@m3ui-vue/m3ui-vue 1.1.4 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +511 -34
- package/dist/MMenuItem-DI351kIf.js +929 -0
- package/dist/MMenuItem-DI351kIf.js.map +1 -0
- package/dist/{MSlider-JflHJ70q.js → MSlider-BnEy5ieZ.js} +295 -320
- 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/MButton.vue.d.ts +7 -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/MContextMenu.vue.d.ts +2 -2
- package/dist/components/MCopyButton.vue.d.ts +1 -1
- 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/MIconButton.vue.d.ts +13 -1
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- 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/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/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/MTooltip.vue.d.ts +1 -1
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -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/useLocale.d.ts +3 -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 +28 -1
- package/dist/locales/index.js +21 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7132 -6217
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +821 -791
- 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 +13 -9
- 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-CXibICQA.js → useLocale-JYxDDeXC.js} +4 -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 +1 -1
- 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__/MIconButton.test.ts +33 -0
- package/src/__tests__/MMap.test.ts +53 -1
- package/src/__tests__/MMapLayers.test.ts +46 -2
- 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__/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__/MSegmentedButton.test.ts +10 -0
- package/src/__tests__/MSkeleton.test.ts +38 -0
- package/src/__tests__/MTimeline.test.ts +238 -0
- package/src/__tests__/_fakeMaplibre.ts +3 -1
- package/src/__tests__/attrsFallthrough.test.ts +3 -0
- package/src/__tests__/escapeStack.test.ts +93 -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/MAutocomplete.vue +5 -0
- package/src/components/MBottomSheet.vue +4 -1
- package/src/components/MButton.vue +15 -1
- 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/MContextMenu.vue +19 -60
- package/src/components/MDragDropList.vue +2 -0
- package/src/components/MIconButton.vue +40 -1
- package/src/components/MKanban.vue +2 -0
- package/src/components/MLightbox.vue +7 -2
- 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 +4 -15
- 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 +20 -18
- 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/MSpotlightSearch.vue +3 -2
- package/src/components/MTextField.vue +15 -2
- package/src/components/MTimeline.vue +370 -81
- package/src/components/MTooltip.vue +20 -152
- package/src/components/_MDrawerItemList.vue +25 -6
- package/src/composables/_mapStyle.ts +45 -0
- package/src/composables/_themeTransition.ts +2 -0
- package/src/composables/_tooltipTrigger.ts +184 -0
- package/src/composables/_useMenuNav.ts +209 -0
- package/src/composables/useAutoGrow.ts +78 -0
- package/src/composables/useLocale.ts +5 -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 +28 -1
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -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/map.ts +1 -1
- package/src/plugin.ts +34 -0
- package/src/styles/theme.css +63 -0
- package/dist/MMenuItem-BfjqwcYP.js +0 -830
- package/dist/MMenuItem-BfjqwcYP.js.map +0 -1
- package/dist/MSlider-JflHJ70q.js.map +0 -1
- package/dist/MTextField-NaIB6RbM.js +0 -673
- package/dist/MTextField-NaIB6RbM.js.map +0 -1
- package/dist/composables/_useThemeTokens.d.ts +0 -7
- package/dist/useLocale-CXibICQA.js.map +0 -1
- package/src/composables/_useThemeTokens.ts +0 -42
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import {
|
|
1
|
+
import { i as e } from "./useLocale-JYxDDeXC.js";
|
|
2
|
+
import { l as t, o as n, s as r } from "./MTextField-BBmkaIbO.js";
|
|
3
3
|
import { t as i } from "./MIcon-Bxh9j135.js";
|
|
4
4
|
import { Fragment as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, h as g, inject as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onUnmounted as w, onUpdated as T, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as ee, shallowRef as j, toDisplayString as M, unref as te, useId as N, useSlots as P, watch as F, withCtx as ne, withModifiers as I } from "vue";
|
|
5
|
-
//#
|
|
6
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/components/MAvatar.vue
|
|
7
|
+
var L = /* @__PURE__ */ m({
|
|
7
8
|
__name: "MAvatar",
|
|
8
9
|
props: {
|
|
9
10
|
name: {},
|
|
@@ -27,49 +28,23 @@ var L = "m3-theme", R = "m3-dynamic-palette", z = "m3-viewport", re = /* @__PURE
|
|
|
27
28
|
})
|
|
28
29
|
}, M(n.value), 5));
|
|
29
30
|
}
|
|
30
|
-
}),
|
|
31
|
-
function ae(e, t, n, r, i) {
|
|
32
|
-
let a = [e], o = e, s = n, c = 2 * r.dampingRatio * Math.sqrt(r.stiffness);
|
|
33
|
-
for (let e = 0; e < 600; e++) {
|
|
34
|
-
for (let e = B / 1e3; e > 1e-9; e -= ie) {
|
|
35
|
-
let n = Math.min(ie, e);
|
|
36
|
-
s += (-r.stiffness * (o - t) - c * s) * n, o += s * n;
|
|
37
|
-
}
|
|
38
|
-
if (a.push(o), Math.abs(o - t) < i && Math.abs(s) < i * 10) break;
|
|
39
|
-
}
|
|
40
|
-
return a[a.length - 1] = t, a;
|
|
41
|
-
}
|
|
42
|
-
function oe(e, t) {
|
|
43
|
-
let n = Number(t ?? 0) / B, r = Math.floor(n);
|
|
44
|
-
return r >= e.length - 1 ? e[e.length - 1] : r < 0 ? e[0] : e[r] + (e[r + 1] - e[r]) * (n - r);
|
|
45
|
-
}
|
|
46
|
-
var se = (e) => (e.length - 1) * B;
|
|
47
|
-
function ce(e, t, n, r = 0) {
|
|
48
|
-
if (!e || typeof e.animate != "function" || t.length < 2) return null;
|
|
49
|
-
let i = e.animate(t.map(n), {
|
|
50
|
-
duration: se(t),
|
|
51
|
-
delay: r,
|
|
52
|
-
easing: "linear"
|
|
53
|
-
});
|
|
54
|
-
return i.finished.catch(() => {}), i;
|
|
55
|
-
}
|
|
56
|
-
var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, V = [
|
|
31
|
+
}), R = [
|
|
57
32
|
"role",
|
|
58
33
|
"tabindex",
|
|
59
34
|
"aria-disabled"
|
|
60
|
-
],
|
|
35
|
+
], z = ["src", "alt"], B = {
|
|
61
36
|
key: 1,
|
|
62
37
|
class: "px-4 pt-4 pb-2"
|
|
63
|
-
},
|
|
38
|
+
}, V = {
|
|
64
39
|
key: 2,
|
|
65
40
|
class: "px-4 pt-4 pb-2"
|
|
66
|
-
},
|
|
41
|
+
}, re = { class: "text-title-large font-medium text-on-surface" }, ie = {
|
|
67
42
|
key: 0,
|
|
68
43
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
69
|
-
},
|
|
44
|
+
}, ae = {
|
|
70
45
|
key: 3,
|
|
71
46
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
72
|
-
},
|
|
47
|
+
}, oe = "relative before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-on-surface before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] active:before:opacity-[0.12]", se = /* @__PURE__ */ m({
|
|
73
48
|
__name: "MCard",
|
|
74
49
|
props: {
|
|
75
50
|
variant: { default: "elevated" },
|
|
@@ -118,7 +93,7 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
118
93
|
o.value ? [
|
|
119
94
|
"cursor-pointer",
|
|
120
95
|
a[n.value],
|
|
121
|
-
|
|
96
|
+
oe
|
|
122
97
|
] : "",
|
|
123
98
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
124
99
|
]]),
|
|
@@ -136,20 +111,20 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
136
111
|
src: e.image,
|
|
137
112
|
alt: e.imageAlt ?? "",
|
|
138
113
|
class: "h-full w-full object-cover"
|
|
139
|
-
}, null, 8,
|
|
140
|
-
t.$slots.header ? (E(), u("div",
|
|
114
|
+
}, null, 8, z)) : A(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : l("", !0),
|
|
115
|
+
t.$slots.header ? (E(), u("div", B, [A(t.$slots, "header")])) : e.title ? (E(), u("div", V, [d("h3", re, M(e.title), 1), e.subtitle ? (E(), u("p", ie, M(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
141
116
|
A(t.$slots, "default"),
|
|
142
|
-
t.$slots.actions ? (E(), u("div",
|
|
143
|
-
], 46,
|
|
117
|
+
t.$slots.actions ? (E(), u("div", ae, [A(t.$slots, "actions")])) : l("", !0)
|
|
118
|
+
], 46, R));
|
|
144
119
|
}
|
|
145
|
-
}),
|
|
120
|
+
}), ce = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, H = [
|
|
146
121
|
"checked",
|
|
147
122
|
"disabled",
|
|
148
123
|
"aria-label"
|
|
149
|
-
],
|
|
124
|
+
], le = {
|
|
150
125
|
key: 1,
|
|
151
126
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
152
|
-
},
|
|
127
|
+
}, U = /* @__PURE__ */ m({
|
|
153
128
|
__name: "MCheckbox",
|
|
154
129
|
props: {
|
|
155
130
|
modelValue: { type: Boolean },
|
|
@@ -178,7 +153,7 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
178
153
|
tertiary: "bg-tertiary",
|
|
179
154
|
error: "bg-error"
|
|
180
155
|
};
|
|
181
|
-
return (t, o) => (E(), u("label", { class: b(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [d("span",
|
|
156
|
+
return (t, o) => (E(), u("label", { class: b(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [d("span", ce, [
|
|
182
157
|
d("input", {
|
|
183
158
|
type: "checkbox",
|
|
184
159
|
class: "peer sr-only",
|
|
@@ -186,12 +161,12 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
186
161
|
disabled: e.disabled,
|
|
187
162
|
"aria-label": e.ariaLabel,
|
|
188
163
|
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
189
|
-
}, null, 40,
|
|
164
|
+
}, null, 40, H),
|
|
190
165
|
e.disabled ? l("", !0) : (E(), u("span", {
|
|
191
166
|
key: 0,
|
|
192
167
|
class: b(["pointer-events-none absolute inset-0 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12]", e.modelValue || e.indeterminate ? a[e.color] : "bg-on-surface"])
|
|
193
168
|
}, null, 2)),
|
|
194
|
-
e.disabled ? l("", !0) : (E(), u("span",
|
|
169
|
+
e.disabled ? l("", !0) : (E(), u("span", le)),
|
|
195
170
|
d("span", { class: b(["relative inline-flex h-4.5 w-4.5 items-center justify-center rounded-[2px] border-2 transition-colors", e.disabled ? e.modelValue || e.indeterminate ? "border-on-surface/38 bg-on-surface/38 text-surface" : "border-on-surface/38 text-transparent" : e.modelValue || e.indeterminate ? r[e.color] : "border-on-surface-variant text-transparent group-hover:border-on-surface group-active:border-on-surface"]) }, [p(i, {
|
|
196
171
|
name: e.indeterminate ? "remove" : "check",
|
|
197
172
|
size: 18,
|
|
@@ -202,7 +177,7 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
202
177
|
class: b(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
203
178
|
}, [A(t.$slots, "default", {}, () => [f(M(e.label), 1)])], 2)) : l("", !0)], 2));
|
|
204
179
|
}
|
|
205
|
-
}),
|
|
180
|
+
}), ue = ["disabled", "aria-pressed"], W = { class: "whitespace-nowrap" }, de = ["aria-label", "disabled"], fe = ["aria-label", "disabled"], G = "relative cursor-pointer before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] active:before:opacity-[0.12] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", K = /* @__PURE__ */ m({
|
|
206
181
|
__name: "MChip",
|
|
207
182
|
props: {
|
|
208
183
|
tone: { default: "neutral" },
|
|
@@ -268,11 +243,11 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
268
243
|
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
269
244
|
return m.elevated && m.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
270
245
|
}), j = s(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), M = s(() => m.type === "input" ? [T.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", D.value ? "pr-2" : "pr-3"] : [m.icon || R.value ? "pl-2" : "pl-4", D.value ? "pr-2" : "pr-4"]), N = O(!1), F = O(), L = O(), R = s(() => m.type === "filter" && !m.icon);
|
|
271
|
-
|
|
246
|
+
t(() => m.type === "filter" || m.type === "input" ? [N.value ? 8 : m.selected ? 16 : 12, R.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
272
247
|
F.value && e !== void 0 && (F.value.style.borderRadius = `${e}px`), L.value && t !== void 0 && (L.value.style.width = `${t}px`);
|
|
273
|
-
}, r),
|
|
248
|
+
}, r), t(() => R.value ? [+!!m.selected] : [], ([e]) => {
|
|
274
249
|
L.value && e !== void 0 && (L.value.style.opacity = String(e));
|
|
275
|
-
},
|
|
250
|
+
}, n);
|
|
276
251
|
function z() {
|
|
277
252
|
m.disabled || (w.value && h("update:selected", !m.selected), h("click"));
|
|
278
253
|
}
|
|
@@ -320,14 +295,14 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
320
295
|
size: 18,
|
|
321
296
|
class: b(["shrink-0", j.value])
|
|
322
297
|
}, null, 8, ["class"])], 512)) : l("", !0),
|
|
323
|
-
d("span",
|
|
298
|
+
d("span", W, [A(e.$slots, "default")]),
|
|
324
299
|
a.trailingIcon ? (E(), c(i, {
|
|
325
300
|
key: 3,
|
|
326
301
|
name: a.trailingIcon,
|
|
327
302
|
size: 18,
|
|
328
303
|
class: b(["shrink-0", a.disabled ? "" : a.selected && w.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
329
304
|
}, null, 8, ["name", "class"])) : l("", !0)
|
|
330
|
-
], 42,
|
|
305
|
+
], 42, ue), a.type === "input" && a.removable ? (E(), u("button", {
|
|
331
306
|
key: 0,
|
|
332
307
|
type: "button",
|
|
333
308
|
class: b(["relative -ml-1 mr-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary", a.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
@@ -337,14 +312,14 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
337
312
|
}, [p(i, {
|
|
338
313
|
name: "close",
|
|
339
314
|
size: 18
|
|
340
|
-
})], 10,
|
|
315
|
+
})], 10, de)) : l("", !0)], 2)) : (E(), c(ee(a.clickable ? "button" : "span"), {
|
|
341
316
|
key: 1,
|
|
342
317
|
type: a.clickable ? "button" : void 0,
|
|
343
318
|
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
344
319
|
class: b(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
345
320
|
C.value,
|
|
346
321
|
S.value,
|
|
347
|
-
a.clickable && !a.disabled ?
|
|
322
|
+
a.clickable && !a.disabled ? G : "",
|
|
348
323
|
a.disabled ? "cursor-not-allowed" : ""
|
|
349
324
|
]]),
|
|
350
325
|
style: x(y.value),
|
|
@@ -367,7 +342,7 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
367
342
|
}, [p(i, {
|
|
368
343
|
name: "close",
|
|
369
344
|
size: 16
|
|
370
|
-
})], 8,
|
|
345
|
+
})], 8, fe)) : l("", !0)
|
|
371
346
|
]),
|
|
372
347
|
_: 3
|
|
373
348
|
}, 8, [
|
|
@@ -380,7 +355,7 @@ var le = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-mo
|
|
|
380
355
|
});
|
|
381
356
|
//#endregion
|
|
382
357
|
//#region src/composables/_useSegmentRuns.ts
|
|
383
|
-
function
|
|
358
|
+
function q(e) {
|
|
384
359
|
let t = j(/* @__PURE__ */ new Map());
|
|
385
360
|
function n() {
|
|
386
361
|
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
@@ -396,7 +371,7 @@ function xe(e) {
|
|
|
396
371
|
}
|
|
397
372
|
//#endregion
|
|
398
373
|
//#region src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
399
|
-
var
|
|
374
|
+
var pe = ["role"], me = /* @__PURE__ */ m({
|
|
400
375
|
__name: "MList",
|
|
401
376
|
props: {
|
|
402
377
|
dense: {
|
|
@@ -424,7 +399,7 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
424
399
|
},
|
|
425
400
|
emits: ["update:selected"],
|
|
426
401
|
setup(e, { emit: t }) {
|
|
427
|
-
let n = e, r = t, i = O(), a =
|
|
402
|
+
let n = e, r = t, i = O(), a = q(i);
|
|
428
403
|
D("m-list", {
|
|
429
404
|
segmentPosition: a,
|
|
430
405
|
dense: s(() => n.dense),
|
|
@@ -461,12 +436,12 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
461
436
|
role: e.selectable ? "listbox" : "list",
|
|
462
437
|
class: b(d.value),
|
|
463
438
|
onKeydown: c
|
|
464
|
-
}, [A(t.$slots, "default")], 42,
|
|
439
|
+
}, [A(t.$slots, "default")], 42, pe));
|
|
465
440
|
}
|
|
466
|
-
}),
|
|
441
|
+
}), J = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], ge = {
|
|
467
442
|
key: 0,
|
|
468
443
|
class: "text-body-large text-on-surface"
|
|
469
|
-
},
|
|
444
|
+
}, _e = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", Y = /* @__PURE__ */ m({
|
|
470
445
|
__name: "MSwitch",
|
|
471
446
|
props: {
|
|
472
447
|
modelValue: { type: Boolean },
|
|
@@ -523,14 +498,14 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
523
498
|
onPointerup: v,
|
|
524
499
|
onPointerleave: v,
|
|
525
500
|
onPointercancel: v
|
|
526
|
-
}, [d("span",
|
|
501
|
+
}, [d("span", J, [d("span", { class: b(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? a[e.color] : "border-outline bg-surface-container-highest"]) }, [
|
|
527
502
|
d("input", {
|
|
528
503
|
type: "checkbox",
|
|
529
504
|
class: "peer sr-only",
|
|
530
505
|
checked: e.modelValue,
|
|
531
506
|
disabled: e.disabled,
|
|
532
507
|
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
533
|
-
}, null, 40,
|
|
508
|
+
}, null, 40, he),
|
|
534
509
|
e.disabled ? l("", !0) : (E(), u("span", {
|
|
535
510
|
key: 0,
|
|
536
511
|
class: b(["pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12] peer-focus-visible:opacity-[0.08]", e.modelValue ? h[e.color] : "bg-on-surface-variant"]),
|
|
@@ -542,7 +517,7 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
542
517
|
style: x(C.value)
|
|
543
518
|
}, null, 4)),
|
|
544
519
|
d("span", {
|
|
545
|
-
class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [f[e.color], "shadow-sm"] :
|
|
520
|
+
class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [f[e.color], "shadow-sm"] : _e]),
|
|
546
521
|
style: x(S.value)
|
|
547
522
|
}, [p(o, {
|
|
548
523
|
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
@@ -560,14 +535,14 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
560
535
|
}, null, 8, ["class"])) : l("", !0)]),
|
|
561
536
|
_: 1
|
|
562
537
|
})], 6)
|
|
563
|
-
], 2)]), e.label ? (E(), u("span",
|
|
538
|
+
], 2)]), e.label ? (E(), u("span", ge, M(e.label), 1)) : l("", !0)], 34));
|
|
564
539
|
}
|
|
565
|
-
}),
|
|
540
|
+
}), ve = [
|
|
566
541
|
"tabindex",
|
|
567
542
|
"aria-expanded",
|
|
568
543
|
"aria-controls",
|
|
569
544
|
"aria-disabled"
|
|
570
|
-
],
|
|
545
|
+
], ye = { class: "min-w-0 flex-1" }, be = ["id"], xe = { class: "mli-expand-body" }, Se = ["src"], Ce = { class: "min-w-0 flex-1" }, we = 4, Te = 8, Ee = 16, De = /* @__PURE__ */ m({
|
|
571
546
|
inheritAttrs: !1,
|
|
572
547
|
__name: "MListItem",
|
|
573
548
|
props: {
|
|
@@ -608,227 +583,227 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
608
583
|
"update:trailingValue",
|
|
609
584
|
"update:expanded"
|
|
610
585
|
],
|
|
611
|
-
setup(e, { emit:
|
|
612
|
-
let r = e, a =
|
|
586
|
+
setup(e, { emit: n }) {
|
|
587
|
+
let r = e, a = n, f = h(), m = () => !!f?.vnode.props?.onClick, y = O(r.expanded ?? !1);
|
|
613
588
|
F(() => r.expanded, (e) => {
|
|
614
589
|
e !== void 0 && (y.value = e);
|
|
615
590
|
});
|
|
616
591
|
let x = s(() => y.value), S = _("m-list", null), C = s(() => r.lines ? r.lines : S?.lines.value ? S.lines.value : r.description || r.overline && r.subtitle ? 3 : r.subtitle || r.overline ? 2 : 1), w = s(() => r.clickable || r.href || r.to || m() || S?.selectable.value || r.expandable), T = s(() => !!S?.selectable.value && r.value != null && !r.href && !r.to && !r.expandable), D = s(() => !!(r.href || r.to)), k = s(() => !T.value && !D.value && !r.expandable && (r.clickable || m())), j = s(() => D.value || k.value), P = s(() => T.value ? "option" : k.value ? "button" : D.value ? void 0 : "listitem"), I = s(() => {
|
|
617
|
-
if (T.value) return
|
|
592
|
+
if (T.value) return z.value && !r.disabled ? 0 : -1;
|
|
618
593
|
if (k.value) return r.disabled ? -1 : 0;
|
|
619
594
|
});
|
|
620
|
-
function
|
|
621
|
-
(T.value || k.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(),
|
|
595
|
+
function R(e) {
|
|
596
|
+
(T.value || k.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), Le(e)));
|
|
622
597
|
}
|
|
623
|
-
let
|
|
598
|
+
let z = s(() => r.active ? !0 : S?.selectable.value && r.value != null ? S.selected.value === r.value : !1), B = s(() => r.leading ? r.leading : r.icon ? "icon" : r.avatarName ? "avatar" : r.image ? "image" : null), V = s(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), re = {
|
|
624
599
|
primary: "bg-primary-container text-on-primary-container",
|
|
625
600
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
626
601
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
627
602
|
error: "bg-error-container text-on-error-container",
|
|
628
603
|
success: "bg-success-container text-on-success-container"
|
|
629
|
-
},
|
|
604
|
+
}, ie = s(() => S?.dense.value ?? !1), ae = s(() => S?.nav.value ?? !1), oe = s(() => S?.segmented.value ?? !1), se = s(() => S?.dividers.value ?? !1), ce = s(() => z.value ? "text-on-secondary-container" : "text-on-surface"), H = s(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), le = s(() => ie.value ? "" : C.value === 3 ? "min-h-22" : C.value === 2 ? "min-h-18" : "min-h-14"), ue = s(() => [
|
|
630
605
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
606
|
+
oe.value ? "bg-surface-container px-4" : ae.value ? "rounded-full px-4" : "px-4",
|
|
607
|
+
ie.value ? "py-1" : C.value === 3 ? "py-3" : "py-2",
|
|
608
|
+
le.value,
|
|
634
609
|
w.value && !r.disabled && "cursor-pointer transition-colors duration-150 hover:bg-on-surface/8 active:bg-on-surface/12",
|
|
635
|
-
|
|
610
|
+
z.value && "bg-secondary-container text-on-secondary-container",
|
|
636
611
|
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
637
|
-
]),
|
|
612
|
+
]), W = O(null), de = O(null), fe = (e, { slots: t }) => j.value ? g("li", {
|
|
638
613
|
role: "listitem",
|
|
639
614
|
ref: (e) => {
|
|
640
|
-
|
|
615
|
+
de.value = e;
|
|
641
616
|
}
|
|
642
|
-
}, t.default?.()) : t.default?.(),
|
|
643
|
-
if (
|
|
644
|
-
let e = w.value && !r.disabled, t = e &&
|
|
617
|
+
}, t.default?.()) : t.default?.(), G = O(null), K = (e) => e && "$el" in e ? e.$el : e, q = O(!1), pe = O(!1), me = O(!1), J = s(() => oe.value ? S?.segmentPosition(j.value ? de.value : K(W.value)) : void 0), he = s(() => {
|
|
618
|
+
if (ae.value) return [];
|
|
619
|
+
let e = w.value && !r.disabled, t = e && pe.value || z.value || e && me.value ? Ee : e && q.value ? Te : null;
|
|
645
620
|
if (t !== null) return [
|
|
646
621
|
t,
|
|
647
622
|
t,
|
|
648
623
|
t,
|
|
649
624
|
t
|
|
650
625
|
];
|
|
651
|
-
let n =
|
|
626
|
+
let n = J.value, i = n === "first" || n === "single" ? Ee : we, a = n === "last" || n === "single" ? Ee : we;
|
|
652
627
|
return [
|
|
653
628
|
i,
|
|
654
629
|
i,
|
|
655
630
|
a,
|
|
656
631
|
a
|
|
657
632
|
];
|
|
658
|
-
}), { snap:
|
|
659
|
-
let t =
|
|
633
|
+
}), { snap: ge } = t(() => he.value, (e) => {
|
|
634
|
+
let t = G.value ?? K(W.value);
|
|
660
635
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
661
636
|
});
|
|
662
|
-
F([
|
|
663
|
-
function
|
|
664
|
-
e.pointerType !== "touch" && (
|
|
637
|
+
F([J, ae], () => ge());
|
|
638
|
+
function _e(e) {
|
|
639
|
+
e.pointerType !== "touch" && (q.value = !0);
|
|
665
640
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
641
|
+
function De() {
|
|
642
|
+
q.value = !1, pe.value = !1;
|
|
668
643
|
}
|
|
669
|
-
function
|
|
670
|
-
e.button === 0 && (
|
|
644
|
+
function Oe(e) {
|
|
645
|
+
e.button === 0 && (pe.value = !0);
|
|
671
646
|
}
|
|
672
|
-
function
|
|
673
|
-
|
|
647
|
+
function ke() {
|
|
648
|
+
pe.value = !1;
|
|
674
649
|
}
|
|
675
|
-
function
|
|
650
|
+
function Ae(e) {
|
|
676
651
|
me.value = e.currentTarget.matches(":focus-visible");
|
|
677
652
|
}
|
|
678
|
-
function
|
|
653
|
+
function je() {
|
|
679
654
|
me.value = !1;
|
|
680
655
|
}
|
|
681
|
-
let
|
|
682
|
-
function
|
|
683
|
-
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(),
|
|
656
|
+
let Me = s(() => r.href ? "a" : r.to ? "router-link" : k.value ? "div" : "li"), Ne = s(() => r.href ? { href: r.href } : r.to ? { to: r.to } : {}), Pe = N();
|
|
657
|
+
function Fe(e) {
|
|
658
|
+
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), Le(e));
|
|
684
659
|
}
|
|
685
|
-
function
|
|
660
|
+
function Ie(e) {
|
|
686
661
|
r.disabled || (y.value = !y.value, a("update:expanded", y.value), a("click", e));
|
|
687
662
|
}
|
|
688
|
-
function
|
|
663
|
+
function Le(e) {
|
|
689
664
|
if (!r.disabled) {
|
|
690
665
|
if (r.expandable) {
|
|
691
|
-
|
|
666
|
+
Ie(e);
|
|
692
667
|
return;
|
|
693
668
|
}
|
|
694
669
|
S?.selectable.value && r.value != null && S.select(r.value), a("click", e);
|
|
695
670
|
}
|
|
696
671
|
}
|
|
697
|
-
function
|
|
672
|
+
function Re() {
|
|
698
673
|
a("update:trailingValue", !r.trailingValue);
|
|
699
674
|
}
|
|
700
675
|
return (t, n) => e.expandable ? (E(), u("li", v({
|
|
701
676
|
key: 0,
|
|
702
677
|
ref_key: "rootEl",
|
|
703
|
-
ref:
|
|
678
|
+
ref: W
|
|
704
679
|
}, t.$attrs, { role: "listitem" }), [d("div", {
|
|
705
680
|
ref_key: "shapeEl",
|
|
706
|
-
ref:
|
|
681
|
+
ref: G,
|
|
707
682
|
role: "button",
|
|
708
683
|
tabindex: e.disabled ? -1 : 0,
|
|
709
684
|
"aria-expanded": x.value,
|
|
710
|
-
"aria-controls": te(
|
|
685
|
+
"aria-controls": te(Pe),
|
|
711
686
|
"aria-disabled": e.disabled || void 0,
|
|
712
|
-
class: b(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
713
|
-
onClick:
|
|
714
|
-
onKeydown:
|
|
715
|
-
onFocus:
|
|
716
|
-
onBlur:
|
|
717
|
-
onPointerenter:
|
|
718
|
-
onPointerleave:
|
|
719
|
-
onPointerdown:
|
|
720
|
-
onPointerup:
|
|
721
|
-
onPointercancel:
|
|
687
|
+
class: b(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", ue.value]),
|
|
688
|
+
onClick: Le,
|
|
689
|
+
onKeydown: Fe,
|
|
690
|
+
onFocus: Ae,
|
|
691
|
+
onBlur: je,
|
|
692
|
+
onPointerenter: _e,
|
|
693
|
+
onPointerleave: De,
|
|
694
|
+
onPointerdown: Oe,
|
|
695
|
+
onPointerup: ke,
|
|
696
|
+
onPointercancel: ke
|
|
722
697
|
}, [
|
|
723
|
-
A(t.$slots, "leading", {}, () => [
|
|
698
|
+
A(t.$slots, "leading", {}, () => [B.value === "icon" ? (E(), c(i, {
|
|
724
699
|
key: 0,
|
|
725
700
|
name: e.icon,
|
|
726
701
|
size: 24,
|
|
727
|
-
class: b(["shrink-0",
|
|
702
|
+
class: b(["shrink-0", H.value])
|
|
728
703
|
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
729
|
-
d("div",
|
|
704
|
+
d("div", ye, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
730
705
|
key: 0,
|
|
731
|
-
class: b(["truncate text-label-small",
|
|
732
|
-
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large",
|
|
706
|
+
class: b(["truncate text-label-small", H.value])
|
|
707
|
+
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large", ce.value]) }, M(e.title), 3), e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
733
708
|
key: 0,
|
|
734
|
-
class: b(["text-body-medium", [
|
|
709
|
+
class: b(["text-body-medium", [H.value, C.value === 2 && "truncate"]])
|
|
735
710
|
}, M(e.subtitle), 3)) : l("", !0)])]),
|
|
736
711
|
p(i, {
|
|
737
712
|
name: x.value ? "expand_less" : "expand_more",
|
|
738
713
|
size: 20,
|
|
739
|
-
class: b(["shrink-0",
|
|
714
|
+
class: b(["shrink-0", H.value])
|
|
740
715
|
}, null, 8, ["name", "class"])
|
|
741
|
-
], 42,
|
|
716
|
+
], 42, ve), p(o, { name: "mli-expand" }, {
|
|
742
717
|
default: ne(() => [x.value ? (E(), u("div", {
|
|
743
718
|
key: 0,
|
|
744
|
-
id: te(
|
|
719
|
+
id: te(Pe),
|
|
745
720
|
class: "mli-expand-grid"
|
|
746
|
-
}, [d("div",
|
|
721
|
+
}, [d("div", xe, [A(t.$slots, "children")])], 8, be)) : l("", !0)]),
|
|
747
722
|
_: 3
|
|
748
723
|
})], 16)) : (E(), c(fe, { key: 1 }, {
|
|
749
|
-
default: ne(() => [(E(), c(ee(
|
|
750
|
-
class:
|
|
724
|
+
default: ne(() => [(E(), c(ee(Me.value), v({
|
|
725
|
+
class: ue.value,
|
|
751
726
|
ref_key: "rootEl",
|
|
752
|
-
ref:
|
|
727
|
+
ref: W
|
|
753
728
|
}, {
|
|
754
|
-
...
|
|
729
|
+
...Ne.value,
|
|
755
730
|
...t.$attrs
|
|
756
731
|
}, {
|
|
757
732
|
role: P.value,
|
|
758
733
|
tabindex: I.value,
|
|
759
|
-
"aria-selected": T.value ?
|
|
734
|
+
"aria-selected": T.value ? z.value : void 0,
|
|
760
735
|
"aria-disabled": (T.value || k.value) && e.disabled ? "true" : void 0,
|
|
761
|
-
onClick:
|
|
762
|
-
onKeydown:
|
|
763
|
-
onPointerenter:
|
|
764
|
-
onPointerleave:
|
|
765
|
-
onPointerdown:
|
|
766
|
-
onPointerup:
|
|
767
|
-
onPointercancel:
|
|
768
|
-
onFocus:
|
|
769
|
-
onBlur:
|
|
736
|
+
onClick: Le,
|
|
737
|
+
onKeydown: R,
|
|
738
|
+
onPointerenter: _e,
|
|
739
|
+
onPointerleave: De,
|
|
740
|
+
onPointerdown: Oe,
|
|
741
|
+
onPointerup: ke,
|
|
742
|
+
onPointercancel: ke,
|
|
743
|
+
onFocus: Ae,
|
|
744
|
+
onBlur: je
|
|
770
745
|
}), {
|
|
771
746
|
default: ne(() => [
|
|
772
|
-
|
|
747
|
+
se.value ? (E(), u("div", {
|
|
773
748
|
key: 0,
|
|
774
|
-
class: b(["absolute top-0 right-0 h-px bg-outline-variant",
|
|
749
|
+
class: b(["absolute top-0 right-0 h-px bg-outline-variant", se.value === "inset" ? "left-16" : "left-0"])
|
|
775
750
|
}, null, 2)) : l("", !0),
|
|
776
|
-
A(t.$slots, "leading", {}, () => [
|
|
751
|
+
A(t.$slots, "leading", {}, () => [B.value === "icon" ? (E(), c(i, {
|
|
777
752
|
key: 0,
|
|
778
753
|
name: e.icon,
|
|
779
754
|
size: 24,
|
|
780
|
-
class: b(["shrink-0",
|
|
781
|
-
}, null, 8, ["name", "class"])) :
|
|
755
|
+
class: b(["shrink-0", H.value])
|
|
756
|
+
}, null, 8, ["name", "class"])) : B.value === "icon-container" ? (E(), u("div", {
|
|
782
757
|
key: 1,
|
|
783
|
-
class: b(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full",
|
|
758
|
+
class: b(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", re[e.iconContainerColor || "primary"]])
|
|
784
759
|
}, [p(i, {
|
|
785
760
|
name: e.icon,
|
|
786
761
|
size: 24
|
|
787
|
-
}, null, 8, ["name"])], 2)) :
|
|
762
|
+
}, null, 8, ["name"])], 2)) : B.value === "avatar" ? (E(), c(L, {
|
|
788
763
|
key: 2,
|
|
789
764
|
name: e.avatarName,
|
|
790
765
|
size: 40,
|
|
791
766
|
class: "shrink-0"
|
|
792
|
-
}, null, 8, ["name"])) :
|
|
767
|
+
}, null, 8, ["name"])) : B.value === "image" ? (E(), u("img", {
|
|
793
768
|
key: 3,
|
|
794
769
|
src: e.image,
|
|
795
770
|
alt: "",
|
|
796
771
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
797
|
-
}, null, 8,
|
|
772
|
+
}, null, 8, Se)) : B.value === "checkbox" ? (E(), c(U, {
|
|
798
773
|
key: 4,
|
|
799
|
-
"model-value":
|
|
774
|
+
"model-value": z.value,
|
|
800
775
|
class: "shrink-0"
|
|
801
776
|
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
802
|
-
d("div",
|
|
777
|
+
d("div", Ce, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
803
778
|
key: 0,
|
|
804
|
-
class: b(["truncate text-label-small",
|
|
779
|
+
class: b(["truncate text-label-small", H.value])
|
|
805
780
|
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [
|
|
806
|
-
d("p", { class: b(["truncate text-body-large",
|
|
781
|
+
d("p", { class: b(["truncate text-body-large", ce.value]) }, M(e.title), 3),
|
|
807
782
|
e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
808
783
|
key: 0,
|
|
809
|
-
class: b(["text-body-medium", [
|
|
784
|
+
class: b(["text-body-medium", [H.value, C.value === 2 && "truncate"]])
|
|
810
785
|
}, M(e.subtitle), 3)) : l("", !0),
|
|
811
786
|
e.description && C.value >= 3 ? (E(), u("p", {
|
|
812
787
|
key: 1,
|
|
813
|
-
class: b(["line-clamp-2 text-body-small",
|
|
788
|
+
class: b(["line-clamp-2 text-body-small", H.value])
|
|
814
789
|
}, M(e.description), 3)) : l("", !0)
|
|
815
790
|
])]),
|
|
816
|
-
A(t.$slots, "trailing", {}, () => [
|
|
791
|
+
A(t.$slots, "trailing", {}, () => [V.value === "icon" ? (E(), c(i, {
|
|
817
792
|
key: 0,
|
|
818
793
|
name: e.trailingIcon,
|
|
819
794
|
size: 24,
|
|
820
|
-
class: b(["shrink-0",
|
|
821
|
-
}, null, 8, ["name", "class"])) :
|
|
795
|
+
class: b(["shrink-0", H.value])
|
|
796
|
+
}, null, 8, ["name", "class"])) : V.value === "text" ? (E(), u("span", {
|
|
822
797
|
key: 1,
|
|
823
|
-
class: b(["shrink-0 text-label-small",
|
|
824
|
-
}, M(e.trailingText), 3)) :
|
|
798
|
+
class: b(["shrink-0 text-label-small", H.value])
|
|
799
|
+
}, M(e.trailingText), 3)) : V.value === "switch" ? (E(), c(Y, {
|
|
825
800
|
key: 2,
|
|
826
801
|
"model-value": !!e.trailingValue,
|
|
827
|
-
"onUpdate:modelValue":
|
|
828
|
-
}, null, 8, ["model-value"])) :
|
|
802
|
+
"onUpdate:modelValue": Re
|
|
803
|
+
}, null, 8, ["model-value"])) : V.value === "checkbox" ? (E(), c(U, {
|
|
829
804
|
key: 3,
|
|
830
805
|
"model-value": !!e.trailingValue,
|
|
831
|
-
"onUpdate:modelValue":
|
|
806
|
+
"onUpdate:modelValue": Re
|
|
832
807
|
}, null, 8, ["model-value"])) : l("", !0)])
|
|
833
808
|
]),
|
|
834
809
|
_: 3
|
|
@@ -842,16 +817,16 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
842
817
|
_: 3
|
|
843
818
|
}));
|
|
844
819
|
}
|
|
845
|
-
}),
|
|
820
|
+
}), Oe = {
|
|
846
821
|
key: 0,
|
|
847
822
|
class: "flex items-center justify-between"
|
|
848
|
-
},
|
|
823
|
+
}, ke = {
|
|
849
824
|
key: 0,
|
|
850
825
|
class: "text-label-large text-on-surface"
|
|
851
|
-
},
|
|
826
|
+
}, Ae = {
|
|
852
827
|
key: 1,
|
|
853
828
|
class: "tabular-nums text-label-large text-on-surface-variant"
|
|
854
|
-
},
|
|
829
|
+
}, je = [
|
|
855
830
|
"role",
|
|
856
831
|
"tabindex",
|
|
857
832
|
"aria-label",
|
|
@@ -860,7 +835,7 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
860
835
|
"aria-valuemax",
|
|
861
836
|
"aria-disabled",
|
|
862
837
|
"aria-orientation"
|
|
863
|
-
],
|
|
838
|
+
], Me = [
|
|
864
839
|
"tabindex",
|
|
865
840
|
"aria-label",
|
|
866
841
|
"aria-valuenow",
|
|
@@ -870,7 +845,7 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
870
845
|
"aria-orientation",
|
|
871
846
|
"onKeydown",
|
|
872
847
|
"onFocus"
|
|
873
|
-
],
|
|
848
|
+
], Ne = "color-mix(in srgb, var(--color-on-surface) 38%, transparent)", Pe = "color-mix(in srgb, var(--color-on-surface) 12%, transparent)", Fe = /* @__PURE__ */ m({
|
|
874
849
|
__name: "MSlider",
|
|
875
850
|
props: {
|
|
876
851
|
modelValue: {},
|
|
@@ -934,17 +909,17 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
934
909
|
let t = r.max - r.min;
|
|
935
910
|
return t === 0 ? 0 : (e - r.min) / t * 100;
|
|
936
911
|
}
|
|
937
|
-
let I = s(() => F(P.value.lo)), L = s(() => F(P.value.hi)), R = s(() => F(0)), z = s(() =>
|
|
912
|
+
let I = s(() => F(P.value.lo)), L = s(() => F(P.value.hi)), R = s(() => F(0)), z = s(() => oe.value < U.value.dotInset + U.value.dot / 2 ? !0 : r.variant === "centered" ? Math.min(I.value, R.value) <= 0 : r.variant !== "range" || I.value <= 0), B = s(() => se.value < U.value.dotInset + U.value.dot / 2 ? !0 : r.variant === "centered" ? Math.max(I.value, R.value) >= 100 : r.variant === "range" ? L.value >= 100 : I.value >= 100), V = O(0), re, ie = () => {
|
|
938
913
|
let e = h.value;
|
|
939
|
-
e && (
|
|
914
|
+
e && (V.value = j.value ? e.offsetHeight : e.offsetWidth);
|
|
940
915
|
};
|
|
941
916
|
C(() => {
|
|
942
|
-
|
|
943
|
-
}), S(() =>
|
|
944
|
-
let
|
|
945
|
-
let t =
|
|
946
|
-
return Math.min(Math.max(e / 100 *
|
|
947
|
-
},
|
|
917
|
+
ie(), !(typeof ResizeObserver > "u" || !h.value) && (re = new ResizeObserver(ie), re.observe(h.value));
|
|
918
|
+
}), S(() => re?.disconnect());
|
|
919
|
+
let ae = (e) => {
|
|
920
|
+
let t = U.value.thumbInset;
|
|
921
|
+
return Math.min(Math.max(e / 100 * V.value, t), V.value - t);
|
|
922
|
+
}, oe = s(() => V.value && (r.variant === "range" || r.variant === "centered" && I.value <= R.value) ? ae(I.value) - W.value : Infinity), se = s(() => V.value ? r.variant === "range" ? V.value - ae(L.value) - W.value : r.variant === "centered" && I.value < R.value ? Infinity : V.value - ae(I.value) - W.value : Infinity), ce = s(() => oe.value <= Z.value), H = s(() => se.value <= Z.value), le = {
|
|
948
923
|
xs: {
|
|
949
924
|
track: 16,
|
|
950
925
|
thumbW: 4,
|
|
@@ -1010,153 +985,153 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1010
985
|
iconSize: 28,
|
|
1011
986
|
thumbIconSize: 66
|
|
1012
987
|
}
|
|
1013
|
-
},
|
|
988
|
+
}, U = s(() => le[r.size] ?? le.xs), ue = s(() => U.value.thumbInset + U.value.thumbW / 2 + U.value.iconSize / 2 + 3), W = s(() => r.thumbIcon ? Math.max(U.value.gap, U.value.thumbIconSize / 2 + 4) : U.value.gap), de = {
|
|
1014
989
|
primary: "var(--color-primary)",
|
|
1015
990
|
secondary: "var(--color-secondary)",
|
|
1016
991
|
tertiary: "var(--color-tertiary)",
|
|
1017
992
|
error: "var(--color-error)"
|
|
1018
993
|
};
|
|
1019
|
-
function
|
|
994
|
+
function fe(e, t) {
|
|
1020
995
|
let n = e ?? t;
|
|
1021
|
-
return
|
|
996
|
+
return de[n] ?? n;
|
|
1022
997
|
}
|
|
1023
|
-
let
|
|
1024
|
-
active:
|
|
1025
|
-
inactive:
|
|
998
|
+
let G = s(() => r.disabled ? {
|
|
999
|
+
active: Ne,
|
|
1000
|
+
inactive: Pe
|
|
1026
1001
|
} : {
|
|
1027
|
-
active:
|
|
1002
|
+
active: fe(r.fillColor, r.color),
|
|
1028
1003
|
inactive: "var(--color-secondary-container)"
|
|
1029
|
-
}),
|
|
1030
|
-
active:
|
|
1031
|
-
inactive:
|
|
1004
|
+
}), K = s(() => r.disabled ? {
|
|
1005
|
+
active: Ne,
|
|
1006
|
+
inactive: Pe
|
|
1032
1007
|
} : {
|
|
1033
|
-
active:
|
|
1008
|
+
active: fe(r.thumbColor, r.color),
|
|
1034
1009
|
inactive: "var(--color-secondary-container)"
|
|
1035
1010
|
});
|
|
1036
|
-
function
|
|
1011
|
+
function q(e) {
|
|
1037
1012
|
let t = Math.round((e - r.min) / r.step) * r.step + r.min;
|
|
1038
1013
|
return Math.max(r.min, Math.min(r.max, +t.toFixed(10)));
|
|
1039
1014
|
}
|
|
1040
|
-
function
|
|
1015
|
+
function pe(e) {
|
|
1041
1016
|
if (!h.value) return 0;
|
|
1042
1017
|
let t = h.value.getBoundingClientRect();
|
|
1043
1018
|
return j.value ? 1 - Math.max(0, Math.min(1, (e.clientY - t.top) / t.height)) : Math.max(0, Math.min(1, (e.clientX - t.left) / t.width));
|
|
1044
1019
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1020
|
+
function me(e) {
|
|
1021
|
+
return q(r.min + pe(e) * (r.max - r.min));
|
|
1047
1022
|
}
|
|
1048
|
-
let
|
|
1049
|
-
function
|
|
1023
|
+
let J = !1;
|
|
1024
|
+
function he(e, t) {
|
|
1050
1025
|
let { lo: n, hi: r } = P.value;
|
|
1051
1026
|
return e === 0 ? [Math.min(t, r), r] : [n, Math.max(t, n)];
|
|
1052
1027
|
}
|
|
1053
|
-
function
|
|
1028
|
+
function ge(e) {
|
|
1054
1029
|
if (r.disabled) return;
|
|
1055
1030
|
e.preventDefault();
|
|
1056
|
-
let t =
|
|
1031
|
+
let t = me(e);
|
|
1057
1032
|
if (N.value) {
|
|
1058
1033
|
let { lo: e, hi: n } = P.value;
|
|
1059
|
-
|
|
1034
|
+
J = !1;
|
|
1060
1035
|
let r;
|
|
1061
|
-
t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0,
|
|
1036
|
+
t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0, J = !0) : r = Math.abs(t - e) <= Math.abs(t - n) ? 0 : 1, _.value = r, D(r), J || f("update:modelValue", he(r, t));
|
|
1062
1037
|
} else _.value = "single", f("update:modelValue", t);
|
|
1063
|
-
window.addEventListener("pointermove",
|
|
1038
|
+
window.addEventListener("pointermove", _e), window.addEventListener("pointerup", Y), window.addEventListener("pointercancel", Y);
|
|
1064
1039
|
}
|
|
1065
|
-
function
|
|
1040
|
+
function _e(e) {
|
|
1066
1041
|
if (_.value === !1) return;
|
|
1067
|
-
let t =
|
|
1042
|
+
let t = me(e);
|
|
1068
1043
|
if (N.value) {
|
|
1069
|
-
if (
|
|
1044
|
+
if (J) {
|
|
1070
1045
|
if (t === P.value.lo) return;
|
|
1071
|
-
|
|
1046
|
+
J = !1, _.value = +(t > P.value.lo), D(_.value);
|
|
1072
1047
|
}
|
|
1073
|
-
f("update:modelValue",
|
|
1048
|
+
f("update:modelValue", he(_.value, t));
|
|
1074
1049
|
} else f("update:modelValue", t);
|
|
1075
1050
|
}
|
|
1076
|
-
function
|
|
1077
|
-
_.value = !1,
|
|
1051
|
+
function Y() {
|
|
1052
|
+
_.value = !1, J = !1, window.removeEventListener("pointermove", _e), window.removeEventListener("pointerup", Y), window.removeEventListener("pointercancel", Y);
|
|
1078
1053
|
}
|
|
1079
|
-
let
|
|
1054
|
+
let ve = {
|
|
1080
1055
|
ArrowRight: 1,
|
|
1081
1056
|
ArrowUp: 1,
|
|
1082
1057
|
ArrowLeft: -1,
|
|
1083
1058
|
ArrowDown: -1
|
|
1084
1059
|
};
|
|
1085
|
-
function
|
|
1060
|
+
function ye(e) {
|
|
1086
1061
|
if (r.disabled) return;
|
|
1087
|
-
let t =
|
|
1088
|
-
t !== void 0 && (e.preventDefault(), f("update:modelValue",
|
|
1062
|
+
let t = ve[e.key];
|
|
1063
|
+
t !== void 0 && (e.preventDefault(), f("update:modelValue", q(r.modelValue + t * r.step))), e.key === "Home" && (e.preventDefault(), f("update:modelValue", r.min)), e.key === "End" && (e.preventDefault(), f("update:modelValue", r.max));
|
|
1089
1064
|
}
|
|
1090
|
-
function
|
|
1065
|
+
function be(e, t) {
|
|
1091
1066
|
if (r.disabled) return;
|
|
1092
|
-
let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o =
|
|
1093
|
-
o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s =
|
|
1067
|
+
let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o = ve[t.key], s;
|
|
1068
|
+
o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s = q(a + o * r.step), s !== void 0 && (t.preventDefault(), w.value = e, f("update:modelValue", he(e, s)));
|
|
1094
1069
|
}
|
|
1095
1070
|
S(() => {
|
|
1096
|
-
window.removeEventListener("pointermove",
|
|
1071
|
+
window.removeEventListener("pointermove", _e), window.removeEventListener("pointerup", Y), window.removeEventListener("pointercancel", Y);
|
|
1097
1072
|
});
|
|
1098
|
-
let
|
|
1073
|
+
let xe = s(() => {
|
|
1099
1074
|
if (!r.stops) return [];
|
|
1100
|
-
let e = [], t = r.max - r.min, n = r.icon ? (
|
|
1075
|
+
let e = [], t = r.max - r.min, n = r.icon ? (U.value.iconSize + U.value.radius) / 2 : 0;
|
|
1101
1076
|
for (let i = r.min + r.step; i < r.max; i += r.step) {
|
|
1102
1077
|
let a = (i - r.min) / t * 100;
|
|
1103
1078
|
r.icon && a < n || e.push(a);
|
|
1104
1079
|
}
|
|
1105
1080
|
return e.length <= 28 ? e : [];
|
|
1106
1081
|
});
|
|
1082
|
+
function Se(e) {
|
|
1083
|
+
return `calc(${$(e)} - ${W.value}px)`;
|
|
1084
|
+
}
|
|
1107
1085
|
function Ce(e) {
|
|
1108
|
-
return `calc(${$(e)} - ${
|
|
1086
|
+
return H.value ? "0px" : `calc(100% - ${$(e)} - ${W.value}px)`;
|
|
1109
1087
|
}
|
|
1110
|
-
function we(
|
|
1111
|
-
return
|
|
1088
|
+
function we() {
|
|
1089
|
+
return ce.value ? "0px" : `calc(${$(I.value)} - ${W.value}px)`;
|
|
1112
1090
|
}
|
|
1113
1091
|
function Te() {
|
|
1114
|
-
return
|
|
1092
|
+
return `calc(${$(I.value)} + ${W.value}px)`;
|
|
1115
1093
|
}
|
|
1116
1094
|
function Ee() {
|
|
1117
|
-
return `calc(${$(I.value)}
|
|
1095
|
+
return `calc(${$(L.value)} - ${$(I.value)} - ${W.value * 2}px)`;
|
|
1118
1096
|
}
|
|
1119
1097
|
function De() {
|
|
1120
|
-
return `calc(
|
|
1098
|
+
return H.value ? "0px" : `calc(100% - ${$(L.value)} - ${W.value}px)`;
|
|
1121
1099
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1124
|
-
}
|
|
1125
|
-
function ke() {
|
|
1126
|
-
return I.value >= R.value ? `${R.value}%` : `calc(${$(I.value)} + ${U.value}px)`;
|
|
1100
|
+
function Fe() {
|
|
1101
|
+
return I.value >= R.value ? `${R.value}%` : `calc(${$(I.value)} + ${W.value}px)`;
|
|
1127
1102
|
}
|
|
1128
|
-
function
|
|
1129
|
-
return I.value >= R.value ? `calc(${$(I.value)} - ${R.value}% - ${
|
|
1103
|
+
function Ie() {
|
|
1104
|
+
return I.value >= R.value ? `calc(${$(I.value)} - ${R.value}% - ${W.value}px)` : `calc(${R.value}% - ${$(I.value)} - ${W.value}px)`;
|
|
1130
1105
|
}
|
|
1131
|
-
function
|
|
1132
|
-
return
|
|
1106
|
+
function Le() {
|
|
1107
|
+
return H.value ? "0px" : I.value >= R.value ? `calc(100% - ${$(I.value)} - ${W.value}px)` : `calc(100% - ${R.value}% - ${W.value}px)`;
|
|
1133
1108
|
}
|
|
1134
|
-
function
|
|
1135
|
-
return
|
|
1109
|
+
function Re() {
|
|
1110
|
+
return ce.value ? "0px" : I.value <= R.value ? `calc(${$(I.value)} - ${W.value}px)` : `calc(${R.value}% - ${W.value}px)`;
|
|
1136
1111
|
}
|
|
1137
|
-
let
|
|
1138
|
-
function
|
|
1139
|
-
return `${
|
|
1112
|
+
let ze = s(() => U.value.radius), X = s(() => Math.max(2, ze.value / 4)), Z = s(() => ze.value * 1.3);
|
|
1113
|
+
function Be() {
|
|
1114
|
+
return `${X.value}px`;
|
|
1140
1115
|
}
|
|
1141
|
-
function
|
|
1142
|
-
return j.value ? `${
|
|
1116
|
+
function Ve() {
|
|
1117
|
+
return j.value ? `${X.value}px ${X.value}px ${Z.value}px ${Z.value}px` : `${Z.value}px ${X.value}px ${X.value}px ${Z.value}px`;
|
|
1143
1118
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return j.value ? `${
|
|
1119
|
+
function He() {
|
|
1120
|
+
return j.value ? `${Z.value}px ${Z.value}px ${X.value}px ${X.value}px` : `${X.value}px ${Z.value}px ${Z.value}px ${X.value}px`;
|
|
1146
1121
|
}
|
|
1147
1122
|
let Ue = s(() => _.value === !1), Q = s(() => Ue.value ? "75ms ease" : "0s");
|
|
1148
1123
|
function $(e) {
|
|
1149
|
-
let t =
|
|
1124
|
+
let t = U.value.thumbInset;
|
|
1150
1125
|
return `clamp(${t}px, ${e}%, calc(100% - ${t}px))`;
|
|
1151
1126
|
}
|
|
1152
1127
|
function We(e, t = 0) {
|
|
1153
|
-
let n = j.value ?
|
|
1128
|
+
let n = j.value ? U.value.thumbH : U.value.thumbW, r = j.value ? U.value.thumbW : U.value.thumbH, i = Math.min(n, r) / 2, a = _.value !== !1, o = {
|
|
1154
1129
|
position: "absolute",
|
|
1155
1130
|
width: `${n}px`,
|
|
1156
1131
|
height: `${r}px`,
|
|
1157
1132
|
borderRadius: `${i}px`,
|
|
1158
|
-
backgroundColor:
|
|
1159
|
-
"--tw-ring-color":
|
|
1133
|
+
backgroundColor: K.value.active,
|
|
1134
|
+
"--tw-ring-color": K.value.active,
|
|
1160
1135
|
zIndex: "2",
|
|
1161
1136
|
transition: Ue.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1162
1137
|
}, s = N.value ? _.value === t || y.value === t : a || v.value, c = (N.value ? _.value === t : a) ? 1.08 : 1, l = s ? .5 : 1;
|
|
@@ -1165,15 +1140,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1165
1140
|
function Ge(e) {
|
|
1166
1141
|
let t = _.value === !1 ? 1 : 1.15, n = {
|
|
1167
1142
|
position: "absolute",
|
|
1168
|
-
color:
|
|
1169
|
-
"--tw-ring-color":
|
|
1143
|
+
color: K.value.active,
|
|
1144
|
+
"--tw-ring-color": K.value.active,
|
|
1170
1145
|
zIndex: "2",
|
|
1171
1146
|
transition: Ue.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1172
1147
|
};
|
|
1173
1148
|
return j.value ? (n.left = "50%", n.bottom = $(e), n.transform = `translateX(-50%) translateY(50%) scale(${t})`) : (n.left = $(e), n.top = "50%", n.transform = `translateX(-50%) translateY(-50%) scale(${t})`), n;
|
|
1174
1149
|
}
|
|
1175
1150
|
function Ke(e) {
|
|
1176
|
-
let t =
|
|
1151
|
+
let t = U.value.track / 2 + 36, n = U.value.track / 2 + 40;
|
|
1177
1152
|
return j.value ? {
|
|
1178
1153
|
left: `calc(50% - ${n}px)`,
|
|
1179
1154
|
bottom: $(e),
|
|
@@ -1187,7 +1162,7 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1187
1162
|
};
|
|
1188
1163
|
}
|
|
1189
1164
|
let qe = s(() => N.value ? `${P.value.lo} – ${P.value.hi}` : String(r.modelValue)), Je = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? P.value.lo : P.value.hi : r.modelValue), Ye = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? I.value : L.value : I.value);
|
|
1190
|
-
return (e, n) => (E(), u("div", { class: b(["flex select-none", j.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [t.label || t.showValue ? (E(), u("div",
|
|
1165
|
+
return (e, n) => (E(), u("div", { class: b(["flex select-none", j.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [t.label || t.showValue ? (E(), u("div", Oe, [t.label ? (E(), u("span", ke, M(t.label), 1)) : l("", !0), t.showValue ? (E(), u("span", Ae, M(qe.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: b(["flex items-center", j.value ? "flex-1 flex-col" : ""]) }, [d("div", {
|
|
1191
1166
|
ref_key: "trackEl",
|
|
1192
1167
|
ref: h,
|
|
1193
1168
|
role: N.value ? "group" : "slider",
|
|
@@ -1200,15 +1175,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1200
1175
|
"aria-orientation": N.value ? void 0 : t.orientation,
|
|
1201
1176
|
class: b(["group relative touch-none cursor-pointer outline-none", t.disabled && "cursor-not-allowed"]),
|
|
1202
1177
|
style: x(j.value ? {
|
|
1203
|
-
width: `${
|
|
1178
|
+
width: `${U.value.hitArea}px`,
|
|
1204
1179
|
minHeight: "160px",
|
|
1205
1180
|
height: "100%"
|
|
1206
1181
|
} : {
|
|
1207
|
-
height: `${
|
|
1182
|
+
height: `${U.value.hitArea}px`,
|
|
1208
1183
|
width: "100%"
|
|
1209
1184
|
}),
|
|
1210
|
-
onPointerdown:
|
|
1211
|
-
onKeydown: n[0] ||= (e) => !N.value &&
|
|
1185
|
+
onPointerdown: ge,
|
|
1186
|
+
onKeydown: n[0] ||= (e) => !N.value && ye(e),
|
|
1212
1187
|
onFocus: n[1] ||= (e) => v.value = !N.value,
|
|
1213
1188
|
onBlur: n[2] ||= (e) => v.value = !1
|
|
1214
1189
|
}, [
|
|
@@ -1218,16 +1193,16 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1218
1193
|
left: "50%",
|
|
1219
1194
|
top: "0",
|
|
1220
1195
|
bottom: "0",
|
|
1221
|
-
width: `${
|
|
1196
|
+
width: `${U.value.track}px`,
|
|
1222
1197
|
transform: "translateX(-50%)",
|
|
1223
|
-
borderRadius: `${
|
|
1198
|
+
borderRadius: `${Z.value}px`
|
|
1224
1199
|
} : {
|
|
1225
1200
|
top: "50%",
|
|
1226
1201
|
left: "0",
|
|
1227
1202
|
right: "0",
|
|
1228
|
-
height: `${
|
|
1203
|
+
height: `${U.value.track}px`,
|
|
1229
1204
|
transform: "translateY(-50%)",
|
|
1230
|
-
borderRadius: `${
|
|
1205
|
+
borderRadius: `${Z.value}px`
|
|
1231
1206
|
})
|
|
1232
1207
|
}, [
|
|
1233
1208
|
t.variant === "standard" ? (E(), u(a, { key: 0 }, [d("div", {
|
|
@@ -1237,15 +1212,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1237
1212
|
left: 0,
|
|
1238
1213
|
right: 0,
|
|
1239
1214
|
bottom: 0,
|
|
1240
|
-
height:
|
|
1215
|
+
height: Se(I.value)
|
|
1241
1216
|
} : {
|
|
1242
1217
|
top: 0,
|
|
1243
1218
|
bottom: 0,
|
|
1244
1219
|
left: 0,
|
|
1245
|
-
width:
|
|
1220
|
+
width: Se(I.value)
|
|
1246
1221
|
},
|
|
1247
|
-
borderRadius:
|
|
1248
|
-
backgroundColor:
|
|
1222
|
+
borderRadius: Ve(),
|
|
1223
|
+
backgroundColor: G.value.active,
|
|
1249
1224
|
transition: `all ${Q.value}`
|
|
1250
1225
|
})
|
|
1251
1226
|
}, null, 4), d("div", {
|
|
@@ -1255,15 +1230,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1255
1230
|
left: 0,
|
|
1256
1231
|
right: 0,
|
|
1257
1232
|
top: 0,
|
|
1258
|
-
height:
|
|
1233
|
+
height: Ce(I.value)
|
|
1259
1234
|
} : {
|
|
1260
1235
|
top: 0,
|
|
1261
1236
|
bottom: 0,
|
|
1262
1237
|
right: 0,
|
|
1263
|
-
width:
|
|
1238
|
+
width: Ce(I.value)
|
|
1264
1239
|
},
|
|
1265
|
-
borderRadius:
|
|
1266
|
-
backgroundColor:
|
|
1240
|
+
borderRadius: He(),
|
|
1241
|
+
backgroundColor: G.value.inactive,
|
|
1267
1242
|
transition: `all ${Q.value}`
|
|
1268
1243
|
})
|
|
1269
1244
|
}, null, 4)], 64)) : t.variant === "centered" ? (E(), u(a, { key: 1 }, [
|
|
@@ -1273,16 +1248,16 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1273
1248
|
...j.value ? {
|
|
1274
1249
|
left: 0,
|
|
1275
1250
|
right: 0,
|
|
1276
|
-
bottom:
|
|
1277
|
-
height:
|
|
1251
|
+
bottom: Fe(),
|
|
1252
|
+
height: Ie()
|
|
1278
1253
|
} : {
|
|
1279
1254
|
top: 0,
|
|
1280
1255
|
bottom: 0,
|
|
1281
|
-
left:
|
|
1282
|
-
width:
|
|
1256
|
+
left: Fe(),
|
|
1257
|
+
width: Ie()
|
|
1283
1258
|
},
|
|
1284
|
-
borderRadius:
|
|
1285
|
-
backgroundColor:
|
|
1259
|
+
borderRadius: Be(),
|
|
1260
|
+
backgroundColor: G.value.active,
|
|
1286
1261
|
transition: `all ${Q.value}`
|
|
1287
1262
|
})
|
|
1288
1263
|
}, null, 4),
|
|
@@ -1293,15 +1268,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1293
1268
|
left: 0,
|
|
1294
1269
|
right: 0,
|
|
1295
1270
|
top: 0,
|
|
1296
|
-
height:
|
|
1271
|
+
height: Le()
|
|
1297
1272
|
} : {
|
|
1298
1273
|
top: 0,
|
|
1299
1274
|
bottom: 0,
|
|
1300
1275
|
right: 0,
|
|
1301
|
-
width:
|
|
1276
|
+
width: Le()
|
|
1302
1277
|
},
|
|
1303
|
-
borderRadius:
|
|
1304
|
-
backgroundColor:
|
|
1278
|
+
borderRadius: He(),
|
|
1279
|
+
backgroundColor: G.value.inactive,
|
|
1305
1280
|
transition: `all ${Q.value}`
|
|
1306
1281
|
})
|
|
1307
1282
|
}, null, 4),
|
|
@@ -1312,15 +1287,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1312
1287
|
left: 0,
|
|
1313
1288
|
right: 0,
|
|
1314
1289
|
bottom: 0,
|
|
1315
|
-
height:
|
|
1290
|
+
height: Re()
|
|
1316
1291
|
} : {
|
|
1317
1292
|
top: 0,
|
|
1318
1293
|
bottom: 0,
|
|
1319
1294
|
left: 0,
|
|
1320
|
-
width:
|
|
1295
|
+
width: Re()
|
|
1321
1296
|
},
|
|
1322
|
-
borderRadius:
|
|
1323
|
-
backgroundColor:
|
|
1297
|
+
borderRadius: Ve(),
|
|
1298
|
+
backgroundColor: G.value.inactive,
|
|
1324
1299
|
transition: `all ${Q.value}`
|
|
1325
1300
|
})
|
|
1326
1301
|
}, null, 4)
|
|
@@ -1332,15 +1307,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1332
1307
|
left: 0,
|
|
1333
1308
|
right: 0,
|
|
1334
1309
|
bottom: 0,
|
|
1335
|
-
height:
|
|
1310
|
+
height: we()
|
|
1336
1311
|
} : {
|
|
1337
1312
|
top: 0,
|
|
1338
1313
|
bottom: 0,
|
|
1339
1314
|
left: 0,
|
|
1340
|
-
width:
|
|
1315
|
+
width: we()
|
|
1341
1316
|
},
|
|
1342
|
-
borderRadius:
|
|
1343
|
-
backgroundColor:
|
|
1317
|
+
borderRadius: Ve(),
|
|
1318
|
+
backgroundColor: G.value.inactive,
|
|
1344
1319
|
transition: `all ${Q.value}`
|
|
1345
1320
|
})
|
|
1346
1321
|
}, null, 4),
|
|
@@ -1350,16 +1325,16 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1350
1325
|
...j.value ? {
|
|
1351
1326
|
left: 0,
|
|
1352
1327
|
right: 0,
|
|
1353
|
-
bottom:
|
|
1354
|
-
height:
|
|
1328
|
+
bottom: Te(),
|
|
1329
|
+
height: Ee()
|
|
1355
1330
|
} : {
|
|
1356
1331
|
top: 0,
|
|
1357
1332
|
bottom: 0,
|
|
1358
|
-
left:
|
|
1359
|
-
width:
|
|
1333
|
+
left: Te(),
|
|
1334
|
+
width: Ee()
|
|
1360
1335
|
},
|
|
1361
|
-
borderRadius:
|
|
1362
|
-
backgroundColor:
|
|
1336
|
+
borderRadius: Be(),
|
|
1337
|
+
backgroundColor: G.value.active,
|
|
1363
1338
|
transition: `all ${Q.value}`
|
|
1364
1339
|
})
|
|
1365
1340
|
}, null, 4),
|
|
@@ -1370,15 +1345,15 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1370
1345
|
left: 0,
|
|
1371
1346
|
right: 0,
|
|
1372
1347
|
top: 0,
|
|
1373
|
-
height:
|
|
1348
|
+
height: De()
|
|
1374
1349
|
} : {
|
|
1375
1350
|
top: 0,
|
|
1376
1351
|
bottom: 0,
|
|
1377
1352
|
right: 0,
|
|
1378
|
-
width:
|
|
1353
|
+
width: De()
|
|
1379
1354
|
},
|
|
1380
|
-
borderRadius:
|
|
1381
|
-
backgroundColor:
|
|
1355
|
+
borderRadius: He(),
|
|
1356
|
+
backgroundColor: G.value.inactive,
|
|
1382
1357
|
transition: `all ${Q.value}`
|
|
1383
1358
|
})
|
|
1384
1359
|
}, null, 4)
|
|
@@ -1386,17 +1361,17 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1386
1361
|
t.icon ? (E(), c(i, {
|
|
1387
1362
|
key: 3,
|
|
1388
1363
|
name: t.icon,
|
|
1389
|
-
size:
|
|
1364
|
+
size: U.value.iconSize,
|
|
1390
1365
|
class: "absolute z-[1]",
|
|
1391
1366
|
style: x({
|
|
1392
|
-
color: t.variant === "standard" && I.value > 0 || t.variant === "range" && I.value > 0 ?
|
|
1367
|
+
color: t.variant === "standard" && I.value > 0 || t.variant === "range" && I.value > 0 ? G.value.inactive : G.value.active,
|
|
1393
1368
|
...j.value ? {
|
|
1394
1369
|
left: "50%",
|
|
1395
|
-
bottom: `${
|
|
1370
|
+
bottom: `${ue.value}px`,
|
|
1396
1371
|
transform: "translateX(-50%)"
|
|
1397
1372
|
} : {
|
|
1398
1373
|
top: "50%",
|
|
1399
|
-
left: `${
|
|
1374
|
+
left: `${ue.value}px`,
|
|
1400
1375
|
transform: "translateY(-50%)"
|
|
1401
1376
|
},
|
|
1402
1377
|
transition: "color 150ms ease"
|
|
@@ -1409,17 +1384,17 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1409
1384
|
key: 4,
|
|
1410
1385
|
class: "absolute rounded-full",
|
|
1411
1386
|
style: x({
|
|
1412
|
-
width: `${
|
|
1413
|
-
height: `${
|
|
1414
|
-
backgroundColor:
|
|
1387
|
+
width: `${U.value.dot}px`,
|
|
1388
|
+
height: `${U.value.dot}px`,
|
|
1389
|
+
backgroundColor: G.value.active,
|
|
1415
1390
|
opacity: +!z.value,
|
|
1416
1391
|
...j.value ? {
|
|
1417
1392
|
left: "50%",
|
|
1418
|
-
bottom: `${
|
|
1393
|
+
bottom: `${U.value.dotInset}px`,
|
|
1419
1394
|
transform: "translateX(-50%)"
|
|
1420
1395
|
} : {
|
|
1421
1396
|
top: "50%",
|
|
1422
|
-
left: `${
|
|
1397
|
+
left: `${U.value.dotInset}px`,
|
|
1423
1398
|
transform: "translateY(-50%)"
|
|
1424
1399
|
},
|
|
1425
1400
|
transition: "opacity 150ms ease"
|
|
@@ -1429,29 +1404,29 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1429
1404
|
key: 5,
|
|
1430
1405
|
class: "absolute rounded-full",
|
|
1431
1406
|
style: x({
|
|
1432
|
-
width: `${
|
|
1433
|
-
height: `${
|
|
1434
|
-
backgroundColor:
|
|
1435
|
-
opacity: +!
|
|
1407
|
+
width: `${U.value.dot}px`,
|
|
1408
|
+
height: `${U.value.dot}px`,
|
|
1409
|
+
backgroundColor: G.value.active,
|
|
1410
|
+
opacity: +!B.value,
|
|
1436
1411
|
...j.value ? {
|
|
1437
1412
|
left: "50%",
|
|
1438
|
-
top: `${
|
|
1413
|
+
top: `${U.value.dotInset}px`,
|
|
1439
1414
|
transform: "translateX(-50%)"
|
|
1440
1415
|
} : {
|
|
1441
1416
|
top: "50%",
|
|
1442
|
-
right: `${
|
|
1417
|
+
right: `${U.value.dotInset}px`,
|
|
1443
1418
|
transform: "translateY(-50%)"
|
|
1444
1419
|
},
|
|
1445
1420
|
transition: "opacity 150ms ease"
|
|
1446
1421
|
})
|
|
1447
1422
|
}, null, 4)),
|
|
1448
|
-
t.stops ? (E(!0), u(a, { key: 6 }, k(
|
|
1423
|
+
t.stops ? (E(!0), u(a, { key: 6 }, k(xe.value, (e, t) => (E(), u("div", {
|
|
1449
1424
|
key: t,
|
|
1450
1425
|
class: "absolute rounded-full",
|
|
1451
1426
|
style: x({
|
|
1452
|
-
width: `${
|
|
1453
|
-
height: `${
|
|
1454
|
-
backgroundColor: e <= I.value ?
|
|
1427
|
+
width: `${U.value.dot}px`,
|
|
1428
|
+
height: `${U.value.dot}px`,
|
|
1429
|
+
backgroundColor: e <= I.value ? G.value.inactive : G.value.active,
|
|
1455
1430
|
opacity: Math.abs(e - I.value) < .01 || N.value && Math.abs(e - L.value) < .01 ? 0 : 1,
|
|
1456
1431
|
...j.value ? {
|
|
1457
1432
|
left: "50%",
|
|
@@ -1481,17 +1456,17 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1481
1456
|
"aria-orientation": t.orientation,
|
|
1482
1457
|
class: b(["pointer-events-none flex items-center justify-center rounded-full outline-none", w.value === e && "ring-2 ring-offset-2 ring-offset-surface"]),
|
|
1483
1458
|
style: x(t.thumbIcon ? Ge(e === 0 ? I.value : L.value) : We(e === 0 ? I.value : L.value, e)),
|
|
1484
|
-
onKeydown: (t) =>
|
|
1459
|
+
onKeydown: (t) => be(e, t),
|
|
1485
1460
|
onFocus: (t) => A(e),
|
|
1486
1461
|
onBlur: ee
|
|
1487
1462
|
}, [t.thumbIcon ? (E(), c(i, {
|
|
1488
1463
|
key: 0,
|
|
1489
1464
|
name: t.thumbIcon,
|
|
1490
|
-
size:
|
|
1491
|
-
}, null, 8, ["name", "size"])) : l("", !0)], 46,
|
|
1465
|
+
size: U.value.thumbIconSize
|
|
1466
|
+
}, null, 8, ["name", "size"])) : l("", !0)], 46, Me)), 64)) : (E(), u(a, { key: 0 }, [t.thumbIcon ? (E(), c(i, {
|
|
1492
1467
|
key: 0,
|
|
1493
1468
|
name: t.thumbIcon,
|
|
1494
|
-
size:
|
|
1469
|
+
size: U.value.thumbIconSize,
|
|
1495
1470
|
class: "pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1496
1471
|
style: x(Ge(I.value))
|
|
1497
1472
|
}, null, 8, [
|
|
@@ -1516,10 +1491,10 @@ var Se = ["role"], Ce = /* @__PURE__ */ m({
|
|
|
1516
1491
|
}, M(Je.value), 5)) : l("", !0)]),
|
|
1517
1492
|
_: 1
|
|
1518
1493
|
})
|
|
1519
|
-
], 46,
|
|
1494
|
+
], 46, je)], 2)], 2));
|
|
1520
1495
|
}
|
|
1521
1496
|
});
|
|
1522
1497
|
//#endregion
|
|
1523
|
-
export {
|
|
1498
|
+
export { q as a, se as c, me as i, L as l, De as n, K as o, Y as r, U as s, Fe as t };
|
|
1524
1499
|
|
|
1525
|
-
//# sourceMappingURL=MSlider-
|
|
1500
|
+
//# sourceMappingURL=MSlider-BnEy5ieZ.js.map
|