jc-react-datatable 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jc-react-datatable.css +263 -0
- package/dist/jc-react-datatable.es.js +894 -1469
- package/dist/jc-react-datatable.umd.js +1077 -51
- package/package.json +6 -4
- package/dist/style.css +0 -1
|
@@ -1,1651 +1,1076 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
3
|
+
import require$$0 from "react-is";
|
|
4
|
+
function getDefaultExportFromCjs(x) {
|
|
5
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
6
|
}
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (tr)
|
|
18
|
-
return Ee;
|
|
19
|
-
tr = 1;
|
|
20
|
-
var r = Ye, h = Symbol.for("react.element"), b = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, p = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
-
function y(i, d, f) {
|
|
22
|
-
var v, g = {}, k = null, P = null;
|
|
23
|
-
f !== void 0 && (k = "" + f), d.key !== void 0 && (k = "" + d.key), d.ref !== void 0 && (P = d.ref);
|
|
24
|
-
for (v in d)
|
|
25
|
-
a.call(d, v) && !u.hasOwnProperty(v) && (g[v] = d[v]);
|
|
26
|
-
if (i && i.defaultProps)
|
|
27
|
-
for (v in d = i.defaultProps, d)
|
|
28
|
-
g[v] === void 0 && (g[v] = d[v]);
|
|
29
|
-
return { $$typeof: h, type: i, key: k, ref: P, props: g, _owner: p.current };
|
|
30
|
-
}
|
|
31
|
-
return Ee.Fragment = b, Ee.jsx = y, Ee.jsxs = y, Ee;
|
|
32
|
-
}
|
|
33
|
-
var Te = {};
|
|
34
|
-
/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-jsx-runtime.development.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
var nr;
|
|
44
|
-
function Ur() {
|
|
45
|
-
return nr || (nr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
46
|
-
var r = Ye, h = Symbol.for("react.element"), b = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), i = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), Y = Symbol.iterator, N = "@@iterator";
|
|
47
|
-
function B(e) {
|
|
48
|
-
if (e === null || typeof e != "object")
|
|
49
|
-
return null;
|
|
50
|
-
var t = Y && e[Y] || e[N];
|
|
51
|
-
return typeof t == "function" ? t : null;
|
|
52
|
-
}
|
|
53
|
-
var V = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
54
|
-
function W(e) {
|
|
55
|
-
{
|
|
56
|
-
for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), m = 1; m < t; m++)
|
|
57
|
-
o[m - 1] = arguments[m];
|
|
58
|
-
U("error", e, o);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function U(e, t, o) {
|
|
62
|
-
{
|
|
63
|
-
var m = V.ReactDebugCurrentFrame, D = m.getStackAddendum();
|
|
64
|
-
D !== "" && (t += "%s", o = o.concat([D]));
|
|
65
|
-
var q = o.map(function($) {
|
|
66
|
-
return String($);
|
|
67
|
-
});
|
|
68
|
-
q.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, q);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
var L = !1, c = !1, te = !1, ie = !1, be = !1, ce;
|
|
72
|
-
ce = Symbol.for("react.module.reference");
|
|
73
|
-
function he(e) {
|
|
74
|
-
return !!(typeof e == "string" || typeof e == "function" || e === a || e === u || be || e === p || e === f || e === v || ie || e === P || L || c || te || typeof e == "object" && e !== null && (e.$$typeof === k || e.$$typeof === g || e.$$typeof === y || e.$$typeof === i || e.$$typeof === d || // This needs to include all possible module reference object
|
|
75
|
-
// types supported by any Flight configuration anywhere since
|
|
76
|
-
// we don't know which Flight build this will end up being used
|
|
77
|
-
// with.
|
|
78
|
-
e.$$typeof === ce || e.getModuleId !== void 0));
|
|
79
|
-
}
|
|
80
|
-
function fe(e, t, o) {
|
|
81
|
-
var m = e.displayName;
|
|
82
|
-
if (m)
|
|
83
|
-
return m;
|
|
84
|
-
var D = t.displayName || t.name || "";
|
|
85
|
-
return D !== "" ? o + "(" + D + ")" : o;
|
|
86
|
-
}
|
|
87
|
-
function le(e) {
|
|
88
|
-
return e.displayName || "Context";
|
|
89
|
-
}
|
|
90
|
-
function G(e) {
|
|
91
|
-
if (e == null)
|
|
92
|
-
return null;
|
|
93
|
-
if (typeof e.tag == "number" && W("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
94
|
-
return e.displayName || e.name || null;
|
|
95
|
-
if (typeof e == "string")
|
|
96
|
-
return e;
|
|
97
|
-
switch (e) {
|
|
98
|
-
case a:
|
|
99
|
-
return "Fragment";
|
|
100
|
-
case b:
|
|
101
|
-
return "Portal";
|
|
102
|
-
case u:
|
|
103
|
-
return "Profiler";
|
|
104
|
-
case p:
|
|
105
|
-
return "StrictMode";
|
|
106
|
-
case f:
|
|
107
|
-
return "Suspense";
|
|
108
|
-
case v:
|
|
109
|
-
return "SuspenseList";
|
|
110
|
-
}
|
|
111
|
-
if (typeof e == "object")
|
|
112
|
-
switch (e.$$typeof) {
|
|
113
|
-
case i:
|
|
114
|
-
var t = e;
|
|
115
|
-
return le(t) + ".Consumer";
|
|
116
|
-
case y:
|
|
117
|
-
var o = e;
|
|
118
|
-
return le(o._context) + ".Provider";
|
|
119
|
-
case d:
|
|
120
|
-
return fe(e, e.render, "ForwardRef");
|
|
121
|
-
case g:
|
|
122
|
-
var m = e.displayName || null;
|
|
123
|
-
return m !== null ? m : G(e.type) || "Memo";
|
|
124
|
-
case k: {
|
|
125
|
-
var D = e, q = D._payload, $ = D._init;
|
|
126
|
-
try {
|
|
127
|
-
return G($(q));
|
|
128
|
-
} catch {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
var X = Object.assign, ae = 0, Q, ne, oe, de, n, l, x;
|
|
136
|
-
function j() {
|
|
137
|
-
}
|
|
138
|
-
j.__reactDisabledLog = !0;
|
|
139
|
-
function T() {
|
|
140
|
-
{
|
|
141
|
-
if (ae === 0) {
|
|
142
|
-
Q = console.log, ne = console.info, oe = console.warn, de = console.error, n = console.group, l = console.groupCollapsed, x = console.groupEnd;
|
|
143
|
-
var e = {
|
|
144
|
-
configurable: !0,
|
|
145
|
-
enumerable: !0,
|
|
146
|
-
value: j,
|
|
147
|
-
writable: !0
|
|
148
|
-
};
|
|
149
|
-
Object.defineProperties(console, {
|
|
150
|
-
info: e,
|
|
151
|
-
log: e,
|
|
152
|
-
warn: e,
|
|
153
|
-
error: e,
|
|
154
|
-
group: e,
|
|
155
|
-
groupCollapsed: e,
|
|
156
|
-
groupEnd: e
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
ae++;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function A() {
|
|
163
|
-
{
|
|
164
|
-
if (ae--, ae === 0) {
|
|
165
|
-
var e = {
|
|
166
|
-
configurable: !0,
|
|
167
|
-
enumerable: !0,
|
|
168
|
-
writable: !0
|
|
169
|
-
};
|
|
170
|
-
Object.defineProperties(console, {
|
|
171
|
-
log: X({}, e, {
|
|
172
|
-
value: Q
|
|
173
|
-
}),
|
|
174
|
-
info: X({}, e, {
|
|
175
|
-
value: ne
|
|
176
|
-
}),
|
|
177
|
-
warn: X({}, e, {
|
|
178
|
-
value: oe
|
|
179
|
-
}),
|
|
180
|
-
error: X({}, e, {
|
|
181
|
-
value: de
|
|
182
|
-
}),
|
|
183
|
-
group: X({}, e, {
|
|
184
|
-
value: n
|
|
185
|
-
}),
|
|
186
|
-
groupCollapsed: X({}, e, {
|
|
187
|
-
value: l
|
|
188
|
-
}),
|
|
189
|
-
groupEnd: X({}, e, {
|
|
190
|
-
value: x
|
|
191
|
-
})
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
ae < 0 && W("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
var R = V.ReactCurrentDispatcher, _;
|
|
198
|
-
function O(e, t, o) {
|
|
199
|
-
{
|
|
200
|
-
if (_ === void 0)
|
|
201
|
-
try {
|
|
202
|
-
throw Error();
|
|
203
|
-
} catch (D) {
|
|
204
|
-
var m = D.stack.trim().match(/\n( *(at )?)/);
|
|
205
|
-
_ = m && m[1] || "";
|
|
206
|
-
}
|
|
207
|
-
return `
|
|
208
|
-
` + _ + e;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
var I = !1, C;
|
|
212
|
-
{
|
|
213
|
-
var H = typeof WeakMap == "function" ? WeakMap : Map;
|
|
214
|
-
C = new H();
|
|
215
|
-
}
|
|
216
|
-
function s(e, t) {
|
|
217
|
-
if (!e || I)
|
|
218
|
-
return "";
|
|
219
|
-
{
|
|
220
|
-
var o = C.get(e);
|
|
221
|
-
if (o !== void 0)
|
|
222
|
-
return o;
|
|
223
|
-
}
|
|
224
|
-
var m;
|
|
225
|
-
I = !0;
|
|
226
|
-
var D = Error.prepareStackTrace;
|
|
227
|
-
Error.prepareStackTrace = void 0;
|
|
228
|
-
var q;
|
|
229
|
-
q = R.current, R.current = null, T();
|
|
230
|
-
try {
|
|
231
|
-
if (t) {
|
|
232
|
-
var $ = function() {
|
|
233
|
-
throw Error();
|
|
234
|
-
};
|
|
235
|
-
if (Object.defineProperty($.prototype, "props", {
|
|
236
|
-
set: function() {
|
|
237
|
-
throw Error();
|
|
238
|
-
}
|
|
239
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
240
|
-
try {
|
|
241
|
-
Reflect.construct($, []);
|
|
242
|
-
} catch (Z) {
|
|
243
|
-
m = Z;
|
|
244
|
-
}
|
|
245
|
-
Reflect.construct(e, [], $);
|
|
246
|
-
} else {
|
|
247
|
-
try {
|
|
248
|
-
$.call();
|
|
249
|
-
} catch (Z) {
|
|
250
|
-
m = Z;
|
|
251
|
-
}
|
|
252
|
-
e.call($.prototype);
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
try {
|
|
256
|
-
throw Error();
|
|
257
|
-
} catch (Z) {
|
|
258
|
-
m = Z;
|
|
259
|
-
}
|
|
260
|
-
e();
|
|
261
|
-
}
|
|
262
|
-
} catch (Z) {
|
|
263
|
-
if (Z && m && typeof Z.stack == "string") {
|
|
264
|
-
for (var w = Z.stack.split(`
|
|
265
|
-
`), K = m.stack.split(`
|
|
266
|
-
`), z = w.length - 1, J = K.length - 1; z >= 1 && J >= 0 && w[z] !== K[J]; )
|
|
267
|
-
J--;
|
|
268
|
-
for (; z >= 1 && J >= 0; z--, J--)
|
|
269
|
-
if (w[z] !== K[J]) {
|
|
270
|
-
if (z !== 1 || J !== 1)
|
|
271
|
-
do
|
|
272
|
-
if (z--, J--, J < 0 || w[z] !== K[J]) {
|
|
273
|
-
var re = `
|
|
274
|
-
` + w[z].replace(" at new ", " at ");
|
|
275
|
-
return e.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", e.displayName)), typeof e == "function" && C.set(e, re), re;
|
|
276
|
-
}
|
|
277
|
-
while (z >= 1 && J >= 0);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
} finally {
|
|
282
|
-
I = !1, R.current = q, A(), Error.prepareStackTrace = D;
|
|
283
|
-
}
|
|
284
|
-
var ye = e ? e.displayName || e.name : "", ue = ye ? O(ye) : "";
|
|
285
|
-
return typeof e == "function" && C.set(e, ue), ue;
|
|
286
|
-
}
|
|
287
|
-
function ee(e, t, o) {
|
|
288
|
-
return s(e, !1);
|
|
289
|
-
}
|
|
290
|
-
function ve(e) {
|
|
291
|
-
var t = e.prototype;
|
|
292
|
-
return !!(t && t.isReactComponent);
|
|
293
|
-
}
|
|
294
|
-
function se(e, t, o) {
|
|
295
|
-
if (e == null)
|
|
296
|
-
return "";
|
|
297
|
-
if (typeof e == "function")
|
|
298
|
-
return s(e, ve(e));
|
|
299
|
-
if (typeof e == "string")
|
|
300
|
-
return O(e);
|
|
301
|
-
switch (e) {
|
|
302
|
-
case f:
|
|
303
|
-
return O("Suspense");
|
|
304
|
-
case v:
|
|
305
|
-
return O("SuspenseList");
|
|
306
|
-
}
|
|
307
|
-
if (typeof e == "object")
|
|
308
|
-
switch (e.$$typeof) {
|
|
309
|
-
case d:
|
|
310
|
-
return ee(e.render);
|
|
311
|
-
case g:
|
|
312
|
-
return se(e.type, t, o);
|
|
313
|
-
case k: {
|
|
314
|
-
var m = e, D = m._payload, q = m._init;
|
|
315
|
-
try {
|
|
316
|
-
return se(q(D), t, o);
|
|
317
|
-
} catch {
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
return "";
|
|
322
|
-
}
|
|
323
|
-
var ge = Object.prototype.hasOwnProperty, Ve = {}, Ue = V.ReactDebugCurrentFrame;
|
|
324
|
-
function _e(e) {
|
|
325
|
-
if (e) {
|
|
326
|
-
var t = e._owner, o = se(e.type, e._source, t ? t.type : null);
|
|
327
|
-
Ue.setExtraStackFrame(o);
|
|
328
|
-
} else
|
|
329
|
-
Ue.setExtraStackFrame(null);
|
|
330
|
-
}
|
|
331
|
-
function Er(e, t, o, m, D) {
|
|
332
|
-
{
|
|
333
|
-
var q = Function.call.bind(ge);
|
|
334
|
-
for (var $ in e)
|
|
335
|
-
if (q(e, $)) {
|
|
336
|
-
var w = void 0;
|
|
337
|
-
try {
|
|
338
|
-
if (typeof e[$] != "function") {
|
|
339
|
-
var K = Error((m || "React class") + ": " + o + " type `" + $ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[$] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
340
|
-
throw K.name = "Invariant Violation", K;
|
|
341
|
-
}
|
|
342
|
-
w = e[$](t, $, m, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
343
|
-
} catch (z) {
|
|
344
|
-
w = z;
|
|
345
|
-
}
|
|
346
|
-
w && !(w instanceof Error) && (_e(D), W("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", o, $, typeof w), _e(null)), w instanceof Error && !(w.message in Ve) && (Ve[w.message] = !0, _e(D), W("Failed %s type: %s", o, w.message), _e(null));
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
var Tr = Array.isArray;
|
|
351
|
-
function je(e) {
|
|
352
|
-
return Tr(e);
|
|
353
|
-
}
|
|
354
|
-
function Rr(e) {
|
|
355
|
-
{
|
|
356
|
-
var t = typeof Symbol == "function" && Symbol.toStringTag, o = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
357
|
-
return o;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function _r(e) {
|
|
361
|
-
try {
|
|
362
|
-
return ze(e), !1;
|
|
363
|
-
} catch {
|
|
364
|
-
return !0;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
function ze(e) {
|
|
368
|
-
return "" + e;
|
|
369
|
-
}
|
|
370
|
-
function Be(e) {
|
|
371
|
-
if (_r(e))
|
|
372
|
-
return W("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Rr(e)), ze(e);
|
|
373
|
-
}
|
|
374
|
-
var me = V.ReactCurrentOwner, Sr = {
|
|
375
|
-
key: !0,
|
|
376
|
-
ref: !0,
|
|
377
|
-
__self: !0,
|
|
378
|
-
__source: !0
|
|
379
|
-
}, Je, He, xe;
|
|
380
|
-
xe = {};
|
|
381
|
-
function Pr(e) {
|
|
382
|
-
if (ge.call(e, "ref")) {
|
|
383
|
-
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
384
|
-
if (t && t.isReactWarning)
|
|
385
|
-
return !1;
|
|
386
|
-
}
|
|
387
|
-
return e.ref !== void 0;
|
|
388
|
-
}
|
|
389
|
-
function jr(e) {
|
|
390
|
-
if (ge.call(e, "key")) {
|
|
391
|
-
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
392
|
-
if (t && t.isReactWarning)
|
|
393
|
-
return !1;
|
|
394
|
-
}
|
|
395
|
-
return e.key !== void 0;
|
|
396
|
-
}
|
|
397
|
-
function xr(e, t) {
|
|
398
|
-
if (typeof e.ref == "string" && me.current && t && me.current.stateNode !== t) {
|
|
399
|
-
var o = G(me.current.type);
|
|
400
|
-
xe[o] || (W('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(me.current.type), e.ref), xe[o] = !0);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
function Or(e, t) {
|
|
404
|
-
{
|
|
405
|
-
var o = function() {
|
|
406
|
-
Je || (Je = !0, W("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
407
|
-
};
|
|
408
|
-
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
409
|
-
get: o,
|
|
410
|
-
configurable: !0
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
function Cr(e, t) {
|
|
415
|
-
{
|
|
416
|
-
var o = function() {
|
|
417
|
-
He || (He = !0, W("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
418
|
-
};
|
|
419
|
-
o.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
420
|
-
get: o,
|
|
421
|
-
configurable: !0
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
var wr = function(e, t, o, m, D, q, $) {
|
|
426
|
-
var w = {
|
|
427
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
428
|
-
$$typeof: h,
|
|
429
|
-
// Built-in properties that belong on the element
|
|
430
|
-
type: e,
|
|
431
|
-
key: t,
|
|
432
|
-
ref: o,
|
|
433
|
-
props: $,
|
|
434
|
-
// Record the component responsible for creating this element.
|
|
435
|
-
_owner: q
|
|
436
|
-
};
|
|
437
|
-
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
438
|
-
configurable: !1,
|
|
439
|
-
enumerable: !1,
|
|
440
|
-
writable: !0,
|
|
441
|
-
value: !1
|
|
442
|
-
}), Object.defineProperty(w, "_self", {
|
|
443
|
-
configurable: !1,
|
|
444
|
-
enumerable: !1,
|
|
445
|
-
writable: !1,
|
|
446
|
-
value: m
|
|
447
|
-
}), Object.defineProperty(w, "_source", {
|
|
448
|
-
configurable: !1,
|
|
449
|
-
enumerable: !1,
|
|
450
|
-
writable: !1,
|
|
451
|
-
value: D
|
|
452
|
-
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
453
|
-
};
|
|
454
|
-
function kr(e, t, o, m, D) {
|
|
455
|
-
{
|
|
456
|
-
var q, $ = {}, w = null, K = null;
|
|
457
|
-
o !== void 0 && (Be(o), w = "" + o), jr(t) && (Be(t.key), w = "" + t.key), Pr(t) && (K = t.ref, xr(t, D));
|
|
458
|
-
for (q in t)
|
|
459
|
-
ge.call(t, q) && !Sr.hasOwnProperty(q) && ($[q] = t[q]);
|
|
460
|
-
if (e && e.defaultProps) {
|
|
461
|
-
var z = e.defaultProps;
|
|
462
|
-
for (q in z)
|
|
463
|
-
$[q] === void 0 && ($[q] = z[q]);
|
|
464
|
-
}
|
|
465
|
-
if (w || K) {
|
|
466
|
-
var J = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
467
|
-
w && Or($, J), K && Cr($, J);
|
|
468
|
-
}
|
|
469
|
-
return wr(e, w, K, D, m, me.current, $);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
var Oe = V.ReactCurrentOwner, Ke = V.ReactDebugCurrentFrame;
|
|
473
|
-
function pe(e) {
|
|
474
|
-
if (e) {
|
|
475
|
-
var t = e._owner, o = se(e.type, e._source, t ? t.type : null);
|
|
476
|
-
Ke.setExtraStackFrame(o);
|
|
477
|
-
} else
|
|
478
|
-
Ke.setExtraStackFrame(null);
|
|
479
|
-
}
|
|
480
|
-
var Ce;
|
|
481
|
-
Ce = !1;
|
|
482
|
-
function we(e) {
|
|
483
|
-
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
484
|
-
}
|
|
485
|
-
function Ge() {
|
|
486
|
-
{
|
|
487
|
-
if (Oe.current) {
|
|
488
|
-
var e = G(Oe.current.type);
|
|
489
|
-
if (e)
|
|
490
|
-
return `
|
|
491
|
-
|
|
492
|
-
Check the render method of \`` + e + "`.";
|
|
493
|
-
}
|
|
494
|
-
return "";
|
|
495
|
-
}
|
|
7
|
+
var propTypes = { exports: {} };
|
|
8
|
+
var objectAssign;
|
|
9
|
+
var hasRequiredObjectAssign;
|
|
10
|
+
function requireObjectAssign() {
|
|
11
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
12
|
+
hasRequiredObjectAssign = 1;
|
|
13
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
14
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
15
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
function toObject(val) {
|
|
17
|
+
if (val === null || val === void 0) {
|
|
18
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
496
19
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
Check your code at ` + t + ":" + o + ".";
|
|
504
|
-
}
|
|
505
|
-
return "";
|
|
20
|
+
return Object(val);
|
|
21
|
+
}
|
|
22
|
+
function shouldUseNative() {
|
|
23
|
+
try {
|
|
24
|
+
if (!Object.assign) {
|
|
25
|
+
return false;
|
|
506
26
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
var t = Ge();
|
|
512
|
-
if (!t) {
|
|
513
|
-
var o = typeof e == "string" ? e : e.displayName || e.name;
|
|
514
|
-
o && (t = `
|
|
515
|
-
|
|
516
|
-
Check the top-level render call using <` + o + ">.");
|
|
517
|
-
}
|
|
518
|
-
return t;
|
|
27
|
+
var test1 = new String("abc");
|
|
28
|
+
test1[5] = "de";
|
|
29
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
30
|
+
return false;
|
|
519
31
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
524
|
-
return;
|
|
525
|
-
e._store.validated = !0;
|
|
526
|
-
var o = $r(t);
|
|
527
|
-
if (Xe[o])
|
|
528
|
-
return;
|
|
529
|
-
Xe[o] = !0;
|
|
530
|
-
var m = "";
|
|
531
|
-
e && e._owner && e._owner !== Oe.current && (m = " It was passed a child from " + G(e._owner.type) + "."), pe(e), W('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, m), pe(null);
|
|
32
|
+
var test2 = {};
|
|
33
|
+
for (var i = 0; i < 10; i++) {
|
|
34
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
532
35
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
if (je(e))
|
|
539
|
-
for (var o = 0; o < e.length; o++) {
|
|
540
|
-
var m = e[o];
|
|
541
|
-
we(m) && Ze(m, t);
|
|
542
|
-
}
|
|
543
|
-
else if (we(e))
|
|
544
|
-
e._store && (e._store.validated = !0);
|
|
545
|
-
else if (e) {
|
|
546
|
-
var D = B(e);
|
|
547
|
-
if (typeof D == "function" && D !== e.entries)
|
|
548
|
-
for (var q = D.call(e), $; !($ = q.next()).done; )
|
|
549
|
-
we($.value) && Ze($.value, t);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
function Ir(e) {
|
|
554
|
-
{
|
|
555
|
-
var t = e.type;
|
|
556
|
-
if (t == null || typeof t == "string")
|
|
557
|
-
return;
|
|
558
|
-
var o;
|
|
559
|
-
if (typeof t == "function")
|
|
560
|
-
o = t.propTypes;
|
|
561
|
-
else if (typeof t == "object" && (t.$$typeof === d || // Note: Memo only checks outer props here.
|
|
562
|
-
// Inner props are checked in the reconciler.
|
|
563
|
-
t.$$typeof === g))
|
|
564
|
-
o = t.propTypes;
|
|
565
|
-
else
|
|
566
|
-
return;
|
|
567
|
-
if (o) {
|
|
568
|
-
var m = G(t);
|
|
569
|
-
Er(o, e.props, "prop", m, e);
|
|
570
|
-
} else if (t.PropTypes !== void 0 && !Ce) {
|
|
571
|
-
Ce = !0;
|
|
572
|
-
var D = G(t);
|
|
573
|
-
W("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
|
|
574
|
-
}
|
|
575
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && W("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
36
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
37
|
+
return test2[n];
|
|
38
|
+
});
|
|
39
|
+
if (order2.join("") !== "0123456789") {
|
|
40
|
+
return false;
|
|
576
41
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
pe(e), W("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), pe(null);
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
e.ref !== null && (pe(e), W("Invalid attribute `ref` supplied to `React.Fragment`."), pe(null));
|
|
42
|
+
var test3 = {};
|
|
43
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
44
|
+
test3[letter] = letter;
|
|
45
|
+
});
|
|
46
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
47
|
+
return false;
|
|
588
48
|
}
|
|
49
|
+
return true;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
return false;
|
|
589
52
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
e === null ? z = "null" : je(e) ? z = "array" : e !== void 0 && e.$$typeof === h ? (z = "<" + (G(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : z = typeof e, W("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", z, w);
|
|
601
|
-
}
|
|
602
|
-
var J = kr(e, t, o, D, q);
|
|
603
|
-
if (J == null)
|
|
604
|
-
return J;
|
|
605
|
-
if ($) {
|
|
606
|
-
var re = t.children;
|
|
607
|
-
if (re !== void 0)
|
|
608
|
-
if (m)
|
|
609
|
-
if (je(re)) {
|
|
610
|
-
for (var ye = 0; ye < re.length; ye++)
|
|
611
|
-
Qe(re[ye], e);
|
|
612
|
-
Object.freeze && Object.freeze(re);
|
|
613
|
-
} else
|
|
614
|
-
W("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
615
|
-
else
|
|
616
|
-
Qe(re, e);
|
|
617
|
-
}
|
|
618
|
-
if (ge.call(t, "key")) {
|
|
619
|
-
var ue = G(e), Z = Object.keys(t).filter(function(Wr) {
|
|
620
|
-
return Wr !== "key";
|
|
621
|
-
}), ke = Z.length > 0 ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
622
|
-
if (!er[ue + ke]) {
|
|
623
|
-
var Yr = Z.length > 0 ? "{" + Z.join(": ..., ") + ": ...}" : "{}";
|
|
624
|
-
W(`A props object containing a "key" prop is being spread into JSX:
|
|
625
|
-
let props = %s;
|
|
626
|
-
<%s {...props} />
|
|
627
|
-
React keys must be passed directly to JSX without using spread:
|
|
628
|
-
let props = %s;
|
|
629
|
-
<%s key={someKey} {...props} />`, ke, ue, Yr, ue), er[ue + ke] = !0;
|
|
630
|
-
}
|
|
53
|
+
}
|
|
54
|
+
objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
|
|
55
|
+
var from;
|
|
56
|
+
var to = toObject(target);
|
|
57
|
+
var symbols;
|
|
58
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
59
|
+
from = Object(arguments[s]);
|
|
60
|
+
for (var key in from) {
|
|
61
|
+
if (hasOwnProperty.call(from, key)) {
|
|
62
|
+
to[key] = from[key];
|
|
631
63
|
}
|
|
632
|
-
return e === a ? Dr(J) : Ir(J), J;
|
|
633
64
|
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
return rr(e, t, o, !1);
|
|
640
|
-
}
|
|
641
|
-
var qr = Mr, Nr = Fr;
|
|
642
|
-
Te.Fragment = a, Te.jsx = qr, Te.jsxs = Nr;
|
|
643
|
-
}()), Te;
|
|
644
|
-
}
|
|
645
|
-
process.env.NODE_ENV === "production" ? qe.exports = Vr() : qe.exports = Ur();
|
|
646
|
-
var S = qe.exports, Ne = { exports: {} }, Se = { exports: {} }, F = {};
|
|
647
|
-
/** @license React v16.13.1
|
|
648
|
-
* react-is.production.min.js
|
|
649
|
-
*
|
|
650
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
651
|
-
*
|
|
652
|
-
* This source code is licensed under the MIT license found in the
|
|
653
|
-
* LICENSE file in the root directory of this source tree.
|
|
654
|
-
*/
|
|
655
|
-
var ar;
|
|
656
|
-
function zr() {
|
|
657
|
-
if (ar)
|
|
658
|
-
return F;
|
|
659
|
-
ar = 1;
|
|
660
|
-
var r = typeof Symbol == "function" && Symbol.for, h = r ? Symbol.for("react.element") : 60103, b = r ? Symbol.for("react.portal") : 60106, a = r ? Symbol.for("react.fragment") : 60107, p = r ? Symbol.for("react.strict_mode") : 60108, u = r ? Symbol.for("react.profiler") : 60114, y = r ? Symbol.for("react.provider") : 60109, i = r ? Symbol.for("react.context") : 60110, d = r ? Symbol.for("react.async_mode") : 60111, f = r ? Symbol.for("react.concurrent_mode") : 60111, v = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, k = r ? Symbol.for("react.suspense_list") : 60120, P = r ? Symbol.for("react.memo") : 60115, Y = r ? Symbol.for("react.lazy") : 60116, N = r ? Symbol.for("react.block") : 60121, B = r ? Symbol.for("react.fundamental") : 60117, V = r ? Symbol.for("react.responder") : 60118, W = r ? Symbol.for("react.scope") : 60119;
|
|
661
|
-
function U(c) {
|
|
662
|
-
if (typeof c == "object" && c !== null) {
|
|
663
|
-
var te = c.$$typeof;
|
|
664
|
-
switch (te) {
|
|
665
|
-
case h:
|
|
666
|
-
switch (c = c.type, c) {
|
|
667
|
-
case d:
|
|
668
|
-
case f:
|
|
669
|
-
case a:
|
|
670
|
-
case u:
|
|
671
|
-
case p:
|
|
672
|
-
case g:
|
|
673
|
-
return c;
|
|
674
|
-
default:
|
|
675
|
-
switch (c = c && c.$$typeof, c) {
|
|
676
|
-
case i:
|
|
677
|
-
case v:
|
|
678
|
-
case Y:
|
|
679
|
-
case P:
|
|
680
|
-
case y:
|
|
681
|
-
return c;
|
|
682
|
-
default:
|
|
683
|
-
return te;
|
|
684
|
-
}
|
|
65
|
+
if (getOwnPropertySymbols) {
|
|
66
|
+
symbols = getOwnPropertySymbols(from);
|
|
67
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
68
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
69
|
+
to[symbols[i]] = from[symbols[i]];
|
|
685
70
|
}
|
|
686
|
-
case b:
|
|
687
|
-
return te;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
function L(c) {
|
|
692
|
-
return U(c) === f;
|
|
693
|
-
}
|
|
694
|
-
return F.AsyncMode = d, F.ConcurrentMode = f, F.ContextConsumer = i, F.ContextProvider = y, F.Element = h, F.ForwardRef = v, F.Fragment = a, F.Lazy = Y, F.Memo = P, F.Portal = b, F.Profiler = u, F.StrictMode = p, F.Suspense = g, F.isAsyncMode = function(c) {
|
|
695
|
-
return L(c) || U(c) === d;
|
|
696
|
-
}, F.isConcurrentMode = L, F.isContextConsumer = function(c) {
|
|
697
|
-
return U(c) === i;
|
|
698
|
-
}, F.isContextProvider = function(c) {
|
|
699
|
-
return U(c) === y;
|
|
700
|
-
}, F.isElement = function(c) {
|
|
701
|
-
return typeof c == "object" && c !== null && c.$$typeof === h;
|
|
702
|
-
}, F.isForwardRef = function(c) {
|
|
703
|
-
return U(c) === v;
|
|
704
|
-
}, F.isFragment = function(c) {
|
|
705
|
-
return U(c) === a;
|
|
706
|
-
}, F.isLazy = function(c) {
|
|
707
|
-
return U(c) === Y;
|
|
708
|
-
}, F.isMemo = function(c) {
|
|
709
|
-
return U(c) === P;
|
|
710
|
-
}, F.isPortal = function(c) {
|
|
711
|
-
return U(c) === b;
|
|
712
|
-
}, F.isProfiler = function(c) {
|
|
713
|
-
return U(c) === u;
|
|
714
|
-
}, F.isStrictMode = function(c) {
|
|
715
|
-
return U(c) === p;
|
|
716
|
-
}, F.isSuspense = function(c) {
|
|
717
|
-
return U(c) === g;
|
|
718
|
-
}, F.isValidElementType = function(c) {
|
|
719
|
-
return typeof c == "string" || typeof c == "function" || c === a || c === f || c === u || c === p || c === g || c === k || typeof c == "object" && c !== null && (c.$$typeof === Y || c.$$typeof === P || c.$$typeof === y || c.$$typeof === i || c.$$typeof === v || c.$$typeof === B || c.$$typeof === V || c.$$typeof === W || c.$$typeof === N);
|
|
720
|
-
}, F.typeOf = U, F;
|
|
721
|
-
}
|
|
722
|
-
var M = {};
|
|
723
|
-
/** @license React v16.13.1
|
|
724
|
-
* react-is.development.js
|
|
725
|
-
*
|
|
726
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
727
|
-
*
|
|
728
|
-
* This source code is licensed under the MIT license found in the
|
|
729
|
-
* LICENSE file in the root directory of this source tree.
|
|
730
|
-
*/
|
|
731
|
-
var ir;
|
|
732
|
-
function Br() {
|
|
733
|
-
return ir || (ir = 1, process.env.NODE_ENV !== "production" && function() {
|
|
734
|
-
var r = typeof Symbol == "function" && Symbol.for, h = r ? Symbol.for("react.element") : 60103, b = r ? Symbol.for("react.portal") : 60106, a = r ? Symbol.for("react.fragment") : 60107, p = r ? Symbol.for("react.strict_mode") : 60108, u = r ? Symbol.for("react.profiler") : 60114, y = r ? Symbol.for("react.provider") : 60109, i = r ? Symbol.for("react.context") : 60110, d = r ? Symbol.for("react.async_mode") : 60111, f = r ? Symbol.for("react.concurrent_mode") : 60111, v = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, k = r ? Symbol.for("react.suspense_list") : 60120, P = r ? Symbol.for("react.memo") : 60115, Y = r ? Symbol.for("react.lazy") : 60116, N = r ? Symbol.for("react.block") : 60121, B = r ? Symbol.for("react.fundamental") : 60117, V = r ? Symbol.for("react.responder") : 60118, W = r ? Symbol.for("react.scope") : 60119;
|
|
735
|
-
function U(s) {
|
|
736
|
-
return typeof s == "string" || typeof s == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
737
|
-
s === a || s === f || s === u || s === p || s === g || s === k || typeof s == "object" && s !== null && (s.$$typeof === Y || s.$$typeof === P || s.$$typeof === y || s.$$typeof === i || s.$$typeof === v || s.$$typeof === B || s.$$typeof === V || s.$$typeof === W || s.$$typeof === N);
|
|
738
|
-
}
|
|
739
|
-
function L(s) {
|
|
740
|
-
if (typeof s == "object" && s !== null) {
|
|
741
|
-
var ee = s.$$typeof;
|
|
742
|
-
switch (ee) {
|
|
743
|
-
case h:
|
|
744
|
-
var ve = s.type;
|
|
745
|
-
switch (ve) {
|
|
746
|
-
case d:
|
|
747
|
-
case f:
|
|
748
|
-
case a:
|
|
749
|
-
case u:
|
|
750
|
-
case p:
|
|
751
|
-
case g:
|
|
752
|
-
return ve;
|
|
753
|
-
default:
|
|
754
|
-
var se = ve && ve.$$typeof;
|
|
755
|
-
switch (se) {
|
|
756
|
-
case i:
|
|
757
|
-
case v:
|
|
758
|
-
case Y:
|
|
759
|
-
case P:
|
|
760
|
-
case y:
|
|
761
|
-
return se;
|
|
762
|
-
default:
|
|
763
|
-
return ee;
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
case b:
|
|
767
|
-
return ee;
|
|
768
71
|
}
|
|
769
72
|
}
|
|
770
73
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
function n(s) {
|
|
776
|
-
return L(s) === f;
|
|
777
|
-
}
|
|
778
|
-
function l(s) {
|
|
779
|
-
return L(s) === i;
|
|
780
|
-
}
|
|
781
|
-
function x(s) {
|
|
782
|
-
return L(s) === y;
|
|
783
|
-
}
|
|
784
|
-
function j(s) {
|
|
785
|
-
return typeof s == "object" && s !== null && s.$$typeof === h;
|
|
786
|
-
}
|
|
787
|
-
function T(s) {
|
|
788
|
-
return L(s) === v;
|
|
789
|
-
}
|
|
790
|
-
function A(s) {
|
|
791
|
-
return L(s) === a;
|
|
792
|
-
}
|
|
793
|
-
function R(s) {
|
|
794
|
-
return L(s) === Y;
|
|
795
|
-
}
|
|
796
|
-
function _(s) {
|
|
797
|
-
return L(s) === P;
|
|
798
|
-
}
|
|
799
|
-
function O(s) {
|
|
800
|
-
return L(s) === b;
|
|
801
|
-
}
|
|
802
|
-
function I(s) {
|
|
803
|
-
return L(s) === u;
|
|
804
|
-
}
|
|
805
|
-
function C(s) {
|
|
806
|
-
return L(s) === p;
|
|
807
|
-
}
|
|
808
|
-
function H(s) {
|
|
809
|
-
return L(s) === g;
|
|
810
|
-
}
|
|
811
|
-
M.AsyncMode = c, M.ConcurrentMode = te, M.ContextConsumer = ie, M.ContextProvider = be, M.Element = ce, M.ForwardRef = he, M.Fragment = fe, M.Lazy = le, M.Memo = G, M.Portal = X, M.Profiler = ae, M.StrictMode = Q, M.Suspense = ne, M.isAsyncMode = de, M.isConcurrentMode = n, M.isContextConsumer = l, M.isContextProvider = x, M.isElement = j, M.isForwardRef = T, M.isFragment = A, M.isLazy = R, M.isMemo = _, M.isPortal = O, M.isProfiler = I, M.isStrictMode = C, M.isSuspense = H, M.isValidElementType = U, M.typeOf = L;
|
|
812
|
-
}()), M;
|
|
813
|
-
}
|
|
814
|
-
var or;
|
|
815
|
-
function pr() {
|
|
816
|
-
return or || (or = 1, process.env.NODE_ENV === "production" ? Se.exports = zr() : Se.exports = Br()), Se.exports;
|
|
817
|
-
}
|
|
818
|
-
/*
|
|
819
|
-
object-assign
|
|
820
|
-
(c) Sindre Sorhus
|
|
821
|
-
@license MIT
|
|
822
|
-
*/
|
|
823
|
-
var Ae, sr;
|
|
824
|
-
function Jr() {
|
|
825
|
-
if (sr)
|
|
826
|
-
return Ae;
|
|
827
|
-
sr = 1;
|
|
828
|
-
var r = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
829
|
-
function a(u) {
|
|
830
|
-
if (u == null)
|
|
831
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
832
|
-
return Object(u);
|
|
833
|
-
}
|
|
834
|
-
function p() {
|
|
835
|
-
try {
|
|
836
|
-
if (!Object.assign)
|
|
837
|
-
return !1;
|
|
838
|
-
var u = new String("abc");
|
|
839
|
-
if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
|
|
840
|
-
return !1;
|
|
841
|
-
for (var y = {}, i = 0; i < 10; i++)
|
|
842
|
-
y["_" + String.fromCharCode(i)] = i;
|
|
843
|
-
var d = Object.getOwnPropertyNames(y).map(function(v) {
|
|
844
|
-
return y[v];
|
|
845
|
-
});
|
|
846
|
-
if (d.join("") !== "0123456789")
|
|
847
|
-
return !1;
|
|
848
|
-
var f = {};
|
|
849
|
-
return "abcdefghijklmnopqrst".split("").forEach(function(v) {
|
|
850
|
-
f[v] = v;
|
|
851
|
-
}), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
|
|
852
|
-
} catch {
|
|
853
|
-
return !1;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
return Ae = p() ? Object.assign : function(u, y) {
|
|
857
|
-
for (var i, d = a(u), f, v = 1; v < arguments.length; v++) {
|
|
858
|
-
i = Object(arguments[v]);
|
|
859
|
-
for (var g in i)
|
|
860
|
-
h.call(i, g) && (d[g] = i[g]);
|
|
861
|
-
if (r) {
|
|
862
|
-
f = r(i);
|
|
863
|
-
for (var k = 0; k < f.length; k++)
|
|
864
|
-
b.call(i, f[k]) && (d[f[k]] = i[f[k]]);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
return d;
|
|
868
|
-
}, Ae;
|
|
74
|
+
return to;
|
|
75
|
+
};
|
|
76
|
+
return objectAssign;
|
|
869
77
|
}
|
|
870
|
-
var
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
var
|
|
876
|
-
|
|
78
|
+
var ReactPropTypesSecret_1;
|
|
79
|
+
var hasRequiredReactPropTypesSecret;
|
|
80
|
+
function requireReactPropTypesSecret() {
|
|
81
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
82
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
83
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
84
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
85
|
+
return ReactPropTypesSecret_1;
|
|
877
86
|
}
|
|
878
|
-
var
|
|
879
|
-
|
|
880
|
-
|
|
87
|
+
var has;
|
|
88
|
+
var hasRequiredHas;
|
|
89
|
+
function requireHas() {
|
|
90
|
+
if (hasRequiredHas) return has;
|
|
91
|
+
hasRequiredHas = 1;
|
|
92
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
93
|
+
return has;
|
|
881
94
|
}
|
|
882
|
-
var
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
var
|
|
95
|
+
var checkPropTypes_1;
|
|
96
|
+
var hasRequiredCheckPropTypes;
|
|
97
|
+
function requireCheckPropTypes() {
|
|
98
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
99
|
+
hasRequiredCheckPropTypes = 1;
|
|
100
|
+
var printWarning = function() {
|
|
888
101
|
};
|
|
889
102
|
if (process.env.NODE_ENV !== "production") {
|
|
890
|
-
var
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
103
|
+
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
104
|
+
var loggedTypeFailures = {};
|
|
105
|
+
var has2 = /* @__PURE__ */ requireHas();
|
|
106
|
+
printWarning = function(text) {
|
|
107
|
+
var message = "Warning: " + text;
|
|
108
|
+
if (typeof console !== "undefined") {
|
|
109
|
+
console.error(message);
|
|
110
|
+
}
|
|
894
111
|
try {
|
|
895
|
-
throw new Error(
|
|
896
|
-
} catch {
|
|
112
|
+
throw new Error(message);
|
|
113
|
+
} catch (x) {
|
|
897
114
|
}
|
|
898
115
|
};
|
|
899
116
|
}
|
|
900
|
-
function
|
|
117
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
901
118
|
if (process.env.NODE_ENV !== "production") {
|
|
902
|
-
for (var
|
|
903
|
-
if (
|
|
904
|
-
var
|
|
119
|
+
for (var typeSpecName in typeSpecs) {
|
|
120
|
+
if (has2(typeSpecs, typeSpecName)) {
|
|
121
|
+
var error;
|
|
905
122
|
try {
|
|
906
|
-
if (typeof
|
|
907
|
-
var
|
|
908
|
-
(
|
|
123
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
124
|
+
var err = Error(
|
|
125
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
909
126
|
);
|
|
910
|
-
|
|
127
|
+
err.name = "Invariant Violation";
|
|
128
|
+
throw err;
|
|
911
129
|
}
|
|
912
|
-
|
|
913
|
-
} catch (
|
|
914
|
-
|
|
130
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
131
|
+
} catch (ex) {
|
|
132
|
+
error = ex;
|
|
915
133
|
}
|
|
916
|
-
if (
|
|
917
|
-
(
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
134
|
+
if (error && !(error instanceof Error)) {
|
|
135
|
+
printWarning(
|
|
136
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
140
|
+
loggedTypeFailures[error.message] = true;
|
|
141
|
+
var stack = getStack ? getStack() : "";
|
|
142
|
+
printWarning(
|
|
143
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
923
144
|
);
|
|
924
145
|
}
|
|
925
146
|
}
|
|
147
|
+
}
|
|
926
148
|
}
|
|
927
149
|
}
|
|
928
|
-
|
|
929
|
-
process.env.NODE_ENV !== "production"
|
|
930
|
-
|
|
150
|
+
checkPropTypes.resetWarningCache = function() {
|
|
151
|
+
if (process.env.NODE_ENV !== "production") {
|
|
152
|
+
loggedTypeFailures = {};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
checkPropTypes_1 = checkPropTypes;
|
|
156
|
+
return checkPropTypes_1;
|
|
931
157
|
}
|
|
932
|
-
var
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
var
|
|
158
|
+
var factoryWithTypeCheckers;
|
|
159
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
160
|
+
function requireFactoryWithTypeCheckers() {
|
|
161
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
162
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
163
|
+
var ReactIs = require$$0;
|
|
164
|
+
var assign = requireObjectAssign();
|
|
165
|
+
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
166
|
+
var has2 = /* @__PURE__ */ requireHas();
|
|
167
|
+
var checkPropTypes = /* @__PURE__ */ requireCheckPropTypes();
|
|
168
|
+
var printWarning = function() {
|
|
938
169
|
};
|
|
939
|
-
process.env.NODE_ENV !== "production"
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
170
|
+
if (process.env.NODE_ENV !== "production") {
|
|
171
|
+
printWarning = function(text) {
|
|
172
|
+
var message = "Warning: " + text;
|
|
173
|
+
if (typeof console !== "undefined") {
|
|
174
|
+
console.error(message);
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
throw new Error(message);
|
|
178
|
+
} catch (x) {
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function emptyFunctionThatReturnsNull() {
|
|
948
183
|
return null;
|
|
949
184
|
}
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
185
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
186
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
187
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
188
|
+
function getIteratorFn(maybeIterable) {
|
|
189
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
190
|
+
if (typeof iteratorFn === "function") {
|
|
191
|
+
return iteratorFn;
|
|
192
|
+
}
|
|
956
193
|
}
|
|
957
|
-
var
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
194
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
195
|
+
var ReactPropTypes = {
|
|
196
|
+
array: createPrimitiveTypeChecker("array"),
|
|
197
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
198
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
199
|
+
func: createPrimitiveTypeChecker("function"),
|
|
200
|
+
number: createPrimitiveTypeChecker("number"),
|
|
201
|
+
object: createPrimitiveTypeChecker("object"),
|
|
202
|
+
string: createPrimitiveTypeChecker("string"),
|
|
203
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
204
|
+
any: createAnyTypeChecker(),
|
|
205
|
+
arrayOf: createArrayOfTypeChecker,
|
|
206
|
+
element: createElementTypeChecker(),
|
|
207
|
+
elementType: createElementTypeTypeChecker(),
|
|
208
|
+
instanceOf: createInstanceTypeChecker,
|
|
209
|
+
node: createNodeChecker(),
|
|
210
|
+
objectOf: createObjectOfTypeChecker,
|
|
211
|
+
oneOf: createEnumTypeChecker,
|
|
212
|
+
oneOfType: createUnionTypeChecker,
|
|
213
|
+
shape: createShapeTypeChecker,
|
|
214
|
+
exact: createStrictShapeTypeChecker
|
|
977
215
|
};
|
|
978
|
-
function
|
|
979
|
-
|
|
216
|
+
function is(x, y) {
|
|
217
|
+
if (x === y) {
|
|
218
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
219
|
+
} else {
|
|
220
|
+
return x !== x && y !== y;
|
|
221
|
+
}
|
|
980
222
|
}
|
|
981
|
-
function
|
|
982
|
-
this.message =
|
|
223
|
+
function PropTypeError(message, data) {
|
|
224
|
+
this.message = message;
|
|
225
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
226
|
+
this.stack = "";
|
|
983
227
|
}
|
|
984
|
-
|
|
985
|
-
function
|
|
986
|
-
if (process.env.NODE_ENV !== "production")
|
|
987
|
-
var
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
228
|
+
PropTypeError.prototype = Error.prototype;
|
|
229
|
+
function createChainableTypeChecker(validate) {
|
|
230
|
+
if (process.env.NODE_ENV !== "production") {
|
|
231
|
+
var manualPropTypeCallCache = {};
|
|
232
|
+
var manualPropTypeWarningCount = 0;
|
|
233
|
+
}
|
|
234
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
235
|
+
componentName = componentName || ANONYMOUS;
|
|
236
|
+
propFullName = propFullName || propName;
|
|
237
|
+
if (secret !== ReactPropTypesSecret) {
|
|
238
|
+
if (throwOnDirectAccess) {
|
|
239
|
+
var err = new Error(
|
|
992
240
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
993
241
|
);
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
242
|
+
err.name = "Invariant Violation";
|
|
243
|
+
throw err;
|
|
244
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
245
|
+
var cacheKey = componentName + ":" + propName;
|
|
246
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
247
|
+
manualPropTypeWarningCount < 3) {
|
|
248
|
+
printWarning(
|
|
249
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
250
|
+
);
|
|
251
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
252
|
+
manualPropTypeWarningCount++;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (props[propName] == null) {
|
|
257
|
+
if (isRequired) {
|
|
258
|
+
if (props[propName] === null) {
|
|
259
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
260
|
+
}
|
|
261
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
1001
262
|
}
|
|
263
|
+
return null;
|
|
264
|
+
} else {
|
|
265
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
1002
266
|
}
|
|
1003
|
-
return R[_] == null ? A ? R[_] === null ? new N("The " + I + " `" + C + "` is marked as required " + ("in `" + O + "`, but its value is `null`.")) : new N("The " + I + " `" + C + "` is marked as required in " + ("`" + O + "`, but its value is `undefined`.")) : null : n(R, _, O, I, C);
|
|
1004
267
|
}
|
|
1005
|
-
var
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
268
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
269
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
270
|
+
return chainedCheckType;
|
|
271
|
+
}
|
|
272
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
273
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
274
|
+
var propValue = props[propName];
|
|
275
|
+
var propType = getPropType(propValue);
|
|
276
|
+
if (propType !== expectedType) {
|
|
277
|
+
var preciseType = getPreciseType(propValue);
|
|
278
|
+
return new PropTypeError(
|
|
279
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
280
|
+
{ expectedType }
|
|
1016
281
|
);
|
|
1017
282
|
}
|
|
1018
283
|
return null;
|
|
1019
284
|
}
|
|
1020
|
-
return
|
|
285
|
+
return createChainableTypeChecker(validate);
|
|
1021
286
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
287
|
+
function createAnyTypeChecker() {
|
|
288
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
1024
289
|
}
|
|
1025
|
-
function
|
|
1026
|
-
function
|
|
1027
|
-
if (typeof
|
|
1028
|
-
return new
|
|
1029
|
-
var _ = x[j];
|
|
1030
|
-
if (!Array.isArray(_)) {
|
|
1031
|
-
var O = Q(_);
|
|
1032
|
-
return new N("Invalid " + A + " `" + R + "` of type " + ("`" + O + "` supplied to `" + T + "`, expected an array."));
|
|
290
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
291
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
292
|
+
if (typeof typeChecker !== "function") {
|
|
293
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
1033
294
|
}
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
295
|
+
var propValue = props[propName];
|
|
296
|
+
if (!Array.isArray(propValue)) {
|
|
297
|
+
var propType = getPropType(propValue);
|
|
298
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
299
|
+
}
|
|
300
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
301
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
302
|
+
if (error instanceof Error) {
|
|
303
|
+
return error;
|
|
304
|
+
}
|
|
1038
305
|
}
|
|
1039
306
|
return null;
|
|
1040
307
|
}
|
|
1041
|
-
return
|
|
1042
|
-
}
|
|
1043
|
-
function
|
|
1044
|
-
function
|
|
1045
|
-
var
|
|
1046
|
-
if (!
|
|
1047
|
-
var
|
|
1048
|
-
return new
|
|
308
|
+
return createChainableTypeChecker(validate);
|
|
309
|
+
}
|
|
310
|
+
function createElementTypeChecker() {
|
|
311
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
312
|
+
var propValue = props[propName];
|
|
313
|
+
if (!isValidElement(propValue)) {
|
|
314
|
+
var propType = getPropType(propValue);
|
|
315
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
1049
316
|
}
|
|
1050
317
|
return null;
|
|
1051
318
|
}
|
|
1052
|
-
return
|
|
1053
|
-
}
|
|
1054
|
-
function
|
|
1055
|
-
function
|
|
1056
|
-
var
|
|
1057
|
-
if (!
|
|
1058
|
-
var
|
|
1059
|
-
return new
|
|
319
|
+
return createChainableTypeChecker(validate);
|
|
320
|
+
}
|
|
321
|
+
function createElementTypeTypeChecker() {
|
|
322
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
323
|
+
var propValue = props[propName];
|
|
324
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
325
|
+
var propType = getPropType(propValue);
|
|
326
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
1060
327
|
}
|
|
1061
328
|
return null;
|
|
1062
329
|
}
|
|
1063
|
-
return
|
|
1064
|
-
}
|
|
1065
|
-
function
|
|
1066
|
-
function
|
|
1067
|
-
if (!(
|
|
1068
|
-
var
|
|
1069
|
-
|
|
330
|
+
return createChainableTypeChecker(validate);
|
|
331
|
+
}
|
|
332
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
333
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
334
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
335
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
336
|
+
var actualClassName = getClassName(props[propName]);
|
|
337
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
1070
338
|
}
|
|
1071
339
|
return null;
|
|
1072
340
|
}
|
|
1073
|
-
return
|
|
1074
|
-
}
|
|
1075
|
-
function
|
|
1076
|
-
if (!Array.isArray(
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
341
|
+
return createChainableTypeChecker(validate);
|
|
342
|
+
}
|
|
343
|
+
function createEnumTypeChecker(expectedValues) {
|
|
344
|
+
if (!Array.isArray(expectedValues)) {
|
|
345
|
+
if (process.env.NODE_ENV !== "production") {
|
|
346
|
+
if (arguments.length > 1) {
|
|
347
|
+
printWarning(
|
|
348
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
349
|
+
);
|
|
350
|
+
} else {
|
|
351
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return emptyFunctionThatReturnsNull;
|
|
355
|
+
}
|
|
356
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
357
|
+
var propValue = props[propName];
|
|
358
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
359
|
+
if (is(propValue, expectedValues[i])) {
|
|
1083
360
|
return null;
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
364
|
+
var type = getPreciseType(value);
|
|
365
|
+
if (type === "symbol") {
|
|
366
|
+
return String(value);
|
|
367
|
+
}
|
|
368
|
+
return value;
|
|
1087
369
|
});
|
|
1088
|
-
return new
|
|
370
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
1089
371
|
}
|
|
1090
|
-
return
|
|
372
|
+
return createChainableTypeChecker(validate);
|
|
1091
373
|
}
|
|
1092
|
-
function
|
|
1093
|
-
function
|
|
1094
|
-
if (typeof
|
|
1095
|
-
return new
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
374
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
375
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
376
|
+
if (typeof typeChecker !== "function") {
|
|
377
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
378
|
+
}
|
|
379
|
+
var propValue = props[propName];
|
|
380
|
+
var propType = getPropType(propValue);
|
|
381
|
+
if (propType !== "object") {
|
|
382
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
383
|
+
}
|
|
384
|
+
for (var key in propValue) {
|
|
385
|
+
if (has2(propValue, key)) {
|
|
386
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
387
|
+
if (error instanceof Error) {
|
|
388
|
+
return error;
|
|
389
|
+
}
|
|
1104
390
|
}
|
|
391
|
+
}
|
|
1105
392
|
return null;
|
|
1106
393
|
}
|
|
1107
|
-
return
|
|
394
|
+
return createChainableTypeChecker(validate);
|
|
1108
395
|
}
|
|
1109
|
-
function
|
|
1110
|
-
if (!Array.isArray(
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
396
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
397
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
398
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
399
|
+
return emptyFunctionThatReturnsNull;
|
|
400
|
+
}
|
|
401
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
402
|
+
var checker = arrayOfTypeCheckers[i];
|
|
403
|
+
if (typeof checker !== "function") {
|
|
404
|
+
printWarning(
|
|
405
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
406
|
+
);
|
|
407
|
+
return emptyFunctionThatReturnsNull;
|
|
408
|
+
}
|
|
1118
409
|
}
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
410
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
411
|
+
var expectedTypes = [];
|
|
412
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
413
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
414
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
415
|
+
if (checkerResult == null) {
|
|
1123
416
|
return null;
|
|
1124
|
-
|
|
417
|
+
}
|
|
418
|
+
if (checkerResult.data && has2(checkerResult.data, "expectedType")) {
|
|
419
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
420
|
+
}
|
|
1125
421
|
}
|
|
1126
|
-
var
|
|
1127
|
-
return new
|
|
422
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
423
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
1128
424
|
}
|
|
1129
|
-
return
|
|
425
|
+
return createChainableTypeChecker(validate);
|
|
1130
426
|
}
|
|
1131
|
-
function
|
|
1132
|
-
function
|
|
1133
|
-
|
|
427
|
+
function createNodeChecker() {
|
|
428
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
429
|
+
if (!isNode(props[propName])) {
|
|
430
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
1134
433
|
}
|
|
1135
|
-
return
|
|
434
|
+
return createChainableTypeChecker(validate);
|
|
1136
435
|
}
|
|
1137
|
-
function
|
|
1138
|
-
return new
|
|
1139
|
-
(
|
|
436
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
437
|
+
return new PropTypeError(
|
|
438
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
1140
439
|
);
|
|
1141
440
|
}
|
|
1142
|
-
function
|
|
1143
|
-
function
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
441
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
442
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
443
|
+
var propValue = props[propName];
|
|
444
|
+
var propType = getPropType(propValue);
|
|
445
|
+
if (propType !== "object") {
|
|
446
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
447
|
+
}
|
|
448
|
+
for (var key in shapeTypes) {
|
|
449
|
+
var checker = shapeTypes[key];
|
|
450
|
+
if (typeof checker !== "function") {
|
|
451
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
452
|
+
}
|
|
453
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
454
|
+
if (error) {
|
|
455
|
+
return error;
|
|
456
|
+
}
|
|
1154
457
|
}
|
|
1155
458
|
return null;
|
|
1156
459
|
}
|
|
1157
|
-
return
|
|
1158
|
-
}
|
|
1159
|
-
function
|
|
1160
|
-
function
|
|
1161
|
-
var
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
if (
|
|
1170
|
-
return
|
|
1171
|
-
|
|
1172
|
-
|
|
460
|
+
return createChainableTypeChecker(validate);
|
|
461
|
+
}
|
|
462
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
463
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
464
|
+
var propValue = props[propName];
|
|
465
|
+
var propType = getPropType(propValue);
|
|
466
|
+
if (propType !== "object") {
|
|
467
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
468
|
+
}
|
|
469
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
470
|
+
for (var key in allKeys) {
|
|
471
|
+
var checker = shapeTypes[key];
|
|
472
|
+
if (has2(shapeTypes, key) && typeof checker !== "function") {
|
|
473
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
474
|
+
}
|
|
475
|
+
if (!checker) {
|
|
476
|
+
return new PropTypeError(
|
|
477
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
1173
478
|
);
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
479
|
+
}
|
|
480
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
481
|
+
if (error) {
|
|
482
|
+
return error;
|
|
483
|
+
}
|
|
1177
484
|
}
|
|
1178
485
|
return null;
|
|
1179
486
|
}
|
|
1180
|
-
return
|
|
487
|
+
return createChainableTypeChecker(validate);
|
|
1181
488
|
}
|
|
1182
|
-
function
|
|
1183
|
-
switch (typeof
|
|
489
|
+
function isNode(propValue) {
|
|
490
|
+
switch (typeof propValue) {
|
|
1184
491
|
case "number":
|
|
1185
492
|
case "string":
|
|
1186
493
|
case "undefined":
|
|
1187
|
-
return
|
|
494
|
+
return true;
|
|
1188
495
|
case "boolean":
|
|
1189
|
-
return !
|
|
496
|
+
return !propValue;
|
|
1190
497
|
case "object":
|
|
1191
|
-
if (Array.isArray(
|
|
1192
|
-
return
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
498
|
+
if (Array.isArray(propValue)) {
|
|
499
|
+
return propValue.every(isNode);
|
|
500
|
+
}
|
|
501
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
502
|
+
return true;
|
|
503
|
+
}
|
|
504
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
505
|
+
if (iteratorFn) {
|
|
506
|
+
var iterator = iteratorFn.call(propValue);
|
|
507
|
+
var step;
|
|
508
|
+
if (iteratorFn !== propValue.entries) {
|
|
509
|
+
while (!(step = iterator.next()).done) {
|
|
510
|
+
if (!isNode(step.value)) {
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
} else {
|
|
515
|
+
while (!(step = iterator.next()).done) {
|
|
516
|
+
var entry = step.value;
|
|
517
|
+
if (entry) {
|
|
518
|
+
if (!isNode(entry[1])) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
1207
522
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
523
|
+
}
|
|
524
|
+
} else {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
return true;
|
|
1211
528
|
default:
|
|
1212
|
-
return
|
|
529
|
+
return false;
|
|
1213
530
|
}
|
|
1214
531
|
}
|
|
1215
|
-
function
|
|
1216
|
-
|
|
532
|
+
function isSymbol(propType, propValue) {
|
|
533
|
+
if (propType === "symbol") {
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
if (!propValue) {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
return false;
|
|
1217
546
|
}
|
|
1218
|
-
function
|
|
1219
|
-
var
|
|
1220
|
-
|
|
547
|
+
function getPropType(propValue) {
|
|
548
|
+
var propType = typeof propValue;
|
|
549
|
+
if (Array.isArray(propValue)) {
|
|
550
|
+
return "array";
|
|
551
|
+
}
|
|
552
|
+
if (propValue instanceof RegExp) {
|
|
553
|
+
return "object";
|
|
554
|
+
}
|
|
555
|
+
if (isSymbol(propType, propValue)) {
|
|
556
|
+
return "symbol";
|
|
557
|
+
}
|
|
558
|
+
return propType;
|
|
1221
559
|
}
|
|
1222
|
-
function
|
|
1223
|
-
if (typeof
|
|
1224
|
-
return "" +
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
560
|
+
function getPreciseType(propValue) {
|
|
561
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
562
|
+
return "" + propValue;
|
|
563
|
+
}
|
|
564
|
+
var propType = getPropType(propValue);
|
|
565
|
+
if (propType === "object") {
|
|
566
|
+
if (propValue instanceof Date) {
|
|
1228
567
|
return "date";
|
|
1229
|
-
if (
|
|
568
|
+
} else if (propValue instanceof RegExp) {
|
|
1230
569
|
return "regexp";
|
|
570
|
+
}
|
|
1231
571
|
}
|
|
1232
|
-
return
|
|
572
|
+
return propType;
|
|
1233
573
|
}
|
|
1234
|
-
function
|
|
1235
|
-
var
|
|
1236
|
-
switch (
|
|
574
|
+
function getPostfixForTypeWarning(value) {
|
|
575
|
+
var type = getPreciseType(value);
|
|
576
|
+
switch (type) {
|
|
1237
577
|
case "array":
|
|
1238
578
|
case "object":
|
|
1239
|
-
return "an " +
|
|
579
|
+
return "an " + type;
|
|
1240
580
|
case "boolean":
|
|
1241
581
|
case "date":
|
|
1242
582
|
case "regexp":
|
|
1243
|
-
return "a " +
|
|
583
|
+
return "a " + type;
|
|
1244
584
|
default:
|
|
1245
|
-
return
|
|
585
|
+
return type;
|
|
1246
586
|
}
|
|
1247
587
|
}
|
|
1248
|
-
function
|
|
1249
|
-
|
|
588
|
+
function getClassName(propValue) {
|
|
589
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
590
|
+
return ANONYMOUS;
|
|
591
|
+
}
|
|
592
|
+
return propValue.constructor.name;
|
|
1250
593
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
594
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
595
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
596
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
597
|
+
return ReactPropTypes;
|
|
598
|
+
};
|
|
599
|
+
return factoryWithTypeCheckers;
|
|
1253
600
|
}
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
var
|
|
1260
|
-
function
|
|
601
|
+
var factoryWithThrowingShims;
|
|
602
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
603
|
+
function requireFactoryWithThrowingShims() {
|
|
604
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
605
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
606
|
+
var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
|
|
607
|
+
function emptyFunction() {
|
|
1261
608
|
}
|
|
1262
|
-
function
|
|
609
|
+
function emptyFunctionWithReset() {
|
|
1263
610
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
);
|
|
1270
|
-
throw k.name = "Invariant Violation", k;
|
|
611
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
612
|
+
factoryWithThrowingShims = function() {
|
|
613
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
614
|
+
if (secret === ReactPropTypesSecret) {
|
|
615
|
+
return;
|
|
1271
616
|
}
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
617
|
+
var err = new Error(
|
|
618
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
619
|
+
);
|
|
620
|
+
err.name = "Invariant Violation";
|
|
621
|
+
throw err;
|
|
622
|
+
}
|
|
623
|
+
shim.isRequired = shim;
|
|
624
|
+
function getShim() {
|
|
625
|
+
return shim;
|
|
626
|
+
}
|
|
627
|
+
var ReactPropTypes = {
|
|
628
|
+
array: shim,
|
|
629
|
+
bigint: shim,
|
|
630
|
+
bool: shim,
|
|
631
|
+
func: shim,
|
|
632
|
+
number: shim,
|
|
633
|
+
object: shim,
|
|
634
|
+
string: shim,
|
|
635
|
+
symbol: shim,
|
|
636
|
+
any: shim,
|
|
637
|
+
arrayOf: getShim,
|
|
638
|
+
element: shim,
|
|
639
|
+
elementType: shim,
|
|
640
|
+
instanceOf: getShim,
|
|
641
|
+
node: shim,
|
|
642
|
+
objectOf: getShim,
|
|
643
|
+
oneOf: getShim,
|
|
644
|
+
oneOfType: getShim,
|
|
645
|
+
shape: getShim,
|
|
646
|
+
exact: getShim,
|
|
647
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
648
|
+
resetWarningCache: emptyFunction
|
|
1299
649
|
};
|
|
1300
|
-
|
|
1301
|
-
|
|
650
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
651
|
+
return ReactPropTypes;
|
|
652
|
+
};
|
|
653
|
+
return factoryWithThrowingShims;
|
|
1302
654
|
}
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
var
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
655
|
+
var hasRequiredPropTypes;
|
|
656
|
+
function requirePropTypes() {
|
|
657
|
+
if (hasRequiredPropTypes) return propTypes.exports;
|
|
658
|
+
hasRequiredPropTypes = 1;
|
|
659
|
+
if (process.env.NODE_ENV !== "production") {
|
|
660
|
+
var ReactIs = require$$0;
|
|
661
|
+
var throwOnDirectAccess = true;
|
|
662
|
+
propTypes.exports = /* @__PURE__ */ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
663
|
+
} else {
|
|
664
|
+
propTypes.exports = /* @__PURE__ */ requireFactoryWithThrowingShims()();
|
|
665
|
+
}
|
|
666
|
+
return propTypes.exports;
|
|
667
|
+
}
|
|
668
|
+
var propTypesExports = /* @__PURE__ */ requirePropTypes();
|
|
669
|
+
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
670
|
+
const ColumnFilter = ({ column, filterValue, setFilter, onClose }) => {
|
|
671
|
+
const [value, setValue] = useState(filterValue || "");
|
|
672
|
+
useEffect(() => {
|
|
673
|
+
const handler = setTimeout(() => {
|
|
674
|
+
setFilter(column.key, value);
|
|
1315
675
|
}, 300);
|
|
1316
676
|
return () => {
|
|
1317
|
-
clearTimeout(
|
|
677
|
+
clearTimeout(handler);
|
|
1318
678
|
};
|
|
1319
|
-
}, [
|
|
1320
|
-
|
|
679
|
+
}, [value, column.key, setFilter]);
|
|
680
|
+
if (!column.searchable) return null;
|
|
681
|
+
return /* @__PURE__ */ jsxs("div", { className: "jc-datatable-filter", children: [
|
|
682
|
+
/* @__PURE__ */ jsx(
|
|
1321
683
|
"input",
|
|
1322
684
|
{
|
|
1323
|
-
autoFocus:
|
|
685
|
+
autoFocus: true,
|
|
1324
686
|
type: "text",
|
|
1325
|
-
placeholder: `Search ${
|
|
1326
|
-
value
|
|
1327
|
-
onChange: (
|
|
687
|
+
placeholder: `Search ${column.header}...`,
|
|
688
|
+
value,
|
|
689
|
+
onChange: (e) => setValue(e.target.value),
|
|
1328
690
|
className: "jc-datatable-filter-input",
|
|
1329
|
-
"aria-label": `Filter by ${
|
|
691
|
+
"aria-label": `Filter by ${column.header}`
|
|
1330
692
|
}
|
|
1331
693
|
),
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
] })
|
|
694
|
+
/* @__PURE__ */ jsx("button", { className: "jc-datatable-filter-close", onClick: onClose, "aria-label": "Close filter", children: "×" })
|
|
695
|
+
] });
|
|
1334
696
|
};
|
|
1335
|
-
|
|
1336
|
-
column:
|
|
1337
|
-
filterValue:
|
|
1338
|
-
setFilter:
|
|
1339
|
-
onClose:
|
|
697
|
+
ColumnFilter.propTypes = {
|
|
698
|
+
column: PropTypes.object.isRequired,
|
|
699
|
+
filterValue: PropTypes.any,
|
|
700
|
+
setFilter: PropTypes.func.isRequired,
|
|
701
|
+
onClose: PropTypes.func.isRequired
|
|
1340
702
|
};
|
|
1341
|
-
const
|
|
1342
|
-
const [
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
703
|
+
const TableHeader = ({ columns, sortConfig, requestSort, filters, setFilter }) => {
|
|
704
|
+
const [activeFilter, setActiveFilter] = React.useState(null);
|
|
705
|
+
const toggleFilter = (e, key) => {
|
|
706
|
+
e.stopPropagation();
|
|
707
|
+
setActiveFilter(activeFilter === key ? null : key);
|
|
708
|
+
};
|
|
709
|
+
const getSortIndicator = (column) => {
|
|
710
|
+
if (!sortConfig || sortConfig.key !== column.key) {
|
|
711
|
+
return /* @__PURE__ */ jsx("span", { className: "jc-datatable-sort-icon", children: "↕" });
|
|
712
|
+
}
|
|
713
|
+
return sortConfig.direction === "asc" ? /* @__PURE__ */ jsx("span", { className: "jc-datatable-sort-icon active", children: "↑" }) : /* @__PURE__ */ jsx("span", { className: "jc-datatable-sort-icon active", children: "↓" });
|
|
714
|
+
};
|
|
715
|
+
return /* @__PURE__ */ jsx("thead", { className: "jc-datatable-thead", children: /* @__PURE__ */ jsx("tr", { children: columns.map((column, index) => {
|
|
716
|
+
const isLastColumn = index === columns.length - 1;
|
|
717
|
+
const isFirstColumn = index === 0;
|
|
718
|
+
let popoverClass = "jc-datatable-filter-popover";
|
|
719
|
+
if (isLastColumn) popoverClass += " right-aligned";
|
|
720
|
+
if (isFirstColumn) popoverClass += " left-aligned";
|
|
721
|
+
return /* @__PURE__ */ jsxs(
|
|
1349
722
|
"th",
|
|
1350
723
|
{
|
|
1351
|
-
className: `jc-datatable-th ${
|
|
1352
|
-
style: {
|
|
1353
|
-
|
|
724
|
+
className: `jc-datatable-th ${column.sortable ? "sortable" : ""}`,
|
|
725
|
+
style: {
|
|
726
|
+
width: column.width,
|
|
727
|
+
minWidth: column.minWidth || column.width,
|
|
728
|
+
maxWidth: column.maxWidth
|
|
729
|
+
},
|
|
730
|
+
onClick: () => column.sortable && requestSort(column.key),
|
|
1354
731
|
children: [
|
|
1355
|
-
/* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
|
|
1358
|
-
|
|
732
|
+
/* @__PURE__ */ jsxs("div", { className: "jc-datatable-th-content", children: [
|
|
733
|
+
/* @__PURE__ */ jsx("span", { children: column.header }),
|
|
734
|
+
column.sortable && getSortIndicator(column),
|
|
735
|
+
column.searchable && /* @__PURE__ */ jsx(
|
|
1359
736
|
"button",
|
|
1360
737
|
{
|
|
1361
|
-
className: `jc-datatable-filter-trigger ${
|
|
1362
|
-
onClick: (
|
|
1363
|
-
"aria-label": `Filter ${
|
|
1364
|
-
children: /* @__PURE__ */
|
|
738
|
+
className: `jc-datatable-filter-trigger ${filters[column.key] ? "active" : ""}`,
|
|
739
|
+
onClick: (e) => toggleFilter(e, column.key),
|
|
740
|
+
"aria-label": `Filter ${column.header}`,
|
|
741
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "14", height: "14", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" }) })
|
|
1365
742
|
}
|
|
1366
743
|
)
|
|
1367
744
|
] }),
|
|
1368
|
-
|
|
1369
|
-
|
|
745
|
+
activeFilter === column.key && /* @__PURE__ */ jsx("div", { className: popoverClass, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
746
|
+
ColumnFilter,
|
|
1370
747
|
{
|
|
1371
|
-
column
|
|
1372
|
-
filterValue:
|
|
1373
|
-
setFilter
|
|
1374
|
-
onClose: () =>
|
|
748
|
+
column,
|
|
749
|
+
filterValue: filters[column.key],
|
|
750
|
+
setFilter,
|
|
751
|
+
onClose: () => setActiveFilter(null)
|
|
1375
752
|
}
|
|
1376
753
|
) })
|
|
1377
754
|
]
|
|
1378
755
|
},
|
|
1379
|
-
|
|
756
|
+
column.key
|
|
1380
757
|
);
|
|
1381
758
|
}) }) });
|
|
1382
759
|
};
|
|
1383
|
-
|
|
1384
|
-
columns:
|
|
1385
|
-
sortConfig:
|
|
1386
|
-
key:
|
|
1387
|
-
direction:
|
|
760
|
+
TableHeader.propTypes = {
|
|
761
|
+
columns: PropTypes.array.isRequired,
|
|
762
|
+
sortConfig: PropTypes.shape({
|
|
763
|
+
key: PropTypes.string,
|
|
764
|
+
direction: PropTypes.oneOf(["asc", "desc"])
|
|
1388
765
|
}),
|
|
1389
|
-
requestSort:
|
|
1390
|
-
filters:
|
|
1391
|
-
setFilter:
|
|
766
|
+
requestSort: PropTypes.func.isRequired,
|
|
767
|
+
filters: PropTypes.object.isRequired,
|
|
768
|
+
setFilter: PropTypes.func.isRequired
|
|
1392
769
|
};
|
|
1393
|
-
function
|
|
1394
|
-
if (!
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
770
|
+
function get(obj, path, defaultValue = void 0) {
|
|
771
|
+
if (!path || !obj) return defaultValue;
|
|
772
|
+
const value = path.split(".").reduce((acc, part) => {
|
|
773
|
+
return acc && acc[part] !== void 0 ? acc[part] : void 0;
|
|
774
|
+
}, obj);
|
|
775
|
+
return value !== void 0 ? value : defaultValue;
|
|
1398
776
|
}
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
children:
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
777
|
+
const TableBody = ({ data, columns, loading, onRowClick, noDataText }) => {
|
|
778
|
+
if (loading) {
|
|
779
|
+
return /* @__PURE__ */ jsx("tbody", { className: "jc-datatable-tbody", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { colSpan: columns.length, className: "jc-datatable-loading-cell", children: [
|
|
780
|
+
/* @__PURE__ */ jsx("div", { className: "jc-datatable-spinner" }),
|
|
781
|
+
"Loading..."
|
|
782
|
+
] }) }) });
|
|
783
|
+
}
|
|
784
|
+
if (!data || data.length === 0) {
|
|
785
|
+
return /* @__PURE__ */ jsx("tbody", { className: "jc-datatable-tbody", children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: columns.length, className: "jc-datatable-empty-cell", children: noDataText || "No records found" }) }) });
|
|
786
|
+
}
|
|
787
|
+
return /* @__PURE__ */ jsx("tbody", { className: "jc-datatable-tbody", children: data.map((row, rowIndex) => /* @__PURE__ */ jsx(
|
|
788
|
+
"tr",
|
|
789
|
+
{
|
|
790
|
+
className: `jc-datatable-tr ${onRowClick ? "clickable" : ""}`,
|
|
791
|
+
onClick: () => onRowClick && onRowClick(row),
|
|
792
|
+
children: columns.map((column) => /* @__PURE__ */ jsx(
|
|
793
|
+
"td",
|
|
794
|
+
{
|
|
795
|
+
className: "jc-datatable-td",
|
|
796
|
+
"data-label": column.header,
|
|
797
|
+
children: column.render ? column.render(row, rowIndex) : get(row, column.key)
|
|
798
|
+
},
|
|
799
|
+
`${row.id || rowIndex}-${column.key}`
|
|
800
|
+
))
|
|
801
|
+
},
|
|
802
|
+
row.id || rowIndex
|
|
803
|
+
)) });
|
|
1425
804
|
};
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
"
|
|
1448
|
-
|
|
1449
|
-
value: b,
|
|
1450
|
-
onChange: (d) => a(Number(d.target.value)),
|
|
1451
|
-
className: "jc-datatable-page-size-select",
|
|
1452
|
-
"aria-label": "Select page size",
|
|
1453
|
-
children: i.map((d) => /* @__PURE__ */ S.jsxs("option", { value: d, children: [
|
|
1454
|
-
d,
|
|
1455
|
-
" / page"
|
|
1456
|
-
] }, d))
|
|
1457
|
-
}
|
|
1458
|
-
),
|
|
1459
|
-
/* @__PURE__ */ S.jsx(
|
|
1460
|
-
"button",
|
|
1461
|
-
{
|
|
1462
|
-
onClick: u,
|
|
1463
|
-
disabled: r === 1,
|
|
1464
|
-
className: "jc-datatable-pagination-btn",
|
|
1465
|
-
"aria-label": "Previous page",
|
|
1466
|
-
children: "Previous"
|
|
1467
|
-
}
|
|
1468
|
-
),
|
|
1469
|
-
/* @__PURE__ */ S.jsxs("span", { className: "jc-datatable-pagination-pages", children: [
|
|
1470
|
-
"Page ",
|
|
1471
|
-
r,
|
|
805
|
+
TableBody.propTypes = {
|
|
806
|
+
data: PropTypes.array.isRequired,
|
|
807
|
+
columns: PropTypes.array.isRequired,
|
|
808
|
+
loading: PropTypes.bool,
|
|
809
|
+
onRowClick: PropTypes.func,
|
|
810
|
+
noDataText: PropTypes.string
|
|
811
|
+
};
|
|
812
|
+
const Pagination = ({
|
|
813
|
+
currentPage,
|
|
814
|
+
totalPages,
|
|
815
|
+
pageSize,
|
|
816
|
+
setPageSize,
|
|
817
|
+
nextPage,
|
|
818
|
+
prevPage,
|
|
819
|
+
totalItems,
|
|
820
|
+
pageSizeOptions = [5, 10, 20, 50]
|
|
821
|
+
}) => {
|
|
822
|
+
return /* @__PURE__ */ jsxs("div", { className: "jc-datatable-pagination", children: [
|
|
823
|
+
/* @__PURE__ */ jsxs("div", { className: "jc-datatable-pagination-info", children: [
|
|
824
|
+
"Showing ",
|
|
825
|
+
(currentPage - 1) * pageSize + 1,
|
|
826
|
+
" to ",
|
|
827
|
+
Math.min(currentPage * pageSize, totalItems),
|
|
1472
828
|
" of ",
|
|
1473
|
-
|
|
829
|
+
totalItems,
|
|
830
|
+
" entries"
|
|
1474
831
|
] }),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
] })
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
832
|
+
/* @__PURE__ */ jsxs("div", { className: "jc-datatable-pagination-controls", children: [
|
|
833
|
+
/* @__PURE__ */ jsx(
|
|
834
|
+
"select",
|
|
835
|
+
{
|
|
836
|
+
value: pageSize,
|
|
837
|
+
onChange: (e) => setPageSize(Number(e.target.value)),
|
|
838
|
+
className: "jc-datatable-page-size-select",
|
|
839
|
+
"aria-label": "Select page size",
|
|
840
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxs("option", { value: size, children: [
|
|
841
|
+
size,
|
|
842
|
+
" / page"
|
|
843
|
+
] }, size))
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
/* @__PURE__ */ jsx(
|
|
847
|
+
"button",
|
|
848
|
+
{
|
|
849
|
+
onClick: prevPage,
|
|
850
|
+
disabled: currentPage === 1,
|
|
851
|
+
className: "jc-datatable-pagination-btn",
|
|
852
|
+
"aria-label": "Previous page",
|
|
853
|
+
children: "Previous"
|
|
854
|
+
}
|
|
855
|
+
),
|
|
856
|
+
/* @__PURE__ */ jsxs("span", { className: "jc-datatable-pagination-pages", children: [
|
|
857
|
+
"Page ",
|
|
858
|
+
currentPage,
|
|
859
|
+
" of ",
|
|
860
|
+
totalPages
|
|
861
|
+
] }),
|
|
862
|
+
/* @__PURE__ */ jsx(
|
|
863
|
+
"button",
|
|
864
|
+
{
|
|
865
|
+
onClick: nextPage,
|
|
866
|
+
disabled: currentPage === totalPages,
|
|
867
|
+
className: "jc-datatable-pagination-btn",
|
|
868
|
+
"aria-label": "Next page",
|
|
869
|
+
children: "Next"
|
|
870
|
+
}
|
|
871
|
+
)
|
|
872
|
+
] })
|
|
873
|
+
] });
|
|
874
|
+
};
|
|
875
|
+
Pagination.propTypes = {
|
|
876
|
+
currentPage: PropTypes.number.isRequired,
|
|
877
|
+
totalPages: PropTypes.number.isRequired,
|
|
878
|
+
pageSize: PropTypes.number.isRequired,
|
|
879
|
+
setPageSize: PropTypes.func.isRequired,
|
|
880
|
+
nextPage: PropTypes.func.isRequired,
|
|
881
|
+
prevPage: PropTypes.func.isRequired,
|
|
882
|
+
totalItems: PropTypes.number.isRequired,
|
|
883
|
+
pageSizeOptions: PropTypes.arrayOf(PropTypes.number)
|
|
1496
884
|
};
|
|
1497
|
-
const
|
|
1498
|
-
const [
|
|
1499
|
-
|
|
1500
|
-
|
|
885
|
+
const useSort = (data, columns, initialSort = null) => {
|
|
886
|
+
const [sortConfig, setSortConfig] = useState(initialSort);
|
|
887
|
+
const requestSort = (key) => {
|
|
888
|
+
let direction = "asc";
|
|
889
|
+
if (sortConfig && sortConfig.key === key && sortConfig.direction === "asc") {
|
|
890
|
+
direction = "desc";
|
|
891
|
+
}
|
|
892
|
+
setSortConfig({ key, direction });
|
|
1501
893
|
};
|
|
1502
|
-
|
|
1503
|
-
if (!
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
894
|
+
const sortedData = useMemo(() => {
|
|
895
|
+
if (!sortConfig) return data;
|
|
896
|
+
const column = columns.find((col) => col.key === sortConfig.key);
|
|
897
|
+
if (!column) return data;
|
|
898
|
+
const sortableItems = [...data];
|
|
899
|
+
return sortableItems.sort((a, b) => {
|
|
900
|
+
if (column.sortFn) {
|
|
901
|
+
return sortConfig.direction === "asc" ? column.sortFn(a, b) : column.sortFn(b, a);
|
|
902
|
+
}
|
|
903
|
+
const aValue = get(a, column.key);
|
|
904
|
+
const bValue = get(b, column.key);
|
|
905
|
+
if (aValue < bValue) {
|
|
906
|
+
return sortConfig.direction === "asc" ? -1 : 1;
|
|
907
|
+
}
|
|
908
|
+
if (aValue > bValue) {
|
|
909
|
+
return sortConfig.direction === "asc" ? 1 : -1;
|
|
910
|
+
}
|
|
911
|
+
return 0;
|
|
912
|
+
});
|
|
913
|
+
}, [data, sortConfig, columns]);
|
|
914
|
+
return { sortedData, sortConfig, requestSort };
|
|
915
|
+
};
|
|
916
|
+
const useFilter = (data, columns) => {
|
|
917
|
+
const [filters, setFilters] = useState({});
|
|
918
|
+
const setFilter = (key, value) => {
|
|
919
|
+
setFilters((prev) => ({
|
|
920
|
+
...prev,
|
|
921
|
+
[key]: value
|
|
1518
922
|
}));
|
|
1519
923
|
};
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
}, [
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
924
|
+
const filteredData = useMemo(() => {
|
|
925
|
+
return data.filter((row) => {
|
|
926
|
+
return Object.keys(filters).every((key) => {
|
|
927
|
+
const filterValue = filters[key];
|
|
928
|
+
if (!filterValue) return true;
|
|
929
|
+
const column = columns.find((col) => col.key === key);
|
|
930
|
+
if (!column) return true;
|
|
931
|
+
const rowValue = get(row, key);
|
|
932
|
+
if (column.filterFn) {
|
|
933
|
+
return column.filterFn(rowValue, filterValue, row);
|
|
934
|
+
}
|
|
935
|
+
return String(rowValue || "").toLowerCase().includes(String(filterValue).toLowerCase());
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
}, [data, filters, columns]);
|
|
939
|
+
return { filteredData, filters, setFilter };
|
|
940
|
+
};
|
|
941
|
+
const usePagination = (data, enabled = true, initialPageSize = 10) => {
|
|
942
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
943
|
+
const [pageSize, setPageSize] = useState(initialPageSize);
|
|
944
|
+
useEffect(() => {
|
|
945
|
+
setCurrentPage(1);
|
|
946
|
+
}, [data.length, pageSize]);
|
|
947
|
+
const totalItems = data.length;
|
|
948
|
+
const totalPages = enabled ? Math.ceil(totalItems / pageSize) : 1;
|
|
949
|
+
const paginatedData = useMemo(() => {
|
|
950
|
+
if (!enabled) return data;
|
|
951
|
+
const start = (currentPage - 1) * pageSize;
|
|
952
|
+
return data.slice(start, start + pageSize);
|
|
953
|
+
}, [data, currentPage, pageSize, enabled]);
|
|
954
|
+
const nextPage = () => {
|
|
955
|
+
if (currentPage < totalPages) {
|
|
956
|
+
setCurrentPage((prev) => prev + 1);
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
const prevPage = () => {
|
|
960
|
+
if (currentPage > 1) {
|
|
961
|
+
setCurrentPage((prev) => prev - 1);
|
|
1557
962
|
}
|
|
1558
963
|
};
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
964
|
+
const setPage = (page) => {
|
|
965
|
+
const p = Math.max(1, Math.min(page, totalPages));
|
|
966
|
+
setCurrentPage(p);
|
|
967
|
+
};
|
|
968
|
+
return {
|
|
969
|
+
paginatedData,
|
|
970
|
+
currentPage,
|
|
971
|
+
totalPages,
|
|
972
|
+
pageSize,
|
|
973
|
+
totalItems,
|
|
974
|
+
setPage,
|
|
975
|
+
setPageSize,
|
|
976
|
+
nextPage,
|
|
977
|
+
prevPage
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
const DataTable = ({
|
|
981
|
+
columns,
|
|
982
|
+
data,
|
|
983
|
+
loading = false,
|
|
984
|
+
pagination = true,
|
|
985
|
+
pageSizeOptions = [5, 10, 20, 50],
|
|
986
|
+
defaultPageSize = 10,
|
|
987
|
+
onRowClick,
|
|
988
|
+
noDataText = "No records found",
|
|
989
|
+
className = "",
|
|
990
|
+
maxHeight
|
|
1570
991
|
}) => {
|
|
1571
|
-
const { filteredData
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
992
|
+
const { filteredData, filters, setFilter } = useFilter(data, columns);
|
|
993
|
+
const { sortedData, sortConfig, requestSort } = useSort(filteredData, columns);
|
|
994
|
+
const {
|
|
995
|
+
paginatedData,
|
|
996
|
+
currentPage,
|
|
997
|
+
totalPages,
|
|
998
|
+
pageSize,
|
|
999
|
+
setPageSize,
|
|
1000
|
+
nextPage,
|
|
1001
|
+
prevPage,
|
|
1002
|
+
totalItems
|
|
1003
|
+
} = usePagination(sortedData, pagination, defaultPageSize);
|
|
1004
|
+
return /* @__PURE__ */ jsxs("div", { className: `jc-datatable-wrapper ${className || ""}`, children: [
|
|
1005
|
+
/* @__PURE__ */ jsx(
|
|
1583
1006
|
"div",
|
|
1584
1007
|
{
|
|
1585
1008
|
className: "jc-datatable-container",
|
|
1586
|
-
style:
|
|
1587
|
-
children: /* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
|
|
1009
|
+
style: maxHeight ? { maxHeight, overflowY: "auto" } : {},
|
|
1010
|
+
children: /* @__PURE__ */ jsxs("table", { className: "jc-datatable-table", children: [
|
|
1011
|
+
/* @__PURE__ */ jsx(
|
|
1012
|
+
TableHeader,
|
|
1590
1013
|
{
|
|
1591
|
-
columns
|
|
1592
|
-
sortConfig
|
|
1593
|
-
requestSort
|
|
1594
|
-
filters
|
|
1595
|
-
setFilter
|
|
1014
|
+
columns,
|
|
1015
|
+
sortConfig,
|
|
1016
|
+
requestSort,
|
|
1017
|
+
filters,
|
|
1018
|
+
setFilter
|
|
1596
1019
|
}
|
|
1597
1020
|
),
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
|
|
1021
|
+
/* @__PURE__ */ jsx(
|
|
1022
|
+
TableBody,
|
|
1600
1023
|
{
|
|
1601
|
-
data:
|
|
1602
|
-
columns
|
|
1603
|
-
loading
|
|
1604
|
-
onRowClick
|
|
1605
|
-
noDataText
|
|
1024
|
+
data: pagination ? paginatedData : sortedData,
|
|
1025
|
+
columns,
|
|
1026
|
+
loading,
|
|
1027
|
+
onRowClick,
|
|
1028
|
+
noDataText
|
|
1606
1029
|
}
|
|
1607
1030
|
)
|
|
1608
1031
|
] })
|
|
1609
1032
|
}
|
|
1610
1033
|
),
|
|
1611
|
-
|
|
1612
|
-
|
|
1034
|
+
pagination && !loading && data.length > 0 && /* @__PURE__ */ jsx(
|
|
1035
|
+
Pagination,
|
|
1613
1036
|
{
|
|
1614
|
-
currentPage
|
|
1615
|
-
totalPages
|
|
1616
|
-
pageSize
|
|
1617
|
-
setPageSize
|
|
1618
|
-
nextPage
|
|
1619
|
-
prevPage
|
|
1620
|
-
totalItems
|
|
1621
|
-
pageSizeOptions
|
|
1037
|
+
currentPage,
|
|
1038
|
+
totalPages,
|
|
1039
|
+
pageSize,
|
|
1040
|
+
setPageSize,
|
|
1041
|
+
nextPage,
|
|
1042
|
+
prevPage,
|
|
1043
|
+
totalItems,
|
|
1044
|
+
pageSizeOptions
|
|
1622
1045
|
}
|
|
1623
1046
|
)
|
|
1624
1047
|
] });
|
|
1625
1048
|
};
|
|
1626
|
-
|
|
1627
|
-
columns:
|
|
1628
|
-
|
|
1629
|
-
key:
|
|
1630
|
-
header:
|
|
1631
|
-
width:
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1049
|
+
DataTable.propTypes = {
|
|
1050
|
+
columns: PropTypes.arrayOf(
|
|
1051
|
+
PropTypes.shape({
|
|
1052
|
+
key: PropTypes.string.isRequired,
|
|
1053
|
+
header: PropTypes.string.isRequired,
|
|
1054
|
+
width: PropTypes.string,
|
|
1055
|
+
minWidth: PropTypes.string,
|
|
1056
|
+
maxWidth: PropTypes.string,
|
|
1057
|
+
sortable: PropTypes.bool,
|
|
1058
|
+
searchable: PropTypes.bool,
|
|
1059
|
+
render: PropTypes.func,
|
|
1060
|
+
sortFn: PropTypes.func,
|
|
1061
|
+
filterFn: PropTypes.func
|
|
1637
1062
|
})
|
|
1638
1063
|
).isRequired,
|
|
1639
|
-
data:
|
|
1640
|
-
loading:
|
|
1641
|
-
pagination:
|
|
1642
|
-
pageSizeOptions:
|
|
1643
|
-
defaultPageSize:
|
|
1644
|
-
onRowClick:
|
|
1645
|
-
noDataText:
|
|
1646
|
-
className:
|
|
1647
|
-
maxHeight:
|
|
1064
|
+
data: PropTypes.array.isRequired,
|
|
1065
|
+
loading: PropTypes.bool,
|
|
1066
|
+
pagination: PropTypes.bool,
|
|
1067
|
+
pageSizeOptions: PropTypes.arrayOf(PropTypes.number),
|
|
1068
|
+
defaultPageSize: PropTypes.number,
|
|
1069
|
+
onRowClick: PropTypes.func,
|
|
1070
|
+
noDataText: PropTypes.string,
|
|
1071
|
+
className: PropTypes.string,
|
|
1072
|
+
maxHeight: PropTypes.string
|
|
1648
1073
|
};
|
|
1649
1074
|
export {
|
|
1650
|
-
|
|
1075
|
+
DataTable
|
|
1651
1076
|
};
|