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