Interface InputOptionsNotificationOptions

Configuration for an options dialog.

interface InputOptionsNotificationOptions {
    cancelOption?: string;
    createOptionsButton?: ((option, props, isDefaultOption) => ReactNode);
    defaultOption?: string;
    description?: string;
    icon?: ReactNode;
    initialValue?: string;
    inputLabel?: string;
    inputPlaceHolder?: string;
    inputProps?: HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>;
    onInputOption?: ((input?, option?) => void);
    onOption?: ((option, isCancel, isDefault) => void);
    onValidateInputOption?: ((input?, option?) => InputValidationResults | Promise<InputValidationResults>);
    onValidateOption?: ((option?) => boolean | Promise<boolean>);
    options?: string[];
    title?: string;
}

Hierarchy (view full)

Properties

cancelOption?: string

Allows for the cancel option to be specified. Allow for special styling.

Default Value

'Cancel'
createOptionsButton?: ((option, props, isDefaultOption) => ReactNode)

Hook for create custom options buttons

Type declaration

    • (option, props, isDefaultOption): ReactNode
    • Parameters

      • option: string
      • props: HTMLAttributes<HTMLButtonElement> & Attributes
      • isDefaultOption: boolean

      Returns ReactNode

Remarks

The option is passed as the children prop and as the second argument

defaultOption?: string

Allows for the option will be the default selected option and the enter key trigger.

Default Value

The first option
description?: string

Display text information for the user to make a decision.

icon?: ReactNode

Display an icon next to the description for additional context

Remarks

Not yet implemented

initialValue?: string
inputLabel?: string
inputPlaceHolder?: string
inputProps?: HTMLAttributes<HTMLInputElement | HTMLTextAreaElement>

Css style for input

onInputOption?: ((input?, option?) => void)

Type declaration

    • (input?, option?): void
    • Parameters

      • Optional input: string
      • Optional option: string

      Returns void

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

Call when an option is selected.

Type declaration

    • (option, isCancel, isDefault): void
    • Parameters

      • option: string
      • isCancel: boolean
      • isDefault: boolean

      Returns void

Remarks

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

onValidateInputOption?: ((input?, option?) => InputValidationResults | Promise<InputValidationResults>)

Call when an option is selected. If false is returned, the the dialog will not close. Notification is not provided but can be supplied via the textFieldProps helperText property.

Type declaration

Remarks

Optional the textProps can be updated via the textFieldProps argument

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

Call when an option is selected. If false is returned, the the dialog will not close. Notification is not provided but can be supplied via the textFieldProps helperText property.

Type declaration

    • (option?): boolean | Promise<boolean>
    • Parameters

      • Optional option: string

      Returns boolean | Promise<boolean>

options?: string[]

The options as a list of strings

title?: string

The title of the options panel