@m4l/components 9.4.36 → 9.4.37
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"CardsView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/CardsView/CardsView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,2DAsK/C"}
|
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef as R, useMemo as E, useEffect as b } from "react";
|
|
3
3
|
import { CardsContainerStyled as S } from "../../slots/DataGridSlot.js";
|
|
4
|
-
import { ContainerFlow as
|
|
5
|
-
import { CardRow as
|
|
4
|
+
import { ContainerFlow as K } from "../../../ContainerFlow/ContainerFlow.js";
|
|
5
|
+
import { CardRow as D } from "./subcomponents/CardRow/CardRow.js";
|
|
6
6
|
import { useProcessedColumns as x } from "./hooks/useProcessedColumns/useProcessedColumns.js";
|
|
7
|
-
import { calculateCardHeight as
|
|
7
|
+
import { calculateCardHeight as F } from "./helpers/calculateCardHeight/calculateCardHeight.js";
|
|
8
8
|
import { useModalDetail as I } from "./hooks/useModalDetail/useModalDetail.js";
|
|
9
|
-
import { scrollToCardElement as
|
|
9
|
+
import { scrollToCardElement as M } from "./helpers/scrollToCardElement/scrollToCardElement.js";
|
|
10
10
|
function q(y) {
|
|
11
11
|
const {
|
|
12
|
-
rows:
|
|
12
|
+
rows: i,
|
|
13
13
|
columns: f,
|
|
14
|
-
rowKeyGetter:
|
|
15
|
-
selectedRows:
|
|
14
|
+
rowKeyGetter: s,
|
|
15
|
+
selectedRows: v,
|
|
16
16
|
onSelectedRowsChange: a,
|
|
17
|
-
onRowsChange:
|
|
17
|
+
onRowsChange: C,
|
|
18
18
|
cardsViewConfig: e,
|
|
19
|
-
focusOnRowKey:
|
|
20
|
-
checkedRows:
|
|
21
|
-
onCheckedRowsChange:
|
|
22
|
-
} = y, w = R(null),
|
|
19
|
+
focusOnRowKey: n,
|
|
20
|
+
checkedRows: d,
|
|
21
|
+
onCheckedRowsChange: h
|
|
22
|
+
} = y, w = R(null), u = R(void 0), c = x(f), p = x(f, {
|
|
23
23
|
applyVisibilityFilter: !1
|
|
24
|
-
}),
|
|
24
|
+
}), k = I({
|
|
25
25
|
columns: p,
|
|
26
|
-
onRowsChange:
|
|
27
|
-
rows:
|
|
26
|
+
onRowsChange: C,
|
|
27
|
+
rows: i
|
|
28
28
|
}), g = E(() => {
|
|
29
|
-
const
|
|
29
|
+
const t = c.reduce((r, o) => {
|
|
30
30
|
const l = o.renderCell?.__imageFormatterHeight;
|
|
31
|
-
return l ?
|
|
31
|
+
return l ? r + l : r;
|
|
32
32
|
}, 0);
|
|
33
|
-
return
|
|
33
|
+
return F({
|
|
34
34
|
visibleColumnsCount: c.length,
|
|
35
35
|
customMinHeight: e?.customRender?.minHeight
|
|
36
|
-
}) +
|
|
36
|
+
}) + t;
|
|
37
37
|
}, [c, e]);
|
|
38
38
|
return b(() => {
|
|
39
|
-
if (!
|
|
40
|
-
|
|
39
|
+
if (!n) {
|
|
40
|
+
u.current = void 0;
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
if (
|
|
44
|
-
(o) =>
|
|
43
|
+
if (u.current === n || i.findIndex(
|
|
44
|
+
(o) => s(o) === n
|
|
45
45
|
) === -1)
|
|
46
46
|
return;
|
|
47
|
-
const
|
|
47
|
+
const r = setTimeout(() => {
|
|
48
48
|
const o = w.current;
|
|
49
49
|
if (!o) {
|
|
50
50
|
console.warn("container es null, abortando scroll");
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
M(
|
|
54
54
|
o,
|
|
55
|
-
|
|
55
|
+
n,
|
|
56
56
|
"data-attribute",
|
|
57
57
|
"data-row-key"
|
|
58
|
-
), a && a(/* @__PURE__ */ new Set([
|
|
58
|
+
), a && a(/* @__PURE__ */ new Set([n])), u.current = n;
|
|
59
59
|
}, 300);
|
|
60
|
-
return () => clearTimeout(
|
|
61
|
-
}, [
|
|
62
|
-
const o =
|
|
60
|
+
return () => clearTimeout(r);
|
|
61
|
+
}, [n, i, s, g, a]), c.length === 0 ? null : /* @__PURE__ */ m(S, { ownerState: {}, "data-testid": "cards-container", ref: w, children: /* @__PURE__ */ m(K, { variant: "grid-layout", minWidth: 280, children: i.map((t, r) => {
|
|
62
|
+
const o = s(t), l = d?.has(o) || !1, H = d !== void 0 && h !== void 0;
|
|
63
63
|
return /* @__PURE__ */ m(
|
|
64
|
-
|
|
64
|
+
D,
|
|
65
65
|
{
|
|
66
|
-
row:
|
|
67
|
-
rows:
|
|
68
|
-
rowIndex:
|
|
66
|
+
row: t,
|
|
67
|
+
rows: i,
|
|
68
|
+
rowIndex: r,
|
|
69
69
|
columns: c,
|
|
70
70
|
originalColumns: p,
|
|
71
|
-
rowKeyGetter:
|
|
72
|
-
selectedRows:
|
|
71
|
+
rowKeyGetter: s,
|
|
72
|
+
selectedRows: v,
|
|
73
73
|
onSelectedRowsChange: a,
|
|
74
|
-
onRowsChange:
|
|
74
|
+
onRowsChange: C,
|
|
75
75
|
customRender: e?.customRender,
|
|
76
76
|
minHeight: g,
|
|
77
77
|
isChecked: l,
|
|
78
|
-
showCheckbox:
|
|
79
|
-
checkedRows:
|
|
80
|
-
onCheckedRowsChange:
|
|
81
|
-
onOpenDetail:
|
|
78
|
+
showCheckbox: H,
|
|
79
|
+
checkedRows: d,
|
|
80
|
+
onCheckedRowsChange: h,
|
|
81
|
+
onOpenDetail: k,
|
|
82
82
|
showExpandButton: e && "columnsConfig" in e ? e.showExpandButton : void 0,
|
|
83
83
|
onExpandClick: e && "columnsConfig" in e ? e.onExpandClick : void 0
|
|
84
84
|
},
|
|
85
|
-
|
|
85
|
+
s(t)
|
|
86
86
|
);
|
|
87
87
|
}) }) });
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/TableView/TableView.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAmBrD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"TableView.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/datagrids/views/TableView/TableView.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAmBrD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,oDAiX/C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as c, jsxs as Z } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useMemo as h, useState as P, useRef as W, useEffect as R } from "react";
|
|
3
3
|
import ee, { TreeDataGrid as oe } from "react-data-grid";
|
|
4
4
|
import { DndProvider as re } from "react-dnd";
|
|
5
5
|
import { HTML5Backend as te } from "react-dnd-html5-backend";
|
|
6
6
|
import { CheckboxFormatter as ne } from "./subcomponents/CheckboxFormatter/CheckboxFormatter.js";
|
|
7
|
-
import { filterHeight as
|
|
7
|
+
import { filterHeight as F } from "./subcomponents/SelectColumn/SelectColumn.js";
|
|
8
8
|
import { useSortColumnsRows as le } from "./hooks/useSortColumnsRows/useSortColumnsRows.js";
|
|
9
9
|
import { useFilters as ie } from "../../hooks/shared/useFilters/useFilters.js";
|
|
10
10
|
import { useDataGrid as se } from "../../hooks/shared/useDataGrid/useDataGrid.js";
|
|
@@ -23,31 +23,31 @@ import "../../../Icon/constants.js";
|
|
|
23
23
|
import "../../../Icon/slots/IconSlots.js";
|
|
24
24
|
import { getGroupBy as de } from "./helpers/getGroupBy/getGroupBy.js";
|
|
25
25
|
import { defaultRowGrouper as fe } from "./helpers/defaultRowGrouper/defaultRowGrouper.js";
|
|
26
|
-
import { createRowCellsBackgroundMap as pe, processColumnsWithRowCellsBackground as
|
|
27
|
-
import { getDefaultAction as
|
|
26
|
+
import { createRowCellsBackgroundMap as pe, processColumnsWithRowCellsBackground as Ce } from "./helpers/rowCellsBackground/rowCellsBackground.js";
|
|
27
|
+
import { getDefaultAction as he } from "../../helpers/shared/getDefaultAction/getDefaultAction.js";
|
|
28
28
|
function qe(z) {
|
|
29
29
|
const {
|
|
30
30
|
columns: L,
|
|
31
31
|
rows: $,
|
|
32
32
|
onRowsChange: y,
|
|
33
33
|
rowKeyGetter: r,
|
|
34
|
-
selectedRows:
|
|
34
|
+
selectedRows: u,
|
|
35
35
|
onSelectedRowsChange: t,
|
|
36
36
|
defaultColumnOptions: j,
|
|
37
|
-
focusOnRowKey:
|
|
38
|
-
rowCellsBackground:
|
|
39
|
-
treeProps:
|
|
37
|
+
focusOnRowKey: n,
|
|
38
|
+
rowCellsBackground: a,
|
|
39
|
+
treeProps: l,
|
|
40
40
|
...b
|
|
41
|
-
} = z, k = (e) => /* @__PURE__ */
|
|
41
|
+
} = z, k = (e) => /* @__PURE__ */ c(
|
|
42
42
|
ne,
|
|
43
43
|
{
|
|
44
44
|
...e,
|
|
45
45
|
tabIndex: e.tabIndex
|
|
46
46
|
}
|
|
47
|
-
), { finalColumns:
|
|
47
|
+
), { finalColumns: i, finalRows: s } = le(
|
|
48
48
|
L,
|
|
49
49
|
$,
|
|
50
|
-
|
|
50
|
+
h(
|
|
51
51
|
() => ({
|
|
52
52
|
/**
|
|
53
53
|
* Función que abre el menú de acciones para una columna
|
|
@@ -68,31 +68,31 @@ function qe(z) {
|
|
|
68
68
|
currentRowHeaderHeight: p,
|
|
69
69
|
currentRowHeightVariant: g,
|
|
70
70
|
size: V,
|
|
71
|
-
sortColumns:
|
|
72
|
-
setSortColumns:
|
|
73
|
-
columnsConfig:
|
|
71
|
+
sortColumns: m,
|
|
72
|
+
setSortColumns: v,
|
|
73
|
+
columnsConfig: H,
|
|
74
74
|
rowActionsGetter: I
|
|
75
|
-
} = se(), _ =
|
|
76
|
-
if (
|
|
77
|
-
return typeof
|
|
78
|
-
}, [
|
|
79
|
-
() =>
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
} = se(), _ = h(() => l ? de(H) : [], [H, l]), J = l?.rowGrouper ?? fe, D = h(() => {
|
|
76
|
+
if (a)
|
|
77
|
+
return typeof a == "function" ? a : pe(a);
|
|
78
|
+
}, [a]), T = h(
|
|
79
|
+
() => Ce(
|
|
80
|
+
i,
|
|
81
|
+
D,
|
|
82
82
|
r,
|
|
83
83
|
g
|
|
84
84
|
),
|
|
85
|
-
[
|
|
86
|
-
),
|
|
85
|
+
[i, D, r, g]
|
|
86
|
+
), d = W(null), [C, A] = P({
|
|
87
87
|
anchorEl: null,
|
|
88
88
|
columnKey: null
|
|
89
|
-
}), x =
|
|
90
|
-
Q && (
|
|
89
|
+
}), x = W(void 0), [Q, B] = P(!1), E = (e) => {
|
|
90
|
+
Q && (v(e), B(!1));
|
|
91
91
|
}, U = (e) => {
|
|
92
|
-
B(!0),
|
|
92
|
+
B(!0), v(e);
|
|
93
93
|
}, K = ({ row: e }) => {
|
|
94
|
-
if (
|
|
95
|
-
if (
|
|
94
|
+
if (u && t) {
|
|
95
|
+
if (u.entries().next().value && u.entries().next().value?.[1] === r(e))
|
|
96
96
|
return;
|
|
97
97
|
const o = /* @__PURE__ */ new Set([r(e)]);
|
|
98
98
|
t(o);
|
|
@@ -100,65 +100,65 @@ function qe(z) {
|
|
|
100
100
|
}, M = ({ row: e }) => {
|
|
101
101
|
if (!I)
|
|
102
102
|
return;
|
|
103
|
-
const o = I(e),
|
|
104
|
-
|
|
103
|
+
const o = I(e), f = he(o);
|
|
104
|
+
f?.onClick && f.onClick(e);
|
|
105
105
|
};
|
|
106
106
|
R(() => {
|
|
107
107
|
let e = 0;
|
|
108
|
-
for (const o of
|
|
109
|
-
const
|
|
108
|
+
for (const o of i) {
|
|
109
|
+
const f = m.findIndex(
|
|
110
110
|
(Y) => o.key === Y.columnKey
|
|
111
111
|
);
|
|
112
|
-
|
|
112
|
+
f !== -1 ? d.current?.element?.querySelector(
|
|
113
113
|
`[role="columnheader"][aria-colindex="${e + 1}"]`
|
|
114
|
-
)?.setAttribute("aria-columnsort", `${
|
|
114
|
+
)?.setAttribute("aria-columnsort", `${m[f].direction}`) : d.current?.element?.querySelector(
|
|
115
115
|
`[role="columnheader"][aria-colindex="${e + 1}"]`
|
|
116
116
|
)?.removeAttribute("aria-columnsort"), e++;
|
|
117
117
|
}
|
|
118
|
-
}, [
|
|
119
|
-
N(
|
|
120
|
-
}, [
|
|
121
|
-
if (!
|
|
122
|
-
x.current =
|
|
118
|
+
}, [m, i]), R(() => {
|
|
119
|
+
N(s.length);
|
|
120
|
+
}, [s]), R(() => {
|
|
121
|
+
if (!n) {
|
|
122
|
+
x.current = void 0;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
if (x.current)
|
|
125
|
+
if (x.current === n)
|
|
126
126
|
return;
|
|
127
|
-
const e =
|
|
128
|
-
(o) => r(o) ===
|
|
127
|
+
const e = s.findIndex(
|
|
128
|
+
(o) => r(o) === n
|
|
129
129
|
);
|
|
130
|
-
e !== -1 && (
|
|
131
|
-
}, [
|
|
130
|
+
e !== -1 && (d.current?.scrollToCell({ rowIdx: e }), t && t(/* @__PURE__ */ new Set([n])), x.current = n);
|
|
131
|
+
}, [n, s, r, t]);
|
|
132
132
|
const O = (e, o) => {
|
|
133
|
-
q(
|
|
133
|
+
q(i[e].key, o);
|
|
134
134
|
}, S = {
|
|
135
135
|
resizable: !0,
|
|
136
136
|
sortable: !0,
|
|
137
137
|
...j || {}
|
|
138
138
|
}, X = ae(
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
C.columnKey,
|
|
140
|
+
i,
|
|
141
141
|
!!S.sortable,
|
|
142
142
|
U
|
|
143
143
|
);
|
|
144
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ c(ce, { ownerState: {}, id: "WrapperTable", children: /* @__PURE__ */ Z(
|
|
145
145
|
ue,
|
|
146
146
|
{
|
|
147
147
|
ownerState: { size: V, currentRowHeightVariant: g, currentRowHeight: w },
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ c(re, { backend: te, context: window, children: l ? /* @__PURE__ */ c(
|
|
150
150
|
oe,
|
|
151
151
|
{
|
|
152
152
|
className: "rdg-light",
|
|
153
|
-
ref:
|
|
154
|
-
headerRowHeight: G ? p +
|
|
155
|
-
columns:
|
|
156
|
-
sortColumns:
|
|
153
|
+
ref: d,
|
|
154
|
+
headerRowHeight: G ? p + F : p,
|
|
155
|
+
columns: T,
|
|
156
|
+
sortColumns: m,
|
|
157
157
|
onSortColumnsChange: E,
|
|
158
158
|
onColumnResize: O,
|
|
159
|
-
rows:
|
|
159
|
+
rows: s,
|
|
160
160
|
onRowsChange: y,
|
|
161
|
-
selectedRows:
|
|
161
|
+
selectedRows: u,
|
|
162
162
|
onSelectedRowsChange: t,
|
|
163
163
|
onCellClick: K,
|
|
164
164
|
onCellDoubleClick: M,
|
|
@@ -170,23 +170,23 @@ function qe(z) {
|
|
|
170
170
|
defaultColumnOptions: S,
|
|
171
171
|
groupBy: _,
|
|
172
172
|
rowGrouper: J,
|
|
173
|
-
expandedGroupIds:
|
|
174
|
-
onExpandedGroupIdsChange:
|
|
173
|
+
expandedGroupIds: l.expandedGroupIds,
|
|
174
|
+
onExpandedGroupIdsChange: l.onExpandedGroupIdsChange,
|
|
175
175
|
...b
|
|
176
176
|
}
|
|
177
|
-
) : /* @__PURE__ */
|
|
177
|
+
) : /* @__PURE__ */ c(
|
|
178
178
|
ee,
|
|
179
179
|
{
|
|
180
180
|
className: "rdg-light",
|
|
181
|
-
ref:
|
|
182
|
-
headerRowHeight: G ? p +
|
|
183
|
-
columns:
|
|
184
|
-
sortColumns:
|
|
181
|
+
ref: d,
|
|
182
|
+
headerRowHeight: G ? p + F : p,
|
|
183
|
+
columns: T,
|
|
184
|
+
sortColumns: m,
|
|
185
185
|
onSortColumnsChange: E,
|
|
186
186
|
onColumnResize: O,
|
|
187
|
-
rows:
|
|
187
|
+
rows: s,
|
|
188
188
|
onRowsChange: y,
|
|
189
|
-
selectedRows:
|
|
189
|
+
selectedRows: u,
|
|
190
190
|
onSelectedRowsChange: t,
|
|
191
191
|
onCellClick: K,
|
|
192
192
|
onCellDoubleClick: M,
|
|
@@ -199,10 +199,10 @@ function qe(z) {
|
|
|
199
199
|
...b
|
|
200
200
|
}
|
|
201
201
|
) }),
|
|
202
|
-
|
|
202
|
+
C.columnKey && C.anchorEl instanceof HTMLDivElement && /* @__PURE__ */ c(
|
|
203
203
|
me,
|
|
204
204
|
{
|
|
205
|
-
externalOpen:
|
|
205
|
+
externalOpen: C.anchorEl,
|
|
206
206
|
onOpen: (e) => {
|
|
207
207
|
e || A({
|
|
208
208
|
anchorEl: null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.37",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
"date-fns": "^2.30.0",
|
|
54
54
|
"react-transition-group": "^4.4.5",
|
|
55
55
|
"react-rnd": "^10.5.2",
|
|
56
|
-
"react-spinners": "^0.13.8",
|
|
57
56
|
"react-color": "^2.19.3",
|
|
58
57
|
"@mui/x-date-pickers": "6.20.2",
|
|
59
58
|
"react-draggable": "^4.4.5",
|
|
59
|
+
"react-spinners": "^0.13.8",
|
|
60
60
|
"react-data-grid": "7.0.0-beta.47",
|
|
61
61
|
"react-dnd": "^16.0.1",
|
|
62
62
|
"react-dnd-html5-backend": "^16.0.1",
|
|
63
|
-
"simplebar-react": "3.2.6",
|
|
64
63
|
"chart.js": "^4.4.0",
|
|
65
64
|
"chartjs-chart-error-bars": "^4.3.3",
|
|
66
65
|
"qrcode.react": "^3.1.0",
|
|
67
66
|
"react-resizable": "^3.0.4",
|
|
67
|
+
"simplebar-react": "3.2.6",
|
|
68
68
|
"react-resizable-panels": "^2.1.8"
|
|
69
69
|
}
|
|
70
70
|
}
|