react-crud-mui 0.0.1-beta.23 → 0.0.1-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,12 @@ import { ControllerFieldState } from 'react-hook-form';
3
3
  import { BoxProps } from '@mui/material';
4
4
  import { FlexBox } from '../../flexbox';
5
5
  export interface FormControlProps {
6
- label?: ReactNode;
6
+ label?: ReactNode | [ReactNode, ReactNode];
7
7
  helperText?: ReactNode;
8
8
  placement?: 'left' | 'right' | 'top' | 'bottom';
9
9
  labelProps?: BoxProps;
10
10
  wrapperProps?: React.ComponentProps<typeof FlexBox>;
11
+ disabled?: boolean;
11
12
  }
12
- declare function FormControl({ placement, children, label, helperText, error, invalid, labelProps, wrapperProps, }: PropsWithChildren<FormControlProps> & Partial<ControllerFieldState>): import("react/jsx-runtime").JSX.Element;
13
+ declare function FormControl({ placement, children, label, helperText, error, invalid, labelProps, wrapperProps, disabled, }: PropsWithChildren<FormControlProps> & Partial<ControllerFieldState>): import("react/jsx-runtime").JSX.Element;
13
14
  export default FormControl;
@@ -4,5 +4,5 @@ import { FormControlProps } from '../components/FormControl';
4
4
  import { ControlCommonProps } from '../Field';
5
5
  export interface FormSwitchProps<TFieldValues extends FieldValues = FieldValues> extends Omit<SwitchProps, 'name'>, ControlCommonProps<TFieldValues>, FormControlProps {
6
6
  }
7
- declare function FormSwitch<TFieldValues extends FieldValues = FieldValues>({ name, label, helperText, placement, fieldProps, ...switchProps }: FormSwitchProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
7
+ declare function FormSwitch<TFieldValues extends FieldValues = FieldValues>({ name, label, helperText, placement, labelProps, wrapperProps, fieldProps, ...switchProps }: FormSwitchProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
8
8
  export default FormSwitch;
@@ -1,12 +1,5 @@
1
- export { default as copyToClipboard } from './copyToClipboard';
2
- export { default as currencyFormat } from './currencyFormat';
3
1
  export { getBase64 } from './getBase64';
4
- export { default as highlightText } from './highlightText';
5
2
  export { default as normalizeAccent } from './normalizeAccent';
6
- export { default as nullToUndefined } from './nullToUndefined';
7
- export { default as undefinedToNull } from './undefinedToNull';
8
- export { default as parseDate } from './parseDate';
9
3
  export { default as reactNodeToString } from './reactNodeToString';
10
- export { default as removeProps } from './removeProps';
11
- export { default as searchInArray } from './searchInArray';
12
4
  export { default as updateQueryString } from './updateQueryString';
5
+ export { default as moneyFormat } from './moneyFormat';
@@ -0,0 +1,9 @@
1
+ import { Currency } from './getCurrencySymbolProps';
2
+ type MoneyFormatOptions = {
3
+ currency: Currency;
4
+ decimalDigit?: number;
5
+ thousandSeparator?: string;
6
+ decimalSeparator?: string;
7
+ };
8
+ declare const moneyFormat: (value: string | number, { currency, decimalDigit, decimalSeparator, thousandSeparator, }: MoneyFormatOptions) => string;
9
+ export default moneyFormat;
@@ -0,0 +1,3 @@
1
+ import { ServerError } from '../utils';
2
+ declare function normalizeServerError(error: ServerError): string[];
3
+ export default normalizeServerError;
@@ -2,7 +2,8 @@ import { ReactNode, Ref } from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
3
  import { AvatarProps, SelectProps as MuiSelectProps } from '@mui/material';
4
4
  import { ComboboxTemplate } from '../combobox/hooks/useComboboxTemplate';
5
- export type SelectProps<T extends FieldValues = FieldValues> = Partial<MuiSelectProps> & {
5
+ export type SelectSize = MuiSelectProps['size'] | 'smaller';
6
+ export type SelectProps<T extends FieldValues = FieldValues> = Partial<Omit<MuiSelectProps, 'size'>> & {
6
7
  dropDownHeight?: number;
7
8
  allowClear?: boolean;
8
9
  valueField?: string;
@@ -16,7 +17,9 @@ export type SelectProps<T extends FieldValues = FieldValues> = Partial<MuiSelect
16
17
  helperText?: ReactNode;
17
18
  selectRef?: Ref<unknown>;
18
19
  optionAsValue?: boolean;
20
+ size?: SelectSize;
21
+ selectFirstOption?: boolean;
19
22
  };
20
- declare function Select<T extends FieldValues = FieldValues>({ allowClear, children, data, descriptionTemplate, disabled, displayTemplate, dropDownHeight, error, groupBy: groupByFn, helperText, id, label, onChange, optionImg, optionImgProps, optionTemplate, optionAsValue, selectRef, sx, value, valueField, multiple, ...rest }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
23
+ declare function Select<T extends FieldValues = FieldValues>({ allowClear, children, data, descriptionTemplate, disabled, displayTemplate, dropDownHeight, error, groupBy: groupByFn, helperText, id, label, onChange, optionImg, optionImgProps, optionTemplate, optionAsValue, selectFirstOption, selectRef, sx, value, valueField, multiple, size, ...rest }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
21
24
  declare const _default: typeof Select;
22
25
  export default _default;
@@ -1,9 +1,10 @@
1
- import { MouseEvent, PropsWithChildren } from 'react';
1
+ import { MouseEvent, PropsWithChildren, ReactNode } from 'react';
2
2
  interface TableMoreMenuProps extends PropsWithChildren {
3
3
  open: HTMLElement | null;
4
4
  handleClose: () => void;
5
5
  handleOpen: (event: MouseEvent<HTMLButtonElement>) => void;
6
6
  disabled?: boolean;
7
+ moreIcon?: ReactNode;
7
8
  }
8
9
  export default function TableMoreMenu(props: TableMoreMenuProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};