@floegence/floe-webapp-core 0.36.68 → 0.36.70
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/CommandPalette.js +94 -82
- package/dist/components/ui/Dialog.js +95 -79
- package/dist/components/ui/Dropdown.js +195 -168
- package/dist/components/ui/FloatingWindow.js +177 -163
- package/dist/components/ui/Tooltip.js +28 -22
- package/dist/components/ui/floatingPresence.d.ts +13 -0
- package/dist/components/ui/floatingPresence.js +54 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/floe.css +94 -0
- package/dist/full.js +61 -59
- package/dist/styles.css +1 -1
- package/dist/ui.js +12 -10
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { setAttribute as v, insert as f, createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
import { ChevronDown as
|
|
6
|
-
import { focusMenuItem as
|
|
7
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { setAttribute as v, insert as f, createComponent as l, Portal as U, use as R, spread as W, mergeProps as G, effect as _, className as E, template as k, memo as N, delegateEvents as ee } from "solid-js/web";
|
|
2
|
+
import { createSignal as T, createMemo as te, createEffect as J, onCleanup as ne, Show as y, Index as Q } from "solid-js";
|
|
3
|
+
import { cn as p } from "../../utils/cn.js";
|
|
4
|
+
import { deferNonBlocking as re } from "../../utils/defer.js";
|
|
5
|
+
import { ChevronDown as oe, Check as ie, ChevronRight as ue } from "../icons/index.js";
|
|
6
|
+
import { focusMenuItem as L, MENU_ITEM_SELECTOR as ae, moveMenuFocus as z, calculateMenuPosition as le, calculateSubmenuPosition as se } from "./menuUtils.js";
|
|
7
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as V } from "./localInteractionSurface.js";
|
|
8
|
+
import { createFloatingPresence as X } from "./floatingPresence.js";
|
|
9
|
+
import { resolveSurfacePortalHost as de, projectSurfacePortalPosition as ce, resolveSurfacePortalBoundaryRect as fe, isSurfacePortalMode as me, resolveSurfacePortalMount as ge } from "./dialogSurfaceScope.js";
|
|
10
|
+
var j = /* @__PURE__ */ k("<div>"), ve = /* @__PURE__ */ k("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Y = /* @__PURE__ */ k('<div class="my-1 h-px bg-border"role=separator>'), be = /* @__PURE__ */ k('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), he = /* @__PURE__ */ k("<div class=relative>"), we = /* @__PURE__ */ k('<span class="w-3.5 h-3.5 flex items-center justify-center">'), ye = /* @__PURE__ */ k("<span>");
|
|
11
|
+
let xe = 0, Se = 0;
|
|
12
|
+
function pe(e, d) {
|
|
12
13
|
switch (e) {
|
|
13
14
|
case "Enter":
|
|
14
15
|
case " ":
|
|
@@ -32,151 +33,161 @@ function ye(e, d) {
|
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
const [d,
|
|
36
|
+
function Me(e) {
|
|
37
|
+
const [d, s] = T(!1), u = X({
|
|
38
|
+
open: d,
|
|
39
|
+
exitDurationMs: 100
|
|
40
|
+
}), [F, M] = T({
|
|
37
41
|
x: -9999,
|
|
38
42
|
y: -9999
|
|
39
43
|
});
|
|
40
|
-
let
|
|
41
|
-
const
|
|
44
|
+
let x, w;
|
|
45
|
+
const b = `floe-dropdown-${xe += 1}`, $ = `${b}-menu`, h = te(() => u.mounted() ? de() : {
|
|
42
46
|
host: null,
|
|
43
47
|
boundaryHost: null,
|
|
44
48
|
mountHost: null,
|
|
45
49
|
mode: "global"
|
|
46
|
-
}),
|
|
47
|
-
mount: () =>
|
|
48
|
-
isSurfaceMode: () =>
|
|
49
|
-
boundaryRect: () =>
|
|
50
|
-
projectPosition: (
|
|
51
|
-
},
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
|
|
50
|
+
}), c = {
|
|
51
|
+
mount: () => ge(h()),
|
|
52
|
+
isSurfaceMode: () => me(h()),
|
|
53
|
+
boundaryRect: () => fe(h()),
|
|
54
|
+
projectPosition: (o) => ce(o, h())
|
|
55
|
+
}, P = () => {
|
|
56
|
+
if (!x || !w) return;
|
|
57
|
+
const o = x.getBoundingClientRect(), r = w.getBoundingClientRect(), i = le(o, r, e.align ?? "start", c.boundaryRect());
|
|
58
|
+
M(i);
|
|
55
59
|
};
|
|
56
|
-
|
|
57
|
-
if (!
|
|
58
|
-
|
|
60
|
+
J(() => {
|
|
61
|
+
if (!u.mounted()) {
|
|
62
|
+
M({
|
|
59
63
|
x: -9999,
|
|
60
64
|
y: -9999
|
|
61
65
|
});
|
|
62
66
|
return;
|
|
63
67
|
}
|
|
64
|
-
|
|
68
|
+
if (!d()) return;
|
|
69
|
+
const o = (i) => {
|
|
65
70
|
const t = i.target;
|
|
66
|
-
t && typeof t.closest == "function" && t.closest(`[data-floe-dropdown="${
|
|
67
|
-
},
|
|
68
|
-
i.key === "Escape" && (
|
|
71
|
+
t && typeof t.closest == "function" && t.closest(`[data-floe-dropdown="${b}"]`) || s(!1);
|
|
72
|
+
}, r = (i) => {
|
|
73
|
+
i.key === "Escape" && (s(!1), requestAnimationFrame(() => x?.focus()));
|
|
69
74
|
};
|
|
70
|
-
document.addEventListener("pointerdown",
|
|
71
|
-
|
|
72
|
-
}),
|
|
73
|
-
document.removeEventListener("pointerdown",
|
|
75
|
+
document.addEventListener("pointerdown", o, !0), document.addEventListener("keydown", r), requestAnimationFrame(() => {
|
|
76
|
+
P(), L(w, e.value ? "selected" : "first");
|
|
77
|
+
}), ne(() => {
|
|
78
|
+
document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", r);
|
|
74
79
|
});
|
|
75
80
|
});
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
e.disabled || (
|
|
81
|
-
|
|
81
|
+
const C = (o) => {
|
|
82
|
+
const r = e.onSelect;
|
|
83
|
+
o.keepOpen || s(!1), re(() => r(o.id));
|
|
84
|
+
}, D = (o, r = "first") => {
|
|
85
|
+
e.disabled || (s(o), requestAnimationFrame(() => {
|
|
86
|
+
P(), L(w, r);
|
|
82
87
|
}));
|
|
83
|
-
},
|
|
88
|
+
}, I = (o) => {
|
|
84
89
|
if (e.disabled) return;
|
|
85
|
-
const
|
|
90
|
+
const r = pe(o.key, {
|
|
86
91
|
open: d(),
|
|
87
92
|
hasSelection: !!e.value
|
|
88
93
|
});
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
91
|
-
|
|
94
|
+
if (r) {
|
|
95
|
+
if (o.preventDefault(), !r.nextOpen) {
|
|
96
|
+
s(!1);
|
|
92
97
|
return;
|
|
93
98
|
}
|
|
94
|
-
|
|
99
|
+
D(!0, r.focusMode ?? "first");
|
|
95
100
|
}
|
|
96
|
-
},
|
|
97
|
-
const
|
|
98
|
-
switch (
|
|
101
|
+
}, O = (o) => {
|
|
102
|
+
const r = o.target, i = r?.closest('[role="menu"]'), t = r?.closest(ae);
|
|
103
|
+
switch (o.key) {
|
|
99
104
|
case "ArrowDown":
|
|
100
|
-
|
|
105
|
+
o.preventDefault(), z(i, t, 1);
|
|
101
106
|
return;
|
|
102
107
|
case "ArrowUp":
|
|
103
|
-
|
|
108
|
+
o.preventDefault(), z(i, t, -1);
|
|
104
109
|
return;
|
|
105
110
|
case "Home":
|
|
106
|
-
|
|
111
|
+
o.preventDefault(), L(i, "first");
|
|
107
112
|
return;
|
|
108
113
|
case "End":
|
|
109
|
-
|
|
114
|
+
o.preventDefault(), L(i, "last");
|
|
110
115
|
return;
|
|
111
116
|
case "Tab":
|
|
112
|
-
|
|
117
|
+
s(!1);
|
|
113
118
|
return;
|
|
114
119
|
default:
|
|
115
120
|
return;
|
|
116
121
|
}
|
|
117
122
|
};
|
|
118
123
|
return (() => {
|
|
119
|
-
var
|
|
120
|
-
v(
|
|
124
|
+
var o = ve(), r = o.firstChild;
|
|
125
|
+
v(o, "data-floe-dropdown", b), r.$$keydown = I, r.$$click = () => {
|
|
121
126
|
if (!e.disabled) {
|
|
122
127
|
if (d()) {
|
|
123
|
-
|
|
128
|
+
s(!1);
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
126
|
-
|
|
131
|
+
D(!0, e.value ? "selected" : "first");
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
|
-
var i =
|
|
130
|
-
return typeof i == "function" ? R(i,
|
|
134
|
+
var i = x;
|
|
135
|
+
return typeof i == "function" ? R(i, r) : x = r, v(r, "aria-controls", $), f(r, () => e.trigger), f(o, l(y, {
|
|
131
136
|
get when() {
|
|
132
|
-
return
|
|
137
|
+
return u.mounted();
|
|
133
138
|
},
|
|
134
139
|
get children() {
|
|
135
|
-
return
|
|
140
|
+
return l(U, {
|
|
136
141
|
get mount() {
|
|
137
|
-
return
|
|
142
|
+
return c.mount();
|
|
138
143
|
},
|
|
139
144
|
get children() {
|
|
140
|
-
var t =
|
|
141
|
-
return typeof
|
|
145
|
+
var t = j(), n = w;
|
|
146
|
+
return typeof n == "function" ? R(n, t) : w = t, v(t, "data-floe-dropdown", b), W(t, G({
|
|
142
147
|
get class() {
|
|
143
|
-
return
|
|
148
|
+
return p(c.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu");
|
|
149
|
+
},
|
|
150
|
+
get "data-floating-presence"() {
|
|
151
|
+
return u.state();
|
|
152
|
+
},
|
|
153
|
+
get "aria-hidden"() {
|
|
154
|
+
return u.exiting() ? "true" : void 0;
|
|
144
155
|
}
|
|
145
156
|
}, () => ({
|
|
146
|
-
[
|
|
157
|
+
[V]: c.isSurfaceMode() ? "true" : void 0
|
|
147
158
|
}), {
|
|
148
159
|
get style() {
|
|
149
160
|
return {
|
|
150
|
-
left: `${
|
|
151
|
-
top: `${
|
|
161
|
+
left: `${c.projectPosition(F()).x}px`,
|
|
162
|
+
top: `${c.projectPosition(F()).y}px`
|
|
152
163
|
};
|
|
153
164
|
},
|
|
154
165
|
role: "menu",
|
|
155
|
-
id:
|
|
156
|
-
onKeyDown:
|
|
157
|
-
}), !1, !0), f(t,
|
|
166
|
+
id: $,
|
|
167
|
+
onKeyDown: O
|
|
168
|
+
}), !1, !0), f(t, l(Q, {
|
|
158
169
|
get each() {
|
|
159
170
|
return e.items;
|
|
160
171
|
},
|
|
161
|
-
children: (
|
|
172
|
+
children: (g) => l(y, {
|
|
162
173
|
get when() {
|
|
163
|
-
return !
|
|
174
|
+
return !g().separator;
|
|
164
175
|
},
|
|
165
176
|
get fallback() {
|
|
166
|
-
return
|
|
177
|
+
return Y();
|
|
167
178
|
},
|
|
168
179
|
get children() {
|
|
169
|
-
return
|
|
180
|
+
return l(Z, {
|
|
170
181
|
get item() {
|
|
171
|
-
return
|
|
182
|
+
return g();
|
|
172
183
|
},
|
|
173
184
|
get selected() {
|
|
174
|
-
return e.value ===
|
|
185
|
+
return e.value === g().id;
|
|
175
186
|
},
|
|
176
|
-
onSelect:
|
|
177
|
-
onCloseMenu: () =>
|
|
178
|
-
dropdownId:
|
|
179
|
-
portalLayout:
|
|
187
|
+
onSelect: C,
|
|
188
|
+
onCloseMenu: () => s(!1),
|
|
189
|
+
dropdownId: b,
|
|
190
|
+
portalLayout: c
|
|
180
191
|
});
|
|
181
192
|
}
|
|
182
193
|
})
|
|
@@ -184,9 +195,9 @@ function xe(e) {
|
|
|
184
195
|
}
|
|
185
196
|
});
|
|
186
197
|
}
|
|
187
|
-
}), null),
|
|
188
|
-
var
|
|
189
|
-
return
|
|
198
|
+
}), null), _((t) => {
|
|
199
|
+
var n = p("relative inline-block", e.class), g = p("cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), m = e.disabled ? -1 : 0, A = d(), a = e.triggerAriaLabel, S = e.disabled ? "true" : void 0;
|
|
200
|
+
return n !== t.e && E(o, t.e = n), g !== t.t && E(r, t.t = g), m !== t.a && v(r, "tabindex", t.a = m), A !== t.o && v(r, "aria-expanded", t.o = A), a !== t.i && v(r, "aria-label", t.i = a), S !== t.n && v(r, "aria-disabled", t.n = S), t;
|
|
190
201
|
}, {
|
|
191
202
|
e: void 0,
|
|
192
203
|
t: void 0,
|
|
@@ -194,153 +205,169 @@ function xe(e) {
|
|
|
194
205
|
o: void 0,
|
|
195
206
|
i: void 0,
|
|
196
207
|
n: void 0
|
|
197
|
-
}),
|
|
208
|
+
}), o;
|
|
198
209
|
})();
|
|
199
210
|
}
|
|
200
|
-
function
|
|
201
|
-
const [d,
|
|
211
|
+
function Z(e) {
|
|
212
|
+
const [d, s] = T(!1), u = () => e.item.children && e.item.children.length > 0, M = X({
|
|
213
|
+
open: () => !!(d() && u()),
|
|
214
|
+
exitDurationMs: 100
|
|
215
|
+
}), [x, w] = T({
|
|
202
216
|
x: -9999,
|
|
203
217
|
y: -9999
|
|
204
218
|
});
|
|
205
|
-
let b, h,
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
let b, $, h, c;
|
|
220
|
+
const P = `floe-dropdown-item-${Se += 1}`;
|
|
221
|
+
J(() => {
|
|
222
|
+
M.mounted() || w({
|
|
223
|
+
x: -9999,
|
|
224
|
+
y: -9999
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
const C = () => {
|
|
228
|
+
if (!b || !h) return;
|
|
229
|
+
const i = b.getBoundingClientRect(), t = h.getBoundingClientRect(), n = se(i, t, e.portalLayout.boundaryRect());
|
|
230
|
+
w(n);
|
|
231
|
+
}, D = () => {
|
|
232
|
+
u() && (clearTimeout(c), c = setTimeout(() => {
|
|
233
|
+
s(!0), requestAnimationFrame(C);
|
|
213
234
|
}, 100));
|
|
214
|
-
},
|
|
215
|
-
u() && (clearTimeout(
|
|
216
|
-
|
|
235
|
+
}, I = () => {
|
|
236
|
+
u() && (clearTimeout(c), c = void 0, !e.item.keepOpen && (c = setTimeout(() => {
|
|
237
|
+
s(!1);
|
|
217
238
|
}, 150)));
|
|
218
|
-
},
|
|
239
|
+
}, O = (i) => {
|
|
219
240
|
if (!e.item.disabled) {
|
|
220
241
|
if (e.item.content && e.item.keepOpen) {
|
|
221
|
-
|
|
242
|
+
i.stopPropagation();
|
|
222
243
|
return;
|
|
223
244
|
}
|
|
224
|
-
u() ? (
|
|
245
|
+
u() ? (s((t) => !t), requestAnimationFrame(C)) : e.item.content || e.onSelect(e.item);
|
|
225
246
|
}
|
|
226
|
-
},
|
|
227
|
-
u() && (
|
|
228
|
-
|
|
247
|
+
}, o = (i = "first") => {
|
|
248
|
+
u() && (s(!0), requestAnimationFrame(() => {
|
|
249
|
+
C(), L(h, i);
|
|
229
250
|
}));
|
|
230
251
|
}, r = () => {
|
|
231
|
-
|
|
252
|
+
s(!1), requestAnimationFrame(() => $?.focus());
|
|
232
253
|
};
|
|
233
254
|
return (() => {
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return typeof
|
|
255
|
+
var i = he();
|
|
256
|
+
i.addEventListener("mouseleave", I), i.addEventListener("mouseenter", D);
|
|
257
|
+
var t = b;
|
|
258
|
+
return typeof t == "function" ? R(t, i) : b = i, f(i, l(y, {
|
|
238
259
|
get when() {
|
|
239
260
|
return e.item.content;
|
|
240
261
|
},
|
|
241
262
|
get children() {
|
|
242
|
-
var
|
|
243
|
-
return
|
|
263
|
+
var n = j();
|
|
264
|
+
return n.$$click = O, f(n, e.item.content), _(() => E(n, p("w-full px-2 py-1.5", e.item.disabled && "opacity-50 pointer-events-none"))), n;
|
|
244
265
|
}
|
|
245
|
-
}), null), f(
|
|
266
|
+
}), null), f(i, l(y, {
|
|
246
267
|
get when() {
|
|
247
268
|
return !e.item.content;
|
|
248
269
|
},
|
|
249
270
|
get children() {
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
e.item.disabled || u() && ((
|
|
253
|
-
},
|
|
254
|
-
var
|
|
255
|
-
return typeof
|
|
271
|
+
var n = be(), g = n.firstChild, m = g.nextSibling;
|
|
272
|
+
n.$$keydown = (a) => {
|
|
273
|
+
e.item.disabled || u() && ((a.key === "ArrowRight" || a.key === "Enter" || a.key === " ") && (a.preventDefault(), o("first")), a.key === "ArrowLeft" && (a.preventDefault(), r()));
|
|
274
|
+
}, n.$$click = O;
|
|
275
|
+
var A = $;
|
|
276
|
+
return typeof A == "function" ? R(A, n) : $ = n, v(n, "id", P), f(g, l(y, {
|
|
256
277
|
get when() {
|
|
257
|
-
return
|
|
278
|
+
return N(() => !!e.selected)() && !u();
|
|
258
279
|
},
|
|
259
280
|
get children() {
|
|
260
|
-
return
|
|
281
|
+
return l(ie, {
|
|
261
282
|
class: "w-3 h-3"
|
|
262
283
|
});
|
|
263
284
|
}
|
|
264
|
-
})), f(
|
|
285
|
+
})), f(n, l(y, {
|
|
265
286
|
get when() {
|
|
266
287
|
return e.item.icon;
|
|
267
288
|
},
|
|
268
289
|
keyed: !0,
|
|
269
|
-
children: (
|
|
270
|
-
var
|
|
271
|
-
return f(
|
|
290
|
+
children: (a) => (() => {
|
|
291
|
+
var S = we();
|
|
292
|
+
return f(S, a), S;
|
|
272
293
|
})()
|
|
273
|
-
}),
|
|
294
|
+
}), m), f(m, () => e.item.label), f(n, l(y, {
|
|
274
295
|
get when() {
|
|
275
296
|
return u();
|
|
276
297
|
},
|
|
277
298
|
get children() {
|
|
278
|
-
return
|
|
299
|
+
return l(ue, {
|
|
279
300
|
class: "w-3 h-3 text-muted-foreground"
|
|
280
301
|
});
|
|
281
302
|
}
|
|
282
|
-
}), null),
|
|
283
|
-
var
|
|
284
|
-
return
|
|
303
|
+
}), null), _((a) => {
|
|
304
|
+
var S = p("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), q = e.item.disabled, B = u() ? "menu" : void 0, H = u() ? d() : void 0, K = e.selected && !u() ? "true" : void 0;
|
|
305
|
+
return S !== a.e && E(n, a.e = S), q !== a.t && (n.disabled = a.t = q), B !== a.a && v(n, "aria-haspopup", a.a = B), H !== a.o && v(n, "aria-expanded", a.o = H), K !== a.i && v(n, "data-floe-selected", a.i = K), a;
|
|
285
306
|
}, {
|
|
286
307
|
e: void 0,
|
|
287
308
|
t: void 0,
|
|
288
309
|
a: void 0,
|
|
289
310
|
o: void 0,
|
|
290
311
|
i: void 0
|
|
291
|
-
}),
|
|
312
|
+
}), n;
|
|
292
313
|
}
|
|
293
|
-
}), null), f(
|
|
314
|
+
}), null), f(i, l(y, {
|
|
294
315
|
get when() {
|
|
295
|
-
return
|
|
316
|
+
return N(() => !!M.mounted())() && u();
|
|
296
317
|
},
|
|
297
318
|
get children() {
|
|
298
|
-
return
|
|
319
|
+
return l(U, {
|
|
299
320
|
get mount() {
|
|
300
321
|
return e.portalLayout.mount();
|
|
301
322
|
},
|
|
302
323
|
get children() {
|
|
303
|
-
var
|
|
304
|
-
return typeof g == "function" ? R(g,
|
|
324
|
+
var n = j(), g = h;
|
|
325
|
+
return typeof g == "function" ? R(g, n) : h = n, W(n, G({
|
|
305
326
|
get class() {
|
|
306
|
-
return
|
|
327
|
+
return p(e.portalLayout.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu floe-floating-submenu");
|
|
307
328
|
},
|
|
308
329
|
get "data-floe-dropdown"() {
|
|
309
330
|
return e.dropdownId;
|
|
331
|
+
},
|
|
332
|
+
get "data-floating-presence"() {
|
|
333
|
+
return M.state();
|
|
334
|
+
},
|
|
335
|
+
get "aria-hidden"() {
|
|
336
|
+
return M.exiting() ? "true" : void 0;
|
|
310
337
|
}
|
|
311
338
|
}, () => ({
|
|
312
|
-
[
|
|
339
|
+
[V]: e.portalLayout.isSurfaceMode() ? "true" : void 0
|
|
313
340
|
}), {
|
|
314
341
|
get style() {
|
|
315
342
|
return {
|
|
316
|
-
left: `${e.portalLayout.projectPosition(
|
|
317
|
-
top: `${e.portalLayout.projectPosition(
|
|
343
|
+
left: `${e.portalLayout.projectPosition(x()).x}px`,
|
|
344
|
+
top: `${e.portalLayout.projectPosition(x()).y}px`
|
|
318
345
|
};
|
|
319
346
|
},
|
|
320
347
|
role: "menu",
|
|
321
|
-
"aria-labelledby":
|
|
348
|
+
"aria-labelledby": P,
|
|
322
349
|
onMouseEnter: () => {
|
|
323
|
-
clearTimeout(
|
|
350
|
+
clearTimeout(c);
|
|
324
351
|
},
|
|
325
|
-
onMouseLeave:
|
|
326
|
-
onKeyDown: (
|
|
327
|
-
|
|
352
|
+
onMouseLeave: I,
|
|
353
|
+
onKeyDown: (m) => {
|
|
354
|
+
m.key !== "ArrowLeft" && m.key !== "Escape" || (m.preventDefault(), m.stopPropagation(), r());
|
|
328
355
|
}
|
|
329
|
-
}), !1, !0), f(
|
|
356
|
+
}), !1, !0), f(n, l(Q, {
|
|
330
357
|
get each() {
|
|
331
358
|
return e.item.children;
|
|
332
359
|
},
|
|
333
|
-
children: (
|
|
360
|
+
children: (m) => l(y, {
|
|
334
361
|
get when() {
|
|
335
|
-
return !
|
|
362
|
+
return !m().separator;
|
|
336
363
|
},
|
|
337
364
|
get fallback() {
|
|
338
|
-
return
|
|
365
|
+
return Y();
|
|
339
366
|
},
|
|
340
367
|
get children() {
|
|
341
|
-
return
|
|
368
|
+
return l(Z, {
|
|
342
369
|
get item() {
|
|
343
|
-
return
|
|
370
|
+
return m();
|
|
344
371
|
},
|
|
345
372
|
selected: !1,
|
|
346
373
|
get onSelect() {
|
|
@@ -358,32 +385,32 @@ function Q(e) {
|
|
|
358
385
|
});
|
|
359
386
|
}
|
|
360
387
|
})
|
|
361
|
-
})),
|
|
388
|
+
})), n;
|
|
362
389
|
}
|
|
363
390
|
});
|
|
364
391
|
}
|
|
365
|
-
}), null),
|
|
392
|
+
}), null), i;
|
|
366
393
|
})();
|
|
367
394
|
}
|
|
368
|
-
function
|
|
369
|
-
const d = () => e.options.find((
|
|
370
|
-
id:
|
|
371
|
-
label:
|
|
395
|
+
function Ie(e) {
|
|
396
|
+
const d = () => e.options.find((u) => u.value === e.value), s = () => e.options.map((u) => ({
|
|
397
|
+
id: u.value,
|
|
398
|
+
label: u.label
|
|
372
399
|
}));
|
|
373
|
-
return
|
|
400
|
+
return l(Me, {
|
|
374
401
|
get triggerClass() {
|
|
375
|
-
return
|
|
402
|
+
return p("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", e.class);
|
|
376
403
|
},
|
|
377
404
|
get trigger() {
|
|
378
405
|
return [(() => {
|
|
379
|
-
var
|
|
380
|
-
return f(
|
|
381
|
-
})(),
|
|
406
|
+
var u = ye();
|
|
407
|
+
return f(u, () => d()?.label ?? e.placeholder ?? "Select..."), _(() => E(u, p("truncate", !d() && "text-muted-foreground"))), u;
|
|
408
|
+
})(), l(oe, {
|
|
382
409
|
class: "w-3.5 h-3.5 text-muted-foreground"
|
|
383
410
|
})];
|
|
384
411
|
},
|
|
385
412
|
get items() {
|
|
386
|
-
return
|
|
413
|
+
return s();
|
|
387
414
|
},
|
|
388
415
|
get value() {
|
|
389
416
|
return e.value;
|
|
@@ -396,9 +423,9 @@ function Re(e) {
|
|
|
396
423
|
}
|
|
397
424
|
});
|
|
398
425
|
}
|
|
399
|
-
|
|
426
|
+
ee(["click", "keydown"]);
|
|
400
427
|
export {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
428
|
+
Me as Dropdown,
|
|
429
|
+
Ie as Select,
|
|
430
|
+
pe as resolveDropdownTriggerKeyAction
|
|
404
431
|
};
|