UNPKG

@c8y/ngx-components

Version:

Angular modules for Cumulocity IoT applications

114 lines 3.84 kB
import { EventEmitter, OnInit, TemplateRef } from '@angular/core'; import { BsModalRef } from 'ngx-bootstrap/modal'; import { WizardOutletComponent } from './wizard-outlet/wizard-outlet.component'; import { Wizard, WizardConfig, WizardEntry } from './wizard.model'; import { WizardService } from './wizard.service'; import * as i0 from "@angular/core"; /** * A generic component that is intended to serve as the building block of more wizards. * * **Example** * ```html * <button * title="Add application" * class="btn btn-primary" * (click)="addApplication()" * > * Add application * </button> * ``` * * ```ts * import { Component } from '@angular/core'; * import { WizardConfig, WizardService, Wizard } from '@c8y/ngx-components'; * import { ModalOptions } from 'ngx-bootstrap/modal'; * * @Component({ * selector: 'c8y-add-application-wizard', * templateUrl: './templatePath' * }) * export class AddApplicationWizardComponent { * constructor(private wizardService: WizardService) {} * * addApplication() { * const wizardConfig: WizardConfig = { * headerText: 'Add Application', * headerIcon: 'c8y-icon-modules', * bodyHeaderText: 'Select methods', * bodyHeaderIcon: 'c8y-icon-modules' * }; * * const initialState: Wizard = { * wizardConfig, * id: 'uploadApplication' * }; * * const modalOptions: ModalOptions = { initialState }; * * this.wizardService.show(modalOptions); * } * } * ``` */ export declare class WizardComponent<T = any> implements Wizard<T>, OnInit { wizardService: WizardService; bsModalRef: BsModalRef; header: TemplateRef<any>; body: TemplateRef<any>; footer: TemplateRef<any>; outlet: WizardOutletComponent; /** * The id parameter identifies the particular wizard and can be used to refer to it when hooking wizard entries. * Example: "wizardId". */ id: string; /** * A configuration object that allows you to set header values, both text and icon. */ wizardConfig: WizardConfig; /** * A state that will be assigned to the actual component contained by the wizard. */ componentInitialState: Partial<T>; /** * The event that is emitted when the wizard is closed. */ onClose: EventEmitter<any>; /** * The event that is emitted when the wizard is reseted. */ onReset: EventEmitter<any>; /** * The event that is emitted when the wizard entry is clicked. */ onSelect: EventEmitter<WizardEntry>; readonly headerTemplate$: import("rxjs").Observable<{ wizardId: string; template: TemplateRef<any>; }>; readonly bodyTemplate$: import("rxjs").Observable<{ wizardId: string; template: TemplateRef<any>; }>; readonly footerTemplate$: import("rxjs").Observable<{ wizardId: string; template: TemplateRef<any>; }>; constructor(wizardService: WizardService, bsModalRef: BsModalRef); ngOnInit(): void; /** * Resets the wizard. * @param result Custom result object which will be emitted via onReset output. */ reset(result?: any): void; /** * Closes the wizard. * @param result Custom result object which will be emitted via onClose output. */ close(result?: any): void; onPath(): void; private emitTemplates; static ɵfac: i0.ɵɵFactoryDeclaration<WizardComponent<any>, never>; static ɵcmp: i0.ɵɵComponentDeclaration<WizardComponent<any>, "c8y-wizard", never, { "id": { "alias": "id"; "required": false; }; "wizardConfig": { "alias": "wizardConfig"; "required": false; }; }, { "onClose": "onClose"; "onReset": "onReset"; "onSelect": "onSelect"; }, never, never, true, never>; } //# sourceMappingURL=wizard.component.d.ts.map