@m4l/components 9.4.45 → 9.4.46

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 (146) hide show
  1. package/components/datagrids/Datagrid.styles.d.ts.map +1 -1
  2. package/components/datagrids/Datagrid.styles.js +358 -272
  3. package/components/datagrids/components/BaseDataGrid/BaseDataGrid.d.ts.map +1 -1
  4. package/components/datagrids/components/BaseDataGrid/BaseDataGrid.js +47 -45
  5. package/components/datagrids/contexts/DataGridContext/DataGridContext.d.ts.map +1 -1
  6. package/components/datagrids/contexts/DataGridContext/DataGridContext.js +237 -178
  7. package/components/datagrids/contexts/DataGridContext/types.d.ts +13 -4
  8. package/components/datagrids/contexts/DataGridContext/types.d.ts.map +1 -1
  9. package/components/datagrids/dictionary.d.ts +1 -0
  10. package/components/datagrids/dictionary.d.ts.map +1 -1
  11. package/components/datagrids/dictionary.js +1 -0
  12. package/components/datagrids/formatters/ColumnImageFormatter/ImageFormatterCell.d.ts.map +1 -1
  13. package/components/datagrids/formatters/ColumnImageFormatter/ImageFormatterCell.js +14 -14
  14. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.d.ts.map +1 -1
  15. package/components/datagrids/helpers/persistence/getViewMode/getViewMode.js +8 -8
  16. package/components/datagrids/helpers/shared/getAllViewModes/getAllViewModes.d.ts +2 -1
  17. package/components/datagrids/helpers/shared/getAllViewModes/getAllViewModes.d.ts.map +1 -1
  18. package/components/datagrids/helpers/shared/getAllViewModes/getAllViewModes.js +1 -1
  19. package/components/datagrids/helpers/shared/getViewSpecificConfig/getViewSpecificConfig.d.ts +2 -1
  20. package/components/datagrids/helpers/shared/getViewSpecificConfig/getViewSpecificConfig.d.ts.map +1 -1
  21. package/components/datagrids/helpers/shared/getViewSpecificConfig/getViewSpecificConfig.js +11 -4
  22. package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.d.ts +3 -2
  23. package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.d.ts.map +1 -1
  24. package/components/datagrids/helpers/shared/getViewSuffix/getViewSuffix.js +1 -1
  25. package/components/datagrids/helpers/shared/scrollToRowElement/index.d.ts +2 -0
  26. package/components/datagrids/helpers/shared/scrollToRowElement/index.d.ts.map +1 -0
  27. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts +10 -0
  28. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.d.ts.map +1 -0
  29. package/components/datagrids/helpers/shared/scrollToRowElement/scrollToRowElement.js +24 -0
  30. package/components/datagrids/hooks/useViewConfig/useViewConfig.d.ts.map +1 -1
  31. package/components/datagrids/hooks/useViewConfig/useViewConfig.js +11 -10
  32. package/components/datagrids/shared/LazyLoadItem/LazyLoadItem.d.ts +7 -0
  33. package/components/datagrids/shared/LazyLoadItem/LazyLoadItem.d.ts.map +1 -0
  34. package/components/datagrids/shared/LazyLoadItem/index.d.ts +3 -0
  35. package/components/datagrids/shared/LazyLoadItem/index.d.ts.map +1 -0
  36. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/IntersectItem.d.ts +7 -0
  37. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/IntersectItem.d.ts.map +1 -0
  38. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/index.d.ts +3 -0
  39. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/index.d.ts.map +1 -0
  40. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/types.d.ts +13 -0
  41. package/components/datagrids/shared/LazyLoadItem/subcomponents/IntersectItem/types.d.ts.map +1 -0
  42. package/components/datagrids/shared/LazyLoadItem/types.d.ts +12 -0
  43. package/components/datagrids/shared/LazyLoadItem/types.d.ts.map +1 -0
  44. package/components/datagrids/slots/DataGridEnum.d.ts +5 -1
  45. package/components/datagrids/slots/DataGridEnum.d.ts.map +1 -1
  46. package/components/datagrids/slots/DataGridEnum.js +3 -3
  47. package/components/datagrids/slots/DataGridSlot.d.ts +12 -0
  48. package/components/datagrids/slots/DataGridSlot.d.ts.map +1 -1
  49. package/components/datagrids/slots/DataGridSlot.js +105 -89
  50. package/components/datagrids/subcomponents/HeaderActions/HeaderActions.d.ts +3 -10
  51. package/components/datagrids/subcomponents/HeaderActions/HeaderActions.d.ts.map +1 -1
  52. package/components/datagrids/subcomponents/HeaderActions/HeaderActions.js +34 -33
  53. package/components/datagrids/subcomponents/HeaderActions/subcomponents/MobileMenuActions/MobileMenuActions.d.ts +1 -13
  54. package/components/datagrids/subcomponents/HeaderActions/subcomponents/MobileMenuActions/MobileMenuActions.d.ts.map +1 -1
  55. package/components/datagrids/subcomponents/HeaderActions/subcomponents/MobileMenuActions/MobileMenuActions.js +27 -26
  56. package/components/datagrids/subcomponents/HeaderActions/subcomponents/ViewMode/ViewMode.d.ts +3 -4
  57. package/components/datagrids/subcomponents/HeaderActions/subcomponents/ViewMode/ViewMode.d.ts.map +1 -1
  58. package/components/datagrids/subcomponents/HeaderActions/subcomponents/ViewMode/ViewMode.js +77 -47
  59. package/components/datagrids/tests/helpers/useListViewConfig.d.ts +12 -0
  60. package/components/datagrids/tests/helpers/useListViewConfig.d.ts.map +1 -0
  61. package/components/datagrids/types.d.ts +58 -0
  62. package/components/datagrids/types.d.ts.map +1 -1
  63. package/components/datagrids/views/CardsView/CardsView.js +14 -14
  64. package/components/datagrids/views/ListView/ListView.d.ts +8 -0
  65. package/components/datagrids/views/ListView/ListView.d.ts.map +1 -0
  66. package/components/datagrids/views/ListView/ListView.js +98 -0
  67. package/components/datagrids/views/ListView/hooks/useListContent/index.d.ts +2 -0
  68. package/components/datagrids/views/{CardsView/helpers/scrollToCardElement → ListView/hooks/useListContent}/index.d.ts.map +1 -1
  69. package/components/datagrids/views/ListView/hooks/useListContent/useListContent.d.ts +10 -0
  70. package/components/datagrids/views/ListView/hooks/useListContent/useListContent.d.ts.map +1 -0
  71. package/components/datagrids/views/ListView/hooks/useListContent/useListContent.js +112 -0
  72. package/components/datagrids/views/ListView/hooks/useListVirtualizer/index.d.ts +3 -0
  73. package/components/datagrids/views/ListView/hooks/useListVirtualizer/index.d.ts.map +1 -0
  74. package/components/datagrids/views/ListView/hooks/useListVirtualizer/types.d.ts +27 -0
  75. package/components/datagrids/views/ListView/hooks/useListVirtualizer/types.d.ts.map +1 -0
  76. package/components/datagrids/views/ListView/hooks/useListVirtualizer/useListVirtualizer.d.ts +19 -0
  77. package/components/datagrids/views/ListView/hooks/useListVirtualizer/useListVirtualizer.d.ts.map +1 -0
  78. package/components/datagrids/views/ListView/hooks/useListVirtualizer/useListVirtualizer.js +23 -0
  79. package/components/datagrids/views/ListView/hooks/useModalDetail/index.d.ts +3 -0
  80. package/components/datagrids/views/ListView/hooks/useModalDetail/index.d.ts.map +1 -0
  81. package/components/datagrids/views/ListView/hooks/useModalDetail/types.d.ts +20 -0
  82. package/components/datagrids/views/ListView/hooks/useModalDetail/types.d.ts.map +1 -0
  83. package/components/datagrids/views/ListView/hooks/useModalDetail/useModalDetail.d.ts +7 -0
  84. package/components/datagrids/views/ListView/hooks/useModalDetail/useModalDetail.d.ts.map +1 -0
  85. package/components/datagrids/views/ListView/hooks/useModalDetail/useModalDetail.js +72 -0
  86. package/components/datagrids/views/ListView/hooks/useProcessedColumns/index.d.ts +3 -0
  87. package/components/datagrids/views/ListView/hooks/useProcessedColumns/index.d.ts.map +1 -0
  88. package/components/datagrids/views/ListView/hooks/useProcessedColumns/types.d.ts +13 -0
  89. package/components/datagrids/views/ListView/hooks/useProcessedColumns/types.d.ts.map +1 -0
  90. package/components/datagrids/views/ListView/hooks/useProcessedColumns/useProcessedColumns.d.ts +49 -0
  91. package/components/datagrids/views/ListView/hooks/useProcessedColumns/useProcessedColumns.d.ts.map +1 -0
  92. package/components/datagrids/views/ListView/hooks/useProcessedColumns/useProcessedColumns.js +30 -0
  93. package/components/datagrids/views/ListView/index.d.ts +3 -0
  94. package/components/datagrids/views/ListView/index.d.ts.map +1 -0
  95. package/components/datagrids/views/ListView/subcomponents/ListDetail/ListDetail.d.ts +9 -0
  96. package/components/datagrids/views/ListView/subcomponents/ListDetail/ListDetail.d.ts.map +1 -0
  97. package/components/datagrids/views/ListView/subcomponents/ListDetail/ListDetail.js +113 -0
  98. package/components/datagrids/views/ListView/subcomponents/ListDetail/index.d.ts +3 -0
  99. package/components/datagrids/views/ListView/subcomponents/ListDetail/index.d.ts.map +1 -0
  100. package/components/datagrids/views/ListView/subcomponents/ListDetail/types.d.ts +39 -0
  101. package/components/datagrids/views/ListView/subcomponents/ListDetail/types.d.ts.map +1 -0
  102. package/components/datagrids/views/ListView/subcomponents/ListRow/ListRow.d.ts +12 -0
  103. package/components/datagrids/views/ListView/subcomponents/ListRow/ListRow.d.ts.map +1 -0
  104. package/components/datagrids/views/ListView/subcomponents/ListRow/ListRow.js +96 -0
  105. package/components/datagrids/views/ListView/subcomponents/ListRow/index.d.ts +3 -0
  106. package/components/datagrids/views/ListView/subcomponents/ListRow/index.d.ts.map +1 -0
  107. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/ListHeader.d.ts +8 -0
  108. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/ListHeader.d.ts.map +1 -0
  109. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/ListHeader.js +83 -0
  110. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/index.d.ts +3 -0
  111. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/index.d.ts.map +1 -0
  112. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/types.d.ts +14 -0
  113. package/components/datagrids/views/ListView/subcomponents/ListRow/subcomponents/ListHeader/types.d.ts.map +1 -0
  114. package/components/datagrids/views/ListView/subcomponents/ListRow/types.d.ts +81 -0
  115. package/components/datagrids/views/ListView/subcomponents/ListRow/types.d.ts.map +1 -0
  116. package/components/datagrids/views/ListView/subcomponents/Settings/Settings.d.ts +7 -0
  117. package/components/datagrids/views/ListView/subcomponents/Settings/Settings.d.ts.map +1 -0
  118. package/components/datagrids/views/ListView/subcomponents/Settings/Settings.js +24 -0
  119. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/index.d.ts +3 -0
  120. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/index.d.ts.map +1 -0
  121. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/types.d.ts +5 -0
  122. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/types.d.ts.map +1 -0
  123. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.d.ts +7 -0
  124. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.d.ts.map +1 -0
  125. package/components/datagrids/views/ListView/subcomponents/Settings/hooks/useModalSettings/useModalSettings.js +62 -0
  126. package/components/datagrids/views/ListView/subcomponents/Settings/index.d.ts +3 -0
  127. package/components/datagrids/views/ListView/subcomponents/Settings/index.d.ts.map +1 -0
  128. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/ColumnsConfig.d.ts +3 -0
  129. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/ColumnsConfig.d.ts.map +1 -0
  130. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/ColumnsConfig.js +253 -0
  131. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/index.d.ts +3 -0
  132. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/index.d.ts.map +1 -0
  133. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts +32 -0
  134. package/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts.map +1 -0
  135. package/components/datagrids/views/ListView/subcomponents/Settings/types.d.ts +5 -0
  136. package/components/datagrids/views/ListView/subcomponents/Settings/types.d.ts.map +1 -0
  137. package/components/datagrids/views/ListView/types.d.ts +7 -0
  138. package/components/datagrids/views/ListView/types.d.ts.map +1 -0
  139. package/components/datagrids/views/adapters/RenderContent/RenderContent.d.ts +2 -1
  140. package/components/datagrids/views/adapters/RenderContent/RenderContent.d.ts.map +1 -1
  141. package/components/datagrids/views/adapters/RenderContent/RenderContent.js +7 -6
  142. package/package.json +7 -6
  143. package/components/datagrids/views/CardsView/helpers/scrollToCardElement/index.d.ts +0 -2
  144. package/components/datagrids/views/CardsView/helpers/scrollToCardElement/scrollToCardElement.d.ts +0 -10
  145. package/components/datagrids/views/CardsView/helpers/scrollToCardElement/scrollToCardElement.d.ts.map +0 -1
  146. package/components/datagrids/views/CardsView/helpers/scrollToCardElement/scrollToCardElement.js +0 -24
