@m3ui-vue/m3ui-vue 1.2.0 → 1.2.2
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 +152 -11
- package/dist/{MMenuItem-DI351kIf.js → MMenuItem-D4Gx_l3F.js} +2 -2
- package/dist/{MMenuItem-DI351kIf.js.map → MMenuItem-D4Gx_l3F.js.map} +1 -1
- package/dist/{MSlider-BnEy5ieZ.js → MSlider-Dx_S3vJ9.js} +227 -221
- package/dist/{MSlider-BnEy5ieZ.js.map → MSlider-Dx_S3vJ9.js.map} +1 -1
- package/dist/{MTextField-BBmkaIbO.js → MTextField-Bz8JIsnl.js} +4 -4
- package/dist/{MTextField-BBmkaIbO.js.map → MTextField-Bz8JIsnl.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/components/MMap.vue.d.ts +1 -1
- package/dist/components/MSlider.vue.d.ts +2 -2
- package/dist/composables/_effectCanvas.d.ts +23 -0
- package/dist/composables/_storageKeys.d.ts +9 -0
- package/dist/composables/themeInitScript.d.ts +2 -0
- package/dist/composables/useConfetti.d.ts +19 -8
- package/dist/composables/useFireworks.d.ts +37 -0
- package/dist/composables/useReactions.d.ts +32 -0
- package/dist/composables/viewportHints.d.ts +2 -0
- package/dist/directives/vSparkle.d.ts +27 -0
- package/dist/index.d.ts +7 -1
- package/dist/m3ui.js +5404 -5023
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +572 -572
- package/dist/map.js.map +1 -1
- package/dist/plugin.d.ts +10 -0
- package/dist/rich-text-editor.js +2 -2
- package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-y0HZpyhL.js} +23 -8
- package/dist/useThemeTokens-y0HZpyhL.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MSegmentedButton.test.ts +10 -0
- package/src/__tests__/MSlider.test.ts +36 -0
- package/src/__tests__/plugin.test.ts +56 -1
- package/src/__tests__/ssr.test.ts +1 -1
- package/src/__tests__/themeInitScript.test.ts +10 -0
- package/src/__tests__/useConfetti.test.ts +33 -2
- package/src/__tests__/useFireworks.test.ts +104 -0
- package/src/__tests__/useReactions.test.ts +51 -0
- package/src/__tests__/vSparkle.test.ts +83 -0
- package/src/components/MEmojiSelector.vue +3 -2
- package/src/components/MMap.vue +3 -2
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSlider.vue +22 -4
- package/src/components/MTextField.vue +8 -4
- package/src/composables/_colorUtils.ts +4 -2
- package/src/composables/_effectCanvas.ts +109 -0
- package/src/composables/_ssrState.ts +2 -2
- package/src/composables/_storageKeys.ts +28 -0
- package/src/composables/themeInitScript.ts +5 -2
- package/src/composables/useColorPalette.ts +36 -8
- package/src/composables/useConfetti.ts +84 -107
- package/src/composables/useFireworks.ts +360 -0
- package/src/composables/useReactions.ts +131 -0
- package/src/composables/useTheme.ts +21 -4
- package/src/composables/viewportHints.ts +6 -5
- package/src/directives/vSparkle.ts +180 -0
- package/src/index.ts +7 -1
- package/src/plugin.ts +21 -5
- package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as e } from "./useLocale-JYxDDeXC.js";
|
|
2
|
-
import { l as t, o as n, s as r } from "./MTextField-
|
|
2
|
+
import { l as t, o as n, s as r } from "./MTextField-Bz8JIsnl.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
5
|
//#endregion
|
|
@@ -35,16 +35,16 @@ var L = /* @__PURE__ */ m({
|
|
|
35
35
|
], z = ["src", "alt"], B = {
|
|
36
36
|
key: 1,
|
|
37
37
|
class: "px-4 pt-4 pb-2"
|
|
38
|
-
},
|
|
38
|
+
}, re = {
|
|
39
39
|
key: 2,
|
|
40
40
|
class: "px-4 pt-4 pb-2"
|
|
41
|
-
},
|
|
41
|
+
}, ie = { class: "text-title-large font-medium text-on-surface" }, V = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
44
|
-
},
|
|
44
|
+
}, H = {
|
|
45
45
|
key: 3,
|
|
46
46
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
47
|
-
},
|
|
47
|
+
}, ae = "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]", oe = /* @__PURE__ */ m({
|
|
48
48
|
__name: "MCard",
|
|
49
49
|
props: {
|
|
50
50
|
variant: { default: "elevated" },
|
|
@@ -93,7 +93,7 @@ var L = /* @__PURE__ */ m({
|
|
|
93
93
|
o.value ? [
|
|
94
94
|
"cursor-pointer",
|
|
95
95
|
a[n.value],
|
|
96
|
-
|
|
96
|
+
ae
|
|
97
97
|
] : "",
|
|
98
98
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
99
99
|
]]),
|
|
@@ -112,19 +112,19 @@ var L = /* @__PURE__ */ m({
|
|
|
112
112
|
alt: e.imageAlt ?? "",
|
|
113
113
|
class: "h-full w-full object-cover"
|
|
114
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",
|
|
115
|
+
t.$slots.header ? (E(), u("div", B, [A(t.$slots, "header")])) : e.title ? (E(), u("div", re, [d("h3", ie, M(e.title), 1), e.subtitle ? (E(), u("p", V, M(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
116
116
|
A(t.$slots, "default"),
|
|
117
|
-
t.$slots.actions ? (E(), u("div",
|
|
117
|
+
t.$slots.actions ? (E(), u("div", H, [A(t.$slots, "actions")])) : l("", !0)
|
|
118
118
|
], 46, R));
|
|
119
119
|
}
|
|
120
|
-
}),
|
|
120
|
+
}), se = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, U = [
|
|
121
121
|
"checked",
|
|
122
122
|
"disabled",
|
|
123
123
|
"aria-label"
|
|
124
|
-
],
|
|
124
|
+
], ce = {
|
|
125
125
|
key: 1,
|
|
126
126
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
127
|
-
},
|
|
127
|
+
}, le = /* @__PURE__ */ m({
|
|
128
128
|
__name: "MCheckbox",
|
|
129
129
|
props: {
|
|
130
130
|
modelValue: { type: Boolean },
|
|
@@ -153,7 +153,7 @@ var L = /* @__PURE__ */ m({
|
|
|
153
153
|
tertiary: "bg-tertiary",
|
|
154
154
|
error: "bg-error"
|
|
155
155
|
};
|
|
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",
|
|
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", se, [
|
|
157
157
|
d("input", {
|
|
158
158
|
type: "checkbox",
|
|
159
159
|
class: "peer sr-only",
|
|
@@ -161,12 +161,12 @@ var L = /* @__PURE__ */ m({
|
|
|
161
161
|
disabled: e.disabled,
|
|
162
162
|
"aria-label": e.ariaLabel,
|
|
163
163
|
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
164
|
-
}, null, 40,
|
|
164
|
+
}, null, 40, U),
|
|
165
165
|
e.disabled ? l("", !0) : (E(), u("span", {
|
|
166
166
|
key: 0,
|
|
167
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"])
|
|
168
168
|
}, null, 2)),
|
|
169
|
-
e.disabled ? l("", !0) : (E(), u("span",
|
|
169
|
+
e.disabled ? l("", !0) : (E(), u("span", ce)),
|
|
170
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, {
|
|
171
171
|
name: e.indeterminate ? "remove" : "check",
|
|
172
172
|
size: 18,
|
|
@@ -177,7 +177,7 @@ var L = /* @__PURE__ */ m({
|
|
|
177
177
|
class: b(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
178
178
|
}, [A(t.$slots, "default", {}, () => [f(M(e.label), 1)])], 2)) : l("", !0)], 2));
|
|
179
179
|
}
|
|
180
|
-
}), ue = ["disabled", "aria-pressed"], W = { class: "whitespace-nowrap" }, de = ["aria-label", "disabled"],
|
|
180
|
+
}), ue = ["disabled", "aria-pressed"], W = { class: "whitespace-nowrap" }, de = ["aria-label", "disabled"], G = ["aria-label", "disabled"], fe = "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", pe = /* @__PURE__ */ m({
|
|
181
181
|
__name: "MChip",
|
|
182
182
|
props: {
|
|
183
183
|
tone: { default: "neutral" },
|
|
@@ -319,7 +319,7 @@ var L = /* @__PURE__ */ m({
|
|
|
319
319
|
class: b(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
320
320
|
C.value,
|
|
321
321
|
S.value,
|
|
322
|
-
a.clickable && !a.disabled ?
|
|
322
|
+
a.clickable && !a.disabled ? fe : "",
|
|
323
323
|
a.disabled ? "cursor-not-allowed" : ""
|
|
324
324
|
]]),
|
|
325
325
|
style: x(y.value),
|
|
@@ -342,7 +342,7 @@ var L = /* @__PURE__ */ m({
|
|
|
342
342
|
}, [p(i, {
|
|
343
343
|
name: "close",
|
|
344
344
|
size: 16
|
|
345
|
-
})], 8,
|
|
345
|
+
})], 8, G)) : l("", !0)
|
|
346
346
|
]),
|
|
347
347
|
_: 3
|
|
348
348
|
}, 8, [
|
|
@@ -355,7 +355,7 @@ var L = /* @__PURE__ */ m({
|
|
|
355
355
|
});
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region src/composables/_useSegmentRuns.ts
|
|
358
|
-
function
|
|
358
|
+
function K(e) {
|
|
359
359
|
let t = j(/* @__PURE__ */ new Map());
|
|
360
360
|
function n() {
|
|
361
361
|
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
@@ -371,7 +371,7 @@ function q(e) {
|
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
-
var
|
|
374
|
+
var q = ["role"], J = /* @__PURE__ */ m({
|
|
375
375
|
__name: "MList",
|
|
376
376
|
props: {
|
|
377
377
|
dense: {
|
|
@@ -399,7 +399,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
399
399
|
},
|
|
400
400
|
emits: ["update:selected"],
|
|
401
401
|
setup(e, { emit: t }) {
|
|
402
|
-
let n = e, r = t, i = O(), a =
|
|
402
|
+
let n = e, r = t, i = O(), a = K(i);
|
|
403
403
|
D("m-list", {
|
|
404
404
|
segmentPosition: a,
|
|
405
405
|
dense: s(() => n.dense),
|
|
@@ -436,12 +436,12 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
436
436
|
role: e.selectable ? "listbox" : "list",
|
|
437
437
|
class: b(d.value),
|
|
438
438
|
onKeydown: c
|
|
439
|
-
}, [A(t.$slots, "default")], 42,
|
|
439
|
+
}, [A(t.$slots, "default")], 42, q));
|
|
440
440
|
}
|
|
441
|
-
}),
|
|
441
|
+
}), me = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], Y = {
|
|
442
442
|
key: 0,
|
|
443
443
|
class: "text-body-large text-on-surface"
|
|
444
|
-
},
|
|
444
|
+
}, 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({
|
|
445
445
|
__name: "MSwitch",
|
|
446
446
|
props: {
|
|
447
447
|
modelValue: { type: Boolean },
|
|
@@ -498,7 +498,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
498
498
|
onPointerup: v,
|
|
499
499
|
onPointerleave: v,
|
|
500
500
|
onPointercancel: v
|
|
501
|
-
}, [d("span",
|
|
501
|
+
}, [d("span", me, [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"]) }, [
|
|
502
502
|
d("input", {
|
|
503
503
|
type: "checkbox",
|
|
504
504
|
class: "peer sr-only",
|
|
@@ -517,7 +517,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
517
517
|
style: x(C.value)
|
|
518
518
|
}, null, 4)),
|
|
519
519
|
d("span", {
|
|
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"] :
|
|
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"] : ge]),
|
|
521
521
|
style: x(S.value)
|
|
522
522
|
}, [p(o, {
|
|
523
523
|
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
@@ -535,7 +535,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
535
535
|
}, null, 8, ["class"])) : l("", !0)]),
|
|
536
536
|
_: 1
|
|
537
537
|
})], 6)
|
|
538
|
-
], 2)]), e.label ? (E(), u("span",
|
|
538
|
+
], 2)]), e.label ? (E(), u("span", Y, M(e.label), 1)) : l("", !0)], 34));
|
|
539
539
|
}
|
|
540
540
|
}), ve = [
|
|
541
541
|
"tabindex",
|
|
@@ -595,63 +595,63 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
595
595
|
function R(e) {
|
|
596
596
|
(T.value || k.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), Le(e)));
|
|
597
597
|
}
|
|
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),
|
|
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), re = s(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), ie = {
|
|
599
599
|
primary: "bg-primary-container text-on-primary-container",
|
|
600
600
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
601
601
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
602
602
|
error: "bg-error-container text-on-error-container",
|
|
603
603
|
success: "bg-success-container text-on-success-container"
|
|
604
|
-
},
|
|
604
|
+
}, V = s(() => S?.dense.value ?? !1), H = s(() => S?.nav.value ?? !1), ae = s(() => S?.segmented.value ?? !1), oe = s(() => S?.dividers.value ?? !1), se = s(() => z.value ? "text-on-secondary-container" : "text-on-surface"), U = s(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), ce = s(() => V.value ? "" : C.value === 3 ? "min-h-22" : C.value === 2 ? "min-h-18" : "min-h-14"), ue = s(() => [
|
|
605
605
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
606
|
+
ae.value ? "bg-surface-container px-4" : H.value ? "rounded-full px-4" : "px-4",
|
|
607
|
+
V.value ? "py-1" : C.value === 3 ? "py-3" : "py-2",
|
|
608
|
+
ce.value,
|
|
609
609
|
w.value && !r.disabled && "cursor-pointer transition-colors duration-150 hover:bg-on-surface/8 active:bg-on-surface/12",
|
|
610
610
|
z.value && "bg-secondary-container text-on-secondary-container",
|
|
611
611
|
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
612
|
-
]), W = O(null), de = O(null),
|
|
612
|
+
]), W = O(null), de = O(null), G = (e, { slots: t }) => j.value ? g("li", {
|
|
613
613
|
role: "listitem",
|
|
614
614
|
ref: (e) => {
|
|
615
615
|
de.value = e;
|
|
616
616
|
}
|
|
617
|
-
}, t.default?.()) : t.default?.(),
|
|
618
|
-
if (
|
|
619
|
-
let e = w.value && !r.disabled, t = e &&
|
|
617
|
+
}, t.default?.()) : t.default?.(), fe = O(null), pe = (e) => e && "$el" in e ? e.$el : e, K = O(!1), q = O(!1), J = O(!1), me = s(() => ae.value ? S?.segmentPosition(j.value ? de.value : pe(W.value)) : void 0), he = s(() => {
|
|
618
|
+
if (H.value) return [];
|
|
619
|
+
let e = w.value && !r.disabled, t = e && q.value || z.value || e && J.value ? Ee : e && K.value ? Te : null;
|
|
620
620
|
if (t !== null) return [
|
|
621
621
|
t,
|
|
622
622
|
t,
|
|
623
623
|
t,
|
|
624
624
|
t
|
|
625
625
|
];
|
|
626
|
-
let n =
|
|
626
|
+
let n = me.value, i = n === "first" || n === "single" ? Ee : we, a = n === "last" || n === "single" ? Ee : we;
|
|
627
627
|
return [
|
|
628
628
|
i,
|
|
629
629
|
i,
|
|
630
630
|
a,
|
|
631
631
|
a
|
|
632
632
|
];
|
|
633
|
-
}), { snap:
|
|
634
|
-
let t =
|
|
633
|
+
}), { snap: Y } = t(() => he.value, (e) => {
|
|
634
|
+
let t = fe.value ?? pe(W.value);
|
|
635
635
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
636
636
|
});
|
|
637
|
-
F([
|
|
638
|
-
function
|
|
639
|
-
e.pointerType !== "touch" && (
|
|
637
|
+
F([me, H], () => Y());
|
|
638
|
+
function ge(e) {
|
|
639
|
+
e.pointerType !== "touch" && (K.value = !0);
|
|
640
640
|
}
|
|
641
641
|
function De() {
|
|
642
|
-
|
|
642
|
+
K.value = !1, q.value = !1;
|
|
643
643
|
}
|
|
644
644
|
function Oe(e) {
|
|
645
|
-
e.button === 0 && (
|
|
645
|
+
e.button === 0 && (q.value = !0);
|
|
646
646
|
}
|
|
647
647
|
function ke() {
|
|
648
|
-
|
|
648
|
+
q.value = !1;
|
|
649
649
|
}
|
|
650
650
|
function Ae(e) {
|
|
651
|
-
|
|
651
|
+
J.value = e.currentTarget.matches(":focus-visible");
|
|
652
652
|
}
|
|
653
653
|
function je() {
|
|
654
|
-
|
|
654
|
+
J.value = !1;
|
|
655
655
|
}
|
|
656
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
657
|
function Fe(e) {
|
|
@@ -678,7 +678,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
678
678
|
ref: W
|
|
679
679
|
}, t.$attrs, { role: "listitem" }), [d("div", {
|
|
680
680
|
ref_key: "shapeEl",
|
|
681
|
-
ref:
|
|
681
|
+
ref: fe,
|
|
682
682
|
role: "button",
|
|
683
683
|
tabindex: e.disabled ? -1 : 0,
|
|
684
684
|
"aria-expanded": x.value,
|
|
@@ -689,7 +689,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
689
689
|
onKeydown: Fe,
|
|
690
690
|
onFocus: Ae,
|
|
691
691
|
onBlur: je,
|
|
692
|
-
onPointerenter:
|
|
692
|
+
onPointerenter: ge,
|
|
693
693
|
onPointerleave: De,
|
|
694
694
|
onPointerdown: Oe,
|
|
695
695
|
onPointerup: ke,
|
|
@@ -699,19 +699,19 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
699
699
|
key: 0,
|
|
700
700
|
name: e.icon,
|
|
701
701
|
size: 24,
|
|
702
|
-
class: b(["shrink-0",
|
|
702
|
+
class: b(["shrink-0", U.value])
|
|
703
703
|
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
704
704
|
d("div", ye, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
705
705
|
key: 0,
|
|
706
|
-
class: b(["truncate text-label-small",
|
|
707
|
-
}, 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", U.value])
|
|
707
|
+
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large", se.value]) }, M(e.title), 3), e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
708
708
|
key: 0,
|
|
709
|
-
class: b(["text-body-medium", [
|
|
709
|
+
class: b(["text-body-medium", [U.value, C.value === 2 && "truncate"]])
|
|
710
710
|
}, M(e.subtitle), 3)) : l("", !0)])]),
|
|
711
711
|
p(i, {
|
|
712
712
|
name: x.value ? "expand_less" : "expand_more",
|
|
713
713
|
size: 20,
|
|
714
|
-
class: b(["shrink-0",
|
|
714
|
+
class: b(["shrink-0", U.value])
|
|
715
715
|
}, null, 8, ["name", "class"])
|
|
716
716
|
], 42, ve), p(o, { name: "mli-expand" }, {
|
|
717
717
|
default: ne(() => [x.value ? (E(), u("div", {
|
|
@@ -720,7 +720,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
720
720
|
class: "mli-expand-grid"
|
|
721
721
|
}, [d("div", xe, [A(t.$slots, "children")])], 8, be)) : l("", !0)]),
|
|
722
722
|
_: 3
|
|
723
|
-
})], 16)) : (E(), c(
|
|
723
|
+
})], 16)) : (E(), c(G, { key: 1 }, {
|
|
724
724
|
default: ne(() => [(E(), c(ee(Me.value), v({
|
|
725
725
|
class: ue.value,
|
|
726
726
|
ref_key: "rootEl",
|
|
@@ -735,7 +735,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
735
735
|
"aria-disabled": (T.value || k.value) && e.disabled ? "true" : void 0,
|
|
736
736
|
onClick: Le,
|
|
737
737
|
onKeydown: R,
|
|
738
|
-
onPointerenter:
|
|
738
|
+
onPointerenter: ge,
|
|
739
739
|
onPointerleave: De,
|
|
740
740
|
onPointerdown: Oe,
|
|
741
741
|
onPointerup: ke,
|
|
@@ -744,18 +744,18 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
744
744
|
onBlur: je
|
|
745
745
|
}), {
|
|
746
746
|
default: ne(() => [
|
|
747
|
-
|
|
747
|
+
oe.value ? (E(), u("div", {
|
|
748
748
|
key: 0,
|
|
749
|
-
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", oe.value === "inset" ? "left-16" : "left-0"])
|
|
750
750
|
}, null, 2)) : l("", !0),
|
|
751
751
|
A(t.$slots, "leading", {}, () => [B.value === "icon" ? (E(), c(i, {
|
|
752
752
|
key: 0,
|
|
753
753
|
name: e.icon,
|
|
754
754
|
size: 24,
|
|
755
|
-
class: b(["shrink-0",
|
|
755
|
+
class: b(["shrink-0", U.value])
|
|
756
756
|
}, null, 8, ["name", "class"])) : B.value === "icon-container" ? (E(), u("div", {
|
|
757
757
|
key: 1,
|
|
758
|
-
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", ie[e.iconContainerColor || "primary"]])
|
|
759
759
|
}, [p(i, {
|
|
760
760
|
name: e.icon,
|
|
761
761
|
size: 24
|
|
@@ -769,38 +769,38 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
769
769
|
src: e.image,
|
|
770
770
|
alt: "",
|
|
771
771
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
772
|
-
}, null, 8, Se)) : B.value === "checkbox" ? (E(), c(
|
|
772
|
+
}, null, 8, Se)) : B.value === "checkbox" ? (E(), c(le, {
|
|
773
773
|
key: 4,
|
|
774
774
|
"model-value": z.value,
|
|
775
775
|
class: "shrink-0"
|
|
776
776
|
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
777
777
|
d("div", Ce, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
778
778
|
key: 0,
|
|
779
|
-
class: b(["truncate text-label-small",
|
|
779
|
+
class: b(["truncate text-label-small", U.value])
|
|
780
780
|
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [
|
|
781
|
-
d("p", { class: b(["truncate text-body-large",
|
|
781
|
+
d("p", { class: b(["truncate text-body-large", se.value]) }, M(e.title), 3),
|
|
782
782
|
e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
783
783
|
key: 0,
|
|
784
|
-
class: b(["text-body-medium", [
|
|
784
|
+
class: b(["text-body-medium", [U.value, C.value === 2 && "truncate"]])
|
|
785
785
|
}, M(e.subtitle), 3)) : l("", !0),
|
|
786
786
|
e.description && C.value >= 3 ? (E(), u("p", {
|
|
787
787
|
key: 1,
|
|
788
|
-
class: b(["line-clamp-2 text-body-small",
|
|
788
|
+
class: b(["line-clamp-2 text-body-small", U.value])
|
|
789
789
|
}, M(e.description), 3)) : l("", !0)
|
|
790
790
|
])]),
|
|
791
|
-
A(t.$slots, "trailing", {}, () => [
|
|
791
|
+
A(t.$slots, "trailing", {}, () => [re.value === "icon" ? (E(), c(i, {
|
|
792
792
|
key: 0,
|
|
793
793
|
name: e.trailingIcon,
|
|
794
794
|
size: 24,
|
|
795
|
-
class: b(["shrink-0",
|
|
796
|
-
}, null, 8, ["name", "class"])) :
|
|
795
|
+
class: b(["shrink-0", U.value])
|
|
796
|
+
}, null, 8, ["name", "class"])) : re.value === "text" ? (E(), u("span", {
|
|
797
797
|
key: 1,
|
|
798
|
-
class: b(["shrink-0 text-label-small",
|
|
799
|
-
}, M(e.trailingText), 3)) :
|
|
798
|
+
class: b(["shrink-0 text-label-small", U.value])
|
|
799
|
+
}, M(e.trailingText), 3)) : re.value === "switch" ? (E(), c(_e, {
|
|
800
800
|
key: 2,
|
|
801
801
|
"model-value": !!e.trailingValue,
|
|
802
802
|
"onUpdate:modelValue": Re
|
|
803
|
-
}, null, 8, ["model-value"])) :
|
|
803
|
+
}, null, 8, ["model-value"])) : re.value === "checkbox" ? (E(), c(le, {
|
|
804
804
|
key: 3,
|
|
805
805
|
"model-value": !!e.trailingValue,
|
|
806
806
|
"onUpdate:modelValue": Re
|
|
@@ -909,17 +909,23 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
909
909
|
let t = r.max - r.min;
|
|
910
910
|
return t === 0 ? 0 : (e - r.min) / t * 100;
|
|
911
911
|
}
|
|
912
|
-
let I =
|
|
912
|
+
let I = O(null), L = s(() => !r.stops && _.value !== !1 && I.value !== null ? I.value * 100 : null), R = s(() => {
|
|
913
|
+
let e = L.value;
|
|
914
|
+
return e !== null && (_.value === "single" || _.value === 0) ? N.value ? Math.min(e, F(P.value.hi)) : e : F(P.value.lo);
|
|
915
|
+
}), z = s(() => {
|
|
916
|
+
let e = L.value;
|
|
917
|
+
return e !== null && _.value === 1 ? Math.max(e, F(P.value.lo)) : F(P.value.hi);
|
|
918
|
+
}), B = s(() => F(0)), re = s(() => se.value < W.value.dotInset + W.value.dot / 2 ? !0 : r.variant === "centered" ? Math.min(R.value, B.value) <= 0 : r.variant !== "range" || R.value <= 0), ie = s(() => U.value < W.value.dotInset + W.value.dot / 2 ? !0 : r.variant === "centered" ? Math.max(R.value, B.value) >= 100 : r.variant === "range" ? z.value >= 100 : R.value >= 100), V = O(0), H, ae = () => {
|
|
913
919
|
let e = h.value;
|
|
914
920
|
e && (V.value = j.value ? e.offsetHeight : e.offsetWidth);
|
|
915
921
|
};
|
|
916
922
|
C(() => {
|
|
917
|
-
|
|
918
|
-
}), S(() =>
|
|
919
|
-
let
|
|
920
|
-
let t =
|
|
923
|
+
ae(), !(typeof ResizeObserver > "u" || !h.value) && (H = new ResizeObserver(ae), H.observe(h.value));
|
|
924
|
+
}), S(() => H?.disconnect());
|
|
925
|
+
let oe = (e) => {
|
|
926
|
+
let t = W.value.thumbInset;
|
|
921
927
|
return Math.min(Math.max(e / 100 * V.value, t), V.value - t);
|
|
922
|
-
},
|
|
928
|
+
}, se = s(() => V.value && (r.variant === "range" || r.variant === "centered" && R.value <= B.value) ? oe(R.value) - G.value : Infinity), U = s(() => V.value ? r.variant === "range" ? V.value - oe(z.value) - G.value : r.variant === "centered" && R.value < B.value ? Infinity : V.value - oe(R.value) - G.value : Infinity), ce = s(() => se.value <= Z.value), le = s(() => U.value <= Z.value), ue = {
|
|
923
929
|
xs: {
|
|
924
930
|
track: 16,
|
|
925
931
|
thumbW: 4,
|
|
@@ -985,184 +991,184 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
985
991
|
iconSize: 28,
|
|
986
992
|
thumbIconSize: 66
|
|
987
993
|
}
|
|
988
|
-
},
|
|
994
|
+
}, W = s(() => ue[r.size] ?? ue.xs), de = s(() => W.value.thumbInset + W.value.thumbW / 2 + W.value.iconSize / 2 + 3), G = s(() => r.thumbIcon ? Math.max(W.value.gap, W.value.thumbIconSize / 2 + 4) : W.value.gap), fe = {
|
|
989
995
|
primary: "var(--color-primary)",
|
|
990
996
|
secondary: "var(--color-secondary)",
|
|
991
997
|
tertiary: "var(--color-tertiary)",
|
|
992
998
|
error: "var(--color-error)"
|
|
993
999
|
};
|
|
994
|
-
function
|
|
1000
|
+
function pe(e, t) {
|
|
995
1001
|
let n = e ?? t;
|
|
996
|
-
return
|
|
1002
|
+
return fe[n] ?? n;
|
|
997
1003
|
}
|
|
998
|
-
let
|
|
1004
|
+
let K = s(() => r.disabled ? {
|
|
999
1005
|
active: Ne,
|
|
1000
1006
|
inactive: Pe
|
|
1001
1007
|
} : {
|
|
1002
|
-
active:
|
|
1008
|
+
active: pe(r.fillColor, r.color),
|
|
1003
1009
|
inactive: "var(--color-secondary-container)"
|
|
1004
|
-
}),
|
|
1010
|
+
}), q = s(() => r.disabled ? {
|
|
1005
1011
|
active: Ne,
|
|
1006
1012
|
inactive: Pe
|
|
1007
1013
|
} : {
|
|
1008
|
-
active:
|
|
1014
|
+
active: pe(r.thumbColor, r.color),
|
|
1009
1015
|
inactive: "var(--color-secondary-container)"
|
|
1010
1016
|
});
|
|
1011
|
-
function
|
|
1017
|
+
function J(e) {
|
|
1012
1018
|
let t = Math.round((e - r.min) / r.step) * r.step + r.min;
|
|
1013
1019
|
return Math.max(r.min, Math.min(r.max, +t.toFixed(10)));
|
|
1014
1020
|
}
|
|
1015
|
-
function
|
|
1021
|
+
function me(e) {
|
|
1016
1022
|
if (!h.value) return 0;
|
|
1017
1023
|
let t = h.value.getBoundingClientRect();
|
|
1018
1024
|
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));
|
|
1019
1025
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return
|
|
1026
|
+
function he(e) {
|
|
1027
|
+
return J(r.min + me(e) * (r.max - r.min));
|
|
1022
1028
|
}
|
|
1023
|
-
let
|
|
1024
|
-
function
|
|
1029
|
+
let Y = !1;
|
|
1030
|
+
function ge(e, t) {
|
|
1025
1031
|
let { lo: n, hi: r } = P.value;
|
|
1026
1032
|
return e === 0 ? [Math.min(t, r), r] : [n, Math.max(t, n)];
|
|
1027
1033
|
}
|
|
1028
|
-
function
|
|
1034
|
+
function _e(e) {
|
|
1029
1035
|
if (r.disabled) return;
|
|
1030
1036
|
e.preventDefault();
|
|
1031
|
-
let t =
|
|
1037
|
+
let t = he(e);
|
|
1032
1038
|
if (N.value) {
|
|
1033
1039
|
let { lo: e, hi: n } = P.value;
|
|
1034
|
-
|
|
1040
|
+
Y = !1;
|
|
1035
1041
|
let r;
|
|
1036
|
-
t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0,
|
|
1042
|
+
t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0, Y = !0) : r = Math.abs(t - e) <= Math.abs(t - n) ? 0 : 1, _.value = r, D(r), Y || f("update:modelValue", ge(r, t));
|
|
1037
1043
|
} else _.value = "single", f("update:modelValue", t);
|
|
1038
|
-
window.addEventListener("pointermove",
|
|
1044
|
+
I.value = Y ? null : me(e), window.addEventListener("pointermove", ve), window.addEventListener("pointerup", ye), window.addEventListener("pointercancel", ye);
|
|
1039
1045
|
}
|
|
1040
|
-
function
|
|
1046
|
+
function ve(e) {
|
|
1041
1047
|
if (_.value === !1) return;
|
|
1042
|
-
let t =
|
|
1048
|
+
let t = he(e);
|
|
1043
1049
|
if (N.value) {
|
|
1044
|
-
if (
|
|
1050
|
+
if (Y) {
|
|
1045
1051
|
if (t === P.value.lo) return;
|
|
1046
|
-
|
|
1052
|
+
Y = !1, _.value = +(t > P.value.lo), D(_.value);
|
|
1047
1053
|
}
|
|
1048
|
-
f("update:modelValue",
|
|
1049
|
-
} else f("update:modelValue", t);
|
|
1054
|
+
I.value = me(e), f("update:modelValue", ge(_.value, t));
|
|
1055
|
+
} else I.value = me(e), f("update:modelValue", t);
|
|
1050
1056
|
}
|
|
1051
|
-
function
|
|
1052
|
-
_.value = !1,
|
|
1057
|
+
function ye() {
|
|
1058
|
+
_.value = !1, I.value = null, Y = !1, window.removeEventListener("pointermove", ve), window.removeEventListener("pointerup", ye), window.removeEventListener("pointercancel", ye);
|
|
1053
1059
|
}
|
|
1054
|
-
let
|
|
1060
|
+
let be = {
|
|
1055
1061
|
ArrowRight: 1,
|
|
1056
1062
|
ArrowUp: 1,
|
|
1057
1063
|
ArrowLeft: -1,
|
|
1058
1064
|
ArrowDown: -1
|
|
1059
1065
|
};
|
|
1060
|
-
function
|
|
1066
|
+
function xe(e) {
|
|
1061
1067
|
if (r.disabled) return;
|
|
1062
|
-
let t =
|
|
1063
|
-
t !== void 0 && (e.preventDefault(), f("update:modelValue",
|
|
1068
|
+
let t = be[e.key];
|
|
1069
|
+
t !== void 0 && (e.preventDefault(), f("update:modelValue", J(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));
|
|
1064
1070
|
}
|
|
1065
|
-
function
|
|
1071
|
+
function Se(e, t) {
|
|
1066
1072
|
if (r.disabled) return;
|
|
1067
|
-
let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o =
|
|
1068
|
-
o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s =
|
|
1073
|
+
let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o = be[t.key], s;
|
|
1074
|
+
o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s = J(a + o * r.step), s !== void 0 && (t.preventDefault(), w.value = e, f("update:modelValue", ge(e, s)));
|
|
1069
1075
|
}
|
|
1070
1076
|
S(() => {
|
|
1071
|
-
window.removeEventListener("pointermove",
|
|
1077
|
+
window.removeEventListener("pointermove", ve), window.removeEventListener("pointerup", ye), window.removeEventListener("pointercancel", ye);
|
|
1072
1078
|
});
|
|
1073
|
-
let
|
|
1079
|
+
let Ce = s(() => {
|
|
1074
1080
|
if (!r.stops) return [];
|
|
1075
|
-
let e = [], t = r.max - r.min, n = r.icon ? (
|
|
1081
|
+
let e = [], t = r.max - r.min, n = r.icon ? (W.value.iconSize + W.value.radius) / 2 : 0;
|
|
1076
1082
|
for (let i = r.min + r.step; i < r.max; i += r.step) {
|
|
1077
1083
|
let a = (i - r.min) / t * 100;
|
|
1078
1084
|
r.icon && a < n || e.push(a);
|
|
1079
1085
|
}
|
|
1080
1086
|
return e.length <= 28 ? e : [];
|
|
1081
1087
|
});
|
|
1082
|
-
function
|
|
1083
|
-
return `calc(${$(e)} - ${
|
|
1084
|
-
}
|
|
1085
|
-
function Ce(e) {
|
|
1086
|
-
return H.value ? "0px" : `calc(100% - ${$(e)} - ${W.value}px)`;
|
|
1088
|
+
function we(e) {
|
|
1089
|
+
return `calc(${$(e)} - ${G.value}px)`;
|
|
1087
1090
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1090
|
-
}
|
|
1091
|
-
function Te() {
|
|
1092
|
-
return `calc(${$(I.value)} + ${W.value}px)`;
|
|
1091
|
+
function Te(e) {
|
|
1092
|
+
return le.value ? "0px" : `calc(100% - ${$(e)} - ${G.value}px)`;
|
|
1093
1093
|
}
|
|
1094
1094
|
function Ee() {
|
|
1095
|
-
return
|
|
1095
|
+
return ce.value ? "0px" : `calc(${$(R.value)} - ${G.value}px)`;
|
|
1096
1096
|
}
|
|
1097
1097
|
function De() {
|
|
1098
|
-
return
|
|
1098
|
+
return `calc(${$(R.value)} + ${G.value}px)`;
|
|
1099
1099
|
}
|
|
1100
1100
|
function Fe() {
|
|
1101
|
-
return
|
|
1101
|
+
return `calc(${$(z.value)} - ${$(R.value)} - ${G.value * 2}px)`;
|
|
1102
1102
|
}
|
|
1103
1103
|
function Ie() {
|
|
1104
|
-
return
|
|
1104
|
+
return le.value ? "0px" : `calc(100% - ${$(z.value)} - ${G.value}px)`;
|
|
1105
1105
|
}
|
|
1106
1106
|
function Le() {
|
|
1107
|
-
return
|
|
1107
|
+
return R.value >= B.value ? `${B.value}%` : `calc(${$(R.value)} + ${G.value}px)`;
|
|
1108
1108
|
}
|
|
1109
1109
|
function Re() {
|
|
1110
|
-
return
|
|
1110
|
+
return R.value >= B.value ? `calc(${$(R.value)} - ${B.value}% - ${G.value}px)` : `calc(${B.value}% - ${$(R.value)} - ${G.value}px)`;
|
|
1111
|
+
}
|
|
1112
|
+
function ze() {
|
|
1113
|
+
return le.value ? "0px" : R.value >= B.value ? `calc(100% - ${$(R.value)} - ${G.value}px)` : `calc(100% - ${B.value}% - ${G.value}px)`;
|
|
1111
1114
|
}
|
|
1112
|
-
let ze = s(() => U.value.radius), X = s(() => Math.max(2, ze.value / 4)), Z = s(() => ze.value * 1.3);
|
|
1113
1115
|
function Be() {
|
|
1116
|
+
return ce.value ? "0px" : R.value <= B.value ? `calc(${$(R.value)} - ${G.value}px)` : `calc(${B.value}% - ${G.value}px)`;
|
|
1117
|
+
}
|
|
1118
|
+
let Ve = s(() => W.value.radius), X = s(() => Math.max(2, Ve.value / 4)), Z = s(() => Ve.value * 1.3);
|
|
1119
|
+
function He() {
|
|
1114
1120
|
return `${X.value}px`;
|
|
1115
1121
|
}
|
|
1116
|
-
function
|
|
1122
|
+
function Ue() {
|
|
1117
1123
|
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`;
|
|
1118
1124
|
}
|
|
1119
|
-
function
|
|
1125
|
+
function We() {
|
|
1120
1126
|
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`;
|
|
1121
1127
|
}
|
|
1122
|
-
let
|
|
1128
|
+
let Ge = s(() => _.value === !1), Q = s(() => Ge.value ? "75ms ease" : "0s");
|
|
1123
1129
|
function $(e) {
|
|
1124
|
-
let t =
|
|
1130
|
+
let t = W.value.thumbInset;
|
|
1125
1131
|
return `clamp(${t}px, ${e}%, calc(100% - ${t}px))`;
|
|
1126
1132
|
}
|
|
1127
|
-
function
|
|
1128
|
-
let n = j.value ?
|
|
1133
|
+
function Ke(e, t = 0) {
|
|
1134
|
+
let n = j.value ? W.value.thumbH : W.value.thumbW, r = j.value ? W.value.thumbW : W.value.thumbH, i = Math.min(n, r) / 2, a = _.value !== !1, o = {
|
|
1129
1135
|
position: "absolute",
|
|
1130
1136
|
width: `${n}px`,
|
|
1131
1137
|
height: `${r}px`,
|
|
1132
1138
|
borderRadius: `${i}px`,
|
|
1133
|
-
backgroundColor:
|
|
1134
|
-
"--tw-ring-color":
|
|
1139
|
+
backgroundColor: q.value.active,
|
|
1140
|
+
"--tw-ring-color": q.value.active,
|
|
1135
1141
|
zIndex: "2",
|
|
1136
|
-
transition:
|
|
1142
|
+
transition: Ge.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1137
1143
|
}, s = N.value ? _.value === t || y.value === t : a || v.value, c = (N.value ? _.value === t : a) ? 1.08 : 1, l = s ? .5 : 1;
|
|
1138
1144
|
return j.value ? (o.left = "50%", o.bottom = $(e), o.transform = `translateX(-50%) translateY(50%) scaleX(${c}) scaleY(${l})`) : (o.left = $(e), o.top = "50%", o.transform = `translateX(-50%) translateY(-50%) scaleY(${c}) scaleX(${l})`), o;
|
|
1139
1145
|
}
|
|
1140
|
-
function
|
|
1146
|
+
function qe(e) {
|
|
1141
1147
|
let t = _.value === !1 ? 1 : 1.15, n = {
|
|
1142
1148
|
position: "absolute",
|
|
1143
|
-
color:
|
|
1144
|
-
"--tw-ring-color":
|
|
1149
|
+
color: q.value.active,
|
|
1150
|
+
"--tw-ring-color": q.value.active,
|
|
1145
1151
|
zIndex: "2",
|
|
1146
|
-
transition:
|
|
1152
|
+
transition: Ge.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1147
1153
|
};
|
|
1148
1154
|
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;
|
|
1149
1155
|
}
|
|
1150
|
-
function
|
|
1151
|
-
let t =
|
|
1156
|
+
function Je(e) {
|
|
1157
|
+
let t = W.value.track / 2 + 36, n = W.value.track / 2 + 40;
|
|
1152
1158
|
return j.value ? {
|
|
1153
1159
|
left: `calc(50% - ${n}px)`,
|
|
1154
1160
|
bottom: $(e),
|
|
1155
1161
|
transform: "translateY(50%)",
|
|
1156
|
-
transition:
|
|
1162
|
+
transition: Ge.value ? "bottom " + Q.value : "none"
|
|
1157
1163
|
} : {
|
|
1158
1164
|
left: $(e),
|
|
1159
1165
|
top: `calc(50% - ${t}px)`,
|
|
1160
1166
|
transform: "translateX(-50%)",
|
|
1161
|
-
transition:
|
|
1167
|
+
transition: Ge.value ? "left " + Q.value : "none"
|
|
1162
1168
|
};
|
|
1163
1169
|
}
|
|
1164
|
-
let
|
|
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(
|
|
1170
|
+
let Ye = s(() => N.value ? `${P.value.lo} – ${P.value.hi}` : String(r.modelValue)), Xe = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? P.value.lo : P.value.hi : r.modelValue), Ze = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? R.value : z.value : R.value);
|
|
1171
|
+
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(Ye.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: b(["flex items-center", j.value ? "flex-1 flex-col" : ""]) }, [d("div", {
|
|
1166
1172
|
ref_key: "trackEl",
|
|
1167
1173
|
ref: h,
|
|
1168
1174
|
role: N.value ? "group" : "slider",
|
|
@@ -1175,15 +1181,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1175
1181
|
"aria-orientation": N.value ? void 0 : t.orientation,
|
|
1176
1182
|
class: b(["group relative touch-none cursor-pointer outline-none", t.disabled && "cursor-not-allowed"]),
|
|
1177
1183
|
style: x(j.value ? {
|
|
1178
|
-
width: `${
|
|
1184
|
+
width: `${W.value.hitArea}px`,
|
|
1179
1185
|
minHeight: "160px",
|
|
1180
1186
|
height: "100%"
|
|
1181
1187
|
} : {
|
|
1182
|
-
height: `${
|
|
1188
|
+
height: `${W.value.hitArea}px`,
|
|
1183
1189
|
width: "100%"
|
|
1184
1190
|
}),
|
|
1185
|
-
onPointerdown:
|
|
1186
|
-
onKeydown: n[0] ||= (e) => !N.value &&
|
|
1191
|
+
onPointerdown: _e,
|
|
1192
|
+
onKeydown: n[0] ||= (e) => !N.value && xe(e),
|
|
1187
1193
|
onFocus: n[1] ||= (e) => v.value = !N.value,
|
|
1188
1194
|
onBlur: n[2] ||= (e) => v.value = !1
|
|
1189
1195
|
}, [
|
|
@@ -1193,14 +1199,14 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1193
1199
|
left: "50%",
|
|
1194
1200
|
top: "0",
|
|
1195
1201
|
bottom: "0",
|
|
1196
|
-
width: `${
|
|
1202
|
+
width: `${W.value.track}px`,
|
|
1197
1203
|
transform: "translateX(-50%)",
|
|
1198
1204
|
borderRadius: `${Z.value}px`
|
|
1199
1205
|
} : {
|
|
1200
1206
|
top: "50%",
|
|
1201
1207
|
left: "0",
|
|
1202
1208
|
right: "0",
|
|
1203
|
-
height: `${
|
|
1209
|
+
height: `${W.value.track}px`,
|
|
1204
1210
|
transform: "translateY(-50%)",
|
|
1205
1211
|
borderRadius: `${Z.value}px`
|
|
1206
1212
|
})
|
|
@@ -1212,15 +1218,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1212
1218
|
left: 0,
|
|
1213
1219
|
right: 0,
|
|
1214
1220
|
bottom: 0,
|
|
1215
|
-
height:
|
|
1221
|
+
height: we(R.value)
|
|
1216
1222
|
} : {
|
|
1217
1223
|
top: 0,
|
|
1218
1224
|
bottom: 0,
|
|
1219
1225
|
left: 0,
|
|
1220
|
-
width:
|
|
1226
|
+
width: we(R.value)
|
|
1221
1227
|
},
|
|
1222
|
-
borderRadius:
|
|
1223
|
-
backgroundColor:
|
|
1228
|
+
borderRadius: Ue(),
|
|
1229
|
+
backgroundColor: K.value.active,
|
|
1224
1230
|
transition: `all ${Q.value}`
|
|
1225
1231
|
})
|
|
1226
1232
|
}, null, 4), d("div", {
|
|
@@ -1230,15 +1236,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1230
1236
|
left: 0,
|
|
1231
1237
|
right: 0,
|
|
1232
1238
|
top: 0,
|
|
1233
|
-
height:
|
|
1239
|
+
height: Te(R.value)
|
|
1234
1240
|
} : {
|
|
1235
1241
|
top: 0,
|
|
1236
1242
|
bottom: 0,
|
|
1237
1243
|
right: 0,
|
|
1238
|
-
width:
|
|
1244
|
+
width: Te(R.value)
|
|
1239
1245
|
},
|
|
1240
|
-
borderRadius:
|
|
1241
|
-
backgroundColor:
|
|
1246
|
+
borderRadius: We(),
|
|
1247
|
+
backgroundColor: K.value.inactive,
|
|
1242
1248
|
transition: `all ${Q.value}`
|
|
1243
1249
|
})
|
|
1244
1250
|
}, null, 4)], 64)) : t.variant === "centered" ? (E(), u(a, { key: 1 }, [
|
|
@@ -1248,16 +1254,16 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1248
1254
|
...j.value ? {
|
|
1249
1255
|
left: 0,
|
|
1250
1256
|
right: 0,
|
|
1251
|
-
bottom:
|
|
1252
|
-
height:
|
|
1257
|
+
bottom: Le(),
|
|
1258
|
+
height: Re()
|
|
1253
1259
|
} : {
|
|
1254
1260
|
top: 0,
|
|
1255
1261
|
bottom: 0,
|
|
1256
|
-
left:
|
|
1257
|
-
width:
|
|
1262
|
+
left: Le(),
|
|
1263
|
+
width: Re()
|
|
1258
1264
|
},
|
|
1259
|
-
borderRadius:
|
|
1260
|
-
backgroundColor:
|
|
1265
|
+
borderRadius: He(),
|
|
1266
|
+
backgroundColor: K.value.active,
|
|
1261
1267
|
transition: `all ${Q.value}`
|
|
1262
1268
|
})
|
|
1263
1269
|
}, null, 4),
|
|
@@ -1268,15 +1274,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1268
1274
|
left: 0,
|
|
1269
1275
|
right: 0,
|
|
1270
1276
|
top: 0,
|
|
1271
|
-
height:
|
|
1277
|
+
height: ze()
|
|
1272
1278
|
} : {
|
|
1273
1279
|
top: 0,
|
|
1274
1280
|
bottom: 0,
|
|
1275
1281
|
right: 0,
|
|
1276
|
-
width:
|
|
1282
|
+
width: ze()
|
|
1277
1283
|
},
|
|
1278
|
-
borderRadius:
|
|
1279
|
-
backgroundColor:
|
|
1284
|
+
borderRadius: We(),
|
|
1285
|
+
backgroundColor: K.value.inactive,
|
|
1280
1286
|
transition: `all ${Q.value}`
|
|
1281
1287
|
})
|
|
1282
1288
|
}, null, 4),
|
|
@@ -1287,15 +1293,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1287
1293
|
left: 0,
|
|
1288
1294
|
right: 0,
|
|
1289
1295
|
bottom: 0,
|
|
1290
|
-
height:
|
|
1296
|
+
height: Be()
|
|
1291
1297
|
} : {
|
|
1292
1298
|
top: 0,
|
|
1293
1299
|
bottom: 0,
|
|
1294
1300
|
left: 0,
|
|
1295
|
-
width:
|
|
1301
|
+
width: Be()
|
|
1296
1302
|
},
|
|
1297
|
-
borderRadius:
|
|
1298
|
-
backgroundColor:
|
|
1303
|
+
borderRadius: Ue(),
|
|
1304
|
+
backgroundColor: K.value.inactive,
|
|
1299
1305
|
transition: `all ${Q.value}`
|
|
1300
1306
|
})
|
|
1301
1307
|
}, null, 4)
|
|
@@ -1307,15 +1313,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1307
1313
|
left: 0,
|
|
1308
1314
|
right: 0,
|
|
1309
1315
|
bottom: 0,
|
|
1310
|
-
height:
|
|
1316
|
+
height: Ee()
|
|
1311
1317
|
} : {
|
|
1312
1318
|
top: 0,
|
|
1313
1319
|
bottom: 0,
|
|
1314
1320
|
left: 0,
|
|
1315
|
-
width:
|
|
1321
|
+
width: Ee()
|
|
1316
1322
|
},
|
|
1317
|
-
borderRadius:
|
|
1318
|
-
backgroundColor:
|
|
1323
|
+
borderRadius: Ue(),
|
|
1324
|
+
backgroundColor: K.value.inactive,
|
|
1319
1325
|
transition: `all ${Q.value}`
|
|
1320
1326
|
})
|
|
1321
1327
|
}, null, 4),
|
|
@@ -1325,16 +1331,16 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1325
1331
|
...j.value ? {
|
|
1326
1332
|
left: 0,
|
|
1327
1333
|
right: 0,
|
|
1328
|
-
bottom:
|
|
1329
|
-
height:
|
|
1334
|
+
bottom: De(),
|
|
1335
|
+
height: Fe()
|
|
1330
1336
|
} : {
|
|
1331
1337
|
top: 0,
|
|
1332
1338
|
bottom: 0,
|
|
1333
|
-
left:
|
|
1334
|
-
width:
|
|
1339
|
+
left: De(),
|
|
1340
|
+
width: Fe()
|
|
1335
1341
|
},
|
|
1336
|
-
borderRadius:
|
|
1337
|
-
backgroundColor:
|
|
1342
|
+
borderRadius: He(),
|
|
1343
|
+
backgroundColor: K.value.active,
|
|
1338
1344
|
transition: `all ${Q.value}`
|
|
1339
1345
|
})
|
|
1340
1346
|
}, null, 4),
|
|
@@ -1345,15 +1351,15 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1345
1351
|
left: 0,
|
|
1346
1352
|
right: 0,
|
|
1347
1353
|
top: 0,
|
|
1348
|
-
height:
|
|
1354
|
+
height: Ie()
|
|
1349
1355
|
} : {
|
|
1350
1356
|
top: 0,
|
|
1351
1357
|
bottom: 0,
|
|
1352
1358
|
right: 0,
|
|
1353
|
-
width:
|
|
1359
|
+
width: Ie()
|
|
1354
1360
|
},
|
|
1355
|
-
borderRadius:
|
|
1356
|
-
backgroundColor:
|
|
1361
|
+
borderRadius: We(),
|
|
1362
|
+
backgroundColor: K.value.inactive,
|
|
1357
1363
|
transition: `all ${Q.value}`
|
|
1358
1364
|
})
|
|
1359
1365
|
}, null, 4)
|
|
@@ -1361,17 +1367,17 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1361
1367
|
t.icon ? (E(), c(i, {
|
|
1362
1368
|
key: 3,
|
|
1363
1369
|
name: t.icon,
|
|
1364
|
-
size:
|
|
1370
|
+
size: W.value.iconSize,
|
|
1365
1371
|
class: "absolute z-[1]",
|
|
1366
1372
|
style: x({
|
|
1367
|
-
color: t.variant === "standard" &&
|
|
1373
|
+
color: t.variant === "standard" && R.value > 0 || t.variant === "range" && R.value > 0 ? K.value.inactive : K.value.active,
|
|
1368
1374
|
...j.value ? {
|
|
1369
1375
|
left: "50%",
|
|
1370
|
-
bottom: `${
|
|
1376
|
+
bottom: `${de.value}px`,
|
|
1371
1377
|
transform: "translateX(-50%)"
|
|
1372
1378
|
} : {
|
|
1373
1379
|
top: "50%",
|
|
1374
|
-
left: `${
|
|
1380
|
+
left: `${de.value}px`,
|
|
1375
1381
|
transform: "translateY(-50%)"
|
|
1376
1382
|
},
|
|
1377
1383
|
transition: "color 150ms ease"
|
|
@@ -1384,17 +1390,17 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1384
1390
|
key: 4,
|
|
1385
1391
|
class: "absolute rounded-full",
|
|
1386
1392
|
style: x({
|
|
1387
|
-
width: `${
|
|
1388
|
-
height: `${
|
|
1389
|
-
backgroundColor:
|
|
1390
|
-
opacity: +!
|
|
1393
|
+
width: `${W.value.dot}px`,
|
|
1394
|
+
height: `${W.value.dot}px`,
|
|
1395
|
+
backgroundColor: K.value.active,
|
|
1396
|
+
opacity: +!re.value,
|
|
1391
1397
|
...j.value ? {
|
|
1392
1398
|
left: "50%",
|
|
1393
|
-
bottom: `${
|
|
1399
|
+
bottom: `${W.value.dotInset}px`,
|
|
1394
1400
|
transform: "translateX(-50%)"
|
|
1395
1401
|
} : {
|
|
1396
1402
|
top: "50%",
|
|
1397
|
-
left: `${
|
|
1403
|
+
left: `${W.value.dotInset}px`,
|
|
1398
1404
|
transform: "translateY(-50%)"
|
|
1399
1405
|
},
|
|
1400
1406
|
transition: "opacity 150ms ease"
|
|
@@ -1404,30 +1410,30 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1404
1410
|
key: 5,
|
|
1405
1411
|
class: "absolute rounded-full",
|
|
1406
1412
|
style: x({
|
|
1407
|
-
width: `${
|
|
1408
|
-
height: `${
|
|
1409
|
-
backgroundColor:
|
|
1410
|
-
opacity: +!
|
|
1413
|
+
width: `${W.value.dot}px`,
|
|
1414
|
+
height: `${W.value.dot}px`,
|
|
1415
|
+
backgroundColor: K.value.active,
|
|
1416
|
+
opacity: +!ie.value,
|
|
1411
1417
|
...j.value ? {
|
|
1412
1418
|
left: "50%",
|
|
1413
|
-
top: `${
|
|
1419
|
+
top: `${W.value.dotInset}px`,
|
|
1414
1420
|
transform: "translateX(-50%)"
|
|
1415
1421
|
} : {
|
|
1416
1422
|
top: "50%",
|
|
1417
|
-
right: `${
|
|
1423
|
+
right: `${W.value.dotInset}px`,
|
|
1418
1424
|
transform: "translateY(-50%)"
|
|
1419
1425
|
},
|
|
1420
1426
|
transition: "opacity 150ms ease"
|
|
1421
1427
|
})
|
|
1422
1428
|
}, null, 4)),
|
|
1423
|
-
t.stops ? (E(!0), u(a, { key: 6 }, k(
|
|
1429
|
+
t.stops ? (E(!0), u(a, { key: 6 }, k(Ce.value, (e, t) => (E(), u("div", {
|
|
1424
1430
|
key: t,
|
|
1425
1431
|
class: "absolute rounded-full",
|
|
1426
1432
|
style: x({
|
|
1427
|
-
width: `${
|
|
1428
|
-
height: `${
|
|
1429
|
-
backgroundColor: e <=
|
|
1430
|
-
opacity: Math.abs(e -
|
|
1433
|
+
width: `${W.value.dot}px`,
|
|
1434
|
+
height: `${W.value.dot}px`,
|
|
1435
|
+
backgroundColor: e <= R.value ? K.value.inactive : K.value.active,
|
|
1436
|
+
opacity: Math.abs(e - R.value) < .01 || N.value && Math.abs(e - z.value) < .01 ? 0 : 1,
|
|
1431
1437
|
...j.value ? {
|
|
1432
1438
|
left: "50%",
|
|
1433
1439
|
bottom: `${e}%`,
|
|
@@ -1455,20 +1461,20 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1455
1461
|
"aria-disabled": t.disabled || void 0,
|
|
1456
1462
|
"aria-orientation": t.orientation,
|
|
1457
1463
|
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"]),
|
|
1458
|
-
style: x(t.thumbIcon ?
|
|
1459
|
-
onKeydown: (t) =>
|
|
1464
|
+
style: x(t.thumbIcon ? qe(e === 0 ? R.value : z.value) : Ke(e === 0 ? R.value : z.value, e)),
|
|
1465
|
+
onKeydown: (t) => Se(e, t),
|
|
1460
1466
|
onFocus: (t) => A(e),
|
|
1461
1467
|
onBlur: ee
|
|
1462
1468
|
}, [t.thumbIcon ? (E(), c(i, {
|
|
1463
1469
|
key: 0,
|
|
1464
1470
|
name: t.thumbIcon,
|
|
1465
|
-
size:
|
|
1471
|
+
size: W.value.thumbIconSize
|
|
1466
1472
|
}, null, 8, ["name", "size"])) : l("", !0)], 46, Me)), 64)) : (E(), u(a, { key: 0 }, [t.thumbIcon ? (E(), c(i, {
|
|
1467
1473
|
key: 0,
|
|
1468
1474
|
name: t.thumbIcon,
|
|
1469
|
-
size:
|
|
1475
|
+
size: W.value.thumbIconSize,
|
|
1470
1476
|
class: "pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1471
|
-
style: x(
|
|
1477
|
+
style: x(qe(R.value))
|
|
1472
1478
|
}, null, 8, [
|
|
1473
1479
|
"name",
|
|
1474
1480
|
"size",
|
|
@@ -1476,7 +1482,7 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1476
1482
|
])) : (E(), u("div", {
|
|
1477
1483
|
key: 1,
|
|
1478
1484
|
class: "pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1479
|
-
style: x(
|
|
1485
|
+
style: x(Ke(R.value))
|
|
1480
1486
|
}, null, 4))], 64)),
|
|
1481
1487
|
p(o, {
|
|
1482
1488
|
"enter-active-class": "transition-opacity duration-100",
|
|
@@ -1487,14 +1493,14 @@ var pe = ["role"], me = /* @__PURE__ */ m({
|
|
|
1487
1493
|
default: ne(() => [t.showTooltip && _.value !== !1 ? (E(), u("div", {
|
|
1488
1494
|
key: 0,
|
|
1489
1495
|
class: "pointer-events-none absolute z-10 flex h-7 min-w-7 items-center justify-center rounded-full bg-inverse-surface px-2 text-label-small tabular-nums text-inverse-on-surface",
|
|
1490
|
-
style: x(
|
|
1491
|
-
}, M(
|
|
1496
|
+
style: x(Je(Ze.value))
|
|
1497
|
+
}, M(Xe.value), 5)) : l("", !0)]),
|
|
1492
1498
|
_: 1
|
|
1493
1499
|
})
|
|
1494
1500
|
], 46, je)], 2)], 2));
|
|
1495
1501
|
}
|
|
1496
1502
|
});
|
|
1497
1503
|
//#endregion
|
|
1498
|
-
export {
|
|
1504
|
+
export { K as a, oe as c, J as i, L as l, De as n, pe as o, _e as r, le as s, Fe as t };
|
|
1499
1505
|
|
|
1500
|
-
//# sourceMappingURL=MSlider-
|
|
1506
|
+
//# sourceMappingURL=MSlider-Dx_S3vJ9.js.map
|