@box-kite/react 2.2.7 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BOX_AI_CONTEXT.md +76 -0
- package/BOX_KITE_AI_CONTEXT.md +76 -0
- package/analytics.cjs +1 -0
- package/analytics.d.ts +10 -0
- package/analytics.mjs +121 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +42 -38
- package/box.cjs +1 -1
- package/box.d.ts +9 -0
- package/box.mjs +17 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +8 -0
- package/client.cjs +1 -1
- package/client.mjs +120 -120
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +19 -10
- package/components/agent.cjs +1 -1
- package/components/agent.mjs +21 -8
- package/components/calendar.cjs +1 -1
- package/components/calendar.d.ts +3 -1
- package/components/calendar.mjs +154 -142
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +184 -174
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +183 -170
- package/components/dataGrid/models/columnModel.d.ts +1 -0
- package/components/dataGrid/models/gridModel.d.ts +18 -0
- package/components/dataGrid/models/rangeModel.d.ts +3 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +987 -896
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +165 -159
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +198 -183
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +38 -33
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +107 -93
- package/components/form.cjs +1 -1
- package/components/form.mjs +22 -18
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -0
- package/components/menu.mjs +196 -175
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +7 -7
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +4 -0
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +10 -5
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +84 -83
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +158 -150
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +92 -84
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +10 -5
- package/components/timeZoneSelect.cjs +1 -1
- package/components/timeZoneSelect.mjs +40 -35
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +151 -113
- package/dataGridDateParts.cjs +1 -1
- package/dataGridDateParts.mjs +56 -55
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +430 -429
- package/effects.cjs +1 -1
- package/effects.mjs +1 -1
- package/interactionListening.cjs +1 -0
- package/interactionListening.mjs +117 -0
- package/interactions.cjs +1 -0
- package/interactions.mjs +25 -0
- package/layer.cjs +1 -1
- package/layer.mjs +68 -66
- package/package.json +132 -68
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +44 -25
- package/react/interactions/interactions.d.ts +30 -0
- package/react/popover/usePopoverLayer.d.ts +3 -0
- package/react/useStyles.d.ts +8 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +49 -48
- package/reporting.cjs +1 -0
- package/reporting.mjs +51 -0
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/supabase/functions/collect/index.d.ts +30 -0
- package/supabase/functions/collect/index.test.d.ts +1 -0
- package/utils/analytics/analytics.d.ts +72 -0
- package/utils/analytics/analyticsIdentity.d.ts +13 -0
- package/utils/interactions/componentAttribute.d.ts +6 -0
- package/utils/interactions/interactionChannel.d.ts +35 -0
- package/utils/interactions/interactionJson.d.ts +6 -0
- package/utils/interactions/interactionListening.d.ts +6 -0
- package/utils/interactions/interactionTypes.d.ts +224 -0
package/dataGridList.mjs
CHANGED
|
@@ -1,64 +1,65 @@
|
|
|
1
1
|
import e from "./box.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import r from "./components/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import w from "./components/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
2
|
+
import { n as t, t as n } from "./reporting.mjs";
|
|
3
|
+
import { Path as r, Svg as i } from "./components/svg.mjs";
|
|
4
|
+
import a from "./components/button.mjs";
|
|
5
|
+
import o from "./components/visuallyHidden.mjs";
|
|
6
|
+
import s from "./components/flex.mjs";
|
|
7
|
+
import c from "./components/checkbox.mjs";
|
|
8
|
+
import l from "./components/textbox.mjs";
|
|
9
|
+
import { H3 as u, Span as d } from "./components/semantics.mjs";
|
|
10
|
+
import { a as f, c as p, d as m, f as h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "./components/dataGrid.mjs";
|
|
11
|
+
import E from "./components/dialog.mjs";
|
|
12
|
+
import D from "./components/list.mjs";
|
|
13
|
+
import O from "./components/radioButton.mjs";
|
|
14
|
+
import k from "./components/skeleton.mjs";
|
|
15
|
+
import { t as A } from "./dataGridListLayout.mjs";
|
|
16
|
+
import { memo as j, useCallback as M, useEffect as N, useRef as P, useState as F } from "react";
|
|
17
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
17
18
|
//#region src/components/dataGrid/components/dataGridListAggregate.tsx
|
|
18
|
-
function
|
|
19
|
+
function z(e) {
|
|
19
20
|
let { cell: t } = e, { AggregateCell: n } = t.column;
|
|
20
|
-
return n ? /* @__PURE__ */
|
|
21
|
+
return n ? /* @__PURE__ */ L(n, { cell: t }) : /* @__PURE__ */ L(I, { children: t.value ?? "—" });
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
z.displayName = "DataGridListAggregate";
|
|
23
24
|
//#endregion
|
|
24
25
|
//#region src/components/dataGrid/components/dataGridListFooter.tsx
|
|
25
|
-
function
|
|
26
|
-
let { grid: n, shown:
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
function B(t) {
|
|
27
|
+
let { grid: n, shown: r } = t, { list: i, pagination: o, aggregation: c } = n, l = n.componentName, u = n.localeText, d = o.state, f = c.hasFooter ? c.footerCells.value.filter((e) => e.column.aggregate) : [];
|
|
28
|
+
return /* @__PURE__ */ R(I, { children: [f.length > 0 && /* @__PURE__ */ R(e, {
|
|
28
29
|
bgColor: "currentColor/3",
|
|
29
30
|
px: 4,
|
|
30
31
|
py: 3,
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ L(e, {
|
|
32
33
|
fontWeight: 600,
|
|
33
34
|
fontSize: 14,
|
|
34
35
|
mb: 1,
|
|
35
36
|
children: c.footerLabel
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ L(e, {
|
|
37
38
|
tag: "dl",
|
|
38
39
|
display: "grid",
|
|
39
40
|
gridTemplateColumns: 2,
|
|
40
41
|
columnGap: 4,
|
|
41
42
|
rowGap: 2,
|
|
42
43
|
m: 0,
|
|
43
|
-
children: f.map((t) => /* @__PURE__ */
|
|
44
|
+
children: f.map((t) => /* @__PURE__ */ R(e, {
|
|
44
45
|
minWidth: 0,
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ L(e, {
|
|
46
47
|
tag: "dt",
|
|
47
48
|
component: "list.muted",
|
|
48
49
|
fontSize: 12,
|
|
49
50
|
lineHeight: 16,
|
|
50
51
|
children: t.column.header ?? String(t.column.key)
|
|
51
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ L(e, {
|
|
52
53
|
tag: "dd",
|
|
53
54
|
m: 0,
|
|
54
55
|
fontSize: 14,
|
|
55
56
|
lineHeight: 20,
|
|
56
57
|
fontWeight: 600,
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ L(z, { cell: t })
|
|
58
59
|
})]
|
|
59
60
|
}, t.column.key))
|
|
60
61
|
})]
|
|
61
|
-
}), d ? /* @__PURE__ */
|
|
62
|
+
}), d ? /* @__PURE__ */ L(s, {
|
|
62
63
|
component: "list.muted",
|
|
63
64
|
d: "column",
|
|
64
65
|
gap: 2,
|
|
@@ -67,40 +68,40 @@ function L(t) {
|
|
|
67
68
|
py: 4,
|
|
68
69
|
fontSize: 13,
|
|
69
70
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ R(s, {
|
|
71
72
|
ai: "center",
|
|
72
73
|
jc: "space-between",
|
|
73
74
|
gap: 3,
|
|
74
75
|
width: "fit",
|
|
75
76
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ L(a, {
|
|
77
78
|
type: "button",
|
|
78
79
|
component: `${l}.list.button`,
|
|
79
|
-
...
|
|
80
|
+
...A.ICON_BUTTON,
|
|
80
81
|
borderRadius: 3,
|
|
81
|
-
disabled: !
|
|
82
|
-
onClick:
|
|
82
|
+
disabled: !o.canGoPrev,
|
|
83
|
+
onClick: o.prevPage,
|
|
83
84
|
props: { "aria-label": u.previousPage },
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ L(h, {
|
|
85
86
|
width: "18px",
|
|
86
87
|
height: "18px",
|
|
87
88
|
rotate: 90,
|
|
88
89
|
rtl: { rotate: -90 }
|
|
89
90
|
})
|
|
90
91
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ L(e, {
|
|
92
93
|
textAlign: "center",
|
|
93
|
-
children: u.pageRowRange(
|
|
94
|
+
children: u.pageRowRange(o.startItem, o.endItem, o.totalItems)
|
|
94
95
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ L(a, {
|
|
96
97
|
type: "button",
|
|
97
98
|
component: `${l}.list.button`,
|
|
98
|
-
...
|
|
99
|
+
...A.ICON_BUTTON,
|
|
99
100
|
borderRadius: 3,
|
|
100
|
-
disabled: !
|
|
101
|
-
onClick:
|
|
101
|
+
disabled: !o.canGoNext,
|
|
102
|
+
onClick: o.nextPage,
|
|
102
103
|
props: { "aria-label": u.nextPage },
|
|
103
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ L(h, {
|
|
104
105
|
width: "18px",
|
|
105
106
|
height: "18px",
|
|
106
107
|
rotate: -90,
|
|
@@ -109,7 +110,7 @@ function L(t) {
|
|
|
109
110
|
})
|
|
110
111
|
]
|
|
111
112
|
})
|
|
112
|
-
}) : (
|
|
113
|
+
}) : (i.hasMore || r !== void 0) && /* @__PURE__ */ R(s, {
|
|
113
114
|
component: "list.muted",
|
|
114
115
|
d: "column",
|
|
115
116
|
gap: 2,
|
|
@@ -118,7 +119,7 @@ function L(t) {
|
|
|
118
119
|
py: 4,
|
|
119
120
|
fontSize: 13,
|
|
120
121
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
121
|
-
children: [
|
|
122
|
+
children: [i.hasMore && /* @__PURE__ */ L(a, {
|
|
122
123
|
type: "button",
|
|
123
124
|
component: `${l}.list.button`,
|
|
124
125
|
width: "fit",
|
|
@@ -129,61 +130,61 @@ function L(t) {
|
|
|
129
130
|
color: "accent-600",
|
|
130
131
|
cursor: "pointer",
|
|
131
132
|
theme: { dark: { color: "accent-300" } },
|
|
132
|
-
onClick:
|
|
133
|
-
children: u.showMore(
|
|
134
|
-
}),
|
|
133
|
+
onClick: i.showMore,
|
|
134
|
+
children: u.showMore(i.nextBatch)
|
|
135
|
+
}), r !== void 0 && /* @__PURE__ */ L(e, { children: u.shownCount(r, n.source.enabled ? n.totalRowCount : n.filterStats.filtered) })]
|
|
135
136
|
})] });
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
+
B.displayName = "DataGridListFooter";
|
|
138
139
|
//#endregion
|
|
139
140
|
//#region src/components/dataGrid/components/dataGridListGroup.tsx
|
|
140
|
-
function
|
|
141
|
+
function V(e) {
|
|
141
142
|
let { row: t } = e, { grid: n } = t, r = t.cells.flatMap((e) => e.aggregate ? [e.aggregate] : []), i = t.placeholder ? "" : String(t.groupValue);
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ R(D.Item, {
|
|
143
144
|
size: "sm",
|
|
144
145
|
bgColor: "currentColor/3",
|
|
145
146
|
ps: 4 + Math.min(t.depth, 3) * 4,
|
|
146
147
|
props: { "aria-busy": t.placeholder || void 0 },
|
|
147
148
|
children: [
|
|
148
|
-
n.list.selecting && t.selectable && /* @__PURE__ */
|
|
149
|
+
n.list.selecting && t.selectable && /* @__PURE__ */ L(D.Actions, { children: /* @__PURE__ */ L(c, {
|
|
149
150
|
variant: "datagrid",
|
|
150
151
|
checked: t.selected,
|
|
151
152
|
indeterminate: t.indeterminate,
|
|
152
153
|
onChange: t.toggleSelectAll,
|
|
153
154
|
props: { "aria-label": n.localeText.selectGroupRows(i) }
|
|
154
155
|
}) }),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ L(h, {
|
|
156
157
|
width: "16px",
|
|
157
158
|
height: "16px",
|
|
158
159
|
flexShrink: 0,
|
|
159
160
|
rotate: t.expanded ? 0 : -90,
|
|
160
161
|
rtl: { rotate: t.expanded ? 0 : 90 }
|
|
161
162
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ R(D.Content, { children: [/* @__PURE__ */ L(D.Title, {
|
|
163
164
|
lines: 1,
|
|
164
165
|
fontSize: 14,
|
|
165
166
|
fontWeight: 600,
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ L(D.Action, {
|
|
167
168
|
onClick: () => t.toggleRow(),
|
|
168
169
|
props: { "aria-expanded": t.expanded },
|
|
169
170
|
children: i
|
|
170
171
|
})
|
|
171
|
-
}), r.length > 0 && /* @__PURE__ */
|
|
172
|
+
}), r.length > 0 && /* @__PURE__ */ L(D.Row, {
|
|
172
173
|
secondary: !0,
|
|
173
174
|
wrap: !0,
|
|
174
175
|
columnGap: 4,
|
|
175
176
|
fontSize: 13,
|
|
176
177
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
177
|
-
children: r.map((e) => /* @__PURE__ */
|
|
178
|
+
children: r.map((e) => /* @__PURE__ */ R(d, {
|
|
178
179
|
display: "inline-flex",
|
|
179
180
|
gap: 1,
|
|
180
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ L(d, { children: e.column.header ?? String(e.column.key) }), /* @__PURE__ */ L(d, {
|
|
181
182
|
fontWeight: 600,
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ L(z, { cell: e })
|
|
183
184
|
})]
|
|
184
185
|
}, e.column.key))
|
|
185
186
|
})] }),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ L(D.Meta, {
|
|
187
188
|
px: 2,
|
|
188
189
|
borderRadius: 999,
|
|
189
190
|
fontSize: 12,
|
|
@@ -196,156 +197,156 @@ function R(e) {
|
|
|
196
197
|
]
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
-
var
|
|
200
|
+
V.displayName = "DataGridListGroup";
|
|
201
|
+
var H = j(V);
|
|
201
202
|
//#endregion
|
|
202
203
|
//#region src/components/dataGrid/components/dataGridListValue.tsx
|
|
203
|
-
function
|
|
204
|
-
let { row:
|
|
205
|
-
if (!
|
|
206
|
-
if (
|
|
207
|
-
let { value:
|
|
208
|
-
if (typeof
|
|
209
|
-
let
|
|
210
|
-
return
|
|
211
|
-
value:
|
|
212
|
-
format:
|
|
213
|
-
}) : /* @__PURE__ */
|
|
204
|
+
function U(e) {
|
|
205
|
+
let { row: n, column: r } = e, i = n.cells.find((e) => e.column === r);
|
|
206
|
+
if (!i) return null;
|
|
207
|
+
if (r.Cell) return /* @__PURE__ */ L(t, { children: /* @__PURE__ */ L(r.Cell, { cell: i }) });
|
|
208
|
+
let { value: a } = i;
|
|
209
|
+
if (typeof a == "boolean") return /* @__PURE__ */ L(I, { children: a ? i.grid.localeText.booleanTrue : i.grid.localeText.booleanFalse });
|
|
210
|
+
let o = T(r, a);
|
|
211
|
+
return o && a != null && a !== "" ? /* @__PURE__ */ L(_, {
|
|
212
|
+
value: a,
|
|
213
|
+
format: o
|
|
214
|
+
}) : /* @__PURE__ */ L(I, { children: a == null || a === "" ? "—" : String(a) });
|
|
214
215
|
}
|
|
215
|
-
|
|
216
|
+
U.displayName = "DataGridListValue";
|
|
216
217
|
//#endregion
|
|
217
218
|
//#region src/components/dataGrid/components/dataGridListItem.tsx
|
|
218
|
-
function
|
|
219
|
-
let { row: n, index:
|
|
220
|
-
"aria-posinset":
|
|
221
|
-
"aria-setsize":
|
|
219
|
+
function W(t) {
|
|
220
|
+
let { row: n, index: r, position: i, setSize: o } = t, { grid: s } = n, { list: l } = s, { title: u, kicker: f, subtitle: p, end: m, fields: g } = l.layout.value, { selecting: _ } = l, v = l.recordViewEnabled && !n.placeholder, y = x(n) ? n : void 0, b = s.props.def.rowDetail, S = s.localeText, C = {
|
|
221
|
+
"aria-posinset": i,
|
|
222
|
+
"aria-setsize": o
|
|
222
223
|
};
|
|
223
|
-
if (n.placeholder) return /* @__PURE__ */
|
|
224
|
+
if (n.placeholder) return /* @__PURE__ */ L(D.Item, {
|
|
224
225
|
props: {
|
|
225
226
|
...C,
|
|
226
227
|
"aria-busy": !0
|
|
227
228
|
},
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ L(k, {
|
|
229
230
|
lines: 2,
|
|
230
231
|
flex1: !0
|
|
231
232
|
})
|
|
232
233
|
});
|
|
233
|
-
let w =
|
|
234
|
+
let w = u ? /* @__PURE__ */ L(U, {
|
|
234
235
|
row: n,
|
|
235
|
-
column:
|
|
236
|
-
}) : S.unnamedRow(n.rowIndex + 1),
|
|
237
|
-
return /* @__PURE__ */
|
|
236
|
+
column: u
|
|
237
|
+
}) : S.unnamedRow(n.rowIndex + 1), T = u ? String(n.cells.find((e) => e.column === u)?.value ?? "") : "", E = l.checkboxId(n.key);
|
|
238
|
+
return /* @__PURE__ */ R(D.Item, {
|
|
238
239
|
ai: "start",
|
|
239
|
-
selected: !!
|
|
240
|
+
selected: !!s.props.def.rowSelection && n.selected,
|
|
240
241
|
chevron: v && !_,
|
|
241
|
-
ps:
|
|
242
|
+
ps: y ? 4 + Math.min(y.level, 3) * 4 : void 0,
|
|
242
243
|
props: {
|
|
243
244
|
...C,
|
|
244
245
|
"data-list-key": String(n.key)
|
|
245
246
|
},
|
|
246
|
-
children: [_ && /* @__PURE__ */
|
|
247
|
+
children: [_ && /* @__PURE__ */ L(D.Actions, {
|
|
247
248
|
width: 6,
|
|
248
249
|
jc: "center",
|
|
249
250
|
alignSelf: "center",
|
|
250
|
-
children: /* @__PURE__ */
|
|
251
|
-
id:
|
|
251
|
+
children: /* @__PURE__ */ L(c, {
|
|
252
|
+
id: E,
|
|
252
253
|
variant: "datagrid",
|
|
253
254
|
checked: n.selected,
|
|
254
255
|
indeterminate: n.indeterminate,
|
|
255
256
|
onChange: n.toggleSelection
|
|
256
257
|
})
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
f && /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ R(D.Content, { children: [
|
|
259
|
+
f && /* @__PURE__ */ L(D.Overline, {
|
|
259
260
|
lines: 1,
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ L(U, {
|
|
261
262
|
row: n,
|
|
262
263
|
column: f
|
|
263
264
|
})
|
|
264
265
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ R(D.Row, {
|
|
266
267
|
ai: "start",
|
|
267
268
|
gap: 3,
|
|
268
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ R(D.Row, {
|
|
269
270
|
jc: "start",
|
|
270
271
|
ai: "center",
|
|
271
272
|
gap: 1,
|
|
272
273
|
flex1: !0,
|
|
273
|
-
children: [
|
|
274
|
+
children: [y?.hasChildren && /* @__PURE__ */ L(D.Actions, {
|
|
274
275
|
ms: -2,
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ L(a, {
|
|
276
277
|
type: "button",
|
|
277
|
-
component: `${
|
|
278
|
-
...
|
|
278
|
+
component: `${s.componentName}.list.toggle`,
|
|
279
|
+
...A.ICON_BUTTON,
|
|
279
280
|
width: 8,
|
|
280
281
|
height: 8,
|
|
281
|
-
onClick:
|
|
282
|
+
onClick: y.toggleTree,
|
|
282
283
|
props: {
|
|
283
|
-
"aria-expanded":
|
|
284
|
-
"aria-label": (
|
|
284
|
+
"aria-expanded": y.treeExpanded,
|
|
285
|
+
"aria-label": (y.treeExpanded ? S.collapseTreeRow : S.expandTreeRow)(T || S.unnamedRow(n.rowIndex + 1))
|
|
285
286
|
},
|
|
286
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ L(h, {
|
|
287
288
|
width: "16px",
|
|
288
289
|
height: "16px",
|
|
289
|
-
rotate:
|
|
290
|
-
rtl: { rotate:
|
|
290
|
+
rotate: y.treeExpanded ? 0 : -90,
|
|
291
|
+
rtl: { rotate: y.treeExpanded ? 0 : 90 }
|
|
291
292
|
})
|
|
292
293
|
})
|
|
293
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ L(D.Title, {
|
|
294
295
|
lines: 1,
|
|
295
296
|
flex1: !0,
|
|
296
297
|
fontWeight: 600,
|
|
297
|
-
children: _ ? /* @__PURE__ */
|
|
298
|
-
props: { htmlFor:
|
|
298
|
+
children: _ ? /* @__PURE__ */ L(D.Action, {
|
|
299
|
+
props: { htmlFor: E },
|
|
299
300
|
children: w
|
|
300
|
-
}) : v ? /* @__PURE__ */
|
|
301
|
+
}) : v ? /* @__PURE__ */ L(D.Action, {
|
|
301
302
|
props: { "aria-haspopup": "dialog" },
|
|
302
|
-
onClick: () =>
|
|
303
|
+
onClick: () => l.openRecord(n, r),
|
|
303
304
|
children: w
|
|
304
305
|
}) : w
|
|
305
306
|
})]
|
|
306
|
-
}),
|
|
307
|
+
}), m && /* @__PURE__ */ R(D.End, {
|
|
307
308
|
fontSize: 16,
|
|
308
309
|
fontWeight: 600,
|
|
309
310
|
lineHeight: 22,
|
|
310
|
-
...
|
|
311
|
-
children: [/* @__PURE__ */
|
|
311
|
+
...A.TRUNCATE,
|
|
312
|
+
children: [/* @__PURE__ */ L(U, {
|
|
312
313
|
row: n,
|
|
313
|
-
column:
|
|
314
|
-
}), /* @__PURE__ */
|
|
314
|
+
column: m
|
|
315
|
+
}), /* @__PURE__ */ L(D.Meta, {
|
|
315
316
|
fontWeight: 400,
|
|
316
|
-
...
|
|
317
|
-
children:
|
|
317
|
+
...A.LABEL,
|
|
318
|
+
children: m.header ?? String(m.key)
|
|
318
319
|
})]
|
|
319
320
|
})]
|
|
320
321
|
}),
|
|
321
|
-
|
|
322
|
+
p.length > 0 && /* @__PURE__ */ L(D.Description, {
|
|
322
323
|
lines: 1,
|
|
323
|
-
children:
|
|
324
|
+
children: p.map((e, t) => /* @__PURE__ */ R(d, { children: [t > 0 && " · ", /* @__PURE__ */ L(U, {
|
|
324
325
|
row: n,
|
|
325
326
|
column: e
|
|
326
327
|
})] }, e.key))
|
|
327
328
|
}),
|
|
328
|
-
g.length > 0 && /* @__PURE__ */
|
|
329
|
+
g.length > 0 && /* @__PURE__ */ L(D.Fields, {
|
|
329
330
|
mt: 2,
|
|
330
331
|
css: { gridTemplateColumns: "repeat(2, minmax(0, 1fr))" },
|
|
331
|
-
children: g.map((t) => /* @__PURE__ */
|
|
332
|
+
children: g.map((t) => /* @__PURE__ */ L(D.Field, {
|
|
332
333
|
label: t.header ?? String(t.key),
|
|
333
|
-
children: /* @__PURE__ */
|
|
334
|
-
...
|
|
335
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ L(e, {
|
|
335
|
+
...A.TRUNCATE,
|
|
336
|
+
children: /* @__PURE__ */ L(U, {
|
|
336
337
|
row: n,
|
|
337
338
|
column: t
|
|
338
339
|
})
|
|
339
340
|
})
|
|
340
341
|
}, t.key))
|
|
341
342
|
}),
|
|
342
|
-
|
|
343
|
+
b && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(D.Actions, {
|
|
343
344
|
alignSelf: "start",
|
|
344
345
|
mt: 1,
|
|
345
346
|
ms: -2,
|
|
346
|
-
children: /* @__PURE__ */
|
|
347
|
+
children: /* @__PURE__ */ R(a, {
|
|
347
348
|
type: "button",
|
|
348
|
-
component: `${
|
|
349
|
+
component: `${s.componentName}.list.toggle`,
|
|
349
350
|
display: "inline-flex",
|
|
350
351
|
ai: "center",
|
|
351
352
|
gap: 1,
|
|
@@ -357,40 +358,40 @@ function B(t) {
|
|
|
357
358
|
cursor: "pointer",
|
|
358
359
|
onClick: n.toggleDetail,
|
|
359
360
|
props: { "aria-expanded": n.expanded },
|
|
360
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ L(h, {
|
|
361
362
|
width: "14px",
|
|
362
363
|
height: "14px",
|
|
363
364
|
rotate: n.expanded ? 0 : -90,
|
|
364
365
|
rtl: { rotate: n.expanded ? 0 : 90 }
|
|
365
366
|
}), S.details]
|
|
366
367
|
})
|
|
367
|
-
}), n.expanded && /* @__PURE__ */
|
|
368
|
+
}), n.expanded && /* @__PURE__ */ L(D.Actions, {
|
|
368
369
|
display: "block",
|
|
369
370
|
mt: 2,
|
|
370
|
-
children: /* @__PURE__ */
|
|
371
|
-
component: `${
|
|
371
|
+
children: /* @__PURE__ */ L(e, {
|
|
372
|
+
component: `${s.componentName}.list.detail`,
|
|
372
373
|
p: 3,
|
|
373
374
|
borderRadius: 2,
|
|
374
375
|
fontSize: 14,
|
|
375
|
-
children:
|
|
376
|
+
children: b.content(n.data)
|
|
376
377
|
})
|
|
377
378
|
})] })
|
|
378
379
|
] })]
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
|
-
|
|
382
|
-
var
|
|
382
|
+
W.displayName = "DataGridListItem";
|
|
383
|
+
var ee = j(W);
|
|
383
384
|
//#endregion
|
|
384
385
|
//#region src/icons/closeIcon.tsx
|
|
385
|
-
function
|
|
386
|
-
return /* @__PURE__ */
|
|
386
|
+
function G(e) {
|
|
387
|
+
return /* @__PURE__ */ L(i, {
|
|
387
388
|
viewBox: "0 0 24 24",
|
|
388
389
|
width: "1.25rem",
|
|
389
390
|
fill: "none",
|
|
390
391
|
stroke: "currentColor",
|
|
391
392
|
strokeWidth: 2,
|
|
392
393
|
...e,
|
|
393
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ L(r, {
|
|
394
395
|
d: "M6 6l12 12M18 6L6 18",
|
|
395
396
|
strokeLinecap: "round"
|
|
396
397
|
})
|
|
@@ -398,48 +399,48 @@ function V(e) {
|
|
|
398
399
|
}
|
|
399
400
|
//#endregion
|
|
400
401
|
//#region src/components/dataGrid/components/dataGridListSheet.tsx
|
|
401
|
-
var
|
|
402
|
-
function
|
|
403
|
-
let { grid:
|
|
402
|
+
var te = 80;
|
|
403
|
+
function K(t) {
|
|
404
|
+
let { grid: r, open: i, onOpen: o, onClose: c, title: l, trigger: u, actions: d, footer: f, tall: p, bodyProps: m, bodyRef: h, onKeyDown: g, children: _ } = t, v = r.componentName, y = `${v}.list.sheet.line`, b = P(null), x = M((e) => {
|
|
404
405
|
let t = e.currentTarget.closest("dialog");
|
|
405
|
-
e.button !== 0 || !t || e.target.closest("button") || (
|
|
406
|
+
e.button !== 0 || !t || e.target.closest("button") || (b.current = {
|
|
406
407
|
id: e.pointerId,
|
|
407
408
|
y: e.clientY,
|
|
408
409
|
dy: 0,
|
|
409
410
|
dialog: t
|
|
410
411
|
}, e.currentTarget.setPointerCapture(e.pointerId));
|
|
411
|
-
}, []),
|
|
412
|
-
let t =
|
|
412
|
+
}, []), S = M((e) => {
|
|
413
|
+
let t = b.current;
|
|
413
414
|
if (!t || t.id !== e.pointerId) return;
|
|
414
415
|
let { dialog: n } = t;
|
|
415
416
|
t.dy = Math.max(0, e.clientY - t.y), n.style.transition = "none", n.style.translate = `0 ${t.dy}px`;
|
|
416
|
-
}, []),
|
|
417
|
-
let e =
|
|
418
|
-
if (
|
|
417
|
+
}, []), C = M(() => {
|
|
418
|
+
let e = b.current;
|
|
419
|
+
if (b.current = null, !e) return;
|
|
419
420
|
let { dialog: t } = e;
|
|
420
|
-
t.style.transition = "", t.style.translate = "", e.dy >
|
|
421
|
-
}, [
|
|
422
|
-
return /* @__PURE__ */
|
|
423
|
-
component: `${
|
|
421
|
+
t.style.transition = "", t.style.translate = "", e.dy > te && c();
|
|
422
|
+
}, [c]);
|
|
423
|
+
return /* @__PURE__ */ L(n, { children: /* @__PURE__ */ R(E, {
|
|
424
|
+
component: `${v}.list.sheet`,
|
|
424
425
|
display: "flex",
|
|
425
426
|
d: "column",
|
|
426
|
-
css:
|
|
427
|
+
css: p ? { minHeight: "min(32rem, calc(100dvh - 2rem))" } : void 0,
|
|
427
428
|
open: i,
|
|
428
|
-
onOpenChange: (e) => e ? o?.() :
|
|
429
|
-
trigger:
|
|
430
|
-
props: { onKeyDown:
|
|
429
|
+
onOpenChange: (e) => e ? o?.() : c(),
|
|
430
|
+
trigger: u,
|
|
431
|
+
props: { onKeyDown: g },
|
|
431
432
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ R(s, {
|
|
433
434
|
d: "column",
|
|
434
435
|
flexShrink: 0,
|
|
435
436
|
css: { touchAction: "none" },
|
|
436
437
|
props: {
|
|
437
|
-
onPointerDown:
|
|
438
|
-
onPointerMove:
|
|
439
|
-
onPointerUp:
|
|
440
|
-
onPointerCancel:
|
|
438
|
+
onPointerDown: x,
|
|
439
|
+
onPointerMove: S,
|
|
440
|
+
onPointerUp: C,
|
|
441
|
+
onPointerCancel: C
|
|
441
442
|
},
|
|
442
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ L(e, {
|
|
443
444
|
width: 9,
|
|
444
445
|
height: 1.25,
|
|
445
446
|
mt: 2,
|
|
@@ -448,8 +449,8 @@ function H(t) {
|
|
|
448
449
|
bgColor: "base-300",
|
|
449
450
|
theme: { dark: { bgColor: "base-600" } },
|
|
450
451
|
props: { "aria-hidden": !0 }
|
|
451
|
-
}), /* @__PURE__ */
|
|
452
|
-
component: `${
|
|
452
|
+
}), /* @__PURE__ */ R(s, {
|
|
453
|
+
component: `${y}`,
|
|
453
454
|
ai: "center",
|
|
454
455
|
gap: 2,
|
|
455
456
|
ps: 4,
|
|
@@ -457,30 +458,30 @@ function H(t) {
|
|
|
457
458
|
py: 2,
|
|
458
459
|
bb: 1,
|
|
459
460
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ L(E.Title, {
|
|
461
462
|
flex1: !0,
|
|
462
463
|
minWidth: 0,
|
|
463
464
|
m: 0,
|
|
464
465
|
fontSize: 17,
|
|
465
466
|
fontWeight: 600,
|
|
466
467
|
lineHeight: 24,
|
|
467
|
-
...
|
|
468
|
-
children:
|
|
468
|
+
...A.TRUNCATE,
|
|
469
|
+
children: l
|
|
469
470
|
}),
|
|
470
|
-
|
|
471
|
-
/* @__PURE__ */
|
|
471
|
+
d,
|
|
472
|
+
/* @__PURE__ */ L(a, {
|
|
472
473
|
type: "button",
|
|
473
|
-
component: `${
|
|
474
|
-
...
|
|
475
|
-
onClick:
|
|
476
|
-
props: { "aria-label":
|
|
477
|
-
children: /* @__PURE__ */
|
|
474
|
+
component: `${v}.list.sheet.button`,
|
|
475
|
+
...A.ICON_BUTTON,
|
|
476
|
+
onClick: c,
|
|
477
|
+
props: { "aria-label": r.localeText.close },
|
|
478
|
+
children: /* @__PURE__ */ L(G, {})
|
|
478
479
|
})
|
|
479
480
|
]
|
|
480
481
|
})]
|
|
481
482
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
ref:
|
|
483
|
+
/* @__PURE__ */ L(e, {
|
|
484
|
+
ref: h,
|
|
484
485
|
flex1: !0,
|
|
485
486
|
overflowY: "auto",
|
|
486
487
|
px: 4,
|
|
@@ -489,41 +490,41 @@ function H(t) {
|
|
|
489
490
|
overscrollBehavior: "contain",
|
|
490
491
|
touchAction: "pan-y"
|
|
491
492
|
},
|
|
492
|
-
props:
|
|
493
|
-
children:
|
|
493
|
+
props: m,
|
|
494
|
+
children: _
|
|
494
495
|
}),
|
|
495
|
-
|
|
496
|
-
component:
|
|
496
|
+
f && /* @__PURE__ */ L(s, {
|
|
497
|
+
component: y,
|
|
497
498
|
gap: 3,
|
|
498
499
|
flexShrink: 0,
|
|
499
500
|
px: 4,
|
|
500
501
|
pt: 3,
|
|
501
502
|
pb: 4,
|
|
502
503
|
bt: 1,
|
|
503
|
-
children:
|
|
504
|
+
children: f
|
|
504
505
|
})
|
|
505
506
|
]
|
|
506
|
-
});
|
|
507
|
+
}) });
|
|
507
508
|
}
|
|
508
|
-
|
|
509
|
+
K.displayName = "DataGridListSheet";
|
|
509
510
|
//#endregion
|
|
510
511
|
//#region src/components/dataGrid/components/dataGridListRecord.tsx
|
|
511
|
-
var
|
|
512
|
-
function
|
|
513
|
-
let { grid:
|
|
514
|
-
return
|
|
512
|
+
var ne = 60;
|
|
513
|
+
function re({ cell: t, index: n }) {
|
|
514
|
+
let { grid: r, column: i } = t, o = r.componentName, c = String(i.header ?? i.key), { editing: l } = t, u = P(null), d = P(!1);
|
|
515
|
+
return N(() => {
|
|
515
516
|
d.current && !l && u.current?.focus(), d.current = l;
|
|
516
|
-
}, [l]), /* @__PURE__ */
|
|
517
|
-
component: `${
|
|
517
|
+
}, [l]), /* @__PURE__ */ R(e, {
|
|
518
|
+
component: `${o}.list.sheet.line`,
|
|
518
519
|
py: 3,
|
|
519
520
|
bb: 1,
|
|
520
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ L(e, {
|
|
521
522
|
tag: "dt",
|
|
522
523
|
component: "list.muted",
|
|
523
524
|
fontSize: 13,
|
|
524
525
|
lineHeight: 18,
|
|
525
526
|
children: c
|
|
526
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ R(e, {
|
|
527
528
|
tag: "dd",
|
|
528
529
|
display: "flex",
|
|
529
530
|
ai: "center",
|
|
@@ -535,99 +536,99 @@ function ae({ cell: t, index: n }) {
|
|
|
535
536
|
fontVariantNumeric: "tabular-nums",
|
|
536
537
|
overflowWrap: "anywhere"
|
|
537
538
|
},
|
|
538
|
-
children: [l ? /* @__PURE__ */
|
|
539
|
-
component: `${
|
|
540
|
-
...
|
|
539
|
+
children: [l ? /* @__PURE__ */ L(s, {
|
|
540
|
+
component: `${o}.list.sheet.input`,
|
|
541
|
+
...A.INPUT,
|
|
541
542
|
flex1: !0,
|
|
542
543
|
ai: "center",
|
|
543
544
|
px: 1,
|
|
544
|
-
children: /* @__PURE__ */
|
|
545
|
+
children: /* @__PURE__ */ L(m, {
|
|
545
546
|
cell: t,
|
|
546
547
|
row: -1,
|
|
547
548
|
columnIndex: n
|
|
548
549
|
})
|
|
549
|
-
}) : /* @__PURE__ */
|
|
550
|
+
}) : /* @__PURE__ */ L(e, {
|
|
550
551
|
flex1: !0,
|
|
551
552
|
minWidth: 0,
|
|
552
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ L(U, {
|
|
553
554
|
row: t.row,
|
|
554
|
-
column:
|
|
555
|
+
column: i
|
|
555
556
|
})
|
|
556
|
-
}), t.editable && !l && /* @__PURE__ */
|
|
557
|
+
}), t.editable && !l && /* @__PURE__ */ L(a, {
|
|
557
558
|
ref: u,
|
|
558
559
|
type: "button",
|
|
559
|
-
component: `${
|
|
560
|
-
...
|
|
560
|
+
component: `${o}.list.sheet.button`,
|
|
561
|
+
...A.SHEET_BUTTON,
|
|
561
562
|
height: 10,
|
|
562
563
|
onClick: () => t.beginEdit(),
|
|
563
|
-
props: { "aria-label":
|
|
564
|
-
children:
|
|
564
|
+
props: { "aria-label": r.localeText.editCell(c) },
|
|
565
|
+
children: r.localeText.edit
|
|
565
566
|
})]
|
|
566
567
|
})]
|
|
567
568
|
});
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
-
let { grid:
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}, [
|
|
574
|
-
let
|
|
570
|
+
function q(n) {
|
|
571
|
+
let { grid: r } = n, { list: i } = r, o = r.componentName, l = r.localeText, d = i.record, f = i.recordPosition, { title: p } = i.layout.value, m = P(null), g = P(null), _ = d?.key;
|
|
572
|
+
N(() => {
|
|
573
|
+
g.current?.scrollTo?.({ top: 0 });
|
|
574
|
+
}, [_]);
|
|
575
|
+
let v = M(() => {
|
|
575
576
|
let e = i.record?.key;
|
|
576
|
-
|
|
577
|
-
let t =
|
|
577
|
+
r.edits.cancel(), i.closeRecord(), requestAnimationFrame(() => {
|
|
578
|
+
let t = r.sizingElement?.querySelectorAll("[data-list-key]") ?? [];
|
|
578
579
|
Array.from(t).find((t) => t.dataset.listKey === String(e))?.querySelector("[data-list-action]")?.focus();
|
|
579
580
|
});
|
|
580
|
-
}, [
|
|
581
|
-
|
|
582
|
-
}, [
|
|
581
|
+
}, [r, i]), y = M((e) => {
|
|
582
|
+
r.edits.isOpen && r.edits.commit(), r.edits.isOpen || i.stepRecord(e);
|
|
583
|
+
}, [r, i]), b = (e) => {
|
|
583
584
|
m.current = e.pointerType === "touch" ? {
|
|
584
585
|
x: e.clientX,
|
|
585
586
|
y: e.clientY
|
|
586
587
|
} : null;
|
|
587
|
-
},
|
|
588
|
+
}, x = (e) => {
|
|
588
589
|
let t = m.current;
|
|
589
590
|
if (m.current = null, !t) return;
|
|
590
|
-
let
|
|
591
|
-
Math.abs(
|
|
592
|
-
},
|
|
591
|
+
let n = e.clientX - t.x, i = e.clientY - t.y;
|
|
592
|
+
Math.abs(n) < ne || Math.abs(n) < Math.abs(i) * 1.5 || y(n < 0 === r.isRtl ? -1 : 1);
|
|
593
|
+
}, S = (e) => {
|
|
593
594
|
if (e.target.closest("input,select,textarea,[role=\"combobox\"]")) return;
|
|
594
|
-
let t =
|
|
595
|
-
(e.key === t || e.key ===
|
|
596
|
-
},
|
|
595
|
+
let t = r.isRtl ? "ArrowLeft" : "ArrowRight", n = r.isRtl ? "ArrowRight" : "ArrowLeft";
|
|
596
|
+
(e.key === t || e.key === n) && (e.preventDefault(), y(e.key === t ? 1 : -1));
|
|
597
|
+
}, C = d && f && /* @__PURE__ */ R(s, {
|
|
597
598
|
ai: "center",
|
|
598
599
|
gap: .5,
|
|
599
600
|
flexShrink: 0,
|
|
600
601
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ L(a, {
|
|
602
603
|
type: "button",
|
|
603
|
-
component: `${
|
|
604
|
-
...
|
|
604
|
+
component: `${o}.list.sheet.button`,
|
|
605
|
+
...A.ICON_BUTTON,
|
|
605
606
|
disabled: !i.hasPreviousRecord,
|
|
606
|
-
onClick: () =>
|
|
607
|
+
onClick: () => y(-1),
|
|
607
608
|
props: { "aria-label": l.previousRow },
|
|
608
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ L(h, {
|
|
609
610
|
width: "18px",
|
|
610
611
|
height: "18px",
|
|
611
612
|
rotate: 90,
|
|
612
613
|
rtl: { rotate: -90 }
|
|
613
614
|
})
|
|
614
615
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ L(e, {
|
|
616
617
|
fontSize: 13,
|
|
617
618
|
color: "base-500",
|
|
618
619
|
textWrap: "nowrap",
|
|
619
620
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
620
621
|
props: { "aria-live": "polite" },
|
|
621
|
-
children: l.recordPosition(
|
|
622
|
+
children: l.recordPosition(f.position, f.total)
|
|
622
623
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ L(a, {
|
|
624
625
|
type: "button",
|
|
625
|
-
component: `${
|
|
626
|
-
...
|
|
626
|
+
component: `${o}.list.sheet.button`,
|
|
627
|
+
...A.ICON_BUTTON,
|
|
627
628
|
disabled: !i.hasNextRecord,
|
|
628
|
-
onClick: () =>
|
|
629
|
+
onClick: () => y(1),
|
|
629
630
|
props: { "aria-label": l.nextRow },
|
|
630
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ L(h, {
|
|
631
632
|
width: "18px",
|
|
632
633
|
height: "18px",
|
|
633
634
|
rotate: -90,
|
|
@@ -635,31 +636,31 @@ function U(t) {
|
|
|
635
636
|
})
|
|
636
637
|
})
|
|
637
638
|
]
|
|
638
|
-
}),
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
grid:
|
|
641
|
-
open: !!
|
|
642
|
-
onClose:
|
|
639
|
+
}), w = r.props.def.rowDetail;
|
|
640
|
+
return /* @__PURE__ */ L(K, {
|
|
641
|
+
grid: r,
|
|
642
|
+
open: !!d,
|
|
643
|
+
onClose: v,
|
|
643
644
|
tall: !0,
|
|
644
|
-
title:
|
|
645
|
-
row:
|
|
646
|
-
column:
|
|
645
|
+
title: d && p ? /* @__PURE__ */ L(U, {
|
|
646
|
+
row: d,
|
|
647
|
+
column: p
|
|
647
648
|
}) : "",
|
|
648
|
-
actions:
|
|
649
|
-
onKeyDown:
|
|
650
|
-
bodyRef:
|
|
649
|
+
actions: C,
|
|
650
|
+
onKeyDown: S,
|
|
651
|
+
bodyRef: g,
|
|
651
652
|
bodyProps: {
|
|
652
|
-
onPointerDown:
|
|
653
|
-
onPointerUp:
|
|
653
|
+
onPointerDown: b,
|
|
654
|
+
onPointerUp: x
|
|
654
655
|
},
|
|
655
|
-
children:
|
|
656
|
-
|
|
656
|
+
children: d && /* @__PURE__ */ R(I, { children: [
|
|
657
|
+
r.props.def.rowSelection && /* @__PURE__ */ L(e, {
|
|
657
658
|
py: 3,
|
|
658
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ L(c, {
|
|
659
660
|
variant: "datagrid",
|
|
660
|
-
checked:
|
|
661
|
-
onChange:
|
|
662
|
-
label: l.selectRow(
|
|
661
|
+
checked: d.selected,
|
|
662
|
+
onChange: d.toggleSelection,
|
|
663
|
+
label: l.selectRow(d.rowIndex + 1),
|
|
663
664
|
labelProps: {
|
|
664
665
|
display: "flex",
|
|
665
666
|
ai: "center",
|
|
@@ -668,38 +669,38 @@ function U(t) {
|
|
|
668
669
|
}
|
|
669
670
|
})
|
|
670
671
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ L(e, {
|
|
672
673
|
tag: "dl",
|
|
673
674
|
m: 0,
|
|
674
675
|
children: i.recordColumns.map((e) => {
|
|
675
|
-
let t =
|
|
676
|
-
return t === -1 ? null : /* @__PURE__ */
|
|
677
|
-
cell:
|
|
676
|
+
let t = d.cells.findIndex((t) => t.column === e);
|
|
677
|
+
return t === -1 ? null : /* @__PURE__ */ L(re, {
|
|
678
|
+
cell: d.cells[t],
|
|
678
679
|
index: t
|
|
679
680
|
}, e.key);
|
|
680
681
|
})
|
|
681
682
|
}),
|
|
682
|
-
|
|
683
|
+
w && /* @__PURE__ */ R(s, {
|
|
683
684
|
d: "column",
|
|
684
685
|
gap: 2,
|
|
685
686
|
py: 3,
|
|
686
|
-
children: [/* @__PURE__ */
|
|
687
|
+
children: [/* @__PURE__ */ L(u, {
|
|
687
688
|
m: 0,
|
|
688
689
|
fontSize: 14,
|
|
689
690
|
fontWeight: 600,
|
|
690
691
|
children: l.details
|
|
691
|
-
}),
|
|
692
|
+
}), /* @__PURE__ */ L(t, { children: w.content(d.data) })]
|
|
692
693
|
})
|
|
693
694
|
] })
|
|
694
695
|
});
|
|
695
696
|
}
|
|
696
|
-
|
|
697
|
+
q.displayName = "DataGridListRecord";
|
|
697
698
|
//#endregion
|
|
698
699
|
//#region src/components/dataGrid/components/dataGridListSelectionBar.tsx
|
|
699
|
-
function
|
|
700
|
-
let { grid: n } = t,
|
|
701
|
-
return !n.props.def.rowSelection ||
|
|
702
|
-
component: `${
|
|
700
|
+
function J(t) {
|
|
701
|
+
let { grid: n } = t, r = n.componentName, i = n.localeText, o = n.selectedRows.size;
|
|
702
|
+
return !n.props.def.rowSelection || o === 0 ? null : /* @__PURE__ */ R(s, {
|
|
703
|
+
component: `${r}.list.selectionBar`,
|
|
703
704
|
position: "sticky",
|
|
704
705
|
bottom: 0,
|
|
705
706
|
zIndex: 2,
|
|
@@ -710,14 +711,14 @@ function W(t) {
|
|
|
710
711
|
fontSize: 14,
|
|
711
712
|
fontWeight: 500,
|
|
712
713
|
children: [
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ L(e, {
|
|
714
715
|
flex1: !0,
|
|
715
716
|
minWidth: 0,
|
|
716
717
|
textWrap: "nowrap",
|
|
717
718
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
718
|
-
children:
|
|
719
|
+
children: i.selectedRows(o)
|
|
719
720
|
}),
|
|
720
|
-
!n.allRowsSelected && /* @__PURE__ */
|
|
721
|
+
!n.allRowsSelected && /* @__PURE__ */ L(a, {
|
|
721
722
|
type: "button",
|
|
722
723
|
minHeight: 10,
|
|
723
724
|
px: 3,
|
|
@@ -728,9 +729,9 @@ function W(t) {
|
|
|
728
729
|
active: { bgColor: "white/15" },
|
|
729
730
|
theme: { dark: { active: { bgColor: "black/10" } } },
|
|
730
731
|
onClick: n.toggleSelectAllRows,
|
|
731
|
-
children:
|
|
732
|
+
children: i.selectAll
|
|
732
733
|
}),
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ L(a, {
|
|
734
735
|
type: "button",
|
|
735
736
|
minHeight: 10,
|
|
736
737
|
px: 3,
|
|
@@ -741,23 +742,23 @@ function W(t) {
|
|
|
741
742
|
active: { bgColor: "white/15" },
|
|
742
743
|
theme: { dark: { active: { bgColor: "black/10" } } },
|
|
743
744
|
onClick: n.clearSelection,
|
|
744
|
-
children:
|
|
745
|
+
children: i.clearSelection
|
|
745
746
|
})
|
|
746
747
|
]
|
|
747
748
|
});
|
|
748
749
|
}
|
|
749
|
-
|
|
750
|
+
J.displayName = "DataGridListSelectionBar";
|
|
750
751
|
//#endregion
|
|
751
752
|
//#region src/icons/filterIcon.tsx
|
|
752
|
-
function
|
|
753
|
-
return /* @__PURE__ */
|
|
753
|
+
function ie(e) {
|
|
754
|
+
return /* @__PURE__ */ L(i, {
|
|
754
755
|
viewBox: "0 0 24 24",
|
|
755
756
|
width: "1rem",
|
|
756
757
|
fill: "none",
|
|
757
758
|
stroke: "currentColor",
|
|
758
759
|
strokeWidth: 2,
|
|
759
760
|
...e,
|
|
760
|
-
children: /* @__PURE__ */
|
|
761
|
+
children: /* @__PURE__ */ L(r, {
|
|
761
762
|
d: "M4 6h16M7 12h10M10 18h4",
|
|
762
763
|
strokeLinecap: "round"
|
|
763
764
|
})
|
|
@@ -765,7 +766,7 @@ function G(e) {
|
|
|
765
766
|
}
|
|
766
767
|
//#endregion
|
|
767
768
|
//#region src/components/dataGrid/components/dataGridListFilter.tsx
|
|
768
|
-
var
|
|
769
|
+
var ae = 8, oe = [
|
|
769
770
|
{
|
|
770
771
|
value: "eq",
|
|
771
772
|
label: "="
|
|
@@ -795,11 +796,11 @@ var K = 8, q = [
|
|
|
795
796
|
label: "↔"
|
|
796
797
|
}
|
|
797
798
|
];
|
|
798
|
-
function
|
|
799
|
-
let { currentFilter: t } = e, n = e.grid.componentName, r = e.grid.localeText, [i, a] =
|
|
800
|
-
return /* @__PURE__ */
|
|
799
|
+
function se({ column: e }) {
|
|
800
|
+
let { currentFilter: t } = e, n = e.grid.componentName, r = e.grid.localeText, [i, a] = F(t?.type === "text" ? t.value : ""), { debounce: o } = C(t, (e) => p.textMatches(i, e), (e) => a(e?.type === "text" ? e.value : ""));
|
|
801
|
+
return /* @__PURE__ */ L(l, {
|
|
801
802
|
component: `${n}.list.sheet.input`,
|
|
802
|
-
...
|
|
803
|
+
...A.INPUT,
|
|
803
804
|
type: "search",
|
|
804
805
|
value: i,
|
|
805
806
|
placeholder: e.filterConfig?.placeholder ?? r.filterPlaceholder,
|
|
@@ -810,68 +811,68 @@ function oe({ column: e }) {
|
|
|
810
811
|
props: { "aria-label": r.filterColumn(String(e.header ?? e.key)) }
|
|
811
812
|
});
|
|
812
813
|
}
|
|
813
|
-
function
|
|
814
|
-
let { currentFilter: n } = t, r = t.grid.componentName, i = t.grid.localeText,
|
|
815
|
-
|
|
816
|
-
}, []), { debounce: m, cancel: h } =
|
|
817
|
-
|
|
818
|
-
...
|
|
814
|
+
function ce({ column: t }) {
|
|
815
|
+
let { currentFilter: n } = t, r = t.grid.componentName, i = t.grid.localeText, a = String(t.header ?? t.key), o = t.filterConfig, [c, u] = F(() => p.numberDraft(n)), d = P(c), f = M((e) => {
|
|
816
|
+
d.current = e, u(e);
|
|
817
|
+
}, []), { debounce: m, cancel: h } = C(n, (e) => p.numberMatches(c, e), (e) => f(p.numberDraft(e))), g = (e, n) => {
|
|
818
|
+
f({
|
|
819
|
+
...d.current,
|
|
819
820
|
...e
|
|
820
821
|
});
|
|
821
|
-
let r = () => t.setNumberFilter(
|
|
822
|
+
let r = () => t.setNumberFilter(d.current.operator, d.current.value, d.current.valueTo);
|
|
822
823
|
n ? m("value", r) : (h(), r());
|
|
823
|
-
}, _ = (e, t, n, i) => /* @__PURE__ */
|
|
824
|
+
}, _ = (e, t, n, i) => /* @__PURE__ */ L(l, {
|
|
824
825
|
component: `${r}.list.sheet.input`,
|
|
825
|
-
...
|
|
826
|
+
...A.INPUT,
|
|
826
827
|
type: "number",
|
|
827
828
|
value: e,
|
|
828
|
-
step:
|
|
829
|
+
step: o?.step,
|
|
829
830
|
placeholder: n,
|
|
830
831
|
onChange: (e) => g({ [i]: e.target.value }, !0),
|
|
831
832
|
props: {
|
|
832
833
|
"aria-label": t,
|
|
833
834
|
inputMode: "decimal",
|
|
834
|
-
min:
|
|
835
|
-
max:
|
|
835
|
+
min: o?.min,
|
|
836
|
+
max: o?.max
|
|
836
837
|
}
|
|
837
838
|
});
|
|
838
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ R(s, {
|
|
839
840
|
gap: 2,
|
|
840
841
|
ai: "center",
|
|
841
842
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ L(e, {
|
|
843
844
|
tag: "select",
|
|
844
845
|
component: `${r}.list.sheet.input`,
|
|
845
|
-
...
|
|
846
|
+
...A.INPUT,
|
|
846
847
|
width: 18,
|
|
847
848
|
flexShrink: 0,
|
|
848
849
|
props: {
|
|
849
|
-
value:
|
|
850
|
-
"aria-label": i.filterComparison(
|
|
850
|
+
value: c.operator,
|
|
851
|
+
"aria-label": i.filterComparison(a),
|
|
851
852
|
onChange: (e) => g({ operator: e.target.value }, !1)
|
|
852
853
|
},
|
|
853
|
-
children:
|
|
854
|
+
children: oe.map((e) => /* @__PURE__ */ L("option", {
|
|
854
855
|
value: e.value,
|
|
855
856
|
children: e.label
|
|
856
857
|
}, e.value))
|
|
857
858
|
}),
|
|
858
|
-
_(
|
|
859
|
-
|
|
859
|
+
_(c.value, c.operator === "between" ? i.filterFrom(a) : i.filterColumn(a), c.operator === "between" ? i.filterFromPlaceholder : o?.placeholder ?? i.filterValuePlaceholder, "value"),
|
|
860
|
+
c.operator === "between" && _(c.valueTo, i.filterTo(a), i.filterToPlaceholder, "valueTo")
|
|
860
861
|
]
|
|
861
862
|
});
|
|
862
863
|
}
|
|
863
|
-
function
|
|
864
|
-
let t =
|
|
865
|
-
return t ? /* @__PURE__ */
|
|
864
|
+
function le({ column: e }) {
|
|
865
|
+
let t = v(!0);
|
|
866
|
+
return t ? /* @__PURE__ */ L(t.ListDateFilter, { column: e }) : null;
|
|
866
867
|
}
|
|
867
|
-
function
|
|
868
|
-
let { currentFilter: t } = e, n = e.grid.componentName,
|
|
869
|
-
e.setMultiselectFilter(
|
|
868
|
+
function ue({ column: e }) {
|
|
869
|
+
let { currentFilter: t } = e, n = e.grid.componentName, r = e.grid.localeText, i = t?.type === "multiselect" ? t.values : [], o = e.filterOptions, [u, d] = F(""), f = (t) => {
|
|
870
|
+
e.setMultiselectFilter(i.includes(t) ? i.filter((e) => e !== t) : [...i, t]);
|
|
870
871
|
};
|
|
871
|
-
if (
|
|
872
|
+
if (o.length <= ae) return /* @__PURE__ */ L(s, {
|
|
872
873
|
flexWrap: "wrap",
|
|
873
874
|
gap: 2,
|
|
874
|
-
children:
|
|
875
|
+
children: o.map((e) => /* @__PURE__ */ L(a, {
|
|
875
876
|
type: "button",
|
|
876
877
|
component: `${n}.list.sheet.chip`,
|
|
877
878
|
display: "inline-flex",
|
|
@@ -882,28 +883,28 @@ function J({ column: e }) {
|
|
|
882
883
|
fontSize: 14,
|
|
883
884
|
cursor: "pointer",
|
|
884
885
|
onClick: () => f(e.value),
|
|
885
|
-
props: { "aria-pressed":
|
|
886
|
+
props: { "aria-pressed": i.includes(e.value) },
|
|
886
887
|
children: e.label
|
|
887
888
|
}, String(e.value)))
|
|
888
889
|
});
|
|
889
|
-
let p = u.trim().toLocaleLowerCase(), m = p ?
|
|
890
|
-
return /* @__PURE__ */
|
|
890
|
+
let p = u.trim().toLocaleLowerCase(), m = p ? o.filter((e) => e.label.toLocaleLowerCase().includes(p)) : o;
|
|
891
|
+
return /* @__PURE__ */ R(s, {
|
|
891
892
|
d: "column",
|
|
892
893
|
gap: 2,
|
|
893
|
-
children: [/* @__PURE__ */
|
|
894
|
+
children: [/* @__PURE__ */ L(l, {
|
|
894
895
|
component: `${n}.list.sheet.input`,
|
|
895
|
-
...
|
|
896
|
+
...A.INPUT,
|
|
896
897
|
type: "search",
|
|
897
898
|
value: u,
|
|
898
|
-
placeholder:
|
|
899
|
+
placeholder: r.filterSelectSearchPlaceholder,
|
|
899
900
|
onChange: (e) => d(e.target.value),
|
|
900
|
-
props: { "aria-label":
|
|
901
|
-
}), /* @__PURE__ */
|
|
901
|
+
props: { "aria-label": r.filterColumn(String(e.header ?? e.key)) }
|
|
902
|
+
}), /* @__PURE__ */ L(s, {
|
|
902
903
|
d: "column",
|
|
903
904
|
maxHeight: 64,
|
|
904
905
|
overflowY: "auto",
|
|
905
|
-
children: m.map((e) => /* @__PURE__ */
|
|
906
|
-
checked:
|
|
906
|
+
children: m.map((e) => /* @__PURE__ */ L(c, {
|
|
907
|
+
checked: i.includes(e.value),
|
|
907
908
|
onChange: () => f(e.value),
|
|
908
909
|
label: e.label,
|
|
909
910
|
labelProps: {
|
|
@@ -923,38 +924,38 @@ function Y(e) {
|
|
|
923
924
|
let { column: t } = e;
|
|
924
925
|
switch (t.filterConfig?.type) {
|
|
925
926
|
case void 0: return null;
|
|
926
|
-
case "number": return /* @__PURE__ */
|
|
927
|
-
case "multiselect": return /* @__PURE__ */
|
|
928
|
-
case "date": return /* @__PURE__ */
|
|
929
|
-
default: return /* @__PURE__ */
|
|
927
|
+
case "number": return /* @__PURE__ */ L(ce, { column: t });
|
|
928
|
+
case "multiselect": return /* @__PURE__ */ L(ue, { column: t });
|
|
929
|
+
case "date": return /* @__PURE__ */ L(le, { column: t });
|
|
930
|
+
default: return /* @__PURE__ */ L(se, { column: t });
|
|
930
931
|
}
|
|
931
932
|
}
|
|
932
933
|
Y.displayName = "DataGridListFilter";
|
|
933
934
|
//#endregion
|
|
934
935
|
//#region src/components/dataGrid/components/dataGridListFilterSheet.tsx
|
|
935
936
|
function X(t) {
|
|
936
|
-
let { grid: n } = t, { list:
|
|
937
|
-
return
|
|
937
|
+
let { grid: n } = t, { list: r } = n, i = n.componentName, o = n.localeText, c = r.activeFilters.length, l = r.filterableColumns;
|
|
938
|
+
return l.length === 0 ? null : /* @__PURE__ */ L(K, {
|
|
938
939
|
grid: n,
|
|
939
|
-
open:
|
|
940
|
-
onOpen: () =>
|
|
941
|
-
onClose: () =>
|
|
942
|
-
title:
|
|
943
|
-
trigger: ({ ref: t, props: { onClick: n, ...
|
|
940
|
+
open: r.sheet === "filter",
|
|
941
|
+
onOpen: () => r.openSheet("filter"),
|
|
942
|
+
onClose: () => r.openSheet(null),
|
|
943
|
+
title: o.filters,
|
|
944
|
+
trigger: ({ ref: t, props: { onClick: n, ...r } }) => /* @__PURE__ */ R(a, {
|
|
944
945
|
type: "button",
|
|
945
|
-
component: `${
|
|
946
|
-
variant: { active:
|
|
947
|
-
...
|
|
946
|
+
component: `${i}.list.toolbar.button`,
|
|
947
|
+
variant: { active: c > 0 },
|
|
948
|
+
...A.PILL,
|
|
948
949
|
ref: t,
|
|
949
950
|
onClick: n,
|
|
950
951
|
props: {
|
|
951
|
-
...
|
|
952
|
-
"aria-label":
|
|
952
|
+
...r,
|
|
953
|
+
"aria-label": o.filtersLabel(c)
|
|
953
954
|
},
|
|
954
955
|
children: [
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
|
|
957
|
-
|
|
956
|
+
/* @__PURE__ */ L(ie, {}),
|
|
957
|
+
o.filters,
|
|
958
|
+
c > 0 && /* @__PURE__ */ L(e, {
|
|
958
959
|
tag: "span",
|
|
959
960
|
minWidth: 5,
|
|
960
961
|
height: 5,
|
|
@@ -967,37 +968,37 @@ function X(t) {
|
|
|
967
968
|
lineHeight: 20,
|
|
968
969
|
textAlign: "center",
|
|
969
970
|
props: { "aria-hidden": !0 },
|
|
970
|
-
children:
|
|
971
|
+
children: c
|
|
971
972
|
})
|
|
972
973
|
]
|
|
973
974
|
}),
|
|
974
|
-
footer: /* @__PURE__ */
|
|
975
|
+
footer: /* @__PURE__ */ R(I, { children: [c > 0 && /* @__PURE__ */ L(a, {
|
|
975
976
|
type: "button",
|
|
976
|
-
component: `${
|
|
977
|
-
...
|
|
977
|
+
component: `${i}.list.sheet.button`,
|
|
978
|
+
...A.SHEET_BUTTON,
|
|
978
979
|
onClick: n.clearColumnFilters,
|
|
979
|
-
children:
|
|
980
|
-
}), /* @__PURE__ */
|
|
980
|
+
children: o.clearFilters
|
|
981
|
+
}), /* @__PURE__ */ L(a, {
|
|
981
982
|
type: "button",
|
|
982
|
-
component: `${
|
|
983
|
-
...
|
|
983
|
+
component: `${i}.list.sheet.primary`,
|
|
984
|
+
...A.SHEET_BUTTON,
|
|
984
985
|
flex1: !0,
|
|
985
986
|
fontWeight: 600,
|
|
986
|
-
onClick: () =>
|
|
987
|
-
children:
|
|
987
|
+
onClick: () => r.openSheet(null),
|
|
988
|
+
children: o.showRows(n.filterStats.filtered)
|
|
988
989
|
})] }),
|
|
989
|
-
children:
|
|
990
|
-
component: `${
|
|
990
|
+
children: l.map((e) => /* @__PURE__ */ R(s, {
|
|
991
|
+
component: `${i}.list.sheet.line`,
|
|
991
992
|
d: "column",
|
|
992
993
|
gap: 2,
|
|
993
994
|
py: 3,
|
|
994
995
|
bb: 1,
|
|
995
|
-
children: [/* @__PURE__ */
|
|
996
|
+
children: [/* @__PURE__ */ L(u, {
|
|
996
997
|
m: 0,
|
|
997
998
|
fontSize: 14,
|
|
998
999
|
fontWeight: 600,
|
|
999
1000
|
children: e.header ?? String(e.key)
|
|
1000
|
-
}), /* @__PURE__ */
|
|
1001
|
+
}), /* @__PURE__ */ L(Y, { column: e })]
|
|
1001
1002
|
}, e.key))
|
|
1002
1003
|
});
|
|
1003
1004
|
}
|
|
@@ -1005,8 +1006,8 @@ X.displayName = "DataGridListFilterSheet";
|
|
|
1005
1006
|
//#endregion
|
|
1006
1007
|
//#region src/components/dataGrid/components/dataGridListSortSheet.tsx
|
|
1007
1008
|
function Z(e) {
|
|
1008
|
-
let { grid: t } = e, { list: n } = t,
|
|
1009
|
-
component: `${
|
|
1009
|
+
let { grid: t } = e, { list: n } = t, r = t.componentName, i = t.localeText, o = n.sortedColumn, c = t.sortDirection === "DESC", l = `${t.identifier}-sort`, u = {
|
|
1010
|
+
component: `${r}.list.sheet.line`,
|
|
1010
1011
|
display: "flex",
|
|
1011
1012
|
ai: "center",
|
|
1012
1013
|
gap: 3,
|
|
@@ -1015,69 +1016,69 @@ function Z(e) {
|
|
|
1015
1016
|
cursor: "pointer",
|
|
1016
1017
|
bb: 1
|
|
1017
1018
|
};
|
|
1018
|
-
return /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ R(K, {
|
|
1019
1020
|
grid: t,
|
|
1020
1021
|
open: n.sheet === "sort",
|
|
1021
1022
|
onClose: () => n.openSheet(null),
|
|
1022
|
-
title:
|
|
1023
|
+
title: i.sortBy,
|
|
1023
1024
|
onOpen: () => n.openSheet("sort"),
|
|
1024
|
-
trigger: ({ ref: e, props: { onClick: t, ...n } }) => /* @__PURE__ */
|
|
1025
|
+
trigger: ({ ref: e, props: { onClick: t, ...n } }) => /* @__PURE__ */ R(a, {
|
|
1025
1026
|
type: "button",
|
|
1026
|
-
component: `${
|
|
1027
|
-
variant: { active: !!
|
|
1028
|
-
...
|
|
1027
|
+
component: `${r}.list.toolbar.button`,
|
|
1028
|
+
variant: { active: !!o },
|
|
1029
|
+
...A.PILL,
|
|
1029
1030
|
ref: e,
|
|
1030
1031
|
onClick: t,
|
|
1031
1032
|
props: n,
|
|
1032
|
-
children: [/* @__PURE__ */
|
|
1033
|
+
children: [/* @__PURE__ */ L(b, {
|
|
1033
1034
|
width: "16px",
|
|
1034
1035
|
height: "16px",
|
|
1035
1036
|
fill: "currentColor",
|
|
1036
1037
|
rotate: c ? 180 : 0
|
|
1037
|
-
}),
|
|
1038
|
+
}), o ? i.sortedBy(String(o.header ?? o.key), c) : i.sortBy]
|
|
1038
1039
|
}),
|
|
1039
|
-
footer: /* @__PURE__ */
|
|
1040
|
+
footer: /* @__PURE__ */ R(I, { children: [o && /* @__PURE__ */ L(a, {
|
|
1040
1041
|
type: "button",
|
|
1041
|
-
component: `${
|
|
1042
|
-
...
|
|
1043
|
-
onClick: () => t.setSortColumn(
|
|
1044
|
-
children:
|
|
1045
|
-
}), /* @__PURE__ */
|
|
1042
|
+
component: `${r}.list.sheet.button`,
|
|
1043
|
+
...A.SHEET_BUTTON,
|
|
1044
|
+
onClick: () => t.setSortColumn(o.key, void 0),
|
|
1045
|
+
children: i.clearSort
|
|
1046
|
+
}), /* @__PURE__ */ L(a, {
|
|
1046
1047
|
type: "button",
|
|
1047
|
-
component: `${
|
|
1048
|
-
...
|
|
1048
|
+
component: `${r}.list.sheet.primary`,
|
|
1049
|
+
...A.SHEET_BUTTON,
|
|
1049
1050
|
flex1: !0,
|
|
1050
1051
|
fontWeight: 600,
|
|
1051
1052
|
onClick: () => n.openSheet(null),
|
|
1052
|
-
children:
|
|
1053
|
+
children: i.close
|
|
1053
1054
|
})] }),
|
|
1054
|
-
children: [/* @__PURE__ */
|
|
1055
|
+
children: [/* @__PURE__ */ L(s, {
|
|
1055
1056
|
tag: "fieldset",
|
|
1056
1057
|
d: "column",
|
|
1057
1058
|
b: 0,
|
|
1058
1059
|
m: 0,
|
|
1059
1060
|
p: 0,
|
|
1060
|
-
props: { "aria-label":
|
|
1061
|
-
children: n.sortableColumns.map((e) => /* @__PURE__ */
|
|
1061
|
+
props: { "aria-label": i.sortBy },
|
|
1062
|
+
children: n.sortableColumns.map((e) => /* @__PURE__ */ L(O, {
|
|
1062
1063
|
name: l,
|
|
1063
|
-
checked:
|
|
1064
|
-
onChange: () => t.setSortColumn(e.key, c &&
|
|
1064
|
+
checked: o === e,
|
|
1065
|
+
onChange: () => t.setSortColumn(e.key, c && o ? "DESC" : "ASC"),
|
|
1065
1066
|
label: e.header ?? String(e.key),
|
|
1066
1067
|
labelProps: u
|
|
1067
1068
|
}, e.key))
|
|
1068
|
-
}),
|
|
1069
|
+
}), o && /* @__PURE__ */ L(s, {
|
|
1069
1070
|
tag: "fieldset",
|
|
1070
1071
|
d: "column",
|
|
1071
1072
|
b: 0,
|
|
1072
1073
|
m: 0,
|
|
1073
1074
|
p: 0,
|
|
1074
1075
|
pt: 4,
|
|
1075
|
-
props: { "aria-label": `${
|
|
1076
|
-
children: ["ASC", "DESC"].map((e) => /* @__PURE__ */
|
|
1076
|
+
props: { "aria-label": `${i.sortBy}: ${o.header ?? o.key}` },
|
|
1077
|
+
children: ["ASC", "DESC"].map((e) => /* @__PURE__ */ L(O, {
|
|
1077
1078
|
name: `${l}-direction`,
|
|
1078
1079
|
checked: t.sortDirection === e,
|
|
1079
|
-
onChange: () => t.setSortColumn(
|
|
1080
|
-
label: e === "ASC" ?
|
|
1080
|
+
onChange: () => t.setSortColumn(o.key, e),
|
|
1081
|
+
label: e === "ASC" ? i.ascending : i.descending,
|
|
1081
1082
|
labelProps: u
|
|
1082
1083
|
}, e))
|
|
1083
1084
|
})]
|
|
@@ -1086,24 +1087,24 @@ function Z(e) {
|
|
|
1086
1087
|
Z.displayName = "DataGridListSortSheet";
|
|
1087
1088
|
//#endregion
|
|
1088
1089
|
//#region src/components/dataGrid/components/dataGridListToolbar.tsx
|
|
1089
|
-
function
|
|
1090
|
-
let t = e.componentName, [n,
|
|
1091
|
-
return /* @__PURE__ */
|
|
1090
|
+
function de({ grid: e }) {
|
|
1091
|
+
let t = e.componentName, [n, r] = F(e.globalFilterValue), { debounce: i, cancel: o } = C(e.globalFilterValue, (e) => e === n, r);
|
|
1092
|
+
return /* @__PURE__ */ R(s, {
|
|
1092
1093
|
position: "relative",
|
|
1093
1094
|
ai: "center",
|
|
1094
1095
|
children: [
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ L(s, {
|
|
1096
1097
|
position: "absolute",
|
|
1097
1098
|
insetStart: 3.5,
|
|
1098
1099
|
pointerEvents: "none",
|
|
1099
1100
|
color: "base-500",
|
|
1100
1101
|
props: { "aria-hidden": !0 },
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1102
|
+
children: /* @__PURE__ */ L(S, {
|
|
1102
1103
|
fill: "currentColor",
|
|
1103
1104
|
width: "16px"
|
|
1104
1105
|
})
|
|
1105
1106
|
}),
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ L(l, {
|
|
1107
1108
|
component: `${t}.list.toolbar.search`,
|
|
1108
1109
|
width: "fit",
|
|
1109
1110
|
height: 11,
|
|
@@ -1117,14 +1118,14 @@ function le({ grid: e }) {
|
|
|
1117
1118
|
placeholder: e.localeText.searchPlaceholder,
|
|
1118
1119
|
onChange: (t) => {
|
|
1119
1120
|
let n = t.target.value;
|
|
1120
|
-
|
|
1121
|
+
r(n), i("value", () => e.filter.setGlobalFilter(n));
|
|
1121
1122
|
},
|
|
1122
1123
|
props: {
|
|
1123
1124
|
"aria-label": e.localeText.searchPlaceholder,
|
|
1124
1125
|
enterKeyHint: "search"
|
|
1125
1126
|
}
|
|
1126
1127
|
}),
|
|
1127
|
-
n && /* @__PURE__ */
|
|
1128
|
+
n && /* @__PURE__ */ L(a, {
|
|
1128
1129
|
type: "button",
|
|
1129
1130
|
component: `${t}.list.sheet.button`,
|
|
1130
1131
|
display: "inline-flex",
|
|
@@ -1137,17 +1138,17 @@ function le({ grid: e }) {
|
|
|
1137
1138
|
position: "absolute",
|
|
1138
1139
|
insetEnd: 2,
|
|
1139
1140
|
onClick: () => {
|
|
1140
|
-
|
|
1141
|
+
o(), r(""), e.filter.setGlobalFilter("");
|
|
1141
1142
|
},
|
|
1142
1143
|
props: { "aria-label": e.localeText.clearSearch },
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1144
|
+
children: /* @__PURE__ */ L(G, { width: "16px" })
|
|
1144
1145
|
})
|
|
1145
1146
|
]
|
|
1146
1147
|
});
|
|
1147
1148
|
}
|
|
1148
1149
|
function Q(t) {
|
|
1149
|
-
let { grid: n } = t, { list:
|
|
1150
|
-
return /* @__PURE__ */
|
|
1150
|
+
let { grid: n } = t, { list: r } = n, { def: i } = n.props, c = n.componentName, l = n.localeText, { filtered: u, total: d } = n.filterStats, f = r.activeFilters, p = r.sortableColumns.length > 0;
|
|
1151
|
+
return /* @__PURE__ */ R(s, {
|
|
1151
1152
|
component: `${c}.list.toolbar`,
|
|
1152
1153
|
d: "column",
|
|
1153
1154
|
gap: 3,
|
|
@@ -1155,61 +1156,61 @@ function Q(t) {
|
|
|
1155
1156
|
pt: 4,
|
|
1156
1157
|
pb: 3,
|
|
1157
1158
|
children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ R(s, {
|
|
1159
1160
|
ai: "center",
|
|
1160
1161
|
gap: 3,
|
|
1161
1162
|
flexWrap: "wrap",
|
|
1162
|
-
children: [/* @__PURE__ */
|
|
1163
|
+
children: [/* @__PURE__ */ R(s, {
|
|
1163
1164
|
d: "column",
|
|
1164
1165
|
flex1: !0,
|
|
1165
1166
|
minWidth: 0,
|
|
1166
|
-
children: [
|
|
1167
|
+
children: [i.title && /* @__PURE__ */ L(e, {
|
|
1167
1168
|
id: n.titleId,
|
|
1168
1169
|
fontSize: 17,
|
|
1169
1170
|
fontWeight: 600,
|
|
1170
1171
|
lineHeight: 24,
|
|
1171
|
-
children:
|
|
1172
|
-
}), /* @__PURE__ */
|
|
1172
|
+
children: i.title
|
|
1173
|
+
}), /* @__PURE__ */ L(e, {
|
|
1173
1174
|
component: `${c}.list.toolbar.count`,
|
|
1174
1175
|
fontSize: 13,
|
|
1175
1176
|
css: { fontVariantNumeric: "tabular-nums" },
|
|
1176
1177
|
children: l.rowCount(u, d)
|
|
1177
1178
|
})]
|
|
1178
|
-
}),
|
|
1179
|
+
}), i.topBar && /* @__PURE__ */ R(s, {
|
|
1179
1180
|
ai: "center",
|
|
1180
1181
|
gap: 2,
|
|
1181
1182
|
flexWrap: "wrap",
|
|
1182
|
-
children: [/* @__PURE__ */
|
|
1183
|
+
children: [/* @__PURE__ */ L(y, { grid: n }), /* @__PURE__ */ L(w, { grid: n })]
|
|
1183
1184
|
})]
|
|
1184
1185
|
}),
|
|
1185
|
-
|
|
1186
|
-
/* @__PURE__ */
|
|
1186
|
+
i.globalFilter && /* @__PURE__ */ L(de, { grid: n }),
|
|
1187
|
+
/* @__PURE__ */ R(s, {
|
|
1187
1188
|
gap: 2,
|
|
1188
1189
|
overflowX: "auto",
|
|
1189
1190
|
scrollbarWidth: "none",
|
|
1190
1191
|
mx: -4,
|
|
1191
1192
|
px: 4,
|
|
1192
1193
|
children: [
|
|
1193
|
-
p && /* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
|
|
1194
|
+
p && /* @__PURE__ */ L(Z, { grid: n }),
|
|
1195
|
+
/* @__PURE__ */ L(X, { grid: n }),
|
|
1196
|
+
i.rowSelection && /* @__PURE__ */ L(a, {
|
|
1196
1197
|
type: "button",
|
|
1197
1198
|
component: `${c}.list.toolbar.button`,
|
|
1198
|
-
...
|
|
1199
|
-
variant: { active:
|
|
1200
|
-
onClick: () =>
|
|
1201
|
-
props: { "aria-pressed":
|
|
1199
|
+
...A.PILL,
|
|
1200
|
+
variant: { active: r.selecting },
|
|
1201
|
+
onClick: () => r.setSelecting(!r.selecting),
|
|
1202
|
+
props: { "aria-pressed": r.selecting },
|
|
1202
1203
|
children: l.selectRows
|
|
1203
1204
|
})
|
|
1204
1205
|
]
|
|
1205
1206
|
}),
|
|
1206
|
-
f.length > 0 && /* @__PURE__ */
|
|
1207
|
+
f.length > 0 && /* @__PURE__ */ L(s, {
|
|
1207
1208
|
gap: 2,
|
|
1208
1209
|
overflowX: "auto",
|
|
1209
1210
|
scrollbarWidth: "none",
|
|
1210
1211
|
mx: -4,
|
|
1211
1212
|
px: 4,
|
|
1212
|
-
children: f.map((t) => /* @__PURE__ */
|
|
1213
|
+
children: f.map((t) => /* @__PURE__ */ R(e, {
|
|
1213
1214
|
tag: "span",
|
|
1214
1215
|
component: `${c}.list.toolbar.chip`,
|
|
1215
1216
|
display: "inline-flex",
|
|
@@ -1223,16 +1224,16 @@ function Q(t) {
|
|
|
1223
1224
|
fontSize: 13,
|
|
1224
1225
|
textWrap: "nowrap",
|
|
1225
1226
|
children: [
|
|
1226
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ R(e, {
|
|
1227
1228
|
tag: "span",
|
|
1228
1229
|
fontWeight: 500,
|
|
1229
1230
|
children: [t.label, ":"]
|
|
1230
1231
|
}),
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ L(e, {
|
|
1232
1233
|
tag: "span",
|
|
1233
1234
|
children: t.value
|
|
1234
1235
|
}),
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ L(a, {
|
|
1236
1237
|
type: "button",
|
|
1237
1238
|
component: `${c}.list.sheet.button`,
|
|
1238
1239
|
display: "inline-flex",
|
|
@@ -1244,13 +1245,13 @@ function Q(t) {
|
|
|
1244
1245
|
cursor: "pointer",
|
|
1245
1246
|
onClick: () => t.column.clearFilter(),
|
|
1246
1247
|
props: { "aria-label": l.clearFilter(t.label) },
|
|
1247
|
-
children: /* @__PURE__ */
|
|
1248
|
+
children: /* @__PURE__ */ L(G, { width: "14px" })
|
|
1248
1249
|
})
|
|
1249
1250
|
]
|
|
1250
1251
|
}, t.column.key))
|
|
1251
1252
|
}),
|
|
1252
|
-
|
|
1253
|
-
/* @__PURE__ */
|
|
1253
|
+
i.topBarContent && /* @__PURE__ */ L(e, { children: i.topBarContent }),
|
|
1254
|
+
/* @__PURE__ */ L(o, {
|
|
1254
1255
|
props: { role: "status" },
|
|
1255
1256
|
children: n.hasActiveFilters ? l.rowCount(u, d) : ""
|
|
1256
1257
|
})
|
|
@@ -1261,51 +1262,51 @@ Q.displayName = "DataGridListToolbar";
|
|
|
1261
1262
|
//#endregion
|
|
1262
1263
|
//#region src/components/dataGrid/components/dataGridList.tsx
|
|
1263
1264
|
function $(t) {
|
|
1264
|
-
let { grid: n } = t, { list: r, source: i } = n,
|
|
1265
|
-
return
|
|
1266
|
-
i.enabled && i.request(0, Math.max(
|
|
1265
|
+
let { grid: n } = t, { list: r, source: i } = n, a = n.componentName, o = r.visibleItems, c = n.props.loading || i.isLoading, l = n.groupColumns.size === 0 && !n.tree.enabled, u = i.enabled ? n.totalRowCount : n.filterStats.filtered, { queryVersion: d } = i;
|
|
1266
|
+
return N(() => {
|
|
1267
|
+
i.enabled && i.request(0, Math.max(o.length, 1));
|
|
1267
1268
|
}, [
|
|
1268
1269
|
i,
|
|
1269
|
-
|
|
1270
|
-
|
|
1270
|
+
d,
|
|
1271
|
+
o.length,
|
|
1271
1272
|
n.page,
|
|
1272
1273
|
n.pageSize,
|
|
1273
1274
|
n.expansionVersion
|
|
1274
|
-
]), /* @__PURE__ */
|
|
1275
|
-
component: `${
|
|
1275
|
+
]), /* @__PURE__ */ R(s, {
|
|
1276
|
+
component: `${a}.list`,
|
|
1276
1277
|
d: "column",
|
|
1277
1278
|
children: [
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
c && /* @__PURE__ */
|
|
1281
|
-
|
|
1279
|
+
/* @__PURE__ */ L(Q, { grid: n }),
|
|
1280
|
+
/* @__PURE__ */ L(g, { grid: n }),
|
|
1281
|
+
c && /* @__PURE__ */ L(f, { grid: n }),
|
|
1282
|
+
o.length === 0 ? /* @__PURE__ */ L(e, {
|
|
1282
1283
|
component: "list.muted",
|
|
1283
1284
|
px: 4,
|
|
1284
1285
|
py: 10,
|
|
1285
1286
|
textAlign: "center",
|
|
1286
1287
|
children: n.props.def.noDataComponent ?? (c ? n.localeText.loadingRows : n.localeText.noRows)
|
|
1287
|
-
}) : /* @__PURE__ */
|
|
1288
|
+
}) : /* @__PURE__ */ L(D, {
|
|
1288
1289
|
props: {
|
|
1289
1290
|
"aria-labelledby": n.props.def.title ? n.titleId : void 0,
|
|
1290
1291
|
"aria-busy": c || void 0
|
|
1291
1292
|
},
|
|
1292
|
-
children:
|
|
1293
|
+
children: o.map(({ row: e, index: t }, r) => e.kind === "group" ? /* @__PURE__ */ L(H, {
|
|
1293
1294
|
row: e,
|
|
1294
1295
|
version: n.rowVersion(e, t)
|
|
1295
|
-
}, e.key) : /* @__PURE__ */
|
|
1296
|
+
}, e.key) : /* @__PURE__ */ L(ee, {
|
|
1296
1297
|
row: e,
|
|
1297
1298
|
index: t,
|
|
1298
1299
|
position: l ? r + 1 : void 0,
|
|
1299
|
-
setSize: l ?
|
|
1300
|
+
setSize: l ? u : void 0,
|
|
1300
1301
|
version: n.rowVersion(e, t)
|
|
1301
1302
|
}, e.key))
|
|
1302
1303
|
}),
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ L(B, {
|
|
1304
1305
|
grid: n,
|
|
1305
|
-
shown: l ?
|
|
1306
|
+
shown: l ? o.length : void 0
|
|
1306
1307
|
}),
|
|
1307
|
-
/* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ L(J, { grid: n }),
|
|
1309
|
+
/* @__PURE__ */ L(q, { grid: n })
|
|
1309
1310
|
]
|
|
1310
1311
|
});
|
|
1311
1312
|
}
|