mig-schema-table 5.0.5 → 5.0.7
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 +753 -719
- 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((p, f) => {
|
|
29
|
+
u = u.replace(`{${f}}`, `${p}`);
|
|
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
|
-
columnNames:
|
|
62
|
-
config:
|
|
63
|
-
disabledCheckedIndexes:
|
|
61
|
+
checkedIndexes: p,
|
|
62
|
+
columnNames: f,
|
|
63
|
+
config: l,
|
|
64
|
+
disabledCheckedIndexes: $,
|
|
64
65
|
displayTimezone: _,
|
|
65
|
-
getRowClassName:
|
|
66
|
+
getRowClassName: O,
|
|
66
67
|
getRowSelected: W,
|
|
67
68
|
isItemLoaded: T,
|
|
68
|
-
lastCheckChangedRowIndex:
|
|
69
|
+
lastCheckChangedRowIndex: I,
|
|
69
70
|
onRowClick: M,
|
|
70
|
-
onRowDoubleClick:
|
|
71
|
-
properties:
|
|
71
|
+
onRowDoubleClick: y,
|
|
72
|
+
properties: S,
|
|
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), b = f[n], w = b === K ? tn : S[b], U = l ? l[b] : 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 = b === K ? void 0 : L[b];
|
|
109
|
+
if (w?.format && w.format === "date-time" && se !== !1) {
|
|
110
|
+
const k = s ? s[L._index] : void 0, E = k ? k[b] : 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-${b}`
|
|
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 && O && A.push(
|
|
123
|
+
O(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: b === K ? void 0 : ne,
|
|
142
|
+
onDoubleClick: b === K ? void 0 : C
|
|
142
143
|
};
|
|
143
144
|
}, [
|
|
144
145
|
L,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
D,
|
|
147
|
+
b,
|
|
148
|
+
w,
|
|
149
|
+
se,
|
|
149
150
|
o,
|
|
150
151
|
s,
|
|
151
152
|
W,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
O,
|
|
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 && I !== void 0) {
|
|
167
|
+
const k = p?.includes(I) ? I : 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
|
+
(!$ || !$.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
|
+
p,
|
|
184
|
+
$,
|
|
185
|
+
I,
|
|
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 (b === 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: p?.includes(L._index),
|
|
205
|
+
disabled: $?.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[b];
|
|
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
|
-
(
|
|
233
|
+
const p = [...u || []].filter(
|
|
234
|
+
(f) => (n ? n.includes(f._index) : !0) || (o ? !o.includes(f._index) : !0)
|
|
234
235
|
);
|
|
235
|
-
return
|
|
236
|
-
}, [
|
|
236
|
+
return n?.length !== 0 && p.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:
|
|
257
|
-
columnWidths:
|
|
258
|
-
config:
|
|
259
|
-
disabledCheckedIndexes:
|
|
256
|
+
checkedIndexes: u,
|
|
257
|
+
columnNames: p,
|
|
258
|
+
columnWidths: f,
|
|
259
|
+
config: l,
|
|
260
|
+
disabledCheckedIndexes: $,
|
|
260
261
|
dropTargetIndex: _,
|
|
261
|
-
isColumnFilterable:
|
|
262
|
+
isColumnFilterable: O,
|
|
262
263
|
isSortable: W,
|
|
263
264
|
setCheckedIndexes: T,
|
|
264
|
-
properties:
|
|
265
|
+
properties: I,
|
|
265
266
|
required: M,
|
|
266
|
-
setCustomColumnNames:
|
|
267
|
-
setDropTargetIndex:
|
|
267
|
+
setCustomColumnNames: y,
|
|
268
|
+
setDropTargetIndex: S,
|
|
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: b,
|
|
275
|
+
displayTimezone: w
|
|
276
|
+
} = e.useContext(Me), [U, te] = e.useState(!1), le = n === _, ne = Dt(), C = p[n], L = C === K ? { type: "boolean" } : I[C], se = s.sortColumn === C ? s.sortAsc : void 0, G = l ? l[C] : void 0;
|
|
277
|
+
let re = O && (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 ? `${b(C)} (${b(w || Te)})` : b(C), [k, _e, A, b, C, w]), oe = e.useCallback(
|
|
324
325
|
(j, he) => {
|
|
325
|
-
if (!
|
|
326
|
+
if (!p || !f)
|
|
326
327
|
return;
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
`${
|
|
334
|
-
JSON.stringify(
|
|
328
|
+
const we = p.indexOf(j), J = [...p];
|
|
329
|
+
J.splice(we, 1);
|
|
330
|
+
const x = J.indexOf(he);
|
|
331
|
+
J.splice(x + 1, 0, j), y(J);
|
|
332
|
+
const ge = [...f], 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
|
-
b,
|
|
339
339
|
p,
|
|
340
|
+
f,
|
|
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), S(-1));
|
|
352
|
+
}, [oe, S]), Ve = e.useCallback(
|
|
352
353
|
(j) => {
|
|
353
|
-
|
|
354
|
+
oe && (j.preventDefault(), S(n));
|
|
354
355
|
},
|
|
355
|
-
[
|
|
356
|
-
),
|
|
356
|
+
[n, oe, S]
|
|
357
|
+
), Pe = e.useCallback(
|
|
357
358
|
(j) => {
|
|
358
|
-
if (
|
|
359
|
+
if (S(-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, S]
|
|
365
|
+
), Le = rn(), Ze = e.useCallback(() => {
|
|
366
|
+
!T || !m || T(
|
|
367
|
+
Le ? [] : m.map((j) => j._index).filter((j) => !$?.includes(j))
|
|
367
368
|
);
|
|
368
369
|
}, [
|
|
369
370
|
T,
|
|
370
|
-
|
|
371
|
+
m,
|
|
371
372
|
Le,
|
|
372
|
-
|
|
373
|
+
$
|
|
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:
|
|
471
|
-
propName:
|
|
472
|
-
propSchema:
|
|
473
|
-
translate:
|
|
470
|
+
onInputKeyDown: u,
|
|
471
|
+
propIsRequired: p,
|
|
472
|
+
propName: f,
|
|
473
|
+
propSchema: l,
|
|
474
|
+
translate: $
|
|
474
475
|
}) => {
|
|
475
|
-
const { displayTimezone: _ } = e.useContext(Me), { type:
|
|
476
|
-
switch (
|
|
476
|
+
const { displayTimezone: _ } = e.useContext(Me), { type: O, format: W, minimum: T, maximum: I } = l || {}, M = n, y = W === "date-time";
|
|
477
|
+
switch (O) {
|
|
477
478
|
case "number":
|
|
478
479
|
case "integer":
|
|
479
|
-
const
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
[s]:
|
|
483
|
-
}, U = Object.values(
|
|
480
|
+
const S = M || {}, q = (s, m, b) => {
|
|
481
|
+
const w = {
|
|
482
|
+
...S,
|
|
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
|
+
b
|
|
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
|
+
p ? 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: !!S.filterEmpty,
|
|
500
501
|
onChange: () => {
|
|
501
|
-
const { filterEmpty: s, ...
|
|
502
|
-
s || (
|
|
503
|
-
Object.keys(
|
|
502
|
+
const { filterEmpty: s, ...m } = S;
|
|
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 = S[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
|
-
"data-prop-name":
|
|
525
|
-
onChange: (
|
|
524
|
+
value: m !== void 0 ? m : "",
|
|
525
|
+
"data-prop-name": f,
|
|
526
|
+
onChange: (b) => {
|
|
526
527
|
q(
|
|
527
528
|
s,
|
|
528
|
-
|
|
529
|
+
b.currentTarget,
|
|
529
530
|
!1
|
|
530
531
|
);
|
|
531
532
|
},
|
|
532
|
-
onBlur: (
|
|
533
|
+
onBlur: (b) => {
|
|
533
534
|
q(
|
|
534
535
|
s,
|
|
535
|
-
|
|
536
|
+
b.currentTarget,
|
|
536
537
|
!0
|
|
537
538
|
);
|
|
538
539
|
},
|
|
539
|
-
onKeyDown:
|
|
540
|
+
onKeyDown: u,
|
|
540
541
|
min: T,
|
|
541
|
-
max:
|
|
542
|
+
max: I
|
|
542
543
|
}
|
|
543
544
|
)
|
|
544
545
|
] }, s);
|
|
@@ -546,15 +547,15 @@ const nn = ({ index: r, style: o }) => {
|
|
|
546
547
|
] });
|
|
547
548
|
case "boolean":
|
|
548
549
|
const ee = ["✓", "✕"];
|
|
549
|
-
|
|
550
|
-
let
|
|
551
|
-
return M === null && (
|
|
550
|
+
p || 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
|
-
"data-prop-name":
|
|
557
|
+
value: D,
|
|
558
|
+
"data-prop-name": f,
|
|
558
559
|
onChange: (s) => {
|
|
559
560
|
switch (s.currentTarget.value) {
|
|
560
561
|
case "✓":
|
|
@@ -585,48 +586,48 @@ 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,
|
|
593
594
|
className: "form-select",
|
|
594
595
|
value: M,
|
|
595
|
-
"data-prop-name":
|
|
596
|
+
"data-prop-name": f,
|
|
596
597
|
onChange: (s) => {
|
|
597
598
|
o(s.currentTarget.value || void 0, !0);
|
|
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: $(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
|
+
p ? 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: b, ...w } = m;
|
|
629
|
+
b || (w.filterEmpty = !0), o(
|
|
630
|
+
Object.keys(w).length ? w : void 0,
|
|
630
631
|
!0
|
|
631
632
|
);
|
|
632
633
|
}
|
|
@@ -636,29 +637,29 @@ 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,
|
|
643
644
|
{
|
|
644
645
|
dateFormat: s,
|
|
645
|
-
"data-prop-name":
|
|
646
|
+
"data-prop-name": f,
|
|
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: (b) => {
|
|
652
|
+
if (!b && !m.to) {
|
|
652
653
|
o(void 0, !0);
|
|
653
654
|
return;
|
|
654
655
|
}
|
|
655
|
-
if (
|
|
656
|
+
if (m.to && b && b > m.to)
|
|
656
657
|
return;
|
|
657
|
-
const
|
|
658
|
+
const w = b ? Ue.tz(_ || Te, b) : void 0;
|
|
658
659
|
o(
|
|
659
660
|
{
|
|
660
|
-
...
|
|
661
|
-
from:
|
|
661
|
+
...n,
|
|
662
|
+
from: w
|
|
662
663
|
},
|
|
663
664
|
!0
|
|
664
665
|
);
|
|
@@ -666,52 +667,52 @@ 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,
|
|
682
683
|
{
|
|
683
684
|
id: "filter-date",
|
|
684
685
|
dateFormat: s,
|
|
685
|
-
"data-prop-name":
|
|
686
|
+
"data-prop-name": f,
|
|
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: (b) => {
|
|
695
|
+
if (!b && !m.from) {
|
|
695
696
|
o(void 0, !0);
|
|
696
697
|
return;
|
|
697
698
|
}
|
|
698
|
-
const
|
|
699
|
-
|
|
699
|
+
const w = b ? y ? Ue.tz(_ || Te, b) : zt(b) : 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
|
] })
|
|
@@ -725,14 +726,14 @@ const nn = ({ index: r, style: o }) => {
|
|
|
725
726
|
autoFocus: !0,
|
|
726
727
|
type: "search",
|
|
727
728
|
className: "form-control",
|
|
728
|
-
placeholder: `Search ${
|
|
729
|
-
"aria-label": `Search ${
|
|
729
|
+
placeholder: `Search ${f}`,
|
|
730
|
+
"aria-label": `Search ${f}`,
|
|
730
731
|
value: M || "",
|
|
731
|
-
"data-prop-name":
|
|
732
|
+
"data-prop-name": f,
|
|
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:
|
|
748
|
-
onInputKeyDown:
|
|
749
|
-
propConfig:
|
|
750
|
-
propIsRequired:
|
|
747
|
+
onChange: u,
|
|
748
|
+
onClose: p,
|
|
749
|
+
onInputKeyDown: f,
|
|
750
|
+
propConfig: l,
|
|
751
|
+
propIsRequired: $,
|
|
751
752
|
propName: _,
|
|
752
|
-
propSchema:
|
|
753
|
+
propSchema: O,
|
|
753
754
|
referenceElement: W,
|
|
754
755
|
setFilterSortColumn: T,
|
|
755
|
-
translate:
|
|
756
|
+
translate: I,
|
|
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
|
+
}), S = mt({
|
|
765
766
|
placement: "right-start",
|
|
766
767
|
middleware: [ht()]
|
|
767
768
|
});
|
|
768
769
|
e.useEffect(() => {
|
|
769
|
-
const
|
|
770
|
-
if (!
|
|
770
|
+
const m = (b) => {
|
|
771
|
+
if (!y.elements.floating)
|
|
771
772
|
return;
|
|
772
|
-
let
|
|
773
|
-
for (;
|
|
774
|
-
if (
|
|
773
|
+
let w = b.target;
|
|
774
|
+
for (; w && y.elements.floating; ) {
|
|
775
|
+
if (w === y.elements.floating || w === S.elements.floating)
|
|
775
776
|
return;
|
|
776
|
-
|
|
777
|
+
w = w.parentNode === window.document ? null : w.parentNode;
|
|
777
778
|
}
|
|
778
|
-
b
|
|
779
|
+
p(b);
|
|
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
|
+
p,
|
|
787
|
+
S.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), p(m);
|
|
791
792
|
},
|
|
792
|
-
[
|
|
793
|
-
),
|
|
794
|
-
(
|
|
795
|
-
T(_, !1),
|
|
793
|
+
[p, _, T]
|
|
794
|
+
), D = e.useCallback(
|
|
795
|
+
(m) => {
|
|
796
|
+
T(_, !1), p(m);
|
|
796
797
|
},
|
|
797
|
-
[
|
|
798
|
+
[p, _, 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
|
+
I("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
|
+
I("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
|
+
S.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: I("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
|
+
S.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: S.refs.setFloating,
|
|
851
|
+
style: S.floatingStyles,
|
|
851
852
|
children: /* @__PURE__ */ t(
|
|
852
853
|
q,
|
|
853
854
|
{
|
|
854
855
|
columnFilterValue: M,
|
|
855
|
-
onChange:
|
|
856
|
-
onInputKeyDown:
|
|
857
|
-
propIsRequired:
|
|
856
|
+
onChange: u,
|
|
857
|
+
onInputKeyDown: f,
|
|
858
|
+
propIsRequired: $,
|
|
858
859
|
propName: _,
|
|
859
|
-
propSchema:
|
|
860
|
-
translate:
|
|
860
|
+
propSchema: O,
|
|
861
|
+
translate: I
|
|
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: p
|
|
871
872
|
}) => {
|
|
872
|
-
const [
|
|
873
|
-
(
|
|
874
|
-
const M =
|
|
875
|
-
(
|
|
873
|
+
const [f, l] = e.useState(0), $ = Dt(), _ = e.useCallback(
|
|
874
|
+
(I) => {
|
|
875
|
+
const M = n.map(
|
|
876
|
+
(y, S) => S === o ? Math.max(y + I, kt) : y
|
|
876
877
|
);
|
|
877
|
-
|
|
878
|
+
$(M);
|
|
878
879
|
},
|
|
879
|
-
[
|
|
880
|
+
[n, o, $]
|
|
880
881
|
);
|
|
881
|
-
let
|
|
882
|
+
let O = 0;
|
|
882
883
|
const W = e.useCallback(
|
|
883
|
-
(
|
|
884
|
-
|
|
884
|
+
(I) => {
|
|
885
|
+
u(parseInt(I.currentTarget.dataset.columnIndex)), l(I.clientX);
|
|
885
886
|
},
|
|
886
|
-
[
|
|
887
|
+
[u]
|
|
887
888
|
), T = e.useCallback(
|
|
888
|
-
(
|
|
889
|
-
_(
|
|
889
|
+
(I) => {
|
|
890
|
+
_(I.clientX - f), l(0), u(-1);
|
|
890
891
|
},
|
|
891
|
-
[
|
|
892
|
+
[f, _, u]
|
|
892
893
|
);
|
|
893
|
-
return /* @__PURE__ */ t("div", { children: [...
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
return M === o &&
|
|
894
|
+
return /* @__PURE__ */ t("div", { children: [...n].map((I, M) => {
|
|
895
|
+
O += I;
|
|
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: O - en, bottom: p },
|
|
901
|
+
className: y.join(" "),
|
|
901
902
|
draggable: "true",
|
|
902
903
|
"data-column-index": M,
|
|
903
904
|
onDragStart: W,
|
|
@@ -906,519 +907,552 @@ 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 }), p = 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
|
|
918
|
-
for (const
|
|
919
|
-
const { blockSize: _, inlineSize:
|
|
920
|
-
|
|
918
|
+
const f = new ResizeObserver((l) => {
|
|
919
|
+
for (const $ of l) {
|
|
920
|
+
const { blockSize: _, inlineSize: O } = $.borderBoxSize[0];
|
|
921
|
+
O && _ && p({ width: O, height: _ });
|
|
921
922
|
}
|
|
922
923
|
});
|
|
923
|
-
return
|
|
924
|
-
|
|
924
|
+
return f.observe(n), () => {
|
|
925
|
+
f.disconnect();
|
|
925
926
|
};
|
|
926
|
-
}, [
|
|
927
|
-
},
|
|
927
|
+
}, [p, 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 { Workbook: o } = await mn(), u = new o(), p = u.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((f) => {
|
|
948
|
+
const { _index: l, SELECT_ALL_COLUMN_NAME: $, ..._ } = f;
|
|
949
|
+
return Object.values(_);
|
|
950
|
+
})
|
|
951
|
+
), u.xlsx.writeBuffer().then((f) => {
|
|
952
|
+
const l = new Blob([f], {
|
|
953
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
954
|
+
});
|
|
955
|
+
Yt(l, "export.xlsx");
|
|
956
|
+
}).catch((f) => {
|
|
957
|
+
console.error("Error generating Excel file:", f);
|
|
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: p } = o || {};
|
|
965
|
+
if (p !== void 0)
|
|
966
|
+
return p;
|
|
967
|
+
if (!n)
|
|
936
968
|
return !1;
|
|
937
|
-
const { format:
|
|
938
|
-
return
|
|
969
|
+
const { format: f, type: l } = n;
|
|
970
|
+
return f?.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:
|
|
945
|
-
checkedIndexes:
|
|
946
|
-
config:
|
|
947
|
-
customElementProps:
|
|
975
|
+
Heading: u = Bt,
|
|
976
|
+
autoRender: p,
|
|
977
|
+
checkedIndexes: f,
|
|
978
|
+
config: l,
|
|
979
|
+
customElementProps: $,
|
|
948
980
|
data: _,
|
|
949
|
-
defaultColumnFilters:
|
|
981
|
+
defaultColumnFilters: O,
|
|
950
982
|
defaultSortAsc: W = !1,
|
|
951
983
|
defaultSortColumn: T,
|
|
952
|
-
disabledCheckedIndexes:
|
|
984
|
+
disabledCheckedIndexes: I,
|
|
953
985
|
displayTimezone: M,
|
|
954
|
-
enableAutoFocus:
|
|
955
|
-
enableRowCounter:
|
|
986
|
+
enableAutoFocus: y = !0,
|
|
987
|
+
enableRowCounter: S = !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: b = !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: O || {},
|
|
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:
|
|
1019
|
-
sortAsc:
|
|
1048
|
+
const { columnFilterMap: r, searchQuery: c, sortAsc: d, sortColumn: i } = z || {}, h = {
|
|
1049
|
+
searchQuery: c || "",
|
|
1050
|
+
columnFilterMap: r || O || {},
|
|
1051
|
+
sortAsc: d === void 0 ? W : d,
|
|
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
|
+
O,
|
|
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 c = Object.keys(ae);
|
|
1083
|
+
if (Z && c.unshift(K), l) {
|
|
1084
|
+
Object.keys(l).forEach((i) => {
|
|
1085
|
+
c.includes(i) || c.push(i);
|
|
1054
1086
|
});
|
|
1055
|
-
const
|
|
1056
|
-
(i, [
|
|
1087
|
+
const d = Object.entries(l).reduce(
|
|
1088
|
+
(i, [h, N]) => (N.hidden && i.push(h), i),
|
|
1057
1089
|
[]
|
|
1058
1090
|
);
|
|
1059
|
-
|
|
1060
|
-
let
|
|
1061
|
-
|
|
1091
|
+
c = c.filter((i) => !d.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 g = l[h] ? l[h].order : void 0;
|
|
1097
|
+
return g === void 0 && (g = Object.keys(ae).findIndex(
|
|
1098
|
+
(H) => H === h
|
|
1099
|
+
)), h === K || i === K ? 0 : N === -1 ? 1 : g === -1 ? -1 : N - g;
|
|
1068
1100
|
});
|
|
1069
1101
|
}
|
|
1070
|
-
return
|
|
1102
|
+
return r?.length === c.length ? r : c;
|
|
1071
1103
|
}, [
|
|
1072
|
-
|
|
1104
|
+
l,
|
|
1073
1105
|
Ce,
|
|
1074
1106
|
Z,
|
|
1075
1107
|
ae,
|
|
1076
1108
|
We
|
|
1077
1109
|
]), je = e.useMemo(
|
|
1078
|
-
() =>
|
|
1079
|
-
(
|
|
1080
|
-
(
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
return
|
|
1084
|
-
if (!
|
|
1085
|
-
return
|
|
1086
|
-
const
|
|
1087
|
-
switch (
|
|
1110
|
+
() => x && Y ? x.map(
|
|
1111
|
+
(r, c) => Y.reduce(
|
|
1112
|
+
(d, i) => {
|
|
1113
|
+
const h = ae[i], N = l ? l[i] : void 0;
|
|
1114
|
+
if (N?.renderData)
|
|
1115
|
+
return d[i] = N.renderData(r, c), d;
|
|
1116
|
+
if (!h || i === K)
|
|
1117
|
+
return d[i] = "", d;
|
|
1118
|
+
const g = r ? r[i] : "";
|
|
1119
|
+
switch (h.type) {
|
|
1088
1120
|
case "array":
|
|
1089
|
-
return
|
|
1121
|
+
return d[i] = h.items?.type === "string" && g ? g.map((H) => k(H)).join(", ") : JSON.stringify(g), d;
|
|
1090
1122
|
case "boolean":
|
|
1091
|
-
return
|
|
1123
|
+
return d[i] = g === void 0 ? "?" : g ? "✓" : "✕", d;
|
|
1092
1124
|
case "number":
|
|
1093
1125
|
case "integer":
|
|
1094
|
-
return
|
|
1126
|
+
return g === void 0 ? (d[i] = "", d) : (d[i] = h.format === "currency" ? bn.format(g) : fn.format(g), d);
|
|
1095
1127
|
// @ts-expect-error investigate
|
|
1096
1128
|
case "string":
|
|
1097
|
-
if (
|
|
1098
|
-
return
|
|
1099
|
-
|
|
1129
|
+
if (h.format === "date" && g)
|
|
1130
|
+
return d[i] = ["2999-12-31", "1970-01-01"].includes(
|
|
1131
|
+
g
|
|
1100
1132
|
) ? "-" : tt(
|
|
1101
|
-
new Date(
|
|
1102
|
-
|
|
1103
|
-
),
|
|
1104
|
-
if (
|
|
1105
|
-
return
|
|
1106
|
-
new Date(
|
|
1133
|
+
new Date(g),
|
|
1134
|
+
N?.dateFormat || vt
|
|
1135
|
+
), d;
|
|
1136
|
+
if (h.format === "date-time" && g)
|
|
1137
|
+
return d[i] = M ? yt(
|
|
1138
|
+
new Date(g),
|
|
1107
1139
|
M,
|
|
1108
|
-
|
|
1140
|
+
Je
|
|
1109
1141
|
) : tt(
|
|
1110
|
-
new Date(
|
|
1111
|
-
|
|
1112
|
-
),
|
|
1113
|
-
if (
|
|
1114
|
-
return
|
|
1142
|
+
new Date(g),
|
|
1143
|
+
N?.dateFormat || Je
|
|
1144
|
+
), d;
|
|
1145
|
+
if (h.enum)
|
|
1146
|
+
return d[i] = g ? k(g) : "", d;
|
|
1115
1147
|
// fallthrough
|
|
1116
1148
|
default:
|
|
1117
|
-
return
|
|
1149
|
+
return d[i] = g ? `${g}` : "", d;
|
|
1118
1150
|
}
|
|
1119
1151
|
},
|
|
1120
|
-
{ _index:
|
|
1152
|
+
{ _index: c }
|
|
1121
1153
|
)
|
|
1122
1154
|
) : void 0,
|
|
1123
|
-
[
|
|
1124
|
-
),
|
|
1125
|
-
let
|
|
1126
|
-
return (Y || []).forEach((
|
|
1127
|
-
if (
|
|
1128
|
-
|
|
1155
|
+
[x, Y, ae, l, k, M]
|
|
1156
|
+
), xe = Y ? Y.length : 0, { dynamicWidthColumnCount: Ge, fixedWidthColumnsWidth: Xe } = e.useMemo(() => {
|
|
1157
|
+
let r = 0, c = 0;
|
|
1158
|
+
return (Y || []).forEach((d) => {
|
|
1159
|
+
if (d === K) {
|
|
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[d] : void 0;
|
|
1164
|
+
i?.width ? r += i.width : c += 1;
|
|
1165
|
+
}, 0), { dynamicWidthColumnCount: c, 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, c = Math.max(
|
|
1138
1170
|
Math.floor(
|
|
1139
|
-
(
|
|
1171
|
+
(Ae - Xe) / Ge
|
|
1140
1172
|
),
|
|
1141
1173
|
kt
|
|
1142
1174
|
);
|
|
1143
|
-
let
|
|
1175
|
+
let d = (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 : d ? (d -= 1, c + 1) : c;
|
|
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, c = r.toLowerCase() || "", d = (i) => x && D ? D(x[i._index], r) : !(Y && !Y.find(
|
|
1200
|
+
(h) => `${i[h]}`.toLowerCase().includes(c)
|
|
1169
1201
|
));
|
|
1170
1202
|
return je.filter((i) => {
|
|
1171
|
-
let
|
|
1172
|
-
return !
|
|
1173
|
-
([
|
|
1174
|
-
if (!
|
|
1203
|
+
let h = d(i);
|
|
1204
|
+
return !h || !a.columnFilterMap ? !1 : (Object.entries(a.columnFilterMap).forEach(
|
|
1205
|
+
([N, g]) => {
|
|
1206
|
+
if (!h || g === 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
|
+
g
|
|
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 (g && typeof g == "object") {
|
|
1222
|
+
g.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 = g[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 && g === null)
|
|
1210
1242
|
return !0;
|
|
1211
|
-
|
|
1243
|
+
h = F === g;
|
|
1212
1244
|
}
|
|
1213
1245
|
break;
|
|
1214
1246
|
// @ts-expect-error investigate
|
|
1215
1247
|
case "string":
|
|
1216
|
-
if (typeof
|
|
1217
|
-
const { from:
|
|
1248
|
+
if (typeof g == "object" && (de.format === "date" || de.format === "date-time")) {
|
|
1249
|
+
const { from: P, to: ye, filterEmpty: it } = g;
|
|
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 === g;
|
|
1230
1262
|
return;
|
|
1231
1263
|
}
|
|
1232
|
-
|
|
1264
|
+
h = `${i[N]}`.toLowerCase().includes(`${g}`.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
|
|
1253
|
-
if (
|
|
1254
|
-
return
|
|
1255
|
-
const F =
|
|
1256
|
-
return F ?
|
|
1281
|
+
const { sortAsc: r, sortColumn: c } = a;
|
|
1282
|
+
if (!c || !Ie || !x || J)
|
|
1283
|
+
return Ie;
|
|
1284
|
+
const d = ae[c], i = l ? l[c] : 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 = d && d.format?.startsWith("date"), g = gn(d, i);
|
|
1295
|
+
return Ie.sort((H, de) => {
|
|
1296
|
+
let F = g && x[H._index] ? x[H._index][c] : `${H[c]}`.toLowerCase(), P = g && x[de._index] ? x[de._index][c] : `${de[c]}`.toLowerCase();
|
|
1297
|
+
return g && N && (F = new Date(F), isNaN(F.getTime()) && (F = Ct), P = new Date(P), isNaN(P.getTime()) && (P = Ct)), F === P ? 0 : F ? P ? (F < P ? 1 : -1) * (r ? -1 : 1) : r ? 1 : -1 : r ? -1 : 1;
|
|
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 c = { ...a.columnFilterMap };
|
|
1310
|
+
delete c[r], ke({
|
|
1279
1311
|
...a,
|
|
1280
|
-
columnFilterMap:
|
|
1312
|
+
columnFilterMap: c
|
|
1281
1313
|
});
|
|
1282
1314
|
},
|
|
1283
1315
|
[a]
|
|
1284
1316
|
), He = e.useCallback(
|
|
1285
|
-
(
|
|
1286
|
-
if (
|
|
1317
|
+
(r, c) => {
|
|
1318
|
+
if (E) {
|
|
1287
1319
|
window.location.hash = ze({
|
|
1288
1320
|
...z,
|
|
1289
|
-
sortColumn:
|
|
1290
|
-
sortAsc:
|
|
1321
|
+
sortColumn: r,
|
|
1322
|
+
sortAsc: c
|
|
1291
1323
|
});
|
|
1292
1324
|
return;
|
|
1293
1325
|
}
|
|
1294
|
-
ke({ ...a, sortColumn:
|
|
1326
|
+
ke({ ...a, sortColumn: r, sortAsc: c });
|
|
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 (!p || !z || !fe || !E)
|
|
1310
1342
|
return;
|
|
1311
|
-
const
|
|
1312
|
-
let
|
|
1313
|
-
for (const
|
|
1314
|
-
const i = z[
|
|
1315
|
-
if (typeof i == "string" && i !==
|
|
1316
|
-
|
|
1343
|
+
const r = Object.keys(z);
|
|
1344
|
+
let c = !1;
|
|
1345
|
+
for (const d of r) {
|
|
1346
|
+
const i = z[d], h = fe[d];
|
|
1347
|
+
if (typeof i == "string" && i !== h) {
|
|
1348
|
+
c = !0;
|
|
1317
1349
|
break;
|
|
1318
1350
|
}
|
|
1319
|
-
if (typeof i == "object" && !et(i,
|
|
1320
|
-
|
|
1351
|
+
if (typeof i == "object" && !et(i, h)) {
|
|
1352
|
+
c = !0;
|
|
1321
1353
|
break;
|
|
1322
1354
|
}
|
|
1323
1355
|
}
|
|
1324
|
-
|
|
1356
|
+
c && De();
|
|
1325
1357
|
}, [
|
|
1326
|
-
|
|
1358
|
+
p,
|
|
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 c;
|
|
1375
|
+
if (C && (c = C === "100%" ? Re.height : C, !c))
|
|
1344
1376
|
return 0;
|
|
1345
|
-
const
|
|
1346
|
-
return
|
|
1377
|
+
const d = c ? c - ot.height - gt : 0;
|
|
1378
|
+
return d && d < r ? d : 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, c) => {
|
|
1360
1392
|
if (!Q)
|
|
1361
1393
|
return;
|
|
1362
|
-
if (
|
|
1394
|
+
if (E && c !== !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
|
-
const
|
|
1408
|
+
const d = {
|
|
1377
1409
|
...a.columnFilterMap,
|
|
1378
|
-
[Q.propName]:
|
|
1410
|
+
[Q.propName]: r
|
|
1379
1411
|
};
|
|
1380
1412
|
ke({
|
|
1381
1413
|
...a,
|
|
1382
|
-
columnFilterMap:
|
|
1414
|
+
columnFilterMap: d
|
|
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
|
-
|
|
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) => {
|
|
1449
|
+
if (!X || !x || !ne || !le)
|
|
1450
|
+
return !0;
|
|
1451
|
+
const c = X[r];
|
|
1452
|
+
return c && x[c._index] !== void 0;
|
|
1453
|
+
},
|
|
1454
|
+
[le, ne, X, x]
|
|
1455
|
+
), Ot = e.useMemo(() => pe ? !(x && !Ne) && !ne ? /* @__PURE__ */ t(
|
|
1422
1456
|
"div",
|
|
1423
1457
|
{
|
|
1424
1458
|
style: {
|
|
@@ -1431,16 +1465,16 @@ const hn = ({
|
|
|
1431
1465
|
alignItems: "center",
|
|
1432
1466
|
justifyContent: "center"
|
|
1433
1467
|
},
|
|
1434
|
-
children:
|
|
1468
|
+
children: Ne ? /* @__PURE__ */ t("button", { onClick: De, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ t("div", { children: "⌛ Loading..." })
|
|
1435
1469
|
}
|
|
1436
1470
|
) : ne && le ? /* @__PURE__ */ t(
|
|
1437
|
-
|
|
1471
|
+
Ht,
|
|
1438
1472
|
{
|
|
1439
1473
|
ref: s,
|
|
1440
1474
|
isItemLoaded: Ke,
|
|
1441
1475
|
itemCount: le,
|
|
1442
1476
|
loadMoreItems: ne,
|
|
1443
|
-
children: ({ onItemsRendered:
|
|
1477
|
+
children: ({ onItemsRendered: c, ref: d }) => /* @__PURE__ */ t(
|
|
1444
1478
|
lt,
|
|
1445
1479
|
{
|
|
1446
1480
|
className: "mig-schema-table__tbody",
|
|
@@ -1449,23 +1483,23 @@ const hn = ({
|
|
|
1449
1483
|
width: ue,
|
|
1450
1484
|
columnWidth: Be,
|
|
1451
1485
|
rowHeight: Ye,
|
|
1452
|
-
columnCount:
|
|
1453
|
-
rowCount:
|
|
1454
|
-
ref:
|
|
1486
|
+
columnCount: xe,
|
|
1487
|
+
rowCount: Se,
|
|
1488
|
+
ref: d,
|
|
1455
1489
|
onItemsRendered: ({
|
|
1456
1490
|
overscanRowStartIndex: i,
|
|
1457
|
-
overscanRowStopIndex:
|
|
1458
|
-
visibleRowStartIndex:
|
|
1459
|
-
visibleRowStopIndex:
|
|
1460
|
-
}) =>
|
|
1491
|
+
overscanRowStopIndex: h,
|
|
1492
|
+
visibleRowStartIndex: N,
|
|
1493
|
+
visibleRowStopIndex: g
|
|
1494
|
+
}) => c({
|
|
1461
1495
|
overscanStartIndex: i,
|
|
1462
|
-
overscanStopIndex:
|
|
1463
|
-
visibleStartIndex:
|
|
1464
|
-
visibleStopIndex:
|
|
1496
|
+
overscanStopIndex: h,
|
|
1497
|
+
visibleStartIndex: N,
|
|
1498
|
+
visibleStopIndex: g
|
|
1465
1499
|
}),
|
|
1466
1500
|
children: pt
|
|
1467
1501
|
},
|
|
1468
|
-
`tbody_${pe}_${ue}_${a.sortColumn}_${a.sortAsc}_${a.searchQuery}_${
|
|
1502
|
+
`tbody_${pe}_${ue}_${a.sortColumn}_${a.sortAsc}_${a.searchQuery}_${xe}_${ie.join(
|
|
1469
1503
|
" "
|
|
1470
1504
|
)}`
|
|
1471
1505
|
)
|
|
@@ -1479,86 +1513,86 @@ const hn = ({
|
|
|
1479
1513
|
width: ue,
|
|
1480
1514
|
columnWidth: Be,
|
|
1481
1515
|
rowHeight: Ye,
|
|
1482
|
-
columnCount:
|
|
1483
|
-
rowCount:
|
|
1516
|
+
columnCount: xe,
|
|
1517
|
+
rowCount: Se,
|
|
1484
1518
|
ref: ce,
|
|
1485
1519
|
children: pt
|
|
1486
1520
|
},
|
|
1487
|
-
`tbody_${pe}_${ue}_${a.sortColumn}_${a.sortAsc}_${a.searchQuery}_${
|
|
1521
|
+
`tbody_${pe}_${ue}_${a.sortColumn}_${a.sortAsc}_${a.searchQuery}_${xe}_${ie.join(
|
|
1488
1522
|
" "
|
|
1489
1523
|
)}`
|
|
1490
1524
|
) : null, [
|
|
1491
|
-
|
|
1525
|
+
xe,
|
|
1492
1526
|
ie,
|
|
1493
1527
|
Be,
|
|
1494
1528
|
Ye,
|
|
1495
1529
|
s,
|
|
1496
|
-
|
|
1530
|
+
Ne,
|
|
1497
1531
|
Ke,
|
|
1498
1532
|
le,
|
|
1499
1533
|
ne,
|
|
1500
|
-
|
|
1501
|
-
|
|
1534
|
+
De,
|
|
1535
|
+
Se,
|
|
1502
1536
|
B,
|
|
1503
1537
|
ue,
|
|
1504
1538
|
a.searchQuery,
|
|
1505
1539
|
a.sortAsc,
|
|
1506
1540
|
a.sortColumn,
|
|
1507
|
-
|
|
1541
|
+
x,
|
|
1508
1542
|
pe,
|
|
1509
1543
|
ce
|
|
1510
|
-
]),
|
|
1544
|
+
]), Rt = e.useMemo(
|
|
1511
1545
|
() => ({
|
|
1512
|
-
...
|
|
1513
|
-
width: me ? Math.min(ue,
|
|
1546
|
+
...A,
|
|
1547
|
+
width: me ? Math.min(ue, Ae) : void 0,
|
|
1514
1548
|
height: C === "100%" ? "100%" : void 0,
|
|
1515
1549
|
maxHeight: C === "100%" ? "100%" : void 0
|
|
1516
1550
|
}),
|
|
1517
|
-
[C, ue,
|
|
1551
|
+
[C, ue, A, Ae, me]
|
|
1518
1552
|
), Wt = o || "input";
|
|
1519
1553
|
return /* @__PURE__ */ t(
|
|
1520
1554
|
Me.Provider,
|
|
1521
1555
|
{
|
|
1522
1556
|
value: {
|
|
1523
|
-
checkedIndexes:
|
|
1557
|
+
checkedIndexes: f,
|
|
1524
1558
|
columnNames: Y,
|
|
1525
1559
|
columnWidths: ie,
|
|
1526
|
-
config:
|
|
1527
|
-
disabledCheckedIndexes:
|
|
1560
|
+
config: l,
|
|
1561
|
+
disabledCheckedIndexes: I,
|
|
1528
1562
|
displayTimezone: M,
|
|
1529
1563
|
dropTargetIndex: Le,
|
|
1530
1564
|
getRowClassName: q,
|
|
1531
1565
|
getRowSelected: ee,
|
|
1532
|
-
isColumnFilterable:
|
|
1566
|
+
isColumnFilterable: m,
|
|
1533
1567
|
isItemLoaded: Ke,
|
|
1534
1568
|
isSortable: te,
|
|
1535
1569
|
lastCheckChangedRowIndex: he,
|
|
1536
1570
|
onRowClick: L,
|
|
1537
|
-
onRowDoubleClick:
|
|
1571
|
+
onRowDoubleClick: se,
|
|
1538
1572
|
properties: ae,
|
|
1539
1573
|
required: Mt,
|
|
1540
1574
|
setCheckedIndexes: Z,
|
|
1541
|
-
setCustomColumnNames:
|
|
1542
|
-
setCustomColumnWidths:
|
|
1575
|
+
setCustomColumnNames: oe,
|
|
1576
|
+
setCustomColumnWidths: Oe,
|
|
1543
1577
|
setDropTargetIndex: Ze,
|
|
1544
1578
|
setFilterSortColumn: He,
|
|
1545
|
-
setLastCheckChangedRowIndex:
|
|
1579
|
+
setLastCheckChangedRowIndex: we,
|
|
1546
1580
|
setMenuConfig: j,
|
|
1547
|
-
settingsStorageKey:
|
|
1581
|
+
settingsStorageKey: v,
|
|
1548
1582
|
sortedRenderData: X,
|
|
1549
|
-
sourceData:
|
|
1583
|
+
sourceData: x,
|
|
1550
1584
|
tableDataState: a,
|
|
1551
1585
|
translate: k || ft
|
|
1552
1586
|
},
|
|
1553
|
-
children: /* @__PURE__ */
|
|
1587
|
+
children: /* @__PURE__ */ R(
|
|
1554
1588
|
"div",
|
|
1555
1589
|
{
|
|
1556
1590
|
className: `mig-schema-table${L ? " mig-schema-table--clickable-rows" : ""}`,
|
|
1557
1591
|
ref: nt,
|
|
1558
|
-
style:
|
|
1592
|
+
style: Rt,
|
|
1559
1593
|
role: "table",
|
|
1560
1594
|
children: [
|
|
1561
|
-
/* @__PURE__ */
|
|
1595
|
+
/* @__PURE__ */ R(
|
|
1562
1596
|
"div",
|
|
1563
1597
|
{
|
|
1564
1598
|
className: "mig-schema-table__action-container",
|
|
@@ -1573,46 +1607,46 @@ const hn = ({
|
|
|
1573
1607
|
autoComplete: "off",
|
|
1574
1608
|
placeholder: _e || k("search..."),
|
|
1575
1609
|
value: a.searchQuery,
|
|
1576
|
-
onChange:
|
|
1610
|
+
onChange: Et,
|
|
1577
1611
|
onKeyDown: at,
|
|
1578
|
-
autoFocus:
|
|
1579
|
-
onBlur:
|
|
1612
|
+
autoFocus: y,
|
|
1613
|
+
onBlur: It
|
|
1580
1614
|
}
|
|
1581
1615
|
) : null }),
|
|
1582
|
-
|
|
1583
|
-
|
|
1616
|
+
n ? /* @__PURE__ */ t(
|
|
1617
|
+
n,
|
|
1584
1618
|
{
|
|
1585
|
-
|
|
1619
|
+
...$,
|
|
1586
1620
|
renderData: X
|
|
1587
1621
|
}
|
|
1588
1622
|
) : /* @__PURE__ */ t("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1589
|
-
|
|
1623
|
+
S && Array.isArray(_) ? /* @__PURE__ */ t("span", { className: "mig-schema-table__row_counter", children: k(
|
|
1590
1624
|
"showingFilteredCountOfTotalCount",
|
|
1591
1625
|
X?.length || 0,
|
|
1592
1626
|
_.length
|
|
1593
1627
|
) }) : null,
|
|
1594
|
-
|
|
1628
|
+
b ? /* @__PURE__ */ t(
|
|
1595
1629
|
"button",
|
|
1596
1630
|
{
|
|
1597
|
-
onClick:
|
|
1631
|
+
onClick: St,
|
|
1598
1632
|
style: { marginLeft: 8 },
|
|
1599
1633
|
disabled: !X?.length,
|
|
1600
1634
|
children: k("exportData")
|
|
1601
1635
|
}
|
|
1602
1636
|
) : null,
|
|
1603
|
-
U ||
|
|
1637
|
+
U || m ? /* @__PURE__ */ t(
|
|
1604
1638
|
"button",
|
|
1605
1639
|
{
|
|
1606
|
-
onClick:
|
|
1640
|
+
onClick: Nt,
|
|
1607
1641
|
style: { marginLeft: 8 },
|
|
1608
1642
|
disabled: a.columnFilterMap && a.searchQuery ? Object.keys(a.columnFilterMap).length + a.searchQuery.length === 0 : !1,
|
|
1609
1643
|
children: k("clearFilters")
|
|
1610
1644
|
}
|
|
1611
1645
|
) : null,
|
|
1612
|
-
|
|
1646
|
+
v ? /* @__PURE__ */ t(
|
|
1613
1647
|
"button",
|
|
1614
1648
|
{
|
|
1615
|
-
onClick:
|
|
1649
|
+
onClick: $t,
|
|
1616
1650
|
style: { marginLeft: 8 },
|
|
1617
1651
|
disabled: !We && !Fe,
|
|
1618
1652
|
children: k("clearSettings")
|
|
@@ -1621,12 +1655,12 @@ const hn = ({
|
|
|
1621
1655
|
]
|
|
1622
1656
|
}
|
|
1623
1657
|
),
|
|
1624
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ R("div", { className: "mig-schema-table__column_resize_container", children: [
|
|
1625
1659
|
/* @__PURE__ */ t(
|
|
1626
|
-
|
|
1660
|
+
u,
|
|
1627
1661
|
{
|
|
1628
|
-
height:
|
|
1629
|
-
itemCount:
|
|
1662
|
+
height: gt,
|
|
1663
|
+
itemCount: xe,
|
|
1630
1664
|
itemSize: Be,
|
|
1631
1665
|
layout: "horizontal",
|
|
1632
1666
|
width: ue,
|
|
@@ -1635,40 +1669,40 @@ const hn = ({
|
|
|
1635
1669
|
sortColumn: a.sortColumn,
|
|
1636
1670
|
sortedRenderData: X,
|
|
1637
1671
|
className: "mig-schema-table__th-row",
|
|
1638
|
-
children:
|
|
1672
|
+
children: sn
|
|
1639
1673
|
},
|
|
1640
1674
|
`thead_${ue}_${a.sortColumn}_${a.sortAsc}_${a.searchQuery}_${ie.join(
|
|
1641
1675
|
" "
|
|
1642
1676
|
)}`
|
|
1643
1677
|
),
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1678
|
+
Ot,
|
|
1679
|
+
w ? /* @__PURE__ */ t(
|
|
1680
|
+
dn,
|
|
1647
1681
|
{
|
|
1648
1682
|
columnWidths: ie,
|
|
1649
|
-
resizeColumnIndex:
|
|
1650
|
-
setResizeColumnIndex:
|
|
1683
|
+
resizeColumnIndex: Ve,
|
|
1684
|
+
setResizeColumnIndex: Pe,
|
|
1651
1685
|
tableBodyHeight: pe
|
|
1652
1686
|
}
|
|
1653
1687
|
) : null
|
|
1654
1688
|
] }),
|
|
1655
|
-
|
|
1689
|
+
x ? x.length > 0 ? /* @__PURE__ */ t(wt, { children: jt(
|
|
1656
1690
|
Q ? /* @__PURE__ */ t(
|
|
1657
|
-
|
|
1691
|
+
un,
|
|
1658
1692
|
{
|
|
1659
|
-
isFilterable:
|
|
1660
|
-
isSortable:
|
|
1693
|
+
isFilterable: m && Q.propConfig?.isFilterable !== !1,
|
|
1694
|
+
isSortable: xt(
|
|
1661
1695
|
!!te,
|
|
1662
|
-
|
|
1696
|
+
V.properties[Q.propName],
|
|
1663
1697
|
Q.propConfig
|
|
1664
1698
|
),
|
|
1665
|
-
onChange:
|
|
1699
|
+
onChange: At,
|
|
1666
1700
|
onClose: Lt,
|
|
1667
1701
|
onInputKeyDown: at,
|
|
1668
1702
|
propConfig: Q.propConfig,
|
|
1669
1703
|
propIsRequired: Q.propIsRequired,
|
|
1670
1704
|
propName: Q.propName,
|
|
1671
|
-
propSchema:
|
|
1705
|
+
propSchema: V.properties[Q.propName],
|
|
1672
1706
|
referenceElement: Q.referenceElement,
|
|
1673
1707
|
setFilterSortColumn: He,
|
|
1674
1708
|
translate: k,
|
|
@@ -1682,43 +1716,43 @@ const hn = ({
|
|
|
1682
1716
|
)
|
|
1683
1717
|
}
|
|
1684
1718
|
);
|
|
1685
|
-
},
|
|
1686
|
-
const [
|
|
1687
|
-
|
|
1688
|
-
}, [
|
|
1689
|
-
() => Ut(
|
|
1690
|
-
[
|
|
1719
|
+
}, In = e.memo(pn), Sn = e.memo(({ refresh: n, period: o = 60 }) => {
|
|
1720
|
+
const [u, p] = e.useState(/* @__PURE__ */ new Date()), [f, l] = e.useState(/* @__PURE__ */ new Date()), $ = e.useCallback(() => {
|
|
1721
|
+
l(/* @__PURE__ */ new Date()), n();
|
|
1722
|
+
}, [n]), _ = e.useMemo(
|
|
1723
|
+
() => Ut(u, f),
|
|
1724
|
+
[u, f]
|
|
1691
1725
|
);
|
|
1692
1726
|
e.useEffect(() => {
|
|
1693
|
-
_ > o &&
|
|
1694
|
-
}, [_,
|
|
1727
|
+
_ > o && $();
|
|
1728
|
+
}, [_, u, f, o, $]), e.useEffect(() => {
|
|
1695
1729
|
const T = setInterval(() => {
|
|
1696
|
-
|
|
1730
|
+
p(/* @__PURE__ */ new Date());
|
|
1697
1731
|
}, 1e3);
|
|
1698
1732
|
return () => {
|
|
1699
1733
|
clearInterval(T);
|
|
1700
1734
|
};
|
|
1701
1735
|
}, []);
|
|
1702
|
-
const
|
|
1703
|
-
return /* @__PURE__ */
|
|
1736
|
+
const O = o - _;
|
|
1737
|
+
return /* @__PURE__ */ R(
|
|
1704
1738
|
"div",
|
|
1705
1739
|
{
|
|
1706
1740
|
className: "mx-auto",
|
|
1707
|
-
title: `Refresh ${
|
|
1741
|
+
title: `Refresh ${O > 0 ? `in ${O} seconds` : "NOW"}`,
|
|
1708
1742
|
children: [
|
|
1709
1743
|
"Last update ",
|
|
1710
|
-
tt(
|
|
1744
|
+
tt(f, "HH:mm")
|
|
1711
1745
|
]
|
|
1712
1746
|
}
|
|
1713
1747
|
);
|
|
1714
1748
|
});
|
|
1715
1749
|
export {
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1750
|
+
vt as DEFAULT_DATE_FORMAT,
|
|
1751
|
+
Je as DEFAULT_DATE_TIME_FORMAT,
|
|
1752
|
+
$e as EColumnFilterStatus,
|
|
1719
1753
|
kt as MINIMUM_COLUMN_WIDTH,
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1754
|
+
en as RESIZER_WIDTH,
|
|
1755
|
+
Sn as Refresher,
|
|
1756
|
+
In as SchemaTable,
|
|
1757
|
+
sn as Th
|
|
1724
1758
|
};
|