@m4l/components 9.4.53-beta-hotfix-706-m4lcom-icons-version-latest.0 → 9.5.0

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 (47) hide show
  1. package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
  2. package/components/datagrids/contexts/DataGridContext/DataGridContext.js +134 -133
  3. package/components/datagrids/helpers/index.d.ts +0 -1
  4. package/components/datagrids/helpers/index.d.ts.map +1 -1
  5. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts +3 -5
  6. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts.map +1 -1
  7. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.js +9 -20
  8. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts +20 -25
  9. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts.map +1 -1
  10. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.js +4 -10
  11. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts +4 -9
  12. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts.map +1 -1
  13. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.js +8 -13
  14. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts +13 -18
  15. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts.map +1 -1
  16. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.js +8 -11
  17. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts +14 -17
  18. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts.map +1 -1
  19. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.js +6 -10
  20. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +18 -19
  21. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts.map +1 -1
  22. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.js +11 -16
  23. package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.d.ts +11 -11
  24. package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +5 -4
  25. package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts.map +1 -1
  26. package/components/datagrids/hooks/useColumnsWidth/types.d.ts +2 -0
  27. package/components/datagrids/hooks/useColumnsWidth/types.d.ts.map +1 -1
  28. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts +1 -1
  29. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts.map +1 -1
  30. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.js +12 -11
  31. package/components/datagrids/hooks/useViewMode/useViewMode.d.ts +13 -13
  32. package/components/datagrids/hooks/useViewMode/useViewMode.d.ts.map +1 -1
  33. package/components/datagrids/types.d.ts +2 -2
  34. package/hooks/useDataGridPersistence/constants.d.ts +1 -0
  35. package/hooks/useDataGridPersistence/constants.d.ts.map +1 -1
  36. package/hooks/useDataGridPersistence/constants.js +5 -4
  37. package/hooks/useDataGridPersistence/helpers.d.ts +4 -0
  38. package/hooks/useDataGridPersistence/helpers.d.ts.map +1 -1
  39. package/hooks/useDataGridPersistence/helpers.js +3 -2
  40. package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts.map +1 -1
  41. package/hooks/useDataGridPersistence/useDataGridPersistence.js +33 -27
  42. package/package.json +5 -5
  43. package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts +0 -2
  44. package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts.map +0 -1
  45. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts +0 -24
  46. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts.map +0 -1
  47. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.js +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridContext.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/contexts/DataGridContext/DataGridContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EAGtB,MAAM,SAAS,CAAC;AAgCjB,QAAA,MAAM,eAAe,qEAIN,CAAC;AAEhB;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAgiBtD;AAED,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"DataGridContext.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/contexts/DataGridContext/DataGridContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EAGtB,MAAM,SAAS,CAAC;AAgCjB,QAAA,MAAM,eAAe,qEAIN,CAAC;AAEhB;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAiiBtD;AAED,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
