mui-design-system 0.0.17 → 0.0.19

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.
@@ -5,7 +5,7 @@ import useMediaQuery from '@mui/material/useMediaQuery';
5
5
  import * as React from 'react';
6
6
  import { VariableSizeList } from 'react-window';
7
7
  import { ListRow } from './ListRow';
8
- import { debounce } from "lodash";
8
+ import debounce from '../../../methods/debounce';
9
9
  export const LISTBOX_PADDING = 8; // px
10
10
  export const ListBox = React.forwardRef(function ListBox(props, ref) {
11
11
  const { children, onReachEnd, ...other } = props;
@@ -0,0 +1,165 @@
1
+ import { GridProps } from '@mui/material/Grid';
2
+ import React, { ReactNode } from 'react';
3
+ import { RegisterOptions } from 'react-hook-form';
4
+ import { TypographyProps } from '@mui/material/Typography';
5
+ import { CustomAutocompleteProps } from '../custom-auto-complete/CustomAutoComplete';
6
+ import { TextFieldProps } from '@mui/material/TextField';
7
+ import { ICustomCheckboxProps } from './components/UFCheckbox';
8
+ import { ICustomNumericInputProps } from '../custom-input/CustomNumericInput';
9
+ import { RadioProps } from '@mui/material/Radio';
10
+ import { CheckboxListProps } from "./checkbox-list/CheckboxList";
11
+ import { ICustomUploaderProps } from "../custom-uploader/CustomUploader";
12
+ import { RadioGroupProps } from "@mui/material";
13
+ import { FormControlLabelProps } from "@mui/material/FormControlLabel";
14
+ import { ICustomSwitchProps } from './components/UFSwitch';
15
+ import { ICustomDatePickerProps } from '../custom-date-picker/CustomDatePicker';
16
+ export interface IFormOption {
17
+ value: string | number;
18
+ label: string;
19
+ labelProp?: any;
20
+ disabled?: boolean;
21
+ }
22
+ interface IBaseForm {
23
+ name: string;
24
+ label: React.ReactNode;
25
+ rules?: RegisterOptions;
26
+ defaultValue?: any;
27
+ placeholder?: string;
28
+ gridItemProp?: GridProps;
29
+ labelProps?: Partial<TypographyProps<any>> | undefined;
30
+ helperText?: string;
31
+ withoutHelperText?: boolean;
32
+ variant?: 'outlined' | 'filled' | 'standard';
33
+ inputLabelMode?: TInputLabelMode;
34
+ disabled?: boolean;
35
+ readonly?: boolean;
36
+ itemProps?: any;
37
+ }
38
+ export interface IRadioForm extends IBaseForm {
39
+ type?: 'radio';
40
+ radioProps?: RadioProps;
41
+ radioGroupProps?: Partial<RadioGroupProps>;
42
+ formControlLabelProps?: Partial<FormControlLabelProps>;
43
+ options?: IFormOption[];
44
+ itemProps?: RadioProps;
45
+ }
46
+ export interface ISelectForm extends IBaseForm {
47
+ type?: 'select';
48
+ props?: TextFieldProps;
49
+ itemProps?: TextFieldProps;
50
+ options?: IFormOption[];
51
+ }
52
+ export interface IMultiSelectForm extends IBaseForm {
53
+ type?: 'multi-select';
54
+ props?: Partial<TextFieldProps>;
55
+ itemProps?: Partial<TextFieldProps>;
56
+ options?: IFormOption[];
57
+ }
58
+ export interface IAutoCompleteForm extends IBaseForm {
59
+ type?: 'auto-complete';
60
+ isLoading?: boolean;
61
+ props?: Partial<CustomAutocompleteProps>;
62
+ itemProps?: Partial<CustomAutocompleteProps>;
63
+ options?: IFormOption[];
64
+ onReachEnd?: () => void;
65
+ onSearch?: (value: any) => void;
66
+ }
67
+ export interface ICheckboxForm extends IBaseForm {
68
+ type?: 'checkbox';
69
+ props?: Partial<ICustomCheckboxProps>;
70
+ formControlLabelProps?: Partial<FormControlLabelProps>;
71
+ itemProps?: Partial<ICustomCheckboxProps>;
72
+ }
73
+ export interface ISwitchForm extends IBaseForm {
74
+ type?: 'switch';
75
+ props?: Partial<ICustomSwitchProps>;
76
+ }
77
+ export interface IDatePickerForm extends IBaseForm {
78
+ type?: 'date-picker';
79
+ props?: Partial<ICustomDatePickerProps>;
80
+ itemProps?: Partial<ICustomDatePickerProps>;
81
+ }
82
+ export interface IDatePickerMobileForm extends IBaseForm {
83
+ type?: 'date-picker-mobile';
84
+ props?: Partial<ICustomDatePickerProps>;
85
+ }
86
+ export interface ITimeForm extends IBaseForm {
87
+ type?: 'time';
88
+ props?: Partial<TextFieldProps>;
89
+ hourProp?: Partial<TextFieldProps>;
90
+ minuteProp?: Partial<TextFieldProps>;
91
+ }
92
+ export interface ITextAreaForm extends IBaseForm {
93
+ type?: 'text-area';
94
+ props?: Partial<TextFieldProps>;
95
+ itemProps?: Partial<TextFieldProps>;
96
+ }
97
+ export interface ICurrencyForm extends IBaseForm {
98
+ type?: 'currency';
99
+ props?: Partial<ICustomNumericInputProps>;
100
+ itemProps?: Partial<ICustomNumericInputProps>;
101
+ currencyIcon?: ReactNode;
102
+ }
103
+ export interface IMultiCheckboxForm extends IBaseForm {
104
+ options: IFormOption[];
105
+ type?: 'multi-checkbox';
106
+ multiple?: boolean;
107
+ props?: Partial<Omit<CheckboxListProps, "multiple" | "options" | "onChange" | "value">>;
108
+ itemProps?: Partial<Omit<CheckboxListProps, "multiple" | "options" | "onChange" | "value">>;
109
+ }
110
+ export interface IUploaderForm extends IBaseForm {
111
+ type?: "uploader";
112
+ multiple?: boolean;
113
+ onDelete?: (index: number) => void;
114
+ props?: Partial<ICustomUploaderProps>;
115
+ itemProps?: Partial<ICustomUploaderProps>;
116
+ }
117
+ export interface ITextFieldForm extends IBaseForm {
118
+ type?: 'text' | 'email' | 'password' | 'phone' | 'number';
119
+ props?: Partial<TextFieldProps>;
120
+ itemProps?: Partial<TextFieldProps>;
121
+ }
122
+ export type TSchema = ITextFieldForm | ICurrencyForm | ITextAreaForm | IDatePickerForm | IDatePickerMobileForm | ITimeForm | ICheckboxForm | IAutoCompleteForm | IMultiSelectForm | ISelectForm | IRadioForm | ISwitchForm | IUploaderForm | IMultiCheckboxForm;
123
+ export type TFormSchema = TSchema[];
124
+ export type TFormTheme = {
125
+ text?: Partial<TextFieldProps>;
126
+ email?: Partial<TextFieldProps>;
127
+ password?: Partial<TextFieldProps>;
128
+ phone?: Partial<TextFieldProps>;
129
+ number?: Partial<TextFieldProps>;
130
+ uploader?: {
131
+ uploaderProps?: Partial<ICustomUploaderProps>;
132
+ };
133
+ multiCheckbox?: {
134
+ multiCheckboxProps?: Partial<Omit<CheckboxListProps, "multiple" | "options" | "onChange" | "value">>;
135
+ };
136
+ currency?: {
137
+ currencyProps?: Partial<ICustomNumericInputProps>;
138
+ };
139
+ textArea?: {
140
+ textAreaProps?: Partial<TextFieldProps>;
141
+ };
142
+ datePicker?: {
143
+ datePickerProps?: Partial<ICustomDatePickerProps>;
144
+ };
145
+ checkbox?: {
146
+ checkboxProps?: Partial<ICustomCheckboxProps>;
147
+ formControlLabelProps?: Partial<FormControlLabelProps>;
148
+ };
149
+ autoComplete?: {
150
+ autoCompleteProps?: Partial<CustomAutocompleteProps>;
151
+ };
152
+ multiSelect?: {
153
+ multiSelectProps?: Partial<TextFieldProps>;
154
+ };
155
+ 'select'?: {
156
+ selectProps: Partial<TextFieldProps>;
157
+ };
158
+ radio?: {
159
+ radioProps?: Partial<RadioProps>;
160
+ radioGroupProps?: Partial<RadioGroupProps>;
161
+ formControlLabelProps?: Partial<FormControlLabelProps>;
162
+ };
163
+ };
164
+ export type TInputLabelMode = 'static' | 'relative';
165
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mui-design-system",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",