@slotted/react 0.1.0-beta.1 → 0.1.0-beta.2
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/README.md +4 -0
- package/dist/{action-sheet-D8Glxl7l.js → action-sheet-DgwzC3iY.js} +1 -1
- package/dist/action-sheet.js +1 -1
- package/dist/{chart-BNzfIfQe.js → chart-Gb_P3Kdq.js} +344 -333
- package/dist/chart.js +1 -1
- package/dist/{column-manager-CNZ7Xk5_.js → column-manager-B7_a_jDK.js} +1 -1
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-C46GRqAA.js → combobox-C66dNlMR.js} +176 -172
- package/dist/combobox.js +1 -1
- package/dist/dashboard-grid-CKdyO4j6.js +1043 -0
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-BUgOJuGp.js → data-grid-rWMDNl-6.js} +2 -2
- package/dist/data-grid.js +1 -1
- package/dist/docs/AGENTS.snippet.md +10 -0
- package/dist/docs/event-calendar.json +7 -0
- package/dist/docs/event-calendar.md +1 -0
- package/dist/docs/guidelines/README.md +27 -0
- package/dist/docs/guidelines/async-feedback.md +108 -0
- package/dist/docs/guidelines/browsing.md +74 -0
- package/dist/docs/guidelines/builders.md +97 -0
- package/dist/docs/guidelines/composition.md +129 -0
- package/dist/docs/guidelines/conversations.md +59 -0
- package/dist/docs/guidelines/errors-and-conflicts.md +71 -0
- package/dist/docs/guidelines/forms.md +192 -0
- package/dist/docs/guidelines/index.md +121 -0
- package/dist/docs/guidelines/layout-alignment.md +95 -0
- package/dist/docs/guidelines/ledgers.md +45 -0
- package/dist/docs/guidelines/list-pages.md +165 -0
- package/dist/docs/guidelines/overviews.md +66 -0
- package/dist/docs/guidelines/own-elements.md +115 -0
- package/dist/docs/guidelines/reading-permissions.md +55 -0
- package/dist/docs/guidelines/record-pages.md +178 -0
- package/dist/docs/guidelines/reports.md +123 -0
- package/dist/docs/guidelines/shell-composition.md +94 -0
- package/dist/docs/guidelines/workspaces.md +46 -0
- package/dist/docs/index.md +12 -0
- package/dist/docs/progress-indicator.json +1 -2
- package/dist/docs/progress-indicator.md +2 -2
- package/dist/docs/skills/build-own-element/SKILL.md +90 -0
- package/dist/docs/skills/compose-screen/SKILL.md +76 -0
- package/dist/docs/skills/index.md +9 -0
- package/dist/docs/skills/review-screen/SKILL.md +70 -0
- package/dist/docs/skills/theme-app/SKILL.md +74 -0
- package/dist/docs/skills/waiting-states/SKILL.md +139 -0
- package/dist/docs/stat-card.json +1 -0
- package/dist/docs/stat-card.md +1 -1
- package/dist/docs/tabs.json +1 -4
- package/dist/docs/tabs.md +1 -1
- package/dist/docs/tokens.md +424 -0
- package/dist/{drawer-Ci3wuCVa.js → drawer-Dtospdqk.js} +1 -1
- package/dist/drawer.js +1 -1
- package/dist/{entity-picker-UGhbVwkC.js → entity-picker-Dm-y0RNE.js} +1 -1
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-BFdeGfC-.js → event-calendar-DYjVwTI6.js} +387 -386
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-b2Q9BZHf.js → filter-bar-Bh7cbqDE.js} +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-D8xbCLWs.js → import-export-center-CkZ_Ar9w.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +14 -14
- package/dist/{multi-select-CfzsvAeI.js → multi-select-B-tuIwAu.js} +226 -231
- package/dist/multi-select.js +1 -1
- package/dist/{select-UTwKjheK.js → select-hRFp8nCj.js} +128 -141
- package/dist/select.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table-CzBIw9ng.js → table-Bd79IwDC.js} +1 -1
- package/dist/table.js +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/combobox/combobox-collection.d.ts +1 -0
- package/dist/types/combobox/combobox-collection.d.ts.map +1 -1
- package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
- package/dist/types/combobox/combobox.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
- package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
- package/dist/types/event-calendar/event-calendar.d.ts +1 -1
- package/dist/types/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/types/event-calendar/event-calendar.types.d.ts +6 -0
- package/dist/types/event-calendar/event-calendar.types.d.ts.map +1 -1
- package/dist/types/menu/menu.types.d.ts +3 -1
- package/dist/types/menu/menu.types.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-collection.d.ts +0 -2
- package/dist/types/multi-select/multi-select-collection.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select.d.ts.map +1 -1
- package/dist/types/select/select-collection.d.ts +0 -2
- package/dist/types/select/select-collection.d.ts.map +1 -1
- package/dist/types/select/select.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/dashboard-grid-nfhEewA4.js +0 -1005
package/dist/chart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./chart-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./chart-Gb_P3Kdq.js";
|
|
2
2
|
export { n as Chart, t as ChartDefaultsProvider, r as ChartTooltipContent, i as preloadChartEngine, e as useChartDefaults };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e, t } from "./icon-T9Yt4tnm.js";
|
|
2
2
|
import { _ as n, c as r, n as i, t as a } from "./menu-parts-BQej6eU9.js";
|
|
3
3
|
import { r as o } from "./i18n-DpW8lqJ1.js";
|
|
4
|
-
import { d as s, o as c, u as l } from "./drawer-
|
|
4
|
+
import { d as s, o as c, u as l } from "./drawer-Dtospdqk.js";
|
|
5
5
|
import { n as u } from "./icon-button-TnvMhK4o.js";
|
|
6
6
|
import { t as d } from "./checkbox-CwUOc-3u.js";
|
|
7
7
|
import { t as f } from "./text-field-BktZbmzD.js";
|
package/dist/column-manager.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./column-manager-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./column-manager-B7_a_jDK.js";
|
|
2
2
|
export { i as ColumnManager, t as ColumnManagerProvider, n as ColumnManagerRoot, r as ColumnManagerTrigger, e as useColumnManagerDefaults };
|
|
@@ -11,10 +11,10 @@ import { createPortalRoot as S, setPortalContainer as C } from "@slotted/core/po
|
|
|
11
11
|
import { createDismissableLayer as w, pressOrigin as T } from "@slotted/core/dismissable-layer";
|
|
12
12
|
import { createPositioner as ee } from "@slotted/core/positioner";
|
|
13
13
|
import { comboboxMessages as E } from "@slotted/core/i18n";
|
|
14
|
-
import { createFilter as te, moveIndex as D } from "@slotted/core/collection";
|
|
15
|
-
import { matchRanges as
|
|
14
|
+
import { createFilter as te, moveIndex as D, revealWithin as O } from "@slotted/core/collection";
|
|
15
|
+
import { matchRanges as k } from "@slotted/core/highlight";
|
|
16
16
|
//#region src/combobox/combobox-defaults.tsx
|
|
17
|
-
var
|
|
17
|
+
var A = {
|
|
18
18
|
align: "start",
|
|
19
19
|
alignOffset: 0,
|
|
20
20
|
allowsCustomValue: !1,
|
|
@@ -45,12 +45,12 @@ var k = {
|
|
|
45
45
|
strategy: "absolute",
|
|
46
46
|
variant: "outline",
|
|
47
47
|
width: "content"
|
|
48
|
-
},
|
|
49
|
-
function
|
|
50
|
-
return u(
|
|
48
|
+
}, j = c(A);
|
|
49
|
+
function M() {
|
|
50
|
+
return u(j);
|
|
51
51
|
}
|
|
52
52
|
function ne({ children: e, container: t, ...n }) {
|
|
53
|
-
let r =
|
|
53
|
+
let r = M();
|
|
54
54
|
d(() => {
|
|
55
55
|
if (t !== void 0) return C(t), () => C(null);
|
|
56
56
|
}, [t]);
|
|
@@ -86,7 +86,7 @@ function ne({ children: e, container: t, ...n }) {
|
|
|
86
86
|
variant: n.variant ?? r.variant,
|
|
87
87
|
width: n.width ?? r.width
|
|
88
88
|
};
|
|
89
|
-
return /* @__PURE__ */ y(
|
|
89
|
+
return /* @__PURE__ */ y(j.Provider, {
|
|
90
90
|
value: i,
|
|
91
91
|
children: e
|
|
92
92
|
});
|
|
@@ -94,119 +94,119 @@ function ne({ children: e, container: t, ...n }) {
|
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/combobox/combobox.tsx
|
|
96
96
|
var re = c(void 0);
|
|
97
|
-
function
|
|
97
|
+
function N() {
|
|
98
98
|
let e = u(re);
|
|
99
99
|
if (e === void 0) throw Error("ComboboxInput, ComboboxContent and every option have to be inside a Combobox.");
|
|
100
100
|
return e;
|
|
101
101
|
}
|
|
102
|
-
var
|
|
102
|
+
var P = (e) => "options" in e;
|
|
103
103
|
function ie(e) {
|
|
104
|
-
return e === void 0 ? [] : e.flatMap((e) =>
|
|
104
|
+
return e === void 0 ? [] : e.flatMap((e) => P(e) ? e.options : [e]);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
let U =
|
|
108
|
-
|
|
106
|
+
function F({ align: e, alignOffset: t, allowsCustomValue: n, autocomplete: o, autoHighlight: c, children: u, clearable: d, closeOnEscape: m, closeOnOutsidePress: v, closeOnSelect: b, collisionPadding: x, onCreate: S, defaultHighlightedValue: C = null, defaultInputValue: w = "", defaultOpen: T = !1, defaultValue: ee = null, disabled: D, filter: k, flip: A, form: j, fullWidth: ne, hideWhenDetached: N, highlightedValue: P, highlightMatch: F, inputValue: ae, invalid: oe, items: I, loading: L, locale: R, loop: z, messages: B, mount: se, name: ce, onHighlightedValueChange: le, onInputValueChange: ue, onInputReset: V, onLoadMore: de, onOpenChange: fe, onValueChange: pe, open: H, openOn: me, portal: he, readOnly: ge, ref: _e, required: ve, shift: ye, side: be, sideOffset: xe, size: Se, strategy: Ce, total: we, value: Te, variant: Ee, width: De }) {
|
|
107
|
+
let U = M(), W = a(), Oe = i(E, B), ke = r(), Ae = R ?? ke, je = f(), Me = `${je}listbox`, Ne = `${je}input`, [Pe, Fe] = _(T), [Ie, Le] = _(ee), [Re, ze] = _(w), [Be, Ve] = _(C), [He, Ue] = _(null), [G, We] = _(null), Ge = D ?? W?.disabled ?? U.disabled, Ke = ge ?? W?.readOnly ?? U.readOnly, K = (H ?? Pe) && !Ge, q = Te === void 0 ? Ie : Te, J = ae ?? Re, qe = P === void 0 ? Be : P, Je = g(K);
|
|
108
|
+
K && (Je.current = !0);
|
|
109
109
|
let Ye = g("none"), [Xe, Ze] = _(null), Qe = g(!1), $e = g(/* @__PURE__ */ new Map()), [et, tt] = _(0), nt = h(() => {
|
|
110
110
|
let e = /* @__PURE__ */ new Map();
|
|
111
|
-
for (let t of ie(
|
|
111
|
+
for (let t of ie(I)) e.set(t.value, t.label);
|
|
112
112
|
return e;
|
|
113
|
-
}, [
|
|
113
|
+
}, [I]), rt = l((e, t) => {
|
|
114
114
|
$e.current.get(e) !== t && ($e.current.set(e, t), tt((e) => e + 1));
|
|
115
|
-
}, []), it = l((e) => nt.get(e) ?? $e.current.get(e), [nt, et]), at = l((e) => `${
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
]),
|
|
115
|
+
}, []), it = l((e) => nt.get(e) ?? $e.current.get(e), [nt, et]), at = l((e) => `${je}option-${encodeURIComponent(e)}`, [je]), Y = J === (q === null ? void 0 : it(q)) ? "" : J, X = h(() => te({ locale: Ae }), [Ae]), ot = l((e) => Y === "" || k === null ? !0 : k === void 0 ? X.contains(e, Y) : k(e, Y), [
|
|
116
|
+
X,
|
|
117
|
+
k,
|
|
118
|
+
Y
|
|
119
|
+
]), Z = g({
|
|
120
120
|
currentHighlighted: qe,
|
|
121
|
-
currentInput:
|
|
122
|
-
currentOpen:
|
|
123
|
-
currentValue:
|
|
124
|
-
highlightedValue:
|
|
125
|
-
inputNode:
|
|
126
|
-
inputValue:
|
|
121
|
+
currentInput: J,
|
|
122
|
+
currentOpen: K,
|
|
123
|
+
currentValue: q,
|
|
124
|
+
highlightedValue: P,
|
|
125
|
+
inputNode: He,
|
|
126
|
+
inputValue: ae,
|
|
127
127
|
onHighlightedValueChange: le,
|
|
128
128
|
onInputValueChange: ue,
|
|
129
129
|
onCreate: S,
|
|
130
|
-
onOpenChange:
|
|
131
|
-
onValueChange:
|
|
130
|
+
onOpenChange: fe,
|
|
131
|
+
onValueChange: pe,
|
|
132
132
|
open: H,
|
|
133
|
-
value:
|
|
133
|
+
value: Te
|
|
134
134
|
});
|
|
135
|
-
|
|
135
|
+
Z.current = {
|
|
136
136
|
currentHighlighted: qe,
|
|
137
|
-
currentInput:
|
|
138
|
-
currentOpen:
|
|
139
|
-
currentValue:
|
|
140
|
-
highlightedValue:
|
|
141
|
-
inputNode:
|
|
142
|
-
inputValue:
|
|
137
|
+
currentInput: J,
|
|
138
|
+
currentOpen: K,
|
|
139
|
+
currentValue: q,
|
|
140
|
+
highlightedValue: P,
|
|
141
|
+
inputNode: He,
|
|
142
|
+
inputValue: ae,
|
|
143
143
|
onHighlightedValueChange: le,
|
|
144
144
|
onInputValueChange: ue,
|
|
145
145
|
onCreate: S,
|
|
146
|
-
onOpenChange:
|
|
147
|
-
onValueChange:
|
|
146
|
+
onOpenChange: fe,
|
|
147
|
+
onValueChange: pe,
|
|
148
148
|
open: H,
|
|
149
|
-
value:
|
|
149
|
+
value: Te
|
|
150
150
|
};
|
|
151
|
-
let
|
|
152
|
-
let r =
|
|
151
|
+
let st = l((e, t, n) => {
|
|
152
|
+
let r = Z.current;
|
|
153
153
|
e !== r.currentOpen && s({
|
|
154
154
|
controlled: r.open,
|
|
155
155
|
initial: r.currentOpen,
|
|
156
156
|
onRequest: (e) => r.onOpenChange?.(e.value, e)
|
|
157
|
-
}).request(e, t, n) && (
|
|
158
|
-
}, []),
|
|
159
|
-
let r =
|
|
157
|
+
}).request(e, t, n) && (Fe(e), e || (Ve(null), Ye.current = "none"));
|
|
158
|
+
}, []), ct = l((e, t, n) => {
|
|
159
|
+
let r = Z.current;
|
|
160
160
|
e !== r.currentHighlighted && s({
|
|
161
161
|
controlled: r.highlightedValue,
|
|
162
162
|
initial: r.currentHighlighted,
|
|
163
163
|
onRequest: (e) => r.onHighlightedValueChange?.(e.value, e)
|
|
164
|
-
}).request(e, t, n) &&
|
|
165
|
-
}, []),
|
|
164
|
+
}).request(e, t, n) && Ve(e);
|
|
165
|
+
}, []), lt = l((e) => {
|
|
166
166
|
if (e !== "") {
|
|
167
|
-
for (let [t, n] of nt) if (
|
|
168
|
-
for (let [t, n] of $e.current) if (
|
|
167
|
+
for (let [t, n] of nt) if (X.equals(n, e)) return t;
|
|
168
|
+
for (let [t, n] of $e.current) if (X.equals(n, e)) return t;
|
|
169
169
|
}
|
|
170
170
|
}, [
|
|
171
171
|
nt,
|
|
172
|
-
|
|
172
|
+
X,
|
|
173
173
|
et
|
|
174
174
|
]), Q = l((e, t, n) => {
|
|
175
|
-
let r =
|
|
175
|
+
let r = Z.current;
|
|
176
176
|
Ze(null), e !== r.currentInput && s({
|
|
177
177
|
controlled: r.inputValue,
|
|
178
178
|
initial: r.currentInput,
|
|
179
179
|
onRequest: (e) => r.onInputValueChange?.(e.value, e)
|
|
180
|
-
}).request(e, t, n) &&
|
|
180
|
+
}).request(e, t, n) && ze(e);
|
|
181
181
|
}, []), $ = l((e, t, n) => {
|
|
182
|
-
let r =
|
|
182
|
+
let r = Z.current;
|
|
183
183
|
e !== r.currentValue && s({
|
|
184
184
|
controlled: r.value,
|
|
185
185
|
initial: r.currentValue,
|
|
186
186
|
onRequest: (e) => r.onValueChange?.(e.value, e)
|
|
187
|
-
}).request(e, t, n) &&
|
|
188
|
-
}, []),
|
|
187
|
+
}).request(e, t, n) && Le(e);
|
|
188
|
+
}, []), ut = g({
|
|
189
189
|
allowsCustomValue: !1,
|
|
190
|
-
currentInput:
|
|
191
|
-
currentValue:
|
|
190
|
+
currentInput: J,
|
|
191
|
+
currentValue: q,
|
|
192
192
|
labelFor: it,
|
|
193
|
-
onInputReset:
|
|
193
|
+
onInputReset: V,
|
|
194
194
|
select: $,
|
|
195
195
|
setInputValue: Q,
|
|
196
|
-
valueForLabel:
|
|
196
|
+
valueForLabel: lt
|
|
197
197
|
});
|
|
198
|
-
|
|
198
|
+
ut.current = {
|
|
199
199
|
allowsCustomValue: n ?? U.allowsCustomValue,
|
|
200
|
-
currentInput:
|
|
201
|
-
currentValue:
|
|
200
|
+
currentInput: J,
|
|
201
|
+
currentValue: q,
|
|
202
202
|
labelFor: it,
|
|
203
|
-
onInputReset:
|
|
203
|
+
onInputReset: V,
|
|
204
204
|
select: $,
|
|
205
205
|
setInputValue: Q,
|
|
206
|
-
valueForLabel:
|
|
206
|
+
valueForLabel: lt
|
|
207
207
|
};
|
|
208
|
-
let
|
|
209
|
-
let t =
|
|
208
|
+
let dt = l((e) => {
|
|
209
|
+
let t = ut.current, n = t.currentInput, r = t.valueForLabel(n);
|
|
210
210
|
if (r !== void 0) {
|
|
211
211
|
r !== t.currentValue && t.select(r, "blur", e), t.setInputValue(t.labelFor(r) ?? n, "blur", e);
|
|
212
212
|
return;
|
|
@@ -224,137 +224,137 @@ function ae({ align: e, alignOffset: t, allowsCustomValue: n, autocomplete: o, a
|
|
|
224
224
|
reason: "blur",
|
|
225
225
|
source: e
|
|
226
226
|
});
|
|
227
|
-
}, []),
|
|
228
|
-
|
|
227
|
+
}, []), ft = l((e, t, n) => {
|
|
228
|
+
Z.current.onCreate?.(e, {
|
|
229
229
|
reason: t,
|
|
230
230
|
source: n
|
|
231
231
|
});
|
|
232
|
-
}, []),
|
|
232
|
+
}, []), pt = l((e, t) => {
|
|
233
233
|
$(null, e, t), Q("", e === "clear" ? "clear" : "programmatic", t);
|
|
234
234
|
}, [$, Q]);
|
|
235
|
-
p(
|
|
236
|
-
close: () =>
|
|
237
|
-
focus: () =>
|
|
238
|
-
open: () =>
|
|
235
|
+
p(_e, () => ({
|
|
236
|
+
close: () => st(!1, "programmatic"),
|
|
237
|
+
focus: () => Z.current.inputNode?.focus({ preventScroll: !0 }),
|
|
238
|
+
open: () => st(!0, "programmatic"),
|
|
239
239
|
scrollToKey: (e) => {
|
|
240
|
-
let t =
|
|
241
|
-
|
|
240
|
+
let t = G?.querySelector(`[data-part='item'][data-value="${CSS.escape(e)}"]`);
|
|
241
|
+
t != null && G !== null && O(t, G);
|
|
242
242
|
}
|
|
243
|
-
}), [
|
|
244
|
-
let
|
|
243
|
+
}), [G, st]);
|
|
244
|
+
let mt = {
|
|
245
245
|
align: e ?? U.align,
|
|
246
246
|
alignOffset: t ?? U.alignOffset,
|
|
247
247
|
allowsCustomValue: n ?? U.allowsCustomValue,
|
|
248
248
|
autocomplete: o ?? U.autocomplete,
|
|
249
249
|
autoHighlight: c ?? U.autoHighlight,
|
|
250
|
-
clear:
|
|
250
|
+
clear: pt,
|
|
251
251
|
clearable: d ?? U.clearable,
|
|
252
252
|
closeOnEscape: m ?? U.closeOnEscape,
|
|
253
253
|
closeOnOutsidePress: v ?? U.closeOnOutsidePress,
|
|
254
254
|
closeOnSelect: b ?? U.closeOnSelect,
|
|
255
255
|
collisionPadding: x ?? U.collisionPadding,
|
|
256
256
|
completion: Xe,
|
|
257
|
-
contentId:
|
|
258
|
-
contentNode:
|
|
257
|
+
contentId: Me,
|
|
258
|
+
contentNode: G,
|
|
259
259
|
canCreate: S !== void 0,
|
|
260
|
-
create:
|
|
260
|
+
create: ft,
|
|
261
261
|
disabled: Ge,
|
|
262
262
|
entry: Ye,
|
|
263
|
-
flip:
|
|
264
|
-
form:
|
|
263
|
+
flip: A ?? U.flip,
|
|
264
|
+
form: j,
|
|
265
265
|
fullWidth: ne ?? U.fullWidth,
|
|
266
|
-
hideWhenDetached:
|
|
266
|
+
hideWhenDetached: N ?? U.hideWhenDetached,
|
|
267
267
|
highlighted: qe,
|
|
268
|
-
highlightMatch:
|
|
269
|
-
inputId:
|
|
270
|
-
inputNode:
|
|
271
|
-
inputValue:
|
|
268
|
+
highlightMatch: F ?? U.highlightMatch,
|
|
269
|
+
inputId: Ne,
|
|
270
|
+
inputNode: He,
|
|
271
|
+
inputValue: J,
|
|
272
272
|
invalid: oe ?? W?.invalid ?? U.invalid,
|
|
273
273
|
labelFor: it,
|
|
274
|
-
loading:
|
|
275
|
-
locale:
|
|
276
|
-
loop:
|
|
274
|
+
loading: L ?? U.loading,
|
|
275
|
+
locale: Ae,
|
|
276
|
+
loop: z ?? U.loop,
|
|
277
277
|
matches: ot,
|
|
278
278
|
mount: se ?? U.mount,
|
|
279
279
|
name: ce,
|
|
280
280
|
onLoadMore: de,
|
|
281
|
-
open:
|
|
282
|
-
openOn:
|
|
281
|
+
open: K,
|
|
282
|
+
openOn: me ?? U.openOn,
|
|
283
283
|
optionId: at,
|
|
284
|
-
portal:
|
|
285
|
-
query:
|
|
284
|
+
portal: he ?? U.portal,
|
|
285
|
+
query: Y,
|
|
286
286
|
readOnly: Ke,
|
|
287
287
|
registerLabel: rt,
|
|
288
|
-
required:
|
|
288
|
+
required: ve ?? W?.required ?? U.required,
|
|
289
289
|
seen: Je.current,
|
|
290
290
|
select: $,
|
|
291
291
|
setCompletion: Ze,
|
|
292
292
|
setContentNode: We,
|
|
293
|
-
setHighlighted:
|
|
294
|
-
setInputNode:
|
|
293
|
+
setHighlighted: ct,
|
|
294
|
+
setInputNode: Ue,
|
|
295
295
|
setInputValue: Q,
|
|
296
|
-
setOpen:
|
|
297
|
-
settleInput:
|
|
298
|
-
shift:
|
|
299
|
-
side:
|
|
300
|
-
sideOffset:
|
|
301
|
-
size:
|
|
302
|
-
strategy:
|
|
303
|
-
t:
|
|
304
|
-
total:
|
|
305
|
-
value:
|
|
306
|
-
variant:
|
|
296
|
+
setOpen: st,
|
|
297
|
+
settleInput: dt,
|
|
298
|
+
shift: ye ?? U.shift,
|
|
299
|
+
side: be ?? U.side,
|
|
300
|
+
sideOffset: xe ?? U.sideOffset,
|
|
301
|
+
size: Se ?? W?.size ?? U.size,
|
|
302
|
+
strategy: Ce ?? U.strategy,
|
|
303
|
+
t: Oe,
|
|
304
|
+
total: we,
|
|
305
|
+
value: q,
|
|
306
|
+
variant: Ee ?? U.variant,
|
|
307
307
|
wantsCompletion: Qe,
|
|
308
|
-
width:
|
|
308
|
+
width: De ?? U.width
|
|
309
309
|
};
|
|
310
310
|
return /* @__PURE__ */ y(re.Provider, {
|
|
311
|
-
value:
|
|
311
|
+
value: mt,
|
|
312
312
|
children: u
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/combobox/combobox-collection.ts
|
|
317
|
-
var
|
|
318
|
-
function
|
|
317
|
+
var ae = e(), oe = "[data-part='item']";
|
|
318
|
+
function I(e) {
|
|
319
319
|
return e === null ? [] : [...e.querySelectorAll(oe)];
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
323
|
-
let i =
|
|
321
|
+
var L = (e) => e.dataset.value ?? "", R = (e) => e.dataset.disabled === void 0, z = (e) => e.dataset.textValue ?? e.querySelector("[data-part='label']")?.textContent?.trim() ?? e.textContent?.trim() ?? "";
|
|
322
|
+
function B(e, t, n, r) {
|
|
323
|
+
let i = I(e);
|
|
324
324
|
if (i.length === 0) return null;
|
|
325
325
|
let a = D({
|
|
326
|
-
enabled: i.map(
|
|
327
|
-
from: t === null ? -1 : i.findIndex((e) =>
|
|
326
|
+
enabled: i.map(R),
|
|
327
|
+
from: t === null ? -1 : i.findIndex((e) => L(e) === t),
|
|
328
328
|
intent: n,
|
|
329
329
|
loop: r
|
|
330
330
|
});
|
|
331
|
-
return a === -1 ? null :
|
|
331
|
+
return a === -1 ? null : L(i[a]);
|
|
332
332
|
}
|
|
333
333
|
function se(e, t, n, r) {
|
|
334
334
|
if (n === "none") return null;
|
|
335
335
|
if (n === "selected") {
|
|
336
336
|
if (t === null) return null;
|
|
337
|
-
let n =
|
|
338
|
-
return n === void 0 ? null :
|
|
337
|
+
let n = I(e).find((e) => L(e) === t && R(e));
|
|
338
|
+
return n === void 0 ? null : L(n);
|
|
339
339
|
}
|
|
340
|
-
return
|
|
340
|
+
return B(e, null, n, r);
|
|
341
341
|
}
|
|
342
342
|
function ce(e) {
|
|
343
|
-
let t =
|
|
344
|
-
return t === void 0 ? null :
|
|
343
|
+
let t = I(e).find(R);
|
|
344
|
+
return t === void 0 ? null : z(t);
|
|
345
345
|
}
|
|
346
346
|
function le(e, t) {
|
|
347
|
-
let n =
|
|
348
|
-
return n === void 0 ? null :
|
|
347
|
+
let n = I(e).find((e) => z(e) === t);
|
|
348
|
+
return n === void 0 ? null : L(n);
|
|
349
349
|
}
|
|
350
350
|
function ue(e, t) {
|
|
351
351
|
if (e === null || t === null) return;
|
|
352
|
-
let n =
|
|
353
|
-
|
|
352
|
+
let n = I(e).find((e) => L(e) === t);
|
|
353
|
+
n !== void 0 && O(n, e);
|
|
354
354
|
}
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/combobox/combobox-parts.tsx
|
|
357
|
-
function
|
|
357
|
+
function V(e, t) {
|
|
358
358
|
return (n) => {
|
|
359
359
|
e?.(n), n.defaultPrevented || t(n);
|
|
360
360
|
};
|
|
@@ -362,8 +362,8 @@ function B(e, t) {
|
|
|
362
362
|
function de(e, ...t) {
|
|
363
363
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
let o =
|
|
365
|
+
function fe({ ref: e, render: r, ...i }) {
|
|
366
|
+
let o = N(), s = a(), [c, u] = _(null);
|
|
367
367
|
d(() => {
|
|
368
368
|
o.setInputNode(c);
|
|
369
369
|
}, [o, c]), m(() => {
|
|
@@ -374,7 +374,7 @@ function V({ ref: e, render: r, ...i }) {
|
|
|
374
374
|
c
|
|
375
375
|
]);
|
|
376
376
|
let f = (e, t) => {
|
|
377
|
-
let n =
|
|
377
|
+
let n = B(o.contentNode, o.highlighted, e, o.loop);
|
|
378
378
|
n !== null && o.setHighlighted(n, "keyboard", t);
|
|
379
379
|
}, p = (e) => {
|
|
380
380
|
if (o.highlighted === null && o.completion !== null) {
|
|
@@ -385,7 +385,7 @@ function V({ ref: e, render: r, ...i }) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
let t = o.highlighted;
|
|
388
|
-
if (t !== null &&
|
|
388
|
+
if (t !== null && pe(o.contentNode, t)) {
|
|
389
389
|
o.create(t, "keyboard", e), o.setOpen(!1, "select", e);
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
@@ -475,11 +475,11 @@ function V({ ref: e, render: r, ...i }) {
|
|
|
475
475
|
"data-part": "input",
|
|
476
476
|
disabled: o.disabled,
|
|
477
477
|
id: i.id ?? s?.ids.control ?? o.inputId,
|
|
478
|
-
onBlur:
|
|
479
|
-
onChange:
|
|
480
|
-
onClick:
|
|
481
|
-
onFocus:
|
|
482
|
-
onKeyDown:
|
|
478
|
+
onBlur: V(i.onBlur, w),
|
|
479
|
+
onChange: V(i.onChange, x),
|
|
480
|
+
onClick: V(i.onClick, C),
|
|
481
|
+
onFocus: V(i.onFocus, S),
|
|
482
|
+
onKeyDown: V(i.onKeyDown, g),
|
|
483
483
|
readOnly: o.readOnly,
|
|
484
484
|
ref: te,
|
|
485
485
|
required: o.required,
|
|
@@ -540,11 +540,11 @@ function V({ ref: e, render: r, ...i }) {
|
|
|
540
540
|
children: A
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function pe(e, t) {
|
|
544
544
|
return e !== null && e.querySelector(`[data-part='item'][data-value="${CSS.escape(t)}"]`)?.hasAttribute("data-create") === !0;
|
|
545
545
|
}
|
|
546
546
|
function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
547
|
-
let o =
|
|
547
|
+
let o = N(), [s, c] = _(null), [l, u] = _(null), [f, p] = _(null), [h, v] = _("unmounted"), [C, T] = _(!1), [E, te] = _(0), D = g(null), O = g(null), k = g(o);
|
|
548
548
|
k.current = o, d(() => {
|
|
549
549
|
let e = x({
|
|
550
550
|
present: k.current.open,
|
|
@@ -570,19 +570,19 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
570
570
|
o.portal,
|
|
571
571
|
A
|
|
572
572
|
]);
|
|
573
|
-
let { align: j, alignOffset:
|
|
573
|
+
let { align: j, alignOffset: M, collisionPadding: ne, flip: re, hideWhenDetached: P, shift: ie, side: F, sideOffset: oe, strategy: R, width: z } = o;
|
|
574
574
|
if (d(() => {
|
|
575
575
|
if (s === null || o.inputNode === null) return;
|
|
576
576
|
let e = !0, t = o.inputNode.closest("[data-part='root']") ?? o.inputNode, n = ee(t, s, {
|
|
577
577
|
align: j,
|
|
578
|
-
alignOffset:
|
|
579
|
-
boundaryPadding:
|
|
580
|
-
flip:
|
|
581
|
-
hideWhenDetached:
|
|
578
|
+
alignOffset: M,
|
|
579
|
+
boundaryPadding: ne,
|
|
580
|
+
flip: re,
|
|
581
|
+
hideWhenDetached: P,
|
|
582
582
|
matchWidth: z === "anchor",
|
|
583
|
-
shift:
|
|
584
|
-
side:
|
|
585
|
-
sideOffset:
|
|
583
|
+
shift: ie,
|
|
584
|
+
side: F,
|
|
585
|
+
sideOffset: oe,
|
|
586
586
|
strategy: R
|
|
587
587
|
});
|
|
588
588
|
return n.update().then(() => {
|
|
@@ -592,15 +592,15 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
592
592
|
};
|
|
593
593
|
}, [
|
|
594
594
|
j,
|
|
595
|
+
M,
|
|
595
596
|
ne,
|
|
596
|
-
re,
|
|
597
597
|
o.inputNode,
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
re,
|
|
599
|
+
P,
|
|
600
600
|
s,
|
|
601
|
-
|
|
601
|
+
ie,
|
|
602
|
+
F,
|
|
602
603
|
oe,
|
|
603
|
-
L,
|
|
604
604
|
R,
|
|
605
605
|
z
|
|
606
606
|
]), d(() => {
|
|
@@ -624,7 +624,7 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
624
624
|
o.open,
|
|
625
625
|
s
|
|
626
626
|
]), m(() => {
|
|
627
|
-
let e =
|
|
627
|
+
let e = I(l).filter((e) => e.dataset.create === void 0).length;
|
|
628
628
|
te((t) => t === e ? t : e);
|
|
629
629
|
}), m(() => {
|
|
630
630
|
let e = k.current;
|
|
@@ -634,7 +634,7 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
634
634
|
t !== null && e.setHighlighted(t, "keyboard");
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
|
-
e.highlighted !== null && (
|
|
637
|
+
e.highlighted !== null && (I(l).some((t) => L(t) === e.highlighted) || e.setHighlighted(null, "keyboard"));
|
|
638
638
|
}
|
|
639
639
|
}, [
|
|
640
640
|
o.open,
|
|
@@ -643,11 +643,15 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
643
643
|
l
|
|
644
644
|
]), d(() => {
|
|
645
645
|
ue(l, o.highlighted);
|
|
646
|
-
}, [
|
|
646
|
+
}, [
|
|
647
|
+
o.highlighted,
|
|
648
|
+
C,
|
|
649
|
+
l
|
|
650
|
+
]), m(() => {
|
|
647
651
|
let e = k.current;
|
|
648
652
|
if (!e.wantsCompletion.current || l === null) return;
|
|
649
653
|
e.wantsCompletion.current = !1;
|
|
650
|
-
let t =
|
|
654
|
+
let t = me(l, e.inputValue);
|
|
651
655
|
t !== null && t !== e.inputValue && e.setCompletion(t);
|
|
652
656
|
}, [
|
|
653
657
|
o.inputValue,
|
|
@@ -665,7 +669,7 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
665
669
|
E,
|
|
666
670
|
l
|
|
667
671
|
]), !A) return null;
|
|
668
|
-
let
|
|
672
|
+
let B = {
|
|
669
673
|
"data-align": j,
|
|
670
674
|
...o.open ? {} : { inert: !0 },
|
|
671
675
|
...o.open && C ? { "data-open": "" } : {},
|
|
@@ -673,8 +677,8 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
673
677
|
"data-size": o.size,
|
|
674
678
|
"data-ui": "combobox",
|
|
675
679
|
"data-width": o.width
|
|
676
|
-
},
|
|
677
|
-
...
|
|
680
|
+
}, ce = i === void 0 ? o.loading ? o.t("loading") : E === 0 ? null : o.t("count", { count: E }) : i, le = /* @__PURE__ */ y("div", {
|
|
681
|
+
...B,
|
|
678
682
|
ref: (e) => {
|
|
679
683
|
c(e), de(e, n);
|
|
680
684
|
},
|
|
@@ -732,25 +736,25 @@ function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
732
736
|
"data-part": "status",
|
|
733
737
|
...o.loading ? { "data-loading": "" } : {},
|
|
734
738
|
role: "status",
|
|
735
|
-
children:
|
|
739
|
+
children: ce
|
|
736
740
|
})
|
|
737
741
|
]
|
|
738
742
|
})
|
|
739
|
-
}), V = r === void 0 ?
|
|
740
|
-
...
|
|
743
|
+
}), V = r === void 0 ? le : r({
|
|
744
|
+
...B,
|
|
741
745
|
children: e
|
|
742
746
|
});
|
|
743
|
-
return f === null ? V : (0,
|
|
747
|
+
return f === null ? V : (0, ae.createPortal)(V, f);
|
|
744
748
|
}
|
|
745
|
-
function
|
|
749
|
+
function me(e, t) {
|
|
746
750
|
if (t === "") return null;
|
|
747
751
|
let n = ce(e);
|
|
748
752
|
return n === null ? null : n.toLowerCase().startsWith(t.toLowerCase()) ? n : null;
|
|
749
753
|
}
|
|
750
754
|
//#endregion
|
|
751
755
|
//#region src/combobox/combobox-items.tsx
|
|
752
|
-
function
|
|
753
|
-
let p =
|
|
756
|
+
function he({ children: e, description: r, disabled: i = !1, icon: a, position: s, ref: c, textValue: l, value: u, ...f }) {
|
|
757
|
+
let p = N(), [m, v] = _(null), x = g(null), S = l ?? (typeof e == "string" ? e : void 0);
|
|
754
758
|
d(() => {
|
|
755
759
|
if (m === null) return;
|
|
756
760
|
let e = S ?? m.querySelector("[data-part='label']")?.textContent?.trim() ?? "";
|
|
@@ -763,7 +767,7 @@ function me({ children: e, description: r, disabled: i = !1, icon: a, position:
|
|
|
763
767
|
]);
|
|
764
768
|
let C = h(() => {
|
|
765
769
|
if (!p.highlightMatch || p.query === "" || S === void 0) return e;
|
|
766
|
-
let t =
|
|
770
|
+
let t = k(S, p.query, { locale: p.locale });
|
|
767
771
|
return t.length === 0 ? e : /* @__PURE__ */ y(o, {
|
|
768
772
|
ranges: t,
|
|
769
773
|
text: S
|
|
@@ -823,8 +827,8 @@ function me({ children: e, description: r, disabled: i = !1, icon: a, position:
|
|
|
823
827
|
]
|
|
824
828
|
});
|
|
825
829
|
}
|
|
826
|
-
function
|
|
827
|
-
let r = `${f()}group`, { query: i } =
|
|
830
|
+
function ge({ children: e, label: t, ...n }) {
|
|
831
|
+
let r = `${f()}group`, { query: i } = N(), [a, o] = _(null), [s, c] = _(!1);
|
|
828
832
|
return d(() => {
|
|
829
833
|
a !== null && c(a.querySelector("[data-part='item']") === null);
|
|
830
834
|
}, [a, i]), /* @__PURE__ */ b("div", {
|
|
@@ -841,7 +845,7 @@ function he({ children: e, label: t, ...n }) {
|
|
|
841
845
|
}), e]
|
|
842
846
|
});
|
|
843
847
|
}
|
|
844
|
-
function
|
|
848
|
+
function _e(e) {
|
|
845
849
|
return /* @__PURE__ */ y("div", {
|
|
846
850
|
"data-part": "separator",
|
|
847
851
|
ref: e.ref,
|
|
@@ -849,4 +853,4 @@ function ge(e) {
|
|
|
849
853
|
});
|
|
850
854
|
}
|
|
851
855
|
//#endregion
|
|
852
|
-
export {
|
|
856
|
+
export { fe as a, A as c, H as i, ne as l, he as n, F as o, _e as r, N as s, ge as t, M as u };
|