@box-kite/react 2.2.6 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/box-kite-rules.md +2 -0
- package/.claude/skills/box-kite/SKILL.md +2 -0
- package/.claude/skills/box-kite/references/extending.md +10 -0
- package/.claude/skills/box-kite/references/styling.md +3 -2
- package/.cursor/rules/box-kite.mdc +2 -0
- package/AGENTS.md +2 -0
- package/BOX_AI_CONTEXT.md +128 -2
- package/BOX_KITE_AI_CONTEXT.md +128 -2
- package/analytics.cjs +1 -0
- package/analytics.d.ts +10 -0
- package/analytics.mjs +121 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +42 -38
- package/box.cjs +1 -1
- package/box.d.ts +14 -0
- package/box.mjs +17 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +8 -0
- package/client.cjs +1 -1
- package/client.mjs +144 -113
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +19 -10
- package/components/agent.cjs +1 -1
- package/components/agent.mjs +21 -8
- package/components/calendar.cjs +1 -1
- package/components/calendar.d.ts +3 -1
- package/components/calendar.mjs +154 -142
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +184 -174
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +183 -170
- package/components/dataGrid/models/columnModel.d.ts +1 -0
- package/components/dataGrid/models/gridModel.d.ts +18 -0
- package/components/dataGrid/models/headerCellModel.d.ts +1 -0
- package/components/dataGrid/models/rangeModel.d.ts +3 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +1015 -923
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +165 -159
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +198 -183
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +38 -33
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +107 -93
- package/components/form.cjs +1 -1
- package/components/form.mjs +22 -18
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -0
- package/components/menu.mjs +196 -175
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +7 -7
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +4 -0
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +10 -5
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +84 -83
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +158 -150
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +92 -84
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +10 -5
- package/components/timeZoneSelect.cjs +1 -1
- package/components/timeZoneSelect.mjs +40 -35
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +151 -113
- package/create/src/index.d.ts +1 -0
- package/create/src/options.d.ts +27 -0
- package/create/src/options.test.d.ts +1 -0
- package/create/src/packageManager.d.ts +5 -0
- package/create/src/project.d.ts +25 -0
- package/create/src/project.test.d.ts +1 -0
- package/create/templates/ts/designs/azure.d.ts +5 -0
- package/create/templates/ts/designs/ember.d.ts +5 -0
- package/create/templates/ts/designs/mono.d.ts +5 -0
- package/create/templates/ts/src/App.d.ts +2 -0
- package/create/templates/ts/src/design.d.ts +5 -0
- package/create/templates/ts/src/main.d.ts +0 -0
- package/dataGridDateParts.cjs +1 -1
- package/dataGridDateParts.mjs +56 -55
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +437 -436
- package/docs/props.md +19 -19
- package/effects.cjs +1 -1
- package/effects.mjs +1 -1
- package/interactionListening.cjs +1 -0
- package/interactionListening.mjs +117 -0
- package/interactions.cjs +1 -0
- package/interactions.mjs +25 -0
- package/layer.cjs +1 -1
- package/layer.mjs +68 -66
- package/package.json +139 -70
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +44 -25
- package/react/interactions/interactions.d.ts +30 -0
- package/react/popover/usePopoverLayer.d.ts +3 -0
- package/react/theme/theme.d.ts +9 -0
- package/react/theme/themeContext.d.ts +2 -0
- package/react/useStyles.d.ts +8 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +49 -48
- package/reporting.cjs +1 -0
- package/reporting.mjs +51 -0
- package/rsc.cjs +1 -1
- package/rsc.d.ts +3 -0
- package/rsc.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/supabase/functions/collect/index.d.ts +30 -0
- package/supabase/functions/collect/index.test.d.ts +1 -0
- package/utils/analytics/analytics.d.ts +72 -0
- package/utils/analytics/analyticsIdentity.d.ts +13 -0
- package/utils/interactions/componentAttribute.d.ts +6 -0
- package/utils/interactions/interactionChannel.d.ts +35 -0
- package/utils/interactions/interactionJson.d.ts +6 -0
- package/utils/interactions/interactionListening.d.ts +6 -0
- package/utils/interactions/interactionTypes.d.ts +224 -0
package/components/dataGrid.mjs
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { l as e, o as t, p as n } from "../platform.mjs";
|
|
3
3
|
import { n as r } from "../effects.mjs";
|
|
4
|
-
import i from "../
|
|
5
|
-
import
|
|
6
|
-
import { t as u } from "../
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import m from "./
|
|
10
|
-
import h from "./
|
|
11
|
-
import g from "./
|
|
12
|
-
import _ from "./
|
|
13
|
-
import v from "./
|
|
14
|
-
import y from "./
|
|
15
|
-
import
|
|
16
|
-
import x from "./
|
|
17
|
-
import S from "
|
|
18
|
-
import
|
|
19
|
-
import w from "./
|
|
20
|
-
import T from "./
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { useSyncExternalStore as ae } from "
|
|
4
|
+
import { t as i } from "../interactions.mjs";
|
|
5
|
+
import a from "../box.mjs";
|
|
6
|
+
import { a as o, n as s, o as c, r as l, t as u } from "../behavior.mjs";
|
|
7
|
+
import { t as d } from "../identity.mjs";
|
|
8
|
+
import { t as f } from "../reporting.mjs";
|
|
9
|
+
import { Path as p, Svg as m } from "./svg.mjs";
|
|
10
|
+
import h from "./button.mjs";
|
|
11
|
+
import g from "./visuallyHidden.mjs";
|
|
12
|
+
import _ from "./flex.mjs";
|
|
13
|
+
import v from "./checkbox.mjs";
|
|
14
|
+
import y from "./overlay.mjs";
|
|
15
|
+
import b from "./presence.mjs";
|
|
16
|
+
import x from "./textbox.mjs";
|
|
17
|
+
import { n as S } from "../scrolling.mjs";
|
|
18
|
+
import C from "./grid.mjs";
|
|
19
|
+
import w from "./dropdown.mjs";
|
|
20
|
+
import { Span as T } from "./semantics.mjs";
|
|
21
|
+
import E from "./popover.mjs";
|
|
22
|
+
import ee from "./switch.mjs";
|
|
23
|
+
import D, { Fragment as te, createContext as O, forwardRef as k, memo as A, useCallback as j, useContext as M, useEffect as N, useImperativeHandle as ne, useLayoutEffect as re, useMemo as ie, useRef as P, useState as F, useSyncExternalStore as ae } from "react";
|
|
24
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
25
|
+
import { useSyncExternalStore as oe } from "use-sync-external-store/shim";
|
|
24
26
|
//#region src/components/dataGrid/components/dataGridBottomBarSelection.tsx
|
|
25
|
-
function
|
|
27
|
+
function se(e) {
|
|
26
28
|
let { grid: t } = e, n = t.selectedRows.size, r = t.isSelectionView;
|
|
27
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ R(_, {
|
|
28
30
|
component: `${t.componentName}.bottomBar.selection`,
|
|
29
31
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ L(a, {
|
|
31
33
|
component: `${t.componentName}.bottomBar.info`,
|
|
32
34
|
children: t.localeText.selectedCount(n, t.hiddenSelectedCount)
|
|
33
35
|
}),
|
|
34
|
-
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */
|
|
36
|
+
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */ L(h, {
|
|
35
37
|
type: "button",
|
|
36
38
|
component: `${t.componentName}.bottomBar.action`,
|
|
37
39
|
variant: { pressed: r },
|
|
@@ -39,11 +41,11 @@ function oe(e) {
|
|
|
39
41
|
onClick: t.toggleSelectionView,
|
|
40
42
|
children: t.localeText.showSelected
|
|
41
43
|
}),
|
|
42
|
-
n > 0 && /* @__PURE__ */
|
|
44
|
+
n > 0 && /* @__PURE__ */ R(h, {
|
|
43
45
|
type: "button",
|
|
44
46
|
component: `${t.componentName}.bottomBar.action`,
|
|
45
47
|
onClick: t.clearSelection,
|
|
46
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ L(a, {
|
|
47
49
|
tag: "span",
|
|
48
50
|
props: { "aria-hidden": !0 },
|
|
49
51
|
children: "✕"
|
|
@@ -54,74 +56,74 @@ function oe(e) {
|
|
|
54
56
|
}
|
|
55
57
|
//#endregion
|
|
56
58
|
//#region src/components/dataGrid/components/dataGridPagination.tsx
|
|
57
|
-
function
|
|
58
|
-
let { grid: t } = e, { pagination: n } = t, r = n.state,
|
|
59
|
+
function ce(e) {
|
|
60
|
+
let { grid: t } = e, { pagination: n } = t, r = n.state, i = j(() => n.firstPage(), [n]), o = j(() => n.prevPage(), [n]), s = j(() => n.nextPage(), [n]), c = j(() => n.lastPage(), [n]);
|
|
59
61
|
if (!r) return null;
|
|
60
62
|
let { canGoPrev: l, canGoNext: u, totalPages: d } = n;
|
|
61
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ R(_, {
|
|
62
64
|
component: `${t.componentName}.bottomBar.pagination`,
|
|
63
65
|
gap: .5,
|
|
64
66
|
ai: "center",
|
|
65
67
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ L(le, {
|
|
67
69
|
grid: t,
|
|
68
70
|
pageSize: r.pageSize
|
|
69
71
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ L(de, {
|
|
71
73
|
componentName: t.componentName,
|
|
72
74
|
label: t.localeText.firstPage,
|
|
73
|
-
onClick:
|
|
75
|
+
onClick: i,
|
|
74
76
|
disabled: !l,
|
|
75
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ L(he, {})
|
|
76
78
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ L(de, {
|
|
78
80
|
componentName: t.componentName,
|
|
79
81
|
label: t.localeText.previousPage,
|
|
80
82
|
onClick: o,
|
|
81
83
|
disabled: !l,
|
|
82
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ L(pe, {})
|
|
83
85
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ R(_, {
|
|
85
87
|
ai: "center",
|
|
86
88
|
gap: 1.5,
|
|
87
89
|
px: 2,
|
|
88
90
|
userSelect: "none",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ L(ue, {
|
|
90
92
|
grid: t,
|
|
91
93
|
page: r.page,
|
|
92
94
|
totalPages: d
|
|
93
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ L(a, {
|
|
94
96
|
component: `${t.componentName}.bottomBar.pagination.info`,
|
|
95
97
|
fontSize: 12,
|
|
96
98
|
opacity: .7,
|
|
97
99
|
children: t.localeText.pageCount(d)
|
|
98
100
|
})]
|
|
99
101
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ L(de, {
|
|
101
103
|
componentName: t.componentName,
|
|
102
104
|
label: t.localeText.nextPage,
|
|
103
105
|
onClick: s,
|
|
104
106
|
disabled: !u,
|
|
105
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ L(me, {})
|
|
106
108
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ L(de, {
|
|
108
110
|
componentName: t.componentName,
|
|
109
111
|
label: t.localeText.lastPage,
|
|
110
112
|
onClick: c,
|
|
111
113
|
disabled: !u,
|
|
112
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ L(ge, {})
|
|
113
115
|
})
|
|
114
116
|
]
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
|
-
|
|
118
|
-
function
|
|
119
|
+
ce.displayName = "DataGridPagination";
|
|
120
|
+
function le({ grid: e, pageSize: t }) {
|
|
119
121
|
let n = e.pagination.pageSizeOptions;
|
|
120
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
122
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ L(_, {
|
|
121
123
|
ai: "center",
|
|
122
124
|
gap: 1,
|
|
123
125
|
me: 1,
|
|
124
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ L(a, {
|
|
125
127
|
component: `${e.componentName}.bottomBar.pagination.pageSize`,
|
|
126
128
|
tag: "select",
|
|
127
129
|
fontSize: 12,
|
|
@@ -132,22 +134,22 @@ function ce({ grid: e, pageSize: t }) {
|
|
|
132
134
|
value: t,
|
|
133
135
|
onChange: (t) => e.pagination.changePageSize(Number(t.target.value))
|
|
134
136
|
},
|
|
135
|
-
children: n.map((t) => /* @__PURE__ */
|
|
137
|
+
children: n.map((t) => /* @__PURE__ */ L("option", {
|
|
136
138
|
value: t,
|
|
137
139
|
children: e.localeText.pageSizeOption(t)
|
|
138
140
|
}, t))
|
|
139
141
|
})
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
|
-
function
|
|
143
|
-
let [r, i] =
|
|
144
|
+
function ue({ grid: e, page: t, totalPages: n }) {
|
|
145
|
+
let [r, i] = F(String(t)), [a, o] = F(t);
|
|
144
146
|
t !== a && (o(t), i(String(t)));
|
|
145
|
-
let s =
|
|
147
|
+
let s = j(() => {
|
|
146
148
|
e.pagination.jumpToPage(r), i(String(e.pagination.page));
|
|
147
|
-
}, [e, r]), c =
|
|
149
|
+
}, [e, r]), c = j((e) => {
|
|
148
150
|
e.key === "Enter" ? s() : e.key === "Escape" && i(String(t));
|
|
149
151
|
}, [s, t]);
|
|
150
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ L(x, {
|
|
151
153
|
type: "number",
|
|
152
154
|
variant: "compact",
|
|
153
155
|
value: r,
|
|
@@ -163,9 +165,9 @@ function le({ grid: e, page: t, totalPages: n }) {
|
|
|
163
165
|
}
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
|
-
function
|
|
168
|
+
function de(e) {
|
|
167
169
|
let { componentName: t, label: n, onClick: r, disabled: i, children: a } = e;
|
|
168
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ L(h, {
|
|
169
171
|
component: `${t}.bottomBar.pagination.button`,
|
|
170
172
|
props: {
|
|
171
173
|
"aria-label": n,
|
|
@@ -178,15 +180,15 @@ function R(e) {
|
|
|
178
180
|
opacity: i ? .3 : .7,
|
|
179
181
|
hover: i ? void 0 : {
|
|
180
182
|
opacity: 1,
|
|
181
|
-
bgColor: "
|
|
183
|
+
bgColor: "base-100"
|
|
182
184
|
},
|
|
183
|
-
theme: { dark: { hover: i ? void 0 : { bgColor: "
|
|
185
|
+
theme: { dark: { hover: i ? void 0 : { bgColor: "base-700" } } },
|
|
184
186
|
transitionDuration: 150,
|
|
185
187
|
children: a
|
|
186
188
|
});
|
|
187
189
|
}
|
|
188
|
-
function
|
|
189
|
-
return /* @__PURE__ */
|
|
190
|
+
function fe(e) {
|
|
191
|
+
return /* @__PURE__ */ L(m, {
|
|
190
192
|
viewBox: "0 0 24 24",
|
|
191
193
|
width: "14",
|
|
192
194
|
height: "14",
|
|
@@ -195,70 +197,70 @@ function ue(e) {
|
|
|
195
197
|
strokeWidth: 2,
|
|
196
198
|
strokeLinecap: "round",
|
|
197
199
|
strokeLinejoin: "round",
|
|
198
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ L(p, { d: e.d })
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
|
-
function de() {
|
|
202
|
-
return /* @__PURE__ */ I(ue, { d: "M15 18l-6-6 6-6" });
|
|
203
|
-
}
|
|
204
|
-
function fe() {
|
|
205
|
-
return /* @__PURE__ */ I(ue, { d: "M9 18l6-6-6-6" });
|
|
206
|
-
}
|
|
207
203
|
function pe() {
|
|
208
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ L(fe, { d: "M15 18l-6-6 6-6" });
|
|
209
205
|
}
|
|
210
206
|
function me() {
|
|
211
|
-
return /* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ L(fe, { d: "M9 18l6-6-6-6" });
|
|
208
|
+
}
|
|
209
|
+
function he() {
|
|
210
|
+
return /* @__PURE__ */ L(fe, { d: "M18 18l-6-6 6-6M11 18l-6-6 6-6" });
|
|
211
|
+
}
|
|
212
|
+
function ge() {
|
|
213
|
+
return /* @__PURE__ */ L(fe, { d: "M6 18l6-6-6-6M13 18l6-6-6-6" });
|
|
212
214
|
}
|
|
213
215
|
//#endregion
|
|
214
216
|
//#region src/components/dataGrid/components/dataGridBottomBar.tsx
|
|
215
|
-
function
|
|
217
|
+
function _e(e) {
|
|
216
218
|
let { grid: t } = e, { pagination: n, filter: r } = t;
|
|
217
219
|
if (n.state) {
|
|
218
|
-
let { totalItems: e, startItem: r, endItem:
|
|
219
|
-
return /* @__PURE__ */
|
|
220
|
+
let { totalItems: e, startItem: r, endItem: i } = n;
|
|
221
|
+
return /* @__PURE__ */ R(_, {
|
|
220
222
|
component: `${t.componentName}.bottomBar`,
|
|
221
223
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ L(a, {
|
|
223
225
|
component: `${t.componentName}.bottomBar.info`,
|
|
224
|
-
children: t.localeText.pageRowRange(r,
|
|
226
|
+
children: t.localeText.pageRowRange(r, i, e)
|
|
225
227
|
}),
|
|
226
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
+
t.props.def.rowSelection && /* @__PURE__ */ L(se, { grid: t }),
|
|
229
|
+
/* @__PURE__ */ L(ce, { grid: t })
|
|
228
230
|
]
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
|
-
let { filtered:
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
+
let { filtered: i, total: o } = r.filterStats;
|
|
234
|
+
return /* @__PURE__ */ R(_, {
|
|
233
235
|
component: `${t.componentName}.bottomBar`,
|
|
234
236
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ L(a, {
|
|
236
238
|
component: `${t.componentName}.bottomBar.info`,
|
|
237
|
-
children: t.localeText.rowCount(
|
|
239
|
+
children: t.localeText.rowCount(i, o)
|
|
238
240
|
}),
|
|
239
|
-
r.hasActiveFilters && /* @__PURE__ */
|
|
241
|
+
r.hasActiveFilters && /* @__PURE__ */ R(h, {
|
|
240
242
|
type: "button",
|
|
241
243
|
component: `${t.componentName}.bottomBar.clearFilters`,
|
|
242
244
|
onClick: r.clearAllFilters,
|
|
243
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ L(a, {
|
|
244
246
|
tag: "span",
|
|
245
247
|
props: { "aria-hidden": !0 },
|
|
246
248
|
children: "✕"
|
|
247
249
|
}), t.localeText.clearFilters]
|
|
248
250
|
}),
|
|
249
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
251
|
+
t.props.def.rowSelection && /* @__PURE__ */ L(se, { grid: t })
|
|
250
252
|
]
|
|
251
253
|
});
|
|
252
254
|
}
|
|
253
255
|
//#endregion
|
|
254
256
|
//#region src/components/dataGrid/gridNavigationContext.ts
|
|
255
|
-
var
|
|
257
|
+
var ve = O(null);
|
|
256
258
|
function z() {
|
|
257
|
-
return
|
|
259
|
+
return M(ve);
|
|
258
260
|
}
|
|
259
|
-
var
|
|
260
|
-
function
|
|
261
|
-
let r =
|
|
261
|
+
var ye = () => () => {};
|
|
262
|
+
function be(e, t, n) {
|
|
263
|
+
let r = ae(e?.activeCell.subscribe ?? ye, () => !!e?.activeCell.isActive(t, n), () => !!e?.activeCell.isActive(t, n));
|
|
262
264
|
return e ? {
|
|
263
265
|
...e.cellProps(t, n),
|
|
264
266
|
tabIndex: r ? 0 : -1
|
|
@@ -266,7 +268,7 @@ function ve(e, t, n) {
|
|
|
266
268
|
}
|
|
267
269
|
//#endregion
|
|
268
270
|
//#region src/components/dataGrid/models/viewportModel.ts
|
|
269
|
-
var
|
|
271
|
+
var xe = class e {
|
|
270
272
|
grid;
|
|
271
273
|
static DEFAULT_VISIBLE_ROWS_COUNT = 10;
|
|
272
274
|
static ROWS_AHEAD = 12;
|
|
@@ -319,7 +321,7 @@ var ye = class e {
|
|
|
319
321
|
totalHeight: this.totalHeight,
|
|
320
322
|
viewHeight: void 0
|
|
321
323
|
};
|
|
322
|
-
let { rowHeight: i } = this.grid, { ROWS_AHEAD: a, ROWS_BEHIND: o, PARTIAL_ROWS: s } = e, c = n === "down" ? o : a, { offsets: l } = this.grid.rowOffsets.value, u = this.hasDetailRows ?
|
|
324
|
+
let { rowHeight: i } = this.grid, { ROWS_AHEAD: a, ROWS_BEHIND: o, PARTIAL_ROWS: s } = e, c = n === "down" ? o : a, { offsets: l } = this.grid.rowOffsets.value, u = this.hasDetailRows ? S(l, t) : Math.floor(t / i), d = Math.max(0, u - c), f = this.hasDetailRows ? l[d] ?? 0 : d * i;
|
|
323
325
|
return {
|
|
324
326
|
startIndex: d,
|
|
325
327
|
take: this.visibleRowsCount + s + o + a,
|
|
@@ -328,7 +330,7 @@ var ye = class e {
|
|
|
328
330
|
viewHeight: this.viewHeight
|
|
329
331
|
};
|
|
330
332
|
}
|
|
331
|
-
},
|
|
333
|
+
}, Se = class {
|
|
332
334
|
row;
|
|
333
335
|
column;
|
|
334
336
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -342,23 +344,23 @@ var ye = class e {
|
|
|
342
344
|
set(e, t) {
|
|
343
345
|
(e !== this.row || t !== this.column) && (this.row = e, this.column = t, this.listeners.forEach((e) => e()));
|
|
344
346
|
}
|
|
345
|
-
},
|
|
346
|
-
function
|
|
347
|
-
return
|
|
347
|
+
}, Ce, we;
|
|
348
|
+
function Te() {
|
|
349
|
+
return we ??= import("../dataGridDateParts.mjs").then((e) => Ce = e.default), we;
|
|
348
350
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
351
|
+
function Ee() {
|
|
352
|
+
return Ce;
|
|
351
353
|
}
|
|
352
|
-
function
|
|
353
|
-
let [t, n] =
|
|
354
|
+
function De(e) {
|
|
355
|
+
let [t, n] = F(void 0);
|
|
354
356
|
return r(() => {
|
|
355
357
|
if (!e || t) return;
|
|
356
|
-
if (
|
|
357
|
-
n(() =>
|
|
358
|
+
if (Ce) {
|
|
359
|
+
n(() => Ce);
|
|
358
360
|
return;
|
|
359
361
|
}
|
|
360
362
|
let r = !0;
|
|
361
|
-
return
|
|
363
|
+
return Te().then((e) => r && n(() => e)), () => {
|
|
362
364
|
r = !1;
|
|
363
365
|
};
|
|
364
366
|
}, [e, t]), t;
|
|
@@ -368,35 +370,39 @@ function Te(e) {
|
|
|
368
370
|
function B(e, t) {
|
|
369
371
|
return JSON.stringify([e, t]);
|
|
370
372
|
}
|
|
371
|
-
var
|
|
372
|
-
function
|
|
373
|
-
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : e instanceof Date ? "datetime" : typeof e == "string" ?
|
|
373
|
+
var Oe = 1e3;
|
|
374
|
+
function ke(e) {
|
|
375
|
+
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : e instanceof Date ? "datetime" : typeof e == "string" ? je.test(e) ? "date" : Me.test(e) ? "time" : Ne.test(e) ? "datetime" : "text" : "text";
|
|
374
376
|
}
|
|
375
|
-
var
|
|
377
|
+
var Ae = /* @__PURE__ */ new Set([
|
|
376
378
|
"date",
|
|
377
379
|
"time",
|
|
378
380
|
"datetime"
|
|
379
|
-
]),
|
|
380
|
-
function
|
|
381
|
-
return
|
|
381
|
+
]), je = /^\d{4}-\d{2}-\d{2}$/, Me = /^\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/, Ne = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
382
|
+
function Pe(e) {
|
|
383
|
+
return Ae.has(e);
|
|
382
384
|
}
|
|
383
|
-
function
|
|
385
|
+
function Fe(e, t) {
|
|
384
386
|
if (e === "text") return t;
|
|
385
387
|
if (e !== "number" || t.trim() === "") return;
|
|
386
388
|
let n = Number(t);
|
|
387
389
|
return Number.isFinite(n) ? n : void 0;
|
|
388
390
|
}
|
|
389
|
-
var
|
|
391
|
+
var Ie = [
|
|
392
|
+
"value",
|
|
393
|
+
"oldValue",
|
|
394
|
+
"error"
|
|
395
|
+
], Le = /* @__PURE__ */ new Set([
|
|
390
396
|
"true",
|
|
391
397
|
"1",
|
|
392
398
|
"yes"
|
|
393
|
-
]),
|
|
399
|
+
]), Re = /* @__PURE__ */ new Set([
|
|
394
400
|
"false",
|
|
395
401
|
"0",
|
|
396
402
|
"no",
|
|
397
403
|
""
|
|
398
404
|
]);
|
|
399
|
-
function
|
|
405
|
+
function ze(e, t, n) {
|
|
400
406
|
if (e.type === "number") {
|
|
401
407
|
if (n.trim() === "") return { value: null };
|
|
402
408
|
let e = Number(n);
|
|
@@ -404,17 +410,17 @@ function Ie(e, t, n) {
|
|
|
404
410
|
}
|
|
405
411
|
if (e.type === "checkbox") {
|
|
406
412
|
let e = n.trim().toLowerCase();
|
|
407
|
-
return
|
|
413
|
+
return Le.has(e) ? { value: !0 } : Re.has(e) ? { value: !1 } : void 0;
|
|
408
414
|
}
|
|
409
|
-
if (
|
|
415
|
+
if (Pe(e.type)) {
|
|
410
416
|
if (n.trim() === "") return { value: null };
|
|
411
|
-
let t =
|
|
417
|
+
let t = Ee();
|
|
412
418
|
if (t) {
|
|
413
419
|
let r = t.parsePasted(e, n);
|
|
414
420
|
return r ? { value: r } : void 0;
|
|
415
421
|
}
|
|
416
422
|
let r = n.trim();
|
|
417
|
-
return (e.type === "date" ?
|
|
423
|
+
return (e.type === "date" ? je : e.type === "time" ? Me : Ne).test(r) ? { value: r } : void 0;
|
|
418
424
|
}
|
|
419
425
|
if (e.type === "select") {
|
|
420
426
|
let e = t.find((e) => String(e.value) === n);
|
|
@@ -422,10 +428,10 @@ function Ie(e, t, n) {
|
|
|
422
428
|
}
|
|
423
429
|
return { value: n };
|
|
424
430
|
}
|
|
425
|
-
function
|
|
431
|
+
function Be(e) {
|
|
426
432
|
return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
427
433
|
}
|
|
428
|
-
var
|
|
434
|
+
var Ve = class {
|
|
429
435
|
grid;
|
|
430
436
|
constructor(e) {
|
|
431
437
|
this.grid = e;
|
|
@@ -450,7 +456,7 @@ var Re = class {
|
|
|
450
456
|
}
|
|
451
457
|
editorFor(e, t) {
|
|
452
458
|
let { editor: n } = e.def;
|
|
453
|
-
return typeof n == "object" ? n : n ? { type: n } : { type:
|
|
459
|
+
return typeof n == "object" ? n : n ? { type: n } : { type: ke(t) };
|
|
454
460
|
}
|
|
455
461
|
isEditing(e, t) {
|
|
456
462
|
return this._active?.rowKey === e && this._active.columnKey === t;
|
|
@@ -475,7 +481,7 @@ var Re = class {
|
|
|
475
481
|
return !!this._active?.pending;
|
|
476
482
|
}
|
|
477
483
|
begin(e, t, n, r) {
|
|
478
|
-
let i = r === void 0 ? void 0 :
|
|
484
|
+
let i = r === void 0 ? void 0 : Fe(this.editorFor(t, n).type, r);
|
|
479
485
|
this.rejected.delete(B(e.key, t.key)), this._active = {
|
|
480
486
|
row: e,
|
|
481
487
|
rowKey: e.key,
|
|
@@ -484,7 +490,10 @@ var Re = class {
|
|
|
484
490
|
token: ++this._token,
|
|
485
491
|
drafts: 0,
|
|
486
492
|
pending: !1
|
|
487
|
-
}, this.grid.notify()
|
|
493
|
+
}, this.grid.notify(), this.grid.reportInteraction("cellEditStart", n, r === void 0 ? "open" : "typing", {
|
|
494
|
+
rowKey: e.key,
|
|
495
|
+
columnKey: t.key
|
|
496
|
+
}, ["value"]);
|
|
488
497
|
}
|
|
489
498
|
beginAt(e, t, n) {
|
|
490
499
|
let r = this.grid.flatRows.value[e], i = this.grid.columns.value.visibleLeafs[t];
|
|
@@ -534,10 +543,19 @@ var Re = class {
|
|
|
534
543
|
...this._active,
|
|
535
544
|
pending: !1,
|
|
536
545
|
error: typeof n == "string" ? n : this.invalidValue
|
|
537
|
-
}, this.grid.notify()
|
|
546
|
+
}, this.grid.notify(), this.grid.reportInteraction("cellEditReject", t.value, "invalid", {
|
|
547
|
+
rowKey: t.rowKey,
|
|
548
|
+
columnKey: t.columnKey,
|
|
549
|
+
oldValue: t.oldValue,
|
|
550
|
+
error: this._active.error
|
|
551
|
+
}, Ie);
|
|
538
552
|
return;
|
|
539
553
|
}
|
|
540
|
-
this.values.set(B(t.rowKey, t.columnKey), t.value), this._edits = [...this._edits, t], this._active = void 0, this.grid.notify(), this.grid.props.onCellEditsChange?.(this._edits, { reason: "edit" })
|
|
554
|
+
this.values.set(B(t.rowKey, t.columnKey), t.value), this._edits = [...this._edits, t], this._active = void 0, this.grid.notify(), this.grid.props.onCellEditsChange?.(this._edits, { reason: "edit" }), this.grid.reportInteraction("cellEdit", t.value, "edit", {
|
|
555
|
+
rowKey: t.rowKey,
|
|
556
|
+
columnKey: t.columnKey,
|
|
557
|
+
oldValue: t.oldValue
|
|
558
|
+
}, Ie);
|
|
541
559
|
}
|
|
542
560
|
}
|
|
543
561
|
valueOf(e, t, n) {
|
|
@@ -561,7 +579,7 @@ var Re = class {
|
|
|
561
579
|
c++;
|
|
562
580
|
continue;
|
|
563
581
|
}
|
|
564
|
-
let f = this.valueOf(l.key, u.key, l.data[u.key]), p =
|
|
582
|
+
let f = this.valueOf(l.key, u.key, l.data[u.key]), p = ze(this.editorFor(u, f), this.optionsFor(u, l), d), m = {
|
|
565
583
|
rowKey: l.key,
|
|
566
584
|
columnKey: u.key,
|
|
567
585
|
row: l.data,
|
|
@@ -594,16 +612,34 @@ var Re = class {
|
|
|
594
612
|
return;
|
|
595
613
|
}
|
|
596
614
|
Object.is(e.value, e.oldValue) || (this.values.set(B(e.rowKey, e.columnKey), e.value), a.push(e));
|
|
597
|
-
}), a.length > 0 && (this._edits = [...this._edits, ...a]), this.grid.notify(), a.length > 0 && this.grid.props.onCellEditsChange?.(this._edits, { reason: "paste" })
|
|
598
|
-
|
|
615
|
+
}), a.length > 0 && (this._edits = [...this._edits, ...a]), this.grid.notify(), a.length > 0 && this.grid.props.onCellEditsChange?.(this._edits, { reason: "paste" });
|
|
616
|
+
let s = this.grid.range.rangeOf(t);
|
|
617
|
+
this.grid.props.onPaste?.({
|
|
618
|
+
range: s,
|
|
599
619
|
applied: a,
|
|
600
620
|
rejected: o,
|
|
601
621
|
skipped: i
|
|
602
622
|
});
|
|
623
|
+
let c = a.map(({ rowKey: e, columnKey: t, value: n, oldValue: r }) => ({
|
|
624
|
+
rowKey: e,
|
|
625
|
+
columnKey: t,
|
|
626
|
+
value: n,
|
|
627
|
+
oldValue: r
|
|
628
|
+
})), { startRow: l, endRow: u, columns: d } = s;
|
|
629
|
+
this.grid.reportInteraction("paste", a.length, "paste", {
|
|
630
|
+
range: {
|
|
631
|
+
startRow: l,
|
|
632
|
+
endRow: u,
|
|
633
|
+
columns: d
|
|
634
|
+
},
|
|
635
|
+
rejected: o.length,
|
|
636
|
+
skipped: i,
|
|
637
|
+
cells: c
|
|
638
|
+
}, ["cells"]);
|
|
603
639
|
}
|
|
604
640
|
nextEditable(e, t, n = !1) {
|
|
605
|
-
let r = this.grid.flatRows.value, i = this.grid.columns.value.visibleLeafs, a = n ? -1 : 1, o = e * i.length + t + a, s = Math.min(r.length * i.length - 1, o +
|
|
606
|
-
for (let e = o; e >= Math.max(0, o -
|
|
641
|
+
let r = this.grid.flatRows.value, i = this.grid.columns.value.visibleLeafs, a = n ? -1 : 1, o = e * i.length + t + a, s = Math.min(r.length * i.length - 1, o + Oe);
|
|
642
|
+
for (let e = o; e >= Math.max(0, o - Oe) && e <= s; e += a) {
|
|
607
643
|
let t = Math.floor(e / i.length), n = e % i.length, a = r[t], o = i[n];
|
|
608
644
|
if (!(!o || a?.kind !== "row" || !this.isEditable(a, o))) return {
|
|
609
645
|
row: t,
|
|
@@ -676,7 +712,12 @@ var Re = class {
|
|
|
676
712
|
this.grid.edits.commit();
|
|
677
713
|
};
|
|
678
714
|
cancelEdit = () => {
|
|
679
|
-
this.grid.edits.
|
|
715
|
+
if (!this.grid.edits.isOpen) return;
|
|
716
|
+
let { draft: e } = this.grid.edits;
|
|
717
|
+
this.grid.edits.cancel(), this.grid.reportInteraction("cellEditCancel", e, "cancel", {
|
|
718
|
+
rowKey: this.row.key,
|
|
719
|
+
columnKey: this.column.key
|
|
720
|
+
}, ["value"]);
|
|
680
721
|
};
|
|
681
722
|
}, H = class e {
|
|
682
723
|
grid;
|
|
@@ -777,42 +818,42 @@ function W(e) {
|
|
|
777
818
|
}
|
|
778
819
|
//#endregion
|
|
779
820
|
//#region src/components/dataGrid/useGridNavigation.ts
|
|
780
|
-
var
|
|
781
|
-
function
|
|
782
|
-
let { grid: t, scrollerRef: n, scroll: i, onScrollTo: a } = e, o = t.headerRows.value,
|
|
821
|
+
var He = "[role=\"gridcell\"],[role=\"columnheader\"]", Ue = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]", We = 2, Ge = [];
|
|
822
|
+
function Ke(e) {
|
|
823
|
+
let { grid: t, scrollerRef: n, scroll: i, onScrollTo: a } = e, o = t.headerRows.value, s = t.filter.hasFilterableColumns, l = o.length + +!!s, d = t.viewport.isEmpty ? Ge : t.flatRows.value, f = t.columns.value.visibleLeafs.length, p = t.aggregation.hasFooter && !t.viewport.isEmpty ? 1 : 0, m = l + d.length + p, h = j((e) => {
|
|
783
824
|
if (e < o.length) return o[e]?.length ?? 0;
|
|
784
|
-
if (e <
|
|
785
|
-
let t = d[e -
|
|
825
|
+
if (e < l || e >= l + d.length) return f;
|
|
826
|
+
let t = d[e - l];
|
|
786
827
|
return t ? t.cellCount : 0;
|
|
787
828
|
}, [
|
|
788
829
|
d,
|
|
789
830
|
f,
|
|
790
|
-
|
|
831
|
+
l,
|
|
791
832
|
o
|
|
792
|
-
]), g =
|
|
833
|
+
]), g = j((e, t) => e < o.length ? (o[e]?.[t]?.headerCell.columnIndex ?? t + 1) - 1 : e < l ? t : d[e - l]?.columnOf(t) ?? t, [
|
|
793
834
|
d,
|
|
794
|
-
|
|
835
|
+
l,
|
|
795
836
|
o
|
|
796
|
-
]), _ =
|
|
797
|
-
let { viewport: o } = t, s = e -
|
|
837
|
+
]), _ = P(!1), v = j((e, r) => {
|
|
838
|
+
let { viewport: o } = t, s = e - l, c = n.current;
|
|
798
839
|
if (o.showAll || !c || s >= d.length) return;
|
|
799
840
|
if (s < 0) {
|
|
800
|
-
r >=
|
|
841
|
+
r >= l && (c.scrollTop = 0, a(0));
|
|
801
842
|
return;
|
|
802
843
|
}
|
|
803
|
-
let { startIndex:
|
|
804
|
-
if (s >=
|
|
844
|
+
let { startIndex: u, take: f } = o.window(i.top, i.direction);
|
|
845
|
+
if (s >= u + We && s < u + f - We) return;
|
|
805
846
|
let p = o.rowTop(s);
|
|
806
847
|
c.scrollTop = p, a(p);
|
|
807
848
|
}, [
|
|
808
849
|
d.length,
|
|
809
850
|
t,
|
|
810
|
-
|
|
851
|
+
l,
|
|
811
852
|
a,
|
|
812
853
|
i,
|
|
813
854
|
n
|
|
814
|
-
]), y =
|
|
815
|
-
let i = e -
|
|
855
|
+
]), y = P(0), b = j((e, n, r) => {
|
|
856
|
+
let i = e - l;
|
|
816
857
|
if (i < 0 || i >= d.length) {
|
|
817
858
|
t.range.clear();
|
|
818
859
|
return;
|
|
@@ -826,8 +867,8 @@ function Ue(e) {
|
|
|
826
867
|
d.length,
|
|
827
868
|
g,
|
|
828
869
|
t,
|
|
829
|
-
|
|
830
|
-
]), x =
|
|
870
|
+
l
|
|
871
|
+
]), x = u({
|
|
831
872
|
count: m,
|
|
832
873
|
columns: h,
|
|
833
874
|
columnIndexOf: g,
|
|
@@ -840,23 +881,23 @@ function Ue(e) {
|
|
|
840
881
|
r(() => {
|
|
841
882
|
_.current && (_.current = !1, S()?.focus());
|
|
842
883
|
});
|
|
843
|
-
let C =
|
|
884
|
+
let C = j((e, n, r) => {
|
|
844
885
|
if (!t.tree.enabled || e.key !== "ArrowRight" && e.key !== "ArrowLeft") return !1;
|
|
845
|
-
let i = d[n -
|
|
886
|
+
let i = d[n - l];
|
|
846
887
|
if (!W(i) || t.columns.value.visibleLeafs[r]?.key !== t.tree.columnKey) return !1;
|
|
847
888
|
if (e.key === (t.isRtl ? "ArrowLeft" : "ArrowRight")) return !i.hasChildren || i.treeExpanded ? !1 : (i.toggleTree(), !0);
|
|
848
889
|
if (i.hasChildren && i.treeExpanded) return i.toggleTree(), !0;
|
|
849
|
-
for (let e = n - 1; e >=
|
|
850
|
-
let t = d[e -
|
|
890
|
+
for (let e = n - 1; e >= l; e--) {
|
|
891
|
+
let t = d[e - l];
|
|
851
892
|
if (!(!W(t) || t.level >= i.level)) return x.setActiveCell(e, r, { reason: "keyboard" }), !0;
|
|
852
893
|
}
|
|
853
894
|
return !1;
|
|
854
895
|
}, [
|
|
855
896
|
d,
|
|
856
897
|
t,
|
|
857
|
-
|
|
898
|
+
l,
|
|
858
899
|
x
|
|
859
|
-
]), w =
|
|
900
|
+
]), w = j((e) => {
|
|
860
901
|
let { activeIndex: t, activeColumn: n } = x, r = e ? -1 : 1, i = n + r;
|
|
861
902
|
if (i >= 0 && i < h(t)) return x.setActiveCell(t, i, { reason: "keyboard" }), !0;
|
|
862
903
|
let a = t + r;
|
|
@@ -865,29 +906,29 @@ function Ue(e) {
|
|
|
865
906
|
h,
|
|
866
907
|
x,
|
|
867
908
|
m
|
|
868
|
-
]), T =
|
|
909
|
+
]), T = j((e, n) => {
|
|
869
910
|
if (!t.props.def.rowSelection) return !1;
|
|
870
|
-
if (e <
|
|
871
|
-
let r = t.flatRows.value[e -
|
|
911
|
+
if (e < l) return e >= o.length || !t.columns.value.visibleLeafs[n]?.isRowSelection ? !1 : (t.toggleSelectAllRows(), !0);
|
|
912
|
+
let r = t.flatRows.value[e - l];
|
|
872
913
|
return r instanceof U && (r.toggleSelection(), !0);
|
|
873
914
|
}, [
|
|
874
915
|
t,
|
|
875
|
-
|
|
916
|
+
l,
|
|
876
917
|
o.length
|
|
877
|
-
]),
|
|
878
|
-
let r = Array.from(e.querySelectorAll(
|
|
918
|
+
]), E = j((e, t, n) => {
|
|
919
|
+
let r = Array.from(e.querySelectorAll(Ue));
|
|
879
920
|
if (r.length < 2) return !1;
|
|
880
921
|
let i = r.indexOf(t);
|
|
881
922
|
return i !== -1 && (r[(i + (n ? -1 : 1) + r.length) % r.length].focus(), !0);
|
|
882
|
-
}, []),
|
|
883
|
-
let n = e.target, r = n.closest?.(
|
|
923
|
+
}, []), ee = x.onKeyDown, D = j((e) => {
|
|
924
|
+
let n = e.target, r = n.closest?.(He);
|
|
884
925
|
if (r) {
|
|
885
926
|
if (n !== r) {
|
|
886
927
|
if (e.key === "Escape" && !r.querySelector("[aria-expanded=\"true\"]")) {
|
|
887
928
|
e.preventDefault(), r.focus();
|
|
888
929
|
return;
|
|
889
930
|
}
|
|
890
|
-
e.key === "Tab" &&
|
|
931
|
+
e.key === "Tab" && E(r, n, e.shiftKey) && e.preventDefault();
|
|
891
932
|
return;
|
|
892
933
|
}
|
|
893
934
|
if (e.key === "Tab" && t.props.def.tabNavigation === "cells") {
|
|
@@ -904,17 +945,17 @@ function Ue(e) {
|
|
|
904
945
|
e.preventDefault(), n.sortColumn();
|
|
905
946
|
return;
|
|
906
947
|
}
|
|
907
|
-
if (t.edits.beginAt(x.activeIndex -
|
|
948
|
+
if (t.edits.beginAt(x.activeIndex - l, x.activeColumn)) {
|
|
908
949
|
e.preventDefault();
|
|
909
950
|
return;
|
|
910
951
|
}
|
|
911
|
-
let i = r.querySelector(
|
|
952
|
+
let i = r.querySelector(Ue);
|
|
912
953
|
if (i) {
|
|
913
954
|
e.preventDefault(), i.focus();
|
|
914
955
|
return;
|
|
915
956
|
}
|
|
916
957
|
}
|
|
917
|
-
if (t.edits.enabled &&
|
|
958
|
+
if (t.edits.enabled && Be(e) && t.edits.beginAt(x.activeIndex - l, x.activeColumn, e.key)) {
|
|
918
959
|
e.preventDefault();
|
|
919
960
|
return;
|
|
920
961
|
}
|
|
@@ -922,26 +963,26 @@ function Ue(e) {
|
|
|
922
963
|
e.preventDefault();
|
|
923
964
|
return;
|
|
924
965
|
}
|
|
925
|
-
|
|
966
|
+
ee(e);
|
|
926
967
|
}
|
|
927
968
|
}, [
|
|
928
969
|
t,
|
|
929
|
-
|
|
970
|
+
l,
|
|
930
971
|
o,
|
|
931
972
|
x.activeColumn,
|
|
932
973
|
x.activeIndex,
|
|
933
|
-
te,
|
|
934
|
-
w,
|
|
935
974
|
ee,
|
|
975
|
+
w,
|
|
976
|
+
E,
|
|
936
977
|
T,
|
|
937
978
|
C
|
|
938
|
-
]), { setActiveCell:
|
|
939
|
-
r(() =>
|
|
940
|
-
|
|
979
|
+
]), { setActiveCell: te, activeIndex: O, activeColumn: k } = x, A = c(x.cellProps), [M] = F(() => new Se(O, k));
|
|
980
|
+
r(() => M.set(O, k), [
|
|
981
|
+
M,
|
|
941
982
|
k,
|
|
942
|
-
|
|
983
|
+
O
|
|
943
984
|
]);
|
|
944
|
-
let
|
|
985
|
+
let N = j((e, t) => {
|
|
945
986
|
let { ref: n, onFocus: r } = A.current(e, t);
|
|
946
987
|
return {
|
|
947
988
|
ref: n,
|
|
@@ -949,27 +990,27 @@ function Ue(e) {
|
|
|
949
990
|
};
|
|
950
991
|
}, [A]);
|
|
951
992
|
return {
|
|
952
|
-
navigation:
|
|
993
|
+
navigation: ie(() => ({
|
|
953
994
|
rowCount: m,
|
|
954
995
|
columnCount: f,
|
|
955
|
-
headerRowCount:
|
|
956
|
-
cellProps:
|
|
957
|
-
activeCell:
|
|
958
|
-
setActiveCell:
|
|
996
|
+
headerRowCount: l,
|
|
997
|
+
cellProps: N,
|
|
998
|
+
activeCell: M,
|
|
999
|
+
setActiveCell: te
|
|
959
1000
|
}), [
|
|
960
|
-
|
|
961
|
-
|
|
1001
|
+
M,
|
|
1002
|
+
N,
|
|
962
1003
|
f,
|
|
963
|
-
|
|
1004
|
+
l,
|
|
964
1005
|
m,
|
|
965
|
-
|
|
1006
|
+
te
|
|
966
1007
|
]),
|
|
967
|
-
onKeyDown:
|
|
1008
|
+
onKeyDown: D
|
|
968
1009
|
};
|
|
969
1010
|
}
|
|
970
1011
|
//#endregion
|
|
971
1012
|
//#region src/utils/array/arrayUtils.ts
|
|
972
|
-
var
|
|
1013
|
+
var qe;
|
|
973
1014
|
(function(e) {
|
|
974
1015
|
function t(e, t, n = 0) {
|
|
975
1016
|
return e.slice(n, n + t);
|
|
@@ -1016,11 +1057,11 @@ var We;
|
|
|
1016
1057
|
}));
|
|
1017
1058
|
}
|
|
1018
1059
|
e.groupBy = s;
|
|
1019
|
-
})(
|
|
1020
|
-
var G =
|
|
1060
|
+
})(qe ||= {});
|
|
1061
|
+
var G = qe, Je = "row-number-cell", Ye = "row-selection-cell", K = "grouping-cell", Xe = "row-detail-cell", Ze = Symbol("memo.unset"), Qe = class {
|
|
1021
1062
|
action;
|
|
1022
1063
|
deps;
|
|
1023
|
-
cache =
|
|
1064
|
+
cache = Ze;
|
|
1024
1065
|
dependents = /* @__PURE__ */ new Set();
|
|
1025
1066
|
wired = !1;
|
|
1026
1067
|
constructor(e, t) {
|
|
@@ -1033,46 +1074,46 @@ var G = We, Ge = "row-number-cell", Ke = "row-selection-cell", K = "grouping-cel
|
|
|
1033
1074
|
}
|
|
1034
1075
|
}
|
|
1035
1076
|
get value() {
|
|
1036
|
-
return this.wire(), this.cache ===
|
|
1077
|
+
return this.wire(), this.cache === Ze && (this.cache = this.action()), this.cache;
|
|
1037
1078
|
}
|
|
1038
1079
|
clear() {
|
|
1039
|
-
if (this.wire(), this.cache !==
|
|
1040
|
-
this.cache =
|
|
1080
|
+
if (this.wire(), this.cache !== Ze) {
|
|
1081
|
+
this.cache = Ze;
|
|
1041
1082
|
for (let e of this.dependents) e.clear();
|
|
1042
1083
|
}
|
|
1043
1084
|
}
|
|
1044
1085
|
};
|
|
1045
1086
|
function q(e, t = () => []) {
|
|
1046
|
-
return new
|
|
1087
|
+
return new Qe(e, t);
|
|
1047
1088
|
}
|
|
1048
1089
|
//#endregion
|
|
1049
1090
|
//#region src/components/dataGrid/models/aggregationModel.ts
|
|
1050
|
-
function
|
|
1091
|
+
function $e(e) {
|
|
1051
1092
|
return e.filter((e) => typeof e == "number" && !Number.isNaN(e));
|
|
1052
1093
|
}
|
|
1053
|
-
var
|
|
1094
|
+
var et = (e) => e.reduce((e, t) => e + t, 0), tt = (e, t) => e.reduce((e, n) => (t ? n < e : n > e) ? n : e), nt = {
|
|
1054
1095
|
sum: (e) => {
|
|
1055
|
-
let t =
|
|
1056
|
-
return t.length ?
|
|
1096
|
+
let t = $e(e);
|
|
1097
|
+
return t.length ? et(t) : null;
|
|
1057
1098
|
},
|
|
1058
1099
|
avg: (e) => {
|
|
1059
|
-
let t =
|
|
1060
|
-
return t.length ? Math.round(
|
|
1100
|
+
let t = $e(e);
|
|
1101
|
+
return t.length ? Math.round(et(t) / t.length * 100) / 100 : null;
|
|
1061
1102
|
},
|
|
1062
1103
|
min: (e) => {
|
|
1063
|
-
let t =
|
|
1064
|
-
return t.length ?
|
|
1104
|
+
let t = $e(e);
|
|
1105
|
+
return t.length ? tt(t, !0) : null;
|
|
1065
1106
|
},
|
|
1066
1107
|
max: (e) => {
|
|
1067
|
-
let t =
|
|
1068
|
-
return t.length ?
|
|
1108
|
+
let t = $e(e);
|
|
1109
|
+
return t.length ? tt(t, !1) : null;
|
|
1069
1110
|
},
|
|
1070
1111
|
count: (e, t) => t.length
|
|
1071
1112
|
};
|
|
1072
|
-
function
|
|
1073
|
-
return typeof e == "function" ? e(t, n) :
|
|
1113
|
+
function rt(e, t, n) {
|
|
1114
|
+
return typeof e == "function" ? e(t, n) : nt[e]?.(t, n) ?? null;
|
|
1074
1115
|
}
|
|
1075
|
-
var
|
|
1116
|
+
var it = class {
|
|
1076
1117
|
grid;
|
|
1077
1118
|
constructor(e) {
|
|
1078
1119
|
this.grid = e;
|
|
@@ -1093,8 +1134,8 @@ var tt = class {
|
|
|
1093
1134
|
get footerLabelColumn() {
|
|
1094
1135
|
return this.grid.columns.value.visibleLeafs.find((e) => (e.isData || e.isGrouping) && !e.aggregate);
|
|
1095
1136
|
}
|
|
1096
|
-
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new
|
|
1097
|
-
},
|
|
1137
|
+
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new at(this.grid, e, this.grid.filteredData, "footer")), () => [this.grid.rows]);
|
|
1138
|
+
}, at = class {
|
|
1098
1139
|
grid;
|
|
1099
1140
|
column;
|
|
1100
1141
|
rows;
|
|
@@ -1109,7 +1150,7 @@ var tt = class {
|
|
|
1109
1150
|
}
|
|
1110
1151
|
_value = q(() => {
|
|
1111
1152
|
let e = this.column.aggregate;
|
|
1112
|
-
return e ?
|
|
1153
|
+
return e ? rt(e, this.values, this.rows) : null;
|
|
1113
1154
|
});
|
|
1114
1155
|
get value() {
|
|
1115
1156
|
let e = this.given?.();
|
|
@@ -1124,7 +1165,7 @@ var tt = class {
|
|
|
1124
1165
|
get isLast() {
|
|
1125
1166
|
return !1;
|
|
1126
1167
|
}
|
|
1127
|
-
},
|
|
1168
|
+
}, ot = class {
|
|
1128
1169
|
grid;
|
|
1129
1170
|
row;
|
|
1130
1171
|
column;
|
|
@@ -1146,7 +1187,7 @@ var tt = class {
|
|
|
1146
1187
|
get cellKind() {
|
|
1147
1188
|
return this.column.isGrouping ? "grouping" : this.column.isRowSelection ? this.row.selectable ? "selection" : "spacer" : this.row.spans(this.column) ? "hidden" : this.column.aggregate ? "aggregate" : "spacer";
|
|
1148
1189
|
}
|
|
1149
|
-
_aggregate = q(() => this.column.aggregate ? new
|
|
1190
|
+
_aggregate = q(() => this.column.aggregate ? new at(this.grid, this.column, this.row.allRows.map((e) => e.data), "group", () => this.row.aggregateValue(this.column)) : null);
|
|
1150
1191
|
get aggregate() {
|
|
1151
1192
|
return this._aggregate.value;
|
|
1152
1193
|
}
|
|
@@ -1165,7 +1206,7 @@ var tt = class {
|
|
|
1165
1206
|
get hasGroupingBorder() {
|
|
1166
1207
|
return this.row.groupingColumn.pin === "START";
|
|
1167
1208
|
}
|
|
1168
|
-
},
|
|
1209
|
+
}, st = class {
|
|
1169
1210
|
grid;
|
|
1170
1211
|
groupColumn;
|
|
1171
1212
|
rows;
|
|
@@ -1199,7 +1240,7 @@ var tt = class {
|
|
|
1199
1240
|
let e = this.grid.columns.value.visibleLeafs;
|
|
1200
1241
|
return this._cells?.leafs !== e && (this._cells = {
|
|
1201
1242
|
leafs: e,
|
|
1202
|
-
cells: e.map((e) => new
|
|
1243
|
+
cells: e.map((e) => new ot(this.grid, this, e))
|
|
1203
1244
|
}), this._cells;
|
|
1204
1245
|
}
|
|
1205
1246
|
get renderedCells() {
|
|
@@ -1257,13 +1298,13 @@ var tt = class {
|
|
|
1257
1298
|
};
|
|
1258
1299
|
//#endregion
|
|
1259
1300
|
//#region src/components/dataGrid/components/dataGridDetailRow.tsx
|
|
1260
|
-
function
|
|
1261
|
-
let { row: t, index: n } = e, { grid:
|
|
1301
|
+
function ct(e) {
|
|
1302
|
+
let { row: t, index: n } = e, { grid: i, parentRow: o } = t, s = i.props.def.rowDetail, c = z(), l = (c?.headerRowCount ?? 0) + n, { ref: u, tabIndex: d, onFocus: f } = be(c, l, 0), p = t.isAutoHeight, m = P(null);
|
|
1262
1303
|
return r(() => {
|
|
1263
|
-
|
|
1264
|
-
}), /* @__PURE__ */
|
|
1304
|
+
i.takeDetailReveal(o.key) && m.current?.scrollIntoView?.({ block: "nearest" });
|
|
1305
|
+
}), /* @__PURE__ */ L(_, {
|
|
1265
1306
|
ref: m,
|
|
1266
|
-
component: `${
|
|
1307
|
+
component: `${i.componentName}.body.detailRow`,
|
|
1267
1308
|
transition: "none",
|
|
1268
1309
|
props: {
|
|
1269
1310
|
role: "row",
|
|
@@ -1273,9 +1314,9 @@ function at(e) {
|
|
|
1273
1314
|
gridColumn: "1 / -1",
|
|
1274
1315
|
height: p ? "auto" : `${t.height}px`
|
|
1275
1316
|
},
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1317
|
+
children: /* @__PURE__ */ L(a, {
|
|
1277
1318
|
ref: u,
|
|
1278
|
-
component: `${
|
|
1319
|
+
component: `${i.componentName}.body.detailRow.content`,
|
|
1279
1320
|
position: "sticky",
|
|
1280
1321
|
insetStart: 0,
|
|
1281
1322
|
overflowX: "auto",
|
|
@@ -1288,20 +1329,20 @@ function at(e) {
|
|
|
1288
1329
|
tabIndex: d,
|
|
1289
1330
|
onFocus: f
|
|
1290
1331
|
},
|
|
1291
|
-
style: { width: `var(${
|
|
1332
|
+
style: { width: `var(${i.viewportWidthVarName})` },
|
|
1292
1333
|
children: s.content(o.data)
|
|
1293
1334
|
})
|
|
1294
1335
|
});
|
|
1295
1336
|
}
|
|
1296
|
-
|
|
1297
|
-
var
|
|
1337
|
+
ct.displayName = "DataGridDetailRow";
|
|
1338
|
+
var lt = A(ct);
|
|
1298
1339
|
//#endregion
|
|
1299
1340
|
//#region src/components/dataGrid/components/dataGridAggregateValue.tsx
|
|
1300
|
-
function
|
|
1341
|
+
function ut(e) {
|
|
1301
1342
|
let { cell: t } = e, { column: n } = t;
|
|
1302
|
-
if (n.AggregateCell) return /* @__PURE__ */
|
|
1343
|
+
if (n.AggregateCell) return /* @__PURE__ */ L(n.AggregateCell, { cell: t });
|
|
1303
1344
|
let r = t.scope === "footer" ? "footer.cell" : "body.groupRow.aggregate";
|
|
1304
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ L(a, {
|
|
1305
1346
|
component: `${n.grid.componentName}.${r}`,
|
|
1306
1347
|
px: 3,
|
|
1307
1348
|
textOverflow: "ellipsis",
|
|
@@ -1310,12 +1351,12 @@ function st(e) {
|
|
|
1310
1351
|
children: t.value
|
|
1311
1352
|
});
|
|
1312
1353
|
}
|
|
1313
|
-
|
|
1354
|
+
ut.displayName = "DataGridAggregateValue";
|
|
1314
1355
|
//#endregion
|
|
1315
1356
|
//#region src/components/dataGrid/components/dataGridCell.tsx
|
|
1316
|
-
var
|
|
1317
|
-
function J(
|
|
1318
|
-
let { children:
|
|
1357
|
+
var dt = "button,a[href],input,select,textarea";
|
|
1358
|
+
function J(t) {
|
|
1359
|
+
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = t, { column: u } = r, d = z(), { ref: f, tabIndex: p, onFocus: m } = be(d, i, a), { range: h } = u.grid, g = r instanceof V ? i - (d?.headerRowCount ?? 0) : -1, v = g >= 0 && h.isCurrent(g, a), y = g >= 0 && h.isSelected(g, a);
|
|
1319
1360
|
u.hasAlign && (l.jc = u.align);
|
|
1320
1361
|
let b = r.isExpanded ? {
|
|
1321
1362
|
...u.cellVariant.value,
|
|
@@ -1337,14 +1378,14 @@ function J(e) {
|
|
|
1337
1378
|
...b,
|
|
1338
1379
|
isInvalid: !0
|
|
1339
1380
|
});
|
|
1340
|
-
let S = r instanceof V ? (
|
|
1341
|
-
|
|
1342
|
-
} : void 0, C =
|
|
1343
|
-
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(
|
|
1344
|
-
} : void 0, T = C &&
|
|
1345
|
-
|
|
1381
|
+
let S = r instanceof V ? (t) => {
|
|
1382
|
+
t.target.closest(dt) || (e(t.currentTarget), r.beginEdit());
|
|
1383
|
+
} : void 0, C = h.enabled && g >= 0, w = C ? (e) => {
|
|
1384
|
+
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(dt) || h.press(g, a, e.shiftKey));
|
|
1385
|
+
} : void 0, T = C && h.isDragging ? (e) => {
|
|
1386
|
+
h.dragTo(g, a), e.currentTarget.focus();
|
|
1346
1387
|
} : void 0;
|
|
1347
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ L(_, {
|
|
1348
1389
|
ref: f,
|
|
1349
1390
|
component: `${u.grid.componentName}.body.cell`,
|
|
1350
1391
|
props: {
|
|
@@ -1365,31 +1406,31 @@ function J(e) {
|
|
|
1365
1406
|
...c
|
|
1366
1407
|
},
|
|
1367
1408
|
...l,
|
|
1368
|
-
children:
|
|
1409
|
+
children: n
|
|
1369
1410
|
});
|
|
1370
1411
|
}
|
|
1371
1412
|
J.displayName = "DataGridCell";
|
|
1372
1413
|
//#endregion
|
|
1373
1414
|
//#region src/components/dataGrid/components/dataGridFooter.tsx
|
|
1374
|
-
function
|
|
1415
|
+
function ft(e) {
|
|
1375
1416
|
let { grid: t } = e, { aggregation: n } = t, r = z();
|
|
1376
1417
|
if (!n.hasFooter) return null;
|
|
1377
|
-
let
|
|
1378
|
-
return /* @__PURE__ */
|
|
1418
|
+
let i = (r?.rowCount ?? 1) - 1, { footerLabelColumn: o, footerLabel: s } = n;
|
|
1419
|
+
return /* @__PURE__ */ L(C, {
|
|
1379
1420
|
component: `${t.componentName}.footer`,
|
|
1380
1421
|
props: { role: "rowgroup" },
|
|
1381
1422
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1382
|
-
children: /* @__PURE__ */
|
|
1423
|
+
children: /* @__PURE__ */ L(a, {
|
|
1383
1424
|
display: "contents",
|
|
1384
1425
|
props: {
|
|
1385
1426
|
role: "row",
|
|
1386
|
-
"aria-rowindex":
|
|
1427
|
+
"aria-rowindex": i + 1
|
|
1387
1428
|
},
|
|
1388
|
-
children: n.footerCells.value.map((e, n) => /* @__PURE__ */
|
|
1429
|
+
children: n.footerCells.value.map((e, n) => /* @__PURE__ */ L(J, {
|
|
1389
1430
|
cell: e,
|
|
1390
|
-
row:
|
|
1431
|
+
row: i,
|
|
1391
1432
|
columnIndex: n,
|
|
1392
|
-
children: e.column.aggregate ? /* @__PURE__ */
|
|
1433
|
+
children: e.column.aggregate ? /* @__PURE__ */ L(ut, { cell: e }) : e.column === o ? /* @__PURE__ */ L(a, {
|
|
1393
1434
|
component: `${t.componentName}.footer.label`,
|
|
1394
1435
|
px: 3,
|
|
1395
1436
|
textWrap: "nowrap",
|
|
@@ -1399,16 +1440,16 @@ function lt(e) {
|
|
|
1399
1440
|
})
|
|
1400
1441
|
});
|
|
1401
1442
|
}
|
|
1402
|
-
|
|
1443
|
+
ft.displayName = "DataGridFooter";
|
|
1403
1444
|
//#endregion
|
|
1404
1445
|
//#region src/icons/expandIcon.tsx
|
|
1405
1446
|
function Y(e) {
|
|
1406
|
-
return /* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ L(m, {
|
|
1407
1448
|
viewBox: "4 2 16 18",
|
|
1408
1449
|
width: "1rem",
|
|
1409
1450
|
fill: "currentColor",
|
|
1410
1451
|
...e,
|
|
1411
|
-
children: /* @__PURE__ */
|
|
1452
|
+
children: /* @__PURE__ */ L(p, {
|
|
1412
1453
|
fillRule: "evenodd",
|
|
1413
1454
|
d: "M12.707 14.707a1 1 0 0 1-1.414 0l-5-5a1 1 0 0 1 1.414-1.414L12 12.586l4.293-4.293a1 1 0 1 1 1.414 1.414l-5 5Z",
|
|
1414
1455
|
props: { clipRule: "evenodd" }
|
|
@@ -1417,32 +1458,32 @@ function Y(e) {
|
|
|
1417
1458
|
}
|
|
1418
1459
|
//#endregion
|
|
1419
1460
|
//#region src/components/dataGrid/components/dataGridCellPlaceholder.tsx
|
|
1420
|
-
var
|
|
1461
|
+
var pt = [
|
|
1421
1462
|
"3/5",
|
|
1422
1463
|
"2/5",
|
|
1423
1464
|
"4/5",
|
|
1424
1465
|
"1/2",
|
|
1425
1466
|
"7/12"
|
|
1426
1467
|
];
|
|
1427
|
-
function
|
|
1428
|
-
let { cell: t, columnIndex: n } = e, r =
|
|
1429
|
-
return /* @__PURE__ */
|
|
1468
|
+
function mt(e) {
|
|
1469
|
+
let { cell: t, columnIndex: n } = e, r = pt[(t.row.rowIndex + n) % pt.length];
|
|
1470
|
+
return /* @__PURE__ */ L(_, {
|
|
1430
1471
|
component: `${t.grid.componentName}.body.cell.placeholder`,
|
|
1431
1472
|
ai: "center",
|
|
1432
1473
|
px: 3,
|
|
1433
1474
|
props: { "aria-hidden": !0 },
|
|
1434
|
-
children: /* @__PURE__ */
|
|
1475
|
+
children: /* @__PURE__ */ L(a, {
|
|
1435
1476
|
component: `${t.grid.componentName}.body.cell.placeholder.bar`,
|
|
1436
1477
|
width: r
|
|
1437
1478
|
})
|
|
1438
1479
|
});
|
|
1439
1480
|
}
|
|
1440
|
-
|
|
1481
|
+
mt.displayName = "DataGridCellPlaceholder";
|
|
1441
1482
|
//#endregion
|
|
1442
1483
|
//#region src/components/dataGrid/components/dataGridGroupRow.tsx
|
|
1443
|
-
function
|
|
1444
|
-
let { row: t, index: n } = e, { selected: r, indeterminate:
|
|
1445
|
-
return /* @__PURE__ */
|
|
1484
|
+
function ht(e) {
|
|
1485
|
+
let { row: t, index: n } = e, { selected: r, indeterminate: i, expanded: o, placeholder: s } = t, c = (z()?.headerRowCount ?? 0) + n, l = j(() => t.toggleSelectAll(), [t]);
|
|
1486
|
+
return /* @__PURE__ */ L(_, {
|
|
1446
1487
|
component: `${t.grid.componentName}.body.groupRow`,
|
|
1447
1488
|
className: "grid-row",
|
|
1448
1489
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1455,7 +1496,7 @@ function ft(e) {
|
|
|
1455
1496
|
},
|
|
1456
1497
|
children: t.renderedCells.map(({ cell: e, columnIndex: n }, u) => {
|
|
1457
1498
|
switch (e.cellKind) {
|
|
1458
|
-
case "grouping": return /* @__PURE__ */
|
|
1499
|
+
case "grouping": return /* @__PURE__ */ L(J, {
|
|
1459
1500
|
cell: e,
|
|
1460
1501
|
row: c,
|
|
1461
1502
|
columnIndex: u,
|
|
@@ -1469,13 +1510,13 @@ function ft(e) {
|
|
|
1469
1510
|
gridColumn: e.gridColumnSpan,
|
|
1470
1511
|
ps: e.depthPadding,
|
|
1471
1512
|
overflow: "auto",
|
|
1472
|
-
children: s ? /* @__PURE__ */
|
|
1513
|
+
children: s ? /* @__PURE__ */ L(mt, {
|
|
1473
1514
|
cell: e,
|
|
1474
1515
|
columnIndex: u
|
|
1475
|
-
}) : /* @__PURE__ */
|
|
1516
|
+
}) : /* @__PURE__ */ L(a, {
|
|
1476
1517
|
textWrap: "nowrap",
|
|
1477
1518
|
px: 3,
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1519
|
+
children: /* @__PURE__ */ R(h, {
|
|
1479
1520
|
component: `${t.grid.componentName}.body.groupRow.expandButton`,
|
|
1480
1521
|
onClick: () => t.toggleRow(),
|
|
1481
1522
|
cursor: "pointer",
|
|
@@ -1486,7 +1527,7 @@ function ft(e) {
|
|
|
1486
1527
|
tabIndex: -1,
|
|
1487
1528
|
"aria-expanded": o
|
|
1488
1529
|
},
|
|
1489
|
-
children: [/* @__PURE__ */
|
|
1530
|
+
children: [/* @__PURE__ */ L(Y, {
|
|
1490
1531
|
fill: "currentColor",
|
|
1491
1532
|
width: "14px",
|
|
1492
1533
|
height: "14px",
|
|
@@ -1495,16 +1536,16 @@ function ft(e) {
|
|
|
1495
1536
|
})
|
|
1496
1537
|
})
|
|
1497
1538
|
}, e.column.key);
|
|
1498
|
-
case "selection": return /* @__PURE__ */
|
|
1539
|
+
case "selection": return /* @__PURE__ */ L(J, {
|
|
1499
1540
|
cell: e,
|
|
1500
1541
|
row: c,
|
|
1501
1542
|
columnIndex: u,
|
|
1502
1543
|
ariaColIndex: n + 1,
|
|
1503
|
-
children: /* @__PURE__ */
|
|
1544
|
+
children: /* @__PURE__ */ L(v, {
|
|
1504
1545
|
variant: "datagrid",
|
|
1505
1546
|
m: 1,
|
|
1506
1547
|
checked: r,
|
|
1507
|
-
indeterminate:
|
|
1548
|
+
indeterminate: i,
|
|
1508
1549
|
onChange: l,
|
|
1509
1550
|
props: {
|
|
1510
1551
|
tabIndex: -1,
|
|
@@ -1512,14 +1553,14 @@ function ft(e) {
|
|
|
1512
1553
|
}
|
|
1513
1554
|
})
|
|
1514
1555
|
}, e.column.key);
|
|
1515
|
-
case "aggregate": return /* @__PURE__ */
|
|
1556
|
+
case "aggregate": return /* @__PURE__ */ L(J, {
|
|
1516
1557
|
cell: e,
|
|
1517
1558
|
row: c,
|
|
1518
1559
|
columnIndex: u,
|
|
1519
1560
|
ariaColIndex: n + 1,
|
|
1520
|
-
children: e.aggregate && /* @__PURE__ */
|
|
1561
|
+
children: e.aggregate && /* @__PURE__ */ L(ut, { cell: e.aggregate })
|
|
1521
1562
|
}, e.column.key);
|
|
1522
|
-
case "spacer": return /* @__PURE__ */
|
|
1563
|
+
case "spacer": return /* @__PURE__ */ L(J, {
|
|
1523
1564
|
cell: e,
|
|
1524
1565
|
row: c,
|
|
1525
1566
|
columnIndex: u,
|
|
@@ -1532,21 +1573,21 @@ function ft(e) {
|
|
|
1532
1573
|
})
|
|
1533
1574
|
});
|
|
1534
1575
|
}
|
|
1535
|
-
|
|
1536
|
-
var
|
|
1537
|
-
function
|
|
1576
|
+
ht.displayName = "DataGridGroupRow";
|
|
1577
|
+
var gt = A(ht), _t = "input:not([type=\"hidden\"]),select,textarea,button,[role=\"spinbutton\"]";
|
|
1578
|
+
function vt(e) {
|
|
1538
1579
|
let { options: t } = e.editor;
|
|
1539
1580
|
return typeof t == "function" ? t(e.row.data) : t ?? [];
|
|
1540
1581
|
}
|
|
1541
|
-
function
|
|
1542
|
-
let { cell: t, row: n, columnIndex: i } = e, { grid: a } = t, o = z(), s =
|
|
1582
|
+
function yt(e) {
|
|
1583
|
+
let { cell: t, row: n, columnIndex: i } = e, { grid: a } = t, o = z(), s = P(null), c = d("datagrid-cell-error"), { error: l, pending: u } = t;
|
|
1543
1584
|
r(() => {
|
|
1544
|
-
let e = s.current?.querySelector(
|
|
1585
|
+
let e = s.current?.querySelector(_t);
|
|
1545
1586
|
e?.focus(), e instanceof HTMLInputElement && e.type !== "checkbox" && e.select();
|
|
1546
1587
|
}, []);
|
|
1547
|
-
let f =
|
|
1588
|
+
let f = j(() => {
|
|
1548
1589
|
s.current?.closest("[role=\"gridcell\"]")?.focus();
|
|
1549
|
-
}, []), p =
|
|
1590
|
+
}, []), p = j((e) => {
|
|
1550
1591
|
if (!o) return;
|
|
1551
1592
|
let t = a.edits.nextEditable(n - o.headerRowCount, i, e.shiftKey);
|
|
1552
1593
|
t && (e.preventDefault(), o.setActiveCell(t.row + o.headerRowCount, t.column, { reason: "programmatic" }), a.edits.beginAt(t.row, t.column));
|
|
@@ -1555,7 +1596,7 @@ function gt(e) {
|
|
|
1555
1596
|
a,
|
|
1556
1597
|
o,
|
|
1557
1598
|
n
|
|
1558
|
-
]), m =
|
|
1599
|
+
]), m = j((e) => {
|
|
1559
1600
|
if (e.key === "Escape") {
|
|
1560
1601
|
if (s.current?.querySelector("[aria-expanded=\"true\"]")) return;
|
|
1561
1602
|
e.preventDefault(), e.stopPropagation(), t.cancelEdit(), f();
|
|
@@ -1576,23 +1617,23 @@ function gt(e) {
|
|
|
1576
1617
|
t,
|
|
1577
1618
|
f,
|
|
1578
1619
|
p
|
|
1579
|
-
]),
|
|
1620
|
+
]), h = j(() => {
|
|
1580
1621
|
!t.editing || t.pending || t.commitEdit();
|
|
1581
1622
|
}, [t]);
|
|
1582
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ R(_, {
|
|
1583
1624
|
ref: s,
|
|
1584
1625
|
component: `${a.componentName}.body.cell.editor`,
|
|
1585
|
-
variant: { isPending:
|
|
1626
|
+
variant: { isPending: u },
|
|
1586
1627
|
props: { onKeyDown: m },
|
|
1587
1628
|
width: "fit",
|
|
1588
1629
|
height: "fit",
|
|
1589
1630
|
ai: "center",
|
|
1590
|
-
children: [/* @__PURE__ */
|
|
1631
|
+
children: [/* @__PURE__ */ L(bt, {
|
|
1591
1632
|
cell: t,
|
|
1592
1633
|
errorId: l ? c : void 0,
|
|
1593
|
-
onBlur:
|
|
1634
|
+
onBlur: h,
|
|
1594
1635
|
onCommitted: f
|
|
1595
|
-
}), l && /* @__PURE__ */
|
|
1636
|
+
}), l && /* @__PURE__ */ L(y, {
|
|
1596
1637
|
anchor: s,
|
|
1597
1638
|
side: "bottom",
|
|
1598
1639
|
align: "start",
|
|
@@ -1605,24 +1646,24 @@ function gt(e) {
|
|
|
1605
1646
|
})]
|
|
1606
1647
|
});
|
|
1607
1648
|
}
|
|
1608
|
-
function
|
|
1609
|
-
let { cell: t, errorId: n, onBlur: r, onCommitted: i } = e, { EditCell: a } = t.column.def, { type: o, placeholder: s, step: c, min: l, max: u } = t.editor, d = t.column.header ?? t.column.key,
|
|
1649
|
+
function bt(e) {
|
|
1650
|
+
let { cell: t, errorId: n, onBlur: r, onCommitted: i } = e, { EditCell: a } = t.column.def, { type: o, placeholder: s, step: c, min: l, max: u } = t.editor, d = t.column.header ?? t.column.key, p = {
|
|
1610
1651
|
"aria-label": t.grid.localeText.editCell(String(d)),
|
|
1611
1652
|
"aria-invalid": n ? !0 : void 0,
|
|
1612
1653
|
"aria-describedby": n
|
|
1613
|
-
},
|
|
1614
|
-
if (a) return /* @__PURE__ */
|
|
1615
|
-
if (o === "checkbox") return /* @__PURE__ */
|
|
1654
|
+
}, m = De(Pe(o));
|
|
1655
|
+
if (a) return /* @__PURE__ */ L(a, { cell: t });
|
|
1656
|
+
if (o === "checkbox") return /* @__PURE__ */ L(v, {
|
|
1616
1657
|
checked: !!t.draft,
|
|
1617
1658
|
onChange: (e) => {
|
|
1618
1659
|
t.setDraft(e.target.checked), t.commitEdit(), i();
|
|
1619
1660
|
},
|
|
1620
1661
|
props: {
|
|
1621
|
-
...
|
|
1662
|
+
...p,
|
|
1622
1663
|
onBlur: r
|
|
1623
1664
|
}
|
|
1624
1665
|
});
|
|
1625
|
-
if (o === "select") return /* @__PURE__ */
|
|
1666
|
+
if (o === "select") return /* @__PURE__ */ L(f, { children: /* @__PURE__ */ L(w, {
|
|
1626
1667
|
value: t.draft,
|
|
1627
1668
|
defaultOpen: !0,
|
|
1628
1669
|
width: "fit",
|
|
@@ -1633,21 +1674,21 @@ function _t(e) {
|
|
|
1633
1674
|
onValueChange: (e) => {
|
|
1634
1675
|
t.setDraft(e ?? null), t.commitEdit(), i();
|
|
1635
1676
|
},
|
|
1636
|
-
props:
|
|
1637
|
-
children:
|
|
1677
|
+
props: p,
|
|
1678
|
+
children: vt(t).map((e) => /* @__PURE__ */ L(w.Item, {
|
|
1638
1679
|
value: e.value,
|
|
1639
1680
|
children: e.label ?? String(e.value)
|
|
1640
1681
|
}, String(e.value)))
|
|
1641
|
-
});
|
|
1642
|
-
if (
|
|
1682
|
+
}) });
|
|
1683
|
+
if (Pe(o)) return m ? /* @__PURE__ */ L(m.DateEditor, {
|
|
1643
1684
|
cell: t,
|
|
1644
|
-
label:
|
|
1685
|
+
label: p["aria-label"],
|
|
1645
1686
|
errorId: n,
|
|
1646
1687
|
onBlur: r
|
|
1647
1688
|
}) : null;
|
|
1648
|
-
let
|
|
1649
|
-
return /* @__PURE__ */
|
|
1650
|
-
type:
|
|
1689
|
+
let h = o === "number";
|
|
1690
|
+
return /* @__PURE__ */ L(x, {
|
|
1691
|
+
type: h ? "number" : "text",
|
|
1651
1692
|
value: t.draft === null || t.draft === void 0 ? "" : String(t.draft),
|
|
1652
1693
|
placeholder: s,
|
|
1653
1694
|
step: c,
|
|
@@ -1658,94 +1699,94 @@ function _t(e) {
|
|
|
1658
1699
|
focus: { outline: 0 },
|
|
1659
1700
|
onChange: (e) => {
|
|
1660
1701
|
let n = e.target.value;
|
|
1661
|
-
t.setDraft(
|
|
1702
|
+
t.setDraft(h ? n === "" ? null : Number(n) : n);
|
|
1662
1703
|
},
|
|
1663
1704
|
props: {
|
|
1664
|
-
...
|
|
1705
|
+
...p,
|
|
1665
1706
|
min: l,
|
|
1666
1707
|
max: u,
|
|
1667
1708
|
onBlur: r
|
|
1668
1709
|
}
|
|
1669
1710
|
});
|
|
1670
1711
|
}
|
|
1671
|
-
|
|
1712
|
+
yt.displayName = "DataGridCellEditor";
|
|
1672
1713
|
//#endregion
|
|
1673
1714
|
//#region src/components/dataGrid/components/dataGridBooleanValue.tsx
|
|
1674
|
-
function
|
|
1715
|
+
function xt(e) {
|
|
1675
1716
|
let { value: t, text: n } = e;
|
|
1676
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(m, {
|
|
1677
1718
|
viewBox: "0 0 16 16",
|
|
1678
1719
|
width: "1rem",
|
|
1679
1720
|
height: "1rem",
|
|
1680
1721
|
css: { verticalAlign: "middle" },
|
|
1681
|
-
color: t ? void 0 : "
|
|
1722
|
+
color: t ? void 0 : "base-400",
|
|
1682
1723
|
props: { fill: "none" },
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1724
|
+
children: /* @__PURE__ */ L(p, {
|
|
1684
1725
|
d: t ? "m3.5 8.5 3 3 6-7" : "m5 5 6 6m0-6-6 6",
|
|
1685
1726
|
stroke: "currentColor",
|
|
1686
1727
|
strokeWidth: 1.75,
|
|
1687
1728
|
strokeLinecap: "round",
|
|
1688
1729
|
strokeLinejoin: "round"
|
|
1689
1730
|
})
|
|
1690
|
-
}), /* @__PURE__ */
|
|
1731
|
+
}), /* @__PURE__ */ L(g, {
|
|
1691
1732
|
tag: "span",
|
|
1692
1733
|
children: t ? n.booleanTrue : n.booleanFalse
|
|
1693
1734
|
})] });
|
|
1694
1735
|
}
|
|
1695
|
-
|
|
1736
|
+
xt.displayName = "DataGridBooleanValue";
|
|
1696
1737
|
//#endregion
|
|
1697
1738
|
//#region src/components/dataGrid/components/dataGridDateValue.tsx
|
|
1698
|
-
function
|
|
1739
|
+
function St(e, t) {
|
|
1699
1740
|
if (e.def.dateFormat) return e.def.dateFormat;
|
|
1700
1741
|
let { editor: n } = e.def, r = typeof n == "object" ? n.type : n;
|
|
1701
|
-
return r &&
|
|
1742
|
+
return r && Pe(r) ? r : t instanceof Date ? "datetime" : null;
|
|
1702
1743
|
}
|
|
1703
|
-
function
|
|
1704
|
-
let { value: t, format: n } = e, r =
|
|
1705
|
-
return r ? /* @__PURE__ */
|
|
1744
|
+
function Ct(e) {
|
|
1745
|
+
let { value: t, format: n } = e, r = De(!0);
|
|
1746
|
+
return r ? /* @__PURE__ */ L(r.DateValue, {
|
|
1706
1747
|
value: t,
|
|
1707
1748
|
format: n
|
|
1708
|
-
}) : /* @__PURE__ */ I
|
|
1749
|
+
}) : /* @__PURE__ */ L(I, { children: t instanceof Date ? t.toISOString() : t == null ? "" : String(t) });
|
|
1709
1750
|
}
|
|
1710
|
-
|
|
1751
|
+
Ct.displayName = "DataGridDateValue";
|
|
1711
1752
|
//#endregion
|
|
1712
1753
|
//#region src/components/dataGrid/components/dataGridCellText.tsx
|
|
1713
|
-
function
|
|
1714
|
-
let { cell: t } = e, { value: n } = t, r =
|
|
1715
|
-
return /* @__PURE__ */
|
|
1754
|
+
function wt(e) {
|
|
1755
|
+
let { cell: t } = e, { value: n } = t, r = St(t.column, n);
|
|
1756
|
+
return /* @__PURE__ */ L(_, {
|
|
1716
1757
|
component: `${t.grid.componentName}.body.cell.text`,
|
|
1717
1758
|
height: "fit",
|
|
1718
1759
|
width: "fit",
|
|
1719
1760
|
overflow: "auto",
|
|
1720
1761
|
ai: "center",
|
|
1721
1762
|
jc: t.column.align,
|
|
1722
|
-
children: /* @__PURE__ */
|
|
1763
|
+
children: /* @__PURE__ */ L(a, {
|
|
1723
1764
|
px: 3,
|
|
1724
1765
|
textOverflow: "ellipsis",
|
|
1725
1766
|
overflow: "hidden",
|
|
1726
1767
|
textWrap: "nowrap",
|
|
1727
|
-
children: typeof n == "boolean" ? /* @__PURE__ */
|
|
1768
|
+
children: typeof n == "boolean" ? /* @__PURE__ */ L(xt, {
|
|
1728
1769
|
value: n,
|
|
1729
1770
|
text: t.grid.localeText
|
|
1730
|
-
}) : r ? /* @__PURE__ */
|
|
1771
|
+
}) : r ? /* @__PURE__ */ L(Ct, {
|
|
1731
1772
|
value: n,
|
|
1732
1773
|
format: r
|
|
1733
1774
|
}) : n
|
|
1734
1775
|
})
|
|
1735
1776
|
});
|
|
1736
1777
|
}
|
|
1737
|
-
|
|
1778
|
+
wt.displayName = "DataGridCellText";
|
|
1738
1779
|
//#endregion
|
|
1739
1780
|
//#region src/components/dataGrid/components/dataGridCellTree.tsx
|
|
1740
|
-
function
|
|
1741
|
-
let { cell: t, row: n, children: r } = e, { hasChildren:
|
|
1781
|
+
function Tt(e) {
|
|
1782
|
+
let { cell: t, row: n, children: r } = e, { hasChildren: i, treeExpanded: o, level: s } = n, c = n.grid.componentName, l = j((e) => {
|
|
1742
1783
|
e.stopPropagation(), n.toggleTree();
|
|
1743
1784
|
}, [n]), u = t.value == null || t.value === "" ? t.grid.localeText.unnamedRow(n.rowIndex + 1) : String(t.value);
|
|
1744
|
-
return /* @__PURE__ */
|
|
1785
|
+
return /* @__PURE__ */ R(_, {
|
|
1745
1786
|
component: `${c}.body.cell.tree`,
|
|
1746
1787
|
ai: "center",
|
|
1747
1788
|
ps: s * n.grid.tree.indent,
|
|
1748
|
-
children: [
|
|
1789
|
+
children: [i ? /* @__PURE__ */ L(h, {
|
|
1749
1790
|
component: `${c}.body.cell.tree.toggle`,
|
|
1750
1791
|
variant: { isExpanded: o },
|
|
1751
1792
|
type: "button",
|
|
@@ -1758,13 +1799,13 @@ function St(e) {
|
|
|
1758
1799
|
tabIndex: -1,
|
|
1759
1800
|
"aria-label": (o ? t.grid.localeText.collapseTreeRow : t.grid.localeText.expandTreeRow)(u)
|
|
1760
1801
|
},
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1802
|
+
children: /* @__PURE__ */ L(Y, {
|
|
1762
1803
|
fill: "currentColor",
|
|
1763
1804
|
width: "14px",
|
|
1764
1805
|
height: "14px",
|
|
1765
1806
|
rotate: o ? 0 : -90
|
|
1766
1807
|
})
|
|
1767
|
-
}) : /* @__PURE__ */
|
|
1808
|
+
}) : /* @__PURE__ */ L(a, { component: `${c}.body.cell.tree.spacer` }), /* @__PURE__ */ L(a, {
|
|
1768
1809
|
textOverflow: "ellipsis",
|
|
1769
1810
|
overflow: "hidden",
|
|
1770
1811
|
textWrap: "nowrap",
|
|
@@ -1773,29 +1814,29 @@ function St(e) {
|
|
|
1773
1814
|
})]
|
|
1774
1815
|
});
|
|
1775
1816
|
}
|
|
1776
|
-
|
|
1817
|
+
Tt.displayName = "DataGridCellTree";
|
|
1777
1818
|
//#endregion
|
|
1778
1819
|
//#region src/components/dataGrid/components/dataGridRow.tsx
|
|
1779
|
-
function
|
|
1780
|
-
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (z()?.headerRowCount ?? 0) + n, o = W(t) ? t : void 0, s = o && t.grid.tree.columnKey, c =
|
|
1820
|
+
function Et(e) {
|
|
1821
|
+
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (z()?.headerRowCount ?? 0) + n, o = W(t) ? t : void 0, s = o && t.grid.tree.columnKey, c = j(() => {
|
|
1781
1822
|
t.toggleDetail();
|
|
1782
1823
|
}, [t]), l = (e, n) => {
|
|
1783
|
-
if (e.editing) return /* @__PURE__ */
|
|
1824
|
+
if (e.editing) return /* @__PURE__ */ L(yt, {
|
|
1784
1825
|
cell: e,
|
|
1785
1826
|
row: a,
|
|
1786
1827
|
columnIndex: n
|
|
1787
1828
|
});
|
|
1788
|
-
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */
|
|
1829
|
+
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */ L(mt, {
|
|
1789
1830
|
cell: e,
|
|
1790
1831
|
columnIndex: n
|
|
1791
|
-
}) : e.column.Cell ? /* @__PURE__ */
|
|
1792
|
-
return !o || e.column.key !== s ? r : /* @__PURE__ */
|
|
1832
|
+
}) : e.column.Cell ? /* @__PURE__ */ L(e.column.Cell, { cell: e }) : /* @__PURE__ */ L(wt, { cell: e });
|
|
1833
|
+
return !o || e.column.key !== s ? r : /* @__PURE__ */ L(Tt, {
|
|
1793
1834
|
cell: e,
|
|
1794
1835
|
row: o,
|
|
1795
1836
|
children: r
|
|
1796
1837
|
});
|
|
1797
1838
|
};
|
|
1798
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ L(_, {
|
|
1799
1840
|
component: `${t.grid.componentName}.body.row`,
|
|
1800
1841
|
className: "grid-row",
|
|
1801
1842
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1811,7 +1852,7 @@ function Ct(e) {
|
|
|
1811
1852
|
onClick: i ? c : void 0
|
|
1812
1853
|
},
|
|
1813
1854
|
cursor: i ? "pointer" : void 0,
|
|
1814
|
-
children: t.cells.map((e, t) => /* @__PURE__ */
|
|
1855
|
+
children: t.cells.map((e, t) => /* @__PURE__ */ L(J, {
|
|
1815
1856
|
cell: e,
|
|
1816
1857
|
row: a,
|
|
1817
1858
|
columnIndex: t,
|
|
@@ -1819,37 +1860,37 @@ function Ct(e) {
|
|
|
1819
1860
|
}, e.column.key))
|
|
1820
1861
|
});
|
|
1821
1862
|
}
|
|
1822
|
-
|
|
1823
|
-
var
|
|
1863
|
+
Et.displayName = "DataGridRow";
|
|
1864
|
+
var Dt = A(Et);
|
|
1824
1865
|
//#endregion
|
|
1825
1866
|
//#region src/components/dataGrid/components/dataGridBody.tsx
|
|
1826
|
-
function
|
|
1827
|
-
return e instanceof H ? /* @__PURE__ */
|
|
1867
|
+
function Ot(e, t, n) {
|
|
1868
|
+
return e instanceof H ? /* @__PURE__ */ L(lt, {
|
|
1828
1869
|
row: e,
|
|
1829
1870
|
index: t,
|
|
1830
1871
|
version: n
|
|
1831
|
-
}, e.key) : e instanceof
|
|
1872
|
+
}, e.key) : e instanceof st ? /* @__PURE__ */ L(gt, {
|
|
1832
1873
|
row: e,
|
|
1833
1874
|
index: t,
|
|
1834
1875
|
version: n
|
|
1835
|
-
}, e.key) : /* @__PURE__ */
|
|
1876
|
+
}, e.key) : /* @__PURE__ */ L(Dt, {
|
|
1836
1877
|
row: e,
|
|
1837
1878
|
index: t,
|
|
1838
1879
|
version: n
|
|
1839
1880
|
}, e.key);
|
|
1840
1881
|
}
|
|
1841
|
-
function
|
|
1842
|
-
let { grid: t, scroll: n } = e, { viewport: r } = t, { startIndex:
|
|
1882
|
+
function kt(e) {
|
|
1883
|
+
let { grid: t, scroll: n } = e, { viewport: r } = t, { startIndex: i, take: o, translateY: s, totalHeight: c, viewHeight: l } = r.window(n.top, n.direction), u = r.showAll, d = r.isEmpty, f = t.flatRows.value, p = t.getSnapshot(), m = ie(() => d ? null : G.take(f, o, i).map((e, n) => Ot(e, i + n, t.rowVersion(e, i + n))), [
|
|
1843
1884
|
f,
|
|
1844
1885
|
t,
|
|
1845
1886
|
d,
|
|
1846
1887
|
o,
|
|
1847
|
-
|
|
1888
|
+
i,
|
|
1848
1889
|
p
|
|
1849
1890
|
]);
|
|
1850
1891
|
if (d) {
|
|
1851
1892
|
let { noDataComponent: e } = t.props.def, n = t.props.loading ? t.localeText.loadingRows : t.localeText.noRows;
|
|
1852
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ L(_, {
|
|
1853
1894
|
component: `${t.componentName}.body.empty`,
|
|
1854
1895
|
jc: "center",
|
|
1855
1896
|
ai: "center",
|
|
@@ -1858,14 +1899,14 @@ function Et(e) {
|
|
|
1858
1899
|
insetStart: 0,
|
|
1859
1900
|
props: { role: "row" },
|
|
1860
1901
|
style: { height: r.emptyHeight },
|
|
1861
|
-
children: /* @__PURE__ */
|
|
1902
|
+
children: /* @__PURE__ */ L(a, {
|
|
1862
1903
|
display: "contents",
|
|
1863
1904
|
props: { role: "gridcell" },
|
|
1864
1905
|
children: e ?? n
|
|
1865
1906
|
})
|
|
1866
1907
|
});
|
|
1867
1908
|
}
|
|
1868
|
-
return u ? /* @__PURE__ */
|
|
1909
|
+
return u ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(C, {
|
|
1869
1910
|
component: `${t.componentName}.body`,
|
|
1870
1911
|
width: "max-content",
|
|
1871
1912
|
minWidth: "fit",
|
|
@@ -1874,13 +1915,13 @@ function Et(e) {
|
|
|
1874
1915
|
props: { role: "rowgroup" },
|
|
1875
1916
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1876
1917
|
children: m
|
|
1877
|
-
}), /* @__PURE__ */
|
|
1918
|
+
}), /* @__PURE__ */ L(ft, { grid: t })] }) : /* @__PURE__ */ R(a, {
|
|
1878
1919
|
props: { role: "presentation" },
|
|
1879
1920
|
style: { height: l },
|
|
1880
|
-
children: [/* @__PURE__ */
|
|
1921
|
+
children: [/* @__PURE__ */ L(a, {
|
|
1881
1922
|
props: { role: "presentation" },
|
|
1882
1923
|
style: { height: `${c}px` },
|
|
1883
|
-
children: /* @__PURE__ */
|
|
1924
|
+
children: /* @__PURE__ */ L(C, {
|
|
1884
1925
|
component: `${t.componentName}.body`,
|
|
1885
1926
|
width: "max-content",
|
|
1886
1927
|
minWidth: "fit",
|
|
@@ -1894,15 +1935,15 @@ function Et(e) {
|
|
|
1894
1935
|
},
|
|
1895
1936
|
children: m
|
|
1896
1937
|
})
|
|
1897
|
-
}), /* @__PURE__ */
|
|
1938
|
+
}), /* @__PURE__ */ L(ft, { grid: t })]
|
|
1898
1939
|
});
|
|
1899
1940
|
}
|
|
1900
|
-
|
|
1941
|
+
kt.displayName = "DataGridBody";
|
|
1901
1942
|
//#endregion
|
|
1902
1943
|
//#region src/components/dataGrid/components/dataGridEmptyColumns.tsx
|
|
1903
|
-
function
|
|
1944
|
+
function At(e) {
|
|
1904
1945
|
let { grid: t } = e;
|
|
1905
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ L(_, {
|
|
1906
1947
|
component: `${t.componentName}.emptyColumns`,
|
|
1907
1948
|
d: "column",
|
|
1908
1949
|
ai: "center",
|
|
@@ -1910,49 +1951,49 @@ function Dt(e) {
|
|
|
1910
1951
|
gap: 4,
|
|
1911
1952
|
py: 16,
|
|
1912
1953
|
px: 6,
|
|
1913
|
-
bgColor: "
|
|
1954
|
+
bgColor: "base-50",
|
|
1914
1955
|
borderRadius: 4,
|
|
1915
|
-
theme: { dark: { bgColor: "
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1956
|
+
theme: { dark: { bgColor: "base-900" } },
|
|
1957
|
+
children: /* @__PURE__ */ R(_, {
|
|
1917
1958
|
d: "column",
|
|
1918
1959
|
ai: "center",
|
|
1919
1960
|
gap: 3,
|
|
1920
|
-
children: [/* @__PURE__ */
|
|
1961
|
+
children: [/* @__PURE__ */ L(a, {
|
|
1921
1962
|
width: 16,
|
|
1922
1963
|
height: 16,
|
|
1923
1964
|
borderRadius: 999,
|
|
1924
|
-
bgColor: "
|
|
1925
|
-
theme: { dark: { bgColor: "
|
|
1965
|
+
bgColor: "base-200",
|
|
1966
|
+
theme: { dark: { bgColor: "base-700" } },
|
|
1926
1967
|
display: "flex",
|
|
1927
1968
|
ai: "center",
|
|
1928
1969
|
jc: "center",
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1970
|
+
children: /* @__PURE__ */ L(m, {
|
|
1930
1971
|
viewBox: "0 0 24 24",
|
|
1931
1972
|
width: "40",
|
|
1932
1973
|
fill: "currentColor",
|
|
1933
|
-
color: "
|
|
1934
|
-
theme: { dark: { color: "
|
|
1935
|
-
children: /* @__PURE__ */
|
|
1974
|
+
color: "base-400",
|
|
1975
|
+
theme: { dark: { color: "base-500" } },
|
|
1976
|
+
children: /* @__PURE__ */ L(p, {
|
|
1936
1977
|
fillRule: "evenodd",
|
|
1937
1978
|
props: { clipRule: "evenodd" },
|
|
1938
1979
|
d: "M3 6a3 3 0 013-3h12a3 3 0 013 3v12a3 3 0 01-3 3H6a3 3 0 01-3-3V6zm3-1a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1V6a1 1 0 00-1-1H6zm2 3a1 1 0 011-1h6a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h6a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h4a1 1 0 110 2H9a1 1 0 01-1-1z"
|
|
1939
1980
|
})
|
|
1940
1981
|
})
|
|
1941
|
-
}), /* @__PURE__ */
|
|
1982
|
+
}), /* @__PURE__ */ R(_, {
|
|
1942
1983
|
d: "column",
|
|
1943
1984
|
ai: "center",
|
|
1944
1985
|
gap: 1,
|
|
1945
|
-
children: [/* @__PURE__ */
|
|
1986
|
+
children: [/* @__PURE__ */ L(a, {
|
|
1946
1987
|
fontSize: 18,
|
|
1947
1988
|
fontWeight: 600,
|
|
1948
|
-
color: "
|
|
1949
|
-
theme: { dark: { color: "
|
|
1989
|
+
color: "base-900",
|
|
1990
|
+
theme: { dark: { color: "base-50" } },
|
|
1950
1991
|
children: t.localeText.noColumnsTitle
|
|
1951
|
-
}), /* @__PURE__ */
|
|
1992
|
+
}), /* @__PURE__ */ L(a, {
|
|
1952
1993
|
fontSize: 14,
|
|
1953
|
-
color: "
|
|
1994
|
+
color: "base-500",
|
|
1954
1995
|
textAlign: "center",
|
|
1955
|
-
theme: { dark: { color: "
|
|
1996
|
+
theme: { dark: { color: "base-400" } },
|
|
1956
1997
|
children: t.localeText.noColumnsDescription
|
|
1957
1998
|
})]
|
|
1958
1999
|
})]
|
|
@@ -1961,7 +2002,7 @@ function Dt(e) {
|
|
|
1961
2002
|
}
|
|
1962
2003
|
//#endregion
|
|
1963
2004
|
//#region src/utils/dataGrid/headerCellUtils.ts
|
|
1964
|
-
var
|
|
2005
|
+
var jt;
|
|
1965
2006
|
(function(e) {
|
|
1966
2007
|
let t = e.CELL_SELECTOR = "[role=\"columnheader\"][aria-sort]", n = ".resizer", r = `button, input, a, [role="menu"], [role="separator"], ${n}`;
|
|
1967
2008
|
function i(e, t) {
|
|
@@ -2036,8 +2077,8 @@ var Ot;
|
|
|
2036
2077
|
} : e;
|
|
2037
2078
|
}
|
|
2038
2079
|
e.pause = u;
|
|
2039
|
-
})(
|
|
2040
|
-
var X =
|
|
2080
|
+
})(jt ||= {});
|
|
2081
|
+
var X = jt, Mt;
|
|
2041
2082
|
(function(e) {
|
|
2042
2083
|
function t(e, t) {
|
|
2043
2084
|
return (t?.type === "text" ? t.value : "") === (e.trim() ? e : "");
|
|
@@ -2064,31 +2105,31 @@ var X = Ot, kt;
|
|
|
2064
2105
|
return t.valueTo === void 0 ? isNaN(r) : t.valueTo === r;
|
|
2065
2106
|
}
|
|
2066
2107
|
e.numberMatches = r;
|
|
2067
|
-
})(
|
|
2068
|
-
var Z =
|
|
2069
|
-
function
|
|
2070
|
-
let i =
|
|
2108
|
+
})(Mt ||= {});
|
|
2109
|
+
var Z = Mt, Nt = 300;
|
|
2110
|
+
function Pt(e, t, n) {
|
|
2111
|
+
let i = P(/* @__PURE__ */ new Map()), a = j(() => {
|
|
2071
2112
|
for (let e of i.current.values()) clearTimeout(e);
|
|
2072
2113
|
i.current.clear();
|
|
2073
|
-
}, []), s =
|
|
2114
|
+
}, []), s = j((e, t) => {
|
|
2074
2115
|
clearTimeout(i.current.get(e)), i.current.set(e, setTimeout(() => {
|
|
2075
2116
|
i.current.delete(e), t();
|
|
2076
|
-
},
|
|
2117
|
+
}, Nt));
|
|
2077
2118
|
}, []);
|
|
2078
|
-
|
|
2079
|
-
let c =
|
|
2080
|
-
t(e) || (
|
|
2119
|
+
N(() => a, [a]);
|
|
2120
|
+
let c = o(() => {
|
|
2121
|
+
t(e) || (a(), n(e));
|
|
2081
2122
|
});
|
|
2082
2123
|
return r(c, [e, c]), {
|
|
2083
2124
|
debounce: s,
|
|
2084
|
-
cancel:
|
|
2125
|
+
cancel: a
|
|
2085
2126
|
};
|
|
2086
2127
|
}
|
|
2087
2128
|
//#endregion
|
|
2088
2129
|
//#region src/components/dataGrid/components/dataGridColumnFilter.tsx
|
|
2089
|
-
function
|
|
2130
|
+
function Ft(e) {
|
|
2090
2131
|
let { label: t, onClear: n } = e;
|
|
2091
|
-
return /* @__PURE__ */
|
|
2132
|
+
return /* @__PURE__ */ L(h, {
|
|
2092
2133
|
clean: !0,
|
|
2093
2134
|
type: "button",
|
|
2094
2135
|
position: "absolute",
|
|
@@ -2103,24 +2144,24 @@ function Mt(e) {
|
|
|
2103
2144
|
tabIndex: -1,
|
|
2104
2145
|
"aria-label": t
|
|
2105
2146
|
},
|
|
2106
|
-
children: /* @__PURE__ */
|
|
2147
|
+
children: /* @__PURE__ */ L(a, {
|
|
2107
2148
|
fontSize: 10,
|
|
2108
|
-
color: "
|
|
2109
|
-
hover: { color: "
|
|
2149
|
+
color: "base-400",
|
|
2150
|
+
hover: { color: "base-600" },
|
|
2110
2151
|
children: "✕"
|
|
2111
2152
|
})
|
|
2112
2153
|
});
|
|
2113
2154
|
}
|
|
2114
|
-
function
|
|
2115
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] =
|
|
2155
|
+
function It({ column: e }) {
|
|
2156
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = F(t?.type === "text" ? t.value : ""), { debounce: s, cancel: c } = Pt(t, (e) => Z.textMatches(a, e), (e) => o(e?.type === "text" ? e.value : "")), l = j((t) => {
|
|
2116
2157
|
let n = t.target.value;
|
|
2117
2158
|
o(n), s("value", () => e.setTextFilter(n));
|
|
2118
|
-
}, [e, s]), u =
|
|
2159
|
+
}, [e, s]), u = j(() => {
|
|
2119
2160
|
c(), o(""), e.clearFilter();
|
|
2120
2161
|
}, [e, c]);
|
|
2121
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ R(_, {
|
|
2122
2163
|
component: `${n}.filter.cell.input`,
|
|
2123
|
-
children: [/* @__PURE__ */
|
|
2164
|
+
children: [/* @__PURE__ */ L(x, {
|
|
2124
2165
|
width: "fit",
|
|
2125
2166
|
variant: "compact",
|
|
2126
2167
|
placeholder: e.filterConfig?.placeholder ?? i.filterPlaceholder,
|
|
@@ -2133,19 +2174,19 @@ function Nt({ column: e }) {
|
|
|
2133
2174
|
tabIndex: -1,
|
|
2134
2175
|
"aria-label": i.filterColumn(r)
|
|
2135
2176
|
}
|
|
2136
|
-
}), a && /* @__PURE__ */
|
|
2177
|
+
}), a && /* @__PURE__ */ L(Ft, {
|
|
2137
2178
|
label: i.clearFilter(r),
|
|
2138
2179
|
onClear: u
|
|
2139
2180
|
})]
|
|
2140
2181
|
});
|
|
2141
2182
|
}
|
|
2142
|
-
function
|
|
2143
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] =
|
|
2183
|
+
function Lt({ column: e }) {
|
|
2184
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = F(() => Z.numberDraft(t)), s = P(a), c = j((e) => {
|
|
2144
2185
|
s.current = e, o(e);
|
|
2145
|
-
}, []), { debounce: l, cancel: u } =
|
|
2186
|
+
}, []), { debounce: l, cancel: u } = Pt(t, (e) => Z.numberMatches(a, e), (e) => c(Z.numberDraft(e))), { operator: d, value: p, valueTo: m } = a, h = e.filterConfig, g = j(() => {
|
|
2146
2187
|
let { operator: t, value: n, valueTo: r } = s.current;
|
|
2147
2188
|
e.setNumberFilter(t, n, r);
|
|
2148
|
-
}, [e]),
|
|
2189
|
+
}, [e]), v = j((e, t) => {
|
|
2149
2190
|
c({
|
|
2150
2191
|
...s.current,
|
|
2151
2192
|
...e
|
|
@@ -2155,21 +2196,21 @@ function Pt({ column: e }) {
|
|
|
2155
2196
|
g,
|
|
2156
2197
|
l,
|
|
2157
2198
|
u
|
|
2158
|
-
]),
|
|
2199
|
+
]), y = j((e) => v({ value: e.target.value }, !0), [v]), b = j((e) => v({ valueTo: e.target.value }, !0), [v]), S = j((e) => v({ operator: e }, !1), [v]), C = j(() => {
|
|
2159
2200
|
u(), c(Z.numberDraft(void 0)), e.clearFilter();
|
|
2160
2201
|
}, [
|
|
2161
2202
|
e,
|
|
2162
2203
|
u,
|
|
2163
2204
|
c
|
|
2164
2205
|
]);
|
|
2165
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ R(_, {
|
|
2166
2207
|
component: `${n}.filter.cell.input`,
|
|
2167
2208
|
ai: d === "between" ? "start" : "center",
|
|
2168
2209
|
gap: 1,
|
|
2169
|
-
children: [/* @__PURE__ */ L(
|
|
2210
|
+
children: [/* @__PURE__ */ L(f, { children: /* @__PURE__ */ R(w, {
|
|
2170
2211
|
value: d,
|
|
2171
2212
|
variant: "compact",
|
|
2172
|
-
onChange: (e) => e &&
|
|
2213
|
+
onChange: (e) => e && S(e),
|
|
2173
2214
|
minWidth: 6,
|
|
2174
2215
|
hideIcon: !0,
|
|
2175
2216
|
b: 0,
|
|
@@ -2180,51 +2221,51 @@ function Pt({ column: e }) {
|
|
|
2180
2221
|
"aria-label": i.filterComparison(r)
|
|
2181
2222
|
},
|
|
2182
2223
|
children: [
|
|
2183
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2184
2225
|
value: "eq",
|
|
2185
2226
|
children: "="
|
|
2186
2227
|
}),
|
|
2187
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2188
2229
|
value: "ne",
|
|
2189
2230
|
children: "≠"
|
|
2190
2231
|
}),
|
|
2191
|
-
/* @__PURE__ */
|
|
2232
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2192
2233
|
value: "gt",
|
|
2193
2234
|
children: ">"
|
|
2194
2235
|
}),
|
|
2195
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2196
2237
|
value: "gte",
|
|
2197
2238
|
children: "≥"
|
|
2198
2239
|
}),
|
|
2199
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2200
2241
|
value: "lt",
|
|
2201
2242
|
children: "<"
|
|
2202
2243
|
}),
|
|
2203
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2204
2245
|
value: "lte",
|
|
2205
2246
|
children: "≤"
|
|
2206
2247
|
}),
|
|
2207
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ L(w.Item, {
|
|
2208
2249
|
value: "between",
|
|
2209
2250
|
children: "↔"
|
|
2210
2251
|
})
|
|
2211
2252
|
]
|
|
2212
|
-
}), d === "between" ? /* @__PURE__ */
|
|
2253
|
+
}) }), d === "between" ? /* @__PURE__ */ R(_, {
|
|
2213
2254
|
d: "column",
|
|
2214
2255
|
gap: 1,
|
|
2215
2256
|
flex1: !0,
|
|
2216
|
-
children: [/* @__PURE__ */
|
|
2257
|
+
children: [/* @__PURE__ */ R(_, {
|
|
2217
2258
|
ai: "center",
|
|
2218
2259
|
position: "relative",
|
|
2219
2260
|
flex1: !0,
|
|
2220
|
-
children: [/* @__PURE__ */
|
|
2261
|
+
children: [/* @__PURE__ */ L(x, {
|
|
2221
2262
|
type: "number",
|
|
2222
2263
|
variant: "compact",
|
|
2223
|
-
placeholder:
|
|
2224
|
-
value:
|
|
2225
|
-
onChange:
|
|
2264
|
+
placeholder: h?.placeholder ?? i.filterFromPlaceholder,
|
|
2265
|
+
value: p,
|
|
2266
|
+
onChange: y,
|
|
2226
2267
|
width: "fit",
|
|
2227
|
-
step:
|
|
2268
|
+
step: h?.step,
|
|
2228
2269
|
b: 0,
|
|
2229
2270
|
bgColor: "transparent",
|
|
2230
2271
|
focus: { outline: 0 },
|
|
@@ -2232,21 +2273,21 @@ function Pt({ column: e }) {
|
|
|
2232
2273
|
tabIndex: -1,
|
|
2233
2274
|
"aria-label": i.filterFrom(r)
|
|
2234
2275
|
}
|
|
2235
|
-
}), (
|
|
2276
|
+
}), (p !== "" || m !== "") && /* @__PURE__ */ L(Ft, {
|
|
2236
2277
|
label: i.clearFilter(r),
|
|
2237
2278
|
onClear: C
|
|
2238
2279
|
})]
|
|
2239
|
-
}), /* @__PURE__ */
|
|
2280
|
+
}), /* @__PURE__ */ L(_, {
|
|
2240
2281
|
ai: "center",
|
|
2241
2282
|
flex1: !0,
|
|
2242
|
-
children: /* @__PURE__ */
|
|
2283
|
+
children: /* @__PURE__ */ L(x, {
|
|
2243
2284
|
type: "number",
|
|
2244
2285
|
variant: "compact",
|
|
2245
2286
|
placeholder: i.filterToPlaceholder,
|
|
2246
|
-
value:
|
|
2287
|
+
value: m,
|
|
2247
2288
|
onChange: b,
|
|
2248
2289
|
width: "fit",
|
|
2249
|
-
step:
|
|
2290
|
+
step: h?.step,
|
|
2250
2291
|
b: 0,
|
|
2251
2292
|
bgColor: "transparent",
|
|
2252
2293
|
focus: { outline: 0 },
|
|
@@ -2256,18 +2297,18 @@ function Pt({ column: e }) {
|
|
|
2256
2297
|
}
|
|
2257
2298
|
})
|
|
2258
2299
|
})]
|
|
2259
|
-
}) : /* @__PURE__ */
|
|
2300
|
+
}) : /* @__PURE__ */ R(_, {
|
|
2260
2301
|
ai: "center",
|
|
2261
2302
|
position: "relative",
|
|
2262
2303
|
flex1: !0,
|
|
2263
|
-
children: [/* @__PURE__ */
|
|
2304
|
+
children: [/* @__PURE__ */ L(x, {
|
|
2264
2305
|
type: "number",
|
|
2265
2306
|
variant: "compact",
|
|
2266
|
-
placeholder:
|
|
2267
|
-
value:
|
|
2268
|
-
onChange:
|
|
2307
|
+
placeholder: h?.placeholder ?? i.filterValuePlaceholder,
|
|
2308
|
+
value: p,
|
|
2309
|
+
onChange: y,
|
|
2269
2310
|
width: "fit",
|
|
2270
|
-
step:
|
|
2311
|
+
step: h?.step,
|
|
2271
2312
|
b: 0,
|
|
2272
2313
|
bgColor: "transparent",
|
|
2273
2314
|
focus: { outline: 0 },
|
|
@@ -2275,28 +2316,28 @@ function Pt({ column: e }) {
|
|
|
2275
2316
|
tabIndex: -1,
|
|
2276
2317
|
"aria-label": i.filterColumn(r)
|
|
2277
2318
|
}
|
|
2278
|
-
}),
|
|
2319
|
+
}), p !== "" && /* @__PURE__ */ L(Ft, {
|
|
2279
2320
|
label: i.clearFilter(r),
|
|
2280
2321
|
onClear: C
|
|
2281
2322
|
})]
|
|
2282
2323
|
})]
|
|
2283
2324
|
});
|
|
2284
2325
|
}
|
|
2285
|
-
function
|
|
2286
|
-
let t =
|
|
2287
|
-
return t ? /* @__PURE__ */
|
|
2326
|
+
function Rt({ column: e }) {
|
|
2327
|
+
let t = De(!0);
|
|
2328
|
+
return t ? /* @__PURE__ */ L(t.DateFilter, { column: e }) : null;
|
|
2288
2329
|
}
|
|
2289
|
-
function
|
|
2290
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key),
|
|
2330
|
+
function zt({ column: e }) {
|
|
2331
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, o = t?.type === "multiselect" ? t.values : [], s = e.filterOptions, c = j((t, n) => {
|
|
2291
2332
|
e.setMultiselectFilter(n);
|
|
2292
2333
|
}, [e]);
|
|
2293
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ L(_, {
|
|
2294
2335
|
component: `${n}.filter.cell.input`,
|
|
2295
|
-
children: /* @__PURE__ */ L(
|
|
2336
|
+
children: /* @__PURE__ */ L(f, { children: /* @__PURE__ */ R(w, {
|
|
2296
2337
|
multiple: !0,
|
|
2297
2338
|
showCheckbox: !0,
|
|
2298
2339
|
isSearchable: !0,
|
|
2299
|
-
searchPlaceholder:
|
|
2340
|
+
searchPlaceholder: i.filterSelectSearchPlaceholder,
|
|
2300
2341
|
value: o,
|
|
2301
2342
|
width: "fit",
|
|
2302
2343
|
minWidth: 0,
|
|
@@ -2307,43 +2348,43 @@ function It({ column: e }) {
|
|
|
2307
2348
|
focus: { outline: 0 },
|
|
2308
2349
|
props: {
|
|
2309
2350
|
tabIndex: -1,
|
|
2310
|
-
"aria-label":
|
|
2351
|
+
"aria-label": i.filterColumn(r)
|
|
2311
2352
|
},
|
|
2312
2353
|
children: [
|
|
2313
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ L(w.Display, { children: (t) => t.length === 0 ? /* @__PURE__ */ L(a, {
|
|
2314
2355
|
tag: "span",
|
|
2315
|
-
color: "
|
|
2316
|
-
children: e.filterConfig?.placeholder ??
|
|
2356
|
+
color: "base-400",
|
|
2357
|
+
children: e.filterConfig?.placeholder ?? i.filterSelectPlaceholder
|
|
2317
2358
|
}) : t.length === 1 ? s.find((e) => e.value === t[0])?.label ?? String(t[0]) : `${t.length} selected` }),
|
|
2318
|
-
/* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
s.map((e) => /* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ L(w.Unselect, { children: i.filterSelectClear }),
|
|
2360
|
+
/* @__PURE__ */ L(w.SelectAll, { children: i.filterSelectAll }),
|
|
2361
|
+
s.map((e) => /* @__PURE__ */ L(w.Item, {
|
|
2321
2362
|
value: e.value,
|
|
2322
2363
|
ai: "center",
|
|
2323
2364
|
gap: 2,
|
|
2324
2365
|
children: e.label
|
|
2325
2366
|
}, String(e.value)))
|
|
2326
2367
|
]
|
|
2327
|
-
})
|
|
2368
|
+
}) })
|
|
2328
2369
|
});
|
|
2329
2370
|
}
|
|
2330
|
-
function
|
|
2371
|
+
function Bt(e) {
|
|
2331
2372
|
let { column: t } = e, n = t.filterConfig;
|
|
2332
2373
|
if (!n) return null;
|
|
2333
2374
|
switch (n.type) {
|
|
2334
|
-
case "number": return /* @__PURE__ */
|
|
2335
|
-
case "multiselect": return /* @__PURE__ */
|
|
2336
|
-
case "date": return /* @__PURE__ */
|
|
2337
|
-
default: return /* @__PURE__ */
|
|
2375
|
+
case "number": return /* @__PURE__ */ L(Lt, { column: t });
|
|
2376
|
+
case "multiselect": return /* @__PURE__ */ L(zt, { column: t });
|
|
2377
|
+
case "date": return /* @__PURE__ */ L(Rt, { column: t });
|
|
2378
|
+
default: return /* @__PURE__ */ L(It, { column: t });
|
|
2338
2379
|
}
|
|
2339
2380
|
}
|
|
2340
|
-
|
|
2381
|
+
Bt.displayName = "DataGridColumnFilter";
|
|
2341
2382
|
//#endregion
|
|
2342
2383
|
//#region src/components/dataGrid/components/dataGridFilterCell.tsx
|
|
2343
|
-
function
|
|
2344
|
-
let { column: t, grid: n, row: r, columnIndex: i } = e, { widthVarName: a, inlineStartVarName: o, inlineEndVarName: s, filterable: c } = t, { isStartPinned: l, isEndPinned: u, isPinned: d, isFirstStartPinned: f, isLastStartPinned: p, isFirstEndPinned: m, isLastEndPinned:
|
|
2345
|
-
return /* @__PURE__ */
|
|
2346
|
-
ref:
|
|
2384
|
+
function Vt(e) {
|
|
2385
|
+
let { column: t, grid: n, row: r, columnIndex: i } = e, { widthVarName: a, inlineStartVarName: o, inlineEndVarName: s, filterable: c } = t, { isStartPinned: l, isEndPinned: u, isPinned: d, isFirstStartPinned: f, isLastStartPinned: p, isFirstEndPinned: m, isLastEndPinned: h } = t.pinFlags.value, { ref: g, tabIndex: v, onFocus: y } = be(z(), r, i), b = t.isGrouping || t.isRowNumber || t.isRowSelection;
|
|
2386
|
+
return /* @__PURE__ */ L(_, {
|
|
2387
|
+
ref: g,
|
|
2347
2388
|
component: `${n.componentName}.filter.cell`,
|
|
2348
2389
|
props: {
|
|
2349
2390
|
role: "gridcell",
|
|
@@ -2356,7 +2397,7 @@ function Rt(e) {
|
|
|
2356
2397
|
isFirstStartPinned: f,
|
|
2357
2398
|
isLastStartPinned: p,
|
|
2358
2399
|
isFirstEndPinned: m,
|
|
2359
|
-
isLastEndPinned:
|
|
2400
|
+
isLastEndPinned: h
|
|
2360
2401
|
},
|
|
2361
2402
|
px: 2,
|
|
2362
2403
|
style: {
|
|
@@ -2364,23 +2405,23 @@ function Rt(e) {
|
|
|
2364
2405
|
insetInlineStart: l ? `var(${o})` : void 0,
|
|
2365
2406
|
insetInlineEnd: u ? `var(${s})` : void 0
|
|
2366
2407
|
},
|
|
2367
|
-
children: !b && c && /* @__PURE__ */
|
|
2408
|
+
children: !b && c && /* @__PURE__ */ L(Bt, { column: t })
|
|
2368
2409
|
});
|
|
2369
2410
|
}
|
|
2370
|
-
|
|
2411
|
+
Vt.displayName = "DataGridFilterCell";
|
|
2371
2412
|
//#endregion
|
|
2372
2413
|
//#region src/components/dataGrid/components/dataGridFilterRow.tsx
|
|
2373
|
-
function
|
|
2414
|
+
function Ht(e) {
|
|
2374
2415
|
let { grid: t } = e;
|
|
2375
2416
|
if (!t.filter.hasFilterableColumns) return null;
|
|
2376
2417
|
let n = t.headerRows.value.length;
|
|
2377
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ L(a, {
|
|
2378
2419
|
display: "contents",
|
|
2379
2420
|
props: {
|
|
2380
2421
|
role: "row",
|
|
2381
2422
|
"aria-rowindex": n + 1
|
|
2382
2423
|
},
|
|
2383
|
-
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */
|
|
2424
|
+
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */ L(Vt, {
|
|
2384
2425
|
column: e,
|
|
2385
2426
|
grid: t,
|
|
2386
2427
|
row: n,
|
|
@@ -2388,25 +2429,25 @@ function zt(e) {
|
|
|
2388
2429
|
}, e.uniqueKey))
|
|
2389
2430
|
});
|
|
2390
2431
|
}
|
|
2391
|
-
|
|
2432
|
+
Ht.displayName = "DataGridFilterRow";
|
|
2392
2433
|
//#endregion
|
|
2393
2434
|
//#region src/icons/sortIcon.tsx
|
|
2394
|
-
function
|
|
2395
|
-
return /* @__PURE__ */
|
|
2435
|
+
function Ut(e) {
|
|
2436
|
+
return /* @__PURE__ */ L(m, {
|
|
2396
2437
|
viewBox: "0 0 24 24",
|
|
2397
2438
|
width: "1.5rem",
|
|
2398
2439
|
...e,
|
|
2399
|
-
children: /* @__PURE__ */
|
|
2440
|
+
children: /* @__PURE__ */ L(p, { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" })
|
|
2400
2441
|
});
|
|
2401
2442
|
}
|
|
2402
2443
|
//#endregion
|
|
2403
2444
|
//#region src/icons/dotsIcon.tsx
|
|
2404
|
-
function
|
|
2405
|
-
return /* @__PURE__ */
|
|
2445
|
+
function Wt(e) {
|
|
2446
|
+
return /* @__PURE__ */ L(m, {
|
|
2406
2447
|
viewBox: "0 0 16 16",
|
|
2407
2448
|
width: "18",
|
|
2408
2449
|
...e,
|
|
2409
|
-
children: /* @__PURE__ */
|
|
2450
|
+
children: /* @__PURE__ */ L(p, {
|
|
2410
2451
|
strokeWidth: 4,
|
|
2411
2452
|
d: "M7.936 12.128a.936.936 0 1 1 0 1.872.936.936 0 0 1 0-1.872ZM7.936 7.052a.936.936 0 1 1 0 1.873.936.936 0 0 1 0-1.873ZM7.936 1.977a.936.936 0 1 1 0 1.872.936.936 0 0 1 0-1.872Z"
|
|
2412
2453
|
})
|
|
@@ -2414,126 +2455,126 @@ function Vt(e) {
|
|
|
2414
2455
|
}
|
|
2415
2456
|
//#endregion
|
|
2416
2457
|
//#region src/icons/groupingIcon.tsx
|
|
2417
|
-
function
|
|
2418
|
-
return /* @__PURE__ */
|
|
2458
|
+
function Gt(e) {
|
|
2459
|
+
return /* @__PURE__ */ L(m, {
|
|
2419
2460
|
viewBox: "0 0 24 24",
|
|
2420
2461
|
width: "1.5rem",
|
|
2421
2462
|
...e,
|
|
2422
|
-
children: /* @__PURE__ */
|
|
2463
|
+
children: /* @__PURE__ */ L(p, { d: "M3 5h8v2H3V5zm0 6h8v2H3v-2zm0 6h8v2H3v-2zm12-12h6v6h-6V5zm1 1v4h4V6h-4zm-1 7h6v6h-6v-6zm1 1v4h4v-4h-4z" })
|
|
2423
2464
|
});
|
|
2424
2465
|
}
|
|
2425
2466
|
//#endregion
|
|
2426
2467
|
//#region src/icons/pinIcon.tsx
|
|
2427
|
-
function
|
|
2428
|
-
return /* @__PURE__ */
|
|
2468
|
+
function Kt(e) {
|
|
2469
|
+
return /* @__PURE__ */ L(m, {
|
|
2429
2470
|
viewBox: "0 0 1024 1024",
|
|
2430
2471
|
width: "1.5rem",
|
|
2431
2472
|
...e,
|
|
2432
|
-
children: /* @__PURE__ */
|
|
2473
|
+
children: /* @__PURE__ */ L(p, { d: "M31.997 1023.957a31.699 31.699 0 0 1-22.611-9.386C3.328 1008.556 0 1000.493 0 991.96s3.328-16.596 9.386-22.611L328.25 650.484l-152.52-152.52a95.907 95.907 0 0 1-25.087-92.152 95.31 95.31 0 0 1 44.327-58.62l.896-.512a353.464 353.464 0 0 1 176.156-47.398c20.137 0 40.36 1.749 60.283 5.205L597.71 44.54A95.224 95.224 0 0 1 678.685.085c25.64 0 49.745 9.983 67.877 28.073l249.195 249.195a95.224 95.224 0 0 1 25.897 88.74 95.139 95.139 0 0 1-42.152 60.154L719.513 591.695a352.227 352.227 0 0 1-42.663 237.292A95.395 95.395 0 0 1 594 876.514a95.523 95.523 0 0 1-67.963-28.2L373.43 695.706 54.61 1014.614a31.912 31.912 0 0 1-22.612 9.343zm340.025-660.68c-50.64 0-100.685 13.566-144.798 39.207a31.57 31.57 0 0 0-14.676 19.497 31.699 31.699 0 0 0 8.362 30.675L571.344 803.09c6.059 6.059 14.122 9.386 22.697 9.386a31.699 31.699 0 0 0 27.56-15.785 287.421 287.421 0 0 0 31.06-212.676 31.997 31.997 0 0 1 13.907-34.471l278.59-177.266a31.57 31.57 0 0 0 14.037-20.051 31.699 31.699 0 0 0-8.618-29.566l-249.28-249.28a31.912 31.912 0 0 0-49.618 5.418l-177.308 278.59a31.827 31.827 0 0 1-34.472 13.908 293.778 293.778 0 0 0-67.877-8.02z" })
|
|
2433
2474
|
});
|
|
2434
2475
|
}
|
|
2435
2476
|
//#endregion
|
|
2436
2477
|
//#region src/components/dataGrid/components/dataGridHeaderCellContextMenu.tsx
|
|
2437
|
-
function
|
|
2478
|
+
function qt(e) {
|
|
2438
2479
|
let { side: t, left: n, right: r } = e;
|
|
2439
|
-
return /* @__PURE__ */
|
|
2480
|
+
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(T, {
|
|
2440
2481
|
rtl: { display: "none" },
|
|
2441
2482
|
children: t === "start" ? n : r
|
|
2442
|
-
}), /* @__PURE__ */
|
|
2483
|
+
}), /* @__PURE__ */ L(T, {
|
|
2443
2484
|
ltr: { display: "none" },
|
|
2444
2485
|
children: t === "start" ? r : n
|
|
2445
2486
|
})] });
|
|
2446
2487
|
}
|
|
2447
|
-
function
|
|
2448
|
-
let { column: t } = e, { grid: n, isEndAligned:
|
|
2449
|
-
let e = (e) => /* @__PURE__ */
|
|
2488
|
+
function Jt(e) {
|
|
2489
|
+
let { column: t } = e, { grid: n, isEndAligned: i, header: o, key: c } = t, f = t.headerCell, p = String(o ?? c), m = n.localeText, g = d("datagrid-column-menu"), [v, x] = F(!1), S = P(null), C = P(null), w = P(!1), E = i ? 3 : void 0, ee = i ? void 0 : 3, D = ie(() => {
|
|
2490
|
+
let e = (e) => /* @__PURE__ */ L(T, {
|
|
2450
2491
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.icon`,
|
|
2451
2492
|
children: e
|
|
2452
|
-
}), r = (t) => e(/* @__PURE__ */
|
|
2493
|
+
}), r = (t) => e(/* @__PURE__ */ L(Ut, {
|
|
2453
2494
|
width: "100%",
|
|
2454
2495
|
fill: "currentColor",
|
|
2455
2496
|
rotate: t
|
|
2456
|
-
})),
|
|
2497
|
+
})), i = (t, n) => e(/* @__PURE__ */ L(Kt, {
|
|
2457
2498
|
width: "100%",
|
|
2458
2499
|
fill: "currentColor",
|
|
2459
2500
|
rotate: t,
|
|
2460
2501
|
rtl: { rotate: n }
|
|
2461
|
-
})), o = e(/* @__PURE__ */
|
|
2502
|
+
})), o = e(/* @__PURE__ */ L(Gt, {
|
|
2462
2503
|
width: "100%",
|
|
2463
2504
|
fill: "currentColor"
|
|
2464
|
-
})), s = /* @__PURE__ */
|
|
2505
|
+
})), s = /* @__PURE__ */ L(a, { width: 4 });
|
|
2465
2506
|
return [
|
|
2466
2507
|
[
|
|
2467
2508
|
f.canSortAsc && {
|
|
2468
2509
|
key: "sort-asc",
|
|
2469
2510
|
icon: r(),
|
|
2470
|
-
label:
|
|
2471
|
-
text:
|
|
2511
|
+
label: m.sortAscending,
|
|
2512
|
+
text: m.sortAscending,
|
|
2472
2513
|
run: () => t.sortColumn("ASC")
|
|
2473
2514
|
},
|
|
2474
2515
|
f.canSortDesc && {
|
|
2475
2516
|
key: "sort-desc",
|
|
2476
2517
|
icon: r(180),
|
|
2477
|
-
label:
|
|
2478
|
-
text:
|
|
2518
|
+
label: m.sortDescending,
|
|
2519
|
+
text: m.sortDescending,
|
|
2479
2520
|
run: () => t.sortColumn("DESC")
|
|
2480
2521
|
},
|
|
2481
2522
|
f.canClearSort && {
|
|
2482
2523
|
key: "sort-clear",
|
|
2483
2524
|
icon: s,
|
|
2484
|
-
label:
|
|
2485
|
-
text:
|
|
2525
|
+
label: m.clearSort,
|
|
2526
|
+
text: m.clearSort,
|
|
2486
2527
|
run: () => t.sortColumn(void 0)
|
|
2487
2528
|
}
|
|
2488
2529
|
],
|
|
2489
2530
|
[
|
|
2490
2531
|
f.canPinStart && {
|
|
2491
2532
|
key: "pin-start",
|
|
2492
|
-
icon:
|
|
2493
|
-
label: /* @__PURE__ */
|
|
2533
|
+
icon: i(0, -90),
|
|
2534
|
+
label: /* @__PURE__ */ L(qt, {
|
|
2494
2535
|
side: "start",
|
|
2495
|
-
left:
|
|
2496
|
-
right:
|
|
2536
|
+
left: m.pinLeft,
|
|
2537
|
+
right: m.pinRight
|
|
2497
2538
|
}),
|
|
2498
|
-
text:
|
|
2539
|
+
text: m.pinLeft,
|
|
2499
2540
|
run: () => t.pinColumn("START")
|
|
2500
2541
|
},
|
|
2501
2542
|
f.canPinEnd && {
|
|
2502
2543
|
key: "pin-end",
|
|
2503
|
-
icon:
|
|
2504
|
-
label: /* @__PURE__ */
|
|
2544
|
+
icon: i(-90, 0),
|
|
2545
|
+
label: /* @__PURE__ */ L(qt, {
|
|
2505
2546
|
side: "end",
|
|
2506
|
-
left:
|
|
2507
|
-
right:
|
|
2547
|
+
left: m.pinLeft,
|
|
2548
|
+
right: m.pinRight
|
|
2508
2549
|
}),
|
|
2509
|
-
text:
|
|
2550
|
+
text: m.pinRight,
|
|
2510
2551
|
run: () => t.pinColumn("END")
|
|
2511
2552
|
},
|
|
2512
2553
|
f.canUnpin && {
|
|
2513
2554
|
key: "unpin",
|
|
2514
2555
|
icon: s,
|
|
2515
|
-
label:
|
|
2516
|
-
text:
|
|
2556
|
+
label: m.unpin,
|
|
2557
|
+
text: m.unpin,
|
|
2517
2558
|
run: () => t.pinColumn()
|
|
2518
2559
|
}
|
|
2519
2560
|
],
|
|
2520
2561
|
[f.canGroupBy && {
|
|
2521
2562
|
key: "group",
|
|
2522
2563
|
icon: o,
|
|
2523
|
-
label: /* @__PURE__ */
|
|
2564
|
+
label: /* @__PURE__ */ L(a, {
|
|
2524
2565
|
textWrap: "nowrap",
|
|
2525
|
-
children:
|
|
2566
|
+
children: m.groupBy(p)
|
|
2526
2567
|
}),
|
|
2527
|
-
text:
|
|
2568
|
+
text: m.groupBy(p),
|
|
2528
2569
|
run: t.toggleGrouping
|
|
2529
2570
|
}, f.canUnGroupAll && {
|
|
2530
2571
|
key: "ungroup",
|
|
2531
2572
|
icon: o,
|
|
2532
|
-
label: /* @__PURE__ */
|
|
2573
|
+
label: /* @__PURE__ */ L(a, {
|
|
2533
2574
|
textWrap: "nowrap",
|
|
2534
|
-
children:
|
|
2575
|
+
children: m.ungroupAll
|
|
2535
2576
|
}),
|
|
2536
|
-
text:
|
|
2577
|
+
text: m.ungroupAll,
|
|
2537
2578
|
run: n.unGroupAll
|
|
2538
2579
|
}]
|
|
2539
2580
|
].map((e) => e.filter((e) => e !== !1)).filter((e) => e.length > 0).flatMap((e, t) => e.map((e, n) => ({
|
|
@@ -2542,93 +2583,93 @@ function Gt(e) {
|
|
|
2542
2583
|
})));
|
|
2543
2584
|
}, [
|
|
2544
2585
|
t,
|
|
2545
|
-
|
|
2586
|
+
p,
|
|
2546
2587
|
n,
|
|
2547
2588
|
f,
|
|
2548
|
-
|
|
2549
|
-
]),
|
|
2550
|
-
|
|
2551
|
-
}, []), k =
|
|
2552
|
-
count:
|
|
2553
|
-
textOf: (e) =>
|
|
2589
|
+
m
|
|
2590
|
+
]), O = j((e = !0) => {
|
|
2591
|
+
w.current = !1, x(!1), e && S.current?.focus();
|
|
2592
|
+
}, []), k = u({
|
|
2593
|
+
count: D.length,
|
|
2594
|
+
textOf: (e) => D[e]?.text ?? "",
|
|
2554
2595
|
onSelect: (e) => {
|
|
2555
|
-
|
|
2596
|
+
D[e]?.run(), O();
|
|
2556
2597
|
}
|
|
2557
2598
|
});
|
|
2558
|
-
|
|
2559
|
-
enabled:
|
|
2560
|
-
inside: [S,
|
|
2561
|
-
onDismiss: () =>
|
|
2562
|
-
}),
|
|
2563
|
-
enabled:
|
|
2599
|
+
l({
|
|
2600
|
+
enabled: v,
|
|
2601
|
+
inside: [S, C],
|
|
2602
|
+
onDismiss: () => O()
|
|
2603
|
+
}), s({
|
|
2604
|
+
enabled: v,
|
|
2564
2605
|
returnTo: S
|
|
2565
2606
|
});
|
|
2566
|
-
let A = k.setActiveIndex,
|
|
2567
|
-
A(0, { reason: "programmatic" }),
|
|
2607
|
+
let A = k.setActiveIndex, M = k.activeItem, N = j(() => {
|
|
2608
|
+
A(0, { reason: "programmatic" }), w.current = !0, x(!0);
|
|
2568
2609
|
}, [A]);
|
|
2569
2610
|
return r(() => {
|
|
2570
|
-
if (!
|
|
2571
|
-
let e =
|
|
2572
|
-
e && (
|
|
2573
|
-
}), /* @__PURE__ */
|
|
2611
|
+
if (!w.current) return;
|
|
2612
|
+
let e = M();
|
|
2613
|
+
e && (w.current = !1, e.focus());
|
|
2614
|
+
}), /* @__PURE__ */ R(_, {
|
|
2574
2615
|
position: "absolute",
|
|
2575
|
-
insetStart:
|
|
2576
|
-
insetEnd:
|
|
2616
|
+
insetStart: E,
|
|
2617
|
+
insetEnd: ee,
|
|
2577
2618
|
top: "1/2",
|
|
2578
2619
|
translateY: -3,
|
|
2579
2620
|
ai: "center",
|
|
2580
|
-
children: [/* @__PURE__ */
|
|
2621
|
+
children: [/* @__PURE__ */ L(h, {
|
|
2581
2622
|
ref: S,
|
|
2582
2623
|
component: `${n.componentName}.header.cell.contextMenu`,
|
|
2583
|
-
onClick: () =>
|
|
2624
|
+
onClick: () => v ? O(!1) : N(),
|
|
2584
2625
|
variant: f.contextMenuButtonVariant,
|
|
2585
2626
|
type: "button",
|
|
2586
2627
|
props: {
|
|
2587
2628
|
tabIndex: -1,
|
|
2588
|
-
"aria-label":
|
|
2629
|
+
"aria-label": m.columnOptions(p),
|
|
2589
2630
|
"aria-haspopup": "menu",
|
|
2590
|
-
"aria-expanded":
|
|
2591
|
-
"aria-controls":
|
|
2631
|
+
"aria-expanded": v,
|
|
2632
|
+
"aria-controls": v ? g : void 0
|
|
2592
2633
|
},
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2634
|
+
children: /* @__PURE__ */ L(T, {
|
|
2594
2635
|
component: `${n.componentName}.header.cell.contextMenu.icon`,
|
|
2595
|
-
children: /* @__PURE__ */
|
|
2636
|
+
children: /* @__PURE__ */ L(Wt, { fill: "currentColor" })
|
|
2596
2637
|
})
|
|
2597
|
-
}), /* @__PURE__ */
|
|
2598
|
-
present:
|
|
2599
|
-
children: (e) => /* @__PURE__ */
|
|
2638
|
+
}), /* @__PURE__ */ L(b, {
|
|
2639
|
+
present: v,
|
|
2640
|
+
children: (e) => /* @__PURE__ */ L(y, {
|
|
2600
2641
|
component: `${n.componentName}.header.cell.contextMenu.tooltip`,
|
|
2601
2642
|
variant: { closed: !e.present },
|
|
2602
|
-
ref:
|
|
2643
|
+
ref: C,
|
|
2603
2644
|
contentRef: e.ref,
|
|
2604
2645
|
anchor: S,
|
|
2605
2646
|
side: "bottom",
|
|
2606
2647
|
align: "end",
|
|
2607
2648
|
matchWidth: !1,
|
|
2608
|
-
id:
|
|
2649
|
+
id: g,
|
|
2609
2650
|
props: {
|
|
2610
2651
|
role: "menu",
|
|
2611
|
-
"aria-label":
|
|
2652
|
+
"aria-label": m.columnOptions(p),
|
|
2612
2653
|
onKeyDown: k.onKeyDown,
|
|
2613
2654
|
...e.props
|
|
2614
2655
|
},
|
|
2615
|
-
children:
|
|
2616
|
-
let { ref: r, tabIndex:
|
|
2617
|
-
return /* @__PURE__ */
|
|
2656
|
+
children: D.map((e, t) => {
|
|
2657
|
+
let { ref: r, tabIndex: i, onFocus: o } = k.itemProps(t);
|
|
2658
|
+
return /* @__PURE__ */ R(te, { children: [e.startsSection && /* @__PURE__ */ L(a, {
|
|
2618
2659
|
bb: 1,
|
|
2619
2660
|
my: 2,
|
|
2620
|
-
borderColor: "
|
|
2661
|
+
borderColor: "base-300",
|
|
2621
2662
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.separator`
|
|
2622
|
-
}), /* @__PURE__ */
|
|
2663
|
+
}), /* @__PURE__ */ R(h, {
|
|
2623
2664
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item`,
|
|
2624
2665
|
ref: r,
|
|
2625
2666
|
type: "button",
|
|
2626
2667
|
onClick: (t) => {
|
|
2627
|
-
t.stopPropagation(), e.run(),
|
|
2668
|
+
t.stopPropagation(), e.run(), O();
|
|
2628
2669
|
},
|
|
2629
2670
|
props: {
|
|
2630
2671
|
role: "menuitem",
|
|
2631
|
-
tabIndex:
|
|
2672
|
+
tabIndex: i,
|
|
2632
2673
|
onFocus: o
|
|
2633
2674
|
},
|
|
2634
2675
|
children: [e.icon, e.label]
|
|
@@ -2638,27 +2679,27 @@ function Gt(e) {
|
|
|
2638
2679
|
})]
|
|
2639
2680
|
});
|
|
2640
2681
|
}
|
|
2641
|
-
|
|
2682
|
+
Jt.displayName = "DataGridHeaderCellContextMenu";
|
|
2642
2683
|
//#endregion
|
|
2643
2684
|
//#region src/components/dataGrid/components/dataGridHeaderCellResizer.tsx
|
|
2644
|
-
var
|
|
2645
|
-
function
|
|
2646
|
-
let { column: t, controls: n } = e, r = t.grid.resizerStyle,
|
|
2685
|
+
var Yt = (e) => "touches" in e ? e.touches[0]?.pageX ?? 0 : e.pageX, Xt = 16, Zt = 150;
|
|
2686
|
+
function Qt(e) {
|
|
2687
|
+
let { column: t, controls: n } = e, r = t.grid.resizerStyle, i = t.headerCell, o = j((e) => {
|
|
2647
2688
|
let { grid: n } = t;
|
|
2648
|
-
e.type === "mousedown" && e.preventDefault(), t.beginResize(
|
|
2649
|
-
let r = new AbortController(), { signal: i } = r, a = 0, o =
|
|
2689
|
+
e.type === "mousedown" && e.preventDefault(), t.beginResize(Yt(e.nativeEvent));
|
|
2690
|
+
let r = new AbortController(), { signal: i } = r, a = 0, o = Yt(e.nativeEvent), s = () => {
|
|
2650
2691
|
t.applyResize(o), n.paintSizes();
|
|
2651
2692
|
}, c = n.resizeMode === "instant" ? (e) => {
|
|
2652
|
-
o =
|
|
2693
|
+
o = Yt(e), s();
|
|
2653
2694
|
} : (e) => {
|
|
2654
|
-
o =
|
|
2695
|
+
o = Yt(e), a ||= requestAnimationFrame(() => {
|
|
2655
2696
|
a = 0, s();
|
|
2656
2697
|
});
|
|
2657
2698
|
}, l = () => {
|
|
2658
2699
|
r.abort(), a && cancelAnimationFrame(a), s(), t.endResize();
|
|
2659
2700
|
};
|
|
2660
2701
|
window.addEventListener("mousemove", c, { signal: i }), window.addEventListener("touchmove", c, { signal: i }), window.addEventListener("mouseup", l, { signal: i }), window.addEventListener("touchend", l, { signal: i });
|
|
2661
|
-
}, [t]), s =
|
|
2702
|
+
}, [t]), s = P(void 0), c = P(0), l = j(() => {
|
|
2662
2703
|
let { grid: e } = t;
|
|
2663
2704
|
if (e.resizeMode === "instant") {
|
|
2664
2705
|
e.paintSizes();
|
|
@@ -2667,36 +2708,36 @@ function Yt(e) {
|
|
|
2667
2708
|
c.current ||= requestAnimationFrame(() => {
|
|
2668
2709
|
c.current = 0, e.paintSizes();
|
|
2669
2710
|
});
|
|
2670
|
-
}, [t]), u =
|
|
2711
|
+
}, [t]), u = j(() => {
|
|
2671
2712
|
s.current !== void 0 && (clearTimeout(s.current), s.current = void 0, c.current &&= (cancelAnimationFrame(c.current), 0), t.endResize());
|
|
2672
2713
|
}, [t]);
|
|
2673
|
-
|
|
2714
|
+
N(() => () => {
|
|
2674
2715
|
clearTimeout(s.current), c.current && cancelAnimationFrame(c.current);
|
|
2675
2716
|
}, []);
|
|
2676
|
-
let d =
|
|
2717
|
+
let d = j((e) => {
|
|
2677
2718
|
switch (e.key) {
|
|
2678
2719
|
case "ArrowRight":
|
|
2679
|
-
t.moveResizer(
|
|
2720
|
+
t.moveResizer(Xt);
|
|
2680
2721
|
break;
|
|
2681
2722
|
case "ArrowLeft":
|
|
2682
2723
|
t.moveResizer(-16);
|
|
2683
2724
|
break;
|
|
2684
2725
|
case "Home":
|
|
2685
|
-
t.resizeWidthTo(
|
|
2726
|
+
t.resizeWidthTo(i.minWidth);
|
|
2686
2727
|
break;
|
|
2687
2728
|
case "End":
|
|
2688
|
-
t.resizeWidthTo(
|
|
2729
|
+
t.resizeWidthTo(i.maxWidth);
|
|
2689
2730
|
break;
|
|
2690
2731
|
default: return;
|
|
2691
2732
|
}
|
|
2692
|
-
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u,
|
|
2733
|
+
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u, Zt);
|
|
2693
2734
|
}, [
|
|
2694
2735
|
t,
|
|
2695
2736
|
u,
|
|
2696
|
-
|
|
2737
|
+
i,
|
|
2697
2738
|
l
|
|
2698
|
-
]), { isAtGridEnd: f } =
|
|
2699
|
-
return /* @__PURE__ */
|
|
2739
|
+
]), { isAtGridEnd: f } = i;
|
|
2740
|
+
return /* @__PURE__ */ L(_, {
|
|
2700
2741
|
height: "fit",
|
|
2701
2742
|
ai: "center",
|
|
2702
2743
|
position: "absolute",
|
|
@@ -2704,7 +2745,7 @@ function Yt(e) {
|
|
|
2704
2745
|
insetStart: t.pin === "END" ? -.75 : void 0,
|
|
2705
2746
|
zIndex: 1,
|
|
2706
2747
|
py: 3,
|
|
2707
|
-
children: /* @__PURE__ */
|
|
2748
|
+
children: /* @__PURE__ */ L(a, {
|
|
2708
2749
|
cursor: "col-resize",
|
|
2709
2750
|
px: f ? void 0 : .75,
|
|
2710
2751
|
ps: f ? 1.5 : void 0,
|
|
@@ -2715,19 +2756,19 @@ function Yt(e) {
|
|
|
2715
2756
|
onMouseDown: o,
|
|
2716
2757
|
onTouchStart: o
|
|
2717
2758
|
},
|
|
2718
|
-
children: /* @__PURE__ */
|
|
2759
|
+
children: /* @__PURE__ */ L(a, {
|
|
2719
2760
|
component: `${t.grid.componentName}.header.cell.resizer`,
|
|
2720
2761
|
opacity: r === "visible" ? void 0 : 0,
|
|
2721
2762
|
group: r === "hover" ? { "header-cell/hover": { opacity: 1 } } : void 0,
|
|
2722
2763
|
props: {
|
|
2723
2764
|
role: "separator",
|
|
2724
|
-
"aria-label":
|
|
2765
|
+
"aria-label": i.resizerLabel,
|
|
2725
2766
|
"aria-controls": n,
|
|
2726
2767
|
"aria-orientation": "vertical",
|
|
2727
|
-
"aria-valuenow":
|
|
2728
|
-
"aria-valuemin":
|
|
2729
|
-
"aria-valuemax":
|
|
2730
|
-
"aria-valuetext": t.grid.localeText.columnWidth(
|
|
2768
|
+
"aria-valuenow": i.width,
|
|
2769
|
+
"aria-valuemin": i.minWidth,
|
|
2770
|
+
"aria-valuemax": i.maxWidth,
|
|
2771
|
+
"aria-valuetext": t.grid.localeText.columnWidth(i.width),
|
|
2731
2772
|
tabIndex: -1,
|
|
2732
2773
|
onKeyDown: d,
|
|
2733
2774
|
onKeyUp: u
|
|
@@ -2736,28 +2777,28 @@ function Yt(e) {
|
|
|
2736
2777
|
})
|
|
2737
2778
|
});
|
|
2738
2779
|
}
|
|
2739
|
-
|
|
2780
|
+
Qt.displayName = "DataGridHeaderCellResizer";
|
|
2740
2781
|
//#endregion
|
|
2741
2782
|
//#region src/components/dataGrid/components/dataGridHeaderCell.tsx
|
|
2742
|
-
function
|
|
2743
|
-
let { column: t, row: n, columnIndex: r } = e, { grid:
|
|
2744
|
-
|
|
2745
|
-
}, [
|
|
2783
|
+
function $t(e) {
|
|
2784
|
+
let { column: t, row: n, columnIndex: r } = e, { grid: i } = t, { isStartPinned: o, isEndPinned: s } = t.pinFlags.value, c = t.headerCell, { isSortable: l, showResizer: u, showContextMenu: f, paddingStart: p, paddingEnd: m } = c, { ref: h, tabIndex: y, onFocus: b } = be(z(), n, r), x = d("datagrid-columnheader"), S = P(null), C = j(() => {
|
|
2785
|
+
i.toggleSelectAllRows();
|
|
2786
|
+
}, [i]), w = t.isRowSelection ? /* @__PURE__ */ L(v, {
|
|
2746
2787
|
variant: "datagrid",
|
|
2747
2788
|
m: 1,
|
|
2748
|
-
indeterminate:
|
|
2749
|
-
checked:
|
|
2789
|
+
indeterminate: i.someRowsSelected && !i.allRowsSelected,
|
|
2790
|
+
checked: i.allRowsSelected,
|
|
2750
2791
|
onChange: C,
|
|
2751
2792
|
props: {
|
|
2752
2793
|
tabIndex: -1,
|
|
2753
|
-
"aria-label":
|
|
2794
|
+
"aria-label": i.localeText.selectAllRows
|
|
2754
2795
|
}
|
|
2755
|
-
}) : c.hiddenLabel ? /* @__PURE__ */
|
|
2796
|
+
}) : c.hiddenLabel ? /* @__PURE__ */ L(g, {
|
|
2756
2797
|
tag: "span",
|
|
2757
2798
|
children: c.hiddenLabel
|
|
2758
2799
|
}) : c.label;
|
|
2759
|
-
return /* @__PURE__ */
|
|
2760
|
-
ref:
|
|
2800
|
+
return /* @__PURE__ */ L(_, {
|
|
2801
|
+
ref: h,
|
|
2761
2802
|
id: x,
|
|
2762
2803
|
props: {
|
|
2763
2804
|
role: "columnheader",
|
|
@@ -2773,7 +2814,7 @@ function Xt(e) {
|
|
|
2773
2814
|
} : void 0
|
|
2774
2815
|
},
|
|
2775
2816
|
className: "header-cell",
|
|
2776
|
-
component: `${
|
|
2817
|
+
component: `${i.componentName}.header.cell`,
|
|
2777
2818
|
variant: c.variant,
|
|
2778
2819
|
gridRow: t.gridRows,
|
|
2779
2820
|
gridColumn: c.gridColumn,
|
|
@@ -2782,29 +2823,29 @@ function Xt(e) {
|
|
|
2782
2823
|
insetInlineStart: o ? `var(${t.inlineStartVarName})` : void 0,
|
|
2783
2824
|
insetInlineEnd: s ? `var(${t.inlineEndVarName})` : void 0
|
|
2784
2825
|
},
|
|
2785
|
-
children: /* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2826
|
+
children: /* @__PURE__ */ R(I, { children: [
|
|
2827
|
+
/* @__PURE__ */ L(_, {
|
|
2787
2828
|
width: "fit",
|
|
2788
2829
|
height: "fit",
|
|
2789
2830
|
jc: t.align,
|
|
2790
|
-
children: /* @__PURE__ */
|
|
2831
|
+
children: /* @__PURE__ */ R(_, {
|
|
2791
2832
|
overflow: "hidden",
|
|
2792
2833
|
position: t.isLeaf ? void 0 : "sticky",
|
|
2793
2834
|
ai: "center",
|
|
2794
2835
|
transition: "none",
|
|
2795
2836
|
ps: p,
|
|
2796
|
-
pe:
|
|
2797
|
-
style: { insetInlineStart: t.pin ? void 0 : `var(${
|
|
2837
|
+
pe: m,
|
|
2838
|
+
style: { insetInlineStart: t.pin ? void 0 : `var(${i.inlineStartEdgeVarName})` },
|
|
2798
2839
|
children: [
|
|
2799
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ L(a, {
|
|
2800
2841
|
overflow: "hidden",
|
|
2801
2842
|
textOverflow: "ellipsis",
|
|
2802
2843
|
textWrap: "nowrap",
|
|
2803
2844
|
children: w
|
|
2804
2845
|
}),
|
|
2805
|
-
c.isSorted && /* @__PURE__ */
|
|
2846
|
+
c.isSorted && /* @__PURE__ */ L(a, {
|
|
2806
2847
|
ps: (t.inlineWidth ?? 0) < 58 ? 0 : 2,
|
|
2807
|
-
children: /* @__PURE__ */
|
|
2848
|
+
children: /* @__PURE__ */ L(Ut, {
|
|
2808
2849
|
width: "16px",
|
|
2809
2850
|
rotate: c.sortDirection === "ASC" ? 0 : 180,
|
|
2810
2851
|
transition: "transform",
|
|
@@ -2814,37 +2855,37 @@ function Xt(e) {
|
|
|
2814
2855
|
fill: "currentColor"
|
|
2815
2856
|
})
|
|
2816
2857
|
}),
|
|
2817
|
-
f && /* @__PURE__ */
|
|
2858
|
+
f && /* @__PURE__ */ L(a, { minWidth: t.isEndAligned ? 4 : 10 })
|
|
2818
2859
|
]
|
|
2819
2860
|
})
|
|
2820
2861
|
}),
|
|
2821
|
-
|
|
2862
|
+
u && /* @__PURE__ */ L(Qt, {
|
|
2822
2863
|
column: t,
|
|
2823
2864
|
controls: x
|
|
2824
2865
|
}),
|
|
2825
|
-
f && /* @__PURE__ */
|
|
2866
|
+
f && /* @__PURE__ */ L(Jt, { column: t })
|
|
2826
2867
|
] })
|
|
2827
2868
|
});
|
|
2828
2869
|
}
|
|
2829
|
-
|
|
2870
|
+
$t.displayName = "DataGridHeaderCell";
|
|
2830
2871
|
//#endregion
|
|
2831
2872
|
//#region src/components/dataGrid/components/dataGridHeader.tsx
|
|
2832
|
-
function
|
|
2833
|
-
let { grid: t } = e, n =
|
|
2873
|
+
function en(e) {
|
|
2874
|
+
let { grid: t } = e, n = P(null), [r, i] = F(X.INITIAL), o = t.headerHover === "sliding", s = (e) => {
|
|
2834
2875
|
let t = n.current;
|
|
2835
2876
|
if (!o || !t || e.pointerType === "touch") return;
|
|
2836
|
-
if (X.isOnResizer(e.target)) return
|
|
2837
|
-
let r = X.cellAt(t, e.target),
|
|
2838
|
-
|
|
2839
|
-
}, c = () =>
|
|
2840
|
-
|
|
2877
|
+
if (X.isOnResizer(e.target)) return i((e) => X.pause(e));
|
|
2878
|
+
let r = X.cellAt(t, e.target), a = r && X.bounds(t, r);
|
|
2879
|
+
i((e) => X.hover(e, a));
|
|
2880
|
+
}, c = () => i((e) => X.hover(e, void 0)), l = r.visible || r.paused;
|
|
2881
|
+
N(() => {
|
|
2841
2882
|
if (l) return document.addEventListener("scroll", c, {
|
|
2842
2883
|
capture: !0,
|
|
2843
2884
|
passive: !0
|
|
2844
2885
|
}), () => document.removeEventListener("scroll", c, { capture: !0 });
|
|
2845
2886
|
}, [l]);
|
|
2846
2887
|
let { bounds: u } = r;
|
|
2847
|
-
return /* @__PURE__ */
|
|
2888
|
+
return /* @__PURE__ */ R(C, {
|
|
2848
2889
|
ref: n,
|
|
2849
2890
|
component: `${t.componentName}.header`,
|
|
2850
2891
|
props: {
|
|
@@ -2854,20 +2895,20 @@ function Zt(e) {
|
|
|
2854
2895
|
},
|
|
2855
2896
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
2856
2897
|
children: [
|
|
2857
|
-
t.headerRows.value.map((e, t) => /* @__PURE__ */
|
|
2898
|
+
t.headerRows.value.map((e, t) => /* @__PURE__ */ L(a, {
|
|
2858
2899
|
display: "contents",
|
|
2859
2900
|
props: {
|
|
2860
2901
|
role: "row",
|
|
2861
2902
|
"aria-rowindex": t + 1
|
|
2862
2903
|
},
|
|
2863
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2904
|
+
children: e.map((e, n) => /* @__PURE__ */ L($t, {
|
|
2864
2905
|
column: e,
|
|
2865
2906
|
row: t,
|
|
2866
2907
|
columnIndex: n
|
|
2867
2908
|
}, e.uniqueKey))
|
|
2868
2909
|
}, t)),
|
|
2869
|
-
/* @__PURE__ */
|
|
2870
|
-
o && u && /* @__PURE__ */
|
|
2910
|
+
/* @__PURE__ */ L(Ht, { grid: t }),
|
|
2911
|
+
o && u && /* @__PURE__ */ L(a, {
|
|
2871
2912
|
tag: "span",
|
|
2872
2913
|
component: `${t.componentName}.header.hover`,
|
|
2873
2914
|
variant: {
|
|
@@ -2886,65 +2927,65 @@ function Zt(e) {
|
|
|
2886
2927
|
]
|
|
2887
2928
|
});
|
|
2888
2929
|
}
|
|
2889
|
-
|
|
2890
|
-
var
|
|
2930
|
+
en.displayName = "DataGridHeader";
|
|
2931
|
+
var tn = A(en);
|
|
2891
2932
|
//#endregion
|
|
2892
2933
|
//#region src/components/dataGrid/components/dataGridLoader.tsx
|
|
2893
|
-
function
|
|
2934
|
+
function nn(e) {
|
|
2894
2935
|
let { grid: t } = e;
|
|
2895
|
-
return /* @__PURE__ */
|
|
2936
|
+
return /* @__PURE__ */ L(a, {
|
|
2896
2937
|
component: `${t.componentName}.loader`,
|
|
2897
2938
|
props: { "aria-hidden": !0 },
|
|
2898
|
-
children: /* @__PURE__ */
|
|
2939
|
+
children: /* @__PURE__ */ L(a, {
|
|
2899
2940
|
component: `${t.componentName}.loader.track`,
|
|
2900
2941
|
style: { height: 3 },
|
|
2901
|
-
children: /* @__PURE__ */
|
|
2942
|
+
children: /* @__PURE__ */ L(a, {
|
|
2902
2943
|
component: `${t.componentName}.loader.track.bar`,
|
|
2903
2944
|
width: "2/5"
|
|
2904
2945
|
})
|
|
2905
2946
|
})
|
|
2906
2947
|
});
|
|
2907
2948
|
}
|
|
2908
|
-
|
|
2949
|
+
nn.displayName = "DataGridLoader";
|
|
2909
2950
|
//#endregion
|
|
2910
2951
|
//#region src/components/dataGrid/components/dataGridContent.tsx
|
|
2911
|
-
function
|
|
2912
|
-
let { grid: t } = e, n =
|
|
2952
|
+
function rn(e) {
|
|
2953
|
+
let { grid: t } = e, n = P(null), [i, o] = F({
|
|
2913
2954
|
top: 0,
|
|
2914
2955
|
direction: "down"
|
|
2915
|
-
}), s =
|
|
2956
|
+
}), s = P(null), c = j((e) => {
|
|
2916
2957
|
o((t) => e === t.top ? t : {
|
|
2917
2958
|
top: e,
|
|
2918
|
-
direction:
|
|
2959
|
+
direction: xe.directionOf(t.top, e, t.direction)
|
|
2919
2960
|
});
|
|
2920
|
-
}, []), l =
|
|
2961
|
+
}, []), l = j((e) => {
|
|
2921
2962
|
s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
|
|
2922
2963
|
c(e.target.scrollTop), s.current = null;
|
|
2923
2964
|
});
|
|
2924
|
-
}, [c]), { navigation: u, onKeyDown: d } =
|
|
2965
|
+
}, [c]), { navigation: u, onKeyDown: d } = Ke({
|
|
2925
2966
|
grid: t,
|
|
2926
2967
|
scrollerRef: n,
|
|
2927
|
-
scroll:
|
|
2968
|
+
scroll: i,
|
|
2928
2969
|
onScrollTo: c
|
|
2929
2970
|
}), { source: f } = t, { queryVersion: p } = f;
|
|
2930
2971
|
r(() => {
|
|
2931
2972
|
f.enabled && n.current && (n.current.scrollTop = 0);
|
|
2932
|
-
}, [f, p]),
|
|
2973
|
+
}, [f, p]), N(() => {
|
|
2933
2974
|
if (!f.enabled) return;
|
|
2934
|
-
let { startIndex: e, take: r } = t.viewport.window(n.current?.scrollTop ?? 0,
|
|
2975
|
+
let { startIndex: e, take: r } = t.viewport.window(n.current?.scrollTop ?? 0, i.direction);
|
|
2935
2976
|
f.request(e, e + r);
|
|
2936
2977
|
}, [
|
|
2937
2978
|
t,
|
|
2938
2979
|
f,
|
|
2939
2980
|
p,
|
|
2940
|
-
|
|
2981
|
+
i,
|
|
2941
2982
|
t.totalRowCount,
|
|
2942
2983
|
t.page,
|
|
2943
2984
|
t.pageSize,
|
|
2944
2985
|
t.expansionVersion
|
|
2945
2986
|
]);
|
|
2946
2987
|
let { range: m } = t, { isDragging: h } = m;
|
|
2947
|
-
return
|
|
2988
|
+
return N(() => {
|
|
2948
2989
|
if (h) return window.addEventListener("pointerup", m.endDrag), window.addEventListener("pointercancel", m.endDrag), () => {
|
|
2949
2990
|
window.removeEventListener("pointerup", m.endDrag), window.removeEventListener("pointercancel", m.endDrag);
|
|
2950
2991
|
};
|
|
@@ -2955,9 +2996,9 @@ function en(e) {
|
|
|
2955
2996
|
t.setContainerWidth(e.clientWidth), t.paintSizes();
|
|
2956
2997
|
});
|
|
2957
2998
|
return r.observe(e), () => r.disconnect();
|
|
2958
|
-
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */
|
|
2999
|
+
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */ L(ve.Provider, {
|
|
2959
3000
|
value: u,
|
|
2960
|
-
children: /* @__PURE__ */
|
|
3001
|
+
children: /* @__PURE__ */ R(a, {
|
|
2961
3002
|
ref: n,
|
|
2962
3003
|
component: `${t.componentName}.content`,
|
|
2963
3004
|
overflowX: "auto",
|
|
@@ -2975,33 +3016,33 @@ function en(e) {
|
|
|
2975
3016
|
onPaste: m.onPaste
|
|
2976
3017
|
},
|
|
2977
3018
|
children: [
|
|
2978
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ L(tn, {
|
|
2979
3020
|
grid: t,
|
|
2980
3021
|
version: t.headerVersion
|
|
2981
3022
|
}),
|
|
2982
|
-
(t.props.loading || f.isLoading) && /* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
3023
|
+
(t.props.loading || f.isLoading) && /* @__PURE__ */ L(nn, { grid: t }),
|
|
3024
|
+
/* @__PURE__ */ L(kt, {
|
|
2984
3025
|
grid: t,
|
|
2985
|
-
scroll:
|
|
3026
|
+
scroll: i
|
|
2986
3027
|
})
|
|
2987
3028
|
]
|
|
2988
3029
|
})
|
|
2989
|
-
}) : /* @__PURE__ */
|
|
3030
|
+
}) : /* @__PURE__ */ L(At, { grid: t });
|
|
2990
3031
|
}
|
|
2991
|
-
|
|
3032
|
+
rn.displayName = "DataGridContent";
|
|
2992
3033
|
//#endregion
|
|
2993
3034
|
//#region src/components/dataGrid/components/dataGridDataSourceError.tsx
|
|
2994
|
-
function
|
|
3035
|
+
function an(e) {
|
|
2995
3036
|
let { grid: t } = e, { error: n } = t.source;
|
|
2996
3037
|
if (n === void 0) return null;
|
|
2997
3038
|
let r = n instanceof Error && n.message ? n.message : t.localeText.loadError;
|
|
2998
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ R(_, {
|
|
2999
3040
|
component: `${t.componentName}.error`,
|
|
3000
3041
|
props: { role: "alert" },
|
|
3001
|
-
children: [/* @__PURE__ */
|
|
3042
|
+
children: [/* @__PURE__ */ L(a, {
|
|
3002
3043
|
component: `${t.componentName}.error.message`,
|
|
3003
3044
|
children: r
|
|
3004
|
-
}), /* @__PURE__ */
|
|
3045
|
+
}), /* @__PURE__ */ L(h, {
|
|
3005
3046
|
component: `${t.componentName}.error.retry`,
|
|
3006
3047
|
type: "button",
|
|
3007
3048
|
onClick: t.source.retry,
|
|
@@ -3009,87 +3050,87 @@ function tn(e) {
|
|
|
3009
3050
|
})]
|
|
3010
3051
|
});
|
|
3011
3052
|
}
|
|
3012
|
-
|
|
3053
|
+
an.displayName = "DataGridDataSourceError";
|
|
3013
3054
|
//#endregion
|
|
3014
3055
|
//#region src/components/dataGrid/components/dataGridColumnGroups.tsx
|
|
3015
|
-
function
|
|
3056
|
+
function on(e) {
|
|
3016
3057
|
let { grid: t } = e;
|
|
3017
|
-
return t.groupColumns.size === 0 ? null : /* @__PURE__ */
|
|
3058
|
+
return t.groupColumns.size === 0 ? null : /* @__PURE__ */ R(_, {
|
|
3018
3059
|
component: `${t.componentName}.topBar.columnGroups`,
|
|
3019
|
-
children: [/* @__PURE__ */
|
|
3060
|
+
children: [/* @__PURE__ */ L(T, {
|
|
3020
3061
|
component: `${t.componentName}.topBar.columnGroups.icon`,
|
|
3021
|
-
children: /* @__PURE__ */
|
|
3062
|
+
children: /* @__PURE__ */ L(Gt, {
|
|
3022
3063
|
width: "100%",
|
|
3023
3064
|
fill: "currentColor"
|
|
3024
3065
|
})
|
|
3025
|
-
}), t.groupedColumns.map((e) => /* @__PURE__ */
|
|
3066
|
+
}), t.groupedColumns.map((e) => /* @__PURE__ */ R(D.Fragment, { children: [/* @__PURE__ */ L(Y, {
|
|
3026
3067
|
fill: "currentColor",
|
|
3027
3068
|
width: "14px",
|
|
3028
3069
|
height: "14px",
|
|
3029
3070
|
rotate: -90
|
|
3030
|
-
}), /* @__PURE__ */
|
|
3071
|
+
}), /* @__PURE__ */ R(_, {
|
|
3031
3072
|
component: `${t.componentName}.topBar.columnGroups.item`,
|
|
3032
|
-
children: [e.header ?? e.key, /* @__PURE__ */
|
|
3073
|
+
children: [e.header ?? e.key, /* @__PURE__ */ L(h, {
|
|
3033
3074
|
component: `${t.componentName}.topBar.columnGroups.item.icon`,
|
|
3034
3075
|
onClick: () => t.toggleGrouping(e.key),
|
|
3035
3076
|
props: { "aria-label": t.localeText.stopGrouping(String(e.header ?? e.key)) },
|
|
3036
|
-
children: /* @__PURE__ */
|
|
3077
|
+
children: /* @__PURE__ */ L(a, {
|
|
3037
3078
|
fontSize: 10,
|
|
3038
|
-
color: "
|
|
3039
|
-
hover: { color: "
|
|
3079
|
+
color: "base-400",
|
|
3080
|
+
hover: { color: "base-600" },
|
|
3040
3081
|
children: "✕"
|
|
3041
3082
|
})
|
|
3042
3083
|
})]
|
|
3043
3084
|
})] }, e.key))]
|
|
3044
3085
|
});
|
|
3045
3086
|
}
|
|
3046
|
-
|
|
3087
|
+
on.displayName = "DataGridColumnGroups";
|
|
3047
3088
|
//#endregion
|
|
3048
3089
|
//#region src/icons/searchIcon.tsx
|
|
3049
|
-
function
|
|
3050
|
-
return /* @__PURE__ */
|
|
3090
|
+
function sn(e) {
|
|
3091
|
+
return /* @__PURE__ */ L(m, {
|
|
3051
3092
|
viewBox: "0 0 488.4 488.4",
|
|
3052
3093
|
width: "1.5rem",
|
|
3053
3094
|
...e,
|
|
3054
|
-
children: /* @__PURE__ */
|
|
3095
|
+
children: /* @__PURE__ */ L(p, { d: "M0 203.25c0 112.1 91.2 203.2 203.2 203.2 51.6 0 98.8-19.4 134.7-51.2l129.5 129.5c2.4 2.4 5.5 3.6 8.7 3.6s6.3-1.2 8.7-3.6c4.8-4.8 4.8-12.5 0-17.3l-129.6-129.5c31.8-35.9 51.2-83 51.2-134.7C406.4 91.15 315.2.05 203.2.05S0 91.15 0 203.25zm381.9 0c0 98.5-80.2 178.7-178.7 178.7s-178.7-80.2-178.7-178.7 80.2-178.7 178.7-178.7 178.7 80.1 178.7 178.7z" })
|
|
3055
3096
|
});
|
|
3056
3097
|
}
|
|
3057
3098
|
//#endregion
|
|
3058
3099
|
//#region src/components/dataGrid/components/dataGridColumnsPanel.tsx
|
|
3059
|
-
var
|
|
3060
|
-
function
|
|
3061
|
-
let { grid: t } = e, { columnVisibility: n, localeText: r, componentName:
|
|
3062
|
-
u(e), e ||
|
|
3100
|
+
var cn = 6;
|
|
3101
|
+
function ln(e) {
|
|
3102
|
+
let { grid: t } = e, { columnVisibility: n, localeText: r, componentName: i } = t, { visibleCount: o, total: s, hasHidden: c } = n, [l, u] = F(!1), [d, g] = F(""), _ = j((e) => {
|
|
3103
|
+
u(e), e || g("");
|
|
3063
3104
|
}, []);
|
|
3064
|
-
return /* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ L(f, { children: /* @__PURE__ */ L(E, {
|
|
3065
3106
|
label: r.columnsMenu,
|
|
3066
3107
|
side: "bottom",
|
|
3067
3108
|
align: "end",
|
|
3068
3109
|
open: l,
|
|
3069
|
-
onOpenChange:
|
|
3110
|
+
onOpenChange: _,
|
|
3070
3111
|
autoFocus: !1,
|
|
3071
3112
|
p: 0,
|
|
3072
3113
|
overflow: "visible",
|
|
3073
|
-
trigger: (e) => /* @__PURE__ */
|
|
3114
|
+
trigger: (e) => /* @__PURE__ */ R(h, {
|
|
3074
3115
|
...e,
|
|
3075
|
-
component: `${
|
|
3116
|
+
component: `${i}.topBar.columnVisibility`,
|
|
3076
3117
|
props: {
|
|
3077
3118
|
...e.props,
|
|
3078
3119
|
"aria-label": c ? r.columnsMenuLabel(o, s) : void 0
|
|
3079
3120
|
},
|
|
3080
3121
|
children: [
|
|
3081
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ L(m, {
|
|
3082
3123
|
viewBox: "0 0 20 20",
|
|
3083
3124
|
width: 16,
|
|
3084
3125
|
height: 16,
|
|
3085
3126
|
fill: "none",
|
|
3086
3127
|
stroke: "currentColor",
|
|
3087
3128
|
strokeWidth: 1.6,
|
|
3088
|
-
children: /* @__PURE__ */
|
|
3129
|
+
children: /* @__PURE__ */ L(p, { d: "M4.5 3.5h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1ZM8 3.5v13M12 3.5v13" })
|
|
3089
3130
|
}),
|
|
3090
3131
|
r.columnsMenu,
|
|
3091
|
-
c && /* @__PURE__ */
|
|
3092
|
-
component: `${
|
|
3132
|
+
c && /* @__PURE__ */ R(a, {
|
|
3133
|
+
component: `${i}.topBar.columnVisibility.badge`,
|
|
3093
3134
|
tag: "span",
|
|
3094
3135
|
variant: { empty: o === 0 },
|
|
3095
3136
|
props: { "aria-hidden": !0 },
|
|
@@ -3101,21 +3142,21 @@ function on(e) {
|
|
|
3101
3142
|
})
|
|
3102
3143
|
]
|
|
3103
3144
|
}),
|
|
3104
|
-
children: /* @__PURE__ */
|
|
3145
|
+
children: /* @__PURE__ */ L(un, {
|
|
3105
3146
|
grid: t,
|
|
3106
3147
|
open: l,
|
|
3107
|
-
query:
|
|
3108
|
-
onQueryChange:
|
|
3148
|
+
query: d,
|
|
3149
|
+
onQueryChange: g
|
|
3109
3150
|
})
|
|
3110
|
-
});
|
|
3151
|
+
}) });
|
|
3111
3152
|
}
|
|
3112
|
-
|
|
3113
|
-
function
|
|
3114
|
-
let { columnVisibility:
|
|
3115
|
-
|
|
3153
|
+
ln.displayName = "DataGridColumnsPanel";
|
|
3154
|
+
function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
3155
|
+
let { columnVisibility: i, localeText: o, componentName: s } = e, c = `${s}.topBar.columnVisibility`, l = P(null), u = P(null), d = i.total > cn, f = i.search(n), p = i.sections(f), m = f.every((e) => e.visible), g = f.every((e) => !e.visible);
|
|
3156
|
+
N(() => {
|
|
3116
3157
|
t && (u.current ?? l.current?.querySelector("input"))?.focus();
|
|
3117
3158
|
}, [t]);
|
|
3118
|
-
let v =
|
|
3159
|
+
let v = j((e) => {
|
|
3119
3160
|
if (![
|
|
3120
3161
|
"ArrowDown",
|
|
3121
3162
|
"ArrowUp",
|
|
@@ -3132,20 +3173,20 @@ function sn({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3132
3173
|
}[e.key];
|
|
3133
3174
|
e.preventDefault(), i?.focus();
|
|
3134
3175
|
}, []);
|
|
3135
|
-
return /* @__PURE__ */
|
|
3176
|
+
return /* @__PURE__ */ R(_, {
|
|
3136
3177
|
ref: l,
|
|
3137
3178
|
component: `${c}.panel`,
|
|
3138
3179
|
props: { onKeyDown: v },
|
|
3139
3180
|
children: [
|
|
3140
|
-
d && /* @__PURE__ */
|
|
3181
|
+
d && /* @__PURE__ */ R(_, {
|
|
3141
3182
|
component: `${c}.search`,
|
|
3142
|
-
children: [/* @__PURE__ */
|
|
3183
|
+
children: [/* @__PURE__ */ L(_, {
|
|
3143
3184
|
component: `${c}.searchIcon`,
|
|
3144
|
-
children: /* @__PURE__ */
|
|
3185
|
+
children: /* @__PURE__ */ L(sn, {
|
|
3145
3186
|
fill: "currentColor",
|
|
3146
3187
|
width: "14px"
|
|
3147
3188
|
})
|
|
3148
|
-
}), /* @__PURE__ */
|
|
3189
|
+
}), /* @__PURE__ */ L(x, {
|
|
3149
3190
|
ref: u,
|
|
3150
3191
|
component: `${c}.searchInput`,
|
|
3151
3192
|
value: n,
|
|
@@ -3158,40 +3199,40 @@ function sn({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3158
3199
|
}
|
|
3159
3200
|
})]
|
|
3160
3201
|
}),
|
|
3161
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ R(_, {
|
|
3162
3203
|
component: `${c}.toolbar`,
|
|
3163
|
-
children: [/* @__PURE__ */
|
|
3204
|
+
children: [/* @__PURE__ */ L(a, {
|
|
3164
3205
|
component: `${c}.count`,
|
|
3165
|
-
children: o.columnsMenuShown(
|
|
3166
|
-
}), /* @__PURE__ */
|
|
3206
|
+
children: o.columnsMenuShown(i.visibleCount, i.total)
|
|
3207
|
+
}), /* @__PURE__ */ R(_, {
|
|
3167
3208
|
gap: 1,
|
|
3168
|
-
children: [/* @__PURE__ */
|
|
3209
|
+
children: [/* @__PURE__ */ L(h, {
|
|
3169
3210
|
component: `${c}.action`,
|
|
3170
|
-
disabled:
|
|
3171
|
-
onClick: () =>
|
|
3211
|
+
disabled: m,
|
|
3212
|
+
onClick: () => i.setAll(!0, f),
|
|
3172
3213
|
children: o.columnsMenuShowAll
|
|
3173
|
-
}), /* @__PURE__ */
|
|
3214
|
+
}), /* @__PURE__ */ L(h, {
|
|
3174
3215
|
component: `${c}.action`,
|
|
3175
|
-
disabled:
|
|
3176
|
-
onClick: () =>
|
|
3216
|
+
disabled: g,
|
|
3217
|
+
onClick: () => i.setAll(!1, f),
|
|
3177
3218
|
children: o.columnsMenuHideAll
|
|
3178
3219
|
})]
|
|
3179
3220
|
})]
|
|
3180
3221
|
}),
|
|
3181
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ R(_, {
|
|
3182
3223
|
component: `${c}.list`,
|
|
3183
|
-
children: [
|
|
3224
|
+
children: [p.map((e, t) => /* @__PURE__ */ R(_, {
|
|
3184
3225
|
component: `${c}.section`,
|
|
3185
3226
|
variant: { divided: t > 0 && !e.group },
|
|
3186
3227
|
props: e.group ? {
|
|
3187
3228
|
role: "group",
|
|
3188
3229
|
"aria-label": e.group
|
|
3189
3230
|
} : void 0,
|
|
3190
|
-
children: [e.group && /* @__PURE__ */
|
|
3231
|
+
children: [e.group && /* @__PURE__ */ L(a, {
|
|
3191
3232
|
component: `${c}.group`,
|
|
3192
3233
|
props: { "aria-hidden": !0 },
|
|
3193
3234
|
children: e.group
|
|
3194
|
-
}), e.entries.map((e) => /* @__PURE__ */
|
|
3235
|
+
}), e.entries.map((e) => /* @__PURE__ */ L(ee, {
|
|
3195
3236
|
checked: e.visible,
|
|
3196
3237
|
onChange: () => e.column.toggleVisibility(),
|
|
3197
3238
|
label: e.label,
|
|
@@ -3200,7 +3241,7 @@ function sn({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3200
3241
|
display: "flex"
|
|
3201
3242
|
}
|
|
3202
3243
|
}, e.id))]
|
|
3203
|
-
}, `${e.group ?? ""}-${t}`)), f.length === 0 && /* @__PURE__ */
|
|
3244
|
+
}, `${e.group ?? ""}-${t}`)), f.length === 0 && /* @__PURE__ */ L(a, {
|
|
3204
3245
|
component: `${c}.empty`,
|
|
3205
3246
|
props: { role: "status" },
|
|
3206
3247
|
children: o.columnsMenuNoMatch(n.trim())
|
|
@@ -3211,18 +3252,18 @@ function sn({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3211
3252
|
}
|
|
3212
3253
|
//#endregion
|
|
3213
3254
|
//#region src/components/dataGrid/components/dataGridExport.tsx
|
|
3214
|
-
function
|
|
3215
|
-
let { grid: t } = e, n = t.exportConfig, r =
|
|
3216
|
-
return n ? /* @__PURE__ */
|
|
3255
|
+
function dn(e) {
|
|
3256
|
+
let { grid: t } = e, n = t.exportConfig, r = j(() => void t.exportCsv(n).then(() => t.reportInteraction("export", "csv", "toolbar"), () => void 0), [t, n]), i = j(() => void t.exportXlsx(n).then(() => t.reportInteraction("export", "xlsx", "toolbar"), () => void 0), [t, n]);
|
|
3257
|
+
return n ? /* @__PURE__ */ R(_, {
|
|
3217
3258
|
component: `${t.componentName}.topBar.export`,
|
|
3218
3259
|
ai: "center",
|
|
3219
3260
|
gap: 2,
|
|
3220
|
-
children: [n.csv !== !1 && /* @__PURE__ */
|
|
3261
|
+
children: [n.csv !== !1 && /* @__PURE__ */ L(fn, {
|
|
3221
3262
|
componentName: t.componentName,
|
|
3222
3263
|
onClick: r,
|
|
3223
3264
|
label: t.localeText.exportCsvLabel,
|
|
3224
3265
|
children: t.localeText.exportCsv
|
|
3225
|
-
}), n.xlsx !== !1 && /* @__PURE__ */
|
|
3266
|
+
}), n.xlsx !== !1 && /* @__PURE__ */ L(fn, {
|
|
3226
3267
|
componentName: t.componentName,
|
|
3227
3268
|
onClick: i,
|
|
3228
3269
|
label: t.localeText.exportExcelLabel,
|
|
@@ -3230,25 +3271,25 @@ function cn(e) {
|
|
|
3230
3271
|
})]
|
|
3231
3272
|
}) : null;
|
|
3232
3273
|
}
|
|
3233
|
-
|
|
3234
|
-
function
|
|
3274
|
+
dn.displayName = "DataGridExport";
|
|
3275
|
+
function fn(e) {
|
|
3235
3276
|
let { componentName: t, onClick: n, label: r, children: i } = e;
|
|
3236
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ R(h, {
|
|
3237
3278
|
component: `${t}.topBar.export.button`,
|
|
3238
3279
|
onClick: n,
|
|
3239
3280
|
props: { "aria-label": r },
|
|
3240
|
-
children: [/* @__PURE__ */
|
|
3281
|
+
children: [/* @__PURE__ */ R(m, {
|
|
3241
3282
|
viewBox: "0 0 20 20",
|
|
3242
3283
|
width: 16,
|
|
3243
3284
|
height: 16,
|
|
3244
3285
|
fill: "none",
|
|
3245
3286
|
stroke: "currentColor",
|
|
3246
3287
|
strokeWidth: 1.6,
|
|
3247
|
-
children: [/* @__PURE__ */
|
|
3288
|
+
children: [/* @__PURE__ */ L(p, {
|
|
3248
3289
|
d: "M10 3v9m0 0 3.5-3.5M10 12 6.5 8.5",
|
|
3249
3290
|
strokeLinecap: "round",
|
|
3250
3291
|
strokeLinejoin: "round"
|
|
3251
|
-
}), /* @__PURE__ */
|
|
3292
|
+
}), /* @__PURE__ */ L(p, {
|
|
3252
3293
|
d: "M3.5 13.5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2",
|
|
3253
3294
|
strokeLinecap: "round"
|
|
3254
3295
|
})]
|
|
@@ -3257,38 +3298,38 @@ function ln(e) {
|
|
|
3257
3298
|
}
|
|
3258
3299
|
//#endregion
|
|
3259
3300
|
//#region src/components/dataGrid/components/dataGridGlobalFilter.tsx
|
|
3260
|
-
function
|
|
3261
|
-
let { grid: t } = e, [n, r] =
|
|
3301
|
+
function pn(e) {
|
|
3302
|
+
let { grid: t } = e, [n, r] = F(t.globalFilterValue), { debounce: i, cancel: o } = Pt(t.globalFilterValue, (e) => e === n, r), s = j((e) => {
|
|
3262
3303
|
let n = e.target.value;
|
|
3263
|
-
r(n),
|
|
3264
|
-
}, [t,
|
|
3304
|
+
r(n), i("value", () => t.filter.setGlobalFilter(n));
|
|
3305
|
+
}, [t, i]), c = j(() => {
|
|
3265
3306
|
o(), r(""), t.filter.setGlobalFilter("");
|
|
3266
3307
|
}, [t, o]), { filtered: l, total: u } = t.filter.filterStats, d = !t.props.def.bottomBar && t.filter.hasActiveFilters && l !== u;
|
|
3267
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ R(_, {
|
|
3268
3309
|
component: `${t.componentName}.topBar.globalFilter`,
|
|
3269
|
-
children: [d && /* @__PURE__ */
|
|
3310
|
+
children: [d && /* @__PURE__ */ R(a, {
|
|
3270
3311
|
component: `${t.componentName}.topBar.globalFilter.stats`,
|
|
3271
3312
|
children: [
|
|
3272
3313
|
l,
|
|
3273
3314
|
"/",
|
|
3274
3315
|
u
|
|
3275
3316
|
]
|
|
3276
|
-
}), /* @__PURE__ */
|
|
3317
|
+
}), /* @__PURE__ */ R(_, {
|
|
3277
3318
|
position: "relative",
|
|
3278
3319
|
ai: "center",
|
|
3279
3320
|
children: [
|
|
3280
|
-
/* @__PURE__ */
|
|
3321
|
+
/* @__PURE__ */ L(_, {
|
|
3281
3322
|
position: "absolute",
|
|
3282
3323
|
insetStart: 3,
|
|
3283
3324
|
pointerEvents: "none",
|
|
3284
|
-
color: "
|
|
3285
|
-
theme: { dark: { color: "
|
|
3286
|
-
children: /* @__PURE__ */
|
|
3325
|
+
color: "base-400",
|
|
3326
|
+
theme: { dark: { color: "base-500" } },
|
|
3327
|
+
children: /* @__PURE__ */ L(sn, {
|
|
3287
3328
|
fill: "currentColor",
|
|
3288
3329
|
width: "14px"
|
|
3289
3330
|
})
|
|
3290
3331
|
}),
|
|
3291
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ L(x, {
|
|
3292
3333
|
placeholder: t.localeText.searchPlaceholder,
|
|
3293
3334
|
variant: "compact",
|
|
3294
3335
|
value: n,
|
|
@@ -3296,19 +3337,19 @@ function un(e) {
|
|
|
3296
3337
|
ps: 8,
|
|
3297
3338
|
pe: n ? 8 : 3
|
|
3298
3339
|
}),
|
|
3299
|
-
n && /* @__PURE__ */
|
|
3340
|
+
n && /* @__PURE__ */ L(a, {
|
|
3300
3341
|
position: "absolute",
|
|
3301
3342
|
insetEnd: 2,
|
|
3302
3343
|
cursor: "pointer",
|
|
3303
3344
|
p: 1,
|
|
3304
|
-
color: "
|
|
3305
|
-
hover: { color: "
|
|
3345
|
+
color: "base-400",
|
|
3346
|
+
hover: { color: "base-600" },
|
|
3306
3347
|
theme: { dark: {
|
|
3307
|
-
color: "
|
|
3308
|
-
hover: { color: "
|
|
3348
|
+
color: "base-500",
|
|
3349
|
+
hover: { color: "base-300" }
|
|
3309
3350
|
} },
|
|
3310
3351
|
props: { onClick: c },
|
|
3311
|
-
children: /* @__PURE__ */
|
|
3352
|
+
children: /* @__PURE__ */ L(a, {
|
|
3312
3353
|
fontSize: 12,
|
|
3313
3354
|
fontWeight: 600,
|
|
3314
3355
|
children: "✕"
|
|
@@ -3320,52 +3361,52 @@ function un(e) {
|
|
|
3320
3361
|
}
|
|
3321
3362
|
//#endregion
|
|
3322
3363
|
//#region src/components/dataGrid/components/dataGridTopBar.tsx
|
|
3323
|
-
function
|
|
3324
|
-
let { grid: t } = e, { title: n, topBarContent: r, globalFilter:
|
|
3325
|
-
return /* @__PURE__ */
|
|
3364
|
+
function mn(e) {
|
|
3365
|
+
let { grid: t } = e, { title: n, topBarContent: r, globalFilter: i } = t.props.def;
|
|
3366
|
+
return /* @__PURE__ */ R(_, {
|
|
3326
3367
|
component: `${t.componentName}.topBar`,
|
|
3327
3368
|
position: "relative",
|
|
3328
3369
|
d: "column",
|
|
3329
3370
|
gap: 3,
|
|
3330
|
-
children: [/* @__PURE__ */
|
|
3371
|
+
children: [/* @__PURE__ */ R(_, {
|
|
3331
3372
|
ai: "center",
|
|
3332
3373
|
jc: "space-between",
|
|
3333
3374
|
gap: 4,
|
|
3334
3375
|
flexWrap: "wrap",
|
|
3335
3376
|
width: "fit",
|
|
3336
|
-
children: [/* @__PURE__ */
|
|
3377
|
+
children: [/* @__PURE__ */ R(_, {
|
|
3337
3378
|
ai: "center",
|
|
3338
3379
|
gap: 3,
|
|
3339
3380
|
flexWrap: "wrap",
|
|
3340
3381
|
minWidth: 0,
|
|
3341
|
-
children: [n && /* @__PURE__ */
|
|
3382
|
+
children: [n && /* @__PURE__ */ L(a, {
|
|
3342
3383
|
id: t.titleId,
|
|
3343
3384
|
fontWeight: 600,
|
|
3344
3385
|
fontSize: 16,
|
|
3345
|
-
color: "
|
|
3346
|
-
theme: { dark: { color: "
|
|
3386
|
+
color: "base-800",
|
|
3387
|
+
theme: { dark: { color: "base-100" } },
|
|
3347
3388
|
children: n
|
|
3348
|
-
}), /* @__PURE__ */
|
|
3349
|
-
}), /* @__PURE__ */
|
|
3389
|
+
}), /* @__PURE__ */ L(on, { grid: t })]
|
|
3390
|
+
}), /* @__PURE__ */ R(_, {
|
|
3350
3391
|
ai: "center",
|
|
3351
3392
|
gap: 3,
|
|
3352
3393
|
flexWrap: "wrap",
|
|
3353
3394
|
children: [
|
|
3354
|
-
|
|
3355
|
-
/* @__PURE__ */
|
|
3356
|
-
/* @__PURE__ */
|
|
3395
|
+
i && /* @__PURE__ */ L(pn, { grid: t }),
|
|
3396
|
+
/* @__PURE__ */ L(ln, { grid: t }),
|
|
3397
|
+
/* @__PURE__ */ L(dn, { grid: t })
|
|
3357
3398
|
]
|
|
3358
3399
|
})]
|
|
3359
|
-
}), r && /* @__PURE__ */
|
|
3400
|
+
}), r && /* @__PURE__ */ L(a, {
|
|
3360
3401
|
width: "fit",
|
|
3361
3402
|
children: r
|
|
3362
3403
|
})]
|
|
3363
3404
|
});
|
|
3364
3405
|
}
|
|
3365
|
-
|
|
3406
|
+
mn.displayName = "DataGridTopBar";
|
|
3366
3407
|
//#endregion
|
|
3367
3408
|
//#region src/utils/string/fuzzySearch.ts
|
|
3368
|
-
function
|
|
3409
|
+
function hn(e, t) {
|
|
3369
3410
|
if (!e) return {
|
|
3370
3411
|
score: 1,
|
|
3371
3412
|
matches: []
|
|
@@ -3378,16 +3419,16 @@ function fn(e, t) {
|
|
|
3378
3419
|
matches: o
|
|
3379
3420
|
});
|
|
3380
3421
|
}
|
|
3381
|
-
function
|
|
3382
|
-
return
|
|
3422
|
+
function gn(e, t) {
|
|
3423
|
+
return hn(e, t) !== null;
|
|
3383
3424
|
}
|
|
3384
3425
|
//#endregion
|
|
3385
3426
|
//#region src/components/dataGrid/components/dataGridCellRowDetail.tsx
|
|
3386
|
-
function
|
|
3387
|
-
let { cell: t } = e, n = t.isExpanded, r =
|
|
3427
|
+
function _n(e) {
|
|
3428
|
+
let { cell: t } = e, n = t.isExpanded, r = j((e) => {
|
|
3388
3429
|
e.stopPropagation(), t.toggleDetail();
|
|
3389
3430
|
}, [t]);
|
|
3390
|
-
return /* @__PURE__ */
|
|
3431
|
+
return /* @__PURE__ */ L(h, {
|
|
3391
3432
|
component: `${t.grid.componentName}.body.cell.rowDetail`,
|
|
3392
3433
|
variant: { isExpanded: n },
|
|
3393
3434
|
type: "button",
|
|
@@ -3403,7 +3444,7 @@ function mn(e) {
|
|
|
3403
3444
|
"aria-label": (n ? t.grid.localeText.collapseRowDetail : t.grid.localeText.expandRowDetail)(t.row.rowIndex + 1),
|
|
3404
3445
|
"aria-expanded": n
|
|
3405
3446
|
},
|
|
3406
|
-
children: /* @__PURE__ */
|
|
3447
|
+
children: /* @__PURE__ */ L(Y, {
|
|
3407
3448
|
fill: "currentColor",
|
|
3408
3449
|
width: "14px",
|
|
3409
3450
|
height: "14px",
|
|
@@ -3411,14 +3452,14 @@ function mn(e) {
|
|
|
3411
3452
|
})
|
|
3412
3453
|
});
|
|
3413
3454
|
}
|
|
3414
|
-
|
|
3455
|
+
_n.displayName = "DataGridCellRowDetail";
|
|
3415
3456
|
//#endregion
|
|
3416
3457
|
//#region src/components/dataGrid/components/dataGridCellRowSelection.tsx
|
|
3417
|
-
function
|
|
3418
|
-
let { cell: t } = e, n =
|
|
3458
|
+
function vn(e) {
|
|
3459
|
+
let { cell: t } = e, n = j(() => {
|
|
3419
3460
|
t.toggleSelection();
|
|
3420
3461
|
}, [t]);
|
|
3421
|
-
return /* @__PURE__ */
|
|
3462
|
+
return /* @__PURE__ */ L(v, {
|
|
3422
3463
|
variant: "datagrid",
|
|
3423
3464
|
checked: t.selected,
|
|
3424
3465
|
indeterminate: t.indeterminate,
|
|
@@ -3429,15 +3470,15 @@ function hn(e) {
|
|
|
3429
3470
|
}
|
|
3430
3471
|
});
|
|
3431
3472
|
}
|
|
3432
|
-
|
|
3473
|
+
vn.displayName = "DataGridCellRowSelection";
|
|
3433
3474
|
//#endregion
|
|
3434
3475
|
//#region src/components/dataGrid/contracts/dataGridContract.ts
|
|
3435
|
-
function
|
|
3476
|
+
function yn(e) {
|
|
3436
3477
|
if (e) return e === "LEFT" ? "START" : e === "RIGHT" ? "END" : e;
|
|
3437
3478
|
}
|
|
3438
3479
|
//#endregion
|
|
3439
3480
|
//#region src/components/dataGrid/models/headerCellModel.ts
|
|
3440
|
-
var
|
|
3481
|
+
var bn = 1e3, xn = class {
|
|
3441
3482
|
column;
|
|
3442
3483
|
constructor(e) {
|
|
3443
3484
|
this.column = e;
|
|
@@ -3514,7 +3555,7 @@ var _n = 1e3, vn = class {
|
|
|
3514
3555
|
return Math.max(1, this.column.leafs.length) * this.grid.MIN_COLUMN_WIDTH_PX;
|
|
3515
3556
|
}
|
|
3516
3557
|
get maxWidth() {
|
|
3517
|
-
return Math.max(this.grid.containerWidth ||
|
|
3558
|
+
return Math.max(this.grid.containerWidth || bn, this.width, this.minWidth);
|
|
3518
3559
|
}
|
|
3519
3560
|
get paddingStart() {
|
|
3520
3561
|
if (!this.column.isRowSelection) return this.column.isEndAligned ? 10 : 3;
|
|
@@ -3535,6 +3576,7 @@ var _n = 1e3, vn = class {
|
|
|
3535
3576
|
isPillBeforeResizer: this.hasHoverPill && this.showResizer && this.column.pin !== "END",
|
|
3536
3577
|
isPillAfterResizer: this.hasHoverPill && this.showResizer && this.column.pin === "END",
|
|
3537
3578
|
isRowNumber: this.column.isRowNumber,
|
|
3579
|
+
isGroup: !this.column.isLeaf,
|
|
3538
3580
|
isFirstLeaf: this.column.isFirstLeaf,
|
|
3539
3581
|
isLastLeaf: this.column.isLastLeaf
|
|
3540
3582
|
};
|
|
@@ -3599,15 +3641,15 @@ var _n = 1e3, vn = class {
|
|
|
3599
3641
|
pin: t.pin
|
|
3600
3642
|
} : r, n, this)) ?? [], this.isLeaf) {
|
|
3601
3643
|
let e = this.grid.columnWidths.get(this.key);
|
|
3602
|
-
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin =
|
|
3644
|
+
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin = yn(t.pin);
|
|
3603
3645
|
}
|
|
3604
3646
|
}
|
|
3605
3647
|
columns = [];
|
|
3606
3648
|
get kind() {
|
|
3607
3649
|
switch (this.key) {
|
|
3608
|
-
case
|
|
3609
|
-
case
|
|
3610
|
-
case
|
|
3650
|
+
case Je: return "rowNumber";
|
|
3651
|
+
case Ye: return "rowSelection";
|
|
3652
|
+
case Xe: return "rowDetail";
|
|
3611
3653
|
case K: return "grouping";
|
|
3612
3654
|
default: return "data";
|
|
3613
3655
|
}
|
|
@@ -3663,7 +3705,7 @@ var _n = 1e3, vn = class {
|
|
|
3663
3705
|
insetInlineEnd: t ? `var(${this.inlineEndVarName})` : void 0
|
|
3664
3706
|
};
|
|
3665
3707
|
}, () => [this.pinFlags]);
|
|
3666
|
-
_headerCell = q(() => new
|
|
3708
|
+
_headerCell = q(() => new xn(this));
|
|
3667
3709
|
get headerCell() {
|
|
3668
3710
|
return this._headerCell.value;
|
|
3669
3711
|
}
|
|
@@ -3913,7 +3955,7 @@ var _n = 1e3, vn = class {
|
|
|
3913
3955
|
this.applyResize(e), this.grid.notify();
|
|
3914
3956
|
};
|
|
3915
3957
|
endResize = () => {
|
|
3916
|
-
this.grid.notify();
|
|
3958
|
+
this.grid.notify(), this.grid.reportInteraction("columnResize", this.leafs.reduce((e, t) => e + (t.inlineWidth ?? t.baseWidth), 0), "resize", { columnKey: this.key });
|
|
3917
3959
|
};
|
|
3918
3960
|
moveResizer = (e) => {
|
|
3919
3961
|
this.beginResize(0), this.applyResize(e);
|
|
@@ -3923,8 +3965,12 @@ var _n = 1e3, vn = class {
|
|
|
3923
3965
|
this.moveResizer((e - t) * this.resizeSign);
|
|
3924
3966
|
};
|
|
3925
3967
|
pinColumn = (e) => {
|
|
3926
|
-
|
|
3968
|
+
let t = this.pin;
|
|
3969
|
+
this.setPin(e), this.pin !== t && this.grid.reportInteraction("columnPinChange", this.pin, this.pin ? "pin" : "unpin", { columnKey: this.key });
|
|
3927
3970
|
};
|
|
3971
|
+
setPin(e) {
|
|
3972
|
+
this.isLeaf ? this._pin = yn(e) : this.columns.forEach((t) => t.setPin(e)), this.grid.pinColumn(this.uniqueKey, e);
|
|
3973
|
+
}
|
|
3928
3974
|
toggleGrouping = () => {
|
|
3929
3975
|
this.grid.toggleGrouping(this.key);
|
|
3930
3976
|
};
|
|
@@ -3938,7 +3984,7 @@ var _n = 1e3, vn = class {
|
|
|
3938
3984
|
toggleVisibility = () => {
|
|
3939
3985
|
this.grid.toggleColumnVisibility(this.key);
|
|
3940
3986
|
};
|
|
3941
|
-
},
|
|
3987
|
+
}, Sn = class {
|
|
3942
3988
|
grid;
|
|
3943
3989
|
constructor(e) {
|
|
3944
3990
|
this.grid = e;
|
|
@@ -3991,26 +4037,25 @@ var _n = 1e3, vn = class {
|
|
|
3991
4037
|
});
|
|
3992
4038
|
};
|
|
3993
4039
|
setAll = (e, t = this.entries) => {
|
|
3994
|
-
t.
|
|
3995
|
-
|
|
3996
|
-
});
|
|
4040
|
+
let n = t.filter((t) => t.visible !== e);
|
|
4041
|
+
n.length !== 0 && (this.grid.quietly(() => n.forEach((e) => e.column.toggleVisibility())), this.grid.reportInteraction("columnVisibilityChange", e, e ? "show-all" : "hide-all", { columnKeys: n.map((e) => e.column.key) }));
|
|
3997
4042
|
};
|
|
3998
4043
|
};
|
|
3999
4044
|
//#endregion
|
|
4000
4045
|
//#region src/utils/array/lazyList.ts
|
|
4001
|
-
function
|
|
4046
|
+
function Cn(e, t) {
|
|
4002
4047
|
return new Proxy([], {
|
|
4003
4048
|
get(n, r, i) {
|
|
4004
4049
|
if (r === "length") return e;
|
|
4005
|
-
let a =
|
|
4050
|
+
let a = wn(r, e);
|
|
4006
4051
|
return a === void 0 ? Reflect.get(n, r, i) : t(a);
|
|
4007
4052
|
},
|
|
4008
4053
|
has(t, n) {
|
|
4009
|
-
return
|
|
4054
|
+
return wn(n, e) !== void 0 || Reflect.has(t, n);
|
|
4010
4055
|
},
|
|
4011
4056
|
getOwnPropertyDescriptor(n, r) {
|
|
4012
|
-
return
|
|
4013
|
-
value: t(
|
|
4057
|
+
return wn(r, e) === void 0 ? Reflect.getOwnPropertyDescriptor(n, r) : {
|
|
4058
|
+
value: t(wn(r, e)),
|
|
4014
4059
|
writable: !0,
|
|
4015
4060
|
enumerable: !0,
|
|
4016
4061
|
configurable: !0
|
|
@@ -4018,7 +4063,7 @@ function bn(e, t) {
|
|
|
4018
4063
|
}
|
|
4019
4064
|
});
|
|
4020
4065
|
}
|
|
4021
|
-
function
|
|
4066
|
+
function wn(e, t) {
|
|
4022
4067
|
if (typeof e != "string") return;
|
|
4023
4068
|
let n = Number(e);
|
|
4024
4069
|
return Number.isInteger(n) && n >= 0 && n < t ? n : void 0;
|
|
@@ -4149,7 +4194,7 @@ var $ = class e {
|
|
|
4149
4194
|
}), this.source.changed());
|
|
4150
4195
|
});
|
|
4151
4196
|
}
|
|
4152
|
-
},
|
|
4197
|
+
}, Tn = class extends st {
|
|
4153
4198
|
level;
|
|
4154
4199
|
constructor(e, t, n, r) {
|
|
4155
4200
|
super(e, n, [], r, ""), this.level = t;
|
|
@@ -4171,7 +4216,7 @@ var $ = class e {
|
|
|
4171
4216
|
return [...this.level.groupKeys, this.groupValue];
|
|
4172
4217
|
}
|
|
4173
4218
|
get key() {
|
|
4174
|
-
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` :
|
|
4219
|
+
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` : En(this.groupKeys);
|
|
4175
4220
|
}
|
|
4176
4221
|
get depth() {
|
|
4177
4222
|
return this.level.depth;
|
|
@@ -4207,21 +4252,21 @@ var $ = class e {
|
|
|
4207
4252
|
this.placeholder || this.grid.toggleGroupRow(this.key);
|
|
4208
4253
|
}
|
|
4209
4254
|
};
|
|
4210
|
-
function
|
|
4255
|
+
function En(e) {
|
|
4211
4256
|
return `rb-group:${$.keyOf(e)}`;
|
|
4212
4257
|
}
|
|
4213
4258
|
//#endregion
|
|
4214
4259
|
//#region src/components/dataGrid/models/sourceRowModel.ts
|
|
4215
|
-
var
|
|
4260
|
+
var Dn = {}, On = class extends U {
|
|
4216
4261
|
sourceLevel;
|
|
4217
4262
|
constructor(e, t, n) {
|
|
4218
|
-
super(e,
|
|
4263
|
+
super(e, Dn, n), this.sourceLevel = t;
|
|
4219
4264
|
}
|
|
4220
4265
|
get row() {
|
|
4221
4266
|
return this.sourceLevel.rowAt(this.rowIndex);
|
|
4222
4267
|
}
|
|
4223
4268
|
get data() {
|
|
4224
|
-
return this.row ??
|
|
4269
|
+
return this.row ?? Dn;
|
|
4225
4270
|
}
|
|
4226
4271
|
get placeholder() {
|
|
4227
4272
|
return this.row === void 0;
|
|
@@ -4239,7 +4284,7 @@ var wn = {}, Tn = class extends U {
|
|
|
4239
4284
|
get selected() {
|
|
4240
4285
|
return !this.placeholder && super.selected;
|
|
4241
4286
|
}
|
|
4242
|
-
},
|
|
4287
|
+
}, kn = class extends On {
|
|
4243
4288
|
isTreeRow = !0;
|
|
4244
4289
|
get level() {
|
|
4245
4290
|
return this.sourceLevel.depth;
|
|
@@ -4259,7 +4304,7 @@ var wn = {}, Tn = class extends U {
|
|
|
4259
4304
|
toggleTree = () => {
|
|
4260
4305
|
this.hasChildren && this.grid.tree.toggle(this.key, this.level);
|
|
4261
4306
|
};
|
|
4262
|
-
},
|
|
4307
|
+
}, An = 100, jn = 40, Mn = class {
|
|
4263
4308
|
grid;
|
|
4264
4309
|
constructor(e) {
|
|
4265
4310
|
this.grid = e;
|
|
@@ -4285,11 +4330,11 @@ var wn = {}, Tn = class extends U {
|
|
|
4285
4330
|
}
|
|
4286
4331
|
get blockSize() {
|
|
4287
4332
|
let e = this.config?.blockSize;
|
|
4288
|
-
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize :
|
|
4333
|
+
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize : An;
|
|
4289
4334
|
}
|
|
4290
4335
|
get maxBlocks() {
|
|
4291
4336
|
let e = this.config?.maxBlocks;
|
|
4292
|
-
return e && e > 0 ? Math.floor(e) :
|
|
4337
|
+
return e && e > 0 ? Math.floor(e) : jn;
|
|
4293
4338
|
}
|
|
4294
4339
|
get queryVersion() {
|
|
4295
4340
|
return this._query;
|
|
@@ -4344,7 +4389,7 @@ var wn = {}, Tn = class extends U {
|
|
|
4344
4389
|
return e.loadedBlocks().forEach(({ index: a, rows: o }) => {
|
|
4345
4390
|
o.forEach((o, s) => {
|
|
4346
4391
|
let c = [...e.path, o[r]];
|
|
4347
|
-
if (!t.has(
|
|
4392
|
+
if (!t.has(En(c))) return;
|
|
4348
4393
|
let l = a * n + s;
|
|
4349
4394
|
i.push({
|
|
4350
4395
|
rowIndex: l,
|
|
@@ -4398,20 +4443,20 @@ var wn = {}, Tn = class extends U {
|
|
|
4398
4443
|
listLength = -1;
|
|
4399
4444
|
rowList() {
|
|
4400
4445
|
let { start: e } = this.visibleRange();
|
|
4401
|
-
return this.listLength = this.visibleLength(),
|
|
4446
|
+
return this.listLength = this.visibleLength(), Cn(this.listLength, (t) => this.rowModelAt(e + t));
|
|
4402
4447
|
}
|
|
4403
4448
|
flatRowList(e) {
|
|
4404
4449
|
let t = this.detailPositions();
|
|
4405
|
-
return t.length === 0 ? e :
|
|
4406
|
-
let r =
|
|
4450
|
+
return t.length === 0 ? e : Cn(e.length + t.length, (n) => {
|
|
4451
|
+
let r = Pn(t, n);
|
|
4407
4452
|
return t[r] === n ? new H(this.grid, e[n - r - 1]) : e[n - r];
|
|
4408
4453
|
});
|
|
4409
4454
|
}
|
|
4410
4455
|
rowOffsets(e) {
|
|
4411
4456
|
let { rowHeight: t } = this.grid, n = this.detailPositions(), r = [0];
|
|
4412
4457
|
return n.forEach((t, n) => r.push(r[n] + e[t].heightForOffset)), {
|
|
4413
|
-
offsets:
|
|
4414
|
-
let i =
|
|
4458
|
+
offsets: Cn(e.length, (e) => {
|
|
4459
|
+
let i = Pn(n, e);
|
|
4415
4460
|
return (e - i) * t + r[i];
|
|
4416
4461
|
}),
|
|
4417
4462
|
totalHeight: (e.length - n.length) * t + r[n.length]
|
|
@@ -4440,7 +4485,7 @@ var wn = {}, Tn = class extends U {
|
|
|
4440
4485
|
let i = this.levels.get(r);
|
|
4441
4486
|
!i || i.isGroupLevel || i.loadedBlocks().forEach(({ index: r, rows: i }) => {
|
|
4442
4487
|
i.forEach((i, a) => {
|
|
4443
|
-
let o =
|
|
4488
|
+
let o = Nn(n, r * t + a);
|
|
4444
4489
|
o !== void 0 && e(o, i);
|
|
4445
4490
|
});
|
|
4446
4491
|
});
|
|
@@ -4448,11 +4493,11 @@ var wn = {}, Tn = class extends U {
|
|
|
4448
4493
|
}
|
|
4449
4494
|
rowModelAt(e) {
|
|
4450
4495
|
let t = this.segmentAt(e);
|
|
4451
|
-
if (!t) return new
|
|
4496
|
+
if (!t) return new On(this.grid, this.root, e);
|
|
4452
4497
|
let { level: n } = t, r = t.levelStart + (e - t.start), i = this.models.get(n.key);
|
|
4453
4498
|
i || this.models.set(n.key, i = /* @__PURE__ */ new Map());
|
|
4454
4499
|
let a = i.get(r);
|
|
4455
|
-
return a || (a = n.isGroupLevel ? new
|
|
4500
|
+
return a || (a = n.isGroupLevel ? new Tn(this.grid, n, this.groupColumnAt(n.depth), r) : this.isTree ? new kn(this.grid, n, r) : new On(this.grid, n, r), i.set(r, a)), a;
|
|
4456
4501
|
}
|
|
4457
4502
|
groupColumnAt(e) {
|
|
4458
4503
|
return G.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === this.groupBy[e]);
|
|
@@ -4504,7 +4549,7 @@ var wn = {}, Tn = class extends U {
|
|
|
4504
4549
|
let e = !1;
|
|
4505
4550
|
this.levels.forEach((t) => {
|
|
4506
4551
|
t.failedBlocks().length !== 0 && (t.retry(), e = !0);
|
|
4507
|
-
}), e && this.changed();
|
|
4552
|
+
}), e && (this.changed(), this.grid.reportInteraction("retry", void 0, "retry"));
|
|
4508
4553
|
};
|
|
4509
4554
|
invalidate() {
|
|
4510
4555
|
if (!this.enabled) return;
|
|
@@ -4541,10 +4586,10 @@ var wn = {}, Tn = class extends U {
|
|
|
4541
4586
|
this._segments = void 0, this._byLevel = void 0, this.listLength !== this.visibleLength() && this.grid.rows.clear(), this.grid.flatRows.clear(), this.grid.notify();
|
|
4542
4587
|
}
|
|
4543
4588
|
};
|
|
4544
|
-
function
|
|
4589
|
+
function Nn(e, t) {
|
|
4545
4590
|
for (let n of e) if (t >= n.levelStart && t < n.levelStart + n.length) return n.start + (t - n.levelStart);
|
|
4546
4591
|
}
|
|
4547
|
-
function
|
|
4592
|
+
function Pn(e, t) {
|
|
4548
4593
|
let n = 0, r = e.length;
|
|
4549
4594
|
for (; n < r;) {
|
|
4550
4595
|
let i = n + r >>> 1;
|
|
@@ -4554,7 +4599,7 @@ function jn(e, t) {
|
|
|
4554
4599
|
}
|
|
4555
4600
|
//#endregion
|
|
4556
4601
|
//#region src/components/dataGrid/models/exportModel.ts
|
|
4557
|
-
var
|
|
4602
|
+
var Fn = 7, In = class {
|
|
4558
4603
|
grid;
|
|
4559
4604
|
constructor(e) {
|
|
4560
4605
|
this.grid = e;
|
|
@@ -4568,7 +4613,7 @@ var Mn = 7, Nn = class {
|
|
|
4568
4613
|
}
|
|
4569
4614
|
width(e) {
|
|
4570
4615
|
let t = e.inlineWidth ?? this.grid.DEFAULT_COLUMN_WIDTH_PX;
|
|
4571
|
-
return Math.min(80, Math.max(6, Math.round(t /
|
|
4616
|
+
return Math.min(80, Math.max(6, Math.round(t / Fn * 10) / 10));
|
|
4572
4617
|
}
|
|
4573
4618
|
value(e, t) {
|
|
4574
4619
|
let { exportValue: n } = e.def, r = n ? n(t) : t[e.key];
|
|
@@ -4576,7 +4621,7 @@ var Mn = 7, Nn = class {
|
|
|
4576
4621
|
}
|
|
4577
4622
|
aggregateOf(e, t) {
|
|
4578
4623
|
let n = e.aggregate;
|
|
4579
|
-
return n ?
|
|
4624
|
+
return n ? rt(n, t.map((t) => this.value(e, t)), t) : null;
|
|
4580
4625
|
}
|
|
4581
4626
|
table(e = {}) {
|
|
4582
4627
|
let t = this.columns(e.columns), n = e.groups ?? !0, r = [], i = (e, a, o) => {
|
|
@@ -4640,7 +4685,7 @@ var Mn = 7, Nn = class {
|
|
|
4640
4685
|
let { title: t } = this.grid.props.def, n = typeof t == "string" && t.trim() ? t.trim() : this.grid.localeText.exportFileName;
|
|
4641
4686
|
return e.fileName?.trim() || n;
|
|
4642
4687
|
}
|
|
4643
|
-
},
|
|
4688
|
+
}, Ln = class {
|
|
4644
4689
|
grid;
|
|
4645
4690
|
constructor(e) {
|
|
4646
4691
|
this.grid = e;
|
|
@@ -4662,7 +4707,7 @@ var Mn = 7, Nn = class {
|
|
|
4662
4707
|
}
|
|
4663
4708
|
setGlobalFilter = (e) => this.grid.setGlobalFilter(e);
|
|
4664
4709
|
clearAllFilters = () => this.grid.clearAllFilters();
|
|
4665
|
-
},
|
|
4710
|
+
}, Rn = class {
|
|
4666
4711
|
grid;
|
|
4667
4712
|
constructor(e) {
|
|
4668
4713
|
this.grid = e;
|
|
@@ -4758,14 +4803,14 @@ var Mn = 7, Nn = class {
|
|
|
4758
4803
|
this._limit = {
|
|
4759
4804
|
query: this.query,
|
|
4760
4805
|
count: this.count + this.batch
|
|
4761
|
-
}, this.grid.notify();
|
|
4806
|
+
}, this.grid.notify(), this.grid.reportInteraction("showMore", this._limit.count, "more", { batch: this.batch });
|
|
4762
4807
|
};
|
|
4763
4808
|
_selecting = !1;
|
|
4764
4809
|
get selecting() {
|
|
4765
4810
|
return !!this.grid.props.def.rowSelection && this._selecting;
|
|
4766
4811
|
}
|
|
4767
4812
|
setSelecting = (e) => {
|
|
4768
|
-
this._selecting !== e && (this._selecting = e, this.grid.notify());
|
|
4813
|
+
this._selecting !== e && (this._selecting = e, this.grid.notify(), this.grid.reportInteraction("selectModeChange", e, e ? "enter" : "exit"));
|
|
4769
4814
|
};
|
|
4770
4815
|
checkboxId(e) {
|
|
4771
4816
|
return `${this.grid.identifier}-pick-${encodeURIComponent(String(e))}`;
|
|
@@ -4775,7 +4820,7 @@ var Mn = 7, Nn = class {
|
|
|
4775
4820
|
return this._sheet;
|
|
4776
4821
|
}
|
|
4777
4822
|
openSheet = (e) => {
|
|
4778
|
-
this._sheet !== e && (this._sheet = e, this.grid.notify());
|
|
4823
|
+
this._sheet !== e && (this._sheet = e, this.grid.notify(), this.grid.reportInteraction("sheetChange", e, e ? "open" : "close"));
|
|
4779
4824
|
};
|
|
4780
4825
|
get sortableColumns() {
|
|
4781
4826
|
return this.grid.columns.value.visibleLeafs.filter((e) => e.isData && e.sortable);
|
|
@@ -4801,23 +4846,23 @@ var Mn = 7, Nn = class {
|
|
|
4801
4846
|
describe(e, t) {
|
|
4802
4847
|
switch (t.type) {
|
|
4803
4848
|
case "text": return `“${t.value}”`;
|
|
4804
|
-
case "number": return t.operator === "between" ? `${t.value}–${t.valueTo ?? ""}` : `${
|
|
4849
|
+
case "number": return t.operator === "between" ? `${t.value}–${t.valueTo ?? ""}` : `${Bn[t.operator]} ${t.value}`;
|
|
4805
4850
|
case "multiselect": {
|
|
4806
4851
|
let n = e.filterOptions, r = t.values.map((e) => e === null ? this.grid.localeText.filterEmptyValue : n.find((t) => t.value === e)?.label ?? String(e)), i = r.slice(0, 2).join(", ");
|
|
4807
4852
|
return r.length > 2 ? `${i} +${r.length - 2}` : i;
|
|
4808
4853
|
}
|
|
4809
|
-
case "date": return t.operator === "between" ?
|
|
4854
|
+
case "date": return t.operator === "between" ? Ee()?.describeDay(t.value, t.valueTo ?? t.value) ?? `${t.value}–${t.valueTo ?? ""}` : `${Vn[t.operator]} ${Ee()?.describeDay(t.value) ?? t.value}`;
|
|
4810
4855
|
}
|
|
4811
4856
|
}
|
|
4812
4857
|
_record = null;
|
|
4813
4858
|
get record() {
|
|
4814
4859
|
if (!this._record) return;
|
|
4815
4860
|
let e = this.grid.flatRows.value, { index: t, key: n } = this._record;
|
|
4816
|
-
if (
|
|
4861
|
+
if (Hn(e[t]) && e[t].key === n) return e[t];
|
|
4817
4862
|
let r = -1;
|
|
4818
|
-
for (let t = 0; t < Math.min(e.length,
|
|
4863
|
+
for (let t = 0; t < Math.min(e.length, zn) && r === -1; t++) {
|
|
4819
4864
|
let i = e[t];
|
|
4820
|
-
|
|
4865
|
+
Hn(i) && i.key === n && (r = t);
|
|
4821
4866
|
}
|
|
4822
4867
|
if (r !== -1) return this._record = {
|
|
4823
4868
|
index: r,
|
|
@@ -4831,17 +4876,17 @@ var Mn = 7, Nn = class {
|
|
|
4831
4876
|
this._record = {
|
|
4832
4877
|
index: t,
|
|
4833
4878
|
key: e.key
|
|
4834
|
-
}, this.grid.notify();
|
|
4879
|
+
}, this.grid.notify(), this.grid.reportInteraction("recordChange", e.key, "open", { index: t });
|
|
4835
4880
|
};
|
|
4836
4881
|
closeRecord = () => {
|
|
4837
|
-
this._record && (this._record = null, this.grid.notify());
|
|
4882
|
+
this._record && (this._record = null, this.grid.notify(), this.grid.reportInteraction("recordChange", null, "close"));
|
|
4838
4883
|
};
|
|
4839
4884
|
neighbour(e) {
|
|
4840
4885
|
if (!this.record || !this._record) return -1;
|
|
4841
4886
|
let t = this.grid.flatRows.value;
|
|
4842
4887
|
for (let n = this._record.index + e; n >= 0 && n < t.length; n += e) {
|
|
4843
4888
|
let e = t[n];
|
|
4844
|
-
if (
|
|
4889
|
+
if (Hn(e) && !e.placeholder) return n;
|
|
4845
4890
|
}
|
|
4846
4891
|
return -1;
|
|
4847
4892
|
}
|
|
@@ -4856,7 +4901,7 @@ var Mn = 7, Nn = class {
|
|
|
4856
4901
|
t !== -1 && (this._record = {
|
|
4857
4902
|
index: t,
|
|
4858
4903
|
key: this.grid.flatRows.value[t].key
|
|
4859
|
-
}, this._limit && t >= this._limit.count && (this._limit = {
|
|
4904
|
+
}, this.grid.reportInteraction("recordChange", this._record.key, e === 1 ? "next" : "previous", { index: t }), this._limit && t >= this._limit.count && (this._limit = {
|
|
4860
4905
|
query: this.query,
|
|
4861
4906
|
count: t + 1
|
|
4862
4907
|
}), this.grid.notify());
|
|
@@ -4868,30 +4913,30 @@ var Mn = 7, Nn = class {
|
|
|
4868
4913
|
total: this.grid.totalRowCount
|
|
4869
4914
|
};
|
|
4870
4915
|
let e = this.grid.flatRows.value, t = 0, n = 0;
|
|
4871
|
-
for (let r = 0; r < e.length; r++)
|
|
4916
|
+
for (let r = 0; r < e.length; r++) Hn(e[r]) && (n++, r <= this._record.index && t++);
|
|
4872
4917
|
return {
|
|
4873
4918
|
position: t,
|
|
4874
4919
|
total: n
|
|
4875
4920
|
};
|
|
4876
4921
|
}
|
|
4877
|
-
},
|
|
4922
|
+
}, zn = 1e4, Bn = {
|
|
4878
4923
|
eq: "=",
|
|
4879
4924
|
ne: "≠",
|
|
4880
4925
|
gt: ">",
|
|
4881
4926
|
gte: "≥",
|
|
4882
4927
|
lt: "<",
|
|
4883
4928
|
lte: "≤"
|
|
4884
|
-
},
|
|
4929
|
+
}, Vn = {
|
|
4885
4930
|
on: "=",
|
|
4886
4931
|
before: "<",
|
|
4887
4932
|
after: ">"
|
|
4888
4933
|
};
|
|
4889
|
-
function
|
|
4934
|
+
function Hn(e) {
|
|
4890
4935
|
return !!e && e.kind === "row";
|
|
4891
4936
|
}
|
|
4892
4937
|
//#endregion
|
|
4893
4938
|
//#region src/components/dataGrid/models/localeText.ts
|
|
4894
|
-
var
|
|
4939
|
+
var Un = {
|
|
4895
4940
|
searchPlaceholder: "Search...",
|
|
4896
4941
|
columnsMenu: "Columns",
|
|
4897
4942
|
columnsMenuLabel: (e, t) => `Columns, ${e} of ${t} shown`,
|
|
@@ -4988,7 +5033,7 @@ var Bn = {
|
|
|
4988
5033
|
selectedRows: (e) => `${e} selected`,
|
|
4989
5034
|
selectAll: "Select all",
|
|
4990
5035
|
selectionAnnouncement: (e, t) => e === 0 ? "No rows selected" : `${e} of ${t} rows selected`
|
|
4991
|
-
},
|
|
5036
|
+
}, Wn = class {
|
|
4992
5037
|
grid;
|
|
4993
5038
|
constructor(e) {
|
|
4994
5039
|
this.grid = e;
|
|
@@ -5044,16 +5089,16 @@ var Bn = {
|
|
|
5044
5089
|
let t = parseInt(e, 10);
|
|
5045
5090
|
isNaN(t) || this.grid.changePage(Math.max(1, Math.min(t, this.totalPages)));
|
|
5046
5091
|
};
|
|
5047
|
-
},
|
|
5048
|
-
function
|
|
5092
|
+
}, Gn = /["\t\r\n]/;
|
|
5093
|
+
function Kn(e) {
|
|
5049
5094
|
if (e == null) return "";
|
|
5050
5095
|
let t = e instanceof Date ? e.toISOString() : String(e);
|
|
5051
|
-
return
|
|
5096
|
+
return Gn.test(t) ? `"${t.split("\"").join("\"\"")}"` : t;
|
|
5052
5097
|
}
|
|
5053
|
-
function
|
|
5054
|
-
return e.map((e) => e.map(
|
|
5098
|
+
function qn(e) {
|
|
5099
|
+
return e.map((e) => e.map(Kn).join(" ")).join("\r\n");
|
|
5055
5100
|
}
|
|
5056
|
-
function
|
|
5101
|
+
function Jn(e) {
|
|
5057
5102
|
let t = [], n = [], r = "", i = !1;
|
|
5058
5103
|
for (let a = 0; a < e.length; a++) {
|
|
5059
5104
|
let o = e[a];
|
|
@@ -5061,10 +5106,10 @@ function Gn(e) {
|
|
|
5061
5106
|
}
|
|
5062
5107
|
return (r !== "" || n.length > 0) && (n.push(r), t.push(n)), t;
|
|
5063
5108
|
}
|
|
5064
|
-
function
|
|
5109
|
+
function Yn(e, t) {
|
|
5065
5110
|
return e?.row === t?.row && e?.column === t?.column;
|
|
5066
5111
|
}
|
|
5067
|
-
var
|
|
5112
|
+
var Xn = class {
|
|
5068
5113
|
grid;
|
|
5069
5114
|
constructor(e) {
|
|
5070
5115
|
this.grid = e;
|
|
@@ -5110,7 +5155,7 @@ var qn = class {
|
|
|
5110
5155
|
row: e,
|
|
5111
5156
|
column: t
|
|
5112
5157
|
}, i = n && this._anchor ? this._anchor : r;
|
|
5113
|
-
|
|
5158
|
+
Yn(this._focus, r) && Yn(this._anchor, i) || (this._anchor = i, this._focus = r, this.grid.notifyRows(), this.emit(n ? "extend" : "select"));
|
|
5114
5159
|
}
|
|
5115
5160
|
syncCurrent(e, t) {
|
|
5116
5161
|
this.isCurrent(e, t) || this.setCurrent(e, t);
|
|
@@ -5125,7 +5170,7 @@ var qn = class {
|
|
|
5125
5170
|
this._dragging && this.setCurrent(e, t, !0);
|
|
5126
5171
|
}
|
|
5127
5172
|
endDrag = () => {
|
|
5128
|
-
this._dragging && (this._dragging = !1, this.grid.notifyRows());
|
|
5173
|
+
this._dragging && (this._dragging = !1, this.grid.notifyRows(), this.reportBlock());
|
|
5129
5174
|
};
|
|
5130
5175
|
columnsOf(e = this.bounds) {
|
|
5131
5176
|
return e ? this.grid.columns.value.visibleLeafs.slice(e.startColumn, e.endColumn + 1) : [];
|
|
@@ -5155,13 +5200,24 @@ var qn = class {
|
|
|
5155
5200
|
let e = this.bounds;
|
|
5156
5201
|
return e && this.rangeOf(e);
|
|
5157
5202
|
}
|
|
5203
|
+
get block() {
|
|
5204
|
+
let e = this.bounds;
|
|
5205
|
+
return e && {
|
|
5206
|
+
startRow: e.startRow,
|
|
5207
|
+
endRow: e.endRow,
|
|
5208
|
+
columns: this.columnsOf(e).map((e) => e.key)
|
|
5209
|
+
};
|
|
5210
|
+
}
|
|
5158
5211
|
emit(e) {
|
|
5159
|
-
this.grid.props.onRangeChange?.(this.range, { reason: e });
|
|
5212
|
+
this.grid.props.onRangeChange?.(this.range, { reason: e }), e === "extend" && !this._dragging && this.reportBlock();
|
|
5213
|
+
}
|
|
5214
|
+
reportBlock() {
|
|
5215
|
+
this.enabled && this._anchor && !Yn(this._anchor, this._focus) && this.grid.reportInteraction("rangeChange", this.block, "extend");
|
|
5160
5216
|
}
|
|
5161
5217
|
onCopy = (e) => {
|
|
5162
5218
|
if (!this._focus || !e.clipboardData) return;
|
|
5163
5219
|
let t = e.currentTarget.ownerDocument.defaultView?.getSelection();
|
|
5164
|
-
t && !t.isCollapsed || (e.clipboardData.setData("text/plain",
|
|
5220
|
+
t && !t.isCollapsed || (e.clipboardData.setData("text/plain", qn(this.values())), e.preventDefault(), this.grid.reportInteraction("copy", this.block, "copy"));
|
|
5165
5221
|
};
|
|
5166
5222
|
pasteBounds(e, t) {
|
|
5167
5223
|
let n = this.bounds;
|
|
@@ -5178,10 +5234,10 @@ var qn = class {
|
|
|
5178
5234
|
if (!this._focus || !e.clipboardData || this.grid.edits.isOpen || !this.grid.edits.enabled) return;
|
|
5179
5235
|
let t = e.clipboardData.getData("text/plain");
|
|
5180
5236
|
if (!t) return;
|
|
5181
|
-
let n =
|
|
5237
|
+
let n = Jn(t), r = n.reduce((e, t) => Math.max(e, t.length), 0), i = this.pasteBounds(n.length, r);
|
|
5182
5238
|
i && (e.preventDefault(), this.grid.edits.paste(i, (e, t) => n[e % n.length][t % r] ?? ""));
|
|
5183
5239
|
};
|
|
5184
|
-
},
|
|
5240
|
+
}, Zn = class extends U {
|
|
5185
5241
|
node;
|
|
5186
5242
|
level;
|
|
5187
5243
|
position;
|
|
@@ -5232,10 +5288,10 @@ var qn = class {
|
|
|
5232
5288
|
};
|
|
5233
5289
|
//#endregion
|
|
5234
5290
|
//#region src/components/dataGrid/models/treeModel.ts
|
|
5235
|
-
function
|
|
5291
|
+
function Qn(e) {
|
|
5236
5292
|
return JSON.stringify(e);
|
|
5237
5293
|
}
|
|
5238
|
-
var
|
|
5294
|
+
var $n = class {
|
|
5239
5295
|
grid;
|
|
5240
5296
|
constructor(e) {
|
|
5241
5297
|
this.grid = e;
|
|
@@ -5289,9 +5345,9 @@ var Xn = class {
|
|
|
5289
5345
|
data: e,
|
|
5290
5346
|
children: []
|
|
5291
5347
|
};
|
|
5292
|
-
n.set(
|
|
5348
|
+
n.set(Qn(r), i);
|
|
5293
5349
|
let a;
|
|
5294
|
-
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(
|
|
5350
|
+
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(Qn(r.slice(0, e)));
|
|
5295
5351
|
(a ? a.children : t).push(i);
|
|
5296
5352
|
}), t;
|
|
5297
5353
|
}
|
|
@@ -5337,7 +5393,7 @@ var Xn = class {
|
|
|
5337
5393
|
}
|
|
5338
5394
|
rowList() {
|
|
5339
5395
|
let e = 0, t = (n, r, i) => n.map((a, o) => {
|
|
5340
|
-
let s = new
|
|
5396
|
+
let s = new Zn(this.grid, a, e++, r, o, n.length, i);
|
|
5341
5397
|
return s.treeExpanded && (s.children = t(a.children, r + 1, s)), s;
|
|
5342
5398
|
});
|
|
5343
5399
|
return t(this.nodes.value, 0);
|
|
@@ -5377,10 +5433,12 @@ var Xn = class {
|
|
|
5377
5433
|
}
|
|
5378
5434
|
toggle = (e, t) => {
|
|
5379
5435
|
let n = !this.isExpanded(e, t);
|
|
5380
|
-
n ? (this._opened.add(e), this._closed.delete(e)) : (this._closed.add(e), this._opened.delete(e)), this.grid.treeExpansionChanged()
|
|
5436
|
+
n ? (this._opened.add(e), this._closed.delete(e)) : (this._closed.add(e), this._opened.delete(e)), this.grid.treeExpansionChanged();
|
|
5437
|
+
let r = this.expandedKeys();
|
|
5438
|
+
this.grid.fire("expandedTreeKeysChange", r, n ? "expand" : "collapse", { details: { rowKey: e } }), this.grid.notify();
|
|
5381
5439
|
};
|
|
5382
|
-
},
|
|
5383
|
-
function
|
|
5440
|
+
}, er = {};
|
|
5441
|
+
function tr(e) {
|
|
5384
5442
|
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
|
|
5385
5443
|
if (!(e instanceof Date) && typeof e != "string" && typeof e != "number") return null;
|
|
5386
5444
|
let t = e instanceof Date ? e : new Date(e);
|
|
@@ -5388,7 +5446,7 @@ function Qn(e) {
|
|
|
5388
5446
|
let n = (e) => String(e).padStart(2, "0");
|
|
5389
5447
|
return `${String(t.getFullYear()).padStart(4, "0")}-${n(t.getMonth() + 1)}-${n(t.getDate())}`;
|
|
5390
5448
|
}
|
|
5391
|
-
var
|
|
5449
|
+
var nr = class e {
|
|
5392
5450
|
props;
|
|
5393
5451
|
constructor(e, t) {
|
|
5394
5452
|
this.props = e, t && this.listeners.add(t);
|
|
@@ -5419,9 +5477,9 @@ var $n = class t {
|
|
|
5419
5477
|
get headerVersion() {
|
|
5420
5478
|
return `${this._epoch}:${this._selectionVersion}`;
|
|
5421
5479
|
}
|
|
5422
|
-
setProps(
|
|
5480
|
+
setProps(t) {
|
|
5423
5481
|
let n = this.props;
|
|
5424
|
-
n !==
|
|
5482
|
+
n !== t && (e.drawnPropsChanged(n, t) && this._epoch++, this.props = t, n.def !== t.def && this.sourceColumns.clear(), (n.data !== t.data || n.def !== t.def || n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters || n.expandedRowKeys !== t.expandedRowKeys || n.expandedTreeKeys !== t.expandedTreeKeys || n.page !== t.page || n.pageSize !== t.pageSize) && this.rows.clear(), (n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters) && this.leaveSelectionView(), (n.data !== t.data || n.def !== t.def || n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters) && this.tree.nodes.clear());
|
|
5425
5483
|
}
|
|
5426
5484
|
get data() {
|
|
5427
5485
|
return this.props.data ?? [];
|
|
@@ -5456,7 +5514,7 @@ var $n = class t {
|
|
|
5456
5514
|
let e = this.props.def.localeText, t = this._localeText;
|
|
5457
5515
|
if (t && t.from === e) return t.text;
|
|
5458
5516
|
let n = {
|
|
5459
|
-
...
|
|
5517
|
+
...Un,
|
|
5460
5518
|
...e
|
|
5461
5519
|
};
|
|
5462
5520
|
return this._localeText = {
|
|
@@ -5469,17 +5527,17 @@ var $n = class t {
|
|
|
5469
5527
|
if (this.groupColumns.size > 0 && t.push(new Q({ key: K }, this)), t.push(...e.columns.map((e) => new Q(e, this))), e.rowSelection) {
|
|
5470
5528
|
let n = typeof e.rowSelection == "object" && e.rowSelection.pinned ? "START" : void 0;
|
|
5471
5529
|
t.unshift(new Q({
|
|
5472
|
-
key:
|
|
5530
|
+
key: Ye,
|
|
5473
5531
|
pin: n,
|
|
5474
5532
|
width: 50,
|
|
5475
5533
|
align: "center",
|
|
5476
|
-
Cell:
|
|
5534
|
+
Cell: vn
|
|
5477
5535
|
}, this));
|
|
5478
5536
|
}
|
|
5479
5537
|
if (e.showRowNumber) {
|
|
5480
5538
|
let n, r = 70;
|
|
5481
5539
|
typeof e.showRowNumber == "object" && (e.showRowNumber.pinned && (n = "START"), r = e.showRowNumber.width ?? 70), t.unshift(new Q({
|
|
5482
|
-
key:
|
|
5540
|
+
key: Je,
|
|
5483
5541
|
pin: n,
|
|
5484
5542
|
width: r,
|
|
5485
5543
|
align: "end"
|
|
@@ -5488,12 +5546,12 @@ var $n = class t {
|
|
|
5488
5546
|
if (e.rowDetail) {
|
|
5489
5547
|
let n = e.rowDetail.pinned ? "START" : void 0, r = e.rowDetail.expandColumnWidth ?? 50, i = e.rowDetail.expandColumnHeader ?? "";
|
|
5490
5548
|
t.unshift(new Q({
|
|
5491
|
-
key:
|
|
5549
|
+
key: Xe,
|
|
5492
5550
|
header: i,
|
|
5493
5551
|
pin: n,
|
|
5494
5552
|
width: r,
|
|
5495
5553
|
align: "center",
|
|
5496
|
-
Cell:
|
|
5554
|
+
Cell: _n
|
|
5497
5555
|
}, this));
|
|
5498
5556
|
}
|
|
5499
5557
|
return t;
|
|
@@ -5512,10 +5570,10 @@ var $n = class t {
|
|
|
5512
5570
|
leafs: i,
|
|
5513
5571
|
visibleLeafs: a,
|
|
5514
5572
|
userVisibleLeafs: a.filter((e) => ![
|
|
5515
|
-
|
|
5516
|
-
|
|
5573
|
+
Je,
|
|
5574
|
+
Ye,
|
|
5517
5575
|
K,
|
|
5518
|
-
|
|
5576
|
+
Xe
|
|
5519
5577
|
].includes(e.key)),
|
|
5520
5578
|
maxDeath: G.maxBy(r, (e) => e.death) + 1
|
|
5521
5579
|
};
|
|
@@ -5552,7 +5610,7 @@ var $n = class t {
|
|
|
5552
5610
|
let t = this.globalFilterValue.trim();
|
|
5553
5611
|
return !t || this.globalFilterColumns.value.some((n) => {
|
|
5554
5612
|
let r = e[n];
|
|
5555
|
-
return r != null &&
|
|
5613
|
+
return r != null && gn(t, String(r));
|
|
5556
5614
|
});
|
|
5557
5615
|
}
|
|
5558
5616
|
matchesColumnFilters(e) {
|
|
@@ -5564,7 +5622,7 @@ var $n = class t {
|
|
|
5564
5622
|
}
|
|
5565
5623
|
matchesFilter(e, t) {
|
|
5566
5624
|
switch (t.type) {
|
|
5567
|
-
case "text": return !t.value.trim() || e != null &&
|
|
5625
|
+
case "text": return !t.value.trim() || e != null && gn(t.value, String(e));
|
|
5568
5626
|
case "number": {
|
|
5569
5627
|
if (e == null) return !1;
|
|
5570
5628
|
let n = typeof e == "number" ? e : parseFloat(String(e));
|
|
@@ -5582,7 +5640,7 @@ var $n = class t {
|
|
|
5582
5640
|
}
|
|
5583
5641
|
case "date": {
|
|
5584
5642
|
if (!t.value) return !0;
|
|
5585
|
-
let n =
|
|
5643
|
+
let n = tr(e);
|
|
5586
5644
|
if (!n) return !1;
|
|
5587
5645
|
switch (t.operator) {
|
|
5588
5646
|
case "on": return n === t.value;
|
|
@@ -5604,6 +5662,30 @@ var $n = class t {
|
|
|
5604
5662
|
}
|
|
5605
5663
|
return this.hasRowFilters ? this.data.filter((e) => this.rowMatchesFilters(e)) : this.data;
|
|
5606
5664
|
}
|
|
5665
|
+
reportInteraction(e, t, n, r, a) {
|
|
5666
|
+
this._batching || i({
|
|
5667
|
+
component: "datagrid",
|
|
5668
|
+
type: e,
|
|
5669
|
+
reason: n,
|
|
5670
|
+
value: t,
|
|
5671
|
+
details: r,
|
|
5672
|
+
content: a,
|
|
5673
|
+
target: this._sizingElement ?? void 0
|
|
5674
|
+
});
|
|
5675
|
+
}
|
|
5676
|
+
fire(e, t, n, r = {}) {
|
|
5677
|
+
let i = this.props[`on${e.charAt(0).toUpperCase()}${e.slice(1)}`];
|
|
5678
|
+
i?.(t, { reason: n }), r && this.reportInteraction(e, t, n, r.details, r.content);
|
|
5679
|
+
}
|
|
5680
|
+
_batching = !1;
|
|
5681
|
+
quietly(e) {
|
|
5682
|
+
this._batching = !0;
|
|
5683
|
+
try {
|
|
5684
|
+
e();
|
|
5685
|
+
} finally {
|
|
5686
|
+
this._batching = !1;
|
|
5687
|
+
}
|
|
5688
|
+
}
|
|
5607
5689
|
fireServerStateChange(e, t) {
|
|
5608
5690
|
this.props.onServerStateChange?.({
|
|
5609
5691
|
page: t?.page ?? this.page,
|
|
@@ -5615,34 +5697,41 @@ var $n = class t {
|
|
|
5615
5697
|
}, { reason: e });
|
|
5616
5698
|
}
|
|
5617
5699
|
firePaginationChange(e, t, n) {
|
|
5618
|
-
this.
|
|
5700
|
+
this.fire("paginationChange", {
|
|
5619
5701
|
page: e,
|
|
5620
5702
|
pageSize: t
|
|
5621
|
-
},
|
|
5703
|
+
}, n, (n === "page" || n === "page-size") && {}), this.props.onPageChange?.(e, t);
|
|
5622
5704
|
}
|
|
5623
5705
|
resetToFirstPage(e) {
|
|
5624
5706
|
return !this.isPaginated || this.page === 1 ? this.page : (this._page = 1, this.firePaginationChange(1, this.pageSize, e), 1);
|
|
5625
5707
|
}
|
|
5626
5708
|
setGlobalFilter = (e) => {
|
|
5627
|
-
let t = e === "" ? "clear" : "filter";
|
|
5628
|
-
this._globalFilterValue = e, this.leaveSelectionView(), this.
|
|
5629
|
-
let
|
|
5709
|
+
let t = e === "" ? "clear" : "filter", n = e !== this.globalFilterValue;
|
|
5710
|
+
this._globalFilterValue = e, this.leaveSelectionView(), this.fire("globalFilterChange", e, t, n && { content: ["value"] });
|
|
5711
|
+
let r = this.resetToFirstPage(t);
|
|
5630
5712
|
this.fireServerStateChange(t, {
|
|
5631
5713
|
globalFilterValue: e,
|
|
5632
|
-
page:
|
|
5714
|
+
page: r
|
|
5633
5715
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5634
5716
|
};
|
|
5635
5717
|
setColumnFilter = (e, t) => {
|
|
5636
|
-
let n = { ...this.columnFilters }, r = t === void 0 ? "clear" : "filter";
|
|
5637
|
-
t === void 0 ? delete n[e] : n[e] = t, this._columnFilters = n, this.leaveSelectionView(), this.
|
|
5638
|
-
|
|
5718
|
+
let n = { ...this.columnFilters }, r = t === void 0 ? "clear" : "filter", i = t !== void 0 || e in n;
|
|
5719
|
+
t === void 0 ? delete n[e] : n[e] = t, this._columnFilters = n, this.leaveSelectionView(), this.fire("columnFiltersChange", n, r, i && {
|
|
5720
|
+
details: {
|
|
5721
|
+
columnKey: e,
|
|
5722
|
+
filter: t
|
|
5723
|
+
},
|
|
5724
|
+
content: ["value", "filter"]
|
|
5725
|
+
});
|
|
5726
|
+
let a = this.resetToFirstPage(r);
|
|
5639
5727
|
this.fireServerStateChange(r, {
|
|
5640
5728
|
columnFilters: n,
|
|
5641
|
-
page:
|
|
5729
|
+
page: a
|
|
5642
5730
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5643
5731
|
};
|
|
5644
5732
|
clearColumnFilters = () => {
|
|
5645
|
-
|
|
5733
|
+
let e = Object.keys(this.columnFilters).length > 0;
|
|
5734
|
+
this._columnFilters = {}, this.leaveSelectionView(), this.fire("columnFiltersChange", {}, "clear", e && {}), this.fireServerStateChange("clear", { columnFilters: {} }), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5646
5735
|
};
|
|
5647
5736
|
clearAllFilters = () => {
|
|
5648
5737
|
this.setGlobalFilter(""), this.clearColumnFilters();
|
|
@@ -5685,7 +5774,7 @@ var $n = class t {
|
|
|
5685
5774
|
return this._sortColumn === "grouping-cell" && (e = G.sortBy(e, (e) => e[i], this._sortDirection)), G.groupBy(e, (e) => e[i]).map((e) => {
|
|
5686
5775
|
let i;
|
|
5687
5776
|
i = n.size > 0 ? t(e.values, new Set(n), r + 1) : e.values.map((e, t) => new U(this, e, r + 1 + t));
|
|
5688
|
-
let o = new
|
|
5777
|
+
let o = new st(this, a, i, r, e.key);
|
|
5689
5778
|
return r += 1, o.expanded && (r += i.length), o;
|
|
5690
5779
|
});
|
|
5691
5780
|
};
|
|
@@ -5735,7 +5824,7 @@ var $n = class t {
|
|
|
5735
5824
|
e && Object.entries(this.sizes.value).forEach(([t, n]) => e.style.setProperty(t, n));
|
|
5736
5825
|
};
|
|
5737
5826
|
get isRtl() {
|
|
5738
|
-
return
|
|
5827
|
+
return n(this._sizingElement);
|
|
5739
5828
|
}
|
|
5740
5829
|
setContainerWidth = (e) => {
|
|
5741
5830
|
this._containerWidth !== e && (this._containerWidth = e, this.flexWidths.clear(), this.notify());
|
|
@@ -5773,7 +5862,7 @@ var $n = class t {
|
|
|
5773
5862
|
let t = new Set(this.expandedDetailRows);
|
|
5774
5863
|
t.has(e) ? t.delete(e) : t.add(e);
|
|
5775
5864
|
let n = t.has(e);
|
|
5776
|
-
this._revealDetailKey = n && this.props.def.rowDetail?.scrollIntoView !== !1 ? e : null, this._expandedDetailRows = t, this.
|
|
5865
|
+
this._revealDetailKey = n && this.props.def.rowDetail?.scrollIntoView !== !1 ? e : null, this._expandedDetailRows = t, this.fire("expandedRowKeysChange", Array.from(t), n ? "expand" : "collapse", { details: { rowKey: e } }), this.rows.clear(), this.notify();
|
|
5777
5866
|
};
|
|
5778
5867
|
_page = 1;
|
|
5779
5868
|
_pageSize;
|
|
@@ -5826,23 +5915,23 @@ var $n = class t {
|
|
|
5826
5915
|
totalHeight: t
|
|
5827
5916
|
};
|
|
5828
5917
|
}, () => [this.flatRows]);
|
|
5829
|
-
viewport = new
|
|
5830
|
-
columnVisibility = new
|
|
5831
|
-
filter = new
|
|
5832
|
-
pagination = new
|
|
5833
|
-
aggregation = new
|
|
5834
|
-
exporter = new
|
|
5835
|
-
source = new
|
|
5836
|
-
tree = new
|
|
5837
|
-
edits = new
|
|
5838
|
-
range = new
|
|
5839
|
-
list = new
|
|
5918
|
+
viewport = new xe(this);
|
|
5919
|
+
columnVisibility = new Sn(this);
|
|
5920
|
+
filter = new Ln(this);
|
|
5921
|
+
pagination = new Wn(this);
|
|
5922
|
+
aggregation = new it(this);
|
|
5923
|
+
exporter = new In(this);
|
|
5924
|
+
source = new Mn(this);
|
|
5925
|
+
tree = new $n(this);
|
|
5926
|
+
edits = new Ve(this);
|
|
5927
|
+
range = new Xn(this);
|
|
5928
|
+
list = new Rn(this);
|
|
5840
5929
|
refresh = () => {
|
|
5841
5930
|
this.edits.clearEdits(), this.source.invalidate();
|
|
5842
5931
|
};
|
|
5843
5932
|
get exportConfig() {
|
|
5844
5933
|
let e = this.props.def.export;
|
|
5845
|
-
if (e) return typeof e == "object" ? e :
|
|
5934
|
+
if (e) return typeof e == "object" ? e : er;
|
|
5846
5935
|
}
|
|
5847
5936
|
exportCsv = async (e = {}) => {
|
|
5848
5937
|
let { downloadCsv: t } = await import("../gridExport.mjs");
|
|
@@ -5895,7 +5984,7 @@ var $n = class t {
|
|
|
5895
5984
|
return !!this.props.def.rowSelection && !this.source.enabled && !this.isPaginated && !this.tree.isEager;
|
|
5896
5985
|
}
|
|
5897
5986
|
toggleSelectionView = () => {
|
|
5898
|
-
this._selectionView = this._selectionView ? null : new Set(this.selectedRows), this.rows.clear(), this.notify();
|
|
5987
|
+
this._selectionView = this._selectionView ? null : new Set(this.selectedRows), this.reportInteraction("selectionViewChange", this._selectionView !== null, this._selectionView ? "show" : "hide"), this.rows.clear(), this.notify();
|
|
5899
5988
|
};
|
|
5900
5989
|
leaveSelectionView() {
|
|
5901
5990
|
this._selectionView = null;
|
|
@@ -5936,7 +6025,7 @@ var $n = class t {
|
|
|
5936
6025
|
columnKey: this._sortColumn,
|
|
5937
6026
|
direction: this._sortDirection
|
|
5938
6027
|
} : void 0;
|
|
5939
|
-
this.
|
|
6028
|
+
this.fire("sortingChange", n, n ? "sort" : "clear", { details: { columnKey: e } }), this.props.onSortChange?.(this._sortColumn, this._sortDirection);
|
|
5940
6029
|
let r = this.resetToFirstPage("sort");
|
|
5941
6030
|
this.fireServerStateChange("sort", {
|
|
5942
6031
|
sortColumn: this._sortColumn,
|
|
@@ -5945,15 +6034,15 @@ var $n = class t {
|
|
|
5945
6034
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5946
6035
|
};
|
|
5947
6036
|
pinColumn = (e, t) => {
|
|
5948
|
-
let n =
|
|
6037
|
+
let n = yn(t), r = G.findOrThrow(this.columns.value.flat, (t) => t.uniqueKey === e);
|
|
5949
6038
|
r.pin !== n && r.pinColumn(n), this.columns.clear(), this.notify();
|
|
5950
6039
|
};
|
|
5951
6040
|
toggleGrouping = (e) => {
|
|
5952
|
-
this.groupColumns = new Set(this.groupColumns), this.hiddenColumns = new Set(this.hiddenColumns), this.groupColumns.has(e) ? (this.groupColumns.delete(e), this.hiddenColumns.delete(e)) : (this.groupColumns.add(e), this.hiddenColumns.add(e)), this.collapseGroups(), this.sourceColumns.clear(), this.notify();
|
|
6041
|
+
this.groupColumns = new Set(this.groupColumns), this.hiddenColumns = new Set(this.hiddenColumns), this.groupColumns.has(e) ? (this.groupColumns.delete(e), this.hiddenColumns.delete(e)) : (this.groupColumns.add(e), this.hiddenColumns.add(e)), this.reportInteraction("groupingChange", Array.from(this.groupColumns), this.groupColumns.has(e) ? "group" : "ungroup", { columnKey: e }), this.collapseGroups(), this.sourceColumns.clear(), this.notify();
|
|
5953
6042
|
};
|
|
5954
6043
|
unGroupAll = () => {
|
|
5955
6044
|
let e = new Set(this.groupColumns);
|
|
5956
|
-
this.groupColumns = /* @__PURE__ */ new Set(), this.hiddenColumns = new Set(Array.from(this.hiddenColumns).filter((t) => !e.has(t))), this.collapseGroups(), this.sourceColumns.clear(), this.notify();
|
|
6045
|
+
this.groupColumns = /* @__PURE__ */ new Set(), this.hiddenColumns = new Set(Array.from(this.hiddenColumns).filter((t) => !e.has(t))), this.reportInteraction("groupingChange", [], "clear"), this.collapseGroups(), this.sourceColumns.clear(), this.notify();
|
|
5957
6046
|
};
|
|
5958
6047
|
collapseGroups() {
|
|
5959
6048
|
this.expandedGroupRow = /* @__PURE__ */ new Set(), this._collapsedGroupRow = /* @__PURE__ */ new Set(), this.source.expansionChanged(), this.source.invalidate();
|
|
@@ -5970,7 +6059,7 @@ var $n = class t {
|
|
|
5970
6059
|
}
|
|
5971
6060
|
_collapsedGroupRow = /* @__PURE__ */ new Set();
|
|
5972
6061
|
toggleGroupRow = (e, t = this.expandedGroupRow.has(e)) => {
|
|
5973
|
-
this._expansion++, this.expandedGroupRow = new Set(this.expandedGroupRow), this._collapsedGroupRow = new Set(this._collapsedGroupRow), t ? (this.expandedGroupRow.delete(e), this._collapsedGroupRow.add(e)) : (this.expandedGroupRow.add(e), this._collapsedGroupRow.delete(e)), this.source.expansionChanged(), this.rows.clear(), this.notify();
|
|
6062
|
+
this._expansion++, this.expandedGroupRow = new Set(this.expandedGroupRow), this._collapsedGroupRow = new Set(this._collapsedGroupRow), t ? (this.expandedGroupRow.delete(e), this._collapsedGroupRow.add(e)) : (this.expandedGroupRow.add(e), this._collapsedGroupRow.delete(e)), this.reportInteraction("groupExpandedChange", !t, t ? "collapse" : "expand", { groupRowKey: e }), this.source.expansionChanged(), this.rows.clear(), this.notify();
|
|
5974
6063
|
};
|
|
5975
6064
|
treeExpansionChanged() {
|
|
5976
6065
|
this._expansion++, this.source.expansionChanged(), this.rows.clear();
|
|
@@ -5995,7 +6084,10 @@ var $n = class t {
|
|
|
5995
6084
|
selectionChanged(e, t, n) {
|
|
5996
6085
|
this._selectionVersion++, this.flatRows.clear(), this.notifyRows();
|
|
5997
6086
|
let r = Array.from(this.selectedRows);
|
|
5998
|
-
this.
|
|
6087
|
+
this.fire("selectedRowKeysChange", r, n, { details: {
|
|
6088
|
+
action: t,
|
|
6089
|
+
affectedRowKeys: e
|
|
6090
|
+
} }), this.props.onSelectionChange?.({
|
|
5999
6091
|
action: t,
|
|
6000
6092
|
affectedRowKeys: e,
|
|
6001
6093
|
selectedRowKeys: r,
|
|
@@ -6003,7 +6095,7 @@ var $n = class t {
|
|
|
6003
6095
|
});
|
|
6004
6096
|
}
|
|
6005
6097
|
toggleColumnVisibility = (e) => {
|
|
6006
|
-
this.hiddenColumns = new Set(this.hiddenColumns), this.hiddenColumns.has(e) ? this.hiddenColumns.delete(e) : this.hiddenColumns.add(e), this.columns.clear(), this.notify();
|
|
6098
|
+
this.hiddenColumns = new Set(this.hiddenColumns), this.hiddenColumns.has(e) ? this.hiddenColumns.delete(e) : this.hiddenColumns.add(e), this.reportInteraction("columnVisibilityChange", !this.hiddenColumns.has(e), this.hiddenColumns.has(e) ? "hide" : "show", { columnKey: e }), this.columns.clear(), this.notify();
|
|
6007
6099
|
};
|
|
6008
6100
|
setWidth = (e, t) => {
|
|
6009
6101
|
this.columnWidths.set(e, t);
|
|
@@ -6034,73 +6126,73 @@ var $n = class t {
|
|
|
6034
6126
|
};
|
|
6035
6127
|
//#endregion
|
|
6036
6128
|
//#region src/components/dataGrid/useGrid.ts
|
|
6037
|
-
function
|
|
6038
|
-
let [t] =
|
|
6039
|
-
return t.setProps(e), t.setIdentifier(n),
|
|
6129
|
+
function rr(e) {
|
|
6130
|
+
let [t] = F(() => new nr(e)), n = d("datagrid");
|
|
6131
|
+
return t.setProps(e), t.setIdentifier(n), oe(t.subscribe, t.getSnapshot, t.getSnapshot), t;
|
|
6040
6132
|
}
|
|
6041
6133
|
//#endregion
|
|
6042
6134
|
//#region src/components/dataGrid/useListLayout.ts
|
|
6043
|
-
var
|
|
6044
|
-
function
|
|
6045
|
-
return
|
|
6135
|
+
var ir, ar;
|
|
6136
|
+
function or() {
|
|
6137
|
+
return ar ??= import("../dataGridList.mjs").then((e) => ir = e.default), ar;
|
|
6046
6138
|
}
|
|
6047
|
-
t("(max-width: 36rem)")?.matches &&
|
|
6048
|
-
function
|
|
6049
|
-
let [t, n] =
|
|
6050
|
-
return
|
|
6139
|
+
t("(max-width: 36rem)")?.matches && or();
|
|
6140
|
+
function sr(e) {
|
|
6141
|
+
let [t, n] = F(() => ir);
|
|
6142
|
+
return N(() => {
|
|
6051
6143
|
if (!e || t) return;
|
|
6052
6144
|
let r = !0;
|
|
6053
|
-
return
|
|
6145
|
+
return or().then((e) => r && n(() => e)), () => {
|
|
6054
6146
|
r = !1;
|
|
6055
6147
|
};
|
|
6056
6148
|
}, [e, t]), t;
|
|
6057
6149
|
}
|
|
6058
6150
|
//#endregion
|
|
6059
6151
|
//#region src/components/dataGrid.tsx
|
|
6060
|
-
function
|
|
6061
|
-
let n =
|
|
6062
|
-
|
|
6152
|
+
function cr(e, t) {
|
|
6153
|
+
let n = rr(e), i = P(null);
|
|
6154
|
+
ne(t, () => ({
|
|
6063
6155
|
get element() {
|
|
6064
|
-
return
|
|
6156
|
+
return i.current;
|
|
6065
6157
|
},
|
|
6066
6158
|
exportCsv: n.exportCsv,
|
|
6067
6159
|
exportXlsx: n.exportXlsx,
|
|
6068
6160
|
refresh: n.refresh,
|
|
6069
6161
|
clearEdits: n.edits.clearEdits
|
|
6070
6162
|
}), [n]);
|
|
6071
|
-
let { component: o, data: s, def: c, loading: l, filters: u, globalFilterValue: d, columnFilters: f, expandedRowKeys: p, expandedTreeKeys:
|
|
6163
|
+
let { component: o, data: s, def: c, loading: l, filters: u, globalFilterValue: d, columnFilters: f, expandedRowKeys: p, expandedTreeKeys: m, page: h, pageSize: _, onSelectedRowKeysChange: v, onSelectionChange: y, onGlobalFilterChange: b, onColumnFiltersChange: x, onExpandedRowKeysChange: S, onExpandedTreeKeysChange: C, onCellEditsChange: w, onPaginationChange: T, onPageChange: E, onPageSizeChange: ee, onSortingChange: D, onSortChange: te, onServerStateChange: O, style: k, ...A } = e;
|
|
6072
6164
|
re(() => {
|
|
6073
|
-
let e =
|
|
6165
|
+
let e = i.current;
|
|
6074
6166
|
if (e) return n.setSizingElement(e), () => n.setSizingElement(null);
|
|
6075
6167
|
}, [n]), r(() => {
|
|
6076
|
-
let e =
|
|
6168
|
+
let e = i.current;
|
|
6077
6169
|
if (!e) return;
|
|
6078
6170
|
n.list.setWidth(e.clientWidth);
|
|
6079
6171
|
let t = new ResizeObserver(() => n.list.setWidth(e.clientWidth));
|
|
6080
6172
|
return t.observe(e), () => t.disconnect();
|
|
6081
6173
|
}, [n]);
|
|
6082
|
-
let
|
|
6083
|
-
return /* @__PURE__ */
|
|
6084
|
-
ref:
|
|
6174
|
+
let j = n.list.active, M = sr(j);
|
|
6175
|
+
return /* @__PURE__ */ R(a, {
|
|
6176
|
+
ref: i,
|
|
6085
6177
|
component: n.componentName,
|
|
6086
|
-
variant: { list: !!M &&
|
|
6087
|
-
...
|
|
6178
|
+
variant: { list: !!M && j },
|
|
6179
|
+
...A,
|
|
6088
6180
|
style: {
|
|
6089
6181
|
...n.sizes.value,
|
|
6090
|
-
...
|
|
6182
|
+
...k
|
|
6091
6183
|
},
|
|
6092
|
-
children: [M &&
|
|
6093
|
-
n.props.def.topBar && /* @__PURE__ */
|
|
6094
|
-
/* @__PURE__ */
|
|
6095
|
-
/* @__PURE__ */
|
|
6096
|
-
n.props.def.bottomBar && /* @__PURE__ */
|
|
6097
|
-
] }), /* @__PURE__ */
|
|
6184
|
+
children: [M && j ? /* @__PURE__ */ L(M, { grid: n }) : /* @__PURE__ */ R(I, { children: [
|
|
6185
|
+
n.props.def.topBar && /* @__PURE__ */ L(mn, { grid: n }),
|
|
6186
|
+
/* @__PURE__ */ L(an, { grid: n }),
|
|
6187
|
+
/* @__PURE__ */ L(rn, { grid: n }),
|
|
6188
|
+
n.props.def.bottomBar && /* @__PURE__ */ L(_e, { grid: n })
|
|
6189
|
+
] }), /* @__PURE__ */ L(g, {
|
|
6098
6190
|
props: { role: "status" },
|
|
6099
6191
|
children: n.selectionAnnouncement
|
|
6100
6192
|
})]
|
|
6101
6193
|
});
|
|
6102
6194
|
}
|
|
6103
|
-
var
|
|
6104
|
-
|
|
6195
|
+
var lr = k(cr);
|
|
6196
|
+
cr.displayName = "DataGrid";
|
|
6105
6197
|
//#endregion
|
|
6106
|
-
export {
|
|
6198
|
+
export { Un as DATA_GRID_LOCALE_TEXT, nn as a, Z as c, yt as d, lr as default, Y as f, an as i, Ct as l, De as m, ln as n, Ut as o, W as p, sn as r, Pt as s, dn as t, St as u };
|