@deck9/ui 0.13.1 → 0.13.3
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 +2508 -0
- package/dist/src/ui.umd.js +5 -0
- package/package.json +17 -16
- package/dist/src/index.es.js +0 -3894
- package/dist/src/index.umd.js +0 -9
package/dist/src/ui.mjs
ADDED
|
@@ -0,0 +1,2508 @@
|
|
|
1
|
+
import { defineComponent as _, computed as k, openBlock as E, createBlock as H, unref as I, mergeProps as ze, createCommentVNode as A, createElementBlock as R, normalizeClass as M, createElementVNode as T, toDisplayString as N, createVNode as V, ref as O, getCurrentInstance as ln, onMounted as Z, watch as ne, Fragment as se, withDirectives as sn, vModelText as un, normalizeStyle as cn, cloneVNode as dn, h as ve, inject as ue, provide as ce, watchEffect as oe, nextTick as B, onUnmounted as Ee, toRaw as G, withCtx as U, renderSlot as nt, Teleport as fn, Transition as wt, normalizeProps as pn, guardReactiveProps as vn, resolveDynamicComponent as mn, isRef as bn, renderList as xt, createTextVNode as gn } from "vue";
|
|
2
|
+
import { FontAwesomeIcon as hn } from "@fortawesome/vue-fontawesome";
|
|
3
|
+
import { library as Ue } from "@fortawesome/fontawesome-svg-core";
|
|
4
|
+
import * as b from "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
import * as fe from "@fortawesome/free-brands-svg-icons";
|
|
6
|
+
var kt = "fas", St = "numeric-input", Ot = 512, Et = 512, $e = [], Dt = "", Pt = "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
|
+
const rt = {
|
|
8
|
+
prefix: kt,
|
|
9
|
+
iconName: St,
|
|
10
|
+
icon: [Ot, Et, $e, Dt, Pt]
|
|
11
|
+
}, yn = {
|
|
12
|
+
definition: rt,
|
|
13
|
+
faAlignJustify: rt,
|
|
14
|
+
prefix: kt,
|
|
15
|
+
iconName: St,
|
|
16
|
+
width: Ot,
|
|
17
|
+
height: Et,
|
|
18
|
+
ligatures: $e,
|
|
19
|
+
unicode: Dt,
|
|
20
|
+
svgPathData: Pt,
|
|
21
|
+
aliases: $e
|
|
22
|
+
};
|
|
23
|
+
Ue.add(
|
|
24
|
+
b.faArrowUp19,
|
|
25
|
+
b.faAt,
|
|
26
|
+
b.faBold,
|
|
27
|
+
b.faBolt,
|
|
28
|
+
b.faCalendar,
|
|
29
|
+
b.faChartPie,
|
|
30
|
+
b.faCheck,
|
|
31
|
+
b.faCheckCircle,
|
|
32
|
+
b.faChevronDown,
|
|
33
|
+
b.faChevronLeft,
|
|
34
|
+
b.faChevronRight,
|
|
35
|
+
b.faChevronUp,
|
|
36
|
+
b.faCircleCheck,
|
|
37
|
+
b.faCircleNotch,
|
|
38
|
+
b.faClipboard,
|
|
39
|
+
b.faCloudDownload,
|
|
40
|
+
b.faCloudUpload,
|
|
41
|
+
b.faCog,
|
|
42
|
+
b.faCrown,
|
|
43
|
+
b.faDoorOpen,
|
|
44
|
+
b.faDotCircle,
|
|
45
|
+
b.faEllipsis,
|
|
46
|
+
b.faEllipsisVertical,
|
|
47
|
+
b.faEnvelope,
|
|
48
|
+
b.faExclamationTriangle,
|
|
49
|
+
b.faExternalLink,
|
|
50
|
+
b.faEyeDropper,
|
|
51
|
+
b.faFileLines,
|
|
52
|
+
b.faFileUpload,
|
|
53
|
+
b.faFilter,
|
|
54
|
+
b.faFingerprint,
|
|
55
|
+
b.faGlobe,
|
|
56
|
+
b.faGripHorizontal,
|
|
57
|
+
b.faGripVertical,
|
|
58
|
+
b.faHandPointRight,
|
|
59
|
+
b.faHashtag,
|
|
60
|
+
b.faHeart,
|
|
61
|
+
b.faInfoCircle,
|
|
62
|
+
b.faItalic,
|
|
63
|
+
b.faLink,
|
|
64
|
+
b.faLock,
|
|
65
|
+
b.faLockOpen,
|
|
66
|
+
b.faMedal,
|
|
67
|
+
b.faMessage,
|
|
68
|
+
b.faPencilAlt,
|
|
69
|
+
b.faPenToSquare,
|
|
70
|
+
b.faPhone,
|
|
71
|
+
b.faPlayCircle,
|
|
72
|
+
b.faPlus,
|
|
73
|
+
b.faPlusCircle,
|
|
74
|
+
b.faPoo,
|
|
75
|
+
b.faPuzzlePiece,
|
|
76
|
+
b.faReply,
|
|
77
|
+
b.faReplyAll,
|
|
78
|
+
b.faRobot,
|
|
79
|
+
b.faSave,
|
|
80
|
+
b.faShield,
|
|
81
|
+
b.faSignal,
|
|
82
|
+
b.faSignature,
|
|
83
|
+
b.faSquareCheck,
|
|
84
|
+
b.faStar,
|
|
85
|
+
b.faTimes,
|
|
86
|
+
b.faTrash,
|
|
87
|
+
b.faTree,
|
|
88
|
+
b.faTrophy,
|
|
89
|
+
b.faTurnDown,
|
|
90
|
+
b.faUpload,
|
|
91
|
+
b.faUser,
|
|
92
|
+
b.faUserShield,
|
|
93
|
+
// Brands
|
|
94
|
+
fe.faTwitter,
|
|
95
|
+
fe.faInstagram,
|
|
96
|
+
fe.faGithub,
|
|
97
|
+
fe.faLinkedin,
|
|
98
|
+
fe.faFacebook,
|
|
99
|
+
// Custom
|
|
100
|
+
yn.definition
|
|
101
|
+
);
|
|
102
|
+
const wn = [...Object.keys(Ue.definitions.fas)].sort(), ot = [...Object.keys(Ue.definitions.fab)].sort(), z = /* @__PURE__ */ _({
|
|
103
|
+
__name: "Icon",
|
|
104
|
+
props: {
|
|
105
|
+
name: { default: "user" }
|
|
106
|
+
},
|
|
107
|
+
setup(e) {
|
|
108
|
+
const t = e, o = k(() => ot.includes(t.name) ? "fab" : "fas"), r = k(() => wn.includes(t.name) || ot.includes(t.name) ? !0 : (console.warn(
|
|
109
|
+
"could not load icon, because it is not available",
|
|
110
|
+
t.name
|
|
111
|
+
), !1));
|
|
112
|
+
return (n, a) => r.value ? (E(), H(I(hn), ze({
|
|
113
|
+
key: 0,
|
|
114
|
+
icon: [o.value, n.name]
|
|
115
|
+
}, n.$attrs), null, 16, ["icon"])) : A("", !0);
|
|
116
|
+
}
|
|
117
|
+
}), xn = ["aria-label", "tabindex"], kn = {
|
|
118
|
+
key: 0,
|
|
119
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
120
|
+
}, ra = /* @__PURE__ */ _({
|
|
121
|
+
__name: "Button",
|
|
122
|
+
props: {
|
|
123
|
+
label: {},
|
|
124
|
+
size: { default: "medium" },
|
|
125
|
+
color: { default: "primary" },
|
|
126
|
+
isLoading: { type: Boolean, default: !1 },
|
|
127
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
128
|
+
icon: {},
|
|
129
|
+
iconPosition: { default: "right" }
|
|
130
|
+
},
|
|
131
|
+
emits: ["onClick"],
|
|
132
|
+
setup(e, { emit: t }) {
|
|
133
|
+
const o = t, r = e, n = k(() => {
|
|
134
|
+
const u = {
|
|
135
|
+
"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": r.color === "primary",
|
|
136
|
+
"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": r.color === "light",
|
|
137
|
+
"text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": r.color === "dark",
|
|
138
|
+
"text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": r.color === "danger"
|
|
139
|
+
}, c = {
|
|
140
|
+
"pointer-events-none opacity-75 cursor-not-allowed": r.isDisabled
|
|
141
|
+
}, s = {
|
|
142
|
+
"px-4 py-1 text-xs leading-5 mono-100 rounded-lg": r.size === "small",
|
|
143
|
+
"px-5 py-2 text-sm leading-4 font-medium rounded-lg": r.size === "medium",
|
|
144
|
+
"px-8 py-3 text-base leading-6 font-medium rounded-lg": r.size === "large"
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
...u,
|
|
148
|
+
...c,
|
|
149
|
+
...s
|
|
150
|
+
};
|
|
151
|
+
}), a = k(() => {
|
|
152
|
+
const u = {
|
|
153
|
+
"mr-2 -ml-1": ["small", "medium"].includes(r.size) && r.iconPosition === "left",
|
|
154
|
+
"mr-4 -ml-2": ["large"].includes(r.size) && r.iconPosition === "left"
|
|
155
|
+
}, c = {
|
|
156
|
+
"ml-3 -mr-1": ["small", "medium"].includes(r.size) && r.iconPosition === "right",
|
|
157
|
+
"ml-3 -mr-3": ["large"].includes(r.size) && r.iconPosition === "right"
|
|
158
|
+
}, s = {
|
|
159
|
+
"text-white": r.color === "primary",
|
|
160
|
+
"text-blue-600": r.color === "light",
|
|
161
|
+
"text-grey-50": r.color === "dark"
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
...u,
|
|
165
|
+
...c,
|
|
166
|
+
...s
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
function i() {
|
|
170
|
+
r.isDisabled || o("onClick");
|
|
171
|
+
}
|
|
172
|
+
return (u, c) => (E(), R("button", {
|
|
173
|
+
class: M(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", n.value]),
|
|
174
|
+
type: "button",
|
|
175
|
+
"aria-label": u.label,
|
|
176
|
+
tabindex: u.isDisabled ? "-1" : void 0,
|
|
177
|
+
onClick: i
|
|
178
|
+
}, [
|
|
179
|
+
T("div", {
|
|
180
|
+
class: M(!u.isLoading || "invisible")
|
|
181
|
+
}, [
|
|
182
|
+
u.icon && u.iconPosition === "left" ? (E(), H(z, {
|
|
183
|
+
key: 0,
|
|
184
|
+
name: u.icon,
|
|
185
|
+
class: M(a.value)
|
|
186
|
+
}, null, 8, ["name", "class"])) : A("", !0),
|
|
187
|
+
T("span", null, N(u.label), 1),
|
|
188
|
+
u.icon && u.iconPosition === "right" ? (E(), H(z, {
|
|
189
|
+
key: 1,
|
|
190
|
+
name: u.icon,
|
|
191
|
+
class: M(a.value)
|
|
192
|
+
}, null, 8, ["name", "class"])) : A("", !0)
|
|
193
|
+
], 2),
|
|
194
|
+
u.isLoading ? (E(), R("span", kn, [
|
|
195
|
+
V(z, {
|
|
196
|
+
class: "animate-spin",
|
|
197
|
+
name: "circle-notch"
|
|
198
|
+
})
|
|
199
|
+
])) : A("", !0)
|
|
200
|
+
], 10, xn));
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
let ge;
|
|
204
|
+
const Sn = new Uint8Array(16);
|
|
205
|
+
function On() {
|
|
206
|
+
if (!ge && (ge = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ge))
|
|
207
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
208
|
+
return ge(Sn);
|
|
209
|
+
}
|
|
210
|
+
const j = [];
|
|
211
|
+
for (let e = 0; e < 256; ++e)
|
|
212
|
+
j.push((e + 256).toString(16).slice(1));
|
|
213
|
+
function En(e, t = 0) {
|
|
214
|
+
return j[e[t + 0]] + j[e[t + 1]] + j[e[t + 2]] + j[e[t + 3]] + "-" + j[e[t + 4]] + j[e[t + 5]] + "-" + j[e[t + 6]] + j[e[t + 7]] + "-" + j[e[t + 8]] + j[e[t + 9]] + "-" + j[e[t + 10]] + j[e[t + 11]] + j[e[t + 12]] + j[e[t + 13]] + j[e[t + 14]] + j[e[t + 15]];
|
|
215
|
+
}
|
|
216
|
+
const Dn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), at = {
|
|
217
|
+
randomUUID: Dn
|
|
218
|
+
};
|
|
219
|
+
function Ct(e, t, o) {
|
|
220
|
+
if (at.randomUUID && !t && !e)
|
|
221
|
+
return at.randomUUID();
|
|
222
|
+
e = e || {};
|
|
223
|
+
const r = e.random || (e.rng || On)();
|
|
224
|
+
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
|
|
225
|
+
o = o || 0;
|
|
226
|
+
for (let n = 0; n < 16; ++n)
|
|
227
|
+
t[o + n] = r[n];
|
|
228
|
+
return t;
|
|
229
|
+
}
|
|
230
|
+
return En(r);
|
|
231
|
+
}
|
|
232
|
+
const Pn = { class: "relative flex items-start" }, Cn = { class: "flex items-center h-5" }, In = ["checked", "id"], Rn = { class: "ml-2 text-sm leading-5" }, Ln = ["for"], Tn = {
|
|
233
|
+
key: 0,
|
|
234
|
+
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
235
|
+
}, oa = /* @__PURE__ */ _({
|
|
236
|
+
__name: "Checkbox",
|
|
237
|
+
props: {
|
|
238
|
+
id: { default: Ct() },
|
|
239
|
+
label: {},
|
|
240
|
+
modelValue: { type: Boolean },
|
|
241
|
+
description: {}
|
|
242
|
+
},
|
|
243
|
+
emits: ["update:modelValue"],
|
|
244
|
+
setup(e, { emit: t }) {
|
|
245
|
+
const o = t, r = (n) => {
|
|
246
|
+
o("update:modelValue", n.target.checked);
|
|
247
|
+
};
|
|
248
|
+
return (n, a) => (E(), R("div", Pn, [
|
|
249
|
+
T("div", Cn, [
|
|
250
|
+
T("input", {
|
|
251
|
+
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",
|
|
252
|
+
type: "checkbox",
|
|
253
|
+
checked: n.modelValue,
|
|
254
|
+
onChange: r,
|
|
255
|
+
id: n.id
|
|
256
|
+
}, null, 40, In)
|
|
257
|
+
]),
|
|
258
|
+
T("div", Rn, [
|
|
259
|
+
T("label", {
|
|
260
|
+
for: n.id,
|
|
261
|
+
class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
|
|
262
|
+
}, N(n.label), 9, Ln),
|
|
263
|
+
n.description ? (E(), R("p", Tn, N(n.description), 1)) : A("", !0)
|
|
264
|
+
])
|
|
265
|
+
]));
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
function _n() {
|
|
269
|
+
const e = O(!1);
|
|
270
|
+
return ln() && Z(() => {
|
|
271
|
+
e.value = !0;
|
|
272
|
+
}), e;
|
|
273
|
+
}
|
|
274
|
+
function $n(e) {
|
|
275
|
+
const t = _n();
|
|
276
|
+
return k(() => (t.value, !!e()));
|
|
277
|
+
}
|
|
278
|
+
function Mn(e = {}) {
|
|
279
|
+
const { initialValue: t = "" } = e, o = $n(() => typeof window < "u" && "EyeDropper" in window), r = O(t);
|
|
280
|
+
async function n(a) {
|
|
281
|
+
if (!o.value)
|
|
282
|
+
return;
|
|
283
|
+
const u = await new window.EyeDropper().open(a);
|
|
284
|
+
return r.value = u.sRGBHex, u;
|
|
285
|
+
}
|
|
286
|
+
return { isSupported: o, sRGBHex: r, open: n };
|
|
287
|
+
}
|
|
288
|
+
const An = () => {
|
|
289
|
+
}, jn = Array.isArray, Vn = (e) => typeof e == "function", Nn = (e) => typeof e == "symbol";
|
|
290
|
+
let lt;
|
|
291
|
+
const it = () => lt || (lt = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
292
|
+
let Bn;
|
|
293
|
+
function Fn(e, t = Bn) {
|
|
294
|
+
t && t.active && t.effects.push(e);
|
|
295
|
+
}
|
|
296
|
+
const zn = (e) => {
|
|
297
|
+
const t = new Set(e);
|
|
298
|
+
return t.w = 0, t.n = 0, t;
|
|
299
|
+
}, It = (e) => (e.w & te) > 0, Rt = (e) => (e.n & te) > 0, Un = ({ deps: e }) => {
|
|
300
|
+
if (e.length)
|
|
301
|
+
for (let t = 0; t < e.length; t++)
|
|
302
|
+
e[t].w |= te;
|
|
303
|
+
}, Hn = (e) => {
|
|
304
|
+
const { deps: t } = e;
|
|
305
|
+
if (t.length) {
|
|
306
|
+
let o = 0;
|
|
307
|
+
for (let r = 0; r < t.length; r++) {
|
|
308
|
+
const n = t[r];
|
|
309
|
+
It(n) && !Rt(n) ? n.delete(e) : t[o++] = n, n.w &= ~te, n.n &= ~te;
|
|
310
|
+
}
|
|
311
|
+
t.length = o;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
let pe = 0, te = 1;
|
|
315
|
+
const Me = 30;
|
|
316
|
+
let Y;
|
|
317
|
+
class Wn {
|
|
318
|
+
constructor(t, o = null, r) {
|
|
319
|
+
this.fn = t, this.scheduler = o, this.active = !0, this.deps = [], this.parent = void 0, Fn(this, r);
|
|
320
|
+
}
|
|
321
|
+
run() {
|
|
322
|
+
if (!this.active)
|
|
323
|
+
return this.fn();
|
|
324
|
+
let t = Y, o = we;
|
|
325
|
+
for (; t; ) {
|
|
326
|
+
if (t === this)
|
|
327
|
+
return;
|
|
328
|
+
t = t.parent;
|
|
329
|
+
}
|
|
330
|
+
try {
|
|
331
|
+
return this.parent = Y, Y = this, we = !0, te = 1 << ++pe, pe <= Me ? Un(this) : st(this), this.fn();
|
|
332
|
+
} finally {
|
|
333
|
+
pe <= Me && Hn(this), te = 1 << --pe, Y = this.parent, we = o, this.parent = void 0, this.deferStop && this.stop();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
stop() {
|
|
337
|
+
Y === this ? this.deferStop = !0 : this.active && (st(this), this.onStop && this.onStop(), this.active = !1);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function st(e) {
|
|
341
|
+
const { deps: t } = e;
|
|
342
|
+
if (t.length) {
|
|
343
|
+
for (let o = 0; o < t.length; o++)
|
|
344
|
+
t[o].delete(e);
|
|
345
|
+
t.length = 0;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
let we = !0;
|
|
349
|
+
function Kn(e, t) {
|
|
350
|
+
let o = !1;
|
|
351
|
+
pe <= Me ? Rt(e) || (e.n |= te, o = !It(e)) : o = !e.has(Y), o && (e.add(Y), Y.deps.push(e));
|
|
352
|
+
}
|
|
353
|
+
function Gn(e, t) {
|
|
354
|
+
const o = jn(e) ? e : [...e];
|
|
355
|
+
for (const r of o)
|
|
356
|
+
r.computed && ut(r);
|
|
357
|
+
for (const r of o)
|
|
358
|
+
r.computed || ut(r);
|
|
359
|
+
}
|
|
360
|
+
function ut(e, t) {
|
|
361
|
+
(e !== Y || e.allowRecurse) && (e.scheduler ? e.scheduler() : e.run());
|
|
362
|
+
}
|
|
363
|
+
new Set(
|
|
364
|
+
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(Nn)
|
|
365
|
+
);
|
|
366
|
+
function De(e) {
|
|
367
|
+
const t = e && e.__v_raw;
|
|
368
|
+
return t ? De(t) : e;
|
|
369
|
+
}
|
|
370
|
+
function qn(e) {
|
|
371
|
+
we && Y && (e = De(e), Kn(e.dep || (e.dep = zn())));
|
|
372
|
+
}
|
|
373
|
+
function Xn(e, t) {
|
|
374
|
+
e = De(e);
|
|
375
|
+
const o = e.dep;
|
|
376
|
+
o && Gn(o);
|
|
377
|
+
}
|
|
378
|
+
class Yn {
|
|
379
|
+
constructor(t, o, r, n) {
|
|
380
|
+
this._setter = o, this.dep = void 0, this.__v_isRef = !0, this.__v_isReadonly = !1, this._dirty = !0, this.effect = new Wn(t, () => {
|
|
381
|
+
this._dirty || (this._dirty = !0, Xn(this));
|
|
382
|
+
}), this.effect.computed = this, this.effect.active = this._cacheable = !n, this.__v_isReadonly = r;
|
|
383
|
+
}
|
|
384
|
+
get value() {
|
|
385
|
+
const t = De(this);
|
|
386
|
+
return qn(t), (t._dirty || !t._cacheable) && (t._dirty = !1, t._value = t.effect.run()), t._value;
|
|
387
|
+
}
|
|
388
|
+
set value(t) {
|
|
389
|
+
this._setter(t);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
function Zn(e, t, o = !1) {
|
|
393
|
+
let r, n;
|
|
394
|
+
const a = Vn(e);
|
|
395
|
+
return a ? (r = e, n = An) : (r = e.get, n = e.set), new Yn(r, n, a || !n, o);
|
|
396
|
+
}
|
|
397
|
+
let Le, ct = "__VUE_INSTANCE_SETTERS__";
|
|
398
|
+
(Le = it()[ct]) || (Le = it()[ct] = []), Le.push((e) => e);
|
|
399
|
+
let Qn = !1;
|
|
400
|
+
const Te = (e, t) => Zn(e, t, Qn);
|
|
401
|
+
function He(e) {
|
|
402
|
+
const t = Te(() => ({
|
|
403
|
+
"pl-3 pr-10 py-2": !e.icon && e.type !== "color" && e.size === "small",
|
|
404
|
+
"pl-4 pr-10 py-3": !e.icon && e.type !== "color" && e.size === "medium",
|
|
405
|
+
"pl-6 pr-10 py-3": !e.icon && e.type !== "color" && e.size === "large",
|
|
406
|
+
"pl-10 pr-10 py-1": (e.icon || e.type === "color") && e.size === "small",
|
|
407
|
+
"pl-12 pr-10 py-3": (e.icon || e.type === "color") && (e.size === "medium" || e.size === "large"),
|
|
408
|
+
"w-full block": e.block === !0
|
|
409
|
+
})), o = Te(() => ({
|
|
410
|
+
"pointer-events-none opacity-50 cursor-not-allowed": e.isDisabled
|
|
411
|
+
})), r = Te(() => ({
|
|
412
|
+
"text-xs leading-4": e.size === "small",
|
|
413
|
+
"text-sm leading-4": e.size === "medium",
|
|
414
|
+
"text-base leading-5": e.size === "large"
|
|
415
|
+
}));
|
|
416
|
+
return {
|
|
417
|
+
inputClasses: t,
|
|
418
|
+
disabledClasses: o,
|
|
419
|
+
textSizeClasses: r
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const Jn = ["placeholder", "type", "tabindex", "value"], er = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, tr = {
|
|
423
|
+
inheritAttrs: !1
|
|
424
|
+
}, aa = /* @__PURE__ */ _({
|
|
425
|
+
...tr,
|
|
426
|
+
__name: "Input",
|
|
427
|
+
props: {
|
|
428
|
+
modelValue: {},
|
|
429
|
+
type: { default: "text" },
|
|
430
|
+
placeholder: {},
|
|
431
|
+
size: { default: "medium" },
|
|
432
|
+
icon: {},
|
|
433
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
434
|
+
block: { type: Boolean },
|
|
435
|
+
showColorPicker: { type: Boolean }
|
|
436
|
+
},
|
|
437
|
+
emits: ["update:modelValue"],
|
|
438
|
+
setup(e, { expose: t, emit: o }) {
|
|
439
|
+
const r = e, n = O(r.modelValue ?? "");
|
|
440
|
+
ne(
|
|
441
|
+
() => r.modelValue,
|
|
442
|
+
(f) => {
|
|
443
|
+
typeof f == "string" && f !== n.value && (n.value = f);
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
const a = o, { inputClasses: i, disabledClasses: u, textSizeClasses: c } = He(r), s = k(() => r.type === "color" ? "text" : r.type), {
|
|
447
|
+
isSupported: l,
|
|
448
|
+
open: m,
|
|
449
|
+
sRGBHex: v
|
|
450
|
+
} = Mn(), p = () => {
|
|
451
|
+
m();
|
|
452
|
+
};
|
|
453
|
+
ne(v, (f) => {
|
|
454
|
+
n.value = f, a("update:modelValue", f);
|
|
455
|
+
});
|
|
456
|
+
const h = function(f) {
|
|
457
|
+
n.value = (f == null ? void 0 : f.target).value, a("update:modelValue", (f == null ? void 0 : f.target).value);
|
|
458
|
+
}, d = O(null);
|
|
459
|
+
return t({
|
|
460
|
+
focus: () => {
|
|
461
|
+
r.isDisabled || d.value.focus();
|
|
462
|
+
}
|
|
463
|
+
}), (f, C) => (E(), R("div", {
|
|
464
|
+
class: M(["relative", [f.block ? "w-full block" : "inline-block"]])
|
|
465
|
+
}, [
|
|
466
|
+
T("input", ze({
|
|
467
|
+
class: ["relative 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", [I(i), I(c), I(u)]],
|
|
468
|
+
placeholder: f.placeholder,
|
|
469
|
+
type: s.value,
|
|
470
|
+
tabindex: f.isDisabled ? "-1" : void 0,
|
|
471
|
+
value: n.value
|
|
472
|
+
}, f.$attrs, {
|
|
473
|
+
ref_key: "input",
|
|
474
|
+
ref: d,
|
|
475
|
+
onInput: h
|
|
476
|
+
}), null, 16, Jn),
|
|
477
|
+
f.type === "color" ? (E(), R(se, { key: 0 }, [
|
|
478
|
+
T("label", er, [
|
|
479
|
+
sn(T("input", {
|
|
480
|
+
class: "invisible",
|
|
481
|
+
type: "color",
|
|
482
|
+
"onUpdate:modelValue": C[0] || (C[0] = (y) => n.value = y),
|
|
483
|
+
onInput: h
|
|
484
|
+
}, null, 544), [
|
|
485
|
+
[un, n.value]
|
|
486
|
+
]),
|
|
487
|
+
T("span", {
|
|
488
|
+
class: "border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",
|
|
489
|
+
style: cn(`background-color: ${n.value}`)
|
|
490
|
+
}, null, 4)
|
|
491
|
+
]),
|
|
492
|
+
I(l) && f.showColorPicker ? (E(), R("button", {
|
|
493
|
+
key: 0,
|
|
494
|
+
type: "button",
|
|
495
|
+
class: "absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",
|
|
496
|
+
onClick: p
|
|
497
|
+
}, [
|
|
498
|
+
V(z, {
|
|
499
|
+
size: "xs",
|
|
500
|
+
name: "eyedropper"
|
|
501
|
+
})
|
|
502
|
+
])) : A("", !0)
|
|
503
|
+
], 64)) : f.icon ? (E(), R("span", {
|
|
504
|
+
key: 1,
|
|
505
|
+
class: M(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", I(c)])
|
|
506
|
+
}, [
|
|
507
|
+
V(z, { name: f.icon }, null, 8, ["name"])
|
|
508
|
+
], 2)) : A("", !0)
|
|
509
|
+
], 2));
|
|
510
|
+
}
|
|
511
|
+
}), nr = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, rr = ["for"], or = {
|
|
512
|
+
key: 0,
|
|
513
|
+
class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
|
|
514
|
+
}, la = /* @__PURE__ */ _({
|
|
515
|
+
__name: "Label",
|
|
516
|
+
props: {
|
|
517
|
+
id: {},
|
|
518
|
+
label: {},
|
|
519
|
+
description: {}
|
|
520
|
+
},
|
|
521
|
+
setup(e) {
|
|
522
|
+
return (t, o) => (E(), R("span", nr, [
|
|
523
|
+
T("label", { for: t.id }, N(t.label), 9, rr),
|
|
524
|
+
t.description ? (E(), R("span", or, N(t.description), 1)) : A("", !0)
|
|
525
|
+
]));
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
function W(e, t, ...o) {
|
|
529
|
+
if (e in t) {
|
|
530
|
+
let n = t[e];
|
|
531
|
+
return typeof n == "function" ? n(...o) : n;
|
|
532
|
+
}
|
|
533
|
+
let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((n) => `"${n}"`).join(", ")}.`);
|
|
534
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r, W), r;
|
|
535
|
+
}
|
|
536
|
+
var me = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(me || {}), ar = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(ar || {});
|
|
537
|
+
function F({ visible: e = !0, features: t = 0, ourProps: o, theirProps: r, ...n }) {
|
|
538
|
+
var a;
|
|
539
|
+
let i = Tt(r, o), u = Object.assign(n, { props: i });
|
|
540
|
+
if (e || t & 2 && i.static)
|
|
541
|
+
return _e(u);
|
|
542
|
+
if (t & 1) {
|
|
543
|
+
let c = (a = i.unmount) == null || a ? 0 : 1;
|
|
544
|
+
return W(c, { 0() {
|
|
545
|
+
return null;
|
|
546
|
+
}, 1() {
|
|
547
|
+
return _e({ ...n, props: { ...i, hidden: !0, style: { display: "none" } } });
|
|
548
|
+
} });
|
|
549
|
+
}
|
|
550
|
+
return _e(u);
|
|
551
|
+
}
|
|
552
|
+
function _e({ props: e, attrs: t, slots: o, slot: r, name: n }) {
|
|
553
|
+
var a, i;
|
|
554
|
+
let { as: u, ...c } = We(e, ["unmount", "static"]), s = (a = o.default) == null ? void 0 : a.call(o, r), l = {};
|
|
555
|
+
if (r) {
|
|
556
|
+
let m = !1, v = [];
|
|
557
|
+
for (let [p, h] of Object.entries(r))
|
|
558
|
+
typeof h == "boolean" && (m = !0), h === !0 && v.push(p);
|
|
559
|
+
m && (l["data-headlessui-state"] = v.join(" "));
|
|
560
|
+
}
|
|
561
|
+
if (u === "template") {
|
|
562
|
+
if (s = Lt(s ?? []), Object.keys(c).length > 0 || Object.keys(t).length > 0) {
|
|
563
|
+
let [m, ...v] = s ?? [];
|
|
564
|
+
if (!lr(m) || v.length > 0)
|
|
565
|
+
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((d) => d.trim()).filter((d, g, f) => f.indexOf(d) === g).sort((d, g) => d.localeCompare(g)).map((d) => ` - ${d}`).join(`
|
|
566
|
+
`), "", "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((d) => ` - ${d}`).join(`
|
|
567
|
+
`)].join(`
|
|
568
|
+
`));
|
|
569
|
+
let p = Tt((i = m.props) != null ? i : {}, c), h = dn(m, p);
|
|
570
|
+
for (let d in p)
|
|
571
|
+
d.startsWith("on") && (h.props || (h.props = {}), h.props[d] = p[d]);
|
|
572
|
+
return h;
|
|
573
|
+
}
|
|
574
|
+
return Array.isArray(s) && s.length === 1 ? s[0] : s;
|
|
575
|
+
}
|
|
576
|
+
return ve(u, Object.assign({}, c, l), { default: () => s });
|
|
577
|
+
}
|
|
578
|
+
function Lt(e) {
|
|
579
|
+
return e.flatMap((t) => t.type === se ? Lt(t.children) : [t]);
|
|
580
|
+
}
|
|
581
|
+
function Tt(...e) {
|
|
582
|
+
if (e.length === 0)
|
|
583
|
+
return {};
|
|
584
|
+
if (e.length === 1)
|
|
585
|
+
return e[0];
|
|
586
|
+
let t = {}, o = {};
|
|
587
|
+
for (let r of e)
|
|
588
|
+
for (let n in r)
|
|
589
|
+
n.startsWith("on") && typeof r[n] == "function" ? (o[n] != null || (o[n] = []), o[n].push(r[n])) : t[n] = r[n];
|
|
590
|
+
if (t.disabled || t["aria-disabled"])
|
|
591
|
+
return Object.assign(t, Object.fromEntries(Object.keys(o).map((r) => [r, void 0])));
|
|
592
|
+
for (let r in o)
|
|
593
|
+
Object.assign(t, { [r](n, ...a) {
|
|
594
|
+
let i = o[r];
|
|
595
|
+
for (let u of i) {
|
|
596
|
+
if (n instanceof Event && n.defaultPrevented)
|
|
597
|
+
return;
|
|
598
|
+
u(n, ...a);
|
|
599
|
+
}
|
|
600
|
+
} });
|
|
601
|
+
return t;
|
|
602
|
+
}
|
|
603
|
+
function _t(e) {
|
|
604
|
+
let t = Object.assign({}, e);
|
|
605
|
+
for (let o in t)
|
|
606
|
+
t[o] === void 0 && delete t[o];
|
|
607
|
+
return t;
|
|
608
|
+
}
|
|
609
|
+
function We(e, t = []) {
|
|
610
|
+
let o = Object.assign({}, e);
|
|
611
|
+
for (let r of t)
|
|
612
|
+
r in o && delete o[r];
|
|
613
|
+
return o;
|
|
614
|
+
}
|
|
615
|
+
function lr(e) {
|
|
616
|
+
return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
|
|
617
|
+
}
|
|
618
|
+
let ir = 0;
|
|
619
|
+
function sr() {
|
|
620
|
+
return ++ir;
|
|
621
|
+
}
|
|
622
|
+
function Q() {
|
|
623
|
+
return sr();
|
|
624
|
+
}
|
|
625
|
+
var P = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(P || {});
|
|
626
|
+
function ur(e) {
|
|
627
|
+
throw new Error("Unexpected object: " + e);
|
|
628
|
+
}
|
|
629
|
+
var L = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(L || {});
|
|
630
|
+
function $t(e, t) {
|
|
631
|
+
let o = t.resolveItems();
|
|
632
|
+
if (o.length <= 0)
|
|
633
|
+
return null;
|
|
634
|
+
let r = t.resolveActiveIndex(), n = r ?? -1, a = (() => {
|
|
635
|
+
switch (e.focus) {
|
|
636
|
+
case 0:
|
|
637
|
+
return o.findIndex((i) => !t.resolveDisabled(i));
|
|
638
|
+
case 1: {
|
|
639
|
+
let i = o.slice().reverse().findIndex((u, c, s) => n !== -1 && s.length - c - 1 >= n ? !1 : !t.resolveDisabled(u));
|
|
640
|
+
return i === -1 ? i : o.length - 1 - i;
|
|
641
|
+
}
|
|
642
|
+
case 2:
|
|
643
|
+
return o.findIndex((i, u) => u <= n ? !1 : !t.resolveDisabled(i));
|
|
644
|
+
case 3: {
|
|
645
|
+
let i = o.slice().reverse().findIndex((u) => !t.resolveDisabled(u));
|
|
646
|
+
return i === -1 ? i : o.length - 1 - i;
|
|
647
|
+
}
|
|
648
|
+
case 4:
|
|
649
|
+
return o.findIndex((i) => t.resolveId(i) === e.id);
|
|
650
|
+
case 5:
|
|
651
|
+
return null;
|
|
652
|
+
default:
|
|
653
|
+
ur(e);
|
|
654
|
+
}
|
|
655
|
+
})();
|
|
656
|
+
return a === -1 ? r : a;
|
|
657
|
+
}
|
|
658
|
+
function D(e) {
|
|
659
|
+
var t;
|
|
660
|
+
return e == null || e.value == null ? null : (t = e.value.$el) != null ? t : e.value;
|
|
661
|
+
}
|
|
662
|
+
let Mt = Symbol("Context");
|
|
663
|
+
var J = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(J || {});
|
|
664
|
+
function At() {
|
|
665
|
+
return ue(Mt, null);
|
|
666
|
+
}
|
|
667
|
+
function jt(e) {
|
|
668
|
+
ce(Mt, e);
|
|
669
|
+
}
|
|
670
|
+
function dt(e, t) {
|
|
671
|
+
if (e)
|
|
672
|
+
return e;
|
|
673
|
+
let o = t ?? "button";
|
|
674
|
+
if (typeof o == "string" && o.toLowerCase() === "button")
|
|
675
|
+
return "button";
|
|
676
|
+
}
|
|
677
|
+
function Ke(e, t) {
|
|
678
|
+
let o = O(dt(e.value.type, e.value.as));
|
|
679
|
+
return Z(() => {
|
|
680
|
+
o.value = dt(e.value.type, e.value.as);
|
|
681
|
+
}), oe(() => {
|
|
682
|
+
var r;
|
|
683
|
+
o.value || D(t) && D(t) instanceof HTMLButtonElement && !((r = D(t)) != null && r.hasAttribute("type")) && (o.value = "button");
|
|
684
|
+
}), o;
|
|
685
|
+
}
|
|
686
|
+
var cr = Object.defineProperty, dr = (e, t, o) => t in e ? cr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, ft = (e, t, o) => (dr(e, typeof t != "symbol" ? t + "" : t, o), o);
|
|
687
|
+
class fr {
|
|
688
|
+
constructor() {
|
|
689
|
+
ft(this, "current", this.detect()), ft(this, "currentId", 0);
|
|
690
|
+
}
|
|
691
|
+
set(t) {
|
|
692
|
+
this.current !== t && (this.currentId = 0, this.current = t);
|
|
693
|
+
}
|
|
694
|
+
reset() {
|
|
695
|
+
this.set(this.detect());
|
|
696
|
+
}
|
|
697
|
+
nextId() {
|
|
698
|
+
return ++this.currentId;
|
|
699
|
+
}
|
|
700
|
+
get isServer() {
|
|
701
|
+
return this.current === "server";
|
|
702
|
+
}
|
|
703
|
+
get isClient() {
|
|
704
|
+
return this.current === "client";
|
|
705
|
+
}
|
|
706
|
+
detect() {
|
|
707
|
+
return typeof window > "u" || typeof document > "u" ? "server" : "client";
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
let Ge = new fr();
|
|
711
|
+
function qe(e) {
|
|
712
|
+
if (Ge.isServer)
|
|
713
|
+
return null;
|
|
714
|
+
if (e instanceof Node)
|
|
715
|
+
return e.ownerDocument;
|
|
716
|
+
if (e != null && e.hasOwnProperty("value")) {
|
|
717
|
+
let t = D(e);
|
|
718
|
+
if (t)
|
|
719
|
+
return t.ownerDocument;
|
|
720
|
+
}
|
|
721
|
+
return document;
|
|
722
|
+
}
|
|
723
|
+
function pr({ container: e, accept: t, walk: o, enabled: r }) {
|
|
724
|
+
oe(() => {
|
|
725
|
+
let n = e.value;
|
|
726
|
+
if (!n || r !== void 0 && !r.value)
|
|
727
|
+
return;
|
|
728
|
+
let a = qe(e);
|
|
729
|
+
if (!a)
|
|
730
|
+
return;
|
|
731
|
+
let i = Object.assign((c) => t(c), { acceptNode: t }), u = a.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, i, !1);
|
|
732
|
+
for (; u.nextNode(); )
|
|
733
|
+
o(u.currentNode);
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
let Ae = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
737
|
+
var je = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(je || {}), vr = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(vr || {}), mr = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(mr || {});
|
|
738
|
+
function Vt(e = document.body) {
|
|
739
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Ae)).sort((t, o) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (o.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
740
|
+
}
|
|
741
|
+
var Pe = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Pe || {});
|
|
742
|
+
function Ce(e, t = 0) {
|
|
743
|
+
var o;
|
|
744
|
+
return e === ((o = qe(e)) == null ? void 0 : o.body) ? !1 : W(t, { 0() {
|
|
745
|
+
return e.matches(Ae);
|
|
746
|
+
}, 1() {
|
|
747
|
+
let r = e;
|
|
748
|
+
for (; r !== null; ) {
|
|
749
|
+
if (r.matches(Ae))
|
|
750
|
+
return !0;
|
|
751
|
+
r = r.parentElement;
|
|
752
|
+
}
|
|
753
|
+
return !1;
|
|
754
|
+
} });
|
|
755
|
+
}
|
|
756
|
+
function Nt(e) {
|
|
757
|
+
let t = qe(e);
|
|
758
|
+
B(() => {
|
|
759
|
+
t && !Ce(t.activeElement, 0) && gr(e);
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
var br = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(br || {});
|
|
763
|
+
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
764
|
+
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
765
|
+
}, !0), document.addEventListener("click", (e) => {
|
|
766
|
+
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
767
|
+
}, !0));
|
|
768
|
+
function gr(e) {
|
|
769
|
+
e == null || e.focus({ preventScroll: !0 });
|
|
770
|
+
}
|
|
771
|
+
let hr = ["textarea", "input"].join(",");
|
|
772
|
+
function yr(e) {
|
|
773
|
+
var t, o;
|
|
774
|
+
return (o = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, hr)) != null ? o : !1;
|
|
775
|
+
}
|
|
776
|
+
function Xe(e, t = (o) => o) {
|
|
777
|
+
return e.slice().sort((o, r) => {
|
|
778
|
+
let n = t(o), a = t(r);
|
|
779
|
+
if (n === null || a === null)
|
|
780
|
+
return 0;
|
|
781
|
+
let i = n.compareDocumentPosition(a);
|
|
782
|
+
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
function wr(e, t) {
|
|
786
|
+
return xr(Vt(), t, { relativeTo: e });
|
|
787
|
+
}
|
|
788
|
+
function xr(e, t, { sorted: o = !0, relativeTo: r = null, skipElements: n = [] } = {}) {
|
|
789
|
+
var a;
|
|
790
|
+
let i = (a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? a : document, u = Array.isArray(e) ? o ? Xe(e) : e : Vt(e);
|
|
791
|
+
n.length > 0 && u.length > 1 && (u = u.filter((h) => !n.includes(h))), r = r ?? i.activeElement;
|
|
792
|
+
let c = (() => {
|
|
793
|
+
if (t & 5)
|
|
794
|
+
return 1;
|
|
795
|
+
if (t & 10)
|
|
796
|
+
return -1;
|
|
797
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
798
|
+
})(), s = (() => {
|
|
799
|
+
if (t & 1)
|
|
800
|
+
return 0;
|
|
801
|
+
if (t & 2)
|
|
802
|
+
return Math.max(0, u.indexOf(r)) - 1;
|
|
803
|
+
if (t & 4)
|
|
804
|
+
return Math.max(0, u.indexOf(r)) + 1;
|
|
805
|
+
if (t & 8)
|
|
806
|
+
return u.length - 1;
|
|
807
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
808
|
+
})(), l = t & 32 ? { preventScroll: !0 } : {}, m = 0, v = u.length, p;
|
|
809
|
+
do {
|
|
810
|
+
if (m >= v || m + v <= 0)
|
|
811
|
+
return 0;
|
|
812
|
+
let h = s + m;
|
|
813
|
+
if (t & 16)
|
|
814
|
+
h = (h + v) % v;
|
|
815
|
+
else {
|
|
816
|
+
if (h < 0)
|
|
817
|
+
return 3;
|
|
818
|
+
if (h >= v)
|
|
819
|
+
return 1;
|
|
820
|
+
}
|
|
821
|
+
p = u[h], p == null || p.focus(l), m += c;
|
|
822
|
+
} while (p !== i.activeElement);
|
|
823
|
+
return t & 6 && yr(p) && p.select(), 2;
|
|
824
|
+
}
|
|
825
|
+
function he(e, t, o) {
|
|
826
|
+
Ge.isServer || oe((r) => {
|
|
827
|
+
document.addEventListener(e, t, o), r(() => document.removeEventListener(e, t, o));
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
function kr(e, t, o) {
|
|
831
|
+
Ge.isServer || oe((r) => {
|
|
832
|
+
window.addEventListener(e, t, o), r(() => window.removeEventListener(e, t, o));
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
function Bt(e, t, o = k(() => !0)) {
|
|
836
|
+
function r(a, i) {
|
|
837
|
+
if (!o.value || a.defaultPrevented)
|
|
838
|
+
return;
|
|
839
|
+
let u = i(a);
|
|
840
|
+
if (u === null || !u.getRootNode().contains(u))
|
|
841
|
+
return;
|
|
842
|
+
let c = function s(l) {
|
|
843
|
+
return typeof l == "function" ? s(l()) : Array.isArray(l) || l instanceof Set ? l : [l];
|
|
844
|
+
}(e);
|
|
845
|
+
for (let s of c) {
|
|
846
|
+
if (s === null)
|
|
847
|
+
continue;
|
|
848
|
+
let l = s instanceof HTMLElement ? s : D(s);
|
|
849
|
+
if (l != null && l.contains(u) || a.composed && a.composedPath().includes(l))
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
return !Ce(u, Pe.Loose) && u.tabIndex !== -1 && a.preventDefault(), t(a, u);
|
|
853
|
+
}
|
|
854
|
+
let n = O(null);
|
|
855
|
+
he("pointerdown", (a) => {
|
|
856
|
+
var i, u;
|
|
857
|
+
o.value && (n.value = ((u = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : u[0]) || a.target);
|
|
858
|
+
}, !0), he("mousedown", (a) => {
|
|
859
|
+
var i, u;
|
|
860
|
+
o.value && (n.value = ((u = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : u[0]) || a.target);
|
|
861
|
+
}, !0), he("click", (a) => {
|
|
862
|
+
n.value && (r(a, () => n.value), n.value = null);
|
|
863
|
+
}, !0), he("touchend", (a) => r(a, () => a.target instanceof HTMLElement ? a.target : null), !0), kr("blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
864
|
+
}
|
|
865
|
+
var Ye = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Ye || {});
|
|
866
|
+
let Ft = _({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: t, attrs: o }) {
|
|
867
|
+
return () => {
|
|
868
|
+
let { features: r, ...n } = e, a = { "aria-hidden": (r & 2) === 2 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
|
|
869
|
+
return F({ ourProps: a, theirProps: n, slot: {}, attrs: o, slots: t, name: "Hidden" });
|
|
870
|
+
};
|
|
871
|
+
} });
|
|
872
|
+
function zt(e = {}, t = null, o = []) {
|
|
873
|
+
for (let [r, n] of Object.entries(e))
|
|
874
|
+
Ht(o, Ut(t, r), n);
|
|
875
|
+
return o;
|
|
876
|
+
}
|
|
877
|
+
function Ut(e, t) {
|
|
878
|
+
return e ? e + "[" + t + "]" : t;
|
|
879
|
+
}
|
|
880
|
+
function Ht(e, t, o) {
|
|
881
|
+
if (Array.isArray(o))
|
|
882
|
+
for (let [r, n] of o.entries())
|
|
883
|
+
Ht(e, Ut(t, r.toString()), n);
|
|
884
|
+
else
|
|
885
|
+
o instanceof Date ? e.push([t, o.toISOString()]) : typeof o == "boolean" ? e.push([t, o ? "1" : "0"]) : typeof o == "string" ? e.push([t, o]) : typeof o == "number" ? e.push([t, `${o}`]) : o == null ? e.push([t, ""]) : zt(o, t, e);
|
|
886
|
+
}
|
|
887
|
+
function Sr(e) {
|
|
888
|
+
var t, o;
|
|
889
|
+
let r = (t = e == null ? void 0 : e.form) != null ? t : e.closest("form");
|
|
890
|
+
if (r) {
|
|
891
|
+
for (let n of r.elements)
|
|
892
|
+
if (n !== e && (n.tagName === "INPUT" && n.type === "submit" || n.tagName === "BUTTON" && n.type === "submit" || n.nodeName === "INPUT" && n.type === "image")) {
|
|
893
|
+
n.click();
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
(o = r.requestSubmit) == null || o.call(r);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
function Wt(e, t, o) {
|
|
900
|
+
let r = O(o == null ? void 0 : o.value), n = k(() => e.value !== void 0);
|
|
901
|
+
return [k(() => n.value ? e.value : r.value), function(a) {
|
|
902
|
+
return n.value || (r.value = a), t == null ? void 0 : t(a);
|
|
903
|
+
}];
|
|
904
|
+
}
|
|
905
|
+
function pt(e) {
|
|
906
|
+
return [e.screenX, e.screenY];
|
|
907
|
+
}
|
|
908
|
+
function Kt() {
|
|
909
|
+
let e = O([-1, -1]);
|
|
910
|
+
return { wasMoved(t) {
|
|
911
|
+
let o = pt(t);
|
|
912
|
+
return e.value[0] === o[0] && e.value[1] === o[1] ? !1 : (e.value = o, !0);
|
|
913
|
+
}, update(t) {
|
|
914
|
+
e.value = pt(t);
|
|
915
|
+
} };
|
|
916
|
+
}
|
|
917
|
+
let Gt = Symbol("DescriptionContext");
|
|
918
|
+
function Or() {
|
|
919
|
+
let e = ue(Gt, null);
|
|
920
|
+
if (e === null)
|
|
921
|
+
throw new Error("Missing parent");
|
|
922
|
+
return e;
|
|
923
|
+
}
|
|
924
|
+
function Er({ slot: e = O({}), name: t = "Description", props: o = {} } = {}) {
|
|
925
|
+
let r = O([]);
|
|
926
|
+
function n(a) {
|
|
927
|
+
return r.value.push(a), () => {
|
|
928
|
+
let i = r.value.indexOf(a);
|
|
929
|
+
i !== -1 && r.value.splice(i, 1);
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
return ce(Gt, { register: n, slot: e, name: t, props: o }), k(() => r.value.length > 0 ? r.value.join(" ") : void 0);
|
|
933
|
+
}
|
|
934
|
+
_({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${Q()}` } }, setup(e, { attrs: t, slots: o }) {
|
|
935
|
+
let r = Or();
|
|
936
|
+
return Z(() => Ee(r.register(e.id))), () => {
|
|
937
|
+
let { name: n = "Description", slot: a = O({}), props: i = {} } = r, { id: u, ...c } = e, s = { ...Object.entries(i).reduce((l, [m, v]) => Object.assign(l, { [m]: I(v) }), {}), id: u };
|
|
938
|
+
return F({ ourProps: s, theirProps: c, slot: a.value, attrs: t, slots: o, name: n });
|
|
939
|
+
};
|
|
940
|
+
} });
|
|
941
|
+
let vt = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
|
|
942
|
+
function mt(e) {
|
|
943
|
+
var t, o;
|
|
944
|
+
let r = (t = e.innerText) != null ? t : "", n = e.cloneNode(!0);
|
|
945
|
+
if (!(n instanceof HTMLElement))
|
|
946
|
+
return r;
|
|
947
|
+
let a = !1;
|
|
948
|
+
for (let u of n.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))
|
|
949
|
+
u.remove(), a = !0;
|
|
950
|
+
let i = a ? (o = n.innerText) != null ? o : "" : r;
|
|
951
|
+
return vt.test(i) && (i = i.replace(vt, "")), i;
|
|
952
|
+
}
|
|
953
|
+
function Dr(e) {
|
|
954
|
+
let t = e.getAttribute("aria-label");
|
|
955
|
+
if (typeof t == "string")
|
|
956
|
+
return t.trim();
|
|
957
|
+
let o = e.getAttribute("aria-labelledby");
|
|
958
|
+
if (o) {
|
|
959
|
+
let r = o.split(" ").map((n) => {
|
|
960
|
+
let a = document.getElementById(n);
|
|
961
|
+
if (a) {
|
|
962
|
+
let i = a.getAttribute("aria-label");
|
|
963
|
+
return typeof i == "string" ? i.trim() : mt(a).trim();
|
|
964
|
+
}
|
|
965
|
+
return null;
|
|
966
|
+
}).filter(Boolean);
|
|
967
|
+
if (r.length > 0)
|
|
968
|
+
return r.join(", ");
|
|
969
|
+
}
|
|
970
|
+
return mt(e).trim();
|
|
971
|
+
}
|
|
972
|
+
function qt(e) {
|
|
973
|
+
let t = O(""), o = O("");
|
|
974
|
+
return () => {
|
|
975
|
+
let r = D(e);
|
|
976
|
+
if (!r)
|
|
977
|
+
return "";
|
|
978
|
+
let n = r.innerText;
|
|
979
|
+
if (t.value === n)
|
|
980
|
+
return o.value;
|
|
981
|
+
let a = Dr(r).trim().toLowerCase();
|
|
982
|
+
return t.value = n, o.value = a, a;
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function Pr(e, t) {
|
|
986
|
+
return e === t;
|
|
987
|
+
}
|
|
988
|
+
var Cr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Cr || {}), Ir = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(Ir || {}), Rr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Other = 1] = "Other", e))(Rr || {});
|
|
989
|
+
function Lr(e) {
|
|
990
|
+
requestAnimationFrame(() => requestAnimationFrame(e));
|
|
991
|
+
}
|
|
992
|
+
let Xt = Symbol("ListboxContext");
|
|
993
|
+
function be(e) {
|
|
994
|
+
let t = ue(Xt, null);
|
|
995
|
+
if (t === null) {
|
|
996
|
+
let o = new Error(`<${e} /> is missing a parent <Listbox /> component.`);
|
|
997
|
+
throw Error.captureStackTrace && Error.captureStackTrace(o, be), o;
|
|
998
|
+
}
|
|
999
|
+
return t;
|
|
1000
|
+
}
|
|
1001
|
+
let Tr = _({ name: "Listbox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], default: () => Pr }, 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: o, emit: r }) {
|
|
1002
|
+
let n = O(1), a = O(null), i = O(null), u = O(null), c = O([]), s = O(""), l = O(null), m = O(1);
|
|
1003
|
+
function v(y = (w) => w) {
|
|
1004
|
+
let w = l.value !== null ? c.value[l.value] : null, x = Xe(y(c.value.slice()), ($) => D($.dataRef.domRef)), S = w ? x.indexOf(w) : null;
|
|
1005
|
+
return S === -1 && (S = null), { options: x, activeOptionIndex: S };
|
|
1006
|
+
}
|
|
1007
|
+
let p = k(() => e.multiple ? 1 : 0), [h, d] = Wt(k(() => e.modelValue), (y) => r("update:modelValue", y), k(() => e.defaultValue)), g = k(() => h.value === void 0 ? W(p.value, { 1: [], 0: void 0 }) : h.value), f = { listboxState: n, value: g, mode: p, compare(y, w) {
|
|
1008
|
+
if (typeof e.by == "string") {
|
|
1009
|
+
let x = e.by;
|
|
1010
|
+
return (y == null ? void 0 : y[x]) === (w == null ? void 0 : w[x]);
|
|
1011
|
+
}
|
|
1012
|
+
return e.by(y, w);
|
|
1013
|
+
}, orientation: k(() => e.horizontal ? "horizontal" : "vertical"), labelRef: a, buttonRef: i, optionsRef: u, disabled: k(() => e.disabled), options: c, searchQuery: s, activeOptionIndex: l, activationTrigger: m, closeListbox() {
|
|
1014
|
+
e.disabled || n.value !== 1 && (n.value = 1, l.value = null);
|
|
1015
|
+
}, openListbox() {
|
|
1016
|
+
e.disabled || n.value !== 0 && (n.value = 0);
|
|
1017
|
+
}, goToOption(y, w, x) {
|
|
1018
|
+
if (e.disabled || n.value === 1)
|
|
1019
|
+
return;
|
|
1020
|
+
let S = v(), $ = $t(y === L.Specific ? { focus: L.Specific, id: w } : { focus: y }, { resolveItems: () => S.options, resolveActiveIndex: () => S.activeOptionIndex, resolveId: (X) => X.id, resolveDisabled: (X) => X.dataRef.disabled });
|
|
1021
|
+
s.value = "", l.value = $, m.value = x ?? 1, c.value = S.options;
|
|
1022
|
+
}, search(y) {
|
|
1023
|
+
if (e.disabled || n.value === 1)
|
|
1024
|
+
return;
|
|
1025
|
+
let w = s.value !== "" ? 0 : 1;
|
|
1026
|
+
s.value += y.toLowerCase();
|
|
1027
|
+
let x = (l.value !== null ? c.value.slice(l.value + w).concat(c.value.slice(0, l.value + w)) : c.value).find(($) => $.dataRef.textValue.startsWith(s.value) && !$.dataRef.disabled), S = x ? c.value.indexOf(x) : -1;
|
|
1028
|
+
S === -1 || S === l.value || (l.value = S, m.value = 1);
|
|
1029
|
+
}, clearSearch() {
|
|
1030
|
+
e.disabled || n.value !== 1 && s.value !== "" && (s.value = "");
|
|
1031
|
+
}, registerOption(y, w) {
|
|
1032
|
+
let x = v((S) => [...S, { id: y, dataRef: w }]);
|
|
1033
|
+
c.value = x.options, l.value = x.activeOptionIndex;
|
|
1034
|
+
}, unregisterOption(y) {
|
|
1035
|
+
let w = v((x) => {
|
|
1036
|
+
let S = x.findIndex(($) => $.id === y);
|
|
1037
|
+
return S !== -1 && x.splice(S, 1), x;
|
|
1038
|
+
});
|
|
1039
|
+
c.value = w.options, l.value = w.activeOptionIndex, m.value = 1;
|
|
1040
|
+
}, theirOnChange(y) {
|
|
1041
|
+
e.disabled || d(y);
|
|
1042
|
+
}, select(y) {
|
|
1043
|
+
e.disabled || d(W(p.value, { 0: () => y, 1: () => {
|
|
1044
|
+
let w = G(f.value.value).slice(), x = G(y), S = w.findIndex(($) => f.compare(x, G($)));
|
|
1045
|
+
return S === -1 ? w.push(x) : w.splice(S, 1), w;
|
|
1046
|
+
} }));
|
|
1047
|
+
} };
|
|
1048
|
+
Bt([i, u], (y, w) => {
|
|
1049
|
+
var x;
|
|
1050
|
+
f.closeListbox(), Ce(w, Pe.Loose) || (y.preventDefault(), (x = D(i)) == null || x.focus());
|
|
1051
|
+
}, k(() => n.value === 0)), ce(Xt, f), jt(k(() => W(n.value, { 0: J.Open, 1: J.Closed })));
|
|
1052
|
+
let C = k(() => {
|
|
1053
|
+
var y;
|
|
1054
|
+
return (y = D(i)) == null ? void 0 : y.closest("form");
|
|
1055
|
+
});
|
|
1056
|
+
return Z(() => {
|
|
1057
|
+
ne([C], () => {
|
|
1058
|
+
if (!C.value || e.defaultValue === void 0)
|
|
1059
|
+
return;
|
|
1060
|
+
function y() {
|
|
1061
|
+
f.theirOnChange(e.defaultValue);
|
|
1062
|
+
}
|
|
1063
|
+
return C.value.addEventListener("reset", y), () => {
|
|
1064
|
+
var w;
|
|
1065
|
+
(w = C.value) == null || w.removeEventListener("reset", y);
|
|
1066
|
+
};
|
|
1067
|
+
}, { immediate: !0 });
|
|
1068
|
+
}), () => {
|
|
1069
|
+
let { name: y, modelValue: w, disabled: x, form: S, ...$ } = e, X = { open: n.value === 0, disabled: x, value: g.value };
|
|
1070
|
+
return ve(se, [...y != null && g.value != null ? zt({ [y]: g.value }).map(([ae, le]) => ve(Ft, _t({ features: Ye.Hidden, key: ae, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: S, name: ae, value: le }))) : [], F({ ourProps: {}, theirProps: { ...o, ...We($, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: X, slots: t, attrs: o, name: "Listbox" })]);
|
|
1071
|
+
};
|
|
1072
|
+
} });
|
|
1073
|
+
_({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: () => `headlessui-listbox-label-${Q()}` } }, setup(e, { attrs: t, slots: o }) {
|
|
1074
|
+
let r = be("ListboxLabel");
|
|
1075
|
+
function n() {
|
|
1076
|
+
var a;
|
|
1077
|
+
(a = D(r.buttonRef)) == null || a.focus({ preventScroll: !0 });
|
|
1078
|
+
}
|
|
1079
|
+
return () => {
|
|
1080
|
+
let a = { open: r.listboxState.value === 0, disabled: r.disabled.value }, { id: i, ...u } = e, c = { id: i, ref: r.labelRef, onClick: n };
|
|
1081
|
+
return F({ ourProps: c, theirProps: u, slot: a, attrs: t, slots: o, name: "ListboxLabel" });
|
|
1082
|
+
};
|
|
1083
|
+
} });
|
|
1084
|
+
let _r = _({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-listbox-button-${Q()}` } }, setup(e, { attrs: t, slots: o, expose: r }) {
|
|
1085
|
+
let n = be("ListboxButton");
|
|
1086
|
+
r({ el: n.buttonRef, $el: n.buttonRef });
|
|
1087
|
+
function a(s) {
|
|
1088
|
+
switch (s.key) {
|
|
1089
|
+
case P.Space:
|
|
1090
|
+
case P.Enter:
|
|
1091
|
+
case P.ArrowDown:
|
|
1092
|
+
s.preventDefault(), n.openListbox(), B(() => {
|
|
1093
|
+
var l;
|
|
1094
|
+
(l = D(n.optionsRef)) == null || l.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.First);
|
|
1095
|
+
});
|
|
1096
|
+
break;
|
|
1097
|
+
case P.ArrowUp:
|
|
1098
|
+
s.preventDefault(), n.openListbox(), B(() => {
|
|
1099
|
+
var l;
|
|
1100
|
+
(l = D(n.optionsRef)) == null || l.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.Last);
|
|
1101
|
+
});
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
function i(s) {
|
|
1106
|
+
switch (s.key) {
|
|
1107
|
+
case P.Space:
|
|
1108
|
+
s.preventDefault();
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
function u(s) {
|
|
1113
|
+
n.disabled.value || (n.listboxState.value === 0 ? (n.closeListbox(), B(() => {
|
|
1114
|
+
var l;
|
|
1115
|
+
return (l = D(n.buttonRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1116
|
+
})) : (s.preventDefault(), n.openListbox(), Lr(() => {
|
|
1117
|
+
var l;
|
|
1118
|
+
return (l = D(n.optionsRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1119
|
+
})));
|
|
1120
|
+
}
|
|
1121
|
+
let c = Ke(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
|
|
1122
|
+
return () => {
|
|
1123
|
+
var s, l;
|
|
1124
|
+
let m = { open: n.listboxState.value === 0, disabled: n.disabled.value, value: n.value.value }, { id: v, ...p } = e, h = { ref: n.buttonRef, id: v, type: c.value, "aria-haspopup": "listbox", "aria-controls": (s = D(n.optionsRef)) == null ? void 0 : s.id, "aria-expanded": n.listboxState.value === 0, "aria-labelledby": n.labelRef.value ? [(l = D(n.labelRef)) == null ? void 0 : l.id, v].join(" ") : void 0, disabled: n.disabled.value === !0 ? !0 : void 0, onKeydown: a, onKeyup: i, onClick: u };
|
|
1125
|
+
return F({ ourProps: h, theirProps: p, slot: m, attrs: t, slots: o, name: "ListboxButton" });
|
|
1126
|
+
};
|
|
1127
|
+
} }), $r = _({ 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-${Q()}` } }, setup(e, { attrs: t, slots: o, expose: r }) {
|
|
1128
|
+
let n = be("ListboxOptions"), a = O(null);
|
|
1129
|
+
r({ el: n.optionsRef, $el: n.optionsRef });
|
|
1130
|
+
function i(s) {
|
|
1131
|
+
switch (a.value && clearTimeout(a.value), s.key) {
|
|
1132
|
+
case P.Space:
|
|
1133
|
+
if (n.searchQuery.value !== "")
|
|
1134
|
+
return s.preventDefault(), s.stopPropagation(), n.search(s.key);
|
|
1135
|
+
case P.Enter:
|
|
1136
|
+
if (s.preventDefault(), s.stopPropagation(), n.activeOptionIndex.value !== null) {
|
|
1137
|
+
let l = n.options.value[n.activeOptionIndex.value];
|
|
1138
|
+
n.select(l.dataRef.value);
|
|
1139
|
+
}
|
|
1140
|
+
n.mode.value === 0 && (n.closeListbox(), B(() => {
|
|
1141
|
+
var l;
|
|
1142
|
+
return (l = D(n.buttonRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1143
|
+
}));
|
|
1144
|
+
break;
|
|
1145
|
+
case W(n.orientation.value, { vertical: P.ArrowDown, horizontal: P.ArrowRight }):
|
|
1146
|
+
return s.preventDefault(), s.stopPropagation(), n.goToOption(L.Next);
|
|
1147
|
+
case W(n.orientation.value, { vertical: P.ArrowUp, horizontal: P.ArrowLeft }):
|
|
1148
|
+
return s.preventDefault(), s.stopPropagation(), n.goToOption(L.Previous);
|
|
1149
|
+
case P.Home:
|
|
1150
|
+
case P.PageUp:
|
|
1151
|
+
return s.preventDefault(), s.stopPropagation(), n.goToOption(L.First);
|
|
1152
|
+
case P.End:
|
|
1153
|
+
case P.PageDown:
|
|
1154
|
+
return s.preventDefault(), s.stopPropagation(), n.goToOption(L.Last);
|
|
1155
|
+
case P.Escape:
|
|
1156
|
+
s.preventDefault(), s.stopPropagation(), n.closeListbox(), B(() => {
|
|
1157
|
+
var l;
|
|
1158
|
+
return (l = D(n.buttonRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1159
|
+
});
|
|
1160
|
+
break;
|
|
1161
|
+
case P.Tab:
|
|
1162
|
+
s.preventDefault(), s.stopPropagation();
|
|
1163
|
+
break;
|
|
1164
|
+
default:
|
|
1165
|
+
s.key.length === 1 && (n.search(s.key), a.value = setTimeout(() => n.clearSearch(), 350));
|
|
1166
|
+
break;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
let u = At(), c = k(() => u !== null ? (u.value & J.Open) === J.Open : n.listboxState.value === 0);
|
|
1170
|
+
return () => {
|
|
1171
|
+
var s, l, m, v;
|
|
1172
|
+
let p = { open: n.listboxState.value === 0 }, { id: h, ...d } = e, g = { "aria-activedescendant": n.activeOptionIndex.value === null || (s = n.options.value[n.activeOptionIndex.value]) == null ? void 0 : s.id, "aria-multiselectable": n.mode.value === 1 ? !0 : void 0, "aria-labelledby": (v = (l = D(n.labelRef)) == null ? void 0 : l.id) != null ? v : (m = D(n.buttonRef)) == null ? void 0 : m.id, "aria-orientation": n.orientation.value, id: h, onKeydown: i, role: "listbox", tabIndex: 0, ref: n.optionsRef };
|
|
1173
|
+
return F({ ourProps: g, theirProps: d, slot: p, attrs: t, slots: o, features: me.RenderStrategy | me.Static, visible: c.value, name: "ListboxOptions" });
|
|
1174
|
+
};
|
|
1175
|
+
} }), Mr = _({ 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-${Q()}` } }, setup(e, { slots: t, attrs: o, expose: r }) {
|
|
1176
|
+
let n = be("ListboxOption"), a = O(null);
|
|
1177
|
+
r({ el: a, $el: a });
|
|
1178
|
+
let i = k(() => n.activeOptionIndex.value !== null ? n.options.value[n.activeOptionIndex.value].id === e.id : !1), u = k(() => W(n.mode.value, { 0: () => n.compare(G(n.value.value), G(e.value)), 1: () => G(n.value.value).some((f) => n.compare(G(f), G(e.value))) })), c = k(() => W(n.mode.value, { 1: () => {
|
|
1179
|
+
var f;
|
|
1180
|
+
let C = G(n.value.value);
|
|
1181
|
+
return ((f = n.options.value.find((y) => C.some((w) => n.compare(G(w), G(y.dataRef.value))))) == null ? void 0 : f.id) === e.id;
|
|
1182
|
+
}, 0: () => u.value })), s = qt(a), l = k(() => ({ disabled: e.disabled, value: e.value, get textValue() {
|
|
1183
|
+
return s();
|
|
1184
|
+
}, domRef: a }));
|
|
1185
|
+
Z(() => n.registerOption(e.id, l)), Ee(() => n.unregisterOption(e.id)), Z(() => {
|
|
1186
|
+
ne([n.listboxState, u], () => {
|
|
1187
|
+
n.listboxState.value === 0 && u.value && W(n.mode.value, { 1: () => {
|
|
1188
|
+
c.value && n.goToOption(L.Specific, e.id);
|
|
1189
|
+
}, 0: () => {
|
|
1190
|
+
n.goToOption(L.Specific, e.id);
|
|
1191
|
+
} });
|
|
1192
|
+
}, { immediate: !0 });
|
|
1193
|
+
}), oe(() => {
|
|
1194
|
+
n.listboxState.value === 0 && i.value && n.activationTrigger.value !== 0 && B(() => {
|
|
1195
|
+
var f, C;
|
|
1196
|
+
return (C = (f = D(a)) == null ? void 0 : f.scrollIntoView) == null ? void 0 : C.call(f, { block: "nearest" });
|
|
1197
|
+
});
|
|
1198
|
+
});
|
|
1199
|
+
function m(f) {
|
|
1200
|
+
if (e.disabled)
|
|
1201
|
+
return f.preventDefault();
|
|
1202
|
+
n.select(e.value), n.mode.value === 0 && (n.closeListbox(), B(() => {
|
|
1203
|
+
var C;
|
|
1204
|
+
return (C = D(n.buttonRef)) == null ? void 0 : C.focus({ preventScroll: !0 });
|
|
1205
|
+
}));
|
|
1206
|
+
}
|
|
1207
|
+
function v() {
|
|
1208
|
+
if (e.disabled)
|
|
1209
|
+
return n.goToOption(L.Nothing);
|
|
1210
|
+
n.goToOption(L.Specific, e.id);
|
|
1211
|
+
}
|
|
1212
|
+
let p = Kt();
|
|
1213
|
+
function h(f) {
|
|
1214
|
+
p.update(f);
|
|
1215
|
+
}
|
|
1216
|
+
function d(f) {
|
|
1217
|
+
p.wasMoved(f) && (e.disabled || i.value || n.goToOption(L.Specific, e.id, 0));
|
|
1218
|
+
}
|
|
1219
|
+
function g(f) {
|
|
1220
|
+
p.wasMoved(f) && (e.disabled || i.value && n.goToOption(L.Nothing));
|
|
1221
|
+
}
|
|
1222
|
+
return () => {
|
|
1223
|
+
let { disabled: f } = e, C = { active: i.value, selected: u.value, disabled: f }, { id: y, value: w, disabled: x, ...S } = e, $ = { id: y, ref: a, role: "option", tabIndex: f === !0 ? void 0 : -1, "aria-disabled": f === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onClick: m, onFocus: v, onPointerenter: h, onMouseenter: h, onPointermove: d, onMousemove: d, onPointerleave: g, onMouseleave: g };
|
|
1224
|
+
return F({ ourProps: $, theirProps: S, slot: C, attrs: o, slots: t, name: "ListboxOption" });
|
|
1225
|
+
};
|
|
1226
|
+
} });
|
|
1227
|
+
var Ar = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Ar || {}), jr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Other = 1] = "Other", e))(jr || {});
|
|
1228
|
+
function Vr(e) {
|
|
1229
|
+
requestAnimationFrame(() => requestAnimationFrame(e));
|
|
1230
|
+
}
|
|
1231
|
+
let Yt = Symbol("MenuContext");
|
|
1232
|
+
function Ie(e) {
|
|
1233
|
+
let t = ue(Yt, null);
|
|
1234
|
+
if (t === null) {
|
|
1235
|
+
let o = new Error(`<${e} /> is missing a parent <Menu /> component.`);
|
|
1236
|
+
throw Error.captureStackTrace && Error.captureStackTrace(o, Ie), o;
|
|
1237
|
+
}
|
|
1238
|
+
return t;
|
|
1239
|
+
}
|
|
1240
|
+
let Nr = _({ name: "Menu", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: o }) {
|
|
1241
|
+
let r = O(1), n = O(null), a = O(null), i = O([]), u = O(""), c = O(null), s = O(1);
|
|
1242
|
+
function l(v = (p) => p) {
|
|
1243
|
+
let p = c.value !== null ? i.value[c.value] : null, h = Xe(v(i.value.slice()), (g) => D(g.dataRef.domRef)), d = p ? h.indexOf(p) : null;
|
|
1244
|
+
return d === -1 && (d = null), { items: h, activeItemIndex: d };
|
|
1245
|
+
}
|
|
1246
|
+
let m = { menuState: r, buttonRef: n, itemsRef: a, items: i, searchQuery: u, activeItemIndex: c, activationTrigger: s, closeMenu: () => {
|
|
1247
|
+
r.value = 1, c.value = null;
|
|
1248
|
+
}, openMenu: () => r.value = 0, goToItem(v, p, h) {
|
|
1249
|
+
let d = l(), g = $t(v === L.Specific ? { focus: L.Specific, id: p } : { focus: v }, { resolveItems: () => d.items, resolveActiveIndex: () => d.activeItemIndex, resolveId: (f) => f.id, resolveDisabled: (f) => f.dataRef.disabled });
|
|
1250
|
+
u.value = "", c.value = g, s.value = h ?? 1, i.value = d.items;
|
|
1251
|
+
}, search(v) {
|
|
1252
|
+
let p = u.value !== "" ? 0 : 1;
|
|
1253
|
+
u.value += v.toLowerCase();
|
|
1254
|
+
let h = (c.value !== null ? i.value.slice(c.value + p).concat(i.value.slice(0, c.value + p)) : i.value).find((g) => g.dataRef.textValue.startsWith(u.value) && !g.dataRef.disabled), d = h ? i.value.indexOf(h) : -1;
|
|
1255
|
+
d === -1 || d === c.value || (c.value = d, s.value = 1);
|
|
1256
|
+
}, clearSearch() {
|
|
1257
|
+
u.value = "";
|
|
1258
|
+
}, registerItem(v, p) {
|
|
1259
|
+
let h = l((d) => [...d, { id: v, dataRef: p }]);
|
|
1260
|
+
i.value = h.items, c.value = h.activeItemIndex, s.value = 1;
|
|
1261
|
+
}, unregisterItem(v) {
|
|
1262
|
+
let p = l((h) => {
|
|
1263
|
+
let d = h.findIndex((g) => g.id === v);
|
|
1264
|
+
return d !== -1 && h.splice(d, 1), h;
|
|
1265
|
+
});
|
|
1266
|
+
i.value = p.items, c.value = p.activeItemIndex, s.value = 1;
|
|
1267
|
+
} };
|
|
1268
|
+
return Bt([n, a], (v, p) => {
|
|
1269
|
+
var h;
|
|
1270
|
+
m.closeMenu(), Ce(p, Pe.Loose) || (v.preventDefault(), (h = D(n)) == null || h.focus());
|
|
1271
|
+
}, k(() => r.value === 0)), ce(Yt, m), jt(k(() => W(r.value, { 0: J.Open, 1: J.Closed }))), () => {
|
|
1272
|
+
let v = { open: r.value === 0, close: m.closeMenu };
|
|
1273
|
+
return F({ ourProps: {}, theirProps: e, slot: v, slots: t, attrs: o, name: "Menu" });
|
|
1274
|
+
};
|
|
1275
|
+
} }), Br = _({ name: "MenuButton", props: { disabled: { type: Boolean, default: !1 }, as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-menu-button-${Q()}` } }, setup(e, { attrs: t, slots: o, expose: r }) {
|
|
1276
|
+
let n = Ie("MenuButton");
|
|
1277
|
+
r({ el: n.buttonRef, $el: n.buttonRef });
|
|
1278
|
+
function a(s) {
|
|
1279
|
+
switch (s.key) {
|
|
1280
|
+
case P.Space:
|
|
1281
|
+
case P.Enter:
|
|
1282
|
+
case P.ArrowDown:
|
|
1283
|
+
s.preventDefault(), s.stopPropagation(), n.openMenu(), B(() => {
|
|
1284
|
+
var l;
|
|
1285
|
+
(l = D(n.itemsRef)) == null || l.focus({ preventScroll: !0 }), n.goToItem(L.First);
|
|
1286
|
+
});
|
|
1287
|
+
break;
|
|
1288
|
+
case P.ArrowUp:
|
|
1289
|
+
s.preventDefault(), s.stopPropagation(), n.openMenu(), B(() => {
|
|
1290
|
+
var l;
|
|
1291
|
+
(l = D(n.itemsRef)) == null || l.focus({ preventScroll: !0 }), n.goToItem(L.Last);
|
|
1292
|
+
});
|
|
1293
|
+
break;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
function i(s) {
|
|
1297
|
+
switch (s.key) {
|
|
1298
|
+
case P.Space:
|
|
1299
|
+
s.preventDefault();
|
|
1300
|
+
break;
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
function u(s) {
|
|
1304
|
+
e.disabled || (n.menuState.value === 0 ? (n.closeMenu(), B(() => {
|
|
1305
|
+
var l;
|
|
1306
|
+
return (l = D(n.buttonRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1307
|
+
})) : (s.preventDefault(), n.openMenu(), Vr(() => {
|
|
1308
|
+
var l;
|
|
1309
|
+
return (l = D(n.itemsRef)) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
1310
|
+
})));
|
|
1311
|
+
}
|
|
1312
|
+
let c = Ke(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
|
|
1313
|
+
return () => {
|
|
1314
|
+
var s;
|
|
1315
|
+
let l = { open: n.menuState.value === 0 }, { id: m, ...v } = e, p = { ref: n.buttonRef, id: m, type: c.value, "aria-haspopup": "menu", "aria-controls": (s = D(n.itemsRef)) == null ? void 0 : s.id, "aria-expanded": n.menuState.value === 0, onKeydown: a, onKeyup: i, onClick: u };
|
|
1316
|
+
return F({ ourProps: p, theirProps: v, slot: l, attrs: t, slots: o, name: "MenuButton" });
|
|
1317
|
+
};
|
|
1318
|
+
} }), Fr = _({ 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-${Q()}` } }, setup(e, { attrs: t, slots: o, expose: r }) {
|
|
1319
|
+
let n = Ie("MenuItems"), a = O(null);
|
|
1320
|
+
r({ el: n.itemsRef, $el: n.itemsRef }), pr({ container: k(() => D(n.itemsRef)), enabled: k(() => n.menuState.value === 0), accept(l) {
|
|
1321
|
+
return l.getAttribute("role") === "menuitem" ? NodeFilter.FILTER_REJECT : l.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1322
|
+
}, walk(l) {
|
|
1323
|
+
l.setAttribute("role", "none");
|
|
1324
|
+
} });
|
|
1325
|
+
function i(l) {
|
|
1326
|
+
var m;
|
|
1327
|
+
switch (a.value && clearTimeout(a.value), l.key) {
|
|
1328
|
+
case P.Space:
|
|
1329
|
+
if (n.searchQuery.value !== "")
|
|
1330
|
+
return l.preventDefault(), l.stopPropagation(), n.search(l.key);
|
|
1331
|
+
case P.Enter:
|
|
1332
|
+
if (l.preventDefault(), l.stopPropagation(), n.activeItemIndex.value !== null) {
|
|
1333
|
+
let v = n.items.value[n.activeItemIndex.value];
|
|
1334
|
+
(m = D(v.dataRef.domRef)) == null || m.click();
|
|
1335
|
+
}
|
|
1336
|
+
n.closeMenu(), Nt(D(n.buttonRef));
|
|
1337
|
+
break;
|
|
1338
|
+
case P.ArrowDown:
|
|
1339
|
+
return l.preventDefault(), l.stopPropagation(), n.goToItem(L.Next);
|
|
1340
|
+
case P.ArrowUp:
|
|
1341
|
+
return l.preventDefault(), l.stopPropagation(), n.goToItem(L.Previous);
|
|
1342
|
+
case P.Home:
|
|
1343
|
+
case P.PageUp:
|
|
1344
|
+
return l.preventDefault(), l.stopPropagation(), n.goToItem(L.First);
|
|
1345
|
+
case P.End:
|
|
1346
|
+
case P.PageDown:
|
|
1347
|
+
return l.preventDefault(), l.stopPropagation(), n.goToItem(L.Last);
|
|
1348
|
+
case P.Escape:
|
|
1349
|
+
l.preventDefault(), l.stopPropagation(), n.closeMenu(), B(() => {
|
|
1350
|
+
var v;
|
|
1351
|
+
return (v = D(n.buttonRef)) == null ? void 0 : v.focus({ preventScroll: !0 });
|
|
1352
|
+
});
|
|
1353
|
+
break;
|
|
1354
|
+
case P.Tab:
|
|
1355
|
+
l.preventDefault(), l.stopPropagation(), n.closeMenu(), B(() => wr(D(n.buttonRef), l.shiftKey ? je.Previous : je.Next));
|
|
1356
|
+
break;
|
|
1357
|
+
default:
|
|
1358
|
+
l.key.length === 1 && (n.search(l.key), a.value = setTimeout(() => n.clearSearch(), 350));
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
function u(l) {
|
|
1363
|
+
switch (l.key) {
|
|
1364
|
+
case P.Space:
|
|
1365
|
+
l.preventDefault();
|
|
1366
|
+
break;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
let c = At(), s = k(() => c !== null ? (c.value & J.Open) === J.Open : n.menuState.value === 0);
|
|
1370
|
+
return () => {
|
|
1371
|
+
var l, m;
|
|
1372
|
+
let v = { open: n.menuState.value === 0 }, { id: p, ...h } = e, d = { "aria-activedescendant": n.activeItemIndex.value === null || (l = n.items.value[n.activeItemIndex.value]) == null ? void 0 : l.id, "aria-labelledby": (m = D(n.buttonRef)) == null ? void 0 : m.id, id: p, onKeydown: i, onKeyup: u, role: "menu", tabIndex: 0, ref: n.itemsRef };
|
|
1373
|
+
return F({ ourProps: d, theirProps: h, slot: v, attrs: t, slots: o, features: me.RenderStrategy | me.Static, visible: s.value, name: "MenuItems" });
|
|
1374
|
+
};
|
|
1375
|
+
} }), zr = _({ name: "MenuItem", inheritAttrs: !1, props: { as: { type: [Object, String], default: "template" }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-menu-item-${Q()}` } }, setup(e, { slots: t, attrs: o, expose: r }) {
|
|
1376
|
+
let n = Ie("MenuItem"), a = O(null);
|
|
1377
|
+
r({ el: a, $el: a });
|
|
1378
|
+
let i = k(() => n.activeItemIndex.value !== null ? n.items.value[n.activeItemIndex.value].id === e.id : !1), u = qt(a), c = k(() => ({ disabled: e.disabled, get textValue() {
|
|
1379
|
+
return u();
|
|
1380
|
+
}, domRef: a }));
|
|
1381
|
+
Z(() => n.registerItem(e.id, c)), Ee(() => n.unregisterItem(e.id)), oe(() => {
|
|
1382
|
+
n.menuState.value === 0 && i.value && n.activationTrigger.value !== 0 && B(() => {
|
|
1383
|
+
var d, g;
|
|
1384
|
+
return (g = (d = D(a)) == null ? void 0 : d.scrollIntoView) == null ? void 0 : g.call(d, { block: "nearest" });
|
|
1385
|
+
});
|
|
1386
|
+
});
|
|
1387
|
+
function s(d) {
|
|
1388
|
+
if (e.disabled)
|
|
1389
|
+
return d.preventDefault();
|
|
1390
|
+
n.closeMenu(), Nt(D(n.buttonRef));
|
|
1391
|
+
}
|
|
1392
|
+
function l() {
|
|
1393
|
+
if (e.disabled)
|
|
1394
|
+
return n.goToItem(L.Nothing);
|
|
1395
|
+
n.goToItem(L.Specific, e.id);
|
|
1396
|
+
}
|
|
1397
|
+
let m = Kt();
|
|
1398
|
+
function v(d) {
|
|
1399
|
+
m.update(d);
|
|
1400
|
+
}
|
|
1401
|
+
function p(d) {
|
|
1402
|
+
m.wasMoved(d) && (e.disabled || i.value || n.goToItem(L.Specific, e.id, 0));
|
|
1403
|
+
}
|
|
1404
|
+
function h(d) {
|
|
1405
|
+
m.wasMoved(d) && (e.disabled || i.value && n.goToItem(L.Nothing));
|
|
1406
|
+
}
|
|
1407
|
+
return () => {
|
|
1408
|
+
let { disabled: d } = e, g = { active: i.value, disabled: d, close: n.closeMenu }, { id: f, ...C } = e;
|
|
1409
|
+
return F({ ourProps: { id: f, ref: a, role: "menuitem", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, disabled: void 0, onClick: s, onFocus: l, onPointerenter: v, onMouseenter: v, onPointermove: p, onMousemove: p, onPointerleave: h, onMouseleave: h }, theirProps: { ...o, ...C }, slot: g, attrs: o, slots: t, name: "MenuItem" });
|
|
1410
|
+
};
|
|
1411
|
+
} }), Zt = Symbol("LabelContext");
|
|
1412
|
+
function Qt() {
|
|
1413
|
+
let e = ue(Zt, null);
|
|
1414
|
+
if (e === null) {
|
|
1415
|
+
let t = new Error("You used a <Label /> component, but it is not inside a parent.");
|
|
1416
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, Qt), t;
|
|
1417
|
+
}
|
|
1418
|
+
return e;
|
|
1419
|
+
}
|
|
1420
|
+
function Ur({ slot: e = {}, name: t = "Label", props: o = {} } = {}) {
|
|
1421
|
+
let r = O([]);
|
|
1422
|
+
function n(a) {
|
|
1423
|
+
return r.value.push(a), () => {
|
|
1424
|
+
let i = r.value.indexOf(a);
|
|
1425
|
+
i !== -1 && r.value.splice(i, 1);
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
return ce(Zt, { register: n, slot: e, name: t, props: o }), k(() => r.value.length > 0 ? r.value.join(" ") : void 0);
|
|
1429
|
+
}
|
|
1430
|
+
_({ name: "Label", props: { as: { type: [Object, String], default: "label" }, passive: { type: [Boolean], default: !1 }, id: { type: String, default: () => `headlessui-label-${Q()}` } }, setup(e, { slots: t, attrs: o }) {
|
|
1431
|
+
let r = Qt();
|
|
1432
|
+
return Z(() => Ee(r.register(e.id))), () => {
|
|
1433
|
+
let { name: n = "Label", slot: a = {}, props: i = {} } = r, { id: u, passive: c, ...s } = e, l = { ...Object.entries(i).reduce((m, [v, p]) => Object.assign(m, { [v]: I(p) }), {}), id: u };
|
|
1434
|
+
return c && (delete l.onClick, delete l.htmlFor, delete s.onClick), F({ ourProps: l, theirProps: s, slot: a, attrs: o, slots: t, name: n });
|
|
1435
|
+
};
|
|
1436
|
+
} });
|
|
1437
|
+
let Jt = Symbol("GroupContext");
|
|
1438
|
+
_({ name: "SwitchGroup", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: o }) {
|
|
1439
|
+
let r = O(null), n = Ur({ name: "SwitchLabel", props: { htmlFor: k(() => {
|
|
1440
|
+
var i;
|
|
1441
|
+
return (i = r.value) == null ? void 0 : i.id;
|
|
1442
|
+
}), onClick(i) {
|
|
1443
|
+
r.value && (i.currentTarget.tagName === "LABEL" && i.preventDefault(), r.value.click(), r.value.focus({ preventScroll: !0 }));
|
|
1444
|
+
} } }), a = Er({ name: "SwitchDescription" });
|
|
1445
|
+
return ce(Jt, { switchRef: r, labelledby: n, describedby: a }), () => F({ theirProps: e, ourProps: {}, slot: {}, slots: t, attrs: o, name: "SwitchGroup" });
|
|
1446
|
+
} });
|
|
1447
|
+
let Hr = _({ 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-${Q()}` } }, inheritAttrs: !1, setup(e, { emit: t, attrs: o, slots: r, expose: n }) {
|
|
1448
|
+
let a = ue(Jt, null), [i, u] = Wt(k(() => e.modelValue), (g) => t("update:modelValue", g), k(() => e.defaultChecked));
|
|
1449
|
+
function c() {
|
|
1450
|
+
u(!i.value);
|
|
1451
|
+
}
|
|
1452
|
+
let s = O(null), l = a === null ? s : a.switchRef, m = Ke(k(() => ({ as: e.as, type: o.type })), l);
|
|
1453
|
+
n({ el: l, $el: l });
|
|
1454
|
+
function v(g) {
|
|
1455
|
+
g.preventDefault(), c();
|
|
1456
|
+
}
|
|
1457
|
+
function p(g) {
|
|
1458
|
+
g.key === P.Space ? (g.preventDefault(), c()) : g.key === P.Enter && Sr(g.currentTarget);
|
|
1459
|
+
}
|
|
1460
|
+
function h(g) {
|
|
1461
|
+
g.preventDefault();
|
|
1462
|
+
}
|
|
1463
|
+
let d = k(() => {
|
|
1464
|
+
var g, f;
|
|
1465
|
+
return (f = (g = D(l)) == null ? void 0 : g.closest) == null ? void 0 : f.call(g, "form");
|
|
1466
|
+
});
|
|
1467
|
+
return Z(() => {
|
|
1468
|
+
ne([d], () => {
|
|
1469
|
+
if (!d.value || e.defaultChecked === void 0)
|
|
1470
|
+
return;
|
|
1471
|
+
function g() {
|
|
1472
|
+
u(e.defaultChecked);
|
|
1473
|
+
}
|
|
1474
|
+
return d.value.addEventListener("reset", g), () => {
|
|
1475
|
+
var f;
|
|
1476
|
+
(f = d.value) == null || f.removeEventListener("reset", g);
|
|
1477
|
+
};
|
|
1478
|
+
}, { immediate: !0 });
|
|
1479
|
+
}), () => {
|
|
1480
|
+
let { id: g, name: f, value: C, form: y, ...w } = e, x = { checked: i.value }, S = { id: g, ref: l, role: "switch", type: m.value, tabIndex: 0, "aria-checked": i.value, "aria-labelledby": a == null ? void 0 : a.labelledby.value, "aria-describedby": a == null ? void 0 : a.describedby.value, onClick: v, onKeyup: p, onKeypress: h };
|
|
1481
|
+
return ve(se, [f != null && i.value != null ? ve(Ft, _t({ features: Ye.Hidden, as: "input", type: "checkbox", hidden: !0, readOnly: !0, checked: i.value, form: y, name: f, value: C })) : null, F({ ourProps: S, theirProps: { ...o, ...We(w, ["modelValue", "defaultChecked"]) }, slot: x, attrs: o, slots: r, name: "Switch" })]);
|
|
1482
|
+
};
|
|
1483
|
+
} });
|
|
1484
|
+
function K(e) {
|
|
1485
|
+
if (e == null)
|
|
1486
|
+
return window;
|
|
1487
|
+
if (e.toString() !== "[object Window]") {
|
|
1488
|
+
var t = e.ownerDocument;
|
|
1489
|
+
return t && t.defaultView || window;
|
|
1490
|
+
}
|
|
1491
|
+
return e;
|
|
1492
|
+
}
|
|
1493
|
+
function Ze(e) {
|
|
1494
|
+
var t = K(e).Element;
|
|
1495
|
+
return e instanceof t || e instanceof Element;
|
|
1496
|
+
}
|
|
1497
|
+
function q(e) {
|
|
1498
|
+
var t = K(e).HTMLElement;
|
|
1499
|
+
return e instanceof t || e instanceof HTMLElement;
|
|
1500
|
+
}
|
|
1501
|
+
function en(e) {
|
|
1502
|
+
if (typeof ShadowRoot > "u")
|
|
1503
|
+
return !1;
|
|
1504
|
+
var t = K(e).ShadowRoot;
|
|
1505
|
+
return e instanceof t || e instanceof ShadowRoot;
|
|
1506
|
+
}
|
|
1507
|
+
var ie = Math.round;
|
|
1508
|
+
function Ve() {
|
|
1509
|
+
var e = navigator.userAgentData;
|
|
1510
|
+
return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
|
|
1511
|
+
return t.brand + "/" + t.version;
|
|
1512
|
+
}).join(" ") : navigator.userAgent;
|
|
1513
|
+
}
|
|
1514
|
+
function Wr() {
|
|
1515
|
+
return !/^((?!chrome|android).)*safari/i.test(Ve());
|
|
1516
|
+
}
|
|
1517
|
+
function Oe(e, t, o) {
|
|
1518
|
+
t === void 0 && (t = !1), o === void 0 && (o = !1);
|
|
1519
|
+
var r = e.getBoundingClientRect(), n = 1, a = 1;
|
|
1520
|
+
t && q(e) && (n = e.offsetWidth > 0 && ie(r.width) / e.offsetWidth || 1, a = e.offsetHeight > 0 && ie(r.height) / e.offsetHeight || 1);
|
|
1521
|
+
var i = Ze(e) ? K(e) : window, u = i.visualViewport, c = !Wr() && o, s = (r.left + (c && u ? u.offsetLeft : 0)) / n, l = (r.top + (c && u ? u.offsetTop : 0)) / a, m = r.width / n, v = r.height / a;
|
|
1522
|
+
return {
|
|
1523
|
+
width: m,
|
|
1524
|
+
height: v,
|
|
1525
|
+
top: l,
|
|
1526
|
+
right: s + m,
|
|
1527
|
+
bottom: l + v,
|
|
1528
|
+
left: s,
|
|
1529
|
+
x: s,
|
|
1530
|
+
y: l
|
|
1531
|
+
};
|
|
1532
|
+
}
|
|
1533
|
+
function tn(e) {
|
|
1534
|
+
var t = K(e), o = t.pageXOffset, r = t.pageYOffset;
|
|
1535
|
+
return {
|
|
1536
|
+
scrollLeft: o,
|
|
1537
|
+
scrollTop: r
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
function Kr(e) {
|
|
1541
|
+
return {
|
|
1542
|
+
scrollLeft: e.scrollLeft,
|
|
1543
|
+
scrollTop: e.scrollTop
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
function Gr(e) {
|
|
1547
|
+
return e === K(e) || !q(e) ? tn(e) : Kr(e);
|
|
1548
|
+
}
|
|
1549
|
+
function ee(e) {
|
|
1550
|
+
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
1551
|
+
}
|
|
1552
|
+
function Re(e) {
|
|
1553
|
+
return ((Ze(e) ? e.ownerDocument : (
|
|
1554
|
+
// $FlowFixMe[prop-missing]
|
|
1555
|
+
e.document
|
|
1556
|
+
)) || window.document).documentElement;
|
|
1557
|
+
}
|
|
1558
|
+
function qr(e) {
|
|
1559
|
+
return Oe(Re(e)).left + tn(e).scrollLeft;
|
|
1560
|
+
}
|
|
1561
|
+
function re(e) {
|
|
1562
|
+
return K(e).getComputedStyle(e);
|
|
1563
|
+
}
|
|
1564
|
+
function Qe(e) {
|
|
1565
|
+
var t = re(e), o = t.overflow, r = t.overflowX, n = t.overflowY;
|
|
1566
|
+
return /auto|scroll|overlay|hidden/.test(o + n + r);
|
|
1567
|
+
}
|
|
1568
|
+
function Xr(e) {
|
|
1569
|
+
var t = e.getBoundingClientRect(), o = ie(t.width) / e.offsetWidth || 1, r = ie(t.height) / e.offsetHeight || 1;
|
|
1570
|
+
return o !== 1 || r !== 1;
|
|
1571
|
+
}
|
|
1572
|
+
function Yr(e, t, o) {
|
|
1573
|
+
o === void 0 && (o = !1);
|
|
1574
|
+
var r = q(t), n = q(t) && Xr(t), a = Re(t), i = Oe(e, n, o), u = {
|
|
1575
|
+
scrollLeft: 0,
|
|
1576
|
+
scrollTop: 0
|
|
1577
|
+
}, c = {
|
|
1578
|
+
x: 0,
|
|
1579
|
+
y: 0
|
|
1580
|
+
};
|
|
1581
|
+
return (r || !r && !o) && ((ee(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
1582
|
+
Qe(a)) && (u = Gr(t)), q(t) ? (c = Oe(t, !0), c.x += t.clientLeft, c.y += t.clientTop) : a && (c.x = qr(a))), {
|
|
1583
|
+
x: i.left + u.scrollLeft - c.x,
|
|
1584
|
+
y: i.top + u.scrollTop - c.y,
|
|
1585
|
+
width: i.width,
|
|
1586
|
+
height: i.height
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
function Zr(e) {
|
|
1590
|
+
var t = Oe(e), o = e.offsetWidth, r = e.offsetHeight;
|
|
1591
|
+
return Math.abs(t.width - o) <= 1 && (o = t.width), Math.abs(t.height - r) <= 1 && (r = t.height), {
|
|
1592
|
+
x: e.offsetLeft,
|
|
1593
|
+
y: e.offsetTop,
|
|
1594
|
+
width: o,
|
|
1595
|
+
height: r
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
function Je(e) {
|
|
1599
|
+
return ee(e) === "html" ? e : (
|
|
1600
|
+
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
1601
|
+
// $FlowFixMe[incompatible-return]
|
|
1602
|
+
// $FlowFixMe[prop-missing]
|
|
1603
|
+
e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
1604
|
+
e.parentNode || // DOM Element detected
|
|
1605
|
+
(en(e) ? e.host : null) || // ShadowRoot detected
|
|
1606
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
1607
|
+
Re(e)
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1610
|
+
function nn(e) {
|
|
1611
|
+
return ["html", "body", "#document"].indexOf(ee(e)) >= 0 ? e.ownerDocument.body : q(e) && Qe(e) ? e : nn(Je(e));
|
|
1612
|
+
}
|
|
1613
|
+
function xe(e, t) {
|
|
1614
|
+
var o;
|
|
1615
|
+
t === void 0 && (t = []);
|
|
1616
|
+
var r = nn(e), n = r === ((o = e.ownerDocument) == null ? void 0 : o.body), a = K(r), i = n ? [a].concat(a.visualViewport || [], Qe(r) ? r : []) : r, u = t.concat(i);
|
|
1617
|
+
return n ? u : (
|
|
1618
|
+
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1619
|
+
u.concat(xe(Je(i)))
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
function Qr(e) {
|
|
1623
|
+
return ["table", "td", "th"].indexOf(ee(e)) >= 0;
|
|
1624
|
+
}
|
|
1625
|
+
function bt(e) {
|
|
1626
|
+
return !q(e) || // https://github.com/popperjs/popper-core/issues/837
|
|
1627
|
+
re(e).position === "fixed" ? null : e.offsetParent;
|
|
1628
|
+
}
|
|
1629
|
+
function Jr(e) {
|
|
1630
|
+
var t = /firefox/i.test(Ve()), o = /Trident/i.test(Ve());
|
|
1631
|
+
if (o && q(e)) {
|
|
1632
|
+
var r = re(e);
|
|
1633
|
+
if (r.position === "fixed")
|
|
1634
|
+
return null;
|
|
1635
|
+
}
|
|
1636
|
+
var n = Je(e);
|
|
1637
|
+
for (en(n) && (n = n.host); q(n) && ["html", "body"].indexOf(ee(n)) < 0; ) {
|
|
1638
|
+
var a = re(n);
|
|
1639
|
+
if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || t && a.willChange === "filter" || t && a.filter && a.filter !== "none")
|
|
1640
|
+
return n;
|
|
1641
|
+
n = n.parentNode;
|
|
1642
|
+
}
|
|
1643
|
+
return null;
|
|
1644
|
+
}
|
|
1645
|
+
function rn(e) {
|
|
1646
|
+
for (var t = K(e), o = bt(e); o && Qr(o) && re(o).position === "static"; )
|
|
1647
|
+
o = bt(o);
|
|
1648
|
+
return o && (ee(o) === "html" || ee(o) === "body" && re(o).position === "static") ? t : o || Jr(e) || t;
|
|
1649
|
+
}
|
|
1650
|
+
var ke = "top", Ne = "bottom", Be = "right", Se = "left", eo = "start", Fe = "end", to = "beforeRead", no = "read", ro = "afterRead", oo = "beforeMain", ao = "main", lo = "afterMain", io = "beforeWrite", so = "write", uo = "afterWrite", co = [to, no, ro, oo, ao, lo, io, so, uo];
|
|
1651
|
+
function fo(e) {
|
|
1652
|
+
var t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), r = [];
|
|
1653
|
+
e.forEach(function(a) {
|
|
1654
|
+
t.set(a.name, a);
|
|
1655
|
+
});
|
|
1656
|
+
function n(a) {
|
|
1657
|
+
o.add(a.name);
|
|
1658
|
+
var i = [].concat(a.requires || [], a.requiresIfExists || []);
|
|
1659
|
+
i.forEach(function(u) {
|
|
1660
|
+
if (!o.has(u)) {
|
|
1661
|
+
var c = t.get(u);
|
|
1662
|
+
c && n(c);
|
|
1663
|
+
}
|
|
1664
|
+
}), r.push(a);
|
|
1665
|
+
}
|
|
1666
|
+
return e.forEach(function(a) {
|
|
1667
|
+
o.has(a.name) || n(a);
|
|
1668
|
+
}), r;
|
|
1669
|
+
}
|
|
1670
|
+
function po(e) {
|
|
1671
|
+
var t = fo(e);
|
|
1672
|
+
return co.reduce(function(o, r) {
|
|
1673
|
+
return o.concat(t.filter(function(n) {
|
|
1674
|
+
return n.phase === r;
|
|
1675
|
+
}));
|
|
1676
|
+
}, []);
|
|
1677
|
+
}
|
|
1678
|
+
function vo(e) {
|
|
1679
|
+
var t;
|
|
1680
|
+
return function() {
|
|
1681
|
+
return t || (t = new Promise(function(o) {
|
|
1682
|
+
Promise.resolve().then(function() {
|
|
1683
|
+
t = void 0, o(e());
|
|
1684
|
+
});
|
|
1685
|
+
})), t;
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
function mo(e) {
|
|
1689
|
+
var t = e.reduce(function(o, r) {
|
|
1690
|
+
var n = o[r.name];
|
|
1691
|
+
return o[r.name] = n ? Object.assign({}, n, r, {
|
|
1692
|
+
options: Object.assign({}, n.options, r.options),
|
|
1693
|
+
data: Object.assign({}, n.data, r.data)
|
|
1694
|
+
}) : r, o;
|
|
1695
|
+
}, {});
|
|
1696
|
+
return Object.keys(t).map(function(o) {
|
|
1697
|
+
return t[o];
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
function on(e) {
|
|
1701
|
+
return e.split("-")[0];
|
|
1702
|
+
}
|
|
1703
|
+
function an(e) {
|
|
1704
|
+
return e.split("-")[1];
|
|
1705
|
+
}
|
|
1706
|
+
function bo(e) {
|
|
1707
|
+
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
|
|
1708
|
+
}
|
|
1709
|
+
function go(e) {
|
|
1710
|
+
var t = e.reference, o = e.element, r = e.placement, n = r ? on(r) : null, a = r ? an(r) : null, i = t.x + t.width / 2 - o.width / 2, u = t.y + t.height / 2 - o.height / 2, c;
|
|
1711
|
+
switch (n) {
|
|
1712
|
+
case ke:
|
|
1713
|
+
c = {
|
|
1714
|
+
x: i,
|
|
1715
|
+
y: t.y - o.height
|
|
1716
|
+
};
|
|
1717
|
+
break;
|
|
1718
|
+
case Ne:
|
|
1719
|
+
c = {
|
|
1720
|
+
x: i,
|
|
1721
|
+
y: t.y + t.height
|
|
1722
|
+
};
|
|
1723
|
+
break;
|
|
1724
|
+
case Be:
|
|
1725
|
+
c = {
|
|
1726
|
+
x: t.x + t.width,
|
|
1727
|
+
y: u
|
|
1728
|
+
};
|
|
1729
|
+
break;
|
|
1730
|
+
case Se:
|
|
1731
|
+
c = {
|
|
1732
|
+
x: t.x - o.width,
|
|
1733
|
+
y: u
|
|
1734
|
+
};
|
|
1735
|
+
break;
|
|
1736
|
+
default:
|
|
1737
|
+
c = {
|
|
1738
|
+
x: t.x,
|
|
1739
|
+
y: t.y
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
var s = n ? bo(n) : null;
|
|
1743
|
+
if (s != null) {
|
|
1744
|
+
var l = s === "y" ? "height" : "width";
|
|
1745
|
+
switch (a) {
|
|
1746
|
+
case eo:
|
|
1747
|
+
c[s] = c[s] - (t[l] / 2 - o[l] / 2);
|
|
1748
|
+
break;
|
|
1749
|
+
case Fe:
|
|
1750
|
+
c[s] = c[s] + (t[l] / 2 - o[l] / 2);
|
|
1751
|
+
break;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
return c;
|
|
1755
|
+
}
|
|
1756
|
+
var gt = {
|
|
1757
|
+
placement: "bottom",
|
|
1758
|
+
modifiers: [],
|
|
1759
|
+
strategy: "absolute"
|
|
1760
|
+
};
|
|
1761
|
+
function ht() {
|
|
1762
|
+
for (var e = arguments.length, t = new Array(e), o = 0; o < e; o++)
|
|
1763
|
+
t[o] = arguments[o];
|
|
1764
|
+
return !t.some(function(r) {
|
|
1765
|
+
return !(r && typeof r.getBoundingClientRect == "function");
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
function ho(e) {
|
|
1769
|
+
e === void 0 && (e = {});
|
|
1770
|
+
var t = e, o = t.defaultModifiers, r = o === void 0 ? [] : o, n = t.defaultOptions, a = n === void 0 ? gt : n;
|
|
1771
|
+
return function(u, c, s) {
|
|
1772
|
+
s === void 0 && (s = a);
|
|
1773
|
+
var l = {
|
|
1774
|
+
placement: "bottom",
|
|
1775
|
+
orderedModifiers: [],
|
|
1776
|
+
options: Object.assign({}, gt, a),
|
|
1777
|
+
modifiersData: {},
|
|
1778
|
+
elements: {
|
|
1779
|
+
reference: u,
|
|
1780
|
+
popper: c
|
|
1781
|
+
},
|
|
1782
|
+
attributes: {},
|
|
1783
|
+
styles: {}
|
|
1784
|
+
}, m = [], v = !1, p = {
|
|
1785
|
+
state: l,
|
|
1786
|
+
setOptions: function(f) {
|
|
1787
|
+
var C = typeof f == "function" ? f(l.options) : f;
|
|
1788
|
+
d(), l.options = Object.assign({}, a, l.options, C), l.scrollParents = {
|
|
1789
|
+
reference: Ze(u) ? xe(u) : u.contextElement ? xe(u.contextElement) : [],
|
|
1790
|
+
popper: xe(c)
|
|
1791
|
+
};
|
|
1792
|
+
var y = po(mo([].concat(r, l.options.modifiers)));
|
|
1793
|
+
return l.orderedModifiers = y.filter(function(w) {
|
|
1794
|
+
return w.enabled;
|
|
1795
|
+
}), h(), p.update();
|
|
1796
|
+
},
|
|
1797
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
1798
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
1799
|
+
// logic.
|
|
1800
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
1801
|
+
// prefer the async Popper#update method
|
|
1802
|
+
forceUpdate: function() {
|
|
1803
|
+
if (!v) {
|
|
1804
|
+
var f = l.elements, C = f.reference, y = f.popper;
|
|
1805
|
+
if (ht(C, y)) {
|
|
1806
|
+
l.rects = {
|
|
1807
|
+
reference: Yr(C, rn(y), l.options.strategy === "fixed"),
|
|
1808
|
+
popper: Zr(y)
|
|
1809
|
+
}, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(le) {
|
|
1810
|
+
return l.modifiersData[le.name] = Object.assign({}, le.data);
|
|
1811
|
+
});
|
|
1812
|
+
for (var w = 0; w < l.orderedModifiers.length; w++) {
|
|
1813
|
+
if (l.reset === !0) {
|
|
1814
|
+
l.reset = !1, w = -1;
|
|
1815
|
+
continue;
|
|
1816
|
+
}
|
|
1817
|
+
var x = l.orderedModifiers[w], S = x.fn, $ = x.options, X = $ === void 0 ? {} : $, ae = x.name;
|
|
1818
|
+
typeof S == "function" && (l = S({
|
|
1819
|
+
state: l,
|
|
1820
|
+
options: X,
|
|
1821
|
+
name: ae,
|
|
1822
|
+
instance: p
|
|
1823
|
+
}) || l);
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1828
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
1829
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
1830
|
+
update: vo(function() {
|
|
1831
|
+
return new Promise(function(g) {
|
|
1832
|
+
p.forceUpdate(), g(l);
|
|
1833
|
+
});
|
|
1834
|
+
}),
|
|
1835
|
+
destroy: function() {
|
|
1836
|
+
d(), v = !0;
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
if (!ht(u, c))
|
|
1840
|
+
return p;
|
|
1841
|
+
p.setOptions(s).then(function(g) {
|
|
1842
|
+
!v && s.onFirstUpdate && s.onFirstUpdate(g);
|
|
1843
|
+
});
|
|
1844
|
+
function h() {
|
|
1845
|
+
l.orderedModifiers.forEach(function(g) {
|
|
1846
|
+
var f = g.name, C = g.options, y = C === void 0 ? {} : C, w = g.effect;
|
|
1847
|
+
if (typeof w == "function") {
|
|
1848
|
+
var x = w({
|
|
1849
|
+
state: l,
|
|
1850
|
+
name: f,
|
|
1851
|
+
instance: p,
|
|
1852
|
+
options: y
|
|
1853
|
+
}), S = function() {
|
|
1854
|
+
};
|
|
1855
|
+
m.push(x || S);
|
|
1856
|
+
}
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
function d() {
|
|
1860
|
+
m.forEach(function(g) {
|
|
1861
|
+
return g();
|
|
1862
|
+
}), m = [];
|
|
1863
|
+
}
|
|
1864
|
+
return p;
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
var ye = {
|
|
1868
|
+
passive: !0
|
|
1869
|
+
};
|
|
1870
|
+
function yo(e) {
|
|
1871
|
+
var t = e.state, o = e.instance, r = e.options, n = r.scroll, a = n === void 0 ? !0 : n, i = r.resize, u = i === void 0 ? !0 : i, c = K(t.elements.popper), s = [].concat(t.scrollParents.reference, t.scrollParents.popper);
|
|
1872
|
+
return a && s.forEach(function(l) {
|
|
1873
|
+
l.addEventListener("scroll", o.update, ye);
|
|
1874
|
+
}), u && c.addEventListener("resize", o.update, ye), function() {
|
|
1875
|
+
a && s.forEach(function(l) {
|
|
1876
|
+
l.removeEventListener("scroll", o.update, ye);
|
|
1877
|
+
}), u && c.removeEventListener("resize", o.update, ye);
|
|
1878
|
+
};
|
|
1879
|
+
}
|
|
1880
|
+
const wo = {
|
|
1881
|
+
name: "eventListeners",
|
|
1882
|
+
enabled: !0,
|
|
1883
|
+
phase: "write",
|
|
1884
|
+
fn: function() {
|
|
1885
|
+
},
|
|
1886
|
+
effect: yo,
|
|
1887
|
+
data: {}
|
|
1888
|
+
};
|
|
1889
|
+
function xo(e) {
|
|
1890
|
+
var t = e.state, o = e.name;
|
|
1891
|
+
t.modifiersData[o] = go({
|
|
1892
|
+
reference: t.rects.reference,
|
|
1893
|
+
element: t.rects.popper,
|
|
1894
|
+
strategy: "absolute",
|
|
1895
|
+
placement: t.placement
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
const ko = {
|
|
1899
|
+
name: "popperOffsets",
|
|
1900
|
+
enabled: !0,
|
|
1901
|
+
phase: "read",
|
|
1902
|
+
fn: xo,
|
|
1903
|
+
data: {}
|
|
1904
|
+
};
|
|
1905
|
+
var So = {
|
|
1906
|
+
top: "auto",
|
|
1907
|
+
right: "auto",
|
|
1908
|
+
bottom: "auto",
|
|
1909
|
+
left: "auto"
|
|
1910
|
+
};
|
|
1911
|
+
function Oo(e, t) {
|
|
1912
|
+
var o = e.x, r = e.y, n = t.devicePixelRatio || 1;
|
|
1913
|
+
return {
|
|
1914
|
+
x: ie(o * n) / n || 0,
|
|
1915
|
+
y: ie(r * n) / n || 0
|
|
1916
|
+
};
|
|
1917
|
+
}
|
|
1918
|
+
function yt(e) {
|
|
1919
|
+
var t, o = e.popper, r = e.popperRect, n = e.placement, a = e.variation, i = e.offsets, u = e.position, c = e.gpuAcceleration, s = e.adaptive, l = e.roundOffsets, m = e.isFixed, v = i.x, p = v === void 0 ? 0 : v, h = i.y, d = h === void 0 ? 0 : h, g = typeof l == "function" ? l({
|
|
1920
|
+
x: p,
|
|
1921
|
+
y: d
|
|
1922
|
+
}) : {
|
|
1923
|
+
x: p,
|
|
1924
|
+
y: d
|
|
1925
|
+
};
|
|
1926
|
+
p = g.x, d = g.y;
|
|
1927
|
+
var f = i.hasOwnProperty("x"), C = i.hasOwnProperty("y"), y = Se, w = ke, x = window;
|
|
1928
|
+
if (s) {
|
|
1929
|
+
var S = rn(o), $ = "clientHeight", X = "clientWidth";
|
|
1930
|
+
if (S === K(o) && (S = Re(o), re(S).position !== "static" && u === "absolute" && ($ = "scrollHeight", X = "scrollWidth")), S = S, n === ke || (n === Se || n === Be) && a === Fe) {
|
|
1931
|
+
w = Ne;
|
|
1932
|
+
var ae = m && S === x && x.visualViewport ? x.visualViewport.height : (
|
|
1933
|
+
// $FlowFixMe[prop-missing]
|
|
1934
|
+
S[$]
|
|
1935
|
+
);
|
|
1936
|
+
d -= ae - r.height, d *= c ? 1 : -1;
|
|
1937
|
+
}
|
|
1938
|
+
if (n === Se || (n === ke || n === Ne) && a === Fe) {
|
|
1939
|
+
y = Be;
|
|
1940
|
+
var le = m && S === x && x.visualViewport ? x.visualViewport.width : (
|
|
1941
|
+
// $FlowFixMe[prop-missing]
|
|
1942
|
+
S[X]
|
|
1943
|
+
);
|
|
1944
|
+
p -= le - r.width, p *= c ? 1 : -1;
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
var et = Object.assign({
|
|
1948
|
+
position: u
|
|
1949
|
+
}, s && So), tt = l === !0 ? Oo({
|
|
1950
|
+
x: p,
|
|
1951
|
+
y: d
|
|
1952
|
+
}, K(o)) : {
|
|
1953
|
+
x: p,
|
|
1954
|
+
y: d
|
|
1955
|
+
};
|
|
1956
|
+
if (p = tt.x, d = tt.y, c) {
|
|
1957
|
+
var de;
|
|
1958
|
+
return Object.assign({}, et, (de = {}, de[w] = C ? "0" : "", de[y] = f ? "0" : "", de.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + d + "px)" : "translate3d(" + p + "px, " + d + "px, 0)", de));
|
|
1959
|
+
}
|
|
1960
|
+
return Object.assign({}, et, (t = {}, t[w] = C ? d + "px" : "", t[y] = f ? p + "px" : "", t.transform = "", t));
|
|
1961
|
+
}
|
|
1962
|
+
function Eo(e) {
|
|
1963
|
+
var t = e.state, o = e.options, r = o.gpuAcceleration, n = r === void 0 ? !0 : r, a = o.adaptive, i = a === void 0 ? !0 : a, u = o.roundOffsets, c = u === void 0 ? !0 : u, s = {
|
|
1964
|
+
placement: on(t.placement),
|
|
1965
|
+
variation: an(t.placement),
|
|
1966
|
+
popper: t.elements.popper,
|
|
1967
|
+
popperRect: t.rects.popper,
|
|
1968
|
+
gpuAcceleration: n,
|
|
1969
|
+
isFixed: t.options.strategy === "fixed"
|
|
1970
|
+
};
|
|
1971
|
+
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, yt(Object.assign({}, s, {
|
|
1972
|
+
offsets: t.modifiersData.popperOffsets,
|
|
1973
|
+
position: t.options.strategy,
|
|
1974
|
+
adaptive: i,
|
|
1975
|
+
roundOffsets: c
|
|
1976
|
+
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, yt(Object.assign({}, s, {
|
|
1977
|
+
offsets: t.modifiersData.arrow,
|
|
1978
|
+
position: "absolute",
|
|
1979
|
+
adaptive: !1,
|
|
1980
|
+
roundOffsets: c
|
|
1981
|
+
})))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
|
|
1982
|
+
"data-popper-placement": t.placement
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
const Do = {
|
|
1986
|
+
name: "computeStyles",
|
|
1987
|
+
enabled: !0,
|
|
1988
|
+
phase: "beforeWrite",
|
|
1989
|
+
fn: Eo,
|
|
1990
|
+
data: {}
|
|
1991
|
+
};
|
|
1992
|
+
function Po(e) {
|
|
1993
|
+
var t = e.state;
|
|
1994
|
+
Object.keys(t.elements).forEach(function(o) {
|
|
1995
|
+
var r = t.styles[o] || {}, n = t.attributes[o] || {}, a = t.elements[o];
|
|
1996
|
+
!q(a) || !ee(a) || (Object.assign(a.style, r), Object.keys(n).forEach(function(i) {
|
|
1997
|
+
var u = n[i];
|
|
1998
|
+
u === !1 ? a.removeAttribute(i) : a.setAttribute(i, u === !0 ? "" : u);
|
|
1999
|
+
}));
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
function Co(e) {
|
|
2003
|
+
var t = e.state, o = {
|
|
2004
|
+
popper: {
|
|
2005
|
+
position: t.options.strategy,
|
|
2006
|
+
left: "0",
|
|
2007
|
+
top: "0",
|
|
2008
|
+
margin: "0"
|
|
2009
|
+
},
|
|
2010
|
+
arrow: {
|
|
2011
|
+
position: "absolute"
|
|
2012
|
+
},
|
|
2013
|
+
reference: {}
|
|
2014
|
+
};
|
|
2015
|
+
return Object.assign(t.elements.popper.style, o.popper), t.styles = o, t.elements.arrow && Object.assign(t.elements.arrow.style, o.arrow), function() {
|
|
2016
|
+
Object.keys(t.elements).forEach(function(r) {
|
|
2017
|
+
var n = t.elements[r], a = t.attributes[r] || {}, i = Object.keys(t.styles.hasOwnProperty(r) ? t.styles[r] : o[r]), u = i.reduce(function(c, s) {
|
|
2018
|
+
return c[s] = "", c;
|
|
2019
|
+
}, {});
|
|
2020
|
+
!q(n) || !ee(n) || (Object.assign(n.style, u), Object.keys(a).forEach(function(c) {
|
|
2021
|
+
n.removeAttribute(c);
|
|
2022
|
+
}));
|
|
2023
|
+
});
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
const Io = {
|
|
2027
|
+
name: "applyStyles",
|
|
2028
|
+
enabled: !0,
|
|
2029
|
+
phase: "write",
|
|
2030
|
+
fn: Po,
|
|
2031
|
+
effect: Co,
|
|
2032
|
+
requires: ["computeStyles"]
|
|
2033
|
+
};
|
|
2034
|
+
var Ro = [wo, ko, Do, Io], Lo = /* @__PURE__ */ ho({
|
|
2035
|
+
defaultModifiers: Ro
|
|
2036
|
+
});
|
|
2037
|
+
function To(e) {
|
|
2038
|
+
const t = O(null), o = O(null);
|
|
2039
|
+
return Z(() => {
|
|
2040
|
+
oe((r) => {
|
|
2041
|
+
if (!o.value || !t.value)
|
|
2042
|
+
return;
|
|
2043
|
+
const n = o.value.el || o.value, a = t.value.el || t.value;
|
|
2044
|
+
if (!(a instanceof HTMLElement) || !(n instanceof HTMLElement))
|
|
2045
|
+
return;
|
|
2046
|
+
const { destroy: i } = Lo(a, n, e);
|
|
2047
|
+
r(i);
|
|
2048
|
+
});
|
|
2049
|
+
}), [t, o];
|
|
2050
|
+
}
|
|
2051
|
+
const ia = /* @__PURE__ */ _({
|
|
2052
|
+
__name: "MenuContainer",
|
|
2053
|
+
props: {
|
|
2054
|
+
position: { default: "left" },
|
|
2055
|
+
usePortal: { type: [Boolean, String], default: !1 }
|
|
2056
|
+
},
|
|
2057
|
+
setup(e) {
|
|
2058
|
+
const o = e.position === "left" ? "bottom-end" : "bottom-start", [r, n] = To({ placement: o });
|
|
2059
|
+
return (a, i) => (E(), H(I(Nr), {
|
|
2060
|
+
as: "div",
|
|
2061
|
+
class: "relative inline-block text-left"
|
|
2062
|
+
}, {
|
|
2063
|
+
default: U(({ open: u }) => [
|
|
2064
|
+
V(I(Br), {
|
|
2065
|
+
class: "focus:outline-none",
|
|
2066
|
+
ref_key: "button",
|
|
2067
|
+
ref: r
|
|
2068
|
+
}, {
|
|
2069
|
+
default: U(() => [
|
|
2070
|
+
nt(a.$slots, "button", {}, () => [
|
|
2071
|
+
V(I(z), {
|
|
2072
|
+
class: "fill-current",
|
|
2073
|
+
name: "ellipsis-h"
|
|
2074
|
+
})
|
|
2075
|
+
])
|
|
2076
|
+
]),
|
|
2077
|
+
_: 3
|
|
2078
|
+
}, 512),
|
|
2079
|
+
(E(), H(fn, {
|
|
2080
|
+
to: typeof a.usePortal == "string" ? a.usePortal : "body",
|
|
2081
|
+
disabled: !a.usePortal
|
|
2082
|
+
}, [
|
|
2083
|
+
T("div", {
|
|
2084
|
+
ref_key: "container",
|
|
2085
|
+
ref: n,
|
|
2086
|
+
class: M(["w-56", u ? "mt-" : "mt-px"])
|
|
2087
|
+
}, [
|
|
2088
|
+
V(wt, {
|
|
2089
|
+
"enter-active-class": "transition duration-200 ease-in-out",
|
|
2090
|
+
"enter-from-class": "transform -translate-y-4 opacity-0",
|
|
2091
|
+
"enter-to-class": "transform opacity-100",
|
|
2092
|
+
"leave-active-class": "transition duration-100 ease-in-out",
|
|
2093
|
+
"leave-from-class": "transform opacity-100",
|
|
2094
|
+
"leave-to-class": "transform -translate-y-2 opacity-0"
|
|
2095
|
+
}, {
|
|
2096
|
+
default: U(() => [
|
|
2097
|
+
V(I(Fr), {
|
|
2098
|
+
class: M([
|
|
2099
|
+
{
|
|
2100
|
+
"absolute left-0 origin-top-left": !a.usePortal && a.position === "right",
|
|
2101
|
+
"absolute right-0 origin-top-right": !a.usePortal && a.position === "left"
|
|
2102
|
+
},
|
|
2103
|
+
"z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
|
|
2104
|
+
])
|
|
2105
|
+
}, {
|
|
2106
|
+
default: U(() => [
|
|
2107
|
+
nt(a.$slots, "default")
|
|
2108
|
+
]),
|
|
2109
|
+
_: 3
|
|
2110
|
+
}, 8, ["class"])
|
|
2111
|
+
]),
|
|
2112
|
+
_: 3
|
|
2113
|
+
})
|
|
2114
|
+
], 2)
|
|
2115
|
+
], 8, ["to", "disabled"]))
|
|
2116
|
+
]),
|
|
2117
|
+
_: 3
|
|
2118
|
+
}));
|
|
2119
|
+
}
|
|
2120
|
+
}), _o = {
|
|
2121
|
+
key: 0,
|
|
2122
|
+
class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
|
|
2123
|
+
}, sa = /* @__PURE__ */ _({
|
|
2124
|
+
__name: "MenuLink",
|
|
2125
|
+
props: {
|
|
2126
|
+
label: {},
|
|
2127
|
+
meta: {},
|
|
2128
|
+
disabled: { type: Boolean },
|
|
2129
|
+
as: {}
|
|
2130
|
+
},
|
|
2131
|
+
setup(e) {
|
|
2132
|
+
return (t, o) => (E(), H(I(zr), pn(vn({ disabled: t.disabled })), {
|
|
2133
|
+
default: U(({ active: r }) => [
|
|
2134
|
+
(E(), H(mn(t.as || "span"), {
|
|
2135
|
+
class: M(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
|
|
2136
|
+
r ? "bg-grey-200" : "",
|
|
2137
|
+
t.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
|
|
2138
|
+
]])
|
|
2139
|
+
}, {
|
|
2140
|
+
default: U(() => [
|
|
2141
|
+
T("span", null, N(t.label), 1),
|
|
2142
|
+
t.meta ? (E(), R("span", _o, N(t.meta), 1)) : A("", !0)
|
|
2143
|
+
]),
|
|
2144
|
+
_: 2
|
|
2145
|
+
}, 1032, ["class"]))
|
|
2146
|
+
]),
|
|
2147
|
+
_: 1
|
|
2148
|
+
}, 16));
|
|
2149
|
+
}
|
|
2150
|
+
}), $o = { class: "relative" }, Mo = {
|
|
2151
|
+
key: 0,
|
|
2152
|
+
class: "absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"
|
|
2153
|
+
}, Ao = {
|
|
2154
|
+
key: 1,
|
|
2155
|
+
class: "block truncate"
|
|
2156
|
+
}, jo = {
|
|
2157
|
+
key: 2,
|
|
2158
|
+
class: "text-grey-500 truncate"
|
|
2159
|
+
}, Vo = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, No = { class: "absolute right-2 inset-y-0 flex items-center" }, Bo = {
|
|
2160
|
+
key: 0,
|
|
2161
|
+
class: "bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"
|
|
2162
|
+
}, ua = /* @__PURE__ */ _({
|
|
2163
|
+
__name: "Select",
|
|
2164
|
+
props: {
|
|
2165
|
+
modelValue: {},
|
|
2166
|
+
size: { default: "medium" },
|
|
2167
|
+
icon: {},
|
|
2168
|
+
placeholder: {},
|
|
2169
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
2170
|
+
options: {},
|
|
2171
|
+
disabledBadge: {}
|
|
2172
|
+
},
|
|
2173
|
+
emits: ["update:modelValue"],
|
|
2174
|
+
setup(e, { emit: t }) {
|
|
2175
|
+
const o = e, r = o.modelValue ? O(o.modelValue) : O(void 0), n = t, { inputClasses: a, disabledClasses: i, textSizeClasses: u } = He(o);
|
|
2176
|
+
return ne(
|
|
2177
|
+
() => o.modelValue,
|
|
2178
|
+
(c) => {
|
|
2179
|
+
var s;
|
|
2180
|
+
c && c.id !== ((s = r.value) == null ? void 0 : s.id) && (r.value = c);
|
|
2181
|
+
}
|
|
2182
|
+
), ne(r, (c) => {
|
|
2183
|
+
c && n("update:modelValue", c);
|
|
2184
|
+
}), (c, s) => (E(), H(I(Tr), {
|
|
2185
|
+
as: "div",
|
|
2186
|
+
modelValue: I(r),
|
|
2187
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => bn(r) ? r.value = l : null),
|
|
2188
|
+
disabled: c.isDisabled
|
|
2189
|
+
}, {
|
|
2190
|
+
default: U(() => [
|
|
2191
|
+
T("div", $o, [
|
|
2192
|
+
V(I(_r), {
|
|
2193
|
+
class: M(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [I(a), I(u), I(i)]])
|
|
2194
|
+
}, {
|
|
2195
|
+
default: U(() => {
|
|
2196
|
+
var l;
|
|
2197
|
+
return [
|
|
2198
|
+
c.icon ? (E(), R("span", Mo, [
|
|
2199
|
+
V(z, {
|
|
2200
|
+
name: ((l = I(r)) == null ? void 0 : l.icon) ?? c.icon
|
|
2201
|
+
}, null, 8, ["name"])
|
|
2202
|
+
])) : A("", !0),
|
|
2203
|
+
I(r) ? (E(), R("span", Ao, N(I(r).label), 1)) : (E(), R("span", jo, N(c.placeholder), 1)),
|
|
2204
|
+
T("span", Vo, [
|
|
2205
|
+
V(z, {
|
|
2206
|
+
class: "text-grey-400",
|
|
2207
|
+
name: "chevron-down",
|
|
2208
|
+
"aria-hidden": "true"
|
|
2209
|
+
})
|
|
2210
|
+
])
|
|
2211
|
+
];
|
|
2212
|
+
}),
|
|
2213
|
+
_: 1
|
|
2214
|
+
}, 8, ["class"]),
|
|
2215
|
+
V(wt, {
|
|
2216
|
+
"leave-active-class": "transition ease-in duration-100",
|
|
2217
|
+
"leave-from-class": "opacity-100",
|
|
2218
|
+
"leave-to-class": "opacity-0"
|
|
2219
|
+
}, {
|
|
2220
|
+
default: U(() => [
|
|
2221
|
+
V(I($r), { 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" }, {
|
|
2222
|
+
default: U(() => [
|
|
2223
|
+
(E(!0), R(se, null, xt(c.options, (l) => (E(), H(I(Mr), {
|
|
2224
|
+
as: "template",
|
|
2225
|
+
key: l.id,
|
|
2226
|
+
value: l,
|
|
2227
|
+
disabled: l.disabled
|
|
2228
|
+
}, {
|
|
2229
|
+
default: U(({ active: m, selected: v }) => [
|
|
2230
|
+
T("li", {
|
|
2231
|
+
class: M([
|
|
2232
|
+
m ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
|
|
2233
|
+
"cursor-default select-none relative py-2 pl-3 pr-12",
|
|
2234
|
+
{ "opacity-50 bg-grey-100": l.disabled }
|
|
2235
|
+
])
|
|
2236
|
+
}, [
|
|
2237
|
+
T("div", No, [
|
|
2238
|
+
l.disabled && c.disabledBadge ? (E(), R("span", Bo, N(c.disabledBadge), 1)) : A("", !0)
|
|
2239
|
+
]),
|
|
2240
|
+
T("span", {
|
|
2241
|
+
class: M([
|
|
2242
|
+
v ? "font-semibold" : "font-normal",
|
|
2243
|
+
"block truncate"
|
|
2244
|
+
])
|
|
2245
|
+
}, [
|
|
2246
|
+
l.icon ? (E(), H(z, {
|
|
2247
|
+
key: 0,
|
|
2248
|
+
class: "inline-block mr-1",
|
|
2249
|
+
name: l.icon
|
|
2250
|
+
}, null, 8, ["name"])) : A("", !0),
|
|
2251
|
+
gn(" " + N(l.label), 1)
|
|
2252
|
+
], 2),
|
|
2253
|
+
v ? (E(), R("span", {
|
|
2254
|
+
key: 0,
|
|
2255
|
+
class: M([
|
|
2256
|
+
m ? "text-blue-100" : "text-blue-500",
|
|
2257
|
+
"absolute inset-y-0 right-0 flex items-center pr-4"
|
|
2258
|
+
])
|
|
2259
|
+
}, [
|
|
2260
|
+
V(z, {
|
|
2261
|
+
name: "check",
|
|
2262
|
+
class: "h-5 w-5",
|
|
2263
|
+
"aria-hidden": "true"
|
|
2264
|
+
})
|
|
2265
|
+
], 2)) : A("", !0)
|
|
2266
|
+
], 2)
|
|
2267
|
+
]),
|
|
2268
|
+
_: 2
|
|
2269
|
+
}, 1032, ["value", "disabled"]))), 128))
|
|
2270
|
+
]),
|
|
2271
|
+
_: 1
|
|
2272
|
+
})
|
|
2273
|
+
]),
|
|
2274
|
+
_: 1
|
|
2275
|
+
})
|
|
2276
|
+
])
|
|
2277
|
+
]),
|
|
2278
|
+
_: 1
|
|
2279
|
+
}, 8, ["modelValue", "disabled"]));
|
|
2280
|
+
}
|
|
2281
|
+
}), Fo = { class: "animate-pulse" }, zo = { class: "flex items-center justify-between space-x-4" }, Uo = {
|
|
2282
|
+
key: 0,
|
|
2283
|
+
class: "w-12 h-12 bg-current rounded-full shrink-0"
|
|
2284
|
+
}, Ho = {
|
|
2285
|
+
key: 1,
|
|
2286
|
+
class: "w-full h-8 bg-current rounded-lg"
|
|
2287
|
+
}, Wo = {
|
|
2288
|
+
key: 0,
|
|
2289
|
+
class: "mt-6 space-y-2"
|
|
2290
|
+
}, Ko = {
|
|
2291
|
+
key: 1,
|
|
2292
|
+
class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
|
|
2293
|
+
}, ca = /* @__PURE__ */ _({
|
|
2294
|
+
__name: "Skeleton",
|
|
2295
|
+
props: {
|
|
2296
|
+
avatar: { type: Boolean, default: !1 },
|
|
2297
|
+
title: { type: Boolean, default: !0 },
|
|
2298
|
+
lines: { default: 3 },
|
|
2299
|
+
footer: { type: Boolean, default: !1 }
|
|
2300
|
+
},
|
|
2301
|
+
setup(e) {
|
|
2302
|
+
const t = e, o = new Array(t.lines).fill(void 0).map(() => {
|
|
2303
|
+
const r = [4, 5, 6, 8, 10, 16, 24, 32];
|
|
2304
|
+
return {
|
|
2305
|
+
margin: `mr-${r[Math.floor(Math.random() * r.length)]}`
|
|
2306
|
+
};
|
|
2307
|
+
});
|
|
2308
|
+
return (r, n) => (E(), R("div", Fo, [
|
|
2309
|
+
T("div", zo, [
|
|
2310
|
+
r.avatar ? (E(), R("div", Uo)) : A("", !0),
|
|
2311
|
+
r.title ? (E(), R("div", Ho)) : A("", !0)
|
|
2312
|
+
]),
|
|
2313
|
+
r.lines > 0 ? (E(), R("div", Wo, [
|
|
2314
|
+
(E(!0), R(se, null, xt(I(o), (a, i) => (E(), R("div", {
|
|
2315
|
+
class: M(["h-4 bg-current rounded-lg", a.margin]),
|
|
2316
|
+
key: i
|
|
2317
|
+
}, null, 2))), 128))
|
|
2318
|
+
])) : A("", !0),
|
|
2319
|
+
r.footer ? (E(), R("div", Ko)) : A("", !0)
|
|
2320
|
+
]));
|
|
2321
|
+
}
|
|
2322
|
+
}), da = /* @__PURE__ */ _({
|
|
2323
|
+
__name: "Spinner",
|
|
2324
|
+
setup(e) {
|
|
2325
|
+
return (t, o) => (E(), H(I(z), {
|
|
2326
|
+
class: "animate-spin",
|
|
2327
|
+
name: "circle-notch"
|
|
2328
|
+
}));
|
|
2329
|
+
}
|
|
2330
|
+
}), Go = { class: "relative inline-flex items-center" }, qo = ["aria-label", "tabindex"], Xo = {
|
|
2331
|
+
key: 0,
|
|
2332
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
2333
|
+
}, fa = /* @__PURE__ */ _({
|
|
2334
|
+
__name: "SplitButton",
|
|
2335
|
+
props: {
|
|
2336
|
+
label: {},
|
|
2337
|
+
size: { default: "medium" },
|
|
2338
|
+
color: { default: "primary" },
|
|
2339
|
+
isLoading: { type: Boolean, default: !1 },
|
|
2340
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
2341
|
+
icon: { default: "plus" }
|
|
2342
|
+
},
|
|
2343
|
+
emits: ["onClick", "onClickSplit"],
|
|
2344
|
+
setup(e, { emit: t }) {
|
|
2345
|
+
const o = t, r = e, n = k(() => {
|
|
2346
|
+
const s = {
|
|
2347
|
+
"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": r.color === "primary",
|
|
2348
|
+
"text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": r.color === "light",
|
|
2349
|
+
"text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": r.color === "dark",
|
|
2350
|
+
"text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": r.color === "danger"
|
|
2351
|
+
}, l = {
|
|
2352
|
+
"px-4 py-1 text-xs leading-5 mono-100": r.size === "small",
|
|
2353
|
+
"px-5 py-2 text-sm leading-4 font-medium": r.size === "medium",
|
|
2354
|
+
"px-8 pr-4 py-3 text-base leading-6 font-medium": r.size === "large"
|
|
2355
|
+
}, m = {
|
|
2356
|
+
"pointer-events-none opacity-75 cursor-not-allowed": r.isDisabled
|
|
2357
|
+
};
|
|
2358
|
+
return {
|
|
2359
|
+
...s,
|
|
2360
|
+
...m,
|
|
2361
|
+
...l
|
|
2362
|
+
};
|
|
2363
|
+
}), a = k(() => {
|
|
2364
|
+
const s = {
|
|
2365
|
+
"border-l-white/50 border-l": r.color === "primary",
|
|
2366
|
+
"border-l-blue-100 border-l": r.color === "light",
|
|
2367
|
+
"border-l-grey-600 border-l": r.color === "dark",
|
|
2368
|
+
"border-l-red-600 border-l": r.color === "danger"
|
|
2369
|
+
}, l = {
|
|
2370
|
+
"pl-2 pr-3": r.size === "small",
|
|
2371
|
+
"pl-3 pr-3": r.size === "medium",
|
|
2372
|
+
"pl-4 pr-5": r.size === "large"
|
|
2373
|
+
};
|
|
2374
|
+
return {
|
|
2375
|
+
...s,
|
|
2376
|
+
...l
|
|
2377
|
+
};
|
|
2378
|
+
}), i = k(() => ({
|
|
2379
|
+
...{
|
|
2380
|
+
"text-white": r.color === "primary",
|
|
2381
|
+
"text-blue-600": r.color === "light",
|
|
2382
|
+
"text-grey-50": r.color === "dark"
|
|
2383
|
+
}
|
|
2384
|
+
}));
|
|
2385
|
+
function u() {
|
|
2386
|
+
r.isDisabled || o("onClick");
|
|
2387
|
+
}
|
|
2388
|
+
function c() {
|
|
2389
|
+
r.isDisabled || o("onClickSplit");
|
|
2390
|
+
}
|
|
2391
|
+
return (s, l) => (E(), R("div", Go, [
|
|
2392
|
+
T("button", {
|
|
2393
|
+
type: "button",
|
|
2394
|
+
"aria-label": s.label,
|
|
2395
|
+
tabindex: s.isDisabled ? "-1" : void 0,
|
|
2396
|
+
class: M(["relative transition duration-150 ease-in-out rounded-l-lg", n.value]),
|
|
2397
|
+
onClick: u
|
|
2398
|
+
}, [
|
|
2399
|
+
T("div", {
|
|
2400
|
+
class: M(!s.isLoading || "invisible")
|
|
2401
|
+
}, [
|
|
2402
|
+
T("span", null, N(s.label), 1)
|
|
2403
|
+
], 2),
|
|
2404
|
+
s.isLoading ? (E(), R("span", Xo, [
|
|
2405
|
+
V(z, {
|
|
2406
|
+
class: "ml-3 animate-spin",
|
|
2407
|
+
name: "circle-notch"
|
|
2408
|
+
})
|
|
2409
|
+
])) : A("", !0)
|
|
2410
|
+
], 10, qo),
|
|
2411
|
+
T("button", {
|
|
2412
|
+
type: "button",
|
|
2413
|
+
class: M(["border-l-white/50 border-l transition duration-150 ease-in-out rounded-r-lg", [n.value, a.value]]),
|
|
2414
|
+
onClick: c
|
|
2415
|
+
}, [
|
|
2416
|
+
V(z, {
|
|
2417
|
+
class: M([i.value]),
|
|
2418
|
+
name: s.icon
|
|
2419
|
+
}, null, 8, ["class", "name"])
|
|
2420
|
+
], 2)
|
|
2421
|
+
]));
|
|
2422
|
+
}
|
|
2423
|
+
}), Yo = { class: "sr-only" }, pa = /* @__PURE__ */ _({
|
|
2424
|
+
__name: "Switch",
|
|
2425
|
+
props: {
|
|
2426
|
+
id: { default: Ct() },
|
|
2427
|
+
label: {},
|
|
2428
|
+
modelValue: { type: Boolean },
|
|
2429
|
+
description: {},
|
|
2430
|
+
onLabel: { default: "on" },
|
|
2431
|
+
offLabel: { default: "off" }
|
|
2432
|
+
},
|
|
2433
|
+
emits: ["update:modelValue", "change"],
|
|
2434
|
+
setup(e, { emit: t }) {
|
|
2435
|
+
const o = t, r = (n) => {
|
|
2436
|
+
o("update:modelValue", n), o("change", n);
|
|
2437
|
+
};
|
|
2438
|
+
return (n, a) => (E(), H(I(Hr), {
|
|
2439
|
+
modelValue: n.modelValue,
|
|
2440
|
+
label: n.label,
|
|
2441
|
+
class: M([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"]),
|
|
2442
|
+
"onUpdate:modelValue": r
|
|
2443
|
+
}, {
|
|
2444
|
+
default: U(() => [
|
|
2445
|
+
T("span", {
|
|
2446
|
+
class: M(["absolute text-xs text-center text-white inset-x-2", n.modelValue ? "pr-3" : "pl-3"])
|
|
2447
|
+
}, N(n.modelValue === !0 ? n.onLabel : n.offLabel), 3),
|
|
2448
|
+
T("span", Yo, N(n.label), 1),
|
|
2449
|
+
T("span", {
|
|
2450
|
+
class: M([n.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
|
|
2451
|
+
}, null, 2)
|
|
2452
|
+
]),
|
|
2453
|
+
_: 1
|
|
2454
|
+
}, 8, ["modelValue", "label", "class"]));
|
|
2455
|
+
}
|
|
2456
|
+
}), Zo = { class: "relative" }, Qo = ["tabindex", "value"], Jo = {
|
|
2457
|
+
inheritAttrs: !1
|
|
2458
|
+
}, va = /* @__PURE__ */ _({
|
|
2459
|
+
...Jo,
|
|
2460
|
+
__name: "Textarea",
|
|
2461
|
+
props: {
|
|
2462
|
+
modelValue: {},
|
|
2463
|
+
size: { default: "medium" },
|
|
2464
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
2465
|
+
block: { type: Boolean }
|
|
2466
|
+
},
|
|
2467
|
+
emits: ["update:modelValue"],
|
|
2468
|
+
setup(e, { expose: t, emit: o }) {
|
|
2469
|
+
const r = e, n = o, { inputClasses: a, disabledClasses: i, textSizeClasses: u } = He(r), c = function(m) {
|
|
2470
|
+
n("update:modelValue", (m == null ? void 0 : m.target).value);
|
|
2471
|
+
}, s = O(null);
|
|
2472
|
+
return t({
|
|
2473
|
+
focus: () => {
|
|
2474
|
+
r.isDisabled || s.value.focus();
|
|
2475
|
+
}
|
|
2476
|
+
}), (m, v) => (E(), R("div", Zo, [
|
|
2477
|
+
T("textarea", ze({
|
|
2478
|
+
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", [I(a), I(u), I(i)]],
|
|
2479
|
+
tabindex: m.isDisabled ? "-1" : void 0,
|
|
2480
|
+
value: m.modelValue ?? ""
|
|
2481
|
+
}, m.$attrs, {
|
|
2482
|
+
ref_key: "input",
|
|
2483
|
+
ref: s,
|
|
2484
|
+
cols: "56",
|
|
2485
|
+
rows: "8",
|
|
2486
|
+
onInput: c
|
|
2487
|
+
}), `
|
|
2488
|
+
`, 16, Qo)
|
|
2489
|
+
]));
|
|
2490
|
+
}
|
|
2491
|
+
});
|
|
2492
|
+
export {
|
|
2493
|
+
ra as D9Button,
|
|
2494
|
+
oa as D9Checkbox,
|
|
2495
|
+
z as D9Icon,
|
|
2496
|
+
aa as D9Input,
|
|
2497
|
+
la as D9Label,
|
|
2498
|
+
ia as D9Menu,
|
|
2499
|
+
sa as D9MenuLink,
|
|
2500
|
+
ua as D9Select,
|
|
2501
|
+
ca as D9Skeleton,
|
|
2502
|
+
da as D9Spinner,
|
|
2503
|
+
fa as D9SplitButton,
|
|
2504
|
+
pa as D9Switch,
|
|
2505
|
+
va as D9Textarea,
|
|
2506
|
+
ot as brands,
|
|
2507
|
+
wn as icons
|
|
2508
|
+
};
|