@zhanxp/station-ui 0.1.0 → 0.1.2
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/README.md +1 -1
- package/dist/components/em-pagination/index.d.ts +6 -2
- package/dist/components/em-table/index.d.ts +10 -4
- package/dist/index.d.ts +7 -9
- package/dist/station-ui.js +1609 -1587
- package/dist/station-ui.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/dist/components/em-button/index.d.ts +0 -9
- package/dist/components/em-input/index.d.ts +0 -13
package/dist/station-ui.js
CHANGED
|
@@ -1,9 +1,262 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as F, jsx as h, Fragment as tt } from "react/jsx-runtime";
|
|
2
|
+
import { Transition as L, Dialog as K, Listbox as D } from "@headlessui/react";
|
|
2
3
|
import * as B from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { Fragment as G, useState as X, useRef as Mt, useCallback as J, useMemo as le, useEffect as pe } from "react";
|
|
5
|
+
import { Close as nt, Down as Be, Check as je, Info as $t, Attention as rt, CloseOne as It, CheckOne as Et } from "@icon-park/react";
|
|
6
|
+
import { flushSync as bt, createPortal as it } from "react-dom";
|
|
7
|
+
function ot(e) {
|
|
8
|
+
var r, t, n = "";
|
|
9
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
10
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
11
|
+
var i = e.length;
|
|
12
|
+
for (r = 0; r < i; r++) e[r] && (t = ot(e[r])) && (n && (n += " "), n += t);
|
|
13
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
function Vt() {
|
|
17
|
+
for (var e, r, t = 0, n = "", i = arguments.length; t < i; t++) (e = arguments[t]) && (r = ot(e)) && (n && (n += " "), n += r);
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
function V(...e) {
|
|
21
|
+
return Vt(e);
|
|
22
|
+
}
|
|
23
|
+
const Pt = {
|
|
24
|
+
default: "#d2d6de",
|
|
25
|
+
// primary 使用 CSS 变量,响应运行时主题切换
|
|
26
|
+
primary: "var(--theme-primary)",
|
|
27
|
+
info: "#00c0ef",
|
|
28
|
+
danger: "#dd4b39",
|
|
29
|
+
warning: "#f39c12",
|
|
30
|
+
success: "#00a65a",
|
|
31
|
+
simple: "transparent"
|
|
32
|
+
};
|
|
33
|
+
function Jn({
|
|
34
|
+
theme: e = "default",
|
|
35
|
+
title: r,
|
|
36
|
+
showClose: t = !1,
|
|
37
|
+
noPadding: n = !1,
|
|
38
|
+
fixtop: i,
|
|
39
|
+
bodyStyle: o = {},
|
|
40
|
+
tabs: s = [],
|
|
41
|
+
header: l,
|
|
42
|
+
tools: a,
|
|
43
|
+
breadcrumb: u,
|
|
44
|
+
footer: f,
|
|
45
|
+
children: m,
|
|
46
|
+
onClose: c,
|
|
47
|
+
onTabClick: d,
|
|
48
|
+
className: g = ""
|
|
49
|
+
}) {
|
|
50
|
+
const p = r || l || a || t, v = { ...o };
|
|
51
|
+
if (i && i > 0) {
|
|
52
|
+
const S = typeof window < "u" ? window.innerHeight : 800;
|
|
53
|
+
v.height = `${S - i}px`, v.overflow = "auto";
|
|
54
|
+
}
|
|
55
|
+
return (
|
|
56
|
+
// borderTop 颜色依赖运行时 theme prop,无法静态化为 Tailwind 类,保留内联 style
|
|
57
|
+
/* @__PURE__ */ F(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: V("rounded-sm bg-white mb-2.5 shadow-sm", g),
|
|
61
|
+
style: { borderTop: `3px solid ${Pt[e]}` },
|
|
62
|
+
children: [
|
|
63
|
+
p && /* @__PURE__ */ F("div", { className: "border-b border-[#f4f4f4] text-[#444] relative", children: [
|
|
64
|
+
r && /* @__PURE__ */ h(
|
|
65
|
+
"h3",
|
|
66
|
+
{
|
|
67
|
+
className: "text-lg m-0 py-2.5 pl-[15px] pr-0 leading-none font-semibold",
|
|
68
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
s.map((S, w) => /* @__PURE__ */ h(
|
|
72
|
+
"h3",
|
|
73
|
+
{
|
|
74
|
+
className: V(
|
|
75
|
+
"cursor-pointer px-3 py-2.5 m-0 text-sm font-normal inline-block",
|
|
76
|
+
S.active ? "border-b-2 border-primary" : "border-b-0"
|
|
77
|
+
),
|
|
78
|
+
onClick: () => d == null ? void 0 : d(S),
|
|
79
|
+
dangerouslySetInnerHTML: { __html: S.title }
|
|
80
|
+
},
|
|
81
|
+
w
|
|
82
|
+
)),
|
|
83
|
+
l,
|
|
84
|
+
(a || t) && /* @__PURE__ */ F("div", { className: "absolute right-2.5 top-0 flex items-center", children: [
|
|
85
|
+
a,
|
|
86
|
+
t && /* @__PURE__ */ h(
|
|
87
|
+
"button",
|
|
88
|
+
{
|
|
89
|
+
onClick: c,
|
|
90
|
+
className: "p-1 mr-1 text-sm bg-transparent border-none text-[#97a0b3] cursor-pointer",
|
|
91
|
+
children: "✕"
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ h(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
className: V(!n && "p-4"),
|
|
100
|
+
style: v,
|
|
101
|
+
children: m
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
f && /* @__PURE__ */ h("div", { className: "border-t border-[#f4f4f4] bg-white p-2 rounded-b-sm", children: f })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
function Qn({
|
|
111
|
+
actions: e,
|
|
112
|
+
search: r,
|
|
113
|
+
footer: t,
|
|
114
|
+
children: n,
|
|
115
|
+
className: i = "",
|
|
116
|
+
noPadding: o = !1
|
|
117
|
+
}) {
|
|
118
|
+
return /* @__PURE__ */ F("div", { className: V("em-grid", i), children: [
|
|
119
|
+
(e || r) && /* @__PURE__ */ F("div", { className: "flex items-center justify-between px-3 py-2 bg-gray-50 border-b border-gray-200 relative", children: [
|
|
120
|
+
e && /* @__PURE__ */ h("div", { className: "flex items-center gap-1", children: e }),
|
|
121
|
+
r && /* @__PURE__ */ h("div", { className: "flex items-center gap-1", children: r })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ h("div", { className: V(o ? "" : "p-3"), children: n }),
|
|
124
|
+
t && /* @__PURE__ */ h("div", { className: "px-3 py-2 text-center border-t border-gray-200 bg-gray-50 text-sm text-gray-500", children: t })
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
const zt = {
|
|
128
|
+
sm: "max-w-sm",
|
|
129
|
+
md: "max-w-md",
|
|
130
|
+
lg: "max-w-lg",
|
|
131
|
+
xl: "max-w-xl"
|
|
132
|
+
};
|
|
133
|
+
function Yn({
|
|
134
|
+
open: e,
|
|
135
|
+
onClose: r,
|
|
136
|
+
title: t,
|
|
137
|
+
children: n,
|
|
138
|
+
footer: i,
|
|
139
|
+
maskClosable: o = !0,
|
|
140
|
+
size: s = "md",
|
|
141
|
+
className: l = ""
|
|
142
|
+
}) {
|
|
143
|
+
return /* @__PURE__ */ h(L, { appear: !0, show: e, as: G, children: /* @__PURE__ */ F(K, { as: "div", className: "relative z-[9990]", onClose: o ? r : () => {
|
|
144
|
+
}, children: [
|
|
145
|
+
/* @__PURE__ */ h(
|
|
146
|
+
L.Child,
|
|
147
|
+
{
|
|
148
|
+
as: G,
|
|
149
|
+
enter: "ease-out duration-200",
|
|
150
|
+
enterFrom: "opacity-0",
|
|
151
|
+
enterTo: "opacity-100",
|
|
152
|
+
leave: "ease-in duration-150",
|
|
153
|
+
leaveFrom: "opacity-100",
|
|
154
|
+
leaveTo: "opacity-0",
|
|
155
|
+
children: /* @__PURE__ */ h("div", { className: "fixed inset-0 bg-black/50" })
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ h("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ h("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ h(
|
|
159
|
+
L.Child,
|
|
160
|
+
{
|
|
161
|
+
as: G,
|
|
162
|
+
enter: "ease-out duration-200",
|
|
163
|
+
enterFrom: "opacity-0 scale-95",
|
|
164
|
+
enterTo: "opacity-100 scale-100",
|
|
165
|
+
leave: "ease-in duration-150",
|
|
166
|
+
leaveFrom: "opacity-100 scale-100",
|
|
167
|
+
leaveTo: "opacity-0 scale-95",
|
|
168
|
+
children: /* @__PURE__ */ F(
|
|
169
|
+
K.Panel,
|
|
170
|
+
{
|
|
171
|
+
className: `w-full ${zt[s]} transform overflow-hidden rounded-lg bg-white shadow-xl transition-all ${l}`,
|
|
172
|
+
children: [
|
|
173
|
+
t && /* @__PURE__ */ F("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
174
|
+
/* @__PURE__ */ h(K.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
175
|
+
/* @__PURE__ */ h(
|
|
176
|
+
"button",
|
|
177
|
+
{
|
|
178
|
+
onClick: r,
|
|
179
|
+
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
180
|
+
children: /* @__PURE__ */ h(nt, { size: 20 })
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ h("div", { className: "px-6 py-4", children: n }),
|
|
185
|
+
i && /* @__PURE__ */ h("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-end gap-3", children: i })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
) }) })
|
|
191
|
+
] }) });
|
|
192
|
+
}
|
|
193
|
+
const Ot = {
|
|
194
|
+
sm: "max-w-sm",
|
|
195
|
+
md: "max-w-md",
|
|
196
|
+
lg: "max-w-2xl",
|
|
197
|
+
xl: "max-w-4xl",
|
|
198
|
+
full: "max-w-full"
|
|
199
|
+
};
|
|
200
|
+
function Zn({
|
|
201
|
+
open: e,
|
|
202
|
+
onClose: r,
|
|
203
|
+
title: t,
|
|
204
|
+
children: n,
|
|
205
|
+
footer: i,
|
|
206
|
+
size: o = "md",
|
|
207
|
+
maskClosable: s = !0,
|
|
208
|
+
className: l = ""
|
|
209
|
+
}) {
|
|
210
|
+
return /* @__PURE__ */ h(L, { appear: !0, show: e, as: G, children: /* @__PURE__ */ F(K, { as: "div", className: "relative z-[9990]", onClose: s ? r : () => {
|
|
211
|
+
}, children: [
|
|
212
|
+
/* @__PURE__ */ h(
|
|
213
|
+
L.Child,
|
|
214
|
+
{
|
|
215
|
+
as: G,
|
|
216
|
+
enter: "ease-out duration-300",
|
|
217
|
+
enterFrom: "opacity-0",
|
|
218
|
+
enterTo: "opacity-100",
|
|
219
|
+
leave: "ease-in duration-200",
|
|
220
|
+
leaveFrom: "opacity-100",
|
|
221
|
+
leaveTo: "opacity-0",
|
|
222
|
+
children: /* @__PURE__ */ h("div", { className: "fixed inset-0 bg-black/50" })
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ h("div", { className: "fixed inset-0 overflow-hidden", children: /* @__PURE__ */ h("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ h("div", { className: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10", children: /* @__PURE__ */ h(
|
|
226
|
+
L.Child,
|
|
227
|
+
{
|
|
228
|
+
as: G,
|
|
229
|
+
enter: "transform transition ease-out duration-300",
|
|
230
|
+
enterFrom: "translate-x-full",
|
|
231
|
+
enterTo: "translate-x-0",
|
|
232
|
+
leave: "transform transition ease-in duration-200",
|
|
233
|
+
leaveFrom: "translate-x-0",
|
|
234
|
+
leaveTo: "translate-x-full",
|
|
235
|
+
children: /* @__PURE__ */ h(
|
|
236
|
+
K.Panel,
|
|
237
|
+
{
|
|
238
|
+
className: `pointer-events-auto w-screen ${Ot[o]} ${l}`,
|
|
239
|
+
children: /* @__PURE__ */ F("div", { className: "flex h-full flex-col bg-white shadow-xl", children: [
|
|
240
|
+
t && /* @__PURE__ */ F("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
241
|
+
/* @__PURE__ */ h(K.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
242
|
+
/* @__PURE__ */ h(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
onClick: r,
|
|
246
|
+
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
247
|
+
children: /* @__PURE__ */ h(nt, { size: 20 })
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ h("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: n }),
|
|
252
|
+
i && /* @__PURE__ */ h("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-center gap-3", children: i })
|
|
253
|
+
] })
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
) }) }) })
|
|
258
|
+
] }) });
|
|
259
|
+
}
|
|
7
260
|
/**
|
|
8
261
|
* table-core
|
|
9
262
|
*
|
|
@@ -14,78 +267,78 @@ import { Close as nt, Down as ke, Check as Te, Info as Ft, Attention as it, Clos
|
|
|
14
267
|
*
|
|
15
268
|
* @license MIT
|
|
16
269
|
*/
|
|
17
|
-
function H(e,
|
|
18
|
-
return typeof e == "function" ? e(
|
|
270
|
+
function H(e, r) {
|
|
271
|
+
return typeof e == "function" ? e(r) : e;
|
|
19
272
|
}
|
|
20
|
-
function
|
|
273
|
+
function P(e, r) {
|
|
21
274
|
return (t) => {
|
|
22
|
-
|
|
275
|
+
r.setState((n) => ({
|
|
23
276
|
...n,
|
|
24
277
|
[e]: H(t, n[e])
|
|
25
278
|
}));
|
|
26
279
|
};
|
|
27
280
|
}
|
|
28
|
-
function
|
|
281
|
+
function me(e) {
|
|
29
282
|
return e instanceof Function;
|
|
30
283
|
}
|
|
31
|
-
function
|
|
32
|
-
return Array.isArray(e) && e.every((
|
|
284
|
+
function Nt(e) {
|
|
285
|
+
return Array.isArray(e) && e.every((r) => typeof r == "number");
|
|
33
286
|
}
|
|
34
|
-
function
|
|
35
|
-
const t = [], n = (
|
|
36
|
-
|
|
37
|
-
t.push(
|
|
38
|
-
const s =
|
|
287
|
+
function At(e, r) {
|
|
288
|
+
const t = [], n = (i) => {
|
|
289
|
+
i.forEach((o) => {
|
|
290
|
+
t.push(o);
|
|
291
|
+
const s = r(o);
|
|
39
292
|
s != null && s.length && n(s);
|
|
40
293
|
});
|
|
41
294
|
};
|
|
42
295
|
return n(e), t;
|
|
43
296
|
}
|
|
44
|
-
function C(e,
|
|
45
|
-
let n = [],
|
|
46
|
-
return (
|
|
297
|
+
function C(e, r, t) {
|
|
298
|
+
let n = [], i;
|
|
299
|
+
return (o) => {
|
|
47
300
|
let s;
|
|
48
301
|
t.key && t.debug && (s = Date.now());
|
|
49
|
-
const l = e(
|
|
50
|
-
if (!(l.length !== n.length || l.some((
|
|
51
|
-
return
|
|
302
|
+
const l = e(o);
|
|
303
|
+
if (!(l.length !== n.length || l.some((f, m) => n[m] !== f)))
|
|
304
|
+
return i;
|
|
52
305
|
n = l;
|
|
53
306
|
let u;
|
|
54
|
-
if (t.key && t.debug && (u = Date.now()),
|
|
55
|
-
const
|
|
56
|
-
for (
|
|
57
|
-
|
|
58
|
-
return
|
|
307
|
+
if (t.key && t.debug && (u = Date.now()), i = r(...l), t == null || t.onChange == null || t.onChange(i), t.key && t.debug && t != null && t.debug()) {
|
|
308
|
+
const f = Math.round((Date.now() - s) * 100) / 100, m = Math.round((Date.now() - u) * 100) / 100, c = m / 16, d = (g, p) => {
|
|
309
|
+
for (g = String(g); g.length < p; )
|
|
310
|
+
g = " " + g;
|
|
311
|
+
return g;
|
|
59
312
|
};
|
|
60
|
-
console.info(`%c⏱ ${d(m, 5)} /${d(
|
|
313
|
+
console.info(`%c⏱ ${d(m, 5)} /${d(f, 5)} ms`, `
|
|
61
314
|
font-size: .6rem;
|
|
62
315
|
font-weight: bold;
|
|
63
316
|
color: hsl(${Math.max(0, Math.min(120 - 120 * c, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
64
317
|
}
|
|
65
|
-
return
|
|
318
|
+
return i;
|
|
66
319
|
};
|
|
67
320
|
}
|
|
68
|
-
function x(e,
|
|
321
|
+
function x(e, r, t, n) {
|
|
69
322
|
return {
|
|
70
323
|
debug: () => {
|
|
71
|
-
var
|
|
72
|
-
return (
|
|
324
|
+
var i;
|
|
325
|
+
return (i = e == null ? void 0 : e.debugAll) != null ? i : e[r];
|
|
73
326
|
},
|
|
74
327
|
key: process.env.NODE_ENV === "development" && t,
|
|
75
328
|
onChange: n
|
|
76
329
|
};
|
|
77
330
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
331
|
+
function Dt(e, r, t, n) {
|
|
332
|
+
const i = () => {
|
|
80
333
|
var s;
|
|
81
|
-
return (s =
|
|
82
|
-
},
|
|
83
|
-
id: `${
|
|
84
|
-
row:
|
|
334
|
+
return (s = o.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
335
|
+
}, o = {
|
|
336
|
+
id: `${r.id}_${t.id}`,
|
|
337
|
+
row: r,
|
|
85
338
|
column: t,
|
|
86
|
-
getValue: () =>
|
|
87
|
-
renderValue:
|
|
88
|
-
getContext: C(() => [e, t,
|
|
339
|
+
getValue: () => r.getValue(n),
|
|
340
|
+
renderValue: i,
|
|
341
|
+
getContext: C(() => [e, t, r, o], (s, l, a, u) => ({
|
|
89
342
|
table: s,
|
|
90
343
|
column: l,
|
|
91
344
|
row: a,
|
|
@@ -95,28 +348,28 @@ function bt(e, i, t, n) {
|
|
|
95
348
|
}), x(e.options, "debugCells", "cell.getContext"))
|
|
96
349
|
};
|
|
97
350
|
return e._features.forEach((s) => {
|
|
98
|
-
s.createCell == null || s.createCell(
|
|
99
|
-
}, {}),
|
|
351
|
+
s.createCell == null || s.createCell(o, t, r, e);
|
|
352
|
+
}, {}), o;
|
|
100
353
|
}
|
|
101
|
-
function
|
|
102
|
-
var
|
|
354
|
+
function Ht(e, r, t, n) {
|
|
355
|
+
var i, o;
|
|
103
356
|
const l = {
|
|
104
357
|
...e._getDefaultColumnDef(),
|
|
105
|
-
...
|
|
358
|
+
...r
|
|
106
359
|
}, a = l.accessorKey;
|
|
107
|
-
let u = (
|
|
108
|
-
if (l.accessorFn ?
|
|
360
|
+
let u = (i = (o = l.id) != null ? o : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? i : typeof l.header == "string" ? l.header : void 0, f;
|
|
361
|
+
if (l.accessorFn ? f = l.accessorFn : a && (a.includes(".") ? f = (c) => {
|
|
109
362
|
let d = c;
|
|
110
|
-
for (const
|
|
111
|
-
var
|
|
112
|
-
d = (
|
|
363
|
+
for (const p of a.split(".")) {
|
|
364
|
+
var g;
|
|
365
|
+
d = (g = d) == null ? void 0 : g[p], process.env.NODE_ENV !== "production" && d === void 0 && console.warn(`"${p}" in deeply nested key "${a}" returned undefined.`);
|
|
113
366
|
}
|
|
114
367
|
return d;
|
|
115
|
-
} :
|
|
368
|
+
} : f = (c) => c[l.accessorKey]), !u)
|
|
116
369
|
throw process.env.NODE_ENV !== "production" ? new Error(l.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
117
370
|
let m = {
|
|
118
371
|
id: `${String(u)}`,
|
|
119
|
-
accessorFn:
|
|
372
|
+
accessorFn: f,
|
|
120
373
|
parent: n,
|
|
121
374
|
depth: t,
|
|
122
375
|
columnDef: l,
|
|
@@ -128,8 +381,8 @@ function Vt(e, i, t, n) {
|
|
|
128
381
|
getLeafColumns: C(() => [e._getOrderColumnsFn()], (c) => {
|
|
129
382
|
var d;
|
|
130
383
|
if ((d = m.columns) != null && d.length) {
|
|
131
|
-
let
|
|
132
|
-
return c(
|
|
384
|
+
let g = m.columns.flatMap((p) => p.getLeafColumns());
|
|
385
|
+
return c(g);
|
|
133
386
|
}
|
|
134
387
|
return [m];
|
|
135
388
|
}, x(e.options, "debugColumns", "column.getLeafColumns"))
|
|
@@ -138,12 +391,12 @@ function Vt(e, i, t, n) {
|
|
|
138
391
|
c.createColumn == null || c.createColumn(m, e);
|
|
139
392
|
return m;
|
|
140
393
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
394
|
+
const b = "debugHeaders";
|
|
395
|
+
function qe(e, r, t) {
|
|
143
396
|
var n;
|
|
144
|
-
let
|
|
145
|
-
id: (n = t.id) != null ? n :
|
|
146
|
-
column:
|
|
397
|
+
let o = {
|
|
398
|
+
id: (n = t.id) != null ? n : r.id,
|
|
399
|
+
column: r,
|
|
147
400
|
index: t.index,
|
|
148
401
|
isPlaceholder: !!t.isPlaceholder,
|
|
149
402
|
placeholderId: t.placeholderId,
|
|
@@ -156,109 +409,109 @@ function Be(e, i, t) {
|
|
|
156
409
|
const s = [], l = (a) => {
|
|
157
410
|
a.subHeaders && a.subHeaders.length && a.subHeaders.map(l), s.push(a);
|
|
158
411
|
};
|
|
159
|
-
return l(
|
|
412
|
+
return l(o), s;
|
|
160
413
|
},
|
|
161
414
|
getContext: () => ({
|
|
162
415
|
table: e,
|
|
163
|
-
header:
|
|
164
|
-
column:
|
|
416
|
+
header: o,
|
|
417
|
+
column: r
|
|
165
418
|
})
|
|
166
419
|
};
|
|
167
420
|
return e._features.forEach((s) => {
|
|
168
|
-
s.createHeader == null || s.createHeader(
|
|
169
|
-
}),
|
|
421
|
+
s.createHeader == null || s.createHeader(o, e);
|
|
422
|
+
}), o;
|
|
170
423
|
}
|
|
171
|
-
const
|
|
424
|
+
const Lt = {
|
|
172
425
|
createTable: (e) => {
|
|
173
|
-
e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (
|
|
174
|
-
var
|
|
175
|
-
const l = (
|
|
176
|
-
return
|
|
177
|
-
}, x(e.options,
|
|
178
|
-
var
|
|
179
|
-
const
|
|
180
|
-
return
|
|
181
|
-
}, x(e.options,
|
|
182
|
-
var
|
|
183
|
-
const
|
|
184
|
-
return
|
|
185
|
-
}, x(e.options,
|
|
426
|
+
e.getHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n, i) => {
|
|
427
|
+
var o, s;
|
|
428
|
+
const l = (o = n == null ? void 0 : n.map((m) => t.find((c) => c.id === m)).filter(Boolean)) != null ? o : [], a = (s = i == null ? void 0 : i.map((m) => t.find((c) => c.id === m)).filter(Boolean)) != null ? s : [], u = t.filter((m) => !(n != null && n.includes(m.id)) && !(i != null && i.includes(m.id)));
|
|
429
|
+
return ae(r, [...l, ...u, ...a], e);
|
|
430
|
+
}, x(e.options, b, "getHeaderGroups")), e.getCenterHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n, i) => (t = t.filter((o) => !(n != null && n.includes(o.id)) && !(i != null && i.includes(o.id))), ae(r, t, e, "center")), x(e.options, b, "getCenterHeaderGroups")), e.getLeftHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (r, t, n) => {
|
|
431
|
+
var i;
|
|
432
|
+
const o = (i = n == null ? void 0 : n.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? i : [];
|
|
433
|
+
return ae(r, o, e, "left");
|
|
434
|
+
}, x(e.options, b, "getLeftHeaderGroups")), e.getRightHeaderGroups = C(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (r, t, n) => {
|
|
435
|
+
var i;
|
|
436
|
+
const o = (i = n == null ? void 0 : n.map((s) => t.find((l) => l.id === s)).filter(Boolean)) != null ? i : [];
|
|
437
|
+
return ae(r, o, e, "right");
|
|
438
|
+
}, x(e.options, b, "getRightHeaderGroups")), e.getFooterGroups = C(() => [e.getHeaderGroups()], (r) => [...r].reverse(), x(e.options, b, "getFooterGroups")), e.getLeftFooterGroups = C(() => [e.getLeftHeaderGroups()], (r) => [...r].reverse(), x(e.options, b, "getLeftFooterGroups")), e.getCenterFooterGroups = C(() => [e.getCenterHeaderGroups()], (r) => [...r].reverse(), x(e.options, b, "getCenterFooterGroups")), e.getRightFooterGroups = C(() => [e.getRightHeaderGroups()], (r) => [...r].reverse(), x(e.options, b, "getRightFooterGroups")), e.getFlatHeaders = C(() => [e.getHeaderGroups()], (r) => r.map((t) => t.headers).flat(), x(e.options, b, "getFlatHeaders")), e.getLeftFlatHeaders = C(() => [e.getLeftHeaderGroups()], (r) => r.map((t) => t.headers).flat(), x(e.options, b, "getLeftFlatHeaders")), e.getCenterFlatHeaders = C(() => [e.getCenterHeaderGroups()], (r) => r.map((t) => t.headers).flat(), x(e.options, b, "getCenterFlatHeaders")), e.getRightFlatHeaders = C(() => [e.getRightHeaderGroups()], (r) => r.map((t) => t.headers).flat(), x(e.options, b, "getRightFlatHeaders")), e.getCenterLeafHeaders = C(() => [e.getCenterFlatHeaders()], (r) => r.filter((t) => {
|
|
186
439
|
var n;
|
|
187
440
|
return !((n = t.subHeaders) != null && n.length);
|
|
188
|
-
}), x(e.options,
|
|
441
|
+
}), x(e.options, b, "getCenterLeafHeaders")), e.getLeftLeafHeaders = C(() => [e.getLeftFlatHeaders()], (r) => r.filter((t) => {
|
|
189
442
|
var n;
|
|
190
443
|
return !((n = t.subHeaders) != null && n.length);
|
|
191
|
-
}), x(e.options,
|
|
444
|
+
}), x(e.options, b, "getLeftLeafHeaders")), e.getRightLeafHeaders = C(() => [e.getRightFlatHeaders()], (r) => r.filter((t) => {
|
|
192
445
|
var n;
|
|
193
446
|
return !((n = t.subHeaders) != null && n.length);
|
|
194
|
-
}), x(e.options,
|
|
195
|
-
var
|
|
196
|
-
return [...(
|
|
197
|
-
}, x(e.options,
|
|
447
|
+
}), x(e.options, b, "getRightLeafHeaders")), e.getLeafHeaders = C(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (r, t, n) => {
|
|
448
|
+
var i, o, s, l, a, u;
|
|
449
|
+
return [...(i = (o = r[0]) == null ? void 0 : o.headers) != null ? i : [], ...(s = (l = t[0]) == null ? void 0 : l.headers) != null ? s : [], ...(a = (u = n[0]) == null ? void 0 : u.headers) != null ? a : []].map((f) => f.getLeafHeaders()).flat();
|
|
450
|
+
}, x(e.options, b, "getLeafHeaders"));
|
|
198
451
|
}
|
|
199
452
|
};
|
|
200
|
-
function
|
|
201
|
-
var
|
|
453
|
+
function ae(e, r, t, n) {
|
|
454
|
+
var i, o;
|
|
202
455
|
let s = 0;
|
|
203
456
|
const l = function(c, d) {
|
|
204
|
-
d === void 0 && (d = 1), s = Math.max(s, d), c.filter((
|
|
205
|
-
var
|
|
206
|
-
(
|
|
457
|
+
d === void 0 && (d = 1), s = Math.max(s, d), c.filter((g) => g.getIsVisible()).forEach((g) => {
|
|
458
|
+
var p;
|
|
459
|
+
(p = g.columns) != null && p.length && l(g.columns, d + 1);
|
|
207
460
|
}, 0);
|
|
208
461
|
};
|
|
209
462
|
l(e);
|
|
210
463
|
let a = [];
|
|
211
464
|
const u = (c, d) => {
|
|
212
|
-
const
|
|
465
|
+
const g = {
|
|
213
466
|
depth: d,
|
|
214
467
|
id: [n, `${d}`].filter(Boolean).join("_"),
|
|
215
468
|
headers: []
|
|
216
|
-
},
|
|
217
|
-
c.forEach((
|
|
218
|
-
const S = [...
|
|
219
|
-
let
|
|
220
|
-
if (
|
|
221
|
-
S.subHeaders.push(
|
|
469
|
+
}, p = [];
|
|
470
|
+
c.forEach((v) => {
|
|
471
|
+
const S = [...p].reverse()[0], w = v.column.depth === g.depth;
|
|
472
|
+
let _, $ = !1;
|
|
473
|
+
if (w && v.column.parent ? _ = v.column.parent : (_ = v.column, $ = !0), S && (S == null ? void 0 : S.column) === _)
|
|
474
|
+
S.subHeaders.push(v);
|
|
222
475
|
else {
|
|
223
|
-
const
|
|
224
|
-
id: [n, d,
|
|
476
|
+
const E = qe(t, _, {
|
|
477
|
+
id: [n, d, _.id, v == null ? void 0 : v.id].filter(Boolean).join("_"),
|
|
225
478
|
isPlaceholder: $,
|
|
226
|
-
placeholderId: $ ? `${
|
|
479
|
+
placeholderId: $ ? `${p.filter((O) => O.column === _).length}` : void 0,
|
|
227
480
|
depth: d,
|
|
228
|
-
index:
|
|
481
|
+
index: p.length
|
|
229
482
|
});
|
|
230
|
-
|
|
483
|
+
E.subHeaders.push(v), p.push(E);
|
|
231
484
|
}
|
|
232
|
-
|
|
233
|
-
}), a.push(
|
|
234
|
-
},
|
|
485
|
+
g.headers.push(v), v.headerGroup = g;
|
|
486
|
+
}), a.push(g), d > 0 && u(p, d - 1);
|
|
487
|
+
}, f = r.map((c, d) => qe(t, c, {
|
|
235
488
|
depth: s,
|
|
236
489
|
index: d
|
|
237
490
|
}));
|
|
238
|
-
u(
|
|
239
|
-
const m = (c) => c.filter((
|
|
240
|
-
let
|
|
241
|
-
|
|
491
|
+
u(f, s - 1), a.reverse();
|
|
492
|
+
const m = (c) => c.filter((g) => g.column.getIsVisible()).map((g) => {
|
|
493
|
+
let p = 0, v = 0, S = [0];
|
|
494
|
+
g.subHeaders && g.subHeaders.length ? (S = [], m(g.subHeaders).forEach((_) => {
|
|
242
495
|
let {
|
|
243
496
|
colSpan: $,
|
|
244
|
-
rowSpan:
|
|
245
|
-
} =
|
|
246
|
-
|
|
247
|
-
})) :
|
|
248
|
-
const
|
|
249
|
-
return
|
|
250
|
-
colSpan:
|
|
251
|
-
rowSpan:
|
|
497
|
+
rowSpan: E
|
|
498
|
+
} = _;
|
|
499
|
+
p += $, S.push(E);
|
|
500
|
+
})) : p = 1;
|
|
501
|
+
const w = Math.min(...S);
|
|
502
|
+
return v = v + w, g.colSpan = p, g.rowSpan = v, {
|
|
503
|
+
colSpan: p,
|
|
504
|
+
rowSpan: v
|
|
252
505
|
};
|
|
253
506
|
});
|
|
254
|
-
return m((
|
|
507
|
+
return m((i = (o = a[0]) == null ? void 0 : o.headers) != null ? i : []), a;
|
|
255
508
|
}
|
|
256
|
-
const
|
|
509
|
+
const Gt = (e, r, t, n, i, o, s) => {
|
|
257
510
|
let l = {
|
|
258
|
-
id:
|
|
511
|
+
id: r,
|
|
259
512
|
index: n,
|
|
260
513
|
original: t,
|
|
261
|
-
depth:
|
|
514
|
+
depth: i,
|
|
262
515
|
parentId: s,
|
|
263
516
|
_valuesCache: {},
|
|
264
517
|
_uniqueValuesCache: {},
|
|
@@ -281,96 +534,96 @@ const zt = (e, i, t, n, o, r, s) => {
|
|
|
281
534
|
return (u = l.getValue(a)) != null ? u : e.options.renderFallbackValue;
|
|
282
535
|
},
|
|
283
536
|
subRows: [],
|
|
284
|
-
getLeafRows: () =>
|
|
537
|
+
getLeafRows: () => At(l.subRows, (a) => a.subRows),
|
|
285
538
|
getParentRow: () => l.parentId ? e.getRow(l.parentId, !0) : void 0,
|
|
286
539
|
getParentRows: () => {
|
|
287
540
|
let a = [], u = l;
|
|
288
541
|
for (; ; ) {
|
|
289
|
-
const
|
|
290
|
-
if (!
|
|
291
|
-
a.push(
|
|
542
|
+
const f = u.getParentRow();
|
|
543
|
+
if (!f) break;
|
|
544
|
+
a.push(f), u = f;
|
|
292
545
|
}
|
|
293
546
|
return a.reverse();
|
|
294
547
|
},
|
|
295
|
-
getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((u) =>
|
|
296
|
-
_getAllCellsByColumnId: C(() => [l.getAllCells()], (a) => a.reduce((u,
|
|
548
|
+
getAllCells: C(() => [e.getAllLeafColumns()], (a) => a.map((u) => Dt(e, l, u, u.id)), x(e.options, "debugRows", "getAllCells")),
|
|
549
|
+
_getAllCellsByColumnId: C(() => [l.getAllCells()], (a) => a.reduce((u, f) => (u[f.column.id] = f, u), {}), x(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
297
550
|
};
|
|
298
551
|
for (let a = 0; a < e._features.length; a++) {
|
|
299
552
|
const u = e._features[a];
|
|
300
553
|
u == null || u.createRow == null || u.createRow(l, e);
|
|
301
554
|
}
|
|
302
555
|
return l;
|
|
303
|
-
},
|
|
304
|
-
createColumn: (e,
|
|
305
|
-
e._getFacetedRowModel =
|
|
556
|
+
}, kt = {
|
|
557
|
+
createColumn: (e, r) => {
|
|
558
|
+
e._getFacetedRowModel = r.options.getFacetedRowModel && r.options.getFacetedRowModel(r, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : r.getPreFilteredRowModel(), e._getFacetedUniqueValues = r.options.getFacetedUniqueValues && r.options.getFacetedUniqueValues(r, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = r.options.getFacetedMinMaxValues && r.options.getFacetedMinMaxValues(r, e.id), e.getFacetedMinMaxValues = () => {
|
|
306
559
|
if (e._getFacetedMinMaxValues)
|
|
307
560
|
return e._getFacetedMinMaxValues();
|
|
308
561
|
};
|
|
309
562
|
}
|
|
310
|
-
},
|
|
311
|
-
var n,
|
|
312
|
-
const
|
|
313
|
-
return !!(!((
|
|
563
|
+
}, st = (e, r, t) => {
|
|
564
|
+
var n, i;
|
|
565
|
+
const o = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
566
|
+
return !!(!((i = e.getValue(r)) == null || (i = i.toString()) == null || (i = i.toLowerCase()) == null) && i.includes(o));
|
|
314
567
|
};
|
|
315
|
-
|
|
316
|
-
const
|
|
568
|
+
st.autoRemove = (e) => z(e);
|
|
569
|
+
const lt = (e, r, t) => {
|
|
317
570
|
var n;
|
|
318
|
-
return !!(!((n = e.getValue(
|
|
571
|
+
return !!(!((n = e.getValue(r)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
319
572
|
};
|
|
320
|
-
|
|
321
|
-
const
|
|
573
|
+
lt.autoRemove = (e) => z(e);
|
|
574
|
+
const at = (e, r, t) => {
|
|
322
575
|
var n;
|
|
323
|
-
return ((n = e.getValue(
|
|
576
|
+
return ((n = e.getValue(r)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
324
577
|
};
|
|
325
|
-
|
|
326
|
-
const
|
|
578
|
+
at.autoRemove = (e) => z(e);
|
|
579
|
+
const ut = (e, r, t) => {
|
|
327
580
|
var n;
|
|
328
|
-
return (n = e.getValue(
|
|
581
|
+
return (n = e.getValue(r)) == null ? void 0 : n.includes(t);
|
|
329
582
|
};
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
var
|
|
333
|
-
return !((
|
|
583
|
+
ut.autoRemove = (e) => z(e);
|
|
584
|
+
const dt = (e, r, t) => !t.some((n) => {
|
|
585
|
+
var i;
|
|
586
|
+
return !((i = e.getValue(r)) != null && i.includes(n));
|
|
334
587
|
});
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
var
|
|
338
|
-
return (
|
|
588
|
+
dt.autoRemove = (e) => z(e) || !(e != null && e.length);
|
|
589
|
+
const gt = (e, r, t) => t.some((n) => {
|
|
590
|
+
var i;
|
|
591
|
+
return (i = e.getValue(r)) == null ? void 0 : i.includes(n);
|
|
339
592
|
});
|
|
340
|
-
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
let [n,
|
|
347
|
-
const
|
|
348
|
-
return
|
|
593
|
+
gt.autoRemove = (e) => z(e) || !(e != null && e.length);
|
|
594
|
+
const ct = (e, r, t) => e.getValue(r) === t;
|
|
595
|
+
ct.autoRemove = (e) => z(e);
|
|
596
|
+
const ft = (e, r, t) => e.getValue(r) == t;
|
|
597
|
+
ft.autoRemove = (e) => z(e);
|
|
598
|
+
const Oe = (e, r, t) => {
|
|
599
|
+
let [n, i] = t;
|
|
600
|
+
const o = e.getValue(r);
|
|
601
|
+
return o >= n && o <= i;
|
|
349
602
|
};
|
|
350
|
-
|
|
351
|
-
let [
|
|
352
|
-
if (
|
|
353
|
-
const l =
|
|
354
|
-
|
|
603
|
+
Oe.resolveFilterValue = (e) => {
|
|
604
|
+
let [r, t] = e, n = typeof r != "number" ? parseFloat(r) : r, i = typeof t != "number" ? parseFloat(t) : t, o = r === null || Number.isNaN(n) ? -1 / 0 : n, s = t === null || Number.isNaN(i) ? 1 / 0 : i;
|
|
605
|
+
if (o > s) {
|
|
606
|
+
const l = o;
|
|
607
|
+
o = s, s = l;
|
|
355
608
|
}
|
|
356
|
-
return [
|
|
609
|
+
return [o, s];
|
|
357
610
|
};
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
includesString:
|
|
361
|
-
includesStringSensitive:
|
|
362
|
-
equalsString:
|
|
363
|
-
arrIncludes:
|
|
364
|
-
arrIncludesAll:
|
|
365
|
-
arrIncludesSome:
|
|
366
|
-
equals:
|
|
367
|
-
weakEquals:
|
|
368
|
-
inNumberRange:
|
|
611
|
+
Oe.autoRemove = (e) => z(e) || z(e[0]) && z(e[1]);
|
|
612
|
+
const A = {
|
|
613
|
+
includesString: st,
|
|
614
|
+
includesStringSensitive: lt,
|
|
615
|
+
equalsString: at,
|
|
616
|
+
arrIncludes: ut,
|
|
617
|
+
arrIncludesAll: dt,
|
|
618
|
+
arrIncludesSome: gt,
|
|
619
|
+
equals: ct,
|
|
620
|
+
weakEquals: ft,
|
|
621
|
+
inNumberRange: Oe
|
|
369
622
|
};
|
|
370
|
-
function
|
|
623
|
+
function z(e) {
|
|
371
624
|
return e == null || e === "";
|
|
372
625
|
}
|
|
373
|
-
const
|
|
626
|
+
const Tt = {
|
|
374
627
|
getDefaultColumnDef: () => ({
|
|
375
628
|
filterFn: "auto"
|
|
376
629
|
}),
|
|
@@ -379,127 +632,127 @@ const Ot = {
|
|
|
379
632
|
...e
|
|
380
633
|
}),
|
|
381
634
|
getDefaultOptions: (e) => ({
|
|
382
|
-
onColumnFiltersChange:
|
|
635
|
+
onColumnFiltersChange: P("columnFilters", e),
|
|
383
636
|
filterFromLeafRows: !1,
|
|
384
637
|
maxLeafRowFilterDepth: 100
|
|
385
638
|
}),
|
|
386
|
-
createColumn: (e,
|
|
639
|
+
createColumn: (e, r) => {
|
|
387
640
|
e.getAutoFilterFn = () => {
|
|
388
|
-
const t =
|
|
389
|
-
return typeof n == "string" ?
|
|
641
|
+
const t = r.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
642
|
+
return typeof n == "string" ? A.includesString : typeof n == "number" ? A.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? A.equals : Array.isArray(n) ? A.arrIncludes : A.weakEquals;
|
|
390
643
|
}, e.getFilterFn = () => {
|
|
391
644
|
var t, n;
|
|
392
|
-
return
|
|
645
|
+
return me(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
393
646
|
// @ts-ignore
|
|
394
|
-
(t = (n =
|
|
647
|
+
(t = (n = r.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : A[e.columnDef.filterFn]
|
|
395
648
|
);
|
|
396
649
|
}, e.getCanFilter = () => {
|
|
397
|
-
var t, n,
|
|
398
|
-
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n =
|
|
650
|
+
var t, n, i;
|
|
651
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = r.options.enableColumnFilters) != null ? n : !0) && ((i = r.options.enableFilters) != null ? i : !0) && !!e.accessorFn;
|
|
399
652
|
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
400
653
|
var t;
|
|
401
|
-
return (t =
|
|
654
|
+
return (t = r.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
402
655
|
}, e.getFilterIndex = () => {
|
|
403
656
|
var t, n;
|
|
404
|
-
return (t = (n =
|
|
657
|
+
return (t = (n = r.getState().columnFilters) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
405
658
|
}, e.setFilterValue = (t) => {
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
659
|
+
r.setColumnFilters((n) => {
|
|
660
|
+
const i = e.getFilterFn(), o = n == null ? void 0 : n.find((f) => f.id === e.id), s = H(t, o ? o.value : void 0);
|
|
661
|
+
if (Ue(i, s, e)) {
|
|
409
662
|
var l;
|
|
410
|
-
return (l = n == null ? void 0 : n.filter((
|
|
663
|
+
return (l = n == null ? void 0 : n.filter((f) => f.id !== e.id)) != null ? l : [];
|
|
411
664
|
}
|
|
412
665
|
const a = {
|
|
413
666
|
id: e.id,
|
|
414
667
|
value: s
|
|
415
668
|
};
|
|
416
|
-
if (
|
|
669
|
+
if (o) {
|
|
417
670
|
var u;
|
|
418
|
-
return (u = n == null ? void 0 : n.map((
|
|
671
|
+
return (u = n == null ? void 0 : n.map((f) => f.id === e.id ? a : f)) != null ? u : [];
|
|
419
672
|
}
|
|
420
673
|
return n != null && n.length ? [...n, a] : [a];
|
|
421
674
|
});
|
|
422
675
|
};
|
|
423
676
|
},
|
|
424
|
-
createRow: (e,
|
|
677
|
+
createRow: (e, r) => {
|
|
425
678
|
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
426
679
|
},
|
|
427
680
|
createTable: (e) => {
|
|
428
|
-
e.setColumnFilters = (
|
|
429
|
-
const t = e.getAllLeafColumns(), n = (
|
|
430
|
-
var
|
|
431
|
-
return (
|
|
681
|
+
e.setColumnFilters = (r) => {
|
|
682
|
+
const t = e.getAllLeafColumns(), n = (i) => {
|
|
683
|
+
var o;
|
|
684
|
+
return (o = H(r, i)) == null ? void 0 : o.filter((s) => {
|
|
432
685
|
const l = t.find((a) => a.id === s.id);
|
|
433
686
|
if (l) {
|
|
434
687
|
const a = l.getFilterFn();
|
|
435
|
-
if (
|
|
688
|
+
if (Ue(a, s.value, l))
|
|
436
689
|
return !1;
|
|
437
690
|
}
|
|
438
691
|
return !0;
|
|
439
692
|
});
|
|
440
693
|
};
|
|
441
694
|
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
442
|
-
}, e.resetColumnFilters = (
|
|
695
|
+
}, e.resetColumnFilters = (r) => {
|
|
443
696
|
var t, n;
|
|
444
|
-
e.setColumnFilters(
|
|
697
|
+
e.setColumnFilters(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
445
698
|
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
|
|
446
699
|
}
|
|
447
700
|
};
|
|
448
|
-
function
|
|
449
|
-
return (e && e.autoRemove ? e.autoRemove(
|
|
701
|
+
function Ue(e, r, t) {
|
|
702
|
+
return (e && e.autoRemove ? e.autoRemove(r, t) : !1) || typeof r > "u" || typeof r == "string" && !r;
|
|
450
703
|
}
|
|
451
|
-
const
|
|
452
|
-
const
|
|
453
|
-
return n + (typeof
|
|
454
|
-
}, 0),
|
|
704
|
+
const Bt = (e, r, t) => t.reduce((n, i) => {
|
|
705
|
+
const o = i.getValue(e);
|
|
706
|
+
return n + (typeof o == "number" ? o : 0);
|
|
707
|
+
}, 0), jt = (e, r, t) => {
|
|
455
708
|
let n;
|
|
456
|
-
return t.forEach((
|
|
457
|
-
const
|
|
458
|
-
|
|
709
|
+
return t.forEach((i) => {
|
|
710
|
+
const o = i.getValue(e);
|
|
711
|
+
o != null && (n > o || n === void 0 && o >= o) && (n = o);
|
|
459
712
|
}), n;
|
|
460
|
-
},
|
|
713
|
+
}, qt = (e, r, t) => {
|
|
461
714
|
let n;
|
|
462
|
-
return t.forEach((
|
|
463
|
-
const
|
|
464
|
-
|
|
715
|
+
return t.forEach((i) => {
|
|
716
|
+
const o = i.getValue(e);
|
|
717
|
+
o != null && (n < o || n === void 0 && o >= o) && (n = o);
|
|
465
718
|
}), n;
|
|
466
|
-
},
|
|
467
|
-
let n,
|
|
468
|
-
return t.forEach((
|
|
469
|
-
const s =
|
|
470
|
-
s != null && (n === void 0 ? s >= s && (n =
|
|
471
|
-
}), [n,
|
|
472
|
-
},
|
|
719
|
+
}, Ut = (e, r, t) => {
|
|
720
|
+
let n, i;
|
|
721
|
+
return t.forEach((o) => {
|
|
722
|
+
const s = o.getValue(e);
|
|
723
|
+
s != null && (n === void 0 ? s >= s && (n = i = s) : (n > s && (n = s), i < s && (i = s)));
|
|
724
|
+
}), [n, i];
|
|
725
|
+
}, Wt = (e, r) => {
|
|
473
726
|
let t = 0, n = 0;
|
|
474
|
-
if (
|
|
475
|
-
let
|
|
476
|
-
|
|
727
|
+
if (r.forEach((i) => {
|
|
728
|
+
let o = i.getValue(e);
|
|
729
|
+
o != null && (o = +o) >= o && (++t, n += o);
|
|
477
730
|
}), t) return n / t;
|
|
478
|
-
},
|
|
479
|
-
if (!
|
|
731
|
+
}, Kt = (e, r) => {
|
|
732
|
+
if (!r.length)
|
|
480
733
|
return;
|
|
481
|
-
const t =
|
|
482
|
-
if (!
|
|
734
|
+
const t = r.map((o) => o.getValue(e));
|
|
735
|
+
if (!Nt(t))
|
|
483
736
|
return;
|
|
484
737
|
if (t.length === 1)
|
|
485
738
|
return t[0];
|
|
486
|
-
const n = Math.floor(t.length / 2),
|
|
487
|
-
return t.length % 2 !== 0 ?
|
|
488
|
-
},
|
|
489
|
-
sum:
|
|
490
|
-
min:
|
|
491
|
-
max:
|
|
492
|
-
extent:
|
|
493
|
-
mean:
|
|
494
|
-
median:
|
|
495
|
-
unique:
|
|
496
|
-
uniqueCount:
|
|
497
|
-
count:
|
|
498
|
-
},
|
|
739
|
+
const n = Math.floor(t.length / 2), i = t.sort((o, s) => o - s);
|
|
740
|
+
return t.length % 2 !== 0 ? i[n] : (i[n - 1] + i[n]) / 2;
|
|
741
|
+
}, Xt = (e, r) => Array.from(new Set(r.map((t) => t.getValue(e))).values()), Jt = (e, r) => new Set(r.map((t) => t.getValue(e))).size, Qt = (e, r) => r.length, xe = {
|
|
742
|
+
sum: Bt,
|
|
743
|
+
min: jt,
|
|
744
|
+
max: qt,
|
|
745
|
+
extent: Ut,
|
|
746
|
+
mean: Wt,
|
|
747
|
+
median: Kt,
|
|
748
|
+
unique: Xt,
|
|
749
|
+
uniqueCount: Jt,
|
|
750
|
+
count: Qt
|
|
751
|
+
}, Yt = {
|
|
499
752
|
getDefaultColumnDef: () => ({
|
|
500
753
|
aggregatedCell: (e) => {
|
|
501
|
-
var
|
|
502
|
-
return (
|
|
754
|
+
var r, t;
|
|
755
|
+
return (r = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? r : null;
|
|
503
756
|
},
|
|
504
757
|
aggregationFn: "auto"
|
|
505
758
|
}),
|
|
@@ -508,237 +761,237 @@ const At = (e, i, t) => t.reduce((n, o) => {
|
|
|
508
761
|
...e
|
|
509
762
|
}),
|
|
510
763
|
getDefaultOptions: (e) => ({
|
|
511
|
-
onGroupingChange:
|
|
764
|
+
onGroupingChange: P("grouping", e),
|
|
512
765
|
groupedColumnMode: "reorder"
|
|
513
766
|
}),
|
|
514
|
-
createColumn: (e,
|
|
767
|
+
createColumn: (e, r) => {
|
|
515
768
|
e.toggleGrouping = () => {
|
|
516
|
-
|
|
769
|
+
r.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
517
770
|
}, e.getCanGroup = () => {
|
|
518
771
|
var t, n;
|
|
519
|
-
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n =
|
|
772
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = r.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
520
773
|
}, e.getIsGrouped = () => {
|
|
521
774
|
var t;
|
|
522
|
-
return (t =
|
|
775
|
+
return (t = r.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
523
776
|
}, e.getGroupedIndex = () => {
|
|
524
777
|
var t;
|
|
525
|
-
return (t =
|
|
778
|
+
return (t = r.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
526
779
|
}, e.getToggleGroupingHandler = () => {
|
|
527
780
|
const t = e.getCanGroup();
|
|
528
781
|
return () => {
|
|
529
782
|
t && e.toggleGrouping();
|
|
530
783
|
};
|
|
531
784
|
}, e.getAutoAggregationFn = () => {
|
|
532
|
-
const t =
|
|
785
|
+
const t = r.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
533
786
|
if (typeof n == "number")
|
|
534
|
-
return
|
|
787
|
+
return xe.sum;
|
|
535
788
|
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
536
|
-
return
|
|
789
|
+
return xe.extent;
|
|
537
790
|
}, e.getAggregationFn = () => {
|
|
538
791
|
var t, n;
|
|
539
792
|
if (!e)
|
|
540
793
|
throw new Error();
|
|
541
|
-
return
|
|
794
|
+
return me(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = r.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : xe[e.columnDef.aggregationFn];
|
|
542
795
|
};
|
|
543
796
|
},
|
|
544
797
|
createTable: (e) => {
|
|
545
|
-
e.setGrouping = (
|
|
798
|
+
e.setGrouping = (r) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(r), e.resetGrouping = (r) => {
|
|
546
799
|
var t, n;
|
|
547
|
-
e.setGrouping(
|
|
800
|
+
e.setGrouping(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
548
801
|
}, e.getPreGroupedRowModel = () => e.getFilteredRowModel(), e.getGroupedRowModel = () => (!e._getGroupedRowModel && e.options.getGroupedRowModel && (e._getGroupedRowModel = e.options.getGroupedRowModel(e)), e.options.manualGrouping || !e._getGroupedRowModel ? e.getPreGroupedRowModel() : e._getGroupedRowModel());
|
|
549
802
|
},
|
|
550
|
-
createRow: (e,
|
|
803
|
+
createRow: (e, r) => {
|
|
551
804
|
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
552
805
|
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
553
806
|
return e._groupingValuesCache[t];
|
|
554
|
-
const n =
|
|
807
|
+
const n = r.getColumn(t);
|
|
555
808
|
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
556
809
|
}, e._groupingValuesCache = {};
|
|
557
810
|
},
|
|
558
|
-
createCell: (e,
|
|
559
|
-
e.getIsGrouped = () =>
|
|
560
|
-
var
|
|
561
|
-
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((
|
|
811
|
+
createCell: (e, r, t, n) => {
|
|
812
|
+
e.getIsGrouped = () => r.getIsGrouped() && r.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && r.getIsGrouped(), e.getIsAggregated = () => {
|
|
813
|
+
var i;
|
|
814
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((i = t.subRows) != null && i.length);
|
|
562
815
|
};
|
|
563
816
|
}
|
|
564
817
|
};
|
|
565
|
-
function
|
|
566
|
-
if (!(
|
|
818
|
+
function Zt(e, r, t) {
|
|
819
|
+
if (!(r != null && r.length) || !t)
|
|
567
820
|
return e;
|
|
568
|
-
const n = e.filter((
|
|
569
|
-
return t === "remove" ? n : [...
|
|
821
|
+
const n = e.filter((o) => !r.includes(o.id));
|
|
822
|
+
return t === "remove" ? n : [...r.map((o) => e.find((s) => s.id === o)).filter(Boolean), ...n];
|
|
570
823
|
}
|
|
571
|
-
const
|
|
824
|
+
const en = {
|
|
572
825
|
getInitialState: (e) => ({
|
|
573
826
|
columnOrder: [],
|
|
574
827
|
...e
|
|
575
828
|
}),
|
|
576
829
|
getDefaultOptions: (e) => ({
|
|
577
|
-
onColumnOrderChange:
|
|
830
|
+
onColumnOrderChange: P("columnOrder", e)
|
|
578
831
|
}),
|
|
579
|
-
createColumn: (e,
|
|
580
|
-
e.getIndex = C((t) => [
|
|
832
|
+
createColumn: (e, r) => {
|
|
833
|
+
e.getIndex = C((t) => [re(r, t)], (t) => t.findIndex((n) => n.id === e.id), x(r.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
581
834
|
var n;
|
|
582
|
-
return ((n =
|
|
835
|
+
return ((n = re(r, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
583
836
|
}, e.getIsLastColumn = (t) => {
|
|
584
837
|
var n;
|
|
585
|
-
const
|
|
586
|
-
return ((n =
|
|
838
|
+
const i = re(r, t);
|
|
839
|
+
return ((n = i[i.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
587
840
|
};
|
|
588
841
|
},
|
|
589
842
|
createTable: (e) => {
|
|
590
|
-
e.setColumnOrder = (
|
|
843
|
+
e.setColumnOrder = (r) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(r), e.resetColumnOrder = (r) => {
|
|
591
844
|
var t;
|
|
592
|
-
e.setColumnOrder(
|
|
593
|
-
}, e._getOrderColumnsFn = C(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (
|
|
594
|
-
let
|
|
595
|
-
if (!(
|
|
596
|
-
|
|
845
|
+
e.setColumnOrder(r ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
846
|
+
}, e._getOrderColumnsFn = C(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (r, t, n) => (i) => {
|
|
847
|
+
let o = [];
|
|
848
|
+
if (!(r != null && r.length))
|
|
849
|
+
o = i;
|
|
597
850
|
else {
|
|
598
|
-
const s = [...
|
|
851
|
+
const s = [...r], l = [...i];
|
|
599
852
|
for (; l.length && s.length; ) {
|
|
600
|
-
const a = s.shift(), u = l.findIndex((
|
|
601
|
-
u > -1 &&
|
|
853
|
+
const a = s.shift(), u = l.findIndex((f) => f.id === a);
|
|
854
|
+
u > -1 && o.push(l.splice(u, 1)[0]);
|
|
602
855
|
}
|
|
603
|
-
|
|
856
|
+
o = [...o, ...l];
|
|
604
857
|
}
|
|
605
|
-
return
|
|
858
|
+
return Zt(o, t, n);
|
|
606
859
|
}, x(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
607
860
|
}
|
|
608
|
-
},
|
|
861
|
+
}, Re = () => ({
|
|
609
862
|
left: [],
|
|
610
863
|
right: []
|
|
611
|
-
}),
|
|
864
|
+
}), tn = {
|
|
612
865
|
getInitialState: (e) => ({
|
|
613
|
-
columnPinning:
|
|
866
|
+
columnPinning: Re(),
|
|
614
867
|
...e
|
|
615
868
|
}),
|
|
616
869
|
getDefaultOptions: (e) => ({
|
|
617
|
-
onColumnPinningChange:
|
|
870
|
+
onColumnPinningChange: P("columnPinning", e)
|
|
618
871
|
}),
|
|
619
|
-
createColumn: (e,
|
|
872
|
+
createColumn: (e, r) => {
|
|
620
873
|
e.pin = (t) => {
|
|
621
|
-
const n = e.getLeafColumns().map((
|
|
622
|
-
|
|
623
|
-
var
|
|
874
|
+
const n = e.getLeafColumns().map((i) => i.id).filter(Boolean);
|
|
875
|
+
r.setColumnPinning((i) => {
|
|
876
|
+
var o, s;
|
|
624
877
|
if (t === "right") {
|
|
625
878
|
var l, a;
|
|
626
879
|
return {
|
|
627
|
-
left: ((l =
|
|
628
|
-
right: [...((a =
|
|
880
|
+
left: ((l = i == null ? void 0 : i.left) != null ? l : []).filter((m) => !(n != null && n.includes(m))),
|
|
881
|
+
right: [...((a = i == null ? void 0 : i.right) != null ? a : []).filter((m) => !(n != null && n.includes(m))), ...n]
|
|
629
882
|
};
|
|
630
883
|
}
|
|
631
884
|
if (t === "left") {
|
|
632
|
-
var u,
|
|
885
|
+
var u, f;
|
|
633
886
|
return {
|
|
634
|
-
left: [...((u =
|
|
635
|
-
right: ((
|
|
887
|
+
left: [...((u = i == null ? void 0 : i.left) != null ? u : []).filter((m) => !(n != null && n.includes(m))), ...n],
|
|
888
|
+
right: ((f = i == null ? void 0 : i.right) != null ? f : []).filter((m) => !(n != null && n.includes(m)))
|
|
636
889
|
};
|
|
637
890
|
}
|
|
638
891
|
return {
|
|
639
|
-
left: ((
|
|
640
|
-
right: ((s =
|
|
892
|
+
left: ((o = i == null ? void 0 : i.left) != null ? o : []).filter((m) => !(n != null && n.includes(m))),
|
|
893
|
+
right: ((s = i == null ? void 0 : i.right) != null ? s : []).filter((m) => !(n != null && n.includes(m)))
|
|
641
894
|
};
|
|
642
895
|
});
|
|
643
896
|
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
644
|
-
var
|
|
645
|
-
return ((
|
|
897
|
+
var i, o, s;
|
|
898
|
+
return ((i = n.columnDef.enablePinning) != null ? i : !0) && ((o = (s = r.options.enableColumnPinning) != null ? s : r.options.enablePinning) != null ? o : !0);
|
|
646
899
|
}), e.getIsPinned = () => {
|
|
647
900
|
const t = e.getLeafColumns().map((l) => l.id), {
|
|
648
901
|
left: n,
|
|
649
|
-
right:
|
|
650
|
-
} =
|
|
651
|
-
return
|
|
902
|
+
right: i
|
|
903
|
+
} = r.getState().columnPinning, o = t.some((l) => n == null ? void 0 : n.includes(l)), s = t.some((l) => i == null ? void 0 : i.includes(l));
|
|
904
|
+
return o ? "left" : s ? "right" : !1;
|
|
652
905
|
}, e.getPinnedIndex = () => {
|
|
653
906
|
var t, n;
|
|
654
|
-
const
|
|
655
|
-
return
|
|
907
|
+
const i = e.getIsPinned();
|
|
908
|
+
return i ? (t = (n = r.getState().columnPinning) == null || (n = n[i]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
656
909
|
};
|
|
657
910
|
},
|
|
658
|
-
createRow: (e,
|
|
659
|
-
e.getCenterVisibleCells = C(() => [e._getAllVisibleCells(),
|
|
660
|
-
const
|
|
661
|
-
return t.filter((s) => !
|
|
662
|
-
}, x(
|
|
663
|
-
...
|
|
911
|
+
createRow: (e, r) => {
|
|
912
|
+
e.getCenterVisibleCells = C(() => [e._getAllVisibleCells(), r.getState().columnPinning.left, r.getState().columnPinning.right], (t, n, i) => {
|
|
913
|
+
const o = [...n ?? [], ...i ?? []];
|
|
914
|
+
return t.filter((s) => !o.includes(s.column.id));
|
|
915
|
+
}, x(r.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = C(() => [e._getAllVisibleCells(), r.getState().columnPinning.left], (t, n) => (n ?? []).map((o) => t.find((s) => s.column.id === o)).filter(Boolean).map((o) => ({
|
|
916
|
+
...o,
|
|
664
917
|
position: "left"
|
|
665
|
-
})), x(
|
|
666
|
-
...
|
|
918
|
+
})), x(r.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = C(() => [e._getAllVisibleCells(), r.getState().columnPinning.right], (t, n) => (n ?? []).map((o) => t.find((s) => s.column.id === o)).filter(Boolean).map((o) => ({
|
|
919
|
+
...o,
|
|
667
920
|
position: "right"
|
|
668
|
-
})), x(
|
|
921
|
+
})), x(r.options, "debugRows", "getRightVisibleCells"));
|
|
669
922
|
},
|
|
670
923
|
createTable: (e) => {
|
|
671
|
-
e.setColumnPinning = (
|
|
924
|
+
e.setColumnPinning = (r) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(r), e.resetColumnPinning = (r) => {
|
|
672
925
|
var t, n;
|
|
673
|
-
return e.setColumnPinning(
|
|
674
|
-
}, e.getIsSomeColumnsPinned = (
|
|
926
|
+
return e.setColumnPinning(r ? Re() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : Re());
|
|
927
|
+
}, e.getIsSomeColumnsPinned = (r) => {
|
|
675
928
|
var t;
|
|
676
929
|
const n = e.getState().columnPinning;
|
|
677
|
-
if (!
|
|
678
|
-
var
|
|
679
|
-
return !!((
|
|
930
|
+
if (!r) {
|
|
931
|
+
var i, o;
|
|
932
|
+
return !!((i = n.left) != null && i.length || (o = n.right) != null && o.length);
|
|
680
933
|
}
|
|
681
|
-
return !!((t = n[
|
|
682
|
-
}, e.getLeftLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (
|
|
683
|
-
const
|
|
684
|
-
return
|
|
934
|
+
return !!((t = n[r]) != null && t.length);
|
|
935
|
+
}, e.getLeftLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (r, t) => (t ?? []).map((n) => r.find((i) => i.id === n)).filter(Boolean), x(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (r, t) => (t ?? []).map((n) => r.find((i) => i.id === n)).filter(Boolean), x(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = C(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (r, t, n) => {
|
|
936
|
+
const i = [...t ?? [], ...n ?? []];
|
|
937
|
+
return r.filter((o) => !i.includes(o.id));
|
|
685
938
|
}, x(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
686
939
|
}
|
|
687
940
|
};
|
|
688
|
-
function
|
|
941
|
+
function nn(e) {
|
|
689
942
|
return e || (typeof document < "u" ? document : null);
|
|
690
943
|
}
|
|
691
|
-
const
|
|
944
|
+
const ue = {
|
|
692
945
|
size: 150,
|
|
693
946
|
minSize: 20,
|
|
694
947
|
maxSize: Number.MAX_SAFE_INTEGER
|
|
695
|
-
},
|
|
948
|
+
}, ye = () => ({
|
|
696
949
|
startOffset: null,
|
|
697
950
|
startSize: null,
|
|
698
951
|
deltaOffset: null,
|
|
699
952
|
deltaPercentage: null,
|
|
700
953
|
isResizingColumn: !1,
|
|
701
954
|
columnSizingStart: []
|
|
702
|
-
}),
|
|
703
|
-
getDefaultColumnDef: () =>
|
|
955
|
+
}), rn = {
|
|
956
|
+
getDefaultColumnDef: () => ue,
|
|
704
957
|
getInitialState: (e) => ({
|
|
705
958
|
columnSizing: {},
|
|
706
|
-
columnSizingInfo:
|
|
959
|
+
columnSizingInfo: ye(),
|
|
707
960
|
...e
|
|
708
961
|
}),
|
|
709
962
|
getDefaultOptions: (e) => ({
|
|
710
963
|
columnResizeMode: "onEnd",
|
|
711
964
|
columnResizeDirection: "ltr",
|
|
712
|
-
onColumnSizingChange:
|
|
713
|
-
onColumnSizingInfoChange:
|
|
965
|
+
onColumnSizingChange: P("columnSizing", e),
|
|
966
|
+
onColumnSizingInfoChange: P("columnSizingInfo", e)
|
|
714
967
|
}),
|
|
715
|
-
createColumn: (e,
|
|
968
|
+
createColumn: (e, r) => {
|
|
716
969
|
e.getSize = () => {
|
|
717
|
-
var t, n,
|
|
718
|
-
const
|
|
719
|
-
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t :
|
|
720
|
-
}, e.getStart = C((t) => [t,
|
|
721
|
-
|
|
970
|
+
var t, n, i;
|
|
971
|
+
const o = r.getState().columnSizing[e.id];
|
|
972
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : ue.minSize, (n = o ?? e.columnDef.size) != null ? n : ue.size), (i = e.columnDef.maxSize) != null ? i : ue.maxSize);
|
|
973
|
+
}, e.getStart = C((t) => [t, re(r, t), r.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((i, o) => i + o.getSize(), 0), x(r.options, "debugColumns", "getStart")), e.getAfter = C((t) => [t, re(r, t), r.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((i, o) => i + o.getSize(), 0), x(r.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
974
|
+
r.setColumnSizing((t) => {
|
|
722
975
|
let {
|
|
723
976
|
[e.id]: n,
|
|
724
|
-
...
|
|
977
|
+
...i
|
|
725
978
|
} = t;
|
|
726
|
-
return
|
|
979
|
+
return i;
|
|
727
980
|
});
|
|
728
981
|
}, e.getCanResize = () => {
|
|
729
982
|
var t, n;
|
|
730
|
-
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n =
|
|
731
|
-
}, e.getIsResizing = () =>
|
|
983
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = r.options.enableColumnResizing) != null ? n : !0);
|
|
984
|
+
}, e.getIsResizing = () => r.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
732
985
|
},
|
|
733
|
-
createHeader: (e,
|
|
986
|
+
createHeader: (e, r) => {
|
|
734
987
|
e.getSize = () => {
|
|
735
988
|
let t = 0;
|
|
736
|
-
const n = (
|
|
737
|
-
if (
|
|
738
|
-
|
|
989
|
+
const n = (i) => {
|
|
990
|
+
if (i.subHeaders.length)
|
|
991
|
+
i.subHeaders.forEach(n);
|
|
739
992
|
else {
|
|
740
|
-
var
|
|
741
|
-
t += (
|
|
993
|
+
var o;
|
|
994
|
+
t += (o = i.column.getSize()) != null ? o : 0;
|
|
742
995
|
}
|
|
743
996
|
};
|
|
744
997
|
return n(e), t;
|
|
@@ -749,29 +1002,29 @@ const ae = {
|
|
|
749
1002
|
}
|
|
750
1003
|
return 0;
|
|
751
1004
|
}, e.getResizeHandler = (t) => {
|
|
752
|
-
const n =
|
|
753
|
-
return (
|
|
754
|
-
if (!n || !
|
|
1005
|
+
const n = r.getColumn(e.column.id), i = n == null ? void 0 : n.getCanResize();
|
|
1006
|
+
return (o) => {
|
|
1007
|
+
if (!n || !i || (o.persist == null || o.persist(), _e(o) && o.touches && o.touches.length > 1))
|
|
755
1008
|
return;
|
|
756
|
-
const s = e.getSize(), l = e ? e.getLeafHeaders().map((S) => [S.column.id, S.column.getSize()]) : [[n.id, n.getSize()]], a =
|
|
757
|
-
typeof
|
|
758
|
-
var $,
|
|
759
|
-
const
|
|
760
|
-
return
|
|
761
|
-
let [
|
|
762
|
-
u[
|
|
1009
|
+
const s = e.getSize(), l = e ? e.getLeafHeaders().map((S) => [S.column.id, S.column.getSize()]) : [[n.id, n.getSize()]], a = _e(o) ? Math.round(o.touches[0].clientX) : o.clientX, u = {}, f = (S, w) => {
|
|
1010
|
+
typeof w == "number" && (r.setColumnSizingInfo((_) => {
|
|
1011
|
+
var $, E;
|
|
1012
|
+
const O = r.options.columnResizeDirection === "rtl" ? -1 : 1, oe = (w - (($ = _ == null ? void 0 : _.startOffset) != null ? $ : 0)) * O, Y = Math.max(oe / ((E = _ == null ? void 0 : _.startSize) != null ? E : 0), -0.999999);
|
|
1013
|
+
return _.columnSizingStart.forEach((Se) => {
|
|
1014
|
+
let [ve, j] = Se;
|
|
1015
|
+
u[ve] = Math.round(Math.max(j + j * Y, 0) * 100) / 100;
|
|
763
1016
|
}), {
|
|
764
|
-
...
|
|
765
|
-
deltaOffset:
|
|
766
|
-
deltaPercentage:
|
|
1017
|
+
..._,
|
|
1018
|
+
deltaOffset: oe,
|
|
1019
|
+
deltaPercentage: Y
|
|
767
1020
|
};
|
|
768
|
-
}), (
|
|
769
|
-
...
|
|
1021
|
+
}), (r.options.columnResizeMode === "onChange" || S === "end") && r.setColumnSizing((_) => ({
|
|
1022
|
+
..._,
|
|
770
1023
|
...u
|
|
771
1024
|
})));
|
|
772
|
-
}, m = (S) =>
|
|
773
|
-
|
|
774
|
-
...
|
|
1025
|
+
}, m = (S) => f("move", S), c = (S) => {
|
|
1026
|
+
f("end", S), r.setColumnSizingInfo((w) => ({
|
|
1027
|
+
...w,
|
|
775
1028
|
isResizingColumn: !1,
|
|
776
1029
|
startOffset: null,
|
|
777
1030
|
startSize: null,
|
|
@@ -779,21 +1032,21 @@ const ae = {
|
|
|
779
1032
|
deltaPercentage: null,
|
|
780
1033
|
columnSizingStart: []
|
|
781
1034
|
}));
|
|
782
|
-
}, d =
|
|
1035
|
+
}, d = nn(t), g = {
|
|
783
1036
|
moveHandler: (S) => m(S.clientX),
|
|
784
1037
|
upHandler: (S) => {
|
|
785
|
-
d == null || d.removeEventListener("mousemove",
|
|
1038
|
+
d == null || d.removeEventListener("mousemove", g.moveHandler), d == null || d.removeEventListener("mouseup", g.upHandler), c(S.clientX);
|
|
786
1039
|
}
|
|
787
|
-
},
|
|
1040
|
+
}, p = {
|
|
788
1041
|
moveHandler: (S) => (S.cancelable && (S.preventDefault(), S.stopPropagation()), m(S.touches[0].clientX), !1),
|
|
789
1042
|
upHandler: (S) => {
|
|
790
|
-
var
|
|
791
|
-
d == null || d.removeEventListener("touchmove",
|
|
1043
|
+
var w;
|
|
1044
|
+
d == null || d.removeEventListener("touchmove", p.moveHandler), d == null || d.removeEventListener("touchend", p.upHandler), S.cancelable && (S.preventDefault(), S.stopPropagation()), c((w = S.touches[0]) == null ? void 0 : w.clientX);
|
|
792
1045
|
}
|
|
793
|
-
},
|
|
1046
|
+
}, v = on() ? {
|
|
794
1047
|
passive: !1
|
|
795
1048
|
} : !1;
|
|
796
|
-
|
|
1049
|
+
_e(o) ? (d == null || d.addEventListener("touchmove", p.moveHandler, v), d == null || d.addEventListener("touchend", p.upHandler, v)) : (d == null || d.addEventListener("mousemove", g.moveHandler, v), d == null || d.addEventListener("mouseup", g.upHandler, v)), r.setColumnSizingInfo((S) => ({
|
|
797
1050
|
...S,
|
|
798
1051
|
startOffset: a,
|
|
799
1052
|
startSize: s,
|
|
@@ -806,85 +1059,85 @@ const ae = {
|
|
|
806
1059
|
};
|
|
807
1060
|
},
|
|
808
1061
|
createTable: (e) => {
|
|
809
|
-
e.setColumnSizing = (
|
|
1062
|
+
e.setColumnSizing = (r) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(r), e.setColumnSizingInfo = (r) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(r), e.resetColumnSizing = (r) => {
|
|
810
1063
|
var t;
|
|
811
|
-
e.setColumnSizing(
|
|
812
|
-
}, e.resetHeaderSizeInfo = (
|
|
1064
|
+
e.setColumnSizing(r ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1065
|
+
}, e.resetHeaderSizeInfo = (r) => {
|
|
813
1066
|
var t;
|
|
814
|
-
e.setColumnSizingInfo(
|
|
1067
|
+
e.setColumnSizingInfo(r ? ye() : (t = e.initialState.columnSizingInfo) != null ? t : ye());
|
|
815
1068
|
}, e.getTotalSize = () => {
|
|
816
|
-
var
|
|
817
|
-
return (
|
|
1069
|
+
var r, t;
|
|
1070
|
+
return (r = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? r : 0;
|
|
818
1071
|
}, e.getLeftTotalSize = () => {
|
|
819
|
-
var
|
|
820
|
-
return (
|
|
1072
|
+
var r, t;
|
|
1073
|
+
return (r = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? r : 0;
|
|
821
1074
|
}, e.getCenterTotalSize = () => {
|
|
822
|
-
var
|
|
823
|
-
return (
|
|
1075
|
+
var r, t;
|
|
1076
|
+
return (r = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? r : 0;
|
|
824
1077
|
}, e.getRightTotalSize = () => {
|
|
825
|
-
var
|
|
826
|
-
return (
|
|
1078
|
+
var r, t;
|
|
1079
|
+
return (r = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, i) => n + i.getSize(), 0)) != null ? r : 0;
|
|
827
1080
|
};
|
|
828
1081
|
}
|
|
829
1082
|
};
|
|
830
|
-
let
|
|
831
|
-
function
|
|
832
|
-
if (typeof
|
|
1083
|
+
let de = null;
|
|
1084
|
+
function on() {
|
|
1085
|
+
if (typeof de == "boolean") return de;
|
|
833
1086
|
let e = !1;
|
|
834
1087
|
try {
|
|
835
|
-
const
|
|
1088
|
+
const r = {
|
|
836
1089
|
get passive() {
|
|
837
1090
|
return e = !0, !1;
|
|
838
1091
|
}
|
|
839
1092
|
}, t = () => {
|
|
840
1093
|
};
|
|
841
|
-
window.addEventListener("test", t,
|
|
1094
|
+
window.addEventListener("test", t, r), window.removeEventListener("test", t);
|
|
842
1095
|
} catch {
|
|
843
1096
|
e = !1;
|
|
844
1097
|
}
|
|
845
|
-
return
|
|
1098
|
+
return de = e, de;
|
|
846
1099
|
}
|
|
847
|
-
function
|
|
1100
|
+
function _e(e) {
|
|
848
1101
|
return e.type === "touchstart";
|
|
849
1102
|
}
|
|
850
|
-
const
|
|
1103
|
+
const sn = {
|
|
851
1104
|
getInitialState: (e) => ({
|
|
852
1105
|
columnVisibility: {},
|
|
853
1106
|
...e
|
|
854
1107
|
}),
|
|
855
1108
|
getDefaultOptions: (e) => ({
|
|
856
|
-
onColumnVisibilityChange:
|
|
1109
|
+
onColumnVisibilityChange: P("columnVisibility", e)
|
|
857
1110
|
}),
|
|
858
|
-
createColumn: (e,
|
|
1111
|
+
createColumn: (e, r) => {
|
|
859
1112
|
e.toggleVisibility = (t) => {
|
|
860
|
-
e.getCanHide() &&
|
|
1113
|
+
e.getCanHide() && r.setColumnVisibility((n) => ({
|
|
861
1114
|
...n,
|
|
862
1115
|
[e.id]: t ?? !e.getIsVisible()
|
|
863
1116
|
}));
|
|
864
1117
|
}, e.getIsVisible = () => {
|
|
865
1118
|
var t, n;
|
|
866
|
-
const
|
|
867
|
-
return (t =
|
|
1119
|
+
const i = e.columns;
|
|
1120
|
+
return (t = i.length ? i.some((o) => o.getIsVisible()) : (n = r.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
868
1121
|
}, e.getCanHide = () => {
|
|
869
1122
|
var t, n;
|
|
870
|
-
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n =
|
|
1123
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = r.options.enableHiding) != null ? n : !0);
|
|
871
1124
|
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
872
1125
|
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
873
1126
|
};
|
|
874
1127
|
},
|
|
875
|
-
createRow: (e,
|
|
876
|
-
e._getAllVisibleCells = C(() => [e.getAllCells(),
|
|
1128
|
+
createRow: (e, r) => {
|
|
1129
|
+
e._getAllVisibleCells = C(() => [e.getAllCells(), r.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), x(r.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = C(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, i) => [...t, ...n, ...i], x(r.options, "debugRows", "getVisibleCells"));
|
|
877
1130
|
},
|
|
878
1131
|
createTable: (e) => {
|
|
879
|
-
const
|
|
880
|
-
e.getVisibleFlatColumns =
|
|
1132
|
+
const r = (t, n) => C(() => [n(), n().filter((i) => i.getIsVisible()).map((i) => i.id).join("_")], (i) => i.filter((o) => o.getIsVisible == null ? void 0 : o.getIsVisible()), x(e.options, "debugColumns", t));
|
|
1133
|
+
e.getVisibleFlatColumns = r("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = r("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = r("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = r("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = r("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
881
1134
|
var n;
|
|
882
1135
|
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
883
1136
|
}, e.toggleAllColumnsVisible = (t) => {
|
|
884
1137
|
var n;
|
|
885
|
-
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((
|
|
886
|
-
...
|
|
887
|
-
[
|
|
1138
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((i, o) => ({
|
|
1139
|
+
...i,
|
|
1140
|
+
[o.id]: t || !(o.getCanHide != null && o.getCanHide())
|
|
888
1141
|
}), {}));
|
|
889
1142
|
}, e.getIsAllColumnsVisible = () => !e.getAllLeafColumns().some((t) => !(t.getIsVisible != null && t.getIsVisible())), e.getIsSomeColumnsVisible = () => e.getAllLeafColumns().some((t) => t.getIsVisible == null ? void 0 : t.getIsVisible()), e.getToggleAllColumnsVisibilityHandler = () => (t) => {
|
|
890
1143
|
var n;
|
|
@@ -892,69 +1145,69 @@ const Yt = {
|
|
|
892
1145
|
};
|
|
893
1146
|
}
|
|
894
1147
|
};
|
|
895
|
-
function
|
|
896
|
-
return
|
|
1148
|
+
function re(e, r) {
|
|
1149
|
+
return r ? r === "center" ? e.getCenterVisibleLeafColumns() : r === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
897
1150
|
}
|
|
898
|
-
const
|
|
1151
|
+
const ln = {
|
|
899
1152
|
createTable: (e) => {
|
|
900
1153
|
e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
|
|
901
1154
|
if (e._getGlobalFacetedMinMaxValues)
|
|
902
1155
|
return e._getGlobalFacetedMinMaxValues();
|
|
903
1156
|
};
|
|
904
1157
|
}
|
|
905
|
-
},
|
|
1158
|
+
}, an = {
|
|
906
1159
|
getInitialState: (e) => ({
|
|
907
1160
|
globalFilter: void 0,
|
|
908
1161
|
...e
|
|
909
1162
|
}),
|
|
910
1163
|
getDefaultOptions: (e) => ({
|
|
911
|
-
onGlobalFilterChange:
|
|
1164
|
+
onGlobalFilterChange: P("globalFilter", e),
|
|
912
1165
|
globalFilterFn: "auto",
|
|
913
|
-
getColumnCanGlobalFilter: (
|
|
1166
|
+
getColumnCanGlobalFilter: (r) => {
|
|
914
1167
|
var t;
|
|
915
|
-
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[
|
|
1168
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[r.id]) == null ? void 0 : t.getValue();
|
|
916
1169
|
return typeof n == "string" || typeof n == "number";
|
|
917
1170
|
}
|
|
918
1171
|
}),
|
|
919
|
-
createColumn: (e,
|
|
1172
|
+
createColumn: (e, r) => {
|
|
920
1173
|
e.getCanGlobalFilter = () => {
|
|
921
|
-
var t, n,
|
|
922
|
-
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n =
|
|
1174
|
+
var t, n, i, o;
|
|
1175
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = r.options.enableGlobalFilter) != null ? n : !0) && ((i = r.options.enableFilters) != null ? i : !0) && ((o = r.options.getColumnCanGlobalFilter == null ? void 0 : r.options.getColumnCanGlobalFilter(e)) != null ? o : !0) && !!e.accessorFn;
|
|
923
1176
|
};
|
|
924
1177
|
},
|
|
925
1178
|
createTable: (e) => {
|
|
926
|
-
e.getGlobalAutoFilterFn = () =>
|
|
927
|
-
var
|
|
1179
|
+
e.getGlobalAutoFilterFn = () => A.includesString, e.getGlobalFilterFn = () => {
|
|
1180
|
+
var r, t;
|
|
928
1181
|
const {
|
|
929
1182
|
globalFilterFn: n
|
|
930
1183
|
} = e.options;
|
|
931
|
-
return
|
|
932
|
-
}, e.setGlobalFilter = (
|
|
933
|
-
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(
|
|
934
|
-
}, e.resetGlobalFilter = (
|
|
935
|
-
e.setGlobalFilter(
|
|
1184
|
+
return me(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (r = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? r : A[n];
|
|
1185
|
+
}, e.setGlobalFilter = (r) => {
|
|
1186
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(r);
|
|
1187
|
+
}, e.resetGlobalFilter = (r) => {
|
|
1188
|
+
e.setGlobalFilter(r ? void 0 : e.initialState.globalFilter);
|
|
936
1189
|
};
|
|
937
1190
|
}
|
|
938
|
-
},
|
|
1191
|
+
}, un = {
|
|
939
1192
|
getInitialState: (e) => ({
|
|
940
1193
|
expanded: {},
|
|
941
1194
|
...e
|
|
942
1195
|
}),
|
|
943
1196
|
getDefaultOptions: (e) => ({
|
|
944
|
-
onExpandedChange:
|
|
1197
|
+
onExpandedChange: P("expanded", e),
|
|
945
1198
|
paginateExpandedRows: !0
|
|
946
1199
|
}),
|
|
947
1200
|
createTable: (e) => {
|
|
948
|
-
let
|
|
1201
|
+
let r = !1, t = !1;
|
|
949
1202
|
e._autoResetExpanded = () => {
|
|
950
|
-
var n,
|
|
951
|
-
if (!
|
|
1203
|
+
var n, i;
|
|
1204
|
+
if (!r) {
|
|
952
1205
|
e._queue(() => {
|
|
953
|
-
|
|
1206
|
+
r = !0;
|
|
954
1207
|
});
|
|
955
1208
|
return;
|
|
956
1209
|
}
|
|
957
|
-
if ((n = (
|
|
1210
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
958
1211
|
if (t) return;
|
|
959
1212
|
t = !0, e._queue(() => {
|
|
960
1213
|
e.resetExpanded(), t = !1;
|
|
@@ -963,8 +1216,8 @@ const Zt = {
|
|
|
963
1216
|
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
964
1217
|
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
965
1218
|
}, e.resetExpanded = (n) => {
|
|
966
|
-
var
|
|
967
|
-
e.setExpanded(n ? {} : (
|
|
1219
|
+
var i, o;
|
|
1220
|
+
e.setExpanded(n ? {} : (i = (o = e.initialState) == null ? void 0 : o.expanded) != null ? i : {});
|
|
968
1221
|
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
969
1222
|
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
970
1223
|
}, e.getIsSomeRowsExpanded = () => {
|
|
@@ -972,29 +1225,29 @@ const Zt = {
|
|
|
972
1225
|
return n === !0 || Object.values(n).some(Boolean);
|
|
973
1226
|
}, e.getIsAllRowsExpanded = () => {
|
|
974
1227
|
const n = e.getState().expanded;
|
|
975
|
-
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((
|
|
1228
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((i) => !i.getIsExpanded()));
|
|
976
1229
|
}, e.getExpandedDepth = () => {
|
|
977
1230
|
let n = 0;
|
|
978
|
-
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((
|
|
979
|
-
const s =
|
|
1231
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((o) => {
|
|
1232
|
+
const s = o.split(".");
|
|
980
1233
|
n = Math.max(n, s.length);
|
|
981
1234
|
}), n;
|
|
982
1235
|
}, e.getPreExpandedRowModel = () => e.getSortedRowModel(), e.getExpandedRowModel = () => (!e._getExpandedRowModel && e.options.getExpandedRowModel && (e._getExpandedRowModel = e.options.getExpandedRowModel(e)), e.options.manualExpanding || !e._getExpandedRowModel ? e.getPreExpandedRowModel() : e._getExpandedRowModel());
|
|
983
1236
|
},
|
|
984
|
-
createRow: (e,
|
|
1237
|
+
createRow: (e, r) => {
|
|
985
1238
|
e.toggleExpanded = (t) => {
|
|
986
|
-
|
|
987
|
-
var
|
|
988
|
-
const
|
|
1239
|
+
r.setExpanded((n) => {
|
|
1240
|
+
var i;
|
|
1241
|
+
const o = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
989
1242
|
let s = {};
|
|
990
|
-
if (n === !0 ? Object.keys(
|
|
1243
|
+
if (n === !0 ? Object.keys(r.getRowModel().rowsById).forEach((l) => {
|
|
991
1244
|
s[l] = !0;
|
|
992
|
-
}) : s = n, t = (
|
|
1245
|
+
}) : s = n, t = (i = t) != null ? i : !o, !o && t)
|
|
993
1246
|
return {
|
|
994
1247
|
...s,
|
|
995
1248
|
[e.id]: !0
|
|
996
1249
|
};
|
|
997
|
-
if (
|
|
1250
|
+
if (o && !t) {
|
|
998
1251
|
const {
|
|
999
1252
|
[e.id]: l,
|
|
1000
1253
|
...a
|
|
@@ -1005,15 +1258,15 @@ const Zt = {
|
|
|
1005
1258
|
});
|
|
1006
1259
|
}, e.getIsExpanded = () => {
|
|
1007
1260
|
var t;
|
|
1008
|
-
const n =
|
|
1009
|
-
return !!((t =
|
|
1261
|
+
const n = r.getState().expanded;
|
|
1262
|
+
return !!((t = r.options.getIsRowExpanded == null ? void 0 : r.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
|
|
1010
1263
|
}, e.getCanExpand = () => {
|
|
1011
|
-
var t, n,
|
|
1012
|
-
return (t =
|
|
1264
|
+
var t, n, i;
|
|
1265
|
+
return (t = r.options.getRowCanExpand == null ? void 0 : r.options.getRowCanExpand(e)) != null ? t : ((n = r.options.enableExpanding) != null ? n : !0) && !!((i = e.subRows) != null && i.length);
|
|
1013
1266
|
}, e.getIsAllParentsExpanded = () => {
|
|
1014
1267
|
let t = !0, n = e;
|
|
1015
1268
|
for (; t && n.parentId; )
|
|
1016
|
-
n =
|
|
1269
|
+
n = r.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1017
1270
|
return t;
|
|
1018
1271
|
}, e.getToggleExpandedHandler = () => {
|
|
1019
1272
|
const t = e.getCanExpand();
|
|
@@ -1022,81 +1275,81 @@ const Zt = {
|
|
|
1022
1275
|
};
|
|
1023
1276
|
};
|
|
1024
1277
|
}
|
|
1025
|
-
},
|
|
1026
|
-
pageIndex:
|
|
1027
|
-
pageSize:
|
|
1028
|
-
}),
|
|
1278
|
+
}, Ie = 0, Ee = 10, Fe = () => ({
|
|
1279
|
+
pageIndex: Ie,
|
|
1280
|
+
pageSize: Ee
|
|
1281
|
+
}), dn = {
|
|
1029
1282
|
getInitialState: (e) => ({
|
|
1030
1283
|
...e,
|
|
1031
1284
|
pagination: {
|
|
1032
|
-
...
|
|
1285
|
+
...Fe(),
|
|
1033
1286
|
...e == null ? void 0 : e.pagination
|
|
1034
1287
|
}
|
|
1035
1288
|
}),
|
|
1036
1289
|
getDefaultOptions: (e) => ({
|
|
1037
|
-
onPaginationChange:
|
|
1290
|
+
onPaginationChange: P("pagination", e)
|
|
1038
1291
|
}),
|
|
1039
1292
|
createTable: (e) => {
|
|
1040
|
-
let
|
|
1293
|
+
let r = !1, t = !1;
|
|
1041
1294
|
e._autoResetPageIndex = () => {
|
|
1042
|
-
var n,
|
|
1043
|
-
if (!
|
|
1295
|
+
var n, i;
|
|
1296
|
+
if (!r) {
|
|
1044
1297
|
e._queue(() => {
|
|
1045
|
-
|
|
1298
|
+
r = !0;
|
|
1046
1299
|
});
|
|
1047
1300
|
return;
|
|
1048
1301
|
}
|
|
1049
|
-
if ((n = (
|
|
1302
|
+
if ((n = (i = e.options.autoResetAll) != null ? i : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1050
1303
|
if (t) return;
|
|
1051
1304
|
t = !0, e._queue(() => {
|
|
1052
1305
|
e.resetPageIndex(), t = !1;
|
|
1053
1306
|
});
|
|
1054
1307
|
}
|
|
1055
1308
|
}, e.setPagination = (n) => {
|
|
1056
|
-
const
|
|
1057
|
-
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(
|
|
1309
|
+
const i = (o) => H(n, o);
|
|
1310
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(i);
|
|
1058
1311
|
}, e.resetPagination = (n) => {
|
|
1059
|
-
var
|
|
1060
|
-
e.setPagination(n ?
|
|
1312
|
+
var i;
|
|
1313
|
+
e.setPagination(n ? Fe() : (i = e.initialState.pagination) != null ? i : Fe());
|
|
1061
1314
|
}, e.setPageIndex = (n) => {
|
|
1062
|
-
e.setPagination((
|
|
1063
|
-
let
|
|
1315
|
+
e.setPagination((i) => {
|
|
1316
|
+
let o = H(n, i.pageIndex);
|
|
1064
1317
|
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1065
|
-
return
|
|
1066
|
-
...
|
|
1067
|
-
pageIndex:
|
|
1318
|
+
return o = Math.max(0, Math.min(o, s)), {
|
|
1319
|
+
...i,
|
|
1320
|
+
pageIndex: o
|
|
1068
1321
|
};
|
|
1069
1322
|
});
|
|
1070
1323
|
}, e.resetPageIndex = (n) => {
|
|
1071
|
-
var
|
|
1072
|
-
e.setPageIndex(n ?
|
|
1324
|
+
var i, o;
|
|
1325
|
+
e.setPageIndex(n ? Ie : (i = (o = e.initialState) == null || (o = o.pagination) == null ? void 0 : o.pageIndex) != null ? i : Ie);
|
|
1073
1326
|
}, e.resetPageSize = (n) => {
|
|
1074
|
-
var
|
|
1075
|
-
e.setPageSize(n ?
|
|
1327
|
+
var i, o;
|
|
1328
|
+
e.setPageSize(n ? Ee : (i = (o = e.initialState) == null || (o = o.pagination) == null ? void 0 : o.pageSize) != null ? i : Ee);
|
|
1076
1329
|
}, e.setPageSize = (n) => {
|
|
1077
|
-
e.setPagination((
|
|
1078
|
-
const
|
|
1330
|
+
e.setPagination((i) => {
|
|
1331
|
+
const o = Math.max(1, H(n, i.pageSize)), s = i.pageSize * i.pageIndex, l = Math.floor(s / o);
|
|
1079
1332
|
return {
|
|
1080
|
-
...
|
|
1333
|
+
...i,
|
|
1081
1334
|
pageIndex: l,
|
|
1082
|
-
pageSize:
|
|
1335
|
+
pageSize: o
|
|
1083
1336
|
};
|
|
1084
1337
|
});
|
|
1085
|
-
}, e.setPageCount = (n) => e.setPagination((
|
|
1086
|
-
var
|
|
1087
|
-
let s = H(n, (
|
|
1338
|
+
}, e.setPageCount = (n) => e.setPagination((i) => {
|
|
1339
|
+
var o;
|
|
1340
|
+
let s = H(n, (o = e.options.pageCount) != null ? o : -1);
|
|
1088
1341
|
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
1089
|
-
...
|
|
1342
|
+
...i,
|
|
1090
1343
|
pageCount: s
|
|
1091
1344
|
};
|
|
1092
1345
|
}), e.getPageOptions = C(() => [e.getPageCount()], (n) => {
|
|
1093
|
-
let
|
|
1094
|
-
return n && n > 0 && (
|
|
1346
|
+
let i = [];
|
|
1347
|
+
return n && n > 0 && (i = [...new Array(n)].fill(null).map((o, s) => s)), i;
|
|
1095
1348
|
}, x(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1096
1349
|
const {
|
|
1097
1350
|
pageIndex: n
|
|
1098
|
-
} = e.getState().pagination,
|
|
1099
|
-
return
|
|
1351
|
+
} = e.getState().pagination, i = e.getPageCount();
|
|
1352
|
+
return i === -1 ? !0 : i === 0 ? !1 : n < i - 1;
|
|
1100
1353
|
}, e.previousPage = () => e.setPageIndex((n) => n - 1), e.nextPage = () => e.setPageIndex((n) => n + 1), e.firstPage = () => e.setPageIndex(0), e.lastPage = () => e.setPageIndex(e.getPageCount() - 1), e.getPrePaginationRowModel = () => e.getExpandedRowModel(), e.getPaginationRowModel = () => (!e._getPaginationRowModel && e.options.getPaginationRowModel && (e._getPaginationRowModel = e.options.getPaginationRowModel(e)), e.options.manualPagination || !e._getPaginationRowModel ? e.getPrePaginationRowModel() : e._getPaginationRowModel()), e.getPageCount = () => {
|
|
1101
1354
|
var n;
|
|
1102
1355
|
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
@@ -1105,92 +1358,92 @@ const Zt = {
|
|
|
1105
1358
|
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1106
1359
|
};
|
|
1107
1360
|
}
|
|
1108
|
-
},
|
|
1361
|
+
}, Me = () => ({
|
|
1109
1362
|
top: [],
|
|
1110
1363
|
bottom: []
|
|
1111
|
-
}),
|
|
1364
|
+
}), gn = {
|
|
1112
1365
|
getInitialState: (e) => ({
|
|
1113
|
-
rowPinning:
|
|
1366
|
+
rowPinning: Me(),
|
|
1114
1367
|
...e
|
|
1115
1368
|
}),
|
|
1116
1369
|
getDefaultOptions: (e) => ({
|
|
1117
|
-
onRowPinningChange:
|
|
1370
|
+
onRowPinningChange: P("rowPinning", e)
|
|
1118
1371
|
}),
|
|
1119
|
-
createRow: (e,
|
|
1120
|
-
e.pin = (t, n,
|
|
1121
|
-
const
|
|
1372
|
+
createRow: (e, r) => {
|
|
1373
|
+
e.pin = (t, n, i) => {
|
|
1374
|
+
const o = n ? e.getLeafRows().map((a) => {
|
|
1122
1375
|
let {
|
|
1123
1376
|
id: u
|
|
1124
1377
|
} = a;
|
|
1125
1378
|
return u;
|
|
1126
|
-
}) : [], s =
|
|
1379
|
+
}) : [], s = i ? e.getParentRows().map((a) => {
|
|
1127
1380
|
let {
|
|
1128
1381
|
id: u
|
|
1129
1382
|
} = a;
|
|
1130
1383
|
return u;
|
|
1131
|
-
}) : [], l = /* @__PURE__ */ new Set([...s, e.id, ...
|
|
1132
|
-
|
|
1133
|
-
var u,
|
|
1384
|
+
}) : [], l = /* @__PURE__ */ new Set([...s, e.id, ...o]);
|
|
1385
|
+
r.setRowPinning((a) => {
|
|
1386
|
+
var u, f;
|
|
1134
1387
|
if (t === "bottom") {
|
|
1135
1388
|
var m, c;
|
|
1136
1389
|
return {
|
|
1137
|
-
top: ((m = a == null ? void 0 : a.top) != null ? m : []).filter((
|
|
1138
|
-
bottom: [...((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((
|
|
1390
|
+
top: ((m = a == null ? void 0 : a.top) != null ? m : []).filter((p) => !(l != null && l.has(p))),
|
|
1391
|
+
bottom: [...((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((p) => !(l != null && l.has(p))), ...Array.from(l)]
|
|
1139
1392
|
};
|
|
1140
1393
|
}
|
|
1141
1394
|
if (t === "top") {
|
|
1142
|
-
var d,
|
|
1395
|
+
var d, g;
|
|
1143
1396
|
return {
|
|
1144
|
-
top: [...((d = a == null ? void 0 : a.top) != null ? d : []).filter((
|
|
1145
|
-
bottom: ((
|
|
1397
|
+
top: [...((d = a == null ? void 0 : a.top) != null ? d : []).filter((p) => !(l != null && l.has(p))), ...Array.from(l)],
|
|
1398
|
+
bottom: ((g = a == null ? void 0 : a.bottom) != null ? g : []).filter((p) => !(l != null && l.has(p)))
|
|
1146
1399
|
};
|
|
1147
1400
|
}
|
|
1148
1401
|
return {
|
|
1149
|
-
top: ((u = a == null ? void 0 : a.top) != null ? u : []).filter((
|
|
1150
|
-
bottom: ((
|
|
1402
|
+
top: ((u = a == null ? void 0 : a.top) != null ? u : []).filter((p) => !(l != null && l.has(p))),
|
|
1403
|
+
bottom: ((f = a == null ? void 0 : a.bottom) != null ? f : []).filter((p) => !(l != null && l.has(p)))
|
|
1151
1404
|
};
|
|
1152
1405
|
});
|
|
1153
1406
|
}, e.getCanPin = () => {
|
|
1154
1407
|
var t;
|
|
1155
1408
|
const {
|
|
1156
1409
|
enableRowPinning: n,
|
|
1157
|
-
enablePinning:
|
|
1158
|
-
} =
|
|
1159
|
-
return typeof n == "function" ? n(e) : (t = n ??
|
|
1410
|
+
enablePinning: i
|
|
1411
|
+
} = r.options;
|
|
1412
|
+
return typeof n == "function" ? n(e) : (t = n ?? i) != null ? t : !0;
|
|
1160
1413
|
}, e.getIsPinned = () => {
|
|
1161
1414
|
const t = [e.id], {
|
|
1162
1415
|
top: n,
|
|
1163
|
-
bottom:
|
|
1164
|
-
} =
|
|
1165
|
-
return
|
|
1416
|
+
bottom: i
|
|
1417
|
+
} = r.getState().rowPinning, o = t.some((l) => n == null ? void 0 : n.includes(l)), s = t.some((l) => i == null ? void 0 : i.includes(l));
|
|
1418
|
+
return o ? "top" : s ? "bottom" : !1;
|
|
1166
1419
|
}, e.getPinnedIndex = () => {
|
|
1167
1420
|
var t, n;
|
|
1168
|
-
const
|
|
1169
|
-
if (!
|
|
1170
|
-
const
|
|
1421
|
+
const i = e.getIsPinned();
|
|
1422
|
+
if (!i) return -1;
|
|
1423
|
+
const o = (t = i === "top" ? r.getTopRows() : r.getBottomRows()) == null ? void 0 : t.map((s) => {
|
|
1171
1424
|
let {
|
|
1172
1425
|
id: l
|
|
1173
1426
|
} = s;
|
|
1174
1427
|
return l;
|
|
1175
1428
|
});
|
|
1176
|
-
return (n =
|
|
1429
|
+
return (n = o == null ? void 0 : o.indexOf(e.id)) != null ? n : -1;
|
|
1177
1430
|
};
|
|
1178
1431
|
},
|
|
1179
1432
|
createTable: (e) => {
|
|
1180
|
-
e.setRowPinning = (
|
|
1433
|
+
e.setRowPinning = (r) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(r), e.resetRowPinning = (r) => {
|
|
1181
1434
|
var t, n;
|
|
1182
|
-
return e.setRowPinning(
|
|
1183
|
-
}, e.getIsSomeRowsPinned = (
|
|
1435
|
+
return e.setRowPinning(r ? Me() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Me());
|
|
1436
|
+
}, e.getIsSomeRowsPinned = (r) => {
|
|
1184
1437
|
var t;
|
|
1185
1438
|
const n = e.getState().rowPinning;
|
|
1186
|
-
if (!
|
|
1187
|
-
var
|
|
1188
|
-
return !!((
|
|
1439
|
+
if (!r) {
|
|
1440
|
+
var i, o;
|
|
1441
|
+
return !!((i = n.top) != null && i.length || (o = n.bottom) != null && o.length);
|
|
1189
1442
|
}
|
|
1190
|
-
return !!((t = n[
|
|
1191
|
-
}, e._getPinnedRows = (
|
|
1192
|
-
var
|
|
1193
|
-
return ((
|
|
1443
|
+
return !!((t = n[r]) != null && t.length);
|
|
1444
|
+
}, e._getPinnedRows = (r, t, n) => {
|
|
1445
|
+
var i;
|
|
1446
|
+
return ((i = e.options.keepPinnedRows) == null || i ? (
|
|
1194
1447
|
//get all rows that are pinned even if they would not be otherwise visible
|
|
1195
1448
|
//account for expanded parent rows, but not pagination or filtering
|
|
1196
1449
|
(t ?? []).map((s) => {
|
|
@@ -1199,23 +1452,23 @@ const Zt = {
|
|
|
1199
1452
|
})
|
|
1200
1453
|
) : (
|
|
1201
1454
|
//else get only visible rows that are pinned
|
|
1202
|
-
(t ?? []).map((s) =>
|
|
1455
|
+
(t ?? []).map((s) => r.find((l) => l.id === s))
|
|
1203
1456
|
)).filter(Boolean).map((s) => ({
|
|
1204
1457
|
...s,
|
|
1205
1458
|
position: n
|
|
1206
1459
|
}));
|
|
1207
|
-
}, e.getTopRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top], (
|
|
1208
|
-
const
|
|
1209
|
-
return
|
|
1460
|
+
}, e.getTopRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top], (r, t) => e._getPinnedRows(r, t, "top"), x(e.options, "debugRows", "getTopRows")), e.getBottomRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (r, t) => e._getPinnedRows(r, t, "bottom"), x(e.options, "debugRows", "getBottomRows")), e.getCenterRows = C(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (r, t, n) => {
|
|
1461
|
+
const i = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1462
|
+
return r.filter((o) => !i.has(o.id));
|
|
1210
1463
|
}, x(e.options, "debugRows", "getCenterRows"));
|
|
1211
1464
|
}
|
|
1212
|
-
},
|
|
1465
|
+
}, cn = {
|
|
1213
1466
|
getInitialState: (e) => ({
|
|
1214
1467
|
rowSelection: {},
|
|
1215
1468
|
...e
|
|
1216
1469
|
}),
|
|
1217
1470
|
getDefaultOptions: (e) => ({
|
|
1218
|
-
onRowSelectionChange:
|
|
1471
|
+
onRowSelectionChange: P("rowSelection", e),
|
|
1219
1472
|
enableRowSelection: !0,
|
|
1220
1473
|
enableMultiRowSelection: !0,
|
|
1221
1474
|
enableSubRowSelection: !0
|
|
@@ -1224,165 +1477,165 @@ const Zt = {
|
|
|
1224
1477
|
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1225
1478
|
}),
|
|
1226
1479
|
createTable: (e) => {
|
|
1227
|
-
e.setRowSelection = (
|
|
1480
|
+
e.setRowSelection = (r) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(r), e.resetRowSelection = (r) => {
|
|
1228
1481
|
var t;
|
|
1229
|
-
return e.setRowSelection(
|
|
1230
|
-
}, e.toggleAllRowsSelected = (
|
|
1482
|
+
return e.setRowSelection(r ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1483
|
+
}, e.toggleAllRowsSelected = (r) => {
|
|
1231
1484
|
e.setRowSelection((t) => {
|
|
1232
|
-
|
|
1485
|
+
r = typeof r < "u" ? r : !e.getIsAllRowsSelected();
|
|
1233
1486
|
const n = {
|
|
1234
1487
|
...t
|
|
1235
|
-
},
|
|
1236
|
-
return
|
|
1237
|
-
|
|
1238
|
-
}) :
|
|
1239
|
-
delete n[
|
|
1488
|
+
}, i = e.getPreGroupedRowModel().flatRows;
|
|
1489
|
+
return r ? i.forEach((o) => {
|
|
1490
|
+
o.getCanSelect() && (n[o.id] = !0);
|
|
1491
|
+
}) : i.forEach((o) => {
|
|
1492
|
+
delete n[o.id];
|
|
1240
1493
|
}), n;
|
|
1241
1494
|
});
|
|
1242
|
-
}, e.toggleAllPageRowsSelected = (
|
|
1243
|
-
const n = typeof
|
|
1495
|
+
}, e.toggleAllPageRowsSelected = (r) => e.setRowSelection((t) => {
|
|
1496
|
+
const n = typeof r < "u" ? r : !e.getIsAllPageRowsSelected(), i = {
|
|
1244
1497
|
...t
|
|
1245
1498
|
};
|
|
1246
|
-
return e.getRowModel().rows.forEach((
|
|
1247
|
-
|
|
1248
|
-
}),
|
|
1249
|
-
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (
|
|
1499
|
+
return e.getRowModel().rows.forEach((o) => {
|
|
1500
|
+
be(i, o.id, n, !0, e);
|
|
1501
|
+
}), i;
|
|
1502
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = C(() => [e.getState().rowSelection, e.getCoreRowModel()], (r, t) => Object.keys(r).length ? $e(e, t) : {
|
|
1250
1503
|
rows: [],
|
|
1251
1504
|
flatRows: [],
|
|
1252
1505
|
rowsById: {}
|
|
1253
|
-
}, x(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (
|
|
1506
|
+
}, x(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = C(() => [e.getState().rowSelection, e.getFilteredRowModel()], (r, t) => Object.keys(r).length ? $e(e, t) : {
|
|
1254
1507
|
rows: [],
|
|
1255
1508
|
flatRows: [],
|
|
1256
1509
|
rowsById: {}
|
|
1257
|
-
}, x(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (
|
|
1510
|
+
}, x(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = C(() => [e.getState().rowSelection, e.getSortedRowModel()], (r, t) => Object.keys(r).length ? $e(e, t) : {
|
|
1258
1511
|
rows: [],
|
|
1259
1512
|
flatRows: [],
|
|
1260
1513
|
rowsById: {}
|
|
1261
1514
|
}, x(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1262
|
-
const
|
|
1515
|
+
const r = e.getFilteredRowModel().flatRows, {
|
|
1263
1516
|
rowSelection: t
|
|
1264
1517
|
} = e.getState();
|
|
1265
|
-
let n = !!(
|
|
1266
|
-
return n &&
|
|
1518
|
+
let n = !!(r.length && Object.keys(t).length);
|
|
1519
|
+
return n && r.some((i) => i.getCanSelect() && !t[i.id]) && (n = !1), n;
|
|
1267
1520
|
}, e.getIsAllPageRowsSelected = () => {
|
|
1268
|
-
const
|
|
1521
|
+
const r = e.getPaginationRowModel().flatRows.filter((i) => i.getCanSelect()), {
|
|
1269
1522
|
rowSelection: t
|
|
1270
1523
|
} = e.getState();
|
|
1271
|
-
let n = !!
|
|
1272
|
-
return n &&
|
|
1524
|
+
let n = !!r.length;
|
|
1525
|
+
return n && r.some((i) => !t[i.id]) && (n = !1), n;
|
|
1273
1526
|
}, e.getIsSomeRowsSelected = () => {
|
|
1274
|
-
var
|
|
1275
|
-
const t = Object.keys((
|
|
1527
|
+
var r;
|
|
1528
|
+
const t = Object.keys((r = e.getState().rowSelection) != null ? r : {}).length;
|
|
1276
1529
|
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1277
1530
|
}, e.getIsSomePageRowsSelected = () => {
|
|
1278
|
-
const
|
|
1279
|
-
return e.getIsAllPageRowsSelected() ? !1 :
|
|
1280
|
-
}, e.getToggleAllRowsSelectedHandler = () => (
|
|
1281
|
-
e.toggleAllRowsSelected(
|
|
1282
|
-
}, e.getToggleAllPageRowsSelectedHandler = () => (
|
|
1283
|
-
e.toggleAllPageRowsSelected(
|
|
1531
|
+
const r = e.getPaginationRowModel().flatRows;
|
|
1532
|
+
return e.getIsAllPageRowsSelected() ? !1 : r.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1533
|
+
}, e.getToggleAllRowsSelectedHandler = () => (r) => {
|
|
1534
|
+
e.toggleAllRowsSelected(r.target.checked);
|
|
1535
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (r) => {
|
|
1536
|
+
e.toggleAllPageRowsSelected(r.target.checked);
|
|
1284
1537
|
};
|
|
1285
1538
|
},
|
|
1286
|
-
createRow: (e,
|
|
1539
|
+
createRow: (e, r) => {
|
|
1287
1540
|
e.toggleSelected = (t, n) => {
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1541
|
+
const i = e.getIsSelected();
|
|
1542
|
+
r.setRowSelection((o) => {
|
|
1290
1543
|
var s;
|
|
1291
|
-
if (t = typeof t < "u" ? t : !
|
|
1292
|
-
return
|
|
1544
|
+
if (t = typeof t < "u" ? t : !i, e.getCanSelect() && i === t)
|
|
1545
|
+
return o;
|
|
1293
1546
|
const l = {
|
|
1294
|
-
...
|
|
1547
|
+
...o
|
|
1295
1548
|
};
|
|
1296
|
-
return
|
|
1549
|
+
return be(l, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, r), l;
|
|
1297
1550
|
});
|
|
1298
1551
|
}, e.getIsSelected = () => {
|
|
1299
1552
|
const {
|
|
1300
1553
|
rowSelection: t
|
|
1301
|
-
} =
|
|
1302
|
-
return
|
|
1554
|
+
} = r.getState();
|
|
1555
|
+
return Ne(e, t);
|
|
1303
1556
|
}, e.getIsSomeSelected = () => {
|
|
1304
1557
|
const {
|
|
1305
1558
|
rowSelection: t
|
|
1306
|
-
} =
|
|
1307
|
-
return
|
|
1559
|
+
} = r.getState();
|
|
1560
|
+
return Ve(e, t) === "some";
|
|
1308
1561
|
}, e.getIsAllSubRowsSelected = () => {
|
|
1309
1562
|
const {
|
|
1310
1563
|
rowSelection: t
|
|
1311
|
-
} =
|
|
1312
|
-
return
|
|
1564
|
+
} = r.getState();
|
|
1565
|
+
return Ve(e, t) === "all";
|
|
1313
1566
|
}, e.getCanSelect = () => {
|
|
1314
1567
|
var t;
|
|
1315
|
-
return typeof
|
|
1568
|
+
return typeof r.options.enableRowSelection == "function" ? r.options.enableRowSelection(e) : (t = r.options.enableRowSelection) != null ? t : !0;
|
|
1316
1569
|
}, e.getCanSelectSubRows = () => {
|
|
1317
1570
|
var t;
|
|
1318
|
-
return typeof
|
|
1571
|
+
return typeof r.options.enableSubRowSelection == "function" ? r.options.enableSubRowSelection(e) : (t = r.options.enableSubRowSelection) != null ? t : !0;
|
|
1319
1572
|
}, e.getCanMultiSelect = () => {
|
|
1320
1573
|
var t;
|
|
1321
|
-
return typeof
|
|
1574
|
+
return typeof r.options.enableMultiRowSelection == "function" ? r.options.enableMultiRowSelection(e) : (t = r.options.enableMultiRowSelection) != null ? t : !0;
|
|
1322
1575
|
}, e.getToggleSelectedHandler = () => {
|
|
1323
1576
|
const t = e.getCanSelect();
|
|
1324
1577
|
return (n) => {
|
|
1325
|
-
var
|
|
1326
|
-
t && e.toggleSelected((
|
|
1578
|
+
var i;
|
|
1579
|
+
t && e.toggleSelected((i = n.target) == null ? void 0 : i.checked);
|
|
1327
1580
|
};
|
|
1328
1581
|
};
|
|
1329
1582
|
}
|
|
1330
|
-
},
|
|
1331
|
-
var
|
|
1332
|
-
const s =
|
|
1333
|
-
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((l) => delete e[l]), s.getCanSelect() && (e[
|
|
1583
|
+
}, be = (e, r, t, n, i) => {
|
|
1584
|
+
var o;
|
|
1585
|
+
const s = i.getRow(r, !0);
|
|
1586
|
+
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((l) => delete e[l]), s.getCanSelect() && (e[r] = !0)) : delete e[r], n && (o = s.subRows) != null && o.length && s.getCanSelectSubRows() && s.subRows.forEach((l) => be(e, l.id, t, n, i));
|
|
1334
1587
|
};
|
|
1335
|
-
function
|
|
1336
|
-
const t = e.getState().rowSelection, n = [],
|
|
1588
|
+
function $e(e, r) {
|
|
1589
|
+
const t = e.getState().rowSelection, n = [], i = {}, o = function(s, l) {
|
|
1337
1590
|
return s.map((a) => {
|
|
1338
1591
|
var u;
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1592
|
+
const f = Ne(a, t);
|
|
1593
|
+
if (f && (n.push(a), i[a.id] = a), (u = a.subRows) != null && u.length && (a = {
|
|
1341
1594
|
...a,
|
|
1342
|
-
subRows:
|
|
1343
|
-
}),
|
|
1595
|
+
subRows: o(a.subRows)
|
|
1596
|
+
}), f)
|
|
1344
1597
|
return a;
|
|
1345
1598
|
}).filter(Boolean);
|
|
1346
1599
|
};
|
|
1347
1600
|
return {
|
|
1348
|
-
rows: r
|
|
1601
|
+
rows: o(r.rows),
|
|
1349
1602
|
flatRows: n,
|
|
1350
|
-
rowsById:
|
|
1603
|
+
rowsById: i
|
|
1351
1604
|
};
|
|
1352
1605
|
}
|
|
1353
|
-
function
|
|
1606
|
+
function Ne(e, r) {
|
|
1354
1607
|
var t;
|
|
1355
|
-
return (t =
|
|
1608
|
+
return (t = r[e.id]) != null ? t : !1;
|
|
1356
1609
|
}
|
|
1357
|
-
function
|
|
1610
|
+
function Ve(e, r, t) {
|
|
1358
1611
|
var n;
|
|
1359
1612
|
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1360
|
-
let
|
|
1613
|
+
let i = !0, o = !1;
|
|
1361
1614
|
return e.subRows.forEach((s) => {
|
|
1362
|
-
if (!(
|
|
1363
|
-
const l =
|
|
1364
|
-
l === "all" ?
|
|
1615
|
+
if (!(o && !i) && (s.getCanSelect() && (Ne(s, r) ? o = !0 : i = !1), s.subRows && s.subRows.length)) {
|
|
1616
|
+
const l = Ve(s, r);
|
|
1617
|
+
l === "all" ? o = !0 : (l === "some" && (o = !0), i = !1);
|
|
1365
1618
|
}
|
|
1366
|
-
}),
|
|
1619
|
+
}), i ? "all" : o ? "some" : !1;
|
|
1367
1620
|
}
|
|
1368
|
-
const
|
|
1369
|
-
const n = e.getValue(t),
|
|
1370
|
-
return n >
|
|
1371
|
-
},
|
|
1372
|
-
function
|
|
1373
|
-
return e ===
|
|
1621
|
+
const Pe = /([0-9]+)/gm, fn = (e, r, t) => ht(k(e.getValue(t)).toLowerCase(), k(r.getValue(t)).toLowerCase()), hn = (e, r, t) => ht(k(e.getValue(t)), k(r.getValue(t))), pn = (e, r, t) => Ae(k(e.getValue(t)).toLowerCase(), k(r.getValue(t)).toLowerCase()), mn = (e, r, t) => Ae(k(e.getValue(t)), k(r.getValue(t))), Sn = (e, r, t) => {
|
|
1622
|
+
const n = e.getValue(t), i = r.getValue(t);
|
|
1623
|
+
return n > i ? 1 : n < i ? -1 : 0;
|
|
1624
|
+
}, vn = (e, r, t) => Ae(e.getValue(t), r.getValue(t));
|
|
1625
|
+
function Ae(e, r) {
|
|
1626
|
+
return e === r ? 0 : e > r ? 1 : -1;
|
|
1374
1627
|
}
|
|
1375
1628
|
function k(e) {
|
|
1376
1629
|
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1377
1630
|
}
|
|
1378
|
-
function
|
|
1379
|
-
const t = e.split(
|
|
1631
|
+
function ht(e, r) {
|
|
1632
|
+
const t = e.split(Pe).filter(Boolean), n = r.split(Pe).filter(Boolean);
|
|
1380
1633
|
for (; t.length && n.length; ) {
|
|
1381
|
-
const
|
|
1634
|
+
const i = t.shift(), o = n.shift(), s = parseInt(i, 10), l = parseInt(o, 10), a = [s, l].sort();
|
|
1382
1635
|
if (isNaN(a[0])) {
|
|
1383
|
-
if (
|
|
1636
|
+
if (i > o)
|
|
1384
1637
|
return 1;
|
|
1385
|
-
if (
|
|
1638
|
+
if (o > i)
|
|
1386
1639
|
return -1;
|
|
1387
1640
|
continue;
|
|
1388
1641
|
}
|
|
@@ -1395,14 +1648,14 @@ function ct(e, i) {
|
|
|
1395
1648
|
}
|
|
1396
1649
|
return t.length - n.length;
|
|
1397
1650
|
}
|
|
1398
|
-
const
|
|
1399
|
-
alphanumeric:
|
|
1400
|
-
alphanumericCaseSensitive:
|
|
1401
|
-
text:
|
|
1402
|
-
textCaseSensitive:
|
|
1403
|
-
datetime:
|
|
1404
|
-
basic:
|
|
1405
|
-
},
|
|
1651
|
+
const ee = {
|
|
1652
|
+
alphanumeric: fn,
|
|
1653
|
+
alphanumericCaseSensitive: hn,
|
|
1654
|
+
text: pn,
|
|
1655
|
+
textCaseSensitive: mn,
|
|
1656
|
+
datetime: Sn,
|
|
1657
|
+
basic: vn
|
|
1658
|
+
}, wn = {
|
|
1406
1659
|
getInitialState: (e) => ({
|
|
1407
1660
|
sorting: [],
|
|
1408
1661
|
...e
|
|
@@ -1412,44 +1665,44 @@ const Q = {
|
|
|
1412
1665
|
sortUndefined: 1
|
|
1413
1666
|
}),
|
|
1414
1667
|
getDefaultOptions: (e) => ({
|
|
1415
|
-
onSortingChange:
|
|
1416
|
-
isMultiSortEvent: (
|
|
1668
|
+
onSortingChange: P("sorting", e),
|
|
1669
|
+
isMultiSortEvent: (r) => r.shiftKey
|
|
1417
1670
|
}),
|
|
1418
|
-
createColumn: (e,
|
|
1671
|
+
createColumn: (e, r) => {
|
|
1419
1672
|
e.getAutoSortingFn = () => {
|
|
1420
|
-
const t =
|
|
1673
|
+
const t = r.getFilteredRowModel().flatRows.slice(10);
|
|
1421
1674
|
let n = !1;
|
|
1422
|
-
for (const
|
|
1423
|
-
const
|
|
1424
|
-
if (Object.prototype.toString.call(
|
|
1425
|
-
return
|
|
1426
|
-
if (typeof
|
|
1427
|
-
return
|
|
1675
|
+
for (const i of t) {
|
|
1676
|
+
const o = i == null ? void 0 : i.getValue(e.id);
|
|
1677
|
+
if (Object.prototype.toString.call(o) === "[object Date]")
|
|
1678
|
+
return ee.datetime;
|
|
1679
|
+
if (typeof o == "string" && (n = !0, o.split(Pe).length > 1))
|
|
1680
|
+
return ee.alphanumeric;
|
|
1428
1681
|
}
|
|
1429
|
-
return n ?
|
|
1682
|
+
return n ? ee.text : ee.basic;
|
|
1430
1683
|
}, e.getAutoSortDir = () => {
|
|
1431
|
-
const t =
|
|
1684
|
+
const t = r.getFilteredRowModel().flatRows[0];
|
|
1432
1685
|
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
1433
1686
|
}, e.getSortingFn = () => {
|
|
1434
1687
|
var t, n;
|
|
1435
1688
|
if (!e)
|
|
1436
1689
|
throw new Error();
|
|
1437
|
-
return
|
|
1690
|
+
return me(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = r.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : ee[e.columnDef.sortingFn];
|
|
1438
1691
|
}, e.toggleSorting = (t, n) => {
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1692
|
+
const i = e.getNextSortingOrder(), o = typeof t < "u" && t !== null;
|
|
1693
|
+
r.setSorting((s) => {
|
|
1441
1694
|
const l = s == null ? void 0 : s.find((d) => d.id === e.id), a = s == null ? void 0 : s.findIndex((d) => d.id === e.id);
|
|
1442
|
-
let u = [],
|
|
1443
|
-
if (s != null && s.length && e.getCanMultiSort() && n ? l ?
|
|
1695
|
+
let u = [], f, m = o ? t : i === "desc";
|
|
1696
|
+
if (s != null && s.length && e.getCanMultiSort() && n ? l ? f = "toggle" : f = "add" : s != null && s.length && a !== s.length - 1 ? f = "replace" : l ? f = "toggle" : f = "replace", f === "toggle" && (o || i || (f = "remove")), f === "add") {
|
|
1444
1697
|
var c;
|
|
1445
1698
|
u = [...s, {
|
|
1446
1699
|
id: e.id,
|
|
1447
1700
|
desc: m
|
|
1448
|
-
}], u.splice(0, u.length - ((c =
|
|
1449
|
-
} else
|
|
1701
|
+
}], u.splice(0, u.length - ((c = r.options.maxMultiSortColCount) != null ? c : Number.MAX_SAFE_INTEGER));
|
|
1702
|
+
} else f === "toggle" ? u = s.map((d) => d.id === e.id ? {
|
|
1450
1703
|
...d,
|
|
1451
1704
|
desc: m
|
|
1452
|
-
} : d) :
|
|
1705
|
+
} : d) : f === "remove" ? u = s.filter((d) => d.id !== e.id) : u = [{
|
|
1453
1706
|
id: e.id,
|
|
1454
1707
|
desc: m
|
|
1455
1708
|
}];
|
|
@@ -1457,211 +1710,211 @@ const Q = {
|
|
|
1457
1710
|
});
|
|
1458
1711
|
}, e.getFirstSortDir = () => {
|
|
1459
1712
|
var t, n;
|
|
1460
|
-
return ((t = (n = e.columnDef.sortDescFirst) != null ? n :
|
|
1713
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : r.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1461
1714
|
}, e.getNextSortingOrder = (t) => {
|
|
1462
|
-
var n,
|
|
1463
|
-
const
|
|
1464
|
-
return s ? s !==
|
|
1465
|
-
(!(t && (
|
|
1715
|
+
var n, i;
|
|
1716
|
+
const o = e.getFirstSortDir(), s = e.getIsSorted();
|
|
1717
|
+
return s ? s !== o && ((n = r.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1718
|
+
(!(t && (i = r.options.enableMultiRemove) != null) || i) ? !1 : s === "desc" ? "asc" : "desc" : o;
|
|
1466
1719
|
}, e.getCanSort = () => {
|
|
1467
1720
|
var t, n;
|
|
1468
|
-
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n =
|
|
1721
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = r.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1469
1722
|
}, e.getCanMultiSort = () => {
|
|
1470
1723
|
var t, n;
|
|
1471
|
-
return (t = (n = e.columnDef.enableMultiSort) != null ? n :
|
|
1724
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : r.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1472
1725
|
}, e.getIsSorted = () => {
|
|
1473
1726
|
var t;
|
|
1474
|
-
const n = (t =
|
|
1727
|
+
const n = (t = r.getState().sorting) == null ? void 0 : t.find((i) => i.id === e.id);
|
|
1475
1728
|
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1476
1729
|
}, e.getSortIndex = () => {
|
|
1477
1730
|
var t, n;
|
|
1478
|
-
return (t = (n =
|
|
1731
|
+
return (t = (n = r.getState().sorting) == null ? void 0 : n.findIndex((i) => i.id === e.id)) != null ? t : -1;
|
|
1479
1732
|
}, e.clearSorting = () => {
|
|
1480
|
-
|
|
1733
|
+
r.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1481
1734
|
}, e.getToggleSortingHandler = () => {
|
|
1482
1735
|
const t = e.getCanSort();
|
|
1483
1736
|
return (n) => {
|
|
1484
|
-
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ?
|
|
1737
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? r.options.isMultiSortEvent == null ? void 0 : r.options.isMultiSortEvent(n) : !1));
|
|
1485
1738
|
};
|
|
1486
1739
|
};
|
|
1487
1740
|
},
|
|
1488
1741
|
createTable: (e) => {
|
|
1489
|
-
e.setSorting = (
|
|
1742
|
+
e.setSorting = (r) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(r), e.resetSorting = (r) => {
|
|
1490
1743
|
var t, n;
|
|
1491
|
-
e.setSorting(
|
|
1744
|
+
e.setSorting(r ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1492
1745
|
}, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
|
|
1493
1746
|
}
|
|
1494
|
-
},
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
Ut,
|
|
1498
|
-
Kt,
|
|
1499
|
-
Nt,
|
|
1500
|
-
Ot,
|
|
1501
|
-
Zt,
|
|
1502
|
-
//depends on ColumnFaceting
|
|
1747
|
+
}, Cn = [
|
|
1748
|
+
Lt,
|
|
1749
|
+
sn,
|
|
1503
1750
|
en,
|
|
1751
|
+
tn,
|
|
1752
|
+
kt,
|
|
1753
|
+
Tt,
|
|
1754
|
+
ln,
|
|
1755
|
+
//depends on ColumnFaceting
|
|
1756
|
+
an,
|
|
1504
1757
|
//depends on ColumnFiltering
|
|
1505
|
-
|
|
1506
|
-
|
|
1758
|
+
wn,
|
|
1759
|
+
Yt,
|
|
1507
1760
|
//depends on RowSorting
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1761
|
+
un,
|
|
1762
|
+
dn,
|
|
1763
|
+
gn,
|
|
1764
|
+
cn,
|
|
1765
|
+
rn
|
|
1513
1766
|
];
|
|
1514
|
-
function
|
|
1515
|
-
var
|
|
1767
|
+
function xn(e) {
|
|
1768
|
+
var r, t;
|
|
1516
1769
|
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1517
|
-
const n = [...
|
|
1518
|
-
let
|
|
1770
|
+
const n = [...Cn, ...(r = e._features) != null ? r : []];
|
|
1771
|
+
let i = {
|
|
1519
1772
|
_features: n
|
|
1520
1773
|
};
|
|
1521
|
-
const
|
|
1522
|
-
...
|
|
1774
|
+
const o = i._features.reduce((c, d) => Object.assign(c, d.getDefaultOptions == null ? void 0 : d.getDefaultOptions(i)), {}), s = (c) => i.options.mergeOptions ? i.options.mergeOptions(o, c) : {
|
|
1775
|
+
...o,
|
|
1523
1776
|
...c
|
|
1524
1777
|
};
|
|
1525
1778
|
let a = {
|
|
1526
1779
|
...{},
|
|
1527
1780
|
...(t = e.initialState) != null ? t : {}
|
|
1528
1781
|
};
|
|
1529
|
-
|
|
1782
|
+
i._features.forEach((c) => {
|
|
1530
1783
|
var d;
|
|
1531
1784
|
a = (d = c.getInitialState == null ? void 0 : c.getInitialState(a)) != null ? d : a;
|
|
1532
1785
|
});
|
|
1533
1786
|
const u = [];
|
|
1534
|
-
let
|
|
1787
|
+
let f = !1;
|
|
1535
1788
|
const m = {
|
|
1536
1789
|
_features: n,
|
|
1537
1790
|
options: {
|
|
1538
|
-
...
|
|
1791
|
+
...o,
|
|
1539
1792
|
...e
|
|
1540
1793
|
},
|
|
1541
1794
|
initialState: a,
|
|
1542
1795
|
_queue: (c) => {
|
|
1543
|
-
u.push(c),
|
|
1796
|
+
u.push(c), f || (f = !0, Promise.resolve().then(() => {
|
|
1544
1797
|
for (; u.length; )
|
|
1545
1798
|
u.shift()();
|
|
1546
|
-
|
|
1799
|
+
f = !1;
|
|
1547
1800
|
}).catch((d) => setTimeout(() => {
|
|
1548
1801
|
throw d;
|
|
1549
1802
|
})));
|
|
1550
1803
|
},
|
|
1551
1804
|
reset: () => {
|
|
1552
|
-
|
|
1805
|
+
i.setState(i.initialState);
|
|
1553
1806
|
},
|
|
1554
1807
|
setOptions: (c) => {
|
|
1555
|
-
const d = H(c,
|
|
1556
|
-
|
|
1808
|
+
const d = H(c, i.options);
|
|
1809
|
+
i.options = s(d);
|
|
1557
1810
|
},
|
|
1558
|
-
getState: () =>
|
|
1811
|
+
getState: () => i.options.state,
|
|
1559
1812
|
setState: (c) => {
|
|
1560
|
-
|
|
1813
|
+
i.options.onStateChange == null || i.options.onStateChange(c);
|
|
1561
1814
|
},
|
|
1562
|
-
_getRowId: (c, d,
|
|
1563
|
-
var
|
|
1564
|
-
return (
|
|
1815
|
+
_getRowId: (c, d, g) => {
|
|
1816
|
+
var p;
|
|
1817
|
+
return (p = i.options.getRowId == null ? void 0 : i.options.getRowId(c, d, g)) != null ? p : `${g ? [g.id, d].join(".") : d}`;
|
|
1565
1818
|
},
|
|
1566
|
-
getCoreRowModel: () => (
|
|
1819
|
+
getCoreRowModel: () => (i._getCoreRowModel || (i._getCoreRowModel = i.options.getCoreRowModel(i)), i._getCoreRowModel()),
|
|
1567
1820
|
// The final calls start at the bottom of the model,
|
|
1568
1821
|
// expanded rows, which then work their way up
|
|
1569
|
-
getRowModel: () =>
|
|
1822
|
+
getRowModel: () => i.getPaginationRowModel(),
|
|
1570
1823
|
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1571
1824
|
getRow: (c, d) => {
|
|
1572
|
-
let
|
|
1573
|
-
if (!
|
|
1825
|
+
let g = (d ? i.getPrePaginationRowModel() : i.getRowModel()).rowsById[c];
|
|
1826
|
+
if (!g && (g = i.getCoreRowModel().rowsById[c], !g))
|
|
1574
1827
|
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${c}`) : new Error();
|
|
1575
|
-
return
|
|
1828
|
+
return g;
|
|
1576
1829
|
},
|
|
1577
|
-
_getDefaultColumnDef: C(() => [
|
|
1830
|
+
_getDefaultColumnDef: C(() => [i.options.defaultColumn], (c) => {
|
|
1578
1831
|
var d;
|
|
1579
1832
|
return c = (d = c) != null ? d : {}, {
|
|
1580
|
-
header: (
|
|
1581
|
-
const
|
|
1582
|
-
return
|
|
1833
|
+
header: (g) => {
|
|
1834
|
+
const p = g.header.column.columnDef;
|
|
1835
|
+
return p.accessorKey ? p.accessorKey : p.accessorFn ? p.id : null;
|
|
1583
1836
|
},
|
|
1584
1837
|
// footer: props => props.header.column.id,
|
|
1585
|
-
cell: (
|
|
1586
|
-
var
|
|
1587
|
-
return (
|
|
1838
|
+
cell: (g) => {
|
|
1839
|
+
var p, v;
|
|
1840
|
+
return (p = (v = g.renderValue()) == null || v.toString == null ? void 0 : v.toString()) != null ? p : null;
|
|
1588
1841
|
},
|
|
1589
|
-
...
|
|
1842
|
+
...i._features.reduce((g, p) => Object.assign(g, p.getDefaultColumnDef == null ? void 0 : p.getDefaultColumnDef()), {}),
|
|
1590
1843
|
...c
|
|
1591
1844
|
};
|
|
1592
1845
|
}, x(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1593
|
-
_getColumnDefs: () =>
|
|
1594
|
-
getAllColumns: C(() => [
|
|
1595
|
-
const d = function(
|
|
1596
|
-
return
|
|
1597
|
-
const
|
|
1598
|
-
return
|
|
1846
|
+
_getColumnDefs: () => i.options.columns,
|
|
1847
|
+
getAllColumns: C(() => [i._getColumnDefs()], (c) => {
|
|
1848
|
+
const d = function(g, p, v) {
|
|
1849
|
+
return v === void 0 && (v = 0), g.map((S) => {
|
|
1850
|
+
const w = Ht(i, S, v, p), _ = S;
|
|
1851
|
+
return w.columns = _.columns ? d(_.columns, w, v + 1) : [], w;
|
|
1599
1852
|
});
|
|
1600
1853
|
};
|
|
1601
1854
|
return d(c);
|
|
1602
1855
|
}, x(e, "debugColumns", "getAllColumns")),
|
|
1603
|
-
getAllFlatColumns: C(() => [
|
|
1604
|
-
_getAllFlatColumnsById: C(() => [
|
|
1605
|
-
getAllLeafColumns: C(() => [
|
|
1606
|
-
let
|
|
1607
|
-
return d(
|
|
1856
|
+
getAllFlatColumns: C(() => [i.getAllColumns()], (c) => c.flatMap((d) => d.getFlatColumns()), x(e, "debugColumns", "getAllFlatColumns")),
|
|
1857
|
+
_getAllFlatColumnsById: C(() => [i.getAllFlatColumns()], (c) => c.reduce((d, g) => (d[g.id] = g, d), {}), x(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1858
|
+
getAllLeafColumns: C(() => [i.getAllColumns(), i._getOrderColumnsFn()], (c, d) => {
|
|
1859
|
+
let g = c.flatMap((p) => p.getLeafColumns());
|
|
1860
|
+
return d(g);
|
|
1608
1861
|
}, x(e, "debugColumns", "getAllLeafColumns")),
|
|
1609
1862
|
getColumn: (c) => {
|
|
1610
|
-
const d =
|
|
1863
|
+
const d = i._getAllFlatColumnsById()[c];
|
|
1611
1864
|
return process.env.NODE_ENV !== "production" && !d && console.error(`[Table] Column with id '${c}' does not exist.`), d;
|
|
1612
1865
|
}
|
|
1613
1866
|
};
|
|
1614
|
-
Object.assign(
|
|
1615
|
-
for (let c = 0; c <
|
|
1616
|
-
const d =
|
|
1617
|
-
d == null || d.createTable == null || d.createTable(
|
|
1867
|
+
Object.assign(i, m);
|
|
1868
|
+
for (let c = 0; c < i._features.length; c++) {
|
|
1869
|
+
const d = i._features[c];
|
|
1870
|
+
d == null || d.createTable == null || d.createTable(i);
|
|
1618
1871
|
}
|
|
1619
|
-
return
|
|
1872
|
+
return i;
|
|
1620
1873
|
}
|
|
1621
|
-
function
|
|
1622
|
-
return (e) => C(() => [e.options.data], (
|
|
1874
|
+
function Rn() {
|
|
1875
|
+
return (e) => C(() => [e.options.data], (r) => {
|
|
1623
1876
|
const t = {
|
|
1624
1877
|
rows: [],
|
|
1625
1878
|
flatRows: [],
|
|
1626
1879
|
rowsById: {}
|
|
1627
|
-
}, n = function(
|
|
1628
|
-
|
|
1880
|
+
}, n = function(i, o, s) {
|
|
1881
|
+
o === void 0 && (o = 0);
|
|
1629
1882
|
const l = [];
|
|
1630
|
-
for (let u = 0; u <
|
|
1631
|
-
const
|
|
1632
|
-
if (t.flatRows.push(
|
|
1883
|
+
for (let u = 0; u < i.length; u++) {
|
|
1884
|
+
const f = Gt(e, e._getRowId(i[u], u, s), i[u], u, o, void 0, s == null ? void 0 : s.id);
|
|
1885
|
+
if (t.flatRows.push(f), t.rowsById[f.id] = f, l.push(f), e.options.getSubRows) {
|
|
1633
1886
|
var a;
|
|
1634
|
-
|
|
1887
|
+
f.originalSubRows = e.options.getSubRows(i[u], u), (a = f.originalSubRows) != null && a.length && (f.subRows = n(f.originalSubRows, o + 1, f));
|
|
1635
1888
|
}
|
|
1636
1889
|
}
|
|
1637
1890
|
return l;
|
|
1638
1891
|
};
|
|
1639
|
-
return t.rows = n(
|
|
1892
|
+
return t.rows = n(r), t;
|
|
1640
1893
|
}, x(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1641
1894
|
}
|
|
1642
|
-
function
|
|
1643
|
-
return (e) => C(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (
|
|
1895
|
+
function yn() {
|
|
1896
|
+
return (e) => C(() => [e.getState().expanded, e.getPreExpandedRowModel(), e.options.paginateExpandedRows], (r, t, n) => !t.rows.length || r !== !0 && !Object.keys(r ?? {}).length || !n ? t : _n(t), x(e.options, "debugTable", "getExpandedRowModel"));
|
|
1644
1897
|
}
|
|
1645
|
-
function
|
|
1646
|
-
const
|
|
1647
|
-
var
|
|
1648
|
-
|
|
1898
|
+
function _n(e) {
|
|
1899
|
+
const r = [], t = (n) => {
|
|
1900
|
+
var i;
|
|
1901
|
+
r.push(n), (i = n.subRows) != null && i.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1649
1902
|
};
|
|
1650
1903
|
return e.rows.forEach(t), {
|
|
1651
|
-
rows:
|
|
1904
|
+
rows: r,
|
|
1652
1905
|
flatRows: e.flatRows,
|
|
1653
1906
|
rowsById: e.rowsById
|
|
1654
1907
|
};
|
|
1655
1908
|
}
|
|
1656
|
-
function
|
|
1657
|
-
return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (
|
|
1658
|
-
if (!t.rows.length || !(
|
|
1909
|
+
function Fn() {
|
|
1910
|
+
return (e) => C(() => [e.getState().sorting, e.getPreSortedRowModel()], (r, t) => {
|
|
1911
|
+
if (!t.rows.length || !(r != null && r.length))
|
|
1659
1912
|
return t;
|
|
1660
|
-
const n = e.getState().sorting,
|
|
1913
|
+
const n = e.getState().sorting, i = [], o = n.filter((a) => {
|
|
1661
1914
|
var u;
|
|
1662
1915
|
return (u = e.getColumn(a.id)) == null ? void 0 : u.getCanSort();
|
|
1663
1916
|
}), s = {};
|
|
1664
|
-
|
|
1917
|
+
o.forEach((a) => {
|
|
1665
1918
|
const u = e.getColumn(a.id);
|
|
1666
1919
|
u && (s[a.id] = {
|
|
1667
1920
|
sortUndefined: u.columnDef.sortUndefined,
|
|
@@ -1670,34 +1923,34 @@ function vn() {
|
|
|
1670
1923
|
});
|
|
1671
1924
|
});
|
|
1672
1925
|
const l = (a) => {
|
|
1673
|
-
const u = a.map((
|
|
1674
|
-
...
|
|
1926
|
+
const u = a.map((f) => ({
|
|
1927
|
+
...f
|
|
1675
1928
|
}));
|
|
1676
|
-
return u.sort((
|
|
1677
|
-
for (let d = 0; d <
|
|
1929
|
+
return u.sort((f, m) => {
|
|
1930
|
+
for (let d = 0; d < o.length; d += 1) {
|
|
1678
1931
|
var c;
|
|
1679
|
-
const
|
|
1680
|
-
let
|
|
1681
|
-
if (
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1684
|
-
if (
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
1932
|
+
const g = o[d], p = s[g.id], v = p.sortUndefined, S = (c = g == null ? void 0 : g.desc) != null ? c : !1;
|
|
1933
|
+
let w = 0;
|
|
1934
|
+
if (v) {
|
|
1935
|
+
const _ = f.getValue(g.id), $ = m.getValue(g.id), E = _ === void 0, O = $ === void 0;
|
|
1936
|
+
if (E || O) {
|
|
1937
|
+
if (v === "first") return E ? -1 : 1;
|
|
1938
|
+
if (v === "last") return E ? 1 : -1;
|
|
1939
|
+
w = E && O ? 0 : E ? v : -v;
|
|
1687
1940
|
}
|
|
1688
1941
|
}
|
|
1689
|
-
if (
|
|
1690
|
-
return S && (
|
|
1942
|
+
if (w === 0 && (w = p.sortingFn(f, m, g.id)), w !== 0)
|
|
1943
|
+
return S && (w *= -1), p.invertSorting && (w *= -1), w;
|
|
1691
1944
|
}
|
|
1692
|
-
return
|
|
1693
|
-
}), u.forEach((
|
|
1945
|
+
return f.index - m.index;
|
|
1946
|
+
}), u.forEach((f) => {
|
|
1694
1947
|
var m;
|
|
1695
|
-
|
|
1948
|
+
i.push(f), (m = f.subRows) != null && m.length && (f.subRows = l(f.subRows));
|
|
1696
1949
|
}), u;
|
|
1697
1950
|
};
|
|
1698
1951
|
return {
|
|
1699
1952
|
rows: l(t.rows),
|
|
1700
|
-
flatRows:
|
|
1953
|
+
flatRows: i,
|
|
1701
1954
|
rowsById: t.rowsById
|
|
1702
1955
|
};
|
|
1703
1956
|
}, x(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
@@ -1712,23 +1965,23 @@ function vn() {
|
|
|
1712
1965
|
*
|
|
1713
1966
|
* @license MIT
|
|
1714
1967
|
*/
|
|
1715
|
-
function
|
|
1716
|
-
return e ?
|
|
1968
|
+
function We(e, r) {
|
|
1969
|
+
return e ? Mn(e) ? /* @__PURE__ */ B.createElement(e, r) : e : null;
|
|
1717
1970
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return
|
|
1971
|
+
function Mn(e) {
|
|
1972
|
+
return $n(e) || typeof e == "function" || In(e);
|
|
1720
1973
|
}
|
|
1721
|
-
function
|
|
1974
|
+
function $n(e) {
|
|
1722
1975
|
return typeof e == "function" && (() => {
|
|
1723
|
-
const
|
|
1724
|
-
return
|
|
1976
|
+
const r = Object.getPrototypeOf(e);
|
|
1977
|
+
return r.prototype && r.prototype.isReactComponent;
|
|
1725
1978
|
})();
|
|
1726
1979
|
}
|
|
1727
|
-
function
|
|
1980
|
+
function In(e) {
|
|
1728
1981
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
1729
1982
|
}
|
|
1730
|
-
function
|
|
1731
|
-
const
|
|
1983
|
+
function En(e) {
|
|
1984
|
+
const r = {
|
|
1732
1985
|
state: {},
|
|
1733
1986
|
// Dummy state
|
|
1734
1987
|
onStateChange: () => {
|
|
@@ -1737,10 +1990,10 @@ function Rn(e) {
|
|
|
1737
1990
|
renderFallbackValue: null,
|
|
1738
1991
|
...e
|
|
1739
1992
|
}, [t] = B.useState(() => ({
|
|
1740
|
-
current:
|
|
1741
|
-
})), [n,
|
|
1742
|
-
return t.current.setOptions((
|
|
1743
|
-
...
|
|
1993
|
+
current: xn(r)
|
|
1994
|
+
})), [n, i] = B.useState(() => t.current.initialState);
|
|
1995
|
+
return t.current.setOptions((o) => ({
|
|
1996
|
+
...o,
|
|
1744
1997
|
...e,
|
|
1745
1998
|
state: {
|
|
1746
1999
|
...n,
|
|
@@ -1749,158 +2002,158 @@ function Rn(e) {
|
|
|
1749
2002
|
// Similarly, we'll maintain both our internal state and any user-provided
|
|
1750
2003
|
// state.
|
|
1751
2004
|
onStateChange: (s) => {
|
|
1752
|
-
|
|
2005
|
+
i(s), e.onStateChange == null || e.onStateChange(s);
|
|
1753
2006
|
}
|
|
1754
2007
|
})), t.current;
|
|
1755
2008
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let n = t.initialDeps ?? [],
|
|
2009
|
+
function W(e, r, t) {
|
|
2010
|
+
let n = t.initialDeps ?? [], i, o = !0;
|
|
1758
2011
|
function s() {
|
|
1759
2012
|
var l, a, u;
|
|
1760
|
-
let
|
|
1761
|
-
t.key && ((l = t.debug) != null && l.call(t)) && (
|
|
2013
|
+
let f;
|
|
2014
|
+
t.key && ((l = t.debug) != null && l.call(t)) && (f = Date.now());
|
|
1762
2015
|
const m = e();
|
|
1763
|
-
if (!(m.length !== n.length || m.some((
|
|
1764
|
-
return
|
|
2016
|
+
if (!(m.length !== n.length || m.some((g, p) => n[p] !== g)))
|
|
2017
|
+
return i;
|
|
1765
2018
|
n = m;
|
|
1766
2019
|
let d;
|
|
1767
|
-
if (t.key && ((a = t.debug) != null && a.call(t)) && (d = Date.now()),
|
|
1768
|
-
const
|
|
1769
|
-
for (
|
|
1770
|
-
|
|
1771
|
-
return
|
|
2020
|
+
if (t.key && ((a = t.debug) != null && a.call(t)) && (d = Date.now()), i = r(...m), t.key && ((u = t.debug) != null && u.call(t))) {
|
|
2021
|
+
const g = Math.round((Date.now() - f) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, v = p / 16, S = (w, _) => {
|
|
2022
|
+
for (w = String(w); w.length < _; )
|
|
2023
|
+
w = " " + w;
|
|
2024
|
+
return w;
|
|
1772
2025
|
};
|
|
1773
2026
|
console.info(
|
|
1774
|
-
`%c⏱ ${S(
|
|
2027
|
+
`%c⏱ ${S(p, 5)} /${S(g, 5)} ms`,
|
|
1775
2028
|
`
|
|
1776
2029
|
font-size: .6rem;
|
|
1777
2030
|
font-weight: bold;
|
|
1778
2031
|
color: hsl(${Math.max(
|
|
1779
2032
|
0,
|
|
1780
|
-
Math.min(120 - 120 *
|
|
2033
|
+
Math.min(120 - 120 * v, 120)
|
|
1781
2034
|
)}deg 100% 31%);`,
|
|
1782
2035
|
t == null ? void 0 : t.key
|
|
1783
2036
|
);
|
|
1784
2037
|
}
|
|
1785
|
-
return t != null && t.onChange && !(
|
|
2038
|
+
return t != null && t.onChange && !(o && t.skipInitialOnChange) && t.onChange(i), o = !1, i;
|
|
1786
2039
|
}
|
|
1787
2040
|
return s.updateDeps = (l) => {
|
|
1788
2041
|
n = l;
|
|
1789
2042
|
}, s;
|
|
1790
2043
|
}
|
|
1791
|
-
function
|
|
2044
|
+
function Ke(e, r) {
|
|
1792
2045
|
if (e === void 0)
|
|
1793
2046
|
throw new Error("Unexpected undefined");
|
|
1794
2047
|
return e;
|
|
1795
2048
|
}
|
|
1796
|
-
const
|
|
2049
|
+
const bn = (e, r) => Math.abs(e - r) < 1.01, Vn = (e, r, t) => {
|
|
1797
2050
|
let n;
|
|
1798
|
-
return function(...
|
|
1799
|
-
e.clearTimeout(n), n = e.setTimeout(() =>
|
|
2051
|
+
return function(...i) {
|
|
2052
|
+
e.clearTimeout(n), n = e.setTimeout(() => r.apply(this, i), t);
|
|
1800
2053
|
};
|
|
1801
|
-
},
|
|
1802
|
-
const { offsetWidth:
|
|
1803
|
-
return { width:
|
|
1804
|
-
},
|
|
1805
|
-
const
|
|
1806
|
-
for (let
|
|
1807
|
-
n.push(
|
|
2054
|
+
}, Xe = (e) => {
|
|
2055
|
+
const { offsetWidth: r, offsetHeight: t } = e;
|
|
2056
|
+
return { width: r, height: t };
|
|
2057
|
+
}, Pn = (e) => e, zn = (e) => {
|
|
2058
|
+
const r = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
2059
|
+
for (let i = r; i <= t; i++)
|
|
2060
|
+
n.push(i);
|
|
1808
2061
|
return n;
|
|
1809
|
-
},
|
|
2062
|
+
}, On = (e, r) => {
|
|
1810
2063
|
const t = e.scrollElement;
|
|
1811
2064
|
if (!t)
|
|
1812
2065
|
return;
|
|
1813
2066
|
const n = e.targetWindow;
|
|
1814
2067
|
if (!n)
|
|
1815
2068
|
return;
|
|
1816
|
-
const
|
|
2069
|
+
const i = (s) => {
|
|
1817
2070
|
const { width: l, height: a } = s;
|
|
1818
|
-
|
|
2071
|
+
r({ width: Math.round(l), height: Math.round(a) });
|
|
1819
2072
|
};
|
|
1820
|
-
if (
|
|
2073
|
+
if (i(Xe(t)), !n.ResizeObserver)
|
|
1821
2074
|
return () => {
|
|
1822
2075
|
};
|
|
1823
|
-
const
|
|
2076
|
+
const o = new n.ResizeObserver((s) => {
|
|
1824
2077
|
const l = () => {
|
|
1825
2078
|
const a = s[0];
|
|
1826
2079
|
if (a != null && a.borderBoxSize) {
|
|
1827
2080
|
const u = a.borderBoxSize[0];
|
|
1828
2081
|
if (u) {
|
|
1829
|
-
|
|
2082
|
+
i({ width: u.inlineSize, height: u.blockSize });
|
|
1830
2083
|
return;
|
|
1831
2084
|
}
|
|
1832
2085
|
}
|
|
1833
|
-
|
|
2086
|
+
i(Xe(t));
|
|
1834
2087
|
};
|
|
1835
2088
|
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(l) : l();
|
|
1836
2089
|
});
|
|
1837
|
-
return
|
|
1838
|
-
|
|
2090
|
+
return o.observe(t, { box: "border-box" }), () => {
|
|
2091
|
+
o.unobserve(t);
|
|
1839
2092
|
};
|
|
1840
|
-
},
|
|
2093
|
+
}, Je = {
|
|
1841
2094
|
passive: !0
|
|
1842
|
-
},
|
|
2095
|
+
}, Qe = typeof window > "u" ? !0 : "onscrollend" in window, Nn = (e, r) => {
|
|
1843
2096
|
const t = e.scrollElement;
|
|
1844
2097
|
if (!t)
|
|
1845
2098
|
return;
|
|
1846
2099
|
const n = e.targetWindow;
|
|
1847
2100
|
if (!n)
|
|
1848
2101
|
return;
|
|
1849
|
-
let
|
|
1850
|
-
const
|
|
1851
|
-
} :
|
|
2102
|
+
let i = 0;
|
|
2103
|
+
const o = e.options.useScrollendEvent && Qe ? () => {
|
|
2104
|
+
} : Vn(
|
|
1852
2105
|
n,
|
|
1853
2106
|
() => {
|
|
1854
|
-
i
|
|
2107
|
+
r(i, !1);
|
|
1855
2108
|
},
|
|
1856
2109
|
e.options.isScrollingResetDelay
|
|
1857
|
-
), s = (
|
|
2110
|
+
), s = (f) => () => {
|
|
1858
2111
|
const { horizontal: m, isRtl: c } = e.options;
|
|
1859
|
-
|
|
2112
|
+
i = m ? t.scrollLeft * (c && -1 || 1) : t.scrollTop, o(), r(i, f);
|
|
1860
2113
|
}, l = s(!0), a = s(!1);
|
|
1861
|
-
t.addEventListener("scroll", l,
|
|
1862
|
-
const u = e.options.useScrollendEvent &&
|
|
1863
|
-
return u && t.addEventListener("scrollend", a,
|
|
2114
|
+
t.addEventListener("scroll", l, Je);
|
|
2115
|
+
const u = e.options.useScrollendEvent && Qe;
|
|
2116
|
+
return u && t.addEventListener("scrollend", a, Je), () => {
|
|
1864
2117
|
t.removeEventListener("scroll", l), u && t.removeEventListener("scrollend", a);
|
|
1865
2118
|
};
|
|
1866
|
-
},
|
|
1867
|
-
if (
|
|
1868
|
-
const n =
|
|
2119
|
+
}, An = (e, r, t) => {
|
|
2120
|
+
if (r != null && r.borderBoxSize) {
|
|
2121
|
+
const n = r.borderBoxSize[0];
|
|
1869
2122
|
if (n)
|
|
1870
2123
|
return Math.round(
|
|
1871
2124
|
n[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
1872
2125
|
);
|
|
1873
2126
|
}
|
|
1874
2127
|
return e[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
1875
|
-
},
|
|
1876
|
-
adjustments:
|
|
2128
|
+
}, Dn = (e, {
|
|
2129
|
+
adjustments: r = 0,
|
|
1877
2130
|
behavior: t
|
|
1878
2131
|
}, n) => {
|
|
1879
|
-
var
|
|
1880
|
-
const s = e +
|
|
1881
|
-
(
|
|
2132
|
+
var i, o;
|
|
2133
|
+
const s = e + r;
|
|
2134
|
+
(o = (i = n.scrollElement) == null ? void 0 : i.scrollTo) == null || o.call(i, {
|
|
1882
2135
|
[n.options.horizontal ? "left" : "top"]: s,
|
|
1883
2136
|
behavior: t
|
|
1884
2137
|
});
|
|
1885
2138
|
};
|
|
1886
|
-
class
|
|
1887
|
-
constructor(
|
|
2139
|
+
class Hn {
|
|
2140
|
+
constructor(r) {
|
|
1888
2141
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
1889
|
-
var t, n,
|
|
1890
|
-
return ((
|
|
2142
|
+
var t, n, i;
|
|
2143
|
+
return ((i = (n = (t = this.targetWindow) == null ? void 0 : t.performance) == null ? void 0 : n.now) == null ? void 0 : i.call(n)) ?? Date.now();
|
|
1891
2144
|
}, this.observer = /* @__PURE__ */ (() => {
|
|
1892
2145
|
let t = null;
|
|
1893
|
-
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((
|
|
1894
|
-
|
|
2146
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((i) => {
|
|
2147
|
+
i.forEach((o) => {
|
|
1895
2148
|
const s = () => {
|
|
1896
|
-
const l =
|
|
2149
|
+
const l = o.target, a = this.indexFromElement(l);
|
|
1897
2150
|
if (!l.isConnected) {
|
|
1898
2151
|
this.observer.unobserve(l);
|
|
1899
2152
|
return;
|
|
1900
2153
|
}
|
|
1901
2154
|
this.shouldMeasureDuringScroll(a) && this.resizeItem(
|
|
1902
2155
|
a,
|
|
1903
|
-
this.options.measureElement(l,
|
|
2156
|
+
this.options.measureElement(l, o, this)
|
|
1904
2157
|
);
|
|
1905
2158
|
};
|
|
1906
2159
|
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(s) : s();
|
|
@@ -1908,21 +2161,21 @@ class Vn {
|
|
|
1908
2161
|
}));
|
|
1909
2162
|
return {
|
|
1910
2163
|
disconnect: () => {
|
|
1911
|
-
var
|
|
1912
|
-
(
|
|
2164
|
+
var i;
|
|
2165
|
+
(i = n()) == null || i.disconnect(), t = null;
|
|
1913
2166
|
},
|
|
1914
|
-
observe: (
|
|
1915
|
-
var
|
|
1916
|
-
return (
|
|
2167
|
+
observe: (i) => {
|
|
2168
|
+
var o;
|
|
2169
|
+
return (o = n()) == null ? void 0 : o.observe(i, { box: "border-box" });
|
|
1917
2170
|
},
|
|
1918
|
-
unobserve: (
|
|
1919
|
-
var
|
|
1920
|
-
return (
|
|
2171
|
+
unobserve: (i) => {
|
|
2172
|
+
var o;
|
|
2173
|
+
return (o = n()) == null ? void 0 : o.unobserve(i);
|
|
1921
2174
|
}
|
|
1922
2175
|
};
|
|
1923
2176
|
})(), this.range = null, this.setOptions = (t) => {
|
|
1924
|
-
Object.entries(t).forEach(([n,
|
|
1925
|
-
typeof
|
|
2177
|
+
Object.entries(t).forEach(([n, i]) => {
|
|
2178
|
+
typeof i > "u" && delete t[n];
|
|
1926
2179
|
}), this.options = {
|
|
1927
2180
|
debug: !1,
|
|
1928
2181
|
initialOffset: 0,
|
|
@@ -1932,11 +2185,11 @@ class Vn {
|
|
|
1932
2185
|
scrollPaddingStart: 0,
|
|
1933
2186
|
scrollPaddingEnd: 0,
|
|
1934
2187
|
horizontal: !1,
|
|
1935
|
-
getItemKey:
|
|
1936
|
-
rangeExtractor:
|
|
2188
|
+
getItemKey: Pn,
|
|
2189
|
+
rangeExtractor: zn,
|
|
1937
2190
|
onChange: () => {
|
|
1938
2191
|
},
|
|
1939
|
-
measureElement:
|
|
2192
|
+
measureElement: An,
|
|
1940
2193
|
initialRect: { width: 0, height: 0 },
|
|
1941
2194
|
scrollMargin: 0,
|
|
1942
2195
|
gap: 0,
|
|
@@ -1951,9 +2204,9 @@ class Vn {
|
|
|
1951
2204
|
...t
|
|
1952
2205
|
};
|
|
1953
2206
|
}, this.notify = (t) => {
|
|
1954
|
-
var n,
|
|
1955
|
-
(
|
|
1956
|
-
}, this.maybeNotify =
|
|
2207
|
+
var n, i;
|
|
2208
|
+
(i = (n = this.options).onChange) == null || i.call(n, this, t);
|
|
2209
|
+
}, this.maybeNotify = W(
|
|
1957
2210
|
() => (this.calculateRange(), [
|
|
1958
2211
|
this.isScrolling,
|
|
1959
2212
|
this.range ? this.range.startIndex : null,
|
|
@@ -1983,15 +2236,15 @@ class Vn {
|
|
|
1983
2236
|
this.maybeNotify();
|
|
1984
2237
|
return;
|
|
1985
2238
|
}
|
|
1986
|
-
this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((
|
|
1987
|
-
this.observer.observe(
|
|
2239
|
+
this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((i) => {
|
|
2240
|
+
this.observer.observe(i);
|
|
1988
2241
|
}), this.unsubs.push(
|
|
1989
|
-
this.options.observeElementRect(this, (
|
|
1990
|
-
this.scrollRect =
|
|
2242
|
+
this.options.observeElementRect(this, (i) => {
|
|
2243
|
+
this.scrollRect = i, this.maybeNotify();
|
|
1991
2244
|
})
|
|
1992
2245
|
), this.unsubs.push(
|
|
1993
|
-
this.options.observeElementOffset(this, (
|
|
1994
|
-
this.scrollAdjustments = 0, this.scrollDirection =
|
|
2246
|
+
this.options.observeElementOffset(this, (i, o) => {
|
|
2247
|
+
this.scrollAdjustments = 0, this.scrollDirection = o ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = o, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
1995
2248
|
})
|
|
1996
2249
|
), this._scrollToOffset(this.getScrollOffset(), {
|
|
1997
2250
|
adjustments: void 0,
|
|
@@ -1999,19 +2252,19 @@ class Vn {
|
|
|
1999
2252
|
});
|
|
2000
2253
|
}
|
|
2001
2254
|
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
2002
|
-
const
|
|
2255
|
+
const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
2003
2256
|
for (let s = n - 1; s >= 0; s--) {
|
|
2004
2257
|
const l = t[s];
|
|
2005
|
-
if (
|
|
2258
|
+
if (i.has(l.lane))
|
|
2006
2259
|
continue;
|
|
2007
|
-
const a =
|
|
2260
|
+
const a = o.get(
|
|
2008
2261
|
l.lane
|
|
2009
2262
|
);
|
|
2010
|
-
if (a == null || l.end > a.end ?
|
|
2263
|
+
if (a == null || l.end > a.end ? o.set(l.lane, l) : l.end < a.end && i.set(l.lane, !0), i.size === this.options.lanes)
|
|
2011
2264
|
break;
|
|
2012
2265
|
}
|
|
2013
|
-
return
|
|
2014
|
-
}, this.getMeasurementOptions =
|
|
2266
|
+
return o.size === this.options.lanes ? Array.from(o.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
|
|
2267
|
+
}, this.getMeasurementOptions = W(
|
|
2015
2268
|
() => [
|
|
2016
2269
|
this.options.count,
|
|
2017
2270
|
this.options.paddingStart,
|
|
@@ -2020,20 +2273,20 @@ class Vn {
|
|
|
2020
2273
|
this.options.enabled,
|
|
2021
2274
|
this.options.lanes
|
|
2022
2275
|
],
|
|
2023
|
-
(t, n,
|
|
2276
|
+
(t, n, i, o, s, l) => (this.prevLanes !== void 0 && this.prevLanes !== l && (this.lanesChangedFlag = !0), this.prevLanes = l, this.pendingMeasuredCacheIndexes = [], {
|
|
2024
2277
|
count: t,
|
|
2025
2278
|
paddingStart: n,
|
|
2026
|
-
scrollMargin:
|
|
2027
|
-
getItemKey:
|
|
2279
|
+
scrollMargin: i,
|
|
2280
|
+
getItemKey: o,
|
|
2028
2281
|
enabled: s,
|
|
2029
2282
|
lanes: l
|
|
2030
2283
|
}),
|
|
2031
2284
|
{
|
|
2032
2285
|
key: !1
|
|
2033
2286
|
}
|
|
2034
|
-
), this.getMeasurements =
|
|
2287
|
+
), this.getMeasurements = W(
|
|
2035
2288
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
2036
|
-
({ count: t, paddingStart: n, scrollMargin:
|
|
2289
|
+
({ count: t, paddingStart: n, scrollMargin: i, getItemKey: o, enabled: s, lanes: l }, a) => {
|
|
2037
2290
|
if (!s)
|
|
2038
2291
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
2039
2292
|
if (this.laneAssignments.size > t)
|
|
@@ -2044,62 +2297,62 @@ class Vn {
|
|
|
2044
2297
|
}));
|
|
2045
2298
|
const u = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
2046
2299
|
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === t && (this.lanesSettling = !1);
|
|
2047
|
-
const
|
|
2300
|
+
const f = this.measurementsCache.slice(0, u), m = new Array(l).fill(
|
|
2048
2301
|
void 0
|
|
2049
2302
|
);
|
|
2050
2303
|
for (let c = 0; c < u; c++) {
|
|
2051
|
-
const d =
|
|
2304
|
+
const d = f[c];
|
|
2052
2305
|
d && (m[d.lane] = c);
|
|
2053
2306
|
}
|
|
2054
2307
|
for (let c = u; c < t; c++) {
|
|
2055
|
-
const d =
|
|
2056
|
-
let
|
|
2057
|
-
if (
|
|
2058
|
-
|
|
2059
|
-
const $ = m[
|
|
2060
|
-
|
|
2308
|
+
const d = o(c), g = this.laneAssignments.get(c);
|
|
2309
|
+
let p, v;
|
|
2310
|
+
if (g !== void 0 && this.options.lanes > 1) {
|
|
2311
|
+
p = g;
|
|
2312
|
+
const $ = m[p], E = $ !== void 0 ? f[$] : void 0;
|
|
2313
|
+
v = E ? E.end + this.options.gap : n + i;
|
|
2061
2314
|
} else {
|
|
2062
|
-
const $ = this.options.lanes === 1 ?
|
|
2063
|
-
|
|
2315
|
+
const $ = this.options.lanes === 1 ? f[c - 1] : this.getFurthestMeasurement(f, c);
|
|
2316
|
+
v = $ ? $.end + this.options.gap : n + i, p = $ ? $.lane : c % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(c, p);
|
|
2064
2317
|
}
|
|
2065
|
-
const S = a.get(d),
|
|
2066
|
-
|
|
2318
|
+
const S = a.get(d), w = typeof S == "number" ? S : this.options.estimateSize(c), _ = v + w;
|
|
2319
|
+
f[c] = {
|
|
2067
2320
|
index: c,
|
|
2068
|
-
start:
|
|
2069
|
-
size:
|
|
2070
|
-
end:
|
|
2321
|
+
start: v,
|
|
2322
|
+
size: w,
|
|
2323
|
+
end: _,
|
|
2071
2324
|
key: d,
|
|
2072
|
-
lane:
|
|
2073
|
-
}, m[
|
|
2325
|
+
lane: p
|
|
2326
|
+
}, m[p] = c;
|
|
2074
2327
|
}
|
|
2075
|
-
return this.measurementsCache =
|
|
2328
|
+
return this.measurementsCache = f, f;
|
|
2076
2329
|
},
|
|
2077
2330
|
{
|
|
2078
2331
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2079
2332
|
debug: () => this.options.debug
|
|
2080
2333
|
}
|
|
2081
|
-
), this.calculateRange =
|
|
2334
|
+
), this.calculateRange = W(
|
|
2082
2335
|
() => [
|
|
2083
2336
|
this.getMeasurements(),
|
|
2084
2337
|
this.getSize(),
|
|
2085
2338
|
this.getScrollOffset(),
|
|
2086
2339
|
this.options.lanes
|
|
2087
2340
|
],
|
|
2088
|
-
(t, n,
|
|
2341
|
+
(t, n, i, o) => this.range = t.length > 0 && n > 0 ? Ln({
|
|
2089
2342
|
measurements: t,
|
|
2090
2343
|
outerSize: n,
|
|
2091
|
-
scrollOffset:
|
|
2092
|
-
lanes:
|
|
2344
|
+
scrollOffset: i,
|
|
2345
|
+
lanes: o
|
|
2093
2346
|
}) : null,
|
|
2094
2347
|
{
|
|
2095
2348
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2096
2349
|
debug: () => this.options.debug
|
|
2097
2350
|
}
|
|
2098
|
-
), this.getVirtualIndexes =
|
|
2351
|
+
), this.getVirtualIndexes = W(
|
|
2099
2352
|
() => {
|
|
2100
2353
|
let t = null, n = null;
|
|
2101
|
-
const
|
|
2102
|
-
return
|
|
2354
|
+
const i = this.calculateRange();
|
|
2355
|
+
return i && (t = i.startIndex, n = i.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, n]), [
|
|
2103
2356
|
this.options.rangeExtractor,
|
|
2104
2357
|
this.options.overscan,
|
|
2105
2358
|
this.options.count,
|
|
@@ -2107,33 +2360,33 @@ class Vn {
|
|
|
2107
2360
|
n
|
|
2108
2361
|
];
|
|
2109
2362
|
},
|
|
2110
|
-
(t, n,
|
|
2111
|
-
startIndex:
|
|
2363
|
+
(t, n, i, o, s) => o === null || s === null ? [] : t({
|
|
2364
|
+
startIndex: o,
|
|
2112
2365
|
endIndex: s,
|
|
2113
2366
|
overscan: n,
|
|
2114
|
-
count:
|
|
2367
|
+
count: i
|
|
2115
2368
|
}),
|
|
2116
2369
|
{
|
|
2117
2370
|
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
2118
2371
|
debug: () => this.options.debug
|
|
2119
2372
|
}
|
|
2120
2373
|
), this.indexFromElement = (t) => {
|
|
2121
|
-
const n = this.options.indexAttribute,
|
|
2122
|
-
return
|
|
2374
|
+
const n = this.options.indexAttribute, i = t.getAttribute(n);
|
|
2375
|
+
return i ? parseInt(i, 10) : (console.warn(
|
|
2123
2376
|
`Missing attribute name '${n}={index}' on measured element.`
|
|
2124
2377
|
), -1);
|
|
2125
2378
|
}, this.shouldMeasureDuringScroll = (t) => {
|
|
2126
2379
|
var n;
|
|
2127
2380
|
if (!this.scrollState || this.scrollState.behavior !== "smooth")
|
|
2128
2381
|
return !0;
|
|
2129
|
-
const
|
|
2130
|
-
if (
|
|
2131
|
-
const
|
|
2382
|
+
const i = this.scrollState.index ?? ((n = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : n.index);
|
|
2383
|
+
if (i !== void 0 && this.range) {
|
|
2384
|
+
const o = Math.max(
|
|
2132
2385
|
this.options.overscan,
|
|
2133
2386
|
Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
|
|
2134
|
-
), s = Math.max(0,
|
|
2387
|
+
), s = Math.max(0, i - o), l = Math.min(
|
|
2135
2388
|
this.options.count - 1,
|
|
2136
|
-
|
|
2389
|
+
i + o
|
|
2137
2390
|
);
|
|
2138
2391
|
return t >= s && t <= l;
|
|
2139
2392
|
}
|
|
@@ -2145,26 +2398,26 @@ class Vn {
|
|
|
2145
2398
|
});
|
|
2146
2399
|
return;
|
|
2147
2400
|
}
|
|
2148
|
-
const n = this.indexFromElement(t),
|
|
2149
|
-
|
|
2401
|
+
const n = this.indexFromElement(t), i = this.options.getItemKey(n), o = this.elementsCache.get(i);
|
|
2402
|
+
o !== t && (o && this.observer.unobserve(o), this.observer.observe(t), this.elementsCache.set(i, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, void 0, this));
|
|
2150
2403
|
}, this.resizeItem = (t, n) => {
|
|
2151
|
-
var
|
|
2152
|
-
const
|
|
2153
|
-
if (!
|
|
2154
|
-
const s = this.itemSizeCache.get(
|
|
2155
|
-
l !== 0 && (((
|
|
2404
|
+
var i;
|
|
2405
|
+
const o = this.measurementsCache[t];
|
|
2406
|
+
if (!o) return;
|
|
2407
|
+
const s = this.itemSizeCache.get(o.key) ?? o.size, l = n - s;
|
|
2408
|
+
l !== 0 && (((i = this.scrollState) == null ? void 0 : i.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(o, l, this) : o.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", l), this._scrollToOffset(this.getScrollOffset(), {
|
|
2156
2409
|
adjustments: this.scrollAdjustments += l,
|
|
2157
2410
|
behavior: void 0
|
|
2158
|
-
})), this.pendingMeasuredCacheIndexes.push(
|
|
2159
|
-
}, this.getVirtualItems =
|
|
2411
|
+
})), this.pendingMeasuredCacheIndexes.push(o.index), this.itemSizeCache = new Map(this.itemSizeCache.set(o.key, n)), this.notify(!1));
|
|
2412
|
+
}, this.getVirtualItems = W(
|
|
2160
2413
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
2161
2414
|
(t, n) => {
|
|
2162
|
-
const
|
|
2163
|
-
for (let
|
|
2164
|
-
const l = t[
|
|
2165
|
-
|
|
2415
|
+
const i = [];
|
|
2416
|
+
for (let o = 0, s = t.length; o < s; o++) {
|
|
2417
|
+
const l = t[o], a = n[l];
|
|
2418
|
+
i.push(a);
|
|
2166
2419
|
}
|
|
2167
|
-
return
|
|
2420
|
+
return i;
|
|
2168
2421
|
},
|
|
2169
2422
|
{
|
|
2170
2423
|
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
@@ -2173,11 +2426,11 @@ class Vn {
|
|
|
2173
2426
|
), this.getVirtualItemForOffset = (t) => {
|
|
2174
2427
|
const n = this.getMeasurements();
|
|
2175
2428
|
if (n.length !== 0)
|
|
2176
|
-
return
|
|
2177
|
-
n[
|
|
2429
|
+
return Ke(
|
|
2430
|
+
n[pt(
|
|
2178
2431
|
0,
|
|
2179
2432
|
n.length - 1,
|
|
2180
|
-
(
|
|
2433
|
+
(i) => Ke(n[i]).start,
|
|
2181
2434
|
t
|
|
2182
2435
|
)]
|
|
2183
2436
|
);
|
|
@@ -2189,23 +2442,23 @@ class Vn {
|
|
|
2189
2442
|
const t = this.scrollElement.document.documentElement;
|
|
2190
2443
|
return this.options.horizontal ? t.scrollWidth - this.scrollElement.innerWidth : t.scrollHeight - this.scrollElement.innerHeight;
|
|
2191
2444
|
}
|
|
2192
|
-
}, this.getOffsetForAlignment = (t, n,
|
|
2445
|
+
}, this.getOffsetForAlignment = (t, n, i = 0) => {
|
|
2193
2446
|
if (!this.scrollElement) return 0;
|
|
2194
|
-
const
|
|
2195
|
-
n === "auto" && (n = t >= s +
|
|
2447
|
+
const o = this.getSize(), s = this.getScrollOffset();
|
|
2448
|
+
n === "auto" && (n = t >= s + o ? "end" : "start"), n === "center" ? t += (i - o) / 2 : n === "end" && (t -= o);
|
|
2196
2449
|
const l = this.getMaxScrollOffset();
|
|
2197
2450
|
return Math.max(Math.min(l, t), 0);
|
|
2198
2451
|
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
2199
2452
|
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2200
|
-
const
|
|
2453
|
+
const i = this.getSize(), o = this.getScrollOffset(), s = this.measurementsCache[t];
|
|
2201
2454
|
if (!s) return;
|
|
2202
2455
|
if (n === "auto")
|
|
2203
|
-
if (s.end >=
|
|
2456
|
+
if (s.end >= o + i - this.options.scrollPaddingEnd)
|
|
2204
2457
|
n = "end";
|
|
2205
|
-
else if (s.start <=
|
|
2458
|
+
else if (s.start <= o + this.options.scrollPaddingStart)
|
|
2206
2459
|
n = "start";
|
|
2207
2460
|
else
|
|
2208
|
-
return [
|
|
2461
|
+
return [o, n];
|
|
2209
2462
|
if (n === "end" && t === this.options.count - 1)
|
|
2210
2463
|
return [this.getMaxScrollOffset(), n];
|
|
2211
2464
|
const l = n === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
|
|
@@ -2213,72 +2466,72 @@ class Vn {
|
|
|
2213
2466
|
this.getOffsetForAlignment(l, n, s.size),
|
|
2214
2467
|
n
|
|
2215
2468
|
];
|
|
2216
|
-
}, this.scrollToOffset = (t, { align: n = "start", behavior:
|
|
2217
|
-
const
|
|
2469
|
+
}, this.scrollToOffset = (t, { align: n = "start", behavior: i = "auto" } = {}) => {
|
|
2470
|
+
const o = this.getOffsetForAlignment(t, n), s = this.now();
|
|
2218
2471
|
this.scrollState = {
|
|
2219
2472
|
index: null,
|
|
2220
2473
|
align: n,
|
|
2221
|
-
behavior:
|
|
2474
|
+
behavior: i,
|
|
2222
2475
|
startedAt: s,
|
|
2223
|
-
lastTargetOffset:
|
|
2476
|
+
lastTargetOffset: o,
|
|
2224
2477
|
stableFrames: 0
|
|
2225
|
-
}, this._scrollToOffset(
|
|
2478
|
+
}, this._scrollToOffset(o, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
|
|
2226
2479
|
}, this.scrollToIndex = (t, {
|
|
2227
2480
|
align: n = "auto",
|
|
2228
|
-
behavior:
|
|
2481
|
+
behavior: i = "auto"
|
|
2229
2482
|
} = {}) => {
|
|
2230
2483
|
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
2231
|
-
const
|
|
2232
|
-
if (!
|
|
2484
|
+
const o = this.getOffsetForIndex(t, n);
|
|
2485
|
+
if (!o)
|
|
2233
2486
|
return;
|
|
2234
|
-
const [s, l] =
|
|
2487
|
+
const [s, l] = o, a = this.now();
|
|
2235
2488
|
this.scrollState = {
|
|
2236
2489
|
index: t,
|
|
2237
2490
|
align: l,
|
|
2238
|
-
behavior:
|
|
2491
|
+
behavior: i,
|
|
2239
2492
|
startedAt: a,
|
|
2240
2493
|
lastTargetOffset: s,
|
|
2241
2494
|
stableFrames: 0
|
|
2242
|
-
}, this._scrollToOffset(s, { adjustments: void 0, behavior:
|
|
2495
|
+
}, this._scrollToOffset(s, { adjustments: void 0, behavior: i }), this.scheduleScrollReconcile();
|
|
2243
2496
|
}, this.scrollBy = (t, { behavior: n = "auto" } = {}) => {
|
|
2244
|
-
const
|
|
2497
|
+
const i = this.getScrollOffset() + t, o = this.now();
|
|
2245
2498
|
this.scrollState = {
|
|
2246
2499
|
index: null,
|
|
2247
2500
|
align: "start",
|
|
2248
2501
|
behavior: n,
|
|
2249
|
-
startedAt:
|
|
2250
|
-
lastTargetOffset:
|
|
2502
|
+
startedAt: o,
|
|
2503
|
+
lastTargetOffset: i,
|
|
2251
2504
|
stableFrames: 0
|
|
2252
|
-
}, this._scrollToOffset(
|
|
2505
|
+
}, this._scrollToOffset(i, { adjustments: void 0, behavior: n }), this.scheduleScrollReconcile();
|
|
2253
2506
|
}, this.getTotalSize = () => {
|
|
2254
2507
|
var t;
|
|
2255
2508
|
const n = this.getMeasurements();
|
|
2256
|
-
let
|
|
2509
|
+
let i;
|
|
2257
2510
|
if (n.length === 0)
|
|
2258
|
-
|
|
2511
|
+
i = this.options.paddingStart;
|
|
2259
2512
|
else if (this.options.lanes === 1)
|
|
2260
|
-
|
|
2513
|
+
i = ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
2261
2514
|
else {
|
|
2262
|
-
const
|
|
2515
|
+
const o = Array(this.options.lanes).fill(null);
|
|
2263
2516
|
let s = n.length - 1;
|
|
2264
|
-
for (; s >= 0 &&
|
|
2517
|
+
for (; s >= 0 && o.some((l) => l === null); ) {
|
|
2265
2518
|
const l = n[s];
|
|
2266
|
-
|
|
2519
|
+
o[l.lane] === null && (o[l.lane] = l.end), s--;
|
|
2267
2520
|
}
|
|
2268
|
-
|
|
2521
|
+
i = Math.max(...o.filter((l) => l !== null));
|
|
2269
2522
|
}
|
|
2270
2523
|
return Math.max(
|
|
2271
|
-
|
|
2524
|
+
i - this.options.scrollMargin + this.options.paddingEnd,
|
|
2272
2525
|
0
|
|
2273
2526
|
);
|
|
2274
2527
|
}, this._scrollToOffset = (t, {
|
|
2275
2528
|
adjustments: n,
|
|
2276
|
-
behavior:
|
|
2529
|
+
behavior: i
|
|
2277
2530
|
}) => {
|
|
2278
|
-
this.options.scrollToFn(t, { behavior:
|
|
2531
|
+
this.options.scrollToFn(t, { behavior: i, adjustments: n }, this);
|
|
2279
2532
|
}, this.measure = () => {
|
|
2280
2533
|
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
2281
|
-
}, this.setOptions(
|
|
2534
|
+
}, this.setOptions(r);
|
|
2282
2535
|
}
|
|
2283
2536
|
scheduleScrollReconcile() {
|
|
2284
2537
|
if (!this.targetWindow) {
|
|
@@ -2295,337 +2548,410 @@ class Vn {
|
|
|
2295
2548
|
this.scrollState = null;
|
|
2296
2549
|
return;
|
|
2297
2550
|
}
|
|
2298
|
-
const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0,
|
|
2299
|
-
if (!s &&
|
|
2300
|
-
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >=
|
|
2551
|
+
const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, i = n ? n[0] : this.scrollState.lastTargetOffset, o = 1, s = i !== this.scrollState.lastTargetOffset;
|
|
2552
|
+
if (!s && bn(i, this.getScrollOffset())) {
|
|
2553
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= o) {
|
|
2301
2554
|
this.scrollState = null;
|
|
2302
2555
|
return;
|
|
2303
2556
|
}
|
|
2304
2557
|
} else
|
|
2305
|
-
this.scrollState.stableFrames = 0, s && (this.scrollState.lastTargetOffset =
|
|
2558
|
+
this.scrollState.stableFrames = 0, s && (this.scrollState.lastTargetOffset = i, this.scrollState.behavior = "auto", this._scrollToOffset(i, {
|
|
2306
2559
|
adjustments: void 0,
|
|
2307
2560
|
behavior: "auto"
|
|
2308
2561
|
}));
|
|
2309
2562
|
this.scheduleScrollReconcile();
|
|
2310
2563
|
}
|
|
2311
2564
|
}
|
|
2312
|
-
const
|
|
2313
|
-
for (; e <=
|
|
2314
|
-
const
|
|
2315
|
-
if (
|
|
2316
|
-
e =
|
|
2317
|
-
else if (
|
|
2318
|
-
|
|
2565
|
+
const pt = (e, r, t, n) => {
|
|
2566
|
+
for (; e <= r; ) {
|
|
2567
|
+
const i = (e + r) / 2 | 0, o = t(i);
|
|
2568
|
+
if (o < n)
|
|
2569
|
+
e = i + 1;
|
|
2570
|
+
else if (o > n)
|
|
2571
|
+
r = i - 1;
|
|
2319
2572
|
else
|
|
2320
|
-
return
|
|
2573
|
+
return i;
|
|
2321
2574
|
}
|
|
2322
2575
|
return e > 0 ? e - 1 : 0;
|
|
2323
2576
|
};
|
|
2324
|
-
function
|
|
2577
|
+
function Ln({
|
|
2325
2578
|
measurements: e,
|
|
2326
|
-
outerSize:
|
|
2579
|
+
outerSize: r,
|
|
2327
2580
|
scrollOffset: t,
|
|
2328
2581
|
lanes: n
|
|
2329
2582
|
}) {
|
|
2330
|
-
const
|
|
2583
|
+
const i = e.length - 1, o = (a) => e[a].start;
|
|
2331
2584
|
if (e.length <= n)
|
|
2332
2585
|
return {
|
|
2333
2586
|
startIndex: 0,
|
|
2334
|
-
endIndex:
|
|
2587
|
+
endIndex: i
|
|
2335
2588
|
};
|
|
2336
|
-
let s =
|
|
2589
|
+
let s = pt(
|
|
2337
2590
|
0,
|
|
2591
|
+
i,
|
|
2338
2592
|
o,
|
|
2339
|
-
r,
|
|
2340
2593
|
t
|
|
2341
2594
|
), l = s;
|
|
2342
2595
|
if (n === 1)
|
|
2343
|
-
for (; l <
|
|
2596
|
+
for (; l < i && e[l].end < t + r; )
|
|
2344
2597
|
l++;
|
|
2345
2598
|
else if (n > 1) {
|
|
2346
2599
|
const a = Array(n).fill(0);
|
|
2347
|
-
for (; l <
|
|
2348
|
-
const
|
|
2349
|
-
a[
|
|
2600
|
+
for (; l < i && a.some((f) => f < t + r); ) {
|
|
2601
|
+
const f = e[l];
|
|
2602
|
+
a[f.lane] = f.end, l++;
|
|
2350
2603
|
}
|
|
2351
|
-
const u = Array(n).fill(t +
|
|
2352
|
-
for (; s >= 0 && u.some((
|
|
2353
|
-
const
|
|
2354
|
-
u[
|
|
2604
|
+
const u = Array(n).fill(t + r);
|
|
2605
|
+
for (; s >= 0 && u.some((f) => f >= t); ) {
|
|
2606
|
+
const f = e[s];
|
|
2607
|
+
u[f.lane] = f.start, s--;
|
|
2355
2608
|
}
|
|
2356
|
-
s = Math.max(0, s - s % n), l = Math.min(
|
|
2609
|
+
s = Math.max(0, s - s % n), l = Math.min(i, l + (n - 1 - l % n));
|
|
2357
2610
|
}
|
|
2358
2611
|
return { startIndex: s, endIndex: l };
|
|
2359
2612
|
}
|
|
2360
|
-
const
|
|
2361
|
-
function
|
|
2613
|
+
const Ye = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
|
|
2614
|
+
function Gn({
|
|
2362
2615
|
useFlushSync: e = !0,
|
|
2363
|
-
...
|
|
2616
|
+
...r
|
|
2364
2617
|
}) {
|
|
2365
2618
|
const t = B.useReducer(() => ({}), {})[1], n = {
|
|
2366
|
-
...
|
|
2367
|
-
onChange: (
|
|
2619
|
+
...r,
|
|
2620
|
+
onChange: (o, s) => {
|
|
2368
2621
|
var l;
|
|
2369
|
-
e && s ?
|
|
2622
|
+
e && s ? bt(t) : t(), (l = r.onChange) == null || l.call(r, o, s);
|
|
2370
2623
|
}
|
|
2371
|
-
}, [
|
|
2372
|
-
() => new
|
|
2624
|
+
}, [i] = B.useState(
|
|
2625
|
+
() => new Hn(n)
|
|
2373
2626
|
);
|
|
2374
|
-
return
|
|
2627
|
+
return i.setOptions(n), Ye(() => i._didMount(), []), Ye(() => i._willUpdate()), i;
|
|
2375
2628
|
}
|
|
2376
|
-
function
|
|
2377
|
-
return
|
|
2378
|
-
observeElementRect:
|
|
2379
|
-
observeElementOffset:
|
|
2380
|
-
scrollToFn:
|
|
2629
|
+
function kn(e) {
|
|
2630
|
+
return Gn({
|
|
2631
|
+
observeElementRect: On,
|
|
2632
|
+
observeElementOffset: Nn,
|
|
2633
|
+
scrollToFn: Dn,
|
|
2381
2634
|
...e
|
|
2382
2635
|
});
|
|
2383
2636
|
}
|
|
2384
|
-
function
|
|
2385
|
-
const
|
|
2637
|
+
function Tn(e) {
|
|
2638
|
+
const r = {}, t = {};
|
|
2386
2639
|
let n = 0;
|
|
2387
|
-
for (const
|
|
2388
|
-
|
|
2389
|
-
let
|
|
2390
|
-
for (let
|
|
2391
|
-
const s = e[
|
|
2392
|
-
s.fixed === "right" && (t[s.key] =
|
|
2640
|
+
for (const o of e)
|
|
2641
|
+
o.fixed === "left" && (r[o.key] = n, n += o.width || o.minWidth || 100);
|
|
2642
|
+
let i = 0;
|
|
2643
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
2644
|
+
const s = e[o];
|
|
2645
|
+
s.fixed === "right" && (t[s.key] = i, i += s.width || s.minWidth || 100);
|
|
2393
2646
|
}
|
|
2394
|
-
return { leftOffsets:
|
|
2647
|
+
return { leftOffsets: r, rightOffsets: t };
|
|
2395
2648
|
}
|
|
2396
|
-
function
|
|
2649
|
+
function er({
|
|
2397
2650
|
columns: e,
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2651
|
+
columnDefs: r,
|
|
2652
|
+
tableRef: t,
|
|
2653
|
+
data: n,
|
|
2654
|
+
rowKey: i = "id",
|
|
2655
|
+
childrenKey: o = "children",
|
|
2656
|
+
height: s,
|
|
2657
|
+
estimateRowHeight: l = 48,
|
|
2658
|
+
bordered: a = !1,
|
|
2659
|
+
striped: u = !1,
|
|
2660
|
+
emptyText: f = "暂无数据",
|
|
2661
|
+
selectable: m = !1,
|
|
2662
|
+
onSelectionChange: c,
|
|
2663
|
+
onSortChange: d,
|
|
2664
|
+
onRowClick: g,
|
|
2665
|
+
rowClassName: p,
|
|
2666
|
+
loading: v = !1,
|
|
2667
|
+
className: S = ""
|
|
2413
2668
|
}) {
|
|
2414
|
-
const [w,
|
|
2669
|
+
const [w, _] = X([]), [$, E] = X({}), [O, oe] = X({}), Y = Mt(null), Se = J(
|
|
2415
2670
|
(R) => {
|
|
2416
|
-
|
|
2417
|
-
const
|
|
2418
|
-
return
|
|
2671
|
+
_((M) => {
|
|
2672
|
+
const y = typeof R == "function" ? R(M) : R;
|
|
2673
|
+
return d == null || d(y), y;
|
|
2419
2674
|
});
|
|
2420
2675
|
},
|
|
2421
|
-
[
|
|
2422
|
-
),
|
|
2676
|
+
[d]
|
|
2677
|
+
), ve = J(
|
|
2423
2678
|
(R) => {
|
|
2424
|
-
|
|
2679
|
+
oe((M) => typeof R == "function" ? R(M) : R);
|
|
2425
2680
|
},
|
|
2426
2681
|
[]
|
|
2427
|
-
), { leftOffsets:
|
|
2428
|
-
|
|
2429
|
-
|
|
2682
|
+
), { leftOffsets: j, rightOffsets: we } = le(
|
|
2683
|
+
() => Tn(e ?? []),
|
|
2684
|
+
[e]
|
|
2685
|
+
), Z = le(() => {
|
|
2686
|
+
if (r)
|
|
2687
|
+
return m ? [
|
|
2688
|
+
{
|
|
2689
|
+
id: "__selection",
|
|
2690
|
+
size: 48,
|
|
2691
|
+
minSize: 48,
|
|
2692
|
+
enableSorting: !1,
|
|
2693
|
+
header: ({ table: y }) => /* @__PURE__ */ h(
|
|
2694
|
+
"input",
|
|
2695
|
+
{
|
|
2696
|
+
type: "checkbox",
|
|
2697
|
+
className: "w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",
|
|
2698
|
+
checked: y.getIsAllRowsSelected(),
|
|
2699
|
+
onChange: y.getToggleAllRowsSelectedHandler(),
|
|
2700
|
+
"aria-label": "全选"
|
|
2701
|
+
}
|
|
2702
|
+
),
|
|
2703
|
+
cell: ({ row: y }) => /* @__PURE__ */ h(
|
|
2704
|
+
"input",
|
|
2705
|
+
{
|
|
2706
|
+
type: "checkbox",
|
|
2707
|
+
className: "w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",
|
|
2708
|
+
checked: y.getIsSelected(),
|
|
2709
|
+
onChange: y.getToggleSelectedHandler(),
|
|
2710
|
+
onClick: (I) => I.stopPropagation(),
|
|
2711
|
+
"aria-label": "选择行"
|
|
2712
|
+
}
|
|
2713
|
+
)
|
|
2714
|
+
},
|
|
2715
|
+
...r
|
|
2716
|
+
] : r;
|
|
2717
|
+
const R = e ?? [], M = [];
|
|
2718
|
+
m && M.push({
|
|
2430
2719
|
id: "__selection",
|
|
2431
2720
|
size: 48,
|
|
2432
2721
|
minSize: 48,
|
|
2433
2722
|
enableSorting: !1,
|
|
2434
|
-
header: ({ table: y }) => /* @__PURE__ */
|
|
2723
|
+
header: ({ table: y }) => /* @__PURE__ */ h(
|
|
2435
2724
|
"input",
|
|
2436
2725
|
{
|
|
2437
2726
|
type: "checkbox",
|
|
2438
|
-
className: "
|
|
2727
|
+
className: "w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",
|
|
2439
2728
|
checked: y.getIsAllRowsSelected(),
|
|
2440
2729
|
onChange: y.getToggleAllRowsSelectedHandler(),
|
|
2441
2730
|
"aria-label": "全选"
|
|
2442
2731
|
}
|
|
2443
2732
|
),
|
|
2444
|
-
cell: ({ row: y }) => /* @__PURE__ */
|
|
2733
|
+
cell: ({ row: y }) => /* @__PURE__ */ h(
|
|
2445
2734
|
"input",
|
|
2446
2735
|
{
|
|
2447
2736
|
type: "checkbox",
|
|
2448
|
-
className: "
|
|
2737
|
+
className: "w-4 h-4 rounded border-gray-300 text-primary focus:ring-primary",
|
|
2449
2738
|
checked: y.getIsSelected(),
|
|
2450
2739
|
onChange: y.getToggleSelectedHandler(),
|
|
2451
|
-
onClick: (
|
|
2740
|
+
onClick: (I) => I.stopPropagation(),
|
|
2452
2741
|
"aria-label": "选择行"
|
|
2453
2742
|
}
|
|
2454
2743
|
)
|
|
2455
2744
|
});
|
|
2456
|
-
for (const y of
|
|
2457
|
-
|
|
2745
|
+
for (const y of R)
|
|
2746
|
+
M.push({
|
|
2458
2747
|
id: y.key,
|
|
2459
2748
|
accessorKey: y.key,
|
|
2460
2749
|
header: y.title,
|
|
2461
2750
|
size: y.width,
|
|
2462
2751
|
minSize: y.minWidth || 80,
|
|
2463
2752
|
enableSorting: y.sortable ?? !1,
|
|
2464
|
-
cell: (
|
|
2465
|
-
var
|
|
2466
|
-
const
|
|
2467
|
-
return /* @__PURE__ */
|
|
2468
|
-
|
|
2753
|
+
cell: (I) => {
|
|
2754
|
+
var Te;
|
|
2755
|
+
const U = I.getValue(), yt = I.row.original, _t = I.row.index, Ce = ((Te = R[0]) == null ? void 0 : Te.key) === y.key, ke = Ce && I.row.getCanExpand();
|
|
2756
|
+
return /* @__PURE__ */ F("div", { className: "flex items-center gap-1", style: { paddingLeft: Ce ? `${I.row.depth * 20}px` : void 0 }, children: [
|
|
2757
|
+
ke && /* @__PURE__ */ h(
|
|
2469
2758
|
"button",
|
|
2470
2759
|
{
|
|
2471
|
-
className: "
|
|
2472
|
-
onClick: (
|
|
2473
|
-
|
|
2760
|
+
className: "p-0.5 rounded hover:bg-gray-200 text-gray-500",
|
|
2761
|
+
onClick: (Ft) => {
|
|
2762
|
+
Ft.stopPropagation(), I.row.toggleExpanded();
|
|
2474
2763
|
},
|
|
2475
|
-
"aria-label":
|
|
2476
|
-
children: /* @__PURE__ */
|
|
2764
|
+
"aria-label": I.row.getIsExpanded() ? "收起" : "展开",
|
|
2765
|
+
children: /* @__PURE__ */ h("svg", { className: `w-4 h-4 transition-transform ${I.row.getIsExpanded() ? "rotate-90" : ""}`, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ h("path", { fillRule: "evenodd", d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z", clipRule: "evenodd" }) })
|
|
2477
2766
|
}
|
|
2478
2767
|
),
|
|
2479
|
-
|
|
2480
|
-
/* @__PURE__ */
|
|
2768
|
+
Ce && !ke && I.row.depth > 0 && /* @__PURE__ */ h("span", { className: "w-4" }),
|
|
2769
|
+
/* @__PURE__ */ h("span", { className: `truncate ${y.align === "center" ? "text-center w-full" : y.align === "right" ? "text-right w-full" : ""}`, children: y.render ? y.render(U, yt, _t) : U ?? "-" })
|
|
2481
2770
|
] });
|
|
2482
2771
|
}
|
|
2483
2772
|
});
|
|
2484
|
-
return
|
|
2485
|
-
}, [e,
|
|
2486
|
-
data:
|
|
2487
|
-
columns:
|
|
2488
|
-
state: { sorting: w, expanded:
|
|
2489
|
-
onSortingChange:
|
|
2490
|
-
onExpandedChange:
|
|
2491
|
-
onRowSelectionChange:
|
|
2492
|
-
getRowId: (R) => String(R[
|
|
2493
|
-
getSubRows: (R) => R[
|
|
2494
|
-
getCoreRowModel:
|
|
2495
|
-
getSortedRowModel:
|
|
2496
|
-
getExpandedRowModel:
|
|
2497
|
-
enableRowSelection:
|
|
2498
|
-
})
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}, [
|
|
2502
|
-
const
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2773
|
+
return M;
|
|
2774
|
+
}, [e, r, m]), q = En({
|
|
2775
|
+
data: n,
|
|
2776
|
+
columns: Z,
|
|
2777
|
+
state: { sorting: w, expanded: $, rowSelection: O },
|
|
2778
|
+
onSortingChange: Se,
|
|
2779
|
+
onExpandedChange: E,
|
|
2780
|
+
onRowSelectionChange: ve,
|
|
2781
|
+
getRowId: (R) => String(R[i] ?? ""),
|
|
2782
|
+
getSubRows: (R) => R[o],
|
|
2783
|
+
getCoreRowModel: Rn(),
|
|
2784
|
+
getSortedRowModel: Fn(),
|
|
2785
|
+
getExpandedRowModel: yn(),
|
|
2786
|
+
enableRowSelection: m
|
|
2787
|
+
});
|
|
2788
|
+
pe(() => {
|
|
2789
|
+
t && (t.current = q);
|
|
2790
|
+
}, [q, t]);
|
|
2791
|
+
const De = le(() => m ? q.getSelectedRowModel().rows.map((R) => R.original) : [], [q, m, O]);
|
|
2792
|
+
le(() => {
|
|
2793
|
+
m && c && c(De);
|
|
2794
|
+
}, [De]);
|
|
2795
|
+
const { rows: se } = q.getRowModel(), He = kn({
|
|
2796
|
+
count: se.length,
|
|
2797
|
+
getScrollElement: () => Y.current,
|
|
2798
|
+
estimateSize: () => l,
|
|
2506
2799
|
overscan: 10,
|
|
2507
|
-
enabled: !!
|
|
2508
|
-
}),
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2800
|
+
enabled: !!s
|
|
2801
|
+
}), vt = J((R, M) => V(
|
|
2802
|
+
"hover:bg-gray-50 transition-colors",
|
|
2803
|
+
u && M % 2 === 1 && "bg-gray-50",
|
|
2804
|
+
g && "cursor-pointer",
|
|
2805
|
+
typeof p == "function" ? p(R.original, M) : p
|
|
2806
|
+
), [u, g, p]), Le = (R) => R in j ? { position: "sticky", left: j[R], zIndex: 1 } : R in we ? { position: "sticky", right: we[R], zIndex: 1 } : {}, wt = (R) => R in j || R in we ? "bg-white" : "", Ct = () => /* @__PURE__ */ h("thead", { children: q.getHeaderGroups().map((R) => /* @__PURE__ */ h("tr", { children: R.headers.map((M) => {
|
|
2807
|
+
const y = e == null ? void 0 : e.find((U) => U.key === M.id), I = M.column.getIsSorted();
|
|
2808
|
+
return /* @__PURE__ */ h(
|
|
2514
2809
|
"th",
|
|
2515
2810
|
{
|
|
2516
|
-
className:
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2811
|
+
className: V(
|
|
2812
|
+
"px-3 py-2 text-left text-sm font-medium text-gray-600 bg-gray-50",
|
|
2813
|
+
"border-b border-gray-200 whitespace-nowrap",
|
|
2814
|
+
M.column.getCanSort() && "cursor-pointer select-none hover:bg-gray-100"
|
|
2815
|
+
),
|
|
2816
|
+
style: {
|
|
2817
|
+
width: M.getSize(),
|
|
2818
|
+
minWidth: M.column.columnDef.minSize,
|
|
2819
|
+
textAlign: (y == null ? void 0 : y.align) || "left",
|
|
2820
|
+
// 固定列偏移量为运行时计算值,保留内联 style
|
|
2821
|
+
...Le(M.id)
|
|
2822
|
+
},
|
|
2823
|
+
onClick: M.column.getToggleSortingHandler(),
|
|
2824
|
+
children: /* @__PURE__ */ F("div", { className: "flex items-center gap-1", children: [
|
|
2825
|
+
We(M.column.columnDef.header, M.getContext()),
|
|
2826
|
+
M.column.getCanSort() && // 排序图标激活状态使用 text-primary 工具类
|
|
2827
|
+
/* @__PURE__ */ h("span", { className: V("text-xs", I ? "text-primary" : "text-gray-400"), children: { asc: "↑", desc: "↓" }[I] ?? "↕" })
|
|
2522
2828
|
] })
|
|
2523
2829
|
},
|
|
2524
|
-
|
|
2830
|
+
M.id
|
|
2525
2831
|
);
|
|
2526
|
-
}) }, R.id)) }),
|
|
2527
|
-
const
|
|
2528
|
-
return /* @__PURE__ */
|
|
2832
|
+
}) }, R.id)) }), Ge = (R, M) => /* @__PURE__ */ h("tr", { className: vt(R, M), onClick: () => g == null ? void 0 : g(R.original), children: R.getVisibleCells().map((y) => {
|
|
2833
|
+
const I = e == null ? void 0 : e.find((U) => U.key === y.column.id);
|
|
2834
|
+
return /* @__PURE__ */ h(
|
|
2529
2835
|
"td",
|
|
2530
2836
|
{
|
|
2531
|
-
className:
|
|
2532
|
-
|
|
2533
|
-
|
|
2837
|
+
className: V(
|
|
2838
|
+
"px-3 py-2 text-sm text-gray-700 border-b border-gray-100",
|
|
2839
|
+
wt(y.column.id)
|
|
2840
|
+
),
|
|
2841
|
+
style: {
|
|
2842
|
+
width: y.column.getSize(),
|
|
2843
|
+
minWidth: y.column.columnDef.minSize,
|
|
2844
|
+
textAlign: (I == null ? void 0 : I.align) || "left",
|
|
2845
|
+
// 固定列偏移量为运行时计算值,保留内联 style
|
|
2846
|
+
...Le(y.column.id)
|
|
2847
|
+
},
|
|
2848
|
+
children: We(y.column.columnDef.cell, y.getContext())
|
|
2534
2849
|
},
|
|
2535
|
-
|
|
2850
|
+
y.id
|
|
2536
2851
|
);
|
|
2537
|
-
}) }, R.id),
|
|
2538
|
-
const R =
|
|
2539
|
-
return /* @__PURE__ */
|
|
2540
|
-
R[0].start > 0 && /* @__PURE__ */
|
|
2541
|
-
R.map((
|
|
2542
|
-
R[R.length - 1].end <
|
|
2852
|
+
}) }, R.id), xt = () => {
|
|
2853
|
+
const R = He.getVirtualItems(), M = He.getTotalSize();
|
|
2854
|
+
return /* @__PURE__ */ h("tbody", { children: R.length === 0 ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: Z.length, className: "py-12 text-center text-sm text-gray-400", children: f }) }) : /* @__PURE__ */ F(tt, { children: [
|
|
2855
|
+
R[0].start > 0 && /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: Z.length, style: { height: R[0].start } }) }),
|
|
2856
|
+
R.map((y) => Ge(se[y.index], y.index)),
|
|
2857
|
+
R[R.length - 1].end < M && /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: Z.length, style: { height: M - R[R.length - 1].end } }) })
|
|
2543
2858
|
] }) });
|
|
2544
|
-
},
|
|
2545
|
-
return /* @__PURE__ */
|
|
2546
|
-
|
|
2547
|
-
|
|
2859
|
+
}, Rt = () => /* @__PURE__ */ h("tbody", { children: se.length === 0 ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: Z.length, className: "py-12 text-center text-sm text-gray-400", children: f }) }) : se.map((R, M) => Ge(R, M)) });
|
|
2860
|
+
return /* @__PURE__ */ F("div", { className: V(
|
|
2861
|
+
"relative overflow-hidden",
|
|
2862
|
+
a && "border border-gray-200 rounded",
|
|
2863
|
+
S
|
|
2864
|
+
), children: [
|
|
2865
|
+
v && /* @__PURE__ */ h("div", { className: "absolute inset-0 bg-white/60 flex items-center justify-center z-10", children: /* @__PURE__ */ h("div", { className: "w-8 h-8 border-2 border-gray-200 border-t-primary rounded-full animate-spin" }) }),
|
|
2866
|
+
/* @__PURE__ */ h(
|
|
2548
2867
|
"div",
|
|
2549
2868
|
{
|
|
2550
|
-
ref:
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
o ? wt() : Ct()
|
|
2869
|
+
ref: Y,
|
|
2870
|
+
style: s ? { height: s, overflow: "auto" } : { overflow: "auto" },
|
|
2871
|
+
children: /* @__PURE__ */ F("table", { className: "w-full border-collapse text-sm", children: [
|
|
2872
|
+
Ct(),
|
|
2873
|
+
s ? xt() : Rt()
|
|
2556
2874
|
] })
|
|
2557
2875
|
}
|
|
2558
2876
|
)
|
|
2559
2877
|
] });
|
|
2560
2878
|
}
|
|
2561
|
-
function
|
|
2879
|
+
function tr({
|
|
2562
2880
|
total: e,
|
|
2563
|
-
pageIndex:
|
|
2881
|
+
pageIndex: r,
|
|
2564
2882
|
pageSize: t,
|
|
2565
2883
|
pageSizes: n = [10, 20, 50, 100],
|
|
2566
|
-
onChange:
|
|
2567
|
-
onPageSizeChange:
|
|
2568
|
-
|
|
2884
|
+
onChange: i,
|
|
2885
|
+
onPageSizeChange: o,
|
|
2886
|
+
showSizeChanger: s = !1,
|
|
2887
|
+
showTotal: l = !0,
|
|
2888
|
+
className: a = ""
|
|
2569
2889
|
}) {
|
|
2570
2890
|
if (e <= 0) return null;
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2891
|
+
const u = Math.ceil(e / t), f = (g) => {
|
|
2892
|
+
o == null || o(g), i(1, g);
|
|
2893
|
+
}, m = l ? typeof l == "function" ? l(e) : `共 ${e} 条` : null, c = () => {
|
|
2894
|
+
const g = [];
|
|
2895
|
+
if (u <= 7)
|
|
2896
|
+
for (let p = 1; p <= u; p++) g.push(p);
|
|
2575
2897
|
else {
|
|
2576
|
-
|
|
2577
|
-
const
|
|
2578
|
-
for (let
|
|
2579
|
-
|
|
2898
|
+
g.push(1), r > 4 && g.push("ellipsis-left");
|
|
2899
|
+
const p = Math.max(2, r - 2), v = Math.min(u - 1, r + 2);
|
|
2900
|
+
for (let S = p; S <= v; S++) g.push(S);
|
|
2901
|
+
r < u - 3 && g.push("ellipsis-right"), g.push(u);
|
|
2580
2902
|
}
|
|
2581
|
-
return
|
|
2582
|
-
}
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2903
|
+
return g;
|
|
2904
|
+
}, d = V(
|
|
2905
|
+
"min-w-[30px] h-7 px-1.5 text-sm border border-gray-300 rounded bg-white text-gray-600",
|
|
2906
|
+
"cursor-pointer transition-all hover:text-primary hover:border-primary",
|
|
2907
|
+
"disabled:text-gray-300 disabled:cursor-not-allowed disabled:bg-gray-50"
|
|
2908
|
+
);
|
|
2909
|
+
return /* @__PURE__ */ F("div", { className: V("flex items-center gap-1.5 flex-wrap", a), children: [
|
|
2910
|
+
m && /* @__PURE__ */ h("span", { className: "text-sm text-gray-500 mr-1", children: m }),
|
|
2911
|
+
(s || o) && /* @__PURE__ */ h(
|
|
2590
2912
|
"select",
|
|
2591
2913
|
{
|
|
2592
2914
|
value: t,
|
|
2593
|
-
onChange: (
|
|
2594
|
-
className: "
|
|
2595
|
-
children: n.map((
|
|
2596
|
-
|
|
2915
|
+
onChange: (g) => f(Number(g.target.value)),
|
|
2916
|
+
className: "h-7 px-1.5 text-sm border border-gray-300 rounded bg-white text-gray-600 cursor-pointer focus:outline-none focus:border-primary",
|
|
2917
|
+
children: n.map((g) => /* @__PURE__ */ F("option", { value: g, children: [
|
|
2918
|
+
g,
|
|
2597
2919
|
"条/页"
|
|
2598
|
-
] },
|
|
2920
|
+
] }, g))
|
|
2599
2921
|
}
|
|
2600
2922
|
),
|
|
2601
|
-
/* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ F("div", { className: "flex items-center gap-1", children: [
|
|
2924
|
+
/* @__PURE__ */ h(
|
|
2603
2925
|
"button",
|
|
2604
2926
|
{
|
|
2605
|
-
className:
|
|
2606
|
-
disabled:
|
|
2607
|
-
onClick: () =>
|
|
2927
|
+
className: d,
|
|
2928
|
+
disabled: r <= 1,
|
|
2929
|
+
onClick: () => i(r - 1),
|
|
2608
2930
|
"aria-label": "上一页",
|
|
2609
2931
|
children: "‹"
|
|
2610
2932
|
}
|
|
2611
2933
|
),
|
|
2612
|
-
|
|
2613
|
-
(
|
|
2934
|
+
c().map(
|
|
2935
|
+
(g, p) => typeof g == "string" ? /* @__PURE__ */ h("span", { className: "min-w-[30px] h-7 flex items-center justify-center text-sm text-gray-400", children: "…" }, g + p) : /* @__PURE__ */ h(
|
|
2614
2936
|
"button",
|
|
2615
2937
|
{
|
|
2616
|
-
className:
|
|
2617
|
-
|
|
2618
|
-
|
|
2938
|
+
className: V(
|
|
2939
|
+
d,
|
|
2940
|
+
// 激活页码使用 primary 工具类,不硬编码颜色
|
|
2941
|
+
g === r && "bg-primary text-white border-primary hover:text-white"
|
|
2942
|
+
),
|
|
2943
|
+
onClick: () => i(g),
|
|
2944
|
+
children: g
|
|
2619
2945
|
},
|
|
2620
|
-
|
|
2946
|
+
g
|
|
2621
2947
|
)
|
|
2622
2948
|
),
|
|
2623
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ h(
|
|
2624
2950
|
"button",
|
|
2625
2951
|
{
|
|
2626
|
-
className:
|
|
2627
|
-
disabled:
|
|
2628
|
-
onClick: () =>
|
|
2952
|
+
className: d,
|
|
2953
|
+
disabled: r >= u,
|
|
2954
|
+
onClick: () => i(r + 1),
|
|
2629
2955
|
"aria-label": "下一页",
|
|
2630
2956
|
children: "›"
|
|
2631
2957
|
}
|
|
@@ -2633,469 +2959,167 @@ function Qn({
|
|
|
2633
2959
|
] })
|
|
2634
2960
|
] });
|
|
2635
2961
|
}
|
|
2636
|
-
function
|
|
2637
|
-
actions: e,
|
|
2638
|
-
search: i,
|
|
2639
|
-
footer: t,
|
|
2640
|
-
children: n,
|
|
2641
|
-
className: o = "",
|
|
2642
|
-
noPadding: r = !1
|
|
2643
|
-
}) {
|
|
2644
|
-
return /* @__PURE__ */ _("div", { className: `em-grid ${o}`, children: [
|
|
2645
|
-
(e || i) && /* @__PURE__ */ _("div", { className: "em-grid-toolbar", style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px 12px", background: "#f8f8f8", borderBottom: "1px solid #e1e4eb", position: "relative" }, children: [
|
|
2646
|
-
e && /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: e }),
|
|
2647
|
-
i && /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: i })
|
|
2648
|
-
] }),
|
|
2649
|
-
/* @__PURE__ */ f("div", { className: "em-grid-body", style: { padding: r ? 0 : "12px" }, children: n }),
|
|
2650
|
-
t && /* @__PURE__ */ f("div", { className: "em-grid-footer", style: { padding: "8px 12px", textAlign: "center", borderTop: "1px solid #e1e4eb", background: "#f6f6f6", fontSize: "14px", color: "#6b7280" }, children: t })
|
|
2651
|
-
] });
|
|
2652
|
-
}
|
|
2653
|
-
function pt(e) {
|
|
2654
|
-
var i, t, n = "";
|
|
2655
|
-
if (typeof e == "string" || typeof e == "number") n += e;
|
|
2656
|
-
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
2657
|
-
var o = e.length;
|
|
2658
|
-
for (i = 0; i < o; i++) e[i] && (t = pt(e[i])) && (n && (n += " "), n += t);
|
|
2659
|
-
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
2660
|
-
return n;
|
|
2661
|
-
}
|
|
2662
|
-
function An() {
|
|
2663
|
-
for (var e, i, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (i = pt(e)) && (n && (n += " "), n += i);
|
|
2664
|
-
return n;
|
|
2665
|
-
}
|
|
2666
|
-
function Dn(...e) {
|
|
2667
|
-
return An(e);
|
|
2668
|
-
}
|
|
2669
|
-
const Hn = {
|
|
2670
|
-
default: "#d2d6de",
|
|
2671
|
-
primary: "#3c8dbc",
|
|
2672
|
-
info: "#00c0ef",
|
|
2673
|
-
danger: "#dd4b39",
|
|
2674
|
-
warning: "#f39c12",
|
|
2675
|
-
success: "#00a65a",
|
|
2676
|
-
simple: "transparent"
|
|
2677
|
-
};
|
|
2678
|
-
function Zn({
|
|
2679
|
-
theme: e = "default",
|
|
2680
|
-
title: i,
|
|
2681
|
-
showClose: t = !1,
|
|
2682
|
-
noPadding: n = !1,
|
|
2683
|
-
fixtop: o,
|
|
2684
|
-
bodyStyle: r = {},
|
|
2685
|
-
tabs: s = [],
|
|
2686
|
-
header: l,
|
|
2687
|
-
tools: a,
|
|
2688
|
-
breadcrumb: u,
|
|
2689
|
-
footer: g,
|
|
2690
|
-
children: m,
|
|
2691
|
-
onClose: c,
|
|
2692
|
-
onTabClick: d,
|
|
2693
|
-
className: p = ""
|
|
2694
|
-
}) {
|
|
2695
|
-
const h = i || l || a || t, w = { ...r };
|
|
2696
|
-
if (o && o > 0) {
|
|
2697
|
-
const S = typeof window < "u" ? window.innerHeight : 800;
|
|
2698
|
-
w.height = `${S - o}px`, w.overflow = "auto";
|
|
2699
|
-
}
|
|
2700
|
-
return /* @__PURE__ */ _("div", { className: Dn("box", p), style: {
|
|
2701
|
-
borderRadius: "2px",
|
|
2702
|
-
background: "#fff",
|
|
2703
|
-
borderTop: `3px solid ${Hn[e]}`,
|
|
2704
|
-
marginBottom: "10px",
|
|
2705
|
-
boxShadow: "0 1px 1px rgba(0,0,0,0.1)"
|
|
2706
|
-
}, children: [
|
|
2707
|
-
h && /* @__PURE__ */ _("div", { style: { borderBottom: "1px solid #f4f4f4", color: "#444", position: "relative" }, children: [
|
|
2708
|
-
i && /* @__PURE__ */ f("h3", { style: { fontSize: "18px", margin: 0, padding: "10px 0 10px 15px", lineHeight: 1, fontWeight: 600 }, dangerouslySetInnerHTML: { __html: i } }),
|
|
2709
|
-
s.map((S, v) => /* @__PURE__ */ f(
|
|
2710
|
-
"h3",
|
|
2711
|
-
{
|
|
2712
|
-
style: { cursor: "pointer", padding: "10px 12px", margin: 0, fontSize: "14px", fontWeight: 400, display: "inline-block", borderBottom: S.active ? "2px solid #3c8dbc" : "none" },
|
|
2713
|
-
onClick: () => d == null ? void 0 : d(S),
|
|
2714
|
-
dangerouslySetInnerHTML: { __html: S.title }
|
|
2715
|
-
},
|
|
2716
|
-
v
|
|
2717
|
-
)),
|
|
2718
|
-
l,
|
|
2719
|
-
(a || t) && /* @__PURE__ */ _("div", { style: { position: "absolute", right: "10px", top: 0 }, children: [
|
|
2720
|
-
a,
|
|
2721
|
-
t && /* @__PURE__ */ f("button", { onClick: c, style: { padding: "4px", marginRight: "4px", fontSize: "14px", background: "transparent", border: "none", color: "#97a0b3", cursor: "pointer" }, children: "✕" })
|
|
2722
|
-
] })
|
|
2723
|
-
] }),
|
|
2724
|
-
/* @__PURE__ */ f("div", { style: { padding: n ? 0 : "16px", ...w }, children: m }),
|
|
2725
|
-
g && /* @__PURE__ */ f("div", { style: { borderTop: "1px solid #f4f4f4", background: "#fff", padding: "8px", borderRadius: "0 0 2px 2px" }, children: g })
|
|
2726
|
-
] });
|
|
2727
|
-
}
|
|
2728
|
-
const Ln = {
|
|
2729
|
-
sm: "max-w-sm",
|
|
2730
|
-
md: "max-w-md",
|
|
2731
|
-
lg: "max-w-lg",
|
|
2732
|
-
xl: "max-w-xl"
|
|
2733
|
-
};
|
|
2734
|
-
function ei({
|
|
2735
|
-
open: e,
|
|
2736
|
-
onClose: i,
|
|
2737
|
-
title: t,
|
|
2738
|
-
children: n,
|
|
2739
|
-
footer: o,
|
|
2740
|
-
maskClosable: r = !0,
|
|
2741
|
-
size: s = "md",
|
|
2742
|
-
className: l = ""
|
|
2743
|
-
}) {
|
|
2744
|
-
return /* @__PURE__ */ f(G, { appear: !0, show: e, as: L, children: /* @__PURE__ */ _(U, { as: "div", className: "relative z-[9990]", onClose: r ? i : () => {
|
|
2745
|
-
}, children: [
|
|
2746
|
-
/* @__PURE__ */ f(
|
|
2747
|
-
G.Child,
|
|
2748
|
-
{
|
|
2749
|
-
as: L,
|
|
2750
|
-
enter: "ease-out duration-200",
|
|
2751
|
-
enterFrom: "opacity-0",
|
|
2752
|
-
enterTo: "opacity-100",
|
|
2753
|
-
leave: "ease-in duration-150",
|
|
2754
|
-
leaveFrom: "opacity-100",
|
|
2755
|
-
leaveTo: "opacity-0",
|
|
2756
|
-
children: /* @__PURE__ */ f("div", { className: "fixed inset-0 bg-black/50" })
|
|
2757
|
-
}
|
|
2758
|
-
),
|
|
2759
|
-
/* @__PURE__ */ f("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ f("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ f(
|
|
2760
|
-
G.Child,
|
|
2761
|
-
{
|
|
2762
|
-
as: L,
|
|
2763
|
-
enter: "ease-out duration-200",
|
|
2764
|
-
enterFrom: "opacity-0 scale-95",
|
|
2765
|
-
enterTo: "opacity-100 scale-100",
|
|
2766
|
-
leave: "ease-in duration-150",
|
|
2767
|
-
leaveFrom: "opacity-100 scale-100",
|
|
2768
|
-
leaveTo: "opacity-0 scale-95",
|
|
2769
|
-
children: /* @__PURE__ */ _(
|
|
2770
|
-
U.Panel,
|
|
2771
|
-
{
|
|
2772
|
-
className: `w-full ${Ln[s]} transform overflow-hidden rounded-lg bg-white shadow-xl transition-all ${l}`,
|
|
2773
|
-
children: [
|
|
2774
|
-
t && /* @__PURE__ */ _("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
2775
|
-
/* @__PURE__ */ f(U.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
2776
|
-
/* @__PURE__ */ f(
|
|
2777
|
-
"button",
|
|
2778
|
-
{
|
|
2779
|
-
onClick: i,
|
|
2780
|
-
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
2781
|
-
children: /* @__PURE__ */ f(nt, { size: 20 })
|
|
2782
|
-
}
|
|
2783
|
-
)
|
|
2784
|
-
] }),
|
|
2785
|
-
/* @__PURE__ */ f("div", { className: "px-6 py-4", children: n }),
|
|
2786
|
-
o && /* @__PURE__ */ f("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-end gap-3", children: o })
|
|
2787
|
-
]
|
|
2788
|
-
}
|
|
2789
|
-
)
|
|
2790
|
-
}
|
|
2791
|
-
) }) })
|
|
2792
|
-
] }) });
|
|
2793
|
-
}
|
|
2794
|
-
const Gn = {
|
|
2795
|
-
sm: "max-w-sm",
|
|
2796
|
-
md: "max-w-md",
|
|
2797
|
-
lg: "max-w-2xl",
|
|
2798
|
-
xl: "max-w-4xl",
|
|
2799
|
-
full: "max-w-full"
|
|
2800
|
-
};
|
|
2801
|
-
function ti({
|
|
2802
|
-
open: e,
|
|
2803
|
-
onClose: i,
|
|
2804
|
-
title: t,
|
|
2805
|
-
children: n,
|
|
2806
|
-
footer: o,
|
|
2807
|
-
size: r = "md",
|
|
2808
|
-
maskClosable: s = !0,
|
|
2809
|
-
className: l = ""
|
|
2810
|
-
}) {
|
|
2811
|
-
return /* @__PURE__ */ f(G, { appear: !0, show: e, as: L, children: /* @__PURE__ */ _(U, { as: "div", className: "relative z-[9990]", onClose: s ? i : () => {
|
|
2812
|
-
}, children: [
|
|
2813
|
-
/* @__PURE__ */ f(
|
|
2814
|
-
G.Child,
|
|
2815
|
-
{
|
|
2816
|
-
as: L,
|
|
2817
|
-
enter: "ease-out duration-300",
|
|
2818
|
-
enterFrom: "opacity-0",
|
|
2819
|
-
enterTo: "opacity-100",
|
|
2820
|
-
leave: "ease-in duration-200",
|
|
2821
|
-
leaveFrom: "opacity-100",
|
|
2822
|
-
leaveTo: "opacity-0",
|
|
2823
|
-
children: /* @__PURE__ */ f("div", { className: "fixed inset-0 bg-black/50" })
|
|
2824
|
-
}
|
|
2825
|
-
),
|
|
2826
|
-
/* @__PURE__ */ f("div", { className: "fixed inset-0 overflow-hidden", children: /* @__PURE__ */ f("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ f("div", { className: "pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10", children: /* @__PURE__ */ f(
|
|
2827
|
-
G.Child,
|
|
2828
|
-
{
|
|
2829
|
-
as: L,
|
|
2830
|
-
enter: "transform transition ease-out duration-300",
|
|
2831
|
-
enterFrom: "translate-x-full",
|
|
2832
|
-
enterTo: "translate-x-0",
|
|
2833
|
-
leave: "transform transition ease-in duration-200",
|
|
2834
|
-
leaveFrom: "translate-x-0",
|
|
2835
|
-
leaveTo: "translate-x-full",
|
|
2836
|
-
children: /* @__PURE__ */ f(
|
|
2837
|
-
U.Panel,
|
|
2838
|
-
{
|
|
2839
|
-
className: `pointer-events-auto w-screen ${Gn[r]} ${l}`,
|
|
2840
|
-
children: /* @__PURE__ */ _("div", { className: "flex h-full flex-col bg-white shadow-xl", children: [
|
|
2841
|
-
t && /* @__PURE__ */ _("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-200", children: [
|
|
2842
|
-
/* @__PURE__ */ f(U.Title, { as: "h3", className: "text-lg font-semibold text-gray-900", children: t }),
|
|
2843
|
-
/* @__PURE__ */ f(
|
|
2844
|
-
"button",
|
|
2845
|
-
{
|
|
2846
|
-
onClick: i,
|
|
2847
|
-
className: "p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600",
|
|
2848
|
-
children: /* @__PURE__ */ f(nt, { size: 20 })
|
|
2849
|
-
}
|
|
2850
|
-
)
|
|
2851
|
-
] }),
|
|
2852
|
-
/* @__PURE__ */ f("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: n }),
|
|
2853
|
-
o && /* @__PURE__ */ f("div", { className: "px-6 py-4 bg-gray-50 border-t border-gray-200 flex justify-center gap-3", children: o })
|
|
2854
|
-
] })
|
|
2855
|
-
}
|
|
2856
|
-
)
|
|
2857
|
-
}
|
|
2858
|
-
) }) }) })
|
|
2859
|
-
] }) });
|
|
2860
|
-
}
|
|
2861
|
-
const kn = et(
|
|
2862
|
-
({ variant: e = "default", size: i = "md", loading: t, children: n, className: o = "", disabled: r, icon: s, type: l = "button", ...a }, u) => {
|
|
2863
|
-
const g = "inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary", m = {
|
|
2864
|
-
primary: "bg-primary text-white hover:bg-primary/90 disabled:bg-primary/50",
|
|
2865
|
-
default: "bg-white text-gray-700 border border-gray-300 hover:bg-gray-50 disabled:bg-gray-50",
|
|
2866
|
-
danger: "bg-red-600 text-white hover:bg-red-700 disabled:bg-red-400",
|
|
2867
|
-
text: "text-primary hover:bg-primary/10 disabled:bg-transparent"
|
|
2868
|
-
}, c = {
|
|
2869
|
-
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
2870
|
-
md: "px-4 py-2 text-sm gap-2",
|
|
2871
|
-
lg: "px-6 py-3 text-base gap-2"
|
|
2872
|
-
};
|
|
2873
|
-
return /* @__PURE__ */ _(
|
|
2874
|
-
"button",
|
|
2875
|
-
{
|
|
2876
|
-
ref: u,
|
|
2877
|
-
type: l,
|
|
2878
|
-
className: `${g} ${m[e]} ${c[i]} ${o}`,
|
|
2879
|
-
disabled: r || t,
|
|
2880
|
-
...a,
|
|
2881
|
-
children: [
|
|
2882
|
-
t && /* @__PURE__ */ _("svg", { className: "animate-spin h-4 w-4", viewBox: "0 0 24 24", children: [
|
|
2883
|
-
/* @__PURE__ */ f("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", fill: "none" }),
|
|
2884
|
-
/* @__PURE__ */ f("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
2885
|
-
] }),
|
|
2886
|
-
s && /* @__PURE__ */ f("span", { className: "inline-flex", children: s }),
|
|
2887
|
-
n
|
|
2888
|
-
]
|
|
2889
|
-
}
|
|
2890
|
-
);
|
|
2891
|
-
}
|
|
2892
|
-
);
|
|
2893
|
-
kn.displayName = "EmButton";
|
|
2894
|
-
const Tn = et(
|
|
2895
|
-
({ label: e, error: i, prefix: t, suffix: n, className: o = "", allowClear: r, showCount: s, maxLength: l, value: a, onChange: u, onPressEnter: g, ...m }, c) => {
|
|
2896
|
-
const d = () => {
|
|
2897
|
-
u && u({ target: { value: "" } });
|
|
2898
|
-
};
|
|
2899
|
-
return /* @__PURE__ */ _("div", { className: "w-full", children: [
|
|
2900
|
-
e && /* @__PURE__ */ f("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: e }),
|
|
2901
|
-
/* @__PURE__ */ _("div", { className: "relative", children: [
|
|
2902
|
-
t && /* @__PURE__ */ f("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-gray-400", children: t }),
|
|
2903
|
-
/* @__PURE__ */ f(
|
|
2904
|
-
"input",
|
|
2905
|
-
{
|
|
2906
|
-
ref: c,
|
|
2907
|
-
value: a,
|
|
2908
|
-
maxLength: l,
|
|
2909
|
-
onChange: u,
|
|
2910
|
-
onKeyDown: (h) => {
|
|
2911
|
-
h.key === "Enter" && g && g();
|
|
2912
|
-
},
|
|
2913
|
-
className: `w-full px-3 py-2 text-sm border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${i ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${t ? "pl-10" : ""} ${n || r ? "pr-10" : ""} ${o}`,
|
|
2914
|
-
...m
|
|
2915
|
-
}
|
|
2916
|
-
),
|
|
2917
|
-
s && l && /* @__PURE__ */ _("div", { className: "absolute inset-y-0 right-3 flex items-center pointer-events-none text-gray-400 text-xs", children: [
|
|
2918
|
-
String(a || "").length,
|
|
2919
|
-
"/",
|
|
2920
|
-
l
|
|
2921
|
-
] }),
|
|
2922
|
-
r && a && /* @__PURE__ */ f(
|
|
2923
|
-
"button",
|
|
2924
|
-
{
|
|
2925
|
-
type: "button",
|
|
2926
|
-
onClick: d,
|
|
2927
|
-
className: "absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600",
|
|
2928
|
-
children: /* @__PURE__ */ f("span", { className: "text-xs", children: "×" })
|
|
2929
|
-
}
|
|
2930
|
-
),
|
|
2931
|
-
n && !r && /* @__PURE__ */ f("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none text-gray-400", children: n })
|
|
2932
|
-
] }),
|
|
2933
|
-
i && /* @__PURE__ */ f("p", { className: "mt-1 text-sm text-red-500", children: i })
|
|
2934
|
-
] });
|
|
2935
|
-
}
|
|
2936
|
-
);
|
|
2937
|
-
Tn.displayName = "EmInput";
|
|
2938
|
-
function ni(e) {
|
|
2962
|
+
function nr(e) {
|
|
2939
2963
|
const {
|
|
2940
|
-
label:
|
|
2964
|
+
label: r,
|
|
2941
2965
|
value: t,
|
|
2942
2966
|
options: n,
|
|
2943
|
-
onChange:
|
|
2944
|
-
placeholder:
|
|
2967
|
+
onChange: i,
|
|
2968
|
+
placeholder: o = "请选择",
|
|
2945
2969
|
error: s,
|
|
2946
2970
|
disabled: l,
|
|
2947
2971
|
className: a = "",
|
|
2948
2972
|
style: u,
|
|
2949
|
-
mode:
|
|
2973
|
+
mode: f
|
|
2950
2974
|
} = e;
|
|
2951
|
-
if (
|
|
2952
|
-
const
|
|
2953
|
-
|
|
2954
|
-
}, S = n.filter((
|
|
2955
|
-
return /* @__PURE__ */
|
|
2956
|
-
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
}, multiple: !0, disabled: l, children: /* @__PURE__ */
|
|
2959
|
-
/* @__PURE__ */
|
|
2975
|
+
if (f === "multiple") {
|
|
2976
|
+
const g = t || [], p = i, v = (w) => {
|
|
2977
|
+
g.includes(w) ? p(g.filter((_) => _ !== w)) : p([...g, w]);
|
|
2978
|
+
}, S = n.filter((w) => g.includes(w.value)).map((w) => w.label);
|
|
2979
|
+
return /* @__PURE__ */ F("div", { className: `w-full ${a}`, style: u, children: [
|
|
2980
|
+
r && /* @__PURE__ */ h("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: r }),
|
|
2981
|
+
/* @__PURE__ */ h("div", { className: "relative", children: /* @__PURE__ */ h(D, { value: g, onChange: () => {
|
|
2982
|
+
}, multiple: !0, disabled: l, children: /* @__PURE__ */ F("div", { className: "relative", children: [
|
|
2983
|
+
/* @__PURE__ */ F(
|
|
2960
2984
|
D.Button,
|
|
2961
2985
|
{
|
|
2962
2986
|
className: `relative w-full cursor-pointer rounded-md border text-left text-sm shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${s ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${l ? "bg-gray-100 cursor-not-allowed" : "bg-white hover:border-gray-400"}`,
|
|
2963
2987
|
children: [
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ h("span", { className: `block px-3 py-2 ${S.length ? "text-gray-900" : "text-gray-400"}`, children: S.length ? S.join("、") : o }),
|
|
2989
|
+
/* @__PURE__ */ h("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ h(Be, { size: 16, className: "text-gray-400" }) })
|
|
2966
2990
|
]
|
|
2967
2991
|
}
|
|
2968
2992
|
),
|
|
2969
|
-
/* @__PURE__ */
|
|
2970
|
-
|
|
2993
|
+
/* @__PURE__ */ h(
|
|
2994
|
+
L,
|
|
2971
2995
|
{
|
|
2972
|
-
as:
|
|
2996
|
+
as: G,
|
|
2973
2997
|
leave: "transition ease-in duration-100",
|
|
2974
2998
|
leaveFrom: "opacity-100",
|
|
2975
2999
|
leaveTo: "opacity-0",
|
|
2976
|
-
children: /* @__PURE__ */
|
|
2977
|
-
const
|
|
2978
|
-
return /* @__PURE__ */
|
|
3000
|
+
children: /* @__PURE__ */ h(D.Options, { className: "absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black/5 focus:outline-none", children: n.map((w) => {
|
|
3001
|
+
const _ = g.includes(w.value);
|
|
3002
|
+
return /* @__PURE__ */ F(
|
|
2979
3003
|
D.Option,
|
|
2980
3004
|
{
|
|
2981
|
-
value:
|
|
2982
|
-
disabled:
|
|
2983
|
-
onClick: () => w
|
|
2984
|
-
className: ({ active: $ }) => `relative cursor-pointer select-none py-2 pl-10 pr-4 ${$ ? "bg-primary/10 text-primary" : "text-gray-900"} ${
|
|
3005
|
+
value: w.value,
|
|
3006
|
+
disabled: w.disabled,
|
|
3007
|
+
onClick: () => v(w.value),
|
|
3008
|
+
className: ({ active: $ }) => `relative cursor-pointer select-none py-2 pl-10 pr-4 ${$ ? "bg-primary/10 text-primary" : "text-gray-900"} ${w.disabled ? "cursor-not-allowed opacity-50" : ""} ${_ ? "bg-primary/5 font-medium" : ""}`,
|
|
2985
3009
|
children: [
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
-
|
|
3010
|
+
/* @__PURE__ */ h("span", { className: `block truncate ${_ ? "font-medium" : "font-normal"}`, children: w.label }),
|
|
3011
|
+
_ && /* @__PURE__ */ h("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-primary", children: /* @__PURE__ */ h(je, { size: 16 }) })
|
|
2988
3012
|
]
|
|
2989
3013
|
},
|
|
2990
|
-
|
|
3014
|
+
w.value
|
|
2991
3015
|
);
|
|
2992
3016
|
}) })
|
|
2993
3017
|
}
|
|
2994
3018
|
)
|
|
2995
3019
|
] }) }) }),
|
|
2996
|
-
s && /* @__PURE__ */
|
|
3020
|
+
s && /* @__PURE__ */ h("p", { className: "mt-1 text-sm text-red-500", children: s })
|
|
2997
3021
|
] });
|
|
2998
3022
|
}
|
|
2999
|
-
const m = t, c =
|
|
3000
|
-
return /* @__PURE__ */
|
|
3001
|
-
|
|
3002
|
-
/* @__PURE__ */
|
|
3003
|
-
/* @__PURE__ */
|
|
3023
|
+
const m = t, c = i, d = n.find((g) => g.value === m);
|
|
3024
|
+
return /* @__PURE__ */ F("div", { className: `w-full ${a}`, style: u, children: [
|
|
3025
|
+
r && /* @__PURE__ */ h("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: r }),
|
|
3026
|
+
/* @__PURE__ */ h(D, { value: m, onChange: c, disabled: l, children: /* @__PURE__ */ F("div", { className: "relative", children: [
|
|
3027
|
+
/* @__PURE__ */ F(
|
|
3004
3028
|
D.Button,
|
|
3005
3029
|
{
|
|
3006
3030
|
className: `relative w-full cursor-pointer rounded-md border text-left text-sm shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-primary/50 ${s ? "border-red-500 focus:border-red-500" : "border-gray-300 focus:border-primary"} ${l ? "bg-gray-100 cursor-not-allowed" : "bg-white hover:border-gray-400"}`,
|
|
3007
3031
|
children: [
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ h("span", { className: `block px-3 py-2 ${d ? "text-gray-900" : "text-gray-400"}`, children: (d == null ? void 0 : d.label) || o }),
|
|
3033
|
+
/* @__PURE__ */ h("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ h(Be, { size: 16, className: "text-gray-400" }) })
|
|
3010
3034
|
]
|
|
3011
3035
|
}
|
|
3012
3036
|
),
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
|
|
3037
|
+
/* @__PURE__ */ h(
|
|
3038
|
+
L,
|
|
3015
3039
|
{
|
|
3016
|
-
as:
|
|
3040
|
+
as: G,
|
|
3017
3041
|
leave: "transition ease-in duration-100",
|
|
3018
3042
|
leaveFrom: "opacity-100",
|
|
3019
3043
|
leaveTo: "opacity-0",
|
|
3020
|
-
children: /* @__PURE__ */
|
|
3044
|
+
children: /* @__PURE__ */ h(D.Options, { className: "absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-sm shadow-lg ring-1 ring-black/5 focus:outline-none", children: n.map((g) => /* @__PURE__ */ h(
|
|
3021
3045
|
D.Option,
|
|
3022
3046
|
{
|
|
3023
|
-
value:
|
|
3024
|
-
disabled:
|
|
3025
|
-
className: ({ active:
|
|
3026
|
-
children: ({ selected:
|
|
3027
|
-
/* @__PURE__ */
|
|
3028
|
-
|
|
3047
|
+
value: g.value,
|
|
3048
|
+
disabled: g.disabled,
|
|
3049
|
+
className: ({ active: p, selected: v }) => `relative cursor-pointer select-none py-2 pl-10 pr-4 ${p ? "bg-primary/10 text-primary" : "text-gray-900"} ${g.disabled ? "cursor-not-allowed opacity-50" : ""} ${v ? "bg-primary/5 font-medium" : ""}`,
|
|
3050
|
+
children: ({ selected: p }) => /* @__PURE__ */ F(tt, { children: [
|
|
3051
|
+
/* @__PURE__ */ h("span", { className: `block truncate ${p ? "font-medium" : "font-normal"}`, children: g.label }),
|
|
3052
|
+
p && /* @__PURE__ */ h("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-primary", children: /* @__PURE__ */ h(je, { size: 16 }) })
|
|
3029
3053
|
] })
|
|
3030
3054
|
},
|
|
3031
|
-
|
|
3055
|
+
g.value
|
|
3032
3056
|
)) })
|
|
3033
3057
|
}
|
|
3034
3058
|
)
|
|
3035
3059
|
] }) }),
|
|
3036
|
-
s && /* @__PURE__ */
|
|
3060
|
+
s && /* @__PURE__ */ h("p", { className: "mt-1 text-sm text-red-500", children: s })
|
|
3037
3061
|
] });
|
|
3038
3062
|
}
|
|
3039
|
-
function
|
|
3063
|
+
function rr({ size: e = "md", className: r, text: t }) {
|
|
3040
3064
|
const n = {
|
|
3041
3065
|
sm: "w-4 h-4 border-2",
|
|
3042
3066
|
md: "w-8 h-8 border-3",
|
|
3043
3067
|
lg: "w-12 h-12 border-4"
|
|
3044
3068
|
};
|
|
3045
|
-
return /* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ F("div", { className: `flex flex-col items-center justify-center gap-2 ${r || ""}`, children: [
|
|
3070
|
+
/* @__PURE__ */ h(
|
|
3047
3071
|
"div",
|
|
3048
3072
|
{
|
|
3049
3073
|
className: `animate-spin rounded-full border-primary border-t-transparent ${n[e]}`
|
|
3050
3074
|
}
|
|
3051
3075
|
),
|
|
3052
|
-
t && /* @__PURE__ */
|
|
3076
|
+
t && /* @__PURE__ */ h("p", { className: "text-sm text-gray-600", children: t })
|
|
3053
3077
|
] });
|
|
3054
3078
|
}
|
|
3055
|
-
let
|
|
3056
|
-
function
|
|
3057
|
-
|
|
3079
|
+
let te = [], Bn = 0, ge = [];
|
|
3080
|
+
function Ze() {
|
|
3081
|
+
ge.forEach((e) => e([...te]));
|
|
3058
3082
|
}
|
|
3059
|
-
function T(e,
|
|
3083
|
+
function T(e, r = "info", t = 3e3) {
|
|
3060
3084
|
const n = Bn++;
|
|
3061
|
-
return
|
|
3062
|
-
|
|
3085
|
+
return te = [...te, { id: n, message: e, type: r, duration: t }], Ze(), t > 0 && setTimeout(() => {
|
|
3086
|
+
te = te.filter((i) => i.id !== n), Ze();
|
|
3063
3087
|
}, t), n;
|
|
3064
3088
|
}
|
|
3065
|
-
T.success = (e,
|
|
3066
|
-
T.error = (e,
|
|
3067
|
-
T.warning = (e,
|
|
3068
|
-
T.info = (e,
|
|
3089
|
+
T.success = (e, r) => T(e, "success", r);
|
|
3090
|
+
T.error = (e, r) => T(e, "error", r ?? 5e3);
|
|
3091
|
+
T.warning = (e, r) => T(e, "warning", r);
|
|
3092
|
+
T.info = (e, r) => T(e, "info", r);
|
|
3069
3093
|
const jn = {
|
|
3070
|
-
success:
|
|
3071
|
-
error:
|
|
3072
|
-
warning:
|
|
3073
|
-
info:
|
|
3074
|
-
},
|
|
3094
|
+
success: Et,
|
|
3095
|
+
error: It,
|
|
3096
|
+
warning: rt,
|
|
3097
|
+
info: $t
|
|
3098
|
+
}, et = {
|
|
3075
3099
|
success: "#2b9b6a",
|
|
3076
3100
|
error: "#f56c6c",
|
|
3077
3101
|
warning: "#e6a23c",
|
|
3078
3102
|
info: "#909399"
|
|
3079
3103
|
};
|
|
3080
|
-
function
|
|
3081
|
-
const [e,
|
|
3082
|
-
return
|
|
3083
|
-
|
|
3084
|
-
}), []), e.length === 0 ? null :
|
|
3085
|
-
/* @__PURE__ */
|
|
3104
|
+
function ir() {
|
|
3105
|
+
const [e, r] = X([]);
|
|
3106
|
+
return pe(() => (ge.push(r), () => {
|
|
3107
|
+
ge = ge.filter((t) => t !== r);
|
|
3108
|
+
}), []), e.length === 0 ? null : it(
|
|
3109
|
+
/* @__PURE__ */ h("div", { className: "fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-2 pointer-events-none", children: e.map((t) => {
|
|
3086
3110
|
const n = jn[t.type];
|
|
3087
|
-
return /* @__PURE__ */
|
|
3111
|
+
return /* @__PURE__ */ F(
|
|
3088
3112
|
"div",
|
|
3089
3113
|
{
|
|
3090
3114
|
className: "pointer-events-auto px-5 py-3 rounded-lg shadow-lg flex items-center gap-2 text-sm animate-slide-down bg-white border",
|
|
3091
3115
|
style: {
|
|
3092
|
-
borderColor: `${
|
|
3116
|
+
borderColor: `${et[t.type]}20`,
|
|
3093
3117
|
color: "#303133",
|
|
3094
3118
|
minWidth: "200px"
|
|
3095
3119
|
},
|
|
3096
3120
|
children: [
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3121
|
+
/* @__PURE__ */ h(n, { size: 18, style: { color: et[t.type] } }),
|
|
3122
|
+
/* @__PURE__ */ h("span", { children: t.message })
|
|
3099
3123
|
]
|
|
3100
3124
|
},
|
|
3101
3125
|
t.id
|
|
@@ -3104,45 +3128,45 @@ function oi() {
|
|
|
3104
3128
|
document.body
|
|
3105
3129
|
);
|
|
3106
3130
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return e ?
|
|
3109
|
-
/* @__PURE__ */
|
|
3110
|
-
/* @__PURE__ */
|
|
3131
|
+
function mt({ open: e, onClose: r, children: t, maskClosable: n = !0 }) {
|
|
3132
|
+
return e ? it(
|
|
3133
|
+
/* @__PURE__ */ F("div", { className: "fixed inset-0 z-[9990] flex items-center justify-center", children: [
|
|
3134
|
+
/* @__PURE__ */ h(
|
|
3111
3135
|
"div",
|
|
3112
3136
|
{
|
|
3113
3137
|
className: "absolute inset-0 bg-black/50 transition-opacity",
|
|
3114
|
-
onClick: n ?
|
|
3138
|
+
onClick: n ? r : void 0
|
|
3115
3139
|
}
|
|
3116
3140
|
),
|
|
3117
|
-
/* @__PURE__ */
|
|
3141
|
+
/* @__PURE__ */ h("div", { className: "relative bg-white rounded-lg shadow-xl max-w-[420px] w-[90%] animate-scale-in", children: t })
|
|
3118
3142
|
] }),
|
|
3119
3143
|
document.body
|
|
3120
3144
|
) : null;
|
|
3121
3145
|
}
|
|
3122
|
-
let
|
|
3123
|
-
function
|
|
3124
|
-
|
|
3146
|
+
let ne = null, he = null, ce = [];
|
|
3147
|
+
function St() {
|
|
3148
|
+
ce.forEach((e) => e(he ? { ...he } : null));
|
|
3125
3149
|
}
|
|
3126
|
-
function
|
|
3150
|
+
function Q(e, r, t) {
|
|
3127
3151
|
return new Promise((n) => {
|
|
3128
|
-
|
|
3152
|
+
ne = n, he = { message: e, title: r || "提示", type: t || "info", confirmText: "确定" }, St();
|
|
3129
3153
|
});
|
|
3130
3154
|
}
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
function
|
|
3135
|
-
const [e,
|
|
3136
|
-
|
|
3137
|
-
|
|
3155
|
+
Q.success = (e, r) => Q(e, r, "success");
|
|
3156
|
+
Q.error = (e, r) => Q(e, r, "error");
|
|
3157
|
+
Q.warning = (e, r) => Q(e, r, "warning");
|
|
3158
|
+
function or() {
|
|
3159
|
+
const [e, r] = X(null);
|
|
3160
|
+
pe(() => (ce.push(r), () => {
|
|
3161
|
+
ce = ce.filter((n) => n !== r);
|
|
3138
3162
|
}), []);
|
|
3139
|
-
const t =
|
|
3140
|
-
|
|
3163
|
+
const t = J(() => {
|
|
3164
|
+
he = null, St(), ne == null || ne(), ne = null;
|
|
3141
3165
|
}, []);
|
|
3142
|
-
return /* @__PURE__ */
|
|
3143
|
-
/* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3166
|
+
return /* @__PURE__ */ h(mt, { open: !!e, onClose: t, maskClosable: !1, children: e && /* @__PURE__ */ F("div", { className: "p-6", children: [
|
|
3167
|
+
/* @__PURE__ */ h("h3", { className: "text-base font-semibold text-gray-900 mb-2", children: e.title }),
|
|
3168
|
+
/* @__PURE__ */ h("p", { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-wrap", children: e.message }),
|
|
3169
|
+
/* @__PURE__ */ h("div", { className: "flex justify-end mt-5", children: /* @__PURE__ */ h(
|
|
3146
3170
|
"button",
|
|
3147
3171
|
{
|
|
3148
3172
|
onClick: t,
|
|
@@ -3152,34 +3176,34 @@ function ri() {
|
|
|
3152
3176
|
) })
|
|
3153
3177
|
] }) });
|
|
3154
3178
|
}
|
|
3155
|
-
let
|
|
3156
|
-
function
|
|
3157
|
-
|
|
3179
|
+
let N = null, ie = null, fe = [];
|
|
3180
|
+
function ze() {
|
|
3181
|
+
fe.forEach((e) => e(ie ? { ...ie } : null));
|
|
3158
3182
|
}
|
|
3159
|
-
function
|
|
3183
|
+
function sr(e, r, t) {
|
|
3160
3184
|
return new Promise((n) => {
|
|
3161
|
-
|
|
3185
|
+
N = n, ie = {
|
|
3162
3186
|
message: e,
|
|
3163
|
-
title:
|
|
3187
|
+
title: r || "确认操作",
|
|
3164
3188
|
type: t || "warning",
|
|
3165
3189
|
confirmText: "确定",
|
|
3166
3190
|
cancelText: "取消"
|
|
3167
|
-
},
|
|
3191
|
+
}, ze();
|
|
3168
3192
|
});
|
|
3169
3193
|
}
|
|
3170
|
-
function
|
|
3171
|
-
const [e,
|
|
3172
|
-
|
|
3173
|
-
|
|
3194
|
+
function lr() {
|
|
3195
|
+
const [e, r] = X(null);
|
|
3196
|
+
pe(() => (fe.push(r), () => {
|
|
3197
|
+
fe = fe.filter((o) => o !== r);
|
|
3174
3198
|
}), []);
|
|
3175
|
-
const t =
|
|
3176
|
-
|
|
3177
|
-
}, []), n =
|
|
3178
|
-
|
|
3199
|
+
const t = J(() => {
|
|
3200
|
+
ie = null, ze(), N == null || N(!0), N = null;
|
|
3201
|
+
}, []), n = J(() => {
|
|
3202
|
+
ie = null, ze(), N == null || N(!1), N = null;
|
|
3179
3203
|
}, []);
|
|
3180
|
-
return /* @__PURE__ */
|
|
3181
|
-
/* @__PURE__ */
|
|
3182
|
-
/* @__PURE__ */
|
|
3204
|
+
return /* @__PURE__ */ h(mt, { open: !!e, onClose: n, children: e && /* @__PURE__ */ F("div", { className: "p-6", children: [
|
|
3205
|
+
/* @__PURE__ */ F("h3", { className: "text-base font-semibold text-gray-900 mb-2 flex items-center gap-2", children: [
|
|
3206
|
+
/* @__PURE__ */ h(rt, { size: 18, style: { color: {
|
|
3183
3207
|
info: "#909399",
|
|
3184
3208
|
success: "#2b9b6a",
|
|
3185
3209
|
warning: "#e6a23c",
|
|
@@ -3187,9 +3211,9 @@ function li() {
|
|
|
3187
3211
|
}[e.type || "warning"] } }),
|
|
3188
3212
|
e.title
|
|
3189
3213
|
] }),
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3214
|
+
/* @__PURE__ */ h("p", { className: "text-sm text-gray-600 leading-relaxed whitespace-pre-wrap ml-6", children: e.message }),
|
|
3215
|
+
/* @__PURE__ */ F("div", { className: "flex justify-end gap-3 mt-5", children: [
|
|
3216
|
+
/* @__PURE__ */ h(
|
|
3193
3217
|
"button",
|
|
3194
3218
|
{
|
|
3195
3219
|
onClick: n,
|
|
@@ -3197,7 +3221,7 @@ function li() {
|
|
|
3197
3221
|
children: e.cancelText
|
|
3198
3222
|
}
|
|
3199
3223
|
),
|
|
3200
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ h(
|
|
3201
3225
|
"button",
|
|
3202
3226
|
{
|
|
3203
3227
|
onClick: t,
|
|
@@ -3209,22 +3233,20 @@ function li() {
|
|
|
3209
3233
|
] }) });
|
|
3210
3234
|
}
|
|
3211
3235
|
export {
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
Yn as
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
Dn as cn,
|
|
3227
|
-
si as confirm,
|
|
3236
|
+
or as AlertContainer,
|
|
3237
|
+
lr as ConfirmContainer,
|
|
3238
|
+
Jn as EmBox,
|
|
3239
|
+
Zn as EmDrawer,
|
|
3240
|
+
Qn as EmGrid,
|
|
3241
|
+
Yn as EmModal,
|
|
3242
|
+
tr as EmPagination,
|
|
3243
|
+
nr as EmSelect,
|
|
3244
|
+
er as EmTable,
|
|
3245
|
+
rr as Loading,
|
|
3246
|
+
ir as ToastContainer,
|
|
3247
|
+
Q as alert,
|
|
3248
|
+
V as cn,
|
|
3249
|
+
sr as confirm,
|
|
3228
3250
|
T as toast
|
|
3229
3251
|
};
|
|
3230
3252
|
//# sourceMappingURL=station-ui.js.map
|