@algorisys/zen-ui-solid 13.8.0 → 13.8.1
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/dist/components/form/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/form/radio/radio-group.d.ts.map +1 -1
- package/dist/components/form/slider/slider.d.ts.map +1 -1
- package/dist/components/form/switch/switch.d.ts.map +1 -1
- package/dist/index208.js +13 -13
- package/dist/index209.js +2 -2
- package/dist/index210.js +5 -5
- package/dist/index211.js +12 -12
- package/dist/index212.js +13 -13
- package/dist/index213.js +10 -10
- package/dist/index214.js +10 -10
- package/dist/index215.js +9 -9
- package/dist/index216.js +9 -9
- package/dist/index218.js +14 -14
- package/dist/index219.js +14 -14
- package/dist/index220.js +13 -13
- package/dist/index221.js +1 -1
- package/dist/index222.js +5 -5
- package/dist/index223.js +9 -9
- package/dist/index224.js +24 -24
- package/dist/index225.js +5 -5
- package/dist/index226.js +3 -3
- package/dist/index249.js +10 -10
- package/dist/index250.js +3 -3
- package/dist/index252.js +2 -2
- package/dist/index257.js +1 -1
- package/dist/index258.js +1 -1
- package/dist/index271.js +5 -5
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +5 -3
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +3 -17
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +17 -16
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +16 -3
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +3 -3
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +3 -26
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +26 -11
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +10 -7
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +8 -49
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +49 -13
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +12 -6
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +7 -4
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +4 -5
- package/dist/index284.js.map +1 -1
- package/dist/index286.js +6 -260
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +105 -64
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +67 -19
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +72 -3
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +22 -15
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +58 -7
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +3 -384
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +16 -35
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +384 -6
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +92 -19
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +34 -391
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +6 -118
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +17 -48
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +62 -16
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +48 -58
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +31 -62
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +16 -20
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +58 -56
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +20 -10
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +10 -117
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +920 -20
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +37 -19
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +256 -18
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +114 -71
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +556 -891
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +121 -36
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +17 -114
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +363 -560
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +85 -118
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +16 -112
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +115 -67
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +21 -16
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +19 -91
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +20 -87
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +71 -16
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +118 -32
- package/dist/index321.js.map +1 -1
- package/dist/index323.js +1 -1
- package/dist/index324.js +93 -63
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +5 -116
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +38 -7
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +44 -7
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +2 -13
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +65 -7
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +115 -3
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +608 -3
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +295 -4
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +88 -5
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +11 -95
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +20 -5
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +62 -38
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +33 -43
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +7 -2
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +6 -608
- package/dist/index339.js.map +1 -1
- package/dist/index340.js +11 -294
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +6 -88
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +3 -10
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +3 -19
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +4 -61
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +5 -33
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +3 -466
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +9 -125
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +33 -134
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +21 -3
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +5 -5
- package/dist/index351.js +2 -2
- package/dist/index357.js +464 -8
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +126 -33
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +133 -20
- package/dist/index359.js.map +1 -1
- package/dist/index53.js +21 -15
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +15 -9
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +20 -14
- package/dist/index55.js.map +1 -1
- package/dist/index62.js +42 -22
- package/dist/index62.js.map +1 -1
- package/dist/server/index.js +50 -12
- package/package.json +1 -1
package/dist/index331.js
CHANGED
|
@@ -1,7 +1,612 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { createComponent as f, Portal as ke, mergeProps as C, memo as te } from "solid-js/web";
|
|
2
|
+
import { HiddenSelectBase as Te } from "./index333.js";
|
|
3
|
+
import { ListboxRoot as Be } from "./index332.js";
|
|
4
|
+
import { getItemCount as he } from "./index334.js";
|
|
5
|
+
import { Popper as ye } from "./index308.js";
|
|
6
|
+
import { ListKeyboardDelegate as _e } from "./index309.js";
|
|
7
|
+
import { createListState as We, Selection as ze, createSelectableCollection as $e } from "./index310.js";
|
|
8
|
+
import { createFilter as Ge } from "./index252.js";
|
|
9
|
+
import { createFocusScope as Ne } from "./index287.js";
|
|
10
|
+
import { createHideOutside as qe } from "./index288.js";
|
|
11
|
+
import { DismissableLayer as He } from "./index289.js";
|
|
12
|
+
import { announce as Q } from "./index301.js";
|
|
13
|
+
import { createDisclosureState as Ue } from "./index290.js";
|
|
14
|
+
import { FORM_CONTROL_FIELD_PROP_NAMES as Xe, createFormControlField as Ye } from "./index335.js";
|
|
15
|
+
import { createFormResetListener as je } from "./index318.js";
|
|
16
|
+
import { useFormControlContext as oe, FORM_CONTROL_PROP_NAMES as Je, createFormControl as Qe, FormControlContext as Ze } from "./index320.js";
|
|
17
|
+
import { createRegisterId as et } from "./index292.js";
|
|
18
|
+
import { createControllableSignal as tt } from "./index304.js";
|
|
19
|
+
import { Polymorphic as B } from "./index293.js";
|
|
20
|
+
import { Show as Ce, splitProps as A, createEffect as M, onCleanup as ot, createUniqueId as nt, createSignal as y, createMemo as v, on as Z, useContext as st, children as rt, createContext as lt } from "solid-js";
|
|
21
|
+
import { mergeDefaultProps as _, isAppleDevice as ee, callHandler as x, contains as Oe, isFunction as L, focusWithoutScrolling as Se, createGenerateId as it } from "./index294.js";
|
|
22
|
+
import at from "./index295.js";
|
|
23
|
+
import ct from "./index296.js";
|
|
24
|
+
import { mergeRefs as W } from "./index297.js";
|
|
25
|
+
import { combineStyle as ut } from "./index298.js";
|
|
26
|
+
import { access as K } from "./index300.js";
|
|
27
|
+
var ve = lt();
|
|
28
|
+
function F() {
|
|
29
|
+
const i = st(ve);
|
|
30
|
+
if (i === void 0)
|
|
31
|
+
throw new Error("[kobalte]: `useComboboxContext` must be used within a `Combobox` component");
|
|
32
|
+
return i;
|
|
33
|
+
}
|
|
34
|
+
function _t(i) {
|
|
35
|
+
let r;
|
|
36
|
+
const n = F(), [o, t] = A(i, ["ref", "style", "onCloseAutoFocus", "onFocusOutside"]), d = () => {
|
|
37
|
+
n.resetInputValue(n.listState().selectionManager().selectedKeys()), n.close(), setTimeout(() => {
|
|
38
|
+
n.close();
|
|
39
|
+
});
|
|
40
|
+
}, g = (c) => {
|
|
41
|
+
o.onFocusOutside?.(c), n.isOpen() && n.isModal() && c.preventDefault();
|
|
42
|
+
};
|
|
43
|
+
return qe({
|
|
44
|
+
isDisabled: () => !(n.isOpen() && n.isModal()),
|
|
45
|
+
targets: () => {
|
|
46
|
+
const c = [];
|
|
47
|
+
r && c.push(r);
|
|
48
|
+
const m = n.controlRef();
|
|
49
|
+
return m && c.push(m), c;
|
|
50
|
+
}
|
|
51
|
+
}), at({
|
|
52
|
+
element: () => r ?? null,
|
|
53
|
+
enabled: () => n.contentPresent() && n.preventScroll()
|
|
54
|
+
}), Ne({
|
|
55
|
+
trapFocus: () => n.isOpen() && n.isModal(),
|
|
56
|
+
onMountAutoFocus: (c) => {
|
|
57
|
+
c.preventDefault();
|
|
58
|
+
},
|
|
59
|
+
onUnmountAutoFocus: (c) => {
|
|
60
|
+
o.onCloseAutoFocus?.(c), c.defaultPrevented || (Se(n.inputRef()), c.preventDefault());
|
|
61
|
+
}
|
|
62
|
+
}, () => r), f(Ce, {
|
|
63
|
+
get when() {
|
|
64
|
+
return n.contentPresent();
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return f(ye.Positioner, {
|
|
68
|
+
get children() {
|
|
69
|
+
return f(He, C({
|
|
70
|
+
ref(c) {
|
|
71
|
+
var m = W((O) => {
|
|
72
|
+
n.setContentRef(O), r = O;
|
|
73
|
+
}, o.ref);
|
|
74
|
+
typeof m == "function" && m(c);
|
|
75
|
+
},
|
|
76
|
+
get disableOutsidePointerEvents() {
|
|
77
|
+
return te(() => !!n.isModal())() && n.isOpen();
|
|
78
|
+
},
|
|
79
|
+
get excludedElements() {
|
|
80
|
+
return [n.controlRef];
|
|
81
|
+
},
|
|
82
|
+
get style() {
|
|
83
|
+
return ut({
|
|
84
|
+
"--kb-combobox-content-transform-origin": "var(--kb-popper-content-transform-origin)",
|
|
85
|
+
position: "relative"
|
|
86
|
+
}, o.style);
|
|
87
|
+
},
|
|
88
|
+
onFocusOutside: g,
|
|
89
|
+
onDismiss: d
|
|
90
|
+
}, () => n.dataset(), t));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function Wt(i) {
|
|
97
|
+
let r;
|
|
98
|
+
const n = oe(), o = F(), t = _({
|
|
99
|
+
id: o.generateId("input")
|
|
100
|
+
}, i), [d, g, c] = A(t, ["ref", "disabled", "onClick", "onInput", "onKeyDown", "onFocus", "onBlur", "onTouchEnd"], Xe), m = () => o.listState().collection(), O = () => o.listState().selectionManager(), I = () => d.disabled || o.isDisabled() || n.isDisabled(), {
|
|
101
|
+
fieldProps: w
|
|
102
|
+
} = Ye(g), D = (l) => {
|
|
103
|
+
x(l, d.onClick), o.triggerMode() === "focus" && !o.isOpen() && o.open(!1, "focus");
|
|
104
|
+
}, z = (l) => {
|
|
105
|
+
if (x(l, d.onInput), n.isReadOnly() || I())
|
|
106
|
+
return;
|
|
107
|
+
const p = l.target;
|
|
108
|
+
o.setInputValue(p.value), p.value = o.inputValue() ?? "", o.isOpen() ? m().getSize() <= 0 && !o.allowsEmptyCollection() && o.close() : (m().getSize() > 0 || o.allowsEmptyCollection()) && o.open(!1, "input");
|
|
109
|
+
}, $ = (l) => {
|
|
110
|
+
if (x(l, d.onKeyDown), !(n.isReadOnly() || I()))
|
|
111
|
+
switch (o.isOpen() && x(l, o.onInputKeyDown), l.key) {
|
|
112
|
+
case "Enter":
|
|
113
|
+
if (o.isOpen()) {
|
|
114
|
+
l.preventDefault();
|
|
115
|
+
const p = O().focusedKey();
|
|
116
|
+
p != null && O().select(p);
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
case "Tab":
|
|
120
|
+
o.isOpen() && (o.close(), o.resetInputValue(o.listState().selectionManager().selectedKeys()));
|
|
121
|
+
break;
|
|
122
|
+
case "Escape":
|
|
123
|
+
o.isOpen() ? (o.close(), o.resetInputValue(o.listState().selectionManager().selectedKeys())) : o.setInputValue("");
|
|
124
|
+
break;
|
|
125
|
+
case "ArrowDown":
|
|
126
|
+
o.isOpen() || o.open(l.altKey ? !1 : "first", "manual");
|
|
127
|
+
break;
|
|
128
|
+
case "ArrowUp":
|
|
129
|
+
o.isOpen() ? l.altKey && (o.close(), o.resetInputValue(o.listState().selectionManager().selectedKeys())) : o.open("last", "manual");
|
|
130
|
+
break;
|
|
131
|
+
case "ArrowLeft":
|
|
132
|
+
case "ArrowRight":
|
|
133
|
+
O().setFocusedKey(void 0);
|
|
134
|
+
break;
|
|
135
|
+
case "Backspace":
|
|
136
|
+
if (o.removeOnBackspace() && O().selectionMode() === "multiple" && o.inputValue() === "") {
|
|
137
|
+
const p = [...O().selectedKeys()].pop() ?? "";
|
|
138
|
+
O().toggleSelection(p);
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}, G = (l) => {
|
|
143
|
+
x(l, d.onFocus), !o.isInputFocused() && o.setIsInputFocused(!0);
|
|
144
|
+
}, V = (l) => {
|
|
145
|
+
x(l, d.onBlur), !(Oe(o.controlRef(), l.relatedTarget) || Oe(o.contentRef(), l.relatedTarget)) && o.setIsInputFocused(!1);
|
|
146
|
+
};
|
|
147
|
+
let E = 0;
|
|
148
|
+
return f(B, C({
|
|
149
|
+
as: "input",
|
|
150
|
+
ref(l) {
|
|
151
|
+
var p = W((S) => {
|
|
152
|
+
o.setInputRef(S), r = S;
|
|
153
|
+
}, d.ref);
|
|
154
|
+
typeof p == "function" && p(l);
|
|
155
|
+
},
|
|
156
|
+
get id() {
|
|
157
|
+
return w.id();
|
|
158
|
+
},
|
|
159
|
+
get value() {
|
|
160
|
+
return o.inputValue();
|
|
161
|
+
},
|
|
162
|
+
get required() {
|
|
163
|
+
return n.isRequired();
|
|
164
|
+
},
|
|
165
|
+
get disabled() {
|
|
166
|
+
return n.isDisabled();
|
|
167
|
+
},
|
|
168
|
+
get readonly() {
|
|
169
|
+
return n.isReadOnly();
|
|
170
|
+
},
|
|
171
|
+
get placeholder() {
|
|
172
|
+
return o.placeholder();
|
|
173
|
+
},
|
|
174
|
+
type: "text",
|
|
175
|
+
role: "combobox",
|
|
176
|
+
autoComplete: "off",
|
|
177
|
+
autoCorrect: "off",
|
|
178
|
+
spellCheck: "false",
|
|
179
|
+
"aria-haspopup": "listbox",
|
|
180
|
+
"aria-autocomplete": "list",
|
|
181
|
+
get "aria-expanded"() {
|
|
182
|
+
return o.isOpen();
|
|
183
|
+
},
|
|
184
|
+
get "aria-controls"() {
|
|
185
|
+
return te(() => !!o.isOpen())() ? o.listboxId() : void 0;
|
|
186
|
+
},
|
|
187
|
+
get "aria-activedescendant"() {
|
|
188
|
+
return o.activeDescendant();
|
|
189
|
+
},
|
|
190
|
+
get "aria-label"() {
|
|
191
|
+
return w.ariaLabel();
|
|
192
|
+
},
|
|
193
|
+
get "aria-labelledby"() {
|
|
194
|
+
return w.ariaLabelledBy();
|
|
195
|
+
},
|
|
196
|
+
get "aria-describedby"() {
|
|
197
|
+
return w.ariaDescribedBy();
|
|
198
|
+
},
|
|
199
|
+
get "aria-invalid"() {
|
|
200
|
+
return n.validationState() === "invalid" || void 0;
|
|
201
|
+
},
|
|
202
|
+
get "aria-required"() {
|
|
203
|
+
return n.isRequired() || void 0;
|
|
204
|
+
},
|
|
205
|
+
get "aria-disabled"() {
|
|
206
|
+
return n.isDisabled() || void 0;
|
|
207
|
+
},
|
|
208
|
+
get "aria-readonly"() {
|
|
209
|
+
return n.isReadOnly() || void 0;
|
|
210
|
+
},
|
|
211
|
+
onClick: D,
|
|
212
|
+
onInput: z,
|
|
213
|
+
onKeyDown: $,
|
|
214
|
+
onFocus: G,
|
|
215
|
+
onBlur: V,
|
|
216
|
+
onTouchEnd: (l) => {
|
|
217
|
+
if (x(l, d.onTouchEnd), !r || n.isReadOnly() || I())
|
|
218
|
+
return;
|
|
219
|
+
if (l.timeStamp - E < 500) {
|
|
220
|
+
l.preventDefault(), r.focus();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const p = l.target.getBoundingClientRect(), S = l.changedTouches[0], P = Math.ceil(p.left + 0.5 * p.width), q = Math.ceil(p.top + 0.5 * p.height);
|
|
224
|
+
S.clientX === P && S.clientY === q && (l.preventDefault(), r.focus(), o.toggle(!1, "manual"), E = l.timeStamp);
|
|
225
|
+
}
|
|
226
|
+
}, () => o.dataset(), () => n.dataset(), c));
|
|
227
|
+
}
|
|
228
|
+
function zt(i) {
|
|
229
|
+
const r = oe(), n = F(), o = _({
|
|
230
|
+
id: n.generateId("listbox")
|
|
231
|
+
}, i), [t, d] = A(o, ["ref"]), g = () => r.getAriaLabelledBy(d.id, n.listboxAriaLabel(), void 0);
|
|
232
|
+
return M(() => ot(n.registerListboxId(d.id))), f(Be, C({
|
|
233
|
+
ref(c) {
|
|
234
|
+
var m = W(n.setListboxRef, t.ref);
|
|
235
|
+
typeof m == "function" && m(c);
|
|
236
|
+
},
|
|
237
|
+
get state() {
|
|
238
|
+
return n.listState();
|
|
239
|
+
},
|
|
240
|
+
get autoFocus() {
|
|
241
|
+
return n.autoFocus();
|
|
242
|
+
},
|
|
243
|
+
shouldUseVirtualFocus: !0,
|
|
244
|
+
shouldSelectOnPressUp: !0,
|
|
245
|
+
shouldFocusOnHover: !0,
|
|
246
|
+
get "aria-label"() {
|
|
247
|
+
return n.listboxAriaLabel();
|
|
248
|
+
},
|
|
249
|
+
get "aria-labelledby"() {
|
|
250
|
+
return g();
|
|
251
|
+
},
|
|
252
|
+
get renderItem() {
|
|
253
|
+
return n.renderItem;
|
|
254
|
+
},
|
|
255
|
+
get renderSection() {
|
|
256
|
+
return n.renderSection;
|
|
257
|
+
},
|
|
258
|
+
get virtualized() {
|
|
259
|
+
return n.isVirtualized();
|
|
260
|
+
}
|
|
261
|
+
}, d));
|
|
262
|
+
}
|
|
263
|
+
function $t(i) {
|
|
264
|
+
const r = F();
|
|
265
|
+
return f(Ce, {
|
|
266
|
+
get when() {
|
|
267
|
+
return r.contentPresent();
|
|
268
|
+
},
|
|
269
|
+
get children() {
|
|
270
|
+
return f(ke, i);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
function Gt(i) {
|
|
275
|
+
const r = oe(), n = F(), [o, t] = A(i, ["ref", "children"]), d = () => n.listState().selectionManager();
|
|
276
|
+
return f(B, C({
|
|
277
|
+
as: "div",
|
|
278
|
+
ref(g) {
|
|
279
|
+
var c = W(n.setControlRef, o.ref);
|
|
280
|
+
typeof c == "function" && c(g);
|
|
281
|
+
}
|
|
282
|
+
}, () => n.dataset(), () => r.dataset(), t, {
|
|
283
|
+
get children() {
|
|
284
|
+
return f(dt, {
|
|
285
|
+
state: {
|
|
286
|
+
selectedOptions: () => n.selectedOptions(),
|
|
287
|
+
remove: (g) => n.removeOptionFromSelection(g),
|
|
288
|
+
clear: () => d().clearSelection()
|
|
289
|
+
},
|
|
290
|
+
get children() {
|
|
291
|
+
return o.children;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}));
|
|
296
|
+
}
|
|
297
|
+
function dt(i) {
|
|
298
|
+
const r = rt(() => {
|
|
299
|
+
const n = i.children;
|
|
300
|
+
return L(n) ? n(i.state) : n;
|
|
301
|
+
});
|
|
302
|
+
return te(r);
|
|
303
|
+
}
|
|
304
|
+
function Nt(i) {
|
|
305
|
+
const r = F();
|
|
306
|
+
return f(Te, C({
|
|
307
|
+
get collection() {
|
|
308
|
+
return r.listState().collection();
|
|
309
|
+
},
|
|
310
|
+
get selectionManager() {
|
|
311
|
+
return r.listState().selectionManager();
|
|
312
|
+
},
|
|
313
|
+
get isOpen() {
|
|
314
|
+
return r.isOpen();
|
|
315
|
+
},
|
|
316
|
+
get isMultiple() {
|
|
317
|
+
return r.isMultiple();
|
|
318
|
+
},
|
|
319
|
+
get isVirtualized() {
|
|
320
|
+
return r.isVirtualized();
|
|
321
|
+
},
|
|
322
|
+
focusTrigger: () => r.inputRef()?.focus({
|
|
323
|
+
preventScroll: !0
|
|
324
|
+
})
|
|
325
|
+
}, i));
|
|
326
|
+
}
|
|
327
|
+
function qt(i) {
|
|
328
|
+
const r = F(), n = _({
|
|
329
|
+
children: "▼"
|
|
330
|
+
}, i);
|
|
331
|
+
return f(B, C({
|
|
332
|
+
as: "span",
|
|
333
|
+
"aria-hidden": "true"
|
|
334
|
+
}, () => r.dataset(), n));
|
|
335
|
+
}
|
|
336
|
+
var pt = {
|
|
337
|
+
// Annouce option to screen readers on focus.
|
|
338
|
+
focusAnnouncement: (i, r) => `${i}${r ? ", selected" : ""}`,
|
|
339
|
+
// Annouce the number of options available to screen readers on open.
|
|
340
|
+
countAnnouncement: (i) => {
|
|
341
|
+
if (i === 1)
|
|
342
|
+
return "one option available";
|
|
343
|
+
},
|
|
344
|
+
// Annouce the selection of an option to screen readers.
|
|
345
|
+
selectedAnnouncement: (i) => `${i}, selected`,
|
|
346
|
+
// `aria-label` of Combobox.Trigger.
|
|
347
|
+
triggerLabel: "Show suggestions",
|
|
348
|
+
// `aria-label` of Combobox.Listbox.
|
|
349
|
+
listboxLabel: "Suggestions"
|
|
350
|
+
};
|
|
351
|
+
function Ht(i) {
|
|
352
|
+
const r = `combobox-${nt()}`, n = Ge({
|
|
353
|
+
sensitivity: "base"
|
|
354
|
+
}), o = _({
|
|
355
|
+
id: r,
|
|
356
|
+
selectionMode: "single",
|
|
357
|
+
allowsEmptyCollection: !1,
|
|
358
|
+
disallowEmptySelection: !1,
|
|
359
|
+
allowDuplicateSelectionEvents: !0,
|
|
360
|
+
closeOnSelection: i.selectionMode === "single",
|
|
361
|
+
removeOnBackspace: !0,
|
|
362
|
+
gutter: 8,
|
|
363
|
+
sameWidth: !0,
|
|
364
|
+
modal: !1,
|
|
365
|
+
defaultFilter: "contains",
|
|
366
|
+
triggerMode: "input",
|
|
367
|
+
translations: pt
|
|
368
|
+
}, i), [t, d, g, c] = A(o, ["noResetInputOnBlur", "translations", "itemComponent", "sectionComponent", "open", "defaultOpen", "onOpenChange", "onInputChange", "value", "defaultValue", "onChange", "triggerMode", "placeholder", "options", "optionValue", "optionTextValue", "optionLabel", "optionDisabled", "optionGroupChildren", "keyboardDelegate", "allowDuplicateSelectionEvents", "disallowEmptySelection", "defaultFilter", "shouldFocusWrap", "allowsEmptyCollection", "closeOnSelection", "removeOnBackspace", "selectionBehavior", "selectionMode", "virtualized", "modal", "preventScroll", "forceMount"], ["getAnchorRect", "placement", "gutter", "shift", "flip", "slide", "overlap", "sameWidth", "fitViewport", "hideWhenDetached", "detachedPadding", "arrowPadding", "overflowPadding"], Je), [m, O] = y(), [I, w] = y(), [D, z] = y(), [$, G] = y(), [V, E] = y(), [N, l] = y(), [p, S] = y(!1), [P, q] = y(!1), [H, ne] = y(!1), [xe, se] = y(t.options), h = Ue({
|
|
369
|
+
open: () => t.open,
|
|
370
|
+
defaultOpen: () => t.defaultOpen,
|
|
371
|
+
onOpenChange: (e) => t.onOpenChange?.(e, ie)
|
|
372
|
+
}), [U, X] = tt({
|
|
373
|
+
defaultValue: () => "",
|
|
374
|
+
onChange: (e) => {
|
|
375
|
+
t.onInputChange?.(e), e === "" && t.selectionMode === "single" && !a.selectionManager().isEmpty() && t.value === void 0 && a.selectionManager().setSelectedKeys([]), a.selectionManager().setFocusedKey(void 0);
|
|
376
|
+
}
|
|
377
|
+
}), R = (e) => {
|
|
378
|
+
const s = t.optionValue;
|
|
379
|
+
return s == null ? String(e) : String(L(s) ? s(e) : e[s]);
|
|
380
|
+
}, Me = (e) => {
|
|
381
|
+
const s = t.optionLabel;
|
|
382
|
+
return s == null ? String(e) : String(L(s) ? s(e) : e[s]);
|
|
383
|
+
}, Fe = (e) => {
|
|
384
|
+
const s = t.optionTextValue;
|
|
385
|
+
return s == null ? String(e) : String(L(s) ? s(e) : e[s]);
|
|
386
|
+
}, re = v(() => {
|
|
387
|
+
const e = t.optionGroupChildren;
|
|
388
|
+
return e == null ? t.options : t.options.flatMap((s) => s[e] ?? s);
|
|
389
|
+
}), le = (e) => {
|
|
390
|
+
const s = U() ?? "";
|
|
391
|
+
if (L(t.defaultFilter))
|
|
392
|
+
return t.defaultFilter?.(e, s);
|
|
393
|
+
const u = Fe(e);
|
|
394
|
+
switch (t.defaultFilter) {
|
|
395
|
+
case "startsWith":
|
|
396
|
+
return n.startsWith(u, s);
|
|
397
|
+
case "endsWith":
|
|
398
|
+
return n.endsWith(u, s);
|
|
399
|
+
case "contains":
|
|
400
|
+
return n.contains(u, s);
|
|
401
|
+
}
|
|
402
|
+
}, Y = v(() => {
|
|
403
|
+
const e = t.optionGroupChildren;
|
|
404
|
+
if (e == null)
|
|
405
|
+
return t.options.filter(le);
|
|
406
|
+
const s = [];
|
|
407
|
+
for (const u of t.options) {
|
|
408
|
+
const b = u[e].filter(le);
|
|
409
|
+
b.length !== 0 && s.push({
|
|
410
|
+
...u,
|
|
411
|
+
[e]: b
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
return s;
|
|
415
|
+
}), Ie = v(() => h.isOpen() ? H() ? t.options : Y() : xe());
|
|
416
|
+
let ie = "focus";
|
|
417
|
+
const ae = (e) => [...e].map((s) => re().find((u) => R(u) === s)).filter((s) => s != null), a = We({
|
|
418
|
+
selectedKeys: () => t.value != null ? t.value.map(R) : t.value,
|
|
419
|
+
defaultSelectedKeys: () => t.defaultValue != null ? t.defaultValue.map(R) : t.defaultValue,
|
|
420
|
+
onSelectionChange: (e) => {
|
|
421
|
+
t.onChange?.(ae(e)), t.closeOnSelection && h.isOpen() && e.size > 0 && (k(), setTimeout(k));
|
|
422
|
+
const s = D();
|
|
423
|
+
s && (s.setSelectionRange(s.value.length, s.value.length), Se(s));
|
|
424
|
+
},
|
|
425
|
+
allowDuplicateSelectionEvents: () => K(t.allowDuplicateSelectionEvents),
|
|
426
|
+
disallowEmptySelection: () => t.disallowEmptySelection,
|
|
427
|
+
selectionBehavior: () => K(t.selectionBehavior),
|
|
428
|
+
selectionMode: () => t.selectionMode,
|
|
429
|
+
dataSource: Ie,
|
|
430
|
+
getKey: () => t.optionValue,
|
|
431
|
+
getTextValue: () => t.optionTextValue,
|
|
432
|
+
getDisabled: () => t.optionDisabled,
|
|
433
|
+
getSectionChildren: () => t.optionGroupChildren
|
|
434
|
+
}), we = v(() => ae(a.selectionManager().selectedKeys())), De = (e) => {
|
|
435
|
+
a.selectionManager().toggleSelection(R(e));
|
|
436
|
+
}, {
|
|
437
|
+
present: Re
|
|
438
|
+
} = ct({
|
|
439
|
+
show: () => t.forceMount || h.isOpen(),
|
|
440
|
+
element: () => V() ?? null
|
|
441
|
+
}), j = (e, s) => {
|
|
442
|
+
if (t.triggerMode === "manual" && s !== "manual" || !(ne(s === "manual") ? t.options.length > 0 : Y().length > 0) && !t.allowsEmptyCollection)
|
|
443
|
+
return;
|
|
444
|
+
ie = s, S(e), h.open();
|
|
445
|
+
let T = a.selectionManager().firstSelectedKey();
|
|
446
|
+
T == null && (e === "first" ? T = a.collection().getFirstKey() : e === "last" && (T = a.collection().getLastKey())), a.selectionManager().setFocused(!0), a.selectionManager().setFocusedKey(T);
|
|
447
|
+
}, k = () => {
|
|
448
|
+
h.close(), a.selectionManager().setFocused(!1), a.selectionManager().setFocusedKey(void 0);
|
|
449
|
+
}, Ke = (e, s) => {
|
|
450
|
+
h.isOpen() ? k() : j(e, s);
|
|
451
|
+
}, {
|
|
452
|
+
formControlContext: J
|
|
453
|
+
} = Qe(g);
|
|
454
|
+
je(D, () => {
|
|
455
|
+
const e = t.defaultValue ? [...t.defaultValue].map(R) : new ze();
|
|
456
|
+
a.selectionManager().setSelectedKeys(e);
|
|
457
|
+
});
|
|
458
|
+
const ce = v(() => {
|
|
459
|
+
const e = K(t.keyboardDelegate);
|
|
460
|
+
return e || new _e(a.collection, N, void 0);
|
|
461
|
+
}), Ve = $e({
|
|
462
|
+
selectionManager: () => a.selectionManager(),
|
|
463
|
+
keyboardDelegate: ce,
|
|
464
|
+
disallowTypeAhead: !0,
|
|
465
|
+
disallowEmptySelection: !0,
|
|
466
|
+
shouldFocusWrap: () => t.shouldFocusWrap,
|
|
467
|
+
// Prevent item scroll behavior from being applied here, handled in the Listbox component.
|
|
468
|
+
isVirtualized: !0
|
|
469
|
+
}, D), Le = (e) => {
|
|
470
|
+
e && t.triggerMode === "focus" && j(!1, "focus"), q(e), a.selectionManager().setFocused(e);
|
|
471
|
+
}, Ae = v(() => {
|
|
472
|
+
const e = a.selectionManager().focusedKey();
|
|
473
|
+
if (e)
|
|
474
|
+
return N()?.querySelector(`[data-key="${e}"]`)?.id;
|
|
475
|
+
}), ue = (e) => {
|
|
476
|
+
if (t.selectionMode === "single") {
|
|
477
|
+
const s = [...e][0], u = re().find((b) => R(b) === s);
|
|
478
|
+
if (t.noResetInputOnBlur && !u) return;
|
|
479
|
+
X(u ? Me(u) : "");
|
|
480
|
+
} else {
|
|
481
|
+
if (t.noResetInputOnBlur) return;
|
|
482
|
+
X("");
|
|
483
|
+
}
|
|
484
|
+
}, Ee = (e) => t.itemComponent?.({
|
|
485
|
+
item: e
|
|
486
|
+
}), Pe = (e) => t.sectionComponent?.({
|
|
487
|
+
section: e
|
|
488
|
+
});
|
|
489
|
+
M(Z([Y, H], (e, s) => {
|
|
490
|
+
if (h.isOpen() && s != null) {
|
|
491
|
+
const u = s[0], b = s[1];
|
|
492
|
+
se(b ? t.options : u);
|
|
493
|
+
} else {
|
|
494
|
+
const u = e[0], b = e[1];
|
|
495
|
+
se(b ? t.options : u);
|
|
496
|
+
}
|
|
497
|
+
})), M(Z(U, () => {
|
|
498
|
+
H() && ne(!1);
|
|
499
|
+
})), M(Z(() => a.selectionManager().selectedKeys(), ue));
|
|
500
|
+
let de = "";
|
|
501
|
+
M(() => {
|
|
502
|
+
const e = a.selectionManager().focusedKey() ?? "", s = a.collection().getItem(e);
|
|
503
|
+
if (ee() && s != null && e !== de) {
|
|
504
|
+
const u = a.selectionManager().isSelected(e), b = t.translations?.focusAnnouncement(s?.textValue || "", u) ?? "";
|
|
505
|
+
Q(b);
|
|
506
|
+
}
|
|
507
|
+
e && (de = e);
|
|
508
|
+
});
|
|
509
|
+
let pe = he(a.collection()), fe = h.isOpen();
|
|
510
|
+
M(() => {
|
|
511
|
+
const e = he(a.collection()), s = h.isOpen(), u = s !== fe && (a.selectionManager().focusedKey() == null || ee());
|
|
512
|
+
if (s && (u || e !== pe)) {
|
|
513
|
+
const b = t.translations?.countAnnouncement(e) ?? "";
|
|
514
|
+
Q(b);
|
|
515
|
+
}
|
|
516
|
+
pe = e, fe = s;
|
|
517
|
+
});
|
|
518
|
+
let ge = "";
|
|
519
|
+
M(() => {
|
|
520
|
+
const e = [...a.selectionManager().selectedKeys()].pop() ?? "", s = a.collection().getItem(e);
|
|
521
|
+
if (ee() && P() && s && e !== ge) {
|
|
522
|
+
const u = t.translations?.selectedAnnouncement(s?.textValue || "") ?? "";
|
|
523
|
+
Q(u);
|
|
524
|
+
}
|
|
525
|
+
e && (ge = e);
|
|
526
|
+
});
|
|
527
|
+
const me = v(() => ({
|
|
528
|
+
"data-expanded": h.isOpen() ? "" : void 0,
|
|
529
|
+
"data-closed": h.isOpen() ? void 0 : ""
|
|
530
|
+
})), be = {
|
|
531
|
+
dataset: me,
|
|
532
|
+
isOpen: h.isOpen,
|
|
533
|
+
isDisabled: () => J.isDisabled() ?? !1,
|
|
534
|
+
isMultiple: () => K(t.selectionMode) === "multiple",
|
|
535
|
+
isVirtualized: () => t.virtualized ?? !1,
|
|
536
|
+
isModal: () => t.modal ?? !1,
|
|
537
|
+
preventScroll: () => t.preventScroll ?? be.isModal(),
|
|
538
|
+
allowsEmptyCollection: () => t.allowsEmptyCollection ?? !1,
|
|
539
|
+
shouldFocusWrap: () => t.shouldFocusWrap ?? !1,
|
|
540
|
+
removeOnBackspace: () => t.removeOnBackspace ?? !0,
|
|
541
|
+
selectedOptions: we,
|
|
542
|
+
isInputFocused: P,
|
|
543
|
+
contentPresent: Re,
|
|
544
|
+
autoFocus: p,
|
|
545
|
+
inputValue: U,
|
|
546
|
+
triggerMode: () => t.triggerMode,
|
|
547
|
+
activeDescendant: Ae,
|
|
548
|
+
controlRef: I,
|
|
549
|
+
inputRef: D,
|
|
550
|
+
triggerRef: $,
|
|
551
|
+
contentRef: V,
|
|
552
|
+
listState: () => a,
|
|
553
|
+
keyboardDelegate: ce,
|
|
554
|
+
listboxId: m,
|
|
555
|
+
triggerAriaLabel: () => t.translations?.triggerLabel,
|
|
556
|
+
listboxAriaLabel: () => t.translations?.listboxLabel,
|
|
557
|
+
setIsInputFocused: Le,
|
|
558
|
+
resetInputValue: ue,
|
|
559
|
+
setInputValue: X,
|
|
560
|
+
setControlRef: w,
|
|
561
|
+
setInputRef: z,
|
|
562
|
+
setTriggerRef: G,
|
|
563
|
+
setContentRef: E,
|
|
564
|
+
setListboxRef: l,
|
|
565
|
+
open: j,
|
|
566
|
+
close: k,
|
|
567
|
+
toggle: Ke,
|
|
568
|
+
placeholder: () => t.placeholder,
|
|
569
|
+
renderItem: Ee,
|
|
570
|
+
renderSection: Pe,
|
|
571
|
+
removeOptionFromSelection: De,
|
|
572
|
+
onInputKeyDown: (e) => Ve.onKeyDown(e),
|
|
573
|
+
generateId: it(() => K(g.id)),
|
|
574
|
+
registerListboxId: et(O)
|
|
575
|
+
};
|
|
576
|
+
return f(Ze.Provider, {
|
|
577
|
+
value: J,
|
|
578
|
+
get children() {
|
|
579
|
+
return f(ve.Provider, {
|
|
580
|
+
value: be,
|
|
581
|
+
get children() {
|
|
582
|
+
return f(ye, C({
|
|
583
|
+
anchorRef: I,
|
|
584
|
+
contentRef: V
|
|
585
|
+
}, d, {
|
|
586
|
+
get children() {
|
|
587
|
+
return f(B, C({
|
|
588
|
+
as: "div",
|
|
589
|
+
role: "group",
|
|
590
|
+
get id() {
|
|
591
|
+
return K(g.id);
|
|
592
|
+
}
|
|
593
|
+
}, () => J.dataset(), me, c));
|
|
594
|
+
}
|
|
595
|
+
}));
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
});
|
|
3
600
|
}
|
|
4
601
|
export {
|
|
5
|
-
|
|
602
|
+
Ht as ComboboxBase,
|
|
603
|
+
_t as ComboboxContent,
|
|
604
|
+
Gt as ComboboxControl,
|
|
605
|
+
Nt as ComboboxHiddenSelect,
|
|
606
|
+
qt as ComboboxIcon,
|
|
607
|
+
Wt as ComboboxInput,
|
|
608
|
+
zt as ComboboxListbox,
|
|
609
|
+
$t as ComboboxPortal,
|
|
610
|
+
F as useComboboxContext
|
|
6
611
|
};
|
|
7
612
|
//# sourceMappingURL=index331.js.map
|