@@ -0,0 +1,253 @@
1
+ import { jsxs as I, jsx as i } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as $, useRef as x, useState as p, useImperativeHandle as q, useMemo as _, useEffect as J } from "react";
3
+ import { useModuleDictionary as Q } from "@m4l/core";
4
+ import X from "react-data-grid";
5
+ import { ColumnsConfigWrapperStyled as Z, ColumnsConfigDataGridStyled as ee, ColumnsConfigSelColumnsStyled as ne, TableWrapperDataGridStyled as te, ColumnsConfigActiosStyled as oe } from "../../../../../../slots/DataGridSlot.js";
6
+ import { DICTIONARY as a } from "../../../../../../dictionary.js";
7
+ import { ArrowChevronUpOutlined as ie, ArrowChevronMdUpOutlined as le, ArrowChevronDownOutlined as re, ArrowChevronMdDownOutlined as se, ActionsMultiCheckOutlined as ae, ActionsCheckIndeterminateOutlined as de, ArrowRestoreOutlined as ce } from "@m4l/icons";
8
+ import { IconButton as c } from "../../../../../../../extended/mui/IconButton/IconButton.js";
9
+ import { ColumnInteractiveCheckFormatter as E } from "../../../../../../formatters/ColumnInteractiveCheckFormatter/formatter.js";
10
+ function R(u, w) {
11
+ return u.filter((l) => !l.hidden).map(
12
+ (l) => ({
13
+ key: l.key,
14
+ name: w?.find((h) => h.key === l.key)?.name ?? "",
15
+ visible: l.visible === void 0 ? !0 : l.visible,
16
+ showTitle: l.showTitle === void 0 ? !0 : l.showTitle,
17
+ originalIndex: l.originalIndex,
18
+ originalVisible: l.originalVisible,
19
+ originalShowTitle: l.originalShowTitle
20
+ })
21
+ );
22
+ }
23
+ const f = (u) => {
24
+ const w = u !== void 0 ? `rdg-cell-align-${u}` : "";
25
+ return {
26
+ cellClass: w,
27
+ headerCellClass: w
28
+ };
29
+ }, ue = $(
30
+ (u, w) => {
31
+ const l = x(null), {
32
+ onCloseSettings: h,
33
+ columnsConfig: m,
34
+ onChangeColumnsConfig: N,
35
+ rowHeight: O,
36
+ classes: A,
37
+ size: T,
38
+ columns: k
39
+ } = u, { getLabel: s } = Q(), [L, M] = p(!0), [t, d] = p(
40
+ R(m, k)
41
+ ), [C, G] = p(
42
+ () => /* @__PURE__ */ new Set()
43
+ ), b = x(null);
44
+ q(w, () => ({
45
+ onClickIntro: H,
46
+ current: b.current
47
+ }));
48
+ const V = _(
49
+ () => [
50
+ {
51
+ key: "name",
52
+ name: s(a.SETTINGS_COLUMN_NAME),
53
+ width: 220,
54
+ resizable: !0,
55
+ type: "string",
56
+ ...f("left")
57
+ },
58
+ {
59
+ key: "visible",
60
+ name: s(a.SETTINGS_COLUMN_VISIBLE),
61
+ width: 80,
62
+ type: "boolean",
63
+ renderCell: E,
64
+ ...f("center")
65
+ },
66
+ {
67
+ key: "showTitle",
68
+ name: s(a.SETTINGS_COLUMN_SHOW_TITLE),
69
+ width: 100,
70
+ type: "boolean",
71
+ renderCell: E,
72
+ ...f("center")
73
+ }
74
+ ],
75
+ [s]
76
+ ), D = () => {
77
+ d(t.map((e) => ({ ...e, visible: !0 })));
78
+ }, U = () => {
79
+ d(t.map((e) => ({ ...e, visible: !1 })));
80
+ }, F = () => {
81
+ d(
82
+ t.map((e) => ({
83
+ ...e,
84
+ visible: e.originalVisible,
85
+ showTitle: e.originalShowTitle,
86
+ index: e.originalIndex
87
+ })).sort((e, n) => e.index - n.index)
88
+ );
89
+ };
90
+ J(() => {
91
+ L === !1 && d(R(m, k)), M(!1);
92
+ }, [m]);
93
+ const o = _(() => {
94
+ let e = -1;
95
+ if (C.size !== 1)
96
+ return e;
97
+ const r = C.entries().next().value?.[1];
98
+ return e = t.findIndex((S) => S.key === r), e;
99
+ }, [t, C]), B = () => {
100
+ if (o === -1)
101
+ return -1;
102
+ const e = [...t];
103
+ e.splice(o, 1), e.splice(0, 0, t[o]), l.current?.selectCell({ idx: 0, rowIdx: 0 }), d(e);
104
+ }, W = () => {
105
+ if (o === -1)
106
+ return -1;
107
+ const e = [...t];
108
+ e.splice(o, 1), e.splice(e.length, 0, t[o]), l.current?.selectCell({ idx: 0, rowIdx: e.length - 1 }), d(e);
109
+ }, y = (e) => {
110
+ if (o === -1)
111
+ return -1;
112
+ const n = [...t], r = n[o];
113
+ n.splice(o, 1), n.splice(o + e, 0, r), l.current?.selectCell({
114
+ idx: 0,
115
+ rowIdx: o + e
116
+ }), d(n);
117
+ }, z = (e) => {
118
+ const n = t.findIndex((r) => r.key === e);
119
+ if (n > -1)
120
+ return {
121
+ visible: t[n].visible,
122
+ showTitle: t[n].showTitle
123
+ };
124
+ }, g = (e) => {
125
+ const n = t.findIndex((r) => r.key === e.key);
126
+ return n > -1 ? n : m.findIndex(
127
+ (r) => r.key === e.key
128
+ );
129
+ }, H = () => {
130
+ const e = m.map((n) => {
131
+ const r = { ...n };
132
+ if (!n.hidden) {
133
+ const S = z(n.key);
134
+ S && (r.visible = S.visible, r.showTitle = S.showTitle);
135
+ const v = t.findIndex(
136
+ (Y) => Y.key === n.key
137
+ );
138
+ v > -1 && (r.index = v);
139
+ }
140
+ return r;
141
+ }).sort((n, r) => g(n) - g(r));
142
+ N(e), h();
143
+ }, j = () => {
144
+ }, K = (e) => {
145
+ d(e);
146
+ }, P = ({ row: e }) => {
147
+ if (C.has(e.key))
148
+ return;
149
+ const n = /* @__PURE__ */ new Set([e.key]);
150
+ G(n);
151
+ };
152
+ return /* @__PURE__ */ I(Z, { ownerState: {}, ref: b, children: [
153
+ /* @__PURE__ */ I(ee, { ownerState: {}, children: [
154
+ /* @__PURE__ */ i(ne, { ownerState: { size: T }, children: s(a.SETTINGS_SEL_COLUMNS) }),
155
+ /* @__PURE__ */ i(
156
+ te,
157
+ {
158
+ className: A?.tableWrapperDataGrid,
159
+ ownerState: { size: T },
160
+ children: /* @__PURE__ */ i(
161
+ X,
162
+ {
163
+ ref: l,
164
+ rowHeight: O,
165
+ columns: V,
166
+ rows: t,
167
+ onRowsChange: K,
168
+ selectedRows: C,
169
+ onSelectedRowsChange: j,
170
+ onCellClick: P,
171
+ rowKeyGetter: (e) => e.key,
172
+ defaultColumnOptions: { resizable: !0, sortable: !0 }
173
+ }
174
+ )
175
+ }
176
+ )
177
+ ] }),
178
+ /* @__PURE__ */ I(oe, { ownerState: {}, children: [
179
+ /* @__PURE__ */ i(
180
+ c,
181
+ {
182
+ tooltip: s(a.SETTINGS_MOVE_FIRST),
183
+ onClick: B,
184
+ "aria-label": "move first place",
185
+ disabled: o < 1,
186
+ icon: /* @__PURE__ */ i(ie, {})
187
+ }
188
+ ),
189
+ /* @__PURE__ */ i(
190
+ c,
191
+ {
192
+ tooltip: s(a.SETTINGS_MOVE_UP),
193
+ onClick: () => y(-1),
194
+ "aria-label": "move up place",
195
+ disabled: o < 1,
196
+ icon: /* @__PURE__ */ i(le, {})
197
+ }
198
+ ),
199
+ /* @__PURE__ */ i(
200
+ c,
201
+ {
202
+ tooltip: s(a.SETTINGS_MOVE_LAST),
203
+ onClick: W,
204
+ "aria-label": "move last place",
205
+ disabled: o === t.length - 1 || o === -1,
206
+ icon: /* @__PURE__ */ i(re, {})
207
+ }
208
+ ),
209
+ /* @__PURE__ */ i(
210
+ c,
211
+ {
212
+ tooltip: s(a.SETTINGS_MOVE_DOWN),
213
+ onClick: () => y(1),
214
+ "aria-label": "move down place",
215
+ disabled: o === t.length - 1 || o === -1,
216
+ icon: /* @__PURE__ */ i(se, {})
217
+ }
218
+ ),
219
+ /* @__PURE__ */ i(
220
+ c,
221
+ {
222
+ tooltip: s(a.SETTINGS_VISIBLE_ALL),
223
+ onClick: D,
224
+ "aria-label": "check visible all",
225
+ icon: /* @__PURE__ */ i(ae, {})
226
+ }
227
+ ),
228
+ /* @__PURE__ */ i(
229
+ c,
230
+ {
231
+ tooltip: s(a.SETTINGS_NO_VISIBLE_ALL),
232
+ onClick: U,
233
+ "aria-label": "un check all",
234
+ icon: /* @__PURE__ */ i(de, {})
235
+ }
236
+ ),
237
+ /* @__PURE__ */ i(
238
+ c,
239
+ {
240
+ tooltip: s(a.SETTINGS_RESTORE),
241
+ onClick: F,
242
+ "aria-label": "Restore columns",
243
+ icon: /* @__PURE__ */ i(ce, {})
244
+ }
245
+ )
246
+ ] })
247
+ ] });
248
+ }
249
+ );
250
+ ue.displayName = "ListViewColumnsConfig";
251
+ export {
252
+ ue as ColumnsConfig
253
+ };
@@ -0,0 +1,3 @@
1
+ export * from './ColumnsConfig';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/components/src/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { DataGridContextProps, IViewConfig } from '../../../../../../contexts/DataGridContext/types';
2
+ import { GridProps } from '../../../../../../types';
3
+ import { Column } from 'react-data-grid';
4
+ export interface Row {
5
+ key: string;
6
+ name: string;
7
+ visible: boolean;
8
+ showTitle: boolean;
9
+ width: number;
10
+ index: number;
11
+ originalIndex: number;
12
+ originalVisible: boolean;
13
+ originalShowTitle: boolean;
14
+ }
15
+ export type ColumnsConfigRef = {
16
+ onClickIntro: () => void;
17
+ current: HTMLDivElement | null;
18
+ };
19
+ export interface ConfigProps {
20
+ onCloseSettings: () => void;
21
+ columns: readonly Column<any, any>[];
22
+ columnsConfig: IViewConfig[];
23
+ onChangeColumnsConfig: (newColumnsConfig: IViewConfig[]) => void;
24
+ rowHeight: number;
25
+ classes: DataGridContextProps<unknown, unknown>['classes'];
26
+ size: GridProps<unknown, unknown>['size'];
27
+ }
28
+ export interface CheckFormatterProps {
29
+ key: string;
30
+ row: any;
31
+ }
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../../packages/components/src/components/datagrids/views/ListView/subcomponents/Settings/subcomponents/ColumnsConfig/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,WAAW,EACZ,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACrC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,qBAAqB,EAAE,CAAC,gBAAgB,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3D,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV"}
@@ -0,0 +1,5 @@
1
+ import { Column } from 'react-data-grid';
2
+ export interface SettingsProps {
3
+ columns: readonly Column<any, any>[];
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/ListView/subcomponents/Settings/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CACtC"}
@@ -0,0 +1,7 @@
1
+ import { GridProps, RowKey } from '../../types';
2
+ /**
3
+ * Props for the ListView component.
4
+ * Same shape as GridProps; uses listViewConfig from context.
5
+ */
6
+ export type ListViewProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> = GridProps<TRow, TSummaryRow, TKey>;
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/ListView/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,aAAa,CACvB,IAAI,EACJ,WAAW,EACX,IAAI,SAAS,MAAM,GAAG,MAAM,IAC1B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { GridProps, RowKey } from '../../../types';
2
2
  /**
3
- * Componente que renderiza el contenido del DataGrid en formato de tarjetas o tabla, depende del viewMode.
3
+ * Renders DataGrid content based on viewMode: table, cards, or list.
4
+ * List view is independent and uses listViewConfig (columnsConfig or customRender).
4
5
  */
5
6
  export declare function RenderContent<TRow, TSummaryRow, TKey extends RowKey = RowKey>(props: GridProps<TRow, TSummaryRow, TKey>): import("@emotion/react/jsx-runtime").JSX.Element;
6
7
  //# sourceMappingURL=RenderContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderContent.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/views/adapters/RenderContent/RenderContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAInD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAC3E,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAY1C"}
1
+ {"version":3,"file":"RenderContent.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/components/src/components/datagrids/views/adapters/RenderContent/RenderContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAKnD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAC3E,KAAK,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAa1C"}
@@ -1,10 +1,11 @@
1
- import { jsx as r, Fragment as o } from "@emotion/react/jsx-runtime";
2
- import { TableView as i } from "../../TableView/TableView.js";
1
+ import { jsx as r } from "@emotion/react/jsx-runtime";
2
+ import { ListView as n } from "../../ListView/ListView.js";
3
+ import { TableView as f } from "../../TableView/TableView.js";
3
4
  import { CardsView as m } from "../../CardsView/CardsView.js";
4
- import { useDataGrid as n } from "../../../hooks/shared/useDataGrid/useDataGrid.js";
5
- function l(e) {
6
- const { viewMode: t } = n();
7
- return /* @__PURE__ */ r(o, { children: t === "table" ? /* @__PURE__ */ r(i, { ...e }) : /* @__PURE__ */ r(m, { ...e }) });
5
+ import { useDataGrid as a } from "../../../hooks/shared/useDataGrid/useDataGrid.js";
6
+ function l(i) {
7
+ const { viewMode: t, listViewConfig: e, cardsViewConfig: o } = a();
8
+ return t === "table" ? /* @__PURE__ */ r(f, { ...i }) : t === "list" && e ? /* @__PURE__ */ r(n, { ...i, listViewConfig: e }) : /* @__PURE__ */ r(m, { ...i, cardsViewConfig: o });
8
9
  }
9
10
  export {
10
11
  l as RenderContent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.4.45",
3
+ "version": "9.4.46",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,20 +52,21 @@
52
52
  "nprogress": "^0.2.0",
53
53
  "date-fns": "^2.30.0",
54
54
  "react-transition-group": "^4.4.5",
55
- "react-dropzone": "^14.2.2",
56
55
  "react-spinners": "^0.13.8",
57
- "react-rnd": "^10.5.2",
58
56
  "react-draggable": "^4.4.5",
57
+ "react-dropzone": "^14.2.2",
58
+ "react-rnd": "^10.5.2",
59
59
  "chart.js": "^4.4.0",
60
60
  "chartjs-chart-error-bars": "^4.3.3",
61
61
  "qrcode.react": "^3.1.0",
62
- "react-color": "^2.19.3",
62
+ "simplebar-react": "3.2.6",
63
63
  "@mui/x-date-pickers": "6.20.2",
64
+ "react-color": "^2.19.3",
64
65
  "react-resizable-panels": "^2.1.8",
65
- "simplebar-react": "3.2.6",
66
66
  "react-data-grid": "7.0.0-beta.47",
67
67
  "react-dnd": "^16.0.1",
68
68
  "react-dnd-html5-backend": "^16.0.1",
69
- "react-resizable": "^3.0.4"
69
+ "react-resizable": "^3.0.4",
70
+ "@tanstack/react-virtual": "3.13.23"
70
71
  }
71
72
  }
@@ -1,2 +0,0 @@
1
- export * from './scrollToCardElement';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Helper para hacer scroll a una card por su key.
3
- * Busca el elemento en el DOM usando querySelector y hace scrollIntoView.
4
- * @param containerElement - Elemento contenedor que tiene scroll
5
- * @param rowKey - Key de la fila/card a la que hacer scroll
6
- * @param selectorType - Tipo de selector: 'class' o 'data-attribute'
7
- * @param selectorName - Nombre de la clase o atributo base
8
- */
9
- export declare function scrollToCardElement(containerElement: HTMLElement | null, rowKey: string | number, selectorType?: 'class' | 'data-attribute', selectorName?: string): void;
10
- //# sourceMappingURL=scrollToCardElement.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scrollToCardElement.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/datagrids/views/CardsView/helpers/scrollToCardElement/scrollToCardElement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,WAAW,GAAG,IAAI,EACpC,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,YAAY,GAAE,OAAO,GAAG,gBAAmC,EAC3D,YAAY,SAAiB,GAC5B,IAAI,CA+BN"}
@@ -1,24 +0,0 @@
1
- function c(o, e, t = "data-attribute", l = "data-row-key") {
2
- if (!o) {
3
- console.warn("scrollToCardElement: containerElement is null");
4
- return;
5
- }
6
- try {
7
- const r = t === "class" ? `.${l}-${e}` : `[${l}="${e}"]`, n = o.querySelector(r);
8
- if (!n) {
9
- console.warn(
10
- `scrollToCardElement: No se encontró card con selector "${r}"`
11
- );
12
- return;
13
- }
14
- n.scrollIntoView({
15
- behavior: "smooth",
16
- block: "end"
17
- });
18
- } catch (r) {
19
- console.error("scrollToCardElement: Error al hacer scroll", r);
20
- }
21
- }
22
- export {
23
- c as scrollToCardElement
24
- };