mig-schema-table 5.0.14 → 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.
|
@@ -5,12 +5,12 @@ 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";
|
|
@@ -30,9 +30,9 @@ function gt(t, ...s) {
|
|
|
30
30
|
m = m.replace(`{${p}}`, `${g}`);
|
|
31
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,114 +44,114 @@ 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:
|
|
59
|
+
translate: we
|
|
60
60
|
}), rn = { type: "boolean" }, sn = ({ columnIndex: t, rowIndex: s, style: m }) => {
|
|
61
61
|
const {
|
|
62
62
|
checkedIndexes: g,
|
|
63
63
|
columnNames: p,
|
|
64
64
|
config: h,
|
|
65
|
-
disabledCheckedIndexes:
|
|
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
78
|
translate: i
|
|
79
|
-
} = e.useContext(
|
|
80
|
-
(
|
|
81
|
-
|
|
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
|
-
), ce =
|
|
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
|
-
[ce,
|
|
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
|
-
se && re && (
|
|
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
113
|
se,
|
|
114
114
|
re,
|
|
115
|
-
|
|
115
|
+
Je
|
|
116
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
139
|
style: m,
|
|
140
|
-
className:
|
|
141
|
-
title:
|
|
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,
|
|
@@ -159,77 +159,77 @@ const De = Bt.createContext({
|
|
|
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 se of
|
|
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 (!
|
|
196
|
+
if (!A || c && !c[L._index])
|
|
197
197
|
return /* @__PURE__ */ r("div", { ...Q, children: "loading" });
|
|
198
198
|
if (o === K)
|
|
199
|
-
return /* @__PURE__ */ r("div", { ...Q, onMouseDown:
|
|
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 (
|
|
209
|
+
if (X && c)
|
|
210
210
|
return /* @__PURE__ */ r("div", { ...Q, children: /* @__PURE__ */ r(
|
|
211
|
-
|
|
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__ */ r("div", { ...Q, children:
|
|
229
|
+
) : /* @__PURE__ */ r("div", { ...Q, children: q });
|
|
230
230
|
}, Ct = e.memo(sn);
|
|
231
231
|
function on() {
|
|
232
|
-
const { checkedIndexes: t, disabledCheckedIndexes: s, sortedRenderData: m } = e.useContext(
|
|
232
|
+
const { checkedIndexes: t, disabledCheckedIndexes: s, sortedRenderData: m } = e.useContext(Me);
|
|
233
233
|
return e.useMemo(() => {
|
|
234
234
|
const g = [...m || []].filter(
|
|
235
235
|
(p) => (t ? t.includes(p._index) : !0) || (s ? !s.includes(p._index) : !0)
|
|
@@ -241,7 +241,7 @@ function Dt(t, s, m) {
|
|
|
241
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(
|
|
@@ -258,123 +258,123 @@ const an = ({ index: t, style: s }) => {
|
|
|
258
258
|
columnNames: g,
|
|
259
259
|
columnWidths: p,
|
|
260
260
|
config: h,
|
|
261
|
-
disabledCheckedIndexes:
|
|
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
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
|
-
]), se =
|
|
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:
|
|
317
|
+
propConfig: X,
|
|
318
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
|
-
|
|
371
|
+
A,
|
|
372
372
|
i,
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
Ee,
|
|
374
|
+
I
|
|
375
375
|
]);
|
|
376
376
|
if (y === K)
|
|
377
|
-
return /* @__PURE__ */ r("div", { style: s, className:
|
|
377
|
+
return /* @__PURE__ */ r("div", { style: s, className: Z.join(" "), children: /* @__PURE__ */ r(
|
|
378
378
|
"div",
|
|
379
379
|
{
|
|
380
380
|
style: {
|
|
@@ -387,40 +387,40 @@ const an = ({ index: t, style: s }) => {
|
|
|
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,18 +428,18 @@ 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__ */ r("span", { className: "mig-schema-table__th__label-body-text", children:
|
|
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:
|
|
442
|
+
onClick: ve,
|
|
443
443
|
children: /* @__PURE__ */ r(
|
|
444
444
|
"svg",
|
|
445
445
|
{
|
|
@@ -461,9 +461,9 @@ 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,
|
|
@@ -472,22 +472,22 @@ const an = ({ index: t, style: s }) => {
|
|
|
472
472
|
propIsRequired: g,
|
|
473
473
|
propName: p,
|
|
474
474
|
propSchema: h,
|
|
475
|
-
translate:
|
|
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
|
-
|
|
484
|
+
...$,
|
|
485
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: [
|
|
@@ -498,9 +498,9 @@ const an = ({ index: t, style: s }) => {
|
|
|
498
498
|
{
|
|
499
499
|
type: "checkbox",
|
|
500
500
|
style: { marginRight: 14 },
|
|
501
|
-
checked:
|
|
501
|
+
checked: !!$.filterEmpty,
|
|
502
502
|
onChange: () => {
|
|
503
|
-
const { filterEmpty: c, ...i } =
|
|
503
|
+
const { filterEmpty: c, ...i } = $;
|
|
504
504
|
c || (i.filterEmpty = !0), s(
|
|
505
505
|
Object.keys(i).length ? i : void 0,
|
|
506
506
|
!0
|
|
@@ -512,8 +512,8 @@ const an = ({ index: t, style: s }) => {
|
|
|
512
512
|
] }),
|
|
513
513
|
/* @__PURE__ */ r("hr", {})
|
|
514
514
|
] }),
|
|
515
|
-
Object.keys(
|
|
516
|
-
const i =
|
|
515
|
+
Object.keys(be).map((c) => {
|
|
516
|
+
const i = $[c];
|
|
517
517
|
return /* @__PURE__ */ F("li", { children: [
|
|
518
518
|
/* @__PURE__ */ r("label", { style: { width: 40, paddingLeft: 16 }, children: cn[c] }),
|
|
519
519
|
/* @__PURE__ */ r(
|
|
@@ -525,22 +525,22 @@ const an = ({ index: t, style: s }) => {
|
|
|
525
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
541
|
onKeyDown: m,
|
|
542
|
-
min:
|
|
543
|
-
max:
|
|
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) => ({
|
|
@@ -597,9 +597,9 @@ const an = ({ index: t, style: s }) => {
|
|
|
597
597
|
if (h?.enum) {
|
|
598
598
|
const c = h.enum.map((o) => ({
|
|
599
599
|
value: o,
|
|
600
|
-
label:
|
|
600
|
+
label: I(o)
|
|
601
601
|
})), i = c.filter(
|
|
602
|
-
(o) => (
|
|
602
|
+
(o) => (D || []).includes(o.value)
|
|
603
603
|
);
|
|
604
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,
|
|
@@ -624,12 +624,12 @@ const an = ({ index: t, style: s }) => {
|
|
|
624
624
|
s(_.length ? _ : void 0, !0);
|
|
625
625
|
},
|
|
626
626
|
onKeyDown: m,
|
|
627
|
-
placeholder:
|
|
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
|
|
@@ -663,8 +663,8 @@ const an = ({ index: t, style: s }) => {
|
|
|
663
663
|
dateFormat: c,
|
|
664
664
|
"data-prop-name": p,
|
|
665
665
|
locale: ht,
|
|
666
|
-
selected: i.from ? new
|
|
667
|
-
C ||
|
|
666
|
+
selected: i.from ? new Pe(i.from).withTimeZone(
|
|
667
|
+
C || Te
|
|
668
668
|
) : null,
|
|
669
669
|
onChange: (o) => {
|
|
670
670
|
if (!o && !i.to) {
|
|
@@ -673,7 +673,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
673
673
|
}
|
|
674
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,12 +685,12 @@ 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
|
] }),
|
|
@@ -704,8 +704,8 @@ const an = ({ index: t, style: s }) => {
|
|
|
704
704
|
"data-prop-name": p,
|
|
705
705
|
locale: ht,
|
|
706
706
|
selectsEnd: !0,
|
|
707
|
-
selected: i.to ? new
|
|
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,
|
|
@@ -714,7 +714,7 @@ const an = ({ index: t, style: s }) => {
|
|
|
714
714
|
s(void 0, !0);
|
|
715
715
|
return;
|
|
716
716
|
}
|
|
717
|
-
const _ = o ?
|
|
717
|
+
const _ = o ? w ? Pe.tz(C || Te, o) : Pt(o) : void 0;
|
|
718
718
|
i.from && _ && _ < i.from || s(
|
|
719
719
|
{
|
|
720
720
|
...t,
|
|
@@ -727,10 +727,10 @@ const an = ({ index: t, style: s }) => {
|
|
|
727
727
|
isClearable: !0,
|
|
728
728
|
startDate: i.from,
|
|
729
729
|
endDate: i.to,
|
|
730
|
-
showTimeInput:
|
|
731
|
-
showTimeSelect:
|
|
730
|
+
showTimeInput: w,
|
|
731
|
+
showTimeSelect: w,
|
|
732
732
|
timeIntervals: 15,
|
|
733
|
-
shouldCloseOnSelect: !
|
|
733
|
+
shouldCloseOnSelect: !w
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] })
|
|
@@ -746,7 +746,7 @@ 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
752
|
const i = c.currentTarget.value, o = i ? i.split(",").map((_) => _.trim()) : [];
|
|
@@ -774,31 +774,31 @@ const an = ({ index: t, style: s }) => {
|
|
|
774
774
|
onClose: g,
|
|
775
775
|
onInputKeyDown: p,
|
|
776
776
|
propConfig: h,
|
|
777
|
-
propIsRequired:
|
|
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
796
|
const i = (o) => {
|
|
797
|
-
if (!
|
|
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
|
}
|
|
@@ -808,20 +808,20 @@ const an = ({ index: t, style: s }) => {
|
|
|
808
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
|
|
815
|
+
const G = h?.FilterMenu || un, ee = e.useCallback(
|
|
816
816
|
(i) => {
|
|
817
|
-
|
|
817
|
+
A(C, !0), g(i);
|
|
818
818
|
},
|
|
819
|
-
[g, C,
|
|
820
|
-
),
|
|
819
|
+
[g, C, A]
|
|
820
|
+
), T = e.useCallback(
|
|
821
821
|
(i) => {
|
|
822
|
-
|
|
822
|
+
A(C, !1), g(i);
|
|
823
823
|
},
|
|
824
|
-
[g, C,
|
|
824
|
+
[g, C, A]
|
|
825
825
|
), c = e.useCallback(() => {
|
|
826
826
|
m(void 0, !0);
|
|
827
827
|
}, [m]);
|
|
@@ -830,25 +830,25 @@ const an = ({ index: t, style: s }) => {
|
|
|
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
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:
|
|
841
|
+
t ? /* @__PURE__ */ F("li", { onClick: T, style: { padding: 8 }, children: [
|
|
842
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
850
|
onMouseOver: (i) => {
|
|
851
|
-
|
|
851
|
+
$.refs.setReference(i.currentTarget);
|
|
852
852
|
},
|
|
853
853
|
children: [
|
|
854
854
|
/* @__PURE__ */ r("span", { className: "mig-schema-table__th-menu__icon", children: /* @__PURE__ */ r(
|
|
@@ -856,12 +856,12 @@ const an = ({ index: t, style: s }) => {
|
|
|
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__ */ r("label", { htmlFor: "mig-schema-table__th-menu__filters", children:
|
|
864
|
+
/* @__PURE__ */ r("label", { htmlFor: "mig-schema-table__th-menu__filters", children: O("filters") }),
|
|
865
865
|
/* @__PURE__ */ r("div", { className: "mig-schema-table__th-menu__sub-menu-indicator" })
|
|
866
866
|
]
|
|
867
867
|
}
|
|
@@ -869,22 +869,22 @@ const an = ({ index: t, style: s }) => {
|
|
|
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:
|
|
876
|
+
ref: $.refs.setFloating,
|
|
877
|
+
style: $.floatingStyles,
|
|
878
878
|
children: /* @__PURE__ */ r(
|
|
879
|
-
|
|
879
|
+
G,
|
|
880
880
|
{
|
|
881
|
-
columnFilterValue:
|
|
881
|
+
columnFilterValue: D,
|
|
882
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
|
}
|
|
@@ -896,56 +896,56 @@ const an = ({ index: t, style: s }) => {
|
|
|
896
896
|
setResizeColumnIndex: m,
|
|
897
897
|
tableBodyHeight: g
|
|
898
898
|
}) => {
|
|
899
|
-
const [p, h] = e.useState(0),
|
|
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
|
-
m(parseInt(
|
|
908
|
+
let R = 0;
|
|
909
|
+
const S = e.useCallback(
|
|
910
|
+
(O) => {
|
|
911
|
+
m(parseInt(O.currentTarget.dataset.columnIndex)), h(O.clientX);
|
|
912
912
|
},
|
|
913
913
|
[m]
|
|
914
|
-
),
|
|
915
|
-
(
|
|
916
|
-
C(
|
|
914
|
+
), A = e.useCallback(
|
|
915
|
+
(O) => {
|
|
916
|
+
C(O.clientX - p), h(0), m(-1);
|
|
917
917
|
},
|
|
918
918
|
[p, C, m]
|
|
919
919
|
);
|
|
920
|
-
return /* @__PURE__ */ r("div", { children: [...t].map((
|
|
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
937
|
const [s, m] = e.useState({ width: 0, height: 0 }), g = e.useMemo(
|
|
938
|
-
() =>
|
|
938
|
+
() => qt(m, 100),
|
|
939
939
|
[]
|
|
940
940
|
);
|
|
941
941
|
return e.useEffect(() => {
|
|
942
942
|
if (!t)
|
|
943
943
|
return;
|
|
944
944
|
const p = new ResizeObserver((h) => {
|
|
945
|
-
for (const
|
|
946
|
-
const { blockSize: C, inlineSize:
|
|
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
|
});
|
|
@@ -967,13 +967,13 @@ const an = ({ index: t, style: s }) => {
|
|
|
967
967
|
}), bn = async (t) => {
|
|
968
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",
|
|
972
972
|
"SELECT_ALL_COLUMN_NAME"
|
|
973
973
|
])
|
|
974
974
|
), g.getRow(1).font = { bold: !0 }, g.addRows(
|
|
975
975
|
t.map((p) => {
|
|
976
|
-
const { _index: h, SELECT_ALL_COLUMN_NAME:
|
|
976
|
+
const { _index: h, SELECT_ALL_COLUMN_NAME: I, ...C } = p;
|
|
977
977
|
return Object.values(C);
|
|
978
978
|
})
|
|
979
979
|
), m.xlsx.writeBuffer().then((p) => {
|
|
@@ -1004,18 +1004,18 @@ const Cn = ({
|
|
|
1004
1004
|
autoRender: g,
|
|
1005
1005
|
checkedIndexes: p,
|
|
1006
1006
|
config: h,
|
|
1007
|
-
customElementProps:
|
|
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
1020
|
isColumnFilterable: i = !0,
|
|
1021
1021
|
isExportable: o = !0,
|
|
@@ -1025,44 +1025,43 @@ const Cn = ({
|
|
|
1025
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, Xe] = e.useState(), [l, 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:
|
|
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 || {}
|
|
1060
1059
|
} : l
|
|
1061
|
-
).then(
|
|
1062
|
-
}, [C,
|
|
1063
|
-
|
|
1064
|
-
}, [l,
|
|
1065
|
-
if (!
|
|
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
1066
|
const n = () => {
|
|
1068
1067
|
Mt(ut(window.location.hash));
|
|
@@ -1070,83 +1069,83 @@ const Cn = ({
|
|
|
1070
1069
|
return window.addEventListener("hashchange", n), () => {
|
|
1071
1070
|
window.removeEventListener("hashchange", n);
|
|
1072
1071
|
};
|
|
1073
|
-
}, [
|
|
1074
|
-
if (!
|
|
1072
|
+
}, [M]), e.useEffect(() => {
|
|
1073
|
+
if (!M)
|
|
1075
1074
|
return;
|
|
1076
|
-
const { columnFilterMap: n, searchQuery: u, sortAsc: d, sortColumn: a } =
|
|
1075
|
+
const { columnFilterMap: n, searchQuery: u, sortAsc: d, sortColumn: a } = U || {}, f = {
|
|
1077
1076
|
searchQuery: u || "",
|
|
1078
|
-
columnFilterMap: n ||
|
|
1079
|
-
sortAsc: d === void 0 ?
|
|
1080
|
-
sortColumn: a === void 0 ?
|
|
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
1091
|
re && re(l);
|
|
1093
1092
|
}, [re, l]);
|
|
1094
|
-
const rt = e.useRef(null), st = e.useRef(null),
|
|
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 n =
|
|
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;
|
|
1110
1109
|
let u = Object.keys(ie);
|
|
1111
|
-
if (
|
|
1110
|
+
if (q && u.unshift(K), h) {
|
|
1112
1111
|
Object.keys(h).forEach((a) => {
|
|
1113
1112
|
u.includes(a) || u.push(a);
|
|
1114
1113
|
});
|
|
1115
1114
|
const d = Object.entries(h).reduce(
|
|
1116
|
-
(a, [f,
|
|
1115
|
+
(a, [f, E]) => (E.hidden && a.push(f), a),
|
|
1117
1116
|
[]
|
|
1118
1117
|
);
|
|
1119
1118
|
u = u.filter((a) => !d.includes(a)).sort((a, f) => {
|
|
1120
|
-
let
|
|
1121
|
-
|
|
1122
|
-
(
|
|
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
1123
|
let b = h[f] ? h[f].order : void 0;
|
|
1125
1124
|
return b === void 0 && (b = Object.keys(ie).findIndex(
|
|
1126
|
-
(
|
|
1127
|
-
)), f === K || a === K ? 0 :
|
|
1125
|
+
(H) => H === f
|
|
1126
|
+
)), f === K || a === K ? 0 : E === -1 ? 1 : b === -1 ? -1 : E - b;
|
|
1128
1127
|
});
|
|
1129
1128
|
}
|
|
1130
1129
|
return n?.length === u.length ? n : u;
|
|
1131
1130
|
}, [
|
|
1132
1131
|
h,
|
|
1133
|
-
|
|
1134
|
-
|
|
1132
|
+
Ce,
|
|
1133
|
+
q,
|
|
1135
1134
|
ie,
|
|
1136
|
-
|
|
1137
|
-
]),
|
|
1138
|
-
() =>
|
|
1135
|
+
je
|
|
1136
|
+
]), Be = e.useMemo(
|
|
1137
|
+
() => x && Y ? x.map(
|
|
1139
1138
|
(n, u) => Y.reduce(
|
|
1140
1139
|
(d, a) => {
|
|
1141
|
-
const f = ie[a],
|
|
1142
|
-
if (
|
|
1143
|
-
return 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;
|
|
1144
1143
|
if (!f || a === K)
|
|
1145
1144
|
return d[a] = "", d;
|
|
1146
1145
|
const b = n ? n[a] : "";
|
|
1147
1146
|
switch (f.type) {
|
|
1148
1147
|
case "array":
|
|
1149
|
-
return d[a] = f.items?.type === "string" && b ? b.map((
|
|
1148
|
+
return d[a] = f.items?.type === "string" && b ? b.map((H) => k(H)).join(", ") : JSON.stringify(b), d;
|
|
1150
1149
|
case "boolean":
|
|
1151
1150
|
return d[a] = b === void 0 ? "?" : b ? "✓" : "✕", d;
|
|
1152
1151
|
case "number":
|
|
@@ -1159,19 +1158,19 @@ const Cn = ({
|
|
|
1159
1158
|
b
|
|
1160
1159
|
) ? "-" : nt(
|
|
1161
1160
|
new Date(b),
|
|
1162
|
-
|
|
1161
|
+
E?.dateFormat || kt
|
|
1163
1162
|
), d;
|
|
1164
1163
|
if (f.format === "date-time" && b)
|
|
1165
|
-
return d[a] =
|
|
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
|
-
|
|
1170
|
+
E?.dateFormat || Je
|
|
1172
1171
|
), d;
|
|
1173
1172
|
if (f.enum)
|
|
1174
|
-
return d[a] = b ?
|
|
1173
|
+
return d[a] = b ? k(b) : "", d;
|
|
1175
1174
|
// fallthrough
|
|
1176
1175
|
default:
|
|
1177
1176
|
return d[a] = b ? `${b}` : "", d;
|
|
@@ -1180,8 +1179,8 @@ const Cn = ({
|
|
|
1180
1179
|
{ _index: u }
|
|
1181
1180
|
)
|
|
1182
1181
|
) : void 0,
|
|
1183
|
-
[
|
|
1184
|
-
),
|
|
1182
|
+
[x, Y, ie, h, k, D]
|
|
1183
|
+
), xe = Y ? Y.length : 0, { dynamicWidthColumnCount: Xe, fixedWidthColumnsWidth: He } = e.useMemo(() => {
|
|
1185
1184
|
let n = 0, u = 0;
|
|
1186
1185
|
return (Y || []).forEach((d) => {
|
|
1187
1186
|
if (d === K) {
|
|
@@ -1192,168 +1191,168 @@ const Cn = ({
|
|
|
1192
1191
|
a?.width ? n += a.width : u += 1;
|
|
1193
1192
|
}, 0), { dynamicWidthColumnCount: u, fixedWidthColumnsWidth: n };
|
|
1194
1193
|
}, [Y, h]), le = e.useMemo(() => {
|
|
1195
|
-
if (
|
|
1196
|
-
return new Uint16Array(
|
|
1197
|
-
const n =
|
|
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 d = (
|
|
1202
|
+
let d = (Le - He) % Xe;
|
|
1204
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
1211
|
return n?.length === a.length ? n : a;
|
|
1213
1212
|
}, [
|
|
1214
1213
|
Y,
|
|
1215
1214
|
h,
|
|
1216
|
-
|
|
1217
|
-
|
|
1215
|
+
Ae,
|
|
1216
|
+
Xe,
|
|
1218
1217
|
He,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
]),
|
|
1218
|
+
Fe,
|
|
1219
|
+
Le
|
|
1220
|
+
]), Qe = e.useCallback(
|
|
1222
1221
|
(n) => le ? le[n] : 1,
|
|
1223
1222
|
[le]
|
|
1224
|
-
),
|
|
1225
|
-
if (!
|
|
1226
|
-
return
|
|
1227
|
-
const { searchQuery: n } = l, u = n.toLowerCase() || "", d = (a) =>
|
|
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(
|
|
1228
1227
|
(f) => `${a[f]}`.toLowerCase().includes(u)
|
|
1229
1228
|
));
|
|
1230
|
-
return
|
|
1229
|
+
return Be.filter((a) => {
|
|
1231
1230
|
let f = d(a);
|
|
1232
1231
|
return !f || !l.columnFilterMap ? !1 : (Object.entries(l.columnFilterMap).forEach(
|
|
1233
|
-
([
|
|
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 = ie[
|
|
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 = `${a[
|
|
1297
|
+
f = `${a[E]}`.toLowerCase().includes(`${b}`.toLowerCase());
|
|
1299
1298
|
}
|
|
1300
1299
|
}
|
|
1301
1300
|
), f);
|
|
1302
1301
|
});
|
|
1303
1302
|
}, [
|
|
1304
|
-
|
|
1303
|
+
Be,
|
|
1305
1304
|
i,
|
|
1306
1305
|
B,
|
|
1307
|
-
|
|
1306
|
+
J,
|
|
1308
1307
|
l,
|
|
1309
|
-
|
|
1308
|
+
T,
|
|
1310
1309
|
Y,
|
|
1311
1310
|
h,
|
|
1312
|
-
|
|
1311
|
+
x,
|
|
1313
1312
|
ie
|
|
1314
|
-
]),
|
|
1313
|
+
]), V = e.useMemo(() => {
|
|
1315
1314
|
const { sortAsc: n, sortColumn: u } = l;
|
|
1316
|
-
if (!u || !
|
|
1317
|
-
return
|
|
1315
|
+
if (!u || !Ie || !x || J)
|
|
1316
|
+
return Ie;
|
|
1318
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
|
-
n === void 0 ?
|
|
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
1333
|
h,
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1334
|
+
S,
|
|
1335
|
+
Ie,
|
|
1336
|
+
J,
|
|
1338
1337
|
ie,
|
|
1339
|
-
|
|
1338
|
+
x,
|
|
1340
1339
|
l
|
|
1341
1340
|
]);
|
|
1342
1341
|
e.useImperativeHandle(
|
|
1343
|
-
|
|
1342
|
+
ve,
|
|
1344
1343
|
() => ({
|
|
1345
|
-
getFilteredSortedData: () =>
|
|
1344
|
+
getFilteredSortedData: () => V,
|
|
1346
1345
|
scrollToIndex: (n) => {
|
|
1347
|
-
const u =
|
|
1346
|
+
const u = Re?.current, d = V?.findIndex((a) => a._index === n) || -1;
|
|
1348
1347
|
u && d >= 0 && u.scrollToItem({ rowIndex: d });
|
|
1349
1348
|
}
|
|
1350
1349
|
}),
|
|
1351
|
-
[
|
|
1350
|
+
[V, Re]
|
|
1352
1351
|
);
|
|
1353
1352
|
const at = e.useCallback(
|
|
1354
1353
|
(n) => {
|
|
1355
1354
|
const u = { ...l.columnFilterMap };
|
|
1356
|
-
delete u[n],
|
|
1355
|
+
delete u[n], ke({
|
|
1357
1356
|
...l,
|
|
1358
1357
|
columnFilterMap: u
|
|
1359
1358
|
});
|
|
@@ -1361,35 +1360,35 @@ const Cn = ({
|
|
|
1361
1360
|
[l]
|
|
1362
1361
|
), Ye = e.useCallback(
|
|
1363
1362
|
(n, u) => {
|
|
1364
|
-
if (
|
|
1365
|
-
window.location.hash =
|
|
1366
|
-
...
|
|
1363
|
+
if (M) {
|
|
1364
|
+
window.location.hash = Ue({
|
|
1365
|
+
...U,
|
|
1367
1366
|
sortColumn: n,
|
|
1368
1367
|
sortAsc: u
|
|
1369
1368
|
});
|
|
1370
1369
|
return;
|
|
1371
1370
|
}
|
|
1372
|
-
|
|
1371
|
+
ke({ ...l, sortColumn: n, sortAsc: u });
|
|
1373
1372
|
},
|
|
1374
|
-
[l,
|
|
1373
|
+
[l, U, M]
|
|
1375
1374
|
), Et = e.useCallback(
|
|
1376
1375
|
(n) => {
|
|
1377
|
-
|
|
1376
|
+
ke({
|
|
1378
1377
|
...l,
|
|
1379
1378
|
searchQuery: n.currentTarget.value
|
|
1380
1379
|
});
|
|
1381
1380
|
},
|
|
1382
1381
|
[l]
|
|
1383
|
-
),
|
|
1384
|
-
|
|
1382
|
+
), De = e.useCallback(() => {
|
|
1383
|
+
qe(l), ge(void 0);
|
|
1385
1384
|
}, [l]);
|
|
1386
1385
|
e.useEffect(() => {
|
|
1387
|
-
if (!g || !
|
|
1386
|
+
if (!g || !U || !he || !M)
|
|
1388
1387
|
return;
|
|
1389
|
-
const n = Object.keys(
|
|
1388
|
+
const n = Object.keys(U);
|
|
1390
1389
|
let u = !1;
|
|
1391
1390
|
for (const d of n) {
|
|
1392
|
-
const a =
|
|
1391
|
+
const a = U[d], f = he[d];
|
|
1393
1392
|
if (typeof a == "string" && a !== f) {
|
|
1394
1393
|
u = !0;
|
|
1395
1394
|
break;
|
|
@@ -1399,69 +1398,69 @@ const Cn = ({
|
|
|
1399
1398
|
break;
|
|
1400
1399
|
}
|
|
1401
1400
|
}
|
|
1402
|
-
u &&
|
|
1401
|
+
u && De();
|
|
1403
1402
|
}, [
|
|
1404
1403
|
g,
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1404
|
+
U,
|
|
1405
|
+
he,
|
|
1406
|
+
De,
|
|
1407
|
+
M
|
|
1409
1408
|
]);
|
|
1410
1409
|
const it = e.useCallback(
|
|
1411
1410
|
(n) => {
|
|
1412
|
-
n.key === "Enter" && (
|
|
1411
|
+
n.key === "Enter" && (j(void 0), Ne && !M && De(), X && n.currentTarget.className === "mig-schema-table__search" && X(l.searchQuery || ""));
|
|
1413
1412
|
},
|
|
1414
1413
|
[
|
|
1415
|
-
|
|
1414
|
+
Ne,
|
|
1416
1415
|
l.searchQuery,
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1416
|
+
X,
|
|
1417
|
+
De,
|
|
1418
|
+
M
|
|
1420
1419
|
]
|
|
1421
|
-
), Ke = e.useCallback(() => Q, [Q]), ue = e.useMemo(() => Yt(le), [le]),
|
|
1422
|
-
() =>
|
|
1423
|
-
[
|
|
1424
|
-
),
|
|
1425
|
-
const n = Q *
|
|
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;
|
|
1426
1425
|
let u;
|
|
1427
|
-
if (y && (u = y === "100%" ?
|
|
1426
|
+
if (y && (u = y === "100%" ? We.height : y, !u))
|
|
1428
1427
|
return 0;
|
|
1429
1428
|
const d = u ? u - ot.height - _t : 0;
|
|
1430
1429
|
return d && d < n ? d : n;
|
|
1431
1430
|
}, [
|
|
1432
1431
|
Q,
|
|
1433
|
-
|
|
1432
|
+
Se,
|
|
1434
1433
|
y,
|
|
1435
1434
|
ot,
|
|
1436
|
-
|
|
1435
|
+
We.height
|
|
1437
1436
|
]), Lt = e.useCallback(
|
|
1438
1437
|
(n) => {
|
|
1439
|
-
|
|
1438
|
+
j(void 0), n.preventDefault(), n.stopPropagation();
|
|
1440
1439
|
},
|
|
1441
1440
|
[]
|
|
1442
1441
|
), Nt = e.useCallback(
|
|
1443
1442
|
(n, u) => {
|
|
1444
|
-
if (!
|
|
1443
|
+
if (!z)
|
|
1445
1444
|
return;
|
|
1446
|
-
if (
|
|
1447
|
-
window.location.hash =
|
|
1448
|
-
...
|
|
1445
|
+
if (M && u !== !1) {
|
|
1446
|
+
window.location.hash = Ue({
|
|
1447
|
+
...U,
|
|
1449
1448
|
columnFilterMap: {
|
|
1450
1449
|
...l.columnFilterMap,
|
|
1451
|
-
[
|
|
1450
|
+
[z.propName]: n
|
|
1452
1451
|
}
|
|
1453
1452
|
});
|
|
1454
1453
|
return;
|
|
1455
1454
|
}
|
|
1456
1455
|
if (n === void 0) {
|
|
1457
|
-
at(
|
|
1456
|
+
at(z.propName);
|
|
1458
1457
|
return;
|
|
1459
1458
|
}
|
|
1460
1459
|
const d = {
|
|
1461
1460
|
...l.columnFilterMap,
|
|
1462
|
-
[
|
|
1461
|
+
[z.propName]: n
|
|
1463
1462
|
};
|
|
1464
|
-
|
|
1463
|
+
ke({
|
|
1465
1464
|
...l,
|
|
1466
1465
|
columnFilterMap: d
|
|
1467
1466
|
});
|
|
@@ -1469,47 +1468,47 @@ const Cn = ({
|
|
|
1469
1468
|
[
|
|
1470
1469
|
at,
|
|
1471
1470
|
l,
|
|
1471
|
+
U,
|
|
1472
1472
|
z,
|
|
1473
|
-
|
|
1474
|
-
A
|
|
1473
|
+
M
|
|
1475
1474
|
]
|
|
1476
1475
|
), It = e.useCallback(() => {
|
|
1477
1476
|
const n = {
|
|
1478
1477
|
searchQuery: "",
|
|
1479
1478
|
columnFilterMap: {},
|
|
1480
1479
|
// Clear button should clear _ALL_ filters, do _NOT_ revert to defaultColumnFilters
|
|
1481
|
-
sortColumn:
|
|
1482
|
-
sortAsc:
|
|
1480
|
+
sortColumn: A,
|
|
1481
|
+
sortAsc: S
|
|
1483
1482
|
};
|
|
1484
|
-
|
|
1485
|
-
}, [
|
|
1486
|
-
const n =
|
|
1487
|
-
|
|
1488
|
-
(l.searchQuery || n) && l.searchQuery !== n && (window.location.hash =
|
|
1489
|
-
...
|
|
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,
|
|
1490
1489
|
searchQuery: l.searchQuery
|
|
1491
1490
|
}));
|
|
1492
|
-
}, [
|
|
1491
|
+
}, [U, l.searchQuery, M]), $t = e.useCallback(
|
|
1493
1492
|
async (n) => {
|
|
1494
|
-
n.preventDefault(), n.stopPropagation(),
|
|
1493
|
+
n.preventDefault(), n.stopPropagation(), V && await bn(V);
|
|
1495
1494
|
},
|
|
1496
|
-
[
|
|
1495
|
+
[V]
|
|
1497
1496
|
), Ot = e.useCallback(() => {
|
|
1498
|
-
|
|
1499
|
-
}, [
|
|
1497
|
+
v && (localStorage.removeItem(`${v}.columnNames`), localStorage.removeItem(`${v}.columnWidths`), oe(void 0), Oe(void 0));
|
|
1498
|
+
}, [v]), et = e.useCallback(
|
|
1500
1499
|
(n) => {
|
|
1501
|
-
if (!
|
|
1500
|
+
if (!V || !x || !ne || !ce)
|
|
1502
1501
|
return !0;
|
|
1503
|
-
const u =
|
|
1504
|
-
return u &&
|
|
1502
|
+
const u = V[n];
|
|
1503
|
+
return u && x[u._index] !== void 0;
|
|
1505
1504
|
},
|
|
1506
|
-
[ce, ne,
|
|
1507
|
-
), Rt = e.useMemo(() =>
|
|
1505
|
+
[ce, ne, V, x]
|
|
1506
|
+
), Rt = e.useMemo(() => pe ? !(x && !Ne) && !ne ? /* @__PURE__ */ r(
|
|
1508
1507
|
"div",
|
|
1509
1508
|
{
|
|
1510
1509
|
style: {
|
|
1511
1510
|
width: ue,
|
|
1512
|
-
height: Math.max(50,
|
|
1511
|
+
height: Math.max(50, pe),
|
|
1513
1512
|
border: "1px solid #BBB",
|
|
1514
1513
|
textAlign: "center",
|
|
1515
1514
|
display: "flex",
|
|
@@ -1517,7 +1516,7 @@ const Cn = ({
|
|
|
1517
1516
|
alignItems: "center",
|
|
1518
1517
|
justifyContent: "center"
|
|
1519
1518
|
},
|
|
1520
|
-
children:
|
|
1519
|
+
children: Ne ? /* @__PURE__ */ r("button", { onClick: De, className: "btn border", children: "Refresh data" }) : /* @__PURE__ */ r("div", { children: "⌛ Loading..." })
|
|
1521
1520
|
}
|
|
1522
1521
|
) : ne && ce ? /* @__PURE__ */ r(
|
|
1523
1522
|
Kt,
|
|
@@ -1531,27 +1530,27 @@ const Cn = ({
|
|
|
1531
1530
|
{
|
|
1532
1531
|
className: "mig-schema-table__tbody",
|
|
1533
1532
|
estimatedRowHeight: Q,
|
|
1534
|
-
height:
|
|
1533
|
+
height: pe,
|
|
1535
1534
|
width: ue,
|
|
1536
|
-
columnWidth:
|
|
1535
|
+
columnWidth: Qe,
|
|
1537
1536
|
rowHeight: Ke,
|
|
1538
|
-
columnCount:
|
|
1539
|
-
rowCount:
|
|
1537
|
+
columnCount: xe,
|
|
1538
|
+
rowCount: Se,
|
|
1540
1539
|
ref: d,
|
|
1541
1540
|
onItemsRendered: ({
|
|
1542
1541
|
overscanRowStartIndex: a,
|
|
1543
1542
|
overscanRowStopIndex: f,
|
|
1544
|
-
visibleRowStartIndex:
|
|
1543
|
+
visibleRowStartIndex: E,
|
|
1545
1544
|
visibleRowStopIndex: b
|
|
1546
1545
|
}) => u({
|
|
1547
1546
|
overscanStartIndex: a,
|
|
1548
1547
|
overscanStopIndex: f,
|
|
1549
|
-
visibleStartIndex:
|
|
1548
|
+
visibleStartIndex: E,
|
|
1550
1549
|
visibleStopIndex: b
|
|
1551
1550
|
}),
|
|
1552
1551
|
children: Ct
|
|
1553
1552
|
},
|
|
1554
|
-
`tbody_${
|
|
1553
|
+
`tbody_${pe}_${ue}_${l.sortColumn}_${l.sortAsc}_${l.searchQuery}_${xe}_${le.join(
|
|
1555
1554
|
" "
|
|
1556
1555
|
)}`
|
|
1557
1556
|
)
|
|
@@ -1561,85 +1560,85 @@ const Cn = ({
|
|
|
1561
1560
|
{
|
|
1562
1561
|
className: "mig-schema-table__tbody",
|
|
1563
1562
|
estimatedRowHeight: Q,
|
|
1564
|
-
height:
|
|
1563
|
+
height: pe,
|
|
1565
1564
|
width: ue,
|
|
1566
|
-
columnWidth:
|
|
1565
|
+
columnWidth: Qe,
|
|
1567
1566
|
rowHeight: Ke,
|
|
1568
|
-
columnCount:
|
|
1569
|
-
rowCount:
|
|
1570
|
-
ref:
|
|
1567
|
+
columnCount: xe,
|
|
1568
|
+
rowCount: Se,
|
|
1569
|
+
ref: Re,
|
|
1571
1570
|
children: Ct
|
|
1572
1571
|
},
|
|
1573
|
-
`tbody_${
|
|
1572
|
+
`tbody_${pe}_${ue}_${l.sortColumn}_${l.sortAsc}_${l.searchQuery}_${xe}_${le.join(
|
|
1574
1573
|
" "
|
|
1575
1574
|
)}`
|
|
1576
1575
|
) : null, [
|
|
1577
|
-
|
|
1576
|
+
xe,
|
|
1578
1577
|
le,
|
|
1579
|
-
|
|
1578
|
+
Qe,
|
|
1580
1579
|
Ke,
|
|
1581
1580
|
c,
|
|
1582
|
-
|
|
1581
|
+
Ne,
|
|
1583
1582
|
et,
|
|
1584
1583
|
ce,
|
|
1585
1584
|
ne,
|
|
1586
|
-
|
|
1587
|
-
|
|
1585
|
+
De,
|
|
1586
|
+
Se,
|
|
1588
1587
|
Q,
|
|
1589
1588
|
ue,
|
|
1590
1589
|
l.searchQuery,
|
|
1591
1590
|
l.sortAsc,
|
|
1592
1591
|
l.sortColumn,
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1592
|
+
x,
|
|
1593
|
+
pe,
|
|
1594
|
+
Re
|
|
1596
1595
|
]), Wt = e.useMemo(
|
|
1597
1596
|
() => ({
|
|
1598
|
-
...
|
|
1599
|
-
width:
|
|
1597
|
+
...N,
|
|
1598
|
+
width: se ? Math.min(ue, Le) : void 0,
|
|
1600
1599
|
height: y === "100%" ? "100%" : void 0,
|
|
1601
1600
|
maxHeight: y === "100%" ? "100%" : void 0
|
|
1602
1601
|
}),
|
|
1603
|
-
[y, ue,
|
|
1602
|
+
[y, ue, N, Le, se]
|
|
1604
1603
|
), jt = s || "input";
|
|
1605
1604
|
return /* @__PURE__ */ r(
|
|
1606
|
-
|
|
1605
|
+
Me.Provider,
|
|
1607
1606
|
{
|
|
1608
1607
|
value: {
|
|
1609
1608
|
checkedIndexes: p,
|
|
1610
1609
|
columnNames: Y,
|
|
1611
1610
|
columnWidths: le,
|
|
1612
1611
|
config: h,
|
|
1613
|
-
disabledCheckedIndexes:
|
|
1614
|
-
displayTimezone:
|
|
1615
|
-
dropTargetIndex:
|
|
1616
|
-
getRowClassName:
|
|
1612
|
+
disabledCheckedIndexes: O,
|
|
1613
|
+
displayTimezone: D,
|
|
1614
|
+
dropTargetIndex: Ee,
|
|
1615
|
+
getRowClassName: G,
|
|
1617
1616
|
getRowSelected: ee,
|
|
1618
1617
|
isColumnFilterable: i,
|
|
1619
1618
|
isItemLoaded: et,
|
|
1620
1619
|
isSortable: te,
|
|
1621
|
-
lastCheckChangedRowIndex:
|
|
1622
|
-
onRowClick:
|
|
1623
|
-
onRowDoubleClick:
|
|
1620
|
+
lastCheckChangedRowIndex: me,
|
|
1621
|
+
onRowClick: L,
|
|
1622
|
+
onRowDoubleClick: ae,
|
|
1624
1623
|
properties: ie,
|
|
1625
1624
|
required: At,
|
|
1626
|
-
setCheckedIndexes:
|
|
1627
|
-
setCustomColumnNames:
|
|
1628
|
-
setCustomColumnWidths:
|
|
1629
|
-
setDropTargetIndex:
|
|
1625
|
+
setCheckedIndexes: q,
|
|
1626
|
+
setCustomColumnNames: oe,
|
|
1627
|
+
setCustomColumnWidths: Oe,
|
|
1628
|
+
setDropTargetIndex: Ge,
|
|
1630
1629
|
setFilterSortColumn: Ye,
|
|
1631
|
-
setLastCheckChangedRowIndex:
|
|
1632
|
-
setMenuConfig:
|
|
1633
|
-
settingsStorageKey:
|
|
1634
|
-
sortedRenderData:
|
|
1635
|
-
sourceData:
|
|
1630
|
+
setLastCheckChangedRowIndex: ye,
|
|
1631
|
+
setMenuConfig: j,
|
|
1632
|
+
settingsStorageKey: v,
|
|
1633
|
+
sortedRenderData: V,
|
|
1634
|
+
sourceData: x,
|
|
1636
1635
|
tableDataState: l,
|
|
1637
|
-
translate:
|
|
1636
|
+
translate: k || gt
|
|
1638
1637
|
},
|
|
1639
1638
|
children: /* @__PURE__ */ F(
|
|
1640
1639
|
"div",
|
|
1641
1640
|
{
|
|
1642
|
-
className: `mig-schema-table${
|
|
1641
|
+
className: `mig-schema-table${L ? " mig-schema-table--clickable-rows" : ""}`,
|
|
1643
1642
|
ref: rt,
|
|
1644
1643
|
style: Wt,
|
|
1645
1644
|
role: "table",
|
|
@@ -1657,24 +1656,24 @@ const Cn = ({
|
|
|
1657
1656
|
type: "search",
|
|
1658
1657
|
name: "search",
|
|
1659
1658
|
autoComplete: "off",
|
|
1660
|
-
placeholder:
|
|
1659
|
+
placeholder: _e || k("search..."),
|
|
1661
1660
|
value: l.searchQuery,
|
|
1662
1661
|
onChange: Et,
|
|
1663
1662
|
onKeyDown: it,
|
|
1664
|
-
autoFocus:
|
|
1663
|
+
autoFocus: w,
|
|
1665
1664
|
onBlur: St
|
|
1666
1665
|
}
|
|
1667
1666
|
) : null }),
|
|
1668
1667
|
t ? /* @__PURE__ */ r(
|
|
1669
1668
|
t,
|
|
1670
1669
|
{
|
|
1671
|
-
...
|
|
1672
|
-
renderData:
|
|
1670
|
+
...I,
|
|
1671
|
+
renderData: V
|
|
1673
1672
|
}
|
|
1674
1673
|
) : /* @__PURE__ */ r("div", { className: "mig-schema-table__custom_element_placeholder" }),
|
|
1675
|
-
|
|
1674
|
+
$ && Array.isArray(C) ? /* @__PURE__ */ r("span", { className: "mig-schema-table__row_counter", children: k(
|
|
1676
1675
|
"showingFilteredCountOfTotalCount",
|
|
1677
|
-
|
|
1676
|
+
V?.length || 0,
|
|
1678
1677
|
C.length
|
|
1679
1678
|
) }) : null,
|
|
1680
1679
|
o ? /* @__PURE__ */ r(
|
|
@@ -1682,8 +1681,8 @@ const Cn = ({
|
|
|
1682
1681
|
{
|
|
1683
1682
|
onClick: $t,
|
|
1684
1683
|
style: { marginLeft: 8 },
|
|
1685
|
-
disabled: !
|
|
1686
|
-
children:
|
|
1684
|
+
disabled: !V?.length,
|
|
1685
|
+
children: k("exportData")
|
|
1687
1686
|
}
|
|
1688
1687
|
) : null,
|
|
1689
1688
|
B || i ? /* @__PURE__ */ r(
|
|
@@ -1692,16 +1691,16 @@ const Cn = ({
|
|
|
1692
1691
|
onClick: It,
|
|
1693
1692
|
style: { marginLeft: 8 },
|
|
1694
1693
|
disabled: l.columnFilterMap && l.searchQuery ? Object.keys(l.columnFilterMap).length + l.searchQuery.length === 0 : !1,
|
|
1695
|
-
children:
|
|
1694
|
+
children: k("clearFilters")
|
|
1696
1695
|
}
|
|
1697
1696
|
) : null,
|
|
1698
|
-
|
|
1697
|
+
v ? /* @__PURE__ */ r(
|
|
1699
1698
|
"button",
|
|
1700
1699
|
{
|
|
1701
1700
|
onClick: Ot,
|
|
1702
1701
|
style: { marginLeft: 8 },
|
|
1703
|
-
disabled: !
|
|
1704
|
-
children:
|
|
1702
|
+
disabled: !je && !Fe,
|
|
1703
|
+
children: k("clearSettings")
|
|
1705
1704
|
}
|
|
1706
1705
|
) : null
|
|
1707
1706
|
]
|
|
@@ -1712,14 +1711,14 @@ const Cn = ({
|
|
|
1712
1711
|
m,
|
|
1713
1712
|
{
|
|
1714
1713
|
height: _t,
|
|
1715
|
-
itemCount:
|
|
1716
|
-
itemSize:
|
|
1714
|
+
itemCount: xe,
|
|
1715
|
+
itemSize: Qe,
|
|
1717
1716
|
layout: "horizontal",
|
|
1718
1717
|
width: ue,
|
|
1719
1718
|
sortAsc: l.sortAsc,
|
|
1720
1719
|
setFilterSortColumn: Ye,
|
|
1721
1720
|
sortColumn: l.sortColumn,
|
|
1722
|
-
sortedRenderData:
|
|
1721
|
+
sortedRenderData: V,
|
|
1723
1722
|
className: "mig-schema-table__th-row",
|
|
1724
1723
|
children: ln
|
|
1725
1724
|
},
|
|
@@ -1732,34 +1731,34 @@ const Cn = ({
|
|
|
1732
1731
|
hn,
|
|
1733
1732
|
{
|
|
1734
1733
|
columnWidths: le,
|
|
1735
|
-
resizeColumnIndex:
|
|
1736
|
-
setResizeColumnIndex:
|
|
1737
|
-
tableBodyHeight:
|
|
1734
|
+
resizeColumnIndex: Ve,
|
|
1735
|
+
setResizeColumnIndex: Ze,
|
|
1736
|
+
tableBodyHeight: pe
|
|
1738
1737
|
}
|
|
1739
1738
|
) : null
|
|
1740
1739
|
] }),
|
|
1741
|
-
|
|
1742
|
-
|
|
1740
|
+
x && x.length === 0 ? /* @__PURE__ */ r("div", { className: "mig-schema-table__no_data", children: "No data found" }) : null,
|
|
1741
|
+
z ? Qt(
|
|
1743
1742
|
/* @__PURE__ */ r(
|
|
1744
1743
|
mn,
|
|
1745
1744
|
{
|
|
1746
|
-
isFilterable: i &&
|
|
1745
|
+
isFilterable: i && z.propConfig?.isFilterable !== !1,
|
|
1747
1746
|
isSortable: Dt(
|
|
1748
1747
|
te,
|
|
1749
|
-
|
|
1750
|
-
|
|
1748
|
+
Z.properties[z.propName],
|
|
1749
|
+
z.propConfig
|
|
1751
1750
|
),
|
|
1752
1751
|
onChange: Nt,
|
|
1753
1752
|
onClose: Lt,
|
|
1754
1753
|
onInputKeyDown: it,
|
|
1755
|
-
propConfig:
|
|
1756
|
-
propIsRequired:
|
|
1757
|
-
propName:
|
|
1758
|
-
propSchema:
|
|
1759
|
-
referenceElement:
|
|
1754
|
+
propConfig: z.propConfig,
|
|
1755
|
+
propIsRequired: z.propIsRequired,
|
|
1756
|
+
propName: z.propName,
|
|
1757
|
+
propSchema: Z.properties[z.propName],
|
|
1758
|
+
referenceElement: z.referenceElement,
|
|
1760
1759
|
setFilterSortColumn: Ye,
|
|
1761
|
-
translate:
|
|
1762
|
-
value: l.columnFilterMap ? l.columnFilterMap[
|
|
1760
|
+
translate: k,
|
|
1761
|
+
value: l.columnFilterMap ? l.columnFilterMap[z.propName] : null
|
|
1763
1762
|
}
|
|
1764
1763
|
),
|
|
1765
1764
|
document.body
|
|
@@ -1770,28 +1769,28 @@ const Cn = ({
|
|
|
1770
1769
|
}
|
|
1771
1770
|
);
|
|
1772
1771
|
}, yn = e.forwardRef(Cn), Rn = e.memo(yn), Wn = e.memo(({ refresh: t, period: s = 60 }) => {
|
|
1773
|
-
const [m, g] = e.useState(/* @__PURE__ */ new Date()), [p, h] = e.useState(/* @__PURE__ */ new Date()),
|
|
1772
|
+
const [m, g] = e.useState(/* @__PURE__ */ new Date()), [p, h] = e.useState(/* @__PURE__ */ new Date()), I = e.useCallback(() => {
|
|
1774
1773
|
h(/* @__PURE__ */ new Date()), t();
|
|
1775
1774
|
}, [t]), C = e.useMemo(
|
|
1776
1775
|
() => Jt(m, p),
|
|
1777
1776
|
[m, p]
|
|
1778
1777
|
);
|
|
1779
1778
|
e.useEffect(() => {
|
|
1780
|
-
C > s &&
|
|
1781
|
-
}, [C, m, p, s,
|
|
1782
|
-
const
|
|
1779
|
+
C > s && I();
|
|
1780
|
+
}, [C, m, p, s, I]), e.useEffect(() => {
|
|
1781
|
+
const A = setInterval(() => {
|
|
1783
1782
|
g(/* @__PURE__ */ new Date());
|
|
1784
1783
|
}, 1e3);
|
|
1785
1784
|
return () => {
|
|
1786
|
-
clearInterval(
|
|
1785
|
+
clearInterval(A);
|
|
1787
1786
|
};
|
|
1788
1787
|
}, []);
|
|
1789
|
-
const
|
|
1788
|
+
const R = s - C;
|
|
1790
1789
|
return /* @__PURE__ */ F(
|
|
1791
1790
|
"div",
|
|
1792
1791
|
{
|
|
1793
1792
|
className: "mx-auto",
|
|
1794
|
-
title: `Refresh ${
|
|
1793
|
+
title: `Refresh ${R > 0 ? `in ${R} seconds` : "NOW"}`,
|
|
1795
1794
|
children: [
|
|
1796
1795
|
"Last update ",
|
|
1797
1796
|
nt(p, "HH:mm")
|
|
@@ -1801,8 +1800,8 @@ const Cn = ({
|
|
|
1801
1800
|
});
|
|
1802
1801
|
export {
|
|
1803
1802
|
kt as DEFAULT_DATE_FORMAT,
|
|
1804
|
-
|
|
1805
|
-
|
|
1803
|
+
Je as DEFAULT_DATE_TIME_FORMAT,
|
|
1804
|
+
$e as EColumnFilterStatus,
|
|
1806
1805
|
xt as MINIMUM_COLUMN_WIDTH,
|
|
1807
1806
|
nn as RESIZER_WIDTH,
|
|
1808
1807
|
Wn as Refresher,
|