@m4l/components 9.3.41-JT04122025.beta.3 → 9.3.43-BE20251205-beta.1

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.
Files changed (105) hide show
  1. package/components/DataGrid/DataGrid.js +1 -7
  2. package/components/DataGrid/contexts/DataGridContext/index.js +275 -56
  3. package/components/DataGrid/contexts/DataGridContext/types.d.ts +23 -24
  4. package/components/DataGrid/index.d.ts +4 -5
  5. package/components/DataGrid/types.d.ts +6 -30
  6. package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +138 -128
  7. package/hooks/useDataGridPersistence/constants.d.ts +0 -2
  8. package/hooks/useDataGridPersistence/constants.js +2 -6
  9. package/hooks/useDataGridPersistence/helpers.d.ts +1 -5
  10. package/hooks/useDataGridPersistence/helpers.js +1 -8
  11. package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts +3 -11
  12. package/hooks/useDataGridPersistence/useDataGridPersistence.js +7 -17
  13. package/package.json +1 -1
  14. package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.d.ts +0 -19
  15. package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.js +0 -6
  16. package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.test.d.ts +0 -1
  17. package/components/DataGrid/helpers/getAllViewModes/index.d.ts +0 -1
  18. package/components/DataGrid/helpers/getAllViewModes/index.js +0 -1
  19. package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.d.ts +0 -47
  20. package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.js +0 -32
  21. package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.test.d.ts +0 -1
  22. package/components/DataGrid/helpers/getColumnsWidth/index.d.ts +0 -1
  23. package/components/DataGrid/helpers/getColumnsWidth/index.js +0 -1
  24. package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.d.ts +0 -24
  25. package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.js +0 -12
  26. package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.test.d.ts +0 -1
  27. package/components/DataGrid/helpers/getIndexRowHeightVariant/index.d.ts +0 -1
  28. package/components/DataGrid/helpers/getIndexRowHeightVariant/index.js +0 -1
  29. package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +0 -48
  30. package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.js +0 -35
  31. package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.test.d.ts +0 -1
  32. package/components/DataGrid/helpers/getInitialColumnsConfig/index.d.ts +0 -1
  33. package/components/DataGrid/helpers/getInitialColumnsConfig/index.js +0 -1
  34. package/components/DataGrid/helpers/getViewMode/getViewMode.d.ts +0 -41
  35. package/components/DataGrid/helpers/getViewMode/getViewMode.js +0 -19
  36. package/components/DataGrid/helpers/getViewMode/getViewMode.test.d.ts +0 -1
  37. package/components/DataGrid/helpers/getViewMode/index.d.ts +0 -1
  38. package/components/DataGrid/helpers/getViewMode/index.js +0 -1
  39. package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.d.ts +0 -28
  40. package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.js +0 -22
  41. package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.test.d.ts +0 -1
  42. package/components/DataGrid/helpers/getViewSpecificConfig/index.d.ts +0 -1
  43. package/components/DataGrid/helpers/getViewSpecificConfig/index.js +0 -1
  44. package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.d.ts +0 -24
  45. package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.js +0 -9
  46. package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.test.d.ts +0 -1
  47. package/components/DataGrid/helpers/getViewSuffix/index.d.ts +0 -1
  48. package/components/DataGrid/helpers/getViewSuffix/index.js +0 -1
  49. package/components/DataGrid/helpers/index.d.ts +0 -13
  50. package/components/DataGrid/helpers/index.js +0 -1
  51. package/components/DataGrid/helpers/loadViewConfig/index.d.ts +0 -1
  52. package/components/DataGrid/helpers/loadViewConfig/index.js +0 -1
  53. package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.d.ts +0 -23
  54. package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.js +0 -12
  55. package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.test.d.ts +0 -1
  56. package/components/DataGrid/helpers/saveColumnsWidth/index.d.ts +0 -1
  57. package/components/DataGrid/helpers/saveColumnsWidth/index.js +0 -1
  58. package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.d.ts +0 -52
  59. package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.js +0 -18
  60. package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.test.d.ts +0 -1
  61. package/components/DataGrid/helpers/saveViewConfig/index.d.ts +0 -1
  62. package/components/DataGrid/helpers/saveViewConfig/index.js +0 -1
  63. package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.d.ts +0 -35
  64. package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.js +0 -15
  65. package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.test.d.ts +0 -1
  66. package/components/DataGrid/helpers/saveViewMode/index.d.ts +0 -1
  67. package/components/DataGrid/helpers/saveViewMode/index.js +0 -1
  68. package/components/DataGrid/helpers/saveViewMode/saveViewMode.d.ts +0 -33
  69. package/components/DataGrid/helpers/saveViewMode/saveViewMode.js +0 -13
  70. package/components/DataGrid/helpers/saveViewMode/saveViewMode.test.d.ts +0 -1
  71. package/components/DataGrid/hooks/index.d.ts +0 -6
  72. package/components/DataGrid/hooks/index.js +0 -1
  73. package/components/DataGrid/hooks/useChangeColumnsConfig/index.d.ts +0 -1
  74. package/components/DataGrid/hooks/useChangeColumnsConfig/index.js +0 -1
  75. package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +0 -9
  76. package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.js +0 -27
  77. package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.test.d.ts +0 -1
  78. package/components/DataGrid/hooks/useChangeColumnsOrder/index.d.ts +0 -1
  79. package/components/DataGrid/hooks/useChangeColumnsOrder/index.js +0 -1
  80. package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.d.ts +0 -10
  81. package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.js +0 -34
  82. package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.test.d.ts +0 -1
  83. package/components/DataGrid/hooks/useColumnsWidth/index.d.ts +0 -1
  84. package/components/DataGrid/hooks/useColumnsWidth/index.js +0 -1
  85. package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.d.ts +0 -11
  86. package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.js +0 -29
  87. package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.test.d.ts +0 -1
  88. package/components/DataGrid/hooks/useRowHeight/index.d.ts +0 -1
  89. package/components/DataGrid/hooks/useRowHeight/index.js +0 -1
  90. package/components/DataGrid/hooks/useRowHeight/useRowHeight.d.ts +0 -28
  91. package/components/DataGrid/hooks/useRowHeight/useRowHeight.js +0 -51
  92. package/components/DataGrid/hooks/useRowHeight/useRowHeight.test.d.ts +0 -1
  93. package/components/DataGrid/hooks/useViewConfig/index.d.ts +0 -1
  94. package/components/DataGrid/hooks/useViewConfig/index.js +0 -1
  95. package/components/DataGrid/hooks/useViewConfig/useViewConfig.d.ts +0 -9
  96. package/components/DataGrid/hooks/useViewConfig/useViewConfig.js +0 -30
  97. package/components/DataGrid/hooks/useViewConfig/useViewConfig.test.d.ts +0 -1
  98. package/components/DataGrid/hooks/useViewMode/index.d.ts +0 -1
  99. package/components/DataGrid/hooks/useViewMode/index.js +0 -1
  100. package/components/DataGrid/hooks/useViewMode/useViewMode.d.ts +0 -31
  101. package/components/DataGrid/hooks/useViewMode/useViewMode.js +0 -44
  102. package/components/DataGrid/hooks/useViewMode/useViewMode.test.d.ts +0 -1
  103. package/components/DataGrid/types.helpers.d.ts +0 -55
  104. package/components/DataGrid/types.helpers.js +0 -1
  105. package/components/DataGrid/types.hooks.d.ts +0 -81
