@box-kite/react 2.2.15 → 2.2.17
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 +1 -1
- package/.claude/skills/box-kite/SKILL.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +1 -1
- package/.cursor/rules/box-kite.mdc +1 -1
- package/AGENTS.md +1 -1
- package/BOX_AI_CONTEXT.md +16 -0
- package/BOX_KITE_AI_CONTEXT.md +16 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +16 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +1 -1
- package/client.cjs +1 -1
- package/client.mjs +10 -10
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +95 -91
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +212 -210
- package/components/chart.cjs +1 -1
- package/components/chart.d.ts +8 -3
- package/components/chart.mjs +70 -65
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +187 -186
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.d.ts +1 -44
- package/components/dashboard.mjs +202 -201
- package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
- package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
- package/components/dataGrid/models/gridModel.d.ts +1 -1
- package/components/dataGrid.cjs +2 -2
- package/components/dataGrid.mjs +10 -10
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +96 -96
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +286 -285
- package/components/dialog.cjs +1 -1
- package/components/dialog.d.ts +2 -64
- package/components/dialog.mjs +131 -126
- package/components/form.cjs +1 -1
- package/components/form.d.ts +4 -3
- package/components/form.mjs +25 -22
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -73
- package/components/menu.mjs +220 -215
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +44 -43
- package/components/popover.cjs +1 -1
- package/components/popover.d.ts +1 -41
- package/components/popover.mjs +56 -51
- package/components/presence.cjs +1 -1
- package/components/presence.mjs +1 -1
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +59 -55
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.d.ts +1 -55
- package/components/slider.mjs +92 -90
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +149 -148
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +100 -100
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +135 -132
- package/components/toaster.cjs +1 -1
- package/components/toaster.d.ts +1 -37
- package/components/toaster.mjs +130 -128
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -34
- package/components/tooltip.mjs +73 -69
- package/components/virtualList.cjs +1 -1
- package/components/virtualList.mjs +88 -87
- package/docs/props.md +2 -2
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/motion.cjs +1 -1
- package/motion.mjs +30 -20
- package/package.json +41 -40
- package/placement.cjs +1 -1
- package/placement.mjs +1 -1
- package/platform.cjs +1 -1
- package/platform.mjs +17 -14
- package/react/animation/useHeldContent.d.ts +6 -0
- package/react/animation/usePresence.d.ts +4 -0
- package/react/componentsContext.d.ts +1 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/utils/chart/chartUtils.d.ts +3 -2
- package/utils/dashboard/dashboardUtils.d.ts +1 -1
- package/utils/dom/domUtils.d.ts +6 -0
- package/create/src/agents.d.ts +0 -22
- package/create/src/agents.test.d.ts +0 -1
- package/create/src/index.d.ts +0 -1
- package/create/src/options.d.ts +0 -31
- package/create/src/options.test.d.ts +0 -1
- package/create/src/packageManager.d.ts +0 -5
- package/create/src/project.d.ts +0 -27
- package/create/src/project.test.d.ts +0 -1
- package/create/templates/ts/designs/azure.d.ts +0 -5
- package/create/templates/ts/designs/ember.d.ts +0 -5
- package/create/templates/ts/designs/mono.d.ts +0 -5
- package/create/templates/ts/src/App.d.ts +0 -2
- package/create/templates/ts/src/design.d.ts +0 -5
- package/create/templates/ts/src/main.d.ts +0 -0
- package/mcp/src/data.d.ts +0 -90
- package/mcp/src/data.test.d.ts +0 -1
- package/mcp/src/engine.d.ts +0 -23
- package/mcp/src/index.d.ts +0 -1
- package/mcp/src/search.d.ts +0 -38
- package/mcp/src/search.test.d.ts +0 -1
- package/mcp/src/server.d.ts +0 -18
- package/mcp/src/server.test.d.ts +0 -1
- package/mcp/src/styles.d.ts +0 -27
- package/mcp/src/styles.test.d.ts +0 -1
- package/mcp/src/tools.d.ts +0 -18
- package/mcp/src/vocabulary.d.ts +0 -41
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
- package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
- package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
- package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
- package/registry/blocks/settings-form/settings-form.d.ts +0 -17
- package/registry/designs/store/address-form.d.ts +0 -11
- package/registry/designs/store/cart-items.d.ts +0 -10
- package/registry/designs/store/cart-page.d.ts +0 -4
- package/registry/designs/store/checkout-page.d.ts +0 -7
- package/registry/designs/store/credit-card-form.d.ts +0 -10
- package/registry/designs/store/form-field.d.ts +0 -19
- package/registry/designs/store/order-summary.d.ts +0 -18
- package/registry/designs/store/product-art.d.ts +0 -26
- package/registry/designs/store/product-card.d.ts +0 -11
- package/registry/designs/store/product-gallery.d.ts +0 -11
- package/registry/designs/store/product-grid.d.ts +0 -10
- package/registry/designs/store/product-page.d.ts +0 -5
- package/registry/designs/store/quantity-stepper.d.ts +0 -13
- package/registry/designs/store/shipping-method.d.ts +0 -14
- package/registry/designs/store/store-data.d.ts +0 -53
- package/registry/designs/store/store-design.d.ts +0 -63
- package/registry/designs/store/store-shell.d.ts +0 -12
- package/registry/designs/store/storefront-page.d.ts +0 -4
- package/registry/designs/store/variant-picker.d.ts +0 -15
- package/supabase/functions/collect/index.d.ts +0 -30
- package/supabase/functions/collect/index.test.d.ts +0 -1
package/components/combobox.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import t from "../
|
|
4
|
-
import
|
|
5
|
-
import { t as o } from "../
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import u from "./
|
|
9
|
-
import d from "./
|
|
10
|
-
import f from "./
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
2
|
+
import { l as e } from "../platform.mjs";
|
|
3
|
+
import { n as t } from "../effects.mjs";
|
|
4
|
+
import n from "../box.mjs";
|
|
5
|
+
import { a as r, i, r as a, t as o } from "../behavior.mjs";
|
|
6
|
+
import { t as s } from "../identity.mjs";
|
|
7
|
+
import { a as c } from "../reporting.mjs";
|
|
8
|
+
import { Path as l, Svg as u } from "./svg.mjs";
|
|
9
|
+
import d from "./flex.mjs";
|
|
10
|
+
import f from "./overlay.mjs";
|
|
11
|
+
import p from "./presence.mjs";
|
|
12
|
+
import { forwardRef as m, useCallback as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
13
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
14
|
//#region src/utils/combobox/comboboxUtils.ts
|
|
14
|
-
var
|
|
15
|
+
var S;
|
|
15
16
|
(function(e) {
|
|
16
17
|
function t(e, t) {
|
|
17
18
|
return typeof e == "function" ? e(t) : t[e];
|
|
@@ -78,20 +79,20 @@ var x;
|
|
|
78
79
|
return (i === "last" ? s[s.length - 1] : s[0]) ?? -1;
|
|
79
80
|
}
|
|
80
81
|
e.activeIndexFor = m;
|
|
81
|
-
})(
|
|
82
|
-
var
|
|
82
|
+
})(S ||= {});
|
|
83
|
+
var C = S;
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region src/components/combobox/comboboxChips.tsx
|
|
85
|
-
function
|
|
86
|
+
function ee(e) {
|
|
86
87
|
let { selection: t, def: n, display: r, removeLabel: i, onRemove: a, disabled: o, variant: s } = e;
|
|
87
|
-
return /* @__PURE__ */ y
|
|
88
|
-
let t =
|
|
89
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ b(y, { children: t.map((e) => {
|
|
89
|
+
let t = C.labelOf(n, e);
|
|
90
|
+
return /* @__PURE__ */ x(d, {
|
|
90
91
|
component: "combobox.chip",
|
|
91
92
|
variant: s,
|
|
92
93
|
ai: "center",
|
|
93
94
|
gap: 1,
|
|
94
|
-
children: [r?.(e) ?? t, !o && /* @__PURE__ */
|
|
95
|
+
children: [r?.(e) ?? t, !o && /* @__PURE__ */ b(d, {
|
|
95
96
|
tag: "button",
|
|
96
97
|
component: "combobox.remove",
|
|
97
98
|
variant: s,
|
|
@@ -106,11 +107,11 @@ function C(e) {
|
|
|
106
107
|
t.stopPropagation(), a(e, t);
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ b(u, {
|
|
110
111
|
viewBox: "0 0 24 24",
|
|
111
112
|
width: "0.625rem",
|
|
112
113
|
props: { fill: "none" },
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ b(l, {
|
|
114
115
|
d: "M6 6 18 18M18 6 6 18",
|
|
115
116
|
stroke: "currentColor",
|
|
116
117
|
strokeWidth: 3,
|
|
@@ -118,7 +119,7 @@ function C(e) {
|
|
|
118
119
|
})
|
|
119
120
|
})
|
|
120
121
|
})]
|
|
121
|
-
},
|
|
122
|
+
}, C.keyOf(n, e));
|
|
122
123
|
}) });
|
|
123
124
|
}
|
|
124
125
|
//#endregion
|
|
@@ -155,25 +156,25 @@ var w;
|
|
|
155
156
|
var T = w;
|
|
156
157
|
//#endregion
|
|
157
158
|
//#region src/react/hooks/useVirtualization.ts
|
|
158
|
-
function
|
|
159
|
-
let { count:
|
|
159
|
+
function te(e) {
|
|
160
|
+
let { count: n, scrollerRef: i, itemHeight: a, viewHeight: o, overscan: s, threshold: c, enabled: l, activeIndex: u } = e, [d, f] = v({
|
|
160
161
|
top: 0,
|
|
161
162
|
at: -1
|
|
162
|
-
}), [p,
|
|
163
|
+
}), [p, m] = v({
|
|
163
164
|
itemHeight: 0,
|
|
164
165
|
viewHeight: 0
|
|
165
|
-
}),
|
|
166
|
-
|
|
167
|
-
}, []), b = T.shouldVirtualize(
|
|
168
|
-
let e = i.current, t =
|
|
166
|
+
}), g = _(null), y = h((e) => {
|
|
167
|
+
g.current = e;
|
|
168
|
+
}, []), b = T.shouldVirtualize(n, l, c), x = r(() => {
|
|
169
|
+
let e = i.current, t = g.current;
|
|
169
170
|
if (!e || !t) return;
|
|
170
171
|
let n = t.children, r = n[0], a = n[1], o = a ? a.offsetTop - r.offsetTop : r?.offsetHeight ?? 0, s = e.clientHeight;
|
|
171
|
-
|
|
172
|
+
m((e) => e.itemHeight === o && e.viewHeight === s ? e : {
|
|
172
173
|
itemHeight: o,
|
|
173
174
|
viewHeight: s
|
|
174
175
|
});
|
|
175
176
|
});
|
|
176
|
-
|
|
177
|
+
t(() => {
|
|
177
178
|
if (!b || (x(), typeof ResizeObserver > "u")) return;
|
|
178
179
|
let e = i.current;
|
|
179
180
|
if (!e) return;
|
|
@@ -181,17 +182,17 @@ function ee(t) {
|
|
|
181
182
|
return t.observe(e), () => t.disconnect();
|
|
182
183
|
}, [
|
|
183
184
|
b,
|
|
184
|
-
|
|
185
|
+
n,
|
|
185
186
|
x,
|
|
186
187
|
i
|
|
187
188
|
]);
|
|
188
|
-
let S =
|
|
189
|
+
let S = r((e) => {
|
|
189
190
|
f({
|
|
190
191
|
top: e.currentTarget.scrollTop,
|
|
191
192
|
at: u ?? -1
|
|
192
193
|
});
|
|
193
194
|
}), C = T.windowFor({
|
|
194
|
-
count:
|
|
195
|
+
count: n,
|
|
195
196
|
itemHeight: a ?? (p.itemHeight > 0 ? p.itemHeight : T.DEFAULT_ITEM_HEIGHT),
|
|
196
197
|
viewHeight: o ?? (p.viewHeight > 0 ? p.viewHeight : T.DEFAULT_VIEW_HEIGHT),
|
|
197
198
|
scrollTop: d.top,
|
|
@@ -205,7 +206,7 @@ function ee(t) {
|
|
|
205
206
|
onScroll: S
|
|
206
207
|
} : {
|
|
207
208
|
startIndex: 0,
|
|
208
|
-
endIndex:
|
|
209
|
+
endIndex: n,
|
|
209
210
|
offsetY: 0,
|
|
210
211
|
totalHeight: 0,
|
|
211
212
|
virtualized: b,
|
|
@@ -215,7 +216,7 @@ function ee(t) {
|
|
|
215
216
|
}
|
|
216
217
|
//#endregion
|
|
217
218
|
//#region src/components/combobox/comboboxListbox.tsx
|
|
218
|
-
function
|
|
219
|
+
function ne(e, t, n, r) {
|
|
219
220
|
return e ? {
|
|
220
221
|
role: "listbox",
|
|
221
222
|
"aria-labelledby": r,
|
|
@@ -223,19 +224,19 @@ function te(e, t, n, r) {
|
|
|
223
224
|
...n ? { "aria-busy": !0 } : {}
|
|
224
225
|
} : { role: "status" };
|
|
225
226
|
}
|
|
226
|
-
function
|
|
227
|
-
let { presence:
|
|
228
|
-
N.current = e,
|
|
229
|
-
}, [
|
|
227
|
+
function re(e) {
|
|
228
|
+
let { presence: t, rows: r, def: i, display: a, selection: o, multiple: s, activeIndex: c, optionId: l, rowRef: u, onSelect: p } = e, { anchorRef: m, popupRef: g, listboxId: y, labelledBy: S, loading: ee, loadingText: w, emptyText: T, createLabel: re, variant: E, itemsProps: D } = e, { virtualize: O } = e, { present: k, ref: ie, props: ae } = t, A = (e) => C.keyOf(i, e), [j, oe] = v(!1), M = h((e) => oe(e === "top"), []), N = _(null), se = h((e) => {
|
|
229
|
+
N.current = e, ie(e);
|
|
230
|
+
}, [ie]), ce = typeof O == "object" ? O : {}, { virtualized: P, startIndex: F, endIndex: le, offsetY: ue, totalHeight: de, contentRef: fe, onScroll: pe } = te({
|
|
230
231
|
count: r.length,
|
|
231
232
|
scrollerRef: N,
|
|
232
233
|
enabled: typeof O == "boolean" ? O : void 0,
|
|
233
234
|
activeIndex: c,
|
|
234
235
|
...ce
|
|
235
|
-
}), I = P ? r.slice(
|
|
236
|
-
let n = P ?
|
|
237
|
-
return /* @__PURE__ */
|
|
238
|
-
ref:
|
|
236
|
+
}), I = P ? r.slice(F, le) : r, L = (e, t) => {
|
|
237
|
+
let n = P ? F + t : t, s = e.kind === "option" && C.isSelected(o, e.row, A), f = C.isRowDisabled(i, e);
|
|
238
|
+
return /* @__PURE__ */ b(d, {
|
|
239
|
+
ref: u(n),
|
|
239
240
|
component: "combobox.item",
|
|
240
241
|
variant: [E, {
|
|
241
242
|
create: e.kind === "create",
|
|
@@ -251,76 +252,76 @@ function ne(e) {
|
|
|
251
252
|
"aria-setsize": r.length,
|
|
252
253
|
"aria-posinset": n + 1
|
|
253
254
|
} : {},
|
|
254
|
-
...
|
|
255
|
+
...f ? { "aria-disabled": !0 } : {},
|
|
255
256
|
onMouseDown: (e) => e.preventDefault(),
|
|
256
|
-
onClick: (e) => !
|
|
257
|
+
onClick: (e) => !f && p(n, e)
|
|
257
258
|
},
|
|
258
|
-
children: e.kind === "create" ? re(e.query) : a?.(e.row) ??
|
|
259
|
+
children: e.kind === "create" ? re(e.query) : a?.(e.row) ?? C.labelOf(i, e.row)
|
|
259
260
|
}, e.kind === "option" ? A(e.row) : "create");
|
|
260
261
|
};
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
ref:
|
|
263
|
-
anchor:
|
|
262
|
+
return /* @__PURE__ */ b(f, {
|
|
263
|
+
ref: g,
|
|
264
|
+
anchor: m,
|
|
264
265
|
side: "bottom",
|
|
265
266
|
align: "start",
|
|
266
267
|
offset: .5,
|
|
267
268
|
matchWidth: !0,
|
|
268
269
|
onSideChange: M,
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ x(n, {
|
|
270
271
|
ref: se,
|
|
271
272
|
component: "combobox.items",
|
|
272
273
|
...D,
|
|
273
274
|
variant: [E, {
|
|
274
|
-
closed: !
|
|
275
|
-
closedUp: !
|
|
275
|
+
closed: !k && !j,
|
|
276
|
+
closedUp: !k && j
|
|
276
277
|
}],
|
|
277
|
-
id:
|
|
278
|
+
id: y,
|
|
278
279
|
props: {
|
|
279
|
-
...
|
|
280
|
-
...
|
|
281
|
-
...P ? { onScroll:
|
|
280
|
+
...ne(r.length > 0, s, ee === !0, S),
|
|
281
|
+
...ae,
|
|
282
|
+
...P ? { onScroll: pe } : {}
|
|
282
283
|
},
|
|
283
|
-
children: [P ? /* @__PURE__ */
|
|
284
|
-
ref:
|
|
284
|
+
children: [P ? /* @__PURE__ */ b(n, {
|
|
285
|
+
ref: fe,
|
|
285
286
|
component: "combobox.window",
|
|
286
287
|
variant: E,
|
|
287
288
|
style: {
|
|
288
|
-
height:
|
|
289
|
-
paddingTop:
|
|
289
|
+
height: de,
|
|
290
|
+
paddingTop: ue
|
|
290
291
|
},
|
|
291
292
|
children: I.map(L)
|
|
292
|
-
}) : I.map(L), r.length === 0 && /* @__PURE__ */
|
|
293
|
+
}) : I.map(L), r.length === 0 && /* @__PURE__ */ b(n, {
|
|
293
294
|
component: "combobox.message",
|
|
294
295
|
variant: E,
|
|
295
|
-
children:
|
|
296
|
+
children: ee ? w : T
|
|
296
297
|
})]
|
|
297
298
|
})
|
|
298
299
|
});
|
|
299
300
|
}
|
|
300
301
|
//#endregion
|
|
301
302
|
//#region src/components/combobox.tsx
|
|
302
|
-
var
|
|
303
|
+
var E = /* @__PURE__ */ new Set([
|
|
303
304
|
" ",
|
|
304
305
|
"Home",
|
|
305
306
|
"End",
|
|
306
307
|
"ArrowLeft",
|
|
307
308
|
"ArrowRight"
|
|
308
309
|
]);
|
|
309
|
-
function
|
|
310
|
-
let { data:
|
|
311
|
-
|
|
312
|
-
}, [
|
|
313
|
-
|
|
314
|
-
}), Se =
|
|
310
|
+
function D(f, m) {
|
|
311
|
+
let { data: S, def: w, label: T, labelProps: te, placeholder: ne, name: D, disabled: O, props: k, itemsProps: ie, hideIcon: ae, filter: A = C.filterRows, loading: j, loadingText: oe = "Loading...", emptyText: M = "No results", createRow: N, createLabel: se = (e) => `Create "${e}"`, removeLabel: ce = (e) => `Remove ${e}`, virtualize: P, query: F, defaultQuery: le, onQueryChange: ue, open: de, defaultOpen: fe, onOpenChange: pe, multiple: I = !1, value: L, defaultValue: me, onValueChange: he, ...R } = f, z = s("combobox"), B = R.id ?? `${z}-field`, ge = `${z}-listbox`, V = `${z}-label`, H = T != null && T !== !1, _e = h((e) => `${z}-option-${e}`, [z]), U = _(null), ve = _(null), ye = _(null), be = h((t) => {
|
|
312
|
+
ye.current = t, e(m, t);
|
|
313
|
+
}, [m]), xe = r((e, t) => {
|
|
314
|
+
he?.(I ? e : e[0] ?? null, t);
|
|
315
|
+
}), Se = g(() => L === void 0 ? void 0 : C.toArray(L), [L]), [W, Ce] = c({
|
|
315
316
|
value: Se,
|
|
316
|
-
defaultValue: () =>
|
|
317
|
+
defaultValue: () => C.toArray(me),
|
|
317
318
|
onChange: xe,
|
|
318
319
|
interaction: {
|
|
319
320
|
component: "combobox",
|
|
320
321
|
type: "valueChange",
|
|
321
322
|
content: ["value"]
|
|
322
323
|
}
|
|
323
|
-
}), [
|
|
324
|
+
}), [G, K] = c({
|
|
324
325
|
value: de,
|
|
325
326
|
defaultValue: fe ?? !1,
|
|
326
327
|
onChange: pe,
|
|
@@ -328,165 +329,165 @@ function E(d, p) {
|
|
|
328
329
|
component: "combobox",
|
|
329
330
|
type: "openChange"
|
|
330
331
|
}
|
|
331
|
-
}), [we,
|
|
332
|
-
value:
|
|
332
|
+
}), [we, q] = i({
|
|
333
|
+
value: F,
|
|
333
334
|
defaultValue: le ?? "",
|
|
334
335
|
onChange: ue
|
|
335
|
-
}), [
|
|
336
|
-
data:
|
|
336
|
+
}), [Te, J] = v(!1), Y = h((e) => C.keyOf(w, e), [w]), Ee = I || W[0] === void 0 ? "" : C.labelOf(w, W[0]), X = Te || we !== "" ? we : Ee, Z = g(() => C.rowsFor({
|
|
337
|
+
data: S,
|
|
337
338
|
def: w,
|
|
338
339
|
query: X,
|
|
339
|
-
filter:
|
|
340
|
-
typed:
|
|
341
|
-
createRow:
|
|
340
|
+
filter: A,
|
|
341
|
+
typed: Te,
|
|
342
|
+
createRow: N
|
|
342
343
|
}), [
|
|
343
|
-
|
|
344
|
+
S,
|
|
344
345
|
w,
|
|
345
346
|
X,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
]),
|
|
350
|
-
|
|
347
|
+
A,
|
|
348
|
+
Te,
|
|
349
|
+
N
|
|
350
|
+
]), De = h((e) => Z[e] ? C.isRowDisabled(w, Z[e]) : !1, [Z, w]), Oe = r((e, t) => {
|
|
351
|
+
K(!1, {
|
|
351
352
|
reason: e,
|
|
352
353
|
event: t
|
|
353
|
-
}), e !== "escape" && (J(!1),
|
|
354
|
+
}), e !== "escape" && (J(!1), q("", {
|
|
354
355
|
reason: "close",
|
|
355
356
|
event: t
|
|
356
357
|
}));
|
|
357
|
-
}), Q =
|
|
358
|
+
}), Q = r((e, t) => {
|
|
358
359
|
let n = Z[e];
|
|
359
|
-
if (!n ||
|
|
360
|
-
let r = n.kind === "create" ?
|
|
360
|
+
if (!n || De(e)) return;
|
|
361
|
+
let r = n.kind === "create" ? N?.(n.query) : n.row;
|
|
361
362
|
if (r == null) return;
|
|
362
|
-
let i =
|
|
363
|
-
Ce(
|
|
363
|
+
let i = C.isSelected(W, r, Y), a = n.kind === "create" ? "create" : i && I ? "deselect" : "select";
|
|
364
|
+
Ce(C.toggle(W, r, I, Y), {
|
|
364
365
|
reason: a,
|
|
365
366
|
event: t
|
|
366
|
-
}), J(!1),
|
|
367
|
+
}), J(!1), q("", {
|
|
367
368
|
reason: "select",
|
|
368
369
|
event: t
|
|
369
|
-
}),
|
|
370
|
+
}), I || K(!1, {
|
|
370
371
|
reason: "select",
|
|
371
372
|
event: t
|
|
372
373
|
});
|
|
373
|
-
}),
|
|
374
|
+
}), ke = o({
|
|
374
375
|
count: Z.length,
|
|
375
376
|
focusItems: !1,
|
|
376
377
|
defaultActiveIndex: -1,
|
|
377
|
-
isDisabled:
|
|
378
|
+
isDisabled: De,
|
|
378
379
|
onSelect: Q
|
|
379
|
-
}), { activeIndex: $, setActiveIndex:
|
|
380
|
-
|
|
381
|
-
enabled:
|
|
382
|
-
inside: [
|
|
383
|
-
onDismiss: (e, t) =>
|
|
384
|
-
}),
|
|
385
|
-
!
|
|
380
|
+
}), { activeIndex: $, setActiveIndex: Ae, activeItem: je } = ke;
|
|
381
|
+
a({
|
|
382
|
+
enabled: G,
|
|
383
|
+
inside: [U, ve],
|
|
384
|
+
onDismiss: (e, t) => Oe(e === "escape" ? "escape" : "outside-pointer", t)
|
|
385
|
+
}), t(() => {
|
|
386
|
+
!G || $ === -1 || je()?.scrollIntoView?.({ block: "nearest" });
|
|
386
387
|
}, [
|
|
387
|
-
|
|
388
|
+
G,
|
|
388
389
|
$,
|
|
389
|
-
|
|
390
|
+
je
|
|
390
391
|
]);
|
|
391
|
-
let
|
|
392
|
-
|
|
392
|
+
let Me = (e, t, n) => {
|
|
393
|
+
K(!0, {
|
|
393
394
|
reason: n,
|
|
394
395
|
event: t
|
|
395
396
|
});
|
|
396
|
-
let r = e === "none" ? -1 :
|
|
397
|
-
|
|
397
|
+
let r = e === "none" ? -1 : C.activeIndexFor(Z, W, w, e);
|
|
398
|
+
Ae(r, {
|
|
398
399
|
reason: "programmatic",
|
|
399
400
|
event: t
|
|
400
401
|
});
|
|
401
|
-
},
|
|
402
|
-
J(!0),
|
|
402
|
+
}, Ne = r((e) => {
|
|
403
|
+
J(!0), q(e.target.value, {
|
|
403
404
|
reason: "input",
|
|
404
405
|
event: e
|
|
405
|
-
}),
|
|
406
|
+
}), G || K(!0, {
|
|
406
407
|
reason: "input",
|
|
407
408
|
event: e
|
|
408
|
-
}),
|
|
409
|
+
}), Ae(-1, {
|
|
409
410
|
reason: "programmatic",
|
|
410
411
|
event: e
|
|
411
412
|
});
|
|
412
|
-
}),
|
|
413
|
-
Ce(
|
|
413
|
+
}), Pe = r((e, t) => {
|
|
414
|
+
Ce(W.filter((t) => Y(t) !== Y(e)), {
|
|
414
415
|
reason: "remove",
|
|
415
416
|
event: t
|
|
416
417
|
});
|
|
417
|
-
}),
|
|
418
|
+
}), Fe = (e) => {
|
|
418
419
|
let { key: t } = e;
|
|
419
420
|
if (t === "ArrowDown" || t === "ArrowUp") {
|
|
420
|
-
e.preventDefault(),
|
|
421
|
+
e.preventDefault(), Me(t === "ArrowUp" ? "last" : e.altKey ? "none" : "first", e, "trigger");
|
|
421
422
|
return;
|
|
422
423
|
}
|
|
423
|
-
t === "Escape" && X !== "" && (J(!0),
|
|
424
|
+
t === "Escape" && X !== "" && (J(!0), q("", {
|
|
424
425
|
reason: "clear",
|
|
425
426
|
event: e
|
|
426
427
|
}));
|
|
427
|
-
},
|
|
428
|
-
if (
|
|
429
|
-
if (e.key === "Backspace" &&
|
|
430
|
-
|
|
428
|
+
}, Ie = r((e) => {
|
|
429
|
+
if (k?.onKeyDown?.(e), !(e.defaultPrevented || O)) {
|
|
430
|
+
if (e.key === "Backspace" && I && X === "" && W.length > 0) {
|
|
431
|
+
Pe(W[W.length - 1], e);
|
|
431
432
|
return;
|
|
432
433
|
}
|
|
433
|
-
if (!
|
|
434
|
-
|
|
434
|
+
if (!G) {
|
|
435
|
+
Fe(e);
|
|
435
436
|
return;
|
|
436
437
|
}
|
|
437
438
|
if (e.key === "Tab") {
|
|
438
|
-
$ !== -1 && Q($, e),
|
|
439
|
+
$ !== -1 && Q($, e), Oe("tab", e);
|
|
439
440
|
return;
|
|
440
441
|
}
|
|
441
442
|
if (e.altKey && e.key === "ArrowUp") {
|
|
442
|
-
e.preventDefault(), $ === -1 ?
|
|
443
|
+
e.preventDefault(), $ === -1 ? Oe("trigger", e) : Q($, e);
|
|
443
444
|
return;
|
|
444
445
|
}
|
|
445
|
-
if (
|
|
446
|
-
|
|
446
|
+
if (E.has(e.key)) {
|
|
447
|
+
Ae(-1, {
|
|
447
448
|
reason: "programmatic",
|
|
448
449
|
event: e
|
|
449
450
|
});
|
|
450
451
|
return;
|
|
451
452
|
}
|
|
452
|
-
|
|
453
|
+
ke.onKeyDown(e);
|
|
453
454
|
}
|
|
454
|
-
}),
|
|
455
|
-
!
|
|
456
|
-
}),
|
|
457
|
-
|
|
458
|
-
}),
|
|
455
|
+
}), Le = r((e) => {
|
|
456
|
+
!O && !G && Me("first", e, "trigger");
|
|
457
|
+
}), Re = r((e) => {
|
|
458
|
+
O || e.target === ye.current || (e.preventDefault(), ye.current?.focus(), G || Me("first", e, "trigger"));
|
|
459
|
+
}), ze = Z.length > 0 || j === !0 || M !== null, Be = G && $ !== -1 && Z.length > 0 ? _e($) : void 0, Ve = /* @__PURE__ */ b(n, {
|
|
459
460
|
tag: "input",
|
|
460
461
|
component: "combobox.field",
|
|
461
462
|
ref: be,
|
|
462
|
-
id:
|
|
463
|
-
disabled:
|
|
463
|
+
id: B,
|
|
464
|
+
disabled: O,
|
|
464
465
|
props: {
|
|
465
|
-
...
|
|
466
|
+
...k,
|
|
466
467
|
role: "combobox",
|
|
467
468
|
"aria-autocomplete": "list",
|
|
468
|
-
"aria-expanded":
|
|
469
|
-
"aria-controls":
|
|
470
|
-
"aria-activedescendant":
|
|
471
|
-
"aria-labelledby":
|
|
469
|
+
"aria-expanded": G,
|
|
470
|
+
"aria-controls": G && ze ? ge : void 0,
|
|
471
|
+
"aria-activedescendant": Be,
|
|
472
|
+
"aria-labelledby": H ? V : k?.["aria-labelledby"],
|
|
472
473
|
autoComplete: "off",
|
|
473
474
|
spellCheck: !1,
|
|
474
475
|
type: "text",
|
|
475
476
|
value: X,
|
|
476
|
-
placeholder:
|
|
477
|
-
onChange:
|
|
478
|
-
onKeyDown:
|
|
479
|
-
onClick:
|
|
477
|
+
placeholder: ne,
|
|
478
|
+
onChange: Ne,
|
|
479
|
+
onKeyDown: Ie,
|
|
480
|
+
onClick: Le
|
|
480
481
|
}
|
|
481
|
-
}),
|
|
482
|
+
}), He = !ae && /* @__PURE__ */ b(d, {
|
|
482
483
|
component: "combobox.icon",
|
|
483
|
-
rotate:
|
|
484
|
+
rotate: G ? 180 : 0,
|
|
484
485
|
props: { "aria-hidden": !0 },
|
|
485
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ b(u, {
|
|
486
487
|
viewBox: "0 0 10 6",
|
|
487
488
|
width: "0.6rem",
|
|
488
489
|
props: { fill: "none" },
|
|
489
|
-
children: /* @__PURE__ */
|
|
490
|
+
children: /* @__PURE__ */ b(l, {
|
|
490
491
|
d: "m1 1 4 4 4-4",
|
|
491
492
|
stroke: "currentColor",
|
|
492
493
|
strokeWidth: 2,
|
|
@@ -494,80 +495,80 @@ function E(d, p) {
|
|
|
494
495
|
strokeLinejoin: "round"
|
|
495
496
|
})
|
|
496
497
|
})
|
|
497
|
-
}),
|
|
498
|
+
}), Ue = D === void 0 ? null : W.map((e) => /* @__PURE__ */ b(n, {
|
|
498
499
|
tag: "input",
|
|
499
500
|
props: {
|
|
500
501
|
type: "hidden",
|
|
501
|
-
name:
|
|
502
|
+
name: D,
|
|
502
503
|
value: String(Y(e))
|
|
503
504
|
}
|
|
504
|
-
}, Y(e))),
|
|
505
|
-
present:
|
|
506
|
-
children: (e) => /* @__PURE__ */
|
|
505
|
+
}, Y(e))), We = ze && /* @__PURE__ */ b(p, {
|
|
506
|
+
present: G,
|
|
507
|
+
children: (e) => /* @__PURE__ */ b(re, {
|
|
507
508
|
presence: e,
|
|
508
509
|
rows: Z,
|
|
509
510
|
def: w,
|
|
510
511
|
display: w.display,
|
|
511
|
-
selection:
|
|
512
|
-
multiple:
|
|
512
|
+
selection: W,
|
|
513
|
+
multiple: I,
|
|
513
514
|
activeIndex: $,
|
|
514
|
-
optionId:
|
|
515
|
-
rowRef: (e) =>
|
|
515
|
+
optionId: _e,
|
|
516
|
+
rowRef: (e) => ke.itemProps(e).ref,
|
|
516
517
|
onSelect: Q,
|
|
517
|
-
anchorRef:
|
|
518
|
-
popupRef:
|
|
518
|
+
anchorRef: U,
|
|
519
|
+
popupRef: ve,
|
|
519
520
|
listboxId: ge,
|
|
520
|
-
labelledBy:
|
|
521
|
-
loading:
|
|
521
|
+
labelledBy: H ? V : B,
|
|
522
|
+
loading: j,
|
|
522
523
|
loadingText: oe,
|
|
523
|
-
emptyText:
|
|
524
|
-
createLabel:
|
|
525
|
-
virtualize:
|
|
524
|
+
emptyText: M,
|
|
525
|
+
createLabel: se,
|
|
526
|
+
virtualize: P,
|
|
526
527
|
variant: R.variant,
|
|
527
528
|
itemsProps: ie
|
|
528
529
|
})
|
|
529
|
-
}),
|
|
530
|
-
ref:
|
|
530
|
+
}), Ge = /* @__PURE__ */ x(d, {
|
|
531
|
+
ref: U,
|
|
531
532
|
component: "combobox",
|
|
532
533
|
ai: "center",
|
|
533
534
|
gap: 1,
|
|
534
535
|
flexWrap: "wrap",
|
|
535
536
|
...R,
|
|
536
|
-
props: { onPointerDown:
|
|
537
|
+
props: { onPointerDown: Re },
|
|
537
538
|
children: [
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
selection:
|
|
539
|
+
Ue,
|
|
540
|
+
I && /* @__PURE__ */ b(ee, {
|
|
541
|
+
selection: W,
|
|
541
542
|
def: w,
|
|
542
543
|
display: w.display,
|
|
543
|
-
removeLabel:
|
|
544
|
-
onRemove:
|
|
545
|
-
disabled:
|
|
544
|
+
removeLabel: ce,
|
|
545
|
+
onRemove: Pe,
|
|
546
|
+
disabled: O,
|
|
546
547
|
variant: R.variant
|
|
547
548
|
}),
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
Ve,
|
|
550
|
+
He
|
|
550
551
|
]
|
|
551
552
|
});
|
|
552
|
-
return
|
|
553
|
+
return H ? /* @__PURE__ */ x(d, {
|
|
553
554
|
d: "column",
|
|
554
555
|
gap: 1,
|
|
555
556
|
width: "fit-content",
|
|
556
557
|
children: [
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ b(n, {
|
|
558
559
|
tag: "label",
|
|
559
560
|
component: "combobox.label",
|
|
560
|
-
id:
|
|
561
|
-
...
|
|
562
|
-
props: { htmlFor:
|
|
561
|
+
id: V,
|
|
562
|
+
...te,
|
|
563
|
+
props: { htmlFor: B },
|
|
563
564
|
children: T
|
|
564
565
|
}),
|
|
565
|
-
|
|
566
|
-
|
|
566
|
+
Ge,
|
|
567
|
+
We
|
|
567
568
|
]
|
|
568
|
-
}) : /* @__PURE__ */
|
|
569
|
+
}) : /* @__PURE__ */ x(y, { children: [Ge, We] });
|
|
569
570
|
}
|
|
570
|
-
var
|
|
571
|
-
|
|
571
|
+
var O = m(D);
|
|
572
|
+
O.displayName = "Combobox";
|
|
572
573
|
//#endregion
|
|
573
|
-
export {
|
|
574
|
+
export { C as ComboboxUtils, O as default };
|