@totalsoft/rocket-ui
Version:
A set of reusable and composable React components built on top of Material UI core for developing fast and friendly web applications interfaces.
29 lines (28 loc) • 897 B
TypeScript
import React from 'react';
export declare enum ControlType {
Text = "Text",
Integer = "Integer",
Numeric = "Numeric",
Date = "Date",
Checkbox = "Checkbox",
Autocomplete = "Autocomplete",
Custom = "Custom"
}
export type DynamicFieldProps<TCustomComponentProps extends object = any, TAutocompleteOptions = any> = {
controlType: ControlType;
id?: string;
value?: unknown;
label?: string;
onChange?: (value: unknown) => void;
options?: readonly TAutocompleteOptions[];
loadOptions?: (input?: string) => Promise<readonly TAutocompleteOptions[]>;
isPaginated?: boolean;
error?: boolean;
helperText?: React.ReactNode;
required?: boolean;
readOnly?: boolean;
disabled?: boolean;
CustomComponent?: (props: TCustomComponentProps) => JSX.Element;
customComponentProps?: TCustomComponentProps;
[key: string]: any;
};