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