SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ShowInputOptions<T, C>

    Configuration for an options dialog.

    interface ShowInputOptions<T = string, C = any> {
        autoFocus?: string | boolean | FocusWindowOptions;
        cancelOption?: OptionInput;
        context?: () => C;
        defaultOption?: OptionInput;
        description?: string;
        disableAutoDestroy?: boolean;
        icon?: ReactNode;
        initialValue?: T;
        inputLabel?: string;
        inputPlaceHolder?: string;
        inputType?:
            | "number"
            | "search"
            | "text"
            | "password"
            | "email"
            | "tel"
            | "url";
        isModal?: boolean;
        onInput?: (input?: T, option?: OptionInput) => void | Promise<void>;
        onKeyDown?: (e: KeyboardEvent) => void;
        onOption?: (
            option: OptionInput,
            isCancel: boolean,
            isDefault: boolean,
        ) => void;
        onValidateInput?: (
            input?: T,
            option?: OptionInput,
        ) => InputValidationResults | Promise<InputValidationResults>;
        onValidateOption?: (option?: OptionInput) => boolean | Promise<boolean>;
        options?: OptionInput[];
        prewarm?: boolean;
        propsInput?: HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
        title?: string;
        type?: NotifierType;
    }

    Type Parameters

    • T = string
    • C = any

    Hierarchy (View Summary)

    Index
    autoFocus?: string | boolean | FocusWindowOptions

    Query selector for the element to focus on show.

    cancelOption?: OptionInput

    The cancel option (Esc key), matched against the options by identity. Gets special styling.

    'Cancel'
    
    context?: () => C
    defaultOption?: OptionInput

    The option that is the default (Enter key), matched against the options by identity (a string matches an option's id/string form, an InputOption matches by reference).

    The first option
    
    description?: string

    Display text information for the user to make a decision.

    disableAutoDestroy?: boolean

    If true the window will not be automatically destroyed when closed.

    icon?: ReactNode

    An icon beside the description, in place of the one type implies. A string is an icon key.

    initialValue?: T

    A value the window can use to display.

    inputLabel?: string
    inputPlaceHolder?: string
    inputType?: "number" | "search" | "text" | "password" | "email" | "tel" | "url"
    isModal?: boolean

    If true show a backdrop.

    Our movable menu achieves modality without a background by listens to global clicks (and focus)

    false
    
    onInput?: (input?: T, option?: OptionInput) => void | Promise<void>
    onKeyDown?: (e: KeyboardEvent) => void

    Allow for tracking of key down events.

    Type Declaration

      • (e: KeyboardEvent): void
      • Parameters

        • e: KeyboardEvent

        Returns void

    onOption?: (option: OptionInput, isCancel: boolean, isDefault: boolean) => void

    Call when an option is selected. option is the selected option's IDENTITY (its id if provided, else the string form, else the InputOption object).

    It is possible that the option can be both a cancel and a default option.

    onValidateInput?: (
        input?: T,
        option?: OptionInput,
    ) => InputValidationResults | Promise<InputValidationResults>

    Validates the current input. Returning { valid: false } keeps the dialog open and shows message under the field.

    Called in two situations, told apart by option:

    • option is undefined — the user typed. Fires on every keystroke, so this path must stay cheap (a format/duplicate-name check).
    • option is set — the user submitted. This is where expensive work belongs (a network round-trip, a password derivation); it is awaited, and the activated button shows a spinner while it runs.

    An expensive validator MUST therefore branch on option — otherwise it runs once per keystroke.

    onValidateOption?: (option?: OptionInput) => boolean | Promise<boolean>

    Call when an option is selected. If false is returned, the dialog will not close. INotifier is not provided but can be supplied via the textFieldProps helperText property. option is the selected option's identity (see onOption).

    options?: OptionInput[]

    The dialog buttons: plain identity strings or rich InputOptions (mixable).

    prewarm?: boolean

    Mount the window hidden (do not reveal it) so a later real open is an instant reuse. Implies disableAutoDestroy (a prewarmed window must be kept alive). Use at idle to move the heavy first-mount cost off the user's open. A no-op if an instance already exists.

    false
    
    propsInput?: HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>

    Css style for input

    title?: string

    The title of the options panel

    What kind of message this is. info, warning, error and success show the matching icon beside the description; default (or omitted) shows none.