@typeach/core 0.0.5 → 0.0.7
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/README.md +23 -0
- package/dist/typeach.js +735 -217
- package/dist/typeach.umd.cjs +4 -4
- package/package.json +7 -2
- package/dist/favicon.ico +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# <img style="block-size: 1.125em; aspect-ratio: 1; display: inline; vertical-align: text-bottom; margin-inline-end: 0.125em; border-radius: 4px;" src="https://raw.githubusercontent.com/sq11y/typeach/refs/heads/main/docs/public/logo.webp" alt="Mascot" /> @typeach/core
|
|
2
|
+
|
|
3
|
+
An unstyled component library for Vue.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
Install [@typeach/core](https://www.npmjs.com/package/@typeach/core).
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
pnpm i @typeach/core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import components. You can find a list of components with examples in the [documentation](https://sq11y.github.io/typeach/p/components).
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<template>
|
|
17
|
+
<PeachyButton> Button </PeachyButton>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts" setup>
|
|
21
|
+
import { PeachyButton } from "@typeach/core";
|
|
22
|
+
</script>
|
|
23
|
+
```
|
package/dist/typeach.js
CHANGED
|
@@ -1,75 +1,292 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o,
|
|
2
|
-
import { defineStore as
|
|
3
|
-
//#region src/
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o, getCurrentInstance as s, getCurrentScope as c, inject as l, markRaw as u, mergeModels as d, mergeProps as f, nextTick as ee, onBeforeMount as te, onBeforeUnmount as ne, onMounted as re, onScopeDispose as ie, openBlock as p, provide as m, ref as h, renderSlot as g, resolveDynamicComponent as _, shallowReadonly as ae, shallowRef as oe, toRefs as se, toValue as v, unref as y, useId as b, useModel as x, useTemplateRef as S, watch as C, watchEffect as ce, withCtx as w, withDirectives as le, withKeys as ue } from "vue";
|
|
2
|
+
import { defineStore as de } from "pinia";
|
|
3
|
+
//#region src/utils/date/date-modifiers.ts
|
|
4
|
+
var T = (e, t) => {
|
|
5
|
+
let n = new Date(e);
|
|
6
|
+
return n.setDate(n.getDate() + t), n;
|
|
7
|
+
}, fe = (e, t) => {
|
|
8
|
+
let n = new Date(e);
|
|
9
|
+
return n.setMonth(n.getMonth() + t), n;
|
|
10
|
+
}, pe = (e, t) => {
|
|
11
|
+
let n = new Date(e);
|
|
12
|
+
return n.setFullYear(n.getFullYear() + t), n;
|
|
13
|
+
}, E = (e) => T(e, 1), D = (e) => T(e, -1), me = (e) => T(e, 7), he = (e) => T(e, -7), ge = (e) => fe(e, 1), _e = (e) => fe(e, -1), ve = (e) => pe(e, 1), ye = (e) => pe(e, -1), be = (e, t) => {
|
|
14
|
+
let n = new Date(e), r = n.getDay(), i = r >= t ? r - t : 6 - r;
|
|
15
|
+
return n.setDate(n.getDate() - i), n;
|
|
16
|
+
}, xe = (e, t) => T(be(e, t), 6), O = (e) => {
|
|
17
|
+
let t = `${e.getFullYear()}`.padStart(4, "0"), n = `${e.getMonth() + 1}`.padStart(2, "0");
|
|
18
|
+
return A(/* @__PURE__ */ new Date(`${t}-${n}-01`));
|
|
19
|
+
}, k = (e) => {
|
|
20
|
+
let t = O(e);
|
|
21
|
+
return t.setMonth(t.getMonth() + 1), t.setDate(t.getDate() - 1), t;
|
|
22
|
+
}, Se = (e) => new Date(e.getFullYear(), 0, 1), Ce = (e) => new Date(e.getFullYear(), 11, 31), A = (e) => {
|
|
23
|
+
let t = new Date(e), n = t.getTimezoneOffset();
|
|
24
|
+
return t.setMinutes(t.getMinutes() + n), t;
|
|
25
|
+
}, we = (e, t) => Intl.DateTimeFormat(t, {
|
|
26
|
+
weekday: "long",
|
|
27
|
+
day: "numeric",
|
|
28
|
+
month: "long",
|
|
29
|
+
year: "numeric"
|
|
30
|
+
}).format(e), Te = (e) => e.getDate(), Ee = (e, t) => Intl.DateTimeFormat(t, { weekday: "long" }).format(e), De = (e) => {
|
|
31
|
+
let t = new Date(e);
|
|
32
|
+
t.setDate(t.getDate() + 4 - t.getDay());
|
|
33
|
+
let n = Se(e);
|
|
34
|
+
return Math.floor(((t - +n) / 864e5 + 1) / 7);
|
|
35
|
+
}, j = (e, t) => ({
|
|
36
|
+
name: Ae(e, t),
|
|
37
|
+
number: e.getMonth() + 1
|
|
38
|
+
}), Oe = (e) => e.getFullYear(), ke = (e, t) => Array.from({ length: 7 }).fill(void 0).map((t, n) => (e + n) % 7 + 1).map((e) => Ee(A(/* @__PURE__ */ new Date(`2006-01-0${e}`)), t)), Ae = (e, t) => Intl.DateTimeFormat(t, { month: "long" }).format(e), je = (e) => Array.from({ length: 12 }).fill(void 0).map((t, n) => j(/* @__PURE__ */ new Date(`2006-${String(n + 1).padStart(2, "0")}-01`), e)), Me = (e) => {
|
|
39
|
+
let t = [], n = O(e);
|
|
40
|
+
for (; n.getMonth() === e.getMonth();) t.push(n), n = E(n);
|
|
41
|
+
return t;
|
|
42
|
+
}, M = (e, t) => {
|
|
43
|
+
let n = Me(e), { daysBefore: r, daysAfter: i } = Pe(e, t);
|
|
44
|
+
return [
|
|
45
|
+
...r,
|
|
46
|
+
...n,
|
|
47
|
+
...i
|
|
48
|
+
];
|
|
49
|
+
}, Ne = (e) => {
|
|
50
|
+
let t = [];
|
|
51
|
+
for (let n = 0; n < e.length; n += 7) t.push(e.slice(n, n + 7));
|
|
52
|
+
return t.map((e) => ({
|
|
53
|
+
days: e,
|
|
54
|
+
number: De(e[e.length - 1])
|
|
55
|
+
}));
|
|
56
|
+
}, Pe = (e, t) => {
|
|
57
|
+
let n = O(e), r = n.getDay() === 0 ? 7 : n.getDay(), i = k(e), a = i.getDay() === 0 ? 7 : i.getDay(), o = t === 1 ? 7 : t - 1, s = [], c = [], l = (7 - t + r) % 7, u = D(n);
|
|
58
|
+
for (; l > 0;) s.push(u), u = D(u), --l;
|
|
59
|
+
s.reverse();
|
|
60
|
+
let d = (7 - a + o) % 7, f = E(i);
|
|
61
|
+
for (; d > 0;) c.push(f), f = E(f), --d;
|
|
62
|
+
return {
|
|
63
|
+
daysBefore: s,
|
|
64
|
+
daysAfter: c
|
|
65
|
+
};
|
|
66
|
+
}, N = (e) => ({
|
|
67
|
+
start: e.start < e.end ? e.start : e.end,
|
|
68
|
+
end: e.start < e.end ? e.end : e.start
|
|
69
|
+
}), Fe = (e, t) => {
|
|
70
|
+
let { start: n, end: r } = N(t);
|
|
71
|
+
return e >= n && e <= r;
|
|
72
|
+
}, Ie = (e, t) => {
|
|
73
|
+
let { start: n, end: r } = N(t);
|
|
74
|
+
return n.setHours(0, 0, 0, 0), r.setHours(23, 59, 59, 999), e >= n && e <= r;
|
|
75
|
+
}, P = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), F = /* @__PURE__ */ function(e) {
|
|
76
|
+
return e[e.Monday = 1] = "Monday", e[e.Tuesday = 2] = "Tuesday", e[e.Wednesday = 3] = "Wednesday", e[e.Thursday = 4] = "Thursday", e[e.Friday = 5] = "Friday", e[e.Saturday = 6] = "Saturday", e[e.Sunday = 7] = "Sunday", e;
|
|
77
|
+
}({}), I = (e) => e == null, Le = (e) => e instanceof HTMLElement, L = (e) => {
|
|
78
|
+
let { disabled: t } = e.dataset;
|
|
79
|
+
return e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true" || !I(t) && t !== "";
|
|
80
|
+
}, Re = (e) => !I(e) && e === document.activeElement, ze = (e) => Re(e) || e.getAttribute("tabindex") === "0", Be = (e) => e.match(/^[\P{Cc}\P{Cn}\P{Cs}]$/u) !== null, Ve = (e) => Be(e) && e !== " ", He = (e, t) => e.length > 1 && e.split("").every((e) => e === t), Ue = (e, t) => !!e?.trim().toLowerCase().startsWith(t.trim().toLowerCase()), We = (e, t = F.Monday) => ({ onKeyDown(n) {
|
|
81
|
+
switch ([
|
|
82
|
+
"ArrowLeft",
|
|
83
|
+
"ArrowRight",
|
|
84
|
+
"ArrowUp",
|
|
85
|
+
"ArrowDown",
|
|
86
|
+
"PageUp",
|
|
87
|
+
"PageDown",
|
|
88
|
+
"Home",
|
|
89
|
+
"End"
|
|
90
|
+
].includes(n.key) && n.preventDefault(), n.key) {
|
|
91
|
+
case "ArrowLeft":
|
|
92
|
+
e.value = D(e.value);
|
|
93
|
+
break;
|
|
94
|
+
case "ArrowRight":
|
|
95
|
+
e.value = E(e.value);
|
|
96
|
+
break;
|
|
97
|
+
case "ArrowUp":
|
|
98
|
+
e.value = he(e.value);
|
|
99
|
+
break;
|
|
100
|
+
case "ArrowDown":
|
|
101
|
+
e.value = me(e.value);
|
|
102
|
+
break;
|
|
103
|
+
case "PageUp":
|
|
104
|
+
e.value = n.shiftKey ? ye(e.value) : _e(e.value);
|
|
105
|
+
break;
|
|
106
|
+
case "PageDown":
|
|
107
|
+
e.value = n.shiftKey ? ve(e.value) : ge(e.value);
|
|
108
|
+
break;
|
|
109
|
+
case "Home":
|
|
110
|
+
e.value = n.shiftKey ? O(e.value) : be(e.value, t);
|
|
111
|
+
break;
|
|
112
|
+
case "End":
|
|
113
|
+
e.value = n.shiftKey ? k(e.value) : xe(e.value, t);
|
|
114
|
+
break;
|
|
115
|
+
default: break;
|
|
116
|
+
}
|
|
117
|
+
} }), Ge = (e) => {
|
|
118
|
+
let t = (t, n) => {
|
|
119
|
+
let { getElements: r, moveTo: i, isMovedTo: a } = v(e), o = r(), s = o.findIndex((e) => a(e)), c = n(s, o.length), l = o[c];
|
|
120
|
+
l = o[t === "forwards" ? c++ : c--], l && i(l, o[s]);
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
moveRelatively: (e) => {
|
|
124
|
+
t(e > 0 ? "forwards" : "backwards", (t) => t + e);
|
|
125
|
+
},
|
|
126
|
+
moveToEdge: (e) => {
|
|
127
|
+
t(e === "start" ? "forwards" : "backwards", (t, n) => e === "start" ? 0 : n - 1);
|
|
15
128
|
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
129
|
+
};
|
|
130
|
+
}, R = (e) => {
|
|
131
|
+
let t = (e, t) => {
|
|
132
|
+
t.filter((t) => !e?.isSameNode(t)).forEach((e) => e.setAttribute("tabindex", "-1")), e?.setAttribute("tabindex", "0");
|
|
133
|
+
}, n = (n) => {
|
|
134
|
+
t(n, e()), n.focus();
|
|
135
|
+
};
|
|
136
|
+
C(e, (e) => {
|
|
137
|
+
let [n] = e, r = e.find((e) => e.matches(":focus"));
|
|
138
|
+
!r && n && L(n) && (n = e.find((e) => !L(e))), t(r || n, e);
|
|
139
|
+
});
|
|
140
|
+
let { moveRelatively: r, moveToEdge: i } = Ge({
|
|
141
|
+
getElements: e,
|
|
142
|
+
isMovedTo: ze,
|
|
143
|
+
moveTo: n
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
moveTo: n,
|
|
147
|
+
moveRelatively: r,
|
|
148
|
+
moveToEdge: i
|
|
149
|
+
};
|
|
150
|
+
}, z = Symbol("grid"), Ke = (e) => {
|
|
151
|
+
let { moveRelatively: t, moveToEdge: n, moveTo: r } = R(e);
|
|
152
|
+
return { onKeyDown(i, a) {
|
|
153
|
+
let o = [
|
|
154
|
+
"ArrowLeft",
|
|
155
|
+
"ArrowRight",
|
|
156
|
+
"ArrowUp",
|
|
157
|
+
"ArrowDown",
|
|
158
|
+
"PageUp",
|
|
159
|
+
"PageDown",
|
|
160
|
+
"Home",
|
|
161
|
+
"End"
|
|
162
|
+
];
|
|
163
|
+
if (!Le(a.target)) return;
|
|
164
|
+
o.includes(a.key) && a.preventDefault();
|
|
165
|
+
let s = e().filter((e) => e.matches(`[data-elements-${i}="true"]`)), [c, l] = [s[0], s[s.length - 1]], u = a.target.closest(`[data-elements-${i}="true"]`);
|
|
166
|
+
switch (a.key) {
|
|
167
|
+
case "ArrowLeft":
|
|
168
|
+
c?.isSameNode(u) || t?.(-1);
|
|
169
|
+
break;
|
|
170
|
+
case "ArrowRight":
|
|
171
|
+
l?.isSameNode(u) || t?.(1);
|
|
172
|
+
break;
|
|
173
|
+
case "ArrowUp": return t(s.length * -1);
|
|
174
|
+
case "ArrowDown": return t(s.length);
|
|
175
|
+
case "PageUp": return t?.(s.length * -10);
|
|
176
|
+
case "PageDown": return t?.(s.length * 10);
|
|
177
|
+
case "Home":
|
|
178
|
+
a.ctrlKey ? n("start") : c && r(c);
|
|
179
|
+
break;
|
|
180
|
+
case "End":
|
|
181
|
+
a.ctrlKey ? n("end") : l && r(l);
|
|
182
|
+
break;
|
|
183
|
+
default: break;
|
|
184
|
+
}
|
|
185
|
+
} };
|
|
186
|
+
}, qe = Symbol("roving-tabindex"), B = (e, t) => {
|
|
187
|
+
let { moveTo: n, moveRelatively: r, moveToEdge: i } = R(t);
|
|
188
|
+
return {
|
|
189
|
+
moveTo: n,
|
|
190
|
+
moveRelatively: r,
|
|
191
|
+
moveToEdge: i,
|
|
192
|
+
onKeyDown(t) {
|
|
193
|
+
let n = v(e) === "vertical", a = n ? "ArrowUp" : "ArrowLeft", o = n ? "ArrowDown" : "ArrowRight";
|
|
194
|
+
switch ([
|
|
195
|
+
o,
|
|
196
|
+
a,
|
|
197
|
+
"PageUp",
|
|
198
|
+
"PageDown",
|
|
199
|
+
"Home",
|
|
200
|
+
"End"
|
|
201
|
+
].includes(t.key) && t.preventDefault(), t.key) {
|
|
202
|
+
case a: return r(-1);
|
|
203
|
+
case o: return r(1);
|
|
204
|
+
case "PageUp": return r(-10);
|
|
205
|
+
case "PageDown": return r(10);
|
|
206
|
+
case "Home": return i("start");
|
|
207
|
+
case "End": return i("end");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.38_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
|
|
214
|
+
function Je(e, t) {
|
|
215
|
+
return c() ? (ie(e, t), !0) : !1;
|
|
216
|
+
}
|
|
217
|
+
var V = typeof window < "u" && typeof document < "u";
|
|
218
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
219
|
+
var Ye = () => {};
|
|
220
|
+
function Xe(e, t, n = {}) {
|
|
221
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = oe(!1), o;
|
|
222
|
+
function s() {
|
|
223
|
+
o &&= (clearTimeout(o), void 0);
|
|
29
224
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
setup(e) {
|
|
33
|
-
return (e, t) => (f(), i("div", { style: C }, [h(e.$slots, "default")]));
|
|
225
|
+
function c() {
|
|
226
|
+
a.value = !1, s();
|
|
34
227
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
onCopy: { type: Function }
|
|
40
|
-
},
|
|
41
|
-
emits: ["copy"],
|
|
42
|
-
setup(n) {
|
|
43
|
-
let o = m(!1), s = n, c = t(() => s.content ? typeof s.content == "string" ? [new ClipboardItem({ "text/plain": s.content })] : Array.isArray(s.content) ? s.content : [s.content] : []), l = async (e) => {
|
|
44
|
-
s.content ? await navigator.clipboard.write(c.value) : await s.onCopy?.(e), o.value = !0, setTimeout(() => {
|
|
45
|
-
o.value = !1;
|
|
46
|
-
}, 4e3);
|
|
47
|
-
};
|
|
48
|
-
return (t, n) => (f(), i(e, null, [a(_(w), { "aria-live": "polite" }, {
|
|
49
|
-
default: x(() => [o.value ? h(t.$slots, "default", {
|
|
50
|
-
key: 0,
|
|
51
|
-
isCopying: o.value
|
|
52
|
-
}) : r("", !0)]),
|
|
53
|
-
_: 3
|
|
54
|
-
}), a(_(S), u(t.$attrs, { onClick: l }), {
|
|
55
|
-
default: x(() => [h(t.$slots, "default", { isCopying: o.value })]),
|
|
56
|
-
_: 3
|
|
57
|
-
}, 16)], 64));
|
|
228
|
+
function l(...n) {
|
|
229
|
+
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
230
|
+
a.value = !1, o = void 0, e(...n);
|
|
231
|
+
}, v(t));
|
|
58
232
|
}
|
|
59
|
-
|
|
60
|
-
|
|
233
|
+
return r && (a.value = !0, V && l()), Je(c), {
|
|
234
|
+
isPending: ae(a),
|
|
235
|
+
start: l,
|
|
236
|
+
stop: c
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function Ze(e = 1e3, n = {}) {
|
|
240
|
+
let { controls: r = !1, callback: i } = n, a = Xe(i ?? Ye, e, n), o = t(() => !a.isPending.value);
|
|
241
|
+
return r ? {
|
|
242
|
+
ready: o,
|
|
243
|
+
...a
|
|
244
|
+
} : o;
|
|
245
|
+
}
|
|
246
|
+
function H(e, t, n) {
|
|
247
|
+
return C(e, t, {
|
|
248
|
+
...n,
|
|
249
|
+
immediate: !0
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
V && window.document, V && window.navigator, V && window.location;
|
|
253
|
+
function Qe() {
|
|
254
|
+
let e = oe(!1), t = s();
|
|
255
|
+
return t && re(() => {
|
|
256
|
+
e.value = !0;
|
|
257
|
+
}, t), e;
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/hooks/keyboard/useTypeahead.ts
|
|
261
|
+
var $e = (e) => {
|
|
262
|
+
let t = h(""), n = Ze(500, {
|
|
263
|
+
controls: !0,
|
|
264
|
+
callback() {
|
|
265
|
+
t.value = "";
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
return { type(r) {
|
|
269
|
+
let { getElements: i, moveTo: a, isMovedTo: o } = v(e);
|
|
270
|
+
n.isPending.value && n.stop();
|
|
271
|
+
let s = r.toLowerCase();
|
|
272
|
+
t.value += s;
|
|
273
|
+
let c = He(t.value, s) ? s : t.value, l = i(), u = l.filter((e) => Ue(e.textContent, c)), d = l.find((e) => o(e)), f = u[u.findIndex((e) => d?.isSameNode(e)) + 1];
|
|
274
|
+
f && a(f, d), n.start();
|
|
275
|
+
} };
|
|
276
|
+
}, et = /([\p{Ll}\d])(\p{Lu})/gu, tt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu, nt = /(\d)\p{Ll}|(\p{L})\d/u, rt = /[^\p{L}\d]+/giu, it = "$1\0$2", at = "";
|
|
277
|
+
function ot(e) {
|
|
61
278
|
let t = e.trim();
|
|
62
|
-
t = t.replace(
|
|
279
|
+
t = t.replace(et, it).replace(tt, it), t = t.replace(rt, "\0");
|
|
63
280
|
let n = 0, r = t.length;
|
|
64
281
|
for (; t.charAt(n) === "\0";) n++;
|
|
65
282
|
if (n === r) return [];
|
|
66
283
|
for (; t.charAt(r - 1) === "\0";) r--;
|
|
67
284
|
return t.slice(n, r).split(/\0/g);
|
|
68
285
|
}
|
|
69
|
-
function
|
|
70
|
-
let t =
|
|
286
|
+
function st(e) {
|
|
287
|
+
let t = ot(e);
|
|
71
288
|
for (let e = 0; e < t.length; e++) {
|
|
72
|
-
let n = t[e], r =
|
|
289
|
+
let n = t[e], r = nt.exec(n);
|
|
73
290
|
if (r) {
|
|
74
291
|
let i = r.index + (r[1] ?? r[2]).length;
|
|
75
292
|
t.splice(e, 1, n.slice(0, i), n.slice(i));
|
|
@@ -77,21 +294,21 @@ function oe(e) {
|
|
|
77
294
|
}
|
|
78
295
|
return t;
|
|
79
296
|
}
|
|
80
|
-
function
|
|
81
|
-
let [n, r, i] =
|
|
82
|
-
return n + r.map(
|
|
297
|
+
function ct(e, t) {
|
|
298
|
+
let [n, r, i] = ut(e, t);
|
|
299
|
+
return n + r.map(lt(t?.locale)).join(t?.delimiter ?? " ") + i;
|
|
83
300
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
301
|
+
function U(e, t) {
|
|
302
|
+
return ct(e, {
|
|
86
303
|
delimiter: "-",
|
|
87
304
|
...t
|
|
88
305
|
});
|
|
89
306
|
}
|
|
90
|
-
function
|
|
307
|
+
function lt(e) {
|
|
91
308
|
return e === !1 ? (e) => e.toLowerCase() : (t) => t.toLocaleLowerCase(e);
|
|
92
309
|
}
|
|
93
|
-
function
|
|
94
|
-
let n = t.split ?? (t.separateNumbers ?
|
|
310
|
+
function ut(e, t = {}) {
|
|
311
|
+
let n = t.split ?? (t.separateNumbers ? st : ot), r = t.prefixCharacters ?? at, i = t.suffixCharacters ?? at, a = 0, o = e.length;
|
|
95
312
|
for (; a < e.length;) {
|
|
96
313
|
let t = e.charAt(a);
|
|
97
314
|
if (!r.includes(t)) break;
|
|
@@ -110,59 +327,57 @@ function le(e, t = {}) {
|
|
|
110
327
|
}
|
|
111
328
|
//#endregion
|
|
112
329
|
//#region src/hooks/useBemClass.ts
|
|
113
|
-
var
|
|
330
|
+
var dt = (e, t) => {
|
|
114
331
|
let n = t ? `${t}-${e}` : e;
|
|
115
332
|
return (...e) => {
|
|
116
|
-
let t = [n, ...e].filter((e) => typeof e == "string").map((e) =>
|
|
333
|
+
let t = [n, ...e].filter((e) => typeof e == "string").map((e) => U(e)).join("__"), r = { [t]: !0 };
|
|
117
334
|
for (let n of e.filter((e) => typeof e == "object")) for (let e of Object.keys(n)) {
|
|
118
335
|
let i = n[e];
|
|
119
|
-
typeof i == "string" && (r[`${t}--${i}`] = !0), typeof i == "number" && (r[`${t}--${
|
|
336
|
+
typeof i == "string" && (r[`${t}--${i}`] = !0), typeof i == "number" && (r[`${t}--${U(e)}-${i}`] = !0), typeof i == "boolean" && (r[`${t}--${U(e)}`] = i);
|
|
120
337
|
}
|
|
121
338
|
return r;
|
|
122
339
|
};
|
|
123
|
-
},
|
|
124
|
-
let
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
340
|
+
}, ft = (e) => (t) => dt(t, e), pt = (e, n = F.Monday, r = "en") => {
|
|
341
|
+
let i = h(M(e.value, v(n))), a = t(() => Oe(e.value)), o = t(() => j(e.value, v(r))), s = t(() => Ne(i.value));
|
|
342
|
+
return C(t(() => `${a.value}${o.value.number}`), () => {
|
|
343
|
+
i.value = M(e.value, v(n));
|
|
344
|
+
}), C(() => v(n), (t) => {
|
|
345
|
+
i.value = M(e.value, t);
|
|
346
|
+
}), {
|
|
347
|
+
year: a,
|
|
348
|
+
month: o,
|
|
349
|
+
weeks: s
|
|
350
|
+
};
|
|
351
|
+
}, mt = (e, t) => (m(e, t), t), W = (e) => l(e, { missingContext: !0 }), G = (e) => l(e), K = (e, n) => {
|
|
352
|
+
let r = h(/* @__PURE__ */ new Map()), i = n ? {
|
|
128
353
|
items: r,
|
|
129
354
|
parent: n
|
|
130
|
-
} :
|
|
355
|
+
} : l(`${e}-elements`, {
|
|
131
356
|
items: r,
|
|
132
|
-
parent:
|
|
357
|
+
parent: h()
|
|
133
358
|
});
|
|
134
|
-
return n &&
|
|
359
|
+
return n && m(`${e}-elements`, i), {
|
|
135
360
|
getElements: (t = !0) => {
|
|
136
361
|
let n = i.parent.value;
|
|
137
362
|
if (!n) return [];
|
|
138
363
|
let r = Array.from(n?.querySelectorAll(`[data-elements-${e}="true"]`));
|
|
139
|
-
return Array.from(i.items.value.values()).sort((e, t) => r.indexOf(e) - r.indexOf(t)).filter((e) => t || !
|
|
364
|
+
return Array.from(i.items.value.values()).sort((e, t) => r.indexOf(e) - r.indexOf(t)).filter((e) => t || !L(e));
|
|
140
365
|
},
|
|
141
366
|
elements: t(() => Array.from(i.items.value.values()))
|
|
142
367
|
};
|
|
143
|
-
},
|
|
144
|
-
let r =
|
|
145
|
-
|
|
368
|
+
}, q = (e, t, n) => {
|
|
369
|
+
let r = l(`${e}-elements`, void 0);
|
|
370
|
+
ce((e) => {
|
|
146
371
|
if (!t.value) return;
|
|
147
|
-
let i =
|
|
372
|
+
let i = u(t.value);
|
|
148
373
|
n?.value ? r?.items.value.delete(i) : r?.items.value.set(i, t.value), e(() => r?.items.value.delete(i));
|
|
149
|
-
}),
|
|
374
|
+
}), re(() => {
|
|
150
375
|
t.value?.setAttribute(`data-elements-${e}`, "true");
|
|
151
|
-
}),
|
|
376
|
+
}), ne(() => {
|
|
152
377
|
t.value?.removeAttribute(`data-elements-${e}`);
|
|
153
378
|
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function U(e, t, n) {
|
|
157
|
-
return te(e, t, {
|
|
158
|
-
...n,
|
|
159
|
-
immediate: !0
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/hooks/useId.ts
|
|
164
|
-
var W = (e) => {
|
|
165
|
-
let n = m();
|
|
379
|
+
}, ht = (e) => {
|
|
380
|
+
let n = h();
|
|
166
381
|
return t({
|
|
167
382
|
set(e) {
|
|
168
383
|
n.value = e;
|
|
@@ -171,12 +386,12 @@ var W = (e) => {
|
|
|
171
386
|
return n.value ?? e;
|
|
172
387
|
}
|
|
173
388
|
});
|
|
174
|
-
},
|
|
175
|
-
|
|
389
|
+
}, gt = (e, t) => {
|
|
390
|
+
H(t, (t) => {
|
|
176
391
|
e.value = t;
|
|
177
392
|
});
|
|
178
|
-
},
|
|
179
|
-
let e =
|
|
393
|
+
}, _t = () => {
|
|
394
|
+
let e = h(/* @__PURE__ */ new Map());
|
|
180
395
|
return {
|
|
181
396
|
set(t, n) {
|
|
182
397
|
n ? e.value.set(t, n) : e.value.delete(t);
|
|
@@ -185,25 +400,189 @@ var W = (e) => {
|
|
|
185
400
|
return e.value.get(t);
|
|
186
401
|
}
|
|
187
402
|
};
|
|
188
|
-
},
|
|
189
|
-
|
|
403
|
+
}, J = (e, t, n) => {
|
|
404
|
+
H(n, (n) => {
|
|
190
405
|
e.set(t, n);
|
|
191
406
|
});
|
|
192
|
-
},
|
|
193
|
-
let e =
|
|
407
|
+
}, vt = de("theme-settings", () => {
|
|
408
|
+
let e = h(1), t = h(!0), n = (e, t) => {
|
|
194
409
|
document.documentElement.style.setProperty(`--${e}`, t);
|
|
195
410
|
};
|
|
196
|
-
return
|
|
411
|
+
return H(e, (e) => {
|
|
197
412
|
document.documentElement.style.setProperty("saturation", `${e}`);
|
|
198
|
-
}),
|
|
413
|
+
}), H(t, (e) => {
|
|
199
414
|
n("code-white-space", e ? "pre-wrap" : "pre");
|
|
200
415
|
}), {
|
|
201
416
|
saturation: e,
|
|
202
417
|
wrapCode: t
|
|
203
418
|
};
|
|
204
|
-
}),
|
|
419
|
+
}), Y = Symbol("toolbar"), yt = ["aria-orientation", "aria-controls"], bt = /* @__PURE__ */ o({
|
|
420
|
+
__name: "Toolbar",
|
|
421
|
+
props: {
|
|
422
|
+
orientation: { default: "horizontal" },
|
|
423
|
+
controls: {}
|
|
424
|
+
},
|
|
425
|
+
setup(e) {
|
|
426
|
+
let { orientation: t } = se(e), n = S("element"), { getElements: r } = K("toolbar", n), { onKeyDown: a } = B(t, r);
|
|
427
|
+
return m(Y, { onKeyDown: a }), (r, a) => (p(), i("div", {
|
|
428
|
+
ref_key: "element",
|
|
429
|
+
ref: n,
|
|
430
|
+
"aria-orientation": y(t),
|
|
431
|
+
"aria-controls": e.controls,
|
|
432
|
+
role: "toolbar"
|
|
433
|
+
}, [g(r.$slots, "default")], 8, yt));
|
|
434
|
+
}
|
|
435
|
+
}), xt = [
|
|
436
|
+
"aria-disabled",
|
|
437
|
+
"disabled",
|
|
438
|
+
"type"
|
|
439
|
+
], X = /* @__PURE__ */ o({
|
|
440
|
+
__name: "Button",
|
|
441
|
+
props: {
|
|
442
|
+
type: { default: "button" },
|
|
443
|
+
disabled: {
|
|
444
|
+
type: [Boolean, String],
|
|
445
|
+
default: void 0
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
emits: ["click"],
|
|
449
|
+
setup(e, { emit: t }) {
|
|
450
|
+
let n = e, r = t, a = S("element"), { onKeyDown: o } = W(Y);
|
|
451
|
+
q("toolbar", a);
|
|
452
|
+
let s = (e) => {
|
|
453
|
+
n.disabled || r("click", e);
|
|
454
|
+
};
|
|
455
|
+
return (t, n) => (p(), i("button", {
|
|
456
|
+
ref_key: "element",
|
|
457
|
+
ref: a,
|
|
458
|
+
"aria-disabled": e.disabled === !0 ? !0 : void 0,
|
|
459
|
+
disabled: e.disabled === "without-focus" ? !0 : void 0,
|
|
460
|
+
type: e.type,
|
|
461
|
+
onClick: s,
|
|
462
|
+
onKeydown: n[0] ||= (...e) => y(o) && y(o)(...e)
|
|
463
|
+
}, [g(t.$slots, "default")], 40, xt));
|
|
464
|
+
}
|
|
465
|
+
}), Z = /* @__PURE__ */ o({
|
|
466
|
+
__name: "Table",
|
|
467
|
+
setup(e) {
|
|
468
|
+
return (e, t) => (p(), i("table", null, [g(e.$slots, "default")]));
|
|
469
|
+
}
|
|
470
|
+
}), St = /* @__PURE__ */ o({
|
|
471
|
+
__name: "TableBody",
|
|
472
|
+
setup(e) {
|
|
473
|
+
return (e, t) => (p(), i("tbody", null, [g(e.$slots, "default")]));
|
|
474
|
+
}
|
|
475
|
+
}), Ct = /* @__PURE__ */ o({
|
|
476
|
+
__name: "TableCell",
|
|
477
|
+
props: { heading: { type: Boolean } },
|
|
478
|
+
setup(e) {
|
|
479
|
+
return (t, r) => (p(), n(_(e.heading ? "th" : "td"), { scope: e.heading ? "row" : void 0 }, {
|
|
480
|
+
default: w(() => [g(t.$slots, "default")]),
|
|
481
|
+
_: 3
|
|
482
|
+
}, 8, ["scope"]));
|
|
483
|
+
}
|
|
484
|
+
}), wt = /* @__PURE__ */ o({
|
|
485
|
+
__name: "TableHead",
|
|
486
|
+
setup(e) {
|
|
487
|
+
return (e, t) => (p(), i("thead", null, [g(e.$slots, "default")]));
|
|
488
|
+
}
|
|
489
|
+
}), Tt = ["aria-sort"], Et = /* @__PURE__ */ o({
|
|
490
|
+
__name: "TableHeadingCell",
|
|
491
|
+
props: { sorted: {} },
|
|
492
|
+
setup(e) {
|
|
493
|
+
return (t, n) => (p(), i("th", { "aria-sort": e.sorted }, [g(t.$slots, "default")], 8, Tt));
|
|
494
|
+
}
|
|
495
|
+
}), Dt = /* @__PURE__ */ o({
|
|
496
|
+
__name: "TableRow",
|
|
497
|
+
setup(e) {
|
|
498
|
+
return (e, t) => (p(), i("tr", null, [g(e.$slots, "default")]));
|
|
499
|
+
}
|
|
500
|
+
}), Ot = Symbol("calendar-table"), kt = /* @__PURE__ */ o({
|
|
501
|
+
__name: "CalendarTable",
|
|
502
|
+
props: /*@__PURE__*/ d({ autoFocus: { type: Boolean } }, {
|
|
503
|
+
modelValue: { default: /* @__PURE__ */ new Date() },
|
|
504
|
+
modelModifiers: {}
|
|
505
|
+
}),
|
|
506
|
+
emits: ["update:modelValue"],
|
|
507
|
+
setup(e) {
|
|
508
|
+
let r = e, i = x(e, "modelValue"), a = Qe();
|
|
509
|
+
return m(Ot, {
|
|
510
|
+
focusedDate: i,
|
|
511
|
+
allowFocus: t(() => !!r.autoFocus || a.value)
|
|
512
|
+
}), (e, t) => (p(), n(y(Z), { role: "grid" }, {
|
|
513
|
+
default: w(() => [g(e.$slots, "default")]),
|
|
514
|
+
_: 3
|
|
515
|
+
}));
|
|
516
|
+
}
|
|
517
|
+
}), At = /* @__PURE__ */ o({
|
|
518
|
+
__name: "CalendarTableCell",
|
|
519
|
+
setup(e) {
|
|
520
|
+
return (e, t) => (p(), n(Ct, { role: "gridcell" }, {
|
|
521
|
+
default: w(() => [g(e.$slots, "default")]),
|
|
522
|
+
_: 3
|
|
523
|
+
}));
|
|
524
|
+
}
|
|
525
|
+
}), jt = [
|
|
526
|
+
"aria-pressed",
|
|
527
|
+
"aria-disabled",
|
|
528
|
+
"aria-current",
|
|
529
|
+
"tabindex"
|
|
530
|
+
], Mt = /* @__PURE__ */ o({
|
|
531
|
+
__name: "CalendarTableCellButton",
|
|
532
|
+
props: {
|
|
533
|
+
date: {},
|
|
534
|
+
disabled: { type: Boolean },
|
|
535
|
+
selected: { type: Boolean }
|
|
536
|
+
},
|
|
537
|
+
emits: ["click"],
|
|
538
|
+
setup(e, { emit: n }) {
|
|
539
|
+
let r = e, a = n, o = S("element"), { focusedDate: s, allowFocus: c } = G(Ot), { onKeyDown: l } = We(s), u = t(() => P(r.date, s.value));
|
|
540
|
+
return H(u, async (e) => {
|
|
541
|
+
e && c.value && (await ee(), o.value?.focus());
|
|
542
|
+
}), (t, n) => (p(), i("button", {
|
|
543
|
+
ref_key: "element",
|
|
544
|
+
ref: o,
|
|
545
|
+
"aria-pressed": e.selected,
|
|
546
|
+
"aria-disabled": e.disabled,
|
|
547
|
+
"aria-current": y(P)(e.date, /* @__PURE__ */ new Date()) ? "date" : void 0,
|
|
548
|
+
tabindex: u.value ? 0 : -1,
|
|
549
|
+
onFocus: n[0] ||= (t) => s.value = e.date,
|
|
550
|
+
onKeydown: n[1] ||= (...e) => y(l) && y(l)(...e),
|
|
551
|
+
onClick: n[2] ||= (e) => a("click", e)
|
|
552
|
+
}, [g(t.$slots, "default")], 40, jt));
|
|
553
|
+
}
|
|
554
|
+
}), Nt = "\n block-size: 1px;\n inline-size: 1px;\n\n position: absolute;\n overflow: hidden;\n\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n\n white-space: nowrap;\n", Pt = /* @__PURE__ */ o({
|
|
555
|
+
__name: "VisuallyHidden",
|
|
556
|
+
setup(e) {
|
|
557
|
+
return (e, t) => (p(), i("div", { style: Nt }, [g(e.$slots, "default")]));
|
|
558
|
+
}
|
|
559
|
+
}), Ft = /* @__PURE__ */ o({
|
|
560
|
+
__name: "CopyButton",
|
|
561
|
+
props: {
|
|
562
|
+
content: {},
|
|
563
|
+
onCopy: { type: Function }
|
|
564
|
+
},
|
|
565
|
+
emits: ["copy"],
|
|
566
|
+
setup(n) {
|
|
567
|
+
let o = h(!1), s = n, c = t(() => s.content ? typeof s.content == "string" ? [new ClipboardItem({ "text/plain": s.content })] : Array.isArray(s.content) ? s.content : [s.content] : []), l = async (e) => {
|
|
568
|
+
s.content ? await navigator.clipboard.write(c.value) : await s.onCopy?.(e), o.value = !0, setTimeout(() => {
|
|
569
|
+
o.value = !1;
|
|
570
|
+
}, 4e3);
|
|
571
|
+
};
|
|
572
|
+
return (t, n) => (p(), i(e, null, [a(y(Pt), { "aria-live": "polite" }, {
|
|
573
|
+
default: w(() => [o.value ? g(t.$slots, "default", {
|
|
574
|
+
key: 0,
|
|
575
|
+
isCopying: o.value
|
|
576
|
+
}) : r("", !0)]),
|
|
577
|
+
_: 3
|
|
578
|
+
}), a(y(X), f(t.$attrs, { onClick: l }), {
|
|
579
|
+
default: w(() => [g(t.$slots, "default", { isCopying: o.value })]),
|
|
580
|
+
_: 3
|
|
581
|
+
}, 16)], 64));
|
|
582
|
+
}
|
|
583
|
+
}), It = Symbol("disclosure"), Lt = { key: 0 }, Rt = /* @__PURE__ */ o({
|
|
205
584
|
__name: "Disclosure",
|
|
206
|
-
props: /*@__PURE__*/
|
|
585
|
+
props: /*@__PURE__*/ d({
|
|
207
586
|
render: { type: Boolean },
|
|
208
587
|
disabled: { type: Boolean },
|
|
209
588
|
popover: { type: Boolean }
|
|
@@ -216,9 +595,9 @@ var W = (e) => {
|
|
|
216
595
|
}),
|
|
217
596
|
emits: ["update:modelValue"],
|
|
218
597
|
setup(e) {
|
|
219
|
-
let n =
|
|
220
|
-
return
|
|
221
|
-
panelId:
|
|
598
|
+
let n = x(e, "modelValue"), r = e;
|
|
599
|
+
return m(It, {
|
|
600
|
+
panelId: ht(b()),
|
|
222
601
|
disabled: t(() => !!r.disabled),
|
|
223
602
|
popover: t(() => !!r.popover),
|
|
224
603
|
open: t({
|
|
@@ -229,25 +608,25 @@ var W = (e) => {
|
|
|
229
608
|
n.value = e;
|
|
230
609
|
}
|
|
231
610
|
})
|
|
232
|
-
}), (t, n) => e.render ? (
|
|
611
|
+
}), (t, n) => e.render ? (p(), i("div", Lt, [g(t.$slots, "default")])) : g(t.$slots, "default", { key: 1 });
|
|
233
612
|
}
|
|
234
|
-
}),
|
|
613
|
+
}), zt = /* @__PURE__ */ o({
|
|
235
614
|
__name: "DisclosureButton",
|
|
236
615
|
props: { disabled: { type: [Boolean, String] } },
|
|
237
616
|
setup(e) {
|
|
238
|
-
let { panelId: i, open: a, disabled: o, popover: s } =
|
|
617
|
+
let { panelId: i, open: a, disabled: o, popover: s } = G(It), c = t(() => s.value ? {
|
|
239
618
|
command: "toggle-popover",
|
|
240
619
|
commandfor: i.value
|
|
241
620
|
} : { onClick() {
|
|
242
621
|
a.value = !a.value;
|
|
243
622
|
} });
|
|
244
|
-
return (t, s) =>
|
|
623
|
+
return (t, s) => y(o) ? r("", !0) : (p(), n(y(X), f({
|
|
245
624
|
key: 0,
|
|
246
|
-
"aria-expanded":
|
|
247
|
-
"aria-controls":
|
|
625
|
+
"aria-expanded": y(a),
|
|
626
|
+
"aria-controls": y(i),
|
|
248
627
|
disabled: e.disabled
|
|
249
628
|
}, c.value), {
|
|
250
|
-
default:
|
|
629
|
+
default: w(() => [g(t.$slots, "default")]),
|
|
251
630
|
_: 3
|
|
252
631
|
}, 16, [
|
|
253
632
|
"aria-expanded",
|
|
@@ -255,42 +634,42 @@ var W = (e) => {
|
|
|
255
634
|
"disabled"
|
|
256
635
|
]));
|
|
257
636
|
}
|
|
258
|
-
}),
|
|
637
|
+
}), Bt = h(0), Vt = {
|
|
259
638
|
beforeMount(e, { value: t }) {
|
|
260
|
-
let n = `a-l-${
|
|
261
|
-
e.setAttribute("data-labelledby-id", n), t && (
|
|
639
|
+
let n = `a-l-${Bt.value++}`;
|
|
640
|
+
e.setAttribute("data-labelledby-id", n), t && (Ht(t, n), e.setAttribute("aria-labelledby", n));
|
|
262
641
|
},
|
|
263
642
|
updated(e, { value: t, oldValue: n }) {
|
|
264
643
|
if (t === n) return;
|
|
265
644
|
let r = e.getAttribute("data-labelledby-id");
|
|
266
645
|
if (r) {
|
|
267
646
|
let n = document.getElementById(r);
|
|
268
|
-
t ? n ? n.innerText = t : (
|
|
647
|
+
t ? n ? n.innerText = t : (Ht(t, r), e.setAttribute("aria-labelledby", r)) : (e.removeAttribute("aria-labelledby"), n?.remove());
|
|
269
648
|
}
|
|
270
649
|
},
|
|
271
650
|
beforeUnmount(e) {
|
|
272
651
|
let t = e.getAttribute("data-labelledby-id");
|
|
273
652
|
t && (e.removeAttribute("aria-labelledby"), document.getElementById(t)?.remove());
|
|
274
653
|
}
|
|
275
|
-
},
|
|
654
|
+
}, Ht = (e, t) => {
|
|
276
655
|
let n = document.createElement("span");
|
|
277
656
|
return n.innerText = e, n.id = `${t}`, n.hidden = !0, document.documentElement.appendChild(n), n;
|
|
278
|
-
},
|
|
657
|
+
}, Ut = {
|
|
279
658
|
beforeMount(e, { value: t }, { transition: n }) {
|
|
280
|
-
n && t === !1 ? n.beforeEnter(e) :
|
|
659
|
+
n && t === !1 ? n.beforeEnter(e) : Q(e, t);
|
|
281
660
|
},
|
|
282
661
|
mounted(e, { value: t }, { transition: n }) {
|
|
283
662
|
n && t === !1 && n.enter(e);
|
|
284
663
|
},
|
|
285
664
|
updated(e, { value: t, oldValue: n }, { transition: r }) {
|
|
286
|
-
t !== n && (r ? t === !1 ? (r.beforeEnter(e),
|
|
665
|
+
t !== n && (r ? t === !1 ? (r.beforeEnter(e), Q(e, t), r.enter(e)) : r.leave(e, () => Q(e, t)) : Q(e, t));
|
|
287
666
|
},
|
|
288
667
|
beforeUnmount(e, { value: t }) {
|
|
289
|
-
|
|
668
|
+
Q(e, t);
|
|
290
669
|
}
|
|
291
|
-
},
|
|
670
|
+
}, Q = (e, t) => {
|
|
292
671
|
t ? e.setAttribute("hidden", `${t}`) : e.removeAttribute("hidden");
|
|
293
|
-
},
|
|
672
|
+
}, Wt = /* @__PURE__ */ o({
|
|
294
673
|
__name: "DisclosurePanel",
|
|
295
674
|
props: {
|
|
296
675
|
hideFromSearch: { type: Boolean },
|
|
@@ -298,70 +677,145 @@ var W = (e) => {
|
|
|
298
677
|
id: { default: void 0 }
|
|
299
678
|
},
|
|
300
679
|
setup(e) {
|
|
301
|
-
let r = e, { panelId: i, disabled: a, popover: o, open: s } =
|
|
302
|
-
|
|
303
|
-
let c =
|
|
304
|
-
|
|
680
|
+
let r = e, { panelId: i, disabled: a, popover: o, open: s } = G(It);
|
|
681
|
+
gt(i, () => r.id);
|
|
682
|
+
let c = S("element"), l = t(() => s.value ? void 0 : r.hideFromSearch ? !0 : "until-found"), u = (e) => {
|
|
683
|
+
e.newState === "open" ? s.value = !0 : s.value = !1;
|
|
305
684
|
};
|
|
306
|
-
return (t, r) =>
|
|
307
|
-
id:
|
|
685
|
+
return (t, r) => le((p(), n(_(e.as), {
|
|
686
|
+
id: y(i),
|
|
308
687
|
ref_key: "element",
|
|
309
688
|
ref: c,
|
|
310
|
-
popover:
|
|
689
|
+
popover: y(a) || !y(o) ? void 0 : "auto",
|
|
311
690
|
onBeforematch: r[0] ||= (e) => s.value = !0,
|
|
312
691
|
onToggle: u
|
|
313
692
|
}, {
|
|
314
|
-
default:
|
|
693
|
+
default: w(() => [g(t.$slots, "default")]),
|
|
315
694
|
_: 3
|
|
316
|
-
}, 40, ["id", "popover"])), [[
|
|
695
|
+
}, 40, ["id", "popover"])), [[y(Ut), l.value]]);
|
|
696
|
+
}
|
|
697
|
+
}), Gt = ["href", "download"], Kt = /* @__PURE__ */ o({
|
|
698
|
+
__name: "DownloadLink",
|
|
699
|
+
props: {
|
|
700
|
+
url: {},
|
|
701
|
+
filename: {}
|
|
702
|
+
},
|
|
703
|
+
setup(e) {
|
|
704
|
+
let t = S("element"), { onKeyDown: n } = W(Y);
|
|
705
|
+
return q("toolbar", t), (r, a) => (p(), i("a", {
|
|
706
|
+
ref_key: "element",
|
|
707
|
+
ref: t,
|
|
708
|
+
href: e.url,
|
|
709
|
+
download: e.filename || !0,
|
|
710
|
+
onKeydown: a[0] ||= (...e) => y(n) && y(n)(...e)
|
|
711
|
+
}, [g(r.$slots, "default")], 40, Gt));
|
|
317
712
|
}
|
|
318
|
-
}),
|
|
713
|
+
}), qt = ["id"], Jt = /* @__PURE__ */ o({
|
|
319
714
|
__name: "FieldDescription",
|
|
320
715
|
setup(e) {
|
|
321
|
-
let t =
|
|
322
|
-
return
|
|
323
|
-
id:
|
|
716
|
+
let t = b(), n = S("element");
|
|
717
|
+
return q("field-description", n), (e, r) => (p(), i("div", {
|
|
718
|
+
id: y(t),
|
|
324
719
|
ref_key: "element",
|
|
325
720
|
ref: n
|
|
326
|
-
}, [
|
|
721
|
+
}, [g(e.$slots, "default")], 8, qt));
|
|
327
722
|
}
|
|
328
|
-
}),
|
|
723
|
+
}), Yt = ["id"], Xt = /* @__PURE__ */ o({
|
|
329
724
|
__name: "FieldError",
|
|
330
725
|
setup(e) {
|
|
331
|
-
let t =
|
|
332
|
-
return
|
|
333
|
-
id:
|
|
726
|
+
let t = b(), n = S("element");
|
|
727
|
+
return q("field-error", n), (e, r) => (p(), i("div", {
|
|
728
|
+
id: y(t),
|
|
334
729
|
ref_key: "element",
|
|
335
730
|
ref: n
|
|
336
|
-
}, [
|
|
731
|
+
}, [g(e.$slots, "default")], 8, Yt));
|
|
337
732
|
}
|
|
338
|
-
}),
|
|
339
|
-
let { elements: r } =
|
|
340
|
-
return
|
|
733
|
+
}), Zt = Symbol("field"), Qt = (e, n) => {
|
|
734
|
+
let { elements: r } = K("field-error", n), { elements: i } = K("field-description", n), a = (e) => e.filter((e) => e.id).map((e) => e.id);
|
|
735
|
+
return mt(Zt, {
|
|
341
736
|
id: e,
|
|
342
737
|
hasErrors: t(() => r.value.length > 0),
|
|
343
738
|
errorIds: t(() => a(r.value)),
|
|
344
739
|
descriptionIds: t(() => a(i.value))
|
|
345
740
|
});
|
|
346
|
-
},
|
|
741
|
+
}, $t = () => G(Zt), en = ["id", "for"], tn = /* @__PURE__ */ o({
|
|
347
742
|
__name: "FieldLabel",
|
|
348
743
|
setup(e) {
|
|
349
|
-
let { id: t } =
|
|
744
|
+
let { id: t } = $t(), n = () => {
|
|
350
745
|
document.getElementById(t)?.focus();
|
|
351
746
|
};
|
|
352
|
-
return (e, r) => (
|
|
353
|
-
id: `${
|
|
354
|
-
for:
|
|
747
|
+
return (e, r) => (p(), i("label", {
|
|
748
|
+
id: `${y(t)}-label`,
|
|
749
|
+
for: y(t),
|
|
355
750
|
onClick: n
|
|
356
|
-
}, [
|
|
751
|
+
}, [g(e.$slots, "default")], 8, en));
|
|
752
|
+
}
|
|
753
|
+
}), nn = /* @__PURE__ */ o({
|
|
754
|
+
__name: "GridTable",
|
|
755
|
+
setup(e) {
|
|
756
|
+
let r = S("element"), i = t(() => r.value?.$el), { getElements: a } = K("table", i), { onKeyDown: o } = Ke(a);
|
|
757
|
+
return m(z, { onKeyDown: o }), (e, t) => (p(), n(Z, {
|
|
758
|
+
ref_key: "element",
|
|
759
|
+
ref: i,
|
|
760
|
+
role: "grid"
|
|
761
|
+
}, {
|
|
762
|
+
default: w(() => [g(e.$slots, "default")]),
|
|
763
|
+
_: 3
|
|
764
|
+
}, 512));
|
|
765
|
+
}
|
|
766
|
+
}), rn = (e) => {
|
|
767
|
+
let n = t(() => e.value?.$el), r = G(an);
|
|
768
|
+
q("table", n), q(r, n);
|
|
769
|
+
let { onKeyDown: i } = G(z);
|
|
770
|
+
return {
|
|
771
|
+
onKeyDown: i,
|
|
772
|
+
rowId: r
|
|
773
|
+
};
|
|
774
|
+
}, an = Symbol("row"), on = /* @__PURE__ */ o({
|
|
775
|
+
__name: "GridTableCell",
|
|
776
|
+
props: { heading: { type: Boolean } },
|
|
777
|
+
setup(e) {
|
|
778
|
+
let { rowId: t, onKeyDown: r } = rn(S("element"));
|
|
779
|
+
return (i, a) => (p(), n(Ct, {
|
|
780
|
+
ref: "element",
|
|
781
|
+
heading: e.heading,
|
|
782
|
+
role: "gridcell",
|
|
783
|
+
onKeydown: a[0] ||= (e) => y(r)(y(t), e)
|
|
784
|
+
}, {
|
|
785
|
+
default: w(() => [g(i.$slots, "default")]),
|
|
786
|
+
_: 3
|
|
787
|
+
}, 8, ["heading"]));
|
|
788
|
+
}
|
|
789
|
+
}), sn = /* @__PURE__ */ o({
|
|
790
|
+
__name: "GridTableHeadingCell",
|
|
791
|
+
props: { sorted: {} },
|
|
792
|
+
setup(e) {
|
|
793
|
+
let { rowId: t, onKeyDown: r } = rn(S("element"));
|
|
794
|
+
return (i, a) => (p(), n(Et, {
|
|
795
|
+
ref: "element",
|
|
796
|
+
role: "gridcell",
|
|
797
|
+
sorted: e.sorted,
|
|
798
|
+
onKeydown: a[0] ||= (e) => y(r)(y(t), e)
|
|
799
|
+
}, {
|
|
800
|
+
default: w(() => [g(i.$slots, "default")]),
|
|
801
|
+
_: 3
|
|
802
|
+
}, 8, ["sorted"]));
|
|
357
803
|
}
|
|
358
|
-
}),
|
|
804
|
+
}), cn = /* @__PURE__ */ o({
|
|
805
|
+
__name: "GridTableRow",
|
|
806
|
+
setup(e) {
|
|
807
|
+
return m(an, b()), (e, t) => (p(), n(Dt, null, {
|
|
808
|
+
default: w(() => [g(e.$slots, "default")]),
|
|
809
|
+
_: 3
|
|
810
|
+
}));
|
|
811
|
+
}
|
|
812
|
+
}), ln = ["aria-orientation"], un = /* @__PURE__ */ o({
|
|
359
813
|
__name: "Separator",
|
|
360
814
|
props: { orientation: { default: "horizontal" } },
|
|
361
815
|
setup(e) {
|
|
362
|
-
return (t, n) => (
|
|
816
|
+
return (t, n) => (p(), i("hr", { "aria-orientation": e.orientation }, null, 8, ln));
|
|
363
817
|
}
|
|
364
|
-
}),
|
|
818
|
+
}), dn = Symbol("Switch-field"), fn = () => G(dn), pn = /* @__PURE__ */ o({
|
|
365
819
|
__name: "SwitchField",
|
|
366
820
|
props: {
|
|
367
821
|
modelValue: {
|
|
@@ -372,81 +826,145 @@ var W = (e) => {
|
|
|
372
826
|
},
|
|
373
827
|
emits: ["update:modelValue"],
|
|
374
828
|
setup(e) {
|
|
375
|
-
let t =
|
|
376
|
-
return
|
|
829
|
+
let t = x(e, "modelValue"), n = b(), r = S("element");
|
|
830
|
+
return Qt(n, r), m(dn, {
|
|
377
831
|
id: n,
|
|
378
832
|
modelValue: t
|
|
379
|
-
}), (e, t) => (
|
|
833
|
+
}), (e, t) => (p(), i("div", {
|
|
380
834
|
ref_key: "element",
|
|
381
835
|
ref: r
|
|
382
|
-
}, [
|
|
836
|
+
}, [g(e.$slots, "default")], 512));
|
|
383
837
|
}
|
|
384
|
-
}),
|
|
838
|
+
}), mn = { "aria-hidden": "true" }, hn = /* @__PURE__ */ o({
|
|
385
839
|
__name: "SwitchFieldStateLabel",
|
|
386
840
|
setup(e) {
|
|
387
|
-
return (e, t) => (
|
|
841
|
+
return (e, t) => (p(), i("div", mn, [g(e.$slots, "default")]));
|
|
388
842
|
}
|
|
389
|
-
}),
|
|
390
|
-
"id",
|
|
391
|
-
"aria-checked",
|
|
392
|
-
"aria-describedby",
|
|
393
|
-
"aria-invalid",
|
|
394
|
-
"aria-labelledby",
|
|
395
|
-
"aria-disabled"
|
|
396
|
-
], Me = /* @__PURE__ */ o({
|
|
843
|
+
}), gn = /* @__PURE__ */ o({
|
|
397
844
|
__name: "SwitchFieldSwitchButton",
|
|
398
845
|
props: { disabled: { type: Boolean } },
|
|
399
846
|
setup(e) {
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
"aria-
|
|
406
|
-
"aria-
|
|
407
|
-
|
|
408
|
-
"aria-labelledby": `${_(r)}-label`,
|
|
409
|
-
"aria-disabled": e.disabled,
|
|
847
|
+
let { modelValue: t } = fn(), { id: r, hasErrors: i, errorIds: a, descriptionIds: o } = $t();
|
|
848
|
+
return (s, c) => (p(), n(y(X), {
|
|
849
|
+
id: y(r),
|
|
850
|
+
"aria-checked": y(t),
|
|
851
|
+
"aria-describedby": [y(a), y(o)].flat().join(" ") || void 0,
|
|
852
|
+
"aria-invalid": y(i) ? !0 : void 0,
|
|
853
|
+
"aria-labelledby": `${y(r)}-label`,
|
|
854
|
+
disabled: e.disabled,
|
|
410
855
|
role: "switch",
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return (e, t) => (f(), i("tbody", null, [h(e.$slots, "default")]));
|
|
856
|
+
onClick: c[0] ||= (e) => t.value = !y(t)
|
|
857
|
+
}, {
|
|
858
|
+
default: w(() => [g(s.$slots, "default")]),
|
|
859
|
+
_: 3
|
|
860
|
+
}, 8, [
|
|
861
|
+
"id",
|
|
862
|
+
"aria-checked",
|
|
863
|
+
"aria-describedby",
|
|
864
|
+
"aria-invalid",
|
|
865
|
+
"aria-labelledby",
|
|
866
|
+
"disabled"
|
|
867
|
+
]));
|
|
424
868
|
}
|
|
425
|
-
}),
|
|
426
|
-
__name: "
|
|
427
|
-
props: {
|
|
869
|
+
}), $ = Symbol("tabs"), _n = Symbol("tabs-list"), vn = /* @__PURE__ */ o({
|
|
870
|
+
__name: "Tabs",
|
|
871
|
+
props: /*@__PURE__*/ d({ as: {} }, {
|
|
872
|
+
modelValue: {},
|
|
873
|
+
modelModifiers: {}
|
|
874
|
+
}),
|
|
875
|
+
emits: ["update:modelValue"],
|
|
428
876
|
setup(e) {
|
|
429
|
-
|
|
430
|
-
|
|
877
|
+
let t = x(e, "modelValue");
|
|
878
|
+
return m($, {
|
|
879
|
+
ids: _t(),
|
|
880
|
+
selectedPanel: t
|
|
881
|
+
}), (t, r) => e.as ? (p(), n(_(e.as), { key: 0 }, {
|
|
882
|
+
default: w(() => [g(t.$slots, "default")]),
|
|
431
883
|
_: 3
|
|
432
|
-
}
|
|
884
|
+
})) : g(t.$slots, "default", { key: 1 });
|
|
433
885
|
}
|
|
434
|
-
}),
|
|
435
|
-
__name: "
|
|
436
|
-
|
|
437
|
-
|
|
886
|
+
}), yn = ["tabindex"], bn = /* @__PURE__ */ o({
|
|
887
|
+
__name: "TabsActionButton",
|
|
888
|
+
props: { value: {} },
|
|
889
|
+
emits: ["click"],
|
|
890
|
+
setup(e, { emit: t }) {
|
|
891
|
+
let n = t, { selectedPanel: r } = G($);
|
|
892
|
+
return (t, a) => (p(), i("button", {
|
|
893
|
+
ref: "button",
|
|
894
|
+
tabindex: y(r) === e.value ? 0 : -1,
|
|
895
|
+
type: "button",
|
|
896
|
+
onClick: a[0] ||= (e) => n("click", e)
|
|
897
|
+
}, [g(t.$slots, "default")], 8, yn));
|
|
438
898
|
}
|
|
439
|
-
}),
|
|
440
|
-
|
|
441
|
-
|
|
899
|
+
}), xn = [
|
|
900
|
+
"id",
|
|
901
|
+
"aria-selected",
|
|
902
|
+
"aria-controls"
|
|
903
|
+
], Sn = /* @__PURE__ */ o({
|
|
904
|
+
__name: "TabsButton",
|
|
905
|
+
props: {
|
|
906
|
+
value: {},
|
|
907
|
+
id: { default: (e) => `${b()}-${e.value}-button` }
|
|
908
|
+
},
|
|
909
|
+
emits: ["delete"],
|
|
910
|
+
setup(e, { emit: t }) {
|
|
911
|
+
let n = e, r = S("element");
|
|
912
|
+
q("tabs-list", r);
|
|
913
|
+
let a = t, { selectedPanel: o, ids: s } = G($);
|
|
914
|
+
J(s, `${n.value}-button`, () => n.id);
|
|
915
|
+
let { onKeyDown: c, selectionFollowsFocus: l } = G(_n);
|
|
916
|
+
return te(() => {
|
|
917
|
+
o.value ||= n.value;
|
|
918
|
+
}), (t, u) => (p(), i("button", {
|
|
919
|
+
id: e.id,
|
|
920
|
+
ref_key: "element",
|
|
921
|
+
ref: r,
|
|
922
|
+
"aria-selected": y(o) === e.value,
|
|
923
|
+
"aria-controls": y(s).get(`${n.value}-panel`),
|
|
924
|
+
type: "button",
|
|
925
|
+
role: "tab",
|
|
926
|
+
onClick: u[0] ||= (t) => o.value = e.value,
|
|
927
|
+
onFocus: u[1] ||= (t) => y(l) ? o.value = e.value : void 0,
|
|
928
|
+
onKeydown: [u[2] ||= ue((e) => a("delete"), ["delete"]), u[3] ||= (...e) => y(c) && y(c)(...e)]
|
|
929
|
+
}, [g(t.$slots, "default")], 40, xn));
|
|
930
|
+
}
|
|
931
|
+
}), Cn = ["aria-orientation"], wn = /* @__PURE__ */ o({
|
|
932
|
+
__name: "TabsList",
|
|
933
|
+
props: {
|
|
934
|
+
orientation: { default: "horizontal" },
|
|
935
|
+
selectionFollowsFocus: { type: Boolean }
|
|
936
|
+
},
|
|
442
937
|
setup(e) {
|
|
443
|
-
|
|
938
|
+
let n = e, { orientation: r } = se(n), a = S("element"), { getElements: o } = K("tabs-list", a), { onKeyDown: s } = B(r, o);
|
|
939
|
+
return m(_n, {
|
|
940
|
+
selectionFollowsFocus: t(() => !!n.selectionFollowsFocus),
|
|
941
|
+
onKeyDown: s
|
|
942
|
+
}), (e, t) => (p(), i("div", {
|
|
943
|
+
ref_key: "element",
|
|
944
|
+
ref: a,
|
|
945
|
+
"aria-orientation": y(r),
|
|
946
|
+
role: "tablist"
|
|
947
|
+
}, [g(e.$slots, "default")], 8, Cn));
|
|
444
948
|
}
|
|
445
|
-
}),
|
|
446
|
-
__name: "
|
|
949
|
+
}), Tn = ["id", "aria-labelledby"], En = /* @__PURE__ */ o({
|
|
950
|
+
__name: "TabsPanel",
|
|
951
|
+
props: {
|
|
952
|
+
value: {},
|
|
953
|
+
id: { default: (e) => `${b()}-${e.value}-panel` }
|
|
954
|
+
},
|
|
447
955
|
setup(e) {
|
|
448
|
-
|
|
956
|
+
let n = e, { selectedPanel: a, ids: o } = G($);
|
|
957
|
+
J(o, `${n.value}-panel`, () => n.id);
|
|
958
|
+
let s = t(() => a.value === n.value);
|
|
959
|
+
return (t, a) => s.value ? (p(), i("div", {
|
|
960
|
+
key: 0,
|
|
961
|
+
id: e.id,
|
|
962
|
+
ref: "button",
|
|
963
|
+
"aria-labelledby": y(o).get(`${n.value}-button`),
|
|
964
|
+
tabindex: "-1",
|
|
965
|
+
role: "tabpanel"
|
|
966
|
+
}, [g(t.$slots, "default")], 8, Tn)) : r("", !0);
|
|
449
967
|
}
|
|
450
968
|
});
|
|
451
969
|
//#endregion
|
|
452
|
-
export {
|
|
970
|
+
export { z as GridKey, X as PeachyButton, kt as PeachyCalendarTable, At as PeachyCalendarTableCell, Mt as PeachyCalendarTableCellButton, Ft as PeachyCopyButton, Rt as PeachyDisclosure, zt as PeachyDisclosureButton, Wt as PeachyDisclosurePanel, Kt as PeachyDownloadLink, Jt as PeachyFieldDescription, Xt as PeachyFieldError, tn as PeachyFieldLabel, nn as PeachyGridTable, on as PeachyGridTableCell, sn as PeachyGridTableHeadingCell, cn as PeachyGridTableRow, un as PeachySeparator, gn as PeachySwitchButton, pn as PeachySwitchField, hn as PeachySwitchStateLabel, Z as PeachyTable, St as PeachyTableBody, Ct as PeachyTableCell, wt as PeachyTableHead, Et as PeachyTableHeadingCell, Dt as PeachyTableRow, vn as PeachyTabs, bn as PeachyTabsActionButton, Sn as PeachyTabsButton, wn as PeachyTabsList, En as PeachyTabsPanel, bt as PeachyToolbar, Pt as PeachyVisuallyHidden, qe as RovingTabindexKey, Y as ToolbarKey, F as Weekday, we as formatDate, Te as getDate, M as getDaysOfCalendarMonth, Me as getDaysOfMonth, O as getFirstDayOfMonth, be as getFirstDayOfWeek, Se as getFirstDayOfYear, k as getLastDayOfMonth, xe as getLastDayOfTheWeek, Ce as getLastDayOfYear, j as getMonth, je as getMonths, Ae as getNameOfMonth, E as getNextDay, ge as getNextMonth, me as getNextWeek, ve as getNextYear, D as getPreviousDay, _e as getPreviousMonth, he as getPreviousWeek, ye as getPreviousYear, De as getWeekNumber, ke as getWeekdays, Oe as getYear, Ie as isDateInRange, Fe as isDateTimeInRange, L as isDisabledElement, Re as isFocusedHtmlElement, ze as isFocusedRovingTabindexElement, Le as isHtmlElement, I as isNullish, Be as isPrintableCharacter, He as isRepeatingCharacter, P as isSameDate, Ve as isTypeaheadCharacter, q as provideElement, A as removeTimezoneOffset, _t as shareDynamicIds, ht as shareId, N as sortRange, Ne as splitDaysIntoWeeks, Ue as startsWith, dt as useBemClass, pt as useCalendar, We as useCalendarGrid, G as useContext, mt as useContextProvider, K as useElements, ft as useGlobalBemClass, Ke as useGrid, Ge as useNavigableElements, W as useOptionalContext, B as useRovingTabindex, J as useSharedDynamicIds, gt as useSharedId, R as useSingleTabStop, vt as useThemeSettingsStore, $e as useTypeahead, Vt as vAriaLabelledby, Ut as vHidden };
|
package/dist/typeach.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("pinia")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`pinia`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Typeach={},e.Vue,e.pinia))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=[`aria-disabled`,`disabled`,`type`],i=(0,t.defineComponent)({__name:`Button`,props:{type:{default:`button`},disabled:{type:[Boolean,String],default:void 0}},emits:[`click`],setup(e,{emit:n}){let i=e,a=n,o=e=>{i.disabled||a(`click`,e)};return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{ref:`element`,"aria-disabled":e.disabled===!0?!0:void 0,disabled:e.disabled===`without-focus`?!0:void 0,type:e.type,onClick:o},[(0,t.renderSlot)(n.$slots,`default`)],8,r))}}),a=`
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("pinia")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`pinia`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Typeach={},e.Vue,e.pinia))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=(e,t)=>{let n=new Date(e);return n.setDate(n.getDate()+t),n},i=(e,t)=>{let n=new Date(e);return n.setMonth(n.getMonth()+t),n},a=(e,t)=>{let n=new Date(e);return n.setFullYear(n.getFullYear()+t),n},o=e=>r(e,1),s=e=>r(e,-1),c=e=>r(e,7),l=e=>r(e,-7),u=e=>i(e,1),d=e=>i(e,-1),f=e=>a(e,1),p=e=>a(e,-1),m=(e,t)=>{let n=new Date(e),r=n.getDay(),i=r>=t?r-t:6-r;return n.setDate(n.getDate()-i),n},ee=(e,t)=>r(m(e,t),6),h=e=>{let t=`${e.getFullYear()}`.padStart(4,`0`),n=`${e.getMonth()+1}`.padStart(2,`0`);return _(new Date(`${t}-${n}-01`))},g=e=>{let t=h(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t},te=e=>new Date(e.getFullYear(),0,1),ne=e=>new Date(e.getFullYear(),11,31),_=e=>{let t=new Date(e),n=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()+n),t},re=(e,t)=>Intl.DateTimeFormat(t,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}).format(e),ie=e=>e.getDate(),ae=(e,t)=>Intl.DateTimeFormat(t,{weekday:`long`}).format(e),v=e=>{let t=new Date(e);t.setDate(t.getDate()+4-t.getDay());let n=te(e);return Math.floor(((t-+n)/864e5+1)/7)},y=(e,t)=>({name:se(e,t),number:e.getMonth()+1}),b=e=>e.getFullYear(),oe=(e,t)=>Array.from({length:7}).fill(void 0).map((t,n)=>(e+n)%7+1).map(e=>ae(_(new Date(`2006-01-0${e}`)),t)),se=(e,t)=>Intl.DateTimeFormat(t,{month:`long`}).format(e),ce=e=>Array.from({length:12}).fill(void 0).map((t,n)=>y(new Date(`2006-${String(n+1).padStart(2,`0`)}-01`),e)),le=e=>{let t=[],n=h(e);for(;n.getMonth()===e.getMonth();)t.push(n),n=o(n);return t},x=(e,t)=>{let n=le(e),{daysBefore:r,daysAfter:i}=ue(e,t);return[...r,...n,...i]},S=e=>{let t=[];for(let n=0;n<e.length;n+=7)t.push(e.slice(n,n+7));return t.map(e=>({days:e,number:v(e[e.length-1])}))},ue=(e,t)=>{let n=h(e),r=n.getDay()===0?7:n.getDay(),i=g(e),a=i.getDay()===0?7:i.getDay(),c=t===1?7:t-1,l=[],u=[],d=(7-t+r)%7,f=s(n);for(;d>0;)l.push(f),f=s(f),--d;l.reverse();let p=(7-a+c)%7,m=o(i);for(;p>0;)u.push(m),m=o(m),--p;return{daysBefore:l,daysAfter:u}},C=e=>({start:e.start<e.end?e.start:e.end,end:e.start<e.end?e.end:e.start}),de=(e,t)=>{let{start:n,end:r}=C(t);return e>=n&&e<=r},fe=(e,t)=>{let{start:n,end:r}=C(t);return n.setHours(0,0,0,0),r.setHours(23,59,59,999),e>=n&&e<=r},w=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),T=function(e){return e[e.Monday=1]=`Monday`,e[e.Tuesday=2]=`Tuesday`,e[e.Wednesday=3]=`Wednesday`,e[e.Thursday=4]=`Thursday`,e[e.Friday=5]=`Friday`,e[e.Saturday=6]=`Saturday`,e[e.Sunday=7]=`Sunday`,e}({}),E=e=>e==null,pe=e=>e instanceof HTMLElement,D=e=>{let{disabled:t}=e.dataset;return e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`||!E(t)&&t!==``},me=e=>!E(e)&&e===document.activeElement,he=e=>me(e)||e.getAttribute(`tabindex`)===`0`,ge=e=>e.match(/^[\P{Cc}\P{Cn}\P{Cs}]$/u)!==null,_e=e=>ge(e)&&e!==` `,O=(e,t)=>e.length>1&&e.split(``).every(e=>e===t),k=(e,t)=>!!e?.trim().toLowerCase().startsWith(t.trim().toLowerCase()),A=(e,t=T.Monday)=>({onKeyDown(n){switch([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`].includes(n.key)&&n.preventDefault(),n.key){case`ArrowLeft`:e.value=s(e.value);break;case`ArrowRight`:e.value=o(e.value);break;case`ArrowUp`:e.value=l(e.value);break;case`ArrowDown`:e.value=c(e.value);break;case`PageUp`:e.value=n.shiftKey?p(e.value):d(e.value);break;case`PageDown`:e.value=n.shiftKey?f(e.value):u(e.value);break;case`Home`:e.value=n.shiftKey?h(e.value):m(e.value,t);break;case`End`:e.value=n.shiftKey?g(e.value):ee(e.value,t);break;default:break}}}),ve=e=>{let n=(n,r)=>{let{getElements:i,moveTo:a,isMovedTo:o}=(0,t.toValue)(e),s=i(),c=s.findIndex(e=>o(e)),l=r(c,s.length),u=s[l];u=s[n===`forwards`?l++:l--],u&&a(u,s[c])};return{moveRelatively:e=>{n(e>0?`forwards`:`backwards`,t=>t+e)},moveToEdge:e=>{n(e===`start`?`forwards`:`backwards`,(t,n)=>e===`start`?0:n-1)}}},j=e=>{let n=(e,t)=>{t.filter(t=>!e?.isSameNode(t)).forEach(e=>e.setAttribute(`tabindex`,`-1`)),e?.setAttribute(`tabindex`,`0`)},r=t=>{n(t,e()),t.focus()};(0,t.watch)(e,e=>{let[t]=e,r=e.find(e=>e.matches(`:focus`));!r&&t&&D(t)&&(t=e.find(e=>!D(e))),n(r||t,e)});let{moveRelatively:i,moveToEdge:a}=ve({getElements:e,isMovedTo:he,moveTo:r});return{moveTo:r,moveRelatively:i,moveToEdge:a}},M=Symbol(`grid`),ye=e=>{let{moveRelatively:t,moveToEdge:n,moveTo:r}=j(e);return{onKeyDown(i,a){let o=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`];if(!pe(a.target))return;o.includes(a.key)&&a.preventDefault();let s=e().filter(e=>e.matches(`[data-elements-${i}="true"]`)),[c,l]=[s[0],s[s.length-1]],u=a.target.closest(`[data-elements-${i}="true"]`);switch(a.key){case`ArrowLeft`:c?.isSameNode(u)||t?.(-1);break;case`ArrowRight`:l?.isSameNode(u)||t?.(1);break;case`ArrowUp`:return t(s.length*-1);case`ArrowDown`:return t(s.length);case`PageUp`:return t?.(s.length*-10);case`PageDown`:return t?.(s.length*10);case`Home`:a.ctrlKey?n(`start`):c&&r(c);break;case`End`:a.ctrlKey?n(`end`):l&&r(l);break;default:break}}}},be=Symbol(`roving-tabindex`),N=(e,n)=>{let{moveTo:r,moveRelatively:i,moveToEdge:a}=j(n);return{moveTo:r,moveRelatively:i,moveToEdge:a,onKeyDown(n){let r=(0,t.toValue)(e)===`vertical`,o=r?`ArrowUp`:`ArrowLeft`,s=r?`ArrowDown`:`ArrowRight`;switch([s,o,`PageUp`,`PageDown`,`Home`,`End`].includes(n.key)&&n.preventDefault(),n.key){case o:return i(-1);case s:return i(1);case`PageUp`:return i(-10);case`PageDown`:return i(10);case`Home`:return a(`start`);case`End`:return a(`end`)}}}};function xe(e,n){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e,n),!0):!1}var P=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Se=()=>{};function Ce(e,n,r={}){let{immediate:i=!0,immediateCallback:a=!1}=r,o=(0,t.shallowRef)(!1),s;function c(){s&&=(clearTimeout(s),void 0)}function l(){o.value=!1,c()}function u(...r){a&&e(),c(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...r)},(0,t.toValue)(n))}return i&&(o.value=!0,P&&u()),xe(l),{isPending:(0,t.shallowReadonly)(o),start:u,stop:l}}function we(e=1e3,n={}){let{controls:r=!1,callback:i}=n,a=Ce(i??Se,e,n),o=(0,t.computed)(()=>!a.isPending.value);return r?{ready:o,...a}:o}function F(e,n,r){return(0,t.watch)(e,n,{...r,immediate:!0})}P&&window.document,P&&window.navigator,P&&window.location;function Te(){let e=(0,t.shallowRef)(!1),n=(0,t.getCurrentInstance)();return n&&(0,t.onMounted)(()=>{e.value=!0},n),e}var Ee=e=>{let n=(0,t.ref)(``),r=we(500,{controls:!0,callback(){n.value=``}});return{type(i){let{getElements:a,moveTo:o,isMovedTo:s}=(0,t.toValue)(e);r.isPending.value&&r.stop();let c=i.toLowerCase();n.value+=c;let l=O(n.value,c)?c:n.value,u=a(),d=u.filter(e=>k(e.textContent,l)),f=u.find(e=>s(e)),p=d[d.findIndex(e=>f?.isSameNode(e))+1];p&&o(p,f),r.start()}}},De=/([\p{Ll}\d])(\p{Lu})/gu,Oe=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,ke=/(\d)\p{Ll}|(\p{L})\d/u,Ae=/[^\p{L}\d]+/giu,I=`$1\0$2`,L=``;function R(e){let t=e.trim();t=t.replace(De,I).replace(Oe,I),t=t.replace(Ae,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function je(e){let t=R(e);for(let e=0;e<t.length;e++){let n=t[e],r=ke.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function Me(e,t){let[n,r,i]=Pe(e,t);return n+r.map(Ne(t?.locale)).join(t?.delimiter??` `)+i}function z(e,t){return Me(e,{delimiter:`-`,...t})}function Ne(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function Pe(e,t={}){let n=t.split??(t.separateNumbers?je:R),r=t.prefixCharacters??L,i=t.suffixCharacters??L,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var B=(e,t)=>{let n=t?`${t}-${e}`:e;return(...e)=>{let t=[n,...e].filter(e=>typeof e==`string`).map(e=>z(e)).join(`__`),r={[t]:!0};for(let n of e.filter(e=>typeof e==`object`))for(let e of Object.keys(n)){let i=n[e];typeof i==`string`&&(r[`${t}--${i}`]=!0),typeof i==`number`&&(r[`${t}--${z(e)}-${i}`]=!0),typeof i==`boolean`&&(r[`${t}--${z(e)}`]=i)}return r}},Fe=e=>t=>B(t,e),Ie=(e,n=T.Monday,r=`en`)=>{let i=(0,t.ref)(x(e.value,(0,t.toValue)(n))),a=(0,t.computed)(()=>b(e.value)),o=(0,t.computed)(()=>y(e.value,(0,t.toValue)(r))),s=(0,t.computed)(()=>S(i.value));return(0,t.watch)((0,t.computed)(()=>`${a.value}${o.value.number}`),()=>{i.value=x(e.value,(0,t.toValue)(n))}),(0,t.watch)(()=>(0,t.toValue)(n),t=>{i.value=x(e.value,t)}),{year:a,month:o,weeks:s}},V=(e,n)=>((0,t.provide)(e,n),n),H=e=>(0,t.inject)(e,{missingContext:!0}),U=e=>(0,t.inject)(e),W=(e,n)=>{let r=(0,t.ref)(new Map),i=n?{items:r,parent:n}:(0,t.inject)(`${e}-elements`,{items:r,parent:(0,t.ref)()});return n&&(0,t.provide)(`${e}-elements`,i),{getElements:(t=!0)=>{let n=i.parent.value;if(!n)return[];let r=Array.from(n?.querySelectorAll(`[data-elements-${e}="true"]`));return Array.from(i.items.value.values()).sort((e,t)=>r.indexOf(e)-r.indexOf(t)).filter(e=>t||!D(e))},elements:(0,t.computed)(()=>Array.from(i.items.value.values()))}},G=(e,n,r)=>{let i=(0,t.inject)(`${e}-elements`,void 0);(0,t.watchEffect)(e=>{if(!n.value)return;let a=(0,t.markRaw)(n.value);r?.value?i?.items.value.delete(a):i?.items.value.set(a,n.value),e(()=>i?.items.value.delete(a))}),(0,t.onMounted)(()=>{n.value?.setAttribute(`data-elements-${e}`,`true`)}),(0,t.onBeforeUnmount)(()=>{n.value?.removeAttribute(`data-elements-${e}`)})},Le=e=>{let n=(0,t.ref)();return(0,t.computed)({set(e){n.value=e},get(){return n.value??e}})},Re=(e,t)=>{F(t,t=>{e.value=t})},ze=()=>{let e=(0,t.ref)(new Map);return{set(t,n){n?e.value.set(t,n):e.value.delete(t)},get(t){return e.value.get(t)}}},K=(e,t,n)=>{F(n,n=>{e.set(t,n)})},Be=(0,n.defineStore)(`theme-settings`,()=>{let e=(0,t.ref)(1),n=(0,t.ref)(!0),r=(e,t)=>{document.documentElement.style.setProperty(`--${e}`,t)};return F(e,e=>{document.documentElement.style.setProperty(`saturation`,`${e}`)}),F(n,e=>{r(`code-white-space`,e?`pre-wrap`:`pre`)}),{saturation:e,wrapCode:n}}),q=Symbol(`toolbar`),Ve=[`aria-orientation`,`aria-controls`],He=(0,t.defineComponent)({__name:`Toolbar`,props:{orientation:{default:`horizontal`},controls:{}},setup(e){let{orientation:n}=(0,t.toRefs)(e),r=(0,t.useTemplateRef)(`element`),{getElements:i}=W(`toolbar`,r),{onKeyDown:a}=N(n,i);return(0,t.provide)(q,{onKeyDown:a}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`element`,ref:r,"aria-orientation":(0,t.unref)(n),"aria-controls":e.controls,role:`toolbar`},[(0,t.renderSlot)(i.$slots,`default`)],8,Ve))}}),Ue=[`aria-disabled`,`disabled`,`type`],J=(0,t.defineComponent)({__name:`Button`,props:{type:{default:`button`},disabled:{type:[Boolean,String],default:void 0}},emits:[`click`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`element`),{onKeyDown:o}=H(q);G(`toolbar`,a);let s=e=>{r.disabled||i(`click`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{ref_key:`element`,ref:a,"aria-disabled":e.disabled===!0?!0:void 0,disabled:e.disabled===`without-focus`?!0:void 0,type:e.type,onClick:s,onKeydown:r[0]||=(...e)=>(0,t.unref)(o)&&(0,t.unref)(o)(...e)},[(0,t.renderSlot)(n.$slots,`default`)],40,Ue))}}),Y=(0,t.defineComponent)({__name:`Table`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),We=(0,t.defineComponent)({__name:`TableBody`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tbody`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),X=(0,t.defineComponent)({__name:`TableCell`,props:{heading:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.heading?`th`:`td`),{scope:e.heading?`row`:void 0},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},8,[`scope`]))}}),Ge=(0,t.defineComponent)({__name:`TableHead`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`thead`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ke=[`aria-sort`],qe=(0,t.defineComponent)({__name:`TableHeadingCell`,props:{sorted:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{"aria-sort":e.sorted},[(0,t.renderSlot)(n.$slots,`default`)],8,Ke))}}),Je=(0,t.defineComponent)({__name:`TableRow`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ye=Symbol(`calendar-table`),Xe=(0,t.defineComponent)({__name:`CalendarTable`,props:(0,t.mergeModels)({autoFocus:{type:Boolean}},{modelValue:{default:new Date},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=e,r=(0,t.useModel)(e,`modelValue`),i=Te();return(0,t.provide)(Ye,{focusedDate:r,allowFocus:(0,t.computed)(()=>!!n.autoFocus||i.value)}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Y),{role:`grid`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3}))}}),Ze=(0,t.defineComponent)({__name:`CalendarTableCell`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(X,{role:`gridcell`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3}))}}),Qe=[`aria-pressed`,`aria-disabled`,`aria-current`,`tabindex`],$e=(0,t.defineComponent)({__name:`CalendarTableCellButton`,props:{date:{},disabled:{type:Boolean},selected:{type:Boolean}},emits:[`click`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.useTemplateRef)(`element`),{focusedDate:o,allowFocus:s}=U(Ye),{onKeyDown:c}=A(o),l=(0,t.computed)(()=>w(r.date,o.value));return F(l,async e=>{e&&s.value&&(await(0,t.nextTick)(),a.value?.focus())}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{ref_key:`element`,ref:a,"aria-pressed":e.selected,"aria-disabled":e.disabled,"aria-current":(0,t.unref)(w)(e.date,new Date)?`date`:void 0,tabindex:l.value?0:-1,onFocus:r[0]||=t=>o.value=e.date,onKeydown:r[1]||=(...e)=>(0,t.unref)(c)&&(0,t.unref)(c)(...e),onClick:r[2]||=e=>i(`click`,e)},[(0,t.renderSlot)(n.$slots,`default`)],40,Qe))}}),et=`
|
|
2
|
+
block-size: 1px;
|
|
3
|
+
inline-size: 1px;
|
|
4
4
|
|
|
5
5
|
position: absolute;
|
|
6
6
|
overflow: hidden;
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
clip-path: inset(50%);
|
|
10
10
|
|
|
11
11
|
white-space: nowrap;
|
|
12
|
-
`,o=(0,t.defineComponent)({__name:`VisuallyHidden`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{style:a},[(0,t.renderSlot)(e.$slots,`default`)]))}}),s=(0,t.defineComponent)({__name:`CopyButton`,props:{content:{},onCopy:{type:Function}},emits:[`copy`],setup(e){let n=(0,t.ref)(!1),r=e,a=(0,t.computed)(()=>r.content?typeof r.content==`string`?[new ClipboardItem({"text/plain":r.content})]:Array.isArray(r.content)?r.content:[r.content]:[]),s=async e=>{r.content?await navigator.clipboard.write(a.value):await r.onCopy?.(e),n.value=!0,setTimeout(()=>{n.value=!1},4e3)};return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(o),{"aria-live":`polite`},{default:(0,t.withCtx)(()=>[n.value?(0,t.renderSlot)(e.$slots,`default`,{key:0,isCopying:n.value}):(0,t.createCommentVNode)(``,!0)]),_:3}),(0,t.createVNode)((0,t.unref)(i),(0,t.mergeProps)(e.$attrs,{onClick:s}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`,{isCopying:n.value})]),_:3},16)],64))}}),c=/([\p{Ll}\d])(\p{Lu})/gu,l=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,u=/(\d)\p{Ll}|(\p{L})\d/u,d=/[^\p{L}\d]+/giu,f=`$1\0$2`,p=``;function m(e){let t=e.trim();t=t.replace(c,f).replace(l,f),t=t.replace(d,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function ee(e){let t=m(e);for(let e=0;e<t.length;e++){let n=t[e],r=u.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function h(e,t){let[n,r,i]=v(e,t);return n+r.map(_(t?.locale)).join(t?.delimiter??` `)+i}function g(e,t){return h(e,{delimiter:`-`,...t})}function _(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function v(e,t={}){let n=t.split??(t.separateNumbers?ee:m),r=t.prefixCharacters??p,i=t.suffixCharacters??p,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var y=(e,t)=>{let n=t?`${t}-${e}`:e;return(...e)=>{let t=[n,...e].filter(e=>typeof e==`string`).map(e=>g(e)).join(`__`),r={[t]:!0};for(let n of e.filter(e=>typeof e==`object`))for(let e of Object.keys(n)){let i=n[e];typeof i==`string`&&(r[`${t}--${i}`]=!0),typeof i==`number`&&(r[`${t}--${g(e)}-${i}`]=!0),typeof i==`boolean`&&(r[`${t}--${g(e)}`]=i)}return r}},te=e=>t=>y(t,e),b=(e,n)=>((0,t.provide)(e,n),n),x=e=>(0,t.inject)(e,{missingContext:!0}),S=e=>(0,t.inject)(e),C=e=>e==null,w=e=>{let{disabled:t}=e.dataset;return e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`||!C(t)&&t!==``},T=(e,n)=>{let r=(0,t.ref)(new Map),i=n?{items:r,parent:n}:(0,t.inject)(`${e}-elements`,{items:r,parent:(0,t.ref)()});return n&&(0,t.provide)(`${e}-elements`,i),{getElements:(t=!0)=>{let n=i.parent.value;if(!n)return[];let r=Array.from(n?.querySelectorAll(`[data-elements-${e}="true"]`));return Array.from(i.items.value.values()).sort((e,t)=>r.indexOf(e)-r.indexOf(t)).filter(e=>t||!w(e))},elements:(0,t.computed)(()=>Array.from(i.items.value.values()))}},E=(e,n,r)=>{let i=(0,t.inject)(`${e}-elements`,void 0);(0,t.watchEffect)(e=>{if(!n.value)return;let a=(0,t.markRaw)(n.value);r?.value?i?.items.value.delete(a):i?.items.value.set(a,n.value),e(()=>i?.items.value.delete(a))}),(0,t.onMounted)(()=>{n.value?.setAttribute(`data-elements-${e}`,`true`)}),(0,t.onBeforeUnmount)(()=>{n.value?.removeAttribute(`data-elements-${e}`)})};typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function D(e,n,r){return(0,t.watch)(e,n,{...r,immediate:!0})}var O=e=>{let n=(0,t.ref)();return(0,t.computed)({set(e){n.value=e},get(){return n.value??e}})},k=(e,t)=>{D(t,t=>{e.value=t})},A=()=>{let e=(0,t.ref)(new Map);return{set(t,n){n?e.value.set(t,n):e.value.delete(t)},get(t){return e.value.get(t)}}},j=(e,t,n)=>{D(n,n=>{e.set(t,n)})},M=(0,n.defineStore)(`theme-settings`,()=>{let e=(0,t.ref)(1),n=(0,t.ref)(!0),r=(e,t)=>{document.documentElement.style.setProperty(`--${e}`,t)};return D(e,e=>{document.documentElement.style.setProperty(`saturation`,`${e}`)}),D(n,e=>{r(`code-white-space`,e?`pre-wrap`:`pre`)}),{saturation:e,wrapCode:n}}),N=Symbol(`disclosure`),P={key:0},F=(0,t.defineComponent)({__name:`Disclosure`,props:(0,t.mergeModels)({render:{type:Boolean},disabled:{type:Boolean},popover:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=e;return(0,t.provide)(N,{panelId:O((0,t.useId)()),disabled:(0,t.computed)(()=>!!r.disabled),popover:(0,t.computed)(()=>!!r.popover),open:(0,t.computed)({get(){return r.disabled?!0:n.value},set(e){n.value=e}})}),(n,r)=>e.render?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,P,[(0,t.renderSlot)(n.$slots,`default`)])):(0,t.renderSlot)(n.$slots,`default`,{key:1})}}),I=(0,t.defineComponent)({__name:`DisclosureButton`,props:{disabled:{type:[Boolean,String]}},setup(e){let{panelId:n,open:r,disabled:a,popover:o}=S(N),s=(0,t.computed)(()=>o.value?{command:`toggle-popover`,commandfor:n.value}:{onClick(){r.value=!r.value}});return(o,c)=>(0,t.unref)(a)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(i),(0,t.mergeProps)({key:0,"aria-expanded":(0,t.unref)(r),"aria-controls":(0,t.unref)(n),disabled:e.disabled},s.value),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(o.$slots,`default`)]),_:3},16,[`aria-expanded`,`aria-controls`,`disabled`]))}}),L=(0,t.ref)(0),R={beforeMount(e,{value:t}){let n=`a-l-${L.value++}`;e.setAttribute(`data-labelledby-id`,n),t&&(z(t,n),e.setAttribute(`aria-labelledby`,n))},updated(e,{value:t,oldValue:n}){if(t===n)return;let r=e.getAttribute(`data-labelledby-id`);if(r){let n=document.getElementById(r);t?n?n.innerText=t:(z(t,r),e.setAttribute(`aria-labelledby`,r)):(e.removeAttribute(`aria-labelledby`),n?.remove())}},beforeUnmount(e){let t=e.getAttribute(`data-labelledby-id`);t&&(e.removeAttribute(`aria-labelledby`),document.getElementById(t)?.remove())}},z=(e,t)=>{let n=document.createElement(`span`);return n.innerText=e,n.id=`${t}`,n.hidden=!0,document.documentElement.appendChild(n),n},B={beforeMount(e,{value:t},{transition:n}){n&&t===!1?n.beforeEnter(e):V(e,t)},mounted(e,{value:t},{transition:n}){n&&t===!1&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){t!==n&&(r?t===!1?(r.beforeEnter(e),V(e,t),r.enter(e)):r.leave(e,()=>V(e,t)):V(e,t))},beforeUnmount(e,{value:t}){V(e,t)}},V=(e,t)=>{t?e.setAttribute(`hidden`,`${t}`):e.removeAttribute(`hidden`)},H=(0,t.defineComponent)({__name:`DisclosurePanel`,props:{hideFromSearch:{type:Boolean},as:{default:`div`},id:{default:void 0}},setup(e){let n=e,{panelId:r,disabled:i,popover:a,open:o}=S(N);k(r,()=>n.id);let s=(0,t.useTemplateRef)(`element`),c=(0,t.computed)(()=>o.value?void 0:n.hideFromSearch?!0:`until-found`),l=e=>{console.log(`event`,e),e.newState===`open`?o.value=!0:o.value=!1};return(n,u)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.as),{id:(0,t.unref)(r),ref_key:`element`,ref:s,popover:(0,t.unref)(i)||!(0,t.unref)(a)?void 0:`auto`,onBeforematch:u[0]||=e=>o.value=!0,onToggle:l},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},40,[`id`,`popover`])),[[(0,t.unref)(B),c.value]])}}),U=[`id`],W=(0,t.defineComponent)({__name:`FieldDescription`,setup(e){let n=(0,t.useId)(),r=(0,t.useTemplateRef)(`element`);return E(`field-description`,r),(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{id:(0,t.unref)(n),ref_key:`element`,ref:r},[(0,t.renderSlot)(e.$slots,`default`)],8,U))}}),ne=[`id`],G=(0,t.defineComponent)({__name:`FieldError`,setup(e){let n=(0,t.useId)(),r=(0,t.useTemplateRef)(`element`);return E(`field-error`,r),(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{id:(0,t.unref)(n),ref_key:`element`,ref:r},[(0,t.renderSlot)(e.$slots,`default`)],8,ne))}}),K=Symbol(`field`),q=(e,n)=>{let{elements:r}=T(`field-error`,n),{elements:i}=T(`field-description`,n),a=e=>e.filter(e=>e.id).map(e=>e.id);return b(K,{id:e,hasErrors:(0,t.computed)(()=>r.value.length>0),errorIds:(0,t.computed)(()=>a(r.value)),descriptionIds:(0,t.computed)(()=>a(i.value))})},J=()=>S(K),Y=[`id`,`for`],X=(0,t.defineComponent)({__name:`FieldLabel`,setup(e){let{id:n}=J(),r=()=>{document.getElementById(n)?.focus()};return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{id:`${(0,t.unref)(n)}-label`,for:(0,t.unref)(n),onClick:r},[(0,t.renderSlot)(e.$slots,`default`)],8,Y))}}),Z=[`aria-orientation`],re=(0,t.defineComponent)({__name:`Separator`,props:{orientation:{default:`horizontal`}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`hr`,{"aria-orientation":e.orientation},null,8,Z))}}),Q=Symbol(`Switch-field`),ie=()=>S(Q),ae=(0,t.defineComponent)({__name:`SwitchField`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useId)(),i=(0,t.useTemplateRef)(`element`);return q(r,i),(0,t.provide)(Q,{id:r,modelValue:n}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`element`,ref:i},[(0,t.renderSlot)(e.$slots,`default`)],512))}}),oe={"aria-hidden":`true`},se=(0,t.defineComponent)({__name:`SwitchFieldStateLabel`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oe,[(0,t.renderSlot)(e.$slots,`default`)]))}}),ce=[`id`,`aria-checked`,`aria-describedby`,`aria-invalid`,`aria-labelledby`,`aria-disabled`],le=(0,t.defineComponent)({__name:`SwitchFieldSwitchButton`,props:{disabled:{type:Boolean}},setup(e){let n=e,{modelValue:r}=ie(),{id:i,hasErrors:a,errorIds:o,descriptionIds:s}=J(),c=()=>{n.disabled||(r.value=!r.value)};return(n,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{id:(0,t.unref)(i),"aria-checked":(0,t.unref)(r),"aria-describedby":[(0,t.unref)(o),(0,t.unref)(s)].flat().join(` `)||void 0,"aria-invalid":(0,t.unref)(a)?!0:void 0,"aria-labelledby":`${(0,t.unref)(i)}-label`,"aria-disabled":e.disabled,role:`switch`,type:`button`,onClick:c},[(0,t.renderSlot)(n.$slots,`default`)],8,ce))}}),$=(0,t.defineComponent)({__name:`Table`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`table`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),ue=(0,t.defineComponent)({__name:`TableBody`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tbody`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),de=(0,t.defineComponent)({__name:`TableCell`,props:{heading:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.heading?`th`:`td`),{scope:e.heading?`row`:void 0},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},8,[`scope`]))}}),fe=(0,t.defineComponent)({__name:`TableHead`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`thead`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}}),pe=[`aria-sort`],me=(0,t.defineComponent)({__name:`TableHeadingCell`,props:{sorted:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{"aria-sort":e.sorted},[(0,t.renderSlot)(n.$slots,`default`)],8,pe))}}),he=(0,t.defineComponent)({__name:`TableRow`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,null,[(0,t.renderSlot)(e.$slots,`default`)]))}});e.PeachyButton=i,e.PeachyCopyButton=s,e.PeachyDisclosure=F,e.PeachyDisclosureButton=I,e.PeachyDisclosurePanel=H,e.PeachyFieldDescription=W,e.PeachyFieldError=G,e.PeachyFieldLabel=X,e.PeachySeparator=re,e.PeachySwitchButton=le,e.PeachySwitchField=ae,e.PeachySwitchStateLabel=se,e.PeachyTable=$,e.PeachyTableBody=ue,e.PeachyTableCell=de,e.PeachyTableHead=fe,e.PeachyTableHeadingCell=me,e.PeachyTableRow=he,e.PeachyVisuallyHidden=o,e.provideElement=E,e.shareDynamicIds=A,e.shareId=O,e.useBemClass=y,e.useContext=S,e.useContextProvider=b,e.useElements=T,e.useGlobalBemClass=te,e.useOptionalContext=x,e.useSharedDynamicIds=j,e.useSharedId=k,e.useThemeSettingsStore=M,e.vAriaLabelledby=R,e.vHidden=B});
|
|
12
|
+
`,tt=(0,t.defineComponent)({__name:`VisuallyHidden`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{style:et},[(0,t.renderSlot)(e.$slots,`default`)]))}}),nt=(0,t.defineComponent)({__name:`CopyButton`,props:{content:{},onCopy:{type:Function}},emits:[`copy`],setup(e){let n=(0,t.ref)(!1),r=e,i=(0,t.computed)(()=>r.content?typeof r.content==`string`?[new ClipboardItem({"text/plain":r.content})]:Array.isArray(r.content)?r.content:[r.content]:[]),a=async e=>{r.content?await navigator.clipboard.write(i.value):await r.onCopy?.(e),n.value=!0,setTimeout(()=>{n.value=!1},4e3)};return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(tt),{"aria-live":`polite`},{default:(0,t.withCtx)(()=>[n.value?(0,t.renderSlot)(e.$slots,`default`,{key:0,isCopying:n.value}):(0,t.createCommentVNode)(``,!0)]),_:3}),(0,t.createVNode)((0,t.unref)(J),(0,t.mergeProps)(e.$attrs,{onClick:a}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`,{isCopying:n.value})]),_:3},16)],64))}}),Z=Symbol(`disclosure`),rt={key:0},it=(0,t.defineComponent)({__name:`Disclosure`,props:(0,t.mergeModels)({render:{type:Boolean},disabled:{type:Boolean},popover:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=e;return(0,t.provide)(Z,{panelId:Le((0,t.useId)()),disabled:(0,t.computed)(()=>!!r.disabled),popover:(0,t.computed)(()=>!!r.popover),open:(0,t.computed)({get(){return r.disabled?!0:n.value},set(e){n.value=e}})}),(n,r)=>e.render?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rt,[(0,t.renderSlot)(n.$slots,`default`)])):(0,t.renderSlot)(n.$slots,`default`,{key:1})}}),at=(0,t.defineComponent)({__name:`DisclosureButton`,props:{disabled:{type:[Boolean,String]}},setup(e){let{panelId:n,open:r,disabled:i,popover:a}=U(Z),o=(0,t.computed)(()=>a.value?{command:`toggle-popover`,commandfor:n.value}:{onClick(){r.value=!r.value}});return(a,s)=>(0,t.unref)(i)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(J),(0,t.mergeProps)({key:0,"aria-expanded":(0,t.unref)(r),"aria-controls":(0,t.unref)(n),disabled:e.disabled},o.value),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(a.$slots,`default`)]),_:3},16,[`aria-expanded`,`aria-controls`,`disabled`]))}}),ot=(0,t.ref)(0),st={beforeMount(e,{value:t}){let n=`a-l-${ot.value++}`;e.setAttribute(`data-labelledby-id`,n),t&&(ct(t,n),e.setAttribute(`aria-labelledby`,n))},updated(e,{value:t,oldValue:n}){if(t===n)return;let r=e.getAttribute(`data-labelledby-id`);if(r){let n=document.getElementById(r);t?n?n.innerText=t:(ct(t,r),e.setAttribute(`aria-labelledby`,r)):(e.removeAttribute(`aria-labelledby`),n?.remove())}},beforeUnmount(e){let t=e.getAttribute(`data-labelledby-id`);t&&(e.removeAttribute(`aria-labelledby`),document.getElementById(t)?.remove())}},ct=(e,t)=>{let n=document.createElement(`span`);return n.innerText=e,n.id=`${t}`,n.hidden=!0,document.documentElement.appendChild(n),n},lt={beforeMount(e,{value:t},{transition:n}){n&&t===!1?n.beforeEnter(e):Q(e,t)},mounted(e,{value:t},{transition:n}){n&&t===!1&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){t!==n&&(r?t===!1?(r.beforeEnter(e),Q(e,t),r.enter(e)):r.leave(e,()=>Q(e,t)):Q(e,t))},beforeUnmount(e,{value:t}){Q(e,t)}},Q=(e,t)=>{t?e.setAttribute(`hidden`,`${t}`):e.removeAttribute(`hidden`)},ut=(0,t.defineComponent)({__name:`DisclosurePanel`,props:{hideFromSearch:{type:Boolean},as:{default:`div`},id:{default:void 0}},setup(e){let n=e,{panelId:r,disabled:i,popover:a,open:o}=U(Z);Re(r,()=>n.id);let s=(0,t.useTemplateRef)(`element`),c=(0,t.computed)(()=>o.value?void 0:n.hideFromSearch?!0:`until-found`),l=e=>{e.newState===`open`?o.value=!0:o.value=!1};return(n,u)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.as),{id:(0,t.unref)(r),ref_key:`element`,ref:s,popover:(0,t.unref)(i)||!(0,t.unref)(a)?void 0:`auto`,onBeforematch:u[0]||=e=>o.value=!0,onToggle:l},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},40,[`id`,`popover`])),[[(0,t.unref)(lt),c.value]])}}),dt=[`href`,`download`],ft=(0,t.defineComponent)({__name:`DownloadLink`,props:{url:{},filename:{}},setup(e){let n=(0,t.useTemplateRef)(`element`),{onKeyDown:r}=H(q);return G(`toolbar`,n),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{ref_key:`element`,ref:n,href:e.url,download:e.filename||!0,onKeydown:a[0]||=(...e)=>(0,t.unref)(r)&&(0,t.unref)(r)(...e)},[(0,t.renderSlot)(i.$slots,`default`)],40,dt))}}),pt=[`id`],mt=(0,t.defineComponent)({__name:`FieldDescription`,setup(e){let n=(0,t.useId)(),r=(0,t.useTemplateRef)(`element`);return G(`field-description`,r),(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{id:(0,t.unref)(n),ref_key:`element`,ref:r},[(0,t.renderSlot)(e.$slots,`default`)],8,pt))}}),ht=[`id`],gt=(0,t.defineComponent)({__name:`FieldError`,setup(e){let n=(0,t.useId)(),r=(0,t.useTemplateRef)(`element`);return G(`field-error`,r),(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{id:(0,t.unref)(n),ref_key:`element`,ref:r},[(0,t.renderSlot)(e.$slots,`default`)],8,ht))}}),_t=Symbol(`field`),vt=(e,n)=>{let{elements:r}=W(`field-error`,n),{elements:i}=W(`field-description`,n),a=e=>e.filter(e=>e.id).map(e=>e.id);return V(_t,{id:e,hasErrors:(0,t.computed)(()=>r.value.length>0),errorIds:(0,t.computed)(()=>a(r.value)),descriptionIds:(0,t.computed)(()=>a(i.value))})},yt=()=>U(_t),bt=[`id`,`for`],xt=(0,t.defineComponent)({__name:`FieldLabel`,setup(e){let{id:n}=yt(),r=()=>{document.getElementById(n)?.focus()};return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{id:`${(0,t.unref)(n)}-label`,for:(0,t.unref)(n),onClick:r},[(0,t.renderSlot)(e.$slots,`default`)],8,bt))}}),St=(0,t.defineComponent)({__name:`GridTable`,setup(e){let n=(0,t.useTemplateRef)(`element`),r=(0,t.computed)(()=>n.value?.$el),{getElements:i}=W(`table`,r),{onKeyDown:a}=ye(i);return(0,t.provide)(M,{onKeyDown:a}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(Y,{ref_key:`element`,ref:r,role:`grid`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3},512))}}),Ct=e=>{let n=(0,t.computed)(()=>e.value?.$el),r=U(wt);G(`table`,n),G(r,n);let{onKeyDown:i}=U(M);return{onKeyDown:i,rowId:r}},wt=Symbol(`row`),Tt=(0,t.defineComponent)({__name:`GridTableCell`,props:{heading:{type:Boolean}},setup(e){let{rowId:n,onKeyDown:r}=Ct((0,t.useTemplateRef)(`element`));return(i,a)=>((0,t.openBlock)(),(0,t.createBlock)(X,{ref:`element`,heading:e.heading,role:`gridcell`,onKeydown:a[0]||=e=>(0,t.unref)(r)((0,t.unref)(n),e)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`default`)]),_:3},8,[`heading`]))}}),Et=(0,t.defineComponent)({__name:`GridTableHeadingCell`,props:{sorted:{}},setup(e){let{rowId:n,onKeyDown:r}=Ct((0,t.useTemplateRef)(`element`));return(i,a)=>((0,t.openBlock)(),(0,t.createBlock)(qe,{ref:`element`,role:`gridcell`,sorted:e.sorted,onKeydown:a[0]||=e=>(0,t.unref)(r)((0,t.unref)(n),e)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`default`)]),_:3},8,[`sorted`]))}}),Dt=(0,t.defineComponent)({__name:`GridTableRow`,setup(e){return(0,t.provide)(wt,(0,t.useId)()),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(Je,null,{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3}))}}),Ot=[`aria-orientation`],kt=(0,t.defineComponent)({__name:`Separator`,props:{orientation:{default:`horizontal`}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`hr`,{"aria-orientation":e.orientation},null,8,Ot))}}),At=Symbol(`Switch-field`),jt=()=>U(At),Mt=(0,t.defineComponent)({__name:`SwitchField`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useId)(),i=(0,t.useTemplateRef)(`element`);return vt(r,i),(0,t.provide)(At,{id:r,modelValue:n}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`element`,ref:i},[(0,t.renderSlot)(e.$slots,`default`)],512))}}),Nt={"aria-hidden":`true`},Pt=(0,t.defineComponent)({__name:`SwitchFieldStateLabel`,setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Nt,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ft=(0,t.defineComponent)({__name:`SwitchFieldSwitchButton`,props:{disabled:{type:Boolean}},setup(e){let{modelValue:n}=jt(),{id:r,hasErrors:i,errorIds:a,descriptionIds:o}=yt();return(s,c)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(J),{id:(0,t.unref)(r),"aria-checked":(0,t.unref)(n),"aria-describedby":[(0,t.unref)(a),(0,t.unref)(o)].flat().join(` `)||void 0,"aria-invalid":(0,t.unref)(i)?!0:void 0,"aria-labelledby":`${(0,t.unref)(r)}-label`,disabled:e.disabled,role:`switch`,onClick:c[0]||=e=>n.value=!(0,t.unref)(n)},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(s.$slots,`default`)]),_:3},8,[`id`,`aria-checked`,`aria-describedby`,`aria-invalid`,`aria-labelledby`,`disabled`]))}}),$=Symbol(`tabs`),It=Symbol(`tabs-list`),Lt=(0,t.defineComponent)({__name:`Tabs`,props:(0,t.mergeModels)({as:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`);return(0,t.provide)($,{ids:ze(),selectedPanel:n}),(n,r)=>e.as?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.as),{key:0},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3})):(0,t.renderSlot)(n.$slots,`default`,{key:1})}}),Rt=[`tabindex`],zt=(0,t.defineComponent)({__name:`TabsActionButton`,props:{value:{}},emits:[`click`],setup(e,{emit:n}){let r=n,{selectedPanel:i}=U($);return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{ref:`button`,tabindex:(0,t.unref)(i)===e.value?0:-1,type:`button`,onClick:a[0]||=e=>r(`click`,e)},[(0,t.renderSlot)(n.$slots,`default`)],8,Rt))}}),Bt=[`id`,`aria-selected`,`aria-controls`],Vt=(0,t.defineComponent)({__name:`TabsButton`,props:{value:{},id:{default:e=>`${(0,t.useId)()}-${e.value}-button`}},emits:[`delete`],setup(e,{emit:n}){let r=e,i=(0,t.useTemplateRef)(`element`);G(`tabs-list`,i);let a=n,{selectedPanel:o,ids:s}=U($);K(s,`${r.value}-button`,()=>r.id);let{onKeyDown:c,selectionFollowsFocus:l}=U(It);return(0,t.onBeforeMount)(()=>{o.value||=r.value}),(n,u)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{id:e.id,ref_key:`element`,ref:i,"aria-selected":(0,t.unref)(o)===e.value,"aria-controls":(0,t.unref)(s).get(`${r.value}-panel`),type:`button`,role:`tab`,onClick:u[0]||=t=>o.value=e.value,onFocus:u[1]||=n=>(0,t.unref)(l)?o.value=e.value:void 0,onKeydown:[u[2]||=(0,t.withKeys)(e=>a(`delete`),[`delete`]),u[3]||=(...e)=>(0,t.unref)(c)&&(0,t.unref)(c)(...e)]},[(0,t.renderSlot)(n.$slots,`default`)],40,Bt))}}),Ht=[`aria-orientation`],Ut=(0,t.defineComponent)({__name:`TabsList`,props:{orientation:{default:`horizontal`},selectionFollowsFocus:{type:Boolean}},setup(e){let n=e,{orientation:r}=(0,t.toRefs)(n),i=(0,t.useTemplateRef)(`element`),{getElements:a}=W(`tabs-list`,i),{onKeyDown:o}=N(r,a);return(0,t.provide)(It,{selectionFollowsFocus:(0,t.computed)(()=>!!n.selectionFollowsFocus),onKeyDown:o}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`element`,ref:i,"aria-orientation":(0,t.unref)(r),role:`tablist`},[(0,t.renderSlot)(e.$slots,`default`)],8,Ht))}}),Wt=[`id`,`aria-labelledby`],Gt=(0,t.defineComponent)({__name:`TabsPanel`,props:{value:{},id:{default:e=>`${(0,t.useId)()}-${e.value}-panel`}},setup(e){let n=e,{selectedPanel:r,ids:i}=U($);K(i,`${n.value}-panel`,()=>n.id);let a=(0,t.computed)(()=>r.value===n.value);return(r,o)=>a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,id:e.id,ref:`button`,"aria-labelledby":(0,t.unref)(i).get(`${n.value}-button`),tabindex:`-1`,role:`tabpanel`},[(0,t.renderSlot)(r.$slots,`default`)],8,Wt)):(0,t.createCommentVNode)(``,!0)}});e.GridKey=M,e.PeachyButton=J,e.PeachyCalendarTable=Xe,e.PeachyCalendarTableCell=Ze,e.PeachyCalendarTableCellButton=$e,e.PeachyCopyButton=nt,e.PeachyDisclosure=it,e.PeachyDisclosureButton=at,e.PeachyDisclosurePanel=ut,e.PeachyDownloadLink=ft,e.PeachyFieldDescription=mt,e.PeachyFieldError=gt,e.PeachyFieldLabel=xt,e.PeachyGridTable=St,e.PeachyGridTableCell=Tt,e.PeachyGridTableHeadingCell=Et,e.PeachyGridTableRow=Dt,e.PeachySeparator=kt,e.PeachySwitchButton=Ft,e.PeachySwitchField=Mt,e.PeachySwitchStateLabel=Pt,e.PeachyTable=Y,e.PeachyTableBody=We,e.PeachyTableCell=X,e.PeachyTableHead=Ge,e.PeachyTableHeadingCell=qe,e.PeachyTableRow=Je,e.PeachyTabs=Lt,e.PeachyTabsActionButton=zt,e.PeachyTabsButton=Vt,e.PeachyTabsList=Ut,e.PeachyTabsPanel=Gt,e.PeachyToolbar=He,e.PeachyVisuallyHidden=tt,e.RovingTabindexKey=be,e.ToolbarKey=q,e.Weekday=T,e.formatDate=re,e.getDate=ie,e.getDaysOfCalendarMonth=x,e.getDaysOfMonth=le,e.getFirstDayOfMonth=h,e.getFirstDayOfWeek=m,e.getFirstDayOfYear=te,e.getLastDayOfMonth=g,e.getLastDayOfTheWeek=ee,e.getLastDayOfYear=ne,e.getMonth=y,e.getMonths=ce,e.getNameOfMonth=se,e.getNextDay=o,e.getNextMonth=u,e.getNextWeek=c,e.getNextYear=f,e.getPreviousDay=s,e.getPreviousMonth=d,e.getPreviousWeek=l,e.getPreviousYear=p,e.getWeekNumber=v,e.getWeekdays=oe,e.getYear=b,e.isDateInRange=fe,e.isDateTimeInRange=de,e.isDisabledElement=D,e.isFocusedHtmlElement=me,e.isFocusedRovingTabindexElement=he,e.isHtmlElement=pe,e.isNullish=E,e.isPrintableCharacter=ge,e.isRepeatingCharacter=O,e.isSameDate=w,e.isTypeaheadCharacter=_e,e.provideElement=G,e.removeTimezoneOffset=_,e.shareDynamicIds=ze,e.shareId=Le,e.sortRange=C,e.splitDaysIntoWeeks=S,e.startsWith=k,e.useBemClass=B,e.useCalendar=Ie,e.useCalendarGrid=A,e.useContext=U,e.useContextProvider=V,e.useElements=W,e.useGlobalBemClass=Fe,e.useGrid=ye,e.useNavigableElements=ve,e.useOptionalContext=H,e.useRovingTabindex=N,e.useSharedDynamicIds=K,e.useSharedId=Re,e.useSingleTabStop=j,e.useThemeSettingsStore=Be,e.useTypeahead=Ee,e.vAriaLabelledby=st,e.vHidden=lt});
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typeach/core",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "An unstyled component library for Vue.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"accessibility",
|
|
7
|
+
"components",
|
|
8
|
+
"vue"
|
|
9
|
+
],
|
|
5
10
|
"homepage": "https://sq11y.github.io/typeach/",
|
|
6
11
|
"license": "MIT",
|
|
7
12
|
"repository": {
|
package/dist/favicon.ico
DELETED
|
Binary file
|