@m3ui-vue/m3ui-vue 0.8.7 → 0.9.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/README.md +13 -3
- package/dist/{MMenuItem-DmrsQrK7.js → MTextField-B0wGv1Mx.js} +374 -364
- package/dist/MTextField-B0wGv1Mx.js.map +1 -0
- package/dist/barcode.js +9 -11
- package/dist/barcode.js.map +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MCarousel.vue.d.ts +55 -36
- package/dist/components/MDialog.vue.d.ts +4 -2
- package/dist/components/MEmojiSelector.vue.d.ts +21 -5
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +15 -5
- package/dist/components/MScheduler.vue.d.ts +38 -1
- package/dist/components/MShape.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +2 -2
- package/dist/components/MSlider.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +1 -1
- package/dist/composables/_carouselStrategy.d.ts +101 -0
- package/dist/composables/useLocale.d.ts +23 -0
- package/dist/data/emoji-names/emoji-names-de.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-en.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-es.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-fr.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ja.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ko.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-pt.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-zh.d.ts +2 -0
- package/dist/data/emojis.d.ts +7 -1
- package/dist/emoji-names-de-BphO5XpV.js +1877 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -0
- package/dist/emoji-names-en-9ZvMRvzi.js +1877 -0
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -0
- package/dist/emoji-names-es-DvfWU3Pj.js +1877 -0
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -0
- package/dist/emoji-names-fr-B-jhUlsP.js +1877 -0
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -0
- package/dist/emoji-names-ja-l8cMFJo1.js +1877 -0
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -0
- package/dist/emoji-names-ko-YP-o9G0c.js +1877 -0
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -0
- package/dist/emoji-names-pt-DGj_Js4M.js +1877 -0
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -0
- package/dist/emoji-names-zh-Dzecwtw_.js +1877 -0
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/locales/index.js +168 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3926 -2430
- package/dist/m3ui.js.map +1 -1
- package/dist/plugin.d.ts +6 -0
- package/dist/rich-text-editor.js +9 -9
- package/dist/styles.css +1 -1
- package/dist/terminal.js +34 -27
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-Bircp823.js → useLocale-CmI675Ab.js} +25 -2
- package/dist/useLocale-CmI675Ab.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MCarousel.test.ts +183 -21
- package/src/__tests__/MDialog.test.ts +18 -0
- package/src/__tests__/MEmojiSelector.test.ts +138 -0
- package/src/__tests__/MLightbox.test.ts +313 -5
- package/src/__tests__/MPagination.test.ts +37 -0
- package/src/__tests__/MPullToRefresh.test.ts +39 -0
- package/src/__tests__/MScheduler.test.ts +122 -0
- package/src/__tests__/MTerminal.test.ts +63 -0
- package/src/__tests__/attrsFallthrough.test.ts +65 -0
- package/src/__tests__/plugin.test.ts +28 -1
- package/src/components/MBarcode.vue +4 -2
- package/src/components/MBottomSheet.vue +1 -1
- package/src/components/MCarousel.vue +526 -200
- package/src/components/MCodeEditor.vue +3 -2
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContextMenu.vue +3 -1
- package/src/components/MDatePickerModal.vue +1 -1
- package/src/components/MDateRangePickerModal.vue +1 -1
- package/src/components/MDialog.vue +19 -6
- package/src/components/MEmojiSelector.vue +479 -78
- package/src/components/MFab.vue +3 -1
- package/src/components/MLightbox.vue +750 -268
- package/src/components/MLoadingOverlay.vue +6 -1
- package/src/components/MMenu.vue +3 -1
- package/src/components/MNavigationDrawer.vue +5 -1
- package/src/components/MNavigationRail.vue +8 -2
- package/src/components/MOverlay.vue +1 -0
- package/src/components/MPagination.vue +8 -5
- package/src/components/MPullToRefresh.vue +13 -1
- package/src/components/MScheduler.vue +282 -115
- package/src/components/MSideSheet.vue +1 -1
- package/src/components/MSplitButton.vue +3 -1
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MTerminal.vue +22 -10
- package/src/components/MTimePickerModal.vue +1 -1
- package/src/components/MTooltip.vue +3 -0
- package/src/components/MTour.vue +2 -2
- package/src/composables/_carouselStrategy.ts +712 -0
- package/src/composables/useLocale.ts +48 -0
- package/src/data/emoji-names/emoji-names-de.ts +1875 -0
- package/src/data/emoji-names/emoji-names-en.ts +1875 -0
- package/src/data/emoji-names/emoji-names-es.ts +1875 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1875 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1875 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1875 -0
- package/src/data/emojis.ts +29 -198
- package/src/index.ts +2 -2
- package/src/locales/de.ts +24 -0
- package/src/locales/es.ts +24 -0
- package/src/locales/fr.ts +24 -0
- package/src/locales/ja.ts +24 -0
- package/src/locales/ko.ts +24 -0
- package/src/locales/pt.ts +24 -0
- package/src/locales/zh.ts +24 -0
- package/src/plugin.ts +12 -1
- package/dist/MMenuItem-DmrsQrK7.js.map +0 -1
- package/dist/useLocale-Bircp823.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { r as e } from "./useLocale-
|
|
1
|
+
import { r as e } from "./useLocale-CmI675Ab.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,
|
|
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, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useId as A, useSlots as j, watch as ee, withCtx as M, withModifiers as N } from "vue";
|
|
5
5
|
//#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
6
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
|
+
], te = ["d", "stroke-dasharray"], L = 3, ne = 9, R = /* @__PURE__ */ p({
|
|
14
14
|
__name: "MSpinner",
|
|
15
15
|
props: {
|
|
16
16
|
size: { default: 20 },
|
|
@@ -24,7 +24,7 @@ var P = ["aria-label"], F = {
|
|
|
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(ne * 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)}`;
|
|
@@ -34,22 +34,22 @@ var P = ["aria-label"], F = {
|
|
|
34
34
|
len: o.toFixed(1)
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
|
-
return (e, n) => (
|
|
37
|
+
return (e, n) => (S(), l("span", {
|
|
38
38
|
class: "inline-flex shrink-0 items-center justify-center",
|
|
39
|
-
style:
|
|
39
|
+
style: v({
|
|
40
40
|
width: `${t.size}px`,
|
|
41
41
|
height: `${t.size}px`
|
|
42
42
|
}),
|
|
43
43
|
role: "status",
|
|
44
|
-
"aria-label": t.label ??
|
|
45
|
-
}, [t.wavy ? (
|
|
44
|
+
"aria-label": t.label ?? k(r).loading
|
|
45
|
+
}, [t.wavy ? (S(), l("svg", {
|
|
46
46
|
key: 1,
|
|
47
47
|
width: t.size,
|
|
48
48
|
height: t.size,
|
|
49
49
|
viewBox: `0 0 ${t.size} ${t.size}`,
|
|
50
50
|
fill: "none",
|
|
51
51
|
class: "animate-[m3-wavy-spin_2.8s_linear_infinite]",
|
|
52
|
-
style:
|
|
52
|
+
style: v(`transform-origin: ${a.value}px ${a.value}px`)
|
|
53
53
|
}, [u("path", {
|
|
54
54
|
d: s.value.path,
|
|
55
55
|
stroke: "currentColor",
|
|
@@ -57,8 +57,8 @@ var P = ["aria-label"], F = {
|
|
|
57
57
|
"stroke-linecap": "round",
|
|
58
58
|
"stroke-dasharray": s.value.dash,
|
|
59
59
|
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
60
|
-
style:
|
|
61
|
-
}, null, 12,
|
|
60
|
+
style: v({ "--m3-wave-len": s.value.len })
|
|
61
|
+
}, null, 12, te)], 12, I)) : (S(), l("span", F))], 12, P));
|
|
62
62
|
}
|
|
63
63
|
}), z = [
|
|
64
64
|
"bg-surface-container-highest",
|
|
@@ -85,7 +85,7 @@ function B(e) {
|
|
|
85
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 V(e) {
|
|
89
89
|
if (!e || e === "transparent") return !0;
|
|
90
90
|
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
91
91
|
if (t) {
|
|
@@ -94,8 +94,8 @@ function ne(e) {
|
|
|
94
94
|
}
|
|
95
95
|
return !1;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let n =
|
|
97
|
+
function H(e, t) {
|
|
98
|
+
let n = w("var(--color-surface)");
|
|
99
99
|
function r(r) {
|
|
100
100
|
n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
|
|
101
101
|
}
|
|
@@ -112,7 +112,7 @@ function V(e, t) {
|
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
let n = getComputedStyle(t).backgroundColor;
|
|
115
|
-
if (!
|
|
115
|
+
if (!V(n)) {
|
|
116
116
|
r(n);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -121,7 +121,7 @@ function V(e, t) {
|
|
|
121
121
|
r("var(--color-surface)");
|
|
122
122
|
}
|
|
123
123
|
let a = null;
|
|
124
|
-
return
|
|
124
|
+
return b(() => {
|
|
125
125
|
i(), a = new MutationObserver(() => i()), a.observe(document.documentElement, {
|
|
126
126
|
attributes: !0,
|
|
127
127
|
attributeFilter: [
|
|
@@ -130,11 +130,11 @@ function V(e, t) {
|
|
|
130
130
|
"data-theme"
|
|
131
131
|
]
|
|
132
132
|
});
|
|
133
|
-
}),
|
|
133
|
+
}), y(() => a?.disconnect()), { resolvedFieldBg: o(() => t() ?? n.value) };
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/composables/useDebounce.ts
|
|
137
|
-
function
|
|
137
|
+
function U(e, t) {
|
|
138
138
|
let n = null;
|
|
139
139
|
function r(...r) {
|
|
140
140
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -144,14 +144,14 @@ function re(e, t) {
|
|
|
144
144
|
function i() {
|
|
145
145
|
n &&= (clearTimeout(n), null);
|
|
146
146
|
}
|
|
147
|
-
return
|
|
147
|
+
return y(i), {
|
|
148
148
|
debounced: r,
|
|
149
149
|
cancel: i
|
|
150
150
|
};
|
|
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]", W = /* @__PURE__ */ p({
|
|
155
155
|
__name: "MIconButton",
|
|
156
156
|
props: {
|
|
157
157
|
icon: {},
|
|
@@ -216,18 +216,18 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
216
216
|
default: return "text-on-surface-variant";
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
|
-
return (n, i) => (
|
|
219
|
+
return (n, i) => (S(), s(D(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
|
-
class:
|
|
225
|
-
|
|
224
|
+
class: _([
|
|
225
|
+
re,
|
|
226
226
|
l.value,
|
|
227
227
|
d.value,
|
|
228
228
|
c.value
|
|
229
229
|
]),
|
|
230
|
-
style:
|
|
230
|
+
style: v({
|
|
231
231
|
width: `${a.value.px}px`,
|
|
232
232
|
height: `${a.value.px}px`
|
|
233
233
|
}),
|
|
@@ -247,7 +247,7 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
247
247
|
"style"
|
|
248
248
|
]));
|
|
249
249
|
}
|
|
250
|
-
}),
|
|
250
|
+
}), G = "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]", K = /* @__PURE__ */ p({
|
|
251
251
|
__name: "MButton",
|
|
252
252
|
props: {
|
|
253
253
|
variant: { default: "filled" },
|
|
@@ -334,7 +334,7 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
334
334
|
pxText: "px-4",
|
|
335
335
|
squareRadius: "rounded-xl"
|
|
336
336
|
}
|
|
337
|
-
}, h = o(() => m[i.size] ?? m.sm),
|
|
337
|
+
}, h = o(() => m[i.size] ?? m.sm), g = o(() => `${h.value.h} ${h.value.text} ${h.value.gap}`), y = o(() => h.value.icon), b = o(() => h.value.spinner), x = 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";
|
|
@@ -345,40 +345,40 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
345
345
|
default: return "";
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
|
-
function
|
|
348
|
+
function T(e) {
|
|
349
349
|
if (i.disabled || i.loading) return;
|
|
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) => (
|
|
353
|
+
return (n, i) => (S(), s(D(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
|
-
class:
|
|
358
|
-
|
|
357
|
+
class: _([
|
|
358
|
+
G,
|
|
359
359
|
C.value,
|
|
360
|
-
|
|
361
|
-
|
|
360
|
+
g.value,
|
|
361
|
+
x.value,
|
|
362
362
|
w.value,
|
|
363
363
|
p.value
|
|
364
364
|
]),
|
|
365
|
-
style:
|
|
366
|
-
onPointerdown:
|
|
365
|
+
style: v(d.value),
|
|
366
|
+
onPointerdown: T
|
|
367
367
|
}, {
|
|
368
368
|
default: M(() => [
|
|
369
|
-
e.iconPos === "leading" ? (
|
|
369
|
+
e.iconPos === "leading" ? (S(), l(r, { key: 0 }, [e.loading ? (S(), s(R, {
|
|
370
370
|
key: 0,
|
|
371
371
|
size: b.value
|
|
372
|
-
}, null, 8, ["size"])) : e.icon ? (
|
|
372
|
+
}, null, 8, ["size"])) : e.icon ? (S(), s(t, {
|
|
373
373
|
key: 1,
|
|
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" ? (
|
|
377
|
+
E(n.$slots, "default"),
|
|
378
|
+
e.iconPos === "trailing" ? (S(), l(r, { key: 1 }, [e.loading ? (S(), s(R, {
|
|
379
379
|
key: 0,
|
|
380
380
|
size: b.value
|
|
381
|
-
}, null, 8, ["size"])) : e.icon ? (
|
|
381
|
+
}, null, 8, ["size"])) : e.icon ? (S(), s(t, {
|
|
382
382
|
key: 1,
|
|
383
383
|
name: e.icon,
|
|
384
384
|
size: y.value
|
|
@@ -393,25 +393,25 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
393
393
|
"style"
|
|
394
394
|
]));
|
|
395
395
|
}
|
|
396
|
-
}),
|
|
396
|
+
}), q = { class: "relative px-6 pt-6 pb-2" }, J = {
|
|
397
397
|
key: 0,
|
|
398
398
|
class: "absolute right-4 top-4"
|
|
399
|
-
},
|
|
399
|
+
}, Y = {
|
|
400
400
|
key: 1,
|
|
401
401
|
class: "mb-4 flex justify-center text-secondary"
|
|
402
|
-
},
|
|
402
|
+
}, X = {
|
|
403
403
|
key: 0,
|
|
404
404
|
class: "shrink-0 border-t border-outline-variant"
|
|
405
|
-
},
|
|
405
|
+
}, ie = {
|
|
406
406
|
key: 1,
|
|
407
407
|
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
408
|
-
},
|
|
408
|
+
}, ae = {
|
|
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" }, oe = { class: "flex-1 text-title-large font-medium text-on-surface" }, se = {
|
|
412
412
|
key: 1,
|
|
413
413
|
class: "flex items-center gap-2"
|
|
414
|
-
}, Q = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" },
|
|
414
|
+
}, Q = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ce = /*#__PURE__*/ n(/* @__PURE__ */ p({
|
|
415
415
|
__name: "MDialog",
|
|
416
416
|
props: {
|
|
417
417
|
modelValue: { type: Boolean },
|
|
@@ -434,236 +434,96 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
434
434
|
},
|
|
435
435
|
emits: ["update:modelValue"],
|
|
436
436
|
setup(t, { emit: n }) {
|
|
437
|
-
let r = t,
|
|
438
|
-
|
|
439
|
-
r.
|
|
437
|
+
let r = t, p = e(), m = (e) => /^-?[\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\(/i.test(e.trim()), h = o(() => [r.maxWidth, r.maxHeight].filter((e) => !m(e))), y = o(() => ({
|
|
438
|
+
...m(r.maxWidth) ? { maxWidth: r.maxWidth } : {},
|
|
439
|
+
...m(r.maxHeight) ? { maxHeight: r.maxHeight } : {}
|
|
440
|
+
})), b = n;
|
|
441
|
+
function C() {
|
|
442
|
+
r.persistent || b("update:modelValue", !1);
|
|
440
443
|
}
|
|
441
|
-
function
|
|
442
|
-
e.key === "Escape" &&
|
|
444
|
+
function T(e) {
|
|
445
|
+
e.key === "Escape" && C();
|
|
443
446
|
}
|
|
444
|
-
let
|
|
445
|
-
function
|
|
446
|
-
let e =
|
|
447
|
+
let D = w(), A = w(), j = w(!1), P;
|
|
448
|
+
function F() {
|
|
449
|
+
let e = D.value;
|
|
447
450
|
if (!e) {
|
|
448
|
-
|
|
451
|
+
j.value = !1;
|
|
449
452
|
return;
|
|
450
453
|
}
|
|
451
|
-
|
|
454
|
+
j.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1;
|
|
452
455
|
}
|
|
453
|
-
return
|
|
454
|
-
e ? (document.addEventListener("keydown",
|
|
455
|
-
}),
|
|
456
|
-
document.removeEventListener("keydown",
|
|
457
|
-
}), (e, n) => (
|
|
456
|
+
return ee(() => r.modelValue, async (e) => {
|
|
457
|
+
e ? (document.addEventListener("keydown", T), document.body.style.overflow = "hidden", await g(), F(), P = new ResizeObserver(F), D.value && P.observe(D.value), A.value && P.observe(A.value)) : (document.removeEventListener("keydown", T), document.body.style.overflow = "", P?.disconnect(), P = void 0);
|
|
458
|
+
}), x(() => {
|
|
459
|
+
document.removeEventListener("keydown", T), P?.disconnect();
|
|
460
|
+
}), (e, n) => (S(), s(i, { to: "body" }, [t.fullscreen ? (S(), s(a, {
|
|
458
461
|
key: 1,
|
|
459
|
-
name: "m3-dialog-fs"
|
|
462
|
+
name: "m3-dialog-fs",
|
|
463
|
+
appear: ""
|
|
460
464
|
}, {
|
|
461
|
-
default: M(() => [t.modelValue ? (
|
|
462
|
-
t.persistent ? c("", !0) : (
|
|
465
|
+
default: M(() => [t.modelValue ? (S(), l("div", ae, [u("div", Z, [
|
|
466
|
+
t.persistent ? c("", !0) : (S(), s(W, {
|
|
463
467
|
key: 0,
|
|
464
468
|
icon: "close",
|
|
465
|
-
label: t.closeLabel ??
|
|
466
|
-
onClick:
|
|
469
|
+
label: t.closeLabel ?? k(p).close,
|
|
470
|
+
onClick: C
|
|
467
471
|
}, null, 8, ["label"])),
|
|
468
|
-
u("h2",
|
|
469
|
-
e.$slots.actions ? (
|
|
470
|
-
]), u("div", Q, [
|
|
472
|
+
u("h2", oe, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)]),
|
|
473
|
+
e.$slots.actions ? (S(), l("div", se, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
474
|
+
]), u("div", Q, [E(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
471
475
|
_: 3
|
|
472
|
-
})) : (
|
|
476
|
+
})) : (S(), s(a, {
|
|
473
477
|
key: 0,
|
|
474
|
-
name: "m3-dialog"
|
|
478
|
+
name: "m3-dialog",
|
|
479
|
+
appear: ""
|
|
475
480
|
}, {
|
|
476
|
-
default: M(() => [t.modelValue ? (
|
|
481
|
+
default: M(() => [t.modelValue ? (S(), l("div", {
|
|
477
482
|
key: 0,
|
|
478
483
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
|
|
479
|
-
onClick: N(
|
|
480
|
-
}, [u("div", {
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
onClick: N(C, ["self"])
|
|
485
|
+
}, [u("div", {
|
|
486
|
+
class: _(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", h.value]),
|
|
487
|
+
style: v(y.value)
|
|
488
|
+
}, [
|
|
489
|
+
u("div", q, [
|
|
490
|
+
t.closable && !t.persistent ? (S(), l("div", J, [f(W, {
|
|
483
491
|
icon: "close",
|
|
484
|
-
label: t.closeLabel ??
|
|
485
|
-
onClick:
|
|
492
|
+
label: t.closeLabel ?? k(p).close,
|
|
493
|
+
onClick: C
|
|
486
494
|
}, null, 8, ["label"])])) : c("", !0),
|
|
487
|
-
e.$slots.icon ? (
|
|
488
|
-
u("h2", { class:
|
|
495
|
+
e.$slots.icon ? (S(), l("div", Y, [E(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
|
|
496
|
+
u("h2", { class: _(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]]) }, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)], 2)
|
|
489
497
|
]),
|
|
490
498
|
u("div", {
|
|
491
499
|
ref_key: "contentEl",
|
|
492
|
-
ref:
|
|
493
|
-
class:
|
|
494
|
-
onScroll:
|
|
500
|
+
ref: D,
|
|
501
|
+
class: _(["overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant", e.$slots.actions ? "pb-2" : "pb-6"]),
|
|
502
|
+
onScroll: F
|
|
495
503
|
}, [u("div", {
|
|
496
504
|
ref_key: "contentInnerEl",
|
|
497
|
-
ref:
|
|
498
|
-
}, [
|
|
499
|
-
|
|
500
|
-
e.$slots.actions ? (
|
|
501
|
-
],
|
|
505
|
+
ref: A
|
|
506
|
+
}, [E(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
507
|
+
j.value && e.$slots.actions ? (S(), l("div", X)) : c("", !0),
|
|
508
|
+
e.$slots.actions ? (S(), l("div", ie, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
509
|
+
], 6)])) : c("", !0)]),
|
|
502
510
|
_: 3
|
|
503
511
|
}))]));
|
|
504
512
|
}
|
|
505
|
-
}), [["__scopeId", "data-v-
|
|
513
|
+
}), [["__scopeId", "data-v-f77d8170"]]), le = { class: "my-1 border-outline-variant" }, ue = /* @__PURE__ */ p({
|
|
506
514
|
__name: "MMenuDivider",
|
|
507
515
|
props: { gap: {
|
|
508
516
|
type: Boolean,
|
|
509
517
|
default: !1
|
|
510
518
|
} },
|
|
511
519
|
setup(e) {
|
|
512
|
-
return (e, t) => (
|
|
513
|
-
}
|
|
514
|
-
}), ue = { class: "flex flex-col gap-1" }, de = [
|
|
515
|
-
"id",
|
|
516
|
-
"value",
|
|
517
|
-
"rows",
|
|
518
|
-
"disabled",
|
|
519
|
-
"required"
|
|
520
|
-
], fe = [
|
|
521
|
-
"id",
|
|
522
|
-
"type",
|
|
523
|
-
"value",
|
|
524
|
-
"disabled",
|
|
525
|
-
"required",
|
|
526
|
-
"autocomplete"
|
|
527
|
-
], pe = ["for"], me = {
|
|
528
|
-
key: 0,
|
|
529
|
-
class: "text-error"
|
|
530
|
-
}, he = {
|
|
531
|
-
key: 3,
|
|
532
|
-
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
533
|
-
}, ge = {
|
|
534
|
-
key: 0,
|
|
535
|
-
class: "px-4 text-body-small text-error"
|
|
536
|
-
}, _e = {
|
|
537
|
-
key: 1,
|
|
538
|
-
class: "px-4 text-body-small text-on-surface-variant"
|
|
539
|
-
}, ve = /* @__PURE__ */ p({
|
|
540
|
-
__name: "MTextField",
|
|
541
|
-
props: {
|
|
542
|
-
modelValue: {},
|
|
543
|
-
label: {},
|
|
544
|
-
type: { default: "text" },
|
|
545
|
-
variant: { default: "filled" },
|
|
546
|
-
error: { type: Boolean },
|
|
547
|
-
errorLabel: {},
|
|
548
|
-
hint: {},
|
|
549
|
-
disabled: { type: Boolean },
|
|
550
|
-
required: { type: Boolean },
|
|
551
|
-
multiline: { type: Boolean },
|
|
552
|
-
rows: { default: 3 },
|
|
553
|
-
autocomplete: {},
|
|
554
|
-
leadingIcon: {},
|
|
555
|
-
clearable: {
|
|
556
|
-
type: Boolean,
|
|
557
|
-
default: !1
|
|
558
|
-
},
|
|
559
|
-
fieldBg: {},
|
|
560
|
-
debounce: { default: 0 }
|
|
561
|
-
},
|
|
562
|
-
emits: ["update:modelValue", "debounced"],
|
|
563
|
-
setup(e, { emit: n }) {
|
|
564
|
-
let r = e, i = n, a = k(), s = A(), p = C(null), { resolvedFieldBg: m } = V(p, () => r.fieldBg), { debounced: h, cancel: v } = re((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
|
|
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 = [
|
|
566
|
-
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
567
|
-
"transition-[border-color,border-width] duration-150",
|
|
568
|
-
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
569
|
-
r.error ? "caret-error" : "caret-primary",
|
|
570
|
-
i,
|
|
571
|
-
t,
|
|
572
|
-
n
|
|
573
|
-
];
|
|
574
|
-
return r.variant === "outlined" ? [
|
|
575
|
-
...a,
|
|
576
|
-
"rounded-xs border bg-transparent py-4",
|
|
577
|
-
r.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
578
|
-
"disabled:border-on-surface/12"
|
|
579
|
-
].join(" ") : [
|
|
580
|
-
...a,
|
|
581
|
-
"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
|
|
582
|
-
r.error ? "border-error focus:border-b-2 focus:border-error" : "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
|
|
583
|
-
"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
|
|
584
|
-
].join(" ");
|
|
585
|
-
}), S = o(() => {
|
|
586
|
-
let e = [
|
|
587
|
-
"pointer-events-none absolute truncate transition-all duration-200",
|
|
588
|
-
r.leadingIcon ? r.variant === "outlined" ? "left-11" : "left-12" : r.variant === "outlined" ? "left-3" : "left-4",
|
|
589
|
-
"right-4",
|
|
590
|
-
`${r.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
|
|
591
|
-
];
|
|
592
|
-
return r.variant === "outlined" ? [
|
|
593
|
-
...e,
|
|
594
|
-
"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1",
|
|
595
|
-
"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]",
|
|
596
|
-
"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
|
|
597
|
-
r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
598
|
-
"peer-disabled:text-on-surface/38"
|
|
599
|
-
].join(" ") : [
|
|
600
|
-
...e,
|
|
601
|
-
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
|
|
602
|
-
"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
|
|
603
|
-
r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
604
|
-
"peer-disabled:text-on-surface/38"
|
|
605
|
-
].join(" ");
|
|
606
|
-
});
|
|
607
|
-
function w(e) {
|
|
608
|
-
let t = e.target;
|
|
609
|
-
i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
|
|
610
|
-
}
|
|
611
|
-
return (n, r) => (x(), l("div", ue, [u("div", {
|
|
612
|
-
ref_key: "fieldBgEl",
|
|
613
|
-
ref: p,
|
|
614
|
-
class: g(["relative", e.variant === "outlined" ? "mt-2" : ""]),
|
|
615
|
-
style: _(e.variant === "outlined" ? { "--field-bg": O(m) } : void 0)
|
|
616
|
-
}, [
|
|
617
|
-
e.leadingIcon ? (x(), l("div", {
|
|
618
|
-
key: 0,
|
|
619
|
-
class: g(["pointer-events-none absolute left-3.5", [e.multiline ? "top-[55%] -translate-y-1/2" : e.variant === "filled" ? "top-4.5" : "top-4", e.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
|
|
620
|
-
}, [f(t, {
|
|
621
|
-
name: e.leadingIcon,
|
|
622
|
-
size: 24
|
|
623
|
-
}, null, 8, ["name"])], 2)) : c("", !0),
|
|
624
|
-
e.multiline ? (x(), l("textarea", {
|
|
625
|
-
key: 1,
|
|
626
|
-
id: O(a),
|
|
627
|
-
value: String(e.modelValue),
|
|
628
|
-
rows: e.rows,
|
|
629
|
-
disabled: e.disabled,
|
|
630
|
-
required: e.required,
|
|
631
|
-
placeholder: " ",
|
|
632
|
-
class: g(b.value),
|
|
633
|
-
onInput: w
|
|
634
|
-
}, null, 42, de)) : (x(), l("input", {
|
|
635
|
-
key: 2,
|
|
636
|
-
id: O(a),
|
|
637
|
-
type: e.type,
|
|
638
|
-
value: e.modelValue,
|
|
639
|
-
disabled: e.disabled,
|
|
640
|
-
required: e.required,
|
|
641
|
-
autocomplete: e.autocomplete,
|
|
642
|
-
placeholder: " ",
|
|
643
|
-
class: g(b.value),
|
|
644
|
-
onInput: w
|
|
645
|
-
}, null, 42, fe)),
|
|
646
|
-
u("label", {
|
|
647
|
-
for: O(a),
|
|
648
|
-
class: g(S.value)
|
|
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", {
|
|
651
|
-
key: 4,
|
|
652
|
-
type: "button",
|
|
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",
|
|
654
|
-
onClick: r[0] ||= (e) => {
|
|
655
|
-
O(v)(), i("update:modelValue", "");
|
|
656
|
-
}
|
|
657
|
-
}, [f(t, {
|
|
658
|
-
name: "close",
|
|
659
|
-
size: 18
|
|
660
|
-
})])) : c("", !0)
|
|
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)]));
|
|
520
|
+
return (e, t) => (S(), l("hr", le));
|
|
662
521
|
}
|
|
663
|
-
}),
|
|
522
|
+
}), de = { class: "flex-1 truncate" }, fe = { key: "root" }, pe = {
|
|
664
523
|
key: 0,
|
|
665
524
|
class: "flex flex-col gap-1 px-1.5"
|
|
666
|
-
},
|
|
525
|
+
}, me = { class: "overflow-hidden rounded-lg bg-surface-container" }, he = 220, $ = 1 / 240, ge = /* @__PURE__ */ p({
|
|
526
|
+
inheritAttrs: !1,
|
|
667
527
|
__name: "MMenu",
|
|
668
528
|
props: {
|
|
669
529
|
align: { default: "right" },
|
|
@@ -671,24 +531,24 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
671
531
|
variant: { default: "standard" }
|
|
672
532
|
},
|
|
673
533
|
setup(e, { expose: n }) {
|
|
674
|
-
let d = e, p =
|
|
675
|
-
function
|
|
534
|
+
let d = e, p = j();
|
|
535
|
+
function y(e) {
|
|
676
536
|
let t = [];
|
|
677
|
-
for (let n of e) n.type === r && Array.isArray(n.children) ? t.push(...
|
|
537
|
+
for (let n of e) n.type === r && Array.isArray(n.children) ? t.push(...y(n.children)) : t.push(n);
|
|
678
538
|
return t;
|
|
679
539
|
}
|
|
680
|
-
function
|
|
681
|
-
if (e.type !==
|
|
540
|
+
function O(e) {
|
|
541
|
+
if (e.type !== ue) return !1;
|
|
682
542
|
let t = e.props?.gap;
|
|
683
543
|
return t === "" || t === !0 || t === "true";
|
|
684
544
|
}
|
|
685
|
-
let
|
|
545
|
+
let k = o(() => {
|
|
686
546
|
if (d.variant !== "expressive") return null;
|
|
687
|
-
let e =
|
|
688
|
-
for (let n of e)
|
|
547
|
+
let e = y(p.default?.({ close: Q }) ?? []), t = [[]];
|
|
548
|
+
for (let n of e) O(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
689
549
|
return t.filter((e) => e.length > 0);
|
|
690
|
-
}),
|
|
691
|
-
function
|
|
550
|
+
}), A = o(() => !!k.value && k.value.length > 1), N = w([]), P = o(() => N.value[N.value.length - 1]), F = w("forward");
|
|
551
|
+
function I(e, t) {
|
|
692
552
|
let n = F.value === "forward" ? 1 : -1, r = e.animate([{
|
|
693
553
|
transform: `translateX(${n * 100}%)`,
|
|
694
554
|
opacity: .4
|
|
@@ -696,12 +556,12 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
696
556
|
transform: "translateX(0%)",
|
|
697
557
|
opacity: 1
|
|
698
558
|
}], {
|
|
699
|
-
duration:
|
|
559
|
+
duration: he,
|
|
700
560
|
easing: "cubic-bezier(0.05,0.7,0.1,1)"
|
|
701
561
|
});
|
|
702
562
|
r.onfinish = t;
|
|
703
563
|
}
|
|
704
|
-
function
|
|
564
|
+
function te(e, t) {
|
|
705
565
|
let n = F.value === "forward" ? -1 : 1, r = e;
|
|
706
566
|
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
707
567
|
let i = r.animate([{
|
|
@@ -711,13 +571,13 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
711
571
|
transform: `translateX(${n * 100}%)`,
|
|
712
572
|
opacity: .4
|
|
713
573
|
}], {
|
|
714
|
-
duration:
|
|
574
|
+
duration: he,
|
|
715
575
|
easing: "cubic-bezier(0.3,0,0.8,0.15)"
|
|
716
576
|
});
|
|
717
577
|
i.onfinish = t;
|
|
718
578
|
}
|
|
719
579
|
let L = null;
|
|
720
|
-
function
|
|
580
|
+
function ne() {
|
|
721
581
|
if (L) return L;
|
|
722
582
|
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
723
583
|
for (let a = 0; a < 1 && (e.push({
|
|
@@ -730,9 +590,9 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
730
590
|
}), L = e, e;
|
|
731
591
|
}
|
|
732
592
|
let R = 0, z = null, B = null;
|
|
733
|
-
function
|
|
593
|
+
function V(e, t, n) {
|
|
734
594
|
z?.();
|
|
735
|
-
let r = e, i =
|
|
595
|
+
let r = e, i = ne(), a = i.length - 1, o = n ? 1 : -1, s = n ? a : 0, c = 0, l = 0, u = !1;
|
|
736
596
|
function d(e) {
|
|
737
597
|
let t = i[Math.round(Math.max(0, Math.min(a, e)))];
|
|
738
598
|
r.style.transform = `scale(${t.scale})`, r.style.opacity = String(Math.min(1, Math.max(0, t.alpha)));
|
|
@@ -752,139 +612,140 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
752
612
|
z?.(), z = null, B = null, t();
|
|
753
613
|
}, d(R), l = requestAnimationFrame(f);
|
|
754
614
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
615
|
+
function H(e, t) {
|
|
616
|
+
V(e, t, !0);
|
|
757
617
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
618
|
+
function U(e, t) {
|
|
619
|
+
V(e, t, !1);
|
|
760
620
|
}
|
|
761
|
-
function
|
|
762
|
-
F.value = "forward", N.value.push(e),
|
|
621
|
+
function re(e) {
|
|
622
|
+
F.value = "forward", N.value.push(e), g(() => Z());
|
|
763
623
|
}
|
|
764
|
-
function
|
|
765
|
-
F.value = "backward", N.value.pop(),
|
|
624
|
+
function W() {
|
|
625
|
+
F.value = "backward", N.value.pop(), g(() => Z());
|
|
766
626
|
}
|
|
767
|
-
let
|
|
768
|
-
|
|
769
|
-
t &&
|
|
770
|
-
}),
|
|
771
|
-
|
|
627
|
+
let G = w(!1), K = w(null), q = w(null), J = w({}), Y = m("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
628
|
+
C("m-menu-panel-registry", Y), ee(q, (e, t) => {
|
|
629
|
+
t && Y.delete(t), e && Y.add(e);
|
|
630
|
+
}), x(() => {
|
|
631
|
+
q.value && Y.delete(q.value);
|
|
772
632
|
});
|
|
773
|
-
let
|
|
774
|
-
|
|
775
|
-
function
|
|
776
|
-
if (!
|
|
777
|
-
let e =
|
|
778
|
-
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`,
|
|
633
|
+
let X = m("m-menu-sibling-group", null);
|
|
634
|
+
C("m-menu-sibling-group", { current: null });
|
|
635
|
+
function ie() {
|
|
636
|
+
if (!K.value) return;
|
|
637
|
+
let e = K.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` };
|
|
638
|
+
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`, J.value = r;
|
|
779
639
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
640
|
+
function ae() {
|
|
641
|
+
return q.value ? Array.from(q.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
782
642
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
643
|
+
function Z() {
|
|
644
|
+
g(() => ae()[0]?.focus());
|
|
785
645
|
}
|
|
786
|
-
function
|
|
787
|
-
let t =
|
|
646
|
+
function oe(e) {
|
|
647
|
+
let t = ae();
|
|
788
648
|
if (!t.length) return;
|
|
789
649
|
let n = t.indexOf(document.activeElement);
|
|
790
650
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
791
651
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
652
|
+
function se() {
|
|
653
|
+
G.value ? X?.current === Q && (X.current = null) : (X && X.current && X.current !== Q && X.current(), X && (X.current = Q), ie(), N.value = []), G.value = !G.value, G.value && Z();
|
|
794
654
|
}
|
|
795
655
|
function Q() {
|
|
796
|
-
|
|
656
|
+
X?.current === Q && (X.current = null), G.value = !1;
|
|
797
657
|
}
|
|
798
|
-
|
|
658
|
+
C("m-menu-close", Q), C("m-menu-nav", {
|
|
799
659
|
mode: d.submenuMode,
|
|
800
|
-
push:
|
|
660
|
+
push: re
|
|
801
661
|
}), n({
|
|
802
662
|
close: Q,
|
|
803
|
-
open:
|
|
663
|
+
open: G
|
|
804
664
|
});
|
|
805
|
-
function
|
|
665
|
+
function ce(e) {
|
|
806
666
|
let t = e.target;
|
|
807
|
-
if (!
|
|
808
|
-
for (let e of
|
|
667
|
+
if (!K.value?.contains(t)) {
|
|
668
|
+
for (let e of Y) if (e.contains(t)) return;
|
|
809
669
|
t.closest?.(".m3-submenu") || Q();
|
|
810
670
|
}
|
|
811
671
|
}
|
|
812
|
-
function
|
|
813
|
-
if (!
|
|
672
|
+
function le(e) {
|
|
673
|
+
if (!G.value) return;
|
|
814
674
|
let t = e.target;
|
|
815
|
-
for (let e of
|
|
675
|
+
for (let e of Y) if (e.contains(t)) return;
|
|
816
676
|
t.closest?.(".m3-submenu") || Q();
|
|
817
677
|
}
|
|
818
|
-
function
|
|
678
|
+
function ge(e) {
|
|
819
679
|
if (e.key === "Escape") {
|
|
820
|
-
N.value.length ?
|
|
680
|
+
N.value.length ? W() : Q();
|
|
821
681
|
return;
|
|
822
682
|
}
|
|
823
|
-
|
|
683
|
+
G.value && (e.key === "ArrowDown" ? (e.preventDefault(), oe(1)) : e.key === "ArrowUp" && (e.preventDefault(), oe(-1)));
|
|
824
684
|
}
|
|
825
|
-
|
|
826
|
-
document.addEventListener("mousedown",
|
|
827
|
-
}),
|
|
828
|
-
document.removeEventListener("mousedown",
|
|
685
|
+
b(() => {
|
|
686
|
+
document.addEventListener("mousedown", ce), document.addEventListener("keydown", ge), window.addEventListener("scroll", le, !0);
|
|
687
|
+
}), x(() => {
|
|
688
|
+
document.removeEventListener("mousedown", ce), document.removeEventListener("keydown", ge), window.removeEventListener("scroll", le, !0), B ? B() : z?.();
|
|
829
689
|
});
|
|
830
|
-
let
|
|
831
|
-
return (n, o) => (
|
|
690
|
+
let _e = o(() => d.align === "right" ? "top right" : "top left");
|
|
691
|
+
return (n, o) => (S(), l(r, null, [u("div", h({
|
|
832
692
|
ref_key: "triggerEl",
|
|
833
|
-
ref:
|
|
693
|
+
ref: K
|
|
694
|
+
}, n.$attrs, {
|
|
834
695
|
class: "inline-block",
|
|
835
|
-
onClick:
|
|
836
|
-
}, [
|
|
696
|
+
onClick: se
|
|
697
|
+
}), [E(n.$slots, "trigger", { open: G.value })], 16), (S(), s(i, { to: "body" }, [f(a, {
|
|
837
698
|
css: !1,
|
|
838
|
-
onEnter:
|
|
839
|
-
onLeave:
|
|
699
|
+
onEnter: H,
|
|
700
|
+
onLeave: U
|
|
840
701
|
}, {
|
|
841
|
-
default: M(() => [
|
|
702
|
+
default: M(() => [G.value ? (S(), l("div", {
|
|
842
703
|
key: 0,
|
|
843
704
|
ref_key: "dropdownEl",
|
|
844
|
-
ref:
|
|
845
|
-
class:
|
|
846
|
-
style:
|
|
847
|
-
...
|
|
848
|
-
transformOrigin:
|
|
705
|
+
ref: q,
|
|
706
|
+
class: _(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "shadow-elevation-2"]]),
|
|
707
|
+
style: v({
|
|
708
|
+
...J.value,
|
|
709
|
+
transformOrigin: _e.value
|
|
849
710
|
})
|
|
850
|
-
}, [u("div", { class:
|
|
711
|
+
}, [u("div", { class: _(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "bg-surface-container"]]) }, [u("div", {
|
|
851
712
|
class: "relative overflow-y-auto overscroll-contain py-1",
|
|
852
|
-
style:
|
|
713
|
+
style: v({ maxHeight: J.value.maxHeight })
|
|
853
714
|
}, [f(a, {
|
|
854
715
|
css: !1,
|
|
855
|
-
onEnter:
|
|
856
|
-
onLeave:
|
|
716
|
+
onEnter: I,
|
|
717
|
+
onLeave: te
|
|
857
718
|
}, {
|
|
858
|
-
default: M(() => [P.value ? (
|
|
719
|
+
default: M(() => [P.value ? (S(), l("div", { key: N.value.length }, [u("button", {
|
|
859
720
|
type: "button",
|
|
860
721
|
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",
|
|
861
|
-
onClick:
|
|
722
|
+
onClick: W
|
|
862
723
|
}, [
|
|
863
724
|
f(t, {
|
|
864
725
|
name: "chevron_left",
|
|
865
726
|
size: 20,
|
|
866
727
|
class: "shrink-0 text-on-surface-variant"
|
|
867
728
|
}),
|
|
868
|
-
P.value.icon ? (
|
|
729
|
+
P.value.icon ? (S(), s(t, {
|
|
869
730
|
key: 0,
|
|
870
731
|
name: P.value.icon,
|
|
871
732
|
size: 20,
|
|
872
733
|
class: "shrink-0 text-on-surface-variant"
|
|
873
734
|
}, null, 8, ["name"])) : c("", !0),
|
|
874
|
-
u("span",
|
|
875
|
-
]), (
|
|
735
|
+
u("span", de, [(S(), s(D(() => P.value?.header?.())))])
|
|
736
|
+
]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div", fe, [A.value ? (S(), l("div", pe, [(S(!0), l(r, null, T(k.value, (e, t) => (S(), l("div", {
|
|
876
737
|
key: t,
|
|
877
738
|
class: "rounded-lg shadow-elevation-2"
|
|
878
|
-
}, [u("div",
|
|
739
|
+
}, [u("div", me, [(S(), s(D(() => e)))])]))), 128))])) : E(n.$slots, "default", { close: Q }, void 0, void 0, 1)]))]),
|
|
879
740
|
_: 3
|
|
880
741
|
})], 4)], 2)], 6)) : c("", !0)]),
|
|
881
742
|
_: 3
|
|
882
743
|
})]))], 64));
|
|
883
744
|
}
|
|
884
|
-
}),
|
|
745
|
+
}), _e = { class: "flex-1" }, ve = {
|
|
885
746
|
key: 1,
|
|
886
747
|
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
887
|
-
},
|
|
748
|
+
}, ye = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, be = /* @__PURE__ */ p({
|
|
888
749
|
__name: "MMenuItem",
|
|
889
750
|
props: {
|
|
890
751
|
icon: {},
|
|
@@ -905,76 +766,76 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
905
766
|
},
|
|
906
767
|
emits: ["click"],
|
|
907
768
|
setup(e, { emit: n }) {
|
|
908
|
-
let r = e, d = n, p =
|
|
909
|
-
function
|
|
910
|
-
if (!
|
|
911
|
-
let e =
|
|
912
|
-
|
|
769
|
+
let r = e, d = n, p = j(), h = o(() => r.to ? "RouterLink" : "button"), g = o(() => !!p.children), y = m("m-menu-close", null), b = m("m-menu-nav", null), x = w(), C = w(!1), T = w({});
|
|
770
|
+
function A() {
|
|
771
|
+
if (!x.value) return;
|
|
772
|
+
let e = x.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
|
|
773
|
+
T.value = {
|
|
913
774
|
position: "fixed",
|
|
914
775
|
top: `${e.top}px`,
|
|
915
776
|
...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
|
|
916
777
|
zIndex: "501"
|
|
917
778
|
};
|
|
918
779
|
}
|
|
919
|
-
function
|
|
920
|
-
if (
|
|
921
|
-
|
|
780
|
+
function ee() {
|
|
781
|
+
if (C.value) {
|
|
782
|
+
C.value = !1;
|
|
922
783
|
return;
|
|
923
784
|
}
|
|
924
|
-
|
|
785
|
+
A(), C.value = !0;
|
|
925
786
|
}
|
|
926
|
-
function
|
|
787
|
+
function N() {
|
|
927
788
|
if (!r.disabled) {
|
|
928
|
-
if (
|
|
789
|
+
if (g.value) {
|
|
929
790
|
b?.mode === "push" ? b.push({
|
|
930
791
|
icon: r.icon,
|
|
931
792
|
header: p.default,
|
|
932
793
|
content: p.children
|
|
933
|
-
}) :
|
|
794
|
+
}) : ee();
|
|
934
795
|
return;
|
|
935
796
|
}
|
|
936
797
|
d("click"), r.keepOpen || y?.();
|
|
937
798
|
}
|
|
938
799
|
}
|
|
939
|
-
function
|
|
940
|
-
e.pointerType === "mouse" &&
|
|
800
|
+
function P(e) {
|
|
801
|
+
e.pointerType === "mouse" && g.value && !r.disabled && (A(), C.value = !0);
|
|
941
802
|
}
|
|
942
|
-
function
|
|
943
|
-
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (
|
|
803
|
+
function F(e) {
|
|
804
|
+
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (C.value = !1));
|
|
944
805
|
}
|
|
945
806
|
function I(e) {
|
|
946
807
|
if (e.pointerType !== "mouse") return;
|
|
947
808
|
let t = e.relatedTarget;
|
|
948
|
-
t?.closest(".m3-submenu") ||
|
|
809
|
+
t?.closest(".m3-submenu") || x.value?.contains(t) || (C.value = !1);
|
|
949
810
|
}
|
|
950
|
-
return (n, r) => (
|
|
811
|
+
return (n, r) => (S(), l("div", {
|
|
951
812
|
ref_key: "itemEl",
|
|
952
|
-
ref:
|
|
953
|
-
onPointerenter:
|
|
954
|
-
onPointerleave:
|
|
955
|
-
}, [(
|
|
813
|
+
ref: x,
|
|
814
|
+
onPointerenter: P,
|
|
815
|
+
onPointerleave: F
|
|
816
|
+
}, [(S(), s(D(h.value), {
|
|
956
817
|
to: e.to || void 0,
|
|
957
818
|
type: e.to ? void 0 : "button",
|
|
958
|
-
class:
|
|
819
|
+
class: _(["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", [
|
|
959
820
|
e.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
|
|
960
821
|
!e.disabled && e.danger ? "text-error hover:bg-error/8" : "",
|
|
961
822
|
!e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
962
823
|
]]),
|
|
963
824
|
disabled: e.disabled || void 0,
|
|
964
|
-
"aria-haspopup":
|
|
965
|
-
"aria-expanded":
|
|
966
|
-
onClick:
|
|
825
|
+
"aria-haspopup": g.value ? "menu" : void 0,
|
|
826
|
+
"aria-expanded": g.value ? C.value : void 0,
|
|
827
|
+
onClick: N
|
|
967
828
|
}, {
|
|
968
829
|
default: M(() => [
|
|
969
|
-
e.icon ? (
|
|
830
|
+
e.icon ? (S(), s(t, {
|
|
970
831
|
key: 0,
|
|
971
832
|
name: e.icon,
|
|
972
833
|
size: 20,
|
|
973
|
-
class:
|
|
834
|
+
class: _(["shrink-0", e.danger ? "text-error" : "text-on-surface-variant"])
|
|
974
835
|
}, null, 8, ["name", "class"])) : c("", !0),
|
|
975
|
-
u("span",
|
|
976
|
-
e.shortcut && !
|
|
977
|
-
|
|
836
|
+
u("span", _e, [E(n.$slots, "default")]),
|
|
837
|
+
e.shortcut && !g.value ? (S(), l("span", ve, O(e.shortcut), 1)) : c("", !0),
|
|
838
|
+
g.value ? (S(), s(t, {
|
|
978
839
|
key: 2,
|
|
979
840
|
name: "chevron_right",
|
|
980
841
|
size: 18,
|
|
@@ -989,7 +850,7 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
989
850
|
"disabled",
|
|
990
851
|
"aria-haspopup",
|
|
991
852
|
"aria-expanded"
|
|
992
|
-
])),
|
|
853
|
+
])), g.value && k(b)?.mode !== "push" ? (S(), s(i, {
|
|
993
854
|
key: 0,
|
|
994
855
|
to: "body"
|
|
995
856
|
}, [f(a, {
|
|
@@ -998,17 +859,166 @@ var ie = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
998
859
|
"leave-active-class": "transition-opacity duration-75",
|
|
999
860
|
"leave-to-class": "opacity-0"
|
|
1000
861
|
}, {
|
|
1001
|
-
default: M(() => [
|
|
862
|
+
default: M(() => [C.value ? (S(), l("div", {
|
|
1002
863
|
key: 0,
|
|
1003
864
|
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
1004
|
-
style:
|
|
865
|
+
style: v(T.value),
|
|
1005
866
|
onPointerleave: I
|
|
1006
|
-
}, [u("div",
|
|
867
|
+
}, [u("div", ye, [E(n.$slots, "children")])], 36)) : c("", !0)]),
|
|
1007
868
|
_: 3
|
|
1008
869
|
})])) : c("", !0)], 544));
|
|
1009
870
|
}
|
|
871
|
+
}), xe = { class: "flex flex-col gap-1" }, Se = [
|
|
872
|
+
"id",
|
|
873
|
+
"value",
|
|
874
|
+
"rows",
|
|
875
|
+
"disabled",
|
|
876
|
+
"required"
|
|
877
|
+
], Ce = [
|
|
878
|
+
"id",
|
|
879
|
+
"type",
|
|
880
|
+
"value",
|
|
881
|
+
"disabled",
|
|
882
|
+
"required",
|
|
883
|
+
"autocomplete"
|
|
884
|
+
], we = ["for"], Te = {
|
|
885
|
+
key: 0,
|
|
886
|
+
class: "text-error"
|
|
887
|
+
}, Ee = {
|
|
888
|
+
key: 3,
|
|
889
|
+
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
890
|
+
}, De = {
|
|
891
|
+
key: 0,
|
|
892
|
+
class: "px-4 text-body-small text-error"
|
|
893
|
+
}, Oe = {
|
|
894
|
+
key: 1,
|
|
895
|
+
class: "px-4 text-body-small text-on-surface-variant"
|
|
896
|
+
}, ke = /* @__PURE__ */ p({
|
|
897
|
+
__name: "MTextField",
|
|
898
|
+
props: {
|
|
899
|
+
modelValue: {},
|
|
900
|
+
label: {},
|
|
901
|
+
type: { default: "text" },
|
|
902
|
+
variant: { default: "filled" },
|
|
903
|
+
error: { type: Boolean },
|
|
904
|
+
errorLabel: {},
|
|
905
|
+
hint: {},
|
|
906
|
+
disabled: { type: Boolean },
|
|
907
|
+
required: { type: Boolean },
|
|
908
|
+
multiline: { type: Boolean },
|
|
909
|
+
rows: { default: 3 },
|
|
910
|
+
autocomplete: {},
|
|
911
|
+
leadingIcon: {},
|
|
912
|
+
clearable: {
|
|
913
|
+
type: Boolean,
|
|
914
|
+
default: !1
|
|
915
|
+
},
|
|
916
|
+
fieldBg: {},
|
|
917
|
+
debounce: { default: 0 }
|
|
918
|
+
},
|
|
919
|
+
emits: ["update:modelValue", "debounced"],
|
|
920
|
+
setup(e, { emit: n }) {
|
|
921
|
+
let r = e, i = n, a = A(), s = j(), p = w(null), { resolvedFieldBg: m } = H(p, () => r.fieldBg), { debounced: h, cancel: g } = U((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
|
|
922
|
+
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 = [
|
|
923
|
+
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
924
|
+
"transition-[border-color,border-width] duration-150",
|
|
925
|
+
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
926
|
+
r.error ? "caret-error" : "caret-primary",
|
|
927
|
+
i,
|
|
928
|
+
t,
|
|
929
|
+
n
|
|
930
|
+
];
|
|
931
|
+
return r.variant === "outlined" ? [
|
|
932
|
+
...a,
|
|
933
|
+
"rounded-xs border bg-transparent py-4",
|
|
934
|
+
r.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
935
|
+
"disabled:border-on-surface/12"
|
|
936
|
+
].join(" ") : [
|
|
937
|
+
...a,
|
|
938
|
+
"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
|
|
939
|
+
r.error ? "border-error focus:border-b-2 focus:border-error" : "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
|
|
940
|
+
"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
|
|
941
|
+
].join(" ");
|
|
942
|
+
}), x = o(() => {
|
|
943
|
+
let e = [
|
|
944
|
+
"pointer-events-none absolute truncate transition-all duration-200",
|
|
945
|
+
r.leadingIcon ? r.variant === "outlined" ? "left-11" : "left-12" : r.variant === "outlined" ? "left-3" : "left-4",
|
|
946
|
+
"right-4",
|
|
947
|
+
`${r.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
|
|
948
|
+
];
|
|
949
|
+
return r.variant === "outlined" ? [
|
|
950
|
+
...e,
|
|
951
|
+
"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1",
|
|
952
|
+
"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]",
|
|
953
|
+
"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
|
|
954
|
+
r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
955
|
+
"peer-disabled:text-on-surface/38"
|
|
956
|
+
].join(" ") : [
|
|
957
|
+
...e,
|
|
958
|
+
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
|
|
959
|
+
"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
|
|
960
|
+
r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
961
|
+
"peer-disabled:text-on-surface/38"
|
|
962
|
+
].join(" ");
|
|
963
|
+
});
|
|
964
|
+
function C(e) {
|
|
965
|
+
let t = e.target;
|
|
966
|
+
i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
|
|
967
|
+
}
|
|
968
|
+
return (n, r) => (S(), l("div", xe, [u("div", {
|
|
969
|
+
ref_key: "fieldBgEl",
|
|
970
|
+
ref: p,
|
|
971
|
+
class: _(["relative", e.variant === "outlined" ? "mt-2" : ""]),
|
|
972
|
+
style: v(e.variant === "outlined" ? { "--field-bg": k(m) } : void 0)
|
|
973
|
+
}, [
|
|
974
|
+
e.leadingIcon ? (S(), l("div", {
|
|
975
|
+
key: 0,
|
|
976
|
+
class: _(["pointer-events-none absolute left-3.5", [e.multiline ? "top-[55%] -translate-y-1/2" : e.variant === "filled" ? "top-4.5" : "top-4", e.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
|
|
977
|
+
}, [f(t, {
|
|
978
|
+
name: e.leadingIcon,
|
|
979
|
+
size: 24
|
|
980
|
+
}, null, 8, ["name"])], 2)) : c("", !0),
|
|
981
|
+
e.multiline ? (S(), l("textarea", {
|
|
982
|
+
key: 1,
|
|
983
|
+
id: k(a),
|
|
984
|
+
value: String(e.modelValue),
|
|
985
|
+
rows: e.rows,
|
|
986
|
+
disabled: e.disabled,
|
|
987
|
+
required: e.required,
|
|
988
|
+
placeholder: " ",
|
|
989
|
+
class: _(b.value),
|
|
990
|
+
onInput: C
|
|
991
|
+
}, null, 42, Se)) : (S(), l("input", {
|
|
992
|
+
key: 2,
|
|
993
|
+
id: k(a),
|
|
994
|
+
type: e.type,
|
|
995
|
+
value: e.modelValue,
|
|
996
|
+
disabled: e.disabled,
|
|
997
|
+
required: e.required,
|
|
998
|
+
autocomplete: e.autocomplete,
|
|
999
|
+
placeholder: " ",
|
|
1000
|
+
class: _(b.value),
|
|
1001
|
+
onInput: C
|
|
1002
|
+
}, null, 42, Ce)),
|
|
1003
|
+
u("label", {
|
|
1004
|
+
for: k(a),
|
|
1005
|
+
class: _(x.value)
|
|
1006
|
+
}, [d(O(e.label), 1), e.required ? (S(), l("span", Te, "\xA0*")) : c("", !0)], 10, we),
|
|
1007
|
+
n.$slots.trailing ? (S(), l("div", Ee, [E(n.$slots, "trailing")])) : y.value ? (S(), l("button", {
|
|
1008
|
+
key: 4,
|
|
1009
|
+
type: "button",
|
|
1010
|
+
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",
|
|
1011
|
+
onClick: r[0] ||= (e) => {
|
|
1012
|
+
k(g)(), i("update:modelValue", "");
|
|
1013
|
+
}
|
|
1014
|
+
}, [f(t, {
|
|
1015
|
+
name: "close",
|
|
1016
|
+
size: 18
|
|
1017
|
+
})])) : c("", !0)
|
|
1018
|
+
], 6), e.error && e.errorLabel ? (S(), l("p", De, O(e.errorLabel), 1)) : e.hint ? (S(), l("p", Oe, O(e.hint), 1)) : c("", !0)]));
|
|
1019
|
+
}
|
|
1010
1020
|
});
|
|
1011
1021
|
//#endregion
|
|
1012
|
-
export {
|
|
1022
|
+
export { ce as a, U as c, ue as i, H as l, be as n, K as o, ge as r, W as s, ke as t, R as u };
|
|
1013
1023
|
|
|
1014
|
-
//# sourceMappingURL=
|
|
1024
|
+
//# sourceMappingURL=MTextField-B0wGv1Mx.js.map
|