@wirecore/wirelayer-react 0.4.0 → 0.6.0

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