import { __decorate, __metadata } from 'tslib';
import * as i0 from '@angular/core';
import { EventEmitter, forwardRef, Component, Input, ViewChild, ContentChild, Output, NgModule } from '@angular/core';
import * as i4 from '@angular/forms';
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
import * as i2 from 'ng-devui/utils';
import { removeClassFromOrigin, addClassToOrigin, WithConfig, PopperModule } from 'ng-devui/utils';
import { Subject } from 'rxjs';
import { takeUntil, debounceTime, distinctUntilChanged } from 'rxjs/operators';
import * as i1 from 'ng-devui/i18n';
import * as i3 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i5 from 'ng-devui/tree';
import { TreeModule } from 'ng-devui/tree';
import * as i6 from 'ng-devui/search';
import { SearchModule } from 'ng-devui/search';
import { CheckBoxModule } from 'ng-devui/checkbox';
import { LoadingModule } from 'ng-devui/loading';

const DefaultIcons = {
    iconParentClose: `
    <span style="width: 14px; display: inline-block; content: '';">
      <svg
        width="16px"
        height="16px"
        viewBox="0 0 16 16"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        xmlns:xlink="http://www.w3.org/1999/xlink"
      >
        <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
          <path
            d="M3,2 L13,2 C13.5522847,2 14,2.44771525 14,3 L14,13 C14,13.5522847 13.5522847,14 13,14 L3,14 C2.44771525,14 2,13.5522847 2,
            13 L2,3 C2,2.44771525 2.44771525,2 3,2 Z M7,7 L4,7 L4,9 L7,9 L7,12 L9,12 L9,9 L12,9 L12,7 L9,7 L9,4 L7,4 L7,7 Z"
            fill="#5E6678"
            fill-rule="nonzero"
          ></path>
        </g>
      </svg>
    </span>
  `,
    iconParentOpen: `
    <span style="width: 14px; display: inline-block; content: '';">
      <svg
        width="16px"
        height="16px"
        viewBox="0 0 16 16"
        version="1.1"
        xmlns="http://www.w3.org/2000/svg"
        xmlns:xlink="http://www.w3.org/1999/xlink"
      >
        <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
          <path
            d="M3,2 L13,2 C13.5522847,2 14,2.44771525 14,3 L14,13 C14,13.5522847 13.5522847,14 13,14 L3,14 C2.44771525,14 2,13.5522847 2,
            13 L2,3 C2,2.44771525 2.44771525,2 3,2 Z M12,7 L4,7 L4,9 L12,9 L12,7 Z"
            fill="#5E6678"
            fill-rule="nonzero"
          ></path>
        </g>
      </svg>
    </span>
  `,
    iconLeaf: `
    <span style="width: 14px; display: inline-block; content: '';"></span>
  `
};
var DefaultIcons$1 = Object.assign({}, DefaultIcons);

