@charlesgomes/leafcode-shared-lib-react 1.0.58 → 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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import react__default, { ReactNode as ReactNode$1 } from 'react';
3
+ import react__default, { ReactNode as ReactNode$1, InputHTMLAttributes } from 'react';
4
4
  import { FieldError } from 'react-hook-form';
5
5
  import { FilterMatchMode } from 'primereact/api';
6
6
  export { FilterMatchMode, FilterOperator } from 'primereact/api';
@@ -18,7 +18,7 @@ interface ButtonProps {
18
18
  }
19
19
  declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
21
+ interface InputProps$1 extends React.InputHTMLAttributes<HTMLInputElement> {
22
22
  name: string;
23
23
  label?: string | ReactNode$1;
24
24
  error?: FieldError;
@@ -28,28 +28,8 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
28
28
  isUppercaseText?: boolean;
29
29
  validationMode?: "default" | "restricted";
30
30
  showPasswordToggle?: boolean;
31
- fonts?: {
32
- labelFamily?: string;
33
- labelWeight?: number | string;
34
- inputFamily?: string;
35
- inputWeight?: number | string;
36
- };
37
- colors?: {
38
- label?: string;
39
- labelBg?: string;
40
- inputBorder?: string;
41
- inputBg?: string;
42
- inputText?: string;
43
- inputFocusBorder?: string;
44
- inputPlaceholder?: string;
45
- inputErrorBorder?: string;
46
- autofillBoxShadow?: string;
47
- autofillTextColor?: string;
48
- autofillColorBorder?: string;
49
- colorPasswordToggle?: string;
50
- };
51
31
  }
52
- declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
32
+ declare const Input: react.ForwardRefExoticComponent<InputProps$1 & react.RefAttributes<HTMLInputElement>>;
53
33
 
54
34
  interface TextAreaProps {
55
35
  name: string;
@@ -60,32 +40,30 @@ interface TextAreaProps {
60
40
  isUppercaseText?: boolean;
61
41
  isUppercaseLabel?: boolean;
62
42
  disabled?: boolean;
63
- height?: {
64
- heightTextArea: string;
65
- };
66
- fonts?: {
67
- labelFamily?: string;
68
- labelWeight?: number | string;
69
- inputFamily?: string;
70
- inputWeight?: number | string;
71
- };
72
- colors?: {
73
- label?: string;
74
- labelBg?: string;
75
- inputBorder?: string;
76
- inputBg?: string;
77
- inputText?: string;
78
- inputFocusBorder?: string;
79
- inputPlaceholder?: string;
80
- inputErrorBorder?: string;
81
- autofillBoxShadow?: string;
82
- autofillTextColor?: string;
83
- autofillColorBorder?: string;
84
- colorPasswordToggle?: string;
85
- };
86
43
  }
87
44
  declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
88
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
+
89
67
  interface Props {
90
68
  show: boolean;
91
69
  onHide: () => void;
@@ -96,8 +74,44 @@ interface Props {
96
74
  btnCancel?: string;
97
75
  btnSuccess?: string;
98
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
+ };
99
94
  }
100
- declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, disabledBtnSuccess, }: Props): react_jsx_runtime.JSX.Element;
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;
113
+ }
114
+ declare const InputAutoComplete: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
101
115
 
102
116
  type IDataTableProps<T extends object> = {
103
117
  queryKey: string;
@@ -225,4 +239,85 @@ declare const getUrlParams: (sortFieldInitial: string, sortOrderInitial: 1 | -1)
225
239
  type SortingResult = any[];
226
240
  declare function buildSortingWithFilters(filters: Record<string, any>, sortField?: string, order?: number): SortingResult;
227
241
 
228
- export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsEnumNotNullable, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getUrlParams, mapPrimeToBackendFilters };
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,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import react__default, { ReactNode as ReactNode$1 } from 'react';
3
+ import react__default, { ReactNode as ReactNode$1, InputHTMLAttributes } from 'react';
4
4
  import { FieldError } from 'react-hook-form';
5
5
  import { FilterMatchMode } from 'primereact/api';
