@connect-soft/mui-hook-form
Version:
682 lines (646 loc) • 29.9 kB
TypeScript
import { AllSystemCSSProperties } from '@mui/system/styleFunctionSx/styleFunctionSx';
import * as react from 'react';
import { ReactNode, PropsWithChildren, Ref, MouseEvent, ChangeEvent, ElementType } from 'react';
import { IDialogContainerProps as IDialogContainerProps$1 } from '@/wrappers/Dialog';
import * as _mui_material_styles from '@mui/material/styles';
import { SxProps, Theme, Breakpoint } from '@mui/material/styles';
import { RegisterOptions } from 'react-hook-form';
import { ICheckboxProps as ICheckboxProps$1 } from '@/fields/Checkbox';
import { IColorPickerProps as IColorPickerProps$1 } from '@/fields/ColorPicker';
import { IDatePickerProps as IDatePickerProps$1 } from '@/fields/DatePicker';
import { IDateRangePickerProps as IDateRangePickerProps$1 } from '@/fields/DateRangePicker';
import { IMultiChipSelect as IMultiChipSelect$1 } from '@/fields/MultiChipSelect';
import { IMultiSelectProps as IMultiSelectProps$1 } from '@/fields/MultiSelect';
import { IPasswordProps } from '@/fields/Password';
import { ISelectProps as ISelectProps$1 } from '@/fields/Select';
import { ISwitchProps as ISwitchProps$1 } from '@/fields/Switch';
import { ITextFieldProps as ITextFieldProps$1 } from '@/fields/TextField';
import { ITimePickerProps as ITimePickerProps$1 } from '@/fields/TimePicker';
import { ITimeRangeOrTimeAndLengthValueType as ITimeRangeOrTimeAndLengthValueType$1, ITimeRangeOrTimeAndLengthProps as ITimeRangeOrTimeAndLengthProps$1 } from '@/fields/TimeRangeOrTimeAndLength';
import { ITimeRangePickerProps as ITimeRangePickerProps$1 } from '@/fields/TimeRangePicker';
import { ITransferListProps as ITransferListProps$1 } from '@/fields/TransferList';
import { IWeekdaysPickerProps as IWeekdaysPickerProps$1 } from '@/fields/WeekdaysPicker';
import { IButtonProps as IButtonProps$1 } from '@/wrappers/Button';
import { IIconButtonProps } from '@/wrappers/IconButton';
import { IDateTimeType } from '@connect-soft/date-helper';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { LocalizationProviderProps, DatePickerProps, TimePickerProps } from '@mui/x-date-pickers';
import { ButtonProps } from '@mui/material/Button';
import * as _mui_system from '@mui/system';
import * as _mui_material from '@mui/material';
import { DialogProps } from '@mui/material/Dialog';
import { DrawerProps } from '@mui/material/Drawer';
import { CheckboxProps } from '@mui/material/Checkbox';
import { ChipProps } from '@mui/material/Chip';
import { StackProps } from '@mui/material/Stack';
import { TextFieldProps } from '@mui/material/TextField';
import { CircularProgressProps } from '@mui/material/CircularProgress';
import * as dayjs from 'dayjs';
import { AutocompleteProps } from '@mui/material/Autocomplete';
import { OutlinedInputProps } from '@mui/material/OutlinedInput';
import { LinearProgressProps } from '@mui/material/LinearProgress';
import { RadioProps } from '@mui/material/Radio';
import { FormControlLabelProps } from '@mui/material/FormControlLabel';
import { RadioGroupProps } from '@mui/material/RadioGroup';
import { SwitchProps } from '@mui/material/Switch';
import { TooltipProps } from '@mui/material/Tooltip';
type ISupportedValueSimpleType = string | number | object | boolean | string[] | number[] | boolean[] | IDateTimeType | ITimeRangePickerProps$1['value'] | IDatePickerProps$1['value'] | IDateRangePickerProps$1['value'] | ITimeRangeOrTimeAndLengthValueType$1;
type IValuesOfSimpleFields = {
[name: string]: ISupportedValueSimpleType;
};
type IValueType$2 = ISupportedValueSimpleType | IValuesOfSimpleFields[];
type ISupportedValueType = {
[name: string]: IValueType$2;
};
type ICallable<RetValue> = RetValue | ((values: IOutputValueType) => RetValue);
type ICallableValue<RetValue> = {
value?: ICallable<RetValue>;
};
type ICallableRequireAttr<T> = Omit<T, 'required'> & {
required?: ICallable<boolean>;
};
type ICallableErrorAttr<T> = Omit<T, 'error'> & {
error?: ICallable<boolean>;
};
type ICallableDisableAttr<T> = Omit<T, 'disabled'> & {
disabled?: ICallable<boolean>;
};
type ICallableMinMaxTimeDurationAttr<T> = Omit<T, 'minStart' | 'maxDuration'> & {
minStart?: ICallable<ITimeRangeOrTimeAndLengthProps$1['minStart']>;
maxDuration?: ICallable<ITimeRangeOrTimeAndLengthProps$1['maxDuration']>;
};
type ISupportedInputTypes = 'abbreviation' | 'block' | 'button' | 'custom' | 'checkBox' | 'colorPicker' | 'datePicker' | 'dateRangePicker' | 'weekdays' | 'iconPicker' | 'html' | 'iconButton' | 'multiChipSelect' | 'multiSelect' | 'multiRowInputs' | 'newLine' | 'password' | 'select' | 'switch' | 'tabs' | 'timePicker' | 'timeRangePicker' | 'timeRangeOrTimeAndLength' | 'textArea' | 'textField' | 'transferList';
type IItem<PropsType> = {
type: ISupportedInputTypes;
changeValueOnlyFromInside?: boolean;
display?: (values: IOutputValueType) => boolean;
width?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
validation?: Omit<RegisterOptions, 'deps'>;
sx?: SxProps<Theme>;
connectedFields?: string | string[];
props: PropsType & {
name: string;
title?: string;
};
};
type IButtonItem = IItem<Omit<IButtonProps$1, 'type'> & {
type?: IButtonProps$1['type'] | 'cancel';
}> & {
type: 'button';
};
type ICheckboxItem = IItem<ICheckboxProps$1 & {
label: string;
}> & {
type: 'checkBox';
};
type IColorPickerItem = IItem<Omit<IColorPickerProps$1, 'control'>> & {
type: 'colorPicker';
};
type ICustomItem = IItem<{
label?: string;
render: (data: {
disabled: boolean;
fullName: string;
parentName?: string;
rowIndex?: number;
}) => ReactNode;
values: IValuesOfSimpleFields;
}> & {
type: 'custom';
};
type IDatePickerItem = IItem<IDatePickerProps$1> & {
type: 'datePicker';
};
type IDateRangePickerItem = IItem<Omit<IDateRangePickerProps$1, 'control' | 'getValues' | 'currentEnd' | 'currentStart' | 'inputFormat' | 'register' | 'setValue'> & {
inputFormat?: string;
}> & {
type: 'dateRangePicker';
};
type IDaysOfWeekItem = IItem<Omit<IWeekdaysPickerProps$1, 'control'>> & {
type: 'weekdays';
};
type IHtmlItem = IItem<{
widthByContent?: boolean;
render: () => react.ReactNode;
}> & {
type: 'html';
};
type IIconButtonItem = IItem<Omit<ICallableDisableAttr<IIconButtonProps>, 'type'> & {
type?: IIconButtonProps['type'] | 'cancel';
}> & {
type: 'iconButton';
};
type IMultiChipSelectItem = IItem<IMultiChipSelect$1> & {
type: 'multiChipSelect';
};
type IMultiSelectItem = IItem<ICallableRequireAttr<IMultiSelectProps$1>> & {
type: 'multiSelect';
};
type INewLineItem = IItem<{
type: 'hidden' | 'line';
}> & {
type: 'newLine';
};
type IPasswordItem = IItem<ICallableErrorAttr<IPasswordProps & {
confirmName?: string;
}>> & {
type: 'password';
isShowable?: boolean;
};
type ISelectItem = IItem<Omit<ICallableRequireAttr<ISelectProps$1<false>>, 'value'> & ICallableValue<ISelectProps$1<false>['value']>> & {
type: 'select';
};
type ISwitchItem = IItem<Omit<ISwitchProps$1, 'onChange'> & {
label: string;
onChange?: (value: boolean) => void;
}> & {
type: 'switch';
};
type ITabType = {
name: string;
label: string;
inputs: (ISimpleFieldTypes | IMultiRowInputsItem)[];
display?: (values: IOutputValueType) => boolean;
};
type ITabsItem = IItem<{
value: string;
contentContainer?: react.ElementType;
tabsContainer?: react.ElementType;
tabs: ITabType[];
}> & {
type: 'tabs';
deps?: string | string[];
};
type ITextAreaItem = IItem<ITextFieldProps$1> & {
type: 'textArea';
};
type ITimePickerItem = IItem<ITimePickerProps$1> & {
type: 'timePicker';
};
type ITimeRangePickerItem = IItem<Omit<ITimeRangePickerProps$1, 'onChange'>> & {
type: 'timeRangePicker';
};
type ITimeRangeOrTimeAndLengthItem = IItem<ICallableRequireAttr<ICallableMinMaxTimeDurationAttr<Omit<ITimeRangeOrTimeAndLengthProps$1, 'labelRange'>>>> & {
type: 'timeRangeOrTimeAndLength';
};
type ITextFieldItem = IItem<Omit<ICallableRequireAttr<ICallableDisableAttr<ITextFieldProps$1>>, 'onChange'> & {
onChange?: (newValue: string) => void;
}> & {
type: 'textField';
};
type ITransferListItem = IItem<ITransferListProps$1> & {
type: 'transferList';
};
type ISortMultiRowInputsItems = {
sort?: (inputs: IValuesOfSimpleFields[]) => void;
};
type IInputFieldTypes = IButtonItem | ICheckboxItem | ICustomItem | IColorPickerItem | IDatePickerItem | IDateRangePickerItem | IDaysOfWeekItem | IIconButtonItem | IMultiChipSelectItem | IMultiSelectItem | IPasswordItem | ISelectItem | ISwitchItem | ITimePickerItem | ITimeRangePickerItem | ITimeRangeOrTimeAndLengthItem | ITextAreaItem | ITextFieldItem | ITransferListItem;
type ISimpleFieldTypes = IInputFieldTypes | IHtmlItem | INewLineItem;
type IBlockItem = IItem<{
title: string;
fields: ISimpleFieldTypes[];
withBorder?: boolean;
wrapNameOfFields?: boolean;
}> & {
type: 'block';
};
type IMultiRowInputsItem = IItem<{
name: string;
/** Only for Tabs */
label?: string;
disableButtons?: boolean;
display?: (values: IOutputValueType) => boolean;
fixedSize?: boolean;
inputs: ISimpleFieldTypes[];
noFirstEmptyRow?: boolean;
value?: IValuesOfSimpleFields[];
onChange?: () => void;
}> & {
type: 'multiRowInputs';
} & ISortMultiRowInputsItems;
type ISupportedFieldType = IBlockItem | ITabsItem | ISimpleFieldTypes | IMultiRowInputsItem;
type IOutputValueType = ISupportedValueType;
type IBaseProps$1 = {
innerRef?: react.Ref<ICallableRef$2>;
/** Only for tests */
name: string;
displayAsModal?: boolean;
displayAsSidebar?: boolean;
error?: boolean;
icon?: react.ReactElement;
isEdit?: boolean;
justIcon?: boolean;
readOnly?: boolean;
noFullWidth?: boolean;
fields: (ISupportedFieldType | false)[];
actions?: ISupportedFieldType[];
maxWidth?: IDialogContainerProps$1['maxWidth'];
title?: react.ReactNode;
subTitle?: react.ReactNode;
openButtonRender?: (onClick: (event: react.MouseEvent) => void) => react.ReactElement;
openButtonValue?: string;
isLoaded?: boolean;
justifyContent?: AllSystemCSSProperties['justifyContent'];
onOpen?: () => void;
onSubmit?: (values: IOutputValueType, buttonName: string) => void;
};
type IModalProps = Omit<IBaseProps$1, 'title'> & {
title: react.ReactNode;
} & ({
displayAsModal: true;
} & {
displayAsSidebar: true;
});
type IPageFormProps = IBaseProps$1 & {
displayAsModal: false;
displayAsSidebar: false;
};
type IFormGeneratorProps = IBaseProps$1 | IModalProps | IPageFormProps;
type ICallableRef$2 = {
setFieldValue: (name: string, value: IValueType$2) => void;
getFieldValue: (name: string) => IValueType$2;
setOpen: (open: boolean) => void;
};
declare const FormGenerator: react.ForwardRefExoticComponent<IFormGeneratorProps & react.RefAttributes<HTMLFormElement>>;
type ISettingsContext = {
enableDOMAttributeRequired: boolean;
loadingSubmitButton: boolean;
hidingTabs: 'css' | 'js';
labels: {
range: string;
};
messages: {
invalidValuesFromTo: string;
invalidRangeOfValues: string;
required: string;
};
};
declare const FormSettingsContext: react.Context<Partial<ISettingsContext>>;
declare const FormSettingsProvider: ({ children, value }: PropsWithChildren<{
value: Partial<ISettingsContext>;
}>) => react_jsx_runtime.JSX.Element;
type IProps$1<TDate extends IDateTimeType, TLocal> = Omit<LocalizationProviderProps<TDate, TLocal>, 'dateAdapter'>;
declare const FormLocalizationProvider: (props: IProps$1<IDateTimeType, string>) => react_jsx_runtime.JSX.Element;
//# sourceMappingURL=LocalizationProvider.d.ts.map
type IButtonProps = Omit<ButtonProps, 'ref' | 'name'> & {
name: string;
};
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref" | "name"> & {
name: string;
} & react.RefAttributes<HTMLButtonElement>>;
type ICallableRef$1 = {
setOpen: (open: boolean) => void;
};
type IDialogContainerProps = Omit<DialogProps, 'open' | 'onClose'> & {
innerRef?: Ref<ICallableRef$1>;
open?: boolean;
onClose?: () => void;
};
type IBaseProps = Pick<IDialogContainerProps, 'fullWidth' | 'maxWidth'> & {
name: string;
open?: boolean;
title?: ReactNode;
subTitle?: ReactNode;
actions?: (onClose: () => void) => ReactNode;
openButtonValue: ReactNode;
openButton: (onClick: (event?: MouseEvent) => void) => ReactNode;
};
type IPropsWithOpenButton = Omit<IBaseProps, 'openButtonValue'> & {
openButtonValue?: IBaseProps['openButtonValue'];
};
type IDefaultProps = Omit<IBaseProps, 'openButton'> & {
openButton?: IBaseProps['openButton'];
};
type IDialogProps = IDefaultProps | IPropsWithOpenButton;
declare const Wrapper$1: ((props: PropsWithChildren<IDialogProps>) => react_jsx_runtime.JSX.Element) & {
Actions: react.FC<_mui_material.DialogActionsProps>;
Container: ({ innerRef, open, onClose, ...props }: IDialogContainerProps) => react_jsx_runtime.JSX.Element;
Content: ({ children }: _mui_material.DialogContentProps) => react_jsx_runtime.JSX.Element;
OpenButton: ({ name, render, value, ...rest }: React.PropsWithChildren<{
render?: (onClick: (event?: React.MouseEvent) => void) => React.ReactNode;
onClick: (event?: React.MouseEvent) => void;
value?: React.ReactNode;
name?: string;
}>) => react_jsx_runtime.JSX.Element;
Subtitle: ({ sx, children }: PropsWithChildren<{
sx?: _mui_system.SxProps<_mui_material.Theme> | undefined;
}>) => react_jsx_runtime.JSX.Element | null;
Title: ({ children, subTitle, onClose, ...props }: React.PropsWithChildren<Omit<_mui_material.DialogTitleProps, "onClick"> & {
subTitle?: React.ReactNode;
onClose?: () => void;
}>) => react_jsx_runtime.JSX.Element | null;
};
type ICallableRef = {
setOpen: (open: boolean) => void;
};
type IDrawerContainerProps = Omit<DrawerProps, 'onClose'> & {
innerRef?: React.Ref<ICallableRef>;
name?: string;
maxWidth?: string;
size?: Breakpoint;
onClose?: () => void;
};
type IDrawerProps = Omit<DrawerProps, 'open' | 'onClose'> & {
name: string;
open?: boolean;
title?: ReactNode;
subtitle?: ReactNode;
size?: Breakpoint;
openButtonValue?: ReactNode;
actions?: (onClose: () => void) => ReactNode;
onClose?: () => void;
};
declare const Wrapper: (({ actions, children, name, open, openButtonValue, subtitle, title, onClose, ...rest }: PropsWithChildren<IDrawerProps>) => react_jsx_runtime.JSX.Element) & {
Actions: ({ sx, children }: PropsWithChildren<{
sx?: _mui_material_styles.SxProps<_mui_material_styles.Theme> | undefined;
}>) => react_jsx_runtime.JSX.Element | null;
Container: ({ anchor, name, innerRef, size, open, onClose, ...props }: IDrawerContainerProps) => react_jsx_runtime.JSX.Element;
Content: ({ sx, children }: PropsWithChildren<{
sx?: _mui_material_styles.SxProps<_mui_material_styles.Theme> | undefined;
}>) => react_jsx_runtime.JSX.Element;
Subtitle: ({ sx, children }: PropsWithChildren<{
sx?: _mui_material_styles.SxProps<_mui_material_styles.Theme> | undefined;
}>) => react_jsx_runtime.JSX.Element | null;
Title: ({ children, ...rest }: PropsWithChildren<{
sx?: _mui_material_styles.SxProps<_mui_material_styles.Theme> | undefined;
}>) => react_jsx_runtime.JSX.Element | null;
};
type ICheckboxProps = Omit<CheckboxProps, 'name' | 'onChange' | 'checked'> & {
name: string;
value?: boolean;
enableDOMAttributeRequired?: boolean;
onChange?: (event: ChangeEvent<HTMLInputElement>, isChecked: boolean) => void;
};
declare const Checkbox: react.ForwardRefExoticComponent<Omit<ICheckboxProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
type IChipProps = ChipProps & {
name: string;
};
declare const Chip: ({ variant, ...rest }: IChipProps) => react_jsx_runtime.JSX.Element;
type IChipStackValue = Pick<IChipProps, 'color'> & {
id: string;
label: string;
title?: string;
avatar?: IChipProps['avatar'];
};
type IChipStackProps = Omit<StackProps, 'onChange'> & Pick<IChipProps, 'variant'> & {
disabled?: boolean;
name: string;
noAdd?: boolean;
noDelete?: boolean;
options: IChipStackValue[];
readOnly?: boolean;
value?: IChipStackValue['id'][];
onChange?: (newValue: IChipStackValue['id'][]) => void;
};
declare const ChipStack: ({ disabled, noAdd, noDelete, options, readOnly, value, variant, onChange, ...props }: IChipStackProps) => react_jsx_runtime.JSX.Element;
type ITextFieldProps = Omit<TextFieldProps, 'name' | 'onChange' | 'ref' | 'defaultValue' | 'InputProps'> & {
enableDOMAttributeRequired?: boolean;
name: string;
readOnly?: boolean;
onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
};
declare const TextField: react.ForwardRefExoticComponent<Omit<TextFieldProps, "ref" | "defaultValue" | "onChange" | "name" | "InputProps"> & {
enableDOMAttributeRequired?: boolean;
name: string;
readOnly?: boolean;
onChange?: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
} & react.RefAttributes<HTMLDivElement>>;
type IColorPickerProps = Omit<ITextFieldProps, 'onChange'> & {
label?: string;
value?: string;
disableAlpha?: boolean;
onChange?: (value: string) => void;
};
declare const ColorPicker: react.ForwardRefExoticComponent<Omit<ITextFieldProps, "onChange"> & {
label?: string;
value?: string;
disableAlpha?: boolean;
onChange?: (value: string) => void;
} & react.RefAttributes<HTMLDivElement>>;
type IComponentLoaderProps = Pick<CircularProgressProps, 'size'> & {
inProgress: boolean;
};
declare function ComponentLoader({ children, inProgress, ...rest }: PropsWithChildren<IComponentLoaderProps>): react_jsx_runtime.JSX.Element;
type IDatePickerProps = Omit<DatePickerProps<IDateTimeType>, 'defaultValue' | 'label' | 'minDate' | 'maxDate' | 'name' | 'value' | 'onError' | 'onChange' | 'renderInput'> & Pick<ITextFieldProps, 'enableDOMAttributeRequired' | 'error' | 'helperText' | 'hidden' | 'label' | 'name' | 'required' | 'size'> & {
minDate?: DatePickerProps<IDateTimeType>['minDate'] | Date;
maxDate?: DatePickerProps<IDateTimeType>['maxDate'] | Date;
value?: DatePickerProps<IDateTimeType>['value'] | Date;
onError?: (message: string) => void;
onChange?: (value: IDateTimeType | null) => void;
};
declare const DatePicker: react.ForwardRefExoticComponent<Omit<DatePickerProps<dayjs.Dayjs>, "value" | "label" | "defaultValue" | "onChange" | "onError" | "name" | "minDate" | "maxDate" | "renderInput"> & Pick<ITextFieldProps, "error" | "enableDOMAttributeRequired" | "label" | "hidden" | "name" | "required" | "size" | "helperText"> & {
minDate?: DatePickerProps<IDateTimeType>["minDate"] | Date;
maxDate?: DatePickerProps<IDateTimeType>["maxDate"] | Date;
value?: DatePickerProps<IDateTimeType>["value"] | Date;
onError?: (message: string) => void;
onChange?: (value: IDateTimeType | null) => void;
} & react.RefAttributes<HTMLDivElement>>;
type IValueType$1<T> = {
start: T;
end: T;
};
type IDateRangePickerProps = Omit<IDatePickerProps, 'minDate' | 'maxDate' | 'error' | 'helperText' | 'onError' | 'onChange' | 'value'> & {
label?: string | IValueType$1<string>;
value?: IValueType$1<IDatePickerProps['value']>;
hidden?: boolean;
minDate?: IDatePickerProps['value'];
maxDate?: IDatePickerProps['value'];
optionalEnd?: boolean;
error?: boolean | IValueType$1<boolean>;
helperText?: string | IValueType$1<string>;
onChange?: (value: IValueType$1<IDatePickerProps['value']>) => void;
};
declare const DateRangePicker: ({ error, helperText, label, minDate, maxDate, name, optionalEnd, required, value, onChange, ...rest }: IDateRangePickerProps) => react_jsx_runtime.JSX.Element;
type ISelectOption = {
id: string;
label: string;
custom?: {
[key: string]: unknown;
};
};
type IProps<Multiple extends boolean | undefined, T = string> = AutocompleteProps<T, Multiple, false, false>;
type ISelectProps<Multiple extends boolean | undefined> = Omit<IProps<Multiple, ISelectOption>, 'defaultValue' | 'getOptionLabel' | 'getOptionId' | 'name' | 'renderInput' | 'renderOption' | 'value' | 'onChange'> & Pick<ITextFieldProps, 'disabled' | 'enableDOMAttributeRequired' | 'label' | 'name' | 'placeholder' | 'readOnly' | 'required'> & {
clearable?: boolean;
disabledInput?: boolean;
error?: boolean;
helperText?: string;
innerRef?: Ref<HTMLDivElement>;
value?: IProps<Multiple>['value'];
onChange?: (value: IProps<Multiple>['value']) => void;
};
type IMultiSelectProps = ISelectProps<true>;
declare const MultiSelect: react.ForwardRefExoticComponent<Omit<IMultiSelectProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
declare const Select: react.ForwardRefExoticComponent<Omit<ISelectProps<false>, "ref"> & react.RefAttributes<HTMLDivElement>>;
type IMultiChipSelect = Omit<ISelectProps<false>, 'value' | 'onChange' | 'ref'> & Pick<IMultiSelectProps, 'value' | 'onChange'>;
declare const MultiChipSelect: react.ForwardRefExoticComponent<Omit<ISelectProps<false>, "ref" | "value" | "onChange"> & Pick<IMultiSelectProps, "value" | "onChange"> & react.RefAttributes<HTMLDivElement>>;
type IOutlinedInputProps = Omit<OutlinedInputProps, 'name' | 'ref'> & {
name: string;
};
declare const OutlinedInput: react.ForwardRefExoticComponent<Omit<OutlinedInputProps, "ref" | "name"> & {
name: string;
} & react.RefAttributes<HTMLDivElement>>;
type IProgressProps = LinearProgressProps;
declare const Progress: ({ hidden, sx, ...rest }: IProgressProps) => react_jsx_runtime.JSX.Element;
type IRadioProps = Omit<RadioProps, 'name' | 'value' | 'onChange'> & {
name: string;
readOnly?: boolean;
onChange?: (value: boolean) => void;
};
declare const Radio: ({ disabled, readOnly, onChange, checked, ...rest }: IRadioProps) => react_jsx_runtime.JSX.Element;
type IOption<T extends number | string> = {
id: T;
label: string;
};
type IRadioGroupProps = Omit<RadioGroupProps, 'onChange'> & {
enableDOMAttributeRequired?: boolean;
error?: boolean;
helperText?: string;
label?: string;
disabled?: boolean;
itemProps?: IRadioProps;
labelPlacement?: FormControlLabelProps['labelPlacement'];
name: string;
options: IOption<string>[];
readOnly?: boolean;
required?: boolean;
onChange?: (value: string) => void;
};
declare const RadioGroup: ({ enableDOMAttributeRequired, error, helperText, label, name, options, disabled, readOnly, required, labelPlacement, onChange, ...rest }: IRadioGroupProps) => react_jsx_runtime.JSX.Element;
type ISwitchProps = Omit<SwitchProps, 'name' | 'checked' | 'defaultValue' | 'defaultChecked' | 'onChange'> & {
name: string;
label?: string;
enableDOMAttributeRequired?: boolean;
labelPlacement?: FormControlLabelProps['labelPlacement'];
value?: boolean;
onChange?: (event: ChangeEvent<HTMLInputElement>, newValue: boolean) => void;
};
declare const Switch: react.ForwardRefExoticComponent<Omit<ISwitchProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
type ITabsProps<ContentContainer extends ElementType, TabContainer extends ElementType> = {
onChange?: (id: string) => void;
contentContainer?: ContentContainer;
tabsContainer?: TabContainer;
hidingMethod?: 'css' | 'js';
tabs: {
id: string;
display?: boolean;
label: ReactNode;
content: ReactNode;
}[];
};
type ITimePickerProps = Omit<TimePickerProps<IDateTimeType>, 'defaultValue' | 'label' | 'minTime' | 'maxTime' | 'name' | 'value' | 'onError' | 'onChange' | 'renderInput'> & Pick<ITextFieldProps, 'enableDOMAttributeRequired' | 'error' | 'helperText' | 'hidden' | 'label' | 'name' | 'required' | 'size'> & {
maxTime?: TimePickerProps<IDateTimeType>['maxTime'] | Date;
minTime?: TimePickerProps<IDateTimeType>['minTime'] | Date;
value?: TimePickerProps<IDateTimeType>['value'] | Date;
onError?: (message: string) => void;
onChange?: (value: IDateTimeType | null) => void;
};
declare const TimePicker: react.ForwardRefExoticComponent<Omit<TimePickerProps<dayjs.Dayjs>, "value" | "label" | "defaultValue" | "onChange" | "onError" | "name" | "renderInput" | "minTime" | "maxTime"> & Pick<ITextFieldProps, "error" | "enableDOMAttributeRequired" | "label" | "hidden" | "name" | "required" | "size" | "helperText"> & {
maxTime?: TimePickerProps<IDateTimeType>["maxTime"] | Date;
minTime?: TimePickerProps<IDateTimeType>["minTime"] | Date;
value?: TimePickerProps<IDateTimeType>["value"] | Date;
onError?: (message: string) => void;
onChange?: (value: IDateTimeType | null) => void;
} & react.RefAttributes<HTMLDivElement>>;
type IValueType<T> = {
start: T;
end: T;
};
type ITimeRangePickerValueType = {
start: ITimePickerProps['value'] | null;
duration: number | null;
};
type ITimeRangePickerProps = Omit<ITimePickerProps, 'label' | 'minTime' | 'maxTime' | 'error' | 'helperText' | 'onError' | 'onChange' | 'value'> & {
label?: string | IValueType<string>;
value?: ITimeRangePickerValueType;
minTime?: ITimePickerProps['value'];
maxTime?: ITimePickerProps['value'];
error?: boolean | IValueType<boolean>;
helperText?: string | IValueType<string>;
zeroIsNextDay?: boolean;
onError?: (message: IValueType<string>) => void;
onChange?: (value: ITimeRangePickerValueType) => void;
};
declare const TimeRangePicker: ({ error, helperText, label, maxTime, minTime, name, required, value, zeroIsNextDay, onError, onChange, ...rest }: ITimeRangePickerProps) => react_jsx_runtime.JSX.Element;
type ITimeRangeOrTimeAndLengthValueType = ITimeRangePickerProps['value'] & {
isRange?: boolean;
};
type ITimeRangeOrTimeAndLengthProps = Omit<ITimeRangePickerProps, 'label' | 'value' | 'minTime' | 'maxTime' | 'error' | 'helperText' | 'zeroIsNextDay' | 'onError' | 'onChange'> & {
name: string;
disabled?: boolean;
readOnly?: boolean;
label: string | {
start: string;
end: string;
length: string;
};
labelRange: string;
value?: ITimeRangeOrTimeAndLengthValueType;
inputFormat?: string;
required?: boolean;
minutesStep?: number;
minStart?: ITimeRangeOrTimeAndLengthValueType['start'];
maxDuration?: number;
error?: boolean | {
time?: boolean;
duration?: boolean;
};
helperText?: string | {
time?: string;
duration?: string;
};
onChange?: (value: ITimeRangeOrTimeAndLengthValueType) => void;
onError?: (value: {
time?: string;
duration?: string;
}) => void;
};
declare function TimeRangeOrTimeAndLength({ name, label, labelRange, value, disabled, readOnly, required, minutesStep, minStart, maxDuration, error, helperText, onError, onChange, ...rest }: ITimeRangeOrTimeAndLengthProps): react_jsx_runtime.JSX.Element;
type ITooltipProps = Omit<TooltipProps, 'color'> & {
color?: 'primary' | 'white';
withBoxWrapper?: boolean;
};
declare const Tooltip: ({ children, withBoxWrapper, ...rest }: ITooltipProps) => react_jsx_runtime.JSX.Element;
type IItemType = {
id: string;
isDivider?: boolean;
disabled?: boolean;
shouldDisplay?: (ids: string[]) => boolean;
name: ReactNode;
};
type ITransferListProps = {
filteredItems?: boolean;
height?: number;
error?: boolean;
helperText?: string;
items: IItemType[];
label?: string;
readOnly?: boolean;
required?: boolean;
titleMoveAllLeft?: string;
titleMoveAllRight?: string;
titleMoveSelectedLeft?: string;
titleMoveSelectedRight?: string;
value?: IItemType['id'][];
onChange?: (values: string[]) => void;
};
declare const TransferList: ({ error, filteredItems, height, helperText, items, label, readOnly, required, value, titleMoveAllRight, titleMoveAllLeft, titleMoveSelectedLeft, titleMoveSelectedRight, onChange }: ITransferListProps) => react_jsx_runtime.JSX.Element;
type IWeekdaysPickerProps = {
error?: boolean;
days?: {
id: number;
label: string;
}[];
disabled?: boolean;
firstDayOfWeek?: 1 | 7;
helperText?: string;
label?: string;
multiple?: boolean;
name: string;
readOnly?: boolean;
required?: boolean;
value?: number;
onChange?: (value: number) => void;
};
declare const WeekdaysPicker: ({ name, days, disabled, error, firstDayOfWeek, helperText, label, multiple, readOnly, required, value, onChange }: IWeekdaysPickerProps) => react_jsx_runtime.JSX.Element;
export { Button, Checkbox, Chip, ChipStack, ColorPicker, ComponentLoader, DatePicker, DateRangePicker, Wrapper$1 as Dialog, Wrapper as Drawer, FormSettingsProvider as FormContextProvider, FormGenerator, FormSettingsContext, FormLocalizationProvider as LocalizationProvider, MultiChipSelect, MultiSelect, OutlinedInput, Progress, Radio, RadioGroup, Select, Switch, TextField, TimePicker, TimeRangeOrTimeAndLength, TimeRangePicker, Tooltip, TransferList, WeekdaysPicker };
export type { IButtonProps, ICallableRef$2 as ICallableRef, ICheckboxProps, IChipProps, IChipStackProps, IChipStackValue, IColorPickerProps, IComponentLoaderProps, IDatePickerProps, IDateRangePickerProps, IDialogProps, IDrawerProps, IFormGeneratorProps, IItemType, IMultiChipSelect, IMultiSelectProps, IOutlinedInputProps, IOutputValueType, IProgressProps, IRadioGroupProps, IRadioProps, ISelectOption, ISelectProps, ISwitchProps, ITabsProps, ITextFieldProps, ITimePickerProps, ITimeRangeOrTimeAndLengthProps, ITimeRangeOrTimeAndLengthValueType, ITimeRangePickerProps, ITimeRangePickerValueType, ITooltipProps, ITransferListProps, IValueType$1 as IValueType, IWeekdaysPickerProps };