mig-schema-table 5.0.13 → 5.0.14
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,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as F, Fragment as Ft } from "react/jsx-runtime";
|
|
2
2
|
import * as Bt from "react";
|
|
3
3
|
import e from "react";
|
|
4
4
|
import { createPortal as Qt } from "react-dom";
|
|
@@ -6,7 +6,7 @@ import { VariableSizeGrid as ct, VariableSizeList as zt } from "react-window";
|
|
|
6
6
|
import { format as Ut, endOfDay as Pt, differenceInSeconds as Jt } from "date-fns";
|
|
7
7
|
import { nl as Vt } from "date-fns/locale";
|
|
8
8
|
import { unCamel as Zt, emptyFn as ye, timeZone as xe, localeFormatInTimeZone as vt, parseLocationHash as ut, serializeLocationHash as Pe } from "mig-data-tools";
|
|
9
|
-
import { range as qt, debounce as
|
|
9
|
+
import { range as qt, debounce as Xt, difference as Gt, isEqual as tt, isFinite as Ht, sum as Yt } from "lodash";
|
|
10
10
|
import dt from "react-datepicker";
|
|
11
11
|
import mt from "react-select";
|
|
12
12
|
import { nl as ht } from "date-fns/locale/nl";
|
|
@@ -25,10 +25,10 @@ const nt = (t, s) => (
|
|
|
25
25
|
showingFilteredCountOfTotalCount: "Showing {0} of {1}"
|
|
26
26
|
};
|
|
27
27
|
function gt(t, ...s) {
|
|
28
|
-
let
|
|
28
|
+
let m = tn[t] || Zt(t);
|
|
29
29
|
return s.forEach((g, p) => {
|
|
30
|
-
|
|
31
|
-
}),
|
|
30
|
+
m = m.replace(`{${p}}`, `${g}`);
|
|
31
|
+
}), m;
|
|
32
32
|
}
|
|
33
33
|
const K = "SELECT_ALL_COLUMN_NAME", pt = 40, kt = "dd MMM yyyy", Ve = "dd MMM yyyy HH:mm", xt = 25, _t = 50, nn = 3;
|
|
34
34
|
var fe = /* @__PURE__ */ ((t) => (t.GT = "GT", t.LT = "LT", t.EQ = "EQ", t))(fe || {}), Oe = /* @__PURE__ */ ((t) => (t.UNAVAILABLE = "UNAVAILABLE", t.AVAILABLE = "AVAILABLE", t.ACTIVE = "ACTIVE", t))(Oe || {});
|
|
@@ -57,11 +57,11 @@ const De = Bt.createContext({
|
|
|
57
57
|
sortAsc: !1
|
|
58
58
|
},
|
|
59
59
|
translate: ye
|
|
60
|
-
}), rn = { type: "boolean" }, sn = ({ columnIndex: t, rowIndex: s, style:
|
|
60
|
+
}), rn = { type: "boolean" }, sn = ({ columnIndex: t, rowIndex: s, style: m }) => {
|
|
61
61
|
const {
|
|
62
62
|
checkedIndexes: g,
|
|
63
63
|
columnNames: p,
|
|
64
|
-
config:
|
|
64
|
+
config: h,
|
|
65
65
|
disabledCheckedIndexes: S,
|
|
66
66
|
displayTimezone: C,
|
|
67
67
|
getRowClassName: W,
|
|
@@ -75,15 +75,15 @@ const De = Bt.createContext({
|
|
|
75
75
|
setLastCheckChangedRowIndex: ee,
|
|
76
76
|
sortedRenderData: M,
|
|
77
77
|
sourceData: c,
|
|
78
|
-
translate:
|
|
79
|
-
} = e.useContext(De), o = p[t], _ = o === K ? rn : O[o], B =
|
|
78
|
+
translate: i
|
|
79
|
+
} = e.useContext(De), o = p[t], _ = o === K ? rn : O[o], B = h ? h[o] : void 0, te = e.useCallback(
|
|
80
80
|
(x) => {
|
|
81
81
|
V && V((I) => I && I.includes(x) ? I.filter((A) => A !== x) : I ? [...I, x] : [x]);
|
|
82
82
|
},
|
|
83
83
|
[V]
|
|
84
|
-
),
|
|
84
|
+
), ce = E(s), ne = e.useCallback(
|
|
85
85
|
(x) => {
|
|
86
|
-
if (!c || !M || !T || !
|
|
86
|
+
if (!c || !M || !T || !ce)
|
|
87
87
|
return;
|
|
88
88
|
const { rowIndex: I } = x.currentTarget.dataset;
|
|
89
89
|
if (!I)
|
|
@@ -91,7 +91,7 @@ const De = Bt.createContext({
|
|
|
91
91
|
const D = M[parseInt(I, 10)];
|
|
92
92
|
T(c[D._index], D._index, x);
|
|
93
93
|
},
|
|
94
|
-
[
|
|
94
|
+
[ce, T, M, c]
|
|
95
95
|
), y = e.useCallback(
|
|
96
96
|
(x) => {
|
|
97
97
|
if (!c || !M || !k || !E)
|
|
@@ -103,17 +103,17 @@ const De = Bt.createContext({
|
|
|
103
103
|
k(c[D._index], D._index, x);
|
|
104
104
|
},
|
|
105
105
|
[E, k, M, c]
|
|
106
|
-
), N = M ? M[s] : void 0, { showTimezones:
|
|
106
|
+
), N = M ? M[s] : void 0, { showTimezones: oe, TdBody: q } = B || {}, re = e.useMemo(() => C ? null : xe.startsWith("Europe/") ? "Asia/Jakarta" : "Europe/Amsterdam", [C]), Q = e.useMemo(() => {
|
|
107
107
|
if (!N || !M)
|
|
108
108
|
return;
|
|
109
109
|
let x = o === K ? void 0 : N[o];
|
|
110
|
-
if (_?.format && _.format === "date-time" &&
|
|
111
|
-
const D = c ? c[N._index] : void 0, A = D ? D[o] : void 0,
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
if (_?.format && _.format === "date-time" && oe !== !1) {
|
|
111
|
+
const D = c ? c[N._index] : void 0, A = D ? D[o] : void 0, se = A ? new Date(A) : void 0;
|
|
112
|
+
se && re && (x = `${vt(
|
|
113
|
+
se,
|
|
114
114
|
re,
|
|
115
115
|
Ve
|
|
116
|
-
)} (${
|
|
116
|
+
)} (${i(re)})`);
|
|
117
117
|
}
|
|
118
118
|
const I = [
|
|
119
119
|
"mig-schema-table__td",
|
|
@@ -136,7 +136,7 @@ const De = Bt.createContext({
|
|
|
136
136
|
return {
|
|
137
137
|
"data-row-index": s,
|
|
138
138
|
"data-column-index": t,
|
|
139
|
-
style:
|
|
139
|
+
style: m,
|
|
140
140
|
className: I.join(" "),
|
|
141
141
|
title: x,
|
|
142
142
|
onClick: o === K ? void 0 : ne,
|
|
@@ -147,19 +147,19 @@ const De = Bt.createContext({
|
|
|
147
147
|
M,
|
|
148
148
|
o,
|
|
149
149
|
_,
|
|
150
|
-
|
|
150
|
+
oe,
|
|
151
151
|
s,
|
|
152
152
|
c,
|
|
153
153
|
$,
|
|
154
154
|
W,
|
|
155
155
|
t,
|
|
156
|
-
|
|
156
|
+
m,
|
|
157
157
|
ne,
|
|
158
158
|
y,
|
|
159
159
|
re,
|
|
160
|
-
|
|
160
|
+
i,
|
|
161
161
|
B
|
|
162
|
-
]),
|
|
162
|
+
]), J = e.useCallback(
|
|
163
163
|
(x) => {
|
|
164
164
|
if (!te || !N)
|
|
165
165
|
return;
|
|
@@ -168,11 +168,11 @@ const De = Bt.createContext({
|
|
|
168
168
|
const D = g?.includes(R) ? R : void 0;
|
|
169
169
|
if (D !== void 0 && M) {
|
|
170
170
|
const A = s;
|
|
171
|
-
for (const
|
|
171
|
+
for (const se of qt(
|
|
172
172
|
A > D ? D + 1 : A,
|
|
173
173
|
A > D ? A + 1 : D
|
|
174
174
|
)) {
|
|
175
|
-
const me = M[
|
|
175
|
+
const me = M[se]._index;
|
|
176
176
|
(!S || !S.includes(me)) && te(me);
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -194,9 +194,9 @@ const De = Bt.createContext({
|
|
|
194
194
|
if (!N || !Q)
|
|
195
195
|
return null;
|
|
196
196
|
if (!E || c && !c[N._index])
|
|
197
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ r("div", { ...Q, children: "loading" });
|
|
198
198
|
if (o === K)
|
|
199
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ r("div", { ...Q, onMouseDown: J, children: /* @__PURE__ */ r("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ r(
|
|
200
200
|
"input",
|
|
201
201
|
{
|
|
202
202
|
ref: ge,
|
|
@@ -207,7 +207,7 @@ const De = Bt.createContext({
|
|
|
207
207
|
}
|
|
208
208
|
) }) });
|
|
209
209
|
if (q && c)
|
|
210
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ r("div", { ...Q, children: /* @__PURE__ */ r(
|
|
211
211
|
q,
|
|
212
212
|
{
|
|
213
213
|
dataIndex: N._index,
|
|
@@ -217,7 +217,7 @@ const De = Bt.createContext({
|
|
|
217
217
|
}
|
|
218
218
|
) });
|
|
219
219
|
const Z = N[o];
|
|
220
|
-
return _?.format === "url" && Z ? /* @__PURE__ */
|
|
220
|
+
return _?.format === "url" && Z ? /* @__PURE__ */ r(
|
|
221
221
|
"a",
|
|
222
222
|
{
|
|
223
223
|
href: Z,
|
|
@@ -226,38 +226,38 @@ const De = Bt.createContext({
|
|
|
226
226
|
...Q,
|
|
227
227
|
children: Z
|
|
228
228
|
}
|
|
229
|
-
) : /* @__PURE__ */
|
|
229
|
+
) : /* @__PURE__ */ r("div", { ...Q, children: Z });
|
|
230
230
|
}, Ct = e.memo(sn);
|
|
231
231
|
function on() {
|
|
232
|
-
const { checkedIndexes: t, disabledCheckedIndexes: s, sortedRenderData:
|
|
232
|
+
const { checkedIndexes: t, disabledCheckedIndexes: s, sortedRenderData: m } = e.useContext(De);
|
|
233
233
|
return e.useMemo(() => {
|
|
234
|
-
const g = [...
|
|
234
|
+
const g = [...m || []].filter(
|
|
235
235
|
(p) => (t ? t.includes(p._index) : !0) || (s ? !s.includes(p._index) : !0)
|
|
236
236
|
);
|
|
237
237
|
return t?.length !== 0 && g.length === t?.length;
|
|
238
|
-
}, [t, s,
|
|
238
|
+
}, [t, s, m]);
|
|
239
239
|
}
|
|
240
|
-
function Dt(t, s,
|
|
241
|
-
return !!(t &&
|
|
240
|
+
function Dt(t, s, m) {
|
|
241
|
+
return !!(t && m?.isSortable !== !1 && (s || m?.renderData || m?.sort));
|
|
242
242
|
}
|
|
243
243
|
function Tt() {
|
|
244
244
|
const { setCustomColumnWidths: t, settingsStorageKey: s } = e.useContext(De);
|
|
245
245
|
return e.useCallback(
|
|
246
|
-
(
|
|
246
|
+
(m) => {
|
|
247
247
|
s && localStorage.setItem(
|
|
248
248
|
`${s}.columnWidths`,
|
|
249
|
-
JSON.stringify(Array.from(
|
|
250
|
-
), t(
|
|
249
|
+
JSON.stringify(Array.from(m))
|
|
250
|
+
), t(m);
|
|
251
251
|
},
|
|
252
252
|
[t, s]
|
|
253
253
|
);
|
|
254
254
|
}
|
|
255
255
|
const an = ({ index: t, style: s }) => {
|
|
256
256
|
const {
|
|
257
|
-
checkedIndexes:
|
|
257
|
+
checkedIndexes: m,
|
|
258
258
|
columnNames: g,
|
|
259
259
|
columnWidths: p,
|
|
260
|
-
config:
|
|
260
|
+
config: h,
|
|
261
261
|
disabledCheckedIndexes: S,
|
|
262
262
|
dropTargetIndex: C,
|
|
263
263
|
isColumnFilterable: W,
|
|
@@ -271,24 +271,24 @@ const an = ({ index: t, style: s }) => {
|
|
|
271
271
|
setMenuConfig: ee,
|
|
272
272
|
settingsStorageKey: M,
|
|
273
273
|
tableDataState: c,
|
|
274
|
-
sortedRenderData:
|
|
274
|
+
sortedRenderData: i,
|
|
275
275
|
translate: o,
|
|
276
276
|
displayTimezone: _
|
|
277
|
-
} = e.useContext(De), [B, te] = e.useState(!1),
|
|
277
|
+
} = e.useContext(De), [B, te] = e.useState(!1), ce = t === C, ne = Tt(), y = g[t], N = y === K ? { type: "boolean" } : R[y], oe = c.sortColumn === y ? c.sortAsc : void 0, q = h ? h[y] : void 0;
|
|
278
278
|
let re = W && (N || q?.FilterMenu) && q?.isFilterable !== !1 ? Oe.AVAILABLE : Oe.UNAVAILABLE;
|
|
279
279
|
c.columnFilterMap && c.columnFilterMap[y] !== void 0 && (re = Oe.ACTIVE);
|
|
280
280
|
const Q = Dt(
|
|
281
281
|
$,
|
|
282
282
|
N,
|
|
283
283
|
q
|
|
284
|
-
),
|
|
284
|
+
), J = [
|
|
285
285
|
"mig-schema-table__th",
|
|
286
286
|
`mig-schema-table__th--filter-${re}`,
|
|
287
287
|
`mig-schema-table__th--prop-${y}`
|
|
288
288
|
];
|
|
289
|
-
|
|
289
|
+
J.push(
|
|
290
290
|
Q ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable"
|
|
291
|
-
),
|
|
291
|
+
), oe !== void 0 && J.push("mig-schema-table__th--sorted"), B && J.push("mig-schema-table__th--dragging"), ce && J.push("mig-schema-table__th--drop-target");
|
|
292
292
|
const { format: ge } = N || {}, {
|
|
293
293
|
align: Z,
|
|
294
294
|
defaultSortDesc: x,
|
|
@@ -296,42 +296,42 @@ const an = ({ index: t, style: s }) => {
|
|
|
296
296
|
title: D
|
|
297
297
|
} = q || {}, A = e.useCallback(() => {
|
|
298
298
|
if (Q) {
|
|
299
|
-
if (
|
|
299
|
+
if (oe === void 0) {
|
|
300
300
|
V(y, !x);
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
V(y, !
|
|
303
|
+
V(y, !oe);
|
|
304
304
|
}
|
|
305
305
|
}, [
|
|
306
306
|
Q,
|
|
307
307
|
x,
|
|
308
308
|
y,
|
|
309
309
|
V,
|
|
310
|
-
|
|
311
|
-
]),
|
|
310
|
+
oe
|
|
311
|
+
]), se = T.includes(y), me = e.useCallback(
|
|
312
312
|
(w) => {
|
|
313
|
-
const
|
|
313
|
+
const ae = w.currentTarget;
|
|
314
314
|
ee((pe) => {
|
|
315
315
|
if (pe?.propName !== y)
|
|
316
316
|
return {
|
|
317
317
|
propConfig: q,
|
|
318
|
-
propIsRequired:
|
|
318
|
+
propIsRequired: se,
|
|
319
319
|
propName: y,
|
|
320
|
-
referenceElement:
|
|
320
|
+
referenceElement: ae
|
|
321
321
|
};
|
|
322
322
|
});
|
|
323
323
|
},
|
|
324
|
-
[q,
|
|
324
|
+
[q, se, y, ee]
|
|
325
325
|
), Te = e.useMemo(() => D !== void 0 ? D : ge === "date-time" && I ? `${o(y)} (${o(_ || xe)})` : o(y), [D, ge, I, o, y, _]), H = e.useCallback(
|
|
326
|
-
(w,
|
|
326
|
+
(w, ae) => {
|
|
327
327
|
if (!g || !p)
|
|
328
328
|
return;
|
|
329
329
|
const pe = g.indexOf(w), _e = [...g];
|
|
330
330
|
_e.splice(pe, 1);
|
|
331
|
-
const
|
|
332
|
-
_e.splice(
|
|
331
|
+
const X = _e.indexOf(ae);
|
|
332
|
+
_e.splice(X + 1, 0, w), k(_e);
|
|
333
333
|
const v = [...p], Le = v[pe];
|
|
334
|
-
v.splice(pe, 1), v.splice(
|
|
334
|
+
v.splice(pe, 1), v.splice(X + 1, 0, Le), ne(new Uint16Array(v)), M && localStorage.setItem(
|
|
335
335
|
`${M}.columnNames`,
|
|
336
336
|
JSON.stringify(_e)
|
|
337
337
|
);
|
|
@@ -359,30 +359,30 @@ const an = ({ index: t, style: s }) => {
|
|
|
359
359
|
(w) => {
|
|
360
360
|
if (O(-1), !H || !y)
|
|
361
361
|
return;
|
|
362
|
-
const
|
|
363
|
-
!
|
|
362
|
+
const ae = w.dataTransfer.getData("text/plain");
|
|
363
|
+
!ae || ae === y || H(ae, y);
|
|
364
364
|
},
|
|
365
365
|
[H, y, O]
|
|
366
366
|
), Ae = on(), qe = e.useCallback(() => {
|
|
367
|
-
!E || !
|
|
368
|
-
Ae ? [] :
|
|
367
|
+
!E || !i || E(
|
|
368
|
+
Ae ? [] : i.map((w) => w._index).filter((w) => !S?.includes(w))
|
|
369
369
|
);
|
|
370
370
|
}, [
|
|
371
371
|
E,
|
|
372
|
-
|
|
372
|
+
i,
|
|
373
373
|
Ae,
|
|
374
374
|
S
|
|
375
375
|
]);
|
|
376
376
|
if (y === K)
|
|
377
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ r("div", { style: s, className: J.join(" "), children: /* @__PURE__ */ r(
|
|
378
378
|
"div",
|
|
379
379
|
{
|
|
380
380
|
style: {
|
|
381
381
|
width: "100%",
|
|
382
382
|
textAlign: "center"
|
|
383
383
|
},
|
|
384
|
-
title: `${
|
|
385
|
-
children: /* @__PURE__ */
|
|
384
|
+
title: `${m?.length || 0} selected`,
|
|
385
|
+
children: /* @__PURE__ */ r(
|
|
386
386
|
"input",
|
|
387
387
|
{
|
|
388
388
|
type: "checkbox",
|
|
@@ -395,26 +395,26 @@ const an = ({ index: t, style: s }) => {
|
|
|
395
395
|
) });
|
|
396
396
|
switch (N?.type) {
|
|
397
397
|
case "boolean":
|
|
398
|
-
|
|
398
|
+
J.push(
|
|
399
399
|
`text-${Z || "center"}`,
|
|
400
400
|
`justify-content-${Z || "center"}`
|
|
401
401
|
);
|
|
402
402
|
break;
|
|
403
403
|
case "integer":
|
|
404
404
|
case "number":
|
|
405
|
-
|
|
405
|
+
J.push(
|
|
406
406
|
`text-${Z || "end"}`,
|
|
407
407
|
`justify-content-${Z || "end"}`
|
|
408
408
|
);
|
|
409
409
|
break;
|
|
410
410
|
default:
|
|
411
|
-
Z &&
|
|
411
|
+
Z && J.push(`text-${Z}`);
|
|
412
412
|
}
|
|
413
413
|
let Ee = q?.hoverTitle;
|
|
414
414
|
return !Ee && typeof Te == "string" && (Ee = Te), /* @__PURE__ */ F(
|
|
415
415
|
"div",
|
|
416
416
|
{
|
|
417
|
-
className:
|
|
417
|
+
className: J.join(" "),
|
|
418
418
|
style: s,
|
|
419
419
|
title: Ee,
|
|
420
420
|
draggable: !0,
|
|
@@ -430,17 +430,17 @@ const an = ({ index: t, style: s }) => {
|
|
|
430
430
|
style: { lineHeight: "44px" },
|
|
431
431
|
onClick: A,
|
|
432
432
|
children: [
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
433
|
+
/* @__PURE__ */ r("span", { className: "mig-schema-table__th__label-body-text", children: Te }),
|
|
434
|
+
oe === void 0 ? null : /* @__PURE__ */ r("span", { className: "mig-schema-table__th__sort-icon", children: oe ? "↓" : "↑" })
|
|
435
435
|
]
|
|
436
436
|
}
|
|
437
437
|
),
|
|
438
|
-
Q || re !== Oe.UNAVAILABLE ? /* @__PURE__ */
|
|
438
|
+
Q || re !== Oe.UNAVAILABLE ? /* @__PURE__ */ r(
|
|
439
439
|
"button",
|
|
440
440
|
{
|
|
441
441
|
className: "mig-schema-table__th__trigger-el",
|
|
442
442
|
onClick: me,
|
|
443
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ r(
|
|
444
444
|
"svg",
|
|
445
445
|
{
|
|
446
446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -452,7 +452,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
452
452
|
strokeWidth: "2",
|
|
453
453
|
strokeLinecap: "round",
|
|
454
454
|
strokeLinejoin: "round",
|
|
455
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ r("polyline", { points: "6 9 12 15 18 9" })
|
|
456
456
|
}
|
|
457
457
|
)
|
|
458
458
|
}
|
|
@@ -468,21 +468,21 @@ const an = ({ index: t, style: s }) => {
|
|
|
468
468
|
({
|
|
469
469
|
columnFilterValue: t,
|
|
470
470
|
onChange: s,
|
|
471
|
-
onInputKeyDown:
|
|
471
|
+
onInputKeyDown: m,
|
|
472
472
|
propIsRequired: g,
|
|
473
473
|
propName: p,
|
|
474
|
-
propSchema:
|
|
474
|
+
propSchema: h,
|
|
475
475
|
translate: S
|
|
476
476
|
}) => {
|
|
477
|
-
const { displayTimezone: C } = e.useContext(De), { type: W, format: $, minimum: E, maximum: R } =
|
|
477
|
+
const { displayTimezone: C } = e.useContext(De), { type: W, format: $, minimum: E, maximum: R } = h || {}, T = t, k = $ === "date-time";
|
|
478
478
|
let O, V;
|
|
479
479
|
switch (W) {
|
|
480
480
|
case "number":
|
|
481
481
|
case "integer":
|
|
482
|
-
return O = T || {}, V = (c,
|
|
482
|
+
return O = T || {}, V = (c, i, o) => {
|
|
483
483
|
const _ = {
|
|
484
484
|
...O,
|
|
485
|
-
[c]:
|
|
485
|
+
[c]: i.value === "" ? void 0 : parseInt(i.value)
|
|
486
486
|
}, B = Object.values(_).find(
|
|
487
487
|
(te) => isFinite(te)
|
|
488
488
|
);
|
|
@@ -493,16 +493,16 @@ const an = ({ index: t, style: s }) => {
|
|
|
493
493
|
}, /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
494
494
|
g ? null : /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
|
|
495
495
|
/* @__PURE__ */ F("label", { className: "d-flex", children: [
|
|
496
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ r(
|
|
497
497
|
"input",
|
|
498
498
|
{
|
|
499
499
|
type: "checkbox",
|
|
500
500
|
style: { marginRight: 14 },
|
|
501
501
|
checked: !!O.filterEmpty,
|
|
502
502
|
onChange: () => {
|
|
503
|
-
const { filterEmpty: c, ...
|
|
504
|
-
c || (
|
|
505
|
-
Object.keys(
|
|
503
|
+
const { filterEmpty: c, ...i } = O;
|
|
504
|
+
c || (i.filterEmpty = !0), s(
|
|
505
|
+
Object.keys(i).length ? i : void 0,
|
|
506
506
|
!0
|
|
507
507
|
);
|
|
508
508
|
}
|
|
@@ -510,19 +510,19 @@ const an = ({ index: t, style: s }) => {
|
|
|
510
510
|
),
|
|
511
511
|
"Hide empty values"
|
|
512
512
|
] }),
|
|
513
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ r("hr", {})
|
|
514
514
|
] }),
|
|
515
515
|
Object.keys(fe).map((c) => {
|
|
516
|
-
const
|
|
516
|
+
const i = O[c];
|
|
517
517
|
return /* @__PURE__ */ F("li", { children: [
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ r("label", { style: { width: 40, paddingLeft: 16 }, children: cn[c] }),
|
|
519
|
+
/* @__PURE__ */ r(
|
|
520
520
|
"input",
|
|
521
521
|
{
|
|
522
522
|
className: "form-control",
|
|
523
523
|
style: { width: 120 },
|
|
524
524
|
type: "number",
|
|
525
|
-
value:
|
|
525
|
+
value: i !== void 0 ? i : "",
|
|
526
526
|
"data-prop-name": p,
|
|
527
527
|
onChange: (o) => {
|
|
528
528
|
V(
|
|
@@ -538,7 +538,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
538
538
|
!0
|
|
539
539
|
);
|
|
540
540
|
},
|
|
541
|
-
onKeyDown:
|
|
541
|
+
onKeyDown: m,
|
|
542
542
|
min: E,
|
|
543
543
|
max: R
|
|
544
544
|
}
|
|
@@ -553,7 +553,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
553
553
|
];
|
|
554
554
|
g || ee.push({ value: "?", label: "?" });
|
|
555
555
|
let M = null;
|
|
556
|
-
return T === !0 ? M = { value: "✓", label: "✓" } : T === !1 ? M = { value: "✕", label: "✕" } : T === null && (M = { value: "?", label: "?" }), /* @__PURE__ */
|
|
556
|
+
return T === !0 ? M = { value: "✓", label: "✓" } : T === !1 ? M = { value: "✕", label: "✕" } : T === null && (M = { value: "?", label: "?" }), /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
557
557
|
mt,
|
|
558
558
|
{
|
|
559
559
|
autoFocus: !0,
|
|
@@ -589,19 +589,19 @@ const an = ({ index: t, style: s }) => {
|
|
|
589
589
|
s(void 0, !0);
|
|
590
590
|
}
|
|
591
591
|
},
|
|
592
|
-
onKeyDown:
|
|
592
|
+
onKeyDown: m
|
|
593
593
|
}
|
|
594
594
|
) }) });
|
|
595
595
|
// @ts-expect-error falls through
|
|
596
596
|
case "string":
|
|
597
|
-
if (
|
|
598
|
-
const c =
|
|
597
|
+
if (h?.enum) {
|
|
598
|
+
const c = h.enum.map((o) => ({
|
|
599
599
|
value: o,
|
|
600
600
|
label: S(o)
|
|
601
|
-
})),
|
|
601
|
+
})), i = c.filter(
|
|
602
602
|
(o) => (T || []).includes(o.value)
|
|
603
603
|
);
|
|
604
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
605
605
|
mt,
|
|
606
606
|
{
|
|
607
607
|
isMulti: !0,
|
|
@@ -609,7 +609,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
609
609
|
menuIsOpen: !0,
|
|
610
610
|
className: "react-select-container",
|
|
611
611
|
classNamePrefix: "react-select",
|
|
612
|
-
value:
|
|
612
|
+
value: i,
|
|
613
613
|
options: c,
|
|
614
614
|
styles: {
|
|
615
615
|
menu: (o) => ({
|
|
@@ -623,13 +623,13 @@ const an = ({ index: t, style: s }) => {
|
|
|
623
623
|
) : [];
|
|
624
624
|
s(_.length ? _ : void 0, !0);
|
|
625
625
|
},
|
|
626
|
-
onKeyDown:
|
|
626
|
+
onKeyDown: m,
|
|
627
627
|
placeholder: S("Select...")
|
|
628
628
|
}
|
|
629
629
|
) }) });
|
|
630
630
|
}
|
|
631
631
|
if (k || $ === "date") {
|
|
632
|
-
const c = k ? Ve : kt,
|
|
632
|
+
const c = k ? Ve : kt, i = t || {
|
|
633
633
|
from: void 0,
|
|
634
634
|
to: void 0,
|
|
635
635
|
filterEmpty: void 0
|
|
@@ -637,13 +637,13 @@ const an = ({ index: t, style: s }) => {
|
|
|
637
637
|
return /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
638
638
|
g ? null : /* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
|
|
639
639
|
/* @__PURE__ */ F("label", { className: "d-flex", children: [
|
|
640
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ r(
|
|
641
641
|
"input",
|
|
642
642
|
{
|
|
643
643
|
type: "checkbox",
|
|
644
|
-
checked: !!
|
|
644
|
+
checked: !!i.filterEmpty,
|
|
645
645
|
onChange: () => {
|
|
646
|
-
const { filterEmpty: o, ..._ } =
|
|
646
|
+
const { filterEmpty: o, ..._ } = i;
|
|
647
647
|
o || (_.filterEmpty = !0), s(
|
|
648
648
|
Object.keys(_).length ? _ : void 0,
|
|
649
649
|
!0
|
|
@@ -653,25 +653,25 @@ const an = ({ index: t, style: s }) => {
|
|
|
653
653
|
),
|
|
654
654
|
"Hide empty values"
|
|
655
655
|
] }),
|
|
656
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ r("hr", {})
|
|
657
657
|
] }),
|
|
658
658
|
/* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ r("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
|
|
660
|
+
/* @__PURE__ */ r(
|
|
661
661
|
dt,
|
|
662
662
|
{
|
|
663
663
|
dateFormat: c,
|
|
664
664
|
"data-prop-name": p,
|
|
665
665
|
locale: ht,
|
|
666
|
-
selected:
|
|
666
|
+
selected: i.from ? new Je(i.from).withTimeZone(
|
|
667
667
|
C || xe
|
|
668
668
|
) : null,
|
|
669
669
|
onChange: (o) => {
|
|
670
|
-
if (!o && !
|
|
670
|
+
if (!o && !i.to) {
|
|
671
671
|
s(void 0, !0);
|
|
672
672
|
return;
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
674
|
+
if (i.to && o && o > i.to)
|
|
675
675
|
return;
|
|
676
676
|
const _ = o ? Je.tz(C || xe, o) : void 0;
|
|
677
677
|
s(
|
|
@@ -695,8 +695,8 @@ const an = ({ index: t, style: s }) => {
|
|
|
695
695
|
)
|
|
696
696
|
] }),
|
|
697
697
|
/* @__PURE__ */ F("li", { style: { padding: 8 }, children: [
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ r("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
|
|
699
|
+
/* @__PURE__ */ r(
|
|
700
700
|
dt,
|
|
701
701
|
{
|
|
702
702
|
id: "filter-date",
|
|
@@ -704,18 +704,18 @@ const an = ({ index: t, style: s }) => {
|
|
|
704
704
|
"data-prop-name": p,
|
|
705
705
|
locale: ht,
|
|
706
706
|
selectsEnd: !0,
|
|
707
|
-
selected:
|
|
707
|
+
selected: i.to ? new Je(i.to).withTimeZone(
|
|
708
708
|
C || xe
|
|
709
709
|
) : null,
|
|
710
710
|
showMonthDropdown: !0,
|
|
711
711
|
showYearDropdown: !0,
|
|
712
712
|
onChange: (o) => {
|
|
713
|
-
if (!o && !
|
|
713
|
+
if (!o && !i.from) {
|
|
714
714
|
s(void 0, !0);
|
|
715
715
|
return;
|
|
716
716
|
}
|
|
717
717
|
const _ = o ? k ? Je.tz(C || xe, o) : Pt(o) : void 0;
|
|
718
|
-
|
|
718
|
+
i.from && _ && _ < i.from || s(
|
|
719
719
|
{
|
|
720
720
|
...t,
|
|
721
721
|
to: _
|
|
@@ -725,8 +725,8 @@ const an = ({ index: t, style: s }) => {
|
|
|
725
725
|
},
|
|
726
726
|
placeholderText: c,
|
|
727
727
|
isClearable: !0,
|
|
728
|
-
startDate:
|
|
729
|
-
endDate:
|
|
728
|
+
startDate: i.from,
|
|
729
|
+
endDate: i.to,
|
|
730
730
|
showTimeInput: k,
|
|
731
731
|
showTimeSelect: k,
|
|
732
732
|
timeIntervals: 15,
|
|
@@ -738,7 +738,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
738
738
|
}
|
|
739
739
|
// falls through
|
|
740
740
|
default:
|
|
741
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ r("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
|
|
742
742
|
"input",
|
|
743
743
|
{
|
|
744
744
|
autoFocus: !0,
|
|
@@ -749,15 +749,15 @@ const an = ({ index: t, style: s }) => {
|
|
|
749
749
|
value: Array.isArray(T) ? T.join(", ") : T || "",
|
|
750
750
|
"data-prop-name": p,
|
|
751
751
|
onChange: (c) => {
|
|
752
|
-
const
|
|
752
|
+
const i = c.currentTarget.value, o = i ? i.split(",").map((_) => _.trim()) : [];
|
|
753
753
|
s(
|
|
754
754
|
(o.length > 1 ? o : o[0]) || void 0,
|
|
755
755
|
!1
|
|
756
756
|
);
|
|
757
757
|
},
|
|
758
|
-
onKeyDown:
|
|
758
|
+
onKeyDown: m,
|
|
759
759
|
onBlur: (c) => {
|
|
760
|
-
const
|
|
760
|
+
const i = c.currentTarget.value, o = i ? i.split(",").map((_) => _.trim()) : [];
|
|
761
761
|
s(
|
|
762
762
|
(o.length > 1 ? o : o[0]) || void 0,
|
|
763
763
|
!0
|
|
@@ -770,10 +770,10 @@ const an = ({ index: t, style: s }) => {
|
|
|
770
770
|
), dn = ({
|
|
771
771
|
isSortable: t,
|
|
772
772
|
isFilterable: s,
|
|
773
|
-
onChange:
|
|
773
|
+
onChange: m,
|
|
774
774
|
onClose: g,
|
|
775
775
|
onInputKeyDown: p,
|
|
776
|
-
propConfig:
|
|
776
|
+
propConfig: h,
|
|
777
777
|
propIsRequired: S,
|
|
778
778
|
propName: C,
|
|
779
779
|
propSchema: W,
|
|
@@ -793,7 +793,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
793
793
|
middleware: [bt()]
|
|
794
794
|
});
|
|
795
795
|
e.useEffect(() => {
|
|
796
|
-
const
|
|
796
|
+
const i = (o) => {
|
|
797
797
|
if (!k.elements.floating)
|
|
798
798
|
return;
|
|
799
799
|
let _ = o.target;
|
|
@@ -804,29 +804,29 @@ const an = ({ index: t, style: s }) => {
|
|
|
804
804
|
}
|
|
805
805
|
g(o);
|
|
806
806
|
};
|
|
807
|
-
return window.addEventListener("click",
|
|
808
|
-
window.removeEventListener("click",
|
|
807
|
+
return window.addEventListener("click", i, { capture: !0 }), () => {
|
|
808
|
+
window.removeEventListener("click", i, { capture: !0 });
|
|
809
809
|
};
|
|
810
810
|
}, [
|
|
811
811
|
k.elements.floating,
|
|
812
812
|
g,
|
|
813
813
|
O.elements.floating
|
|
814
814
|
]);
|
|
815
|
-
const V =
|
|
816
|
-
(
|
|
817
|
-
E(C, !0), g(
|
|
815
|
+
const V = h?.FilterMenu || un, ee = e.useCallback(
|
|
816
|
+
(i) => {
|
|
817
|
+
E(C, !0), g(i);
|
|
818
818
|
},
|
|
819
819
|
[g, C, E]
|
|
820
820
|
), M = e.useCallback(
|
|
821
|
-
(
|
|
822
|
-
E(C, !1), g(
|
|
821
|
+
(i) => {
|
|
822
|
+
E(C, !1), g(i);
|
|
823
823
|
},
|
|
824
824
|
[g, C, E]
|
|
825
825
|
), c = e.useCallback(() => {
|
|
826
|
-
|
|
827
|
-
}, [
|
|
826
|
+
m(void 0, !0);
|
|
827
|
+
}, [m]);
|
|
828
828
|
return !t && !s ? null : /* @__PURE__ */ F(Ft, { children: [
|
|
829
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ r(
|
|
830
830
|
"div",
|
|
831
831
|
{
|
|
832
832
|
className: "mig-schema-table mig-schema-table__th-menu",
|
|
@@ -834,12 +834,12 @@ const an = ({ index: t, style: s }) => {
|
|
|
834
834
|
style: k.floatingStyles,
|
|
835
835
|
children: /* @__PURE__ */ F("ol", { className: "mig-schema-table-menu", children: [
|
|
836
836
|
t ? /* @__PURE__ */ F("li", { onClick: ee, style: { padding: 8 }, children: [
|
|
837
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
|
|
838
838
|
" ",
|
|
839
839
|
R("sortAscending")
|
|
840
840
|
] }) : null,
|
|
841
841
|
t ? /* @__PURE__ */ F("li", { onClick: M, style: { padding: 8 }, children: [
|
|
842
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
|
|
843
843
|
" ",
|
|
844
844
|
R("sortDescending")
|
|
845
845
|
] }) : null,
|
|
@@ -847,11 +847,11 @@ const an = ({ index: t, style: s }) => {
|
|
|
847
847
|
"li",
|
|
848
848
|
{
|
|
849
849
|
style: { padding: 8 },
|
|
850
|
-
onMouseOver: (
|
|
851
|
-
O.refs.setReference(
|
|
850
|
+
onMouseOver: (i) => {
|
|
851
|
+
O.refs.setReference(i.currentTarget);
|
|
852
852
|
},
|
|
853
853
|
children: [
|
|
854
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ r(
|
|
855
855
|
"input",
|
|
856
856
|
{
|
|
857
857
|
type: "checkbox",
|
|
@@ -861,25 +861,25 @@ const an = ({ index: t, style: s }) => {
|
|
|
861
861
|
onChange: c
|
|
862
862
|
}
|
|
863
863
|
) }),
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ r("label", { htmlFor: "mig-schema-table__th-menu__filters", children: R("filters") }),
|
|
865
|
+
/* @__PURE__ */ r("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
|
|
866
866
|
]
|
|
867
867
|
}
|
|
868
868
|
) : null
|
|
869
869
|
] })
|
|
870
870
|
}
|
|
871
871
|
),
|
|
872
|
-
O.elements.reference ? /* @__PURE__ */
|
|
872
|
+
O.elements.reference ? /* @__PURE__ */ r(
|
|
873
873
|
"div",
|
|
874
874
|
{
|
|
875
875
|
className: "mig-schema-table mig-schema-table__th-menu__sub-menu",
|
|
876
876
|
ref: O.refs.setFloating,
|
|
877
877
|
style: O.floatingStyles,
|
|
878
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ r(
|
|
879
879
|
V,
|
|
880
880
|
{
|
|
881
881
|
columnFilterValue: T,
|
|
882
|
-
onChange:
|
|
882
|
+
onChange: m,
|
|
883
883
|
onInputKeyDown: p,
|
|
884
884
|
propIsRequired: S,
|
|
885
885
|
propName: C,
|
|
@@ -893,10 +893,10 @@ const an = ({ index: t, style: s }) => {
|
|
|
893
893
|
}, mn = e.memo(dn), hn = ({
|
|
894
894
|
columnWidths: t,
|
|
895
895
|
resizeColumnIndex: s,
|
|
896
|
-
setResizeColumnIndex:
|
|
896
|
+
setResizeColumnIndex: m,
|
|
897
897
|
tableBodyHeight: g
|
|
898
898
|
}) => {
|
|
899
|
-
const [p,
|
|
899
|
+
const [p, h] = e.useState(0), S = Tt(), C = e.useCallback(
|
|
900
900
|
(R) => {
|
|
901
901
|
const T = t.map(
|
|
902
902
|
(k, O) => O === s ? Math.max(k + R, xt) : k
|
|
@@ -908,19 +908,19 @@ const an = ({ index: t, style: s }) => {
|
|
|
908
908
|
let W = 0;
|
|
909
909
|
const $ = e.useCallback(
|
|
910
910
|
(R) => {
|
|
911
|
-
|
|
911
|
+
m(parseInt(R.currentTarget.dataset.columnIndex)), h(R.clientX);
|
|
912
912
|
},
|
|
913
|
-
[
|
|
913
|
+
[m]
|
|
914
914
|
), E = e.useCallback(
|
|
915
915
|
(R) => {
|
|
916
|
-
C(R.clientX - p),
|
|
916
|
+
C(R.clientX - p), h(0), m(-1);
|
|
917
917
|
},
|
|
918
|
-
[p, C,
|
|
918
|
+
[p, C, m]
|
|
919
919
|
);
|
|
920
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ r("div", { children: [...t].map((R, T) => {
|
|
921
921
|
W += R;
|
|
922
922
|
const k = ["mig-schema-table__column_resizer"];
|
|
923
|
-
return T === s && k.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */
|
|
923
|
+
return T === s && k.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ r(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
926
|
style: { left: W - nn, bottom: g },
|
|
@@ -934,15 +934,15 @@ const an = ({ index: t, style: s }) => {
|
|
|
934
934
|
);
|
|
935
935
|
}) });
|
|
936
936
|
}, yt = (t) => {
|
|
937
|
-
const [s,
|
|
938
|
-
() =>
|
|
937
|
+
const [s, m] = e.useState({ width: 0, height: 0 }), g = e.useMemo(
|
|
938
|
+
() => Xt(m, 100),
|
|
939
939
|
[]
|
|
940
940
|
);
|
|
941
941
|
return e.useEffect(() => {
|
|
942
942
|
if (!t)
|
|
943
943
|
return;
|
|
944
|
-
const p = new ResizeObserver((
|
|
945
|
-
for (const S of
|
|
944
|
+
const p = new ResizeObserver((h) => {
|
|
945
|
+
for (const S of h) {
|
|
946
946
|
const { blockSize: C, inlineSize: W } = S.borderBoxSize[0];
|
|
947
947
|
g(
|
|
948
948
|
($) => W && C && ($.width !== W || $.height !== C) ? { width: W, height: C } : $
|
|
@@ -958,29 +958,29 @@ const an = ({ index: t, style: s }) => {
|
|
|
958
958
|
t(window.ExcelJS);
|
|
959
959
|
return;
|
|
960
960
|
}
|
|
961
|
-
const
|
|
962
|
-
|
|
961
|
+
const m = document.createElement("script");
|
|
962
|
+
m.src = "https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.bare.min.js", m.onload = () => {
|
|
963
963
|
t(window.ExcelJS);
|
|
964
|
-
},
|
|
964
|
+
}, m.onerror = () => {
|
|
965
965
|
s(new Error("Failed to load ExcelJS library"));
|
|
966
|
-
}, document.head.appendChild(
|
|
966
|
+
}, document.head.appendChild(m);
|
|
967
967
|
}), bn = async (t) => {
|
|
968
|
-
const { Workbook: s } = await fn(),
|
|
968
|
+
const { Workbook: s } = await fn(), m = new s(), g = m.addWorksheet("Data");
|
|
969
969
|
t.length && (g.addRow(
|
|
970
|
-
|
|
970
|
+
Gt(Object.keys(t[0]), [
|
|
971
971
|
"_index",
|
|
972
972
|
"SELECT_ALL_COLUMN_NAME"
|
|
973
973
|
])
|
|
974
974
|
), g.getRow(1).font = { bold: !0 }, g.addRows(
|
|
975
975
|
t.map((p) => {
|
|
976
|
-
const { _index:
|
|
976
|
+
const { _index: h, SELECT_ALL_COLUMN_NAME: S, ...C } = p;
|
|
977
977
|
return Object.values(C);
|
|
978
978
|
})
|
|
979
|
-
),
|
|
980
|
-
const
|
|
979
|
+
), m.xlsx.writeBuffer().then((p) => {
|
|
980
|
+
const h = new Blob([p], {
|
|
981
981
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
982
982
|
});
|
|
983
|
-
en(
|
|
983
|
+
en(h, "export.xlsx");
|
|
984
984
|
}).catch((p) => {
|
|
985
985
|
console.error("Error generating Excel file:", p);
|
|
986
986
|
}));
|
|
@@ -989,21 +989,21 @@ const an = ({ index: t, style: s }) => {
|
|
|
989
989
|
currency: "EUR"
|
|
990
990
|
});
|
|
991
991
|
function _n(t, s) {
|
|
992
|
-
const { TdBody:
|
|
992
|
+
const { TdBody: m, sortByValue: g } = s || {};
|
|
993
993
|
if (g !== void 0)
|
|
994
994
|
return g;
|
|
995
995
|
if (!t)
|
|
996
996
|
return !1;
|
|
997
|
-
const { format: p, type:
|
|
998
|
-
return p?.startsWith("date") ||
|
|
997
|
+
const { format: p, type: h } = t;
|
|
998
|
+
return p?.startsWith("date") || h === "boolean" || h === "integer" || h === "number" || !!m;
|
|
999
999
|
}
|
|
1000
1000
|
const Cn = ({
|
|
1001
1001
|
CustomElement: t,
|
|
1002
1002
|
CustomSearchInput: s,
|
|
1003
|
-
Heading:
|
|
1003
|
+
Heading: m = zt,
|
|
1004
1004
|
autoRender: g,
|
|
1005
1005
|
checkedIndexes: p,
|
|
1006
|
-
config:
|
|
1006
|
+
config: h,
|
|
1007
1007
|
customElementProps: S,
|
|
1008
1008
|
data: C,
|
|
1009
1009
|
defaultColumnFilters: W,
|
|
@@ -1017,32 +1017,32 @@ const Cn = ({
|
|
|
1017
1017
|
getRowSelected: ee,
|
|
1018
1018
|
getSearchQueryFilterResult: M,
|
|
1019
1019
|
infiniteLoaderRef: c,
|
|
1020
|
-
isColumnFilterable:
|
|
1020
|
+
isColumnFilterable: i = !0,
|
|
1021
1021
|
isExportable: o = !0,
|
|
1022
1022
|
isResizable: _ = !0,
|
|
1023
1023
|
isSearchable: B = !0,
|
|
1024
1024
|
isSortable: te = !0,
|
|
1025
|
-
itemCount:
|
|
1025
|
+
itemCount: ce,
|
|
1026
1026
|
loadMoreItems: ne,
|
|
1027
1027
|
maxHeight: y,
|
|
1028
1028
|
onRowClick: N,
|
|
1029
|
-
onRowDoubleClick:
|
|
1029
|
+
onRowDoubleClick: oe,
|
|
1030
1030
|
onSearchEnter: q,
|
|
1031
1031
|
onTableDataStateChange: re,
|
|
1032
1032
|
rowHeight: Q = 36,
|
|
1033
|
-
schema:
|
|
1033
|
+
schema: J,
|
|
1034
1034
|
searchPlaceholder: ge,
|
|
1035
1035
|
setCheckedIndexes: Z,
|
|
1036
1036
|
settingsStorageKey: x,
|
|
1037
1037
|
style: I,
|
|
1038
1038
|
translate: D = gt,
|
|
1039
1039
|
useFilterStateHash: A,
|
|
1040
|
-
variableSizeGridRef:
|
|
1040
|
+
variableSizeGridRef: se,
|
|
1041
1041
|
width: me
|
|
1042
1042
|
}, Te) => {
|
|
1043
|
-
const [H, Re] = e.useState(), [Me, We] = e.useState(), [Ze, Ae] = e.useState(-1), [qe, Ee] = e.useState(-1), [w,
|
|
1044
|
-
|
|
1045
|
-
), [Ce,
|
|
1043
|
+
const [H, Re] = e.useState(), [Me, We] = e.useState(), [Ze, Ae] = e.useState(-1), [qe, Ee] = e.useState(-1), [w, ae] = e.useState(), [pe, _e] = e.useState(), X = C instanceof Function, [v, Le] = e.useState(
|
|
1044
|
+
X ? void 0 : C
|
|
1045
|
+
), [Ce, Xe] = e.useState(), [l, we] = e.useState({
|
|
1046
1046
|
searchQuery: "",
|
|
1047
1047
|
columnFilterMap: W || {},
|
|
1048
1048
|
sortColumn: E,
|
|
@@ -1051,33 +1051,33 @@ const Cn = ({
|
|
|
1051
1051
|
A ? ut(window.location.hash) : null
|
|
1052
1052
|
);
|
|
1053
1053
|
e.useEffect(() => {
|
|
1054
|
-
|
|
1055
|
-
}, [C,
|
|
1056
|
-
!
|
|
1054
|
+
X || Le(C);
|
|
1055
|
+
}, [C, X]), e.useEffect(() => {
|
|
1056
|
+
!X || v !== void 0 || C(
|
|
1057
1057
|
z && Object.keys(z).length !== 0 ? {
|
|
1058
1058
|
...z,
|
|
1059
1059
|
columnFilterMap: z.columnFilterMap || {}
|
|
1060
|
-
} :
|
|
1060
|
+
} : l
|
|
1061
1061
|
).then(Le);
|
|
1062
|
-
}, [C,
|
|
1063
|
-
Ce ||
|
|
1064
|
-
}, [
|
|
1062
|
+
}, [C, X, z, v, l]), e.useEffect(() => {
|
|
1063
|
+
Ce || Xe(l);
|
|
1064
|
+
}, [l, Ce]), e.useEffect(() => {
|
|
1065
1065
|
if (!A)
|
|
1066
1066
|
return;
|
|
1067
|
-
const
|
|
1067
|
+
const n = () => {
|
|
1068
1068
|
Mt(ut(window.location.hash));
|
|
1069
1069
|
};
|
|
1070
|
-
return window.addEventListener("hashchange",
|
|
1071
|
-
window.removeEventListener("hashchange",
|
|
1070
|
+
return window.addEventListener("hashchange", n), () => {
|
|
1071
|
+
window.removeEventListener("hashchange", n);
|
|
1072
1072
|
};
|
|
1073
1073
|
}, [A]), e.useEffect(() => {
|
|
1074
1074
|
if (!A)
|
|
1075
1075
|
return;
|
|
1076
|
-
const { columnFilterMap:
|
|
1077
|
-
searchQuery:
|
|
1078
|
-
columnFilterMap:
|
|
1079
|
-
sortAsc:
|
|
1080
|
-
sortColumn:
|
|
1076
|
+
const { columnFilterMap: n, searchQuery: u, sortAsc: d, sortColumn: a } = z || {}, f = {
|
|
1077
|
+
searchQuery: u || "",
|
|
1078
|
+
columnFilterMap: n || W || {},
|
|
1079
|
+
sortAsc: d === void 0 ? $ : d,
|
|
1080
|
+
sortColumn: a === void 0 ? E : a
|
|
1081
1081
|
};
|
|
1082
1082
|
we(
|
|
1083
1083
|
(L) => tt(f, L) ? L : f
|
|
@@ -1089,159 +1089,159 @@ const Cn = ({
|
|
|
1089
1089
|
$,
|
|
1090
1090
|
E
|
|
1091
1091
|
]), e.useEffect(() => {
|
|
1092
|
-
re && re(
|
|
1093
|
-
}, [re,
|
|
1092
|
+
re && re(l);
|
|
1093
|
+
}, [re, l]);
|
|
1094
1094
|
const rt = e.useRef(null), st = e.useRef(null), je = yt(rt.current), ot = yt(
|
|
1095
1095
|
st.current
|
|
1096
1096
|
), Ne = e.useMemo(
|
|
1097
1097
|
() => me || Math.floor(je.width || 0),
|
|
1098
1098
|
[je.width, me]
|
|
1099
|
-
), Ie = e.useMemo(() => !tt(
|
|
1099
|
+
), Ie = e.useMemo(() => !tt(l, Ce) && X, [l, Ce, X]), { properties: ie, required: At } = e.useMemo(
|
|
1100
1100
|
() => ({
|
|
1101
1101
|
properties: {},
|
|
1102
1102
|
required: [],
|
|
1103
|
-
...
|
|
1103
|
+
...J
|
|
1104
1104
|
}),
|
|
1105
|
-
[
|
|
1105
|
+
[J]
|
|
1106
1106
|
), Fe = x ? localStorage.getItem(`${x}.columnNames`) : null, Be = x ? localStorage.getItem(`${x}.columnWidths`) : null, Y = e.useMemo(() => {
|
|
1107
1107
|
if (H)
|
|
1108
1108
|
return H;
|
|
1109
|
-
const
|
|
1110
|
-
let
|
|
1111
|
-
if (Z &&
|
|
1112
|
-
Object.keys(
|
|
1113
|
-
|
|
1109
|
+
const n = Fe ? JSON.parse(Fe) : void 0;
|
|
1110
|
+
let u = Object.keys(ie);
|
|
1111
|
+
if (Z && u.unshift(K), h) {
|
|
1112
|
+
Object.keys(h).forEach((a) => {
|
|
1113
|
+
u.includes(a) || u.push(a);
|
|
1114
1114
|
});
|
|
1115
|
-
const
|
|
1116
|
-
(
|
|
1115
|
+
const d = Object.entries(h).reduce(
|
|
1116
|
+
(a, [f, L]) => (L.hidden && a.push(f), a),
|
|
1117
1117
|
[]
|
|
1118
1118
|
);
|
|
1119
|
-
|
|
1120
|
-
let L =
|
|
1121
|
-
L === void 0 && (L = Object.keys(
|
|
1122
|
-
(
|
|
1119
|
+
u = u.filter((a) => !d.includes(a)).sort((a, f) => {
|
|
1120
|
+
let L = h[a] ? h[a].order : void 0;
|
|
1121
|
+
L === void 0 && (L = Object.keys(ie).findIndex(
|
|
1122
|
+
(G) => G === a
|
|
1123
1123
|
));
|
|
1124
|
-
let b =
|
|
1125
|
-
return b === void 0 && (b = Object.keys(
|
|
1126
|
-
(
|
|
1127
|
-
)), f === K ||
|
|
1124
|
+
let b = h[f] ? h[f].order : void 0;
|
|
1125
|
+
return b === void 0 && (b = Object.keys(ie).findIndex(
|
|
1126
|
+
(G) => G === f
|
|
1127
|
+
)), f === K || a === K ? 0 : L === -1 ? 1 : b === -1 ? -1 : L - b;
|
|
1128
1128
|
});
|
|
1129
1129
|
}
|
|
1130
|
-
return
|
|
1130
|
+
return n?.length === u.length ? n : u;
|
|
1131
1131
|
}, [
|
|
1132
|
-
|
|
1132
|
+
h,
|
|
1133
1133
|
H,
|
|
1134
1134
|
Z,
|
|
1135
|
-
|
|
1135
|
+
ie,
|
|
1136
1136
|
Fe
|
|
1137
1137
|
]), Qe = e.useMemo(
|
|
1138
1138
|
() => v && Y ? v.map(
|
|
1139
|
-
(
|
|
1140
|
-
(
|
|
1141
|
-
const f =
|
|
1139
|
+
(n, u) => Y.reduce(
|
|
1140
|
+
(d, a) => {
|
|
1141
|
+
const f = ie[a], L = h ? h[a] : void 0;
|
|
1142
1142
|
if (L?.renderData)
|
|
1143
|
-
return
|
|
1144
|
-
if (!f ||
|
|
1145
|
-
return
|
|
1146
|
-
const b =
|
|
1143
|
+
return d[a] = L.renderData(n, u), d;
|
|
1144
|
+
if (!f || a === K)
|
|
1145
|
+
return d[a] = "", d;
|
|
1146
|
+
const b = n ? n[a] : "";
|
|
1147
1147
|
switch (f.type) {
|
|
1148
1148
|
case "array":
|
|
1149
|
-
return
|
|
1149
|
+
return d[a] = f.items?.type === "string" && b ? b.map((G) => D(G)).join(", ") : JSON.stringify(b), d;
|
|
1150
1150
|
case "boolean":
|
|
1151
|
-
return
|
|
1151
|
+
return d[a] = b === void 0 ? "?" : b ? "✓" : "✕", d;
|
|
1152
1152
|
case "number":
|
|
1153
1153
|
case "integer":
|
|
1154
|
-
return b === void 0 ? (
|
|
1154
|
+
return b === void 0 ? (d[a] = "", d) : (d[a] = f.format === "currency" ? pn.format(b) : gn.format(b), d);
|
|
1155
1155
|
// @ts-expect-error investigate
|
|
1156
1156
|
case "string":
|
|
1157
1157
|
if (f.format === "date" && b)
|
|
1158
|
-
return
|
|
1158
|
+
return d[a] = ["2999-12-31", "1970-01-01"].includes(
|
|
1159
1159
|
b
|
|
1160
1160
|
) ? "-" : nt(
|
|
1161
1161
|
new Date(b),
|
|
1162
1162
|
L?.dateFormat || kt
|
|
1163
|
-
),
|
|
1163
|
+
), d;
|
|
1164
1164
|
if (f.format === "date-time" && b)
|
|
1165
|
-
return
|
|
1165
|
+
return d[a] = T ? vt(
|
|
1166
1166
|
new Date(b),
|
|
1167
1167
|
T,
|
|
1168
1168
|
Ve
|
|
1169
1169
|
) : nt(
|
|
1170
1170
|
new Date(b),
|
|
1171
1171
|
L?.dateFormat || Ve
|
|
1172
|
-
),
|
|
1172
|
+
), d;
|
|
1173
1173
|
if (f.enum)
|
|
1174
|
-
return
|
|
1174
|
+
return d[a] = b ? D(b) : "", d;
|
|
1175
1175
|
// fallthrough
|
|
1176
1176
|
default:
|
|
1177
|
-
return
|
|
1177
|
+
return d[a] = b ? `${b}` : "", d;
|
|
1178
1178
|
}
|
|
1179
1179
|
},
|
|
1180
|
-
{ _index:
|
|
1180
|
+
{ _index: u }
|
|
1181
1181
|
)
|
|
1182
1182
|
) : void 0,
|
|
1183
|
-
[v, Y,
|
|
1184
|
-
), ve = Y ? Y.length : 0, { dynamicWidthColumnCount:
|
|
1185
|
-
let
|
|
1186
|
-
return (Y || []).forEach((
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
1183
|
+
[v, Y, ie, h, D, T]
|
|
1184
|
+
), ve = Y ? Y.length : 0, { dynamicWidthColumnCount: Ge, fixedWidthColumnsWidth: He } = e.useMemo(() => {
|
|
1185
|
+
let n = 0, u = 0;
|
|
1186
|
+
return (Y || []).forEach((d) => {
|
|
1187
|
+
if (d === K) {
|
|
1188
|
+
n += pt;
|
|
1189
1189
|
return;
|
|
1190
1190
|
}
|
|
1191
|
-
const
|
|
1192
|
-
|
|
1193
|
-
}, 0), { dynamicWidthColumnCount:
|
|
1194
|
-
}, [Y,
|
|
1191
|
+
const a = h ? h[d] : void 0;
|
|
1192
|
+
a?.width ? n += a.width : u += 1;
|
|
1193
|
+
}, 0), { dynamicWidthColumnCount: u, fixedWidthColumnsWidth: n };
|
|
1194
|
+
}, [Y, h]), le = e.useMemo(() => {
|
|
1195
1195
|
if (Me)
|
|
1196
1196
|
return new Uint16Array(Me);
|
|
1197
|
-
const
|
|
1197
|
+
const n = Be ? new Uint16Array(JSON.parse(Be)) : void 0, u = Math.max(
|
|
1198
1198
|
Math.floor(
|
|
1199
|
-
(Ne - He) /
|
|
1199
|
+
(Ne - He) / Ge
|
|
1200
1200
|
),
|
|
1201
1201
|
xt
|
|
1202
1202
|
);
|
|
1203
|
-
let
|
|
1204
|
-
const
|
|
1203
|
+
let d = (Ne - He) % Ge;
|
|
1204
|
+
const a = new Uint16Array(
|
|
1205
1205
|
Y.map((f) => {
|
|
1206
1206
|
if (f === K)
|
|
1207
1207
|
return pt;
|
|
1208
|
-
const L =
|
|
1209
|
-
return L?.width ? L?.width :
|
|
1208
|
+
const L = h ? h[f] : void 0;
|
|
1209
|
+
return L?.width ? L?.width : d ? (d -= 1, u + 1) : u;
|
|
1210
1210
|
})
|
|
1211
1211
|
);
|
|
1212
|
-
return
|
|
1212
|
+
return n?.length === a.length ? n : a;
|
|
1213
1213
|
}, [
|
|
1214
1214
|
Y,
|
|
1215
|
-
|
|
1215
|
+
h,
|
|
1216
1216
|
Me,
|
|
1217
|
-
|
|
1217
|
+
Ge,
|
|
1218
1218
|
He,
|
|
1219
1219
|
Be,
|
|
1220
1220
|
Ne
|
|
1221
1221
|
]), ze = e.useCallback(
|
|
1222
|
-
(
|
|
1223
|
-
[
|
|
1222
|
+
(n) => le ? le[n] : 1,
|
|
1223
|
+
[le]
|
|
1224
1224
|
), Se = e.useMemo(() => {
|
|
1225
|
-
if (!Qe || !
|
|
1225
|
+
if (!Qe || !i && !B || X)
|
|
1226
1226
|
return Qe;
|
|
1227
|
-
const { searchQuery:
|
|
1228
|
-
(f) => `${
|
|
1227
|
+
const { searchQuery: n } = l, u = n.toLowerCase() || "", d = (a) => v && M ? M(v[a._index], n) : !(Y && !Y.find(
|
|
1228
|
+
(f) => `${a[f]}`.toLowerCase().includes(u)
|
|
1229
1229
|
));
|
|
1230
|
-
return Qe.filter((
|
|
1231
|
-
let f =
|
|
1232
|
-
return !f || !
|
|
1230
|
+
return Qe.filter((a) => {
|
|
1231
|
+
let f = d(a);
|
|
1232
|
+
return !f || !l.columnFilterMap ? !1 : (Object.entries(l.columnFilterMap).forEach(
|
|
1233
1233
|
([L, b]) => {
|
|
1234
1234
|
if (!f || b === void 0)
|
|
1235
1235
|
return;
|
|
1236
|
-
const
|
|
1237
|
-
if (v &&
|
|
1238
|
-
f =
|
|
1239
|
-
v[
|
|
1236
|
+
const G = h ? h[L] : void 0;
|
|
1237
|
+
if (v && G?.filter) {
|
|
1238
|
+
f = G.filter(
|
|
1239
|
+
v[a._index],
|
|
1240
1240
|
b
|
|
1241
1241
|
);
|
|
1242
1242
|
return;
|
|
1243
1243
|
}
|
|
1244
|
-
const de =
|
|
1244
|
+
const de = ie[L], j = v[a._index]?.[L];
|
|
1245
1245
|
switch (de?.type) {
|
|
1246
1246
|
case "boolean":
|
|
1247
1247
|
case "number":
|
|
@@ -1290,112 +1290,116 @@ const Cn = ({
|
|
|
1290
1290
|
return;
|
|
1291
1291
|
}
|
|
1292
1292
|
if (Array.isArray(b)) {
|
|
1293
|
-
const U = `${
|
|
1293
|
+
const U = `${a[L]}`.toLowerCase();
|
|
1294
1294
|
f = b.some(
|
|
1295
1295
|
(he) => U.includes(`${he}`.toLowerCase())
|
|
1296
1296
|
);
|
|
1297
1297
|
} else
|
|
1298
|
-
f = `${
|
|
1298
|
+
f = `${a[L]}`.toLowerCase().includes(`${b}`.toLowerCase());
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
), f);
|
|
1302
1302
|
});
|
|
1303
1303
|
}, [
|
|
1304
1304
|
Qe,
|
|
1305
|
-
a,
|
|
1306
|
-
B,
|
|
1307
|
-
G,
|
|
1308
1305
|
i,
|
|
1306
|
+
B,
|
|
1307
|
+
X,
|
|
1308
|
+
l,
|
|
1309
1309
|
M,
|
|
1310
1310
|
Y,
|
|
1311
|
-
|
|
1311
|
+
h,
|
|
1312
1312
|
v,
|
|
1313
|
-
|
|
1314
|
-
]),
|
|
1315
|
-
const { sortAsc:
|
|
1316
|
-
if (!
|
|
1313
|
+
ie
|
|
1314
|
+
]), P = e.useMemo(() => {
|
|
1315
|
+
const { sortAsc: n, sortColumn: u } = l;
|
|
1316
|
+
if (!u || !Se || !v || X)
|
|
1317
1317
|
return Se;
|
|
1318
|
-
const
|
|
1318
|
+
const d = ie[u], a = h ? h[u] : void 0, f = a?.sort;
|
|
1319
1319
|
if (f)
|
|
1320
|
-
return Se.sort((
|
|
1321
|
-
const j = v[
|
|
1320
|
+
return Se.sort((G, de) => {
|
|
1321
|
+
const j = v[G._index], U = v[de._index];
|
|
1322
1322
|
return j ? U ? f(
|
|
1323
1323
|
j,
|
|
1324
1324
|
U,
|
|
1325
|
-
|
|
1325
|
+
n === void 0 ? $ : n
|
|
1326
1326
|
) : -1 : 1;
|
|
1327
1327
|
});
|
|
1328
|
-
const L =
|
|
1329
|
-
return Se.sort((
|
|
1330
|
-
let j = b && v[
|
|
1331
|
-
return b && L && (j = new Date(j), isNaN(j.getTime()) && (j = wt), U = new Date(U), isNaN(U.getTime()) && (U = wt)), j === U ? 0 : j ? U ? (j < U ? 1 : -1) * (
|
|
1328
|
+
const L = d && d.format?.startsWith("date"), b = _n(d, a);
|
|
1329
|
+
return Se.sort((G, de) => {
|
|
1330
|
+
let j = b && v[G._index] ? v[G._index][u] : `${G[u]}`.toLowerCase(), U = b && v[de._index] ? v[de._index][u] : `${de[u]}`.toLowerCase();
|
|
1331
|
+
return b && L && (j = new Date(j), isNaN(j.getTime()) && (j = wt), U = new Date(U), isNaN(U.getTime()) && (U = wt)), j === U ? 0 : j ? U ? (j < U ? 1 : -1) * (n ? -1 : 1) : n ? 1 : -1 : n ? -1 : 1;
|
|
1332
1332
|
});
|
|
1333
1333
|
}, [
|
|
1334
|
-
|
|
1334
|
+
h,
|
|
1335
1335
|
$,
|
|
1336
1336
|
Se,
|
|
1337
|
-
|
|
1338
|
-
|
|
1337
|
+
X,
|
|
1338
|
+
ie,
|
|
1339
1339
|
v,
|
|
1340
|
-
|
|
1340
|
+
l
|
|
1341
1341
|
]);
|
|
1342
1342
|
e.useImperativeHandle(
|
|
1343
1343
|
Te,
|
|
1344
1344
|
() => ({
|
|
1345
|
-
getFilteredSortedData: () =>
|
|
1345
|
+
getFilteredSortedData: () => P,
|
|
1346
|
+
scrollToIndex: (n) => {
|
|
1347
|
+
const u = se?.current, d = P?.findIndex((a) => a._index === n) || -1;
|
|
1348
|
+
u && d >= 0 && u.scrollToItem({ rowIndex: d });
|
|
1349
|
+
}
|
|
1346
1350
|
}),
|
|
1347
|
-
[
|
|
1351
|
+
[P, se]
|
|
1348
1352
|
);
|
|
1349
1353
|
const at = e.useCallback(
|
|
1350
|
-
(
|
|
1351
|
-
const
|
|
1352
|
-
delete
|
|
1353
|
-
...
|
|
1354
|
-
columnFilterMap:
|
|
1354
|
+
(n) => {
|
|
1355
|
+
const u = { ...l.columnFilterMap };
|
|
1356
|
+
delete u[n], we({
|
|
1357
|
+
...l,
|
|
1358
|
+
columnFilterMap: u
|
|
1355
1359
|
});
|
|
1356
1360
|
},
|
|
1357
|
-
[
|
|
1361
|
+
[l]
|
|
1358
1362
|
), Ye = e.useCallback(
|
|
1359
|
-
(
|
|
1363
|
+
(n, u) => {
|
|
1360
1364
|
if (A) {
|
|
1361
1365
|
window.location.hash = Pe({
|
|
1362
1366
|
...z,
|
|
1363
|
-
sortColumn:
|
|
1364
|
-
sortAsc:
|
|
1367
|
+
sortColumn: n,
|
|
1368
|
+
sortAsc: u
|
|
1365
1369
|
});
|
|
1366
1370
|
return;
|
|
1367
1371
|
}
|
|
1368
|
-
we({ ...
|
|
1372
|
+
we({ ...l, sortColumn: n, sortAsc: u });
|
|
1369
1373
|
},
|
|
1370
|
-
[
|
|
1374
|
+
[l, z, A]
|
|
1371
1375
|
), Et = e.useCallback(
|
|
1372
|
-
(
|
|
1376
|
+
(n) => {
|
|
1373
1377
|
we({
|
|
1374
|
-
...
|
|
1375
|
-
searchQuery:
|
|
1378
|
+
...l,
|
|
1379
|
+
searchQuery: n.currentTarget.value
|
|
1376
1380
|
});
|
|
1377
1381
|
},
|
|
1378
|
-
[
|
|
1382
|
+
[l]
|
|
1379
1383
|
), ke = e.useCallback(() => {
|
|
1380
|
-
|
|
1381
|
-
}, [
|
|
1384
|
+
Xe(l), Le(void 0);
|
|
1385
|
+
}, [l]);
|
|
1382
1386
|
e.useEffect(() => {
|
|
1383
1387
|
if (!g || !z || !Ce || !A)
|
|
1384
1388
|
return;
|
|
1385
|
-
const
|
|
1386
|
-
let
|
|
1387
|
-
for (const
|
|
1388
|
-
const
|
|
1389
|
-
if (typeof
|
|
1390
|
-
|
|
1389
|
+
const n = Object.keys(z);
|
|
1390
|
+
let u = !1;
|
|
1391
|
+
for (const d of n) {
|
|
1392
|
+
const a = z[d], f = Ce[d];
|
|
1393
|
+
if (typeof a == "string" && a !== f) {
|
|
1394
|
+
u = !0;
|
|
1391
1395
|
break;
|
|
1392
1396
|
}
|
|
1393
|
-
if (typeof
|
|
1394
|
-
|
|
1397
|
+
if (typeof a == "object" && !tt(a, f)) {
|
|
1398
|
+
u = !0;
|
|
1395
1399
|
break;
|
|
1396
1400
|
}
|
|
1397
1401
|
}
|
|
1398
|
-
|
|
1402
|
+
u && ke();
|
|
1399
1403
|
}, [
|
|
1400
1404
|
g,
|
|
1401
1405
|
z,
|
|
@@ -1404,26 +1408,26 @@ const Cn = ({
|
|
|
1404
1408
|
A
|
|
1405
1409
|
]);
|
|
1406
1410
|
const it = e.useCallback(
|
|
1407
|
-
(
|
|
1408
|
-
|
|
1411
|
+
(n) => {
|
|
1412
|
+
n.key === "Enter" && (ae(void 0), Ie && !A && ke(), q && n.currentTarget.className === "mig-schema-table__search" && q(l.searchQuery || ""));
|
|
1409
1413
|
},
|
|
1410
1414
|
[
|
|
1411
1415
|
Ie,
|
|
1412
|
-
|
|
1416
|
+
l.searchQuery,
|
|
1413
1417
|
q,
|
|
1414
1418
|
ke,
|
|
1415
1419
|
A
|
|
1416
1420
|
]
|
|
1417
|
-
), Ke = e.useCallback(() => Q, [Q]), ue = e.useMemo(() => Yt(
|
|
1418
|
-
() =>
|
|
1419
|
-
[
|
|
1421
|
+
), Ke = e.useCallback(() => Q, [Q]), ue = e.useMemo(() => Yt(le), [le]), $e = e.useMemo(
|
|
1422
|
+
() => P ? P.length : 0,
|
|
1423
|
+
[P]
|
|
1420
1424
|
), be = e.useMemo(() => {
|
|
1421
|
-
const
|
|
1422
|
-
let
|
|
1423
|
-
if (y && (
|
|
1425
|
+
const n = Q * $e;
|
|
1426
|
+
let u;
|
|
1427
|
+
if (y && (u = y === "100%" ? je.height : y, !u))
|
|
1424
1428
|
return 0;
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1429
|
+
const d = u ? u - ot.height - _t : 0;
|
|
1430
|
+
return d && d < n ? d : n;
|
|
1427
1431
|
}, [
|
|
1428
1432
|
Q,
|
|
1429
1433
|
$e,
|
|
@@ -1431,76 +1435,76 @@ const Cn = ({
|
|
|
1431
1435
|
ot,
|
|
1432
1436
|
je.height
|
|
1433
1437
|
]), Lt = e.useCallback(
|
|
1434
|
-
(
|
|
1435
|
-
|
|
1438
|
+
(n) => {
|
|
1439
|
+
ae(void 0), n.preventDefault(), n.stopPropagation();
|
|
1436
1440
|
},
|
|
1437
1441
|
[]
|
|
1438
1442
|
), Nt = e.useCallback(
|
|
1439
|
-
(
|
|
1443
|
+
(n, u) => {
|
|
1440
1444
|
if (!w)
|
|
1441
1445
|
return;
|
|
1442
|
-
if (A &&
|
|
1446
|
+
if (A && u !== !1) {
|
|
1443
1447
|
window.location.hash = Pe({
|
|
1444
1448
|
...z,
|
|
1445
1449
|
columnFilterMap: {
|
|
1446
|
-
...
|
|
1447
|
-
[w.propName]:
|
|
1450
|
+
...l.columnFilterMap,
|
|
1451
|
+
[w.propName]: n
|
|
1448
1452
|
}
|
|
1449
1453
|
});
|
|
1450
1454
|
return;
|
|
1451
1455
|
}
|
|
1452
|
-
if (
|
|
1456
|
+
if (n === void 0) {
|
|
1453
1457
|
at(w.propName);
|
|
1454
1458
|
return;
|
|
1455
1459
|
}
|
|
1456
|
-
const
|
|
1457
|
-
...
|
|
1458
|
-
[w.propName]:
|
|
1460
|
+
const d = {
|
|
1461
|
+
...l.columnFilterMap,
|
|
1462
|
+
[w.propName]: n
|
|
1459
1463
|
};
|
|
1460
1464
|
we({
|
|
1461
|
-
...
|
|
1462
|
-
columnFilterMap:
|
|
1465
|
+
...l,
|
|
1466
|
+
columnFilterMap: d
|
|
1463
1467
|
});
|
|
1464
1468
|
},
|
|
1465
1469
|
[
|
|
1466
1470
|
at,
|
|
1467
|
-
|
|
1471
|
+
l,
|
|
1468
1472
|
z,
|
|
1469
1473
|
w,
|
|
1470
1474
|
A
|
|
1471
1475
|
]
|
|
1472
1476
|
), It = e.useCallback(() => {
|
|
1473
|
-
const
|
|
1477
|
+
const n = {
|
|
1474
1478
|
searchQuery: "",
|
|
1475
1479
|
columnFilterMap: {},
|
|
1476
1480
|
// Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
|
|
1477
1481
|
sortColumn: E,
|
|
1478
1482
|
sortAsc: $
|
|
1479
1483
|
};
|
|
1480
|
-
A && (window.location.hash = Pe(
|
|
1484
|
+
A && (window.location.hash = Pe(n)), Xe(n), we(n);
|
|
1481
1485
|
}, [A, $, E]), St = e.useCallback(() => {
|
|
1482
|
-
const
|
|
1486
|
+
const n = z?.searchQuery || "";
|
|
1483
1487
|
A && // prevent hash change for undefined vs empty string compare
|
|
1484
|
-
(
|
|
1488
|
+
(l.searchQuery || n) && l.searchQuery !== n && (window.location.hash = Pe({
|
|
1485
1489
|
...z,
|
|
1486
|
-
searchQuery:
|
|
1490
|
+
searchQuery: l.searchQuery
|
|
1487
1491
|
}));
|
|
1488
|
-
}, [z,
|
|
1489
|
-
async (
|
|
1490
|
-
|
|
1492
|
+
}, [z, l.searchQuery, A]), $t = e.useCallback(
|
|
1493
|
+
async (n) => {
|
|
1494
|
+
n.preventDefault(), n.stopPropagation(), P && await bn(P);
|
|
1491
1495
|
},
|
|
1492
|
-
[
|
|
1496
|
+
[P]
|
|
1493
1497
|
), Ot = e.useCallback(() => {
|
|
1494
1498
|
x && (localStorage.removeItem(`${x}.columnNames`), localStorage.removeItem(`${x}.columnWidths`), Re(void 0), We(void 0));
|
|
1495
1499
|
}, [x]), et = e.useCallback(
|
|
1496
|
-
(
|
|
1497
|
-
if (!
|
|
1500
|
+
(n) => {
|
|
1501
|
+
if (!P || !v || !ne || !ce)
|
|
1498
1502
|
return !0;
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1503
|
+
const u = P[n];
|
|
1504
|
+
return u && v[u._index] !== void 0;
|
|
1501
1505
|
},
|
|
1502
|
-
[
|
|
1503
|
-
), Rt = e.useMemo(() => be ? !(v && !Ie) && !ne ? /* @__PURE__ */
|
|
1506
|
+
[ce, ne, P, v]
|
|
1507
|
+
), Rt = e.useMemo(() => be ? !(v && !Ie) && !ne ? /* @__PURE__ */ r(
|
|
1504
1508
|
"div",
|
|
1505
1509
|
{
|
|
1506
1510
|
style: {
|
|
@@ -1513,16 +1517,16 @@ const Cn = ({
|
|
|
1513
1517
|
alignItems: "center",
|
|
1514
1518
|
justifyContent: "center"
|
|
1515
1519
|
},
|
|
1516
|
-
children: Ie ? /* @__PURE__ */
|
|
1520
|
+
children: Ie ? /* @__PURE__ */ r("button", { onClick: ke, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ r("div", { children: "⌛ Loading..." })
|
|
1517
1521
|
}
|
|
1518
|
-
) : ne &&
|
|
1522
|
+
) : ne && ce ? /* @__PURE__ */ r(
|
|
1519
1523
|
Kt,
|
|
1520
1524
|
{
|
|
1521
1525
|
ref: c,
|
|
1522
1526
|
isItemLoaded: et,
|
|
1523
|
-
itemCount:
|
|
1527
|
+
itemCount: ce,
|
|
1524
1528
|
loadMoreItems: ne,
|
|
1525
|
-
children: ({ onItemsRendered:
|
|
1529
|
+
children: ({ onItemsRendered: u, ref: d }) => /* @__PURE__ */ r(
|
|
1526
1530
|
ct,
|
|
1527
1531
|
{
|
|
1528
1532
|
className: "mig-schema-table__tbody",
|
|
@@ -1533,26 +1537,26 @@ const Cn = ({
|
|
|
1533
1537
|
rowHeight: Ke,
|
|
1534
1538
|
columnCount: ve,
|
|
1535
1539
|
rowCount: $e,
|
|
1536
|
-
ref:
|
|
1540
|
+
ref: d,
|
|
1537
1541
|
onItemsRendered: ({
|
|
1538
|
-
overscanRowStartIndex:
|
|
1542
|
+
overscanRowStartIndex: a,
|
|
1539
1543
|
overscanRowStopIndex: f,
|
|
1540
1544
|
visibleRowStartIndex: L,
|
|
1541
1545
|
visibleRowStopIndex: b
|
|
1542
|
-
}) =>
|
|
1543
|
-
overscanStartIndex:
|
|
1546
|
+
}) => u({
|
|
1547
|
+
overscanStartIndex: a,
|
|
1544
1548
|
overscanStopIndex: f,
|
|
1545
1549
|
visibleStartIndex: L,
|
|
1546
1550
|
visibleStopIndex: b
|
|
1547
1551
|
}),
|
|
1548
1552
|
children: Ct
|
|
1549
1553
|
},
|
|
1550
|
-
`tbody_${be}_${ue}_${
|
|
1554
|
+
`tbody_${be}_${ue}_${l.sortColumn}_${l.sortAsc}_${l.searchQuery}_${ve}_${le.join(
|
|
1551
1555
|
" "
|
|
1552
1556
|
)}`
|
|
1553
1557
|
)
|
|
1554
1558
|
}
|
|
1555
|
-
) : /* @__PURE__ */
|
|
1559
|
+
) : /* @__PURE__ */ r(
|
|
1556
1560
|
ct,
|
|
1557
1561
|
{
|
|
1558
1562
|
className: "mig-schema-table__tbody",
|
|
@@ -1563,32 +1567,32 @@ const Cn = ({
|
|
|
1563
1567
|
rowHeight: Ke,
|
|
1564
1568
|
columnCount: ve,
|
|
1565
1569
|
rowCount: $e,
|
|
1566
|
-
ref:
|
|
1570
|
+
ref: se,
|
|
1567
1571
|
children: Ct
|
|
1568
1572
|
},
|
|
1569
|
-
`tbody_${be}_${ue}_${
|
|
1573
|
+
`tbody_${be}_${ue}_${l.sortColumn}_${l.sortAsc}_${l.searchQuery}_${ve}_${le.join(
|
|
1570
1574
|
" "
|
|
1571
1575
|
)}`
|
|
1572
1576
|
) : null, [
|
|
1573
1577
|
ve,
|
|
1574
|
-
|
|
1578
|
+
le,
|
|
1575
1579
|
ze,
|
|
1576
1580
|
Ke,
|
|
1577
1581
|
c,
|
|
1578
1582
|
Ie,
|
|
1579
1583
|
et,
|
|
1580
|
-
|
|
1584
|
+
ce,
|
|
1581
1585
|
ne,
|
|
1582
1586
|
ke,
|
|
1583
1587
|
$e,
|
|
1584
1588
|
Q,
|
|
1585
1589
|
ue,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1590
|
+
l.searchQuery,
|
|
1591
|
+
l.sortAsc,
|
|
1592
|
+
l.sortColumn,
|
|
1589
1593
|
v,
|
|
1590
1594
|
be,
|
|
1591
|
-
|
|
1595
|
+
se
|
|
1592
1596
|
]), Wt = e.useMemo(
|
|
1593
1597
|
() => ({
|
|
1594
1598
|
...I,
|
|
@@ -1598,26 +1602,26 @@ const Cn = ({
|
|
|
1598
1602
|
}),
|
|
1599
1603
|
[y, ue, I, Ne, me]
|
|
1600
1604
|
), jt = s || "input";
|
|
1601
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ r(
|
|
1602
1606
|
De.Provider,
|
|
1603
1607
|
{
|
|
1604
1608
|
value: {
|
|
1605
1609
|
checkedIndexes: p,
|
|
1606
1610
|
columnNames: Y,
|
|
1607
|
-
columnWidths:
|
|
1608
|
-
config:
|
|
1611
|
+
columnWidths: le,
|
|
1612
|
+
config: h,
|
|
1609
1613
|
disabledCheckedIndexes: R,
|
|
1610
1614
|
displayTimezone: T,
|
|
1611
1615
|
dropTargetIndex: qe,
|
|
1612
1616
|
getRowClassName: V,
|
|
1613
1617
|
getRowSelected: ee,
|
|
1614
|
-
isColumnFilterable:
|
|
1618
|
+
isColumnFilterable: i,
|
|
1615
1619
|
isItemLoaded: et,
|
|
1616
1620
|
isSortable: te,
|
|
1617
1621
|
lastCheckChangedRowIndex: pe,
|
|
1618
1622
|
onRowClick: N,
|
|
1619
|
-
onRowDoubleClick:
|
|
1620
|
-
properties:
|
|
1623
|
+
onRowDoubleClick: oe,
|
|
1624
|
+
properties: ie,
|
|
1621
1625
|
required: At,
|
|
1622
1626
|
setCheckedIndexes: Z,
|
|
1623
1627
|
setCustomColumnNames: Re,
|
|
@@ -1625,11 +1629,11 @@ const Cn = ({
|
|
|
1625
1629
|
setDropTargetIndex: Ee,
|
|
1626
1630
|
setFilterSortColumn: Ye,
|
|
1627
1631
|
setLastCheckChangedRowIndex: _e,
|
|
1628
|
-
setMenuConfig:
|
|
1632
|
+
setMenuConfig: ae,
|
|
1629
1633
|
settingsStorageKey: x,
|
|
1630
|
-
sortedRenderData:
|
|
1634
|
+
sortedRenderData: P,
|
|
1631
1635
|
sourceData: v,
|
|
1632
|
-
tableDataState:
|
|
1636
|
+
tableDataState: l,
|
|
1633
1637
|
translate: D || gt
|
|
1634
1638
|
},
|
|
1635
1639
|
children: /* @__PURE__ */ F(
|
|
@@ -1646,7 +1650,7 @@ const Cn = ({
|
|
|
1646
1650
|
className: "mig-schema-table__action-container",
|
|
1647
1651
|
ref: st,
|
|
1648
1652
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ r("div", { children: B ? /* @__PURE__ */ r(
|
|
1650
1654
|
jt,
|
|
1651
1655
|
{
|
|
1652
1656
|
className: "mig-schema-table__search",
|
|
@@ -1654,44 +1658,44 @@ const Cn = ({
|
|
|
1654
1658
|
name: "search",
|
|
1655
1659
|
autoComplete: "off",
|
|
1656
1660
|
placeholder: ge || D("search..."),
|
|
1657
|
-
value:
|
|
1661
|
+
value: l.searchQuery,
|
|
1658
1662
|
onChange: Et,
|
|
1659
1663
|
onKeyDown: it,
|
|
1660
1664
|
autoFocus: k,
|
|
1661
1665
|
onBlur: St
|
|
1662
1666
|
}
|
|
1663
1667
|
) : null }),
|
|
1664
|
-
t ? /* @__PURE__ */
|
|
1668
|
+
t ? /* @__PURE__ */ r(
|
|
1665
1669
|
t,
|
|
1666
1670
|
{
|
|
1667
1671
|
...S,
|
|
1668
|
-
renderData:
|
|
1672
|
+
renderData: P
|
|
1669
1673
|
}
|
|
1670
|
-
) : /* @__PURE__ */
|
|
1671
|
-
O && Array.isArray(C) ? /* @__PURE__ */
|
|
1674
|
+
) : /* @__PURE__ */ r("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1675
|
+
O && Array.isArray(C) ? /* @__PURE__ */ r("span", { className: "mig-schema-table__row_counter", children: D(
|
|
1672
1676
|
"showingFilteredCountOfTotalCount",
|
|
1673
|
-
|
|
1677
|
+
P?.length || 0,
|
|
1674
1678
|
C.length
|
|
1675
1679
|
) }) : null,
|
|
1676
|
-
o ? /* @__PURE__ */
|
|
1680
|
+
o ? /* @__PURE__ */ r(
|
|
1677
1681
|
"button",
|
|
1678
1682
|
{
|
|
1679
1683
|
onClick: $t,
|
|
1680
1684
|
style: { marginLeft: 8 },
|
|
1681
|
-
disabled: !
|
|
1685
|
+
disabled: !P?.length,
|
|
1682
1686
|
children: D("exportData")
|
|
1683
1687
|
}
|
|
1684
1688
|
) : null,
|
|
1685
|
-
B ||
|
|
1689
|
+
B || i ? /* @__PURE__ */ r(
|
|
1686
1690
|
"button",
|
|
1687
1691
|
{
|
|
1688
1692
|
onClick: It,
|
|
1689
1693
|
style: { marginLeft: 8 },
|
|
1690
|
-
disabled:
|
|
1694
|
+
disabled: l.columnFilterMap && l.searchQuery ? Object.keys(l.columnFilterMap).length + l.searchQuery.length === 0 : !1,
|
|
1691
1695
|
children: D("clearFilters")
|
|
1692
1696
|
}
|
|
1693
1697
|
) : null,
|
|
1694
|
-
x ? /* @__PURE__ */
|
|
1698
|
+
x ? /* @__PURE__ */ r(
|
|
1695
1699
|
"button",
|
|
1696
1700
|
{
|
|
1697
1701
|
onClick: Ot,
|
|
@@ -1704,45 +1708,45 @@ const Cn = ({
|
|
|
1704
1708
|
}
|
|
1705
1709
|
),
|
|
1706
1710
|
/* @__PURE__ */ F("div", { className: "mig-schema-table__column_resize_container", children: [
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
|
|
1711
|
+
/* @__PURE__ */ r(
|
|
1712
|
+
m,
|
|
1709
1713
|
{
|
|
1710
1714
|
height: _t,
|
|
1711
1715
|
itemCount: ve,
|
|
1712
1716
|
itemSize: ze,
|
|
1713
1717
|
layout: "horizontal",
|
|
1714
1718
|
width: ue,
|
|
1715
|
-
sortAsc:
|
|
1719
|
+
sortAsc: l.sortAsc,
|
|
1716
1720
|
setFilterSortColumn: Ye,
|
|
1717
|
-
sortColumn:
|
|
1718
|
-
sortedRenderData:
|
|
1721
|
+
sortColumn: l.sortColumn,
|
|
1722
|
+
sortedRenderData: P,
|
|
1719
1723
|
className: "mig-schema-table__th-row",
|
|
1720
1724
|
children: ln
|
|
1721
1725
|
},
|
|
1722
|
-
`thead_${ue}_${
|
|
1726
|
+
`thead_${ue}_${l.sortColumn}_${l.sortAsc}_${l.searchQuery}_${le.join(
|
|
1723
1727
|
" "
|
|
1724
1728
|
)}`
|
|
1725
1729
|
),
|
|
1726
1730
|
Rt,
|
|
1727
|
-
_ ? /* @__PURE__ */
|
|
1731
|
+
_ ? /* @__PURE__ */ r(
|
|
1728
1732
|
hn,
|
|
1729
1733
|
{
|
|
1730
|
-
columnWidths:
|
|
1734
|
+
columnWidths: le,
|
|
1731
1735
|
resizeColumnIndex: Ze,
|
|
1732
1736
|
setResizeColumnIndex: Ae,
|
|
1733
1737
|
tableBodyHeight: be
|
|
1734
1738
|
}
|
|
1735
1739
|
) : null
|
|
1736
1740
|
] }),
|
|
1737
|
-
v && v.length === 0 ? /* @__PURE__ */
|
|
1741
|
+
v && v.length === 0 ? /* @__PURE__ */ r("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
|
|
1738
1742
|
w ? Qt(
|
|
1739
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ r(
|
|
1740
1744
|
mn,
|
|
1741
1745
|
{
|
|
1742
|
-
isFilterable:
|
|
1746
|
+
isFilterable: i && w.propConfig?.isFilterable !== !1,
|
|
1743
1747
|
isSortable: Dt(
|
|
1744
1748
|
te,
|
|
1745
|
-
|
|
1749
|
+
J.properties[w.propName],
|
|
1746
1750
|
w.propConfig
|
|
1747
1751
|
),
|
|
1748
1752
|
onChange: Nt,
|
|
@@ -1751,11 +1755,11 @@ const Cn = ({
|
|
|
1751
1755
|
propConfig: w.propConfig,
|
|
1752
1756
|
propIsRequired: w.propIsRequired,
|
|
1753
1757
|
propName: w.propName,
|
|
1754
|
-
propSchema:
|
|
1758
|
+
propSchema: J.properties[w.propName],
|
|
1755
1759
|
referenceElement: w.referenceElement,
|
|
1756
1760
|
setFilterSortColumn: Ye,
|
|
1757
1761
|
translate: D,
|
|
1758
|
-
value:
|
|
1762
|
+
value: l.columnFilterMap ? l.columnFilterMap[w.propName] : null
|
|
1759
1763
|
}
|
|
1760
1764
|
),
|
|
1761
1765
|
document.body
|
|
@@ -1766,15 +1770,15 @@ const Cn = ({
|
|
|
1766
1770
|
}
|
|
1767
1771
|
);
|
|
1768
1772
|
}, yn = e.forwardRef(Cn), Rn = e.memo(yn), Wn = e.memo(({ refresh: t, period: s = 60 }) => {
|
|
1769
|
-
const [
|
|
1770
|
-
|
|
1773
|
+
const [m, g] = e.useState(/* @__PURE__ */ new Date()), [p, h] = e.useState(/* @__PURE__ */ new Date()), S = e.useCallback(() => {
|
|
1774
|
+
h(/* @__PURE__ */ new Date()), t();
|
|
1771
1775
|
}, [t]), C = e.useMemo(
|
|
1772
|
-
() => Jt(
|
|
1773
|
-
[
|
|
1776
|
+
() => Jt(m, p),
|
|
1777
|
+
[m, p]
|
|
1774
1778
|
);
|
|
1775
1779
|
e.useEffect(() => {
|
|
1776
1780
|
C > s && S();
|
|
1777
|
-
}, [C,
|
|
1781
|
+
}, [C, m, p, s, S]), e.useEffect(() => {
|
|
1778
1782
|
const E = setInterval(() => {
|
|
1779
1783
|
g(/* @__PURE__ */ new Date());
|
|
1780
1784
|
}, 1e3);
|