class TreeSelectComponent {
    constructor(renderer, changeDetectorRef, i18n, devConfigService) {
        this.renderer = renderer;
        this.changeDetectorRef = changeDetectorRef;
        this.i18n = i18n;
        this.devConfigService = devConfigService;
        this.checkableRelation = 'both';
        this.showAnimation = true;
        this.placeholder = '';
        this.disabled = false;
        this.expandTree = false;
        this.multiple = false;
        this.treeNodeIdKey = 'id';
        this.treeNodeChildrenKey = 'children';
        this.treeNodeTitleKey = 'title';
        this.disabledKey = 'disabled';
        this.leafOnly = false;
        this.delimiter = ', '; // 废弃
        this.iconParentOpen = DefaultIcons$1.iconParentOpen;
        this.iconParentClose = DefaultIcons$1.iconParentClose;
        this.iconLeaf = DefaultIcons$1.iconLeaf;
        this.closeOnNodeSelected = true;
        this.width = null;
        this.searchable = false;
        this.appendTo = 'body';
        this.allowUnselect = true;
        this.enableLabelization = true;
        this.customViewDirection = 'bottom';
        // TODO: need to change to nodeToggledEvent
        this.nodeToggleEvent = new EventEmitter();
        this.valueChanged = new EventEmitter();
        this.virtualScroll = false;
        this.virtualScrollItemSize = 30;
        this.virtualScrollMinBufferPx = 300;
        this.virtualScrollMaxBufferPx = 600;
        this.virtualScrollHeightPx = 300;
        this._treeData = [];
        this.searchString = null;
        this.noRecord = false;
        this.destroy$ = new Subject();
        this._isOpen = false;
        this._sourceTree = [];
        this.readyEvent = (treeSelect) => { };
        this.onChange = (_) => null;
        this.onTouch = () => null;
    }
    set allowClear(allowClear) {
        // 废弃
        this._allowClear = allowClear;
    }
    get allowClear() {
        return !this.disabled && !this.multiple && !this.enableLabelization && this.allowUnselect && this._allowClear && !!this.selectedValue;
    }
    set treeData(treeData) {
        this._sourceTree = treeData;
        this.refreshTree(treeData);
    }
    get treeData() {
        return this._treeData;
    }
    get isOpen() {
        return this._isOpen;
    }
    set isOpen(value) {
        if (this._isOpen !== value) {
            this._isOpen = value;
            if (!value) {
                removeClassFromOrigin(this.selectHost);
                this.onTouch();
            }
            else {
                addClassToOrigin(this.selectHost);
            }
            this.changeDetectorRef.detectChanges();
        }
    }
    set value(val) {
        this._value = val;
        if (val && Array.isArray(val) && val.length) {
            this.valueType = 'array';
            this.valueLength = val.length;
        }
        else if (val && Object.keys(val).length) {
            this.valueType = 'object';
        }
        else {
            this.valueType = undefined;
        }
    }
    get value() {
        return this._value;
    }
    ngAfterViewInit() {
        this.changeDetectorRef.detectChanges();
        this.readyEvent(this);
        if (this.searchable) {
            this.registerSearchListener();
        }
    }
    ngOnChanges(changes) { }
    ngOnDestroy() {
        if (this.i18nSubscription) {
            this.i18nSubscription.unsubscribe();
        }
        this.isOpen = false; // 销毁Popper
        this.destroy$.next();
        this.destroy$.complete();
    }
    ngOnInit() {
        this.setI18nText();
        this.queryMedia();
    }
    afterTreeInit() {
        if (this.virtualScroll) {
            this.tree.treeFactory.flattenNodes.pipe(takeUntil(this.destroy$)).subscribe((data) => {
                const treeNodeOnDisplay = data.filter((node) => !(node.data.isHide || node.data.hideInVirtualScroll));
                this.validVirtualScrollHeight = Math.min(treeNodeOnDisplay.length * this.virtualScrollItemSize, this.virtualScrollHeightPx);
            });
        }
    }
    registerOnChange(fn) {
        this.onChange = fn;
    }
    registerOnTouched(fn) {
        this.onTouch = fn;
    }
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
    }
    writeValue(value) {
        this.value = this.multiple ? Object.assign([], value) : value;
        this.refreshTree(this.treeData);
        // Trigger visualization after tree data is fulfilled.
        this.changeDetectorRef.detectChanges();
        this.visualizeSelectedItems();
    }
    toggle() {
        if (this.disabled) {
            return;
        }
        if (this.timer) {
            clearTimeout(this.timer);
        }
        const applyNow = !this.timer;
        this.timer = setTimeout(() => {
            this.timer = null;
        }, 200);
        if (applyNow) {
            this.isOpen = !this.isOpen;
        }
    }
    setI18nText() {
        this.i18nCommonText = this.i18n.getI18nText().common;
        this.i18nSubscription = this.i18n.langChange().subscribe((data) => {
            this.i18nCommonText = data.common;
        });
    }
    queryMedia() {
        if (typeof window === 'undefined') {
            return;
        }
        const userAgent = window.navigator.userAgent;
        if (userAgent.indexOf('Edge') > -1) {
            this.userAgent = 'edge';
        }
        else if (userAgent.indexOf('MSIE') > -1 || userAgent.indexOf('Trident/') > -1) {
            this.userAgent = 'ie';
        }
        else if (userAgent.indexOf('Firefox') > -1) {
            this.userAgent = 'firefox';
        }
        else {
            this.userAgent = 'chrome';
        }
    }
    prepareTree(treeNode, expandTree = false) {
        if (Array.isArray(treeNode)) {
            return treeNode.map((node) => this.prepareTree(node, expandTree));
        }
        else if (treeNode) {
            let parentCheckedByChildren = false;
            if (Object.prototype.hasOwnProperty.call(treeNode, this.treeNodeChildrenKey)) {
                treeNode.open = expandTree ? true : treeNode.open;
                treeNode[this.treeNodeChildrenKey] = this.prepareTree(treeNode[this.treeNodeChildrenKey], expandTree);
                if (this.multiple) {
                    [parentCheckedByChildren, treeNode.halfChecked] = this.resolveParentNode(treeNode[this.treeNodeChildrenKey]);
                }
            }
            if (Object.prototype.hasOwnProperty.call(treeNode, this.treeNodeIdKey)) {
                const nodeId = treeNode[this.treeNodeIdKey];
                if (this.multiple) {
                    const selectedByValue = this.nodeSelected(nodeId);
                    treeNode.isActive = false;
                    treeNode.isChecked = selectedByValue || parentCheckedByChildren;
                    if (!this.leafOnly && !selectedByValue && parentCheckedByChildren) {
                        const insertObject = {};
                        insertObject[this.treeNodeIdKey] = treeNode[this.treeNodeIdKey];
                        insertObject[this.treeNodeTitleKey] = treeNode[this.treeNodeTitleKey];
                        this.value.push(insertObject);
                        // 赋值触发setValue设置valueType和valueLength
                        /* eslint-disable-next-line no-self-assign*/
                        this.value = this.value;
                    }
                }
                else {
                    treeNode.isChecked = false;
                    treeNode.isActive = this.nodeSelected(nodeId);
                    if (treeNode.isActive) {
                        this.currentActiveNode = treeNode;
                    }
                }
            }
            return treeNode;
        }
    }
    nodeSelected(treeNodeId) {
        if (!this.value) {
            return false;
        }
        if (this.multiple && Array.isArray(this.value)) {
            // polyfill Array.prototype.includes()
            return this.value.map((_) => _[this.treeNodeIdKey]).indexOf(treeNodeId) > -1;
        }
        else {
            return this.value[this.treeNodeIdKey] && treeNodeId === this.value[this.treeNodeIdKey];
        }
    }
    resolveParentNode(treeNodes) {
        const enableParentNodeCheckByChild = this.checkableRelation === 'both' || this.checkableRelation === 'upward';
        const childrenFullCheckedCount = enableParentNodeCheckByChild && treeNodes.filter((_) => _.isChecked).length;
        const childrenCheckedCount = enableParentNodeCheckByChild && treeNodes.filter((_) => _.isChecked || _.halfChecked).length;
        return [
            childrenFullCheckedCount > 0 && treeNodes.length === childrenFullCheckedCount,
            childrenCheckedCount > 0 && treeNodes.length > childrenFullCheckedCount,
        ];
    }
    refreshTree(treeData) {
        this._treeData = Object.assign([], this.prepareTree(treeData, this.expandTree));
    }
    onOperableNodeChecked(selectedNodes) {
        const selectedValueExtractor = (_selectedNodes) => {
            return this.leafOnly
                ? _selectedNodes.filter((_) => !_.data.isParent).map((_) => _.data.originItem)
                : _selectedNodes.map((_) => _.data.originItem);
        };
        if (this.multiple) {
            this.value = selectedValueExtractor(selectedNodes);
            this.emitEvents();
        }
    }
    onOperableNodeSelected(selectedNode) {
        const node = selectedNode;
        if (!this.multiple) {
            if (this.leafOnly && node.data.isParent) {
                return;
            }
            if (node.data.isActive) {
                this.currentActiveNode = node.data.originItem;
                this.value = node.data.originItem;
                // Configurable close on node selected
                if (this.closeOnNodeSelected) {
                    this.isOpen = false;
                }
            }
            else {
                if (this.allowUnselect) {
                    this.currentActiveNode = null;
                    this.value = null;
                }
                else {
                    node.data.isActive = true;
                    if (this.closeOnNodeSelected) {
                        this.isOpen = false;
                    }
                }
            }
            this.emitEvents();
        }
    }
    emitEvents() {
        this.visualizeSelectedItems();
        this.onChange(this.value);
        this.valueChanged.emit(this.selectedValue());
    }
    visualizeSelectedItems() {
        if (this.multiple) {
            this.visualizeMultipleValue();
        }
        else {
            this.visualizeSingleValue();
        }
    }
    visualizeMultipleValue() {
        if (this.tree && this.tree.treeFactory) {
            const selectedNodes = this.selectedValue();
            const valueText = selectedNodes.map((_) => _[this.treeNodeTitleKey]);
            this.displayValue = valueText;
        }
        else {
            this.emptyInput();
        }
    }
    visualizeSingleValue() {
        if (this.value && this.value[this.treeNodeTitleKey]) {
            const valueText = this.value[this.treeNodeTitleKey];
            this.displayValue = valueText;
        }
        else {
            this.emptyInput();
        }
    }
    emptyInput() {
        this.displayValue = '';
    }
    selectedValue() {
        return this.value;
    }
    responsePopperChange(popperState) {
        if (popperState && this.searchable) {
            this.focusSearchInput();
        }
        if (popperState && this.virtualScroll && this.tree) {
            this.tree.operableTree.viewPort.checkViewportSize();
        }
    }
    focusSearchInput() {
        if (this.searchInput.filterInputElement.nativeElement) {
            this.searchInput.filterInputElement.nativeElement.focus();
        }
    }
    search(searchString) {
        const searchRes = this.tree.treeFactory.searchTree(searchString, true);
        if (typeof searchRes === 'boolean') {
            this.noRecord = searchRes;
        }
        else if (Array.isArray(searchRes)) {
            this.noRecord = searchRes.every((res) => !res);
        }
        this.tree.treeFactory.getFlattenNodes();
        this.popper.update();
    }
    registerSearchListener() {
        this.searchInputModel.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe((searchString) => {
            this.search(searchString);
        });
    }
    clearValue(event, item, index) {
        event.preventDefault();
        event.stopPropagation();
        if (this.multiple) {
            this.tree.treeFactory.checkNodesById(item[this.treeNodeIdKey], false);
            const curValue = this.tree.treeFactory.getCheckedNodes();
            this.value = this.leafOnly
                ? curValue.filter((node) => !node.data.isParent).map((node) => node.data.originItem)
                : curValue.map((node) => node.data.originItem);
        }
        else {
            this.clearAll();
        }
        this.emitEvents();
    }
    clearAll() {
        this.tree.treeFactory.deactivateAllNodes();
        this.currentActiveNode = null;
        this.value = null;
    }
    onNodeToggled($event) {
        if (this.popper) {
            this.popper.update();
        }
        this.nodeToggleEvent.emit($event);
    }
}
TreeSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.I18nService }, { token: i2.DevConfigService }], target: i0.ɵɵFactoryTarget.Component });
TreeSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: TreeSelectComponent, selector: "d-tree-select", inputs: { checkableRelation: "checkableRelation", allowClear: "allowClear", treeData: "treeData", showAnimation: "showAnimation", placeholder: "placeholder", disabled: "disabled", expandTree: "expandTree", multiple: "multiple", treeNodeIdKey: "treeNodeIdKey", treeNodeChildrenKey: "treeNodeChildrenKey", treeNodeTitleKey: "treeNodeTitleKey", disabledKey: "disabledKey", leafOnly: "leafOnly", delimiter: "delimiter", iconParentOpen: "iconParentOpen", iconParentClose: "iconParentClose", iconLeaf: "iconLeaf", closeOnNodeSelected: "closeOnNodeSelected", width: "width", searchable: "searchable", appendTo: "appendTo", allowUnselect: "allowUnselect", iconTemplatePosition: "iconTemplatePosition", iconTemplateInput: "iconTemplateInput", enableLabelization: "enableLabelization", customItemTemplate: "customItemTemplate", customViewTemplate: "customViewTemplate", customViewDirection: "customViewDirection", virtualScroll: "virtualScroll", virtualScrollItemSize: "virtualScrollItemSize", virtualScrollMinBufferPx: "virtualScrollMinBufferPx", virtualScrollMaxBufferPx: "virtualScrollMaxBufferPx", virtualScrollHeightPx: "virtualScrollHeightPx", readyEvent: "readyEvent" }, outputs: { nodeToggleEvent: "nodeToggleEvent", valueChanged: "valueChanged" }, providers: [
        {
            provide: NG_VALUE_ACCESSOR,
            useExisting: forwardRef(() => TreeSelectComponent),
            multi: true,
        },
    ], queries: [{ propertyName: "iconTemplatePassThrough", first: true, predicate: ["iconTemplate"], descendants: true }], viewQueries: [{ propertyName: "selectHost", first: true, predicate: ["selectHost"], descendants: true, static: true }, { propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true, static: true }, { propertyName: "tree", first: true, predicate: ["tree"], descendants: true, static: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "searchInputModel", first: true, predicate: ["searchInputModel"], descendants: true }, { propertyName: "popper", first: true, predicate: ["popper"], descendants: true, static: true }], exportAs: ["select"], usesOnChanges: true, ngImport: i0, template: "<div class=\"devui-tree-select {{ userAgent }}\">\r\n  <d-popper-component\r\n    [poppoverAppendDirection]=\"customViewDirection\"\r\n    [(open)]=\"isOpen\"\r\n    [fluidPopper]=\"!width\"\r\n    (openChange)=\"responsePopperChange($event)\"\r\n    [appendTo]=\"appendTo\"\r\n    [showAnimation]=\"showAnimation\"\r\n    #popper\r\n  >\r\n    <div\r\n      #selectHost\r\n      class=\"devui-select-input devui-form-control devui-tree-select-input devui-dropdown-origin\"\r\n      (click)=\"toggle()\"\r\n      autocomplete=\"off\"\r\n      [ngClass]=\"{ disabled: disabled, 'devui-select-no-label': !enableLabelization }\"\r\n      readonly\r\n      popper-activator\r\n    >\r\n      {{ !valueType ? placeholder : '' }}\r\n      <div class=\"devui-select-item\" *ngIf=\"valueType === 'object' && enableLabelization && !customItemTemplate\">\r\n        <span class=\"devui-select-item-content\">{{ value[treeNodeTitleKey] }}</span>\r\n        <span *ngIf=\"!disabled\" class=\"devui-select-item-clear-icon\" (click)=\"clearValue($event, value)\">\r\n          <svg\r\n            width=\"6px\"\r\n            height=\"6px\"\r\n            viewBox=\"0 0 10 10\"\r\n            version=\"1.1\"\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n          >\r\n            <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n              <g transform=\"translate(-3.000000, -3.000000)\" fill-rule=\"nonzero\">\r\n                <path\r\n                  d=\"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z\"\r\n                ></path>\r\n              </g>\r\n            </g>\r\n          </svg>\r\n        </span>\r\n      </div>\r\n      <div class=\"devui-select-item devui-no-label-item\" *ngIf=\"valueType === 'object' && !enableLabelization && !customItemTemplate\">\r\n        {{ value[treeNodeTitleKey] }}\r\n      </div>\r\n      <div class=\"devui-select-item devui-no-label-item\" *ngIf=\"valueType === 'object' && customItemTemplate\">\r\n        <ng-template [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ item: value }\"></ng-template>\r\n      </div>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && enableLabelization && !customItemTemplate\">\r\n        <li class=\"devui-select-item\" *ngFor=\"let item of value; let i = index\">\r\n          <span class=\"devui-select-item-content\">{{ item[treeNodeTitleKey] }}</span>\r\n          <span *ngIf=\"!disabled\" class=\"devui-select-item-clear-icon\" (click)=\"clearValue($event, item, i)\">\r\n            <svg\r\n              width=\"6px\"\r\n              height=\"6px\"\r\n              viewBox=\"0 0 10 10\"\r\n              version=\"1.1\"\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n              xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n            >\r\n              <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n                <g transform=\"translate(-3.000000, -3.000000)\" fill-rule=\"nonzero\">\r\n                  <path\r\n                    d=\"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z\"\r\n                  ></path>\r\n                </g>\r\n              </g>\r\n            </svg>\r\n          </span>\r\n        </li>\r\n      </ul>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && !enableLabelization && !customItemTemplate\">\r\n        <li class=\"devui-select-item devui-no-label-item\" *ngFor=\"let item of value; let i = index\">\r\n          {{ item[treeNodeTitleKey] }}\r\n          <span *ngIf=\"valueLength && i < valueLength - 1\">, </span>\r\n        </li>\r\n      </ul>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && customItemTemplate\">\r\n        <li class=\"devui-select-item devui-no-label-item\" *ngFor=\"let item of value\">\r\n          <ng-template [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ item: item }\"></ng-template>\r\n        </li>\r\n      </ul>\r\n    </div>\r\n    <div popper-prepend class=\"devui-tree-select devui-search-container devui-form-group devui-has-feedback\" *ngIf=\"searchable\">\r\n      <d-search #searchInputModel=\"ngModel\" #searchInput [(ngModel)]=\"searchString\" [placeholder]=\"''\"></d-search>\r\n    </div>\r\n    <div\r\n      class=\"devui-tree-select devui-options-container\"\r\n      #optionsContainer\r\n      popper-container\r\n      [ngStyle]=\"{ width: width, maxHeight: validVirtualScrollHeight === undefined ? '300px' : validVirtualScrollHeight + 'px' }\"\r\n    >\r\n      <d-operable-tree\r\n        #tree\r\n        [style.display]=\"treeData && treeData.length > 0 && !noRecord ? 'block' : 'none'\"\r\n        [tree]=\"treeData\"\r\n        [treeNodeIdKey]=\"treeNodeIdKey\"\r\n        [treeNodeChildrenKey]=\"treeNodeChildrenKey\"\r\n        [checkboxDisabledKey]=\"disabledKey\"\r\n        [checkboxInput]=\"checkboxInput\"\r\n        [checkable]=\"multiple\"\r\n        [checkableRelation]=\"checkableRelation\"\r\n        [canActivateNode]=\"!multiple\"\r\n        [canActivateParentNode]=\"!leafOnly\"\r\n        (nodeChecked)=\"onOperableNodeChecked($event)\"\r\n        (nodeSelected)=\"onOperableNodeSelected($event)\"\r\n        (nodeToggled)=\"onNodeToggled($event)\"\r\n        [iconParentOpen]=\"iconParentOpen\"\r\n        [iconParentClose]=\"iconParentClose\"\r\n        [iconLeaf]=\"iconLeaf\"\r\n        [treeNodeTitleKey]=\"treeNodeTitleKey\"\r\n        [iconTemplatePosition]=\"iconTemplatePosition\"\r\n        [virtualScroll]=\"virtualScroll\"\r\n        [itemSize]=\"virtualScrollItemSize\"\r\n        [minBufferPx]=\"virtualScrollMinBufferPx\"\r\n        [maxBufferPx]=\"virtualScrollMaxBufferPx\"\r\n        [virtualScrollHeight]=\"validVirtualScrollHeight + 'px'\"\r\n        (afterTreeInit)=\"afterTreeInit()\"\r\n        class=\"devui-tree\"\r\n      >\r\n        <ng-template *ngIf=\"iconTemplateInput || iconTemplatePassThrough\" #iconTemplate let-node=\"node\">\r\n          <ng-template [ngTemplateOutlet]=\"iconTemplateInput || iconTemplatePassThrough\" [ngTemplateOutletContext]=\"{ node: node }\">\r\n          </ng-template>\r\n        </ng-template>\r\n      </d-operable-tree>\r\n      <div *ngIf=\"!treeData || treeData.length <= 0\" class=\"devui-no-data-tip\">\r\n        {{ i18nCommonText?.noData }}\r\n      </div>\r\n      <div *ngIf=\"noRecord\" class=\"devui-no-data-tip\">\r\n        {{ i18nCommonText?.noRecordsFound }}\r\n      </div>\r\n    </div>\r\n\r\n    <!-- \u81EA\u5B9A\u4E49\u533A\u57DF -->\r\n    <div popper-append *ngIf=\"customViewTemplate\">\r\n      <ng-template [ngTemplateOutlet]=\"customViewTemplate\" [ngTemplateOutletContext]=\"{ $implicit: this }\"></ng-template>\r\n    </div>\r\n  </d-popper-component>\r\n  <div\r\n    [ngClass]=\"{ disabled: disabled, clear: allowClear }\"\r\n    (click)=\"$event.stopPropagation(); $event.preventDefault(); clearAll(); emitEvents()\"\r\n  ></div>\r\n  <span\r\n    class=\"devui-select-chevron-icon\"\r\n    [class.open]=\"isOpen\"\r\n    [ngClass]=\"{ disabled: disabled, 'allow-clear': allowClear, 'devui-select-chevron-icon-animation': showAnimation }\"\r\n  >\r\n    <svg\r\n      width=\"14px\"\r\n      height=\"14px\"\r\n      viewBox=\"0 0 16 16\"\r\n      version=\"1.1\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n    >\r\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <path\r\n          d=\"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z\"\r\n          fill-rule=\"nonzero\"\r\n        ></path>\r\n      </g>\r\n    </svg>\r\n  </span>\r\n</div>\r\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.edge.devui-tree-select:hover .clear,.ie.devui-tree-select:hover .clear,.firefox.devui-tree-select:hover .clear,.edge.devui-tree-select .devui-select-chevron-icon,.ie.devui-tree-select .devui-select-chevron-icon,.firefox.devui-tree-select .devui-select-chevron-icon{right:20px}.devui-tree-select{position:relative;width:100%}.devui-tree-select .devui-select-input:not([disabled]){color:#252b3a;color:var(--devui-text, #252b3a)}.devui-tree-select .devui-select-input.devui-tree-select-input{font-size:12px;font-size:var(--devui-font-size, 12px);padding:2px 32px 2px 2px;height:auto;height:initial;min-height:28px;max-height:52px;overflow-y:auto;line-height:22px;display:flex;text-indent:8px}.devui-tree-select .devui-select-input.devui-tree-select-input.devui-select-no-label{padding-left:10px}.devui-tree-select:hover .clear{position:absolute;height:14px;width:14px;right:12px;top:calc((100% - 14px)/2);cursor:pointer;z-index:1}.devui-tree-select:hover .clear:after,.devui-tree-select:hover .clear:before{position:absolute;content:\"\";height:14px;width:2px;background-color:#71757f;background-color:var(--devui-icon-text, #71757f);left:50%}.devui-tree-select:hover .clear:before{transform:rotate(45deg)}.devui-tree-select:hover .clear:after{transform:rotate(-45deg)}.devui-tree-select:hover .clear:hover:after,.devui-tree-select:hover .clear:hover:before{background-color:#252b3a;background-color:var(--devui-icon-fill-active, #252b3a)}.devui-tree-select:hover .allow-clear{opacity:0}.devui-tree-select .devui-select-chevron-icon{right:12px;top:calc((100% - 14px)/2);position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;height:14px;line-height:14px;z-index:1}.devui-tree-select .devui-select-chevron-icon svg path{fill:#575d6c;fill:var(--devui-text-weak, #575d6c)}.devui-tree-select .devui-select-chevron-icon-animation svg{transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-tree-select .devui-select-chevron-icon.open{z-index:1052;z-index:var(--devui-z-index-dropdown, 1052)}.devui-tree-select .devui-select-chevron-icon.open svg{transform:rotate(180deg)}.devui-tree-select .devui-select-chevron-icon.clear{opacity:0}.devui-tree-select .devui-select-chevron-icon.disabled svg path{fill:#cfd0d3;fill:var(--devui-disabled-text, #cfd0d3)}.devui-tree-select:not(:hover) .devui-select-chevron-icon:not(.disabled){opacity:1;transition:opacity .1s cubic-bezier(0,0,1,1);transition:opacity var(--devui-animation-duration-fast, .1s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.devui-tree-select.devui-options-container{width:100%;color:#252b3a;color:var(--devui-text, #252b3a);padding-left:8px}.devui-select-item{color:#252b3a;color:var(--devui-text, #252b3a);line-height:16px;background-color:#e9edfa;background-color:var(--devui-label-bg, #e9edfa);border-radius:2px;border-radius:var(--devui-border-radius, 2px);border:1px solid #e9edfa;border:1px solid var(--devui-label-bg, #e9edfa);display:inline-block;max-width:100%;min-height:20px;height:20px;max-height:20px;margin:1px;padding:0 5px;position:relative;text-indent:0}.devui-select-item.devui-no-label-item{padding:1px 0;background:transparent;border-color:transparent;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.devui-select-item .devui-select-item-content{display:inline-block;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:baseline;height:18px;line-height:18px;max-width:100%;padding-right:30px;position:relative}.devui-select-item .devui-select-item-content:hover{color:#252b3a;color:var(--devui-list-item-hover-text, #252b3a)}.devui-select-item>.devui-select-item-clear-icon{width:12px;height:12px;line-height:12px;text-align:center;margin-left:12px;border-radius:50%;background-color:#d7d8da;background-color:var(--devui-line, #d7d8da);display:inline-flex;justify-content:center;align-items:center;cursor:pointer;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:transform .2s ease;transition:transform var(--devui-animation-duration-base, .2s) ease}.devui-select-item>.devui-select-item-clear-icon svg path{fill:#fff;fill:var(--devui-light-text, #ffffff)}.devui-select-item>.devui-select-item-clear-icon:hover{background-color:#252b3a;background-color:var(--devui-icon-fill-active-hover, #252b3a)}.devui-select-list{display:flex;flex-wrap:wrap}svg.svg-icon-search path{fill:#575d6c;fill:var(--devui-text-weak, #575d6c)}:host{display:inline-block;width:100%}.devui-select-input.devui-tree-select-input.disabled{color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item{background-color:#f5f5f5;background-color:var(--devui-disabled-bg, #f5f5f5);border-color:#dfe1e6;border-color:var(--devui-disabled-line, #dfe1e6)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item.devui-no-label-item{background-color:transparent;border-color:transparent;color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content:hover,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content:focus{color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed;padding-right:0}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:hover,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:focus{background-color:#dfe1e6;background-color:var(--devui-disabled-line, #dfe1e6);cursor:not-allowed}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon svg path,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:hover svg path,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:focus svg path{fill:#f5f5f5;fill:var(--devui-disabled-bg, #f5f5f5)}.devui-tree-select .devui-select-input.devui-tree-select-input:not(.icon):not([class^=icon-]):not([disabled]):not(.disabled):not(.devui-disabled){color:#babbc0;color:var(--devui-placeholder, #babbc0)}::ng-deep .devui-tree-select.devui-search-container d-search{width:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.OperableTreeComponent, selector: "d-operable-tree", inputs: ["tree", "treeNodeIdKey", "treeNodeChildrenKey", "checkboxDisabledKey", "selectDisabledKey", "toggleDisabledKey", "iconParentOpen", "iconParentClose", "iconLeaf", "showLoading", "loadingTemplateRef", "treeNodesRef", "checkable", "deletable", "addable", "editable", "draggable", "checkboxInput", "beforeAddNode", "disableMouseEvent", "beforeDeleteNode", "beforeNodeDrop", "beforeEditNode", "canActivateNode", "canActivateParentNode", "canActivateMultipleNode", "treeNodeTitleKey", "postAddNode", "iconTemplatePosition", "virtualScroll", "virtualScrollHeight", "showAnimation", "itemSize", "minBufferPx", "maxBufferPx", "checkableRelation", "dropType"], outputs: ["nodeSelected", "nodeDblClicked", "nodeRightClicked", "nodeToggled", "afterTreeInit", "nodeDeleted", "nodeChecked", "currentNodeChecked", "nodeEdited", "editValueChange", "nodeDragStart", "nodeOnDrop"], exportAs: ["dOperableTreeComponent"] }, { kind: "component", type: i2.PopperComponent, selector: "d-popper-component", inputs: ["open", "fluidPopper", "poppoverAppendDirection", "appendTo", "extraConfig", "showAnimation"], outputs: ["openChange"] }, { kind: "component", type: i6.SearchComponent, selector: "d-search", inputs: ["size", "placeholder", "maxLength", "isKeyupSearch", "delay", "disabled", "cssClass", "iconPosition", "noBorder", "autoFocus"], outputs: ["searchFn"], exportAs: ["search"] }] });
