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