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