@m3ui-vue/m3ui-vue 0.8.1 → 0.8.2
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/{MMenuItem-CDWfeU4F.js → MMenuItem-BAWmUTT3.js} +331 -165
- package/dist/MMenuItem-BAWmUTT3.js.map +1 -0
- package/dist/components/MContextMenu.vue.d.ts +25 -4
- package/dist/components/MMenu.vue.d.ts +20 -2
- package/dist/components/MMenuDivider.vue.d.ts +13 -1
- package/dist/components/MMenuItem.vue.d.ts +3 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +4002 -3872
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +8 -8
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/MCommandPalette.vue +4 -0
- package/src/components/MContextMenu.vue +287 -13
- package/src/components/MMenu.vue +308 -20
- package/src/components/MMenuDivider.vue +16 -0
- package/src/components/MMenuItem.vue +60 -18
- package/src/components/MSpotlightSearch.vue +6 -0
- package/dist/MMenuItem-CDWfeU4F.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { r as e } from "./useLocale-DbREg9Zn.js";
|
|
2
2
|
import { t } from "./MIcon-CaEooCmZ.js";
|
|
3
3
|
import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
4
|
-
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onUnmounted as b, openBlock as x, provide as S, ref as C,
|
|
4
|
+
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onUnmounted as b, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useId as k, useSlots as A, watch as j, withCtx as M, withModifiers as N } from "vue";
|
|
5
5
|
//#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var P = ["aria-label"], F = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
9
|
-
},
|
|
9
|
+
}, I = [
|
|
10
10
|
"width",
|
|
11
11
|
"height",
|
|
12
12
|
"viewBox"
|
|
13
|
-
],
|
|
13
|
+
], ee = ["d", "stroke-dasharray"], L = 3, te = 9, R = /* @__PURE__ */ p({
|
|
14
14
|
__name: "MSpinner",
|
|
15
15
|
props: {
|
|
16
16
|
size: { default: 20 },
|
|
@@ -24,7 +24,7 @@ var N = ["aria-label"], P = {
|
|
|
24
24
|
let n = t, r = e(), i = o(() => (n.size / 2 - 1 - L / 2) / 1.25), a = o(() => n.size / 2), s = o(() => {
|
|
25
25
|
let e = a.value, t = i.value, n = t * .08, r = [], o = 0, s = 0, c = 0;
|
|
26
26
|
for (let i = 0; i <= 216; i++) {
|
|
27
|
-
let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(
|
|
27
|
+
let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(te * a), u = e + l * Math.cos(a), d = e + l * Math.sin(a);
|
|
28
28
|
i > 0 && (o += Math.sqrt((u - s) ** 2 + (d - c) ** 2)), r.push(`${i === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), s = u, c = d;
|
|
29
29
|
}
|
|
30
30
|
let l = o * .58, u = o - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
|
|
@@ -41,7 +41,7 @@ var N = ["aria-label"], P = {
|
|
|
41
41
|
height: `${t.size}px`
|
|
42
42
|
}),
|
|
43
43
|
role: "status",
|
|
44
|
-
"aria-label": t.label ??
|
|
44
|
+
"aria-label": t.label ?? O(r).loading
|
|
45
45
|
}, [t.wavy ? (x(), l("svg", {
|
|
46
46
|
key: 1,
|
|
47
47
|
width: t.size,
|
|
@@ -58,9 +58,9 @@ var N = ["aria-label"], P = {
|
|
|
58
58
|
"stroke-dasharray": s.value.dash,
|
|
59
59
|
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
60
60
|
style: _({ "--m3-wave-len": s.value.len })
|
|
61
|
-
}, null, 12,
|
|
61
|
+
}, null, 12, ee)], 12, I)) : (x(), l("span", F))], 12, P));
|
|
62
62
|
}
|
|
63
|
-
}),
|
|
63
|
+
}), z = [
|
|
64
64
|
"bg-surface-container-highest",
|
|
65
65
|
"bg-surface-container-high",
|
|
66
66
|
"bg-surface-container-low",
|
|
@@ -82,10 +82,10 @@ var N = ["aria-label"], P = {
|
|
|
82
82
|
"bg-error"
|
|
83
83
|
];
|
|
84
84
|
function B(e) {
|
|
85
|
-
for (let t of
|
|
85
|
+
for (let t of z) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function ne(e) {
|
|
89
89
|
if (!e || e === "transparent") return !0;
|
|
90
90
|
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
91
91
|
if (t) {
|
|
@@ -94,7 +94,7 @@ function V(e) {
|
|
|
94
94
|
}
|
|
95
95
|
return !1;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function V(e, t) {
|
|
98
98
|
let n = C("var(--color-surface)");
|
|
99
99
|
function r(r) {
|
|
100
100
|
n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
|
|
@@ -112,7 +112,7 @@ function H(e, t) {
|
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
let n = getComputedStyle(t).backgroundColor;
|
|
115
|
-
if (!
|
|
115
|
+
if (!ne(n)) {
|
|
116
116
|
r(n);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -134,7 +134,7 @@ function H(e, t) {
|
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/composables/useDebounce.ts
|
|
137
|
-
function
|
|
137
|
+
function H(e, t) {
|
|
138
138
|
let n = null;
|
|
139
139
|
function r(...r) {
|
|
140
140
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -151,7 +151,7 @@ function U(e, t) {
|
|
|
151
151
|
}
|
|
152
152
|
//#endregion
|
|
153
153
|
//#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
|
|
154
|
-
var
|
|
154
|
+
var re = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", U = /* @__PURE__ */ p({
|
|
155
155
|
__name: "MIconButton",
|
|
156
156
|
props: {
|
|
157
157
|
icon: {},
|
|
@@ -216,13 +216,13 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
216
216
|
default: return "text-on-surface-variant";
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
|
-
return (n, i) => (x(), s(
|
|
219
|
+
return (n, i) => (x(), s(E(r.value), {
|
|
220
220
|
to: e.to || void 0,
|
|
221
221
|
type: e.to ? void 0 : "button",
|
|
222
222
|
"aria-label": e.label || void 0,
|
|
223
223
|
disabled: e.disabled,
|
|
224
224
|
class: g([
|
|
225
|
-
|
|
225
|
+
re,
|
|
226
226
|
l.value,
|
|
227
227
|
d.value,
|
|
228
228
|
c.value
|
|
@@ -233,7 +233,7 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
233
233
|
}),
|
|
234
234
|
onPointerdown: u
|
|
235
235
|
}, {
|
|
236
|
-
default:
|
|
236
|
+
default: M(() => [f(t, {
|
|
237
237
|
name: e.icon,
|
|
238
238
|
size: a.value.icon
|
|
239
239
|
}, null, 8, ["name", "size"])]),
|
|
@@ -247,7 +247,7 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
247
247
|
"style"
|
|
248
248
|
]));
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
250
|
+
}), W = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", G = /* @__PURE__ */ p({
|
|
251
251
|
__name: "MButton",
|
|
252
252
|
props: {
|
|
253
253
|
variant: { default: "filled" },
|
|
@@ -334,7 +334,7 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
334
334
|
pxText: "px-4",
|
|
335
335
|
squareRadius: "rounded-xl"
|
|
336
336
|
}
|
|
337
|
-
}, h = o(() => m[i.size] ?? m.sm), v = o(() => `${h.value.h} ${h.value.text} ${h.value.gap}`), y = o(() => h.value.icon), b = o(() => h.value.spinner), S = o(() => i.variant === "text" ? h.value.pxText : h.value.px), C = o(() => i.shape === "squared" ? h.value.squareRadius : "rounded-full"),
|
|
337
|
+
}, h = o(() => m[i.size] ?? m.sm), v = o(() => `${h.value.h} ${h.value.text} ${h.value.gap}`), y = o(() => h.value.icon), b = o(() => h.value.spinner), S = o(() => i.variant === "text" ? h.value.pxText : h.value.px), C = o(() => i.shape === "squared" ? h.value.squareRadius : "rounded-full"), w = o(() => {
|
|
338
338
|
let e = f.value;
|
|
339
339
|
switch (i.variant) {
|
|
340
340
|
case "filled": return e ? "bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
|
|
@@ -350,23 +350,23 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
350
350
|
let t = e.currentTarget, n = t.getBoundingClientRect(), r = Math.max(n.width, n.height) * 2, a = document.createElement("span");
|
|
351
351
|
a.className = "m3-ripple", a.style.cssText = `width:${r}px;height:${r}px;top:${e.clientY - n.top - r / 2}px;left:${e.clientX - n.left - r / 2}px`, t.appendChild(a), a.addEventListener("animationend", () => a.remove(), { once: !0 });
|
|
352
352
|
}
|
|
353
|
-
return (n, i) => (x(), s(
|
|
353
|
+
return (n, i) => (x(), s(E(a.value), {
|
|
354
354
|
to: e.to || void 0,
|
|
355
355
|
type: e.to ? void 0 : e.type,
|
|
356
356
|
disabled: e.disabled || e.loading,
|
|
357
357
|
class: g([
|
|
358
|
-
|
|
358
|
+
W,
|
|
359
359
|
C.value,
|
|
360
360
|
v.value,
|
|
361
361
|
S.value,
|
|
362
|
-
|
|
362
|
+
w.value,
|
|
363
363
|
p.value
|
|
364
364
|
]),
|
|
365
365
|
style: _(d.value),
|
|
366
366
|
onPointerdown: D
|
|
367
367
|
}, {
|
|
368
|
-
default:
|
|
369
|
-
e.iconPos === "leading" ? (x(), l(r, { key: 0 }, [e.loading ? (x(), s(
|
|
368
|
+
default: M(() => [
|
|
369
|
+
e.iconPos === "leading" ? (x(), l(r, { key: 0 }, [e.loading ? (x(), s(R, {
|
|
370
370
|
key: 0,
|
|
371
371
|
size: b.value
|
|
372
372
|
}, null, 8, ["size"])) : e.icon ? (x(), s(t, {
|
|
@@ -374,8 +374,8 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
374
374
|
name: e.icon,
|
|
375
375
|
size: y.value
|
|
376
376
|
}, null, 8, ["name", "size"])) : c("", !0)], 64)) : c("", !0),
|
|
377
|
-
|
|
378
|
-
e.iconPos === "trailing" ? (x(), l(r, { key: 1 }, [e.loading ? (x(), s(
|
|
377
|
+
T(n.$slots, "default"),
|
|
378
|
+
e.iconPos === "trailing" ? (x(), l(r, { key: 1 }, [e.loading ? (x(), s(R, {
|
|
379
379
|
key: 0,
|
|
380
380
|
size: b.value
|
|
381
381
|
}, null, 8, ["size"])) : e.icon ? (x(), s(t, {
|
|
@@ -393,25 +393,25 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
393
393
|
"style"
|
|
394
394
|
]));
|
|
395
395
|
}
|
|
396
|
-
}),
|
|
396
|
+
}), K = { class: "relative px-6 pt-6 pb-2" }, q = {
|
|
397
397
|
key: 0,
|
|
398
398
|
class: "absolute right-4 top-4"
|
|
399
|
-
},
|
|
399
|
+
}, J = {
|
|
400
400
|
key: 1,
|
|
401
401
|
class: "mb-4 flex justify-center text-secondary"
|
|
402
|
-
},
|
|
402
|
+
}, ie = {
|
|
403
403
|
key: 0,
|
|
404
404
|
class: "shrink-0 border-t border-outline-variant"
|
|
405
|
-
},
|
|
405
|
+
}, Y = {
|
|
406
406
|
key: 1,
|
|
407
407
|
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
408
|
-
},
|
|
408
|
+
}, X = {
|
|
409
409
|
key: 0,
|
|
410
410
|
class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
|
|
411
|
-
},
|
|
411
|
+
}, Z = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, ae = { class: "flex-1 text-title-large font-medium text-on-surface" }, Q = {
|
|
412
412
|
key: 1,
|
|
413
413
|
class: "flex items-center gap-2"
|
|
414
|
-
},
|
|
414
|
+
}, oe = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, se = /*#__PURE__*/ n(/* @__PURE__ */ p({
|
|
415
415
|
__name: "MDialog",
|
|
416
416
|
props: {
|
|
417
417
|
modelValue: { type: Boolean },
|
|
@@ -441,8 +441,8 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
441
441
|
function _(e) {
|
|
442
442
|
e.key === "Escape" && m();
|
|
443
443
|
}
|
|
444
|
-
let v = C(), y = C(), S = C(!1),
|
|
445
|
-
function
|
|
444
|
+
let v = C(), y = C(), S = C(!1), w;
|
|
445
|
+
function E() {
|
|
446
446
|
let e = v.value;
|
|
447
447
|
if (!e) {
|
|
448
448
|
S.value = !1;
|
|
@@ -450,84 +450,93 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
450
450
|
}
|
|
451
451
|
S.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1;
|
|
452
452
|
}
|
|
453
|
-
return
|
|
454
|
-
e ? (document.addEventListener("keydown", _), document.body.style.overflow = "hidden", await h(),
|
|
453
|
+
return j(() => r.modelValue, async (e) => {
|
|
454
|
+
e ? (document.addEventListener("keydown", _), document.body.style.overflow = "hidden", await h(), E(), w = new ResizeObserver(E), v.value && w.observe(v.value), y.value && w.observe(y.value)) : (document.removeEventListener("keydown", _), document.body.style.overflow = "", w?.disconnect(), w = void 0);
|
|
455
455
|
}), b(() => {
|
|
456
|
-
document.removeEventListener("keydown", _),
|
|
456
|
+
document.removeEventListener("keydown", _), w?.disconnect();
|
|
457
457
|
}), (e, n) => (x(), s(i, { to: "body" }, [t.fullscreen ? (x(), s(a, {
|
|
458
458
|
key: 1,
|
|
459
459
|
name: "m3-dialog-fs"
|
|
460
460
|
}, {
|
|
461
|
-
default:
|
|
462
|
-
t.persistent ? c("", !0) : (x(), s(
|
|
461
|
+
default: M(() => [t.modelValue ? (x(), l("div", X, [u("div", Z, [
|
|
462
|
+
t.persistent ? c("", !0) : (x(), s(U, {
|
|
463
463
|
key: 0,
|
|
464
464
|
icon: "close",
|
|
465
|
-
label: t.closeLabel ??
|
|
465
|
+
label: t.closeLabel ?? O(o).close,
|
|
466
466
|
onClick: m
|
|
467
467
|
}, null, 8, ["label"])),
|
|
468
|
-
u("h2",
|
|
469
|
-
e.$slots.actions ? (x(), l("div",
|
|
470
|
-
]), u("div",
|
|
468
|
+
u("h2", ae, [T(e.$slots, "title", {}, () => [d(D(t.title), 1)], !0)]),
|
|
469
|
+
e.$slots.actions ? (x(), l("div", Q, [T(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
470
|
+
]), u("div", oe, [T(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
471
471
|
_: 3
|
|
472
472
|
})) : (x(), s(a, {
|
|
473
473
|
key: 0,
|
|
474
474
|
name: "m3-dialog"
|
|
475
475
|
}, {
|
|
476
|
-
default:
|
|
476
|
+
default: M(() => [t.modelValue ? (x(), l("div", {
|
|
477
477
|
key: 0,
|
|
478
478
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
|
|
479
|
-
onClick:
|
|
479
|
+
onClick: N(m, ["self"])
|
|
480
480
|
}, [u("div", { class: g(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", [t.maxWidth, t.maxHeight]]) }, [
|
|
481
|
-
u("div",
|
|
482
|
-
t.closable && !t.persistent ? (x(), l("div",
|
|
481
|
+
u("div", K, [
|
|
482
|
+
t.closable && !t.persistent ? (x(), l("div", q, [f(U, {
|
|
483
483
|
icon: "close",
|
|
484
|
-
label: t.closeLabel ??
|
|
484
|
+
label: t.closeLabel ?? O(o).close,
|
|
485
485
|
onClick: m
|
|
486
486
|
}, null, 8, ["label"])])) : c("", !0),
|
|
487
|
-
e.$slots.icon ? (x(), l("div",
|
|
488
|
-
u("h2", { class: g(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]]) }, [
|
|
487
|
+
e.$slots.icon ? (x(), l("div", J, [T(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
|
|
488
|
+
u("h2", { class: g(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]]) }, [T(e.$slots, "title", {}, () => [d(D(t.title), 1)], !0)], 2)
|
|
489
489
|
]),
|
|
490
490
|
u("div", {
|
|
491
491
|
ref_key: "contentEl",
|
|
492
492
|
ref: v,
|
|
493
493
|
class: g(["overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant", e.$slots.actions ? "pb-2" : "pb-6"]),
|
|
494
|
-
onScroll:
|
|
494
|
+
onScroll: E
|
|
495
495
|
}, [u("div", {
|
|
496
496
|
ref_key: "contentInnerEl",
|
|
497
497
|
ref: y
|
|
498
|
-
}, [
|
|
499
|
-
S.value && e.$slots.actions ? (x(), l("div",
|
|
500
|
-
e.$slots.actions ? (x(), l("div",
|
|
498
|
+
}, [T(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
499
|
+
S.value && e.$slots.actions ? (x(), l("div", ie)) : c("", !0),
|
|
500
|
+
e.$slots.actions ? (x(), l("div", Y, [T(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
501
501
|
], 2)])) : c("", !0)]),
|
|
502
502
|
_: 3
|
|
503
503
|
}))]));
|
|
504
504
|
}
|
|
505
|
-
}), [["__scopeId", "data-v-be5c35b4"]]),
|
|
505
|
+
}), [["__scopeId", "data-v-be5c35b4"]]), ce = { class: "my-1 border-outline-variant" }, le = /* @__PURE__ */ p({
|
|
506
|
+
__name: "MMenuDivider",
|
|
507
|
+
props: { gap: {
|
|
508
|
+
type: Boolean,
|
|
509
|
+
default: !1
|
|
510
|
+
} },
|
|
511
|
+
setup(e) {
|
|
512
|
+
return (e, t) => (x(), l("hr", ce));
|
|
513
|
+
}
|
|
514
|
+
}), ue = { class: "flex flex-col gap-1" }, de = [
|
|
506
515
|
"id",
|
|
507
516
|
"value",
|
|
508
517
|
"rows",
|
|
509
518
|
"disabled",
|
|
510
519
|
"required"
|
|
511
|
-
],
|
|
520
|
+
], fe = [
|
|
512
521
|
"id",
|
|
513
522
|
"type",
|
|
514
523
|
"value",
|
|
515
524
|
"disabled",
|
|
516
525
|
"required",
|
|
517
526
|
"autocomplete"
|
|
518
|
-
],
|
|
527
|
+
], pe = ["for"], me = {
|
|
519
528
|
key: 0,
|
|
520
529
|
class: "text-error"
|
|
521
|
-
},
|
|
530
|
+
}, he = {
|
|
522
531
|
key: 3,
|
|
523
532
|
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
524
|
-
},
|
|
533
|
+
}, ge = {
|
|
525
534
|
key: 0,
|
|
526
535
|
class: "px-4 text-body-small text-error"
|
|
527
|
-
},
|
|
536
|
+
}, _e = {
|
|
528
537
|
key: 1,
|
|
529
538
|
class: "px-4 text-body-small text-on-surface-variant"
|
|
530
|
-
},
|
|
539
|
+
}, ve = /* @__PURE__ */ p({
|
|
531
540
|
__name: "MTextField",
|
|
532
541
|
props: {
|
|
533
542
|
modelValue: {},
|
|
@@ -552,7 +561,7 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
552
561
|
},
|
|
553
562
|
emits: ["update:modelValue", "debounced"],
|
|
554
563
|
setup(e, { emit: n }) {
|
|
555
|
-
let r = e, i = n, a =
|
|
564
|
+
let r = e, i = n, a = k(), s = A(), p = C(null), { resolvedFieldBg: m } = V(p, () => r.fieldBg), { debounced: h, cancel: v } = H((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
|
|
556
565
|
let e = !!s.trailing || r.clearable, t = r.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", i = r.multiline ? "resize-y min-h-[56px]" : "h-14", a = [
|
|
557
566
|
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
558
567
|
"transition-[border-color,border-width] duration-150",
|
|
@@ -595,15 +604,15 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
595
604
|
"peer-disabled:text-on-surface/38"
|
|
596
605
|
].join(" ");
|
|
597
606
|
});
|
|
598
|
-
function
|
|
607
|
+
function w(e) {
|
|
599
608
|
let t = e.target;
|
|
600
609
|
i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
|
|
601
610
|
}
|
|
602
|
-
return (n, r) => (x(), l("div",
|
|
611
|
+
return (n, r) => (x(), l("div", ue, [u("div", {
|
|
603
612
|
ref_key: "fieldBgEl",
|
|
604
613
|
ref: p,
|
|
605
614
|
class: g(["relative", e.variant === "outlined" ? "mt-2" : ""]),
|
|
606
|
-
style: _(e.variant === "outlined" ? { "--field-bg":
|
|
615
|
+
style: _(e.variant === "outlined" ? { "--field-bg": O(m) } : void 0)
|
|
607
616
|
}, [
|
|
608
617
|
e.leadingIcon ? (x(), l("div", {
|
|
609
618
|
key: 0,
|
|
@@ -614,17 +623,17 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
614
623
|
}, null, 8, ["name"])], 2)) : c("", !0),
|
|
615
624
|
e.multiline ? (x(), l("textarea", {
|
|
616
625
|
key: 1,
|
|
617
|
-
id:
|
|
626
|
+
id: O(a),
|
|
618
627
|
value: String(e.modelValue),
|
|
619
628
|
rows: e.rows,
|
|
620
629
|
disabled: e.disabled,
|
|
621
630
|
required: e.required,
|
|
622
631
|
placeholder: " ",
|
|
623
632
|
class: g(b.value),
|
|
624
|
-
onInput:
|
|
625
|
-
}, null, 42,
|
|
633
|
+
onInput: w
|
|
634
|
+
}, null, 42, de)) : (x(), l("input", {
|
|
626
635
|
key: 2,
|
|
627
|
-
id:
|
|
636
|
+
id: O(a),
|
|
628
637
|
type: e.type,
|
|
629
638
|
value: e.modelValue,
|
|
630
639
|
disabled: e.disabled,
|
|
@@ -632,116 +641,245 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
632
641
|
autocomplete: e.autocomplete,
|
|
633
642
|
placeholder: " ",
|
|
634
643
|
class: g(b.value),
|
|
635
|
-
onInput:
|
|
636
|
-
}, null, 42,
|
|
644
|
+
onInput: w
|
|
645
|
+
}, null, 42, fe)),
|
|
637
646
|
u("label", {
|
|
638
|
-
for:
|
|
647
|
+
for: O(a),
|
|
639
648
|
class: g(S.value)
|
|
640
|
-
}, [d(
|
|
641
|
-
n.$slots.trailing ? (x(), l("div",
|
|
649
|
+
}, [d(D(e.label), 1), e.required ? (x(), l("span", me, "\xA0*")) : c("", !0)], 10, pe),
|
|
650
|
+
n.$slots.trailing ? (x(), l("div", he, [T(n.$slots, "trailing")])) : y.value ? (x(), l("button", {
|
|
642
651
|
key: 4,
|
|
643
652
|
type: "button",
|
|
644
653
|
class: "absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface",
|
|
645
654
|
onClick: r[0] ||= (e) => {
|
|
646
|
-
|
|
655
|
+
O(v)(), i("update:modelValue", "");
|
|
647
656
|
}
|
|
648
657
|
}, [f(t, {
|
|
649
658
|
name: "close",
|
|
650
659
|
size: 18
|
|
651
660
|
})])) : c("", !0)
|
|
652
|
-
], 6), e.error && e.errorLabel ? (x(), l("p",
|
|
661
|
+
], 6), e.error && e.errorLabel ? (x(), l("p", ge, D(e.errorLabel), 1)) : e.hint ? (x(), l("p", _e, D(e.hint), 1)) : c("", !0)]));
|
|
653
662
|
}
|
|
654
|
-
}),
|
|
663
|
+
}), ye = { class: "flex-1 truncate" }, be = { key: "root" }, xe = {
|
|
664
|
+
key: 0,
|
|
665
|
+
class: "flex flex-col gap-1 px-1.5"
|
|
666
|
+
}, Se = { class: "overflow-hidden rounded-lg bg-surface-container" }, Ce = 220, $ = 1 / 240, we = /* @__PURE__ */ p({
|
|
655
667
|
__name: "MMenu",
|
|
656
|
-
props: {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
668
|
+
props: {
|
|
669
|
+
align: { default: "right" },
|
|
670
|
+
submenuMode: { default: "flyout" },
|
|
671
|
+
variant: { default: "standard" }
|
|
672
|
+
},
|
|
673
|
+
setup(e, { expose: n }) {
|
|
674
|
+
let d = e, p = A();
|
|
675
|
+
function v(e) {
|
|
676
|
+
let t = [];
|
|
677
|
+
for (let n of e) n.type === r && Array.isArray(n.children) ? t.push(...v(n.children)) : t.push(n);
|
|
678
|
+
return t;
|
|
663
679
|
}
|
|
664
|
-
function
|
|
665
|
-
|
|
680
|
+
function D(e) {
|
|
681
|
+
if (e.type !== le) return !1;
|
|
682
|
+
let t = e.props?.gap;
|
|
683
|
+
return t === "" || t === !0 || t === "true";
|
|
666
684
|
}
|
|
667
|
-
|
|
668
|
-
|
|
685
|
+
let O = o(() => {
|
|
686
|
+
if (d.variant !== "expressive") return null;
|
|
687
|
+
let e = v(p.default?.({ close: Q }) ?? []), t = [[]];
|
|
688
|
+
for (let n of e) D(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
689
|
+
return t.filter((e) => e.length > 0);
|
|
690
|
+
}), k = o(() => !!O.value && O.value.length > 1), N = C([]), P = o(() => N.value[N.value.length - 1]), F = C("forward");
|
|
691
|
+
function I(e, t) {
|
|
692
|
+
let n = F.value === "forward" ? 1 : -1, r = e.animate([{
|
|
693
|
+
transform: `translateX(${n * 100}%)`,
|
|
694
|
+
opacity: .4
|
|
695
|
+
}, {
|
|
696
|
+
transform: "translateX(0%)",
|
|
697
|
+
opacity: 1
|
|
698
|
+
}], {
|
|
699
|
+
duration: Ce,
|
|
700
|
+
easing: "cubic-bezier(0.05,0.7,0.1,1)"
|
|
701
|
+
});
|
|
702
|
+
r.onfinish = t;
|
|
669
703
|
}
|
|
670
|
-
function
|
|
671
|
-
let
|
|
704
|
+
function ee(e, t) {
|
|
705
|
+
let n = F.value === "forward" ? -1 : 1, r = e;
|
|
706
|
+
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
707
|
+
let i = r.animate([{
|
|
708
|
+
transform: "translateX(0%)",
|
|
709
|
+
opacity: 1
|
|
710
|
+
}, {
|
|
711
|
+
transform: `translateX(${n * 100}%)`,
|
|
712
|
+
opacity: .4
|
|
713
|
+
}], {
|
|
714
|
+
duration: Ce,
|
|
715
|
+
easing: "cubic-bezier(0.3,0,0.8,0.15)"
|
|
716
|
+
});
|
|
717
|
+
i.onfinish = t;
|
|
718
|
+
}
|
|
719
|
+
let L = null;
|
|
720
|
+
function te() {
|
|
721
|
+
if (L) return L;
|
|
722
|
+
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
723
|
+
for (let a = 0; a < 1 && (e.push({
|
|
724
|
+
scale: t,
|
|
725
|
+
alpha: r
|
|
726
|
+
}), n += (-1400 * (t - 1) - 1.8 * Math.sqrt(1400) * n) * $, t += n * $, i += (-3800 * (r - 1) - 2 * Math.sqrt(3800) * i) * $, r += i * $, !(Math.abs(t - 1) < .003 && Math.abs(r - 1) < .003)); a += $);
|
|
727
|
+
return e.push({
|
|
728
|
+
scale: 1,
|
|
729
|
+
alpha: 1
|
|
730
|
+
}), L = e, e;
|
|
731
|
+
}
|
|
732
|
+
let R = 0, z = null;
|
|
733
|
+
function B(e, t, n) {
|
|
734
|
+
z?.();
|
|
735
|
+
let r = e, i = te(), a = i.length - 1, o = n ? 1 : -1, s = n ? a : 0, c = 0, l = 0, u = !1;
|
|
736
|
+
function d(e) {
|
|
737
|
+
let t = i[Math.round(Math.max(0, Math.min(a, e)))];
|
|
738
|
+
r.style.transform = `scale(${t.scale})`, r.style.opacity = String(Math.min(1, Math.max(0, t.alpha)));
|
|
739
|
+
}
|
|
740
|
+
function f(e) {
|
|
741
|
+
if (u) return;
|
|
742
|
+
let r = c ? (e - c) / 1e3 / $ : 1;
|
|
743
|
+
if (c = e, R = Math.max(0, Math.min(a, R + o * r)), d(R), n && R >= s || !n && R <= s) {
|
|
744
|
+
z = null, t();
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
l = requestAnimationFrame(f);
|
|
748
|
+
}
|
|
749
|
+
z = () => {
|
|
750
|
+
u = !0, cancelAnimationFrame(l);
|
|
751
|
+
}, d(R), l = requestAnimationFrame(f);
|
|
752
|
+
}
|
|
753
|
+
function ne(e, t) {
|
|
754
|
+
B(e, t, !0);
|
|
755
|
+
}
|
|
756
|
+
function V(e, t) {
|
|
757
|
+
B(e, t, !1);
|
|
758
|
+
}
|
|
759
|
+
function H(e) {
|
|
760
|
+
F.value = "forward", N.value.push(e), h(() => X());
|
|
761
|
+
}
|
|
762
|
+
function re() {
|
|
763
|
+
F.value = "backward", N.value.pop(), h(() => X());
|
|
764
|
+
}
|
|
765
|
+
let U = C(!1), W = C(null), G = C(null), K = C({}), q = m("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
766
|
+
S("m-menu-panel-registry", q), j(G, (e, t) => {
|
|
767
|
+
t && q.delete(t), e && q.add(e);
|
|
768
|
+
}), b(() => {
|
|
769
|
+
G.value && q.delete(G.value);
|
|
770
|
+
});
|
|
771
|
+
let J = m("m-menu-sibling-group", null);
|
|
772
|
+
S("m-menu-sibling-group", { current: null });
|
|
773
|
+
function ie() {
|
|
774
|
+
if (!W.value) return;
|
|
775
|
+
let e = W.value.getBoundingClientRect(), t = window.innerHeight - e.bottom - 8, n = t < 200 && e.top > t, r = { maxHeight: `${Math.min(n ? e.top - 12 : t, 400)}px` };
|
|
776
|
+
n ? r.bottom = `${window.innerHeight - e.top + 4}px` : r.top = `${e.bottom + 4}px`, d.align === "right" ? r.right = `${window.innerWidth - e.right}px` : r.left = `${e.left}px`, K.value = r;
|
|
777
|
+
}
|
|
778
|
+
function Y() {
|
|
779
|
+
return G.value ? Array.from(G.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
780
|
+
}
|
|
781
|
+
function X() {
|
|
782
|
+
h(() => Y()[0]?.focus());
|
|
783
|
+
}
|
|
784
|
+
function Z(e) {
|
|
785
|
+
let t = Y();
|
|
672
786
|
if (!t.length) return;
|
|
673
787
|
let n = t.indexOf(document.activeElement);
|
|
674
788
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
675
789
|
}
|
|
676
|
-
function
|
|
677
|
-
|
|
790
|
+
function ae() {
|
|
791
|
+
U.value ? J?.current === Q && (J.current = null) : (J && J.current && J.current !== Q && J.current(), J && (J.current = Q), ie(), N.value = []), U.value = !U.value, U.value && X();
|
|
678
792
|
}
|
|
679
|
-
function
|
|
680
|
-
|
|
793
|
+
function Q() {
|
|
794
|
+
J?.current === Q && (J.current = null), U.value = !1;
|
|
681
795
|
}
|
|
682
|
-
S("m-menu-close",
|
|
683
|
-
|
|
684
|
-
|
|
796
|
+
S("m-menu-close", Q), S("m-menu-nav", {
|
|
797
|
+
mode: d.submenuMode,
|
|
798
|
+
push: H
|
|
799
|
+
}), n({
|
|
800
|
+
close: Q,
|
|
801
|
+
open: U
|
|
685
802
|
});
|
|
686
|
-
function
|
|
803
|
+
function oe(e) {
|
|
687
804
|
let t = e.target;
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (!d.value || m.value?.contains(e.target) || !p.value) return;
|
|
692
|
-
let t = p.value.getBoundingClientRect();
|
|
693
|
-
if (t.bottom < 0 || t.top > window.innerHeight) {
|
|
694
|
-
k();
|
|
695
|
-
return;
|
|
805
|
+
if (!W.value?.contains(t)) {
|
|
806
|
+
for (let e of q) if (e.contains(t)) return;
|
|
807
|
+
t.closest?.(".m3-submenu") || Q();
|
|
696
808
|
}
|
|
697
|
-
v();
|
|
698
809
|
}
|
|
699
|
-
function
|
|
810
|
+
function se(e) {
|
|
811
|
+
U.value && (G.value?.contains(e.target) || Q());
|
|
812
|
+
}
|
|
813
|
+
function ce(e) {
|
|
700
814
|
if (e.key === "Escape") {
|
|
701
|
-
|
|
815
|
+
N.value.length ? re() : Q();
|
|
702
816
|
return;
|
|
703
817
|
}
|
|
704
|
-
|
|
818
|
+
U.value && (e.key === "ArrowDown" ? (e.preventDefault(), Z(1)) : e.key === "ArrowUp" && (e.preventDefault(), Z(-1)));
|
|
705
819
|
}
|
|
706
820
|
y(() => {
|
|
707
|
-
document.addEventListener("mousedown",
|
|
821
|
+
document.addEventListener("mousedown", oe), document.addEventListener("keydown", ce), window.addEventListener("scroll", se, !0);
|
|
708
822
|
}), b(() => {
|
|
709
|
-
document.removeEventListener("mousedown",
|
|
823
|
+
document.removeEventListener("mousedown", oe), document.removeEventListener("keydown", ce), window.removeEventListener("scroll", se, !0), z?.();
|
|
710
824
|
});
|
|
711
|
-
let
|
|
712
|
-
return (
|
|
825
|
+
let ue = o(() => d.align === "right" ? "top right" : "top left");
|
|
826
|
+
return (n, o) => (x(), l(r, null, [u("div", {
|
|
713
827
|
ref_key: "triggerEl",
|
|
714
|
-
ref:
|
|
828
|
+
ref: W,
|
|
715
829
|
class: "inline-block",
|
|
716
|
-
onClick:
|
|
717
|
-
}, [
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
"leave-active-class": "transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.3,0,0.8,0.15)]",
|
|
722
|
-
"leave-from-class": "opacity-100 scale-100",
|
|
723
|
-
"leave-to-class": "opacity-0 scale-[0.8]"
|
|
830
|
+
onClick: ae
|
|
831
|
+
}, [T(n.$slots, "trigger", { open: U.value })], 512), (x(), s(i, { to: "body" }, [f(a, {
|
|
832
|
+
css: !1,
|
|
833
|
+
onEnter: ne,
|
|
834
|
+
onLeave: V
|
|
724
835
|
}, {
|
|
725
|
-
default:
|
|
836
|
+
default: M(() => [U.value ? (x(), l("div", {
|
|
726
837
|
key: 0,
|
|
727
838
|
ref_key: "dropdownEl",
|
|
728
|
-
ref:
|
|
729
|
-
class: "fixed z-500 min-w-48
|
|
839
|
+
ref: G,
|
|
840
|
+
class: g(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", k.value ? "" : "shadow-elevation-2"]]),
|
|
730
841
|
style: _({
|
|
731
|
-
...
|
|
732
|
-
transformOrigin:
|
|
842
|
+
...K.value,
|
|
843
|
+
transformOrigin: ue.value
|
|
733
844
|
})
|
|
734
|
-
}, [u("div", {
|
|
735
|
-
class: "overflow-y-auto py-1",
|
|
736
|
-
style: _({ maxHeight:
|
|
737
|
-
}, [
|
|
845
|
+
}, [u("div", { class: g(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", k.value ? "" : "bg-surface-container"]]) }, [u("div", {
|
|
846
|
+
class: "relative overflow-y-auto py-1",
|
|
847
|
+
style: _({ maxHeight: K.value.maxHeight })
|
|
848
|
+
}, [f(a, {
|
|
849
|
+
css: !1,
|
|
850
|
+
onEnter: I,
|
|
851
|
+
onLeave: ee
|
|
852
|
+
}, {
|
|
853
|
+
default: M(() => [P.value ? (x(), l("div", { key: N.value.length }, [u("button", {
|
|
854
|
+
type: "button",
|
|
855
|
+
class: "flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
856
|
+
onClick: re
|
|
857
|
+
}, [
|
|
858
|
+
f(t, {
|
|
859
|
+
name: "chevron_left",
|
|
860
|
+
size: 20,
|
|
861
|
+
class: "shrink-0 text-on-surface-variant"
|
|
862
|
+
}),
|
|
863
|
+
P.value.icon ? (x(), s(t, {
|
|
864
|
+
key: 0,
|
|
865
|
+
name: P.value.icon,
|
|
866
|
+
size: 20,
|
|
867
|
+
class: "shrink-0 text-on-surface-variant"
|
|
868
|
+
}, null, 8, ["name"])) : c("", !0),
|
|
869
|
+
u("span", ye, [(x(), s(E(() => P.value?.header?.())))])
|
|
870
|
+
]), (x(), s(E(() => P.value?.content?.())))])) : (x(), l("div", be, [k.value ? (x(), l("div", xe, [(x(!0), l(r, null, w(O.value, (e, t) => (x(), l("div", {
|
|
871
|
+
key: t,
|
|
872
|
+
class: "rounded-lg shadow-elevation-2"
|
|
873
|
+
}, [u("div", Se, [(x(), s(E(() => e)))])]))), 128))])) : T(n.$slots, "default", { close: Q }, void 0, void 0, 1)]))]),
|
|
874
|
+
_: 3
|
|
875
|
+
})], 4)], 2)], 6)) : c("", !0)]),
|
|
738
876
|
_: 3
|
|
739
877
|
})]))], 64));
|
|
740
878
|
}
|
|
741
|
-
}),
|
|
879
|
+
}), Te = { class: "flex-1" }, Ee = {
|
|
742
880
|
key: 1,
|
|
743
881
|
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
744
|
-
},
|
|
882
|
+
}, De = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Oe = /* @__PURE__ */ p({
|
|
745
883
|
__name: "MMenuItem",
|
|
746
884
|
props: {
|
|
747
885
|
icon: {},
|
|
@@ -754,38 +892,62 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
754
892
|
danger: {
|
|
755
893
|
type: Boolean,
|
|
756
894
|
default: !1
|
|
895
|
+
},
|
|
896
|
+
keepOpen: {
|
|
897
|
+
type: Boolean,
|
|
898
|
+
default: !1
|
|
757
899
|
}
|
|
758
900
|
},
|
|
759
901
|
emits: ["click"],
|
|
760
902
|
setup(e, { emit: n }) {
|
|
761
|
-
let r = e, d = n, p =
|
|
762
|
-
function
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
function A() {
|
|
767
|
-
if (!v.value || r.disabled || (S.value = !0, !D.value)) return;
|
|
768
|
-
let e = D.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
|
|
769
|
-
O.value = {
|
|
903
|
+
let r = e, d = n, p = A(), h = o(() => r.to ? "RouterLink" : "button"), v = o(() => !!p.children), y = m("m-menu-close", null), b = m("m-menu-nav", null), S = C(), w = C(!1), k = C({});
|
|
904
|
+
function j() {
|
|
905
|
+
if (!S.value) return;
|
|
906
|
+
let e = S.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
|
|
907
|
+
k.value = {
|
|
770
908
|
position: "fixed",
|
|
771
909
|
top: `${e.top}px`,
|
|
772
910
|
...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
|
|
773
911
|
zIndex: "501"
|
|
774
912
|
};
|
|
775
913
|
}
|
|
776
|
-
function
|
|
777
|
-
|
|
914
|
+
function N() {
|
|
915
|
+
if (w.value) {
|
|
916
|
+
w.value = !1;
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
j(), w.value = !0;
|
|
778
920
|
}
|
|
779
|
-
function
|
|
921
|
+
function P() {
|
|
922
|
+
if (!r.disabled) {
|
|
923
|
+
if (v.value) {
|
|
924
|
+
b?.mode === "push" ? b.push({
|
|
925
|
+
icon: r.icon,
|
|
926
|
+
header: p.default,
|
|
927
|
+
content: p.children
|
|
928
|
+
}) : N();
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
d("click"), r.keepOpen || y?.();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
function F(e) {
|
|
935
|
+
e.pointerType === "mouse" && v.value && !r.disabled && (j(), w.value = !0);
|
|
936
|
+
}
|
|
937
|
+
function I(e) {
|
|
938
|
+
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (w.value = !1));
|
|
939
|
+
}
|
|
940
|
+
function ee(e) {
|
|
941
|
+
if (e.pointerType !== "mouse") return;
|
|
780
942
|
let t = e.relatedTarget;
|
|
781
|
-
t?.closest(".m3-submenu") ||
|
|
943
|
+
t?.closest(".m3-submenu") || S.value?.contains(t) || (w.value = !1);
|
|
782
944
|
}
|
|
783
945
|
return (n, r) => (x(), l("div", {
|
|
784
946
|
ref_key: "itemEl",
|
|
785
|
-
ref:
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
}, [(x(), s(
|
|
947
|
+
ref: S,
|
|
948
|
+
onPointerenter: F,
|
|
949
|
+
onPointerleave: I
|
|
950
|
+
}, [(x(), s(E(h.value), {
|
|
789
951
|
to: e.to || void 0,
|
|
790
952
|
type: e.to ? void 0 : "button",
|
|
791
953
|
class: g(["flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", [
|
|
@@ -794,17 +956,19 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
794
956
|
!e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
795
957
|
]]),
|
|
796
958
|
disabled: e.disabled || void 0,
|
|
797
|
-
|
|
959
|
+
"aria-haspopup": v.value ? "menu" : void 0,
|
|
960
|
+
"aria-expanded": v.value ? w.value : void 0,
|
|
961
|
+
onClick: P
|
|
798
962
|
}, {
|
|
799
|
-
default:
|
|
963
|
+
default: M(() => [
|
|
800
964
|
e.icon ? (x(), s(t, {
|
|
801
965
|
key: 0,
|
|
802
966
|
name: e.icon,
|
|
803
967
|
size: 20,
|
|
804
968
|
class: g(["shrink-0", e.danger ? "text-error" : "text-on-surface-variant"])
|
|
805
969
|
}, null, 8, ["name", "class"])) : c("", !0),
|
|
806
|
-
u("span",
|
|
807
|
-
e.shortcut && !v.value ? (x(), l("span",
|
|
970
|
+
u("span", Te, [T(n.$slots, "default")]),
|
|
971
|
+
e.shortcut && !v.value ? (x(), l("span", Ee, D(e.shortcut), 1)) : c("", !0),
|
|
808
972
|
v.value ? (x(), s(t, {
|
|
809
973
|
key: 2,
|
|
810
974
|
name: "chevron_right",
|
|
@@ -817,8 +981,10 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
817
981
|
"to",
|
|
818
982
|
"type",
|
|
819
983
|
"class",
|
|
820
|
-
"disabled"
|
|
821
|
-
|
|
984
|
+
"disabled",
|
|
985
|
+
"aria-haspopup",
|
|
986
|
+
"aria-expanded"
|
|
987
|
+
])), v.value && O(b)?.mode !== "push" ? (x(), s(i, {
|
|
822
988
|
key: 0,
|
|
823
989
|
to: "body"
|
|
824
990
|
}, [f(a, {
|
|
@@ -827,17 +993,17 @@ var W = "relative inline-flex shrink-0 items-center justify-center overflow-hidd
|
|
|
827
993
|
"leave-active-class": "transition-opacity duration-75",
|
|
828
994
|
"leave-to-class": "opacity-0"
|
|
829
995
|
}, {
|
|
830
|
-
default:
|
|
996
|
+
default: M(() => [w.value ? (x(), l("div", {
|
|
831
997
|
key: 0,
|
|
832
|
-
class: "m3-submenu min-w-44
|
|
833
|
-
style: _(
|
|
834
|
-
|
|
835
|
-
}, [
|
|
998
|
+
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
999
|
+
style: _(k.value),
|
|
1000
|
+
onPointerleave: ee
|
|
1001
|
+
}, [u("div", De, [T(n.$slots, "children")])], 36)) : c("", !0)]),
|
|
836
1002
|
_: 3
|
|
837
1003
|
})])) : c("", !0)], 544));
|
|
838
1004
|
}
|
|
839
1005
|
});
|
|
840
1006
|
//#endregion
|
|
841
|
-
export {
|
|
1007
|
+
export { se as a, H as c, le as i, V as l, we as n, G as o, ve as r, U as s, Oe as t, R as u };
|
|
842
1008
|
|
|
843
|
-
//# sourceMappingURL=MMenuItem-
|
|
1009
|
+
//# sourceMappingURL=MMenuItem-BAWmUTT3.js.map
|