import { Component, HostListener, Input } from '@angular/core';
import { gettext } from '@c8y/ngx-components';
import { BsModalRef } from 'ngx-bootstrap/modal';
import * as i0 from "@angular/core";
import * as i1 from "ngx-bootstrap/modal";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "../type-dashboard-target-assets-grid/type-dashboard-target-assets-grid.component";
export class TypeDashboardTargetAssetsModalComponent {
    constructor(bsModalRef) {
        this.bsModalRef = bsModalRef;
        this.labels = { cancel: gettext('Cancel') };
    }
    handleKeyboardEvent(event) {
        if (event.key === 'Escape') {
            this.close();
        }
    }
    close() {
        this.bsModalRef.hide();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TypeDashboardTargetAssetsModalComponent, deps: [{ token: i1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TypeDashboardTargetAssetsModalComponent, selector: "c8y-type-dashboard-target-assets-modal", inputs: { dashboard: "dashboard" }, host: { listeners: { "document:keydown": "handleKeyboardEvent($event)" } }, ngImport: i0, template: "<c8y-modal\n  title=\"{{ 'Select dashboard instance to edit' | translate }}\"\n  (onClose)=\"close()\"\n  (onDismiss)=\"close()\"\n  [labels]=\"labels\"\n  [disabled]=\"true\"\n  [headerClasses]=\"'has-data-grid'\"\n>\n  <c8y-type-dashboard-target-assets-grid\n    [dashboard]=\"dashboard\"\n    (onNavigateToAsset)=\"close()\"\n  ></c8y-type-dashboard-target-assets-grid>\n</c8y-modal>\n", dependencies: [{ kind: "component", type: i2.ModalComponent, selector: "c8y-modal", inputs: ["disabled", "close", "dismiss", "title", "body", "customFooter", "headerClasses", "labels"], outputs: ["onDismiss", "onClose"] }, { kind: "component", type: i3.TypeDashboardTargetAssetsGridComponent, selector: "c8y-type-dashboard-target-assets-grid", inputs: ["dashboard"], outputs: ["onNavigateToAsset"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TypeDashboardTargetAssetsModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-type-dashboard-target-assets-modal', template: "<c8y-modal\n  title=\"{{ 'Select dashboard instance to edit' | translate }}\"\n  (onClose)=\"close()\"\n  (onDismiss)=\"close()\"\n  [labels]=\"labels\"\n  [disabled]=\"true\"\n  [headerClasses]=\"'has-data-grid'\"\n>\n  <c8y-type-dashboard-target-assets-grid\n    [dashboard]=\"dashboard\"\n    (onNavigateToAsset)=\"close()\"\n  ></c8y-type-dashboard-target-assets-grid>\n</c8y-modal>\n" }]
        }], ctorParameters: () => [{ type: i1.BsModalRef }], propDecorators: { dashboard: [{
                type: Input
            }], handleKeyboardEvent: [{
                type: HostListener,
                args: ['document:keydown', ['$event']]
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS1kYXNoYm9hcmQtdGFyZ2V0LWFzc2V0cy1tb2RhbC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9jb250ZXh0LWRhc2hib2FyZC9kYXNoYm9hcmQtbWFuYWdlci90eXBlLWRhc2hib2FyZC10YXJnZXQtYXNzZXRzLW1vZGFsL3R5cGUtZGFzaGJvYXJkLXRhcmdldC1hc3NldHMtbW9kYWwuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vY29udGV4dC1kYXNoYm9hcmQvZGFzaGJvYXJkLW1hbmFnZXIvdHlwZS1kYXNoYm9hcmQtdGFyZ2V0LWFzc2V0cy1tb2RhbC90eXBlLWRhc2hib2FyZC10YXJnZXQtYXNzZXRzLW1vZGFsLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQ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