@@ -20,7 +20,7 @@ const dateTimePickerStyles = {
20
20
  "& .MuiInputBase-root": {
21
21
  height: "100%",
22
22
  padding: 0,
23
- borderRadius: theme.vars.size.borderRadius.r1,
23
+ borderRadius: theme.vars.size.borderRadius.r2,
24
24
  paddingLeft: theme.vars.size.baseSpacings.sp1,
25
25
  "& input": {
26
26
  padding: 0,
@@ -61,7 +61,7 @@ const dateTimePickerStyles = {
61
61
  border: 0,
62
62
  borderBottom: theme.vars.size.borderStroke.actionInput
63
63
  },
64
- borderColor: ownerState?.error ? theme.vars.palette.error.hover : ownerState?.disabled ? `${theme.vars.palette.border.secondary}` : theme.vars.palette.border.default,
64
+ borderColor: ownerState?.error ? theme.vars.palette.error.hover : theme.vars.palette.border.secondary,
65
65
  borderRadius: theme.vars.size.borderRadius.r1,
66
66
  borderWidth: 1
67
67
  },
@@ -111,7 +111,7 @@ const dateTimePickerStyles = {
111
111
  "& .MuiInputBase-root": {
112
112
  height: "100%",
113
113
  padding: 0,
114
- borderRadius: theme.vars.size.borderRadius.r1,
114
+ borderRadius: theme.vars.size.borderRadius.r2,
115
115
  paddingLeft: theme.vars.size.baseSpacings.sp1,
116
116
  "& input": {
117
117
  padding: 0,
@@ -164,93 +164,140 @@ const dateTimePickerStyles = {
164
164
  * Estilos para el popper de Material UI
165
165
  */
166
166
  popper: ({ theme, ownerState }) => ({
167
- zIndex: theme.vars.zIndex.modal,
168
- "& .MuiDivider-root": {
169
- borderColor: theme.vars.palette.border.secondary
170
- },
171
- // Estilos globales del MuiPickersLayout-root 🌎
172
- "& .MuiPaper-root": {
173
- boxShadow: theme.vars.customShadows.z4,
174
- paddingTop: theme.vars.size.baseSpacings.sp3,
175
- borderRadius: theme.vars.size.borderRadius.r1
176
- },
177
- // Estilos globales del MuiPickersLayout-root 🌎
178
- "& .MuiPickersLayout-root": {
179
- gap: `0px 0px ${theme.vars.size.baseSpacings.sp1} 0px`,
180
- "& .MuiPickersLayout-contentWrapper": {
181
- // ↴ Overrides ❌
182
- // paddingLeft: theme.vars.size.baseSpacings.sp3,
183
- // paddingRight: theme.vars.size.baseSpacings.sp3,
184
- // Estilos específicos para el primer div hijo directo
185
- "& > div:first-of-type": {
186
- height: "265px"
167
+ "&&&": {
168
+ zIndex: theme.vars.zIndex.modal,
169
+ marginTop: `${theme.vars.size.baseSpacings.sp2} !important`,
170
+ "& .MuiPickersDay-root.Mui-selected": {
171
+ backgroundColor: theme.vars.palette.primary.enabled
172
+ },
173
+ "& .MuiMultiSectionDigitalClockSection-item": {
174
+ borderRadius: theme.vars.size.borderRadius.r1
175
+ },
176
+ "& .MuiDivider-root": {
177
+ borderColor: theme.vars.palette.border.secondary
178
+ },
179
+ // Estilos globales del MuiPickersLayout-root 🌎
180
+ "& .MuiPaper-root": {
181
+ paddingTop: theme.vars.size.baseSpacings.sp3,
182
+ borderRadius: theme.vars.size.borderRadius.r2,
183
+ backgroundColor: theme.vars.palette.background.default,
184
+ boxShadow: theme.vars.customShadows.z4
185
+ },
186
+ // Estilos globales del MuiPickersLayout-root 🌎
187
+ "& .MuiPickersLayout-root": {
188
+ gap: `0px 0px ${theme.vars.size.baseSpacings.sp1} 0px`,
189
+ "& .MuiPickersLayout-contentWrapper": {
190
+ // ↴ Overrides ❌
191
+ // paddingLeft: theme.vars.size.baseSpacings.sp3,
192
+ // paddingRight: theme.vars.size.baseSpacings.sp3,
193
+ // Estilos específicos para el primer div hijo directo
194
+ "& > div:first-of-type": {
195
+ height: "265px"
196
+ }
187
197
  }
188
- }
189
- },
190
- // Estilos globales del MuiDateCalendar-root 🌎
191
- "& .MuiDateCalendar-root": {
192
- display: "flex",
193
- width: "fit-content",
194
- position: "relative",
195
- top: -1,
196
- gap: theme.vars.size.baseSpacings.sp3,
197
- padding: theme.vars.size.baseSpacings.sp1,
198
- // Overrides ❌
199
- "& .MuiYearCalendar-root": {
200
- // Fix en el height
201
- height: "218px",
202
- "& .MuiPickersYear-root": {
203
- "& .MuiPickersYear-yearButton": {
204
- width: "fit-content",
205
- padding: `0px ${theme.vars.size.baseSpacings.sp3}`,
206
- borderRadius: theme.vars.size.borderRadius.r1,
207
- "&:hover": {
208
- background: theme.vars.palette.default.hoverOpacity
209
- },
210
- "&:active": {
211
- background: theme.vars.palette.default.active
212
- },
213
- "&.Mui-selected": {
214
- background: theme.vars.palette.primary.enabled,
198
+ },
199
+ // Estilos globales del MuiDateCalendar-root 🌎
200
+ "& .MuiDateCalendar-root": {
201
+ display: "flex",
202
+ width: "fit-content",
203
+ position: "relative",
204
+ top: -1,
205
+ gap: theme.vars.size.baseSpacings.sp3,
206
+ padding: theme.vars.size.baseSpacings.sp1,
207
+ // ↴ Overrides ❌
208
+ "& .MuiYearCalendar-root": {
209
+ // Fix en el height
210
+ height: "218px",
211
+ "& .MuiPickersYear-root": {
212
+ "& .MuiPickersYear-yearButton": {
213
+ width: "fit-content",
214
+ padding: `0px ${theme.vars.size.baseSpacings.sp3}`,
215
+ borderRadius: theme.vars.size.borderRadius.r1,
215
216
  "&:hover": {
216
- background: theme.vars.palette.primary.hover
217
+ background: theme.vars.palette.default.hoverOpacity
217
218
  },
218
219
  "&:active": {
219
- background: theme.vars.palette.primary.active
220
- }
221
- },
222
- ...getHeightSizeStyles(
223
- theme.generalSettings.isMobile,
224
- ownerState?.size || "small",
225
- "action",
226
- (height) => ({
227
- minHeight: height,
228
- height,
229
- maxHeight: height
230
- })
231
- ),
232
- ...getTypographyStyles(
233
- theme.generalSettings.isMobile,
234
- ownerState?.size || "medium",
235
- "body"
236
- )
220
+ background: theme.vars.palette.default.active
221
+ },
222
+ "&.Mui-selected": {
223
+ background: theme.vars.palette.primary.enabled,
224
+ "&:hover": {
225
+ background: theme.vars.palette.primary.hover
226
+ },
227
+ "&:active": {
228
+ background: theme.vars.palette.primary.active
229
+ }
230
+ },
231
+ ...getHeightSizeStyles(
232
+ theme.generalSettings.isMobile,
233
+ ownerState?.size || "small",
234
+ "action",
235
+ (height) => ({
236
+ minHeight: height,
237
+ height,
238
+ maxHeight: height
239
+ })
240
+ ),
241
+ ...getTypographyStyles(
242
+ theme.generalSettings.isMobile,
243
+ ownerState?.size || "medium",
244
+ "body"
245
+ )
246
+ }
247
+ }
248
+ },
249
+ // ↴ Overrides ❌
250
+ "& .MuiDayCalendar-root": {
251
+ width: "fit-content",
252
+ padding: theme.vars.size.baseSpacings.sp2,
253
+ "& .MuiDayCalendar-header": {
254
+ display: "flex",
255
+ gap: theme.vars.size.baseSpacings.sp1,
256
+ "& .MuiTypography-root": {
257
+ margin: 0,
258
+ ...getTypographyStyles(
259
+ theme.generalSettings.isMobile,
260
+ ownerState?.size || "medium",
261
+ "body"
262
+ ),
263
+ ...getHeightSizeStyles(
264
+ theme.generalSettings.isMobile,
265
+ ownerState?.size || "small",
266
+ "action",
267
+ (height) => ({
268
+ minHeight: height,
269
+ height,
270
+ maxHeight: height,
271
+ minWidth: height,
272
+ width: height,
273
+ maxWidth: height
274
+ })
275
+ )
276
+ }
277
+ },
278
+ "& .MuiDayCalendar-weekContainer": {
279
+ display: "flex",
280
+ margin: 0,
281
+ paddingTop: theme.vars.size.baseSpacings.sp1,
282
+ gap: theme.vars.size.baseSpacings.sp1
237
283
  }
238
284
  }
239
285
  },
240
- // Overrides
241
- "& .MuiDayCalendar-root": {
242
- width: "fit-content",
243
- padding: theme.vars.size.baseSpacings.sp2,
244
- "& .MuiDayCalendar-header": {
286
+ // Estilos globales del MuiMultiSectionDigitalClock-root 🌎
287
+ "& .MuiMultiSectionDigitalClock-root": {
288
+ padding: theme.vars.size.baseSpacings.sp1,
289
+ // ↴ Overrides ❌
290
+ "& .MuiList-root": {
245
291
  display: "flex",
246
- gap: theme.vars.size.baseSpacings.sp1,
247
- "& .MuiTypography-root": {
292
+ width: "fit-content",
293
+ flexDirection: "column",
294
+ overflow: "overlay",
295
+ borderColor: theme.vars.palette.border.secondary,
296
+ paddingRight: theme.vars.size.baseSpacings.sp2,
297
+ paddingLeft: theme.vars.size.baseSpacings.sp2,
298
+ gap: theme.vars.size.baseSpacings.sp2,
299
+ "& .MuiButtonBase-root": {
248
300
  margin: 0,
249
- ...getTypographyStyles(
250
- theme.generalSettings.isMobile,
251
- ownerState?.size || "medium",
252
- "body"
253
- ),
254
301
  ...getHeightSizeStyles(
255
302
  theme.generalSettings.isMobile,
256
303
  ownerState?.size || "small",
@@ -263,30 +310,19 @@ const dateTimePickerStyles = {
263
310
  width: height,
264
311
  maxWidth: height
265
312
  })
313
+ ),
314
+ ...getTypographyStyles(
315
+ theme.generalSettings.isMobile,
316
+ ownerState?.size || "medium",
317
+ "body"
266
318
  )
267
319
  }
268
- },
269
- "& .MuiDayCalendar-weekContainer": {
270
- display: "flex",
271
- margin: 0,
272
- paddingTop: theme.vars.size.baseSpacings.sp1,
273
- gap: theme.vars.size.baseSpacings.sp1
274
320
  }
275
- }
276
- },
277
- // Estilos globales del MuiMultiSectionDigitalClock-root 🌎
278
- "& .MuiMultiSectionDigitalClock-root": {
279
- padding: theme.vars.size.baseSpacings.sp1,
280
- // ↴ Overrides ❌
281
- "& .MuiList-root": {
282
- display: "flex",
283
- width: "fit-content",
284
- flexDirection: "column",
285
- overflow: "overlay",
286
- borderColor: theme.vars.palette.border.secondary,
287
- paddingRight: theme.vars.size.baseSpacings.sp2,
288
- paddingLeft: theme.vars.size.baseSpacings.sp2,
289
- gap: theme.vars.size.baseSpacings.sp2,
321
+ },
322
+ // Estilos globales del MuiDialogActions-root 🌎
323
+ "& .MuiDialogActions-root": {
324
+ paddingRight: theme.vars.size.baseSpacings.sp3,
325
+ // ↴ Overrides ❌
290
326
  "& .MuiButtonBase-root": {
291
327
  margin: 0,
292
328
  ...getHeightSizeStyles(
@@ -309,32 +345,6 @@ const dateTimePickerStyles = {
309
345
  )
310
346
  }
311
347
  }
312
- },
313
- // Estilos globales del MuiDialogActions-root 🌎
314
- "& .MuiDialogActions-root": {
315
- paddingRight: theme.vars.size.baseSpacings.sp3,
316
- // ↴ Overrides ❌
317
- "& .MuiButtonBase-root": {
318
- margin: 0,
319
- ...getHeightSizeStyles(
320
- theme.generalSettings.isMobile,
321
- ownerState?.size || "small",
322
- "action",
323
- (height) => ({
324
- minHeight: height,
325
- height,
326
- maxHeight: height,
327
- minWidth: height,
328
- width: height,
329
- maxWidth: height
330
- })
331
- ),
332
- ...getTypographyStyles(
333
- theme.generalSettings.isMobile,
334
- ownerState?.size || "medium",
335
- "body"
336
- )
337
- }
338
348
  }
339
349
  }),
340
350
  /**
@@ -1,5 +1,3 @@
1
1
  export declare const M4LDYNAMIC_KEY_FILTER_AND_SORT = "M4LDynamicFilterAndSort";
2
2
  export declare const COOKIE_COLUMNS_WIDTHS = "columns_widths";
3
3
  export declare const COOKIE_COLUMNS_CONFIG = "columns_config";
4
- export declare const COOKIE_COLUMNS_CONFIG_CARDS = "columns_config_cards";
5
- export declare const COOKIE_VIEW_MODE = "view_mode";
@@ -1,10 +1,6 @@
1
1
  const COOKIE_COLUMNS_WIDTHS = "columns_widths";
2
2
  const COOKIE_COLUMNS_CONFIG = "columns_config";
3
- const COOKIE_COLUMNS_CONFIG_CARDS = "columns_config_cards";
4
- const COOKIE_VIEW_MODE = "view_mode";
5
3
  export {
6
- COOKIE_VIEW_MODE as C,
7
- COOKIE_COLUMNS_CONFIG_CARDS as a,
8
- COOKIE_COLUMNS_CONFIG as b,
9
- COOKIE_COLUMNS_WIDTHS as c
4
+ COOKIE_COLUMNS_CONFIG as C,
5
+ COOKIE_COLUMNS_WIDTHS as a
10
6
  };
@@ -1,9 +1,5 @@
1
1
  import { IGridConfigExtended } from '../../components/DataGrid';
2
2
  /**
3
- * Obtiene la configuración de columnas de tabla desde la cookie
3
+ * Obtiene el sort de la cookie
4
4
  */
5
5
  export declare const getColumnsConfigCookie: (cookie: Record<string, any> | undefined | Array<any>) => IGridConfigExtended["columnsConfig"];
6
- /**
7
- * Obtiene la configuración de columnas de cards desde la cookie
8
- */
9
- export declare const getColumnsConfigCardsCookie: (cookie: Record<string, any> | undefined | Array<any>) => IGridConfigExtended["columnsConfigCards"];
@@ -4,13 +4,6 @@ const getColumnsConfigCookie = (cookie) => {
4
4
  }
5
5
  return [];
6
6
  };
7
- const getColumnsConfigCardsCookie = (cookie) => {
8
- if (Array.isArray(cookie)) {
9
- return cookie;
10
- }
11
- return [];
12
- };
13
7
  export {
14
- getColumnsConfigCookie as a,
15
- getColumnsConfigCardsCookie as g
8
+ getColumnsConfigCookie as g
16
9
  };
@@ -1,17 +1,9 @@
1
1
  import { UseDataGridPersistenceProps } from './types';
2
- import { ChangeConfig, IGridConfigExtended } from '../../components/DataGrid';
2
+ import { ChangeUserColumn, IGridConfigExtended } from '../../components/DataGrid';
3
3
  /**
4
- * Hook para manejar la persistencia de configuración del DataGrid en cookies de red.
5
- *
6
- * Retorna:
7
- * - `defaultConfig`: Configuración inicial cargada desde cookies
8
- * - `onChangeConfig`: Callback para persistir cambios en cookies
9
- * - `defaultUserColumns`: @deprecated Alias de defaultConfig
10
- * - `onChangeUserColumns`: @deprecated Alias de onChangeConfig
4
+ * Hook para manejar los filtros y ordenamientos dinamicos
11
5
  */
12
6
  export declare const useDataGridPersistence: (props: UseDataGridPersistenceProps) => {
13
- defaultConfig: IGridConfigExtended;
14
- onChangeConfig: (newProps: ChangeConfig) => void;
7
+ onChangeUserColumns: (newProps: ChangeUserColumn) => void;
15
8
  defaultUserColumns: IGridConfigExtended;
16
- onChangeUserColumns: (newProps: ChangeConfig) => void;
17
9
  };
@@ -1,42 +1,32 @@
1
1
  import { useState, useCallback } from "react";
2
- import { g as getColumnsConfigCardsCookie, a as getColumnsConfigCookie } from "./helpers.js";
3
- import { C as COOKIE_VIEW_MODE, a as COOKIE_COLUMNS_CONFIG_CARDS, b as COOKIE_COLUMNS_CONFIG, c as COOKIE_COLUMNS_WIDTHS } from "./constants.js";
2
+ import { g as getColumnsConfigCookie } from "./helpers.js";
3
+ import { C as COOKIE_COLUMNS_CONFIG, a as COOKIE_COLUMNS_WIDTHS } from "./constants.js";
4
4
  import { u as useWindowToolsMF } from "../../components/WindowBase/hooks/useWindowToolsMF/index.js";
5
5
  const useDataGridPersistence = (props) => {
6
6
  const { prefixCookie } = props;
7
7
  const { setCookie, getCookie } = useWindowToolsMF();
8
- const [defaultConfig] = useState(() => {
8
+ const [defaultUserColumns] = useState(() => {
9
9
  return {
10
10
  columnsWidths: getCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_WIDTHS}` : COOKIE_COLUMNS_WIDTHS) || {},
11
- columnsConfig: getColumnsConfigCookie(getCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG}` : COOKIE_COLUMNS_CONFIG)) || [],
12
- columnsConfigCards: getColumnsConfigCardsCookie(getCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG_CARDS}` : COOKIE_COLUMNS_CONFIG_CARDS)) || [],
13
- viewMode: getCookie(prefixCookie ? `${prefixCookie}_${COOKIE_VIEW_MODE}` : COOKIE_VIEW_MODE) || "table"
11
+ columnsConfig: getColumnsConfigCookie(getCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG}` : COOKIE_COLUMNS_CONFIG)) || []
14
12
  };
15
13
  });
16
- const onChangeConfig = useCallback((newProps) => {
14
+ const onChangeUserColumns = useCallback((newProps) => {
17
15
  const { reason, userConfig } = newProps;
18
16
  if (userConfig === void 0) {
19
17
  return;
20
18
  }
21
19
  if (reason === "columnsConfig") {
22
20
  setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG}` : COOKIE_COLUMNS_CONFIG, "window", userConfig);
23
- } else if (reason === "columnsConfigCards") {
24
- setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_CONFIG_CARDS}` : COOKIE_COLUMNS_CONFIG_CARDS, "window", userConfig);
25
21
  } else if (reason === "columnsWidths") {
26
22
  setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_COLUMNS_WIDTHS}` : COOKIE_COLUMNS_WIDTHS, "window", userConfig);
27
- } else if (reason === "viewMode") {
28
- setCookie(prefixCookie ? `${prefixCookie}_${COOKIE_VIEW_MODE}` : COOKIE_VIEW_MODE, "window", userConfig);
29
23
  } else {
30
24
  setCookie(prefixCookie ? `${prefixCookie}_${reason}` : reason, "window", userConfig);
31
25
  }
32
26
  }, [setCookie, prefixCookie]);
33
27
  return {
34
- // Nuevos nombres
35
- defaultConfig,
36
- onChangeConfig,
37
- // Deprecated aliases para backward compatibility
38
- defaultUserColumns: defaultConfig,
39
- onChangeUserColumns: onChangeConfig
28
+ onChangeUserColumns,
29
+ defaultUserColumns
40
30
  };
41
31
  };
42
32
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.3.41-JT04122025.beta.3",
3
+ "version": "9.3.43-BE20251205-beta.1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "M4L Components",
6
6
  "lint-staged": {
@@ -1,19 +0,0 @@
1
- import { ViewMode } from '../../contexts/DataGridContext/types';
2
- /**
3
- * Obtiene todos los modos de vista disponibles en el DataGrid.
4
- *
5
- * ## Modos disponibles
6
- *
7
- * - `table`: Vista de tabla tradicional con filas y columnas
8
- * - `cards`: Vista de tarjetas para visualización compacta
9
- *
10
- * ## Uso
11
- *
12
- * Esta función centraliza los modos de vista disponibles,
13
- * facilitando la extensión futura si se agregan nuevos modos.
14
- * @returns Array con los modos de vista disponibles
15
- * @example
16
- * const modes = getAllViewModes();
17
- * // ['table', 'cards']
18
- */
19
- export declare const getAllViewModes: () => ViewMode[];
@@ -1,6 +0,0 @@
1
- const getAllViewModes = () => {
2
- return ["table", "cards"];
3
- };
4
- export {
5
- getAllViewModes as g
6
- };
@@ -1 +0,0 @@
1
- export { getAllViewModes } from './getAllViewModes';
@@ -1,47 +0,0 @@
1
- import { Column } from 'react-data-grid';
2
- import { Maybe } from '@m4l/core';
3
- import { RowKey } from '../../types';
4
- import { IGridConfig } from '../../types.helpers';
5
- /**
6
- * Obtiene la configuración de anchos de las columnas del DataGrid.
7
- *
8
- * ## Flujo de persistencia
9
- *
10
- * Esta función obtiene los anchos de columnas siguiendo una jerarquía de precedencia:
11
- *
12
- * 1. **defaultConfig** (Cookies de red) - Prioridad máxima
13
- * Configuración que viene de las cookies de red cuando el componente se monta.
14
- * En producción, esta es la fuente principal de datos persistidos.
15
- *
16
- * 2. **localStorage** - Fallback local
17
- * Solo se usa cuando NO hay configuración de cookies de red.
18
- * Útil para desarrollo o cuando no hay integración con cookies de red.
19
- *
20
- * Si no se encuentra configuración en ninguna fuente, la columna no se incluye
21
- * en el Map resultante y usará el ancho por defecto definido en la columna.
22
- *
23
- * ## Relación con saveColumnsWidth
24
- *
25
- * - Cuando el usuario modifica anchos, `saveColumnsWidth` envía los cambios
26
- * mediante el callback `onChangeConfig`
27
- * - En la siguiente carga, esos datos vuelven como `defaultConfig`
28
- * - localStorage es solo un fallback cuando no hay callback configurado
29
- * @template TRow - Tipo de datos de cada fila del DataGrid
30
- * @template TSummaryRow - Tipo de datos de la fila de resumen del DataGrid
31
- * @param id - Identificador único del DataGrid. Se usa como prefijo para la key en localStorage (fallback)
32
- * @param columns - Array de columnas del DataGrid con su configuración
33
- * @param defaultConfig - Configuración del usuario obtenida de cookies de red.
34
- * Esta es la fuente principal en producción.
35
- * @returns Map donde la key es el identificador de la columna (column.key) y el value
36
- * es el ancho configurado (número en píxeles o string con unidad CSS)
37
- * @example
38
- * // Sin configuración de cookies de red (usa localStorage como fallback)
39
- * const columnsWidths = getColumnsWidth('my-grid', columns, null);
40
- * @example
41
- * // Con configuración de cookies de red (caso típico en producción)
42
- * const columnsWidths = getColumnsWidth('my-grid', columns, {
43
- * columnsWidths: { name: 200, email: 300 }
44
- * });
45
- * @see saveColumnsWidth - Función complementaria para persistir la configuración
46
- */
47
- export declare function getColumnsWidth<TRow, TSummaryRow>(id: RowKey, columns: readonly Column<TRow, TSummaryRow>[], defaultConfig: Maybe<IGridConfig>): Map<string, Maybe<string | number>>;
@@ -1,32 +0,0 @@
1
- function getColumnsWidth(id, columns, defaultConfig) {
2
- const newMap = /* @__PURE__ */ new Map();
3
- let storeColumnsWidth;
4
- try {
5
- const item = window.localStorage.getItem(`${id}_columns_width`);
6
- storeColumnsWidth = item !== null ? new Map(JSON.parse(item)) : /* @__PURE__ */ new Map();
7
- } catch (_e) {
8
- storeColumnsWidth = /* @__PURE__ */ new Map();
9
- }
10
- for (let i = 0; i < columns.length; i++) {
11
- let width;
12
- if (defaultConfig) {
13
- try {
14
- width = defaultConfig.columnsWidths[columns[i].key];
15
- } catch (_e) {
16
- }
17
- }
18
- if (width === void 0) {
19
- const storeWidth = storeColumnsWidth.get(columns[i].key);
20
- if (typeof storeWidth === "number") {
21
- width = storeWidth;
22
- }
23
- }
24
- if (width !== void 0) {
25
- newMap.set(columns[i].key, width);
26
- }
27
- }
28
- return newMap;
29
- }
30
- export {
31
- getColumnsWidth as g
32
- };
@@ -1 +0,0 @@
1
- export { getColumnsWidth } from './getColumnsWidth';
@@ -1,24 +0,0 @@
1
- import { RowHeightVariants } from '../../types';
2
- /**
3
- * Obtiene el índice correspondiente a un variant de altura de fila.
4
- *
5
- * ## Propósito
6
- *
7
- * Mapea el nombre del variant ('compact', 'standard', 'confortable') a su
8
- * índice en los arrays de alturas (rowHeights y rowHeaderHeights).
9
- *
10
- * ## Mapeo de variants a índices
11
- *
12
- * | Variant | Índice |
13
- * |-------------|--------|
14
- * | compact | 0 |
15
- * | standard | 1 |
16
- * | confortable | 2 |
17
- * @param variant - Variant de altura de fila
18
- * @returns Índice correspondiente en los arrays de alturas (0, 1 o 2)
19
- * @example
20
- * getIndexRowHeightVariant('compact'); // 0
21
- * getIndexRowHeightVariant('standard'); // 1
22
- * getIndexRowHeightVariant('confortable'); // 2
23
- */
24
- export declare const getIndexRowHeightVariant: (variant: RowHeightVariants) => number;
@@ -1,12 +0,0 @@
1
- const getIndexRowHeightVariant = (variant) => {
2
- if (variant === "compact") {
3
- return 0;
4
- }
5
- if (variant === "standard") {
6
- return 1;
7
- }
8
- return 2;
9
- };
10
- export {
11
- getIndexRowHeightVariant as g
12
- };
@@ -1 +0,0 @@
1
- export { getIndexRowHeightVariant } from './getIndexRowHeightVariant';