import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ManagedObjectRealtimeService } from '@c8y/ngx-components';
import { DeviceGridService } from '@c8y/ngx-components/device-grid';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@c8y/ngx-components/device-grid";
import * as i3 from "@c8y/ngx-components";
export class ChildDevicesComponent {
    constructor(route, deviceGridService) {
        this.route = route;
        this.deviceGridService = deviceGridService;
    }
    async ngOnInit() {
        await this.getAllDevices();
        this.columns = this.deviceGridService.getChildDeviceGridColumns();
    }
    async getAllDevices() {
        this.id = this.route.snapshot.parent.data.contextData;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ChildDevicesComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.DeviceGridService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: ChildDevicesComponent, selector: "c8y-child-devices", providers: [ManagedObjectRealtimeService], ngImport: i0, template: "<div class=\"content-fullpage border-top border-bottom\">\n  <c8y-device-grid\n    [title]=\"'Child devices' | translate\"\n    [childDeviceGrid]=\"true\"\n    [columns]=\"columns\"\n    [parentDeviceId]=\"id\"\n    c8yProductExperience\n    [actionName]=\"'childDevices'\"\n  ></c8y-device-grid>\n</div>\n", dependencies: [{ kind: "directive", type: i3.ProductExperienceDirective, selector: "[c8yProductExperience]", inputs: ["actionName", "actionData", "inherit", "suppressDataOverriding"] }, { kind: "component", type: i2.DeviceGridComponent, selector: "c8y-device-grid", inputs: ["dataCallback", "refresh", "title", "loadMoreItemsLabel", "loadingItemsLabel", "legacyConfigKey", "legacyFilterKey", "columns", "pagination", "infiniteScroll", "actionControls", "selectable", "singleSelection", "baseQuery", "bulkActionControls", "headerActionControls", "childDeviceGrid", "parentDeviceId", "withChildren", "showSearch", "activeClassName"], outputs: ["onColumnsChange", "onFilterChange", "onDeviceQueryStringChange", "itemsSelect"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ChildDevicesComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-child-devices', providers: [ManagedObjectRealtimeService], template: "<div class=\"content-fullpage border-top border-bottom\">\n  <c8y-device-grid\n    [title]=\"'Child devices' | translate\"\n    [childDeviceGrid]=\"true\"\n    [columns]=\"columns\"\n    [parentDeviceId]=\"id\"\n    c8yProductExperience\n    [actionName]=\"'childDevices'\"\n  ></c8y-device-grid>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: i2.DeviceGridService }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hpbGQtZGV2aWNlcy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9jaGlsZC1kZXZpY2VzL2NoaWxkLWRldmljZXMuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vY2hpbGQtZGV2aWNlcy9jaGlsZC1kZXZpY2VzLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2pELE9BQU8sRUFBVSw0QkFBNEIsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzNFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlDQUFpQyxDQUFDOzs7OztBQU9wRSxNQUFNLE9BQU8scUJBQXFCO0lBSWhDLFlBQW9CLEtBQXFCLEVBQVUsaUJBQW9DO1FBQW5FLFVBQUssR0FBTCxLQUFLLENBQWdCO1FBQVUsc0JBQWlCLEdBQWpCLGlCQU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