@scbt-ecom/ui 0.46.5 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-CmLWueZd.js → index-jk9y4fVq.js} +6 -4
- package/dist/{index-CmLWueZd.js.map → index-jk9y4fVq.js.map} +1 -1
- package/dist/shared/ui/index.d.ts +2 -0
- package/dist/shared/ui/pagination/Pagination.d.ts +38 -0
- package/dist/shared/ui/pagination/index.d.ts +1 -0
- package/dist/shared/ui/table/Desktop.d.ts +7 -0
- package/dist/shared/ui/table/Mobile.d.ts +5 -0
- package/dist/shared/ui/table/Table.d.ts +2 -0
- package/dist/shared/ui/table/TablePagination.d.ts +16 -0
- package/dist/shared/ui/table/index.d.ts +3 -0
- package/dist/shared/ui/table/model/TableUtils.d.ts +13 -0
- package/dist/shared/ui/table/model/index.d.ts +2 -0
- package/dist/shared/ui/table/model/types.d.ts +59 -0
- package/dist/shared/ui/table/ui/dataTableColumnHeader/DataTableColumnHeader.d.ts +16 -0
- package/dist/shared/ui/table/ui/dataTableColumnHeader/index.d.ts +1 -0
- package/dist/shared/ui/table/ui/index.d.ts +2 -0
- package/dist/shared/ui/table/ui/primitives/Primitives.d.ts +8 -0
- package/dist/shared/ui/table/ui/primitives/index.d.ts +1 -0
- package/dist/shared/utils/typeGuards.d.ts +1 -0
- package/dist/{typeGuards-CSJS99k6.js → typeGuards-BigW-JS1.js} +4 -1
- package/dist/{typeGuards-CSJS99k6.js.map → typeGuards-BigW-JS1.js.map} +1 -1
- package/dist/ui.js +2518 -225
- package/dist/ui.js.map +1 -1
- package/dist/{utils-BAQ59khV.js → utils-Od0KoTas.js} +2 -2
- package/dist/{utils-BAQ59khV.js.map → utils-Od0KoTas.js.map} +1 -1
- package/dist/utils.js +1 -1
- package/dist/validation.js +2 -2
- package/dist/widget.js +2 -2
- package/package.json +2 -1
package/dist/ui.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { d as
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { c as
|
|
6
|
-
import { D as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
|
|
1
|
+
import { j as p, c as We, R as Ye, B as E, u as Je, f as Qe, g as Ze, h as et, i as k, k as ve, l as tt, m as nt, n as U, o as ot, A as rt, H as it, I as N, p as lt, q as me, D as ut, V as st, O as at } from "./index-jk9y4fVq.js";
|
|
2
|
+
import { d as Kn, r as Xn, e as Wn, C as Yn, s as Jn, K as Qn, L as Zn, N as eo, P as to, a as no, S as oo, t as ro, U as io, b as lo } from "./index-jk9y4fVq.js";
|
|
3
|
+
import * as P from "react";
|
|
4
|
+
import { forwardRef as D, useState as he, useEffect as gt } from "react";
|
|
5
|
+
import { c as w, T as Se } from "./typeGuards-BigW-JS1.js";
|
|
6
|
+
import { D as so, d as ao, f as go, b as co, a as fo } from "./utils-Od0KoTas.js";
|
|
7
|
+
import { createPortal as dt } from "react-dom";
|
|
8
|
+
import { a as xe } from "./useDebounce-QgEEiWs9.js";
|
|
9
|
+
const ct = We(
|
|
9
10
|
"group flex items-center justify-center cursor-pointer rounded-full outline-offset-[3px] outline-transparent outline-2 transition duration-12 active:scale-[0.97] disabled:pointer-events-none",
|
|
10
11
|
{
|
|
11
12
|
variants: {
|
|
@@ -25,143 +26,143 @@ const Z = B(
|
|
|
25
26
|
size: "lg"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
),
|
|
29
|
-
({ size:
|
|
30
|
-
),
|
|
31
|
-
|
|
29
|
+
), An = D(
|
|
30
|
+
({ size: e, intent: o, children: t, classes: n, type: r = "button", ...i }, l) => /* @__PURE__ */ p.jsx("button", { ref: l, type: r, className: w(ct({ intent: o, size: e }), n == null ? void 0 : n.button), ...i, children: /* @__PURE__ */ p.jsx("span", { className: w(n == null ? void 0 : n.icon), children: t }) })
|
|
31
|
+
), Hn = ({ className: e }) => /* @__PURE__ */ p.jsx("div", { className: w("skeleton-apply h-full w-full", e) }), Gn = ({ isVisible: e, classes: o, children: t, buttonProps: n }) => /* @__PURE__ */ p.jsxs(
|
|
32
|
+
Ye,
|
|
32
33
|
{
|
|
33
|
-
className:
|
|
34
|
+
className: w(
|
|
34
35
|
"fixed bottom-0 left-1/2 z-[60] w-full max-w-[604px] -translate-x-1/2 translate-y-0 rounded-t-lg bg-color-white px-6 py-4 shadow-[0px_-6px_8px_0px_#2929290A] transition-transform duration-1000 desktop:hidden",
|
|
35
|
-
{ "translate-y-[100%]": !
|
|
36
|
-
|
|
36
|
+
{ "translate-y-[100%]": !e },
|
|
37
|
+
o == null ? void 0 : o.root
|
|
37
38
|
),
|
|
38
39
|
children: [
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
t,
|
|
41
|
+
/* @__PURE__ */ p.jsx(E, { size: "lg", className: w("m-auto w-full", o == null ? void 0 : o.button), ...n, children: "Оформить заявку" })
|
|
41
42
|
]
|
|
42
43
|
}
|
|
43
|
-
),
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
), jn = ({ topContent: e, bottomContent: o, progress: t, maxPercent: n = 100, classes: r }) => /* @__PURE__ */ p.jsxs("div", { className: w("flex w-full flex-col", r == null ? void 0 : r.root), children: [
|
|
45
|
+
e && /* @__PURE__ */ p.jsx("div", { className: w("mb-2 flex justify-between gap-5", r == null ? void 0 : r.topContent), children: e }),
|
|
46
|
+
/* @__PURE__ */ p.jsxs("div", { className: w("relative h-2 w-[328xp] rounded-md bg-color-blue-grey-100 desktop:w-[524px]", r == null ? void 0 : r.progressBar), children: [
|
|
47
|
+
/* @__PURE__ */ p.jsx(
|
|
47
48
|
"div",
|
|
48
49
|
{
|
|
49
|
-
style: { width: `${
|
|
50
|
-
className:
|
|
50
|
+
style: { width: `${t}%` },
|
|
51
|
+
className: w("relative z-10 h-2 rounded-md bg-color-positive transition-all", r == null ? void 0 : r.progress)
|
|
51
52
|
}
|
|
52
53
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ p.jsx(
|
|
54
55
|
"span",
|
|
55
56
|
{
|
|
56
|
-
style: { maxWidth: `${
|
|
57
|
-
className:
|
|
57
|
+
style: { maxWidth: `${n}%` },
|
|
58
|
+
className: w(
|
|
58
59
|
"progressBar-apply z-1 absolute top-1/2 h-full w-full -translate-y-1/2 animate-progress-loader rounded-md",
|
|
59
|
-
|
|
60
|
+
r == null ? void 0 : r.loader
|
|
60
61
|
)
|
|
61
62
|
}
|
|
62
63
|
)
|
|
63
64
|
] }),
|
|
64
|
-
|
|
65
|
+
o && /* @__PURE__ */ p.jsx("div", { className: w("mt-2 flex justify-between gap-5", r == null ? void 0 : r.bottomContent), children: o })
|
|
65
66
|
] });
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
]),
|
|
69
|
-
(
|
|
67
|
+
var le = "Tabs", [ft, Ln] = Ze(le, [
|
|
68
|
+
ve
|
|
69
|
+
]), _e = ve(), [pt, ue] = ft(le), Fe = P.forwardRef(
|
|
70
|
+
(e, o) => {
|
|
70
71
|
const {
|
|
71
|
-
__scopeTabs:
|
|
72
|
-
value:
|
|
73
|
-
onValueChange:
|
|
74
|
-
defaultValue:
|
|
75
|
-
orientation:
|
|
72
|
+
__scopeTabs: t,
|
|
73
|
+
value: n,
|
|
74
|
+
onValueChange: r,
|
|
75
|
+
defaultValue: i,
|
|
76
|
+
orientation: l = "horizontal",
|
|
76
77
|
dir: u,
|
|
77
|
-
activationMode:
|
|
78
|
-
...
|
|
79
|
-
} =
|
|
80
|
-
prop:
|
|
81
|
-
onChange:
|
|
82
|
-
defaultProp:
|
|
78
|
+
activationMode: s = "automatic",
|
|
79
|
+
...g
|
|
80
|
+
} = e, d = Je(u), [f, c] = Qe({
|
|
81
|
+
prop: n,
|
|
82
|
+
onChange: r,
|
|
83
|
+
defaultProp: i
|
|
83
84
|
});
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
85
|
+
return /* @__PURE__ */ p.jsx(
|
|
86
|
+
pt,
|
|
86
87
|
{
|
|
87
|
-
scope:
|
|
88
|
-
baseId:
|
|
89
|
-
value:
|
|
90
|
-
onValueChange:
|
|
91
|
-
orientation:
|
|
92
|
-
dir:
|
|
93
|
-
activationMode:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
88
|
+
scope: t,
|
|
89
|
+
baseId: et(),
|
|
90
|
+
value: f,
|
|
91
|
+
onValueChange: c,
|
|
92
|
+
orientation: l,
|
|
93
|
+
dir: d,
|
|
94
|
+
activationMode: s,
|
|
95
|
+
children: /* @__PURE__ */ p.jsx(
|
|
96
|
+
k.div,
|
|
96
97
|
{
|
|
97
|
-
dir:
|
|
98
|
-
"data-orientation":
|
|
99
|
-
...
|
|
100
|
-
ref:
|
|
98
|
+
dir: d,
|
|
99
|
+
"data-orientation": l,
|
|
100
|
+
...g,
|
|
101
|
+
ref: o
|
|
101
102
|
}
|
|
102
103
|
)
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
107
|
);
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
(
|
|
110
|
-
const { __scopeTabs:
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
|
|
108
|
+
Fe.displayName = le;
|
|
109
|
+
var ye = "TabsList", $e = P.forwardRef(
|
|
110
|
+
(e, o) => {
|
|
111
|
+
const { __scopeTabs: t, loop: n = !0, ...r } = e, i = ue(ye, t), l = _e(t);
|
|
112
|
+
return /* @__PURE__ */ p.jsx(
|
|
113
|
+
tt,
|
|
113
114
|
{
|
|
114
115
|
asChild: !0,
|
|
115
|
-
...
|
|
116
|
-
orientation:
|
|
117
|
-
dir:
|
|
118
|
-
loop:
|
|
119
|
-
children: /* @__PURE__ */
|
|
120
|
-
|
|
116
|
+
...l,
|
|
117
|
+
orientation: i.orientation,
|
|
118
|
+
dir: i.dir,
|
|
119
|
+
loop: n,
|
|
120
|
+
children: /* @__PURE__ */ p.jsx(
|
|
121
|
+
k.div,
|
|
121
122
|
{
|
|
122
123
|
role: "tablist",
|
|
123
|
-
"aria-orientation":
|
|
124
|
-
...
|
|
125
|
-
ref:
|
|
124
|
+
"aria-orientation": i.orientation,
|
|
125
|
+
...r,
|
|
126
|
+
ref: o
|
|
126
127
|
}
|
|
127
128
|
)
|
|
128
129
|
}
|
|
129
130
|
);
|
|
130
131
|
}
|
|
131
132
|
);
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
(
|
|
135
|
-
const { __scopeTabs:
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
|
|
133
|
+
$e.displayName = ye;
|
|
134
|
+
var Ve = "TabsTrigger", Me = P.forwardRef(
|
|
135
|
+
(e, o) => {
|
|
136
|
+
const { __scopeTabs: t, value: n, disabled: r = !1, ...i } = e, l = ue(Ve, t), u = _e(t), s = De(l.baseId, n), g = Ee(l.baseId, n), d = n === l.value;
|
|
137
|
+
return /* @__PURE__ */ p.jsx(
|
|
138
|
+
nt,
|
|
138
139
|
{
|
|
139
140
|
asChild: !0,
|
|
140
141
|
...u,
|
|
141
|
-
focusable: !
|
|
142
|
-
active:
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
|
|
142
|
+
focusable: !r,
|
|
143
|
+
active: d,
|
|
144
|
+
children: /* @__PURE__ */ p.jsx(
|
|
145
|
+
k.button,
|
|
145
146
|
{
|
|
146
147
|
type: "button",
|
|
147
148
|
role: "tab",
|
|
148
|
-
"aria-selected":
|
|
149
|
-
"aria-controls":
|
|
150
|
-
"data-state":
|
|
151
|
-
"data-disabled":
|
|
152
|
-
disabled:
|
|
153
|
-
id:
|
|
154
|
-
...
|
|
155
|
-
ref:
|
|
156
|
-
onMouseDown:
|
|
157
|
-
!
|
|
149
|
+
"aria-selected": d,
|
|
150
|
+
"aria-controls": g,
|
|
151
|
+
"data-state": d ? "active" : "inactive",
|
|
152
|
+
"data-disabled": r ? "" : void 0,
|
|
153
|
+
disabled: r,
|
|
154
|
+
id: s,
|
|
155
|
+
...i,
|
|
156
|
+
ref: o,
|
|
157
|
+
onMouseDown: U(e.onMouseDown, (f) => {
|
|
158
|
+
!r && f.button === 0 && f.ctrlKey === !1 ? l.onValueChange(n) : f.preventDefault();
|
|
158
159
|
}),
|
|
159
|
-
onKeyDown:
|
|
160
|
-
[" ", "Enter"].includes(
|
|
160
|
+
onKeyDown: U(e.onKeyDown, (f) => {
|
|
161
|
+
[" ", "Enter"].includes(f.key) && l.onValueChange(n);
|
|
161
162
|
}),
|
|
162
|
-
onFocus:
|
|
163
|
-
const
|
|
164
|
-
!
|
|
163
|
+
onFocus: U(e.onFocus, () => {
|
|
164
|
+
const f = l.activationMode !== "manual";
|
|
165
|
+
!d && !r && f && l.onValueChange(n);
|
|
165
166
|
})
|
|
166
167
|
}
|
|
167
168
|
)
|
|
@@ -169,208 +170,2500 @@ var S = "TabsTrigger", _ = x.forwardRef(
|
|
|
169
170
|
);
|
|
170
171
|
}
|
|
171
172
|
);
|
|
172
|
-
|
|
173
|
-
var
|
|
174
|
-
(
|
|
175
|
-
const { __scopeTabs:
|
|
176
|
-
return
|
|
177
|
-
const
|
|
178
|
-
return () => cancelAnimationFrame(
|
|
179
|
-
}, []), /* @__PURE__ */
|
|
180
|
-
|
|
173
|
+
Me.displayName = Ve;
|
|
174
|
+
var Ie = "TabsContent", Pe = P.forwardRef(
|
|
175
|
+
(e, o) => {
|
|
176
|
+
const { __scopeTabs: t, value: n, forceMount: r, children: i, ...l } = e, u = ue(Ie, t), s = De(u.baseId, n), g = Ee(u.baseId, n), d = n === u.value, f = P.useRef(d);
|
|
177
|
+
return P.useEffect(() => {
|
|
178
|
+
const c = requestAnimationFrame(() => f.current = !1);
|
|
179
|
+
return () => cancelAnimationFrame(c);
|
|
180
|
+
}, []), /* @__PURE__ */ p.jsx(ot, { present: r || d, children: ({ present: c }) => /* @__PURE__ */ p.jsx(
|
|
181
|
+
k.div,
|
|
181
182
|
{
|
|
182
|
-
"data-state":
|
|
183
|
+
"data-state": d ? "active" : "inactive",
|
|
183
184
|
"data-orientation": u.orientation,
|
|
184
185
|
role: "tabpanel",
|
|
185
|
-
"aria-labelledby":
|
|
186
|
-
hidden: !
|
|
187
|
-
id:
|
|
186
|
+
"aria-labelledby": s,
|
|
187
|
+
hidden: !c,
|
|
188
|
+
id: g,
|
|
188
189
|
tabIndex: 0,
|
|
189
|
-
...
|
|
190
|
-
ref:
|
|
190
|
+
...l,
|
|
191
|
+
ref: o,
|
|
191
192
|
style: {
|
|
192
|
-
...
|
|
193
|
-
animationDuration:
|
|
193
|
+
...e.style,
|
|
194
|
+
animationDuration: f.current ? "0s" : void 0
|
|
194
195
|
},
|
|
195
|
-
children:
|
|
196
|
+
children: c && i
|
|
196
197
|
}
|
|
197
198
|
) });
|
|
198
199
|
}
|
|
199
200
|
);
|
|
200
|
-
|
|
201
|
-
function
|
|
202
|
-
return `${
|
|
203
|
-
}
|
|
204
|
-
function
|
|
205
|
-
return `${
|
|
206
|
-
}
|
|
207
|
-
var
|
|
208
|
-
const
|
|
209
|
-
var
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
|
|
201
|
+
Pe.displayName = Ie;
|
|
202
|
+
function De(e, o) {
|
|
203
|
+
return `${e}-trigger-${o}`;
|
|
204
|
+
}
|
|
205
|
+
function Ee(e, o) {
|
|
206
|
+
return `${e}-content-${o}`;
|
|
207
|
+
}
|
|
208
|
+
var mt = Fe, ht = $e, St = Me, Ce = Pe;
|
|
209
|
+
const Ct = ({ classes: e, contents: o }) => /* @__PURE__ */ p.jsx("div", { className: w("flex flex-col gap-4", e == null ? void 0 : e.contentsWrapper), children: o == null ? void 0 : o.map(({ id: t, body: n, accordion: r }) => r && (r != null && r.title) ? /* @__PURE__ */ p.jsx(Ce, { value: t, className: w("py-8", e == null ? void 0 : e.content), children: /* @__PURE__ */ p.jsx(rt, { label: r == null ? void 0 : r.title, children: n }) }, t) : /* @__PURE__ */ p.jsx(Ce, { value: t, className: w("py-8", e == null ? void 0 : e.content), children: n }, t)) }), Nn = ({ renderContent: e, defaultActiveTabId: o = "1", value: t, onChangeTab: n, classes: r }) => {
|
|
210
|
+
var i;
|
|
211
|
+
return /* @__PURE__ */ p.jsxs(
|
|
212
|
+
mt,
|
|
212
213
|
{
|
|
213
|
-
value:
|
|
214
|
-
onValueChange:
|
|
215
|
-
defaultValue:
|
|
216
|
-
className:
|
|
214
|
+
value: t,
|
|
215
|
+
onValueChange: n,
|
|
216
|
+
defaultValue: o,
|
|
217
|
+
className: w("flex flex-col", r == null ? void 0 : r.root),
|
|
217
218
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
219
|
+
/* @__PURE__ */ p.jsx(ht, { className: w("flex items-center gap-4", r == null ? void 0 : r.list), children: (i = e == null ? void 0 : e.triggers) == null ? void 0 : i.map(({ id: l, label: u }) => /* @__PURE__ */ p.jsx(
|
|
220
|
+
St,
|
|
220
221
|
{
|
|
221
|
-
value:
|
|
222
|
-
className:
|
|
222
|
+
value: l,
|
|
223
|
+
className: w(
|
|
223
224
|
'desk-body-regular-l cursor-pointer rounded-sm bg-color-blue-grey-100 px-4 py-2 text-color-secondary outline outline-2 outline-offset-2 outline-transparent transition-colors hover:bg-color-blue-grey-200 hover:text-color-secondary data-[state="active"]:!bg-color-primary-default data-[state="active"]:!text-color-white',
|
|
224
|
-
|
|
225
|
+
r == null ? void 0 : r.trigger
|
|
225
226
|
),
|
|
226
227
|
children: u
|
|
227
228
|
},
|
|
228
|
-
|
|
229
|
+
l
|
|
229
230
|
)) }),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ p.jsx(Ct, { contents: e == null ? void 0 : e.contents, classes: r == null ? void 0 : r.tabContent })
|
|
231
232
|
]
|
|
232
233
|
}
|
|
233
234
|
);
|
|
234
|
-
},
|
|
235
|
+
}, wt = {
|
|
235
236
|
initial: { opacity: 0 },
|
|
236
237
|
animate: { opacity: 1 },
|
|
237
238
|
exit: { opacity: 0 },
|
|
238
239
|
transition: { duration: 0.3, ease: "easeInOut" }
|
|
239
|
-
},
|
|
240
|
+
}, Rt = {
|
|
240
241
|
initial: { opacity: 0, scale: 0 },
|
|
241
242
|
animate: { opacity: 1, scale: 1 },
|
|
242
243
|
exit: { opacity: 0, scale: 0 },
|
|
243
244
|
transition: { duration: 0.3, ease: "easeInOut" }
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
245
|
+
}, vt = ({ title: e, closeModal: o, classes: t }) => /* @__PURE__ */ p.jsxs("div", { className: w("flex items-start justify-between gap-4", t == null ? void 0 : t.header), children: [
|
|
246
|
+
e && /* @__PURE__ */ p.jsx(it, { as: "h3", className: w("flex-1 text-color-dark", t == null ? void 0 : t.title), children: e }),
|
|
247
|
+
/* @__PURE__ */ p.jsx(
|
|
248
|
+
N,
|
|
248
249
|
{
|
|
249
|
-
onClick:
|
|
250
|
+
onClick: o,
|
|
250
251
|
name: "general/close",
|
|
251
|
-
className:
|
|
252
|
+
className: w("size-8 cursor-pointer text-icon-dark-hover", t == null ? void 0 : t.icon)
|
|
252
253
|
}
|
|
253
254
|
)
|
|
254
|
-
] }),
|
|
255
|
-
title:
|
|
256
|
-
children:
|
|
257
|
-
isModalOpen:
|
|
258
|
-
isPortal:
|
|
259
|
-
portalContainer:
|
|
260
|
-
closeModal:
|
|
261
|
-
classes:
|
|
255
|
+
] }), zn = ({
|
|
256
|
+
title: e,
|
|
257
|
+
children: o,
|
|
258
|
+
isModalOpen: t,
|
|
259
|
+
isPortal: n = !0,
|
|
260
|
+
portalContainer: r = ((u) => (u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body)(),
|
|
261
|
+
closeModal: i,
|
|
262
|
+
classes: l
|
|
262
263
|
}) => {
|
|
263
|
-
const
|
|
264
|
-
|
|
264
|
+
const s = /* @__PURE__ */ p.jsx(lt, { children: t && /* @__PURE__ */ p.jsx(
|
|
265
|
+
me.div,
|
|
265
266
|
{
|
|
266
267
|
tabIndex: -1,
|
|
267
|
-
onClick:
|
|
268
|
-
className:
|
|
268
|
+
onClick: i,
|
|
269
|
+
className: w(
|
|
269
270
|
"fixed inset-0 flex h-screen w-screen items-center justify-center bg-color-overlay",
|
|
270
|
-
{ "z-1000": !
|
|
271
|
-
|
|
271
|
+
{ "z-1000": !n },
|
|
272
|
+
l == null ? void 0 : l.overlay
|
|
272
273
|
),
|
|
273
|
-
onKeyDown: (
|
|
274
|
-
|
|
274
|
+
onKeyDown: (g) => {
|
|
275
|
+
g.key === "Escape" && i();
|
|
275
276
|
},
|
|
276
277
|
"data-test-id": "modal-overlay",
|
|
277
|
-
...
|
|
278
|
-
children: /* @__PURE__ */
|
|
279
|
-
|
|
278
|
+
...wt,
|
|
279
|
+
children: /* @__PURE__ */ p.jsxs(
|
|
280
|
+
me.div,
|
|
280
281
|
{
|
|
281
|
-
onClick: (
|
|
282
|
-
className:
|
|
282
|
+
onClick: (g) => g.stopPropagation(),
|
|
283
|
+
className: w(
|
|
283
284
|
"w-full max-w-[600px] rounded-md bg-color-white px-4 py-6 shadow-sm desktop:px-6 desktop:py-8",
|
|
284
|
-
|
|
285
|
+
l == null ? void 0 : l.modal
|
|
285
286
|
),
|
|
286
287
|
"data-test-id": "modal",
|
|
287
|
-
...
|
|
288
|
+
...Rt,
|
|
288
289
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ p.jsx(vt, { title: e, closeModal: i, classes: l == null ? void 0 : l.modalHeader }),
|
|
291
|
+
/* @__PURE__ */ p.jsx("div", { className: w("mt-4", l == null ? void 0 : l.content), children: o })
|
|
291
292
|
]
|
|
292
293
|
}
|
|
293
294
|
)
|
|
294
295
|
}
|
|
295
296
|
) });
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
297
|
+
return /* @__PURE__ */ p.jsx(p.Fragment, { children: n ? dt(s, r) : s });
|
|
298
|
+
}, Ae = D((e, o) => /* @__PURE__ */ p.jsx("table", { ref: o, ...e }));
|
|
299
|
+
Ae.displayName = "Table";
|
|
300
|
+
const He = D((e, o) => /* @__PURE__ */ p.jsx("thead", { ref: o, ...e }));
|
|
301
|
+
He.displayName = "TableHeader";
|
|
302
|
+
const Ge = D((e, o) => /* @__PURE__ */ p.jsx("tbody", { ref: o, ...e }));
|
|
303
|
+
Ge.displayName = "TableBody";
|
|
304
|
+
const xt = D((e, o) => /* @__PURE__ */ p.jsx("tfoot", { ref: o, ...e }));
|
|
305
|
+
xt.displayName = "TableFooter";
|
|
306
|
+
const O = D((e, o) => /* @__PURE__ */ p.jsx("tr", { ref: o, ...e }));
|
|
307
|
+
O.displayName = "TableRow";
|
|
308
|
+
const je = D((e, o) => /* @__PURE__ */ p.jsx("th", { ref: o, ...e }));
|
|
309
|
+
je.displayName = "TableHead";
|
|
310
|
+
const ee = D((e, o) => /* @__PURE__ */ p.jsx("td", { ref: o, ...e }));
|
|
311
|
+
ee.displayName = "TableCell";
|
|
312
|
+
const _t = D((e, o) => /* @__PURE__ */ p.jsx("caption", { ref: o, ...e }));
|
|
313
|
+
_t.displayName = "TableCaption";
|
|
314
|
+
const Ft = ({
|
|
315
|
+
children: e,
|
|
316
|
+
canSort: o,
|
|
317
|
+
toggleSorting: t,
|
|
318
|
+
nextSortingOrder: n,
|
|
319
|
+
isSorted: r,
|
|
320
|
+
classes: i
|
|
321
|
+
}) => {
|
|
322
|
+
const { root: l, content: u, icon: s } = i || {}, { isDesktop: g } = xe(), d = o && g;
|
|
323
|
+
return /* @__PURE__ */ p.jsxs(
|
|
324
|
+
"button",
|
|
325
|
+
{
|
|
326
|
+
type: "button",
|
|
327
|
+
className: w("desk-body-regular-l flex items-center justify-center gap-x-2 text-color-secondary", l),
|
|
328
|
+
onClick: () => t(!r),
|
|
329
|
+
disabled: !d,
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ p.jsx("span", { className: w("", u), children: e }),
|
|
332
|
+
d && /* @__PURE__ */ p.jsx(
|
|
333
|
+
N,
|
|
334
|
+
{
|
|
335
|
+
name: "arrows/arrowRight",
|
|
336
|
+
className: w(
|
|
337
|
+
"size-4 rotate-90 text-color-current duration-100",
|
|
338
|
+
{
|
|
339
|
+
"-rotate-90": !n
|
|
340
|
+
},
|
|
341
|
+
s
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* table-core
|
|
351
|
+
*
|
|
352
|
+
* Copyright (c) TanStack
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license found in the
|
|
355
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
356
|
+
*
|
|
357
|
+
* @license MIT
|
|
358
|
+
*/
|
|
359
|
+
function yt() {
|
|
360
|
+
return {
|
|
361
|
+
accessor: (e, o) => typeof e == "function" ? {
|
|
362
|
+
...o,
|
|
363
|
+
accessorFn: e
|
|
364
|
+
} : {
|
|
365
|
+
...o,
|
|
366
|
+
accessorKey: e
|
|
367
|
+
},
|
|
368
|
+
display: (e) => e,
|
|
369
|
+
group: (e) => e
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function A(e, o) {
|
|
373
|
+
return typeof e == "function" ? e(o) : e;
|
|
374
|
+
}
|
|
375
|
+
function $(e, o) {
|
|
376
|
+
return (t) => {
|
|
377
|
+
o.setState((n) => ({
|
|
378
|
+
...n,
|
|
379
|
+
[e]: A(t, n[e])
|
|
380
|
+
}));
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function q(e) {
|
|
384
|
+
return e instanceof Function;
|
|
385
|
+
}
|
|
386
|
+
function $t(e) {
|
|
387
|
+
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
388
|
+
}
|
|
389
|
+
function Vt(e, o) {
|
|
390
|
+
const t = [], n = (r) => {
|
|
391
|
+
r.forEach((i) => {
|
|
392
|
+
t.push(i);
|
|
393
|
+
const l = o(i);
|
|
394
|
+
l != null && l.length && n(l);
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
return n(e), t;
|
|
398
|
+
}
|
|
399
|
+
function S(e, o, t) {
|
|
400
|
+
let n = [], r;
|
|
401
|
+
return (i) => {
|
|
402
|
+
let l;
|
|
403
|
+
t.key && t.debug && (l = Date.now());
|
|
404
|
+
const u = e(i);
|
|
405
|
+
if (!(u.length !== n.length || u.some((d, f) => n[f] !== d)))
|
|
406
|
+
return r;
|
|
407
|
+
n = u;
|
|
408
|
+
let g;
|
|
409
|
+
if (t.key && t.debug && (g = Date.now()), r = o(...u), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
|
|
410
|
+
const d = Math.round((Date.now() - l) * 100) / 100, f = Math.round((Date.now() - g) * 100) / 100, c = f / 16, a = (m, h) => {
|
|
411
|
+
for (m = String(m); m.length < h; )
|
|
412
|
+
m = " " + m;
|
|
413
|
+
return m;
|
|
414
|
+
};
|
|
415
|
+
console.info(`%c⏱ ${a(f, 5)} /${a(d, 5)} ms`, `
|
|
416
|
+
font-size: .6rem;
|
|
417
|
+
font-weight: bold;
|
|
418
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * c, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
419
|
+
}
|
|
420
|
+
return r;
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function C(e, o, t, n) {
|
|
424
|
+
return {
|
|
425
|
+
debug: () => {
|
|
426
|
+
var r;
|
|
427
|
+
return (r = e == null ? void 0 : e.debugAll) != null ? r : e[o];
|
|
428
|
+
},
|
|
429
|
+
key: process.env.NODE_ENV === "development" && t,
|
|
430
|
+
onChange: n
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function Mt(e, o, t, n) {
|
|
434
|
+
const r = () => {
|
|
435
|
+
var l;
|
|
436
|
+
return (l = i.getValue()) != null ? l : e.options.renderFallbackValue;
|
|
437
|
+
}, i = {
|
|
438
|
+
id: `${o.id}_${t.id}`,
|
|
439
|
+
row: o,
|
|
440
|
+
column: t,
|
|
441
|
+
getValue: () => o.getValue(n),
|
|
442
|
+
renderValue: r,
|
|
443
|
+
getContext: S(() => [e, t, o, i], (l, u, s, g) => ({
|
|
444
|
+
table: l,
|
|
445
|
+
column: u,
|
|
446
|
+
row: s,
|
|
447
|
+
cell: g,
|
|
448
|
+
getValue: g.getValue,
|
|
449
|
+
renderValue: g.renderValue
|
|
450
|
+
}), C(e.options, "debugCells", "cell.getContext"))
|
|
451
|
+
};
|
|
452
|
+
return e._features.forEach((l) => {
|
|
453
|
+
l.createCell == null || l.createCell(i, t, o, e);
|
|
454
|
+
}, {}), i;
|
|
455
|
+
}
|
|
456
|
+
function It(e, o, t, n) {
|
|
457
|
+
var r, i;
|
|
458
|
+
const u = {
|
|
459
|
+
...e._getDefaultColumnDef(),
|
|
460
|
+
...o
|
|
461
|
+
}, s = u.accessorKey;
|
|
462
|
+
let g = (r = (i = u.id) != null ? i : s ? typeof String.prototype.replaceAll == "function" ? s.replaceAll(".", "_") : s.replace(/\./g, "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, d;
|
|
463
|
+
if (u.accessorFn ? d = u.accessorFn : s && (s.includes(".") ? d = (c) => {
|
|
464
|
+
let a = c;
|
|
465
|
+
for (const h of s.split(".")) {
|
|
466
|
+
var m;
|
|
467
|
+
a = (m = a) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && a === void 0 && console.warn(`"${h}" in deeply nested key "${s}" returned undefined.`);
|
|
468
|
+
}
|
|
469
|
+
return a;
|
|
470
|
+
} : d = (c) => c[u.accessorKey]), !g)
|
|
471
|
+
throw process.env.NODE_ENV !== "production" ? new Error(u.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
472
|
+
let f = {
|
|
473
|
+
id: `${String(g)}`,
|
|
474
|
+
accessorFn: d,
|
|
475
|
+
parent: n,
|
|
476
|
+
depth: t,
|
|
477
|
+
columnDef: u,
|
|
478
|
+
columns: [],
|
|
479
|
+
getFlatColumns: S(() => [!0], () => {
|
|
480
|
+
var c;
|
|
481
|
+
return [f, ...(c = f.columns) == null ? void 0 : c.flatMap((a) => a.getFlatColumns())];
|
|
482
|
+
}, C(e.options, "debugColumns", "column.getFlatColumns")),
|
|
483
|
+
getLeafColumns: S(() => [e._getOrderColumnsFn()], (c) => {
|
|
484
|
+
var a;
|
|
485
|
+
if ((a = f.columns) != null && a.length) {
|
|
486
|
+
let m = f.columns.flatMap((h) => h.getLeafColumns());
|
|
487
|
+
return c(m);
|
|
488
|
+
}
|
|
489
|
+
return [f];
|
|
490
|
+
}, C(e.options, "debugColumns", "column.getLeafColumns"))
|
|
491
|
+
};
|
|
492
|
+
for (const c of e._features)
|
|
493
|
+
c.createColumn == null || c.createColumn(f, e);
|
|
494
|
+
return f;
|
|
495
|
+
}
|
|
496
|
+
const F = "debugHeaders";
|
|
497
|
+
function we(e, o, t) {
|
|
498
|
+
var n;
|
|
499
|
+
let i = {
|
|
500
|
+
id: (n = t.id) != null ? n : o.id,
|
|
501
|
+
column: o,
|
|
502
|
+
index: t.index,
|
|
503
|
+
isPlaceholder: !!t.isPlaceholder,
|
|
504
|
+
placeholderId: t.placeholderId,
|
|
505
|
+
depth: t.depth,
|
|
506
|
+
subHeaders: [],
|
|
507
|
+
colSpan: 0,
|
|
508
|
+
rowSpan: 0,
|
|
509
|
+
headerGroup: null,
|
|
510
|
+
getLeafHeaders: () => {
|
|
511
|
+
const l = [], u = (s) => {
|
|
512
|
+
s.subHeaders && s.subHeaders.length && s.subHeaders.map(u), l.push(s);
|
|
513
|
+
};
|
|
514
|
+
return u(i), l;
|
|
515
|
+
},
|
|
516
|
+
getContext: () => ({
|
|
517
|
+
table: e,
|
|
518
|
+
header: i,
|
|
519
|
+
column: o
|
|
520
|
+
})
|
|
521
|
+
};
|
|
522
|
+
return e._features.forEach((l) => {
|
|
523
|
+
l.createHeader == null || l.createHeader(i, e);
|
|
524
|
+
}), i;
|
|
525
|
+
}
|
|
526
|
+
const Pt = {
|
|
527
|
+
createTable: (e) => {
|
|
528
|
+
e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
529
|
+
var i, l;
|
|
530
|
+
const u = (i = n == null ? void 0 : n.map((f) => t.find((c) => c.id === f)).filter(Boolean)) != null ? i : [], s = (l = r == null ? void 0 : r.map((f) => t.find((c) => c.id === f)).filter(Boolean)) != null ? l : [], g = t.filter((f) => !(n != null && n.includes(f.id)) && !(r != null && r.includes(f.id)));
|
|
531
|
+
return z(o, [...u, ...g, ...s], e);
|
|
532
|
+
}, C(e.options, F, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((i) => !(n != null && n.includes(i.id)) && !(r != null && r.includes(i.id))), z(o, t, e, "center")), C(e.options, F, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
533
|
+
var r;
|
|
534
|
+
const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
|
|
535
|
+
return z(o, i, e, "left");
|
|
536
|
+
}, C(e.options, F, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
537
|
+
var r;
|
|
538
|
+
const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
|
|
539
|
+
return z(o, i, e, "right");
|
|
540
|
+
}, C(e.options, F, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), C(e.options, F, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), C(e.options, F, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), C(e.options, F, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), C(e.options, F, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, F, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, F, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, F, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, F, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
541
|
+
var n;
|
|
542
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
543
|
+
}), C(e.options, F, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
544
|
+
var n;
|
|
545
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
546
|
+
}), C(e.options, F, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
547
|
+
var n;
|
|
548
|
+
return !((n = t.subHeaders) != null && n.length);
|
|
549
|
+
}), C(e.options, F, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
550
|
+
var r, i, l, u, s, g;
|
|
551
|
+
return [...(r = (i = o[0]) == null ? void 0 : i.headers) != null ? r : [], ...(l = (u = t[0]) == null ? void 0 : u.headers) != null ? l : [], ...(s = (g = n[0]) == null ? void 0 : g.headers) != null ? s : []].map((d) => d.getLeafHeaders()).flat();
|
|
552
|
+
}, C(e.options, F, "getLeafHeaders"));
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
function z(e, o, t, n) {
|
|
556
|
+
var r, i;
|
|
557
|
+
let l = 0;
|
|
558
|
+
const u = function(c, a) {
|
|
559
|
+
a === void 0 && (a = 1), l = Math.max(l, a), c.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
560
|
+
var h;
|
|
561
|
+
(h = m.columns) != null && h.length && u(m.columns, a + 1);
|
|
562
|
+
}, 0);
|
|
563
|
+
};
|
|
564
|
+
u(e);
|
|
565
|
+
let s = [];
|
|
566
|
+
const g = (c, a) => {
|
|
567
|
+
const m = {
|
|
568
|
+
depth: a,
|
|
569
|
+
id: [n, `${a}`].filter(Boolean).join("_"),
|
|
570
|
+
headers: []
|
|
571
|
+
}, h = [];
|
|
572
|
+
c.forEach((R) => {
|
|
573
|
+
const v = [...h].reverse()[0], x = R.column.depth === m.depth;
|
|
574
|
+
let _, M = !1;
|
|
575
|
+
if (x && R.column.parent ? _ = R.column.parent : (_ = R.column, M = !0), v && (v == null ? void 0 : v.column) === _)
|
|
576
|
+
v.subHeaders.push(R);
|
|
577
|
+
else {
|
|
578
|
+
const y = we(t, _, {
|
|
579
|
+
id: [n, a, _.id, R == null ? void 0 : R.id].filter(Boolean).join("_"),
|
|
580
|
+
isPlaceholder: M,
|
|
581
|
+
placeholderId: M ? `${h.filter((G) => G.column === _).length}` : void 0,
|
|
582
|
+
depth: a,
|
|
583
|
+
index: h.length
|
|
584
|
+
});
|
|
585
|
+
y.subHeaders.push(R), h.push(y);
|
|
586
|
+
}
|
|
587
|
+
m.headers.push(R), R.headerGroup = m;
|
|
588
|
+
}), s.push(m), a > 0 && g(h, a - 1);
|
|
589
|
+
}, d = o.map((c, a) => we(t, c, {
|
|
590
|
+
depth: l,
|
|
591
|
+
index: a
|
|
592
|
+
}));
|
|
593
|
+
g(d, l - 1), s.reverse();
|
|
594
|
+
const f = (c) => c.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
595
|
+
let h = 0, R = 0, v = [0];
|
|
596
|
+
m.subHeaders && m.subHeaders.length ? (v = [], f(m.subHeaders).forEach((_) => {
|
|
597
|
+
let {
|
|
598
|
+
colSpan: M,
|
|
599
|
+
rowSpan: y
|
|
600
|
+
} = _;
|
|
601
|
+
h += M, v.push(y);
|
|
602
|
+
})) : h = 1;
|
|
603
|
+
const x = Math.min(...v);
|
|
604
|
+
return R = R + x, m.colSpan = h, m.rowSpan = R, {
|
|
605
|
+
colSpan: h,
|
|
606
|
+
rowSpan: R
|
|
607
|
+
};
|
|
608
|
+
});
|
|
609
|
+
return f((r = (i = s[0]) == null ? void 0 : i.headers) != null ? r : []), s;
|
|
610
|
+
}
|
|
611
|
+
const se = (e, o, t, n, r, i, l) => {
|
|
612
|
+
let u = {
|
|
613
|
+
id: o,
|
|
614
|
+
index: n,
|
|
615
|
+
original: t,
|
|
616
|
+
depth: r,
|
|
617
|
+
parentId: l,
|
|
618
|
+
_valuesCache: {},
|
|
619
|
+
_uniqueValuesCache: {},
|
|
620
|
+
getValue: (s) => {
|
|
621
|
+
if (u._valuesCache.hasOwnProperty(s))
|
|
622
|
+
return u._valuesCache[s];
|
|
623
|
+
const g = e.getColumn(s);
|
|
624
|
+
if (g != null && g.accessorFn)
|
|
625
|
+
return u._valuesCache[s] = g.accessorFn(u.original, n), u._valuesCache[s];
|
|
626
|
+
},
|
|
627
|
+
getUniqueValues: (s) => {
|
|
628
|
+
if (u._uniqueValuesCache.hasOwnProperty(s))
|
|
629
|
+
return u._uniqueValuesCache[s];
|
|
630
|
+
const g = e.getColumn(s);
|
|
631
|
+
if (g != null && g.accessorFn)
|
|
632
|
+
return g.columnDef.getUniqueValues ? (u._uniqueValuesCache[s] = g.columnDef.getUniqueValues(u.original, n), u._uniqueValuesCache[s]) : (u._uniqueValuesCache[s] = [u.getValue(s)], u._uniqueValuesCache[s]);
|
|
633
|
+
},
|
|
634
|
+
renderValue: (s) => {
|
|
635
|
+
var g;
|
|
636
|
+
return (g = u.getValue(s)) != null ? g : e.options.renderFallbackValue;
|
|
637
|
+
},
|
|
638
|
+
subRows: [],
|
|
639
|
+
getLeafRows: () => Vt(u.subRows, (s) => s.subRows),
|
|
640
|
+
getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
|
|
641
|
+
getParentRows: () => {
|
|
642
|
+
let s = [], g = u;
|
|
643
|
+
for (; ; ) {
|
|
644
|
+
const d = g.getParentRow();
|
|
645
|
+
if (!d) break;
|
|
646
|
+
s.push(d), g = d;
|
|
647
|
+
}
|
|
648
|
+
return s.reverse();
|
|
649
|
+
},
|
|
650
|
+
getAllCells: S(() => [e.getAllLeafColumns()], (s) => s.map((g) => Mt(e, u, g, g.id)), C(e.options, "debugRows", "getAllCells")),
|
|
651
|
+
_getAllCellsByColumnId: S(() => [u.getAllCells()], (s) => s.reduce((g, d) => (g[d.column.id] = d, g), {}), C(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
652
|
+
};
|
|
653
|
+
for (let s = 0; s < e._features.length; s++) {
|
|
654
|
+
const g = e._features[s];
|
|
655
|
+
g == null || g.createRow == null || g.createRow(u, e);
|
|
656
|
+
}
|
|
657
|
+
return u;
|
|
658
|
+
}, Dt = {
|
|
659
|
+
createColumn: (e, o) => {
|
|
660
|
+
e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
|
|
661
|
+
if (e._getFacetedMinMaxValues)
|
|
662
|
+
return e._getFacetedMinMaxValues();
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
}, Le = (e, o, t) => {
|
|
666
|
+
var n, r;
|
|
667
|
+
const i = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
668
|
+
return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(i));
|
|
669
|
+
};
|
|
670
|
+
Le.autoRemove = (e) => V(e);
|
|
671
|
+
const Ne = (e, o, t) => {
|
|
672
|
+
var n;
|
|
673
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
674
|
+
};
|
|
675
|
+
Ne.autoRemove = (e) => V(e);
|
|
676
|
+
const ze = (e, o, t) => {
|
|
677
|
+
var n;
|
|
678
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
679
|
+
};
|
|
680
|
+
ze.autoRemove = (e) => V(e);
|
|
681
|
+
const be = (e, o, t) => {
|
|
682
|
+
var n;
|
|
683
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
684
|
+
};
|
|
685
|
+
be.autoRemove = (e) => V(e);
|
|
686
|
+
const Te = (e, o, t) => !t.some((n) => {
|
|
687
|
+
var r;
|
|
688
|
+
return !((r = e.getValue(o)) != null && r.includes(n));
|
|
689
|
+
});
|
|
690
|
+
Te.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
691
|
+
const Oe = (e, o, t) => t.some((n) => {
|
|
692
|
+
var r;
|
|
693
|
+
return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
|
|
694
|
+
});
|
|
695
|
+
Oe.autoRemove = (e) => V(e) || !(e != null && e.length);
|
|
696
|
+
const Be = (e, o, t) => e.getValue(o) === t;
|
|
697
|
+
Be.autoRemove = (e) => V(e);
|
|
698
|
+
const ke = (e, o, t) => e.getValue(o) == t;
|
|
699
|
+
ke.autoRemove = (e) => V(e);
|
|
700
|
+
const ae = (e, o, t) => {
|
|
701
|
+
let [n, r] = t;
|
|
702
|
+
const i = e.getValue(o);
|
|
703
|
+
return i >= n && i <= r;
|
|
704
|
+
};
|
|
705
|
+
ae.resolveFilterValue = (e) => {
|
|
706
|
+
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, i = o === null || Number.isNaN(n) ? -1 / 0 : n, l = t === null || Number.isNaN(r) ? 1 / 0 : r;
|
|
707
|
+
if (i > l) {
|
|
708
|
+
const u = i;
|
|
709
|
+
i = l, l = u;
|
|
710
|
+
}
|
|
711
|
+
return [i, l];
|
|
712
|
+
};
|
|
713
|
+
ae.autoRemove = (e) => V(e) || V(e[0]) && V(e[1]);
|
|
714
|
+
const I = {
|
|
715
|
+
includesString: Le,
|
|
716
|
+
includesStringSensitive: Ne,
|
|
717
|
+
equalsString: ze,
|
|
718
|
+
arrIncludes: be,
|
|
719
|
+
arrIncludesAll: Te,
|
|
720
|
+
arrIncludesSome: Oe,
|
|
721
|
+
equals: Be,
|
|
722
|
+
weakEquals: ke,
|
|
723
|
+
inNumberRange: ae
|
|
724
|
+
};
|
|
725
|
+
function V(e) {
|
|
726
|
+
return e == null || e === "";
|
|
727
|
+
}
|
|
728
|
+
const Et = {
|
|
729
|
+
getDefaultColumnDef: () => ({
|
|
730
|
+
filterFn: "auto"
|
|
731
|
+
}),
|
|
732
|
+
getInitialState: (e) => ({
|
|
733
|
+
columnFilters: [],
|
|
734
|
+
...e
|
|
735
|
+
}),
|
|
736
|
+
getDefaultOptions: (e) => ({
|
|
737
|
+
onColumnFiltersChange: $("columnFilters", e),
|
|
738
|
+
filterFromLeafRows: !1,
|
|
739
|
+
maxLeafRowFilterDepth: 100
|
|
740
|
+
}),
|
|
741
|
+
createColumn: (e, o) => {
|
|
742
|
+
e.getAutoFilterFn = () => {
|
|
743
|
+
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
744
|
+
return typeof n == "string" ? I.includesString : typeof n == "number" ? I.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? I.equals : Array.isArray(n) ? I.arrIncludes : I.weakEquals;
|
|
745
|
+
}, e.getFilterFn = () => {
|
|
746
|
+
var t, n;
|
|
747
|
+
return q(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
748
|
+
// @ts-ignore
|
|
749
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : I[e.columnDef.filterFn]
|
|
750
|
+
);
|
|
751
|
+
}, e.getCanFilter = () => {
|
|
752
|
+
var t, n, r;
|
|
753
|
+
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((n = o.options.enableColumnFilters) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && !!e.accessorFn;
|
|
754
|
+
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
|
|
755
|
+
var t;
|
|
756
|
+
return (t = o.getState().columnFilters) == null || (t = t.find((n) => n.id === e.id)) == null ? void 0 : t.value;
|
|
757
|
+
}, e.getFilterIndex = () => {
|
|
758
|
+
var t, n;
|
|
759
|
+
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
760
|
+
}, e.setFilterValue = (t) => {
|
|
761
|
+
o.setColumnFilters((n) => {
|
|
762
|
+
const r = e.getFilterFn(), i = n == null ? void 0 : n.find((d) => d.id === e.id), l = A(t, i ? i.value : void 0);
|
|
763
|
+
if (Re(r, l, e)) {
|
|
764
|
+
var u;
|
|
765
|
+
return (u = n == null ? void 0 : n.filter((d) => d.id !== e.id)) != null ? u : [];
|
|
766
|
+
}
|
|
767
|
+
const s = {
|
|
768
|
+
id: e.id,
|
|
769
|
+
value: l
|
|
770
|
+
};
|
|
771
|
+
if (i) {
|
|
772
|
+
var g;
|
|
773
|
+
return (g = n == null ? void 0 : n.map((d) => d.id === e.id ? s : d)) != null ? g : [];
|
|
774
|
+
}
|
|
775
|
+
return n != null && n.length ? [...n, s] : [s];
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
},
|
|
779
|
+
createRow: (e, o) => {
|
|
780
|
+
e.columnFilters = {}, e.columnFiltersMeta = {};
|
|
781
|
+
},
|
|
782
|
+
createTable: (e) => {
|
|
783
|
+
e.setColumnFilters = (o) => {
|
|
784
|
+
const t = e.getAllLeafColumns(), n = (r) => {
|
|
785
|
+
var i;
|
|
786
|
+
return (i = A(o, r)) == null ? void 0 : i.filter((l) => {
|
|
787
|
+
const u = t.find((s) => s.id === l.id);
|
|
788
|
+
if (u) {
|
|
789
|
+
const s = u.getFilterFn();
|
|
790
|
+
if (Re(s, l.value, u))
|
|
791
|
+
return !1;
|
|
792
|
+
}
|
|
793
|
+
return !0;
|
|
794
|
+
});
|
|
795
|
+
};
|
|
796
|
+
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(n);
|
|
797
|
+
}, e.resetColumnFilters = (o) => {
|
|
798
|
+
var t, n;
|
|
799
|
+
e.setColumnFilters(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.columnFilters) != null ? t : []);
|
|
800
|
+
}, 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());
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
function Re(e, o, t) {
|
|
804
|
+
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
805
|
+
}
|
|
806
|
+
const At = (e, o, t) => t.reduce((n, r) => {
|
|
807
|
+
const i = r.getValue(e);
|
|
808
|
+
return n + (typeof i == "number" ? i : 0);
|
|
809
|
+
}, 0), Ht = (e, o, t) => {
|
|
810
|
+
let n;
|
|
811
|
+
return t.forEach((r) => {
|
|
812
|
+
const i = r.getValue(e);
|
|
813
|
+
i != null && (n > i || n === void 0 && i >= i) && (n = i);
|
|
814
|
+
}), n;
|
|
815
|
+
}, Gt = (e, o, t) => {
|
|
816
|
+
let n;
|
|
817
|
+
return t.forEach((r) => {
|
|
818
|
+
const i = r.getValue(e);
|
|
819
|
+
i != null && (n < i || n === void 0 && i >= i) && (n = i);
|
|
820
|
+
}), n;
|
|
821
|
+
}, jt = (e, o, t) => {
|
|
822
|
+
let n, r;
|
|
823
|
+
return t.forEach((i) => {
|
|
824
|
+
const l = i.getValue(e);
|
|
825
|
+
l != null && (n === void 0 ? l >= l && (n = r = l) : (n > l && (n = l), r < l && (r = l)));
|
|
826
|
+
}), [n, r];
|
|
827
|
+
}, Lt = (e, o) => {
|
|
828
|
+
let t = 0, n = 0;
|
|
829
|
+
if (o.forEach((r) => {
|
|
830
|
+
let i = r.getValue(e);
|
|
831
|
+
i != null && (i = +i) >= i && (++t, n += i);
|
|
832
|
+
}), t) return n / t;
|
|
833
|
+
}, Nt = (e, o) => {
|
|
834
|
+
if (!o.length)
|
|
835
|
+
return;
|
|
836
|
+
const t = o.map((i) => i.getValue(e));
|
|
837
|
+
if (!$t(t))
|
|
838
|
+
return;
|
|
839
|
+
if (t.length === 1)
|
|
840
|
+
return t[0];
|
|
841
|
+
const n = Math.floor(t.length / 2), r = t.sort((i, l) => i - l);
|
|
842
|
+
return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
|
|
843
|
+
}, zt = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), bt = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Tt = (e, o) => o.length, K = {
|
|
844
|
+
sum: At,
|
|
845
|
+
min: Ht,
|
|
846
|
+
max: Gt,
|
|
847
|
+
extent: jt,
|
|
848
|
+
mean: Lt,
|
|
849
|
+
median: Nt,
|
|
850
|
+
unique: zt,
|
|
851
|
+
uniqueCount: bt,
|
|
852
|
+
count: Tt
|
|
853
|
+
}, Ot = {
|
|
854
|
+
getDefaultColumnDef: () => ({
|
|
855
|
+
aggregatedCell: (e) => {
|
|
856
|
+
var o, t;
|
|
857
|
+
return (o = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? o : null;
|
|
858
|
+
},
|
|
859
|
+
aggregationFn: "auto"
|
|
860
|
+
}),
|
|
861
|
+
getInitialState: (e) => ({
|
|
862
|
+
grouping: [],
|
|
863
|
+
...e
|
|
864
|
+
}),
|
|
865
|
+
getDefaultOptions: (e) => ({
|
|
866
|
+
onGroupingChange: $("grouping", e),
|
|
867
|
+
groupedColumnMode: "reorder"
|
|
868
|
+
}),
|
|
869
|
+
createColumn: (e, o) => {
|
|
870
|
+
e.toggleGrouping = () => {
|
|
871
|
+
o.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((n) => n !== e.id) : [...t ?? [], e.id]);
|
|
872
|
+
}, e.getCanGroup = () => {
|
|
873
|
+
var t, n;
|
|
874
|
+
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((n = o.options.enableGrouping) != null ? n : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
|
|
875
|
+
}, e.getIsGrouped = () => {
|
|
876
|
+
var t;
|
|
877
|
+
return (t = o.getState().grouping) == null ? void 0 : t.includes(e.id);
|
|
878
|
+
}, e.getGroupedIndex = () => {
|
|
879
|
+
var t;
|
|
880
|
+
return (t = o.getState().grouping) == null ? void 0 : t.indexOf(e.id);
|
|
881
|
+
}, e.getToggleGroupingHandler = () => {
|
|
882
|
+
const t = e.getCanGroup();
|
|
883
|
+
return () => {
|
|
884
|
+
t && e.toggleGrouping();
|
|
885
|
+
};
|
|
886
|
+
}, e.getAutoAggregationFn = () => {
|
|
887
|
+
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
888
|
+
if (typeof n == "number")
|
|
889
|
+
return K.sum;
|
|
890
|
+
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
891
|
+
return K.extent;
|
|
892
|
+
}, e.getAggregationFn = () => {
|
|
893
|
+
var t, n;
|
|
894
|
+
if (!e)
|
|
895
|
+
throw new Error();
|
|
896
|
+
return q(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : K[e.columnDef.aggregationFn];
|
|
897
|
+
};
|
|
898
|
+
},
|
|
899
|
+
createTable: (e) => {
|
|
900
|
+
e.setGrouping = (o) => e.options.onGroupingChange == null ? void 0 : e.options.onGroupingChange(o), e.resetGrouping = (o) => {
|
|
901
|
+
var t, n;
|
|
902
|
+
e.setGrouping(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.grouping) != null ? t : []);
|
|
903
|
+
}, 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());
|
|
904
|
+
},
|
|
905
|
+
createRow: (e, o) => {
|
|
906
|
+
e.getIsGrouped = () => !!e.groupingColumnId, e.getGroupingValue = (t) => {
|
|
907
|
+
if (e._groupingValuesCache.hasOwnProperty(t))
|
|
908
|
+
return e._groupingValuesCache[t];
|
|
909
|
+
const n = o.getColumn(t);
|
|
910
|
+
return n != null && n.columnDef.getGroupingValue ? (e._groupingValuesCache[t] = n.columnDef.getGroupingValue(e.original), e._groupingValuesCache[t]) : e.getValue(t);
|
|
911
|
+
}, e._groupingValuesCache = {};
|
|
912
|
+
},
|
|
913
|
+
createCell: (e, o, t, n) => {
|
|
914
|
+
e.getIsGrouped = () => o.getIsGrouped() && o.id === t.groupingColumnId, e.getIsPlaceholder = () => !e.getIsGrouped() && o.getIsGrouped(), e.getIsAggregated = () => {
|
|
915
|
+
var r;
|
|
916
|
+
return !e.getIsGrouped() && !e.getIsPlaceholder() && !!((r = t.subRows) != null && r.length);
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
function Bt(e, o, t) {
|
|
921
|
+
if (!(o != null && o.length) || !t)
|
|
922
|
+
return e;
|
|
923
|
+
const n = e.filter((i) => !o.includes(i.id));
|
|
924
|
+
return t === "remove" ? n : [...o.map((i) => e.find((l) => l.id === i)).filter(Boolean), ...n];
|
|
925
|
+
}
|
|
926
|
+
const kt = {
|
|
927
|
+
getInitialState: (e) => ({
|
|
928
|
+
columnOrder: [],
|
|
929
|
+
...e
|
|
930
|
+
}),
|
|
931
|
+
getDefaultOptions: (e) => ({
|
|
932
|
+
onColumnOrderChange: $("columnOrder", e)
|
|
933
|
+
}),
|
|
934
|
+
createColumn: (e, o) => {
|
|
935
|
+
e.getIndex = S((t) => [L(o, t)], (t) => t.findIndex((n) => n.id === e.id), C(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
936
|
+
var n;
|
|
937
|
+
return ((n = L(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
938
|
+
}, e.getIsLastColumn = (t) => {
|
|
939
|
+
var n;
|
|
940
|
+
const r = L(o, t);
|
|
941
|
+
return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
942
|
+
};
|
|
943
|
+
},
|
|
944
|
+
createTable: (e) => {
|
|
945
|
+
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
946
|
+
var t;
|
|
947
|
+
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
948
|
+
}, e._getOrderColumnsFn = S(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
|
|
949
|
+
let i = [];
|
|
950
|
+
if (!(o != null && o.length))
|
|
951
|
+
i = r;
|
|
952
|
+
else {
|
|
953
|
+
const l = [...o], u = [...r];
|
|
954
|
+
for (; u.length && l.length; ) {
|
|
955
|
+
const s = l.shift(), g = u.findIndex((d) => d.id === s);
|
|
956
|
+
g > -1 && i.push(u.splice(g, 1)[0]);
|
|
957
|
+
}
|
|
958
|
+
i = [...i, ...u];
|
|
959
|
+
}
|
|
960
|
+
return Bt(i, t, n);
|
|
961
|
+
}, C(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
962
|
+
}
|
|
963
|
+
}, X = () => ({
|
|
964
|
+
left: [],
|
|
965
|
+
right: []
|
|
966
|
+
}), qt = {
|
|
967
|
+
getInitialState: (e) => ({
|
|
968
|
+
columnPinning: X(),
|
|
969
|
+
...e
|
|
970
|
+
}),
|
|
971
|
+
getDefaultOptions: (e) => ({
|
|
972
|
+
onColumnPinningChange: $("columnPinning", e)
|
|
973
|
+
}),
|
|
974
|
+
createColumn: (e, o) => {
|
|
975
|
+
e.pin = (t) => {
|
|
976
|
+
const n = e.getLeafColumns().map((r) => r.id).filter(Boolean);
|
|
977
|
+
o.setColumnPinning((r) => {
|
|
978
|
+
var i, l;
|
|
979
|
+
if (t === "right") {
|
|
980
|
+
var u, s;
|
|
981
|
+
return {
|
|
982
|
+
left: ((u = r == null ? void 0 : r.left) != null ? u : []).filter((f) => !(n != null && n.includes(f))),
|
|
983
|
+
right: [...((s = r == null ? void 0 : r.right) != null ? s : []).filter((f) => !(n != null && n.includes(f))), ...n]
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
if (t === "left") {
|
|
987
|
+
var g, d;
|
|
988
|
+
return {
|
|
989
|
+
left: [...((g = r == null ? void 0 : r.left) != null ? g : []).filter((f) => !(n != null && n.includes(f))), ...n],
|
|
990
|
+
right: ((d = r == null ? void 0 : r.right) != null ? d : []).filter((f) => !(n != null && n.includes(f)))
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
left: ((i = r == null ? void 0 : r.left) != null ? i : []).filter((f) => !(n != null && n.includes(f))),
|
|
995
|
+
right: ((l = r == null ? void 0 : r.right) != null ? l : []).filter((f) => !(n != null && n.includes(f)))
|
|
996
|
+
};
|
|
997
|
+
});
|
|
998
|
+
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
999
|
+
var r, i, l;
|
|
1000
|
+
return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((i = (l = o.options.enableColumnPinning) != null ? l : o.options.enablePinning) != null ? i : !0);
|
|
1001
|
+
}), e.getIsPinned = () => {
|
|
1002
|
+
const t = e.getLeafColumns().map((u) => u.id), {
|
|
1003
|
+
left: n,
|
|
1004
|
+
right: r
|
|
1005
|
+
} = o.getState().columnPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
|
|
1006
|
+
return i ? "left" : l ? "right" : !1;
|
|
1007
|
+
}, e.getPinnedIndex = () => {
|
|
1008
|
+
var t, n;
|
|
1009
|
+
const r = e.getIsPinned();
|
|
1010
|
+
return r ? (t = (n = o.getState().columnPinning) == null || (n = n[r]) == null ? void 0 : n.indexOf(e.id)) != null ? t : -1 : 0;
|
|
1011
|
+
};
|
|
1012
|
+
},
|
|
1013
|
+
createRow: (e, o) => {
|
|
1014
|
+
e.getCenterVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
|
|
1015
|
+
const i = [...n ?? [], ...r ?? []];
|
|
1016
|
+
return t.filter((l) => !i.includes(l.column.id));
|
|
1017
|
+
}, C(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
|
|
1018
|
+
...i,
|
|
1019
|
+
position: "left"
|
|
1020
|
+
})), C(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((i) => t.find((l) => l.column.id === i)).filter(Boolean).map((i) => ({
|
|
1021
|
+
...i,
|
|
1022
|
+
position: "right"
|
|
1023
|
+
})), C(o.options, "debugRows", "getRightVisibleCells"));
|
|
1024
|
+
},
|
|
1025
|
+
createTable: (e) => {
|
|
1026
|
+
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
1027
|
+
var t, n;
|
|
1028
|
+
return e.setColumnPinning(o ? X() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : X());
|
|
1029
|
+
}, e.getIsSomeColumnsPinned = (o) => {
|
|
1030
|
+
var t;
|
|
1031
|
+
const n = e.getState().columnPinning;
|
|
1032
|
+
if (!o) {
|
|
1033
|
+
var r, i;
|
|
1034
|
+
return !!((r = n.left) != null && r.length || (i = n.right) != null && i.length);
|
|
1035
|
+
}
|
|
1036
|
+
return !!((t = n[o]) != null && t.length);
|
|
1037
|
+
}, e.getLeftLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), C(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
1038
|
+
const r = [...t ?? [], ...n ?? []];
|
|
1039
|
+
return o.filter((i) => !r.includes(i.id));
|
|
1040
|
+
}, C(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1041
|
+
}
|
|
1042
|
+
}, b = {
|
|
1043
|
+
size: 150,
|
|
1044
|
+
minSize: 20,
|
|
1045
|
+
maxSize: Number.MAX_SAFE_INTEGER
|
|
1046
|
+
}, W = () => ({
|
|
1047
|
+
startOffset: null,
|
|
1048
|
+
startSize: null,
|
|
1049
|
+
deltaOffset: null,
|
|
1050
|
+
deltaPercentage: null,
|
|
1051
|
+
isResizingColumn: !1,
|
|
1052
|
+
columnSizingStart: []
|
|
1053
|
+
}), Ut = {
|
|
1054
|
+
getDefaultColumnDef: () => b,
|
|
1055
|
+
getInitialState: (e) => ({
|
|
1056
|
+
columnSizing: {},
|
|
1057
|
+
columnSizingInfo: W(),
|
|
1058
|
+
...e
|
|
1059
|
+
}),
|
|
1060
|
+
getDefaultOptions: (e) => ({
|
|
1061
|
+
columnResizeMode: "onEnd",
|
|
1062
|
+
columnResizeDirection: "ltr",
|
|
1063
|
+
onColumnSizingChange: $("columnSizing", e),
|
|
1064
|
+
onColumnSizingInfoChange: $("columnSizingInfo", e)
|
|
1065
|
+
}),
|
|
1066
|
+
createColumn: (e, o) => {
|
|
1067
|
+
e.getSize = () => {
|
|
1068
|
+
var t, n, r;
|
|
1069
|
+
const i = o.getState().columnSizing[e.id];
|
|
1070
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : b.minSize, (n = i ?? e.columnDef.size) != null ? n : b.size), (r = e.columnDef.maxSize) != null ? r : b.maxSize);
|
|
1071
|
+
}, e.getStart = S((t) => [t, L(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getStart")), e.getAfter = S((t) => [t, L(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, i) => r + i.getSize(), 0), C(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
1072
|
+
o.setColumnSizing((t) => {
|
|
1073
|
+
let {
|
|
1074
|
+
[e.id]: n,
|
|
1075
|
+
...r
|
|
1076
|
+
} = t;
|
|
1077
|
+
return r;
|
|
1078
|
+
});
|
|
1079
|
+
}, e.getCanResize = () => {
|
|
1080
|
+
var t, n;
|
|
1081
|
+
return ((t = e.columnDef.enableResizing) != null ? t : !0) && ((n = o.options.enableColumnResizing) != null ? n : !0);
|
|
1082
|
+
}, e.getIsResizing = () => o.getState().columnSizingInfo.isResizingColumn === e.id;
|
|
1083
|
+
},
|
|
1084
|
+
createHeader: (e, o) => {
|
|
1085
|
+
e.getSize = () => {
|
|
1086
|
+
let t = 0;
|
|
1087
|
+
const n = (r) => {
|
|
1088
|
+
if (r.subHeaders.length)
|
|
1089
|
+
r.subHeaders.forEach(n);
|
|
1090
|
+
else {
|
|
1091
|
+
var i;
|
|
1092
|
+
t += (i = r.column.getSize()) != null ? i : 0;
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
return n(e), t;
|
|
1096
|
+
}, e.getStart = () => {
|
|
1097
|
+
if (e.index > 0) {
|
|
1098
|
+
const t = e.headerGroup.headers[e.index - 1];
|
|
1099
|
+
return t.getStart() + t.getSize();
|
|
1100
|
+
}
|
|
1101
|
+
return 0;
|
|
1102
|
+
}, e.getResizeHandler = (t) => {
|
|
1103
|
+
const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
|
|
1104
|
+
return (i) => {
|
|
1105
|
+
if (!n || !r || (i.persist == null || i.persist(), Y(i) && i.touches && i.touches.length > 1))
|
|
1106
|
+
return;
|
|
1107
|
+
const l = e.getSize(), u = e ? e.getLeafHeaders().map((v) => [v.column.id, v.column.getSize()]) : [[n.id, n.getSize()]], s = Y(i) ? Math.round(i.touches[0].clientX) : i.clientX, g = {}, d = (v, x) => {
|
|
1108
|
+
typeof x == "number" && (o.setColumnSizingInfo((_) => {
|
|
1109
|
+
var M, y;
|
|
1110
|
+
const G = o.options.columnResizeDirection === "rtl" ? -1 : 1, ce = (x - ((M = _ == null ? void 0 : _.startOffset) != null ? M : 0)) * G, fe = Math.max(ce / ((y = _ == null ? void 0 : _.startSize) != null ? y : 0), -0.999999);
|
|
1111
|
+
return _.columnSizingStart.forEach((Ke) => {
|
|
1112
|
+
let [Xe, pe] = Ke;
|
|
1113
|
+
g[Xe] = Math.round(Math.max(pe + pe * fe, 0) * 100) / 100;
|
|
1114
|
+
}), {
|
|
1115
|
+
..._,
|
|
1116
|
+
deltaOffset: ce,
|
|
1117
|
+
deltaPercentage: fe
|
|
1118
|
+
};
|
|
1119
|
+
}), (o.options.columnResizeMode === "onChange" || v === "end") && o.setColumnSizing((_) => ({
|
|
1120
|
+
..._,
|
|
1121
|
+
...g
|
|
1122
|
+
})));
|
|
1123
|
+
}, f = (v) => d("move", v), c = (v) => {
|
|
1124
|
+
d("end", v), o.setColumnSizingInfo((x) => ({
|
|
1125
|
+
...x,
|
|
1126
|
+
isResizingColumn: !1,
|
|
1127
|
+
startOffset: null,
|
|
1128
|
+
startSize: null,
|
|
1129
|
+
deltaOffset: null,
|
|
1130
|
+
deltaPercentage: null,
|
|
1131
|
+
columnSizingStart: []
|
|
1132
|
+
}));
|
|
1133
|
+
}, a = t || typeof document < "u" ? document : null, m = {
|
|
1134
|
+
moveHandler: (v) => f(v.clientX),
|
|
1135
|
+
upHandler: (v) => {
|
|
1136
|
+
a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), c(v.clientX);
|
|
1137
|
+
}
|
|
1138
|
+
}, h = {
|
|
1139
|
+
moveHandler: (v) => (v.cancelable && (v.preventDefault(), v.stopPropagation()), f(v.touches[0].clientX), !1),
|
|
1140
|
+
upHandler: (v) => {
|
|
1141
|
+
var x;
|
|
1142
|
+
a == null || a.removeEventListener("touchmove", h.moveHandler), a == null || a.removeEventListener("touchend", h.upHandler), v.cancelable && (v.preventDefault(), v.stopPropagation()), c((x = v.touches[0]) == null ? void 0 : x.clientX);
|
|
1143
|
+
}
|
|
1144
|
+
}, R = Kt() ? {
|
|
1145
|
+
passive: !1
|
|
1146
|
+
} : !1;
|
|
1147
|
+
Y(i) ? (a == null || a.addEventListener("touchmove", h.moveHandler, R), a == null || a.addEventListener("touchend", h.upHandler, R)) : (a == null || a.addEventListener("mousemove", m.moveHandler, R), a == null || a.addEventListener("mouseup", m.upHandler, R)), o.setColumnSizingInfo((v) => ({
|
|
1148
|
+
...v,
|
|
1149
|
+
startOffset: s,
|
|
1150
|
+
startSize: l,
|
|
1151
|
+
deltaOffset: 0,
|
|
1152
|
+
deltaPercentage: 0,
|
|
1153
|
+
columnSizingStart: u,
|
|
1154
|
+
isResizingColumn: n.id
|
|
1155
|
+
}));
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
},
|
|
1159
|
+
createTable: (e) => {
|
|
1160
|
+
e.setColumnSizing = (o) => e.options.onColumnSizingChange == null ? void 0 : e.options.onColumnSizingChange(o), e.setColumnSizingInfo = (o) => e.options.onColumnSizingInfoChange == null ? void 0 : e.options.onColumnSizingInfoChange(o), e.resetColumnSizing = (o) => {
|
|
1161
|
+
var t;
|
|
1162
|
+
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1163
|
+
}, e.resetHeaderSizeInfo = (o) => {
|
|
1164
|
+
var t;
|
|
1165
|
+
e.setColumnSizingInfo(o ? W() : (t = e.initialState.columnSizingInfo) != null ? t : W());
|
|
1166
|
+
}, e.getTotalSize = () => {
|
|
1167
|
+
var o, t;
|
|
1168
|
+
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
1169
|
+
}, e.getLeftTotalSize = () => {
|
|
1170
|
+
var o, t;
|
|
1171
|
+
return (o = (t = e.getLeftHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
1172
|
+
}, e.getCenterTotalSize = () => {
|
|
1173
|
+
var o, t;
|
|
1174
|
+
return (o = (t = e.getCenterHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
1175
|
+
}, e.getRightTotalSize = () => {
|
|
1176
|
+
var o, t;
|
|
1177
|
+
return (o = (t = e.getRightHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
let T = null;
|
|
1182
|
+
function Kt() {
|
|
1183
|
+
if (typeof T == "boolean") return T;
|
|
1184
|
+
let e = !1;
|
|
1185
|
+
try {
|
|
1186
|
+
const o = {
|
|
1187
|
+
get passive() {
|
|
1188
|
+
return e = !0, !1;
|
|
1189
|
+
}
|
|
1190
|
+
}, t = () => {
|
|
1191
|
+
};
|
|
1192
|
+
window.addEventListener("test", t, o), window.removeEventListener("test", t);
|
|
1193
|
+
} catch {
|
|
1194
|
+
e = !1;
|
|
1195
|
+
}
|
|
1196
|
+
return T = e, T;
|
|
1197
|
+
}
|
|
1198
|
+
function Y(e) {
|
|
1199
|
+
return e.type === "touchstart";
|
|
1200
|
+
}
|
|
1201
|
+
const Xt = {
|
|
1202
|
+
getInitialState: (e) => ({
|
|
1203
|
+
columnVisibility: {},
|
|
1204
|
+
...e
|
|
1205
|
+
}),
|
|
1206
|
+
getDefaultOptions: (e) => ({
|
|
1207
|
+
onColumnVisibilityChange: $("columnVisibility", e)
|
|
1208
|
+
}),
|
|
1209
|
+
createColumn: (e, o) => {
|
|
1210
|
+
e.toggleVisibility = (t) => {
|
|
1211
|
+
e.getCanHide() && o.setColumnVisibility((n) => ({
|
|
1212
|
+
...n,
|
|
1213
|
+
[e.id]: t ?? !e.getIsVisible()
|
|
1214
|
+
}));
|
|
1215
|
+
}, e.getIsVisible = () => {
|
|
1216
|
+
var t, n;
|
|
1217
|
+
const r = e.columns;
|
|
1218
|
+
return (t = r.length ? r.some((i) => i.getIsVisible()) : (n = o.getState().columnVisibility) == null ? void 0 : n[e.id]) != null ? t : !0;
|
|
1219
|
+
}, e.getCanHide = () => {
|
|
1220
|
+
var t, n;
|
|
1221
|
+
return ((t = e.columnDef.enableHiding) != null ? t : !0) && ((n = o.options.enableHiding) != null ? n : !0);
|
|
1222
|
+
}, e.getToggleVisibilityHandler = () => (t) => {
|
|
1223
|
+
e.toggleVisibility == null || e.toggleVisibility(t.target.checked);
|
|
1224
|
+
};
|
|
1225
|
+
},
|
|
1226
|
+
createRow: (e, o) => {
|
|
1227
|
+
e._getAllVisibleCells = S(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), C(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = S(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], C(o.options, "debugRows", "getVisibleCells"));
|
|
1228
|
+
},
|
|
1229
|
+
createTable: (e) => {
|
|
1230
|
+
const o = (t, n) => S(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((i) => i.getIsVisible == null ? void 0 : i.getIsVisible()), C(e.options, "debugColumns", t));
|
|
1231
|
+
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
1232
|
+
var n;
|
|
1233
|
+
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
1234
|
+
}, e.toggleAllColumnsVisible = (t) => {
|
|
1235
|
+
var n;
|
|
1236
|
+
t = (n = t) != null ? n : !e.getIsAllColumnsVisible(), e.setColumnVisibility(e.getAllLeafColumns().reduce((r, i) => ({
|
|
1237
|
+
...r,
|
|
1238
|
+
[i.id]: t || !(i.getCanHide != null && i.getCanHide())
|
|
1239
|
+
}), {}));
|
|
1240
|
+
}, 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) => {
|
|
1241
|
+
var n;
|
|
1242
|
+
e.toggleAllColumnsVisible((n = t.target) == null ? void 0 : n.checked);
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
function L(e, o) {
|
|
1247
|
+
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
1248
|
+
}
|
|
1249
|
+
const Wt = {
|
|
1250
|
+
createTable: (e) => {
|
|
1251
|
+
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 = () => {
|
|
1252
|
+
if (e._getGlobalFacetedMinMaxValues)
|
|
1253
|
+
return e._getGlobalFacetedMinMaxValues();
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
}, Yt = {
|
|
1257
|
+
getInitialState: (e) => ({
|
|
1258
|
+
globalFilter: void 0,
|
|
1259
|
+
...e
|
|
1260
|
+
}),
|
|
1261
|
+
getDefaultOptions: (e) => ({
|
|
1262
|
+
onGlobalFilterChange: $("globalFilter", e),
|
|
1263
|
+
globalFilterFn: "auto",
|
|
1264
|
+
getColumnCanGlobalFilter: (o) => {
|
|
1265
|
+
var t;
|
|
1266
|
+
const n = (t = e.getCoreRowModel().flatRows[0]) == null || (t = t._getAllCellsByColumnId()[o.id]) == null ? void 0 : t.getValue();
|
|
1267
|
+
return typeof n == "string" || typeof n == "number";
|
|
1268
|
+
}
|
|
1269
|
+
}),
|
|
1270
|
+
createColumn: (e, o) => {
|
|
1271
|
+
e.getCanGlobalFilter = () => {
|
|
1272
|
+
var t, n, r, i;
|
|
1273
|
+
return ((t = e.columnDef.enableGlobalFilter) != null ? t : !0) && ((n = o.options.enableGlobalFilter) != null ? n : !0) && ((r = o.options.enableFilters) != null ? r : !0) && ((i = o.options.getColumnCanGlobalFilter == null ? void 0 : o.options.getColumnCanGlobalFilter(e)) != null ? i : !0) && !!e.accessorFn;
|
|
1274
|
+
};
|
|
1275
|
+
},
|
|
1276
|
+
createTable: (e) => {
|
|
1277
|
+
e.getGlobalAutoFilterFn = () => I.includesString, e.getGlobalFilterFn = () => {
|
|
1278
|
+
var o, t;
|
|
1279
|
+
const {
|
|
1280
|
+
globalFilterFn: n
|
|
1281
|
+
} = e.options;
|
|
1282
|
+
return q(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : I[n];
|
|
1283
|
+
}, e.setGlobalFilter = (o) => {
|
|
1284
|
+
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
1285
|
+
}, e.resetGlobalFilter = (o) => {
|
|
1286
|
+
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
}, Jt = {
|
|
1290
|
+
getInitialState: (e) => ({
|
|
1291
|
+
expanded: {},
|
|
1292
|
+
...e
|
|
1293
|
+
}),
|
|
1294
|
+
getDefaultOptions: (e) => ({
|
|
1295
|
+
onExpandedChange: $("expanded", e),
|
|
1296
|
+
paginateExpandedRows: !0
|
|
1297
|
+
}),
|
|
1298
|
+
createTable: (e) => {
|
|
1299
|
+
let o = !1, t = !1;
|
|
1300
|
+
e._autoResetExpanded = () => {
|
|
1301
|
+
var n, r;
|
|
1302
|
+
if (!o) {
|
|
1303
|
+
e._queue(() => {
|
|
1304
|
+
o = !0;
|
|
1305
|
+
});
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetExpanded) != null ? n : !e.options.manualExpanding) {
|
|
1309
|
+
if (t) return;
|
|
1310
|
+
t = !0, e._queue(() => {
|
|
1311
|
+
e.resetExpanded(), t = !1;
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
}, e.setExpanded = (n) => e.options.onExpandedChange == null ? void 0 : e.options.onExpandedChange(n), e.toggleAllRowsExpanded = (n) => {
|
|
1315
|
+
n ?? !e.getIsAllRowsExpanded() ? e.setExpanded(!0) : e.setExpanded({});
|
|
1316
|
+
}, e.resetExpanded = (n) => {
|
|
1317
|
+
var r, i;
|
|
1318
|
+
e.setExpanded(n ? {} : (r = (i = e.initialState) == null ? void 0 : i.expanded) != null ? r : {});
|
|
1319
|
+
}, e.getCanSomeRowsExpand = () => e.getPrePaginationRowModel().flatRows.some((n) => n.getCanExpand()), e.getToggleAllRowsExpandedHandler = () => (n) => {
|
|
1320
|
+
n.persist == null || n.persist(), e.toggleAllRowsExpanded();
|
|
1321
|
+
}, e.getIsSomeRowsExpanded = () => {
|
|
1322
|
+
const n = e.getState().expanded;
|
|
1323
|
+
return n === !0 || Object.values(n).some(Boolean);
|
|
1324
|
+
}, e.getIsAllRowsExpanded = () => {
|
|
1325
|
+
const n = e.getState().expanded;
|
|
1326
|
+
return typeof n == "boolean" ? n === !0 : !(!Object.keys(n).length || e.getRowModel().flatRows.some((r) => !r.getIsExpanded()));
|
|
1327
|
+
}, e.getExpandedDepth = () => {
|
|
1328
|
+
let n = 0;
|
|
1329
|
+
return (e.getState().expanded === !0 ? Object.keys(e.getRowModel().rowsById) : Object.keys(e.getState().expanded)).forEach((i) => {
|
|
1330
|
+
const l = i.split(".");
|
|
1331
|
+
n = Math.max(n, l.length);
|
|
1332
|
+
}), n;
|
|
1333
|
+
}, 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());
|
|
1334
|
+
},
|
|
1335
|
+
createRow: (e, o) => {
|
|
1336
|
+
e.toggleExpanded = (t) => {
|
|
1337
|
+
o.setExpanded((n) => {
|
|
1338
|
+
var r;
|
|
1339
|
+
const i = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
1340
|
+
let l = {};
|
|
1341
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((u) => {
|
|
1342
|
+
l[u] = !0;
|
|
1343
|
+
}) : l = n, t = (r = t) != null ? r : !i, !i && t)
|
|
1344
|
+
return {
|
|
1345
|
+
...l,
|
|
1346
|
+
[e.id]: !0
|
|
1347
|
+
};
|
|
1348
|
+
if (i && !t) {
|
|
1349
|
+
const {
|
|
1350
|
+
[e.id]: u,
|
|
1351
|
+
...s
|
|
1352
|
+
} = l;
|
|
1353
|
+
return s;
|
|
1354
|
+
}
|
|
1355
|
+
return n;
|
|
1356
|
+
});
|
|
1357
|
+
}, e.getIsExpanded = () => {
|
|
1358
|
+
var t;
|
|
1359
|
+
const n = o.getState().expanded;
|
|
1360
|
+
return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
|
|
1361
|
+
}, e.getCanExpand = () => {
|
|
1362
|
+
var t, n, r;
|
|
1363
|
+
return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((r = e.subRows) != null && r.length);
|
|
1364
|
+
}, e.getIsAllParentsExpanded = () => {
|
|
1365
|
+
let t = !0, n = e;
|
|
1366
|
+
for (; t && n.parentId; )
|
|
1367
|
+
n = o.getRow(n.parentId, !0), t = n.getIsExpanded();
|
|
1368
|
+
return t;
|
|
1369
|
+
}, e.getToggleExpandedHandler = () => {
|
|
1370
|
+
const t = e.getCanExpand();
|
|
1371
|
+
return () => {
|
|
1372
|
+
t && e.toggleExpanded();
|
|
1373
|
+
};
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
}, te = 0, ne = 10, J = () => ({
|
|
1377
|
+
pageIndex: te,
|
|
1378
|
+
pageSize: ne
|
|
1379
|
+
}), Qt = {
|
|
1380
|
+
getInitialState: (e) => ({
|
|
1381
|
+
...e,
|
|
1382
|
+
pagination: {
|
|
1383
|
+
...J(),
|
|
1384
|
+
...e == null ? void 0 : e.pagination
|
|
1385
|
+
}
|
|
1386
|
+
}),
|
|
1387
|
+
getDefaultOptions: (e) => ({
|
|
1388
|
+
onPaginationChange: $("pagination", e)
|
|
1389
|
+
}),
|
|
1390
|
+
createTable: (e) => {
|
|
1391
|
+
let o = !1, t = !1;
|
|
1392
|
+
e._autoResetPageIndex = () => {
|
|
1393
|
+
var n, r;
|
|
1394
|
+
if (!o) {
|
|
1395
|
+
e._queue(() => {
|
|
1396
|
+
o = !0;
|
|
1397
|
+
});
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
if ((n = (r = e.options.autoResetAll) != null ? r : e.options.autoResetPageIndex) != null ? n : !e.options.manualPagination) {
|
|
1401
|
+
if (t) return;
|
|
1402
|
+
t = !0, e._queue(() => {
|
|
1403
|
+
e.resetPageIndex(), t = !1;
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
}, e.setPagination = (n) => {
|
|
1407
|
+
const r = (i) => A(n, i);
|
|
1408
|
+
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
|
|
1409
|
+
}, e.resetPagination = (n) => {
|
|
1410
|
+
var r;
|
|
1411
|
+
e.setPagination(n ? J() : (r = e.initialState.pagination) != null ? r : J());
|
|
1412
|
+
}, e.setPageIndex = (n) => {
|
|
1413
|
+
e.setPagination((r) => {
|
|
1414
|
+
let i = A(n, r.pageIndex);
|
|
1415
|
+
const l = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1416
|
+
return i = Math.max(0, Math.min(i, l)), {
|
|
1417
|
+
...r,
|
|
1418
|
+
pageIndex: i
|
|
1419
|
+
};
|
|
1420
|
+
});
|
|
1421
|
+
}, e.resetPageIndex = (n) => {
|
|
1422
|
+
var r, i;
|
|
1423
|
+
e.setPageIndex(n ? te : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageIndex) != null ? r : te);
|
|
1424
|
+
}, e.resetPageSize = (n) => {
|
|
1425
|
+
var r, i;
|
|
1426
|
+
e.setPageSize(n ? ne : (r = (i = e.initialState) == null || (i = i.pagination) == null ? void 0 : i.pageSize) != null ? r : ne);
|
|
1427
|
+
}, e.setPageSize = (n) => {
|
|
1428
|
+
e.setPagination((r) => {
|
|
1429
|
+
const i = Math.max(1, A(n, r.pageSize)), l = r.pageSize * r.pageIndex, u = Math.floor(l / i);
|
|
1430
|
+
return {
|
|
1431
|
+
...r,
|
|
1432
|
+
pageIndex: u,
|
|
1433
|
+
pageSize: i
|
|
1434
|
+
};
|
|
1435
|
+
});
|
|
1436
|
+
}, e.setPageCount = (n) => e.setPagination((r) => {
|
|
1437
|
+
var i;
|
|
1438
|
+
let l = A(n, (i = e.options.pageCount) != null ? i : -1);
|
|
1439
|
+
return typeof l == "number" && (l = Math.max(-1, l)), {
|
|
1440
|
+
...r,
|
|
1441
|
+
pageCount: l
|
|
1442
|
+
};
|
|
1443
|
+
}), e.getPageOptions = S(() => [e.getPageCount()], (n) => {
|
|
1444
|
+
let r = [];
|
|
1445
|
+
return n && n > 0 && (r = [...new Array(n)].fill(null).map((i, l) => l)), r;
|
|
1446
|
+
}, C(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1447
|
+
const {
|
|
1448
|
+
pageIndex: n
|
|
1449
|
+
} = e.getState().pagination, r = e.getPageCount();
|
|
1450
|
+
return r === -1 ? !0 : r === 0 ? !1 : n < r - 1;
|
|
1451
|
+
}, 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 = () => {
|
|
1452
|
+
var n;
|
|
1453
|
+
return (n = e.options.pageCount) != null ? n : Math.ceil(e.getRowCount() / e.getState().pagination.pageSize);
|
|
1454
|
+
}, e.getRowCount = () => {
|
|
1455
|
+
var n;
|
|
1456
|
+
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
}, Q = () => ({
|
|
1460
|
+
top: [],
|
|
1461
|
+
bottom: []
|
|
1462
|
+
}), Zt = {
|
|
1463
|
+
getInitialState: (e) => ({
|
|
1464
|
+
rowPinning: Q(),
|
|
1465
|
+
...e
|
|
1466
|
+
}),
|
|
1467
|
+
getDefaultOptions: (e) => ({
|
|
1468
|
+
onRowPinningChange: $("rowPinning", e)
|
|
1469
|
+
}),
|
|
1470
|
+
createRow: (e, o) => {
|
|
1471
|
+
e.pin = (t, n, r) => {
|
|
1472
|
+
const i = n ? e.getLeafRows().map((s) => {
|
|
1473
|
+
let {
|
|
1474
|
+
id: g
|
|
1475
|
+
} = s;
|
|
1476
|
+
return g;
|
|
1477
|
+
}) : [], l = r ? e.getParentRows().map((s) => {
|
|
1478
|
+
let {
|
|
1479
|
+
id: g
|
|
1480
|
+
} = s;
|
|
1481
|
+
return g;
|
|
1482
|
+
}) : [], u = /* @__PURE__ */ new Set([...l, e.id, ...i]);
|
|
1483
|
+
o.setRowPinning((s) => {
|
|
1484
|
+
var g, d;
|
|
1485
|
+
if (t === "bottom") {
|
|
1486
|
+
var f, c;
|
|
1487
|
+
return {
|
|
1488
|
+
top: ((f = s == null ? void 0 : s.top) != null ? f : []).filter((h) => !(u != null && u.has(h))),
|
|
1489
|
+
bottom: [...((c = s == null ? void 0 : s.bottom) != null ? c : []).filter((h) => !(u != null && u.has(h))), ...Array.from(u)]
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
if (t === "top") {
|
|
1493
|
+
var a, m;
|
|
1494
|
+
return {
|
|
1495
|
+
top: [...((a = s == null ? void 0 : s.top) != null ? a : []).filter((h) => !(u != null && u.has(h))), ...Array.from(u)],
|
|
1496
|
+
bottom: ((m = s == null ? void 0 : s.bottom) != null ? m : []).filter((h) => !(u != null && u.has(h)))
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
return {
|
|
1500
|
+
top: ((g = s == null ? void 0 : s.top) != null ? g : []).filter((h) => !(u != null && u.has(h))),
|
|
1501
|
+
bottom: ((d = s == null ? void 0 : s.bottom) != null ? d : []).filter((h) => !(u != null && u.has(h)))
|
|
1502
|
+
};
|
|
1503
|
+
});
|
|
1504
|
+
}, e.getCanPin = () => {
|
|
1505
|
+
var t;
|
|
1506
|
+
const {
|
|
1507
|
+
enableRowPinning: n,
|
|
1508
|
+
enablePinning: r
|
|
1509
|
+
} = o.options;
|
|
1510
|
+
return typeof n == "function" ? n(e) : (t = n ?? r) != null ? t : !0;
|
|
1511
|
+
}, e.getIsPinned = () => {
|
|
1512
|
+
const t = [e.id], {
|
|
1513
|
+
top: n,
|
|
1514
|
+
bottom: r
|
|
1515
|
+
} = o.getState().rowPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
|
|
1516
|
+
return i ? "top" : l ? "bottom" : !1;
|
|
1517
|
+
}, e.getPinnedIndex = () => {
|
|
1518
|
+
var t, n;
|
|
1519
|
+
const r = e.getIsPinned();
|
|
1520
|
+
if (!r) return -1;
|
|
1521
|
+
const i = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((l) => {
|
|
1522
|
+
let {
|
|
1523
|
+
id: u
|
|
1524
|
+
} = l;
|
|
1525
|
+
return u;
|
|
1526
|
+
});
|
|
1527
|
+
return (n = i == null ? void 0 : i.indexOf(e.id)) != null ? n : -1;
|
|
1528
|
+
};
|
|
1529
|
+
},
|
|
1530
|
+
createTable: (e) => {
|
|
1531
|
+
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1532
|
+
var t, n;
|
|
1533
|
+
return e.setRowPinning(o ? Q() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Q());
|
|
1534
|
+
}, e.getIsSomeRowsPinned = (o) => {
|
|
1535
|
+
var t;
|
|
1536
|
+
const n = e.getState().rowPinning;
|
|
1537
|
+
if (!o) {
|
|
1538
|
+
var r, i;
|
|
1539
|
+
return !!((r = n.top) != null && r.length || (i = n.bottom) != null && i.length);
|
|
1540
|
+
}
|
|
1541
|
+
return !!((t = n[o]) != null && t.length);
|
|
1542
|
+
}, e._getPinnedRows = (o, t, n) => {
|
|
1543
|
+
var r;
|
|
1544
|
+
return ((r = e.options.keepPinnedRows) == null || r ? (
|
|
1545
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
1546
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
1547
|
+
(t ?? []).map((l) => {
|
|
1548
|
+
const u = e.getRow(l, !0);
|
|
1549
|
+
return u.getIsAllParentsExpanded() ? u : null;
|
|
1550
|
+
})
|
|
1551
|
+
) : (
|
|
1552
|
+
//else get only visible rows that are pinned
|
|
1553
|
+
(t ?? []).map((l) => o.find((u) => u.id === l))
|
|
1554
|
+
)).filter(Boolean).map((l) => ({
|
|
1555
|
+
...l,
|
|
1556
|
+
position: n
|
|
1557
|
+
}));
|
|
1558
|
+
}, e.getTopRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), C(e.options, "debugRows", "getTopRows")), e.getBottomRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), C(e.options, "debugRows", "getBottomRows")), e.getCenterRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1559
|
+
const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1560
|
+
return o.filter((i) => !r.has(i.id));
|
|
1561
|
+
}, C(e.options, "debugRows", "getCenterRows"));
|
|
1562
|
+
}
|
|
1563
|
+
}, en = {
|
|
1564
|
+
getInitialState: (e) => ({
|
|
1565
|
+
rowSelection: {},
|
|
1566
|
+
...e
|
|
1567
|
+
}),
|
|
1568
|
+
getDefaultOptions: (e) => ({
|
|
1569
|
+
onRowSelectionChange: $("rowSelection", e),
|
|
1570
|
+
enableRowSelection: !0,
|
|
1571
|
+
enableMultiRowSelection: !0,
|
|
1572
|
+
enableSubRowSelection: !0
|
|
1573
|
+
// enableGroupingRowSelection: false,
|
|
1574
|
+
// isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
|
|
1575
|
+
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1576
|
+
}),
|
|
1577
|
+
createTable: (e) => {
|
|
1578
|
+
e.setRowSelection = (o) => e.options.onRowSelectionChange == null ? void 0 : e.options.onRowSelectionChange(o), e.resetRowSelection = (o) => {
|
|
1579
|
+
var t;
|
|
1580
|
+
return e.setRowSelection(o ? {} : (t = e.initialState.rowSelection) != null ? t : {});
|
|
1581
|
+
}, e.toggleAllRowsSelected = (o) => {
|
|
1582
|
+
e.setRowSelection((t) => {
|
|
1583
|
+
o = typeof o < "u" ? o : !e.getIsAllRowsSelected();
|
|
1584
|
+
const n = {
|
|
1585
|
+
...t
|
|
1586
|
+
}, r = e.getPreGroupedRowModel().flatRows;
|
|
1587
|
+
return o ? r.forEach((i) => {
|
|
1588
|
+
i.getCanSelect() && (n[i.id] = !0);
|
|
1589
|
+
}) : r.forEach((i) => {
|
|
1590
|
+
delete n[i.id];
|
|
1591
|
+
}), n;
|
|
1592
|
+
});
|
|
1593
|
+
}, e.toggleAllPageRowsSelected = (o) => e.setRowSelection((t) => {
|
|
1594
|
+
const n = typeof o < "u" ? o : !e.getIsAllPageRowsSelected(), r = {
|
|
1595
|
+
...t
|
|
1596
|
+
};
|
|
1597
|
+
return e.getRowModel().rows.forEach((i) => {
|
|
1598
|
+
oe(r, i.id, n, !0, e);
|
|
1599
|
+
}), r;
|
|
1600
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? Z(e, t) : {
|
|
1601
|
+
rows: [],
|
|
1602
|
+
flatRows: [],
|
|
1603
|
+
rowsById: {}
|
|
1604
|
+
}, C(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? Z(e, t) : {
|
|
1605
|
+
rows: [],
|
|
1606
|
+
flatRows: [],
|
|
1607
|
+
rowsById: {}
|
|
1608
|
+
}, C(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? Z(e, t) : {
|
|
1609
|
+
rows: [],
|
|
1610
|
+
flatRows: [],
|
|
1611
|
+
rowsById: {}
|
|
1612
|
+
}, C(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1613
|
+
const o = e.getFilteredRowModel().flatRows, {
|
|
1614
|
+
rowSelection: t
|
|
1615
|
+
} = e.getState();
|
|
1616
|
+
let n = !!(o.length && Object.keys(t).length);
|
|
1617
|
+
return n && o.some((r) => r.getCanSelect() && !t[r.id]) && (n = !1), n;
|
|
1618
|
+
}, e.getIsAllPageRowsSelected = () => {
|
|
1619
|
+
const o = e.getPaginationRowModel().flatRows.filter((r) => r.getCanSelect()), {
|
|
1620
|
+
rowSelection: t
|
|
1621
|
+
} = e.getState();
|
|
1622
|
+
let n = !!o.length;
|
|
1623
|
+
return n && o.some((r) => !t[r.id]) && (n = !1), n;
|
|
1624
|
+
}, e.getIsSomeRowsSelected = () => {
|
|
1625
|
+
var o;
|
|
1626
|
+
const t = Object.keys((o = e.getState().rowSelection) != null ? o : {}).length;
|
|
1627
|
+
return t > 0 && t < e.getFilteredRowModel().flatRows.length;
|
|
1628
|
+
}, e.getIsSomePageRowsSelected = () => {
|
|
1629
|
+
const o = e.getPaginationRowModel().flatRows;
|
|
1630
|
+
return e.getIsAllPageRowsSelected() ? !1 : o.filter((t) => t.getCanSelect()).some((t) => t.getIsSelected() || t.getIsSomeSelected());
|
|
1631
|
+
}, e.getToggleAllRowsSelectedHandler = () => (o) => {
|
|
1632
|
+
e.toggleAllRowsSelected(o.target.checked);
|
|
1633
|
+
}, e.getToggleAllPageRowsSelectedHandler = () => (o) => {
|
|
1634
|
+
e.toggleAllPageRowsSelected(o.target.checked);
|
|
1635
|
+
};
|
|
1636
|
+
},
|
|
1637
|
+
createRow: (e, o) => {
|
|
1638
|
+
e.toggleSelected = (t, n) => {
|
|
1639
|
+
const r = e.getIsSelected();
|
|
1640
|
+
o.setRowSelection((i) => {
|
|
1641
|
+
var l;
|
|
1642
|
+
if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
|
|
1643
|
+
return i;
|
|
1644
|
+
const u = {
|
|
1645
|
+
...i
|
|
1646
|
+
};
|
|
1647
|
+
return oe(u, e.id, t, (l = n == null ? void 0 : n.selectChildren) != null ? l : !0, o), u;
|
|
1648
|
+
});
|
|
1649
|
+
}, e.getIsSelected = () => {
|
|
1650
|
+
const {
|
|
1651
|
+
rowSelection: t
|
|
1652
|
+
} = o.getState();
|
|
1653
|
+
return ge(e, t);
|
|
1654
|
+
}, e.getIsSomeSelected = () => {
|
|
1655
|
+
const {
|
|
1656
|
+
rowSelection: t
|
|
1657
|
+
} = o.getState();
|
|
1658
|
+
return re(e, t) === "some";
|
|
1659
|
+
}, e.getIsAllSubRowsSelected = () => {
|
|
1660
|
+
const {
|
|
1661
|
+
rowSelection: t
|
|
1662
|
+
} = o.getState();
|
|
1663
|
+
return re(e, t) === "all";
|
|
1664
|
+
}, e.getCanSelect = () => {
|
|
1665
|
+
var t;
|
|
1666
|
+
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
1667
|
+
}, e.getCanSelectSubRows = () => {
|
|
1668
|
+
var t;
|
|
1669
|
+
return typeof o.options.enableSubRowSelection == "function" ? o.options.enableSubRowSelection(e) : (t = o.options.enableSubRowSelection) != null ? t : !0;
|
|
1670
|
+
}, e.getCanMultiSelect = () => {
|
|
1671
|
+
var t;
|
|
1672
|
+
return typeof o.options.enableMultiRowSelection == "function" ? o.options.enableMultiRowSelection(e) : (t = o.options.enableMultiRowSelection) != null ? t : !0;
|
|
1673
|
+
}, e.getToggleSelectedHandler = () => {
|
|
1674
|
+
const t = e.getCanSelect();
|
|
1675
|
+
return (n) => {
|
|
1676
|
+
var r;
|
|
1677
|
+
t && e.toggleSelected((r = n.target) == null ? void 0 : r.checked);
|
|
1678
|
+
};
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
}, oe = (e, o, t, n, r) => {
|
|
1682
|
+
var i;
|
|
1683
|
+
const l = r.getRow(o, !0);
|
|
1684
|
+
t ? (l.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), l.getCanSelect() && (e[o] = !0)) : delete e[o], n && (i = l.subRows) != null && i.length && l.getCanSelectSubRows() && l.subRows.forEach((u) => oe(e, u.id, t, n, r));
|
|
1685
|
+
};
|
|
1686
|
+
function Z(e, o) {
|
|
1687
|
+
const t = e.getState().rowSelection, n = [], r = {}, i = function(l, u) {
|
|
1688
|
+
return l.map((s) => {
|
|
1689
|
+
var g;
|
|
1690
|
+
const d = ge(s, t);
|
|
1691
|
+
if (d && (n.push(s), r[s.id] = s), (g = s.subRows) != null && g.length && (s = {
|
|
1692
|
+
...s,
|
|
1693
|
+
subRows: i(s.subRows)
|
|
1694
|
+
}), d)
|
|
1695
|
+
return s;
|
|
1696
|
+
}).filter(Boolean);
|
|
1697
|
+
};
|
|
1698
|
+
return {
|
|
1699
|
+
rows: i(o.rows),
|
|
1700
|
+
flatRows: n,
|
|
1701
|
+
rowsById: r
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
function ge(e, o) {
|
|
1705
|
+
var t;
|
|
1706
|
+
return (t = o[e.id]) != null ? t : !1;
|
|
1707
|
+
}
|
|
1708
|
+
function re(e, o, t) {
|
|
1709
|
+
var n;
|
|
1710
|
+
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
1711
|
+
let r = !0, i = !1;
|
|
1712
|
+
return e.subRows.forEach((l) => {
|
|
1713
|
+
if (!(i && !r) && (l.getCanSelect() && (ge(l, o) ? i = !0 : r = !1), l.subRows && l.subRows.length)) {
|
|
1714
|
+
const u = re(l, o);
|
|
1715
|
+
u === "all" ? i = !0 : (u === "some" && (i = !0), r = !1);
|
|
1716
|
+
}
|
|
1717
|
+
}), r ? "all" : i ? "some" : !1;
|
|
1718
|
+
}
|
|
1719
|
+
const ie = /([0-9]+)/gm, tn = (e, o, t) => qe(H(e.getValue(t)).toLowerCase(), H(o.getValue(t)).toLowerCase()), nn = (e, o, t) => qe(H(e.getValue(t)), H(o.getValue(t))), on = (e, o, t) => de(H(e.getValue(t)).toLowerCase(), H(o.getValue(t)).toLowerCase()), rn = (e, o, t) => de(H(e.getValue(t)), H(o.getValue(t))), ln = (e, o, t) => {
|
|
1720
|
+
const n = e.getValue(t), r = o.getValue(t);
|
|
1721
|
+
return n > r ? 1 : n < r ? -1 : 0;
|
|
1722
|
+
}, un = (e, o, t) => de(e.getValue(t), o.getValue(t));
|
|
1723
|
+
function de(e, o) {
|
|
1724
|
+
return e === o ? 0 : e > o ? 1 : -1;
|
|
1725
|
+
}
|
|
1726
|
+
function H(e) {
|
|
1727
|
+
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
1728
|
+
}
|
|
1729
|
+
function qe(e, o) {
|
|
1730
|
+
const t = e.split(ie).filter(Boolean), n = o.split(ie).filter(Boolean);
|
|
1731
|
+
for (; t.length && n.length; ) {
|
|
1732
|
+
const r = t.shift(), i = n.shift(), l = parseInt(r, 10), u = parseInt(i, 10), s = [l, u].sort();
|
|
1733
|
+
if (isNaN(s[0])) {
|
|
1734
|
+
if (r > i)
|
|
1735
|
+
return 1;
|
|
1736
|
+
if (i > r)
|
|
1737
|
+
return -1;
|
|
1738
|
+
continue;
|
|
1739
|
+
}
|
|
1740
|
+
if (isNaN(s[1]))
|
|
1741
|
+
return isNaN(l) ? -1 : 1;
|
|
1742
|
+
if (l > u)
|
|
1743
|
+
return 1;
|
|
1744
|
+
if (u > l)
|
|
1745
|
+
return -1;
|
|
1746
|
+
}
|
|
1747
|
+
return t.length - n.length;
|
|
1748
|
+
}
|
|
1749
|
+
const j = {
|
|
1750
|
+
alphanumeric: tn,
|
|
1751
|
+
alphanumericCaseSensitive: nn,
|
|
1752
|
+
text: on,
|
|
1753
|
+
textCaseSensitive: rn,
|
|
1754
|
+
datetime: ln,
|
|
1755
|
+
basic: un
|
|
1756
|
+
}, sn = {
|
|
1757
|
+
getInitialState: (e) => ({
|
|
1758
|
+
sorting: [],
|
|
1759
|
+
...e
|
|
1760
|
+
}),
|
|
1761
|
+
getDefaultColumnDef: () => ({
|
|
1762
|
+
sortingFn: "auto",
|
|
1763
|
+
sortUndefined: 1
|
|
1764
|
+
}),
|
|
1765
|
+
getDefaultOptions: (e) => ({
|
|
1766
|
+
onSortingChange: $("sorting", e),
|
|
1767
|
+
isMultiSortEvent: (o) => o.shiftKey
|
|
1768
|
+
}),
|
|
1769
|
+
createColumn: (e, o) => {
|
|
1770
|
+
e.getAutoSortingFn = () => {
|
|
1771
|
+
const t = o.getFilteredRowModel().flatRows.slice(10);
|
|
1772
|
+
let n = !1;
|
|
1773
|
+
for (const r of t) {
|
|
1774
|
+
const i = r == null ? void 0 : r.getValue(e.id);
|
|
1775
|
+
if (Object.prototype.toString.call(i) === "[object Date]")
|
|
1776
|
+
return j.datetime;
|
|
1777
|
+
if (typeof i == "string" && (n = !0, i.split(ie).length > 1))
|
|
1778
|
+
return j.alphanumeric;
|
|
1779
|
+
}
|
|
1780
|
+
return n ? j.text : j.basic;
|
|
1781
|
+
}, e.getAutoSortDir = () => {
|
|
1782
|
+
const t = o.getFilteredRowModel().flatRows[0];
|
|
1783
|
+
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
1784
|
+
}, e.getSortingFn = () => {
|
|
1785
|
+
var t, n;
|
|
1786
|
+
if (!e)
|
|
1787
|
+
throw new Error();
|
|
1788
|
+
return q(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : j[e.columnDef.sortingFn];
|
|
1789
|
+
}, e.toggleSorting = (t, n) => {
|
|
1790
|
+
const r = e.getNextSortingOrder(), i = typeof t < "u" && t !== null;
|
|
1791
|
+
o.setSorting((l) => {
|
|
1792
|
+
const u = l == null ? void 0 : l.find((a) => a.id === e.id), s = l == null ? void 0 : l.findIndex((a) => a.id === e.id);
|
|
1793
|
+
let g = [], d, f = i ? t : r === "desc";
|
|
1794
|
+
if (l != null && l.length && e.getCanMultiSort() && n ? u ? d = "toggle" : d = "add" : l != null && l.length && s !== l.length - 1 ? d = "replace" : u ? d = "toggle" : d = "replace", d === "toggle" && (i || r || (d = "remove")), d === "add") {
|
|
1795
|
+
var c;
|
|
1796
|
+
g = [...l, {
|
|
1797
|
+
id: e.id,
|
|
1798
|
+
desc: f
|
|
1799
|
+
}], g.splice(0, g.length - ((c = o.options.maxMultiSortColCount) != null ? c : Number.MAX_SAFE_INTEGER));
|
|
1800
|
+
} else d === "toggle" ? g = l.map((a) => a.id === e.id ? {
|
|
1801
|
+
...a,
|
|
1802
|
+
desc: f
|
|
1803
|
+
} : a) : d === "remove" ? g = l.filter((a) => a.id !== e.id) : g = [{
|
|
1804
|
+
id: e.id,
|
|
1805
|
+
desc: f
|
|
1806
|
+
}];
|
|
1807
|
+
return g;
|
|
1808
|
+
});
|
|
1809
|
+
}, e.getFirstSortDir = () => {
|
|
1810
|
+
var t, n;
|
|
1811
|
+
return ((t = (n = e.columnDef.sortDescFirst) != null ? n : o.options.sortDescFirst) != null ? t : e.getAutoSortDir() === "desc") ? "desc" : "asc";
|
|
1812
|
+
}, e.getNextSortingOrder = (t) => {
|
|
1813
|
+
var n, r;
|
|
1814
|
+
const i = e.getFirstSortDir(), l = e.getIsSorted();
|
|
1815
|
+
return l ? l !== i && ((n = o.options.enableSortingRemoval) == null || n) && // If enableSortRemove, enable in general
|
|
1816
|
+
(!(t && (r = o.options.enableMultiRemove) != null) || r) ? !1 : l === "desc" ? "asc" : "desc" : i;
|
|
1817
|
+
}, e.getCanSort = () => {
|
|
1818
|
+
var t, n;
|
|
1819
|
+
return ((t = e.columnDef.enableSorting) != null ? t : !0) && ((n = o.options.enableSorting) != null ? n : !0) && !!e.accessorFn;
|
|
1820
|
+
}, e.getCanMultiSort = () => {
|
|
1821
|
+
var t, n;
|
|
1822
|
+
return (t = (n = e.columnDef.enableMultiSort) != null ? n : o.options.enableMultiSort) != null ? t : !!e.accessorFn;
|
|
1823
|
+
}, e.getIsSorted = () => {
|
|
1824
|
+
var t;
|
|
1825
|
+
const n = (t = o.getState().sorting) == null ? void 0 : t.find((r) => r.id === e.id);
|
|
1826
|
+
return n ? n.desc ? "desc" : "asc" : !1;
|
|
1827
|
+
}, e.getSortIndex = () => {
|
|
1828
|
+
var t, n;
|
|
1829
|
+
return (t = (n = o.getState().sorting) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
1830
|
+
}, e.clearSorting = () => {
|
|
1831
|
+
o.setSorting((t) => t != null && t.length ? t.filter((n) => n.id !== e.id) : []);
|
|
1832
|
+
}, e.getToggleSortingHandler = () => {
|
|
1833
|
+
const t = e.getCanSort();
|
|
1834
|
+
return (n) => {
|
|
1835
|
+
t && (n.persist == null || n.persist(), e.toggleSorting == null || e.toggleSorting(void 0, e.getCanMultiSort() ? o.options.isMultiSortEvent == null ? void 0 : o.options.isMultiSortEvent(n) : !1));
|
|
1836
|
+
};
|
|
1837
|
+
};
|
|
1838
|
+
},
|
|
1839
|
+
createTable: (e) => {
|
|
1840
|
+
e.setSorting = (o) => e.options.onSortingChange == null ? void 0 : e.options.onSortingChange(o), e.resetSorting = (o) => {
|
|
1841
|
+
var t, n;
|
|
1842
|
+
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
1843
|
+
}, 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());
|
|
1844
|
+
}
|
|
1845
|
+
}, an = [
|
|
1846
|
+
Pt,
|
|
1847
|
+
Xt,
|
|
1848
|
+
kt,
|
|
1849
|
+
qt,
|
|
1850
|
+
Dt,
|
|
1851
|
+
Et,
|
|
1852
|
+
Wt,
|
|
1853
|
+
//depends on ColumnFaceting
|
|
1854
|
+
Yt,
|
|
1855
|
+
//depends on ColumnFiltering
|
|
1856
|
+
sn,
|
|
1857
|
+
Ot,
|
|
1858
|
+
//depends on RowSorting
|
|
1859
|
+
Jt,
|
|
1860
|
+
Qt,
|
|
1861
|
+
Zt,
|
|
1862
|
+
en,
|
|
1863
|
+
Ut
|
|
1864
|
+
];
|
|
1865
|
+
function gn(e) {
|
|
1866
|
+
var o, t;
|
|
1867
|
+
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
1868
|
+
const n = [...an, ...(o = e._features) != null ? o : []];
|
|
1869
|
+
let r = {
|
|
1870
|
+
_features: n
|
|
1871
|
+
};
|
|
1872
|
+
const i = r._features.reduce((c, a) => Object.assign(c, a.getDefaultOptions == null ? void 0 : a.getDefaultOptions(r)), {}), l = (c) => r.options.mergeOptions ? r.options.mergeOptions(i, c) : {
|
|
1873
|
+
...i,
|
|
1874
|
+
...c
|
|
1875
|
+
};
|
|
1876
|
+
let s = {
|
|
1877
|
+
...{},
|
|
1878
|
+
...(t = e.initialState) != null ? t : {}
|
|
1879
|
+
};
|
|
1880
|
+
r._features.forEach((c) => {
|
|
1881
|
+
var a;
|
|
1882
|
+
s = (a = c.getInitialState == null ? void 0 : c.getInitialState(s)) != null ? a : s;
|
|
1883
|
+
});
|
|
1884
|
+
const g = [];
|
|
1885
|
+
let d = !1;
|
|
1886
|
+
const f = {
|
|
1887
|
+
_features: n,
|
|
1888
|
+
options: {
|
|
1889
|
+
...i,
|
|
1890
|
+
...e
|
|
1891
|
+
},
|
|
1892
|
+
initialState: s,
|
|
1893
|
+
_queue: (c) => {
|
|
1894
|
+
g.push(c), d || (d = !0, Promise.resolve().then(() => {
|
|
1895
|
+
for (; g.length; )
|
|
1896
|
+
g.shift()();
|
|
1897
|
+
d = !1;
|
|
1898
|
+
}).catch((a) => setTimeout(() => {
|
|
1899
|
+
throw a;
|
|
1900
|
+
})));
|
|
1901
|
+
},
|
|
1902
|
+
reset: () => {
|
|
1903
|
+
r.setState(r.initialState);
|
|
1904
|
+
},
|
|
1905
|
+
setOptions: (c) => {
|
|
1906
|
+
const a = A(c, r.options);
|
|
1907
|
+
r.options = l(a);
|
|
1908
|
+
},
|
|
1909
|
+
getState: () => r.options.state,
|
|
1910
|
+
setState: (c) => {
|
|
1911
|
+
r.options.onStateChange == null || r.options.onStateChange(c);
|
|
1912
|
+
},
|
|
1913
|
+
_getRowId: (c, a, m) => {
|
|
1914
|
+
var h;
|
|
1915
|
+
return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(c, a, m)) != null ? h : `${m ? [m.id, a].join(".") : a}`;
|
|
1916
|
+
},
|
|
1917
|
+
getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
|
|
1918
|
+
// The final calls start at the bottom of the model,
|
|
1919
|
+
// expanded rows, which then work their way up
|
|
1920
|
+
getRowModel: () => r.getPaginationRowModel(),
|
|
1921
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1922
|
+
getRow: (c, a) => {
|
|
1923
|
+
let m = (a ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[c];
|
|
1924
|
+
if (!m && (m = r.getCoreRowModel().rowsById[c], !m))
|
|
1925
|
+
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${c}`) : new Error();
|
|
1926
|
+
return m;
|
|
1927
|
+
},
|
|
1928
|
+
_getDefaultColumnDef: S(() => [r.options.defaultColumn], (c) => {
|
|
1929
|
+
var a;
|
|
1930
|
+
return c = (a = c) != null ? a : {}, {
|
|
1931
|
+
header: (m) => {
|
|
1932
|
+
const h = m.header.column.columnDef;
|
|
1933
|
+
return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
|
|
1934
|
+
},
|
|
1935
|
+
// footer: props => props.header.column.id,
|
|
1936
|
+
cell: (m) => {
|
|
1937
|
+
var h, R;
|
|
1938
|
+
return (h = (R = m.renderValue()) == null || R.toString == null ? void 0 : R.toString()) != null ? h : null;
|
|
1939
|
+
},
|
|
1940
|
+
...r._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
|
|
1941
|
+
...c
|
|
1942
|
+
};
|
|
1943
|
+
}, C(e, "debugColumns", "_getDefaultColumnDef")),
|
|
1944
|
+
_getColumnDefs: () => r.options.columns,
|
|
1945
|
+
getAllColumns: S(() => [r._getColumnDefs()], (c) => {
|
|
1946
|
+
const a = function(m, h, R) {
|
|
1947
|
+
return R === void 0 && (R = 0), m.map((v) => {
|
|
1948
|
+
const x = It(r, v, R, h), _ = v;
|
|
1949
|
+
return x.columns = _.columns ? a(_.columns, x, R + 1) : [], x;
|
|
1950
|
+
});
|
|
1951
|
+
};
|
|
1952
|
+
return a(c);
|
|
1953
|
+
}, C(e, "debugColumns", "getAllColumns")),
|
|
1954
|
+
getAllFlatColumns: S(() => [r.getAllColumns()], (c) => c.flatMap((a) => a.getFlatColumns()), C(e, "debugColumns", "getAllFlatColumns")),
|
|
1955
|
+
_getAllFlatColumnsById: S(() => [r.getAllFlatColumns()], (c) => c.reduce((a, m) => (a[m.id] = m, a), {}), C(e, "debugColumns", "getAllFlatColumnsById")),
|
|
1956
|
+
getAllLeafColumns: S(() => [r.getAllColumns(), r._getOrderColumnsFn()], (c, a) => {
|
|
1957
|
+
let m = c.flatMap((h) => h.getLeafColumns());
|
|
1958
|
+
return a(m);
|
|
1959
|
+
}, C(e, "debugColumns", "getAllLeafColumns")),
|
|
1960
|
+
getColumn: (c) => {
|
|
1961
|
+
const a = r._getAllFlatColumnsById()[c];
|
|
1962
|
+
return process.env.NODE_ENV !== "production" && !a && console.error(`[Table] Column with id '${c}' does not exist.`), a;
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
Object.assign(r, f);
|
|
1966
|
+
for (let c = 0; c < r._features.length; c++) {
|
|
1967
|
+
const a = r._features[c];
|
|
1968
|
+
a == null || a.createTable == null || a.createTable(r);
|
|
1969
|
+
}
|
|
1970
|
+
return r;
|
|
1971
|
+
}
|
|
1972
|
+
function dn() {
|
|
1973
|
+
return (e) => S(() => [e.options.data], (o) => {
|
|
1974
|
+
const t = {
|
|
1975
|
+
rows: [],
|
|
1976
|
+
flatRows: [],
|
|
1977
|
+
rowsById: {}
|
|
1978
|
+
}, n = function(r, i, l) {
|
|
1979
|
+
i === void 0 && (i = 0);
|
|
1980
|
+
const u = [];
|
|
1981
|
+
for (let g = 0; g < r.length; g++) {
|
|
1982
|
+
const d = se(e, e._getRowId(r[g], g, l), r[g], g, i, void 0, l == null ? void 0 : l.id);
|
|
1983
|
+
if (t.flatRows.push(d), t.rowsById[d.id] = d, u.push(d), e.options.getSubRows) {
|
|
1984
|
+
var s;
|
|
1985
|
+
d.originalSubRows = e.options.getSubRows(r[g], g), (s = d.originalSubRows) != null && s.length && (d.subRows = n(d.originalSubRows, i + 1, d));
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
return u;
|
|
1989
|
+
};
|
|
1990
|
+
return t.rows = n(o), t;
|
|
1991
|
+
}, C(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
1992
|
+
}
|
|
1993
|
+
function cn(e) {
|
|
1994
|
+
const o = [], t = (n) => {
|
|
1995
|
+
var r;
|
|
1996
|
+
o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
1997
|
+
};
|
|
1998
|
+
return e.rows.forEach(t), {
|
|
1999
|
+
rows: o,
|
|
2000
|
+
flatRows: e.flatRows,
|
|
2001
|
+
rowsById: e.rowsById
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
function Ue(e, o, t) {
|
|
2005
|
+
return t.options.filterFromLeafRows ? fn(e, o, t) : pn(e, o, t);
|
|
2006
|
+
}
|
|
2007
|
+
function fn(e, o, t) {
|
|
2008
|
+
var n;
|
|
2009
|
+
const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(s, g) {
|
|
2010
|
+
g === void 0 && (g = 0);
|
|
2011
|
+
const d = [];
|
|
2012
|
+
for (let c = 0; c < s.length; c++) {
|
|
2013
|
+
var f;
|
|
2014
|
+
let a = s[c];
|
|
2015
|
+
const m = se(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2016
|
+
if (m.columnFilters = a.columnFilters, (f = a.subRows) != null && f.length && g < l) {
|
|
2017
|
+
if (m.subRows = u(a.subRows, g + 1), a = m, o(a) && !m.subRows.length) {
|
|
2018
|
+
d.push(a), i[a.id] = a, r.push(a);
|
|
2019
|
+
continue;
|
|
2020
|
+
}
|
|
2021
|
+
if (o(a) || m.subRows.length) {
|
|
2022
|
+
d.push(a), i[a.id] = a, r.push(a);
|
|
2023
|
+
continue;
|
|
2024
|
+
}
|
|
2025
|
+
} else
|
|
2026
|
+
a = m, o(a) && (d.push(a), i[a.id] = a, r.push(a));
|
|
2027
|
+
}
|
|
2028
|
+
return d;
|
|
2029
|
+
};
|
|
2030
|
+
return {
|
|
2031
|
+
rows: u(e),
|
|
2032
|
+
flatRows: r,
|
|
2033
|
+
rowsById: i
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
function pn(e, o, t) {
|
|
2037
|
+
var n;
|
|
2038
|
+
const r = [], i = {}, l = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(s, g) {
|
|
2039
|
+
g === void 0 && (g = 0);
|
|
2040
|
+
const d = [];
|
|
2041
|
+
for (let c = 0; c < s.length; c++) {
|
|
2042
|
+
let a = s[c];
|
|
2043
|
+
if (o(a)) {
|
|
2044
|
+
var f;
|
|
2045
|
+
if ((f = a.subRows) != null && f.length && g < l) {
|
|
2046
|
+
const h = se(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2047
|
+
h.subRows = u(a.subRows, g + 1), a = h;
|
|
2048
|
+
}
|
|
2049
|
+
d.push(a), r.push(a), i[a.id] = a;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
return d;
|
|
2053
|
+
};
|
|
2054
|
+
return {
|
|
2055
|
+
rows: u(e),
|
|
2056
|
+
flatRows: r,
|
|
2057
|
+
rowsById: i
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
function mn() {
|
|
2061
|
+
return (e, o) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter, e.getFilteredRowModel()], (t, n, r) => {
|
|
2062
|
+
if (!t.rows.length || !(n != null && n.length) && !r)
|
|
2063
|
+
return t;
|
|
2064
|
+
const i = [...n.map((u) => u.id).filter((u) => u !== o), r ? "__global__" : void 0].filter(Boolean), l = (u) => {
|
|
2065
|
+
for (let s = 0; s < i.length; s++)
|
|
2066
|
+
if (u.columnFilters[i[s]] === !1)
|
|
2067
|
+
return !1;
|
|
2068
|
+
return !0;
|
|
2069
|
+
};
|
|
2070
|
+
return Ue(t.rows, l, e);
|
|
2071
|
+
}, C(e.options, "debugTable", "getFacetedRowModel"));
|
|
2072
|
+
}
|
|
2073
|
+
function hn() {
|
|
2074
|
+
return (e, o) => S(() => {
|
|
2075
|
+
var t;
|
|
2076
|
+
return [(t = e.getColumn(o)) == null ? void 0 : t.getFacetedRowModel()];
|
|
2077
|
+
}, (t) => {
|
|
2078
|
+
if (!t) return /* @__PURE__ */ new Map();
|
|
2079
|
+
let n = /* @__PURE__ */ new Map();
|
|
2080
|
+
for (let i = 0; i < t.flatRows.length; i++) {
|
|
2081
|
+
const l = t.flatRows[i].getUniqueValues(o);
|
|
2082
|
+
for (let u = 0; u < l.length; u++) {
|
|
2083
|
+
const s = l[u];
|
|
2084
|
+
if (n.has(s)) {
|
|
2085
|
+
var r;
|
|
2086
|
+
n.set(s, ((r = n.get(s)) != null ? r : 0) + 1);
|
|
2087
|
+
} else
|
|
2088
|
+
n.set(s, 1);
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
return n;
|
|
2092
|
+
}, C(e.options, "debugTable", `getFacetedUniqueValues_${o}`));
|
|
2093
|
+
}
|
|
2094
|
+
function Sn() {
|
|
2095
|
+
return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2096
|
+
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2097
|
+
for (let c = 0; c < o.flatRows.length; c++)
|
|
2098
|
+
o.flatRows[c].columnFilters = {}, o.flatRows[c].columnFiltersMeta = {};
|
|
2099
|
+
return o;
|
|
2100
|
+
}
|
|
2101
|
+
const r = [], i = [];
|
|
2102
|
+
(t ?? []).forEach((c) => {
|
|
2103
|
+
var a;
|
|
2104
|
+
const m = e.getColumn(c.id);
|
|
2105
|
+
if (!m)
|
|
2106
|
+
return;
|
|
2107
|
+
const h = m.getFilterFn();
|
|
2108
|
+
if (!h) {
|
|
2109
|
+
process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);
|
|
2110
|
+
return;
|
|
2111
|
+
}
|
|
2112
|
+
r.push({
|
|
2113
|
+
id: c.id,
|
|
2114
|
+
filterFn: h,
|
|
2115
|
+
resolvedValue: (a = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(c.value)) != null ? a : c.value
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
const l = (t ?? []).map((c) => c.id), u = e.getGlobalFilterFn(), s = e.getAllLeafColumns().filter((c) => c.getCanGlobalFilter());
|
|
2119
|
+
n && u && s.length && (l.push("__global__"), s.forEach((c) => {
|
|
2120
|
+
var a;
|
|
2121
|
+
i.push({
|
|
2122
|
+
id: c.id,
|
|
2123
|
+
filterFn: u,
|
|
2124
|
+
resolvedValue: (a = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? a : n
|
|
2125
|
+
});
|
|
2126
|
+
}));
|
|
2127
|
+
let g, d;
|
|
2128
|
+
for (let c = 0; c < o.flatRows.length; c++) {
|
|
2129
|
+
const a = o.flatRows[c];
|
|
2130
|
+
if (a.columnFilters = {}, r.length)
|
|
2131
|
+
for (let m = 0; m < r.length; m++) {
|
|
2132
|
+
g = r[m];
|
|
2133
|
+
const h = g.id;
|
|
2134
|
+
a.columnFilters[h] = g.filterFn(a, h, g.resolvedValue, (R) => {
|
|
2135
|
+
a.columnFiltersMeta[h] = R;
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
if (i.length) {
|
|
2139
|
+
for (let m = 0; m < i.length; m++) {
|
|
2140
|
+
d = i[m];
|
|
2141
|
+
const h = d.id;
|
|
2142
|
+
if (d.filterFn(a, h, d.resolvedValue, (R) => {
|
|
2143
|
+
a.columnFiltersMeta[h] = R;
|
|
2144
|
+
})) {
|
|
2145
|
+
a.columnFilters.__global__ = !0;
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
a.columnFilters.__global__ !== !0 && (a.columnFilters.__global__ = !1);
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
const f = (c) => {
|
|
2153
|
+
for (let a = 0; a < l.length; a++)
|
|
2154
|
+
if (c.columnFilters[l[a]] === !1)
|
|
2155
|
+
return !1;
|
|
2156
|
+
return !0;
|
|
2157
|
+
};
|
|
2158
|
+
return Ue(o.rows, f, e);
|
|
2159
|
+
}, C(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2160
|
+
}
|
|
2161
|
+
function Cn(e) {
|
|
2162
|
+
return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2163
|
+
if (!n.rows.length)
|
|
2164
|
+
return n;
|
|
2165
|
+
const {
|
|
2166
|
+
pageSize: r,
|
|
2167
|
+
pageIndex: i
|
|
2168
|
+
} = t;
|
|
2169
|
+
let {
|
|
2170
|
+
rows: l,
|
|
2171
|
+
flatRows: u,
|
|
2172
|
+
rowsById: s
|
|
2173
|
+
} = n;
|
|
2174
|
+
const g = r * i, d = g + r;
|
|
2175
|
+
l = l.slice(g, d);
|
|
2176
|
+
let f;
|
|
2177
|
+
o.options.paginateExpandedRows ? f = {
|
|
2178
|
+
rows: l,
|
|
2179
|
+
flatRows: u,
|
|
2180
|
+
rowsById: s
|
|
2181
|
+
} : f = cn({
|
|
2182
|
+
rows: l,
|
|
2183
|
+
flatRows: u,
|
|
2184
|
+
rowsById: s
|
|
2185
|
+
}), f.flatRows = [];
|
|
2186
|
+
const c = (a) => {
|
|
2187
|
+
f.flatRows.push(a), a.subRows.length && a.subRows.forEach(c);
|
|
2188
|
+
};
|
|
2189
|
+
return f.rows.forEach(c), f;
|
|
2190
|
+
}, C(o.options, "debugTable", "getPaginationRowModel"));
|
|
2191
|
+
}
|
|
2192
|
+
function wn() {
|
|
2193
|
+
return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2194
|
+
if (!t.rows.length || !(o != null && o.length))
|
|
2195
|
+
return t;
|
|
2196
|
+
const n = e.getState().sorting, r = [], i = n.filter((s) => {
|
|
2197
|
+
var g;
|
|
2198
|
+
return (g = e.getColumn(s.id)) == null ? void 0 : g.getCanSort();
|
|
2199
|
+
}), l = {};
|
|
2200
|
+
i.forEach((s) => {
|
|
2201
|
+
const g = e.getColumn(s.id);
|
|
2202
|
+
g && (l[s.id] = {
|
|
2203
|
+
sortUndefined: g.columnDef.sortUndefined,
|
|
2204
|
+
invertSorting: g.columnDef.invertSorting,
|
|
2205
|
+
sortingFn: g.getSortingFn()
|
|
2206
|
+
});
|
|
2207
|
+
});
|
|
2208
|
+
const u = (s) => {
|
|
2209
|
+
const g = s.map((d) => ({
|
|
2210
|
+
...d
|
|
2211
|
+
}));
|
|
2212
|
+
return g.sort((d, f) => {
|
|
2213
|
+
for (let a = 0; a < i.length; a += 1) {
|
|
2214
|
+
var c;
|
|
2215
|
+
const m = i[a], h = l[m.id], R = h.sortUndefined, v = (c = m == null ? void 0 : m.desc) != null ? c : !1;
|
|
2216
|
+
let x = 0;
|
|
2217
|
+
if (R) {
|
|
2218
|
+
const _ = d.getValue(m.id), M = f.getValue(m.id), y = _ === void 0, G = M === void 0;
|
|
2219
|
+
if (y || G) {
|
|
2220
|
+
if (R === "first") return y ? -1 : 1;
|
|
2221
|
+
if (R === "last") return y ? 1 : -1;
|
|
2222
|
+
x = y && G ? 0 : y ? R : -R;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
if (x === 0 && (x = h.sortingFn(d, f, m.id)), x !== 0)
|
|
2226
|
+
return v && (x *= -1), h.invertSorting && (x *= -1), x;
|
|
2227
|
+
}
|
|
2228
|
+
return d.index - f.index;
|
|
2229
|
+
}), g.forEach((d) => {
|
|
2230
|
+
var f;
|
|
2231
|
+
r.push(d), (f = d.subRows) != null && f.length && (d.subRows = u(d.subRows));
|
|
2232
|
+
}), g;
|
|
2233
|
+
};
|
|
2234
|
+
return {
|
|
2235
|
+
rows: u(t.rows),
|
|
2236
|
+
flatRows: r,
|
|
2237
|
+
rowsById: t.rowsById
|
|
2238
|
+
};
|
|
2239
|
+
}, C(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* react-table
|
|
2243
|
+
*
|
|
2244
|
+
* Copyright (c) TanStack
|
|
2245
|
+
*
|
|
2246
|
+
* This source code is licensed under the MIT license found in the
|
|
2247
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
2248
|
+
*
|
|
2249
|
+
* @license MIT
|
|
2250
|
+
*/
|
|
2251
|
+
function B(e, o) {
|
|
2252
|
+
return e ? Rn(e) ? /* @__PURE__ */ P.createElement(e, o) : e : null;
|
|
2253
|
+
}
|
|
2254
|
+
function Rn(e) {
|
|
2255
|
+
return vn(e) || typeof e == "function" || xn(e);
|
|
2256
|
+
}
|
|
2257
|
+
function vn(e) {
|
|
2258
|
+
return typeof e == "function" && (() => {
|
|
2259
|
+
const o = Object.getPrototypeOf(e);
|
|
2260
|
+
return o.prototype && o.prototype.isReactComponent;
|
|
2261
|
+
})();
|
|
2262
|
+
}
|
|
2263
|
+
function xn(e) {
|
|
2264
|
+
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
2265
|
+
}
|
|
2266
|
+
function _n(e) {
|
|
2267
|
+
const o = {
|
|
2268
|
+
state: {},
|
|
2269
|
+
// Dummy state
|
|
2270
|
+
onStateChange: () => {
|
|
2271
|
+
},
|
|
2272
|
+
// noop
|
|
2273
|
+
renderFallbackValue: null,
|
|
2274
|
+
...e
|
|
2275
|
+
}, [t] = P.useState(() => ({
|
|
2276
|
+
current: gn(o)
|
|
2277
|
+
})), [n, r] = P.useState(() => t.current.initialState);
|
|
2278
|
+
return t.current.setOptions((i) => ({
|
|
2279
|
+
...i,
|
|
2280
|
+
...e,
|
|
2281
|
+
state: {
|
|
2282
|
+
...n,
|
|
2283
|
+
...e.state
|
|
2284
|
+
},
|
|
2285
|
+
// Similarly, we'll maintain both our internal state and any user-provided
|
|
2286
|
+
// state.
|
|
2287
|
+
onStateChange: (l) => {
|
|
2288
|
+
r(l), e.onStateChange == null || e.onStateChange(l);
|
|
2289
|
+
}
|
|
2290
|
+
})), t.current;
|
|
2291
|
+
}
|
|
2292
|
+
const Fn = ({
|
|
2293
|
+
page: e = 1,
|
|
2294
|
+
between: o = 3,
|
|
2295
|
+
totalPages: t,
|
|
2296
|
+
changePage: n,
|
|
2297
|
+
next: r = !0,
|
|
2298
|
+
ellipsis: i = 0,
|
|
2299
|
+
classes: l
|
|
2300
|
+
}) => {
|
|
2301
|
+
o = o < 1 ? 1 : o, e = Math.min(Math.max(e, 1), t), i = Math.min(Math.max(i, 0), o - 2);
|
|
2302
|
+
const u = Array.from({ length: t }, (d, f) => f), s = o * 2 + 1;
|
|
2303
|
+
let g;
|
|
2304
|
+
return t < s ? g = u : e - 1 <= o ? g = u.slice(0, s - (i > 0 ? i + 1 : 0)) : e + o >= t ? g = u.slice(t - s + (i > 0 ? i + 1 : 0), t) : g = u.slice(
|
|
2305
|
+
e - 1 - (o - (i > 0 ? i + 1 : 0)),
|
|
2306
|
+
e + (o - (i > 0 ? i + 1 : 0))
|
|
2307
|
+
), /* @__PURE__ */ p.jsxs("div", { className: w("flex", l == null ? void 0 : l.root), children: [
|
|
2308
|
+
r && /* @__PURE__ */ p.jsx(
|
|
2309
|
+
E,
|
|
2310
|
+
{
|
|
2311
|
+
size: "sm",
|
|
2312
|
+
intent: "ghost",
|
|
2313
|
+
className: w("mob-body-regular-l w-[40px] p-0 text-color-dark disabled:text-icon-disabled", l == null ? void 0 : l.button),
|
|
2314
|
+
disabled: e <= 1,
|
|
2315
|
+
onClick: () => e > 1 && n(e - 2),
|
|
2316
|
+
children: /* @__PURE__ */ p.jsx(N, { name: "arrows/arrowRight", className: "rotate-180" })
|
|
2317
|
+
}
|
|
2318
|
+
),
|
|
2319
|
+
t > s && i > 0 && u.slice(0, e - 1 <= o ? 0 : i).map((d) => /* @__PURE__ */ p.jsx(
|
|
2320
|
+
E,
|
|
2321
|
+
{
|
|
2322
|
+
size: "sm",
|
|
2323
|
+
intent: "ghost",
|
|
2324
|
+
className: w("mob-body-regular-l w-[40px] p-0 text-color-dark", l == null ? void 0 : l.button),
|
|
2325
|
+
onClick: () => d !== e - 1 && n(d),
|
|
2326
|
+
children: d + 1
|
|
2327
|
+
},
|
|
2328
|
+
d
|
|
2329
|
+
)),
|
|
2330
|
+
t > s && i > 0 && e - 1 > o && /* @__PURE__ */ p.jsx(
|
|
2331
|
+
E,
|
|
2332
|
+
{
|
|
2333
|
+
size: "sm",
|
|
2334
|
+
intent: "ghost",
|
|
2335
|
+
className: w("mob-body-regular-l pointer-events-none w-[40px] p-0 text-color-dark", l == null ? void 0 : l.ellipsis),
|
|
2336
|
+
children: "..."
|
|
2337
|
+
}
|
|
2338
|
+
),
|
|
2339
|
+
g.map((d) => {
|
|
2340
|
+
const f = d === e - 1;
|
|
2341
|
+
return /* @__PURE__ */ p.jsx(
|
|
2342
|
+
E,
|
|
2343
|
+
{
|
|
2344
|
+
size: "sm",
|
|
2345
|
+
className: w(
|
|
2346
|
+
"mob-body-regular-l w-[40px] p-0 text-color-dark",
|
|
2347
|
+
{
|
|
2348
|
+
"text-color-primary-default": f
|
|
2349
|
+
},
|
|
2350
|
+
l == null ? void 0 : l.button
|
|
2351
|
+
),
|
|
2352
|
+
intent: f ? "secondary" : "ghost",
|
|
2353
|
+
onClick: () => !f && n(d),
|
|
2354
|
+
children: d + 1
|
|
2355
|
+
},
|
|
2356
|
+
d
|
|
2357
|
+
);
|
|
2358
|
+
}),
|
|
2359
|
+
t > s && i > 0 && e < t - o && /* @__PURE__ */ p.jsx(
|
|
2360
|
+
E,
|
|
2361
|
+
{
|
|
2362
|
+
size: "sm",
|
|
2363
|
+
intent: "ghost",
|
|
2364
|
+
className: w("mob-body-regular-l pointer-events-none w-[40px] p-0 text-color-dark", l == null ? void 0 : l.ellipsis),
|
|
2365
|
+
children: "..."
|
|
2366
|
+
}
|
|
2367
|
+
),
|
|
2368
|
+
t > s && i > 0 && u.slice(e >= t - o ? t : t - i, t).map((d) => /* @__PURE__ */ p.jsx(
|
|
2369
|
+
E,
|
|
2370
|
+
{
|
|
2371
|
+
size: "sm",
|
|
2372
|
+
className: w("mob-body-regular-l w-[40px] p-0 text-color-dark", l == null ? void 0 : l.button),
|
|
2373
|
+
intent: "ghost",
|
|
2374
|
+
onClick: () => d !== e - 1 && n(d),
|
|
2375
|
+
children: d + 1
|
|
2376
|
+
},
|
|
2377
|
+
d
|
|
2378
|
+
)),
|
|
2379
|
+
r && /* @__PURE__ */ p.jsx(
|
|
2380
|
+
E,
|
|
2381
|
+
{
|
|
2382
|
+
size: "sm",
|
|
2383
|
+
intent: "ghost",
|
|
2384
|
+
className: w("mob-body-regular-l w-[40px] p-0 text-color-dark disabled:text-icon-disabled", l == null ? void 0 : l.button),
|
|
2385
|
+
disabled: e >= t,
|
|
2386
|
+
onClick: () => e < t && n(e),
|
|
2387
|
+
children: /* @__PURE__ */ p.jsx(N, { name: "arrows/arrowRight" })
|
|
2388
|
+
}
|
|
2389
|
+
)
|
|
2390
|
+
] });
|
|
2391
|
+
}, yn = ({ page: e, pageCount: o, pageSize: t, onPageIndexChange: n, rowsCount: r, classes: i }) => {
|
|
2392
|
+
const l = t * e, u = l > r ? r : l;
|
|
2393
|
+
return /* @__PURE__ */ p.jsxs("div", { className: w("flex w-full items-center justify-between", i == null ? void 0 : i.root), children: [
|
|
2394
|
+
/* @__PURE__ */ p.jsxs("span", { className: w("desk-body-regular-m text-color-tetriary", i == null ? void 0 : i.displayShown), children: [
|
|
2395
|
+
"Показано ",
|
|
2396
|
+
u,
|
|
2397
|
+
" из ",
|
|
2398
|
+
r
|
|
2399
|
+
] }),
|
|
2400
|
+
/* @__PURE__ */ p.jsx(
|
|
2401
|
+
Fn,
|
|
2402
|
+
{
|
|
2403
|
+
totalPages: o,
|
|
2404
|
+
changePage: (s) => n(s),
|
|
2405
|
+
page: e,
|
|
2406
|
+
ellipsis: 1,
|
|
2407
|
+
classes: i == null ? void 0 : i.pagination
|
|
2408
|
+
}
|
|
2409
|
+
)
|
|
2410
|
+
] });
|
|
2411
|
+
}, $n = ({ mode: e, enableHeaders: o, table: t, classes: n, pagination: r }) => {
|
|
2412
|
+
const i = r !== !1 && t.getPageCount() > 1, l = {
|
|
2413
|
+
pageCount: t.getPageCount(),
|
|
2414
|
+
rowsCount: t.getCoreRowModel().rows.length,
|
|
2415
|
+
pageSize: t.getState().pagination.pageSize,
|
|
2416
|
+
page: t.getState().pagination.pageIndex + 1,
|
|
2417
|
+
onPageIndexChange: t.setPageIndex,
|
|
2418
|
+
classes: n == null ? void 0 : n.pagination
|
|
2419
|
+
};
|
|
2420
|
+
return /* @__PURE__ */ p.jsxs("div", { className: w("flex w-full flex-col gap-y-4", n == null ? void 0 : n.root), children: [
|
|
2421
|
+
/* @__PURE__ */ p.jsxs(Ae, { className: w("w-full", n == null ? void 0 : n.table), children: [
|
|
2422
|
+
o && /* @__PURE__ */ p.jsx(He, { className: "px-2", children: t.getHeaderGroups().map((u) => /* @__PURE__ */ p.jsx(
|
|
2423
|
+
O,
|
|
2424
|
+
{
|
|
2425
|
+
className: w(
|
|
2426
|
+
"w-full",
|
|
2427
|
+
{
|
|
2428
|
+
"border-b border-b-[rgba(234,237,241,1)]": e === "solid"
|
|
2429
|
+
},
|
|
2430
|
+
n == null ? void 0 : n.tableHeader
|
|
2431
|
+
),
|
|
2432
|
+
children: u.headers.map((s) => /* @__PURE__ */ p.jsx(
|
|
2433
|
+
je,
|
|
2434
|
+
{
|
|
2435
|
+
className: w(
|
|
2436
|
+
"py-3",
|
|
2437
|
+
{
|
|
2438
|
+
"px-2": e === "odd"
|
|
2439
|
+
},
|
|
2440
|
+
n == null ? void 0 : n.tableHead
|
|
2441
|
+
),
|
|
2442
|
+
children: s.isPlaceholder ? null : B(s.column.columnDef.header, s.getContext())
|
|
2443
|
+
},
|
|
2444
|
+
s.id
|
|
2445
|
+
))
|
|
2446
|
+
},
|
|
2447
|
+
u.id
|
|
2448
|
+
)) }),
|
|
2449
|
+
/* @__PURE__ */ p.jsx(Ge, { children: t.getRowModel().rows.length ? t.getRowModel().rows.map((u) => /* @__PURE__ */ p.jsx(
|
|
2450
|
+
O,
|
|
2451
|
+
{
|
|
2452
|
+
className: w(
|
|
2453
|
+
"w-full",
|
|
2454
|
+
{
|
|
2455
|
+
"[&:not(:last-child)]:border-b [&:not(:last-child)]:border-b-[rgba(234,237,241,1)]": e === "solid",
|
|
2456
|
+
"[&:nth-child(odd)]:bg-color-primary-light-default": e === "odd"
|
|
2457
|
+
},
|
|
2458
|
+
n == null ? void 0 : n.tableRow
|
|
2459
|
+
),
|
|
2460
|
+
children: u.getVisibleCells().map((s, g) => /* @__PURE__ */ p.jsx(
|
|
2461
|
+
ee,
|
|
2462
|
+
{
|
|
2463
|
+
className: w(
|
|
2464
|
+
"py-3",
|
|
2465
|
+
{
|
|
2466
|
+
"px-2": e === "odd",
|
|
2467
|
+
"font-medium": g !== 0
|
|
2468
|
+
},
|
|
2469
|
+
n == null ? void 0 : n.tableCell
|
|
2470
|
+
),
|
|
2471
|
+
children: B(s.column.columnDef.cell, s.getContext())
|
|
2472
|
+
},
|
|
2473
|
+
s.id
|
|
2474
|
+
))
|
|
2475
|
+
},
|
|
2476
|
+
u.id
|
|
2477
|
+
)) : /* @__PURE__ */ p.jsx(O, { children: /* @__PURE__ */ p.jsx(ee, { colSpan: t.getRowCount(), children: "Not found" }) }) })
|
|
2478
|
+
] }),
|
|
2479
|
+
i ? typeof r == "function" ? r(l) : /* @__PURE__ */ p.jsx(yn, { ...l }) : null
|
|
2480
|
+
] });
|
|
2481
|
+
}, Vn = ({
|
|
2482
|
+
mode: e,
|
|
2483
|
+
enableHeaders: o,
|
|
2484
|
+
table: t,
|
|
2485
|
+
classes: n
|
|
2486
|
+
}) => /* @__PURE__ */ p.jsx("div", { className: w("w-full", n == null ? void 0 : n.table), children: t.getRowModel().rows.length ? t.getRowModel().rows.map((r) => /* @__PURE__ */ p.jsx(
|
|
2487
|
+
"div",
|
|
2488
|
+
{
|
|
2489
|
+
className: w(
|
|
2490
|
+
{
|
|
2491
|
+
"[&:not(:last-child)]:border-b [&:not(:last-child)]:border-b-[rgba(234,237,241,1)]": e === "solid",
|
|
2492
|
+
"[&:nth-child(odd)]:bg-color-primary-light-default": e === "odd"
|
|
2493
|
+
},
|
|
2494
|
+
n == null ? void 0 : n.tableRow
|
|
2495
|
+
),
|
|
2496
|
+
children: r.getVisibleCells().map((i, l) => {
|
|
2497
|
+
const u = t.getHeaderGroups()[0].headers[l];
|
|
2498
|
+
return /* @__PURE__ */ p.jsxs(
|
|
2499
|
+
"div",
|
|
2500
|
+
{
|
|
2501
|
+
className: w(
|
|
2502
|
+
"grid grid-cols-2 p-2",
|
|
2503
|
+
{
|
|
2504
|
+
"px-2": e === "odd",
|
|
2505
|
+
"font-medium": l !== 0
|
|
2506
|
+
},
|
|
2507
|
+
n == null ? void 0 : n.tableCell
|
|
2508
|
+
),
|
|
2509
|
+
children: [
|
|
2510
|
+
o && /* @__PURE__ */ p.jsx("p", { className: "font-bold", children: B(u.column.columnDef.header, u.getContext()) }),
|
|
2511
|
+
/* @__PURE__ */ p.jsx("p", { children: B(i.column.columnDef.cell, i.getContext()) })
|
|
2512
|
+
]
|
|
2513
|
+
},
|
|
2514
|
+
i.id
|
|
2515
|
+
);
|
|
2516
|
+
})
|
|
2517
|
+
},
|
|
2518
|
+
r.id
|
|
2519
|
+
)) : /* @__PURE__ */ p.jsx("div", { children: "Not found" }) }), bn = ({
|
|
2520
|
+
columns: e,
|
|
2521
|
+
data: o,
|
|
2522
|
+
enableHeaders: t = !0,
|
|
2523
|
+
mode: n = "solid",
|
|
2524
|
+
classes: r,
|
|
2525
|
+
pagination: i = !0
|
|
2526
|
+
}) => {
|
|
2527
|
+
const [l, u] = he([]), [s, g] = he([]), d = _n({
|
|
2528
|
+
data: o,
|
|
2529
|
+
columns: e,
|
|
2530
|
+
state: { columnFilters: l, sorting: s },
|
|
2531
|
+
enableRowSelection: !0,
|
|
2532
|
+
onSortingChange: g,
|
|
2533
|
+
onColumnFiltersChange: u,
|
|
2534
|
+
getCoreRowModel: dn(),
|
|
2535
|
+
getFilteredRowModel: Sn(),
|
|
2536
|
+
getSortedRowModel: wn(),
|
|
2537
|
+
getFacetedRowModel: mn(),
|
|
2538
|
+
getFacetedUniqueValues: hn(),
|
|
2539
|
+
getPaginationRowModel: Cn()
|
|
2540
|
+
}), { isMobile: f } = xe();
|
|
2541
|
+
return f ? /* @__PURE__ */ p.jsx(Vn, { table: d, enableHeaders: t, mode: n, classes: r }) : /* @__PURE__ */ p.jsx($n, { table: d, enableHeaders: t, mode: n, pagination: i, classes: r });
|
|
2542
|
+
};
|
|
2543
|
+
class Tn {
|
|
2544
|
+
static getColumnHelper() {
|
|
2545
|
+
return yt();
|
|
2546
|
+
}
|
|
2547
|
+
static getColumns(o, t) {
|
|
2548
|
+
const {
|
|
2549
|
+
helper: n = this.getColumnHelper(),
|
|
2550
|
+
enableColumnFilter: r = !1,
|
|
2551
|
+
enableSorting: i = !1,
|
|
2552
|
+
cellAccessor: l,
|
|
2553
|
+
headerAccessor: u
|
|
2554
|
+
} = t || {};
|
|
2555
|
+
return Object.keys(o).map((g) => n.accessor(g, {
|
|
2556
|
+
header: (d) => {
|
|
2557
|
+
const { column: f } = d, c = u ? u[g] : null;
|
|
2558
|
+
return /* @__PURE__ */ p.jsx(
|
|
2559
|
+
Ft,
|
|
2560
|
+
{
|
|
2561
|
+
isSorted: f.getIsSorted() === "desc",
|
|
2562
|
+
nextSortingOrder: f.getNextSortingOrder(),
|
|
2563
|
+
toggleSorting: f.toggleSorting,
|
|
2564
|
+
canSort: f.getCanSort(),
|
|
2565
|
+
children: c ? c(g, d) : g
|
|
2566
|
+
}
|
|
2567
|
+
);
|
|
2568
|
+
},
|
|
2569
|
+
cell: (d) => {
|
|
2570
|
+
const f = l ? l[g] : null;
|
|
2571
|
+
return f ? f(d) : d.getValue();
|
|
2572
|
+
},
|
|
2573
|
+
enableColumnFilter: Se.isBoolean(r) ? r : r.includes(g),
|
|
2574
|
+
enableSorting: Se.isBoolean(i) ? i : i.includes(g)
|
|
2575
|
+
}));
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
const On = ({ maxToastViewLimit: e = 2, toastDuration: o = 5e3 }) => {
|
|
2579
|
+
const { toasts: t } = ut();
|
|
2580
|
+
return gt(() => {
|
|
2581
|
+
t.filter((n) => n.visible).filter((n, r) => r >= e).forEach((n) => st.dismiss(n.id));
|
|
2582
|
+
}, [e, t]), /* @__PURE__ */ p.jsx(
|
|
2583
|
+
at,
|
|
303
2584
|
{
|
|
304
2585
|
position: "top-center",
|
|
305
2586
|
toastOptions: {
|
|
306
|
-
duration:
|
|
2587
|
+
duration: o
|
|
307
2588
|
}
|
|
308
2589
|
}
|
|
309
2590
|
);
|
|
310
|
-
},
|
|
2591
|
+
}, Bn = ({ linksList: e }) => /* @__PURE__ */ p.jsx("div", { "aria-label": "Breadcrumb", className: "flex max-w-[840px] items-center gap-2", children: e.map((o) => /* @__PURE__ */ p.jsx(p.Fragment, { children: "path" in o ? /* @__PURE__ */ p.jsxs(
|
|
311
2592
|
"div",
|
|
312
2593
|
{
|
|
313
|
-
className:
|
|
2594
|
+
className: w(
|
|
314
2595
|
"flex items-center gap-1 rounded-sm border-2 border-solid border-transparent px-1 focus-within:border-primary-focus",
|
|
315
|
-
{ "pointer-events-none !border-transparent":
|
|
2596
|
+
{ "pointer-events-none !border-transparent": o == null ? void 0 : o.isDisabled }
|
|
316
2597
|
),
|
|
317
2598
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ p.jsx(
|
|
319
2600
|
"a",
|
|
320
2601
|
{
|
|
321
|
-
href:
|
|
2602
|
+
href: o.path,
|
|
322
2603
|
target: "_blank",
|
|
323
2604
|
rel: "noreferrer",
|
|
324
|
-
className:
|
|
2605
|
+
className: w(
|
|
325
2606
|
"desk-body-regular-m text-color-primary-default outline-none hover:text-color-primary-hover focus:text-color-primary-default",
|
|
326
|
-
{ "!text-color-disabled":
|
|
2607
|
+
{ "!text-color-disabled": o == null ? void 0 : o.isDisabled }
|
|
327
2608
|
),
|
|
328
|
-
children:
|
|
2609
|
+
children: o.label
|
|
329
2610
|
}
|
|
330
2611
|
),
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
2612
|
+
/* @__PURE__ */ p.jsx(
|
|
2613
|
+
N,
|
|
333
2614
|
{
|
|
334
2615
|
name: "arrows/arrowRight",
|
|
335
|
-
className:
|
|
2616
|
+
className: w("size-4 text-icon-primary-default", { "!text-icon-disabled": o == null ? void 0 : o.isDisabled })
|
|
336
2617
|
}
|
|
337
2618
|
)
|
|
338
2619
|
]
|
|
339
2620
|
}
|
|
340
|
-
) : /* @__PURE__ */
|
|
2621
|
+
) : /* @__PURE__ */ p.jsx("div", { "aria-current": "page", className: "desk-body-regular-m text-color-blue-grey-600", children: o.label }) })) }), kn = (e) => !!e && !Array.isArray(e);
|
|
341
2622
|
export {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
2623
|
+
rt as Accordion,
|
|
2624
|
+
Kn as Badge,
|
|
2625
|
+
Bn as Breadcrumbs,
|
|
2626
|
+
E as Button,
|
|
2627
|
+
An as ButtonIcon,
|
|
2628
|
+
Xn as Calendar,
|
|
2629
|
+
Wn as Controlled,
|
|
2630
|
+
Yn as CustomLink,
|
|
2631
|
+
so as DATE_VISIBLE_PATTERN,
|
|
2632
|
+
bn as DataTable,
|
|
2633
|
+
Ft as DataTableColumnHeader,
|
|
2634
|
+
Gn as FloatButton,
|
|
2635
|
+
it as Heading,
|
|
2636
|
+
Jn as Hint,
|
|
2637
|
+
N as Icon,
|
|
2638
|
+
Qn as KeyboardShortcuts,
|
|
2639
|
+
Zn as Loader,
|
|
2640
|
+
zn as Modal,
|
|
2641
|
+
eo as Notification,
|
|
2642
|
+
On as NotificationProvider,
|
|
2643
|
+
Fn as Pagination,
|
|
2644
|
+
to as PhoneView,
|
|
2645
|
+
no as Popover,
|
|
2646
|
+
jn as ProgressBar,
|
|
2647
|
+
Ye as ResponsiveContainer,
|
|
2648
|
+
oo as Section,
|
|
2649
|
+
Hn as Skeleton,
|
|
2650
|
+
ro as Slot,
|
|
2651
|
+
Ae as Table,
|
|
2652
|
+
Ge as TableBody,
|
|
2653
|
+
_t as TableCaption,
|
|
2654
|
+
ee as TableCell,
|
|
2655
|
+
xt as TableFooter,
|
|
2656
|
+
je as TableHead,
|
|
2657
|
+
He as TableHeader,
|
|
2658
|
+
O as TableRow,
|
|
2659
|
+
Tn as TableUtils,
|
|
2660
|
+
Nn as TabsSwitcher,
|
|
2661
|
+
io as Uncontrolled,
|
|
2662
|
+
lo as brandLogos,
|
|
2663
|
+
ao as defaultClassNames,
|
|
2664
|
+
go as formatDateToLocaleString,
|
|
2665
|
+
co as formatDateToMonthString,
|
|
2666
|
+
fo as formatDateToYearString,
|
|
2667
|
+
kn as isSingleOption
|
|
375
2668
|
};
|
|
376
2669
|
//# sourceMappingURL=ui.js.map
|