@charlesgomes/leafcode-shared-lib-react 1.0.57 → 1.0.59
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/index.css +5 -5
- package/dist/index.d.mts +168 -3
- package/dist/index.d.ts +168 -3
- package/dist/index.js +803 -130
- package/dist/index.mjs +803 -124
- package/dist/styles/base.css +20 -0
- package/dist/styles/button.css +41 -47
- package/dist/styles/input.css +246 -0
- package/dist/styles/modalBase.css +99 -0
- package/dist/styles/table.css +5 -5
- package/package.json +10 -2
package/dist/index.css
CHANGED
|
@@ -541,9 +541,9 @@ th {
|
|
|
541
541
|
height: 1.25rem;
|
|
542
542
|
padding: 3px;
|
|
543
543
|
transition: all 0.3s ease-in-out;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
544
|
+
}
|
|
545
|
+
.close-search:hover {
|
|
546
|
+
background-color: #bf1717;
|
|
547
|
+
color: #fff;
|
|
548
|
+
border-radius: 5rem;
|
|
549
549
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { ReactNode as ReactNode$1, InputHTMLAttributes } from 'react';
|
|
4
|
+
import { FieldError } from 'react-hook-form';
|
|
3
5
|
import { FilterMatchMode } from 'primereact/api';
|
|
4
6
|
export { FilterMatchMode, FilterOperator } from 'primereact/api';
|
|
5
7
|
export { DataTableProps } from 'primereact/datatable';
|
|
@@ -16,6 +18,52 @@ interface ButtonProps {
|
|
|
16
18
|
}
|
|
17
19
|
declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
18
20
|
|
|
21
|
+
interface InputProps$1 extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
22
|
+
name: string;
|
|
23
|
+
label?: string | ReactNode$1;
|
|
24
|
+
error?: FieldError;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
onFocus?: () => void;
|
|
27
|
+
isUppercaseLabel?: boolean;
|
|
28
|
+
isUppercaseText?: boolean;
|
|
29
|
+
validationMode?: "default" | "restricted";
|
|
30
|
+
showPasswordToggle?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps$1 & react.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
|
|
34
|
+
interface TextAreaProps {
|
|
35
|
+
name: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
error?: FieldError;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
onFocus?: () => void;
|
|
40
|
+
isUppercaseText?: boolean;
|
|
41
|
+
isUppercaseLabel?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
}
|
|
44
|
+
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
45
|
+
|
|
46
|
+
interface OptionsProps {
|
|
47
|
+
value: string;
|
|
48
|
+
label: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface SelectProps {
|
|
52
|
+
name: string;
|
|
53
|
+
label?: string | ReactNode$1;
|
|
54
|
+
error?: FieldError | any;
|
|
55
|
+
placeholder?: string;
|
|
56
|
+
options: OptionsProps[] | any[];
|
|
57
|
+
isMulti?: boolean;
|
|
58
|
+
closeMenuOnSelect?: boolean;
|
|
59
|
+
isClearable?: boolean;
|
|
60
|
+
control?: any;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
onSelect?: any;
|
|
63
|
+
isUppercaseLabel?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare const InputSelect: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
66
|
+
|
|
19
67
|
interface Props {
|
|
20
68
|
show: boolean;
|
|
21
69
|
onHide: () => void;
|
|
@@ -26,8 +74,44 @@ interface Props {
|
|
|
26
74
|
btnCancel?: string;
|
|
27
75
|
btnSuccess?: string;
|
|
28
76
|
disabledBtnSuccess?: boolean;
|
|
77
|
+
type?: "submit" | "button";
|
|
78
|
+
fonts?: {
|
|
79
|
+
modalTitleFontWeight?: number | string;
|
|
80
|
+
modalTitleFontSize?: number | string;
|
|
81
|
+
modalTitleFontFamily?: string;
|
|
82
|
+
modalBodyFontFamily?: string;
|
|
83
|
+
modalBodyFontSize?: number | string;
|
|
84
|
+
};
|
|
85
|
+
colors?: {
|
|
86
|
+
modalBgColor?: string;
|
|
87
|
+
modalTitleColor?: string;
|
|
88
|
+
modalBodyColor?: string;
|
|
89
|
+
modalCloseColor?: string;
|
|
90
|
+
};
|
|
91
|
+
modalMaxWidth?: {
|
|
92
|
+
modalMaxWidth?: number | string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, type, disabledBtnSuccess, colors, fonts, modalMaxWidth, }: Props): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface PaginatedResponse$1 {
|
|
98
|
+
items: any[];
|
|
99
|
+
totalPages: number;
|
|
100
|
+
totalCount: number;
|
|
101
|
+
}
|
|
102
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
|
+
name: string;
|
|
104
|
+
label?: string;
|
|
105
|
+
error?: FieldError;
|
|
106
|
+
onSelect: (item: any) => void;
|
|
107
|
+
defaultValue?: any;
|
|
108
|
+
inputAutocompleteActive?: string;
|
|
109
|
+
queryKey: string;
|
|
110
|
+
isUppercaseLabel?: boolean;
|
|
111
|
+
mutationFn: (pageNumber: number, pageSize: number, search: string) => Promise<PaginatedResponse$1>;
|
|
112
|
+
renderOption: (item: any) => ReactNode$1;
|
|
29
113
|
}
|
|
30
|
-
declare
|
|
114
|
+
declare const InputAutoComplete: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
31
115
|
|
|
32
116
|
type IDataTableProps<T extends object> = {
|
|
33
117
|
queryKey: string;
|
|
@@ -155,4 +239,85 @@ declare const getUrlParams: (sortFieldInitial: string, sortOrderInitial: 1 | -1)
|
|
|
155
239
|
type SortingResult = any[];
|
|
156
240
|
declare function buildSortingWithFilters(filters: Record<string, any>, sortField?: string, order?: number): SortingResult;
|
|
157
241
|
|
|
158
|
-
|
|
242
|
+
interface LeafcodeTheme {
|
|
243
|
+
colors: {
|
|
244
|
+
primary: string;
|
|
245
|
+
danger: string;
|
|
246
|
+
border: string;
|
|
247
|
+
text: string;
|
|
248
|
+
light: string,
|
|
249
|
+
background: string;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
fonts: {
|
|
253
|
+
body: string;
|
|
254
|
+
heading: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
radius: {
|
|
258
|
+
sm: string;
|
|
259
|
+
md: string;
|
|
260
|
+
lg: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
components: {
|
|
264
|
+
input: {
|
|
265
|
+
colors: {
|
|
266
|
+
border: string;
|
|
267
|
+
focusBorder: string;
|
|
268
|
+
errorBorder: string;
|
|
269
|
+
background: string;
|
|
270
|
+
text: string;
|
|
271
|
+
placeholder: string;
|
|
272
|
+
passwordToggle: string;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
fonts: {
|
|
276
|
+
label: string;
|
|
277
|
+
input: string;
|
|
278
|
+
labelSize: string | number;
|
|
279
|
+
inputSize: string | number;
|
|
280
|
+
labelWeight: number | string;
|
|
281
|
+
inputWeight: number | string;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
sizes: {
|
|
285
|
+
height: string | number;
|
|
286
|
+
heightTextArea: string | number;
|
|
287
|
+
radius: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
button: {
|
|
291
|
+
colors: {
|
|
292
|
+
text: string;
|
|
293
|
+
primaryBg: string;
|
|
294
|
+
primaryHoverBg: string;
|
|
295
|
+
secondaryBg: string;
|
|
296
|
+
secondaryHoverBg: string;
|
|
297
|
+
disabledBorder: string;
|
|
298
|
+
disabledBg: string;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
fonts: {
|
|
302
|
+
family: string;
|
|
303
|
+
weight: number | string;
|
|
304
|
+
size: string | number;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
sizes: {
|
|
308
|
+
height: string | number;
|
|
309
|
+
minWidth: string | number;
|
|
310
|
+
radius: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare const LeafcodeThemeProvider: ({ children, theme, }: {
|
|
317
|
+
children: React.ReactNode;
|
|
318
|
+
theme?: Partial<LeafcodeTheme>;
|
|
319
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
320
|
+
|
|
321
|
+
declare const defaultTheme: LeafcodeTheme;
|
|
322
|
+
|
|
323
|
+
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsEnumNotNullable, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getUrlParams, mapPrimeToBackendFilters };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import react__default, { ReactNode as ReactNode$1, InputHTMLAttributes } from 'react';
|
|
4
|
+
import { FieldError } from 'react-hook-form';
|
|
3
5
|
import { FilterMatchMode } from 'primereact/api';
|
|
4
6
|
export { FilterMatchMode, FilterOperator } from 'primereact/api';
|
|
5
7
|
export { DataTableProps } from 'primereact/datatable';
|
|
@@ -16,6 +18,52 @@ interface ButtonProps {
|
|
|
16
18
|
}
|
|
17
19
|
declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
18
20
|
|
|
21
|
+
interface InputProps$1 extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
22
|
+
name: string;
|
|
23
|
+
label?: string | ReactNode$1;
|
|
24
|
+
error?: FieldError;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
onFocus?: () => void;
|
|
27
|
+
isUppercaseLabel?: boolean;
|
|
28
|
+
isUppercaseText?: boolean;
|
|
29
|
+
validationMode?: "default" | "restricted";
|
|
30
|
+
showPasswordToggle?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps$1 & react.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
|
|
34
|
+
interface TextAreaProps {
|
|
35
|
+
name: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
error?: FieldError;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
onFocus?: () => void;
|
|
40
|
+
isUppercaseText?: boolean;
|
|
41
|
+
isUppercaseLabel?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
}
|
|
44
|
+
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
45
|
+
|
|
46
|
+
interface OptionsProps {
|
|
47
|
+
value: string;
|
|
48
|
+
label: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface SelectProps {
|
|
52
|
+
name: string;
|
|
53
|
+
label?: string | ReactNode$1;
|
|
54
|
+
error?: FieldError | any;
|
|
55
|
+
placeholder?: string;
|
|
56
|
+
options: OptionsProps[] | any[];
|
|
57
|
+
isMulti?: boolean;
|
|
58
|
+
closeMenuOnSelect?: boolean;
|
|
59
|
+
isClearable?: boolean;
|
|
60
|
+
control?: any;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
onSelect?: any;
|
|
63
|
+
isUppercaseLabel?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare const InputSelect: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
66
|
+
|
|
19
67
|
interface Props {
|
|
20
68
|
show: boolean;
|
|
21
69
|
onHide: () => void;
|
|
@@ -26,8 +74,44 @@ interface Props {
|
|
|
26
74
|
btnCancel?: string;
|
|
27
75
|
btnSuccess?: string;
|
|
28
76
|
disabledBtnSuccess?: boolean;
|
|
77
|
+
type?: "submit" | "button";
|
|
78
|
+
fonts?: {
|
|
79
|
+
modalTitleFontWeight?: number | string;
|
|
80
|
+
modalTitleFontSize?: number | string;
|
|
81
|
+
modalTitleFontFamily?: string;
|
|
82
|
+
modalBodyFontFamily?: string;
|
|
83
|
+
modalBodyFontSize?: number | string;
|
|
84
|
+
};
|
|
85
|
+
colors?: {
|
|
86
|
+
modalBgColor?: string;
|
|
87
|
+
modalTitleColor?: string;
|
|
88
|
+
modalBodyColor?: string;
|
|
89
|
+
modalCloseColor?: string;
|
|
90
|
+
};
|
|
91
|
+
modalMaxWidth?: {
|
|
92
|
+
modalMaxWidth?: number | string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, type, disabledBtnSuccess, colors, fonts, modalMaxWidth, }: Props): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
interface PaginatedResponse$1 {
|
|
98
|
+
items: any[];
|
|
99
|
+
totalPages: number;
|
|
100
|
+
totalCount: number;
|
|
101
|
+
}
|
|
102
|
+
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
|
+
name: string;
|
|
104
|
+
label?: string;
|
|
105
|
+
error?: FieldError;
|
|
106
|
+
onSelect: (item: any) => void;
|
|
107
|
+
defaultValue?: any;
|
|
108
|
+
inputAutocompleteActive?: string;
|
|
109
|
+
queryKey: string;
|
|
110
|
+
isUppercaseLabel?: boolean;
|
|
111
|
+
mutationFn: (pageNumber: number, pageSize: number, search: string) => Promise<PaginatedResponse$1>;
|
|
112
|
+
renderOption: (item: any) => ReactNode$1;
|
|
29
113
|
}
|
|
30
|
-
declare
|
|
114
|
+
declare const InputAutoComplete: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
31
115
|
|
|
32
116
|
type IDataTableProps<T extends object> = {
|
|
33
117
|
queryKey: string;
|
|
@@ -155,4 +239,85 @@ declare const getUrlParams: (sortFieldInitial: string, sortOrderInitial: 1 | -1)
|
|
|
155
239
|
type SortingResult = any[];
|
|
156
240
|
declare function buildSortingWithFilters(filters: Record<string, any>, sortField?: string, order?: number): SortingResult;
|
|
157
241
|
|
|
158
|
-
|
|
242
|
+
interface LeafcodeTheme {
|
|
243
|
+
colors: {
|
|
244
|
+
primary: string;
|
|
245
|
+
danger: string;
|
|
246
|
+
border: string;
|
|
247
|
+
text: string;
|
|
248
|
+
light: string,
|
|
249
|
+
background: string;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
fonts: {
|
|
253
|
+
body: string;
|
|
254
|
+
heading: string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
radius: {
|
|
258
|
+
sm: string;
|
|
259
|
+
md: string;
|
|
260
|
+
lg: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
components: {
|
|
264
|
+
input: {
|
|
265
|
+
colors: {
|
|
266
|
+
border: string;
|
|
267
|
+
focusBorder: string;
|
|
268
|
+
errorBorder: string;
|
|
269
|
+
background: string;
|
|
270
|
+
text: string;
|
|
271
|
+
placeholder: string;
|
|
272
|
+
passwordToggle: string;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
fonts: {
|
|
276
|
+
label: string;
|
|
277
|
+
input: string;
|
|
278
|
+
labelSize: string | number;
|
|
279
|
+
inputSize: string | number;
|
|
280
|
+
labelWeight: number | string;
|
|
281
|
+
inputWeight: number | string;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
sizes: {
|
|
285
|
+
height: string | number;
|
|
286
|
+
heightTextArea: string | number;
|
|
287
|
+
radius: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
button: {
|
|
291
|
+
colors: {
|
|
292
|
+
text: string;
|
|
293
|
+
primaryBg: string;
|
|
294
|
+
primaryHoverBg: string;
|
|
295
|
+
secondaryBg: string;
|
|
296
|
+
secondaryHoverBg: string;
|
|
297
|
+
disabledBorder: string;
|
|
298
|
+
disabledBg: string;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
fonts: {
|
|
302
|
+
family: string;
|
|
303
|
+
weight: number | string;
|
|
304
|
+
size: string | number;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
sizes: {
|
|
308
|
+
height: string | number;
|
|
309
|
+
minWidth: string | number;
|
|
310
|
+
radius: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare const LeafcodeThemeProvider: ({ children, theme, }: {
|
|
317
|
+
children: React.ReactNode;
|
|
318
|
+
theme?: Partial<LeafcodeTheme>;
|
|
319
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
320
|
+
|
|
321
|
+
declare const defaultTheme: LeafcodeTheme;
|
|
322
|
+
|
|
323
|
+
export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, InputAutoComplete, InputSelect, LeafcodeThemeProvider, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, defaultTheme, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsEnumNotNullable, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getUrlParams, mapPrimeToBackendFilters };
|