@m4l/components 9.4.51-beta-fix-683-datagrids-remove-localstorage.2 → 9.4.51

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 (61) hide show
  1. package/components/datagrids/components/DataGridMain/DataGridMain.d.ts.map +1 -1
  2. package/components/datagrids/components/DataGridMain/DataGridMain.js +9 -7
  3. package/components/datagrids/components/TreeDataGrid/TreeDataGrid.d.ts.map +1 -1
  4. package/components/datagrids/components/TreeDataGrid/TreeDataGrid.js +27 -25
  5. package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
  6. package/components/datagrids/contexts/DataGridContext/DataGridContext.js +133 -134
  7. package/components/datagrids/helpers/index.d.ts +1 -0
  8. package/components/datagrids/helpers/index.d.ts.map +1 -1
  9. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts +5 -3
  10. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts.map +1 -1
  11. package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.js +20 -9
  12. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts +25 -20
  13. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts.map +1 -1
  14. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.js +10 -4
  15. package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts +2 -0
  16. package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts.map +1 -0
  17. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts +24 -0
  18. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts.map +1 -0
  19. package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.js +11 -0
  20. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts +9 -4
  21. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts.map +1 -1
  22. package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.js +13 -8
  23. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts +18 -13
  24. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts.map +1 -1
  25. package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.js +11 -8
  26. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts +17 -14
  27. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts.map +1 -1
  28. package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.js +10 -6
  29. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +19 -18
  30. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts.map +1 -1
  31. package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.js +16 -11
  32. package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.d.ts +11 -11
  33. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts +2 -1
  34. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts.map +1 -1
  35. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.js +3 -3
  36. package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +4 -5
  37. package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts.map +1 -1
  38. package/components/datagrids/hooks/useColumnsWidth/types.d.ts +0 -2
  39. package/components/datagrids/hooks/useColumnsWidth/types.d.ts.map +1 -1
  40. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts +1 -1
  41. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts.map +1 -1
  42. package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.js +11 -12
  43. package/components/datagrids/hooks/useViewMode/useViewMode.d.ts +13 -13
  44. package/components/datagrids/hooks/useViewMode/useViewMode.d.ts.map +1 -1
  45. package/components/datagrids/types.d.ts +8 -2
  46. package/components/datagrids/types.d.ts.map +1 -1
  47. package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
  48. package/components/datagrids/views/CardsView/CardsView.js +36 -34
  49. package/components/datagrids/views/ListView/ListView.d.ts.map +1 -1
  50. package/components/datagrids/views/ListView/ListView.js +45 -43
  51. package/components/datagrids/views/TableView/TableView.d.ts.map +1 -1
  52. package/components/datagrids/views/TableView/TableView.js +115 -109
  53. package/hooks/useDataGridPersistence/constants.d.ts +0 -1
  54. package/hooks/useDataGridPersistence/constants.d.ts.map +1 -1
  55. package/hooks/useDataGridPersistence/constants.js +4 -5
  56. package/hooks/useDataGridPersistence/helpers.d.ts +0 -4
  57. package/hooks/useDataGridPersistence/helpers.d.ts.map +1 -1
  58. package/hooks/useDataGridPersistence/helpers.js +2 -3
  59. package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts.map +1 -1
  60. package/hooks/useDataGridPersistence/useDataGridPersistence.js +27 -33
  61. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridMain.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/components/DataGridMain/DataGridMain.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACtE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAqC9C"}
1
+ {"version":3,"file":"DataGridMain.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/components/DataGridMain/DataGridMain.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACtE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAuC9C"}
@@ -1,7 +1,7 @@
1
- import { jsx as o } from "@emotion/react/jsx-runtime";
1
+ import { jsx as e } from "@emotion/react/jsx-runtime";
2
2
  import { BaseDataGrid as f } from "../BaseDataGrid/BaseDataGrid.js";
