@bluemarble/bm-components 0.0.71 → 0.0.73
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.
- package/dist/esm/index.js +823 -823
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Autocomplete/index.d.ts +27 -27
- package/dist/esm/types/components/BaseGrid/Pagination/index.d.ts +12 -12
- package/dist/esm/types/components/BaseGrid/index.d.ts +32 -32
- package/dist/esm/types/components/Checkbox/index.d.ts +19 -19
- package/dist/esm/types/components/Dialog/index.d.ts +16 -16
- package/dist/esm/types/components/EditableGrid/GridCell.d.ts +24 -24
- package/dist/esm/types/components/EditableGrid/GridInput/index.d.ts +16 -16
- package/dist/esm/types/components/EditableGrid/GridInputAutocomplete/index.d.ts +11 -11
- package/dist/esm/types/components/EditableGrid/GridInputText/index.d.ts +3 -3
- package/dist/esm/types/components/EditableGrid/GridSelect/index.d.ts +10 -10
- package/dist/esm/types/components/EditableGrid/NewRow/index.d.ts +13 -13
- package/dist/esm/types/components/EditableGrid/index.d.ts +52 -52
- package/dist/esm/types/components/Grid/AutoCreatedRows.d.ts +9 -9
- package/dist/esm/types/components/Grid/EditableTableCell/DefaultInput.d.ts +17 -17
- package/dist/esm/types/components/Grid/EditableTableCell/InputMask.d.ts +8 -8
- package/dist/esm/types/components/Grid/EditableTableCell/index.d.ts +24 -24
- package/dist/esm/types/components/Grid/Filters.d.ts +13 -13
- package/dist/esm/types/components/Grid/Grid.d.ts +33 -33
- package/dist/esm/types/components/Grid/Header.d.ts +11 -11
- package/dist/esm/types/components/Grid/Td.d.ts +3 -3
- package/dist/esm/types/components/Grid/Tr.d.ts +13 -13
- package/dist/esm/types/components/Grid/index.d.ts +6 -6
- package/dist/esm/types/components/Grid/utils.d.ts +5 -5
- package/dist/esm/types/components/Input/index.d.ts +12 -12
- package/dist/esm/types/components/InputMask/index.d.ts +13 -13
- package/dist/esm/types/components/LargeButton/index.d.ts +9 -9
- package/dist/esm/types/components/Modal/index.d.ts +8 -8
- package/dist/esm/types/components/Radio/index.d.ts +23 -23
- package/dist/esm/types/components/Select/index.d.ts +17 -17
- package/dist/esm/types/components/Switch/index.d.ts +19 -19
- package/dist/esm/types/components/TabPanel/index.d.ts +11 -11
- package/dist/esm/types/components/hooks/useEditableGrid.d.ts +23 -23
- package/dist/esm/types/components/hooks/useEvent.d.ts +1 -1
- package/dist/esm/types/components/hooks/useFilter.d.ts +17 -17
- package/dist/esm/types/components/hooks/useGrid.d.ts +23 -23
- package/dist/esm/types/components/hooks/useLoading.d.ts +4 -4
- package/dist/esm/types/components/index.d.ts +18 -18
- package/dist/esm/types/components/utils/GetInputLabel.d.ts +4 -4
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/index.d.ts +248 -248
- package/package.json +45 -45
package/dist/index.d.ts
CHANGED
|
@@ -3,296 +3,296 @@ import React, { ReactNode, FC } from 'react';
|
|
|
3
3
|
import { TableCellProps, TextFieldProps, TableRowProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteRenderInputParams, AutocompleteProps as AutocompleteProps$1, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, SxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps as ModalProps$1, DialogProps } from '@mui/material';
|
|
4
4
|
import IMask$1 from 'imask';
|
|
5
5
|
|
|
6
|
-
interface ColumnTitleProps {
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
transformer?: (value: string | number | Date) => string;
|
|
10
|
-
sx?: TableCellProps['sx'];
|
|
11
|
-
}
|
|
12
|
-
interface FilterProps$1 {
|
|
13
|
-
column: string;
|
|
14
|
-
value: string;
|
|
15
|
-
transformer?: (value: string | number | Date) => string;
|
|
16
|
-
}
|
|
17
|
-
declare type IFilter = FilterProps$1;
|
|
18
|
-
interface GridProps$1<T> {
|
|
19
|
-
columnTitles: ColumnTitleProps[];
|
|
20
|
-
defaultData: T[];
|
|
21
|
-
tableData: T[];
|
|
22
|
-
selectedFilters: FilterProps$1[];
|
|
23
|
-
setSelectedFilters(value: FilterProps$1[]): void;
|
|
24
|
-
setTableData(value: T[]): void;
|
|
25
|
-
updateFilters(value: Record<string, any>[]): void;
|
|
26
|
-
rowOptions?: number[];
|
|
27
|
-
footer?: ReactNode;
|
|
28
|
-
customButtons?: ReactNode;
|
|
29
|
-
isLoading?: boolean;
|
|
30
|
-
noFilterButtons?: boolean;
|
|
31
|
-
noPagination?: boolean;
|
|
32
|
-
noFilters?: boolean;
|
|
33
|
-
primaryKey?: string;
|
|
34
|
-
}
|
|
6
|
+
interface ColumnTitleProps {
|
|
7
|
+
name: string;
|
|
8
|
+
label: string;
|
|
9
|
+
transformer?: (value: string | number | Date) => string;
|
|
10
|
+
sx?: TableCellProps['sx'];
|
|
11
|
+
}
|
|
12
|
+
interface FilterProps$1 {
|
|
13
|
+
column: string;
|
|
14
|
+
value: string;
|
|
15
|
+
transformer?: (value: string | number | Date) => string;
|
|
16
|
+
}
|
|
17
|
+
declare type IFilter = FilterProps$1;
|
|
18
|
+
interface GridProps$1<T> {
|
|
19
|
+
columnTitles: ColumnTitleProps[];
|
|
20
|
+
defaultData: T[];
|
|
21
|
+
tableData: T[];
|
|
22
|
+
selectedFilters: FilterProps$1[];
|
|
23
|
+
setSelectedFilters(value: FilterProps$1[]): void;
|
|
24
|
+
setTableData(value: T[]): void;
|
|
25
|
+
updateFilters(value: Record<string, any>[]): void;
|
|
26
|
+
rowOptions?: number[];
|
|
27
|
+
footer?: ReactNode;
|
|
28
|
+
customButtons?: ReactNode;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
noFilterButtons?: boolean;
|
|
31
|
+
noPagination?: boolean;
|
|
32
|
+
noFilters?: boolean;
|
|
33
|
+
primaryKey?: string;
|
|
34
|
+
}
|
|
35
35
|
declare const Grid: <ObjectType>(props: React.PropsWithChildren<GridProps$1<ObjectType>>) => JSX.Element;
|
|
36
36
|
|
|
37
|
-
declare function filterData<T>(filters: FilterProps$1[], defaultData: {
|
|
38
|
-
current: T[];
|
|
37
|
+
declare function filterData<T>(filters: FilterProps$1[], defaultData: {
|
|
38
|
+
current: T[];
|
|
39
39
|
}): T[];
|
|
40
40
|
|
|
41
|
-
interface EditableTableCellProps extends TableCellProps {
|
|
42
|
-
name: string;
|
|
43
|
-
TextFieldProps?: TextFieldProps;
|
|
44
|
-
type?: TextFieldProps['type'];
|
|
45
|
-
fullWidth?: boolean;
|
|
46
|
-
rowData?: Record<string, any>;
|
|
47
|
-
mask?: IMask.AnyMaskedOptions;
|
|
48
|
-
bordered?: boolean;
|
|
49
|
-
rowIndex?: string | number;
|
|
50
|
-
formatCellValue?: (value: string) => string;
|
|
51
|
-
formatInputDefautvalue?: (value: string) => string;
|
|
52
|
-
onSave?: (props: OnSaveProps) => void;
|
|
53
|
-
onCancel?: () => void;
|
|
54
|
-
}
|
|
55
|
-
interface OnSaveProps {
|
|
56
|
-
name: string;
|
|
57
|
-
event: FocusEvent;
|
|
58
|
-
value: string;
|
|
59
|
-
data: Record<string, any>;
|
|
60
|
-
}
|
|
41
|
+
interface EditableTableCellProps extends TableCellProps {
|
|
42
|
+
name: string;
|
|
43
|
+
TextFieldProps?: TextFieldProps;
|
|
44
|
+
type?: TextFieldProps['type'];
|
|
45
|
+
fullWidth?: boolean;
|
|
46
|
+
rowData?: Record<string, any>;
|
|
47
|
+
mask?: IMask.AnyMaskedOptions;
|
|
48
|
+
bordered?: boolean;
|
|
49
|
+
rowIndex?: string | number;
|
|
50
|
+
formatCellValue?: (value: string) => string;
|
|
51
|
+
formatInputDefautvalue?: (value: string) => string;
|
|
52
|
+
onSave?: (props: OnSaveProps) => void;
|
|
53
|
+
onCancel?: () => void;
|
|
54
|
+
}
|
|
55
|
+
interface OnSaveProps {
|
|
56
|
+
name: string;
|
|
57
|
+
event: FocusEvent;
|
|
58
|
+
value: string;
|
|
59
|
+
data: Record<string, any>;
|
|
60
|
+
}
|
|
61
61
|
declare const EditableTableCell: (allProps: EditableTableCellProps) => JSX.Element;
|
|
62
62
|
|
|
63
|
-
interface CustomTableRowProps extends TableRowProps {
|
|
64
|
-
striped?: boolean;
|
|
65
|
-
bordered?: boolean;
|
|
66
|
-
index?: number;
|
|
67
|
-
rowData?: Record<string, any>;
|
|
68
|
-
onSave?: (props: OnSaveProps) => void;
|
|
69
|
-
children: React.ReactNode;
|
|
70
|
-
}
|
|
63
|
+
interface CustomTableRowProps extends TableRowProps {
|
|
64
|
+
striped?: boolean;
|
|
65
|
+
bordered?: boolean;
|
|
66
|
+
index?: number;
|
|
67
|
+
rowData?: Record<string, any>;
|
|
68
|
+
onSave?: (props: OnSaveProps) => void;
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
}
|
|
71
71
|
declare const Tr: React.MemoExoticComponent<(props: CustomTableRowProps) => JSX.Element>;
|
|
72
72
|
|
|
73
73
|
declare const Td: React.MemoExoticComponent<({ children, ...props }: TableCellProps) => JSX.Element>;
|
|
74
74
|
|
|
75
|
-
interface InputProps extends StandardTextFieldProps {
|
|
76
|
-
name: string;
|
|
77
|
-
label: string;
|
|
78
|
-
shrink?: boolean;
|
|
79
|
-
withFormik?: boolean;
|
|
80
|
-
}
|
|
75
|
+
interface InputProps extends StandardTextFieldProps {
|
|
76
|
+
name: string;
|
|
77
|
+
label: string;
|
|
78
|
+
shrink?: boolean;
|
|
79
|
+
withFormik?: boolean;
|
|
80
|
+
}
|
|
81
81
|
declare const Input: FC<InputProps>;
|
|
82
82
|
|
|
83
|
-
interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
84
|
-
name: string;
|
|
85
|
-
label: string;
|
|
86
|
-
withFormik?: boolean;
|
|
87
|
-
mask: IMask$1.AnyMaskedOptions;
|
|
88
|
-
onChangeValue?: (value: string, unmaskedValue: string) => void;
|
|
89
|
-
}
|
|
83
|
+
interface InputMaskProps extends Partial<StandardTextFieldProps> {
|
|
84
|
+
name: string;
|
|
85
|
+
label: string;
|
|
86
|
+
withFormik?: boolean;
|
|
87
|
+
mask: IMask$1.AnyMaskedOptions;
|
|
88
|
+
onChangeValue?: (value: string, unmaskedValue: string) => void;
|
|
89
|
+
}
|
|
90
90
|
declare function InputMask({ withFormik, ...rest }: InputMaskProps): JSX.Element;
|
|
91
91
|
|
|
92
|
-
interface CustomInputLabelProps extends InputLabelProps {
|
|
93
|
-
size?: 'small';
|
|
94
|
-
}
|
|
95
|
-
interface SelectProps extends SelectProps$1 {
|
|
96
|
-
name: string;
|
|
97
|
-
label: string;
|
|
98
|
-
defaultValue?: string;
|
|
99
|
-
withFormik?: boolean;
|
|
100
|
-
FormControlProps?: Partial<FormControlProps>;
|
|
101
|
-
InputLabelProps?: Partial<CustomInputLabelProps>;
|
|
102
|
-
}
|
|
92
|
+
interface CustomInputLabelProps extends InputLabelProps {
|
|
93
|
+
size?: 'small';
|
|
94
|
+
}
|
|
95
|
+
interface SelectProps extends SelectProps$1 {
|
|
96
|
+
name: string;
|
|
97
|
+
label: string;
|
|
98
|
+
defaultValue?: string;
|
|
99
|
+
withFormik?: boolean;
|
|
100
|
+
FormControlProps?: Partial<FormControlProps>;
|
|
101
|
+
InputLabelProps?: Partial<CustomInputLabelProps>;
|
|
102
|
+
}
|
|
103
103
|
declare const Select: FC<SelectProps>;
|
|
104
104
|
|
|
105
|
-
declare type MuiAutocompleteBaseProps<T> = Omit<AutocompleteProps$1<T, boolean, undefined, boolean>, 'renderInput' | 'getOptionLabel'>;
|
|
106
|
-
interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
107
|
-
name?: never;
|
|
108
|
-
withFormik: false;
|
|
109
|
-
getOptionValue?: never;
|
|
110
|
-
label?: string;
|
|
111
|
-
getOptionLabel: (option: T) => string;
|
|
112
|
-
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
113
|
-
}
|
|
114
|
-
interface AutocompleteWithFormikProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
115
|
-
name: string;
|
|
116
|
-
withFormik?: true;
|
|
117
|
-
label?: string;
|
|
118
|
-
option?: {
|
|
119
|
-
label?: keyof T;
|
|
120
|
-
value?: keyof T;
|
|
121
|
-
key?: string;
|
|
122
|
-
};
|
|
123
|
-
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
124
|
-
getOptionLabel?: (option: T) => string;
|
|
125
|
-
getOptionValue?: (option: T) => string | number;
|
|
126
|
-
}
|
|
127
|
-
declare type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
|
|
105
|
+
declare type MuiAutocompleteBaseProps<T> = Omit<AutocompleteProps$1<T, boolean, undefined, boolean>, 'renderInput' | 'getOptionLabel'>;
|
|
106
|
+
interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
107
|
+
name?: never;
|
|
108
|
+
withFormik: false;
|
|
109
|
+
getOptionValue?: never;
|
|
110
|
+
label?: string;
|
|
111
|
+
getOptionLabel: (option: T) => string;
|
|
112
|
+
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
113
|
+
}
|
|
114
|
+
interface AutocompleteWithFormikProps<T> extends MuiAutocompleteBaseProps<T> {
|
|
115
|
+
name: string;
|
|
116
|
+
withFormik?: true;
|
|
117
|
+
label?: string;
|
|
118
|
+
option?: {
|
|
119
|
+
label?: keyof T;
|
|
120
|
+
value?: keyof T;
|
|
121
|
+
key?: string;
|
|
122
|
+
};
|
|
123
|
+
renderInput?: (params: AutocompleteRenderInputParams) => ReactNode;
|
|
124
|
+
getOptionLabel?: (option: T) => string;
|
|
125
|
+
getOptionValue?: (option: T) => string | number;
|
|
126
|
+
}
|
|
127
|
+
declare type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
|
|
128
128
|
declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): JSX.Element;
|
|
129
129
|
|
|
130
|
-
declare type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
|
|
131
|
-
interface CheckboxWithFormik extends CheckboxProps$1 {
|
|
132
|
-
name: string;
|
|
133
|
-
label?: string;
|
|
134
|
-
withFormik?: true;
|
|
135
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
136
|
-
}
|
|
137
|
-
interface CheckboxWithoutFormik extends CheckboxProps$1 {
|
|
138
|
-
name?: never;
|
|
139
|
-
label?: string;
|
|
140
|
-
withFormik: false;
|
|
141
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
142
|
-
}
|
|
130
|
+
declare type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
|
|
131
|
+
interface CheckboxWithFormik extends CheckboxProps$1 {
|
|
132
|
+
name: string;
|
|
133
|
+
label?: string;
|
|
134
|
+
withFormik?: true;
|
|
135
|
+
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
136
|
+
}
|
|
137
|
+
interface CheckboxWithoutFormik extends CheckboxProps$1 {
|
|
138
|
+
name?: never;
|
|
139
|
+
label?: string;
|
|
140
|
+
withFormik: false;
|
|
141
|
+
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
142
|
+
}
|
|
143
143
|
declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => JSX.Element;
|
|
144
144
|
|
|
145
|
-
declare type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
|
|
146
|
-
interface SwitchWithFormik extends SwitchProps$1 {
|
|
147
|
-
name: string;
|
|
148
|
-
label?: string;
|
|
149
|
-
withFormik?: true;
|
|
150
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
151
|
-
}
|
|
152
|
-
interface SwitchWithoutFormik extends SwitchProps$1 {
|
|
153
|
-
name?: never;
|
|
154
|
-
label?: string;
|
|
155
|
-
withFormik: false;
|
|
156
|
-
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
157
|
-
}
|
|
145
|
+
declare type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
|
|
146
|
+
interface SwitchWithFormik extends SwitchProps$1 {
|
|
147
|
+
name: string;
|
|
148
|
+
label?: string;
|
|
149
|
+
withFormik?: true;
|
|
150
|
+
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
151
|
+
}
|
|
152
|
+
interface SwitchWithoutFormik extends SwitchProps$1 {
|
|
153
|
+
name?: never;
|
|
154
|
+
label?: string;
|
|
155
|
+
withFormik: false;
|
|
156
|
+
FormControlLabelProps?: Partial<FormControlLabelProps>;
|
|
157
|
+
}
|
|
158
158
|
declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => JSX.Element;
|
|
159
159
|
|
|
160
|
-
declare type RadioOptionProps = {
|
|
161
|
-
value: string | number | boolean;
|
|
162
|
-
label: string;
|
|
163
|
-
};
|
|
164
|
-
declare type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
|
|
165
|
-
interface RadioWithFormik extends RadioGroupProps {
|
|
166
|
-
name: string;
|
|
167
|
-
label?: string;
|
|
168
|
-
options: RadioOptionProps[];
|
|
169
|
-
withFormik?: true;
|
|
170
|
-
}
|
|
171
|
-
interface RadioWithoutFormik extends RadioGroupProps {
|
|
172
|
-
name?: never;
|
|
173
|
-
label?: string;
|
|
174
|
-
options: RadioOptionProps[];
|
|
175
|
-
withFormik: false;
|
|
176
|
-
}
|
|
160
|
+
declare type RadioOptionProps = {
|
|
161
|
+
value: string | number | boolean;
|
|
162
|
+
label: string;
|
|
163
|
+
};
|
|
164
|
+
declare type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
|
|
165
|
+
interface RadioWithFormik extends RadioGroupProps {
|
|
166
|
+
name: string;
|
|
167
|
+
label?: string;
|
|
168
|
+
options: RadioOptionProps[];
|
|
169
|
+
withFormik?: true;
|
|
170
|
+
}
|
|
171
|
+
interface RadioWithoutFormik extends RadioGroupProps {
|
|
172
|
+
name?: never;
|
|
173
|
+
label?: string;
|
|
174
|
+
options: RadioOptionProps[];
|
|
175
|
+
withFormik: false;
|
|
176
|
+
}
|
|
177
177
|
declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => JSX.Element;
|
|
178
178
|
|
|
179
|
-
interface LargeButtonProps extends ButtonProps {
|
|
180
|
-
loading?: boolean;
|
|
181
|
-
children: ReactNode;
|
|
182
|
-
CircularProgressProps?: CircularProgressProps;
|
|
183
|
-
}
|
|
179
|
+
interface LargeButtonProps extends ButtonProps {
|
|
180
|
+
loading?: boolean;
|
|
181
|
+
children: ReactNode;
|
|
182
|
+
CircularProgressProps?: CircularProgressProps;
|
|
183
|
+
}
|
|
184
184
|
declare const LargeButton: ({ loading, children, CircularProgressProps, sx, ...rest }: LargeButtonProps) => JSX.Element;
|
|
185
185
|
|
|
186
|
-
declare function getTabProps(index: string): {
|
|
187
|
-
id: string;
|
|
188
|
-
'aria-controls': string;
|
|
189
|
-
};
|
|
190
|
-
interface TabPanelProps {
|
|
191
|
-
children: React.ReactNode;
|
|
192
|
-
value: number;
|
|
193
|
-
index: number;
|
|
194
|
-
}
|
|
186
|
+
declare function getTabProps(index: string): {
|
|
187
|
+
id: string;
|
|
188
|
+
'aria-controls': string;
|
|
189
|
+
};
|
|
190
|
+
interface TabPanelProps {
|
|
191
|
+
children: React.ReactNode;
|
|
192
|
+
value: number;
|
|
193
|
+
index: number;
|
|
194
|
+
}
|
|
195
195
|
declare const TabPanel: (props: TabPanelProps) => JSX.Element;
|
|
196
196
|
|
|
197
|
-
interface ColumnsProps {
|
|
198
|
-
label: string;
|
|
199
|
-
name?: string;
|
|
200
|
-
width?: number;
|
|
201
|
-
sx?: SxProps;
|
|
202
|
-
canSort?: boolean;
|
|
203
|
-
}
|
|
204
|
-
interface GridProps {
|
|
205
|
-
columns: ColumnsProps[];
|
|
206
|
-
children: ReactNode;
|
|
207
|
-
fixedColumns?: boolean;
|
|
208
|
-
sortedBy: string;
|
|
209
|
-
sortedDirection: 'asc' | 'desc';
|
|
210
|
-
dense?: boolean;
|
|
211
|
-
onSortBy: (prop: string) => void;
|
|
212
|
-
paperProps?: PaperProps;
|
|
213
|
-
tableProps?: TableProps;
|
|
214
|
-
tableHeadProps?: TableHeadProps;
|
|
215
|
-
tableBodyProps?: TableBodyProps;
|
|
216
|
-
striped?: boolean;
|
|
217
|
-
bordered?: boolean;
|
|
218
|
-
currentPage: number;
|
|
219
|
-
totalNumberOfPages: number;
|
|
220
|
-
rowsPerPageOptions: number[];
|
|
221
|
-
rowsPerPage: number;
|
|
222
|
-
onPageChange: (pageNumber: number) => void;
|
|
223
|
-
setRowsPerPage: (rows: number) => void;
|
|
224
|
-
}
|
|
197
|
+
interface ColumnsProps {
|
|
198
|
+
label: string;
|
|
199
|
+
name?: string;
|
|
200
|
+
width?: number;
|
|
201
|
+
sx?: SxProps;
|
|
202
|
+
canSort?: boolean;
|
|
203
|
+
}
|
|
204
|
+
interface GridProps {
|
|
205
|
+
columns: ColumnsProps[];
|
|
206
|
+
children: ReactNode;
|
|
207
|
+
fixedColumns?: boolean;
|
|
208
|
+
sortedBy: string;
|
|
209
|
+
sortedDirection: 'asc' | 'desc';
|
|
210
|
+
dense?: boolean;
|
|
211
|
+
onSortBy: (prop: string) => void;
|
|
212
|
+
paperProps?: PaperProps;
|
|
213
|
+
tableProps?: TableProps;
|
|
214
|
+
tableHeadProps?: TableHeadProps;
|
|
215
|
+
tableBodyProps?: TableBodyProps;
|
|
216
|
+
striped?: boolean;
|
|
217
|
+
bordered?: boolean;
|
|
218
|
+
currentPage: number;
|
|
219
|
+
totalNumberOfPages: number;
|
|
220
|
+
rowsPerPageOptions: number[];
|
|
221
|
+
rowsPerPage: number;
|
|
222
|
+
onPageChange: (pageNumber: number) => void;
|
|
223
|
+
setRowsPerPage: (rows: number) => void;
|
|
224
|
+
}
|
|
225
225
|
declare function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedDirection, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions }: GridProps): JSX.Element;
|
|
226
226
|
|
|
227
|
-
declare type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in';
|
|
228
|
-
declare type FilterProps = {
|
|
229
|
-
id?: string;
|
|
230
|
-
prop: string;
|
|
231
|
-
value: unknown;
|
|
232
|
-
compareType: FilterCompareType;
|
|
233
|
-
};
|
|
234
|
-
declare function useFilter(): {
|
|
235
|
-
filters: FilterProps[];
|
|
236
|
-
filterBy: (newFilter: FilterProps) => void;
|
|
237
|
-
removeFilter: (prop: string) => void;
|
|
238
|
-
createFilter: typeof createFilter;
|
|
239
|
-
clearAllFilters: () => void;
|
|
240
|
-
};
|
|
241
|
-
declare function createFilter<T extends Record<string, any>>(filters: FilterProps[]): {
|
|
242
|
-
apply: (item: T) => boolean;
|
|
227
|
+
declare type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in';
|
|
228
|
+
declare type FilterProps = {
|
|
229
|
+
id?: string;
|
|
230
|
+
prop: string;
|
|
231
|
+
value: unknown;
|
|
232
|
+
compareType: FilterCompareType;
|
|
233
|
+
};
|
|
234
|
+
declare function useFilter(): {
|
|
235
|
+
filters: FilterProps[];
|
|
236
|
+
filterBy: (newFilter: FilterProps) => void;
|
|
237
|
+
removeFilter: (prop: string) => void;
|
|
238
|
+
createFilter: typeof createFilter;
|
|
239
|
+
clearAllFilters: () => void;
|
|
240
|
+
};
|
|
241
|
+
declare function createFilter<T extends Record<string, any>>(filters: FilterProps[]): {
|
|
242
|
+
apply: (item: T) => boolean;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
-
interface UseGridProps {
|
|
246
|
-
columns: ColumnsProps[];
|
|
247
|
-
filters?: FilterProps[];
|
|
248
|
-
rowsPerPageOptions?: number[];
|
|
249
|
-
}
|
|
250
|
-
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
251
|
-
data:
|
|
252
|
-
set: (data: T[]) => void;
|
|
253
|
-
onSortBy: (prop: string) => void;
|
|
254
|
-
sortedBy: string;
|
|
255
|
-
defaultData: T[];
|
|
256
|
-
sortedDirection: "desc" | "asc";
|
|
257
|
-
columns: ColumnsProps[];
|
|
258
|
-
currentPage: number;
|
|
259
|
-
totalNumberOfPages: number;
|
|
260
|
-
onPageChange: (pageNumber: number) => void;
|
|
261
|
-
setRowsPerPage: (rows: number) => void;
|
|
262
|
-
rowsPerPageOptions: number[];
|
|
263
|
-
rowsPerPage: number;
|
|
245
|
+
interface UseGridProps {
|
|
246
|
+
columns: ColumnsProps[];
|
|
247
|
+
filters?: FilterProps[];
|
|
248
|
+
rowsPerPageOptions?: number[];
|
|
249
|
+
}
|
|
250
|
+
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
251
|
+
data: T[];
|
|
252
|
+
set: (data: T[]) => void;
|
|
253
|
+
onSortBy: (prop: string) => void;
|
|
254
|
+
sortedBy: string;
|
|
255
|
+
defaultData: T[];
|
|
256
|
+
sortedDirection: "desc" | "asc";
|
|
257
|
+
columns: ColumnsProps[];
|
|
258
|
+
currentPage: number;
|
|
259
|
+
totalNumberOfPages: number;
|
|
260
|
+
onPageChange: (pageNumber: number) => void;
|
|
261
|
+
setRowsPerPage: (rows: number) => void;
|
|
262
|
+
rowsPerPageOptions: number[];
|
|
263
|
+
rowsPerPage: number;
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
declare function useEvent(event: keyof WindowEventMap, handler: (ev: any) => void, passive?: boolean): void;
|
|
267
267
|
|
|
268
|
-
declare function useLoading<T = string>(): {
|
|
269
|
-
isLoading: (prop: T) => boolean;
|
|
270
|
-
setLoading: (prop: T, remove?: boolean) => void;
|
|
268
|
+
declare function useLoading<T = string>(): {
|
|
269
|
+
isLoading: (prop: T) => boolean;
|
|
270
|
+
setLoading: (prop: T, remove?: boolean) => void;
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
declare type ModalProps = {
|
|
274
|
-
open: boolean;
|
|
275
|
-
onClose: () => void;
|
|
276
|
-
} & ModalProps$1;
|
|
273
|
+
declare type ModalProps = {
|
|
274
|
+
open: boolean;
|
|
275
|
+
onClose: () => void;
|
|
276
|
+
} & ModalProps$1;
|
|
277
277
|
declare const Modal: ({ open, onClose, ...rest }: ModalProps) => JSX.Element;
|
|
278
278
|
|
|
279
|
-
declare function GetInputLabel<T, K extends T[number]['name']>(columns: T): (columnName: K) => {
|
|
280
|
-
label: any;
|
|
281
|
-
name: any;
|
|
279
|
+
declare function GetInputLabel<T, K extends T[number]['name']>(columns: T): (columnName: K) => {
|
|
280
|
+
label: any;
|
|
281
|
+
name: any;
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
-
interface DialogOptionsProps {
|
|
285
|
-
label: string;
|
|
286
|
-
focus?: boolean;
|
|
287
|
-
cb(label: string): void;
|
|
288
|
-
}
|
|
289
|
-
interface DialogCustomProps extends DialogProps {
|
|
290
|
-
open: boolean;
|
|
291
|
-
title: string;
|
|
292
|
-
body: string;
|
|
293
|
-
options: DialogOptionsProps[];
|
|
294
|
-
loading: boolean;
|
|
295
|
-
}
|
|
284
|
+
interface DialogOptionsProps {
|
|
285
|
+
label: string;
|
|
286
|
+
focus?: boolean;
|
|
287
|
+
cb(label: string): void;
|
|
288
|
+
}
|
|
289
|
+
interface DialogCustomProps extends DialogProps {
|
|
290
|
+
open: boolean;
|
|
291
|
+
title: string;
|
|
292
|
+
body: string;
|
|
293
|
+
options: DialogOptionsProps[];
|
|
294
|
+
loading: boolean;
|
|
295
|
+
}
|
|
296
296
|
declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => JSX.Element;
|
|
297
297
|
|
|
298
298
|
export { Autocomplete, BaseGrid, Checkbox, ColumnTitleProps, ColumnsProps, Dialog, EditableTableCell, FilterCompareType, FilterProps, GetInputLabel, Grid, IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, Switch, TabPanel, TabPanelProps, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bluemarble/bm-components",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "BM components",
|
|
5
|
-
"main": "dist/cjs/index.js",
|
|
6
|
-
"module": "dist/esm/index.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"types": "dist/index.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"rollup": "rollup -c",
|
|
13
|
-
"deploy": "rollup -c && npm publish"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [],
|
|
16
|
-
"author": "",
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"imask": "^6.4.2",
|
|
20
|
-
"moment": "^2.29.4",
|
|
21
|
-
"react": ">=17.0.2",
|
|
22
|
-
"react-dom": ">=17.0.2",
|
|
23
|
-
"react-icons": "^4.3.1",
|
|
24
|
-
"react-imask": "^6.4.2"
|
|
25
|
-
},
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"@emotion/react": "^11.7.1",
|
|
28
|
-
"@emotion/styled": "^11.6.0",
|
|
29
|
-
"@mui/material": "^5.4.0",
|
|
30
|
-
"formik": "^2.2.9"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
34
|
-
"@rollup/plugin-commonjs": "^21.0.3",
|
|
35
|
-
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
36
|
-
"@rollup/plugin-typescript": "^8.3.1",
|
|
37
|
-
"@types/react": "^17.0.43",
|
|
38
|
-
"eslint": "^8.12.0",
|
|
39
|
-
"prettier": "^2.6.2",
|
|
40
|
-
"rollup": "^2.70.1",
|
|
41
|
-
"rollup-plugin-dts": "^4.2.0",
|
|
42
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
43
|
-
"typescript": "^4.6.3"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bluemarble/bm-components",
|
|
3
|
+
"version": "0.0.73",
|
|
4
|
+
"description": "BM components",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"rollup": "rollup -c",
|
|
13
|
+
"deploy": "rollup -c && npm publish"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"imask": "^6.4.2",
|
|
20
|
+
"moment": "^2.29.4",
|
|
21
|
+
"react": ">=17.0.2",
|
|
22
|
+
"react-dom": ">=17.0.2",
|
|
23
|
+
"react-icons": "^4.3.1",
|
|
24
|
+
"react-imask": "^6.4.2"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@emotion/react": "^11.7.1",
|
|
28
|
+
"@emotion/styled": "^11.6.0",
|
|
29
|
+
"@mui/material": "^5.4.0",
|
|
30
|
+
"formik": "^2.2.9"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
34
|
+
"@rollup/plugin-commonjs": "^21.0.3",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
36
|
+
"@rollup/plugin-typescript": "^8.3.1",
|
|
37
|
+
"@types/react": "^17.0.43",
|
|
38
|
+
"eslint": "^8.12.0",
|
|
39
|
+
"prettier": "^2.6.2",
|
|
40
|
+
"rollup": "^2.70.1",
|
|
41
|
+
"rollup-plugin-dts": "^4.2.0",
|
|
42
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
43
|
+
"typescript": "^4.6.3"
|
|
44
|
+
}
|
|
45
|
+
}
|