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