UNPKG

@sixbell-telco/sdk

Version:

A collection of reusable components designed for use in Sixbell Telco Angular projects

222 lines (221 loc) 7.22 kB
import * as i0 from "@angular/core"; /** * Enum-like object representing possible wizard step statuses * @readonly * @enum {string} */ export declare const WIZARD_STEP_STATUS: { readonly IN_PROGRESS: "in progress"; readonly PENDING: "pending"; readonly COMPLETED: "completed"; }; /** * Configuration object for a wizard step * @property {string} name - Unique identifier for the step * @property {(typeof WIZARD_STEP_STATUS)[keyof typeof WIZARD_STEP_STATUS]} status - Current status of the step * @property {boolean} isValid - Indicates if the step's data is valid * @property {string} label - Display text for the step * @property {string} [icon] - Optional icon for the step */ export type WizardStepConfig = { name: string; status: (typeof WIZARD_STEP_STATUS)[keyof typeof WIZARD_STEP_STATUS]; isValid: boolean; label: string; icon?: string; }; /** * Simplified step definition without status and validation * @property {string} name - Unique identifier for the step * @property {string} label - Display text for the step * @property {string} [icon] - Optional icon for the step */ export type WizardStep = Omit<WizardStepConfig, 'status' | 'isValid'>; /** * Union type of possible wizard step status values */ export type WizardStepStatus = (typeof WIZARD_STEP_STATUS)[keyof typeof WIZARD_STEP_STATUS]; /** * Service for managing wizard state and navigation * @Injectable */ export declare class WizardService { /** @private Internal signal for wizard steps */ private readonly _steps; /** @private Internal signal for current step index */ private readonly _currentStepIndex; /** @private Internal signal for first step index */ private readonly _fistStepIndex; /** @private Internal signal for last step index */ private readonly _lastStepIndex; /** @private Internal signal for transition state */ private readonly _isTransitioning; /** Readonly array of wizard steps */ steps: import("@angular/core").Signal<WizardStepConfig[]>; /** * Current step index * @readonly */ currentStepIndex: import("@angular/core").Signal<number>; /** * Currently active step * @readonly */ currentStep: import("@angular/core").Signal<WizardStepConfig>; /** * Array of valid steps * @readonly */ validSteps: import("@angular/core").Signal<WizardStepConfig[]>; /** * Indicates if all steps are valid * @readonly */ areAllStepsValid: import("@angular/core").Signal<boolean>; /** * First step index * @readonly */ fistStepIndex: import("@angular/core").Signal<number>; /** * First step in the wizard * @readonly */ firstStep: import("@angular/core").Signal<WizardStepConfig>; /** * Last step index * @readonly */ lastStepIndex: import("@angular/core").Signal<number>; /** * Last step in the wizard * @readonly */ lastStep: import("@angular/core").Signal<WizardStepConfig>; /** * Completed steps * @readonly */ completedSteps: import("@angular/core").Signal<WizardStepConfig[]>; /** * Pending steps * @readonly */ pendingSteps: import("@angular/core").Signal<WizardStepConfig[]>; /** * In-progress steps * @readonly */ inProgressSteps: import("@angular/core").Signal<WizardStepConfig[]>; /** * Indicates if all steps are completed * @readonly */ isCompleted: import("@angular/core").Signal<boolean>; /** * Indicates if current step is the first step * @readonly */ isCurrentStepFirst: import("@angular/core").Signal<boolean>; /** * Indicates if current step is the last step * @readonly */ isCurrentStepLast: import("@angular/core").Signal<boolean>; /** * Indicates if wizard is transitioning between steps * @readonly */ isTransitioning: import("@angular/core").Signal<boolean>; /** * Initializes the wizard with given steps * @param {WizardStep[]} steps - Array of step configurations */ init(steps: WizardStep[]): void; /** * Replaces all steps with new configuration * @param {WizardStepConfig[]} steps - New array of step configurations */ setSteps(steps: WizardStepConfig[]): void; /** * Adds a new step to the end of the wizard * @param {WizardStepConfig} step - Step configuration to add */ addStep(step: WizardStepConfig): void; /** * Inserts a step at specific index * @param {number} index - Position to insert the step * @param {WizardStepConfig} step - Step configuration to add */ addStepAtIndex(index: number, step: WizardStepConfig): void; /** * Removes step at specified index * @param {number} index - Index of step to remove */ removeStep(index: number): void; /** * Updates name of step at specified index * @param {number} index - Index of step to update * @param {string} name - New name for the step */ updateStepName(index: number, name: string): void; /** * Updates label of step at specified index * @param {number} index - Index of step to update * @param {string} label - New label for the step */ updateStepLabel(index: number, label: string): void; /** * Updates status of step at specified index * @param {number} index - Index of step to update * @param {WizardStepStatus} status - New status for the step * @param {number} [stale] - Optional delay in milliseconds before applying changes */ updateStepStatus(index: number, status: WizardStepStatus, stale?: number): void; /** * Updates validation status of step at specified index * @param {number} index - Index of step to update * @param {boolean} isValid - New validation status */ updateStepIsValid(index: number, isValid: boolean): void; /** * Replaces entire step configuration at specified index * @param {number} index - Index of step to replace * @param {WizardStepConfig} step - New step configuration */ updateStep(index: number, step: WizardStepConfig): void; /** * Sets current active step index * @param {number} index - New current step index */ setCurrentStepIndex(index: number): void; /** * Sets index for first step in wizard * @param {number} index - New first step index */ setFistStepIndex(index: number): void; /** * Sets index for last step in wizard * @param {number} index - New last step index */ setLastStepIndex(index: number): void; /** * Navigates to next valid step */ nextStep(): void; /** * Navigates to previous step */ previousStep(): void; /** * Jumps to specified step index * @param {number} index - Target step index to navigate to */ gotoStep(index: number): void; /** * Resets wizard to initial state */ reset(): void; static ɵfac: i0.ɵɵFactoryDeclaration<WizardService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<WizardService>; }