mig-schema-table 5.0.6 → 5.0.8
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 +344 -340
- package/dist/mig-schema-table.umd.js +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, 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";
|
|
@@ -25,11 +25,11 @@ const tt = (n, o) => (
|
|
|
25
25
|
};
|
|
26
26
|
function ft(n, ...o) {
|
|
27
27
|
let u = Kt[n] || Vt(n);
|
|
28
|
-
return o.forEach((
|
|
29
|
-
u = u.replace(`{${
|
|
28
|
+
return o.forEach((p, f) => {
|
|
29
|
+
u = u.replace(`{${f}}`, `${p}`);
|
|
30
30
|
}), u;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const ee = "SELECT_ALL_COLUMN_NAME", bt = 40, vt = "dd MMM yyyy", Je = "dd MMM yyyy HH:mm", kt = 25, gt = 50, en = 3;
|
|
33
33
|
var be = /* @__PURE__ */ ((n) => (n.GT = "GT", n.LT = "LT", n.EQ = "EQ", n))(be || {}), $e = /* @__PURE__ */ ((n) => (n.UNAVAILABLE = "UNAVAILABLE", n.AVAILABLE = "AVAILABLE", n.ACTIVE = "ACTIVE", n))($e || {});
|
|
34
34
|
const Me = Ft.createContext({
|
|
35
35
|
checkedIndexes: [],
|
|
@@ -58,28 +58,28 @@ const Me = Ft.createContext({
|
|
|
58
58
|
translate: ve
|
|
59
59
|
}), tn = { type: "boolean" }, nn = ({ columnIndex: n, rowIndex: o, style: u }) => {
|
|
60
60
|
const {
|
|
61
|
-
checkedIndexes:
|
|
62
|
-
columnNames:
|
|
61
|
+
checkedIndexes: p,
|
|
62
|
+
columnNames: f,
|
|
63
63
|
config: l,
|
|
64
|
-
disabledCheckedIndexes:
|
|
64
|
+
disabledCheckedIndexes: O,
|
|
65
65
|
displayTimezone: _,
|
|
66
|
-
getRowClassName:
|
|
67
|
-
getRowSelected:
|
|
66
|
+
getRowClassName: R,
|
|
67
|
+
getRowSelected: I,
|
|
68
68
|
isItemLoaded: T,
|
|
69
69
|
lastCheckChangedRowIndex: $,
|
|
70
70
|
onRowClick: M,
|
|
71
71
|
onRowDoubleClick: y,
|
|
72
|
-
properties:
|
|
73
|
-
setCheckedIndexes:
|
|
74
|
-
setLastCheckChangedRowIndex:
|
|
72
|
+
properties: S,
|
|
73
|
+
setCheckedIndexes: Z,
|
|
74
|
+
setLastCheckChangedRowIndex: Y,
|
|
75
75
|
sortedRenderData: D,
|
|
76
76
|
sourceData: s,
|
|
77
77
|
translate: m
|
|
78
|
-
} = e.useContext(Me),
|
|
78
|
+
} = e.useContext(Me), b = f[n], w = b === ee ? tn : S[b], U = l ? l[b] : void 0, te = e.useCallback(
|
|
79
79
|
(v) => {
|
|
80
|
-
|
|
80
|
+
Z && Z((A) => A && A.includes(v) ? A.filter((E) => E !== v) : A ? [...A, v] : [v]);
|
|
81
81
|
},
|
|
82
|
-
[
|
|
82
|
+
[Z]
|
|
83
83
|
), le = T(o), ne = e.useCallback(
|
|
84
84
|
(v) => {
|
|
85
85
|
if (!s || !D || !M || !le)
|
|
@@ -105,9 +105,9 @@ const Me = Ft.createContext({
|
|
|
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
|
-
let v =
|
|
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, E = k ? k[
|
|
110
|
+
const k = s ? s[L._index] : void 0, E = k ? k[b] : void 0, ce = E ? new Date(E) : void 0;
|
|
111
111
|
ce && re && (v = `${yt(
|
|
112
112
|
ce,
|
|
113
113
|
re,
|
|
@@ -117,10 +117,10 @@ const Me = Ft.createContext({
|
|
|
117
117
|
const A = [
|
|
118
118
|
"mig-schema-table__td",
|
|
119
119
|
`mig-schema-table__td--${o % 2 ? "odd" : "even"}`,
|
|
120
|
-
`mig-schema-table__td--prop-${
|
|
120
|
+
`mig-schema-table__td--prop-${b}`
|
|
121
121
|
];
|
|
122
|
-
switch (s &&
|
|
123
|
-
|
|
122
|
+
switch (s && I && I(s[L._index], L._index) && A.push("mig-schema-table__td--selected"), s && R && A.push(
|
|
123
|
+
R(s[L._index], L._index, D)
|
|
124
124
|
), w?.type) {
|
|
125
125
|
case "boolean":
|
|
126
126
|
A.push(`text-${U?.align || "center"}`);
|
|
@@ -138,19 +138,19 @@ const Me = Ft.createContext({
|
|
|
138
138
|
style: u,
|
|
139
139
|
className: A.join(" "),
|
|
140
140
|
title: v,
|
|
141
|
-
onClick:
|
|
142
|
-
onDoubleClick:
|
|
141
|
+
onClick: b === ee ? void 0 : ne,
|
|
142
|
+
onDoubleClick: b === ee ? void 0 : C
|
|
143
143
|
};
|
|
144
144
|
}, [
|
|
145
145
|
L,
|
|
146
146
|
D,
|
|
147
|
-
|
|
147
|
+
b,
|
|
148
148
|
w,
|
|
149
149
|
se,
|
|
150
150
|
o,
|
|
151
151
|
s,
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
I,
|
|
153
|
+
R,
|
|
154
154
|
n,
|
|
155
155
|
u,
|
|
156
156
|
ne,
|
|
@@ -164,7 +164,7 @@ const Me = Ft.createContext({
|
|
|
164
164
|
return;
|
|
165
165
|
const A = parseInt(v.currentTarget.dataset.rowIndex);
|
|
166
166
|
if (v.shiftKey && $ !== void 0) {
|
|
167
|
-
const k =
|
|
167
|
+
const k = p?.includes($) ? $ : void 0;
|
|
168
168
|
if (k !== void 0 && D) {
|
|
169
169
|
const E = o;
|
|
170
170
|
for (const ce of Pt(
|
|
@@ -172,21 +172,21 @@ const Me = Ft.createContext({
|
|
|
172
172
|
E > k ? E + 1 : k
|
|
173
173
|
)) {
|
|
174
174
|
const me = D[ce]._index;
|
|
175
|
-
(!
|
|
175
|
+
(!O || !O.includes(me)) && te(me);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
} else
|
|
179
179
|
te(L._index);
|
|
180
|
-
|
|
180
|
+
Y(A), _e.current?.focus();
|
|
181
181
|
},
|
|
182
182
|
[
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
p,
|
|
184
|
+
O,
|
|
185
185
|
$,
|
|
186
186
|
te,
|
|
187
187
|
L,
|
|
188
188
|
o,
|
|
189
|
-
|
|
189
|
+
Y,
|
|
190
190
|
D
|
|
191
191
|
]
|
|
192
192
|
), _e = e.useRef(null);
|
|
@@ -194,15 +194,15 @@ const Me = Ft.createContext({
|
|
|
194
194
|
return null;
|
|
195
195
|
if (!T || s && !s[L._index])
|
|
196
196
|
return /* @__PURE__ */ t("div", { ...B, children: "loading" });
|
|
197
|
-
if (
|
|
197
|
+
if (b === ee)
|
|
198
198
|
return /* @__PURE__ */ t("div", { ...B, onMouseDown: V, children: /* @__PURE__ */ t("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ t(
|
|
199
199
|
"input",
|
|
200
200
|
{
|
|
201
201
|
ref: _e,
|
|
202
202
|
type: "checkbox",
|
|
203
203
|
readOnly: !0,
|
|
204
|
-
checked:
|
|
205
|
-
disabled:
|
|
204
|
+
checked: p?.includes(L._index),
|
|
205
|
+
disabled: O?.includes(L._index)
|
|
206
206
|
}
|
|
207
207
|
) }) });
|
|
208
208
|
if (G && s)
|
|
@@ -215,25 +215,25 @@ const Me = Ft.createContext({
|
|
|
215
215
|
...U?.tdBodyProps
|
|
216
216
|
}
|
|
217
217
|
) });
|
|
218
|
-
const
|
|
219
|
-
return w?.format === "url" &&
|
|
218
|
+
const q = L[b];
|
|
219
|
+
return w?.format === "url" && q ? /* @__PURE__ */ t(
|
|
220
220
|
"a",
|
|
221
221
|
{
|
|
222
|
-
href:
|
|
222
|
+
href: q,
|
|
223
223
|
target: "_blank",
|
|
224
224
|
rel: "noopener noreferrer",
|
|
225
225
|
...B,
|
|
226
|
-
children:
|
|
226
|
+
children: q
|
|
227
227
|
}
|
|
228
|
-
) : /* @__PURE__ */ t("div", { ...B, children:
|
|
228
|
+
) : /* @__PURE__ */ t("div", { ...B, children: q });
|
|
229
229
|
}, pt = e.memo(nn);
|
|
230
230
|
function rn() {
|
|
231
231
|
const { checkedIndexes: n, disabledCheckedIndexes: o, sortedRenderData: u } = e.useContext(Me);
|
|
232
232
|
return e.useMemo(() => {
|
|
233
|
-
const
|
|
234
|
-
(
|
|
233
|
+
const p = [...u || []].filter(
|
|
234
|
+
(f) => (n ? n.includes(f._index) : !0) || (o ? !o.includes(f._index) : !0)
|
|
235
235
|
);
|
|
236
|
-
return n?.length !== 0 &&
|
|
236
|
+
return n?.length !== 0 && p.length === n?.length;
|
|
237
237
|
}, [n, o, u]);
|
|
238
238
|
}
|
|
239
239
|
function xt(n, o, u) {
|
|
@@ -254,30 +254,30 @@ function Dt() {
|
|
|
254
254
|
const on = ({ index: n, style: o }) => {
|
|
255
255
|
const {
|
|
256
256
|
checkedIndexes: u,
|
|
257
|
-
columnNames:
|
|
258
|
-
columnWidths:
|
|
257
|
+
columnNames: p,
|
|
258
|
+
columnWidths: f,
|
|
259
259
|
config: l,
|
|
260
|
-
disabledCheckedIndexes:
|
|
260
|
+
disabledCheckedIndexes: O,
|
|
261
261
|
dropTargetIndex: _,
|
|
262
|
-
isColumnFilterable:
|
|
263
|
-
isSortable:
|
|
262
|
+
isColumnFilterable: R,
|
|
263
|
+
isSortable: I,
|
|
264
264
|
setCheckedIndexes: T,
|
|
265
265
|
properties: $,
|
|
266
266
|
required: M,
|
|
267
267
|
setCustomColumnNames: y,
|
|
268
|
-
setDropTargetIndex:
|
|
269
|
-
setFilterSortColumn:
|
|
270
|
-
setMenuConfig:
|
|
268
|
+
setDropTargetIndex: S,
|
|
269
|
+
setFilterSortColumn: Z,
|
|
270
|
+
setMenuConfig: Y,
|
|
271
271
|
settingsStorageKey: D,
|
|
272
272
|
tableDataState: s,
|
|
273
273
|
sortedRenderData: m,
|
|
274
|
-
translate:
|
|
274
|
+
translate: b,
|
|
275
275
|
displayTimezone: w
|
|
276
|
-
} = e.useContext(Me), [U, te] = e.useState(!1), le = n === _, ne = Dt(), C =
|
|
277
|
-
let re =
|
|
276
|
+
} = e.useContext(Me), [U, te] = e.useState(!1), le = n === _, ne = Dt(), C = p[n], L = C === ee ? { type: "boolean" } : $[C], se = s.sortColumn === C ? s.sortAsc : void 0, G = l ? l[C] : void 0;
|
|
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
279
|
const B = xt(
|
|
280
|
-
|
|
280
|
+
I,
|
|
281
281
|
L,
|
|
282
282
|
G
|
|
283
283
|
), V = [
|
|
@@ -289,28 +289,28 @@ const on = ({ index: n, style: o }) => {
|
|
|
289
289
|
B ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable"
|
|
290
290
|
), se !== void 0 && V.push("mig-schema-table__th--sorted"), U && V.push("mig-schema-table__th--dragging"), le && V.push("mig-schema-table__th--drop-target");
|
|
291
291
|
const { format: _e } = L || {}, {
|
|
292
|
-
align:
|
|
292
|
+
align: q,
|
|
293
293
|
defaultSortDesc: v,
|
|
294
294
|
showTimezones: A = !w,
|
|
295
295
|
title: k
|
|
296
296
|
} = G || {}, E = e.useCallback(() => {
|
|
297
297
|
if (B) {
|
|
298
298
|
if (se === void 0) {
|
|
299
|
-
|
|
299
|
+
Z(C, !v);
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
|
|
302
|
+
Z(C, !se);
|
|
303
303
|
}
|
|
304
304
|
}, [
|
|
305
305
|
B,
|
|
306
306
|
v,
|
|
307
307
|
C,
|
|
308
|
-
|
|
308
|
+
Z,
|
|
309
309
|
se
|
|
310
310
|
]), ce = M.includes(C), me = e.useCallback(
|
|
311
311
|
(j) => {
|
|
312
312
|
const he = j.currentTarget;
|
|
313
|
-
|
|
313
|
+
Y((we) => {
|
|
314
314
|
if (we?.propName !== C)
|
|
315
315
|
return {
|
|
316
316
|
propConfig: G,
|
|
@@ -320,24 +320,24 @@ const on = ({ index: n, style: o }) => {
|
|
|
320
320
|
};
|
|
321
321
|
});
|
|
322
322
|
},
|
|
323
|
-
[G, ce, C,
|
|
324
|
-
), Ce = e.useMemo(() => k !== void 0 ? k : _e === "date-time" && A ? `${
|
|
323
|
+
[G, ce, C, Y]
|
|
324
|
+
), Ce = e.useMemo(() => k !== void 0 ? k : _e === "date-time" && A ? `${b(C)} (${b(w || Te)})` : b(C), [k, _e, A, b, C, w]), oe = e.useCallback(
|
|
325
325
|
(j, he) => {
|
|
326
|
-
if (!
|
|
326
|
+
if (!p || !f)
|
|
327
327
|
return;
|
|
328
|
-
const we =
|
|
328
|
+
const we = p.indexOf(j), J = [...p];
|
|
329
329
|
J.splice(we, 1);
|
|
330
330
|
const x = J.indexOf(he);
|
|
331
331
|
J.splice(x + 1, 0, j), y(J);
|
|
332
|
-
const ge = [...
|
|
332
|
+
const ge = [...f], fe = ge[we];
|
|
333
333
|
ge.splice(we, 1), ge.splice(x + 1, 0, fe), ne(new Uint16Array(ge)), D && localStorage.setItem(
|
|
334
334
|
`${D}.columnNames`,
|
|
335
335
|
JSON.stringify(J)
|
|
336
336
|
);
|
|
337
337
|
},
|
|
338
338
|
[
|
|
339
|
-
g,
|
|
340
339
|
p,
|
|
340
|
+
f,
|
|
341
341
|
ne,
|
|
342
342
|
D,
|
|
343
343
|
y
|
|
@@ -348,31 +348,31 @@ const on = ({ index: n, style: o }) => {
|
|
|
348
348
|
},
|
|
349
349
|
[oe, C]
|
|
350
350
|
), Oe = e.useCallback(() => {
|
|
351
|
-
oe && (te(!1),
|
|
352
|
-
}, [oe,
|
|
351
|
+
oe && (te(!1), S(-1));
|
|
352
|
+
}, [oe, S]), Ve = e.useCallback(
|
|
353
353
|
(j) => {
|
|
354
|
-
oe && (j.preventDefault(),
|
|
354
|
+
oe && (j.preventDefault(), S(n));
|
|
355
355
|
},
|
|
356
|
-
[n, oe,
|
|
356
|
+
[n, oe, S]
|
|
357
357
|
), Pe = e.useCallback(
|
|
358
358
|
(j) => {
|
|
359
|
-
if (
|
|
359
|
+
if (S(-1), !oe || !C)
|
|
360
360
|
return;
|
|
361
361
|
const he = j.dataTransfer.getData("text/plain");
|
|
362
362
|
!he || he === C || oe(he, C);
|
|
363
363
|
},
|
|
364
|
-
[oe, C,
|
|
364
|
+
[oe, C, S]
|
|
365
365
|
), Le = rn(), Ze = e.useCallback(() => {
|
|
366
366
|
!T || !m || T(
|
|
367
|
-
Le ? [] : m.map((j) => j._index).filter((j) => !
|
|
367
|
+
Le ? [] : m.map((j) => j._index).filter((j) => !O?.includes(j))
|
|
368
368
|
);
|
|
369
369
|
}, [
|
|
370
370
|
T,
|
|
371
371
|
m,
|
|
372
372
|
Le,
|
|
373
|
-
|
|
373
|
+
O
|
|
374
374
|
]);
|
|
375
|
-
if (C ===
|
|
375
|
+
if (C === ee)
|
|
376
376
|
return /* @__PURE__ */ t("div", { style: o, className: V.join(" "), children: /* @__PURE__ */ t(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
@@ -395,22 +395,22 @@ const on = ({ index: n, style: o }) => {
|
|
|
395
395
|
switch (L?.type) {
|
|
396
396
|
case "boolean":
|
|
397
397
|
V.push(
|
|
398
|
-
`text-${
|
|
399
|
-
`justify-content-${
|
|
398
|
+
`text-${q || "center"}`,
|
|
399
|
+
`justify-content-${q || "center"}`
|
|
400
400
|
);
|
|
401
401
|
break;
|
|
402
402
|
case "integer":
|
|
403
403
|
case "number":
|
|
404
404
|
V.push(
|
|
405
|
-
`text-${
|
|
406
|
-
`justify-content-${
|
|
405
|
+
`text-${q || "end"}`,
|
|
406
|
+
`justify-content-${q || "end"}`
|
|
407
407
|
);
|
|
408
408
|
break;
|
|
409
409
|
default:
|
|
410
|
-
|
|
410
|
+
q && V.push(`text-${q}`);
|
|
411
411
|
}
|
|
412
412
|
let Q = G?.hoverTitle;
|
|
413
|
-
return !Q && typeof Ce == "string" && (Q = Ce), /* @__PURE__ */
|
|
413
|
+
return !Q && typeof Ce == "string" && (Q = Ce), /* @__PURE__ */ W(
|
|
414
414
|
"div",
|
|
415
415
|
{
|
|
416
416
|
className: V.join(" "),
|
|
@@ -422,7 +422,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
422
422
|
onDragOver: Ve,
|
|
423
423
|
onDrop: Pe,
|
|
424
424
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ W(
|
|
426
426
|
"div",
|
|
427
427
|
{
|
|
428
428
|
className: "mig-schema-table__th__label-body",
|
|
@@ -468,38 +468,38 @@ const on = ({ index: n, style: o }) => {
|
|
|
468
468
|
columnFilterValue: n,
|
|
469
469
|
onChange: o,
|
|
470
470
|
onInputKeyDown: u,
|
|
471
|
-
propIsRequired:
|
|
472
|
-
propName:
|
|
471
|
+
propIsRequired: p,
|
|
472
|
+
propName: f,
|
|
473
473
|
propSchema: l,
|
|
474
|
-
translate:
|
|
474
|
+
translate: O
|
|
475
475
|
}) => {
|
|
476
|
-
const { displayTimezone: _ } = e.useContext(Me), { type:
|
|
477
|
-
|
|
476
|
+
const { displayTimezone: _ } = e.useContext(Me), { type: R, format: I, minimum: T, maximum: $ } = l || {}, M = n, y = I === "date-time";
|
|
477
|
+
let S, Z, Y, D;
|
|
478
|
+
switch (R) {
|
|
478
479
|
case "number":
|
|
479
480
|
case "integer":
|
|
480
|
-
|
|
481
|
+
return S = M || {}, Z = (s, m, b) => {
|
|
481
482
|
const w = {
|
|
482
|
-
...
|
|
483
|
+
...S,
|
|
483
484
|
[s]: m.value === "" ? void 0 : parseInt(m.value)
|
|
484
485
|
}, U = Object.values(w).find(
|
|
485
486
|
(te) => isFinite(te)
|
|
486
487
|
);
|
|
487
488
|
o(
|
|
488
489
|
U !== void 0 && (T === void 0 || U >= T) ? w : void 0,
|
|
489
|
-
|
|
490
|
+
b
|
|
490
491
|
);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
/* @__PURE__ */ R("label", { className: "d-flex", children: [
|
|
492
|
+
}, /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
493
|
+
p ? null : /* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
494
|
+
/* @__PURE__ */ W("label", { className: "d-flex", children: [
|
|
495
495
|
/* @__PURE__ */ t(
|
|
496
496
|
"input",
|
|
497
497
|
{
|
|
498
498
|
type: "checkbox",
|
|
499
499
|
style: { marginRight: 14 },
|
|
500
|
-
checked: !!
|
|
500
|
+
checked: !!S.filterEmpty,
|
|
501
501
|
onChange: () => {
|
|
502
|
-
const { filterEmpty: s, ...m } =
|
|
502
|
+
const { filterEmpty: s, ...m } = S;
|
|
503
503
|
s || (m.filterEmpty = !0), o(
|
|
504
504
|
Object.keys(m).length ? m : void 0,
|
|
505
505
|
!0
|
|
@@ -512,8 +512,8 @@ const on = ({ index: n, style: o }) => {
|
|
|
512
512
|
/* @__PURE__ */ t("hr", {})
|
|
513
513
|
] }),
|
|
514
514
|
Object.keys(be).map((s) => {
|
|
515
|
-
const m =
|
|
516
|
-
return /* @__PURE__ */
|
|
515
|
+
const m = S[s];
|
|
516
|
+
return /* @__PURE__ */ W("li", { children: [
|
|
517
517
|
/* @__PURE__ */ t("label", { style: { width: 40, paddingLeft: 16 }, children: an[s] }),
|
|
518
518
|
/* @__PURE__ */ t(
|
|
519
519
|
"input",
|
|
@@ -522,18 +522,18 @@ const on = ({ index: n, style: o }) => {
|
|
|
522
522
|
style: { width: 120 },
|
|
523
523
|
type: "number",
|
|
524
524
|
value: m !== void 0 ? m : "",
|
|
525
|
-
"data-prop-name":
|
|
526
|
-
onChange: (
|
|
527
|
-
|
|
525
|
+
"data-prop-name": f,
|
|
526
|
+
onChange: (b) => {
|
|
527
|
+
Z(
|
|
528
528
|
s,
|
|
529
|
-
|
|
529
|
+
b.currentTarget,
|
|
530
530
|
!1
|
|
531
531
|
);
|
|
532
532
|
},
|
|
533
|
-
onBlur: (
|
|
534
|
-
|
|
533
|
+
onBlur: (b) => {
|
|
534
|
+
Z(
|
|
535
535
|
s,
|
|
536
|
-
|
|
536
|
+
b.currentTarget,
|
|
537
537
|
!0
|
|
538
538
|
);
|
|
539
539
|
},
|
|
@@ -546,16 +546,13 @@ const on = ({ index: n, style: o }) => {
|
|
|
546
546
|
})
|
|
547
547
|
] });
|
|
548
548
|
case "boolean":
|
|
549
|
-
|
|
550
|
-
g || ee.push("?");
|
|
551
|
-
let D = M ? "✓" : "✕";
|
|
552
|
-
return M === null && (D = "?"), M === void 0 && (D = ""), /* @__PURE__ */ t("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ t("li", { children: /* @__PURE__ */ R(
|
|
549
|
+
return Y = ["✓", "✕"], p || Y.push("?"), D = M ? "✓" : "✕", M === null && (D = "?"), M === void 0 && (D = ""), /* @__PURE__ */ t("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ t("li", { children: /* @__PURE__ */ W(
|
|
553
550
|
"select",
|
|
554
551
|
{
|
|
555
552
|
autoFocus: !0,
|
|
556
553
|
className: "form-select",
|
|
557
554
|
value: D,
|
|
558
|
-
"data-prop-name":
|
|
555
|
+
"data-prop-name": f,
|
|
559
556
|
onChange: (s) => {
|
|
560
557
|
switch (s.currentTarget.value) {
|
|
561
558
|
case "✓":
|
|
@@ -573,7 +570,7 @@ const on = ({ index: n, style: o }) => {
|
|
|
573
570
|
},
|
|
574
571
|
children: [
|
|
575
572
|
/* @__PURE__ */ t("option", { value: "", children: "All" }, "all"),
|
|
576
|
-
|
|
573
|
+
Y.map((s) => /* @__PURE__ */ t(
|
|
577
574
|
"option",
|
|
578
575
|
{
|
|
579
576
|
value: s,
|
|
@@ -587,13 +584,13 @@ const on = ({ index: n, style: o }) => {
|
|
|
587
584
|
// @ts-expect-error falls through
|
|
588
585
|
case "string":
|
|
589
586
|
if (l?.enum)
|
|
590
|
-
return /* @__PURE__ */ t("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ t("li", { children: /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ t("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ t("li", { children: /* @__PURE__ */ W(
|
|
591
588
|
"select",
|
|
592
589
|
{
|
|
593
590
|
autoFocus: !0,
|
|
594
591
|
className: "form-select",
|
|
595
592
|
value: M,
|
|
596
|
-
"data-prop-name":
|
|
593
|
+
"data-prop-name": f,
|
|
597
594
|
onChange: (s) => {
|
|
598
595
|
o(s.currentTarget.value || void 0, !0);
|
|
599
596
|
},
|
|
@@ -603,30 +600,30 @@ const on = ({ index: n, style: o }) => {
|
|
|
603
600
|
"option",
|
|
604
601
|
{
|
|
605
602
|
value: s,
|
|
606
|
-
children:
|
|
603
|
+
children: O(s)
|
|
607
604
|
},
|
|
608
605
|
`column-filter-select-${s}`
|
|
609
606
|
))
|
|
610
607
|
]
|
|
611
608
|
}
|
|
612
609
|
) }) });
|
|
613
|
-
if (y ||
|
|
610
|
+
if (y || I === "date") {
|
|
614
611
|
const s = y ? Je : vt, m = n || {
|
|
615
612
|
from: void 0,
|
|
616
613
|
to: void 0,
|
|
617
614
|
filterEmpty: void 0
|
|
618
615
|
};
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
|
|
621
|
-
/* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
617
|
+
p ? null : /* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
618
|
+
/* @__PURE__ */ W("label", { className: "d-flex", children: [
|
|
622
619
|
/* @__PURE__ */ t(
|
|
623
620
|
"input",
|
|
624
621
|
{
|
|
625
622
|
type: "checkbox",
|
|
626
623
|
checked: !!m.filterEmpty,
|
|
627
624
|
onChange: () => {
|
|
628
|
-
const { filterEmpty:
|
|
629
|
-
|
|
625
|
+
const { filterEmpty: b, ...w } = m;
|
|
626
|
+
b || (w.filterEmpty = !0), o(
|
|
630
627
|
Object.keys(w).length ? w : void 0,
|
|
631
628
|
!0
|
|
632
629
|
);
|
|
@@ -637,25 +634,25 @@ const on = ({ index: n, style: o }) => {
|
|
|
637
634
|
] }),
|
|
638
635
|
/* @__PURE__ */ t("hr", {})
|
|
639
636
|
] }),
|
|
640
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
641
638
|
/* @__PURE__ */ t("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
|
|
642
639
|
/* @__PURE__ */ t(
|
|
643
640
|
ut,
|
|
644
641
|
{
|
|
645
642
|
dateFormat: s,
|
|
646
|
-
"data-prop-name":
|
|
643
|
+
"data-prop-name": f,
|
|
647
644
|
locale: dt,
|
|
648
645
|
selected: m.from ? new Ue(m.from).withTimeZone(
|
|
649
646
|
_ || Te
|
|
650
647
|
) : null,
|
|
651
|
-
onChange: (
|
|
652
|
-
if (!
|
|
648
|
+
onChange: (b) => {
|
|
649
|
+
if (!b && !m.to) {
|
|
653
650
|
o(void 0, !0);
|
|
654
651
|
return;
|
|
655
652
|
}
|
|
656
|
-
if (m.to &&
|
|
653
|
+
if (m.to && b && b > m.to)
|
|
657
654
|
return;
|
|
658
|
-
const w =
|
|
655
|
+
const w = b ? Ue.tz(_ || Te, b) : void 0;
|
|
659
656
|
o(
|
|
660
657
|
{
|
|
661
658
|
...n,
|
|
@@ -676,14 +673,14 @@ const on = ({ index: n, style: o }) => {
|
|
|
676
673
|
}
|
|
677
674
|
)
|
|
678
675
|
] }),
|
|
679
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ W("li", { style: { padding: 8 }, children: [
|
|
680
677
|
/* @__PURE__ */ t("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
|
|
681
678
|
/* @__PURE__ */ t(
|
|
682
679
|
ut,
|
|
683
680
|
{
|
|
684
681
|
id: "filter-date",
|
|
685
682
|
dateFormat: s,
|
|
686
|
-
"data-prop-name":
|
|
683
|
+
"data-prop-name": f,
|
|
687
684
|
locale: dt,
|
|
688
685
|
selectsEnd: !0,
|
|
689
686
|
selected: m.to ? new Ue(m.to).withTimeZone(
|
|
@@ -691,12 +688,12 @@ const on = ({ index: n, style: o }) => {
|
|
|
691
688
|
) : null,
|
|
692
689
|
showMonthDropdown: !0,
|
|
693
690
|
showYearDropdown: !0,
|
|
694
|
-
onChange: (
|
|
695
|
-
if (!
|
|
691
|
+
onChange: (b) => {
|
|
692
|
+
if (!b && !m.from) {
|
|
696
693
|
o(void 0, !0);
|
|
697
694
|
return;
|
|
698
695
|
}
|
|
699
|
-
const w =
|
|
696
|
+
const w = b ? y ? Ue.tz(_ || Te, b) : zt(b) : void 0;
|
|
700
697
|
m.from && w && w < m.from || o(
|
|
701
698
|
{
|
|
702
699
|
...n,
|
|
@@ -726,10 +723,10 @@ const on = ({ index: n, style: o }) => {
|
|
|
726
723
|
autoFocus: !0,
|
|
727
724
|
type: "search",
|
|
728
725
|
className: "form-control",
|
|
729
|
-
placeholder: `Search ${
|
|
730
|
-
"aria-label": `Search ${
|
|
726
|
+
placeholder: `Search ${f}`,
|
|
727
|
+
"aria-label": `Search ${f}`,
|
|
731
728
|
value: M || "",
|
|
732
|
-
"data-prop-name":
|
|
729
|
+
"data-prop-name": f,
|
|
733
730
|
onChange: (s) => {
|
|
734
731
|
o(s.currentTarget.value || void 0, !1);
|
|
735
732
|
},
|
|
@@ -745,13 +742,13 @@ const on = ({ index: n, style: o }) => {
|
|
|
745
742
|
isSortable: n,
|
|
746
743
|
isFilterable: o,
|
|
747
744
|
onChange: u,
|
|
748
|
-
onClose:
|
|
749
|
-
onInputKeyDown:
|
|
745
|
+
onClose: p,
|
|
746
|
+
onInputKeyDown: f,
|
|
750
747
|
propConfig: l,
|
|
751
|
-
propIsRequired:
|
|
748
|
+
propIsRequired: O,
|
|
752
749
|
propName: _,
|
|
753
|
-
propSchema:
|
|
754
|
-
referenceElement:
|
|
750
|
+
propSchema: R,
|
|
751
|
+
referenceElement: I,
|
|
755
752
|
setFilterSortColumn: T,
|
|
756
753
|
translate: $,
|
|
757
754
|
value: M
|
|
@@ -759,70 +756,70 @@ const on = ({ index: n, style: o }) => {
|
|
|
759
756
|
const y = mt({
|
|
760
757
|
placement: "bottom-start",
|
|
761
758
|
elements: {
|
|
762
|
-
reference:
|
|
759
|
+
reference: I
|
|
763
760
|
},
|
|
764
761
|
middleware: [ht()]
|
|
765
|
-
}),
|
|
762
|
+
}), S = mt({
|
|
766
763
|
placement: "right-start",
|
|
767
764
|
middleware: [ht()]
|
|
768
765
|
});
|
|
769
766
|
e.useEffect(() => {
|
|
770
|
-
const m = (
|
|
767
|
+
const m = (b) => {
|
|
771
768
|
if (!y.elements.floating)
|
|
772
769
|
return;
|
|
773
|
-
let w =
|
|
770
|
+
let w = b.target;
|
|
774
771
|
for (; w && y.elements.floating; ) {
|
|
775
|
-
if (w === y.elements.floating || w ===
|
|
772
|
+
if (w === y.elements.floating || w === S.elements.floating)
|
|
776
773
|
return;
|
|
777
774
|
w = w.parentNode === window.document ? null : w.parentNode;
|
|
778
775
|
}
|
|
779
|
-
|
|
776
|
+
p(b);
|
|
780
777
|
};
|
|
781
778
|
return window.addEventListener("click", m, { capture: !0 }), () => {
|
|
782
779
|
window.removeEventListener("click", m, { capture: !0 });
|
|
783
780
|
};
|
|
784
781
|
}, [
|
|
785
782
|
y.elements.floating,
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
p,
|
|
784
|
+
S.elements.floating
|
|
788
785
|
]);
|
|
789
|
-
const
|
|
786
|
+
const Z = l?.FilterMenu || ln, Y = e.useCallback(
|
|
790
787
|
(m) => {
|
|
791
|
-
T(_, !0),
|
|
788
|
+
T(_, !0), p(m);
|
|
792
789
|
},
|
|
793
|
-
[
|
|
790
|
+
[p, _, T]
|
|
794
791
|
), D = e.useCallback(
|
|
795
792
|
(m) => {
|
|
796
|
-
T(_, !1),
|
|
793
|
+
T(_, !1), p(m);
|
|
797
794
|
},
|
|
798
|
-
[
|
|
795
|
+
[p, _, T]
|
|
799
796
|
), s = e.useCallback(() => {
|
|
800
797
|
u(void 0, !0);
|
|
801
798
|
}, [u]);
|
|
802
|
-
return !n && !o ? null : /* @__PURE__ */
|
|
799
|
+
return !n && !o ? null : /* @__PURE__ */ W(wt, { children: [
|
|
803
800
|
/* @__PURE__ */ t(
|
|
804
801
|
"div",
|
|
805
802
|
{
|
|
806
803
|
className: "mig-schema-table mig-schema-table__th-menu",
|
|
807
804
|
ref: y.refs.setFloating,
|
|
808
805
|
style: y.floatingStyles,
|
|
809
|
-
children: /* @__PURE__ */
|
|
810
|
-
n ? /* @__PURE__ */
|
|
806
|
+
children: /* @__PURE__ */ W("ol", { className: "mig-schema-table-menu", children: [
|
|
807
|
+
n ? /* @__PURE__ */ W("li", { onClick: Y, style: { padding: 8 }, children: [
|
|
811
808
|
/* @__PURE__ */ t("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
|
|
812
809
|
" ",
|
|
813
810
|
$("sortAscending")
|
|
814
811
|
] }) : null,
|
|
815
|
-
n ? /* @__PURE__ */
|
|
812
|
+
n ? /* @__PURE__ */ W("li", { onClick: D, style: { padding: 8 }, children: [
|
|
816
813
|
/* @__PURE__ */ t("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
|
|
817
814
|
" ",
|
|
818
815
|
$("sortDescending")
|
|
819
816
|
] }) : null,
|
|
820
|
-
o ? /* @__PURE__ */
|
|
817
|
+
o ? /* @__PURE__ */ W(
|
|
821
818
|
"li",
|
|
822
819
|
{
|
|
823
820
|
style: { padding: 8 },
|
|
824
821
|
onMouseOver: (m) => {
|
|
825
|
-
|
|
822
|
+
S.refs.setReference(m.currentTarget);
|
|
826
823
|
},
|
|
827
824
|
children: [
|
|
828
825
|
/* @__PURE__ */ t("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ t(
|
|
@@ -843,21 +840,21 @@ const on = ({ index: n, style: o }) => {
|
|
|
843
840
|
] })
|
|
844
841
|
}
|
|
845
842
|
),
|
|
846
|
-
|
|
843
|
+
S.elements.reference ? /* @__PURE__ */ t(
|
|
847
844
|
"div",
|
|
848
845
|
{
|
|
849
846
|
className: "mig-schema-table mig-schema-table__th-menu__sub-menu",
|
|
850
|
-
ref:
|
|
851
|
-
style:
|
|
847
|
+
ref: S.refs.setFloating,
|
|
848
|
+
style: S.floatingStyles,
|
|
852
849
|
children: /* @__PURE__ */ t(
|
|
853
|
-
|
|
850
|
+
Z,
|
|
854
851
|
{
|
|
855
852
|
columnFilterValue: M,
|
|
856
853
|
onChange: u,
|
|
857
|
-
onInputKeyDown:
|
|
858
|
-
propIsRequired:
|
|
854
|
+
onInputKeyDown: f,
|
|
855
|
+
propIsRequired: O,
|
|
859
856
|
propName: _,
|
|
860
|
-
propSchema:
|
|
857
|
+
propSchema: R,
|
|
861
858
|
translate: $
|
|
862
859
|
}
|
|
863
860
|
)
|
|
@@ -868,63 +865,65 @@ const on = ({ index: n, style: o }) => {
|
|
|
868
865
|
columnWidths: n,
|
|
869
866
|
resizeColumnIndex: o,
|
|
870
867
|
setResizeColumnIndex: u,
|
|
871
|
-
tableBodyHeight:
|
|
868
|
+
tableBodyHeight: p
|
|
872
869
|
}) => {
|
|
873
|
-
const [
|
|
870
|
+
const [f, l] = e.useState(0), O = Dt(), _ = e.useCallback(
|
|
874
871
|
($) => {
|
|
875
872
|
const M = n.map(
|
|
876
|
-
(y,
|
|
873
|
+
(y, S) => S === o ? Math.max(y + $, kt) : y
|
|
877
874
|
);
|
|
878
|
-
|
|
875
|
+
O(M);
|
|
879
876
|
},
|
|
880
|
-
[n, o,
|
|
877
|
+
[n, o, O]
|
|
881
878
|
);
|
|
882
|
-
let
|
|
883
|
-
const
|
|
879
|
+
let R = 0;
|
|
880
|
+
const I = e.useCallback(
|
|
884
881
|
($) => {
|
|
885
882
|
u(parseInt($.currentTarget.dataset.columnIndex)), l($.clientX);
|
|
886
883
|
},
|
|
887
884
|
[u]
|
|
888
885
|
), T = e.useCallback(
|
|
889
886
|
($) => {
|
|
890
|
-
_($.clientX -
|
|
887
|
+
_($.clientX - f), l(0), u(-1);
|
|
891
888
|
},
|
|
892
|
-
[
|
|
889
|
+
[f, _, u]
|
|
893
890
|
);
|
|
894
891
|
return /* @__PURE__ */ t("div", { children: [...n].map(($, M) => {
|
|
895
|
-
|
|
892
|
+
R += $;
|
|
896
893
|
const y = ["mig-schema-table__column_resizer"];
|
|
897
894
|
return M === o && y.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ t(
|
|
898
895
|
"div",
|
|
899
896
|
{
|
|
900
|
-
style: { left:
|
|
897
|
+
style: { left: R - en, bottom: p },
|
|
901
898
|
className: y.join(" "),
|
|
902
899
|
draggable: "true",
|
|
903
900
|
"data-column-index": M,
|
|
904
|
-
onDragStart:
|
|
901
|
+
onDragStart: I,
|
|
905
902
|
onDragEnd: T
|
|
906
903
|
},
|
|
907
904
|
M
|
|
908
905
|
);
|
|
909
906
|
}) });
|
|
910
907
|
}, _t = (n) => {
|
|
911
|
-
const [o, u] = e.useState({ width: 0, height: 0 }),
|
|
908
|
+
const [o, u] = e.useState({ width: 0, height: 0 }), p = e.useMemo(
|
|
912
909
|
() => Zt(u, 100),
|
|
913
910
|
[]
|
|
914
911
|
);
|
|
915
912
|
return e.useEffect(() => {
|
|
916
913
|
if (!n)
|
|
917
914
|
return;
|
|
918
|
-
const
|
|
919
|
-
for (const
|
|
920
|
-
const { blockSize: _, inlineSize:
|
|
921
|
-
|
|
915
|
+
const f = new ResizeObserver((l) => {
|
|
916
|
+
for (const O of l) {
|
|
917
|
+
const { blockSize: _, inlineSize: R } = O.borderBoxSize[0];
|
|
918
|
+
p(
|
|
919
|
+
(I) => R && _ && (I.width !== R || I.height !== _) ? { width: R, height: _ } : I
|
|
920
|
+
);
|
|
922
921
|
}
|
|
923
922
|
});
|
|
924
|
-
return
|
|
925
|
-
|
|
923
|
+
return f.observe(n), () => {
|
|
924
|
+
f.disconnect();
|
|
926
925
|
};
|
|
927
|
-
}, [
|
|
926
|
+
}, [p, n]), o;
|
|
928
927
|
}, mn = () => new Promise((n, o) => {
|
|
929
928
|
if (window.ExcelJS) {
|
|
930
929
|
n(window.ExcelJS);
|
|
@@ -937,60 +936,60 @@ const on = ({ index: n, style: o }) => {
|
|
|
937
936
|
o(new Error("Failed to load ExcelJS library"));
|
|
938
937
|
}, document.head.appendChild(u);
|
|
939
938
|
}), hn = async (n) => {
|
|
940
|
-
const o = await mn(),
|
|
939
|
+
const { Workbook: o } = await mn(), u = new o(), p = u.addWorksheet("Data");
|
|
941
940
|
n.length && (p.addRow(
|
|
942
941
|
qt(Object.keys(n[0]), [
|
|
943
942
|
"_index",
|
|
944
943
|
"SELECT_ALL_COLUMN_NAME"
|
|
945
944
|
])
|
|
946
945
|
), p.getRow(1).font = { bold: !0 }, p.addRows(
|
|
947
|
-
n.map((
|
|
948
|
-
const { _index:
|
|
949
|
-
return Object.values(
|
|
946
|
+
n.map((f) => {
|
|
947
|
+
const { _index: l, SELECT_ALL_COLUMN_NAME: O, ..._ } = f;
|
|
948
|
+
return Object.values(_);
|
|
950
949
|
})
|
|
951
|
-
),
|
|
952
|
-
const
|
|
950
|
+
), u.xlsx.writeBuffer().then((f) => {
|
|
951
|
+
const l = new Blob([f], {
|
|
953
952
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
954
953
|
});
|
|
955
|
-
Yt(
|
|
956
|
-
}).catch((
|
|
957
|
-
console.error("Error generating Excel file:",
|
|
954
|
+
Yt(l, "export.xlsx");
|
|
955
|
+
}).catch((f) => {
|
|
956
|
+
console.error("Error generating Excel file:", f);
|
|
958
957
|
}));
|
|
959
958
|
}, Ct = /* @__PURE__ */ new Date("1000-01-01 00:00:00Z"), fn = new Intl.NumberFormat("nl-NL"), bn = new Intl.NumberFormat("nl-NL", {
|
|
960
959
|
style: "currency",
|
|
961
960
|
currency: "EUR"
|
|
962
961
|
});
|
|
963
962
|
function gn(n, o) {
|
|
964
|
-
const { TdBody: u, sortByValue:
|
|
965
|
-
if (
|
|
966
|
-
return
|
|
963
|
+
const { TdBody: u, sortByValue: p } = o || {};
|
|
964
|
+
if (p !== void 0)
|
|
965
|
+
return p;
|
|
967
966
|
if (!n)
|
|
968
967
|
return !1;
|
|
969
|
-
const { format:
|
|
970
|
-
return
|
|
968
|
+
const { format: f, type: l } = n;
|
|
969
|
+
return f?.startsWith("date") || l === "boolean" || l === "integer" || l === "number" || !!u;
|
|
971
970
|
}
|
|
972
971
|
const pn = ({
|
|
973
972
|
CustomElement: n,
|
|
974
973
|
CustomSearchInput: o,
|
|
975
974
|
Heading: u = Bt,
|
|
976
|
-
autoRender:
|
|
977
|
-
checkedIndexes:
|
|
975
|
+
autoRender: p,
|
|
976
|
+
checkedIndexes: f,
|
|
978
977
|
config: l,
|
|
979
|
-
customElementProps:
|
|
978
|
+
customElementProps: O,
|
|
980
979
|
data: _,
|
|
981
|
-
defaultColumnFilters:
|
|
982
|
-
defaultSortAsc:
|
|
980
|
+
defaultColumnFilters: R,
|
|
981
|
+
defaultSortAsc: I = !1,
|
|
983
982
|
defaultSortColumn: T,
|
|
984
983
|
disabledCheckedIndexes: $,
|
|
985
984
|
displayTimezone: M,
|
|
986
985
|
enableAutoFocus: y = !0,
|
|
987
|
-
enableRowCounter:
|
|
988
|
-
getRowClassName:
|
|
989
|
-
getRowSelected:
|
|
986
|
+
enableRowCounter: S = !0,
|
|
987
|
+
getRowClassName: Z,
|
|
988
|
+
getRowSelected: Y,
|
|
990
989
|
getSearchQueryFilterResult: D,
|
|
991
990
|
infiniteLoaderRef: s,
|
|
992
991
|
isColumnFilterable: m = !0,
|
|
993
|
-
isExportable:
|
|
992
|
+
isExportable: b = !0,
|
|
994
993
|
isResizable: w = !0,
|
|
995
994
|
isSearchable: U = !0,
|
|
996
995
|
isSortable: te = !0,
|
|
@@ -1004,7 +1003,7 @@ const pn = ({
|
|
|
1004
1003
|
rowHeight: B = 36,
|
|
1005
1004
|
schema: V,
|
|
1006
1005
|
searchPlaceholder: _e,
|
|
1007
|
-
setCheckedIndexes:
|
|
1006
|
+
setCheckedIndexes: q,
|
|
1008
1007
|
settingsStorageKey: v,
|
|
1009
1008
|
style: A,
|
|
1010
1009
|
translate: k = ft,
|
|
@@ -1016,9 +1015,9 @@ const pn = ({
|
|
|
1016
1015
|
J ? void 0 : _
|
|
1017
1016
|
), [fe, qe] = e.useState(), [a, ke] = e.useState({
|
|
1018
1017
|
searchQuery: "",
|
|
1019
|
-
columnFilterMap:
|
|
1018
|
+
columnFilterMap: R || {},
|
|
1020
1019
|
sortColumn: T,
|
|
1021
|
-
sortAsc:
|
|
1020
|
+
sortAsc: I
|
|
1022
1021
|
}), [z, Tt] = e.useState(
|
|
1023
1022
|
E ? ct(window.location.hash) : null
|
|
1024
1023
|
);
|
|
@@ -1045,10 +1044,10 @@ const pn = ({
|
|
|
1045
1044
|
}, [E]), e.useEffect(() => {
|
|
1046
1045
|
if (!E)
|
|
1047
1046
|
return;
|
|
1048
|
-
const { columnFilterMap: r, searchQuery:
|
|
1049
|
-
searchQuery:
|
|
1050
|
-
columnFilterMap: r ||
|
|
1051
|
-
sortAsc:
|
|
1047
|
+
const { columnFilterMap: r, searchQuery: c, sortAsc: d, sortColumn: i } = z || {}, h = {
|
|
1048
|
+
searchQuery: c || "",
|
|
1049
|
+
columnFilterMap: r || R || {},
|
|
1050
|
+
sortAsc: d === void 0 ? I : d,
|
|
1052
1051
|
sortColumn: i === void 0 ? T : i
|
|
1053
1052
|
};
|
|
1054
1053
|
ke(
|
|
@@ -1057,8 +1056,8 @@ const pn = ({
|
|
|
1057
1056
|
}, [
|
|
1058
1057
|
z,
|
|
1059
1058
|
E,
|
|
1060
|
-
|
|
1061
|
-
|
|
1059
|
+
R,
|
|
1060
|
+
I,
|
|
1062
1061
|
T
|
|
1063
1062
|
]), e.useEffect(() => {
|
|
1064
1063
|
re && re(a);
|
|
@@ -1075,115 +1074,115 @@ const pn = ({
|
|
|
1075
1074
|
...V
|
|
1076
1075
|
}),
|
|
1077
1076
|
[V]
|
|
1078
|
-
), We = v ? localStorage.getItem(`${v}.columnNames`) : null, Fe = v ? localStorage.getItem(`${v}.columnWidths`) : null,
|
|
1077
|
+
), We = v ? localStorage.getItem(`${v}.columnNames`) : null, Fe = v ? localStorage.getItem(`${v}.columnWidths`) : null, K = e.useMemo(() => {
|
|
1079
1078
|
if (Ce)
|
|
1080
1079
|
return Ce;
|
|
1081
1080
|
const r = We ? JSON.parse(We) : void 0;
|
|
1082
|
-
let
|
|
1083
|
-
if (
|
|
1081
|
+
let c = Object.keys(ae);
|
|
1082
|
+
if (q && c.unshift(ee), l) {
|
|
1084
1083
|
Object.keys(l).forEach((i) => {
|
|
1085
|
-
|
|
1084
|
+
c.includes(i) || c.push(i);
|
|
1086
1085
|
});
|
|
1087
|
-
const
|
|
1086
|
+
const d = Object.entries(l).reduce(
|
|
1088
1087
|
(i, [h, N]) => (N.hidden && i.push(h), i),
|
|
1089
1088
|
[]
|
|
1090
1089
|
);
|
|
1091
|
-
|
|
1090
|
+
c = c.filter((i) => !d.includes(i)).sort((i, h) => {
|
|
1092
1091
|
let N = l[i] ? l[i].order : void 0;
|
|
1093
1092
|
N === void 0 && (N = Object.keys(ae).findIndex(
|
|
1094
1093
|
(H) => H === i
|
|
1095
1094
|
));
|
|
1096
|
-
let
|
|
1097
|
-
return
|
|
1095
|
+
let g = l[h] ? l[h].order : void 0;
|
|
1096
|
+
return g === void 0 && (g = Object.keys(ae).findIndex(
|
|
1098
1097
|
(H) => H === h
|
|
1099
|
-
)), h ===
|
|
1098
|
+
)), h === ee || i === ee ? 0 : N === -1 ? 1 : g === -1 ? -1 : N - g;
|
|
1100
1099
|
});
|
|
1101
1100
|
}
|
|
1102
|
-
return r?.length ===
|
|
1101
|
+
return r?.length === c.length ? r : c;
|
|
1103
1102
|
}, [
|
|
1104
1103
|
l,
|
|
1105
1104
|
Ce,
|
|
1106
|
-
|
|
1105
|
+
q,
|
|
1107
1106
|
ae,
|
|
1108
1107
|
We
|
|
1109
1108
|
]), je = e.useMemo(
|
|
1110
|
-
() => x &&
|
|
1111
|
-
(r,
|
|
1112
|
-
(
|
|
1109
|
+
() => x && K ? x.map(
|
|
1110
|
+
(r, c) => K.reduce(
|
|
1111
|
+
(d, i) => {
|
|
1113
1112
|
const h = ae[i], N = l ? l[i] : void 0;
|
|
1114
1113
|
if (N?.renderData)
|
|
1115
|
-
return
|
|
1116
|
-
if (!h || i ===
|
|
1117
|
-
return
|
|
1118
|
-
const
|
|
1114
|
+
return d[i] = N.renderData(r, c), d;
|
|
1115
|
+
if (!h || i === ee)
|
|
1116
|
+
return d[i] = "", d;
|
|
1117
|
+
const g = r ? r[i] : "";
|
|
1119
1118
|
switch (h.type) {
|
|
1120
1119
|
case "array":
|
|
1121
|
-
return
|
|
1120
|
+
return d[i] = h.items?.type === "string" && g ? g.map((H) => k(H)).join(", ") : JSON.stringify(g), d;
|
|
1122
1121
|
case "boolean":
|
|
1123
|
-
return
|
|
1122
|
+
return d[i] = g === void 0 ? "?" : g ? "✓" : "✕", d;
|
|
1124
1123
|
case "number":
|
|
1125
1124
|
case "integer":
|
|
1126
|
-
return
|
|
1125
|
+
return g === void 0 ? (d[i] = "", d) : (d[i] = h.format === "currency" ? bn.format(g) : fn.format(g), d);
|
|
1127
1126
|
// @ts-expect-error investigate
|
|
1128
1127
|
case "string":
|
|
1129
|
-
if (h.format === "date" &&
|
|
1130
|
-
return
|
|
1131
|
-
|
|
1128
|
+
if (h.format === "date" && g)
|
|
1129
|
+
return d[i] = ["2999-12-31", "1970-01-01"].includes(
|
|
1130
|
+
g
|
|
1132
1131
|
) ? "-" : tt(
|
|
1133
|
-
new Date(
|
|
1132
|
+
new Date(g),
|
|
1134
1133
|
N?.dateFormat || vt
|
|
1135
|
-
),
|
|
1136
|
-
if (h.format === "date-time" &&
|
|
1137
|
-
return
|
|
1138
|
-
new Date(
|
|
1134
|
+
), d;
|
|
1135
|
+
if (h.format === "date-time" && g)
|
|
1136
|
+
return d[i] = M ? yt(
|
|
1137
|
+
new Date(g),
|
|
1139
1138
|
M,
|
|
1140
1139
|
Je
|
|
1141
1140
|
) : tt(
|
|
1142
|
-
new Date(
|
|
1141
|
+
new Date(g),
|
|
1143
1142
|
N?.dateFormat || Je
|
|
1144
|
-
),
|
|
1143
|
+
), d;
|
|
1145
1144
|
if (h.enum)
|
|
1146
|
-
return
|
|
1145
|
+
return d[i] = g ? k(g) : "", d;
|
|
1147
1146
|
// fallthrough
|
|
1148
1147
|
default:
|
|
1149
|
-
return
|
|
1148
|
+
return d[i] = g ? `${g}` : "", d;
|
|
1150
1149
|
}
|
|
1151
1150
|
},
|
|
1152
|
-
{ _index:
|
|
1151
|
+
{ _index: c }
|
|
1153
1152
|
)
|
|
1154
1153
|
) : void 0,
|
|
1155
|
-
[x,
|
|
1156
|
-
), xe =
|
|
1157
|
-
let r = 0,
|
|
1158
|
-
return (
|
|
1159
|
-
if (
|
|
1154
|
+
[x, K, ae, l, k, M]
|
|
1155
|
+
), xe = K ? K.length : 0, { dynamicWidthColumnCount: Ge, fixedWidthColumnsWidth: Xe } = e.useMemo(() => {
|
|
1156
|
+
let r = 0, c = 0;
|
|
1157
|
+
return (K || []).forEach((d) => {
|
|
1158
|
+
if (d === ee) {
|
|
1160
1159
|
r += bt;
|
|
1161
1160
|
return;
|
|
1162
1161
|
}
|
|
1163
|
-
const i = l ? l[
|
|
1164
|
-
i?.width ? r += i.width :
|
|
1165
|
-
}, 0), { dynamicWidthColumnCount:
|
|
1166
|
-
}, [
|
|
1162
|
+
const i = l ? l[d] : void 0;
|
|
1163
|
+
i?.width ? r += i.width : c += 1;
|
|
1164
|
+
}, 0), { dynamicWidthColumnCount: c, fixedWidthColumnsWidth: r };
|
|
1165
|
+
}, [K, l]), ie = e.useMemo(() => {
|
|
1167
1166
|
if (Ee)
|
|
1168
1167
|
return new Uint16Array(Ee);
|
|
1169
|
-
const r = Fe ? new Uint16Array(JSON.parse(Fe)) : void 0,
|
|
1168
|
+
const r = Fe ? new Uint16Array(JSON.parse(Fe)) : void 0, c = Math.max(
|
|
1170
1169
|
Math.floor(
|
|
1171
1170
|
(Ae - Xe) / Ge
|
|
1172
1171
|
),
|
|
1173
1172
|
kt
|
|
1174
1173
|
);
|
|
1175
|
-
let
|
|
1174
|
+
let d = (Ae - Xe) % Ge;
|
|
1176
1175
|
const i = new Uint16Array(
|
|
1177
|
-
|
|
1178
|
-
if (h ===
|
|
1176
|
+
K.map((h) => {
|
|
1177
|
+
if (h === ee)
|
|
1179
1178
|
return bt;
|
|
1180
1179
|
const N = l ? l[h] : void 0;
|
|
1181
|
-
return N?.width ? N?.width :
|
|
1180
|
+
return N?.width ? N?.width : d ? (d -= 1, c + 1) : c;
|
|
1182
1181
|
})
|
|
1183
1182
|
);
|
|
1184
1183
|
return r?.length === i.length ? r : i;
|
|
1185
1184
|
}, [
|
|
1186
|
-
|
|
1185
|
+
K,
|
|
1187
1186
|
l,
|
|
1188
1187
|
Ee,
|
|
1189
1188
|
Ge,
|
|
@@ -1196,20 +1195,20 @@ const pn = ({
|
|
|
1196
1195
|
), Ie = e.useMemo(() => {
|
|
1197
1196
|
if (!je || !m && !U || J)
|
|
1198
1197
|
return je;
|
|
1199
|
-
const { searchQuery: r } = a,
|
|
1200
|
-
(h) => `${i[h]}`.toLowerCase().includes(
|
|
1198
|
+
const { searchQuery: r } = a, c = r.toLowerCase() || "", d = (i) => x && D ? D(x[i._index], r) : !(K && !K.find(
|
|
1199
|
+
(h) => `${i[h]}`.toLowerCase().includes(c)
|
|
1201
1200
|
));
|
|
1202
1201
|
return je.filter((i) => {
|
|
1203
|
-
let h =
|
|
1202
|
+
let h = d(i);
|
|
1204
1203
|
return !h || !a.columnFilterMap ? !1 : (Object.entries(a.columnFilterMap).forEach(
|
|
1205
|
-
([N,
|
|
1206
|
-
if (!h ||
|
|
1204
|
+
([N, g]) => {
|
|
1205
|
+
if (!h || g === void 0)
|
|
1207
1206
|
return;
|
|
1208
1207
|
const H = l ? l[N] : void 0;
|
|
1209
1208
|
if (x && H?.filter) {
|
|
1210
1209
|
h = H.filter(
|
|
1211
1210
|
x[i._index],
|
|
1212
|
-
|
|
1211
|
+
g
|
|
1213
1212
|
);
|
|
1214
1213
|
return;
|
|
1215
1214
|
}
|
|
@@ -1218,12 +1217,12 @@ const pn = ({
|
|
|
1218
1217
|
case "boolean":
|
|
1219
1218
|
case "number":
|
|
1220
1219
|
case "integer":
|
|
1221
|
-
if (
|
|
1222
|
-
|
|
1220
|
+
if (g && typeof g == "object") {
|
|
1221
|
+
g.filterEmpty && F === void 0 && (h = !1);
|
|
1223
1222
|
for (const P of Object.keys(
|
|
1224
1223
|
be
|
|
1225
1224
|
)) {
|
|
1226
|
-
const ye =
|
|
1225
|
+
const ye = g[P];
|
|
1227
1226
|
if (h && Gt(ye))
|
|
1228
1227
|
switch (P) {
|
|
1229
1228
|
case be.EQ:
|
|
@@ -1238,15 +1237,15 @@ const pn = ({
|
|
|
1238
1237
|
}
|
|
1239
1238
|
}
|
|
1240
1239
|
} else {
|
|
1241
|
-
if (F === void 0 &&
|
|
1240
|
+
if (F === void 0 && g === null)
|
|
1242
1241
|
return !0;
|
|
1243
|
-
h = F ===
|
|
1242
|
+
h = F === g;
|
|
1244
1243
|
}
|
|
1245
1244
|
break;
|
|
1246
1245
|
// @ts-expect-error investigate
|
|
1247
1246
|
case "string":
|
|
1248
|
-
if (typeof
|
|
1249
|
-
const { from: P, to: ye, filterEmpty: it } =
|
|
1247
|
+
if (typeof g == "object" && (de.format === "date" || de.format === "date-time")) {
|
|
1248
|
+
const { from: P, to: ye, filterEmpty: it } = g;
|
|
1250
1249
|
if (!F)
|
|
1251
1250
|
h = !it;
|
|
1252
1251
|
else {
|
|
@@ -1258,10 +1257,10 @@ const pn = ({
|
|
|
1258
1257
|
// fall through
|
|
1259
1258
|
default:
|
|
1260
1259
|
if (de?.enum) {
|
|
1261
|
-
h = F ===
|
|
1260
|
+
h = F === g;
|
|
1262
1261
|
return;
|
|
1263
1262
|
}
|
|
1264
|
-
h = `${i[N]}`.toLowerCase().includes(`${
|
|
1263
|
+
h = `${i[N]}`.toLowerCase().includes(`${g}`.toLowerCase());
|
|
1265
1264
|
}
|
|
1266
1265
|
}
|
|
1267
1266
|
), h);
|
|
@@ -1273,32 +1272,32 @@ const pn = ({
|
|
|
1273
1272
|
J,
|
|
1274
1273
|
a,
|
|
1275
1274
|
D,
|
|
1276
|
-
|
|
1275
|
+
K,
|
|
1277
1276
|
l,
|
|
1278
1277
|
x,
|
|
1279
1278
|
ae
|
|
1280
1279
|
]), X = e.useMemo(() => {
|
|
1281
|
-
const { sortAsc: r, sortColumn:
|
|
1282
|
-
if (!
|
|
1280
|
+
const { sortAsc: r, sortColumn: c } = a;
|
|
1281
|
+
if (!c || !Ie || !x || J)
|
|
1283
1282
|
return Ie;
|
|
1284
|
-
const
|
|
1283
|
+
const d = ae[c], i = l ? l[c] : void 0, h = i?.sort;
|
|
1285
1284
|
if (h)
|
|
1286
1285
|
return Ie.sort((H, de) => {
|
|
1287
1286
|
const F = x[H._index], P = x[de._index];
|
|
1288
1287
|
return F ? P ? h(
|
|
1289
1288
|
F,
|
|
1290
1289
|
P,
|
|
1291
|
-
r === void 0 ?
|
|
1290
|
+
r === void 0 ? I : r
|
|
1292
1291
|
) : -1 : 1;
|
|
1293
1292
|
});
|
|
1294
|
-
const N =
|
|
1293
|
+
const N = d && d.format?.startsWith("date"), g = gn(d, i);
|
|
1295
1294
|
return Ie.sort((H, de) => {
|
|
1296
|
-
let F =
|
|
1297
|
-
return
|
|
1295
|
+
let F = g && x[H._index] ? x[H._index][c] : `${H[c]}`.toLowerCase(), P = g && x[de._index] ? x[de._index][c] : `${de[c]}`.toLowerCase();
|
|
1296
|
+
return g && N && (F = new Date(F), isNaN(F.getTime()) && (F = Ct), P = new Date(P), isNaN(P.getTime()) && (P = Ct)), F === P ? 0 : F ? P ? (F < P ? 1 : -1) * (r ? -1 : 1) : r ? 1 : -1 : r ? -1 : 1;
|
|
1298
1297
|
});
|
|
1299
1298
|
}, [
|
|
1300
1299
|
l,
|
|
1301
|
-
|
|
1300
|
+
I,
|
|
1302
1301
|
Ie,
|
|
1303
1302
|
J,
|
|
1304
1303
|
ae,
|
|
@@ -1306,24 +1305,24 @@ const pn = ({
|
|
|
1306
1305
|
a
|
|
1307
1306
|
]), st = e.useCallback(
|
|
1308
1307
|
(r) => {
|
|
1309
|
-
const
|
|
1310
|
-
delete
|
|
1308
|
+
const c = { ...a.columnFilterMap };
|
|
1309
|
+
delete c[r], ke({
|
|
1311
1310
|
...a,
|
|
1312
|
-
columnFilterMap:
|
|
1311
|
+
columnFilterMap: c
|
|
1313
1312
|
});
|
|
1314
1313
|
},
|
|
1315
1314
|
[a]
|
|
1316
1315
|
), He = e.useCallback(
|
|
1317
|
-
(r,
|
|
1316
|
+
(r, c) => {
|
|
1318
1317
|
if (E) {
|
|
1319
1318
|
window.location.hash = ze({
|
|
1320
1319
|
...z,
|
|
1321
1320
|
sortColumn: r,
|
|
1322
|
-
sortAsc:
|
|
1321
|
+
sortAsc: c
|
|
1323
1322
|
});
|
|
1324
1323
|
return;
|
|
1325
1324
|
}
|
|
1326
|
-
ke({ ...a, sortColumn: r, sortAsc:
|
|
1325
|
+
ke({ ...a, sortColumn: r, sortAsc: c });
|
|
1327
1326
|
},
|
|
1328
1327
|
[a, z, E]
|
|
1329
1328
|
), Et = e.useCallback(
|
|
@@ -1338,24 +1337,24 @@ const pn = ({
|
|
|
1338
1337
|
qe(a), ge(void 0);
|
|
1339
1338
|
}, [a]);
|
|
1340
1339
|
e.useEffect(() => {
|
|
1341
|
-
if (!
|
|
1340
|
+
if (!p || !z || !fe || !E)
|
|
1342
1341
|
return;
|
|
1343
1342
|
const r = Object.keys(z);
|
|
1344
|
-
let
|
|
1345
|
-
for (const
|
|
1346
|
-
const i = z[
|
|
1343
|
+
let c = !1;
|
|
1344
|
+
for (const d of r) {
|
|
1345
|
+
const i = z[d], h = fe[d];
|
|
1347
1346
|
if (typeof i == "string" && i !== h) {
|
|
1348
|
-
|
|
1347
|
+
c = !0;
|
|
1349
1348
|
break;
|
|
1350
1349
|
}
|
|
1351
1350
|
if (typeof i == "object" && !et(i, h)) {
|
|
1352
|
-
|
|
1351
|
+
c = !0;
|
|
1353
1352
|
break;
|
|
1354
1353
|
}
|
|
1355
1354
|
}
|
|
1356
|
-
|
|
1355
|
+
c && De();
|
|
1357
1356
|
}, [
|
|
1358
|
-
|
|
1357
|
+
p,
|
|
1359
1358
|
z,
|
|
1360
1359
|
fe,
|
|
1361
1360
|
De,
|
|
@@ -1371,11 +1370,11 @@ const pn = ({
|
|
|
1371
1370
|
[X]
|
|
1372
1371
|
), pe = e.useMemo(() => {
|
|
1373
1372
|
const r = B * Se;
|
|
1374
|
-
let
|
|
1375
|
-
if (C && (
|
|
1373
|
+
let c;
|
|
1374
|
+
if (C && (c = C === "100%" ? Re.height : C, !c))
|
|
1376
1375
|
return 0;
|
|
1377
|
-
const
|
|
1378
|
-
return
|
|
1376
|
+
const d = c ? c - ot.height - gt : 0;
|
|
1377
|
+
return d && d < r ? d : r;
|
|
1379
1378
|
}, [
|
|
1380
1379
|
B,
|
|
1381
1380
|
Se,
|
|
@@ -1388,10 +1387,10 @@ const pn = ({
|
|
|
1388
1387
|
},
|
|
1389
1388
|
[]
|
|
1390
1389
|
), At = e.useCallback(
|
|
1391
|
-
(r,
|
|
1390
|
+
(r, c) => {
|
|
1392
1391
|
if (!Q)
|
|
1393
1392
|
return;
|
|
1394
|
-
if (E &&
|
|
1393
|
+
if (E && c !== !1) {
|
|
1395
1394
|
window.location.hash = ze({
|
|
1396
1395
|
...z,
|
|
1397
1396
|
columnFilterMap: {
|
|
@@ -1405,13 +1404,13 @@ const pn = ({
|
|
|
1405
1404
|
st(Q.propName);
|
|
1406
1405
|
return;
|
|
1407
1406
|
}
|
|
1408
|
-
const
|
|
1407
|
+
const d = {
|
|
1409
1408
|
...a.columnFilterMap,
|
|
1410
1409
|
[Q.propName]: r
|
|
1411
1410
|
};
|
|
1412
1411
|
ke({
|
|
1413
1412
|
...a,
|
|
1414
|
-
columnFilterMap:
|
|
1413
|
+
columnFilterMap: d
|
|
1415
1414
|
});
|
|
1416
1415
|
},
|
|
1417
1416
|
[
|
|
@@ -1427,10 +1426,10 @@ const pn = ({
|
|
|
1427
1426
|
columnFilterMap: {},
|
|
1428
1427
|
// Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
|
|
1429
1428
|
sortColumn: T,
|
|
1430
|
-
sortAsc:
|
|
1429
|
+
sortAsc: I
|
|
1431
1430
|
};
|
|
1432
1431
|
E && (window.location.hash = ze(r)), qe(r), ke(r);
|
|
1433
|
-
}, [E,
|
|
1432
|
+
}, [E, I, T]), It = e.useCallback(() => {
|
|
1434
1433
|
const r = z?.searchQuery || "";
|
|
1435
1434
|
E && // prevent hash change for undefined vs empty string compare
|
|
1436
1435
|
(a.searchQuery || r) && a.searchQuery !== r && (window.location.hash = ze({
|
|
@@ -1445,7 +1444,12 @@ const pn = ({
|
|
|
1445
1444
|
), $t = e.useCallback(() => {
|
|
1446
1445
|
v && (localStorage.removeItem(`${v}.columnNames`), localStorage.removeItem(`${v}.columnWidths`), oe(void 0), Oe(void 0));
|
|
1447
1446
|
}, [v]), Ke = e.useCallback(
|
|
1448
|
-
(r) =>
|
|
1447
|
+
(r) => {
|
|
1448
|
+
if (!X || !x || !ne || !le)
|
|
1449
|
+
return !0;
|
|
1450
|
+
const c = X[r];
|
|
1451
|
+
return c && x[c._index] !== void 0;
|
|
1452
|
+
},
|
|
1449
1453
|
[le, ne, X, x]
|
|
1450
1454
|
), Ot = e.useMemo(() => pe ? !(x && !Ne) && !ne ? /* @__PURE__ */ t(
|
|
1451
1455
|
"div",
|
|
@@ -1469,7 +1473,7 @@ const pn = ({
|
|
|
1469
1473
|
isItemLoaded: Ke,
|
|
1470
1474
|
itemCount: le,
|
|
1471
1475
|
loadMoreItems: ne,
|
|
1472
|
-
children: ({ onItemsRendered:
|
|
1476
|
+
children: ({ onItemsRendered: c, ref: d }) => /* @__PURE__ */ t(
|
|
1473
1477
|
lt,
|
|
1474
1478
|
{
|
|
1475
1479
|
className: "mig-schema-table__tbody",
|
|
@@ -1480,17 +1484,17 @@ const pn = ({
|
|
|
1480
1484
|
rowHeight: Ye,
|
|
1481
1485
|
columnCount: xe,
|
|
1482
1486
|
rowCount: Se,
|
|
1483
|
-
ref:
|
|
1487
|
+
ref: d,
|
|
1484
1488
|
onItemsRendered: ({
|
|
1485
1489
|
overscanRowStartIndex: i,
|
|
1486
1490
|
overscanRowStopIndex: h,
|
|
1487
1491
|
visibleRowStartIndex: N,
|
|
1488
|
-
visibleRowStopIndex:
|
|
1489
|
-
}) =>
|
|
1492
|
+
visibleRowStopIndex: g
|
|
1493
|
+
}) => c({
|
|
1490
1494
|
overscanStartIndex: i,
|
|
1491
1495
|
overscanStopIndex: h,
|
|
1492
1496
|
visibleStartIndex: N,
|
|
1493
|
-
visibleStopIndex:
|
|
1497
|
+
visibleStopIndex: g
|
|
1494
1498
|
}),
|
|
1495
1499
|
children: pt
|
|
1496
1500
|
},
|
|
@@ -1549,15 +1553,15 @@ const pn = ({
|
|
|
1549
1553
|
Me.Provider,
|
|
1550
1554
|
{
|
|
1551
1555
|
value: {
|
|
1552
|
-
checkedIndexes:
|
|
1553
|
-
columnNames:
|
|
1556
|
+
checkedIndexes: f,
|
|
1557
|
+
columnNames: K,
|
|
1554
1558
|
columnWidths: ie,
|
|
1555
1559
|
config: l,
|
|
1556
1560
|
disabledCheckedIndexes: $,
|
|
1557
1561
|
displayTimezone: M,
|
|
1558
1562
|
dropTargetIndex: Le,
|
|
1559
|
-
getRowClassName:
|
|
1560
|
-
getRowSelected:
|
|
1563
|
+
getRowClassName: Z,
|
|
1564
|
+
getRowSelected: Y,
|
|
1561
1565
|
isColumnFilterable: m,
|
|
1562
1566
|
isItemLoaded: Ke,
|
|
1563
1567
|
isSortable: te,
|
|
@@ -1566,7 +1570,7 @@ const pn = ({
|
|
|
1566
1570
|
onRowDoubleClick: se,
|
|
1567
1571
|
properties: ae,
|
|
1568
1572
|
required: Mt,
|
|
1569
|
-
setCheckedIndexes:
|
|
1573
|
+
setCheckedIndexes: q,
|
|
1570
1574
|
setCustomColumnNames: oe,
|
|
1571
1575
|
setCustomColumnWidths: Oe,
|
|
1572
1576
|
setDropTargetIndex: Ze,
|
|
@@ -1579,7 +1583,7 @@ const pn = ({
|
|
|
1579
1583
|
tableDataState: a,
|
|
1580
1584
|
translate: k || ft
|
|
1581
1585
|
},
|
|
1582
|
-
children: /* @__PURE__ */
|
|
1586
|
+
children: /* @__PURE__ */ W(
|
|
1583
1587
|
"div",
|
|
1584
1588
|
{
|
|
1585
1589
|
className: `mig-schema-table${L ? " mig-schema-table--clickable-rows" : ""}`,
|
|
@@ -1587,7 +1591,7 @@ const pn = ({
|
|
|
1587
1591
|
style: Rt,
|
|
1588
1592
|
role: "table",
|
|
1589
1593
|
children: [
|
|
1590
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ W(
|
|
1591
1595
|
"div",
|
|
1592
1596
|
{
|
|
1593
1597
|
className: "mig-schema-table__action-container",
|
|
@@ -1611,16 +1615,16 @@ const pn = ({
|
|
|
1611
1615
|
n ? /* @__PURE__ */ t(
|
|
1612
1616
|
n,
|
|
1613
1617
|
{
|
|
1614
|
-
...
|
|
1618
|
+
...O,
|
|
1615
1619
|
renderData: X
|
|
1616
1620
|
}
|
|
1617
1621
|
) : /* @__PURE__ */ t("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1618
|
-
|
|
1622
|
+
S && Array.isArray(_) ? /* @__PURE__ */ t("span", { className: "mig-schema-table__row_counter", children: k(
|
|
1619
1623
|
"showingFilteredCountOfTotalCount",
|
|
1620
1624
|
X?.length || 0,
|
|
1621
1625
|
_.length
|
|
1622
1626
|
) }) : null,
|
|
1623
|
-
|
|
1627
|
+
b ? /* @__PURE__ */ t(
|
|
1624
1628
|
"button",
|
|
1625
1629
|
{
|
|
1626
1630
|
onClick: St,
|
|
@@ -1650,7 +1654,7 @@ const pn = ({
|
|
|
1650
1654
|
]
|
|
1651
1655
|
}
|
|
1652
1656
|
),
|
|
1653
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ W("div", { className: "mig-schema-table__column_resize_container", children: [
|
|
1654
1658
|
/* @__PURE__ */ t(
|
|
1655
1659
|
u,
|
|
1656
1660
|
{
|
|
@@ -1712,31 +1716,31 @@ const pn = ({
|
|
|
1712
1716
|
}
|
|
1713
1717
|
);
|
|
1714
1718
|
}, In = e.memo(pn), Sn = e.memo(({ refresh: n, period: o = 60 }) => {
|
|
1715
|
-
const [u,
|
|
1719
|
+
const [u, p] = e.useState(/* @__PURE__ */ new Date()), [f, l] = e.useState(/* @__PURE__ */ new Date()), O = e.useCallback(() => {
|
|
1716
1720
|
l(/* @__PURE__ */ new Date()), n();
|
|
1717
1721
|
}, [n]), _ = e.useMemo(
|
|
1718
|
-
() => Ut(u,
|
|
1719
|
-
[u,
|
|
1722
|
+
() => Ut(u, f),
|
|
1723
|
+
[u, f]
|
|
1720
1724
|
);
|
|
1721
1725
|
e.useEffect(() => {
|
|
1722
|
-
_ > o &&
|
|
1723
|
-
}, [_, u,
|
|
1726
|
+
_ > o && O();
|
|
1727
|
+
}, [_, u, f, o, O]), e.useEffect(() => {
|
|
1724
1728
|
const T = setInterval(() => {
|
|
1725
|
-
|
|
1729
|
+
p(/* @__PURE__ */ new Date());
|
|
1726
1730
|
}, 1e3);
|
|
1727
1731
|
return () => {
|
|
1728
1732
|
clearInterval(T);
|
|
1729
1733
|
};
|
|
1730
1734
|
}, []);
|
|
1731
|
-
const
|
|
1732
|
-
return /* @__PURE__ */
|
|
1735
|
+
const R = o - _;
|
|
1736
|
+
return /* @__PURE__ */ W(
|
|
1733
1737
|
"div",
|
|
1734
1738
|
{
|
|
1735
1739
|
className: "mx-auto",
|
|
1736
|
-
title: `Refresh ${
|
|
1740
|
+
title: `Refresh ${R > 0 ? `in ${R} seconds` : "NOW"}`,
|
|
1737
1741
|
children: [
|
|
1738
1742
|
"Last update ",
|
|
1739
|
-
tt(
|
|
1743
|
+
tt(f, "HH:mm")
|
|
1740
1744
|
]
|
|
1741
1745
|
}
|
|
1742
1746
|
);
|