import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ng-devui/tags";
export class ToggleMenuLabelComponent {
    constructor() {
        this.multiItems = [];
        this.disabled = false;
        this.optionDisabledKey = '';
        this.removeChange = new EventEmitter();
    }
    trackByOptionPointer(index, item) {
        return item.option;
    }
    removeItem(item, event, index) {
        this.removeChange.emit({ ...item, event, index });
    }
}
ToggleMenuLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ToggleMenuLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
ToggleMenuLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: ToggleMenuLabelComponent, selector: "d-toggle-menu-label", inputs: { mode: "mode", multiItems: "multiItems", disabled: "disabled", maxWidth: "maxWidth", maxHeight: "maxHeight", optionDisabledKey: "optionDisabledKey", valueParser: "valueParser" }, outputs: { removeChange: "removeChange" }, ngImport: i0, template: "<ul class=\"devui-select-tag-list {{ mode }}\" [style.maxHeight]=\"maxHeight\" *ngIf=\"multiItems.length > 0\">\r\n  <li\r\n    class=\"devui-select-tag-item\"\r\n    *ngFor=\"let item of multiItems; let index = index; trackBy: trackByOptionPointer\"\r\n    [style.maxWidth]=\"maxWidth\"\r\n    [ngClass]=\"{\r\n      disabled: disabled || (optionDisabledKey && item.option[optionDisabledKey])\r\n    }\"\r\n  >\r\n    <d-tag\r\n      [deletable]=\"!(disabled || (optionDisabledKey && item.option[optionDisabledKey]))\"\r\n      [tag]=\"valueParser(item.option)\"\r\n      (tagDelete)=\"removeItem(item, $event?.event, index)\"\r\n    ></d-tag>\r\n  </li>\r\n</ul>\r\n", styles: [".devui-select-tag-list{height:26px;margin:0;padding:0;list-style-type:none;overflow:hidden}.devui-select-tag-list.normal{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.devui-select-tag-list.scroll-y{overflow-y:auto;overflow-x:hidden}.devui-select-tag-list.multiple-line{height:auto;overflow-y:auto;overflow-x:hidden;line-height:1;max-height:48px;min-height:24px}.devui-select-tag-item{display:inline-block;margin:2px 0 0 2px}:host ::ng-deep .devui-select-tag-item d-tag{width:100%}:host ::ng-deep .devui-select-tag-item d-tag .devui-tag-item>span{vertical-align:top;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;width:100%}:host ::ng-deep .devui-select-tag-item.disabled{line-height:18px}:host ::ng-deep .devui-select-tag-item.disabled d-tag .devui-tag-item{border:solid 1px #dfe1e6;border:solid 1px var(--devui-disabled-line, #dfe1e6);line-height:18px;background-color:#f5f5f5;background-color:var(--devui-disabled-bg, #f5f5f5);color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.TagComponent, selector: "d-tag", inputs: ["tag", "labelStyle", "customColor", "deletable", "titleContent", "mode", "checked", "maxWidth", "customViewTemplate"], outputs: ["tagDelete", "checkedChange"], exportAs: ["Tag"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: ToggleMenuLabelComponent, decorators: [{
            type: Component,
            args: [{ selector: 'd-toggle-menu-label', template: "<ul class=\"devui-select-tag-list {{ mode }}\" [style.maxHeight]=\"maxHeight\" *ngIf=\"multiItems.length > 0\">\r\n  <li\r\n    class=\"devui-select-tag-item\"\r\n    *ngFor=\"let item of multiItems; let index = index; trackBy: trackByOptionPointer\"\r\n    [style.maxWidth]=\"maxWidth\"\r\n    [ngClass]=\"{\r\n      disabled: disabled || (optionDisabledKey && item.option[optionDisabledKey])\r\n    }\"\r\n  >\r\n    <d-tag\r\n      [deletable]=\"!(disabled || (optionDisabledKey && item.option[optionDisabledKey]))\"\r\n      [tag]=\"valueParser(item.option)\"\r\n      (tagDelete)=\"removeItem(item, $event?.event, index)\"\r\n    ></d-tag>\r\n  </li>\r\n</ul>\r\n", styles: [".devui-select-tag-list{height:26px;margin:0;padding:0;list-style-type:none;overflow:hidden}.devui-select-tag-list.normal{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.devui-select-tag-list.scroll-y{overflow-y:auto;overflow-x:hidden}.devui-select-tag-list.multiple-line{height:auto;overflow-y:auto;overflow-x:hidden;line-height:1;max-height:48px;min-height:24px}.devui-select-tag-item{display:inline-block;margin:2px 0 0 2px}:host ::ng-deep .devui-select-tag-item d-tag{width:100%}:host ::ng-deep .devui-select-tag-item d-tag .devui-tag-item>span{vertical-align:top;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;width:100%}:host ::ng-deep .devui-select-tag-item.disabled{line-height:18px}:host ::ng-deep .devui-select-tag-item.disabled d-tag .devui-tag-item{border:solid 1px #dfe1e6;border:solid 1px var(--devui-disabled-line, #dfe1e6);line-height:18px;background-color:#f5f5f5;background-color:var(--devui-disabled-bg, #f5f5f5);color:#cfd0d3;color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed}\n"] }]
        }], propDecorators: { mode: [{
                type: Input
            }], multiItems: [{
                type: Input
            }], disabled: [{
                type: Input
            }], maxWidth: [{
                type: Input
            }], maxHeight: [{
                type: Input
            }], optionDisabledKey: [{
                type: Input
            }], valueParser: [{
                type: Input
            }], removeChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlLW1lbnUtbGFiZWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vZGV2dWkvdG9nZ2xlLW1lbnUvdG9nZ2xlLW1lbnUtbGFiZWw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