UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

75 lines (70 loc) 5.01 kB
import * as i0 from '@angular/core'; import { ViewContainerRef, Component, ViewChild, NgModule } from '@angular/core'; import * as i1 from '@angular/router'; import { RouterModule } from '@angular/router'; import * as i3 from '@c8y/ngx-components'; import { CoreModule } from '@c8y/ngx-components'; import * as i2 from '@c8y/ngx-components/operations/bulk-operations-service'; 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: "18.2.13", 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: "18.2.13", type: BulkOperationsStepperContainerComponent, 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: i3.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "pipe", type: i3.C8yTranslatePipe, name: "translate" }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BulkOperationsStepperContainerComponent, decorators: [{ type: Component, args: [{ selector: 'bulk-operations-stepper-container', 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: "18.2.13", ngImport: i0, type: BulkOperationsStepperContainerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: BulkOperationsStepperContainerModule, declarations: [BulkOperationsStepperContainerComponent], imports: [CoreModule, i1.RouterModule] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BulkOperationsStepperContainerModule, imports: [CoreModule, RouterModule.forChild(bulkOperatioStepperRoutes)] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BulkOperationsStepperContainerModule, decorators: [{ type: NgModule, args: [{ declarations: [BulkOperationsStepperContainerComponent], imports: [CoreModule, RouterModule.forChild(bulkOperatioStepperRoutes)] }] }] }); /** * Generated bundle index. Do not edit. */ export { BulkOperationsStepperContainerComponent, BulkOperationsStepperContainerModule, bulkOperatioStepperRoutes }; //# sourceMappingURL=c8y-ngx-components-operations-bulk-operations-stepper-container.mjs.map