@m3ui-vue/m3ui-vue 1.1.3 → 1.2.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 +1 -1
- package/dist/API.md +579 -40
- package/dist/MMenuItem-DI351kIf.js +929 -0
- package/dist/MMenuItem-DI351kIf.js.map +1 -0
- package/dist/MSlider-BnEy5ieZ.js +1500 -0
- package/dist/MSlider-BnEy5ieZ.js.map +1 -0
- package/dist/MTextField-BBmkaIbO.js +633 -0
- package/dist/MTextField-BBmkaIbO.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/chart.js +83 -49
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAnimatedNumber.vue.d.ts +3 -1
- package/dist/components/MButton.vue.d.ts +9 -1
- package/dist/components/MButtonGroup.vue.d.ts +40 -31
- package/dist/components/MCarousel.vue.d.ts +2 -0
- package/dist/components/MChart.vue.d.ts +6 -0
- package/dist/components/MCircleProgressBar.vue.d.ts +5 -3
- package/dist/components/MContainerTransform.vue.d.ts +59 -0
- package/dist/components/MContextMenu.vue.d.ts +2 -2
- package/dist/components/MCopyButton.vue.d.ts +1 -1
- package/dist/components/MDialog.vue.d.ts +8 -5
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MIconButton.vue.d.ts +15 -1
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- package/dist/components/MListItem.vue.d.ts +5 -5
- package/dist/components/MMap.vue.d.ts +20 -2
- package/dist/components/MMapBaseLayers.vue.d.ts +3 -0
- package/dist/components/MMapFilter.vue.d.ts +3 -0
- package/dist/components/MMapLayers.vue.d.ts +3 -0
- package/dist/components/MMenu.vue.d.ts +2 -2
- package/dist/components/MMenuItem.vue.d.ts +7 -3
- package/dist/components/MNavigationDrawer.vue.d.ts +13 -2
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MOverlay.vue.d.ts +12 -1
- package/dist/components/MProgressBar.vue.d.ts +5 -3
- package/dist/components/MPullToRefresh.vue.d.ts +7 -2
- package/dist/components/MRichTextEditor.vue.d.ts +7 -1
- package/dist/components/MSearchField.vue.d.ts +58 -0
- package/dist/components/MSegmentedButton.vue.d.ts +31 -23
- package/dist/components/MSimpleCarousel.vue.d.ts +2 -0
- package/dist/components/MSkeleton.vue.d.ts +6 -3
- package/dist/components/MSplitter.vue.d.ts +1 -1
- package/dist/components/MStack.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/MTextField.vue.d.ts +5 -1
- package/dist/components/MTimeline.vue.d.ts +85 -22
- package/dist/components/MToolbar.vue.d.ts +32 -5
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
- package/dist/components/_MToolbarFab.vue.d.ts +16 -0
- package/dist/composables/_containerTransform.d.ts +48 -0
- package/dist/composables/_mapStyle.d.ts +13 -0
- package/dist/composables/_themeTransition.d.ts +2 -0
- package/dist/composables/_tooltipTrigger.d.ts +22 -0
- package/dist/composables/_useMenuNav.d.ts +28 -0
- package/dist/composables/useAutoGrow.d.ts +21 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useContainerTransform.d.ts +30 -0
- package/dist/composables/useLocale.d.ts +6 -0
- package/dist/composables/useMap.d.ts +19 -3
- package/dist/composables/useMapFilter.d.ts +4 -1
- package/dist/composables/useMapLayers.d.ts +5 -2
- package/dist/composables/useScrollReveal.d.ts +44 -0
- package/dist/composables/useThemeTokens.d.ts +21 -0
- package/dist/composables/viewportHints.d.ts +27 -0
- package/dist/directives/vClickOutside.d.ts +25 -0
- package/dist/directives/vFocusRing.d.ts +22 -0
- package/dist/directives/vLongPress.d.ts +27 -0
- package/dist/directives/vReveal.d.ts +10 -0
- package/dist/directives/vScrollElevation.d.ts +31 -0
- package/dist/directives/vSkeleton.d.ts +19 -0
- package/dist/directives/vStateLayer.d.ts +20 -0
- package/dist/directives/vSwipe.d.ts +45 -0
- package/dist/directives/vTooltip.d.ts +23 -0
- package/dist/index.d.ts +31 -1
- package/dist/locales/index.js +35 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7692 -6273
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +823 -793
- package/dist/map.js.map +1 -1
- package/dist/motion-DZiXG09o.js +150 -0
- package/dist/motion-DZiXG09o.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/rich-text-editor.js +20 -16
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +63 -0
- package/dist/styles.css +1 -1
- package/dist/{useLocale-SfQHnJfp.js → useLocale-JYxDDeXC.js} +6 -2
- package/dist/useLocale-JYxDDeXC.js.map +1 -0
- package/dist/useThemeTokens-Bv-Uv8eX.js +135 -0
- package/dist/useThemeTokens-Bv-Uv8eX.js.map +1 -0
- package/package.json +2 -1
- package/src/__tests__/MAnimatedNumber.test.ts +24 -2
- package/src/__tests__/MButton.test.ts +22 -0
- package/src/__tests__/MCarousel.test.ts +9 -0
- package/src/__tests__/MChart.test.ts +77 -5
- package/src/__tests__/MContainerTransform.test.ts +279 -0
- package/src/__tests__/MDialog.test.ts +27 -0
- package/src/__tests__/MIconButton.test.ts +33 -0
- package/src/__tests__/MListItemExpandable.test.ts +48 -0
- package/src/__tests__/MListItemShape.test.ts +9 -6
- package/src/__tests__/MListKeyboard.test.ts +90 -0
- package/src/__tests__/MMap.test.ts +53 -1
- package/src/__tests__/MMapLayers.test.ts +46 -2
- package/src/__tests__/MMapTools.test.ts +2 -1
- package/src/__tests__/MMenu.test.ts +104 -1
- package/src/__tests__/MMenuItem.test.ts +18 -0
- package/src/__tests__/MNavigationDrawer.test.ts +80 -0
- package/src/__tests__/MNavigationRail.test.ts +33 -0
- package/src/__tests__/MOverlay.test.ts +49 -0
- package/src/__tests__/MProgressBar.test.ts +41 -0
- package/src/__tests__/MPullToRefresh.test.ts +33 -0
- package/src/__tests__/MRichTextEditor.test.ts +22 -0
- package/src/__tests__/MSearchField.test.ts +71 -0
- package/src/__tests__/MSkeleton.test.ts +38 -0
- package/src/__tests__/MSlider.test.ts +161 -0
- package/src/__tests__/MTimeline.test.ts +238 -0
- package/src/__tests__/MToolbar.test.ts +157 -0
- package/src/__tests__/_fakeMaplibre.ts +3 -1
- package/src/__tests__/attrsFallthrough.test.ts +9 -0
- package/src/__tests__/escapeStack.test.ts +93 -0
- package/src/__tests__/hydration.test.ts +25 -0
- package/src/__tests__/ssr.test.ts +21 -2
- package/src/__tests__/useAutoGrow.test.ts +103 -0
- package/src/__tests__/useScrollReveal.test.ts +102 -0
- package/src/__tests__/useThemeTokens.test.ts +114 -0
- package/src/__tests__/vClickOutside.test.ts +82 -0
- package/src/__tests__/vFocusRing.test.ts +36 -0
- package/src/__tests__/vLongPress.test.ts +81 -0
- package/src/__tests__/vScrollElevation.test.ts +89 -0
- package/src/__tests__/vSkeleton.test.ts +48 -0
- package/src/__tests__/vStateLayer.test.ts +53 -0
- package/src/__tests__/vSwipe.test.ts +93 -0
- package/src/__tests__/vTooltip.test.ts +95 -0
- package/src/__tests__/viewportHints.test.ts +41 -0
- package/src/components/MAnimatedNumber.vue +32 -6
- package/src/components/MAutocomplete.vue +5 -0
- package/src/components/MBottomSheet.vue +4 -1
- package/src/components/MButton.vue +19 -3
- package/src/components/MButtonGroup.vue +22 -17
- package/src/components/MCarousel.vue +7 -1
- package/src/components/MChart.vue +74 -34
- package/src/components/MCircleProgressBar.vue +14 -9
- package/src/components/MCommandPalette.vue +3 -2
- package/src/components/MContainerTransform.vue +321 -0
- package/src/components/MContextMenu.vue +19 -60
- package/src/components/MDialog.vue +31 -6
- package/src/components/MDragDropList.vue +2 -0
- package/src/components/MFab.vue +10 -5
- package/src/components/MIconButton.vue +43 -2
- package/src/components/MKanban.vue +2 -0
- package/src/components/MLightbox.vue +7 -2
- package/src/components/MList.vue +26 -2
- package/src/components/MListItem.vue +138 -84
- package/src/components/MMap.vue +38 -5
- package/src/components/MMapBaseLayers.vue +7 -3
- package/src/components/MMapFilter.vue +7 -4
- package/src/components/MMapGeoJson.vue +1 -1
- package/src/components/MMapLayers.vue +6 -2
- package/src/components/MMapMeasure.vue +5 -2
- package/src/components/MMenu.vue +18 -59
- package/src/components/MMenuItem.vue +11 -2
- package/src/components/MMultiAutocomplete.vue +5 -0
- package/src/components/MNavigationDrawer.vue +96 -11
- package/src/components/MNavigationRail.vue +44 -25
- package/src/components/MOverlay.vue +32 -13
- package/src/components/MProgressBar.vue +25 -27
- package/src/components/MPullToRefresh.vue +20 -1
- package/src/components/MRichTextEditor.vue +19 -5
- package/src/components/MSearchBar.vue +5 -0
- package/src/components/MSearchField.vue +142 -0
- package/src/components/MSegmentedButton.vue +19 -17
- package/src/components/MSelect.vue +10 -1
- package/src/components/MSideSheet.vue +5 -2
- package/src/components/MSimpleCarousel.vue +10 -1
- package/src/components/MSkeleton.vue +30 -8
- package/src/components/MSlider.vue +161 -42
- package/src/components/MSpotlightSearch.vue +3 -2
- package/src/components/MTextField.vue +15 -2
- package/src/components/MTimeline.vue +370 -81
- package/src/components/MToolbar.vue +256 -15
- package/src/components/MTooltip.vue +20 -152
- package/src/components/_MDrawerItemList.vue +25 -6
- package/src/components/_MToolbarFab.vue +14 -0
- package/src/composables/_containerTransform.ts +179 -0
- package/src/composables/_mapStyle.ts +45 -0
- package/src/composables/_themeTransition.ts +2 -0
- package/src/composables/_tooltipTrigger.ts +184 -0
- package/src/composables/_useEscapeStack.ts +2 -0
- package/src/composables/_useMenuNav.ts +209 -0
- package/src/composables/useAutoGrow.ts +78 -0
- package/src/composables/useContainerTransform.ts +59 -0
- package/src/composables/useLocale.ts +10 -0
- package/src/composables/useMap.ts +43 -5
- package/src/composables/useMapFilter.ts +6 -5
- package/src/composables/useMapLayers.ts +7 -6
- package/src/composables/useScrollReveal.ts +151 -0
- package/src/composables/useThemeTokens.ts +116 -0
- package/src/composables/viewportHints.ts +80 -0
- package/src/directives/vClickOutside.ts +90 -0
- package/src/directives/vFocusRing.ts +60 -0
- package/src/directives/vLongPress.ts +134 -0
- package/src/directives/vReveal.ts +57 -0
- package/src/directives/vScrollElevation.ts +116 -0
- package/src/directives/vSkeleton.ts +87 -0
- package/src/directives/vStateLayer.ts +83 -0
- package/src/directives/vSwipe.ts +197 -0
- package/src/directives/vTooltip.ts +128 -0
- package/src/index.ts +31 -1
- package/src/locales/de.ts +4 -0
- package/src/locales/es.ts +4 -0
- package/src/locales/fr.ts +4 -0
- package/src/locales/ja.ts +4 -0
- package/src/locales/ko.ts +4 -0
- package/src/locales/pt.ts +4 -0
- package/src/locales/zh.ts +4 -0
- package/src/map.ts +1 -1
- package/src/plugin.ts +34 -0
- package/src/styles/theme.css +63 -0
- package/dist/MMenuItem-BckcR0nW.js +0 -809
- package/dist/MMenuItem-BckcR0nW.js.map +0 -1
- package/dist/MSlider-LyH_gy8D.js +0 -1411
- package/dist/MSlider-LyH_gy8D.js.map +0 -1
- package/dist/MTextField-FCPOTB0o.js +0 -672
- package/dist/MTextField-FCPOTB0o.js.map +0 -1
- package/dist/composables/_useThemeTokens.d.ts +0 -7
- package/dist/useLocale-SfQHnJfp.js.map +0 -1
- package/src/composables/_useThemeTokens.ts +0 -42
|
@@ -1,809 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-SfQHnJfp.js";
|
|
2
|
-
import { a as t, c as n, g as r, h as i, n as a, o } from "./MTextField-FCPOTB0o.js";
|
|
3
|
-
import { t as s } from "./MIcon-Bxh9j135.js";
|
|
4
|
-
import { t as c } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
5
|
-
import { Fragment as l, Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, getCurrentInstance as b, inject as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeStyle as T, onBeforeUnmount as E, onMounted as D, onUnmounted as ee, openBlock as O, provide as k, ref as A, renderList as j, renderSlot as M, resolveDynamicComponent as te, toDisplayString as ne, unref as N, useId as re, useSlots as ie, watch as P, withCtx as F, withDirectives as I, withModifiers as L } from "vue";
|
|
6
|
-
//#region src/composables/_useScrollLock.ts
|
|
7
|
-
var R = 0, z = "";
|
|
8
|
-
function ae() {
|
|
9
|
-
R++ === 0 && (z = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
10
|
-
}
|
|
11
|
-
function B() {
|
|
12
|
-
R > 0 && --R === 0 && (document.body.style.overflow = z);
|
|
13
|
-
}
|
|
14
|
-
function V(e) {
|
|
15
|
-
let t = !1;
|
|
16
|
-
function n(e) {
|
|
17
|
-
typeof document > "u" || e === t || (t = e, e ? ae() : B());
|
|
18
|
-
}
|
|
19
|
-
return e && P(e, (e) => n(!!e), { immediate: !0 }), b() && E(() => n(!1)), { set: n };
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/components/MButton.vue?vue&type=script&setup=true&lang.ts
|
|
23
|
-
var H = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", U = /* @__PURE__ */ y({
|
|
24
|
-
__name: "MButton",
|
|
25
|
-
props: {
|
|
26
|
-
variant: { default: "filled" },
|
|
27
|
-
color: { default: "primary" },
|
|
28
|
-
type: { default: "button" },
|
|
29
|
-
disabled: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: !1
|
|
32
|
-
},
|
|
33
|
-
loading: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !1
|
|
36
|
-
},
|
|
37
|
-
icon: {},
|
|
38
|
-
iconPos: { default: "leading" },
|
|
39
|
-
size: { default: "sm" },
|
|
40
|
-
shape: { default: "rounded" },
|
|
41
|
-
to: {},
|
|
42
|
-
rippleColor: {}
|
|
43
|
-
},
|
|
44
|
-
setup(e) {
|
|
45
|
-
let t = ["primary", "error"], n = e, a = f(() => n.to ? "RouterLink" : "button"), o = f(() => !!n.color && !t.includes(n.color)), c = f(() => {
|
|
46
|
-
if (o.value) return {
|
|
47
|
-
"--color-primary": n.color,
|
|
48
|
-
"--color-on-primary": "#ffffff",
|
|
49
|
-
"--color-primary-container": n.color + "33",
|
|
50
|
-
"--color-on-primary-container": n.color
|
|
51
|
-
};
|
|
52
|
-
}), u = f(() => n.color === "error"), d = f(() => {
|
|
53
|
-
switch (n.variant) {
|
|
54
|
-
case "filled":
|
|
55
|
-
case "tonal":
|
|
56
|
-
case "elevated": return "disabled:bg-on-surface/10";
|
|
57
|
-
case "outlined": return u.value ? "disabled:border-error/10" : "disabled:border-outline-variant/10";
|
|
58
|
-
default: return "";
|
|
59
|
-
}
|
|
60
|
-
}), g = {
|
|
61
|
-
xs: {
|
|
62
|
-
h: "h-8",
|
|
63
|
-
text: "text-label-large",
|
|
64
|
-
icon: 20,
|
|
65
|
-
spinner: 16,
|
|
66
|
-
gap: "gap-1",
|
|
67
|
-
px: "px-3",
|
|
68
|
-
pxText: "px-2",
|
|
69
|
-
squareRadius: "rounded-md"
|
|
70
|
-
},
|
|
71
|
-
sm: {
|
|
72
|
-
h: "h-10",
|
|
73
|
-
text: "text-label-large",
|
|
74
|
-
icon: 20,
|
|
75
|
-
spinner: 16,
|
|
76
|
-
gap: "gap-2",
|
|
77
|
-
px: "px-4",
|
|
78
|
-
pxText: "px-3",
|
|
79
|
-
squareRadius: "rounded-md"
|
|
80
|
-
},
|
|
81
|
-
md: {
|
|
82
|
-
h: "h-14",
|
|
83
|
-
text: "text-title-medium",
|
|
84
|
-
icon: 24,
|
|
85
|
-
spinner: 18,
|
|
86
|
-
gap: "gap-2",
|
|
87
|
-
px: "px-6",
|
|
88
|
-
pxText: "px-3",
|
|
89
|
-
squareRadius: "rounded-lg"
|
|
90
|
-
},
|
|
91
|
-
lg: {
|
|
92
|
-
h: "h-24",
|
|
93
|
-
text: "text-headline-small",
|
|
94
|
-
icon: 32,
|
|
95
|
-
spinner: 26,
|
|
96
|
-
gap: "gap-3",
|
|
97
|
-
px: "px-12",
|
|
98
|
-
pxText: "px-4",
|
|
99
|
-
squareRadius: "rounded-xl"
|
|
100
|
-
},
|
|
101
|
-
xl: {
|
|
102
|
-
h: "h-[136px]",
|
|
103
|
-
text: "text-headline-large",
|
|
104
|
-
icon: 40,
|
|
105
|
-
spinner: 34,
|
|
106
|
-
gap: "gap-4",
|
|
107
|
-
px: "px-16",
|
|
108
|
-
pxText: "px-4",
|
|
109
|
-
squareRadius: "rounded-xl"
|
|
110
|
-
}
|
|
111
|
-
}, _ = f(() => g[n.size] ?? g.sm), v = f(() => `${_.value.h} ${_.value.text} ${_.value.gap}`), y = f(() => _.value.icon), b = f(() => _.value.spinner), x = f(() => n.variant === "text" ? _.value.pxText : _.value.px), S = f(() => n.shape === "squared" ? _.value.squareRadius : "rounded-full"), C = f(() => {
|
|
112
|
-
let e = u.value;
|
|
113
|
-
switch (n.variant) {
|
|
114
|
-
case "filled": return e ? "bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
|
|
115
|
-
case "tonal": return e ? "bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
|
|
116
|
-
case "elevated": return e ? "bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2" : "bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2";
|
|
117
|
-
case "outlined": return e ? "border border-error text-error" : "border border-outline-variant text-primary";
|
|
118
|
-
case "text": return e ? "text-error" : "text-primary";
|
|
119
|
-
default: return "";
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return (t, n) => I((O(), p(te(a.value), {
|
|
123
|
-
to: e.to || void 0,
|
|
124
|
-
type: e.to ? void 0 : e.type,
|
|
125
|
-
disabled: e.disabled || e.loading,
|
|
126
|
-
class: w([
|
|
127
|
-
H,
|
|
128
|
-
S.value,
|
|
129
|
-
v.value,
|
|
130
|
-
x.value,
|
|
131
|
-
C.value,
|
|
132
|
-
d.value
|
|
133
|
-
]),
|
|
134
|
-
style: T(c.value)
|
|
135
|
-
}, {
|
|
136
|
-
default: F(() => [
|
|
137
|
-
e.iconPos === "leading" ? (O(), h(l, { key: 0 }, [e.loading ? (O(), p(i, {
|
|
138
|
-
key: 0,
|
|
139
|
-
size: b.value
|
|
140
|
-
}, null, 8, ["size"])) : e.icon ? (O(), p(s, {
|
|
141
|
-
key: 1,
|
|
142
|
-
name: e.icon,
|
|
143
|
-
size: y.value
|
|
144
|
-
}, null, 8, ["name", "size"])) : m("", !0)], 64)) : m("", !0),
|
|
145
|
-
M(t.$slots, "default"),
|
|
146
|
-
e.iconPos === "trailing" ? (O(), h(l, { key: 1 }, [e.loading ? (O(), p(i, {
|
|
147
|
-
key: 0,
|
|
148
|
-
size: b.value
|
|
149
|
-
}, null, 8, ["size"])) : e.icon ? (O(), p(s, {
|
|
150
|
-
key: 1,
|
|
151
|
-
name: e.icon,
|
|
152
|
-
size: y.value
|
|
153
|
-
}, null, 8, ["name", "size"])) : m("", !0)], 64)) : m("", !0)
|
|
154
|
-
]),
|
|
155
|
-
_: 3
|
|
156
|
-
}, 8, [
|
|
157
|
-
"to",
|
|
158
|
-
"type",
|
|
159
|
-
"disabled",
|
|
160
|
-
"class",
|
|
161
|
-
"style"
|
|
162
|
-
])), [[N(r), {
|
|
163
|
-
disabled: e.disabled || e.loading,
|
|
164
|
-
color: e.rippleColor
|
|
165
|
-
}]]);
|
|
166
|
-
}
|
|
167
|
-
}), W = [];
|
|
168
|
-
function G(e) {
|
|
169
|
-
e.key === "Escape" && W.length && W[W.length - 1]();
|
|
170
|
-
}
|
|
171
|
-
function K(e, t) {
|
|
172
|
-
let n = () => t();
|
|
173
|
-
function r(e) {
|
|
174
|
-
if (typeof document > "u") return;
|
|
175
|
-
let t = W.indexOf(n);
|
|
176
|
-
e && t < 0 ? (W.push(n), W.length === 1 && document.addEventListener("keydown", G)) : !e && t >= 0 && (W.splice(t, 1), W.length || document.removeEventListener("keydown", G));
|
|
177
|
-
}
|
|
178
|
-
P(e, (e) => r(!!e), { immediate: !0 }), b() && E(() => r(!1));
|
|
179
|
-
}
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/components/MDialog.vue?vue&type=script&setup=true&lang.ts
|
|
182
|
-
var q = ["aria-labelledby", "aria-label"], J = {
|
|
183
|
-
key: 0,
|
|
184
|
-
class: "min-h-0 overflow-y-auto rounded-[inherit]"
|
|
185
|
-
}, Y = { class: "relative px-6 pt-6 pb-2" }, X = {
|
|
186
|
-
key: 0,
|
|
187
|
-
class: "absolute right-4 top-4"
|
|
188
|
-
}, oe = {
|
|
189
|
-
key: 1,
|
|
190
|
-
class: "mb-4 flex justify-center text-secondary"
|
|
191
|
-
}, se = {
|
|
192
|
-
key: 0,
|
|
193
|
-
class: "shrink-0 border-t border-outline-variant"
|
|
194
|
-
}, ce = {
|
|
195
|
-
key: 1,
|
|
196
|
-
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
197
|
-
}, le = ["aria-labelledby"], ue = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, de = {
|
|
198
|
-
key: 1,
|
|
199
|
-
class: "flex items-center gap-2"
|
|
200
|
-
}, fe = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, Z = /*#__PURE__*/ c(/* @__PURE__ */ y({
|
|
201
|
-
__name: "MDialog",
|
|
202
|
-
props: {
|
|
203
|
-
modelValue: { type: Boolean },
|
|
204
|
-
title: {},
|
|
205
|
-
maxWidth: { default: "max-w-[560px]" },
|
|
206
|
-
maxHeight: { default: "max-h-[90vh]" },
|
|
207
|
-
persistent: {
|
|
208
|
-
type: Boolean,
|
|
209
|
-
default: !1
|
|
210
|
-
},
|
|
211
|
-
fullscreen: {
|
|
212
|
-
type: Boolean,
|
|
213
|
-
default: !1
|
|
214
|
-
},
|
|
215
|
-
closeLabel: {},
|
|
216
|
-
closable: {
|
|
217
|
-
type: Boolean,
|
|
218
|
-
default: !0
|
|
219
|
-
},
|
|
220
|
-
bare: {
|
|
221
|
-
type: Boolean,
|
|
222
|
-
default: !1
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
emits: ["update:modelValue"],
|
|
226
|
-
setup(t, { emit: n }) {
|
|
227
|
-
let r = t, i = e(), o = (e) => /^-?[\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\(/i.test(e.trim()), s = f(() => [r.maxWidth, r.maxHeight].filter((e) => !o(e))), c = f(() => ({
|
|
228
|
-
...o(r.maxWidth) ? { maxWidth: r.maxWidth } : {},
|
|
229
|
-
...o(r.maxHeight) ? { maxHeight: r.maxHeight } : {}
|
|
230
|
-
})), y = n;
|
|
231
|
-
function b() {
|
|
232
|
-
r.persistent || y("update:modelValue", !1);
|
|
233
|
-
}
|
|
234
|
-
let x = A(), S = A(), E = A(!1), D;
|
|
235
|
-
function k() {
|
|
236
|
-
let e = x.value;
|
|
237
|
-
if (!e) {
|
|
238
|
-
E.value = !1;
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
E.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1;
|
|
242
|
-
}
|
|
243
|
-
V(() => r.modelValue), K(() => r.modelValue, b);
|
|
244
|
-
let j = `m3-dialog-${re()}`;
|
|
245
|
-
return P(() => r.modelValue, async (e) => {
|
|
246
|
-
typeof window > "u" || (e ? (await C(), k(), D = new ResizeObserver(k), x.value && D.observe(x.value), S.value && D.observe(S.value)) : (D?.disconnect(), D = void 0));
|
|
247
|
-
}, { immediate: !0 }), ee(() => {
|
|
248
|
-
D?.disconnect();
|
|
249
|
-
}), (e, n) => (O(), p(u, { to: "body" }, [t.fullscreen ? (O(), p(d, {
|
|
250
|
-
key: 1,
|
|
251
|
-
name: "m3-dialog-fs",
|
|
252
|
-
appear: ""
|
|
253
|
-
}, {
|
|
254
|
-
default: F(() => [t.modelValue ? (O(), h("div", {
|
|
255
|
-
key: 0,
|
|
256
|
-
class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface",
|
|
257
|
-
role: "dialog",
|
|
258
|
-
"aria-modal": "true",
|
|
259
|
-
"aria-labelledby": e.$slots.title || t.title ? j : void 0
|
|
260
|
-
}, [g("div", ue, [
|
|
261
|
-
t.persistent ? m("", !0) : (O(), p(a, {
|
|
262
|
-
key: 0,
|
|
263
|
-
icon: "close",
|
|
264
|
-
label: t.closeLabel ?? N(i).close,
|
|
265
|
-
onClick: b
|
|
266
|
-
}, null, 8, ["label"])),
|
|
267
|
-
g("h2", {
|
|
268
|
-
id: j,
|
|
269
|
-
class: "flex-1 text-title-large font-medium text-on-surface"
|
|
270
|
-
}, [M(e.$slots, "title", {}, () => [_(ne(t.title), 1)], !0)]),
|
|
271
|
-
e.$slots.actions ? (O(), h("div", de, [M(e.$slots, "actions", {}, void 0, !0)])) : m("", !0)
|
|
272
|
-
]), g("div", fe, [M(e.$slots, "default", {}, void 0, !0)])], 8, le)) : m("", !0)]),
|
|
273
|
-
_: 3
|
|
274
|
-
})) : (O(), p(d, {
|
|
275
|
-
key: 0,
|
|
276
|
-
name: "m3-dialog",
|
|
277
|
-
appear: ""
|
|
278
|
-
}, {
|
|
279
|
-
default: F(() => [t.modelValue ? (O(), h("div", {
|
|
280
|
-
key: 0,
|
|
281
|
-
class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
|
|
282
|
-
onClick: L(b, ["self"])
|
|
283
|
-
}, [g("div", {
|
|
284
|
-
class: w(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", s.value]),
|
|
285
|
-
style: T(c.value),
|
|
286
|
-
role: "dialog",
|
|
287
|
-
"aria-modal": "true",
|
|
288
|
-
"aria-labelledby": !t.bare && (e.$slots.title || t.title) ? j : void 0,
|
|
289
|
-
"aria-label": t.bare ? t.title : void 0
|
|
290
|
-
}, [t.bare ? (O(), h("div", J, [M(e.$slots, "default", {}, void 0, !0)])) : (O(), h(l, { key: 1 }, [
|
|
291
|
-
g("div", Y, [
|
|
292
|
-
t.closable && !t.persistent ? (O(), h("div", X, [v(a, {
|
|
293
|
-
icon: "close",
|
|
294
|
-
label: t.closeLabel ?? N(i).close,
|
|
295
|
-
onClick: b
|
|
296
|
-
}, null, 8, ["label"])])) : m("", !0),
|
|
297
|
-
e.$slots.icon ? (O(), h("div", oe, [M(e.$slots, "icon", {}, void 0, !0)])) : m("", !0),
|
|
298
|
-
g("h2", {
|
|
299
|
-
id: j,
|
|
300
|
-
class: w(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]])
|
|
301
|
-
}, [M(e.$slots, "title", {}, () => [_(ne(t.title), 1)], !0)], 2)
|
|
302
|
-
]),
|
|
303
|
-
g("div", {
|
|
304
|
-
ref_key: "contentEl",
|
|
305
|
-
ref: x,
|
|
306
|
-
class: w(["overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant", e.$slots.actions ? "pb-2" : "pb-6"]),
|
|
307
|
-
onScroll: k
|
|
308
|
-
}, [g("div", {
|
|
309
|
-
ref_key: "contentInnerEl",
|
|
310
|
-
ref: S
|
|
311
|
-
}, [M(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
312
|
-
E.value && e.$slots.actions ? (O(), h("div", se)) : m("", !0),
|
|
313
|
-
e.$slots.actions ? (O(), h("div", ce, [M(e.$slots, "actions", {}, void 0, !0)])) : m("", !0)
|
|
314
|
-
], 64))], 14, q)])) : m("", !0)]),
|
|
315
|
-
_: 3
|
|
316
|
-
}))]));
|
|
317
|
-
}
|
|
318
|
-
}), [["__scopeId", "data-v-1d35a150"]]), pe = { class: "my-1 border-outline-variant" }, me = /* @__PURE__ */ y({
|
|
319
|
-
__name: "MMenuDivider",
|
|
320
|
-
props: { gap: {
|
|
321
|
-
type: Boolean,
|
|
322
|
-
default: !1
|
|
323
|
-
} },
|
|
324
|
-
setup(e) {
|
|
325
|
-
return (e, t) => (O(), h("hr", pe));
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
function Q(e, t, n, r = 8) {
|
|
329
|
-
for (let i of e) if (i >= r && i + t <= n - r) return i;
|
|
330
|
-
if (t >= n - 2 * r) return (n - t) / 2;
|
|
331
|
-
let i = e[e.length - 1] ?? r;
|
|
332
|
-
return Math.min(n - r - t, Math.max(r, i));
|
|
333
|
-
}
|
|
334
|
-
function he(e, t, n, r, i = 8) {
|
|
335
|
-
let a = e.left, o = e.right - t, s = (e.left + e.right) / 2 < n / 2 ? i : n - i - t;
|
|
336
|
-
return Q(r === "start" ? [
|
|
337
|
-
a,
|
|
338
|
-
o,
|
|
339
|
-
s
|
|
340
|
-
] : [
|
|
341
|
-
o,
|
|
342
|
-
a,
|
|
343
|
-
s
|
|
344
|
-
], t, n, i);
|
|
345
|
-
}
|
|
346
|
-
//#endregion
|
|
347
|
-
//#region src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
|
|
348
|
-
var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
|
|
349
|
-
key: 0,
|
|
350
|
-
class: "flex flex-col gap-1 px-1.5"
|
|
351
|
-
}, ye = { class: "overflow-hidden rounded-lg bg-surface-container" }, be = 220, $ = 1 / 240, xe = /* @__PURE__ */ y({
|
|
352
|
-
inheritAttrs: !1,
|
|
353
|
-
__name: "MMenu",
|
|
354
|
-
props: {
|
|
355
|
-
align: { default: "right" },
|
|
356
|
-
submenuMode: { default: "flyout" },
|
|
357
|
-
variant: { default: "standard" }
|
|
358
|
-
},
|
|
359
|
-
setup(e, { expose: t }) {
|
|
360
|
-
let n = e, r = ie();
|
|
361
|
-
function i(e) {
|
|
362
|
-
let t = [];
|
|
363
|
-
for (let n of e) n.type === l && Array.isArray(n.children) ? t.push(...i(n.children)) : t.push(n);
|
|
364
|
-
return t;
|
|
365
|
-
}
|
|
366
|
-
function a(e) {
|
|
367
|
-
if (e.type !== me) return !1;
|
|
368
|
-
let t = e.props?.gap;
|
|
369
|
-
return t === "" || t === !0 || t === "true";
|
|
370
|
-
}
|
|
371
|
-
let o = f(() => {
|
|
372
|
-
if (n.variant !== "expressive") return null;
|
|
373
|
-
let e = i(r.default?.({ close: Z }) ?? []), t = [[]];
|
|
374
|
-
for (let n of e) a(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
375
|
-
return t.filter((e) => e.length > 0);
|
|
376
|
-
}), c = f(() => !!o.value && o.value.length > 1), _ = A([]), y = f(() => _.value[_.value.length - 1]), b = A("forward");
|
|
377
|
-
function E(e, t) {
|
|
378
|
-
let n = b.value === "forward" ? 1 : -1, r = e.animate([{
|
|
379
|
-
transform: `translateX(${n * 100}%)`,
|
|
380
|
-
opacity: .4
|
|
381
|
-
}, {
|
|
382
|
-
transform: "translateX(0%)",
|
|
383
|
-
opacity: 1
|
|
384
|
-
}], {
|
|
385
|
-
duration: be,
|
|
386
|
-
easing: "cubic-bezier(0.05,0.7,0.1,1)"
|
|
387
|
-
});
|
|
388
|
-
r.onfinish = t;
|
|
389
|
-
}
|
|
390
|
-
function ne(e, t) {
|
|
391
|
-
let n = b.value === "forward" ? -1 : 1, r = e;
|
|
392
|
-
r.style.position = "absolute", r.style.insetInline = "0", r.style.top = "0";
|
|
393
|
-
let i = r.animate([{
|
|
394
|
-
transform: "translateX(0%)",
|
|
395
|
-
opacity: 1
|
|
396
|
-
}, {
|
|
397
|
-
transform: `translateX(${n * 100}%)`,
|
|
398
|
-
opacity: .4
|
|
399
|
-
}], {
|
|
400
|
-
duration: be,
|
|
401
|
-
easing: "cubic-bezier(0.3,0,0.8,0.15)"
|
|
402
|
-
});
|
|
403
|
-
i.onfinish = t;
|
|
404
|
-
}
|
|
405
|
-
let N = null;
|
|
406
|
-
function re() {
|
|
407
|
-
if (N) return N;
|
|
408
|
-
let e = [], t = .8, n = 0, r = 0, i = 0;
|
|
409
|
-
for (let a = 0; a < 1 && (e.push({
|
|
410
|
-
scale: t,
|
|
411
|
-
alpha: r
|
|
412
|
-
}), n += (-1400 * (t - 1) - 1.8 * Math.sqrt(1400) * n) * $, t += n * $, i += (-3800 * (r - 1) - 2 * Math.sqrt(3800) * i) * $, r += i * $, !(Math.abs(t - 1) < .003 && Math.abs(r - 1) < .003)); a += $);
|
|
413
|
-
return e.push({
|
|
414
|
-
scale: 1,
|
|
415
|
-
alpha: 1
|
|
416
|
-
}), N = e, e;
|
|
417
|
-
}
|
|
418
|
-
let I = 0, L = null, R = null;
|
|
419
|
-
function z(e, t, n) {
|
|
420
|
-
L?.();
|
|
421
|
-
let r = e, i = re(), a = i.length - 1, o = Math.round(Math.max(0, Math.min(a, I))), s = n ? a : 0, c = n ? 1 : -1, l = [];
|
|
422
|
-
for (let e = o; n ? e <= s : e >= s; e += c) l.push(i[e]);
|
|
423
|
-
let u = (e) => ({
|
|
424
|
-
transform: `scale(${e.scale})`,
|
|
425
|
-
opacity: String(Math.min(1, Math.max(0, e.alpha)))
|
|
426
|
-
});
|
|
427
|
-
Object.assign(r.style, u(i[s]));
|
|
428
|
-
let d = !1;
|
|
429
|
-
function f() {
|
|
430
|
-
d || (d = !0, I = s, L = null, R = null, t());
|
|
431
|
-
}
|
|
432
|
-
if (l.length < 2 || typeof r.animate != "function") return f();
|
|
433
|
-
let p = r.animate(l.map(u), {
|
|
434
|
-
duration: (l.length - 1) * $ * 1e3,
|
|
435
|
-
easing: "linear"
|
|
436
|
-
});
|
|
437
|
-
p.finished.catch(() => {}), p.onfinish = f, L = () => {
|
|
438
|
-
let e = Number(p.currentTime ?? 0) / ($ * 1e3);
|
|
439
|
-
I = Math.max(0, Math.min(a, o + c * e)), d = !0, p.cancel();
|
|
440
|
-
}, R = n ? null : () => {
|
|
441
|
-
L?.(), L = null, R = null, t();
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
function ae(e, t) {
|
|
445
|
-
ce(e), z(e, t, !0);
|
|
446
|
-
}
|
|
447
|
-
function B(e, t) {
|
|
448
|
-
z(e, t, !1);
|
|
449
|
-
}
|
|
450
|
-
function V(e) {
|
|
451
|
-
b.value = "forward", _.value.push(e), C(() => ue());
|
|
452
|
-
}
|
|
453
|
-
function H() {
|
|
454
|
-
b.value = "backward", _.value.pop(), C(() => ue());
|
|
455
|
-
}
|
|
456
|
-
let U = A(!1), W = A(null), G = A(null), K = A({}), q = x("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
457
|
-
k("m-menu-panel-registry", q), P(G, (e, t) => {
|
|
458
|
-
t && q.delete(t), e && q.add(e);
|
|
459
|
-
}), ee(() => {
|
|
460
|
-
G.value && q.delete(G.value);
|
|
461
|
-
});
|
|
462
|
-
let J = x("m-menu-sibling-group", null);
|
|
463
|
-
k("m-menu-sibling-group", { current: null });
|
|
464
|
-
let Y = null, X = A(!1);
|
|
465
|
-
function oe() {
|
|
466
|
-
if (!W.value) return;
|
|
467
|
-
let e = W.value.getBoundingClientRect();
|
|
468
|
-
Y = e;
|
|
469
|
-
let t = window.innerHeight - e.bottom - 8;
|
|
470
|
-
X.value = t < 200 && e.top > t;
|
|
471
|
-
let n = {
|
|
472
|
-
maxHeight: `${Math.min(X.value ? e.top - 12 : t, 400)}px`,
|
|
473
|
-
maxWidth: `${window.innerWidth - 16}px`,
|
|
474
|
-
left: "0px"
|
|
475
|
-
};
|
|
476
|
-
X.value ? n.bottom = `${window.innerHeight - e.top + 4}px` : n.top = `${e.bottom + 4}px`, K.value = n;
|
|
477
|
-
}
|
|
478
|
-
let se = A(n.align === "right" ? "right" : "left");
|
|
479
|
-
function ce(e) {
|
|
480
|
-
if (!Y) return;
|
|
481
|
-
let t = e.offsetWidth, r = he(Y, t, window.innerWidth, n.align === "right" ? "end" : "start"), i = Math.min(t, Math.max(0, (Y.left + Y.right) / 2 - r)), a = Math.abs(r - Y.left) < 1 ? "left" : Math.abs(r + t - Y.right) < 1 ? "right" : `${i}px`;
|
|
482
|
-
se.value = a, K.value = {
|
|
483
|
-
...K.value,
|
|
484
|
-
left: `${r}px`
|
|
485
|
-
}, e.style.left = `${r}px`, e.style.transformOrigin = `${a} ${X.value ? "bottom" : "top"}`;
|
|
486
|
-
}
|
|
487
|
-
function le() {
|
|
488
|
-
return G.value ? Array.from(G.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
489
|
-
}
|
|
490
|
-
function ue() {
|
|
491
|
-
C(() => le()[0]?.focus());
|
|
492
|
-
}
|
|
493
|
-
function de(e) {
|
|
494
|
-
let t = le();
|
|
495
|
-
if (!t.length) return;
|
|
496
|
-
let n = t.indexOf(document.activeElement);
|
|
497
|
-
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
498
|
-
}
|
|
499
|
-
function fe() {
|
|
500
|
-
U.value ? J?.current === Z && (J.current = null) : (J && J.current && J.current !== Z && J.current(), J && (J.current = Z), oe(), _.value = []), U.value = !U.value, U.value && ue();
|
|
501
|
-
}
|
|
502
|
-
function Z() {
|
|
503
|
-
J?.current === Z && (J.current = null), U.value = !1;
|
|
504
|
-
}
|
|
505
|
-
k("m-menu-close", Z), k("m-menu-nav", {
|
|
506
|
-
mode: n.submenuMode,
|
|
507
|
-
push: V
|
|
508
|
-
}), t({
|
|
509
|
-
close: Z,
|
|
510
|
-
open: U
|
|
511
|
-
});
|
|
512
|
-
function pe(e) {
|
|
513
|
-
let t = e.target;
|
|
514
|
-
if (!W.value?.contains(t)) {
|
|
515
|
-
for (let e of q) if (e.contains(t)) return;
|
|
516
|
-
t.closest?.(".m3-submenu") || Z();
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
function Q(e) {
|
|
520
|
-
if (!U.value) return;
|
|
521
|
-
let t = e.target;
|
|
522
|
-
for (let e of q) if (e.contains(t)) return;
|
|
523
|
-
t.closest?.(".m3-submenu") || Z();
|
|
524
|
-
}
|
|
525
|
-
function xe(e) {
|
|
526
|
-
if (e.key === "Escape") {
|
|
527
|
-
_.value.length ? H() : Z();
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
U.value && (e.key === "ArrowDown" ? (e.preventDefault(), de(1)) : e.key === "ArrowUp" && (e.preventDefault(), de(-1)));
|
|
531
|
-
}
|
|
532
|
-
D(() => {
|
|
533
|
-
document.addEventListener("mousedown", pe), document.addEventListener("keydown", xe), window.addEventListener("scroll", Q, !0);
|
|
534
|
-
}), ee(() => {
|
|
535
|
-
document.removeEventListener("mousedown", pe), document.removeEventListener("keydown", xe), window.removeEventListener("scroll", Q, !0), R ? R() : L?.();
|
|
536
|
-
});
|
|
537
|
-
let Se = f(() => `${se.value} ${X.value ? "bottom" : "top"}`);
|
|
538
|
-
return (t, n) => (O(), h(l, null, [g("div", S({
|
|
539
|
-
ref_key: "triggerEl",
|
|
540
|
-
ref: W
|
|
541
|
-
}, t.$attrs, {
|
|
542
|
-
class: "inline-block",
|
|
543
|
-
onClick: fe
|
|
544
|
-
}), [M(t.$slots, "trigger", { open: U.value })], 16), (O(), p(u, { to: "body" }, [v(d, {
|
|
545
|
-
css: !1,
|
|
546
|
-
onEnter: ae,
|
|
547
|
-
onLeave: B
|
|
548
|
-
}, {
|
|
549
|
-
default: F(() => [U.value ? (O(), h("div", {
|
|
550
|
-
key: 0,
|
|
551
|
-
ref_key: "dropdownEl",
|
|
552
|
-
ref: G,
|
|
553
|
-
class: w(["fixed z-500 min-w-48", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "shadow-elevation-2"]]),
|
|
554
|
-
style: T({
|
|
555
|
-
...K.value,
|
|
556
|
-
transformOrigin: Se.value
|
|
557
|
-
})
|
|
558
|
-
}, [g("div", { class: w(["overflow-hidden", [e.variant === "expressive" ? "rounded-lg" : "rounded-xs", c.value ? "" : "bg-surface-container"]]) }, [g("div", {
|
|
559
|
-
class: "relative overflow-y-auto overscroll-contain py-1",
|
|
560
|
-
style: T({ maxHeight: K.value.maxHeight })
|
|
561
|
-
}, [v(d, {
|
|
562
|
-
css: !1,
|
|
563
|
-
onEnter: E,
|
|
564
|
-
onLeave: ne
|
|
565
|
-
}, {
|
|
566
|
-
default: F(() => [y.value ? (O(), h("div", { key: _.value.length }, [g("button", {
|
|
567
|
-
type: "button",
|
|
568
|
-
class: "flex w-full items-center gap-3 border-b border-outline-variant px-4 py-2.5 text-left text-body-large text-on-surface outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
569
|
-
onClick: H
|
|
570
|
-
}, [
|
|
571
|
-
v(s, {
|
|
572
|
-
name: "chevron_left",
|
|
573
|
-
size: 20,
|
|
574
|
-
class: "shrink-0 text-on-surface-variant"
|
|
575
|
-
}),
|
|
576
|
-
y.value.icon ? (O(), p(s, {
|
|
577
|
-
key: 0,
|
|
578
|
-
name: y.value.icon,
|
|
579
|
-
size: 20,
|
|
580
|
-
class: "shrink-0 text-on-surface-variant"
|
|
581
|
-
}, null, 8, ["name"])) : m("", !0),
|
|
582
|
-
g("span", ge, [(O(), p(te(() => y.value?.header?.())))])
|
|
583
|
-
]), (O(), p(te(() => y.value?.content?.())))])) : (O(), h("div", _e, [c.value ? (O(), h("div", ve, [(O(!0), h(l, null, j(o.value, (e, t) => (O(), h("div", {
|
|
584
|
-
key: t,
|
|
585
|
-
class: "rounded-lg shadow-elevation-2"
|
|
586
|
-
}, [g("div", ye, [(O(), p(te(() => e)))])]))), 128))])) : M(t.$slots, "default", { close: Z }, void 0, void 0, 1)]))]),
|
|
587
|
-
_: 3
|
|
588
|
-
})], 4)], 2)], 6)) : m("", !0)]),
|
|
589
|
-
_: 3
|
|
590
|
-
})]))], 64));
|
|
591
|
-
}
|
|
592
|
-
}), Se = ["data-m3-menu-choice"], Ce = { class: "flex-1" }, we = {
|
|
593
|
-
key: 2,
|
|
594
|
-
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
595
|
-
}, Te = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Ee = 32, De = /* @__PURE__ */ y({
|
|
596
|
-
__name: "MMenuItem",
|
|
597
|
-
props: {
|
|
598
|
-
icon: {},
|
|
599
|
-
shortcut: {},
|
|
600
|
-
to: {},
|
|
601
|
-
disabled: {
|
|
602
|
-
type: Boolean,
|
|
603
|
-
default: !1
|
|
604
|
-
},
|
|
605
|
-
danger: {
|
|
606
|
-
type: Boolean,
|
|
607
|
-
default: !1
|
|
608
|
-
},
|
|
609
|
-
keepOpen: {
|
|
610
|
-
type: Boolean,
|
|
611
|
-
default: void 0
|
|
612
|
-
},
|
|
613
|
-
selected: {
|
|
614
|
-
type: Boolean,
|
|
615
|
-
default: void 0
|
|
616
|
-
},
|
|
617
|
-
checked: {
|
|
618
|
-
type: Boolean,
|
|
619
|
-
default: void 0
|
|
620
|
-
},
|
|
621
|
-
selectedIcon: {}
|
|
622
|
-
},
|
|
623
|
-
emits: ["click", "update:checked"],
|
|
624
|
-
setup(e, { emit: r }) {
|
|
625
|
-
let i = e, a = r, c = f(() => i.checked !== void 0), l = f(() => c.value || i.selected !== void 0), _ = f(() => !!(i.checked ?? i.selected)), y = f(() => l.value && !i.icon), b = f(() => i.selectedIcon ?? (i.icon ? void 0 : "check")), S = A("single");
|
|
626
|
-
function E() {
|
|
627
|
-
let e = B.value;
|
|
628
|
-
if (!e || !l.value) return;
|
|
629
|
-
let t = (e) => !!e?.hasAttribute("data-m3-menu-choice"), n = t(e.previousElementSibling), r = t(e.nextElementSibling);
|
|
630
|
-
S.value = n && r ? "middle" : n ? "last" : r ? "first" : "single";
|
|
631
|
-
}
|
|
632
|
-
function k() {
|
|
633
|
-
if (_.value) return [
|
|
634
|
-
12,
|
|
635
|
-
12,
|
|
636
|
-
12,
|
|
637
|
-
12
|
|
638
|
-
];
|
|
639
|
-
let e = S.value === "first" ? 12 : 4, t = S.value === "last" ? 12 : 4;
|
|
640
|
-
return [
|
|
641
|
-
e,
|
|
642
|
-
e,
|
|
643
|
-
t,
|
|
644
|
-
t
|
|
645
|
-
];
|
|
646
|
-
}
|
|
647
|
-
let { snap: j } = n(() => l.value ? [...k(), y.value && _.value ? Ee : 0] : [], ([e, t, n, r, i]) => {
|
|
648
|
-
let a = V.value instanceof HTMLElement ? V.value : V.value?.$el;
|
|
649
|
-
a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), H.value && i !== void 0 && (H.value.style.width = `${i}px`);
|
|
650
|
-
}, o);
|
|
651
|
-
P(S, () => j());
|
|
652
|
-
let re = null;
|
|
653
|
-
D(() => {
|
|
654
|
-
E();
|
|
655
|
-
let e = B.value?.parentElement;
|
|
656
|
-
e && (re = new MutationObserver(E), re.observe(e, { childList: !0 }));
|
|
657
|
-
}), ee(() => re?.disconnect()), P(l, () => C(E)), n(() => y.value ? [+!!_.value] : [], ([e]) => {
|
|
658
|
-
H.value && e !== void 0 && (H.value.style.opacity = String(e));
|
|
659
|
-
}, t);
|
|
660
|
-
let I = ie(), L = f(() => i.to ? "RouterLink" : "button"), R = f(() => !!I.children), z = x("m-menu-close", null), ae = x("m-menu-nav", null), B = A(), V = A(), H = A(), U = A(!1), W = A({});
|
|
661
|
-
function G() {
|
|
662
|
-
if (!B.value) return;
|
|
663
|
-
let e = B.value.getBoundingClientRect();
|
|
664
|
-
W.value = {
|
|
665
|
-
position: "fixed",
|
|
666
|
-
top: `${e.top}px`,
|
|
667
|
-
left: `${e.right}px`,
|
|
668
|
-
maxWidth: `${window.innerWidth - 16}px`,
|
|
669
|
-
zIndex: "501"
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
function K(e) {
|
|
673
|
-
if (!B.value) return;
|
|
674
|
-
let t = e, n = B.value.getBoundingClientRect();
|
|
675
|
-
t.style.left = "0px";
|
|
676
|
-
let r = t.offsetWidth, i = t.offsetHeight, a = Q([n.right, n.left - r], r, window.innerWidth), o = Q([n.top, n.bottom - i], i, window.innerHeight);
|
|
677
|
-
W.value = {
|
|
678
|
-
...W.value,
|
|
679
|
-
left: `${a}px`,
|
|
680
|
-
top: `${o}px`
|
|
681
|
-
}, t.style.left = `${a}px`, t.style.top = `${o}px`;
|
|
682
|
-
}
|
|
683
|
-
function q() {
|
|
684
|
-
if (U.value) {
|
|
685
|
-
U.value = !1;
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
G(), U.value = !0;
|
|
689
|
-
}
|
|
690
|
-
function J() {
|
|
691
|
-
if (!i.disabled) {
|
|
692
|
-
if (R.value) {
|
|
693
|
-
ae?.mode === "push" ? ae.push({
|
|
694
|
-
icon: i.icon,
|
|
695
|
-
header: I.default,
|
|
696
|
-
content: I.children
|
|
697
|
-
}) : q();
|
|
698
|
-
return;
|
|
699
|
-
}
|
|
700
|
-
c.value && a("update:checked", !i.checked), a("click"), (i.keepOpen ?? c.value) || z?.();
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
function Y(e) {
|
|
704
|
-
e.pointerType === "mouse" && R.value && !i.disabled && (G(), U.value = !0);
|
|
705
|
-
}
|
|
706
|
-
function X(e) {
|
|
707
|
-
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (U.value = !1));
|
|
708
|
-
}
|
|
709
|
-
function oe(e) {
|
|
710
|
-
if (e.pointerType !== "mouse") return;
|
|
711
|
-
let t = e.relatedTarget;
|
|
712
|
-
t?.closest(".m3-submenu") || B.value?.contains(t) || (U.value = !1);
|
|
713
|
-
}
|
|
714
|
-
return (t, n) => (O(), h("div", {
|
|
715
|
-
ref_key: "itemEl",
|
|
716
|
-
ref: B,
|
|
717
|
-
"data-m3-menu-choice": l.value || void 0,
|
|
718
|
-
onPointerenter: Y,
|
|
719
|
-
onPointerleave: X
|
|
720
|
-
}, [(O(), p(te(L.value), {
|
|
721
|
-
ref_key: "controlEl",
|
|
722
|
-
ref: V,
|
|
723
|
-
to: e.to || void 0,
|
|
724
|
-
type: e.to ? void 0 : "button",
|
|
725
|
-
role: l.value ? c.value ? "menuitemcheckbox" : "menuitemradio" : void 0,
|
|
726
|
-
"aria-checked": l.value ? _.value : void 0,
|
|
727
|
-
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", l.value ? [
|
|
728
|
-
"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",
|
|
729
|
-
_.value ? "bg-tertiary-container text-on-tertiary-container" : "text-on-surface",
|
|
730
|
-
e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"
|
|
731
|
-
] : [
|
|
732
|
-
"w-full px-4",
|
|
733
|
-
e.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
|
|
734
|
-
!e.disabled && e.danger ? "text-error hover:bg-error/8" : "",
|
|
735
|
-
!e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
|
|
736
|
-
]]),
|
|
737
|
-
disabled: e.disabled || void 0,
|
|
738
|
-
"aria-haspopup": R.value ? "menu" : void 0,
|
|
739
|
-
"aria-expanded": R.value ? U.value : void 0,
|
|
740
|
-
onClick: J
|
|
741
|
-
}, {
|
|
742
|
-
default: F(() => [
|
|
743
|
-
y.value ? (O(), h("span", {
|
|
744
|
-
key: 0,
|
|
745
|
-
ref_key: "iconSlotEl",
|
|
746
|
-
ref: H,
|
|
747
|
-
class: "-mr-3 flex shrink-0 overflow-hidden",
|
|
748
|
-
style: {
|
|
749
|
-
width: "0",
|
|
750
|
-
opacity: "0"
|
|
751
|
-
}
|
|
752
|
-
}, [v(s, {
|
|
753
|
-
name: b.value,
|
|
754
|
-
size: 20,
|
|
755
|
-
class: "shrink-0"
|
|
756
|
-
}, null, 8, ["name"])], 512)) : e.icon ? (O(), p(s, {
|
|
757
|
-
key: 1,
|
|
758
|
-
name: _.value && b.value ? b.value : e.icon,
|
|
759
|
-
filled: _.value && !b.value,
|
|
760
|
-
size: 20,
|
|
761
|
-
class: w(["shrink-0", l.value ? _.value ? "" : "text-on-surface-variant" : e.danger ? "text-error" : "text-on-surface-variant"])
|
|
762
|
-
}, null, 8, [
|
|
763
|
-
"name",
|
|
764
|
-
"filled",
|
|
765
|
-
"class"
|
|
766
|
-
])) : m("", !0),
|
|
767
|
-
g("span", Ce, [M(t.$slots, "default")]),
|
|
768
|
-
e.shortcut && !R.value ? (O(), h("span", we, ne(e.shortcut), 1)) : m("", !0),
|
|
769
|
-
R.value ? (O(), p(s, {
|
|
770
|
-
key: 3,
|
|
771
|
-
name: "chevron_right",
|
|
772
|
-
size: 18,
|
|
773
|
-
class: "shrink-0 text-on-surface-variant"
|
|
774
|
-
})) : m("", !0)
|
|
775
|
-
]),
|
|
776
|
-
_: 3
|
|
777
|
-
}, 8, [
|
|
778
|
-
"to",
|
|
779
|
-
"type",
|
|
780
|
-
"role",
|
|
781
|
-
"aria-checked",
|
|
782
|
-
"class",
|
|
783
|
-
"disabled",
|
|
784
|
-
"aria-haspopup",
|
|
785
|
-
"aria-expanded"
|
|
786
|
-
])), R.value && N(ae)?.mode !== "push" ? (O(), p(u, {
|
|
787
|
-
key: 0,
|
|
788
|
-
to: "body"
|
|
789
|
-
}, [v(d, {
|
|
790
|
-
"enter-active-class": "transition-opacity duration-100",
|
|
791
|
-
"enter-from-class": "opacity-0",
|
|
792
|
-
"leave-active-class": "transition-opacity duration-75",
|
|
793
|
-
"leave-to-class": "opacity-0",
|
|
794
|
-
onEnter: K
|
|
795
|
-
}, {
|
|
796
|
-
default: F(() => [U.value ? (O(), h("div", {
|
|
797
|
-
key: 0,
|
|
798
|
-
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
799
|
-
style: T(W.value),
|
|
800
|
-
onPointerleave: oe
|
|
801
|
-
}, [g("div", Te, [M(t.$slots, "children")])], 36)) : m("", !0)]),
|
|
802
|
-
_: 3
|
|
803
|
-
})])) : m("", !0)], 40, Se));
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
//#endregion
|
|
807
|
-
export { me as a, V as c, Q as i, xe as n, Z as o, he as r, U as s, De as t };
|
|
808
|
-
|
|
809
|
-
//# sourceMappingURL=MMenuItem-BckcR0nW.js.map
|