mig-schema-table 5.0.18 → 5.0.19
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.css +1 -1
- package/dist/mig-schema-table.d.ts +2 -0
- package/dist/mig-schema-table.es.js +1165 -1093
- package/dist/mig-schema-table.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,386 +1,427 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as s, jsxs as B, Fragment as en } from "react/jsx-runtime";
|
|
2
|
+
import * as tn from "react";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { VariableSizeGrid as
|
|
6
|
-
import { format as
|
|
7
|
-
import { nl as
|
|
8
|
-
import { unCamel as
|
|
9
|
-
import { range as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { nl as
|
|
13
|
-
import { TZDate as
|
|
14
|
-
import { useFloating as
|
|
15
|
-
import
|
|
16
|
-
import { saveAs as
|
|
17
|
-
const
|
|
4
|
+
import { createPortal as nn } from "react-dom";
|
|
5
|
+
import { VariableSizeGrid as Ct, VariableSizeList as rn } from "react-window";
|
|
6
|
+
import { format as sn, endOfDay as on, differenceInSeconds as an } from "date-fns";
|
|
7
|
+
import { nl as ln } from "date-fns/locale";
|
|
8
|
+
import { unCamel as cn, emptyFn as be, timeZone as Ne, localeFormatInTimeZone as Rt, parseLocationHash as wt, serializeLocationHash as He } from "mig-data-tools";
|
|
9
|
+
import { range as un, debounce as dn, difference as mn, isEqual as Xe, isFinite as hn, sum as fn } from "lodash";
|
|
10
|
+
import vt from "react-datepicker";
|
|
11
|
+
import yt from "react-select";
|
|
12
|
+
import { nl as kt } from "date-fns/locale/nl";
|
|
13
|
+
import { TZDate as Ve } from "@date-fns/tz";
|
|
14
|
+
import { useFloating as Dt, flip as xt } from "@floating-ui/react-dom";
|
|
15
|
+
import gn from "react-window-infinite-loader";
|
|
16
|
+
import { saveAs as bn } from "file-saver";
|
|
17
|
+
const ut = (n, o) => (
|
|
18
18
|
// replace jan. with jan
|
|
19
|
-
|
|
20
|
-
),
|
|
19
|
+
sn(n, o, { locale: ln }).replace(".", "")
|
|
20
|
+
), pn = {
|
|
21
21
|
"Europe/Amsterdam": "AMS",
|
|
22
22
|
"Europe/Berlin": "AMS",
|
|
23
23
|
"Asia/Jakarta": "JKT",
|
|
24
24
|
"Asia/Bangkok": "JKT",
|
|
25
25
|
showingFilteredCountOfTotalCount: "Showing {0} of {1}"
|
|
26
26
|
};
|
|
27
|
-
function
|
|
28
|
-
let h =
|
|
29
|
-
return
|
|
30
|
-
h = h.replace(`{${
|
|
27
|
+
function Tt(n, ...o) {
|
|
28
|
+
let h = pn[n] || cn(n);
|
|
29
|
+
return o.forEach((p, _) => {
|
|
30
|
+
h = h.replace(`{${_}}`, `${p}`);
|
|
31
31
|
}), h;
|
|
32
32
|
}
|
|
33
|
-
const ee = "SELECT_ALL_COLUMN_NAME",
|
|
34
|
-
var
|
|
35
|
-
const
|
|
33
|
+
const ee = "SELECT_ALL_COLUMN_NAME", Mt = 40, we = "__drag_handle__", At = 32, $t = "dd MMM yyyy", Ye = "dd MMM yyyy HH:mm", Ot = 25, Et = 50, _n = 3;
|
|
34
|
+
var pe = /* @__PURE__ */ ((n) => (n.GT = "GT", n.LT = "LT", n.EQ = "EQ", n))(pe || {});
|
|
35
|
+
const Lt = /* @__PURE__ */ new Map([
|
|
36
36
|
[!0, "✓"],
|
|
37
37
|
[!1, "✕"],
|
|
38
38
|
[null, "?"]
|
|
39
39
|
]);
|
|
40
|
-
var
|
|
41
|
-
const
|
|
40
|
+
var Qe = /* @__PURE__ */ ((n) => (n.UNAVAILABLE = "UNAVAILABLE", n.AVAILABLE = "AVAILABLE", n.ACTIVE = "ACTIVE", n))(Qe || {});
|
|
41
|
+
const Ie = tn.createContext({
|
|
42
42
|
checkedIndexes: [],
|
|
43
43
|
columnNames: [],
|
|
44
44
|
columnWidths: new Uint16Array(),
|
|
45
45
|
config: {},
|
|
46
46
|
disabledCheckedIndexes: [],
|
|
47
47
|
dropTargetIndex: -1,
|
|
48
|
+
isDraggable: !1,
|
|
48
49
|
isColumnFilterable: !1,
|
|
49
50
|
isItemLoaded: () => !1,
|
|
50
51
|
isSortable: !1,
|
|
52
|
+
onRowDrop: be,
|
|
51
53
|
properties: {},
|
|
52
54
|
required: [],
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
rowDropTargetRowIndex: -1,
|
|
56
|
+
setCustomColumnNames: be,
|
|
57
|
+
setCustomColumnWidths: be,
|
|
58
|
+
setDropTargetIndex: be,
|
|
59
|
+
setFilterSortColumn: be,
|
|
60
|
+
setLastCheckChangedRowIndex: be,
|
|
61
|
+
setMenuConfig: be,
|
|
62
|
+
setRowDropTargetRowIndex: be,
|
|
59
63
|
tableDataState: {
|
|
60
64
|
searchQuery: "",
|
|
61
65
|
columnFilterMap: {},
|
|
62
66
|
sortColumn: "",
|
|
63
67
|
sortAsc: !1
|
|
64
68
|
},
|
|
65
|
-
translate:
|
|
66
|
-
}),
|
|
69
|
+
translate: be
|
|
70
|
+
}), Cn = { type: "boolean" }, wn = ({ columnIndex: n, rowIndex: o, style: h }) => {
|
|
67
71
|
const {
|
|
68
|
-
checkedIndexes:
|
|
69
|
-
columnNames:
|
|
72
|
+
checkedIndexes: p,
|
|
73
|
+
columnNames: _,
|
|
70
74
|
config: f,
|
|
71
|
-
disabledCheckedIndexes:
|
|
72
|
-
displayTimezone:
|
|
73
|
-
getRowClassName:
|
|
74
|
-
getRowSelected:
|
|
75
|
-
isItemLoaded:
|
|
76
|
-
lastCheckChangedRowIndex:
|
|
77
|
-
onRowClick:
|
|
78
|
-
onRowDoubleClick:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
disabledCheckedIndexes: E,
|
|
76
|
+
displayTimezone: C,
|
|
77
|
+
getRowClassName: O,
|
|
78
|
+
getRowSelected: L,
|
|
79
|
+
isItemLoaded: N,
|
|
80
|
+
lastCheckChangedRowIndex: $,
|
|
81
|
+
onRowClick: M,
|
|
82
|
+
onRowDoubleClick: D,
|
|
83
|
+
onRowDrop: I,
|
|
84
|
+
properties: Y,
|
|
85
|
+
rowDropTargetRowIndex: te,
|
|
86
|
+
setCheckedIndexes: q,
|
|
87
|
+
setLastCheckChangedRowIndex: b,
|
|
88
|
+
setRowDropTargetRowIndex: u,
|
|
89
|
+
sortedRenderData: r,
|
|
90
|
+
sourceData: g,
|
|
91
|
+
translate: oe
|
|
92
|
+
} = e.useContext(Ie), W = _[n], ce = W === ee ? Cn : Y[W], G = f ? f[W] : void 0, v = e.useCallback(
|
|
93
|
+
(w) => {
|
|
94
|
+
q && q((T) => T && T.includes(w) ? T.filter((x) => x !== w) : T ? [...T, w] : [w]);
|
|
88
95
|
},
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
(
|
|
92
|
-
if (!
|
|
96
|
+
[q]
|
|
97
|
+
), J = N(o), ne = e.useCallback(
|
|
98
|
+
(w) => {
|
|
99
|
+
if (!g || !r || !M || !J)
|
|
93
100
|
return;
|
|
94
|
-
const { rowIndex:
|
|
95
|
-
if (!
|
|
101
|
+
const { rowIndex: T } = w.currentTarget.dataset;
|
|
102
|
+
if (!T)
|
|
96
103
|
return;
|
|
97
|
-
const
|
|
98
|
-
|
|
104
|
+
const A = r[parseInt(T, 10)];
|
|
105
|
+
M(g[A._index], A._index, w);
|
|
99
106
|
},
|
|
100
|
-
[
|
|
101
|
-
),
|
|
102
|
-
(
|
|
103
|
-
if (!
|
|
107
|
+
[J, M, r, g]
|
|
108
|
+
), re = e.useCallback(
|
|
109
|
+
(w) => {
|
|
110
|
+
if (!g || !r || !D || !J)
|
|
104
111
|
return;
|
|
105
|
-
const { rowIndex:
|
|
106
|
-
if (!
|
|
112
|
+
const { rowIndex: T } = w.currentTarget.dataset;
|
|
113
|
+
if (!T)
|
|
107
114
|
return;
|
|
108
|
-
const
|
|
109
|
-
|
|
115
|
+
const A = r[parseInt(T, 10)];
|
|
116
|
+
D(g[A._index], A._index, w);
|
|
110
117
|
},
|
|
111
|
-
[
|
|
112
|
-
),
|
|
113
|
-
if (!
|
|
118
|
+
[J, D, r, g]
|
|
119
|
+
), S = r ? r[o] : void 0, { showTimezones: ae, TdBody: Z } = G || {}, ue = e.useMemo(() => C ? null : Ne.startsWith("Europe/") ? "Asia/Jakarta" : "Europe/Amsterdam", [C]), j = e.useMemo(() => {
|
|
120
|
+
if (!S || !r)
|
|
114
121
|
return;
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
)} (${
|
|
122
|
+
let w = W === ee ? void 0 : S[W];
|
|
123
|
+
if (ce?.format && ce.format === "date-time" && ae !== !1) {
|
|
124
|
+
const A = g ? g[S._index] : void 0, x = A ? A[W] : void 0, Q = x ? new Date(x) : void 0;
|
|
125
|
+
Q && ue && (w = `${Rt(
|
|
126
|
+
Q,
|
|
127
|
+
ue,
|
|
128
|
+
Ye
|
|
129
|
+
)} (${oe(ue)})`);
|
|
123
130
|
}
|
|
124
|
-
const
|
|
131
|
+
const T = [
|
|
125
132
|
"mig-schema-table__td",
|
|
126
|
-
`mig-schema-table__td--${
|
|
127
|
-
`mig-schema-table__td--prop-${
|
|
133
|
+
`mig-schema-table__td--${o % 2 ? "odd" : "even"}`,
|
|
134
|
+
`mig-schema-table__td--prop-${W}`
|
|
128
135
|
];
|
|
129
|
-
switch (o &&
|
|
130
|
-
|
|
131
|
-
),
|
|
136
|
+
switch (o === te && T.push("mig-schema-table__td--row-drop-target"), g && L && L(g[S._index], S._index) && T.push("mig-schema-table__td--selected"), g && O && T.push(
|
|
137
|
+
O(g[S._index], S._index, r)
|
|
138
|
+
), ce?.type) {
|
|
132
139
|
case "boolean":
|
|
133
|
-
|
|
140
|
+
T.push(`text-${G?.align || "center"}`);
|
|
134
141
|
break;
|
|
135
142
|
case "number":
|
|
136
143
|
case "integer":
|
|
137
|
-
|
|
144
|
+
T.push(`text-${G?.align || "end"}`);
|
|
138
145
|
break;
|
|
139
146
|
default:
|
|
140
|
-
|
|
147
|
+
G?.align && T.push(`text-${G.align}`);
|
|
141
148
|
}
|
|
142
149
|
return {
|
|
143
|
-
"data-row-index":
|
|
144
|
-
"data-column-index":
|
|
150
|
+
"data-row-index": o,
|
|
151
|
+
"data-column-index": n,
|
|
145
152
|
style: h,
|
|
146
|
-
className:
|
|
147
|
-
title:
|
|
148
|
-
onClick:
|
|
149
|
-
onDoubleClick:
|
|
153
|
+
className: T.join(" "),
|
|
154
|
+
title: w,
|
|
155
|
+
onClick: W === ee ? void 0 : ne,
|
|
156
|
+
onDoubleClick: W === ee ? void 0 : re
|
|
150
157
|
};
|
|
151
158
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
a,
|
|
159
|
+
S,
|
|
160
|
+
r,
|
|
161
|
+
W,
|
|
162
|
+
ce,
|
|
163
|
+
ae,
|
|
158
164
|
o,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
te,
|
|
166
|
+
g,
|
|
167
|
+
L,
|
|
168
|
+
O,
|
|
169
|
+
n,
|
|
162
170
|
h,
|
|
171
|
+
ne,
|
|
163
172
|
re,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (!ne || !E)
|
|
173
|
+
ue,
|
|
174
|
+
oe,
|
|
175
|
+
G
|
|
176
|
+
]), he = e.useCallback(
|
|
177
|
+
(w) => {
|
|
178
|
+
if (!v || !S)
|
|
171
179
|
return;
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
for (const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
const T = parseInt(w.currentTarget.dataset.rowIndex);
|
|
181
|
+
if (w.shiftKey && $ !== void 0) {
|
|
182
|
+
const A = p?.includes($) ? $ : void 0;
|
|
183
|
+
if (A !== void 0 && r) {
|
|
184
|
+
const x = o;
|
|
185
|
+
for (const Q of un(
|
|
186
|
+
x > A ? A + 1 : x,
|
|
187
|
+
x > A ? x + 1 : A
|
|
180
188
|
)) {
|
|
181
|
-
const
|
|
182
|
-
(!
|
|
189
|
+
const Me = r[Q]._index;
|
|
190
|
+
(!E || !E.includes(Me)) && v(Me);
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
193
|
} else
|
|
186
|
-
|
|
187
|
-
|
|
194
|
+
v(S._index);
|
|
195
|
+
b(T), ve.current?.focus();
|
|
188
196
|
},
|
|
189
197
|
[
|
|
190
|
-
|
|
191
|
-
L,
|
|
192
|
-
O,
|
|
193
|
-
ne,
|
|
198
|
+
p,
|
|
194
199
|
E,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
$,
|
|
201
|
+
v,
|
|
202
|
+
S,
|
|
203
|
+
o,
|
|
204
|
+
b,
|
|
205
|
+
r
|
|
198
206
|
]
|
|
199
|
-
),
|
|
200
|
-
if (!
|
|
207
|
+
), ve = e.useRef(null);
|
|
208
|
+
if (!S || !j)
|
|
201
209
|
return null;
|
|
202
|
-
if (!
|
|
203
|
-
return /* @__PURE__ */
|
|
204
|
-
if (
|
|
205
|
-
return /* @__PURE__ */
|
|
210
|
+
if (!N || g && !g[S._index])
|
|
211
|
+
return /* @__PURE__ */ s("div", { ...j, children: "loading" });
|
|
212
|
+
if (W === we)
|
|
213
|
+
return /* @__PURE__ */ s(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
...j,
|
|
217
|
+
className: `${j.className} mig-schema-table__td--drag-handle`,
|
|
218
|
+
draggable: !0,
|
|
219
|
+
onDragStart: (w) => {
|
|
220
|
+
w.dataTransfer.effectAllowed = "move", w.dataTransfer.setData("row-drag-index", String(o));
|
|
221
|
+
},
|
|
222
|
+
onDragOver: (w) => {
|
|
223
|
+
w.preventDefault(), w.dataTransfer.dropEffect = "move", u(o);
|
|
224
|
+
},
|
|
225
|
+
onDragEnd: () => u(-1),
|
|
226
|
+
onDrop: (w) => {
|
|
227
|
+
w.preventDefault(), u(-1);
|
|
228
|
+
const T = parseInt(
|
|
229
|
+
w.dataTransfer.getData("row-drag-index"),
|
|
230
|
+
10
|
|
231
|
+
);
|
|
232
|
+
isNaN(T) || I(T, o);
|
|
233
|
+
},
|
|
234
|
+
children: /* @__PURE__ */ s("span", { className: "mig-schema-table__td--drag-handle__icon", children: "⠿" })
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
if (W === ee)
|
|
238
|
+
return /* @__PURE__ */ s("div", { ...j, onMouseDown: he, children: /* @__PURE__ */ s("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ s(
|
|
206
239
|
"input",
|
|
207
240
|
{
|
|
208
|
-
ref:
|
|
241
|
+
ref: ve,
|
|
209
242
|
type: "checkbox",
|
|
210
243
|
readOnly: !0,
|
|
211
|
-
checked:
|
|
212
|
-
disabled:
|
|
244
|
+
checked: p?.includes(S._index),
|
|
245
|
+
disabled: E?.includes(S._index)
|
|
213
246
|
}
|
|
214
247
|
) }) });
|
|
215
|
-
if (
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
248
|
+
if (Z && g)
|
|
249
|
+
return /* @__PURE__ */ s("div", { ...j, children: /* @__PURE__ */ s(
|
|
250
|
+
Z,
|
|
218
251
|
{
|
|
219
|
-
dataIndex:
|
|
220
|
-
rowData:
|
|
221
|
-
rowIndex:
|
|
222
|
-
...
|
|
252
|
+
dataIndex: S._index,
|
|
253
|
+
rowData: g[S._index],
|
|
254
|
+
rowIndex: o,
|
|
255
|
+
...G?.tdBodyProps
|
|
223
256
|
}
|
|
224
257
|
) });
|
|
225
|
-
const
|
|
226
|
-
return
|
|
258
|
+
const se = S[W];
|
|
259
|
+
return ce?.format === "url" && se ? /* @__PURE__ */ s(
|
|
227
260
|
"a",
|
|
228
261
|
{
|
|
229
|
-
href:
|
|
262
|
+
href: se,
|
|
230
263
|
target: "_blank",
|
|
231
264
|
rel: "noopener noreferrer",
|
|
232
|
-
...
|
|
233
|
-
children:
|
|
265
|
+
...j,
|
|
266
|
+
children: se
|
|
234
267
|
}
|
|
235
|
-
) : /* @__PURE__ */
|
|
236
|
-
},
|
|
237
|
-
function
|
|
238
|
-
const { checkedIndexes:
|
|
268
|
+
) : /* @__PURE__ */ s("div", { ...j, children: se });
|
|
269
|
+
}, Nt = e.memo(wn);
|
|
270
|
+
function vn() {
|
|
271
|
+
const { checkedIndexes: n, disabledCheckedIndexes: o, sortedRenderData: h } = e.useContext(Ie);
|
|
239
272
|
return e.useMemo(() => {
|
|
240
|
-
const
|
|
241
|
-
(
|
|
273
|
+
const p = [...h || []].filter(
|
|
274
|
+
(_) => (n ? n.includes(_._index) : !0) || (o ? !o.includes(_._index) : !0)
|
|
242
275
|
);
|
|
243
|
-
return
|
|
244
|
-
}, [
|
|
276
|
+
return n?.length !== 0 && p.length === n?.length;
|
|
277
|
+
}, [n, o, h]);
|
|
245
278
|
}
|
|
246
|
-
function
|
|
247
|
-
return !!(
|
|
279
|
+
function Wt(n, o, h) {
|
|
280
|
+
return !!(n && h?.isSortable !== !1 && (o || h?.renderData || h?.sort));
|
|
248
281
|
}
|
|
249
|
-
function
|
|
250
|
-
const { setCustomColumnWidths:
|
|
282
|
+
function jt() {
|
|
283
|
+
const { setCustomColumnWidths: n, settingsStorageKey: o } = e.useContext(Ie);
|
|
251
284
|
return e.useCallback(
|
|
252
285
|
(h) => {
|
|
253
|
-
|
|
254
|
-
`${
|
|
286
|
+
o && localStorage.setItem(
|
|
287
|
+
`${o}.columnWidths`,
|
|
255
288
|
JSON.stringify(Array.from(h))
|
|
256
|
-
),
|
|
289
|
+
), n(h);
|
|
257
290
|
},
|
|
258
|
-
[
|
|
291
|
+
[n, o]
|
|
259
292
|
);
|
|
260
293
|
}
|
|
261
|
-
const
|
|
294
|
+
const yn = ({ index: n, style: o }) => {
|
|
262
295
|
const {
|
|
263
296
|
checkedIndexes: h,
|
|
264
|
-
columnNames:
|
|
265
|
-
columnWidths:
|
|
297
|
+
columnNames: p,
|
|
298
|
+
columnWidths: _,
|
|
266
299
|
config: f,
|
|
267
|
-
disabledCheckedIndexes:
|
|
268
|
-
dropTargetIndex:
|
|
269
|
-
isColumnFilterable:
|
|
270
|
-
isSortable:
|
|
271
|
-
setCheckedIndexes:
|
|
272
|
-
properties:
|
|
273
|
-
required:
|
|
274
|
-
setCustomColumnNames:
|
|
300
|
+
disabledCheckedIndexes: E,
|
|
301
|
+
dropTargetIndex: C,
|
|
302
|
+
isColumnFilterable: O,
|
|
303
|
+
isSortable: L,
|
|
304
|
+
setCheckedIndexes: N,
|
|
305
|
+
properties: $,
|
|
306
|
+
required: M,
|
|
307
|
+
setCustomColumnNames: D,
|
|
275
308
|
setDropTargetIndex: I,
|
|
276
|
-
setFilterSortColumn:
|
|
309
|
+
setFilterSortColumn: Y,
|
|
277
310
|
setMenuConfig: te,
|
|
278
|
-
settingsStorageKey:
|
|
279
|
-
tableDataState:
|
|
280
|
-
sortedRenderData:
|
|
281
|
-
translate:
|
|
282
|
-
displayTimezone:
|
|
283
|
-
} = e.useContext(
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
),
|
|
311
|
+
settingsStorageKey: q,
|
|
312
|
+
tableDataState: b,
|
|
313
|
+
sortedRenderData: u,
|
|
314
|
+
translate: r,
|
|
315
|
+
displayTimezone: g
|
|
316
|
+
} = e.useContext(Ie), [oe, W] = e.useState(!1), ce = n === C, G = jt(), v = p[n], J = v === ee ? { type: "boolean" } : $[v], ne = b.sortColumn === v ? b.sortAsc : void 0, re = f ? f[v] : void 0;
|
|
317
|
+
let S = O && (J || re?.FilterMenu) && re?.isFilterable !== !1 ? Qe.AVAILABLE : Qe.UNAVAILABLE;
|
|
318
|
+
b.columnFilterMap && b.columnFilterMap[v] !== void 0 && (S = Qe.ACTIVE);
|
|
319
|
+
const ae = Wt(
|
|
320
|
+
L,
|
|
321
|
+
J,
|
|
322
|
+
re
|
|
323
|
+
), Z = [
|
|
291
324
|
"mig-schema-table__th",
|
|
292
|
-
`mig-schema-table__th--filter-${
|
|
293
|
-
`mig-schema-table__th--prop-${
|
|
325
|
+
`mig-schema-table__th--filter-${S}`,
|
|
326
|
+
`mig-schema-table__th--prop-${v}`
|
|
294
327
|
];
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
),
|
|
298
|
-
const { format: ue } =
|
|
299
|
-
align:
|
|
300
|
-
defaultSortDesc:
|
|
301
|
-
showTimezones:
|
|
302
|
-
title:
|
|
303
|
-
} =
|
|
304
|
-
if (
|
|
305
|
-
if (
|
|
306
|
-
|
|
328
|
+
Z.push(
|
|
329
|
+
ae ? "mig-schema-table__th--sortable" : "mig-schema-table__th--unsortable"
|
|
330
|
+
), ne !== void 0 && Z.push("mig-schema-table__th--sorted"), oe && Z.push("mig-schema-table__th--dragging"), ce && Z.push("mig-schema-table__th--drop-target");
|
|
331
|
+
const { format: ue } = J || {}, {
|
|
332
|
+
align: j,
|
|
333
|
+
defaultSortDesc: he,
|
|
334
|
+
showTimezones: ve = !g,
|
|
335
|
+
title: se
|
|
336
|
+
} = re || {}, w = e.useCallback(() => {
|
|
337
|
+
if (ae) {
|
|
338
|
+
if (ne === void 0) {
|
|
339
|
+
Y(v, !he);
|
|
307
340
|
return;
|
|
308
341
|
}
|
|
309
|
-
|
|
342
|
+
Y(v, !ne);
|
|
310
343
|
}
|
|
311
344
|
}, [
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
]),
|
|
318
|
-
(
|
|
319
|
-
const
|
|
320
|
-
te((
|
|
321
|
-
if (
|
|
345
|
+
ae,
|
|
346
|
+
he,
|
|
347
|
+
v,
|
|
348
|
+
Y,
|
|
349
|
+
ne
|
|
350
|
+
]), T = M.includes(v), A = e.useCallback(
|
|
351
|
+
(z) => {
|
|
352
|
+
const fe = z.currentTarget;
|
|
353
|
+
te((ye) => {
|
|
354
|
+
if (ye?.propName !== v)
|
|
322
355
|
return {
|
|
323
|
-
propConfig:
|
|
324
|
-
propIsRequired:
|
|
325
|
-
propName:
|
|
326
|
-
referenceElement:
|
|
356
|
+
propConfig: re,
|
|
357
|
+
propIsRequired: T,
|
|
358
|
+
propName: v,
|
|
359
|
+
referenceElement: fe
|
|
327
360
|
};
|
|
328
361
|
});
|
|
329
362
|
},
|
|
330
|
-
[
|
|
331
|
-
),
|
|
332
|
-
(
|
|
333
|
-
if (!
|
|
363
|
+
[re, T, v, te]
|
|
364
|
+
), x = e.useMemo(() => se !== void 0 ? se : ue === "date-time" && ve ? `${r(v)} (${r(g || Ne)})` : r(v), [se, ue, ve, r, v, g]), Q = e.useCallback(
|
|
365
|
+
(z, fe) => {
|
|
366
|
+
if (!p || !_)
|
|
334
367
|
return;
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
`${
|
|
342
|
-
JSON.stringify(
|
|
368
|
+
const ye = p.indexOf(z), ke = [...p];
|
|
369
|
+
ke.splice(ye, 1);
|
|
370
|
+
const H = ke.indexOf(fe);
|
|
371
|
+
ke.splice(H + 1, 0, z), D(ke);
|
|
372
|
+
const _e = [..._], Oe = _e[ye];
|
|
373
|
+
_e.splice(ye, 1), _e.splice(H + 1, 0, Oe), G(new Uint16Array(_e)), q && localStorage.setItem(
|
|
374
|
+
`${q}.columnNames`,
|
|
375
|
+
JSON.stringify(ke)
|
|
343
376
|
);
|
|
344
377
|
},
|
|
345
378
|
[
|
|
346
|
-
b,
|
|
347
379
|
p,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
380
|
+
_,
|
|
381
|
+
G,
|
|
382
|
+
q,
|
|
383
|
+
D
|
|
351
384
|
]
|
|
352
|
-
),
|
|
353
|
-
(
|
|
354
|
-
|
|
385
|
+
), Me = e.useCallback(
|
|
386
|
+
(z) => {
|
|
387
|
+
Q && (W(!0), z.dataTransfer.effectAllowed = "move", z.dataTransfer.dropEffect = "move", z.dataTransfer.setData("text/plain", v));
|
|
355
388
|
},
|
|
356
|
-
[
|
|
357
|
-
),
|
|
358
|
-
|
|
359
|
-
}, [
|
|
360
|
-
(
|
|
361
|
-
|
|
389
|
+
[Q, v]
|
|
390
|
+
), Se = e.useCallback(() => {
|
|
391
|
+
Q && (W(!1), I(-1));
|
|
392
|
+
}, [Q, I]), ze = e.useCallback(
|
|
393
|
+
(z) => {
|
|
394
|
+
Q && (z.preventDefault(), I(n));
|
|
362
395
|
},
|
|
363
|
-
[
|
|
364
|
-
),
|
|
365
|
-
(
|
|
366
|
-
if (I(-1), !
|
|
396
|
+
[n, Q, I]
|
|
397
|
+
), Re = e.useCallback(
|
|
398
|
+
(z) => {
|
|
399
|
+
if (I(-1), !Q || !v)
|
|
367
400
|
return;
|
|
368
|
-
const
|
|
369
|
-
!
|
|
401
|
+
const fe = z.dataTransfer.getData("text/plain");
|
|
402
|
+
!fe || fe === v || Q(fe, v);
|
|
370
403
|
},
|
|
371
|
-
[
|
|
372
|
-
), Ae =
|
|
373
|
-
!
|
|
374
|
-
Ae ? [] :
|
|
404
|
+
[Q, v, I]
|
|
405
|
+
), Ae = vn(), Ke = e.useCallback(() => {
|
|
406
|
+
!N || !u || N(
|
|
407
|
+
Ae ? [] : u.map((z) => z._index).filter((z) => !E?.includes(z))
|
|
375
408
|
);
|
|
376
409
|
}, [
|
|
377
|
-
|
|
378
|
-
|
|
410
|
+
N,
|
|
411
|
+
u,
|
|
379
412
|
Ae,
|
|
380
|
-
|
|
413
|
+
E
|
|
381
414
|
]);
|
|
382
|
-
if (
|
|
383
|
-
return /* @__PURE__ */
|
|
415
|
+
if (v === we)
|
|
416
|
+
return /* @__PURE__ */ s(
|
|
417
|
+
"div",
|
|
418
|
+
{
|
|
419
|
+
style: o,
|
|
420
|
+
className: "mig-schema-table__th mig-schema-table__th--drag-handle"
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
if (v === ee)
|
|
424
|
+
return /* @__PURE__ */ s("div", { style: o, className: Z.join(" "), children: /* @__PURE__ */ s(
|
|
384
425
|
"div",
|
|
385
426
|
{
|
|
386
427
|
style: {
|
|
@@ -388,65 +429,65 @@ const cn = ({ index: t, style: a }) => {
|
|
|
388
429
|
textAlign: "center"
|
|
389
430
|
},
|
|
390
431
|
title: `${h?.length || 0} selected`,
|
|
391
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ s(
|
|
392
433
|
"input",
|
|
393
434
|
{
|
|
394
435
|
type: "checkbox",
|
|
395
436
|
name: "selectAll",
|
|
396
437
|
checked: Ae,
|
|
397
|
-
onChange:
|
|
438
|
+
onChange: Ke
|
|
398
439
|
}
|
|
399
440
|
)
|
|
400
441
|
}
|
|
401
442
|
) });
|
|
402
|
-
switch (
|
|
443
|
+
switch (J?.type) {
|
|
403
444
|
case "boolean":
|
|
404
|
-
|
|
405
|
-
`text-${
|
|
406
|
-
`justify-content-${
|
|
445
|
+
Z.push(
|
|
446
|
+
`text-${j || "center"}`,
|
|
447
|
+
`justify-content-${j || "center"}`
|
|
407
448
|
);
|
|
408
449
|
break;
|
|
409
450
|
case "integer":
|
|
410
451
|
case "number":
|
|
411
|
-
|
|
412
|
-
`text-${
|
|
413
|
-
`justify-content-${
|
|
452
|
+
Z.push(
|
|
453
|
+
`text-${j || "end"}`,
|
|
454
|
+
`justify-content-${j || "end"}`
|
|
414
455
|
);
|
|
415
456
|
break;
|
|
416
457
|
default:
|
|
417
|
-
|
|
458
|
+
j && Z.push(`text-${j}`);
|
|
418
459
|
}
|
|
419
|
-
let
|
|
420
|
-
return
|
|
460
|
+
let $e = re?.hoverTitle;
|
|
461
|
+
return !$e && typeof x == "string" && ($e = x), /* @__PURE__ */ B(
|
|
421
462
|
"div",
|
|
422
463
|
{
|
|
423
|
-
className:
|
|
424
|
-
style:
|
|
425
|
-
title:
|
|
464
|
+
className: Z.join(" "),
|
|
465
|
+
style: o,
|
|
466
|
+
title: $e,
|
|
426
467
|
draggable: !0,
|
|
427
|
-
onDragStart:
|
|
428
|
-
onDragEnd:
|
|
429
|
-
onDragOver:
|
|
430
|
-
onDrop:
|
|
468
|
+
onDragStart: Me,
|
|
469
|
+
onDragEnd: Se,
|
|
470
|
+
onDragOver: ze,
|
|
471
|
+
onDrop: Re,
|
|
431
472
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ B(
|
|
433
474
|
"div",
|
|
434
475
|
{
|
|
435
476
|
className: "mig-schema-table__th__label-body",
|
|
436
477
|
style: { lineHeight: "44px" },
|
|
437
|
-
onClick:
|
|
478
|
+
onClick: w,
|
|
438
479
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
480
|
+
/* @__PURE__ */ s("span", { className: "mig-schema-table__th__label-body-text", children: x }),
|
|
481
|
+
ne === void 0 ? null : /* @__PURE__ */ s("span", { className: "mig-schema-table__th__sort-icon", children: ne ? "↓" : "↑" })
|
|
441
482
|
]
|
|
442
483
|
}
|
|
443
484
|
),
|
|
444
|
-
|
|
485
|
+
ae || S !== Qe.UNAVAILABLE ? /* @__PURE__ */ s(
|
|
445
486
|
"button",
|
|
446
487
|
{
|
|
447
488
|
className: "mig-schema-table__th__trigger-el",
|
|
448
|
-
onClick:
|
|
449
|
-
children: /* @__PURE__ */
|
|
489
|
+
onClick: A,
|
|
490
|
+
children: /* @__PURE__ */ s(
|
|
450
491
|
"svg",
|
|
451
492
|
{
|
|
452
493
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -458,7 +499,7 @@ const cn = ({ index: t, style: a }) => {
|
|
|
458
499
|
strokeWidth: "2",
|
|
459
500
|
strokeLinecap: "round",
|
|
460
501
|
strokeLinejoin: "round",
|
|
461
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ s("polyline", { points: "6 9 12 15 18 9" })
|
|
462
503
|
}
|
|
463
504
|
)
|
|
464
505
|
}
|
|
@@ -466,49 +507,49 @@ const cn = ({ index: t, style: a }) => {
|
|
|
466
507
|
]
|
|
467
508
|
}
|
|
468
509
|
);
|
|
469
|
-
},
|
|
470
|
-
[
|
|
471
|
-
[
|
|
472
|
-
[
|
|
473
|
-
},
|
|
510
|
+
}, kn = e.memo(yn), Dn = {
|
|
511
|
+
[pe.GT]: ">",
|
|
512
|
+
[pe.LT]: "<",
|
|
513
|
+
[pe.EQ]: "="
|
|
514
|
+
}, xn = e.memo(
|
|
474
515
|
({
|
|
475
|
-
columnFilterValue:
|
|
476
|
-
onChange:
|
|
516
|
+
columnFilterValue: n,
|
|
517
|
+
onChange: o,
|
|
477
518
|
onInputKeyDown: h,
|
|
478
|
-
propIsRequired:
|
|
479
|
-
propName:
|
|
519
|
+
propIsRequired: p,
|
|
520
|
+
propName: _,
|
|
480
521
|
propSchema: f,
|
|
481
|
-
translate:
|
|
522
|
+
translate: E
|
|
482
523
|
}) => {
|
|
483
|
-
const { displayTimezone:
|
|
484
|
-
let I,
|
|
485
|
-
switch (
|
|
524
|
+
const { displayTimezone: C } = e.useContext(Ie), { type: O, format: L, minimum: N, maximum: $ } = f || {}, M = n, D = L === "date-time";
|
|
525
|
+
let I, Y;
|
|
526
|
+
switch (O) {
|
|
486
527
|
case "number":
|
|
487
528
|
case "integer":
|
|
488
|
-
return I =
|
|
489
|
-
const
|
|
529
|
+
return I = M || {}, Y = (b, u, r) => {
|
|
530
|
+
const g = {
|
|
490
531
|
...I,
|
|
491
|
-
[
|
|
492
|
-
},
|
|
493
|
-
(
|
|
532
|
+
[b]: u.value === "" ? void 0 : parseInt(u.value)
|
|
533
|
+
}, oe = Object.values(g).find(
|
|
534
|
+
(W) => isFinite(W)
|
|
494
535
|
);
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
536
|
+
o(
|
|
537
|
+
oe !== void 0 && (N === void 0 || oe >= N) ? g : void 0,
|
|
538
|
+
r
|
|
498
539
|
);
|
|
499
|
-
}, /* @__PURE__ */
|
|
500
|
-
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
540
|
+
}, /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
541
|
+
p ? null : /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
|
|
542
|
+
/* @__PURE__ */ B("label", { className: "d-flex", children: [
|
|
543
|
+
/* @__PURE__ */ s(
|
|
503
544
|
"input",
|
|
504
545
|
{
|
|
505
546
|
type: "checkbox",
|
|
506
547
|
style: { marginRight: 14 },
|
|
507
548
|
checked: !!I.filterEmpty,
|
|
508
549
|
onChange: () => {
|
|
509
|
-
const { filterEmpty:
|
|
510
|
-
|
|
511
|
-
Object.keys(
|
|
550
|
+
const { filterEmpty: b, ...u } = I;
|
|
551
|
+
b || (u.filterEmpty = !0), o(
|
|
552
|
+
Object.keys(u).length ? u : void 0,
|
|
512
553
|
!0
|
|
513
554
|
);
|
|
514
555
|
}
|
|
@@ -516,73 +557,73 @@ const cn = ({ index: t, style: a }) => {
|
|
|
516
557
|
),
|
|
517
558
|
"Hide empty values"
|
|
518
559
|
] }),
|
|
519
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ s("hr", {})
|
|
520
561
|
] }),
|
|
521
|
-
Object.keys(
|
|
522
|
-
const
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
562
|
+
Object.keys(pe).map((b) => {
|
|
563
|
+
const u = I[b];
|
|
564
|
+
return /* @__PURE__ */ B("li", { children: [
|
|
565
|
+
/* @__PURE__ */ s("label", { style: { width: 40, paddingLeft: 16 }, children: Dn[b] }),
|
|
566
|
+
/* @__PURE__ */ s(
|
|
526
567
|
"input",
|
|
527
568
|
{
|
|
528
569
|
className: "form-control",
|
|
529
570
|
style: { width: 120 },
|
|
530
571
|
type: "number",
|
|
531
|
-
value:
|
|
532
|
-
"data-prop-name":
|
|
533
|
-
onChange: (
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
572
|
+
value: u !== void 0 ? u : "",
|
|
573
|
+
"data-prop-name": _,
|
|
574
|
+
onChange: (r) => {
|
|
575
|
+
Y(
|
|
576
|
+
b,
|
|
577
|
+
r.currentTarget,
|
|
537
578
|
!1
|
|
538
579
|
);
|
|
539
580
|
},
|
|
540
|
-
onBlur: (
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
581
|
+
onBlur: (r) => {
|
|
582
|
+
Y(
|
|
583
|
+
b,
|
|
584
|
+
r.currentTarget,
|
|
544
585
|
!0
|
|
545
586
|
);
|
|
546
587
|
},
|
|
547
588
|
onKeyDown: h,
|
|
548
|
-
min:
|
|
549
|
-
max:
|
|
589
|
+
min: N,
|
|
590
|
+
max: $
|
|
550
591
|
}
|
|
551
592
|
)
|
|
552
|
-
] },
|
|
593
|
+
] }, b);
|
|
553
594
|
})
|
|
554
595
|
] });
|
|
555
596
|
case "boolean":
|
|
556
597
|
const te = [!0, !1];
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
value:
|
|
560
|
-
label:
|
|
598
|
+
p || te.push(null);
|
|
599
|
+
const q = M ? M.map((b) => ({
|
|
600
|
+
value: b,
|
|
601
|
+
label: Lt.get(b)
|
|
561
602
|
})) : null;
|
|
562
|
-
return /* @__PURE__ */
|
|
563
|
-
|
|
603
|
+
return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
604
|
+
yt,
|
|
564
605
|
{
|
|
565
606
|
autoFocus: !0,
|
|
566
607
|
menuIsOpen: !0,
|
|
567
608
|
isClearable: !0,
|
|
568
609
|
isMulti: !0,
|
|
569
|
-
placeholder:
|
|
610
|
+
placeholder: E("All"),
|
|
570
611
|
className: "react-select-container",
|
|
571
612
|
classNamePrefix: "react-select",
|
|
572
|
-
value:
|
|
573
|
-
options: te.map((
|
|
574
|
-
value:
|
|
575
|
-
label:
|
|
613
|
+
value: q,
|
|
614
|
+
options: te.map((b) => ({
|
|
615
|
+
value: b,
|
|
616
|
+
label: Lt.get(b)
|
|
576
617
|
})),
|
|
577
618
|
styles: {
|
|
578
|
-
menu: (
|
|
579
|
-
...
|
|
619
|
+
menu: (b) => ({
|
|
620
|
+
...b,
|
|
580
621
|
marginTop: 0
|
|
581
622
|
})
|
|
582
623
|
},
|
|
583
|
-
onChange: (
|
|
584
|
-
const
|
|
585
|
-
|
|
624
|
+
onChange: (b) => {
|
|
625
|
+
const u = b && b.length ? b.map(({ value: r }) => r) : void 0;
|
|
626
|
+
o(u, !0);
|
|
586
627
|
},
|
|
587
628
|
onKeyDown: h
|
|
588
629
|
}
|
|
@@ -590,57 +631,57 @@ const cn = ({ index: t, style: a }) => {
|
|
|
590
631
|
// @ts-expect-error falls through
|
|
591
632
|
case "string":
|
|
592
633
|
if (f?.enum) {
|
|
593
|
-
const
|
|
594
|
-
value:
|
|
595
|
-
label:
|
|
596
|
-
})),
|
|
597
|
-
(
|
|
634
|
+
const b = f.enum.map((r) => ({
|
|
635
|
+
value: r,
|
|
636
|
+
label: E(r)
|
|
637
|
+
})), u = b.filter(
|
|
638
|
+
(r) => (M || []).includes(r.value)
|
|
598
639
|
);
|
|
599
|
-
return /* @__PURE__ */
|
|
600
|
-
|
|
640
|
+
return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
641
|
+
yt,
|
|
601
642
|
{
|
|
602
643
|
isMulti: !0,
|
|
603
644
|
autoFocus: !0,
|
|
604
645
|
menuIsOpen: !0,
|
|
605
646
|
className: "react-select-container",
|
|
606
647
|
classNamePrefix: "react-select",
|
|
607
|
-
value:
|
|
608
|
-
options:
|
|
648
|
+
value: u,
|
|
649
|
+
options: b,
|
|
609
650
|
styles: {
|
|
610
|
-
menu: (
|
|
611
|
-
...
|
|
651
|
+
menu: (r) => ({
|
|
652
|
+
...r,
|
|
612
653
|
marginTop: 0
|
|
613
654
|
})
|
|
614
655
|
},
|
|
615
|
-
onChange: (
|
|
616
|
-
const
|
|
617
|
-
(
|
|
656
|
+
onChange: (r) => {
|
|
657
|
+
const g = r ? r.map(
|
|
658
|
+
(oe) => oe.value
|
|
618
659
|
) : [];
|
|
619
|
-
|
|
660
|
+
o(g.length ? g : void 0, !0);
|
|
620
661
|
},
|
|
621
662
|
onKeyDown: h,
|
|
622
|
-
placeholder:
|
|
663
|
+
placeholder: E("Select...")
|
|
623
664
|
}
|
|
624
665
|
) }) });
|
|
625
666
|
}
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
667
|
+
if (D || L === "date") {
|
|
668
|
+
const b = D ? Ye : $t, u = n || {
|
|
628
669
|
from: void 0,
|
|
629
670
|
to: void 0,
|
|
630
671
|
filterEmpty: void 0
|
|
631
672
|
};
|
|
632
|
-
return /* @__PURE__ */
|
|
633
|
-
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: [
|
|
674
|
+
p ? null : /* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
|
|
675
|
+
/* @__PURE__ */ B("label", { className: "d-flex", children: [
|
|
676
|
+
/* @__PURE__ */ s(
|
|
636
677
|
"input",
|
|
637
678
|
{
|
|
638
679
|
type: "checkbox",
|
|
639
|
-
checked: !!
|
|
680
|
+
checked: !!u.filterEmpty,
|
|
640
681
|
onChange: () => {
|
|
641
|
-
const { filterEmpty:
|
|
642
|
-
|
|
643
|
-
Object.keys(
|
|
682
|
+
const { filterEmpty: r, ...g } = u;
|
|
683
|
+
r || (g.filterEmpty = !0), o(
|
|
684
|
+
Object.keys(g).length ? g : void 0,
|
|
644
685
|
!0
|
|
645
686
|
);
|
|
646
687
|
}
|
|
@@ -648,84 +689,84 @@ const cn = ({ index: t, style: a }) => {
|
|
|
648
689
|
),
|
|
649
690
|
"Hide empty values"
|
|
650
691
|
] }),
|
|
651
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ s("hr", {})
|
|
652
693
|
] }),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
|
|
694
|
+
/* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
|
|
695
|
+
/* @__PURE__ */ s("label", { style: { width: 120, paddingLeft: 4 }, children: "After" }),
|
|
696
|
+
/* @__PURE__ */ s(
|
|
697
|
+
vt,
|
|
657
698
|
{
|
|
658
|
-
dateFormat:
|
|
659
|
-
"data-prop-name":
|
|
660
|
-
locale:
|
|
661
|
-
selected:
|
|
662
|
-
|
|
699
|
+
dateFormat: b,
|
|
700
|
+
"data-prop-name": _,
|
|
701
|
+
locale: kt,
|
|
702
|
+
selected: u.from ? new Ve(u.from).withTimeZone(
|
|
703
|
+
C || Ne
|
|
663
704
|
) : null,
|
|
664
|
-
onChange: (
|
|
665
|
-
if (!
|
|
666
|
-
|
|
705
|
+
onChange: (r) => {
|
|
706
|
+
if (!r && !u.to) {
|
|
707
|
+
o(void 0, !0);
|
|
667
708
|
return;
|
|
668
709
|
}
|
|
669
|
-
if (
|
|
710
|
+
if (u.to && r && r > u.to)
|
|
670
711
|
return;
|
|
671
|
-
const
|
|
672
|
-
|
|
712
|
+
const g = r ? Ve.tz(C || Ne, r) : void 0;
|
|
713
|
+
o(
|
|
673
714
|
{
|
|
674
|
-
...
|
|
675
|
-
from:
|
|
715
|
+
...n,
|
|
716
|
+
from: g
|
|
676
717
|
},
|
|
677
718
|
!0
|
|
678
719
|
);
|
|
679
720
|
},
|
|
680
|
-
placeholderText:
|
|
721
|
+
placeholderText: b,
|
|
681
722
|
isClearable: !0,
|
|
682
723
|
selectsStart: !0,
|
|
683
|
-
showTimeSelect:
|
|
684
|
-
showTimeInput:
|
|
724
|
+
showTimeSelect: D,
|
|
725
|
+
showTimeInput: D,
|
|
685
726
|
showMonthDropdown: !0,
|
|
686
727
|
showYearDropdown: !0,
|
|
687
728
|
timeIntervals: 15,
|
|
688
|
-
shouldCloseOnSelect: !
|
|
729
|
+
shouldCloseOnSelect: !D
|
|
689
730
|
}
|
|
690
731
|
)
|
|
691
732
|
] }),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
733
|
+
/* @__PURE__ */ B("li", { style: { padding: 8 }, children: [
|
|
734
|
+
/* @__PURE__ */ s("label", { style: { width: 120, paddingLeft: 4 }, children: "Before" }),
|
|
735
|
+
/* @__PURE__ */ s(
|
|
736
|
+
vt,
|
|
696
737
|
{
|
|
697
738
|
id: "filter-date",
|
|
698
|
-
dateFormat:
|
|
699
|
-
"data-prop-name":
|
|
700
|
-
locale:
|
|
739
|
+
dateFormat: b,
|
|
740
|
+
"data-prop-name": _,
|
|
741
|
+
locale: kt,
|
|
701
742
|
selectsEnd: !0,
|
|
702
|
-
selected:
|
|
703
|
-
|
|
743
|
+
selected: u.to ? new Ve(u.to).withTimeZone(
|
|
744
|
+
C || Ne
|
|
704
745
|
) : null,
|
|
705
746
|
showMonthDropdown: !0,
|
|
706
747
|
showYearDropdown: !0,
|
|
707
|
-
onChange: (
|
|
708
|
-
if (!
|
|
709
|
-
|
|
748
|
+
onChange: (r) => {
|
|
749
|
+
if (!r && !u.from) {
|
|
750
|
+
o(void 0, !0);
|
|
710
751
|
return;
|
|
711
752
|
}
|
|
712
|
-
const
|
|
713
|
-
|
|
753
|
+
const g = r ? D ? Ve.tz(C || Ne, r) : on(r) : void 0;
|
|
754
|
+
u.from && g && g < u.from || o(
|
|
714
755
|
{
|
|
715
|
-
...
|
|
716
|
-
to:
|
|
756
|
+
...n,
|
|
757
|
+
to: g
|
|
717
758
|
},
|
|
718
759
|
!0
|
|
719
760
|
);
|
|
720
761
|
},
|
|
721
|
-
placeholderText:
|
|
762
|
+
placeholderText: b,
|
|
722
763
|
isClearable: !0,
|
|
723
|
-
startDate:
|
|
724
|
-
endDate:
|
|
725
|
-
showTimeInput:
|
|
726
|
-
showTimeSelect:
|
|
764
|
+
startDate: u.from,
|
|
765
|
+
endDate: u.to,
|
|
766
|
+
showTimeInput: D,
|
|
767
|
+
showTimeSelect: D,
|
|
727
768
|
timeIntervals: 15,
|
|
728
|
-
shouldCloseOnSelect: !
|
|
769
|
+
shouldCloseOnSelect: !D
|
|
729
770
|
}
|
|
730
771
|
)
|
|
731
772
|
] })
|
|
@@ -733,28 +774,28 @@ const cn = ({ index: t, style: a }) => {
|
|
|
733
774
|
}
|
|
734
775
|
// falls through
|
|
735
776
|
default:
|
|
736
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ s("ol", { className: "mig-schema-table-menu mig-schema-table__th-menu__filter-menu-component", children: /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
737
778
|
"input",
|
|
738
779
|
{
|
|
739
780
|
autoFocus: !0,
|
|
740
781
|
type: "search",
|
|
741
782
|
className: "form-control",
|
|
742
|
-
placeholder: `Search ${
|
|
743
|
-
"aria-label": `Search ${
|
|
744
|
-
value: Array.isArray(
|
|
745
|
-
"data-prop-name":
|
|
746
|
-
onChange: (
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
(
|
|
783
|
+
placeholder: `Search ${_}`,
|
|
784
|
+
"aria-label": `Search ${_}`,
|
|
785
|
+
value: Array.isArray(M) ? M.join(",") : M || "",
|
|
786
|
+
"data-prop-name": _,
|
|
787
|
+
onChange: (b) => {
|
|
788
|
+
const u = b.currentTarget.value, r = u ? u.split(",") : [];
|
|
789
|
+
o(
|
|
790
|
+
(r.length > 1 ? r : r[0]) || void 0,
|
|
750
791
|
!1
|
|
751
792
|
);
|
|
752
793
|
},
|
|
753
794
|
onKeyDown: h,
|
|
754
|
-
onBlur: (
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
(
|
|
795
|
+
onBlur: (b) => {
|
|
796
|
+
const u = b.currentTarget.value, r = u ? u.split(",") : [];
|
|
797
|
+
o(
|
|
798
|
+
(r.length > 1 ? r : r[0]) || void 0,
|
|
758
799
|
!0
|
|
759
800
|
);
|
|
760
801
|
}
|
|
@@ -762,761 +803,788 @@ const cn = ({ index: t, style: a }) => {
|
|
|
762
803
|
) }) });
|
|
763
804
|
}
|
|
764
805
|
}
|
|
765
|
-
),
|
|
766
|
-
isSortable:
|
|
767
|
-
isFilterable:
|
|
806
|
+
), Tn = ({
|
|
807
|
+
isSortable: n,
|
|
808
|
+
isFilterable: o,
|
|
768
809
|
onChange: h,
|
|
769
|
-
onClose:
|
|
770
|
-
onInputKeyDown:
|
|
810
|
+
onClose: p,
|
|
811
|
+
onInputKeyDown: _,
|
|
771
812
|
propConfig: f,
|
|
772
|
-
propIsRequired:
|
|
773
|
-
propName:
|
|
774
|
-
propSchema:
|
|
775
|
-
referenceElement:
|
|
776
|
-
setFilterSortColumn:
|
|
777
|
-
translate:
|
|
778
|
-
value:
|
|
813
|
+
propIsRequired: E,
|
|
814
|
+
propName: C,
|
|
815
|
+
propSchema: O,
|
|
816
|
+
referenceElement: L,
|
|
817
|
+
setFilterSortColumn: N,
|
|
818
|
+
translate: $,
|
|
819
|
+
value: M
|
|
779
820
|
}) => {
|
|
780
|
-
const
|
|
821
|
+
const D = Dt({
|
|
781
822
|
placement: "bottom-start",
|
|
782
823
|
elements: {
|
|
783
|
-
reference:
|
|
824
|
+
reference: L
|
|
784
825
|
},
|
|
785
|
-
middleware: [
|
|
786
|
-
}), I =
|
|
826
|
+
middleware: [xt()]
|
|
827
|
+
}), I = Dt({
|
|
787
828
|
placement: "right-start",
|
|
788
|
-
middleware: [
|
|
829
|
+
middleware: [xt()]
|
|
789
830
|
});
|
|
790
831
|
e.useEffect(() => {
|
|
791
|
-
const
|
|
792
|
-
if (!
|
|
832
|
+
const u = (r) => {
|
|
833
|
+
if (!D.elements.floating)
|
|
793
834
|
return;
|
|
794
|
-
let
|
|
795
|
-
for (;
|
|
796
|
-
if (
|
|
835
|
+
let g = r.target;
|
|
836
|
+
for (; g && D.elements.floating; ) {
|
|
837
|
+
if (g === D.elements.floating || g === I.elements.floating)
|
|
797
838
|
return;
|
|
798
|
-
|
|
839
|
+
g = g.parentNode === window.document ? null : g.parentNode;
|
|
799
840
|
}
|
|
800
|
-
|
|
841
|
+
p(r);
|
|
801
842
|
};
|
|
802
|
-
return window.addEventListener("click",
|
|
803
|
-
window.removeEventListener("click",
|
|
843
|
+
return window.addEventListener("click", u, { capture: !0 }), () => {
|
|
844
|
+
window.removeEventListener("click", u, { capture: !0 });
|
|
804
845
|
};
|
|
805
846
|
}, [
|
|
806
|
-
|
|
807
|
-
|
|
847
|
+
D.elements.floating,
|
|
848
|
+
p,
|
|
808
849
|
I.elements.floating
|
|
809
850
|
]);
|
|
810
|
-
const
|
|
811
|
-
(
|
|
812
|
-
|
|
851
|
+
const Y = f?.FilterMenu || xn, te = e.useCallback(
|
|
852
|
+
(u) => {
|
|
853
|
+
N(C, !0), p(u);
|
|
813
854
|
},
|
|
814
|
-
[
|
|
815
|
-
),
|
|
816
|
-
(
|
|
817
|
-
|
|
855
|
+
[p, C, N]
|
|
856
|
+
), q = e.useCallback(
|
|
857
|
+
(u) => {
|
|
858
|
+
N(C, !1), p(u);
|
|
818
859
|
},
|
|
819
|
-
[
|
|
820
|
-
),
|
|
860
|
+
[p, C, N]
|
|
861
|
+
), b = e.useCallback(() => {
|
|
821
862
|
h(void 0, !0);
|
|
822
863
|
}, [h]);
|
|
823
|
-
return !
|
|
824
|
-
/* @__PURE__ */
|
|
864
|
+
return !n && !o ? null : /* @__PURE__ */ B(en, { children: [
|
|
865
|
+
/* @__PURE__ */ s(
|
|
825
866
|
"div",
|
|
826
867
|
{
|
|
827
868
|
className: "mig-schema-table mig-schema-table__th-menu",
|
|
828
|
-
ref:
|
|
829
|
-
style:
|
|
830
|
-
children: /* @__PURE__ */
|
|
831
|
-
|
|
832
|
-
/* @__PURE__ */
|
|
869
|
+
ref: D.refs.setFloating,
|
|
870
|
+
style: D.floatingStyles,
|
|
871
|
+
children: /* @__PURE__ */ B("ol", { className: "mig-schema-table-menu", children: [
|
|
872
|
+
n ? /* @__PURE__ */ B("li", { onClick: te, style: { padding: 8 }, children: [
|
|
873
|
+
/* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: "↓" }),
|
|
833
874
|
" ",
|
|
834
|
-
|
|
875
|
+
$("sortAscending")
|
|
835
876
|
] }) : null,
|
|
836
|
-
|
|
837
|
-
/* @__PURE__ */
|
|
877
|
+
n ? /* @__PURE__ */ B("li", { onClick: q, style: { padding: 8 }, children: [
|
|
878
|
+
/* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: "↑" }),
|
|
838
879
|
" ",
|
|
839
|
-
|
|
880
|
+
$("sortDescending")
|
|
840
881
|
] }) : null,
|
|
841
|
-
|
|
882
|
+
o ? /* @__PURE__ */ B(
|
|
842
883
|
"li",
|
|
843
884
|
{
|
|
844
885
|
style: { padding: 8 },
|
|
845
|
-
onMouseOver: (
|
|
846
|
-
I.refs.setReference(
|
|
886
|
+
onMouseOver: (u) => {
|
|
887
|
+
I.refs.setReference(u.currentTarget);
|
|
847
888
|
},
|
|
848
889
|
children: [
|
|
849
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ s("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ s(
|
|
850
891
|
"input",
|
|
851
892
|
{
|
|
852
893
|
type: "checkbox",
|
|
853
894
|
id: "mig-schema-table__th-menu__filters",
|
|
854
|
-
checked:
|
|
855
|
-
disabled:
|
|
856
|
-
onChange:
|
|
895
|
+
checked: M !== void 0,
|
|
896
|
+
disabled: M === void 0,
|
|
897
|
+
onChange: b
|
|
857
898
|
}
|
|
858
899
|
) }),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ s("label", { htmlFor: "mig-schema-table__th-menu__filters", children: $("filters") }),
|
|
901
|
+
/* @__PURE__ */ s("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
|
|
861
902
|
]
|
|
862
903
|
}
|
|
863
904
|
) : null
|
|
864
905
|
] })
|
|
865
906
|
}
|
|
866
907
|
),
|
|
867
|
-
I.elements.reference ? /* @__PURE__ */
|
|
908
|
+
I.elements.reference ? /* @__PURE__ */ s(
|
|
868
909
|
"div",
|
|
869
910
|
{
|
|
870
911
|
className: "mig-schema-table mig-schema-table__th-menu__sub-menu",
|
|
871
912
|
ref: I.refs.setFloating,
|
|
872
913
|
style: I.floatingStyles,
|
|
873
|
-
children: /* @__PURE__ */
|
|
874
|
-
|
|
914
|
+
children: /* @__PURE__ */ s(
|
|
915
|
+
Y,
|
|
875
916
|
{
|
|
876
|
-
columnFilterValue:
|
|
917
|
+
columnFilterValue: M,
|
|
877
918
|
onChange: h,
|
|
878
|
-
onInputKeyDown:
|
|
879
|
-
propIsRequired:
|
|
880
|
-
propName:
|
|
881
|
-
propSchema:
|
|
882
|
-
translate:
|
|
919
|
+
onInputKeyDown: _,
|
|
920
|
+
propIsRequired: E,
|
|
921
|
+
propName: C,
|
|
922
|
+
propSchema: O,
|
|
923
|
+
translate: $
|
|
883
924
|
}
|
|
884
925
|
)
|
|
885
926
|
}
|
|
886
927
|
) : null
|
|
887
928
|
] });
|
|
888
|
-
},
|
|
889
|
-
columnWidths:
|
|
890
|
-
resizeColumnIndex:
|
|
929
|
+
}, Mn = e.memo(Tn), An = ({
|
|
930
|
+
columnWidths: n,
|
|
931
|
+
resizeColumnIndex: o,
|
|
891
932
|
setResizeColumnIndex: h,
|
|
892
|
-
tableBodyHeight:
|
|
933
|
+
tableBodyHeight: p
|
|
893
934
|
}) => {
|
|
894
|
-
const [
|
|
895
|
-
(
|
|
896
|
-
const
|
|
897
|
-
(
|
|
935
|
+
const [_, f] = e.useState(0), E = jt(), C = e.useCallback(
|
|
936
|
+
($) => {
|
|
937
|
+
const M = n.map(
|
|
938
|
+
(D, I) => I === o ? Math.max(D + $, Ot) : D
|
|
898
939
|
);
|
|
899
|
-
|
|
940
|
+
E(M);
|
|
900
941
|
},
|
|
901
|
-
[
|
|
942
|
+
[n, o, E]
|
|
902
943
|
);
|
|
903
|
-
let
|
|
904
|
-
const
|
|
905
|
-
(
|
|
906
|
-
h(parseInt(
|
|
944
|
+
let O = 0;
|
|
945
|
+
const L = e.useCallback(
|
|
946
|
+
($) => {
|
|
947
|
+
h(parseInt($.currentTarget.dataset.columnIndex)), f($.clientX);
|
|
907
948
|
},
|
|
908
949
|
[h]
|
|
909
|
-
),
|
|
910
|
-
(
|
|
911
|
-
|
|
950
|
+
), N = e.useCallback(
|
|
951
|
+
($) => {
|
|
952
|
+
C($.clientX - _), f(0), h(-1);
|
|
912
953
|
},
|
|
913
|
-
[
|
|
954
|
+
[_, C, h]
|
|
914
955
|
);
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
return
|
|
956
|
+
return /* @__PURE__ */ s("div", { children: [...n].map(($, M) => {
|
|
957
|
+
O += $;
|
|
958
|
+
const D = ["mig-schema-table__column_resizer"];
|
|
959
|
+
return M === o && D.push("mig-schema-table__column_resizer--dragged"), /* @__PURE__ */ s(
|
|
919
960
|
"div",
|
|
920
961
|
{
|
|
921
|
-
style: { left:
|
|
922
|
-
className:
|
|
962
|
+
style: { left: O - _n, bottom: p },
|
|
963
|
+
className: D.join(" "),
|
|
923
964
|
draggable: "true",
|
|
924
|
-
"data-column-index":
|
|
925
|
-
onDragStart:
|
|
926
|
-
onDragEnd:
|
|
965
|
+
"data-column-index": M,
|
|
966
|
+
onDragStart: L,
|
|
967
|
+
onDragEnd: N
|
|
927
968
|
},
|
|
928
|
-
|
|
969
|
+
M
|
|
929
970
|
);
|
|
930
971
|
}) });
|
|
931
|
-
},
|
|
932
|
-
const [
|
|
933
|
-
() =>
|
|
972
|
+
}, It = (n) => {
|
|
973
|
+
const [o, h] = e.useState({ width: 0, height: 0 }), p = e.useMemo(
|
|
974
|
+
() => dn(h, 100),
|
|
934
975
|
[]
|
|
935
976
|
);
|
|
936
977
|
return e.useEffect(() => {
|
|
937
|
-
if (!
|
|
978
|
+
if (!n)
|
|
938
979
|
return;
|
|
939
|
-
const
|
|
940
|
-
for (const
|
|
941
|
-
const { blockSize:
|
|
942
|
-
|
|
943
|
-
(
|
|
980
|
+
const _ = new ResizeObserver((f) => {
|
|
981
|
+
for (const E of f) {
|
|
982
|
+
const { blockSize: C, inlineSize: O } = E.borderBoxSize[0];
|
|
983
|
+
p(
|
|
984
|
+
(L) => O && C && (L.width !== O || L.height !== C) ? { width: O, height: C } : L
|
|
944
985
|
);
|
|
945
986
|
}
|
|
946
987
|
});
|
|
947
|
-
return
|
|
948
|
-
|
|
988
|
+
return _.observe(n), () => {
|
|
989
|
+
_.disconnect();
|
|
949
990
|
};
|
|
950
|
-
}, [
|
|
951
|
-
},
|
|
991
|
+
}, [p, n]), o;
|
|
992
|
+
}, En = () => new Promise((n, o) => {
|
|
952
993
|
if (window.ExcelJS) {
|
|
953
|
-
|
|
994
|
+
n(window.ExcelJS);
|
|
954
995
|
return;
|
|
955
996
|
}
|
|
956
997
|
const h = document.createElement("script");
|
|
957
998
|
h.src = "https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.4.0/exceljs.bare.min.js", h.onload = () => {
|
|
958
|
-
|
|
999
|
+
n(window.ExcelJS);
|
|
959
1000
|
}, h.onerror = () => {
|
|
960
|
-
|
|
1001
|
+
o(new Error("Failed to load ExcelJS library"));
|
|
961
1002
|
}, document.head.appendChild(h);
|
|
962
|
-
}),
|
|
963
|
-
const { Workbook:
|
|
964
|
-
|
|
965
|
-
|
|
1003
|
+
}), Ln = async (n) => {
|
|
1004
|
+
const { Workbook: o } = await En(), h = new o(), p = h.addWorksheet("Data");
|
|
1005
|
+
n.length && (p.addRow(
|
|
1006
|
+
mn(Object.keys(n[0]), [
|
|
966
1007
|
"_index",
|
|
967
1008
|
"SELECT_ALL_COLUMN_NAME"
|
|
968
1009
|
])
|
|
969
|
-
),
|
|
970
|
-
|
|
971
|
-
const { _index: f, SELECT_ALL_COLUMN_NAME:
|
|
972
|
-
return Object.values(
|
|
1010
|
+
), p.getRow(1).font = { bold: !0 }, p.addRows(
|
|
1011
|
+
n.map((_) => {
|
|
1012
|
+
const { _index: f, SELECT_ALL_COLUMN_NAME: E, ...C } = _;
|
|
1013
|
+
return Object.values(C);
|
|
973
1014
|
})
|
|
974
|
-
), h.xlsx.writeBuffer().then((
|
|
975
|
-
const f = new Blob([
|
|
1015
|
+
), h.xlsx.writeBuffer().then((_) => {
|
|
1016
|
+
const f = new Blob([_], {
|
|
976
1017
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
977
1018
|
});
|
|
978
|
-
|
|
979
|
-
}).catch((
|
|
980
|
-
console.error("Error generating Excel file:",
|
|
1019
|
+
bn(f, "export.xlsx");
|
|
1020
|
+
}).catch((_) => {
|
|
1021
|
+
console.error("Error generating Excel file:", _);
|
|
981
1022
|
}));
|
|
982
|
-
},
|
|
1023
|
+
}, St = /* @__PURE__ */ new Date("1000-01-01 00:00:00Z"), Nn = new Intl.NumberFormat("nl-NL"), In = new Intl.NumberFormat("nl-NL", {
|
|
983
1024
|
style: "currency",
|
|
984
1025
|
currency: "EUR"
|
|
985
1026
|
});
|
|
986
|
-
function
|
|
987
|
-
const { TdBody: h, sortByValue:
|
|
988
|
-
if (
|
|
989
|
-
return
|
|
990
|
-
if (!
|
|
1027
|
+
function Sn(n, o) {
|
|
1028
|
+
const { TdBody: h, sortByValue: p } = o || {};
|
|
1029
|
+
if (p !== void 0)
|
|
1030
|
+
return p;
|
|
1031
|
+
if (!n)
|
|
991
1032
|
return !1;
|
|
992
|
-
const { format:
|
|
993
|
-
return
|
|
1033
|
+
const { format: _, type: f } = n;
|
|
1034
|
+
return _?.startsWith("date") || f === "boolean" || f === "integer" || f === "number" || !!h;
|
|
994
1035
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1036
|
+
function ct(n) {
|
|
1037
|
+
return n ? [...n.keys()] : void 0;
|
|
1038
|
+
}
|
|
1039
|
+
const Rn = ({
|
|
1040
|
+
CustomElement: n,
|
|
1041
|
+
CustomSearchInput: o,
|
|
1042
|
+
Heading: h = rn,
|
|
1043
|
+
autoRender: p,
|
|
1044
|
+
checkedIndexes: _,
|
|
1001
1045
|
config: f,
|
|
1002
|
-
customElementProps:
|
|
1003
|
-
data:
|
|
1004
|
-
defaultColumnFilters:
|
|
1005
|
-
defaultSortAsc:
|
|
1006
|
-
defaultSortColumn:
|
|
1007
|
-
disabledCheckedIndexes:
|
|
1008
|
-
displayTimezone:
|
|
1009
|
-
enableAutoFocus:
|
|
1046
|
+
customElementProps: E,
|
|
1047
|
+
data: C,
|
|
1048
|
+
defaultColumnFilters: O,
|
|
1049
|
+
defaultSortAsc: L = !1,
|
|
1050
|
+
defaultSortColumn: N,
|
|
1051
|
+
disabledCheckedIndexes: $,
|
|
1052
|
+
displayTimezone: M,
|
|
1053
|
+
enableAutoFocus: D = !0,
|
|
1010
1054
|
enableRowCounter: I = !0,
|
|
1011
|
-
getRowClassName:
|
|
1055
|
+
getRowClassName: Y,
|
|
1012
1056
|
getRowSelected: te,
|
|
1013
|
-
getSearchQueryFilterResult:
|
|
1014
|
-
infiniteLoaderRef:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1057
|
+
getSearchQueryFilterResult: q,
|
|
1058
|
+
infiniteLoaderRef: b,
|
|
1059
|
+
isDraggable: u = !1,
|
|
1060
|
+
isColumnFilterable: r = !0,
|
|
1061
|
+
isExportable: g = !0,
|
|
1062
|
+
isResizable: oe = !0,
|
|
1063
|
+
isSearchable: W = !0,
|
|
1064
|
+
isSortable: ce = !0,
|
|
1065
|
+
itemCount: G,
|
|
1066
|
+
loadMoreItems: v,
|
|
1067
|
+
maxHeight: J,
|
|
1068
|
+
onRowClick: ne,
|
|
1069
|
+
onRowDoubleClick: re,
|
|
1070
|
+
onRowOrderChange: S,
|
|
1071
|
+
onSearchEnter: ae,
|
|
1072
|
+
onTableDataStateChange: Z,
|
|
1073
|
+
onFilteredSortedDataChange: ue,
|
|
1074
|
+
rowHeight: j = 36,
|
|
1075
|
+
schema: he,
|
|
1076
|
+
searchPlaceholder: ve,
|
|
1077
|
+
setCheckedIndexes: se,
|
|
1032
1078
|
settingsStorageKey: w,
|
|
1033
|
-
style:
|
|
1034
|
-
translate:
|
|
1035
|
-
useFilterStateHash:
|
|
1036
|
-
width:
|
|
1037
|
-
},
|
|
1038
|
-
const [
|
|
1039
|
-
|
|
1040
|
-
), [
|
|
1079
|
+
style: T,
|
|
1080
|
+
translate: A = Tt,
|
|
1081
|
+
useFilterStateHash: x,
|
|
1082
|
+
width: Q
|
|
1083
|
+
}, Me) => {
|
|
1084
|
+
const [Se, ze] = e.useState(), [Re, Ae] = e.useState(), [Ke, $e] = e.useState(-1), [z, fe] = e.useState(-1), [ye, ke] = e.useState(-1), H = C instanceof Function, [_e, Oe] = e.useState(
|
|
1085
|
+
H ? void 0 : ct(C)
|
|
1086
|
+
), [X, et] = e.useState(), [Ft, Bt] = e.useState(), [y, tt] = e.useState(
|
|
1087
|
+
H ? void 0 : C
|
|
1088
|
+
), [De, nt] = e.useState(), [c, xe] = e.useState({
|
|
1041
1089
|
searchQuery: "",
|
|
1042
|
-
columnFilterMap:
|
|
1043
|
-
sortColumn:
|
|
1044
|
-
sortAsc:
|
|
1045
|
-
}), [
|
|
1046
|
-
|
|
1090
|
+
columnFilterMap: O || {},
|
|
1091
|
+
sortColumn: N,
|
|
1092
|
+
sortAsc: L
|
|
1093
|
+
}), [U, Qt] = e.useState(
|
|
1094
|
+
x ? wt(window.location.hash) : null
|
|
1047
1095
|
);
|
|
1048
1096
|
e.useEffect(() => {
|
|
1049
|
-
|
|
1050
|
-
}, [
|
|
1051
|
-
!
|
|
1052
|
-
|
|
1053
|
-
...
|
|
1054
|
-
columnFilterMap:
|
|
1097
|
+
H || (tt(C), Oe(ct(C)));
|
|
1098
|
+
}, [C, H]), e.useEffect(() => {
|
|
1099
|
+
!H || y !== void 0 || C(
|
|
1100
|
+
U && Object.keys(U).length !== 0 ? {
|
|
1101
|
+
...U,
|
|
1102
|
+
columnFilterMap: U.columnFilterMap || {}
|
|
1055
1103
|
} : c
|
|
1056
|
-
).then(
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
}, [
|
|
1060
|
-
|
|
1104
|
+
).then((t) => {
|
|
1105
|
+
tt(t), Oe(ct(t));
|
|
1106
|
+
});
|
|
1107
|
+
}, [C, H, U, y, c]), e.useEffect(() => {
|
|
1108
|
+
De || nt(c);
|
|
1109
|
+
}, [c, De]), e.useEffect(() => {
|
|
1110
|
+
if (!x)
|
|
1061
1111
|
return;
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1112
|
+
const t = () => {
|
|
1113
|
+
Qt(wt(window.location.hash));
|
|
1064
1114
|
};
|
|
1065
|
-
return window.addEventListener("hashchange",
|
|
1066
|
-
window.removeEventListener("hashchange",
|
|
1115
|
+
return window.addEventListener("hashchange", t), () => {
|
|
1116
|
+
window.removeEventListener("hashchange", t);
|
|
1067
1117
|
};
|
|
1068
|
-
}, [
|
|
1069
|
-
|
|
1118
|
+
}, [x]);
|
|
1119
|
+
const dt = e.useRef(O);
|
|
1120
|
+
dt.current = O, e.useEffect(() => {
|
|
1121
|
+
if (!x)
|
|
1070
1122
|
return;
|
|
1071
|
-
const { columnFilterMap:
|
|
1072
|
-
searchQuery:
|
|
1073
|
-
columnFilterMap:
|
|
1074
|
-
sortAsc:
|
|
1075
|
-
sortColumn: i === void 0 ?
|
|
1123
|
+
const { columnFilterMap: t, searchQuery: a, sortAsc: l, sortColumn: i } = U || {}, d = {
|
|
1124
|
+
searchQuery: a || "",
|
|
1125
|
+
columnFilterMap: t || dt.current || {},
|
|
1126
|
+
sortAsc: l === void 0 ? L : l,
|
|
1127
|
+
sortColumn: i === void 0 ? N : i
|
|
1076
1128
|
};
|
|
1077
|
-
|
|
1078
|
-
(
|
|
1129
|
+
xe(
|
|
1130
|
+
(k) => Xe(d, k) ? k : d
|
|
1079
1131
|
);
|
|
1080
|
-
}, [
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
const je = e.useRef(null), st = e.useRef(null), ot = e.useRef(null), Be = vt(st.current), at = vt(
|
|
1090
|
-
ot.current
|
|
1091
|
-
), Ne = e.useMemo(
|
|
1092
|
-
() => he || Math.floor(Be.width || 0),
|
|
1093
|
-
[Be.width, he]
|
|
1094
|
-
), Ie = e.useMemo(() => !nt(c, Ce) && X, [c, Ce, X]), { properties: ie, required: Lt } = e.useMemo(
|
|
1132
|
+
}, [U, x, L, N]), e.useEffect(() => {
|
|
1133
|
+
Z && Z(c);
|
|
1134
|
+
}, [Z, c]);
|
|
1135
|
+
const Ue = e.useRef(null), mt = e.useRef(null), ht = e.useRef(null), Pe = It(mt.current), ft = It(
|
|
1136
|
+
ht.current
|
|
1137
|
+
), We = e.useMemo(
|
|
1138
|
+
() => Q || Math.floor(Pe.width || 0),
|
|
1139
|
+
[Pe.width, Q]
|
|
1140
|
+
), je = e.useMemo(() => !Xe(c, De) && H, [c, De, H]), { properties: ie, required: zt } = e.useMemo(
|
|
1095
1141
|
() => ({
|
|
1096
1142
|
properties: {},
|
|
1097
1143
|
required: [],
|
|
1098
|
-
...
|
|
1144
|
+
...he
|
|
1099
1145
|
}),
|
|
1100
|
-
[
|
|
1101
|
-
),
|
|
1102
|
-
if (
|
|
1103
|
-
return
|
|
1104
|
-
const
|
|
1105
|
-
let
|
|
1106
|
-
if (
|
|
1146
|
+
[he]
|
|
1147
|
+
), Je = w ? localStorage.getItem(`${w}.columnNames`) : null, Ge = w ? localStorage.getItem(`${w}.columnWidths`) : null, K = e.useMemo(() => {
|
|
1148
|
+
if (Se)
|
|
1149
|
+
return Se;
|
|
1150
|
+
const t = Je ? JSON.parse(Je) : void 0;
|
|
1151
|
+
let a = Object.keys(ie);
|
|
1152
|
+
if (se && a.unshift(ee), u && a.unshift(we), f) {
|
|
1107
1153
|
Object.keys(f).forEach((i) => {
|
|
1108
|
-
|
|
1154
|
+
a.includes(i) || a.push(i);
|
|
1109
1155
|
});
|
|
1110
|
-
const
|
|
1111
|
-
(i, [
|
|
1156
|
+
const l = Object.entries(f).reduce(
|
|
1157
|
+
(i, [d, k]) => (k.hidden && i.push(d), i),
|
|
1112
1158
|
[]
|
|
1113
1159
|
);
|
|
1114
|
-
|
|
1115
|
-
let
|
|
1116
|
-
|
|
1117
|
-
(
|
|
1160
|
+
a = a.filter((i) => !l.includes(i)).sort((i, d) => {
|
|
1161
|
+
let k = f[i] ? f[i].order : void 0;
|
|
1162
|
+
k === void 0 && (k = Object.keys(ie).findIndex(
|
|
1163
|
+
(V) => V === i
|
|
1118
1164
|
));
|
|
1119
|
-
let
|
|
1120
|
-
return
|
|
1121
|
-
(
|
|
1122
|
-
)),
|
|
1165
|
+
let m = f[d] ? f[d].order : void 0;
|
|
1166
|
+
return m === void 0 && (m = Object.keys(ie).findIndex(
|
|
1167
|
+
(V) => V === d
|
|
1168
|
+
)), d === ee || i === ee || d === we || i === we ? 0 : k === -1 ? 1 : m === -1 ? -1 : k - m;
|
|
1123
1169
|
});
|
|
1124
1170
|
}
|
|
1125
|
-
return
|
|
1171
|
+
return t?.length === a.length ? t : a;
|
|
1126
1172
|
}, [
|
|
1127
1173
|
f,
|
|
1128
|
-
|
|
1129
|
-
|
|
1174
|
+
Se,
|
|
1175
|
+
u,
|
|
1176
|
+
se,
|
|
1130
1177
|
ie,
|
|
1131
|
-
|
|
1132
|
-
]),
|
|
1133
|
-
() =>
|
|
1134
|
-
(
|
|
1135
|
-
(
|
|
1136
|
-
const
|
|
1137
|
-
if (
|
|
1138
|
-
return
|
|
1139
|
-
if (!
|
|
1140
|
-
return
|
|
1141
|
-
const
|
|
1142
|
-
switch (
|
|
1178
|
+
Je
|
|
1179
|
+
]), Te = e.useMemo(
|
|
1180
|
+
() => y && K ? y.map(
|
|
1181
|
+
(t, a) => K.reduce(
|
|
1182
|
+
(l, i) => {
|
|
1183
|
+
const d = ie[i], k = f ? f[i] : void 0;
|
|
1184
|
+
if (k?.renderData)
|
|
1185
|
+
return l[i] = k.renderData(t, a), l;
|
|
1186
|
+
if (!d || i === ee || i === we)
|
|
1187
|
+
return l[i] = "", l;
|
|
1188
|
+
const m = t ? t[i] : "";
|
|
1189
|
+
switch (d.type) {
|
|
1143
1190
|
case "array":
|
|
1144
|
-
return
|
|
1191
|
+
return l[i] = d.items?.type === "string" && m ? m.map((V) => A(V)).join(", ") : JSON.stringify(m), l;
|
|
1145
1192
|
case "boolean":
|
|
1146
|
-
return
|
|
1193
|
+
return l[i] = m === void 0 ? "?" : m ? "✓" : "✕", l;
|
|
1147
1194
|
case "number":
|
|
1148
1195
|
case "integer":
|
|
1149
|
-
return
|
|
1196
|
+
return m === void 0 ? (l[i] = "", l) : (l[i] = d.format === "currency" ? In.format(m) : Nn.format(m), l);
|
|
1150
1197
|
// @ts-expect-error investigate
|
|
1151
1198
|
case "string":
|
|
1152
|
-
if (
|
|
1153
|
-
return
|
|
1154
|
-
|
|
1155
|
-
) ? "-" :
|
|
1156
|
-
new Date(
|
|
1157
|
-
|
|
1158
|
-
),
|
|
1159
|
-
if (
|
|
1160
|
-
return
|
|
1161
|
-
new Date(
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
) :
|
|
1165
|
-
new Date(
|
|
1166
|
-
|
|
1167
|
-
),
|
|
1168
|
-
if (
|
|
1169
|
-
return
|
|
1199
|
+
if (d.format === "date" && m)
|
|
1200
|
+
return l[i] = ["2999-12-31", "1970-01-01"].includes(
|
|
1201
|
+
m
|
|
1202
|
+
) ? "-" : ut(
|
|
1203
|
+
new Date(m),
|
|
1204
|
+
k?.dateFormat || $t
|
|
1205
|
+
), l;
|
|
1206
|
+
if (d.format === "date-time" && m)
|
|
1207
|
+
return l[i] = M ? Rt(
|
|
1208
|
+
new Date(m),
|
|
1209
|
+
M,
|
|
1210
|
+
Ye
|
|
1211
|
+
) : ut(
|
|
1212
|
+
new Date(m),
|
|
1213
|
+
k?.dateFormat || Ye
|
|
1214
|
+
), l;
|
|
1215
|
+
if (d.enum)
|
|
1216
|
+
return l[i] = m ? A(m) : "", l;
|
|
1170
1217
|
// fallthrough
|
|
1171
1218
|
default:
|
|
1172
|
-
return
|
|
1219
|
+
return l[i] = m ? `${m}` : "", l;
|
|
1173
1220
|
}
|
|
1174
1221
|
},
|
|
1175
|
-
{ _index:
|
|
1222
|
+
{ _index: a }
|
|
1176
1223
|
)
|
|
1177
1224
|
) : void 0,
|
|
1178
|
-
[
|
|
1179
|
-
),
|
|
1180
|
-
let
|
|
1181
|
-
return (K || []).forEach((
|
|
1182
|
-
if (
|
|
1183
|
-
|
|
1225
|
+
[y, K, ie, f, A, M]
|
|
1226
|
+
), Ee = K ? K.length : 0, { dynamicWidthColumnCount: rt, fixedWidthColumnsWidth: st } = e.useMemo(() => {
|
|
1227
|
+
let t = 0, a = 0;
|
|
1228
|
+
return (K || []).forEach((l) => {
|
|
1229
|
+
if (l === ee) {
|
|
1230
|
+
t += Mt;
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
if (l === we) {
|
|
1234
|
+
t += At;
|
|
1184
1235
|
return;
|
|
1185
1236
|
}
|
|
1186
|
-
const i = f ? f[
|
|
1187
|
-
i?.width ?
|
|
1188
|
-
}, 0), { dynamicWidthColumnCount:
|
|
1237
|
+
const i = f ? f[l] : void 0;
|
|
1238
|
+
i?.width ? t += i.width : a += 1;
|
|
1239
|
+
}, 0), { dynamicWidthColumnCount: a, fixedWidthColumnsWidth: t };
|
|
1189
1240
|
}, [K, f]), le = e.useMemo(() => {
|
|
1190
|
-
if (
|
|
1191
|
-
return new Uint16Array(
|
|
1192
|
-
const
|
|
1241
|
+
if (Re)
|
|
1242
|
+
return new Uint16Array(Re);
|
|
1243
|
+
const t = Ge ? new Uint16Array(JSON.parse(Ge)) : void 0, a = Math.max(
|
|
1193
1244
|
Math.floor(
|
|
1194
|
-
(
|
|
1245
|
+
(We - st) / rt
|
|
1195
1246
|
),
|
|
1196
|
-
|
|
1247
|
+
Ot
|
|
1197
1248
|
);
|
|
1198
|
-
let
|
|
1249
|
+
let l = (We - st) % rt;
|
|
1199
1250
|
const i = new Uint16Array(
|
|
1200
|
-
K.map((
|
|
1201
|
-
if (
|
|
1202
|
-
return
|
|
1203
|
-
|
|
1204
|
-
|
|
1251
|
+
K.map((d) => {
|
|
1252
|
+
if (d === ee)
|
|
1253
|
+
return Mt;
|
|
1254
|
+
if (d === we)
|
|
1255
|
+
return At;
|
|
1256
|
+
const k = f ? f[d] : void 0;
|
|
1257
|
+
return k?.width ? k?.width : l ? (l -= 1, a + 1) : a;
|
|
1205
1258
|
})
|
|
1206
1259
|
);
|
|
1207
|
-
return
|
|
1260
|
+
return t?.length === i.length ? t : i;
|
|
1208
1261
|
}, [
|
|
1209
1262
|
K,
|
|
1210
1263
|
f,
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
]),
|
|
1217
|
-
(
|
|
1264
|
+
Re,
|
|
1265
|
+
rt,
|
|
1266
|
+
st,
|
|
1267
|
+
Ge,
|
|
1268
|
+
We
|
|
1269
|
+
]), Ze = e.useCallback(
|
|
1270
|
+
(t) => le ? le[t] : 1,
|
|
1218
1271
|
[le]
|
|
1219
|
-
),
|
|
1220
|
-
if (!
|
|
1221
|
-
return
|
|
1222
|
-
const { searchQuery:
|
|
1223
|
-
(
|
|
1272
|
+
), Fe = e.useMemo(() => {
|
|
1273
|
+
if (!Te || !r && !W || H)
|
|
1274
|
+
return Te;
|
|
1275
|
+
const { searchQuery: t } = c, a = t.toLowerCase() || "", l = (i) => y && q ? q(y[i._index], t) : !(K && !K.find(
|
|
1276
|
+
(d) => `${i[d]}`.toLowerCase().includes(a)
|
|
1224
1277
|
));
|
|
1225
|
-
return
|
|
1226
|
-
let
|
|
1227
|
-
return !
|
|
1228
|
-
([
|
|
1229
|
-
if (!
|
|
1278
|
+
return Te.filter((i) => {
|
|
1279
|
+
let d = l(i);
|
|
1280
|
+
return !d || !c.columnFilterMap ? !1 : (Object.entries(c.columnFilterMap).forEach(
|
|
1281
|
+
([k, m]) => {
|
|
1282
|
+
if (!d || m === void 0)
|
|
1230
1283
|
return;
|
|
1231
|
-
const
|
|
1232
|
-
if (
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1284
|
+
const V = f ? f[k] : void 0;
|
|
1285
|
+
if (y && V?.filter) {
|
|
1286
|
+
d = V.filter(
|
|
1287
|
+
y[i._index],
|
|
1288
|
+
m
|
|
1236
1289
|
);
|
|
1237
1290
|
return;
|
|
1238
1291
|
}
|
|
1239
|
-
const me = ie[
|
|
1292
|
+
const me = ie[k], R = y[i._index]?.[k];
|
|
1240
1293
|
switch (me?.type) {
|
|
1241
1294
|
case "boolean":
|
|
1242
|
-
if (
|
|
1295
|
+
if (m === void 0)
|
|
1243
1296
|
return;
|
|
1244
|
-
if (Array.isArray(
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
) || (
|
|
1297
|
+
if (Array.isArray(m) && m.length) {
|
|
1298
|
+
m.includes(
|
|
1299
|
+
R === void 0 ? null : R
|
|
1300
|
+
) || (d = !1);
|
|
1248
1301
|
return;
|
|
1249
1302
|
}
|
|
1250
|
-
|
|
1303
|
+
d = R === m;
|
|
1251
1304
|
break;
|
|
1252
1305
|
case "number":
|
|
1253
1306
|
case "integer":
|
|
1254
|
-
if (
|
|
1255
|
-
|
|
1256
|
-
for (const
|
|
1257
|
-
|
|
1307
|
+
if (m && typeof m == "object") {
|
|
1308
|
+
m.filterEmpty && R === void 0 && (d = !1);
|
|
1309
|
+
for (const P of Object.keys(
|
|
1310
|
+
pe
|
|
1258
1311
|
)) {
|
|
1259
|
-
const
|
|
1260
|
-
if (
|
|
1261
|
-
switch (
|
|
1262
|
-
case
|
|
1263
|
-
|
|
1312
|
+
const ge = m[P];
|
|
1313
|
+
if (d && hn(ge))
|
|
1314
|
+
switch (P) {
|
|
1315
|
+
case pe.EQ:
|
|
1316
|
+
R !== ge && (d = !1);
|
|
1264
1317
|
break;
|
|
1265
|
-
case
|
|
1266
|
-
|
|
1318
|
+
case pe.GT:
|
|
1319
|
+
R <= ge && (d = !1);
|
|
1267
1320
|
break;
|
|
1268
|
-
case
|
|
1269
|
-
|
|
1321
|
+
case pe.LT:
|
|
1322
|
+
R >= ge && (d = !1);
|
|
1270
1323
|
break;
|
|
1271
1324
|
}
|
|
1272
1325
|
}
|
|
1273
1326
|
} else {
|
|
1274
|
-
if (
|
|
1327
|
+
if (R === void 0 && m === null)
|
|
1275
1328
|
return !0;
|
|
1276
|
-
|
|
1329
|
+
d = R === m;
|
|
1277
1330
|
}
|
|
1278
1331
|
break;
|
|
1279
1332
|
// @ts-expect-error investigate
|
|
1280
1333
|
case "string":
|
|
1281
|
-
if (typeof
|
|
1282
|
-
const { from:
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1334
|
+
if (typeof m == "object" && !Array.isArray(m) && (me.format === "date" || me.format === "date-time")) {
|
|
1335
|
+
const { from: P, to: ge, filterEmpty: _t } = m;
|
|
1336
|
+
if (!R)
|
|
1337
|
+
d = !_t;
|
|
1285
1338
|
else {
|
|
1286
|
-
const
|
|
1287
|
-
(
|
|
1339
|
+
const qe = R ? new Date(R) : void 0;
|
|
1340
|
+
(_t === !1 || P && (!qe || qe < P) || ge && (!qe || qe > ge)) && (d = !1);
|
|
1288
1341
|
}
|
|
1289
1342
|
return;
|
|
1290
1343
|
}
|
|
1291
1344
|
// fall through
|
|
1292
1345
|
default:
|
|
1293
1346
|
if (me?.enum) {
|
|
1294
|
-
Array.isArray(
|
|
1347
|
+
Array.isArray(m) ? d = m.includes(R) : d = R === m;
|
|
1295
1348
|
return;
|
|
1296
1349
|
}
|
|
1297
|
-
if (Array.isArray(
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
(
|
|
1350
|
+
if (Array.isArray(m)) {
|
|
1351
|
+
const P = `${i[k]}`.toLowerCase();
|
|
1352
|
+
d = m.some(
|
|
1353
|
+
(ge) => P.includes(`${ge}`.toLowerCase())
|
|
1301
1354
|
);
|
|
1302
1355
|
} else
|
|
1303
|
-
|
|
1356
|
+
d = `${i[k]}`.toLowerCase().includes(`${m}`.toLowerCase());
|
|
1304
1357
|
}
|
|
1305
1358
|
}
|
|
1306
|
-
),
|
|
1359
|
+
), d);
|
|
1307
1360
|
});
|
|
1308
1361
|
}, [
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1362
|
+
Te,
|
|
1363
|
+
r,
|
|
1364
|
+
W,
|
|
1365
|
+
H,
|
|
1313
1366
|
c,
|
|
1314
|
-
|
|
1367
|
+
q,
|
|
1315
1368
|
K,
|
|
1316
1369
|
f,
|
|
1317
|
-
|
|
1370
|
+
y,
|
|
1318
1371
|
ie
|
|
1319
|
-
]),
|
|
1320
|
-
const { sortAsc:
|
|
1321
|
-
if (!
|
|
1322
|
-
return
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1325
|
-
return
|
|
1326
|
-
const
|
|
1327
|
-
return
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1372
|
+
]), ot = e.useMemo(() => {
|
|
1373
|
+
const { sortAsc: t, sortColumn: a } = c;
|
|
1374
|
+
if (!a || !Fe || !y || H)
|
|
1375
|
+
return Fe;
|
|
1376
|
+
const l = ie[a], i = f ? f[a] : void 0, d = i?.sort;
|
|
1377
|
+
if (d)
|
|
1378
|
+
return Fe.sort((V, me) => {
|
|
1379
|
+
const R = y[V._index], P = y[me._index];
|
|
1380
|
+
return R ? P ? d(
|
|
1381
|
+
R,
|
|
1382
|
+
P,
|
|
1383
|
+
t === void 0 ? L : t
|
|
1331
1384
|
) : -1 : 1;
|
|
1332
1385
|
});
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1335
|
-
let
|
|
1336
|
-
return
|
|
1386
|
+
const k = l && l.format?.startsWith("date"), m = Sn(l, i);
|
|
1387
|
+
return Fe.sort((V, me) => {
|
|
1388
|
+
let R = m && y[V._index] ? y[V._index][a] : `${V[a]}`.toLowerCase(), P = m && y[me._index] ? y[me._index][a] : `${me[a]}`.toLowerCase();
|
|
1389
|
+
return m && k && (R = new Date(R), isNaN(R.getTime()) && (R = St), P = new Date(P), isNaN(P.getTime()) && (P = St)), R === P ? 0 : R ? P ? (R < P ? 1 : -1) * (t ? -1 : 1) : t ? 1 : -1 : t ? -1 : 1;
|
|
1337
1390
|
});
|
|
1338
1391
|
}, [
|
|
1339
1392
|
f,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1393
|
+
L,
|
|
1394
|
+
Fe,
|
|
1395
|
+
H,
|
|
1343
1396
|
ie,
|
|
1344
|
-
|
|
1397
|
+
y,
|
|
1345
1398
|
c
|
|
1346
|
-
])
|
|
1399
|
+
]), F = e.useMemo(() => !_e?.length || !Te || c.sortColumn ? ot : _e.map((t) => Te[t]), [_e, Te, ot, c.sortColumn]), Ut = e.useCallback(
|
|
1400
|
+
(t, a) => {
|
|
1401
|
+
if (!F || !y || t === a)
|
|
1402
|
+
return;
|
|
1403
|
+
const l = F.map((k) => k._index), [i] = l.splice(t, 1), d = t < a ? a - 1 : a;
|
|
1404
|
+
l.splice(d, 0, i), Oe(l), xe((k) => ({
|
|
1405
|
+
...k,
|
|
1406
|
+
sortColumn: void 0,
|
|
1407
|
+
sortAsc: void 0
|
|
1408
|
+
})), S?.(l.map((k) => y[k]));
|
|
1409
|
+
},
|
|
1410
|
+
[F, y, S]
|
|
1411
|
+
);
|
|
1347
1412
|
e.useImperativeHandle(
|
|
1348
|
-
|
|
1413
|
+
Me,
|
|
1349
1414
|
() => ({
|
|
1350
|
-
getFilteredSortedData: () =>
|
|
1351
|
-
scrollToIndex: (
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1415
|
+
getFilteredSortedData: () => F,
|
|
1416
|
+
scrollToIndex: (t) => {
|
|
1417
|
+
const a = Ue?.current, l = F?.findIndex((i) => i._index === t) || -1;
|
|
1418
|
+
a && l >= 0 && a.scrollToItem({ rowIndex: l });
|
|
1354
1419
|
}
|
|
1355
1420
|
}),
|
|
1356
|
-
[
|
|
1357
|
-
)
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
(
|
|
1362
|
-
|
|
1363
|
-
|
|
1421
|
+
[F, Ue]
|
|
1422
|
+
);
|
|
1423
|
+
const gt = e.useRef(void 0);
|
|
1424
|
+
e.useEffect(() => {
|
|
1425
|
+
const t = F?.map((l) => l._index), a = gt.current;
|
|
1426
|
+
a && a.sourceData === y && Xe(a.indices, t) || (gt.current = { sourceData: y, indices: t }, ue?.(F));
|
|
1427
|
+
}, [F, ue, y]);
|
|
1428
|
+
const bt = e.useCallback(
|
|
1429
|
+
(t) => {
|
|
1430
|
+
const a = { ...c.columnFilterMap };
|
|
1431
|
+
delete a[t], xe({
|
|
1364
1432
|
...c,
|
|
1365
|
-
columnFilterMap:
|
|
1433
|
+
columnFilterMap: a
|
|
1366
1434
|
});
|
|
1367
1435
|
},
|
|
1368
1436
|
[c]
|
|
1369
|
-
),
|
|
1370
|
-
(
|
|
1371
|
-
if (
|
|
1372
|
-
window.location.hash =
|
|
1373
|
-
...
|
|
1374
|
-
sortColumn:
|
|
1375
|
-
sortAsc:
|
|
1437
|
+
), at = e.useCallback(
|
|
1438
|
+
(t, a) => {
|
|
1439
|
+
if (x) {
|
|
1440
|
+
window.location.hash = He({
|
|
1441
|
+
...U,
|
|
1442
|
+
sortColumn: t,
|
|
1443
|
+
sortAsc: a
|
|
1376
1444
|
});
|
|
1377
1445
|
return;
|
|
1378
1446
|
}
|
|
1379
|
-
|
|
1447
|
+
xe({ ...c, sortColumn: t, sortAsc: a });
|
|
1380
1448
|
},
|
|
1381
|
-
[c,
|
|
1382
|
-
),
|
|
1383
|
-
(
|
|
1384
|
-
|
|
1449
|
+
[c, U, x]
|
|
1450
|
+
), Pt = e.useCallback(
|
|
1451
|
+
(t) => {
|
|
1452
|
+
xe({
|
|
1385
1453
|
...c,
|
|
1386
|
-
searchQuery:
|
|
1454
|
+
searchQuery: t.currentTarget.value
|
|
1387
1455
|
});
|
|
1388
1456
|
},
|
|
1389
1457
|
[c]
|
|
1390
|
-
),
|
|
1391
|
-
|
|
1458
|
+
), Le = e.useCallback(() => {
|
|
1459
|
+
nt(c), tt(void 0);
|
|
1392
1460
|
}, [c]);
|
|
1393
1461
|
e.useEffect(() => {
|
|
1394
|
-
if (!
|
|
1462
|
+
if (!p || !U || !De || !x)
|
|
1395
1463
|
return;
|
|
1396
|
-
const
|
|
1397
|
-
let
|
|
1398
|
-
for (const
|
|
1399
|
-
const i =
|
|
1400
|
-
if (typeof i == "string" && i !==
|
|
1401
|
-
|
|
1464
|
+
const t = Object.keys(U);
|
|
1465
|
+
let a = !1;
|
|
1466
|
+
for (const l of t) {
|
|
1467
|
+
const i = U[l], d = De[l];
|
|
1468
|
+
if (typeof i == "string" && i !== d) {
|
|
1469
|
+
a = !0;
|
|
1402
1470
|
break;
|
|
1403
1471
|
}
|
|
1404
|
-
if (typeof i == "object" && !
|
|
1405
|
-
|
|
1472
|
+
if (typeof i == "object" && !Xe(i, d)) {
|
|
1473
|
+
a = !0;
|
|
1406
1474
|
break;
|
|
1407
1475
|
}
|
|
1408
1476
|
}
|
|
1409
|
-
|
|
1477
|
+
a && Le();
|
|
1410
1478
|
}, [
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1479
|
+
p,
|
|
1480
|
+
U,
|
|
1481
|
+
De,
|
|
1482
|
+
Le,
|
|
1483
|
+
x
|
|
1416
1484
|
]);
|
|
1417
|
-
const
|
|
1418
|
-
(
|
|
1419
|
-
|
|
1485
|
+
const pt = e.useCallback(
|
|
1486
|
+
(t) => {
|
|
1487
|
+
t.key === "Enter" && (et(void 0), je && !x && Le(), ae && t.currentTarget.className === "mig-schema-table__search" && ae(c.searchQuery || ""));
|
|
1420
1488
|
},
|
|
1421
1489
|
[
|
|
1422
|
-
|
|
1490
|
+
je,
|
|
1423
1491
|
c.searchQuery,
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1492
|
+
ae,
|
|
1493
|
+
Le,
|
|
1494
|
+
x
|
|
1427
1495
|
]
|
|
1428
|
-
),
|
|
1429
|
-
() =>
|
|
1430
|
-
[
|
|
1431
|
-
),
|
|
1432
|
-
const
|
|
1433
|
-
let
|
|
1434
|
-
if (
|
|
1496
|
+
), it = e.useCallback(() => j, [j]), de = e.useMemo(() => fn(le), [le]), Be = e.useMemo(
|
|
1497
|
+
() => F ? F.length : 0,
|
|
1498
|
+
[F]
|
|
1499
|
+
), Ce = e.useMemo(() => {
|
|
1500
|
+
const t = j * Be;
|
|
1501
|
+
let a;
|
|
1502
|
+
if (J && (a = J === "100%" ? Pe.height : J, !a))
|
|
1435
1503
|
return 0;
|
|
1436
|
-
const
|
|
1437
|
-
return
|
|
1504
|
+
const l = a ? a - ft.height - Et : 0;
|
|
1505
|
+
return l && l < t ? l : t;
|
|
1438
1506
|
}, [
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
]),
|
|
1445
|
-
(
|
|
1446
|
-
|
|
1507
|
+
j,
|
|
1508
|
+
Be,
|
|
1509
|
+
J,
|
|
1510
|
+
ft,
|
|
1511
|
+
Pe.height
|
|
1512
|
+
]), Jt = e.useCallback(
|
|
1513
|
+
(t) => {
|
|
1514
|
+
et(void 0), t.preventDefault(), t.stopPropagation();
|
|
1447
1515
|
},
|
|
1448
1516
|
[]
|
|
1449
|
-
),
|
|
1450
|
-
(
|
|
1451
|
-
if (!
|
|
1517
|
+
), Gt = e.useCallback(
|
|
1518
|
+
(t, a) => {
|
|
1519
|
+
if (!X)
|
|
1452
1520
|
return;
|
|
1453
|
-
if (
|
|
1454
|
-
window.location.hash =
|
|
1455
|
-
...
|
|
1521
|
+
if (x && a !== !1) {
|
|
1522
|
+
window.location.hash = He({
|
|
1523
|
+
...U,
|
|
1456
1524
|
columnFilterMap: {
|
|
1457
1525
|
...c.columnFilterMap,
|
|
1458
|
-
[
|
|
1526
|
+
[X.propName]: t
|
|
1459
1527
|
}
|
|
1460
1528
|
});
|
|
1461
1529
|
return;
|
|
1462
1530
|
}
|
|
1463
|
-
if (
|
|
1464
|
-
|
|
1531
|
+
if (t === void 0) {
|
|
1532
|
+
bt(X.propName);
|
|
1465
1533
|
return;
|
|
1466
1534
|
}
|
|
1467
|
-
const
|
|
1535
|
+
const l = {
|
|
1468
1536
|
...c.columnFilterMap,
|
|
1469
|
-
[
|
|
1537
|
+
[X.propName]: t
|
|
1470
1538
|
};
|
|
1471
|
-
|
|
1539
|
+
xe({
|
|
1472
1540
|
...c,
|
|
1473
|
-
columnFilterMap:
|
|
1541
|
+
columnFilterMap: l
|
|
1474
1542
|
});
|
|
1475
1543
|
},
|
|
1476
1544
|
[
|
|
1477
|
-
|
|
1545
|
+
bt,
|
|
1478
1546
|
c,
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1547
|
+
U,
|
|
1548
|
+
X,
|
|
1549
|
+
x
|
|
1482
1550
|
]
|
|
1483
|
-
),
|
|
1484
|
-
const
|
|
1551
|
+
), Zt = e.useCallback(() => {
|
|
1552
|
+
const t = {
|
|
1485
1553
|
searchQuery: "",
|
|
1486
1554
|
columnFilterMap: {},
|
|
1487
1555
|
// Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
|
|
1488
|
-
sortColumn:
|
|
1489
|
-
sortAsc:
|
|
1556
|
+
sortColumn: N,
|
|
1557
|
+
sortAsc: L
|
|
1490
1558
|
};
|
|
1491
|
-
|
|
1492
|
-
}, [
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
(c.searchQuery ||
|
|
1496
|
-
...
|
|
1559
|
+
x && (window.location.hash = He(t)), nt(t), xe(t);
|
|
1560
|
+
}, [x, L, N]), qt = e.useCallback(() => {
|
|
1561
|
+
const t = U?.searchQuery || "";
|
|
1562
|
+
x && // prevent hash change for undefined vs empty string compare
|
|
1563
|
+
(c.searchQuery || t) && c.searchQuery !== t && (window.location.hash = He({
|
|
1564
|
+
...U,
|
|
1497
1565
|
searchQuery: c.searchQuery
|
|
1498
1566
|
}));
|
|
1499
|
-
}, [
|
|
1500
|
-
async (
|
|
1501
|
-
|
|
1567
|
+
}, [U, c.searchQuery, x]), Ht = e.useCallback(
|
|
1568
|
+
async (t) => {
|
|
1569
|
+
t.preventDefault(), t.stopPropagation(), F && await Ln(F);
|
|
1502
1570
|
},
|
|
1503
|
-
[
|
|
1504
|
-
),
|
|
1505
|
-
w && (localStorage.removeItem(`${w}.columnNames`), localStorage.removeItem(`${w}.columnWidths`),
|
|
1506
|
-
}, [w]),
|
|
1507
|
-
(
|
|
1508
|
-
if (!
|
|
1571
|
+
[F]
|
|
1572
|
+
), Xt = e.useCallback(() => {
|
|
1573
|
+
w && (localStorage.removeItem(`${w}.columnNames`), localStorage.removeItem(`${w}.columnWidths`), ze(void 0), Ae(void 0));
|
|
1574
|
+
}, [w]), lt = e.useCallback(
|
|
1575
|
+
(t) => {
|
|
1576
|
+
if (!F || !y || !v || !G)
|
|
1509
1577
|
return !0;
|
|
1510
|
-
const
|
|
1511
|
-
return
|
|
1578
|
+
const a = F[t];
|
|
1579
|
+
return a && y[a._index] !== void 0;
|
|
1512
1580
|
},
|
|
1513
|
-
[
|
|
1514
|
-
),
|
|
1581
|
+
[G, v, F, y]
|
|
1582
|
+
), Vt = e.useMemo(() => Ce ? !(y && !je) && !v ? /* @__PURE__ */ s(
|
|
1515
1583
|
"div",
|
|
1516
1584
|
{
|
|
1517
1585
|
style: {
|
|
1518
1586
|
width: de,
|
|
1519
|
-
height: Math.max(50,
|
|
1587
|
+
height: Math.max(50, Ce),
|
|
1520
1588
|
border: "1px solid #BBB",
|
|
1521
1589
|
textAlign: "center",
|
|
1522
1590
|
display: "flex",
|
|
@@ -1524,249 +1592,253 @@ const wn = ({
|
|
|
1524
1592
|
alignItems: "center",
|
|
1525
1593
|
justifyContent: "center"
|
|
1526
1594
|
},
|
|
1527
|
-
children:
|
|
1595
|
+
children: je ? /* @__PURE__ */ s("button", { onClick: Le, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ s("div", { children: "⌛ Loading..." })
|
|
1528
1596
|
}
|
|
1529
|
-
) :
|
|
1530
|
-
|
|
1597
|
+
) : v && G ? /* @__PURE__ */ s(
|
|
1598
|
+
gn,
|
|
1531
1599
|
{
|
|
1532
|
-
ref:
|
|
1533
|
-
isItemLoaded:
|
|
1534
|
-
itemCount:
|
|
1535
|
-
loadMoreItems:
|
|
1536
|
-
children: ({ onItemsRendered:
|
|
1537
|
-
|
|
1600
|
+
ref: b,
|
|
1601
|
+
isItemLoaded: lt,
|
|
1602
|
+
itemCount: G,
|
|
1603
|
+
loadMoreItems: v,
|
|
1604
|
+
children: ({ onItemsRendered: a, ref: l }) => /* @__PURE__ */ s(
|
|
1605
|
+
Ct,
|
|
1538
1606
|
{
|
|
1539
1607
|
className: "mig-schema-table__tbody",
|
|
1540
|
-
estimatedRowHeight:
|
|
1541
|
-
height:
|
|
1608
|
+
estimatedRowHeight: j,
|
|
1609
|
+
height: Ce,
|
|
1542
1610
|
width: de,
|
|
1543
|
-
columnWidth:
|
|
1544
|
-
rowHeight:
|
|
1545
|
-
columnCount:
|
|
1546
|
-
rowCount:
|
|
1547
|
-
ref:
|
|
1611
|
+
columnWidth: Ze,
|
|
1612
|
+
rowHeight: it,
|
|
1613
|
+
columnCount: Ee,
|
|
1614
|
+
rowCount: Be,
|
|
1615
|
+
ref: l,
|
|
1548
1616
|
onItemsRendered: ({
|
|
1549
1617
|
overscanRowStartIndex: i,
|
|
1550
|
-
overscanRowStopIndex:
|
|
1551
|
-
visibleRowStartIndex:
|
|
1552
|
-
visibleRowStopIndex:
|
|
1553
|
-
}) =>
|
|
1618
|
+
overscanRowStopIndex: d,
|
|
1619
|
+
visibleRowStartIndex: k,
|
|
1620
|
+
visibleRowStopIndex: m
|
|
1621
|
+
}) => a({
|
|
1554
1622
|
overscanStartIndex: i,
|
|
1555
|
-
overscanStopIndex:
|
|
1556
|
-
visibleStartIndex:
|
|
1557
|
-
visibleStopIndex:
|
|
1623
|
+
overscanStopIndex: d,
|
|
1624
|
+
visibleStartIndex: k,
|
|
1625
|
+
visibleStopIndex: m
|
|
1558
1626
|
}),
|
|
1559
|
-
children:
|
|
1627
|
+
children: Nt
|
|
1560
1628
|
},
|
|
1561
|
-
`tbody_${
|
|
1629
|
+
`tbody_${Ce}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${Ee}_${le.join(
|
|
1562
1630
|
" "
|
|
1563
1631
|
)}`
|
|
1564
1632
|
)
|
|
1565
1633
|
}
|
|
1566
|
-
) : /* @__PURE__ */
|
|
1567
|
-
|
|
1634
|
+
) : /* @__PURE__ */ s(
|
|
1635
|
+
Ct,
|
|
1568
1636
|
{
|
|
1569
1637
|
className: "mig-schema-table__tbody",
|
|
1570
|
-
estimatedRowHeight:
|
|
1571
|
-
height:
|
|
1638
|
+
estimatedRowHeight: j,
|
|
1639
|
+
height: Ce,
|
|
1572
1640
|
width: de,
|
|
1573
|
-
columnWidth:
|
|
1574
|
-
rowHeight:
|
|
1575
|
-
columnCount:
|
|
1576
|
-
rowCount:
|
|
1577
|
-
ref:
|
|
1578
|
-
children:
|
|
1641
|
+
columnWidth: Ze,
|
|
1642
|
+
rowHeight: it,
|
|
1643
|
+
columnCount: Ee,
|
|
1644
|
+
rowCount: Be,
|
|
1645
|
+
ref: Ue,
|
|
1646
|
+
children: Nt
|
|
1579
1647
|
},
|
|
1580
|
-
`tbody_${
|
|
1648
|
+
`tbody_${Ce}_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${Ee}_${le.join(
|
|
1581
1649
|
" "
|
|
1582
1650
|
)}`
|
|
1583
1651
|
) : null, [
|
|
1584
|
-
|
|
1652
|
+
Ee,
|
|
1585
1653
|
le,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1654
|
+
Ze,
|
|
1655
|
+
it,
|
|
1656
|
+
b,
|
|
1657
|
+
je,
|
|
1658
|
+
lt,
|
|
1659
|
+
G,
|
|
1660
|
+
v,
|
|
1661
|
+
Le,
|
|
1662
|
+
Be,
|
|
1663
|
+
j,
|
|
1596
1664
|
de,
|
|
1597
1665
|
c.searchQuery,
|
|
1598
1666
|
c.sortAsc,
|
|
1599
1667
|
c.sortColumn,
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
]),
|
|
1668
|
+
y,
|
|
1669
|
+
Ce,
|
|
1670
|
+
Ue
|
|
1671
|
+
]), Yt = e.useMemo(
|
|
1604
1672
|
() => ({
|
|
1605
|
-
...
|
|
1606
|
-
width:
|
|
1607
|
-
height:
|
|
1608
|
-
maxHeight:
|
|
1673
|
+
...T,
|
|
1674
|
+
width: Q ? Math.min(de, We) : void 0,
|
|
1675
|
+
height: J === "100%" ? "100%" : void 0,
|
|
1676
|
+
maxHeight: J === "100%" ? "100%" : void 0
|
|
1609
1677
|
}),
|
|
1610
|
-
[
|
|
1611
|
-
),
|
|
1612
|
-
return /* @__PURE__ */
|
|
1613
|
-
|
|
1678
|
+
[J, de, T, We, Q]
|
|
1679
|
+
), Kt = o || "input";
|
|
1680
|
+
return /* @__PURE__ */ s(
|
|
1681
|
+
Ie.Provider,
|
|
1614
1682
|
{
|
|
1615
1683
|
value: {
|
|
1616
|
-
checkedIndexes:
|
|
1684
|
+
checkedIndexes: _,
|
|
1617
1685
|
columnNames: K,
|
|
1618
1686
|
columnWidths: le,
|
|
1619
1687
|
config: f,
|
|
1620
|
-
disabledCheckedIndexes:
|
|
1621
|
-
displayTimezone:
|
|
1622
|
-
dropTargetIndex:
|
|
1623
|
-
getRowClassName:
|
|
1688
|
+
disabledCheckedIndexes: $,
|
|
1689
|
+
displayTimezone: M,
|
|
1690
|
+
dropTargetIndex: z,
|
|
1691
|
+
getRowClassName: Y,
|
|
1624
1692
|
getRowSelected: te,
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1693
|
+
isDraggable: u,
|
|
1694
|
+
isColumnFilterable: r,
|
|
1695
|
+
isItemLoaded: lt,
|
|
1696
|
+
isSortable: ce,
|
|
1697
|
+
lastCheckChangedRowIndex: Ft,
|
|
1698
|
+
onRowClick: ne,
|
|
1699
|
+
onRowDoubleClick: re,
|
|
1700
|
+
onRowDrop: Ut,
|
|
1631
1701
|
properties: ie,
|
|
1632
|
-
required:
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1702
|
+
required: zt,
|
|
1703
|
+
rowDropTargetRowIndex: ye,
|
|
1704
|
+
setCheckedIndexes: se,
|
|
1705
|
+
setCustomColumnNames: ze,
|
|
1706
|
+
setCustomColumnWidths: Ae,
|
|
1707
|
+
setDropTargetIndex: fe,
|
|
1708
|
+
setFilterSortColumn: at,
|
|
1709
|
+
setLastCheckChangedRowIndex: Bt,
|
|
1710
|
+
setMenuConfig: et,
|
|
1711
|
+
setRowDropTargetRowIndex: ke,
|
|
1640
1712
|
settingsStorageKey: w,
|
|
1641
|
-
sortedRenderData:
|
|
1642
|
-
sourceData:
|
|
1713
|
+
sortedRenderData: F,
|
|
1714
|
+
sourceData: y,
|
|
1643
1715
|
tableDataState: c,
|
|
1644
|
-
translate:
|
|
1716
|
+
translate: A || Tt
|
|
1645
1717
|
},
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1718
|
+
children: /* @__PURE__ */ B(
|
|
1647
1719
|
"div",
|
|
1648
1720
|
{
|
|
1649
|
-
className: `mig-schema-table${
|
|
1650
|
-
ref:
|
|
1651
|
-
style:
|
|
1721
|
+
className: `mig-schema-table${ne ? " mig-schema-table--clickable-rows" : ""}`,
|
|
1722
|
+
ref: mt,
|
|
1723
|
+
style: Yt,
|
|
1652
1724
|
role: "table",
|
|
1653
1725
|
children: [
|
|
1654
|
-
/* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ B(
|
|
1655
1727
|
"div",
|
|
1656
1728
|
{
|
|
1657
1729
|
className: "mig-schema-table__action-container",
|
|
1658
|
-
ref:
|
|
1730
|
+
ref: ht,
|
|
1659
1731
|
children: [
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
|
|
1732
|
+
/* @__PURE__ */ s("div", { children: W ? /* @__PURE__ */ s(
|
|
1733
|
+
Kt,
|
|
1662
1734
|
{
|
|
1663
1735
|
className: "mig-schema-table__search",
|
|
1664
1736
|
type: "search",
|
|
1665
1737
|
name: "search",
|
|
1666
1738
|
autoComplete: "off",
|
|
1667
|
-
placeholder:
|
|
1739
|
+
placeholder: ve || A("search..."),
|
|
1668
1740
|
value: c.searchQuery,
|
|
1669
|
-
onChange:
|
|
1670
|
-
onKeyDown:
|
|
1671
|
-
autoFocus:
|
|
1672
|
-
onBlur:
|
|
1741
|
+
onChange: Pt,
|
|
1742
|
+
onKeyDown: pt,
|
|
1743
|
+
autoFocus: D,
|
|
1744
|
+
onBlur: qt
|
|
1673
1745
|
}
|
|
1674
1746
|
) : null }),
|
|
1675
|
-
|
|
1676
|
-
|
|
1747
|
+
n ? /* @__PURE__ */ s(
|
|
1748
|
+
n,
|
|
1677
1749
|
{
|
|
1678
|
-
...
|
|
1679
|
-
renderData:
|
|
1750
|
+
...E,
|
|
1751
|
+
renderData: ot
|
|
1680
1752
|
}
|
|
1681
|
-
) : /* @__PURE__ */
|
|
1682
|
-
I && Array.isArray(
|
|
1753
|
+
) : /* @__PURE__ */ s("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1754
|
+
I && Array.isArray(C) ? /* @__PURE__ */ s("span", { className: "mig-schema-table__row_counter", children: A(
|
|
1683
1755
|
"showingFilteredCountOfTotalCount",
|
|
1684
|
-
|
|
1685
|
-
|
|
1756
|
+
F?.length || 0,
|
|
1757
|
+
C.length
|
|
1686
1758
|
) }) : null,
|
|
1687
|
-
|
|
1759
|
+
g ? /* @__PURE__ */ s(
|
|
1688
1760
|
"button",
|
|
1689
1761
|
{
|
|
1690
|
-
onClick:
|
|
1762
|
+
onClick: Ht,
|
|
1691
1763
|
style: { marginLeft: 8 },
|
|
1692
|
-
disabled: !
|
|
1693
|
-
children:
|
|
1764
|
+
disabled: !F?.length,
|
|
1765
|
+
children: A("exportData")
|
|
1694
1766
|
}
|
|
1695
1767
|
) : null,
|
|
1696
|
-
|
|
1768
|
+
W || r ? /* @__PURE__ */ s(
|
|
1697
1769
|
"button",
|
|
1698
1770
|
{
|
|
1699
|
-
onClick:
|
|
1771
|
+
onClick: Zt,
|
|
1700
1772
|
style: { marginLeft: 8 },
|
|
1701
1773
|
disabled: c.columnFilterMap && c.searchQuery ? Object.keys(c.columnFilterMap).length + c.searchQuery.length === 0 : !1,
|
|
1702
|
-
children:
|
|
1774
|
+
children: A("clearFilters")
|
|
1703
1775
|
}
|
|
1704
1776
|
) : null,
|
|
1705
|
-
w ? /* @__PURE__ */
|
|
1777
|
+
w ? /* @__PURE__ */ s(
|
|
1706
1778
|
"button",
|
|
1707
1779
|
{
|
|
1708
|
-
onClick:
|
|
1780
|
+
onClick: Xt,
|
|
1709
1781
|
style: { marginLeft: 8 },
|
|
1710
|
-
disabled: !
|
|
1711
|
-
children:
|
|
1782
|
+
disabled: !Je && !Ge,
|
|
1783
|
+
children: A("clearSettings")
|
|
1712
1784
|
}
|
|
1713
1785
|
) : null
|
|
1714
1786
|
]
|
|
1715
1787
|
}
|
|
1716
1788
|
),
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ B("div", { className: "mig-schema-table__column_resize_container", children: [
|
|
1790
|
+
/* @__PURE__ */ s(
|
|
1719
1791
|
h,
|
|
1720
1792
|
{
|
|
1721
|
-
height:
|
|
1722
|
-
itemCount:
|
|
1723
|
-
itemSize:
|
|
1793
|
+
height: Et,
|
|
1794
|
+
itemCount: Ee,
|
|
1795
|
+
itemSize: Ze,
|
|
1724
1796
|
layout: "horizontal",
|
|
1725
1797
|
width: de,
|
|
1726
1798
|
sortAsc: c.sortAsc,
|
|
1727
|
-
setFilterSortColumn:
|
|
1799
|
+
setFilterSortColumn: at,
|
|
1728
1800
|
sortColumn: c.sortColumn,
|
|
1729
|
-
sortedRenderData:
|
|
1801
|
+
sortedRenderData: F,
|
|
1730
1802
|
className: "mig-schema-table__th-row",
|
|
1731
|
-
children:
|
|
1803
|
+
children: kn
|
|
1732
1804
|
},
|
|
1733
1805
|
`thead_${de}_${c.sortColumn}_${c.sortAsc}_${c.searchQuery}_${le.join(
|
|
1734
1806
|
" "
|
|
1735
1807
|
)}`
|
|
1736
1808
|
),
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1809
|
+
Vt,
|
|
1810
|
+
oe ? /* @__PURE__ */ s(
|
|
1811
|
+
An,
|
|
1740
1812
|
{
|
|
1741
1813
|
columnWidths: le,
|
|
1742
|
-
resizeColumnIndex:
|
|
1743
|
-
setResizeColumnIndex:
|
|
1744
|
-
tableBodyHeight:
|
|
1814
|
+
resizeColumnIndex: Ke,
|
|
1815
|
+
setResizeColumnIndex: $e,
|
|
1816
|
+
tableBodyHeight: Ce
|
|
1745
1817
|
}
|
|
1746
1818
|
) : null
|
|
1747
1819
|
] }),
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
|
|
1820
|
+
y && y.length === 0 ? /* @__PURE__ */ s("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
|
|
1821
|
+
X ? nn(
|
|
1822
|
+
/* @__PURE__ */ s(
|
|
1823
|
+
Mn,
|
|
1752
1824
|
{
|
|
1753
|
-
isFilterable:
|
|
1754
|
-
isSortable:
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1825
|
+
isFilterable: r && X.propConfig?.isFilterable !== !1,
|
|
1826
|
+
isSortable: Wt(
|
|
1827
|
+
ce,
|
|
1828
|
+
he.properties[X.propName],
|
|
1829
|
+
X.propConfig
|
|
1758
1830
|
),
|
|
1759
|
-
onChange:
|
|
1760
|
-
onClose:
|
|
1761
|
-
onInputKeyDown:
|
|
1762
|
-
propConfig:
|
|
1763
|
-
propIsRequired:
|
|
1764
|
-
propName:
|
|
1765
|
-
propSchema:
|
|
1766
|
-
referenceElement:
|
|
1767
|
-
setFilterSortColumn:
|
|
1768
|
-
translate:
|
|
1769
|
-
value: c.columnFilterMap ? c.columnFilterMap[
|
|
1831
|
+
onChange: Gt,
|
|
1832
|
+
onClose: Jt,
|
|
1833
|
+
onInputKeyDown: pt,
|
|
1834
|
+
propConfig: X.propConfig,
|
|
1835
|
+
propIsRequired: X.propIsRequired,
|
|
1836
|
+
propName: X.propName,
|
|
1837
|
+
propSchema: he.properties[X.propName],
|
|
1838
|
+
referenceElement: X.referenceElement,
|
|
1839
|
+
setFilterSortColumn: at,
|
|
1840
|
+
translate: A,
|
|
1841
|
+
value: c.columnFilterMap ? c.columnFilterMap[X.propName] : null
|
|
1770
1842
|
}
|
|
1771
1843
|
),
|
|
1772
1844
|
document.body
|
|
@@ -1776,43 +1848,43 @@ const wn = ({
|
|
|
1776
1848
|
)
|
|
1777
1849
|
}
|
|
1778
1850
|
);
|
|
1779
|
-
},
|
|
1780
|
-
const [h,
|
|
1781
|
-
f(/* @__PURE__ */ new Date()),
|
|
1782
|
-
}, [
|
|
1783
|
-
() =>
|
|
1784
|
-
[h,
|
|
1851
|
+
}, $n = e.forwardRef(Rn), Vn = e.memo($n), Yn = e.memo(({ refresh: n, period: o = 60 }) => {
|
|
1852
|
+
const [h, p] = e.useState(/* @__PURE__ */ new Date()), [_, f] = e.useState(/* @__PURE__ */ new Date()), E = e.useCallback(() => {
|
|
1853
|
+
f(/* @__PURE__ */ new Date()), n();
|
|
1854
|
+
}, [n]), C = e.useMemo(
|
|
1855
|
+
() => an(h, _),
|
|
1856
|
+
[h, _]
|
|
1785
1857
|
);
|
|
1786
1858
|
e.useEffect(() => {
|
|
1787
|
-
|
|
1788
|
-
}, [
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1859
|
+
C > o && E();
|
|
1860
|
+
}, [C, h, _, o, E]), e.useEffect(() => {
|
|
1861
|
+
const N = setInterval(() => {
|
|
1862
|
+
p(/* @__PURE__ */ new Date());
|
|
1791
1863
|
}, 1e3);
|
|
1792
1864
|
return () => {
|
|
1793
|
-
clearInterval(
|
|
1865
|
+
clearInterval(N);
|
|
1794
1866
|
};
|
|
1795
1867
|
}, []);
|
|
1796
|
-
const
|
|
1797
|
-
return /* @__PURE__ */
|
|
1868
|
+
const O = o - C;
|
|
1869
|
+
return /* @__PURE__ */ B(
|
|
1798
1870
|
"div",
|
|
1799
1871
|
{
|
|
1800
1872
|
className: "mx-auto",
|
|
1801
|
-
title: `Refresh ${
|
|
1873
|
+
title: `Refresh ${O > 0 ? `in ${O} seconds` : "NOW"}`,
|
|
1802
1874
|
children: [
|
|
1803
1875
|
"Last update ",
|
|
1804
|
-
|
|
1876
|
+
ut(_, "HH:mm")
|
|
1805
1877
|
]
|
|
1806
1878
|
}
|
|
1807
1879
|
);
|
|
1808
1880
|
});
|
|
1809
1881
|
export {
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1882
|
+
$t as DEFAULT_DATE_FORMAT,
|
|
1883
|
+
Ye as DEFAULT_DATE_TIME_FORMAT,
|
|
1884
|
+
Qe as EColumnFilterStatus,
|
|
1885
|
+
Ot as MINIMUM_COLUMN_WIDTH,
|
|
1886
|
+
_n as RESIZER_WIDTH,
|
|
1887
|
+
Yn as Refresher,
|
|
1888
|
+
Vn as SchemaTable,
|
|
1889
|
+
kn as Th
|
|
1818
1890
|
};
|