UNPKG

@ux-aspects/ux-aspects

Version:

Open source user interface framework for building modern, responsive, mobile big data applications

159 lines (158 loc) 9.21 kB
import { AfterContentInit, EventEmitter, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core'; import { Subject } from 'rxjs'; import { WizardStepComponent } from './wizard-step.component'; import { WizardService } from './wizard.service'; import * as i0 from "@angular/core"; export declare class WizardComponent implements OnInit, AfterContentInit, OnDestroy { protected readonly _wizardService: WizardService<WizardStepComponent>; /** Defines whether or not the wizard should be displayed in a `horizontal` or `vertical` layout. */ orientation: 'horizontal' | 'vertical'; /** Defines the text displayed in the 'Next' button. */ nextText: string; /** Defines the text displayed in the 'Previous' button. */ previousText: string; /** Defines the text displayed in the 'Cancel' button. */ cancelText: string; /** Defines the text displayed in the 'Finish' button. */ finishText: string; /** Defines the text displayed in the tooltip when the 'Next' button is hovered. */ nextTooltip: string; /** Defines the text displayed in the tooltip when the 'Previous' button is hovered. */ previousTooltip: string; /** Defines the text displayed in the tooltip when the 'Cancel' button is hovered. */ cancelTooltip: string; /** Defines the text displayed in the tooltip when the 'Finish' button is hovered. */ finishTooltip: string; /** Defines the text for the aria label on the 'Next' button. */ nextAriaLabel: string; /** Defines the text for the aria label on the 'Previous' button. */ previousAriaLabel: string; /** Defines the text for the aria label on the 'Cancel' button. */ cancelAriaLabel: string; /** Defines the text for the aria label on the 'Finish' button. */ finishAriaLabel: string; /** If set to `true` the 'Next' button will appear disabled and will not respond to clicks. */ nextDisabled: boolean; /** If set to `true` the 'Previous' button will appear disabled and will not respond to clicks. */ previousDisabled: boolean; /** If set to `true` the 'Cancel' button will appear disabled and will not respond to clicks. */ cancelDisabled: boolean; /** If set to `true` the 'Finish' button will appear disabled and will not respond to clicks. */ finishDisabled: boolean; /** If set to `false` the 'Next' button will be hidden. */ nextVisible: boolean; /** If set to `false` the 'Previous' button will be hidden. */ previousVisible: boolean; /** If set to `false` the 'Cancel' button will be hidden. */ cancelVisible: boolean; /** If set to false the 'Finish' button will be hidden. */ finishVisible: boolean; /** If set to `true` the 'Cancel' button will be visible even on the last step. By default it will be hidden on the final step. */ cancelAlwaysVisible: boolean; /** If set to `true` the 'Finish' button will be visible on all steps of the wizard. By default this button will only be visible on the final step of the wizard. */ finishAlwaysVisible: boolean; /** If set to `true` the 'Next' or 'Finish' button will become disabled when the current step is invalid. */ disableNextWhenInvalid: boolean; /** Whether to set `visited` to false on subsequent steps after a validation fault. */ resetVisitedOnValidationError: boolean; /** If set to false it will allow users to navigate to every step */ sequential: boolean; /** Emits when the wizard has moved to the next step. It will receive the current step index as a parameter. */ onNext: EventEmitter<number>; /** Emits when the wizard has moved to the previous step. It will receive the current step index as a parameter. */ onPrevious: EventEmitter<number>; /** Emits when the 'Cancel' button has been pressed. */ onCancel: EventEmitter<void>; /** Emits when the 'Finish' button is clicked, but before the finish event fires. This fires regardless of the validity of the final step. */ onFinishing: EventEmitter<void>; /** Emits when the 'Finish' button has been pressed and the final step is valid. */ onFinish: EventEmitter<void>; /** Emits before the current step changes. The event contains the current step index in the `from` property, and the requested step index in the `to` property. */ stepChanging: EventEmitter<StepChangingEvent>; /** Emits when the current step has changed. */ stepChange: EventEmitter<number>; /** Emits when the user tries to continue but the current step is invalid. */ stepError: EventEmitter<number>; steps: QueryList<WizardStepComponent>; footerTemplate: TemplateRef<WizardFooterContext>; id: string; invalidIndicator: boolean; /** * The current active step. When the step changes an event will be emitted containing the index of the newly active step. * If this is not specified the wizard will start on the first step. */ get step(): number; set step(value: number); private _step; protected readonly _onDestroy: Subject<void>; ngOnInit(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** * Navigate to the next step */ next(): Promise<void>; /** * Whether the Next or Finish button should be disabled. */ isNextDisabled(): boolean; /** * Navigate to the previous step */ previous(): void; /** * Perform actions when the finish button is clicked */ finish(): Promise<void>; /** * Perform actions when the cancel button is clicked */ cancel(): void; /** * Update the active state of each step */ update(): void; /** * Jump to a specific step only if the step has previously been visited */ gotoStep(step: WizardStepComponent): void; /** * Determine if the current step is the last step */ isLastStep(): boolean; /** * Reset the wizard - goes to first step and resets visited state */ reset(): void; /** * Get the step at the current index */ getCurrentStep(): WizardStepComponent; /** * Return a step at a specific index */ getStepAtIndex(index: number): WizardStepComponent; /** * If a step in the wizard becomes invalid, all steps sequentially after * it should become unvisited */ protected setFutureStepsUnvisited(currentStep: WizardStepComponent): void; /** * Get the currently active step and all steps beyond it */ protected getFutureSteps(currentStep: WizardStepComponent): WizardStepComponent[]; /** * Returns the valid status of the current step, including the `validation` function (if provided). */ private isStepValid; static ɵfac: i0.ɵɵFactoryDeclaration<WizardComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<WizardComponent, "ux-wizard", never, { "orientation": { "alias": "orientation"; "required": false; }; "nextText": { "alias": "nextText"; "required": false; }; "previousText": { "alias": "previousText"; "required": false; }; "cancelText": { "alias": "cancelText"; "required": false; }; "finishText": { "alias": "finishText"; "required": false; }; "nextTooltip": { "alias": "nextTooltip"; "required": false; }; "previousTooltip": { "alias": "previousTooltip"; "required": false; }; "cancelTooltip": { "alias": "cancelTooltip"; "required": false; }; "finishTooltip": { "alias": "finishTooltip"; "required": false; }; "nextAriaLabel": { "alias": "nextAriaLabel"; "required": false; }; "previousAriaLabel": { "alias": "previousAriaLabel"; "required": false; }; "cancelAriaLabel": { "alias": "cancelAriaLabel"; "required": false; }; "finishAriaLabel": { "alias": "finishAriaLabel"; "required": false; }; "nextDisabled": { "alias": "nextDisabled"; "required": false; }; "previousDisabled": { "alias": "previousDisabled"; "required": false; }; "cancelDisabled": { "alias": "cancelDisabled"; "required": false; }; "finishDisabled": { "alias": "finishDisabled"; "required": false; }; "nextVisible": { "alias": "nextVisible"; "required": false; }; "previousVisible": { "alias": "previousVisible"; "required": false; }; "cancelVisible": { "alias": "cancelVisible"; "required": false; }; "finishVisible": { "alias": "finishVisible"; "required": false; }; "cancelAlwaysVisible": { "alias": "cancelAlwaysVisible"; "required": false; }; "finishAlwaysVisible": { "alias": "finishAlwaysVisible"; "required": false; }; "disableNextWhenInvalid": { "alias": "disableNextWhenInvalid"; "required": false; }; "resetVisitedOnValidationError": { "alias": "resetVisitedOnValidationError"; "required": false; }; "sequential": { "alias": "sequential"; "required": false; }; "step": { "alias": "step"; "required": false; }; }, { "onNext": "onNext"; "onPrevious": "onPrevious"; "onCancel": "onCancel"; "onFinishing": "onFinishing"; "onFinish": "onFinish"; "stepChanging": "stepChanging"; "stepChange": "stepChange"; "stepError": "stepError"; }, ["footerTemplate", "steps"], ["*"], false, never>; } export declare class StepChangingEvent { from: number; to: number; constructor(from: number, to: number); } export interface WizardFooterContext { step: number; }