@deck9/ui 0.14.9 → 0.14.11
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/src/ui.mjs +272 -257
- package/dist/src/ui.umd.js +3 -3
- package/package.json +1 -1
package/dist/src/ui.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as $, computed as k, openBlock as
|
|
1
|
+
import { defineComponent as $, computed as k, openBlock as R, createBlock as K, unref as P, mergeProps as ot, createCommentVNode as M, createElementBlock as T, normalizeClass as A, createElementVNode as I, toDisplayString as B, createVNode as F, ref as O, getCurrentInstance as In, onMounted as ee, watch as Z, Fragment as be, withDirectives as $n, vModelText as An, normalizeStyle as Nt, cloneVNode as Mn, h as Ce, inject as he, provide as ye, watchEffect as xe, nextTick as j, onUnmounted as Ne, toRaw as X, shallowRef as Vn, getCurrentScope as Fn, onScopeDispose as Nn, shallowReadonly as me, withCtx as W, renderSlot as ht, Teleport as Bn, Transition as Bt, normalizeProps as jn, guardReactiveProps as zn, resolveDynamicComponent as Un, isRef as Hn, renderList as jt, createTextVNode as Wn } from "vue";
|
|
2
2
|
import { FontAwesomeIcon as Kn } from "@fortawesome/vue-fontawesome";
|
|
3
3
|
import { library as lt } from "@fortawesome/fontawesome-svg-core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as g from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import * as Se from "@fortawesome/free-brands-svg-icons";
|
|
6
6
|
var zt = "fas", Ut = "numeric-input", Ht = 512, Wt = 512, Qe = [], Kt = "", Gt = "m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";
|
|
7
7
|
const yt = {
|
|
@@ -21,78 +21,93 @@ const yt = {
|
|
|
21
21
|
aliases: Qe
|
|
22
22
|
};
|
|
23
23
|
lt.add(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
24
|
+
g.faAlignCenter,
|
|
25
|
+
g.faAlignLeft,
|
|
26
|
+
g.faAlignRight,
|
|
27
|
+
g.faArrowUp19,
|
|
28
|
+
g.faAt,
|
|
29
|
+
g.faBold,
|
|
30
|
+
g.faBolt,
|
|
31
|
+
g.faCalendar,
|
|
32
|
+
g.faChartPie,
|
|
33
|
+
g.faCheck,
|
|
34
|
+
g.faCheckCircle,
|
|
35
|
+
g.faChevronDown,
|
|
36
|
+
g.faChevronLeft,
|
|
37
|
+
g.faChevronRight,
|
|
38
|
+
g.faChevronUp,
|
|
39
|
+
g.faCircleCheck,
|
|
40
|
+
g.faCircleNotch,
|
|
41
|
+
g.faClipboard,
|
|
42
|
+
g.faCloudDownload,
|
|
43
|
+
g.faCloudUpload,
|
|
44
|
+
g.faCode,
|
|
45
|
+
g.faCog,
|
|
46
|
+
g.faCrown,
|
|
47
|
+
g.faDoorOpen,
|
|
48
|
+
g.faDotCircle,
|
|
49
|
+
g.faEllipsis,
|
|
50
|
+
g.faEllipsisVertical,
|
|
51
|
+
g.faEnvelope,
|
|
52
|
+
g.faExclamationTriangle,
|
|
53
|
+
g.faExternalLink,
|
|
54
|
+
g.faEyeDropper,
|
|
55
|
+
g.faFileLines,
|
|
56
|
+
g.faFilePdf,
|
|
57
|
+
g.faFileUpload,
|
|
58
|
+
g.faFileVideo,
|
|
59
|
+
g.faFileWaveform,
|
|
60
|
+
g.faFilter,
|
|
61
|
+
g.faFingerprint,
|
|
62
|
+
g.faFont,
|
|
63
|
+
g.faGlobe,
|
|
64
|
+
g.faGripHorizontal,
|
|
65
|
+
g.faGripVertical,
|
|
66
|
+
g.faHandPointRight,
|
|
67
|
+
g.faHashtag,
|
|
68
|
+
g.faHeading,
|
|
69
|
+
g.faHeart,
|
|
70
|
+
g.faInfoCircle,
|
|
71
|
+
g.faItalic,
|
|
72
|
+
g.faLink,
|
|
73
|
+
g.faLinkSlash,
|
|
74
|
+
g.faList,
|
|
75
|
+
g.faListOl,
|
|
76
|
+
g.faListUl,
|
|
77
|
+
g.faLock,
|
|
78
|
+
g.faLockOpen,
|
|
79
|
+
g.faMedal,
|
|
80
|
+
g.faMessage,
|
|
81
|
+
g.faPencilAlt,
|
|
82
|
+
g.faPenToSquare,
|
|
83
|
+
g.faPhone,
|
|
84
|
+
g.faPlayCircle,
|
|
85
|
+
g.faPlus,
|
|
86
|
+
g.faPlusCircle,
|
|
87
|
+
g.faPoo,
|
|
88
|
+
g.faPuzzlePiece,
|
|
89
|
+
g.faReply,
|
|
90
|
+
g.faReplyAll,
|
|
91
|
+
g.faRobot,
|
|
92
|
+
g.faSave,
|
|
93
|
+
g.faShield,
|
|
94
|
+
g.faSignal,
|
|
95
|
+
g.faSignature,
|
|
96
|
+
g.faSignature,
|
|
97
|
+
g.faSquareCheck,
|
|
98
|
+
g.faStar,
|
|
99
|
+
g.faStrikethrough,
|
|
100
|
+
g.faTextSlash,
|
|
101
|
+
g.faTimes,
|
|
102
|
+
g.faTrash,
|
|
103
|
+
g.faTree,
|
|
104
|
+
g.faTrophy,
|
|
105
|
+
g.faTurnDown,
|
|
106
|
+
g.faUnderline,
|
|
107
|
+
g.faUpload,
|
|
108
|
+
g.faUser,
|
|
109
|
+
g.faUserShield,
|
|
110
|
+
g.faWandMagicSparkles,
|
|
96
111
|
// Brands
|
|
97
112
|
Se.faTwitter,
|
|
98
113
|
Se.faInstagram,
|
|
@@ -112,7 +127,7 @@ const qn = [...Object.keys(lt.definitions.fas)].sort(), xt = [...Object.keys(lt.
|
|
|
112
127
|
"could not load icon, because it is not available",
|
|
113
128
|
t.name
|
|
114
129
|
), !1));
|
|
115
|
-
return (n, r) => o.value ? (
|
|
130
|
+
return (n, r) => o.value ? (R(), K(P(Kn), ot({
|
|
116
131
|
key: 0,
|
|
117
132
|
icon: [l.value, n.name]
|
|
118
133
|
}, n.$attrs), null, 16, ["icon"])) : M("", !0);
|
|
@@ -120,7 +135,7 @@ const qn = [...Object.keys(lt.definitions.fas)].sort(), xt = [...Object.keys(lt.
|
|
|
120
135
|
}), Xn = ["aria-label", "tabindex"], Yn = {
|
|
121
136
|
key: 0,
|
|
122
137
|
class: "absolute inset-0 flex items-center justify-center"
|
|
123
|
-
},
|
|
138
|
+
}, Rr = /* @__PURE__ */ $({
|
|
124
139
|
__name: "Button",
|
|
125
140
|
props: {
|
|
126
141
|
label: {},
|
|
@@ -172,7 +187,7 @@ const qn = [...Object.keys(lt.definitions.fas)].sort(), xt = [...Object.keys(lt.
|
|
|
172
187
|
function i() {
|
|
173
188
|
o.isDisabled || l("onClick");
|
|
174
189
|
}
|
|
175
|
-
return (u, c) => (
|
|
190
|
+
return (u, c) => (R(), T("button", {
|
|
176
191
|
class: A(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", n.value]),
|
|
177
192
|
type: "button",
|
|
178
193
|
"aria-label": u.label,
|
|
@@ -182,19 +197,19 @@ const qn = [...Object.keys(lt.definitions.fas)].sort(), xt = [...Object.keys(lt.
|
|
|
182
197
|
I("div", {
|
|
183
198
|
class: A(!u.isLoading || "invisible")
|
|
184
199
|
}, [
|
|
185
|
-
u.icon && u.iconPosition === "left" ? (
|
|
200
|
+
u.icon && u.iconPosition === "left" ? (R(), K(U, {
|
|
186
201
|
key: 0,
|
|
187
202
|
name: u.icon,
|
|
188
203
|
class: A(r.value)
|
|
189
204
|
}, null, 8, ["name", "class"])) : M("", !0),
|
|
190
205
|
I("span", null, B(u.label), 1),
|
|
191
|
-
u.icon && u.iconPosition === "right" ? (
|
|
206
|
+
u.icon && u.iconPosition === "right" ? (R(), K(U, {
|
|
192
207
|
key: 1,
|
|
193
208
|
name: u.icon,
|
|
194
209
|
class: A(r.value)
|
|
195
210
|
}, null, 8, ["name", "class"])) : M("", !0)
|
|
196
211
|
], 2),
|
|
197
|
-
u.isLoading ? (
|
|
212
|
+
u.isLoading ? (R(), T("span", Yn, [
|
|
198
213
|
F(U, {
|
|
199
214
|
class: "animate-spin",
|
|
200
215
|
name: "circle-notch"
|
|
@@ -235,7 +250,7 @@ function qt(e, t, l) {
|
|
|
235
250
|
const to = { class: "relative flex items-start" }, no = { class: "flex items-center h-5" }, oo = ["checked", "id"], lo = { class: "ml-2 text-sm leading-5" }, ro = ["for"], io = {
|
|
236
251
|
key: 0,
|
|
237
252
|
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
238
|
-
},
|
|
253
|
+
}, Er = /* @__PURE__ */ $({
|
|
239
254
|
__name: "Checkbox",
|
|
240
255
|
props: {
|
|
241
256
|
id: { default: qt() },
|
|
@@ -248,7 +263,7 @@ const to = { class: "relative flex items-start" }, no = { class: "flex items-cen
|
|
|
248
263
|
const l = t, o = (n) => {
|
|
249
264
|
l("update:modelValue", n.target.checked);
|
|
250
265
|
};
|
|
251
|
-
return (n, r) => (
|
|
266
|
+
return (n, r) => (R(), T("div", to, [
|
|
252
267
|
I("div", no, [
|
|
253
268
|
I("input", {
|
|
254
269
|
class: "h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm",
|
|
@@ -263,7 +278,7 @@ const to = { class: "relative flex items-start" }, no = { class: "flex items-cen
|
|
|
263
278
|
for: n.id,
|
|
264
279
|
class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
|
|
265
280
|
}, B(n.label), 9, ro),
|
|
266
|
-
n.description ? (
|
|
281
|
+
n.description ? (R(), T("p", io, B(n.description), 1)) : M("", !0)
|
|
267
282
|
])
|
|
268
283
|
]));
|
|
269
284
|
}
|
|
@@ -392,15 +407,15 @@ class Co {
|
|
|
392
407
|
this._setter(t);
|
|
393
408
|
}
|
|
394
409
|
}
|
|
395
|
-
function
|
|
410
|
+
function Ro(e, t, l = !1) {
|
|
396
411
|
let o, n;
|
|
397
412
|
const r = po(e);
|
|
398
413
|
return r ? (o = e, n = co) : (o = e.get, n = e.set), new Co(o, n, r || !n, l);
|
|
399
414
|
}
|
|
400
|
-
let Xe,
|
|
401
|
-
(Xe = St()[
|
|
402
|
-
let
|
|
403
|
-
const Ye = (e, t) =>
|
|
415
|
+
let Xe, Rt = "__VUE_INSTANCE_SETTERS__";
|
|
416
|
+
(Xe = St()[Rt]) || (Xe = St()[Rt] = []), Xe.push((e) => e);
|
|
417
|
+
let Eo = !1;
|
|
418
|
+
const Ye = (e, t) => Ro(e, t, Eo);
|
|
404
419
|
function rt(e) {
|
|
405
420
|
const t = Ye(() => ({
|
|
406
421
|
"pl-3 pr-10 py-2": !e.icon && e.type !== "color" && e.size === "small",
|
|
@@ -469,12 +484,12 @@ const Do = ["placeholder", "type", "tabindex", "value"], Po = { class: "absolute
|
|
|
469
484
|
return;
|
|
470
485
|
}
|
|
471
486
|
r.value = (y == null ? void 0 : y.target).value, i("update:modelValue", r.value);
|
|
472
|
-
},
|
|
487
|
+
}, h = O(null);
|
|
473
488
|
return t({
|
|
474
489
|
focus: () => {
|
|
475
|
-
o.isDisabled ||
|
|
490
|
+
o.isDisabled || h.value.focus();
|
|
476
491
|
}
|
|
477
|
-
}), (y, x) => (
|
|
492
|
+
}), (y, x) => (R(), T("div", {
|
|
478
493
|
class: A(["relative", [y.block ? "w-full block" : "inline-block"]])
|
|
479
494
|
}, [
|
|
480
495
|
I("input", ot({
|
|
@@ -488,7 +503,7 @@ const Do = ["placeholder", "type", "tabindex", "value"], Po = { class: "absolute
|
|
|
488
503
|
ref: n,
|
|
489
504
|
onInput: p
|
|
490
505
|
}), null, 16, Do),
|
|
491
|
-
y.type === "color" ? (
|
|
506
|
+
y.type === "color" ? (R(), T(be, { key: 0 }, [
|
|
492
507
|
I("label", Po, [
|
|
493
508
|
$n(I("input", {
|
|
494
509
|
class: "invisible",
|
|
@@ -503,7 +518,7 @@ const Do = ["placeholder", "type", "tabindex", "value"], Po = { class: "absolute
|
|
|
503
518
|
style: Nt(`background-color: ${r.value}`)
|
|
504
519
|
}, null, 4)
|
|
505
520
|
]),
|
|
506
|
-
P(d) && y.showColorPicker ? (
|
|
521
|
+
P(d) && y.showColorPicker ? (R(), T("button", {
|
|
507
522
|
key: 0,
|
|
508
523
|
type: "button",
|
|
509
524
|
class: "absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",
|
|
@@ -514,7 +529,7 @@ const Do = ["placeholder", "type", "tabindex", "value"], Po = { class: "absolute
|
|
|
514
529
|
name: "eyedropper"
|
|
515
530
|
})
|
|
516
531
|
])) : M("", !0)
|
|
517
|
-
], 64)) : y.icon ? (
|
|
532
|
+
], 64)) : y.icon ? (R(), T("span", {
|
|
518
533
|
key: 1,
|
|
519
534
|
class: A(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", P(a)])
|
|
520
535
|
}, [
|
|
@@ -533,9 +548,9 @@ const Do = ["placeholder", "type", "tabindex", "value"], Po = { class: "absolute
|
|
|
533
548
|
description: {}
|
|
534
549
|
},
|
|
535
550
|
setup(e) {
|
|
536
|
-
return (t, l) => (
|
|
551
|
+
return (t, l) => (R(), T("span", To, [
|
|
537
552
|
I("label", { for: t.id }, B(t.label), 9, Lo),
|
|
538
|
-
t.description ? (
|
|
553
|
+
t.description ? (R(), T("span", Io, B(t.description), 1)) : M("", !0)
|
|
539
554
|
]));
|
|
540
555
|
}
|
|
541
556
|
});
|
|
@@ -547,7 +562,7 @@ function G(e, t, ...l) {
|
|
|
547
562
|
let o = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((n) => `"${n}"`).join(", ")}.`);
|
|
548
563
|
throw Error.captureStackTrace && Error.captureStackTrace(o, G), o;
|
|
549
564
|
}
|
|
550
|
-
var
|
|
565
|
+
var Re = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Re || {}), $o = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))($o || {});
|
|
551
566
|
function z({ visible: e = !0, features: t = 0, ourProps: l, theirProps: o, ...n }) {
|
|
552
567
|
var r;
|
|
553
568
|
let i = Qt(o, l), u = Object.assign(n, { props: i });
|
|
@@ -576,7 +591,7 @@ function Ze({ props: e, attrs: t, slots: l, slot: o, name: n }) {
|
|
|
576
591
|
if (a = Zt(a ?? []), Object.keys(c).length > 0 || Object.keys(t).length > 0) {
|
|
577
592
|
let [d, ...m] = a ?? [];
|
|
578
593
|
if (!Ao(d) || m.length > 0)
|
|
579
|
-
throw new Error(['Passing props on "template"!', "", `The current component <${n} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(c).concat(Object.keys(t)).map((p) => p.trim()).filter((p,
|
|
594
|
+
throw new Error(['Passing props on "template"!', "", `The current component <${n} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(c).concat(Object.keys(t)).map((p) => p.trim()).filter((p, h, b) => b.indexOf(p) === h).sort((p, h) => p.localeCompare(h)).map((p) => ` - ${p}`).join(`
|
|
580
595
|
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((p) => ` - ${p}`).join(`
|
|
581
596
|
`)].join(`
|
|
582
597
|
`));
|
|
@@ -669,7 +684,7 @@ function en(e, t) {
|
|
|
669
684
|
})();
|
|
670
685
|
return r === -1 ? o : r;
|
|
671
686
|
}
|
|
672
|
-
function
|
|
687
|
+
function E(e) {
|
|
673
688
|
var t;
|
|
674
689
|
return e == null || e.value == null ? null : (t = e.value.$el) != null ? t : e.value;
|
|
675
690
|
}
|
|
@@ -681,7 +696,7 @@ function nn() {
|
|
|
681
696
|
function on(e) {
|
|
682
697
|
ye(tn, e);
|
|
683
698
|
}
|
|
684
|
-
function
|
|
699
|
+
function Et(e, t) {
|
|
685
700
|
if (e)
|
|
686
701
|
return e;
|
|
687
702
|
let l = t ?? "button";
|
|
@@ -689,12 +704,12 @@ function Rt(e, t) {
|
|
|
689
704
|
return "button";
|
|
690
705
|
}
|
|
691
706
|
function at(e, t) {
|
|
692
|
-
let l = O(
|
|
707
|
+
let l = O(Et(e.value.type, e.value.as));
|
|
693
708
|
return ee(() => {
|
|
694
|
-
l.value =
|
|
709
|
+
l.value = Et(e.value.type, e.value.as);
|
|
695
710
|
}), xe(() => {
|
|
696
711
|
var o;
|
|
697
|
-
l.value ||
|
|
712
|
+
l.value || E(t) && E(t) instanceof HTMLButtonElement && !((o = E(t)) != null && o.hasAttribute("type")) && (l.value = "button");
|
|
698
713
|
}), l;
|
|
699
714
|
}
|
|
700
715
|
var No = Object.defineProperty, Bo = (e, t, l) => t in e ? No(e, t, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[t] = l, Dt = (e, t, l) => (Bo(e, typeof t != "symbol" ? t + "" : t, l), l);
|
|
@@ -728,7 +743,7 @@ function ut(e) {
|
|
|
728
743
|
if (e instanceof Node)
|
|
729
744
|
return e.ownerDocument;
|
|
730
745
|
if (e != null && e.hasOwnProperty("value")) {
|
|
731
|
-
let t =
|
|
746
|
+
let t = E(e);
|
|
732
747
|
if (t)
|
|
733
748
|
return t.ownerDocument;
|
|
734
749
|
}
|
|
@@ -859,7 +874,7 @@ function an(e, t, l = k(() => !0)) {
|
|
|
859
874
|
for (let a of c) {
|
|
860
875
|
if (a === null)
|
|
861
876
|
continue;
|
|
862
|
-
let s = a instanceof HTMLElement ? a :
|
|
877
|
+
let s = a instanceof HTMLElement ? a : E(a);
|
|
863
878
|
if (s != null && s.contains(u) || r.composed && r.composedPath().includes(s))
|
|
864
879
|
return;
|
|
865
880
|
}
|
|
@@ -986,7 +1001,7 @@ function tl(e) {
|
|
|
986
1001
|
function vn(e) {
|
|
987
1002
|
let t = O(""), l = O("");
|
|
988
1003
|
return () => {
|
|
989
|
-
let o =
|
|
1004
|
+
let o = E(e);
|
|
990
1005
|
if (!o)
|
|
991
1006
|
return "";
|
|
992
1007
|
let n = o.innerText;
|
|
@@ -1015,10 +1030,10 @@ function De(e) {
|
|
|
1015
1030
|
let al = $({ name: "Listbox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], default: () => nl }, horizontal: { type: [Boolean], default: !1 }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, multiple: { type: [Boolean], default: !1 } }, inheritAttrs: !1, setup(e, { slots: t, attrs: l, emit: o }) {
|
|
1016
1031
|
let n = O(1), r = O(null), i = O(null), u = O(null), c = O([]), a = O(""), s = O(null), d = O(1);
|
|
1017
1032
|
function m(x = (w) => w) {
|
|
1018
|
-
let w = s.value !== null ? c.value[s.value] : null, S = ct(x(c.value.slice()), (C) =>
|
|
1033
|
+
let w = s.value !== null ? c.value[s.value] : null, S = ct(x(c.value.slice()), (C) => E(C.dataRef.domRef)), _ = w ? S.indexOf(w) : null;
|
|
1019
1034
|
return _ === -1 && (_ = null), { options: S, activeOptionIndex: _ };
|
|
1020
1035
|
}
|
|
1021
|
-
let f = k(() => e.multiple ? 1 : 0), [v, p] = fn(k(() => e.modelValue), (x) => o("update:modelValue", x), k(() => e.defaultValue)),
|
|
1036
|
+
let f = k(() => e.multiple ? 1 : 0), [v, p] = fn(k(() => e.modelValue), (x) => o("update:modelValue", x), k(() => e.defaultValue)), h = k(() => v.value === void 0 ? G(f.value, { 1: [], 0: void 0 }) : v.value), b = { listboxState: n, value: h, mode: f, compare(x, w) {
|
|
1022
1037
|
if (typeof e.by == "string") {
|
|
1023
1038
|
let S = e.by;
|
|
1024
1039
|
return (x == null ? void 0 : x[S]) === (w == null ? void 0 : w[S]);
|
|
@@ -1055,24 +1070,24 @@ let al = $({ name: "Listbox", emits: { "update:modelValue": (e) => !0 }, props:
|
|
|
1055
1070
|
e.disabled || p(x);
|
|
1056
1071
|
}, select(x) {
|
|
1057
1072
|
e.disabled || p(G(f.value, { 0: () => x, 1: () => {
|
|
1058
|
-
let w = X(
|
|
1073
|
+
let w = X(b.value.value).slice(), S = X(x), _ = w.findIndex((C) => b.compare(S, X(C)));
|
|
1059
1074
|
return _ === -1 ? w.push(S) : w.splice(_, 1), w;
|
|
1060
1075
|
} }));
|
|
1061
1076
|
} };
|
|
1062
1077
|
an([i, u], (x, w) => {
|
|
1063
1078
|
var S;
|
|
1064
|
-
|
|
1065
|
-
}, k(() => n.value === 0)), ye(gn,
|
|
1079
|
+
b.closeListbox(), ze(w, je.Loose) || (x.preventDefault(), (S = E(i)) == null || S.focus());
|
|
1080
|
+
}, k(() => n.value === 0)), ye(gn, b), on(k(() => G(n.value, { 0: te.Open, 1: te.Closed })));
|
|
1066
1081
|
let y = k(() => {
|
|
1067
1082
|
var x;
|
|
1068
|
-
return (x =
|
|
1083
|
+
return (x = E(i)) == null ? void 0 : x.closest("form");
|
|
1069
1084
|
});
|
|
1070
1085
|
return ee(() => {
|
|
1071
1086
|
Z([y], () => {
|
|
1072
1087
|
if (!y.value || e.defaultValue === void 0)
|
|
1073
1088
|
return;
|
|
1074
1089
|
function x() {
|
|
1075
|
-
|
|
1090
|
+
b.theirOnChange(e.defaultValue);
|
|
1076
1091
|
}
|
|
1077
1092
|
return y.value.addEventListener("reset", x), () => {
|
|
1078
1093
|
var w;
|
|
@@ -1080,15 +1095,15 @@ let al = $({ name: "Listbox", emits: { "update:modelValue": (e) => !0 }, props:
|
|
|
1080
1095
|
};
|
|
1081
1096
|
}, { immediate: !0 });
|
|
1082
1097
|
}), () => {
|
|
1083
|
-
let { name: x, modelValue: w, disabled: S, form: _, ...C } = e, N = { open: n.value === 0, disabled: S, value:
|
|
1084
|
-
return Ce(be, [...x != null &&
|
|
1098
|
+
let { name: x, modelValue: w, disabled: S, form: _, ...C } = e, N = { open: n.value === 0, disabled: S, value: h.value };
|
|
1099
|
+
return Ce(be, [...x != null && h.value != null ? un({ [x]: h.value }).map(([re, _e]) => Ce(sn, Jt({ features: dt.Hidden, key: re, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: _, name: re, value: _e }))) : [], z({ ourProps: {}, theirProps: { ...l, ...it(C, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: N, slots: t, attrs: l, name: "Listbox" })]);
|
|
1085
1100
|
};
|
|
1086
1101
|
} });
|
|
1087
1102
|
$({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: () => `headlessui-listbox-label-${J()}` } }, setup(e, { attrs: t, slots: l }) {
|
|
1088
1103
|
let o = De("ListboxLabel");
|
|
1089
1104
|
function n() {
|
|
1090
1105
|
var r;
|
|
1091
|
-
(r =
|
|
1106
|
+
(r = E(o.buttonRef)) == null || r.focus({ preventScroll: !0 });
|
|
1092
1107
|
}
|
|
1093
1108
|
return () => {
|
|
1094
1109
|
let r = { open: o.listboxState.value === 0, disabled: o.disabled.value }, { id: i, ...u } = e, c = { id: i, ref: o.labelRef, onClick: n };
|
|
@@ -1105,13 +1120,13 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1105
1120
|
case D.ArrowDown:
|
|
1106
1121
|
a.preventDefault(), n.openListbox(), j(() => {
|
|
1107
1122
|
var s;
|
|
1108
|
-
(s =
|
|
1123
|
+
(s = E(n.optionsRef)) == null || s.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.First);
|
|
1109
1124
|
});
|
|
1110
1125
|
break;
|
|
1111
1126
|
case D.ArrowUp:
|
|
1112
1127
|
a.preventDefault(), n.openListbox(), j(() => {
|
|
1113
1128
|
var s;
|
|
1114
|
-
(s =
|
|
1129
|
+
(s = E(n.optionsRef)) == null || s.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.Last);
|
|
1115
1130
|
});
|
|
1116
1131
|
break;
|
|
1117
1132
|
}
|
|
@@ -1126,16 +1141,16 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1126
1141
|
function u(a) {
|
|
1127
1142
|
n.disabled.value || (n.listboxState.value === 0 ? (n.closeListbox(), j(() => {
|
|
1128
1143
|
var s;
|
|
1129
|
-
return (s =
|
|
1144
|
+
return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1130
1145
|
})) : (a.preventDefault(), n.openListbox(), il(() => {
|
|
1131
1146
|
var s;
|
|
1132
|
-
return (s =
|
|
1147
|
+
return (s = E(n.optionsRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1133
1148
|
})));
|
|
1134
1149
|
}
|
|
1135
1150
|
let c = at(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
|
|
1136
1151
|
return () => {
|
|
1137
1152
|
var a, s;
|
|
1138
|
-
let d = { open: n.listboxState.value === 0, disabled: n.disabled.value, value: n.value.value }, { id: m, ...f } = e, v = { ref: n.buttonRef, id: m, type: c.value, "aria-haspopup": "listbox", "aria-controls": (a =
|
|
1153
|
+
let d = { open: n.listboxState.value === 0, disabled: n.disabled.value, value: n.value.value }, { id: m, ...f } = e, v = { ref: n.buttonRef, id: m, type: c.value, "aria-haspopup": "listbox", "aria-controls": (a = E(n.optionsRef)) == null ? void 0 : a.id, "aria-expanded": n.listboxState.value === 0, "aria-labelledby": n.labelRef.value ? [(s = E(n.labelRef)) == null ? void 0 : s.id, m].join(" ") : void 0, disabled: n.disabled.value === !0 ? !0 : void 0, onKeydown: r, onKeyup: i, onClick: u };
|
|
1139
1154
|
return z({ ourProps: v, theirProps: f, slot: d, attrs: t, slots: l, name: "ListboxButton" });
|
|
1140
1155
|
};
|
|
1141
1156
|
} }), ul = $({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: () => `headlessui-listbox-options-${J()}` } }, setup(e, { attrs: t, slots: l, expose: o }) {
|
|
@@ -1153,7 +1168,7 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1153
1168
|
}
|
|
1154
1169
|
n.mode.value === 0 && (n.closeListbox(), j(() => {
|
|
1155
1170
|
var s;
|
|
1156
|
-
return (s =
|
|
1171
|
+
return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1157
1172
|
}));
|
|
1158
1173
|
break;
|
|
1159
1174
|
case G(n.orientation.value, { vertical: D.ArrowDown, horizontal: D.ArrowRight }):
|
|
@@ -1169,7 +1184,7 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1169
1184
|
case D.Escape:
|
|
1170
1185
|
a.preventDefault(), a.stopPropagation(), n.closeListbox(), j(() => {
|
|
1171
1186
|
var s;
|
|
1172
|
-
return (s =
|
|
1187
|
+
return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1173
1188
|
});
|
|
1174
1189
|
break;
|
|
1175
1190
|
case D.Tab:
|
|
@@ -1183,16 +1198,16 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1183
1198
|
let u = nn(), c = k(() => u !== null ? (u.value & te.Open) === te.Open : n.listboxState.value === 0);
|
|
1184
1199
|
return () => {
|
|
1185
1200
|
var a, s, d, m;
|
|
1186
|
-
let f = { open: n.listboxState.value === 0 }, { id: v, ...p } = e,
|
|
1187
|
-
return z({ ourProps:
|
|
1201
|
+
let f = { open: n.listboxState.value === 0 }, { id: v, ...p } = e, h = { "aria-activedescendant": n.activeOptionIndex.value === null || (a = n.options.value[n.activeOptionIndex.value]) == null ? void 0 : a.id, "aria-multiselectable": n.mode.value === 1 ? !0 : void 0, "aria-labelledby": (m = (s = E(n.labelRef)) == null ? void 0 : s.id) != null ? m : (d = E(n.buttonRef)) == null ? void 0 : d.id, "aria-orientation": n.orientation.value, id: v, onKeydown: i, role: "listbox", tabIndex: 0, ref: n.optionsRef };
|
|
1202
|
+
return z({ ourProps: h, theirProps: p, slot: f, attrs: t, slots: l, features: Re.RenderStrategy | Re.Static, visible: c.value, name: "ListboxOptions" });
|
|
1188
1203
|
};
|
|
1189
1204
|
} }), cl = $({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-listbox.option-${J()}` } }, setup(e, { slots: t, attrs: l, expose: o }) {
|
|
1190
1205
|
let n = De("ListboxOption"), r = O(null);
|
|
1191
1206
|
o({ el: r, $el: r });
|
|
1192
|
-
let i = k(() => n.activeOptionIndex.value !== null ? n.options.value[n.activeOptionIndex.value].id === e.id : !1), u = k(() => G(n.mode.value, { 0: () => n.compare(X(n.value.value), X(e.value)), 1: () => X(n.value.value).some((
|
|
1193
|
-
var
|
|
1207
|
+
let i = k(() => n.activeOptionIndex.value !== null ? n.options.value[n.activeOptionIndex.value].id === e.id : !1), u = k(() => G(n.mode.value, { 0: () => n.compare(X(n.value.value), X(e.value)), 1: () => X(n.value.value).some((b) => n.compare(X(b), X(e.value))) })), c = k(() => G(n.mode.value, { 1: () => {
|
|
1208
|
+
var b;
|
|
1194
1209
|
let y = X(n.value.value);
|
|
1195
|
-
return ((
|
|
1210
|
+
return ((b = n.options.value.find((x) => y.some((w) => n.compare(X(w), X(x.dataRef.value))))) == null ? void 0 : b.id) === e.id;
|
|
1196
1211
|
}, 0: () => u.value })), a = vn(r), s = k(() => ({ disabled: e.disabled, value: e.value, get textValue() {
|
|
1197
1212
|
return a();
|
|
1198
1213
|
}, domRef: r }));
|
|
@@ -1206,16 +1221,16 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1206
1221
|
}, { immediate: !0 });
|
|
1207
1222
|
}), xe(() => {
|
|
1208
1223
|
n.listboxState.value === 0 && i.value && n.activationTrigger.value !== 0 && j(() => {
|
|
1209
|
-
var
|
|
1210
|
-
return (y = (
|
|
1224
|
+
var b, y;
|
|
1225
|
+
return (y = (b = E(r)) == null ? void 0 : b.scrollIntoView) == null ? void 0 : y.call(b, { block: "nearest" });
|
|
1211
1226
|
});
|
|
1212
1227
|
});
|
|
1213
|
-
function d(
|
|
1228
|
+
function d(b) {
|
|
1214
1229
|
if (e.disabled)
|
|
1215
|
-
return
|
|
1230
|
+
return b.preventDefault();
|
|
1216
1231
|
n.select(e.value), n.mode.value === 0 && (n.closeListbox(), j(() => {
|
|
1217
1232
|
var y;
|
|
1218
|
-
return (y =
|
|
1233
|
+
return (y = E(n.buttonRef)) == null ? void 0 : y.focus({ preventScroll: !0 });
|
|
1219
1234
|
}));
|
|
1220
1235
|
}
|
|
1221
1236
|
function m() {
|
|
@@ -1224,17 +1239,17 @@ let sl = $({ name: "ListboxButton", props: { as: { type: [Object, String], defau
|
|
|
1224
1239
|
n.goToOption(L.Specific, e.id);
|
|
1225
1240
|
}
|
|
1226
1241
|
let f = pn();
|
|
1227
|
-
function v(
|
|
1228
|
-
f.update(
|
|
1242
|
+
function v(b) {
|
|
1243
|
+
f.update(b);
|
|
1229
1244
|
}
|
|
1230
|
-
function p(
|
|
1231
|
-
f.wasMoved(
|
|
1245
|
+
function p(b) {
|
|
1246
|
+
f.wasMoved(b) && (e.disabled || i.value || n.goToOption(L.Specific, e.id, 0));
|
|
1232
1247
|
}
|
|
1233
|
-
function b
|
|
1234
|
-
f.wasMoved(
|
|
1248
|
+
function h(b) {
|
|
1249
|
+
f.wasMoved(b) && (e.disabled || i.value && n.goToOption(L.Nothing));
|
|
1235
1250
|
}
|
|
1236
1251
|
return () => {
|
|
1237
|
-
let { disabled:
|
|
1252
|
+
let { disabled: b } = e, y = { active: i.value, selected: u.value, disabled: b }, { id: x, value: w, disabled: S, ..._ } = e, C = { id: x, ref: r, role: "option", tabIndex: b === !0 ? void 0 : -1, "aria-disabled": b === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onClick: d, onFocus: m, onPointerenter: v, onMouseenter: v, onPointermove: p, onMousemove: p, onPointerleave: h, onMouseleave: h };
|
|
1238
1253
|
return z({ ourProps: C, theirProps: _, slot: y, attrs: l, slots: t, name: "ListboxOption" });
|
|
1239
1254
|
};
|
|
1240
1255
|
} });
|
|
@@ -1254,18 +1269,18 @@ function Ue(e) {
|
|
|
1254
1269
|
let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: l }) {
|
|
1255
1270
|
let o = O(1), n = O(null), r = O(null), i = O([]), u = O(""), c = O(null), a = O(1);
|
|
1256
1271
|
function s(m = (f) => f) {
|
|
1257
|
-
let f = c.value !== null ? i.value[c.value] : null, v = ct(m(i.value.slice()), (
|
|
1272
|
+
let f = c.value !== null ? i.value[c.value] : null, v = ct(m(i.value.slice()), (h) => E(h.dataRef.domRef)), p = f ? v.indexOf(f) : null;
|
|
1258
1273
|
return p === -1 && (p = null), { items: v, activeItemIndex: p };
|
|
1259
1274
|
}
|
|
1260
1275
|
let d = { menuState: o, buttonRef: n, itemsRef: r, items: i, searchQuery: u, activeItemIndex: c, activationTrigger: a, closeMenu: () => {
|
|
1261
1276
|
o.value = 1, c.value = null;
|
|
1262
1277
|
}, openMenu: () => o.value = 0, goToItem(m, f, v) {
|
|
1263
|
-
let p = s(),
|
|
1264
|
-
u.value = "", c.value =
|
|
1278
|
+
let p = s(), h = en(m === L.Specific ? { focus: L.Specific, id: f } : { focus: m }, { resolveItems: () => p.items, resolveActiveIndex: () => p.activeItemIndex, resolveId: (b) => b.id, resolveDisabled: (b) => b.dataRef.disabled });
|
|
1279
|
+
u.value = "", c.value = h, a.value = v ?? 1, i.value = p.items;
|
|
1265
1280
|
}, search(m) {
|
|
1266
1281
|
let f = u.value !== "" ? 0 : 1;
|
|
1267
1282
|
u.value += m.toLowerCase();
|
|
1268
|
-
let v = (c.value !== null ? i.value.slice(c.value + f).concat(i.value.slice(0, c.value + f)) : i.value).find((
|
|
1283
|
+
let v = (c.value !== null ? i.value.slice(c.value + f).concat(i.value.slice(0, c.value + f)) : i.value).find((h) => h.dataRef.textValue.startsWith(u.value) && !h.dataRef.disabled), p = v ? i.value.indexOf(v) : -1;
|
|
1269
1284
|
p === -1 || p === c.value || (c.value = p, a.value = 1);
|
|
1270
1285
|
}, clearSearch() {
|
|
1271
1286
|
u.value = "";
|
|
@@ -1274,14 +1289,14 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1274
1289
|
i.value = v.items, c.value = v.activeItemIndex, a.value = 1;
|
|
1275
1290
|
}, unregisterItem(m) {
|
|
1276
1291
|
let f = s((v) => {
|
|
1277
|
-
let p = v.findIndex((
|
|
1292
|
+
let p = v.findIndex((h) => h.id === m);
|
|
1278
1293
|
return p !== -1 && v.splice(p, 1), v;
|
|
1279
1294
|
});
|
|
1280
1295
|
i.value = f.items, c.value = f.activeItemIndex, a.value = 1;
|
|
1281
1296
|
} };
|
|
1282
1297
|
return an([n, r], (m, f) => {
|
|
1283
1298
|
var v;
|
|
1284
|
-
d.closeMenu(), ze(f, je.Loose) || (m.preventDefault(), (v =
|
|
1299
|
+
d.closeMenu(), ze(f, je.Loose) || (m.preventDefault(), (v = E(n)) == null || v.focus());
|
|
1285
1300
|
}, k(() => o.value === 0)), ye(bn, d), on(k(() => G(o.value, { 0: te.Open, 1: te.Closed }))), () => {
|
|
1286
1301
|
let m = { open: o.value === 0, close: d.closeMenu };
|
|
1287
1302
|
return z({ ourProps: {}, theirProps: e, slot: m, slots: t, attrs: l, name: "Menu" });
|
|
@@ -1296,13 +1311,13 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1296
1311
|
case D.ArrowDown:
|
|
1297
1312
|
a.preventDefault(), a.stopPropagation(), n.openMenu(), j(() => {
|
|
1298
1313
|
var s;
|
|
1299
|
-
(s =
|
|
1314
|
+
(s = E(n.itemsRef)) == null || s.focus({ preventScroll: !0 }), n.goToItem(L.First);
|
|
1300
1315
|
});
|
|
1301
1316
|
break;
|
|
1302
1317
|
case D.ArrowUp:
|
|
1303
1318
|
a.preventDefault(), a.stopPropagation(), n.openMenu(), j(() => {
|
|
1304
1319
|
var s;
|
|
1305
|
-
(s =
|
|
1320
|
+
(s = E(n.itemsRef)) == null || s.focus({ preventScroll: !0 }), n.goToItem(L.Last);
|
|
1306
1321
|
});
|
|
1307
1322
|
break;
|
|
1308
1323
|
}
|
|
@@ -1317,21 +1332,21 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1317
1332
|
function u(a) {
|
|
1318
1333
|
e.disabled || (n.menuState.value === 0 ? (n.closeMenu(), j(() => {
|
|
1319
1334
|
var s;
|
|
1320
|
-
return (s =
|
|
1335
|
+
return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1321
1336
|
})) : (a.preventDefault(), n.openMenu(), pl(() => {
|
|
1322
1337
|
var s;
|
|
1323
|
-
return (s =
|
|
1338
|
+
return (s = E(n.itemsRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
|
|
1324
1339
|
})));
|
|
1325
1340
|
}
|
|
1326
1341
|
let c = at(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
|
|
1327
1342
|
return () => {
|
|
1328
1343
|
var a;
|
|
1329
|
-
let s = { open: n.menuState.value === 0 }, { id: d, ...m } = e, f = { ref: n.buttonRef, id: d, type: c.value, "aria-haspopup": "menu", "aria-controls": (a =
|
|
1344
|
+
let s = { open: n.menuState.value === 0 }, { id: d, ...m } = e, f = { ref: n.buttonRef, id: d, type: c.value, "aria-haspopup": "menu", "aria-controls": (a = E(n.itemsRef)) == null ? void 0 : a.id, "aria-expanded": n.menuState.value === 0, onKeydown: r, onKeyup: i, onClick: u };
|
|
1330
1345
|
return z({ ourProps: f, theirProps: m, slot: s, attrs: t, slots: l, name: "MenuButton" });
|
|
1331
1346
|
};
|
|
1332
1347
|
} }), gl = $({ name: "MenuItems", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: () => `headlessui-menu-items-${J()}` } }, setup(e, { attrs: t, slots: l, expose: o }) {
|
|
1333
1348
|
let n = Ue("MenuItems"), r = O(null);
|
|
1334
|
-
o({ el: n.itemsRef, $el: n.itemsRef }), zo({ container: k(() =>
|
|
1349
|
+
o({ el: n.itemsRef, $el: n.itemsRef }), zo({ container: k(() => E(n.itemsRef)), enabled: k(() => n.menuState.value === 0), accept(s) {
|
|
1335
1350
|
return s.getAttribute("role") === "menuitem" ? NodeFilter.FILTER_REJECT : s.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1336
1351
|
}, walk(s) {
|
|
1337
1352
|
s.setAttribute("role", "none");
|
|
@@ -1345,9 +1360,9 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1345
1360
|
case D.Enter:
|
|
1346
1361
|
if (s.preventDefault(), s.stopPropagation(), n.activeItemIndex.value !== null) {
|
|
1347
1362
|
let m = n.items.value[n.activeItemIndex.value];
|
|
1348
|
-
(d =
|
|
1363
|
+
(d = E(m.dataRef.domRef)) == null || d.click();
|
|
1349
1364
|
}
|
|
1350
|
-
n.closeMenu(), rn(
|
|
1365
|
+
n.closeMenu(), rn(E(n.buttonRef));
|
|
1351
1366
|
break;
|
|
1352
1367
|
case D.ArrowDown:
|
|
1353
1368
|
return s.preventDefault(), s.stopPropagation(), n.goToItem(L.Next);
|
|
@@ -1362,11 +1377,11 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1362
1377
|
case D.Escape:
|
|
1363
1378
|
s.preventDefault(), s.stopPropagation(), n.closeMenu(), j(() => {
|
|
1364
1379
|
var m;
|
|
1365
|
-
return (m =
|
|
1380
|
+
return (m = E(n.buttonRef)) == null ? void 0 : m.focus({ preventScroll: !0 });
|
|
1366
1381
|
});
|
|
1367
1382
|
break;
|
|
1368
1383
|
case D.Tab:
|
|
1369
|
-
s.preventDefault(), s.stopPropagation(), n.closeMenu(), j(() => Xo(
|
|
1384
|
+
s.preventDefault(), s.stopPropagation(), n.closeMenu(), j(() => Xo(E(n.buttonRef), s.shiftKey ? tt.Previous : tt.Next));
|
|
1370
1385
|
break;
|
|
1371
1386
|
default:
|
|
1372
1387
|
s.key.length === 1 && (n.search(s.key), r.value = setTimeout(() => n.clearSearch(), 350));
|
|
@@ -1383,8 +1398,8 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1383
1398
|
let c = nn(), a = k(() => c !== null ? (c.value & te.Open) === te.Open : n.menuState.value === 0);
|
|
1384
1399
|
return () => {
|
|
1385
1400
|
var s, d;
|
|
1386
|
-
let m = { open: n.menuState.value === 0 }, { id: f, ...v } = e, p = { "aria-activedescendant": n.activeItemIndex.value === null || (s = n.items.value[n.activeItemIndex.value]) == null ? void 0 : s.id, "aria-labelledby": (d =
|
|
1387
|
-
return z({ ourProps: p, theirProps: v, slot: m, attrs: t, slots: l, features:
|
|
1401
|
+
let m = { open: n.menuState.value === 0 }, { id: f, ...v } = e, p = { "aria-activedescendant": n.activeItemIndex.value === null || (s = n.items.value[n.activeItemIndex.value]) == null ? void 0 : s.id, "aria-labelledby": (d = E(n.buttonRef)) == null ? void 0 : d.id, id: f, onKeydown: i, onKeyup: u, role: "menu", tabIndex: 0, ref: n.itemsRef };
|
|
1402
|
+
return z({ ourProps: p, theirProps: v, slot: m, attrs: t, slots: l, features: Re.RenderStrategy | Re.Static, visible: a.value, name: "MenuItems" });
|
|
1388
1403
|
};
|
|
1389
1404
|
} }), bl = $({ name: "MenuItem", inheritAttrs: !1, props: { as: { type: [Object, String], default: "template" }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-menu-item-${J()}` } }, setup(e, { slots: t, attrs: l, expose: o }) {
|
|
1390
1405
|
let n = Ue("MenuItem"), r = O(null);
|
|
@@ -1394,14 +1409,14 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1394
1409
|
}, domRef: r }));
|
|
1395
1410
|
ee(() => n.registerItem(e.id, c)), Ne(() => n.unregisterItem(e.id)), xe(() => {
|
|
1396
1411
|
n.menuState.value === 0 && i.value && n.activationTrigger.value !== 0 && j(() => {
|
|
1397
|
-
var p,
|
|
1398
|
-
return (
|
|
1412
|
+
var p, h;
|
|
1413
|
+
return (h = (p = E(r)) == null ? void 0 : p.scrollIntoView) == null ? void 0 : h.call(p, { block: "nearest" });
|
|
1399
1414
|
});
|
|
1400
1415
|
});
|
|
1401
1416
|
function a(p) {
|
|
1402
1417
|
if (e.disabled)
|
|
1403
1418
|
return p.preventDefault();
|
|
1404
|
-
n.closeMenu(), rn(
|
|
1419
|
+
n.closeMenu(), rn(E(n.buttonRef));
|
|
1405
1420
|
}
|
|
1406
1421
|
function s() {
|
|
1407
1422
|
if (e.disabled)
|
|
@@ -1419,8 +1434,8 @@ let ml = $({ name: "Menu", props: { as: { type: [Object, String], default: "temp
|
|
|
1419
1434
|
d.wasMoved(p) && (e.disabled || i.value && n.goToItem(L.Nothing));
|
|
1420
1435
|
}
|
|
1421
1436
|
return () => {
|
|
1422
|
-
let { disabled: p } = e,
|
|
1423
|
-
return z({ ourProps: { id:
|
|
1437
|
+
let { disabled: p } = e, h = { active: i.value, disabled: p, close: n.closeMenu }, { id: b, ...y } = e;
|
|
1438
|
+
return z({ ourProps: { id: b, ref: r, role: "menuitem", tabIndex: p === !0 ? void 0 : -1, "aria-disabled": p === !0 ? !0 : void 0, disabled: void 0, onClick: a, onFocus: s, onPointerenter: m, onMouseenter: m, onPointermove: f, onMousemove: f, onPointerleave: v, onMouseleave: v }, theirProps: { ...l, ...y }, slot: h, attrs: l, slots: t, name: "MenuItem" });
|
|
1424
1439
|
};
|
|
1425
1440
|
} }), hn = Symbol("LabelContext");
|
|
1426
1441
|
function yn() {
|
|
@@ -1459,40 +1474,40 @@ $({ name: "SwitchGroup", props: { as: { type: [Object, String], default: "templa
|
|
|
1459
1474
|
return ye(xn, { switchRef: o, labelledby: n, describedby: r }), () => z({ theirProps: e, ourProps: {}, slot: {}, slots: t, attrs: l, name: "SwitchGroup" });
|
|
1460
1475
|
} });
|
|
1461
1476
|
let yl = $({ name: "Switch", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "button" }, modelValue: { type: Boolean, default: void 0 }, defaultChecked: { type: Boolean, optional: !0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, value: { type: String, optional: !0 }, id: { type: String, default: () => `headlessui-switch-${J()}` } }, inheritAttrs: !1, setup(e, { emit: t, attrs: l, slots: o, expose: n }) {
|
|
1462
|
-
let r = he(xn, null), [i, u] = fn(k(() => e.modelValue), (
|
|
1477
|
+
let r = he(xn, null), [i, u] = fn(k(() => e.modelValue), (h) => t("update:modelValue", h), k(() => e.defaultChecked));
|
|
1463
1478
|
function c() {
|
|
1464
1479
|
u(!i.value);
|
|
1465
1480
|
}
|
|
1466
1481
|
let a = O(null), s = r === null ? a : r.switchRef, d = at(k(() => ({ as: e.as, type: l.type })), s);
|
|
1467
1482
|
n({ el: s, $el: s });
|
|
1468
|
-
function m(
|
|
1469
|
-
|
|
1483
|
+
function m(h) {
|
|
1484
|
+
h.preventDefault(), c();
|
|
1470
1485
|
}
|
|
1471
|
-
function f(
|
|
1472
|
-
|
|
1486
|
+
function f(h) {
|
|
1487
|
+
h.key === D.Space ? (h.preventDefault(), c()) : h.key === D.Enter && Qo(h.currentTarget);
|
|
1473
1488
|
}
|
|
1474
|
-
function v(
|
|
1475
|
-
|
|
1489
|
+
function v(h) {
|
|
1490
|
+
h.preventDefault();
|
|
1476
1491
|
}
|
|
1477
1492
|
let p = k(() => {
|
|
1478
|
-
var
|
|
1479
|
-
return (
|
|
1493
|
+
var h, b;
|
|
1494
|
+
return (b = (h = E(s)) == null ? void 0 : h.closest) == null ? void 0 : b.call(h, "form");
|
|
1480
1495
|
});
|
|
1481
1496
|
return ee(() => {
|
|
1482
1497
|
Z([p], () => {
|
|
1483
1498
|
if (!p.value || e.defaultChecked === void 0)
|
|
1484
1499
|
return;
|
|
1485
|
-
function
|
|
1500
|
+
function h() {
|
|
1486
1501
|
u(e.defaultChecked);
|
|
1487
1502
|
}
|
|
1488
|
-
return p.value.addEventListener("reset",
|
|
1489
|
-
var
|
|
1490
|
-
(
|
|
1503
|
+
return p.value.addEventListener("reset", h), () => {
|
|
1504
|
+
var b;
|
|
1505
|
+
(b = p.value) == null || b.removeEventListener("reset", h);
|
|
1491
1506
|
};
|
|
1492
1507
|
}, { immediate: !0 });
|
|
1493
1508
|
}), () => {
|
|
1494
|
-
let { id:
|
|
1495
|
-
return Ce(be, [
|
|
1509
|
+
let { id: h, name: b, value: y, form: x, ...w } = e, S = { checked: i.value }, _ = { id: h, ref: s, role: "switch", type: d.value, tabIndex: 0, "aria-checked": i.value, "aria-labelledby": r == null ? void 0 : r.labelledby.value, "aria-describedby": r == null ? void 0 : r.describedby.value, onClick: m, onKeyup: f, onKeypress: v };
|
|
1510
|
+
return Ce(be, [b != null && i.value != null ? Ce(sn, Jt({ features: dt.Hidden, as: "input", type: "checkbox", hidden: !0, readOnly: !0, checked: i.value, form: x, name: b, value: y })) : null, z({ ourProps: _, theirProps: { ...l, ...it(w, ["modelValue", "defaultChecked"]) }, slot: S, attrs: l, slots: o, name: "Switch" })]);
|
|
1496
1511
|
};
|
|
1497
1512
|
} });
|
|
1498
1513
|
const Ae = Math.min, ue = Math.max, Me = Math.round, Ie = Math.floor, ae = (e) => ({
|
|
@@ -1565,7 +1580,7 @@ function Cl(e, t, l, o) {
|
|
|
1565
1580
|
function Ve(e) {
|
|
1566
1581
|
return e.replace(/left|right|bottom|top/g, (t) => xl[t]);
|
|
1567
1582
|
}
|
|
1568
|
-
function
|
|
1583
|
+
function Rl(e) {
|
|
1569
1584
|
return {
|
|
1570
1585
|
top: 0,
|
|
1571
1586
|
right: 0,
|
|
@@ -1574,8 +1589,8 @@ function El(e) {
|
|
|
1574
1589
|
...e
|
|
1575
1590
|
};
|
|
1576
1591
|
}
|
|
1577
|
-
function
|
|
1578
|
-
return typeof e != "number" ?
|
|
1592
|
+
function El(e) {
|
|
1593
|
+
return typeof e != "number" ? Rl(e) : {
|
|
1579
1594
|
top: e,
|
|
1580
1595
|
right: e,
|
|
1581
1596
|
bottom: e,
|
|
@@ -1656,14 +1671,14 @@ const Dl = async (e, t, l) => {
|
|
|
1656
1671
|
} = It(a, o, c), m = o, f = {}, v = 0;
|
|
1657
1672
|
for (let p = 0; p < u.length; p++) {
|
|
1658
1673
|
const {
|
|
1659
|
-
name:
|
|
1660
|
-
fn:
|
|
1674
|
+
name: h,
|
|
1675
|
+
fn: b
|
|
1661
1676
|
} = u[p], {
|
|
1662
1677
|
x: y,
|
|
1663
1678
|
y: x,
|
|
1664
1679
|
data: w,
|
|
1665
1680
|
reset: S
|
|
1666
|
-
} = await
|
|
1681
|
+
} = await b({
|
|
1667
1682
|
x: s,
|
|
1668
1683
|
y: d,
|
|
1669
1684
|
initialPlacement: o,
|
|
@@ -1679,8 +1694,8 @@ const Dl = async (e, t, l) => {
|
|
|
1679
1694
|
});
|
|
1680
1695
|
if (s = y ?? s, d = x ?? d, f = {
|
|
1681
1696
|
...f,
|
|
1682
|
-
[
|
|
1683
|
-
...f[
|
|
1697
|
+
[h]: {
|
|
1698
|
+
...f[h],
|
|
1684
1699
|
...w
|
|
1685
1700
|
}
|
|
1686
1701
|
}, S && v <= 50) {
|
|
@@ -1719,8 +1734,8 @@ async function On(e, t) {
|
|
|
1719
1734
|
elementContext: d = "floating",
|
|
1720
1735
|
altBoundary: m = !1,
|
|
1721
1736
|
padding: f = 0
|
|
1722
|
-
} = He(t, e), v =
|
|
1723
|
-
element: (l = await (r.isElement == null ? void 0 : r.isElement(
|
|
1737
|
+
} = He(t, e), v = El(f), h = u[m ? d === "floating" ? "reference" : "floating" : d], b = Fe(await r.getClippingRect({
|
|
1738
|
+
element: (l = await (r.isElement == null ? void 0 : r.isElement(h))) == null || l ? h : h.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(u.floating)),
|
|
1724
1739
|
boundary: a,
|
|
1725
1740
|
rootBoundary: s,
|
|
1726
1741
|
strategy: c
|
|
@@ -1740,10 +1755,10 @@ async function On(e, t) {
|
|
|
1740
1755
|
strategy: c
|
|
1741
1756
|
}) : y);
|
|
1742
1757
|
return {
|
|
1743
|
-
top: (
|
|
1744
|
-
bottom: (S.bottom -
|
|
1745
|
-
left: (
|
|
1746
|
-
right: (S.right -
|
|
1758
|
+
top: (b.top - S.top + v.top) / w.y,
|
|
1759
|
+
bottom: (S.bottom - b.bottom + v.bottom) / w.y,
|
|
1760
|
+
left: (b.left - S.left + v.left) / w.x,
|
|
1761
|
+
right: (S.right - b.right + v.right) / w.x
|
|
1747
1762
|
};
|
|
1748
1763
|
}
|
|
1749
1764
|
const Pl = function(e) {
|
|
@@ -1766,15 +1781,15 @@ const Pl = function(e) {
|
|
|
1766
1781
|
fallbackStrategy: f = "bestFit",
|
|
1767
1782
|
fallbackAxisSideDirection: v = "none",
|
|
1768
1783
|
flipAlignment: p = !0,
|
|
1769
|
-
...
|
|
1784
|
+
...h
|
|
1770
1785
|
} = He(e, t);
|
|
1771
1786
|
if ((l = r.arrow) != null && l.alignmentOffset)
|
|
1772
1787
|
return {};
|
|
1773
|
-
const
|
|
1788
|
+
const b = ce(n), y = ce(u) === u, x = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), w = m || (y || !p ? [Ve(u)] : Sl(u));
|
|
1774
1789
|
!m && v !== "none" && w.push(...Cl(u, p, v, x));
|
|
1775
|
-
const S = [u, ...w], _ = await On(t,
|
|
1790
|
+
const S = [u, ...w], _ = await On(t, h), C = [];
|
|
1776
1791
|
let N = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
|
1777
|
-
if (s && C.push(_[
|
|
1792
|
+
if (s && C.push(_[b]), d) {
|
|
1778
1793
|
const se = kl(n, i, x);
|
|
1779
1794
|
C.push(_[se[0]], _[se[1]]);
|
|
1780
1795
|
}
|
|
@@ -1881,13 +1896,13 @@ const Tl = function(e) {
|
|
|
1881
1896
|
mainAxis: r = !0,
|
|
1882
1897
|
crossAxis: i = !1,
|
|
1883
1898
|
limiter: u = {
|
|
1884
|
-
fn: (
|
|
1899
|
+
fn: (h) => {
|
|
1885
1900
|
let {
|
|
1886
|
-
x:
|
|
1901
|
+
x: b,
|
|
1887
1902
|
y
|
|
1888
|
-
} =
|
|
1903
|
+
} = h;
|
|
1889
1904
|
return {
|
|
1890
|
-
x:
|
|
1905
|
+
x: b,
|
|
1891
1906
|
y
|
|
1892
1907
|
};
|
|
1893
1908
|
}
|
|
@@ -1899,11 +1914,11 @@ const Tl = function(e) {
|
|
|
1899
1914
|
}, s = await On(t, c), d = Ke(ce(n)), m = wn(d);
|
|
1900
1915
|
let f = a[m], v = a[d];
|
|
1901
1916
|
if (r) {
|
|
1902
|
-
const
|
|
1917
|
+
const h = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", y = f + s[h], x = f - s[b];
|
|
1903
1918
|
f = Lt(y, f, x);
|
|
1904
1919
|
}
|
|
1905
1920
|
if (i) {
|
|
1906
|
-
const
|
|
1921
|
+
const h = d === "y" ? "top" : "left", b = d === "y" ? "bottom" : "right", y = v + s[h], x = v - s[b];
|
|
1907
1922
|
v = Lt(y, v, x);
|
|
1908
1923
|
}
|
|
1909
1924
|
const p = u.fn({
|
|
@@ -2003,13 +2018,13 @@ function Cn(e) {
|
|
|
2003
2018
|
const t = ge(e);
|
|
2004
2019
|
return Ge(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Q(t) && Pe(t) ? t : Cn(t);
|
|
2005
2020
|
}
|
|
2006
|
-
function
|
|
2021
|
+
function Ee(e, t, l) {
|
|
2007
2022
|
var o;
|
|
2008
2023
|
t === void 0 && (t = []), l === void 0 && (l = !0);
|
|
2009
2024
|
const n = Cn(e), r = n === ((o = e.ownerDocument) == null ? void 0 : o.body), i = H(n);
|
|
2010
|
-
return r ? t.concat(i, i.visualViewport || [], Pe(n) ? n : [], i.frameElement && l ?
|
|
2025
|
+
return r ? t.concat(i, i.visualViewport || [], Pe(n) ? n : [], i.frameElement && l ? Ee(i.frameElement) : []) : t.concat(n, Ee(n, [], l));
|
|
2011
2026
|
}
|
|
2012
|
-
function
|
|
2027
|
+
function Rn(e) {
|
|
2013
2028
|
const t = q(e);
|
|
2014
2029
|
let l = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
2015
2030
|
const n = Q(e), r = n ? e.offsetWidth : l, i = n ? e.offsetHeight : o, u = Me(l) !== r || Me(o) !== i;
|
|
@@ -2030,7 +2045,7 @@ function ve(e) {
|
|
|
2030
2045
|
width: o,
|
|
2031
2046
|
height: n,
|
|
2032
2047
|
$: r
|
|
2033
|
-
} =
|
|
2048
|
+
} = Rn(t);
|
|
2034
2049
|
let i = (r ? Me(l.width) : l.width) / o, u = (r ? Me(l.height) : l.height) / n;
|
|
2035
2050
|
return (!i || !Number.isFinite(i)) && (i = 1), (!u || !Number.isFinite(u)) && (u = 1), {
|
|
2036
2051
|
x: i,
|
|
@@ -2038,7 +2053,7 @@ function ve(e) {
|
|
|
2038
2053
|
};
|
|
2039
2054
|
}
|
|
2040
2055
|
const Al = /* @__PURE__ */ ae(0);
|
|
2041
|
-
function
|
|
2056
|
+
function En(e) {
|
|
2042
2057
|
const t = H(e);
|
|
2043
2058
|
return !mt() || !t.visualViewport ? Al : {
|
|
2044
2059
|
x: t.visualViewport.offsetLeft,
|
|
@@ -2053,13 +2068,13 @@ function de(e, t, l, o) {
|
|
|
2053
2068
|
const n = e.getBoundingClientRect(), r = vt(e);
|
|
2054
2069
|
let i = ae(1);
|
|
2055
2070
|
t && (o ? oe(o) && (i = ve(o)) : i = ve(e));
|
|
2056
|
-
const u = Ml(r, l, o) ?
|
|
2071
|
+
const u = Ml(r, l, o) ? En(r) : ae(0);
|
|
2057
2072
|
let c = (n.left + u.x) / i.x, a = (n.top + u.y) / i.y, s = n.width / i.x, d = n.height / i.y;
|
|
2058
2073
|
if (r) {
|
|
2059
2074
|
const m = H(r), f = o && oe(o) ? H(o) : o;
|
|
2060
2075
|
let v = m.frameElement;
|
|
2061
2076
|
for (; v && o && f !== m; ) {
|
|
2062
|
-
const p = ve(v),
|
|
2077
|
+
const p = ve(v), h = v.getBoundingClientRect(), b = q(v), y = h.left + (v.clientLeft + parseFloat(b.paddingLeft)) * p.x, x = h.top + (v.clientTop + parseFloat(b.paddingTop)) * p.y;
|
|
2063
2078
|
c *= p.x, a *= p.y, s *= p.x, d *= p.y, c += y, a += x, v = H(v).frameElement;
|
|
2064
2079
|
}
|
|
2065
2080
|
}
|
|
@@ -2145,7 +2160,7 @@ function At(e, t, l) {
|
|
|
2145
2160
|
else if (oe(t))
|
|
2146
2161
|
o = jl(t, l);
|
|
2147
2162
|
else {
|
|
2148
|
-
const n =
|
|
2163
|
+
const n = En(e);
|
|
2149
2164
|
o = {
|
|
2150
2165
|
...t,
|
|
2151
2166
|
x: t.x - n.x,
|
|
@@ -2162,7 +2177,7 @@ function zl(e, t) {
|
|
|
2162
2177
|
const l = t.get(e);
|
|
2163
2178
|
if (l)
|
|
2164
2179
|
return l;
|
|
2165
|
-
let o =
|
|
2180
|
+
let o = Ee(e, [], !1).filter((u) => oe(u) && ne(u) !== "body"), n = null;
|
|
2166
2181
|
const r = q(e).position === "fixed";
|
|
2167
2182
|
let i = r ? ge(e) : e;
|
|
2168
2183
|
for (; oe(i) && !Ge(i); ) {
|
|
@@ -2193,7 +2208,7 @@ function Hl(e) {
|
|
|
2193
2208
|
const {
|
|
2194
2209
|
width: t,
|
|
2195
2210
|
height: l
|
|
2196
|
-
} =
|
|
2211
|
+
} = Rn(e);
|
|
2197
2212
|
return {
|
|
2198
2213
|
width: t,
|
|
2199
2214
|
height: l
|
|
@@ -2278,8 +2293,8 @@ function Xl(e, t) {
|
|
|
2278
2293
|
} = e.getBoundingClientRect();
|
|
2279
2294
|
if (u || t(), !d || !m)
|
|
2280
2295
|
return;
|
|
2281
|
-
const f = Ie(s), v = Ie(n.clientWidth - (a + d)), p = Ie(n.clientHeight - (s + m)),
|
|
2282
|
-
rootMargin: -f + "px " + -v + "px " + -p + "px " + -
|
|
2296
|
+
const f = Ie(s), v = Ie(n.clientWidth - (a + d)), p = Ie(n.clientHeight - (s + m)), h = Ie(a), y = {
|
|
2297
|
+
rootMargin: -f + "px " + -v + "px " + -p + "px " + -h + "px",
|
|
2283
2298
|
threshold: ue(0, Ae(1, c)) || 1
|
|
2284
2299
|
};
|
|
2285
2300
|
let x = !0;
|
|
@@ -2315,29 +2330,29 @@ function Yl(e, t, l, o) {
|
|
|
2315
2330
|
elementResize: i = typeof ResizeObserver == "function",
|
|
2316
2331
|
layoutShift: u = typeof IntersectionObserver == "function",
|
|
2317
2332
|
animationFrame: c = !1
|
|
2318
|
-
} = o, a = vt(e), s = n || r ? [...a ?
|
|
2319
|
-
s.forEach((
|
|
2320
|
-
n &&
|
|
2333
|
+
} = o, a = vt(e), s = n || r ? [...a ? Ee(a) : [], ...Ee(t)] : [];
|
|
2334
|
+
s.forEach((b) => {
|
|
2335
|
+
n && b.addEventListener("scroll", l, {
|
|
2321
2336
|
passive: !0
|
|
2322
|
-
}), r &&
|
|
2337
|
+
}), r && b.addEventListener("resize", l);
|
|
2323
2338
|
});
|
|
2324
2339
|
const d = a && u ? Xl(a, l) : null;
|
|
2325
2340
|
let m = -1, f = null;
|
|
2326
|
-
i && (f = new ResizeObserver((
|
|
2327
|
-
let [y] =
|
|
2341
|
+
i && (f = new ResizeObserver((b) => {
|
|
2342
|
+
let [y] = b;
|
|
2328
2343
|
y && y.target === a && f && (f.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
2329
2344
|
f && f.observe(t);
|
|
2330
2345
|
})), l();
|
|
2331
2346
|
}), a && !c && f.observe(a), f.observe(t));
|
|
2332
2347
|
let v, p = c ? de(e) : null;
|
|
2333
|
-
c &&
|
|
2334
|
-
function
|
|
2335
|
-
const
|
|
2336
|
-
p && (
|
|
2348
|
+
c && h();
|
|
2349
|
+
function h() {
|
|
2350
|
+
const b = de(e);
|
|
2351
|
+
p && (b.x !== p.x || b.y !== p.y || b.width !== p.width || b.height !== p.height) && l(), p = b, v = requestAnimationFrame(h);
|
|
2337
2352
|
}
|
|
2338
2353
|
return l(), () => {
|
|
2339
|
-
s.forEach((
|
|
2340
|
-
n &&
|
|
2354
|
+
s.forEach((b) => {
|
|
2355
|
+
n && b.removeEventListener("scroll", l), r && b.removeEventListener("resize", l);
|
|
2341
2356
|
}), d && d(), f && f.disconnect(), f = null, c && cancelAnimationFrame(v);
|
|
2342
2357
|
};
|
|
2343
2358
|
}
|
|
@@ -2385,7 +2400,7 @@ function tr(e, t, l) {
|
|
|
2385
2400
|
}), c = k(() => {
|
|
2386
2401
|
var C;
|
|
2387
2402
|
return (C = P(l.transform)) != null ? C : !0;
|
|
2388
|
-
}), a = k(() => Vt(e.value)), s = k(() => Vt(t.value)), d = O(0), m = O(0), f = O(u.value), v = O(i.value), p = Vn({}),
|
|
2403
|
+
}), a = k(() => Vt(e.value)), s = k(() => Vt(t.value)), d = O(0), m = O(0), f = O(u.value), v = O(i.value), p = Vn({}), h = O(!1), b = k(() => {
|
|
2389
2404
|
const C = {
|
|
2390
2405
|
position: f.value,
|
|
2391
2406
|
left: "0",
|
|
@@ -2413,7 +2428,7 @@ function tr(e, t, l) {
|
|
|
2413
2428
|
placement: i.value,
|
|
2414
2429
|
strategy: u.value
|
|
2415
2430
|
}).then((C) => {
|
|
2416
|
-
d.value = C.x, m.value = C.y, f.value = C.strategy, v.value = C.placement, p.value = C.middlewareData,
|
|
2431
|
+
d.value = C.x, m.value = C.y, f.value = C.strategy, v.value = C.placement, p.value = C.middlewareData, h.value = !0;
|
|
2417
2432
|
});
|
|
2418
2433
|
}
|
|
2419
2434
|
function w() {
|
|
@@ -2430,7 +2445,7 @@ function tr(e, t, l) {
|
|
|
2430
2445
|
}
|
|
2431
2446
|
}
|
|
2432
2447
|
function _() {
|
|
2433
|
-
n.value || (
|
|
2448
|
+
n.value || (h.value = !1);
|
|
2434
2449
|
}
|
|
2435
2450
|
return Z([r, i, u], x, {
|
|
2436
2451
|
flush: "sync"
|
|
@@ -2444,8 +2459,8 @@ function tr(e, t, l) {
|
|
|
2444
2459
|
strategy: me(f),
|
|
2445
2460
|
placement: me(v),
|
|
2446
2461
|
middlewareData: me(p),
|
|
2447
|
-
isPositioned: me(
|
|
2448
|
-
floatingStyles:
|
|
2462
|
+
isPositioned: me(h),
|
|
2463
|
+
floatingStyles: b,
|
|
2449
2464
|
update: x
|
|
2450
2465
|
};
|
|
2451
2466
|
}
|
|
@@ -2461,7 +2476,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2461
2476
|
whileElementsMounted: Yl,
|
|
2462
2477
|
middleware: [Tl(6), Ql(), Zl({ padding: 6 })]
|
|
2463
2478
|
});
|
|
2464
|
-
return (i, u) => (
|
|
2479
|
+
return (i, u) => (R(), K(P(ml), {
|
|
2465
2480
|
as: "div",
|
|
2466
2481
|
class: "inline-block text-left"
|
|
2467
2482
|
}, {
|
|
@@ -2481,12 +2496,12 @@ const _r = /* @__PURE__ */ $({
|
|
|
2481
2496
|
]),
|
|
2482
2497
|
_: 3
|
|
2483
2498
|
}, 512),
|
|
2484
|
-
(
|
|
2499
|
+
(R(), K(Bn, {
|
|
2485
2500
|
to: typeof i.usePortal == "string" ? i.usePortal : "body",
|
|
2486
2501
|
disabled: !i.usePortal
|
|
2487
2502
|
}, [
|
|
2488
2503
|
I("div", {
|
|
2489
|
-
class: "w-56",
|
|
2504
|
+
class: "w-56 z-20",
|
|
2490
2505
|
style: Nt(P(r)),
|
|
2491
2506
|
ref_key: "floating",
|
|
2492
2507
|
ref: o
|
|
@@ -2531,9 +2546,9 @@ const _r = /* @__PURE__ */ $({
|
|
|
2531
2546
|
as: {}
|
|
2532
2547
|
},
|
|
2533
2548
|
setup(e) {
|
|
2534
|
-
return (t, l) => (
|
|
2549
|
+
return (t, l) => (R(), K(P(bl), jn(zn({ disabled: t.disabled })), {
|
|
2535
2550
|
default: W(({ active: o }) => [
|
|
2536
|
-
(
|
|
2551
|
+
(R(), K(Un(t.as || "span"), {
|
|
2537
2552
|
class: A(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
|
|
2538
2553
|
o ? "bg-grey-200" : "",
|
|
2539
2554
|
t.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
|
|
@@ -2541,7 +2556,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2541
2556
|
}, {
|
|
2542
2557
|
default: W(() => [
|
|
2543
2558
|
I("span", null, B(t.label), 1),
|
|
2544
|
-
t.meta ? (
|
|
2559
|
+
t.meta ? (R(), T("span", nr, B(t.meta), 1)) : M("", !0)
|
|
2545
2560
|
]),
|
|
2546
2561
|
_: 2
|
|
2547
2562
|
}, 1032, ["class"]))
|
|
@@ -2583,7 +2598,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2583
2598
|
}
|
|
2584
2599
|
), Z(o, (c) => {
|
|
2585
2600
|
c && n("update:modelValue", c);
|
|
2586
|
-
}), (c, a) => (
|
|
2601
|
+
}), (c, a) => (R(), K(P(al), {
|
|
2587
2602
|
as: "div",
|
|
2588
2603
|
modelValue: P(o),
|
|
2589
2604
|
"onUpdate:modelValue": a[0] || (a[0] = (s) => Hn(o) ? o.value = s : null),
|
|
@@ -2597,12 +2612,12 @@ const _r = /* @__PURE__ */ $({
|
|
|
2597
2612
|
default: W(() => {
|
|
2598
2613
|
var s;
|
|
2599
2614
|
return [
|
|
2600
|
-
c.icon ? (
|
|
2615
|
+
c.icon ? (R(), T("span", lr, [
|
|
2601
2616
|
F(U, {
|
|
2602
2617
|
name: ((s = P(o)) == null ? void 0 : s.icon) ?? c.icon
|
|
2603
2618
|
}, null, 8, ["name"])
|
|
2604
2619
|
])) : M("", !0),
|
|
2605
|
-
P(o) ? (
|
|
2620
|
+
P(o) ? (R(), T("span", rr, B(P(o).label), 1)) : (R(), T("span", ir, B(c.placeholder), 1)),
|
|
2606
2621
|
I("span", ar, [
|
|
2607
2622
|
F(U, {
|
|
2608
2623
|
class: "text-grey-400",
|
|
@@ -2622,7 +2637,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2622
2637
|
default: W(() => [
|
|
2623
2638
|
F(P(ul), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
|
|
2624
2639
|
default: W(() => [
|
|
2625
|
-
(
|
|
2640
|
+
(R(!0), T(be, null, jt(c.options, (s) => (R(), K(P(cl), {
|
|
2626
2641
|
as: "template",
|
|
2627
2642
|
key: s.id,
|
|
2628
2643
|
value: s,
|
|
@@ -2637,7 +2652,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2637
2652
|
])
|
|
2638
2653
|
}, [
|
|
2639
2654
|
I("div", sr, [
|
|
2640
|
-
s.disabled && c.disabledBadge ? (
|
|
2655
|
+
s.disabled && c.disabledBadge ? (R(), T("span", ur, B(c.disabledBadge), 1)) : M("", !0)
|
|
2641
2656
|
]),
|
|
2642
2657
|
I("span", {
|
|
2643
2658
|
class: A([
|
|
@@ -2645,14 +2660,14 @@ const _r = /* @__PURE__ */ $({
|
|
|
2645
2660
|
"block truncate"
|
|
2646
2661
|
])
|
|
2647
2662
|
}, [
|
|
2648
|
-
s.icon ? (
|
|
2663
|
+
s.icon ? (R(), K(U, {
|
|
2649
2664
|
key: 0,
|
|
2650
2665
|
class: "inline-block mr-1",
|
|
2651
2666
|
name: s.icon
|
|
2652
2667
|
}, null, 8, ["name"])) : M("", !0),
|
|
2653
2668
|
Wn(" " + B(s.label), 1)
|
|
2654
2669
|
], 2),
|
|
2655
|
-
m ? (
|
|
2670
|
+
m ? (R(), T("span", {
|
|
2656
2671
|
key: 0,
|
|
2657
2672
|
class: A([
|
|
2658
2673
|
d ? "text-blue-100" : "text-blue-500",
|
|
@@ -2707,24 +2722,24 @@ const _r = /* @__PURE__ */ $({
|
|
|
2707
2722
|
margin: `mr-${o[Math.floor(Math.random() * o.length)]}`
|
|
2708
2723
|
};
|
|
2709
2724
|
});
|
|
2710
|
-
return (o, n) => (
|
|
2725
|
+
return (o, n) => (R(), T("div", cr, [
|
|
2711
2726
|
I("div", dr, [
|
|
2712
|
-
o.avatar ? (
|
|
2713
|
-
o.title ? (
|
|
2727
|
+
o.avatar ? (R(), T("div", fr)) : M("", !0),
|
|
2728
|
+
o.title ? (R(), T("div", pr)) : M("", !0)
|
|
2714
2729
|
]),
|
|
2715
|
-
o.lines > 0 ? (
|
|
2716
|
-
(
|
|
2730
|
+
o.lines > 0 ? (R(), T("div", mr, [
|
|
2731
|
+
(R(!0), T(be, null, jt(P(l), (r, i) => (R(), T("div", {
|
|
2717
2732
|
class: A(["h-4 bg-current rounded-lg", r.margin]),
|
|
2718
2733
|
key: i
|
|
2719
2734
|
}, null, 2))), 128))
|
|
2720
2735
|
])) : M("", !0),
|
|
2721
|
-
o.footer ? (
|
|
2736
|
+
o.footer ? (R(), T("div", vr)) : M("", !0)
|
|
2722
2737
|
]));
|
|
2723
2738
|
}
|
|
2724
2739
|
}), $r = /* @__PURE__ */ $({
|
|
2725
2740
|
__name: "Spinner",
|
|
2726
2741
|
setup(e) {
|
|
2727
|
-
return (t, l) => (
|
|
2742
|
+
return (t, l) => (R(), K(P(U), {
|
|
2728
2743
|
class: "animate-spin",
|
|
2729
2744
|
name: "circle-notch"
|
|
2730
2745
|
}));
|
|
@@ -2790,7 +2805,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2790
2805
|
function c() {
|
|
2791
2806
|
o.isDisabled || l("onClickSplit");
|
|
2792
2807
|
}
|
|
2793
|
-
return (a, s) => (
|
|
2808
|
+
return (a, s) => (R(), T("div", gr, [
|
|
2794
2809
|
I("button", {
|
|
2795
2810
|
type: "button",
|
|
2796
2811
|
"aria-label": a.label,
|
|
@@ -2803,7 +2818,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2803
2818
|
}, [
|
|
2804
2819
|
I("span", null, B(a.label), 1)
|
|
2805
2820
|
], 2),
|
|
2806
|
-
a.isLoading ? (
|
|
2821
|
+
a.isLoading ? (R(), T("span", hr, [
|
|
2807
2822
|
F(U, {
|
|
2808
2823
|
class: "ml-3 animate-spin",
|
|
2809
2824
|
name: "circle-notch"
|
|
@@ -2837,7 +2852,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2837
2852
|
const l = t, o = (n) => {
|
|
2838
2853
|
l("update:modelValue", n), l("change", n);
|
|
2839
2854
|
};
|
|
2840
|
-
return (n, r) => (
|
|
2855
|
+
return (n, r) => (R(), K(P(yl), {
|
|
2841
2856
|
modelValue: n.modelValue,
|
|
2842
2857
|
label: n.label,
|
|
2843
2858
|
class: A([n.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
|
|
@@ -2875,7 +2890,7 @@ const _r = /* @__PURE__ */ $({
|
|
|
2875
2890
|
focus: () => {
|
|
2876
2891
|
o.isDisabled || a.value.focus();
|
|
2877
2892
|
}
|
|
2878
|
-
}), (d, m) => (
|
|
2893
|
+
}), (d, m) => (R(), T("div", xr, [
|
|
2879
2894
|
I("textarea", ot({
|
|
2880
2895
|
class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [P(r), P(u), P(i)]],
|
|
2881
2896
|
tabindex: d.isDisabled ? "-1" : void 0,
|
|
@@ -2892,8 +2907,8 @@ const _r = /* @__PURE__ */ $({
|
|
|
2892
2907
|
}
|
|
2893
2908
|
});
|
|
2894
2909
|
export {
|
|
2895
|
-
|
|
2896
|
-
|
|
2910
|
+
Rr as D9Button,
|
|
2911
|
+
Er as D9Checkbox,
|
|
2897
2912
|
U as D9Icon,
|
|
2898
2913
|
Dr as D9Input,
|
|
2899
2914
|
Pr as D9Label,
|