import { FASTElement } from "@microsoft/fast-element"; import { WizardStep } from "../wizard-step/wizard-step.js"; /** * # Wizard * A customizable wizard component for a step-by-step interface. * * @summary A customizable wizard component for a step-by-step interface. * * @example * ```html * * Step One * Content for Step One * Step Two * Content for Step Two *
Wizard Title
* Next *
* ``` * * @attr {boolean} numbered - Determines whether the step state indicator should be labeled with the order of the steps. * @attr {boolean} linear - Indicates whether the wizard enforces linear step completion. * @attr {boolean} disable-on-complete - Indicates whether steps should be disabled on completion. * @attr {number} current-index - The current index of the active step. * * @prop {number} numbered - Determines whether the step state indicator should be labeled with the order of the steps. * @prop {boolean} linear - Indicates whether the wizard enforces linear step completion. * @prop {number} currentIndex - The current index of the active step. * @prop {boolean} disableOnComplete - Indicates whether steps should be disabled on completion. * @prop {HTMLElement} stepcontainer - The container for wizard steps. * @prop {HTMLElement} panelcontainer - The container for wizard panels. * @prop {HTMLElement[]} slottedsteps - The list of slotted wizard steps. * @prop {Button[]} slottedactions - The list of slotted buttons. * @prop {HTMLElement[]} slottedpanels - The list of slotted wizard panels. * @prop {string | undefined} activeid - The ID of the active step. * @prop {WizardStep | undefined} activestep - The currently active step. * @prop {number | undefined} prevActiveStepIndex - The index of the previously active step. * * @slot step - Slot for adding WizardStep components, representing each step in the wizard. * @slot panel - Slot for adding WizardPanel components, representing the content of each step. * @slot title - Slot for adding a title to the wizard. * @slot button - Slot for adding buttons to the wizard toolbar. * @slot actions - Slot for action buttons rendered in the toolbar area, such as Back and Next controls. * @slot end - Slot for content appended after the panels container. * @slot start - Slot for content prepended before the main wizard area. * * @csspart wizard - The root element of the wizard component. * @csspart steps - The navigation element (tablist) that contains the WizardStep components. * @csspart panels - The wrapper element containing all WizardPanel components. * @csspart panels-container - The outer container wrapping the toolbar and panels sections. * @csspart title - The element that renders the title slot content. * @csspart toolbar - The toolbar row containing the title element and action buttons. * @csspart button-container - The container element wrapping the actions slot inside the toolbar. * * @cssprop --wizard-tablist-width - Set's the width of the Wizard tablist step container * @cssprop --wizard-toolbar-display - Set's the display of the wizard toolbar * @cssprop --wizard-overflow-step-width - Sets the width of each wizard step in overflow mode. * @cssprop --wizard-overflow-tablist-width - Sets the width of the wizard tablist in overflow mode. * @cssprop --wizard-scrollbar-radius - Sets the border radius of the wizard overflow scrollbar. * @cssprop --wizard-scrollbar-spacing - Sets the spacing around the wizard overflow scrollbar. * @cssprop --wizard-scrollbar-thumb-color - Sets the color of the wizard overflow scrollbar thumb. * @cssprop --wizard-scrollbar-track-color - Sets the color of the wizard overflow scrollbar track. * * @method next() - Moves to the next step. * @method previous() - Moves to the previous step. * @method show() - Shows the wizard. * @method hide() - Hides the wizard. * @method enableStep(index?: number) - Enables the specified step. * @method disableStep(index?: number) - Disables the specified step. * @method errorStep(index?: number) - Sets the specified step to an error state. * @method completeStep(index?: number) - Completes the specified step. * @method incompleteStep(index?: number) - Sets the specified step to an incomplete state. * @method getStepStatus() - Gets the status of the steps. * @method reset() - Resets the wizard to its initial state. * @method setActiveStep(step: WizardStep) - Sets the active step. * @method focusNextStep(setActive?: boolean) - Focuses the next step. * @method focusPreviousStep(setActive?: boolean) - Focuses the previous step. * @method moveToStepByIndex(index: number, moveFocus?: boolean) - Moves to the step by its index. * * @fires wizard-change - Fires when there is a change in the wizard, providing the current index and active ID. * @fires wizard-complete - Fires when all steps in the wizard are complete. * * @extends FASTElement * @tagname fabric-wizard * @public */ export declare class Wizard extends FASTElement { /** * Indicates whether the steps should be visually numbered at smaller viewports. * @public * @attr * @type {boolean} * @default false */ numbered?: boolean; /** * Indicates whether the wizard enforces linear step completion. * @public * @attr * @type {boolean} * @default false */ linear?: boolean; /** * Indicates whether steps should be disabled on completion. * @public * @attr * @type {boolean} * @default false */ disableOnComplete?: boolean; /** * The current index of the active step. * @public * @attr * @type {number} * @default 0 */ currentIndex: number; /** * The container for wizard steps. * @public * @observable * @type {HTMLElement} */ stepcontainer: HTMLElement; /** * The container for wizard panels. * @public * @observable * @type {HTMLElement} */ panelcontainer: HTMLElement; /** * The list of slotted wizard steps. * @public * @observable * @type {HTMLElement[]} */ slottedsteps: HTMLElement[]; /** * The list of slotted buttons. * @public * @observable * @type {HTMLElement[]} */ slottedactions: HTMLElement[]; /** * The list of slotted wizard panels. * @public * @observable * @type {HTMLElement[]} */ slottedpanels: HTMLElement[]; /** * The ID of the active step. * @private * @observable * @type {string | undefined} */ private activeid?; /** * The currently active step. * @public * @type {WizardStep | undefined} */ activestep?: WizardStep; /** * The index of the previously active step. * @private * @type {number | undefined} */ private prevActiveStepIndex?; /** * The list of step IDs. * @private * @type {string[]} */ private stepIds; /** * The list of panel IDs. * @private * @type {string[]} */ private panelIds; /** * Called when the element is connected to the DOM. * @public */ connectedCallback(): void; /** * Called when the element is disconnected from the DOM. * @public */ disconnectedCallback(): void; /** * Handles changes to the activeid attribute. * @public * @param {string} oldValue - The previous value of the active ID. * @param {string} newValue - The new value of the active ID. */ activeidChanged(oldValue: string, newValue: string): void; /** * Handles changes to the slotted panels. * @public */ slottedpanelsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void; /** * Handles changes to the slotted steps. * @public */ slottedstepsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void; /** * Handles changes to the current index. * @public * @param {number} oldValue - The previous value of the current index. * @param {number} newValue - The new value of the current index. */ currentIndexChanged(oldValue: number, newValue: number): void; /** * Moves to the next step. * @public */ next(): void; /** * Moves to the previous step. * @public */ previous(): void; /** * Shows the wizard. * @public */ show(): void; /** * Hides the wizard. * @public */ hide(): void; /** * Enables the specified step. * @public * @param {number} [index] - The index of the step to enable. */ enableStep(index?: number): void; /** * Disables the specified step. * @public * @param {number} [index] - The index of the step to disable. */ disableStep(index?: number): void; /** * Sets the specified step to an error state. * @public * @param {number} [index] - The index of the step to set to an error state. */ errorStep(index?: number): void; /** * Completes the specified step. * @public * @param {number} [index] - The index of the step to complete. */ completeStep(index?: number): void; /** * Sets the specified step to an incomplete state. * @public * @param {number} [index] - The index of the step to set to an incomplete state. */ incompleteStep(index?: number): void; /** * Gets the status of the steps. * @public * @returns {Array<{id: string, state: string, index: number, active: boolean}>} */ /** * Returns an array of objects representing the status of each wizard step. * * Each object in the returned array contains: * - `id`: The HTML element ID of the step. * - `state`: The current state of the step. * - `index`: The zero-based index of the step. * - `active`: Whether the step is currently active. * * @returns An array of step status objects for all slotted steps. */ getStepStatus(): { id: string; state: string; index: number; active: boolean; }[]; /** * Resets the wizard to its initial state. * @public */ reset(): void; /** * Sets the active step. * @public * @param {HTMLElement} step - The step to set as active. */ setActiveStep(step: HTMLElement): void; /** * Focuses the next step. * @public * @param {boolean} [setActive=false] - Indicates whether to set the next step as active. */ focusNextStep(setActive?: boolean): void; /** * Focuses the previous step. * @public * @param {boolean} [setActive=false] - Indicates whether to set the previous step as active. */ focusPreviousStep(setActive?: boolean): void; /** * Moves to the step by its index. * @public * @param {number} index - The index of the step to move to. * @param {boolean} [moveFocus=true] - Whether to move keyboard focus to the step. */ moveToStepByIndex(index: number, moveFocus?: boolean): void; /** * Handles keydown events on the step container. * @public * @param {KeyboardEvent} event - The keyboard event. */ handleStepContainerKeydown(event: KeyboardEvent): void | boolean; /** * Handles keydown events on a step. * @public * @param {KeyboardEvent} event - The keyboard event. */ handleStepKeyDown(event: KeyboardEvent): void | boolean; /** * Sets the steps and updates their attributes. * @protected */ protected setSteps(): void; /** * Sets the panels and updates their attributes. * @protected */ protected setPanels(): void; /** * Adds event listeners to steps and panels. * @protected */ protected addListeners(): void; /** * Removes event listeners from steps and panels. * @protected */ protected removeListeners(): void; /** * Sets the component and updates its state. * @private */ private setComponent; /** * Gets the active step index. * @private * @returns {number} */ private getActiveIndex; /** * Gets the IDs of the steps. * @private * @returns {string[]} */ private getStepIds; /** * Gets the IDs of the panels. * @private * @returns {string[]} */ private getPanelIds; /** * Determines if the element is disabled. * @private * @param {Element} el - The element to check. * @returns {boolean} */ private isDisabledElement; /** * Determines if the element is hidden. * @private * @param {Element} el - The element to check. * @returns {boolean} */ private isHiddenElement; /** * Determines if the element is focusable. * @private * @param {Element} el - The element to check. * @returns {boolean} */ private isFocusableElement; /** * Handles the step state change event. * @private * @param {CustomEvent} e - The custom event. */ private handleWizardStepStateChange; /** * Handles the panel state change event. * @private * @param {CustomEvent} e - The custom event. */ private handlePanelStateChange; /** * Handles the step select event. * @private * @param {Event} event - The event. */ private handleStepSelect; /** * Emits a wizard change event. * @fires wizard-change * @private */ private emitChange; /** * Emits a wizard complete event. * @fires wizard-complete * @private */ private emitComplete; private setAllStepTabIndex; private focusFirstEnabledStep; private handleStepContainerFocus; private handleStepContainerBlur; } //# sourceMappingURL=wizard.d.ts.map