react-crud-mui 0.2.2 → 0.2.4

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.
@@ -414,6 +414,7 @@ declare function useDetailPageModal<TModel extends FieldValues>({ models, unique
414
414
  readonly footerContent?: import('react').ReactNode;
415
415
  readonly moreContent?: import('react').ReactNode;
416
416
  readonly panels?: import('../../page/components/DefaultPanels').PanelPane[];
417
+ readonly hiddenOnSingleTab?: boolean;
417
418
  readonly commandsPosition?: import('../../page/Page').CommandsPosition;
418
419
  readonly onHeader?: (props: import('../components/DetailPageHeader').DetailPageHeaderProps) => import('react').ReactNode;
419
420
  readonly onLayout?: (props: import('../../page/components/DefaultLayout').PageLayoutProps) => import('react').ReactNode;
@@ -8,6 +8,7 @@ import { default as FormCheckbox } from './controls/FormCheckbox';
8
8
  import { default as FormComboBox } from './controls/FormComboBox';
9
9
  import { default as FormDatePicker } from './controls/FormDatePicker';
10
10
  import { default as FormInput } from './controls/FormInput';
11
+ import { default as FormMaskedInput } from './controls/FormMaskedInput';
11
12
  import { default as FormMoneyInput } from './controls/FormMoneyInput';
12
13
  import { default as FormNumberInput } from './controls/FormNumberInput';
13
14
  import { default as FormPhoneInput } from './controls/FormPhoneInput';
@@ -35,6 +36,7 @@ export type FieldProps<TFieldValues extends FieldValues = FieldValues> = Omit<Us
35
36
  declare function Field<TFieldValues extends FieldValues = FieldValues>({ children, control, defaultValue, disabled: fieldDisabled, name, render, rules, shouldUnregister, formControlProps, }: FieldProps<TFieldValues>): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
36
37
  declare namespace Field {
37
38
  var Input: typeof FormInput;
39
+ var MaskedInput: typeof FormMaskedInput;
38
40
  var Search: typeof FormSearchInput;
39
41
  var NumberInput: typeof FormNumberInput;
40
42
  var MoneyInput: typeof FormMoneyInput;
@@ -0,0 +1,7 @@
1
+ import { FieldValues } from 'react-hook-form';
2
+ import { MaskedInputProps } from '../../masked-input/MaskedInput';
3
+ import { ControlCommonProps } from '../Field';
4
+ export interface FormMaskedInputProps<TFieldValues extends FieldValues = FieldValues> extends Omit<MaskedInputProps, 'name'>, ControlCommonProps<TFieldValues> {
5
+ }
6
+ declare function FormMaskedInput<TFieldValues extends FieldValues = FieldValues>({ name, disabled, formControlProps, fieldProps, helperText, ...inputProps }: FormMaskedInputProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
7
+ export default FormMaskedInput;
@@ -3,5 +3,5 @@ import { NumberInputProps } from '../../number-input/NumberInput';
3
3
  import { ControlCommonProps } from '../Field';
4
4
  export interface FormNumberInputProps<TFieldValues extends FieldValues = FieldValues> extends Omit<NumberInputProps, 'name'>, ControlCommonProps<TFieldValues> {
5
5
  }
6
- declare function FormNumberInput<TFieldValues extends FieldValues = FieldValues>({ name, fieldProps, formControlProps, disabled, ...inputProps }: FormNumberInputProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
6
+ declare function FormNumberInput<TFieldValues extends FieldValues = FieldValues>({ name, fieldProps, formControlProps, disabled, helperText, ...inputProps }: FormNumberInputProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
7
7
  export default FormNumberInput;
@@ -11,5 +11,5 @@ export interface FormRadioGroupProps<TFieldValues extends FieldValues = FieldVal
11
11
  disabled?: boolean;
12
12
  }
13
13
  export declare const StyledFormControlLabel: import('@emotion/styled').StyledComponent<import('@mui/material').FormControlLabelProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
14
- declare function FormRadioGroup<TFieldValues extends FieldValues = FieldValues>({ name, label, helperText, placement, fieldProps, disabled, data, ...radioGroupProps }: FormRadioGroupProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
14
+ declare function FormRadioGroup<TFieldValues extends FieldValues = FieldValues>({ name, label, helperText, placement, fieldProps, disabled, formControlProps, data, ...radioGroupProps }: FormRadioGroupProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
15
15
  export default FormRadioGroup;
@@ -0,0 +1,12 @@
1
+ import { Props } from 'react-input-mask';
2
+ import { InputProps } from '../input/Input';
3
+ export type MaskedInputProps = Omit<InputProps, 'value' | 'onChange' | 'ref'> & Pick<Props, 'mask' | 'value' | 'onChange' | 'maskPlaceholder'> & {
4
+ maskRepeat?: number;
5
+ maskInputProps?: Props;
6
+ };
7
+ declare function MaskedInput({ caseType, disabled, mask, maskRepeat, maskPlaceholder, maskInputProps, onBlur, value, onChange, getRef, ...inputProps }: MaskedInputProps): import("react/jsx-runtime").JSX.Element;
8
+ declare const _default: import('react').ForwardRefExoticComponent<Omit<InputProps, "ref" | "onChange" | "value"> & Pick<Props, "mask" | "onChange" | "value" | "maskPlaceholder"> & {
9
+ maskRepeat?: number;
10
+ maskInputProps?: Props;
11
+ } & import('react').RefAttributes<typeof MaskedInput>>;
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { Props } from 'react-input-mask';
2
+ interface UseCreateMaskOptions {
3
+ maskRepeat?: number;
4
+ mask?: Props['mask'];
5
+ }
6
+ declare function useCreateMask({ maskRepeat, mask }: UseCreateMaskOptions): string | (string | RegExp)[];
7
+ export default useCreateMask;
@@ -33,6 +33,7 @@ export interface PageProps extends HeaderProps {
33
33
  tabs?: TabPane[];
34
34
  tabsPosition?: TabsPosition;
35
35
  tabExtraContent?: ReactNode;
36
+ hiddenOnSingleTab?: boolean;
36
37
  selectedTabIndex?: number;
37
38
  onTabChanged?: (selected: TabChangedPayload) => void;
38
39
  onTabs?: (props: DefaultTabsProps) => ReactNode;
@@ -40,7 +41,7 @@ export interface PageProps extends HeaderProps {
40
41
  panels?: PanelPane[];
41
42
  }
42
43
  export declare const PagePadding: Record<PaddingSize, number>;
43
- declare function Page({ alertsContent, bordered, centerContent, children, commandsContent, commandsPosition, disabled, footerContent, loading, progressProps, moreContent, morePanelProps, onHeader, onLayout, onTabChanged, onTabs, panels, rightContent, selectedTabIndex, showCommands, showHeader, size, style, sx, tabs, tabExtraContent, tabsPosition, ...headerProps }: PageProps): import("react/jsx-runtime").JSX.Element;
44
+ declare function Page({ alertsContent, bordered, centerContent, children, commandsContent, commandsPosition, disabled, footerContent, loading, progressProps, moreContent, morePanelProps, onHeader, onLayout, onTabChanged, onTabs, panels, rightContent, selectedTabIndex, showCommands, showHeader, size, style, sx, tabs, tabExtraContent, tabsPosition, hiddenOnSingleTab, ...headerProps }: PageProps): import("react/jsx-runtime").JSX.Element;
44
45
  declare namespace Page {
45
46
  var Content: typeof PageContent;
46
47
  var Divider: typeof PageDivider;
@@ -5,15 +5,17 @@ import { TabsProps } from '@mui/material/Tabs';
5
5
  export type TabPane = Omit<TabProps, 'children' | 'key'> & {
6
6
  children?: ReactNode;
7
7
  key: string;
8
+ hidden?: boolean;
8
9
  };
9
10
  export interface DefaultTabsProps extends TabsProps {
10
11
  tabs: TabPane[];
11
12
  extra?: ReactNode;
12
13
  wrapperSx?: SxProps;
14
+ hiddenOnSingleTab?: boolean;
13
15
  }
14
16
  export type TabChangedPayload = {
15
17
  selectedTabIndex: number;
16
18
  selectedTabValue: string;
17
19
  };
18
- declare function DefaultTabs({ tabs, extra, wrapperSx, sx, ...tabsProps }: DefaultTabsProps): import("react/jsx-runtime").JSX.Element;
20
+ declare function DefaultTabs({ tabs, extra, wrapperSx, sx, hiddenOnSingleTab, ...tabsProps }: DefaultTabsProps): import("react/jsx-runtime").JSX.Element | null;
19
21
  export default DefaultTabs;