@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
73 lines (68 loc) • 6.55 kB
JavaScript
import * as i0 from '@angular/core';
import { Component, NgModule } from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { C8yTranslateDirective, hookStepper, 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 { AsyncPipe, NgIf } from '@angular/common';
import { gettext } from '@c8y/ngx-components/gettext';
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: "20.3.19", ngImport: i0, type: PluginSetupStepperComponent, deps: [{ token: i1.AppStateService }, { token: i1.C8yStepper }, { token: i1.SetupComponent }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", 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\n class=\"text-medium l-h-base\"\n translate\n >\n Plugins\n </h3>\n <p\n class=\"lead text-normal\"\n translate\n >\n Manage the application plugins.\n </p>\n </div>\n </div>\n</div>\n<div class=\"inner-scroll flex-grow\">\n @if (appId$ | async; as appId) {\n <c8y-app-plugins [appId]=\"appId\"></c8y-app-plugins>\n }\n</div>\n<div class=\"card-footer separator d-flex gap-8 j-c-center\">\n @if (stepper.selectedIndex !== 0) {\n <button\n class=\"btn btn-default\"\n type=\"button\"\n data-cy=\"c8y-plugin-setup-stepper--cancel-button\"\n (click)=\"back()\"\n translate\n >\n Previous\n </button>\n }\n <button\n class=\"btn btn-primary\"\n type=\"submit\"\n data-cy=\"c8y-plugin-setup-stepper--continue-button\"\n (click)=\"next()\"\n translate\n >\n Continue\n </button>\n</div>\n", dependencies: [{ 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]" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", 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\n class=\"text-medium l-h-base\"\n translate\n >\n Plugins\n </h3>\n <p\n class=\"lead text-normal\"\n translate\n >\n Manage the application plugins.\n </p>\n </div>\n </div>\n</div>\n<div class=\"inner-scroll flex-grow\">\n @if (appId$ | async; as appId) {\n <c8y-app-plugins [appId]=\"appId\"></c8y-app-plugins>\n }\n</div>\n<div class=\"card-footer separator d-flex gap-8 j-c-center\">\n @if (stepper.selectedIndex !== 0) {\n <button\n class=\"btn btn-default\"\n type=\"button\"\n data-cy=\"c8y-plugin-setup-stepper--cancel-button\"\n (click)=\"back()\"\n translate\n >\n Previous\n </button>\n }\n <button\n class=\"btn btn-primary\"\n type=\"submit\"\n data-cy=\"c8y-plugin-setup-stepper--continue-button\"\n (click)=\"next()\"\n translate\n >\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: "20.3.19", ngImport: i0, type: PluginSetupStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.19", ngImport: i0, type: PluginSetupStepperModule, imports: [PluginSetupStepperComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.19", 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: "20.3.19", 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