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