@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.
- package/components/datagrids/components/DataGridMain/DataGridMain.d.ts.map +1 -1
- package/components/datagrids/components/DataGridMain/DataGridMain.js +9 -7
- package/components/datagrids/components/TreeDataGrid/TreeDataGrid.d.ts.map +1 -1
- package/components/datagrids/components/TreeDataGrid/TreeDataGrid.js +27 -25
- package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
- package/components/datagrids/contexts/DataGridContext/DataGridContext.js +133 -134
- package/components/datagrids/helpers/index.d.ts +1 -0
- package/components/datagrids/helpers/index.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts +5 -3
- package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/getColumnsWidth/getColumnsWidth.js +20 -9
- package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts +25 -20
- package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/getViewMode/getViewMode.js +10 -4
- package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts +2 -0
- package/components/datagrids/helpers/persistence/loadViewConfig/index.d.ts.map +1 -0
- package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts +24 -0
- package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.d.ts.map +1 -0
- package/components/datagrids/helpers/persistence/loadViewConfig/loadViewConfig.js +11 -0
- package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts +9 -4
- package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/saveColumnsWidth/saveColumnsWidth.js +13 -8
- package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts +18 -13
- package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/saveViewConfig/saveViewConfig.js +11 -8
- package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts +17 -14
- package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.d.ts.map +1 -1
- package/components/datagrids/helpers/persistence/saveViewMode/saveViewMode.js +10 -6
- package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +19 -18
- package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.d.ts.map +1 -1
- package/components/datagrids/helpers/shared/getInitialColumnsConfig/getInitialColumnsConfig.js +16 -11
- package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.d.ts +11 -11
- package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts +2 -1
- package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts.map +1 -1
- package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.js +3 -3
- package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +4 -5
- package/components/datagrids/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts.map +1 -1
- package/components/datagrids/hooks/useColumnsWidth/types.d.ts +0 -2
- package/components/datagrids/hooks/useColumnsWidth/types.d.ts.map +1 -1
- package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts +1 -1
- package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.d.ts.map +1 -1
- package/components/datagrids/hooks/useColumnsWidth/useColumnsWidth.js +11 -12
- package/components/datagrids/hooks/useViewMode/useViewMode.d.ts +13 -13
- package/components/datagrids/hooks/useViewMode/useViewMode.d.ts.map +1 -1
- package/components/datagrids/types.d.ts +8 -2
- package/components/datagrids/types.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/CardsView.d.ts.map +1 -1
- package/components/datagrids/views/CardsView/CardsView.js +36 -34
- package/components/datagrids/views/ListView/ListView.d.ts.map +1 -1
- package/components/datagrids/views/ListView/ListView.js +45 -43
- package/components/datagrids/views/TableView/TableView.d.ts.map +1 -1
- package/components/datagrids/views/TableView/TableView.js +115 -109
- package/hooks/useDataGridPersistence/constants.d.ts +0 -1
- package/hooks/useDataGridPersistence/constants.d.ts.map +1 -1
- package/hooks/useDataGridPersistence/constants.js +4 -5
- package/hooks/useDataGridPersistence/helpers.d.ts +0 -4
- package/hooks/useDataGridPersistence/helpers.d.ts.map +1 -1
- package/hooks/useDataGridPersistence/helpers.js +2 -3
- package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts.map +1 -1
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +27 -33
- 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,
|
|
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
|
|
1
|
+
import { jsx as e } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { BaseDataGrid as f } from "../BaseDataGrid/BaseDataGrid.js";
|
|
3
|
-
import { RenderContent as
|
|
4
|
-
function
|
|
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
|
-
} =
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
|
3
|
-
import { TableView as
|
|
4
|
-
import { BaseDataGrid as
|
|
5
|
-
function
|
|
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:
|
|
12
|
-
onSelectedRowsChange:
|
|
11
|
+
selectedRows: c,
|
|
12
|
+
onSelectedRowsChange: u,
|
|
13
13
|
rowKeyGetter: i,
|
|
14
14
|
onRowsChange: G,
|
|
15
|
-
focusOnRowKey:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
focusOnRowKey: l,
|
|
16
|
+
smoothScroll: w,
|
|
17
|
+
checkedRows: h,
|
|
18
|
+
onCheckedRowsChange: x,
|
|
19
|
+
rowGrouper: I,
|
|
20
|
+
expandedGroupIds: o,
|
|
20
21
|
onExpandedGroupIdsChange: n,
|
|
21
|
-
rowCellsBackground:
|
|
22
|
-
} =
|
|
23
|
-
return /* @__PURE__ */ r(
|
|
24
|
-
|
|
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:
|
|
31
|
-
onSelectedRowsChange:
|
|
31
|
+
selectedRows: c,
|
|
32
|
+
onSelectedRowsChange: u,
|
|
32
33
|
rowKeyGetter: i,
|
|
33
34
|
onRowsChange: G,
|
|
34
|
-
focusOnRowKey:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
focusOnRowKey: l,
|
|
36
|
+
smoothScroll: w,
|
|
37
|
+
checkedRows: h,
|
|
38
|
+
onCheckedRowsChange: x,
|
|
39
|
+
rowCellsBackground: m,
|
|
38
40
|
treeProps: {
|
|
39
|
-
rowGrouper:
|
|
40
|
-
expandedGroupIds: d ?
|
|
41
|
-
onExpandedGroupIdsChange: d ? n :
|
|
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
|
-
|
|
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,
|
|
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
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useFirstRender as
|
|
4
|
-
import { getComponentClasses as
|
|
5
|
-
import { DATAGRID_ROW_HEIGHTS as
|
|
6
|
-
import { ControlNavigateSlots as
|
|
7
|
-
import { deepEqual as
|
|
8
|
-
import { useViewMode as
|
|
9
|
-
import { useRowHeight as
|
|
10
|
-
import { useColumnsWidth as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { getViewMode as
|
|
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
|
|
19
|
-
const Mo =
|
|
20
|
-
function re(
|
|
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:
|
|
24
|
-
columns:
|
|
25
|
-
defaultConfig:
|
|
26
|
-
onChangeConfig:
|
|
27
|
-
defaultUserColumns:
|
|
23
|
+
children: I,
|
|
24
|
+
columns: t,
|
|
25
|
+
defaultConfig: F,
|
|
26
|
+
onChangeConfig: $,
|
|
27
|
+
defaultUserColumns: A,
|
|
28
28
|
// deprecated
|
|
29
|
-
onChangeUserColumns:
|
|
29
|
+
onChangeUserColumns: O,
|
|
30
30
|
// deprecated
|
|
31
|
-
rows:
|
|
32
|
-
rowsCount:
|
|
33
|
-
rowActionsGetter:
|
|
34
|
-
rowHeights: R =
|
|
35
|
-
rowHeaderHeights:
|
|
36
|
-
initialRowHeightVariant:
|
|
37
|
-
checkedRows:
|
|
38
|
-
onCheckedRowsChange:
|
|
39
|
-
checkedRowsMultiple:
|
|
40
|
-
rowKeyGetter:
|
|
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:
|
|
44
|
-
viewMode:
|
|
45
|
-
onViewModeChange:
|
|
43
|
+
size: P,
|
|
44
|
+
viewMode: X,
|
|
45
|
+
onViewModeChange: B,
|
|
46
46
|
defaultViewMode: m,
|
|
47
47
|
cardsViewConfig: s,
|
|
48
48
|
listViewConfig: c,
|
|
49
|
-
reorderable:
|
|
50
|
-
} =
|
|
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:
|
|
53
|
+
viewMode: X,
|
|
54
54
|
defaultViewMode: m,
|
|
55
|
-
onViewModeChange:
|
|
55
|
+
onViewModeChange: B,
|
|
56
56
|
onChangeConfig: g
|
|
57
57
|
}
|
|
58
|
-
), { currentRowHeightVariant: S, setRowHeightVariant:
|
|
58
|
+
), { currentRowHeightVariant: S, setRowHeightVariant: Z } = Io({
|
|
59
59
|
rowHeights: R,
|
|
60
|
-
rowHeaderHeights:
|
|
61
|
-
initialRowHeightVariant:
|
|
62
|
-
}), { columnsWidths:
|
|
60
|
+
rowHeaderHeights: _,
|
|
61
|
+
initialRowHeightVariant: L
|
|
62
|
+
}), { columnsWidths: oo, setColumnsWidths: eo, onChangeColumnWidth: no } = Fo({
|
|
63
63
|
id: r,
|
|
64
|
-
onChangeConfig: g
|
|
65
|
-
|
|
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:
|
|
69
|
+
}), { onChangeColumnsOrder: io } = Oo({
|
|
71
70
|
getConfigColumns: d,
|
|
72
71
|
onChangeColumnsConfig: T
|
|
73
|
-
}),
|
|
74
|
-
...Go,
|
|
72
|
+
}), to = Vo(vo, {
|
|
75
73
|
...ko,
|
|
76
74
|
...bo,
|
|
77
75
|
...To,
|
|
78
76
|
...Eo,
|
|
79
77
|
...Do,
|
|
80
|
-
...xo
|
|
81
|
-
|
|
78
|
+
...xo,
|
|
79
|
+
...Ho
|
|
80
|
+
}), [ro, so] = b(M), [lo, ao] = b([]);
|
|
82
81
|
x(() => {
|
|
83
|
-
const
|
|
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 (!
|
|
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 && !
|
|
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 && !
|
|
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
|
|
179
|
-
if (!
|
|
177
|
+
for (const i of s.columnsConfig)
|
|
178
|
+
if (!n.has(i.columnKey))
|
|
180
179
|
throw new Error(
|
|
181
|
-
`DataGridProvider: cardsViewConfig.columnsConfig incluye 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 (!
|
|
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
|
-
}, [
|
|
193
|
-
const
|
|
191
|
+
}, [t, h, p, s, c, m]);
|
|
192
|
+
const uo = po(() => R, [R]);
|
|
194
193
|
x(() => {
|
|
195
194
|
if (D) {
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
eo(Wo(r, t, a)), E(
|
|
196
|
+
k(r, a, m) ?? "table"
|
|
198
197
|
), E(
|
|
199
|
-
|
|
198
|
+
k(r, a, m) ?? "table"
|
|
200
199
|
), C(
|
|
201
200
|
"table",
|
|
202
201
|
y(
|
|
203
202
|
r,
|
|
204
|
-
|
|
203
|
+
t,
|
|
205
204
|
"table",
|
|
206
|
-
|
|
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
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
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
|
|
215
|
+
const i = t.find(
|
|
217
216
|
(u) => u.key === o.columnKey
|
|
218
217
|
);
|
|
219
218
|
return {
|
|
220
219
|
key: o.columnKey,
|
|
221
|
-
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
|
-
|
|
230
|
+
t,
|
|
232
231
|
"cards",
|
|
233
|
-
|
|
232
|
+
n,
|
|
234
233
|
{ showTitle: !1 },
|
|
235
234
|
{ originalShowTitle: !1 }
|
|
236
235
|
)
|
|
237
236
|
), c) {
|
|
238
237
|
const o = (() => {
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
238
|
+
if (a?.columnsConfigList && a.columnsConfigList.length > 0)
|
|
239
|
+
return a.columnsConfigList;
|
|
241
240
|
if (c.columnsConfig)
|
|
242
|
-
return c.columnsConfig.map((e,
|
|
243
|
-
const u =
|
|
244
|
-
(
|
|
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:
|
|
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
|
-
|
|
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
|
-
}, [
|
|
266
|
+
}, [a]), x(() => {
|
|
268
267
|
if (!D) {
|
|
269
|
-
const
|
|
268
|
+
const n = {
|
|
270
269
|
table: [],
|
|
271
270
|
cards: [],
|
|
272
271
|
list: []
|
|
273
272
|
};
|
|
274
273
|
V().forEach((e) => {
|
|
275
|
-
const
|
|
276
|
-
for (let
|
|
277
|
-
const f =
|
|
278
|
-
(w) => w.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 =
|
|
280
|
+
const w = t[f];
|
|
282
281
|
u.push({
|
|
283
|
-
...
|
|
282
|
+
...i[l],
|
|
284
283
|
originalIndex: f,
|
|
285
284
|
// Propiedades específicas por vista dinámicamente
|
|
286
|
-
...
|
|
287
|
-
|
|
285
|
+
...G(e).dynamicOriginalProperty(
|
|
286
|
+
i[l] || w
|
|
288
287
|
),
|
|
289
288
|
originalVisible: w.visible ?? !0
|
|
290
289
|
});
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
|
-
|
|
292
|
+
n[e] = u;
|
|
294
293
|
}), V().forEach((e) => {
|
|
295
|
-
const
|
|
294
|
+
const i = n[e], u = new Set(
|
|
296
295
|
d(e).map((f) => f.key)
|
|
297
|
-
),
|
|
296
|
+
), l = t.filter(
|
|
298
297
|
(f) => !u.has(f.key)
|
|
299
298
|
);
|
|
300
|
-
if (
|
|
301
|
-
const f =
|
|
299
|
+
if (l.length > 0) {
|
|
300
|
+
const f = i.length, co = y(
|
|
302
301
|
r,
|
|
303
|
-
|
|
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((
|
|
319
|
-
const
|
|
320
|
-
(
|
|
321
|
-
), H =
|
|
317
|
+
).map((mo, v) => {
|
|
318
|
+
const go = t.findIndex(
|
|
319
|
+
(Co) => Co.key === l[v].key
|
|
320
|
+
), H = l[v];
|
|
322
321
|
return {
|
|
323
|
-
...
|
|
322
|
+
...mo,
|
|
324
323
|
index: v + f,
|
|
325
324
|
name: H.name,
|
|
326
|
-
originalIndex:
|
|
325
|
+
originalIndex: go,
|
|
327
326
|
originalVisible: H.visible ?? !0,
|
|
328
327
|
// Propiedades específicas por vista dinámicamente
|
|
329
|
-
...
|
|
328
|
+
...G(e).dynamicOriginalProperty(
|
|
330
329
|
H
|
|
331
330
|
)
|
|
332
331
|
};
|
|
333
332
|
});
|
|
334
|
-
|
|
333
|
+
n[e].push(...co);
|
|
335
334
|
}
|
|
336
335
|
});
|
|
337
336
|
let o = !1;
|
|
338
337
|
if (V().forEach((e) => {
|
|
339
|
-
|
|
338
|
+
Go(
|
|
340
339
|
d(e),
|
|
341
|
-
|
|
340
|
+
n[e]
|
|
342
341
|
) || (o = !0);
|
|
343
342
|
}), !o)
|
|
344
343
|
return;
|
|
345
344
|
V().forEach((e) => {
|
|
346
|
-
C(e,
|
|
345
|
+
C(e, n[e]);
|
|
347
346
|
});
|
|
348
347
|
}
|
|
349
|
-
}, [
|
|
350
|
-
const
|
|
351
|
-
|
|
348
|
+
}, [t, r]);
|
|
349
|
+
const fo = (n) => {
|
|
350
|
+
so(n);
|
|
352
351
|
};
|
|
353
|
-
return /* @__PURE__ */
|
|
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:
|
|
361
|
-
rowsCount:
|
|
359
|
+
columnsWidths: oo,
|
|
360
|
+
rowsCount: ro,
|
|
362
361
|
currentRowHeightVariant: S.rowHVariant,
|
|
363
362
|
currentRowHeight: S.rowHeight,
|
|
364
363
|
currentRowHeaderHeight: S.rowHeaderHeight,
|
|
365
|
-
rows:
|
|
366
|
-
rowHeights:
|
|
367
|
-
checkedRows:
|
|
368
|
-
reorderable:
|
|
369
|
-
onChangeColumnsOrder:
|
|
370
|
-
onChangeColumnWidth:
|
|
371
|
-
setRowsCount:
|
|
372
|
-
rowActionsGetter:
|
|
373
|
-
setRowHeightVariant:
|
|
374
|
-
onCheckedRowsChange:
|
|
375
|
-
checkedRowsMultiple:
|
|
376
|
-
rowKeyGetter:
|
|
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:
|
|
381
|
-
setSortColumns:
|
|
379
|
+
sortColumns: lo,
|
|
380
|
+
setSortColumns: ao,
|
|
382
381
|
externalSortSettings: h,
|
|
383
382
|
externalFilterSettings: p,
|
|
384
|
-
classes:
|
|
385
|
-
size:
|
|
386
|
-
viewMode:
|
|
387
|
-
onViewModeChange:
|
|
383
|
+
classes: to,
|
|
384
|
+
size: P,
|
|
385
|
+
viewMode: Q,
|
|
386
|
+
onViewModeChange: Y,
|
|
388
387
|
cardsViewConfig: s,
|
|
389
388
|
listViewConfig: c
|
|
390
389
|
},
|
|
391
|
-
children:
|
|
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
|
|
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
|
-
* //
|
|
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
|
-
* //
|
|
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
|
|
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"}
|