@box-kite/react 2.2.3 → 2.2.5
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 +8 -0
- package/.claude/skills/box-kite/SKILL.md +8 -0
- package/.claude/skills/box-kite/references/components.md +49 -3
- package/.cursor/rules/box-kite.mdc +8 -0
- package/AGENTS.md +8 -0
- package/BOX_AI_CONTEXT.md +276 -20
- package/BOX_KITE_AI_CONTEXT.md +276 -20
- package/behavior.cjs +1 -1
- package/behavior.mjs +57 -57
- package/box.cjs +1 -1
- package/box.d.ts +5 -0
- package/box.mjs +17 -17
- package/catalog.cjs +1 -1
- package/catalog.mjs +385 -0
- package/client.cjs +1 -1
- package/client.mjs +113 -87
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid/components/dataGridList.d.ts +12 -0
- package/components/dataGrid/components/dataGridListAggregate.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilter.d.ts +7 -0
- package/components/dataGrid/components/dataGridListFilterSheet.d.ts +11 -0
- package/components/dataGrid/components/dataGridListFooter.d.ts +13 -0
- package/components/dataGrid/components/dataGridListGroup.d.ts +13 -0
- package/components/dataGrid/components/dataGridListItem.d.ts +21 -0
- package/components/dataGrid/components/dataGridListLayout.d.ts +20 -0
- package/components/dataGrid/components/dataGridListRecord.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSelectionBar.d.ts +11 -0
- package/components/dataGrid/components/dataGridListSheet.d.ts +30 -0
- package/components/dataGrid/components/dataGridListSortSheet.d.ts +10 -0
- package/components/dataGrid/components/dataGridListToolbar.d.ts +10 -0
- package/components/dataGrid/components/dataGridListValue.d.ts +12 -0
- package/components/dataGrid/contracts/dataGridContract.d.ts +32 -0
- package/components/dataGrid/models/gridModel.d.ts +3 -0
- package/components/dataGrid/models/listModel.d.ts +129 -0
- package/components/dataGrid/models/localeText.d.ts +32 -0
- package/components/dataGrid/models/viewportModel.d.ts +0 -2
- package/components/dataGrid/useListLayout.d.ts +13 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +1052 -788
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +85 -97
- package/components/list/listItemParts.d.ts +9 -0
- package/components/list.cjs +1 -0
- package/components/list.d.ts +118 -0
- package/components/list.mjs +391 -0
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +25 -25
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +12 -12
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +1 -1
- package/components/sortableList.cjs +1 -0
- package/components/sortableList.d.ts +49 -0
- package/components/sortableList.mjs +384 -0
- package/components/swipeItem.cjs +1 -0
- package/components/swipeItem.d.ts +52 -0
- package/components/swipeItem.mjs +321 -0
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +24 -24
- package/components/virtualList.cjs +1 -0
- package/components/virtualList.d.ts +32 -0
- package/components/virtualList.mjs +188 -0
- package/dataGridList.cjs +1 -0
- package/dataGridList.mjs +1351 -0
- package/docs/components.md +5 -1
- package/icons/closeIcon.d.ts +2 -0
- package/icons/filterIcon.d.ts +2 -0
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/mcp/src/data.d.ts +2 -0
- package/package.json +86 -22
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +4 -1
- package/react/a11y/useControllableState.d.ts +2 -1
- package/react/componentsContext.d.ts +4 -0
- package/react/componentsProvider.d.ts +10 -0
- package/react/resolveStyles.d.ts +2 -1
- package/react/theme/theme.d.ts +6 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +40 -29
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +3 -1
- package/registry/designs/store/address-form.d.ts +11 -0
- package/registry/designs/store/cart-items.d.ts +10 -0
- package/registry/designs/store/cart-page.d.ts +4 -0
- package/registry/designs/store/checkout-page.d.ts +7 -0
- package/registry/designs/store/credit-card-form.d.ts +10 -0
- package/registry/designs/store/form-field.d.ts +19 -0
- package/registry/designs/store/order-summary.d.ts +18 -0
- package/registry/designs/store/product-art.d.ts +26 -0
- package/registry/designs/store/product-card.d.ts +11 -0
- package/registry/designs/store/product-gallery.d.ts +11 -0
- package/registry/designs/store/product-grid.d.ts +10 -0
- package/registry/designs/store/product-page.d.ts +5 -0
- package/registry/designs/store/quantity-stepper.d.ts +13 -0
- package/registry/designs/store/shipping-method.d.ts +14 -0
- package/registry/designs/store/store-data.d.ts +53 -0
- package/registry/designs/store/store-design.d.ts +63 -0
- package/registry/designs/store/store-shell.d.ts +12 -0
- package/registry/designs/store/storefront-page.d.ts +4 -0
- package/registry/designs/store/variant-picker.d.ts +15 -0
- package/rsc.cjs +1 -1
- package/rsc.d.ts +2 -0
- package/rsc.mjs +1 -1
- package/scrolling.cjs +1 -0
- package/scrolling.mjs +22 -0
- package/ssg.cjs +1 -1
- package/ssg.mjs +1 -1
- package/utils/scroll/scrollUtils.d.ts +6 -0
- package/utils/sortable/sortableUtils.d.ts +25 -0
- package/utils/swipe/swipeUtils.d.ts +53 -0
- package/utils/virtual/measuredWindow.d.ts +28 -0
- package/utils/virtual/rowSearch.d.ts +11 -0
package/components/dataGrid.mjs
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { n } from "../effects.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { a
|
|
6
|
-
import { t as
|
|
7
|
-
import { Path as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import {
|
|
2
|
+
import { d as e, i as t, s as n } from "../platform.mjs";
|
|
3
|
+
import { n as r } from "../effects.mjs";
|
|
4
|
+
import i from "../box.mjs";
|
|
5
|
+
import { a, n as o, o as s, r as c, t as l } from "../behavior.mjs";
|
|
6
|
+
import { t as u } from "../identity.mjs";
|
|
7
|
+
import { Path as d, Svg as f } from "./svg.mjs";
|
|
8
|
+
import p from "./button.mjs";
|
|
9
|
+
import m from "./flex.mjs";
|
|
10
|
+
import h from "./checkbox.mjs";
|
|
11
|
+
import g from "./overlay.mjs";
|
|
12
|
+
import _ from "./presence.mjs";
|
|
13
|
+
import v from "./visuallyHidden.mjs";
|
|
14
|
+
import y from "./textbox.mjs";
|
|
15
|
+
import { n as b } from "../scrolling.mjs";
|
|
16
|
+
import x from "./grid.mjs";
|
|
17
|
+
import S from "./dropdown.mjs";
|
|
18
|
+
import { Span as C } from "./semantics.mjs";
|
|
19
|
+
import w from "./popover.mjs";
|
|
20
|
+
import T from "./switch.mjs";
|
|
21
|
+
import ee, { Fragment as te, createContext as ne, forwardRef as E, memo as D, useCallback as O, useContext as k, useEffect as A, useImperativeHandle as j, useLayoutEffect as re, useMemo as M, useRef as N, useState as P, useSyncExternalStore as ie } from "react";
|
|
22
|
+
import { Fragment as ae, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
23
|
+
import { useSyncExternalStore as oe } from "use-sync-external-store/shim";
|
|
23
24
|
//#region src/components/dataGrid/components/dataGridBottomBarSelection.tsx
|
|
24
|
-
function
|
|
25
|
-
let { grid: t } = e, n = t.selectedRows.size,
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
function se(e) {
|
|
26
|
+
let { grid: t } = e, n = t.selectedRows.size, r = t.isSelectionView;
|
|
27
|
+
return /* @__PURE__ */ I(m, {
|
|
27
28
|
component: `${t.componentName}.bottomBar.selection`,
|
|
28
29
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ F(i, {
|
|
30
31
|
component: `${t.componentName}.bottomBar.info`,
|
|
31
32
|
children: t.localeText.selectedCount(n, t.hiddenSelectedCount)
|
|
32
33
|
}),
|
|
33
|
-
t.canShowSelection && (n > 0 ||
|
|
34
|
+
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */ F(p, {
|
|
34
35
|
type: "button",
|
|
35
36
|
component: `${t.componentName}.bottomBar.action`,
|
|
36
|
-
variant: { pressed:
|
|
37
|
-
props: { "aria-pressed":
|
|
37
|
+
variant: { pressed: r },
|
|
38
|
+
props: { "aria-pressed": r },
|
|
38
39
|
onClick: t.toggleSelectionView,
|
|
39
40
|
children: t.localeText.showSelected
|
|
40
41
|
}),
|
|
41
|
-
n > 0 && /* @__PURE__ */
|
|
42
|
+
n > 0 && /* @__PURE__ */ I(p, {
|
|
42
43
|
type: "button",
|
|
43
44
|
component: `${t.componentName}.bottomBar.action`,
|
|
44
45
|
onClick: t.clearSelection,
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ F(i, {
|
|
46
47
|
tag: "span",
|
|
47
48
|
props: { "aria-hidden": !0 },
|
|
48
49
|
children: "✕"
|
|
@@ -53,74 +54,74 @@ function re(e) {
|
|
|
53
54
|
}
|
|
54
55
|
//#endregion
|
|
55
56
|
//#region src/components/dataGrid/components/dataGridPagination.tsx
|
|
56
|
-
function
|
|
57
|
-
let { grid: t } = e, { pagination: n } = t,
|
|
58
|
-
if (!
|
|
57
|
+
function ce(e) {
|
|
58
|
+
let { grid: t } = e, { pagination: n } = t, r = n.state, a = O(() => n.firstPage(), [n]), o = O(() => n.prevPage(), [n]), s = O(() => n.nextPage(), [n]), c = O(() => n.lastPage(), [n]);
|
|
59
|
+
if (!r) return null;
|
|
59
60
|
let { canGoPrev: l, canGoNext: u, totalPages: d } = n;
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ I(m, {
|
|
61
62
|
component: `${t.componentName}.bottomBar.pagination`,
|
|
62
63
|
gap: .5,
|
|
63
64
|
ai: "center",
|
|
64
65
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ F(le, {
|
|
66
67
|
grid: t,
|
|
67
|
-
pageSize:
|
|
68
|
+
pageSize: r.pageSize
|
|
68
69
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ F(de, {
|
|
70
71
|
componentName: t.componentName,
|
|
71
72
|
label: t.localeText.firstPage,
|
|
72
73
|
onClick: a,
|
|
73
74
|
disabled: !l,
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ F(he, {})
|
|
75
76
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ F(de, {
|
|
77
78
|
componentName: t.componentName,
|
|
78
79
|
label: t.localeText.previousPage,
|
|
79
80
|
onClick: o,
|
|
80
81
|
disabled: !l,
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ F(pe, {})
|
|
82
83
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ I(m, {
|
|
84
85
|
ai: "center",
|
|
85
86
|
gap: 1.5,
|
|
86
87
|
px: 2,
|
|
87
88
|
userSelect: "none",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ F(ue, {
|
|
89
90
|
grid: t,
|
|
90
|
-
page:
|
|
91
|
+
page: r.page,
|
|
91
92
|
totalPages: d
|
|
92
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ F(i, {
|
|
93
94
|
component: `${t.componentName}.bottomBar.pagination.info`,
|
|
94
95
|
fontSize: 12,
|
|
95
96
|
opacity: .7,
|
|
96
97
|
children: t.localeText.pageCount(d)
|
|
97
98
|
})]
|
|
98
99
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ F(de, {
|
|
100
101
|
componentName: t.componentName,
|
|
101
102
|
label: t.localeText.nextPage,
|
|
102
103
|
onClick: s,
|
|
103
104
|
disabled: !u,
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ F(me, {})
|
|
105
106
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ F(de, {
|
|
107
108
|
componentName: t.componentName,
|
|
108
109
|
label: t.localeText.lastPage,
|
|
109
110
|
onClick: c,
|
|
110
111
|
disabled: !u,
|
|
111
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ F(ge, {})
|
|
112
113
|
})
|
|
113
114
|
]
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
-
function
|
|
117
|
+
ce.displayName = "DataGridPagination";
|
|
118
|
+
function le({ grid: e, pageSize: t }) {
|
|
118
119
|
let n = e.pagination.pageSizeOptions;
|
|
119
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
120
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ F(m, {
|
|
120
121
|
ai: "center",
|
|
121
122
|
gap: 1,
|
|
122
123
|
me: 1,
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ F(i, {
|
|
124
125
|
component: `${e.componentName}.bottomBar.pagination.pageSize`,
|
|
125
126
|
tag: "select",
|
|
126
127
|
fontSize: 12,
|
|
@@ -131,14 +132,14 @@ function ae({ grid: e, pageSize: t }) {
|
|
|
131
132
|
value: t,
|
|
132
133
|
onChange: (t) => e.pagination.changePageSize(Number(t.target.value))
|
|
133
134
|
},
|
|
134
|
-
children: n.map((t) => /* @__PURE__ */
|
|
135
|
+
children: n.map((t) => /* @__PURE__ */ F("option", {
|
|
135
136
|
value: t,
|
|
136
137
|
children: e.localeText.pageSizeOption(t)
|
|
137
138
|
}, t))
|
|
138
139
|
})
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function ue({ grid: e, page: t, totalPages: n }) {
|
|
142
143
|
let [r, i] = P(String(t)), [a, o] = P(t);
|
|
143
144
|
t !== a && (o(t), i(String(t)));
|
|
144
145
|
let s = O(() => {
|
|
@@ -146,7 +147,7 @@ function oe({ grid: e, page: t, totalPages: n }) {
|
|
|
146
147
|
}, [e, r]), c = O((e) => {
|
|
147
148
|
e.key === "Enter" ? s() : e.key === "Escape" && i(String(t));
|
|
148
149
|
}, [s, t]);
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ F(y, {
|
|
150
151
|
type: "number",
|
|
151
152
|
variant: "compact",
|
|
152
153
|
value: r,
|
|
@@ -162,9 +163,9 @@ function oe({ grid: e, page: t, totalPages: n }) {
|
|
|
162
163
|
}
|
|
163
164
|
});
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
+
function de(e) {
|
|
166
167
|
let { componentName: t, label: n, onClick: r, disabled: i, children: a } = e;
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ F(p, {
|
|
168
169
|
component: `${t}.bottomBar.pagination.button`,
|
|
169
170
|
props: {
|
|
170
171
|
"aria-label": n,
|
|
@@ -184,8 +185,8 @@ function se(e) {
|
|
|
184
185
|
children: a
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
-
return /* @__PURE__ */
|
|
188
|
+
function fe(e) {
|
|
189
|
+
return /* @__PURE__ */ F(f, {
|
|
189
190
|
viewBox: "0 0 24 24",
|
|
190
191
|
width: "14",
|
|
191
192
|
height: "14",
|
|
@@ -194,70 +195,70 @@ function ce(e) {
|
|
|
194
195
|
strokeWidth: 2,
|
|
195
196
|
strokeLinecap: "round",
|
|
196
197
|
strokeLinejoin: "round",
|
|
197
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ F(d, { d: e.d })
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
-
return /* @__PURE__ */
|
|
201
|
+
function pe() {
|
|
202
|
+
return /* @__PURE__ */ F(fe, { d: "M15 18l-6-6 6-6" });
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
return /* @__PURE__ */
|
|
204
|
+
function me() {
|
|
205
|
+
return /* @__PURE__ */ F(fe, { d: "M9 18l6-6-6-6" });
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
-
return /* @__PURE__ */
|
|
207
|
+
function he() {
|
|
208
|
+
return /* @__PURE__ */ F(fe, { d: "M18 18l-6-6 6-6M11 18l-6-6 6-6" });
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
-
return /* @__PURE__ */
|
|
210
|
+
function ge() {
|
|
211
|
+
return /* @__PURE__ */ F(fe, { d: "M6 18l6-6-6-6M13 18l6-6-6-6" });
|
|
211
212
|
}
|
|
212
213
|
//#endregion
|
|
213
214
|
//#region src/components/dataGrid/components/dataGridBottomBar.tsx
|
|
214
|
-
function
|
|
215
|
-
let { grid: t } = e, { pagination: n, filter:
|
|
215
|
+
function _e(e) {
|
|
216
|
+
let { grid: t } = e, { pagination: n, filter: r } = t;
|
|
216
217
|
if (n.state) {
|
|
217
|
-
let { totalItems: e, startItem:
|
|
218
|
-
return /* @__PURE__ */
|
|
218
|
+
let { totalItems: e, startItem: r, endItem: a } = n;
|
|
219
|
+
return /* @__PURE__ */ I(m, {
|
|
219
220
|
component: `${t.componentName}.bottomBar`,
|
|
220
221
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ F(i, {
|
|
222
223
|
component: `${t.componentName}.bottomBar.info`,
|
|
223
|
-
children: t.localeText.pageRowRange(
|
|
224
|
+
children: t.localeText.pageRowRange(r, a, e)
|
|
224
225
|
}),
|
|
225
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
226
|
+
t.props.def.rowSelection && /* @__PURE__ */ F(se, { grid: t }),
|
|
227
|
+
/* @__PURE__ */ F(ce, { grid: t })
|
|
227
228
|
]
|
|
228
229
|
});
|
|
229
230
|
}
|
|
230
|
-
let { filtered: a, total: o } =
|
|
231
|
-
return /* @__PURE__ */
|
|
231
|
+
let { filtered: a, total: o } = r.filterStats;
|
|
232
|
+
return /* @__PURE__ */ I(m, {
|
|
232
233
|
component: `${t.componentName}.bottomBar`,
|
|
233
234
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ F(i, {
|
|
235
236
|
component: `${t.componentName}.bottomBar.info`,
|
|
236
237
|
children: t.localeText.rowCount(a, o)
|
|
237
238
|
}),
|
|
238
|
-
|
|
239
|
+
r.hasActiveFilters && /* @__PURE__ */ I(p, {
|
|
239
240
|
type: "button",
|
|
240
241
|
component: `${t.componentName}.bottomBar.clearFilters`,
|
|
241
|
-
onClick:
|
|
242
|
-
children: [/* @__PURE__ */
|
|
242
|
+
onClick: r.clearAllFilters,
|
|
243
|
+
children: [/* @__PURE__ */ F(i, {
|
|
243
244
|
tag: "span",
|
|
244
245
|
props: { "aria-hidden": !0 },
|
|
245
246
|
children: "✕"
|
|
246
247
|
}), t.localeText.clearFilters]
|
|
247
248
|
}),
|
|
248
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
249
|
+
t.props.def.rowSelection && /* @__PURE__ */ F(se, { grid: t })
|
|
249
250
|
]
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
//#endregion
|
|
253
254
|
//#region src/components/dataGrid/gridNavigationContext.ts
|
|
254
|
-
var
|
|
255
|
-
function
|
|
256
|
-
return k(
|
|
255
|
+
var ve = ne(null);
|
|
256
|
+
function L() {
|
|
257
|
+
return k(ve);
|
|
257
258
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
let r =
|
|
259
|
+
var ye = () => () => {};
|
|
260
|
+
function R(e, t, n) {
|
|
261
|
+
let r = ie(e?.activeCell.subscribe ?? ye, () => !!e?.activeCell.isActive(t, n), () => !!e?.activeCell.isActive(t, n));
|
|
261
262
|
return e ? {
|
|
262
263
|
...e.cellProps(t, n),
|
|
263
264
|
tabIndex: r ? 0 : -1
|
|
@@ -265,7 +266,7 @@ function B(e, t, n) {
|
|
|
265
266
|
}
|
|
266
267
|
//#endregion
|
|
267
268
|
//#region src/components/dataGrid/models/viewportModel.ts
|
|
268
|
-
var
|
|
269
|
+
var be = class e {
|
|
269
270
|
grid;
|
|
270
271
|
static DEFAULT_VISIBLE_ROWS_COUNT = 10;
|
|
271
272
|
static ROWS_AHEAD = 12;
|
|
@@ -309,14 +310,6 @@ var ge = class e {
|
|
|
309
310
|
rowTop(e) {
|
|
310
311
|
return this.hasDetailRows ? this.grid.rowOffsets.value.offsets[e] ?? 0 : e * this.grid.rowHeight;
|
|
311
312
|
}
|
|
312
|
-
findStartIndex(e, t) {
|
|
313
|
-
let n = 0, r = e.length - 1;
|
|
314
|
-
for (; n < r;) {
|
|
315
|
-
let i = n + r + 1 >>> 1;
|
|
316
|
-
e[i] <= t ? n = i : r = i - 1;
|
|
317
|
-
}
|
|
318
|
-
return n;
|
|
319
|
-
}
|
|
320
313
|
window(t, n = "down") {
|
|
321
314
|
let r = this.grid.flatRows.value.length;
|
|
322
315
|
if (this.showAll) return {
|
|
@@ -326,7 +319,7 @@ var ge = class e {
|
|
|
326
319
|
totalHeight: this.totalHeight,
|
|
327
320
|
viewHeight: void 0
|
|
328
321
|
};
|
|
329
|
-
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 ?
|
|
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 ? b(l, t) : Math.floor(t / i), d = Math.max(0, u - c), f = this.hasDetailRows ? l[d] ?? 0 : d * i;
|
|
330
323
|
return {
|
|
331
324
|
startIndex: d,
|
|
332
325
|
take: this.visibleRowsCount + s + o + a,
|
|
@@ -335,7 +328,7 @@ var ge = class e {
|
|
|
335
328
|
viewHeight: this.viewHeight
|
|
336
329
|
};
|
|
337
330
|
}
|
|
338
|
-
},
|
|
331
|
+
}, xe = class {
|
|
339
332
|
row;
|
|
340
333
|
column;
|
|
341
334
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -352,30 +345,30 @@ var ge = class e {
|
|
|
352
345
|
};
|
|
353
346
|
//#endregion
|
|
354
347
|
//#region src/components/dataGrid/models/editModel.ts
|
|
355
|
-
function
|
|
348
|
+
function z(e, t) {
|
|
356
349
|
return JSON.stringify([e, t]);
|
|
357
350
|
}
|
|
358
|
-
var
|
|
359
|
-
function
|
|
351
|
+
var Se = 1e3;
|
|
352
|
+
function Ce(e) {
|
|
360
353
|
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : "text";
|
|
361
354
|
}
|
|
362
|
-
function
|
|
355
|
+
function we(e, t) {
|
|
363
356
|
if (e === "text") return t;
|
|
364
357
|
if (e !== "number" || t.trim() === "") return;
|
|
365
358
|
let n = Number(t);
|
|
366
359
|
return Number.isFinite(n) ? n : void 0;
|
|
367
360
|
}
|
|
368
|
-
var
|
|
361
|
+
var Te = /* @__PURE__ */ new Set([
|
|
369
362
|
"true",
|
|
370
363
|
"1",
|
|
371
364
|
"yes"
|
|
372
|
-
]),
|
|
365
|
+
]), Ee = /* @__PURE__ */ new Set([
|
|
373
366
|
"false",
|
|
374
367
|
"0",
|
|
375
368
|
"no",
|
|
376
369
|
""
|
|
377
370
|
]);
|
|
378
|
-
function
|
|
371
|
+
function De(e, t, n) {
|
|
379
372
|
if (e.type === "number") {
|
|
380
373
|
if (n.trim() === "") return { value: null };
|
|
381
374
|
let e = Number(n);
|
|
@@ -383,7 +376,7 @@ function Ce(e, t, n) {
|
|
|
383
376
|
}
|
|
384
377
|
if (e.type === "checkbox") {
|
|
385
378
|
let e = n.trim().toLowerCase();
|
|
386
|
-
return
|
|
379
|
+
return Te.has(e) ? { value: !0 } : Ee.has(e) ? { value: !1 } : void 0;
|
|
387
380
|
}
|
|
388
381
|
if (e.type === "select") {
|
|
389
382
|
let e = t.find((e) => String(e.value) === n);
|
|
@@ -391,10 +384,10 @@ function Ce(e, t, n) {
|
|
|
391
384
|
}
|
|
392
385
|
return { value: n };
|
|
393
386
|
}
|
|
394
|
-
function
|
|
387
|
+
function Oe(e) {
|
|
395
388
|
return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
396
389
|
}
|
|
397
|
-
var
|
|
390
|
+
var ke = class {
|
|
398
391
|
grid;
|
|
399
392
|
constructor(e) {
|
|
400
393
|
this.grid = e;
|
|
@@ -419,7 +412,7 @@ var Te = class {
|
|
|
419
412
|
}
|
|
420
413
|
editorFor(e, t) {
|
|
421
414
|
let { editor: n } = e.def;
|
|
422
|
-
return typeof n == "object" ? n : n ? { type: n } : { type:
|
|
415
|
+
return typeof n == "object" ? n : n ? { type: n } : { type: Ce(t) };
|
|
423
416
|
}
|
|
424
417
|
isEditing(e, t) {
|
|
425
418
|
return this._active?.rowKey === e && this._active.columnKey === t;
|
|
@@ -432,7 +425,7 @@ var Te = class {
|
|
|
432
425
|
return !!this._active;
|
|
433
426
|
}
|
|
434
427
|
isRejected(e, t) {
|
|
435
|
-
return this.rejected.size > 0 && this.rejected.has(
|
|
428
|
+
return this.rejected.size > 0 && this.rejected.has(z(e, t));
|
|
436
429
|
}
|
|
437
430
|
get draft() {
|
|
438
431
|
return this._active?.draft;
|
|
@@ -444,8 +437,8 @@ var Te = class {
|
|
|
444
437
|
return !!this._active?.pending;
|
|
445
438
|
}
|
|
446
439
|
begin(e, t, n, r) {
|
|
447
|
-
let i = r === void 0 ? void 0 :
|
|
448
|
-
this.rejected.delete(
|
|
440
|
+
let i = r === void 0 ? void 0 : we(this.editorFor(t, n).type, r);
|
|
441
|
+
this.rejected.delete(z(e.key, t.key)), this._active = {
|
|
449
442
|
row: e,
|
|
450
443
|
rowKey: e.key,
|
|
451
444
|
columnKey: t.key,
|
|
@@ -506,12 +499,12 @@ var Te = class {
|
|
|
506
499
|
}, this.grid.notify();
|
|
507
500
|
return;
|
|
508
501
|
}
|
|
509
|
-
this.values.set(
|
|
502
|
+
this.values.set(z(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" });
|
|
510
503
|
}
|
|
511
504
|
}
|
|
512
505
|
valueOf(e, t, n) {
|
|
513
506
|
if (this.values.size === 0) return n;
|
|
514
|
-
let r =
|
|
507
|
+
let r = z(e, t);
|
|
515
508
|
return this.values.has(r) ? this.values.get(r) : n;
|
|
516
509
|
}
|
|
517
510
|
get edits() {
|
|
@@ -530,7 +523,7 @@ var Te = class {
|
|
|
530
523
|
c++;
|
|
531
524
|
continue;
|
|
532
525
|
}
|
|
533
|
-
let f = this.valueOf(l.key, u.key, l.data[u.key]), p =
|
|
526
|
+
let f = this.valueOf(l.key, u.key, l.data[u.key]), p = De(this.editorFor(u, f), this.optionsFor(u, l), d), m = {
|
|
534
527
|
rowKey: l.key,
|
|
535
528
|
columnKey: u.key,
|
|
536
529
|
row: l.data,
|
|
@@ -556,13 +549,13 @@ var Te = class {
|
|
|
556
549
|
this.rejected.clear(), n.forEach((e, t) => {
|
|
557
550
|
let n = r[t];
|
|
558
551
|
if (typeof n == "string" || n === !1) {
|
|
559
|
-
this.rejected.add(
|
|
552
|
+
this.rejected.add(z(e.rowKey, e.columnKey)), o.push({
|
|
560
553
|
...e,
|
|
561
554
|
error: typeof n == "string" ? n : this.invalidValue
|
|
562
555
|
});
|
|
563
556
|
return;
|
|
564
557
|
}
|
|
565
|
-
Object.is(e.value, e.oldValue) || (this.values.set(
|
|
558
|
+
Object.is(e.value, e.oldValue) || (this.values.set(z(e.rowKey, e.columnKey), e.value), a.push(e));
|
|
566
559
|
}), a.length > 0 && (this._edits = [...this._edits, ...a]), this.grid.notify(), a.length > 0 && this.grid.props.onCellEditsChange?.(this._edits, { reason: "paste" }), this.grid.props.onPaste?.({
|
|
567
560
|
range: this.grid.range.rangeOf(t),
|
|
568
561
|
applied: a,
|
|
@@ -571,8 +564,8 @@ var Te = class {
|
|
|
571
564
|
});
|
|
572
565
|
}
|
|
573
566
|
nextEditable(e, t, n = !1) {
|
|
574
|
-
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 +
|
|
575
|
-
for (let e = o; e >= Math.max(0, o -
|
|
567
|
+
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 + Se);
|
|
568
|
+
for (let e = o; e >= Math.max(0, o - Se) && e <= s; e += a) {
|
|
576
569
|
let t = Math.floor(e / i.length), n = e % i.length, a = r[t], o = i[n];
|
|
577
570
|
if (!(!o || a?.kind !== "row" || !this.isEditable(a, o))) return {
|
|
578
571
|
row: t,
|
|
@@ -580,7 +573,7 @@ var Te = class {
|
|
|
580
573
|
};
|
|
581
574
|
}
|
|
582
575
|
}
|
|
583
|
-
},
|
|
576
|
+
}, B = class {
|
|
584
577
|
grid;
|
|
585
578
|
row;
|
|
586
579
|
column;
|
|
@@ -647,7 +640,7 @@ var Te = class {
|
|
|
647
640
|
cancelEdit = () => {
|
|
648
641
|
this.grid.edits.cancel();
|
|
649
642
|
};
|
|
650
|
-
},
|
|
643
|
+
}, V = class e {
|
|
651
644
|
grid;
|
|
652
645
|
parentRow;
|
|
653
646
|
constructor(e, t) {
|
|
@@ -680,7 +673,7 @@ var Te = class {
|
|
|
680
673
|
get allRows() {
|
|
681
674
|
return [];
|
|
682
675
|
}
|
|
683
|
-
},
|
|
676
|
+
}, H = class {
|
|
684
677
|
grid;
|
|
685
678
|
rowIndex;
|
|
686
679
|
constructor(e, t, n) {
|
|
@@ -711,7 +704,7 @@ var Te = class {
|
|
|
711
704
|
let e = this.grid.columns.value.visibleLeafs;
|
|
712
705
|
return this._cells?.leafs !== e && (this._cells = {
|
|
713
706
|
leafs: e,
|
|
714
|
-
cells: e.map((e) => new
|
|
707
|
+
cells: e.map((e) => new B(this.grid, this, e))
|
|
715
708
|
}), this._cells.cells;
|
|
716
709
|
}
|
|
717
710
|
get cellCount() {
|
|
@@ -733,7 +726,7 @@ var Te = class {
|
|
|
733
726
|
return this.grid.expandedDetailRows.has(this.key);
|
|
734
727
|
}
|
|
735
728
|
get flatRows() {
|
|
736
|
-
return this.grid.props.def.rowDetail && this.expanded ? [this, new
|
|
729
|
+
return this.grid.props.def.rowDetail && this.expanded ? [this, new V(this.grid, this)] : [this];
|
|
737
730
|
}
|
|
738
731
|
get allRows() {
|
|
739
732
|
return this;
|
|
@@ -741,15 +734,15 @@ var Te = class {
|
|
|
741
734
|
};
|
|
742
735
|
//#endregion
|
|
743
736
|
//#region src/components/dataGrid/models/treeRow.ts
|
|
744
|
-
function
|
|
737
|
+
function U(e) {
|
|
745
738
|
return !!e && e.isTreeRow === !0;
|
|
746
739
|
}
|
|
747
740
|
//#endregion
|
|
748
741
|
//#region src/components/dataGrid/useGridNavigation.ts
|
|
749
|
-
var
|
|
750
|
-
function
|
|
751
|
-
let { grid: t, scrollerRef:
|
|
752
|
-
if (e <
|
|
742
|
+
var Ae = "[role=\"gridcell\"],[role=\"columnheader\"]", je = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]", Me = 2, Ne = [];
|
|
743
|
+
function Pe(e) {
|
|
744
|
+
let { grid: t, scrollerRef: n, scroll: i, onScrollTo: a } = e, o = t.headerRows.value, c = t.filter.hasFilterableColumns, u = o.length + +!!c, d = t.viewport.isEmpty ? Ne : t.flatRows.value, f = t.columns.value.visibleLeafs.length, p = t.aggregation.hasFooter && !t.viewport.isEmpty ? 1 : 0, m = u + d.length + p, h = O((e) => {
|
|
745
|
+
if (e < o.length) return o[e]?.length ?? 0;
|
|
753
746
|
if (e < u || e >= u + d.length) return f;
|
|
754
747
|
let t = d[e - u];
|
|
755
748
|
return t ? t.cellCount : 0;
|
|
@@ -757,20 +750,20 @@ function Me(e) {
|
|
|
757
750
|
d,
|
|
758
751
|
f,
|
|
759
752
|
u,
|
|
760
|
-
|
|
761
|
-
]), g = O((e, t) => e <
|
|
753
|
+
o
|
|
754
|
+
]), g = O((e, t) => e < o.length ? (o[e]?.[t]?.headerCell.columnIndex ?? t + 1) - 1 : e < u ? t : d[e - u]?.columnOf(t) ?? t, [
|
|
762
755
|
d,
|
|
763
756
|
u,
|
|
764
|
-
|
|
765
|
-
]), _ = N(!1), v = O((e,
|
|
766
|
-
let { viewport: o } = t, s = e - u, c =
|
|
757
|
+
o
|
|
758
|
+
]), _ = N(!1), v = O((e, r) => {
|
|
759
|
+
let { viewport: o } = t, s = e - u, c = n.current;
|
|
767
760
|
if (o.showAll || !c || s >= d.length) return;
|
|
768
761
|
if (s < 0) {
|
|
769
|
-
|
|
762
|
+
r >= u && (c.scrollTop = 0, a(0));
|
|
770
763
|
return;
|
|
771
764
|
}
|
|
772
765
|
let { startIndex: l, take: f } = o.window(i.top, i.direction);
|
|
773
|
-
if (s >= l +
|
|
766
|
+
if (s >= l + Me && s < l + f - Me) return;
|
|
774
767
|
let p = o.rowTop(s);
|
|
775
768
|
c.scrollTop = p, a(p);
|
|
776
769
|
}, [
|
|
@@ -779,7 +772,7 @@ function Me(e) {
|
|
|
779
772
|
u,
|
|
780
773
|
a,
|
|
781
774
|
i,
|
|
782
|
-
|
|
775
|
+
n
|
|
783
776
|
]), y = N(0), b = O((e, n, r) => {
|
|
784
777
|
let i = e - u;
|
|
785
778
|
if (i < 0 || i >= d.length) {
|
|
@@ -796,7 +789,7 @@ function Me(e) {
|
|
|
796
789
|
g,
|
|
797
790
|
t,
|
|
798
791
|
u
|
|
799
|
-
]), x =
|
|
792
|
+
]), x = l({
|
|
800
793
|
count: m,
|
|
801
794
|
columns: h,
|
|
802
795
|
columnIndexOf: g,
|
|
@@ -806,18 +799,18 @@ function Me(e) {
|
|
|
806
799
|
y.current = e.row, b(e.row, e.column, t), t.reason === "keyboard" && (v(e.row, n), _.current = !0);
|
|
807
800
|
}
|
|
808
801
|
}), S = x.activeItem;
|
|
809
|
-
|
|
802
|
+
r(() => {
|
|
810
803
|
_.current && (_.current = !1, S()?.focus());
|
|
811
804
|
});
|
|
812
805
|
let C = O((e, n, r) => {
|
|
813
806
|
if (!t.tree.enabled || e.key !== "ArrowRight" && e.key !== "ArrowLeft") return !1;
|
|
814
807
|
let i = d[n - u];
|
|
815
|
-
if (!
|
|
808
|
+
if (!U(i) || t.columns.value.visibleLeafs[r]?.key !== t.tree.columnKey) return !1;
|
|
816
809
|
if (e.key === (t.isRtl ? "ArrowLeft" : "ArrowRight")) return !i.hasChildren || i.treeExpanded ? !1 : (i.toggleTree(), !0);
|
|
817
810
|
if (i.hasChildren && i.treeExpanded) return i.toggleTree(), !0;
|
|
818
811
|
for (let e = n - 1; e >= u; e--) {
|
|
819
812
|
let t = d[e - u];
|
|
820
|
-
if (!(!
|
|
813
|
+
if (!(!U(t) || t.level >= i.level)) return x.setActiveCell(e, r, { reason: "keyboard" }), !0;
|
|
821
814
|
}
|
|
822
815
|
return !1;
|
|
823
816
|
}, [
|
|
@@ -836,27 +829,27 @@ function Me(e) {
|
|
|
836
829
|
m
|
|
837
830
|
]), T = O((e, n) => {
|
|
838
831
|
if (!t.props.def.rowSelection) return !1;
|
|
839
|
-
if (e < u) return e >=
|
|
832
|
+
if (e < u) return e >= o.length || !t.columns.value.visibleLeafs[n]?.isRowSelection ? !1 : (t.toggleSelectAllRows(), !0);
|
|
840
833
|
let r = t.flatRows.value[e - u];
|
|
841
|
-
return r instanceof
|
|
834
|
+
return r instanceof H && (r.toggleSelection(), !0);
|
|
842
835
|
}, [
|
|
843
836
|
t,
|
|
844
837
|
u,
|
|
845
|
-
|
|
846
|
-
]),
|
|
847
|
-
let r = Array.from(e.querySelectorAll(
|
|
838
|
+
o.length
|
|
839
|
+
]), ee = O((e, t, n) => {
|
|
840
|
+
let r = Array.from(e.querySelectorAll(je));
|
|
848
841
|
if (r.length < 2) return !1;
|
|
849
842
|
let i = r.indexOf(t);
|
|
850
843
|
return i !== -1 && (r[(i + (n ? -1 : 1) + r.length) % r.length].focus(), !0);
|
|
851
|
-
}, []),
|
|
852
|
-
let n = e.target, r = n.closest?.(
|
|
844
|
+
}, []), te = x.onKeyDown, ne = O((e) => {
|
|
845
|
+
let n = e.target, r = n.closest?.(Ae);
|
|
853
846
|
if (r) {
|
|
854
847
|
if (n !== r) {
|
|
855
848
|
if (e.key === "Escape" && !r.querySelector("[aria-expanded=\"true\"]")) {
|
|
856
849
|
e.preventDefault(), r.focus();
|
|
857
850
|
return;
|
|
858
851
|
}
|
|
859
|
-
e.key === "Tab" &&
|
|
852
|
+
e.key === "Tab" && ee(r, n, e.shiftKey) && e.preventDefault();
|
|
860
853
|
return;
|
|
861
854
|
}
|
|
862
855
|
if (e.key === "Tab" && t.props.def.tabNavigation === "cells") {
|
|
@@ -868,7 +861,7 @@ function Me(e) {
|
|
|
868
861
|
return;
|
|
869
862
|
}
|
|
870
863
|
if (e.key === "Enter" || e.key === " " || e.key === "F2") {
|
|
871
|
-
let n =
|
|
864
|
+
let n = o[x.activeIndex]?.[x.activeColumn];
|
|
872
865
|
if (e.key !== "F2" && n?.headerCell.isSortable) {
|
|
873
866
|
e.preventDefault(), n.sortColumn();
|
|
874
867
|
return;
|
|
@@ -877,13 +870,13 @@ function Me(e) {
|
|
|
877
870
|
e.preventDefault();
|
|
878
871
|
return;
|
|
879
872
|
}
|
|
880
|
-
let i = r.querySelector(
|
|
873
|
+
let i = r.querySelector(je);
|
|
881
874
|
if (i) {
|
|
882
875
|
e.preventDefault(), i.focus();
|
|
883
876
|
return;
|
|
884
877
|
}
|
|
885
878
|
}
|
|
886
|
-
if (t.edits.enabled &&
|
|
879
|
+
if (t.edits.enabled && Oe(e) && t.edits.beginAt(x.activeIndex - u, x.activeColumn, e.key)) {
|
|
887
880
|
e.preventDefault();
|
|
888
881
|
return;
|
|
889
882
|
}
|
|
@@ -891,54 +884,54 @@ function Me(e) {
|
|
|
891
884
|
e.preventDefault();
|
|
892
885
|
return;
|
|
893
886
|
}
|
|
894
|
-
|
|
887
|
+
te(e);
|
|
895
888
|
}
|
|
896
889
|
}, [
|
|
897
890
|
t,
|
|
898
891
|
u,
|
|
899
|
-
|
|
892
|
+
o,
|
|
900
893
|
x.activeColumn,
|
|
901
894
|
x.activeIndex,
|
|
902
|
-
|
|
895
|
+
te,
|
|
903
896
|
w,
|
|
904
|
-
|
|
897
|
+
ee,
|
|
905
898
|
T,
|
|
906
899
|
C
|
|
907
|
-
]), { setActiveCell:
|
|
908
|
-
|
|
909
|
-
F,
|
|
900
|
+
]), { setActiveCell: E, activeIndex: D, activeColumn: k } = x, A = s(x.cellProps), [j] = P(() => new xe(D, k));
|
|
901
|
+
r(() => j.set(D, k), [
|
|
910
902
|
j,
|
|
911
|
-
|
|
903
|
+
k,
|
|
904
|
+
D
|
|
912
905
|
]);
|
|
913
|
-
let
|
|
914
|
-
let { ref: n, onFocus: r } =
|
|
906
|
+
let re = O((e, t) => {
|
|
907
|
+
let { ref: n, onFocus: r } = A.current(e, t);
|
|
915
908
|
return {
|
|
916
909
|
ref: n,
|
|
917
910
|
onFocus: r
|
|
918
911
|
};
|
|
919
|
-
}, [
|
|
912
|
+
}, [A]);
|
|
920
913
|
return {
|
|
921
|
-
navigation:
|
|
914
|
+
navigation: M(() => ({
|
|
922
915
|
rowCount: m,
|
|
923
916
|
columnCount: f,
|
|
924
917
|
headerRowCount: u,
|
|
925
|
-
cellProps:
|
|
926
|
-
activeCell:
|
|
927
|
-
setActiveCell:
|
|
918
|
+
cellProps: re,
|
|
919
|
+
activeCell: j,
|
|
920
|
+
setActiveCell: E
|
|
928
921
|
}), [
|
|
929
|
-
|
|
930
|
-
|
|
922
|
+
j,
|
|
923
|
+
re,
|
|
931
924
|
f,
|
|
932
925
|
u,
|
|
933
926
|
m,
|
|
934
|
-
|
|
927
|
+
E
|
|
935
928
|
]),
|
|
936
|
-
onKeyDown:
|
|
929
|
+
onKeyDown: ne
|
|
937
930
|
};
|
|
938
931
|
}
|
|
939
932
|
//#endregion
|
|
940
933
|
//#region src/utils/array/arrayUtils.ts
|
|
941
|
-
var
|
|
934
|
+
var Fe;
|
|
942
935
|
(function(e) {
|
|
943
936
|
function t(e, t, n = 0) {
|
|
944
937
|
return e.slice(n, n + t);
|
|
@@ -985,8 +978,8 @@ var Ne;
|
|
|
985
978
|
}));
|
|
986
979
|
}
|
|
987
980
|
e.groupBy = s;
|
|
988
|
-
})(
|
|
989
|
-
var W =
|
|
981
|
+
})(Fe ||= {});
|
|
982
|
+
var W = Fe, Ie = "row-number-cell", Le = "row-selection-cell", G = "grouping-cell", Re = "row-detail-cell", K = Symbol("memo.unset"), ze = class {
|
|
990
983
|
action;
|
|
991
984
|
deps;
|
|
992
985
|
cache = K;
|
|
@@ -1012,36 +1005,36 @@ var W = Ne, Pe = "row-number-cell", Fe = "row-selection-cell", G = "grouping-cel
|
|
|
1012
1005
|
}
|
|
1013
1006
|
};
|
|
1014
1007
|
function q(e, t = () => []) {
|
|
1015
|
-
return new
|
|
1008
|
+
return new ze(e, t);
|
|
1016
1009
|
}
|
|
1017
1010
|
//#endregion
|
|
1018
1011
|
//#region src/components/dataGrid/models/aggregationModel.ts
|
|
1019
|
-
function
|
|
1012
|
+
function Be(e) {
|
|
1020
1013
|
return e.filter((e) => typeof e == "number" && !Number.isNaN(e));
|
|
1021
1014
|
}
|
|
1022
|
-
var
|
|
1015
|
+
var Ve = (e) => e.reduce((e, t) => e + t, 0), He = (e, t) => e.reduce((e, n) => (t ? n < e : n > e) ? n : e), Ue = {
|
|
1023
1016
|
sum: (e) => {
|
|
1024
|
-
let t =
|
|
1025
|
-
return t.length ?
|
|
1017
|
+
let t = Be(e);
|
|
1018
|
+
return t.length ? Ve(t) : null;
|
|
1026
1019
|
},
|
|
1027
1020
|
avg: (e) => {
|
|
1028
|
-
let t =
|
|
1029
|
-
return t.length ? Math.round(
|
|
1021
|
+
let t = Be(e);
|
|
1022
|
+
return t.length ? Math.round(Ve(t) / t.length * 100) / 100 : null;
|
|
1030
1023
|
},
|
|
1031
1024
|
min: (e) => {
|
|
1032
|
-
let t =
|
|
1033
|
-
return t.length ?
|
|
1025
|
+
let t = Be(e);
|
|
1026
|
+
return t.length ? He(t, !0) : null;
|
|
1034
1027
|
},
|
|
1035
1028
|
max: (e) => {
|
|
1036
|
-
let t =
|
|
1037
|
-
return t.length ?
|
|
1029
|
+
let t = Be(e);
|
|
1030
|
+
return t.length ? He(t, !1) : null;
|
|
1038
1031
|
},
|
|
1039
1032
|
count: (e, t) => t.length
|
|
1040
1033
|
};
|
|
1041
|
-
function
|
|
1042
|
-
return typeof e == "function" ? e(t, n) :
|
|
1034
|
+
function We(e, t, n) {
|
|
1035
|
+
return typeof e == "function" ? e(t, n) : Ue[e]?.(t, n) ?? null;
|
|
1043
1036
|
}
|
|
1044
|
-
var
|
|
1037
|
+
var Ge = class {
|
|
1045
1038
|
grid;
|
|
1046
1039
|
constructor(e) {
|
|
1047
1040
|
this.grid = e;
|
|
@@ -1062,8 +1055,8 @@ var Ue = class {
|
|
|
1062
1055
|
get footerLabelColumn() {
|
|
1063
1056
|
return this.grid.columns.value.visibleLeafs.find((e) => (e.isData || e.isGrouping) && !e.aggregate);
|
|
1064
1057
|
}
|
|
1065
|
-
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new
|
|
1066
|
-
},
|
|
1058
|
+
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new Ke(this.grid, e, this.grid.filteredData, "footer")), () => [this.grid.rows]);
|
|
1059
|
+
}, Ke = class {
|
|
1067
1060
|
grid;
|
|
1068
1061
|
column;
|
|
1069
1062
|
rows;
|
|
@@ -1078,7 +1071,7 @@ var Ue = class {
|
|
|
1078
1071
|
}
|
|
1079
1072
|
_value = q(() => {
|
|
1080
1073
|
let e = this.column.aggregate;
|
|
1081
|
-
return e ?
|
|
1074
|
+
return e ? We(e, this.values, this.rows) : null;
|
|
1082
1075
|
});
|
|
1083
1076
|
get value() {
|
|
1084
1077
|
let e = this.given?.();
|
|
@@ -1093,7 +1086,7 @@ var Ue = class {
|
|
|
1093
1086
|
get isLast() {
|
|
1094
1087
|
return !1;
|
|
1095
1088
|
}
|
|
1096
|
-
},
|
|
1089
|
+
}, qe = class {
|
|
1097
1090
|
grid;
|
|
1098
1091
|
row;
|
|
1099
1092
|
column;
|
|
@@ -1115,7 +1108,7 @@ var Ue = class {
|
|
|
1115
1108
|
get cellKind() {
|
|
1116
1109
|
return this.column.isGrouping ? "grouping" : this.column.isRowSelection ? this.row.selectable ? "selection" : "spacer" : this.row.spans(this.column) ? "hidden" : this.column.aggregate ? "aggregate" : "spacer";
|
|
1117
1110
|
}
|
|
1118
|
-
_aggregate = q(() => this.column.aggregate ? new
|
|
1111
|
+
_aggregate = q(() => this.column.aggregate ? new Ke(this.grid, this.column, this.row.allRows.map((e) => e.data), "group", () => this.row.aggregateValue(this.column)) : null);
|
|
1119
1112
|
get aggregate() {
|
|
1120
1113
|
return this._aggregate.value;
|
|
1121
1114
|
}
|
|
@@ -1134,7 +1127,7 @@ var Ue = class {
|
|
|
1134
1127
|
get hasGroupingBorder() {
|
|
1135
1128
|
return this.row.groupingColumn.pin === "START";
|
|
1136
1129
|
}
|
|
1137
|
-
},
|
|
1130
|
+
}, Je = class {
|
|
1138
1131
|
grid;
|
|
1139
1132
|
groupColumn;
|
|
1140
1133
|
rows;
|
|
@@ -1168,7 +1161,7 @@ var Ue = class {
|
|
|
1168
1161
|
let e = this.grid.columns.value.visibleLeafs;
|
|
1169
1162
|
return this._cells?.leafs !== e && (this._cells = {
|
|
1170
1163
|
leafs: e,
|
|
1171
|
-
cells: e.map((e) => new
|
|
1164
|
+
cells: e.map((e) => new qe(this.grid, this, e))
|
|
1172
1165
|
}), this._cells;
|
|
1173
1166
|
}
|
|
1174
1167
|
get renderedCells() {
|
|
@@ -1226,28 +1219,30 @@ var Ue = class {
|
|
|
1226
1219
|
};
|
|
1227
1220
|
//#endregion
|
|
1228
1221
|
//#region src/components/dataGrid/components/dataGridDetailRow.tsx
|
|
1229
|
-
function
|
|
1230
|
-
let { row: t, index:
|
|
1231
|
-
return
|
|
1222
|
+
function Ye(e) {
|
|
1223
|
+
let { row: t, index: n } = e, { grid: a, parentRow: o } = t, s = a.props.def.rowDetail, c = L(), l = (c?.headerRowCount ?? 0) + n, { ref: u, tabIndex: d, onFocus: f } = R(c, l, 0), p = t.isAutoHeight, h = N(null);
|
|
1224
|
+
return r(() => {
|
|
1232
1225
|
a.takeDetailReveal(o.key) && h.current?.scrollIntoView?.({ block: "nearest" });
|
|
1233
|
-
}), /* @__PURE__ */
|
|
1226
|
+
}), /* @__PURE__ */ F(m, {
|
|
1234
1227
|
ref: h,
|
|
1235
1228
|
component: `${a.componentName}.body.detailRow`,
|
|
1229
|
+
transition: "none",
|
|
1236
1230
|
props: {
|
|
1237
1231
|
role: "row",
|
|
1238
1232
|
"aria-rowindex": l + 1
|
|
1239
1233
|
},
|
|
1240
1234
|
style: {
|
|
1241
1235
|
gridColumn: "1 / -1",
|
|
1242
|
-
height:
|
|
1236
|
+
height: p ? "auto" : `${t.height}px`
|
|
1243
1237
|
},
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1238
|
+
children: /* @__PURE__ */ F(i, {
|
|
1245
1239
|
ref: u,
|
|
1246
1240
|
component: `${a.componentName}.body.detailRow.content`,
|
|
1247
1241
|
position: "sticky",
|
|
1248
1242
|
insetStart: 0,
|
|
1249
1243
|
overflowX: "auto",
|
|
1250
1244
|
overflowY: "hidden",
|
|
1245
|
+
transition: "none",
|
|
1251
1246
|
props: {
|
|
1252
1247
|
role: "gridcell",
|
|
1253
1248
|
"aria-colindex": 1,
|
|
@@ -1260,16 +1255,16 @@ function qe(e) {
|
|
|
1260
1255
|
})
|
|
1261
1256
|
});
|
|
1262
1257
|
}
|
|
1263
|
-
|
|
1264
|
-
var
|
|
1258
|
+
Ye.displayName = "DataGridDetailRow";
|
|
1259
|
+
var Xe = D(Ye);
|
|
1265
1260
|
//#endregion
|
|
1266
1261
|
//#region src/components/dataGrid/components/dataGridAggregateValue.tsx
|
|
1267
|
-
function
|
|
1262
|
+
function Ze(e) {
|
|
1268
1263
|
let { cell: t } = e, { column: n } = t;
|
|
1269
|
-
if (n.AggregateCell) return /* @__PURE__ */
|
|
1270
|
-
let
|
|
1271
|
-
return /* @__PURE__ */
|
|
1272
|
-
component: `${n.grid.componentName}.${
|
|
1264
|
+
if (n.AggregateCell) return /* @__PURE__ */ F(n.AggregateCell, { cell: t });
|
|
1265
|
+
let r = t.scope === "footer" ? "footer.cell" : "body.groupRow.aggregate";
|
|
1266
|
+
return /* @__PURE__ */ F(i, {
|
|
1267
|
+
component: `${n.grid.componentName}.${r}`,
|
|
1273
1268
|
px: 3,
|
|
1274
1269
|
textOverflow: "ellipsis",
|
|
1275
1270
|
overflow: "hidden",
|
|
@@ -1277,12 +1272,12 @@ function Ye(e) {
|
|
|
1277
1272
|
children: t.value
|
|
1278
1273
|
});
|
|
1279
1274
|
}
|
|
1280
|
-
|
|
1275
|
+
Ze.displayName = "DataGridAggregateValue";
|
|
1281
1276
|
//#endregion
|
|
1282
1277
|
//#region src/components/dataGrid/components/dataGridCell.tsx
|
|
1283
|
-
var
|
|
1284
|
-
function J(
|
|
1285
|
-
let { children:
|
|
1278
|
+
var Qe = "button,a[href],input,select,textarea";
|
|
1279
|
+
function J(e) {
|
|
1280
|
+
let { children: t, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = e, { column: u } = r, d = L(), { ref: f, tabIndex: p, onFocus: h } = R(d, i, a), { range: g } = u.grid, _ = r instanceof B ? i - (d?.headerRowCount ?? 0) : -1, v = _ >= 0 && g.isCurrent(_, a), y = _ >= 0 && g.isSelected(_, a);
|
|
1286
1281
|
u.hasAlign && (l.jc = u.align);
|
|
1287
1282
|
let b = r.isExpanded ? {
|
|
1288
1283
|
...u.cellVariant.value,
|
|
@@ -1295,8 +1290,8 @@ function J(t) {
|
|
|
1295
1290
|
isInRange: y && !v,
|
|
1296
1291
|
isCurrentCell: v
|
|
1297
1292
|
});
|
|
1298
|
-
let x = r instanceof
|
|
1299
|
-
r instanceof
|
|
1293
|
+
let x = r instanceof B && !r.editing && r.rejected;
|
|
1294
|
+
r instanceof B && r.editing ? b = {
|
|
1300
1295
|
...b,
|
|
1301
1296
|
isEditing: !0,
|
|
1302
1297
|
isInvalid: !!r.error
|
|
@@ -1304,14 +1299,14 @@ function J(t) {
|
|
|
1304
1299
|
...b,
|
|
1305
1300
|
isInvalid: !0
|
|
1306
1301
|
});
|
|
1307
|
-
let S = r instanceof
|
|
1308
|
-
|
|
1302
|
+
let S = r instanceof B ? (e) => {
|
|
1303
|
+
e.target.closest(Qe) || (n(e.currentTarget), r.beginEdit());
|
|
1309
1304
|
} : void 0, C = g.enabled && _ >= 0, w = C ? (e) => {
|
|
1310
|
-
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(
|
|
1305
|
+
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(Qe) || g.press(_, a, e.shiftKey));
|
|
1311
1306
|
} : void 0, T = C && g.isDragging ? (e) => {
|
|
1312
1307
|
g.dragTo(_, a), e.currentTarget.focus();
|
|
1313
1308
|
} : void 0;
|
|
1314
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ F(m, {
|
|
1315
1310
|
ref: f,
|
|
1316
1311
|
component: `${u.grid.componentName}.body.cell`,
|
|
1317
1312
|
props: {
|
|
@@ -1320,7 +1315,7 @@ function J(t) {
|
|
|
1320
1315
|
"aria-colspan": s,
|
|
1321
1316
|
"aria-selected": y || void 0,
|
|
1322
1317
|
"aria-invalid": x || void 0,
|
|
1323
|
-
tabIndex:
|
|
1318
|
+
tabIndex: p,
|
|
1324
1319
|
onFocus: h,
|
|
1325
1320
|
onDoubleClick: S,
|
|
1326
1321
|
onPointerDown: w,
|
|
@@ -1332,31 +1327,31 @@ function J(t) {
|
|
|
1332
1327
|
...c
|
|
1333
1328
|
},
|
|
1334
1329
|
...l,
|
|
1335
|
-
children:
|
|
1330
|
+
children: t
|
|
1336
1331
|
});
|
|
1337
1332
|
}
|
|
1338
1333
|
J.displayName = "DataGridCell";
|
|
1339
1334
|
//#endregion
|
|
1340
1335
|
//#region src/components/dataGrid/components/dataGridFooter.tsx
|
|
1341
|
-
function
|
|
1342
|
-
let { grid: t } = e, { aggregation: n } = t,
|
|
1336
|
+
function $e(e) {
|
|
1337
|
+
let { grid: t } = e, { aggregation: n } = t, r = L();
|
|
1343
1338
|
if (!n.hasFooter) return null;
|
|
1344
|
-
let a = (
|
|
1345
|
-
return /* @__PURE__ */
|
|
1339
|
+
let a = (r?.rowCount ?? 1) - 1, { footerLabelColumn: o, footerLabel: s } = n;
|
|
1340
|
+
return /* @__PURE__ */ F(x, {
|
|
1346
1341
|
component: `${t.componentName}.footer`,
|
|
1347
1342
|
props: { role: "rowgroup" },
|
|
1348
1343
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1349
|
-
children: /* @__PURE__ */
|
|
1344
|
+
children: /* @__PURE__ */ F(i, {
|
|
1350
1345
|
display: "contents",
|
|
1351
1346
|
props: {
|
|
1352
1347
|
role: "row",
|
|
1353
1348
|
"aria-rowindex": a + 1
|
|
1354
1349
|
},
|
|
1355
|
-
children: n.footerCells.value.map((e, n) => /* @__PURE__ */
|
|
1350
|
+
children: n.footerCells.value.map((e, n) => /* @__PURE__ */ F(J, {
|
|
1356
1351
|
cell: e,
|
|
1357
1352
|
row: a,
|
|
1358
1353
|
columnIndex: n,
|
|
1359
|
-
children: e.column.aggregate ? /* @__PURE__ */
|
|
1354
|
+
children: e.column.aggregate ? /* @__PURE__ */ F(Ze, { cell: e }) : e.column === o ? /* @__PURE__ */ F(i, {
|
|
1360
1355
|
component: `${t.componentName}.footer.label`,
|
|
1361
1356
|
px: 3,
|
|
1362
1357
|
textWrap: "nowrap",
|
|
@@ -1366,16 +1361,16 @@ function Ze(e) {
|
|
|
1366
1361
|
})
|
|
1367
1362
|
});
|
|
1368
1363
|
}
|
|
1369
|
-
|
|
1364
|
+
$e.displayName = "DataGridFooter";
|
|
1370
1365
|
//#endregion
|
|
1371
1366
|
//#region src/icons/expandIcon.tsx
|
|
1372
|
-
function
|
|
1373
|
-
return /* @__PURE__ */
|
|
1367
|
+
function Y(e) {
|
|
1368
|
+
return /* @__PURE__ */ F(f, {
|
|
1374
1369
|
viewBox: "4 2 16 18",
|
|
1375
1370
|
width: "1rem",
|
|
1376
1371
|
fill: "currentColor",
|
|
1377
1372
|
...e,
|
|
1378
|
-
children: /* @__PURE__ */
|
|
1373
|
+
children: /* @__PURE__ */ F(d, {
|
|
1379
1374
|
fillRule: "evenodd",
|
|
1380
1375
|
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",
|
|
1381
1376
|
props: { clipRule: "evenodd" }
|
|
@@ -1384,35 +1379,35 @@ function Qe(e) {
|
|
|
1384
1379
|
}
|
|
1385
1380
|
//#endregion
|
|
1386
1381
|
//#region src/components/dataGrid/components/dataGridCellPlaceholder.tsx
|
|
1387
|
-
var
|
|
1382
|
+
var et = [
|
|
1388
1383
|
"3/5",
|
|
1389
1384
|
"2/5",
|
|
1390
1385
|
"4/5",
|
|
1391
1386
|
"1/2",
|
|
1392
1387
|
"7/12"
|
|
1393
1388
|
];
|
|
1394
|
-
function
|
|
1395
|
-
let { cell: t, columnIndex: n } = e,
|
|
1396
|
-
return /* @__PURE__ */
|
|
1389
|
+
function tt(e) {
|
|
1390
|
+
let { cell: t, columnIndex: n } = e, r = et[(t.row.rowIndex + n) % et.length];
|
|
1391
|
+
return /* @__PURE__ */ F(m, {
|
|
1397
1392
|
component: `${t.grid.componentName}.body.cell.placeholder`,
|
|
1398
1393
|
ai: "center",
|
|
1399
1394
|
px: 3,
|
|
1400
1395
|
props: { "aria-hidden": !0 },
|
|
1401
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ F(i, {
|
|
1402
1397
|
component: `${t.grid.componentName}.body.cell.placeholder.bar`,
|
|
1403
|
-
width:
|
|
1398
|
+
width: r
|
|
1404
1399
|
})
|
|
1405
1400
|
});
|
|
1406
1401
|
}
|
|
1407
|
-
|
|
1402
|
+
tt.displayName = "DataGridCellPlaceholder";
|
|
1408
1403
|
//#endregion
|
|
1409
1404
|
//#region src/components/dataGrid/components/dataGridGroupRow.tsx
|
|
1410
|
-
function
|
|
1411
|
-
let { row: t, index: n } = e, { selected:
|
|
1412
|
-
return /* @__PURE__ */
|
|
1405
|
+
function nt(e) {
|
|
1406
|
+
let { row: t, index: n } = e, { selected: r, indeterminate: a, expanded: o, placeholder: s } = t, c = (L()?.headerRowCount ?? 0) + n, l = O(() => t.toggleSelectAll(), [t]);
|
|
1407
|
+
return /* @__PURE__ */ F(m, {
|
|
1413
1408
|
component: `${t.grid.componentName}.body.groupRow`,
|
|
1414
1409
|
className: "grid-row",
|
|
1415
|
-
selected: t.grid.props.def.rowSelection ?
|
|
1410
|
+
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
1416
1411
|
display: "contents",
|
|
1417
1412
|
props: {
|
|
1418
1413
|
role: "row",
|
|
@@ -1422,7 +1417,7 @@ function tt(e) {
|
|
|
1422
1417
|
},
|
|
1423
1418
|
children: t.renderedCells.map(({ cell: e, columnIndex: n }, u) => {
|
|
1424
1419
|
switch (e.cellKind) {
|
|
1425
|
-
case "grouping": return /* @__PURE__ */
|
|
1420
|
+
case "grouping": return /* @__PURE__ */ F(J, {
|
|
1426
1421
|
cell: e,
|
|
1427
1422
|
row: c,
|
|
1428
1423
|
columnIndex: u,
|
|
@@ -1436,13 +1431,13 @@ function tt(e) {
|
|
|
1436
1431
|
gridColumn: e.gridColumnSpan,
|
|
1437
1432
|
ps: e.depthPadding,
|
|
1438
1433
|
overflow: "auto",
|
|
1439
|
-
children: s ? /* @__PURE__ */
|
|
1434
|
+
children: s ? /* @__PURE__ */ F(tt, {
|
|
1440
1435
|
cell: e,
|
|
1441
1436
|
columnIndex: u
|
|
1442
|
-
}) : /* @__PURE__ */
|
|
1437
|
+
}) : /* @__PURE__ */ F(i, {
|
|
1443
1438
|
textWrap: "nowrap",
|
|
1444
1439
|
px: 3,
|
|
1445
|
-
children: /* @__PURE__ */
|
|
1440
|
+
children: /* @__PURE__ */ I(p, {
|
|
1446
1441
|
component: `${t.grid.componentName}.body.groupRow.expandButton`,
|
|
1447
1442
|
onClick: () => t.toggleRow(),
|
|
1448
1443
|
cursor: "pointer",
|
|
@@ -1453,7 +1448,7 @@ function tt(e) {
|
|
|
1453
1448
|
tabIndex: -1,
|
|
1454
1449
|
"aria-expanded": o
|
|
1455
1450
|
},
|
|
1456
|
-
children: [/* @__PURE__ */
|
|
1451
|
+
children: [/* @__PURE__ */ F(Y, {
|
|
1457
1452
|
fill: "currentColor",
|
|
1458
1453
|
width: "14px",
|
|
1459
1454
|
height: "14px",
|
|
@@ -1462,15 +1457,15 @@ function tt(e) {
|
|
|
1462
1457
|
})
|
|
1463
1458
|
})
|
|
1464
1459
|
}, e.column.key);
|
|
1465
|
-
case "selection": return /* @__PURE__ */
|
|
1460
|
+
case "selection": return /* @__PURE__ */ F(J, {
|
|
1466
1461
|
cell: e,
|
|
1467
1462
|
row: c,
|
|
1468
1463
|
columnIndex: u,
|
|
1469
1464
|
ariaColIndex: n + 1,
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1465
|
+
children: /* @__PURE__ */ F(h, {
|
|
1471
1466
|
variant: "datagrid",
|
|
1472
1467
|
m: 1,
|
|
1473
|
-
checked:
|
|
1468
|
+
checked: r,
|
|
1474
1469
|
indeterminate: a,
|
|
1475
1470
|
onChange: l,
|
|
1476
1471
|
props: {
|
|
@@ -1479,14 +1474,14 @@ function tt(e) {
|
|
|
1479
1474
|
}
|
|
1480
1475
|
})
|
|
1481
1476
|
}, e.column.key);
|
|
1482
|
-
case "aggregate": return /* @__PURE__ */
|
|
1477
|
+
case "aggregate": return /* @__PURE__ */ F(J, {
|
|
1483
1478
|
cell: e,
|
|
1484
1479
|
row: c,
|
|
1485
1480
|
columnIndex: u,
|
|
1486
1481
|
ariaColIndex: n + 1,
|
|
1487
|
-
children: e.aggregate && /* @__PURE__ */
|
|
1482
|
+
children: e.aggregate && /* @__PURE__ */ F(Ze, { cell: e.aggregate })
|
|
1488
1483
|
}, e.column.key);
|
|
1489
|
-
case "spacer": return /* @__PURE__ */
|
|
1484
|
+
case "spacer": return /* @__PURE__ */ F(J, {
|
|
1490
1485
|
cell: e,
|
|
1491
1486
|
row: c,
|
|
1492
1487
|
columnIndex: u,
|
|
@@ -1499,30 +1494,30 @@ function tt(e) {
|
|
|
1499
1494
|
})
|
|
1500
1495
|
});
|
|
1501
1496
|
}
|
|
1502
|
-
|
|
1503
|
-
var
|
|
1504
|
-
function
|
|
1497
|
+
nt.displayName = "DataGridGroupRow";
|
|
1498
|
+
var rt = D(nt), it = "input,select,textarea,button";
|
|
1499
|
+
function at(e) {
|
|
1505
1500
|
let { options: t } = e.editor;
|
|
1506
1501
|
return typeof t == "function" ? t(e.row.data) : t ?? [];
|
|
1507
1502
|
}
|
|
1508
|
-
function
|
|
1509
|
-
let { cell: t, row:
|
|
1510
|
-
|
|
1511
|
-
let e = s.current?.querySelector(
|
|
1503
|
+
function ot(e) {
|
|
1504
|
+
let { cell: t, row: n, columnIndex: i } = e, { grid: a } = t, o = L(), s = N(null), c = u("datagrid-cell-error"), { error: l, pending: d } = t;
|
|
1505
|
+
r(() => {
|
|
1506
|
+
let e = s.current?.querySelector(it);
|
|
1512
1507
|
e?.focus(), e instanceof HTMLInputElement && e.type !== "checkbox" && e.select();
|
|
1513
1508
|
}, []);
|
|
1514
1509
|
let f = O(() => {
|
|
1515
1510
|
s.current?.closest("[role=\"gridcell\"]")?.focus();
|
|
1516
|
-
}, []),
|
|
1511
|
+
}, []), p = O((e) => {
|
|
1517
1512
|
if (!o) return;
|
|
1518
|
-
let t = a.edits.nextEditable(
|
|
1513
|
+
let t = a.edits.nextEditable(n - o.headerRowCount, i, e.shiftKey);
|
|
1519
1514
|
t && (e.preventDefault(), o.setActiveCell(t.row + o.headerRowCount, t.column, { reason: "programmatic" }), a.edits.beginAt(t.row, t.column));
|
|
1520
1515
|
}, [
|
|
1521
1516
|
i,
|
|
1522
1517
|
a,
|
|
1523
1518
|
o,
|
|
1524
|
-
|
|
1525
|
-
]),
|
|
1519
|
+
n
|
|
1520
|
+
]), h = O((e) => {
|
|
1526
1521
|
if (e.key === "Escape") {
|
|
1527
1522
|
if (s.current?.querySelector("[aria-expanded=\"true\"]")) return;
|
|
1528
1523
|
e.preventDefault(), e.stopPropagation(), t.cancelEdit(), f();
|
|
@@ -1537,29 +1532,29 @@ function at(e) {
|
|
|
1537
1532
|
e.preventDefault();
|
|
1538
1533
|
return;
|
|
1539
1534
|
}
|
|
1540
|
-
|
|
1535
|
+
p(e);
|
|
1541
1536
|
}
|
|
1542
1537
|
}, [
|
|
1543
1538
|
t,
|
|
1544
1539
|
f,
|
|
1545
|
-
|
|
1540
|
+
p
|
|
1546
1541
|
]), _ = O(() => {
|
|
1547
1542
|
!t.editing || t.pending || t.commitEdit();
|
|
1548
1543
|
}, [t]);
|
|
1549
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ I(m, {
|
|
1550
1545
|
ref: s,
|
|
1551
1546
|
component: `${a.componentName}.body.cell.editor`,
|
|
1552
1547
|
variant: { isPending: d },
|
|
1553
|
-
props: { onKeyDown:
|
|
1548
|
+
props: { onKeyDown: h },
|
|
1554
1549
|
width: "fit",
|
|
1555
1550
|
height: "fit",
|
|
1556
1551
|
ai: "center",
|
|
1557
|
-
children: [/* @__PURE__ */
|
|
1552
|
+
children: [/* @__PURE__ */ F(st, {
|
|
1558
1553
|
cell: t,
|
|
1559
|
-
errorId:
|
|
1554
|
+
errorId: l ? c : void 0,
|
|
1560
1555
|
onBlur: _,
|
|
1561
1556
|
onCommitted: f
|
|
1562
|
-
}),
|
|
1557
|
+
}), l && /* @__PURE__ */ F(g, {
|
|
1563
1558
|
anchor: s,
|
|
1564
1559
|
side: "bottom",
|
|
1565
1560
|
align: "start",
|
|
@@ -1568,18 +1563,18 @@ function at(e) {
|
|
|
1568
1563
|
component: `${a.componentName}.body.cell.error`,
|
|
1569
1564
|
id: c,
|
|
1570
1565
|
props: { role: "alert" },
|
|
1571
|
-
children:
|
|
1566
|
+
children: l
|
|
1572
1567
|
})]
|
|
1573
1568
|
});
|
|
1574
1569
|
}
|
|
1575
|
-
function
|
|
1570
|
+
function st(e) {
|
|
1576
1571
|
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, f = {
|
|
1577
1572
|
"aria-label": t.grid.localeText.editCell(String(d)),
|
|
1578
1573
|
"aria-invalid": n ? !0 : void 0,
|
|
1579
1574
|
"aria-describedby": n
|
|
1580
1575
|
};
|
|
1581
|
-
if (a) return /* @__PURE__ */
|
|
1582
|
-
if (o === "checkbox") return /* @__PURE__ */
|
|
1576
|
+
if (a) return /* @__PURE__ */ F(a, { cell: t });
|
|
1577
|
+
if (o === "checkbox") return /* @__PURE__ */ F(h, {
|
|
1583
1578
|
checked: !!t.draft,
|
|
1584
1579
|
onChange: (e) => {
|
|
1585
1580
|
t.setDraft(e.target.checked), t.commitEdit(), i();
|
|
@@ -1589,7 +1584,7 @@ function ot(e) {
|
|
|
1589
1584
|
onBlur: r
|
|
1590
1585
|
}
|
|
1591
1586
|
});
|
|
1592
|
-
if (o === "select") return /* @__PURE__ */
|
|
1587
|
+
if (o === "select") return /* @__PURE__ */ F(S, {
|
|
1593
1588
|
value: t.draft,
|
|
1594
1589
|
defaultOpen: !0,
|
|
1595
1590
|
width: "fit",
|
|
@@ -1601,13 +1596,13 @@ function ot(e) {
|
|
|
1601
1596
|
t.setDraft(e ?? null), t.commitEdit(), i();
|
|
1602
1597
|
},
|
|
1603
1598
|
props: f,
|
|
1604
|
-
children:
|
|
1599
|
+
children: at(t).map((e) => /* @__PURE__ */ F(S.Item, {
|
|
1605
1600
|
value: e.value,
|
|
1606
1601
|
children: e.label ?? String(e.value)
|
|
1607
1602
|
}, String(e.value)))
|
|
1608
1603
|
});
|
|
1609
1604
|
let p = o === "number";
|
|
1610
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ F(y, {
|
|
1611
1606
|
type: p ? "number" : "text",
|
|
1612
1607
|
value: t.draft === null || t.draft === void 0 ? "" : String(t.draft),
|
|
1613
1608
|
placeholder: s,
|
|
@@ -1629,19 +1624,19 @@ function ot(e) {
|
|
|
1629
1624
|
}
|
|
1630
1625
|
});
|
|
1631
1626
|
}
|
|
1632
|
-
|
|
1627
|
+
ot.displayName = "DataGridCellEditor";
|
|
1633
1628
|
//#endregion
|
|
1634
1629
|
//#region src/components/dataGrid/components/dataGridCellText.tsx
|
|
1635
|
-
function
|
|
1630
|
+
function ct(e) {
|
|
1636
1631
|
let { cell: t } = e;
|
|
1637
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ F(m, {
|
|
1638
1633
|
component: `${t.grid.componentName}.body.cell.text`,
|
|
1639
1634
|
height: "fit",
|
|
1640
1635
|
width: "fit",
|
|
1641
1636
|
overflow: "auto",
|
|
1642
1637
|
ai: "center",
|
|
1643
1638
|
jc: t.column.align,
|
|
1644
|
-
children: /* @__PURE__ */
|
|
1639
|
+
children: /* @__PURE__ */ F(i, {
|
|
1645
1640
|
px: 3,
|
|
1646
1641
|
textOverflow: "ellipsis",
|
|
1647
1642
|
overflow: "hidden",
|
|
@@ -1650,18 +1645,18 @@ function st(e) {
|
|
|
1650
1645
|
})
|
|
1651
1646
|
});
|
|
1652
1647
|
}
|
|
1653
|
-
|
|
1648
|
+
ct.displayName = "DataGridCellText";
|
|
1654
1649
|
//#endregion
|
|
1655
1650
|
//#region src/components/dataGrid/components/dataGridCellTree.tsx
|
|
1656
|
-
function
|
|
1657
|
-
let { cell: t, row: n, children:
|
|
1651
|
+
function lt(e) {
|
|
1652
|
+
let { cell: t, row: n, children: r } = e, { hasChildren: a, treeExpanded: o, level: s } = n, c = n.grid.componentName, l = O((e) => {
|
|
1658
1653
|
e.stopPropagation(), n.toggleTree();
|
|
1659
1654
|
}, [n]), u = t.value == null || t.value === "" ? t.grid.localeText.unnamedRow(n.rowIndex + 1) : String(t.value);
|
|
1660
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ I(m, {
|
|
1661
1656
|
component: `${c}.body.cell.tree`,
|
|
1662
1657
|
ai: "center",
|
|
1663
1658
|
ps: s * n.grid.tree.indent,
|
|
1664
|
-
children: [a ? /* @__PURE__ */
|
|
1659
|
+
children: [a ? /* @__PURE__ */ F(p, {
|
|
1665
1660
|
component: `${c}.body.cell.tree.toggle`,
|
|
1666
1661
|
variant: { isExpanded: o },
|
|
1667
1662
|
type: "button",
|
|
@@ -1674,44 +1669,44 @@ function ct(e) {
|
|
|
1674
1669
|
tabIndex: -1,
|
|
1675
1670
|
"aria-label": (o ? t.grid.localeText.collapseTreeRow : t.grid.localeText.expandTreeRow)(u)
|
|
1676
1671
|
},
|
|
1677
|
-
children: /* @__PURE__ */
|
|
1672
|
+
children: /* @__PURE__ */ F(Y, {
|
|
1678
1673
|
fill: "currentColor",
|
|
1679
1674
|
width: "14px",
|
|
1680
1675
|
height: "14px",
|
|
1681
1676
|
rotate: o ? 0 : -90
|
|
1682
1677
|
})
|
|
1683
|
-
}) : /* @__PURE__ */
|
|
1678
|
+
}) : /* @__PURE__ */ F(i, { component: `${c}.body.cell.tree.spacer` }), /* @__PURE__ */ F(i, {
|
|
1684
1679
|
textOverflow: "ellipsis",
|
|
1685
1680
|
overflow: "hidden",
|
|
1686
1681
|
textWrap: "nowrap",
|
|
1687
1682
|
minWidth: 0,
|
|
1688
|
-
children:
|
|
1683
|
+
children: r
|
|
1689
1684
|
})]
|
|
1690
1685
|
});
|
|
1691
1686
|
}
|
|
1692
|
-
|
|
1687
|
+
lt.displayName = "DataGridCellTree";
|
|
1693
1688
|
//#endregion
|
|
1694
1689
|
//#region src/components/dataGrid/components/dataGridRow.tsx
|
|
1695
|
-
function
|
|
1696
|
-
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (
|
|
1690
|
+
function ut(e) {
|
|
1691
|
+
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (L()?.headerRowCount ?? 0) + n, o = U(t) ? t : void 0, s = o && t.grid.tree.columnKey, c = O(() => {
|
|
1697
1692
|
t.toggleDetail();
|
|
1698
1693
|
}, [t]), l = (e, n) => {
|
|
1699
|
-
if (e.editing) return /* @__PURE__ */
|
|
1694
|
+
if (e.editing) return /* @__PURE__ */ F(ot, {
|
|
1700
1695
|
cell: e,
|
|
1701
1696
|
row: a,
|
|
1702
1697
|
columnIndex: n
|
|
1703
1698
|
});
|
|
1704
|
-
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */
|
|
1699
|
+
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */ F(tt, {
|
|
1705
1700
|
cell: e,
|
|
1706
1701
|
columnIndex: n
|
|
1707
|
-
}) : e.column.Cell ? /* @__PURE__ */
|
|
1708
|
-
return !o || e.column.key !== s ? r : /* @__PURE__ */
|
|
1702
|
+
}) : e.column.Cell ? /* @__PURE__ */ F(e.column.Cell, { cell: e }) : /* @__PURE__ */ F(ct, { cell: e });
|
|
1703
|
+
return !o || e.column.key !== s ? r : /* @__PURE__ */ F(lt, {
|
|
1709
1704
|
cell: e,
|
|
1710
1705
|
row: o,
|
|
1711
1706
|
children: r
|
|
1712
1707
|
});
|
|
1713
1708
|
};
|
|
1714
|
-
return /* @__PURE__ */
|
|
1709
|
+
return /* @__PURE__ */ F(m, {
|
|
1715
1710
|
component: `${t.grid.componentName}.body.row`,
|
|
1716
1711
|
className: "grid-row",
|
|
1717
1712
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1727,7 +1722,7 @@ function lt(e) {
|
|
|
1727
1722
|
onClick: i ? c : void 0
|
|
1728
1723
|
},
|
|
1729
1724
|
cursor: i ? "pointer" : void 0,
|
|
1730
|
-
children: t.cells.map((e, t) => /* @__PURE__ */
|
|
1725
|
+
children: t.cells.map((e, t) => /* @__PURE__ */ F(J, {
|
|
1731
1726
|
cell: e,
|
|
1732
1727
|
row: a,
|
|
1733
1728
|
columnIndex: t,
|
|
@@ -1735,37 +1730,37 @@ function lt(e) {
|
|
|
1735
1730
|
}, e.column.key))
|
|
1736
1731
|
});
|
|
1737
1732
|
}
|
|
1738
|
-
|
|
1739
|
-
var
|
|
1733
|
+
ut.displayName = "DataGridRow";
|
|
1734
|
+
var dt = D(ut);
|
|
1740
1735
|
//#endregion
|
|
1741
1736
|
//#region src/components/dataGrid/components/dataGridBody.tsx
|
|
1742
|
-
function
|
|
1743
|
-
return e instanceof
|
|
1737
|
+
function ft(e, t, n) {
|
|
1738
|
+
return e instanceof V ? /* @__PURE__ */ F(Xe, {
|
|
1744
1739
|
row: e,
|
|
1745
1740
|
index: t,
|
|
1746
1741
|
version: n
|
|
1747
|
-
}, e.key) : e instanceof
|
|
1742
|
+
}, e.key) : e instanceof Je ? /* @__PURE__ */ F(rt, {
|
|
1748
1743
|
row: e,
|
|
1749
1744
|
index: t,
|
|
1750
1745
|
version: n
|
|
1751
|
-
}, e.key) : /* @__PURE__ */
|
|
1746
|
+
}, e.key) : /* @__PURE__ */ F(dt, {
|
|
1752
1747
|
row: e,
|
|
1753
1748
|
index: t,
|
|
1754
1749
|
version: n
|
|
1755
1750
|
}, e.key);
|
|
1756
1751
|
}
|
|
1757
|
-
function
|
|
1758
|
-
let { grid: t, scroll: n } = e, { viewport:
|
|
1752
|
+
function pt(e) {
|
|
1753
|
+
let { grid: t, scroll: n } = e, { viewport: r } = t, { startIndex: a, 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(), h = M(() => d ? null : W.take(f, o, a).map((e, n) => ft(e, a + n, t.rowVersion(e, a + n))), [
|
|
1759
1754
|
f,
|
|
1760
1755
|
t,
|
|
1761
1756
|
d,
|
|
1762
1757
|
o,
|
|
1763
1758
|
a,
|
|
1764
|
-
|
|
1759
|
+
p
|
|
1765
1760
|
]);
|
|
1766
1761
|
if (d) {
|
|
1767
1762
|
let { noDataComponent: e } = t.props.def, n = t.props.loading ? t.localeText.loadingRows : t.localeText.noRows;
|
|
1768
|
-
return /* @__PURE__ */
|
|
1763
|
+
return /* @__PURE__ */ F(m, {
|
|
1769
1764
|
component: `${t.componentName}.body.empty`,
|
|
1770
1765
|
jc: "center",
|
|
1771
1766
|
ai: "center",
|
|
@@ -1773,15 +1768,15 @@ function ft(e) {
|
|
|
1773
1768
|
position: "sticky",
|
|
1774
1769
|
insetStart: 0,
|
|
1775
1770
|
props: { role: "row" },
|
|
1776
|
-
style: { height:
|
|
1777
|
-
children: /* @__PURE__ */
|
|
1771
|
+
style: { height: r.emptyHeight },
|
|
1772
|
+
children: /* @__PURE__ */ F(i, {
|
|
1778
1773
|
display: "contents",
|
|
1779
1774
|
props: { role: "gridcell" },
|
|
1780
1775
|
children: e ?? n
|
|
1781
1776
|
})
|
|
1782
1777
|
});
|
|
1783
1778
|
}
|
|
1784
|
-
return u ? /* @__PURE__ */
|
|
1779
|
+
return u ? /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F(x, {
|
|
1785
1780
|
component: `${t.componentName}.body`,
|
|
1786
1781
|
width: "max-content",
|
|
1787
1782
|
minWidth: "fit",
|
|
@@ -1790,13 +1785,13 @@ function ft(e) {
|
|
|
1790
1785
|
props: { role: "rowgroup" },
|
|
1791
1786
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1792
1787
|
children: h
|
|
1793
|
-
}), /* @__PURE__ */
|
|
1788
|
+
}), /* @__PURE__ */ F($e, { grid: t })] }) : /* @__PURE__ */ I(i, {
|
|
1794
1789
|
props: { role: "presentation" },
|
|
1795
1790
|
style: { height: l },
|
|
1796
|
-
children: [/* @__PURE__ */
|
|
1791
|
+
children: [/* @__PURE__ */ F(i, {
|
|
1797
1792
|
props: { role: "presentation" },
|
|
1798
1793
|
style: { height: `${c}px` },
|
|
1799
|
-
children: /* @__PURE__ */
|
|
1794
|
+
children: /* @__PURE__ */ F(x, {
|
|
1800
1795
|
component: `${t.componentName}.body`,
|
|
1801
1796
|
width: "max-content",
|
|
1802
1797
|
minWidth: "fit",
|
|
@@ -1810,15 +1805,15 @@ function ft(e) {
|
|
|
1810
1805
|
},
|
|
1811
1806
|
children: h
|
|
1812
1807
|
})
|
|
1813
|
-
}), /* @__PURE__ */
|
|
1808
|
+
}), /* @__PURE__ */ F($e, { grid: t })]
|
|
1814
1809
|
});
|
|
1815
1810
|
}
|
|
1816
|
-
|
|
1811
|
+
pt.displayName = "DataGridBody";
|
|
1817
1812
|
//#endregion
|
|
1818
1813
|
//#region src/components/dataGrid/components/dataGridEmptyColumns.tsx
|
|
1819
|
-
function
|
|
1814
|
+
function mt(e) {
|
|
1820
1815
|
let { grid: t } = e;
|
|
1821
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ F(m, {
|
|
1822
1817
|
component: `${t.componentName}.emptyColumns`,
|
|
1823
1818
|
d: "column",
|
|
1824
1819
|
ai: "center",
|
|
@@ -1829,11 +1824,11 @@ function pt(e) {
|
|
|
1829
1824
|
bgColor: "gray-50",
|
|
1830
1825
|
borderRadius: 4,
|
|
1831
1826
|
theme: { dark: { bgColor: "gray-900" } },
|
|
1832
|
-
children: /* @__PURE__ */
|
|
1827
|
+
children: /* @__PURE__ */ I(m, {
|
|
1833
1828
|
d: "column",
|
|
1834
1829
|
ai: "center",
|
|
1835
1830
|
gap: 3,
|
|
1836
|
-
children: [/* @__PURE__ */
|
|
1831
|
+
children: [/* @__PURE__ */ F(i, {
|
|
1837
1832
|
width: 16,
|
|
1838
1833
|
height: 16,
|
|
1839
1834
|
borderRadius: 999,
|
|
@@ -1842,29 +1837,29 @@ function pt(e) {
|
|
|
1842
1837
|
display: "flex",
|
|
1843
1838
|
ai: "center",
|
|
1844
1839
|
jc: "center",
|
|
1845
|
-
children: /* @__PURE__ */
|
|
1840
|
+
children: /* @__PURE__ */ F(f, {
|
|
1846
1841
|
viewBox: "0 0 24 24",
|
|
1847
1842
|
width: "40",
|
|
1848
1843
|
fill: "currentColor",
|
|
1849
1844
|
color: "gray-400",
|
|
1850
1845
|
theme: { dark: { color: "gray-500" } },
|
|
1851
|
-
children: /* @__PURE__ */
|
|
1846
|
+
children: /* @__PURE__ */ F(d, {
|
|
1852
1847
|
fillRule: "evenodd",
|
|
1853
1848
|
props: { clipRule: "evenodd" },
|
|
1854
1849
|
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"
|
|
1855
1850
|
})
|
|
1856
1851
|
})
|
|
1857
|
-
}), /* @__PURE__ */
|
|
1852
|
+
}), /* @__PURE__ */ I(m, {
|
|
1858
1853
|
d: "column",
|
|
1859
1854
|
ai: "center",
|
|
1860
1855
|
gap: 1,
|
|
1861
|
-
children: [/* @__PURE__ */
|
|
1856
|
+
children: [/* @__PURE__ */ F(i, {
|
|
1862
1857
|
fontSize: 18,
|
|
1863
1858
|
fontWeight: 600,
|
|
1864
1859
|
color: "gray-900",
|
|
1865
1860
|
theme: { dark: { color: "gray-50" } },
|
|
1866
1861
|
children: t.localeText.noColumnsTitle
|
|
1867
|
-
}), /* @__PURE__ */
|
|
1862
|
+
}), /* @__PURE__ */ F(i, {
|
|
1868
1863
|
fontSize: 14,
|
|
1869
1864
|
color: "gray-500",
|
|
1870
1865
|
textAlign: "center",
|
|
@@ -1877,7 +1872,7 @@ function pt(e) {
|
|
|
1877
1872
|
}
|
|
1878
1873
|
//#endregion
|
|
1879
1874
|
//#region src/utils/dataGrid/headerCellUtils.ts
|
|
1880
|
-
var
|
|
1875
|
+
var ht;
|
|
1881
1876
|
(function(e) {
|
|
1882
1877
|
let t = e.CELL_SELECTOR = "[role=\"columnheader\"][aria-sort]", n = ".resizer", r = `button, input, a, [role="menu"], [role="separator"], ${n}`;
|
|
1883
1878
|
function i(e, t) {
|
|
@@ -1952,8 +1947,8 @@ var mt;
|
|
|
1952
1947
|
} : e;
|
|
1953
1948
|
}
|
|
1954
1949
|
e.pause = u;
|
|
1955
|
-
})(
|
|
1956
|
-
var
|
|
1950
|
+
})(ht ||= {});
|
|
1951
|
+
var X = ht, gt;
|
|
1957
1952
|
(function(e) {
|
|
1958
1953
|
function t(e, t) {
|
|
1959
1954
|
return (t?.type === "text" ? t.value : "") === (e.trim() ? e : "");
|
|
@@ -1980,31 +1975,31 @@ var Y = mt, ht;
|
|
|
1980
1975
|
return t.valueTo === void 0 ? isNaN(r) : t.valueTo === r;
|
|
1981
1976
|
}
|
|
1982
1977
|
e.numberMatches = r;
|
|
1983
|
-
})(
|
|
1984
|
-
var
|
|
1985
|
-
function
|
|
1986
|
-
let
|
|
1987
|
-
for (let e of
|
|
1988
|
-
|
|
1978
|
+
})(gt ||= {});
|
|
1979
|
+
var Z = gt, _t = 300;
|
|
1980
|
+
function vt(e, t, n) {
|
|
1981
|
+
let i = N(/* @__PURE__ */ new Map()), o = O(() => {
|
|
1982
|
+
for (let e of i.current.values()) clearTimeout(e);
|
|
1983
|
+
i.current.clear();
|
|
1989
1984
|
}, []), s = O((e, t) => {
|
|
1990
|
-
clearTimeout(
|
|
1991
|
-
|
|
1992
|
-
},
|
|
1985
|
+
clearTimeout(i.current.get(e)), i.current.set(e, setTimeout(() => {
|
|
1986
|
+
i.current.delete(e), t();
|
|
1987
|
+
}, _t));
|
|
1993
1988
|
}, []);
|
|
1994
1989
|
A(() => o, [o]);
|
|
1995
|
-
let c =
|
|
1996
|
-
t(e) || (o(),
|
|
1990
|
+
let c = a(() => {
|
|
1991
|
+
t(e) || (o(), n(e));
|
|
1997
1992
|
});
|
|
1998
|
-
return
|
|
1993
|
+
return r(c, [e, c]), {
|
|
1999
1994
|
debounce: s,
|
|
2000
1995
|
cancel: o
|
|
2001
1996
|
};
|
|
2002
1997
|
}
|
|
2003
1998
|
//#endregion
|
|
2004
1999
|
//#region src/components/dataGrid/components/dataGridColumnFilter.tsx
|
|
2005
|
-
function
|
|
2000
|
+
function yt(e) {
|
|
2006
2001
|
let { label: t, onClear: n } = e;
|
|
2007
|
-
return /* @__PURE__ */
|
|
2002
|
+
return /* @__PURE__ */ F(p, {
|
|
2008
2003
|
clean: !0,
|
|
2009
2004
|
type: "button",
|
|
2010
2005
|
position: "absolute",
|
|
@@ -2019,7 +2014,7 @@ function vt(e) {
|
|
|
2019
2014
|
tabIndex: -1,
|
|
2020
2015
|
"aria-label": t
|
|
2021
2016
|
},
|
|
2022
|
-
children: /* @__PURE__ */
|
|
2017
|
+
children: /* @__PURE__ */ F(i, {
|
|
2023
2018
|
fontSize: 10,
|
|
2024
2019
|
color: "gray-400",
|
|
2025
2020
|
hover: { color: "gray-600" },
|
|
@@ -2027,16 +2022,16 @@ function vt(e) {
|
|
|
2027
2022
|
})
|
|
2028
2023
|
});
|
|
2029
2024
|
}
|
|
2030
|
-
function
|
|
2031
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(t?.type === "text" ? t.value : ""), { debounce: s, cancel: c } =
|
|
2025
|
+
function bt({ column: e }) {
|
|
2026
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(t?.type === "text" ? t.value : ""), { debounce: s, cancel: c } = vt(t, (e) => Z.textMatches(a, e), (e) => o(e?.type === "text" ? e.value : "")), l = O((t) => {
|
|
2032
2027
|
let n = t.target.value;
|
|
2033
2028
|
o(n), s("value", () => e.setTextFilter(n));
|
|
2034
2029
|
}, [e, s]), u = O(() => {
|
|
2035
2030
|
c(), o(""), e.clearFilter();
|
|
2036
2031
|
}, [e, c]);
|
|
2037
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ I(m, {
|
|
2038
2033
|
component: `${n}.filter.cell.input`,
|
|
2039
|
-
children: [/* @__PURE__ */
|
|
2034
|
+
children: [/* @__PURE__ */ F(y, {
|
|
2040
2035
|
width: "fit",
|
|
2041
2036
|
variant: "compact",
|
|
2042
2037
|
placeholder: e.filterConfig?.placeholder ?? i.filterPlaceholder,
|
|
@@ -2049,16 +2044,16 @@ function yt({ column: e }) {
|
|
|
2049
2044
|
tabIndex: -1,
|
|
2050
2045
|
"aria-label": i.filterColumn(r)
|
|
2051
2046
|
}
|
|
2052
|
-
}), a && /* @__PURE__ */
|
|
2047
|
+
}), a && /* @__PURE__ */ F(yt, {
|
|
2053
2048
|
label: i.clearFilter(r),
|
|
2054
2049
|
onClear: u
|
|
2055
2050
|
})]
|
|
2056
2051
|
});
|
|
2057
2052
|
}
|
|
2058
|
-
function
|
|
2059
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(() =>
|
|
2053
|
+
function xt({ column: e }) {
|
|
2054
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(() => Z.numberDraft(t)), s = N(a), c = O((e) => {
|
|
2060
2055
|
s.current = e, o(e);
|
|
2061
|
-
}, []), { debounce: l, cancel: u } =
|
|
2056
|
+
}, []), { debounce: l, cancel: u } = vt(t, (e) => Z.numberMatches(a, e), (e) => c(Z.numberDraft(e))), { operator: d, value: f, valueTo: p } = a, h = e.filterConfig, g = O(() => {
|
|
2062
2057
|
let { operator: t, value: n, valueTo: r } = s.current;
|
|
2063
2058
|
e.setNumberFilter(t, n, r);
|
|
2064
2059
|
}, [e]), _ = O((e, t) => {
|
|
@@ -2071,21 +2066,21 @@ function bt({ column: e }) {
|
|
|
2071
2066
|
g,
|
|
2072
2067
|
l,
|
|
2073
2068
|
u
|
|
2074
|
-
]),
|
|
2075
|
-
u(), c(
|
|
2069
|
+
]), v = O((e) => _({ value: e.target.value }, !0), [_]), b = O((e) => _({ valueTo: e.target.value }, !0), [_]), x = O((e) => _({ operator: e }, !1), [_]), C = O(() => {
|
|
2070
|
+
u(), c(Z.numberDraft(void 0)), e.clearFilter();
|
|
2076
2071
|
}, [
|
|
2077
2072
|
e,
|
|
2078
2073
|
u,
|
|
2079
2074
|
c
|
|
2080
2075
|
]);
|
|
2081
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ I(m, {
|
|
2082
2077
|
component: `${n}.filter.cell.input`,
|
|
2083
2078
|
ai: d === "between" ? "start" : "center",
|
|
2084
2079
|
gap: 1,
|
|
2085
|
-
children: [/* @__PURE__ */
|
|
2080
|
+
children: [/* @__PURE__ */ I(S, {
|
|
2086
2081
|
value: d,
|
|
2087
2082
|
variant: "compact",
|
|
2088
|
-
onChange: (e) => e &&
|
|
2083
|
+
onChange: (e) => e && x(e),
|
|
2089
2084
|
minWidth: 6,
|
|
2090
2085
|
hideIcon: !0,
|
|
2091
2086
|
b: 0,
|
|
@@ -2096,49 +2091,49 @@ function bt({ column: e }) {
|
|
|
2096
2091
|
"aria-label": i.filterComparison(r)
|
|
2097
2092
|
},
|
|
2098
2093
|
children: [
|
|
2099
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2100
2095
|
value: "eq",
|
|
2101
2096
|
children: "="
|
|
2102
2097
|
}),
|
|
2103
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2104
2099
|
value: "ne",
|
|
2105
2100
|
children: "≠"
|
|
2106
2101
|
}),
|
|
2107
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2108
2103
|
value: "gt",
|
|
2109
2104
|
children: ">"
|
|
2110
2105
|
}),
|
|
2111
|
-
/* @__PURE__ */
|
|
2106
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2112
2107
|
value: "gte",
|
|
2113
2108
|
children: "≥"
|
|
2114
2109
|
}),
|
|
2115
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2116
2111
|
value: "lt",
|
|
2117
2112
|
children: "<"
|
|
2118
2113
|
}),
|
|
2119
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2120
2115
|
value: "lte",
|
|
2121
2116
|
children: "≤"
|
|
2122
2117
|
}),
|
|
2123
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ F(S.Item, {
|
|
2124
2119
|
value: "between",
|
|
2125
2120
|
children: "↔"
|
|
2126
2121
|
})
|
|
2127
2122
|
]
|
|
2128
|
-
}), d === "between" ? /* @__PURE__ */
|
|
2123
|
+
}), d === "between" ? /* @__PURE__ */ I(m, {
|
|
2129
2124
|
d: "column",
|
|
2130
2125
|
gap: 1,
|
|
2131
2126
|
flex1: !0,
|
|
2132
|
-
children: [/* @__PURE__ */
|
|
2127
|
+
children: [/* @__PURE__ */ I(m, {
|
|
2133
2128
|
ai: "center",
|
|
2134
2129
|
position: "relative",
|
|
2135
2130
|
flex1: !0,
|
|
2136
|
-
children: [/* @__PURE__ */
|
|
2131
|
+
children: [/* @__PURE__ */ F(y, {
|
|
2137
2132
|
type: "number",
|
|
2138
2133
|
variant: "compact",
|
|
2139
2134
|
placeholder: h?.placeholder ?? i.filterFromPlaceholder,
|
|
2140
2135
|
value: f,
|
|
2141
|
-
onChange:
|
|
2136
|
+
onChange: v,
|
|
2142
2137
|
width: "fit",
|
|
2143
2138
|
step: h?.step,
|
|
2144
2139
|
b: 0,
|
|
@@ -2148,19 +2143,19 @@ function bt({ column: e }) {
|
|
|
2148
2143
|
tabIndex: -1,
|
|
2149
2144
|
"aria-label": i.filterFrom(r)
|
|
2150
2145
|
}
|
|
2151
|
-
}), (f !== "" ||
|
|
2146
|
+
}), (f !== "" || p !== "") && /* @__PURE__ */ F(yt, {
|
|
2152
2147
|
label: i.clearFilter(r),
|
|
2153
2148
|
onClear: C
|
|
2154
2149
|
})]
|
|
2155
|
-
}), /* @__PURE__ */
|
|
2150
|
+
}), /* @__PURE__ */ F(m, {
|
|
2156
2151
|
ai: "center",
|
|
2157
2152
|
flex1: !0,
|
|
2158
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ F(y, {
|
|
2159
2154
|
type: "number",
|
|
2160
2155
|
variant: "compact",
|
|
2161
2156
|
placeholder: i.filterToPlaceholder,
|
|
2162
|
-
value:
|
|
2163
|
-
onChange:
|
|
2157
|
+
value: p,
|
|
2158
|
+
onChange: b,
|
|
2164
2159
|
width: "fit",
|
|
2165
2160
|
step: h?.step,
|
|
2166
2161
|
b: 0,
|
|
@@ -2172,16 +2167,16 @@ function bt({ column: e }) {
|
|
|
2172
2167
|
}
|
|
2173
2168
|
})
|
|
2174
2169
|
})]
|
|
2175
|
-
}) : /* @__PURE__ */
|
|
2170
|
+
}) : /* @__PURE__ */ I(m, {
|
|
2176
2171
|
ai: "center",
|
|
2177
2172
|
position: "relative",
|
|
2178
2173
|
flex1: !0,
|
|
2179
|
-
children: [/* @__PURE__ */
|
|
2174
|
+
children: [/* @__PURE__ */ F(y, {
|
|
2180
2175
|
type: "number",
|
|
2181
2176
|
variant: "compact",
|
|
2182
2177
|
placeholder: h?.placeholder ?? i.filterValuePlaceholder,
|
|
2183
2178
|
value: f,
|
|
2184
|
-
onChange:
|
|
2179
|
+
onChange: v,
|
|
2185
2180
|
width: "fit",
|
|
2186
2181
|
step: h?.step,
|
|
2187
2182
|
b: 0,
|
|
@@ -2191,20 +2186,20 @@ function bt({ column: e }) {
|
|
|
2191
2186
|
tabIndex: -1,
|
|
2192
2187
|
"aria-label": i.filterColumn(r)
|
|
2193
2188
|
}
|
|
2194
|
-
}), f !== "" && /* @__PURE__ */
|
|
2189
|
+
}), f !== "" && /* @__PURE__ */ F(yt, {
|
|
2195
2190
|
label: i.clearFilter(r),
|
|
2196
2191
|
onClear: C
|
|
2197
2192
|
})]
|
|
2198
2193
|
})]
|
|
2199
2194
|
});
|
|
2200
2195
|
}
|
|
2201
|
-
function
|
|
2202
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid,
|
|
2196
|
+
function St({ column: e }) {
|
|
2197
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), a = e.grid.localeText, o = t?.type === "multiselect" ? t.values : [], s = e.filterOptions, c = O((t, n) => {
|
|
2203
2198
|
e.setMultiselectFilter(n);
|
|
2204
2199
|
}, [e]);
|
|
2205
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ F(m, {
|
|
2206
2201
|
component: `${n}.filter.cell.input`,
|
|
2207
|
-
children: /* @__PURE__ */
|
|
2202
|
+
children: /* @__PURE__ */ I(S, {
|
|
2208
2203
|
multiple: !0,
|
|
2209
2204
|
showCheckbox: !0,
|
|
2210
2205
|
isSearchable: !0,
|
|
@@ -2219,17 +2214,17 @@ function xt({ column: e }) {
|
|
|
2219
2214
|
focus: { outline: 0 },
|
|
2220
2215
|
props: {
|
|
2221
2216
|
tabIndex: -1,
|
|
2222
|
-
"aria-label": a.filterColumn(
|
|
2217
|
+
"aria-label": a.filterColumn(r)
|
|
2223
2218
|
},
|
|
2224
2219
|
children: [
|
|
2225
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ F(S.Display, { children: (t) => t.length === 0 ? /* @__PURE__ */ F(i, {
|
|
2226
2221
|
tag: "span",
|
|
2227
2222
|
color: "gray-400",
|
|
2228
2223
|
children: e.filterConfig?.placeholder ?? a.filterSelectPlaceholder
|
|
2229
2224
|
}) : t.length === 1 ? s.find((e) => e.value === t[0])?.label ?? String(t[0]) : `${t.length} selected` }),
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
s.map((e) => /* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ F(S.Unselect, { children: a.filterSelectClear }),
|
|
2226
|
+
/* @__PURE__ */ F(S.SelectAll, { children: a.filterSelectAll }),
|
|
2227
|
+
s.map((e) => /* @__PURE__ */ F(S.Item, {
|
|
2233
2228
|
value: e.value,
|
|
2234
2229
|
ai: "center",
|
|
2235
2230
|
gap: 2,
|
|
@@ -2239,21 +2234,21 @@ function xt({ column: e }) {
|
|
|
2239
2234
|
})
|
|
2240
2235
|
});
|
|
2241
2236
|
}
|
|
2242
|
-
function
|
|
2237
|
+
function Ct(e) {
|
|
2243
2238
|
let { column: t } = e, n = t.filterConfig;
|
|
2244
2239
|
if (!n) return null;
|
|
2245
2240
|
switch (n.type) {
|
|
2246
|
-
case "number": return /* @__PURE__ */
|
|
2247
|
-
case "multiselect": return /* @__PURE__ */
|
|
2248
|
-
default: return /* @__PURE__ */
|
|
2241
|
+
case "number": return /* @__PURE__ */ F(xt, { column: t });
|
|
2242
|
+
case "multiselect": return /* @__PURE__ */ F(St, { column: t });
|
|
2243
|
+
default: return /* @__PURE__ */ F(bt, { column: t });
|
|
2249
2244
|
}
|
|
2250
2245
|
}
|
|
2251
|
-
|
|
2246
|
+
Ct.displayName = "DataGridColumnFilter";
|
|
2252
2247
|
//#endregion
|
|
2253
2248
|
//#region src/components/dataGrid/components/dataGridFilterCell.tsx
|
|
2254
|
-
function
|
|
2255
|
-
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:
|
|
2256
|
-
return /* @__PURE__ */
|
|
2249
|
+
function wt(e) {
|
|
2250
|
+
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: h, isLastEndPinned: g } = t.pinFlags.value, { ref: _, tabIndex: v, onFocus: y } = R(L(), r, i), b = t.isGrouping || t.isRowNumber || t.isRowSelection;
|
|
2251
|
+
return /* @__PURE__ */ F(m, {
|
|
2257
2252
|
ref: _,
|
|
2258
2253
|
component: `${n.componentName}.filter.cell`,
|
|
2259
2254
|
props: {
|
|
@@ -2265,7 +2260,7 @@ function Ct(e) {
|
|
|
2265
2260
|
variant: {
|
|
2266
2261
|
isPinned: d,
|
|
2267
2262
|
isFirstStartPinned: f,
|
|
2268
|
-
isLastStartPinned:
|
|
2263
|
+
isLastStartPinned: p,
|
|
2269
2264
|
isFirstEndPinned: h,
|
|
2270
2265
|
isLastEndPinned: g
|
|
2271
2266
|
},
|
|
@@ -2275,23 +2270,23 @@ function Ct(e) {
|
|
|
2275
2270
|
insetInlineStart: l ? `var(${o})` : void 0,
|
|
2276
2271
|
insetInlineEnd: u ? `var(${s})` : void 0
|
|
2277
2272
|
},
|
|
2278
|
-
children: !b && c && /* @__PURE__ */
|
|
2273
|
+
children: !b && c && /* @__PURE__ */ F(Ct, { column: t })
|
|
2279
2274
|
});
|
|
2280
2275
|
}
|
|
2281
|
-
|
|
2276
|
+
wt.displayName = "DataGridFilterCell";
|
|
2282
2277
|
//#endregion
|
|
2283
2278
|
//#region src/components/dataGrid/components/dataGridFilterRow.tsx
|
|
2284
|
-
function
|
|
2279
|
+
function Tt(e) {
|
|
2285
2280
|
let { grid: t } = e;
|
|
2286
2281
|
if (!t.filter.hasFilterableColumns) return null;
|
|
2287
2282
|
let n = t.headerRows.value.length;
|
|
2288
|
-
return /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ F(i, {
|
|
2289
2284
|
display: "contents",
|
|
2290
2285
|
props: {
|
|
2291
2286
|
role: "row",
|
|
2292
2287
|
"aria-rowindex": n + 1
|
|
2293
2288
|
},
|
|
2294
|
-
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */
|
|
2289
|
+
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */ F(wt, {
|
|
2295
2290
|
column: e,
|
|
2296
2291
|
grid: t,
|
|
2297
2292
|
row: n,
|
|
@@ -2299,25 +2294,25 @@ function wt(e) {
|
|
|
2299
2294
|
}, e.uniqueKey))
|
|
2300
2295
|
});
|
|
2301
2296
|
}
|
|
2302
|
-
|
|
2297
|
+
Tt.displayName = "DataGridFilterRow";
|
|
2303
2298
|
//#endregion
|
|
2304
2299
|
//#region src/icons/sortIcon.tsx
|
|
2305
|
-
function
|
|
2306
|
-
return /* @__PURE__ */
|
|
2300
|
+
function Et(e) {
|
|
2301
|
+
return /* @__PURE__ */ F(f, {
|
|
2307
2302
|
viewBox: "0 0 24 24",
|
|
2308
2303
|
width: "1.5rem",
|
|
2309
2304
|
...e,
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2305
|
+
children: /* @__PURE__ */ F(d, { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" })
|
|
2311
2306
|
});
|
|
2312
2307
|
}
|
|
2313
2308
|
//#endregion
|
|
2314
2309
|
//#region src/icons/dotsIcon.tsx
|
|
2315
|
-
function
|
|
2316
|
-
return /* @__PURE__ */
|
|
2310
|
+
function Dt(e) {
|
|
2311
|
+
return /* @__PURE__ */ F(f, {
|
|
2317
2312
|
viewBox: "0 0 16 16",
|
|
2318
2313
|
width: "18",
|
|
2319
2314
|
...e,
|
|
2320
|
-
children: /* @__PURE__ */
|
|
2315
|
+
children: /* @__PURE__ */ F(d, {
|
|
2321
2316
|
strokeWidth: 4,
|
|
2322
2317
|
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"
|
|
2323
2318
|
})
|
|
@@ -2325,71 +2320,71 @@ function Et(e) {
|
|
|
2325
2320
|
}
|
|
2326
2321
|
//#endregion
|
|
2327
2322
|
//#region src/icons/groupingIcon.tsx
|
|
2328
|
-
function
|
|
2329
|
-
return /* @__PURE__ */
|
|
2323
|
+
function Ot(e) {
|
|
2324
|
+
return /* @__PURE__ */ F(f, {
|
|
2330
2325
|
viewBox: "0 0 24 24",
|
|
2331
2326
|
width: "1.5rem",
|
|
2332
2327
|
...e,
|
|
2333
|
-
children: /* @__PURE__ */
|
|
2328
|
+
children: /* @__PURE__ */ F(d, { d: "M3 5h8v2H3V5zm0 6h8v2H3v-2zm0 6h8v2H3v-2zm12-12h6v6h-6V5zm1 1v4h4V6h-4zm-1 7h6v6h-6v-6zm1 1v4h4v-4h-4z" })
|
|
2334
2329
|
});
|
|
2335
2330
|
}
|
|
2336
2331
|
//#endregion
|
|
2337
2332
|
//#region src/icons/pinIcon.tsx
|
|
2338
|
-
function
|
|
2339
|
-
return /* @__PURE__ */
|
|
2333
|
+
function kt(e) {
|
|
2334
|
+
return /* @__PURE__ */ F(f, {
|
|
2340
2335
|
viewBox: "0 0 1024 1024",
|
|
2341
2336
|
width: "1.5rem",
|
|
2342
2337
|
...e,
|
|
2343
|
-
children: /* @__PURE__ */
|
|
2338
|
+
children: /* @__PURE__ */ F(d, { 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" })
|
|
2344
2339
|
});
|
|
2345
2340
|
}
|
|
2346
2341
|
//#endregion
|
|
2347
2342
|
//#region src/components/dataGrid/components/dataGridHeaderCellContextMenu.tsx
|
|
2348
|
-
function
|
|
2343
|
+
function At(e) {
|
|
2349
2344
|
let { side: t, left: n, right: r } = e;
|
|
2350
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F(C, {
|
|
2351
2346
|
rtl: { display: "none" },
|
|
2352
2347
|
children: t === "start" ? n : r
|
|
2353
|
-
}), /* @__PURE__ */
|
|
2348
|
+
}), /* @__PURE__ */ F(C, {
|
|
2354
2349
|
ltr: { display: "none" },
|
|
2355
2350
|
children: t === "start" ? r : n
|
|
2356
2351
|
})] });
|
|
2357
2352
|
}
|
|
2358
|
-
function
|
|
2359
|
-
let { column: t } = e, { grid:
|
|
2360
|
-
let e = (e) => /* @__PURE__ */
|
|
2361
|
-
component: `${
|
|
2353
|
+
function jt(e) {
|
|
2354
|
+
let { column: t } = e, { grid: n, isEndAligned: a, header: s, key: d } = t, f = t.headerCell, h = String(s ?? d), v = n.localeText, y = u("datagrid-column-menu"), [b, x] = P(!1), S = N(null), w = N(null), T = N(!1), ee = a ? 3 : void 0, ne = a ? void 0 : 3, E = M(() => {
|
|
2355
|
+
let e = (e) => /* @__PURE__ */ F(C, {
|
|
2356
|
+
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.icon`,
|
|
2362
2357
|
children: e
|
|
2363
|
-
}),
|
|
2358
|
+
}), r = (t) => e(/* @__PURE__ */ F(Et, {
|
|
2364
2359
|
width: "100%",
|
|
2365
2360
|
fill: "currentColor",
|
|
2366
2361
|
rotate: t
|
|
2367
|
-
})), a = (t, n) => e(/* @__PURE__ */
|
|
2362
|
+
})), a = (t, n) => e(/* @__PURE__ */ F(kt, {
|
|
2368
2363
|
width: "100%",
|
|
2369
2364
|
fill: "currentColor",
|
|
2370
2365
|
rotate: t,
|
|
2371
2366
|
rtl: { rotate: n }
|
|
2372
|
-
})), o = e(/* @__PURE__ */
|
|
2367
|
+
})), o = e(/* @__PURE__ */ F(Ot, {
|
|
2373
2368
|
width: "100%",
|
|
2374
2369
|
fill: "currentColor"
|
|
2375
|
-
})), s = /* @__PURE__ */
|
|
2370
|
+
})), s = /* @__PURE__ */ F(i, { width: 4 });
|
|
2376
2371
|
return [
|
|
2377
2372
|
[
|
|
2378
|
-
|
|
2373
|
+
f.canSortAsc && {
|
|
2379
2374
|
key: "sort-asc",
|
|
2380
|
-
icon:
|
|
2375
|
+
icon: r(),
|
|
2381
2376
|
label: v.sortAscending,
|
|
2382
2377
|
text: v.sortAscending,
|
|
2383
2378
|
run: () => t.sortColumn("ASC")
|
|
2384
2379
|
},
|
|
2385
|
-
|
|
2380
|
+
f.canSortDesc && {
|
|
2386
2381
|
key: "sort-desc",
|
|
2387
|
-
icon:
|
|
2382
|
+
icon: r(180),
|
|
2388
2383
|
label: v.sortDescending,
|
|
2389
2384
|
text: v.sortDescending,
|
|
2390
2385
|
run: () => t.sortColumn("DESC")
|
|
2391
2386
|
},
|
|
2392
|
-
|
|
2387
|
+
f.canClearSort && {
|
|
2393
2388
|
key: "sort-clear",
|
|
2394
2389
|
icon: s,
|
|
2395
2390
|
label: v.clearSort,
|
|
@@ -2398,10 +2393,10 @@ function At(e) {
|
|
|
2398
2393
|
}
|
|
2399
2394
|
],
|
|
2400
2395
|
[
|
|
2401
|
-
|
|
2396
|
+
f.canPinStart && {
|
|
2402
2397
|
key: "pin-start",
|
|
2403
2398
|
icon: a(0, -90),
|
|
2404
|
-
label: /* @__PURE__ */
|
|
2399
|
+
label: /* @__PURE__ */ F(At, {
|
|
2405
2400
|
side: "start",
|
|
2406
2401
|
left: v.pinLeft,
|
|
2407
2402
|
right: v.pinRight
|
|
@@ -2409,10 +2404,10 @@ function At(e) {
|
|
|
2409
2404
|
text: v.pinLeft,
|
|
2410
2405
|
run: () => t.pinColumn("START")
|
|
2411
2406
|
},
|
|
2412
|
-
|
|
2407
|
+
f.canPinEnd && {
|
|
2413
2408
|
key: "pin-end",
|
|
2414
2409
|
icon: a(-90, 0),
|
|
2415
|
-
label: /* @__PURE__ */
|
|
2410
|
+
label: /* @__PURE__ */ F(At, {
|
|
2416
2411
|
side: "end",
|
|
2417
2412
|
left: v.pinLeft,
|
|
2418
2413
|
right: v.pinRight
|
|
@@ -2420,7 +2415,7 @@ function At(e) {
|
|
|
2420
2415
|
text: v.pinRight,
|
|
2421
2416
|
run: () => t.pinColumn("END")
|
|
2422
2417
|
},
|
|
2423
|
-
|
|
2418
|
+
f.canUnpin && {
|
|
2424
2419
|
key: "unpin",
|
|
2425
2420
|
icon: s,
|
|
2426
2421
|
label: v.unpin,
|
|
@@ -2428,24 +2423,24 @@ function At(e) {
|
|
|
2428
2423
|
run: () => t.pinColumn()
|
|
2429
2424
|
}
|
|
2430
2425
|
],
|
|
2431
|
-
[
|
|
2426
|
+
[f.canGroupBy && {
|
|
2432
2427
|
key: "group",
|
|
2433
2428
|
icon: o,
|
|
2434
|
-
label: /* @__PURE__ */
|
|
2429
|
+
label: /* @__PURE__ */ F(i, {
|
|
2435
2430
|
textWrap: "nowrap",
|
|
2436
|
-
children: v.groupBy(
|
|
2431
|
+
children: v.groupBy(h)
|
|
2437
2432
|
}),
|
|
2438
|
-
text: v.groupBy(
|
|
2433
|
+
text: v.groupBy(h),
|
|
2439
2434
|
run: t.toggleGrouping
|
|
2440
|
-
},
|
|
2435
|
+
}, f.canUnGroupAll && {
|
|
2441
2436
|
key: "ungroup",
|
|
2442
2437
|
icon: o,
|
|
2443
|
-
label: /* @__PURE__ */
|
|
2438
|
+
label: /* @__PURE__ */ F(i, {
|
|
2444
2439
|
textWrap: "nowrap",
|
|
2445
2440
|
children: v.ungroupAll
|
|
2446
2441
|
}),
|
|
2447
2442
|
text: v.ungroupAll,
|
|
2448
|
-
run:
|
|
2443
|
+
run: n.unGroupAll
|
|
2449
2444
|
}]
|
|
2450
2445
|
].map((e) => e.filter((e) => e !== !1)).filter((e) => e.length > 0).flatMap((e, t) => e.map((e, n) => ({
|
|
2451
2446
|
...e,
|
|
@@ -2453,89 +2448,89 @@ function At(e) {
|
|
|
2453
2448
|
})));
|
|
2454
2449
|
}, [
|
|
2455
2450
|
t,
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2451
|
+
h,
|
|
2452
|
+
n,
|
|
2453
|
+
f,
|
|
2459
2454
|
v
|
|
2460
|
-
]),
|
|
2461
|
-
|
|
2462
|
-
}, []),
|
|
2463
|
-
count:
|
|
2464
|
-
textOf: (e) =>
|
|
2455
|
+
]), D = O((e = !0) => {
|
|
2456
|
+
T.current = !1, x(!1), e && S.current?.focus();
|
|
2457
|
+
}, []), k = l({
|
|
2458
|
+
count: E.length,
|
|
2459
|
+
textOf: (e) => E[e]?.text ?? "",
|
|
2465
2460
|
onSelect: (e) => {
|
|
2466
|
-
|
|
2461
|
+
E[e]?.run(), D();
|
|
2467
2462
|
}
|
|
2468
2463
|
});
|
|
2469
|
-
|
|
2464
|
+
c({
|
|
2470
2465
|
enabled: b,
|
|
2471
|
-
inside: [
|
|
2472
|
-
onDismiss: () =>
|
|
2473
|
-
}),
|
|
2466
|
+
inside: [S, w],
|
|
2467
|
+
onDismiss: () => D()
|
|
2468
|
+
}), o({
|
|
2474
2469
|
enabled: b,
|
|
2475
|
-
returnTo:
|
|
2470
|
+
returnTo: S
|
|
2476
2471
|
});
|
|
2477
|
-
let
|
|
2478
|
-
|
|
2479
|
-
}, [
|
|
2480
|
-
return
|
|
2481
|
-
if (!
|
|
2482
|
-
let e =
|
|
2483
|
-
e && (
|
|
2484
|
-
}), /* @__PURE__ */
|
|
2472
|
+
let A = k.setActiveIndex, j = k.activeItem, re = O(() => {
|
|
2473
|
+
A(0, { reason: "programmatic" }), T.current = !0, x(!0);
|
|
2474
|
+
}, [A]);
|
|
2475
|
+
return r(() => {
|
|
2476
|
+
if (!T.current) return;
|
|
2477
|
+
let e = j();
|
|
2478
|
+
e && (T.current = !1, e.focus());
|
|
2479
|
+
}), /* @__PURE__ */ I(m, {
|
|
2485
2480
|
position: "absolute",
|
|
2486
2481
|
insetStart: ee,
|
|
2487
|
-
insetEnd:
|
|
2482
|
+
insetEnd: ne,
|
|
2488
2483
|
top: "1/2",
|
|
2489
2484
|
translateY: -3,
|
|
2490
2485
|
ai: "center",
|
|
2491
|
-
children: [/* @__PURE__ */
|
|
2492
|
-
ref:
|
|
2493
|
-
component: `${
|
|
2494
|
-
onClick: () => b ?
|
|
2495
|
-
variant:
|
|
2486
|
+
children: [/* @__PURE__ */ F(p, {
|
|
2487
|
+
ref: S,
|
|
2488
|
+
component: `${n.componentName}.header.cell.contextMenu`,
|
|
2489
|
+
onClick: () => b ? D(!1) : re(),
|
|
2490
|
+
variant: f.contextMenuButtonVariant,
|
|
2496
2491
|
type: "button",
|
|
2497
2492
|
props: {
|
|
2498
2493
|
tabIndex: -1,
|
|
2499
|
-
"aria-label": v.columnOptions(
|
|
2494
|
+
"aria-label": v.columnOptions(h),
|
|
2500
2495
|
"aria-haspopup": "menu",
|
|
2501
2496
|
"aria-expanded": b,
|
|
2502
2497
|
"aria-controls": b ? y : void 0
|
|
2503
2498
|
},
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2505
|
-
component: `${
|
|
2506
|
-
children: /* @__PURE__ */
|
|
2499
|
+
children: /* @__PURE__ */ F(C, {
|
|
2500
|
+
component: `${n.componentName}.header.cell.contextMenu.icon`,
|
|
2501
|
+
children: /* @__PURE__ */ F(Dt, { fill: "currentColor" })
|
|
2507
2502
|
})
|
|
2508
|
-
}), /* @__PURE__ */
|
|
2503
|
+
}), /* @__PURE__ */ F(_, {
|
|
2509
2504
|
present: b,
|
|
2510
|
-
children: (e) => /* @__PURE__ */
|
|
2511
|
-
component: `${
|
|
2505
|
+
children: (e) => /* @__PURE__ */ F(g, {
|
|
2506
|
+
component: `${n.componentName}.header.cell.contextMenu.tooltip`,
|
|
2512
2507
|
variant: { closed: !e.present },
|
|
2513
2508
|
ref: w,
|
|
2514
2509
|
contentRef: e.ref,
|
|
2515
|
-
anchor:
|
|
2510
|
+
anchor: S,
|
|
2516
2511
|
side: "bottom",
|
|
2517
2512
|
align: "end",
|
|
2518
2513
|
matchWidth: !1,
|
|
2519
2514
|
id: y,
|
|
2520
2515
|
props: {
|
|
2521
2516
|
role: "menu",
|
|
2522
|
-
"aria-label": v.columnOptions(
|
|
2523
|
-
onKeyDown:
|
|
2517
|
+
"aria-label": v.columnOptions(h),
|
|
2518
|
+
onKeyDown: k.onKeyDown,
|
|
2524
2519
|
...e.props
|
|
2525
2520
|
},
|
|
2526
|
-
children:
|
|
2527
|
-
let { ref:
|
|
2528
|
-
return /* @__PURE__ */
|
|
2521
|
+
children: E.map((e, t) => {
|
|
2522
|
+
let { ref: r, tabIndex: a, onFocus: o } = k.itemProps(t);
|
|
2523
|
+
return /* @__PURE__ */ I(te, { children: [e.startsSection && /* @__PURE__ */ F(i, {
|
|
2529
2524
|
bb: 1,
|
|
2530
2525
|
my: 2,
|
|
2531
2526
|
borderColor: "gray-300",
|
|
2532
|
-
component: `${
|
|
2533
|
-
}), /* @__PURE__ */
|
|
2534
|
-
component: `${
|
|
2535
|
-
ref:
|
|
2527
|
+
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.separator`
|
|
2528
|
+
}), /* @__PURE__ */ I(p, {
|
|
2529
|
+
component: `${n.componentName}.header.cell.contextMenu.tooltip.item`,
|
|
2530
|
+
ref: r,
|
|
2536
2531
|
type: "button",
|
|
2537
2532
|
onClick: (t) => {
|
|
2538
|
-
t.stopPropagation(), e.run(),
|
|
2533
|
+
t.stopPropagation(), e.run(), D();
|
|
2539
2534
|
},
|
|
2540
2535
|
props: {
|
|
2541
2536
|
role: "menuitem",
|
|
@@ -2549,20 +2544,20 @@ function At(e) {
|
|
|
2549
2544
|
})]
|
|
2550
2545
|
});
|
|
2551
2546
|
}
|
|
2552
|
-
|
|
2547
|
+
jt.displayName = "DataGridHeaderCellContextMenu";
|
|
2553
2548
|
//#endregion
|
|
2554
2549
|
//#region src/components/dataGrid/components/dataGridHeaderCellResizer.tsx
|
|
2555
|
-
var
|
|
2556
|
-
function
|
|
2557
|
-
let { column: t, controls: n } = e,
|
|
2550
|
+
var Mt = (e) => "touches" in e ? e.touches[0]?.pageX ?? 0 : e.pageX, Nt = 16, Pt = 150;
|
|
2551
|
+
function Ft(e) {
|
|
2552
|
+
let { column: t, controls: n } = e, r = t.grid.resizerStyle, a = t.headerCell, o = O((e) => {
|
|
2558
2553
|
let { grid: n } = t;
|
|
2559
|
-
e.type === "mousedown" && e.preventDefault(), t.beginResize(
|
|
2560
|
-
let r = new AbortController(), { signal: i } = r, a = 0, o =
|
|
2554
|
+
e.type === "mousedown" && e.preventDefault(), t.beginResize(Mt(e.nativeEvent));
|
|
2555
|
+
let r = new AbortController(), { signal: i } = r, a = 0, o = Mt(e.nativeEvent), s = () => {
|
|
2561
2556
|
t.applyResize(o), n.paintSizes();
|
|
2562
2557
|
}, c = n.resizeMode === "instant" ? (e) => {
|
|
2563
|
-
o =
|
|
2558
|
+
o = Mt(e), s();
|
|
2564
2559
|
} : (e) => {
|
|
2565
|
-
o =
|
|
2560
|
+
o = Mt(e), a ||= requestAnimationFrame(() => {
|
|
2566
2561
|
a = 0, s();
|
|
2567
2562
|
});
|
|
2568
2563
|
}, l = () => {
|
|
@@ -2587,7 +2582,7 @@ function Nt(e) {
|
|
|
2587
2582
|
let d = O((e) => {
|
|
2588
2583
|
switch (e.key) {
|
|
2589
2584
|
case "ArrowRight":
|
|
2590
|
-
t.moveResizer(
|
|
2585
|
+
t.moveResizer(Nt);
|
|
2591
2586
|
break;
|
|
2592
2587
|
case "ArrowLeft":
|
|
2593
2588
|
t.moveResizer(-16);
|
|
@@ -2600,14 +2595,14 @@ function Nt(e) {
|
|
|
2600
2595
|
break;
|
|
2601
2596
|
default: return;
|
|
2602
2597
|
}
|
|
2603
|
-
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u,
|
|
2598
|
+
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u, Pt);
|
|
2604
2599
|
}, [
|
|
2605
2600
|
t,
|
|
2606
2601
|
u,
|
|
2607
2602
|
a,
|
|
2608
2603
|
l
|
|
2609
2604
|
]), { isAtGridEnd: f } = a;
|
|
2610
|
-
return /* @__PURE__ */
|
|
2605
|
+
return /* @__PURE__ */ F(m, {
|
|
2611
2606
|
height: "fit",
|
|
2612
2607
|
ai: "center",
|
|
2613
2608
|
position: "absolute",
|
|
@@ -2615,7 +2610,7 @@ function Nt(e) {
|
|
|
2615
2610
|
insetStart: t.pin === "END" ? -.75 : void 0,
|
|
2616
2611
|
zIndex: 1,
|
|
2617
2612
|
py: 3,
|
|
2618
|
-
children: /* @__PURE__ */
|
|
2613
|
+
children: /* @__PURE__ */ F(i, {
|
|
2619
2614
|
cursor: "col-resize",
|
|
2620
2615
|
px: f ? void 0 : .75,
|
|
2621
2616
|
ps: f ? 1.5 : void 0,
|
|
@@ -2626,10 +2621,10 @@ function Nt(e) {
|
|
|
2626
2621
|
onMouseDown: o,
|
|
2627
2622
|
onTouchStart: o
|
|
2628
2623
|
},
|
|
2629
|
-
children: /* @__PURE__ */
|
|
2624
|
+
children: /* @__PURE__ */ F(i, {
|
|
2630
2625
|
component: `${t.grid.componentName}.header.cell.resizer`,
|
|
2631
|
-
opacity:
|
|
2632
|
-
group:
|
|
2626
|
+
opacity: r === "visible" ? void 0 : 0,
|
|
2627
|
+
group: r === "hover" ? { "header-cell/hover": { opacity: 1 } } : void 0,
|
|
2633
2628
|
props: {
|
|
2634
2629
|
role: "separator",
|
|
2635
2630
|
"aria-label": a.resizerLabel,
|
|
@@ -2647,13 +2642,13 @@ function Nt(e) {
|
|
|
2647
2642
|
})
|
|
2648
2643
|
});
|
|
2649
2644
|
}
|
|
2650
|
-
|
|
2645
|
+
Ft.displayName = "DataGridHeaderCellResizer";
|
|
2651
2646
|
//#endregion
|
|
2652
2647
|
//#region src/components/dataGrid/components/dataGridHeaderCell.tsx
|
|
2653
|
-
function
|
|
2654
|
-
let { column: t, row: n, columnIndex:
|
|
2648
|
+
function It(e) {
|
|
2649
|
+
let { column: t, row: n, columnIndex: r } = e, { grid: a } = t, { isStartPinned: o, isEndPinned: s } = t.pinFlags.value, c = t.headerCell, { isSortable: l, showResizer: d, showContextMenu: f, paddingStart: p, paddingEnd: g } = c, { ref: _, tabIndex: y, onFocus: b } = R(L(), n, r), x = u("datagrid-columnheader"), S = N(null), C = O(() => {
|
|
2655
2650
|
a.toggleSelectAllRows();
|
|
2656
|
-
}, [a]), w = t.isRowSelection ? /* @__PURE__ */
|
|
2651
|
+
}, [a]), w = t.isRowSelection ? /* @__PURE__ */ F(h, {
|
|
2657
2652
|
variant: "datagrid",
|
|
2658
2653
|
m: 1,
|
|
2659
2654
|
indeterminate: a.someRowsSelected && !a.allRowsSelected,
|
|
@@ -2663,12 +2658,12 @@ function Pt(e) {
|
|
|
2663
2658
|
tabIndex: -1,
|
|
2664
2659
|
"aria-label": a.localeText.selectAllRows
|
|
2665
2660
|
}
|
|
2666
|
-
}) : c.hiddenLabel ? /* @__PURE__ */
|
|
2661
|
+
}) : c.hiddenLabel ? /* @__PURE__ */ F(v, {
|
|
2667
2662
|
tag: "span",
|
|
2668
2663
|
children: c.hiddenLabel
|
|
2669
2664
|
}) : c.label;
|
|
2670
|
-
return /* @__PURE__ */
|
|
2671
|
-
ref:
|
|
2665
|
+
return /* @__PURE__ */ F(m, {
|
|
2666
|
+
ref: _,
|
|
2672
2667
|
id: x,
|
|
2673
2668
|
props: {
|
|
2674
2669
|
role: "columnheader",
|
|
@@ -2678,9 +2673,9 @@ function Pt(e) {
|
|
|
2678
2673
|
"aria-sort": c.ariaSort,
|
|
2679
2674
|
tabIndex: y,
|
|
2680
2675
|
onFocus: b,
|
|
2681
|
-
onPointerDown:
|
|
2682
|
-
onClick:
|
|
2683
|
-
|
|
2676
|
+
onPointerDown: l ? (e) => S.current = e.target : void 0,
|
|
2677
|
+
onClick: l ? (e) => {
|
|
2678
|
+
X.isSortPress(e.currentTarget, S.current ?? e.target) && t.sortColumn(), S.current = null;
|
|
2684
2679
|
} : void 0
|
|
2685
2680
|
},
|
|
2686
2681
|
className: "header-cell",
|
|
@@ -2693,29 +2688,29 @@ function Pt(e) {
|
|
|
2693
2688
|
insetInlineStart: o ? `var(${t.inlineStartVarName})` : void 0,
|
|
2694
2689
|
insetInlineEnd: s ? `var(${t.inlineEndVarName})` : void 0
|
|
2695
2690
|
},
|
|
2696
|
-
children: /* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ I(ae, { children: [
|
|
2692
|
+
/* @__PURE__ */ F(m, {
|
|
2698
2693
|
width: "fit",
|
|
2699
2694
|
height: "fit",
|
|
2700
2695
|
jc: t.align,
|
|
2701
|
-
children: /* @__PURE__ */
|
|
2696
|
+
children: /* @__PURE__ */ I(m, {
|
|
2702
2697
|
overflow: "hidden",
|
|
2703
2698
|
position: t.isLeaf ? void 0 : "sticky",
|
|
2704
2699
|
ai: "center",
|
|
2705
2700
|
transition: "none",
|
|
2706
|
-
ps:
|
|
2701
|
+
ps: p,
|
|
2707
2702
|
pe: g,
|
|
2708
2703
|
style: { insetInlineStart: t.pin ? void 0 : `var(${a.inlineStartEdgeVarName})` },
|
|
2709
2704
|
children: [
|
|
2710
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ F(i, {
|
|
2711
2706
|
overflow: "hidden",
|
|
2712
2707
|
textOverflow: "ellipsis",
|
|
2713
2708
|
textWrap: "nowrap",
|
|
2714
2709
|
children: w
|
|
2715
2710
|
}),
|
|
2716
|
-
c.isSorted && /* @__PURE__ */
|
|
2711
|
+
c.isSorted && /* @__PURE__ */ F(i, {
|
|
2717
2712
|
ps: (t.inlineWidth ?? 0) < 58 ? 0 : 2,
|
|
2718
|
-
children: /* @__PURE__ */
|
|
2713
|
+
children: /* @__PURE__ */ F(Et, {
|
|
2719
2714
|
width: "16px",
|
|
2720
2715
|
rotate: c.sortDirection === "ASC" ? 0 : 180,
|
|
2721
2716
|
transition: "transform",
|
|
@@ -2725,37 +2720,37 @@ function Pt(e) {
|
|
|
2725
2720
|
fill: "currentColor"
|
|
2726
2721
|
})
|
|
2727
2722
|
}),
|
|
2728
|
-
f && /* @__PURE__ */
|
|
2723
|
+
f && /* @__PURE__ */ F(i, { minWidth: t.isEndAligned ? 4 : 10 })
|
|
2729
2724
|
]
|
|
2730
2725
|
})
|
|
2731
2726
|
}),
|
|
2732
|
-
d && /* @__PURE__ */
|
|
2727
|
+
d && /* @__PURE__ */ F(Ft, {
|
|
2733
2728
|
column: t,
|
|
2734
2729
|
controls: x
|
|
2735
2730
|
}),
|
|
2736
|
-
f && /* @__PURE__ */
|
|
2731
|
+
f && /* @__PURE__ */ F(jt, { column: t })
|
|
2737
2732
|
] })
|
|
2738
2733
|
});
|
|
2739
2734
|
}
|
|
2740
|
-
|
|
2735
|
+
It.displayName = "DataGridHeaderCell";
|
|
2741
2736
|
//#endregion
|
|
2742
2737
|
//#region src/components/dataGrid/components/dataGridHeader.tsx
|
|
2743
|
-
function
|
|
2744
|
-
let { grid: t } = e, n = N(null), [
|
|
2738
|
+
function Lt(e) {
|
|
2739
|
+
let { grid: t } = e, n = N(null), [r, a] = P(X.INITIAL), o = t.headerHover === "sliding", s = (e) => {
|
|
2745
2740
|
let t = n.current;
|
|
2746
2741
|
if (!o || !t || e.pointerType === "touch") return;
|
|
2747
|
-
if (
|
|
2748
|
-
let r =
|
|
2749
|
-
a((e) =>
|
|
2750
|
-
}, c = () => a((e) =>
|
|
2742
|
+
if (X.isOnResizer(e.target)) return a((e) => X.pause(e));
|
|
2743
|
+
let r = X.cellAt(t, e.target), i = r && X.bounds(t, r);
|
|
2744
|
+
a((e) => X.hover(e, i));
|
|
2745
|
+
}, c = () => a((e) => X.hover(e, void 0)), l = r.visible || r.paused;
|
|
2751
2746
|
A(() => {
|
|
2752
2747
|
if (l) return document.addEventListener("scroll", c, {
|
|
2753
2748
|
capture: !0,
|
|
2754
2749
|
passive: !0
|
|
2755
2750
|
}), () => document.removeEventListener("scroll", c, { capture: !0 });
|
|
2756
2751
|
}, [l]);
|
|
2757
|
-
let { bounds: u } =
|
|
2758
|
-
return /* @__PURE__ */
|
|
2752
|
+
let { bounds: u } = r;
|
|
2753
|
+
return /* @__PURE__ */ I(x, {
|
|
2759
2754
|
ref: n,
|
|
2760
2755
|
component: `${t.componentName}.header`,
|
|
2761
2756
|
props: {
|
|
@@ -2765,26 +2760,26 @@ function Ft(e) {
|
|
|
2765
2760
|
},
|
|
2766
2761
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
2767
2762
|
children: [
|
|
2768
|
-
t.headerRows.value.map((e, t) => /* @__PURE__ */
|
|
2763
|
+
t.headerRows.value.map((e, t) => /* @__PURE__ */ F(i, {
|
|
2769
2764
|
display: "contents",
|
|
2770
2765
|
props: {
|
|
2771
2766
|
role: "row",
|
|
2772
2767
|
"aria-rowindex": t + 1
|
|
2773
2768
|
},
|
|
2774
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2769
|
+
children: e.map((e, n) => /* @__PURE__ */ F(It, {
|
|
2775
2770
|
column: e,
|
|
2776
2771
|
row: t,
|
|
2777
2772
|
columnIndex: n
|
|
2778
2773
|
}, e.uniqueKey))
|
|
2779
2774
|
}, t)),
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
o && u && /* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ F(Tt, { grid: t }),
|
|
2776
|
+
o && u && /* @__PURE__ */ F(i, {
|
|
2782
2777
|
tag: "span",
|
|
2783
2778
|
component: `${t.componentName}.header.hover`,
|
|
2784
2779
|
variant: {
|
|
2785
|
-
visible:
|
|
2786
|
-
backward:
|
|
2787
|
-
entering:
|
|
2780
|
+
visible: r.visible,
|
|
2781
|
+
backward: r.backward,
|
|
2782
|
+
entering: r.entering
|
|
2788
2783
|
},
|
|
2789
2784
|
style: {
|
|
2790
2785
|
left: `${u.left}px`,
|
|
@@ -2797,53 +2792,53 @@ function Ft(e) {
|
|
|
2797
2792
|
]
|
|
2798
2793
|
});
|
|
2799
2794
|
}
|
|
2800
|
-
|
|
2801
|
-
var
|
|
2795
|
+
Lt.displayName = "DataGridHeader";
|
|
2796
|
+
var Rt = D(Lt);
|
|
2802
2797
|
//#endregion
|
|
2803
2798
|
//#region src/components/dataGrid/components/dataGridLoader.tsx
|
|
2804
|
-
function
|
|
2799
|
+
function zt(e) {
|
|
2805
2800
|
let { grid: t } = e;
|
|
2806
|
-
return /* @__PURE__ */
|
|
2801
|
+
return /* @__PURE__ */ F(i, {
|
|
2807
2802
|
component: `${t.componentName}.loader`,
|
|
2808
2803
|
props: { "aria-hidden": !0 },
|
|
2809
|
-
children: /* @__PURE__ */
|
|
2804
|
+
children: /* @__PURE__ */ F(i, {
|
|
2810
2805
|
component: `${t.componentName}.loader.track`,
|
|
2811
2806
|
style: { height: 3 },
|
|
2812
|
-
children: /* @__PURE__ */
|
|
2807
|
+
children: /* @__PURE__ */ F(i, {
|
|
2813
2808
|
component: `${t.componentName}.loader.track.bar`,
|
|
2814
2809
|
width: "2/5"
|
|
2815
2810
|
})
|
|
2816
2811
|
})
|
|
2817
2812
|
});
|
|
2818
2813
|
}
|
|
2819
|
-
|
|
2814
|
+
zt.displayName = "DataGridLoader";
|
|
2820
2815
|
//#endregion
|
|
2821
2816
|
//#region src/components/dataGrid/components/dataGridContent.tsx
|
|
2822
|
-
function
|
|
2823
|
-
let { grid: t } = e,
|
|
2817
|
+
function Bt(e) {
|
|
2818
|
+
let { grid: t } = e, n = N(null), [a, o] = P({
|
|
2824
2819
|
top: 0,
|
|
2825
2820
|
direction: "down"
|
|
2826
2821
|
}), s = N(null), c = O((e) => {
|
|
2827
2822
|
o((t) => e === t.top ? t : {
|
|
2828
2823
|
top: e,
|
|
2829
|
-
direction:
|
|
2824
|
+
direction: be.directionOf(t.top, e, t.direction)
|
|
2830
2825
|
});
|
|
2831
2826
|
}, []), l = O((e) => {
|
|
2832
2827
|
s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
|
|
2833
2828
|
c(e.target.scrollTop), s.current = null;
|
|
2834
2829
|
});
|
|
2835
|
-
}, [c]), { navigation: u, onKeyDown: d } =
|
|
2830
|
+
}, [c]), { navigation: u, onKeyDown: d } = Pe({
|
|
2836
2831
|
grid: t,
|
|
2837
|
-
scrollerRef:
|
|
2832
|
+
scrollerRef: n,
|
|
2838
2833
|
scroll: a,
|
|
2839
2834
|
onScrollTo: c
|
|
2840
2835
|
}), { source: f } = t, { queryVersion: p } = f;
|
|
2841
|
-
|
|
2842
|
-
f.enabled &&
|
|
2836
|
+
r(() => {
|
|
2837
|
+
f.enabled && n.current && (n.current.scrollTop = 0);
|
|
2843
2838
|
}, [f, p]), A(() => {
|
|
2844
2839
|
if (!f.enabled) return;
|
|
2845
|
-
let { startIndex: e, take:
|
|
2846
|
-
f.request(e, e +
|
|
2840
|
+
let { startIndex: e, take: r } = t.viewport.window(n.current?.scrollTop ?? 0, a.direction);
|
|
2841
|
+
f.request(e, e + r);
|
|
2847
2842
|
}, [
|
|
2848
2843
|
t,
|
|
2849
2844
|
f,
|
|
@@ -2859,17 +2854,17 @@ function Rt(e) {
|
|
|
2859
2854
|
if (h) return window.addEventListener("pointerup", m.endDrag), window.addEventListener("pointercancel", m.endDrag), () => {
|
|
2860
2855
|
window.removeEventListener("pointerup", m.endDrag), window.removeEventListener("pointercancel", m.endDrag);
|
|
2861
2856
|
};
|
|
2862
|
-
}, [h, m]),
|
|
2863
|
-
let e =
|
|
2857
|
+
}, [h, m]), r(() => {
|
|
2858
|
+
let e = n.current;
|
|
2864
2859
|
if (!e) return;
|
|
2865
|
-
let
|
|
2860
|
+
let r = new ResizeObserver(() => {
|
|
2866
2861
|
t.setContainerWidth(e.clientWidth), t.paintSizes();
|
|
2867
2862
|
});
|
|
2868
|
-
return
|
|
2869
|
-
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */
|
|
2863
|
+
return r.observe(e), () => r.disconnect();
|
|
2864
|
+
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */ F(ve.Provider, {
|
|
2870
2865
|
value: u,
|
|
2871
|
-
children: /* @__PURE__ */
|
|
2872
|
-
ref:
|
|
2866
|
+
children: /* @__PURE__ */ I(i, {
|
|
2867
|
+
ref: n,
|
|
2873
2868
|
component: `${t.componentName}.content`,
|
|
2874
2869
|
overflowX: "auto",
|
|
2875
2870
|
style: { willChange: "scroll-position" },
|
|
@@ -2886,33 +2881,33 @@ function Rt(e) {
|
|
|
2886
2881
|
onPaste: m.onPaste
|
|
2887
2882
|
},
|
|
2888
2883
|
children: [
|
|
2889
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ F(Rt, {
|
|
2890
2885
|
grid: t,
|
|
2891
2886
|
version: t.headerVersion
|
|
2892
2887
|
}),
|
|
2893
|
-
(t.props.loading || f.isLoading) && /* @__PURE__ */
|
|
2894
|
-
/* @__PURE__ */
|
|
2888
|
+
(t.props.loading || f.isLoading) && /* @__PURE__ */ F(zt, { grid: t }),
|
|
2889
|
+
/* @__PURE__ */ F(pt, {
|
|
2895
2890
|
grid: t,
|
|
2896
2891
|
scroll: a
|
|
2897
2892
|
})
|
|
2898
2893
|
]
|
|
2899
2894
|
})
|
|
2900
|
-
}) : /* @__PURE__ */
|
|
2895
|
+
}) : /* @__PURE__ */ F(mt, { grid: t });
|
|
2901
2896
|
}
|
|
2902
|
-
|
|
2897
|
+
Bt.displayName = "DataGridContent";
|
|
2903
2898
|
//#endregion
|
|
2904
2899
|
//#region src/components/dataGrid/components/dataGridDataSourceError.tsx
|
|
2905
|
-
function
|
|
2900
|
+
function Vt(e) {
|
|
2906
2901
|
let { grid: t } = e, { error: n } = t.source;
|
|
2907
2902
|
if (n === void 0) return null;
|
|
2908
|
-
let
|
|
2909
|
-
return /* @__PURE__ */
|
|
2903
|
+
let r = n instanceof Error && n.message ? n.message : t.localeText.loadError;
|
|
2904
|
+
return /* @__PURE__ */ I(m, {
|
|
2910
2905
|
component: `${t.componentName}.error`,
|
|
2911
2906
|
props: { role: "alert" },
|
|
2912
|
-
children: [/* @__PURE__ */
|
|
2907
|
+
children: [/* @__PURE__ */ F(i, {
|
|
2913
2908
|
component: `${t.componentName}.error.message`,
|
|
2914
|
-
children:
|
|
2915
|
-
}), /* @__PURE__ */
|
|
2909
|
+
children: r
|
|
2910
|
+
}), /* @__PURE__ */ F(p, {
|
|
2916
2911
|
component: `${t.componentName}.error.retry`,
|
|
2917
2912
|
type: "button",
|
|
2918
2913
|
onClick: t.source.retry,
|
|
@@ -2920,31 +2915,31 @@ function zt(e) {
|
|
|
2920
2915
|
})]
|
|
2921
2916
|
});
|
|
2922
2917
|
}
|
|
2923
|
-
|
|
2918
|
+
Vt.displayName = "DataGridDataSourceError";
|
|
2924
2919
|
//#endregion
|
|
2925
2920
|
//#region src/components/dataGrid/components/dataGridColumnGroups.tsx
|
|
2926
|
-
function
|
|
2921
|
+
function Ht(e) {
|
|
2927
2922
|
let { grid: t } = e;
|
|
2928
|
-
return t.groupColumns.size === 0 ? null : /* @__PURE__ */
|
|
2923
|
+
return t.groupColumns.size === 0 ? null : /* @__PURE__ */ I(m, {
|
|
2929
2924
|
component: `${t.componentName}.topBar.columnGroups`,
|
|
2930
|
-
children: [/* @__PURE__ */
|
|
2925
|
+
children: [/* @__PURE__ */ F(C, {
|
|
2931
2926
|
component: `${t.componentName}.topBar.columnGroups.icon`,
|
|
2932
|
-
children: /* @__PURE__ */
|
|
2927
|
+
children: /* @__PURE__ */ F(Ot, {
|
|
2933
2928
|
width: "100%",
|
|
2934
2929
|
fill: "currentColor"
|
|
2935
2930
|
})
|
|
2936
|
-
}), t.groupedColumns.map((e) => /* @__PURE__ */
|
|
2931
|
+
}), t.groupedColumns.map((e) => /* @__PURE__ */ I(ee.Fragment, { children: [/* @__PURE__ */ F(Y, {
|
|
2937
2932
|
fill: "currentColor",
|
|
2938
2933
|
width: "14px",
|
|
2939
2934
|
height: "14px",
|
|
2940
2935
|
rotate: -90
|
|
2941
|
-
}), /* @__PURE__ */
|
|
2936
|
+
}), /* @__PURE__ */ I(m, {
|
|
2942
2937
|
component: `${t.componentName}.topBar.columnGroups.item`,
|
|
2943
|
-
children: [e.header ?? e.key, /* @__PURE__ */
|
|
2938
|
+
children: [e.header ?? e.key, /* @__PURE__ */ F(p, {
|
|
2944
2939
|
component: `${t.componentName}.topBar.columnGroups.item.icon`,
|
|
2945
2940
|
onClick: () => t.toggleGrouping(e.key),
|
|
2946
2941
|
props: { "aria-label": t.localeText.stopGrouping(String(e.header ?? e.key)) },
|
|
2947
|
-
children: /* @__PURE__ */
|
|
2942
|
+
children: /* @__PURE__ */ F(i, {
|
|
2948
2943
|
fontSize: 10,
|
|
2949
2944
|
color: "gray-400",
|
|
2950
2945
|
hover: { color: "gray-600" },
|
|
@@ -2954,26 +2949,26 @@ function Bt(e) {
|
|
|
2954
2949
|
})] }, e.key))]
|
|
2955
2950
|
});
|
|
2956
2951
|
}
|
|
2957
|
-
|
|
2952
|
+
Ht.displayName = "DataGridColumnGroups";
|
|
2958
2953
|
//#endregion
|
|
2959
2954
|
//#region src/icons/searchIcon.tsx
|
|
2960
|
-
function
|
|
2961
|
-
return /* @__PURE__ */
|
|
2955
|
+
function Ut(e) {
|
|
2956
|
+
return /* @__PURE__ */ F(f, {
|
|
2962
2957
|
viewBox: "0 0 488.4 488.4",
|
|
2963
2958
|
width: "1.5rem",
|
|
2964
2959
|
...e,
|
|
2965
|
-
children: /* @__PURE__ */
|
|
2960
|
+
children: /* @__PURE__ */ F(d, { 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" })
|
|
2966
2961
|
});
|
|
2967
2962
|
}
|
|
2968
2963
|
//#endregion
|
|
2969
2964
|
//#region src/components/dataGrid/components/dataGridColumnsPanel.tsx
|
|
2970
|
-
var
|
|
2971
|
-
function
|
|
2972
|
-
let { grid: t } = e, { columnVisibility: n, localeText:
|
|
2973
|
-
|
|
2965
|
+
var Wt = 6;
|
|
2966
|
+
function Gt(e) {
|
|
2967
|
+
let { grid: t } = e, { columnVisibility: n, localeText: r, componentName: a } = t, { visibleCount: o, total: s, hasHidden: c } = n, [l, u] = P(!1), [m, h] = P(""), g = O((e) => {
|
|
2968
|
+
u(e), e || h("");
|
|
2974
2969
|
}, []);
|
|
2975
|
-
return /* @__PURE__ */
|
|
2976
|
-
label:
|
|
2970
|
+
return /* @__PURE__ */ F(w, {
|
|
2971
|
+
label: r.columnsMenu,
|
|
2977
2972
|
side: "bottom",
|
|
2978
2973
|
align: "end",
|
|
2979
2974
|
open: l,
|
|
@@ -2981,25 +2976,25 @@ function Ut(e) {
|
|
|
2981
2976
|
autoFocus: !1,
|
|
2982
2977
|
p: 0,
|
|
2983
2978
|
overflow: "visible",
|
|
2984
|
-
trigger: (e) => /* @__PURE__ */
|
|
2979
|
+
trigger: (e) => /* @__PURE__ */ I(p, {
|
|
2985
2980
|
...e,
|
|
2986
2981
|
component: `${a}.topBar.columnVisibility`,
|
|
2987
2982
|
props: {
|
|
2988
2983
|
...e.props,
|
|
2989
|
-
"aria-label": c ?
|
|
2984
|
+
"aria-label": c ? r.columnsMenuLabel(o, s) : void 0
|
|
2990
2985
|
},
|
|
2991
2986
|
children: [
|
|
2992
|
-
/* @__PURE__ */
|
|
2987
|
+
/* @__PURE__ */ F(f, {
|
|
2993
2988
|
viewBox: "0 0 20 20",
|
|
2994
2989
|
width: 16,
|
|
2995
2990
|
height: 16,
|
|
2996
2991
|
fill: "none",
|
|
2997
2992
|
stroke: "currentColor",
|
|
2998
2993
|
strokeWidth: 1.6,
|
|
2999
|
-
children: /* @__PURE__ */
|
|
2994
|
+
children: /* @__PURE__ */ F(d, { 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" })
|
|
3000
2995
|
}),
|
|
3001
|
-
|
|
3002
|
-
c && /* @__PURE__ */
|
|
2996
|
+
r.columnsMenu,
|
|
2997
|
+
c && /* @__PURE__ */ I(i, {
|
|
3003
2998
|
component: `${a}.topBar.columnVisibility.badge`,
|
|
3004
2999
|
tag: "span",
|
|
3005
3000
|
variant: { empty: o === 0 },
|
|
@@ -3012,7 +3007,7 @@ function Ut(e) {
|
|
|
3012
3007
|
})
|
|
3013
3008
|
]
|
|
3014
3009
|
}),
|
|
3015
|
-
children: /* @__PURE__ */
|
|
3010
|
+
children: /* @__PURE__ */ F(Kt, {
|
|
3016
3011
|
grid: t,
|
|
3017
3012
|
open: l,
|
|
3018
3013
|
query: m,
|
|
@@ -3020,13 +3015,13 @@ function Ut(e) {
|
|
|
3020
3015
|
})
|
|
3021
3016
|
});
|
|
3022
3017
|
}
|
|
3023
|
-
|
|
3024
|
-
function
|
|
3025
|
-
let { columnVisibility: a, localeText: o, componentName: s } = e, c = `${s}.topBar.columnVisibility`, l = N(null), u = N(null), d = a.total >
|
|
3018
|
+
Gt.displayName = "DataGridColumnsPanel";
|
|
3019
|
+
function Kt({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
3020
|
+
let { columnVisibility: a, localeText: o, componentName: s } = e, c = `${s}.topBar.columnVisibility`, l = N(null), u = N(null), d = a.total > Wt, f = a.search(n), h = a.sections(f), g = f.every((e) => e.visible), _ = f.every((e) => !e.visible);
|
|
3026
3021
|
A(() => {
|
|
3027
3022
|
t && (u.current ?? l.current?.querySelector("input"))?.focus();
|
|
3028
3023
|
}, [t]);
|
|
3029
|
-
let
|
|
3024
|
+
let v = O((e) => {
|
|
3030
3025
|
if (![
|
|
3031
3026
|
"ArrowDown",
|
|
3032
3027
|
"ArrowUp",
|
|
@@ -3043,25 +3038,25 @@ function Wt({ grid: e, open: t, query: n, onQueryChange: i }) {
|
|
|
3043
3038
|
}[e.key];
|
|
3044
3039
|
e.preventDefault(), i?.focus();
|
|
3045
3040
|
}, []);
|
|
3046
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ I(m, {
|
|
3047
3042
|
ref: l,
|
|
3048
3043
|
component: `${c}.panel`,
|
|
3049
|
-
props: { onKeyDown:
|
|
3044
|
+
props: { onKeyDown: v },
|
|
3050
3045
|
children: [
|
|
3051
|
-
d && /* @__PURE__ */
|
|
3046
|
+
d && /* @__PURE__ */ I(m, {
|
|
3052
3047
|
component: `${c}.search`,
|
|
3053
|
-
children: [/* @__PURE__ */
|
|
3048
|
+
children: [/* @__PURE__ */ F(m, {
|
|
3054
3049
|
component: `${c}.searchIcon`,
|
|
3055
|
-
children: /* @__PURE__ */
|
|
3050
|
+
children: /* @__PURE__ */ F(Ut, {
|
|
3056
3051
|
fill: "currentColor",
|
|
3057
3052
|
width: "14px"
|
|
3058
3053
|
})
|
|
3059
|
-
}), /* @__PURE__ */
|
|
3054
|
+
}), /* @__PURE__ */ F(y, {
|
|
3060
3055
|
ref: u,
|
|
3061
3056
|
component: `${c}.searchInput`,
|
|
3062
3057
|
value: n,
|
|
3063
3058
|
placeholder: o.columnsMenuSearchPlaceholder,
|
|
3064
|
-
onChange: (e) =>
|
|
3059
|
+
onChange: (e) => r(e.target.value),
|
|
3065
3060
|
props: {
|
|
3066
3061
|
"aria-label": o.columnsMenuSearchPlaceholder,
|
|
3067
3062
|
autoComplete: "off",
|
|
@@ -3069,40 +3064,40 @@ function Wt({ grid: e, open: t, query: n, onQueryChange: i }) {
|
|
|
3069
3064
|
}
|
|
3070
3065
|
})]
|
|
3071
3066
|
}),
|
|
3072
|
-
/* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ I(m, {
|
|
3073
3068
|
component: `${c}.toolbar`,
|
|
3074
|
-
children: [/* @__PURE__ */
|
|
3069
|
+
children: [/* @__PURE__ */ F(i, {
|
|
3075
3070
|
component: `${c}.count`,
|
|
3076
3071
|
children: o.columnsMenuShown(a.visibleCount, a.total)
|
|
3077
|
-
}), /* @__PURE__ */
|
|
3072
|
+
}), /* @__PURE__ */ I(m, {
|
|
3078
3073
|
gap: 1,
|
|
3079
|
-
children: [/* @__PURE__ */
|
|
3074
|
+
children: [/* @__PURE__ */ F(p, {
|
|
3080
3075
|
component: `${c}.action`,
|
|
3081
3076
|
disabled: g,
|
|
3082
|
-
onClick: () => a.setAll(!0,
|
|
3077
|
+
onClick: () => a.setAll(!0, f),
|
|
3083
3078
|
children: o.columnsMenuShowAll
|
|
3084
|
-
}), /* @__PURE__ */
|
|
3079
|
+
}), /* @__PURE__ */ F(p, {
|
|
3085
3080
|
component: `${c}.action`,
|
|
3086
3081
|
disabled: _,
|
|
3087
|
-
onClick: () => a.setAll(!1,
|
|
3082
|
+
onClick: () => a.setAll(!1, f),
|
|
3088
3083
|
children: o.columnsMenuHideAll
|
|
3089
3084
|
})]
|
|
3090
3085
|
})]
|
|
3091
3086
|
}),
|
|
3092
|
-
/* @__PURE__ */
|
|
3087
|
+
/* @__PURE__ */ I(m, {
|
|
3093
3088
|
component: `${c}.list`,
|
|
3094
|
-
children: [h.map((e, t) => /* @__PURE__ */
|
|
3089
|
+
children: [h.map((e, t) => /* @__PURE__ */ I(m, {
|
|
3095
3090
|
component: `${c}.section`,
|
|
3096
3091
|
variant: { divided: t > 0 && !e.group },
|
|
3097
3092
|
props: e.group ? {
|
|
3098
3093
|
role: "group",
|
|
3099
3094
|
"aria-label": e.group
|
|
3100
3095
|
} : void 0,
|
|
3101
|
-
children: [e.group && /* @__PURE__ */
|
|
3096
|
+
children: [e.group && /* @__PURE__ */ F(i, {
|
|
3102
3097
|
component: `${c}.group`,
|
|
3103
3098
|
props: { "aria-hidden": !0 },
|
|
3104
3099
|
children: e.group
|
|
3105
|
-
}), e.entries.map((e) => /* @__PURE__ */
|
|
3100
|
+
}), e.entries.map((e) => /* @__PURE__ */ F(T, {
|
|
3106
3101
|
checked: e.visible,
|
|
3107
3102
|
onChange: () => e.column.toggleVisibility(),
|
|
3108
3103
|
label: e.label,
|
|
@@ -3111,7 +3106,7 @@ function Wt({ grid: e, open: t, query: n, onQueryChange: i }) {
|
|
|
3111
3106
|
display: "flex"
|
|
3112
3107
|
}
|
|
3113
3108
|
}, e.id))]
|
|
3114
|
-
}, `${e.group ?? ""}-${t}`)),
|
|
3109
|
+
}, `${e.group ?? ""}-${t}`)), f.length === 0 && /* @__PURE__ */ F(i, {
|
|
3115
3110
|
component: `${c}.empty`,
|
|
3116
3111
|
props: { role: "status" },
|
|
3117
3112
|
children: o.columnsMenuNoMatch(n.trim())
|
|
@@ -3122,18 +3117,18 @@ function Wt({ grid: e, open: t, query: n, onQueryChange: i }) {
|
|
|
3122
3117
|
}
|
|
3123
3118
|
//#endregion
|
|
3124
3119
|
//#region src/components/dataGrid/components/dataGridExport.tsx
|
|
3125
|
-
function
|
|
3120
|
+
function qt(e) {
|
|
3126
3121
|
let { grid: t } = e, n = t.exportConfig, r = O(() => void t.exportCsv(n).catch(() => void 0), [t, n]), i = O(() => void t.exportXlsx(n).catch(() => void 0), [t, n]);
|
|
3127
|
-
return n ? /* @__PURE__ */
|
|
3122
|
+
return n ? /* @__PURE__ */ I(m, {
|
|
3128
3123
|
component: `${t.componentName}.topBar.export`,
|
|
3129
3124
|
ai: "center",
|
|
3130
3125
|
gap: 2,
|
|
3131
|
-
children: [n.csv !== !1 && /* @__PURE__ */
|
|
3126
|
+
children: [n.csv !== !1 && /* @__PURE__ */ F(Jt, {
|
|
3132
3127
|
componentName: t.componentName,
|
|
3133
3128
|
onClick: r,
|
|
3134
3129
|
label: t.localeText.exportCsvLabel,
|
|
3135
3130
|
children: t.localeText.exportCsv
|
|
3136
|
-
}), n.xlsx !== !1 && /* @__PURE__ */
|
|
3131
|
+
}), n.xlsx !== !1 && /* @__PURE__ */ F(Jt, {
|
|
3137
3132
|
componentName: t.componentName,
|
|
3138
3133
|
onClick: i,
|
|
3139
3134
|
label: t.localeText.exportExcelLabel,
|
|
@@ -3141,25 +3136,25 @@ function Gt(e) {
|
|
|
3141
3136
|
})]
|
|
3142
3137
|
}) : null;
|
|
3143
3138
|
}
|
|
3144
|
-
|
|
3145
|
-
function
|
|
3139
|
+
qt.displayName = "DataGridExport";
|
|
3140
|
+
function Jt(e) {
|
|
3146
3141
|
let { componentName: t, onClick: n, label: r, children: i } = e;
|
|
3147
|
-
return /* @__PURE__ */
|
|
3142
|
+
return /* @__PURE__ */ I(p, {
|
|
3148
3143
|
component: `${t}.topBar.export.button`,
|
|
3149
3144
|
onClick: n,
|
|
3150
3145
|
props: { "aria-label": r },
|
|
3151
|
-
children: [/* @__PURE__ */
|
|
3146
|
+
children: [/* @__PURE__ */ I(f, {
|
|
3152
3147
|
viewBox: "0 0 20 20",
|
|
3153
3148
|
width: 16,
|
|
3154
3149
|
height: 16,
|
|
3155
3150
|
fill: "none",
|
|
3156
3151
|
stroke: "currentColor",
|
|
3157
3152
|
strokeWidth: 1.6,
|
|
3158
|
-
children: [/* @__PURE__ */
|
|
3153
|
+
children: [/* @__PURE__ */ F(d, {
|
|
3159
3154
|
d: "M10 3v9m0 0 3.5-3.5M10 12 6.5 8.5",
|
|
3160
3155
|
strokeLinecap: "round",
|
|
3161
3156
|
strokeLinejoin: "round"
|
|
3162
|
-
}), /* @__PURE__ */
|
|
3157
|
+
}), /* @__PURE__ */ F(d, {
|
|
3163
3158
|
d: "M3.5 13.5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2",
|
|
3164
3159
|
strokeLinecap: "round"
|
|
3165
3160
|
})]
|
|
@@ -3168,38 +3163,38 @@ function Kt(e) {
|
|
|
3168
3163
|
}
|
|
3169
3164
|
//#endregion
|
|
3170
3165
|
//#region src/components/dataGrid/components/dataGridGlobalFilter.tsx
|
|
3171
|
-
function
|
|
3172
|
-
let { grid: t } = e, [n,
|
|
3166
|
+
function Yt(e) {
|
|
3167
|
+
let { grid: t } = e, [n, r] = P(t.globalFilterValue), { debounce: a, cancel: o } = vt(t.globalFilterValue, (e) => e === n, r), s = O((e) => {
|
|
3173
3168
|
let n = e.target.value;
|
|
3174
|
-
|
|
3169
|
+
r(n), a("value", () => t.filter.setGlobalFilter(n));
|
|
3175
3170
|
}, [t, a]), c = O(() => {
|
|
3176
|
-
o(),
|
|
3171
|
+
o(), r(""), t.filter.setGlobalFilter("");
|
|
3177
3172
|
}, [t, o]), { filtered: l, total: u } = t.filter.filterStats, d = !t.props.def.bottomBar && t.filter.hasActiveFilters && l !== u;
|
|
3178
|
-
return /* @__PURE__ */
|
|
3173
|
+
return /* @__PURE__ */ I(m, {
|
|
3179
3174
|
component: `${t.componentName}.topBar.globalFilter`,
|
|
3180
|
-
children: [d && /* @__PURE__ */
|
|
3175
|
+
children: [d && /* @__PURE__ */ I(i, {
|
|
3181
3176
|
component: `${t.componentName}.topBar.globalFilter.stats`,
|
|
3182
3177
|
children: [
|
|
3183
3178
|
l,
|
|
3184
3179
|
"/",
|
|
3185
3180
|
u
|
|
3186
3181
|
]
|
|
3187
|
-
}), /* @__PURE__ */
|
|
3182
|
+
}), /* @__PURE__ */ I(m, {
|
|
3188
3183
|
position: "relative",
|
|
3189
3184
|
ai: "center",
|
|
3190
3185
|
children: [
|
|
3191
|
-
/* @__PURE__ */
|
|
3186
|
+
/* @__PURE__ */ F(m, {
|
|
3192
3187
|
position: "absolute",
|
|
3193
3188
|
insetStart: 3,
|
|
3194
3189
|
pointerEvents: "none",
|
|
3195
3190
|
color: "gray-400",
|
|
3196
3191
|
theme: { dark: { color: "gray-500" } },
|
|
3197
|
-
children: /* @__PURE__ */
|
|
3192
|
+
children: /* @__PURE__ */ F(Ut, {
|
|
3198
3193
|
fill: "currentColor",
|
|
3199
3194
|
width: "14px"
|
|
3200
3195
|
})
|
|
3201
3196
|
}),
|
|
3202
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ F(y, {
|
|
3203
3198
|
placeholder: t.localeText.searchPlaceholder,
|
|
3204
3199
|
variant: "compact",
|
|
3205
3200
|
value: n,
|
|
@@ -3207,7 +3202,7 @@ function qt(e) {
|
|
|
3207
3202
|
ps: 8,
|
|
3208
3203
|
pe: n ? 8 : 3
|
|
3209
3204
|
}),
|
|
3210
|
-
n && /* @__PURE__ */
|
|
3205
|
+
n && /* @__PURE__ */ F(i, {
|
|
3211
3206
|
position: "absolute",
|
|
3212
3207
|
insetEnd: 2,
|
|
3213
3208
|
cursor: "pointer",
|
|
@@ -3219,7 +3214,7 @@ function qt(e) {
|
|
|
3219
3214
|
hover: { color: "gray-300" }
|
|
3220
3215
|
} },
|
|
3221
3216
|
props: { onClick: c },
|
|
3222
|
-
children: /* @__PURE__ */
|
|
3217
|
+
children: /* @__PURE__ */ F(i, {
|
|
3223
3218
|
fontSize: 12,
|
|
3224
3219
|
fontWeight: 600,
|
|
3225
3220
|
children: "✕"
|
|
@@ -3231,52 +3226,52 @@ function qt(e) {
|
|
|
3231
3226
|
}
|
|
3232
3227
|
//#endregion
|
|
3233
3228
|
//#region src/components/dataGrid/components/dataGridTopBar.tsx
|
|
3234
|
-
function
|
|
3235
|
-
let { grid: t } = e, { title: n, topBarContent:
|
|
3236
|
-
return /* @__PURE__ */
|
|
3229
|
+
function Xt(e) {
|
|
3230
|
+
let { grid: t } = e, { title: n, topBarContent: r, globalFilter: a } = t.props.def;
|
|
3231
|
+
return /* @__PURE__ */ I(m, {
|
|
3237
3232
|
component: `${t.componentName}.topBar`,
|
|
3238
3233
|
position: "relative",
|
|
3239
3234
|
d: "column",
|
|
3240
3235
|
gap: 3,
|
|
3241
|
-
children: [/* @__PURE__ */
|
|
3236
|
+
children: [/* @__PURE__ */ I(m, {
|
|
3242
3237
|
ai: "center",
|
|
3243
3238
|
jc: "space-between",
|
|
3244
3239
|
gap: 4,
|
|
3245
3240
|
flexWrap: "wrap",
|
|
3246
3241
|
width: "fit",
|
|
3247
|
-
children: [/* @__PURE__ */
|
|
3242
|
+
children: [/* @__PURE__ */ I(m, {
|
|
3248
3243
|
ai: "center",
|
|
3249
3244
|
gap: 3,
|
|
3250
3245
|
flexWrap: "wrap",
|
|
3251
3246
|
minWidth: 0,
|
|
3252
|
-
children: [n && /* @__PURE__ */
|
|
3247
|
+
children: [n && /* @__PURE__ */ F(i, {
|
|
3253
3248
|
id: t.titleId,
|
|
3254
3249
|
fontWeight: 600,
|
|
3255
3250
|
fontSize: 16,
|
|
3256
3251
|
color: "gray-800",
|
|
3257
3252
|
theme: { dark: { color: "gray-100" } },
|
|
3258
3253
|
children: n
|
|
3259
|
-
}), /* @__PURE__ */
|
|
3260
|
-
}), /* @__PURE__ */
|
|
3254
|
+
}), /* @__PURE__ */ F(Ht, { grid: t })]
|
|
3255
|
+
}), /* @__PURE__ */ I(m, {
|
|
3261
3256
|
ai: "center",
|
|
3262
3257
|
gap: 3,
|
|
3263
3258
|
flexWrap: "wrap",
|
|
3264
3259
|
children: [
|
|
3265
|
-
a && /* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3260
|
+
a && /* @__PURE__ */ F(Yt, { grid: t }),
|
|
3261
|
+
/* @__PURE__ */ F(Gt, { grid: t }),
|
|
3262
|
+
/* @__PURE__ */ F(qt, { grid: t })
|
|
3268
3263
|
]
|
|
3269
3264
|
})]
|
|
3270
|
-
}),
|
|
3265
|
+
}), r && /* @__PURE__ */ F(i, {
|
|
3271
3266
|
width: "fit",
|
|
3272
|
-
children:
|
|
3267
|
+
children: r
|
|
3273
3268
|
})]
|
|
3274
3269
|
});
|
|
3275
3270
|
}
|
|
3276
|
-
|
|
3271
|
+
Xt.displayName = "DataGridTopBar";
|
|
3277
3272
|
//#endregion
|
|
3278
3273
|
//#region src/utils/string/fuzzySearch.ts
|
|
3279
|
-
function
|
|
3274
|
+
function Zt(e, t) {
|
|
3280
3275
|
if (!e) return {
|
|
3281
3276
|
score: 1,
|
|
3282
3277
|
matches: []
|
|
@@ -3289,16 +3284,16 @@ function Yt(e, t) {
|
|
|
3289
3284
|
matches: o
|
|
3290
3285
|
});
|
|
3291
3286
|
}
|
|
3292
|
-
function
|
|
3293
|
-
return
|
|
3287
|
+
function Qt(e, t) {
|
|
3288
|
+
return Zt(e, t) !== null;
|
|
3294
3289
|
}
|
|
3295
3290
|
//#endregion
|
|
3296
3291
|
//#region src/components/dataGrid/components/dataGridCellRowDetail.tsx
|
|
3297
|
-
function
|
|
3292
|
+
function $t(e) {
|
|
3298
3293
|
let { cell: t } = e, n = t.isExpanded, r = O((e) => {
|
|
3299
3294
|
e.stopPropagation(), t.toggleDetail();
|
|
3300
3295
|
}, [t]);
|
|
3301
|
-
return /* @__PURE__ */
|
|
3296
|
+
return /* @__PURE__ */ F(p, {
|
|
3302
3297
|
component: `${t.grid.componentName}.body.cell.rowDetail`,
|
|
3303
3298
|
variant: { isExpanded: n },
|
|
3304
3299
|
type: "button",
|
|
@@ -3314,7 +3309,7 @@ function Zt(e) {
|
|
|
3314
3309
|
"aria-label": (n ? t.grid.localeText.collapseRowDetail : t.grid.localeText.expandRowDetail)(t.row.rowIndex + 1),
|
|
3315
3310
|
"aria-expanded": n
|
|
3316
3311
|
},
|
|
3317
|
-
children: /* @__PURE__ */
|
|
3312
|
+
children: /* @__PURE__ */ F(Y, {
|
|
3318
3313
|
fill: "currentColor",
|
|
3319
3314
|
width: "14px",
|
|
3320
3315
|
height: "14px",
|
|
@@ -3322,14 +3317,14 @@ function Zt(e) {
|
|
|
3322
3317
|
})
|
|
3323
3318
|
});
|
|
3324
3319
|
}
|
|
3325
|
-
|
|
3320
|
+
$t.displayName = "DataGridCellRowDetail";
|
|
3326
3321
|
//#endregion
|
|
3327
3322
|
//#region src/components/dataGrid/components/dataGridCellRowSelection.tsx
|
|
3328
|
-
function
|
|
3323
|
+
function en(e) {
|
|
3329
3324
|
let { cell: t } = e, n = O(() => {
|
|
3330
3325
|
t.toggleSelection();
|
|
3331
3326
|
}, [t]);
|
|
3332
|
-
return /* @__PURE__ */
|
|
3327
|
+
return /* @__PURE__ */ F(h, {
|
|
3333
3328
|
variant: "datagrid",
|
|
3334
3329
|
checked: t.selected,
|
|
3335
3330
|
indeterminate: t.indeterminate,
|
|
@@ -3340,15 +3335,15 @@ function Qt(e) {
|
|
|
3340
3335
|
}
|
|
3341
3336
|
});
|
|
3342
3337
|
}
|
|
3343
|
-
|
|
3338
|
+
en.displayName = "DataGridCellRowSelection";
|
|
3344
3339
|
//#endregion
|
|
3345
3340
|
//#region src/components/dataGrid/contracts/dataGridContract.ts
|
|
3346
|
-
function
|
|
3341
|
+
function tn(e) {
|
|
3347
3342
|
if (e) return e === "LEFT" ? "START" : e === "RIGHT" ? "END" : e;
|
|
3348
3343
|
}
|
|
3349
3344
|
//#endregion
|
|
3350
3345
|
//#region src/components/dataGrid/models/headerCellModel.ts
|
|
3351
|
-
var
|
|
3346
|
+
var nn = 1e3, rn = class {
|
|
3352
3347
|
column;
|
|
3353
3348
|
constructor(e) {
|
|
3354
3349
|
this.column = e;
|
|
@@ -3425,7 +3420,7 @@ var en = 1e3, tn = class {
|
|
|
3425
3420
|
return Math.max(1, this.column.leafs.length) * this.grid.MIN_COLUMN_WIDTH_PX;
|
|
3426
3421
|
}
|
|
3427
3422
|
get maxWidth() {
|
|
3428
|
-
return Math.max(this.grid.containerWidth ||
|
|
3423
|
+
return Math.max(this.grid.containerWidth || nn, this.width, this.minWidth);
|
|
3429
3424
|
}
|
|
3430
3425
|
get paddingStart() {
|
|
3431
3426
|
if (!this.column.isRowSelection) return this.column.isEndAligned ? 10 : 3;
|
|
@@ -3510,15 +3505,15 @@ var en = 1e3, tn = class {
|
|
|
3510
3505
|
pin: t.pin
|
|
3511
3506
|
} : r, n, this)) ?? [], this.isLeaf) {
|
|
3512
3507
|
let e = this.grid.columnWidths.get(this.key);
|
|
3513
|
-
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin =
|
|
3508
|
+
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin = tn(t.pin);
|
|
3514
3509
|
}
|
|
3515
3510
|
}
|
|
3516
3511
|
columns = [];
|
|
3517
3512
|
get kind() {
|
|
3518
3513
|
switch (this.key) {
|
|
3519
|
-
case
|
|
3520
|
-
case
|
|
3521
|
-
case
|
|
3514
|
+
case Ie: return "rowNumber";
|
|
3515
|
+
case Le: return "rowSelection";
|
|
3516
|
+
case Re: return "rowDetail";
|
|
3522
3517
|
case G: return "grouping";
|
|
3523
3518
|
default: return "data";
|
|
3524
3519
|
}
|
|
@@ -3574,7 +3569,7 @@ var en = 1e3, tn = class {
|
|
|
3574
3569
|
insetInlineEnd: t ? `var(${this.inlineEndVarName})` : void 0
|
|
3575
3570
|
};
|
|
3576
3571
|
}, () => [this.pinFlags]);
|
|
3577
|
-
_headerCell = q(() => new
|
|
3572
|
+
_headerCell = q(() => new rn(this));
|
|
3578
3573
|
get headerCell() {
|
|
3579
3574
|
return this._headerCell.value;
|
|
3580
3575
|
}
|
|
@@ -3822,7 +3817,7 @@ var en = 1e3, tn = class {
|
|
|
3822
3817
|
this.moveResizer((e - t) * this.resizeSign);
|
|
3823
3818
|
};
|
|
3824
3819
|
pinColumn = (e) => {
|
|
3825
|
-
this.isLeaf ? this._pin =
|
|
3820
|
+
this.isLeaf ? this._pin = tn(e) : this.columns.forEach((t) => t.pinColumn(e)), this.grid.pinColumn(this.uniqueKey, e);
|
|
3826
3821
|
};
|
|
3827
3822
|
toggleGrouping = () => {
|
|
3828
3823
|
this.grid.toggleGrouping(this.key);
|
|
@@ -3837,7 +3832,7 @@ var en = 1e3, tn = class {
|
|
|
3837
3832
|
toggleVisibility = () => {
|
|
3838
3833
|
this.grid.toggleColumnVisibility(this.key);
|
|
3839
3834
|
};
|
|
3840
|
-
},
|
|
3835
|
+
}, an = class {
|
|
3841
3836
|
grid;
|
|
3842
3837
|
constructor(e) {
|
|
3843
3838
|
this.grid = e;
|
|
@@ -3897,19 +3892,19 @@ var en = 1e3, tn = class {
|
|
|
3897
3892
|
};
|
|
3898
3893
|
//#endregion
|
|
3899
3894
|
//#region src/utils/array/lazyList.ts
|
|
3900
|
-
function
|
|
3895
|
+
function on(e, t) {
|
|
3901
3896
|
return new Proxy([], {
|
|
3902
3897
|
get(n, r, i) {
|
|
3903
3898
|
if (r === "length") return e;
|
|
3904
|
-
let a =
|
|
3899
|
+
let a = sn(r, e);
|
|
3905
3900
|
return a === void 0 ? Reflect.get(n, r, i) : t(a);
|
|
3906
3901
|
},
|
|
3907
3902
|
has(t, n) {
|
|
3908
|
-
return
|
|
3903
|
+
return sn(n, e) !== void 0 || Reflect.has(t, n);
|
|
3909
3904
|
},
|
|
3910
3905
|
getOwnPropertyDescriptor(n, r) {
|
|
3911
|
-
return
|
|
3912
|
-
value: t(
|
|
3906
|
+
return sn(r, e) === void 0 ? Reflect.getOwnPropertyDescriptor(n, r) : {
|
|
3907
|
+
value: t(sn(r, e)),
|
|
3913
3908
|
writable: !0,
|
|
3914
3909
|
enumerable: !0,
|
|
3915
3910
|
configurable: !0
|
|
@@ -3917,7 +3912,7 @@ function rn(e, t) {
|
|
|
3917
3912
|
}
|
|
3918
3913
|
});
|
|
3919
3914
|
}
|
|
3920
|
-
function
|
|
3915
|
+
function sn(e, t) {
|
|
3921
3916
|
if (typeof e != "string") return;
|
|
3922
3917
|
let n = Number(e);
|
|
3923
3918
|
return Number.isInteger(n) && n >= 0 && n < t ? n : void 0;
|
|
@@ -4048,7 +4043,7 @@ var $ = class e {
|
|
|
4048
4043
|
}), this.source.changed());
|
|
4049
4044
|
});
|
|
4050
4045
|
}
|
|
4051
|
-
},
|
|
4046
|
+
}, cn = class extends Je {
|
|
4052
4047
|
level;
|
|
4053
4048
|
constructor(e, t, n, r) {
|
|
4054
4049
|
super(e, n, [], r, ""), this.level = t;
|
|
@@ -4070,7 +4065,7 @@ var $ = class e {
|
|
|
4070
4065
|
return [...this.level.groupKeys, this.groupValue];
|
|
4071
4066
|
}
|
|
4072
4067
|
get key() {
|
|
4073
|
-
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` :
|
|
4068
|
+
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` : ln(this.groupKeys);
|
|
4074
4069
|
}
|
|
4075
4070
|
get depth() {
|
|
4076
4071
|
return this.level.depth;
|
|
@@ -4106,21 +4101,21 @@ var $ = class e {
|
|
|
4106
4101
|
this.placeholder || this.grid.toggleGroupRow(this.key);
|
|
4107
4102
|
}
|
|
4108
4103
|
};
|
|
4109
|
-
function
|
|
4104
|
+
function ln(e) {
|
|
4110
4105
|
return `rb-group:${$.keyOf(e)}`;
|
|
4111
4106
|
}
|
|
4112
4107
|
//#endregion
|
|
4113
4108
|
//#region src/components/dataGrid/models/sourceRowModel.ts
|
|
4114
|
-
var
|
|
4109
|
+
var un = {}, dn = class extends H {
|
|
4115
4110
|
sourceLevel;
|
|
4116
4111
|
constructor(e, t, n) {
|
|
4117
|
-
super(e,
|
|
4112
|
+
super(e, un, n), this.sourceLevel = t;
|
|
4118
4113
|
}
|
|
4119
4114
|
get row() {
|
|
4120
4115
|
return this.sourceLevel.rowAt(this.rowIndex);
|
|
4121
4116
|
}
|
|
4122
4117
|
get data() {
|
|
4123
|
-
return this.row ??
|
|
4118
|
+
return this.row ?? un;
|
|
4124
4119
|
}
|
|
4125
4120
|
get placeholder() {
|
|
4126
4121
|
return this.row === void 0;
|
|
@@ -4138,7 +4133,7 @@ var cn = {}, ln = class extends U {
|
|
|
4138
4133
|
get selected() {
|
|
4139
4134
|
return !this.placeholder && super.selected;
|
|
4140
4135
|
}
|
|
4141
|
-
},
|
|
4136
|
+
}, fn = class extends dn {
|
|
4142
4137
|
isTreeRow = !0;
|
|
4143
4138
|
get level() {
|
|
4144
4139
|
return this.sourceLevel.depth;
|
|
@@ -4158,7 +4153,7 @@ var cn = {}, ln = class extends U {
|
|
|
4158
4153
|
toggleTree = () => {
|
|
4159
4154
|
this.hasChildren && this.grid.tree.toggle(this.key, this.level);
|
|
4160
4155
|
};
|
|
4161
|
-
},
|
|
4156
|
+
}, pn = 100, mn = 40, hn = class {
|
|
4162
4157
|
grid;
|
|
4163
4158
|
constructor(e) {
|
|
4164
4159
|
this.grid = e;
|
|
@@ -4184,11 +4179,11 @@ var cn = {}, ln = class extends U {
|
|
|
4184
4179
|
}
|
|
4185
4180
|
get blockSize() {
|
|
4186
4181
|
let e = this.config?.blockSize;
|
|
4187
|
-
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize :
|
|
4182
|
+
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize : pn;
|
|
4188
4183
|
}
|
|
4189
4184
|
get maxBlocks() {
|
|
4190
4185
|
let e = this.config?.maxBlocks;
|
|
4191
|
-
return e && e > 0 ? Math.floor(e) :
|
|
4186
|
+
return e && e > 0 ? Math.floor(e) : mn;
|
|
4192
4187
|
}
|
|
4193
4188
|
get queryVersion() {
|
|
4194
4189
|
return this._query;
|
|
@@ -4243,7 +4238,7 @@ var cn = {}, ln = class extends U {
|
|
|
4243
4238
|
return e.loadedBlocks().forEach(({ index: a, rows: o }) => {
|
|
4244
4239
|
o.forEach((o, s) => {
|
|
4245
4240
|
let c = [...e.path, o[r]];
|
|
4246
|
-
if (!t.has(
|
|
4241
|
+
if (!t.has(ln(c))) return;
|
|
4247
4242
|
let l = a * n + s;
|
|
4248
4243
|
i.push({
|
|
4249
4244
|
rowIndex: l,
|
|
@@ -4297,20 +4292,20 @@ var cn = {}, ln = class extends U {
|
|
|
4297
4292
|
listLength = -1;
|
|
4298
4293
|
rowList() {
|
|
4299
4294
|
let { start: e } = this.visibleRange();
|
|
4300
|
-
return this.listLength = this.visibleLength(),
|
|
4295
|
+
return this.listLength = this.visibleLength(), on(this.listLength, (t) => this.rowModelAt(e + t));
|
|
4301
4296
|
}
|
|
4302
4297
|
flatRowList(e) {
|
|
4303
4298
|
let t = this.detailPositions();
|
|
4304
|
-
return t.length === 0 ? e :
|
|
4305
|
-
let r =
|
|
4306
|
-
return t[r] === n ? new
|
|
4299
|
+
return t.length === 0 ? e : on(e.length + t.length, (n) => {
|
|
4300
|
+
let r = _n(t, n);
|
|
4301
|
+
return t[r] === n ? new V(this.grid, e[n - r - 1]) : e[n - r];
|
|
4307
4302
|
});
|
|
4308
4303
|
}
|
|
4309
4304
|
rowOffsets(e) {
|
|
4310
4305
|
let { rowHeight: t } = this.grid, n = this.detailPositions(), r = [0];
|
|
4311
4306
|
return n.forEach((t, n) => r.push(r[n] + e[t].heightForOffset)), {
|
|
4312
|
-
offsets:
|
|
4313
|
-
let i =
|
|
4307
|
+
offsets: on(e.length, (e) => {
|
|
4308
|
+
let i = _n(n, e);
|
|
4314
4309
|
return (e - i) * t + r[i];
|
|
4315
4310
|
}),
|
|
4316
4311
|
totalHeight: (e.length - n.length) * t + r[n.length]
|
|
@@ -4339,7 +4334,7 @@ var cn = {}, ln = class extends U {
|
|
|
4339
4334
|
let i = this.levels.get(r);
|
|
4340
4335
|
!i || i.isGroupLevel || i.loadedBlocks().forEach(({ index: r, rows: i }) => {
|
|
4341
4336
|
i.forEach((i, a) => {
|
|
4342
|
-
let o =
|
|
4337
|
+
let o = gn(n, r * t + a);
|
|
4343
4338
|
o !== void 0 && e(o, i);
|
|
4344
4339
|
});
|
|
4345
4340
|
});
|
|
@@ -4347,11 +4342,11 @@ var cn = {}, ln = class extends U {
|
|
|
4347
4342
|
}
|
|
4348
4343
|
rowModelAt(e) {
|
|
4349
4344
|
let t = this.segmentAt(e);
|
|
4350
|
-
if (!t) return new
|
|
4345
|
+
if (!t) return new dn(this.grid, this.root, e);
|
|
4351
4346
|
let { level: n } = t, r = t.levelStart + (e - t.start), i = this.models.get(n.key);
|
|
4352
4347
|
i || this.models.set(n.key, i = /* @__PURE__ */ new Map());
|
|
4353
4348
|
let a = i.get(r);
|
|
4354
|
-
return a || (a = n.isGroupLevel ? new
|
|
4349
|
+
return a || (a = n.isGroupLevel ? new cn(this.grid, n, this.groupColumnAt(n.depth), r) : this.isTree ? new fn(this.grid, n, r) : new dn(this.grid, n, r), i.set(r, a)), a;
|
|
4355
4350
|
}
|
|
4356
4351
|
groupColumnAt(e) {
|
|
4357
4352
|
return W.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === this.groupBy[e]);
|
|
@@ -4440,10 +4435,10 @@ var cn = {}, ln = class extends U {
|
|
|
4440
4435
|
this._segments = void 0, this._byLevel = void 0, this.listLength !== this.visibleLength() && this.grid.rows.clear(), this.grid.flatRows.clear(), this.grid.notify();
|
|
4441
4436
|
}
|
|
4442
4437
|
};
|
|
4443
|
-
function
|
|
4438
|
+
function gn(e, t) {
|
|
4444
4439
|
for (let n of e) if (t >= n.levelStart && t < n.levelStart + n.length) return n.start + (t - n.levelStart);
|
|
4445
4440
|
}
|
|
4446
|
-
function
|
|
4441
|
+
function _n(e, t) {
|
|
4447
4442
|
let n = 0, r = e.length;
|
|
4448
4443
|
for (; n < r;) {
|
|
4449
4444
|
let i = n + r >>> 1;
|
|
@@ -4453,7 +4448,7 @@ function hn(e, t) {
|
|
|
4453
4448
|
}
|
|
4454
4449
|
//#endregion
|
|
4455
4450
|
//#region src/components/dataGrid/models/exportModel.ts
|
|
4456
|
-
var
|
|
4451
|
+
var vn = 7, yn = class {
|
|
4457
4452
|
grid;
|
|
4458
4453
|
constructor(e) {
|
|
4459
4454
|
this.grid = e;
|
|
@@ -4467,7 +4462,7 @@ var gn = 7, _n = class {
|
|
|
4467
4462
|
}
|
|
4468
4463
|
width(e) {
|
|
4469
4464
|
let t = e.inlineWidth ?? this.grid.DEFAULT_COLUMN_WIDTH_PX;
|
|
4470
|
-
return Math.min(80, Math.max(6, Math.round(t /
|
|
4465
|
+
return Math.min(80, Math.max(6, Math.round(t / vn * 10) / 10));
|
|
4471
4466
|
}
|
|
4472
4467
|
value(e, t) {
|
|
4473
4468
|
let { exportValue: n } = e.def, r = n ? n(t) : t[e.key];
|
|
@@ -4475,7 +4470,7 @@ var gn = 7, _n = class {
|
|
|
4475
4470
|
}
|
|
4476
4471
|
aggregateOf(e, t) {
|
|
4477
4472
|
let n = e.aggregate;
|
|
4478
|
-
return n ?
|
|
4473
|
+
return n ? We(n, t.map((t) => this.value(e, t)), t) : null;
|
|
4479
4474
|
}
|
|
4480
4475
|
table(e = {}) {
|
|
4481
4476
|
let t = this.columns(e.columns), n = e.groups ?? !0, r = [], i = (e, a, o) => {
|
|
@@ -4490,7 +4485,7 @@ var gn = 7, _n = class {
|
|
|
4490
4485
|
}), i(s.rows, n ? a + 1 : a, o || n && e);
|
|
4491
4486
|
} else {
|
|
4492
4487
|
if (s.placeholder) continue;
|
|
4493
|
-
let e =
|
|
4488
|
+
let e = U(s) ? s.level : a;
|
|
4494
4489
|
r.push({
|
|
4495
4490
|
kind: "data",
|
|
4496
4491
|
level: e,
|
|
@@ -4539,7 +4534,7 @@ var gn = 7, _n = class {
|
|
|
4539
4534
|
let { title: t } = this.grid.props.def, n = typeof t == "string" && t.trim() ? t.trim() : this.grid.localeText.exportFileName;
|
|
4540
4535
|
return e.fileName?.trim() || n;
|
|
4541
4536
|
}
|
|
4542
|
-
},
|
|
4537
|
+
}, bn = class {
|
|
4543
4538
|
grid;
|
|
4544
4539
|
constructor(e) {
|
|
4545
4540
|
this.grid = e;
|
|
@@ -4561,7 +4556,231 @@ var gn = 7, _n = class {
|
|
|
4561
4556
|
}
|
|
4562
4557
|
setGlobalFilter = (e) => this.grid.setGlobalFilter(e);
|
|
4563
4558
|
clearAllFilters = () => this.grid.clearAllFilters();
|
|
4564
|
-
},
|
|
4559
|
+
}, xn = class {
|
|
4560
|
+
grid;
|
|
4561
|
+
constructor(e) {
|
|
4562
|
+
this.grid = e;
|
|
4563
|
+
}
|
|
4564
|
+
get config() {
|
|
4565
|
+
return this.grid.props.def.list ?? {};
|
|
4566
|
+
}
|
|
4567
|
+
get breakpoint() {
|
|
4568
|
+
return this.config.breakpoint ?? 576;
|
|
4569
|
+
}
|
|
4570
|
+
_width = 0;
|
|
4571
|
+
get width() {
|
|
4572
|
+
return this._width;
|
|
4573
|
+
}
|
|
4574
|
+
get active() {
|
|
4575
|
+
let e = this.grid.props.def.layout ?? "auto";
|
|
4576
|
+
return e === "auto" ? this._width > 0 && this._width < this.breakpoint : e === "list";
|
|
4577
|
+
}
|
|
4578
|
+
setWidth = (e) => {
|
|
4579
|
+
let t = this.active;
|
|
4580
|
+
this._width = e, this.active !== t && this.grid.notify();
|
|
4581
|
+
};
|
|
4582
|
+
layout = q(() => {
|
|
4583
|
+
let e = this.grid.groupColumns, t = this.grid.columns.value.visibleLeafs.filter((t) => t.isData && !e.has(t.key) && t.def.list !== "hidden"), n = (e) => e.def.list, r = (e) => n(e) === void 0, i = this.grid.tree.enabled ? this.grid.tree.columnKey : void 0, a = t.find((e) => n(e) === "title") ?? t.find((e) => e.key === i && r(e)) ?? t.find(r), o = t.find((e) => e !== a && n(e) === "end") ?? t.find((e) => e !== a && r(e) && e.isEndAligned), s = t.find((e) => n(e) === "kicker"), c = t.filter((e) => n(e) === "subtitle"), l = this.config.fields ?? 4, u = [], d = [];
|
|
4584
|
+
for (let e of t) {
|
|
4585
|
+
if (e === a || e === o || e === s || c.includes(e)) continue;
|
|
4586
|
+
let t = n(e);
|
|
4587
|
+
t === "field" || t === void 0 && u.length < l ? u.push(e) : d.push(e);
|
|
4588
|
+
}
|
|
4589
|
+
return {
|
|
4590
|
+
title: a,
|
|
4591
|
+
kicker: s,
|
|
4592
|
+
subtitle: c,
|
|
4593
|
+
end: o,
|
|
4594
|
+
fields: u,
|
|
4595
|
+
detail: d
|
|
4596
|
+
};
|
|
4597
|
+
}, () => [this.grid.columns]);
|
|
4598
|
+
get recordColumns() {
|
|
4599
|
+
let { title: e, kicker: t, subtitle: n, end: r, fields: i, detail: a } = this.layout.value, o = /* @__PURE__ */ new Set([
|
|
4600
|
+
e,
|
|
4601
|
+
t,
|
|
4602
|
+
r,
|
|
4603
|
+
...n,
|
|
4604
|
+
...i,
|
|
4605
|
+
...a
|
|
4606
|
+
]);
|
|
4607
|
+
return this.grid.columns.value.visibleLeafs.filter((e) => o.has(e));
|
|
4608
|
+
}
|
|
4609
|
+
get batch() {
|
|
4610
|
+
return this.config.batchSize ?? 20;
|
|
4611
|
+
}
|
|
4612
|
+
_limit;
|
|
4613
|
+
get query() {
|
|
4614
|
+
let { grid: e } = this;
|
|
4615
|
+
return JSON.stringify([
|
|
4616
|
+
e.globalFilterValue,
|
|
4617
|
+
e.columnFilters,
|
|
4618
|
+
e.sortColumn,
|
|
4619
|
+
e.sortDirection,
|
|
4620
|
+
[...e.groupColumns],
|
|
4621
|
+
e.source.enabled ? e.source.queryVersion : e.data.length
|
|
4622
|
+
]);
|
|
4623
|
+
}
|
|
4624
|
+
get count() {
|
|
4625
|
+
if (this.grid.isPaginated) return Infinity;
|
|
4626
|
+
let { query: e } = this;
|
|
4627
|
+
return this._limit?.query !== e && (this._limit = {
|
|
4628
|
+
query: e,
|
|
4629
|
+
count: this.batch
|
|
4630
|
+
}), this._limit.count;
|
|
4631
|
+
}
|
|
4632
|
+
_more = 0;
|
|
4633
|
+
get visibleItems() {
|
|
4634
|
+
let e = this.grid.flatRows.value, t = this.count, n = [], r = 0;
|
|
4635
|
+
for (; r < e.length && n.length < t; r++) {
|
|
4636
|
+
let t = e[r];
|
|
4637
|
+
t.kind !== "detail" && n.push({
|
|
4638
|
+
row: t,
|
|
4639
|
+
index: r
|
|
4640
|
+
});
|
|
4641
|
+
}
|
|
4642
|
+
for (; r < e.length && e[r].kind === "detail";) r++;
|
|
4643
|
+
return this._more = e.length - r, n;
|
|
4644
|
+
}
|
|
4645
|
+
get hasMore() {
|
|
4646
|
+
return !this.grid.isPaginated && this._more > 0;
|
|
4647
|
+
}
|
|
4648
|
+
get nextBatch() {
|
|
4649
|
+
return Math.min(this.batch, this._more);
|
|
4650
|
+
}
|
|
4651
|
+
showMore = () => {
|
|
4652
|
+
this._limit = {
|
|
4653
|
+
query: this.query,
|
|
4654
|
+
count: this.count + this.batch
|
|
4655
|
+
}, this.grid.notify();
|
|
4656
|
+
};
|
|
4657
|
+
_selecting = !1;
|
|
4658
|
+
get selecting() {
|
|
4659
|
+
return !!this.grid.props.def.rowSelection && this._selecting;
|
|
4660
|
+
}
|
|
4661
|
+
setSelecting = (e) => {
|
|
4662
|
+
this._selecting !== e && (this._selecting = e, this.grid.notify());
|
|
4663
|
+
};
|
|
4664
|
+
checkboxId(e) {
|
|
4665
|
+
return `${this.grid.identifier}-pick-${encodeURIComponent(String(e))}`;
|
|
4666
|
+
}
|
|
4667
|
+
_sheet = null;
|
|
4668
|
+
get sheet() {
|
|
4669
|
+
return this._sheet;
|
|
4670
|
+
}
|
|
4671
|
+
openSheet = (e) => {
|
|
4672
|
+
this._sheet !== e && (this._sheet = e, this.grid.notify());
|
|
4673
|
+
};
|
|
4674
|
+
get sortableColumns() {
|
|
4675
|
+
return this.grid.columns.value.visibleLeafs.filter((e) => e.isData && e.sortable);
|
|
4676
|
+
}
|
|
4677
|
+
get sortedColumn() {
|
|
4678
|
+
let e = this.grid.sortColumn;
|
|
4679
|
+
if (e !== void 0) return this.sortableColumns.find((t) => t.key === e);
|
|
4680
|
+
}
|
|
4681
|
+
get filterableColumns() {
|
|
4682
|
+
return this.grid.columns.value.visibleLeafs.filter((e) => e.isData && !!e.filterConfig);
|
|
4683
|
+
}
|
|
4684
|
+
get activeFilters() {
|
|
4685
|
+
let e = this.grid.columnFilters;
|
|
4686
|
+
return this.grid.columns.value.leafs.flatMap((t) => {
|
|
4687
|
+
let n = e[t.key];
|
|
4688
|
+
return n ? [{
|
|
4689
|
+
column: t,
|
|
4690
|
+
label: String(t.header ?? t.key),
|
|
4691
|
+
value: this.describe(t, n)
|
|
4692
|
+
}] : [];
|
|
4693
|
+
});
|
|
4694
|
+
}
|
|
4695
|
+
describe(e, t) {
|
|
4696
|
+
switch (t.type) {
|
|
4697
|
+
case "text": return `“${t.value}”`;
|
|
4698
|
+
case "number": return t.operator === "between" ? `${t.value}–${t.valueTo ?? ""}` : `${Cn[t.operator]} ${t.value}`;
|
|
4699
|
+
case "multiselect": {
|
|
4700
|
+
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(", ");
|
|
4701
|
+
return r.length > 2 ? `${i} +${r.length - 2}` : i;
|
|
4702
|
+
}
|
|
4703
|
+
}
|
|
4704
|
+
}
|
|
4705
|
+
_record = null;
|
|
4706
|
+
get record() {
|
|
4707
|
+
if (!this._record) return;
|
|
4708
|
+
let e = this.grid.flatRows.value, { index: t, key: n } = this._record;
|
|
4709
|
+
if (wn(e[t]) && e[t].key === n) return e[t];
|
|
4710
|
+
let r = -1;
|
|
4711
|
+
for (let t = 0; t < Math.min(e.length, Sn) && r === -1; t++) {
|
|
4712
|
+
let i = e[t];
|
|
4713
|
+
wn(i) && i.key === n && (r = t);
|
|
4714
|
+
}
|
|
4715
|
+
if (r !== -1) return this._record = {
|
|
4716
|
+
index: r,
|
|
4717
|
+
key: n
|
|
4718
|
+
}, e[r];
|
|
4719
|
+
}
|
|
4720
|
+
get recordViewEnabled() {
|
|
4721
|
+
return this.config.recordView ?? !0;
|
|
4722
|
+
}
|
|
4723
|
+
openRecord = (e, t) => {
|
|
4724
|
+
this._record = {
|
|
4725
|
+
index: t,
|
|
4726
|
+
key: e.key
|
|
4727
|
+
}, this.grid.notify();
|
|
4728
|
+
};
|
|
4729
|
+
closeRecord = () => {
|
|
4730
|
+
this._record && (this._record = null, this.grid.notify());
|
|
4731
|
+
};
|
|
4732
|
+
neighbour(e) {
|
|
4733
|
+
if (!this.record || !this._record) return -1;
|
|
4734
|
+
let t = this.grid.flatRows.value;
|
|
4735
|
+
for (let n = this._record.index + e; n >= 0 && n < t.length; n += e) {
|
|
4736
|
+
let e = t[n];
|
|
4737
|
+
if (wn(e) && !e.placeholder) return n;
|
|
4738
|
+
}
|
|
4739
|
+
return -1;
|
|
4740
|
+
}
|
|
4741
|
+
get hasPreviousRecord() {
|
|
4742
|
+
return this.neighbour(-1) !== -1;
|
|
4743
|
+
}
|
|
4744
|
+
get hasNextRecord() {
|
|
4745
|
+
return this.neighbour(1) !== -1;
|
|
4746
|
+
}
|
|
4747
|
+
stepRecord = (e) => {
|
|
4748
|
+
let t = this.neighbour(e);
|
|
4749
|
+
t !== -1 && (this._record = {
|
|
4750
|
+
index: t,
|
|
4751
|
+
key: this.grid.flatRows.value[t].key
|
|
4752
|
+
}, this._limit && t >= this._limit.count && (this._limit = {
|
|
4753
|
+
query: this.query,
|
|
4754
|
+
count: t + 1
|
|
4755
|
+
}), this.grid.notify());
|
|
4756
|
+
};
|
|
4757
|
+
get recordPosition() {
|
|
4758
|
+
if (!this.record || !this._record) return;
|
|
4759
|
+
if (this.grid.source.enabled) return {
|
|
4760
|
+
position: this._record.index + 1,
|
|
4761
|
+
total: this.grid.totalRowCount
|
|
4762
|
+
};
|
|
4763
|
+
let e = this.grid.flatRows.value, t = 0, n = 0;
|
|
4764
|
+
for (let r = 0; r < e.length; r++) wn(e[r]) && (n++, r <= this._record.index && t++);
|
|
4765
|
+
return {
|
|
4766
|
+
position: t,
|
|
4767
|
+
total: n
|
|
4768
|
+
};
|
|
4769
|
+
}
|
|
4770
|
+
}, Sn = 1e4, Cn = {
|
|
4771
|
+
eq: "=",
|
|
4772
|
+
ne: "≠",
|
|
4773
|
+
gt: ">",
|
|
4774
|
+
gte: "≥",
|
|
4775
|
+
lt: "<",
|
|
4776
|
+
lte: "≤"
|
|
4777
|
+
};
|
|
4778
|
+
function wn(e) {
|
|
4779
|
+
return !!e && e.kind === "row";
|
|
4780
|
+
}
|
|
4781
|
+
//#endregion
|
|
4782
|
+
//#region src/components/dataGrid/models/localeText.ts
|
|
4783
|
+
var Tn = {
|
|
4565
4784
|
searchPlaceholder: "Search...",
|
|
4566
4785
|
columnsMenu: "Columns",
|
|
4567
4786
|
columnsMenuLabel: (e, t) => `Columns, ${e} of ${t} shown`,
|
|
@@ -4636,8 +4855,27 @@ var gn = 7, _n = class {
|
|
|
4636
4855
|
previousPage: "Previous page",
|
|
4637
4856
|
nextPage: "Next page",
|
|
4638
4857
|
lastPage: "Last page",
|
|
4858
|
+
sortBy: "Sort",
|
|
4859
|
+
sortedBy: (e, t) => `${e} ${t ? "↓" : "↑"}`,
|
|
4860
|
+
ascending: "Ascending",
|
|
4861
|
+
descending: "Descending",
|
|
4862
|
+
filters: "Filters",
|
|
4863
|
+
filtersLabel: (e) => e > 0 ? `Filters, ${e} applied` : "Filters",
|
|
4864
|
+
showRows: (e) => e === 1 ? "Show 1 row" : `Show ${e} rows`,
|
|
4865
|
+
close: "Close",
|
|
4866
|
+
showMore: (e) => `Show ${e} more`,
|
|
4867
|
+
shownCount: (e, t) => `${e} of ${t}`,
|
|
4868
|
+
recordPosition: (e, t) => `${e} of ${t}`,
|
|
4869
|
+
previousRow: "Previous row",
|
|
4870
|
+
nextRow: "Next row",
|
|
4871
|
+
details: "Details",
|
|
4872
|
+
selectRows: "Select",
|
|
4873
|
+
clearSearch: "Clear search",
|
|
4874
|
+
edit: "Edit",
|
|
4875
|
+
selectedRows: (e) => `${e} selected`,
|
|
4876
|
+
selectAll: "Select all",
|
|
4639
4877
|
selectionAnnouncement: (e, t) => e === 0 ? "No rows selected" : `${e} of ${t} rows selected`
|
|
4640
|
-
},
|
|
4878
|
+
}, En = class {
|
|
4641
4879
|
grid;
|
|
4642
4880
|
constructor(e) {
|
|
4643
4881
|
this.grid = e;
|
|
@@ -4693,16 +4931,16 @@ var gn = 7, _n = class {
|
|
|
4693
4931
|
let t = parseInt(e, 10);
|
|
4694
4932
|
isNaN(t) || this.grid.changePage(Math.max(1, Math.min(t, this.totalPages)));
|
|
4695
4933
|
};
|
|
4696
|
-
},
|
|
4697
|
-
function
|
|
4934
|
+
}, Dn = /["\t\r\n]/;
|
|
4935
|
+
function On(e) {
|
|
4698
4936
|
if (e == null) return "";
|
|
4699
4937
|
let t = e instanceof Date ? e.toISOString() : String(e);
|
|
4700
|
-
return
|
|
4938
|
+
return Dn.test(t) ? `"${t.split("\"").join("\"\"")}"` : t;
|
|
4701
4939
|
}
|
|
4702
|
-
function
|
|
4703
|
-
return e.map((e) => e.map(
|
|
4940
|
+
function kn(e) {
|
|
4941
|
+
return e.map((e) => e.map(On).join(" ")).join("\r\n");
|
|
4704
4942
|
}
|
|
4705
|
-
function
|
|
4943
|
+
function An(e) {
|
|
4706
4944
|
let t = [], n = [], r = "", i = !1;
|
|
4707
4945
|
for (let a = 0; a < e.length; a++) {
|
|
4708
4946
|
let o = e[a];
|
|
@@ -4710,10 +4948,10 @@ function wn(e) {
|
|
|
4710
4948
|
}
|
|
4711
4949
|
return (r !== "" || n.length > 0) && (n.push(r), t.push(n)), t;
|
|
4712
4950
|
}
|
|
4713
|
-
function
|
|
4951
|
+
function jn(e, t) {
|
|
4714
4952
|
return e?.row === t?.row && e?.column === t?.column;
|
|
4715
4953
|
}
|
|
4716
|
-
var
|
|
4954
|
+
var Mn = class {
|
|
4717
4955
|
grid;
|
|
4718
4956
|
constructor(e) {
|
|
4719
4957
|
this.grid = e;
|
|
@@ -4759,7 +4997,7 @@ var En = class {
|
|
|
4759
4997
|
row: e,
|
|
4760
4998
|
column: t
|
|
4761
4999
|
}, i = n && this._anchor ? this._anchor : r;
|
|
4762
|
-
|
|
5000
|
+
jn(this._focus, r) && jn(this._anchor, i) || (this._anchor = i, this._focus = r, this.grid.notifyRows(), this.emit(n ? "extend" : "select"));
|
|
4763
5001
|
}
|
|
4764
5002
|
syncCurrent(e, t) {
|
|
4765
5003
|
this.isCurrent(e, t) || this.setCurrent(e, t);
|
|
@@ -4810,7 +5048,7 @@ var En = class {
|
|
|
4810
5048
|
onCopy = (e) => {
|
|
4811
5049
|
if (!this._focus || !e.clipboardData) return;
|
|
4812
5050
|
let t = e.currentTarget.ownerDocument.defaultView?.getSelection();
|
|
4813
|
-
t && !t.isCollapsed || (e.clipboardData.setData("text/plain",
|
|
5051
|
+
t && !t.isCollapsed || (e.clipboardData.setData("text/plain", kn(this.values())), e.preventDefault());
|
|
4814
5052
|
};
|
|
4815
5053
|
pasteBounds(e, t) {
|
|
4816
5054
|
let n = this.bounds;
|
|
@@ -4827,10 +5065,10 @@ var En = class {
|
|
|
4827
5065
|
if (!this._focus || !e.clipboardData || this.grid.edits.isOpen || !this.grid.edits.enabled) return;
|
|
4828
5066
|
let t = e.clipboardData.getData("text/plain");
|
|
4829
5067
|
if (!t) return;
|
|
4830
|
-
let n =
|
|
5068
|
+
let n = An(t), r = n.reduce((e, t) => Math.max(e, t.length), 0), i = this.pasteBounds(n.length, r);
|
|
4831
5069
|
i && (e.preventDefault(), this.grid.edits.paste(i, (e, t) => n[e % n.length][t % r] ?? ""));
|
|
4832
5070
|
};
|
|
4833
|
-
},
|
|
5071
|
+
}, Nn = class extends H {
|
|
4834
5072
|
node;
|
|
4835
5073
|
level;
|
|
4836
5074
|
position;
|
|
@@ -4881,10 +5119,10 @@ var En = class {
|
|
|
4881
5119
|
};
|
|
4882
5120
|
//#endregion
|
|
4883
5121
|
//#region src/components/dataGrid/models/treeModel.ts
|
|
4884
|
-
function
|
|
5122
|
+
function Pn(e) {
|
|
4885
5123
|
return JSON.stringify(e);
|
|
4886
5124
|
}
|
|
4887
|
-
var
|
|
5125
|
+
var Fn = class {
|
|
4888
5126
|
grid;
|
|
4889
5127
|
constructor(e) {
|
|
4890
5128
|
this.grid = e;
|
|
@@ -4938,9 +5176,9 @@ var kn = class {
|
|
|
4938
5176
|
data: e,
|
|
4939
5177
|
children: []
|
|
4940
5178
|
};
|
|
4941
|
-
n.set(
|
|
5179
|
+
n.set(Pn(r), i);
|
|
4942
5180
|
let a;
|
|
4943
|
-
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(
|
|
5181
|
+
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(Pn(r.slice(0, e)));
|
|
4944
5182
|
(a ? a.children : t).push(i);
|
|
4945
5183
|
}), t;
|
|
4946
5184
|
}
|
|
@@ -4986,7 +5224,7 @@ var kn = class {
|
|
|
4986
5224
|
}
|
|
4987
5225
|
rowList() {
|
|
4988
5226
|
let e = 0, t = (n, r, i) => n.map((a, o) => {
|
|
4989
|
-
let s = new
|
|
5227
|
+
let s = new Nn(this.grid, a, e++, r, o, n.length, i);
|
|
4990
5228
|
return s.treeExpanded && (s.children = t(a.children, r + 1, s)), s;
|
|
4991
5229
|
});
|
|
4992
5230
|
return t(this.nodes.value, 0);
|
|
@@ -5028,7 +5266,7 @@ var kn = class {
|
|
|
5028
5266
|
let n = !this.isExpanded(e, t);
|
|
5029
5267
|
n ? (this._opened.add(e), this._closed.delete(e)) : (this._closed.add(e), this._opened.delete(e)), this.grid.treeExpansionChanged(), this.grid.props.onExpandedTreeKeysChange?.(this.expandedKeys(), { reason: n ? "expand" : "collapse" }), this.grid.notify();
|
|
5030
5268
|
};
|
|
5031
|
-
},
|
|
5269
|
+
}, In = {}, Ln = class t {
|
|
5032
5270
|
props;
|
|
5033
5271
|
constructor(e, t) {
|
|
5034
5272
|
this.props = e, t && this.listeners.add(t);
|
|
@@ -5059,9 +5297,9 @@ var kn = class {
|
|
|
5059
5297
|
get headerVersion() {
|
|
5060
5298
|
return `${this._epoch}:${this._selectionVersion}`;
|
|
5061
5299
|
}
|
|
5062
|
-
setProps(
|
|
5300
|
+
setProps(e) {
|
|
5063
5301
|
let n = this.props;
|
|
5064
|
-
n !==
|
|
5302
|
+
n !== e && (t.drawnPropsChanged(n, e) && this._epoch++, this.props = e, n.def !== e.def && this.sourceColumns.clear(), (n.data !== e.data || n.def !== e.def || n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters || n.expandedRowKeys !== e.expandedRowKeys || n.expandedTreeKeys !== e.expandedTreeKeys || n.page !== e.page || n.pageSize !== e.pageSize) && this.rows.clear(), (n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters) && this.leaveSelectionView(), (n.data !== e.data || n.def !== e.def || n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters) && this.tree.nodes.clear());
|
|
5065
5303
|
}
|
|
5066
5304
|
get data() {
|
|
5067
5305
|
return this.props.data ?? [];
|
|
@@ -5096,7 +5334,7 @@ var kn = class {
|
|
|
5096
5334
|
let e = this.props.def.localeText, t = this._localeText;
|
|
5097
5335
|
if (t && t.from === e) return t.text;
|
|
5098
5336
|
let n = {
|
|
5099
|
-
...
|
|
5337
|
+
...Tn,
|
|
5100
5338
|
...e
|
|
5101
5339
|
};
|
|
5102
5340
|
return this._localeText = {
|
|
@@ -5109,17 +5347,17 @@ var kn = class {
|
|
|
5109
5347
|
if (this.groupColumns.size > 0 && t.push(new Q({ key: G }, this)), t.push(...e.columns.map((e) => new Q(e, this))), e.rowSelection) {
|
|
5110
5348
|
let n = typeof e.rowSelection == "object" && e.rowSelection.pinned ? "START" : void 0;
|
|
5111
5349
|
t.unshift(new Q({
|
|
5112
|
-
key:
|
|
5350
|
+
key: Le,
|
|
5113
5351
|
pin: n,
|
|
5114
5352
|
width: 50,
|
|
5115
5353
|
align: "center",
|
|
5116
|
-
Cell:
|
|
5354
|
+
Cell: en
|
|
5117
5355
|
}, this));
|
|
5118
5356
|
}
|
|
5119
5357
|
if (e.showRowNumber) {
|
|
5120
5358
|
let n, r = 70;
|
|
5121
5359
|
typeof e.showRowNumber == "object" && (e.showRowNumber.pinned && (n = "START"), r = e.showRowNumber.width ?? 70), t.unshift(new Q({
|
|
5122
|
-
key:
|
|
5360
|
+
key: Ie,
|
|
5123
5361
|
pin: n,
|
|
5124
5362
|
width: r,
|
|
5125
5363
|
align: "end"
|
|
@@ -5128,12 +5366,12 @@ var kn = class {
|
|
|
5128
5366
|
if (e.rowDetail) {
|
|
5129
5367
|
let n = e.rowDetail.pinned ? "START" : void 0, r = e.rowDetail.expandColumnWidth ?? 50, i = e.rowDetail.expandColumnHeader ?? "";
|
|
5130
5368
|
t.unshift(new Q({
|
|
5131
|
-
key:
|
|
5369
|
+
key: Re,
|
|
5132
5370
|
header: i,
|
|
5133
5371
|
pin: n,
|
|
5134
5372
|
width: r,
|
|
5135
5373
|
align: "center",
|
|
5136
|
-
Cell:
|
|
5374
|
+
Cell: $t
|
|
5137
5375
|
}, this));
|
|
5138
5376
|
}
|
|
5139
5377
|
return t;
|
|
@@ -5152,10 +5390,10 @@ var kn = class {
|
|
|
5152
5390
|
leafs: i,
|
|
5153
5391
|
visibleLeafs: a,
|
|
5154
5392
|
userVisibleLeafs: a.filter((e) => ![
|
|
5155
|
-
|
|
5156
|
-
|
|
5393
|
+
Ie,
|
|
5394
|
+
Le,
|
|
5157
5395
|
G,
|
|
5158
|
-
|
|
5396
|
+
Re
|
|
5159
5397
|
].includes(e.key)),
|
|
5160
5398
|
maxDeath: W.maxBy(r, (e) => e.death) + 1
|
|
5161
5399
|
};
|
|
@@ -5192,7 +5430,7 @@ var kn = class {
|
|
|
5192
5430
|
let t = this.globalFilterValue.trim();
|
|
5193
5431
|
return !t || this.globalFilterColumns.value.some((n) => {
|
|
5194
5432
|
let r = e[n];
|
|
5195
|
-
return r != null &&
|
|
5433
|
+
return r != null && Qt(t, String(r));
|
|
5196
5434
|
});
|
|
5197
5435
|
}
|
|
5198
5436
|
matchesColumnFilters(e) {
|
|
@@ -5204,7 +5442,7 @@ var kn = class {
|
|
|
5204
5442
|
}
|
|
5205
5443
|
matchesFilter(e, t) {
|
|
5206
5444
|
switch (t.type) {
|
|
5207
|
-
case "text": return !t.value.trim() || e != null &&
|
|
5445
|
+
case "text": return !t.value.trim() || e != null && Qt(t.value, String(e));
|
|
5208
5446
|
case "number": {
|
|
5209
5447
|
if (e == null) return !1;
|
|
5210
5448
|
let n = typeof e == "number" ? e : parseFloat(String(e));
|
|
@@ -5313,14 +5551,14 @@ var kn = class {
|
|
|
5313
5551
|
let a = W.findOrThrow(this.columns.value.leafs, (e) => e.key === i);
|
|
5314
5552
|
return this._sortColumn === "grouping-cell" && (e = W.sortBy(e, (e) => e[i], this._sortDirection)), W.groupBy(e, (e) => e[i]).map((e) => {
|
|
5315
5553
|
let i;
|
|
5316
|
-
i = n.size > 0 ? t(e.values, new Set(n), r + 1) : e.values.map((e, t) => new
|
|
5317
|
-
let o = new
|
|
5554
|
+
i = n.size > 0 ? t(e.values, new Set(n), r + 1) : e.values.map((e, t) => new H(this, e, r + 1 + t));
|
|
5555
|
+
let o = new Je(this, a, i, r, e.key);
|
|
5318
5556
|
return r += 1, o.expanded && (r += i.length), o;
|
|
5319
5557
|
});
|
|
5320
5558
|
};
|
|
5321
5559
|
return t(e, new Set(this.groupColumns), 0);
|
|
5322
5560
|
}
|
|
5323
|
-
return e.map((e, t) => new
|
|
5561
|
+
return e.map((e, t) => new H(this, e, t));
|
|
5324
5562
|
}, () => [this.columns]);
|
|
5325
5563
|
groupingSpan = q(() => {
|
|
5326
5564
|
let { visibleLeafs: e } = this.columns.value, t = e.findIndex((e) => e.isGrouping);
|
|
@@ -5364,7 +5602,7 @@ var kn = class {
|
|
|
5364
5602
|
e && Object.entries(this.sizes.value).forEach(([t, n]) => e.style.setProperty(t, n));
|
|
5365
5603
|
};
|
|
5366
5604
|
get isRtl() {
|
|
5367
|
-
return
|
|
5605
|
+
return e(this._sizingElement);
|
|
5368
5606
|
}
|
|
5369
5607
|
setContainerWidth = (e) => {
|
|
5370
5608
|
this._containerWidth !== e && (this._containerWidth = e, this.flexWidths.clear(), this.notify());
|
|
@@ -5449,28 +5687,29 @@ var kn = class {
|
|
|
5449
5687
|
rowOffsets = q(() => {
|
|
5450
5688
|
if (this.source.enabled) return this.source.rowOffsets(this.flatRows.value);
|
|
5451
5689
|
let e = [], t = 0;
|
|
5452
|
-
for (let n of this.flatRows.value) e.push(t), t += n instanceof
|
|
5690
|
+
for (let n of this.flatRows.value) e.push(t), t += n instanceof V ? n.heightForOffset : this.rowHeight;
|
|
5453
5691
|
return {
|
|
5454
5692
|
offsets: e,
|
|
5455
5693
|
totalHeight: t
|
|
5456
5694
|
};
|
|
5457
5695
|
}, () => [this.flatRows]);
|
|
5458
|
-
viewport = new
|
|
5459
|
-
columnVisibility = new
|
|
5460
|
-
filter = new
|
|
5461
|
-
pagination = new
|
|
5462
|
-
aggregation = new
|
|
5463
|
-
exporter = new
|
|
5464
|
-
source = new
|
|
5465
|
-
tree = new
|
|
5466
|
-
edits = new
|
|
5467
|
-
range = new
|
|
5696
|
+
viewport = new be(this);
|
|
5697
|
+
columnVisibility = new an(this);
|
|
5698
|
+
filter = new bn(this);
|
|
5699
|
+
pagination = new En(this);
|
|
5700
|
+
aggregation = new Ge(this);
|
|
5701
|
+
exporter = new yn(this);
|
|
5702
|
+
source = new hn(this);
|
|
5703
|
+
tree = new Fn(this);
|
|
5704
|
+
edits = new ke(this);
|
|
5705
|
+
range = new Mn(this);
|
|
5706
|
+
list = new xn(this);
|
|
5468
5707
|
refresh = () => {
|
|
5469
5708
|
this.edits.clearEdits(), this.source.invalidate();
|
|
5470
5709
|
};
|
|
5471
5710
|
get exportConfig() {
|
|
5472
5711
|
let e = this.props.def.export;
|
|
5473
|
-
if (e) return typeof e == "object" ? e :
|
|
5712
|
+
if (e) return typeof e == "object" ? e : In;
|
|
5474
5713
|
}
|
|
5475
5714
|
exportCsv = async (e = {}) => {
|
|
5476
5715
|
let { downloadCsv: t } = await import("../gridExport.mjs");
|
|
@@ -5573,7 +5812,7 @@ var kn = class {
|
|
|
5573
5812
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5574
5813
|
};
|
|
5575
5814
|
pinColumn = (e, t) => {
|
|
5576
|
-
let n =
|
|
5815
|
+
let n = tn(t), r = W.findOrThrow(this.columns.value.flat, (t) => t.uniqueKey === e);
|
|
5577
5816
|
r.pin !== n && r.pinColumn(n), this.columns.clear(), this.notify();
|
|
5578
5817
|
};
|
|
5579
5818
|
toggleGrouping = (e) => {
|
|
@@ -5662,48 +5901,73 @@ var kn = class {
|
|
|
5662
5901
|
};
|
|
5663
5902
|
//#endregion
|
|
5664
5903
|
//#region src/components/dataGrid/useGrid.ts
|
|
5665
|
-
function
|
|
5666
|
-
let [t] = P(() => new
|
|
5667
|
-
return t.setProps(e), t.setIdentifier(n),
|
|
5904
|
+
function Rn(e) {
|
|
5905
|
+
let [t] = P(() => new Ln(e)), n = u("datagrid");
|
|
5906
|
+
return t.setProps(e), t.setIdentifier(n), oe(t.subscribe, t.getSnapshot, t.getSnapshot), t;
|
|
5907
|
+
}
|
|
5908
|
+
//#endregion
|
|
5909
|
+
//#region src/components/dataGrid/useListLayout.ts
|
|
5910
|
+
var zn, Bn;
|
|
5911
|
+
function Vn() {
|
|
5912
|
+
return Bn ??= import("../dataGridList.mjs").then((e) => zn = e.default), Bn;
|
|
5913
|
+
}
|
|
5914
|
+
t("(max-width: 36rem)")?.matches && Vn();
|
|
5915
|
+
function Hn(e) {
|
|
5916
|
+
let [t, n] = P(() => zn);
|
|
5917
|
+
return A(() => {
|
|
5918
|
+
if (!e || t) return;
|
|
5919
|
+
let r = !0;
|
|
5920
|
+
return Vn().then((e) => r && n(() => e)), () => {
|
|
5921
|
+
r = !1;
|
|
5922
|
+
};
|
|
5923
|
+
}, [e, t]), t;
|
|
5668
5924
|
}
|
|
5669
5925
|
//#endregion
|
|
5670
5926
|
//#region src/components/dataGrid.tsx
|
|
5671
|
-
function
|
|
5672
|
-
let n =
|
|
5927
|
+
function Un(e, t) {
|
|
5928
|
+
let n = Rn(e), a = N(null);
|
|
5673
5929
|
j(t, () => ({
|
|
5674
5930
|
get element() {
|
|
5675
|
-
return
|
|
5931
|
+
return a.current;
|
|
5676
5932
|
},
|
|
5677
5933
|
exportCsv: n.exportCsv,
|
|
5678
5934
|
exportXlsx: n.exportXlsx,
|
|
5679
5935
|
refresh: n.refresh,
|
|
5680
5936
|
clearEdits: n.edits.clearEdits
|
|
5681
5937
|
}), [n]);
|
|
5682
|
-
let { component:
|
|
5683
|
-
|
|
5684
|
-
let e =
|
|
5938
|
+
let { component: o, data: s, def: c, loading: l, filters: u, globalFilterValue: d, columnFilters: f, expandedRowKeys: p, expandedTreeKeys: m, page: h, pageSize: g, onSelectedRowKeysChange: _, onSelectionChange: y, onGlobalFilterChange: b, onColumnFiltersChange: x, onExpandedRowKeysChange: S, onExpandedTreeKeysChange: C, onCellEditsChange: w, onPaginationChange: T, onPageChange: ee, onPageSizeChange: te, onSortingChange: ne, onSortChange: E, onServerStateChange: D, style: O, ...k } = e;
|
|
5939
|
+
re(() => {
|
|
5940
|
+
let e = a.current;
|
|
5685
5941
|
if (e) return n.setSizingElement(e), () => n.setSizingElement(null);
|
|
5686
|
-
}, [n]),
|
|
5687
|
-
|
|
5942
|
+
}, [n]), r(() => {
|
|
5943
|
+
let e = a.current;
|
|
5944
|
+
if (!e) return;
|
|
5945
|
+
n.list.setWidth(e.clientWidth);
|
|
5946
|
+
let t = new ResizeObserver(() => n.list.setWidth(e.clientWidth));
|
|
5947
|
+
return t.observe(e), () => t.disconnect();
|
|
5948
|
+
}, [n]);
|
|
5949
|
+
let A = n.list.active, M = Hn(A);
|
|
5950
|
+
return /* @__PURE__ */ I(i, {
|
|
5951
|
+
ref: a,
|
|
5688
5952
|
component: n.componentName,
|
|
5689
|
-
|
|
5953
|
+
variant: { list: !!M && A },
|
|
5954
|
+
...k,
|
|
5690
5955
|
style: {
|
|
5691
5956
|
...n.sizes.value,
|
|
5692
|
-
...
|
|
5957
|
+
...O
|
|
5693
5958
|
},
|
|
5694
|
-
children: [
|
|
5695
|
-
n.props.def.topBar && /* @__PURE__ */
|
|
5696
|
-
/* @__PURE__ */
|
|
5697
|
-
/* @__PURE__ */
|
|
5698
|
-
n.props.def.bottomBar && /* @__PURE__ */
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
]
|
|
5959
|
+
children: [M && A ? /* @__PURE__ */ F(M, { grid: n }) : /* @__PURE__ */ I(ae, { children: [
|
|
5960
|
+
n.props.def.topBar && /* @__PURE__ */ F(Xt, { grid: n }),
|
|
5961
|
+
/* @__PURE__ */ F(Vt, { grid: n }),
|
|
5962
|
+
/* @__PURE__ */ F(Bt, { grid: n }),
|
|
5963
|
+
n.props.def.bottomBar && /* @__PURE__ */ F(_e, { grid: n })
|
|
5964
|
+
] }), /* @__PURE__ */ F(v, {
|
|
5965
|
+
props: { role: "status" },
|
|
5966
|
+
children: n.selectionAnnouncement
|
|
5967
|
+
})]
|
|
5704
5968
|
});
|
|
5705
5969
|
}
|
|
5706
|
-
var
|
|
5707
|
-
|
|
5970
|
+
var Wn = E(Un);
|
|
5971
|
+
Un.displayName = "DataGrid";
|
|
5708
5972
|
//#endregion
|
|
5709
|
-
export {
|
|
5973
|
+
export { Tn as DATA_GRID_LOCALE_TEXT, zt as a, Z as c, U as d, Wn as default, Vt as i, ot as l, Gt as n, Et as o, Ut as r, vt as s, qt as t, Y as u };
|