@@ -1,85 +1,86 @@
1
- import { jsx as wo } from "@emotion/react/jsx-runtime";
2
- import { createContext as ho, useState as b, useEffect as x, useMemo as po } from "react";
3
- import { useFirstRender as yo } from "@m4l/graphics";
4
- import { getComponentClasses as Vo } from "../../../../utils/getComponentSlotRoot.js";
5
- import { DATAGRID_ROW_HEIGHTS as Ro, DATAGRID_ROW_HEADER_HEIGHTS as So, DATAGRID_PREFIX_NAME as vo } from "../../constants.js";
6
- import { ControlNavigateSlots as Ho, ColumnsConfigSlots as xo, TextEditorSlots as Do, TableSlots as Eo, RowsCountSlots as To, ActionsSlots as bo, DataGridSlots as ko } from "../../slots/DataGridEnum.js";
7
- import { deepEqual as Go } from "fast-equals";
8
- import { useViewMode as Ko } from "../../hooks/useViewMode/useViewMode.js";
9
- import { useRowHeight as Io } from "../../hooks/useRowHeight/useRowHeight.js";
10
- import { useColumnsWidth as Fo } from "../../hooks/useColumnsWidth/useColumnsWidth.js";
11
- import { useViewConfig as $o } from "../../hooks/useViewConfig/useViewConfig.js";
12
- import { useChangeColumnsConfig as Ao } from "../../hooks/useChangeColumnsConfig/useChangeColumnsConfig.js";
13
- import { useChangeColumnsOrder as Oo } from "../../hooks/useChangeColumnsOrder/useChangeColumnsOrder.js";
14
- import { getColumnsWidth as Wo } from "../../helpers/persistence/getColumnsWidth/getColumnsWidth.js";
15
- import { getViewMode as k } from "../../helpers/persistence/getViewMode/getViewMode.js";
1
+ import { jsx as ho } from "@emotion/react/jsx-runtime";
2
+ import { createContext as po, useState as b, useEffect as x, useMemo as yo } from "react";
3
+ import { useFirstRender as Vo } from "@m4l/graphics";
4
+ import { getComponentClasses as Ro } from "../../../../utils/getComponentSlotRoot.js";
5
+ import { DATAGRID_ROW_HEIGHTS as So, DATAGRID_ROW_HEADER_HEIGHTS as vo, DATAGRID_PREFIX_NAME as Ho } from "../../constants.js";
6
+ import { ControlNavigateSlots as xo, ColumnsConfigSlots as Do, TextEditorSlots as Eo, TableSlots as To, RowsCountSlots as bo, ActionsSlots as ko, DataGridSlots as Go } from "../../slots/DataGridEnum.js";
7
+ import { deepEqual as Ko } from "fast-equals";
8
+ import { useViewMode as Io } from "../../hooks/useViewMode/useViewMode.js";
9
+ import { useRowHeight as Fo } from "../../hooks/useRowHeight/useRowHeight.js";
10
+ import { useColumnsWidth as $o } from "../../hooks/useColumnsWidth/useColumnsWidth.js";
11
+ import { getColumnsWidth as k } from "../../helpers/persistence/getColumnsWidth/getColumnsWidth.js";
12
+ import { useViewConfig as Ao } from "../../hooks/useViewConfig/useViewConfig.js";
13
+ import { useChangeColumnsConfig as Oo } from "../../hooks/useChangeColumnsConfig/useChangeColumnsConfig.js";
14
+ import { useChangeColumnsOrder as Wo } from "../../hooks/useChangeColumnsOrder/useChangeColumnsOrder.js";
15
+ import { getViewMode as G } from "../../helpers/persistence/getViewMode/getViewMode.js";
16
16
  import { getInitialColumnsConfig as y } from "../../helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.js";
17
17
  import { getAllViewModes as V } from "../../helpers/shared/getAllViewModes/getAllViewModes.js";
