@m3ui-vue/m3ui-vue 1.10.2 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/dist/API.md +195 -56
- package/dist/MButton-gWoOzFWf.js +284 -0
- package/dist/MButton-gWoOzFWf.js.map +1 -0
- package/dist/MColorPickerModal-CJYMvlgK.js +466 -0
- package/dist/MColorPickerModal-CJYMvlgK.js.map +1 -0
- package/dist/MDialog-CU8EYgCC.js +226 -0
- package/dist/MDialog-CU8EYgCC.js.map +1 -0
- package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
- package/dist/MIcon-CkUc9kuQ.js.map +1 -0
- package/dist/MIconButton-DTFOfsTy.js +317 -0
- package/dist/MIconButton-DTFOfsTy.js.map +1 -0
- package/dist/MListItem-Cdw2FqCT.js +1306 -0
- package/dist/MListItem-Cdw2FqCT.js.map +1 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js +115 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js.map +1 -0
- package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
- package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
- package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-CEfyXGq2.js} +674 -671
- package/dist/MPdfViewer-CEfyXGq2.js.map +1 -0
- package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
- package/dist/MSeekBar-B3_D-PwH.js +435 -0
- package/dist/MSeekBar-B3_D-PwH.js.map +1 -0
- package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-Dg07j-4r.js} +4 -4
- package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-Dg07j-4r.js.map} +1 -1
- package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-3nddtLKI.js} +2 -2
- package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-3nddtLKI.js.map} +1 -1
- package/dist/{MSlider-7TzhFHKS.js → MSlider-BrpLbqwt.js} +4 -4
- package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BrpLbqwt.js.map} +1 -1
- package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CLwzDH33.js} +2 -2
- package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CLwzDH33.js.map} +1 -1
- package/dist/{MTextField-B6_iOczK.js → MTextField-CZRizAwA.js} +136 -134
- package/dist/MTextField-CZRizAwA.js.map +1 -0
- package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-DVcqyy9g.js} +2 -2
- package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-DVcqyy9g.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAlert.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +3 -3
- package/dist/components/MAvatar.vue.d.ts +19 -1
- package/dist/components/MButton.vue.d.ts +2 -1
- package/dist/components/MChatBubble.vue.d.ts +2 -0
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MDataTable.vue.d.ts +31 -3
- package/dist/components/MFlow.vue.d.ts +1 -1
- package/dist/components/MHotkeys.vue.d.ts +1 -0
- package/dist/components/MIcon.vue.d.ts +6 -0
- package/dist/components/MIconButton.vue.d.ts +5 -0
- package/dist/components/MKanban.vue.d.ts +1 -1
- package/dist/components/MLink.vue.d.ts +59 -0
- package/dist/components/MListItem.vue.d.ts +3 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MPagination.vue.d.ts +14 -1
- package/dist/components/MPdfSigner.vue.d.ts +2 -2
- package/dist/components/MRadio.vue.d.ts +2 -0
- package/dist/components/MRadioGroup.vue.d.ts +2 -0
- package/dist/components/MStatCard.vue.d.ts +2 -2
- package/dist/components/MSwitch.vue.d.ts +2 -0
- package/dist/components/MText.vue.d.ts +4 -2
- package/dist/components/MTextField.vue.d.ts +2 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
- package/dist/composables/_menuGroups.d.ts +10 -1
- package/dist/composables/_splitAttrs.d.ts +6 -0
- package/dist/composables/_springAnimation.d.ts +2 -2
- package/dist/composables/_useFocusTrap.d.ts +15 -0
- package/dist/composables/_usePaneResize.d.ts +1 -1
- package/dist/composables/_useSpring.d.ts +4 -4
- package/dist/composables/dynamicColor.d.ts +9 -1
- package/dist/composables/motion.d.ts +63 -0
- package/dist/composables/useConfirm.d.ts +28 -0
- package/dist/composables/useDevice.d.ts +8 -1
- package/dist/composables/useLocale.d.ts +14 -0
- package/dist/composables/useScrollReveal.d.ts +1 -1
- package/dist/composables/useTheme.d.ts +1 -0
- package/dist/composables/useToast.d.ts +7 -0
- package/dist/draw.js +556 -556
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +854 -851
- package/dist/flow.js.map +1 -1
- package/dist/gantt.js +1118 -1096
- package/dist/gantt.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +833 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/pl.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10327 -9796
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +860 -860
- package/dist/map.js.map +1 -1
- package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
- package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
- package/dist/media.js +7 -7
- package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
- package/dist/motion-BqYcqcim.js.map +1 -0
- package/dist/pdf-sign.js +140 -137
- package/dist/pdf-sign.js.map +1 -1
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +11 -0
- package/dist/rich-text-editor.js +7 -7
- package/dist/styles/theme.css +40 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-YRaOT12S.js → useLocale-BjcYauXr.js} +60 -4
- package/dist/useLocale-BjcYauXr.js.map +1 -0
- package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
- package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
- package/package.json +17 -2
- package/src/__tests__/MAvatarImage.test.ts +37 -0
- package/src/__tests__/MDataTableControlled.test.ts +68 -0
- package/src/__tests__/MHotkeysSequence.test.ts +53 -0
- package/src/__tests__/MIconAxes.test.ts +16 -0
- package/src/__tests__/MIconButtonWidth.test.ts +22 -0
- package/src/__tests__/MLink.test.ts +46 -0
- package/src/__tests__/MPaginationPages.test.ts +43 -0
- package/src/__tests__/MTextEmphasized.test.ts +14 -0
- package/src/__tests__/controlDescription.test.ts +34 -0
- package/src/__tests__/customColor.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +3 -2
- package/src/__tests__/focusTrap.test.ts +124 -0
- package/src/__tests__/formatMessage.test.ts +20 -0
- package/src/__tests__/inputAttrs.test.ts +103 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/menuGroupsRemount.test.ts +40 -0
- package/src/__tests__/menuHydration.test.ts +41 -0
- package/src/__tests__/motionPrefs.test.ts +28 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/__tests__/ssrToast.test.ts +20 -0
- package/src/__tests__/toastDetails.test.ts +39 -0
- package/src/__tests__/useConfirm.test.ts +47 -0
- package/src/__tests__/useTheme.test.ts +14 -0
- package/src/__tests__/warningRole.test.ts +22 -0
- package/src/components/MAlert.vue +2 -2
- package/src/components/MAnimatedNumber.vue +9 -3
- package/src/components/MAutocomplete.vue +16 -4
- package/src/components/MAvailabilityCalendar.vue +3 -3
- package/src/components/MAvatar.vue +32 -5
- package/src/components/MAvatarGroup.vue +7 -2
- package/src/components/MBottomSheet.vue +18 -2
- package/src/components/MButton.vue +18 -5
- package/src/components/MCarousel.vue +3 -3
- package/src/components/MChatBubble.vue +14 -1
- package/src/components/MCheckbox.vue +21 -4
- package/src/components/MChip.vue +4 -2
- package/src/components/MCollapse.vue +7 -1
- package/src/components/MCommandPalette.vue +6 -2
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MCreditCardInput.vue +5 -0
- package/src/components/MDashboardGrid.vue +2 -1
- package/src/components/MDataTable.vue +63 -16
- package/src/components/MDialog.vue +21 -3
- package/src/components/MDiffViewer.vue +3 -3
- package/src/components/MDrawLayers.vue +3 -3
- package/src/components/MFabMenu.vue +7 -0
- package/src/components/MFloorPlan.vue +3 -3
- package/src/components/MFloorPlanInspector.vue +3 -3
- package/src/components/MFlow.vue +9 -5
- package/src/components/MFlowControls.vue +6 -0
- package/src/components/MFormBuilder.vue +1 -1
- package/src/components/MGantt.vue +10 -10
- package/src/components/MHotkeys.vue +61 -16
- package/src/components/MIcon.vue +17 -1
- package/src/components/MIconButton.vue +29 -6
- package/src/components/MImageCropper.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MLightbox.vue +5 -4
- package/src/components/MLink.vue +136 -0
- package/src/components/MListDetail.vue +7 -0
- package/src/components/MListItem.vue +7 -4
- package/src/components/MLoadingIndicator.vue +2 -1
- package/src/components/MMap.vue +3 -0
- package/src/components/MMapCluster.vue +2 -2
- package/src/components/MMapControl.vue +2 -2
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMaskField.vue +16 -3
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMeterGroup.vue +3 -2
- package/src/components/MMortgageCalculator.vue +3 -3
- package/src/components/MMultiAutocomplete.vue +19 -7
- package/src/components/MMultiSelect.vue +19 -7
- package/src/components/MNavigationDrawer.vue +10 -3
- package/src/components/MNavigationRail.vue +5 -1
- package/src/components/MNotificationCenter.vue +2 -1
- package/src/components/MNotificationHost.vue +3 -3
- package/src/components/MNumberField.vue +23 -6
- package/src/components/MOdontogram.vue +4 -4
- package/src/components/MOrderBook.vue +4 -0
- package/src/components/MPagination.vue +91 -12
- package/src/components/MPdfSigner.vue +3 -3
- package/src/components/MPdfViewer.vue +7 -7
- package/src/components/MPhoneInput.vue +17 -4
- package/src/components/MProductConfigurator.vue +4 -4
- package/src/components/MProgressBar.vue +5 -0
- package/src/components/MQuiz.vue +8 -5
- package/src/components/MRadio.vue +24 -5
- package/src/components/MRadioGroup.vue +3 -0
- package/src/components/MReactions.vue +2 -2
- package/src/components/MResourceTimeline.vue +3 -3
- package/src/components/MResult.vue +1 -1
- package/src/components/MScrollField.vue +1 -1
- package/src/components/MSearchField.vue +6 -5
- package/src/components/MSeatMap.vue +5 -0
- package/src/components/MSeekBar.vue +3 -2
- package/src/components/MSelect.vue +16 -4
- package/src/components/MSideSheet.vue +25 -3
- package/src/components/MSimpleCarousel.vue +2 -2
- package/src/components/MSnackbar.vue +16 -13
- package/src/components/MSparkline.vue +2 -1
- package/src/components/MSpinner.vue +8 -0
- package/src/components/MSplitter.vue +1 -1
- package/src/components/MSpotlightSearch.vue +6 -2
- package/src/components/MSpreadsheet.vue +1 -1
- package/src/components/MStatCard.vue +2 -1
- package/src/components/MSwitch.vue +21 -4
- package/src/components/MTabs.vue +2 -1
- package/src/components/MTagInput.vue +19 -6
- package/src/components/MText.vue +23 -4
- package/src/components/MTextField.vue +25 -6
- package/src/components/MTimeline.vue +5 -5
- package/src/components/MToolbar.vue +2 -2
- package/src/components/MTour.vue +3 -0
- package/src/components/MTrackingTimeline.vue +6 -0
- package/src/components/MTypewriter.vue +7 -1
- package/src/components/MWindow.vue +10 -1
- package/src/components/_MColorPanel.vue +4 -4
- package/src/components/_MComment.vue +3 -2
- package/src/components/_MFlowNodeShell.vue +1 -1
- package/src/components/_MPdfPage.vue +1 -1
- package/src/components/_MTransferPane.vue +10 -0
- package/src/composables/_effectCanvas.ts +2 -1
- package/src/composables/_menuGroups.ts +10 -1
- package/src/composables/_splitAttrs.ts +29 -0
- package/src/composables/_springAnimation.ts +3 -3
- package/src/composables/_themeTransition.ts +3 -2
- package/src/composables/_useFocusTrap.ts +142 -0
- package/src/composables/_useMenuNav.ts +3 -3
- package/src/composables/_usePaneResize.ts +2 -1
- package/src/composables/_useSheetMotion.ts +3 -4
- package/src/composables/_useSpring.ts +16 -10
- package/src/composables/cron.ts +7 -6
- package/src/composables/dynamicColor.ts +21 -2
- package/src/composables/motion.ts +27 -0
- package/src/composables/useConfirm.ts +116 -0
- package/src/composables/useDevice.ts +23 -3
- package/src/composables/useFieldBg.ts +4 -0
- package/src/composables/useLocale.ts +74 -0
- package/src/composables/useNotification.ts +3 -0
- package/src/composables/useScrollReveal.ts +3 -3
- package/src/composables/useTheme.ts +8 -2
- package/src/composables/useToast.ts +27 -4
- package/src/directives/vSparkle.ts +2 -1
- package/src/index.ts +8 -5
- package/src/locales/ar.ts +7 -0
- package/src/locales/de.ts +7 -0
- package/src/locales/es.ts +7 -0
- package/src/locales/fr.ts +7 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +7 -0
- package/src/locales/ko.ts +7 -0
- package/src/locales/pl.ts +807 -0
- package/src/locales/pt.ts +7 -0
- package/src/locales/zh.ts +7 -0
- package/src/plugin.ts +16 -0
- package/src/styles/theme.css +40 -0
- package/dist/MButton-B9RCM06i.js +0 -171
- package/dist/MButton-B9RCM06i.js.map +0 -1
- package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
- package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
- package/dist/MDialog-dk07tify.js +0 -167
- package/dist/MDialog-dk07tify.js.map +0 -1
- package/dist/MIcon-BSsJZhK7.js.map +0 -1
- package/dist/MIconButton-CrBPZidd.js +0 -288
- package/dist/MIconButton-CrBPZidd.js.map +0 -1
- package/dist/MListItem-h9H223vx.js +0 -1239
- package/dist/MListItem-h9H223vx.js.map +0 -1
- package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
- package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
- package/dist/MMenuItem-US0Zbglq.js.map +0 -1
- package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
- package/dist/MSeekBar-JFZcoJ8y.js +0 -434
- package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
- package/dist/MTextField-B6_iOczK.js.map +0 -1
- package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
- package/dist/motion-BcejVTeX.js.map +0 -1
- package/dist/useLocale-YRaOT12S.js.map +0 -1
- package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as l } from "./
|
|
1
|
+
import { t as e } from "./motion-BqYcqcim.js";
|
|
2
|
+
import { r as t, t as n } from "./MIcon-CkUc9kuQ.js";
|
|
3
|
+
import { a as r, f as i, i as a, l as o, p as s, s as c, u as l } from "./MIconButton-DTFOfsTy.js";
|
|
4
4
|
import { n as u, r as d, t as f } from "./_popupPosition-C_lxj9qU.js";
|
|
5
|
-
import { Fragment as p, Teleport as ee, Transition as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, inject as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeStyle as
|
|
5
|
+
import { Fragment as p, Teleport as ee, Transition as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, inject as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeStyle as E, onMounted as te, onUnmounted as ne, openBlock as D, provide as O, ref as k, renderList as re, renderSlot as A, resolveDynamicComponent as ie, toDisplayString as ae, unref as j, useSlots as oe, watch as se, withCtx as ce, withDirectives as le } from "vue";
|
|
6
6
|
// src/components/MMenuDivider.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var M = { class: "my-1 border-outline-variant" }, N = /* @__PURE__ */ x({
|
|
8
8
|
__name: "MMenuDivider",
|
|
@@ -11,7 +11,7 @@ var M = { class: "my-1 border-outline-variant" }, N = /* @__PURE__ */ x({
|
|
|
11
11
|
default: !1
|
|
12
12
|
} },
|
|
13
13
|
setup(e) {
|
|
14
|
-
return (e, t) => (
|
|
14
|
+
return (e, t) => (D(), v("hr", M));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
// src/composables/_menuGroups.ts
|
|
@@ -30,13 +30,15 @@ function de(e) {
|
|
|
30
30
|
for (let n of P(e)) ue(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
31
31
|
return t.filter((e) => e.length > 0);
|
|
32
32
|
}
|
|
33
|
+
var F = (e) => e.nodes?.() ?? null;
|
|
34
|
+
F.props = ["nodes"];
|
|
33
35
|
// src/composables/_useMenuNav.ts
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
let
|
|
36
|
+
var I = 30, L = 380, fe = 8, R = 1 / 3, pe = .5;
|
|
37
|
+
function me(n) {
|
|
38
|
+
let r = k([]), a = h(() => r.value[r.value.length - 1]), s = k("forward"), c = k(), u = 0, d = 1, f = () => t(c.value) ? -1 : 1;
|
|
37
39
|
function p(e, t) {
|
|
38
|
-
let n = (
|
|
39
|
-
transform: `translateX(${n *
|
|
40
|
+
let n = (s.value === "forward" ? 1 : -1) * f(), r = e.animate([{
|
|
41
|
+
transform: `translateX(${n * I}px)`,
|
|
40
42
|
opacity: 0
|
|
41
43
|
}, {
|
|
42
44
|
transform: "translateX(0)",
|
|
@@ -50,65 +52,65 @@ function pe(t) {
|
|
|
50
52
|
r.onfinish = t;
|
|
51
53
|
}
|
|
52
54
|
function ee(e, t) {
|
|
53
|
-
let n = (
|
|
55
|
+
let n = (s.value === "forward" ? -1 : 1) * f(), r = e;
|
|
54
56
|
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
55
57
|
let i = u, a = d;
|
|
56
58
|
u = 0, d = 1;
|
|
57
|
-
let
|
|
59
|
+
let o = r.animate([{
|
|
58
60
|
transform: `translateX(${i}px)`,
|
|
59
61
|
opacity: a
|
|
60
62
|
}, {
|
|
61
|
-
transform: `translateX(${i + n *
|
|
63
|
+
transform: `translateX(${i + n * I}px)`,
|
|
62
64
|
opacity: 0
|
|
63
65
|
}], {
|
|
64
66
|
duration: 90,
|
|
65
67
|
easing: "cubic-bezier(0.3,0,0.8,0.15)",
|
|
66
68
|
fill: "forwards"
|
|
67
69
|
});
|
|
68
|
-
|
|
70
|
+
o.onfinish = t;
|
|
69
71
|
}
|
|
70
|
-
function m(
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
|
|
72
|
+
function m(t) {
|
|
73
|
+
let n = c.value, r = n?.offsetHeight ?? 0, a = n?.style.overflowY ?? "";
|
|
74
|
+
n && (n.style.overflowY = "hidden");
|
|
75
|
+
let s = () => {
|
|
76
|
+
n && (n.style.overflowY = a);
|
|
75
77
|
};
|
|
76
|
-
if (
|
|
78
|
+
if (t(), !n || l()) return s();
|
|
77
79
|
w(() => {
|
|
78
|
-
let
|
|
79
|
-
Promise.all([
|
|
80
|
+
let t = n.offsetHeight, a = Math.abs(t - r) < 1 ? null : o(n, i(r, t, 0, e().defaultSpatial, .5), (e) => ({ height: `${e}px` })), c = new Promise((e) => setTimeout(e, L));
|
|
81
|
+
Promise.all([c, a?.finished.catch(() => {})]).then(s);
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
function g(e) {
|
|
83
|
-
|
|
85
|
+
s.value = "forward", m(() => r.value.push(e)), w(n);
|
|
84
86
|
}
|
|
85
87
|
function _() {
|
|
86
|
-
|
|
88
|
+
s.value = "backward", m(() => r.value.pop()), w(n);
|
|
87
89
|
}
|
|
88
90
|
function v() {
|
|
89
|
-
|
|
91
|
+
r.value = [];
|
|
90
92
|
}
|
|
91
93
|
let y = null;
|
|
92
94
|
function b() {
|
|
93
|
-
return
|
|
95
|
+
return c.value?.querySelector(`:scope > [data-menu-level="${r.value.length}"]`) ?? null;
|
|
94
96
|
}
|
|
95
97
|
function x(e) {
|
|
96
|
-
if (e.pointerType !== "touch" || !
|
|
98
|
+
if (e.pointerType !== "touch" || !r.value.length || y) return;
|
|
97
99
|
let t = b();
|
|
98
100
|
if (!t) return;
|
|
99
|
-
let
|
|
101
|
+
let n = f();
|
|
100
102
|
y = {
|
|
101
103
|
id: e.pointerId,
|
|
102
|
-
x: e.clientX *
|
|
104
|
+
x: e.clientX * n,
|
|
103
105
|
y: e.clientY,
|
|
104
106
|
level: t,
|
|
105
|
-
width:
|
|
107
|
+
width: c.value.clientWidth,
|
|
106
108
|
active: !1,
|
|
107
|
-
lastX: e.clientX *
|
|
109
|
+
lastX: e.clientX * n,
|
|
108
110
|
lastT: e.timeStamp,
|
|
109
111
|
vel: 0,
|
|
110
|
-
sign:
|
|
111
|
-
}, window.addEventListener("pointermove", C), window.addEventListener("pointerup", T), window.addEventListener("pointercancel",
|
|
112
|
+
sign: n
|
|
113
|
+
}, window.addEventListener("pointermove", C), window.addEventListener("pointerup", T), window.addEventListener("pointercancel", E);
|
|
112
114
|
}
|
|
113
115
|
function S(e) {
|
|
114
116
|
y && (y.level.style.transform = `translateX(${e * y.sign}px)`, y.level.style.opacity = String(1 - .5 * Math.min(1, e / y.width)));
|
|
@@ -117,8 +119,8 @@ function pe(t) {
|
|
|
117
119
|
if (!y || e.pointerId !== y.id) return;
|
|
118
120
|
let t = e.clientX * y.sign, n = t - y.x, r = e.clientY - y.y;
|
|
119
121
|
if (!y.active) {
|
|
120
|
-
if (Math.hypot(n, r) <
|
|
121
|
-
if (Math.abs(r) > Math.abs(n) || n < 0) return
|
|
122
|
+
if (Math.hypot(n, r) < fe) return;
|
|
123
|
+
if (Math.abs(r) > Math.abs(n) || n < 0) return A();
|
|
122
124
|
y.active = !0, y.x = t, y.level.getAnimations().forEach((e) => e.finish());
|
|
123
125
|
}
|
|
124
126
|
let i = e.timeStamp - y.lastT;
|
|
@@ -127,43 +129,43 @@ function pe(t) {
|
|
|
127
129
|
function T(e) {
|
|
128
130
|
if (!y || e.pointerId !== y.id) return;
|
|
129
131
|
let t = y;
|
|
130
|
-
if (
|
|
131
|
-
window.addEventListener("click",
|
|
132
|
+
if (A(), !t.active) return;
|
|
133
|
+
window.addEventListener("click", re, {
|
|
132
134
|
capture: !0,
|
|
133
135
|
once: !0
|
|
134
|
-
}), clearTimeout(
|
|
136
|
+
}), clearTimeout(D), D = setTimeout(O, 400);
|
|
135
137
|
let n = Math.max(0, e.clientX * t.sign - t.x);
|
|
136
|
-
n > t.width * R || t.vel >
|
|
138
|
+
n > t.width * R || t.vel > pe ? (u = n * t.sign, d = Number(t.level.style.opacity || 1), _()) : te(t.level, n, t.sign);
|
|
137
139
|
}
|
|
138
|
-
function
|
|
140
|
+
function E(e) {
|
|
139
141
|
if (!y || e.pointerId !== y.id) return;
|
|
140
142
|
let t = y;
|
|
141
|
-
|
|
143
|
+
A(), t.active && te(t.level, Math.max(0, t.lastX - t.x), t.sign);
|
|
142
144
|
}
|
|
143
|
-
function
|
|
144
|
-
if (
|
|
145
|
-
let
|
|
146
|
-
|
|
147
|
-
transform: `translateX(${e *
|
|
148
|
-
opacity: String(1 - .5 * Math.min(1, e /
|
|
145
|
+
function te(t, n, r) {
|
|
146
|
+
if (t.style.transform = "", t.style.opacity = "", l() || n < 1) return;
|
|
147
|
+
let a = c.value?.clientWidth || 1;
|
|
148
|
+
o(t, i(n, 0, 0, e().defaultSpatial, .5), (e) => ({
|
|
149
|
+
transform: `translateX(${e * r}px)`,
|
|
150
|
+
opacity: String(1 - .5 * Math.min(1, e / a))
|
|
149
151
|
}));
|
|
150
152
|
}
|
|
151
|
-
let
|
|
152
|
-
function
|
|
153
|
-
clearTimeout(
|
|
153
|
+
let D;
|
|
154
|
+
function O() {
|
|
155
|
+
clearTimeout(D), window.removeEventListener("click", re, { capture: !0 });
|
|
154
156
|
}
|
|
155
|
-
function
|
|
157
|
+
function re(e) {
|
|
156
158
|
e.stopPropagation(), e.preventDefault();
|
|
157
159
|
}
|
|
158
|
-
function
|
|
159
|
-
y = null, window.removeEventListener("pointermove", C), window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel",
|
|
160
|
+
function A() {
|
|
161
|
+
y = null, window.removeEventListener("pointermove", C), window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel", E);
|
|
160
162
|
}
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
+
return ne(() => {
|
|
164
|
+
A(), O();
|
|
163
165
|
}), {
|
|
164
|
-
navStack:
|
|
165
|
-
currentNav:
|
|
166
|
-
navBox:
|
|
166
|
+
navStack: r,
|
|
167
|
+
currentNav: a,
|
|
168
|
+
navBox: c,
|
|
167
169
|
navSlideEnter: p,
|
|
168
170
|
navSlideLeave: ee,
|
|
169
171
|
pushNav: g,
|
|
@@ -173,10 +175,10 @@ function pe(t) {
|
|
|
173
175
|
};
|
|
174
176
|
}
|
|
175
177
|
// src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
|
|
176
|
-
var z = ["data-menu-level"],
|
|
178
|
+
var z = ["data-menu-level"], he = { class: "flex-1 truncate" }, B = { key: "root" }, ge = {
|
|
177
179
|
key: 0,
|
|
178
180
|
class: "flex flex-col gap-1 px-1.5"
|
|
179
|
-
}, V = 1 / 240, H = 4,
|
|
181
|
+
}, V = 1 / 240, H = 4, U = /* @__PURE__ */ x({
|
|
180
182
|
inheritAttrs: !1,
|
|
181
183
|
__name: "MMenu",
|
|
182
184
|
props: {
|
|
@@ -186,10 +188,10 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
186
188
|
color: { default: "standard" },
|
|
187
189
|
maxHeight: { default: 400 }
|
|
188
190
|
},
|
|
189
|
-
setup(
|
|
190
|
-
let i =
|
|
191
|
-
function
|
|
192
|
-
if (
|
|
191
|
+
setup(e, { expose: r }) {
|
|
192
|
+
let i = e, a = oe(), o = h(() => i.variant === "expressive" ? de(a.default?.({ close: $ }) ?? []) : null), s = h(() => !!o.value && o.value.length > 1), { navStack: c, currentNav: l, navBox: u, navSlideEnter: x, navSlideLeave: ie, pushNav: ae, popNav: le, onNavPointerDown: M } = me(() => be()), N = null;
|
|
193
|
+
function P() {
|
|
194
|
+
if (N) return N;
|
|
193
195
|
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
194
196
|
for (let a = 0; a < 1 && (e.push({
|
|
195
197
|
scale: t,
|
|
@@ -198,12 +200,12 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
198
200
|
return e.push({
|
|
199
201
|
scale: 1,
|
|
200
202
|
alpha: 1
|
|
201
|
-
}),
|
|
203
|
+
}), N = e, e;
|
|
202
204
|
}
|
|
203
|
-
let
|
|
204
|
-
function
|
|
205
|
+
let ue = 0, I = null, L = null;
|
|
206
|
+
function fe(e, t, n) {
|
|
205
207
|
I?.();
|
|
206
|
-
let r = e, i =
|
|
208
|
+
let r = e, i = P(), a = i.length - 1, o = Math.round(Math.max(0, Math.min(a, ue))), s = n ? a : 0, c = n ? 1 : -1, l = [];
|
|
207
209
|
for (let e = o; n ? e <= s : e >= s; e += c) l.push(i[e]);
|
|
208
210
|
let u = (e) => ({
|
|
209
211
|
transform: `scale(${e.scale})`,
|
|
@@ -212,7 +214,7 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
212
214
|
Object.assign(r.style, u(i[s]));
|
|
213
215
|
let d = !1;
|
|
214
216
|
function f() {
|
|
215
|
-
d || (d = !0,
|
|
217
|
+
d || (d = !0, ue = s, I = null, L = null, t());
|
|
216
218
|
}
|
|
217
219
|
if (l.length < 2 || typeof r.animate != "function") return f();
|
|
218
220
|
let p = r.animate(l.map(u), {
|
|
@@ -221,30 +223,30 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
221
223
|
});
|
|
222
224
|
p.finished.catch(() => {}), p.onfinish = f, I = () => {
|
|
223
225
|
let e = Number(p.currentTime ?? 0) / (V * 1e3);
|
|
224
|
-
|
|
226
|
+
ue = Math.max(0, Math.min(a, o + c * e)), d = !0, p.cancel();
|
|
225
227
|
}, L = n ? null : () => {
|
|
226
228
|
I?.(), I = null, L = null, t();
|
|
227
229
|
};
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
Z(e), ve(e),
|
|
231
|
+
function R(e, t) {
|
|
232
|
+
Z(e), ve(e), fe(e, t, !0);
|
|
231
233
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
234
|
+
function pe(e, t) {
|
|
235
|
+
fe(e, t, !1);
|
|
234
236
|
}
|
|
235
|
-
let U =
|
|
236
|
-
|
|
237
|
-
t &&
|
|
238
|
-
}),
|
|
239
|
-
|
|
237
|
+
let U = k(!1), W = k(null), G = k(null), K = k({}), q = S("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
238
|
+
O("m-menu-panel-registry", q), se(G, (e, t) => {
|
|
239
|
+
t && q.delete(t), e && q.add(e);
|
|
240
|
+
}), ne(() => {
|
|
241
|
+
G.value && q.delete(G.value);
|
|
240
242
|
});
|
|
241
|
-
let
|
|
242
|
-
|
|
243
|
-
let
|
|
244
|
-
function
|
|
245
|
-
if (!
|
|
246
|
-
let e =
|
|
247
|
-
|
|
243
|
+
let J = S("m-menu-sibling-group", null);
|
|
244
|
+
O("m-menu-sibling-group", { current: null });
|
|
245
|
+
let Y = null, X = k(!1);
|
|
246
|
+
function _e() {
|
|
247
|
+
if (!W.value) return;
|
|
248
|
+
let e = W.value.getBoundingClientRect();
|
|
249
|
+
Y = e, X.value = !1, K.value = {
|
|
248
250
|
maxHeight: `${i.maxHeight}px`,
|
|
249
251
|
maxWidth: `${window.innerWidth - 16}px`,
|
|
250
252
|
left: "0px",
|
|
@@ -252,26 +254,26 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
252
254
|
};
|
|
253
255
|
}
|
|
254
256
|
function Z(e) {
|
|
255
|
-
if (!
|
|
256
|
-
let t = Math.min(u.value.scrollHeight, i.maxHeight), n = window.innerHeight -
|
|
257
|
-
|
|
257
|
+
if (!Y || !u.value) return;
|
|
258
|
+
let t = Math.min(u.value.scrollHeight, i.maxHeight), n = window.innerHeight - Y.bottom - H - 8, r = Y.top - H - 8;
|
|
259
|
+
X.value = t > n && (t <= r || r > n);
|
|
258
260
|
let a = {
|
|
259
|
-
...
|
|
260
|
-
maxHeight: `${Math.min(
|
|
261
|
+
...K.value,
|
|
262
|
+
maxHeight: `${Math.min(X.value ? r : n, i.maxHeight)}px`
|
|
261
263
|
};
|
|
262
|
-
delete a.top, delete a.bottom,
|
|
264
|
+
delete a.top, delete a.bottom, X.value ? a.bottom = `${window.innerHeight - Y.top + H}px` : a.top = `${Y.bottom + H}px`, K.value = a, e.style.top = a.top ?? "", e.style.bottom = a.bottom ?? "", u.value.style.maxHeight = a.maxHeight;
|
|
263
265
|
}
|
|
264
|
-
let Q =
|
|
265
|
-
function ve(
|
|
266
|
-
if (!
|
|
267
|
-
let n =
|
|
268
|
-
Q.value = c,
|
|
269
|
-
...
|
|
266
|
+
let Q = k(i.align === "right" || i.align === "end" && !t() || i.align === "start" && t() ? "right" : "left");
|
|
267
|
+
function ve(e) {
|
|
268
|
+
if (!Y) return;
|
|
269
|
+
let n = e.offsetWidth, r = t(), a = i.align === "left" ? r ? "end" : "start" : i.align === "right" ? r ? "start" : "end" : i.align, o = f(Y, n, window.innerWidth, a, void 0, r), s = Math.min(n, Math.max(0, (Y.left + Y.right) / 2 - o)), c = Math.abs(o - Y.left) < 1 ? "left" : Math.abs(o + n - Y.right) < 1 ? "right" : `${s}px`;
|
|
270
|
+
Q.value = c, K.value = {
|
|
271
|
+
...K.value,
|
|
270
272
|
left: `${o}px`
|
|
271
|
-
},
|
|
273
|
+
}, e.style.left = `${o}px`, e.style.transformOrigin = `${c} ${X.value ? "bottom" : "top"}`;
|
|
272
274
|
}
|
|
273
275
|
function ye() {
|
|
274
|
-
return
|
|
276
|
+
return G.value ? Array.from(G.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
275
277
|
}
|
|
276
278
|
function be() {
|
|
277
279
|
w(() => ye()[0]?.focus());
|
|
@@ -283,105 +285,105 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
283
285
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
284
286
|
}
|
|
285
287
|
function Se() {
|
|
286
|
-
U.value ?
|
|
288
|
+
U.value ? J?.current === $ && (J.current = null) : (J && J.current && J.current !== $ && J.current(), J && (J.current = $), _e(), c.value = []), U.value = !U.value, U.value && be();
|
|
287
289
|
}
|
|
288
290
|
function $() {
|
|
289
|
-
|
|
291
|
+
J?.current === $ && (J.current = null), U.value = !1;
|
|
290
292
|
}
|
|
291
|
-
|
|
293
|
+
O("m-menu-close", $), O("m-menu-color", h(() => i.color)), O("m-menu-variant", h(() => i.variant));
|
|
292
294
|
let Ce = h(() => i.color === "vibrant" ? "bg-tertiary-container" : i.variant === "expressive" ? "bg-surface-container-low" : "bg-surface-container");
|
|
293
|
-
|
|
295
|
+
O("m-menu-nav", {
|
|
294
296
|
mode: i.submenuMode,
|
|
295
|
-
push:
|
|
297
|
+
push: ae
|
|
296
298
|
}), r({
|
|
297
299
|
close: $,
|
|
298
300
|
open: U
|
|
299
301
|
});
|
|
300
302
|
function we(e) {
|
|
301
303
|
let t = e.target;
|
|
302
|
-
if (!
|
|
303
|
-
for (let e of
|
|
304
|
+
if (!W.value?.contains(t)) {
|
|
305
|
+
for (let e of q) if (e.contains(t)) return;
|
|
304
306
|
t.closest?.(".m3-submenu") || $();
|
|
305
307
|
}
|
|
306
308
|
}
|
|
307
309
|
function Te(e) {
|
|
308
310
|
if (!U.value) return;
|
|
309
311
|
let t = e.target;
|
|
310
|
-
for (let e of
|
|
312
|
+
for (let e of q) if (e.contains(t)) return;
|
|
311
313
|
t.closest?.(".m3-submenu") || $();
|
|
312
314
|
}
|
|
313
|
-
d(() => U.value, () => c.value.length ?
|
|
315
|
+
d(() => U.value, () => c.value.length ? le() : $());
|
|
314
316
|
function Ee(e) {
|
|
315
317
|
U.value && (e.key === "ArrowDown" ? (e.preventDefault(), xe(1)) : e.key === "ArrowUp" && (e.preventDefault(), xe(-1)));
|
|
316
318
|
}
|
|
317
|
-
|
|
319
|
+
te(() => {
|
|
318
320
|
document.addEventListener("mousedown", we), document.addEventListener("keydown", Ee), window.addEventListener("scroll", Te, !0);
|
|
319
|
-
}),
|
|
321
|
+
}), ne(() => {
|
|
320
322
|
document.removeEventListener("mousedown", we), document.removeEventListener("keydown", Ee), window.removeEventListener("scroll", Te, !0), L ? L() : I?.();
|
|
321
323
|
});
|
|
322
|
-
let De = h(() => `${Q.value} ${
|
|
323
|
-
return (
|
|
324
|
+
let De = h(() => `${Q.value} ${X.value ? "bottom" : "top"}`);
|
|
325
|
+
return (t, r) => (D(), v(p, null, [y("div", C({
|
|
324
326
|
ref_key: "triggerEl",
|
|
325
|
-
ref:
|
|
326
|
-
},
|
|
327
|
+
ref: W
|
|
328
|
+
}, t.$attrs, {
|
|
327
329
|
class: "inline-block",
|
|
328
330
|
onClick: Se
|
|
329
|
-
}), [
|
|
331
|
+
}), [A(t.$slots, "trigger", { open: U.value })], 16), (D(), g(ee, { to: "body" }, [b(m, {
|
|
330
332
|
css: !1,
|
|
331
|
-
onEnter:
|
|
332
|
-
onLeave:
|
|
333
|
+
onEnter: R,
|
|
334
|
+
onLeave: pe
|
|
333
335
|
}, {
|
|
334
|
-
default: ce(() => [U.value ? (
|
|
336
|
+
default: ce(() => [U.value ? (D(), v("div", {
|
|
335
337
|
key: 0,
|
|
336
338
|
ref_key: "dropdownEl",
|
|
337
|
-
ref:
|
|
338
|
-
class: T(["fixed z-500 min-w-48", [
|
|
339
|
-
style:
|
|
340
|
-
...
|
|
339
|
+
ref: G,
|
|
340
|
+
class: T(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", s.value ? "" : "shadow-elevation-2"]]),
|
|
341
|
+
style: E({
|
|
342
|
+
...K.value,
|
|
341
343
|
transformOrigin: De.value
|
|
342
344
|
})
|
|
343
|
-
}, [y("div", { class: T(["overflow-hidden", [
|
|
345
|
+
}, [y("div", { class: T(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", s.value ? "" : Ce.value]]) }, [y("div", {
|
|
344
346
|
ref_key: "navBox",
|
|
345
347
|
ref: u,
|
|
346
348
|
class: "relative overflow-x-hidden overflow-y-auto overscroll-contain py-1",
|
|
347
|
-
style:
|
|
348
|
-
maxHeight:
|
|
349
|
+
style: E({
|
|
350
|
+
maxHeight: K.value.maxHeight,
|
|
349
351
|
touchAction: j(l) ? "pan-y" : void 0
|
|
350
352
|
}),
|
|
351
|
-
onPointerdown: r[1] ||= (...e) => j(
|
|
353
|
+
onPointerdown: r[1] ||= (...e) => j(M) && j(M)(...e)
|
|
352
354
|
}, [b(m, {
|
|
353
355
|
css: !1,
|
|
354
356
|
onEnter: j(x),
|
|
355
|
-
onLeave: j(
|
|
357
|
+
onLeave: j(ie)
|
|
356
358
|
}, {
|
|
357
|
-
default: ce(() => [j(l) ? (
|
|
359
|
+
default: ce(() => [j(l) ? (D(), v("div", {
|
|
358
360
|
key: j(c).length,
|
|
359
361
|
"data-menu-level": j(c).length
|
|
360
362
|
}, [
|
|
361
363
|
y("button", {
|
|
362
364
|
type: "button",
|
|
363
|
-
class: T(["flex w-full items-center gap-3 px-4 py-2.5 text-start text-label-large outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
364
|
-
onClick: r[0] ||= (...e) => j(
|
|
365
|
-
}, [b(
|
|
365
|
+
class: T(["flex w-full items-center gap-3 px-4 py-2.5 text-start text-label-large outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", e.color === "vibrant" ? "text-on-tertiary-container hover:bg-on-tertiary-container/8" : "text-on-surface-variant hover:bg-on-surface/8"]),
|
|
366
|
+
onClick: r[0] ||= (...e) => j(le) && j(le)(...e)
|
|
367
|
+
}, [b(n, {
|
|
366
368
|
name: "arrow_back",
|
|
367
369
|
size: 20,
|
|
368
370
|
class: "shrink-0"
|
|
369
|
-
}), y("span",
|
|
371
|
+
}), y("span", he, [b(j(F), { nodes: () => j(l)?.header?.() }, null, 8, ["nodes"])])], 2),
|
|
370
372
|
r[2] ||= y("hr", { class: "my-1 border-outline-variant" }, null, -1),
|
|
371
|
-
(
|
|
372
|
-
], 8, z)) : (
|
|
373
|
+
b(j(F), { nodes: () => j(l)?.content?.() }, null, 8, ["nodes"])
|
|
374
|
+
], 8, z)) : (D(), v("div", B, [s.value ? (D(), v("div", ge, [(D(!0), v(p, null, re(o.value, (e, t) => (D(), v("div", {
|
|
373
375
|
key: t,
|
|
374
376
|
class: "rounded-lg shadow-elevation-2"
|
|
375
|
-
}, [y("div", { class: T(["overflow-hidden rounded-lg", Ce.value]) }, [(
|
|
377
|
+
}, [y("div", { class: T(["overflow-hidden rounded-lg", Ce.value]) }, [b(j(F), { nodes: () => e }, null, 8, ["nodes"])], 2)]))), 128))])) : A(t.$slots, "default", { close: $ }, void 0, void 0, 1)]))]),
|
|
376
378
|
_: 3
|
|
377
379
|
}, 8, ["onEnter", "onLeave"])], 36)], 2)], 6)) : _("", !0)]),
|
|
378
380
|
_: 3
|
|
379
381
|
})]))], 64));
|
|
380
382
|
}
|
|
381
|
-
}),
|
|
383
|
+
}), W = ["data-m3-menu-choice"], G = { class: "flex-1" }, K = {
|
|
382
384
|
key: 0,
|
|
383
385
|
class: "flex flex-col gap-1 px-1.5"
|
|
384
|
-
},
|
|
386
|
+
}, q = 32, J = /* @__PURE__ */ x({
|
|
385
387
|
__name: "MMenuItem",
|
|
386
388
|
props: {
|
|
387
389
|
icon: {},
|
|
@@ -410,10 +412,10 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
410
412
|
selectedIcon: {}
|
|
411
413
|
},
|
|
412
414
|
emits: ["click", "update:checked"],
|
|
413
|
-
setup(
|
|
414
|
-
let
|
|
415
|
+
setup(e, { emit: i }) {
|
|
416
|
+
let o = e, l = i, d = oe(), f = h(() => o.checked !== void 0), x = h(() => f.value || o.selected !== void 0), C = h(() => !!(o.checked ?? o.selected)), O = h(() => x.value && !o.icon && !d.icon), M = h(() => o.selectedIcon ?? (o.icon ? void 0 : "check")), N = k("single");
|
|
415
417
|
function P() {
|
|
416
|
-
let e =
|
|
418
|
+
let e = X.value;
|
|
417
419
|
if (!e || !x.value) return;
|
|
418
420
|
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
419
421
|
N.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
@@ -433,24 +435,24 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
433
435
|
t
|
|
434
436
|
];
|
|
435
437
|
}
|
|
436
|
-
let { snap:
|
|
437
|
-
let a =
|
|
438
|
-
a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`),
|
|
439
|
-
},
|
|
440
|
-
se(N, () =>
|
|
441
|
-
let
|
|
442
|
-
|
|
438
|
+
let { snap: I } = c(() => x.value ? [...ue(), O.value && C.value ? q : 0] : [], ([e, t, n, r, i]) => {
|
|
439
|
+
let a = _e.value instanceof HTMLElement ? _e.value : _e.value?.$el;
|
|
440
|
+
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
|
+
}, r);
|
|
442
|
+
se(N, () => I());
|
|
443
|
+
let L = null;
|
|
444
|
+
te(() => {
|
|
443
445
|
P();
|
|
444
|
-
let e =
|
|
445
|
-
e && (
|
|
446
|
-
}),
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
let
|
|
450
|
-
function
|
|
451
|
-
if (!
|
|
452
|
-
let e =
|
|
453
|
-
|
|
446
|
+
let e = X.value?.parentElement;
|
|
447
|
+
e && (L = new MutationObserver(P), L.observe(e, { childList: !0 }));
|
|
448
|
+
}), ne(() => L?.disconnect()), se(x, () => w(P)), c(() => O.value ? [+!!C.value] : [], ([e]) => {
|
|
449
|
+
Z.value && e !== void 0 && (Z.value.style.opacity = String(e));
|
|
450
|
+
}, a);
|
|
451
|
+
let fe = h(() => o.to ? "RouterLink" : "button"), R = h(() => !!d.children), pe = S("m-menu-close", null), me = S("m-menu-color", null), z = h(() => me?.value === "vibrant"), he = S("m-menu-variant", null), B = h(() => he?.value === "expressive"), ge = h(() => z.value ? "bg-tertiary-container" : B.value ? "bg-surface-container-low" : "bg-surface-container"), V = h(() => B.value ? de(d.children?.() ?? []) : null), H = h(() => !!V.value && V.value.length > 1), U = h(() => x.value && C.value ? "" : !x.value && o.danger ? "text-error" : z.value ? o.disabled ? "text-on-tertiary-container" : "text-on-tertiary-container group-hover:text-tertiary group-active:text-tertiary" : "text-on-surface-variant"), J = h(() => z.value ? "text-on-tertiary-container" : "text-on-surface-variant"), Y = S("m-menu-nav", null), X = k(), _e = k(), Z = k(), Q = k(!1), ve = k({});
|
|
452
|
+
function ye() {
|
|
453
|
+
if (!X.value) return;
|
|
454
|
+
let e = X.value.getBoundingClientRect();
|
|
455
|
+
ve.value = {
|
|
454
456
|
position: "fixed",
|
|
455
457
|
top: `${e.top}px`,
|
|
456
458
|
left: `${e.right}px`,
|
|
@@ -458,104 +460,104 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
458
460
|
zIndex: "501"
|
|
459
461
|
};
|
|
460
462
|
}
|
|
461
|
-
function
|
|
462
|
-
if (!
|
|
463
|
-
let n =
|
|
463
|
+
function be(e) {
|
|
464
|
+
if (!X.value) return;
|
|
465
|
+
let n = e, r = X.value.getBoundingClientRect();
|
|
464
466
|
n.style.left = "0px";
|
|
465
|
-
let i = n.offsetWidth, a = n.offsetHeight, o = u(
|
|
466
|
-
|
|
467
|
-
...
|
|
467
|
+
let i = n.offsetWidth, a = n.offsetHeight, o = u(t(X.value) ? [r.left - i, r.right] : [r.right, r.left - i], i, window.innerWidth), s = u([r.top, r.bottom - a], a, window.innerHeight);
|
|
468
|
+
ve.value = {
|
|
469
|
+
...ve.value,
|
|
468
470
|
left: `${o}px`,
|
|
469
471
|
top: `${s}px`
|
|
470
472
|
}, n.style.left = `${o}px`, n.style.top = `${s}px`;
|
|
471
473
|
}
|
|
472
|
-
function be() {
|
|
473
|
-
Z.value ? Z.value = !1 : (ve(), Z.value = !0);
|
|
474
|
-
}
|
|
475
474
|
function xe() {
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
Q.value ? Q.value = !1 : (ye(), Q.value = !0);
|
|
476
|
+
}
|
|
477
|
+
function Se() {
|
|
478
|
+
o.disabled || (R.value ? Y?.mode === "push" ? Y.push({
|
|
479
|
+
icon: o.icon,
|
|
478
480
|
header: d.default,
|
|
479
481
|
content: d.children
|
|
480
|
-
}) :
|
|
481
|
-
}
|
|
482
|
-
function Se(e) {
|
|
483
|
-
e.pointerType === "mouse" && R.value && !c.disabled && (ve(), Z.value = !0);
|
|
482
|
+
}) : xe() : (f.value && l("update:checked", !o.checked), l("click"), (o.keepOpen ?? f.value) || pe?.()));
|
|
484
483
|
}
|
|
485
484
|
function $(e) {
|
|
486
|
-
e.pointerType === "mouse" &&
|
|
485
|
+
e.pointerType === "mouse" && R.value && !o.disabled && (ye(), Q.value = !0);
|
|
487
486
|
}
|
|
488
487
|
function Ce(e) {
|
|
488
|
+
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (Q.value = !1));
|
|
489
|
+
}
|
|
490
|
+
function we(e) {
|
|
489
491
|
if (e.pointerType !== "mouse") return;
|
|
490
492
|
let t = e.relatedTarget;
|
|
491
|
-
t?.closest(".m3-submenu") ||
|
|
493
|
+
t?.closest(".m3-submenu") || X.value?.contains(t) || (Q.value = !1);
|
|
492
494
|
}
|
|
493
|
-
return (
|
|
495
|
+
return (t, r) => (D(), v("div", {
|
|
494
496
|
ref_key: "itemEl",
|
|
495
|
-
ref:
|
|
497
|
+
ref: X,
|
|
496
498
|
"data-m3-menu-choice": x.value || void 0,
|
|
497
|
-
onPointerenter:
|
|
498
|
-
onPointerleave:
|
|
499
|
-
}, [le((
|
|
499
|
+
onPointerenter: $,
|
|
500
|
+
onPointerleave: Ce
|
|
501
|
+
}, [le((D(), g(ie(fe.value), {
|
|
500
502
|
ref_key: "controlEl",
|
|
501
|
-
ref:
|
|
502
|
-
to:
|
|
503
|
-
type:
|
|
503
|
+
ref: _e,
|
|
504
|
+
to: e.to || void 0,
|
|
505
|
+
type: e.to ? void 0 : "button",
|
|
504
506
|
role: x.value ? f.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
|
|
505
507
|
"aria-checked": x.value ? C.value : void 0,
|
|
506
508
|
class: T(["group flex items-center gap-3 py-2.5 text-start text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", x.value ? [
|
|
507
509
|
"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",
|
|
508
510
|
C.value ? z.value ? "bg-tertiary text-on-tertiary" : "bg-tertiary-container text-on-tertiary-container" : z.value ? "text-on-tertiary-container" : "text-on-surface",
|
|
509
|
-
|
|
511
|
+
e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] focus-visible:before:opacity-[0.1] active:before:opacity-[0.1]"
|
|
510
512
|
] : [
|
|
511
513
|
"w-full px-4",
|
|
512
|
-
|
|
513
|
-
!
|
|
514
|
-
!
|
|
514
|
+
e.disabled ? ["cursor-not-allowed opacity-[0.38]", z.value ? "text-on-tertiary-container" : "text-on-surface"] : "cursor-pointer",
|
|
515
|
+
!e.disabled && e.danger ? "text-error hover:bg-error/8 focus-visible:bg-error/10 active:bg-error/10" : "",
|
|
516
|
+
!e.disabled && !e.danger ? z.value ? "text-on-tertiary-container hover:bg-on-tertiary-container/8 focus-visible:bg-on-tertiary-container/10 active:bg-on-tertiary-container/10" : "text-on-surface hover:bg-on-surface/8 focus-visible:bg-on-surface/10 active:bg-on-surface/10" : ""
|
|
515
517
|
]]),
|
|
516
|
-
disabled:
|
|
518
|
+
disabled: e.disabled || void 0,
|
|
517
519
|
"aria-haspopup": R.value ? "menu" : void 0,
|
|
518
|
-
"aria-expanded": R.value ?
|
|
519
|
-
onClick:
|
|
520
|
+
"aria-expanded": R.value ? Q.value : void 0,
|
|
521
|
+
onClick: Se
|
|
520
522
|
}, {
|
|
521
523
|
default: ce(() => [
|
|
522
|
-
|
|
524
|
+
O.value ? (D(), v("span", {
|
|
523
525
|
key: 0,
|
|
524
526
|
ref_key: "iconSlotEl",
|
|
525
|
-
ref:
|
|
527
|
+
ref: Z,
|
|
526
528
|
class: "-me-3 flex shrink-0 overflow-hidden",
|
|
527
529
|
style: {
|
|
528
530
|
width: "0",
|
|
529
531
|
opacity: "0"
|
|
530
532
|
}
|
|
531
|
-
}, [b(
|
|
533
|
+
}, [b(n, {
|
|
532
534
|
name: M.value,
|
|
533
535
|
size: 20,
|
|
534
536
|
class: "shrink-0"
|
|
535
|
-
}, null, 8, ["name"])], 512)) :
|
|
537
|
+
}, null, 8, ["name"])], 512)) : t.$slots.icon ? (D(), v("span", {
|
|
536
538
|
key: 1,
|
|
537
|
-
class: T(["flex size-5 shrink-0 items-center justify-center",
|
|
538
|
-
}, [
|
|
539
|
+
class: T(["flex size-5 shrink-0 items-center justify-center", U.value])
|
|
540
|
+
}, [A(t.$slots, "icon", { on: C.value })], 2)) : e.icon ? (D(), g(n, {
|
|
539
541
|
key: 2,
|
|
540
|
-
name: C.value && M.value ? M.value :
|
|
542
|
+
name: C.value && M.value ? M.value : e.icon,
|
|
541
543
|
filled: C.value && !M.value,
|
|
542
544
|
size: 20,
|
|
543
|
-
class: T(["shrink-0",
|
|
545
|
+
class: T(["shrink-0", U.value])
|
|
544
546
|
}, null, 8, [
|
|
545
547
|
"name",
|
|
546
548
|
"filled",
|
|
547
549
|
"class"
|
|
548
550
|
])) : _("", !0),
|
|
549
|
-
y("span",
|
|
550
|
-
|
|
551
|
+
y("span", G, [A(t.$slots, "default")]),
|
|
552
|
+
e.shortcut && !R.value ? (D(), v("span", {
|
|
551
553
|
key: 3,
|
|
552
|
-
class: T(["ms-4 shrink-0 text-label-small opacity-60",
|
|
553
|
-
}, ae(
|
|
554
|
-
R.value ? (
|
|
554
|
+
class: T(["ms-4 shrink-0 text-label-small opacity-60", J.value])
|
|
555
|
+
}, ae(e.shortcut), 3)) : _("", !0),
|
|
556
|
+
R.value ? (D(), g(n, {
|
|
555
557
|
key: 4,
|
|
556
558
|
name: "chevron_right",
|
|
557
559
|
size: 18,
|
|
558
|
-
class: T(["shrink-0",
|
|
560
|
+
class: T(["shrink-0", J.value])
|
|
559
561
|
}, null, 8, ["class"])) : _("", !0)
|
|
560
562
|
]),
|
|
561
563
|
_: 3
|
|
@@ -568,7 +570,7 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
568
570
|
"disabled",
|
|
569
571
|
"aria-haspopup",
|
|
570
572
|
"aria-expanded"
|
|
571
|
-
])), [[j(
|
|
573
|
+
])), [[j(s), { disabled: e.disabled }]]), R.value && j(Y)?.mode !== "push" ? (D(), g(ee, {
|
|
572
574
|
key: 0,
|
|
573
575
|
to: "body"
|
|
574
576
|
}, [b(m, {
|
|
@@ -576,21 +578,21 @@ var z = ["data-menu-level"], me = { class: "flex-1 truncate" }, B = { key: "root
|
|
|
576
578
|
"enter-from-class": "opacity-0",
|
|
577
579
|
"leave-active-class": "transition-opacity duration-75",
|
|
578
580
|
"leave-to-class": "opacity-0",
|
|
579
|
-
onEnter:
|
|
581
|
+
onEnter: be
|
|
580
582
|
}, {
|
|
581
|
-
default: ce(() => [
|
|
583
|
+
default: ce(() => [Q.value ? (D(), v("div", {
|
|
582
584
|
key: 0,
|
|
583
585
|
class: T(["m3-submenu min-w-44", [B.value ? "rounded-lg" : "rounded-xs", H.value ? "" : "shadow-elevation-2"]]),
|
|
584
|
-
style:
|
|
585
|
-
onPointerleave:
|
|
586
|
-
}, [y("div", { class: T(["overflow-hidden py-1", [B.value ? "rounded-lg" : "rounded-xs", H.value ? "" :
|
|
586
|
+
style: E(ve.value),
|
|
587
|
+
onPointerleave: we
|
|
588
|
+
}, [y("div", { class: T(["overflow-hidden py-1", [B.value ? "rounded-lg" : "rounded-xs", H.value ? "" : ge.value]]) }, [H.value ? (D(), v("div", K, [(D(!0), v(p, null, re(V.value, (e, t) => (D(), v("div", {
|
|
587
589
|
key: t,
|
|
588
590
|
class: "rounded-lg shadow-elevation-2"
|
|
589
|
-
}, [y("div", { class: T(["overflow-hidden rounded-lg",
|
|
591
|
+
}, [y("div", { class: T(["overflow-hidden rounded-lg", ge.value]) }, [b(j(F), { nodes: () => e }, null, 8, ["nodes"])], 2)]))), 128))])) : A(t.$slots, "children", {}, void 0, void 0, 1)], 2)], 38)) : _("", !0)]),
|
|
590
592
|
_: 3
|
|
591
|
-
})])) : _("", !0)], 40,
|
|
593
|
+
})])) : _("", !0)], 40, W));
|
|
592
594
|
}
|
|
593
595
|
});
|
|
594
|
-
export {
|
|
596
|
+
export { de as a, F as i, U as n, N as o, me as r, J as t };
|
|
595
597
|
|
|
596
|
-
//# sourceMappingURL=MMenuItem-
|
|
598
|
+
//# sourceMappingURL=MMenuItem-CEIKYvaX.js.map
|