@slotted/react 0.1.0-beta.4 → 0.1.0-beta.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.
- package/README.md +16 -1
- package/dist/{action-bar-OACchRZw.js → action-bar-ti3e6FK1.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{app-shell-CmYvnu_7.js → app-shell-nnSP44OO.js} +271 -267
- package/dist/app-shell.js +1 -1
- package/dist/bin/slotted-agent-docs.mjs +297 -0
- package/dist/{cascader-D1AhTyBL.js → cascader-Cn2Acpcv.js} +227 -210
- package/dist/cascader.js +1 -1
- package/dist/chart-04i6NZQA.js +968 -0
- package/dist/chart.js +1 -1
- package/dist/{checkbox-DfxFHZaU.js → checkbox-B4Sb1eXj.js} +3 -3
- package/dist/{checkbox-group-9sDgrV5Z.js → checkbox-group-LpGMuq9w.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{code-block-CFHf8uTm.js → code-block-CTNiyt0U.js} +1 -1
- package/dist/code-block.js +1 -1
- package/dist/{color-picker-CwbWzCKg.js → color-picker-BcRCeISx.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-CTtizVhm.js → column-manager-BtkYLs5G.js} +4 -4
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-BVMI9lg8.js → combobox-C1D5doWM.js} +227 -198
- package/dist/combobox.js +1 -1
- package/dist/{context-menu-BuST6W94.js → context-menu-B00UIBVC.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{currency-field-DD9A5U3D.js → currency-field-Dti9JFu0.js} +1 -1
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-CBMP_-JV.js → dashboard-grid-CoLKLvYL.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-Eb-a4jg3.js → data-grid-DX95Y7mY.js} +18 -18
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-oICmxGkA.js → data-list-CWYTPNm-.js} +2 -2
- package/dist/data-list.js +1 -1
- package/dist/{date-field-Hr-OCU-H.js → date-field-BxEpqAPg.js} +1 -1
- package/dist/date-field.js +1 -1
- package/dist/date-picker-DRk9SZp1.js +308 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-6Yz7avTS.js +483 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-B8TrmsDK.js → datetime-field-D2f9u6im.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/datetime-picker-STqSWMkH.js +645 -0
- package/dist/datetime-picker.js +1 -1
- package/dist/datetime-range-picker-DQNQwr3K.js +1000 -0
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{detail-panel-CW53lUjp.js → detail-panel-z6WGleP4.js} +1 -1
- package/dist/detail-panel.js +1 -1
- package/dist/docs/AGENTS.snippet.md +2 -0
- package/dist/docs/app-shell.examples.md +1 -1
- package/dist/docs/app-shell.json +4 -4
- package/dist/docs/app-shell.md +2 -2
- package/dist/docs/guidelines/README.md +2 -2
- package/dist/docs/guidelines/index.md +1 -1
- package/dist/docs/guidelines/own-elements.md +1 -1
- package/dist/docs/page-header.json +1 -0
- package/dist/docs/page-header.md +1 -1
- package/dist/docs/skills/build-own-element/SKILL.md +6 -6
- package/dist/docs/skills/compose-screen/SKILL.md +6 -6
- package/dist/docs/skills/review-screen/SKILL.md +6 -6
- package/dist/docs/skills/theme-app/SKILL.md +1 -1
- package/dist/docs/skills/waiting-states/SKILL.md +2 -2
- package/dist/docs/tabs.json +13 -3
- package/dist/docs/tabs.md +3 -2
- package/dist/{entity-picker-Dn1T7JCq.js → entity-picker-BdySwW8F.js} +274 -256
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CnF3iIZD.js → event-calendar-CiphPXdV.js} +4 -4
- package/dist/event-calendar.js +1 -1
- package/dist/{field-NJaCxl2h.js → field-BxQFpOXS.js} +1 -1
- package/dist/{field-group-hAzVa2O9.js → field-group-DcN_hiZN.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-CHyy1o--.js → filter-bar-C_dXljI_.js} +10 -10
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-BJE5dtaQ.js → hover-card-DpVzwvDJ.js} +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/{import-export-center-jF37b909.js → import-export-center-BQnMJz4g.js} +3 -3
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +63 -63
- package/dist/{listbox-Dv856z9I.js → listbox-D0MJcAMm.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{markdown-CeG8mUbI.js → markdown-IiVoh6yi.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-D6v_mz6O.js +809 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-b2CruimJ.js → menubar-DApIg1eR.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DQ5ds0fX.js → multi-select-B8z6ApgW.js} +286 -257
- package/dist/multi-select.js +1 -1
- package/dist/{notification-center-C1iWWl5Y.js → notification-center-CGEEHcRA.js} +2 -2
- package/dist/notification-center.js +1 -1
- package/dist/{number-field-BFIAmv-z.js → number-field-DXk1TAXA.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-BNQhuKaT.js → otp-input-CI-kdNgx.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{popover-Be7JWbGJ.js → popover-DEp8Bf3e.js} +186 -166
- package/dist/popover.js +1 -1
- package/dist/{prompt-composer-BxpdkTpZ.js → prompt-composer-DdcU3S3L.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-BaVIP9UH.js → radio-group-D8csBZ8Z.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-DYBQBzwB.js → rating-rI3b5zII.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-DlE_--Z9.js → saved-views-B3brBTD9.js} +4 -4
- package/dist/saved-views.js +1 -1
- package/dist/scroll-area-DQ_ansLu.js +112 -0
- package/dist/scroll-area.js +1 -1
- package/dist/{segmented-control-DmuOGiu6.js → segmented-control-C-PzkTtg.js} +2 -2
- package/dist/segmented-control.js +1 -1
- package/dist/{select-M7Io4UL9.js → select-BUylPwpb.js} +241 -203
- package/dist/select.js +1 -1
- package/dist/{side-navigation-CBLtCzuJ.js → side-navigation-Bm-BZma1.js} +156 -140
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-DTes4HLF.js → slider-fp7kyg-6.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-CPgHiy9G.js → split-button-DKRm0j5c.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-DQzuIhPX.js → switch-aVoc4C2F.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-U9eJYCuB.js → table-BYEvFr4P.js} +276 -275
- package/dist/table.js +1 -1
- package/dist/{tabs-BtHmjlnM.js → tabs-HWmvOKM4.js} +109 -102
- package/dist/tabs.js +1 -1
- package/dist/{tags-input-CcOkm0AW.js → tags-input-pbv6x1Pi.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-DLfIZ0fk.js → text-field-CbQ6UCAP.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CBJBJBi6.js → textarea-DJSfhrXH.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-DrhiCtUl.js → time-field-BI9n607q.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/time-picker-D6SlQWNF.js +402 -0
- package/dist/time-picker.js +1 -1
- package/dist/time-range-picker-CcV3_45h.js +751 -0
- package/dist/time-range-picker.js +1 -1
- package/dist/{toggle-group-7iBR9Rn1.js → toggle-group-i7JPO8BM.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-DDZpEftQ.js → toolbar-B9knmgHA.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/tooltip-CgjIROUy.js +410 -0
- package/dist/tooltip.js +1 -1
- package/dist/{top-navigation-e-tWMGNr.js → top-navigation-DiG2PF5W.js} +2 -2
- package/dist/top-navigation.js +1 -1
- package/dist/{transfer-CqZOTLMP.js → transfer--UOQVeKE.js} +5 -5
- package/dist/transfer.js +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts +6 -4
- package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell.d.ts.map +1 -1
- package/dist/types/cascader/cascader.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker-popup.d.ts.map +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
- package/dist/types/popover/popover-parts.d.ts.map +1 -1
- package/dist/types/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card.types.d.ts +2 -2
- package/dist/types/stat-card/stat-card.types.d.ts.map +1 -1
- package/dist/types/table/table-content.d.ts.map +1 -1
- package/dist/types/tabs/tabs-parts.d.ts +2 -4
- package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/types/tooltip/tooltip-parts.d.ts.map +1 -1
- package/dist/{upload-DjnlVR8y.js → upload-CLX5cURk.js} +1 -1
- package/dist/upload.js +1 -1
- package/package.json +10 -7
- package/dist/chart-O0ZhkzJe.js +0 -966
- package/dist/date-picker-D3-y2Jxw.js +0 -295
- package/dist/date-range-picker-y3b82Wmf.js +0 -471
- package/dist/datetime-picker-CIRHVLQp.js +0 -629
- package/dist/datetime-range-picker-DM-1m98z.js +0 -994
- package/dist/menu-parts-W58pVNUt.js +0 -786
- package/dist/scroll-area-BriwmvYY.js +0 -111
- package/dist/time-picker-CRQsMJbQ.js +0 -396
- package/dist/time-range-picker-DlZJsj1e.js +0 -745
- package/dist/tooltip-DbKTPe_i.js +0 -392
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { n as e, t } from "./icon-T9Yt4tnm.js";
|
|
2
2
|
import { n, r } from "./i18n-DpW8lqJ1.js";
|
|
3
|
-
import { b as i } from "./field-
|
|
3
|
+
import { b as i } from "./field-BxQFpOXS.js";
|
|
4
4
|
import { t as a } from "./highlight-0Qw23QPp.js";
|
|
5
5
|
import { createControllable as o } from "@slotted/core/state";
|
|
6
6
|
import { createContext as s, useCallback as c, useContext as l, useEffect as u, useId as d, useImperativeHandle as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
7
7
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
8
8
|
import { createPresence as ee } from "@slotted/core/presence";
|
|
9
9
|
import { createPortalRoot as b, setPortalContainer as x } from "@slotted/core/portal";
|
|
10
|
-
import { createDismissableLayer as
|
|
11
|
-
import { createPositioner as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import { comboboxMessages as
|
|
14
|
-
import { createFilter as
|
|
15
|
-
import { matchRanges as
|
|
10
|
+
import { createDismissableLayer as te, pressOrigin as S } from "@slotted/core/dismissable-layer";
|
|
11
|
+
import { createPositioner as ne } from "@slotted/core/positioner";
|
|
12
|
+
import { createPortal as re } from "react-dom";
|
|
13
|
+
import { comboboxMessages as C } from "@slotted/core/i18n";
|
|
14
|
+
import { createFilter as ie, moveIndex as w, revealWithin as ae } from "@slotted/core/collection";
|
|
15
|
+
import { matchRanges as T } from "@slotted/core/highlight";
|
|
16
16
|
//#region src/combobox/combobox-defaults.tsx
|
|
17
|
-
var
|
|
17
|
+
var E = {
|
|
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 l(
|
|
48
|
+
}, D = s(E);
|
|
49
|
+
function O() {
|
|
50
|
+
return l(D);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let r =
|
|
52
|
+
function oe({ children: e, container: t, ...n }) {
|
|
53
|
+
let r = O();
|
|
54
54
|
u(() => {
|
|
55
55
|
if (t !== void 0) return x(t), () => x(null);
|
|
56
56
|
}, [t]);
|
|
@@ -86,50 +86,50 @@ function re({ children: e, container: t, ...n }) {
|
|
|
86
86
|
variant: n.variant ?? r.variant,
|
|
87
87
|
width: n.width ?? r.width
|
|
88
88
|
};
|
|
89
|
-
return /* @__PURE__ */ v(
|
|
89
|
+
return /* @__PURE__ */ v(D.Provider, {
|
|
90
90
|
value: i,
|
|
91
91
|
children: e
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/combobox/combobox.tsx
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
let e = l(
|
|
96
|
+
var k = s(void 0);
|
|
97
|
+
function A() {
|
|
98
|
+
let e = l(k);
|
|
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
|
|
103
|
-
function
|
|
104
|
-
return e === void 0 ? [] : e.flatMap((e) =>
|
|
102
|
+
var j = (e) => "options" in e;
|
|
103
|
+
function se(e) {
|
|
104
|
+
return e === void 0 ? [] : e.flatMap((e) => j(e) ? e.options : [e]);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
let U =
|
|
106
|
+
function M({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, autoHighlight: l, children: u, clearable: p, closeOnEscape: _, closeOnOutsidePress: y, closeOnSelect: ee, collisionPadding: b, onCreate: x, defaultHighlightedValue: te = null, defaultInputValue: S = "", defaultOpen: ne = !1, defaultValue: re = null, disabled: w, filter: T, flip: E, form: D, fullWidth: oe, hideWhenDetached: A, highlightedValue: j, highlightMatch: M, inputValue: N, invalid: P, items: F, loading: I, locale: L, loop: R, messages: ce, mount: le, name: ue, onHighlightedValueChange: de, onInputValueChange: z, onInputReset: fe, onLoadMore: B, onOpenChange: V, onValueChange: H, open: pe, 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 = O(), W = i(), Oe = r(C, ce), ke = n(), Ae = L ?? ke, je = d(), Me = `${je}listbox`, Ne = `${je}input`, [Pe, Fe] = g(ne), [Ie, Le] = g(re), [Re, ze] = g(S), [Be, Ve] = g(te), [He, Ue] = g(null), [G, We] = g(null), Ge = w ?? W?.disabled ?? U.disabled, Ke = ge ?? W?.readOnly ?? U.readOnly, K = (pe ?? Pe) && !Ge, q = Te === void 0 ? Ie : Te, J = N ?? Re, qe = j === void 0 ? Be : j, Je = h(K);
|
|
108
108
|
K && (Je.current = !0);
|
|
109
109
|
let Ye = h("none"), [Xe, Ze] = g(null), Qe = h(!1), $e = h(/* @__PURE__ */ new Map()), [et, tt] = g(0), nt = m(() => {
|
|
110
110
|
let e = /* @__PURE__ */ new Map();
|
|
111
|
-
for (let t of
|
|
111
|
+
for (let t of se(F)) e.set(t.value, t.label);
|
|
112
112
|
return e;
|
|
113
|
-
}, [
|
|
113
|
+
}, [F]), rt = c((e, t) => {
|
|
114
114
|
$e.current.get(e) !== t && ($e.current.set(e, t), tt((e) => e + 1));
|
|
115
|
-
}, []), it = c((e) => nt.get(e) ?? $e.current.get(e), [nt, et]), at = c((e) => `${je}option-${encodeURIComponent(e)}`, [je]), Y = J === (q === null ? void 0 : it(q)) ? "" : J, X = m(() =>
|
|
115
|
+
}, []), it = c((e) => nt.get(e) ?? $e.current.get(e), [nt, et]), at = c((e) => `${je}option-${encodeURIComponent(e)}`, [je]), Y = J === (q === null ? void 0 : it(q)) ? "" : J, X = m(() => ie({ locale: Ae }), [Ae]), ot = c((e) => Y === "" || T === null ? !0 : T === void 0 ? X.contains(e, Y) : T(e, Y), [
|
|
116
116
|
X,
|
|
117
|
-
|
|
117
|
+
T,
|
|
118
118
|
Y
|
|
119
119
|
]), Z = h({
|
|
120
120
|
currentHighlighted: qe,
|
|
121
121
|
currentInput: J,
|
|
122
122
|
currentOpen: K,
|
|
123
123
|
currentValue: q,
|
|
124
|
-
highlightedValue:
|
|
124
|
+
highlightedValue: j,
|
|
125
125
|
inputNode: He,
|
|
126
|
-
inputValue:
|
|
127
|
-
onHighlightedValueChange:
|
|
128
|
-
onInputValueChange:
|
|
126
|
+
inputValue: N,
|
|
127
|
+
onHighlightedValueChange: de,
|
|
128
|
+
onInputValueChange: z,
|
|
129
129
|
onCreate: x,
|
|
130
|
-
onOpenChange:
|
|
131
|
-
onValueChange:
|
|
132
|
-
open:
|
|
130
|
+
onOpenChange: V,
|
|
131
|
+
onValueChange: H,
|
|
132
|
+
open: pe,
|
|
133
133
|
value: Te
|
|
134
134
|
});
|
|
135
135
|
Z.current = {
|
|
@@ -137,15 +137,15 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
137
137
|
currentInput: J,
|
|
138
138
|
currentOpen: K,
|
|
139
139
|
currentValue: q,
|
|
140
|
-
highlightedValue:
|
|
140
|
+
highlightedValue: j,
|
|
141
141
|
inputNode: He,
|
|
142
|
-
inputValue:
|
|
143
|
-
onHighlightedValueChange:
|
|
144
|
-
onInputValueChange:
|
|
142
|
+
inputValue: N,
|
|
143
|
+
onHighlightedValueChange: de,
|
|
144
|
+
onInputValueChange: z,
|
|
145
145
|
onCreate: x,
|
|
146
|
-
onOpenChange:
|
|
147
|
-
onValueChange:
|
|
148
|
-
open:
|
|
146
|
+
onOpenChange: V,
|
|
147
|
+
onValueChange: H,
|
|
148
|
+
open: pe,
|
|
149
149
|
value: Te
|
|
150
150
|
};
|
|
151
151
|
let st = c((e, t, n) => {
|
|
@@ -190,7 +190,7 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
190
190
|
currentInput: J,
|
|
191
191
|
currentValue: q,
|
|
192
192
|
labelFor: it,
|
|
193
|
-
onInputReset:
|
|
193
|
+
onInputReset: fe,
|
|
194
194
|
select: $,
|
|
195
195
|
setInputValue: Q,
|
|
196
196
|
valueForLabel: lt
|
|
@@ -200,7 +200,7 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
200
200
|
currentInput: J,
|
|
201
201
|
currentValue: q,
|
|
202
202
|
labelFor: it,
|
|
203
|
-
onInputReset:
|
|
203
|
+
onInputReset: fe,
|
|
204
204
|
select: $,
|
|
205
205
|
setInputValue: Q,
|
|
206
206
|
valueForLabel: lt
|
|
@@ -238,7 +238,7 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
238
238
|
open: () => st(!0, "programmatic"),
|
|
239
239
|
scrollToKey: (e) => {
|
|
240
240
|
let t = G?.querySelector(`[data-part='item'][data-value="${CSS.escape(e)}"]`);
|
|
241
|
-
t != null && G !== null &&
|
|
241
|
+
t != null && G !== null && ae(t, G);
|
|
242
242
|
}
|
|
243
243
|
}), [G, st]);
|
|
244
244
|
let mt = {
|
|
@@ -260,24 +260,24 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
260
260
|
create: ft,
|
|
261
261
|
disabled: Ge,
|
|
262
262
|
entry: Ye,
|
|
263
|
-
flip:
|
|
264
|
-
form:
|
|
265
|
-
fullWidth:
|
|
266
|
-
hideWhenDetached:
|
|
263
|
+
flip: E ?? U.flip,
|
|
264
|
+
form: D,
|
|
265
|
+
fullWidth: oe ?? U.fullWidth,
|
|
266
|
+
hideWhenDetached: A ?? U.hideWhenDetached,
|
|
267
267
|
highlighted: qe,
|
|
268
|
-
highlightMatch:
|
|
268
|
+
highlightMatch: M ?? U.highlightMatch,
|
|
269
269
|
inputId: Ne,
|
|
270
270
|
inputNode: He,
|
|
271
271
|
inputValue: J,
|
|
272
|
-
invalid:
|
|
272
|
+
invalid: P ?? W?.invalid ?? U.invalid,
|
|
273
273
|
labelFor: it,
|
|
274
|
-
loading:
|
|
274
|
+
loading: I ?? U.loading,
|
|
275
275
|
locale: Ae,
|
|
276
|
-
loop:
|
|
276
|
+
loop: R ?? U.loop,
|
|
277
277
|
matches: ot,
|
|
278
|
-
mount:
|
|
279
|
-
name:
|
|
280
|
-
onLoadMore:
|
|
278
|
+
mount: le ?? U.mount,
|
|
279
|
+
name: ue,
|
|
280
|
+
onLoadMore: B,
|
|
281
281
|
open: K,
|
|
282
282
|
openOn: me ?? U.openOn,
|
|
283
283
|
optionId: at,
|
|
@@ -307,63 +307,63 @@ function oe({ align: e, alignOffset: t, allowsCustomValue: a, autocomplete: s, a
|
|
|
307
307
|
wantsCompletion: Qe,
|
|
308
308
|
width: De ?? U.width
|
|
309
309
|
};
|
|
310
|
-
return /* @__PURE__ */ v(
|
|
310
|
+
return /* @__PURE__ */ v(k.Provider, {
|
|
311
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
|
|
319
|
-
return e === null ? [] : [...e.querySelectorAll(
|
|
317
|
+
var N = "[data-part='item']";
|
|
318
|
+
function P(e) {
|
|
319
|
+
return e === null ? [] : [...e.querySelectorAll(N)];
|
|
320
320
|
}
|
|
321
|
-
var
|
|
322
|
-
function
|
|
323
|
-
let i =
|
|
321
|
+
var F = (e) => e.dataset.value ?? "", I = (e) => e.dataset.disabled === void 0, L = (e) => e.dataset.textValue ?? e.querySelector("[data-part='label']")?.textContent?.trim() ?? e.textContent?.trim() ?? "";
|
|
322
|
+
function R(e, t, n, r) {
|
|
323
|
+
let i = P(e);
|
|
324
324
|
if (i.length === 0) return null;
|
|
325
|
-
let a =
|
|
326
|
-
enabled: i.map(
|
|
327
|
-
from: t === null ? -1 : i.findIndex((e) =>
|
|
325
|
+
let a = w({
|
|
326
|
+
enabled: i.map(I),
|
|
327
|
+
from: t === null ? -1 : i.findIndex((e) => F(e) === t),
|
|
328
328
|
intent: n,
|
|
329
329
|
loop: r
|
|
330
330
|
});
|
|
331
|
-
return a === -1 ? null :
|
|
331
|
+
return a === -1 ? null : F(i[a]);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ce(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 = P(e).find((e) => F(e) === t && I(e));
|
|
338
|
+
return n === void 0 ? null : F(n);
|
|
339
339
|
}
|
|
340
|
-
return
|
|
341
|
-
}
|
|
342
|
-
function ce(e) {
|
|
343
|
-
let t = F(e).find(L);
|
|
344
|
-
return t === void 0 ? null : R(t);
|
|
340
|
+
return R(e, null, n, r);
|
|
345
341
|
}
|
|
346
|
-
function le(e
|
|
347
|
-
let
|
|
348
|
-
return
|
|
342
|
+
function le(e) {
|
|
343
|
+
let t = P(e).find(I);
|
|
344
|
+
return t === void 0 ? null : L(t);
|
|
349
345
|
}
|
|
350
346
|
function ue(e, t) {
|
|
347
|
+
let n = P(e).find((e) => L(e) === t);
|
|
348
|
+
return n === void 0 ? null : F(n);
|
|
349
|
+
}
|
|
350
|
+
function de(e, t) {
|
|
351
351
|
if (e === null || t === null) return;
|
|
352
|
-
let n =
|
|
353
|
-
n !== void 0 &&
|
|
352
|
+
let n = P(e).find((e) => F(e) === t);
|
|
353
|
+
n !== void 0 && ae(n, e);
|
|
354
354
|
}
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/combobox/combobox-parts.tsx
|
|
357
|
-
function
|
|
357
|
+
function z(e, t) {
|
|
358
358
|
return (n) => {
|
|
359
359
|
e?.(n), n.defaultPrevented || t(n);
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function fe(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 B({ ref: n, render: r, ...a }) {
|
|
366
|
+
let o = A(), s = i(), [l, d] = g(null);
|
|
367
367
|
u(() => {
|
|
368
368
|
o.setInputNode(l);
|
|
369
369
|
}, [o, l]), p(() => {
|
|
@@ -374,18 +374,18 @@ function V({ ref: n, render: r, ...a }) {
|
|
|
374
374
|
l
|
|
375
375
|
]);
|
|
376
376
|
let f = (e, t) => {
|
|
377
|
-
let n =
|
|
377
|
+
let n = R(o.contentNode, o.highlighted, e, o.loop);
|
|
378
378
|
n !== null && o.setHighlighted(n, "keyboard", t);
|
|
379
379
|
}, m = (e) => {
|
|
380
380
|
if (o.highlighted === null && o.completion !== null) {
|
|
381
|
-
let t =
|
|
381
|
+
let t = ue(o.contentNode, o.completion);
|
|
382
382
|
if (t !== null) {
|
|
383
383
|
o.select(t, "keyboard", e), o.setInputValue(o.completion, "select", e), o.setOpen(!1, "select", e);
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
let t = o.highlighted;
|
|
388
|
-
if (t !== null &&
|
|
388
|
+
if (t !== null && V(o.contentNode, t)) {
|
|
389
389
|
o.create(t, "keyboard", e), o.setOpen(!1, "select", e);
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
@@ -437,20 +437,20 @@ function V({ ref: n, render: r, ...a }) {
|
|
|
437
437
|
o.setInputValue(t, "keyboard", e.nativeEvent), o.wantsCompletion.current = o.autocomplete === "both" && t.length > o.inputValue.length, o.openOn === "input" && !o.open && !o.readOnly && (o.entry.current = o.autoHighlight ? "first" : "none", o.setOpen(!0, "keyboard", e.nativeEvent));
|
|
438
438
|
}, x = () => {
|
|
439
439
|
o.openOn !== "focus" || o.readOnly || o.open || (o.entry.current = "selected", o.setOpen(!0, "keyboard"));
|
|
440
|
-
}, S = (e) => {
|
|
441
|
-
o.openOn === "manual" || o.open || o.disabled || o.readOnly || (o.entry.current = "selected", o.setOpen(!0, "pointer", e.nativeEvent));
|
|
442
440
|
}, te = (e) => {
|
|
441
|
+
o.openOn === "manual" || o.open || o.disabled || o.readOnly || (o.entry.current = "selected", o.setOpen(!0, "pointer", e.nativeEvent));
|
|
442
|
+
}, ne = (e) => {
|
|
443
443
|
let t = e.relatedTarget;
|
|
444
444
|
if (t instanceof Node && o.contentNode?.contains(t) === !0) return;
|
|
445
|
-
let n =
|
|
445
|
+
let n = S(l?.ownerDocument);
|
|
446
446
|
n instanceof Node && o.contentNode?.contains(n) === !0 || (o.settleInput(e), o.open && o.setOpen(!1, "blur"));
|
|
447
|
-
},
|
|
447
|
+
}, re = (e) => {
|
|
448
448
|
o.clear("clear", e.nativeEvent), l?.focus({ preventScroll: !0 });
|
|
449
|
-
},
|
|
449
|
+
}, C = (e) => {
|
|
450
450
|
o.disabled || o.readOnly || (o.entry.current = "selected", o.setOpen(!o.open, "pointer", e.nativeEvent), l?.focus({ preventScroll: !0 }));
|
|
451
|
-
},
|
|
452
|
-
d(e),
|
|
453
|
-
}, [n]),
|
|
451
|
+
}, ie = c((e) => {
|
|
452
|
+
d(e), fe(e, n);
|
|
453
|
+
}, [n]), w = [a["aria-describedby"], s?.describedBy].filter(Boolean).join(" "), ae = o.clearable && o.inputValue !== "" && !o.disabled && !o.readOnly, T = {
|
|
454
454
|
"data-part": "root",
|
|
455
455
|
"data-size": o.size,
|
|
456
456
|
"data-ui": "combobox",
|
|
@@ -462,35 +462,35 @@ function V({ ref: n, render: r, ...a }) {
|
|
|
462
462
|
...o.invalid ? { "data-invalid": "" } : {},
|
|
463
463
|
...o.required ? { "data-required": "" } : {},
|
|
464
464
|
...o.loading ? { "data-loading": "" } : {}
|
|
465
|
-
},
|
|
465
|
+
}, E = /* @__PURE__ */ y(_, { children: [
|
|
466
466
|
/* @__PURE__ */ v("input", {
|
|
467
467
|
...a,
|
|
468
468
|
"aria-activedescendant": o.open && o.highlighted !== null ? o.optionId(o.highlighted) : void 0,
|
|
469
469
|
"aria-autocomplete": o.autocomplete,
|
|
470
470
|
"aria-controls": o.open ? o.contentId : void 0,
|
|
471
|
-
"aria-describedby":
|
|
471
|
+
"aria-describedby": w === "" ? void 0 : w,
|
|
472
472
|
"aria-expanded": o.open,
|
|
473
473
|
"aria-invalid": o.invalid ? !0 : void 0,
|
|
474
474
|
"aria-readonly": o.readOnly ? !0 : void 0,
|
|
475
475
|
"data-part": "input",
|
|
476
476
|
disabled: o.disabled,
|
|
477
477
|
id: a.id ?? s?.ids.control ?? o.inputId,
|
|
478
|
-
onBlur:
|
|
479
|
-
onChange:
|
|
480
|
-
onClick:
|
|
481
|
-
onFocus:
|
|
482
|
-
onKeyDown:
|
|
478
|
+
onBlur: z(a.onBlur, ne),
|
|
479
|
+
onChange: z(a.onChange, b),
|
|
480
|
+
onClick: z(a.onClick, te),
|
|
481
|
+
onFocus: z(a.onFocus, x),
|
|
482
|
+
onKeyDown: z(a.onKeyDown, ee),
|
|
483
483
|
readOnly: o.readOnly,
|
|
484
|
-
ref:
|
|
484
|
+
ref: ie,
|
|
485
485
|
required: o.required,
|
|
486
486
|
role: "combobox",
|
|
487
487
|
type: "text",
|
|
488
488
|
value: o.completion ?? o.inputValue
|
|
489
489
|
}),
|
|
490
|
-
|
|
490
|
+
ae ? /* @__PURE__ */ v("button", {
|
|
491
491
|
"aria-label": o.t("clear"),
|
|
492
492
|
"data-part": "clear",
|
|
493
|
-
onClick:
|
|
493
|
+
onClick: re,
|
|
494
494
|
type: "button",
|
|
495
495
|
children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ v(e, { name: "x" }) })
|
|
496
496
|
}) : null,
|
|
@@ -498,7 +498,7 @@ function V({ ref: n, render: r, ...a }) {
|
|
|
498
498
|
"aria-label": o.t("trigger"),
|
|
499
499
|
"data-part": "trigger",
|
|
500
500
|
disabled: o.disabled,
|
|
501
|
-
onClick:
|
|
501
|
+
onClick: C,
|
|
502
502
|
tabIndex: -1,
|
|
503
503
|
type: "button",
|
|
504
504
|
children: o.loading ? /* @__PURE__ */ v("span", {
|
|
@@ -533,79 +533,109 @@ function V({ ref: n, render: r, ...a }) {
|
|
|
533
533
|
})
|
|
534
534
|
] });
|
|
535
535
|
return r === void 0 ? /* @__PURE__ */ v("div", {
|
|
536
|
-
...
|
|
537
|
-
children:
|
|
536
|
+
...T,
|
|
537
|
+
children: E
|
|
538
538
|
}) : r({
|
|
539
|
-
...
|
|
540
|
-
children:
|
|
539
|
+
...T,
|
|
540
|
+
children: E
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function V(e, t) {
|
|
544
544
|
return e !== null && e.querySelector(`[data-part='item'][data-value="${CSS.escape(t)}"]`)?.hasAttribute("data-create") === !0;
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
let o =
|
|
548
|
-
|
|
546
|
+
function H({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
547
|
+
let o = A(), [s, l] = g(null), [d, f] = g(null), [m, _] = g(null), [x, S] = g("unmounted"), [C, ie] = g(!1), [w, ae] = g(0), T = h(null), E = h(null), D = h(o);
|
|
548
|
+
D.current = o, u(() => {
|
|
549
549
|
let e = ee({
|
|
550
|
-
present:
|
|
551
|
-
onStatusChange:
|
|
550
|
+
present: D.current.open,
|
|
551
|
+
onStatusChange: S
|
|
552
552
|
});
|
|
553
|
-
return
|
|
554
|
-
e.destroy(),
|
|
553
|
+
return T.current = e, S(e.status), () => {
|
|
554
|
+
e.destroy(), T.current = null;
|
|
555
555
|
};
|
|
556
|
-
}, []), u(() =>
|
|
557
|
-
let
|
|
556
|
+
}, []), u(() => T.current?.sync(o.open), [o.open]), u(() => T.current?.setNode(s), [s]), u(() => o.setContentNode(d), [o, d]);
|
|
557
|
+
let O = o.mount === "eager" || o.mount === "lazy" && o.seen || o.open || x !== "unmounted";
|
|
558
558
|
u(() => {
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
let e = o.inputNode;
|
|
560
|
+
if (e === null || C) return;
|
|
561
|
+
let t = () => ie(!0);
|
|
562
|
+
return e.addEventListener("focusin", t), e.addEventListener("pointerdown", t), () => {
|
|
563
|
+
e.removeEventListener("focusin", t), e.removeEventListener("pointerdown", t);
|
|
564
|
+
};
|
|
565
|
+
}, [o.inputNode, C]);
|
|
566
|
+
let oe = O || C;
|
|
567
|
+
p(() => {
|
|
568
|
+
if (!oe) {
|
|
569
|
+
_(null);
|
|
561
570
|
return;
|
|
562
571
|
}
|
|
563
572
|
let e = b({
|
|
564
573
|
origin: o.inputNode,
|
|
565
574
|
disabled: !o.portal
|
|
566
575
|
});
|
|
567
|
-
return
|
|
576
|
+
return _(e.container), () => e.release();
|
|
568
577
|
}, [
|
|
569
578
|
o.inputNode,
|
|
570
579
|
o.portal,
|
|
571
|
-
|
|
580
|
+
oe
|
|
572
581
|
]);
|
|
573
|
-
let { align:
|
|
574
|
-
|
|
582
|
+
let { align: k, alignOffset: j, collisionPadding: se, flip: M, hideWhenDetached: N, shift: I, side: L, sideOffset: R, strategy: le, width: ue } = o, z = h(null), B = h(0), V = c((e, t) => {
|
|
583
|
+
e.update().then(() => {
|
|
584
|
+
if (z.current !== e || !D.current.open) return;
|
|
585
|
+
t.setAttribute("data-open", "");
|
|
586
|
+
let n = t.ownerDocument.defaultView;
|
|
587
|
+
n !== null && B.current === 0 && (B.current = n.requestAnimationFrame(() => {
|
|
588
|
+
B.current = 0, de(D.current.contentNode, D.current.highlighted);
|
|
589
|
+
}));
|
|
590
|
+
});
|
|
591
|
+
}, []);
|
|
592
|
+
if (p(() => {
|
|
575
593
|
if (s === null || o.inputNode === null) return;
|
|
576
|
-
let e =
|
|
577
|
-
align:
|
|
578
|
-
alignOffset:
|
|
579
|
-
boundaryPadding:
|
|
580
|
-
flip:
|
|
581
|
-
hideWhenDetached:
|
|
582
|
-
matchWidth:
|
|
583
|
-
shift:
|
|
584
|
-
side:
|
|
585
|
-
sideOffset:
|
|
586
|
-
strategy:
|
|
594
|
+
let e = o.inputNode.closest("[data-part='root']") ?? o.inputNode, t = ne(e, s, {
|
|
595
|
+
align: k,
|
|
596
|
+
alignOffset: j,
|
|
597
|
+
boundaryPadding: se,
|
|
598
|
+
flip: M,
|
|
599
|
+
hideWhenDetached: N,
|
|
600
|
+
matchWidth: ue === "anchor",
|
|
601
|
+
shift: I,
|
|
602
|
+
side: L,
|
|
603
|
+
sideOffset: R,
|
|
604
|
+
strategy: le
|
|
587
605
|
});
|
|
588
|
-
return
|
|
589
|
-
|
|
590
|
-
}), () => {
|
|
591
|
-
e = !1, n.destroy(), w(!1);
|
|
606
|
+
return z.current = t, D.current.open && V(t, s), () => {
|
|
607
|
+
t.destroy(), z.current = null, s.removeAttribute("data-open");
|
|
592
608
|
};
|
|
593
609
|
}, [
|
|
610
|
+
k,
|
|
594
611
|
j,
|
|
595
|
-
|
|
596
|
-
ie,
|
|
612
|
+
se,
|
|
597
613
|
o.inputNode,
|
|
614
|
+
M,
|
|
598
615
|
N,
|
|
599
|
-
ae,
|
|
600
616
|
s,
|
|
601
|
-
|
|
602
|
-
P,
|
|
617
|
+
I,
|
|
603
618
|
L,
|
|
604
619
|
R,
|
|
605
|
-
|
|
620
|
+
le,
|
|
621
|
+
ue,
|
|
622
|
+
V
|
|
623
|
+
]), p(() => {
|
|
624
|
+
let e = z.current;
|
|
625
|
+
if (e !== null && s !== null) {
|
|
626
|
+
if (o.open) {
|
|
627
|
+
V(e, s);
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
s.removeAttribute("data-open"), B.current !== 0 && (s.ownerDocument.defaultView?.cancelAnimationFrame(B.current), B.current = 0);
|
|
631
|
+
}
|
|
632
|
+
}, [
|
|
633
|
+
s,
|
|
634
|
+
V,
|
|
635
|
+
o.open
|
|
606
636
|
]), u(() => {
|
|
607
637
|
if (s === null || !o.open) return;
|
|
608
|
-
let e = [o.inputNode?.closest("[data-part='root']") ?? null].filter((e) => e !== null), t =
|
|
638
|
+
let e = [o.inputNode?.closest("[data-part='root']") ?? null].filter((e) => e !== null), t = te(s, {
|
|
609
639
|
branches: e,
|
|
610
640
|
escape: o.closeOnEscape,
|
|
611
641
|
focusOutside: !1,
|
|
@@ -613,7 +643,7 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
613
643
|
outsidePress: o.closeOnOutsidePress,
|
|
614
644
|
scrollLock: !1,
|
|
615
645
|
onDismiss: (e) => {
|
|
616
|
-
|
|
646
|
+
D.current.setOpen(!1, e.reason === "escape" ? "escape" : "outsidePress", e.source);
|
|
617
647
|
}
|
|
618
648
|
});
|
|
619
649
|
return () => t.destroy();
|
|
@@ -624,41 +654,41 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
624
654
|
o.open,
|
|
625
655
|
s
|
|
626
656
|
]), p(() => {
|
|
627
|
-
let e =
|
|
628
|
-
|
|
657
|
+
let e = P(d).filter((e) => e.dataset.create === void 0).length;
|
|
658
|
+
ae((t) => t === e ? t : e);
|
|
629
659
|
}), p(() => {
|
|
630
|
-
let e =
|
|
631
|
-
if (e.open &&
|
|
660
|
+
let e = D.current;
|
|
661
|
+
if (e.open && d !== null) {
|
|
632
662
|
if (e.entry.current !== "none") {
|
|
633
|
-
let t =
|
|
663
|
+
let t = ce(d, e.value, e.entry.current, e.loop) ?? (e.autoHighlight ? ce(d, null, "first", e.loop) : null);
|
|
634
664
|
t !== null && e.setHighlighted(t, "keyboard");
|
|
635
665
|
return;
|
|
636
666
|
}
|
|
637
|
-
e.highlighted !== null && (
|
|
667
|
+
e.highlighted !== null && (P(d).some((t) => F(t) === e.highlighted) || e.setHighlighted(null, "keyboard"));
|
|
638
668
|
}
|
|
639
669
|
}, [
|
|
640
670
|
o.open,
|
|
641
671
|
o.query,
|
|
642
|
-
|
|
643
|
-
|
|
672
|
+
w,
|
|
673
|
+
d
|
|
644
674
|
]), u(() => {
|
|
645
|
-
|
|
675
|
+
s?.hasAttribute("data-open") === !0 && de(d, o.highlighted);
|
|
646
676
|
}, [
|
|
677
|
+
s,
|
|
647
678
|
o.highlighted,
|
|
648
|
-
|
|
649
|
-
l
|
|
679
|
+
d
|
|
650
680
|
]), p(() => {
|
|
651
|
-
let e =
|
|
652
|
-
if (!e.wantsCompletion.current ||
|
|
681
|
+
let e = D.current;
|
|
682
|
+
if (!e.wantsCompletion.current || d === null) return;
|
|
653
683
|
e.wantsCompletion.current = !1;
|
|
654
|
-
let t =
|
|
684
|
+
let t = pe(d, e.inputValue);
|
|
655
685
|
t !== null && t !== e.inputValue && e.setCompletion(t);
|
|
656
686
|
}, [
|
|
657
687
|
o.inputValue,
|
|
658
|
-
|
|
659
|
-
|
|
688
|
+
w,
|
|
689
|
+
d
|
|
660
690
|
]), u(() => {
|
|
661
|
-
let e =
|
|
691
|
+
let e = E.current, t = d, n = o.onLoadMore;
|
|
662
692
|
if (e === null || t === null || n === void 0 || typeof IntersectionObserver != "function") return;
|
|
663
693
|
let r = new IntersectionObserver((e) => {
|
|
664
694
|
e.some((e) => e.isIntersecting) && n();
|
|
@@ -666,21 +696,20 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
666
696
|
return r.observe(e), () => r.disconnect();
|
|
667
697
|
}, [
|
|
668
698
|
o.onLoadMore,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
]), !
|
|
672
|
-
let
|
|
673
|
-
"data-align":
|
|
699
|
+
w,
|
|
700
|
+
d
|
|
701
|
+
]), !O) return null;
|
|
702
|
+
let H = {
|
|
703
|
+
"data-align": k,
|
|
674
704
|
...o.open ? {} : { inert: !0 },
|
|
675
|
-
...o.open && C ? { "data-open": "" } : {},
|
|
676
705
|
"data-part": "positioner",
|
|
677
706
|
"data-size": o.size,
|
|
678
707
|
"data-ui": "combobox",
|
|
679
708
|
"data-width": o.width
|
|
680
|
-
},
|
|
681
|
-
...
|
|
709
|
+
}, me = i === void 0 ? o.loading ? o.t("loading") : w === 0 ? null : o.t("count", { count: w }) : i, he = /* @__PURE__ */ v("div", {
|
|
710
|
+
...H,
|
|
682
711
|
ref: (e) => {
|
|
683
|
-
|
|
712
|
+
l(e), fe(e, n);
|
|
684
713
|
},
|
|
685
714
|
children: /* @__PURE__ */ y("div", {
|
|
686
715
|
...a,
|
|
@@ -689,12 +718,12 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
689
718
|
"data-loading": o.loading ? "" : void 0,
|
|
690
719
|
"data-part": "content",
|
|
691
720
|
id: o.contentId,
|
|
692
|
-
ref:
|
|
721
|
+
ref: f,
|
|
693
722
|
role: "listbox",
|
|
694
723
|
children: [
|
|
695
724
|
e,
|
|
696
|
-
/* @__PURE__ */ v("div", { ref:
|
|
697
|
-
!o.loading &&
|
|
725
|
+
/* @__PURE__ */ v("div", { ref: E }),
|
|
726
|
+
!o.loading && w === 0 && o.canCreate && o.query !== "" ? /* @__PURE__ */ v("div", {
|
|
698
727
|
"data-create": "",
|
|
699
728
|
"data-part": "item",
|
|
700
729
|
"data-value": o.query,
|
|
@@ -713,7 +742,7 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
713
742
|
children: o.t("create", { query: o.query })
|
|
714
743
|
})
|
|
715
744
|
}) : null,
|
|
716
|
-
!o.loading &&
|
|
745
|
+
!o.loading && w === 0 && !(o.canCreate && o.query !== "") ? /* @__PURE__ */ v("div", {
|
|
717
746
|
"data-part": "empty",
|
|
718
747
|
children: t ?? o.t("empty")
|
|
719
748
|
}) : null,
|
|
@@ -736,25 +765,25 @@ function pe({ children: e, empty: t, ref: n, render: r, status: i, ...a }) {
|
|
|
736
765
|
"data-part": "status",
|
|
737
766
|
...o.loading ? { "data-loading": "" } : {},
|
|
738
767
|
role: "status",
|
|
739
|
-
children:
|
|
768
|
+
children: me
|
|
740
769
|
})
|
|
741
770
|
]
|
|
742
771
|
})
|
|
743
|
-
}),
|
|
744
|
-
...
|
|
772
|
+
}), ge = r === void 0 ? he : r({
|
|
773
|
+
...H,
|
|
745
774
|
children: e
|
|
746
775
|
});
|
|
747
|
-
return
|
|
776
|
+
return m === null ? ge : re(ge, m);
|
|
748
777
|
}
|
|
749
|
-
function
|
|
778
|
+
function pe(e, t) {
|
|
750
779
|
if (t === "") return null;
|
|
751
|
-
let n =
|
|
780
|
+
let n = le(e);
|
|
752
781
|
return n === null ? null : n.toLowerCase().startsWith(t.toLowerCase()) ? n : null;
|
|
753
782
|
}
|
|
754
783
|
//#endregion
|
|
755
784
|
//#region src/combobox/combobox-items.tsx
|
|
756
785
|
function me({ children: n, description: r, disabled: i = !1, icon: o, position: s, ref: c, textValue: l, value: d, ...f }) {
|
|
757
|
-
let p =
|
|
786
|
+
let p = A(), [_, ee] = g(null), b = h(null), x = l ?? (typeof n == "string" ? n : void 0);
|
|
758
787
|
u(() => {
|
|
759
788
|
if (_ === null) return;
|
|
760
789
|
let e = x ?? _.querySelector("[data-part='label']")?.textContent?.trim() ?? "";
|
|
@@ -765,9 +794,9 @@ function me({ children: n, description: r, disabled: i = !1, icon: o, position:
|
|
|
765
794
|
x,
|
|
766
795
|
d
|
|
767
796
|
]);
|
|
768
|
-
let
|
|
797
|
+
let te = m(() => {
|
|
769
798
|
if (!p.highlightMatch || p.query === "" || x === void 0) return n;
|
|
770
|
-
let e =
|
|
799
|
+
let e = T(x, p.query, { locale: p.locale });
|
|
771
800
|
return e.length === 0 ? n : /* @__PURE__ */ v(a, {
|
|
772
801
|
ranges: e,
|
|
773
802
|
text: x
|
|
@@ -780,29 +809,29 @@ function me({ children: n, description: r, disabled: i = !1, icon: o, position:
|
|
|
780
809
|
x
|
|
781
810
|
]);
|
|
782
811
|
if (x !== void 0 && !p.matches(x)) return null;
|
|
783
|
-
let
|
|
812
|
+
let S = p.value === d, ne = p.highlighted === d, re = (e) => {
|
|
784
813
|
i || p.setHighlighted(d, "pointer", e.nativeEvent);
|
|
785
|
-
},
|
|
814
|
+
}, C = (e) => {
|
|
786
815
|
f.onPointerDown?.(e), !e.defaultPrevented && e.preventDefault();
|
|
787
|
-
},
|
|
816
|
+
}, ie = (e) => {
|
|
788
817
|
i || (p.select(d, "pointer", e.nativeEvent), p.setInputValue(p.labelFor(d) ?? x ?? d, "select", e.nativeEvent), p.closeOnSelect && p.setOpen(!1, "select", e.nativeEvent), p.inputNode?.focus({ preventScroll: !0 }));
|
|
789
818
|
};
|
|
790
819
|
return /* @__PURE__ */ y("div", {
|
|
791
820
|
...f,
|
|
792
821
|
"aria-disabled": i ? !0 : void 0,
|
|
793
822
|
"aria-posinset": s,
|
|
794
|
-
"aria-selected":
|
|
823
|
+
"aria-selected": S,
|
|
795
824
|
"aria-setsize": s === void 0 ? void 0 : p.total,
|
|
796
825
|
"data-part": "item",
|
|
797
826
|
"data-value": d,
|
|
798
827
|
...x === void 0 ? {} : { "data-text-value": x },
|
|
799
828
|
...i ? { "data-disabled": "" } : {},
|
|
800
|
-
...
|
|
801
|
-
...
|
|
829
|
+
...S ? { "data-selected": "" } : {},
|
|
830
|
+
...ne ? { "data-current": "" } : {},
|
|
802
831
|
id: f.id ?? p.optionId(d),
|
|
803
|
-
onClick:
|
|
804
|
-
onPointerDown:
|
|
805
|
-
onPointerEnter:
|
|
832
|
+
onClick: ie,
|
|
833
|
+
onPointerDown: C,
|
|
834
|
+
onPointerEnter: re,
|
|
806
835
|
ref: (e) => {
|
|
807
836
|
ee(e), typeof c == "function" ? c(e) : c != null && (c.current = e);
|
|
808
837
|
},
|
|
@@ -814,7 +843,7 @@ function me({ children: n, description: r, disabled: i = !1, icon: o, position:
|
|
|
814
843
|
}),
|
|
815
844
|
/* @__PURE__ */ v("span", {
|
|
816
845
|
"data-part": "label",
|
|
817
|
-
children:
|
|
846
|
+
children: te
|
|
818
847
|
}),
|
|
819
848
|
r === void 0 ? null : /* @__PURE__ */ v("span", {
|
|
820
849
|
"data-part": "description",
|
|
@@ -828,7 +857,7 @@ function me({ children: n, description: r, disabled: i = !1, icon: o, position:
|
|
|
828
857
|
});
|
|
829
858
|
}
|
|
830
859
|
function he({ children: e, label: t, ...n }) {
|
|
831
|
-
let r = `${d()}group`, { query: i } =
|
|
860
|
+
let r = `${d()}group`, { query: i } = A(), [a, o] = g(null), [s, c] = g(!1);
|
|
832
861
|
return u(() => {
|
|
833
862
|
a !== null && c(a.querySelector("[data-part='item']") === null);
|
|
834
863
|
}, [a, i]), /* @__PURE__ */ y("div", {
|
|
@@ -853,4 +882,4 @@ function ge(e) {
|
|
|
853
882
|
});
|
|
854
883
|
}
|
|
855
884
|
//#endregion
|
|
856
|
-
export {
|
|
885
|
+
export { B as a, E as c, H as i, oe as l, me as n, M as o, ge as r, A as s, he as t, O as u };
|