import { Component, Input, Output, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "primeng-lts/dropdown";
import * as i2 from "@angular/forms";
import * as i3 from "primeng-lts/api";
import * as i4 from "@angular/common";
function AlDropdownFilterComponent_ng_template_1_i_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i");
} if (rf & 2) {
    const selectedItem_r2 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵclassMap(selectedItem_r2.value.icon);
} }
function AlDropdownFilterComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, AlDropdownFilterComponent_ng_template_1_i_0_Template, 1, 2, "i", 3);
    i0.ɵɵelementStart(1, "span", 4);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const selectedItem_r2 = ctx.$implicit;
    i0.ɵɵproperty("ngIf", selectedItem_r2.value.icon !== "" || undefined);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(selectedItem_r2.label);
} }
function AlDropdownFilterComponent_ng_template_2_i_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i");
} if (rf & 2) {
    const item_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵclassMap(item_r5.value.icon);
} }
function AlDropdownFilterComponent_ng_template_2_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 6);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" - ", item_r5.value.subtext, "");
} }
function AlDropdownFilterComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, AlDropdownFilterComponent_ng_template_2_i_0_Template, 1, 2, "i", 3);
    i0.ɵɵelementStart(1, "span", 4);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, AlDropdownFilterComponent_ng_template_2_span_3_Template, 2, 1, "span", 5);
} if (rf & 2) {
    const item_r5 = ctx.$implicit;
    i0.ɵɵproperty("ngIf", item_r5.value.icon !== "" || undefined);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(item_r5.label);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", item_r5.value.subtext);
} }
const _c0 = function (a0) { return { "width": a0 }; };
export class AlDropdownFilterComponent {
    constructor() {
        /**
         * Event to  fire dashboard object
         */
        this.onFilterSelection = new EventEmitter();
    }
    ngOnInit() {
        this.dropDownWidth ? this.defaultWidth = this.dropDownWidth : this.defaultWidth = '350px';
    }
    clickEvent(item) {
        this.onFilterSelection.emit(item);
    }
}
/** @nocollapse */ AlDropdownFilterComponent.ɵfac = function AlDropdownFilterComponent_Factory(t) { return new (t || AlDropdownFilterComponent)(); };
/** @nocollapse */ AlDropdownFilterComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AlDropdownFilterComponent, selectors: [["al-dropdown-filter"]], inputs: { filterOptions: "filterOptions", selectedOption: "selectedOption", dropDownWidth: "dropDownWidth" }, outputs: { onFilterSelection: "onFilterSelection" }, decls: 3, vars: 6, consts: [["dropdownIcon", "ui-icon-arrow-drop-down", "optionLabel", "label", 3, "options", "ngModel", "onChange", "ngModelChange"], ["pTemplate", "selectedItem"], ["pTemplate", "item"], [3, "class", 4, "ngIf"], [2, "padding-left", "10px"], ["class", "item-subtext", 4, "ngIf"], [1, "item-subtext"]], template: function AlDropdownFilterComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "p-dropdown", 0);
        i0.ɵɵlistener("onChange", function AlDropdownFilterComponent_Template_p_dropdown_onChange_0_listener($event) { return ctx.clickEvent($event.value); })("ngModelChange", function AlDropdownFilterComponent_Template_p_dropdown_ngModelChange_0_listener($event) { return ctx.selectedOption = $event; });
        i0.ɵɵtemplate(1, AlDropdownFilterComponent_ng_template_1_Template, 3, 2, "ng-template", 1);
        i0.ɵɵtemplate(2, AlDropdownFilterComponent_ng_template_2_Template, 4, 3, "ng-template", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵstyleMap(i0.ɵɵpureFunction1(4, _c0, ctx.defaultWidth));
        i0.ɵɵproperty("options", ctx.filterOptions)("ngModel", ctx.selectedOption);
    } }, directives: [i1.Dropdown, i2.NgControlStatus, i2.NgModel, i3.PrimeTemplate, i4.NgIf], styles: ["i.ui-icon-contacts,   i.ui-icon-dashboard,   i.ui-icon-vertical-align-top{font-size:1em;font-weight:700}  label.ui-dropdown-label{display:flex;align-items:center}  .item-subtext{color:var(--ald-g-color-text-primary);font-size:10px;margin-left:4px}  li.ui-dropdown-item.ui-state-highlight .item-subtext{color:unset}"] });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(AlDropdownFilterComponent, [{
        type: Component,
        args: [{
                selector: 'al-dropdown-filter',
                templateUrl: './al-dropdown-filter.component.html',
                styleUrls: ['./al-dropdown-filter.component.scss']
            }]
    }], null, { filterOptions: [{
            type: Input
        }], selectedOption: [{
            type: Input
        }], dropDownWidth: [{
            type: Input
        }], onFilterSelection: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 