UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

77 lines (72 loc) 5.08 kB
import * as i0 from '@angular/core'; import { ViewContainerRef, ViewChild, Component, NgModule } from '@angular/core'; import * as i1 from '@angular/router'; import { RouterModule } from '@angular/router'; import * as i2 from '@c8y/ngx-components/operations/bulk-operations-service'; import { TitleComponent, C8yTranslatePipe } from '@c8y/ngx-components'; class BulkOperationsStepperContainerComponent { constructor(activatedRoute, bulkOpsService, changeDetector) { this.activatedRoute = activatedRoute; this.bulkOpsService = bulkOpsService; this.changeDetector = changeDetector; } ngOnInit() { this.activatedRoute.params.subscribe(params => { if (params && params.type) { this.bulkOperationType = params.type; this.component = this.bulkOpsService .getBulkTypes() .find(element => element.path.includes(this.bulkOperationType)).component; this.changeDetector.detectChanges(); this.createComponent(this.component); } }); } createComponent(component) { if (component) { this.container.createComponent(component); } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerComponent, deps: [{ token: i1.ActivatedRoute }, { token: i2.BulkOperationsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: BulkOperationsStepperContainerComponent, isStandalone: true, selector: "bulk-operations-stepper-container", viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<c8y-title>{{ 'Add bulk operation' | translate }}</c8y-title>\n<div class=\"card card--grid--fullpage\">\n <div class=\"d-contents\">\n <template #container></template>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerComponent, decorators: [{ type: Component, args: [{ selector: 'bulk-operations-stepper-container', imports: [TitleComponent, C8yTranslatePipe], template: "<c8y-title>{{ 'Add bulk operation' | translate }}</c8y-title>\n<div class=\"card card--grid--fullpage\">\n <div class=\"d-contents\">\n <template #container></template>\n </div>\n</div>\n" }] }], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: i2.BulkOperationsService }, { type: i0.ChangeDetectorRef }], propDecorators: { container: [{ type: ViewChild, args: ['container', { static: false, read: ViewContainerRef }] }] } }); const bulkOperatioStepperRoutes = [ { path: 'devicecontrol/bulk/creation/:type', component: BulkOperationsStepperContainerComponent } ]; /** * Container module for the new bulk operation steppers. Use this module in your application * to provide a step by step guided process for scheduling of bulk operations. * The module reads the bulk operation type from the URL and displays the corresponding stepper. * You can provide stepper for your custom bulk operation type by registering it with the * HOOK_LIST_BULK_TYPE injection token. */ class BulkOperationsStepperContainerModule { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerModule, imports: [i1.RouterModule, BulkOperationsStepperContainerComponent] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerModule, imports: [RouterModule.forChild(bulkOperatioStepperRoutes), BulkOperationsStepperContainerComponent] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BulkOperationsStepperContainerModule, decorators: [{ type: NgModule, args: [{ imports: [ RouterModule.forChild(bulkOperatioStepperRoutes), BulkOperationsStepperContainerComponent ] }] }] }); /** * Generated bundle index. Do not edit. */ export { BulkOperationsStepperContainerComponent, BulkOperationsStepperContainerModule, bulkOperatioStepperRoutes }; //# sourceMappingURL=c8y-ngx-components-operations-bulk-operations-stepper-container.mjs.map