IOneButtonProps

interface IOneButtonProps<
    Data extends {} = IAnything,
    Payload extends IAnything = IAnything,
> {
    badgeColor?:
        | "error"
        | "primary"
        | "secondary"
        | "success"
        | "info"
        | "warning"
        | "default";
    badgeOverlap?: "rectangular"
    | "circular";
    badgeSx?: any;
    closeSubject?: TSubject<void>;
    color?:
        | "error"
        | "inherit"
        | "primary"
        | "secondary"
        | "success"
        | "info"
        | "warning";
    fieldDebounce?: number;
    fields: IField<Data, Payload>[];
    handler: OneHandler<Data, Payload>;
    incomingTransform?: (data: any, payload: Payload) => Data;
    isBaseline?: (field: IField) => boolean;
    isBaselineForRoot?: (field: IField) => boolean;
    noBadge?: boolean;
    onBlur?: (
        name: string,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void;
    onChange?: (Data: Data, initial: boolean) => void;
    onClose?: (data: Data) => void;
    oneSx?: any;
    onFocus?: (
        name: string,
        data: Data,
        payload: Payload,
        onValueChange: (value: Value) => void,
        onChange: (data: Data) => void,
    ) => void;
    onInvalid?: (name: string, msg: string, payload: Payload) => void;
    outgoingTransform?: (data: any, payload: Payload) => Data;
    payload?: Payload | () => Payload;
    readTransform?: (
        value: string | string[],
        name: string,
        data: Data,
        payload: Payload,
    ) => Value;
    reloadSubject?: TSubject<void>;
    waitForChangesDelay?: number;
    withCloseAfterChange?: boolean;
    writeTransform?: (
        value: string | string[],
        name: string,
        data: Data,
        payload: Payload,
    ) => Value;
    [key: string]: ButtonProps;
    [key: number]: ButtonProps;
    [key: symbol]: ButtonProps;
}

Type Parameters

  • Data extends {} = IAnything

    The data type of the IField object's data property

  • Payload extends IAnything = IAnything

    The payload type of the IField object

Hierarchy

  • Omit<
        dayjs,
        keyof {
            color: never;
            onBlur: never;
            onChange: never;
            onClick: never;
            onFocus: never;
            onInvalid: never;
        },
    >
    • IOneButtonProps

Indexable

  • [key: string]: ButtonProps
  • [key: number]: ButtonProps
  • [key: symbol]: ButtonProps

Properties

badgeColor?:
    | "error"
    | "primary"
    | "secondary"
    | "success"
    | "info"
    | "warning"
    | "default"

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

badgeOverlap?: "rectangular" | "circular"

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

badgeSx?: any

The style for the badge. Default is null.

closeSubject?: TSubject<void>
color?:
    | "error"
    | "inherit"
    | "primary"
    | "secondary"
    | "success"
    | "info"
    | "warning"

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

fieldDebounce?: 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.

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

incomingTransform?: (data: any, payload: Payload) => Data
isBaseline?: (field: IField) => boolean
isBaselineForRoot?: (field: IField) => boolean
noBadge?: boolean

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

onBlur?: (
    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.

onChange?: (Data: Data, initial: boolean) => void

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

onClose?: (data: Data) => void
oneSx?: any

The style for the button. Default is null.

onFocus?: (
    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.

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

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

outgoingTransform?: (data: any, payload: Payload) => Data
payload?: Payload | () => Payload

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

readTransform?: (
    value: string | string[],
    name: string,
    data: Data,
    payload: Payload,
) => Value
reloadSubject?: TSubject<void>
waitForChangesDelay?: number

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

withCloseAfterChange?: boolean
writeTransform?: (
    value: string | string[],
    name: string,
    data: Data,
    payload: Payload,
) => Value