6
6
  export { FilterMatchMode, FilterOperator } from 'primereact/api';
@@ -18,7 +18,7 @@ interface ButtonProps {
18
18
  }
19
19
  declare function Button({ disabled, loading, color, type, onClick, title, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
20
20
 
21
- interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
21
+ interface InputProps$1 extends React.InputHTMLAttributes<HTMLInputElement> {
22
22
  name: string;
23
23
  label?: string | ReactNode$1;
24
24
  error?: FieldError;
@@ -28,28 +28,8 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
28
28
  isUppercaseText?: boolean;
29
29
  validationMode?: "default" | "restricted";
30
30
  showPasswordToggle?: boolean;
31
- fonts?: {
32
- labelFamily?: string;
33
- labelWeight?: number | string;
34
- inputFamily?: string;
35
- inputWeight?: number | string;
36
- };
37
- colors?: {
38
- label?: string;
39
- labelBg?: string;
40
- inputBorder?: string;
41
- inputBg?: string;
42
- inputText?: string;
43
- inputFocusBorder?: string;
44
- inputPlaceholder?: string;
45
- inputErrorBorder?: string;
46
- autofillBoxShadow?: string;
47
- autofillTextColor?: string;
48
- autofillColorBorder?: string;
49
- colorPasswordToggle?: string;
50
- };
51
31
  }
52
- declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
32
+ declare const Input: react.ForwardRefExoticComponent<InputProps$1 & react.RefAttributes<HTMLInputElement>>;
53
33
 
54
34
  interface TextAreaProps {
55
35
  name: string;
@@ -60,32 +40,30 @@ interface TextAreaProps {
60
40
  isUppercaseText?: boolean;
61
41
  isUppercaseLabel?: boolean;
62
42
  disabled?: boolean;
63
- height?: {
64
- heightTextArea: string;
65
- };
66
- fonts?: {
67
- labelFamily?: string;
68
- labelWeight?: number | string;
69
- inputFamily?: string;
70
- inputWeight?: number | string;
71
- };
72
- colors?: {
73
- label?: string;
74
- labelBg?: string;
75
- inputBorder?: string;
76
- inputBg?: string;
77
- inputText?: string;
78
- inputFocusBorder?: string;
79
- inputPlaceholder?: string;
80
- inputErrorBorder?: string;
81
- autofillBoxShadow?: string;
82
- autofillTextColor?: string;
83
- autofillColorBorder?: string;
84
- colorPasswordToggle?: string;
85
- };
86
43
  }
87
44
  declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
88
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
+
89
67
  interface Props {
90
68
  show: boolean;
91
69
  onHide: () => void;
@@ -96,8 +74,44 @@ interface Props {
96
74
  btnCancel?: string;
97
75
  btnSuccess?: string;
98
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
+ };
99
94
  }
100
- declare function ModalBase({ show, onHide, onAction, title, children, loading, btnCancel, btnSuccess, disabledBtnSuccess, }: Props): react_jsx_runtime.JSX.Element;
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;
113
+ }
114
+ declare const InputAutoComplete: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
101
115
 
102
116
  type IDataTableProps<T extends object> = {
103
117
  queryKey: string;
@@ -225,4 +239,85 @@ declare const getUrlParams: (sortFieldInitial: string, sortOrderInitial: 1 | -1)
225
239
  type SortingResult = any[];
226
240
  declare function buildSortingWithFilters(filters: Record<string, any>, sortField?: string, order?: number): SortingResult;
227
241
 
228
- export { Button, type ColumnCustom, CustomFilterElement, DataTableAdvancedFilter, DateFilterTemplate, DateTimeFilterTemplate, type IDataTableProps, type IItemProps, Input, ModalBase, SelectFilterTemplate, TextArea, ValueFilterTemplate, buildDynamicCampoFilters, buildSortingWithFilters, customMatchModes, getDefaultFilterMatchOptionsDate, getDefaultFilterMatchOptionsEnum, getDefaultFilterMatchOptionsEnumNotNullable, getDefaultFilterMatchOptionsString, getDefaultFilterMatchOptionsStringArray, getUrlParams, mapPrimeToBackendFilters };
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 };