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