@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
72 lines (67 loc) • 6.33 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, NgModule } from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { C8yTranslateDirective, hookStepper, gettext, Steppers } from '@c8y/ngx-components';
import { map, filter } from 'rxjs/operators';
import * as i2 from '@c8y/ngx-components/ecosystem/application-plugins';
import { ApplicationPluginsModule } from '@c8y/ngx-components/ecosystem/application-plugins';
import { LicenseConfirmModule } from '@c8y/ngx-components/ecosystem/license-confirm';
import { NgIf, AsyncPipe } from '@angular/common';
class PluginSetupStepperComponent {
constructor(appState, stepper, setup) {
this.appState = appState;
this.stepper = stepper;
this.setup = setup;
this.appId$ = this.appState.currentApplication.pipe(map(app => app?.id), filter(appId => !!appId));
}
next() {
this.setup.stepCompleted(this.stepper.selectedIndex);
this.stepper.next();
}
back() {
this.stepper.previous();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperComponent, deps: [{ token: i1.AppStateService }, { token: i1.C8yStepper }, { token: i1.SetupComponent }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: PluginSetupStepperComponent, isStandalone: true, selector: "c8y-plugin-setup-stepper", host: { classAttribute: "d-contents" }, ngImport: i0, template: "<div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\">Plugins</h3>\n <p class=\"lead text-normal\" translate>\n Manage the application plugins.\n </p>\n </div>\n </div>\n</div>\n<div class=\"inner-scroll flex-grow\">\n <c8y-app-plugins *ngIf=\"appId$ | async as appId\" [appId]=\"appId\"></c8y-app-plugins>\n</div>\n<div class=\"card-footer separator d-flex j-c-center\">\n <button\n class=\"btn btn-default\"\n type=\"button\"\n data-cy=\"c8y-plugin-setup-stepper--cancel-button\"\n *ngIf=\"stepper.selectedIndex !== 0\"\n (click)=\"back()\"\n translate\n >\n Previous\n </button>\n <button class=\"btn btn-primary\" type=\"submit\" data-cy=\"c8y-plugin-setup-stepper--continue-button\" (click)=\"next()\" translate>\n Continue\n </button>\n</div>\n", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ApplicationPluginsModule }, { kind: "component", type: i2.ApplicationPluginsComponent, selector: "c8y-app-plugins", inputs: ["appId"] }, { kind: "ngmodule", type: LicenseConfirmModule }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperComponent, decorators: [{
type: Component,
args: [{ selector: 'c8y-plugin-setup-stepper', standalone: true, imports: [NgIf, AsyncPipe, ApplicationPluginsModule, LicenseConfirmModule, C8yTranslateDirective], host: { class: 'd-contents' }, template: "<div class=\"container-fluid flex-no-shrink fit-w\">\n <div class=\"row\">\n <div class=\"col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3 p-t-24 p-l-16 p-r-16\">\n <h3 translate class=\"text-medium l-h-base\">Plugins</h3>\n <p class=\"lead text-normal\" translate>\n Manage the application plugins.\n </p>\n </div>\n </div>\n</div>\n<div class=\"inner-scroll flex-grow\">\n <c8y-app-plugins *ngIf=\"appId$ | async as appId\" [appId]=\"appId\"></c8y-app-plugins>\n</div>\n<div class=\"card-footer separator d-flex j-c-center\">\n <button\n class=\"btn btn-default\"\n type=\"button\"\n data-cy=\"c8y-plugin-setup-stepper--cancel-button\"\n *ngIf=\"stepper.selectedIndex !== 0\"\n (click)=\"back()\"\n translate\n >\n Previous\n </button>\n <button class=\"btn btn-primary\" type=\"submit\" data-cy=\"c8y-plugin-setup-stepper--continue-button\" (click)=\"next()\" translate>\n Continue\n </button>\n</div>\n" }]
}], ctorParameters: () => [{ type: i1.AppStateService }, { type: i1.C8yStepper }, { type: i1.SetupComponent }] });
class PluginSetupStepperModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperModule, imports: [PluginSetupStepperComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperModule, providers: [
hookStepper([
{
stepperId: Steppers.SETUP,
component: PluginSetupStepperComponent,
label: gettext('Plugins'),
setupId: 'plugins',
priority: 30
}
])
], imports: [PluginSetupStepperComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginSetupStepperModule, decorators: [{
type: NgModule,
args: [{
imports: [PluginSetupStepperComponent],
providers: [
hookStepper([
{
stepperId: Steppers.SETUP,
component: PluginSetupStepperComponent,
label: gettext('Plugins'),
setupId: 'plugins',
priority: 30
}
])
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { PluginSetupStepperModule };
//# sourceMappingURL=c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs.map