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