@box-kite/react 2.2.3 → 2.2.5

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