@m3ui-vue/m3ui-vue 0.9.1 → 0.9.3
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 +43 -0
- package/dist/API.md +266 -60
- package/dist/{MIcon-CaEooCmZ.js → MIcon-DLOkQduI.js} +10 -3
- package/dist/MIcon-DLOkQduI.js.map +1 -0
- package/dist/{MTextField-pJU1vFaR.js → MTextField-DKtgPymd.js} +422 -206
- package/dist/MTextField-DKtgPymd.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.md +547 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MBox.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +4 -2
- package/dist/components/MButtonGroup.vue.d.ts +2 -0
- package/dist/components/MColorPicker.vue.d.ts +13 -1
- package/dist/components/MColorPickerModal.vue.d.ts +14 -2
- package/dist/components/MDragHandle.vue.d.ts +12 -0
- package/dist/components/MEmojiSelector.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +5 -3
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -0
- package/dist/components/MIconButton.vue.d.ts +15 -1
- package/dist/components/MListItem.vue.d.ts +5 -5
- package/dist/components/MMenuItem.vue.d.ts +17 -4
- package/dist/components/MOverlay.vue.d.ts +1 -1
- package/dist/components/MScrollField.vue.d.ts +40 -0
- package/dist/components/MScrollable.vue.d.ts +9 -0
- package/dist/components/MSplitButton.vue.d.ts +2 -0
- package/dist/components/MSplitter.vue.d.ts +2 -2
- package/dist/components/MSwipeToDismiss.vue.d.ts +49 -0
- package/dist/components/MTabs.vue.d.ts +6 -0
- package/dist/components/MTimePickerModal.vue.d.ts +3 -0
- package/dist/components/MTimeScroll.vue.d.ts +22 -0
- package/dist/components/MToggleButton.vue.d.ts +2 -0
- package/dist/components/MTransition.vue.d.ts +34 -0
- package/dist/components/MTree.vue.d.ts +2 -2
- package/dist/components/MWindow.vue.d.ts +1 -1
- package/dist/components/_MColorPanel.vue.d.ts +18 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +3 -0
- package/dist/composables/_colorUtils.d.ts +34 -0
- package/dist/composables/_themeColor.d.ts +1 -0
- package/dist/composables/_useSpring.d.ts +17 -0
- package/dist/composables/dynamicColor.d.ts +18 -0
- package/dist/composables/useColorPalette.d.ts +27 -0
- package/dist/composables/useLocale.d.ts +16 -0
- package/dist/directives/vRipple.d.ts +16 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -1
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -1
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -1
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -1
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -1
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -1
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -1
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/locales/index.js +112 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7443 -6150
- package/dist/m3ui.js.map +1 -1
- package/dist/material-color-utilities-Cktu8DBU.js +3160 -0
- package/dist/material-color-utilities-Cktu8DBU.js.map +1 -0
- package/dist/plugin.d.ts +18 -0
- package/dist/rich-text-editor.js +22 -22
- package/dist/styles/palettes.css +546 -0
- package/dist/styles/theme.css +90 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-Drihe5G2.js → useLocale-Cn9MVIdw.js} +17 -1
- package/dist/useLocale-Cn9MVIdw.js.map +1 -0
- package/package.json +3 -2
- package/src/__tests__/MButtonGroup.test.ts +51 -0
- package/src/__tests__/MColorPicker.test.ts +141 -0
- package/src/__tests__/MDragHandle.test.ts +57 -0
- package/src/__tests__/MIconButton.test.ts +60 -0
- package/src/__tests__/MListItemShape.test.ts +76 -0
- package/src/__tests__/MMenuItem.test.ts +84 -0
- package/src/__tests__/MScrollField.test.ts +69 -0
- package/src/__tests__/MScrollable.test.ts +42 -0
- package/src/__tests__/MSwipeToDismiss.test.ts +104 -0
- package/src/__tests__/MTabs.test.ts +39 -0
- package/src/__tests__/MTimePickerModal.test.ts +52 -0
- package/src/__tests__/MTimeScroll.test.ts +44 -0
- package/src/__tests__/MTransition.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +191 -0
- package/src/__tests__/vRipple.test.ts +92 -0
- package/src/components/MBox.vue +4 -2
- package/src/components/MButton.vue +4 -13
- package/src/components/MButtonGroup.vue +118 -44
- package/src/components/MColorPicker.vue +114 -210
- package/src/components/MColorPickerModal.vue +50 -251
- package/src/components/MDragHandle.vue +54 -0
- package/src/components/MFab.vue +8 -15
- package/src/components/MIcon.vue +4 -2
- package/src/components/MIconButton.vue +96 -24
- package/src/components/MList.vue +33 -3
- package/src/components/MListItem.vue +75 -5
- package/src/components/MMenuItem.vue +115 -13
- package/src/components/MScrollField.vue +310 -0
- package/src/components/MScrollable.vue +160 -5
- package/src/components/MSplitButton.vue +5 -12
- package/src/components/MSplitter.vue +33 -10
- package/src/components/MSwipeToDismiss.vue +247 -0
- package/src/components/MTabs.vue +16 -5
- package/src/components/MTimePickerModal.vue +48 -8
- package/src/components/MTimeScroll.vue +161 -0
- package/src/components/MToggleButton.vue +5 -12
- package/src/components/MTransition.vue +149 -0
- package/src/components/_MColorPanel.vue +478 -0
- package/src/composables/_carouselStrategy.ts +3 -0
- package/src/composables/_colorUtils.ts +107 -0
- package/src/composables/_themeColor.ts +33 -0
- package/src/composables/_useSpring.ts +91 -0
- package/src/composables/dynamicColor.ts +85 -0
- package/src/composables/useColorPalette.ts +171 -25
- package/src/composables/useFieldBg.ts +6 -0
- package/src/composables/useLocale.ts +34 -0
- package/src/data/emoji-names/emoji-names-de.ts +1 -0
- package/src/data/emoji-names/emoji-names-en.ts +1 -0
- package/src/data/emoji-names/emoji-names-es.ts +1 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1 -0
- package/src/data/emojis.ts +1 -0
- package/src/directives/vRipple.ts +73 -0
- package/src/index.ts +14 -1
- package/src/locales/de.ts +16 -0
- package/src/locales/es.ts +16 -0
- package/src/locales/fr.ts +16 -0
- package/src/locales/ja.ts +16 -0
- package/src/locales/ko.ts +16 -0
- package/src/locales/pt.ts +16 -0
- package/src/locales/zh.ts +16 -0
- package/src/plugin.ts +30 -7
- package/src/styles/palettes.css +546 -0
- package/src/styles/theme.css +90 -0
- package/dist/MIcon-CaEooCmZ.js.map +0 -1
- package/dist/MTextField-pJU1vFaR.js.map +0 -1
- package/dist/useLocale-Drihe5G2.js.map +0 -1
|
@@ -1,16 +1,45 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import { t } from "./MIcon-
|
|
1
|
+
import { i as e } from "./useLocale-Cn9MVIdw.js";
|
|
2
|
+
import { t } from "./MIcon-DLOkQduI.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, 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,
|
|
5
|
-
//#region src/
|
|
6
|
-
|
|
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, withDirectives as N, withModifiers as P } from "vue";
|
|
5
|
+
//#region src/directives/vRipple.ts
|
|
6
|
+
function F(e) {
|
|
7
|
+
return e === !1 ? { disabled: !0 } : typeof e == "string" ? { color: e } : e === !0 || e == null ? {} : e;
|
|
8
|
+
}
|
|
9
|
+
function te(e, t, n) {
|
|
10
|
+
let r = e.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = document.createElement("span");
|
|
11
|
+
a.className = "m3-ripple-layer";
|
|
12
|
+
let o = document.createElement("span");
|
|
13
|
+
o.className = "m3-ripple", o.style.cssText = `width:${i}px;height:${i}px;top:${t.clientY - r.top - i / 2}px;left:${t.clientX - r.left - i / 2}px`, n && (o.style.background = n), a.appendChild(o), e.appendChild(a), o.addEventListener("animationend", () => a.remove(), { once: !0 });
|
|
14
|
+
}
|
|
15
|
+
var I = /* @__PURE__ */ new WeakMap(), L = {
|
|
16
|
+
mounted(e, t) {
|
|
17
|
+
let n = {
|
|
18
|
+
options: F(t.value),
|
|
19
|
+
onPointerDown(t) {
|
|
20
|
+
if (n.options.disabled || t.button !== 0) return;
|
|
21
|
+
let { position: r } = getComputedStyle(e);
|
|
22
|
+
(!r || r === "static") && (e.style.position = "relative"), te(e, t, n.options.color);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
I.set(e, n), e.addEventListener("pointerdown", n.onPointerDown);
|
|
26
|
+
},
|
|
27
|
+
updated(e, t) {
|
|
28
|
+
let n = I.get(e);
|
|
29
|
+
n && (n.options = F(t.value));
|
|
30
|
+
},
|
|
31
|
+
beforeUnmount(e) {
|
|
32
|
+
let t = I.get(e);
|
|
33
|
+
t && e.removeEventListener("pointerdown", t.onPointerDown), I.delete(e);
|
|
34
|
+
}
|
|
35
|
+
}, R = ["aria-label"], z = {
|
|
7
36
|
key: 0,
|
|
8
37
|
class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
9
|
-
},
|
|
38
|
+
}, B = [
|
|
10
39
|
"width",
|
|
11
40
|
"height",
|
|
12
41
|
"viewBox"
|
|
13
|
-
],
|
|
42
|
+
], V = ["d", "stroke-dasharray"], H = 3, U = 9, W = /* @__PURE__ */ p({
|
|
14
43
|
__name: "MSpinner",
|
|
15
44
|
props: {
|
|
16
45
|
size: { default: 20 },
|
|
@@ -21,10 +50,10 @@ var P = ["aria-label"], F = {
|
|
|
21
50
|
label: {}
|
|
22
51
|
},
|
|
23
52
|
setup(t) {
|
|
24
|
-
let n = t, r = e(), i = o(() => (n.size / 2 - 1 -
|
|
53
|
+
let n = t, r = e(), i = o(() => (n.size / 2 - 1 - H / 2) / 1.25), a = o(() => n.size / 2), s = o(() => {
|
|
25
54
|
let e = a.value, t = i.value, n = t * .08, r = [], o = 0, s = 0, c = 0;
|
|
26
55
|
for (let i = 0; i <= 216; i++) {
|
|
27
|
-
let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(
|
|
56
|
+
let a = 2 * Math.PI * i / 216 - Math.PI / 2, l = t + n * Math.sin(U * a), u = e + l * Math.cos(a), d = e + l * Math.sin(a);
|
|
28
57
|
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
58
|
}
|
|
30
59
|
let l = o * .58, u = o - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
|
|
@@ -53,14 +82,14 @@ var P = ["aria-label"], F = {
|
|
|
53
82
|
}, [u("path", {
|
|
54
83
|
d: s.value.path,
|
|
55
84
|
stroke: "currentColor",
|
|
56
|
-
"stroke-width":
|
|
85
|
+
"stroke-width": H,
|
|
57
86
|
"stroke-linecap": "round",
|
|
58
87
|
"stroke-dasharray": s.value.dash,
|
|
59
88
|
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
60
89
|
style: v({ "--m3-wave-len": s.value.len })
|
|
61
|
-
}, null, 12,
|
|
90
|
+
}, null, 12, V)], 12, B)) : (S(), l("span", z))], 12, R));
|
|
62
91
|
}
|
|
63
|
-
}),
|
|
92
|
+
}), ne = [
|
|
64
93
|
"bg-surface-container-highest",
|
|
65
94
|
"bg-surface-container-high",
|
|
66
95
|
"bg-surface-container-low",
|
|
@@ -76,16 +105,22 @@ var P = ["aria-label"], F = {
|
|
|
76
105
|
"bg-secondary-container",
|
|
77
106
|
"bg-tertiary-container",
|
|
78
107
|
"bg-error-container",
|
|
108
|
+
"bg-primary-fixed",
|
|
109
|
+
"bg-primary-fixed-dim",
|
|
110
|
+
"bg-secondary-fixed",
|
|
111
|
+
"bg-secondary-fixed-dim",
|
|
112
|
+
"bg-tertiary-fixed",
|
|
113
|
+
"bg-tertiary-fixed-dim",
|
|
79
114
|
"bg-primary",
|
|
80
115
|
"bg-secondary",
|
|
81
116
|
"bg-tertiary",
|
|
82
117
|
"bg-error"
|
|
83
118
|
];
|
|
84
|
-
function
|
|
85
|
-
for (let t of
|
|
119
|
+
function re(e) {
|
|
120
|
+
for (let t of ne) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
|
|
86
121
|
return null;
|
|
87
122
|
}
|
|
88
|
-
function
|
|
123
|
+
function G(e) {
|
|
89
124
|
if (!e || e === "transparent") return !0;
|
|
90
125
|
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
91
126
|
if (t) {
|
|
@@ -94,7 +129,7 @@ function V(e) {
|
|
|
94
129
|
}
|
|
95
130
|
return !1;
|
|
96
131
|
}
|
|
97
|
-
function
|
|
132
|
+
function K(e, t) {
|
|
98
133
|
let n = w("var(--color-surface)");
|
|
99
134
|
function r(r) {
|
|
100
135
|
n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
|
|
@@ -102,7 +137,7 @@ function H(e, t) {
|
|
|
102
137
|
function i() {
|
|
103
138
|
let t = e.value?.parentElement ?? null;
|
|
104
139
|
for (; t;) {
|
|
105
|
-
let e =
|
|
140
|
+
let e = re(t);
|
|
106
141
|
if (e) {
|
|
107
142
|
r(e);
|
|
108
143
|
return;
|
|
@@ -112,7 +147,7 @@ function H(e, t) {
|
|
|
112
147
|
return;
|
|
113
148
|
}
|
|
114
149
|
let n = getComputedStyle(t).backgroundColor;
|
|
115
|
-
if (!
|
|
150
|
+
if (!G(n)) {
|
|
116
151
|
r(n);
|
|
117
152
|
return;
|
|
118
153
|
}
|
|
@@ -134,7 +169,7 @@ function H(e, t) {
|
|
|
134
169
|
}
|
|
135
170
|
//#endregion
|
|
136
171
|
//#region src/composables/useDebounce.ts
|
|
137
|
-
function
|
|
172
|
+
function q(e, t) {
|
|
138
173
|
let n = null;
|
|
139
174
|
function r(...r) {
|
|
140
175
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -150,8 +185,55 @@ function U(e, t) {
|
|
|
150
185
|
};
|
|
151
186
|
}
|
|
152
187
|
//#endregion
|
|
188
|
+
//#region src/composables/_useSpring.ts
|
|
189
|
+
var J = {
|
|
190
|
+
dampingRatio: .9,
|
|
191
|
+
stiffness: 1400
|
|
192
|
+
}, Y = {
|
|
193
|
+
dampingRatio: 1,
|
|
194
|
+
stiffness: 3800
|
|
195
|
+
}, X = {
|
|
196
|
+
dampingRatio: 1,
|
|
197
|
+
stiffness: 1600
|
|
198
|
+
}, ie = .004;
|
|
199
|
+
function Z(e, t, n = J) {
|
|
200
|
+
let r = [...e()], i = r.map(() => 0), a = 0, o = 0;
|
|
201
|
+
function s(c) {
|
|
202
|
+
let l = Math.min((c - o) / 1e3, 1 / 30);
|
|
203
|
+
o = c;
|
|
204
|
+
let u = e();
|
|
205
|
+
u.length !== r.length && (r = [...u], i = u.map(() => 0));
|
|
206
|
+
let d = n.stiffness, f = 2 * n.dampingRatio * Math.sqrt(d);
|
|
207
|
+
for (; l > 0;) {
|
|
208
|
+
let e = Math.min(l, ie);
|
|
209
|
+
l -= e;
|
|
210
|
+
for (let t = 0; t < u.length; t++) i[t] += (-d * (r[t] - u[t]) - f * i[t]) * e, r[t] += i[t] * e;
|
|
211
|
+
}
|
|
212
|
+
let p = u.every((e, t) => Math.abs(e - r[t]) < .05 && Math.abs(i[t]) < .05);
|
|
213
|
+
p && (r = [...u], i = u.map(() => 0)), t(r), a = p ? 0 : requestAnimationFrame(s);
|
|
214
|
+
}
|
|
215
|
+
function c() {
|
|
216
|
+
a ||= (o = performance.now(), requestAnimationFrame(s));
|
|
217
|
+
}
|
|
218
|
+
function l() {
|
|
219
|
+
cancelAnimationFrame(a), a = 0, r = [...e()], i = r.map(() => 0), t(r);
|
|
220
|
+
}
|
|
221
|
+
return ee(() => e().join(","), c), b(() => t(r)), x(() => cancelAnimationFrame(a)), { snap: l };
|
|
222
|
+
}
|
|
223
|
+
function ae(e) {
|
|
224
|
+
if (e <= 0) return 0;
|
|
225
|
+
if (e >= 1) return 1;
|
|
226
|
+
let t = e;
|
|
227
|
+
for (let n = 0; n < 8; n++) {
|
|
228
|
+
let n = 3 * t * (1 - t) ** 2 * .4 + 3 * t ** 2 * (1 - t) * .2 + t ** 3 - e, r = 3 * (1 - t) ** 2 * .4 + 6 * t * (1 - t) * -.2 + 3 * t ** 2 * .8;
|
|
229
|
+
if (Math.abs(r) < 1e-6) break;
|
|
230
|
+
t -= n / r;
|
|
231
|
+
}
|
|
232
|
+
return 3 * t ** 2 * (1 - t) + t ** 3;
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
153
235
|
//#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
|
|
154
|
-
var
|
|
236
|
+
var oe = "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]", se = /* @__PURE__ */ p({
|
|
155
237
|
__name: "MIconButton",
|
|
156
238
|
props: {
|
|
157
239
|
icon: {},
|
|
@@ -163,91 +245,153 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
163
245
|
type: Boolean,
|
|
164
246
|
default: !1
|
|
165
247
|
},
|
|
166
|
-
to: {}
|
|
248
|
+
to: {},
|
|
249
|
+
rippleColor: {},
|
|
250
|
+
checked: {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: void 0
|
|
253
|
+
},
|
|
254
|
+
checkedIcon: {}
|
|
167
255
|
},
|
|
168
|
-
|
|
169
|
-
|
|
256
|
+
emits: ["update:checked"],
|
|
257
|
+
setup(e, { emit: n }) {
|
|
258
|
+
let r = e, i = n, a = o(() => r.checked !== void 0), c = o(() => r.to && !a.value ? "RouterLink" : "button"), l = {
|
|
170
259
|
xs: {
|
|
171
260
|
px: 32,
|
|
172
261
|
icon: 20,
|
|
173
|
-
squareRadius: "rounded-md"
|
|
262
|
+
squareRadius: "rounded-md",
|
|
263
|
+
square: 12,
|
|
264
|
+
pressed: 8,
|
|
265
|
+
checkedRound: 12
|
|
174
266
|
},
|
|
175
267
|
sm: {
|
|
176
268
|
px: 40,
|
|
177
269
|
icon: 24,
|
|
178
|
-
squareRadius: "rounded-md"
|
|
270
|
+
squareRadius: "rounded-md",
|
|
271
|
+
square: 12,
|
|
272
|
+
pressed: 8,
|
|
273
|
+
checkedRound: 12
|
|
179
274
|
},
|
|
180
275
|
md: {
|
|
181
276
|
px: 56,
|
|
182
277
|
icon: 24,
|
|
183
|
-
squareRadius: "rounded-lg"
|
|
278
|
+
squareRadius: "rounded-lg",
|
|
279
|
+
square: 16,
|
|
280
|
+
pressed: 12,
|
|
281
|
+
checkedRound: 16
|
|
184
282
|
},
|
|
185
283
|
lg: {
|
|
186
284
|
px: 96,
|
|
187
285
|
icon: 32,
|
|
188
|
-
squareRadius: "rounded-xl"
|
|
286
|
+
squareRadius: "rounded-xl",
|
|
287
|
+
square: 28,
|
|
288
|
+
pressed: 16,
|
|
289
|
+
checkedRound: 28
|
|
189
290
|
},
|
|
190
291
|
xl: {
|
|
191
292
|
px: 136,
|
|
192
293
|
icon: 40,
|
|
193
|
-
squareRadius: "rounded-xl"
|
|
294
|
+
squareRadius: "rounded-xl",
|
|
295
|
+
square: 28,
|
|
296
|
+
pressed: 16,
|
|
297
|
+
checkedRound: 28
|
|
194
298
|
}
|
|
195
|
-
},
|
|
196
|
-
px:
|
|
197
|
-
icon: Math.round(
|
|
198
|
-
squareRadius: "rounded-md"
|
|
199
|
-
|
|
200
|
-
|
|
299
|
+
}, u = o(() => typeof r.size == "number" ? {
|
|
300
|
+
px: r.size,
|
|
301
|
+
icon: Math.round(r.size * .55),
|
|
302
|
+
squareRadius: "rounded-md",
|
|
303
|
+
square: 12,
|
|
304
|
+
pressed: 8,
|
|
305
|
+
checkedRound: 12
|
|
306
|
+
} : l[r.size] ?? l.sm), d = w(null), p = w(!1);
|
|
307
|
+
function m() {
|
|
308
|
+
let e = u.value, t = e.px / 2;
|
|
309
|
+
return p.value ? e.pressed : r.checked ? r.shape === "squared" ? t : e.checkedRound : r.shape === "squared" ? e.square : t;
|
|
310
|
+
}
|
|
311
|
+
Z(() => a.value ? [m()] : [], (e) => {
|
|
312
|
+
d.value instanceof HTMLElement && (d.value.style.borderRadius = e.length ? `${e[0]}px` : "");
|
|
313
|
+
}, X);
|
|
314
|
+
function h() {
|
|
315
|
+
a.value && !r.disabled && (p.value = !0);
|
|
316
|
+
}
|
|
317
|
+
function g() {
|
|
318
|
+
p.value = !1;
|
|
319
|
+
}
|
|
320
|
+
function y() {
|
|
321
|
+
a.value && !r.disabled && i("update:checked", !r.checked);
|
|
322
|
+
}
|
|
323
|
+
let b = o(() => {
|
|
324
|
+
if (r.variant === "outlined" && r.checked) return "disabled:bg-on-surface/10";
|
|
325
|
+
switch (r.variant) {
|
|
201
326
|
case "filled":
|
|
202
327
|
case "tonal": return "disabled:bg-on-surface/10";
|
|
203
328
|
default: return "";
|
|
204
329
|
}
|
|
205
|
-
}),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
330
|
+
}), x = o(() => r.shape === "squared" ? u.value.squareRadius : "rounded-full"), C = o(() => {
|
|
331
|
+
let e = r.checked;
|
|
332
|
+
switch (r.variant) {
|
|
333
|
+
case "filled": return e ? "bg-primary text-on-primary" : "bg-surface-container text-on-surface-variant";
|
|
334
|
+
case "tonal": return e ? "bg-secondary text-on-secondary" : "bg-secondary-container text-on-secondary-container";
|
|
335
|
+
case "outlined": return e ? "bg-inverse-surface text-inverse-on-surface" : "border border-current text-on-surface-variant";
|
|
336
|
+
default: return e ? "text-primary" : "text-on-surface-variant";
|
|
337
|
+
}
|
|
338
|
+
}), T = o(() => {
|
|
339
|
+
if (a.value) return C.value;
|
|
340
|
+
switch (r.variant) {
|
|
213
341
|
case "filled": return "bg-primary text-on-primary";
|
|
214
342
|
case "tonal": return "bg-secondary-container text-on-secondary-container";
|
|
215
343
|
case "outlined": return "border border-current text-on-surface-variant";
|
|
216
344
|
default: return "text-on-surface-variant";
|
|
217
345
|
}
|
|
218
346
|
});
|
|
219
|
-
return (n,
|
|
220
|
-
|
|
221
|
-
|
|
347
|
+
return (n, r) => N((S(), s(D(c.value), {
|
|
348
|
+
ref_key: "rootEl",
|
|
349
|
+
ref: d,
|
|
350
|
+
to: c.value === "RouterLink" ? e.to : void 0,
|
|
351
|
+
type: c.value === "RouterLink" ? void 0 : "button",
|
|
222
352
|
"aria-label": e.label || void 0,
|
|
353
|
+
"aria-pressed": a.value ? e.checked : void 0,
|
|
223
354
|
disabled: e.disabled,
|
|
224
355
|
class: _([
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
356
|
+
oe,
|
|
357
|
+
x.value,
|
|
358
|
+
T.value,
|
|
359
|
+
b.value
|
|
229
360
|
]),
|
|
230
361
|
style: v({
|
|
231
|
-
width: `${
|
|
232
|
-
height: `${
|
|
362
|
+
width: `${u.value.px}px`,
|
|
363
|
+
height: `${u.value.px}px`
|
|
233
364
|
}),
|
|
234
|
-
onPointerdown:
|
|
365
|
+
onPointerdown: h,
|
|
366
|
+
onPointerup: g,
|
|
367
|
+
onPointerleave: g,
|
|
368
|
+
onPointercancel: g,
|
|
369
|
+
onClick: y
|
|
235
370
|
}, {
|
|
236
371
|
default: M(() => [f(t, {
|
|
237
|
-
name: e.icon,
|
|
238
|
-
size:
|
|
239
|
-
|
|
372
|
+
name: e.checked && e.checkedIcon ? e.checkedIcon : e.icon,
|
|
373
|
+
size: u.value.icon,
|
|
374
|
+
filled: !!e.checked
|
|
375
|
+
}, null, 8, [
|
|
376
|
+
"name",
|
|
377
|
+
"size",
|
|
378
|
+
"filled"
|
|
379
|
+
])]),
|
|
240
380
|
_: 1
|
|
241
381
|
}, 40, [
|
|
242
382
|
"to",
|
|
243
383
|
"type",
|
|
244
384
|
"aria-label",
|
|
385
|
+
"aria-pressed",
|
|
245
386
|
"disabled",
|
|
246
387
|
"class",
|
|
247
388
|
"style"
|
|
248
|
-
]))
|
|
389
|
+
])), [[k(L), {
|
|
390
|
+
disabled: e.disabled,
|
|
391
|
+
color: e.rippleColor
|
|
392
|
+
}]]);
|
|
249
393
|
}
|
|
250
|
-
}),
|
|
394
|
+
}), Q = "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]", ce = /* @__PURE__ */ p({
|
|
251
395
|
__name: "MButton",
|
|
252
396
|
props: {
|
|
253
397
|
variant: { default: "filled" },
|
|
@@ -265,7 +409,8 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
265
409
|
iconPos: { default: "leading" },
|
|
266
410
|
size: { default: "sm" },
|
|
267
411
|
shape: { default: "rounded" },
|
|
268
|
-
to: {}
|
|
412
|
+
to: {},
|
|
413
|
+
rippleColor: {}
|
|
269
414
|
},
|
|
270
415
|
setup(e) {
|
|
271
416
|
let n = ["primary", "error"], i = e, a = o(() => i.to ? "RouterLink" : "button"), u = o(() => !!i.color && !n.includes(i.color)), d = o(() => {
|
|
@@ -345,28 +490,22 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
345
490
|
default: return "";
|
|
346
491
|
}
|
|
347
492
|
});
|
|
348
|
-
|
|
349
|
-
if (i.disabled || i.loading) return;
|
|
350
|
-
let t = e.currentTarget, n = t.getBoundingClientRect(), r = Math.max(n.width, n.height) * 2, a = document.createElement("span");
|
|
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
|
-
}
|
|
353
|
-
return (n, i) => (S(), s(D(a.value), {
|
|
493
|
+
return (n, i) => N((S(), s(D(a.value), {
|
|
354
494
|
to: e.to || void 0,
|
|
355
495
|
type: e.to ? void 0 : e.type,
|
|
356
496
|
disabled: e.disabled || e.loading,
|
|
357
497
|
class: _([
|
|
358
|
-
|
|
498
|
+
Q,
|
|
359
499
|
C.value,
|
|
360
500
|
g.value,
|
|
361
501
|
x.value,
|
|
362
502
|
w.value,
|
|
363
503
|
p.value
|
|
364
504
|
]),
|
|
365
|
-
style: v(d.value)
|
|
366
|
-
onPointerdown: T
|
|
505
|
+
style: v(d.value)
|
|
367
506
|
}, {
|
|
368
507
|
default: M(() => [
|
|
369
|
-
e.iconPos === "leading" ? (S(), l(r, { key: 0 }, [e.loading ? (S(), s(
|
|
508
|
+
e.iconPos === "leading" ? (S(), l(r, { key: 0 }, [e.loading ? (S(), s(W, {
|
|
370
509
|
key: 0,
|
|
371
510
|
size: b.value
|
|
372
511
|
}, null, 8, ["size"])) : e.icon ? (S(), s(t, {
|
|
@@ -375,7 +514,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
375
514
|
size: y.value
|
|
376
515
|
}, null, 8, ["name", "size"])) : c("", !0)], 64)) : c("", !0),
|
|
377
516
|
E(n.$slots, "default"),
|
|
378
|
-
e.iconPos === "trailing" ? (S(), l(r, { key: 1 }, [e.loading ? (S(), s(
|
|
517
|
+
e.iconPos === "trailing" ? (S(), l(r, { key: 1 }, [e.loading ? (S(), s(W, {
|
|
379
518
|
key: 0,
|
|
380
519
|
size: b.value
|
|
381
520
|
}, null, 8, ["size"])) : e.icon ? (S(), s(t, {
|
|
@@ -385,33 +524,36 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
385
524
|
}, null, 8, ["name", "size"])) : c("", !0)], 64)) : c("", !0)
|
|
386
525
|
]),
|
|
387
526
|
_: 3
|
|
388
|
-
},
|
|
527
|
+
}, 8, [
|
|
389
528
|
"to",
|
|
390
529
|
"type",
|
|
391
530
|
"disabled",
|
|
392
531
|
"class",
|
|
393
532
|
"style"
|
|
394
|
-
]))
|
|
533
|
+
])), [[k(L), {
|
|
534
|
+
disabled: e.disabled || e.loading,
|
|
535
|
+
color: e.rippleColor
|
|
536
|
+
}]]);
|
|
395
537
|
}
|
|
396
|
-
}),
|
|
538
|
+
}), le = { class: "relative px-6 pt-6 pb-2" }, ue = {
|
|
397
539
|
key: 0,
|
|
398
540
|
class: "absolute right-4 top-4"
|
|
399
|
-
},
|
|
541
|
+
}, de = {
|
|
400
542
|
key: 1,
|
|
401
543
|
class: "mb-4 flex justify-center text-secondary"
|
|
402
|
-
},
|
|
544
|
+
}, fe = {
|
|
403
545
|
key: 0,
|
|
404
546
|
class: "shrink-0 border-t border-outline-variant"
|
|
405
|
-
},
|
|
547
|
+
}, pe = {
|
|
406
548
|
key: 1,
|
|
407
549
|
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
408
|
-
},
|
|
550
|
+
}, me = {
|
|
409
551
|
key: 0,
|
|
410
552
|
class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
|
|
411
|
-
},
|
|
553
|
+
}, he = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, ge = { class: "flex-1 text-title-large font-medium text-on-surface" }, _e = {
|
|
412
554
|
key: 1,
|
|
413
555
|
class: "flex items-center gap-2"
|
|
414
|
-
},
|
|
556
|
+
}, ve = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ye = /*#__PURE__*/ n(/* @__PURE__ */ p({
|
|
415
557
|
__name: "MDialog",
|
|
416
558
|
props: {
|
|
417
559
|
modelValue: { type: Boolean },
|
|
@@ -444,7 +586,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
444
586
|
function T(e) {
|
|
445
587
|
e.key === "Escape" && C();
|
|
446
588
|
}
|
|
447
|
-
let D = w(), A = w(), j = w(!1),
|
|
589
|
+
let D = w(), A = w(), j = w(!1), N;
|
|
448
590
|
function F() {
|
|
449
591
|
let e = D.value;
|
|
450
592
|
if (!e) {
|
|
@@ -454,24 +596,24 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
454
596
|
j.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1;
|
|
455
597
|
}
|
|
456
598
|
return ee(() => r.modelValue, async (e) => {
|
|
457
|
-
e ? (document.addEventListener("keydown", T), document.body.style.overflow = "hidden", await g(), F(),
|
|
599
|
+
e ? (document.addEventListener("keydown", T), document.body.style.overflow = "hidden", await g(), F(), N = new ResizeObserver(F), D.value && N.observe(D.value), A.value && N.observe(A.value)) : (document.removeEventListener("keydown", T), document.body.style.overflow = "", N?.disconnect(), N = void 0);
|
|
458
600
|
}), x(() => {
|
|
459
|
-
document.removeEventListener("keydown", T),
|
|
601
|
+
document.removeEventListener("keydown", T), N?.disconnect();
|
|
460
602
|
}), (e, n) => (S(), s(i, { to: "body" }, [t.fullscreen ? (S(), s(a, {
|
|
461
603
|
key: 1,
|
|
462
604
|
name: "m3-dialog-fs",
|
|
463
605
|
appear: ""
|
|
464
606
|
}, {
|
|
465
|
-
default: M(() => [t.modelValue ? (S(), l("div",
|
|
466
|
-
t.persistent ? c("", !0) : (S(), s(
|
|
607
|
+
default: M(() => [t.modelValue ? (S(), l("div", me, [u("div", he, [
|
|
608
|
+
t.persistent ? c("", !0) : (S(), s(se, {
|
|
467
609
|
key: 0,
|
|
468
610
|
icon: "close",
|
|
469
611
|
label: t.closeLabel ?? k(p).close,
|
|
470
612
|
onClick: C
|
|
471
613
|
}, null, 8, ["label"])),
|
|
472
|
-
u("h2",
|
|
473
|
-
e.$slots.actions ? (S(), l("div",
|
|
474
|
-
]), u("div",
|
|
614
|
+
u("h2", ge, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)]),
|
|
615
|
+
e.$slots.actions ? (S(), l("div", _e, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
616
|
+
]), u("div", ve, [E(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
475
617
|
_: 3
|
|
476
618
|
})) : (S(), s(a, {
|
|
477
619
|
key: 0,
|
|
@@ -481,18 +623,18 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
481
623
|
default: M(() => [t.modelValue ? (S(), l("div", {
|
|
482
624
|
key: 0,
|
|
483
625
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
|
|
484
|
-
onClick:
|
|
626
|
+
onClick: P(C, ["self"])
|
|
485
627
|
}, [u("div", {
|
|
486
628
|
class: _(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", h.value]),
|
|
487
629
|
style: v(y.value)
|
|
488
630
|
}, [
|
|
489
|
-
u("div",
|
|
490
|
-
t.closable && !t.persistent ? (S(), l("div",
|
|
631
|
+
u("div", le, [
|
|
632
|
+
t.closable && !t.persistent ? (S(), l("div", ue, [f(se, {
|
|
491
633
|
icon: "close",
|
|
492
634
|
label: t.closeLabel ?? k(p).close,
|
|
493
635
|
onClick: C
|
|
494
636
|
}, null, 8, ["label"])])) : c("", !0),
|
|
495
|
-
e.$slots.icon ? (S(), l("div",
|
|
637
|
+
e.$slots.icon ? (S(), l("div", de, [E(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
|
|
496
638
|
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)
|
|
497
639
|
]),
|
|
498
640
|
u("div", {
|
|
@@ -504,25 +646,25 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
504
646
|
ref_key: "contentInnerEl",
|
|
505
647
|
ref: A
|
|
506
648
|
}, [E(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
507
|
-
j.value && e.$slots.actions ? (S(), l("div",
|
|
508
|
-
e.$slots.actions ? (S(), l("div",
|
|
649
|
+
j.value && e.$slots.actions ? (S(), l("div", fe)) : c("", !0),
|
|
650
|
+
e.$slots.actions ? (S(), l("div", pe, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
509
651
|
], 6)])) : c("", !0)]),
|
|
510
652
|
_: 3
|
|
511
653
|
}))]));
|
|
512
654
|
}
|
|
513
|
-
}), [["__scopeId", "data-v-0aac9ebd"]]),
|
|
655
|
+
}), [["__scopeId", "data-v-0aac9ebd"]]), be = { class: "my-1 border-outline-variant" }, xe = /* @__PURE__ */ p({
|
|
514
656
|
__name: "MMenuDivider",
|
|
515
657
|
props: { gap: {
|
|
516
658
|
type: Boolean,
|
|
517
659
|
default: !1
|
|
518
660
|
} },
|
|
519
661
|
setup(e) {
|
|
520
|
-
return (e, t) => (S(), l("hr",
|
|
662
|
+
return (e, t) => (S(), l("hr", be));
|
|
521
663
|
}
|
|
522
|
-
}),
|
|
664
|
+
}), Se = { class: "flex-1 truncate" }, Ce = { key: "root" }, we = {
|
|
523
665
|
key: 0,
|
|
524
666
|
class: "flex flex-col gap-1 px-1.5"
|
|
525
|
-
},
|
|
667
|
+
}, Te = { class: "overflow-hidden rounded-lg bg-surface-container" }, Ee = 220, $ = 1 / 240, De = /* @__PURE__ */ p({
|
|
526
668
|
inheritAttrs: !1,
|
|
527
669
|
__name: "MMenu",
|
|
528
670
|
props: {
|
|
@@ -538,7 +680,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
538
680
|
return t;
|
|
539
681
|
}
|
|
540
682
|
function O(e) {
|
|
541
|
-
if (e.type !==
|
|
683
|
+
if (e.type !== xe) return !1;
|
|
542
684
|
let t = e.props?.gap;
|
|
543
685
|
return t === "" || t === !0 || t === "true";
|
|
544
686
|
}
|
|
@@ -548,7 +690,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
548
690
|
for (let n of e) O(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
549
691
|
return t.filter((e) => e.length > 0);
|
|
550
692
|
}), A = o(() => !!k.value && k.value.length > 1), N = w([]), P = o(() => N.value[N.value.length - 1]), F = w("forward");
|
|
551
|
-
function
|
|
693
|
+
function te(e, t) {
|
|
552
694
|
let n = F.value === "forward" ? 1 : -1, r = e.animate([{
|
|
553
695
|
transform: `translateX(${n * 100}%)`,
|
|
554
696
|
opacity: .4
|
|
@@ -556,12 +698,12 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
556
698
|
transform: "translateX(0%)",
|
|
557
699
|
opacity: 1
|
|
558
700
|
}], {
|
|
559
|
-
duration:
|
|
701
|
+
duration: Ee,
|
|
560
702
|
easing: "cubic-bezier(0.05,0.7,0.1,1)"
|
|
561
703
|
});
|
|
562
704
|
r.onfinish = t;
|
|
563
705
|
}
|
|
564
|
-
function
|
|
706
|
+
function I(e, t) {
|
|
565
707
|
let n = F.value === "forward" ? -1 : 1, r = e;
|
|
566
708
|
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
567
709
|
let i = r.animate([{
|
|
@@ -571,13 +713,13 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
571
713
|
transform: `translateX(${n * 100}%)`,
|
|
572
714
|
opacity: .4
|
|
573
715
|
}], {
|
|
574
|
-
duration:
|
|
716
|
+
duration: Ee,
|
|
575
717
|
easing: "cubic-bezier(0.3,0,0.8,0.15)"
|
|
576
718
|
});
|
|
577
719
|
i.onfinish = t;
|
|
578
720
|
}
|
|
579
721
|
let L = null;
|
|
580
|
-
function
|
|
722
|
+
function R() {
|
|
581
723
|
if (L) return L;
|
|
582
724
|
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
583
725
|
for (let a = 0; a < 1 && (e.push({
|
|
@@ -589,10 +731,10 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
589
731
|
alpha: 1
|
|
590
732
|
}), L = e, e;
|
|
591
733
|
}
|
|
592
|
-
let
|
|
593
|
-
function
|
|
594
|
-
|
|
595
|
-
let r = e, i =
|
|
734
|
+
let z = 0, B = null, V = null;
|
|
735
|
+
function H(e, t, n) {
|
|
736
|
+
B?.();
|
|
737
|
+
let r = e, i = R(), a = i.length - 1, o = n ? 1 : -1, s = n ? a : 0, c = 0, l = 0, u = !1;
|
|
596
738
|
function d(e) {
|
|
597
739
|
let t = i[Math.round(Math.max(0, Math.min(a, e)))];
|
|
598
740
|
r.style.transform = `scale(${t.scale})`, r.style.opacity = String(Math.min(1, Math.max(0, t.alpha)));
|
|
@@ -600,29 +742,29 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
600
742
|
function f(e) {
|
|
601
743
|
if (u) return;
|
|
602
744
|
let r = c ? (e - c) / 1e3 / $ : 1;
|
|
603
|
-
if (c = e,
|
|
604
|
-
|
|
745
|
+
if (c = e, z = Math.max(0, Math.min(a, z + o * r)), d(z), n && z >= s || !n && z <= s) {
|
|
746
|
+
B = null, V = null, t();
|
|
605
747
|
return;
|
|
606
748
|
}
|
|
607
749
|
l = requestAnimationFrame(f);
|
|
608
750
|
}
|
|
609
|
-
|
|
751
|
+
B = () => {
|
|
610
752
|
u = !0, cancelAnimationFrame(l);
|
|
611
|
-
},
|
|
612
|
-
|
|
613
|
-
}, d(
|
|
614
|
-
}
|
|
615
|
-
function H(e, t) {
|
|
616
|
-
V(e, t, !0);
|
|
753
|
+
}, V = n ? null : () => {
|
|
754
|
+
B?.(), B = null, V = null, t();
|
|
755
|
+
}, d(z), l = requestAnimationFrame(f);
|
|
617
756
|
}
|
|
618
757
|
function U(e, t) {
|
|
619
|
-
|
|
758
|
+
H(e, t, !0);
|
|
620
759
|
}
|
|
621
|
-
function
|
|
622
|
-
|
|
760
|
+
function W(e, t) {
|
|
761
|
+
H(e, t, !1);
|
|
623
762
|
}
|
|
624
|
-
function
|
|
625
|
-
F.value = "
|
|
763
|
+
function ne(e) {
|
|
764
|
+
F.value = "forward", N.value.push(e), g(() => ae());
|
|
765
|
+
}
|
|
766
|
+
function re() {
|
|
767
|
+
F.value = "backward", N.value.pop(), g(() => ae());
|
|
626
768
|
}
|
|
627
769
|
let G = w(!1), K = w(null), q = w(null), J = w({}), Y = m("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
628
770
|
C("m-menu-panel-registry", Y), ee(q, (e, t) => {
|
|
@@ -637,27 +779,27 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
637
779
|
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
780
|
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;
|
|
639
781
|
}
|
|
640
|
-
function
|
|
782
|
+
function Z() {
|
|
641
783
|
return q.value ? Array.from(q.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
642
784
|
}
|
|
643
|
-
function
|
|
644
|
-
g(() =>
|
|
785
|
+
function ae() {
|
|
786
|
+
g(() => Z()[0]?.focus());
|
|
645
787
|
}
|
|
646
788
|
function oe(e) {
|
|
647
|
-
let t =
|
|
789
|
+
let t = Z();
|
|
648
790
|
if (!t.length) return;
|
|
649
791
|
let n = t.indexOf(document.activeElement);
|
|
650
792
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
651
793
|
}
|
|
652
794
|
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 &&
|
|
795
|
+
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 && ae();
|
|
654
796
|
}
|
|
655
797
|
function Q() {
|
|
656
798
|
X?.current === Q && (X.current = null), G.value = !1;
|
|
657
799
|
}
|
|
658
800
|
C("m-menu-close", Q), C("m-menu-nav", {
|
|
659
801
|
mode: d.submenuMode,
|
|
660
|
-
push:
|
|
802
|
+
push: ne
|
|
661
803
|
}), n({
|
|
662
804
|
close: Q,
|
|
663
805
|
open: G
|
|
@@ -675,19 +817,19 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
675
817
|
for (let e of Y) if (e.contains(t)) return;
|
|
676
818
|
t.closest?.(".m3-submenu") || Q();
|
|
677
819
|
}
|
|
678
|
-
function
|
|
820
|
+
function ue(e) {
|
|
679
821
|
if (e.key === "Escape") {
|
|
680
|
-
N.value.length ?
|
|
822
|
+
N.value.length ? re() : Q();
|
|
681
823
|
return;
|
|
682
824
|
}
|
|
683
825
|
G.value && (e.key === "ArrowDown" ? (e.preventDefault(), oe(1)) : e.key === "ArrowUp" && (e.preventDefault(), oe(-1)));
|
|
684
826
|
}
|
|
685
827
|
b(() => {
|
|
686
|
-
document.addEventListener("mousedown", ce), document.addEventListener("keydown",
|
|
828
|
+
document.addEventListener("mousedown", ce), document.addEventListener("keydown", ue), window.addEventListener("scroll", le, !0);
|
|
687
829
|
}), x(() => {
|
|
688
|
-
document.removeEventListener("mousedown", ce), document.removeEventListener("keydown",
|
|
830
|
+
document.removeEventListener("mousedown", ce), document.removeEventListener("keydown", ue), window.removeEventListener("scroll", le, !0), V ? V() : B?.();
|
|
689
831
|
});
|
|
690
|
-
let
|
|
832
|
+
let de = o(() => d.align === "right" ? "top right" : "top left");
|
|
691
833
|
return (n, o) => (S(), l(r, null, [u("div", h({
|
|
692
834
|
ref_key: "triggerEl",
|
|
693
835
|
ref: K
|
|
@@ -696,8 +838,8 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
696
838
|
onClick: se
|
|
697
839
|
}), [E(n.$slots, "trigger", { open: G.value })], 16), (S(), s(i, { to: "body" }, [f(a, {
|
|
698
840
|
css: !1,
|
|
699
|
-
onEnter:
|
|
700
|
-
onLeave:
|
|
841
|
+
onEnter: U,
|
|
842
|
+
onLeave: W
|
|
701
843
|
}, {
|
|
702
844
|
default: M(() => [G.value ? (S(), l("div", {
|
|
703
845
|
key: 0,
|
|
@@ -706,20 +848,20 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
706
848
|
class: _(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "shadow-elevation-2"]]),
|
|
707
849
|
style: v({
|
|
708
850
|
...J.value,
|
|
709
|
-
transformOrigin:
|
|
851
|
+
transformOrigin: de.value
|
|
710
852
|
})
|
|
711
853
|
}, [u("div", { class: _(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", A.value ? "" : "bg-surface-container"]]) }, [u("div", {
|
|
712
854
|
class: "relative overflow-y-auto overscroll-contain py-1",
|
|
713
855
|
style: v({ maxHeight: J.value.maxHeight })
|
|
714
856
|
}, [f(a, {
|
|
715
857
|
css: !1,
|
|
716
|
-
onEnter:
|
|
717
|
-
onLeave:
|
|
858
|
+
onEnter: te,
|
|
859
|
+
onLeave: I
|
|
718
860
|
}, {
|
|
719
861
|
default: M(() => [P.value ? (S(), l("div", { key: N.value.length }, [u("button", {
|
|
720
862
|
type: "button",
|
|
721
863
|
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",
|
|
722
|
-
onClick:
|
|
864
|
+
onClick: re
|
|
723
865
|
}, [
|
|
724
866
|
f(t, {
|
|
725
867
|
name: "chevron_left",
|
|
@@ -732,20 +874,20 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
732
874
|
size: 20,
|
|
733
875
|
class: "shrink-0 text-on-surface-variant"
|
|
734
876
|
}, null, 8, ["name"])) : c("", !0),
|
|
735
|
-
u("span",
|
|
736
|
-
]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div",
|
|
877
|
+
u("span", Se, [(S(), s(D(() => P.value?.header?.())))])
|
|
878
|
+
]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div", Ce, [A.value ? (S(), l("div", we, [(S(!0), l(r, null, T(k.value, (e, t) => (S(), l("div", {
|
|
737
879
|
key: t,
|
|
738
880
|
class: "rounded-lg shadow-elevation-2"
|
|
739
|
-
}, [u("div",
|
|
881
|
+
}, [u("div", Te, [(S(), s(D(() => e)))])]))), 128))])) : E(n.$slots, "default", { close: Q }, void 0, void 0, 1)]))]),
|
|
740
882
|
_: 3
|
|
741
883
|
})], 4)], 2)], 6)) : c("", !0)]),
|
|
742
884
|
_: 3
|
|
743
885
|
})]))], 64));
|
|
744
886
|
}
|
|
745
|
-
}),
|
|
746
|
-
key:
|
|
887
|
+
}), Oe = ["data-m3-menu-choice"], ke = { class: "flex-1" }, Ae = {
|
|
888
|
+
key: 2,
|
|
747
889
|
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
748
|
-
},
|
|
890
|
+
}, je = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Me = 32, Ne = /* @__PURE__ */ p({
|
|
749
891
|
__name: "MMenuItem",
|
|
750
892
|
props: {
|
|
751
893
|
icon: {},
|
|
@@ -761,82 +903,154 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
761
903
|
},
|
|
762
904
|
keepOpen: {
|
|
763
905
|
type: Boolean,
|
|
764
|
-
default:
|
|
765
|
-
}
|
|
906
|
+
default: void 0
|
|
907
|
+
},
|
|
908
|
+
selected: {
|
|
909
|
+
type: Boolean,
|
|
910
|
+
default: void 0
|
|
911
|
+
},
|
|
912
|
+
checked: {
|
|
913
|
+
type: Boolean,
|
|
914
|
+
default: void 0
|
|
915
|
+
},
|
|
916
|
+
selectedIcon: {}
|
|
766
917
|
},
|
|
767
|
-
emits: ["click"],
|
|
918
|
+
emits: ["click", "update:checked"],
|
|
768
919
|
setup(e, { emit: n }) {
|
|
769
|
-
let r = e, d = n, p =
|
|
770
|
-
function
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
920
|
+
let r = e, d = n, p = o(() => r.checked !== void 0), h = o(() => p.value || r.selected !== void 0), y = o(() => !!(r.checked ?? r.selected)), C = o(() => h.value && !r.icon), T = o(() => r.selectedIcon ?? (r.icon ? void 0 : "check")), A = w("single");
|
|
921
|
+
function N() {
|
|
922
|
+
let e = V.value;
|
|
923
|
+
if (!e || !h.value) return;
|
|
924
|
+
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
925
|
+
A.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
926
|
+
}
|
|
927
|
+
function P() {
|
|
928
|
+
if (y.value) return [
|
|
929
|
+
12,
|
|
930
|
+
12,
|
|
931
|
+
12,
|
|
932
|
+
12
|
|
933
|
+
];
|
|
934
|
+
let e = A.value === "first" ? 12 : 4, t = A.value === "last" ? 12 : 4;
|
|
935
|
+
return [
|
|
936
|
+
e,
|
|
937
|
+
e,
|
|
938
|
+
t,
|
|
939
|
+
t
|
|
940
|
+
];
|
|
941
|
+
}
|
|
942
|
+
let { snap: F } = Z(() => h.value ? [...P(), C.value && y.value ? Me : 0] : [], ([e, t, n, r, i]) => {
|
|
943
|
+
let a = H.value instanceof HTMLElement ? H.value : H.value?.$el;
|
|
944
|
+
a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), U.value && i !== void 0 && (U.value.style.width = `${i}px`);
|
|
945
|
+
}, J);
|
|
946
|
+
ee(A, () => F());
|
|
947
|
+
let te = null;
|
|
948
|
+
b(() => {
|
|
949
|
+
N();
|
|
950
|
+
let e = V.value?.parentElement;
|
|
951
|
+
e && (te = new MutationObserver(N), te.observe(e, { childList: !0 }));
|
|
952
|
+
}), x(() => te?.disconnect()), ee(h, () => g(N)), Z(() => C.value ? [+!!y.value] : [], ([e]) => {
|
|
953
|
+
U.value && e !== void 0 && (U.value.style.opacity = String(e));
|
|
954
|
+
}, Y);
|
|
955
|
+
let I = j(), L = o(() => r.to ? "RouterLink" : "button"), R = o(() => !!I.children), z = m("m-menu-close", null), B = m("m-menu-nav", null), V = w(), H = w(), U = w(), W = w(!1), ne = w({});
|
|
956
|
+
function re() {
|
|
957
|
+
if (!V.value) return;
|
|
958
|
+
let e = V.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
|
|
959
|
+
ne.value = {
|
|
774
960
|
position: "fixed",
|
|
775
961
|
top: `${e.top}px`,
|
|
776
962
|
...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
|
|
777
963
|
zIndex: "501"
|
|
778
964
|
};
|
|
779
965
|
}
|
|
780
|
-
function
|
|
781
|
-
if (
|
|
782
|
-
|
|
966
|
+
function G() {
|
|
967
|
+
if (W.value) {
|
|
968
|
+
W.value = !1;
|
|
783
969
|
return;
|
|
784
970
|
}
|
|
785
|
-
|
|
971
|
+
re(), W.value = !0;
|
|
786
972
|
}
|
|
787
|
-
function
|
|
973
|
+
function K() {
|
|
788
974
|
if (!r.disabled) {
|
|
789
|
-
if (
|
|
790
|
-
|
|
975
|
+
if (R.value) {
|
|
976
|
+
B?.mode === "push" ? B.push({
|
|
791
977
|
icon: r.icon,
|
|
792
|
-
header:
|
|
793
|
-
content:
|
|
794
|
-
}) :
|
|
978
|
+
header: I.default,
|
|
979
|
+
content: I.children
|
|
980
|
+
}) : G();
|
|
795
981
|
return;
|
|
796
982
|
}
|
|
797
|
-
d("click"), r.keepOpen ||
|
|
983
|
+
p.value && d("update:checked", !r.checked), d("click"), (r.keepOpen ?? p.value) || z?.();
|
|
798
984
|
}
|
|
799
985
|
}
|
|
800
|
-
function
|
|
801
|
-
e.pointerType === "mouse" &&
|
|
986
|
+
function q(e) {
|
|
987
|
+
e.pointerType === "mouse" && R.value && !r.disabled && (re(), W.value = !0);
|
|
802
988
|
}
|
|
803
|
-
function
|
|
804
|
-
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (
|
|
989
|
+
function X(e) {
|
|
990
|
+
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (W.value = !1));
|
|
805
991
|
}
|
|
806
|
-
function
|
|
992
|
+
function ie(e) {
|
|
807
993
|
if (e.pointerType !== "mouse") return;
|
|
808
994
|
let t = e.relatedTarget;
|
|
809
|
-
t?.closest(".m3-submenu") ||
|
|
995
|
+
t?.closest(".m3-submenu") || V.value?.contains(t) || (W.value = !1);
|
|
810
996
|
}
|
|
811
997
|
return (n, r) => (S(), l("div", {
|
|
812
998
|
ref_key: "itemEl",
|
|
813
|
-
ref:
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
999
|
+
ref: V,
|
|
1000
|
+
"data-m3-menu-choice": h.value || void 0,
|
|
1001
|
+
onPointerenter: q,
|
|
1002
|
+
onPointerleave: X
|
|
1003
|
+
}, [(S(), s(D(L.value), {
|
|
1004
|
+
ref_key: "controlEl",
|
|
1005
|
+
ref: H,
|
|
817
1006
|
to: e.to || void 0,
|
|
818
1007
|
type: e.to ? void 0 : "button",
|
|
819
|
-
|
|
1008
|
+
role: h.value ? p.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
|
|
1009
|
+
"aria-checked": h.value ? y.value : void 0,
|
|
1010
|
+
class: _(["flex items-center gap-3 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", h.value ? [
|
|
1011
|
+
"relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity",
|
|
1012
|
+
y.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
|
|
1013
|
+
e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
|
|
1014
|
+
] : [
|
|
1015
|
+
"w-full px-4",
|
|
820
1016
|
e.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
|
|
821
1017
|
!e.disabled && e.danger ? "text-error hover:bg-error/8" : "",
|
|
822
1018
|
!e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
823
1019
|
]]),
|
|
824
1020
|
disabled: e.disabled || void 0,
|
|
825
|
-
"aria-haspopup":
|
|
826
|
-
"aria-expanded":
|
|
827
|
-
onClick:
|
|
1021
|
+
"aria-haspopup": R.value ? "menu" : void 0,
|
|
1022
|
+
"aria-expanded": R.value ? W.value : void 0,
|
|
1023
|
+
onClick: K
|
|
828
1024
|
}, {
|
|
829
1025
|
default: M(() => [
|
|
830
|
-
|
|
1026
|
+
C.value ? (S(), l("span", {
|
|
831
1027
|
key: 0,
|
|
832
|
-
|
|
1028
|
+
ref_key: "iconSlotEl",
|
|
1029
|
+
ref: U,
|
|
1030
|
+
class: "-mr-3 flex shrink-0 overflow-hidden",
|
|
1031
|
+
style: {
|
|
1032
|
+
width: "0",
|
|
1033
|
+
opacity: "0"
|
|
1034
|
+
}
|
|
1035
|
+
}, [f(t, {
|
|
1036
|
+
name: T.value,
|
|
1037
|
+
size: 20,
|
|
1038
|
+
class: "shrink-0"
|
|
1039
|
+
}, null, 8, ["name"])], 512)) : e.icon ? (S(), s(t, {
|
|
1040
|
+
key: 1,
|
|
1041
|
+
name: y.value && T.value ? T.value : e.icon,
|
|
1042
|
+
filled: y.value && !T.value,
|
|
833
1043
|
size: 20,
|
|
834
|
-
class: _(["shrink-0", e.danger ? "text-error" : "text-on-surface-variant"])
|
|
835
|
-
}, null, 8, [
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
1044
|
+
class: _(["shrink-0", h.value ? y.value ? "" : "text-on-surface-variant" : e.danger ? "text-error" : "text-on-surface-variant"])
|
|
1045
|
+
}, null, 8, [
|
|
1046
|
+
"name",
|
|
1047
|
+
"filled",
|
|
1048
|
+
"class"
|
|
1049
|
+
])) : c("", !0),
|
|
1050
|
+
u("span", ke, [E(n.$slots, "default")]),
|
|
1051
|
+
e.shortcut && !R.value ? (S(), l("span", Ae, O(e.shortcut), 1)) : c("", !0),
|
|
1052
|
+
R.value ? (S(), s(t, {
|
|
1053
|
+
key: 3,
|
|
840
1054
|
name: "chevron_right",
|
|
841
1055
|
size: 18,
|
|
842
1056
|
class: "shrink-0 text-on-surface-variant"
|
|
@@ -846,11 +1060,13 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
846
1060
|
}, 8, [
|
|
847
1061
|
"to",
|
|
848
1062
|
"type",
|
|
1063
|
+
"role",
|
|
1064
|
+
"aria-checked",
|
|
849
1065
|
"class",
|
|
850
1066
|
"disabled",
|
|
851
1067
|
"aria-haspopup",
|
|
852
1068
|
"aria-expanded"
|
|
853
|
-
])),
|
|
1069
|
+
])), R.value && k(B)?.mode !== "push" ? (S(), s(i, {
|
|
854
1070
|
key: 0,
|
|
855
1071
|
to: "body"
|
|
856
1072
|
}, [f(a, {
|
|
@@ -859,41 +1075,41 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
859
1075
|
"leave-active-class": "transition-opacity duration-75",
|
|
860
1076
|
"leave-to-class": "opacity-0"
|
|
861
1077
|
}, {
|
|
862
|
-
default: M(() => [
|
|
1078
|
+
default: M(() => [W.value ? (S(), l("div", {
|
|
863
1079
|
key: 0,
|
|
864
1080
|
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
865
|
-
style: v(
|
|
866
|
-
onPointerleave:
|
|
867
|
-
}, [u("div",
|
|
1081
|
+
style: v(ne.value),
|
|
1082
|
+
onPointerleave: ie
|
|
1083
|
+
}, [u("div", je, [E(n.$slots, "children")])], 36)) : c("", !0)]),
|
|
868
1084
|
_: 3
|
|
869
|
-
})])) : c("", !0)],
|
|
1085
|
+
})])) : c("", !0)], 40, Oe));
|
|
870
1086
|
}
|
|
871
|
-
}),
|
|
1087
|
+
}), Pe = { class: "flex flex-col gap-1" }, Fe = [
|
|
872
1088
|
"id",
|
|
873
1089
|
"value",
|
|
874
1090
|
"rows",
|
|
875
1091
|
"disabled",
|
|
876
1092
|
"required"
|
|
877
|
-
],
|
|
1093
|
+
], Ie = [
|
|
878
1094
|
"id",
|
|
879
1095
|
"type",
|
|
880
1096
|
"value",
|
|
881
1097
|
"disabled",
|
|
882
1098
|
"required",
|
|
883
1099
|
"autocomplete"
|
|
884
|
-
],
|
|
1100
|
+
], Le = ["for"], Re = {
|
|
885
1101
|
key: 0,
|
|
886
1102
|
class: "text-error"
|
|
887
|
-
},
|
|
1103
|
+
}, ze = {
|
|
888
1104
|
key: 3,
|
|
889
1105
|
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
890
|
-
},
|
|
1106
|
+
}, Be = {
|
|
891
1107
|
key: 0,
|
|
892
1108
|
class: "px-4 text-body-small text-error"
|
|
893
|
-
},
|
|
1109
|
+
}, Ve = {
|
|
894
1110
|
key: 1,
|
|
895
1111
|
class: "px-4 text-body-small text-on-surface-variant"
|
|
896
|
-
},
|
|
1112
|
+
}, He = /* @__PURE__ */ p({
|
|
897
1113
|
__name: "MTextField",
|
|
898
1114
|
props: {
|
|
899
1115
|
modelValue: {},
|
|
@@ -918,7 +1134,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
918
1134
|
},
|
|
919
1135
|
emits: ["update:modelValue", "debounced"],
|
|
920
1136
|
setup(e, { emit: n }) {
|
|
921
|
-
let r = e, i = n, a = A(), s = j(), p = w(null), { resolvedFieldBg: m } =
|
|
1137
|
+
let r = e, i = n, a = A(), s = j(), p = w(null), { resolvedFieldBg: m } = K(p, () => r.fieldBg), { debounced: h, cancel: g } = q((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), b = o(() => {
|
|
922
1138
|
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
1139
|
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
924
1140
|
"transition-[border-color,border-width] duration-150",
|
|
@@ -965,7 +1181,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
965
1181
|
let t = e.target;
|
|
966
1182
|
i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
|
|
967
1183
|
}
|
|
968
|
-
return (n, r) => (S(), l("div",
|
|
1184
|
+
return (n, r) => (S(), l("div", Pe, [u("div", {
|
|
969
1185
|
ref_key: "fieldBgEl",
|
|
970
1186
|
ref: p,
|
|
971
1187
|
class: _(["relative", e.variant === "outlined" ? "mt-2" : ""]),
|
|
@@ -988,7 +1204,7 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
988
1204
|
placeholder: " ",
|
|
989
1205
|
class: _(b.value),
|
|
990
1206
|
onInput: C
|
|
991
|
-
}, null, 42,
|
|
1207
|
+
}, null, 42, Fe)) : (S(), l("input", {
|
|
992
1208
|
key: 2,
|
|
993
1209
|
id: k(a),
|
|
994
1210
|
type: e.type,
|
|
@@ -999,12 +1215,12 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
999
1215
|
placeholder: " ",
|
|
1000
1216
|
class: _(b.value),
|
|
1001
1217
|
onInput: C
|
|
1002
|
-
}, null, 42,
|
|
1218
|
+
}, null, 42, Ie)),
|
|
1003
1219
|
u("label", {
|
|
1004
1220
|
for: k(a),
|
|
1005
1221
|
class: _(x.value)
|
|
1006
|
-
}, [d(O(e.label), 1), e.required ? (S(), l("span",
|
|
1007
|
-
n.$slots.trailing ? (S(), l("div",
|
|
1222
|
+
}, [d(O(e.label), 1), e.required ? (S(), l("span", Re, "\xA0*")) : c("", !0)], 10, Le),
|
|
1223
|
+
n.$slots.trailing ? (S(), l("div", ze, [E(n.$slots, "trailing")])) : y.value ? (S(), l("button", {
|
|
1008
1224
|
key: 4,
|
|
1009
1225
|
type: "button",
|
|
1010
1226
|
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",
|
|
@@ -1015,10 +1231,10 @@ var re = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1015
1231
|
name: "close",
|
|
1016
1232
|
size: 18
|
|
1017
1233
|
})])) : c("", !0)
|
|
1018
|
-
], 6), e.error && e.errorLabel ? (S(), l("p",
|
|
1234
|
+
], 6), e.error && e.errorLabel ? (S(), l("p", Be, O(e.errorLabel), 1)) : e.hint ? (S(), l("p", Ve, O(e.hint), 1)) : c("", !0)]));
|
|
1019
1235
|
}
|
|
1020
1236
|
});
|
|
1021
1237
|
//#endregion
|
|
1022
|
-
export {
|
|
1238
|
+
export { ye as a, J as c, q as d, K as f, xe as i, ae as l, L as m, Ne as n, ce as o, W as p, De as r, se as s, He as t, Z as u };
|
|
1023
1239
|
|
|
1024
|
-
//# sourceMappingURL=MTextField-
|
|
1240
|
+
//# sourceMappingURL=MTextField-DKtgPymd.js.map
|