@m3ui-vue/m3ui-vue 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +940 -33
- package/dist/{MButton-CPghlKb0.js → MButton-OQ4wIERQ.js} +2 -2
- package/dist/{MButton-CPghlKb0.js.map → MButton-OQ4wIERQ.js.map} +1 -1
- package/dist/{MDialog-X50At1Gk.js → MDialog-DYMnaBlt.js} +3 -3
- package/dist/{MDialog-X50At1Gk.js.map → MDialog-DYMnaBlt.js.map} +1 -1
- package/dist/{MListItem-DVi1j1QI.js → MListItem-D2cNUyzP.js} +211 -168
- package/dist/MListItem-D2cNUyzP.js.map +1 -0
- package/dist/{MLoadingIndicator-vooA3110.js → MLoadingIndicator-DWUj0BAB.js} +2 -2
- package/dist/{MLoadingIndicator-vooA3110.js.map → MLoadingIndicator-DWUj0BAB.js.map} +1 -1
- package/dist/{MMenuItem-CRNZkVVr.js → MMenuItem-BuxYoASE.js} +133 -151
- package/dist/MMenuItem-BuxYoASE.js.map +1 -0
- package/dist/{MSeekBar-BL2W5_rD.js → MSeekBar-C4cn9RIF.js} +2 -2
- package/dist/{MSeekBar-BL2W5_rD.js.map → MSeekBar-C4cn9RIF.js.map} +1 -1
- package/dist/{MSlider-B9NcKTmZ.js → MSlider-BIkA6DiE.js} +2 -2
- package/dist/{MSlider-B9NcKTmZ.js.map → MSlider-BIkA6DiE.js.map} +1 -1
- package/dist/{MSpinner-_XpTRkAg.js → MSpinner-DZkXZJpc.js} +2 -2
- package/dist/{MSpinner-_XpTRkAg.js.map → MSpinner-DZkXZJpc.js.map} +1 -1
- package/dist/{MTextField-DpcPmR5B.js → MTextField-CNH-byir.js} +2 -2
- package/dist/{MTextField-DpcPmR5B.js.map → MTextField-CNH-byir.js.map} +1 -1
- package/dist/{MTooltip-BL3jPYPT.js → MTooltip-Dd5g2zhh.js} +4 -4
- package/dist/{MTooltip-BL3jPYPT.js.map → MTooltip-Dd5g2zhh.js.map} +1 -1
- package/dist/{_useEscapeStack-C5-BYr8y.js → _popupPosition-nL8SVKPK.js} +20 -2
- package/dist/_popupPosition-nL8SVKPK.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAddressField.vue.d.ts +54 -0
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +51 -0
- package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
- package/dist/components/MCameraCapture.vue.d.ts +51 -0
- package/dist/components/MCollapse.vue.d.ts +32 -0
- package/dist/components/MCountrySelect.vue.d.ts +41 -0
- package/dist/components/MCronField.vue.d.ts +26 -0
- package/dist/components/MDashboardGrid.vue.d.ts +65 -0
- package/dist/components/MDiffViewer.vue.d.ts +56 -0
- package/dist/components/MExpansionPanel.vue.d.ts +26 -3
- package/dist/components/MFilterBuilder.vue.d.ts +22 -0
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MMapCluster.vue.d.ts +80 -0
- package/dist/components/MMapDraw.vue.d.ts +79 -0
- package/dist/components/MMentionField.vue.d.ts +102 -0
- package/dist/components/MNotificationCenter.vue.d.ts +57 -0
- package/dist/components/MQRScanner.vue.d.ts +52 -0
- package/dist/components/MQuiz.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +39 -0
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MVideoPlayer.vue.d.ts +1 -1
- package/dist/components/_MFilterGroup.vue.d.ts +17 -0
- package/dist/composables/_caretPosition.d.ts +6 -0
- package/dist/composables/_useCamera.d.ts +16 -0
- package/dist/composables/_useFollowAnchor.d.ts +15 -0
- package/dist/composables/cron.d.ts +29 -0
- package/dist/composables/dashboardLayout.d.ts +28 -0
- package/dist/composables/filterBuilder.d.ts +55 -0
- package/dist/composables/mapAdapters.d.ts +6 -1
- package/dist/composables/mapSearch.d.ts +1 -0
- package/dist/composables/textDiff.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +108 -0
- package/dist/draw.js +3 -3
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/locales/index.js +749 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +9888 -6940
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +5 -0
- package/dist/map.js +1462 -576
- package/dist/map.js.map +1 -1
- package/dist/media.js +5 -5
- package/dist/pdf.js +5 -5
- package/dist/rich-text-editor.js +5 -5
- package/dist/styles.css +1 -1
- package/dist/{useLocale-COav9m8C.js → useLocale-DaVSTdm0.js} +108 -1
- package/dist/useLocale-DaVSTdm0.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAddressField.test.ts +149 -0
- package/src/__tests__/MAudioRecorder.test.ts +125 -0
- package/src/__tests__/MCameraCapture.test.ts +154 -0
- package/src/__tests__/MCountrySelect.test.ts +67 -0
- package/src/__tests__/MCronField.test.ts +100 -0
- package/src/__tests__/MDashboardGrid.test.ts +122 -0
- package/src/__tests__/MDiffViewer.test.ts +68 -0
- package/src/__tests__/MExpansionPanel.test.ts +107 -0
- package/src/__tests__/MFilterBuilder.test.ts +130 -0
- package/src/__tests__/MMapCluster.test.ts +127 -0
- package/src/__tests__/MMapDraw.test.ts +188 -0
- package/src/__tests__/MMapLayers.test.ts +56 -0
- package/src/__tests__/MMentionField.test.ts +163 -0
- package/src/__tests__/MNotificationCenter.test.ts +94 -0
- package/src/__tests__/_fakeMaplibre.ts +14 -3
- package/src/__tests__/attrsFallthrough.test.ts +4 -0
- package/src/__tests__/cron.test.ts +68 -0
- package/src/__tests__/dashboardLayout.test.ts +45 -0
- package/src/__tests__/filterBuilder.test.ts +91 -0
- package/src/__tests__/followAnchor.test.ts +162 -0
- package/src/__tests__/ssr.test.ts +3 -0
- package/src/__tests__/textDiff.test.ts +37 -0
- package/src/components/MAddressField.vue +301 -0
- package/src/components/MAudioRecorder.vue +334 -0
- package/src/components/MAutocomplete.vue +3 -7
- package/src/components/MCameraCapture.vue +156 -0
- package/src/components/MCollapse.vue +91 -0
- package/src/components/MColorPicker.vue +4 -8
- package/src/components/MCountrySelect.vue +89 -0
- package/src/components/MCronField.vue +251 -0
- package/src/components/MDashboardGrid.vue +382 -0
- package/src/components/MDatePicker.vue +10 -7
- package/src/components/MDateRangePicker.vue +10 -7
- package/src/components/MDiffViewer.vue +234 -0
- package/src/components/MExpansionPanel.vue +56 -48
- package/src/components/MFilterBuilder.vue +47 -0
- package/src/components/MMapCluster.vue +295 -0
- package/src/components/MMapDraw.vue +601 -0
- package/src/components/MMapSearch.vue +1 -9
- package/src/components/MMentionField.vue +373 -0
- package/src/components/MMultiAutocomplete.vue +3 -7
- package/src/components/MMultiSelect.vue +3 -7
- package/src/components/MNotificationCenter.vue +252 -0
- package/src/components/MPhoneInput.vue +3 -10
- package/src/components/MQRScanner.vue +177 -0
- package/src/components/MSelect.vue +3 -7
- package/src/components/MTimePicker.vue +10 -7
- package/src/components/MTimezoneSelect.vue +116 -0
- package/src/components/_MFilterGroup.vue +210 -0
- package/src/composables/_caretPosition.ts +44 -0
- package/src/composables/_useCamera.ts +66 -0
- package/src/composables/_useFollowAnchor.ts +109 -0
- package/src/composables/cron.ts +179 -0
- package/src/composables/dashboardLayout.ts +94 -0
- package/src/composables/filterBuilder.ts +195 -0
- package/src/composables/mapAdapters.ts +29 -15
- package/src/composables/mapSearch.ts +10 -0
- package/src/composables/textDiff.ts +106 -0
- package/src/composables/useLocale.ts +215 -0
- package/src/index.ts +25 -0
- package/src/locales/de.ts +107 -0
- package/src/locales/es.ts +107 -0
- package/src/locales/fr.ts +107 -0
- package/src/locales/ja.ts +107 -0
- package/src/locales/ko.ts +107 -0
- package/src/locales/pt.ts +107 -0
- package/src/locales/zh.ts +107 -0
- package/src/map.ts +5 -0
- package/dist/MListItem-DVi1j1QI.js.map +0 -1
- package/dist/MMenuItem-CRNZkVVr.js.map +0 -1
- package/dist/_useEscapeStack-C5-BYr8y.js.map +0 -1
- package/dist/useLocale-COav9m8C.js.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { a as e, f as t, i as n, l as r, s as i, u as a } from "./MIconButton-BBggVwBV.js";
|
|
2
2
|
import { i as o } from "./motion-BcejVTeX.js";
|
|
3
3
|
import { t as s } from "./MIcon-DpajuUTJ.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Fragment as
|
|
4
|
+
import { n as c, r as l, t as u } from "./_popupPosition-nL8SVKPK.js";
|
|
5
|
+
import { Fragment as d, Teleport as f, Transition as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createVNode as y, defineComponent as b, inject as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeStyle as T, onMounted as ee, onUnmounted as te, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as ne, toDisplayString as j, unref as M, useSlots as re, watch as ie, withCtx as ae } from "vue";
|
|
6
6
|
// src/components/MMenuDivider.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var N = { class: "my-1 border-outline-variant" }, oe = /* @__PURE__ */ b({
|
|
8
8
|
__name: "MMenuDivider",
|
|
9
9
|
props: { gap: {
|
|
10
10
|
type: Boolean,
|
|
11
11
|
default: !1
|
|
12
12
|
} },
|
|
13
13
|
setup(e) {
|
|
14
|
-
return (e, t) => (
|
|
14
|
+
return (e, t) => (E(), _("hr", N));
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
17
|
-
function
|
|
18
|
-
let n =
|
|
16
|
+
}), se = 30, P = 380, ce = 8, F = 1 / 3, le = .5;
|
|
17
|
+
function I(e) {
|
|
18
|
+
let n = O([]), i = m(() => n.value[n.value.length - 1]), s = O("forward"), c = O(), l = 0, u = 1;
|
|
19
19
|
function d(e, t) {
|
|
20
20
|
let n = s.value === "forward" ? 1 : -1, r = e.animate([{
|
|
21
|
-
transform: `translateX(${n *
|
|
21
|
+
transform: `translateX(${n * se}px)`,
|
|
22
22
|
opacity: 0
|
|
23
23
|
}, {
|
|
24
24
|
transform: "translateX(0)",
|
|
@@ -31,7 +31,7 @@ function le(e) {
|
|
|
31
31
|
});
|
|
32
32
|
r.onfinish = t;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function f(e, t) {
|
|
35
35
|
let n = s.value === "forward" ? -1 : 1, r = e;
|
|
36
36
|
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
37
37
|
let i = l, a = u;
|
|
@@ -40,7 +40,7 @@ function le(e) {
|
|
|
40
40
|
transform: `translateX(${i}px)`,
|
|
41
41
|
opacity: a
|
|
42
42
|
}, {
|
|
43
|
-
transform: `translateX(${i + n *
|
|
43
|
+
transform: `translateX(${i + n * se}px)`,
|
|
44
44
|
opacity: 0
|
|
45
45
|
}], {
|
|
46
46
|
duration: 90,
|
|
@@ -49,34 +49,34 @@ function le(e) {
|
|
|
49
49
|
});
|
|
50
50
|
o.onfinish = t;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function p(e) {
|
|
53
53
|
let n = c.value, i = n?.offsetHeight ?? 0, s = n?.style.overflowY ?? "";
|
|
54
54
|
n && (n.style.overflowY = "hidden");
|
|
55
55
|
let l = () => {
|
|
56
56
|
n && (n.style.overflowY = s);
|
|
57
57
|
};
|
|
58
58
|
if (e(), !n || a()) return l();
|
|
59
|
-
|
|
60
|
-
let e = n.offsetHeight, a = Math.abs(e - i) < 1 ? null : r(n, t(i, e, 0, o.standard.defaultSpatial, .5), (e) => ({ height: `${e}px` })), s = new Promise((e) => setTimeout(e,
|
|
59
|
+
C(() => {
|
|
60
|
+
let e = n.offsetHeight, a = Math.abs(e - i) < 1 ? null : r(n, t(i, e, 0, o.standard.defaultSpatial, .5), (e) => ({ height: `${e}px` })), s = new Promise((e) => setTimeout(e, P));
|
|
61
61
|
Promise.all([s, a?.finished.catch(() => {})]).then(l);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function h(t) {
|
|
65
|
-
s.value = "forward",
|
|
65
|
+
s.value = "forward", p(() => n.value.push(t)), C(e);
|
|
66
66
|
}
|
|
67
67
|
function g() {
|
|
68
|
-
s.value = "backward",
|
|
68
|
+
s.value = "backward", p(() => n.value.pop()), C(e);
|
|
69
69
|
}
|
|
70
70
|
function _() {
|
|
71
71
|
n.value = [];
|
|
72
72
|
}
|
|
73
73
|
let v = null;
|
|
74
|
-
function
|
|
74
|
+
function y() {
|
|
75
75
|
return c.value?.querySelector(`:scope > [data-menu-level="${n.value.length}"]`) ?? null;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function b(e) {
|
|
78
78
|
if (e.pointerType !== "touch" || !n.value.length || v) return;
|
|
79
|
-
let t =
|
|
79
|
+
let t = y();
|
|
80
80
|
t && (v = {
|
|
81
81
|
id: e.pointerId,
|
|
82
82
|
x: e.clientX,
|
|
@@ -87,7 +87,7 @@ function le(e) {
|
|
|
87
87
|
lastX: e.clientX,
|
|
88
88
|
lastT: e.timeStamp,
|
|
89
89
|
vel: 0
|
|
90
|
-
}, window.addEventListener("pointermove", S), window.addEventListener("pointerup",
|
|
90
|
+
}, window.addEventListener("pointermove", S), window.addEventListener("pointerup", w), window.addEventListener("pointercancel", T));
|
|
91
91
|
}
|
|
92
92
|
function x(e) {
|
|
93
93
|
v && (v.level.style.transform = `translateX(${e}px)`, v.level.style.opacity = String(1 - .5 * Math.min(1, e / v.width)));
|
|
@@ -96,30 +96,30 @@ function le(e) {
|
|
|
96
96
|
if (!v || e.pointerId !== v.id) return;
|
|
97
97
|
let t = e.clientX - v.x, n = e.clientY - v.y;
|
|
98
98
|
if (!v.active) {
|
|
99
|
-
if (Math.hypot(t, n) <
|
|
100
|
-
if (Math.abs(n) > Math.abs(t) || t < 0) return
|
|
99
|
+
if (Math.hypot(t, n) < ce) return;
|
|
100
|
+
if (Math.abs(n) > Math.abs(t) || t < 0) return A();
|
|
101
101
|
v.active = !0, v.x = e.clientX, v.level.getAnimations().forEach((e) => e.finish());
|
|
102
102
|
}
|
|
103
103
|
let r = e.timeStamp - v.lastT;
|
|
104
104
|
r > 0 && (v.vel = .8 * ((e.clientX - v.lastX) / r) + .2 * v.vel), v.lastX = e.clientX, v.lastT = e.timeStamp, x(Math.max(0, e.clientX - v.x));
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function w(e) {
|
|
107
107
|
if (!v || e.pointerId !== v.id) return;
|
|
108
108
|
let t = v;
|
|
109
|
-
if (
|
|
110
|
-
window.addEventListener("click",
|
|
109
|
+
if (A(), !t.active) return;
|
|
110
|
+
window.addEventListener("click", k, {
|
|
111
111
|
capture: !0,
|
|
112
112
|
once: !0
|
|
113
113
|
}), clearTimeout(E), E = setTimeout(D, 400);
|
|
114
114
|
let n = Math.max(0, e.clientX - t.x);
|
|
115
|
-
n > t.width *
|
|
115
|
+
n > t.width * F || t.vel > le ? (l = n, u = Number(t.level.style.opacity || 1), g()) : ee(t.level, n);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function T(e) {
|
|
118
118
|
if (!v || e.pointerId !== v.id) return;
|
|
119
119
|
let t = v;
|
|
120
|
-
|
|
120
|
+
A(), t.active && ee(t.level, Math.max(0, t.lastX - t.x));
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function ee(e, n) {
|
|
123
123
|
if (e.style.transform = "", e.style.opacity = "", a() || n < 1) return;
|
|
124
124
|
let i = c.value?.clientWidth || 1;
|
|
125
125
|
r(e, t(n, 0, 0, o.standard.defaultSpatial, .5), (e) => ({
|
|
@@ -129,51 +129,33 @@ function le(e) {
|
|
|
129
129
|
}
|
|
130
130
|
let E;
|
|
131
131
|
function D() {
|
|
132
|
-
clearTimeout(E), window.removeEventListener("click",
|
|
132
|
+
clearTimeout(E), window.removeEventListener("click", k, { capture: !0 });
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function k(e) {
|
|
135
135
|
e.stopPropagation(), e.preventDefault();
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
v = null, window.removeEventListener("pointermove", S), window.removeEventListener("pointerup",
|
|
137
|
+
function A() {
|
|
138
|
+
v = null, window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", w), window.removeEventListener("pointercancel", T);
|
|
139
139
|
}
|
|
140
|
-
return
|
|
141
|
-
|
|
140
|
+
return te(() => {
|
|
141
|
+
A(), D();
|
|
142
142
|
}), {
|
|
143
143
|
navStack: n,
|
|
144
144
|
currentNav: i,
|
|
145
145
|
navBox: c,
|
|
146
146
|
navSlideEnter: d,
|
|
147
|
-
navSlideLeave:
|
|
147
|
+
navSlideLeave: f,
|
|
148
148
|
pushNav: h,
|
|
149
149
|
popNav: g,
|
|
150
150
|
resetNav: _,
|
|
151
|
-
onNavPointerDown:
|
|
151
|
+
onNavPointerDown: b
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function F(e, t, n, r = 8) {
|
|
155
|
-
for (let i of e) if (i >= r && i + t <= n - r) return i;
|
|
156
|
-
if (t >= n - 2 * r) return (n - t) / 2;
|
|
157
|
-
let i = e[e.length - 1] ?? r;
|
|
158
|
-
return Math.min(n - r - t, Math.max(r, i));
|
|
159
|
-
}
|
|
160
|
-
function I(e, t, n, r, i = 8) {
|
|
161
|
-
let a = e.left, o = e.right - t, s = (e.left + e.right) / 2 < n / 2 ? i : n - i - t;
|
|
162
|
-
return F(r === "start" ? [
|
|
163
|
-
a,
|
|
164
|
-
o,
|
|
165
|
-
s
|
|
166
|
-
] : [
|
|
167
|
-
o,
|
|
168
|
-
a,
|
|
169
|
-
s
|
|
170
|
-
], t, n, i);
|
|
171
|
-
}
|
|
172
154
|
// src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
|
|
173
155
|
var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root" }, B = {
|
|
174
156
|
key: 0,
|
|
175
157
|
class: "flex flex-col gap-1 px-1.5"
|
|
176
|
-
}, V = { class: "overflow-hidden rounded-lg bg-surface-container" }, H = 1 / 240, U = /* @__PURE__ */
|
|
158
|
+
}, V = { class: "overflow-hidden rounded-lg bg-surface-container" }, H = 1 / 240, U = /* @__PURE__ */ b({
|
|
177
159
|
inheritAttrs: !1,
|
|
178
160
|
__name: "MMenu",
|
|
179
161
|
props: {
|
|
@@ -185,20 +167,20 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
185
167
|
let n = e, r = re();
|
|
186
168
|
function i(e) {
|
|
187
169
|
let t = [];
|
|
188
|
-
for (let n of e) n.type ===
|
|
170
|
+
for (let n of e) n.type === d && Array.isArray(n.children) ? t.push(...i(n.children)) : t.push(n);
|
|
189
171
|
return t;
|
|
190
172
|
}
|
|
191
173
|
function a(e) {
|
|
192
|
-
if (e.type !==
|
|
174
|
+
if (e.type !== oe) return !1;
|
|
193
175
|
let t = e.props?.gap;
|
|
194
176
|
return t === "" || t === !0 || t === "true";
|
|
195
177
|
}
|
|
196
|
-
let o =
|
|
178
|
+
let o = m(() => {
|
|
197
179
|
if (n.variant !== "expressive") return null;
|
|
198
180
|
let e = i(r.default?.({ close: $ }) ?? []), t = [[]];
|
|
199
181
|
for (let n of e) a(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
200
182
|
return t.filter((e) => e.length > 0);
|
|
201
|
-
}),
|
|
183
|
+
}), c = m(() => !!o.value && o.value.length > 1), { navStack: b, currentNav: j, navBox: N, navSlideEnter: se, navSlideLeave: P, pushNav: ce, popNav: F, onNavPointerDown: le } = I(() => be()), U = null;
|
|
202
184
|
function ue() {
|
|
203
185
|
if (U) return U;
|
|
204
186
|
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
@@ -243,15 +225,15 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
243
225
|
function me(e, t) {
|
|
244
226
|
fe(e, t, !1);
|
|
245
227
|
}
|
|
246
|
-
let K =
|
|
247
|
-
|
|
228
|
+
let K = O(!1), q = O(null), J = O(null), Y = O({}), X = x("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
229
|
+
D("m-menu-panel-registry", X), ie(J, (e, t) => {
|
|
248
230
|
t && X.delete(t), e && X.add(e);
|
|
249
|
-
}),
|
|
231
|
+
}), te(() => {
|
|
250
232
|
J.value && X.delete(J.value);
|
|
251
233
|
});
|
|
252
|
-
let Z =
|
|
253
|
-
|
|
254
|
-
let Q = null, he =
|
|
234
|
+
let Z = x("m-menu-sibling-group", null);
|
|
235
|
+
D("m-menu-sibling-group", { current: null });
|
|
236
|
+
let Q = null, he = O(!1);
|
|
255
237
|
function ge() {
|
|
256
238
|
if (!q.value) return;
|
|
257
239
|
let e = q.value.getBoundingClientRect();
|
|
@@ -265,10 +247,10 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
265
247
|
};
|
|
266
248
|
he.value ? n.bottom = `${window.innerHeight - e.top + 4}px` : n.top = `${e.bottom + 4}px`, Y.value = n;
|
|
267
249
|
}
|
|
268
|
-
let _e =
|
|
250
|
+
let _e = O(n.align === "right" ? "right" : "left");
|
|
269
251
|
function ve(e) {
|
|
270
252
|
if (!Q) return;
|
|
271
|
-
let t = e.offsetWidth, r =
|
|
253
|
+
let t = e.offsetWidth, r = u(Q, t, window.innerWidth, n.align === "right" ? "end" : "start"), i = Math.min(t, Math.max(0, (Q.left + Q.right) / 2 - r)), a = Math.abs(r - Q.left) < 1 ? "left" : Math.abs(r + t - Q.right) < 1 ? "right" : `${i}px`;
|
|
272
254
|
_e.value = a, Y.value = {
|
|
273
255
|
...Y.value,
|
|
274
256
|
left: `${r}px`
|
|
@@ -278,7 +260,7 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
278
260
|
return J.value ? Array.from(J.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
279
261
|
}
|
|
280
262
|
function be() {
|
|
281
|
-
|
|
263
|
+
C(() => ye()[0]?.focus());
|
|
282
264
|
}
|
|
283
265
|
function xe(e) {
|
|
284
266
|
let t = ye();
|
|
@@ -287,12 +269,12 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
287
269
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
288
270
|
}
|
|
289
271
|
function Se() {
|
|
290
|
-
K.value ? Z?.current === $ && (Z.current = null) : (Z && Z.current && Z.current !== $ && Z.current(), Z && (Z.current = $), ge(),
|
|
272
|
+
K.value ? Z?.current === $ && (Z.current = null) : (Z && Z.current && Z.current !== $ && Z.current(), Z && (Z.current = $), ge(), b.value = []), K.value = !K.value, K.value && be();
|
|
291
273
|
}
|
|
292
274
|
function $() {
|
|
293
275
|
Z?.current === $ && (Z.current = null), K.value = !1;
|
|
294
276
|
}
|
|
295
|
-
|
|
277
|
+
D("m-menu-close", $), D("m-menu-nav", {
|
|
296
278
|
mode: n.submenuMode,
|
|
297
279
|
push: ce
|
|
298
280
|
}), t({
|
|
@@ -312,78 +294,78 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
312
294
|
for (let e of X) if (e.contains(t)) return;
|
|
313
295
|
t.closest?.(".m3-submenu") || $();
|
|
314
296
|
}
|
|
315
|
-
|
|
297
|
+
l(() => K.value, () => b.value.length ? F() : $());
|
|
316
298
|
function Te(e) {
|
|
317
299
|
K.value && (e.key === "ArrowDown" ? (e.preventDefault(), xe(1)) : e.key === "ArrowUp" && (e.preventDefault(), xe(-1)));
|
|
318
300
|
}
|
|
319
|
-
|
|
301
|
+
ee(() => {
|
|
320
302
|
document.addEventListener("mousedown", Ce), document.addEventListener("keydown", Te), window.addEventListener("scroll", we, !0);
|
|
321
|
-
}),
|
|
303
|
+
}), te(() => {
|
|
322
304
|
document.removeEventListener("mousedown", Ce), document.removeEventListener("keydown", Te), window.removeEventListener("scroll", we, !0), G ? G() : W?.();
|
|
323
305
|
});
|
|
324
|
-
let Ee =
|
|
325
|
-
return (t, n) => (
|
|
306
|
+
let Ee = m(() => `${_e.value} ${he.value ? "bottom" : "top"}`);
|
|
307
|
+
return (t, n) => (E(), _(d, null, [v("div", S({
|
|
326
308
|
ref_key: "triggerEl",
|
|
327
309
|
ref: q
|
|
328
310
|
}, t.$attrs, {
|
|
329
311
|
class: "inline-block",
|
|
330
312
|
onClick: Se
|
|
331
|
-
}), [
|
|
313
|
+
}), [A(t.$slots, "trigger", { open: K.value })], 16), (E(), h(f, { to: "body" }, [y(p, {
|
|
332
314
|
css: !1,
|
|
333
315
|
onEnter: pe,
|
|
334
316
|
onLeave: me
|
|
335
317
|
}, {
|
|
336
|
-
default: ae(() => [K.value ? (
|
|
318
|
+
default: ae(() => [K.value ? (E(), _("div", {
|
|
337
319
|
key: 0,
|
|
338
320
|
ref_key: "dropdownEl",
|
|
339
321
|
ref: J,
|
|
340
|
-
class:
|
|
341
|
-
style:
|
|
322
|
+
class: w(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "shadow-elevation-2"]]),
|
|
323
|
+
style: T({
|
|
342
324
|
...Y.value,
|
|
343
325
|
transformOrigin: Ee.value
|
|
344
326
|
})
|
|
345
|
-
}, [
|
|
327
|
+
}, [v("div", { class: w(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "bg-surface-container"]]) }, [v("div", {
|
|
346
328
|
ref_key: "navBox",
|
|
347
|
-
ref:
|
|
329
|
+
ref: N,
|
|
348
330
|
class: "relative overflow-x-hidden overflow-y-auto overscroll-contain py-1",
|
|
349
|
-
style:
|
|
331
|
+
style: T({
|
|
350
332
|
maxHeight: Y.value.maxHeight,
|
|
351
|
-
touchAction:
|
|
333
|
+
touchAction: M(j) ? "pan-y" : void 0
|
|
352
334
|
}),
|
|
353
|
-
onPointerdown: n[1] ||= (...e) =>
|
|
354
|
-
}, [
|
|
335
|
+
onPointerdown: n[1] ||= (...e) => M(le) && M(le)(...e)
|
|
336
|
+
}, [y(p, {
|
|
355
337
|
css: !1,
|
|
356
|
-
onEnter:
|
|
357
|
-
onLeave:
|
|
338
|
+
onEnter: M(se),
|
|
339
|
+
onLeave: M(P)
|
|
358
340
|
}, {
|
|
359
|
-
default: ae(() => [
|
|
360
|
-
key:
|
|
361
|
-
"data-menu-level":
|
|
341
|
+
default: ae(() => [M(j) ? (E(), _("div", {
|
|
342
|
+
key: M(b).length,
|
|
343
|
+
"data-menu-level": M(b).length
|
|
362
344
|
}, [
|
|
363
|
-
|
|
345
|
+
v("button", {
|
|
364
346
|
type: "button",
|
|
365
347
|
class: "flex w-full items-center gap-3 px-4 py-2.5 text-left text-label-large text-on-surface-variant outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
366
|
-
onClick: n[0] ||= (...e) =>
|
|
367
|
-
}, [
|
|
348
|
+
onClick: n[0] ||= (...e) => M(F) && M(F)(...e)
|
|
349
|
+
}, [y(s, {
|
|
368
350
|
name: "arrow_back",
|
|
369
351
|
size: 20,
|
|
370
352
|
class: "shrink-0"
|
|
371
|
-
}),
|
|
372
|
-
n[2] ||=
|
|
373
|
-
(
|
|
374
|
-
], 8, L)) : (
|
|
353
|
+
}), v("span", R, [(E(), h(ne(() => M(j)?.header?.())))])]),
|
|
354
|
+
n[2] ||= v("hr", { class: "my-1 border-outline-variant" }, null, -1),
|
|
355
|
+
(E(), h(ne(() => M(j)?.content?.())))
|
|
356
|
+
], 8, L)) : (E(), _("div", z, [c.value ? (E(), _("div", B, [(E(!0), _(d, null, k(o.value, (e, t) => (E(), _("div", {
|
|
375
357
|
key: t,
|
|
376
358
|
class: "rounded-lg shadow-elevation-2"
|
|
377
|
-
}, [
|
|
359
|
+
}, [v("div", V, [(E(), h(ne(() => e)))])]))), 128))])) : A(t.$slots, "default", { close: $ }, void 0, void 0, 1)]))]),
|
|
378
360
|
_: 3
|
|
379
|
-
}, 8, ["onEnter", "onLeave"])], 36)], 2)], 6)) :
|
|
361
|
+
}, 8, ["onEnter", "onLeave"])], 36)], 2)], 6)) : g("", !0)]),
|
|
380
362
|
_: 3
|
|
381
363
|
})]))], 64));
|
|
382
364
|
}
|
|
383
365
|
}), ue = ["data-m3-menu-choice"], de = { class: "flex-1" }, W = {
|
|
384
366
|
key: 3,
|
|
385
367
|
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
386
|
-
}, G = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, fe = 32, pe = /* @__PURE__ */
|
|
368
|
+
}, G = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, fe = 32, pe = /* @__PURE__ */ b({
|
|
387
369
|
__name: "MMenuItem",
|
|
388
370
|
props: {
|
|
389
371
|
icon: {},
|
|
@@ -413,21 +395,21 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
413
395
|
},
|
|
414
396
|
emits: ["click", "update:checked"],
|
|
415
397
|
setup(t, { emit: r }) {
|
|
416
|
-
let a = t, o = r,
|
|
417
|
-
function
|
|
398
|
+
let a = t, o = r, l = re(), u = m(() => a.checked !== void 0), d = m(() => u.value || a.selected !== void 0), b = m(() => !!(a.checked ?? a.selected)), S = m(() => d.value && !a.icon && !l.icon), D = m(() => a.selectedIcon ?? (a.icon ? void 0 : "check")), k = O("single");
|
|
399
|
+
function N() {
|
|
418
400
|
let e = L.value;
|
|
419
|
-
if (!e || !
|
|
401
|
+
if (!e || !d.value) return;
|
|
420
402
|
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
421
|
-
|
|
403
|
+
k.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
422
404
|
}
|
|
423
405
|
function oe() {
|
|
424
|
-
if (
|
|
406
|
+
if (b.value) return [
|
|
425
407
|
12,
|
|
426
408
|
12,
|
|
427
409
|
12,
|
|
428
410
|
12
|
|
429
411
|
];
|
|
430
|
-
let e =
|
|
412
|
+
let e = k.value === "first" ? 12 : 4, t = k.value === "last" ? 12 : 4;
|
|
431
413
|
return [
|
|
432
414
|
e,
|
|
433
415
|
e,
|
|
@@ -435,20 +417,20 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
435
417
|
t
|
|
436
418
|
];
|
|
437
419
|
}
|
|
438
|
-
let { snap: se } = i(() =>
|
|
420
|
+
let { snap: se } = i(() => d.value ? [...oe(), S.value && b.value ? fe : 0] : [], ([e, t, n, r, i]) => {
|
|
439
421
|
let a = R.value instanceof HTMLElement ? R.value : R.value?.$el;
|
|
440
422
|
a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), z.value && i !== void 0 && (z.value.style.width = `${i}px`);
|
|
441
423
|
}, e);
|
|
442
|
-
ie(
|
|
443
|
-
let
|
|
444
|
-
|
|
445
|
-
|
|
424
|
+
ie(k, () => se());
|
|
425
|
+
let P = null;
|
|
426
|
+
ee(() => {
|
|
427
|
+
N();
|
|
446
428
|
let e = L.value?.parentElement;
|
|
447
|
-
e && (
|
|
448
|
-
}),
|
|
429
|
+
e && (P = new MutationObserver(N), P.observe(e, { childList: !0 }));
|
|
430
|
+
}), te(() => P?.disconnect()), ie(d, () => C(N)), i(() => S.value ? [+!!b.value] : [], ([e]) => {
|
|
449
431
|
z.value && e !== void 0 && (z.value.style.opacity = String(e));
|
|
450
432
|
}, n);
|
|
451
|
-
let ce =
|
|
433
|
+
let ce = m(() => a.to ? "RouterLink" : "button"), F = m(() => !!l.children), le = x("m-menu-close", null), I = x("m-menu-nav", null), L = O(), R = O(), z = O(), B = O(!1), V = O({});
|
|
452
434
|
function H() {
|
|
453
435
|
if (!L.value) return;
|
|
454
436
|
let e = L.value.getBoundingClientRect();
|
|
@@ -464,7 +446,7 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
464
446
|
if (!L.value) return;
|
|
465
447
|
let t = e, n = L.value.getBoundingClientRect();
|
|
466
448
|
t.style.left = "0px";
|
|
467
|
-
let r = t.offsetWidth, i = t.offsetHeight, a =
|
|
449
|
+
let r = t.offsetWidth, i = t.offsetHeight, a = c([n.right, n.left - r], r, window.innerWidth), o = c([n.top, n.bottom - i], i, window.innerHeight);
|
|
468
450
|
V.value = {
|
|
469
451
|
...V.value,
|
|
470
452
|
left: `${a}px`,
|
|
@@ -475,14 +457,14 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
475
457
|
B.value ? B.value = !1 : (H(), B.value = !0);
|
|
476
458
|
}
|
|
477
459
|
function me() {
|
|
478
|
-
a.disabled || (
|
|
460
|
+
a.disabled || (F.value ? I?.mode === "push" ? I.push({
|
|
479
461
|
icon: a.icon,
|
|
480
|
-
header:
|
|
481
|
-
content:
|
|
482
|
-
}) : pe() : (
|
|
462
|
+
header: l.default,
|
|
463
|
+
content: l.children
|
|
464
|
+
}) : pe() : (u.value && o("update:checked", !a.checked), o("click"), (a.keepOpen ?? u.value) || le?.()));
|
|
483
465
|
}
|
|
484
466
|
function K(e) {
|
|
485
|
-
e.pointerType === "mouse" &&
|
|
467
|
+
e.pointerType === "mouse" && F.value && !a.disabled && (H(), B.value = !0);
|
|
486
468
|
}
|
|
487
469
|
function q(e) {
|
|
488
470
|
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (B.value = !1));
|
|
@@ -492,22 +474,22 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
492
474
|
let t = e.relatedTarget;
|
|
493
475
|
t?.closest(".m3-submenu") || L.value?.contains(t) || (B.value = !1);
|
|
494
476
|
}
|
|
495
|
-
return (e, n) => (
|
|
477
|
+
return (e, n) => (E(), _("div", {
|
|
496
478
|
ref_key: "itemEl",
|
|
497
479
|
ref: L,
|
|
498
|
-
"data-m3-menu-choice":
|
|
480
|
+
"data-m3-menu-choice": d.value || void 0,
|
|
499
481
|
onPointerenter: K,
|
|
500
482
|
onPointerleave: q
|
|
501
|
-
}, [(
|
|
483
|
+
}, [(E(), h(ne(ce.value), {
|
|
502
484
|
ref_key: "controlEl",
|
|
503
485
|
ref: R,
|
|
504
486
|
to: t.to || void 0,
|
|
505
487
|
type: t.to ? void 0 : "button",
|
|
506
|
-
role:
|
|
507
|
-
"aria-checked":
|
|
508
|
-
class:
|
|
488
|
+
role: d.value ? u.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
|
|
489
|
+
"aria-checked": d.value ? b.value : void 0,
|
|
490
|
+
class: w(["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", d.value ? [
|
|
509
491
|
"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",
|
|
510
|
-
|
|
492
|
+
b.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
|
|
511
493
|
t.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
|
|
512
494
|
] : [
|
|
513
495
|
"w-full px-4",
|
|
@@ -516,12 +498,12 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
516
498
|
!t.disabled && !t.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
517
499
|
]]),
|
|
518
500
|
disabled: t.disabled || void 0,
|
|
519
|
-
"aria-haspopup":
|
|
520
|
-
"aria-expanded":
|
|
501
|
+
"aria-haspopup": F.value ? "menu" : void 0,
|
|
502
|
+
"aria-expanded": F.value ? B.value : void 0,
|
|
521
503
|
onClick: me
|
|
522
504
|
}, {
|
|
523
505
|
default: ae(() => [
|
|
524
|
-
|
|
506
|
+
S.value ? (E(), _("span", {
|
|
525
507
|
key: 0,
|
|
526
508
|
ref_key: "iconSlotEl",
|
|
527
509
|
ref: z,
|
|
@@ -530,32 +512,32 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
530
512
|
width: "0",
|
|
531
513
|
opacity: "0"
|
|
532
514
|
}
|
|
533
|
-
}, [
|
|
534
|
-
name:
|
|
515
|
+
}, [y(s, {
|
|
516
|
+
name: D.value,
|
|
535
517
|
size: 20,
|
|
536
518
|
class: "shrink-0"
|
|
537
|
-
}, null, 8, ["name"])], 512)) : e.$slots.icon ? (
|
|
519
|
+
}, null, 8, ["name"])], 512)) : e.$slots.icon ? (E(), _("span", {
|
|
538
520
|
key: 1,
|
|
539
|
-
class:
|
|
540
|
-
}, [
|
|
521
|
+
class: w(["flex size-5 shrink-0 items-center justify-center", d.value ? b.value ? "" : "text-on-surface-variant" : t.danger ? "text-error" : "text-on-surface-variant"])
|
|
522
|
+
}, [A(e.$slots, "icon", { on: b.value })], 2)) : t.icon ? (E(), h(s, {
|
|
541
523
|
key: 2,
|
|
542
|
-
name:
|
|
543
|
-
filled:
|
|
524
|
+
name: b.value && D.value ? D.value : t.icon,
|
|
525
|
+
filled: b.value && !D.value,
|
|
544
526
|
size: 20,
|
|
545
|
-
class:
|
|
527
|
+
class: w(["shrink-0", d.value ? b.value ? "" : "text-on-surface-variant" : t.danger ? "text-error" : "text-on-surface-variant"])
|
|
546
528
|
}, null, 8, [
|
|
547
529
|
"name",
|
|
548
530
|
"filled",
|
|
549
531
|
"class"
|
|
550
|
-
])) :
|
|
551
|
-
|
|
552
|
-
t.shortcut && !
|
|
553
|
-
|
|
532
|
+
])) : g("", !0),
|
|
533
|
+
v("span", de, [A(e.$slots, "default")]),
|
|
534
|
+
t.shortcut && !F.value ? (E(), _("span", W, j(t.shortcut), 1)) : g("", !0),
|
|
535
|
+
F.value ? (E(), h(s, {
|
|
554
536
|
key: 4,
|
|
555
537
|
name: "chevron_right",
|
|
556
538
|
size: 18,
|
|
557
539
|
class: "shrink-0 text-on-surface-variant"
|
|
558
|
-
})) :
|
|
540
|
+
})) : g("", !0)
|
|
559
541
|
]),
|
|
560
542
|
_: 3
|
|
561
543
|
}, 8, [
|
|
@@ -567,26 +549,26 @@ var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root"
|
|
|
567
549
|
"disabled",
|
|
568
550
|
"aria-haspopup",
|
|
569
551
|
"aria-expanded"
|
|
570
|
-
])),
|
|
552
|
+
])), F.value && M(I)?.mode !== "push" ? (E(), h(f, {
|
|
571
553
|
key: 0,
|
|
572
554
|
to: "body"
|
|
573
|
-
}, [
|
|
555
|
+
}, [y(p, {
|
|
574
556
|
"enter-active-class": "transition-opacity duration-100",
|
|
575
557
|
"enter-from-class": "opacity-0",
|
|
576
558
|
"leave-active-class": "transition-opacity duration-75",
|
|
577
559
|
"leave-to-class": "opacity-0",
|
|
578
560
|
onEnter: U
|
|
579
561
|
}, {
|
|
580
|
-
default: ae(() => [B.value ? (
|
|
562
|
+
default: ae(() => [B.value ? (E(), _("div", {
|
|
581
563
|
key: 0,
|
|
582
564
|
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
583
|
-
style:
|
|
565
|
+
style: T(V.value),
|
|
584
566
|
onPointerleave: J
|
|
585
|
-
}, [
|
|
567
|
+
}, [v("div", G, [A(e.$slots, "children")])], 36)) : g("", !0)]),
|
|
586
568
|
_: 3
|
|
587
|
-
})])) :
|
|
569
|
+
})])) : g("", !0)], 40, ue));
|
|
588
570
|
}
|
|
589
571
|
});
|
|
590
|
-
export {
|
|
572
|
+
export { oe as i, U as n, I as r, pe as t };
|
|
591
573
|
|
|
592
|
-
//# sourceMappingURL=MMenuItem-
|
|
574
|
+
//# sourceMappingURL=MMenuItem-BuxYoASE.js.map
|