@wirecore/wirelayer-react 0.12.1 → 0.13.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/{Button-Cd7lufvJ.js → Button-D_ctSYR-.js} +1 -1
- package/dist/{Checkbox-BMRax6m4.js → Checkbox-DXiff9X7.js} +1 -1
- package/dist/{ContextMenu-Bz723GfL.js → ContextMenu-Z23QyLFn.js} +408 -370
- package/dist/{CopyButton-C_LAuCkR.js → CopyButton-Dr_QrMYf.js} +2 -2
- package/dist/{Field-DkYxlVar.js → Field-DFh-zcjr.js} +3 -3
- package/dist/{Highlight-43-H9459.js → Highlight-CpYN310r.js} +1 -1
- package/dist/{Input-CtYSQznO.js → Input-D8lXkJcv.js} +4 -4
- package/dist/PasswordInput-DQIzdTGq.js +452 -0
- package/dist/{RecipesProvider-0idafuGm.js → RecipesProvider-COODXvxz.js} +8 -1
- package/dist/{Select-CGyqfOm3.js → Select-E_geb3hU.js} +5 -5
- package/dist/{Slider-Bfm_jjYE.js → Slider-BFGCHR5_.js} +3 -3
- package/dist/{Tree-DLHbcH3-.js → Tree-BDYg4j6i.js} +128 -128
- package/dist/chart.js +2 -2
- package/dist/code.js +14 -14
- package/dist/components/Confirm/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/Confirm/confirm.d.ts +5 -0
- package/dist/components/Confirm/confirm.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +12 -3
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/DialogService/DialogHost.d.ts.map +1 -1
- package/dist/components/DialogService/dialogs.d.ts +5 -0
- package/dist/components/DialogService/dialogs.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +10 -2
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +8 -2
- package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -1
- package/dist/components/RecipesProvider/RecipesProvider.d.ts +6 -0
- package/dist/components/RecipesProvider/RecipesProvider.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +26 -7
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table/FilterMenu.d.ts.map +1 -1
- package/dist/data-table/ValueInput.d.ts +5 -1
- package/dist/data-table/ValueInput.d.ts.map +1 -1
- package/dist/data-table/features.d.ts +10 -0
- package/dist/data-table/features.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/inputs.d.ts +5 -0
- package/dist/data-table/inputs.d.ts.map +1 -1
- package/dist/data-table/types.d.ts +3 -0
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +1150 -1083
- package/dist/editor.js +4 -4
- package/dist/form.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2088 -2111
- package/dist/pdf.js +7 -7
- package/dist/sources/dateRangeInput.css +3 -0
- package/dist/virtual.js +7 -7
- package/llms-full.txt +127 -26
- package/llms.txt +1 -0
- package/package.json +3 -3
- package/dist/PasswordInput-CxZXGV2m.js +0 -449
package/dist/data-table.js
CHANGED
|
@@ -1,184 +1,215 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e,
|
|
3
|
-
import { _ as
|
|
4
|
-
import { t as
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { EditHistory as
|
|
11
|
-
import { ArrowDown as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { Fragment as
|
|
2
|
+
import { a as e, n as t, o as n, r, t as i } from "./RecipesProvider-COODXvxz.js";
|
|
3
|
+
import { _ as a, a as o, g as s, i as c, n as l, r as ee, t as te, v as ne, y as u } from "./ContextMenu-Z23QyLFn.js";
|
|
4
|
+
import { t as d } from "./Button-D_ctSYR-.js";
|
|
5
|
+
import { n as f, t as p } from "./Input-D8lXkJcv.js";
|
|
6
|
+
import { n as re, t as ie } from "./Select-E_geb3hU.js";
|
|
7
|
+
import { t as ae } from "./Checkbox-DXiff9X7.js";
|
|
8
|
+
import { t as oe } from "./Highlight-CpYN310r.js";
|
|
9
|
+
import { t as m } from "./CopyButton-Dr_QrMYf.js";
|
|
10
|
+
import { EditHistory as se, aggregateValues as ce, applyPending as le, autoRowSpans as ue, changesByRow as de, clearTableState as fe, collectErrors as pe, conditionFieldsFromColumns as me, createDataController as he, createDataController as ge, createXlsx as _e, csvSeparator as ve, dataAnnouncement as ye, dataSourceToRows as be, dataTable as xe, dataTableMatchModes as Se, defineMatchMode as Ce, downloadBytes as we, downloadText as Te, emptyConditionGroup as Ee, emptyFilterRule as De, extendRange as Oe, findMatches as ke, fitColumnWidth as Ae, gridFocusIn as je, gridKeydown as Me, groupedRowMove as Ne, historyKey as Pe, idRange as Fe, inlineArrowStep as Ie, isActiveCondition as Le, isActiveFilter as Re, isRangeMatchMode as ze, listValueKey as Be, loadTableState as Ve, locateTreeNode as He, matchModeDefinition as Ue, matchModeLabel as h, matchModesFor as We, matchesColumnFilter as Ge, matchesCondition as Ke, matchesRowKeywords as qe, matchesSearch as Je, menu as Ye, moveColumnBlock as Xe, moveItem as Ze, moveTreeRow as Qe, nextSorting as $e, numberSummary as et, omitTableState as tt, paginatorAlignKey as nt, parseCellText as rt, parseTsv as it, pasteTargets as at, pendingValue as ot, pivotTable as st, pivotView as ct, printHtml as lt, printTableHtml as ut, queryKey as dt, rangeAround as ft, rangeBounds as pt, rowColumnSpans as mt, rowsToDataSource as ht, rowsToDataSource as gt, sameCellValue as _t, sameTableValue as vt, saveTableState as yt, sizeOverrides as bt, syncGrid as xt, toCsv as St, toFilterRule as Ct, toTsv as wt, treeDropMove as Tt, treeGridKeyAction as Et, treeKeyboardMove as Dt, warnInDevelopment as Ot } from "@wirecore/wirelayer-recipes";
|
|
11
|
+
import { ArrowDown as kt, ArrowUp as At, ArrowUpDown as jt, Check as Mt, ChevronDown as Nt, ChevronRight as Pt, ChevronUp as Ft, ChevronsDownUp as It, ChevronsUpDown as Lt, Columns3 as Rt, Download as zt, EllipsisVertical as Bt, Filter as Vt, FilterX as Ht, GripVertical as Ut, ListFilter as Wt, Maximize2 as Gt, Minimize2 as Kt, Pencil as qt, Plus as Jt, Redo2 as Yt, Rows3 as Xt, Search as Zt, TextSearch as Qt, Trash2 as $t, Undo2 as en, X as tn } from "lucide-react";
|
|
12
|
+
import { Fragment as nn, createContext as rn, useContext as an, useEffect as g, useId as on, useImperativeHandle as sn, useLayoutEffect as cn, useMemo as _, useRef as v, useState as y } from "react";
|
|
13
|
+
import { Fragment as ln, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
14
|
import { Menu as S } from "@ark-ui/react/menu";
|
|
15
|
-
import { Portal as
|
|
16
|
-
import { Popover as
|
|
17
|
-
import { createPortal as
|
|
18
|
-
import { columnFilteringFeature as
|
|
15
|
+
import { Portal as un } from "@ark-ui/react/portal";
|
|
16
|
+
import { Popover as dn } from "@ark-ui/react/popover";
|
|
17
|
+
import { createPortal as fn } from "react-dom";
|
|
18
|
+
import { columnFilteringFeature as pn, columnGroupingFeature as mn, columnOrderingFeature as hn, columnPinningFeature as gn, columnResizingFeature as _n, columnSizingFeature as vn, columnVisibilityFeature as yn, constructSortFn as bn, createExpandedRowModel as xn, createFilteredRowModel as Sn, createGroupedRowModel as Cn, createPaginatedRowModel as wn, createSortedRowModel as Tn, filterFn_equalsString as En, filterFn_includesString as Dn, globalFilteringFeature as On, rowExpandingFeature as kn, rowPaginationFeature as An, rowPinningFeature as jn, rowSelectionFeature as Mn, rowSortingFeature as Nn, sortFn_alphanumericCaseSensitive as Pn, sortFn_basic as Fn, sortFn_datetime as In, sortFn_textCaseSensitive as Ln, tableFeatures as Rn, useTable as zn } from "@tanstack/react-table";
|
|
19
19
|
//#region src/data-table/features.ts
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
var Bn = /* @__PURE__ */ new Map(), Vn = (e) => {
|
|
21
|
+
let t = e.table.options.meta?.locale ?? "", n = Bn.get(t);
|
|
22
|
+
return n || (n = new Intl.Collator(t || void 0, {
|
|
23
|
+
numeric: !0,
|
|
24
|
+
sensitivity: "base"
|
|
25
|
+
}), Bn.set(t, n)), n;
|
|
26
|
+
}, Hn = bn({
|
|
27
|
+
resolveDataValue: (e) => typeof e == "string" ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : "",
|
|
28
|
+
sort: (e, t, n) => Vn(n).compare(e, t)
|
|
29
|
+
}), Un = Rn({
|
|
30
|
+
tableMeta: {},
|
|
31
|
+
rowSortingFeature: Nn,
|
|
32
|
+
sortedRowModel: Tn(),
|
|
33
|
+
sortFns: {
|
|
34
|
+
text: Hn,
|
|
35
|
+
alphanumeric: Hn,
|
|
36
|
+
textCaseSensitive: Ln,
|
|
37
|
+
alphanumericCaseSensitive: Pn,
|
|
38
|
+
datetime: In,
|
|
39
|
+
basic: Fn
|
|
40
|
+
},
|
|
41
|
+
rowPaginationFeature: An,
|
|
42
|
+
paginatedRowModel: wn(),
|
|
43
|
+
rowSelectionFeature: Mn,
|
|
44
|
+
rowPinningFeature: jn,
|
|
45
|
+
rowExpandingFeature: kn,
|
|
46
|
+
expandedRowModel: xn(),
|
|
47
|
+
columnGroupingFeature: mn,
|
|
48
|
+
groupedRowModel: Cn(),
|
|
49
|
+
columnFilteringFeature: pn,
|
|
50
|
+
globalFilteringFeature: On,
|
|
51
|
+
filteredRowModel: Sn(),
|
|
35
52
|
filterFns: {
|
|
36
|
-
includesString:
|
|
37
|
-
equalsString:
|
|
53
|
+
includesString: Dn,
|
|
54
|
+
equalsString: En
|
|
38
55
|
},
|
|
39
|
-
columnVisibilityFeature:
|
|
40
|
-
columnOrderingFeature:
|
|
41
|
-
columnPinningFeature:
|
|
42
|
-
columnSizingFeature:
|
|
43
|
-
columnResizingFeature:
|
|
44
|
-
}),
|
|
56
|
+
columnVisibilityFeature: yn,
|
|
57
|
+
columnOrderingFeature: hn,
|
|
58
|
+
columnPinningFeature: gn,
|
|
59
|
+
columnSizingFeature: vn,
|
|
60
|
+
columnResizingFeature: _n
|
|
61
|
+
}), Wn = rn({});
|
|
45
62
|
//#endregion
|
|
46
63
|
//#region src/data-table/ValueInput.tsx
|
|
47
|
-
function
|
|
48
|
-
let d =
|
|
64
|
+
function Gn({ type: e, value: t, onChange: r, label: i, options: a, any: o = !1, invalid: s, inputProps: l, filter: ee = !1, range: te = !1, renderOption: u }) {
|
|
65
|
+
let d = n(), f = d.dataTable, { dateInput: re, numberInput: oe, dateRangeInput: m } = an(Wn), se = (a ?? []).some((e) => typeof e != "string"), ce = [...o ? [{
|
|
49
66
|
value: "",
|
|
50
|
-
label:
|
|
51
|
-
}] : [], ...
|
|
67
|
+
label: f.filterAll
|
|
68
|
+
}] : [], ...e === "boolean" ? [{
|
|
52
69
|
value: "true",
|
|
53
|
-
label:
|
|
70
|
+
label: f.yes
|
|
54
71
|
}, {
|
|
55
72
|
value: "false",
|
|
56
|
-
label:
|
|
73
|
+
label: f.no
|
|
57
74
|
}] : (a ?? []).map((e) => typeof e == "string" ? {
|
|
58
75
|
value: e,
|
|
59
76
|
label: e
|
|
60
|
-
} : e)],
|
|
61
|
-
return
|
|
77
|
+
} : e)], le = t == null ? "" : String(t);
|
|
78
|
+
return te && (e === "date" || e === "datetime") && m ? /* @__PURE__ */ b(m, {
|
|
62
79
|
size: "sm",
|
|
63
80
|
"aria-label": i,
|
|
64
|
-
invalid:
|
|
81
|
+
invalid: s,
|
|
65
82
|
placeholder: l?.placeholder,
|
|
66
|
-
|
|
83
|
+
withTime: e === "datetime",
|
|
84
|
+
value: Array.isArray(t) && (t[0] || t[1]) ? {
|
|
85
|
+
start: t[0] ?? null,
|
|
86
|
+
end: t[1] ?? null
|
|
87
|
+
} : null,
|
|
88
|
+
onValueChange: (e) => r([e?.start ?? null, e?.end ?? null])
|
|
89
|
+
}) : e === "text" ? /* @__PURE__ */ b(p, {
|
|
90
|
+
size: "sm",
|
|
91
|
+
"aria-label": i,
|
|
92
|
+
invalid: s,
|
|
93
|
+
placeholder: l?.placeholder ?? (ee ? f.filterText : void 0),
|
|
94
|
+
value: le,
|
|
67
95
|
onChange: (e) => r(e.target.value)
|
|
68
|
-
}) :
|
|
96
|
+
}) : e === "textarea" ? /* @__PURE__ */ b(ne, {
|
|
69
97
|
size: "sm",
|
|
70
98
|
autoResize: !0,
|
|
71
99
|
"aria-label": i,
|
|
72
|
-
invalid:
|
|
73
|
-
value:
|
|
100
|
+
invalid: s,
|
|
101
|
+
value: le,
|
|
74
102
|
onChange: (e) => r(e.target.value)
|
|
75
|
-
}) :
|
|
103
|
+
}) : e === "number" && oe ? /* @__PURE__ */ b(oe, {
|
|
76
104
|
size: "sm",
|
|
77
105
|
"aria-label": i,
|
|
78
|
-
invalid:
|
|
106
|
+
invalid: s,
|
|
79
107
|
placeholder: l?.placeholder,
|
|
80
|
-
value: typeof
|
|
108
|
+
value: typeof t == "number" ? t : null,
|
|
81
109
|
onValueChange: r
|
|
82
|
-
}) :
|
|
110
|
+
}) : e === "number" ? /* @__PURE__ */ b(p, {
|
|
83
111
|
type: "number",
|
|
84
112
|
size: "sm",
|
|
85
113
|
"aria-label": i,
|
|
86
|
-
invalid:
|
|
114
|
+
invalid: s,
|
|
87
115
|
placeholder: l?.placeholder,
|
|
88
|
-
value: typeof
|
|
116
|
+
value: typeof t == "number" ? String(t) : "",
|
|
89
117
|
onChange: ({ target: e }) => r(e.value && Number.isFinite(Number(e.value)) ? Number(e.value) : null)
|
|
90
|
-
}) : (
|
|
118
|
+
}) : (e === "date" || e === "datetime") && re ? /* @__PURE__ */ b(re, {
|
|
119
|
+
size: "sm",
|
|
91
120
|
"aria-label": i,
|
|
92
|
-
invalid:
|
|
121
|
+
invalid: s,
|
|
93
122
|
placeholder: l?.placeholder,
|
|
94
|
-
withTime:
|
|
95
|
-
value:
|
|
123
|
+
withTime: e === "datetime",
|
|
124
|
+
value: le || null,
|
|
96
125
|
onValueChange: r
|
|
97
|
-
}) :
|
|
98
|
-
type:
|
|
126
|
+
}) : e === "date" || e === "datetime" ? /* @__PURE__ */ b(p, {
|
|
127
|
+
type: e === "date" ? "date" : "datetime-local",
|
|
99
128
|
size: "sm",
|
|
100
129
|
"aria-label": i,
|
|
101
|
-
invalid:
|
|
102
|
-
value:
|
|
130
|
+
invalid: s,
|
|
131
|
+
value: le.slice(0, e === "date" ? 10 : 16),
|
|
103
132
|
onChange: ({ target: e }) => r(e.value || null)
|
|
104
|
-
}) :
|
|
133
|
+
}) : e === "multiSelect" ? /* @__PURE__ */ b(c, {
|
|
134
|
+
size: "sm",
|
|
105
135
|
"aria-label": i,
|
|
106
|
-
items:
|
|
107
|
-
invalid:
|
|
108
|
-
placeholder: l?.placeholder ??
|
|
136
|
+
items: ce,
|
|
137
|
+
invalid: s,
|
|
138
|
+
placeholder: l?.placeholder ?? f.filterAll,
|
|
109
139
|
filter: l?.filter,
|
|
110
140
|
maxShown: l?.maxShown,
|
|
111
141
|
clearable: l?.clearable,
|
|
112
142
|
renderItem: u,
|
|
113
|
-
value: Array.isArray(
|
|
143
|
+
value: Array.isArray(t) ? t : [],
|
|
114
144
|
onValueChange: r
|
|
115
|
-
}) :
|
|
145
|
+
}) : e === "checkbox" ? /* @__PURE__ */ b(ae, {
|
|
116
146
|
"aria-label": i,
|
|
117
|
-
invalid:
|
|
118
|
-
checked:
|
|
147
|
+
invalid: s,
|
|
148
|
+
checked: t === !0,
|
|
119
149
|
onCheckedChange: (e) => r(e === !0)
|
|
120
|
-
}) : /* @__PURE__ */ b(
|
|
150
|
+
}) : /* @__PURE__ */ b(ie, {
|
|
151
|
+
size: "sm",
|
|
121
152
|
"aria-label": i,
|
|
122
|
-
items:
|
|
123
|
-
invalid:
|
|
153
|
+
items: ce,
|
|
154
|
+
invalid: s,
|
|
124
155
|
placeholder: l?.placeholder ?? d.common.placeholder,
|
|
125
156
|
filter: l?.filter,
|
|
126
157
|
clearable: l?.clearable,
|
|
127
158
|
renderItem: u,
|
|
128
|
-
value:
|
|
159
|
+
value: se ? t ?? (o ? "" : null) : le,
|
|
129
160
|
onValueChange: (e) => r(e ?? "")
|
|
130
161
|
});
|
|
131
162
|
}
|
|
132
163
|
//#endregion
|
|
133
164
|
//#region src/data-table/FilterMenu.tsx
|
|
134
|
-
function
|
|
135
|
-
let
|
|
136
|
-
e && se(structuredClone(
|
|
137
|
-
},
|
|
165
|
+
function Kn({ header: r, type: i, value: a, onChange: o, options: s, matchModes: c, maxConstraints: l, renderValue: ee, inputProps: te, renderOption: ne }) {
|
|
166
|
+
let u = t("dataTable", xe)(), p = n().dataTable, { locale: re } = e(), [ae, oe] = y(!1), [m, se] = y(() => De(i)), ce = Re(a), le = We(i, c), ue = (e) => Ue(e)?.input ?? i, de = an(Wn), fe = (e) => !!de.dateRangeInput && ["date", "datetime"].includes(ue(e)), pe = (e) => {
|
|
167
|
+
e && se(structuredClone(Ct(a ?? De(i), i))), oe(e);
|
|
168
|
+
}, me = (e, t) => se((n) => ({
|
|
138
169
|
...n,
|
|
139
170
|
constraints: n.constraints.map((n, r) => r === e ? {
|
|
140
171
|
...n,
|
|
141
172
|
...t
|
|
142
173
|
} : n)
|
|
143
|
-
})),
|
|
144
|
-
let n = m.constraints[e], r =
|
|
145
|
-
|
|
174
|
+
})), he = (e, t) => {
|
|
175
|
+
let n = m.constraints[e], r = ze(t) !== ze(n.matchMode);
|
|
176
|
+
me(e, r ? {
|
|
146
177
|
matchMode: t,
|
|
147
|
-
value:
|
|
178
|
+
value: ze(t) ? [null, null] : null
|
|
148
179
|
} : { matchMode: t });
|
|
149
|
-
},
|
|
180
|
+
}, ge = (e, t, n) => {
|
|
150
181
|
let r = m.constraints[e], i = Array.isArray(r.value) ? [...r.value] : [null, null];
|
|
151
|
-
i[t] = n,
|
|
152
|
-
},
|
|
153
|
-
o(
|
|
182
|
+
i[t] = n, me(e, { value: i });
|
|
183
|
+
}, _e = () => {
|
|
184
|
+
o(Re(m) ? structuredClone(m) : void 0), oe(!1);
|
|
154
185
|
};
|
|
155
|
-
return /* @__PURE__ */ x(
|
|
186
|
+
return /* @__PURE__ */ x(dn.Root, {
|
|
156
187
|
open: ae,
|
|
157
|
-
onOpenChange: (e) =>
|
|
188
|
+
onOpenChange: (e) => pe(e.open),
|
|
158
189
|
positioning: {
|
|
159
190
|
placement: "bottom-end",
|
|
160
191
|
gutter: 4
|
|
161
192
|
},
|
|
162
193
|
lazyMount: !0,
|
|
163
194
|
unmountOnExit: !0,
|
|
164
|
-
children: [/* @__PURE__ */ b(
|
|
165
|
-
className:
|
|
195
|
+
children: [/* @__PURE__ */ b(dn.Trigger, {
|
|
196
|
+
className: u.headButton(),
|
|
166
197
|
"aria-label": p.filterMenu(r, ce),
|
|
167
198
|
"data-active": ce || void 0,
|
|
168
|
-
children: /* @__PURE__ */ b(
|
|
169
|
-
className:
|
|
199
|
+
children: /* @__PURE__ */ b(Vt, {
|
|
200
|
+
className: u.headButtonIcon(),
|
|
170
201
|
"aria-hidden": "true"
|
|
171
202
|
})
|
|
172
|
-
}), /* @__PURE__ */ b(
|
|
173
|
-
className:
|
|
203
|
+
}), /* @__PURE__ */ b(un, { children: /* @__PURE__ */ b(dn.Positioner, { children: /* @__PURE__ */ b(dn.Content, {
|
|
204
|
+
className: u.filterPanel(),
|
|
174
205
|
"aria-label": p.filterMenu(r, !1),
|
|
175
206
|
children: /* @__PURE__ */ x("form", {
|
|
176
|
-
className:
|
|
207
|
+
className: u.filterForm(),
|
|
177
208
|
onSubmit: (e) => {
|
|
178
|
-
e.preventDefault(),
|
|
209
|
+
e.preventDefault(), _e();
|
|
179
210
|
},
|
|
180
211
|
children: [
|
|
181
|
-
m.constraints.length > 1 && /* @__PURE__ */ b(
|
|
212
|
+
m.constraints.length > 1 && /* @__PURE__ */ b(ie, {
|
|
182
213
|
"aria-label": p.operator,
|
|
183
214
|
items: [{
|
|
184
215
|
value: "and",
|
|
@@ -194,20 +225,20 @@ function Fn({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
194
225
|
}))
|
|
195
226
|
}),
|
|
196
227
|
m.constraints.map((e, t) => /* @__PURE__ */ x("div", {
|
|
197
|
-
className:
|
|
228
|
+
className: u.filterRule(),
|
|
198
229
|
children: [/* @__PURE__ */ x("div", {
|
|
199
|
-
className:
|
|
200
|
-
children: [le.length > 1 && /* @__PURE__ */ b(
|
|
201
|
-
className:
|
|
230
|
+
className: u.filterRuleHead(),
|
|
231
|
+
children: [le.length > 1 && /* @__PURE__ */ b(ie, {
|
|
232
|
+
className: u.filterMode(),
|
|
202
233
|
"aria-label": p.matchMode(t),
|
|
203
234
|
items: le.map((e) => ({
|
|
204
235
|
value: e,
|
|
205
|
-
label:
|
|
236
|
+
label: h(e, p.matchModes, re)
|
|
206
237
|
})),
|
|
207
238
|
value: e.matchMode,
|
|
208
|
-
onValueChange: (e) =>
|
|
209
|
-
}), m.constraints.length > 1 && /* @__PURE__ */ b(
|
|
210
|
-
icon:
|
|
239
|
+
onValueChange: (e) => he(t, e ?? le[0])
|
|
240
|
+
}), m.constraints.length > 1 && /* @__PURE__ */ b(f, {
|
|
241
|
+
icon: $t,
|
|
211
242
|
label: p.removeRule(t),
|
|
212
243
|
variant: "text",
|
|
213
244
|
size: "sm",
|
|
@@ -216,41 +247,49 @@ function Fn({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
216
247
|
constraints: e.constraints.filter((e, n) => n !== t)
|
|
217
248
|
}))
|
|
218
249
|
})]
|
|
219
|
-
}),
|
|
250
|
+
}), ee ? ee({
|
|
220
251
|
value: e.value,
|
|
221
|
-
setValue: (e) =>
|
|
222
|
-
}) :
|
|
223
|
-
|
|
224
|
-
|
|
252
|
+
setValue: (e) => me(t, { value: e })
|
|
253
|
+
}) : ze(e.matchMode) && fe(e.matchMode) ? /* @__PURE__ */ b(Gn, {
|
|
254
|
+
range: !0,
|
|
255
|
+
type: ue(e.matchMode),
|
|
256
|
+
label: p.value(t),
|
|
257
|
+
inputProps: te,
|
|
258
|
+
value: e.value,
|
|
259
|
+
onChange: (e) => me(t, { value: e })
|
|
260
|
+
}) : ze(e.matchMode) ? /* @__PURE__ */ x("div", {
|
|
261
|
+
className: u.filterRange(),
|
|
262
|
+
children: [/* @__PURE__ */ b(Gn, {
|
|
225
263
|
type: ue(e.matchMode),
|
|
226
264
|
label: `${p.value(t)}, ${p.from}`,
|
|
227
265
|
options: s,
|
|
228
266
|
inputProps: te,
|
|
229
267
|
value: Array.isArray(e.value) ? e.value[0] : null,
|
|
230
|
-
onChange: (e) =>
|
|
231
|
-
}), /* @__PURE__ */ b(
|
|
268
|
+
onChange: (e) => ge(t, 0, e)
|
|
269
|
+
}), /* @__PURE__ */ b(Gn, {
|
|
232
270
|
type: ue(e.matchMode),
|
|
233
271
|
label: `${p.value(t)}, ${p.to}`,
|
|
234
272
|
options: s,
|
|
235
273
|
inputProps: te,
|
|
236
274
|
value: Array.isArray(e.value) ? e.value[1] : null,
|
|
237
|
-
onChange: (e) =>
|
|
275
|
+
onChange: (e) => ge(t, 1, e)
|
|
238
276
|
})]
|
|
239
|
-
}) : /* @__PURE__ */ b(
|
|
277
|
+
}) : /* @__PURE__ */ b(Gn, {
|
|
240
278
|
type: ue(e.matchMode),
|
|
241
279
|
label: p.value(t),
|
|
242
280
|
options: s,
|
|
243
281
|
inputProps: te,
|
|
282
|
+
filter: !0,
|
|
244
283
|
renderOption: ne,
|
|
245
284
|
value: e.value,
|
|
246
|
-
onChange: (e) =>
|
|
285
|
+
onChange: (e) => me(t, { value: e })
|
|
247
286
|
})]
|
|
248
287
|
}, t)),
|
|
249
|
-
m.constraints.length <
|
|
288
|
+
m.constraints.length < l && /* @__PURE__ */ b(d, {
|
|
250
289
|
variant: "text",
|
|
251
290
|
size: "sm",
|
|
252
|
-
className:
|
|
253
|
-
leadingIcon:
|
|
291
|
+
className: u.filterAdd(),
|
|
292
|
+
leadingIcon: Jt,
|
|
254
293
|
onClick: () => se((e) => ({
|
|
255
294
|
...e,
|
|
256
295
|
constraints: [...e.constraints, {
|
|
@@ -261,15 +300,15 @@ function Fn({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
261
300
|
children: p.addRule
|
|
262
301
|
}),
|
|
263
302
|
/* @__PURE__ */ x("div", {
|
|
264
|
-
className:
|
|
265
|
-
children: [/* @__PURE__ */ b(
|
|
303
|
+
className: u.filterActions(),
|
|
304
|
+
children: [/* @__PURE__ */ b(d, {
|
|
266
305
|
variant: "outline",
|
|
267
306
|
size: "sm",
|
|
268
307
|
onClick: () => {
|
|
269
308
|
o(void 0), oe(!1);
|
|
270
309
|
},
|
|
271
310
|
children: p.clear
|
|
272
|
-
}), /* @__PURE__ */ b(
|
|
311
|
+
}), /* @__PURE__ */ b(d, {
|
|
273
312
|
type: "submit",
|
|
274
313
|
size: "sm",
|
|
275
314
|
children: p.apply
|
|
@@ -282,139 +321,139 @@ function Fn({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
282
321
|
}
|
|
283
322
|
//#endregion
|
|
284
323
|
//#region src/data-table/DataTable.tsx
|
|
285
|
-
var C = (e, t) => typeof e == "function" ? e(t) : e,
|
|
324
|
+
var C = (e, t) => typeof e == "function" ? e(t) : e, qn = (e) => e == null ? "" : String(e), Jn = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Yn = (e) => e ? Array.isArray(e) ? e : [e] : [], Xn = (e) => Object.fromEntries(e.filter((e) => Re(e.value)).map((e) => [e.id, e.value])), Zn = (e) => Object.entries(e).filter(([, e]) => Re(e)).map(([e, t]) => ({
|
|
286
325
|
id: e,
|
|
287
326
|
value: t
|
|
288
|
-
})),
|
|
327
|
+
})), Qn = (e, t = !0) => Object.fromEntries(e.map((e) => [e, t])), $n = (e) => Object.fromEntries(e.map((e) => [e, !0])), er = (e, t, n) => {
|
|
289
328
|
let r = { ...e };
|
|
290
329
|
for (let e of t) n ? r[e] = !0 : delete r[e];
|
|
291
330
|
return r;
|
|
292
|
-
},
|
|
331
|
+
}, tr = (e) => (e.filterOptions ?? []).some((e) => typeof e != "string"), nr = /* @__PURE__ */ new Set([
|
|
293
332
|
"select",
|
|
294
333
|
"date",
|
|
295
334
|
"checkbox"
|
|
296
|
-
]),
|
|
297
|
-
function
|
|
335
|
+
]), rr = 60, ir = 16, ar = [], or = ["selection"];
|
|
336
|
+
function sr(e) {
|
|
298
337
|
let [t, n] = y(e);
|
|
299
|
-
return t === e ||
|
|
338
|
+
return t === e || vt(t, e) ? t : (n(e), e);
|
|
300
339
|
}
|
|
301
|
-
var
|
|
340
|
+
var cr = (e) => "getRows" in e ? gt(e.getRows) : e, lr = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [data-editor]", ur = {
|
|
302
341
|
drag: 40,
|
|
303
342
|
select: 48,
|
|
304
343
|
expand: 40,
|
|
305
344
|
number: 56,
|
|
306
345
|
actions: 88
|
|
307
|
-
},
|
|
308
|
-
function
|
|
309
|
-
let
|
|
346
|
+
}, dr = () => void 0, fr = bt("sm");
|
|
347
|
+
function pr({ classes: o, data: c, dataSource: l, cacheTime: ee = 0, searchDebounce: ne = 300, pivot: he, columns: be, caption: Ce, getRowId: De, pageSize: h, onPageSizeChange: We, pageSizeOptions: Ze, page: Qe, onPageChange: ht, first: gt, onFirstChange: vt, paginatorPosition: bt = "bottom", paginatorEdges: Ct, paginatorAlign: Jt, sorting: $t, onSortingChange: rn, defaultSorting: an, sortMode: dn = "single", manual: pn = !1, rowCount: mn, selectable: hn = !1, selectionMode: gn = "multiple", selection: _n, onSelectionChange: vn, selectedRows: yn, onSelectedRowsChange: bn, selectOnRowClick: xn = !1, isRowSelectable: Sn, selectAllMode: Cn = "page", allSelection: wn, onAllSelectionChange: Tn, rowLabel: En, loading: Dn = !1, loadingVariant: On = "overlay", emptyText: kn, noResultsText: An, loadingText: jn, selectAllLabel: Mn, getSubRows: Nn, treeFilterMode: Pn, expanded: Fn, defaultExpanded: In, onExpandedChange: Ln, expandLabel: Rn, rowExpandable: Bn, expansion: Vn, advancedFilter: Hn, advancedFilterValue: pr, onAdvancedFilterValueChange: mr, renderAdvancedFilter: hr, sortable: gr, search: _r = !1, searchAlign: vr, globalFilter: yr, onGlobalFilterChange: br, rowKeywords: xr, highlightSearch: Sr = !1, filters: Cr, onFiltersChange: wr, filterDisplay: Tr = "row", showFilters: Er, onShowFiltersChange: Dr, filterToggle: Or = !1, filterReset: kr = !1, maxConstraints: Ar = 2, resizable: jr = !1, columnToggle: Mr = !1, hiddenColumns: Nr, onHiddenColumnsChange: Pr, columnMenu: Fr = !1, reorderableColumns: Ir = !1, columnOrder: Lr, onColumnOrderChange: Rr, pinnedColumns: zr, onPinnedColumnsChange: Br, exportFilename: Vr, csvSeparator: Hr, exportFormats: Ur, groupBy: Wr, onGroupByChange: Gr, frozenRows: Kr, reorderableRows: qr = !1, onRowReorder: Jr, rowNumbers: Yr = !1, rowActions: Xr, onRowAction: Zr, contextMenu: Qr = !1, rowClass: $r, rowHref: ei, onRowClick: ti, navigation: ni = "tab", statusBar: ri = !1, cellSelection: w = !1, onCellSelectionChange: ii, onCellPaste: ai, onSave: oi, find: si = !1, wrapHeaders: ci, verticalHeaders: li, editMode: T = "cell", editTrigger: ui = "click", onCellEdit: di, onRowEdit: fi, size: pi, onSizeChange: mi, densityToggle: hi = !1, gridlines: gi, bordered: _i, striped: vi, fullscreenToggle: yi = !1, scrollHeight: bi, minScrollHeight: xi, features: Si, virtual: Ci = !1, rowHeight: wi = 41, onLoadMore: Ti, onScrollEnd: Ei, onScroll: Di, stateKey: Oi, stateStorage: ki = "session", stateExclude: Ai = or, toolbar: ji, toolbarStart: Mi, toolbarEnd: Ni, empty: Pi, noResults: Fi, loadingContent: Ii, ref: Li, className: Ri, ...zi }) {
|
|
348
|
+
let Bi = t("dataTable", xe, o), Vi = r("dataTable", xe), Hi = gi ?? !!Vi.gridlines, Ui = _i ?? !!Vi.bordered, Wi = vi ?? !!Vi.striped, Gi = ci ?? !!Vi.wrapHeaders, Ki = li ?? !!Vi.verticalHeaders, qi = t("menu", Ye)(), E = n(), { locale: D } = e(), O = E.dataTable, Ji = on(), Yi = v(null), [Xi] = y(() => Object.assign({}, ...Si ?? [])), Zi = (e, t) => En?.(e, t) ?? O.row(t), Qi = (e, t) => Rn?.(e, t) ?? O.subRows(Zi(e, t)), [$i, ea] = y({
|
|
310
349
|
status: "idle",
|
|
311
350
|
items: []
|
|
312
|
-
}),
|
|
351
|
+
}), ta = v(l), [na] = y(() => ge({ source: { getItems: (e) => cr(ta.current).getItems(e) } }));
|
|
313
352
|
g(() => {
|
|
314
|
-
|
|
353
|
+
ta.current = l, na.configure({
|
|
315
354
|
ttl: ee,
|
|
316
|
-
debounce:
|
|
355
|
+
debounce: ne
|
|
317
356
|
});
|
|
318
|
-
}), g(() => (
|
|
319
|
-
let
|
|
320
|
-
if (!
|
|
357
|
+
}), g(() => (na.configure({ onChange: ea }), () => na.dispose()), [na]);
|
|
358
|
+
let ra = _(() => {
|
|
359
|
+
if (!he) return null;
|
|
321
360
|
let e = /* @__PURE__ */ new Map(), t = (n) => n.forEach((n) => n.columns ? t(n.columns) : e.set(n.id, n));
|
|
322
361
|
t(be);
|
|
323
362
|
let n = (t, n) => {
|
|
324
363
|
let r = e.get(n);
|
|
325
364
|
return r ? typeof r.accessor == "function" ? r.accessor(t) : t[r.accessor ?? r.id] : t[n];
|
|
326
365
|
}, r = new Intl.NumberFormat(D, { maximumFractionDigits: 2 });
|
|
327
|
-
return
|
|
366
|
+
return ct(st(c ?? ar, he, n, (t, n, r) => {
|
|
328
367
|
let i = e.get(n)?.format;
|
|
329
|
-
return i ? i(r, t) :
|
|
330
|
-
}),
|
|
368
|
+
return i ? i(r, t) : qn(r);
|
|
369
|
+
}), he, {
|
|
331
370
|
header: (t) => e.get(t)?.header ?? t,
|
|
332
371
|
totalLabel: O.total,
|
|
333
|
-
format: (e) => typeof e == "number" ? r.format(e) :
|
|
372
|
+
format: (e) => typeof e == "number" ? r.format(e) : qn(e)
|
|
334
373
|
});
|
|
335
374
|
}, [
|
|
336
|
-
|
|
337
|
-
|
|
375
|
+
he,
|
|
376
|
+
c,
|
|
338
377
|
be,
|
|
339
378
|
D,
|
|
340
379
|
O
|
|
341
|
-
]), [
|
|
342
|
-
|
|
380
|
+
]), [ia, aa] = y(() => Ee("and", "root")), oa = pr ?? ia, [sa, ca] = y(!1), la = _(() => Array.isArray(Hn) ? Hn : Hn ? me(be, c ?? ar) : [], [
|
|
381
|
+
Hn,
|
|
343
382
|
be,
|
|
344
|
-
|
|
345
|
-
]),
|
|
346
|
-
|
|
347
|
-
},
|
|
383
|
+
c
|
|
384
|
+
]), ua = !!Hn && Le(oa, la), da = (e) => {
|
|
385
|
+
aa(e), mr?.(e);
|
|
386
|
+
}, fa = !!Hn && !!hr;
|
|
348
387
|
g(() => {
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
let
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
388
|
+
Hn && !hr && Ot("DataTable: `advancedFilter` has no editor, so the toolbar button is hidden – pass `renderAdvancedFilter={(props) => <ConditionBuilder {...props} />}` with ConditionBuilder from @wirecore/wirelayer-blocks-react");
|
|
389
|
+
}, [Hn, hr]);
|
|
390
|
+
let pa = _(() => ua && !pn ? (c ?? ar).filter((e) => Ke(e, oa, la, D)) : c, [
|
|
391
|
+
ua,
|
|
392
|
+
pn,
|
|
393
|
+
c,
|
|
394
|
+
oa,
|
|
395
|
+
la,
|
|
357
396
|
D
|
|
358
|
-
]),
|
|
397
|
+
]), ma = ra ? ra.rows : l ? $i.items : pa ?? ar, ha = ra ? ra.columns : be, k = pn || !!l, ga = l ? $i.totalCount ?? $i.items.length : mn, _a = !!l && $i.status === "error", va = Dn || !!l && $i.status === "loading", { leafDefs: A, columnById: j } = _(() => {
|
|
359
398
|
let e = /* @__PURE__ */ new Map(), t = [], n = (r) => r.forEach((r) => {
|
|
360
399
|
e.set(r.id, r), r.columns ? n(r.columns) : t.push(r);
|
|
361
400
|
});
|
|
362
|
-
return n(
|
|
401
|
+
return n(ha), {
|
|
363
402
|
leafDefs: t,
|
|
364
403
|
columnById: e
|
|
365
404
|
};
|
|
366
|
-
}, [
|
|
367
|
-
h !==
|
|
368
|
-
let
|
|
369
|
-
pageIndex:
|
|
370
|
-
pageSize:
|
|
371
|
-
}), [
|
|
372
|
-
let t = (
|
|
373
|
-
return
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
]), [
|
|
379
|
-
|
|
380
|
-
let [
|
|
405
|
+
}, [ha]), ya = (e, t) => typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor ?? e.id], M = (e, t, n) => e?.format ? e.format(t, n) : qn(t), ba = sr($t), [xa, Sa] = y(() => Yn(an)), N = _(() => ba === void 0 ? xa : Yn(ba), [ba, xa]), [Ca, wa] = y(0), [Ta, Ea] = y(h ?? 10), [Da, Oa] = y(h);
|
|
406
|
+
h !== Da && (Oa(h), Ea(h ?? 10));
|
|
407
|
+
let ka = gt === void 0 ? Qe === void 0 ? Ca : Qe - 1 : Math.floor(gt / Ta), Aa = Ta, P = _(() => ({
|
|
408
|
+
pageIndex: ka,
|
|
409
|
+
pageSize: Aa
|
|
410
|
+
}), [ka, Aa]), ja = (e) => {
|
|
411
|
+
let t = (c ?? ar).indexOf(e);
|
|
412
|
+
return De ? De(e, t) : t >= 0 ? String(t) : void 0;
|
|
413
|
+
}, Ma = sr(_n), Na = sr(yn), Pa = _(() => Na?.map(ja).filter((e) => e !== void 0), [Na]), [Fa, Ia] = y({}), La = _(() => Ma === void 0 ? Pa === void 0 ? Fa : $n(Pa) : $n(Ma), [
|
|
414
|
+
Ma,
|
|
415
|
+
Pa,
|
|
416
|
+
Fa
|
|
417
|
+
]), [Ra, za] = y(null), Ba = sr(wn), Va = Ba === void 0 ? Ra : Ba, [Ha, Ua] = y(Vi.showFilters ?? !0), Wa = Er ?? Ha, [F, Ga] = y(() => Jn(Wr)), Ka = Jn(Wr).join("\0"), [qa, Ja] = y(Ka);
|
|
418
|
+
Ka !== qa && (Ja(Ka), Ga(Jn(Wr)));
|
|
419
|
+
let [Ya, Xa] = y(() => In ? Qn(In) : Wr && !Vn ? !0 : {}), Za = sr(Fn), Qa = _(() => Za === void 0 ? Ya : Qn(Za), [Za, Ya]), [$a, eo] = y(""), I = yr ?? $a, [to, no] = y([]), ro = sr(Cr), io = _(() => ro === void 0 ? to : Zn(ro), [ro, to]), [ao, oo] = y({}), so = sr(Nr), co = _(() => so === void 0 ? ao : Qn(so, !1), [so, ao]), [lo, uo] = y([]), fo = sr(Lr) ?? lo, [po, mo] = y(null), ho = sr(zr), go = _(() => ho ?? po ?? {
|
|
381
420
|
start: A.filter((e) => e.pinned === "start").map((e) => e.id),
|
|
382
421
|
end: A.filter((e) => e.pinned === "end").map((e) => e.id)
|
|
383
422
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
423
|
+
ho,
|
|
424
|
+
po,
|
|
386
425
|
A
|
|
387
|
-
]), [
|
|
388
|
-
|
|
389
|
-
let
|
|
390
|
-
top: [...
|
|
426
|
+
]), [_o, vo] = y({}), [yo, bo] = y(pi ?? "md"), [xo, So] = y(pi);
|
|
427
|
+
pi !== xo && (So(pi), pi && bo(pi));
|
|
428
|
+
let Co = _(() => ({
|
|
429
|
+
top: [...Kr ?? []],
|
|
391
430
|
bottom: []
|
|
392
|
-
}), [
|
|
393
|
-
|
|
394
|
-
},
|
|
395
|
-
e.pageSize !== P.pageSize && (
|
|
396
|
-
},
|
|
397
|
-
|
|
431
|
+
}), [Kr]), wo = (e) => {
|
|
432
|
+
Sa(e), rn?.(dn === "multiple" ? [...e] : e[0] ?? null);
|
|
433
|
+
}, To = (e) => {
|
|
434
|
+
e.pageSize !== P.pageSize && (Ea(e.pageSize), We?.(e.pageSize)), wa(e.pageIndex), ht?.(e.pageIndex + 1), vt?.(e.pageIndex * e.pageSize);
|
|
435
|
+
}, Eo = v(/* @__PURE__ */ new Map()), Do = (e) => {
|
|
436
|
+
Ia(e);
|
|
398
437
|
let t = Object.keys(e).filter((t) => e[t]);
|
|
399
|
-
|
|
438
|
+
vn?.(t);
|
|
400
439
|
let n = L.getCoreRowModel().rowsById;
|
|
401
|
-
for (let t of [...
|
|
402
|
-
for (let e of t) n[e] &&
|
|
403
|
-
for (let t of
|
|
404
|
-
let n =
|
|
405
|
-
n !== void 0 && e[n] && !
|
|
440
|
+
for (let t of [...Eo.current.keys()]) e[t] || Eo.current.delete(t);
|
|
441
|
+
for (let e of t) n[e] && Eo.current.set(e, n[e].original);
|
|
442
|
+
for (let t of yn ?? []) {
|
|
443
|
+
let n = ja(t);
|
|
444
|
+
n !== void 0 && e[n] && !Eo.current.has(n) && Eo.current.set(n, t);
|
|
406
445
|
}
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
},
|
|
415
|
-
|
|
416
|
-
},
|
|
417
|
-
let e = (e) => !e.filter || e.filter === "text" || e.filter === "select" || e.filter === "multiSelect", t = (e, t, n) => e.format ? e.format(t, n) :
|
|
446
|
+
bn?.(t.flatMap((e) => Eo.current.has(e) ? [Eo.current.get(e)] : []));
|
|
447
|
+
}, Oo = (e) => {
|
|
448
|
+
za(e), Tn?.(e);
|
|
449
|
+
}, ko = (e) => {
|
|
450
|
+
Ua(e), Dr?.(e);
|
|
451
|
+
}, Ao = () => ko(!Wa), jo = (e) => {
|
|
452
|
+
Xa(e), Ln?.(e === !0 ? [] : Object.keys(e).filter((t) => e[t]));
|
|
453
|
+
}, Mo = (e) => {
|
|
454
|
+
bo(e), mi?.(e);
|
|
455
|
+
}, No = !!xr && !ra, Po = _(() => {
|
|
456
|
+
let e = (e) => !e.filter || e.filter === "text" || e.filter === "select" || e.filter === "multiSelect", t = (e, t, n) => e.format ? e.format(t, n) : qn(t), n = (r) => r.columns ? {
|
|
418
457
|
id: r.id,
|
|
419
458
|
header: r.header,
|
|
420
459
|
columns: r.columns.map(n)
|
|
@@ -426,143 +465,146 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
426
465
|
sortDescFirst: !1,
|
|
427
466
|
sortUndefined: "last",
|
|
428
467
|
...r.sortFn ? { sortFn: (e, t) => r.sortFn(e.original, t.original) } : {},
|
|
429
|
-
filterFn: (n, i, a) =>
|
|
468
|
+
filterFn: (n, i, a) => Ge({
|
|
430
469
|
value: n.getValue(i),
|
|
431
470
|
text: e(r) ? t(r, n.getValue(i), n.original) : "",
|
|
432
471
|
row: n.original,
|
|
433
472
|
type: r.filter,
|
|
434
473
|
locale: D,
|
|
435
474
|
filterFn: r.filterFn,
|
|
436
|
-
byValue:
|
|
475
|
+
byValue: tr(r)
|
|
437
476
|
}, a),
|
|
438
|
-
enableGlobalFilter:
|
|
477
|
+
enableGlobalFilter: No || r.searchable !== !1,
|
|
439
478
|
enableHiding: r.hideable !== !1,
|
|
440
479
|
enableGrouping: !0,
|
|
441
480
|
...r.width ? { size: r.width } : {},
|
|
442
|
-
minSize:
|
|
481
|
+
minSize: rr
|
|
443
482
|
};
|
|
444
|
-
return
|
|
483
|
+
return ha.map(n);
|
|
445
484
|
}, [
|
|
446
|
-
|
|
485
|
+
ha,
|
|
447
486
|
D,
|
|
448
|
-
|
|
449
|
-
]), L =
|
|
450
|
-
features:
|
|
451
|
-
columns:
|
|
452
|
-
data:
|
|
453
|
-
|
|
487
|
+
No
|
|
488
|
+
]), L = zn({
|
|
489
|
+
features: Un,
|
|
490
|
+
columns: Po,
|
|
491
|
+
data: ma,
|
|
492
|
+
meta: { locale: D },
|
|
493
|
+
getRowId: (e, t) => ra ? e.id : De?.(e, t) ?? String(t),
|
|
454
494
|
state: {
|
|
455
495
|
sorting: N,
|
|
456
496
|
pagination: P,
|
|
457
|
-
rowSelection:
|
|
458
|
-
expanded:
|
|
497
|
+
rowSelection: La,
|
|
498
|
+
expanded: Qa,
|
|
459
499
|
globalFilter: I,
|
|
460
|
-
columnFilters:
|
|
461
|
-
columnVisibility:
|
|
462
|
-
columnOrder:
|
|
463
|
-
columnPinning:
|
|
464
|
-
columnSizing:
|
|
500
|
+
columnFilters: io,
|
|
501
|
+
columnVisibility: co,
|
|
502
|
+
columnOrder: fo,
|
|
503
|
+
columnPinning: go,
|
|
504
|
+
columnSizing: _o,
|
|
465
505
|
grouping: F,
|
|
466
|
-
rowPinning:
|
|
506
|
+
rowPinning: Co
|
|
467
507
|
},
|
|
468
|
-
getSubRows:
|
|
469
|
-
filterFromLeafRows:
|
|
470
|
-
getRowCanExpand: (e) => !!
|
|
471
|
-
...
|
|
472
|
-
onExpandedChange: (e) =>
|
|
473
|
-
onSortingChange: (e) =>
|
|
474
|
-
onPaginationChange: (e) =>
|
|
475
|
-
onRowSelectionChange: (e) =>
|
|
508
|
+
getSubRows: Nn,
|
|
509
|
+
filterFromLeafRows: Pn === "lenient",
|
|
510
|
+
getRowCanExpand: (e) => !!Vn && (Bn?.(e.original) ?? !0) || !!e.subRows?.length,
|
|
511
|
+
...qr || w ? { autoResetExpanded: !1 } : {},
|
|
512
|
+
onExpandedChange: (e) => jo(C(e, Qa)),
|
|
513
|
+
onSortingChange: (e) => wo(C(e, N)),
|
|
514
|
+
onPaginationChange: (e) => To(C(e, P)),
|
|
515
|
+
onRowSelectionChange: (e) => Do(C(e, La)),
|
|
476
516
|
onGlobalFilterChange: (e) => {
|
|
477
517
|
let t = C(e, I) ?? "";
|
|
478
|
-
|
|
518
|
+
eo(t), br?.(t);
|
|
479
519
|
},
|
|
480
520
|
onColumnFiltersChange: (e) => {
|
|
481
|
-
let t = C(e,
|
|
482
|
-
|
|
521
|
+
let t = C(e, io);
|
|
522
|
+
no(t), wr?.(Xn(t));
|
|
483
523
|
},
|
|
484
524
|
onColumnVisibilityChange: (e) => {
|
|
485
|
-
let t = C(e,
|
|
486
|
-
|
|
525
|
+
let t = C(e, co);
|
|
526
|
+
oo(t), Pr?.(Object.keys(t).filter((e) => t[e] === !1));
|
|
487
527
|
},
|
|
488
528
|
onColumnOrderChange: (e) => {
|
|
489
|
-
let t = C(e,
|
|
490
|
-
|
|
529
|
+
let t = C(e, fo);
|
|
530
|
+
uo(t), Rr?.(t);
|
|
491
531
|
},
|
|
492
532
|
onColumnPinningChange: (e) => {
|
|
493
|
-
let t = C(e,
|
|
494
|
-
|
|
533
|
+
let t = C(e, go);
|
|
534
|
+
mo(t), Br?.({
|
|
495
535
|
start: [...t.start],
|
|
496
536
|
end: [...t.end]
|
|
497
537
|
});
|
|
498
538
|
},
|
|
499
|
-
onColumnSizingChange: (e) =>
|
|
539
|
+
onColumnSizingChange: (e) => vo((t) => C(e, t)),
|
|
500
540
|
onGroupingChange: (e) => {
|
|
501
541
|
let t = C(e, F);
|
|
502
|
-
|
|
542
|
+
Ga(t), Gr?.(t);
|
|
503
543
|
},
|
|
504
544
|
globalFilterFn: (e, t, n) => {
|
|
505
|
-
if (
|
|
545
|
+
if (No && qe(xr(e.original), n, D)) return !0;
|
|
506
546
|
let r = j.get(t);
|
|
507
|
-
return r?.searchable !== !1 &&
|
|
547
|
+
return r?.searchable !== !1 && Je([M(r, e.getValue(t), e.original)], n, D);
|
|
508
548
|
},
|
|
509
|
-
getColumnCanGlobalFilter: (e) =>
|
|
510
|
-
enableColumnResizing:
|
|
549
|
+
getColumnCanGlobalFilter: (e) => No || j.get(e.id)?.searchable !== !1,
|
|
550
|
+
enableColumnResizing: jr,
|
|
511
551
|
columnResizeMode: "onChange",
|
|
512
552
|
groupedColumnMode: !1,
|
|
513
553
|
keepPinnedRows: !0,
|
|
514
|
-
enableRowSelection: (e) =>
|
|
515
|
-
enableMultiRowSelection:
|
|
554
|
+
enableRowSelection: (e) => hn && !e.getIsGrouped() && (Sn?.(e.original) ?? !0),
|
|
555
|
+
enableMultiRowSelection: gn !== "single",
|
|
516
556
|
manualSorting: k,
|
|
517
557
|
manualFiltering: k,
|
|
518
558
|
manualPagination: k || !h,
|
|
519
|
-
rowCount: k ?
|
|
520
|
-
}), [R,
|
|
521
|
-
size:
|
|
522
|
-
gridlines:
|
|
523
|
-
bordered:
|
|
524
|
-
paginatorAlign:
|
|
525
|
-
striped:
|
|
526
|
-
scrollable: !!
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
559
|
+
rowCount: k ? ga : void 0
|
|
560
|
+
}), [R, Fo] = y(!1), Io = {
|
|
561
|
+
size: yo,
|
|
562
|
+
gridlines: Hi,
|
|
563
|
+
bordered: Ui,
|
|
564
|
+
paginatorAlign: nt(Jt),
|
|
565
|
+
striped: Wi,
|
|
566
|
+
scrollable: !!bi,
|
|
567
|
+
fill: bi === "fill",
|
|
568
|
+
wrapHeaders: Gi,
|
|
569
|
+
verticalHeaders: Ki
|
|
570
|
+
}, z = ni === "grid", Lo = z && !!Nn, B = Ci && !!bi && !!Xi.useVirtualizer, Ro = !!h, zo = _r && (vr ? vr === "center" : !!Vi.searchCentered), V = Bi({
|
|
571
|
+
...Io,
|
|
531
572
|
fullscreen: R,
|
|
532
|
-
grid: z
|
|
533
|
-
|
|
573
|
+
grid: z,
|
|
574
|
+
searchCentered: zo
|
|
575
|
+
}), Bo = (e) => {
|
|
534
576
|
let t = j.get(e);
|
|
535
|
-
return
|
|
536
|
-
...
|
|
577
|
+
return Bi({
|
|
578
|
+
...Io,
|
|
537
579
|
align: t?.align,
|
|
538
580
|
hideBelow: t?.hideBelow ? `hide-${t.hideBelow}` : void 0
|
|
539
581
|
});
|
|
540
|
-
},
|
|
582
|
+
}, Vo = (e, t) => {
|
|
541
583
|
let n = j.get(e)?.cellClass;
|
|
542
584
|
return typeof n == "function" ? t && !t.getIsGrouped() ? n(t.original) : void 0 : n;
|
|
543
|
-
},
|
|
544
|
-
...
|
|
545
|
-
...
|
|
546
|
-
...
|
|
547
|
-
...
|
|
548
|
-
], U =
|
|
585
|
+
}, Ho = A.some((e) => e.editable), Uo = T !== "row", H = [
|
|
586
|
+
...qr ? ["drag"] : [],
|
|
587
|
+
...hn ? ["select"] : [],
|
|
588
|
+
...Vn ? ["expand"] : [],
|
|
589
|
+
...Yr ? ["number"] : []
|
|
590
|
+
], U = Xr || T === "row" && Ho ? ["actions"] : [], W = L.getVisibleLeafColumns(), Wo = (e) => !U.length && W.at(-1)?.id === e, Go = W.length + H.length + U.length, Ko = jr || A.some((e) => e.width) || go.start.length > 0 || go.end.length > 0, qo = go.start.length > 0, Jo = go.end.length > 0, Yo = H.reduce((e, t) => e + ur[t], 0), Xo = U.reduce((e, t) => e + ur[t], 0), Zo = (e, t) => {
|
|
549
591
|
let n = L.getColumn(e), r = n?.getIsPinned();
|
|
550
592
|
if (!n || !r) return "";
|
|
551
593
|
let i = r === "start" ? L.getStartVisibleLeafColumns().at(-1)?.id === e && V.pinnedStartEdge() : L.getEndVisibleLeafColumns()[0]?.id === e && V.pinnedEndEdge();
|
|
552
594
|
return [t ? V.pinnedHead() : V.pinned(), i].filter(Boolean).join(" ");
|
|
553
|
-
},
|
|
595
|
+
}, Qo = (e, t) => {
|
|
554
596
|
let n = L.getColumn(e);
|
|
555
|
-
if (!n || !
|
|
597
|
+
if (!n || !Ko) return;
|
|
556
598
|
let r = n.getIsPinned();
|
|
557
599
|
return {
|
|
558
600
|
...t ? { width: n.getSize() } : {},
|
|
559
|
-
...r === "start" ? { insetInlineStart:
|
|
560
|
-
...r === "end" ? { insetInlineEnd:
|
|
601
|
+
...r === "start" ? { insetInlineStart: Yo + n.getStart("start") } : {},
|
|
602
|
+
...r === "end" ? { insetInlineEnd: Xo + n.getAfter("end") } : {}
|
|
561
603
|
};
|
|
562
|
-
},
|
|
563
|
-
if (!
|
|
564
|
-
let t = { width:
|
|
565
|
-
if (
|
|
604
|
+
}, $o = (e) => U.includes(e) ? Jo : qo, G = (e, t) => [e === "select" ? V.selectCell() : V.utilityCell(), $o(e) ? t ? V.pinnedHead() : V.pinned() : ""].filter(Boolean).join(" "), K = (e) => {
|
|
605
|
+
if (!Ko) return;
|
|
606
|
+
let t = { width: ur[e] };
|
|
607
|
+
if (!$o(e)) return t;
|
|
566
608
|
if (U.includes(e)) return {
|
|
567
609
|
...t,
|
|
568
610
|
insetInlineEnd: 0
|
|
@@ -570,15 +612,15 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
570
612
|
let n = H.slice(0, H.indexOf(e));
|
|
571
613
|
return {
|
|
572
614
|
...t,
|
|
573
|
-
insetInlineStart: n.reduce((e, t) => e +
|
|
615
|
+
insetInlineStart: n.reduce((e, t) => e + ur[t], 0)
|
|
574
616
|
};
|
|
575
|
-
},
|
|
617
|
+
}, es = L.getHeaderGroups(), ts = (() => {
|
|
576
618
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
577
|
-
|
|
619
|
+
es.forEach((n, r) => n.headers.forEach((n) => {
|
|
578
620
|
n.isPlaceholder || (e.set(n.column.id, r), t.set(n.column.id, n));
|
|
579
621
|
}));
|
|
580
622
|
let n = /* @__PURE__ */ new Set();
|
|
581
|
-
return
|
|
623
|
+
return es.map((r, i) => r.headers.flatMap((r) => {
|
|
582
624
|
let a = r.column.id;
|
|
583
625
|
if (n.has(a)) return [];
|
|
584
626
|
n.add(a);
|
|
@@ -589,31 +631,37 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
589
631
|
group: o.subHeaders.length > 0
|
|
590
632
|
}];
|
|
591
633
|
}));
|
|
592
|
-
})(), q = (e) => j.get(e.id)?.header ?? e.id,
|
|
634
|
+
})(), q = (e) => j.get(e.id)?.header ?? e.id, ns = (e) => j.get(e.id)?.headerHidden ? V.srOnly() : V.headLabel(), rs = (e) => {
|
|
635
|
+
let t = j.get(e);
|
|
636
|
+
return !!t && (t.sortable ?? ((gr ?? !!Vi.sortable) && is(t)));
|
|
637
|
+
}, is = (e) => {
|
|
638
|
+
let t = ma[0];
|
|
639
|
+
return !!e.sortFn || e.accessor !== void 0 || !!t && e.id in t;
|
|
640
|
+
}, as = (e) => {
|
|
593
641
|
let t = N[0];
|
|
594
|
-
return t?.id === e ? t.desc ? "descending" : "ascending" :
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
}, J = v(null),
|
|
598
|
-
|
|
642
|
+
return t?.id === e ? t.desc ? "descending" : "ascending" : rs(e) ? "none" : void 0;
|
|
643
|
+
}, os = (e) => N.findIndex((t) => t.id === e) + 1, [ss, cs] = y(""), ls = (e) => {
|
|
644
|
+
cs(""), setTimeout(() => cs(e));
|
|
645
|
+
}, J = v(null), us = v(!1);
|
|
646
|
+
cn(() => {
|
|
599
647
|
if (!J.current) return;
|
|
600
|
-
let e =
|
|
601
|
-
(
|
|
648
|
+
let e = Yi.current?.querySelector(J.current);
|
|
649
|
+
(us.current ? e?.closest("td") ?? e : e)?.focus(), J.current = null, us.current = !1;
|
|
602
650
|
});
|
|
603
|
-
let
|
|
651
|
+
let ds = Fr || Ir, fs = (e) => Ir && j.get(e)?.reorderable !== !1, ps = (e) => {
|
|
604
652
|
let t = j.get(e.id), n = e.getIsSorted(), r = e.getIsPinned(), i = W.map((e) => e.id), a = i.indexOf(e.id);
|
|
605
653
|
return [
|
|
606
|
-
|
|
654
|
+
rs(e.id) ? [
|
|
607
655
|
{
|
|
608
656
|
value: "sort-asc",
|
|
609
657
|
label: O.sortAscending,
|
|
610
|
-
icon:
|
|
658
|
+
icon: At,
|
|
611
659
|
disabled: n === "asc"
|
|
612
660
|
},
|
|
613
661
|
{
|
|
614
662
|
value: "sort-desc",
|
|
615
663
|
label: O.sortDescending,
|
|
616
|
-
icon:
|
|
664
|
+
icon: kt,
|
|
617
665
|
disabled: n === "desc"
|
|
618
666
|
},
|
|
619
667
|
...n ? [{
|
|
@@ -635,7 +683,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
635
683
|
label: O.unpin
|
|
636
684
|
}] : []
|
|
637
685
|
],
|
|
638
|
-
|
|
686
|
+
fs(e.id) ? [{
|
|
639
687
|
value: "move-earlier",
|
|
640
688
|
label: O.moveEarlier,
|
|
641
689
|
disabled: a <= 0
|
|
@@ -655,12 +703,12 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
655
703
|
label: O.hideColumn
|
|
656
704
|
}] : []]
|
|
657
705
|
].filter((e) => e.length).flatMap((e, t) => t ? [{ type: "separator" }, ...e] : e);
|
|
658
|
-
},
|
|
706
|
+
}, ms = (e, t, n) => {
|
|
659
707
|
let r = L.getAllLeafColumns().map((e) => e.id).filter((t) => t !== e);
|
|
660
708
|
r.splice(r.indexOf(t) + +!!n, 0, e), L.setColumnOrder(r);
|
|
661
709
|
let i = W.map((e) => e.id).filter((t) => t !== e);
|
|
662
|
-
i.splice(i.indexOf(t) + +!!n, 0, e),
|
|
663
|
-
},
|
|
710
|
+
i.splice(i.indexOf(t) + +!!n, 0, e), ls(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
711
|
+
}, hs = (e, t) => {
|
|
664
712
|
let n = W.map((e) => e.id), r = n.indexOf(e.id);
|
|
665
713
|
switch (J.current = `[data-column-menu="${CSS.escape(e.id)}"]`, t) {
|
|
666
714
|
case "sort-asc":
|
|
@@ -669,11 +717,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
669
717
|
id: e.id,
|
|
670
718
|
desc: t === "sort-desc"
|
|
671
719
|
};
|
|
672
|
-
|
|
720
|
+
dn === "multiple" ? os(e.id) ? wo(N.map((t) => t.id === e.id ? n : t)) : wo([...N, n]) : wo([n]);
|
|
673
721
|
break;
|
|
674
722
|
}
|
|
675
723
|
case "sort-clear":
|
|
676
|
-
|
|
724
|
+
wo(N.filter((t) => t.id !== e.id));
|
|
677
725
|
break;
|
|
678
726
|
case "pin-start":
|
|
679
727
|
case "pin-end":
|
|
@@ -681,10 +729,10 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
681
729
|
e.pin(t === "unpin" ? !1 : t === "pin-start" ? "start" : "end");
|
|
682
730
|
break;
|
|
683
731
|
case "move-earlier":
|
|
684
|
-
|
|
732
|
+
ms(e.id, n[r - 1], !1);
|
|
685
733
|
break;
|
|
686
734
|
case "move-later":
|
|
687
|
-
|
|
735
|
+
ms(e.id, n[r + 1], !0);
|
|
688
736
|
break;
|
|
689
737
|
case "group":
|
|
690
738
|
L.setGrouping([...F, e.id]);
|
|
@@ -699,78 +747,78 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
699
747
|
break;
|
|
700
748
|
}
|
|
701
749
|
}
|
|
702
|
-
}, [
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
if (!
|
|
750
|
+
}, [gs, _s] = y(null), [vs, ys] = y(null), bs = (e, t) => {
|
|
751
|
+
_s(e), t.dataTransfer.setData("text/plain", e), t.dataTransfer.effectAllowed = "move";
|
|
752
|
+
}, xs = (e, t) => {
|
|
753
|
+
if (!gs || gs === e || !fs(e)) return;
|
|
706
754
|
t.preventDefault();
|
|
707
755
|
let n = t.currentTarget, r = n.getBoundingClientRect(), i = getComputedStyle(n).direction === "rtl", a = t.clientX > r.left + r.width / 2;
|
|
708
|
-
|
|
756
|
+
ys({
|
|
709
757
|
id: e,
|
|
710
758
|
after: i ? !a : a
|
|
711
759
|
});
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
},
|
|
715
|
-
e.preventDefault(),
|
|
716
|
-
},
|
|
760
|
+
}, Ss = () => {
|
|
761
|
+
_s(null), ys(null);
|
|
762
|
+
}, Cs = (e) => {
|
|
763
|
+
e.preventDefault(), gs && vs && ms(gs, vs.id, vs.after), Ss();
|
|
764
|
+
}, ws = (e) => vs?.id === e ? vs.after ? "after" : "before" : void 0, Ts = (e, t) => {
|
|
717
765
|
let n = t.currentTarget.closest("th"), r = n?.closest("table");
|
|
718
766
|
if (!n || !r) return;
|
|
719
|
-
let i = j.get(e), a = B && i ? L.getRowModel().rows.map((t) => M(i, t.getValue(e), t.original)) : void 0, o =
|
|
767
|
+
let i = j.get(e), a = B && i ? L.getRowModel().rows.map((t) => M(i, t.getValue(e), t.original)) : void 0, o = Ae(r, n, a);
|
|
720
768
|
o && L.setColumnSizing((t) => ({
|
|
721
769
|
...t,
|
|
722
|
-
[e]: Math.min(1200, Math.max(
|
|
770
|
+
[e]: Math.min(1200, Math.max(rr, o))
|
|
723
771
|
}));
|
|
724
|
-
},
|
|
725
|
-
if (t.key === "Enter") return t.preventDefault(),
|
|
726
|
-
let n =
|
|
772
|
+
}, Es = (e, t) => {
|
|
773
|
+
if (t.key === "Enter") return t.preventDefault(), Ts(e, t);
|
|
774
|
+
let n = Ie(t.key, t.currentTarget) * ir;
|
|
727
775
|
if (!n) return;
|
|
728
776
|
t.preventDefault();
|
|
729
777
|
let r = L.getColumn(e);
|
|
730
778
|
L.setColumnSizing((t) => ({
|
|
731
779
|
...t,
|
|
732
|
-
[e]: Math.max(
|
|
780
|
+
[e]: Math.max(rr, r.getSize() + n)
|
|
733
781
|
}));
|
|
734
|
-
},
|
|
735
|
-
let t =
|
|
782
|
+
}, Ds = (e) => !!e && (!!e.filter || !!e.renderFilter), Os = Tr === "row" && Wa && A.some((e) => Ds(e)), ks = Tr === "menu" && Wa, As = !!I || io.length > 0 || ua, js = (e) => io.find((t) => t.id === e)?.value, Ms = (e) => e.filterOptions ?? [...new Set(ma.map((t) => M(e, ya(e, t), t)))].filter(Boolean).sort(), Ns = (e) => {
|
|
783
|
+
let t = js(e.id);
|
|
736
784
|
return t === void 0 ? e.filter === "multiSelect" ? [] : null : typeof t == "string" ? t : t.constraints[0]?.value ?? null;
|
|
737
|
-
},
|
|
785
|
+
}, Ps = (e, t) => L.getColumn(e)?.setFilterValue(t !== void 0 && Re(t) ? t : void 0), Fs = (e) => e.filterMatchMode ?? (tr(e) && e.filter === "multiSelect" ? "in" : Se[e.filter ?? "text"][0]), Is = (e) => Ue(Fs(e))?.input ?? e.filter ?? "text", Ls = (e, t) => {
|
|
738
786
|
let n = e.filter ?? "text";
|
|
739
|
-
if ((n === "text" || n === "select") && !e.filterMatchMode && !
|
|
740
|
-
|
|
787
|
+
if ((n === "text" || n === "select") && !e.filterMatchMode && !tr(e) && !e.renderFilter) return Ps(e.id, qn(t));
|
|
788
|
+
Ps(e.id, {
|
|
741
789
|
operator: "and",
|
|
742
790
|
constraints: [{
|
|
743
|
-
matchMode:
|
|
791
|
+
matchMode: Fs(e),
|
|
744
792
|
value: t
|
|
745
793
|
}]
|
|
746
794
|
});
|
|
747
|
-
},
|
|
748
|
-
let n =
|
|
795
|
+
}, Rs = (e) => !!Xi.dateRangeInput && ["date", "datetime"].includes(Is(e)), zs = (e, t) => {
|
|
796
|
+
let n = Ns(e);
|
|
749
797
|
return Array.isArray(n) ? n[t] : null;
|
|
750
|
-
},
|
|
751
|
-
let r =
|
|
752
|
-
i[t] = n,
|
|
753
|
-
},
|
|
754
|
-
|
|
798
|
+
}, Bs = (e, t, n) => {
|
|
799
|
+
let r = Ns(e), i = Array.isArray(r) ? [...r] : [null, null];
|
|
800
|
+
i[t] = n, Ls(e, i);
|
|
801
|
+
}, Vs = gn !== "single", Hs = Cn === "all" && k, Us = (e) => Hs && Va ? e.getCanSelect() && !Va.except.includes(e.id) : e.getIsSelected(), Ws = Hs && Va ? Math.max(0, (ga ?? ma.length) - Va.except.length) : Object.values(La).filter(Boolean).length, Gs = Hs ? Va ? !Va.except.length || "indeterminate" : Ws ? "indeterminate" : !1 : L.getIsAllPageRowsSelected() ? !0 : L.getIsSomePageRowsSelected() ? "indeterminate" : !1, Ks = (e) => {
|
|
802
|
+
Hs ? (Do({}), Oo(Va || !e ? null : {
|
|
755
803
|
mode: "all",
|
|
756
804
|
except: []
|
|
757
|
-
})) :
|
|
758
|
-
},
|
|
805
|
+
})) : Cn === "all" ? L.toggleAllRowsSelected(e) : L.toggleAllPageRowsSelected(e);
|
|
806
|
+
}, qs = `${Ji}-select`, Js = v(null), Ys = v(!1), Xs = (e, t, n = !1) => {
|
|
759
807
|
let r = L.getRowModel().rows.filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
760
|
-
if (
|
|
761
|
-
let i = new Set(
|
|
762
|
-
for (let a of n &&
|
|
763
|
-
|
|
808
|
+
if (Hs && Va) {
|
|
809
|
+
let i = new Set(Va.except);
|
|
810
|
+
for (let a of n && Js.current ? Fe(r, Js.current, e.id) : [e.id]) t ? i.delete(a) : i.add(a);
|
|
811
|
+
Oo({
|
|
764
812
|
mode: "all",
|
|
765
813
|
except: [...i]
|
|
766
814
|
});
|
|
767
|
-
} else
|
|
768
|
-
|
|
769
|
-
},
|
|
815
|
+
} else Do(Vs ? er(La, n && Js.current ? Fe(r, Js.current, e.id) : [e.id], t) : t ? $n([e.id]) : {});
|
|
816
|
+
Js.current = e.id;
|
|
817
|
+
}, Zs = (e) => Ys.current = e.shiftKey, Qs = "button, a, input, select, textarea, label, [role=checkbox], [role=combobox], [contenteditable]", $s = (e, t) => {
|
|
770
818
|
let n = t.target, r = !!n.closest("[data-row-link]");
|
|
771
|
-
if (!r && n.closest(
|
|
772
|
-
let i =
|
|
773
|
-
if (
|
|
819
|
+
if (!r && n.closest(Qs)) return;
|
|
820
|
+
let i = ei?.(e.original);
|
|
821
|
+
if (ti?.({
|
|
774
822
|
row: e.original,
|
|
775
823
|
rowId: e.id,
|
|
776
824
|
href: i,
|
|
@@ -778,11 +826,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
778
826
|
}), i) {
|
|
779
827
|
if (r || t.nativeEvent.defaultPrevented) return;
|
|
780
828
|
t.ctrlKey || t.metaKey || t.shiftKey ? window.open(i, "_blank", "noopener") : window.location.assign(i);
|
|
781
|
-
} else
|
|
782
|
-
},
|
|
783
|
-
let n =
|
|
784
|
-
t.button === 1 && n && !t.target.closest(
|
|
785
|
-
},
|
|
829
|
+
} else xn && e.getCanSelect() && Xs(e, !Vs || !Us(e), Vs && t.shiftKey);
|
|
830
|
+
}, ec = (e, t) => {
|
|
831
|
+
let n = ei?.(e.original);
|
|
832
|
+
t.button === 1 && n && !t.target.closest(Qs) && window.open(n, "_blank", "noopener");
|
|
833
|
+
}, tc = Kr?.length ? L.getCenterRows() : L.getRowModel().rows, nc = Kr?.length ? L.getTopRows() : [], Y = (_a ? ar : tc).flatMap((e) => e.getIsGrouped() ? [{
|
|
786
834
|
kind: "group",
|
|
787
835
|
row: e,
|
|
788
836
|
key: e.id
|
|
@@ -790,158 +838,158 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
790
838
|
kind: "row",
|
|
791
839
|
row: e,
|
|
792
840
|
key: e.id
|
|
793
|
-
}, ...
|
|
841
|
+
}, ...Vn && e.getCanExpand() && e.getIsExpanded() ? [{
|
|
794
842
|
kind: "expansion",
|
|
795
843
|
row: e,
|
|
796
844
|
key: `${e.id}:details`
|
|
797
|
-
}] : []]),
|
|
845
|
+
}] : []]), rc = h && !k ? P.pageIndex * P.pageSize : 0, ic = new Map(Y.filter((e) => e.kind === "row").map((e, t) => [e.row.id, rc + t + 1])), ac = (e) => Wi ? String(((ic.get(e.id) ?? 0) - rc) % 2 == 0) : void 0, oc = (e) => `${Ji}-details-${e.id}`, sc = L.getIsAllRowsExpanded(), cc = !!Nn || F.length > 0, lc = A.some((e) => e.aggregate), uc = A.some((e) => e.aggregate || e.footer || e.renderFooter), dc = (e, t, n) => t == null ? "" : e.format && n ? e.format(t, n) : typeof t == "number" ? new Intl.NumberFormat(D, { maximumFractionDigits: 2 }).format(t) : qn(t), fc = (e, t) => {
|
|
798
846
|
if (!e.aggregate) return "";
|
|
799
|
-
let n = t.filter((e) => !e.getIsGrouped()), r =
|
|
800
|
-
return
|
|
801
|
-
},
|
|
847
|
+
let n = t.filter((e) => !e.getIsGrouped()), r = ce(n.map((t) => ya(e, t.original)), e.aggregate);
|
|
848
|
+
return dc(e, r, e.aggregate === "count" ? void 0 : n[0]?.original);
|
|
849
|
+
}, pc = (e) => {
|
|
802
850
|
if (e.footer !== void 0) return e.footer;
|
|
803
851
|
if (!e.aggregate) return "";
|
|
804
|
-
let t =
|
|
852
|
+
let t = fc(e, L.getFilteredRowModel().flatRows);
|
|
805
853
|
return typeof e.aggregate == "string" ? O.aggregates[e.aggregate]?.(t) ?? t : t;
|
|
806
|
-
},
|
|
807
|
-
let t =
|
|
854
|
+
}, mc = (e) => {
|
|
855
|
+
let t = pc(e);
|
|
808
856
|
if (!e.renderFooter) return t;
|
|
809
|
-
let n = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = e.aggregate ?
|
|
857
|
+
let n = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = e.aggregate ? ce(n.map((t) => ya(e, t.original)), e.aggregate) : void 0;
|
|
810
858
|
return e.renderFooter({
|
|
811
859
|
value: r,
|
|
812
860
|
text: t,
|
|
813
861
|
rows: n.map((e) => e.original)
|
|
814
862
|
});
|
|
815
|
-
},
|
|
863
|
+
}, hc = (e) => typeof Xr == "function" ? Xr(e.original) : Xr ?? [], [gc, _c] = y(null), vc = (e) => {
|
|
816
864
|
let t = e.target.closest("[data-row-id]");
|
|
817
|
-
|
|
818
|
-
},
|
|
819
|
-
e &&
|
|
865
|
+
_c(t ? L.getRow(t.dataset.rowId, !0) ?? null : null);
|
|
866
|
+
}, yc = (e, t) => {
|
|
867
|
+
e && Zr?.({
|
|
820
868
|
value: t,
|
|
821
869
|
row: e.original,
|
|
822
870
|
rowId: e.id
|
|
823
871
|
});
|
|
824
|
-
},
|
|
872
|
+
}, bc = (e) => {
|
|
825
873
|
try {
|
|
826
874
|
return L.getRow(e, !0) ?? void 0;
|
|
827
875
|
} catch {
|
|
828
876
|
return;
|
|
829
877
|
}
|
|
830
|
-
}, [X,
|
|
878
|
+
}, [X, xc] = y(null), [Sc, Cc] = y(null), [wc, Tc] = y(null), Ec = v(null);
|
|
831
879
|
g(() => {
|
|
832
|
-
|
|
833
|
-
}, [
|
|
834
|
-
let
|
|
880
|
+
Ec.current &&= (Yi.current?.querySelector(`[data-drag-handle="${CSS.escape(Ec.current)}"]`)?.focus(), null);
|
|
881
|
+
}, [ma]);
|
|
882
|
+
let Dc = !!Nn, Oc = F.length > 0, kc = (e) => F.map((t) => Be(e.getValue(t))).join("\0"), Ac = (e) => F.map((t) => {
|
|
835
883
|
let n = j.get(t);
|
|
836
884
|
return `${n?.header ?? t}: ${M(n, e.getValue(t), e.original)}`;
|
|
837
|
-
}).join(", "),
|
|
885
|
+
}).join(", "), jc = () => Y.filter((e) => e.kind === "row" && (Oc || e.row.depth === 0)).map((e) => e.row), Mc = () => {
|
|
838
886
|
let e = (t) => t.map((t) => ({
|
|
839
887
|
id: t.id,
|
|
840
|
-
...
|
|
888
|
+
...Nn?.(t.original) ? { children: e(t.subRows) } : {}
|
|
841
889
|
}));
|
|
842
890
|
return e(L.getCoreRowModel().rows);
|
|
843
|
-
},
|
|
844
|
-
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o =
|
|
891
|
+
}, Nc = (e, t, n) => {
|
|
892
|
+
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o = Oc && kc(e) !== kc(t);
|
|
845
893
|
if (i === a && !o) return;
|
|
846
894
|
let s = o ? Object.fromEntries(F.map((e) => [e, t.getValue(e)])) : void 0;
|
|
847
|
-
|
|
895
|
+
Jr?.({
|
|
848
896
|
row: e.original,
|
|
849
897
|
rowId: e.id,
|
|
850
898
|
from: i,
|
|
851
899
|
to: a,
|
|
852
900
|
...s ? { group: s } : {}
|
|
853
901
|
});
|
|
854
|
-
let c =
|
|
855
|
-
|
|
856
|
-
},
|
|
902
|
+
let c = jc().filter((n) => n.id !== e.id && (!Oc || kc(n) === kc(t))).map((e) => e.id), l = c.indexOf(t.id) + +!!n + 1, ee = Zi(e.original, e.index);
|
|
903
|
+
ls(o ? O.rowMovedToGroup(ee, Ac(t), l, c.length + 1) : O.rowMoved(ee, l, c.length + 1));
|
|
904
|
+
}, Pc = (e, t) => {
|
|
857
905
|
if (!t) return;
|
|
858
|
-
let n =
|
|
859
|
-
|
|
906
|
+
let n = Mc(), r = t.parentId ? bc(t.parentId) : void 0, i = t.parentId ? He(n, t.parentId)?.node.children ?? [] : n;
|
|
907
|
+
Jr?.({
|
|
860
908
|
row: e.original,
|
|
861
909
|
rowId: e.id,
|
|
862
910
|
from: e.index,
|
|
863
911
|
to: t.index,
|
|
864
912
|
parentId: t.parentId,
|
|
865
913
|
index: t.index
|
|
866
|
-
}), r && !r.getIsExpanded() && r.toggleExpanded(!0),
|
|
867
|
-
},
|
|
868
|
-
if (
|
|
914
|
+
}), r && !r.getIsExpanded() && r.toggleExpanded(!0), ls(O.rowMovedInTree(Zi(e.original, e.index), r ? Zi(r.original, r.index) : null, t.index + 1, i.filter((t) => t.id !== e.id).length + 1));
|
|
915
|
+
}, Fc = (e, t) => {
|
|
916
|
+
if (Dc) {
|
|
869
917
|
let n = getComputedStyle(t.currentTarget).direction === "rtl", r = t.key === "ArrowUp" ? "up" : t.key === "ArrowDown" ? "down" : t.key === "ArrowRight" ? n ? "out" : "in" : t.key === "ArrowLeft" ? n ? "in" : "out" : void 0;
|
|
870
918
|
if (!r) return;
|
|
871
|
-
t.preventDefault(),
|
|
919
|
+
t.preventDefault(), Ec.current = e.id, Pc(e, Dt(Mc(), e.id, r));
|
|
872
920
|
return;
|
|
873
921
|
}
|
|
874
922
|
if (t.key !== "ArrowUp" && t.key !== "ArrowDown") return;
|
|
875
923
|
t.preventDefault();
|
|
876
|
-
let n =
|
|
877
|
-
if (
|
|
878
|
-
let r =
|
|
924
|
+
let n = jc();
|
|
925
|
+
if (Oc) {
|
|
926
|
+
let r = Ne(n.map((e) => ({
|
|
879
927
|
id: e.id,
|
|
880
|
-
group:
|
|
881
|
-
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r &&
|
|
928
|
+
group: kc(e)
|
|
929
|
+
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r && bc(r.targetId);
|
|
882
930
|
if (!r || !i) return;
|
|
883
|
-
|
|
931
|
+
Ec.current = e.id, Nc(e, i, r.after);
|
|
884
932
|
return;
|
|
885
933
|
}
|
|
886
934
|
let r = n[n.indexOf(e) + (t.key === "ArrowUp" ? -1 : 1)];
|
|
887
|
-
r && (
|
|
888
|
-
},
|
|
889
|
-
if (
|
|
890
|
-
|
|
891
|
-
},
|
|
935
|
+
r && (Ec.current = e.id, Nc(e, r, t.key === "ArrowDown"));
|
|
936
|
+
}, Ic = (e, t) => {
|
|
937
|
+
if (Sc !== e.id) return t.preventDefault();
|
|
938
|
+
xc(e.id), t.dataTransfer.setData("text/plain", e.id), t.dataTransfer.effectAllowed = "move";
|
|
939
|
+
}, Lc = (e, t) => {
|
|
892
940
|
if (!X || X === e.id) return;
|
|
893
941
|
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientY - n.top) / n.height;
|
|
894
|
-
if (
|
|
895
|
-
let n =
|
|
896
|
-
if (!
|
|
897
|
-
t.preventDefault(),
|
|
942
|
+
if (Dc) {
|
|
943
|
+
let n = Nn?.(e.original) ? r < .25 ? "before" : r > .75 ? "after" : "inside" : r < .5 ? "before" : "after";
|
|
944
|
+
if (!Tt(Mc(), X, e.id, n)) return Tc(null);
|
|
945
|
+
t.preventDefault(), Tc({
|
|
898
946
|
id: e.id,
|
|
899
947
|
position: n
|
|
900
948
|
});
|
|
901
|
-
} else t.preventDefault(),
|
|
949
|
+
} else t.preventDefault(), Tc({
|
|
902
950
|
id: e.id,
|
|
903
951
|
position: r > .5 ? "after" : "before"
|
|
904
952
|
});
|
|
905
|
-
},
|
|
906
|
-
X && (t.preventDefault(),
|
|
953
|
+
}, Rc = (e, t) => {
|
|
954
|
+
X && (t.preventDefault(), Tc({
|
|
907
955
|
id: e.id,
|
|
908
956
|
position: "inside"
|
|
909
957
|
}));
|
|
910
|
-
},
|
|
911
|
-
|
|
912
|
-
},
|
|
958
|
+
}, zc = () => {
|
|
959
|
+
xc(null), Tc(null), Cc(null);
|
|
960
|
+
}, Bc = (e) => {
|
|
913
961
|
e.preventDefault();
|
|
914
|
-
let t = X ?
|
|
915
|
-
if (t && n &&
|
|
916
|
-
if (
|
|
962
|
+
let t = X ? bc(X) : void 0, n = wc ? bc(wc.id) : void 0;
|
|
963
|
+
if (t && n && wc) {
|
|
964
|
+
if (Dc) Pc(t, Tt(Mc(), t.id, n.id, wc.position));
|
|
917
965
|
else if (n.getIsGrouped()) {
|
|
918
966
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped() && e.id !== t.id).at(-1);
|
|
919
|
-
e &&
|
|
920
|
-
} else
|
|
967
|
+
e && Nc(t, e, !0);
|
|
968
|
+
} else Nc(t, n, wc.position === "after");
|
|
921
969
|
}
|
|
922
|
-
|
|
923
|
-
},
|
|
924
|
-
|
|
925
|
-
},
|
|
926
|
-
let n =
|
|
970
|
+
zc();
|
|
971
|
+
}, Vc = (e) => wc?.id === e ? wc.position : void 0, [Hc, Uc] = y({}), Wc = v(Hc), Gc = (e) => {
|
|
972
|
+
Wc.current = e, Uc(e);
|
|
973
|
+
}, Kc = (e, t) => {
|
|
974
|
+
let n = ot(Hc, e.id, t);
|
|
927
975
|
return n ? n.value : e.getValue(t);
|
|
928
|
-
},
|
|
976
|
+
}, qc = w || T === "batch", [Jc] = y(() => new se()), [, Yc] = y(0), Xc = () => Yc((e) => e + 1), Zc = (e, t = !0, n = !1) => {
|
|
929
977
|
if (e.length) {
|
|
930
|
-
if (T === "batch")
|
|
978
|
+
if (T === "batch") Gc(le(Wc.current, e, n));
|
|
931
979
|
else for (let t of n ? [...e].reverse() : e) {
|
|
932
|
-
let e =
|
|
933
|
-
e &&
|
|
980
|
+
let e = bc(t.rowId);
|
|
981
|
+
e && di?.({
|
|
934
982
|
row: e.original,
|
|
935
983
|
rowId: e.id,
|
|
936
984
|
columnId: t.columnId,
|
|
937
985
|
value: n ? t.before : t.after
|
|
938
986
|
});
|
|
939
987
|
}
|
|
940
|
-
if (T === "row") for (let { rowId: t, values: r } of
|
|
941
|
-
let e =
|
|
988
|
+
if (T === "row") for (let { rowId: t, values: r } of de(e, n)) {
|
|
989
|
+
let e = bc(t);
|
|
942
990
|
if (!e) continue;
|
|
943
|
-
let n = A.filter((e) => e.editable).map((t) => [t.id,
|
|
944
|
-
|
|
991
|
+
let n = A.filter((e) => e.editable).map((t) => [t.id, Kc(e, t.id)]);
|
|
992
|
+
fi?.({
|
|
945
993
|
row: e.original,
|
|
946
994
|
rowId: t,
|
|
947
995
|
values: {
|
|
@@ -950,23 +998,23 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
950
998
|
}
|
|
951
999
|
});
|
|
952
1000
|
}
|
|
953
|
-
t &&
|
|
1001
|
+
t && qc && (Jc.push(e), Xc());
|
|
954
1002
|
}
|
|
955
|
-
},
|
|
956
|
-
let e =
|
|
957
|
-
e && (
|
|
958
|
-
},
|
|
959
|
-
let e =
|
|
960
|
-
e && (
|
|
961
|
-
},
|
|
1003
|
+
}, Qc = () => {
|
|
1004
|
+
let e = Jc.undo();
|
|
1005
|
+
e && (Zc(e, !1, !0), Xc(), ls(O.undone(e.length)));
|
|
1006
|
+
}, $c = () => {
|
|
1007
|
+
let e = Jc.redo();
|
|
1008
|
+
e && (Zc(e, !1), Xc(), ls(O.redone(e.length)));
|
|
1009
|
+
}, el = Object.keys(Hc).length, tl = () => {
|
|
962
1010
|
let e = $.current;
|
|
963
1011
|
(e?.querySelector("[tabindex=\"0\"]") ?? e)?.focus();
|
|
964
|
-
},
|
|
965
|
-
let e = Object.values(
|
|
1012
|
+
}, nl = () => {
|
|
1013
|
+
let e = Object.values(Wc.current);
|
|
966
1014
|
if (!e.length) return;
|
|
967
1015
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
968
1016
|
for (let r of e) {
|
|
969
|
-
let e =
|
|
1017
|
+
let e = bc(r.rowId);
|
|
970
1018
|
if (!e) continue;
|
|
971
1019
|
t.push({
|
|
972
1020
|
row: e.original,
|
|
@@ -982,139 +1030,139 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
982
1030
|
};
|
|
983
1031
|
i.values[r.columnId] = r.after, n.set(e.id, i);
|
|
984
1032
|
}
|
|
985
|
-
|
|
1033
|
+
oi?.({
|
|
986
1034
|
changes: t,
|
|
987
1035
|
rows: [...n.values()]
|
|
988
|
-
}),
|
|
989
|
-
},
|
|
990
|
-
Object.keys(
|
|
991
|
-
}, [
|
|
992
|
-
|
|
993
|
-
}, [
|
|
994
|
-
J.current = e,
|
|
995
|
-
},
|
|
1036
|
+
}), Gc({}), Jc.clear(), Xc(), ls(O.changesSaved(t.length)), tl();
|
|
1037
|
+
}, rl = () => {
|
|
1038
|
+
Object.keys(Wc.current).length && (Gc({}), Jc.clear(), Xc(), ls(O.changesDiscarded), tl());
|
|
1039
|
+
}, [il, al] = y(null), [ol, sl] = y(null), [cl, ll] = y({}), [ul, dl] = y({}), fl = v(cl), pl = (e) => {
|
|
1040
|
+
fl.current = e, ll(e);
|
|
1041
|
+
}, [ml, hl] = y(!1), gl = v(!1), _l = (e) => {
|
|
1042
|
+
J.current = e, us.current = z;
|
|
1043
|
+
}, vl = (e) => e.editor ?? "text", yl = (e, t) => `${e}:${t}`, bl = (e, t) => `${Ji}-error-${e}-${t}`, xl = "[data-editor] :is(input, button, [role=combobox], [tabindex=\"0\"])", Sl = () => Y.filter((e) => e.kind === "row").flatMap((e) => W.filter((e) => j.get(e.id)?.editable).map((t) => ({
|
|
996
1044
|
rowId: e.row.id,
|
|
997
1045
|
columnId: t.id
|
|
998
|
-
}))),
|
|
999
|
-
|
|
1046
|
+
}))), Cl = (e, t) => {
|
|
1047
|
+
El({
|
|
1000
1048
|
rowId: e.id,
|
|
1001
1049
|
columnId: t
|
|
1002
|
-
}),
|
|
1003
|
-
},
|
|
1004
|
-
let r =
|
|
1005
|
-
return r instanceof Promise ? (
|
|
1006
|
-
|
|
1050
|
+
}), pl({ [t]: Kc(e, t) }), dl({}), J.current = xl;
|
|
1051
|
+
}, wl = (e, t, n) => {
|
|
1052
|
+
let r = pe(t.map((t) => [t, () => j.get(t)?.validate?.(n[t], e.original)])), i = (e) => (dl(e), Object.keys(e).length === 0);
|
|
1053
|
+
return r instanceof Promise ? (gl.current = !0, hl(!0), r.then(i).finally(() => {
|
|
1054
|
+
gl.current = !1, hl(!1);
|
|
1007
1055
|
})) : i(r);
|
|
1008
|
-
},
|
|
1009
|
-
|
|
1010
|
-
},
|
|
1011
|
-
if (!
|
|
1012
|
-
let i =
|
|
1056
|
+
}, Tl = v(il), El = (e) => {
|
|
1057
|
+
Tl.current = e, al(e);
|
|
1058
|
+
}, Dl = (e, t, n, r = fl.current) => {
|
|
1059
|
+
if (!il || gl.current) return;
|
|
1060
|
+
let i = wl(e, [t], r);
|
|
1013
1061
|
i instanceof Promise ? i.then((i) => {
|
|
1014
|
-
let a =
|
|
1015
|
-
a?.rowId === e.id && a.columnId === t && (i ?
|
|
1016
|
-
}) : i ?
|
|
1017
|
-
},
|
|
1062
|
+
let a = Tl.current;
|
|
1063
|
+
a?.rowId === e.id && a.columnId === t && (i ? Ol(e, t, n, r) : J.current = xl);
|
|
1064
|
+
}) : i ? Ol(e, t, n, r) : J.current = xl;
|
|
1065
|
+
}, Ol = (e, t, n, r) => {
|
|
1018
1066
|
let i = r[t];
|
|
1019
|
-
|
|
1020
|
-
let a =
|
|
1021
|
-
if ((T === "batch" ? !
|
|
1067
|
+
El(null);
|
|
1068
|
+
let a = Kc(e, t);
|
|
1069
|
+
if ((T === "batch" ? !_t(i, a) : i !== e.getValue(t)) && Zc([{
|
|
1022
1070
|
rowId: e.id,
|
|
1023
1071
|
columnId: t,
|
|
1024
1072
|
before: a,
|
|
1025
1073
|
after: i
|
|
1026
1074
|
}]), n) {
|
|
1027
|
-
let r =
|
|
1028
|
-
if (i && a) return
|
|
1075
|
+
let r = Sl(), i = r[r.findIndex((n) => n.rowId === e.id && n.columnId === t) + n], a = i && L.getRow(i.rowId, !0);
|
|
1076
|
+
if (i && a) return Cl(a, i.columnId);
|
|
1029
1077
|
}
|
|
1030
|
-
|
|
1031
|
-
},
|
|
1032
|
-
|
|
1033
|
-
},
|
|
1034
|
-
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(),
|
|
1035
|
-
},
|
|
1078
|
+
_l(`[data-edit="${CSS.escape(yl(e.id, t))}"]`);
|
|
1079
|
+
}, kl = (e, t) => {
|
|
1080
|
+
El(null), dl({}), _l(`[data-edit="${CSS.escape(yl(e.id, t))}"]`);
|
|
1081
|
+
}, Al = (e, t, n) => {
|
|
1082
|
+
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(), kl(e, t)) : n.key === "Enter" && (n.target.matches("textarea") ? n.ctrlKey || n.metaKey : !n.target.matches("button, [role=combobox]")) ? (n.preventDefault(), Dl(e, t)) : n.key === "Tab" && (n.preventDefault(), Dl(e, t, n.shiftKey ? -1 : 1)));
|
|
1083
|
+
}, jl = (e, t, n) => {
|
|
1036
1084
|
let r = n.relatedTarget, i = n.currentTarget;
|
|
1037
|
-
r && (i.contains(r) || !
|
|
1038
|
-
},
|
|
1085
|
+
r && (i.contains(r) || !Yi.current?.contains(r) && r.closest("[data-scope]")) || Dl(e, t);
|
|
1086
|
+
}, Ml = (e, t, n) => {
|
|
1039
1087
|
let r = {
|
|
1040
|
-
...
|
|
1088
|
+
...fl.current,
|
|
1041
1089
|
[t.id]: n
|
|
1042
1090
|
};
|
|
1043
|
-
|
|
1044
|
-
},
|
|
1045
|
-
value:
|
|
1046
|
-
setValue: (e) =>
|
|
1047
|
-
...
|
|
1091
|
+
pl(r), Uo && nr.has(vl(t)) && !t.renderEditor && Dl(e, t.id, void 0, r);
|
|
1092
|
+
}, Nl = (e, t) => ({
|
|
1093
|
+
value: cl[t.id],
|
|
1094
|
+
setValue: (e) => pl({
|
|
1095
|
+
...fl.current,
|
|
1048
1096
|
[t.id]: e
|
|
1049
1097
|
}),
|
|
1050
1098
|
row: e.original,
|
|
1051
|
-
commit: () =>
|
|
1052
|
-
cancel: () =>
|
|
1053
|
-
invalid: !!
|
|
1054
|
-
}),
|
|
1055
|
-
|
|
1056
|
-
},
|
|
1057
|
-
if (
|
|
1058
|
-
let n =
|
|
1059
|
-
|
|
1099
|
+
commit: () => Uo ? Dl(e, t.id) : Fl(e, !0),
|
|
1100
|
+
cancel: () => Uo ? kl(e, t.id) : Fl(e, !1),
|
|
1101
|
+
invalid: !!ul[t.id]
|
|
1102
|
+
}), Pl = (e) => {
|
|
1103
|
+
sl(e.id), dl({}), pl(Object.fromEntries(A.filter((e) => e.editable).map((t) => [t.id, e.getValue(t.id)]))), J.current = xl;
|
|
1104
|
+
}, Fl = (e, t) => {
|
|
1105
|
+
if (gl.current) return;
|
|
1106
|
+
let n = fl.current, r = () => {
|
|
1107
|
+
sl(null), dl({}), _l(`[data-row-edit="${CSS.escape(e.id)}"]`);
|
|
1060
1108
|
};
|
|
1061
1109
|
if (!t) return r();
|
|
1062
1110
|
let i = A.filter((e) => e.editable).map((e) => e.id), a = (t) => {
|
|
1063
|
-
t ? (
|
|
1111
|
+
t ? (fi?.({
|
|
1064
1112
|
row: e.original,
|
|
1065
1113
|
rowId: e.id,
|
|
1066
1114
|
values: { ...n }
|
|
1067
|
-
}), r()) : J.current =
|
|
1068
|
-
}, o =
|
|
1115
|
+
}), r()) : J.current = xl;
|
|
1116
|
+
}, o = wl(e, i, n);
|
|
1069
1117
|
o instanceof Promise ? o.then(a) : a(o);
|
|
1070
|
-
},
|
|
1071
|
-
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(),
|
|
1072
|
-
}, [Z,
|
|
1073
|
-
if (!
|
|
1074
|
-
let n =
|
|
1075
|
-
return n >=
|
|
1076
|
-
},
|
|
1077
|
-
let t =
|
|
1118
|
+
}, Il = (e, t) => {
|
|
1119
|
+
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(), Fl(e, !1)) : t.key === "Enter" && t.target.matches("input") && (t.preventDefault(), Fl(e, !0)));
|
|
1120
|
+
}, [Z, Ll] = y(null), Rl = Y.filter((e) => e.kind === "row").map((e) => e.row.id), zl = W.map((e) => e.id), Bl = w ? pt(Z, Rl, zl) : null, Vl = new Map(Rl.map((e, t) => [e, t])), Hl = new Map(zl.map((e, t) => [e, t])), Ul = (e, t) => {
|
|
1121
|
+
if (!Bl) return !1;
|
|
1122
|
+
let n = Vl.get(e) ?? -1, r = Hl.get(t) ?? -1;
|
|
1123
|
+
return n >= Bl.top && n <= Bl.bottom && r >= Bl.left && r <= Bl.right;
|
|
1124
|
+
}, Wl = (e) => {
|
|
1125
|
+
let t = pt(e, Rl, zl);
|
|
1078
1126
|
if (!t) return null;
|
|
1079
|
-
let n =
|
|
1127
|
+
let n = Rl.slice(t.top, t.bottom + 1), r = zl.slice(t.left, t.right + 1), i = n.flatMap((e) => bc(e) ?? []);
|
|
1080
1128
|
return {
|
|
1081
1129
|
rowIds: n,
|
|
1082
1130
|
columnIds: r,
|
|
1083
1131
|
rows: i.map((e) => e.original),
|
|
1084
|
-
values: i.map((e) => r.map((t) =>
|
|
1132
|
+
values: i.map((e) => r.map((t) => Kc(e, t)))
|
|
1085
1133
|
};
|
|
1086
|
-
},
|
|
1087
|
-
e && Z && e.anchor.rowId === Z.anchor.rowId && e.anchor.columnId === Z.anchor.columnId && e.focus.rowId === Z.focus.rowId && e.focus.columnId === Z.focus.columnId || !e && !Z || (
|
|
1088
|
-
},
|
|
1134
|
+
}, Gl = (e) => {
|
|
1135
|
+
e && Z && e.anchor.rowId === Z.anchor.rowId && e.anchor.columnId === Z.anchor.columnId && e.focus.rowId === Z.focus.rowId && e.focus.columnId === Z.focus.columnId || !e && !Z || (Ll(e), ii?.(Wl(e)));
|
|
1136
|
+
}, Kl = v(!1), ql = v(!1), Jl = v(!1);
|
|
1089
1137
|
g(() => {
|
|
1090
1138
|
if (!w) return;
|
|
1091
|
-
let e = () =>
|
|
1139
|
+
let e = () => Kl.current = !1;
|
|
1092
1140
|
return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
|
|
1093
1141
|
}, [w]);
|
|
1094
|
-
let
|
|
1142
|
+
let Yl = (e, t, n) => {
|
|
1095
1143
|
if (!w || n.button !== 0 || n.target.closest("[data-editor]")) return;
|
|
1096
1144
|
let r = {
|
|
1097
1145
|
rowId: e,
|
|
1098
1146
|
columnId: t
|
|
1099
1147
|
}, i = n.shiftKey && Z;
|
|
1100
|
-
|
|
1148
|
+
Gl(i ? {
|
|
1101
1149
|
anchor: Z.anchor,
|
|
1102
1150
|
focus: r
|
|
1103
1151
|
} : {
|
|
1104
1152
|
anchor: r,
|
|
1105
1153
|
focus: r
|
|
1106
|
-
}),
|
|
1107
|
-
},
|
|
1108
|
-
|
|
1154
|
+
}), Kl.current = !0, Jl.current = !!i, i && window.getSelection()?.removeAllRanges();
|
|
1155
|
+
}, Xl = (e, t, n) => {
|
|
1156
|
+
Kl.current && Z && n.buttons & 1 && (Gl({
|
|
1109
1157
|
anchor: Z.anchor,
|
|
1110
1158
|
focus: {
|
|
1111
1159
|
rowId: e,
|
|
1112
1160
|
columnId: t
|
|
1113
1161
|
}
|
|
1114
1162
|
}), window.getSelection()?.removeAllRanges());
|
|
1115
|
-
},
|
|
1116
|
-
|
|
1117
|
-
},
|
|
1163
|
+
}, Zl = (e) => {
|
|
1164
|
+
Jl.current && (Jl.current = !1, e.preventDefault(), e.stopPropagation());
|
|
1165
|
+
}, Ql = (e, t) => $.current?.querySelector(`tr[data-row-id="${CSS.escape(e)}"] > [data-column-id="${CSS.escape(t)}"]`) ?? null, $l = (e) => {
|
|
1118
1166
|
let t = e.target, n = e.key;
|
|
1119
1167
|
if (!w || !z || !e.shiftKey || e.altKey || ![
|
|
1120
1168
|
"ArrowUp",
|
|
@@ -1126,7 +1174,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1126
1174
|
].includes(n)) return !1;
|
|
1127
1175
|
let r = t.closest("tr")?.dataset.rowId, i = t.dataset.columnId;
|
|
1128
1176
|
if (!r || !i || !t.matches("td")) return !1;
|
|
1129
|
-
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s = Z &&
|
|
1177
|
+
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s = Z && Ul(r, i) ? Z : {
|
|
1130
1178
|
anchor: {
|
|
1131
1179
|
rowId: r,
|
|
1132
1180
|
columnId: i
|
|
@@ -1135,46 +1183,46 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1135
1183
|
rowId: r,
|
|
1136
1184
|
columnId: i
|
|
1137
1185
|
}
|
|
1138
|
-
}, c =
|
|
1139
|
-
e.preventDefault(),
|
|
1140
|
-
let
|
|
1141
|
-
let e =
|
|
1142
|
-
return e ? (
|
|
1186
|
+
}, c = Oe(s, Rl, zl, o, e.ctrlKey || e.metaKey);
|
|
1187
|
+
e.preventDefault(), Gl(c);
|
|
1188
|
+
let l = () => {
|
|
1189
|
+
let e = Ql(c.focus.rowId, c.focus.columnId);
|
|
1190
|
+
return e ? (ql.current = !0, e.focus(), ql.current = !1, e.scrollIntoView?.({
|
|
1143
1191
|
block: "nearest",
|
|
1144
1192
|
inline: "nearest"
|
|
1145
1193
|
}), !0) : !1;
|
|
1146
1194
|
};
|
|
1147
|
-
return !
|
|
1148
|
-
},
|
|
1149
|
-
let e =
|
|
1195
|
+
return !l() && B && (Ku?.scrollToIndex(Y.findIndex((e) => e.kind === "row" && e.row.id === c.focus.rowId)), requestAnimationFrame(() => requestAnimationFrame(() => void l()))), !0;
|
|
1196
|
+
}, eu = (e, t) => M(j.get(t), Kc(e, t), e.original), tu = () => {
|
|
1197
|
+
let e = Wl(Z);
|
|
1150
1198
|
if (e) {
|
|
1151
|
-
let t = e.rowIds.flatMap((e) =>
|
|
1199
|
+
let t = e.rowIds.flatMap((e) => bc(e) ?? []);
|
|
1152
1200
|
return {
|
|
1153
|
-
text:
|
|
1201
|
+
text: wt(t.map((t) => e.columnIds.map((e) => eu(t, e)))),
|
|
1154
1202
|
count: t.length * e.columnIds.length
|
|
1155
1203
|
};
|
|
1156
1204
|
}
|
|
1157
|
-
let t = Y.filter((e) => e.kind === "row" &&
|
|
1205
|
+
let t = Y.filter((e) => e.kind === "row" && Us(e.row)).map((e) => e.row);
|
|
1158
1206
|
return t.length ? {
|
|
1159
|
-
text:
|
|
1160
|
-
count: t.length *
|
|
1207
|
+
text: wt(t.map((e) => zl.map((t) => eu(e, t)))),
|
|
1208
|
+
count: t.length * zl.length
|
|
1161
1209
|
} : null;
|
|
1162
|
-
},
|
|
1210
|
+
}, nu = () => {
|
|
1163
1211
|
let e = document.activeElement;
|
|
1164
|
-
return !!e && !!$.current?.contains(e) && !e.closest(
|
|
1165
|
-
},
|
|
1166
|
-
if (!
|
|
1167
|
-
let t =
|
|
1168
|
-
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(),
|
|
1169
|
-
},
|
|
1170
|
-
let t =
|
|
1212
|
+
return !!e && !!$.current?.contains(e) && !e.closest(lr);
|
|
1213
|
+
}, ru = (e) => {
|
|
1214
|
+
if (!nu() || !e.clipboardData || window.getSelection()?.toString()) return;
|
|
1215
|
+
let t = tu();
|
|
1216
|
+
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(), ls(O.cellsCopied(t.count)));
|
|
1217
|
+
}, iu = async (e) => {
|
|
1218
|
+
let t = it(e), n = pt(Z, Rl, zl);
|
|
1171
1219
|
if (!t.length || !n || !Z) return;
|
|
1172
|
-
let r =
|
|
1220
|
+
let r = at(t, {
|
|
1173
1221
|
row: n.top,
|
|
1174
1222
|
column: n.left
|
|
1175
|
-
},
|
|
1223
|
+
}, Rl, zl, n), i = [], a = [];
|
|
1176
1224
|
for (let e of r) {
|
|
1177
|
-
let t = j.get(e.columnId), n =
|
|
1225
|
+
let t = j.get(e.columnId), n = bc(e.rowId);
|
|
1178
1226
|
if (!t || !n) continue;
|
|
1179
1227
|
if (!t.editable) {
|
|
1180
1228
|
i.push({
|
|
@@ -1183,7 +1231,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1183
1231
|
});
|
|
1184
1232
|
continue;
|
|
1185
1233
|
}
|
|
1186
|
-
let r =
|
|
1234
|
+
let r = rt(e.text, vl(t), {
|
|
1187
1235
|
locale: D,
|
|
1188
1236
|
choices: t.editOptions
|
|
1189
1237
|
});
|
|
@@ -1194,8 +1242,8 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1194
1242
|
});
|
|
1195
1243
|
continue;
|
|
1196
1244
|
}
|
|
1197
|
-
let o =
|
|
1198
|
-
|
|
1245
|
+
let o = Kc(n, e.columnId);
|
|
1246
|
+
_t(r.value, o) || a.push({
|
|
1199
1247
|
change: {
|
|
1200
1248
|
rowId: n.id,
|
|
1201
1249
|
columnId: t.id,
|
|
@@ -1206,7 +1254,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1206
1254
|
def: t
|
|
1207
1255
|
});
|
|
1208
1256
|
}
|
|
1209
|
-
let o = await
|
|
1257
|
+
let o = await pe(a.map(({ change: e, row: t, def: n }, r) => [String(r), () => n.validate?.(e.after, t.original)])), s = a.filter((e, t) => {
|
|
1210
1258
|
let n = o[String(t)];
|
|
1211
1259
|
return n && i.push({
|
|
1212
1260
|
rowId: e.change.rowId,
|
|
@@ -1228,113 +1276,113 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1228
1276
|
c.defaultPrevented = !0;
|
|
1229
1277
|
}
|
|
1230
1278
|
};
|
|
1231
|
-
|
|
1232
|
-
},
|
|
1233
|
-
if (!
|
|
1279
|
+
ai?.(c), !c.defaultPrevented && (Zc(s.map(({ change: e }) => e)), Gl(ft(r, Rl, zl)), ls(O.cellsPasted(s.length, i.length)));
|
|
1280
|
+
}, au = (e) => {
|
|
1281
|
+
if (!nu()) return;
|
|
1234
1282
|
let t = e.clipboardData?.getData("text/plain");
|
|
1235
|
-
t && (e.preventDefault(),
|
|
1283
|
+
t && (e.preventDefault(), iu(t));
|
|
1236
1284
|
};
|
|
1237
1285
|
g(() => {
|
|
1238
|
-
if (w) return document.addEventListener("copy",
|
|
1239
|
-
document.removeEventListener("copy",
|
|
1286
|
+
if (w) return document.addEventListener("copy", ru), document.addEventListener("paste", au), () => {
|
|
1287
|
+
document.removeEventListener("copy", ru), document.removeEventListener("paste", au);
|
|
1240
1288
|
};
|
|
1241
1289
|
});
|
|
1242
|
-
let
|
|
1243
|
-
if (!
|
|
1244
|
-
let t =
|
|
1245
|
-
return t ? (e.preventDefault(), t === "undo" ?
|
|
1246
|
-
}, [
|
|
1290
|
+
let ou = (e) => {
|
|
1291
|
+
if (!qc || e.target.closest(lr)) return !1;
|
|
1292
|
+
let t = Pe(e);
|
|
1293
|
+
return t ? (e.preventDefault(), t === "undo" ? Qc() : $c(), !0) : !1;
|
|
1294
|
+
}, [su, cu] = y(!1), [lu, uu] = y(""), [du, fu] = y(0), pu = si && su && !!lu.trim(), mu = pu ? (Ro && !k ? L.getPrePaginatedRowModel().rows : L.getRowModel().rows).filter((e) => !e.getIsGrouped()) : [], Q = pu ? ke(mu.map((e) => ({
|
|
1247
1295
|
id: e.id,
|
|
1248
1296
|
cells: W.map((t) => ({
|
|
1249
1297
|
columnId: t.id,
|
|
1250
|
-
text:
|
|
1298
|
+
text: eu(e, t.id)
|
|
1251
1299
|
}))
|
|
1252
|
-
})),
|
|
1300
|
+
})), lu, D) : [], hu = Q.length ? Q[Math.min(du, Q.length - 1)] : void 0, gu = new Set(Q.map((e) => `${e.rowId}\u0000${e.columnId}`)), _u = (e, t) => pu ? hu?.rowId === e && hu.columnId === t ? V.findCurrent() : gu.has(`${e}\u0000${t}`) ? V.findMatch() : "" : "", vu = v(!1), yu = (e) => {
|
|
1253
1301
|
if (!Q.length) return;
|
|
1254
1302
|
let t = (e + Q.length) % Q.length;
|
|
1255
|
-
|
|
1303
|
+
fu(t);
|
|
1256
1304
|
let n = Q[t];
|
|
1257
|
-
if (
|
|
1258
|
-
let e =
|
|
1305
|
+
if (Ro && !k) {
|
|
1306
|
+
let e = mu.findIndex((e) => e.id === n.rowId), t = Math.floor(e / P.pageSize);
|
|
1259
1307
|
e >= 0 && t !== P.pageIndex && L.setPageIndex(t);
|
|
1260
1308
|
}
|
|
1261
|
-
|
|
1309
|
+
vu.current = !0;
|
|
1262
1310
|
};
|
|
1263
1311
|
g(() => {
|
|
1264
|
-
if (!
|
|
1265
|
-
|
|
1266
|
-
let e = () =>
|
|
1312
|
+
if (!vu.current || !hu) return;
|
|
1313
|
+
vu.current = !1;
|
|
1314
|
+
let e = () => Ql(hu.rowId, hu.columnId)?.scrollIntoView?.({
|
|
1267
1315
|
block: "nearest",
|
|
1268
1316
|
inline: "nearest"
|
|
1269
|
-
}), t = Y.findIndex((e) => e.kind === "row" && e.row.id ===
|
|
1270
|
-
B && t >= 0 ? (
|
|
1317
|
+
}), t = Y.findIndex((e) => e.kind === "row" && e.row.id === hu.rowId);
|
|
1318
|
+
B && t >= 0 ? (Ku?.scrollToIndex(t, { align: "center" }), requestAnimationFrame(() => requestAnimationFrame(e))) : e();
|
|
1271
1319
|
});
|
|
1272
|
-
let
|
|
1273
|
-
let e = !
|
|
1274
|
-
|
|
1275
|
-
},
|
|
1276
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
1277
|
-
},
|
|
1278
|
-
|
|
1279
|
-
},
|
|
1280
|
-
if (!
|
|
1281
|
-
let e = Y.map((e) => e.kind === "row" ?
|
|
1320
|
+
let bu = () => {
|
|
1321
|
+
let e = !su;
|
|
1322
|
+
cu(e), J.current = e ? "[data-find-input] input, input[data-find-input]" : "[data-find-toggle]";
|
|
1323
|
+
}, xu = (e) => {
|
|
1324
|
+
e.key === "Enter" ? (e.preventDefault(), yu(du + (e.shiftKey ? -1 : 1))) : e.key === "Escape" && (e.preventDefault(), bu());
|
|
1325
|
+
}, Su = (e) => {
|
|
1326
|
+
uu(e), fu(0), vu.current = !0;
|
|
1327
|
+
}, Cu = !B && A.some((e) => e.rowSpan === "auto" || e.colSpan), wu = (e) => `${Ji}-head-${e}`, Tu = (() => {
|
|
1328
|
+
if (!Cu) return;
|
|
1329
|
+
let e = Y.map((e) => e.kind === "row" ? mt(W.map((t) => j.get(t.id)?.colSpan?.(e.row.original) ?? 1)) : W.map(() => 1)), t = Y.map((e, t) => e.kind !== "row" || Y[t - 1]?.kind !== "row"), n = W.map((e) => j.get(e.id)?.rowSpan === "auto"), r = (t, n) => Y.map((r, i) => r.kind === "row" && e[i][n] === 1 ? eu(r.row, t) : null), i = ue(W.flatMap((e, t) => n[t] ? [r(e.id, t)] : []), t), a = 0;
|
|
1282
1330
|
return {
|
|
1283
1331
|
columnSpans: e,
|
|
1284
1332
|
rowSpans: n.map((e) => e ? i[a++] : void 0)
|
|
1285
1333
|
};
|
|
1286
|
-
})(),
|
|
1287
|
-
rowSpan:
|
|
1288
|
-
colSpan:
|
|
1289
|
-
}),
|
|
1290
|
-
if (!
|
|
1291
|
-
let { rowSpan: n, colSpan: r } =
|
|
1334
|
+
})(), Eu = (e, t) => ({
|
|
1335
|
+
rowSpan: Tu?.rowSpans[t]?.[e] ?? 1,
|
|
1336
|
+
colSpan: Tu?.columnSpans[e]?.[t] ?? 1
|
|
1337
|
+
}), Du = (e, t) => {
|
|
1338
|
+
if (!Cu) return {};
|
|
1339
|
+
let { rowSpan: n, colSpan: r } = Eu(e, t);
|
|
1292
1340
|
return {
|
|
1293
1341
|
...n > 1 ? { rowSpan: n } : {},
|
|
1294
1342
|
...r > 1 ? { colSpan: r } : {},
|
|
1295
|
-
headers: W.slice(t, t + r).map((e) =>
|
|
1343
|
+
headers: W.slice(t, t + r).map((e) => wu(e.id)).join(" ")
|
|
1296
1344
|
};
|
|
1297
|
-
},
|
|
1298
|
-
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = (e.selectionOnly ? L.getSelectedRowModel().flatRows : L.getSortedRowModel().flatRows).filter((e) => !e.getIsGrouped()).map((e) => t.map((t) => t.exportValue ? t.exportValue(e.original) : M(t, e.getValue(t.id), e.original))), r = e.separator ??
|
|
1345
|
+
}, Ou = (e = {}) => {
|
|
1346
|
+
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = (e.selectionOnly ? L.getSelectedRowModel().flatRows : L.getSortedRowModel().flatRows).filter((e) => !e.getIsGrouped()).map((e) => t.map((t) => t.exportValue ? t.exportValue(e.original) : M(t, e.getValue(t.id), e.original))), r = e.separator ?? Hr ?? ve(D), i = St([t.map((e) => e.exportHeader ?? e.header), ...n], r);
|
|
1299
1347
|
return e.bom === !1 ? i.slice(1) : i;
|
|
1300
|
-
},
|
|
1348
|
+
}, ku = (e = !1) => {
|
|
1301
1349
|
let t = typeof e == "boolean" ? { selectionOnly: e } : e;
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1350
|
+
Te(`${t.filename ?? Vr ?? "export"}.csv`, Ou(t));
|
|
1351
|
+
}, Au = (e) => [{
|
|
1304
1352
|
row: e,
|
|
1305
1353
|
group: e.getIsGrouped(),
|
|
1306
1354
|
depth: e.depth
|
|
1307
|
-
}, ...e.subRows.flatMap(
|
|
1355
|
+
}, ...e.subRows.flatMap(Au)], ju = (e = !1) => e ? L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped()).map((e) => ({
|
|
1308
1356
|
row: e,
|
|
1309
1357
|
group: !1,
|
|
1310
1358
|
depth: 0
|
|
1311
|
-
})) : L.getSortedRowModel().rows.flatMap(
|
|
1359
|
+
})) : L.getSortedRowModel().rows.flatMap(Au), Mu = (e) => {
|
|
1312
1360
|
let t = j.get(e.groupingColumnId);
|
|
1313
1361
|
return `${t?.header ?? ""}: ${M(t, e.groupingValue, e.original)} (${e.getLeafRows().filter((e) => !e.getIsGrouped()).length})`;
|
|
1314
|
-
},
|
|
1362
|
+
}, Nu = (e) => e.editor === "datetime" ? "datetime" : e.filter === "date" || e.editor === "date" ? "date" : void 0, Pu = (e, t, n) => {
|
|
1315
1363
|
if (e == null || e === "") return null;
|
|
1316
1364
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
1317
1365
|
if (e instanceof Date) return {
|
|
1318
1366
|
date: e,
|
|
1319
|
-
time:
|
|
1367
|
+
time: Nu(t) === "datetime"
|
|
1320
1368
|
};
|
|
1321
|
-
let r =
|
|
1369
|
+
let r = Nu(t);
|
|
1322
1370
|
return r && (typeof e == "string" || typeof e == "number") ? {
|
|
1323
1371
|
date: e,
|
|
1324
1372
|
time: r === "datetime"
|
|
1325
|
-
} : typeof e == "boolean" && !t.format ? e : n ? M(t, e, n) :
|
|
1326
|
-
},
|
|
1327
|
-
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n =
|
|
1373
|
+
} : typeof e == "boolean" && !t.format ? e : n ? M(t, e, n) : qn(e);
|
|
1374
|
+
}, Fu = (e = {}) => {
|
|
1375
|
+
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = ju(e.selectionOnly).filter((t) => !t.group || e.groups !== !1).map(({ row: n, group: r, depth: i }) => {
|
|
1328
1376
|
if (r) {
|
|
1329
1377
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped());
|
|
1330
1378
|
return {
|
|
1331
1379
|
kind: "group",
|
|
1332
1380
|
level: i,
|
|
1333
1381
|
cells: t.map((t, r) => {
|
|
1334
|
-
if (r === 0) return
|
|
1382
|
+
if (r === 0) return Mu(n);
|
|
1335
1383
|
if (!t.aggregate) return null;
|
|
1336
|
-
let i =
|
|
1337
|
-
return typeof i == "number" ? i :
|
|
1384
|
+
let i = ce(e.map((e) => ya(t, e.original)), t.aggregate);
|
|
1385
|
+
return typeof i == "number" ? i : qn(i);
|
|
1338
1386
|
})
|
|
1339
1387
|
};
|
|
1340
1388
|
}
|
|
@@ -1343,9 +1391,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1343
1391
|
cells: t.map((e) => {
|
|
1344
1392
|
if (e.exportValue) {
|
|
1345
1393
|
let t = e.exportValue(n.original);
|
|
1346
|
-
return typeof t == "number" || typeof t == "boolean" ? t : t instanceof Date ? { date: t } :
|
|
1394
|
+
return typeof t == "number" || typeof t == "boolean" ? t : t instanceof Date ? { date: t } : qn(t);
|
|
1347
1395
|
}
|
|
1348
|
-
return
|
|
1396
|
+
return Pu(n.getValue(e.id), e, n.original);
|
|
1349
1397
|
})
|
|
1350
1398
|
};
|
|
1351
1399
|
});
|
|
@@ -1353,152 +1401,152 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1353
1401
|
let e = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = t.map((t) => {
|
|
1354
1402
|
if (t.footer !== void 0) return t.footer;
|
|
1355
1403
|
if (!t.aggregate) return null;
|
|
1356
|
-
let n =
|
|
1357
|
-
return typeof n == "number" ? n :
|
|
1404
|
+
let n = ce(e.map((e) => ya(t, e.original)), t.aggregate);
|
|
1405
|
+
return typeof n == "number" ? n : qn(n);
|
|
1358
1406
|
});
|
|
1359
1407
|
r[0] === null && (r[0] = O.total), n.push({
|
|
1360
1408
|
kind: "total",
|
|
1361
1409
|
cells: r
|
|
1362
1410
|
});
|
|
1363
1411
|
}
|
|
1364
|
-
return
|
|
1365
|
-
name: e.sheetName ??
|
|
1412
|
+
return _e({
|
|
1413
|
+
name: e.sheetName ?? Ce,
|
|
1366
1414
|
columns: t.map((e) => ({ header: e.exportHeader ?? e.header })),
|
|
1367
1415
|
rows: n
|
|
1368
1416
|
});
|
|
1369
|
-
},
|
|
1370
|
-
let t = W.map((e) => j.get(e.id)), n =
|
|
1417
|
+
}, Iu = (e = {}) => we(`${e.filename ?? Vr ?? "export"}.xlsx`, Fu(e)), Lu = (e, t) => e === "xlsx" ? Iu({ selectionOnly: t }) : ku(t), Ru = (e = {}) => {
|
|
1418
|
+
let t = W.map((e) => j.get(e.id)), n = ts.map((e) => e.map((e) => ({
|
|
1371
1419
|
text: q(e.header.column),
|
|
1372
1420
|
colSpan: e.group ? e.header.colSpan : 1,
|
|
1373
1421
|
rowSpan: e.rowSpan,
|
|
1374
1422
|
align: e.group ? void 0 : j.get(e.header.column.id)?.align
|
|
1375
|
-
}))), r =
|
|
1423
|
+
}))), r = ju(e.selectionOnly).map(({ row: e, group: n }) => n ? {
|
|
1376
1424
|
kind: "group",
|
|
1377
1425
|
cells: [{
|
|
1378
|
-
text:
|
|
1426
|
+
text: Mu(e),
|
|
1379
1427
|
colSpan: t.length
|
|
1380
1428
|
}]
|
|
1381
1429
|
} : { cells: t.map((t) => ({
|
|
1382
|
-
text:
|
|
1430
|
+
text: eu(e, t.id),
|
|
1383
1431
|
align: t.align
|
|
1384
|
-
})) }), i =
|
|
1385
|
-
text:
|
|
1432
|
+
})) }), i = uc ? t.map((e) => ({
|
|
1433
|
+
text: pc(e),
|
|
1386
1434
|
align: e.align
|
|
1387
1435
|
})) : void 0;
|
|
1388
|
-
|
|
1389
|
-
title: e.title ??
|
|
1390
|
-
caption:
|
|
1436
|
+
lt(ut({
|
|
1437
|
+
title: e.title ?? Ce,
|
|
1438
|
+
caption: Ce,
|
|
1391
1439
|
lang: D,
|
|
1392
|
-
dir: getComputedStyle(
|
|
1440
|
+
dir: getComputedStyle(Yi.current ?? document.body).direction === "rtl" ? "rtl" : "ltr",
|
|
1393
1441
|
head: n,
|
|
1394
1442
|
body: r,
|
|
1395
1443
|
foot: i
|
|
1396
1444
|
}));
|
|
1397
|
-
},
|
|
1398
|
-
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1445
|
+
}, zu = () => {
|
|
1446
|
+
Oi && fe(Oi, ki);
|
|
1447
|
+
}, Bu = () => {
|
|
1448
|
+
io.length && L.setColumnFilters([]), I && L.setGlobalFilter(""), ua && da(Ee("and", "root")), P.pageIndex && To({
|
|
1401
1449
|
...P,
|
|
1402
1450
|
pageIndex: 0
|
|
1403
1451
|
});
|
|
1404
|
-
},
|
|
1405
|
-
|
|
1406
|
-
},
|
|
1407
|
-
|
|
1452
|
+
}, Vu = () => {
|
|
1453
|
+
Bu(), wo(Yn(an)), Object.keys(La).length && Do({}), Va && Oo(null), dd((e) => e + 1);
|
|
1454
|
+
}, Hu = async () => {
|
|
1455
|
+
l && await na.refresh();
|
|
1408
1456
|
};
|
|
1409
|
-
|
|
1410
|
-
exportCsv:
|
|
1411
|
-
generateCsv:
|
|
1412
|
-
clearState:
|
|
1413
|
-
resetFilters:
|
|
1414
|
-
resetState:
|
|
1415
|
-
exportXlsx:
|
|
1416
|
-
generateXlsx:
|
|
1417
|
-
print:
|
|
1418
|
-
refresh:
|
|
1419
|
-
undo:
|
|
1420
|
-
redo:
|
|
1421
|
-
})),
|
|
1457
|
+
sn(Li, () => ({
|
|
1458
|
+
exportCsv: ku,
|
|
1459
|
+
generateCsv: Ou,
|
|
1460
|
+
clearState: zu,
|
|
1461
|
+
resetFilters: Bu,
|
|
1462
|
+
resetState: Vu,
|
|
1463
|
+
exportXlsx: Iu,
|
|
1464
|
+
generateXlsx: Fu,
|
|
1465
|
+
print: Ru,
|
|
1466
|
+
refresh: Hu,
|
|
1467
|
+
undo: Qc,
|
|
1468
|
+
redo: $c
|
|
1469
|
+
})), cn(() => {
|
|
1422
1470
|
if (!R) return;
|
|
1423
1471
|
let e = [];
|
|
1424
|
-
for (let t of document.body.children) t !==
|
|
1472
|
+
for (let t of document.body.children) t !== Yi.current && t instanceof HTMLElement && !t.inert && (t.inert = !0, e.push(t));
|
|
1425
1473
|
return () => e.forEach((e) => e.inert = !1);
|
|
1426
1474
|
}, [R]);
|
|
1427
|
-
let
|
|
1428
|
-
|
|
1429
|
-
},
|
|
1430
|
-
R && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(),
|
|
1431
|
-
},
|
|
1475
|
+
let Uu = () => {
|
|
1476
|
+
Fo(!R), J.current = "[data-fullscreen-toggle]";
|
|
1477
|
+
}, Wu = (e) => {
|
|
1478
|
+
R && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Uu());
|
|
1479
|
+
}, Gu = v(null), Ku = (Xi.useVirtualizer ?? dr)({
|
|
1432
1480
|
count: B ? Y.length : 0,
|
|
1433
|
-
getScrollElement: () =>
|
|
1434
|
-
estimateSize: () =>
|
|
1481
|
+
getScrollElement: () => Gu.current,
|
|
1482
|
+
estimateSize: () => wi,
|
|
1435
1483
|
overscan: 8,
|
|
1436
1484
|
getItemKey: (e) => Y[e]?.key ?? e,
|
|
1437
1485
|
initialRect: {
|
|
1438
1486
|
width: 0,
|
|
1439
|
-
height: Number.parseInt(
|
|
1487
|
+
height: Number.parseInt(bi ?? "", 10) || 400
|
|
1440
1488
|
}
|
|
1441
1489
|
});
|
|
1442
1490
|
g(() => {
|
|
1443
|
-
|
|
1444
|
-
}, [
|
|
1445
|
-
let
|
|
1491
|
+
Ci && !Xi.useVirtualizer && Ot("DataTable: `virtual` needs the feature virtualRows, so all rows are rendered – pass `features={[virtualRows]}` with virtualRows from @wirecore/wirelayer-react/virtual");
|
|
1492
|
+
}, [Ci, Xi]);
|
|
1493
|
+
let qu = B ? Ku?.getVirtualItems() ?? [] : [], Ju = B ? qu.map((e) => ({
|
|
1446
1494
|
...Y[e.index],
|
|
1447
1495
|
index: e.index
|
|
1448
1496
|
})) : Y.map((e, t) => ({
|
|
1449
1497
|
...e,
|
|
1450
1498
|
index: t
|
|
1451
|
-
})),
|
|
1452
|
-
B && e &&
|
|
1453
|
-
},
|
|
1499
|
+
})), Yu = B ? qu[0]?.start ?? 0 : 0, Xu = B ? (Ku?.getTotalSize() ?? 0) - (qu.at(-1)?.end ?? 0) : 0, Zu = (e) => {
|
|
1500
|
+
B && e && Ku?.measureElement(e);
|
|
1501
|
+
}, Qu = v(!1);
|
|
1454
1502
|
g(() => {
|
|
1455
|
-
|
|
1456
|
-
}, [
|
|
1457
|
-
let
|
|
1458
|
-
if (
|
|
1503
|
+
Qu.current = !1;
|
|
1504
|
+
}, [ma.length]);
|
|
1505
|
+
let $u = (e) => {
|
|
1506
|
+
if (Di?.(e), !bi) return;
|
|
1459
1507
|
let t = e.currentTarget;
|
|
1460
|
-
|
|
1461
|
-
},
|
|
1508
|
+
Qu.current || t.scrollTop + t.clientHeight < t.scrollHeight - 80 || (Qu.current = !0, Ti?.(), Ei?.());
|
|
1509
|
+
}, ed = v(null), [td, nd] = y(0);
|
|
1462
1510
|
g(() => {
|
|
1463
|
-
if (!
|
|
1464
|
-
let e = new ResizeObserver(() =>
|
|
1465
|
-
return e.observe(
|
|
1511
|
+
if (!ed.current || typeof ResizeObserver > "u") return;
|
|
1512
|
+
let e = new ResizeObserver(() => nd(ed.current?.offsetHeight ?? 0));
|
|
1513
|
+
return e.observe(ed.current), () => e.disconnect();
|
|
1466
1514
|
}, []);
|
|
1467
1515
|
let $ = v(null);
|
|
1468
1516
|
g(() => {
|
|
1469
|
-
z && $.current &&
|
|
1517
|
+
z && $.current && xt($.current);
|
|
1470
1518
|
});
|
|
1471
|
-
let
|
|
1519
|
+
let rd = (e) => {
|
|
1472
1520
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.defaultPrevented) return !1;
|
|
1473
1521
|
let t = e.target, n = t.closest("td"), r = n?.parentElement?.dataset.rowId;
|
|
1474
|
-
if (!n || !r || n.cellIndex !== H.length || t.closest(
|
|
1522
|
+
if (!n || !r || n.cellIndex !== H.length || t.closest(lr)) return !1;
|
|
1475
1523
|
let i = L.getRow(r, !0);
|
|
1476
1524
|
if (!i) return !1;
|
|
1477
1525
|
let a = getComputedStyle($.current).direction === "rtl", o = {
|
|
1478
1526
|
expandable: i.getCanExpand(),
|
|
1479
1527
|
expanded: i.getIsExpanded(),
|
|
1480
1528
|
level: i.depth + 1
|
|
1481
|
-
}, s =
|
|
1529
|
+
}, s = Et(e.key, o, a);
|
|
1482
1530
|
if (!s) return !1;
|
|
1483
1531
|
if (e.preventDefault(), s === "parent") {
|
|
1484
1532
|
let e = i.getParentRow();
|
|
1485
1533
|
$.current?.querySelector(`tr[data-row-id="${CSS.escape(e?.id ?? "")}"] > td:nth-child(${H.length + 1})`)?.focus();
|
|
1486
1534
|
} else i.toggleExpanded(s === "expand");
|
|
1487
1535
|
return !0;
|
|
1488
|
-
},
|
|
1489
|
-
z && $.current && (
|
|
1536
|
+
}, id = (e) => {
|
|
1537
|
+
z && $.current && (Lo && rd(e) || Me(e.nativeEvent, $.current, {
|
|
1490
1538
|
itemCount: Y.length,
|
|
1491
|
-
scrollToItem: B ? (e) =>
|
|
1492
|
-
pageRows:
|
|
1539
|
+
scrollToItem: B ? (e) => Ku?.scrollToIndex(e) : void 0,
|
|
1540
|
+
pageRows: Gu.current && bi ? Math.max(1, Math.floor(Gu.current.clientHeight / wi) - 1) : 10,
|
|
1493
1541
|
onSelectRow: (e) => {
|
|
1494
1542
|
let t = L.getRow(e, !0);
|
|
1495
|
-
t?.getCanSelect() &&
|
|
1543
|
+
t?.getCanSelect() && Xs(t, !Vs || !Us(t));
|
|
1496
1544
|
}
|
|
1497
1545
|
}));
|
|
1498
|
-
},
|
|
1499
|
-
z && $.current &&
|
|
1546
|
+
}, ad = (e) => {
|
|
1547
|
+
z && $.current && je($.current, e.target);
|
|
1500
1548
|
let t = e.target, n = t.closest("tr")?.dataset.rowId, r = t.dataset.columnId;
|
|
1501
|
-
w && z && !
|
|
1549
|
+
w && z && !Kl.current && !ql.current && n && r && t.matches("td") && Gl({
|
|
1502
1550
|
anchor: {
|
|
1503
1551
|
rowId: n,
|
|
1504
1552
|
columnId: r
|
|
@@ -1508,254 +1556,254 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1508
1556
|
columnId: r
|
|
1509
1557
|
}
|
|
1510
1558
|
});
|
|
1511
|
-
},
|
|
1512
|
-
|
|
1513
|
-
},
|
|
1559
|
+
}, od = (e) => {
|
|
1560
|
+
ou(e) || $l(e) || id(e);
|
|
1561
|
+
}, sd = v(!1);
|
|
1514
1562
|
g(() => {
|
|
1515
|
-
if (!
|
|
1516
|
-
let e =
|
|
1517
|
-
|
|
1563
|
+
if (!Oi) return;
|
|
1564
|
+
let e = Ve(Oi, ki), t = e && tt(e, Ai);
|
|
1565
|
+
sd.current = !0, t && (t.sorting && wo(t.sorting), t.filters && L.setColumnFilters(Zn(t.filters)), t.globalFilter !== void 0 && L.setGlobalFilter(t.globalFilter), t.columnSizing && vo(t.columnSizing), t.columnOrder && L.setColumnOrder(t.columnOrder), t.hiddenColumns && L.setColumnVisibility(Qn(t.hiddenColumns, !1)), t.pinnedColumns && L.setColumnPinning(t.pinnedColumns), t.expanded && t.expanded.length && jo(Qn(t.expanded)), t.selection && Do($n(t.selection)), t.density && Mo(t.density), t.showFilters !== void 0 && t.showFilters !== Wa && ko(t.showFilters), (t.page || t.pageSize) && To({
|
|
1518
1566
|
pageIndex: (t.page ?? 1) - 1,
|
|
1519
1567
|
pageSize: t.pageSize ?? P.pageSize
|
|
1520
1568
|
}));
|
|
1521
1569
|
}, []);
|
|
1522
|
-
let
|
|
1570
|
+
let cd = {
|
|
1523
1571
|
sorting: N,
|
|
1524
|
-
filters:
|
|
1572
|
+
filters: Xn(io),
|
|
1525
1573
|
globalFilter: I,
|
|
1526
1574
|
page: P.pageIndex + 1,
|
|
1527
1575
|
pageSize: P.pageSize,
|
|
1528
|
-
columnSizing:
|
|
1529
|
-
columnOrder:
|
|
1530
|
-
hiddenColumns: Object.keys(
|
|
1531
|
-
pinnedColumns:
|
|
1532
|
-
expanded:
|
|
1533
|
-
selection: Object.keys(
|
|
1534
|
-
density:
|
|
1535
|
-
showFilters:
|
|
1536
|
-
},
|
|
1576
|
+
columnSizing: _o,
|
|
1577
|
+
columnOrder: fo,
|
|
1578
|
+
hiddenColumns: Object.keys(co).filter((e) => co[e] === !1),
|
|
1579
|
+
pinnedColumns: go,
|
|
1580
|
+
expanded: Qa === !0 ? [] : Object.keys(Qa).filter((e) => Qa[e]),
|
|
1581
|
+
selection: Object.keys(La).filter((e) => La[e]),
|
|
1582
|
+
density: yo,
|
|
1583
|
+
showFilters: Wa
|
|
1584
|
+
}, ld = JSON.stringify(tt(cd, Ai)), [ud, dd] = y(0), fd = v(0);
|
|
1537
1585
|
g(() => {
|
|
1538
|
-
|
|
1586
|
+
Oi && sd.current && (ud === fd.current ? yt(Oi, JSON.parse(ld), ki) : (fd.current = ud, fe(Oi, ki)));
|
|
1539
1587
|
}, [
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1588
|
+
Oi,
|
|
1589
|
+
ki,
|
|
1590
|
+
ld,
|
|
1591
|
+
ud
|
|
1544
1592
|
]);
|
|
1545
|
-
let
|
|
1593
|
+
let pd = {
|
|
1546
1594
|
page: P.pageIndex + 1,
|
|
1547
1595
|
pageSize: h ? P.pageSize : 0,
|
|
1548
1596
|
sorting: N.map((e) => ({
|
|
1549
1597
|
id: e.id,
|
|
1550
1598
|
desc: e.desc
|
|
1551
1599
|
})),
|
|
1552
|
-
filters:
|
|
1600
|
+
filters: Xn(io),
|
|
1553
1601
|
search: I,
|
|
1554
1602
|
groupBy: F,
|
|
1555
|
-
...
|
|
1556
|
-
},
|
|
1557
|
-
...
|
|
1603
|
+
...ua ? { condition: oa } : {}
|
|
1604
|
+
}, md = dt(pd), hd = dt({
|
|
1605
|
+
...pd,
|
|
1558
1606
|
page: void 0,
|
|
1559
1607
|
pageSize: void 0
|
|
1560
|
-
}),
|
|
1608
|
+
}), gd = v(void 0), _d = v(I);
|
|
1561
1609
|
g(() => {
|
|
1562
|
-
if (!
|
|
1563
|
-
let e =
|
|
1564
|
-
if (
|
|
1565
|
-
|
|
1610
|
+
if (!l) return;
|
|
1611
|
+
let e = gd.current !== void 0 && gd.current !== hd;
|
|
1612
|
+
if (gd.current = hd, e && P.pageIndex !== 0) {
|
|
1613
|
+
To({
|
|
1566
1614
|
...P,
|
|
1567
1615
|
pageIndex: 0
|
|
1568
1616
|
});
|
|
1569
1617
|
return;
|
|
1570
1618
|
}
|
|
1571
|
-
let t =
|
|
1572
|
-
|
|
1573
|
-
}, [
|
|
1574
|
-
let
|
|
1619
|
+
let t = _d.current !== I;
|
|
1620
|
+
_d.current = I, na.load(JSON.parse(md), { debounce: t });
|
|
1621
|
+
}, [md, !!l]);
|
|
1622
|
+
let vd = k ? ga ?? ma.length : L.getPrePaginatedRowModel().rows.length, yd = (Ze ?? []).map((e) => ({
|
|
1575
1623
|
value: String(e),
|
|
1576
1624
|
label: String(e)
|
|
1577
|
-
})),
|
|
1578
|
-
if (!
|
|
1625
|
+
})), bd = si || _r || Mr || !!Vr || hi || yi || Or || kr || fa || !!ji || !!Mi || !!Ni, xd = Sr ? I : "", Sd = va && On === "skeleton", Cd = Math.min(Y.length || h || 5, 50), wd = As && (k || ma.length > 0) && (Fi !== void 0 || An !== void 0), Td = (() => {
|
|
1626
|
+
if (!ri) return [];
|
|
1579
1627
|
let e = L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped());
|
|
1580
1628
|
return e.length ? W.flatMap((t) => {
|
|
1581
|
-
let n = j.get(t.id), r =
|
|
1629
|
+
let n = j.get(t.id), r = et(e.map((e) => ya(n, e.original)));
|
|
1582
1630
|
if (!r) return [];
|
|
1583
1631
|
let i = e[0].original;
|
|
1584
1632
|
return [{
|
|
1585
1633
|
id: t.id,
|
|
1586
|
-
text: `${n.header}: ${O.aggregates.sum(
|
|
1634
|
+
text: `${n.header}: ${O.aggregates.sum(dc(n, r.sum, i))} · ${O.aggregates.avg(dc(n, r.avg, i))}`
|
|
1587
1635
|
}];
|
|
1588
1636
|
}) : [];
|
|
1589
|
-
})(),
|
|
1637
|
+
})(), Ed = k ? ga ?? ma.length : L.getCoreRowModel().rows.length, Dd = ei ? W.find((e) => {
|
|
1590
1638
|
let t = j.get(e.id);
|
|
1591
|
-
return !t?.copyable && !(
|
|
1592
|
-
})?.id : void 0,
|
|
1639
|
+
return !t?.copyable && !(Uo && t?.editable);
|
|
1640
|
+
})?.id : void 0, Od = (e, t) => t === Dd ? ei?.(e.original) : void 0, kd = (e) => e.columns ? e.columns.flatMap(kd) : [e.id], Ad = ha.some((e) => e.columns) ? (() => {
|
|
1593
1641
|
let e = L.getAllLeafColumns(), t = (t) => e.findIndex((e) => e.id === t);
|
|
1594
|
-
return
|
|
1642
|
+
return ha.map((n) => ({
|
|
1595
1643
|
def: n,
|
|
1596
|
-
leaves:
|
|
1644
|
+
leaves: kd(n).map((n) => e[t(n)]).filter(Boolean).sort((e, n) => t(e.id) - t(n.id))
|
|
1597
1645
|
})).sort((e, n) => t(e.leaves[0]?.id ?? "") - t(n.leaves[0]?.id ?? ""));
|
|
1598
|
-
})() : void 0,
|
|
1599
|
-
let n =
|
|
1646
|
+
})() : void 0, jd = (e, t) => {
|
|
1647
|
+
let n = ha.map((e) => ({
|
|
1600
1648
|
id: e.id,
|
|
1601
|
-
leaves:
|
|
1602
|
-
})), r =
|
|
1649
|
+
leaves: kd(e)
|
|
1650
|
+
})), r = Xe(L.getAllLeafColumns().map((e) => e.id), n, e, t);
|
|
1603
1651
|
if (!r) return;
|
|
1604
1652
|
L.setColumnOrder(r);
|
|
1605
1653
|
let i = n.map((e) => e.id).sort((e, t) => r.indexOf(n.find((t) => t.id === e).leaves[0]) - r.indexOf(n.find((e) => e.id === t).leaves[0]));
|
|
1606
|
-
|
|
1607
|
-
},
|
|
1654
|
+
ls(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
1655
|
+
}, Md = Ur?.length ? Ur : ["csv"], Nd = hn && Ws > 0, Pd = Md.length === 1 && Md[0] === "csv" ? Nd ? [{
|
|
1608
1656
|
value: "all",
|
|
1609
1657
|
label: O.exportAll
|
|
1610
1658
|
}, {
|
|
1611
1659
|
value: "selection",
|
|
1612
1660
|
label: O.exportSelection
|
|
1613
|
-
}] : [] :
|
|
1661
|
+
}] : [] : Md.flatMap((e) => Nd ? [{
|
|
1614
1662
|
value: `${e}:all`,
|
|
1615
1663
|
label: O.exportAs(e, !1)
|
|
1616
1664
|
}, {
|
|
1617
1665
|
value: `${e}:selection`,
|
|
1618
1666
|
label: O.exportAs(e, !0)
|
|
1619
|
-
}] :
|
|
1667
|
+
}] : Md.length > 1 ? [{
|
|
1620
1668
|
value: `${e}:all`,
|
|
1621
1669
|
label: O.exportAs(e, !1)
|
|
1622
|
-
}] : []),
|
|
1670
|
+
}] : []), Fd = Md.length > 1 ? O.exportMenu : Md[0] === "xlsx" ? O.exportXlsx : O.export, Id = /* @__PURE__ */ x("div", {
|
|
1623
1671
|
className: V.footer(),
|
|
1624
|
-
children: [
|
|
1672
|
+
children: [yd.length > 0 && /* @__PURE__ */ x("div", {
|
|
1625
1673
|
className: V.pageSize(),
|
|
1626
1674
|
children: [/* @__PURE__ */ b("span", {
|
|
1627
1675
|
"aria-hidden": "true",
|
|
1628
1676
|
children: O.rowsPerPage
|
|
1629
|
-
}), /* @__PURE__ */ b(
|
|
1677
|
+
}), /* @__PURE__ */ b(ie, {
|
|
1630
1678
|
className: V.pageSizeSelect(),
|
|
1631
1679
|
"aria-label": O.rowsPerPage,
|
|
1632
|
-
items:
|
|
1680
|
+
items: yd,
|
|
1633
1681
|
value: String(P.pageSize),
|
|
1634
1682
|
onValueChange: (e) => L.setPageSize(Number(e))
|
|
1635
1683
|
})]
|
|
1636
|
-
}), /* @__PURE__ */ b(
|
|
1637
|
-
count:
|
|
1684
|
+
}), /* @__PURE__ */ b(a, {
|
|
1685
|
+
count: vd,
|
|
1638
1686
|
pageSize: P.pageSize,
|
|
1639
1687
|
page: P.pageIndex + 1,
|
|
1640
|
-
translations: { rootLabel: `${
|
|
1641
|
-
withEdges:
|
|
1688
|
+
translations: { rootLabel: `${Ce}: ${E.pagination.rootLabel}` },
|
|
1689
|
+
withEdges: Ct,
|
|
1642
1690
|
onPageChange: (e) => L.setPageIndex(e - 1)
|
|
1643
1691
|
})]
|
|
1644
|
-
}),
|
|
1645
|
-
let i = w &&
|
|
1692
|
+
}), Ld = (e, t, n, r) => {
|
|
1693
|
+
let i = w && Ul(e.id, t), a = T === "batch" && !!ot(Hc, e.id, t);
|
|
1646
1694
|
return {
|
|
1647
1695
|
className: [
|
|
1648
1696
|
i ? V.cellSelected() : "",
|
|
1649
1697
|
a ? V.cellChanged() : "",
|
|
1650
|
-
|
|
1698
|
+
_u(e.id, t)
|
|
1651
1699
|
],
|
|
1652
1700
|
attributes: {
|
|
1653
|
-
...w ||
|
|
1701
|
+
...w || si ? { "data-column-id": t } : {},
|
|
1654
1702
|
...w && z ? { "aria-selected": i } : {},
|
|
1655
1703
|
...a ? { "data-changed": "" } : {},
|
|
1656
|
-
...
|
|
1704
|
+
...Du(n, r),
|
|
1657
1705
|
...w ? {
|
|
1658
|
-
onPointerDown: (n) =>
|
|
1659
|
-
onPointerEnter: (n) =>
|
|
1660
|
-
onClickCapture:
|
|
1706
|
+
onPointerDown: (n) => Yl(e.id, t, n),
|
|
1707
|
+
onPointerEnter: (n) => Xl(e.id, t, n),
|
|
1708
|
+
onClickCapture: Zl
|
|
1661
1709
|
} : {}
|
|
1662
1710
|
}
|
|
1663
1711
|
};
|
|
1664
|
-
},
|
|
1665
|
-
icon:
|
|
1712
|
+
}, Rd = (e, t) => ol === e.id ? /* @__PURE__ */ x(ln, { children: [/* @__PURE__ */ b(f, {
|
|
1713
|
+
icon: Mt,
|
|
1666
1714
|
label: O.saveRow(t),
|
|
1667
1715
|
variant: "text",
|
|
1668
1716
|
size: "sm",
|
|
1669
|
-
onClick: () =>
|
|
1670
|
-
}), /* @__PURE__ */ b(
|
|
1671
|
-
icon:
|
|
1717
|
+
onClick: () => Fl(e, !0)
|
|
1718
|
+
}), /* @__PURE__ */ b(f, {
|
|
1719
|
+
icon: tn,
|
|
1672
1720
|
label: O.cancelEdit(t),
|
|
1673
1721
|
variant: "text",
|
|
1674
1722
|
size: "sm",
|
|
1675
|
-
onClick: () =>
|
|
1676
|
-
})] }) : /* @__PURE__ */ b(
|
|
1723
|
+
onClick: () => Fl(e, !1)
|
|
1724
|
+
})] }) : /* @__PURE__ */ b(f, {
|
|
1677
1725
|
"data-row-edit": e.id,
|
|
1678
|
-
icon:
|
|
1726
|
+
icon: qt,
|
|
1679
1727
|
label: O.editRow(t),
|
|
1680
1728
|
variant: "text",
|
|
1681
1729
|
size: "sm",
|
|
1682
|
-
onClick: () =>
|
|
1683
|
-
}),
|
|
1684
|
-
let r = j.get(t.id), i = M(r, n, e.original), a = T === "batch" && !!
|
|
1685
|
-
if (r?.editable && (
|
|
1730
|
+
onClick: () => Pl(e)
|
|
1731
|
+
}), zd = (e, t, n) => {
|
|
1732
|
+
let r = j.get(t.id), i = M(r, n, e.original), a = T === "batch" && !!ot(Hc, e.id, t.id), o = r?.cell ? r.cell(e.original, n) : void 0;
|
|
1733
|
+
if (r?.editable && (Uo && il?.rowId === e.id && il.columnId === t.id || T === "row" && ol === e.id)) return /* @__PURE__ */ x("div", {
|
|
1686
1734
|
"data-editor": "",
|
|
1687
1735
|
className: V.editor(),
|
|
1688
|
-
"aria-busy":
|
|
1689
|
-
onKeyDown: (n) =>
|
|
1690
|
-
onBlur:
|
|
1691
|
-
children: [r.renderEditor ? r.renderEditor(
|
|
1692
|
-
type:
|
|
1736
|
+
"aria-busy": ml || void 0,
|
|
1737
|
+
onKeyDown: (n) => Uo ? Al(e, t.id, n) : Il(e, n),
|
|
1738
|
+
onBlur: Uo ? (n) => jl(e, t.id, n) : void 0,
|
|
1739
|
+
children: [r.renderEditor ? r.renderEditor(Nl(e, r)) : /* @__PURE__ */ b(Gn, {
|
|
1740
|
+
type: vl(r),
|
|
1693
1741
|
label: q(t),
|
|
1694
1742
|
options: r.editOptions,
|
|
1695
1743
|
renderOption: r.renderOption,
|
|
1696
|
-
invalid: !!
|
|
1697
|
-
value:
|
|
1698
|
-
onChange: (t) =>
|
|
1699
|
-
}),
|
|
1700
|
-
id:
|
|
1744
|
+
invalid: !!ul[t.id],
|
|
1745
|
+
value: cl[t.id],
|
|
1746
|
+
onChange: (t) => Ml(e, r, t)
|
|
1747
|
+
}), ul[t.id] && /* @__PURE__ */ b("span", {
|
|
1748
|
+
id: bl(e.id, t.id),
|
|
1701
1749
|
role: "alert",
|
|
1702
1750
|
className: V.editError(),
|
|
1703
|
-
children:
|
|
1751
|
+
children: ul[t.id]
|
|
1704
1752
|
})]
|
|
1705
1753
|
});
|
|
1706
|
-
if (
|
|
1754
|
+
if (Uo && r?.editable) return /* @__PURE__ */ b("button", {
|
|
1707
1755
|
type: "button",
|
|
1708
|
-
className:
|
|
1709
|
-
"data-edit":
|
|
1756
|
+
className: Bo(t.id).editButton(),
|
|
1757
|
+
"data-edit": yl(e.id, t.id),
|
|
1710
1758
|
"aria-label": a ? `${O.edit(q(t), i)}, ${O.changed}` : O.edit(q(t), i),
|
|
1711
1759
|
onClick: (n) => {
|
|
1712
|
-
(
|
|
1760
|
+
(ui !== "dblclick" || n.detail !== 1) && Cl(e, t.id);
|
|
1713
1761
|
},
|
|
1714
1762
|
children: o ?? i
|
|
1715
1763
|
});
|
|
1716
1764
|
if (r?.copyable) return /* @__PURE__ */ x("span", {
|
|
1717
1765
|
className: V.copyCell(),
|
|
1718
|
-
children: [o ?? i, /* @__PURE__ */ b(
|
|
1766
|
+
children: [o ?? i, /* @__PURE__ */ b(m, {
|
|
1719
1767
|
value: i,
|
|
1720
1768
|
label: O.copy(q(t), i)
|
|
1721
1769
|
})]
|
|
1722
1770
|
});
|
|
1723
|
-
let s =
|
|
1771
|
+
let s = pu ? lu.trim() : xd, c = o === void 0 ? s ? /* @__PURE__ */ b(oe, {
|
|
1724
1772
|
text: i,
|
|
1725
1773
|
query: s
|
|
1726
|
-
}) : i : o,
|
|
1727
|
-
return
|
|
1728
|
-
href:
|
|
1774
|
+
}) : i : o, l = Od(e, t.id);
|
|
1775
|
+
return l ? /* @__PURE__ */ b("a", {
|
|
1776
|
+
href: l,
|
|
1729
1777
|
className: V.rowLink(),
|
|
1730
1778
|
"data-row-link": "",
|
|
1731
1779
|
children: c
|
|
1732
1780
|
}) : c;
|
|
1733
|
-
},
|
|
1734
|
-
onContextMenuCapture:
|
|
1781
|
+
}, Bd = /* @__PURE__ */ x("tbody", {
|
|
1782
|
+
onContextMenuCapture: vc,
|
|
1735
1783
|
children: [
|
|
1736
|
-
Y.length === 0 && !
|
|
1737
|
-
colSpan:
|
|
1784
|
+
Y.length === 0 && !Sd && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
|
|
1785
|
+
colSpan: Go,
|
|
1738
1786
|
className: V.message(),
|
|
1739
|
-
children:
|
|
1787
|
+
children: _a ? /* @__PURE__ */ x("span", {
|
|
1740
1788
|
className: V.errorContent(),
|
|
1741
1789
|
children: [/* @__PURE__ */ b("span", {
|
|
1742
1790
|
role: "alert",
|
|
1743
1791
|
children: E.dataSource.error
|
|
1744
|
-
}), /* @__PURE__ */ b(
|
|
1792
|
+
}), /* @__PURE__ */ b(d, {
|
|
1745
1793
|
variant: "outline",
|
|
1746
1794
|
size: "sm",
|
|
1747
|
-
onClick: () => void
|
|
1795
|
+
onClick: () => void Hu(),
|
|
1748
1796
|
children: E.dataSource.retry
|
|
1749
1797
|
})]
|
|
1750
|
-
}) :
|
|
1798
|
+
}) : va ? Ii ?? /* @__PURE__ */ x("span", {
|
|
1751
1799
|
className: V.messageContent(),
|
|
1752
|
-
children: [/* @__PURE__ */ b(
|
|
1800
|
+
children: [/* @__PURE__ */ b(re, {
|
|
1753
1801
|
size: "sm",
|
|
1754
|
-
label:
|
|
1755
|
-
}),
|
|
1756
|
-
}) :
|
|
1802
|
+
label: jn ?? E.common.loading
|
|
1803
|
+
}), jn ?? E.common.loading]
|
|
1804
|
+
}) : wd ? Fi ?? An ?? kn ?? E.common.empty : Pi ?? kn ?? E.common.empty
|
|
1757
1805
|
}) }),
|
|
1758
|
-
|
|
1806
|
+
Sd && Array.from({ length: Cd }, (e, t) => /* @__PURE__ */ x("tr", {
|
|
1759
1807
|
className: V.row(),
|
|
1760
1808
|
children: [
|
|
1761
1809
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -1763,9 +1811,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1763
1811
|
style: K(e)
|
|
1764
1812
|
}, e)),
|
|
1765
1813
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
1766
|
-
className:
|
|
1767
|
-
style:
|
|
1768
|
-
children: /* @__PURE__ */ b(
|
|
1814
|
+
className: Bo(e.id).td({ class: Zo(e.id, !1) }),
|
|
1815
|
+
style: Qo(e.id, !1),
|
|
1816
|
+
children: /* @__PURE__ */ b(s, {})
|
|
1769
1817
|
}, e.id)),
|
|
1770
1818
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
1771
1819
|
className: V.td({ class: G("actions", !1) }),
|
|
@@ -1773,30 +1821,30 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1773
1821
|
})
|
|
1774
1822
|
]
|
|
1775
1823
|
}, `skeleton-${t + 1}`)),
|
|
1776
|
-
|
|
1824
|
+
Yu > 0 && !Sd && /* @__PURE__ */ b("tr", {
|
|
1777
1825
|
className: V.spacer(),
|
|
1778
1826
|
"aria-hidden": "true",
|
|
1779
1827
|
children: /* @__PURE__ */ b("td", {
|
|
1780
|
-
colSpan:
|
|
1828
|
+
colSpan: Go,
|
|
1781
1829
|
className: V.spacerCell(),
|
|
1782
|
-
style: { height:
|
|
1830
|
+
style: { height: Yu }
|
|
1783
1831
|
})
|
|
1784
1832
|
}),
|
|
1785
|
-
(
|
|
1786
|
-
let t = e.row, n = B ? e.index +
|
|
1833
|
+
(Sd ? [] : Ju).map((e) => {
|
|
1834
|
+
let t = e.row, n = B ? e.index + ts.length + 1 : void 0;
|
|
1787
1835
|
if (e.kind === "group") {
|
|
1788
1836
|
let r = j.get(t.groupingColumnId), i = M(r, t.groupingValue, t.original), a = t.getLeafRows().length;
|
|
1789
1837
|
return /* @__PURE__ */ x("tr", {
|
|
1790
|
-
ref:
|
|
1838
|
+
ref: Zu,
|
|
1791
1839
|
className: V.groupRow({ class: X ? [V.dropTarget(), V.dropInside()] : void 0 }),
|
|
1792
1840
|
"data-index": e.index,
|
|
1793
1841
|
"aria-rowindex": n,
|
|
1794
|
-
"data-drop": X ?
|
|
1795
|
-
onDragOver:
|
|
1796
|
-
onDragLeave:
|
|
1797
|
-
onDrop:
|
|
1842
|
+
"data-drop": X ? Vc(t.id) : void 0,
|
|
1843
|
+
onDragOver: qr ? (e) => Rc(t, e) : void 0,
|
|
1844
|
+
onDragLeave: qr ? () => Tc(null) : void 0,
|
|
1845
|
+
onDrop: qr ? Bc : void 0,
|
|
1798
1846
|
children: [/* @__PURE__ */ b("td", {
|
|
1799
|
-
colSpan:
|
|
1847
|
+
colSpan: lc ? H.length + 1 : Go,
|
|
1800
1848
|
className: V.groupCell(),
|
|
1801
1849
|
children: /* @__PURE__ */ x("div", {
|
|
1802
1850
|
className: V.treeCell(),
|
|
@@ -1808,7 +1856,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1808
1856
|
"aria-expanded": t.getIsExpanded(),
|
|
1809
1857
|
"aria-label": O.group(r?.header ?? "", i, a),
|
|
1810
1858
|
onClick: t.getToggleExpandedHandler(),
|
|
1811
|
-
children: /* @__PURE__ */ b(
|
|
1859
|
+
children: /* @__PURE__ */ b(Pt, {
|
|
1812
1860
|
className: V.expanderIcon(),
|
|
1813
1861
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1814
1862
|
"aria-hidden": "true"
|
|
@@ -1824,50 +1872,51 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1824
1872
|
})
|
|
1825
1873
|
]
|
|
1826
1874
|
})
|
|
1827
|
-
}),
|
|
1828
|
-
className:
|
|
1829
|
-
children:
|
|
1875
|
+
}), lc && /* @__PURE__ */ x(ln, { children: [W.slice(1).map((e) => /* @__PURE__ */ b("td", {
|
|
1876
|
+
className: Bo(e.id).groupAggregate(),
|
|
1877
|
+
children: fc(j.get(e.id), t.getLeafRows())
|
|
1830
1878
|
}, e.id)), U.length > 0 && /* @__PURE__ */ b("td", { className: V.groupAggregate() })] })]
|
|
1831
1879
|
}, e.key);
|
|
1832
1880
|
}
|
|
1833
1881
|
if (e.kind === "expansion") return /* @__PURE__ */ b("tr", {
|
|
1834
|
-
id:
|
|
1835
|
-
ref:
|
|
1882
|
+
id: oc(t),
|
|
1883
|
+
ref: Zu,
|
|
1836
1884
|
className: V.expansionRow(),
|
|
1837
1885
|
"data-index": e.index,
|
|
1838
1886
|
"aria-rowindex": n,
|
|
1839
1887
|
children: /* @__PURE__ */ b("td", {
|
|
1840
|
-
colSpan:
|
|
1888
|
+
colSpan: Go,
|
|
1841
1889
|
className: V.expansionCell(),
|
|
1842
|
-
children:
|
|
1890
|
+
children: Vn?.(t.original, t.id)
|
|
1843
1891
|
})
|
|
1844
1892
|
}, e.key);
|
|
1845
|
-
let r =
|
|
1893
|
+
let r = Zi(t.original, t.index);
|
|
1846
1894
|
return /* @__PURE__ */ x("tr", {
|
|
1847
|
-
ref:
|
|
1895
|
+
ref: Zu,
|
|
1848
1896
|
className: V.row({ class: [
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1897
|
+
qr ? V.dropTarget() : "",
|
|
1898
|
+
qr && Dc && X ? V.dropInside() : "",
|
|
1899
|
+
ei?.(t.original) ? V.linkRow() : "",
|
|
1900
|
+
$r?.(t.original)
|
|
1853
1901
|
] }),
|
|
1854
|
-
"data-state":
|
|
1855
|
-
"aria-selected": z &&
|
|
1902
|
+
"data-state": Us(t) ? "selected" : void 0,
|
|
1903
|
+
"aria-selected": z && hn ? Us(t) : void 0,
|
|
1856
1904
|
"data-row-id": t.id,
|
|
1905
|
+
"data-stripe": ac(t),
|
|
1857
1906
|
"data-index": e.index,
|
|
1858
1907
|
"aria-rowindex": n,
|
|
1859
|
-
"aria-level":
|
|
1860
|
-
"aria-expanded":
|
|
1861
|
-
draggable:
|
|
1862
|
-
"data-drop":
|
|
1908
|
+
"aria-level": Lo ? t.depth + 1 : void 0,
|
|
1909
|
+
"aria-expanded": Lo && t.getCanExpand() ? t.getIsExpanded() : void 0,
|
|
1910
|
+
draggable: Sc === t.id ? "true" : void 0,
|
|
1911
|
+
"data-drop": Vc(t.id),
|
|
1863
1912
|
"data-dragging": X === t.id || void 0,
|
|
1864
|
-
onClick: (e) =>
|
|
1865
|
-
onAuxClick: (e) =>
|
|
1866
|
-
onDragStart: (e) =>
|
|
1867
|
-
onDragOver: (e) =>
|
|
1868
|
-
onDragLeave: () =>
|
|
1869
|
-
onDrop:
|
|
1870
|
-
onDragEnd:
|
|
1913
|
+
onClick: (e) => $s(t, e),
|
|
1914
|
+
onAuxClick: (e) => ec(t, e),
|
|
1915
|
+
onDragStart: (e) => Ic(t, e),
|
|
1916
|
+
onDragOver: (e) => Lc(t, e),
|
|
1917
|
+
onDragLeave: () => Tc(null),
|
|
1918
|
+
onDrop: Bc,
|
|
1919
|
+
onDragEnd: zc,
|
|
1871
1920
|
children: [
|
|
1872
1921
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
1873
1922
|
className: V.td({ class: G(e, !1) }),
|
|
@@ -1877,72 +1926,72 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1877
1926
|
className: V.dragHandle(),
|
|
1878
1927
|
"data-drag-handle": t.id,
|
|
1879
1928
|
"aria-label": O.moveRow(r),
|
|
1880
|
-
"aria-keyshortcuts":
|
|
1881
|
-
onKeyDown: (e) =>
|
|
1882
|
-
onPointerDown: () =>
|
|
1883
|
-
onPointerUp: () =>
|
|
1884
|
-
children: /* @__PURE__ */ b(
|
|
1929
|
+
"aria-keyshortcuts": Dc ? "ArrowUp ArrowDown ArrowLeft ArrowRight" : "ArrowUp ArrowDown",
|
|
1930
|
+
onKeyDown: (e) => Fc(t, e),
|
|
1931
|
+
onPointerDown: () => Cc(t.id),
|
|
1932
|
+
onPointerUp: () => Cc(X ? Sc : null),
|
|
1933
|
+
children: /* @__PURE__ */ b(Ut, {
|
|
1885
1934
|
className: V.dragIcon(),
|
|
1886
1935
|
"aria-hidden": "true"
|
|
1887
1936
|
})
|
|
1888
|
-
}) : e === "select" &&
|
|
1889
|
-
onClickCapture:
|
|
1890
|
-
onKeyDownCapture:
|
|
1891
|
-
children: /* @__PURE__ */ b(
|
|
1892
|
-
checked:
|
|
1937
|
+
}) : e === "select" && Vs ? /* @__PURE__ */ b("span", {
|
|
1938
|
+
onClickCapture: Zs,
|
|
1939
|
+
onKeyDownCapture: Zs,
|
|
1940
|
+
children: /* @__PURE__ */ b(ae, {
|
|
1941
|
+
checked: Us(t),
|
|
1893
1942
|
disabled: !t.getCanSelect(),
|
|
1894
1943
|
"aria-label": O.selectRow(r),
|
|
1895
|
-
onCheckedChange: (e) =>
|
|
1944
|
+
onCheckedChange: (e) => Xs(t, e === !0, Ys.current)
|
|
1896
1945
|
})
|
|
1897
1946
|
}) : e === "select" ? /* @__PURE__ */ b("input", {
|
|
1898
1947
|
type: "radio",
|
|
1899
|
-
name:
|
|
1948
|
+
name: qs,
|
|
1900
1949
|
className: V.radio(),
|
|
1901
|
-
checked:
|
|
1950
|
+
checked: Us(t),
|
|
1902
1951
|
disabled: !t.getCanSelect(),
|
|
1903
1952
|
"aria-label": O.selectRow(r),
|
|
1904
|
-
onChange: () =>
|
|
1953
|
+
onChange: () => Xs(t, !0)
|
|
1905
1954
|
}) : e === "expand" && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1906
1955
|
type: "button",
|
|
1907
1956
|
className: V.expander(),
|
|
1908
1957
|
"aria-expanded": t.getIsExpanded(),
|
|
1909
|
-
"aria-controls": t.getIsExpanded() ?
|
|
1958
|
+
"aria-controls": t.getIsExpanded() ? oc(t) : void 0,
|
|
1910
1959
|
"aria-label": O.details(r),
|
|
1911
1960
|
onClick: () => t.toggleExpanded(),
|
|
1912
|
-
children: /* @__PURE__ */ b(
|
|
1961
|
+
children: /* @__PURE__ */ b(Pt, {
|
|
1913
1962
|
className: V.expanderIcon(),
|
|
1914
1963
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1915
1964
|
"aria-hidden": "true"
|
|
1916
1965
|
})
|
|
1917
1966
|
}) : e === "expand" ? /* @__PURE__ */ b("span", { className: V.expanderSpacer() }) : /* @__PURE__ */ b("span", {
|
|
1918
1967
|
className: V.rowNumber(),
|
|
1919
|
-
children:
|
|
1968
|
+
children: ic.get(t.id)
|
|
1920
1969
|
})
|
|
1921
1970
|
}, e)),
|
|
1922
1971
|
t.getVisibleCells().map((n, r) => {
|
|
1923
|
-
if (
|
|
1924
|
-
let t =
|
|
1972
|
+
if (Cu) {
|
|
1973
|
+
let t = Eu(e.index, r);
|
|
1925
1974
|
if (!t.rowSpan || !t.colSpan) return null;
|
|
1926
1975
|
}
|
|
1927
|
-
let i =
|
|
1976
|
+
let i = zd(t, n.column, Kc(t, n.column.id)), a = Ld(t, n.column.id, e.index, r);
|
|
1928
1977
|
return /* @__PURE__ */ b("td", {
|
|
1929
|
-
className:
|
|
1930
|
-
|
|
1931
|
-
|
|
1978
|
+
className: Bo(n.column.id).td({ class: [
|
|
1979
|
+
Zo(n.column.id, !1),
|
|
1980
|
+
Vo(n.column.id, t),
|
|
1932
1981
|
...a.className
|
|
1933
1982
|
] }),
|
|
1934
|
-
style:
|
|
1983
|
+
style: Qo(n.column.id, !1),
|
|
1935
1984
|
...a.attributes,
|
|
1936
|
-
children:
|
|
1985
|
+
children: cc && r === 0 ? /* @__PURE__ */ x("div", {
|
|
1937
1986
|
className: V.treeCell(),
|
|
1938
1987
|
style: { paddingInlineStart: t.depth * 20 },
|
|
1939
|
-
children: [
|
|
1988
|
+
children: [Nn && t.getCanExpand() ? /* @__PURE__ */ b("button", {
|
|
1940
1989
|
type: "button",
|
|
1941
1990
|
className: V.expander(),
|
|
1942
1991
|
"aria-expanded": t.getIsExpanded(),
|
|
1943
|
-
"aria-label":
|
|
1992
|
+
"aria-label": Qi(t.original, t.index),
|
|
1944
1993
|
onClick: t.getToggleExpandedHandler(),
|
|
1945
|
-
children: /* @__PURE__ */ b(
|
|
1994
|
+
children: /* @__PURE__ */ b(Pt, {
|
|
1946
1995
|
className: V.expanderIcon(),
|
|
1947
1996
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1948
1997
|
"aria-hidden": "true"
|
|
@@ -1956,11 +2005,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1956
2005
|
style: K("actions"),
|
|
1957
2006
|
children: /* @__PURE__ */ x("div", {
|
|
1958
2007
|
className: V.editActions(),
|
|
1959
|
-
children: [T === "row" &&
|
|
1960
|
-
items:
|
|
1961
|
-
onSelect: (e) =>
|
|
1962
|
-
children: /* @__PURE__ */ b(
|
|
1963
|
-
icon:
|
|
2008
|
+
children: [T === "row" && Ho && Rd(t, r), Xr && ol !== t.id && /* @__PURE__ */ b(u, {
|
|
2009
|
+
items: hc(t),
|
|
2010
|
+
onSelect: (e) => yc(t, e),
|
|
2011
|
+
children: /* @__PURE__ */ b(f, {
|
|
2012
|
+
icon: Bt,
|
|
1964
2013
|
label: O.rowActions(r),
|
|
1965
2014
|
variant: "text",
|
|
1966
2015
|
size: "sm"
|
|
@@ -1971,79 +2020,88 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1971
2020
|
]
|
|
1972
2021
|
}, e.key);
|
|
1973
2022
|
}),
|
|
1974
|
-
|
|
2023
|
+
Xu > 0 && !Sd && /* @__PURE__ */ b("tr", {
|
|
1975
2024
|
className: V.spacer(),
|
|
1976
2025
|
"aria-hidden": "true",
|
|
1977
2026
|
children: /* @__PURE__ */ b("td", {
|
|
1978
|
-
colSpan:
|
|
2027
|
+
colSpan: Go,
|
|
1979
2028
|
className: V.spacerCell(),
|
|
1980
|
-
style: { height:
|
|
2029
|
+
style: { height: Xu }
|
|
1981
2030
|
})
|
|
1982
2031
|
})
|
|
1983
2032
|
]
|
|
1984
|
-
}),
|
|
1985
|
-
...
|
|
1986
|
-
ref:
|
|
1987
|
-
className: V.base({ class:
|
|
2033
|
+
}), Vd = /* @__PURE__ */ x("div", {
|
|
2034
|
+
...zi,
|
|
2035
|
+
ref: Yi,
|
|
2036
|
+
className: V.base({ class: Ri }),
|
|
1988
2037
|
role: R ? "dialog" : void 0,
|
|
1989
2038
|
"aria-modal": R || void 0,
|
|
1990
|
-
"aria-label": R ?
|
|
1991
|
-
onKeyDown:
|
|
2039
|
+
"aria-label": R ? Ce : void 0,
|
|
2040
|
+
onKeyDown: Wu,
|
|
1992
2041
|
children: [
|
|
1993
|
-
|
|
2042
|
+
bd && /* @__PURE__ */ x("div", {
|
|
1994
2043
|
className: V.toolbar(),
|
|
1995
2044
|
children: [
|
|
1996
|
-
|
|
1997
|
-
|
|
2045
|
+
Mi && /* @__PURE__ */ b(i, {
|
|
2046
|
+
recipes: fr,
|
|
2047
|
+
children: Mi
|
|
2048
|
+
}),
|
|
2049
|
+
_r && /* @__PURE__ */ b(p, {
|
|
1998
2050
|
type: "search",
|
|
1999
2051
|
size: "sm",
|
|
2000
|
-
leadingIcon:
|
|
2052
|
+
leadingIcon: Zt,
|
|
2001
2053
|
className: V.search(),
|
|
2002
2054
|
placeholder: O.searchPlaceholder,
|
|
2003
|
-
"aria-label": O.search(
|
|
2055
|
+
"aria-label": O.search(Ce),
|
|
2004
2056
|
value: I,
|
|
2005
2057
|
onChange: (e) => L.setGlobalFilter(e.target.value)
|
|
2006
2058
|
}),
|
|
2007
|
-
|
|
2059
|
+
ji && /* @__PURE__ */ b(i, {
|
|
2060
|
+
recipes: fr,
|
|
2061
|
+
children: ji
|
|
2062
|
+
}),
|
|
2008
2063
|
/* @__PURE__ */ x("div", {
|
|
2009
2064
|
className: V.toolbarEnd(),
|
|
2010
2065
|
children: [
|
|
2011
|
-
|
|
2012
|
-
|
|
2066
|
+
Ni && /* @__PURE__ */ b(i, {
|
|
2067
|
+
recipes: fr,
|
|
2068
|
+
children: Ni
|
|
2069
|
+
}),
|
|
2070
|
+
si && /* @__PURE__ */ b(f, {
|
|
2013
2071
|
"data-find-toggle": "",
|
|
2014
|
-
icon:
|
|
2072
|
+
icon: Qt,
|
|
2015
2073
|
label: O.find,
|
|
2016
2074
|
variant: "outline",
|
|
2017
2075
|
size: "sm",
|
|
2018
|
-
"aria-expanded":
|
|
2019
|
-
onClick:
|
|
2076
|
+
"aria-expanded": su,
|
|
2077
|
+
onClick: bu
|
|
2020
2078
|
}),
|
|
2021
|
-
|
|
2079
|
+
fa && /* @__PURE__ */ b(d, {
|
|
2022
2080
|
variant: "outline",
|
|
2023
2081
|
size: "sm",
|
|
2024
|
-
leadingIcon:
|
|
2025
|
-
"aria-expanded":
|
|
2026
|
-
"aria-controls": `${
|
|
2027
|
-
onClick: () =>
|
|
2082
|
+
leadingIcon: Wt,
|
|
2083
|
+
"aria-expanded": sa,
|
|
2084
|
+
"aria-controls": `${Ji}-advanced`,
|
|
2085
|
+
onClick: () => ca(!sa),
|
|
2028
2086
|
children: E.conditionBuilder.advanced
|
|
2029
2087
|
}),
|
|
2030
|
-
|
|
2031
|
-
icon:
|
|
2088
|
+
Or && /* @__PURE__ */ b(f, {
|
|
2089
|
+
icon: Vt,
|
|
2032
2090
|
label: O.filterToggle,
|
|
2033
2091
|
variant: "outline",
|
|
2034
2092
|
size: "sm",
|
|
2035
|
-
"aria-pressed":
|
|
2036
|
-
onClick:
|
|
2093
|
+
"aria-pressed": Wa,
|
|
2094
|
+
onClick: Ao
|
|
2037
2095
|
}),
|
|
2038
|
-
|
|
2039
|
-
icon:
|
|
2096
|
+
kr && /* @__PURE__ */ b(f, {
|
|
2097
|
+
icon: Ht,
|
|
2040
2098
|
label: O.resetFilters,
|
|
2041
2099
|
variant: "outline",
|
|
2042
2100
|
size: "sm",
|
|
2043
|
-
disabled: !
|
|
2044
|
-
onClick:
|
|
2101
|
+
disabled: !As,
|
|
2102
|
+
onClick: Bu
|
|
2045
2103
|
}),
|
|
2046
|
-
|
|
2104
|
+
hi && /* @__PURE__ */ x(S.Root, {
|
|
2047
2105
|
positioning: {
|
|
2048
2106
|
placement: "bottom-end",
|
|
2049
2107
|
gutter: 4
|
|
@@ -2052,36 +2110,36 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2052
2110
|
unmountOnExit: !0,
|
|
2053
2111
|
children: [/* @__PURE__ */ b(S.Trigger, {
|
|
2054
2112
|
asChild: !0,
|
|
2055
|
-
children: /* @__PURE__ */ b(
|
|
2056
|
-
icon:
|
|
2113
|
+
children: /* @__PURE__ */ b(f, {
|
|
2114
|
+
icon: Xt,
|
|
2057
2115
|
label: O.density,
|
|
2058
2116
|
variant: "outline",
|
|
2059
2117
|
size: "sm"
|
|
2060
2118
|
})
|
|
2061
|
-
}), /* @__PURE__ */ b(
|
|
2062
|
-
className:
|
|
2119
|
+
}), /* @__PURE__ */ b(un, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2120
|
+
className: qi.content(),
|
|
2063
2121
|
children: /* @__PURE__ */ b(S.RadioItemGroup, {
|
|
2064
|
-
value:
|
|
2065
|
-
onValueChange: (e) =>
|
|
2122
|
+
value: yo,
|
|
2123
|
+
onValueChange: (e) => Mo(e.value),
|
|
2066
2124
|
children: [
|
|
2067
2125
|
"sm",
|
|
2068
2126
|
"md",
|
|
2069
2127
|
"lg"
|
|
2070
2128
|
].map((e) => /* @__PURE__ */ x(S.RadioItem, {
|
|
2071
2129
|
value: e,
|
|
2072
|
-
className:
|
|
2073
|
-
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(
|
|
2130
|
+
className: qi.item(),
|
|
2131
|
+
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Mt, {
|
|
2074
2132
|
className: V.menuCheck(),
|
|
2075
2133
|
"aria-hidden": "true"
|
|
2076
2134
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2077
|
-
className:
|
|
2135
|
+
className: qi.label(),
|
|
2078
2136
|
children: O.densities[e]
|
|
2079
2137
|
})]
|
|
2080
2138
|
}, e))
|
|
2081
2139
|
})
|
|
2082
2140
|
}) }) })]
|
|
2083
2141
|
}),
|
|
2084
|
-
|
|
2142
|
+
Mr && /* @__PURE__ */ x(S.Root, {
|
|
2085
2143
|
positioning: {
|
|
2086
2144
|
placement: "bottom-end",
|
|
2087
2145
|
gutter: 4
|
|
@@ -2090,15 +2148,15 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2090
2148
|
unmountOnExit: !0,
|
|
2091
2149
|
children: [/* @__PURE__ */ b(S.Trigger, {
|
|
2092
2150
|
asChild: !0,
|
|
2093
|
-
children: /* @__PURE__ */ b(
|
|
2151
|
+
children: /* @__PURE__ */ b(d, {
|
|
2094
2152
|
variant: "outline",
|
|
2095
2153
|
size: "sm",
|
|
2096
|
-
leadingIcon:
|
|
2154
|
+
leadingIcon: Rt,
|
|
2097
2155
|
children: O.columns
|
|
2098
2156
|
})
|
|
2099
|
-
}), /* @__PURE__ */ b(
|
|
2100
|
-
className:
|
|
2101
|
-
children: (
|
|
2157
|
+
}), /* @__PURE__ */ b(un, { children: /* @__PURE__ */ b(S.Positioner, { children: /* @__PURE__ */ b(S.Content, {
|
|
2158
|
+
className: qi.content(),
|
|
2159
|
+
children: (Ad || [{
|
|
2102
2160
|
def: void 0,
|
|
2103
2161
|
leaves: L.getAllLeafColumns()
|
|
2104
2162
|
}]).map(({ def: e, leaves: t }, n) => {
|
|
@@ -2107,135 +2165,135 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2107
2165
|
checked: e.getIsVisible(),
|
|
2108
2166
|
onCheckedChange: (t) => e.toggleVisibility(t),
|
|
2109
2167
|
closeOnSelect: !1,
|
|
2110
|
-
className:
|
|
2111
|
-
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(
|
|
2168
|
+
className: qi.item({ class: t ? V.columnGroupItem() : void 0 }),
|
|
2169
|
+
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Mt, {
|
|
2112
2170
|
className: V.menuCheck(),
|
|
2113
2171
|
"aria-hidden": "true"
|
|
2114
2172
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2115
|
-
className:
|
|
2173
|
+
className: qi.label(),
|
|
2116
2174
|
children: q(e)
|
|
2117
2175
|
})]
|
|
2118
2176
|
}, e.id);
|
|
2119
|
-
return e?.columns ? /* @__PURE__ */ x(
|
|
2177
|
+
return e?.columns ? /* @__PURE__ */ x(nn, { children: [
|
|
2120
2178
|
/* @__PURE__ */ x(S.CheckboxItem, {
|
|
2121
2179
|
value: `group:${e.id}`,
|
|
2122
2180
|
checked: r.every((e) => e.getIsVisible()),
|
|
2123
2181
|
disabled: !r.length,
|
|
2124
2182
|
onCheckedChange: (e) => L.setColumnVisibility({
|
|
2125
|
-
...
|
|
2183
|
+
...co,
|
|
2126
2184
|
...Object.fromEntries(r.map((t) => [t.id, e]))
|
|
2127
2185
|
}),
|
|
2128
2186
|
closeOnSelect: !1,
|
|
2129
|
-
className:
|
|
2130
|
-
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(
|
|
2187
|
+
className: qi.item(),
|
|
2188
|
+
children: [/* @__PURE__ */ b(S.ItemIndicator, { children: /* @__PURE__ */ b(Mt, {
|
|
2131
2189
|
className: V.menuCheck(),
|
|
2132
2190
|
"aria-hidden": "true"
|
|
2133
2191
|
}) }), /* @__PURE__ */ b(S.ItemText, {
|
|
2134
|
-
className:
|
|
2192
|
+
className: qi.label(),
|
|
2135
2193
|
children: e.header
|
|
2136
2194
|
})]
|
|
2137
2195
|
}),
|
|
2138
2196
|
r.map((e) => i(e, !0)),
|
|
2139
|
-
|
|
2197
|
+
Ir && [-1, 1].map((t) => /* @__PURE__ */ b(S.Item, {
|
|
2140
2198
|
value: `group-${t < 0 ? "earlier" : "later"}:${e.id}`,
|
|
2141
|
-
disabled: t < 0 ? n === 0 : n ===
|
|
2199
|
+
disabled: t < 0 ? n === 0 : n === Ad.length - 1,
|
|
2142
2200
|
closeOnSelect: !1,
|
|
2143
|
-
className:
|
|
2144
|
-
onSelect: () =>
|
|
2201
|
+
className: qi.item({ class: V.columnGroupItem() }),
|
|
2202
|
+
onSelect: () => jd(e.id, t),
|
|
2145
2203
|
children: /* @__PURE__ */ b(S.ItemText, {
|
|
2146
|
-
className:
|
|
2204
|
+
className: qi.label(),
|
|
2147
2205
|
children: t < 0 ? O.columnGroupEarlier(e.header) : O.columnGroupLater(e.header)
|
|
2148
2206
|
})
|
|
2149
2207
|
}, t))
|
|
2150
|
-
] }, `group:${e.id}`) : /* @__PURE__ */ b(
|
|
2208
|
+
] }, `group:${e.id}`) : /* @__PURE__ */ b(nn, { children: r.map((e) => i(e, !1)) }, e?.id ?? "columns");
|
|
2151
2209
|
})
|
|
2152
2210
|
}) }) })]
|
|
2153
2211
|
}),
|
|
2154
|
-
|
|
2155
|
-
items:
|
|
2212
|
+
Vr && (Pd.length > 1 ? /* @__PURE__ */ b(u, {
|
|
2213
|
+
items: Pd,
|
|
2156
2214
|
onSelect: (e) => {
|
|
2157
2215
|
let [t, n] = e.includes(":") ? e.split(":") : ["csv", e];
|
|
2158
|
-
|
|
2216
|
+
Lu(t, n === "selection");
|
|
2159
2217
|
},
|
|
2160
|
-
children: /* @__PURE__ */ b(
|
|
2218
|
+
children: /* @__PURE__ */ b(d, {
|
|
2161
2219
|
variant: "outline",
|
|
2162
2220
|
size: "sm",
|
|
2163
|
-
leadingIcon:
|
|
2164
|
-
children:
|
|
2221
|
+
leadingIcon: zt,
|
|
2222
|
+
children: Fd
|
|
2165
2223
|
})
|
|
2166
|
-
}) : /* @__PURE__ */ b(
|
|
2224
|
+
}) : /* @__PURE__ */ b(d, {
|
|
2167
2225
|
variant: "outline",
|
|
2168
2226
|
size: "sm",
|
|
2169
|
-
leadingIcon:
|
|
2170
|
-
onClick: () =>
|
|
2171
|
-
children:
|
|
2227
|
+
leadingIcon: zt,
|
|
2228
|
+
onClick: () => Lu(Md[0], !1),
|
|
2229
|
+
children: Fd
|
|
2172
2230
|
})),
|
|
2173
|
-
|
|
2231
|
+
yi && /* @__PURE__ */ b(f, {
|
|
2174
2232
|
"data-fullscreen-toggle": "",
|
|
2175
|
-
icon: R ?
|
|
2233
|
+
icon: R ? Kt : Gt,
|
|
2176
2234
|
label: R ? O.exitFullscreen : O.fullscreen,
|
|
2177
2235
|
variant: "outline",
|
|
2178
2236
|
size: "sm",
|
|
2179
|
-
onClick:
|
|
2237
|
+
onClick: Uu
|
|
2180
2238
|
})
|
|
2181
2239
|
]
|
|
2182
2240
|
})
|
|
2183
2241
|
]
|
|
2184
2242
|
}),
|
|
2185
|
-
|
|
2186
|
-
id: `${
|
|
2243
|
+
fa && sa && /* @__PURE__ */ b("div", {
|
|
2244
|
+
id: `${Ji}-advanced`,
|
|
2187
2245
|
className: V.advancedFilter(),
|
|
2188
|
-
children:
|
|
2189
|
-
fields:
|
|
2190
|
-
value:
|
|
2191
|
-
onValueChange:
|
|
2246
|
+
children: hr({
|
|
2247
|
+
fields: la,
|
|
2248
|
+
value: oa,
|
|
2249
|
+
onValueChange: da,
|
|
2192
2250
|
label: E.conditionBuilder.advanced
|
|
2193
2251
|
})
|
|
2194
2252
|
}),
|
|
2195
|
-
|
|
2253
|
+
si && su && /* @__PURE__ */ x("div", {
|
|
2196
2254
|
className: V.findBar(),
|
|
2197
2255
|
role: "search",
|
|
2198
2256
|
"aria-label": O.find,
|
|
2199
2257
|
children: [
|
|
2200
|
-
/* @__PURE__ */ b(
|
|
2258
|
+
/* @__PURE__ */ b(p, {
|
|
2201
2259
|
type: "search",
|
|
2202
2260
|
size: "sm",
|
|
2203
2261
|
"data-find-input": "",
|
|
2204
|
-
leadingIcon:
|
|
2262
|
+
leadingIcon: Qt,
|
|
2205
2263
|
className: V.findInput(),
|
|
2206
2264
|
placeholder: O.searchPlaceholder,
|
|
2207
2265
|
"aria-label": O.find,
|
|
2208
|
-
value:
|
|
2209
|
-
onChange: (e) =>
|
|
2210
|
-
onKeyDown:
|
|
2266
|
+
value: lu,
|
|
2267
|
+
onChange: (e) => Su(e.target.value),
|
|
2268
|
+
onKeyDown: xu
|
|
2211
2269
|
}),
|
|
2212
2270
|
/* @__PURE__ */ b("span", {
|
|
2213
2271
|
className: V.findCount(),
|
|
2214
2272
|
"aria-live": "polite",
|
|
2215
|
-
children:
|
|
2273
|
+
children: lu.trim() ? O.findMatches(Q.length ? Math.min(du, Q.length - 1) + 1 : 0, Q.length) : ""
|
|
2216
2274
|
}),
|
|
2217
|
-
/* @__PURE__ */ b(
|
|
2218
|
-
icon:
|
|
2275
|
+
/* @__PURE__ */ b(f, {
|
|
2276
|
+
icon: Ft,
|
|
2219
2277
|
label: O.findPrevious,
|
|
2220
2278
|
variant: "text",
|
|
2221
2279
|
size: "sm",
|
|
2222
2280
|
disabled: !Q.length,
|
|
2223
|
-
onClick: () =>
|
|
2281
|
+
onClick: () => yu(du - 1)
|
|
2224
2282
|
}),
|
|
2225
|
-
/* @__PURE__ */ b(
|
|
2226
|
-
icon:
|
|
2283
|
+
/* @__PURE__ */ b(f, {
|
|
2284
|
+
icon: Nt,
|
|
2227
2285
|
label: O.findNext,
|
|
2228
2286
|
variant: "text",
|
|
2229
2287
|
size: "sm",
|
|
2230
2288
|
disabled: !Q.length,
|
|
2231
|
-
onClick: () =>
|
|
2289
|
+
onClick: () => yu(du + 1)
|
|
2232
2290
|
}),
|
|
2233
|
-
/* @__PURE__ */ b(
|
|
2234
|
-
icon:
|
|
2291
|
+
/* @__PURE__ */ b(f, {
|
|
2292
|
+
icon: tn,
|
|
2235
2293
|
label: O.findClose,
|
|
2236
2294
|
variant: "text",
|
|
2237
2295
|
size: "sm",
|
|
2238
|
-
onClick:
|
|
2296
|
+
onClick: bu
|
|
2239
2297
|
})
|
|
2240
2298
|
]
|
|
2241
2299
|
}),
|
|
@@ -2244,35 +2302,35 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2244
2302
|
children: [
|
|
2245
2303
|
/* @__PURE__ */ b("span", {
|
|
2246
2304
|
className: V.batchCount(),
|
|
2247
|
-
children: O.changes(
|
|
2305
|
+
children: O.changes(el)
|
|
2248
2306
|
}),
|
|
2249
|
-
/* @__PURE__ */ b(
|
|
2307
|
+
/* @__PURE__ */ b(d, {
|
|
2250
2308
|
variant: "text",
|
|
2251
2309
|
size: "sm",
|
|
2252
|
-
leadingIcon:
|
|
2253
|
-
disabled: !
|
|
2254
|
-
onClick:
|
|
2310
|
+
leadingIcon: en,
|
|
2311
|
+
disabled: !Jc.canUndo,
|
|
2312
|
+
onClick: Qc,
|
|
2255
2313
|
children: O.undo
|
|
2256
2314
|
}),
|
|
2257
|
-
/* @__PURE__ */ b(
|
|
2315
|
+
/* @__PURE__ */ b(d, {
|
|
2258
2316
|
variant: "text",
|
|
2259
2317
|
size: "sm",
|
|
2260
|
-
leadingIcon:
|
|
2261
|
-
disabled: !
|
|
2262
|
-
onClick:
|
|
2318
|
+
leadingIcon: Yt,
|
|
2319
|
+
disabled: !Jc.canRedo,
|
|
2320
|
+
onClick: $c,
|
|
2263
2321
|
children: O.redo
|
|
2264
2322
|
}),
|
|
2265
|
-
/* @__PURE__ */ b(
|
|
2323
|
+
/* @__PURE__ */ b(d, {
|
|
2266
2324
|
variant: "outline",
|
|
2267
2325
|
size: "sm",
|
|
2268
|
-
disabled: !
|
|
2269
|
-
onClick:
|
|
2326
|
+
disabled: !el,
|
|
2327
|
+
onClick: rl,
|
|
2270
2328
|
children: O.discardChanges
|
|
2271
2329
|
}),
|
|
2272
|
-
/* @__PURE__ */ b(
|
|
2330
|
+
/* @__PURE__ */ b(d, {
|
|
2273
2331
|
size: "sm",
|
|
2274
|
-
disabled: !
|
|
2275
|
-
onClick:
|
|
2332
|
+
disabled: !el,
|
|
2333
|
+
onClick: nl,
|
|
2276
2334
|
children: O.saveChanges
|
|
2277
2335
|
})
|
|
2278
2336
|
]
|
|
@@ -2280,54 +2338,54 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2280
2338
|
/* @__PURE__ */ b("p", {
|
|
2281
2339
|
role: "status",
|
|
2282
2340
|
className: V.status(),
|
|
2283
|
-
children:
|
|
2341
|
+
children: ss || (l ? _a ? "" : ye($i, E, D) : As ? O.results(L.getFilteredRowModel().rows.length) : "")
|
|
2284
2342
|
}),
|
|
2285
|
-
|
|
2343
|
+
Ro && bt === "top" && Id,
|
|
2286
2344
|
/* @__PURE__ */ b("div", {
|
|
2287
|
-
ref:
|
|
2345
|
+
ref: Gu,
|
|
2288
2346
|
className: V.scroll(),
|
|
2289
|
-
style:
|
|
2290
|
-
onScroll:
|
|
2347
|
+
style: bi === "fill" ? xi ? { minHeight: xi } : void 0 : bi ? { maxHeight: bi } : void 0,
|
|
2348
|
+
onScroll: $u,
|
|
2291
2349
|
children: /* @__PURE__ */ x("table", {
|
|
2292
2350
|
ref: $,
|
|
2293
|
-
className: V.table({ class:
|
|
2294
|
-
style:
|
|
2295
|
-
"aria-busy":
|
|
2296
|
-
"aria-rowcount": B ? Y.length +
|
|
2297
|
-
role: z ?
|
|
2298
|
-
"aria-multiselectable": z && (
|
|
2351
|
+
className: V.table({ class: Ko ? V.fixedLayout() : void 0 }),
|
|
2352
|
+
style: Ko ? { minWidth: L.getTotalSize() + Yo + Xo } : void 0,
|
|
2353
|
+
"aria-busy": va || void 0,
|
|
2354
|
+
"aria-rowcount": B ? Y.length + ts.length : void 0,
|
|
2355
|
+
role: z ? Lo ? "treegrid" : "grid" : void 0,
|
|
2356
|
+
"aria-multiselectable": z && (hn && Vs || w) ? "true" : void 0,
|
|
2299
2357
|
tabIndex: (w || T === "batch") && !z ? -1 : void 0,
|
|
2300
|
-
onKeyDown:
|
|
2301
|
-
onFocus:
|
|
2358
|
+
onKeyDown: od,
|
|
2359
|
+
onFocus: ad,
|
|
2302
2360
|
children: [
|
|
2303
2361
|
/* @__PURE__ */ b("caption", {
|
|
2304
2362
|
className: V.caption(),
|
|
2305
|
-
children:
|
|
2363
|
+
children: Ce
|
|
2306
2364
|
}),
|
|
2307
2365
|
/* @__PURE__ */ x("thead", {
|
|
2308
|
-
ref:
|
|
2366
|
+
ref: ed,
|
|
2309
2367
|
className: V.head(),
|
|
2310
|
-
children: [
|
|
2368
|
+
children: [ts.map((e, t) => /* @__PURE__ */ x("tr", {
|
|
2311
2369
|
className: V.headRow(),
|
|
2312
2370
|
children: [
|
|
2313
2371
|
t === 0 && H.map((e) => /* @__PURE__ */ b("th", {
|
|
2314
2372
|
scope: "col",
|
|
2315
|
-
rowSpan:
|
|
2373
|
+
rowSpan: ts.length,
|
|
2316
2374
|
className: V.th({ class: G(e, !0) }),
|
|
2317
2375
|
style: K(e),
|
|
2318
|
-
children: e === "select" &&
|
|
2319
|
-
checked:
|
|
2320
|
-
"aria-label":
|
|
2321
|
-
onCheckedChange: (e) =>
|
|
2376
|
+
children: e === "select" && Vs ? /* @__PURE__ */ b(ae, {
|
|
2377
|
+
checked: Gs,
|
|
2378
|
+
"aria-label": Mn ?? (Cn === "all" ? O.selectAllRows : O.selectAll),
|
|
2379
|
+
onCheckedChange: (e) => Ks(e === !0)
|
|
2322
2380
|
}) : e === "select" ? /* @__PURE__ */ b("span", {
|
|
2323
2381
|
className: V.srOnly(),
|
|
2324
2382
|
children: O.select
|
|
2325
2383
|
}) : e === "expand" ? /* @__PURE__ */ b("button", {
|
|
2326
2384
|
type: "button",
|
|
2327
2385
|
className: V.expander(),
|
|
2328
|
-
"aria-label":
|
|
2329
|
-
onClick: () => L.toggleAllRowsExpanded(!
|
|
2330
|
-
children: b(
|
|
2386
|
+
"aria-label": sc ? O.collapseAll : O.expandAll,
|
|
2387
|
+
onClick: () => L.toggleAllRowsExpanded(!sc),
|
|
2388
|
+
children: b(sc ? It : Lt, {
|
|
2331
2389
|
className: V.expanderIcon(),
|
|
2332
2390
|
"aria-hidden": "true"
|
|
2333
2391
|
})
|
|
@@ -2345,43 +2403,43 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2345
2403
|
className: V.th({ class: V.groupTh() }),
|
|
2346
2404
|
children: q(t)
|
|
2347
2405
|
}, e.header.id);
|
|
2348
|
-
let r = t.getIsSorted(), i =
|
|
2406
|
+
let r = t.getIsSorted(), i = os(t.id);
|
|
2349
2407
|
return /* @__PURE__ */ x("th", {
|
|
2350
|
-
id:
|
|
2408
|
+
id: Cu ? wu(t.id) : void 0,
|
|
2351
2409
|
scope: "col",
|
|
2352
2410
|
rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
2353
|
-
className:
|
|
2354
|
-
|
|
2355
|
-
|
|
2411
|
+
className: Bo(t.id).th({ class: [
|
|
2412
|
+
Zo(t.id, !0),
|
|
2413
|
+
Ir ? V.dropTargetColumn() : "",
|
|
2356
2414
|
j.get(t.id)?.headerClass
|
|
2357
2415
|
] }),
|
|
2358
|
-
style:
|
|
2359
|
-
"aria-sort":
|
|
2360
|
-
draggable:
|
|
2361
|
-
"data-drop":
|
|
2362
|
-
"data-dragging":
|
|
2363
|
-
onDragStart: (e) =>
|
|
2364
|
-
onDragOver: (e) =>
|
|
2365
|
-
onDragLeave: () =>
|
|
2366
|
-
onDrop:
|
|
2367
|
-
onDragEnd:
|
|
2416
|
+
style: Qo(t.id, !0),
|
|
2417
|
+
"aria-sort": as(t.id),
|
|
2418
|
+
draggable: fs(t.id) && !t.getIsPinned() ? "true" : void 0,
|
|
2419
|
+
"data-drop": ws(t.id),
|
|
2420
|
+
"data-dragging": gs === t.id || void 0,
|
|
2421
|
+
onDragStart: (e) => bs(t.id, e),
|
|
2422
|
+
onDragOver: (e) => xs(t.id, e),
|
|
2423
|
+
onDragLeave: () => ys(null),
|
|
2424
|
+
onDrop: Cs,
|
|
2425
|
+
onDragEnd: Ss,
|
|
2368
2426
|
children: [/* @__PURE__ */ x("div", {
|
|
2369
|
-
className:
|
|
2427
|
+
className: Bo(t.id).headContent(),
|
|
2370
2428
|
children: [
|
|
2371
|
-
|
|
2429
|
+
rs(t.id) ? /* @__PURE__ */ x("button", {
|
|
2372
2430
|
type: "button",
|
|
2373
2431
|
className: V.sortButton(),
|
|
2374
|
-
onClick: (e) =>
|
|
2432
|
+
onClick: (e) => wo($e(N, t.id, dn === "multiple" && e.shiftKey)),
|
|
2375
2433
|
children: [
|
|
2376
2434
|
/* @__PURE__ */ b("span", {
|
|
2377
|
-
className:
|
|
2435
|
+
className: ns(t),
|
|
2378
2436
|
children: q(t)
|
|
2379
2437
|
}),
|
|
2380
|
-
b(r === "asc" ?
|
|
2438
|
+
b(r === "asc" ? At : r === "desc" ? kt : jt, {
|
|
2381
2439
|
className: V.sortIcon(),
|
|
2382
2440
|
"aria-hidden": "true"
|
|
2383
2441
|
}),
|
|
2384
|
-
N.length > 1 && i > 0 && /* @__PURE__ */ x(
|
|
2442
|
+
N.length > 1 && i > 0 && /* @__PURE__ */ x(ln, { children: [/* @__PURE__ */ b("span", {
|
|
2385
2443
|
className: V.sortBadge(),
|
|
2386
2444
|
"aria-hidden": "true",
|
|
2387
2445
|
children: i
|
|
@@ -2391,59 +2449,59 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2391
2449
|
})] })
|
|
2392
2450
|
]
|
|
2393
2451
|
}) : /* @__PURE__ */ b("span", {
|
|
2394
|
-
className:
|
|
2452
|
+
className: ns(t),
|
|
2395
2453
|
children: q(t)
|
|
2396
2454
|
}),
|
|
2397
|
-
|
|
2455
|
+
ks && n && Ds(n) && /* @__PURE__ */ b(Kn, {
|
|
2398
2456
|
header: q(t),
|
|
2399
2457
|
type: n.filter ?? "text",
|
|
2400
|
-
value:
|
|
2401
|
-
onChange: (e) =>
|
|
2402
|
-
options:
|
|
2458
|
+
value: js(t.id),
|
|
2459
|
+
onChange: (e) => Ps(t.id, e),
|
|
2460
|
+
options: Ms(n),
|
|
2403
2461
|
inputProps: n.filterInputProps,
|
|
2404
2462
|
renderOption: n.renderOption,
|
|
2405
2463
|
matchModes: n.matchModes,
|
|
2406
|
-
maxConstraints:
|
|
2464
|
+
maxConstraints: Ar,
|
|
2407
2465
|
renderValue: n.renderFilter ? (e) => n.renderFilter({
|
|
2408
2466
|
...e,
|
|
2409
2467
|
column: n
|
|
2410
2468
|
}) : void 0
|
|
2411
2469
|
}),
|
|
2412
|
-
|
|
2413
|
-
items:
|
|
2414
|
-
onSelect: (e) =>
|
|
2470
|
+
ds && /* @__PURE__ */ b(u, {
|
|
2471
|
+
items: ps(t),
|
|
2472
|
+
onSelect: (e) => hs(t, e),
|
|
2415
2473
|
children: /* @__PURE__ */ b("button", {
|
|
2416
2474
|
type: "button",
|
|
2417
2475
|
className: V.headButton(),
|
|
2418
2476
|
"data-column-menu": t.id,
|
|
2419
2477
|
"aria-label": O.columnMenu(q(t)),
|
|
2420
|
-
children: /* @__PURE__ */ b(
|
|
2478
|
+
children: /* @__PURE__ */ b(Bt, {
|
|
2421
2479
|
className: V.headButtonIcon(),
|
|
2422
2480
|
"aria-hidden": "true"
|
|
2423
2481
|
})
|
|
2424
2482
|
})
|
|
2425
2483
|
})
|
|
2426
2484
|
]
|
|
2427
|
-
}),
|
|
2485
|
+
}), jr && /* @__PURE__ */ b("div", {
|
|
2428
2486
|
role: "separator",
|
|
2429
2487
|
"aria-orientation": "vertical",
|
|
2430
2488
|
"aria-label": O.resize(q(t)),
|
|
2431
2489
|
"aria-valuenow": t.getSize(),
|
|
2432
|
-
"aria-valuemin":
|
|
2490
|
+
"aria-valuemin": rr,
|
|
2433
2491
|
"aria-valuemax": 1200,
|
|
2434
2492
|
tabIndex: 0,
|
|
2435
|
-
className: V.resizer(),
|
|
2493
|
+
className: V.resizer({ edge: Wo(t.id) }),
|
|
2436
2494
|
"data-resizing": t.getIsResizing() || void 0,
|
|
2437
2495
|
onMouseDown: e.header.getResizeHandler(),
|
|
2438
2496
|
onTouchStart: e.header.getResizeHandler(),
|
|
2439
|
-
onKeyDown: (e) =>
|
|
2440
|
-
onDoubleClick: (e) =>
|
|
2497
|
+
onKeyDown: (e) => Es(t.id, e),
|
|
2498
|
+
onDoubleClick: (e) => Ts(t.id, e)
|
|
2441
2499
|
})]
|
|
2442
2500
|
}, e.header.id);
|
|
2443
2501
|
}),
|
|
2444
2502
|
t === 0 && U.length > 0 && /* @__PURE__ */ b("th", {
|
|
2445
2503
|
scope: "col",
|
|
2446
|
-
rowSpan:
|
|
2504
|
+
rowSpan: ts.length,
|
|
2447
2505
|
className: V.th({ class: G("actions", !0) }),
|
|
2448
2506
|
style: K("actions"),
|
|
2449
2507
|
children: /* @__PURE__ */ b("span", {
|
|
@@ -2452,7 +2510,7 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2452
2510
|
})
|
|
2453
2511
|
})
|
|
2454
2512
|
]
|
|
2455
|
-
}, t)),
|
|
2513
|
+
}, t)), Os && /* @__PURE__ */ x("tr", {
|
|
2456
2514
|
className: V.filterRow(),
|
|
2457
2515
|
children: [
|
|
2458
2516
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2462,31 +2520,39 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2462
2520
|
W.map((e) => {
|
|
2463
2521
|
let t = j.get(e.id);
|
|
2464
2522
|
return /* @__PURE__ */ b("td", {
|
|
2465
|
-
className:
|
|
2466
|
-
style:
|
|
2467
|
-
children: t &&
|
|
2468
|
-
value:
|
|
2469
|
-
setValue: (e) =>
|
|
2523
|
+
className: Bo(e.id).filterCell({ class: Zo(e.id, !0) }),
|
|
2524
|
+
style: Qo(e.id, !0),
|
|
2525
|
+
children: t && Ds(t) ? t.renderFilter ? t.renderFilter({
|
|
2526
|
+
value: Ns(t),
|
|
2527
|
+
setValue: (e) => Ls(t, e),
|
|
2470
2528
|
column: t
|
|
2471
|
-
}) :
|
|
2529
|
+
}) : ze(Fs(t)) && Rs(t) ? /* @__PURE__ */ b(Gn, {
|
|
2530
|
+
range: !0,
|
|
2531
|
+
type: Is(t),
|
|
2532
|
+
label: O.filter(q(e)),
|
|
2533
|
+
inputProps: t.filterInputProps,
|
|
2534
|
+
value: Ns(t),
|
|
2535
|
+
onChange: (e) => Ls(t, e)
|
|
2536
|
+
}) : ze(Fs(t)) ? /* @__PURE__ */ b("div", {
|
|
2472
2537
|
className: V.filterRowRange(),
|
|
2473
|
-
children: [0, 1].map((n) => /* @__PURE__ */ b(
|
|
2474
|
-
type:
|
|
2538
|
+
children: [0, 1].map((n) => /* @__PURE__ */ b(Gn, {
|
|
2539
|
+
type: Is(t),
|
|
2475
2540
|
label: `${O.filter(q(e))}, ${n ? O.to : O.from}`,
|
|
2476
|
-
options:
|
|
2541
|
+
options: Ms(t),
|
|
2477
2542
|
inputProps: t.filterInputProps,
|
|
2478
|
-
value:
|
|
2479
|
-
onChange: (e) =>
|
|
2543
|
+
value: zs(t, n),
|
|
2544
|
+
onChange: (e) => Bs(t, n, e)
|
|
2480
2545
|
}, n))
|
|
2481
|
-
}) : /* @__PURE__ */ b(
|
|
2482
|
-
type:
|
|
2546
|
+
}) : /* @__PURE__ */ b(Gn, {
|
|
2547
|
+
type: Is(t),
|
|
2483
2548
|
label: O.filter(q(e)),
|
|
2484
|
-
options:
|
|
2549
|
+
options: Ms(t),
|
|
2485
2550
|
inputProps: t.filterInputProps,
|
|
2486
2551
|
renderOption: t.renderOption,
|
|
2487
2552
|
any: !0,
|
|
2488
|
-
|
|
2489
|
-
|
|
2553
|
+
filter: !0,
|
|
2554
|
+
value: Ns(t),
|
|
2555
|
+
onChange: (e) => Ls(t, e)
|
|
2490
2556
|
}) : null
|
|
2491
2557
|
}, e.id);
|
|
2492
2558
|
}),
|
|
@@ -2497,14 +2563,15 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2497
2563
|
]
|
|
2498
2564
|
})]
|
|
2499
2565
|
}),
|
|
2500
|
-
|
|
2566
|
+
nc.length > 0 && /* @__PURE__ */ b("tbody", {
|
|
2501
2567
|
className: V.frozenBody(),
|
|
2502
|
-
style:
|
|
2503
|
-
children:
|
|
2504
|
-
className: V.row({ class:
|
|
2505
|
-
"data-state":
|
|
2506
|
-
"aria-selected": z &&
|
|
2568
|
+
style: bi ? { top: td } : void 0,
|
|
2569
|
+
children: nc.map((e, t) => /* @__PURE__ */ x("tr", {
|
|
2570
|
+
className: V.row({ class: $r?.(e.original) }),
|
|
2571
|
+
"data-state": Us(e) ? "selected" : void 0,
|
|
2572
|
+
"aria-selected": z && hn ? Us(e) : void 0,
|
|
2507
2573
|
"data-row-id": e.id,
|
|
2574
|
+
"data-stripe": Wi ? String(t % 2 == 1) : void 0,
|
|
2508
2575
|
children: [
|
|
2509
2576
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
2510
2577
|
className: V.td({ class: G(e, !1) }),
|
|
@@ -2513,11 +2580,11 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2513
2580
|
e.getVisibleCells().map((t) => {
|
|
2514
2581
|
let n = j.get(t.column.id);
|
|
2515
2582
|
return /* @__PURE__ */ b("td", {
|
|
2516
|
-
className:
|
|
2517
|
-
style:
|
|
2518
|
-
children: n?.editable && (
|
|
2583
|
+
className: Bo(t.column.id).td({ class: [Zo(t.column.id, !1), Vo(t.column.id, e)] }),
|
|
2584
|
+
style: Qo(t.column.id, !1),
|
|
2585
|
+
children: n?.editable && (Uo || ol === e.id) ? zd(e, t.column, Kc(e, t.column.id)) : n?.copyable ? /* @__PURE__ */ x("span", {
|
|
2519
2586
|
className: V.copyCell(),
|
|
2520
|
-
children: [n.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original), /* @__PURE__ */ b(
|
|
2587
|
+
children: [n.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original), /* @__PURE__ */ b(m, {
|
|
2521
2588
|
value: M(n, t.getValue(), e.original),
|
|
2522
2589
|
label: O.copy(q(t.column), M(n, t.getValue(), e.original))
|
|
2523
2590
|
})]
|
|
@@ -2527,21 +2594,21 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2527
2594
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2528
2595
|
className: V.td({ class: G("actions", !1) }),
|
|
2529
2596
|
style: K("actions"),
|
|
2530
|
-
children: T === "row" &&
|
|
2597
|
+
children: T === "row" && Ho && /* @__PURE__ */ b("div", {
|
|
2531
2598
|
className: V.editActions(),
|
|
2532
|
-
children:
|
|
2599
|
+
children: Rd(e, Zi(e.original, e.index))
|
|
2533
2600
|
})
|
|
2534
2601
|
})
|
|
2535
2602
|
]
|
|
2536
2603
|
}, e.id))
|
|
2537
2604
|
}),
|
|
2538
|
-
|
|
2539
|
-
items:
|
|
2540
|
-
label:
|
|
2541
|
-
onSelect: (e) =>
|
|
2542
|
-
children:
|
|
2543
|
-
}) :
|
|
2544
|
-
|
|
2605
|
+
Qr && Xr ? /* @__PURE__ */ b(te, {
|
|
2606
|
+
items: gc ? hc(gc) : [],
|
|
2607
|
+
label: gc ? O.rowActions(Zi(gc.original, gc.index)) : void 0,
|
|
2608
|
+
onSelect: (e) => yc(gc, e),
|
|
2609
|
+
children: Bd
|
|
2610
|
+
}) : Bd,
|
|
2611
|
+
uc && /* @__PURE__ */ b("tfoot", {
|
|
2545
2612
|
className: V.foot(),
|
|
2546
2613
|
children: /* @__PURE__ */ x("tr", { children: [
|
|
2547
2614
|
H.map((e) => /* @__PURE__ */ b("td", {
|
|
@@ -2549,9 +2616,9 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2549
2616
|
style: K(e)
|
|
2550
2617
|
}, e)),
|
|
2551
2618
|
W.map((e) => /* @__PURE__ */ b("td", {
|
|
2552
|
-
className:
|
|
2553
|
-
style:
|
|
2554
|
-
children:
|
|
2619
|
+
className: Bo(e.id).footCell({ class: [Zo(e.id, !1), Vo(e.id)] }),
|
|
2620
|
+
style: Qo(e.id, !1),
|
|
2621
|
+
children: mc(j.get(e.id))
|
|
2555
2622
|
}, e.id)),
|
|
2556
2623
|
U.length > 0 && /* @__PURE__ */ b("td", {
|
|
2557
2624
|
className: V.footCell({ class: G("actions", !1) }),
|
|
@@ -2562,25 +2629,25 @@ function tr({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2562
2629
|
]
|
|
2563
2630
|
})
|
|
2564
2631
|
}),
|
|
2565
|
-
|
|
2632
|
+
ri && /* @__PURE__ */ x("div", {
|
|
2566
2633
|
className: V.statusBar(),
|
|
2567
2634
|
children: [
|
|
2568
|
-
/* @__PURE__ */ b("span", { children: O.rowCount(
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2635
|
+
/* @__PURE__ */ b("span", { children: O.rowCount(Ed) }),
|
|
2636
|
+
As && /* @__PURE__ */ b("span", { children: O.filteredCount(L.getFilteredRowModel().rows.length) }),
|
|
2637
|
+
hn && /* @__PURE__ */ b("span", { children: E.common.selectedCount(Ws) }),
|
|
2638
|
+
Td.map((e) => /* @__PURE__ */ b("span", { children: e.text }, e.id))
|
|
2572
2639
|
]
|
|
2573
2640
|
}),
|
|
2574
|
-
|
|
2641
|
+
Ro && bt === "bottom" && Id
|
|
2575
2642
|
]
|
|
2576
2643
|
});
|
|
2577
|
-
return /* @__PURE__ */ b(
|
|
2578
|
-
value:
|
|
2579
|
-
children: R ?
|
|
2644
|
+
return /* @__PURE__ */ b(Wn.Provider, {
|
|
2645
|
+
value: Xi,
|
|
2646
|
+
children: R ? fn(Vd, document.body) : /* @__PURE__ */ b(nn, { children: Vd })
|
|
2580
2647
|
});
|
|
2581
2648
|
}
|
|
2582
2649
|
//#endregion
|
|
2583
2650
|
//#region src/data-table/inputs.ts
|
|
2584
|
-
var
|
|
2651
|
+
var mr = { dateInput: o }, hr = { numberInput: ee }, gr = { dateRangeInput: l };
|
|
2585
2652
|
//#endregion
|
|
2586
|
-
export {
|
|
2653
|
+
export { pr as DataTable, he as createDataController, be as dataSourceToRows, mr as dateInput, gr as dateRangeInput, Ce as defineMatchMode, Ze as moveItem, Qe as moveTreeRow, hr as numberInput, ht as rowsToDataSource };
|