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