UNPKG

ng-tree-antd

Version:
208 lines 31.1 kB
import { Component, Input, Output, EventEmitter, ViewChild, ViewEncapsulation, ContentChild, TemplateRef } from '@angular/core'; import { TreeComponent, TREE_ACTIONS } from 'angular-tree-component'; var NzTreeComponent = (function () { function NzTreeComponent() { this.nzCheckable = false; this.nzAutoExpandParent = false; this.nzAllowChildLinkage = true; this.nzAllowParentLinkage = true; this.nzShowLine = false; this.nzShiftSelectedMulti = true; this.nzToggleExpanded = new EventEmitter(); this.nzActivate = new EventEmitter(); this.nzDeactivate = new EventEmitter(); this.nzFocus = new EventEmitter(); this.nzBlur = new EventEmitter(); this.nzUpdateData = new EventEmitter(); this.nzInitialized = new EventEmitter(); this.nzMoveNode = new EventEmitter(); this.nzCopyNode = new EventEmitter(); this.nzLoadNodeChildren = new EventEmitter(); this.nzChangeFilter = new EventEmitter(); this.nzEvent = new EventEmitter(); this.nzStateChange = new EventEmitter(); this.nzCheck = new EventEmitter(); } Object.defineProperty(NzTreeComponent.prototype, "treeModel", { get: function () { return this.tree.treeModel; }, enumerable: true, configurable: true }); NzTreeComponent.prototype.toggleCheck = function (node) { if (node.data.disableCheckbox) return; node.data.checked = !node.data.checked; node.data.halfChecked = false; this.updateCheckState(node, node.data.checked); this.fireEvent({ eventName: 'check', node: node, checked: node.data.checked }); }; NzTreeComponent.prototype.traverseData = function (nodes, callback) { var traverse = function (subTreeNodes, level, parent) { if (Array.isArray(subTreeNodes)) { subTreeNodes = subTreeNodes.filter(function (item) { return !!item; }); } subTreeNodes.forEach(function (item, index) { // if (!item.children) item.children = []; if (item.children && item.children.length > 0) { traverse(item.children, ++level, item); } callback(item, level, parent, subTreeNodes); }); }; traverse(nodes, 0, null); }; NzTreeComponent.prototype.updateCheckState = function (node, checkIt) { var childLoop = function (parentNode) { if (!parentNode.children) return; for (var _i = 0, _a = parentNode.children; _i < _a.length; _i++) { var childNode = _a[_i]; if (!childNode.data.disableCheckbox) { childNode.data.halfChecked = false; childNode.data.checked = checkIt; } childLoop(childNode); } }; if (this.nzAllowChildLinkage) { childLoop(node); } var parentLoop = function (childNode) { if (!childNode.parent) return; var parentNode = childNode.parent; var childrenCount = parentNode.children.length; var checkedChildrenCount = 0; for (var _i = 0, _a = parentNode.children; _i < _a.length; _i++) { var item = _a[_i]; if (item.data.disableCheckbox) { childrenCount -= 1; continue; } if (item.data.checked === true) checkedChildrenCount++; else if (item.data.halfChecked === true) checkedChildrenCount += 0.5; } if (checkedChildrenCount === childrenCount) { parentNode.data.checked = true; parentNode.data.halfChecked = false; } else if (checkedChildrenCount > 0) { parentNode.data.checked = false; parentNode.data.halfChecked = true; } else { parentNode.data.checked = false; parentNode.data.halfChecked = false; } parentLoop(parentNode); }; if (this.nzAllowParentLinkage) { parentLoop(node); } }; NzTreeComponent.prototype.fireEvent = function (event) { var eventName = event && event.eventName; if (eventName && typeof eventName === 'string') { var emitEventName = 'nz' + (eventName.charAt(0).toUpperCase() + eventName.slice(1)); var emitObj = this[emitEventName]; if (this[emitEventName]) this[emitEventName].emit(event); } this.nzEvent.emit(event); }; NzTreeComponent.prototype.traverseNode = function () { // nzAutoExpandParent var maxLevel = 0; var expand = this.nzAutoExpandParent; if (typeof expand === 'number') { maxLevel = expand; expand = true; } this.traverseData(this.nzNodes, function (node, level, parent, nodes) { // expand if (expand && typeof node.isExpanded === 'undefined') { node.isExpanded = maxLevel === 0 || level <= maxLevel; console.log(node); } // checked if (!parent || node.checked) return; var validNodes = nodes.filter(function (w) { return !w.disableCheckbox; }); var checkCount = validNodes.filter(function (w) { return w.checked; }).length; if (checkCount === 0) return; if (checkCount === validNodes.length) parent.checked = true; else parent.halfChecked = true; }); return this; }; NzTreeComponent.prototype.ngOnInit = function () { console.log('this._options', this._options); }; NzTreeComponent.prototype.ngOnChanges = function (changes) { var actionMapping = {}; if (this.nzShiftSelectedMulti) { actionMapping.mouse = { click: function (tree, node, $event) { $event.shiftKey ? TREE_ACTIONS.TOGGLE_ACTIVE_MULTI(tree, node, $event) : TREE_ACTIONS.TOGGLE_ACTIVE(tree, node, $event); } }; } this._options = Object.assign({ actionMapping: actionMapping, animateExpand: true }, this.nzOptions); if (changes.nzNodes) { this.traverseNode(); } }; NzTreeComponent.decorators = [ { type: Component, args: [{ selector: 'nz-tree', template: "\n <tree-root class=\"ant-tree\" [class.ant-tree-show-line]=\"nzShowLine\" [nodes]=\"nzNodes\" [options]=\"_options\"\n (toggleExpanded)=\"fireEvent($event)\"\n (activate)=\"fireEvent($event)\"\n (deactivate)=\"fireEvent($event)\"\n (focus)=\"fireEvent($event)\"\n (blur)=\"fireEvent($event)\"\n (updateData)=\"fireEvent($event)\"\n (initialized)=\"fireEvent($event)\"\n (moveNode)=\"fireEvent($event)\"\n (copyNode)=\"fireEvent($event)\"\n (loadNodeChildren)=\"fireEvent($event)\"\n (changeFilter)=\"fireEvent($event)\"\n (stateChange)=\"fireEvent($event)\">\n <ng-template #treeNodeFullTemplate let-node let-index=\"index\" let-templates=\"templates\">\n <div\n [class.ant-tree-node]=\"true\"\n [class.ant-tree-node-expanded]=\"node.isExpanded && node.hasChildren\"\n [class.ant-tree-node-collapsed]=\"node.isCollapsed && node.hasChildren\"\n [class.ant-tree-node-leaf]=\"node.isLeaf\"\n [class.ant-tree-node-active]=\"node.isActive\"\n [class.ant-tree-node-focused]=\"node.isFocused\">\n <tree-node-drop-slot *ngIf=\"index === 0\" [dropIndex]=\"node.index\" [node]=\"node.parent\"></tree-node-drop-slot>\n <span\n *ngIf=\"node.hasChildren\"\n [class.ant-tree-switcher_open]=\"node.isExpanded\"\n [class.ant-tree-switcher_close]=\"node.isCollapsed\"\n class=\"ant-tree-switcher\"\n (click)=\"node.mouseAction('expanderClick', $event)\"></span>\n <span\n *ngIf=\"!node.hasChildren\"\n class=\"ant-tree-switcher ant-tree-switcher-noop\">\n </span>\n <span *ngIf=\"nzCheckable\"\n class=\"ant-tree-checkbox\"\n [class.ant-tree-checkbox-checked]=\"node.data.checked\"\n [class.ant-tree-checkbox-disabled]=\"node.data.disableCheckbox\"\n [class.ant-tree-checkbox-indeterminate]=\"node.data.halfChecked\"\n (click)=\"toggleCheck(node)\">\n <span class=\"ant-tree-checkbox-inner\"></span>\n </span>\n <span class=\"ant-tree-node-content-wrapper\"\n [class.ant-tree-node-selected]=\"node.isActive\"\n [class.ant-tree-node-content-wrapper-open]=\"node.isExpanded\"\n [class.ant-tree-node-content-wrapper-close]=\"node.isCollapsed\"\n (click)=\"node.mouseAction('click', $event)\"\n (dblclick)=\"node.mouseAction('dblClick', $event)\"\n (contextmenu)=\"node.mouseAction('contextMenu', $event)\"\n (treeDrop)=\"node.onDrop($event)\"\n (treeDropDragOver)=\"node.mouseAction('dragOver', $event)\"\n (treeDropDragLeave)=\"node.mouseAction('dragLeave', $event)\"\n (treeDropDragEnter)=\"node.mouseAction('dragEnter', $event)\"\n [treeAllowDrop]=\"node.allowDrop\"\n [treeDrag]=\"node\"\n [treeDragEnabled]=\"node.allowDrag()\">\n <span *ngIf=\"!nzTitle\" class=\"ant-tree-title\" [innerHTML]=\"node.displayField\"></span>\n <ng-container\n [ngTemplateOutlet]=\"nzTitle\"\n [ngTemplateOutletContext]=\"{ $implicit:node, node: node, index: index }\">\n </ng-container>\n </span>\n <tree-node-children [node]=\"node\" [templates]=\"templates\"></tree-node-children>\n <tree-node-drop-slot [dropIndex]=\"node.index + 1\" [node]=\"node.parent\"></tree-node-drop-slot>\n </div>\n </ng-template>\n <ng-template #loadingTemplate let-node let-index=\"index\" let-templates=\"templates\"></ng-template>\n </tree-root>\n ", encapsulation: ViewEncapsulation.None, styles: ["/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ /* stylelint-disable declaration-bang-space-before */ /* stylelint-disable declaration-bang-space-before */ @keyframes antCheckboxEffect { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.6); opacity: 0; } } .ant-tree-checkbox { white-space: nowrap; cursor: pointer; outline: none; display: inline-block; line-height: 1; position: relative; vertical-align: text-bottom; } .ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner, .ant-tree-checkbox:hover .ant-tree-checkbox-inner, .ant-tree-checkbox-input:focus + .ant-tree-checkbox-inner { border-color: #108ee9; } .ant-tree-checkbox-checked:after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 2px; border: 1px solid #108ee9; content: ''; animation: antCheckboxEffect 0.36s ease-in-out; animation-fill-mode: both; visibility: hidden; } .ant-tree-checkbox:hover:after, .ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after { visibility: visible; } .ant-tree-checkbox-inner { position: relative; top: 0; left: 0; display: block; width: 14px; height: 14px; border: 1px solid #d9d9d9; border-radius: 2px; background-color: #fff; transition: all .3s; } .ant-tree-checkbox-inner:after { transform: rotate(45deg) scale(0); position: absolute; left: 4px; top: 1px; display: table; width: 5px; height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; content: ' '; transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6); } .ant-tree-checkbox-input { position: absolute; left: 0; z-index: 1; cursor: pointer; opacity: 0; top: 0; bottom: 0; right: 0; width: 100%; height: 100%; } .ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after { content: ' '; transform: scale(1); position: absolute; left: 2px; top: 5px; width: 8px; height: 1px; } .ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after { border-color: rgba(0, 0, 0, 0.25); } .ant-tree-checkbox-checked .ant-tree-checkbox-inner:after { transform: rotate(45deg) scale(1); position: absolute; display: table; border: 2px solid #fff; border-top: 0; border-left: 0; content: ' '; transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s; } .ant-tree-checkbox-checked .ant-tree-checkbox-inner, .ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner { background-color: #108ee9; border-color: #108ee9; } .ant-tree-checkbox-disabled { cursor: not-allowed; } .ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after { animation-name: none; border-color: rgba(0, 0, 0, 0.25); } .ant-tree-checkbox-disabled .ant-tree-checkbox-input { cursor: not-allowed; } .ant-tree-checkbox-disabled .ant-tree-checkbox-inner { border-color: #d9d9d9 !important; background-color: #f7f7f7; } .ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after { animation-name: none; border-color: #f7f7f7; } .ant-tree-checkbox-disabled + span { color: rgba(0, 0, 0, 0.25); cursor: not-allowed; } .ant-tree-checkbox-wrapper { cursor: pointer; font-size: 12px; display: inline-block; } .ant-tree-checkbox-wrapper + .ant-tree-checkbox-wrapper { margin-left: 8px; } .ant-tree-checkbox-wrapper + span, .ant-tree-checkbox + span { padding-left: 8px; padding-right: 8px; } .ant-tree-checkbox-group { font-size: 12px; } .ant-tree-checkbox-group-item { display: inline-block; margin-right: 8px; } .ant-tree-checkbox-group-item:last-child { margin-right: 0; } .ant-tree-checkbox-group-item + .ant-tree-checkbox-group-item { margin-left: 0; } .ant-tree { margin: 0; padding: 0; font-size: 12px; } .ant-tree li { padding: 4px 0; margin: 0; list-style: none; white-space: nowrap; outline: 0; } .ant-tree li span[draggable], .ant-tree li span[draggable=\"true\"] { user-select: none; border-top: 2px transparent solid; border-bottom: 2px transparent solid; margin-top: -2px; /* Required to make elements draggable in old WebKit */ -khtml-user-drag: element; -webkit-user-drag: element; } .ant-tree li.drag-over > span[draggable] { background-color: #108ee9; color: white; opacity: 0.8; } .ant-tree li.drag-over-gap-top > span[draggable] { border-top-color: #108ee9; } .ant-tree li.drag-over-gap-bottom > span[draggable] { border-bottom-color: #108ee9; } .ant-tree li.filter-node > span { color: #f04134 !important; font-weight: 500 !important; } .ant-tree li ul { margin: 0; padding: 0 0 0 18px; } .ant-tree li .ant-tree-node-content-wrapper { display: inline-block; padding: 3px 5px; border-radius: 2px; margin: 0; cursor: pointer; text-decoration: none; vertical-align: top; color: rgba(0, 0, 0, 0.65); transition: all .3s; position: relative; } .ant-tree li .ant-tree-node-content-wrapper:hover { background-color: #ecf6fd; } .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected { background-color: #d2eafb; } .ant-tree li span.ant-tree-checkbox { margin: 0 4px 0 2px; vertical-align: middle; } .ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle { margin: 0; width: 24px; height: 24px; line-height: 24px; display: inline-block; vertical-align: middle; border: 0 none; cursor: pointer; outline: none; text-align: center; } .ant-tree li span.ant-tree-icon_loading { position: absolute; left: 0; top: 1px; background: #fff; transform: translateX(-100%); transition: all .3s; } .ant-tree li span.ant-tree-icon_loading:after { display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e6ae\"; animation: loadingCircle 1s infinite linear; color: #108ee9; } .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop { cursor: default; } .ant-tree li span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; transform: scale(0.58333333) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e606\"; font-weight: bold; transition: transform .3s; } :root .ant-tree li span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; } .ant-tree li span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; transform: scale(0.58333333) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e606\"; font-weight: bold; transition: transform .3s; } :root .ant-tree li span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; } .ant-tree li span.ant-tree-switcher.ant-tree-switcher_close:after { transform: rotate(270deg) scale(0.59); } .ant-tree li:last-child > span.ant-tree-switcher:before, .ant-tree li:last-child > span.ant-tree-iconEle:before { display: none; } .ant-tree > li:first-child { padding-top: 7px; } .ant-tree > li:last-child { padding-bottom: 7px; } .ant-tree-child-tree { display: none; } .ant-tree-child-tree-open { display: block; } li.ant-tree-treenode-disabled > span, li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper, li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper span, li.ant-tree-treenode-disabled > span.ant-tree-switcher { color: rgba(0, 0, 0, 0.25); cursor: not-allowed; } li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper:hover { background: transparent; } .ant-tree-icon__open { margin-right: 2px; vertical-align: top; } .ant-tree-icon__close { margin-right: 2px; vertical-align: top; } .ant-tree.ant-tree-show-line li { position: relative; } .ant-tree.ant-tree-show-line li span.ant-tree-switcher { background: #fff; color: rgba(0, 0, 0, 0.65); } .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher-noop:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e664\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher-noop:after { font-size: 12px; } .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_open { color: rgba(0, 0, 0, 0.43); } .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e621\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; } .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_close { color: rgba(0, 0, 0, 0.43); } .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e645\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line li span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; } .ant-tree.ant-tree-show-line li:not(:last-child):before { content: ' '; width: 1px; border-left: 1px solid #d9d9d9; height: 100%; position: absolute; left: 12px; margin: 18px 0; } ", "/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ /* stylelint-disable declaration-bang-space-before */ /* stylelint-disable declaration-bang-space-before */ @keyframes antCheckboxEffect { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.6); opacity: 0; } } .ant-tree-checkbox { white-space: nowrap; cursor: pointer; outline: none; display: inline-block; line-height: 1; position: relative; vertical-align: text-bottom; } .ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner, .ant-tree-checkbox:hover .ant-tree-checkbox-inner, .ant-tree-checkbox-input:focus + .ant-tree-checkbox-inner { border-color: #108ee9; } .ant-tree-checkbox-checked:after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 2px; border: 1px solid #108ee9; content: ''; animation: antCheckboxEffect 0.36s ease-in-out; animation-fill-mode: both; visibility: hidden; } .ant-tree-checkbox:hover:after, .ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after { visibility: visible; } .ant-tree-checkbox-inner { position: relative; top: 0; left: 0; display: block; width: 14px; height: 14px; border: 1px solid #d9d9d9; border-radius: 2px; background-color: #fff; transition: all .3s; } .ant-tree-checkbox-inner:after { transform: rotate(45deg) scale(0); position: absolute; left: 4px; top: 1px; display: table; width: 5px; height: 8px; border: 2px solid #fff; border-top: 0; border-left: 0; content: ' '; transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6); } .ant-tree-checkbox-input { position: absolute; left: 0; z-index: 1; cursor: pointer; opacity: 0; top: 0; bottom: 0; right: 0; width: 100%; height: 100%; } .ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after { content: ' '; transform: scale(1); position: absolute; left: 2px; top: 5px; width: 8px; height: 1px; } .ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after { border-color: rgba(0, 0, 0, 0.25); } .ant-tree-checkbox-checked .ant-tree-checkbox-inner:after { transform: rotate(45deg) scale(1); position: absolute; display: table; border: 2px solid #fff; border-top: 0; border-left: 0; content: ' '; transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s; } .ant-tree-checkbox-checked .ant-tree-checkbox-inner, .ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner { background-color: #108ee9; border-color: #108ee9; } .ant-tree-checkbox-disabled { cursor: not-allowed; } .ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after { animation-name: none; border-color: rgba(0, 0, 0, 0.25); } .ant-tree-checkbox-disabled .ant-tree-checkbox-input { cursor: not-allowed; } .ant-tree-checkbox-disabled .ant-tree-checkbox-inner { border-color: #d9d9d9 !important; background-color: #f7f7f7; } .ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after { animation-name: none; border-color: #f7f7f7; } .ant-tree-checkbox-disabled + span { color: rgba(0, 0, 0, 0.25); cursor: not-allowed; } .ant-tree-checkbox-wrapper { cursor: pointer; font-size: 12px; display: inline-block; } .ant-tree-checkbox-wrapper + .ant-tree-checkbox-wrapper { margin-left: 8px; } .ant-tree-checkbox-wrapper + span, .ant-tree-checkbox + span { padding-left: 8px; padding-right: 8px; } .ant-tree-checkbox-group { font-size: 12px; } .ant-tree-checkbox-group-item { display: inline-block; margin-right: 8px; } .ant-tree-checkbox-group-item:last-child { margin-right: 0; } .ant-tree-checkbox-group-item + .ant-tree-checkbox-group-item { margin-left: 0; } .ant-tree { margin: 0; padding: 0; font-size: 12px; } .ant-tree span[draggable=\"true\"] { user-select: none; border-top: 2px transparent solid; border-bottom: 2px transparent solid; margin-top: -2px; /* Required to make elements draggable in old WebKit */ -khtml-user-drag: element; -webkit-user-drag: element; } .ant-tree .node-drop-slot { display: block; height: 2px; } .ant-tree .node-drop-slot.is-dragging-over { background-color: #108ee9; } .ant-tree-node { padding: 4px 0; margin: 0; list-style: none; white-space: nowrap; outline: 0; position: relative; } .ant-tree-node .tree-children { margin: 0; padding: 0 0 0 18px; overflow: hidden; } .ant-tree-node .tree-node-loading { position: absolute; left: 1px; top: 5px; background: #fff; transition: all .3s; width: 24px; height: 24px; line-height: 24px; display: inline-block; vertical-align: middle; text-align: center; } .ant-tree-node .tree-node-loading:after { display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e6ae\"; animation: loadingCircle 1s infinite linear; color: #108ee9; } .ant-tree .ant-tree-node-content-wrapper { display: inline-block; padding: 3px 5px; border-radius: 2px; margin: 0; cursor: pointer; text-decoration: none; vertical-align: top; color: rgba(0, 0, 0, 0.65); transition: all .3s; position: relative; user-select: none; } .ant-tree .ant-tree-node-content-wrapper:hover { background-color: #ecf6fd; } .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected { background-color: #d2eafb; } .ant-tree .ant-tree-node-content-wrapper.is-dragging-over { background-color: #108ee9; color: white; opacity: 0.8; } .ant-tree span.ant-tree-checkbox { margin: 0 4px 0 2px; vertical-align: middle; } .ant-tree span.ant-tree-switcher, .ant-tree span.ant-tree-iconEle { margin: 0; width: 24px; height: 24px; line-height: 24px; display: inline-block; vertical-align: middle; border: 0 none; cursor: pointer; outline: none; text-align: center; } .ant-tree span.ant-tree-icon_loading { position: absolute; left: 0; top: 1px; background: #fff; transform: translateX(-100%); transition: all .3s; } .ant-tree span.ant-tree-icon_loading:after { display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e6ae\"; animation: loadingCircle 1s infinite linear; color: #108ee9; } .ant-tree span.ant-tree-switcher.ant-tree-switcher-noop { cursor: default; } .ant-tree span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; transform: scale(0.58333333) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e606\"; font-weight: bold; transition: transform .3s; } :root .ant-tree span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; } .ant-tree span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; transform: scale(0.58333333) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e606\"; font-weight: bold; transition: transform .3s; } :root .ant-tree span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; } .ant-tree span.ant-tree-switcher.ant-tree-switcher_close:after { transform: rotate(270deg) scale(0.59); } .ant-tree:last-child > span.ant-tree-switcher:before, .ant-tree:last-child > span.ant-tree-iconEle:before { display: none; } .ant-tree.ant-tree-show-line .ant-tree-node { position: relative; user-select: none; } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher { background: #fff; color: rgba(0, 0, 0, 0.65); } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher-noop:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e664\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher-noop:after { font-size: 12px; } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_open { color: rgba(0, 0, 0, 0.43); } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e621\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_open:after { font-size: 12px; } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_close { color: rgba(0, 0, 0, 0.43); } .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; transform: scale(1) rotate(0deg); display: inline-block; font-family: 'anticon'; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; content: \"\\e645\"; vertical-align: baseline; font-weight: normal; transition: transform .3s; } :root .ant-tree.ant-tree-show-line .ant-tree-node span.ant-tree-switcher.ant-tree-switcher_close:after { font-size: 12px; } .ant-tree.ant-tree-show-line tree-node:not(:last-child) .ant-tree-node:before { content: ' '; width: 1px; border-left: 1px solid #d9d9d9; height: 100%; position: absolute; left: 11px; margin: 24px 0; } "] },] }, ]; /** @nocollapse */ NzTreeComponent.ctorParameters = function () { return []; }; NzTreeComponent.propDecorators = { "nzNodes": [{ type: Input },], "nzCheckable": [{ type: Input },], "nzAutoExpandParent": [{ type: Input },], "nzAllowChildLinkage": [{ type: Input },], "nzAllowParentLinkage": [{ type: Input },], "nzShowLine": [{ type: Input },], "nzOptions": [{ type: Input },], "nzShiftSelectedMulti": [{ type: Input },], "nzTitle": [{ type: ContentChild, args: ['nzTitle',] },], "nzLoading": [{ type: ContentChild, args: ['nzLoading',] },], "nzToggleExpanded": [{ type: Output },], "nzActivate": [{ type: Output },], "nzDeactivate": [{ type: Output },], "nzFocus": [{ type: Output },], "nzBlur": [{ type: Output },], "nzUpdateData": [{ type: Output },], "nzInitialized": [{ type: Output },], "nzMoveNode": [{ type: Output },], "nzCopyNode": [{ type: Output },], "nzLoadNodeChildren": [{ type: Output },], "nzChangeFilter": [{ type: Output },], "nzEvent": [{ type: Output },], "nzStateChange": [{ type: Output },], "nzCheck": [{ type: Output },], "tree": [{ type: ViewChild, args: [TreeComponent,] },], }; return NzTreeComponent; }()); export { NzTreeComponent }; //# sourceMappingURL=nz-tree.component.js.map