18
- import { getViewSpecificConfig as G } from "../../helpers/shared/getViewSpecificConfig/getViewSpecificConfig.js";
19
- const Mo = ho(null);
20
- function re(K) {
18
+ import { getViewSpecificConfig as K } from "../../helpers/shared/getViewSpecificConfig/getViewSpecificConfig.js";
19
+ const Mo = po(null);
20
+ function re(I) {
21
21
  const {
22
22
  id: r,
23
- children: I,
24
- columns: t,
25
- defaultConfig: F,
26
- onChangeConfig: $,
27
- defaultUserColumns: A,
23
+ children: F,
24
+ columns: n,
25
+ defaultConfig: $,
26
+ onChangeConfig: A,
27
+ defaultUserColumns: O,
28
28
  // deprecated
29
- onChangeUserColumns: O,
29
+ onChangeUserColumns: W,
30
30
  // deprecated
31
- rows: W,
32
- rowsCount: M,
33
- rowActionsGetter: z,
34
- rowHeights: R = Ro,
35
- rowHeaderHeights: _ = So,
36
- initialRowHeightVariant: L = "standard",
37
- checkedRows: j,
38
- onCheckedRowsChange: U,
39
- checkedRowsMultiple: q,
40
- rowKeyGetter: N,
31
+ rows: M,
32
+ rowsCount: z,
33
+ rowActionsGetter: _,
34
+ rowHeights: R = So,
35
+ rowHeaderHeights: L = vo,
36
+ initialRowHeightVariant: j = "standard",
37
+ checkedRows: U,
38
+ onCheckedRowsChange: q,
39
+ checkedRowsMultiple: N,
40
+ rowKeyGetter: P,
41
41
  externalSortSettings: h,
42
42
  externalFilterSettings: p,
43
- size: P,
44
- viewMode: X,
45
- onViewModeChange: B,
43
+ size: X,
44
+ viewMode: B,
45
+ onViewModeChange: J,
46
46
  defaultViewMode: m,
47
47
  cardsViewConfig: s,
48
48
  listViewConfig: c,
49
- reorderable: J = !0
50
- } = K, a = F ?? A, g = $ ?? O, D = yo([t, r]), { viewModeState: Q, setViewModeState: E, handleViewModeChange: Y } = Ko(
49
+ reorderable: Q = !0
50
+ } = I, l = $ ?? O, g = A ?? W, D = Vo([n, r]), { viewModeState: Y, setViewModeState: E, handleViewModeChange: Z } = Io(
51
51
  {
52
52
  id: r,
53
- viewMode: X,
53
+ viewMode: B,
54
54
  defaultViewMode: m,
55
- onViewModeChange: B,
55
+ onViewModeChange: J,
56
56
  onChangeConfig: g
57
57
  }
58
- ), { currentRowHeightVariant: S, setRowHeightVariant: Z } = Io({
58
+ ), { currentRowHeightVariant: S, setRowHeightVariant: oo } = Fo({
59
59
  rowHeights: R,
60
- rowHeaderHeights: _,
61
- initialRowHeightVariant: L
62
- }), { columnsWidths: oo, setColumnsWidths: eo, onChangeColumnWidth: no } = Fo({
60
+ rowHeaderHeights: L,
61
+ initialRowHeightVariant: j
62
+ }), { columnsWidths: eo, setColumnsWidths: no, onChangeColumnWidth: io } = $o({
63
63
  id: r,
64
- onChangeConfig: g
65
- }), { getConfigColumns: d, updateConfigColumns: C } = $o(), { onChangeColumnsConfig: T } = Ao({
64
+ onChangeConfig: g,
65
+ initialWidths: k(r, n, l)
66
+ }), { getConfigColumns: d, updateConfigColumns: C } = Ao(), { onChangeColumnsConfig: T } = Oo({
66
67
  id: r,
67
68
  onChangeConfig: g,
68
69
  updateConfigColumns: C
69
- }), { onChangeColumnsOrder: io } = Oo({
70
+ }), { onChangeColumnsOrder: to } = Wo({
70
71
  getConfigColumns: d,
71
72
  onChangeColumnsConfig: T
72
- }), to = Vo(vo, {
73
+ }), ro = Ro(Ho, {
74
+ ...Go,
73
75
  ...ko,
74
76
  ...bo,
75
77
  ...To,
76
78
  ...Eo,
77
79
  ...Do,
78
- ...xo,
79
- ...Ho
80
- }), [ro, so] = b(M), [lo, ao] = b([]);
80
+ ...xo
81
+ }), [so, lo] = b(z), [ao, uo] = b([]);
81
82
  x(() => {
82
- const n = new Set(t.map((o) => o.key));
83
+ const i = new Set(n.map((o) => o.key));
83
84
  if (m === "cards" && s === void 0)
84
85
  throw new Error(
85
86
  `DataGridProvider: When defaultViewMode="cards", you must provide cardsViewConfig.
@@ -126,18 +127,18 @@ function re(K) {
126
127
  if (h?.sortsColumns) {
127
128
  for (const o of h.sortsColumns)
128
129
  if (typeof o == "string") {
129
- if (!n.has(o))
130
+ if (!i.has(o))
130
131
  throw new Error(
131
132
  `DataGridProvider: Sorts incluye "${o}", pero no existe ninguna columna con key="${o}".`
132
133
  );
133
- } else if (!o.skipColumnValidation && !n.has(o.name))
134
+ } else if (!o.skipColumnValidation && !i.has(o.name))
134
135
  throw new Error(
135
136
  `DataGridProvider: Sorts incluye "${o.name}", pero no existe ninguna columna con key="${o.name}".`
136
137
  );
137
138
  }
138
139
  if (p?.filterColumns) {
139
140
  for (const o of p.filterColumns)
140
- if (!o.skipColumnValidation && !n.has(o.name))
141
+ if (!o.skipColumnValidation && !i.has(o.name))
141
142
  throw new Error(
142
143
  `DataGridProvider: Fields incluye "${o.name}", pero no existe ninguna columna con key="${o.name}".`
143
144
  );
@@ -174,50 +175,50 @@ function re(K) {
174
175
  `
175
176
  );
176
177
  if (e && s.columnsConfig) {
177
- for (const i of s.columnsConfig)
178
- if (!n.has(i.columnKey))
178
+ for (const t of s.columnsConfig)
179
+ if (!i.has(t.columnKey))
179
180
  throw new Error(
180
- `DataGridProvider: cardsViewConfig.columnsConfig incluye columnKey="${i.columnKey}", pero no existe ninguna columna con key="${i.columnKey}".`
181
+ `DataGridProvider: cardsViewConfig.columnsConfig incluye columnKey="${t.columnKey}", pero no existe ninguna columna con key="${t.columnKey}".`
181
182
  );
182
183
  }
183
184
  }
184
185
  if (c?.columnsConfig) {
185
186
  for (const o of c.columnsConfig)
186
- if (!n.has(o.columnKey))
187
+ if (!i.has(o.columnKey))
187
188
  throw new Error(
188
189
  `DataGridProvider: listViewConfig.columnsConfig includes columnKey="${o.columnKey}", but no column with key="${o.columnKey}" exists.`
189
190
  );
190
191
  }
191
- }, [t, h, p, s, c, m]);
192
- const uo = po(() => R, [R]);
192
+ }, [n, h, p, s, c, m]);
193
+ const fo = yo(() => R, [R]);
193
194
  x(() => {
194
195
  if (D) {
195
- eo(Wo(r, t, a)), E(
196
- k(r, a, m) ?? "table"
196
+ no(k(r, n, l)), E(
197
+ G(r, l, m) ?? "table"
197
198
  ), E(
198
- k(r, a, m) ?? "table"
199
+ G(r, l, m) ?? "table"
199
200
  ), C(
200
201
  "table",
201
202
  y(
202
203
  r,
203
- t,
204
+ n,
204
205
  "table",
205
- a?.columnsConfig,
206
+ l?.columnsConfig,
206
207
  { frozen: !1, grouped: !1, groupOrder: 0 },
207
208
  { originalFrozen: !1, originalGrouped: !1, originalGroupOrder: 0 }
208
209
  )
209
210
  );
210
- const n = (() => {
211
- if (a?.columnsConfigCards && a.columnsConfigCards.length > 0)
212
- return a.columnsConfigCards;
211
+ const i = (() => {
212
+ if (l?.columnsConfigCards && l.columnsConfigCards.length > 0)
213
+ return l.columnsConfigCards;
213
214
  if (s?.columnsConfig)
214
215
  return s.columnsConfig.map((o, e) => {
215
- const i = t.find(
216
+ const t = n.find(
216
217
  (u) => u.key === o.columnKey
217
218
  );
218
219
  return {
219
220
  key: o.columnKey,
220
- visible: i?.visible === void 0 ? !0 : i?.visible,
221
+ visible: t?.visible === void 0 ? !0 : t?.visible,
221
222
  index: e,
222
223
  showTitle: o.showTitle
223
224
  };
@@ -227,25 +228,25 @@ function re(K) {
227
228
  "cards",
228
229
  y(
229
230
  r,
230
- t,
231
- "cards",
232
231
  n,
232
+ "cards",
233
+ i,
233
234
  { showTitle: !1 },
234
235
  { originalShowTitle: !1 }
235
236
  )
236
237
  ), c) {
237
238
  const o = (() => {
238
- if (a?.columnsConfigList && a.columnsConfigList.length > 0)
239
- return a.columnsConfigList;
239
+ if (l?.columnsConfigList && l.columnsConfigList.length > 0)
240
+ return l.columnsConfigList;
240
241
  if (c.columnsConfig)
241
- return c.columnsConfig.map((e, i) => {
242
- const u = t.find(
243
- (l) => l.key === e.columnKey
242
+ return c.columnsConfig.map((e, t) => {
243
+ const u = n.find(
244
+ (a) => a.key === e.columnKey
244
245
  );
245
246
  return {
246
247
  key: e.columnKey,
247
248
  visible: u?.visible === void 0 ? !0 : u?.visible,
248
- index: i,
249
+ index: t,
249
250
  showTitle: e.showTitle
250
251
  };
251
252
  });
@@ -254,7 +255,7 @@ function re(K) {
254
255
  "list",
255
256
  y(
256
257
  r,
257
- t,
258
+ n,
258
259
  "list",
259
260
  o,
260
261
  { showTitle: !1 },
@@ -263,43 +264,43 @@ function re(K) {
263
264
  );
264
265
  }
265
266
  }
266
- }, [a]), x(() => {
267
+ }, [l]), x(() => {
267
268
  if (!D) {
268
- const n = {
269
+ const i = {
269
270
  table: [],
270
271
  cards: [],
271
272
  list: []
272
273
  };
273
274
  V().forEach((e) => {
274
- const i = d(e), u = [];
275
- for (let l = 0; l < i.length; l++) {
276
- const f = t.findIndex(
277
- (w) => w.key === i[l]?.key
275
+ const t = d(e), u = [];
276
+ for (let a = 0; a < t.length; a++) {
277
+ const f = n.findIndex(
278
+ (w) => w.key === t[a]?.key
278
279
  );
279
280
  if (f !== -1) {
280
- const w = t[f];
281
+ const w = n[f];
281
282
  u.push({
282
- ...i[l],
283
+ ...t[a],
283
284
  originalIndex: f,
284
285
  // Propiedades específicas por vista dinámicamente
285
- ...G(e).dynamicOriginalProperty(
286
- i[l] || w
286
+ ...K(e).dynamicOriginalProperty(
287
+ t[a] || w
287
288
  ),
288
289
  originalVisible: w.visible ?? !0
289
290
  });
290
291
  }
291
292
  }
292
- n[e] = u;
293
+ i[e] = u;
293
294
  }), V().forEach((e) => {
294
- const i = n[e], u = new Set(
295
+ const t = i[e], u = new Set(
295
296
  d(e).map((f) => f.key)
296
- ), l = t.filter(
297
+ ), a = n.filter(
297
298
  (f) => !u.has(f.key)
298
299
  );
299
- if (l.length > 0) {
300
- const f = i.length, co = y(
300
+ if (a.length > 0) {
301
+ const f = t.length, mo = y(
301
302
  r,
302
- l,
303
+ a,
303
304
  e,
304
305
  void 0,
305
306
  e === "cards" || e === "list" ? { showTitle: !1 } : {
@@ -314,80 +315,80 @@ function re(K) {
314
315
  originalGrouped: !1,
315
316
  originalGroupOrder: 0
316
317
  }
317
- ).map((mo, v) => {
318
- const go = t.findIndex(
319
- (Co) => Co.key === l[v].key
320
- ), H = l[v];
318
+ ).map((go, v) => {
319
+ const Co = n.findIndex(
320
+ (wo) => wo.key === a[v].key
321
+ ), H = a[v];
321
322
  return {
322
- ...mo,
323
+ ...go,
323
324
  index: v + f,
324
325
  name: H.name,
325
- originalIndex: go,
326
+ originalIndex: Co,
326
327
  originalVisible: H.visible ?? !0,
327
328
  // Propiedades específicas por vista dinámicamente
328
- ...G(e).dynamicOriginalProperty(
329
+ ...K(e).dynamicOriginalProperty(
329
330
  H
330
331
  )
331
332
  };
332
333
  });
333
- n[e].push(...co);
334
+ i[e].push(...mo);
334
335
  }
335
336
  });
336
337
  let o = !1;
337
338
  if (V().forEach((e) => {
338
- Go(
339
+ Ko(
339
340
  d(e),
340
- n[e]
341
+ i[e]
341
342
  ) || (o = !0);
342
343
  }), !o)
343
344
  return;
344
345
  V().forEach((e) => {
345
- C(e, n[e]);
346
+ C(e, i[e]);
346
347
  });
347
348
  }
348
- }, [t, r]);
349
- const fo = (n) => {
350
- so(n);
349
+ }, [n, r]);
350
+ const co = (i) => {
351
+ lo(i);
351
352
  };
352
- return /* @__PURE__ */ wo(
353
+ return /* @__PURE__ */ ho(
353
354
  Mo.Provider,
354
355
  {
355
356
  value: {
356
357
  getConfigColumns: d,
357
358
  onChangeColumnsConfig: T,
358
359
  columnsConfig: d("table"),
359
- columnsWidths: oo,
360
- rowsCount: ro,
360
+ columnsWidths: eo,
361
+ rowsCount: so,
361
362
  currentRowHeightVariant: S.rowHVariant,
362
363
  currentRowHeight: S.rowHeight,
363
364
  currentRowHeaderHeight: S.rowHeaderHeight,
364
- rows: W,
365
- rowHeights: uo,
366
- checkedRows: j,
367
- reorderable: J,
368
- onChangeColumnsOrder: io,
369
- onChangeColumnWidth: no,
370
- setRowsCount: fo,
371
- rowActionsGetter: z,
372
- setRowHeightVariant: Z,
373
- onCheckedRowsChange: U,
374
- checkedRowsMultiple: q,
375
- rowKeyGetter: N,
365
+ rows: M,
366
+ rowHeights: fo,
367
+ checkedRows: U,
368
+ reorderable: Q,
369
+ onChangeColumnsOrder: to,
370
+ onChangeColumnWidth: io,
371
+ setRowsCount: co,
372
+ rowActionsGetter: _,
373
+ setRowHeightVariant: oo,
374
+ onCheckedRowsChange: q,
375
+ checkedRowsMultiple: N,
376
+ rowKeyGetter: P,
376
377
  onChangeConfig: g,
377
378
  onChangeUserColumns: g,
378
379
  // deprecated alias
379
- sortColumns: lo,
380
- setSortColumns: ao,
380
+ sortColumns: ao,
381
+ setSortColumns: uo,
381
382
  externalSortSettings: h,
382
383
  externalFilterSettings: p,
383
- classes: to,
384
- size: P,
385
- viewMode: Q,
386
- onViewModeChange: Y,
384
+ classes: ro,
385
+ size: X,
386
+ viewMode: Y,
387
+ onViewModeChange: Z,
387
388
  cardsViewConfig: s,
388
389
  listViewConfig: c
389
390
  },
390
- children: I
391
+ children: F
391
392
  }
392
393
  );
393
394
  }
@@ -1,7 +1,6 @@
1
1
  export { saveColumnsWidth } from './persistence/saveColumnsWidth';
2
2
  export { saveViewConfig } from './persistence/saveViewConfig';
3
3
  export { saveViewMode } from './persistence/saveViewMode';
4
- export { loadViewConfig } from './persistence/loadViewConfig';
5
4
  export { getColumnsWidth } from './persistence/getColumnsWidth';
6
5
  export { getViewMode } from './persistence/getViewMode';
7
6
  export { castMapColumnsWidthToRecord } from './shared/castMapColumnsWidthToRecord';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/datagrids/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -13,9 +13,7 @@ import { IGridConfig } from './types';
13
13
  * Configuración que viene de las cookies de red cuando el componente se monta.
14
14
  * En producción, esta es la fuente principal de datos persistidos.
15
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.
16
+ * localStorage is not used; configuration must be provided via defaultConfig (network cookies).
19
17
  *
20
18
  * Si no se encuentra configuración en ninguna fuente, la columna no se incluye
21
19
  * en el Map resultante y usará el ancho por defecto definido en la columna.
@@ -35,10 +33,10 @@ import { IGridConfig } from './types';
35
33
  * @returns Map donde la key es el identificador de la columna (column.key) y el value
36
34
  * es el ancho configurado (número en píxeles o string con unidad CSS)
37
35
  * @example
38
- * // Sin configuración de cookies de red (usa localStorage como fallback)
36
+ * // No network cookie config (no fallback; defaultConfig must come from consumer)
39
37
  * const columnsWidths = getColumnsWidth('my-grid', columns, null);
40
38
  * @example
41
- * // Con configuración de cookies de red (caso típico en producción)
39
+ * // With network cookie config (typical production case)
42
40
  * const columnsWidths = getColumnsWidth('my-grid', columns, {
43
41
  * columnsWidths: { name: 200, email: 300 }
44
42
  * });
@@ -1 +1 @@
1
- {"version":3,"file":"getColumnsWidth.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAC/C,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAC7C,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAsCrC"}
1
+ {"version":3,"file":"getColumnsWidth.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAC/C,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,SAAS,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAC7C,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,GAChC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAuBrC"}
@@ -1,27 +1,16 @@
1
- function s(h, i, r) {
2
- const a = /* @__PURE__ */ new Map();
3
- let n;
4
- try {
5
- const t = window.localStorage.getItem(`${h}_columns_width`);
6
- n = t !== null ? new Map(JSON.parse(t)) : /* @__PURE__ */ new Map();
7
- } catch {
8
- n = /* @__PURE__ */ new Map();
9
- }
10
- for (let t = 0; t < i.length; t++) {
11
- let e;
12
- if (r)
1
+ function o(r, e, n) {
2
+ const h = /* @__PURE__ */ new Map();
3
+ for (let t = 0; t < e.length; t++) {
4
+ let i;
5
+ if (n)
13
6
  try {
14
- e = r.columnsWidths[i[t].key];
7
+ i = n.columnsWidths[e[t].key];
15
8
  } catch {
16
9
  }
17
- if (e === void 0) {
18
- const o = n.get(i[t].key);
19
- typeof o == "number" && (e = o);
20
- }
21
- e !== void 0 && a.set(i[t].key, e);
10
+ i !== void 0 && h.set(e[t].key, i);
22
11
  }
23
- return a;
12
+ return h;
24
13
  }
25
14
  export {
26
- s as getColumnsWidth
15
+ o as getColumnsWidth
27
16
  };
@@ -2,41 +2,36 @@ import { Maybe } from '@m4l/core';
2
2
  import { RowKey } from '../../../types';
3
3
  import { IGridConfigExtended, ViewMode } from '../../../contexts/DataGridContext/types';
4
4
  /**
5
- * Obtiene el modo de visualización del DataGrid.
5
+ * Gets the DataGrid view mode (table/cards).
6
6
  *
7
- * ## Flujo de persistencia
7
+ * ## Persistence flow
8
8
  *
9
- * Esta función obtiene el viewMode siguiendo una jerarquía de precedencia:
9
+ * This function obtains viewMode following a precedence order:
10
10
  *
11
- * 1. **defaultConfig.viewMode** (Cookies de red) - Prioridad máxima
12
- * Configuración que viene de las cookies de red cuando el componente se monta.
13
- * En producción, esta es la fuente principal de datos persistidos.
11
+ * 1. **defaultConfig.viewMode** (Network cookies) - Highest priority
12
+ * Configuration that comes from network cookies when the component mounts.
13
+ * In production, this is the main source of persisted data.
14
14
  *
15
- * 2. **localStorage** - Fallback local
16
- * Solo se usa cuando NO hay configuración de cookies de red.
17
- * Útil para desarrollo o cuando no hay integración con cookies de red.
15
+ * localStorage is not used.
18
16
  *
19
- * 3. **defaultViewMode** - Valor por defecto del desarrollador
20
- * Se usa si no hay configuración guardada en ningún lado.
17
+ * 2. **defaultViewMode** - Developer default value
18
+ * Used when there is no configuration saved in network cookies.
21
19
  *
22
- * ## Relación con saveViewMode
20
+ * ## Relation with saveViewMode
23
21
  *
24
- * - Cuando el usuario cambia de vista, `saveViewMode` envía los cambios
25
- * mediante el callback `onChangeConfig`
26
- * - En la siguiente carga, esos datos vuelven como `defaultConfig.viewMode`
27
- * - localStorage es solo un fallback cuando no hay callback configurado
28
- * @param id - Identificador único del DataGrid. Se usa como prefijo para la key en localStorage (fallback)
29
- * @param defaultConfig - Configuración del usuario obtenida de cookies de red.
30
- * Esta es la fuente principal en producción.
31
- * @param defaultViewMode - Valor por defecto del desarrollador cuando no hay configuración guardada
32
- * @returns El viewMode a usar, o undefined si no se encontró configuración
22
+ * - When the user changes view, `saveViewMode` sends changes via the `onChangeConfig` callback
23
+ * - On next load, that data comes back as `defaultConfig.viewMode`
24
+ * @param id - Unique DataGrid identifier (API compatibility)
25
+ * @param defaultConfig - User configuration from network cookies. Main source in production.
26
+ * @param defaultViewMode - Developer default when no configuration is saved
27
+ * @returns The viewMode to use, or undefined if none found
33
28
  * @example
34
- * // Sin configuración de cookies de red (usa localStorage como fallback)
29
+ * // No network cookie config (uses defaultViewMode if provided)
35
30
  * const viewMode = getViewMode('my-grid', null, 'table');
36
31
  * @example
37
- * // Con configuración de cookies de red (caso típico en producción)
32
+ * // With network cookie config (typical production case)
38
33
  * const viewMode = getViewMode('my-grid', { viewMode: 'cards' }, 'table');
39
- * @see saveViewMode - Función complementaria para persistir la configuración
34
+ * @see saveViewMode - Complementary function to persist view mode
40
35
  */
41
- export declare function getViewMode(id: RowKey, defaultConfig: Maybe<IGridConfigExtended>, defaultViewMode?: ViewMode): ViewMode | undefined;
36
+ export declare function getViewMode(_id: RowKey, defaultConfig: Maybe<IGridConfigExtended>, defaultViewMode?: ViewMode): ViewMode | undefined;
42
37
  //# sourceMappingURL=getViewMode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getViewMode.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/persistence/getViewMode/getViewMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,EACzC,eAAe,CAAC,EAAE,QAAQ,GACzB,QAAQ,GAAG,SAAS,CA0BtB"}
1
+ {"version":3,"file":"getViewMode.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/helpers/persistence/getViewMode/getViewMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,EACzC,eAAe,CAAC,EAAE,QAAQ,GACzB,QAAQ,GAAG,SAAS,CAUtB"}
@@ -1,15 +1,9 @@
1
- function o(i, t, r) {
2
- if (t?.viewMode)
3
- return t.viewMode;
4
- try {
5
- const e = window.localStorage.getItem(`${i}_view_mode`);
6
- if (e === "cards" || e === "table" || e === "list")
7
- return e;
8
- } catch {
9
- }
1
+ function n(i, e, r) {
2
+ if (e?.viewMode)
3
+ return e.viewMode;
10
4
  if (r)
11
5
  return r;
12
6
  }
13
7
  export {
14
- o as getViewMode
8
+ n as getViewMode
15
9
  };