Represents a button component with a popover that displays a form.

  • Type Parameters

    • Data extends {} = any

      The type of data for the form.

    • Payload extends unknown = any

      The type of payload for the button handler.

    Parameters

    • props: IOneButtonProps<Data, Payload>

      The properties of the button component.

      IOneButtonProps

      • [key: string]: ButtonProps
      • [key: number]: ButtonProps
      • [key: symbol]: ButtonProps
      • OptionalbadgeColor?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "default"

        The color of the badge. Default is 'primary'.

      • OptionalbadgeOverlap?: "rectangular" | "circular"

        The overlap type for the badge. Default is 'rectangular'.

      • OptionalbadgeSx?: any

        The style for the badge. Default is null.

      • OptionalcloseSubject?: TSubject<void>
      • Optionalcolor?: "error" | "inherit" | "primary" | "secondary" | "success" | "info" | "warning"

        The color of the button. Default is 'inherit'.

      • OptionalfieldDebounce?: number

        The debounce time in milliseconds for field changes. Default is null.

      • fields: IField<Data, Payload>[]

        An array of IField objects representing the fields associated with the button.

      • handler: OneHandler<Data, Payload>

        The handler function to be invoked when the button is clicked.

      • OptionalincomingTransform?: (data: any, payload: Payload) => Data
      • OptionalisBaseline?: (field: IField) => boolean
      • OptionalisBaselineForRoot?: (field: IField) => boolean
      • OptionalnoBadge?: boolean

        Determines whether to display a badge on the button. Default is false.

      • OptionalonBlur?: (
            name: string,
            data: Data,
            payload: Payload,
            onValueChange: (value: Value) => void,
            onChange: (data: Data) => void,
        ) => void

        The blur callback function for the button. Default is null.

      • OptionalonChange?: (Data: Data, initial: boolean) => void

        The change callback function for the button. Default is null.

      • OptionalonClose?: (data: Data) => void
      • OptionaloneSx?: any

        The style for the button. Default is null.

      • OptionalonFocus?: (
            name: string,
            data: Data,
            payload: Payload,
            onValueChange: (value: Value) => void,
            onChange: (data: Data) => void,
        ) => void

        The focus callback function for the button. Default is null.

      • OptionalonInvalid?: (name: string, msg: string, payload: Payload) => void

        The invalidity callback function for the button. Default is null.

      • OptionaloutgoingTransform?: (data: any, payload: Payload) => Data
      • Optionalpayload?: Payload | () => Payload

        The payload to be passed to the handler when the button is clicked.

      • OptionalreadTransform?: (value: string | string[], name: string, data: Data, payload: Payload) => Value
      • OptionalreloadSubject?: TSubject<void>
      • OptionalwaitForChangesDelay?: number

        The delay time in milliseconds to wait for changes before invoking the handler. Default is null.

      • OptionalwithCloseAfterChange?: boolean
      • OptionalwriteTransform?: (value: string | string[], name: string, data: Data, payload: Payload) => Value

    Returns any

    • Returns null if loading or error, otherwise returns the button component with popover.