import { Component, HostBinding, Input } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import * as i0 from "@angular/core";
import * as i1 from "../../icon/icon.component";
import * as i2 from "@angular/common";
export class DropdownItemComponent {
    constructor(element) {
        this.element = element;
        this.label = '';
        this.disabled = false;
        this.role = 'menuitem';
        this.active = false;
        this.selected = false;
    }
    set setDisabled(value) {
        this.disabled = coerceBooleanProperty(value);
    }
    get tabindex() {
        return this.disabled ? -1 : 0;
    }
    set setSelected(value) {
        this.selected = coerceBooleanProperty(value);
    }
    ngOnInit() {
    }
    getLabel() {
        return this.label;
    }
    setActiveStyles() {
        this.active = true;
    }
    setInactiveStyles() {
        this.active = false;
    }
    select() {
        this.element.nativeElement.click();
    }
}
DropdownItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DropdownItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
DropdownItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: DropdownItemComponent, selector: "ui-dropdown-item, [ui-dropdown-item]", inputs: { label: "label", setDisabled: ["disabled", "setDisabled"], role: "role", setSelected: ["selected", "setSelected"] }, host: { properties: { "attr.tabindex": "this.tabindex", "attr.role": "this.role", "class.active": "this.active", "attr.aria-selected": "this.selected" } }, ngImport: i0, template: "<div class=\"value\">\n  <ng-content></ng-content>\n</div>\n<div class=\"check-icon\" *ngIf=\"selected\">\n  <ui-icon name=\"check\"></ui-icon>\n</div>\n", styles: [":host{display:flex;color:var(--color-contrast-90);align-items:center;outline:none;border-radius:var(--field-border-radius-inner);padding:6px 12px;margin:0 0 1px;cursor:pointer;overflow:hidden;min-height:56px}:host:hover,:host.active{background:var(--select-color-hover)}:hosta{text-decoration:none;color:var(--color-contrast-100)}:host .value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .check-icon{padding-left:12px}\n"], components: [{ type: i1.IconComponent, selector: "ui-icon", inputs: ["name", "color", "size", "stroke", "styles"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DropdownItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ui-dropdown-item, [ui-dropdown-item]', template: "<div class=\"value\">\n  <ng-content></ng-content>\n</div>\n<div class=\"check-icon\" *ngIf=\"selected\">\n  <ui-icon name=\"check\"></ui-icon>\n</div>\n", styles: [":host{display:flex;color:var(--color-contrast-90);align-items:center;outline:none;border-radius:var(--field-border-radius-inner);padding:6px 12px;margin:0 0 1px;cursor:pointer;overflow:hidden;min-height:56px}:host:hover,:host.active{background:var(--select-color-hover)}:hosta{text-decoration:none;color:var(--color-contrast-100)}:host .value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host .check-icon{padding-left:12px}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { label: [{
                type: Input
            }], setDisabled: [{
                type: Input,
                args: ['disabled']
            }], tabindex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }], role: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['attr.role']
            }], active: [{
                type: HostBinding,
                args: ['class.active']
            }], selected: [{
                type: HostBinding,
                args: ['attr.aria-selected']
            }], setSelected: [{
                type: Input,
                args: ['selected']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24taXRlbS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi91aS1raXQvc3JjL2xpYi9kcm9wZG93bi9kcm9wZG93bi1pdGVtL2Ryb3Bkb3duLWl0ZW0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvZHJvcGRv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