@code-coaching/vuetiful 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/styles/all.css +280 -51
- package/dist/types/components/atoms/VRadio/VRadioDescription.vue.d.ts +8 -0
- package/dist/types/components/atoms/VRadio/VRadioGroup.vue.d.ts +55 -0
- package/dist/types/components/atoms/VRadio/VRadioItem.vue.d.ts +12 -0
- package/dist/types/components/atoms/VRadio/VRadioLabel.vue.d.ts +14 -0
- package/dist/types/components/atoms/index.d.ts +5 -1
- package/dist/types/components/index.d.ts +2 -3
- package/dist/vuetiful.es.mjs +666 -111
- package/dist/vuetiful.umd.js +14 -11
- package/package.json +2 -1
- package/src/components/atoms/VRadio/VRadioDescription.vue +11 -0
- package/src/components/atoms/VRadio/VRadioGroup.vue +60 -0
- package/src/components/atoms/VRadio/VRadioItem.vue +26 -0
- package/src/components/atoms/VRadio/VRadioLabel.vue +16 -0
- package/src/components/atoms/index.ts +6 -3
- package/src/components/index.ts +2 -4
- package/src/components/atoms/VRadioGroup.vue +0 -42
- package/src/components/atoms/VRadioItem.vue +0 -154
package/dist/vuetiful.es.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, renderSlot, normalizeClass, defineComponent, createBlock, resolveDynamicComponent, withCtx,
|
|
1
|
+
import { openBlock, createElementBlock, renderSlot, normalizeClass, defineComponent, createBlock, resolveDynamicComponent, withCtx, Fragment, cloneVNode, h as h$1, watchEffect, computed, ref, provide, onMounted, onUnmounted, unref, inject, toRaw, watch, createElementVNode, reactive, readonly, toRefs, createVNode, Transition, createCommentVNode, useAttrs, mergeProps, toDisplayString, withDirectives, createTextVNode, resolveComponent, renderList, pushScopeId, popScopeId } from "vue";
|
|
2
2
|
var _export_sfc = (sfc, props) => {
|
|
3
3
|
const target = sfc.__vccOpts || sfc;
|
|
4
4
|
for (const [key, val] of props) {
|
|
@@ -6,7 +6,7 @@ var _export_sfc = (sfc, props) => {
|
|
|
6
6
|
}
|
|
7
7
|
return target;
|
|
8
8
|
};
|
|
9
|
-
const _sfc_main$
|
|
9
|
+
const _sfc_main$d = {};
|
|
10
10
|
const _hoisted_1$7 = {
|
|
11
11
|
class: /* @__PURE__ */ normalizeClass(`vuetiful-badge badge`)
|
|
12
12
|
};
|
|
@@ -15,8 +15,8 @@ function _sfc_render$3(_ctx, _cache) {
|
|
|
15
15
|
renderSlot(_ctx.$slots, "default")
|
|
16
16
|
]);
|
|
17
17
|
}
|
|
18
|
-
var VBadge = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
19
|
-
const _sfc_main$
|
|
18
|
+
var VBadge = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$3]]);
|
|
19
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
20
20
|
__name: "VButton",
|
|
21
21
|
props: {
|
|
22
22
|
icon: {
|
|
@@ -66,7 +66,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
const _sfc_main$
|
|
69
|
+
const _sfc_main$b = {};
|
|
70
70
|
const _hoisted_1$6 = {
|
|
71
71
|
class: /* @__PURE__ */ normalizeClass(`vuetiful-chip chip`)
|
|
72
72
|
};
|
|
@@ -75,7 +75,558 @@ function _sfc_render$2(_ctx, _cache) {
|
|
|
75
75
|
renderSlot(_ctx.$slots, "default")
|
|
76
76
|
]);
|
|
77
77
|
}
|
|
78
|
-
var VChip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
78
|
+
var VChip = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$2]]);
|
|
79
|
+
function u(r2, n2, ...a2) {
|
|
80
|
+
if (r2 in n2) {
|
|
81
|
+
let e2 = n2[r2];
|
|
82
|
+
return typeof e2 == "function" ? e2(...a2) : e2;
|
|
83
|
+
}
|
|
84
|
+
let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e2) => `"${e2}"`).join(", ")}.`);
|
|
85
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t2, u), t2;
|
|
86
|
+
}
|
|
87
|
+
var N$1 = ((o2) => (o2[o2.None = 0] = "None", o2[o2.RenderStrategy = 1] = "RenderStrategy", o2[o2.Static = 2] = "Static", o2))(N$1 || {}), S = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(S || {});
|
|
88
|
+
function H$2({ visible: r2 = true, features: t2 = 0, ourProps: e2, theirProps: o2, ...i2 }) {
|
|
89
|
+
var a2;
|
|
90
|
+
let n2 = j$1(o2, e2), l = Object.assign(i2, { props: n2 });
|
|
91
|
+
if (r2 || t2 & 2 && n2.static)
|
|
92
|
+
return y$1(l);
|
|
93
|
+
if (t2 & 1) {
|
|
94
|
+
let d2 = (a2 = n2.unmount) == null || a2 ? 0 : 1;
|
|
95
|
+
return u(d2, { [0]() {
|
|
96
|
+
return null;
|
|
97
|
+
}, [1]() {
|
|
98
|
+
return y$1({ ...i2, props: { ...n2, hidden: true, style: { display: "none" } } });
|
|
99
|
+
} });
|
|
100
|
+
}
|
|
101
|
+
return y$1(l);
|
|
102
|
+
}
|
|
103
|
+
function y$1({ props: r2, attrs: t2, slots: e2, slot: o2, name: i2 }) {
|
|
104
|
+
var m2, h2;
|
|
105
|
+
let { as: n2, ...l } = T$2(r2, ["unmount", "static"]), a2 = (m2 = e2.default) == null ? void 0 : m2.call(e2, o2), d2 = {};
|
|
106
|
+
if (o2) {
|
|
107
|
+
let u2 = false, c2 = [];
|
|
108
|
+
for (let [p2, f2] of Object.entries(o2))
|
|
109
|
+
typeof f2 == "boolean" && (u2 = true), f2 === true && c2.push(p2);
|
|
110
|
+
u2 && (d2["data-headlessui-state"] = c2.join(" "));
|
|
111
|
+
}
|
|
112
|
+
if (n2 === "template") {
|
|
113
|
+
if (a2 = b$1(a2 != null ? a2 : []), Object.keys(l).length > 0 || Object.keys(t2).length > 0) {
|
|
114
|
+
let [u2, ...c2] = a2 != null ? a2 : [];
|
|
115
|
+
if (!v(u2) || c2.length > 0)
|
|
116
|
+
throw new Error(['Passing props on "template"!', "", `The current component <${i2} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(l).concat(Object.keys(t2)).map((s2) => s2.trim()).filter((s2, g, R) => R.indexOf(s2) === g).sort((s2, g) => s2.localeCompare(g)).map((s2) => ` - ${s2}`).join(`
|
|
117
|
+
`), "", "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((s2) => ` - ${s2}`).join(`
|
|
118
|
+
`)].join(`
|
|
119
|
+
`));
|
|
120
|
+
let p2 = j$1((h2 = u2.props) != null ? h2 : {}, l), f2 = cloneVNode(u2, p2);
|
|
121
|
+
for (let s2 in p2)
|
|
122
|
+
s2.startsWith("on") && (f2.props || (f2.props = {}), f2.props[s2] = p2[s2]);
|
|
123
|
+
return f2;
|
|
124
|
+
}
|
|
125
|
+
return Array.isArray(a2) && a2.length === 1 ? a2[0] : a2;
|
|
126
|
+
}
|
|
127
|
+
return h$1(n2, Object.assign({}, l, d2), { default: () => a2 });
|
|
128
|
+
}
|
|
129
|
+
function b$1(r2) {
|
|
130
|
+
return r2.flatMap((t2) => t2.type === Fragment ? b$1(t2.children) : [t2]);
|
|
131
|
+
}
|
|
132
|
+
function j$1(...r2) {
|
|
133
|
+
if (r2.length === 0)
|
|
134
|
+
return {};
|
|
135
|
+
if (r2.length === 1)
|
|
136
|
+
return r2[0];
|
|
137
|
+
let t2 = {}, e2 = {};
|
|
138
|
+
for (let i2 of r2)
|
|
139
|
+
for (let n2 in i2)
|
|
140
|
+
n2.startsWith("on") && typeof i2[n2] == "function" ? (e2[n2] != null || (e2[n2] = []), e2[n2].push(i2[n2])) : t2[n2] = i2[n2];
|
|
141
|
+
if (t2.disabled || t2["aria-disabled"])
|
|
142
|
+
return Object.assign(t2, Object.fromEntries(Object.keys(e2).map((i2) => [i2, void 0])));
|
|
143
|
+
for (let i2 in e2)
|
|
144
|
+
Object.assign(t2, { [i2](n2, ...l) {
|
|
145
|
+
let a2 = e2[i2];
|
|
146
|
+
for (let d2 of a2) {
|
|
147
|
+
if (n2 instanceof Event && n2.defaultPrevented)
|
|
148
|
+
return;
|
|
149
|
+
d2(n2, ...l);
|
|
150
|
+
}
|
|
151
|
+
} });
|
|
152
|
+
return t2;
|
|
153
|
+
}
|
|
154
|
+
function K$1(r2) {
|
|
155
|
+
let t2 = Object.assign({}, r2);
|
|
156
|
+
for (let e2 in t2)
|
|
157
|
+
t2[e2] === void 0 && delete t2[e2];
|
|
158
|
+
return t2;
|
|
159
|
+
}
|
|
160
|
+
function T$2(r2, t2 = []) {
|
|
161
|
+
let e2 = Object.assign({}, r2);
|
|
162
|
+
for (let o2 of t2)
|
|
163
|
+
o2 in e2 && delete e2[o2];
|
|
164
|
+
return e2;
|
|
165
|
+
}
|
|
166
|
+
function v(r2) {
|
|
167
|
+
return r2 == null ? false : typeof r2.type == "string" || typeof r2.type == "object" || typeof r2.type == "function";
|
|
168
|
+
}
|
|
169
|
+
let e$1 = 0;
|
|
170
|
+
function n$1() {
|
|
171
|
+
return ++e$1;
|
|
172
|
+
}
|
|
173
|
+
function t() {
|
|
174
|
+
return n$1();
|
|
175
|
+
}
|
|
176
|
+
var o$1 = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o$1 || {});
|
|
177
|
+
function o(n2) {
|
|
178
|
+
var l;
|
|
179
|
+
return n2 == null || n2.value == null ? null : (l = n2.value.$el) != null ? l : n2.value;
|
|
180
|
+
}
|
|
181
|
+
var i = Object.defineProperty;
|
|
182
|
+
var d$3 = (t2, e2, r2) => e2 in t2 ? i(t2, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e2] = r2;
|
|
183
|
+
var n = (t2, e2, r2) => (d$3(t2, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2);
|
|
184
|
+
class s$1 {
|
|
185
|
+
constructor() {
|
|
186
|
+
n(this, "current", this.detect());
|
|
187
|
+
n(this, "currentId", 0);
|
|
188
|
+
}
|
|
189
|
+
set(e2) {
|
|
190
|
+
this.current !== e2 && (this.currentId = 0, this.current = e2);
|
|
191
|
+
}
|
|
192
|
+
reset() {
|
|
193
|
+
this.set(this.detect());
|
|
194
|
+
}
|
|
195
|
+
nextId() {
|
|
196
|
+
return ++this.currentId;
|
|
197
|
+
}
|
|
198
|
+
get isServer() {
|
|
199
|
+
return this.current === "server";
|
|
200
|
+
}
|
|
201
|
+
get isClient() {
|
|
202
|
+
return this.current === "client";
|
|
203
|
+
}
|
|
204
|
+
detect() {
|
|
205
|
+
return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client";
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
let c$2 = new s$1();
|
|
209
|
+
function m(r2) {
|
|
210
|
+
if (c$2.isServer)
|
|
211
|
+
return null;
|
|
212
|
+
if (r2 instanceof Node)
|
|
213
|
+
return r2.ownerDocument;
|
|
214
|
+
if (r2 != null && r2.hasOwnProperty("value")) {
|
|
215
|
+
let n2 = o(r2);
|
|
216
|
+
if (n2)
|
|
217
|
+
return n2.ownerDocument;
|
|
218
|
+
}
|
|
219
|
+
return document;
|
|
220
|
+
}
|
|
221
|
+
function p$2({ container: e2, accept: t2, walk: d2, enabled: o2 }) {
|
|
222
|
+
watchEffect(() => {
|
|
223
|
+
let r2 = e2.value;
|
|
224
|
+
if (!r2 || o2 !== void 0 && !o2.value)
|
|
225
|
+
return;
|
|
226
|
+
let l = m(e2);
|
|
227
|
+
if (!l)
|
|
228
|
+
return;
|
|
229
|
+
let c2 = Object.assign((f2) => t2(f2), { acceptNode: t2 }), n2 = l.createTreeWalker(r2, NodeFilter.SHOW_ELEMENT, c2, false);
|
|
230
|
+
for (; n2.nextNode(); )
|
|
231
|
+
d2(n2.currentNode);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
let c$1 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => `${e2}:not([tabindex='-1'])`).join(",");
|
|
235
|
+
var N = ((n2) => (n2[n2.First = 1] = "First", n2[n2.Previous = 2] = "Previous", n2[n2.Next = 4] = "Next", n2[n2.Last = 8] = "Last", n2[n2.WrapAround = 16] = "WrapAround", n2[n2.NoScroll = 32] = "NoScroll", n2))(N || {}), T$1 = ((o2) => (o2[o2.Error = 0] = "Error", o2[o2.Overflow = 1] = "Overflow", o2[o2.Success = 2] = "Success", o2[o2.Underflow = 3] = "Underflow", o2))(T$1 || {}), F = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(F || {});
|
|
236
|
+
function E$1(e2 = document.body) {
|
|
237
|
+
return e2 == null ? [] : Array.from(e2.querySelectorAll(c$1)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
238
|
+
}
|
|
239
|
+
var h = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(h || {});
|
|
240
|
+
var y = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(y || {});
|
|
241
|
+
typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e2) => {
|
|
242
|
+
e2.metaKey || e2.altKey || e2.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
243
|
+
}, true), document.addEventListener("click", (e2) => {
|
|
244
|
+
e2.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e2.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
245
|
+
}, true));
|
|
246
|
+
let H$1 = ["textarea", "input"].join(",");
|
|
247
|
+
function I(e2) {
|
|
248
|
+
var r2, t2;
|
|
249
|
+
return (t2 = (r2 = e2 == null ? void 0 : e2.matches) == null ? void 0 : r2.call(e2, H$1)) != null ? t2 : false;
|
|
250
|
+
}
|
|
251
|
+
function O(e2, r2 = (t2) => t2) {
|
|
252
|
+
return e2.slice().sort((t2, l) => {
|
|
253
|
+
let o2 = r2(t2), i2 = r2(l);
|
|
254
|
+
if (o2 === null || i2 === null)
|
|
255
|
+
return 0;
|
|
256
|
+
let n2 = o2.compareDocumentPosition(i2);
|
|
257
|
+
return n2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function P(e2, r2, { sorted: t2 = true, relativeTo: l = null, skipElements: o2 = [] } = {}) {
|
|
261
|
+
var m2;
|
|
262
|
+
let i2 = (m2 = Array.isArray(e2) ? e2.length > 0 ? e2[0].ownerDocument : document : e2 == null ? void 0 : e2.ownerDocument) != null ? m2 : document, n2 = Array.isArray(e2) ? t2 ? O(e2) : e2 : E$1(e2);
|
|
263
|
+
o2.length > 0 && n2.length > 1 && (n2 = n2.filter((s2) => !o2.includes(s2))), l = l != null ? l : i2.activeElement;
|
|
264
|
+
let x = (() => {
|
|
265
|
+
if (r2 & 5)
|
|
266
|
+
return 1;
|
|
267
|
+
if (r2 & 10)
|
|
268
|
+
return -1;
|
|
269
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
270
|
+
})(), p2 = (() => {
|
|
271
|
+
if (r2 & 1)
|
|
272
|
+
return 0;
|
|
273
|
+
if (r2 & 2)
|
|
274
|
+
return Math.max(0, n2.indexOf(l)) - 1;
|
|
275
|
+
if (r2 & 4)
|
|
276
|
+
return Math.max(0, n2.indexOf(l)) + 1;
|
|
277
|
+
if (r2 & 8)
|
|
278
|
+
return n2.length - 1;
|
|
279
|
+
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
280
|
+
})(), L = r2 & 32 ? { preventScroll: true } : {}, a2 = 0, d2 = n2.length, u2;
|
|
281
|
+
do {
|
|
282
|
+
if (a2 >= d2 || a2 + d2 <= 0)
|
|
283
|
+
return 0;
|
|
284
|
+
let s2 = p2 + a2;
|
|
285
|
+
if (r2 & 16)
|
|
286
|
+
s2 = (s2 + d2) % d2;
|
|
287
|
+
else {
|
|
288
|
+
if (s2 < 0)
|
|
289
|
+
return 3;
|
|
290
|
+
if (s2 >= d2)
|
|
291
|
+
return 1;
|
|
292
|
+
}
|
|
293
|
+
u2 = n2[s2], u2 == null || u2.focus(L), a2 += x;
|
|
294
|
+
} while (u2 !== i2.activeElement);
|
|
295
|
+
return r2 & 6 && I(u2) && u2.select(), 2;
|
|
296
|
+
}
|
|
297
|
+
var a$1 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(a$1 || {});
|
|
298
|
+
let f$1 = defineComponent({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(r2, { slots: t2, attrs: d2 }) {
|
|
299
|
+
return () => {
|
|
300
|
+
let { features: e2, ...o2 } = r2, n2 = { "aria-hidden": (e2 & 2) === 2 ? true : 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", ...(e2 & 4) === 4 && (e2 & 2) !== 2 && { display: "none" } } };
|
|
301
|
+
return H$2({ ourProps: n2, theirProps: o2, slot: {}, attrs: d2, slots: t2, name: "Hidden" });
|
|
302
|
+
};
|
|
303
|
+
} });
|
|
304
|
+
function e(n2 = {}, r2 = null, t2 = []) {
|
|
305
|
+
for (let [i2, o2] of Object.entries(n2))
|
|
306
|
+
f(t2, s(r2, i2), o2);
|
|
307
|
+
return t2;
|
|
308
|
+
}
|
|
309
|
+
function s(n2, r2) {
|
|
310
|
+
return n2 ? n2 + "[" + r2 + "]" : r2;
|
|
311
|
+
}
|
|
312
|
+
function f(n2, r2, t2) {
|
|
313
|
+
if (Array.isArray(t2))
|
|
314
|
+
for (let [i2, o2] of t2.entries())
|
|
315
|
+
f(n2, s(r2, i2.toString()), o2);
|
|
316
|
+
else
|
|
317
|
+
t2 instanceof Date ? n2.push([r2, t2.toISOString()]) : typeof t2 == "boolean" ? n2.push([r2, t2 ? "1" : "0"]) : typeof t2 == "string" ? n2.push([r2, t2]) : typeof t2 == "number" ? n2.push([r2, `${t2}`]) : t2 == null ? n2.push([r2, ""]) : e(t2, r2, n2);
|
|
318
|
+
}
|
|
319
|
+
function p$1(n2) {
|
|
320
|
+
var t2;
|
|
321
|
+
let r2 = (t2 = n2 == null ? void 0 : n2.form) != null ? t2 : n2.closest("form");
|
|
322
|
+
if (r2) {
|
|
323
|
+
for (let i2 of r2.elements)
|
|
324
|
+
if (i2.tagName === "INPUT" && i2.type === "submit" || i2.tagName === "BUTTON" && i2.type === "submit" || i2.nodeName === "INPUT" && i2.type === "image") {
|
|
325
|
+
i2.click();
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function d$2(u2, e2, r2) {
|
|
331
|
+
let i2 = ref(r2 == null ? void 0 : r2.value), f2 = computed(() => u2.value !== void 0);
|
|
332
|
+
return [computed(() => f2.value ? u2.value : i2.value), function(t2) {
|
|
333
|
+
return f2.value || (i2.value = t2), e2 == null ? void 0 : e2(t2);
|
|
334
|
+
}];
|
|
335
|
+
}
|
|
336
|
+
let p = Symbol("DescriptionContext");
|
|
337
|
+
function b() {
|
|
338
|
+
let t2 = inject(p, null);
|
|
339
|
+
if (t2 === null)
|
|
340
|
+
throw new Error("Missing parent");
|
|
341
|
+
return t2;
|
|
342
|
+
}
|
|
343
|
+
function M({ slot: t2 = ref({}), name: i2 = "Description", props: o2 = {} } = {}) {
|
|
344
|
+
let e2 = ref([]);
|
|
345
|
+
function s2(n2) {
|
|
346
|
+
return e2.value.push(n2), () => {
|
|
347
|
+
let r2 = e2.value.indexOf(n2);
|
|
348
|
+
r2 !== -1 && e2.value.splice(r2, 1);
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
return provide(p, { register: s2, slot: t2, name: i2, props: o2 }), computed(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
|
|
352
|
+
}
|
|
353
|
+
let E = defineComponent({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${t()}` } }, setup(t2, { attrs: i2, slots: o2 }) {
|
|
354
|
+
let e2 = b();
|
|
355
|
+
return onMounted(() => onUnmounted(e2.register(t2.id))), () => {
|
|
356
|
+
let { name: s2 = "Description", slot: n2 = ref({}), props: r2 = {} } = e2, { id: d2, ...l } = t2, c2 = { ...Object.entries(r2).reduce((f2, [a2, g]) => Object.assign(f2, { [a2]: unref(g) }), {}), id: d2 };
|
|
357
|
+
return H$2({ ourProps: c2, theirProps: l, slot: n2.value, attrs: i2, slots: o2, name: s2 });
|
|
358
|
+
};
|
|
359
|
+
} });
|
|
360
|
+
let a = Symbol("LabelContext");
|
|
361
|
+
function d$1() {
|
|
362
|
+
let t2 = inject(a, null);
|
|
363
|
+
if (t2 === null) {
|
|
364
|
+
let n2 = new Error("You used a <Label /> component, but it is not inside a parent.");
|
|
365
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n2, d$1), n2;
|
|
366
|
+
}
|
|
367
|
+
return t2;
|
|
368
|
+
}
|
|
369
|
+
function K({ slot: t2 = {}, name: n2 = "Label", props: i2 = {} } = {}) {
|
|
370
|
+
let e2 = ref([]);
|
|
371
|
+
function l(r2) {
|
|
372
|
+
return e2.value.push(r2), () => {
|
|
373
|
+
let o2 = e2.value.indexOf(r2);
|
|
374
|
+
o2 !== -1 && e2.value.splice(o2, 1);
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
return provide(a, { register: l, slot: t2, name: n2, props: i2 }), computed(() => e2.value.length > 0 ? e2.value.join(" ") : void 0);
|
|
378
|
+
}
|
|
379
|
+
let T = defineComponent({ name: "Label", props: { as: { type: [Object, String], default: "label" }, passive: { type: [Boolean], default: false }, id: { type: String, default: () => `headlessui-label-${t()}` } }, setup(t2, { slots: n2, attrs: i2 }) {
|
|
380
|
+
let e2 = d$1();
|
|
381
|
+
return onMounted(() => onUnmounted(e2.register(t2.id))), () => {
|
|
382
|
+
let { name: l = "Label", slot: r2 = {}, props: o2 = {} } = e2, { id: p2, passive: c2, ...u2 } = t2, s2 = { ...Object.entries(o2).reduce((f2, [b2, g]) => Object.assign(f2, { [b2]: unref(g) }), {}), id: p2 };
|
|
383
|
+
return c2 && (delete s2.onClick, delete s2.htmlFor, delete u2.onClick), H$2({ ourProps: s2, theirProps: u2, slot: r2, attrs: i2, slots: n2, name: l });
|
|
384
|
+
};
|
|
385
|
+
} });
|
|
386
|
+
function re(t2, c2) {
|
|
387
|
+
return t2 === c2;
|
|
388
|
+
}
|
|
389
|
+
let j = Symbol("RadioGroupContext");
|
|
390
|
+
function H(t2) {
|
|
391
|
+
let c2 = inject(j, null);
|
|
392
|
+
if (c2 === null) {
|
|
393
|
+
let u2 = new Error(`<${t2} /> is missing a parent <RadioGroup /> component.`);
|
|
394
|
+
throw Error.captureStackTrace && Error.captureStackTrace(u2, H), u2;
|
|
395
|
+
}
|
|
396
|
+
return c2;
|
|
397
|
+
}
|
|
398
|
+
let ke = defineComponent({ name: "RadioGroup", emits: { "update:modelValue": (t2) => true }, props: { as: { type: [Object, String], default: "div" }, disabled: { type: [Boolean], default: false }, by: { type: [String, Function], default: () => re }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: true }, name: { type: String, optional: true }, id: { type: String, default: () => `headlessui-radiogroup-${t()}` } }, inheritAttrs: false, setup(t2, { emit: c2, attrs: u2, slots: E2, expose: d2 }) {
|
|
399
|
+
let s2 = ref(null), i2 = ref([]), R = K({ name: "RadioGroupLabel" }), w = M({ name: "RadioGroupDescription" });
|
|
400
|
+
d2({ el: s2, $el: s2 });
|
|
401
|
+
let [f2, S2] = d$2(computed(() => t2.modelValue), (e2) => c2("update:modelValue", e2), computed(() => t2.defaultValue)), p2 = { options: i2, value: f2, disabled: computed(() => t2.disabled), firstOption: computed(() => i2.value.find((e2) => !e2.propsRef.disabled)), containsCheckedOption: computed(() => i2.value.some((e2) => p2.compare(toRaw(e2.propsRef.value), toRaw(t2.modelValue)))), compare(e2, a2) {
|
|
402
|
+
if (typeof t2.by == "string") {
|
|
403
|
+
let n2 = t2.by;
|
|
404
|
+
return (e2 == null ? void 0 : e2[n2]) === (a2 == null ? void 0 : a2[n2]);
|
|
405
|
+
}
|
|
406
|
+
return t2.by(e2, a2);
|
|
407
|
+
}, change(e2) {
|
|
408
|
+
var n2;
|
|
409
|
+
if (t2.disabled || p2.compare(toRaw(f2.value), toRaw(e2)))
|
|
410
|
+
return false;
|
|
411
|
+
let a2 = (n2 = i2.value.find((l) => p2.compare(toRaw(l.propsRef.value), toRaw(e2)))) == null ? void 0 : n2.propsRef;
|
|
412
|
+
return a2 != null && a2.disabled ? false : (S2(e2), true);
|
|
413
|
+
}, registerOption(e2) {
|
|
414
|
+
i2.value.push(e2), i2.value = O(i2.value, (a2) => a2.element);
|
|
415
|
+
}, unregisterOption(e2) {
|
|
416
|
+
let a2 = i2.value.findIndex((n2) => n2.id === e2);
|
|
417
|
+
a2 !== -1 && i2.value.splice(a2, 1);
|
|
418
|
+
} };
|
|
419
|
+
provide(j, p2), p$2({ container: computed(() => o(s2)), accept(e2) {
|
|
420
|
+
return e2.getAttribute("role") === "radio" ? NodeFilter.FILTER_REJECT : e2.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
421
|
+
}, walk(e2) {
|
|
422
|
+
e2.setAttribute("role", "none");
|
|
423
|
+
} });
|
|
424
|
+
function m$1(e2) {
|
|
425
|
+
if (!s2.value || !s2.value.contains(e2.target))
|
|
426
|
+
return;
|
|
427
|
+
let a2 = i2.value.filter((n2) => n2.propsRef.disabled === false).map((n2) => n2.element);
|
|
428
|
+
switch (e2.key) {
|
|
429
|
+
case o$1.Enter:
|
|
430
|
+
p$1(e2.currentTarget);
|
|
431
|
+
break;
|
|
432
|
+
case o$1.ArrowLeft:
|
|
433
|
+
case o$1.ArrowUp:
|
|
434
|
+
if (e2.preventDefault(), e2.stopPropagation(), P(a2, N.Previous | N.WrapAround) === T$1.Success) {
|
|
435
|
+
let l = i2.value.find((r2) => {
|
|
436
|
+
var b2;
|
|
437
|
+
return r2.element === ((b2 = m(s2)) == null ? void 0 : b2.activeElement);
|
|
438
|
+
});
|
|
439
|
+
l && p2.change(l.propsRef.value);
|
|
440
|
+
}
|
|
441
|
+
break;
|
|
442
|
+
case o$1.ArrowRight:
|
|
443
|
+
case o$1.ArrowDown:
|
|
444
|
+
if (e2.preventDefault(), e2.stopPropagation(), P(a2, N.Next | N.WrapAround) === T$1.Success) {
|
|
445
|
+
let l = i2.value.find((r2) => {
|
|
446
|
+
var b2;
|
|
447
|
+
return r2.element === ((b2 = m(r2.element)) == null ? void 0 : b2.activeElement);
|
|
448
|
+
});
|
|
449
|
+
l && p2.change(l.propsRef.value);
|
|
450
|
+
}
|
|
451
|
+
break;
|
|
452
|
+
case o$1.Space:
|
|
453
|
+
{
|
|
454
|
+
e2.preventDefault(), e2.stopPropagation();
|
|
455
|
+
let n2 = i2.value.find((l) => {
|
|
456
|
+
var r2;
|
|
457
|
+
return l.element === ((r2 = m(l.element)) == null ? void 0 : r2.activeElement);
|
|
458
|
+
});
|
|
459
|
+
n2 && p2.change(n2.propsRef.value);
|
|
460
|
+
}
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
let v2 = computed(() => {
|
|
465
|
+
var e2;
|
|
466
|
+
return (e2 = o(s2)) == null ? void 0 : e2.closest("form");
|
|
467
|
+
});
|
|
468
|
+
return onMounted(() => {
|
|
469
|
+
watch([v2], () => {
|
|
470
|
+
if (!v2.value || t2.defaultValue === void 0)
|
|
471
|
+
return;
|
|
472
|
+
function e2() {
|
|
473
|
+
p2.change(t2.defaultValue);
|
|
474
|
+
}
|
|
475
|
+
return v2.value.addEventListener("reset", e2), () => {
|
|
476
|
+
var a2;
|
|
477
|
+
(a2 = v2.value) == null || a2.removeEventListener("reset", e2);
|
|
478
|
+
};
|
|
479
|
+
}, { immediate: true });
|
|
480
|
+
}), () => {
|
|
481
|
+
let { disabled: e$12, name: a2, id: n2, form: l, ...r2 } = t2, b2 = { ref: s2, id: n2, role: "radiogroup", "aria-labelledby": R.value, "aria-describedby": w.value, onKeydown: m$1 };
|
|
482
|
+
return h$1(Fragment, [...a2 != null && f2.value != null ? e({ [a2]: f2.value }).map(([T2, G]) => h$1(f$1, K$1({ features: a$1.Hidden, key: T2, as: "input", type: "hidden", hidden: true, readOnly: true, form: l, name: T2, value: G }))) : [], H$2({ ourProps: b2, theirProps: { ...u2, ...T$2(r2, ["modelValue", "defaultValue", "by"]) }, slot: {}, attrs: u2, slots: E2, name: "RadioGroup" })]);
|
|
483
|
+
};
|
|
484
|
+
} });
|
|
485
|
+
var ie = ((u2) => (u2[u2.Empty = 1] = "Empty", u2[u2.Active = 2] = "Active", u2))(ie || {});
|
|
486
|
+
let Ee = defineComponent({ name: "RadioGroupOption", props: { as: { type: [Object, String], default: "div" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: false }, id: { type: String, default: () => `headlessui-radiogroup-option-${t()}` } }, setup(t2, { attrs: c2, slots: u2, expose: E2 }) {
|
|
487
|
+
let d2 = H("RadioGroupOption"), s2 = K({ name: "RadioGroupLabel" }), i2 = M({ name: "RadioGroupDescription" }), R = ref(null), w = computed(() => ({ value: t2.value, disabled: t2.disabled })), f2 = ref(1);
|
|
488
|
+
E2({ el: R, $el: R });
|
|
489
|
+
let S2 = computed(() => o(R));
|
|
490
|
+
onMounted(() => d2.registerOption({ id: t2.id, element: S2, propsRef: w })), onUnmounted(() => d2.unregisterOption(t2.id));
|
|
491
|
+
let p2 = computed(() => {
|
|
492
|
+
var r2;
|
|
493
|
+
return ((r2 = d2.firstOption.value) == null ? void 0 : r2.id) === t2.id;
|
|
494
|
+
}), m2 = computed(() => d2.disabled.value || t2.disabled), v2 = computed(() => d2.compare(toRaw(d2.value.value), toRaw(t2.value))), e2 = computed(() => m2.value ? -1 : v2.value || !d2.containsCheckedOption.value && p2.value ? 0 : -1);
|
|
495
|
+
function a2() {
|
|
496
|
+
var r2;
|
|
497
|
+
d2.change(t2.value) && (f2.value |= 2, (r2 = o(R)) == null || r2.focus());
|
|
498
|
+
}
|
|
499
|
+
function n2() {
|
|
500
|
+
f2.value |= 2;
|
|
501
|
+
}
|
|
502
|
+
function l() {
|
|
503
|
+
f2.value &= -3;
|
|
504
|
+
}
|
|
505
|
+
return () => {
|
|
506
|
+
let { id: r2, value: b2, disabled: T2, ...G } = t2, N2 = { checked: v2.value, disabled: m2.value, active: Boolean(f2.value & 2) }, K2 = { id: r2, ref: R, role: "radio", "aria-checked": v2.value ? "true" : "false", "aria-labelledby": s2.value, "aria-describedby": i2.value, "aria-disabled": m2.value ? true : void 0, tabIndex: e2.value, onClick: m2.value ? void 0 : a2, onFocus: m2.value ? void 0 : n2, onBlur: m2.value ? void 0 : l };
|
|
507
|
+
return H$2({ ourProps: K2, theirProps: G, slot: N2, attrs: c2, slots: u2, name: "RadioGroupOption" });
|
|
508
|
+
};
|
|
509
|
+
} }), we = T, Se = E;
|
|
510
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
511
|
+
__name: "VRadioDescription",
|
|
512
|
+
props: {
|
|
513
|
+
as: Se.props["as"]
|
|
514
|
+
},
|
|
515
|
+
setup(__props) {
|
|
516
|
+
return (_ctx, _cache) => {
|
|
517
|
+
return openBlock(), createBlock(unref(Se), { as: __props.as }, {
|
|
518
|
+
default: withCtx(() => [
|
|
519
|
+
renderSlot(_ctx.$slots, "default")
|
|
520
|
+
]),
|
|
521
|
+
_: 3
|
|
522
|
+
}, 8, ["as"]);
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
527
|
+
__name: "VRadioGroup",
|
|
528
|
+
props: {
|
|
529
|
+
as: ke.props["as"],
|
|
530
|
+
disabled: ke.props["disabled"],
|
|
531
|
+
by: ke.props["by"],
|
|
532
|
+
modelValue: ke.props["modelValue"],
|
|
533
|
+
active: {
|
|
534
|
+
type: String,
|
|
535
|
+
default: "variant-filled"
|
|
536
|
+
},
|
|
537
|
+
hover: {
|
|
538
|
+
type: String,
|
|
539
|
+
default: "hover:variant-ghost"
|
|
540
|
+
},
|
|
541
|
+
background: {
|
|
542
|
+
type: String,
|
|
543
|
+
default: "bg-surface-200-700-token"
|
|
544
|
+
},
|
|
545
|
+
text: {
|
|
546
|
+
type: String,
|
|
547
|
+
default: "text-surface-900 dark:text-surface-50"
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
emits: ["update:modelValue"],
|
|
551
|
+
setup(__props, { emit }) {
|
|
552
|
+
const props = __props;
|
|
553
|
+
const parentModelValue = ref(props.modelValue);
|
|
554
|
+
watch(
|
|
555
|
+
() => props.modelValue,
|
|
556
|
+
(newValue) => {
|
|
557
|
+
parentModelValue.value = newValue;
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
watch(
|
|
561
|
+
() => parentModelValue.value,
|
|
562
|
+
(newValue) => {
|
|
563
|
+
console.log("test: ", newValue);
|
|
564
|
+
emit("update:modelValue", newValue);
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
provide("active", props.active);
|
|
568
|
+
provide("hover", props.hover);
|
|
569
|
+
return (_ctx, _cache) => {
|
|
570
|
+
return openBlock(), createBlock(unref(ke), {
|
|
571
|
+
modelValue: parentModelValue.value,
|
|
572
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => parentModelValue.value = $event),
|
|
573
|
+
as: __props.as,
|
|
574
|
+
disabled: __props.disabled,
|
|
575
|
+
by: __props.by,
|
|
576
|
+
class: normalizeClass(`radio-group inline-flex gap-1 p-1 ${__props.background} ${__props.text} border-token border-surface-400-500-token rounded-container-token`)
|
|
577
|
+
}, {
|
|
578
|
+
default: withCtx(() => [
|
|
579
|
+
renderSlot(_ctx.$slots, "default")
|
|
580
|
+
]),
|
|
581
|
+
_: 3
|
|
582
|
+
}, 8, ["modelValue", "as", "disabled", "by", "class"]);
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
587
|
+
__name: "VRadioItem",
|
|
588
|
+
props: {
|
|
589
|
+
value: {
|
|
590
|
+
type: [String, Number],
|
|
591
|
+
required: true
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
setup(__props) {
|
|
595
|
+
const active = inject("active") || "variant-filled";
|
|
596
|
+
const hover = inject("hover") || "hover:variant-ghost";
|
|
597
|
+
return (_ctx, _cache) => {
|
|
598
|
+
return openBlock(), createBlock(unref(Ee), { value: __props.value }, {
|
|
599
|
+
default: withCtx(({ checked, disabled }) => [
|
|
600
|
+
createElementVNode("span", {
|
|
601
|
+
class: normalizeClass(`radio-item px-4 py-1 text-center text-base rounded-token ${checked ? unref(active) : unref(hover)} ${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`)
|
|
602
|
+
}, [
|
|
603
|
+
renderSlot(_ctx.$slots, "default")
|
|
604
|
+
], 2)
|
|
605
|
+
]),
|
|
606
|
+
_: 3
|
|
607
|
+
}, 8, ["value"]);
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
612
|
+
__name: "VRadioLabel",
|
|
613
|
+
props: {
|
|
614
|
+
as: {
|
|
615
|
+
type: we.props["as"].type,
|
|
616
|
+
default: "p"
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
setup(__props) {
|
|
620
|
+
return (_ctx, _cache) => {
|
|
621
|
+
return openBlock(), createBlock(unref(we), { as: __props.as }, {
|
|
622
|
+
default: withCtx(() => [
|
|
623
|
+
renderSlot(_ctx.$slots, "default")
|
|
624
|
+
]),
|
|
625
|
+
_: 3
|
|
626
|
+
}, 8, ["as"]);
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
});
|
|
79
630
|
const selectedRailTile = ref("");
|
|
80
631
|
const useRail = () => {
|
|
81
632
|
return {
|
|
@@ -396,13 +947,17 @@ const _sfc_main$3 = defineComponent({
|
|
|
396
947
|
var components = /* @__PURE__ */ Object.freeze({
|
|
397
948
|
__proto__: null,
|
|
398
949
|
[Symbol.toStringTag]: "Module",
|
|
399
|
-
VButton: _sfc_main$
|
|
950
|
+
VButton: _sfc_main$c,
|
|
951
|
+
VBadge,
|
|
952
|
+
VChip,
|
|
953
|
+
VRadioGroup: _sfc_main$9,
|
|
954
|
+
VRadioItem: _sfc_main$8,
|
|
955
|
+
VRadioLabel: _sfc_main$7,
|
|
956
|
+
VRadioDescription: _sfc_main$a,
|
|
400
957
|
VRail: _sfc_main$5,
|
|
401
958
|
VRailTile: _sfc_main$4,
|
|
402
959
|
VShell: _sfc_main$3,
|
|
403
|
-
VDrawer: _sfc_main$6
|
|
404
|
-
VBadge,
|
|
405
|
-
VChip
|
|
960
|
+
VDrawer: _sfc_main$6
|
|
406
961
|
});
|
|
407
962
|
var main = "";
|
|
408
963
|
var tailwind = "";
|
|
@@ -464,7 +1019,7 @@ const scopeToCSSClass = (name, { prefix }) => {
|
|
|
464
1019
|
const pieces = name.split(".");
|
|
465
1020
|
return [
|
|
466
1021
|
`${prefix}${pieces.shift()}`,
|
|
467
|
-
...pieces.map((x,
|
|
1022
|
+
...pieces.map((x, i2) => `${x}${"_".repeat(i2 + 1)}`)
|
|
468
1023
|
].join(" ");
|
|
469
1024
|
}
|
|
470
1025
|
return `${prefix}${name}`;
|
|
@@ -598,21 +1153,21 @@ class TokenTreeEmitter extends TokenTree {
|
|
|
598
1153
|
return true;
|
|
599
1154
|
}
|
|
600
1155
|
}
|
|
601
|
-
function source$2(
|
|
602
|
-
if (!
|
|
1156
|
+
function source$2(re2) {
|
|
1157
|
+
if (!re2)
|
|
603
1158
|
return null;
|
|
604
|
-
if (typeof
|
|
605
|
-
return
|
|
606
|
-
return
|
|
1159
|
+
if (typeof re2 === "string")
|
|
1160
|
+
return re2;
|
|
1161
|
+
return re2.source;
|
|
607
1162
|
}
|
|
608
|
-
function lookahead$2(
|
|
609
|
-
return concat$2("(?=",
|
|
1163
|
+
function lookahead$2(re2) {
|
|
1164
|
+
return concat$2("(?=", re2, ")");
|
|
610
1165
|
}
|
|
611
|
-
function anyNumberOfTimes(
|
|
612
|
-
return concat$2("(?:",
|
|
1166
|
+
function anyNumberOfTimes(re2) {
|
|
1167
|
+
return concat$2("(?:", re2, ")*");
|
|
613
1168
|
}
|
|
614
|
-
function optional(
|
|
615
|
-
return concat$2("(?:",
|
|
1169
|
+
function optional(re2) {
|
|
1170
|
+
return concat$2("(?:", re2, ")?");
|
|
616
1171
|
}
|
|
617
1172
|
function concat$2(...args) {
|
|
618
1173
|
const joined = args.map((x) => source$2(x)).join("");
|
|
@@ -632,11 +1187,11 @@ function either$2(...args) {
|
|
|
632
1187
|
const joined = "(" + (opts.capture ? "" : "?:") + args.map((x) => source$2(x)).join("|") + ")";
|
|
633
1188
|
return joined;
|
|
634
1189
|
}
|
|
635
|
-
function countMatchGroups(
|
|
636
|
-
return new RegExp(
|
|
1190
|
+
function countMatchGroups(re2) {
|
|
1191
|
+
return new RegExp(re2.toString() + "|").exec("").length - 1;
|
|
637
1192
|
}
|
|
638
|
-
function startsWith(
|
|
639
|
-
const match =
|
|
1193
|
+
function startsWith(re2, lexeme) {
|
|
1194
|
+
const match = re2 && re2.exec(lexeme);
|
|
640
1195
|
return match && match.index === 0;
|
|
641
1196
|
}
|
|
642
1197
|
const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
@@ -645,16 +1200,16 @@ function _rewriteBackreferences(regexps, { joinWith }) {
|
|
|
645
1200
|
return regexps.map((regex) => {
|
|
646
1201
|
numCaptures += 1;
|
|
647
1202
|
const offset = numCaptures;
|
|
648
|
-
let
|
|
1203
|
+
let re2 = source$2(regex);
|
|
649
1204
|
let out = "";
|
|
650
|
-
while (
|
|
651
|
-
const match = BACKREF_RE.exec(
|
|
1205
|
+
while (re2.length > 0) {
|
|
1206
|
+
const match = BACKREF_RE.exec(re2);
|
|
652
1207
|
if (!match) {
|
|
653
|
-
out +=
|
|
1208
|
+
out += re2;
|
|
654
1209
|
break;
|
|
655
1210
|
}
|
|
656
|
-
out +=
|
|
657
|
-
|
|
1211
|
+
out += re2.substring(0, match.index);
|
|
1212
|
+
re2 = re2.substring(match.index + match[0].length);
|
|
658
1213
|
if (match[0][0] === "\\" && match[1]) {
|
|
659
1214
|
out += "\\" + String(Number(match[1]) + offset);
|
|
660
1215
|
} else {
|
|
@@ -665,7 +1220,7 @@ function _rewriteBackreferences(regexps, { joinWith }) {
|
|
|
665
1220
|
}
|
|
666
1221
|
}
|
|
667
1222
|
return out;
|
|
668
|
-
}).map((
|
|
1223
|
+
}).map((re2) => `(${re2})`).join(joinWith);
|
|
669
1224
|
}
|
|
670
1225
|
const MATCH_NOTHING_RE = /\b\B/;
|
|
671
1226
|
const IDENT_RE$2 = "[a-zA-Z]\\w*";
|
|
@@ -689,8 +1244,8 @@ const SHEBANG = (opts = {}) => {
|
|
|
689
1244
|
begin: beginShebang,
|
|
690
1245
|
end: /$/,
|
|
691
1246
|
relevance: 0,
|
|
692
|
-
"on:begin": (
|
|
693
|
-
if (
|
|
1247
|
+
"on:begin": (m2, resp) => {
|
|
1248
|
+
if (m2.index !== 0)
|
|
694
1249
|
resp.ignoreMatch();
|
|
695
1250
|
}
|
|
696
1251
|
}, opts);
|
|
@@ -816,11 +1371,11 @@ const END_SAME_AS_BEGIN = function(mode) {
|
|
|
816
1371
|
return Object.assign(
|
|
817
1372
|
mode,
|
|
818
1373
|
{
|
|
819
|
-
"on:begin": (
|
|
820
|
-
resp.data._beginMatch =
|
|
1374
|
+
"on:begin": (m2, resp) => {
|
|
1375
|
+
resp.data._beginMatch = m2[1];
|
|
821
1376
|
},
|
|
822
|
-
"on:end": (
|
|
823
|
-
if (resp.data._beginMatch !==
|
|
1377
|
+
"on:end": (m2, resp) => {
|
|
1378
|
+
if (resp.data._beginMatch !== m2[1])
|
|
824
1379
|
resp.ignoreMatch();
|
|
825
1380
|
}
|
|
826
1381
|
}
|
|
@@ -981,10 +1536,10 @@ function remapScopeNames(mode, regexes, { key }) {
|
|
|
981
1536
|
const scopeNames = mode[key];
|
|
982
1537
|
const emit = {};
|
|
983
1538
|
const positions = {};
|
|
984
|
-
for (let
|
|
985
|
-
positions[
|
|
986
|
-
emit[
|
|
987
|
-
offset += countMatchGroups(regexes[
|
|
1539
|
+
for (let i2 = 1; i2 <= regexes.length; i2++) {
|
|
1540
|
+
positions[i2 + offset] = scopeNames[i2];
|
|
1541
|
+
emit[i2 + offset] = true;
|
|
1542
|
+
offset += countMatchGroups(regexes[i2 - 1]);
|
|
988
1543
|
}
|
|
989
1544
|
mode[key] = positions;
|
|
990
1545
|
mode[key]._emit = emit;
|
|
@@ -1049,11 +1604,11 @@ function compileLanguage(language) {
|
|
|
1049
1604
|
this.matchAt = 1;
|
|
1050
1605
|
this.position = 0;
|
|
1051
1606
|
}
|
|
1052
|
-
addRule(
|
|
1607
|
+
addRule(re2, opts) {
|
|
1053
1608
|
opts.position = this.position++;
|
|
1054
1609
|
this.matchIndexes[this.matchAt] = opts;
|
|
1055
|
-
this.regexes.push([opts,
|
|
1056
|
-
this.matchAt += countMatchGroups(
|
|
1610
|
+
this.regexes.push([opts, re2]);
|
|
1611
|
+
this.matchAt += countMatchGroups(re2) + 1;
|
|
1057
1612
|
}
|
|
1058
1613
|
compile() {
|
|
1059
1614
|
if (this.regexes.length === 0) {
|
|
@@ -1063,15 +1618,15 @@ function compileLanguage(language) {
|
|
|
1063
1618
|
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: "|" }), true);
|
|
1064
1619
|
this.lastIndex = 0;
|
|
1065
1620
|
}
|
|
1066
|
-
exec(
|
|
1621
|
+
exec(s2) {
|
|
1067
1622
|
this.matcherRe.lastIndex = this.lastIndex;
|
|
1068
|
-
const match = this.matcherRe.exec(
|
|
1623
|
+
const match = this.matcherRe.exec(s2);
|
|
1069
1624
|
if (!match) {
|
|
1070
1625
|
return null;
|
|
1071
1626
|
}
|
|
1072
|
-
const
|
|
1073
|
-
const matchData = this.matchIndexes[
|
|
1074
|
-
match.splice(0,
|
|
1627
|
+
const i2 = match.findIndex((el, i3) => i3 > 0 && el !== void 0);
|
|
1628
|
+
const matchData = this.matchIndexes[i2];
|
|
1629
|
+
match.splice(0, i2);
|
|
1075
1630
|
return Object.assign(match, matchData);
|
|
1076
1631
|
}
|
|
1077
1632
|
}
|
|
@@ -1087,7 +1642,7 @@ function compileLanguage(language) {
|
|
|
1087
1642
|
if (this.multiRegexes[index2])
|
|
1088
1643
|
return this.multiRegexes[index2];
|
|
1089
1644
|
const matcher = new MultiRegex();
|
|
1090
|
-
this.rules.slice(index2).forEach(([
|
|
1645
|
+
this.rules.slice(index2).forEach(([re2, opts]) => matcher.addRule(re2, opts));
|
|
1091
1646
|
matcher.compile();
|
|
1092
1647
|
this.multiRegexes[index2] = matcher;
|
|
1093
1648
|
return matcher;
|
|
@@ -1098,22 +1653,22 @@ function compileLanguage(language) {
|
|
|
1098
1653
|
considerAll() {
|
|
1099
1654
|
this.regexIndex = 0;
|
|
1100
1655
|
}
|
|
1101
|
-
addRule(
|
|
1102
|
-
this.rules.push([
|
|
1656
|
+
addRule(re2, opts) {
|
|
1657
|
+
this.rules.push([re2, opts]);
|
|
1103
1658
|
if (opts.type === "begin")
|
|
1104
1659
|
this.count++;
|
|
1105
1660
|
}
|
|
1106
|
-
exec(
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
let result =
|
|
1661
|
+
exec(s2) {
|
|
1662
|
+
const m2 = this.getMatcher(this.regexIndex);
|
|
1663
|
+
m2.lastIndex = this.lastIndex;
|
|
1664
|
+
let result = m2.exec(s2);
|
|
1110
1665
|
if (this.resumingScanAtSamePosition()) {
|
|
1111
1666
|
if (result && result.index === this.lastIndex)
|
|
1112
1667
|
;
|
|
1113
1668
|
else {
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
result =
|
|
1669
|
+
const m22 = this.getMatcher(0);
|
|
1670
|
+
m22.lastIndex = this.lastIndex + 1;
|
|
1671
|
+
result = m22.exec(s2);
|
|
1117
1672
|
}
|
|
1118
1673
|
}
|
|
1119
1674
|
if (result) {
|
|
@@ -1364,15 +1919,15 @@ const HLJS = function(hljs2) {
|
|
|
1364
1919
|
modeBuffer = "";
|
|
1365
1920
|
}
|
|
1366
1921
|
function emitMultiClass(scope, match) {
|
|
1367
|
-
let
|
|
1922
|
+
let i2 = 1;
|
|
1368
1923
|
const max = match.length - 1;
|
|
1369
|
-
while (
|
|
1370
|
-
if (!scope._emit[
|
|
1371
|
-
|
|
1924
|
+
while (i2 <= max) {
|
|
1925
|
+
if (!scope._emit[i2]) {
|
|
1926
|
+
i2++;
|
|
1372
1927
|
continue;
|
|
1373
1928
|
}
|
|
1374
|
-
const klass = language.classNameAliases[scope[
|
|
1375
|
-
const text = match[
|
|
1929
|
+
const klass = language.classNameAliases[scope[i2]] || scope[i2];
|
|
1930
|
+
const text = match[i2];
|
|
1376
1931
|
if (klass) {
|
|
1377
1932
|
emitter.addKeyword(text, klass);
|
|
1378
1933
|
} else {
|
|
@@ -1380,7 +1935,7 @@ const HLJS = function(hljs2) {
|
|
|
1380
1935
|
processKeywords();
|
|
1381
1936
|
modeBuffer = "";
|
|
1382
1937
|
}
|
|
1383
|
-
|
|
1938
|
+
i2++;
|
|
1384
1939
|
}
|
|
1385
1940
|
}
|
|
1386
1941
|
function startNewMode(mode, match) {
|
|
@@ -1637,13 +2192,13 @@ const HLJS = function(hljs2) {
|
|
|
1637
2192
|
(name) => _highlight(name, code, false)
|
|
1638
2193
|
);
|
|
1639
2194
|
results.unshift(plaintext2);
|
|
1640
|
-
const sorted = results.sort((
|
|
1641
|
-
if (
|
|
1642
|
-
return
|
|
1643
|
-
if (
|
|
1644
|
-
if (getLanguage(
|
|
2195
|
+
const sorted = results.sort((a2, b2) => {
|
|
2196
|
+
if (a2.relevance !== b2.relevance)
|
|
2197
|
+
return b2.relevance - a2.relevance;
|
|
2198
|
+
if (a2.language && b2.language) {
|
|
2199
|
+
if (getLanguage(a2.language).supersetOf === b2.language) {
|
|
1645
2200
|
return 1;
|
|
1646
|
-
} else if (getLanguage(
|
|
2201
|
+
} else if (getLanguage(b2.language).supersetOf === a2.language) {
|
|
1647
2202
|
return -1;
|
|
1648
2203
|
}
|
|
1649
2204
|
}
|
|
@@ -9899,8 +10454,8 @@ function markdown(hljs2) {
|
|
|
9899
10454
|
ITALIC,
|
|
9900
10455
|
BOLD_WITHOUT_ITALIC,
|
|
9901
10456
|
ITALIC_WITHOUT_BOLD
|
|
9902
|
-
].forEach((
|
|
9903
|
-
|
|
10457
|
+
].forEach((m2) => {
|
|
10458
|
+
m2.contains = m2.contains.concat(CONTAINABLE);
|
|
9904
10459
|
});
|
|
9905
10460
|
CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);
|
|
9906
10461
|
const HEADER = {
|
|
@@ -10060,7 +10615,7 @@ function dart(hljs2) {
|
|
|
10060
10615
|
"Element",
|
|
10061
10616
|
"ElementList"
|
|
10062
10617
|
];
|
|
10063
|
-
const NULLABLE_BUILT_IN_TYPES = BUILT_IN_TYPES.map((
|
|
10618
|
+
const NULLABLE_BUILT_IN_TYPES = BUILT_IN_TYPES.map((e2) => `${e2}?`);
|
|
10064
10619
|
const BASIC_KEYWORDS = [
|
|
10065
10620
|
"abstract",
|
|
10066
10621
|
"as",
|
|
@@ -13231,15 +13786,15 @@ var fortran_1 = fortran;
|
|
|
13231
13786
|
function escape(value) {
|
|
13232
13787
|
return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m");
|
|
13233
13788
|
}
|
|
13234
|
-
function source$1(
|
|
13235
|
-
if (!
|
|
13789
|
+
function source$1(re2) {
|
|
13790
|
+
if (!re2)
|
|
13236
13791
|
return null;
|
|
13237
|
-
if (typeof
|
|
13238
|
-
return
|
|
13239
|
-
return
|
|
13792
|
+
if (typeof re2 === "string")
|
|
13793
|
+
return re2;
|
|
13794
|
+
return re2.source;
|
|
13240
13795
|
}
|
|
13241
|
-
function lookahead$1(
|
|
13242
|
-
return concat$1("(?=",
|
|
13796
|
+
function lookahead$1(re2) {
|
|
13797
|
+
return concat$1("(?=", re2, ")");
|
|
13243
13798
|
}
|
|
13244
13799
|
function concat$1(...args) {
|
|
13245
13800
|
const joined = args.map((x) => source$1(x)).join("");
|
|
@@ -18931,11 +19486,11 @@ var NUMERIC$1 = {
|
|
|
18931
19486
|
],
|
|
18932
19487
|
relevance: 0
|
|
18933
19488
|
};
|
|
18934
|
-
function recurRegex(
|
|
19489
|
+
function recurRegex(re2, substitution, depth) {
|
|
18935
19490
|
if (depth === -1)
|
|
18936
19491
|
return "";
|
|
18937
|
-
return
|
|
18938
|
-
return recurRegex(
|
|
19492
|
+
return re2.replace(substitution, (_) => {
|
|
19493
|
+
return recurRegex(re2, substitution, depth - 1);
|
|
18939
19494
|
});
|
|
18940
19495
|
}
|
|
18941
19496
|
function java(hljs2) {
|
|
@@ -19314,14 +19869,14 @@ function javascript$1(hljs2) {
|
|
|
19314
19869
|
response.ignoreMatch();
|
|
19315
19870
|
}
|
|
19316
19871
|
}
|
|
19317
|
-
let
|
|
19872
|
+
let m2;
|
|
19318
19873
|
const afterMatch = match.input.substring(afterMatchIndex);
|
|
19319
|
-
if (
|
|
19874
|
+
if (m2 = afterMatch.match(/^\s*=/)) {
|
|
19320
19875
|
response.ignoreMatch();
|
|
19321
19876
|
return;
|
|
19322
19877
|
}
|
|
19323
|
-
if (
|
|
19324
|
-
if (
|
|
19878
|
+
if (m2 = afterMatch.match(/^\s+extends\s+/)) {
|
|
19879
|
+
if (m2.index === 0) {
|
|
19325
19880
|
response.ignoreMatch();
|
|
19326
19881
|
return;
|
|
19327
19882
|
}
|
|
@@ -42021,15 +42576,15 @@ function subunit(hljs2) {
|
|
|
42021
42576
|
};
|
|
42022
42577
|
}
|
|
42023
42578
|
var subunit_1 = subunit;
|
|
42024
|
-
function source(
|
|
42025
|
-
if (!
|
|
42579
|
+
function source(re2) {
|
|
42580
|
+
if (!re2)
|
|
42026
42581
|
return null;
|
|
42027
|
-
if (typeof
|
|
42028
|
-
return
|
|
42029
|
-
return
|
|
42582
|
+
if (typeof re2 === "string")
|
|
42583
|
+
return re2;
|
|
42584
|
+
return re2.source;
|
|
42030
42585
|
}
|
|
42031
|
-
function lookahead(
|
|
42032
|
-
return concat("(?=",
|
|
42586
|
+
function lookahead(re2) {
|
|
42587
|
+
return concat("(?=", re2, ")");
|
|
42033
42588
|
}
|
|
42034
42589
|
function concat(...args) {
|
|
42035
42590
|
const joined = args.map((x) => source(x)).join("");
|
|
@@ -43519,7 +44074,7 @@ function twig(hljs2) {
|
|
|
43519
44074
|
"verbatim",
|
|
43520
44075
|
"with"
|
|
43521
44076
|
];
|
|
43522
|
-
TAG_NAMES = TAG_NAMES.concat(TAG_NAMES.map((
|
|
44077
|
+
TAG_NAMES = TAG_NAMES.concat(TAG_NAMES.map((t2) => `end${t2}`));
|
|
43523
44078
|
const STRING = {
|
|
43524
44079
|
scope: "string",
|
|
43525
44080
|
variants: [
|
|
@@ -43778,14 +44333,14 @@ function javascript(hljs2) {
|
|
|
43778
44333
|
response.ignoreMatch();
|
|
43779
44334
|
}
|
|
43780
44335
|
}
|
|
43781
|
-
let
|
|
44336
|
+
let m2;
|
|
43782
44337
|
const afterMatch = match.input.substring(afterMatchIndex);
|
|
43783
|
-
if (
|
|
44338
|
+
if (m2 = afterMatch.match(/^\s*=/)) {
|
|
43784
44339
|
response.ignoreMatch();
|
|
43785
44340
|
return;
|
|
43786
44341
|
}
|
|
43787
|
-
if (
|
|
43788
|
-
if (
|
|
44342
|
+
if (m2 = afterMatch.match(/^\s+extends\s+/)) {
|
|
44343
|
+
if (m2.index === 0) {
|
|
43789
44344
|
response.ignoreMatch();
|
|
43790
44345
|
return;
|
|
43791
44346
|
}
|
|
@@ -44280,7 +44835,7 @@ function typescript(hljs2) {
|
|
|
44280
44835
|
begin: "@" + IDENT_RE$12
|
|
44281
44836
|
};
|
|
44282
44837
|
const swapMode = (mode, label, replacement) => {
|
|
44283
|
-
const indx = mode.contains.findIndex((
|
|
44838
|
+
const indx = mode.contains.findIndex((m2) => m2.label === label);
|
|
44284
44839
|
if (indx === -1) {
|
|
44285
44840
|
throw new Error("can not find mode to replace");
|
|
44286
44841
|
}
|
|
@@ -44295,7 +44850,7 @@ function typescript(hljs2) {
|
|
|
44295
44850
|
]);
|
|
44296
44851
|
swapMode(tsLanguage, "shebang", hljs2.SHEBANG());
|
|
44297
44852
|
swapMode(tsLanguage, "use_strict", USE_STRICT);
|
|
44298
|
-
const functionDeclaration = tsLanguage.contains.find((
|
|
44853
|
+
const functionDeclaration = tsLanguage.contains.find((m2) => m2.label === "func.def");
|
|
44299
44854
|
functionDeclaration.relevance = 0;
|
|
44300
44855
|
Object.assign(tsLanguage, {
|
|
44301
44856
|
name: "TypeScript",
|
|
@@ -47048,7 +47603,7 @@ var themeSwitcher_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
|
47048
47603
|
const _sfc_main = defineComponent({
|
|
47049
47604
|
components: {
|
|
47050
47605
|
DarkModeSwitch,
|
|
47051
|
-
VButton: _sfc_main$
|
|
47606
|
+
VButton: _sfc_main$c
|
|
47052
47607
|
},
|
|
47053
47608
|
props: {
|
|
47054
47609
|
bgLight: {
|
|
@@ -47144,7 +47699,7 @@ const _sfc_main = defineComponent({
|
|
|
47144
47699
|
};
|
|
47145
47700
|
}
|
|
47146
47701
|
});
|
|
47147
|
-
const _withScopeId = (
|
|
47702
|
+
const _withScopeId = (n2) => (pushScopeId("data-v-3283243a"), n2 = n2(), popScopeId(), n2);
|
|
47148
47703
|
const _hoisted_1 = { class: "cc-theme-switcher" };
|
|
47149
47704
|
const _hoisted_2 = { class: "space-y-4" };
|
|
47150
47705
|
const _hoisted_3 = { class: "flex items-center justify-between" };
|
|
@@ -47218,7 +47773,7 @@ const defaultTheme = THEMES.VUETIFUL;
|
|
|
47218
47773
|
const chosenTheme = ref(defaultTheme);
|
|
47219
47774
|
const useTheme = () => {
|
|
47220
47775
|
const saveThemeToStorage = (name) => {
|
|
47221
|
-
const theme = themes.value.find((
|
|
47776
|
+
const theme = themes.value.find((t2) => t2.name === name);
|
|
47222
47777
|
if (!theme)
|
|
47223
47778
|
return;
|
|
47224
47779
|
if (isBrowser) {
|
|
@@ -47236,9 +47791,9 @@ const useTheme = () => {
|
|
|
47236
47791
|
}
|
|
47237
47792
|
};
|
|
47238
47793
|
const loadTheme = (themeName, callback) => {
|
|
47239
|
-
let themeToLoad = themes.value.find((
|
|
47794
|
+
let themeToLoad = themes.value.find((t2) => t2.name === themeName);
|
|
47240
47795
|
if (!themeToLoad)
|
|
47241
|
-
themeToLoad = themes.value.find((
|
|
47796
|
+
themeToLoad = themes.value.find((t2) => t2.name === defaultTheme) || themes.value[0];
|
|
47242
47797
|
const theme = themeToLoad;
|
|
47243
47798
|
chosenTheme.value = theme.name;
|
|
47244
47799
|
const existingStyle = document.getElementById("theme");
|
|
@@ -47291,4 +47846,4 @@ function install(app) {
|
|
|
47291
47846
|
}
|
|
47292
47847
|
}
|
|
47293
47848
|
var index = { install };
|
|
47294
|
-
export { DarkModeSwitch, themeSwitcher as ThemeSwitcher, VBadge, _sfc_main$
|
|
47849
|
+
export { DarkModeSwitch, themeSwitcher as ThemeSwitcher, VBadge, _sfc_main$c as VButton, VChip, _sfc_main$2 as VCodeBlock, _sfc_main$6 as VDrawer, _sfc_main$a as VRadioDescription, _sfc_main$9 as VRadioGroup, _sfc_main$8 as VRadioItem, _sfc_main$7 as VRadioLabel, _sfc_main$5 as VRail, _sfc_main$4 as VRailTile, _sfc_main$3 as VShell, index as default, useDarkMode, useDrawer, useRail, useTheme, clipboard as vClipboard };
|