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