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