@m3ui-vue/m3ui-vue 1.8.1 → 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 +26 -11
- package/dist/{MButton-B6eZTfFV.js → MButton-LiZRRP4h.js} +4 -4
- package/dist/{MButton-B6eZTfFV.js.map → MButton-LiZRRP4h.js.map} +1 -1
- package/dist/{MColorPickerModal-Dajjf6tH.js → MColorPickerModal-IjciC8zh.js} +185 -185
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/{MDialog-DQvE_JBv.js → MDialog-BLpfgIA3.js} +7 -7
- package/dist/{MDialog-DQvE_JBv.js.map → MDialog-BLpfgIA3.js.map} +1 -1
- 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-C5ngKPRM.js → MPdfViewer-B5Q9Xs9d.js} +9 -9
- package/dist/{MPdfViewer-C5ngKPRM.js.map → MPdfViewer-B5Q9Xs9d.js.map} +1 -1
- package/dist/{MProgressBar-BWly1UKN.js → MProgressBar-CPrZhQbA.js} +3 -3
- package/dist/{MProgressBar-BWly1UKN.js.map → MProgressBar-CPrZhQbA.js.map} +1 -1
- 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-CxOtelzE.js → MSignaturePad-Bqr-1R9f.js} +2 -2
- package/dist/{MSignaturePad-CxOtelzE.js.map → MSignaturePad-Bqr-1R9f.js.map} +1 -1
- 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/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 +11961 -12040
- 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.js +9 -9
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -78
- 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 +1 -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/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/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/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-Dajjf6tH.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/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/useLocale-DL96OFgr.js.map +0 -1
|
@@ -1,574 +0,0 @@
|
|
|
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
|
-
import { i as o } from "./motion-BcejVTeX.js";
|
|
3
|
-
import { t as s } from "./MIcon-DpajuUTJ.js";
|
|
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
|
-
// src/components/MMenuDivider.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var N = { class: "my-1 border-outline-variant" }, oe = /* @__PURE__ */ b({
|
|
8
|
-
__name: "MMenuDivider",
|
|
9
|
-
props: { gap: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: !1
|
|
12
|
-
} },
|
|
13
|
-
setup(e) {
|
|
14
|
-
return (e, t) => (E(), _("hr", N));
|
|
15
|
-
}
|
|
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
|
-
function d(e, t) {
|
|
20
|
-
let n = s.value === "forward" ? 1 : -1, r = e.animate([{
|
|
21
|
-
transform: `translateX(${n * se}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 f(e, t) {
|
|
35
|
-
let n = s.value === "forward" ? -1 : 1, r = e;
|
|
36
|
-
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
37
|
-
let i = l, a = u;
|
|
38
|
-
l = 0, u = 1;
|
|
39
|
-
let o = r.animate([{
|
|
40
|
-
transform: `translateX(${i}px)`,
|
|
41
|
-
opacity: a
|
|
42
|
-
}, {
|
|
43
|
-
transform: `translateX(${i + n * se}px)`,
|
|
44
|
-
opacity: 0
|
|
45
|
-
}], {
|
|
46
|
-
duration: 90,
|
|
47
|
-
easing: "cubic-bezier(0.3,0,0.8,0.15)",
|
|
48
|
-
fill: "forwards"
|
|
49
|
-
});
|
|
50
|
-
o.onfinish = t;
|
|
51
|
-
}
|
|
52
|
-
function p(e) {
|
|
53
|
-
let n = c.value, i = n?.offsetHeight ?? 0, s = n?.style.overflowY ?? "";
|
|
54
|
-
n && (n.style.overflowY = "hidden");
|
|
55
|
-
let l = () => {
|
|
56
|
-
n && (n.style.overflowY = s);
|
|
57
|
-
};
|
|
58
|
-
if (e(), !n || a()) return l();
|
|
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
|
-
Promise.all([s, a?.finished.catch(() => {})]).then(l);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function h(t) {
|
|
65
|
-
s.value = "forward", p(() => n.value.push(t)), C(e);
|
|
66
|
-
}
|
|
67
|
-
function g() {
|
|
68
|
-
s.value = "backward", p(() => n.value.pop()), C(e);
|
|
69
|
-
}
|
|
70
|
-
function _() {
|
|
71
|
-
n.value = [];
|
|
72
|
-
}
|
|
73
|
-
let v = null;
|
|
74
|
-
function y() {
|
|
75
|
-
return c.value?.querySelector(`:scope > [data-menu-level="${n.value.length}"]`) ?? null;
|
|
76
|
-
}
|
|
77
|
-
function b(e) {
|
|
78
|
-
if (e.pointerType !== "touch" || !n.value.length || v) return;
|
|
79
|
-
let t = y();
|
|
80
|
-
t && (v = {
|
|
81
|
-
id: e.pointerId,
|
|
82
|
-
x: e.clientX,
|
|
83
|
-
y: e.clientY,
|
|
84
|
-
level: t,
|
|
85
|
-
width: c.value.clientWidth,
|
|
86
|
-
active: !1,
|
|
87
|
-
lastX: e.clientX,
|
|
88
|
-
lastT: e.timeStamp,
|
|
89
|
-
vel: 0
|
|
90
|
-
}, window.addEventListener("pointermove", S), window.addEventListener("pointerup", w), window.addEventListener("pointercancel", T));
|
|
91
|
-
}
|
|
92
|
-
function x(e) {
|
|
93
|
-
v && (v.level.style.transform = `translateX(${e}px)`, v.level.style.opacity = String(1 - .5 * Math.min(1, e / v.width)));
|
|
94
|
-
}
|
|
95
|
-
function S(e) {
|
|
96
|
-
if (!v || e.pointerId !== v.id) return;
|
|
97
|
-
let t = e.clientX - v.x, n = e.clientY - v.y;
|
|
98
|
-
if (!v.active) {
|
|
99
|
-
if (Math.hypot(t, n) < ce) return;
|
|
100
|
-
if (Math.abs(n) > Math.abs(t) || t < 0) return A();
|
|
101
|
-
v.active = !0, v.x = e.clientX, v.level.getAnimations().forEach((e) => e.finish());
|
|
102
|
-
}
|
|
103
|
-
let r = e.timeStamp - v.lastT;
|
|
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
|
-
}
|
|
106
|
-
function w(e) {
|
|
107
|
-
if (!v || e.pointerId !== v.id) return;
|
|
108
|
-
let t = v;
|
|
109
|
-
if (A(), !t.active) return;
|
|
110
|
-
window.addEventListener("click", k, {
|
|
111
|
-
capture: !0,
|
|
112
|
-
once: !0
|
|
113
|
-
}), clearTimeout(E), E = setTimeout(D, 400);
|
|
114
|
-
let n = Math.max(0, e.clientX - t.x);
|
|
115
|
-
n > t.width * F || t.vel > le ? (l = n, u = Number(t.level.style.opacity || 1), g()) : ee(t.level, n);
|
|
116
|
-
}
|
|
117
|
-
function T(e) {
|
|
118
|
-
if (!v || e.pointerId !== v.id) return;
|
|
119
|
-
let t = v;
|
|
120
|
-
A(), t.active && ee(t.level, Math.max(0, t.lastX - t.x));
|
|
121
|
-
}
|
|
122
|
-
function ee(e, n) {
|
|
123
|
-
if (e.style.transform = "", e.style.opacity = "", a() || n < 1) return;
|
|
124
|
-
let i = c.value?.clientWidth || 1;
|
|
125
|
-
r(e, t(n, 0, 0, o.standard.defaultSpatial, .5), (e) => ({
|
|
126
|
-
transform: `translateX(${e}px)`,
|
|
127
|
-
opacity: String(1 - .5 * Math.min(1, e / i))
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
let E;
|
|
131
|
-
function D() {
|
|
132
|
-
clearTimeout(E), window.removeEventListener("click", k, { capture: !0 });
|
|
133
|
-
}
|
|
134
|
-
function k(e) {
|
|
135
|
-
e.stopPropagation(), e.preventDefault();
|
|
136
|
-
}
|
|
137
|
-
function A() {
|
|
138
|
-
v = null, window.removeEventListener("pointermove", S), window.removeEventListener("pointerup", w), window.removeEventListener("pointercancel", T);
|
|
139
|
-
}
|
|
140
|
-
return te(() => {
|
|
141
|
-
A(), D();
|
|
142
|
-
}), {
|
|
143
|
-
navStack: n,
|
|
144
|
-
currentNav: i,
|
|
145
|
-
navBox: c,
|
|
146
|
-
navSlideEnter: d,
|
|
147
|
-
navSlideLeave: f,
|
|
148
|
-
pushNav: h,
|
|
149
|
-
popNav: g,
|
|
150
|
-
resetNav: _,
|
|
151
|
-
onNavPointerDown: b
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
// src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
|
|
155
|
-
var L = ["data-menu-level"], R = { class: "flex-1 truncate" }, z = { key: "root" }, B = {
|
|
156
|
-
key: 0,
|
|
157
|
-
class: "flex flex-col gap-1 px-1.5"
|
|
158
|
-
}, V = { class: "overflow-hidden rounded-lg bg-surface-container" }, H = 1 / 240, U = /* @__PURE__ */ b({
|
|
159
|
-
inheritAttrs: !1,
|
|
160
|
-
__name: "MMenu",
|
|
161
|
-
props: {
|
|
162
|
-
align: { default: "right" },
|
|
163
|
-
submenuMode: { default: "flyout" },
|
|
164
|
-
variant: { default: "standard" }
|
|
165
|
-
},
|
|
166
|
-
setup(e, { expose: t }) {
|
|
167
|
-
let n = e, r = re();
|
|
168
|
-
function i(e) {
|
|
169
|
-
let t = [];
|
|
170
|
-
for (let n of e) n.type === d && Array.isArray(n.children) ? t.push(...i(n.children)) : t.push(n);
|
|
171
|
-
return t;
|
|
172
|
-
}
|
|
173
|
-
function a(e) {
|
|
174
|
-
if (e.type !== oe) return !1;
|
|
175
|
-
let t = e.props?.gap;
|
|
176
|
-
return t === "" || t === !0 || t === "true";
|
|
177
|
-
}
|
|
178
|
-
let o = m(() => {
|
|
179
|
-
if (n.variant !== "expressive") return null;
|
|
180
|
-
let e = i(r.default?.({ close: $ }) ?? []), t = [[]];
|
|
181
|
-
for (let n of e) a(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
182
|
-
return t.filter((e) => e.length > 0);
|
|
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;
|
|
184
|
-
function ue() {
|
|
185
|
-
if (U) return U;
|
|
186
|
-
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
187
|
-
for (let a = 0; a < 1 && (e.push({
|
|
188
|
-
scale: t,
|
|
189
|
-
alpha: r
|
|
190
|
-
}), 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);
|
|
191
|
-
return e.push({
|
|
192
|
-
scale: 1,
|
|
193
|
-
alpha: 1
|
|
194
|
-
}), U = e, e;
|
|
195
|
-
}
|
|
196
|
-
let de = 0, W = null, G = null;
|
|
197
|
-
function fe(e, t, n) {
|
|
198
|
-
W?.();
|
|
199
|
-
let r = e, i = ue(), a = i.length - 1, o = Math.round(Math.max(0, Math.min(a, de))), s = n ? a : 0, c = n ? 1 : -1, l = [];
|
|
200
|
-
for (let e = o; n ? e <= s : e >= s; e += c) l.push(i[e]);
|
|
201
|
-
let u = (e) => ({
|
|
202
|
-
transform: `scale(${e.scale})`,
|
|
203
|
-
opacity: String(Math.min(1, Math.max(0, e.alpha)))
|
|
204
|
-
});
|
|
205
|
-
Object.assign(r.style, u(i[s]));
|
|
206
|
-
let d = !1;
|
|
207
|
-
function f() {
|
|
208
|
-
d || (d = !0, de = s, W = null, G = null, t());
|
|
209
|
-
}
|
|
210
|
-
if (l.length < 2 || typeof r.animate != "function") return f();
|
|
211
|
-
let p = r.animate(l.map(u), {
|
|
212
|
-
duration: (l.length - 1) * H * 1e3,
|
|
213
|
-
easing: "linear"
|
|
214
|
-
});
|
|
215
|
-
p.finished.catch(() => {}), p.onfinish = f, W = () => {
|
|
216
|
-
let e = Number(p.currentTime ?? 0) / (H * 1e3);
|
|
217
|
-
de = Math.max(0, Math.min(a, o + c * e)), d = !0, p.cancel();
|
|
218
|
-
}, G = n ? null : () => {
|
|
219
|
-
W?.(), W = null, G = null, t();
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
function pe(e, t) {
|
|
223
|
-
ve(e), fe(e, t, !0);
|
|
224
|
-
}
|
|
225
|
-
function me(e, t) {
|
|
226
|
-
fe(e, t, !1);
|
|
227
|
-
}
|
|
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) => {
|
|
230
|
-
t && X.delete(t), e && X.add(e);
|
|
231
|
-
}), te(() => {
|
|
232
|
-
J.value && X.delete(J.value);
|
|
233
|
-
});
|
|
234
|
-
let Z = x("m-menu-sibling-group", null);
|
|
235
|
-
D("m-menu-sibling-group", { current: null });
|
|
236
|
-
let Q = null, he = O(!1);
|
|
237
|
-
function ge() {
|
|
238
|
-
if (!q.value) return;
|
|
239
|
-
let e = q.value.getBoundingClientRect();
|
|
240
|
-
Q = e;
|
|
241
|
-
let t = window.innerHeight - e.bottom - 8;
|
|
242
|
-
he.value = t < 200 && e.top > t;
|
|
243
|
-
let n = {
|
|
244
|
-
maxHeight: `${Math.min(he.value ? e.top - 12 : t, 400)}px`,
|
|
245
|
-
maxWidth: `${window.innerWidth - 16}px`,
|
|
246
|
-
left: "0px"
|
|
247
|
-
};
|
|
248
|
-
he.value ? n.bottom = `${window.innerHeight - e.top + 4}px` : n.top = `${e.bottom + 4}px`, Y.value = n;
|
|
249
|
-
}
|
|
250
|
-
let _e = O(n.align === "right" ? "right" : "left");
|
|
251
|
-
function ve(e) {
|
|
252
|
-
if (!Q) return;
|
|
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`;
|
|
254
|
-
_e.value = a, Y.value = {
|
|
255
|
-
...Y.value,
|
|
256
|
-
left: `${r}px`
|
|
257
|
-
}, e.style.left = `${r}px`, e.style.transformOrigin = `${a} ${he.value ? "bottom" : "top"}`;
|
|
258
|
-
}
|
|
259
|
-
function ye() {
|
|
260
|
-
return J.value ? Array.from(J.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
261
|
-
}
|
|
262
|
-
function be() {
|
|
263
|
-
C(() => ye()[0]?.focus());
|
|
264
|
-
}
|
|
265
|
-
function xe(e) {
|
|
266
|
-
let t = ye();
|
|
267
|
-
if (!t.length) return;
|
|
268
|
-
let n = t.indexOf(document.activeElement);
|
|
269
|
-
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
270
|
-
}
|
|
271
|
-
function Se() {
|
|
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();
|
|
273
|
-
}
|
|
274
|
-
function $() {
|
|
275
|
-
Z?.current === $ && (Z.current = null), K.value = !1;
|
|
276
|
-
}
|
|
277
|
-
D("m-menu-close", $), D("m-menu-nav", {
|
|
278
|
-
mode: n.submenuMode,
|
|
279
|
-
push: ce
|
|
280
|
-
}), t({
|
|
281
|
-
close: $,
|
|
282
|
-
open: K
|
|
283
|
-
});
|
|
284
|
-
function Ce(e) {
|
|
285
|
-
let t = e.target;
|
|
286
|
-
if (!q.value?.contains(t)) {
|
|
287
|
-
for (let e of X) if (e.contains(t)) return;
|
|
288
|
-
t.closest?.(".m3-submenu") || $();
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
function we(e) {
|
|
292
|
-
if (!K.value) return;
|
|
293
|
-
let t = e.target;
|
|
294
|
-
for (let e of X) if (e.contains(t)) return;
|
|
295
|
-
t.closest?.(".m3-submenu") || $();
|
|
296
|
-
}
|
|
297
|
-
l(() => K.value, () => b.value.length ? F() : $());
|
|
298
|
-
function Te(e) {
|
|
299
|
-
K.value && (e.key === "ArrowDown" ? (e.preventDefault(), xe(1)) : e.key === "ArrowUp" && (e.preventDefault(), xe(-1)));
|
|
300
|
-
}
|
|
301
|
-
ee(() => {
|
|
302
|
-
document.addEventListener("mousedown", Ce), document.addEventListener("keydown", Te), window.addEventListener("scroll", we, !0);
|
|
303
|
-
}), te(() => {
|
|
304
|
-
document.removeEventListener("mousedown", Ce), document.removeEventListener("keydown", Te), window.removeEventListener("scroll", we, !0), G ? G() : W?.();
|
|
305
|
-
});
|
|
306
|
-
let Ee = m(() => `${_e.value} ${he.value ? "bottom" : "top"}`);
|
|
307
|
-
return (t, n) => (E(), _(d, null, [v("div", S({
|
|
308
|
-
ref_key: "triggerEl",
|
|
309
|
-
ref: q
|
|
310
|
-
}, t.$attrs, {
|
|
311
|
-
class: "inline-block",
|
|
312
|
-
onClick: Se
|
|
313
|
-
}), [A(t.$slots, "trigger", { open: K.value })], 16), (E(), h(f, { to: "body" }, [y(p, {
|
|
314
|
-
css: !1,
|
|
315
|
-
onEnter: pe,
|
|
316
|
-
onLeave: me
|
|
317
|
-
}, {
|
|
318
|
-
default: ae(() => [K.value ? (E(), _("div", {
|
|
319
|
-
key: 0,
|
|
320
|
-
ref_key: "dropdownEl",
|
|
321
|
-
ref: J,
|
|
322
|
-
class: w(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "shadow-elevation-2"]]),
|
|
323
|
-
style: T({
|
|
324
|
-
...Y.value,
|
|
325
|
-
transformOrigin: Ee.value
|
|
326
|
-
})
|
|
327
|
-
}, [v("div", { class: w(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "bg-surface-container"]]) }, [v("div", {
|
|
328
|
-
ref_key: "navBox",
|
|
329
|
-
ref: N,
|
|
330
|
-
class: "relative overflow-x-hidden overflow-y-auto overscroll-contain py-1",
|
|
331
|
-
style: T({
|
|
332
|
-
maxHeight: Y.value.maxHeight,
|
|
333
|
-
touchAction: M(j) ? "pan-y" : void 0
|
|
334
|
-
}),
|
|
335
|
-
onPointerdown: n[1] ||= (...e) => M(le) && M(le)(...e)
|
|
336
|
-
}, [y(p, {
|
|
337
|
-
css: !1,
|
|
338
|
-
onEnter: M(se),
|
|
339
|
-
onLeave: M(P)
|
|
340
|
-
}, {
|
|
341
|
-
default: ae(() => [M(j) ? (E(), _("div", {
|
|
342
|
-
key: M(b).length,
|
|
343
|
-
"data-menu-level": M(b).length
|
|
344
|
-
}, [
|
|
345
|
-
v("button", {
|
|
346
|
-
type: "button",
|
|
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",
|
|
348
|
-
onClick: n[0] ||= (...e) => M(F) && M(F)(...e)
|
|
349
|
-
}, [y(s, {
|
|
350
|
-
name: "arrow_back",
|
|
351
|
-
size: 20,
|
|
352
|
-
class: "shrink-0"
|
|
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", {
|
|
357
|
-
key: t,
|
|
358
|
-
class: "rounded-lg shadow-elevation-2"
|
|
359
|
-
}, [v("div", V, [(E(), h(ne(() => e)))])]))), 128))])) : A(t.$slots, "default", { close: $ }, void 0, void 0, 1)]))]),
|
|
360
|
-
_: 3
|
|
361
|
-
}, 8, ["onEnter", "onLeave"])], 36)], 2)], 6)) : g("", !0)]),
|
|
362
|
-
_: 3
|
|
363
|
-
})]))], 64));
|
|
364
|
-
}
|
|
365
|
-
}), ue = ["data-m3-menu-choice"], de = { class: "flex-1" }, W = {
|
|
366
|
-
key: 3,
|
|
367
|
-
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
368
|
-
}, G = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, fe = 32, pe = /* @__PURE__ */ b({
|
|
369
|
-
__name: "MMenuItem",
|
|
370
|
-
props: {
|
|
371
|
-
icon: {},
|
|
372
|
-
shortcut: {},
|
|
373
|
-
to: {},
|
|
374
|
-
disabled: {
|
|
375
|
-
type: Boolean,
|
|
376
|
-
default: !1
|
|
377
|
-
},
|
|
378
|
-
danger: {
|
|
379
|
-
type: Boolean,
|
|
380
|
-
default: !1
|
|
381
|
-
},
|
|
382
|
-
keepOpen: {
|
|
383
|
-
type: Boolean,
|
|
384
|
-
default: void 0
|
|
385
|
-
},
|
|
386
|
-
selected: {
|
|
387
|
-
type: Boolean,
|
|
388
|
-
default: void 0
|
|
389
|
-
},
|
|
390
|
-
checked: {
|
|
391
|
-
type: Boolean,
|
|
392
|
-
default: void 0
|
|
393
|
-
},
|
|
394
|
-
selectedIcon: {}
|
|
395
|
-
},
|
|
396
|
-
emits: ["click", "update:checked"],
|
|
397
|
-
setup(t, { emit: r }) {
|
|
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() {
|
|
400
|
-
let e = L.value;
|
|
401
|
-
if (!e || !d.value) return;
|
|
402
|
-
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
403
|
-
k.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
404
|
-
}
|
|
405
|
-
function oe() {
|
|
406
|
-
if (b.value) return [
|
|
407
|
-
12,
|
|
408
|
-
12,
|
|
409
|
-
12,
|
|
410
|
-
12
|
|
411
|
-
];
|
|
412
|
-
let e = k.value === "first" ? 12 : 4, t = k.value === "last" ? 12 : 4;
|
|
413
|
-
return [
|
|
414
|
-
e,
|
|
415
|
-
e,
|
|
416
|
-
t,
|
|
417
|
-
t
|
|
418
|
-
];
|
|
419
|
-
}
|
|
420
|
-
let { snap: se } = i(() => d.value ? [...oe(), S.value && b.value ? fe : 0] : [], ([e, t, n, r, i]) => {
|
|
421
|
-
let a = R.value instanceof HTMLElement ? R.value : R.value?.$el;
|
|
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`);
|
|
423
|
-
}, e);
|
|
424
|
-
ie(k, () => se());
|
|
425
|
-
let P = null;
|
|
426
|
-
ee(() => {
|
|
427
|
-
N();
|
|
428
|
-
let e = L.value?.parentElement;
|
|
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]) => {
|
|
431
|
-
z.value && e !== void 0 && (z.value.style.opacity = String(e));
|
|
432
|
-
}, n);
|
|
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({});
|
|
434
|
-
function H() {
|
|
435
|
-
if (!L.value) return;
|
|
436
|
-
let e = L.value.getBoundingClientRect();
|
|
437
|
-
V.value = {
|
|
438
|
-
position: "fixed",
|
|
439
|
-
top: `${e.top}px`,
|
|
440
|
-
left: `${e.right}px`,
|
|
441
|
-
maxWidth: `${window.innerWidth - 16}px`,
|
|
442
|
-
zIndex: "501"
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
function U(e) {
|
|
446
|
-
if (!L.value) return;
|
|
447
|
-
let t = e, n = L.value.getBoundingClientRect();
|
|
448
|
-
t.style.left = "0px";
|
|
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);
|
|
450
|
-
V.value = {
|
|
451
|
-
...V.value,
|
|
452
|
-
left: `${a}px`,
|
|
453
|
-
top: `${o}px`
|
|
454
|
-
}, t.style.left = `${a}px`, t.style.top = `${o}px`;
|
|
455
|
-
}
|
|
456
|
-
function pe() {
|
|
457
|
-
B.value ? B.value = !1 : (H(), B.value = !0);
|
|
458
|
-
}
|
|
459
|
-
function me() {
|
|
460
|
-
a.disabled || (F.value ? I?.mode === "push" ? I.push({
|
|
461
|
-
icon: a.icon,
|
|
462
|
-
header: l.default,
|
|
463
|
-
content: l.children
|
|
464
|
-
}) : pe() : (u.value && o("update:checked", !a.checked), o("click"), (a.keepOpen ?? u.value) || le?.()));
|
|
465
|
-
}
|
|
466
|
-
function K(e) {
|
|
467
|
-
e.pointerType === "mouse" && F.value && !a.disabled && (H(), B.value = !0);
|
|
468
|
-
}
|
|
469
|
-
function q(e) {
|
|
470
|
-
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (B.value = !1));
|
|
471
|
-
}
|
|
472
|
-
function J(e) {
|
|
473
|
-
if (e.pointerType !== "mouse") return;
|
|
474
|
-
let t = e.relatedTarget;
|
|
475
|
-
t?.closest(".m3-submenu") || L.value?.contains(t) || (B.value = !1);
|
|
476
|
-
}
|
|
477
|
-
return (e, n) => (E(), _("div", {
|
|
478
|
-
ref_key: "itemEl",
|
|
479
|
-
ref: L,
|
|
480
|
-
"data-m3-menu-choice": d.value || void 0,
|
|
481
|
-
onPointerenter: K,
|
|
482
|
-
onPointerleave: q
|
|
483
|
-
}, [(E(), h(ne(ce.value), {
|
|
484
|
-
ref_key: "controlEl",
|
|
485
|
-
ref: R,
|
|
486
|
-
to: t.to || void 0,
|
|
487
|
-
type: t.to ? void 0 : "button",
|
|
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 ? [
|
|
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",
|
|
492
|
-
b.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
|
|
493
|
-
t.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
|
|
494
|
-
] : [
|
|
495
|
-
"w-full px-4",
|
|
496
|
-
t.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
|
|
497
|
-
!t.disabled && t.danger ? "text-error hover:bg-error/8" : "",
|
|
498
|
-
!t.disabled && !t.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
499
|
-
]]),
|
|
500
|
-
disabled: t.disabled || void 0,
|
|
501
|
-
"aria-haspopup": F.value ? "menu" : void 0,
|
|
502
|
-
"aria-expanded": F.value ? B.value : void 0,
|
|
503
|
-
onClick: me
|
|
504
|
-
}, {
|
|
505
|
-
default: ae(() => [
|
|
506
|
-
S.value ? (E(), _("span", {
|
|
507
|
-
key: 0,
|
|
508
|
-
ref_key: "iconSlotEl",
|
|
509
|
-
ref: z,
|
|
510
|
-
class: "-mr-3 flex shrink-0 overflow-hidden",
|
|
511
|
-
style: {
|
|
512
|
-
width: "0",
|
|
513
|
-
opacity: "0"
|
|
514
|
-
}
|
|
515
|
-
}, [y(s, {
|
|
516
|
-
name: D.value,
|
|
517
|
-
size: 20,
|
|
518
|
-
class: "shrink-0"
|
|
519
|
-
}, null, 8, ["name"])], 512)) : e.$slots.icon ? (E(), _("span", {
|
|
520
|
-
key: 1,
|
|
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, {
|
|
523
|
-
key: 2,
|
|
524
|
-
name: b.value && D.value ? D.value : t.icon,
|
|
525
|
-
filled: b.value && !D.value,
|
|
526
|
-
size: 20,
|
|
527
|
-
class: w(["shrink-0", d.value ? b.value ? "" : "text-on-surface-variant" : t.danger ? "text-error" : "text-on-surface-variant"])
|
|
528
|
-
}, null, 8, [
|
|
529
|
-
"name",
|
|
530
|
-
"filled",
|
|
531
|
-
"class"
|
|
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, {
|
|
536
|
-
key: 4,
|
|
537
|
-
name: "chevron_right",
|
|
538
|
-
size: 18,
|
|
539
|
-
class: "shrink-0 text-on-surface-variant"
|
|
540
|
-
})) : g("", !0)
|
|
541
|
-
]),
|
|
542
|
-
_: 3
|
|
543
|
-
}, 8, [
|
|
544
|
-
"to",
|
|
545
|
-
"type",
|
|
546
|
-
"role",
|
|
547
|
-
"aria-checked",
|
|
548
|
-
"class",
|
|
549
|
-
"disabled",
|
|
550
|
-
"aria-haspopup",
|
|
551
|
-
"aria-expanded"
|
|
552
|
-
])), F.value && M(I)?.mode !== "push" ? (E(), h(f, {
|
|
553
|
-
key: 0,
|
|
554
|
-
to: "body"
|
|
555
|
-
}, [y(p, {
|
|
556
|
-
"enter-active-class": "transition-opacity duration-100",
|
|
557
|
-
"enter-from-class": "opacity-0",
|
|
558
|
-
"leave-active-class": "transition-opacity duration-75",
|
|
559
|
-
"leave-to-class": "opacity-0",
|
|
560
|
-
onEnter: U
|
|
561
|
-
}, {
|
|
562
|
-
default: ae(() => [B.value ? (E(), _("div", {
|
|
563
|
-
key: 0,
|
|
564
|
-
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
565
|
-
style: T(V.value),
|
|
566
|
-
onPointerleave: J
|
|
567
|
-
}, [v("div", G, [A(e.$slots, "children")])], 36)) : g("", !0)]),
|
|
568
|
-
_: 3
|
|
569
|
-
})])) : g("", !0)], 40, ue));
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
export { oe as i, U as n, I as r, pe as t };
|
|
573
|
-
|
|
574
|
-
//# sourceMappingURL=MMenuItem-BuxYoASE.js.map
|