import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "ng-devui/checkbox";
import * as i4 from "ng-devui/utils";
export class ToggleMenuListItemComponent {
    constructor() {
        /**
         * 【当传入资源（options）类型为Array<{key: value}，必选】针对传入资源options的每项对应字段做禁用操作的key
         */
        this.optionDisabledKey = '';
        /**
         * 【当传入资源（options）类型为Array<{key: value}，可选】如使用分组需设置
         */
        this.optionGroupKey = '';
        /**
         * 【可选】是否允许高亮选项
         */
        this.highlightToggle = true;
        /**
         * 【可选】下拉高亮css
         */
        this.highlightItemClass = 'active';
        this.chooseItem = new EventEmitter();
        this.formatter = (item) => (item ? item[this.filterKey] || item.label || item.toString() : '');
    }
    choose(option, index, event) {
        this.chooseItem.emit({ option, index, event });
    }
}
ToggleMenuListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ToggleMenuListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
ToggleMenuListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: ToggleMenuListItemComponent, selector: "d-toggle-menu-list-item", inputs: { item: "item", index: "index", selectIndex: "selectIndex", activeIndex: "activeIndex", formatter: "formatter", filterKey: "filterKey", optionDisabledKey: "optionDisabledKey", optionGroupKey: "optionGroupKey", highlightToggle: "highlightToggle", highlightItemClass: "highlightItemClass", multiple: "multiple", isShowKeyword: "isShowKeyword", keyword: "keyword", customTemplate: "customTemplate", color: "color" }, outputs: { chooseItem: "chooseItem" }, ngImport: i0, template: "<li\n  title=\"{{ formatter(item.option) }}\"\n  class=\"devui-dropdown-item devui-toggle-menu{{ multiple ? '-multiple-' : '-' }}item {{\n    highlightToggle && item.isChecked ? highlightItemClass : ''\n  }}\"\n  [class.selected]=\"selectIndex === index && item.id !== activeIndex\"\n  [class.disabled]=\"optionDisabledKey && item.option[optionDisabledKey]\"\n  [class.group]=\"optionGroupKey && item.option[optionGroupKey]\"\n  (click)=\"choose(item.option, item.id, $event)\"\n>\n  <ng-template\n    [ngTemplateOutlet]=\"customTemplate || (multiple ? checkBoxItem : isShowKeyword ? defaultHighlight : defaultItem)\"\n    [ngTemplateOutletContext]=\"\n      isShowKeyword\n        ? {\n            item: item.option,\n            formatter: formatter,\n            keyword: keyword,\n            $index: index\n          }\n        : multiple\n        ? {\n            option: item.option,\n            checked: item.isChecked,\n            filterKey: filterKey,\n            position: 'list',\n            template: checkBoxItem,\n            $index: index\n          }\n        : {\n            option: item.option,\n            filterKey: filterKey,\n            position: 'list',\n            template: defaultItem,\n            $index: index\n          }\n    \"\n  >\n  </ng-template>\n</li>\n\n<ng-template #defaultItem let-option=\"option\">\n  {{ formatter(option) }}\n</ng-template>\n\n<ng-template #defaultHighlight let-item=\"item\" let-keyword=\"keyword\">\n  <d-highlight [value]=\"formatter(item)\" [term]=\"keyword\"></d-highlight>\n</ng-template>\n\n<ng-template #checkBoxItem let-option=\"option\" let-checked=\"checked\">\n  <d-checkbox\n    [color]=\"color\"\n    [cssClass]=\"'devui-select-checkbox'\"\n    [disabled]=\"option[optionDisabledKey]\"\n    [label]=\"formatter(option)\"\n    [ngModel]=\"checked\"\n  >\n  </d-checkbox>\n</ng-template>\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}:host:first-of-type>li{margin-top:0}:host>li{margin-top:4px;font-size:inherit;min-height:inherit}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.CheckBoxComponent, selector: "d-checkbox", inputs: ["name", "label", "cssClass", "color", "disabled", "isShowTitle", "title", "labelTemplate", "halfchecked", "showAnimation", "beforeChange"], outputs: ["change"] }, { kind: "component", type: i4.HighlightComponent, selector: "d-highlight", inputs: ["value", "term", "highlightClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ToggleMenuListItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-toggle-menu-list-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<li\n  title=\"{{ formatter(item.option) }}\"\n  class=\"devui-dropdown-item devui-toggle-menu{{ multiple ? '-multiple-' : '-' }}item {{\n    highlightToggle && item.isChecked ? highlightItemClass : ''\n  }}\"\n  [class.selected]=\"selectIndex === index && item.id !== activeIndex\"\n  [class.disabled]=\"optionDisabledKey && item.option[optionDisabledKey]\"\n  [class.group]=\"optionGroupKey && item.option[optionGroupKey]\"\n  (click)=\"choose(item.option, item.id, $event)\"\n>\n  <ng-template\n    [ngTemplateOutlet]=\"customTemplate || (multiple ? checkBoxItem : isShowKeyword ? defaultHighlight : defaultItem)\"\n    [ngTemplateOutletContext]=\"\n      isShowKeyword\n        ? {\n            item: item.option,\n            formatter: formatter,\n            keyword: keyword,\n            $index: index\n          }\n        : multiple\n        ? {\n            option: item.option,\n            checked: item.isChecked,\n            filterKey: filterKey,\n            position: 'list',\n            template: checkBoxItem,\n            $index: index\n          }\n        : {\n            option: item.option,\n            filterKey: filterKey,\n            position: 'list',\n            template: defaultItem,\n            $index: index\n          }\n    \"\n  >\n  </ng-template>\n</li>\n\n<ng-template #defaultItem let-option=\"option\">\n  {{ formatter(option) }}\n</ng-template>\n\n<ng-template #defaultHighlight let-item=\"item\" let-keyword=\"keyword\">\n  <d-highlight [value]=\"formatter(item)\" [term]=\"keyword\"></d-highlight>\n</ng-template>\n\n<ng-template #checkBoxItem let-option=\"option\" let-checked=\"checked\">\n  <d-checkbox\n    [color]=\"color\"\n    [cssClass]=\"'devui-select-checkbox'\"\n    [disabled]=\"option[optionDisabledKey]\"\n    [label]=\"formatter(option)\"\n    [ngModel]=\"checked\"\n  >\n  </d-checkbox>\n</ng-template>\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}:host:first-of-type>li{margin-top:0}:host>li{margin-top:4px;font-size:inherit;min-height:inherit}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { item: [{
                type: Input
            }], index: [{
                type: Input
            }], selectIndex: [{
                type: Input
            }], activeIndex: [{
                type: Input
            }], formatter: [{
                type: Input
            }], filterKey: [{
                type: Input
            }], optionDisabledKey: [{
                type: Input
            }], optionGroupKey: [{
                type: Input
            }], highlightToggle: [{
                type: Input
            }], highlightItemClass: [{
                type: Input
            }], multiple: [{
                type: Input
            }], isShowKeyword: [{
                type: Input
            }], keyword: [{
                type: Input
            }], customTemplate: [{
                type: Input
            }], color: [{
                type: Input
            }], chooseItem: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 