mig-schema-table 5.0.9 → 5.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mig-schema-table.es.js +217 -216
- package/dist/mig-schema-table.umd.js +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as W, Fragment as Wt } from "react/jsx-runtime";
|
|
2
2
|
import * as Ft from "react";
|
|
3
3
|
import e from "react";
|
|
4
4
|
import { createPortal as jt } from "react-dom";
|
|
5
5
|
import { VariableSizeGrid as lt, VariableSizeList as Bt } from "react-window";
|
|
6
6
|
import { format as Qt, endOfDay as zt, differenceInSeconds as Ut } from "date-fns";
|
|
7
7
|
import { nl as Jt } from "date-fns/locale";
|
|
8
|
-
import { unCamel as Vt, emptyFn as ve, timeZone as Te, localeFormatInTimeZone as
|
|
8
|
+
import { unCamel as Vt, emptyFn as ve, timeZone as Te, localeFormatInTimeZone as wt, parseLocationHash as ct, serializeLocationHash as ze } from "mig-data-tools";
|
|
9
9
|
import { range as Pt, debounce as Zt, difference as qt, isEqual as et, isFinite as Gt, sum as Xt } from "lodash";
|
|
10
10
|
import ut from "react-datepicker";
|
|
11
11
|
import { nl as dt } from "date-fns/locale/nl";
|
|
@@ -13,9 +13,9 @@ import { TZDate as Ue } from "@date-fns/tz";
|
|
|
13
13
|
import { useFloating as mt, flip as ht } from "@floating-ui/react-dom";
|
|
14
14
|
import Ht from "react-window-infinite-loader";
|
|
15
15
|
import { saveAs as Yt } from "file-saver";
|
|
16
|
-
const tt = (
|
|
16
|
+
const tt = (t, o) => (
|
|
17
17
|
// replace jan. with jan
|
|
18
|
-
Qt(
|
|
18
|
+
Qt(t, o, { locale: Jt }).replace(".", "")
|
|
19
19
|
), Kt = {
|
|
20
20
|
"Europe/Amsterdam": "AMS",
|
|
21
21
|
"Europe/Berlin": "AMS",
|
|
@@ -23,14 +23,14 @@ const tt = (n, o) => (
|
|
|
23
23
|
"Asia/Bangkok": "JKT",
|
|
24
24
|
showingFilteredCountOfTotalCount: "Showing {0} of {1}"
|
|
25
25
|
};
|
|
26
|
-
function ft(
|
|
27
|
-
let u = Kt[
|
|
26
|
+
function ft(t, ...o) {
|
|
27
|
+
let u = Kt[t] || Vt(t);
|
|
28
28
|
return o.forEach((p, f) => {
|
|
29
29
|
u = u.replace(`{${f}}`, `${p}`);
|
|
30
30
|
}), u;
|
|
31
31
|
}
|
|
32
|
-
const ee = "SELECT_ALL_COLUMN_NAME", bt = 40,
|
|
33
|
-
var be = /* @__PURE__ */ ((
|
|
32
|
+
const ee = "SELECT_ALL_COLUMN_NAME", bt = 40, yt = "dd MMM yyyy", Je = "dd MMM yyyy HH:mm", vt = 25, gt = 50, en = 3;
|
|
33
|
+
var be = /* @__PURE__ */ ((t) => (t.GT = "GT", t.LT = "LT", t.EQ = "EQ", t))(be || {}), $e = /* @__PURE__ */ ((t) => (t.UNAVAILABLE = "UNAVAILABLE", t.AVAILABLE = "AVAILABLE", t.ACTIVE = "ACTIVE", t))($e || {});
|
|
34
34
|
const Me = Ft.createContext({
|
|
35
35
|
checkedIndexes: [],
|
|
36
36
|
columnNames: [],
|
|
@@ -56,7 +56,7 @@ const Me = Ft.createContext({
|
|
|
56
56
|
sortAsc: !1
|
|
57
57
|
},
|
|
58
58
|
translate: ve
|
|
59
|
-
}), tn = { type: "boolean" }, nn = ({ columnIndex:
|
|
59
|
+
}), tn = { type: "boolean" }, nn = ({ columnIndex: t, rowIndex: o, style: u }) => {
|
|
60
60
|
const {
|
|
61
61
|
checkedIndexes: p,
|
|
62
62
|
columnNames: f,
|
|
@@ -65,9 +65,9 @@ const Me = Ft.createContext({
|
|
|
65
65
|
displayTimezone: _,
|
|
66
66
|
getRowClassName: R,
|
|
67
67
|
getRowSelected: I,
|
|
68
|
-
isItemLoaded:
|
|
68
|
+
isItemLoaded: M,
|
|
69
69
|
lastCheckChangedRowIndex: $,
|
|
70
|
-
onRowClick:
|
|
70
|
+
onRowClick: E,
|
|
71
71
|
onRowDoubleClick: y,
|
|
72
72
|
properties: S,
|
|
73
73
|
setCheckedIndexes: Z,
|
|
@@ -75,25 +75,25 @@ const Me = Ft.createContext({
|
|
|
75
75
|
sortedRenderData: D,
|
|
76
76
|
sourceData: s,
|
|
77
77
|
translate: m
|
|
78
|
-
} = e.useContext(Me), b = f[
|
|
78
|
+
} = e.useContext(Me), b = f[t], w = b === ee ? tn : S[b], U = l ? l[b] : void 0, te = e.useCallback(
|
|
79
79
|
(v) => {
|
|
80
|
-
Z && Z((A) => A && A.includes(v) ? A.filter((
|
|
80
|
+
Z && Z((A) => A && A.includes(v) ? A.filter((T) => T !== v) : A ? [...A, v] : [v]);
|
|
81
81
|
},
|
|
82
82
|
[Z]
|
|
83
|
-
), le =
|
|
83
|
+
), le = M(o), ne = e.useCallback(
|
|
84
84
|
(v) => {
|
|
85
|
-
if (!s || !D || !
|
|
85
|
+
if (!s || !D || !E || !le)
|
|
86
86
|
return;
|
|
87
87
|
const { rowIndex: A } = v.currentTarget.dataset;
|
|
88
88
|
if (!A)
|
|
89
89
|
return;
|
|
90
90
|
const k = D[parseInt(A, 10)];
|
|
91
|
-
|
|
91
|
+
E(s[k._index], k._index, v);
|
|
92
92
|
},
|
|
93
|
-
[le,
|
|
93
|
+
[le, E, D, s]
|
|
94
94
|
), C = e.useCallback(
|
|
95
95
|
(v) => {
|
|
96
|
-
if (!s || !D || !y || !
|
|
96
|
+
if (!s || !D || !y || !M)
|
|
97
97
|
return;
|
|
98
98
|
const { rowIndex: A } = v.currentTarget.dataset;
|
|
99
99
|
if (!A)
|
|
@@ -101,14 +101,14 @@ const Me = Ft.createContext({
|
|
|
101
101
|
const k = D[parseInt(A, 10)];
|
|
102
102
|
y(s[k._index], k._index, v);
|
|
103
103
|
},
|
|
104
|
-
[
|
|
104
|
+
[M, y, D, s]
|
|
105
105
|
), L = D ? D[o] : void 0, { showTimezones: se, TdBody: G } = U || {}, re = e.useMemo(() => _ ? null : Te.startsWith("Europe/") ? "Asia/Jakarta" : "Europe/Amsterdam", [_]), B = e.useMemo(() => {
|
|
106
106
|
if (!L || !D)
|
|
107
107
|
return;
|
|
108
108
|
let v = b === ee ? void 0 : L[b];
|
|
109
109
|
if (w?.format && w.format === "date-time" && se !== !1) {
|
|
110
|
-
const k = s ? s[L._index] : void 0,
|
|
111
|
-
ce && re && (v = `${
|
|
110
|
+
const k = s ? s[L._index] : void 0, T = k ? k[b] : void 0, ce = T ? new Date(T) : void 0;
|
|
111
|
+
ce && re && (v = `${wt(
|
|
112
112
|
ce,
|
|
113
113
|
re,
|
|
114
114
|
Je
|
|
@@ -134,7 +134,7 @@ const Me = Ft.createContext({
|
|
|
134
134
|
}
|
|
135
135
|
return {
|
|
136
136
|
"data-row-index": o,
|
|
137
|
-
"data-column-index":
|
|
137
|
+
"data-column-index": t,
|
|
138
138
|
style: u,
|
|
139
139
|
className: A.join(" "),
|
|
140
140
|
title: v,
|
|
@@ -151,7 +151,7 @@ const Me = Ft.createContext({
|
|
|
151
151
|
s,
|
|
152
152
|
I,
|
|
153
153
|
R,
|
|
154
|
-
|
|
154
|
+
t,
|
|
155
155
|
u,
|
|
156
156
|
ne,
|
|
157
157
|
C,
|
|
@@ -166,10 +166,10 @@ const Me = Ft.createContext({
|
|
|
166
166
|
if (v.shiftKey && $ !== void 0) {
|
|
167
167
|
const k = p?.includes($) ? $ : void 0;
|
|
168
168
|
if (k !== void 0 && D) {
|
|
169
|
-
const
|
|
169
|
+
const T = o;
|
|
170
170
|
for (const ce of Pt(
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
T > k ? k + 1 : T,
|
|
172
|
+
T > k ? T + 1 : k
|
|
173
173
|
)) {
|
|
174
174
|
const me = D[ce]._index;
|
|
175
175
|
(!O || !O.includes(me)) && te(me);
|
|
@@ -192,10 +192,10 @@ const Me = Ft.createContext({
|
|
|
192
192
|
), _e = e.useRef(null);
|
|
193
193
|
if (!L || !B)
|
|
194
194
|
return null;
|
|
195
|
-
if (!
|
|
196
|
-
return /* @__PURE__ */
|
|
195
|
+
if (!M || s && !s[L._index])
|
|
196
|
+
return /* @__PURE__ */ n("div", { ...B, children: "loading" });
|
|
197
197
|
if (b === ee)
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ n("div", { ...B, onMouseDown: V, children: /* @__PURE__ */ n("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ n(
|
|
199
199
|
"input",
|
|
200
200
|
{
|
|
201
201
|
ref: _e,
|
|
@@ -206,7 +206,7 @@ const Me = Ft.createContext({
|
|
|
206
206
|
}
|
|
207
207
|
) }) });
|
|
208
208
|
if (G && s)
|
|
209
|
-
return /* @__PURE__ */
|
|
209
|
+
return /* @__PURE__ */ n("div", { ...B, children: /* @__PURE__ */ n(
|
|
210
210
|
G,
|
|
211
211
|
{
|
|
212
212
|
dataIndex: L._index,
|
|
@@ -216,7 +216,7 @@ const Me = Ft.createContext({
|
|
|
216
216
|
}
|
|
217
217
|
) });
|
|
218
218
|
const q = L[b];
|
|
219
|
-
return w?.format === "url" && q ? /* @__PURE__ */
|
|
219
|
+
return w?.format === "url" && q ? /* @__PURE__ */ n(
|
|
220
220
|
"a",
|
|
221
221
|
{
|
|
222
222
|
href: q,
|
|
@@ -225,33 +225,33 @@ const Me = Ft.createContext({
|
|
|
225
225
|
...B,
|
|
226
226
|
children: q
|
|
227
227
|
}
|
|
228
|
-
) : /* @__PURE__ */
|
|
228
|
+
) : /* @__PURE__ */ n("div", { ...B, children: q });
|
|
229
229
|
}, pt = e.memo(nn);
|
|
230
230
|
function rn() {
|
|
231
|
-
const { checkedIndexes:
|
|
231
|
+
const { checkedIndexes: t, disabledCheckedIndexes: o, sortedRenderData: u } = e.useContext(Me);
|
|
232
232
|
return e.useMemo(() => {
|
|
233
233
|
const p = [...u || []].filter(
|
|
234
|
-
(f) => (
|
|
234
|
+
(f) => (t ? t.includes(f._index) : !0) || (o ? !o.includes(f._index) : !0)
|
|
235
235
|
);
|
|
236
|
-
return
|
|
237
|
-
}, [
|
|
236
|
+
return t?.length !== 0 && p.length === t?.length;
|
|
237
|
+
}, [t, o, u]);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return !!(
|
|
239
|
+
function kt(t, o, u) {
|
|
240
|
+
return !!(t && u?.isSortable !== !1 && (o || u?.renderData || u?.sort));
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const { setCustomColumnWidths:
|
|
242
|
+
function xt() {
|
|
243
|
+
const { setCustomColumnWidths: t, settingsStorageKey: o } = e.useContext(Me);
|
|
244
244
|
return e.useCallback(
|
|
245
245
|
(u) => {
|
|
246
246
|
o && localStorage.setItem(
|
|
247
247
|
`${o}.columnWidths`,
|
|
248
248
|
JSON.stringify(Array.from(u))
|
|
249
|
-
),
|
|
249
|
+
), t(u);
|
|
250
250
|
},
|
|
251
|
-
[
|
|
251
|
+
[t, o]
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
const on = ({ index:
|
|
254
|
+
const on = ({ index: t, style: o }) => {
|
|
255
255
|
const {
|
|
256
256
|
checkedIndexes: u,
|
|
257
257
|
columnNames: p,
|
|
@@ -261,9 +261,9 @@ const on = ({ index: n, style: o }) => {
|
|
|
261
261
|
dropTargetIndex: _,
|
|
262
262
|
isColumnFilterable: R,
|
|
263
263
|
isSortable: I,
|
|
264
|
-
setCheckedIndexes:
|
|
264
|
+
setCheckedIndexes: M,
|
|
265
265
|
properties: $,
|
|
266
|
-
required:
|
|
266
|
+
required: E,
|
|
267
267
|
setCustomColumnNames: y,
|
|
268
268
|
setDropTargetIndex: S,
|
|
269
269
|
setFilterSortColumn: Z,
|
|
@@ -273,10 +273,10 @@ const on = ({ index: n, style: o }) => {
|
|
|
273
273
|
sortedRenderData: m,
|
|
274
274
|
translate: b,
|
|
275
275
|
displayTimezone: w
|
|
276
|
-
} = e.useContext(Me), [U, te] = e.useState(!1), le =
|
|
276
|
+
} = e.useContext(Me), [U, te] = e.useState(!1), le = t === _, ne = xt(), C = p[t], L = C === ee ? { type: "boolean" } : $[C], se = s.sortColumn === C ? s.sortAsc : void 0, G = l ? l[C] : void 0;
|
|
277
277
|
let re = R && (L || G?.FilterMenu) && G?.isFilterable !== !1 ? $e.AVAILABLE : $e.UNAVAILABLE;
|
|
278
278
|
s.columnFilterMap && s.columnFilterMap[C] !== void 0 && (re = $e.ACTIVE);
|
|
279
|
-
const B =
|
|
279
|
+
const B = kt(
|
|
280
280
|
I,
|
|
281
281
|
L,
|
|
282
282
|
G
|
|
@@ -293,7 +293,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
293
293
|
defaultSortDesc: v,
|
|
294
294
|
showTimezones: A = !w,
|
|
295
295
|
title: k
|
|
296
|
-
} = G || {},
|
|
296
|
+
} = G || {}, T = e.useCallback(() => {
|
|
297
297
|
if (B) {
|
|
298
298
|
if (se === void 0) {
|
|
299
299
|
Z(C, !v);
|
|
@@ -307,7 +307,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
307
307
|
C,
|
|
308
308
|
Z,
|
|
309
309
|
se
|
|
310
|
-
]), ce =
|
|
310
|
+
]), ce = E.includes(C), me = e.useCallback(
|
|
311
311
|
(j) => {
|
|
312
312
|
const he = j.currentTarget;
|
|
313
313
|
Y((we) => {
|
|
@@ -351,9 +351,9 @@ const on = ({ index: n, style: o }) => {
|
|
|
351
351
|
oe && (te(!1), S(-1));
|
|
352
352
|
}, [oe, S]), Ve = e.useCallback(
|
|
353
353
|
(j) => {
|
|
354
|
-
oe && (j.preventDefault(), S(
|
|
354
|
+
oe && (j.preventDefault(), S(t));
|
|
355
355
|
},
|
|
356
|
-
[
|
|
356
|
+
[t, oe, S]
|
|
357
357
|
), Pe = e.useCallback(
|
|
358
358
|
(j) => {
|
|
359
359
|
if (S(-1), !oe || !C)
|
|
@@ -363,17 +363,17 @@ const on = ({ index: n, style: o }) => {
|
|
|
363
363
|
},
|
|
364
364
|
[oe, C, S]
|
|
365
365
|
), Le = rn(), Ze = e.useCallback(() => {
|
|
366
|
-
!
|
|
366
|
+
!M || !m || M(
|
|
367
367
|
Le ? [] : m.map((j) => j._index).filter((j) => !O?.includes(j))
|
|
368
368
|
);
|
|
369
369
|
}, [
|
|
370
|
-
|
|
370
|
+
M,
|
|
371
371
|
m,
|
|
372
372
|
Le,
|
|
373
373
|
O
|
|
374
374
|
]);
|
|
375
375
|
if (C === ee)
|
|
376
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ n("div", { style: o, className: V.join(" "), children: /* @__PURE__ */ n(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -381,7 +381,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
381
381
|
textAlign: "center"
|
|
382
382
|
},
|
|
383
383
|
title: `${u?.length || 0} selected`,
|
|
384
|
-
children: /* @__PURE__ */
|
|
384
|
+
children: /* @__PURE__ */ n(
|
|
385
385
|
"input",
|
|
386
386
|
{
|
|
387
387
|
type: "checkbox",
|
|
@@ -427,19 +427,19 @@ const on = ({ index: n, style: o }) => {
|
|
|
427
427
|
{
|
|
428
428
|
className: "mig-schema-table__th__label-body",
|
|
429
429
|
style: { lineHeight: "44px" },
|
|
430
|
-
onClick:
|
|
430
|
+
onClick: T,
|
|
431
431
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
se === void 0 ? null : /* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ n("span", { className: "mig-schema-table__th__label-body-text", children: Ce }),
|
|
433
|
+
se === void 0 ? null : /* @__PURE__ */ n("span", { className: "mig-schema-table__th__sort-icon", children: se ? "↓" : "↑" })
|
|
434
434
|
]
|
|
435
435
|
}
|
|
436
436
|
),
|
|
437
|
-
B || re !== $e.UNAVAILABLE ? /* @__PURE__ */
|
|
437
|
+
B || re !== $e.UNAVAILABLE ? /* @__PURE__ */ n(
|
|
438
438
|
"button",
|
|
439
439
|
{
|
|
440
440
|
className: "mig-schema-table__th__trigger-el",
|
|
441
441
|
onClick: me,
|
|
442
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ n(
|
|
443
443
|
"svg",
|
|
444
444
|
{
|
|
445
445
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -451,7 +451,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
451
451
|
strokeWidth: "2",
|
|
452
452
|
strokeLinecap: "round",
|
|
453
453
|
strokeLinejoin: "round",
|
|
454
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ n("polyline", { points: "6 9 12 15 18 9" })
|
|
455
455
|
}
|
|
456
456
|
)
|
|
457
457
|
}
|
|
@@ -465,7 +465,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
465
465
|
[be.EQ]: "="
|
|
466
466
|
}, ln = e.memo(
|
|
467
467
|
({
|
|
468
|
-
columnFilterValue:
|
|
468
|
+
columnFilterValue: t,
|
|
469
469
|
onChange: o,
|
|
470
470
|
onInputKeyDown: u,
|
|
471
471
|
propIsRequired: p,
|
|
@@ -473,12 +473,12 @@ const on = ({ index: n, style: o }) => {
|
|
|
473
473
|
propSchema: l,
|
|
474
474
|
translate: O
|
|
475
475
|
}) => {
|
|
476
|
-
const { displayTimezone: _ } = e.useContext(Me), { type: R, format: I, minimum:
|
|
476
|
+
const { displayTimezone: _ } = e.useContext(Me), { type: R, format: I, minimum: M, maximum: $ } = l || {}, E = t, y = I === "date-time";
|
|
477
477
|
let S, Z, Y, D;
|
|
478
478
|
switch (R) {
|
|
479
479
|
case "number":
|
|
480
480
|
case "integer":
|
|
481
|
-
return S =
|
|
481
|
+
return S = E || {}, Z = (s, m, b) => {
|
|
482
482
|
const w = {
|
|
483
483
|
...S,
|
|
484
484
|
[s]: m.value === "" ? void 0 : parseInt(m.value)
|
|
@@ -486,13 +486,13 @@ const on = ({ index: n, style: o }) => {
|
|
|
486
486
|
(te) => isFinite(te)
|
|
487
487
|
);
|
|
488
488
|
o(
|
|
489
|
-
U !== void 0 && (
|
|
489
|
+
U !== void 0 && (M === void 0 || U >= M) ? w : void 0,
|
|
490
490
|
b
|
|
491
491
|
);
|
|
492
492
|
}, /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
493
493
|
p ? null : /* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
494
494
|
/* @__PURE__ */ W("label", { className: "d-flex", children: [
|
|
495
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ n(
|
|
496
496
|
"input",
|
|
497
497
|
{
|
|
498
498
|
type: "checkbox",
|
|
@@ -509,13 +509,13 @@ const on = ({ index: n, style: o }) => {
|
|
|
509
509
|
),
|
|
510
510
|
"Hide empty values"
|
|
511
511
|
] }),
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ n("hr", {})
|
|
513
513
|
] }),
|
|
514
514
|
Object.keys(be).map((s) => {
|
|
515
515
|
const m = S[s];
|
|
516
516
|
return /* @__PURE__ */ W("li", { children: [
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ n("label", { style: { width: 40, paddingLeft: 16 }, children: an[s] }),
|
|
518
|
+
/* @__PURE__ */ n(
|
|
519
519
|
"input",
|
|
520
520
|
{
|
|
521
521
|
className: "form-control",
|
|
@@ -538,7 +538,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
538
538
|
);
|
|
539
539
|
},
|
|
540
540
|
onKeyDown: u,
|
|
541
|
-
min:
|
|
541
|
+
min: M,
|
|
542
542
|
max: $
|
|
543
543
|
}
|
|
544
544
|
)
|
|
@@ -546,7 +546,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
546
546
|
})
|
|
547
547
|
] });
|
|
548
548
|
case "boolean":
|
|
549
|
-
return Y = ["✓", "✕"], p || Y.push("?"), D =
|
|
549
|
+
return Y = ["✓", "✕"], p || Y.push("?"), D = E ? "✓" : "✕", E === null && (D = "?"), E === void 0 && (D = ""), /* @__PURE__ */ n("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ n("li", { children: /* @__PURE__ */ W(
|
|
550
550
|
"select",
|
|
551
551
|
{
|
|
552
552
|
autoFocus: !0,
|
|
@@ -569,8 +569,8 @@ const on = ({ index: n, style: o }) => {
|
|
|
569
569
|
}
|
|
570
570
|
},
|
|
571
571
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
Y.map((s) => /* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ n("option", { value: "", children: "All" }, "all"),
|
|
573
|
+
Y.map((s) => /* @__PURE__ */ n(
|
|
574
574
|
"option",
|
|
575
575
|
{
|
|
576
576
|
value: s,
|
|
@@ -584,19 +584,19 @@ const on = ({ index: n, style: o }) => {
|
|
|
584
584
|
// @ts-expect-error falls through
|
|
585
585
|
case "string":
|
|
586
586
|
if (l?.enum)
|
|
587
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ n("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ n("li", { children: /* @__PURE__ */ W(
|
|
588
588
|
"select",
|
|
589
589
|
{
|
|
590
590
|
autoFocus: !0,
|
|
591
591
|
className: "form-select",
|
|
592
|
-
value:
|
|
592
|
+
value: E,
|
|
593
593
|
"data-prop-name": f,
|
|
594
594
|
onChange: (s) => {
|
|
595
595
|
o(s.currentTarget.value || void 0, !0);
|
|
596
596
|
},
|
|
597
597
|
children: [
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
l.enum.map((s) => /* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ n("option", { value: "", children: "All" }, "all"),
|
|
599
|
+
l.enum.map((s) => /* @__PURE__ */ n(
|
|
600
600
|
"option",
|
|
601
601
|
{
|
|
602
602
|
value: s,
|
|
@@ -608,7 +608,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
608
608
|
}
|
|
609
609
|
) }) });
|
|
610
610
|
if (y || I === "date") {
|
|
611
|
-
const s = y ? Je :
|
|
611
|
+
const s = y ? Je : yt, m = t || {
|
|
612
612
|
from: void 0,
|
|
613
613
|
to: void 0,
|
|
614
614
|
filterEmpty: void 0
|
|
@@ -616,7 +616,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
616
616
|
return /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
617
617
|
p ? null : /* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
618
618
|
/* @__PURE__ */ W("label", { className: "d-flex", children: [
|
|
619
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ n(
|
|
620
620
|
"input",
|
|
621
621
|
{
|
|
622
622
|
type: "checkbox",
|
|
@@ -632,11 +632,11 @@ const on = ({ index: n, style: o }) => {
|
|
|
632
632
|
),
|
|
633
633
|
"Hide empty values"
|
|
634
634
|
] }),
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ n("hr", {})
|
|
636
636
|
] }),
|
|
637
637
|
/* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ n("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
|
|
639
|
+
/* @__PURE__ */ n(
|
|
640
640
|
ut,
|
|
641
641
|
{
|
|
642
642
|
dateFormat: s,
|
|
@@ -655,7 +655,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
655
655
|
const w = b ? Ue.tz(_ || Te, b) : void 0;
|
|
656
656
|
o(
|
|
657
657
|
{
|
|
658
|
-
...
|
|
658
|
+
...t,
|
|
659
659
|
from: w
|
|
660
660
|
},
|
|
661
661
|
!0
|
|
@@ -674,8 +674,8 @@ const on = ({ index: n, style: o }) => {
|
|
|
674
674
|
)
|
|
675
675
|
] }),
|
|
676
676
|
/* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ n("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
|
|
678
|
+
/* @__PURE__ */ n(
|
|
679
679
|
ut,
|
|
680
680
|
{
|
|
681
681
|
id: "filter-date",
|
|
@@ -696,7 +696,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
696
696
|
const w = b ? y ? Ue.tz(_ || Te, b) : zt(b) : void 0;
|
|
697
697
|
m.from && w && w < m.from || o(
|
|
698
698
|
{
|
|
699
|
-
...
|
|
699
|
+
...t,
|
|
700
700
|
to: w
|
|
701
701
|
},
|
|
702
702
|
!0
|
|
@@ -717,7 +717,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
717
717
|
}
|
|
718
718
|
// falls through
|
|
719
719
|
default:
|
|
720
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ n("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
721
721
|
"input",
|
|
722
722
|
{
|
|
723
723
|
autoFocus: !0,
|
|
@@ -725,7 +725,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
725
725
|
className: "form-control",
|
|
726
726
|
placeholder: `Search ${f}`,
|
|
727
727
|
"aria-label": `Search ${f}`,
|
|
728
|
-
value:
|
|
728
|
+
value: E || "",
|
|
729
729
|
"data-prop-name": f,
|
|
730
730
|
onChange: (s) => {
|
|
731
731
|
o(s.currentTarget.value || void 0, !1);
|
|
@@ -739,7 +739,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
), cn = ({
|
|
742
|
-
isSortable:
|
|
742
|
+
isSortable: t,
|
|
743
743
|
isFilterable: o,
|
|
744
744
|
onChange: u,
|
|
745
745
|
onClose: p,
|
|
@@ -749,9 +749,9 @@ const on = ({ index: n, style: o }) => {
|
|
|
749
749
|
propName: _,
|
|
750
750
|
propSchema: R,
|
|
751
751
|
referenceElement: I,
|
|
752
|
-
setFilterSortColumn:
|
|
752
|
+
setFilterSortColumn: M,
|
|
753
753
|
translate: $,
|
|
754
|
-
value:
|
|
754
|
+
value: E
|
|
755
755
|
}) => {
|
|
756
756
|
const y = mt({
|
|
757
757
|
placement: "bottom-start",
|
|
@@ -785,32 +785,32 @@ const on = ({ index: n, style: o }) => {
|
|
|
785
785
|
]);
|
|
786
786
|
const Z = l?.FilterMenu || ln, Y = e.useCallback(
|
|
787
787
|
(m) => {
|
|
788
|
-
|
|
788
|
+
M(_, !0), p(m);
|
|
789
789
|
},
|
|
790
|
-
[p, _,
|
|
790
|
+
[p, _, M]
|
|
791
791
|
), D = e.useCallback(
|
|
792
792
|
(m) => {
|
|
793
|
-
|
|
793
|
+
M(_, !1), p(m);
|
|
794
794
|
},
|
|
795
|
-
[p, _,
|
|
795
|
+
[p, _, M]
|
|
796
796
|
), s = e.useCallback(() => {
|
|
797
797
|
u(void 0, !0);
|
|
798
798
|
}, [u]);
|
|
799
|
-
return !
|
|
800
|
-
/* @__PURE__ */
|
|
799
|
+
return !t && !o ? null : /* @__PURE__ */ W(Wt, { children: [
|
|
800
|
+
/* @__PURE__ */ n(
|
|
801
801
|
"div",
|
|
802
802
|
{
|
|
803
803
|
className: "mig-schema-table mig-schema-table__th-menu",
|
|
804
804
|
ref: y.refs.setFloating,
|
|
805
805
|
style: y.floatingStyles,
|
|
806
806
|
children: /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu", children: [
|
|
807
|
-
|
|
808
|
-
/* @__PURE__ */
|
|
807
|
+
t ? /* @__PURE__ */ W("li", { onClick: Y, style: { padding: 8 }, children: [
|
|
808
|
+
/* @__PURE__ */ n("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
|
|
809
809
|
" ",
|
|
810
810
|
$("sortAscending")
|
|
811
811
|
] }) : null,
|
|
812
|
-
|
|
813
|
-
/* @__PURE__ */
|
|
812
|
+
t ? /* @__PURE__ */ W("li", { onClick: D, style: { padding: 8 }, children: [
|
|
813
|
+
/* @__PURE__ */ n("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
|
|
814
814
|
" ",
|
|
815
815
|
$("sortDescending")
|
|
816
816
|
] }) : null,
|
|
@@ -822,34 +822,34 @@ const on = ({ index: n, style: o }) => {
|
|
|
822
822
|
S.refs.setReference(m.currentTarget);
|
|
823
823
|
},
|
|
824
824
|
children: [
|
|
825
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ n("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ n(
|
|
826
826
|
"input",
|
|
827
827
|
{
|
|
828
828
|
type: "checkbox",
|
|
829
829
|
id: "mig-schema-table__th-menu__filters",
|
|
830
|
-
checked:
|
|
831
|
-
disabled:
|
|
830
|
+
checked: E !== void 0,
|
|
831
|
+
disabled: E === void 0,
|
|
832
832
|
onChange: s
|
|
833
833
|
}
|
|
834
834
|
) }),
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ n("label", { htmlFor: "mig-schema-table__th-menu__filters", children: $("filters") }),
|
|
836
|
+
/* @__PURE__ */ n("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
|
|
837
837
|
]
|
|
838
838
|
}
|
|
839
839
|
) : null
|
|
840
840
|
] })
|
|
841
841
|
}
|
|
842
842
|
),
|
|
843
|
-
S.elements.reference ? /* @__PURE__ */
|
|
843
|
+
S.elements.reference ? /* @__PURE__ */ n(
|
|
844
844
|
"div",
|
|
845
845
|
{
|
|
846
846
|
className: "mig-schema-table mig-schema-table__th-menu__sub-menu",
|
|
847
847
|
ref: S.refs.setFloating,
|
|
848
848
|
style: S.floatingStyles,
|
|
849
|
-
children: /* @__PURE__ */
|
|
849
|
+
children: /* @__PURE__ */ n(
|
|
850
850
|
Z,
|
|
851
851
|
{
|
|
852
|
-
columnFilterValue:
|
|
852
|
+
columnFilterValue: E,
|
|
853
853
|
onChange: u,
|
|
854
854
|
onInputKeyDown: f,
|
|
855
855
|
propIsRequired: O,
|
|
@@ -862,19 +862,19 @@ const on = ({ index: n, style: o }) => {
|
|
|
862
862
|
) : null
|
|
863
863
|
] });
|
|
864
864
|
}, un = e.memo(cn), dn = ({
|
|
865
|
-
columnWidths:
|
|
865
|
+
columnWidths: t,
|
|
866
866
|
resizeColumnIndex: o,
|
|
867
867
|
setResizeColumnIndex: u,
|
|
868
868
|
tableBodyHeight: p
|
|
869
869
|
}) => {
|
|
870
|
-
const [f, l] = e.useState(0), O =
|
|
870
|
+
const [f, l] = e.useState(0), O = xt(), _ = e.useCallback(
|
|
871
871
|
($) => {
|
|
872
|
-
const
|
|
873
|
-
(y, S) => S === o ? Math.max(y + $,
|
|
872
|
+
const E = t.map(
|
|
873
|
+
(y, S) => S === o ? Math.max(y + $, vt) : y
|
|
874
874
|
);
|
|
875
|
-
O(
|
|
875
|
+
O(E);
|
|
876
876
|
},
|
|
877
|
-
[
|
|
877
|
+
[t, o, O]
|
|
878
878
|
);
|
|
879
879
|
let R = 0;
|
|
880
880
|
const I = e.useCallback(
|
|
@@ -882,35 +882,35 @@ const on = ({ index: n, style: o }) => {
|
|
|
882
882
|
u(parseInt($.currentTarget.dataset.columnIndex)), l($.clientX);
|
|
883
883
|
},
|
|
884
884
|
[u]
|
|
885
|
-
),
|
|
885
|
+
), M = e.useCallback(
|
|
886
886
|
($) => {
|
|
887
887
|
_($.clientX - f), l(0), u(-1);
|
|
888
888
|
},
|
|
889
889
|
[f, _, u]
|
|
890
890
|
);
|
|
891
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ n("div", { children: [...t].map(($, E) => {
|
|
892
892
|
R += $;
|
|
893
893
|
const y = ["mig-schema-table__column_resizer"];
|
|
894
|
-
return
|
|
894
|
+
return E === o && y.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
897
|
style: { left: R - en, bottom: p },
|
|
898
898
|
className: y.join(" "),
|
|
899
899
|
draggable: "true",
|
|
900
|
-
"data-column-index":
|
|
900
|
+
"data-column-index": E,
|
|
901
901
|
onDragStart: I,
|
|
902
|
-
onDragEnd:
|
|
902
|
+
onDragEnd: M
|
|
903
903
|
},
|
|
904
|
-
|
|
904
|
+
E
|
|
905
905
|
);
|
|
906
906
|
}) });
|
|
907
|
-
}, _t = (
|
|
907
|
+
}, _t = (t) => {
|
|
908
908
|
const [o, u] = e.useState({ width: 0, height: 0 }), p = e.useMemo(
|
|
909
909
|
() => Zt(u, 100),
|
|
910
910
|
[]
|
|
911
911
|
);
|
|
912
912
|
return e.useEffect(() => {
|
|
913
|
-
if (!
|
|
913
|
+
if (!t)
|
|
914
914
|
return;
|
|
915
915
|
const f = new ResizeObserver((l) => {
|
|
916
916
|
for (const O of l) {
|
|
@@ -920,30 +920,30 @@ const on = ({ index: n, style: o }) => {
|
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
922
|
});
|
|
923
|
-
return f.observe(
|
|
923
|
+
return f.observe(t), () => {
|
|
924
924
|
f.disconnect();
|
|
925
925
|
};
|
|
926
|
-
}, [p,
|
|
927
|
-
}, mn = () => new Promise((
|
|
926
|
+
}, [p, t]), o;
|
|
927
|
+
}, mn = () => new Promise((t, o) => {
|
|
928
928
|
if (window.ExcelJS) {
|
|
929
|
-
|
|
929
|
+
t(window.ExcelJS);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
932
|
const u = document.createElement("script");
|
|
933
933
|
u.src = "https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.bare.min.js", u.onload = () => {
|
|
934
|
-
|
|
934
|
+
t(window.ExcelJS);
|
|
935
935
|
}, u.onerror = () => {
|
|
936
936
|
o(new Error("Failed to load ExcelJS library"));
|
|
937
937
|
}, document.head.appendChild(u);
|
|
938
|
-
}), hn = async (
|
|
938
|
+
}), hn = async (t) => {
|
|
939
939
|
const { Workbook: o } = await mn(), u = new o(), p = u.addWorksheet("Data");
|
|
940
|
-
|
|
941
|
-
qt(Object.keys(
|
|
940
|
+
t.length && (p.addRow(
|
|
941
|
+
qt(Object.keys(t[0]), [
|
|
942
942
|
"_index",
|
|
943
943
|
"SELECT_ALL_COLUMN_NAME"
|
|
944
944
|
])
|
|
945
945
|
), p.getRow(1).font = { bold: !0 }, p.addRows(
|
|
946
|
-
|
|
946
|
+
t.map((f) => {
|
|
947
947
|
const { _index: l, SELECT_ALL_COLUMN_NAME: O, ..._ } = f;
|
|
948
948
|
return Object.values(_);
|
|
949
949
|
})
|
|
@@ -959,17 +959,17 @@ const on = ({ index: n, style: o }) => {
|
|
|
959
959
|
style: "currency",
|
|
960
960
|
currency: "EUR"
|
|
961
961
|
});
|
|
962
|
-
function gn(
|
|
962
|
+
function gn(t, o) {
|
|
963
963
|
const { TdBody: u, sortByValue: p } = o || {};
|
|
964
964
|
if (p !== void 0)
|
|
965
965
|
return p;
|
|
966
|
-
if (!
|
|
966
|
+
if (!t)
|
|
967
967
|
return !1;
|
|
968
|
-
const { format: f, type: l } =
|
|
968
|
+
const { format: f, type: l } = t;
|
|
969
969
|
return f?.startsWith("date") || l === "boolean" || l === "integer" || l === "number" || !!u;
|
|
970
970
|
}
|
|
971
971
|
const pn = ({
|
|
972
|
-
CustomElement:
|
|
972
|
+
CustomElement: t,
|
|
973
973
|
CustomSearchInput: o,
|
|
974
974
|
Heading: u = Bt,
|
|
975
975
|
autoRender: p,
|
|
@@ -979,9 +979,9 @@ const pn = ({
|
|
|
979
979
|
data: _,
|
|
980
980
|
defaultColumnFilters: R,
|
|
981
981
|
defaultSortAsc: I = !1,
|
|
982
|
-
defaultSortColumn:
|
|
982
|
+
defaultSortColumn: M,
|
|
983
983
|
disabledCheckedIndexes: $,
|
|
984
|
-
displayTimezone:
|
|
984
|
+
displayTimezone: E,
|
|
985
985
|
enableAutoFocus: y = !0,
|
|
986
986
|
enableRowCounter: S = !0,
|
|
987
987
|
getRowClassName: Z,
|
|
@@ -1007,7 +1007,7 @@ const pn = ({
|
|
|
1007
1007
|
settingsStorageKey: v,
|
|
1008
1008
|
style: A,
|
|
1009
1009
|
translate: k = ft,
|
|
1010
|
-
useFilterStateHash:
|
|
1010
|
+
useFilterStateHash: T,
|
|
1011
1011
|
variableSizeGridRef: ce,
|
|
1012
1012
|
width: me
|
|
1013
1013
|
}) => {
|
|
@@ -1016,10 +1016,10 @@ const pn = ({
|
|
|
1016
1016
|
), [fe, qe] = e.useState(), [a, ke] = e.useState({
|
|
1017
1017
|
searchQuery: "",
|
|
1018
1018
|
columnFilterMap: R || {},
|
|
1019
|
-
sortColumn:
|
|
1019
|
+
sortColumn: M,
|
|
1020
1020
|
sortAsc: I
|
|
1021
|
-
}), [z,
|
|
1022
|
-
|
|
1021
|
+
}), [z, Dt] = e.useState(
|
|
1022
|
+
T ? ct(window.location.hash) : null
|
|
1023
1023
|
);
|
|
1024
1024
|
e.useEffect(() => {
|
|
1025
1025
|
J || ge(_);
|
|
@@ -1033,32 +1033,32 @@ const pn = ({
|
|
|
1033
1033
|
}, [_, J, z, x, a]), e.useEffect(() => {
|
|
1034
1034
|
fe || qe(a);
|
|
1035
1035
|
}, [a, fe]), e.useEffect(() => {
|
|
1036
|
-
if (!
|
|
1036
|
+
if (!T)
|
|
1037
1037
|
return;
|
|
1038
1038
|
const r = () => {
|
|
1039
|
-
|
|
1039
|
+
Dt(ct(window.location.hash));
|
|
1040
1040
|
};
|
|
1041
1041
|
return window.addEventListener("hashchange", r), () => {
|
|
1042
1042
|
window.removeEventListener("hashchange", r);
|
|
1043
1043
|
};
|
|
1044
|
-
}, [
|
|
1045
|
-
if (!
|
|
1044
|
+
}, [T]), e.useEffect(() => {
|
|
1045
|
+
if (!T)
|
|
1046
1046
|
return;
|
|
1047
1047
|
const { columnFilterMap: r, searchQuery: c, sortAsc: d, sortColumn: i } = z || {}, h = {
|
|
1048
1048
|
searchQuery: c || "",
|
|
1049
1049
|
columnFilterMap: r || R || {},
|
|
1050
1050
|
sortAsc: d === void 0 ? I : d,
|
|
1051
|
-
sortColumn: i === void 0 ?
|
|
1051
|
+
sortColumn: i === void 0 ? M : i
|
|
1052
1052
|
};
|
|
1053
1053
|
ke(
|
|
1054
1054
|
(N) => et(h, N) ? N : h
|
|
1055
1055
|
);
|
|
1056
1056
|
}, [
|
|
1057
1057
|
z,
|
|
1058
|
-
|
|
1058
|
+
T,
|
|
1059
1059
|
R,
|
|
1060
1060
|
I,
|
|
1061
|
-
|
|
1061
|
+
M
|
|
1062
1062
|
]), e.useEffect(() => {
|
|
1063
1063
|
re && re(a);
|
|
1064
1064
|
}, [re, a]);
|
|
@@ -1067,7 +1067,7 @@ const pn = ({
|
|
|
1067
1067
|
), Ae = e.useMemo(
|
|
1068
1068
|
() => me || Math.floor(Re.width || 0),
|
|
1069
1069
|
[Re.width, me]
|
|
1070
|
-
), Ne = e.useMemo(() => !et(a, fe) && J, [a, fe, J]), { properties: ae, required:
|
|
1070
|
+
), Ne = e.useMemo(() => !et(a, fe) && J, [a, fe, J]), { properties: ae, required: Tt } = e.useMemo(
|
|
1071
1071
|
() => ({
|
|
1072
1072
|
properties: {},
|
|
1073
1073
|
required: [],
|
|
@@ -1130,12 +1130,12 @@ const pn = ({
|
|
|
1130
1130
|
g
|
|
1131
1131
|
) ? "-" : tt(
|
|
1132
1132
|
new Date(g),
|
|
1133
|
-
N?.dateFormat ||
|
|
1133
|
+
N?.dateFormat || yt
|
|
1134
1134
|
), d;
|
|
1135
1135
|
if (h.format === "date-time" && g)
|
|
1136
|
-
return d[i] =
|
|
1136
|
+
return d[i] = E ? wt(
|
|
1137
1137
|
new Date(g),
|
|
1138
|
-
|
|
1138
|
+
E,
|
|
1139
1139
|
Je
|
|
1140
1140
|
) : tt(
|
|
1141
1141
|
new Date(g),
|
|
@@ -1151,7 +1151,7 @@ const pn = ({
|
|
|
1151
1151
|
{ _index: c }
|
|
1152
1152
|
)
|
|
1153
1153
|
) : void 0,
|
|
1154
|
-
[x, K, ae, l, k,
|
|
1154
|
+
[x, K, ae, l, k, E]
|
|
1155
1155
|
), xe = K ? K.length : 0, { dynamicWidthColumnCount: Ge, fixedWidthColumnsWidth: Xe } = e.useMemo(() => {
|
|
1156
1156
|
let r = 0, c = 0;
|
|
1157
1157
|
return (K || []).forEach((d) => {
|
|
@@ -1169,7 +1169,7 @@ const pn = ({
|
|
|
1169
1169
|
Math.floor(
|
|
1170
1170
|
(Ae - Xe) / Ge
|
|
1171
1171
|
),
|
|
1172
|
-
|
|
1172
|
+
vt
|
|
1173
1173
|
);
|
|
1174
1174
|
let d = (Ae - Xe) % Ge;
|
|
1175
1175
|
const i = new Uint16Array(
|
|
@@ -1314,7 +1314,7 @@ const pn = ({
|
|
|
1314
1314
|
[a]
|
|
1315
1315
|
), He = e.useCallback(
|
|
1316
1316
|
(r, c) => {
|
|
1317
|
-
if (
|
|
1317
|
+
if (T) {
|
|
1318
1318
|
window.location.hash = ze({
|
|
1319
1319
|
...z,
|
|
1320
1320
|
sortColumn: r,
|
|
@@ -1324,8 +1324,8 @@ const pn = ({
|
|
|
1324
1324
|
}
|
|
1325
1325
|
ke({ ...a, sortColumn: r, sortAsc: c });
|
|
1326
1326
|
},
|
|
1327
|
-
[a, z,
|
|
1328
|
-
),
|
|
1327
|
+
[a, z, T]
|
|
1328
|
+
), Mt = e.useCallback(
|
|
1329
1329
|
(r) => {
|
|
1330
1330
|
ke({
|
|
1331
1331
|
...a,
|
|
@@ -1337,7 +1337,7 @@ const pn = ({
|
|
|
1337
1337
|
qe(a), ge(void 0);
|
|
1338
1338
|
}, [a]);
|
|
1339
1339
|
e.useEffect(() => {
|
|
1340
|
-
if (!p || !z || !fe || !
|
|
1340
|
+
if (!p || !z || !fe || !T)
|
|
1341
1341
|
return;
|
|
1342
1342
|
const r = Object.keys(z);
|
|
1343
1343
|
let c = !1;
|
|
@@ -1358,11 +1358,11 @@ const pn = ({
|
|
|
1358
1358
|
z,
|
|
1359
1359
|
fe,
|
|
1360
1360
|
De,
|
|
1361
|
-
|
|
1361
|
+
T
|
|
1362
1362
|
]);
|
|
1363
1363
|
const at = e.useCallback(
|
|
1364
1364
|
(r) => {
|
|
1365
|
-
r.key === "Enter" && (j(void 0), Ne && De(), G && r.currentTarget.className === "mig-schema-table__search" && G(a.searchQuery || ""));
|
|
1365
|
+
r.key === "Enter" && (j(void 0), Ne && !T && De(), G && r.currentTarget.className === "mig-schema-table__search" && G(a.searchQuery || ""));
|
|
1366
1366
|
},
|
|
1367
1367
|
[Ne, a.searchQuery, G, De]
|
|
1368
1368
|
), Ye = e.useCallback(() => B, [B]), ue = e.useMemo(() => Xt(ie), [ie]), Se = e.useMemo(
|
|
@@ -1381,16 +1381,16 @@ const pn = ({
|
|
|
1381
1381
|
C,
|
|
1382
1382
|
ot,
|
|
1383
1383
|
Re.height
|
|
1384
|
-
]),
|
|
1384
|
+
]), Et = e.useCallback(
|
|
1385
1385
|
(r) => {
|
|
1386
1386
|
j(void 0), r.preventDefault(), r.stopPropagation();
|
|
1387
1387
|
},
|
|
1388
1388
|
[]
|
|
1389
|
-
),
|
|
1389
|
+
), Lt = e.useCallback(
|
|
1390
1390
|
(r, c) => {
|
|
1391
1391
|
if (!Q)
|
|
1392
1392
|
return;
|
|
1393
|
-
if (
|
|
1393
|
+
if (T && c !== !1) {
|
|
1394
1394
|
window.location.hash = ze({
|
|
1395
1395
|
...z,
|
|
1396
1396
|
columnFilterMap: {
|
|
@@ -1418,30 +1418,30 @@ const pn = ({
|
|
|
1418
1418
|
a,
|
|
1419
1419
|
z,
|
|
1420
1420
|
Q,
|
|
1421
|
-
|
|
1421
|
+
T
|
|
1422
1422
|
]
|
|
1423
|
-
),
|
|
1423
|
+
), At = e.useCallback(() => {
|
|
1424
1424
|
const r = {
|
|
1425
1425
|
searchQuery: "",
|
|
1426
1426
|
columnFilterMap: {},
|
|
1427
1427
|
// Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
|
|
1428
|
-
sortColumn:
|
|
1428
|
+
sortColumn: M,
|
|
1429
1429
|
sortAsc: I
|
|
1430
1430
|
};
|
|
1431
|
-
|
|
1432
|
-
}, [
|
|
1431
|
+
T && (window.location.hash = ze(r)), qe(r), ke(r);
|
|
1432
|
+
}, [T, I, M]), Nt = e.useCallback(() => {
|
|
1433
1433
|
const r = z?.searchQuery || "";
|
|
1434
|
-
|
|
1434
|
+
T && // prevent hash change for undefined vs empty string compare
|
|
1435
1435
|
(a.searchQuery || r) && a.searchQuery !== r && (window.location.hash = ze({
|
|
1436
1436
|
...z,
|
|
1437
1437
|
searchQuery: a.searchQuery
|
|
1438
1438
|
}));
|
|
1439
|
-
}, [z, a.searchQuery,
|
|
1439
|
+
}, [z, a.searchQuery, T]), It = e.useCallback(
|
|
1440
1440
|
async (r) => {
|
|
1441
|
-
r.preventDefault(), r.stopPropagation(), X && hn(X);
|
|
1441
|
+
r.preventDefault(), r.stopPropagation(), X && await hn(X);
|
|
1442
1442
|
},
|
|
1443
1443
|
[X]
|
|
1444
|
-
),
|
|
1444
|
+
), St = e.useCallback(() => {
|
|
1445
1445
|
v && (localStorage.removeItem(`${v}.columnNames`), localStorage.removeItem(`${v}.columnWidths`), oe(void 0), Oe(void 0));
|
|
1446
1446
|
}, [v]), Ke = e.useCallback(
|
|
1447
1447
|
(r) => {
|
|
@@ -1451,7 +1451,7 @@ const pn = ({
|
|
|
1451
1451
|
return c && x[c._index] !== void 0;
|
|
1452
1452
|
},
|
|
1453
1453
|
[le, ne, X, x]
|
|
1454
|
-
),
|
|
1454
|
+
), $t = e.useMemo(() => pe ? !(x && !Ne) && !ne ? /* @__PURE__ */ n(
|
|
1455
1455
|
"div",
|
|
1456
1456
|
{
|
|
1457
1457
|
style: {
|
|
@@ -1464,16 +1464,16 @@ const pn = ({
|
|
|
1464
1464
|
alignItems: "center",
|
|
1465
1465
|
justifyContent: "center"
|
|
1466
1466
|
},
|
|
1467
|
-
children: Ne ? /* @__PURE__ */
|
|
1467
|
+
children: Ne ? /* @__PURE__ */ n("button", { onClick: De, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ n("div", { children: "⌛ Loading..." })
|
|
1468
1468
|
}
|
|
1469
|
-
) : ne && le ? /* @__PURE__ */
|
|
1469
|
+
) : ne && le ? /* @__PURE__ */ n(
|
|
1470
1470
|
Ht,
|
|
1471
1471
|
{
|
|
1472
1472
|
ref: s,
|
|
1473
1473
|
isItemLoaded: Ke,
|
|
1474
1474
|
itemCount: le,
|
|
1475
1475
|
loadMoreItems: ne,
|
|
1476
|
-
children: ({ onItemsRendered: c, ref: d }) => /* @__PURE__ */
|
|
1476
|
+
children: ({ onItemsRendered: c, ref: d }) => /* @__PURE__ */ n(
|
|
1477
1477
|
lt,
|
|
1478
1478
|
{
|
|
1479
1479
|
className: "mig-schema-table__tbody",
|
|
@@ -1503,7 +1503,7 @@ const pn = ({
|
|
|
1503
1503
|
)}`
|
|
1504
1504
|
)
|
|
1505
1505
|
}
|
|
1506
|
-
) : /* @__PURE__ */
|
|
1506
|
+
) : /* @__PURE__ */ n(
|
|
1507
1507
|
lt,
|
|
1508
1508
|
{
|
|
1509
1509
|
className: "mig-schema-table__tbody",
|
|
@@ -1540,7 +1540,7 @@ const pn = ({
|
|
|
1540
1540
|
x,
|
|
1541
1541
|
pe,
|
|
1542
1542
|
ce
|
|
1543
|
-
]),
|
|
1543
|
+
]), Ot = e.useMemo(
|
|
1544
1544
|
() => ({
|
|
1545
1545
|
...A,
|
|
1546
1546
|
width: me ? Math.min(ue, Ae) : void 0,
|
|
@@ -1548,8 +1548,8 @@ const pn = ({
|
|
|
1548
1548
|
maxHeight: C === "100%" ? "100%" : void 0
|
|
1549
1549
|
}),
|
|
1550
1550
|
[C, ue, A, Ae, me]
|
|
1551
|
-
),
|
|
1552
|
-
return /* @__PURE__ */
|
|
1551
|
+
), Rt = o || "input";
|
|
1552
|
+
return /* @__PURE__ */ n(
|
|
1553
1553
|
Me.Provider,
|
|
1554
1554
|
{
|
|
1555
1555
|
value: {
|
|
@@ -1558,7 +1558,7 @@ const pn = ({
|
|
|
1558
1558
|
columnWidths: ie,
|
|
1559
1559
|
config: l,
|
|
1560
1560
|
disabledCheckedIndexes: $,
|
|
1561
|
-
displayTimezone:
|
|
1561
|
+
displayTimezone: E,
|
|
1562
1562
|
dropTargetIndex: Le,
|
|
1563
1563
|
getRowClassName: Z,
|
|
1564
1564
|
getRowSelected: Y,
|
|
@@ -1569,7 +1569,7 @@ const pn = ({
|
|
|
1569
1569
|
onRowClick: L,
|
|
1570
1570
|
onRowDoubleClick: se,
|
|
1571
1571
|
properties: ae,
|
|
1572
|
-
required:
|
|
1572
|
+
required: Tt,
|
|
1573
1573
|
setCheckedIndexes: q,
|
|
1574
1574
|
setCustomColumnNames: oe,
|
|
1575
1575
|
setCustomColumnWidths: Oe,
|
|
@@ -1588,7 +1588,7 @@ const pn = ({
|
|
|
1588
1588
|
{
|
|
1589
1589
|
className: `mig-schema-table${L ? " mig-schema-table--clickable-rows" : ""}`,
|
|
1590
1590
|
ref: nt,
|
|
1591
|
-
style:
|
|
1591
|
+
style: Ot,
|
|
1592
1592
|
role: "table",
|
|
1593
1593
|
children: [
|
|
1594
1594
|
/* @__PURE__ */ W(
|
|
@@ -1597,8 +1597,8 @@ const pn = ({
|
|
|
1597
1597
|
className: "mig-schema-table__action-container",
|
|
1598
1598
|
ref: rt,
|
|
1599
1599
|
children: [
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
|
|
1600
|
+
/* @__PURE__ */ n("div", { children: U ? /* @__PURE__ */ n(
|
|
1601
|
+
Rt,
|
|
1602
1602
|
{
|
|
1603
1603
|
className: "mig-schema-table__search",
|
|
1604
1604
|
type: "search",
|
|
@@ -1606,46 +1606,46 @@ const pn = ({
|
|
|
1606
1606
|
autoComplete: "off",
|
|
1607
1607
|
placeholder: _e || k("search..."),
|
|
1608
1608
|
value: a.searchQuery,
|
|
1609
|
-
onChange:
|
|
1609
|
+
onChange: Mt,
|
|
1610
1610
|
onKeyDown: at,
|
|
1611
1611
|
autoFocus: y,
|
|
1612
|
-
onBlur:
|
|
1612
|
+
onBlur: Nt
|
|
1613
1613
|
}
|
|
1614
1614
|
) : null }),
|
|
1615
|
-
|
|
1616
|
-
|
|
1615
|
+
t ? /* @__PURE__ */ n(
|
|
1616
|
+
t,
|
|
1617
1617
|
{
|
|
1618
1618
|
...O,
|
|
1619
1619
|
renderData: X
|
|
1620
1620
|
}
|
|
1621
|
-
) : /* @__PURE__ */
|
|
1622
|
-
S && Array.isArray(_) ? /* @__PURE__ */
|
|
1621
|
+
) : /* @__PURE__ */ n("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1622
|
+
S && Array.isArray(_) ? /* @__PURE__ */ n("span", { className: "mig-schema-table__row_counter", children: k(
|
|
1623
1623
|
"showingFilteredCountOfTotalCount",
|
|
1624
1624
|
X?.length || 0,
|
|
1625
1625
|
_.length
|
|
1626
1626
|
) }) : null,
|
|
1627
|
-
b ? /* @__PURE__ */
|
|
1627
|
+
b ? /* @__PURE__ */ n(
|
|
1628
1628
|
"button",
|
|
1629
1629
|
{
|
|
1630
|
-
onClick:
|
|
1630
|
+
onClick: It,
|
|
1631
1631
|
style: { marginLeft: 8 },
|
|
1632
1632
|
disabled: !X?.length,
|
|
1633
1633
|
children: k("exportData")
|
|
1634
1634
|
}
|
|
1635
1635
|
) : null,
|
|
1636
|
-
U || m ? /* @__PURE__ */
|
|
1636
|
+
U || m ? /* @__PURE__ */ n(
|
|
1637
1637
|
"button",
|
|
1638
1638
|
{
|
|
1639
|
-
onClick:
|
|
1639
|
+
onClick: At,
|
|
1640
1640
|
style: { marginLeft: 8 },
|
|
1641
1641
|
disabled: a.columnFilterMap && a.searchQuery ? Object.keys(a.columnFilterMap).length + a.searchQuery.length === 0 : !1,
|
|
1642
1642
|
children: k("clearFilters")
|
|
1643
1643
|
}
|
|
1644
1644
|
) : null,
|
|
1645
|
-
v ? /* @__PURE__ */
|
|
1645
|
+
v ? /* @__PURE__ */ n(
|
|
1646
1646
|
"button",
|
|
1647
1647
|
{
|
|
1648
|
-
onClick:
|
|
1648
|
+
onClick: St,
|
|
1649
1649
|
style: { marginLeft: 8 },
|
|
1650
1650
|
disabled: !We && !Fe,
|
|
1651
1651
|
children: k("clearSettings")
|
|
@@ -1655,7 +1655,7 @@ const pn = ({
|
|
|
1655
1655
|
}
|
|
1656
1656
|
),
|
|
1657
1657
|
/* @__PURE__ */ W("div", { className: "mig-schema-table__column_resize_container", children: [
|
|
1658
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ n(
|
|
1659
1659
|
u,
|
|
1660
1660
|
{
|
|
1661
1661
|
height: gt,
|
|
@@ -1674,8 +1674,8 @@ const pn = ({
|
|
|
1674
1674
|
" "
|
|
1675
1675
|
)}`
|
|
1676
1676
|
),
|
|
1677
|
-
|
|
1678
|
-
w ? /* @__PURE__ */
|
|
1677
|
+
$t,
|
|
1678
|
+
w ? /* @__PURE__ */ n(
|
|
1679
1679
|
dn,
|
|
1680
1680
|
{
|
|
1681
1681
|
columnWidths: ie,
|
|
@@ -1685,18 +1685,19 @@ const pn = ({
|
|
|
1685
1685
|
}
|
|
1686
1686
|
) : null
|
|
1687
1687
|
] }),
|
|
1688
|
-
x
|
|
1689
|
-
|
|
1688
|
+
x && x.length === 0 ? /* @__PURE__ */ n("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
|
|
1689
|
+
Q ? jt(
|
|
1690
|
+
/* @__PURE__ */ n(
|
|
1690
1691
|
un,
|
|
1691
1692
|
{
|
|
1692
1693
|
isFilterable: m && Q.propConfig?.isFilterable !== !1,
|
|
1693
|
-
isSortable:
|
|
1694
|
-
|
|
1694
|
+
isSortable: kt(
|
|
1695
|
+
te,
|
|
1695
1696
|
V.properties[Q.propName],
|
|
1696
1697
|
Q.propConfig
|
|
1697
1698
|
),
|
|
1698
|
-
onChange:
|
|
1699
|
-
onClose:
|
|
1699
|
+
onChange: Lt,
|
|
1700
|
+
onClose: Et,
|
|
1700
1701
|
onInputKeyDown: at,
|
|
1701
1702
|
propConfig: Q.propConfig,
|
|
1702
1703
|
propIsRequired: Q.propIsRequired,
|
|
@@ -1707,29 +1708,29 @@ const pn = ({
|
|
|
1707
1708
|
translate: k,
|
|
1708
1709
|
value: a.columnFilterMap ? a.columnFilterMap[Q.propName] : null
|
|
1709
1710
|
}
|
|
1710
|
-
)
|
|
1711
|
+
),
|
|
1711
1712
|
document.body
|
|
1712
|
-
)
|
|
1713
|
+
) : null
|
|
1713
1714
|
]
|
|
1714
1715
|
}
|
|
1715
1716
|
)
|
|
1716
1717
|
}
|
|
1717
1718
|
);
|
|
1718
|
-
}, In = e.memo(pn), Sn = e.memo(({ refresh:
|
|
1719
|
+
}, In = e.memo(pn), Sn = e.memo(({ refresh: t, period: o = 60 }) => {
|
|
1719
1720
|
const [u, p] = e.useState(/* @__PURE__ */ new Date()), [f, l] = e.useState(/* @__PURE__ */ new Date()), O = e.useCallback(() => {
|
|
1720
|
-
l(/* @__PURE__ */ new Date()),
|
|
1721
|
-
}, [
|
|
1721
|
+
l(/* @__PURE__ */ new Date()), t();
|
|
1722
|
+
}, [t]), _ = e.useMemo(
|
|
1722
1723
|
() => Ut(u, f),
|
|
1723
1724
|
[u, f]
|
|
1724
1725
|
);
|
|
1725
1726
|
e.useEffect(() => {
|
|
1726
1727
|
_ > o && O();
|
|
1727
1728
|
}, [_, u, f, o, O]), e.useEffect(() => {
|
|
1728
|
-
const
|
|
1729
|
+
const M = setInterval(() => {
|
|
1729
1730
|
p(/* @__PURE__ */ new Date());
|
|
1730
1731
|
}, 1e3);
|
|
1731
1732
|
return () => {
|
|
1732
|
-
clearInterval(
|
|
1733
|
+
clearInterval(M);
|
|
1733
1734
|
};
|
|
1734
1735
|
}, []);
|
|
1735
1736
|
const R = o - _;
|
|
@@ -1746,10 +1747,10 @@ const pn = ({
|
|
|
1746
1747
|
);
|
|
1747
1748
|
});
|
|
1748
1749
|
export {
|
|
1749
|
-
|
|
1750
|
+
yt as DEFAULT_DATE_FORMAT,
|
|
1750
1751
|
Je as DEFAULT_DATE_TIME_FORMAT,
|
|
1751
1752
|
$e as EColumnFilterStatus,
|
|
1752
|
-
|
|
1753
|
+
vt as MINIMUM_COLUMN_WIDTH,
|
|
1753
1754
|
en as RESIZER_WIDTH,
|
|
1754
1755
|
Sn as Refresher,
|
|
1755
1756
|
In as SchemaTable,
|