@m3ui-vue/m3ui-vue 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +75 -11
- package/dist/MMenuItem-BOkcVtEe.js +809 -0
- package/dist/MMenuItem-BOkcVtEe.js.map +1 -0
- package/dist/{MSlider-CdNIH7jc.js → MSlider-BXsBv0ox.js} +208 -182
- package/dist/MSlider-BXsBv0ox.js.map +1 -0
- package/dist/{MTextField-B4X92vH_.js → MTextField-rML9jnXs.js} +2 -2
- package/dist/{MTextField-B4X92vH_.js.map → MTextField-rML9jnXs.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MBottomSheet.vue.d.ts +20 -1
- package/dist/components/MDialog.vue.d.ts +17 -8
- package/dist/components/MDragDropList.vue.d.ts +1 -1
- package/dist/components/MMap.vue.d.ts +4 -4
- package/dist/components/MMapControl.vue.d.ts +20 -3
- package/dist/components/MMapMarker.vue.d.ts +5 -2
- package/dist/components/MMapPopup.vue.d.ts +5 -3
- package/dist/components/MMenuItem.vue.d.ts +2 -2
- package/dist/components/MSeekBar.vue.d.ts +122 -0
- package/dist/components/MSplitButton.vue.d.ts +2 -2
- package/dist/components/_MMapAttribution.vue.d.ts +7 -0
- package/dist/composables/_mapPin.d.ts +5 -0
- package/dist/composables/_popupPosition.d.ts +12 -0
- package/dist/composables/_useCalendarMonth.d.ts +24 -0
- package/dist/composables/_useEscapeStack.d.ts +3 -0
- package/dist/composables/_useScrollLock.d.ts +8 -0
- package/dist/composables/_useSheetMotion.d.ts +16 -1
- package/dist/composables/useLocale.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/locales/index.js +56 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +5269 -4714
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +777 -641
- package/dist/map.js.map +1 -1
- package/dist/rich-text-editor.js +8 -8
- package/dist/styles.css +1 -1
- package/dist/{useLocale-b5-hzsL3.js → useLocale-CqQrhWFl.js} +9 -1
- package/dist/useLocale-CqQrhWFl.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MDialog.test.ts +30 -0
- package/src/__tests__/MMap.test.ts +132 -2
- package/src/__tests__/MSeekBar.test.ts +170 -0
- package/src/__tests__/MTooltip.test.ts +110 -0
- package/src/__tests__/_fakeMaplibre.ts +3 -0
- package/src/__tests__/calendarMonth.test.ts +59 -0
- package/src/__tests__/pickerModals.test.ts +128 -0
- package/src/__tests__/popupPosition.test.ts +224 -0
- package/src/__tests__/scrollLock.test.ts +110 -0
- package/src/__tests__/sheets.test.ts +158 -0
- package/src/components/MAutocomplete.vue +2 -4
- package/src/components/MBottomSheet.vue +211 -13
- package/src/components/MCommandPalette.vue +4 -6
- package/src/components/MContextMenu.vue +19 -5
- package/src/components/MDatePicker.vue +29 -70
- package/src/components/MDatePickerModal.vue +116 -172
- package/src/components/MDateRangePicker.vue +29 -51
- package/src/components/MDateRangePickerModal.vue +84 -162
- package/src/components/MDialog.vue +87 -63
- package/src/components/MLightbox.vue +6 -3
- package/src/components/MMap.vue +74 -28
- package/src/components/MMapControl.vue +121 -7
- package/src/components/MMapIdentify.vue +2 -1
- package/src/components/MMapMarker.vue +14 -7
- package/src/components/MMapPopup.vue +8 -4
- package/src/components/MMenu.vue +31 -12
- package/src/components/MMenuItem.vue +21 -4
- package/src/components/MMultiAutocomplete.vue +2 -4
- package/src/components/MMultiSelect.vue +2 -4
- package/src/components/MNavigationDrawer.vue +2 -8
- package/src/components/MNavigationRail.vue +2 -3
- package/src/components/MSearchBar.vue +2 -5
- package/src/components/MSeekBar.vue +593 -0
- package/src/components/MSelect.vue +2 -8
- package/src/components/MSplitButton.vue +23 -7
- package/src/components/MSpotlightSearch.vue +4 -6
- package/src/components/MTimePicker.vue +23 -6
- package/src/components/MTimePickerModal.vue +213 -226
- package/src/components/MTooltip.vue +99 -3
- package/src/components/_MMapAttribution.vue +81 -0
- package/src/composables/_mapPin.ts +25 -0
- package/src/composables/_popupPosition.ts +39 -0
- package/src/composables/_useCalendarMonth.ts +74 -0
- package/src/composables/_useEscapeStack.ts +33 -0
- package/src/composables/_useScrollLock.ts +41 -0
- package/src/composables/_useSheetMotion.ts +82 -20
- package/src/composables/useLocale.ts +16 -0
- package/src/index.ts +2 -0
- package/src/locales/de.ts +8 -0
- package/src/locales/es.ts +8 -0
- package/src/locales/fr.ts +8 -0
- package/src/locales/ja.ts +8 -0
- package/src/locales/ko.ts +8 -0
- package/src/locales/pt.ts +8 -0
- package/src/locales/zh.ts +8 -0
- package/dist/MMenuItem-DFyXflk9.js +0 -707
- package/dist/MMenuItem-DFyXflk9.js.map +0 -1
- package/dist/MSlider-CdNIH7jc.js.map +0 -1
- package/dist/useLocale-b5-hzsL3.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import { a as t, c as n, o as r } from "./MTextField-
|
|
1
|
+
import { i as e } from "./useLocale-CqQrhWFl.js";
|
|
2
|
+
import { a as t, c as n, o as r } from "./MTextField-rML9jnXs.js";
|
|
3
3
|
import { t as i } from "./MIcon-DLOkQduI.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, inject as h, mergeProps as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, unref as ee, useAttrs as te, useSlots as A, watch as j, withCtx as ne, withModifiers as M } from "vue";
|
|
5
5
|
//#region src/composables/_storageKeys.ts
|
|
6
|
-
var N = "m3-theme",
|
|
6
|
+
var N = "m3-theme", P = "m3-dynamic-palette", F = "m3-viewport", I = /* @__PURE__ */ m({
|
|
7
7
|
__name: "MAvatar",
|
|
8
8
|
props: {
|
|
9
9
|
name: {},
|
|
@@ -27,23 +27,49 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
27
27
|
})
|
|
28
28
|
}, k(n.value), 5));
|
|
29
29
|
}
|
|
30
|
-
}),
|
|
30
|
+
}), L = 1e3 / 60, R = .004;
|
|
31
|
+
function z(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 = L / 1e3; e > 1e-9; e -= R) {
|
|
35
|
+
let n = Math.min(R, 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 B(e, t) {
|
|
43
|
+
let n = Number(t ?? 0) / L, 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 re = (e) => (e.length - 1) * L;
|
|
47
|
+
function V(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: re(t),
|
|
51
|
+
delay: r,
|
|
52
|
+
easing: "linear"
|
|
53
|
+
});
|
|
54
|
+
return i.finished.catch(() => {}), i;
|
|
55
|
+
}
|
|
56
|
+
var H = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, U = [
|
|
31
57
|
"role",
|
|
32
58
|
"tabindex",
|
|
33
59
|
"aria-disabled"
|
|
34
|
-
],
|
|
60
|
+
], W = ["src", "alt"], G = {
|
|
35
61
|
key: 1,
|
|
36
62
|
class: "px-4 pt-4 pb-2"
|
|
37
|
-
},
|
|
63
|
+
}, ie = {
|
|
38
64
|
key: 2,
|
|
39
65
|
class: "px-4 pt-4 pb-2"
|
|
40
|
-
},
|
|
66
|
+
}, ae = { class: "text-title-large font-medium text-on-surface" }, K = {
|
|
41
67
|
key: 0,
|
|
42
68
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
43
|
-
},
|
|
69
|
+
}, oe = {
|
|
44
70
|
key: 3,
|
|
45
71
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
46
|
-
},
|
|
72
|
+
}, se = "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]", q = /* @__PURE__ */ m({
|
|
47
73
|
__name: "MCard",
|
|
48
74
|
props: {
|
|
49
75
|
variant: { default: "elevated" },
|
|
@@ -92,7 +118,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
92
118
|
o.value ? [
|
|
93
119
|
"cursor-pointer",
|
|
94
120
|
a[n.value],
|
|
95
|
-
|
|
121
|
+
se
|
|
96
122
|
] : "",
|
|
97
123
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
98
124
|
]]),
|
|
@@ -110,20 +136,20 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
110
136
|
src: e.image,
|
|
111
137
|
alt: e.imageAlt ?? "",
|
|
112
138
|
class: "h-full w-full object-cover"
|
|
113
|
-
}, null, 8,
|
|
114
|
-
t.$slots.header ? (S(), u("div",
|
|
139
|
+
}, null, 8, W)) : E(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : l("", !0),
|
|
140
|
+
t.$slots.header ? (S(), u("div", G, [E(t.$slots, "header")])) : e.title ? (S(), u("div", ie, [d("h3", ae, k(e.title), 1), e.subtitle ? (S(), u("p", K, k(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
115
141
|
E(t.$slots, "default"),
|
|
116
|
-
t.$slots.actions ? (S(), u("div",
|
|
117
|
-
], 46,
|
|
142
|
+
t.$slots.actions ? (S(), u("div", oe, [E(t.$slots, "actions")])) : l("", !0)
|
|
143
|
+
], 46, U));
|
|
118
144
|
}
|
|
119
|
-
}),
|
|
145
|
+
}), ce = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, le = [
|
|
120
146
|
"checked",
|
|
121
147
|
"disabled",
|
|
122
148
|
"aria-label"
|
|
123
|
-
],
|
|
149
|
+
], ue = {
|
|
124
150
|
key: 1,
|
|
125
151
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
126
|
-
},
|
|
152
|
+
}, de = /* @__PURE__ */ m({
|
|
127
153
|
__name: "MCheckbox",
|
|
128
154
|
props: {
|
|
129
155
|
modelValue: { type: Boolean },
|
|
@@ -152,7 +178,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
152
178
|
tertiary: "bg-tertiary",
|
|
153
179
|
error: "bg-error"
|
|
154
180
|
};
|
|
155
|
-
return (t, o) => (S(), u("label", { class: _(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [d("span",
|
|
181
|
+
return (t, o) => (S(), u("label", { class: _(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [d("span", ce, [
|
|
156
182
|
d("input", {
|
|
157
183
|
type: "checkbox",
|
|
158
184
|
class: "peer sr-only",
|
|
@@ -160,12 +186,12 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
160
186
|
disabled: e.disabled,
|
|
161
187
|
"aria-label": e.ariaLabel,
|
|
162
188
|
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
163
|
-
}, null, 40,
|
|
189
|
+
}, null, 40, le),
|
|
164
190
|
e.disabled ? l("", !0) : (S(), u("span", {
|
|
165
191
|
key: 0,
|
|
166
192
|
class: _(["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"])
|
|
167
193
|
}, null, 2)),
|
|
168
|
-
e.disabled ? l("", !0) : (S(), u("span",
|
|
194
|
+
e.disabled ? l("", !0) : (S(), u("span", ue)),
|
|
169
195
|
d("span", { class: _(["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, {
|
|
170
196
|
name: e.indeterminate ? "remove" : "check",
|
|
171
197
|
size: 18,
|
|
@@ -176,7 +202,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
176
202
|
class: _(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
177
203
|
}, [E(t.$slots, "default", {}, () => [f(k(e.label), 1)])], 2)) : l("", !0)], 2));
|
|
178
204
|
}
|
|
179
|
-
}),
|
|
205
|
+
}), J = ["disabled", "aria-pressed"], Y = { class: "whitespace-nowrap" }, fe = ["aria-label", "disabled"], X = ["aria-label", "disabled"], pe = "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", Z = /* @__PURE__ */ m({
|
|
180
206
|
__name: "MChip",
|
|
181
207
|
props: {
|
|
182
208
|
tone: { default: "neutral" },
|
|
@@ -241,30 +267,30 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
241
267
|
if (e) return ["bg-secondary-container text-on-secondary-container", m.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
242
268
|
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
243
269
|
return m.elevated && m.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
244
|
-
}), N = s(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"),
|
|
245
|
-
n(() => m.type === "filter" || m.type === "input" ? [
|
|
246
|
-
|
|
247
|
-
}, r), n(() =>
|
|
248
|
-
|
|
270
|
+
}), N = s(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), P = s(() => m.type === "input" ? [k.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", te.value ? "pr-2" : "pr-3"] : [m.icon || R.value ? "pl-2" : "pl-4", te.value ? "pr-2" : "pr-4"]), F = w(!1), I = w(), L = w(), R = s(() => m.type === "filter" && !m.icon);
|
|
271
|
+
n(() => m.type === "filter" || m.type === "input" ? [F.value ? 8 : m.selected ? 16 : 12, R.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
272
|
+
I.value && e !== void 0 && (I.value.style.borderRadius = `${e}px`), L.value && t !== void 0 && (L.value.style.width = `${t}px`);
|
|
273
|
+
}, r), n(() => R.value ? [+!!m.selected] : [], ([e]) => {
|
|
274
|
+
L.value && e !== void 0 && (L.value.style.opacity = String(e));
|
|
249
275
|
}, t);
|
|
250
|
-
function
|
|
276
|
+
function z() {
|
|
251
277
|
m.disabled || (O.value && h("update:selected", !m.selected), h("click"));
|
|
252
278
|
}
|
|
253
279
|
return (e, t) => a.type ? (S(), u("span", {
|
|
254
280
|
key: 0,
|
|
255
281
|
ref_key: "typedEl",
|
|
256
|
-
ref:
|
|
282
|
+
ref: I,
|
|
257
283
|
class: _(["relative inline-flex h-8 items-center overflow-hidden align-middle text-label-large transition-[background-color,box-shadow,color] has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-inset has-[button:focus-visible]:ring-secondary", [j.value, a.type === "assist" || a.type === "suggestion" ? "rounded-sm" : "rounded-md"]])
|
|
258
284
|
}, [d("button", {
|
|
259
285
|
type: "button",
|
|
260
|
-
class: _(["flex h-full items-center gap-2 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity", [
|
|
286
|
+
class: _(["flex h-full items-center gap-2 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity", [P.value, a.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"]]),
|
|
261
287
|
disabled: a.disabled,
|
|
262
288
|
"aria-pressed": O.value ? a.selected : void 0,
|
|
263
|
-
onPointerdown: t[0] ||= (e) =>
|
|
264
|
-
onPointerup: t[1] ||= (e) =>
|
|
265
|
-
onPointerleave: t[2] ||= (e) =>
|
|
266
|
-
onPointercancel: t[3] ||= (e) =>
|
|
267
|
-
onClick:
|
|
289
|
+
onPointerdown: t[0] ||= (e) => F.value = !0,
|
|
290
|
+
onPointerup: t[1] ||= (e) => F.value = !1,
|
|
291
|
+
onPointerleave: t[2] ||= (e) => F.value = !1,
|
|
292
|
+
onPointercancel: t[3] ||= (e) => F.value = !1,
|
|
293
|
+
onClick: z
|
|
268
294
|
}, [
|
|
269
295
|
k.value ? (S(), u("span", {
|
|
270
296
|
key: 0,
|
|
@@ -279,10 +305,10 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
279
305
|
"name",
|
|
280
306
|
"filled",
|
|
281
307
|
"class"
|
|
282
|
-
])) :
|
|
308
|
+
])) : R.value ? (S(), u("span", {
|
|
283
309
|
key: 2,
|
|
284
310
|
ref_key: "checkEl",
|
|
285
|
-
ref:
|
|
311
|
+
ref: L,
|
|
286
312
|
class: "-mr-2 flex shrink-0 overflow-hidden",
|
|
287
313
|
style: {
|
|
288
314
|
width: "8px",
|
|
@@ -294,14 +320,14 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
294
320
|
size: 18,
|
|
295
321
|
class: _(["shrink-0", N.value])
|
|
296
322
|
}, null, 8, ["class"])], 512)) : l("", !0),
|
|
297
|
-
d("span",
|
|
323
|
+
d("span", Y, [E(e.$slots, "default")]),
|
|
298
324
|
a.trailingIcon ? (S(), c(i, {
|
|
299
325
|
key: 3,
|
|
300
326
|
name: a.trailingIcon,
|
|
301
327
|
size: 18,
|
|
302
328
|
class: _(["shrink-0", a.disabled ? "" : a.selected && O.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
303
329
|
}, null, 8, ["name", "class"])) : l("", !0)
|
|
304
|
-
], 42,
|
|
330
|
+
], 42, J), a.type === "input" && a.removable ? (S(), u("button", {
|
|
305
331
|
key: 0,
|
|
306
332
|
type: "button",
|
|
307
333
|
class: _(["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"]),
|
|
@@ -311,14 +337,14 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
311
337
|
}, [p(i, {
|
|
312
338
|
name: "close",
|
|
313
339
|
size: 18
|
|
314
|
-
})], 10,
|
|
340
|
+
})], 10, fe)) : l("", !0)], 2)) : (S(), c(D(a.clickable ? "button" : "span"), {
|
|
315
341
|
key: 1,
|
|
316
342
|
type: a.clickable ? "button" : void 0,
|
|
317
343
|
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
318
344
|
class: _(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
319
345
|
T.value,
|
|
320
346
|
C.value,
|
|
321
|
-
a.clickable && !a.disabled ?
|
|
347
|
+
a.clickable && !a.disabled ? pe : "",
|
|
322
348
|
a.disabled ? "cursor-not-allowed" : ""
|
|
323
349
|
]]),
|
|
324
350
|
style: v(x.value),
|
|
@@ -341,7 +367,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
341
367
|
}, [p(i, {
|
|
342
368
|
name: "close",
|
|
343
369
|
size: 16
|
|
344
|
-
})], 8,
|
|
370
|
+
})], 8, X)) : l("", !0)
|
|
345
371
|
]),
|
|
346
372
|
_: 3
|
|
347
373
|
}, 8, [
|
|
@@ -351,7 +377,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
351
377
|
"style"
|
|
352
378
|
]));
|
|
353
379
|
}
|
|
354
|
-
}),
|
|
380
|
+
}), Q = /* @__PURE__ */ m({
|
|
355
381
|
__name: "MList",
|
|
356
382
|
props: {
|
|
357
383
|
dense: {
|
|
@@ -413,10 +439,10 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
413
439
|
class: _(l.value)
|
|
414
440
|
}, [E(e.$slots, "default")], 2));
|
|
415
441
|
}
|
|
416
|
-
}),
|
|
442
|
+
}), $ = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, me = ["checked", "disabled"], he = {
|
|
417
443
|
key: 0,
|
|
418
444
|
class: "text-body-large text-on-surface"
|
|
419
|
-
},
|
|
445
|
+
}, ge = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", _e = /* @__PURE__ */ m({
|
|
420
446
|
__name: "MSwitch",
|
|
421
447
|
props: {
|
|
422
448
|
modelValue: { type: Boolean },
|
|
@@ -473,14 +499,14 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
473
499
|
onPointerup: b,
|
|
474
500
|
onPointerleave: b,
|
|
475
501
|
onPointercancel: b
|
|
476
|
-
}, [d("span",
|
|
502
|
+
}, [d("span", $, [d("span", { class: _(["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"]) }, [
|
|
477
503
|
d("input", {
|
|
478
504
|
type: "checkbox",
|
|
479
505
|
class: "peer sr-only",
|
|
480
506
|
checked: e.modelValue,
|
|
481
507
|
disabled: e.disabled,
|
|
482
508
|
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
483
|
-
}, null, 40,
|
|
509
|
+
}, null, 40, me),
|
|
484
510
|
e.disabled ? l("", !0) : (S(), u("span", {
|
|
485
511
|
key: 0,
|
|
486
512
|
class: _(["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"]),
|
|
@@ -492,7 +518,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
492
518
|
style: v(T.value)
|
|
493
519
|
}, null, 4)),
|
|
494
520
|
d("span", {
|
|
495
|
-
class: _(["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"] :
|
|
521
|
+
class: _(["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"] : ge]),
|
|
496
522
|
style: v(C.value)
|
|
497
523
|
}, [p(o, {
|
|
498
524
|
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
@@ -510,12 +536,12 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
510
536
|
}, null, 8, ["class"])) : l("", !0)]),
|
|
511
537
|
_: 1
|
|
512
538
|
})], 6)
|
|
513
|
-
], 2)]), e.label ? (S(), u("span",
|
|
539
|
+
], 2)]), e.label ? (S(), u("span", he, k(e.label), 1)) : l("", !0)], 34));
|
|
514
540
|
}
|
|
515
|
-
}),
|
|
541
|
+
}), ve = { class: "min-w-0 flex-1" }, ye = {
|
|
516
542
|
key: 0,
|
|
517
543
|
class: "mli-expand-grid"
|
|
518
|
-
},
|
|
544
|
+
}, be = { class: "mli-expand-body" }, xe = ["src"], Se = { class: "min-w-0 flex-1" }, Ce = 4, we = 8, Te = 16, Ee = /* @__PURE__ */ m({
|
|
519
545
|
__name: "MListItem",
|
|
520
546
|
props: {
|
|
521
547
|
title: {},
|
|
@@ -566,54 +592,54 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
566
592
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
567
593
|
error: "bg-error-container text-on-error-container",
|
|
568
594
|
success: "bg-success-container text-on-success-container"
|
|
569
|
-
}, A = s(() => y?.dense.value ?? !1), M = s(() => y?.nav.value ?? !1), N = s(() => y?.segmented.value ?? !1),
|
|
595
|
+
}, A = s(() => y?.dense.value ?? !1), M = s(() => y?.nav.value ?? !1), N = s(() => y?.segmented.value ?? !1), P = s(() => y?.dividers.value ?? !1), F = s(() => C.value ? "text-on-secondary-container" : "text-on-surface"), L = s(() => C.value ? "text-on-secondary-container" : "text-on-surface-variant"), R = s(() => A.value ? "" : b.value === 3 ? "min-h-22" : b.value === 2 ? "min-h-18" : "min-h-14"), z = s(() => [
|
|
570
596
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
571
597
|
N.value ? "bg-surface-container px-4" : M.value ? "rounded-full px-4" : "px-4",
|
|
572
598
|
A.value ? "py-1" : b.value === 3 ? "py-3" : "py-2",
|
|
573
|
-
|
|
599
|
+
R.value,
|
|
574
600
|
x.value && !r.disabled && "cursor-pointer transition-colors duration-150 hover:bg-on-surface/8 active:bg-on-surface/12",
|
|
575
601
|
C.value && "bg-secondary-container text-on-secondary-container",
|
|
576
602
|
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
577
|
-
]),
|
|
603
|
+
]), B = w(null), re = w(null), V = (e) => e && "$el" in e ? e.$el : e, H = w(!1), U = w(!1), W = w(!1), G = s(() => N.value ? y?.segmentPosition(V(B.value)) : void 0), ie = s(() => {
|
|
578
604
|
if (M.value) return [];
|
|
579
|
-
let e = x.value && !r.disabled, t = e &&
|
|
605
|
+
let e = x.value && !r.disabled, t = e && U.value || C.value || e && W.value ? Te : e && H.value ? we : null;
|
|
580
606
|
if (t !== null) return [
|
|
581
607
|
t,
|
|
582
608
|
t,
|
|
583
609
|
t,
|
|
584
610
|
t
|
|
585
611
|
];
|
|
586
|
-
let n =
|
|
612
|
+
let n = G.value, i = n === "first" || n === "single" ? Te : Ce, a = n === "last" || n === "single" ? Te : Ce;
|
|
587
613
|
return [
|
|
588
614
|
i,
|
|
589
615
|
i,
|
|
590
616
|
a,
|
|
591
617
|
a
|
|
592
618
|
];
|
|
593
|
-
}), { snap:
|
|
594
|
-
let t =
|
|
619
|
+
}), { snap: ae } = n(() => ie.value, (e) => {
|
|
620
|
+
let t = re.value ?? V(B.value);
|
|
595
621
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
596
622
|
});
|
|
597
|
-
j([
|
|
598
|
-
function
|
|
599
|
-
e.pointerType !== "touch" && (
|
|
623
|
+
j([G, M], () => ae());
|
|
624
|
+
function K(e) {
|
|
625
|
+
e.pointerType !== "touch" && (H.value = !0);
|
|
600
626
|
}
|
|
601
|
-
function
|
|
602
|
-
|
|
627
|
+
function oe() {
|
|
628
|
+
H.value = !1, U.value = !1;
|
|
603
629
|
}
|
|
604
|
-
function
|
|
605
|
-
e.button === 0 && (
|
|
630
|
+
function se(e) {
|
|
631
|
+
e.button === 0 && (U.value = !0);
|
|
606
632
|
}
|
|
607
633
|
function q() {
|
|
608
|
-
|
|
634
|
+
U.value = !1;
|
|
609
635
|
}
|
|
610
|
-
function
|
|
611
|
-
|
|
636
|
+
function ce(e) {
|
|
637
|
+
W.value = e.currentTarget.matches(":focus-visible");
|
|
612
638
|
}
|
|
613
|
-
function
|
|
614
|
-
|
|
639
|
+
function le() {
|
|
640
|
+
W.value = !1;
|
|
615
641
|
}
|
|
616
|
-
let
|
|
642
|
+
let ue = s(() => r.href ? "a" : r.to ? "router-link" : r.expandable ? "div" : "li"), J = s(() => r.href ? { href: r.href } : r.to ? { to: r.to } : {});
|
|
617
643
|
function Y(e) {
|
|
618
644
|
r.disabled || (m.value = !m.value, a("update:expanded", m.value), a("click", e));
|
|
619
645
|
}
|
|
@@ -632,16 +658,16 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
632
658
|
return (t, n) => e.expandable ? (S(), u("li", {
|
|
633
659
|
key: 0,
|
|
634
660
|
ref_key: "rootEl",
|
|
635
|
-
ref:
|
|
661
|
+
ref: B,
|
|
636
662
|
role: "listitem"
|
|
637
663
|
}, [d("div", {
|
|
638
664
|
ref_key: "shapeEl",
|
|
639
|
-
ref:
|
|
640
|
-
class: _(
|
|
665
|
+
ref: re,
|
|
666
|
+
class: _(z.value),
|
|
641
667
|
onClick: fe,
|
|
642
|
-
onPointerenter:
|
|
643
|
-
onPointerleave:
|
|
644
|
-
onPointerdown:
|
|
668
|
+
onPointerenter: K,
|
|
669
|
+
onPointerleave: oe,
|
|
670
|
+
onPointerdown: se,
|
|
645
671
|
onPointerup: q,
|
|
646
672
|
onPointercancel: q
|
|
647
673
|
}, [
|
|
@@ -649,56 +675,56 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
649
675
|
key: 0,
|
|
650
676
|
name: e.icon,
|
|
651
677
|
size: 24,
|
|
652
|
-
class: _(["shrink-0",
|
|
678
|
+
class: _(["shrink-0", L.value])
|
|
653
679
|
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
654
|
-
d("div",
|
|
680
|
+
d("div", ve, [E(t.$slots, "overline", {}, () => [e.overline ? (S(), u("p", {
|
|
655
681
|
key: 0,
|
|
656
|
-
class: _(["truncate text-label-small",
|
|
657
|
-
}, k(e.overline), 3)) : l("", !0)]), E(t.$slots, "default", {}, () => [d("p", { class: _(["truncate text-body-large",
|
|
682
|
+
class: _(["truncate text-label-small", L.value])
|
|
683
|
+
}, k(e.overline), 3)) : l("", !0)]), E(t.$slots, "default", {}, () => [d("p", { class: _(["truncate text-body-large", F.value]) }, k(e.title), 3), e.subtitle && b.value >= 2 ? (S(), u("p", {
|
|
658
684
|
key: 0,
|
|
659
|
-
class: _(["text-body-medium", [
|
|
685
|
+
class: _(["text-body-medium", [L.value, b.value === 2 && "truncate"]])
|
|
660
686
|
}, k(e.subtitle), 3)) : l("", !0)])]),
|
|
661
687
|
p(i, {
|
|
662
688
|
name: v.value ? "expand_less" : "expand_more",
|
|
663
689
|
size: 20,
|
|
664
|
-
class: _(["shrink-0",
|
|
690
|
+
class: _(["shrink-0", L.value])
|
|
665
691
|
}, null, 8, ["name", "class"])
|
|
666
692
|
], 34), p(o, { name: "mli-expand" }, {
|
|
667
|
-
default: ne(() => [v.value ? (S(), u("div",
|
|
693
|
+
default: ne(() => [v.value ? (S(), u("div", ye, [d("div", be, [E(t.$slots, "children")])])) : l("", !0)]),
|
|
668
694
|
_: 3
|
|
669
|
-
})], 512)) : (S(), c(D(
|
|
695
|
+
})], 512)) : (S(), c(D(ue.value), g({
|
|
670
696
|
key: 1,
|
|
671
|
-
class:
|
|
697
|
+
class: z.value,
|
|
672
698
|
ref_key: "rootEl",
|
|
673
|
-
ref:
|
|
699
|
+
ref: B
|
|
674
700
|
}, J.value, {
|
|
675
701
|
role: "listitem",
|
|
676
702
|
onClick: fe,
|
|
677
|
-
onPointerenter:
|
|
678
|
-
onPointerleave:
|
|
679
|
-
onPointerdown:
|
|
703
|
+
onPointerenter: K,
|
|
704
|
+
onPointerleave: oe,
|
|
705
|
+
onPointerdown: se,
|
|
680
706
|
onPointerup: q,
|
|
681
707
|
onPointercancel: q,
|
|
682
|
-
onFocus:
|
|
683
|
-
onBlur:
|
|
708
|
+
onFocus: ce,
|
|
709
|
+
onBlur: le
|
|
684
710
|
}), {
|
|
685
711
|
default: ne(() => [
|
|
686
|
-
|
|
712
|
+
P.value ? (S(), u("div", {
|
|
687
713
|
key: 0,
|
|
688
|
-
class: _(["absolute top-0 right-0 h-px bg-outline-variant",
|
|
714
|
+
class: _(["absolute top-0 right-0 h-px bg-outline-variant", P.value === "inset" ? "left-16" : "left-0"])
|
|
689
715
|
}, null, 2)) : l("", !0),
|
|
690
716
|
E(t.$slots, "leading", {}, () => [T.value === "icon" ? (S(), c(i, {
|
|
691
717
|
key: 0,
|
|
692
718
|
name: e.icon,
|
|
693
719
|
size: 24,
|
|
694
|
-
class: _(["shrink-0",
|
|
720
|
+
class: _(["shrink-0", L.value])
|
|
695
721
|
}, null, 8, ["name", "class"])) : T.value === "icon-container" ? (S(), u("div", {
|
|
696
722
|
key: 1,
|
|
697
723
|
class: _(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ee[e.iconContainerColor || "primary"]])
|
|
698
724
|
}, [p(i, {
|
|
699
725
|
name: e.icon,
|
|
700
726
|
size: 24
|
|
701
|
-
}, null, 8, ["name"])], 2)) : T.value === "avatar" ? (S(), c(
|
|
727
|
+
}, null, 8, ["name"])], 2)) : T.value === "avatar" ? (S(), c(I, {
|
|
702
728
|
key: 2,
|
|
703
729
|
name: e.avatarName,
|
|
704
730
|
size: 40,
|
|
@@ -708,38 +734,38 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
708
734
|
src: e.image,
|
|
709
735
|
alt: "",
|
|
710
736
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
711
|
-
}, null, 8,
|
|
737
|
+
}, null, 8, xe)) : T.value === "checkbox" ? (S(), c(de, {
|
|
712
738
|
key: 4,
|
|
713
739
|
"model-value": C.value,
|
|
714
740
|
class: "shrink-0"
|
|
715
741
|
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
716
|
-
d("div",
|
|
742
|
+
d("div", Se, [E(t.$slots, "overline", {}, () => [e.overline ? (S(), u("p", {
|
|
717
743
|
key: 0,
|
|
718
|
-
class: _(["truncate text-label-small",
|
|
744
|
+
class: _(["truncate text-label-small", L.value])
|
|
719
745
|
}, k(e.overline), 3)) : l("", !0)]), E(t.$slots, "default", {}, () => [
|
|
720
|
-
d("p", { class: _(["truncate text-body-large",
|
|
746
|
+
d("p", { class: _(["truncate text-body-large", F.value]) }, k(e.title), 3),
|
|
721
747
|
e.subtitle && b.value >= 2 ? (S(), u("p", {
|
|
722
748
|
key: 0,
|
|
723
|
-
class: _(["text-body-medium", [
|
|
749
|
+
class: _(["text-body-medium", [L.value, b.value === 2 && "truncate"]])
|
|
724
750
|
}, k(e.subtitle), 3)) : l("", !0),
|
|
725
751
|
e.description && b.value >= 3 ? (S(), u("p", {
|
|
726
752
|
key: 1,
|
|
727
|
-
class: _(["line-clamp-2 text-body-small",
|
|
753
|
+
class: _(["line-clamp-2 text-body-small", L.value])
|
|
728
754
|
}, k(e.description), 3)) : l("", !0)
|
|
729
755
|
])]),
|
|
730
756
|
E(t.$slots, "trailing", {}, () => [O.value === "icon" ? (S(), c(i, {
|
|
731
757
|
key: 0,
|
|
732
758
|
name: e.trailingIcon,
|
|
733
759
|
size: 24,
|
|
734
|
-
class: _(["shrink-0",
|
|
760
|
+
class: _(["shrink-0", L.value])
|
|
735
761
|
}, null, 8, ["name", "class"])) : O.value === "text" ? (S(), u("span", {
|
|
736
762
|
key: 1,
|
|
737
|
-
class: _(["shrink-0 text-label-small",
|
|
738
|
-
}, k(e.trailingText), 3)) : O.value === "switch" ? (S(), c(
|
|
763
|
+
class: _(["shrink-0 text-label-small", L.value])
|
|
764
|
+
}, k(e.trailingText), 3)) : O.value === "switch" ? (S(), c(_e, {
|
|
739
765
|
key: 2,
|
|
740
766
|
"model-value": !!e.trailingValue,
|
|
741
767
|
"onUpdate:modelValue": X
|
|
742
|
-
}, null, 8, ["model-value"])) : O.value === "checkbox" ? (S(), c(
|
|
768
|
+
}, null, 8, ["model-value"])) : O.value === "checkbox" ? (S(), c(de, {
|
|
743
769
|
key: 3,
|
|
744
770
|
"model-value": !!e.trailingValue,
|
|
745
771
|
"onUpdate:modelValue": X
|
|
@@ -748,22 +774,22 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
748
774
|
_: 3
|
|
749
775
|
}, 16, ["class"]));
|
|
750
776
|
}
|
|
751
|
-
}),
|
|
777
|
+
}), De = {
|
|
752
778
|
key: 0,
|
|
753
779
|
class: "flex items-center justify-between"
|
|
754
|
-
},
|
|
780
|
+
}, Oe = {
|
|
755
781
|
key: 0,
|
|
756
782
|
class: "text-label-large text-on-surface"
|
|
757
|
-
},
|
|
783
|
+
}, ke = {
|
|
758
784
|
key: 1,
|
|
759
785
|
class: "tabular-nums text-label-large text-on-surface-variant"
|
|
760
|
-
},
|
|
786
|
+
}, Ae = [
|
|
761
787
|
"aria-valuenow",
|
|
762
788
|
"aria-valuemin",
|
|
763
789
|
"aria-valuemax",
|
|
764
790
|
"aria-disabled",
|
|
765
791
|
"aria-orientation"
|
|
766
|
-
],
|
|
792
|
+
], je = "color-mix(in srgb, var(--color-on-surface) 38%, transparent)", Me = "color-mix(in srgb, var(--color-on-surface) 12%, transparent)", Ne = /* @__PURE__ */ m({
|
|
767
793
|
__name: "MSlider",
|
|
768
794
|
props: {
|
|
769
795
|
modelValue: {},
|
|
@@ -883,65 +909,65 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
883
909
|
iconSize: 28,
|
|
884
910
|
thumbIconSize: 66
|
|
885
911
|
}
|
|
886
|
-
}, j = s(() => A[n.size] ?? A.xs), M = s(() => j.value.thumbInset + j.value.thumbW / 2 + j.value.iconSize / 2 + 3), N = s(() => n.thumbIcon ? Math.max(j.value.gap, j.value.thumbIconSize / 2 + 4) : j.value.gap),
|
|
912
|
+
}, j = s(() => A[n.size] ?? A.xs), M = s(() => j.value.thumbInset + j.value.thumbW / 2 + j.value.iconSize / 2 + 3), N = s(() => n.thumbIcon ? Math.max(j.value.gap, j.value.thumbIconSize / 2 + 4) : j.value.gap), P = {
|
|
887
913
|
primary: "var(--color-primary)",
|
|
888
914
|
secondary: "var(--color-secondary)",
|
|
889
915
|
tertiary: "var(--color-tertiary)",
|
|
890
916
|
error: "var(--color-error)"
|
|
891
917
|
};
|
|
892
|
-
function
|
|
918
|
+
function F(e, t) {
|
|
893
919
|
let n = e ?? t;
|
|
894
|
-
return
|
|
920
|
+
return P[n] ?? n;
|
|
895
921
|
}
|
|
896
|
-
let
|
|
897
|
-
active:
|
|
898
|
-
inactive:
|
|
922
|
+
let I = s(() => n.disabled ? {
|
|
923
|
+
active: je,
|
|
924
|
+
inactive: Me
|
|
899
925
|
} : {
|
|
900
|
-
active:
|
|
926
|
+
active: F(n.fillColor, n.color),
|
|
901
927
|
inactive: "var(--color-secondary-container)"
|
|
902
|
-
}),
|
|
903
|
-
active:
|
|
904
|
-
inactive:
|
|
928
|
+
}), L = s(() => n.disabled ? {
|
|
929
|
+
active: je,
|
|
930
|
+
inactive: Me
|
|
905
931
|
} : {
|
|
906
|
-
active:
|
|
932
|
+
active: F(n.thumbColor, n.color),
|
|
907
933
|
inactive: "var(--color-secondary-container)"
|
|
908
934
|
});
|
|
909
|
-
function
|
|
935
|
+
function R(e) {
|
|
910
936
|
let t = Math.round((e - n.min) / n.step) * n.step + n.min;
|
|
911
937
|
return Math.max(n.min, Math.min(n.max, +t.toFixed(10)));
|
|
912
938
|
}
|
|
913
|
-
function
|
|
939
|
+
function z(e) {
|
|
914
940
|
if (!f.value) return 0;
|
|
915
941
|
let t = f.value.getBoundingClientRect();
|
|
916
942
|
return g.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));
|
|
917
943
|
}
|
|
918
|
-
function
|
|
919
|
-
return
|
|
944
|
+
function B(e) {
|
|
945
|
+
return R(n.min + z(e) * (n.max - n.min));
|
|
920
946
|
}
|
|
921
|
-
function
|
|
947
|
+
function re(e) {
|
|
922
948
|
if (n.disabled) return;
|
|
923
949
|
e.preventDefault();
|
|
924
|
-
let t =
|
|
950
|
+
let t = B(e);
|
|
925
951
|
if (b.value) {
|
|
926
952
|
let e = n.modelValue, i = Math.abs(t - e[0]) <= Math.abs(t - e[1]) ? 0 : 1;
|
|
927
953
|
m.value = i;
|
|
928
954
|
let a = [e[0], e[1]];
|
|
929
955
|
a[i] = t, r("update:modelValue", a);
|
|
930
956
|
} else m.value = "single", r("update:modelValue", t);
|
|
931
|
-
window.addEventListener("pointermove",
|
|
957
|
+
window.addEventListener("pointermove", V), window.addEventListener("pointerup", H), window.addEventListener("pointercancel", H);
|
|
932
958
|
}
|
|
933
|
-
function
|
|
959
|
+
function V(e) {
|
|
934
960
|
if (m.value === !1) return;
|
|
935
|
-
let t =
|
|
961
|
+
let t = B(e);
|
|
936
962
|
if (b.value) {
|
|
937
963
|
let e = n.modelValue, i = [e[0], e[1]];
|
|
938
964
|
i[m.value] = t, r("update:modelValue", i);
|
|
939
965
|
} else r("update:modelValue", t);
|
|
940
966
|
}
|
|
941
|
-
function
|
|
942
|
-
m.value = !1, window.removeEventListener("pointermove",
|
|
967
|
+
function H() {
|
|
968
|
+
m.value = !1, window.removeEventListener("pointermove", V), window.removeEventListener("pointerup", H), window.removeEventListener("pointercancel", H);
|
|
943
969
|
}
|
|
944
|
-
function
|
|
970
|
+
function U(e) {
|
|
945
971
|
if (n.disabled) return;
|
|
946
972
|
let t = {
|
|
947
973
|
ArrowRight: 1,
|
|
@@ -952,15 +978,15 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
952
978
|
if (t !== void 0) {
|
|
953
979
|
if (e.preventDefault(), b.value) {
|
|
954
980
|
let e = n.modelValue;
|
|
955
|
-
r("update:modelValue", [
|
|
956
|
-
} else r("update:modelValue",
|
|
981
|
+
r("update:modelValue", [R(e[0] + t * n.step), e[1]]);
|
|
982
|
+
} else r("update:modelValue", R(n.modelValue + t * n.step));
|
|
957
983
|
}
|
|
958
984
|
e.key === "Home" && (e.preventDefault(), r("update:modelValue", b.value ? [n.min, n.modelValue[1]] : n.min)), e.key === "End" && (e.preventDefault(), r("update:modelValue", b.value ? [n.modelValue[0], n.max] : n.max));
|
|
959
985
|
}
|
|
960
986
|
y(() => {
|
|
961
|
-
window.removeEventListener("pointermove",
|
|
987
|
+
window.removeEventListener("pointermove", V), window.removeEventListener("pointerup", H), window.removeEventListener("pointercancel", H);
|
|
962
988
|
});
|
|
963
|
-
let
|
|
989
|
+
let W = s(() => {
|
|
964
990
|
if (!n.stops) return [];
|
|
965
991
|
let e = [], t = n.max - n.min, r = n.icon ? (j.value.iconSize + j.value.radius) / 2 : 0;
|
|
966
992
|
for (let i = n.min + n.step; i < n.max; i += n.step) {
|
|
@@ -969,28 +995,28 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
969
995
|
}
|
|
970
996
|
return e.length <= 28 ? e : [];
|
|
971
997
|
});
|
|
972
|
-
function
|
|
998
|
+
function G(e) {
|
|
973
999
|
return `calc(${$(e)} - ${N.value}px)`;
|
|
974
1000
|
}
|
|
975
|
-
function
|
|
1001
|
+
function ie(e) {
|
|
976
1002
|
return `calc(100% - ${$(e)} - ${N.value}px)`;
|
|
977
1003
|
}
|
|
978
|
-
function
|
|
1004
|
+
function ae() {
|
|
979
1005
|
return `calc(${$(E.value)} - ${N.value}px)`;
|
|
980
1006
|
}
|
|
981
|
-
function
|
|
1007
|
+
function K() {
|
|
982
1008
|
return `calc(${$(E.value)} + ${N.value}px)`;
|
|
983
1009
|
}
|
|
984
|
-
function
|
|
1010
|
+
function oe() {
|
|
985
1011
|
return `calc(${$(D.value)} - ${$(E.value)} - ${N.value * 2}px)`;
|
|
986
1012
|
}
|
|
987
|
-
function
|
|
1013
|
+
function se() {
|
|
988
1014
|
return `calc(100% - ${$(D.value)} - ${N.value}px)`;
|
|
989
1015
|
}
|
|
990
|
-
function
|
|
1016
|
+
function q() {
|
|
991
1017
|
return E.value >= O.value ? `${O.value}%` : `calc(${$(E.value)} + ${N.value}px)`;
|
|
992
1018
|
}
|
|
993
|
-
function
|
|
1019
|
+
function ce() {
|
|
994
1020
|
return E.value >= O.value ? `calc(${$(E.value)} - ${O.value}% - ${N.value}px)` : `calc(${O.value}% - ${$(E.value)} - ${N.value}px)`;
|
|
995
1021
|
}
|
|
996
1022
|
function le() {
|
|
@@ -1020,7 +1046,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1020
1046
|
width: `${t}px`,
|
|
1021
1047
|
height: `${n}px`,
|
|
1022
1048
|
borderRadius: `${r}px`,
|
|
1023
|
-
backgroundColor:
|
|
1049
|
+
backgroundColor: L.value.active,
|
|
1024
1050
|
zIndex: "2",
|
|
1025
1051
|
transition: Z.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1026
1052
|
}, o = i || h.value, s = i ? 1.08 : 1, c = o ? .5 : 1;
|
|
@@ -1029,7 +1055,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1029
1055
|
function he(e) {
|
|
1030
1056
|
let t = m.value === !1 ? 1 : 1.15, n = {
|
|
1031
1057
|
position: "absolute",
|
|
1032
|
-
color:
|
|
1058
|
+
color: L.value.active,
|
|
1033
1059
|
zIndex: "2",
|
|
1034
1060
|
transition: Z.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1035
1061
|
};
|
|
@@ -1050,7 +1076,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1050
1076
|
};
|
|
1051
1077
|
}
|
|
1052
1078
|
let _e = s(() => b.value ? `${x.value.lo} – ${x.value.hi}` : String(n.modelValue)), ve = s(() => b.value && typeof m.value == "number" ? n.modelValue[m.value] : n.modelValue), ye = s(() => b.value && typeof m.value == "number" ? C(n.modelValue[m.value]) : E.value);
|
|
1053
|
-
return (t, n) => (S(), u("div", { class: _(["flex select-none", g.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [e.label || e.showValue ? (S(), u("div",
|
|
1079
|
+
return (t, n) => (S(), u("div", { class: _(["flex select-none", g.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [e.label || e.showValue ? (S(), u("div", De, [e.label ? (S(), u("span", Oe, k(e.label), 1)) : l("", !0), e.showValue ? (S(), u("span", ke, k(_e.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: _(["flex items-center", g.value ? "flex-1 flex-col" : ""]) }, [d("div", {
|
|
1054
1080
|
ref_key: "trackEl",
|
|
1055
1081
|
ref: f,
|
|
1056
1082
|
role: "slider",
|
|
@@ -1069,8 +1095,8 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1069
1095
|
height: `${j.value.hitArea}px`,
|
|
1070
1096
|
width: "100%"
|
|
1071
1097
|
}),
|
|
1072
|
-
onPointerdown:
|
|
1073
|
-
onKeydown:
|
|
1098
|
+
onPointerdown: re,
|
|
1099
|
+
onKeydown: U,
|
|
1074
1100
|
onFocus: n[0] ||= (e) => h.value = !0,
|
|
1075
1101
|
onBlur: n[1] ||= (e) => h.value = !1
|
|
1076
1102
|
}, [
|
|
@@ -1099,15 +1125,15 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1099
1125
|
left: 0,
|
|
1100
1126
|
right: 0,
|
|
1101
1127
|
bottom: 0,
|
|
1102
|
-
height:
|
|
1128
|
+
height: G(E.value)
|
|
1103
1129
|
} : {
|
|
1104
1130
|
top: 0,
|
|
1105
1131
|
bottom: 0,
|
|
1106
1132
|
left: 0,
|
|
1107
|
-
width:
|
|
1133
|
+
width: G(E.value)
|
|
1108
1134
|
},
|
|
1109
1135
|
borderRadius: X(),
|
|
1110
|
-
backgroundColor:
|
|
1136
|
+
backgroundColor: I.value.active,
|
|
1111
1137
|
transition: `all ${Q.value}`
|
|
1112
1138
|
})
|
|
1113
1139
|
}, null, 4), d("div", {
|
|
@@ -1117,15 +1143,15 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1117
1143
|
left: 0,
|
|
1118
1144
|
right: 0,
|
|
1119
1145
|
top: 0,
|
|
1120
|
-
height:
|
|
1146
|
+
height: ie(E.value)
|
|
1121
1147
|
} : {
|
|
1122
1148
|
top: 0,
|
|
1123
1149
|
bottom: 0,
|
|
1124
1150
|
right: 0,
|
|
1125
|
-
width:
|
|
1151
|
+
width: ie(E.value)
|
|
1126
1152
|
},
|
|
1127
1153
|
borderRadius: pe(),
|
|
1128
|
-
backgroundColor:
|
|
1154
|
+
backgroundColor: I.value.inactive,
|
|
1129
1155
|
transition: `all ${Q.value}`
|
|
1130
1156
|
})
|
|
1131
1157
|
}, null, 4)], 64)) : e.variant === "centered" ? (S(), u(a, { key: 1 }, [
|
|
@@ -1135,16 +1161,16 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1135
1161
|
...g.value ? {
|
|
1136
1162
|
left: 0,
|
|
1137
1163
|
right: 0,
|
|
1138
|
-
bottom:
|
|
1139
|
-
height:
|
|
1164
|
+
bottom: q(),
|
|
1165
|
+
height: ce()
|
|
1140
1166
|
} : {
|
|
1141
1167
|
top: 0,
|
|
1142
1168
|
bottom: 0,
|
|
1143
|
-
left:
|
|
1144
|
-
width:
|
|
1169
|
+
left: q(),
|
|
1170
|
+
width: ce()
|
|
1145
1171
|
},
|
|
1146
1172
|
borderRadius: fe(),
|
|
1147
|
-
backgroundColor:
|
|
1173
|
+
backgroundColor: I.value.active,
|
|
1148
1174
|
transition: `all ${Q.value}`
|
|
1149
1175
|
})
|
|
1150
1176
|
}, null, 4),
|
|
@@ -1163,7 +1189,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1163
1189
|
width: le()
|
|
1164
1190
|
},
|
|
1165
1191
|
borderRadius: pe(),
|
|
1166
|
-
backgroundColor:
|
|
1192
|
+
backgroundColor: I.value.inactive,
|
|
1167
1193
|
transition: `all ${Q.value}`
|
|
1168
1194
|
})
|
|
1169
1195
|
}, null, 4),
|
|
@@ -1182,7 +1208,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1182
1208
|
width: ue()
|
|
1183
1209
|
},
|
|
1184
1210
|
borderRadius: X(),
|
|
1185
|
-
backgroundColor:
|
|
1211
|
+
backgroundColor: I.value.inactive,
|
|
1186
1212
|
transition: `all ${Q.value}`
|
|
1187
1213
|
})
|
|
1188
1214
|
}, null, 4)
|
|
@@ -1194,15 +1220,15 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1194
1220
|
left: 0,
|
|
1195
1221
|
right: 0,
|
|
1196
1222
|
bottom: 0,
|
|
1197
|
-
height:
|
|
1223
|
+
height: ae()
|
|
1198
1224
|
} : {
|
|
1199
1225
|
top: 0,
|
|
1200
1226
|
bottom: 0,
|
|
1201
1227
|
left: 0,
|
|
1202
|
-
width:
|
|
1228
|
+
width: ae()
|
|
1203
1229
|
},
|
|
1204
1230
|
borderRadius: X(),
|
|
1205
|
-
backgroundColor:
|
|
1231
|
+
backgroundColor: I.value.inactive,
|
|
1206
1232
|
transition: `all ${Q.value}`
|
|
1207
1233
|
})
|
|
1208
1234
|
}, null, 4),
|
|
@@ -1212,16 +1238,16 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1212
1238
|
...g.value ? {
|
|
1213
1239
|
left: 0,
|
|
1214
1240
|
right: 0,
|
|
1215
|
-
bottom:
|
|
1216
|
-
height:
|
|
1241
|
+
bottom: K(),
|
|
1242
|
+
height: oe()
|
|
1217
1243
|
} : {
|
|
1218
1244
|
top: 0,
|
|
1219
1245
|
bottom: 0,
|
|
1220
|
-
left:
|
|
1221
|
-
width:
|
|
1246
|
+
left: K(),
|
|
1247
|
+
width: oe()
|
|
1222
1248
|
},
|
|
1223
1249
|
borderRadius: fe(),
|
|
1224
|
-
backgroundColor:
|
|
1250
|
+
backgroundColor: I.value.active,
|
|
1225
1251
|
transition: `all ${Q.value}`
|
|
1226
1252
|
})
|
|
1227
1253
|
}, null, 4),
|
|
@@ -1232,15 +1258,15 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1232
1258
|
left: 0,
|
|
1233
1259
|
right: 0,
|
|
1234
1260
|
top: 0,
|
|
1235
|
-
height:
|
|
1261
|
+
height: se()
|
|
1236
1262
|
} : {
|
|
1237
1263
|
top: 0,
|
|
1238
1264
|
bottom: 0,
|
|
1239
1265
|
right: 0,
|
|
1240
|
-
width:
|
|
1266
|
+
width: se()
|
|
1241
1267
|
},
|
|
1242
1268
|
borderRadius: pe(),
|
|
1243
|
-
backgroundColor:
|
|
1269
|
+
backgroundColor: I.value.inactive,
|
|
1244
1270
|
transition: `all ${Q.value}`
|
|
1245
1271
|
})
|
|
1246
1272
|
}, null, 4)
|
|
@@ -1251,7 +1277,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1251
1277
|
size: j.value.iconSize,
|
|
1252
1278
|
class: "absolute z-[1]",
|
|
1253
1279
|
style: v({
|
|
1254
|
-
color: e.variant === "standard" && E.value > 0 || e.variant === "range" && E.value > 0 ?
|
|
1280
|
+
color: e.variant === "standard" && E.value > 0 || e.variant === "range" && E.value > 0 ? I.value.inactive : I.value.active,
|
|
1255
1281
|
...g.value ? {
|
|
1256
1282
|
left: "50%",
|
|
1257
1283
|
bottom: `${M.value}px`,
|
|
@@ -1273,7 +1299,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1273
1299
|
style: v({
|
|
1274
1300
|
width: `${j.value.dot}px`,
|
|
1275
1301
|
height: `${j.value.dot}px`,
|
|
1276
|
-
backgroundColor:
|
|
1302
|
+
backgroundColor: I.value.active,
|
|
1277
1303
|
opacity: +!ee.value,
|
|
1278
1304
|
...g.value ? {
|
|
1279
1305
|
left: "50%",
|
|
@@ -1293,7 +1319,7 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1293
1319
|
style: v({
|
|
1294
1320
|
width: `${j.value.dot}px`,
|
|
1295
1321
|
height: `${j.value.dot}px`,
|
|
1296
|
-
backgroundColor:
|
|
1322
|
+
backgroundColor: I.value.active,
|
|
1297
1323
|
opacity: +!te.value,
|
|
1298
1324
|
...g.value ? {
|
|
1299
1325
|
left: "50%",
|
|
@@ -1307,13 +1333,13 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1307
1333
|
transition: "opacity 150ms ease"
|
|
1308
1334
|
})
|
|
1309
1335
|
}, null, 4)),
|
|
1310
|
-
e.stops ? (S(!0), u(a, { key: 6 }, T(
|
|
1336
|
+
e.stops ? (S(!0), u(a, { key: 6 }, T(W.value, (e, t) => (S(), u("div", {
|
|
1311
1337
|
key: t,
|
|
1312
1338
|
class: "absolute rounded-full",
|
|
1313
1339
|
style: v({
|
|
1314
1340
|
width: `${j.value.dot}px`,
|
|
1315
1341
|
height: `${j.value.dot}px`,
|
|
1316
|
-
backgroundColor: e <= E.value ?
|
|
1342
|
+
backgroundColor: e <= E.value ? I.value.inactive : I.value.active,
|
|
1317
1343
|
opacity: Math.abs(e - E.value) < .01 || b.value && Math.abs(e - D.value) < .01 ? 0 : 1,
|
|
1318
1344
|
...g.value ? {
|
|
1319
1345
|
left: "50%",
|
|
@@ -1367,10 +1393,10 @@ var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE
|
|
|
1367
1393
|
}, k(ve.value), 5)) : l("", !0)]),
|
|
1368
1394
|
_: 1
|
|
1369
1395
|
})
|
|
1370
|
-
], 46,
|
|
1396
|
+
], 46, Ae)], 2)], 2));
|
|
1371
1397
|
}
|
|
1372
1398
|
});
|
|
1373
1399
|
//#endregion
|
|
1374
|
-
export {
|
|
1400
|
+
export { Z as a, V as c, z as d, I as f, F as h, Q as i, H as l, N as m, Ee as n, de as o, P as p, _e as r, q as s, Ne as t, B as u };
|
|
1375
1401
|
|
|
1376
|
-
//# sourceMappingURL=MSlider-
|
|
1402
|
+
//# sourceMappingURL=MSlider-BXsBv0ox.js.map
|