@robuust-digital/vue-components 1.1.0-rc.0 → 1.1.1
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/style.css +1 -1
- package/dist/tailwind/components/alert.js +188 -0
- package/dist/tailwind/components/button.js +10 -32
- package/dist/tailwind/index.js +2 -0
- package/dist/vue-components.es.js +617 -536
- package/dist/vue-components.umd.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
import * as _e from "vue";
|
|
2
|
-
import { openBlock as
|
|
3
|
-
|
|
2
|
+
import { openBlock as P, createElementBlock as fe, createElementVNode as $, createBlock as Y, resolveDynamicComponent as de, normalizeClass as le, withCtx as V, renderSlot as k, createCommentVNode as J, toDisplayString as ce, createVNode as q, unref as R, createTextVNode as Oe, watchEffect as x, mergeProps as Ct, ref as h, computed as m, cloneVNode as Dt, h as S, Fragment as ot, defineComponent as T, inject as B, provide as H, onMounted as L, onUnmounted as N, watch as re, shallowRef as kt, getCurrentInstance as xt, Teleport as Bt, reactive as Nt, nextTick as jt, withModifiers as Mt } from "vue";
|
|
3
|
+
function it(e, t) {
|
|
4
|
+
return P(), fe("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
"data-slot": "icon"
|
|
10
|
+
}, [
|
|
11
|
+
$("path", {
|
|
12
|
+
"fill-rule": "evenodd",
|
|
13
|
+
d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
|
|
14
|
+
"clip-rule": "evenodd"
|
|
15
|
+
})
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
const Rt = { class: "alert-title" }, Zn = {
|
|
19
|
+
__name: "Alert",
|
|
20
|
+
props: {
|
|
21
|
+
as: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "div"
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
icon: {
|
|
30
|
+
type: [Object, Function],
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "default",
|
|
36
|
+
validator: (e) => ["success", "warning", "danger", "default"].includes(e)
|
|
37
|
+
},
|
|
38
|
+
close: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
emits: ["alert:close"],
|
|
44
|
+
setup(e) {
|
|
45
|
+
return (t, n) => (P(), Y(de(e.as), {
|
|
46
|
+
class: le(["alert", `alert-${e.type}`])
|
|
47
|
+
}, {
|
|
48
|
+
default: V(() => [
|
|
49
|
+
k(t.$slots, "icon", {}, () => [
|
|
50
|
+
e.icon ? (P(), Y(de(e.icon), {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: "alert-icon"
|
|
53
|
+
})) : J("", !0)
|
|
54
|
+
]),
|
|
55
|
+
$("div", null, [
|
|
56
|
+
k(t.$slots, "title", {}, () => [
|
|
57
|
+
$("span", Rt, ce(e.title), 1)
|
|
58
|
+
]),
|
|
59
|
+
k(t.$slots, "default")
|
|
60
|
+
]),
|
|
61
|
+
k(t.$slots, "close", {}, () => [
|
|
62
|
+
e.close ? (P(), fe("button", {
|
|
63
|
+
key: 0,
|
|
64
|
+
type: "button",
|
|
65
|
+
class: "alert-close rvc-transition-colors",
|
|
66
|
+
onClick: n[0] || (n[0] = (l) => t.$emit("alert:close"))
|
|
67
|
+
}, [
|
|
68
|
+
q(R(it), { class: "rvc-size-5" })
|
|
69
|
+
])) : J("", !0)
|
|
70
|
+
])
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
}, 8, ["class"]));
|
|
74
|
+
}
|
|
75
|
+
}, ut = (e) => typeof e != "string" ? !1 : /^(primary|secondary|tertiary|light|dark|danger|warning|success)(-soft)?$/.test(e) || e.startsWith("custom-") || e === "clear", Jn = {
|
|
4
76
|
__name: "Badge",
|
|
5
77
|
props: {
|
|
6
78
|
as: {
|
|
@@ -19,29 +91,29 @@ const it = (e) => typeof e != "string" ? !1 : /^(primary|secondary|tertiary|ligh
|
|
|
19
91
|
color: {
|
|
20
92
|
type: String,
|
|
21
93
|
default: "primary",
|
|
22
|
-
validator: (e) =>
|
|
94
|
+
validator: (e) => ut(e)
|
|
23
95
|
}
|
|
24
96
|
},
|
|
25
97
|
setup(e) {
|
|
26
|
-
return (t, n) => (
|
|
27
|
-
class:
|
|
98
|
+
return (t, n) => (P(), Y(de(e.as), {
|
|
99
|
+
class: le(["badge", `badge-${e.color}`, `badge-${e.size}`])
|
|
28
100
|
}, {
|
|
29
|
-
default:
|
|
30
|
-
|
|
31
|
-
|
|
101
|
+
default: V(() => [
|
|
102
|
+
k(t.$slots, "default", { label: e.label }, () => [
|
|
103
|
+
Oe(ce(e.label), 1)
|
|
32
104
|
])
|
|
33
105
|
]),
|
|
34
106
|
_: 3
|
|
35
107
|
}, 8, ["class"]));
|
|
36
108
|
}
|
|
37
|
-
},
|
|
109
|
+
}, Ht = {
|
|
38
110
|
xmlns: "http://www.w3.org/2000/svg",
|
|
39
111
|
fill: "none",
|
|
40
112
|
viewBox: "0 0 24 24"
|
|
41
113
|
};
|
|
42
|
-
function
|
|
43
|
-
return
|
|
44
|
-
|
|
114
|
+
function It(e, t) {
|
|
115
|
+
return P(), fe("svg", Ht, t[0] || (t[0] = [
|
|
116
|
+
$("circle", {
|
|
45
117
|
cx: "12",
|
|
46
118
|
cy: "12",
|
|
47
119
|
r: "10",
|
|
@@ -49,13 +121,16 @@ function Rt(e, t) {
|
|
|
49
121
|
"stroke-width": "4",
|
|
50
122
|
style: { opacity: ".25" }
|
|
51
123
|
}, null, -1),
|
|
52
|
-
|
|
124
|
+
$("path", {
|
|
53
125
|
fill: "currentColor",
|
|
54
126
|
d: "M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z"
|
|
55
127
|
}, null, -1)
|
|
56
128
|
]));
|
|
57
129
|
}
|
|
58
|
-
const
|
|
130
|
+
const Ut = { render: It }, Wt = {
|
|
131
|
+
key: 0,
|
|
132
|
+
class: "rvc-sr-only"
|
|
133
|
+
}, et = {
|
|
59
134
|
__name: "ButtonBase",
|
|
60
135
|
props: {
|
|
61
136
|
as: {
|
|
@@ -74,13 +149,17 @@ const Ht = { render: Rt }, et = {
|
|
|
74
149
|
type: [Object, Function],
|
|
75
150
|
default: null
|
|
76
151
|
},
|
|
152
|
+
iconOnly: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: !1
|
|
155
|
+
},
|
|
77
156
|
iconLeft: {
|
|
78
157
|
type: Boolean
|
|
79
158
|
},
|
|
80
159
|
size: {
|
|
81
160
|
type: String,
|
|
82
161
|
default: "base",
|
|
83
|
-
validator: (e) => ["
|
|
162
|
+
validator: (e) => ["sm", "base"].includes(e)
|
|
84
163
|
},
|
|
85
164
|
spinning: {
|
|
86
165
|
type: Boolean
|
|
@@ -88,30 +167,46 @@ const Ht = { render: Rt }, et = {
|
|
|
88
167
|
color: {
|
|
89
168
|
type: String,
|
|
90
169
|
default: "primary",
|
|
91
|
-
validator: (e) =>
|
|
170
|
+
validator: (e) => ut(e)
|
|
92
171
|
}
|
|
93
172
|
},
|
|
94
173
|
setup(e) {
|
|
95
|
-
|
|
96
|
-
|
|
174
|
+
const t = e;
|
|
175
|
+
return x(() => {
|
|
176
|
+
t.iconOnly && !t.icon && console.warn("[ButtonBase] Using iconOnly prop without providing an icon may result in an empty button.");
|
|
177
|
+
}), (n, l) => (P(), Y(de(e.as), Ct(e.bindAs ? { as: e.bindAs } : {}, {
|
|
178
|
+
class: ["button", `button-${e.color}`, `button-${e.size}`, { "button-reverse": e.iconLeft }, { "button-icon-only": e.iconOnly }],
|
|
179
|
+
"aria-label": e.iconOnly ? e.label : null,
|
|
180
|
+
"aria-busy": e.spinning
|
|
97
181
|
}), {
|
|
98
|
-
default:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
182
|
+
default: V(() => [
|
|
183
|
+
e.iconOnly && e.label ? (P(), fe("span", Wt, [
|
|
184
|
+
k(n.$slots, "default", { label: e.label }, () => [
|
|
185
|
+
Oe(ce(e.label), 1)
|
|
186
|
+
])
|
|
187
|
+
])) : e.label ? k(n.$slots, "default", {
|
|
188
|
+
key: 1,
|
|
189
|
+
label: e.label
|
|
190
|
+
}, () => [
|
|
191
|
+
Oe(ce(e.label), 1)
|
|
192
|
+
]) : J("", !0),
|
|
193
|
+
k(n.$slots, "icon", { icon: e.icon }, () => [
|
|
194
|
+
e.icon && !e.spinning ? (P(), Y(de(e.icon), {
|
|
102
195
|
key: 0,
|
|
103
|
-
class: "button-icon"
|
|
104
|
-
|
|
196
|
+
class: "button-icon",
|
|
197
|
+
"aria-hidden": !e.iconOnly
|
|
198
|
+
}, null, 8, ["aria-hidden"])) : J("", !0)
|
|
105
199
|
]),
|
|
106
|
-
|
|
107
|
-
e.spinning ? (
|
|
200
|
+
k(n.$slots, "spinner", { spinning: e.spinning }, () => [
|
|
201
|
+
e.spinning ? (P(), Y(R(Ut), {
|
|
108
202
|
key: 0,
|
|
109
|
-
class: "button-icon button-icon-loading"
|
|
110
|
-
|
|
203
|
+
class: "button-icon button-icon-loading",
|
|
204
|
+
"aria-hidden": "true"
|
|
205
|
+
})) : J("", !0)
|
|
111
206
|
])
|
|
112
207
|
]),
|
|
113
208
|
_: 3
|
|
114
|
-
}, 16, ["class"]));
|
|
209
|
+
}, 16, ["class", "aria-label", "aria-busy"]));
|
|
115
210
|
}
|
|
116
211
|
};
|
|
117
212
|
function Ge(e) {
|
|
@@ -119,38 +214,38 @@ function Ge(e) {
|
|
|
119
214
|
throw t;
|
|
120
215
|
}));
|
|
121
216
|
}
|
|
122
|
-
function
|
|
123
|
-
let e = [], t = { addEventListener(n,
|
|
124
|
-
return n.addEventListener(
|
|
217
|
+
function ve() {
|
|
218
|
+
let e = [], t = { addEventListener(n, l, r, a) {
|
|
219
|
+
return n.addEventListener(l, r, a), t.add(() => n.removeEventListener(l, r, a));
|
|
125
220
|
}, requestAnimationFrame(...n) {
|
|
126
|
-
let
|
|
127
|
-
t.add(() => cancelAnimationFrame(
|
|
221
|
+
let l = requestAnimationFrame(...n);
|
|
222
|
+
t.add(() => cancelAnimationFrame(l));
|
|
128
223
|
}, nextFrame(...n) {
|
|
129
224
|
t.requestAnimationFrame(() => {
|
|
130
225
|
t.requestAnimationFrame(...n);
|
|
131
226
|
});
|
|
132
227
|
}, setTimeout(...n) {
|
|
133
|
-
let
|
|
134
|
-
t.add(() => clearTimeout(
|
|
228
|
+
let l = setTimeout(...n);
|
|
229
|
+
t.add(() => clearTimeout(l));
|
|
135
230
|
}, microTask(...n) {
|
|
136
|
-
let
|
|
231
|
+
let l = { current: !0 };
|
|
137
232
|
return Ge(() => {
|
|
138
|
-
|
|
233
|
+
l.current && n[0]();
|
|
139
234
|
}), t.add(() => {
|
|
140
|
-
|
|
235
|
+
l.current = !1;
|
|
141
236
|
});
|
|
142
|
-
}, style(n,
|
|
143
|
-
let a = n.style.getPropertyValue(
|
|
144
|
-
return Object.assign(n.style, { [
|
|
145
|
-
Object.assign(n.style, { [
|
|
237
|
+
}, style(n, l, r) {
|
|
238
|
+
let a = n.style.getPropertyValue(l);
|
|
239
|
+
return Object.assign(n.style, { [l]: r }), this.add(() => {
|
|
240
|
+
Object.assign(n.style, { [l]: a });
|
|
146
241
|
});
|
|
147
242
|
}, group(n) {
|
|
148
|
-
let
|
|
149
|
-
return n(
|
|
243
|
+
let l = ve();
|
|
244
|
+
return n(l), this.add(() => l.dispose());
|
|
150
245
|
}, add(n) {
|
|
151
246
|
return e.push(n), () => {
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
247
|
+
let l = e.indexOf(n);
|
|
248
|
+
if (l >= 0) for (let r of e.splice(l, 1)) r();
|
|
154
249
|
};
|
|
155
250
|
}, dispose() {
|
|
156
251
|
for (let n of e.splice(0)) n();
|
|
@@ -158,9 +253,9 @@ function se() {
|
|
|
158
253
|
return t;
|
|
159
254
|
}
|
|
160
255
|
var tt;
|
|
161
|
-
let
|
|
162
|
-
const
|
|
163
|
-
return _e.inject(
|
|
256
|
+
let Vt = Symbol("headlessui.useid"), qt = 0;
|
|
257
|
+
const ee = (tt = _e.useId) != null ? tt : function() {
|
|
258
|
+
return _e.inject(Vt, () => `${++qt}`)();
|
|
164
259
|
};
|
|
165
260
|
function E(e) {
|
|
166
261
|
var t;
|
|
@@ -168,16 +263,16 @@ function E(e) {
|
|
|
168
263
|
let n = (t = e.value.$el) != null ? t : e.value;
|
|
169
264
|
return n instanceof Node ? n : null;
|
|
170
265
|
}
|
|
171
|
-
function
|
|
266
|
+
function I(e, t, ...n) {
|
|
172
267
|
if (e in t) {
|
|
173
|
-
let
|
|
174
|
-
return typeof
|
|
268
|
+
let r = t[e];
|
|
269
|
+
return typeof r == "function" ? r(...n) : r;
|
|
175
270
|
}
|
|
176
|
-
let
|
|
177
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
271
|
+
let l = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((r) => `"${r}"`).join(", ")}.`);
|
|
272
|
+
throw Error.captureStackTrace && Error.captureStackTrace(l, I), l;
|
|
178
273
|
}
|
|
179
|
-
var
|
|
180
|
-
let
|
|
274
|
+
var zt = Object.defineProperty, Gt = (e, t, n) => t in e ? zt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nt = (e, t, n) => (Gt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
275
|
+
let Yt = class {
|
|
181
276
|
constructor() {
|
|
182
277
|
nt(this, "current", this.detect()), nt(this, "currentId", 0);
|
|
183
278
|
}
|
|
@@ -199,9 +294,9 @@ let qt = class {
|
|
|
199
294
|
detect() {
|
|
200
295
|
return typeof window > "u" || typeof document > "u" ? "server" : "client";
|
|
201
296
|
}
|
|
202
|
-
},
|
|
203
|
-
function
|
|
204
|
-
if (
|
|
297
|
+
}, pe = new Yt();
|
|
298
|
+
function ae(e) {
|
|
299
|
+
if (pe.isServer) return null;
|
|
205
300
|
if (e instanceof Node) return e.ownerDocument;
|
|
206
301
|
if (e != null && e.hasOwnProperty("value")) {
|
|
207
302
|
let t = E(e);
|
|
@@ -209,59 +304,59 @@ function re(e) {
|
|
|
209
304
|
}
|
|
210
305
|
return document;
|
|
211
306
|
}
|
|
212
|
-
let
|
|
213
|
-
var
|
|
214
|
-
function
|
|
215
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
307
|
+
let Me = ["[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(",");
|
|
308
|
+
var z = ((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))(z || {}), st = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(st || {}), Kt = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Kt || {});
|
|
309
|
+
function Xt(e = document.body) {
|
|
310
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Me)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
216
311
|
}
|
|
217
|
-
var
|
|
218
|
-
function
|
|
312
|
+
var dt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(dt || {});
|
|
313
|
+
function Qt(e, t = 0) {
|
|
219
314
|
var n;
|
|
220
|
-
return e === ((n =
|
|
221
|
-
return e.matches(
|
|
315
|
+
return e === ((n = ae(e)) == null ? void 0 : n.body) ? !1 : I(t, { 0() {
|
|
316
|
+
return e.matches(Me);
|
|
222
317
|
}, 1() {
|
|
223
|
-
let
|
|
224
|
-
for (;
|
|
225
|
-
if (
|
|
226
|
-
|
|
318
|
+
let l = e;
|
|
319
|
+
for (; l !== null; ) {
|
|
320
|
+
if (l.matches(Me)) return !0;
|
|
321
|
+
l = l.parentElement;
|
|
227
322
|
}
|
|
228
323
|
return !1;
|
|
229
324
|
} });
|
|
230
325
|
}
|
|
231
|
-
var
|
|
326
|
+
var Zt = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Zt || {});
|
|
232
327
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
233
328
|
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
234
329
|
}, !0), document.addEventListener("click", (e) => {
|
|
235
330
|
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
236
331
|
}, !0));
|
|
237
|
-
function
|
|
332
|
+
function _(e) {
|
|
238
333
|
e == null || e.focus({ preventScroll: !0 });
|
|
239
334
|
}
|
|
240
|
-
let
|
|
241
|
-
function
|
|
335
|
+
let Jt = ["textarea", "input"].join(",");
|
|
336
|
+
function _t(e) {
|
|
242
337
|
var t, n;
|
|
243
|
-
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e,
|
|
338
|
+
return (n = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Jt)) != null ? n : !1;
|
|
244
339
|
}
|
|
245
|
-
function
|
|
246
|
-
return e.slice().sort((n,
|
|
247
|
-
let
|
|
248
|
-
if (
|
|
249
|
-
let i =
|
|
340
|
+
function en(e, t = (n) => n) {
|
|
341
|
+
return e.slice().sort((n, l) => {
|
|
342
|
+
let r = t(n), a = t(l);
|
|
343
|
+
if (r === null || a === null) return 0;
|
|
344
|
+
let i = r.compareDocumentPosition(a);
|
|
250
345
|
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
251
346
|
});
|
|
252
347
|
}
|
|
253
|
-
function
|
|
348
|
+
function Te(e, t, { sorted: n = !0, relativeTo: l = null, skipElements: r = [] } = {}) {
|
|
254
349
|
var a;
|
|
255
|
-
let i = (a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? a : document, o = Array.isArray(e) ? n ?
|
|
256
|
-
|
|
350
|
+
let i = (a = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? a : document, o = Array.isArray(e) ? n ? en(e) : e : Xt(e);
|
|
351
|
+
r.length > 0 && o.length > 1 && (o = o.filter((v) => !r.includes(v))), l = l ?? i.activeElement;
|
|
257
352
|
let u = (() => {
|
|
258
353
|
if (t & 5) return 1;
|
|
259
354
|
if (t & 10) return -1;
|
|
260
355
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
261
356
|
})(), d = (() => {
|
|
262
357
|
if (t & 1) return 0;
|
|
263
|
-
if (t & 2) return Math.max(0, o.indexOf(
|
|
264
|
-
if (t & 4) return Math.max(0, o.indexOf(
|
|
358
|
+
if (t & 2) return Math.max(0, o.indexOf(l)) - 1;
|
|
359
|
+
if (t & 4) return Math.max(0, o.indexOf(l)) + 1;
|
|
265
360
|
if (t & 8) return o.length - 1;
|
|
266
361
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
267
362
|
})(), s = t & 32 ? { preventScroll: !0 } : {}, f = 0, c = o.length, p;
|
|
@@ -275,29 +370,29 @@ function Ee(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] }
|
|
|
275
370
|
}
|
|
276
371
|
p = o[v], p == null || p.focus(s), f += u;
|
|
277
372
|
} while (p !== i.activeElement);
|
|
278
|
-
return t & 6 &&
|
|
373
|
+
return t & 6 && _t(p) && p.select(), 2;
|
|
279
374
|
}
|
|
280
|
-
function
|
|
375
|
+
function ct() {
|
|
281
376
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
282
377
|
}
|
|
283
|
-
function
|
|
378
|
+
function tn() {
|
|
284
379
|
return /Android/gi.test(window.navigator.userAgent);
|
|
285
380
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
381
|
+
function nn() {
|
|
382
|
+
return ct() || tn();
|
|
288
383
|
}
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
document.addEventListener(e, t, n),
|
|
384
|
+
function Se(e, t, n) {
|
|
385
|
+
pe.isServer || x((l) => {
|
|
386
|
+
document.addEventListener(e, t, n), l(() => document.removeEventListener(e, t, n));
|
|
292
387
|
});
|
|
293
388
|
}
|
|
294
|
-
function
|
|
295
|
-
|
|
296
|
-
window.addEventListener(e, t, n),
|
|
389
|
+
function ft(e, t, n) {
|
|
390
|
+
pe.isServer || x((l) => {
|
|
391
|
+
window.addEventListener(e, t, n), l(() => window.removeEventListener(e, t, n));
|
|
297
392
|
});
|
|
298
393
|
}
|
|
299
|
-
function
|
|
300
|
-
function
|
|
394
|
+
function ln(e, t, n = m(() => !0)) {
|
|
395
|
+
function l(a, i) {
|
|
301
396
|
if (!n.value || a.defaultPrevented) return;
|
|
302
397
|
let o = i(a);
|
|
303
398
|
if (o === null || !o.getRootNode().contains(o)) return;
|
|
@@ -309,50 +404,50 @@ function en(e, t, n = m(() => !0)) {
|
|
|
309
404
|
let s = d instanceof HTMLElement ? d : E(d);
|
|
310
405
|
if (s != null && s.contains(o) || a.composed && a.composedPath().includes(s)) return;
|
|
311
406
|
}
|
|
312
|
-
return !
|
|
407
|
+
return !Qt(o, dt.Loose) && o.tabIndex !== -1 && a.preventDefault(), t(a, o);
|
|
313
408
|
}
|
|
314
|
-
let
|
|
315
|
-
|
|
409
|
+
let r = h(null);
|
|
410
|
+
Se("pointerdown", (a) => {
|
|
316
411
|
var i, o;
|
|
317
|
-
n.value && (
|
|
318
|
-
}, !0),
|
|
412
|
+
n.value && (r.value = ((o = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : o[0]) || a.target);
|
|
413
|
+
}, !0), Se("mousedown", (a) => {
|
|
319
414
|
var i, o;
|
|
320
|
-
n.value && (
|
|
321
|
-
}, !0),
|
|
322
|
-
|
|
323
|
-
}, !0),
|
|
415
|
+
n.value && (r.value = ((o = (i = a.composedPath) == null ? void 0 : i.call(a)) == null ? void 0 : o[0]) || a.target);
|
|
416
|
+
}, !0), Se("click", (a) => {
|
|
417
|
+
nn() || r.value && (l(a, () => r.value), r.value = null);
|
|
418
|
+
}, !0), Se("touchend", (a) => l(a, () => a.target instanceof HTMLElement ? a.target : null), !0), ft("blur", (a) => l(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
324
419
|
}
|
|
325
|
-
var
|
|
326
|
-
function
|
|
420
|
+
var Fe = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Fe || {}), G = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(G || {});
|
|
421
|
+
function A({ visible: e = !0, features: t = 0, ourProps: n, theirProps: l, ...r }) {
|
|
327
422
|
var a;
|
|
328
|
-
let i =
|
|
329
|
-
if (e || t & 2 && i.static) return
|
|
423
|
+
let i = pt(l, n), o = Object.assign(r, { props: i });
|
|
424
|
+
if (e || t & 2 && i.static) return Be(o);
|
|
330
425
|
if (t & 1) {
|
|
331
426
|
let u = (a = i.unmount) == null || a ? 0 : 1;
|
|
332
|
-
return
|
|
427
|
+
return I(u, { 0() {
|
|
333
428
|
return null;
|
|
334
429
|
}, 1() {
|
|
335
|
-
return
|
|
430
|
+
return Be({ ...r, props: { ...i, hidden: !0, style: { display: "none" } } });
|
|
336
431
|
} });
|
|
337
432
|
}
|
|
338
|
-
return
|
|
433
|
+
return Be(o);
|
|
339
434
|
}
|
|
340
|
-
function
|
|
435
|
+
function Be({ props: e, attrs: t, slots: n, slot: l, name: r }) {
|
|
341
436
|
var a, i;
|
|
342
|
-
let { as: o, ...u } =
|
|
343
|
-
if (
|
|
437
|
+
let { as: o, ...u } = mt(e, ["unmount", "static"]), d = (a = n.default) == null ? void 0 : a.call(n, l), s = {};
|
|
438
|
+
if (l) {
|
|
344
439
|
let f = !1, c = [];
|
|
345
|
-
for (let [p, v] of Object.entries(
|
|
440
|
+
for (let [p, v] of Object.entries(l)) typeof v == "boolean" && (f = !0), v === !0 && c.push(p);
|
|
346
441
|
f && (s["data-headlessui-state"] = c.join(" "));
|
|
347
442
|
}
|
|
348
443
|
if (o === "template") {
|
|
349
|
-
if (d =
|
|
444
|
+
if (d = vt(d ?? []), Object.keys(u).length > 0 || Object.keys(t).length > 0) {
|
|
350
445
|
let [f, ...c] = d ?? [];
|
|
351
|
-
if (!
|
|
446
|
+
if (!rn(f) || c.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${r} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(u).concat(Object.keys(t)).map((g) => g.trim()).filter((g, b, j) => j.indexOf(g) === b).sort((g, b) => g.localeCompare(b)).map((g) => ` - ${g}`).join(`
|
|
352
447
|
`), "", "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((g) => ` - ${g}`).join(`
|
|
353
448
|
`)].join(`
|
|
354
449
|
`));
|
|
355
|
-
let p =
|
|
450
|
+
let p = pt((i = f.props) != null ? i : {}, u, s), v = Dt(f, p, !0);
|
|
356
451
|
for (let g in p) g.startsWith("on") && (v.props || (v.props = {}), v.props[g] = p[g]);
|
|
357
452
|
return v;
|
|
358
453
|
}
|
|
@@ -360,102 +455,102 @@ function Ae({ props: e, attrs: t, slots: n, slot: r, name: l }) {
|
|
|
360
455
|
}
|
|
361
456
|
return S(o, Object.assign({}, u, s), { default: () => d });
|
|
362
457
|
}
|
|
363
|
-
function
|
|
364
|
-
return e.flatMap((t) => t.type === ot ?
|
|
458
|
+
function vt(e) {
|
|
459
|
+
return e.flatMap((t) => t.type === ot ? vt(t.children) : [t]);
|
|
365
460
|
}
|
|
366
|
-
function
|
|
461
|
+
function pt(...e) {
|
|
367
462
|
if (e.length === 0) return {};
|
|
368
463
|
if (e.length === 1) return e[0];
|
|
369
464
|
let t = {}, n = {};
|
|
370
|
-
for (let
|
|
371
|
-
if (t.disabled || t["aria-disabled"]) return Object.assign(t, Object.fromEntries(Object.keys(n).map((
|
|
372
|
-
for (let
|
|
373
|
-
let i = n[
|
|
465
|
+
for (let l of e) for (let r in l) r.startsWith("on") && typeof l[r] == "function" ? (n[r] != null || (n[r] = []), n[r].push(l[r])) : t[r] = l[r];
|
|
466
|
+
if (t.disabled || t["aria-disabled"]) return Object.assign(t, Object.fromEntries(Object.keys(n).map((l) => [l, void 0])));
|
|
467
|
+
for (let l in n) Object.assign(t, { [l](r, ...a) {
|
|
468
|
+
let i = n[l];
|
|
374
469
|
for (let o of i) {
|
|
375
|
-
if (
|
|
376
|
-
o(
|
|
470
|
+
if (r instanceof Event && r.defaultPrevented) return;
|
|
471
|
+
o(r, ...a);
|
|
377
472
|
}
|
|
378
473
|
} });
|
|
379
474
|
return t;
|
|
380
475
|
}
|
|
381
|
-
function
|
|
476
|
+
function mt(e, t = []) {
|
|
382
477
|
let n = Object.assign({}, e);
|
|
383
|
-
for (let
|
|
478
|
+
for (let l of t) l in n && delete n[l];
|
|
384
479
|
return n;
|
|
385
480
|
}
|
|
386
|
-
function
|
|
481
|
+
function rn(e) {
|
|
387
482
|
return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
|
|
388
483
|
}
|
|
389
|
-
var
|
|
390
|
-
let
|
|
484
|
+
var Pe = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Pe || {});
|
|
485
|
+
let Re = T({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: t, attrs: n }) {
|
|
391
486
|
return () => {
|
|
392
|
-
var
|
|
393
|
-
let { features:
|
|
394
|
-
return
|
|
487
|
+
var l;
|
|
488
|
+
let { features: r, ...a } = e, i = { "aria-hidden": (r & 2) === 2 ? !0 : (l = a["aria-hidden"]) != null ? l : void 0, hidden: (r & 4) === 4 ? !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" } } };
|
|
489
|
+
return A({ ourProps: i, theirProps: a, slot: {}, attrs: n, slots: t, name: "Hidden" });
|
|
395
490
|
};
|
|
396
|
-
} }),
|
|
397
|
-
var
|
|
398
|
-
function
|
|
491
|
+
} }), gt = Symbol("Context");
|
|
492
|
+
var F = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(F || {});
|
|
493
|
+
function an() {
|
|
399
494
|
return Ye() !== null;
|
|
400
495
|
}
|
|
401
496
|
function Ye() {
|
|
402
|
-
return
|
|
497
|
+
return B(gt, null);
|
|
403
498
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
499
|
+
function on(e) {
|
|
500
|
+
H(gt, e);
|
|
406
501
|
}
|
|
407
|
-
var
|
|
408
|
-
function
|
|
502
|
+
var ht = ((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))(ht || {});
|
|
503
|
+
function un(e) {
|
|
409
504
|
function t() {
|
|
410
505
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
411
506
|
}
|
|
412
507
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
413
508
|
}
|
|
414
|
-
let
|
|
415
|
-
|
|
509
|
+
let Q = [];
|
|
510
|
+
un(() => {
|
|
416
511
|
function e(t) {
|
|
417
|
-
t.target instanceof HTMLElement && t.target !== document.body &&
|
|
512
|
+
t.target instanceof HTMLElement && t.target !== document.body && Q[0] !== t.target && (Q.unshift(t.target), Q = Q.filter((n) => n != null && n.isConnected), Q.splice(10));
|
|
418
513
|
}
|
|
419
514
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
420
515
|
});
|
|
421
|
-
function
|
|
422
|
-
|
|
423
|
-
e = e ?? window, e.addEventListener(t, n,
|
|
516
|
+
function yt(e, t, n, l) {
|
|
517
|
+
pe.isServer || x((r) => {
|
|
518
|
+
e = e ?? window, e.addEventListener(t, n, l), r(() => e.removeEventListener(t, n, l));
|
|
424
519
|
});
|
|
425
520
|
}
|
|
426
|
-
var
|
|
427
|
-
function
|
|
521
|
+
var se = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(se || {});
|
|
522
|
+
function sn() {
|
|
428
523
|
let e = h(0);
|
|
429
|
-
return
|
|
524
|
+
return ft("keydown", (t) => {
|
|
430
525
|
t.key === "Tab" && (e.value = t.shiftKey ? 1 : 0);
|
|
431
526
|
}), e;
|
|
432
527
|
}
|
|
433
|
-
function
|
|
528
|
+
function bt(e) {
|
|
434
529
|
if (!e) return /* @__PURE__ */ new Set();
|
|
435
530
|
if (typeof e == "function") return new Set(e());
|
|
436
531
|
let t = /* @__PURE__ */ new Set();
|
|
437
532
|
for (let n of e.value) {
|
|
438
|
-
let
|
|
439
|
-
|
|
533
|
+
let l = E(n);
|
|
534
|
+
l instanceof HTMLElement && t.add(l);
|
|
440
535
|
}
|
|
441
536
|
return t;
|
|
442
537
|
}
|
|
443
|
-
var
|
|
444
|
-
let
|
|
445
|
-
let
|
|
446
|
-
|
|
447
|
-
let a = m(() =>
|
|
448
|
-
|
|
449
|
-
let o =
|
|
450
|
-
|
|
451
|
-
let u =
|
|
538
|
+
var wt = ((e) => (e[e.None = 1] = "None", e[e.InitialFocus = 2] = "InitialFocus", e[e.TabLock = 4] = "TabLock", e[e.FocusLock = 8] = "FocusLock", e[e.RestoreFocus = 16] = "RestoreFocus", e[e.All = 30] = "All", e))(wt || {});
|
|
539
|
+
let ie = Object.assign(T({ name: "FocusTrap", props: { as: { type: [Object, String], default: "div" }, initialFocus: { type: Object, default: null }, features: { type: Number, default: 30 }, containers: { type: [Object, Function], default: h(/* @__PURE__ */ new Set()) } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: l }) {
|
|
540
|
+
let r = h(null);
|
|
541
|
+
l({ el: r, $el: r });
|
|
542
|
+
let a = m(() => ae(r)), i = h(!1);
|
|
543
|
+
L(() => i.value = !0), N(() => i.value = !1), cn({ ownerDocument: a }, m(() => i.value && !!(e.features & 16)));
|
|
544
|
+
let o = fn({ ownerDocument: a, container: r, initialFocus: m(() => e.initialFocus) }, m(() => i.value && !!(e.features & 2)));
|
|
545
|
+
vn({ ownerDocument: a, container: r, containers: e.containers, previousActiveElement: o }, m(() => i.value && !!(e.features & 8)));
|
|
546
|
+
let u = sn();
|
|
452
547
|
function d(p) {
|
|
453
|
-
let v = E(
|
|
548
|
+
let v = E(r);
|
|
454
549
|
v && ((g) => g())(() => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
}, [
|
|
458
|
-
|
|
550
|
+
I(u.value, { [se.Forwards]: () => {
|
|
551
|
+
Te(v, z.First, { skipElements: [p.relatedTarget] });
|
|
552
|
+
}, [se.Backwards]: () => {
|
|
553
|
+
Te(v, z.Last, { skipElements: [p.relatedTarget] });
|
|
459
554
|
} });
|
|
460
555
|
});
|
|
461
556
|
}
|
|
@@ -467,43 +562,43 @@ let ae = Object.assign(T({ name: "FocusTrap", props: { as: { type: [Object, Stri
|
|
|
467
562
|
}
|
|
468
563
|
function c(p) {
|
|
469
564
|
if (!i.value) return;
|
|
470
|
-
let v =
|
|
471
|
-
E(
|
|
565
|
+
let v = bt(e.containers);
|
|
566
|
+
E(r) instanceof HTMLElement && v.add(E(r));
|
|
472
567
|
let g = p.relatedTarget;
|
|
473
|
-
g instanceof HTMLElement && g.dataset.headlessuiFocusGuard !== "true" && (
|
|
568
|
+
g instanceof HTMLElement && g.dataset.headlessuiFocusGuard !== "true" && (Et(v, g) || (s.value ? Te(E(r), I(u.value, { [se.Forwards]: () => z.Next, [se.Backwards]: () => z.Previous }) | z.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && _(p.target)));
|
|
474
569
|
}
|
|
475
570
|
return () => {
|
|
476
|
-
let p = {}, v = { ref:
|
|
477
|
-
return S(ot, [!!(g & 4) && S(
|
|
571
|
+
let p = {}, v = { ref: r, onKeydown: f, onFocusout: c }, { features: g, initialFocus: b, containers: j, ...O } = e;
|
|
572
|
+
return S(ot, [!!(g & 4) && S(Re, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: d, features: Pe.Focusable }), A({ ourProps: v, theirProps: { ...t, ...O }, slot: p, attrs: t, slots: n, name: "FocusTrap" }), !!(g & 4) && S(Re, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: d, features: Pe.Focusable })]);
|
|
478
573
|
};
|
|
479
|
-
} }), { features:
|
|
480
|
-
function
|
|
481
|
-
let t = h(
|
|
482
|
-
return
|
|
483
|
-
|
|
574
|
+
} }), { features: wt });
|
|
575
|
+
function dn(e) {
|
|
576
|
+
let t = h(Q.slice());
|
|
577
|
+
return re([e], ([n], [l]) => {
|
|
578
|
+
l === !0 && n === !1 ? Ge(() => {
|
|
484
579
|
t.value.splice(0);
|
|
485
|
-
}) :
|
|
580
|
+
}) : l === !1 && n === !0 && (t.value = Q.slice());
|
|
486
581
|
}, { flush: "post" }), () => {
|
|
487
582
|
var n;
|
|
488
|
-
return (n = t.value.find((
|
|
583
|
+
return (n = t.value.find((l) => l != null && l.isConnected)) != null ? n : null;
|
|
489
584
|
};
|
|
490
585
|
}
|
|
491
|
-
function
|
|
492
|
-
let n =
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
var
|
|
496
|
-
t.value || ((
|
|
586
|
+
function cn({ ownerDocument: e }, t) {
|
|
587
|
+
let n = dn(t);
|
|
588
|
+
L(() => {
|
|
589
|
+
x(() => {
|
|
590
|
+
var l, r;
|
|
591
|
+
t.value || ((l = e.value) == null ? void 0 : l.activeElement) === ((r = e.value) == null ? void 0 : r.body) && _(n());
|
|
497
592
|
}, { flush: "post" });
|
|
498
|
-
}),
|
|
499
|
-
t.value &&
|
|
593
|
+
}), N(() => {
|
|
594
|
+
t.value && _(n());
|
|
500
595
|
});
|
|
501
596
|
}
|
|
502
|
-
function
|
|
503
|
-
let
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
if (i.every((d, s) => (o == null ? void 0 : o[s]) === d) || !
|
|
597
|
+
function fn({ ownerDocument: e, container: t, initialFocus: n }, l) {
|
|
598
|
+
let r = h(null), a = h(!1);
|
|
599
|
+
return L(() => a.value = !0), N(() => a.value = !1), L(() => {
|
|
600
|
+
re([t, n, l], (i, o) => {
|
|
601
|
+
if (i.every((d, s) => (o == null ? void 0 : o[s]) === d) || !l.value) return;
|
|
507
602
|
let u = E(t);
|
|
508
603
|
u && Ge(() => {
|
|
509
604
|
var d, s;
|
|
@@ -511,92 +606,92 @@ function sn({ ownerDocument: e, container: t, initialFocus: n }, r) {
|
|
|
511
606
|
let f = E(n), c = (d = e.value) == null ? void 0 : d.activeElement;
|
|
512
607
|
if (f) {
|
|
513
608
|
if (f === c) {
|
|
514
|
-
|
|
609
|
+
r.value = c;
|
|
515
610
|
return;
|
|
516
611
|
}
|
|
517
612
|
} else if (u.contains(c)) {
|
|
518
|
-
|
|
613
|
+
r.value = c;
|
|
519
614
|
return;
|
|
520
615
|
}
|
|
521
|
-
f ?
|
|
616
|
+
f ? _(f) : Te(u, z.First | z.NoScroll) === st.Error && console.warn("There are no focusable elements inside the <FocusTrap />"), r.value = (s = e.value) == null ? void 0 : s.activeElement;
|
|
522
617
|
});
|
|
523
618
|
}, { immediate: !0, flush: "post" });
|
|
524
|
-
}),
|
|
619
|
+
}), r;
|
|
525
620
|
}
|
|
526
|
-
function
|
|
621
|
+
function vn({ ownerDocument: e, container: t, containers: n, previousActiveElement: l }, r) {
|
|
527
622
|
var a;
|
|
528
|
-
|
|
529
|
-
if (!
|
|
530
|
-
let o =
|
|
623
|
+
yt((a = e.value) == null ? void 0 : a.defaultView, "focus", (i) => {
|
|
624
|
+
if (!r.value) return;
|
|
625
|
+
let o = bt(n);
|
|
531
626
|
E(t) instanceof HTMLElement && o.add(E(t));
|
|
532
|
-
let u =
|
|
627
|
+
let u = l.value;
|
|
533
628
|
if (!u) return;
|
|
534
629
|
let d = i.target;
|
|
535
|
-
d && d instanceof HTMLElement ?
|
|
630
|
+
d && d instanceof HTMLElement ? Et(o, d) ? (l.value = d, _(d)) : (i.preventDefault(), i.stopPropagation(), _(u)) : _(l.value);
|
|
536
631
|
}, !0);
|
|
537
632
|
}
|
|
538
|
-
function
|
|
633
|
+
function Et(e, t) {
|
|
539
634
|
for (let n of e) if (n.contains(t)) return !0;
|
|
540
635
|
return !1;
|
|
541
636
|
}
|
|
542
|
-
function
|
|
543
|
-
let t =
|
|
544
|
-
return
|
|
637
|
+
function pn(e) {
|
|
638
|
+
let t = kt(e.getSnapshot());
|
|
639
|
+
return N(e.subscribe(() => {
|
|
545
640
|
t.value = e.getSnapshot();
|
|
546
641
|
})), t;
|
|
547
642
|
}
|
|
548
|
-
function
|
|
549
|
-
let n = e(),
|
|
643
|
+
function mn(e, t) {
|
|
644
|
+
let n = e(), l = /* @__PURE__ */ new Set();
|
|
550
645
|
return { getSnapshot() {
|
|
551
646
|
return n;
|
|
552
|
-
}, subscribe(
|
|
553
|
-
return
|
|
554
|
-
}, dispatch(
|
|
555
|
-
let i = t[
|
|
556
|
-
i && (n = i,
|
|
647
|
+
}, subscribe(r) {
|
|
648
|
+
return l.add(r), () => l.delete(r);
|
|
649
|
+
}, dispatch(r, ...a) {
|
|
650
|
+
let i = t[r].call(n, ...a);
|
|
651
|
+
i && (n = i, l.forEach((o) => o()));
|
|
557
652
|
} };
|
|
558
653
|
}
|
|
559
|
-
function
|
|
654
|
+
function gn() {
|
|
560
655
|
let e;
|
|
561
656
|
return { before({ doc: t }) {
|
|
562
657
|
var n;
|
|
563
|
-
let
|
|
564
|
-
e = ((n = t.defaultView) != null ? n : window).innerWidth -
|
|
658
|
+
let l = t.documentElement;
|
|
659
|
+
e = ((n = t.defaultView) != null ? n : window).innerWidth - l.clientWidth;
|
|
565
660
|
}, after({ doc: t, d: n }) {
|
|
566
|
-
let
|
|
567
|
-
n.style(
|
|
661
|
+
let l = t.documentElement, r = l.clientWidth - l.offsetWidth, a = e - r;
|
|
662
|
+
n.style(l, "paddingRight", `${a}px`);
|
|
568
663
|
} };
|
|
569
664
|
}
|
|
570
|
-
function
|
|
571
|
-
return
|
|
572
|
-
function r
|
|
573
|
-
return n.containers.flatMap((a) => a()).some((a) => a.contains(
|
|
665
|
+
function hn() {
|
|
666
|
+
return ct() ? { before({ doc: e, d: t, meta: n }) {
|
|
667
|
+
function l(r) {
|
|
668
|
+
return n.containers.flatMap((a) => a()).some((a) => a.contains(r));
|
|
574
669
|
}
|
|
575
670
|
t.microTask(() => {
|
|
576
|
-
var
|
|
671
|
+
var r;
|
|
577
672
|
if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
|
|
578
|
-
let o =
|
|
673
|
+
let o = ve();
|
|
579
674
|
o.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => o.dispose()));
|
|
580
675
|
}
|
|
581
|
-
let a = (
|
|
676
|
+
let a = (r = window.scrollY) != null ? r : window.pageYOffset, i = null;
|
|
582
677
|
t.addEventListener(e, "click", (o) => {
|
|
583
678
|
if (o.target instanceof HTMLElement) try {
|
|
584
679
|
let u = o.target.closest("a");
|
|
585
680
|
if (!u) return;
|
|
586
681
|
let { hash: d } = new URL(u.href), s = e.querySelector(d);
|
|
587
|
-
s && !
|
|
682
|
+
s && !l(s) && (i = s);
|
|
588
683
|
} catch {
|
|
589
684
|
}
|
|
590
685
|
}, !0), t.addEventListener(e, "touchstart", (o) => {
|
|
591
|
-
if (o.target instanceof HTMLElement) if (
|
|
686
|
+
if (o.target instanceof HTMLElement) if (l(o.target)) {
|
|
592
687
|
let u = o.target;
|
|
593
|
-
for (; u.parentElement &&
|
|
688
|
+
for (; u.parentElement && l(u.parentElement); ) u = u.parentElement;
|
|
594
689
|
t.style(u, "overscrollBehavior", "contain");
|
|
595
690
|
} else t.style(o.target, "touchAction", "none");
|
|
596
691
|
}), t.addEventListener(e, "touchmove", (o) => {
|
|
597
692
|
if (o.target instanceof HTMLElement) {
|
|
598
693
|
if (o.target.tagName === "INPUT") return;
|
|
599
|
-
if (
|
|
694
|
+
if (l(o.target)) {
|
|
600
695
|
let u = o.target;
|
|
601
696
|
for (; u.parentElement && u.dataset.headlessuiPortal !== "" && !(u.scrollHeight > u.clientHeight || u.scrollWidth > u.clientWidth); ) u = u.parentElement;
|
|
602
697
|
u.dataset.headlessuiPortal === "" && o.preventDefault();
|
|
@@ -610,484 +705,469 @@ function pn() {
|
|
|
610
705
|
});
|
|
611
706
|
} } : {};
|
|
612
707
|
}
|
|
613
|
-
function
|
|
708
|
+
function yn() {
|
|
614
709
|
return { before({ doc: e, d: t }) {
|
|
615
710
|
t.style(e.documentElement, "overflow", "hidden");
|
|
616
711
|
} };
|
|
617
712
|
}
|
|
618
|
-
function
|
|
713
|
+
function bn(e) {
|
|
619
714
|
let t = {};
|
|
620
715
|
for (let n of e) Object.assign(t, n(t));
|
|
621
716
|
return t;
|
|
622
717
|
}
|
|
623
|
-
let
|
|
718
|
+
let Z = mn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
624
719
|
var n;
|
|
625
|
-
let
|
|
626
|
-
return
|
|
720
|
+
let l = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: ve(), meta: /* @__PURE__ */ new Set() };
|
|
721
|
+
return l.count++, l.meta.add(t), this.set(e, l), this;
|
|
627
722
|
}, POP(e, t) {
|
|
628
723
|
let n = this.get(e);
|
|
629
724
|
return n && (n.count--, n.meta.delete(t)), this;
|
|
630
725
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
|
631
|
-
let
|
|
632
|
-
|
|
726
|
+
let l = { doc: e, d: t, meta: bn(n) }, r = [hn(), gn(), yn()];
|
|
727
|
+
r.forEach(({ before: a }) => a == null ? void 0 : a(l)), r.forEach(({ after: a }) => a == null ? void 0 : a(l));
|
|
633
728
|
}, SCROLL_ALLOW({ d: e }) {
|
|
634
729
|
e.dispose();
|
|
635
730
|
}, TEARDOWN({ doc: e }) {
|
|
636
731
|
this.delete(e);
|
|
637
732
|
} });
|
|
638
|
-
|
|
639
|
-
let e =
|
|
733
|
+
Z.subscribe(() => {
|
|
734
|
+
let e = Z.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
640
735
|
for (let [n] of e) t.set(n, n.documentElement.style.overflow);
|
|
641
736
|
for (let n of e.values()) {
|
|
642
|
-
let
|
|
643
|
-
(
|
|
737
|
+
let l = t.get(n.doc) === "hidden", r = n.count !== 0;
|
|
738
|
+
(r && !l || !r && l) && Z.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && Z.dispatch("TEARDOWN", n);
|
|
644
739
|
}
|
|
645
740
|
});
|
|
646
|
-
function
|
|
647
|
-
let
|
|
648
|
-
let a = e.value ?
|
|
741
|
+
function wn(e, t, n) {
|
|
742
|
+
let l = pn(Z), r = m(() => {
|
|
743
|
+
let a = e.value ? l.value.get(e.value) : void 0;
|
|
649
744
|
return a ? a.count > 0 : !1;
|
|
650
745
|
});
|
|
651
|
-
return
|
|
746
|
+
return re([e, t], ([a, i], [o], u) => {
|
|
652
747
|
if (!a || !i) return;
|
|
653
|
-
|
|
748
|
+
Z.dispatch("PUSH", a, n);
|
|
654
749
|
let d = !1;
|
|
655
750
|
u(() => {
|
|
656
|
-
d || (
|
|
751
|
+
d || (Z.dispatch("POP", o ?? a, n), d = !0);
|
|
657
752
|
});
|
|
658
|
-
}, { immediate: !0 }),
|
|
753
|
+
}, { immediate: !0 }), r;
|
|
659
754
|
}
|
|
660
|
-
let
|
|
661
|
-
function
|
|
662
|
-
|
|
663
|
-
var
|
|
755
|
+
let Ne = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new Map();
|
|
756
|
+
function lt(e, t = h(!0)) {
|
|
757
|
+
x((n) => {
|
|
758
|
+
var l;
|
|
664
759
|
if (!t.value) return;
|
|
665
|
-
let
|
|
666
|
-
if (!
|
|
760
|
+
let r = E(e);
|
|
761
|
+
if (!r) return;
|
|
667
762
|
n(function() {
|
|
668
763
|
var i;
|
|
669
|
-
if (!
|
|
670
|
-
let o = (i =
|
|
671
|
-
if (o === 1 ?
|
|
672
|
-
let u =
|
|
673
|
-
u && (u["aria-hidden"] === null ?
|
|
764
|
+
if (!r) return;
|
|
765
|
+
let o = (i = ue.get(r)) != null ? i : 1;
|
|
766
|
+
if (o === 1 ? ue.delete(r) : ue.set(r, o - 1), o !== 1) return;
|
|
767
|
+
let u = Ne.get(r);
|
|
768
|
+
u && (u["aria-hidden"] === null ? r.removeAttribute("aria-hidden") : r.setAttribute("aria-hidden", u["aria-hidden"]), r.inert = u.inert, Ne.delete(r));
|
|
674
769
|
});
|
|
675
|
-
let a = (
|
|
676
|
-
|
|
770
|
+
let a = (l = ue.get(r)) != null ? l : 0;
|
|
771
|
+
ue.set(r, a + 1), a === 0 && (Ne.set(r, { "aria-hidden": r.getAttribute("aria-hidden"), inert: r.inert }), r.setAttribute("aria-hidden", "true"), r.inert = !0);
|
|
677
772
|
});
|
|
678
773
|
}
|
|
679
|
-
function
|
|
680
|
-
let
|
|
774
|
+
function En({ defaultContainers: e = [], portals: t, mainTreeNodeRef: n } = {}) {
|
|
775
|
+
let l = h(null), r = ae(l);
|
|
681
776
|
function a() {
|
|
682
777
|
var i, o, u;
|
|
683
778
|
let d = [];
|
|
684
779
|
for (let s of e) s !== null && (s instanceof HTMLElement ? d.push(s) : "value" in s && s.value instanceof HTMLElement && d.push(s.value));
|
|
685
780
|
if (t != null && t.value) for (let s of t.value) d.push(s);
|
|
686
|
-
for (let s of (i =
|
|
781
|
+
for (let s of (i = r == null ? void 0 : r.querySelectorAll("html > *, body > *")) != null ? i : []) s !== document.body && s !== document.head && s instanceof HTMLElement && s.id !== "headlessui-portal-root" && (s.contains(E(l)) || s.contains((u = (o = E(l)) == null ? void 0 : o.getRootNode()) == null ? void 0 : u.host) || d.some((f) => s.contains(f)) || d.push(s));
|
|
687
782
|
return d;
|
|
688
783
|
}
|
|
689
784
|
return { resolveContainers: a, contains(i) {
|
|
690
785
|
return a().some((o) => o.contains(i));
|
|
691
|
-
}, mainTreeNodeRef:
|
|
692
|
-
return n != null ? null : S(
|
|
786
|
+
}, mainTreeNodeRef: l, MainTreeNode() {
|
|
787
|
+
return n != null ? null : S(Re, { features: Pe.Hidden, ref: l });
|
|
693
788
|
} };
|
|
694
789
|
}
|
|
695
|
-
let
|
|
696
|
-
function
|
|
697
|
-
return
|
|
790
|
+
let St = Symbol("ForcePortalRootContext");
|
|
791
|
+
function Sn() {
|
|
792
|
+
return B(St, !1);
|
|
698
793
|
}
|
|
699
|
-
let
|
|
700
|
-
return
|
|
701
|
-
let { force:
|
|
702
|
-
return
|
|
794
|
+
let He = T({ name: "ForcePortalRoot", props: { as: { type: [Object, String], default: "template" }, force: { type: Boolean, default: !1 } }, setup(e, { slots: t, attrs: n }) {
|
|
795
|
+
return H(St, e.force), () => {
|
|
796
|
+
let { force: l, ...r } = e;
|
|
797
|
+
return A({ theirProps: r, ourProps: {}, slot: {}, slots: t, attrs: n, name: "ForcePortalRoot" });
|
|
703
798
|
};
|
|
704
|
-
} }),
|
|
705
|
-
var
|
|
706
|
-
function
|
|
707
|
-
return
|
|
799
|
+
} }), $t = Symbol("StackContext");
|
|
800
|
+
var Ie = ((e) => (e[e.Add = 0] = "Add", e[e.Remove = 1] = "Remove", e))(Ie || {});
|
|
801
|
+
function $n() {
|
|
802
|
+
return B($t, () => {
|
|
708
803
|
});
|
|
709
804
|
}
|
|
710
|
-
function
|
|
711
|
-
let
|
|
805
|
+
function Ln({ type: e, enabled: t, element: n, onUpdate: l }) {
|
|
806
|
+
let r = $n();
|
|
712
807
|
function a(...i) {
|
|
713
|
-
|
|
808
|
+
l == null || l(...i), r(...i);
|
|
714
809
|
}
|
|
715
|
-
|
|
716
|
-
|
|
810
|
+
L(() => {
|
|
811
|
+
re(t, (i, o) => {
|
|
717
812
|
i ? a(0, e, n) : o === !0 && a(1, e, n);
|
|
718
813
|
}, { immediate: !0, flush: "sync" });
|
|
719
|
-
}),
|
|
814
|
+
}), N(() => {
|
|
720
815
|
t.value && a(1, e, n);
|
|
721
|
-
}),
|
|
816
|
+
}), H($t, a);
|
|
722
817
|
}
|
|
723
|
-
let
|
|
724
|
-
function
|
|
725
|
-
let e =
|
|
818
|
+
let Lt = Symbol("DescriptionContext");
|
|
819
|
+
function Tn() {
|
|
820
|
+
let e = B(Lt, null);
|
|
726
821
|
if (e === null) throw new Error("Missing parent");
|
|
727
822
|
return e;
|
|
728
823
|
}
|
|
729
|
-
function
|
|
730
|
-
let
|
|
731
|
-
function
|
|
732
|
-
return
|
|
733
|
-
let i =
|
|
734
|
-
i !== -1 &&
|
|
824
|
+
function On({ slot: e = h({}), name: t = "Description", props: n = {} } = {}) {
|
|
825
|
+
let l = h([]);
|
|
826
|
+
function r(a) {
|
|
827
|
+
return l.value.push(a), () => {
|
|
828
|
+
let i = l.value.indexOf(a);
|
|
829
|
+
i !== -1 && l.value.splice(i, 1);
|
|
735
830
|
};
|
|
736
831
|
}
|
|
737
|
-
return
|
|
832
|
+
return H(Lt, { register: r, slot: e, name: t, props: n }), m(() => l.value.length > 0 ? l.value.join(" ") : void 0);
|
|
738
833
|
}
|
|
739
834
|
T({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
|
|
740
|
-
var
|
|
741
|
-
let
|
|
742
|
-
return
|
|
743
|
-
let { name: i = "Description", slot: o = h({}), props: u = {} } = a, { ...d } = e, s = { ...Object.entries(u).reduce((f, [c, p]) => Object.assign(f, { [c]:
|
|
744
|
-
return
|
|
835
|
+
var l;
|
|
836
|
+
let r = (l = e.id) != null ? l : `headlessui-description-${ee()}`, a = Tn();
|
|
837
|
+
return L(() => N(a.register(r))), () => {
|
|
838
|
+
let { name: i = "Description", slot: o = h({}), props: u = {} } = a, { ...d } = e, s = { ...Object.entries(u).reduce((f, [c, p]) => Object.assign(f, { [c]: R(p) }), {}), id: r };
|
|
839
|
+
return A({ ourProps: s, theirProps: d, slot: o.value, attrs: t, slots: n, name: i });
|
|
745
840
|
};
|
|
746
841
|
} });
|
|
747
|
-
function
|
|
748
|
-
let t =
|
|
842
|
+
function Fn(e) {
|
|
843
|
+
let t = ae(e);
|
|
749
844
|
if (!t) {
|
|
750
845
|
if (e === null) return null;
|
|
751
846
|
throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${e}`);
|
|
752
847
|
}
|
|
753
848
|
let n = t.getElementById("headlessui-portal-root");
|
|
754
849
|
if (n) return n;
|
|
755
|
-
let
|
|
756
|
-
return
|
|
850
|
+
let l = t.createElement("div");
|
|
851
|
+
return l.setAttribute("id", "headlessui-portal-root"), t.body.appendChild(l);
|
|
757
852
|
}
|
|
758
|
-
const
|
|
759
|
-
function
|
|
853
|
+
const Ue = /* @__PURE__ */ new WeakMap();
|
|
854
|
+
function Pn(e) {
|
|
760
855
|
var t;
|
|
761
|
-
return (t =
|
|
856
|
+
return (t = Ue.get(e)) != null ? t : 0;
|
|
762
857
|
}
|
|
763
|
-
function
|
|
764
|
-
let n = t(
|
|
765
|
-
return n <= 0 ?
|
|
858
|
+
function rt(e, t) {
|
|
859
|
+
let n = t(Pn(e));
|
|
860
|
+
return n <= 0 ? Ue.delete(e) : Ue.set(e, n), n;
|
|
766
861
|
}
|
|
767
|
-
let
|
|
768
|
-
let
|
|
769
|
-
o.value &&
|
|
862
|
+
let Tt = T({ name: "Portal", props: { as: { type: [Object, String], default: "div" } }, setup(e, { slots: t, attrs: n }) {
|
|
863
|
+
let l = h(null), r = m(() => ae(l)), a = Sn(), i = B(Ot, null), o = h(a === !0 || i == null ? Fn(l.value) : i.resolveTarget());
|
|
864
|
+
o.value && rt(o.value, (c) => c + 1);
|
|
770
865
|
let u = h(!1);
|
|
771
|
-
|
|
866
|
+
L(() => {
|
|
772
867
|
u.value = !0;
|
|
773
|
-
}),
|
|
868
|
+
}), x(() => {
|
|
774
869
|
a || i != null && (o.value = i.resolveTarget());
|
|
775
870
|
});
|
|
776
|
-
let d =
|
|
777
|
-
return
|
|
871
|
+
let d = B(We, null), s = !1, f = xt();
|
|
872
|
+
return re(l, () => {
|
|
778
873
|
if (s || !d) return;
|
|
779
|
-
let c = E(
|
|
780
|
-
c && (
|
|
781
|
-
}),
|
|
874
|
+
let c = E(l);
|
|
875
|
+
c && (N(d.register(c), f), s = !0);
|
|
876
|
+
}), N(() => {
|
|
782
877
|
var c, p;
|
|
783
|
-
let v = (c =
|
|
784
|
-
!v || o.value !== v ||
|
|
878
|
+
let v = (c = r.value) == null ? void 0 : c.getElementById("headlessui-portal-root");
|
|
879
|
+
!v || o.value !== v || rt(o.value, (g) => g - 1) || o.value.children.length > 0 || (p = o.value.parentElement) == null || p.removeChild(o.value);
|
|
785
880
|
}), () => {
|
|
786
881
|
if (!u.value || o.value === null) return null;
|
|
787
|
-
let c = { ref:
|
|
788
|
-
return S(
|
|
882
|
+
let c = { ref: l, "data-headlessui-portal": "" };
|
|
883
|
+
return S(Bt, { to: o.value }, A({ ourProps: c, theirProps: e, slot: {}, attrs: n, slots: t, name: "Portal" }));
|
|
789
884
|
};
|
|
790
|
-
} }),
|
|
791
|
-
function
|
|
792
|
-
let e =
|
|
885
|
+
} }), We = Symbol("PortalParentContext");
|
|
886
|
+
function An() {
|
|
887
|
+
let e = B(We, null), t = h([]);
|
|
793
888
|
function n(a) {
|
|
794
|
-
return t.value.push(a), e && e.register(a), () =>
|
|
889
|
+
return t.value.push(a), e && e.register(a), () => l(a);
|
|
795
890
|
}
|
|
796
|
-
function
|
|
891
|
+
function l(a) {
|
|
797
892
|
let i = t.value.indexOf(a);
|
|
798
893
|
i !== -1 && t.value.splice(i, 1), e && e.unregister(a);
|
|
799
894
|
}
|
|
800
|
-
let
|
|
895
|
+
let r = { register: n, unregister: l, portals: t };
|
|
801
896
|
return [t, T({ name: "PortalWrapper", setup(a, { slots: i }) {
|
|
802
|
-
return
|
|
897
|
+
return H(We, r), () => {
|
|
803
898
|
var o;
|
|
804
899
|
return (o = i.default) == null ? void 0 : o.call(i);
|
|
805
900
|
};
|
|
806
901
|
} })];
|
|
807
902
|
}
|
|
808
|
-
let
|
|
809
|
-
let
|
|
903
|
+
let Ot = Symbol("PortalGroupContext"), Cn = T({ name: "PortalGroup", props: { as: { type: [Object, String], default: "template" }, target: { type: Object, default: null } }, setup(e, { attrs: t, slots: n }) {
|
|
904
|
+
let l = Nt({ resolveTarget() {
|
|
810
905
|
return e.target;
|
|
811
906
|
} });
|
|
812
|
-
return
|
|
813
|
-
let { target:
|
|
814
|
-
return
|
|
907
|
+
return H(Ot, l), () => {
|
|
908
|
+
let { target: r, ...a } = e;
|
|
909
|
+
return A({ theirProps: a, ourProps: {}, slot: {}, attrs: t, slots: n, name: "PortalGroup" });
|
|
815
910
|
};
|
|
816
911
|
} });
|
|
817
|
-
var
|
|
818
|
-
let
|
|
819
|
-
function
|
|
820
|
-
let t =
|
|
912
|
+
var Dn = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Dn || {});
|
|
913
|
+
let Ve = Symbol("DialogContext");
|
|
914
|
+
function me(e) {
|
|
915
|
+
let t = B(Ve, null);
|
|
821
916
|
if (t === null) {
|
|
822
917
|
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
823
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
|
918
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, me), n;
|
|
824
919
|
}
|
|
825
920
|
return t;
|
|
826
921
|
}
|
|
827
|
-
let
|
|
922
|
+
let $e = "DC8F892D-2EBD-447C-A4C8-A03058436FF4", kn = T({ name: "Dialog", inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, open: { type: [Boolean, String], default: $e }, initialFocus: { type: Object, default: null }, id: { type: String, default: null }, role: { type: String, default: "dialog" } }, emits: { close: (e) => !0 }, setup(e, { emit: t, attrs: n, slots: l, expose: r }) {
|
|
828
923
|
var a, i;
|
|
829
|
-
let o = (a = e.id) != null ? a : `headlessui-dialog-${
|
|
830
|
-
|
|
924
|
+
let o = (a = e.id) != null ? a : `headlessui-dialog-${ee()}`, u = h(!1);
|
|
925
|
+
L(() => {
|
|
831
926
|
u.value = !0;
|
|
832
927
|
});
|
|
833
|
-
let d = !1, s = m(() => e.role === "dialog" || e.role === "alertdialog" ? e.role : (d || (d = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog")), f = h(0), c = Ye(), p = m(() => e.open ===
|
|
834
|
-
if (
|
|
835
|
-
if (typeof p.value != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${p.value ===
|
|
836
|
-
let b = m(() => u.value && p.value ? 0 : 1),
|
|
928
|
+
let d = !1, s = m(() => e.role === "dialog" || e.role === "alertdialog" ? e.role : (d || (d = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog")), f = h(0), c = Ye(), p = m(() => e.open === $e && c !== null ? (c.value & F.Open) === F.Open : e.open), v = h(null), g = m(() => ae(v));
|
|
929
|
+
if (r({ el: v, $el: v }), !(e.open !== $e || c !== null)) throw new Error("You forgot to provide an `open` prop to the `Dialog`.");
|
|
930
|
+
if (typeof p.value != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${p.value === $e ? void 0 : e.open}`);
|
|
931
|
+
let b = m(() => u.value && p.value ? 0 : 1), j = m(() => b.value === 0), O = m(() => f.value > 1), K = B(Ve, null) !== null, [ge, he] = An(), { resolveContainers: te, mainTreeNodeRef: ye, MainTreeNode: be } = En({ portals: ge, defaultContainers: [m(() => {
|
|
837
932
|
var y;
|
|
838
|
-
return (y =
|
|
839
|
-
})] }),
|
|
840
|
-
var y, w,
|
|
841
|
-
return (
|
|
933
|
+
return (y = ne.panelRef.value) != null ? y : v.value;
|
|
934
|
+
})] }), Ce = m(() => O.value ? "parent" : "leaf"), we = m(() => c !== null ? (c.value & F.Closing) === F.Closing : !1), De = m(() => K || we.value ? !1 : j.value), ke = m(() => {
|
|
935
|
+
var y, w, C;
|
|
936
|
+
return (C = Array.from((w = (y = g.value) == null ? void 0 : y.querySelectorAll("body > *")) != null ? w : []).find((D) => D.id === "headlessui-portal-root" ? !1 : D.contains(E(ye)) && D instanceof HTMLElement)) != null ? C : null;
|
|
842
937
|
});
|
|
843
|
-
|
|
844
|
-
let
|
|
845
|
-
var y, w,
|
|
846
|
-
return (
|
|
938
|
+
lt(ke, De);
|
|
939
|
+
let M = m(() => O.value ? !0 : j.value), oe = m(() => {
|
|
940
|
+
var y, w, C;
|
|
941
|
+
return (C = Array.from((w = (y = g.value) == null ? void 0 : y.querySelectorAll("[data-headlessui-portal]")) != null ? w : []).find((D) => D.contains(E(ye)) && D instanceof HTMLElement)) != null ? C : null;
|
|
847
942
|
});
|
|
848
|
-
|
|
849
|
-
if (w === "Dialog") return
|
|
943
|
+
lt(oe, M), Ln({ type: "Dialog", enabled: m(() => b.value === 0), element: v, onUpdate: (y, w) => {
|
|
944
|
+
if (w === "Dialog") return I(y, { [Ie.Add]: () => f.value += 1, [Ie.Remove]: () => f.value -= 1 });
|
|
850
945
|
} });
|
|
851
|
-
let
|
|
852
|
-
|
|
946
|
+
let U = On({ name: "DialogDescription", slot: m(() => ({ open: p.value })) }), W = h(null), ne = { titleId: W, panelRef: h(null), dialogState: b, setTitleId(y) {
|
|
947
|
+
W.value !== y && (W.value = y);
|
|
853
948
|
}, close() {
|
|
854
949
|
t("close", !1);
|
|
855
950
|
} };
|
|
856
|
-
|
|
857
|
-
let Qe = m(() => !(!
|
|
858
|
-
|
|
859
|
-
y.preventDefault(),
|
|
951
|
+
H(Ve, ne);
|
|
952
|
+
let Qe = m(() => !(!j.value || O.value));
|
|
953
|
+
ln(te, (y, w) => {
|
|
954
|
+
y.preventDefault(), ne.close(), jt(() => w == null ? void 0 : w.focus());
|
|
860
955
|
}, Qe);
|
|
861
956
|
let Ze = m(() => !(O.value || b.value !== 0));
|
|
862
|
-
|
|
863
|
-
Ze.value && (y.defaultPrevented || y.key ===
|
|
957
|
+
yt((i = g.value) == null ? void 0 : i.defaultView, "keydown", (y) => {
|
|
958
|
+
Ze.value && (y.defaultPrevented || y.key === ht.Escape && (y.preventDefault(), y.stopPropagation(), ne.close()));
|
|
864
959
|
});
|
|
865
|
-
let Je = m(() => !(
|
|
866
|
-
return
|
|
960
|
+
let Je = m(() => !(we.value || b.value !== 0 || K));
|
|
961
|
+
return wn(g, Je, (y) => {
|
|
867
962
|
var w;
|
|
868
|
-
return { containers: [...(w = y.containers) != null ? w : [],
|
|
869
|
-
}),
|
|
963
|
+
return { containers: [...(w = y.containers) != null ? w : [], te] };
|
|
964
|
+
}), x((y) => {
|
|
870
965
|
if (b.value !== 0) return;
|
|
871
966
|
let w = E(v);
|
|
872
967
|
if (!w) return;
|
|
873
|
-
let
|
|
874
|
-
for (let xe of
|
|
875
|
-
let
|
|
876
|
-
|
|
968
|
+
let C = new ResizeObserver((D) => {
|
|
969
|
+
for (let xe of D) {
|
|
970
|
+
let Ee = xe.target.getBoundingClientRect();
|
|
971
|
+
Ee.x === 0 && Ee.y === 0 && Ee.width === 0 && Ee.height === 0 && ne.close();
|
|
877
972
|
}
|
|
878
973
|
});
|
|
879
|
-
|
|
974
|
+
C.observe(w), y(() => C.disconnect());
|
|
880
975
|
}), () => {
|
|
881
|
-
let { open: y, initialFocus: w, ...
|
|
882
|
-
return S(
|
|
976
|
+
let { open: y, initialFocus: w, ...C } = e, D = { ...n, ref: v, id: o, role: s.value, "aria-modal": b.value === 0 ? !0 : void 0, "aria-labelledby": W.value, "aria-describedby": U.value }, xe = { open: b.value === 0 };
|
|
977
|
+
return S(He, { force: !0 }, () => [S(Tt, () => S(Cn, { target: v.value }, () => S(He, { force: !1 }, () => S(ie, { initialFocus: w, containers: te, features: j.value ? I(Ce.value, { parent: ie.features.RestoreFocus, leaf: ie.features.All & ~ie.features.FocusLock }) : ie.features.None }, () => S(he, {}, () => A({ ourProps: D, theirProps: { ...C, ...n }, slot: xe, attrs: n, slots: l, visible: b.value === 0, features: Fe.RenderStrategy | Fe.Static, name: "Dialog" })))))), S(be)]);
|
|
883
978
|
};
|
|
884
979
|
} });
|
|
885
980
|
T({ name: "DialogOverlay", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
|
|
886
|
-
var
|
|
887
|
-
let
|
|
981
|
+
var l;
|
|
982
|
+
let r = (l = e.id) != null ? l : `headlessui-dialog-overlay-${ee()}`, a = me("DialogOverlay");
|
|
888
983
|
function i(o) {
|
|
889
984
|
o.target === o.currentTarget && (o.preventDefault(), o.stopPropagation(), a.close());
|
|
890
985
|
}
|
|
891
986
|
return () => {
|
|
892
987
|
let { ...o } = e;
|
|
893
|
-
return
|
|
988
|
+
return A({ ourProps: { id: r, "aria-hidden": !0, onClick: i }, theirProps: o, slot: { open: a.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogOverlay" });
|
|
894
989
|
};
|
|
895
990
|
} });
|
|
896
|
-
T({ name: "DialogBackdrop", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose:
|
|
897
|
-
var
|
|
898
|
-
let a = (
|
|
899
|
-
return
|
|
991
|
+
T({ name: "DialogBackdrop", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, inheritAttrs: !1, setup(e, { attrs: t, slots: n, expose: l }) {
|
|
992
|
+
var r;
|
|
993
|
+
let a = (r = e.id) != null ? r : `headlessui-dialog-backdrop-${ee()}`, i = me("DialogBackdrop"), o = h(null);
|
|
994
|
+
return l({ el: o, $el: o }), L(() => {
|
|
900
995
|
if (i.panelRef.value === null) throw new Error("A <DialogBackdrop /> component is being used, but a <DialogPanel /> component is missing.");
|
|
901
996
|
}), () => {
|
|
902
997
|
let { ...u } = e, d = { id: a, ref: o, "aria-hidden": !0 };
|
|
903
|
-
return S(
|
|
998
|
+
return S(He, { force: !0 }, () => S(Tt, () => A({ ourProps: d, theirProps: { ...t, ...u }, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogBackdrop" })));
|
|
904
999
|
};
|
|
905
1000
|
} });
|
|
906
|
-
let
|
|
907
|
-
var
|
|
908
|
-
let a = (
|
|
909
|
-
|
|
1001
|
+
let xn = T({ name: "DialogPanel", props: { as: { type: [Object, String], default: "div" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n, expose: l }) {
|
|
1002
|
+
var r;
|
|
1003
|
+
let a = (r = e.id) != null ? r : `headlessui-dialog-panel-${ee()}`, i = me("DialogPanel");
|
|
1004
|
+
l({ el: i.panelRef, $el: i.panelRef });
|
|
910
1005
|
function o(u) {
|
|
911
1006
|
u.stopPropagation();
|
|
912
1007
|
}
|
|
913
1008
|
return () => {
|
|
914
1009
|
let { ...u } = e, d = { id: a, ref: i.panelRef, onClick: o };
|
|
915
|
-
return
|
|
1010
|
+
return A({ ourProps: d, theirProps: u, slot: { open: i.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogPanel" });
|
|
916
1011
|
};
|
|
917
|
-
} }),
|
|
918
|
-
var
|
|
919
|
-
let
|
|
920
|
-
return
|
|
921
|
-
a.setTitleId(
|
|
1012
|
+
} }), Bn = T({ name: "DialogTitle", props: { as: { type: [Object, String], default: "h2" }, id: { type: String, default: null } }, setup(e, { attrs: t, slots: n }) {
|
|
1013
|
+
var l;
|
|
1014
|
+
let r = (l = e.id) != null ? l : `headlessui-dialog-title-${ee()}`, a = me("DialogTitle");
|
|
1015
|
+
return L(() => {
|
|
1016
|
+
a.setTitleId(r), N(() => a.setTitleId(null));
|
|
922
1017
|
}), () => {
|
|
923
1018
|
let { ...i } = e;
|
|
924
|
-
return
|
|
1019
|
+
return A({ ourProps: { id: r }, theirProps: i, slot: { open: a.dialogState.value === 0 }, attrs: t, slots: n, name: "DialogTitle" });
|
|
925
1020
|
};
|
|
926
1021
|
} });
|
|
927
|
-
function
|
|
1022
|
+
function Nn(e) {
|
|
928
1023
|
let t = { called: !1 };
|
|
929
1024
|
return (...n) => {
|
|
930
1025
|
if (!t.called) return t.called = !0, e(...n);
|
|
931
1026
|
};
|
|
932
1027
|
}
|
|
933
|
-
function
|
|
1028
|
+
function je(e, ...t) {
|
|
934
1029
|
e && t.length > 0 && e.classList.add(...t);
|
|
935
1030
|
}
|
|
936
|
-
function
|
|
1031
|
+
function Le(e, ...t) {
|
|
937
1032
|
e && t.length > 0 && e.classList.remove(...t);
|
|
938
1033
|
}
|
|
939
|
-
var
|
|
940
|
-
function
|
|
941
|
-
let n =
|
|
1034
|
+
var qe = ((e) => (e.Finished = "finished", e.Cancelled = "cancelled", e))(qe || {});
|
|
1035
|
+
function jn(e, t) {
|
|
1036
|
+
let n = ve();
|
|
942
1037
|
if (!e) return n.dispose;
|
|
943
|
-
let { transitionDuration:
|
|
1038
|
+
let { transitionDuration: l, transitionDelay: r } = getComputedStyle(e), [a, i] = [l, r].map((o) => {
|
|
944
1039
|
let [u = 0] = o.split(",").filter(Boolean).map((d) => d.includes("ms") ? parseFloat(d) : parseFloat(d) * 1e3).sort((d, s) => s - d);
|
|
945
1040
|
return u;
|
|
946
1041
|
});
|
|
947
1042
|
return a !== 0 ? n.setTimeout(() => t("finished"), a + i) : t("finished"), n.add(() => t("cancelled")), n.dispose;
|
|
948
1043
|
}
|
|
949
|
-
function at(e, t, n,
|
|
950
|
-
let i =
|
|
1044
|
+
function at(e, t, n, l, r, a) {
|
|
1045
|
+
let i = ve(), o = a !== void 0 ? Nn(a) : () => {
|
|
951
1046
|
};
|
|
952
|
-
return
|
|
953
|
-
|
|
954
|
-
}), i.add(() =>
|
|
1047
|
+
return Le(e, ...r), je(e, ...t, ...n), i.nextFrame(() => {
|
|
1048
|
+
Le(e, ...n), je(e, ...l), i.add(jn(e, (u) => (Le(e, ...l, ...t), je(e, ...r), o(u))));
|
|
1049
|
+
}), i.add(() => Le(e, ...t, ...n, ...l, ...r)), i.add(() => o("cancelled")), i.dispose;
|
|
955
1050
|
}
|
|
956
|
-
function
|
|
1051
|
+
function X(e = "") {
|
|
957
1052
|
return e.split(/\s+/).filter((t) => t.length > 1);
|
|
958
1053
|
}
|
|
959
1054
|
let Ke = Symbol("TransitionContext");
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
return
|
|
1055
|
+
var Mn = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Mn || {});
|
|
1056
|
+
function Rn() {
|
|
1057
|
+
return B(Ke, null) !== null;
|
|
963
1058
|
}
|
|
964
|
-
function
|
|
965
|
-
let e =
|
|
1059
|
+
function Hn() {
|
|
1060
|
+
let e = B(Ke, null);
|
|
966
1061
|
if (e === null) throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");
|
|
967
1062
|
return e;
|
|
968
1063
|
}
|
|
969
|
-
function
|
|
970
|
-
let e =
|
|
1064
|
+
function In() {
|
|
1065
|
+
let e = B(Xe, null);
|
|
971
1066
|
if (e === null) throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");
|
|
972
1067
|
return e;
|
|
973
1068
|
}
|
|
974
1069
|
let Xe = Symbol("NestingContext");
|
|
975
|
-
function
|
|
976
|
-
return "children" in e ?
|
|
1070
|
+
function Ae(e) {
|
|
1071
|
+
return "children" in e ? Ae(e.children) : e.value.filter(({ state: t }) => t === "visible").length > 0;
|
|
977
1072
|
}
|
|
978
|
-
function
|
|
1073
|
+
function Ft(e) {
|
|
979
1074
|
let t = h([]), n = h(!1);
|
|
980
|
-
|
|
981
|
-
function
|
|
1075
|
+
L(() => n.value = !0), N(() => n.value = !1);
|
|
1076
|
+
function l(a, i = G.Hidden) {
|
|
982
1077
|
let o = t.value.findIndex(({ id: u }) => u === a);
|
|
983
|
-
o !== -1 && (
|
|
1078
|
+
o !== -1 && (I(i, { [G.Unmount]() {
|
|
984
1079
|
t.value.splice(o, 1);
|
|
985
|
-
}, [
|
|
1080
|
+
}, [G.Hidden]() {
|
|
986
1081
|
t.value[o].state = "hidden";
|
|
987
|
-
} }), !
|
|
1082
|
+
} }), !Ae(t) && n.value && (e == null || e()));
|
|
988
1083
|
}
|
|
989
|
-
function
|
|
1084
|
+
function r(a) {
|
|
990
1085
|
let i = t.value.find(({ id: o }) => o === a);
|
|
991
|
-
return i ? i.state !== "visible" && (i.state = "visible") : t.value.push({ id: a, state: "visible" }), () =>
|
|
1086
|
+
return i ? i.state !== "visible" && (i.state = "visible") : t.value.push({ id: a, state: "visible" }), () => l(a, G.Unmount);
|
|
992
1087
|
}
|
|
993
|
-
return { children: t, register:
|
|
1088
|
+
return { children: t, register: r, unregister: l };
|
|
994
1089
|
}
|
|
995
|
-
let Pt =
|
|
1090
|
+
let Pt = Fe.RenderStrategy, ze = T({ props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: l, expose: r }) {
|
|
996
1091
|
let a = h(0);
|
|
997
1092
|
function i() {
|
|
998
|
-
a.value |=
|
|
1093
|
+
a.value |= F.Opening, t("beforeEnter");
|
|
999
1094
|
}
|
|
1000
1095
|
function o() {
|
|
1001
|
-
a.value &= ~
|
|
1096
|
+
a.value &= ~F.Opening, t("afterEnter");
|
|
1002
1097
|
}
|
|
1003
1098
|
function u() {
|
|
1004
|
-
a.value |=
|
|
1099
|
+
a.value |= F.Closing, t("beforeLeave");
|
|
1005
1100
|
}
|
|
1006
1101
|
function d() {
|
|
1007
|
-
a.value &= ~
|
|
1102
|
+
a.value &= ~F.Closing, t("afterLeave");
|
|
1008
1103
|
}
|
|
1009
|
-
if (!
|
|
1010
|
-
let s = h(null), f = m(() => e.unmount ?
|
|
1011
|
-
|
|
1012
|
-
let { show: c, appear: p } =
|
|
1013
|
-
!
|
|
1104
|
+
if (!Rn() && an()) return () => S(At, { ...e, onBeforeEnter: i, onAfterEnter: o, onBeforeLeave: u, onAfterLeave: d }, l);
|
|
1105
|
+
let s = h(null), f = m(() => e.unmount ? G.Unmount : G.Hidden);
|
|
1106
|
+
r({ el: s, $el: s });
|
|
1107
|
+
let { show: c, appear: p } = Hn(), { register: v, unregister: g } = In(), b = h(c.value ? "visible" : "hidden"), j = { value: !0 }, O = ee(), K = { value: !1 }, ge = Ft(() => {
|
|
1108
|
+
!K.value && b.value !== "hidden" && (b.value = "hidden", g(O), d());
|
|
1014
1109
|
});
|
|
1015
|
-
|
|
1016
|
-
let
|
|
1017
|
-
|
|
1018
|
-
}),
|
|
1019
|
-
if (f.value ===
|
|
1110
|
+
L(() => {
|
|
1111
|
+
let M = v(O);
|
|
1112
|
+
N(M);
|
|
1113
|
+
}), x(() => {
|
|
1114
|
+
if (f.value === G.Hidden && O) {
|
|
1020
1115
|
if (c.value && b.value !== "visible") {
|
|
1021
1116
|
b.value = "visible";
|
|
1022
1117
|
return;
|
|
1023
1118
|
}
|
|
1024
|
-
|
|
1119
|
+
I(b.value, { hidden: () => g(O), visible: () => v(O) });
|
|
1025
1120
|
}
|
|
1026
1121
|
});
|
|
1027
|
-
let
|
|
1028
|
-
|
|
1029
|
-
|
|
1122
|
+
let he = X(e.enter), te = X(e.enterFrom), ye = X(e.enterTo), be = X(e.entered), Ce = X(e.leave), we = X(e.leaveFrom), De = X(e.leaveTo);
|
|
1123
|
+
L(() => {
|
|
1124
|
+
x(() => {
|
|
1030
1125
|
if (b.value === "visible") {
|
|
1031
|
-
let
|
|
1032
|
-
if (
|
|
1126
|
+
let M = E(s);
|
|
1127
|
+
if (M instanceof Comment && M.data === "") throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1033
1128
|
}
|
|
1034
1129
|
});
|
|
1035
1130
|
});
|
|
1036
|
-
function
|
|
1037
|
-
let
|
|
1038
|
-
!
|
|
1039
|
-
|
|
1040
|
-
}) : at(
|
|
1041
|
-
|
|
1131
|
+
function ke(M) {
|
|
1132
|
+
let oe = j.value && !p.value, U = E(s);
|
|
1133
|
+
!U || !(U instanceof HTMLElement) || oe || (K.value = !0, c.value && i(), c.value || u(), M(c.value ? at(U, he, te, ye, be, (W) => {
|
|
1134
|
+
K.value = !1, W === qe.Finished && o();
|
|
1135
|
+
}) : at(U, Ce, we, De, be, (W) => {
|
|
1136
|
+
K.value = !1, W === qe.Finished && (Ae(ge) || (b.value = "hidden", g(O), d()));
|
|
1042
1137
|
})));
|
|
1043
1138
|
}
|
|
1044
|
-
return
|
|
1045
|
-
|
|
1046
|
-
|
|
1139
|
+
return L(() => {
|
|
1140
|
+
re([c], (M, oe, U) => {
|
|
1141
|
+
ke(U), j.value = !1;
|
|
1047
1142
|
}, { immediate: !0 });
|
|
1048
|
-
}),
|
|
1049
|
-
let { appear:
|
|
1050
|
-
return
|
|
1143
|
+
}), H(Xe, ge), on(m(() => I(b.value, { visible: F.Open, hidden: F.Closed }) | a.value)), () => {
|
|
1144
|
+
let { appear: M, show: oe, enter: U, enterFrom: W, enterTo: ne, entered: Qe, leave: Ze, leaveFrom: Je, leaveTo: y, ...w } = e, C = { ref: s }, D = { ...w, ...p.value && c.value && pe.isServer ? { class: le([n.class, w.class, ...he, ...te]) } : {} };
|
|
1145
|
+
return A({ theirProps: D, ourProps: C, slot: {}, slots: l, attrs: n, features: Pt, visible: b.value === "visible", name: "TransitionChild" });
|
|
1051
1146
|
};
|
|
1052
|
-
} }),
|
|
1053
|
-
let
|
|
1054
|
-
|
|
1147
|
+
} }), Un = ze, At = T({ inheritAttrs: !1, props: { as: { type: [Object, String], default: "div" }, show: { type: [Boolean], default: null }, unmount: { type: [Boolean], default: !0 }, appear: { type: [Boolean], default: !1 }, enter: { type: [String], default: "" }, enterFrom: { type: [String], default: "" }, enterTo: { type: [String], default: "" }, entered: { type: [String], default: "" }, leave: { type: [String], default: "" }, leaveFrom: { type: [String], default: "" }, leaveTo: { type: [String], default: "" } }, emits: { beforeEnter: () => !0, afterEnter: () => !0, beforeLeave: () => !0, afterLeave: () => !0 }, setup(e, { emit: t, attrs: n, slots: l }) {
|
|
1148
|
+
let r = Ye(), a = m(() => e.show === null && r !== null ? (r.value & F.Open) === F.Open : e.show);
|
|
1149
|
+
x(() => {
|
|
1055
1150
|
if (![!0, !1].includes(a.value)) throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.');
|
|
1056
1151
|
});
|
|
1057
|
-
let i = h(a.value ? "visible" : "hidden"), o =
|
|
1152
|
+
let i = h(a.value ? "visible" : "hidden"), o = Ft(() => {
|
|
1058
1153
|
i.value = "hidden";
|
|
1059
1154
|
}), u = h(!0), d = { show: a, appear: m(() => e.appear || !u.value) };
|
|
1060
|
-
return
|
|
1061
|
-
|
|
1062
|
-
u.value = !1, a.value ? i.value = "visible" :
|
|
1155
|
+
return L(() => {
|
|
1156
|
+
x(() => {
|
|
1157
|
+
u.value = !1, a.value ? i.value = "visible" : Ae(o) || (i.value = "hidden");
|
|
1063
1158
|
});
|
|
1064
|
-
}),
|
|
1065
|
-
let s =
|
|
1066
|
-
return
|
|
1159
|
+
}), H(Xe, o), H(Ke, d), () => {
|
|
1160
|
+
let s = mt(e, ["show", "appear", "unmount", "onBeforeEnter", "onBeforeLeave", "onAfterEnter", "onAfterLeave"]), f = { unmount: e.unmount };
|
|
1161
|
+
return A({ ourProps: { ...f, as: "template" }, theirProps: {}, slot: {}, slots: { ...l, default: () => [S(Un, { onBeforeEnter: () => t("beforeEnter"), onAfterEnter: () => t("afterEnter"), onBeforeLeave: () => t("beforeLeave"), onAfterLeave: () => t("afterLeave"), ...n, ...f, ...s }, l.default)] }, attrs: {}, features: Pt, visible: i.value === "visible", name: "Transition" });
|
|
1067
1162
|
};
|
|
1068
1163
|
} });
|
|
1069
|
-
|
|
1070
|
-
return U(), ze("svg", {
|
|
1071
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1072
|
-
viewBox: "0 0 24 24",
|
|
1073
|
-
fill: "currentColor",
|
|
1074
|
-
"aria-hidden": "true",
|
|
1075
|
-
"data-slot": "icon"
|
|
1076
|
-
}, [
|
|
1077
|
-
L("path", {
|
|
1078
|
-
"fill-rule": "evenodd",
|
|
1079
|
-
d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
|
|
1080
|
-
"clip-rule": "evenodd"
|
|
1081
|
-
})
|
|
1082
|
-
]);
|
|
1083
|
-
}
|
|
1084
|
-
const In = {
|
|
1164
|
+
const Wn = {
|
|
1085
1165
|
class: "rvc-fixed rvc-inset-0 rvc-overflow-hidden",
|
|
1086
1166
|
role: "presentation"
|
|
1087
|
-
},
|
|
1167
|
+
}, Vn = { class: "rvc-absolute rvc-inset-0 rvc-overflow-hidden" }, qn = { class: "rvc-pointer-events-none rvc-fixed rvc-inset-y-0 rvc-right-0 rvc-flex rvc-max-w-full rvc-pl-10" }, zn = { class: "rvc-flex rvc-h-full rvc-flex-col rvc-shadow-xl" }, Gn = { class: "rvc-flex rvc-items-center rvc-justify-between" }, Yn = {
|
|
1088
1168
|
key: 0,
|
|
1089
1169
|
class: "rvc-ml-3 rvc-flex rvc-h-7 rvc-items-center"
|
|
1090
|
-
},
|
|
1170
|
+
}, Kn = ["id"], Xn = { class: "rvc-flex rvc-shrink-0 drawer-footer" }, el = {
|
|
1091
1171
|
__name: "Drawer",
|
|
1092
1172
|
props: {
|
|
1093
1173
|
as: {
|
|
@@ -1129,13 +1209,13 @@ const In = {
|
|
|
1129
1209
|
},
|
|
1130
1210
|
emits: ["drawer:open", "drawer:close", "drawer:save"],
|
|
1131
1211
|
setup(e, { emit: t }) {
|
|
1132
|
-
const n = t,
|
|
1212
|
+
const n = t, l = e, r = h(null), a = h(!1), i = m(() => l.as === "form"), o = m(() => `${l.id}-title`), u = m(() => `${l.id}-content`), d = m(() => {
|
|
1133
1213
|
var s;
|
|
1134
|
-
return (s =
|
|
1214
|
+
return (s = r.value) == null ? void 0 : s.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1135
1215
|
});
|
|
1136
|
-
return (s, f) => (
|
|
1137
|
-
default:
|
|
1138
|
-
|
|
1216
|
+
return (s, f) => (P(), Y(R(At), { as: "template" }, {
|
|
1217
|
+
default: V(() => [
|
|
1218
|
+
q(R(kn), {
|
|
1139
1219
|
as: e.as,
|
|
1140
1220
|
class: "drawer",
|
|
1141
1221
|
static: "",
|
|
@@ -1144,10 +1224,10 @@ const In = {
|
|
|
1144
1224
|
"initial-focus": d.value,
|
|
1145
1225
|
"aria-labelledby": o.value,
|
|
1146
1226
|
onClose: f[5] || (f[5] = (c) => s.$emit("drawer:close")),
|
|
1147
|
-
onSubmit: f[6] || (f[6] =
|
|
1227
|
+
onSubmit: f[6] || (f[6] = Mt((c) => n("drawer:save", c), ["prevent"]))
|
|
1148
1228
|
}, {
|
|
1149
|
-
default:
|
|
1150
|
-
|
|
1229
|
+
default: V(() => [
|
|
1230
|
+
q(R(ze), {
|
|
1151
1231
|
as: "template",
|
|
1152
1232
|
enter: "rvc-ease-in-out rvc-duration-500",
|
|
1153
1233
|
"enter-from": "rvc-opacity-0",
|
|
@@ -1157,18 +1237,18 @@ const In = {
|
|
|
1157
1237
|
"leave-to": "rvc-opacity-0",
|
|
1158
1238
|
onBeforeEnter: f[0] || (f[0] = (c) => n("drawer:open"))
|
|
1159
1239
|
}, {
|
|
1160
|
-
default:
|
|
1161
|
-
|
|
1240
|
+
default: V(() => f[7] || (f[7] = [
|
|
1241
|
+
$("div", {
|
|
1162
1242
|
class: "rvc-fixed rvc-inset-0 rvc-transition-opacity drawer-backdrop",
|
|
1163
1243
|
"aria-hidden": "true"
|
|
1164
1244
|
}, null, -1)
|
|
1165
1245
|
])),
|
|
1166
1246
|
_: 1
|
|
1167
1247
|
}),
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1248
|
+
$("div", Wn, [
|
|
1249
|
+
$("div", Vn, [
|
|
1250
|
+
$("div", qn, [
|
|
1251
|
+
q(R(ze), {
|
|
1172
1252
|
as: "template",
|
|
1173
1253
|
enter: "rvc-transform rvc-transition rvc-ease-in-out rvc-duration-500 sm:rvc-duration-700",
|
|
1174
1254
|
"enter-from": "rvc-translate-x-full",
|
|
@@ -1179,74 +1259,74 @@ const In = {
|
|
|
1179
1259
|
onBeforeEnter: f[3] || (f[3] = (c) => a.value = !0),
|
|
1180
1260
|
onAfterLeave: f[4] || (f[4] = (c) => a.value = !1)
|
|
1181
1261
|
}, {
|
|
1182
|
-
default:
|
|
1183
|
-
|
|
1184
|
-
class:
|
|
1262
|
+
default: V(() => [
|
|
1263
|
+
q(R(xn), {
|
|
1264
|
+
class: le(["rvc-pointer-events-auto rvc-w-screen", e.panelClass]),
|
|
1185
1265
|
"aria-busy": e.spinning,
|
|
1186
1266
|
"aria-describedby": u.value
|
|
1187
1267
|
}, {
|
|
1188
|
-
default:
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
class:
|
|
1268
|
+
default: V(() => [
|
|
1269
|
+
$("div", zn, [
|
|
1270
|
+
$("header", {
|
|
1271
|
+
class: le([{ "rvc-sticky rvc-top-0 rvc-left-0 rvc-w-full rvc-z-10": e.headerSticky }, "drawer-header"])
|
|
1192
1272
|
}, [
|
|
1193
|
-
|
|
1273
|
+
k(s.$slots, "header", {
|
|
1194
1274
|
title: e.title,
|
|
1195
1275
|
showClose: e.showClose
|
|
1196
1276
|
}, () => [
|
|
1197
|
-
|
|
1198
|
-
|
|
1277
|
+
$("div", Gn, [
|
|
1278
|
+
q(R(Bn), {
|
|
1199
1279
|
id: o.value,
|
|
1200
1280
|
class: "drawer-title"
|
|
1201
1281
|
}, {
|
|
1202
|
-
default:
|
|
1203
|
-
|
|
1282
|
+
default: V(() => [
|
|
1283
|
+
Oe(ce(e.title), 1)
|
|
1204
1284
|
]),
|
|
1205
1285
|
_: 1
|
|
1206
1286
|
}, 8, ["id"]),
|
|
1207
|
-
e.showClose ? (
|
|
1208
|
-
|
|
1287
|
+
e.showClose ? (P(), fe("div", Yn, [
|
|
1288
|
+
$("button", {
|
|
1209
1289
|
type: "button",
|
|
1210
1290
|
class: "rvc-relative drawer-close",
|
|
1211
1291
|
"aria-label": "Close panel",
|
|
1212
1292
|
onClick: f[1] || (f[1] = (c) => n("drawer:close"))
|
|
1213
1293
|
}, [
|
|
1214
|
-
|
|
1294
|
+
q(R(it), {
|
|
1215
1295
|
class: "rvc-size-full",
|
|
1216
1296
|
"aria-hidden": "true"
|
|
1217
1297
|
})
|
|
1218
1298
|
])
|
|
1219
|
-
])) :
|
|
1299
|
+
])) : J("", !0)
|
|
1220
1300
|
])
|
|
1221
1301
|
])
|
|
1222
1302
|
], 2),
|
|
1223
|
-
|
|
1224
|
-
class:
|
|
1303
|
+
$("div", {
|
|
1304
|
+
class: le([e.scrolledDown ? "rvc-flex-col-reverse" : "rvc-flex-col", "rvc-flex rvc-min-h-0 rvc-flex-1 rvc-overflow-y-scroll"])
|
|
1225
1305
|
}, [
|
|
1226
|
-
|
|
1306
|
+
$("div", {
|
|
1227
1307
|
id: u.value,
|
|
1228
1308
|
ref_key: "contentRef",
|
|
1229
|
-
ref:
|
|
1309
|
+
ref: r,
|
|
1230
1310
|
class: "rvc-relative rvc-flex-1 drawer-content"
|
|
1231
1311
|
}, [
|
|
1232
|
-
|
|
1233
|
-
], 8,
|
|
1312
|
+
k(s.$slots, "default", { ready: a.value })
|
|
1313
|
+
], 8, Kn)
|
|
1234
1314
|
], 2),
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1315
|
+
$("footer", Xn, [
|
|
1316
|
+
k(s.$slots, "footer", { loading: e.spinning }, () => [
|
|
1317
|
+
q(et, {
|
|
1238
1318
|
type: "button",
|
|
1239
1319
|
label: e.cancelLabel,
|
|
1240
1320
|
color: "light",
|
|
1241
1321
|
onClick: f[2] || (f[2] = (c) => n("drawer:close"))
|
|
1242
1322
|
}, null, 8, ["label"]),
|
|
1243
|
-
i.value ? (
|
|
1323
|
+
i.value ? (P(), Y(et, {
|
|
1244
1324
|
key: 0,
|
|
1245
1325
|
type: "submit",
|
|
1246
1326
|
label: e.submitLabel,
|
|
1247
1327
|
spinning: e.spinning,
|
|
1248
1328
|
disabled: e.spinning
|
|
1249
|
-
}, null, 8, ["label", "spinning", "disabled"])) :
|
|
1329
|
+
}, null, 8, ["label", "spinning", "disabled"])) : J("", !0)
|
|
1250
1330
|
])
|
|
1251
1331
|
])
|
|
1252
1332
|
])
|
|
@@ -1268,7 +1348,8 @@ const In = {
|
|
|
1268
1348
|
}
|
|
1269
1349
|
};
|
|
1270
1350
|
export {
|
|
1271
|
-
|
|
1351
|
+
Zn as Alert,
|
|
1352
|
+
Jn as Badge,
|
|
1272
1353
|
et as ButtonBase,
|
|
1273
|
-
|
|
1354
|
+
el as Drawer
|
|
1274
1355
|
};
|