@floegence/floe-webapp-core 0.90.4 → 0.90.7
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/ui/Checkbox.js +17 -17
- package/dist/components/ui/Select.js +224 -205
- package/dist/language.css +4 -3
- package/dist/styles/themes/presets.js +5 -1
- package/dist/styles.css +1 -1
- package/dist/surface.css +50 -2
- package/dist/themes/shell-presets.generated.css +9 -7
- package/package.json +1 -1
|
@@ -1,74 +1,93 @@
|
|
|
1
|
-
import { createComponent as c, mergeProps as
|
|
2
|
-
import { createUniqueId as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useFloeLocale as
|
|
5
|
-
import { useOverlayMask as
|
|
6
|
-
import { SurfaceFloatingLayer as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { createComponent as c, mergeProps as R, insert as o, spread as te, memo as K, effect as P, use as le, setAttribute as m, className as ve, template as w, delegateEvents as ge } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as me, createSignal as B, createMemo as he, createEffect as N, untrack as be, onCleanup as ae, onMount as ye, Show as V, For as Q } from "solid-js";
|
|
3
|
+
import { cn as re } from "../../utils/cn.js";
|
|
4
|
+
import { useFloeLocale as we } from "../../context/LocaleContext.js";
|
|
5
|
+
import { useOverlayMask as Ce } from "../../hooks/useOverlayMask.js";
|
|
6
|
+
import { SurfaceFloatingLayer as xe } from "./SurfaceFloatingLayer.js";
|
|
7
|
+
import { createFloatingPresence as ke } from "./floatingPresence.js";
|
|
8
|
+
import { calculateMenuPosition as Ve } from "./menuUtils.js";
|
|
9
|
+
import { useFormControl as Le, joinAriaIds as Oe } from "./formFieldContext.js";
|
|
10
|
+
import { createControllableValue as M } from "./controllable.js";
|
|
11
|
+
import { ChevronDown as $e, Check as Ee } from "../icons/index.js";
|
|
12
|
+
import { resolveSurfacePortalBoundaryRect as De, resolveSurfacePortalHost as Pe } from "./dialogSurfaceScope.js";
|
|
13
|
+
var Se = /* @__PURE__ */ w("<input>"), _e = /* @__PURE__ */ w("<option value>"), qe = /* @__PURE__ */ w('<div role=status class="px-2 py-2 text-caption">'), Ae = /* @__PURE__ */ w("<button type=button>"), Fe = /* @__PURE__ */ w('<div role=alert class="p-2 text-error">'), Te = /* @__PURE__ */ w('<div role=status class="p-2 text-caption">'), Be = /* @__PURE__ */ w('<div class="floe-floating-presence floe-floating-menu rounded-panel border border-[var(--floe-line)] bg-popover text-popover-foreground shadow-[var(--floe-elevation-float)] p-1"data-floe-surface=floating><div role=listbox class="max-h-64 overflow-y-auto"data-floe-local-interaction-surface=true>'), Re = /* @__PURE__ */ w('<div class="relative min-w-0"><select tabindex=-1 aria-hidden=true class="sr-only pointer-events-none">'), Ie = /* @__PURE__ */ w("<button><span class=truncate>"), Ke = /* @__PURE__ */ w("<option selected>"), Me = /* @__PURE__ */ w("<option>"), He = /* @__PURE__ */ w('<div role=option><span class="h-3.5 w-3.5 shrink-0">');
|
|
14
|
+
function U(e) {
|
|
15
|
+
const u = we(), g = Le(), b = me(), W = () => e.id ?? g.id ?? "select-" + b, S = "options-" + b, _ = () => e.disabled ?? g.disabled, q = () => e.readOnly ?? g.readOnly, [h, ne] = M({
|
|
15
16
|
value: () => e.open,
|
|
16
17
|
defaultValue: e.defaultOpen ?? !1,
|
|
17
18
|
onChange: (t) => e.onOpenChange?.(t)
|
|
18
|
-
}), [
|
|
19
|
+
}), [H, G] = B(""), [L, E] = B(-1), [ie, oe] = B({
|
|
19
20
|
x: 0,
|
|
20
21
|
y: 0
|
|
21
|
-
}), [
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
}), [ue, de] = B(200);
|
|
23
|
+
let x, O, k, I;
|
|
24
|
+
const D = ke({
|
|
25
|
+
open: h,
|
|
26
|
+
element: () => k
|
|
27
|
+
}), [se, ce] = B("bottom");
|
|
28
|
+
let j = "", J = 0;
|
|
29
|
+
const C = he(() => {
|
|
30
|
+
if (!e.searchable || e.filter === !1 || !H()) return e.options;
|
|
31
|
+
const t = H().toLocaleLowerCase(u.locale);
|
|
32
|
+
return e.options.filter((a) => [a.label, ...a.keywords ?? []].some((i) => i.toLocaleLowerCase(u.locale).includes(t)));
|
|
33
|
+
}), X = () => e.values.map((t) => e.options.find((a) => a.value === t)?.label ?? t).join(", "), y = (t) => {
|
|
34
|
+
t && (_() || q()) || (ne(t), t || G(""));
|
|
35
|
+
}, z = (t) => {
|
|
36
|
+
_() || q() || t.disabled || (e.onValuesChange(e.multiple ? e.values.includes(t.value) ? e.values.filter((a) => a !== t.value) : [...e.values, t.value] : [t.value]), e.multiple || y(!1), x?.focus({
|
|
31
37
|
preventScroll: !0
|
|
32
38
|
}));
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
|
|
39
|
+
}, Y = (t, a) => {
|
|
40
|
+
const i = C().map((v, r) => v.disabled ? -1 : r).filter((v) => v >= 0);
|
|
41
|
+
if (!i.length) {
|
|
42
|
+
E(-1);
|
|
37
43
|
return;
|
|
38
44
|
}
|
|
39
|
-
const l =
|
|
40
|
-
|
|
45
|
+
const l = i.indexOf(L()), n = a === "first" ? 0 : a === "last" ? i.length - 1 : l < 0 ? t < 0 ? i.length - 1 : 0 : (l + t + i.length) % i.length;
|
|
46
|
+
E(i[n]), k?.querySelector('[id="' + S + "-" + i[n] + '"]')?.scrollIntoView({
|
|
41
47
|
block: "nearest"
|
|
42
48
|
});
|
|
43
|
-
},
|
|
44
|
-
if (!
|
|
45
|
-
const t =
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
owner:
|
|
49
|
-
}))
|
|
50
|
-
|
|
49
|
+
}, fe = () => {
|
|
50
|
+
if (!x || !k) return;
|
|
51
|
+
const t = x.getBoundingClientRect();
|
|
52
|
+
de(t.width);
|
|
53
|
+
const a = De(Pe({
|
|
54
|
+
owner: x
|
|
55
|
+
})), i = Ve(
|
|
56
|
+
t,
|
|
57
|
+
// The position layer is never transformed; motion belongs to its child.
|
|
58
|
+
I?.getBoundingClientRect() ?? k.getBoundingClientRect(),
|
|
59
|
+
u.direction === "rtl" ? "end" : "start",
|
|
60
|
+
a
|
|
61
|
+
);
|
|
62
|
+
ce(i.y < t.top ? "top" : "bottom"), oe(i);
|
|
51
63
|
};
|
|
52
|
-
|
|
53
|
-
if (!
|
|
54
|
-
const t =
|
|
55
|
-
if (t < 0 || !
|
|
56
|
-
const
|
|
57
|
-
|
|
64
|
+
N(() => {
|
|
65
|
+
if (!h()) return;
|
|
66
|
+
const t = be(L);
|
|
67
|
+
if (t < 0 || !C()[t] || C()[t].disabled) {
|
|
68
|
+
const a = C().findIndex((i) => !i.disabled && e.values.includes(i.value));
|
|
69
|
+
E(a >= 0 ? a : C().findIndex((i) => !i.disabled));
|
|
58
70
|
}
|
|
59
|
-
}),
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
}), N(() => {
|
|
72
|
+
if (!D.mounted() || D.exiting() || typeof window > "u") return;
|
|
73
|
+
let t = 0;
|
|
74
|
+
const a = () => {
|
|
75
|
+
t || (t = requestAnimationFrame(() => {
|
|
76
|
+
t = 0, fe();
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
a();
|
|
80
|
+
const i = new ResizeObserver(a);
|
|
81
|
+
x && i.observe(x), I && i.observe(I), window.addEventListener("resize", a), window.addEventListener("scroll", a, !0), ae(() => {
|
|
82
|
+
cancelAnimationFrame(t), i.disconnect(), window.removeEventListener("resize", a), window.removeEventListener("scroll", a, !0);
|
|
64
83
|
});
|
|
65
|
-
}),
|
|
66
|
-
open:
|
|
84
|
+
}), Ce({
|
|
85
|
+
open: h,
|
|
67
86
|
root: () => k,
|
|
68
|
-
containsTarget: (t) => t instanceof Node && !!(k?.contains(t) ||
|
|
69
|
-
onClose: () =>
|
|
70
|
-
onInteractOutside: () =>
|
|
71
|
-
onEscapeOutside: () =>
|
|
87
|
+
containsTarget: (t) => t instanceof Node && !!(k?.contains(t) || x?.contains(t)),
|
|
88
|
+
onClose: () => y(!1),
|
|
89
|
+
onInteractOutside: () => y(!1),
|
|
90
|
+
onEscapeOutside: () => y(!1),
|
|
72
91
|
lockBodyScroll: !1,
|
|
73
92
|
trapFocus: !1,
|
|
74
93
|
autoFocus: !1,
|
|
@@ -76,42 +95,42 @@ function H(e) {
|
|
|
76
95
|
blockHotkeys: !1,
|
|
77
96
|
closeOnEscape: "inside",
|
|
78
97
|
escapeKeyPhase: "bubble"
|
|
79
|
-
}),
|
|
80
|
-
const t =
|
|
81
|
-
let
|
|
82
|
-
const
|
|
83
|
-
clearTimeout(
|
|
84
|
-
if (!l.defaultPrevented && (e.onValuesChange([...e.resetValues]),
|
|
85
|
-
for (const
|
|
98
|
+
}), ye(() => {
|
|
99
|
+
const t = O?.form;
|
|
100
|
+
let a;
|
|
101
|
+
const i = (l) => {
|
|
102
|
+
clearTimeout(a), a = setTimeout(() => {
|
|
103
|
+
if (!l.defaultPrevented && (e.onValuesChange([...e.resetValues]), y(!1), O))
|
|
104
|
+
for (const n of O.options) n.selected = e.values.includes(n.value);
|
|
86
105
|
});
|
|
87
106
|
};
|
|
88
|
-
t?.addEventListener("reset",
|
|
89
|
-
clearTimeout(
|
|
107
|
+
t?.addEventListener("reset", i), ae(() => {
|
|
108
|
+
clearTimeout(a), t?.removeEventListener("reset", i);
|
|
90
109
|
});
|
|
91
|
-
}),
|
|
110
|
+
}), N(() => {
|
|
92
111
|
const t = e.values;
|
|
93
|
-
if (e.options,
|
|
112
|
+
if (e.options, O) for (const a of O.options) a.selected = t.includes(a.value);
|
|
94
113
|
});
|
|
95
|
-
const
|
|
114
|
+
const Z = {
|
|
96
115
|
get id() {
|
|
97
|
-
return
|
|
116
|
+
return W();
|
|
98
117
|
},
|
|
99
118
|
get disabled() {
|
|
100
119
|
return _();
|
|
101
120
|
},
|
|
102
121
|
get "aria-readonly"() {
|
|
103
|
-
return
|
|
122
|
+
return q();
|
|
104
123
|
},
|
|
105
124
|
role: "combobox",
|
|
106
125
|
"aria-haspopup": "listbox",
|
|
107
126
|
get "aria-expanded"() {
|
|
108
|
-
return
|
|
127
|
+
return h();
|
|
109
128
|
},
|
|
110
129
|
get "aria-controls"() {
|
|
111
|
-
return
|
|
130
|
+
return h() ? S : void 0;
|
|
112
131
|
},
|
|
113
132
|
get "aria-activedescendant"() {
|
|
114
|
-
return
|
|
133
|
+
return h() && C()[L()] ? S + "-" + L() : void 0;
|
|
115
134
|
},
|
|
116
135
|
get "aria-label"() {
|
|
117
136
|
return e.ariaLabel;
|
|
@@ -120,232 +139,232 @@ function H(e) {
|
|
|
120
139
|
return e.ariaLabelledBy;
|
|
121
140
|
},
|
|
122
141
|
get "aria-describedby"() {
|
|
123
|
-
return
|
|
142
|
+
return Oe(g["aria-describedby"], e.ariaDescribedBy);
|
|
124
143
|
},
|
|
125
144
|
get "aria-invalid"() {
|
|
126
|
-
return e.invalid ||
|
|
145
|
+
return e.invalid || g["aria-invalid"];
|
|
127
146
|
},
|
|
128
147
|
get "aria-required"() {
|
|
129
|
-
return e.required ??
|
|
148
|
+
return e.required ?? g.required;
|
|
130
149
|
},
|
|
131
150
|
"data-floe-input-surface": "true",
|
|
132
151
|
"data-floe-control": "select",
|
|
133
152
|
"data-floe-dropdown-trigger": "",
|
|
134
153
|
"data-floe-surface": "inset",
|
|
135
154
|
get class() {
|
|
136
|
-
return
|
|
155
|
+
return re("floe-field flex w-full min-w-0 items-center justify-between gap-2 h-[var(--floe-control-height-md)] px-2.5 text-[length:var(--floe-type-control)]", e.class);
|
|
137
156
|
},
|
|
138
157
|
onKeyDown: (t) => {
|
|
139
|
-
if (!(_() ||
|
|
140
|
-
if (t.key === "Escape" &&
|
|
141
|
-
t.preventDefault(), t.stopPropagation(),
|
|
158
|
+
if (!(_() || q() || t.isComposing)) {
|
|
159
|
+
if (t.key === "Escape" && h()) {
|
|
160
|
+
t.preventDefault(), t.stopPropagation(), y(!1);
|
|
142
161
|
return;
|
|
143
162
|
}
|
|
144
163
|
if (t.key === "Tab") {
|
|
145
|
-
|
|
164
|
+
y(!1);
|
|
146
165
|
return;
|
|
147
166
|
}
|
|
148
167
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
149
168
|
t.preventDefault();
|
|
150
|
-
const
|
|
151
|
-
|
|
169
|
+
const a = h();
|
|
170
|
+
y(!0), a && Y(t.key === "ArrowDown" ? 1 : -1);
|
|
152
171
|
return;
|
|
153
172
|
}
|
|
154
|
-
if (
|
|
155
|
-
t.preventDefault(),
|
|
173
|
+
if (h() && (t.key === "Home" || t.key === "End") && !e.searchable) {
|
|
174
|
+
t.preventDefault(), Y(0, t.key === "Home" ? "first" : "last");
|
|
156
175
|
return;
|
|
157
176
|
}
|
|
158
177
|
if (t.key === "Enter" || !e.searchable && t.key === " ") {
|
|
159
|
-
t.preventDefault(),
|
|
178
|
+
t.preventDefault(), h() && C()[L()] ? z(C()[L()]) : y(!0);
|
|
160
179
|
return;
|
|
161
180
|
}
|
|
162
181
|
if (!e.searchable && t.key.length === 1 && !t.ctrlKey && !t.metaKey && !t.altKey) {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
182
|
+
const a = Date.now();
|
|
183
|
+
j = a - J > 700 ? t.key : j + t.key, J = a;
|
|
184
|
+
const i = e.options.find((l) => !l.disabled && l.label.toLocaleLowerCase(u.locale).startsWith(j.toLocaleLowerCase(u.locale)));
|
|
185
|
+
i && (t.preventDefault(), h() ? E(C().indexOf(i)) : z(i));
|
|
167
186
|
}
|
|
168
187
|
}
|
|
169
188
|
},
|
|
170
189
|
ref: (t) => {
|
|
171
|
-
|
|
190
|
+
x = t, e.ref?.(t);
|
|
172
191
|
}
|
|
173
192
|
};
|
|
174
193
|
return (() => {
|
|
175
|
-
var t =
|
|
176
|
-
|
|
194
|
+
var t = Re(), a = t.firstChild;
|
|
195
|
+
o(t, c(V, {
|
|
177
196
|
get when() {
|
|
178
197
|
return e.searchable;
|
|
179
198
|
},
|
|
180
199
|
get fallback() {
|
|
181
200
|
return (() => {
|
|
182
|
-
var l =
|
|
183
|
-
return
|
|
201
|
+
var l = Ie(), n = l.firstChild;
|
|
202
|
+
return te(l, R(Z, {
|
|
184
203
|
type: "button",
|
|
185
|
-
onClick: () =>
|
|
186
|
-
}), !1, !0),
|
|
204
|
+
onClick: () => y(!h())
|
|
205
|
+
}), !1, !0), o(n, () => X() || e.placeholder || u.t("selectPlaceholder")), o(l, c($e, {
|
|
187
206
|
class: "h-3.5 w-3.5 shrink-0"
|
|
188
207
|
}), null), l;
|
|
189
208
|
})();
|
|
190
209
|
},
|
|
191
210
|
get children() {
|
|
192
|
-
var l =
|
|
193
|
-
return
|
|
211
|
+
var l = Se();
|
|
212
|
+
return te(l, R(Z, {
|
|
194
213
|
type: "text",
|
|
195
214
|
autocomplete: "off",
|
|
196
215
|
get readOnly() {
|
|
197
|
-
return
|
|
216
|
+
return q();
|
|
198
217
|
},
|
|
199
218
|
"aria-autocomplete": "list",
|
|
200
219
|
get placeholder() {
|
|
201
220
|
return e.placeholder ?? u.t("searchPlaceholder");
|
|
202
221
|
},
|
|
203
222
|
get value() {
|
|
204
|
-
return
|
|
223
|
+
return K(() => !!h())() ? H() : X();
|
|
205
224
|
},
|
|
206
|
-
onClick: () =>
|
|
207
|
-
onInput: (
|
|
208
|
-
|
|
225
|
+
onClick: () => y(!0),
|
|
226
|
+
onInput: (n) => {
|
|
227
|
+
G(n.currentTarget.value), E(-1), y(!0), e.onQueryChange?.(n.currentTarget.value);
|
|
209
228
|
}
|
|
210
229
|
}), !1, !1), l;
|
|
211
230
|
}
|
|
212
|
-
}),
|
|
213
|
-
l.preventDefault(),
|
|
231
|
+
}), a), a.addEventListener("change", (l) => e.onValuesChange(Array.from(l.currentTarget.selectedOptions, (n) => n.value))), a.addEventListener("invalid", (l) => {
|
|
232
|
+
l.preventDefault(), x?.focus();
|
|
214
233
|
});
|
|
215
|
-
var
|
|
216
|
-
return typeof
|
|
234
|
+
var i = O;
|
|
235
|
+
return typeof i == "function" ? le(i, a) : O = a, o(a, c(V, {
|
|
217
236
|
get when() {
|
|
218
|
-
return
|
|
237
|
+
return K(() => !e.multiple)() && !e.options.some((l) => l.value === "");
|
|
219
238
|
},
|
|
220
239
|
get children() {
|
|
221
|
-
var l =
|
|
222
|
-
return
|
|
240
|
+
var l = _e();
|
|
241
|
+
return P(() => l.selected = !e.values.length || e.values[0] === ""), l;
|
|
223
242
|
}
|
|
224
|
-
}), null),
|
|
243
|
+
}), null), o(a, c(Q, {
|
|
225
244
|
get each() {
|
|
226
|
-
return e.values.filter((l) => l !== "" && !e.options.some((
|
|
245
|
+
return e.values.filter((l) => l !== "" && !e.options.some((n) => n.value === l));
|
|
227
246
|
},
|
|
228
247
|
children: (l) => (() => {
|
|
229
|
-
var
|
|
230
|
-
return
|
|
248
|
+
var n = Ke();
|
|
249
|
+
return n.value = l, o(n, l), n;
|
|
231
250
|
})()
|
|
232
|
-
}), null),
|
|
251
|
+
}), null), o(a, c(Q, {
|
|
233
252
|
get each() {
|
|
234
253
|
return e.options;
|
|
235
254
|
},
|
|
236
255
|
children: (l) => (() => {
|
|
237
|
-
var
|
|
238
|
-
return
|
|
239
|
-
var
|
|
240
|
-
return
|
|
256
|
+
var n = Me();
|
|
257
|
+
return o(n, () => l.label), P((v) => {
|
|
258
|
+
var r = e.values.includes(l.value), f = l.disabled;
|
|
259
|
+
return r !== v.e && (n.selected = v.e = r), f !== v.t && (n.disabled = v.t = f), v;
|
|
241
260
|
}, {
|
|
242
261
|
e: void 0,
|
|
243
262
|
t: void 0
|
|
244
|
-
}),
|
|
263
|
+
}), P(() => n.value = l.value), n;
|
|
245
264
|
})()
|
|
246
|
-
}), null),
|
|
265
|
+
}), null), o(t, c(V, {
|
|
247
266
|
get when() {
|
|
248
|
-
return
|
|
267
|
+
return D.mounted();
|
|
249
268
|
},
|
|
250
269
|
get children() {
|
|
251
|
-
return c(
|
|
252
|
-
owner:
|
|
270
|
+
return c(xe, {
|
|
271
|
+
owner: x,
|
|
253
272
|
get position() {
|
|
254
|
-
return
|
|
273
|
+
return ie();
|
|
255
274
|
},
|
|
256
275
|
layerRef: (l) => {
|
|
257
|
-
|
|
276
|
+
I = l;
|
|
258
277
|
},
|
|
259
278
|
get dir() {
|
|
260
279
|
return u.direction;
|
|
261
280
|
},
|
|
262
|
-
class: "rounded-panel border border-[var(--floe-line)] bg-popover text-popover-foreground shadow-[var(--floe-elevation-float)] p-1",
|
|
263
281
|
get style() {
|
|
264
282
|
return {
|
|
265
|
-
width:
|
|
283
|
+
width: ue() + "px",
|
|
266
284
|
"max-width": "calc(100vw - 24px)"
|
|
267
285
|
};
|
|
268
286
|
},
|
|
269
|
-
"data-floe-surface": "floating",
|
|
270
287
|
get children() {
|
|
271
|
-
|
|
288
|
+
var l = Be(), n = l.firstChild, v = k;
|
|
289
|
+
return typeof v == "function" ? le(v, l) : k = l, o(l, c(V, {
|
|
272
290
|
get when() {
|
|
273
291
|
return e.loading;
|
|
274
292
|
},
|
|
275
293
|
get children() {
|
|
276
|
-
var
|
|
277
|
-
return
|
|
294
|
+
var r = qe();
|
|
295
|
+
return o(r, () => u.t("loading")), r;
|
|
278
296
|
}
|
|
279
|
-
}), c(
|
|
297
|
+
}), n), o(l, c(V, {
|
|
280
298
|
get when() {
|
|
281
299
|
return e.error;
|
|
282
300
|
},
|
|
283
301
|
get children() {
|
|
284
|
-
var
|
|
285
|
-
return
|
|
302
|
+
var r = Fe();
|
|
303
|
+
return o(r, () => e.error, null), o(r, c(V, {
|
|
286
304
|
get when() {
|
|
287
305
|
return e.onRetry;
|
|
288
306
|
},
|
|
289
307
|
get children() {
|
|
290
|
-
var
|
|
291
|
-
return
|
|
308
|
+
var f = Ae();
|
|
309
|
+
return f.$$click = () => e.onRetry?.(), o(f, () => u.t("retry")), f;
|
|
292
310
|
}
|
|
293
|
-
}), null),
|
|
311
|
+
}), null), r;
|
|
294
312
|
}
|
|
295
|
-
}), (
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
})()
|
|
326
|
-
})), E((a) => {
|
|
327
|
-
var o = e.ariaLabel, i = e.ariaLabelledBy ?? (e.ariaLabel ? void 0 : j()), C = e.multiple || void 0;
|
|
328
|
-
return o !== a.e && y(l, "aria-label", a.e = o), i !== a.t && y(l, "aria-labelledby", a.t = i), C !== a.a && y(l, "aria-multiselectable", a.a = C), a;
|
|
329
|
-
}, {
|
|
330
|
-
e: void 0,
|
|
331
|
-
t: void 0,
|
|
332
|
-
a: void 0
|
|
333
|
-
}), l;
|
|
334
|
-
})(), c(x, {
|
|
313
|
+
}), n), m(n, "id", S), o(n, c(Q, {
|
|
314
|
+
get each() {
|
|
315
|
+
return C();
|
|
316
|
+
},
|
|
317
|
+
children: (r, f) => (() => {
|
|
318
|
+
var s = He(), $ = s.firstChild;
|
|
319
|
+
return s.$$click = () => z(r), s.$$pointermove = () => !r.disabled && E(f()), s.$$pointerdown = (d) => d.preventDefault(), o($, c(V, {
|
|
320
|
+
get when() {
|
|
321
|
+
return e.values.includes(r.value);
|
|
322
|
+
},
|
|
323
|
+
get children() {
|
|
324
|
+
return c(Ee, {
|
|
325
|
+
class: "h-3.5 w-3.5"
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
})), o(s, (() => {
|
|
329
|
+
var d = K(() => !!e.renderOption);
|
|
330
|
+
return () => d() ? e.renderOption(r) : r.label;
|
|
331
|
+
})(), null), P((d) => {
|
|
332
|
+
var A = S + "-" + f(), F = e.values.includes(r.value), T = r.disabled || void 0, p = e.values.includes(r.value) ? "true" : void 0, ee = re("flex min-h-[var(--floe-row-height)] items-center gap-2 rounded-sm px-2 text-[length:var(--floe-type-control)]", L() === f() && "bg-accent text-accent-foreground", r.disabled ? "opacity-50" : "cursor-pointer");
|
|
333
|
+
return A !== d.e && m(s, "id", d.e = A), F !== d.t && m(s, "aria-selected", d.t = F), T !== d.a && m(s, "aria-disabled", d.a = T), p !== d.o && m(s, "data-floe-selected", d.o = p), ee !== d.i && ve(s, d.i = ee), d;
|
|
334
|
+
}, {
|
|
335
|
+
e: void 0,
|
|
336
|
+
t: void 0,
|
|
337
|
+
a: void 0,
|
|
338
|
+
o: void 0,
|
|
339
|
+
i: void 0
|
|
340
|
+
}), s;
|
|
341
|
+
})()
|
|
342
|
+
})), o(l, c(V, {
|
|
335
343
|
get when() {
|
|
336
|
-
return
|
|
344
|
+
return K(() => !C().length && !e.loading)() && !e.error;
|
|
337
345
|
},
|
|
338
346
|
get children() {
|
|
339
|
-
var
|
|
340
|
-
return
|
|
347
|
+
var r = Te();
|
|
348
|
+
return o(r, () => u.t("noResults")), r;
|
|
341
349
|
}
|
|
342
|
-
})
|
|
350
|
+
}), null), P((r) => {
|
|
351
|
+
var f = D.state(), s = se(), $ = D.exiting(), d = D.exiting() ? "true" : void 0, A = e.ariaLabel, F = e.ariaLabelledBy ?? (e.ariaLabel ? void 0 : W()), T = e.multiple || void 0;
|
|
352
|
+
return f !== r.e && m(l, "data-floating-presence", r.e = f), s !== r.t && m(l, "data-floating-side", r.t = s), $ !== r.a && (l.inert = r.a = $), d !== r.o && m(l, "aria-hidden", r.o = d), A !== r.i && m(n, "aria-label", r.i = A), F !== r.n && m(n, "aria-labelledby", r.n = F), T !== r.s && m(n, "aria-multiselectable", r.s = T), r;
|
|
353
|
+
}, {
|
|
354
|
+
e: void 0,
|
|
355
|
+
t: void 0,
|
|
356
|
+
a: void 0,
|
|
357
|
+
o: void 0,
|
|
358
|
+
i: void 0,
|
|
359
|
+
n: void 0,
|
|
360
|
+
s: void 0
|
|
361
|
+
}), l;
|
|
343
362
|
}
|
|
344
363
|
});
|
|
345
364
|
}
|
|
346
|
-
}), null),
|
|
347
|
-
var
|
|
348
|
-
return
|
|
365
|
+
}), null), P((l) => {
|
|
366
|
+
var n = u.direction, v = e.name ?? g.name, r = e.form, f = e.required ?? g.required, s = _(), $ = e.multiple;
|
|
367
|
+
return n !== l.e && m(t, "dir", l.e = n), v !== l.t && m(a, "name", l.t = v), r !== l.a && m(a, "form", l.a = r), f !== l.o && (a.required = l.o = f), s !== l.i && (a.disabled = l.i = s), $ !== l.n && (a.multiple = l.n = $), l;
|
|
349
368
|
}, {
|
|
350
369
|
e: void 0,
|
|
351
370
|
t: void 0,
|
|
@@ -356,29 +375,29 @@ function H(e) {
|
|
|
356
375
|
}), t;
|
|
357
376
|
})();
|
|
358
377
|
}
|
|
359
|
-
function
|
|
360
|
-
const [u,
|
|
378
|
+
function tt(e) {
|
|
379
|
+
const [u, g] = M({
|
|
361
380
|
value: () => e.value,
|
|
362
381
|
defaultValue: e.defaultValue ?? "",
|
|
363
|
-
onChange: (
|
|
382
|
+
onChange: (b) => e.onChange?.(b)
|
|
364
383
|
});
|
|
365
|
-
return c(
|
|
384
|
+
return c(U, R(e, {
|
|
366
385
|
get values() {
|
|
367
386
|
return [u()];
|
|
368
387
|
},
|
|
369
388
|
get resetValues() {
|
|
370
389
|
return [e.defaultValue ?? ""];
|
|
371
390
|
},
|
|
372
|
-
onValuesChange: (
|
|
391
|
+
onValuesChange: (b) => g(b[0] ?? "")
|
|
373
392
|
}));
|
|
374
393
|
}
|
|
375
|
-
function
|
|
376
|
-
const [u,
|
|
394
|
+
function lt(e) {
|
|
395
|
+
const [u, g] = M({
|
|
377
396
|
value: () => e.value,
|
|
378
397
|
defaultValue: e.defaultValue ?? "",
|
|
379
|
-
onChange: (
|
|
398
|
+
onChange: (b) => e.onChange?.(b)
|
|
380
399
|
});
|
|
381
|
-
return c(
|
|
400
|
+
return c(U, R(e, {
|
|
382
401
|
searchable: !0,
|
|
383
402
|
get values() {
|
|
384
403
|
return [u()];
|
|
@@ -386,16 +405,16 @@ function Ge(e) {
|
|
|
386
405
|
get resetValues() {
|
|
387
406
|
return [e.defaultValue ?? ""];
|
|
388
407
|
},
|
|
389
|
-
onValuesChange: (
|
|
408
|
+
onValuesChange: (b) => g(b[0] ?? "")
|
|
390
409
|
}));
|
|
391
410
|
}
|
|
392
|
-
function
|
|
393
|
-
const [u,
|
|
411
|
+
function at(e) {
|
|
412
|
+
const [u, g] = M({
|
|
394
413
|
value: () => e.value,
|
|
395
414
|
defaultValue: e.defaultValue ?? [],
|
|
396
|
-
onChange: (
|
|
415
|
+
onChange: (b) => e.onChange?.(b)
|
|
397
416
|
});
|
|
398
|
-
return c(
|
|
417
|
+
return c(U, R(e, {
|
|
399
418
|
multiple: !0,
|
|
400
419
|
get values() {
|
|
401
420
|
return u();
|
|
@@ -403,12 +422,12 @@ function Je(e) {
|
|
|
403
422
|
get resetValues() {
|
|
404
423
|
return e.defaultValue ?? [];
|
|
405
424
|
},
|
|
406
|
-
onValuesChange:
|
|
425
|
+
onValuesChange: g
|
|
407
426
|
}));
|
|
408
427
|
}
|
|
409
|
-
|
|
428
|
+
ge(["click", "pointerdown", "pointermove"]);
|
|
410
429
|
export {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
430
|
+
lt as Combobox,
|
|
431
|
+
at as MultiSelect,
|
|
432
|
+
tt as Select
|
|
414
433
|
};
|