3
- import { RenderContent as l } from "../../views/adapters/RenderContent/RenderContent.js";
4
- function G(e) {
3
+ import { RenderContent as g } from "../../views/adapters/RenderContent/RenderContent.js";
4
+ function p(o) {
5
5
  const {
6
6
  id: n,
7
7
  withActions: r,
@@ -13,12 +13,13 @@ function G(e) {
13
13
  onRowsChange: w,
14
14
  cardsViewConfig: a,
15
15
  focusOnRowKey: h,
16
+ smoothScroll: l,
16
17
  checkedRows: m,
17
18
  onCheckedRowsChange: C,
18
19
  rowCellsBackground: R
19
- } = e;
20
- return /* @__PURE__ */ o(f, { ...e, children: /* @__PURE__ */ o(
21
- l,
20
+ } = o;
21
+ return /* @__PURE__ */ e(f, { ...o, children: /* @__PURE__ */ e(
22
+ g,
22
23
  {
23
24
  id: n,
24
25
  withActions: r,
@@ -30,6 +31,7 @@ function G(e) {
30
31
  onRowsChange: w,
31
32
  cardsViewConfig: a,
32
33
  focusOnRowKey: h,
34
+ smoothScroll: l,
33
35
  checkedRows: m,
34
36
  onCheckedRowsChange: C,
35
37
  rowCellsBackground: R
@@ -37,5 +39,5 @@ function G(e) {
37
39
  ) });
38
40
  }
39
41
  export {
40
- G as DataGrid
42
+ p as DataGrid
41
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TreeDataGrid.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/components/TreeDataGrid/TreeDataGrid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAC1E,KAAK,EAAE,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDA6DlD"}
1
+ {"version":3,"file":"TreeDataGrid.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/components/TreeDataGrid/TreeDataGrid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAC1E,KAAK,EAAE,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDA+DlD"}
@@ -1,48 +1,50 @@
1
1
  import { jsx as r } from "@emotion/react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { TableView as f } from "../../views/TableView/TableView.js";
4
- import { BaseDataGrid as E } from "../BaseDataGrid/BaseDataGrid.js";
5
- function B(o) {
2
+ import { useState as f } from "react";
3
+ import { TableView as E } from "../../views/TableView/TableView.js";
4
+ import { BaseDataGrid as R } from "../BaseDataGrid/BaseDataGrid.js";
5
+ function D(e) {
6
6
  const {
7
7
  id: s,
8
8
  withActions: t,
9
9
  columns: a,
10
10
  rows: p,
11
- selectedRows: u,
12
- onSelectedRowsChange: c,
11
+ selectedRows: c,
12
+ onSelectedRowsChange: u,
13
13
  rowKeyGetter: i,
14
14
  onRowsChange: G,
15
- focusOnRowKey: w,
16
- checkedRows: x,
17
- onCheckedRowsChange: h,
18
- rowGrouper: l,
19
- expandedGroupIds: e,
15
+ focusOnRowKey: l,
16
+ smoothScroll: w,
17
+ checkedRows: h,
18
+ onCheckedRowsChange: x,
19
+ rowGrouper: I,
20
+ expandedGroupIds: o,
20
21
  onExpandedGroupIdsChange: n,
21
- rowCellsBackground: I
22
- } = o, [C, m] = g(() => new Set(e ?? [])), d = e !== void 0 && n !== void 0;
23
- return /* @__PURE__ */ r(E, { ...o, children: /* @__PURE__ */ r(
24
- f,
22
+ rowCellsBackground: m
23
+ } = e, [C, g] = f(() => new Set(o ?? [])), d = o !== void 0 && n !== void 0;
24
+ return /* @__PURE__ */ r(R, { ...e, children: /* @__PURE__ */ r(
25
+ E,
25
26
  {
26
27
  id: s,
27
28
  withActions: t,
28
29
  columns: a,
29
30
  rows: p,
30
- selectedRows: u,
31
- onSelectedRowsChange: c,
31
+ selectedRows: c,
32
+ onSelectedRowsChange: u,
32
33
  rowKeyGetter: i,
33
34
  onRowsChange: G,
34
- focusOnRowKey: w,
35
- checkedRows: x,
36
- onCheckedRowsChange: h,
37
- rowCellsBackground: I,
35
+ focusOnRowKey: l,
36
+ smoothScroll: w,
37
+ checkedRows: h,
38
+ onCheckedRowsChange: x,
39
+ rowCellsBackground: m,
38
40
  treeProps: {
39
- rowGrouper: l,
40
- expandedGroupIds: d ? e : C,
41
- onExpandedGroupIdsChange: d ? n : m
41
+ rowGrouper: I,
42
+ expandedGroupIds: d ? o : C,
43
+ onExpandedGroupIdsChange: d ? n : g
42
44
  }
43
45
  }
44
46
  ) });
45
47
  }
46
48
  export {
47
- B as TreeDataGrid
49
+ D as TreeDataGrid
48
50
  };
@@ -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,oDAiiBtD;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,oDAgiBtD;AAED,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
@@ -1,86 +1,85 @@
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";
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";
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 K } from "../../helpers/shared/getViewSpecificConfig/getViewSpecificConfig.js";
19
- const Mo = po(null);
20
- function re(I) {
18
+ import { getViewSpecificConfig as G } from "../../helpers/shared/getViewSpecificConfig/getViewSpecificConfig.js";
19
+ const Mo = ho(null);
20
+ function re(K) {
21
21
  const {
22
22
  id: r,
23
- children: F,
24
- columns: n,
25
- defaultConfig: $,
26
- onChangeConfig: A,
27
- defaultUserColumns: O,
23
+ children: I,
24
+ columns: t,
25
+ defaultConfig: F,
26
+ onChangeConfig: $,
27
+ defaultUserColumns: A,
28
28
  // deprecated
29
- onChangeUserColumns: W,
29
+ onChangeUserColumns: O,
30
30
  // deprecated
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,
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,
41
41
  externalSortSettings: h,
42
42
  externalFilterSettings: p,
43
- size: X,
44
- viewMode: B,
45
- onViewModeChange: J,
43
+ size: P,
44
+ viewMode: X,
45
+ onViewModeChange: B,
46
46
  defaultViewMode: m,
47
47
  cardsViewConfig: s,
48
48
  listViewConfig: c,
49
- reorderable: Q = !0
50
- } = I, l = $ ?? O, g = A ?? W, D = Vo([n, r]), { viewModeState: Y, setViewModeState: E, handleViewModeChange: Z } = Io(
49
+ reorderable: J = !0
50
+ } = K, a = F ?? A, g = $ ?? O, D = yo([t, r]), { viewModeState: Q, setViewModeState: E, handleViewModeChange: Y } = Ko(
51
51
  {
52
52
  id: r,
53
- viewMode: B,
53
+ viewMode: X,
54
54
  defaultViewMode: m,
55
- onViewModeChange: J,
55
+ onViewModeChange: B,
56
56
  onChangeConfig: g
57
57
  }
58
- ), { currentRowHeightVariant: S, setRowHeightVariant: oo } = Fo({
58
+ ), { currentRowHeightVariant: S, setRowHeightVariant: Z } = Io({
59
59
  rowHeights: R,
60
- rowHeaderHeights: L,
61
- initialRowHeightVariant: j
62
- }), { columnsWidths: eo, setColumnsWidths: no, onChangeColumnWidth: io } = $o({
60
+ rowHeaderHeights: _,
61
+ initialRowHeightVariant: L
62
+ }), { columnsWidths: oo, setColumnsWidths: eo, onChangeColumnWidth: no } = Fo({
63
63
  id: r,
64
- onChangeConfig: g,
65
- initialWidths: k(r, n, l)
66
- }), { getConfigColumns: d, updateConfigColumns: C } = Ao(), { onChangeColumnsConfig: T } = Oo({
64
+ onChangeConfig: g
65
+ }), { getConfigColumns: d, updateConfigColumns: C } = $o(), { onChangeColumnsConfig: T } = Ao({
67
66
  id: r,
68
67
  onChangeConfig: g,
69
68
  updateConfigColumns: C
70
- }), { onChangeColumnsOrder: to } = Wo({
69
+ }), { onChangeColumnsOrder: io } = Oo({
71
70
  getConfigColumns: d,
72
71
  onChangeColumnsConfig: T
73
- }), ro = Ro(Ho, {
74
- ...Go,
72
+ }), to = Vo(vo, {
75
73
  ...ko,
76
74
  ...bo,
77
75
  ...To,
78
76
  ...Eo,
79
77
  ...Do,
80
- ...xo
81
- }), [so, lo] = b(z), [ao, uo] = b([]);
78
+ ...xo,
79
+ ...Ho
80
+ }), [ro, so] = b(M), [lo, ao] = b([]);
82
81
  x(() => {
83
- const i = new Set(n.map((o) => o.key));
82
+ const n = new Set(t.map((o) => o.key));
84
83
  if (m === "cards" && s === void 0)
85
84
  throw new Error(
86
85
  `DataGridProvider: When defaultViewMode="cards", you must provide cardsViewConfig.
@@ -127,18 +126,18 @@ function re(I) {
127
126
  if (h?.sortsColumns) {
128
127
  for (const o of h.sortsColumns)
129
128
  if (typeof o == "string") {
130
- if (!i.has(o))
129
+ if (!n.has(o))
131
130
  throw new Error(
132
131
  `DataGridProvider: Sorts incluye "${o}", pero no existe ninguna columna con key="${o}".`
133
132
  );
134
- } else if (!o.skipColumnValidation && !i.has(o.name))
133
+ } else if (!o.skipColumnValidation && !n.has(o.name))
135
134
  throw new Error(
136
135
  `DataGridProvider: Sorts incluye "${o.name}", pero no existe ninguna columna con key="${o.name}".`
137
136
  );
138
137
  }
139
138
  if (p?.filterColumns) {
140
139
  for (const o of p.filterColumns)
141
- if (!o.skipColumnValidation && !i.has(o.name))
140
+ if (!o.skipColumnValidation && !n.has(o.name))
142
141
  throw new Error(
143
142
  `DataGridProvider: Fields incluye "${o.name}", pero no existe ninguna columna con key="${o.name}".`
144
143
  );
@@ -175,50 +174,50 @@ function re(I) {
175
174
  `
176
175
  );
177
176
  if (e && s.columnsConfig) {
178
- for (const t of s.columnsConfig)
179
- if (!i.has(t.columnKey))
177
+ for (const i of s.columnsConfig)
178
+ if (!n.has(i.columnKey))
180
179
  throw new Error(
181
- `DataGridProvider: cardsViewConfig.columnsConfig incluye columnKey="${t.columnKey}", pero no existe ninguna columna con key="${t.columnKey}".`
180
+ `DataGridProvider: cardsViewConfig.columnsConfig incluye columnKey="${i.columnKey}", pero no existe ninguna columna con key="${i.columnKey}".`
182
181
  );
183
182
  }
184
183
  }
185
184
  if (c?.columnsConfig) {
186
185
  for (const o of c.columnsConfig)
187
- if (!i.has(o.columnKey))
186
+ if (!n.has(o.columnKey))
188
187
  throw new Error(
189
188
  `DataGridProvider: listViewConfig.columnsConfig includes columnKey="${o.columnKey}", but no column with key="${o.columnKey}" exists.`
190
189
  );
191
190
  }
192
- }, [n, h, p, s, c, m]);
193
- const fo = yo(() => R, [R]);
191
+ }, [t, h, p, s, c, m]);
192
+ const uo = po(() => R, [R]);
194
193
  x(() => {
195
194
  if (D) {
196
- no(k(r, n, l)), E(
197
- G(r, l, m) ?? "table"
195
+ eo(Wo(r, t, a)), E(
196
+ k(r, a, m) ?? "table"
198
197
  ), E(
199
- G(r, l, m) ?? "table"
198
+ k(r, a, m) ?? "table"
200
199
  ), C(
201
200
  "table",
202
201
  y(
203
202
  r,
204
- n,
203
+ t,
205
204
  "table",
206
- l?.columnsConfig,
205
+ a?.columnsConfig,
207
206
  { frozen: !1, grouped: !1, groupOrder: 0 },
208
207
  { originalFrozen: !1, originalGrouped: !1, originalGroupOrder: 0 }
209
208
  )
210
209
  );
211
- const i = (() => {
212
- if (l?.columnsConfigCards && l.columnsConfigCards.length > 0)
213
- return l.columnsConfigCards;
210
+ const n = (() => {
211
+ if (a?.columnsConfigCards && a.columnsConfigCards.length > 0)
212
+ return a.columnsConfigCards;
214
213
  if (s?.columnsConfig)
215
214
  return s.columnsConfig.map((o, e) => {
216
- const t = n.find(
215
+ const i = t.find(
217
216
  (u) => u.key === o.columnKey
218
217
  );
219
218
  return {
220
219
  key: o.columnKey,
221
- visible: t?.visible === void 0 ? !0 : t?.visible,
220
+ visible: i?.visible === void 0 ? !0 : i?.visible,
222
221
  index: e,
223
222
  showTitle: o.showTitle
224
223
  };
@@ -228,25 +227,25 @@ function re(I) {
228
227
  "cards",
229
228
  y(
230
229
  r,
231
- n,
230
+ t,
232
231
  "cards",
233
- i,
232
+ n,
234
233
  { showTitle: !1 },
235
234
  { originalShowTitle: !1 }
236
235
  )
237
236
  ), c) {
238
237
  const o = (() => {
239
- if (l?.columnsConfigList && l.columnsConfigList.length > 0)
240
- return l.columnsConfigList;
238
+ if (a?.columnsConfigList && a.columnsConfigList.length > 0)
239
+ return a.columnsConfigList;
241
240
  if (c.columnsConfig)
242
- return c.columnsConfig.map((e, t) => {
243
- const u = n.find(
244
- (a) => a.key === e.columnKey
241
+ return c.columnsConfig.map((e, i) => {
242
+ const u = t.find(
243
+ (l) => l.key === e.columnKey
245
244
  );
246
245
  return {
247
246
  key: e.columnKey,
248
247
  visible: u?.visible === void 0 ? !0 : u?.visible,
249
- index: t,
248
+ index: i,
250
249
  showTitle: e.showTitle
251
250
  };
252
251
  });
@@ -255,7 +254,7 @@ function re(I) {
255
254
  "list",
256
255
  y(
257
256
  r,
258
- n,
257
+ t,
259
258
  "list",
260
259
  o,
261
260
  { showTitle: !1 },
@@ -264,43 +263,43 @@ function re(I) {
264
263
  );
265
264
  }
266
265
  }
267
- }, [l]), x(() => {
266
+ }, [a]), x(() => {
268
267
  if (!D) {
269
- const i = {
268
+ const n = {
270
269
  table: [],
271
270
  cards: [],
272
271
  list: []
273
272
  };
274
273
  V().forEach((e) => {
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
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
279
278
  );
280
279
  if (f !== -1) {
281
- const w = n[f];
280
+ const w = t[f];
282
281
  u.push({
283
- ...t[a],
282
+ ...i[l],
284
283
  originalIndex: f,
285
284
  // Propiedades específicas por vista dinámicamente
286
- ...K(e).dynamicOriginalProperty(
287
- t[a] || w
285
+ ...G(e).dynamicOriginalProperty(
286
+ i[l] || w
288
287
  ),
289
288
  originalVisible: w.visible ?? !0
290
289
  });
291
290
  }
292
291
  }
293
- i[e] = u;
292
+ n[e] = u;
294
293
  }), V().forEach((e) => {
295
- const t = i[e], u = new Set(
294
+ const i = n[e], u = new Set(
296
295
  d(e).map((f) => f.key)
297
- ), a = n.filter(
296
+ ), l = t.filter(
298
297
  (f) => !u.has(f.key)
299
298
  );
300
- if (a.length > 0) {
301
- const f = t.length, mo = y(
299
+ if (l.length > 0) {
300
+ const f = i.length, co = y(
302
301
  r,
303
- a,
302
+ l,
304
303
  e,
305
304
  void 0,
306
305
  e === "cards" || e === "list" ? { showTitle: !1 } : {
@@ -315,80 +314,80 @@ function re(I) {
315
314
  originalGrouped: !1,
316
315
  originalGroupOrder: 0
317
316
  }
318
- ).map((go, v) => {
319
- const Co = n.findIndex(
320
- (wo) => wo.key === a[v].key
321
- ), H = a[v];
317
+ ).map((mo, v) => {
318
+ const go = t.findIndex(
319
+ (Co) => Co.key === l[v].key
320
+ ), H = l[v];
322
321
  return {
323
- ...go,
322
+ ...mo,
324
323
  index: v + f,
325
324
  name: H.name,
326
- originalIndex: Co,
325
+ originalIndex: go,
327
326
  originalVisible: H.visible ?? !0,
328
327
  // Propiedades específicas por vista dinámicamente
329
- ...K(e).dynamicOriginalProperty(
328
+ ...G(e).dynamicOriginalProperty(
330
329
  H
331
330
  )
332
331
  };
333
332
  });
334
- i[e].push(...mo);
333
+ n[e].push(...co);
335
334
  }
336
335
  });
337
336
  let o = !1;
338
337
  if (V().forEach((e) => {
339
- Ko(
338
+ Go(
340
339
  d(e),
341
- i[e]
340
+ n[e]
342
341
  ) || (o = !0);
343
342
  }), !o)
344
343
  return;
345
344
  V().forEach((e) => {
346
- C(e, i[e]);
345
+ C(e, n[e]);
347
346
  });
348
347
  }
349
- }, [n, r]);
350
- const co = (i) => {
351
- lo(i);
348
+ }, [t, r]);
349
+ const fo = (n) => {
350
+ so(n);
352
351
  };
353
- return /* @__PURE__ */ ho(
352
+ return /* @__PURE__ */ wo(
354
353
  Mo.Provider,
355
354
  {
356
355
  value: {
357
356
  getConfigColumns: d,
358
357
  onChangeColumnsConfig: T,
359
358
  columnsConfig: d("table"),
360
- columnsWidths: eo,
361
- rowsCount: so,
359
+ columnsWidths: oo,
360
+ rowsCount: ro,
362
361
  currentRowHeightVariant: S.rowHVariant,
363
362
  currentRowHeight: S.rowHeight,
364
363
  currentRowHeaderHeight: S.rowHeaderHeight,
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,
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,
377
376
  onChangeConfig: g,
378
377
  onChangeUserColumns: g,
379
378
  // deprecated alias
380
- sortColumns: ao,
381
- setSortColumns: uo,
379
+ sortColumns: lo,
380
+ setSortColumns: ao,
382
381
  externalSortSettings: h,
383
382
  externalFilterSettings: p,
384
- classes: ro,
385
- size: X,
386
- viewMode: Y,
387
- onViewModeChange: Z,
383
+ classes: to,
384
+ size: P,
385
+ viewMode: Q,
386
+ onViewModeChange: Y,
388
387
  cardsViewConfig: s,
389
388
  listViewConfig: c
390
389
  },
391
- children: F
390
+ children: I
392
391
  }
393
392
  );
394
393
  }
@@ -1,6 +1,7 @@
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';
4
5
  export { getColumnsWidth } from './persistence/getColumnsWidth';
5
6
  export { getViewMode } from './persistence/getViewMode';
6
7
  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,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,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"}
@@ -13,7 +13,9 @@ 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
- * localStorage is not used; configuration must be provided via defaultConfig (network cookies).
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.
17
19
  *
18
20
  * Si no se encuentra configuración en ninguna fuente, la columna no se incluye
19
21
  * en el Map resultante y usará el ancho por defecto definido en la columna.
@@ -33,10 +35,10 @@ import { IGridConfig } from './types';
33
35
  * @returns Map donde la key es el identificador de la columna (column.key) y el value
34
36
  * es el ancho configurado (número en píxeles o string con unidad CSS)
35
37
  * @example
36
- * // No network cookie config (no fallback; defaultConfig must come from consumer)
38
+ * // Sin configuración de cookies de red (usa localStorage como fallback)
37
39
  * const columnsWidths = getColumnsWidth('my-grid', columns, null);
38
40
  * @example
39
- * // With network cookie config (typical production case)
41
+ * // Con configuración de cookies de red (caso típico en producción)
40
42
  * const columnsWidths = getColumnsWidth('my-grid', columns, {
41
43
  * columnsWidths: { name: 200, email: 300 }
42
44
  * });
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
+ {"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"}