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