@m3ui-vue/m3ui-vue 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +34 -19
- package/dist/MButton-LiZRRP4h.js +171 -0
- package/dist/MButton-LiZRRP4h.js.map +1 -0
- package/dist/{MColorPickerModal-H8nuX0Wu.js → MColorPickerModal-IjciC8zh.js} +185 -184
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/MDialog-BLpfgIA3.js +167 -0
- package/dist/MDialog-BLpfgIA3.js.map +1 -0
- package/dist/MIcon-BSsJZhK7.js +116 -0
- package/dist/MIcon-BSsJZhK7.js.map +1 -0
- package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
- package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
- package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
- package/dist/MListItem-BBQ-6i3v.js.map +1 -0
- package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
- package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
- package/dist/MMenuItem-E31tMzOt.js +577 -0
- package/dist/MMenuItem-E31tMzOt.js.map +1 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js +1866 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js.map +1 -0
- package/dist/MProgressBar-CPrZhQbA.js +179 -0
- package/dist/MProgressBar-CPrZhQbA.js.map +1 -0
- package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
- package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
- package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
- package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
- package/dist/MSignaturePad-Bqr-1R9f.js +140 -0
- package/dist/MSignaturePad-Bqr-1R9f.js.map +1 -0
- package/dist/MSlider-B7dIcHVn.js +745 -0
- package/dist/MSlider-B7dIcHVn.js.map +1 -0
- package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
- package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
- package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
- package/dist/MTextField-CryHMs8-.js.map +1 -0
- package/dist/MTooltip-Cn_DYm9M.js +90 -0
- package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
- package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
- package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
- package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
- package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +129 -128
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
- package/dist/components/MBadge.vue.d.ts +2 -2
- package/dist/components/MBar.vue.d.ts +1 -1
- package/dist/components/MBeforeAfter.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MContainerTransform.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +1 -1
- package/dist/components/MCreditCardInput.vue.d.ts +2 -2
- package/dist/components/MDiffViewer.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +2 -2
- package/dist/components/MExpansionPanel.vue.d.ts +1 -1
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +1 -1
- package/dist/components/MFilterBuilder.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +2 -2
- package/dist/components/MFormRenderer.vue.d.ts +2 -2
- package/dist/components/MGantt.vue.d.ts +2 -2
- package/dist/components/MGanttControls.vue.d.ts +1 -1
- package/dist/components/MGrid.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -5
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MMapMeasure.vue.d.ts +2 -2
- package/dist/components/MMenu.vue.d.ts +6 -3
- package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MOdontogram.vue.d.ts +2 -2
- package/dist/components/MPdfSigner.vue.d.ts +1 -1
- package/dist/components/MPhoneInput.vue.d.ts +2 -2
- package/dist/components/MPinInput.vue.d.ts +3 -3
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MProductConfigurator.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +2 -2
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchBar.vue.d.ts +2 -2
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeatMap.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +2 -2
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +2 -2
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSubtitle.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +3 -3
- package/dist/components/MTimeScroll.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +2 -2
- package/dist/components/MVitalsChart.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
- package/dist/composables/_fieldLayout.d.ts +8 -8
- package/dist/composables/_popupPosition.d.ts +3 -2
- package/dist/composables/_rtl.d.ts +26 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +4 -0
- package/dist/draw.js +5 -5
- package/dist/flow.js +2 -2
- package/dist/gantt.js +3 -3
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +768 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +11962 -12039
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +1127 -1149
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/media.js +7 -7
- package/dist/pdf-sign.d.ts +3 -0
- package/dist/pdf-sign.js +548 -0
- package/dist/pdf-sign.js.map +1 -0
- package/dist/pdf.d.ts +0 -3
- package/dist/pdf.js +1 -2400
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -77
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +5 -2
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
- package/dist/useLocale-ybIju59R.js.map +1 -0
- package/dist/vTooltip-xESB2YOb.js +154 -0
- package/dist/vTooltip-xESB2YOb.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MAddressField.test.ts +1 -1
- package/src/__tests__/MChip.test.ts +3 -3
- package/src/__tests__/MFab.test.ts +6 -6
- package/src/__tests__/MListItemNestedControl.test.ts +2 -2
- package/src/__tests__/MScheduler.test.ts +1 -1
- package/src/__tests__/MTrackingTimeline.test.ts +1 -1
- package/src/__tests__/MWindow.test.ts +16 -0
- package/src/__tests__/fieldOverflow.test.ts +9 -9
- package/src/__tests__/hydration.test.ts +39 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/rtl.test.ts +167 -0
- package/src/__tests__/ssr.test.ts +6 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MAutocomplete.vue +7 -7
- package/src/components/MAvailabilityCalendar.vue +5 -3
- package/src/components/MBadge.vue +12 -3
- package/src/components/MBar.vue +1 -1
- package/src/components/MBottomAppBar.vue +1 -1
- package/src/components/MCalendar.vue +3 -3
- package/src/components/MCalendarHeatmap.vue +3 -3
- package/src/components/MChatBubble.vue +3 -3
- package/src/components/MChip.vue +6 -6
- package/src/components/MCodeEditor.vue +7 -3
- package/src/components/MColorPicker.vue +1 -1
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContainerTransform.vue +1 -1
- package/src/components/MContextMenu.vue +1 -1
- package/src/components/MDataTable.vue +5 -5
- package/src/components/MDatePicker.vue +3 -2
- package/src/components/MDateRangePicker.vue +3 -2
- package/src/components/MDialog.vue +5 -5
- package/src/components/MDiffViewer.vue +1 -1
- package/src/components/MDivider.vue +1 -1
- package/src/components/MDragDropList.vue +1 -1
- package/src/components/MEmojiSelector.vue +11 -7
- package/src/components/MExpansionPanel.vue +1 -1
- package/src/components/MFab.vue +5 -5
- package/src/components/MFormBuilder.vue +3 -3
- package/src/components/MIcon.vue +14 -2
- package/src/components/MJsonEditor.vue +1 -3
- package/src/components/MJsonViewer.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MListDetail.vue +2 -2
- package/src/components/MListGroup.vue +1 -1
- package/src/components/MListItem.vue +5 -5
- package/src/components/MListSubheader.vue +1 -1
- package/src/components/MMapDraw.vue +3 -2
- package/src/components/MMapHover.vue +2 -1
- package/src/components/MMapMeasure.vue +2 -1
- package/src/components/MMapRoute.vue +2 -1
- package/src/components/MMarkdown.vue +9 -6
- package/src/components/MMaskField.vue +6 -6
- package/src/components/MMenu.vue +13 -6
- package/src/components/MMenuItem.vue +8 -6
- package/src/components/MMultiAutocomplete.vue +9 -8
- package/src/components/MMultiSelect.vue +9 -8
- package/src/components/MNavigationDrawer.vue +39 -27
- package/src/components/MNavigationRail.vue +28 -19
- package/src/components/MNavigationSuite.vue +1 -1
- package/src/components/MNotificationCenter.vue +1 -1
- package/src/components/MNotificationHost.vue +1 -1
- package/src/components/MNumberField.vue +6 -6
- package/src/components/MOrderTicket.vue +1 -1
- package/src/components/MPageProgress.vue +1 -1
- package/src/components/MPdfSigner.vue +1 -1
- package/src/components/MPhoneInput.vue +5 -4
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MPosKeypad.vue +2 -1
- package/src/components/MProductConfigurator.vue +2 -1
- package/src/components/MProgressBar.vue +2 -2
- package/src/components/MRichTextEditor.vue +8 -4
- package/src/components/MScheduler.vue +14 -14
- package/src/components/MSearchField.vue +1 -1
- package/src/components/MSeatMap.vue +2 -1
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSelect.vue +7 -7
- package/src/components/MSideSheet.vue +3 -2
- package/src/components/MSimpleCarousel.vue +20 -11
- package/src/components/MSlider.vue +15 -5
- package/src/components/MSnackbar.vue +2 -2
- package/src/components/MSplitButton.vue +3 -2
- package/src/components/MSplitter.vue +6 -3
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +5 -5
- package/src/components/MTable.vue +3 -3
- package/src/components/MTabs.vue +4 -1
- package/src/components/MTagInput.vue +6 -6
- package/src/components/MTerminal.vue +1 -1
- package/src/components/MText.vue +1 -1
- package/src/components/MTextField.vue +7 -7
- package/src/components/MTimePicker.vue +3 -2
- package/src/components/MTimePickerModal.vue +2 -2
- package/src/components/MTimeScroll.vue +1 -1
- package/src/components/MTimeline.vue +12 -12
- package/src/components/MToolbar.vue +3 -3
- package/src/components/MTrackingTimeline.vue +3 -2
- package/src/components/MTransition.vue +8 -3
- package/src/components/MTreeTable.vue +1 -1
- package/src/components/MTypewriter.vue +1 -1
- package/src/components/MVirtualTable.vue +2 -2
- package/src/components/MWindow.vue +4 -3
- package/src/components/_MColorPanel.vue +5 -4
- package/src/components/_MDrawerItemList.vue +9 -5
- package/src/components/_MMapAttribution.vue +2 -1
- package/src/components/_MMonthYearButton.vue +1 -1
- package/src/components/_MTransferPane.vue +8 -1
- package/src/components/_MTreeNode.vue +3 -3
- package/src/components/_MYearGrid.vue +4 -2
- package/src/composables/_fieldLayout.ts +19 -19
- package/src/composables/_popupPosition.ts +5 -3
- package/src/composables/_rtl.ts +76 -0
- package/src/composables/_useMenuNav.ts +24 -17
- package/src/composables/_useSheetMotion.ts +10 -3
- package/src/composables/pdfSign.ts +2 -2
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/ar.ts +798 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/zh.ts +2 -0
- package/src/pdf-sign.ts +5 -0
- package/src/pdf.ts +0 -3
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-H8nuX0Wu.js.map +0 -1
- package/dist/MDialog-B42Mhn8W.js +0 -331
- package/dist/MDialog-B42Mhn8W.js.map +0 -1
- package/dist/MIcon-DpajuUTJ.js +0 -33
- package/dist/MIcon-DpajuUTJ.js.map +0 -1
- package/dist/MListItem-DiOAxaN7.js.map +0 -1
- package/dist/MMenuItem-BuxYoASE.js +0 -574
- package/dist/MMenuItem-BuxYoASE.js.map +0 -1
- package/dist/MSignaturePad-BTqGaPXA.js +0 -313
- package/dist/MSignaturePad-BTqGaPXA.js.map +0 -1
- package/dist/MSlider-D_O8J9YH.js +0 -739
- package/dist/MSlider-D_O8J9YH.js.map +0 -1
- package/dist/MTextField-CYk9yFvi.js.map +0 -1
- package/dist/MTooltip-CK39Zon4.js +0 -183
- package/dist/MTooltip-CK39Zon4.js.map +0 -1
- package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
- package/dist/pdf.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { r as e, t } from "./MIcon-BSsJZhK7.js";
|
|
2
|
+
import { a as n, f as r, i, l as a, s as o, u as s } from "./MIconButton-CNjN0xwW.js";
|
|
3
|
+
import { i as c } from "./motion-BcejVTeX.js";
|
|
4
|
+
import { n as l, r as u, t as d } from "./_popupPosition-C_lxj9qU.js";
|
|
5
|
+
import { Fragment as f, Teleport as p, Transition as ee, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createVNode as y, defineComponent as b, inject as te, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onMounted as ne, onUnmounted as re, openBlock as T, provide as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, toDisplayString as j, unref as M, useSlots as ie, watch as ae, withCtx as oe } from "vue";
|
|
6
|
+
// src/components/MMenuDivider.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var N = { class: "my-1 border-outline-variant" }, se = /* @__PURE__ */ b({
|
|
8
|
+
__name: "MMenuDivider",
|
|
9
|
+
props: { gap: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !1
|
|
12
|
+
} },
|
|
13
|
+
setup(e) {
|
|
14
|
+
return (e, t) => (T(), _("hr", N));
|
|
15
|
+
}
|
|
16
|
+
}), ce = 30, P = 380, le = 8, F = 1 / 3, ue = .5;
|
|
17
|
+
function I(t) {
|
|
18
|
+
let n = D([]), i = m(() => n.value[n.value.length - 1]), o = D("forward"), l = D(), u = 0, d = 1, f = () => e(l.value) ? -1 : 1;
|
|
19
|
+
function p(e, t) {
|
|
20
|
+
let n = (o.value === "forward" ? 1 : -1) * f(), r = e.animate([{
|
|
21
|
+
transform: `translateX(${n * ce}px)`,
|
|
22
|
+
opacity: 0
|
|
23
|
+
}, {
|
|
24
|
+
transform: "translateX(0)",
|
|
25
|
+
opacity: 1
|
|
26
|
+
}], {
|
|
27
|
+
duration: 300,
|
|
28
|
+
delay: 60,
|
|
29
|
+
easing: "cubic-bezier(0.05,0.7,0.1,1)",
|
|
30
|
+
fill: "backwards"
|
|
31
|
+
});
|
|
32
|
+
r.onfinish = t;
|
|
33
|
+
}
|
|
34
|
+
function ee(e, t) {
|
|
35
|
+
let n = (o.value === "forward" ? -1 : 1) * f(), r = e;
|
|
36
|
+
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
37
|
+
let i = u, a = d;
|
|
38
|
+
u = 0, d = 1;
|
|
39
|
+
let s = r.animate([{
|
|
40
|
+
transform: `translateX(${i}px)`,
|
|
41
|
+
opacity: a
|
|
42
|
+
}, {
|
|
43
|
+
transform: `translateX(${i + n * ce}px)`,
|
|
44
|
+
opacity: 0
|
|
45
|
+
}], {
|
|
46
|
+
duration: 90,
|
|
47
|
+
easing: "cubic-bezier(0.3,0,0.8,0.15)",
|
|
48
|
+
fill: "forwards"
|
|
49
|
+
});
|
|
50
|
+
s.onfinish = t;
|
|
51
|
+
}
|
|
52
|
+
function h(e) {
|
|
53
|
+
let t = l.value, n = t?.offsetHeight ?? 0, i = t?.style.overflowY ?? "";
|
|
54
|
+
t && (t.style.overflowY = "hidden");
|
|
55
|
+
let o = () => {
|
|
56
|
+
t && (t.style.overflowY = i);
|
|
57
|
+
};
|
|
58
|
+
if (e(), !t || s()) return o();
|
|
59
|
+
S(() => {
|
|
60
|
+
let e = t.offsetHeight, i = Math.abs(e - n) < 1 ? null : a(t, r(n, e, 0, c.standard.defaultSpatial, .5), (e) => ({ height: `${e}px` })), s = new Promise((e) => setTimeout(e, P));
|
|
61
|
+
Promise.all([s, i?.finished.catch(() => {})]).then(o);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function g(e) {
|
|
65
|
+
o.value = "forward", h(() => n.value.push(e)), S(t);
|
|
66
|
+
}
|
|
67
|
+
function _() {
|
|
68
|
+
o.value = "backward", h(() => n.value.pop()), S(t);
|
|
69
|
+
}
|
|
70
|
+
function v() {
|
|
71
|
+
n.value = [];
|
|
72
|
+
}
|
|
73
|
+
let y = null;
|
|
74
|
+
function b() {
|
|
75
|
+
return l.value?.querySelector(`:scope > [data-menu-level="${n.value.length}"]`) ?? null;
|
|
76
|
+
}
|
|
77
|
+
function te(e) {
|
|
78
|
+
if (e.pointerType !== "touch" || !n.value.length || y) return;
|
|
79
|
+
let t = b();
|
|
80
|
+
if (!t) return;
|
|
81
|
+
let r = f();
|
|
82
|
+
y = {
|
|
83
|
+
id: e.pointerId,
|
|
84
|
+
x: e.clientX * r,
|
|
85
|
+
y: e.clientY,
|
|
86
|
+
level: t,
|
|
87
|
+
width: l.value.clientWidth,
|
|
88
|
+
active: !1,
|
|
89
|
+
lastX: e.clientX * r,
|
|
90
|
+
lastT: e.timeStamp,
|
|
91
|
+
vel: 0,
|
|
92
|
+
sign: r
|
|
93
|
+
}, window.addEventListener("pointermove", C), window.addEventListener("pointerup", w), window.addEventListener("pointercancel", ne);
|
|
94
|
+
}
|
|
95
|
+
function x(e) {
|
|
96
|
+
y && (y.level.style.transform = `translateX(${e * y.sign}px)`, y.level.style.opacity = String(1 - .5 * Math.min(1, e / y.width)));
|
|
97
|
+
}
|
|
98
|
+
function C(e) {
|
|
99
|
+
if (!y || e.pointerId !== y.id) return;
|
|
100
|
+
let t = e.clientX * y.sign, n = t - y.x, r = e.clientY - y.y;
|
|
101
|
+
if (!y.active) {
|
|
102
|
+
if (Math.hypot(n, r) < le) return;
|
|
103
|
+
if (Math.abs(r) > Math.abs(n) || n < 0) return A();
|
|
104
|
+
y.active = !0, y.x = t, y.level.getAnimations().forEach((e) => e.finish());
|
|
105
|
+
}
|
|
106
|
+
let i = e.timeStamp - y.lastT;
|
|
107
|
+
i > 0 && (y.vel = .8 * ((t - y.lastX) / i) + .2 * y.vel), y.lastX = t, y.lastT = e.timeStamp, x(Math.max(0, t - y.x));
|
|
108
|
+
}
|
|
109
|
+
function w(e) {
|
|
110
|
+
if (!y || e.pointerId !== y.id) return;
|
|
111
|
+
let t = y;
|
|
112
|
+
if (A(), !t.active) return;
|
|
113
|
+
window.addEventListener("click", k, {
|
|
114
|
+
capture: !0,
|
|
115
|
+
once: !0
|
|
116
|
+
}), clearTimeout(E), E = setTimeout(O, 400);
|
|
117
|
+
let n = Math.max(0, e.clientX * t.sign - t.x);
|
|
118
|
+
n > t.width * F || t.vel > ue ? (u = n * t.sign, d = Number(t.level.style.opacity || 1), _()) : T(t.level, n, t.sign);
|
|
119
|
+
}
|
|
120
|
+
function ne(e) {
|
|
121
|
+
if (!y || e.pointerId !== y.id) return;
|
|
122
|
+
let t = y;
|
|
123
|
+
A(), t.active && T(t.level, Math.max(0, t.lastX - t.x), t.sign);
|
|
124
|
+
}
|
|
125
|
+
function T(e, t, n) {
|
|
126
|
+
if (e.style.transform = "", e.style.opacity = "", s() || t < 1) return;
|
|
127
|
+
let i = l.value?.clientWidth || 1;
|
|
128
|
+
a(e, r(t, 0, 0, c.standard.defaultSpatial, .5), (e) => ({
|
|
129
|
+
transform: `translateX(${e * n}px)`,
|
|
130
|
+
opacity: String(1 - .5 * Math.min(1, e / i))
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
let E;
|
|
134
|
+
function O() {
|
|
135
|
+
clearTimeout(E), window.removeEventListener("click", k, { capture: !0 });
|
|
136
|
+
}
|
|
137
|
+
function k(e) {
|
|
138
|
+
e.stopPropagation(), e.preventDefault();
|
|
139
|
+
}
|
|
140
|
+
function A() {
|
|
141
|
+
y = null, window.removeEventListener("pointermove", C), window.removeEventListener("pointerup", w), window.removeEventListener("pointercancel", ne);
|
|
142
|
+
}
|
|
143
|
+
return re(() => {
|
|
144
|
+
A(), O();
|
|
145
|
+
}), {
|
|
146
|
+
navStack: n,
|
|
147
|
+
currentNav: i,
|
|
148
|
+
navBox: l,
|
|
149
|
+
navSlideEnter: p,
|
|
150
|
+
navSlideLeave: ee,
|
|
151
|
+
pushNav: g,
|
|
152
|
+
popNav: _,
|
|
153
|
+
resetNav: v,
|
|
154
|
+
onNavPointerDown: te
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
// src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
|
|
158
|
+
var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root" }, B = {
|
|
159
|
+
key: 0,
|
|
160
|
+
class: "flex flex-col gap-1 px-1.5"
|
|
161
|
+
}, V = { class: "overflow-hidden rounded-lg bg-surface-container" }, H = 1 / 240, U = /* @__PURE__ */ b({
|
|
162
|
+
inheritAttrs: !1,
|
|
163
|
+
__name: "MMenu",
|
|
164
|
+
props: {
|
|
165
|
+
align: { default: "end" },
|
|
166
|
+
submenuMode: { default: "flyout" },
|
|
167
|
+
variant: { default: "standard" }
|
|
168
|
+
},
|
|
169
|
+
setup(n, { expose: r }) {
|
|
170
|
+
let i = n, a = ie();
|
|
171
|
+
function o(e) {
|
|
172
|
+
let t = [];
|
|
173
|
+
for (let n of e) n.type === f && Array.isArray(n.children) ? t.push(...o(n.children)) : t.push(n);
|
|
174
|
+
return t;
|
|
175
|
+
}
|
|
176
|
+
function s(e) {
|
|
177
|
+
if (e.type !== se) return !1;
|
|
178
|
+
let t = e.props?.gap;
|
|
179
|
+
return t === "" || t === !0 || t === "true";
|
|
180
|
+
}
|
|
181
|
+
let c = m(() => {
|
|
182
|
+
if (i.variant !== "expressive") return null;
|
|
183
|
+
let e = o(a.default?.({ close: $ }) ?? []), t = [[]];
|
|
184
|
+
for (let n of e) s(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
185
|
+
return t.filter((e) => e.length > 0);
|
|
186
|
+
}), l = m(() => !!c.value && c.value.length > 1), { navStack: b, currentNav: j, navBox: N, navSlideEnter: ce, navSlideLeave: P, pushNav: le, popNav: F, onNavPointerDown: ue } = I(() => xe()), U = null;
|
|
187
|
+
function de() {
|
|
188
|
+
if (U) return U;
|
|
189
|
+
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
190
|
+
for (let a = 0; a < 1 && (e.push({
|
|
191
|
+
scale: t,
|
|
192
|
+
alpha: r
|
|
193
|
+
}), n += (-1400 * (t - 1) - 1.8 * Math.sqrt(1400) * n) * H, t += n * H, i += (-3800 * (r - 1) - 2 * Math.sqrt(3800) * i) * H, r += i * H, !(Math.abs(t - 1) < .003 && Math.abs(r - 1) < .003)); a += H);
|
|
194
|
+
return e.push({
|
|
195
|
+
scale: 1,
|
|
196
|
+
alpha: 1
|
|
197
|
+
}), U = e, e;
|
|
198
|
+
}
|
|
199
|
+
let fe = 0, W = null, G = null;
|
|
200
|
+
function pe(e, t, n) {
|
|
201
|
+
W?.();
|
|
202
|
+
let r = e, i = de(), a = i.length - 1, o = Math.round(Math.max(0, Math.min(a, fe))), s = n ? a : 0, c = n ? 1 : -1, l = [];
|
|
203
|
+
for (let e = o; n ? e <= s : e >= s; e += c) l.push(i[e]);
|
|
204
|
+
let u = (e) => ({
|
|
205
|
+
transform: `scale(${e.scale})`,
|
|
206
|
+
opacity: String(Math.min(1, Math.max(0, e.alpha)))
|
|
207
|
+
});
|
|
208
|
+
Object.assign(r.style, u(i[s]));
|
|
209
|
+
let d = !1;
|
|
210
|
+
function f() {
|
|
211
|
+
d || (d = !0, fe = s, W = null, G = null, t());
|
|
212
|
+
}
|
|
213
|
+
if (l.length < 2 || typeof r.animate != "function") return f();
|
|
214
|
+
let p = r.animate(l.map(u), {
|
|
215
|
+
duration: (l.length - 1) * H * 1e3,
|
|
216
|
+
easing: "linear"
|
|
217
|
+
});
|
|
218
|
+
p.finished.catch(() => {}), p.onfinish = f, W = () => {
|
|
219
|
+
let e = Number(p.currentTime ?? 0) / (H * 1e3);
|
|
220
|
+
fe = Math.max(0, Math.min(a, o + c * e)), d = !0, p.cancel();
|
|
221
|
+
}, G = n ? null : () => {
|
|
222
|
+
W?.(), W = null, G = null, t();
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function me(e, t) {
|
|
226
|
+
ye(e), pe(e, t, !0);
|
|
227
|
+
}
|
|
228
|
+
function he(e, t) {
|
|
229
|
+
pe(e, t, !1);
|
|
230
|
+
}
|
|
231
|
+
let K = D(!1), q = D(null), J = D(null), Y = D({}), X = te("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
232
|
+
E("m-menu-panel-registry", X), ae(J, (e, t) => {
|
|
233
|
+
t && X.delete(t), e && X.add(e);
|
|
234
|
+
}), re(() => {
|
|
235
|
+
J.value && X.delete(J.value);
|
|
236
|
+
});
|
|
237
|
+
let Z = te("m-menu-sibling-group", null);
|
|
238
|
+
E("m-menu-sibling-group", { current: null });
|
|
239
|
+
let Q = null, ge = D(!1);
|
|
240
|
+
function _e() {
|
|
241
|
+
if (!q.value) return;
|
|
242
|
+
let e = q.value.getBoundingClientRect();
|
|
243
|
+
Q = e;
|
|
244
|
+
let t = window.innerHeight - e.bottom - 8;
|
|
245
|
+
ge.value = t < 200 && e.top > t;
|
|
246
|
+
let n = {
|
|
247
|
+
maxHeight: `${Math.min(ge.value ? e.top - 12 : t, 400)}px`,
|
|
248
|
+
maxWidth: `${window.innerWidth - 16}px`,
|
|
249
|
+
left: "0px"
|
|
250
|
+
};
|
|
251
|
+
ge.value ? n.bottom = `${window.innerHeight - e.top + 4}px` : n.top = `${e.bottom + 4}px`, Y.value = n;
|
|
252
|
+
}
|
|
253
|
+
let ve = D(i.align === "right" || i.align === "end" && !e() || i.align === "start" && e() ? "right" : "left");
|
|
254
|
+
function ye(t) {
|
|
255
|
+
if (!Q) return;
|
|
256
|
+
let n = t.offsetWidth, r = e(), a = i.align === "left" ? r ? "end" : "start" : i.align === "right" ? r ? "start" : "end" : i.align, o = d(Q, n, window.innerWidth, a, void 0, r), s = Math.min(n, Math.max(0, (Q.left + Q.right) / 2 - o)), c = Math.abs(o - Q.left) < 1 ? "left" : Math.abs(o + n - Q.right) < 1 ? "right" : `${s}px`;
|
|
257
|
+
ve.value = c, Y.value = {
|
|
258
|
+
...Y.value,
|
|
259
|
+
left: `${o}px`
|
|
260
|
+
}, t.style.left = `${o}px`, t.style.transformOrigin = `${c} ${ge.value ? "bottom" : "top"}`;
|
|
261
|
+
}
|
|
262
|
+
function be() {
|
|
263
|
+
return J.value ? Array.from(J.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
264
|
+
}
|
|
265
|
+
function xe() {
|
|
266
|
+
S(() => be()[0]?.focus());
|
|
267
|
+
}
|
|
268
|
+
function Se(e) {
|
|
269
|
+
let t = be();
|
|
270
|
+
if (!t.length) return;
|
|
271
|
+
let n = t.indexOf(document.activeElement);
|
|
272
|
+
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
273
|
+
}
|
|
274
|
+
function Ce() {
|
|
275
|
+
K.value ? Z?.current === $ && (Z.current = null) : (Z && Z.current && Z.current !== $ && Z.current(), Z && (Z.current = $), _e(), b.value = []), K.value = !K.value, K.value && xe();
|
|
276
|
+
}
|
|
277
|
+
function $() {
|
|
278
|
+
Z?.current === $ && (Z.current = null), K.value = !1;
|
|
279
|
+
}
|
|
280
|
+
E("m-menu-close", $), E("m-menu-nav", {
|
|
281
|
+
mode: i.submenuMode,
|
|
282
|
+
push: le
|
|
283
|
+
}), r({
|
|
284
|
+
close: $,
|
|
285
|
+
open: K
|
|
286
|
+
});
|
|
287
|
+
function we(e) {
|
|
288
|
+
let t = e.target;
|
|
289
|
+
if (!q.value?.contains(t)) {
|
|
290
|
+
for (let e of X) if (e.contains(t)) return;
|
|
291
|
+
t.closest?.(".m3-submenu") || $();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function Te(e) {
|
|
295
|
+
if (!K.value) return;
|
|
296
|
+
let t = e.target;
|
|
297
|
+
for (let e of X) if (e.contains(t)) return;
|
|
298
|
+
t.closest?.(".m3-submenu") || $();
|
|
299
|
+
}
|
|
300
|
+
u(() => K.value, () => b.value.length ? F() : $());
|
|
301
|
+
function Ee(e) {
|
|
302
|
+
K.value && (e.key === "ArrowDown" ? (e.preventDefault(), Se(1)) : e.key === "ArrowUp" && (e.preventDefault(), Se(-1)));
|
|
303
|
+
}
|
|
304
|
+
ne(() => {
|
|
305
|
+
document.addEventListener("mousedown", we), document.addEventListener("keydown", Ee), window.addEventListener("scroll", Te, !0);
|
|
306
|
+
}), re(() => {
|
|
307
|
+
document.removeEventListener("mousedown", we), document.removeEventListener("keydown", Ee), window.removeEventListener("scroll", Te, !0), G ? G() : W?.();
|
|
308
|
+
});
|
|
309
|
+
let De = m(() => `${ve.value} ${ge.value ? "bottom" : "top"}`);
|
|
310
|
+
return (e, r) => (T(), _(f, null, [v("div", x({
|
|
311
|
+
ref_key: "triggerEl",
|
|
312
|
+
ref: q
|
|
313
|
+
}, e.$attrs, {
|
|
314
|
+
class: "inline-block",
|
|
315
|
+
onClick: Ce
|
|
316
|
+
}), [k(e.$slots, "trigger", { open: K.value })], 16), (T(), h(p, { to: "body" }, [y(ee, {
|
|
317
|
+
css: !1,
|
|
318
|
+
onEnter: me,
|
|
319
|
+
onLeave: he
|
|
320
|
+
}, {
|
|
321
|
+
default: oe(() => [K.value ? (T(), _("div", {
|
|
322
|
+
key: 0,
|
|
323
|
+
ref_key: "dropdownEl",
|
|
324
|
+
ref: J,
|
|
325
|
+
class: C(["fixed z-500 min-w-48", [n.variant === "expressive" ? "rounded-lg" : "rounded-xs", l.value ? "" : "shadow-elevation-2"]]),
|
|
326
|
+
style: w({
|
|
327
|
+
...Y.value,
|
|
328
|
+
transformOrigin: De.value
|
|
329
|
+
})
|
|
330
|
+
}, [v("div", { class: C(["overflow-hidden", [n.variant === "expressive" ? "rounded-lg" : "rounded-xs", l.value ? "" : "bg-surface-container"]]) }, [v("div", {
|
|
331
|
+
ref_key: "navBox",
|
|
332
|
+
ref: N,
|
|
333
|
+
class: "relative overflow-x-hidden overflow-y-auto overscroll-contain py-1",
|
|
334
|
+
style: w({
|
|
335
|
+
maxHeight: Y.value.maxHeight,
|
|
336
|
+
touchAction: M(j) ? "pan-y" : void 0
|
|
337
|
+
}),
|
|
338
|
+
onPointerdown: r[1] ||= (...e) => M(ue) && M(ue)(...e)
|
|
339
|
+
}, [y(ee, {
|
|
340
|
+
css: !1,
|
|
341
|
+
onEnter: M(ce),
|
|
342
|
+
onLeave: M(P)
|
|
343
|
+
}, {
|
|
344
|
+
default: oe(() => [M(j) ? (T(), _("div", {
|
|
345
|
+
key: M(b).length,
|
|
346
|
+
"data-menu-level": M(b).length
|
|
347
|
+
}, [
|
|
348
|
+
v("button", {
|
|
349
|
+
type: "button",
|
|
350
|
+
class: "flex w-full items-center gap-3 px-4 py-2.5 text-start 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",
|
|
351
|
+
onClick: r[0] ||= (...e) => M(F) && M(F)(...e)
|
|
352
|
+
}, [y(t, {
|
|
353
|
+
name: "arrow_back",
|
|
354
|
+
size: 20,
|
|
355
|
+
class: "shrink-0"
|
|
356
|
+
}), v("span", R, [(T(), h(A(() => M(j)?.header?.())))])]),
|
|
357
|
+
r[2] ||= v("hr", { class: "my-1 border-outline-variant" }, null, -1),
|
|
358
|
+
(T(), h(A(() => M(j)?.content?.())))
|
|
359
|
+
], 8, L)) : (T(), _("div", z, [l.value ? (T(), _("div", B, [(T(!0), _(f, null, O(c.value, (e, t) => (T(), _("div", {
|
|
360
|
+
key: t,
|
|
361
|
+
class: "rounded-lg shadow-elevation-2"
|
|
362
|
+
}, [v("div", V, [(T(), h(A(() => e)))])]))), 128))])) : k(e.$slots, "default", { close: $ }, void 0, void 0, 1)]))]),
|
|
363
|
+
_: 3
|
|
364
|
+
}, 8, ["onEnter", "onLeave"])], 36)], 2)], 6)) : g("", !0)]),
|
|
365
|
+
_: 3
|
|
366
|
+
})]))], 64));
|
|
367
|
+
}
|
|
368
|
+
}), de = ["data-m3-menu-choice"], fe = { class: "flex-1" }, W = {
|
|
369
|
+
key: 3,
|
|
370
|
+
class: "ms-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
371
|
+
}, G = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, pe = 32, me = /* @__PURE__ */ b({
|
|
372
|
+
__name: "MMenuItem",
|
|
373
|
+
props: {
|
|
374
|
+
icon: {},
|
|
375
|
+
shortcut: {},
|
|
376
|
+
to: {},
|
|
377
|
+
disabled: {
|
|
378
|
+
type: Boolean,
|
|
379
|
+
default: !1
|
|
380
|
+
},
|
|
381
|
+
danger: {
|
|
382
|
+
type: Boolean,
|
|
383
|
+
default: !1
|
|
384
|
+
},
|
|
385
|
+
keepOpen: {
|
|
386
|
+
type: Boolean,
|
|
387
|
+
default: void 0
|
|
388
|
+
},
|
|
389
|
+
selected: {
|
|
390
|
+
type: Boolean,
|
|
391
|
+
default: void 0
|
|
392
|
+
},
|
|
393
|
+
checked: {
|
|
394
|
+
type: Boolean,
|
|
395
|
+
default: void 0
|
|
396
|
+
},
|
|
397
|
+
selectedIcon: {}
|
|
398
|
+
},
|
|
399
|
+
emits: ["click", "update:checked"],
|
|
400
|
+
setup(r, { emit: a }) {
|
|
401
|
+
let s = r, c = a, u = ie(), d = m(() => s.checked !== void 0), f = m(() => d.value || s.selected !== void 0), b = m(() => !!(s.checked ?? s.selected)), x = m(() => f.value && !s.icon && !u.icon), E = m(() => s.selectedIcon ?? (s.icon ? void 0 : "check")), O = D("single");
|
|
402
|
+
function N() {
|
|
403
|
+
let e = L.value;
|
|
404
|
+
if (!e || !f.value) return;
|
|
405
|
+
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
406
|
+
O.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
407
|
+
}
|
|
408
|
+
function se() {
|
|
409
|
+
if (b.value) return [
|
|
410
|
+
12,
|
|
411
|
+
12,
|
|
412
|
+
12,
|
|
413
|
+
12
|
|
414
|
+
];
|
|
415
|
+
let e = O.value === "first" ? 12 : 4, t = O.value === "last" ? 12 : 4;
|
|
416
|
+
return [
|
|
417
|
+
e,
|
|
418
|
+
e,
|
|
419
|
+
t,
|
|
420
|
+
t
|
|
421
|
+
];
|
|
422
|
+
}
|
|
423
|
+
let { snap: ce } = o(() => f.value ? [...se(), x.value && b.value ? pe : 0] : [], ([e, t, n, r, i]) => {
|
|
424
|
+
let a = R.value instanceof HTMLElement ? R.value : R.value?.$el;
|
|
425
|
+
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`);
|
|
426
|
+
}, n);
|
|
427
|
+
ae(O, () => ce());
|
|
428
|
+
let P = null;
|
|
429
|
+
ne(() => {
|
|
430
|
+
N();
|
|
431
|
+
let e = L.value?.parentElement;
|
|
432
|
+
e && (P = new MutationObserver(N), P.observe(e, { childList: !0 }));
|
|
433
|
+
}), re(() => P?.disconnect()), ae(f, () => S(N)), o(() => x.value ? [+!!b.value] : [], ([e]) => {
|
|
434
|
+
z.value && e !== void 0 && (z.value.style.opacity = String(e));
|
|
435
|
+
}, i);
|
|
436
|
+
let le = m(() => s.to ? "RouterLink" : "button"), F = m(() => !!u.children), ue = te("m-menu-close", null), I = te("m-menu-nav", null), L = D(), R = D(), z = D(), B = D(!1), V = D({});
|
|
437
|
+
function H() {
|
|
438
|
+
if (!L.value) return;
|
|
439
|
+
let e = L.value.getBoundingClientRect();
|
|
440
|
+
V.value = {
|
|
441
|
+
position: "fixed",
|
|
442
|
+
top: `${e.top}px`,
|
|
443
|
+
left: `${e.right}px`,
|
|
444
|
+
maxWidth: `${window.innerWidth - 16}px`,
|
|
445
|
+
zIndex: "501"
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function U(t) {
|
|
449
|
+
if (!L.value) return;
|
|
450
|
+
let n = t, r = L.value.getBoundingClientRect();
|
|
451
|
+
n.style.left = "0px";
|
|
452
|
+
let i = n.offsetWidth, a = n.offsetHeight, o = l(e(L.value) ? [r.left - i, r.right] : [r.right, r.left - i], i, window.innerWidth), s = l([r.top, r.bottom - a], a, window.innerHeight);
|
|
453
|
+
V.value = {
|
|
454
|
+
...V.value,
|
|
455
|
+
left: `${o}px`,
|
|
456
|
+
top: `${s}px`
|
|
457
|
+
}, n.style.left = `${o}px`, n.style.top = `${s}px`;
|
|
458
|
+
}
|
|
459
|
+
function me() {
|
|
460
|
+
B.value ? B.value = !1 : (H(), B.value = !0);
|
|
461
|
+
}
|
|
462
|
+
function he() {
|
|
463
|
+
s.disabled || (F.value ? I?.mode === "push" ? I.push({
|
|
464
|
+
icon: s.icon,
|
|
465
|
+
header: u.default,
|
|
466
|
+
content: u.children
|
|
467
|
+
}) : me() : (d.value && c("update:checked", !s.checked), c("click"), (s.keepOpen ?? d.value) || ue?.()));
|
|
468
|
+
}
|
|
469
|
+
function K(e) {
|
|
470
|
+
e.pointerType === "mouse" && F.value && !s.disabled && (H(), B.value = !0);
|
|
471
|
+
}
|
|
472
|
+
function q(e) {
|
|
473
|
+
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (B.value = !1));
|
|
474
|
+
}
|
|
475
|
+
function J(e) {
|
|
476
|
+
if (e.pointerType !== "mouse") return;
|
|
477
|
+
let t = e.relatedTarget;
|
|
478
|
+
t?.closest(".m3-submenu") || L.value?.contains(t) || (B.value = !1);
|
|
479
|
+
}
|
|
480
|
+
return (e, n) => (T(), _("div", {
|
|
481
|
+
ref_key: "itemEl",
|
|
482
|
+
ref: L,
|
|
483
|
+
"data-m3-menu-choice": f.value || void 0,
|
|
484
|
+
onPointerenter: K,
|
|
485
|
+
onPointerleave: q
|
|
486
|
+
}, [(T(), h(A(le.value), {
|
|
487
|
+
ref_key: "controlEl",
|
|
488
|
+
ref: R,
|
|
489
|
+
to: r.to || void 0,
|
|
490
|
+
type: r.to ? void 0 : "button",
|
|
491
|
+
role: f.value ? d.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
|
|
492
|
+
"aria-checked": f.value ? b.value : void 0,
|
|
493
|
+
class: C(["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", f.value ? [
|
|
494
|
+
"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",
|
|
495
|
+
b.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
|
|
496
|
+
r.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
|
|
497
|
+
] : [
|
|
498
|
+
"w-full px-4",
|
|
499
|
+
r.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
|
|
500
|
+
!r.disabled && r.danger ? "text-error hover:bg-error/8" : "",
|
|
501
|
+
!r.disabled && !r.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
502
|
+
]]),
|
|
503
|
+
disabled: r.disabled || void 0,
|
|
504
|
+
"aria-haspopup": F.value ? "menu" : void 0,
|
|
505
|
+
"aria-expanded": F.value ? B.value : void 0,
|
|
506
|
+
onClick: he
|
|
507
|
+
}, {
|
|
508
|
+
default: oe(() => [
|
|
509
|
+
x.value ? (T(), _("span", {
|
|
510
|
+
key: 0,
|
|
511
|
+
ref_key: "iconSlotEl",
|
|
512
|
+
ref: z,
|
|
513
|
+
class: "-me-3 flex shrink-0 overflow-hidden",
|
|
514
|
+
style: {
|
|
515
|
+
width: "0",
|
|
516
|
+
opacity: "0"
|
|
517
|
+
}
|
|
518
|
+
}, [y(t, {
|
|
519
|
+
name: E.value,
|
|
520
|
+
size: 20,
|
|
521
|
+
class: "shrink-0"
|
|
522
|
+
}, null, 8, ["name"])], 512)) : e.$slots.icon ? (T(), _("span", {
|
|
523
|
+
key: 1,
|
|
524
|
+
class: C(["flex size-5 shrink-0 items-center justify-center", f.value ? b.value ? "" : "text-on-surface-variant" : r.danger ? "text-error" : "text-on-surface-variant"])
|
|
525
|
+
}, [k(e.$slots, "icon", { on: b.value })], 2)) : r.icon ? (T(), h(t, {
|
|
526
|
+
key: 2,
|
|
527
|
+
name: b.value && E.value ? E.value : r.icon,
|
|
528
|
+
filled: b.value && !E.value,
|
|
529
|
+
size: 20,
|
|
530
|
+
class: C(["shrink-0", f.value ? b.value ? "" : "text-on-surface-variant" : r.danger ? "text-error" : "text-on-surface-variant"])
|
|
531
|
+
}, null, 8, [
|
|
532
|
+
"name",
|
|
533
|
+
"filled",
|
|
534
|
+
"class"
|
|
535
|
+
])) : g("", !0),
|
|
536
|
+
v("span", fe, [k(e.$slots, "default")]),
|
|
537
|
+
r.shortcut && !F.value ? (T(), _("span", W, j(r.shortcut), 1)) : g("", !0),
|
|
538
|
+
F.value ? (T(), h(t, {
|
|
539
|
+
key: 4,
|
|
540
|
+
name: "chevron_right",
|
|
541
|
+
size: 18,
|
|
542
|
+
class: "shrink-0 text-on-surface-variant"
|
|
543
|
+
})) : g("", !0)
|
|
544
|
+
]),
|
|
545
|
+
_: 3
|
|
546
|
+
}, 8, [
|
|
547
|
+
"to",
|
|
548
|
+
"type",
|
|
549
|
+
"role",
|
|
550
|
+
"aria-checked",
|
|
551
|
+
"class",
|
|
552
|
+
"disabled",
|
|
553
|
+
"aria-haspopup",
|
|
554
|
+
"aria-expanded"
|
|
555
|
+
])), F.value && M(I)?.mode !== "push" ? (T(), h(p, {
|
|
556
|
+
key: 0,
|
|
557
|
+
to: "body"
|
|
558
|
+
}, [y(ee, {
|
|
559
|
+
"enter-active-class": "transition-opacity duration-100",
|
|
560
|
+
"enter-from-class": "opacity-0",
|
|
561
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
562
|
+
"leave-to-class": "opacity-0",
|
|
563
|
+
onEnter: U
|
|
564
|
+
}, {
|
|
565
|
+
default: oe(() => [B.value ? (T(), _("div", {
|
|
566
|
+
key: 0,
|
|
567
|
+
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
568
|
+
style: w(V.value),
|
|
569
|
+
onPointerleave: J
|
|
570
|
+
}, [v("div", G, [k(e.$slots, "children")])], 36)) : g("", !0)]),
|
|
571
|
+
_: 3
|
|
572
|
+
})])) : g("", !0)], 40, de));
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
export { se as i, U as n, I as r, me as t };
|
|
576
|
+
|
|
577
|
+
//# sourceMappingURL=MMenuItem-E31tMzOt.js.map
|