__decorate([
    WithConfig(),
    __metadata("design:type", Object)
], TreeSelectComponent.prototype, "showAnimation", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-tree-select', exportAs: 'select', providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => TreeSelectComponent),
                            multi: true,
                        },
                    ], preserveWhitespaces: false, template: "<div class=\"devui-tree-select {{ userAgent }}\">\r\n  <d-popper-component\r\n    [poppoverAppendDirection]=\"customViewDirection\"\r\n    [(open)]=\"isOpen\"\r\n    [fluidPopper]=\"!width\"\r\n    (openChange)=\"responsePopperChange($event)\"\r\n    [appendTo]=\"appendTo\"\r\n    [showAnimation]=\"showAnimation\"\r\n    #popper\r\n  >\r\n    <div\r\n      #selectHost\r\n      class=\"devui-select-input devui-form-control devui-tree-select-input devui-dropdown-origin\"\r\n      (click)=\"toggle()\"\r\n      autocomplete=\"off\"\r\n      [ngClass]=\"{ disabled: disabled, 'devui-select-no-label': !enableLabelization }\"\r\n      readonly\r\n      popper-activator\r\n    >\r\n      {{ !valueType ? placeholder : '' }}\r\n      <div class=\"devui-select-item\" *ngIf=\"valueType === 'object' && enableLabelization && !customItemTemplate\">\r\n        <span class=\"devui-select-item-content\">{{ value[treeNodeTitleKey] }}</span>\r\n        <span *ngIf=\"!disabled\" class=\"devui-select-item-clear-icon\" (click)=\"clearValue($event, value)\">\r\n          <svg\r\n            width=\"6px\"\r\n            height=\"6px\"\r\n            viewBox=\"0 0 10 10\"\r\n            version=\"1.1\"\r\n            xmlns=\"http://www.w3.org/2000/svg\"\r\n            xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n          >\r\n            <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n              <g transform=\"translate(-3.000000, -3.000000)\" fill-rule=\"nonzero\">\r\n                <path\r\n                  d=\"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z\"\r\n                ></path>\r\n              </g>\r\n            </g>\r\n          </svg>\r\n        </span>\r\n      </div>\r\n      <div class=\"devui-select-item devui-no-label-item\" *ngIf=\"valueType === 'object' && !enableLabelization && !customItemTemplate\">\r\n        {{ value[treeNodeTitleKey] }}\r\n      </div>\r\n      <div class=\"devui-select-item devui-no-label-item\" *ngIf=\"valueType === 'object' && customItemTemplate\">\r\n        <ng-template [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ item: value }\"></ng-template>\r\n      </div>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && enableLabelization && !customItemTemplate\">\r\n        <li class=\"devui-select-item\" *ngFor=\"let item of value; let i = index\">\r\n          <span class=\"devui-select-item-content\">{{ item[treeNodeTitleKey] }}</span>\r\n          <span *ngIf=\"!disabled\" class=\"devui-select-item-clear-icon\" (click)=\"clearValue($event, item, i)\">\r\n            <svg\r\n              width=\"6px\"\r\n              height=\"6px\"\r\n              viewBox=\"0 0 10 10\"\r\n              version=\"1.1\"\r\n              xmlns=\"http://www.w3.org/2000/svg\"\r\n              xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n            >\r\n              <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n                <g transform=\"translate(-3.000000, -3.000000)\" fill-rule=\"nonzero\">\r\n                  <path\r\n                    d=\"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z\"\r\n                  ></path>\r\n                </g>\r\n              </g>\r\n            </svg>\r\n          </span>\r\n        </li>\r\n      </ul>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && !enableLabelization && !customItemTemplate\">\r\n        <li class=\"devui-select-item devui-no-label-item\" *ngFor=\"let item of value; let i = index\">\r\n          {{ item[treeNodeTitleKey] }}\r\n          <span *ngIf=\"valueLength && i < valueLength - 1\">, </span>\r\n        </li>\r\n      </ul>\r\n      <ul class=\"devui-select-list\" *ngIf=\"valueType === 'array' && customItemTemplate\">\r\n        <li class=\"devui-select-item devui-no-label-item\" *ngFor=\"let item of value\">\r\n          <ng-template [ngTemplateOutlet]=\"customItemTemplate\" [ngTemplateOutletContext]=\"{ item: item }\"></ng-template>\r\n        </li>\r\n      </ul>\r\n    </div>\r\n    <div popper-prepend class=\"devui-tree-select devui-search-container devui-form-group devui-has-feedback\" *ngIf=\"searchable\">\r\n      <d-search #searchInputModel=\"ngModel\" #searchInput [(ngModel)]=\"searchString\" [placeholder]=\"''\"></d-search>\r\n    </div>\r\n    <div\r\n      class=\"devui-tree-select devui-options-container\"\r\n      #optionsContainer\r\n      popper-container\r\n      [ngStyle]=\"{ width: width, maxHeight: validVirtualScrollHeight === undefined ? '300px' : validVirtualScrollHeight + 'px' }\"\r\n    >\r\n      <d-operable-tree\r\n        #tree\r\n        [style.display]=\"treeData && treeData.length > 0 && !noRecord ? 'block' : 'none'\"\r\n        [tree]=\"treeData\"\r\n        [treeNodeIdKey]=\"treeNodeIdKey\"\r\n        [treeNodeChildrenKey]=\"treeNodeChildrenKey\"\r\n        [checkboxDisabledKey]=\"disabledKey\"\r\n        [checkboxInput]=\"checkboxInput\"\r\n        [checkable]=\"multiple\"\r\n        [checkableRelation]=\"checkableRelation\"\r\n        [canActivateNode]=\"!multiple\"\r\n        [canActivateParentNode]=\"!leafOnly\"\r\n        (nodeChecked)=\"onOperableNodeChecked($event)\"\r\n        (nodeSelected)=\"onOperableNodeSelected($event)\"\r\n        (nodeToggled)=\"onNodeToggled($event)\"\r\n        [iconParentOpen]=\"iconParentOpen\"\r\n        [iconParentClose]=\"iconParentClose\"\r\n        [iconLeaf]=\"iconLeaf\"\r\n        [treeNodeTitleKey]=\"treeNodeTitleKey\"\r\n        [iconTemplatePosition]=\"iconTemplatePosition\"\r\n        [virtualScroll]=\"virtualScroll\"\r\n        [itemSize]=\"virtualScrollItemSize\"\r\n        [minBufferPx]=\"virtualScrollMinBufferPx\"\r\n        [maxBufferPx]=\"virtualScrollMaxBufferPx\"\r\n        [virtualScrollHeight]=\"validVirtualScrollHeight + 'px'\"\r\n        (afterTreeInit)=\"afterTreeInit()\"\r\n        class=\"devui-tree\"\r\n      >\r\n        <ng-template *ngIf=\"iconTemplateInput || iconTemplatePassThrough\" #iconTemplate let-node=\"node\">\r\n          <ng-template [ngTemplateOutlet]=\"iconTemplateInput || iconTemplatePassThrough\" [ngTemplateOutletContext]=\"{ node: node }\">\r\n          </ng-template>\r\n        </ng-template>\r\n      </d-operable-tree>\r\n      <div *ngIf=\"!treeData || treeData.length <= 0\" class=\"devui-no-data-tip\">\r\n        {{ i18nCommonText?.noData }}\r\n      </div>\r\n      <div *ngIf=\"noRecord\" class=\"devui-no-data-tip\">\r\n        {{ i18nCommonText?.noRecordsFound }}\r\n      </div>\r\n    </div>\r\n\r\n    <!-- \u81EA\u5B9A\u4E49\u533A\u57DF -->\r\n    <div popper-append *ngIf=\"customViewTemplate\">\r\n      <ng-template [ngTemplateOutlet]=\"customViewTemplate\" [ngTemplateOutletContext]=\"{ $implicit: this }\"></ng-template>\r\n    </div>\r\n  </d-popper-component>\r\n  <div\r\n    [ngClass]=\"{ disabled: disabled, clear: allowClear }\"\r\n    (click)=\"$event.stopPropagation(); $event.preventDefault(); clearAll(); emitEvents()\"\r\n  ></div>\r\n  <span\r\n    class=\"devui-select-chevron-icon\"\r\n    [class.open]=\"isOpen\"\r\n    [ngClass]=\"{ disabled: disabled, 'allow-clear': allowClear, 'devui-select-chevron-icon-animation': showAnimation }\"\r\n  >\r\n    <svg\r\n      width=\"14px\"\r\n      height=\"14px\"\r\n      viewBox=\"0 0 16 16\"\r\n      version=\"1.1\"\r\n      xmlns=\"http://www.w3.org/2000/svg\"\r\n      xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n    >\r\n      <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <path\r\n          d=\"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z\"\r\n          fill-rule=\"nonzero\"\r\n        ></path>\r\n      </g>\r\n    </svg>\r\n  </span>\r\n</div>\r\n", styles: [".devui-font-size-base{font-size:12px;font-size:var(--devui-font-size, 12px)}.devui-font-base{font-size:12px;font-size:var(--devui-font-size, 12px);font-weight:400;line-height:1.5}.devui-font-size-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px)}.devui-font-modal-title{font-size:18px;font-size:var(--devui-font-size-modal-title, 18px);font-weight:700;line-height:1.5}.devui-font-size-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px)}.devui-font-page-title{font-size:16px;font-size:var(--devui-font-size-page-title, 16px);font-weight:700;line-height:1.5}.devui-font-size-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px)}.devui-font-secondary-title{font-size:14px;font-size:var(--devui-font-size-card-title, 14px);font-weight:700;line-height:1.5}.edge.devui-tree-select:hover .clear,.ie.devui-tree-select:hover .clear,.firefox.devui-tree-select:hover .clear,.edge.devui-tree-select .devui-select-chevron-icon,.ie.devui-tree-select .devui-select-chevron-icon,.firefox.devui-tree-select .devui-select-chevron-icon{right:20px}.devui-tree-select{position:relative;width:100%}.devui-tree-select .devui-select-input:not([disabled]){color:#252b3a;color:var(--devui-text, #252b3a)}.devui-tree-select .devui-select-input.devui-tree-select-input{font-size:12px;font-size:var(--devui-font-size, 12px);padding:2px 32px 2px 2px;height:auto;height:initial;min-height:28px;max-height:52px;overflow-y:auto;line-height:22px;display:flex;text-indent:8px}.devui-tree-select .devui-select-input.devui-tree-select-input.devui-select-no-label{padding-left:10px}.devui-tree-select:hover .clear{position:absolute;height:14px;width:14px;right:12px;top:calc((100% - 14px)/2);cursor:pointer;z-index:1}.devui-tree-select:hover .clear:after,.devui-tree-select:hover .clear:before{position:absolute;content:\"\";height:14px;width:2px;background-color:#71757f;background-color:var(--devui-icon-text, #71757f);left:50%}.devui-tree-select:hover .clear:before{transform:rotate(45deg)}.devui-tree-select:hover .clear:after{transform:rotate(-45deg)}.devui-tree-select:hover .clear:hover:after,.devui-tree-select:hover .clear:hover:before{background-color:#252b3a;background-color:var(--devui-icon-fill-active, #252b3a)}.devui-tree-select:hover .allow-clear{opacity:0}.devui-tree-select .devui-select-chevron-icon{right:12px;top:calc((100% - 14px)/2);position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;height:14px;line-height:14px;z-index:1}.devui-tree-select .devui-select-chevron-icon svg path{fill:#575d6c;fill:var(--devui-text-weak, #575d6c)}.devui-tree-select .devui-select-chevron-icon-animation svg{transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-tree-select .devui-select-chevron-icon.open{z-index:1052;z-index:var(--devui-z-index-dropdown, 1052)}.devui-tree-select .devui-select-chevron-icon.open svg{transform:rotate(180deg)}.devui-tree-select .devui-select-chevron-icon.clear{opacity:0}.devui-tree-select .devui-select-chevron-icon.disabled svg path{fill:#cfd0d3;fill:var(--devui-disabled-text, #cfd0d3)}.devui-tree-select:not(:hover) .devui-select-chevron-icon:not(.disabled){opacity:1;transition:opacity .1s cubic-bezier(0,0,1,1);transition:opacity var(--devui-animation-duration-fast, .1s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.devui-tree-select.devui-options-container{width:100%;color:#252b3a;color:var(--devui-text, #252b3a);padding-left:8px}.devui-select-item{color:#252b3a;color:var(--devui-text, #252b3a);line-height:16px;background-color:#e9edfa;background-color:var(--devui-label-bg, #e9edfa);border-radius:2px;border-radius:var(--devui-border-radius, 2px);border:1px solid #e9edfa;border:1px solid var(--devui-label-bg, #e9edfa);display:inline-block;max-width:100%;min-height:20px;height:20px;max-height:20px;margin:1px;padding:0 5px;position:relative;text-indent:0}.devui-select-item.devui-no-label-item{padding:1px 0;background:transparent;border-color:transparent;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.devui-select-item .devui-select-item-content{display:inline-block;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:baseline;height:18px;line-height:18px;max-width:100%;padding-right:30px;position:relative}.devui-select-item .devui-select-item-content:hover{color:#252b3a;color:var(--devui-list-item-hover-text, #252b3a)}.devui-select-item>.devui-select-item-clear-icon{width:12px;height:12px;line-height:12px;text-align:center;margin-left:12px;border-radius:50%;background-color:#d7d8da;background-color:var(--devui-line, #d7d8da);display:inline-flex;justify-content:center;align-items:center;cursor:pointer;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:transform .2s ease;transition:transform var(--devui-animation-duration-base, .2s) ease}.devui-select-item>.devui-select-item-clear-icon svg path{fill:#fff;fill:var(--devui-light-text, #ffffff)}.devui-select-item>.devui-select-item-clear-icon:hover{background-color:#252b3a;background-color:var(--devui-icon-fill-active-hover, #252b3a)}.devui-select-list{display:flex;flex-wrap:wrap}svg.svg-icon-search path{fill:#575d6c;fill:var(--devui-text-weak, #575d6c)}:host{display:inline-block;width:100%}.devui-select-input.devui-tree-select-input.disabled{color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item{background-color:#f5f5f5;background-color:var(--devui-disabled-bg, #f5f5f5);border-color:#dfe1e6;border-color:var(--devui-disabled-line, #dfe1e6)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item.devui-no-label-item{background-color:transparent;border-color:transparent;color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3)}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content:hover,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-content:focus{color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed;padding-right:0}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:hover,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:focus{background-color:#dfe1e6;background-color:var(--devui-disabled-line, #dfe1e6);cursor:not-allowed}.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon svg path,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:hover svg path,.devui-select-input.devui-tree-select-input.disabled .devui-select-item>.devui-select-item-clear-icon:focus svg path{fill:#f5f5f5;fill:var(--devui-disabled-bg, #f5f5f5)}.devui-tree-select .devui-select-input.devui-tree-select-input:not(.icon):not([class^=icon-]):not([disabled]):not(.disabled):not(.devui-disabled){color:#babbc0;color:var(--devui-placeholder, #babbc0)}::ng-deep .devui-tree-select.devui-search-container d-search{width:100%}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i1.I18nService }, { type: i2.DevConfigService }]; }, propDecorators: { checkableRelation: [{
                type: Input
            }], allowClear: [{
                type: Input
            }], treeData: [{
                type: Input
            }], showAnimation: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], disabled: [{
                type: Input
            }], expandTree: [{
                type: Input
            }], multiple: [{
                type: Input
            }], treeNodeIdKey: [{
                type: Input
            }], treeNodeChildrenKey: [{
                type: Input
            }], treeNodeTitleKey: [{
                type: Input
            }], disabledKey: [{
                type: Input
            }], leafOnly: [{
                type: Input
            }], delimiter: [{
                type: Input
            }], iconParentOpen: [{
                type: Input
            }], iconParentClose: [{
                type: Input
            }], iconLeaf: [{
                type: Input
            }], closeOnNodeSelected: [{
                type: Input
            }], width: [{
                type: Input
            }], searchable: [{
                type: Input
            }], appendTo: [{
                type: Input
            }], allowUnselect: [{
                type: Input
            }], iconTemplatePosition: [{
                type: Input
            }], iconTemplateInput: [{
                type: Input
            }], enableLabelization: [{
                type: Input
            }], customItemTemplate: [{
                type: Input
            }], customViewTemplate: [{
                type: Input
            }], customViewDirection: [{
                type: Input
            }], selectHost: [{
                type: ViewChild,
                args: ['selectHost', { static: true }]
            }], optionsContainer: [{
                type: ViewChild,
                args: ['optionsContainer', { static: true }]
            }], tree: [{
                type: ViewChild,
                args: ['tree', { static: true }]
            }], searchInput: [{
                type: ViewChild,
                args: ['searchInput']
            }], searchInputModel: [{
                type: ViewChild,
                args: ['searchInputModel']
            }], popper: [{
                type: ViewChild,
                args: ['popper', { static: true }]
            }], iconTemplatePassThrough: [{
                type: ContentChild,
                args: ['iconTemplate']
            }], nodeToggleEvent: [{
                type: Output
            }], valueChanged: [{
                type: Output
            }], virtualScroll: [{
                type: Input
            }], virtualScrollItemSize: [{
                type: Input
            }], virtualScrollMinBufferPx: [{
                type: Input
            }], virtualScrollMaxBufferPx: [{
                type: Input
            }], virtualScrollHeightPx: [{
                type: Input
            }], readyEvent: [{
                type: Input
            }] } });

class TreeSelectModule {
}
TreeSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
TreeSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectModule, declarations: [TreeSelectComponent], imports: [CommonModule, FormsModule, CheckBoxModule, LoadingModule, TreeModule, PopperModule, SearchModule], exports: [TreeSelectComponent] });
TreeSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectModule, imports: [CommonModule, FormsModule, CheckBoxModule, LoadingModule, TreeModule, PopperModule, SearchModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: TreeSelectModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [CommonModule, FormsModule, CheckBoxModule, LoadingModule, TreeModule, PopperModule, SearchModule],
                    exports: [TreeSelectComponent],
                    declarations: [TreeSelectComponent],
                    providers: [],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { DefaultIcons, TreeSelectComponent, TreeSelectModule };
//# sourceMappingURL=ng-devui-tree-select.mjs.map
