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