import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "./configuration-filter.pipe";
export class DeviceConfigurationListComponent {
    constructor() {
        this.configSelected = new EventEmitter();
        this.filterTerm = '';
    }
    showConfigurationTypePreview(config) {
        this.selectedConfig = config;
        this.configSelected.emit(config);
    }
    updatePipe(filterTerm) {
        this.filterTerm = filterTerm;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DeviceConfigurationListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: DeviceConfigurationListComponent, selector: "c8y-device-configuration-list", inputs: { items: "items", itemIcon: "itemIcon", emptyState: "emptyState", isFilterEnabled: "isFilterEnabled" }, outputs: { configSelected: "configSelected" }, ngImport: i0, template: "<div class=\"p-l-16 m-b-8\" *ngIf=\"isFilterEnabled\">\n  <c8y-filter [icon]=\"'search'\" (onSearch)=\"updatePipe($event)\"></c8y-filter>\n</div>\n\n<!-- EMPTY STATE -->\n<div class=\"c8y-empty-state text-left\" *ngIf=\"items?.length === 0\">\n  <h1 [c8yIcon]=\"emptyState.icon\"></h1>\n  <p>\n    <strong>{{ emptyState.title | translate }}</strong>\n    <br />\n    <small>{{ emptyState.text | translate }}</small>\n  </p>\n</div>\n\n<!-- CONFIGURATIONS AVAILABLE -->\n<div class=\"c8y-nav-stacked\">\n  <button\n    type=\"button\"\n    class=\"c8y-stacked-item d-flex\"\n    [class.active]=\"config === selectedConfig\"\n    *ngFor=\"let config of items | configurationFilterPipe: filterTerm\"\n    (click)=\"showConfigurationTypePreview(config)\"\n  >\n    <div class=\"list-item-icon\">\n      <i [c8yIcon]=\"itemIcon\"></i>\n    </div>\n    <div class=\"list-item-body text-truncate\">\n      <div class=\"d-flex\">\n        <span class=\"text-truncate\" title=\"{{ config.name }}\">{{ config.name }}</span>\n        <span class=\"text-label-small m-l-auto m-t-auto m-b-auto\">{{ config.deviceType }}</span>\n      </div>\n    </div>\n  </button>\n</div>\n\n<!-- for Carlos: config.configurationType to differentiate whether a config matches configuration type. -->\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: i2.FilterInputComponent, selector: "c8y-filter", inputs: ["icon"], outputs: ["onSearch"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.ConfigurationFilterPipe, name: "configurationFilterPipe" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DeviceConfigurationListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-device-configuration-list', template: "<div class=\"p-l-16 m-b-8\" *ngIf=\"isFilterEnabled\">\n  <c8y-filter [icon]=\"'search'\" (onSearch)=\"updatePipe($event)\"></c8y-filter>\n</div>\n\n<!-- EMPTY STATE -->\n<div class=\"c8y-empty-state text-left\" *ngIf=\"items?.length === 0\">\n  <h1 [c8yIcon]=\"emptyState.icon\"></h1>\n  <p>\n    <strong>{{ emptyState.title | translate }}</strong>\n    <br />\n    <small>{{ emptyState.text | translate }}</small>\n  </p>\n</div>\n\n<!-- CONFIGURATIONS AVAILABLE -->\n<div class=\"c8y-nav-stacked\">\n  <button\n    type=\"button\"\n    class=\"c8y-stacked-item d-flex\"\n    [class.active]=\"config === selectedConfig\"\n    *ngFor=\"let config of items | configurationFilterPipe: filterTerm\"\n    (click)=\"showConfigurationTypePreview(config)\"\n  >\n    <div class=\"list-item-icon\">\n      <i [c8yIcon]=\"itemIcon\"></i>\n    </div>\n    <div class=\"list-item-body text-truncate\">\n      <div class=\"d-flex\">\n        <span class=\"text-truncate\" title=\"{{ config.name }}\">{{ config.name }}</span>\n        <span class=\"text-label-small m-l-auto m-t-auto m-b-auto\">{{ config.deviceType }}</span>\n      </div>\n    </div>\n  </button>\n</div>\n\n<!-- for Carlos: config.configurationType to differentiate whether a config matches configuration type. -->\n" }]
        }], propDecorators: { items: [{
                type: Input
            }], itemIcon: [{
                type: Input
            }], emptyState: [{
                type: Input
            }], isFilterEnabled: [{
                type: Input
            }], configSelected: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlLWNvbmZpZ3VyYXRpb24tbGlzdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9yZXBvc2l0b3J5L2NvbmZpZ3VyYXRpb24vZGV2aWNlLXRhYi9kZXZpY2UtY29uZmlndXJhdGlvbi1saXN0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3JlcG9zaXRvcnkvY29uZmlndXJhdGlvbi9kZXZpY2UtdGFiL2RldmljZS1jb25maWd1cmF0aW9uLWxpc3QuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7QUFVdkUsTUFBTSxPQUFPLGdDQUFnQztJQUo3QztRQVNZLG1CQUFjLEdBQUcsSUFBSSxZQUFZLEVBQVUsQ0FBQztRQUV0RCxlQUFVLEdBQUcsRUFBRSxDQUFDO0tBVWpCO0lBUkMsNEJBQTRCLENBQUMsTUFBTTtRQUNqQyxJQUFJLENBQUMsY0FBYyxHQUFHLE1BQU0sQ0FBQztRQUM3QixJQUFJLENBQUMsY0FBYyxDQU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