componentes-sinco 1.0.2-rc.7 → 1.0.2-rc.9

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.cts CHANGED
@@ -1,19 +1,30 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ComponentType } from 'react';
2
+ import React__default, { ComponentType, ReactNode } from 'react';
3
3
  import * as Muicon from '@mui/icons-material';
4
4
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
5
5
  import * as _mui_material from '@mui/material';
6
+ import { Dayjs } from 'dayjs';
6
7
  import * as _mui_material_styles from '@mui/material/styles';
7
8
 
8
- type ReplyPalette$1 = "primary" | "secondary" | "warning" | "info" | "success" | "error";
9
+ type ReplyPalette$1 = "primary" | "secondary" | "warning" | "info" | "success" | "error" | any;
9
10
  type ReplyTextPalette = "primary" | "secondary" | "disabled";
10
11
  type ReplyVariants = "outlined" | "filled" | "standard";
11
12
  type RepplyButtonVariants = "text" | "contained" | "outlined";
12
13
 
13
14
  declare function capitalize(text: string): string;
14
15
 
15
- interface ArrayElement {
16
- type?: 'textField' | 'textArea';
16
+ interface ArrayElement<T> {
17
+ data?: T[];
18
+ columnGroup?: string;
19
+ getItemValue?: (item: T) => {
20
+ icon?: any;
21
+ text: string;
22
+ value: string;
23
+ };
24
+ typeFormat?: "normal" | "multiselect";
25
+ checkMassive?: boolean;
26
+ deleteType?: "button" | "icon";
27
+ type?: 'textField' | 'textArea' | 'select' | 'autocomplete' | 'dateRange';
17
28
  title?: string;
18
29
  iconTitle?: keyof typeof Muicon;
19
30
  infoTitle?: {
@@ -21,6 +32,8 @@ interface ArrayElement {
21
32
  component?: "tooltip" | "popover";
22
33
  };
23
34
  label?: string;
35
+ labelDateInitial?: string;
36
+ labelDateFinal?: string;
24
37
  placeholder?: string;
25
38
  infoElement?: {
26
39
  text?: string;
@@ -39,15 +52,17 @@ interface ArrayElement {
39
52
  rows?: number;
40
53
  color?: ReplyPalette$1;
41
54
  background?: string;
42
- state?: any | React.Dispatch<React.SetStateAction<string>>;
43
- value?: string;
55
+ setState?: any | React.Dispatch<React.SetStateAction<string>>;
56
+ state?: any;
44
57
  onChange?: () => {};
45
58
  onBlur?: () => {};
46
59
  onKeyDown?: () => {};
60
+ fnAplicar?: () => void | React.ReactNode;
61
+ inputChange?: (value: string) => void;
47
62
  }
48
- interface DrawerProps {
63
+ interface DrawerProps<T> {
49
64
  title?: string;
50
- arrayElements?: ArrayElement[];
65
+ arrayElements?: ArrayElement<T>[];
51
66
  actions?: {
52
67
  text: string;
53
68
  fn: () => void;
@@ -90,7 +105,65 @@ declare const ToastProgress: (timeProgress: number) => {
90
105
  progressToast: number;
91
106
  };
92
107
 
93
- declare const SCDrawer: ({ title, arrayElements, actions, buttonDrawer, colorTitle, anchor, width, open, }: DrawerProps) => React__default.JSX.Element;
108
+ declare function SCDrawer<T>({ title, arrayElements, actions, buttonDrawer, colorTitle, anchor, width, open, }: DrawerProps<T>): React__default.JSX.Element;
109
+
110
+ interface FooterActionsProperties {
111
+ label?: React.ReactNode;
112
+ leftContent?: React.ReactNode;
113
+ rightContent?: React.ReactNode;
114
+ variant?: 'standard' | 'float';
115
+ }
116
+
117
+ declare const FooterAction: ({ leftContent, rightContent, label, variant, }: FooterActionsProperties) => React__default.JSX.Element;
118
+
119
+ declare const modalStateConfig: {
120
+ info: {
121
+ color: string;
122
+ defaultDescription: string;
123
+ icon: React__default.JSX.Element;
124
+ };
125
+ delete: {
126
+ color: string;
127
+ defaultDescription: string;
128
+ icon: React__default.JSX.Element;
129
+ };
130
+ warning: {
131
+ color: string;
132
+ defaultDescription: string;
133
+ icon: React__default.JSX.Element;
134
+ };
135
+ };
136
+
137
+ type ModalStates = 'info' | 'delete' | 'warning';
138
+ interface ModalProps {
139
+ title: string;
140
+ description?: string;
141
+ textButton?: string;
142
+ buttonVariant?: RepplyButtonVariants;
143
+ iconPosition?: 'left' | 'right';
144
+ buttonColor?: ReplyPalette$1;
145
+ state: ModalStates;
146
+ open: boolean;
147
+ action?: {
148
+ text: string;
149
+ fn: () => void;
150
+ disabled?: boolean;
151
+ }[];
152
+ buttonModal?: {
153
+ icon?: string;
154
+ text?: string;
155
+ color?: ReplyPalette$1;
156
+ variant?: 'text' | 'outlined' | 'contained';
157
+ iconPosition?: 'left' | 'right';
158
+ size?: "small" | "medium" | "large";
159
+ };
160
+ }
161
+
162
+ declare const getIconComponent: (iconName?: string) => React.ElementType;
163
+ declare const getModalColor: (state: string) => string;
164
+ declare const getButtonColor: (state: string) => 'inherit' | 'info' | 'error' | 'warning';
165
+
166
+ declare const SCModal: ({ buttonModal, state, open, title, description, action, }: ModalProps) => React__default.JSX.Element;
94
167
 
95
168
  interface MultiSelectProps<T> {
96
169
  textButton?: string;
@@ -137,7 +210,18 @@ declare function useFilteredItems<T>(items: T[], filterValue: string, getItemLab
137
210
  sortedItems: T[];
138
211
  };
139
212
 
140
- declare function SCMultiSelect<T>({ textButton, button, items, topPanel, actions, dense, open, selectAll, getItemLabel }: MultiSelectProps<T>): React__default.JSX.Element;
213
+ declare function MultiSelect<T>({ textButton, button, items, topPanel, actions, dense, open, selectAll, getItemLabel }: MultiSelectProps<T>): React__default.JSX.Element;
214
+
215
+ interface PageheaderProperties {
216
+ title: string | React.ReactNode;
217
+ subtitle?: string | React.ReactNode;
218
+ actions?: React.ReactNode;
219
+ buttonBack?: React.ReactNode;
220
+ fixed?: boolean;
221
+ shadow?: boolean;
222
+ }
223
+
224
+ declare const PageHeader: ({ title, subtitle, actions, buttonBack, fixed, shadow, }: PageheaderProperties) => React__default.JSX.Element;
141
225
 
142
226
  interface SCTextAreaProps {
143
227
  title?: string;
@@ -156,14 +240,14 @@ interface SCTextAreaProps {
156
240
  disabled?: boolean;
157
241
  rows?: number;
158
242
  maxLength?: number;
159
- value: string;
160
- state: React.Dispatch<React.SetStateAction<string>>;
243
+ state: string;
244
+ setState: React.Dispatch<React.SetStateAction<string>>;
161
245
  onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
162
246
  }
163
247
 
164
248
  declare function getIcon(name?: string): ComponentType | null;
165
249
 
166
- declare const SCTextArea: ({ title, iconTitle, infoTitle, label, placeholder, maxLength, variant, disabled, required, width, rows, colorTitle, background, state, value, onBlur, }: SCTextAreaProps) => React__default.JSX.Element;
250
+ declare const SCTextArea: ({ title, iconTitle, infoTitle, label, placeholder, maxLength, variant, disabled, required, width, rows, colorTitle, background, setState, state, onBlur, }: SCTextAreaProps) => React__default.JSX.Element;
167
251
 
168
252
  interface SCTextFieldProps {
169
253
  title?: string;
@@ -186,17 +270,94 @@ interface SCTextFieldProps {
186
270
  };
187
271
  size?: "small" | "medium";
188
272
  variant?: "outlined" | "filled" | "standard";
189
- value: string;
190
273
  maxLength?: number;
191
274
  disabled?: boolean;
192
275
  required?: boolean;
193
- state: React.Dispatch<React.SetStateAction<string>>;
276
+ setState: React.Dispatch<React.SetStateAction<string>>;
277
+ state: string;
194
278
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
195
279
  onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
196
280
  onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
197
281
  }
198
282
 
199
- declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, state, value, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
283
+ declare const SCTextField: ({ title, iconTitle, infoTitle, label, placeholder, infoElement, iconInputStart, iconInputEnd, maxLength, variant, format, disabled, required, size, width, color, background, setState, state, onChange, onBlur, onKeyDown, }: SCTextFieldProps) => React__default.JSX.Element;
284
+
285
+ interface SCAutocompleteProps<T> {
286
+ label?: string;
287
+ data: T[];
288
+ columnGroup?: string;
289
+ getItemValue: (item: T) => {
290
+ icon?: any;
291
+ text: string;
292
+ value: string;
293
+ };
294
+ typeFormat?: "normal" | "multiselect";
295
+ checkMassive?: boolean;
296
+ deleteType?: "button" | "icon";
297
+ required?: boolean;
298
+ disabled?: boolean;
299
+ background?: string;
300
+ fnAplicar?: () => void | React__default.ReactNode;
301
+ setState: React__default.Dispatch<React__default.SetStateAction<any>>;
302
+ state: {
303
+ hiddenValue: string | string[];
304
+ textValue: string | string[];
305
+ };
306
+ inputChange?: (value: string) => void;
307
+ }
308
+ declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, typeFormat, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, inputChange, }: SCAutocompleteProps<T>): React__default.JSX.Element;
309
+
310
+ interface SCCalendarSwipeableProps {
311
+ background?: string;
312
+ setState: React__default.Dispatch<React__default.SetStateAction<string>>;
313
+ state: string | any;
314
+ }
315
+ declare const SCCalendarSwipeable: ({ background, setState, state, }: SCCalendarSwipeableProps) => React__default.JSX.Element;
316
+
317
+ interface SCDataGridInitialProps {
318
+ data: any;
319
+ columns: any;
320
+ groupColumns?: any;
321
+ rowsTable?: number;
322
+ checkboxSelection?: boolean;
323
+ width?: string | number;
324
+ maxHeight?: number;
325
+ density?: "compact" | "standard" | "comfortable";
326
+ }
327
+ declare const SCDataGridInitial: ({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps) => React__default.JSX.Element;
328
+ declare const SCDataGrid: React__default.MemoExoticComponent<({ data, columns, groupColumns, rowsTable, checkboxSelection, width, maxHeight, density }: SCDataGridInitialProps) => React__default.JSX.Element>;
329
+
330
+ type EmptyStateStates = 'create' | 'error' | 'noResult' | 'search';
331
+ type EmptyStateSize = 'small' | 'large';
332
+ interface EmptyStateProperties {
333
+ icon?: ReactNode;
334
+ state?: EmptyStateStates;
335
+ size?: EmptyStateSize;
336
+ title: string;
337
+ subtitle?: string;
338
+ actions?: {
339
+ icon?: string;
340
+ text?: string;
341
+ color?: ReplyPalette$1;
342
+ variant?: 'text' | 'outlined' | 'contained';
343
+ iconPosition?: 'left' | 'right';
344
+ size?: "small" | "medium" | "large";
345
+ onClick?: () => void;
346
+ }[];
347
+ containerHeight?: string;
348
+ }
349
+ declare const EmptyState: ({ state, size, title, subtitle, actions, containerHeight, icon, }: EmptyStateProperties) => React__default.JSX.Element;
350
+
351
+ interface SCDateRangeProps {
352
+ labelDateInitial?: string;
353
+ labelDateFinal?: string;
354
+ required?: boolean;
355
+ disabled?: boolean;
356
+ background?: string;
357
+ state: [Dayjs | null, Dayjs | null];
358
+ setState: React__default.Dispatch<React__default.SetStateAction<[Dayjs | null, Dayjs | null]>>;
359
+ }
360
+ declare const SCDateRange: ({ labelDateInitial, labelDateFinal, required, disabled, background, state, setState, }: SCDateRangeProps) => React__default.JSX.Element;
200
361
 
201
362
  type ReplyPalette = "primary" | "secondary" | "warning" | "info" | "success" | "error" | "inherit";
202
363
 
@@ -228,8 +389,6 @@ interface SCDialogProps {
228
389
  }
229
390
  declare const SCDialog: ({ title, iconTitle, subtitle, content, actions, buttonDialog, disableClose, dividers, widthContent, heightContent, background, setShow, show }: SCDialogProps) => React__default.JSX.Element;
230
391
 
231
- /***************************************************************************/
232
-
233
392
  interface Option$1 {
234
393
  name?: string;
235
394
  iconLeft?: any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType | null;
@@ -248,8 +407,30 @@ interface SCMenuProps {
248
407
  }
249
408
  declare const SCMenu: ({ header, options, defaultOption, disable, widthMenu, heightMenu, widthPage }: SCMenuProps) => React__default.JSX.Element;
250
409
 
251
- /***************************************************************************/
252
-
410
+ interface SCSelectProps<T> {
411
+ label?: string;
412
+ data: T[];
413
+ getItemValue: (item: T) => {
414
+ icon?: any;
415
+ text: string;
416
+ value: string;
417
+ };
418
+ width?: string;
419
+ size?: "small" | "medium";
420
+ variant?: "outlined" | "filled" | "standard";
421
+ deleteType?: "button" | "icon";
422
+ required?: boolean;
423
+ disabled?: boolean;
424
+ background?: string;
425
+ fnAplicar?: () => void | React__default.ReactNode;
426
+ setState: React__default.Dispatch<React__default.SetStateAction<any>>;
427
+ state: {
428
+ hiddenValue: string | string[];
429
+ textValue: string | string[];
430
+ };
431
+ }
432
+ declare function SCSelect<T>({ label, data, getItemValue, width, size, variant, deleteType, required, disabled, background, fnAplicar, setState, state, }: SCSelectProps<T>): React__default.JSX.Element;
433
+
253
434
  interface Option {
254
435
  name?: string;
255
436
  iconOrBadge: string | number | null | undefined | any | React__default.ReactNode | React__default.ReactElement | React__default.ElementType;
@@ -270,123 +451,8 @@ interface SCTabsProps {
270
451
  }
271
452
  declare const SCTabs: ({ options, defaultOption, typeIcon, background, iconPosition, colorTab, orientation, variant, scrollButtons, children }: SCTabsProps) => React__default.JSX.Element;
272
453
 
273
- interface FooterActionsProperties {
274
- label?: React.ReactNode;
275
- leftContent?: React.ReactNode;
276
- rightContent?: React.ReactNode;
277
- variant?: 'standard' | 'float';
278
- }
279
-
280
- declare const FooterAction: ({ leftContent, rightContent, label, variant, }: FooterActionsProperties) => React__default.JSX.Element;
281
-
282
- declare const modalStateConfig: {
283
- info: {
284
- color: string;
285
- defaultDescription: string;
286
- icon: React__default.JSX.Element;
287
- };
288
- delete: {
289
- color: string;
290
- defaultDescription: string;
291
- icon: React__default.JSX.Element;
292
- };
293
- warning: {
294
- color: string;
295
- defaultDescription: string;
296
- icon: React__default.JSX.Element;
297
- };
298
- };
299
-
300
- type ModalStates = 'info' | 'delete' | 'warning';
301
- interface ModalProps {
302
- title: string;
303
- description?: string;
304
- textButton?: string;
305
- buttonVariant?: RepplyButtonVariants;
306
- iconPosition?: 'left' | 'right';
307
- buttonColor?: ReplyPalette$1;
308
- state: ModalStates;
309
- open: boolean;
310
- action?: {
311
- text: string;
312
- fn: () => void;
313
- disabled?: boolean;
314
- }[];
315
- buttonModal?: {
316
- icon?: string;
317
- text?: string;
318
- color?: ReplyPalette$1;
319
- variant?: 'text' | 'outlined' | 'contained';
320
- iconPosition?: 'left' | 'right';
321
- size?: "small" | "medium" | "large";
322
- };
323
- }
324
-
325
- declare const getIconComponent: (iconName?: string) => React.ElementType;
326
- declare const getModalColor: (state: string) => string;
327
- declare const getButtonColor: (state: string) => 'inherit' | 'info' | 'error' | 'warning';
328
-
329
- declare const SCModal: ({ buttonModal, state, open, title, description, action, }: ModalProps) => React__default.JSX.Element;
330
-
331
- interface PageheaderProperties {
332
- title: string | React.ReactNode;
333
- subtitle?: string | React.ReactNode;
334
- actions?: React.ReactNode;
335
- buttonBack?: React.ReactNode;
336
- fixed?: boolean;
337
- shadow?: boolean;
338
- }
339
-
340
- declare const PageHeader: ({ title, subtitle, actions, buttonBack, fixed, shadow, }: PageheaderProperties) => React__default.JSX.Element;
341
-
342
- /***************************************************************************/
343
-
344
- interface SCCalendarSwipeableProps {
345
- background?: string;
346
- setState: React__default.Dispatch<React__default.SetStateAction<string>>;
347
- state: string | any;
348
- }
349
- declare const SCCalendarSwipeable: ({ background, setState, state, }: SCCalendarSwipeableProps) => React__default.JSX.Element;
350
-
351
- interface SCDataGridProps {
352
- data: any;
353
- columns: any;
354
- rowsTable?: number;
355
- checkboxSelection?: boolean;
356
- width?: string | number;
357
- maxHeight: number;
358
- density?: "compact" | "standard" | "comfortable";
359
- groupingColDef?: any;
360
- getTreeDataPath?: (row: any) => string[] | [];
361
- }
362
- declare const SCDataGrid: ({ data, columns, rowsTable, checkboxSelection, width, maxHeight, density, groupingColDef, getTreeDataPath, }: SCDataGridProps) => React__default.JSX.Element;
363
-
364
- interface SCAutocompleteProps<T> {
365
- label?: string;
366
- data: T[];
367
- columnGroup?: string;
368
- getItemValue: (item: T) => {
369
- icon?: any;
370
- text: string;
371
- value: string;
372
- };
373
- type?: "normal" | "multiselect";
374
- checkMassive?: boolean;
375
- deleteType?: "button" | "icon";
376
- required?: boolean;
377
- disabled?: boolean;
378
- background?: string;
379
- fnAplicar?: () => void | React__default.ReactNode;
380
- setState: React__default.Dispatch<React__default.SetStateAction<any>>;
381
- state: {
382
- hiddenValue: string | string[];
383
- textValue: string | string[];
384
- };
385
- }
386
- declare function SCAutocomplete<T>({ label, data, columnGroup, getItemValue, type, checkMassive, deleteType, fnAplicar, required, disabled, background, setState, state, }: SCAutocompleteProps<T>): React__default.JSX.Element;
387
-
388
454
  declare const SincoTheme: _mui_material_styles.Theme;
389
455
  declare let AdproSincoTheme: _mui_material_styles.Theme;
390
456
  declare let ADCSincoTheme: _mui_material_styles.Theme;
391
457
 
392
- export { ADCSincoTheme, AdproSincoTheme, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, type MultiSelectProps, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCAutocomplete, SCCalendarSwipeable, SCDataGrid, SCDialog, SCDrawer, SCMenu, SCModal, SCMultiSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, getButtonColor, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useFilteredItems, useMultiSelectHandlers, useProgress };
458
+ export { ADCSincoTheme, AdproSincoTheme, EmptyState, type EmptyStateProperties, type EmptyStateSize, type EmptyStateStates, FooterAction, type FooterActionsProperties, type ModalProps, type ModalStates, MultiSelect, type MultiSelectProps, PageHeader, type PageheaderProperties, type ReplyPalette$1 as ReplyPalette, type ReplyTextPalette, type ReplyVariants, type RepplyButtonVariants, SCAutocomplete, SCCalendarSwipeable, SCDataGrid, SCDataGridInitial, SCDateRange, SCDialog, SCDrawer, SCMenu, SCModal, SCSelect, SCTabs, SCTextArea, type SCTextAreaProps, SCTextField, type SCTextFieldProps, SCToastNotification, SincoTheme, type ToastBaseProperties, ToastProgress, type ToastType, capitalize, getButtonColor, getIcon, getIconComponent, getIconMultiSelect, getModalColor, modalStateConfig, useFilteredItems, useMultiSelectHandlers, useProgress };