@m3ui-vue/m3ui-vue 1.0.2 → 1.0.3
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 +599 -9
- package/dist/MMenuItem-DFyXflk9.js +707 -0
- package/dist/MMenuItem-DFyXflk9.js.map +1 -0
- package/dist/MSlider-CdNIH7jc.js +1376 -0
- package/dist/MSlider-CdNIH7jc.js.map +1 -0
- package/dist/MTextField-B4X92vH_.js +671 -0
- package/dist/MTextField-B4X92vH_.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MMap.vue.d.ts +74 -0
- package/dist/components/MMapBaseLayers.vue.d.ts +15 -0
- package/dist/components/MMapControl.vue.d.ts +23 -0
- package/dist/components/MMapFeatureInfo.vue.d.ts +25 -0
- package/dist/components/MMapFilter.vue.d.ts +19 -0
- package/dist/components/MMapGeoJson.vue.d.ts +34 -0
- package/dist/components/MMapHover.vue.d.ts +17 -0
- package/dist/components/MMapIdentify.vue.d.ts +37 -0
- package/dist/components/MMapLayers.vue.d.ts +31 -0
- package/dist/components/MMapMarker.vue.d.ts +42 -0
- package/dist/components/MMapMeasure.vue.d.ts +43 -0
- package/dist/components/MMapPopup.vue.d.ts +43 -0
- package/dist/components/MMapSearch.vue.d.ts +28 -0
- package/dist/components/_MMapLayerItem.vue.d.ts +25 -0
- package/dist/composables/_mapGeometry.d.ts +13 -0
- package/dist/composables/_ssrState.d.ts +30 -0
- package/dist/composables/_storageKeys.d.ts +3 -0
- package/dist/composables/_useThemeTokens.d.ts +7 -0
- package/dist/composables/mapAdapters.d.ts +111 -0
- package/dist/composables/mapSearch.d.ts +31 -0
- package/dist/composables/themeInitScript.d.ts +4 -3
- package/dist/composables/useColorPalette.d.ts +173 -7
- package/dist/composables/useLocale.d.ts +30 -0
- package/dist/composables/useMap.d.ts +47 -0
- package/dist/composables/useMapFilter.d.ts +10 -0
- package/dist/composables/useMapLayers.d.ts +30 -0
- package/dist/composables/useTheme.d.ts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/locales/index.js +217 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +6709 -7976
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +24 -0
- package/dist/map.js +1931 -0
- package/dist/map.js.map +1 -0
- package/dist/plugin.d.ts +18 -2
- package/dist/rich-text-editor.js +27 -26
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-CuvWRZ1h.js → useLocale-b5-hzsL3.js} +32 -2
- package/dist/useLocale-b5-hzsL3.js.map +1 -0
- package/package.json +11 -2
- package/src/__tests__/MFab.test.ts +52 -6
- package/src/__tests__/MMap.test.ts +292 -0
- package/src/__tests__/MMapLayers.test.ts +257 -0
- package/src/__tests__/MMapTools.test.ts +233 -0
- package/src/__tests__/_fakeMaplibre.ts +158 -0
- package/src/__tests__/hydration.test.ts +33 -0
- package/src/__tests__/ssr.test.ts +63 -1
- package/src/__tests__/ssrState.test.ts +155 -0
- package/src/__tests__/themeInitScript.test.ts +18 -0
- package/src/components/MFab.vue +29 -7
- package/src/components/MIconButton.vue +1 -1
- package/src/components/MLightbox.vue +6 -2
- package/src/components/MMap.vue +522 -0
- package/src/components/MMapBaseLayers.vue +67 -0
- package/src/components/MMapControl.vue +61 -0
- package/src/components/MMapFeatureInfo.vue +41 -0
- package/src/components/MMapFilter.vue +80 -0
- package/src/components/MMapGeoJson.vue +136 -0
- package/src/components/MMapHover.vue +131 -0
- package/src/components/MMapIdentify.vue +103 -0
- package/src/components/MMapLayers.vue +111 -0
- package/src/components/MMapMarker.vue +102 -0
- package/src/components/MMapMeasure.vue +452 -0
- package/src/components/MMapPopup.vue +99 -0
- package/src/components/MMapSearch.vue +162 -0
- package/src/components/_MMapLayerItem.vue +77 -0
- package/src/composables/_mapGeometry.ts +75 -0
- package/src/composables/_ssrState.ts +80 -0
- package/src/composables/_storageKeys.ts +6 -0
- package/src/composables/_useThemeTokens.ts +42 -0
- package/src/composables/mapAdapters.ts +208 -0
- package/src/composables/mapSearch.ts +56 -0
- package/src/composables/themeInitScript.ts +6 -4
- package/src/composables/useColorPalette.ts +23 -9
- package/src/composables/useLocale.ts +62 -0
- package/src/composables/useMap.ts +98 -0
- package/src/composables/useMapFilter.ts +45 -0
- package/src/composables/useMapLayers.ts +124 -0
- package/src/composables/useTheme.ts +8 -3
- package/src/composables/useWindowSizeClass.ts +14 -5
- package/src/index.ts +2 -1
- package/src/locales/de.ts +31 -1
- package/src/locales/es.ts +31 -1
- package/src/locales/fr.ts +31 -1
- package/src/locales/ja.ts +31 -1
- package/src/locales/ko.ts +31 -1
- package/src/locales/pt.ts +31 -1
- package/src/locales/zh.ts +31 -1
- package/src/map.ts +32 -0
- package/src/plugin.ts +54 -3
- package/dist/MTextField-BPbFeI9M.js +0 -1368
- package/dist/MTextField-BPbFeI9M.js.map +0 -1
- package/dist/useLocale-CuvWRZ1h.js.map +0 -1
|
@@ -0,0 +1,1376 @@
|
|
|
1
|
+
import { i as e } from "./useLocale-b5-hzsL3.js";
|
|
2
|
+
import { a as t, c as n, o as r } from "./MTextField-B4X92vH_.js";
|
|
3
|
+
import { t as i } from "./MIcon-DLOkQduI.js";
|
|
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
|
+
//#region src/composables/_storageKeys.ts
|
|
6
|
+
var N = "m3-theme", re = "m3-dynamic-palette", P = "m3-viewport", F = /* @__PURE__ */ m({
|
|
7
|
+
__name: "MAvatar",
|
|
8
|
+
props: {
|
|
9
|
+
name: {},
|
|
10
|
+
fallback: {},
|
|
11
|
+
size: { default: 40 }
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
let t = e, n = s(() => {
|
|
15
|
+
if (t.name) {
|
|
16
|
+
let e = t.name.trim().split(/\s+/).filter(Boolean);
|
|
17
|
+
return ((e[0]?.[0] ?? "") + (e.length > 1 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase() || t.fallback || "?";
|
|
18
|
+
}
|
|
19
|
+
return t.fallback || "?";
|
|
20
|
+
});
|
|
21
|
+
return (t, r) => (S(), u("div", {
|
|
22
|
+
class: "inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
23
|
+
style: v({
|
|
24
|
+
width: `${e.size}px`,
|
|
25
|
+
height: `${e.size}px`,
|
|
26
|
+
fontSize: `${Math.round(e.size * .4)}px`
|
|
27
|
+
})
|
|
28
|
+
}, k(n.value), 5));
|
|
29
|
+
}
|
|
30
|
+
}), I = [
|
|
31
|
+
"role",
|
|
32
|
+
"tabindex",
|
|
33
|
+
"aria-disabled"
|
|
34
|
+
], L = ["src", "alt"], R = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "px-4 pt-4 pb-2"
|
|
37
|
+
}, z = {
|
|
38
|
+
key: 2,
|
|
39
|
+
class: "px-4 pt-4 pb-2"
|
|
40
|
+
}, ie = { class: "text-title-large font-medium text-on-surface" }, B = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
43
|
+
}, V = {
|
|
44
|
+
key: 3,
|
|
45
|
+
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
46
|
+
}, H = "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]", ae = /* @__PURE__ */ m({
|
|
47
|
+
__name: "MCard",
|
|
48
|
+
props: {
|
|
49
|
+
variant: { default: "elevated" },
|
|
50
|
+
clickable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
elevated: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
image: {},
|
|
63
|
+
imageAlt: {},
|
|
64
|
+
imageHeight: {},
|
|
65
|
+
title: {},
|
|
66
|
+
subtitle: {}
|
|
67
|
+
},
|
|
68
|
+
setup(e) {
|
|
69
|
+
let t = e, n = s(() => t.elevated ? "elevated" : t.variant), r = {
|
|
70
|
+
elevated: "var(--color-surface-container-low)",
|
|
71
|
+
filled: "var(--color-surface-container-highest)",
|
|
72
|
+
outlined: "var(--color-surface)"
|
|
73
|
+
}, i = s(() => (t.disabled ? {
|
|
74
|
+
elevated: "bg-surface/38 shadow-none",
|
|
75
|
+
filled: "bg-surface-variant/38",
|
|
76
|
+
outlined: "bg-surface border border-outline/12"
|
|
77
|
+
} : {
|
|
78
|
+
elevated: "bg-surface-container-low shadow-elevation-1",
|
|
79
|
+
filled: "bg-surface-container-highest",
|
|
80
|
+
outlined: "bg-surface border border-outline-variant"
|
|
81
|
+
})[n.value]), a = {
|
|
82
|
+
elevated: "hover:shadow-elevation-2 active:shadow-elevation-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
83
|
+
filled: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
84
|
+
outlined: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:border-on-surface"
|
|
85
|
+
}, o = s(() => t.clickable && !t.disabled);
|
|
86
|
+
function c(e) {
|
|
87
|
+
o.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
88
|
+
}
|
|
89
|
+
return (t, s) => (S(), u("div", {
|
|
90
|
+
class: _(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
91
|
+
i.value,
|
|
92
|
+
o.value ? [
|
|
93
|
+
"cursor-pointer",
|
|
94
|
+
a[n.value],
|
|
95
|
+
H
|
|
96
|
+
] : "",
|
|
97
|
+
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
98
|
+
]]),
|
|
99
|
+
style: v({ "--field-bg": r[n.value] }),
|
|
100
|
+
role: e.clickable ? "button" : void 0,
|
|
101
|
+
tabindex: o.value ? 0 : void 0,
|
|
102
|
+
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
103
|
+
onKeydown: c
|
|
104
|
+
}, [
|
|
105
|
+
e.image || t.$slots.media ? (S(), u("div", {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: _(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
108
|
+
}, [e.image ? (S(), u("img", {
|
|
109
|
+
key: 0,
|
|
110
|
+
src: e.image,
|
|
111
|
+
alt: e.imageAlt ?? "",
|
|
112
|
+
class: "h-full w-full object-cover"
|
|
113
|
+
}, null, 8, L)) : E(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : l("", !0),
|
|
114
|
+
t.$slots.header ? (S(), u("div", R, [E(t.$slots, "header")])) : e.title ? (S(), u("div", z, [d("h3", ie, k(e.title), 1), e.subtitle ? (S(), u("p", B, k(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
115
|
+
E(t.$slots, "default"),
|
|
116
|
+
t.$slots.actions ? (S(), u("div", V, [E(t.$slots, "actions")])) : l("", !0)
|
|
117
|
+
], 46, I));
|
|
118
|
+
}
|
|
119
|
+
}), oe = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, se = [
|
|
120
|
+
"checked",
|
|
121
|
+
"disabled",
|
|
122
|
+
"aria-label"
|
|
123
|
+
], ce = {
|
|
124
|
+
key: 1,
|
|
125
|
+
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
126
|
+
}, U = /* @__PURE__ */ m({
|
|
127
|
+
__name: "MCheckbox",
|
|
128
|
+
props: {
|
|
129
|
+
modelValue: { type: Boolean },
|
|
130
|
+
indeterminate: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: !1
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: !1
|
|
137
|
+
},
|
|
138
|
+
label: {},
|
|
139
|
+
color: { default: "primary" },
|
|
140
|
+
ariaLabel: {}
|
|
141
|
+
},
|
|
142
|
+
emits: ["update:modelValue"],
|
|
143
|
+
setup(e, { emit: t }) {
|
|
144
|
+
let n = t, r = {
|
|
145
|
+
primary: "border-primary bg-primary text-on-primary",
|
|
146
|
+
secondary: "border-secondary bg-secondary text-on-secondary",
|
|
147
|
+
tertiary: "border-tertiary bg-tertiary text-on-tertiary",
|
|
148
|
+
error: "border-error bg-error text-on-error"
|
|
149
|
+
}, a = {
|
|
150
|
+
primary: "bg-primary",
|
|
151
|
+
secondary: "bg-secondary",
|
|
152
|
+
tertiary: "bg-tertiary",
|
|
153
|
+
error: "bg-error"
|
|
154
|
+
};
|
|
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", oe, [
|
|
156
|
+
d("input", {
|
|
157
|
+
type: "checkbox",
|
|
158
|
+
class: "peer sr-only",
|
|
159
|
+
checked: e.modelValue,
|
|
160
|
+
disabled: e.disabled,
|
|
161
|
+
"aria-label": e.ariaLabel,
|
|
162
|
+
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
163
|
+
}, null, 40, se),
|
|
164
|
+
e.disabled ? l("", !0) : (S(), u("span", {
|
|
165
|
+
key: 0,
|
|
166
|
+
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
|
+
}, null, 2)),
|
|
168
|
+
e.disabled ? l("", !0) : (S(), u("span", ce)),
|
|
169
|
+
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
|
+
name: e.indeterminate ? "remove" : "check",
|
|
171
|
+
size: 18,
|
|
172
|
+
class: _(["transition-[opacity,transform] duration-150", e.modelValue || e.indeterminate ? "scale-100 opacity-100" : "scale-0 opacity-0"])
|
|
173
|
+
}, null, 8, ["name", "class"])], 2)
|
|
174
|
+
]), e.label || t.$slots.default ? (S(), u("span", {
|
|
175
|
+
key: 0,
|
|
176
|
+
class: _(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
177
|
+
}, [E(t.$slots, "default", {}, () => [f(k(e.label), 1)])], 2)) : l("", !0)], 2));
|
|
178
|
+
}
|
|
179
|
+
}), W = ["disabled", "aria-pressed"], G = { class: "whitespace-nowrap" }, K = ["aria-label", "disabled"], q = ["aria-label", "disabled"], le = "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", ue = /* @__PURE__ */ m({
|
|
180
|
+
__name: "MChip",
|
|
181
|
+
props: {
|
|
182
|
+
tone: { default: "neutral" },
|
|
183
|
+
selected: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: !1
|
|
186
|
+
},
|
|
187
|
+
removable: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: !1
|
|
190
|
+
},
|
|
191
|
+
clickable: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: !1
|
|
194
|
+
},
|
|
195
|
+
disabled: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: !1
|
|
198
|
+
},
|
|
199
|
+
icon: {},
|
|
200
|
+
type: {},
|
|
201
|
+
elevated: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: !1
|
|
204
|
+
},
|
|
205
|
+
trailingIcon: {}
|
|
206
|
+
},
|
|
207
|
+
emits: [
|
|
208
|
+
"click",
|
|
209
|
+
"remove",
|
|
210
|
+
"update:selected"
|
|
211
|
+
],
|
|
212
|
+
setup(a, { emit: o }) {
|
|
213
|
+
let f = [
|
|
214
|
+
"neutral",
|
|
215
|
+
"primary",
|
|
216
|
+
"success",
|
|
217
|
+
"error",
|
|
218
|
+
"tertiary",
|
|
219
|
+
"secondary"
|
|
220
|
+
], m = a, h = o, g = e(), y = A(), b = s(() => !!m.tone && !f.includes(m.tone)), x = s(() => {
|
|
221
|
+
if (b.value) return {
|
|
222
|
+
"--chip-bg": m.tone + "22",
|
|
223
|
+
"--chip-color": m.tone
|
|
224
|
+
};
|
|
225
|
+
}), C = s(() => {
|
|
226
|
+
if (m.disabled) return m.tone === "neutral" && !m.selected && !b.value ? "border border-on-surface/10 bg-transparent text-on-surface/38" : "border border-transparent bg-on-surface/12 text-on-surface/38";
|
|
227
|
+
if (b.value) return "border border-transparent bg-[var(--chip-bg)] text-[var(--chip-color)]";
|
|
228
|
+
if (m.tone === "neutral" && !m.selected) return "border border-outline-variant bg-transparent text-on-surface-variant";
|
|
229
|
+
let e = {
|
|
230
|
+
neutral: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
231
|
+
primary: "border border-transparent bg-primary-container text-on-primary-container",
|
|
232
|
+
secondary: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
233
|
+
success: "border border-transparent bg-success-container text-on-success-container",
|
|
234
|
+
error: "border border-transparent bg-error-container text-on-error-container",
|
|
235
|
+
tertiary: "border border-transparent bg-tertiary-container text-on-tertiary-container"
|
|
236
|
+
};
|
|
237
|
+
return e[m.tone ?? "neutral"] ?? e.neutral;
|
|
238
|
+
}), T = s(() => m.selected ? "rounded-full" : "rounded-md"), O = s(() => m.type === "filter" || m.type === "input"), k = s(() => m.type === "input" && !!y.avatar), te = s(() => !!m.trailingIcon || m.type === "input" && m.removable), j = s(() => {
|
|
239
|
+
let e = O.value && m.selected;
|
|
240
|
+
if (m.disabled) return e || m.elevated && m.type !== "input" ? "bg-on-surface/12 text-on-surface/38" : "border border-on-surface/12 text-on-surface/38";
|
|
241
|
+
if (e) return ["bg-secondary-container text-on-secondary-container", m.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
242
|
+
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
243
|
+
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"), re = s(() => m.type === "input" ? [k.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", te.value ? "pr-2" : "pr-3"] : [m.icon || L.value ? "pl-2" : "pl-4", te.value ? "pr-2" : "pr-4"]), P = w(!1), F = w(), I = w(), L = s(() => m.type === "filter" && !m.icon);
|
|
245
|
+
n(() => m.type === "filter" || m.type === "input" ? [P.value ? 8 : m.selected ? 16 : 12, L.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
246
|
+
F.value && e !== void 0 && (F.value.style.borderRadius = `${e}px`), I.value && t !== void 0 && (I.value.style.width = `${t}px`);
|
|
247
|
+
}, r), n(() => L.value ? [+!!m.selected] : [], ([e]) => {
|
|
248
|
+
I.value && e !== void 0 && (I.value.style.opacity = String(e));
|
|
249
|
+
}, t);
|
|
250
|
+
function R() {
|
|
251
|
+
m.disabled || (O.value && h("update:selected", !m.selected), h("click"));
|
|
252
|
+
}
|
|
253
|
+
return (e, t) => a.type ? (S(), u("span", {
|
|
254
|
+
key: 0,
|
|
255
|
+
ref_key: "typedEl",
|
|
256
|
+
ref: F,
|
|
257
|
+
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
|
+
}, [d("button", {
|
|
259
|
+
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", [re.value, a.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"]]),
|
|
261
|
+
disabled: a.disabled,
|
|
262
|
+
"aria-pressed": O.value ? a.selected : void 0,
|
|
263
|
+
onPointerdown: t[0] ||= (e) => P.value = !0,
|
|
264
|
+
onPointerup: t[1] ||= (e) => P.value = !1,
|
|
265
|
+
onPointerleave: t[2] ||= (e) => P.value = !1,
|
|
266
|
+
onPointercancel: t[3] ||= (e) => P.value = !1,
|
|
267
|
+
onClick: R
|
|
268
|
+
}, [
|
|
269
|
+
k.value ? (S(), u("span", {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: _(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", a.disabled ? "opacity-38" : ""])
|
|
272
|
+
}, [E(e.$slots, "avatar")], 2)) : a.icon ? (S(), c(i, {
|
|
273
|
+
key: 1,
|
|
274
|
+
name: a.icon,
|
|
275
|
+
size: 18,
|
|
276
|
+
filled: a.type === "filter" && a.selected,
|
|
277
|
+
class: _(["shrink-0", N.value])
|
|
278
|
+
}, null, 8, [
|
|
279
|
+
"name",
|
|
280
|
+
"filled",
|
|
281
|
+
"class"
|
|
282
|
+
])) : L.value ? (S(), u("span", {
|
|
283
|
+
key: 2,
|
|
284
|
+
ref_key: "checkEl",
|
|
285
|
+
ref: I,
|
|
286
|
+
class: "-mr-2 flex shrink-0 overflow-hidden",
|
|
287
|
+
style: {
|
|
288
|
+
width: "8px",
|
|
289
|
+
opacity: "0"
|
|
290
|
+
},
|
|
291
|
+
"aria-hidden": "true"
|
|
292
|
+
}, [p(i, {
|
|
293
|
+
name: "check",
|
|
294
|
+
size: 18,
|
|
295
|
+
class: _(["shrink-0", N.value])
|
|
296
|
+
}, null, 8, ["class"])], 512)) : l("", !0),
|
|
297
|
+
d("span", G, [E(e.$slots, "default")]),
|
|
298
|
+
a.trailingIcon ? (S(), c(i, {
|
|
299
|
+
key: 3,
|
|
300
|
+
name: a.trailingIcon,
|
|
301
|
+
size: 18,
|
|
302
|
+
class: _(["shrink-0", a.disabled ? "" : a.selected && O.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
303
|
+
}, null, 8, ["name", "class"])) : l("", !0)
|
|
304
|
+
], 42, W), a.type === "input" && a.removable ? (S(), u("button", {
|
|
305
|
+
key: 0,
|
|
306
|
+
type: "button",
|
|
307
|
+
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"]),
|
|
308
|
+
"aria-label": ee(g).remove,
|
|
309
|
+
disabled: a.disabled,
|
|
310
|
+
onClick: t[4] ||= M((e) => h("remove"), ["stop"])
|
|
311
|
+
}, [p(i, {
|
|
312
|
+
name: "close",
|
|
313
|
+
size: 18
|
|
314
|
+
})], 10, K)) : l("", !0)], 2)) : (S(), c(D(a.clickable ? "button" : "span"), {
|
|
315
|
+
key: 1,
|
|
316
|
+
type: a.clickable ? "button" : void 0,
|
|
317
|
+
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
318
|
+
class: _(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
319
|
+
T.value,
|
|
320
|
+
C.value,
|
|
321
|
+
a.clickable && !a.disabled ? le : "",
|
|
322
|
+
a.disabled ? "cursor-not-allowed" : ""
|
|
323
|
+
]]),
|
|
324
|
+
style: v(x.value),
|
|
325
|
+
onClick: t[6] ||= (e) => a.clickable && !a.disabled && h("click")
|
|
326
|
+
}, {
|
|
327
|
+
default: ne(() => [
|
|
328
|
+
a.icon ? (S(), c(i, {
|
|
329
|
+
key: 0,
|
|
330
|
+
name: a.icon,
|
|
331
|
+
size: 18
|
|
332
|
+
}, null, 8, ["name"])) : l("", !0),
|
|
333
|
+
E(e.$slots, "default"),
|
|
334
|
+
a.removable ? (S(), u("button", {
|
|
335
|
+
key: 1,
|
|
336
|
+
type: "button",
|
|
337
|
+
class: "-mr-1 ml-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12",
|
|
338
|
+
"aria-label": ee(g).remove,
|
|
339
|
+
disabled: a.disabled,
|
|
340
|
+
onClick: t[5] ||= M((e) => h("remove"), ["stop"])
|
|
341
|
+
}, [p(i, {
|
|
342
|
+
name: "close",
|
|
343
|
+
size: 16
|
|
344
|
+
})], 8, q)) : l("", !0)
|
|
345
|
+
]),
|
|
346
|
+
_: 3
|
|
347
|
+
}, 8, [
|
|
348
|
+
"type",
|
|
349
|
+
"disabled",
|
|
350
|
+
"class",
|
|
351
|
+
"style"
|
|
352
|
+
]));
|
|
353
|
+
}
|
|
354
|
+
}), de = /* @__PURE__ */ m({
|
|
355
|
+
__name: "MList",
|
|
356
|
+
props: {
|
|
357
|
+
dense: {
|
|
358
|
+
type: Boolean,
|
|
359
|
+
default: !1
|
|
360
|
+
},
|
|
361
|
+
dividers: {
|
|
362
|
+
type: [Boolean, String],
|
|
363
|
+
default: !1
|
|
364
|
+
},
|
|
365
|
+
nav: {
|
|
366
|
+
type: Boolean,
|
|
367
|
+
default: !1
|
|
368
|
+
},
|
|
369
|
+
segmented: {
|
|
370
|
+
type: Boolean,
|
|
371
|
+
default: !1
|
|
372
|
+
},
|
|
373
|
+
selectable: {
|
|
374
|
+
type: Boolean,
|
|
375
|
+
default: !1
|
|
376
|
+
},
|
|
377
|
+
selected: {},
|
|
378
|
+
lines: {}
|
|
379
|
+
},
|
|
380
|
+
emits: ["update:selected"],
|
|
381
|
+
setup(e, { emit: t }) {
|
|
382
|
+
let n = e, r = t, i = w(), a = O(/* @__PURE__ */ new Map());
|
|
383
|
+
function o() {
|
|
384
|
+
let e = /* @__PURE__ */ new Map(), t = [], n = () => {
|
|
385
|
+
t.forEach((n, r) => e.set(n, t.length === 1 ? "single" : r === 0 ? "first" : r === t.length - 1 ? "last" : "middle")), t = [];
|
|
386
|
+
};
|
|
387
|
+
for (let e of i.value?.children ?? []) e.getAttribute("role") === "listitem" ? t.push(e) : n();
|
|
388
|
+
n(), a.value = e;
|
|
389
|
+
}
|
|
390
|
+
let c;
|
|
391
|
+
b(() => {
|
|
392
|
+
o(), i.value && (c = new MutationObserver(o), c.observe(i.value, { childList: !0 }));
|
|
393
|
+
}), x(() => c?.disconnect()), C("m-list", {
|
|
394
|
+
segmentPosition: (e) => e ? a.value.get(e) : void 0,
|
|
395
|
+
dense: s(() => n.dense),
|
|
396
|
+
nav: s(() => n.nav),
|
|
397
|
+
segmented: s(() => n.segmented),
|
|
398
|
+
selectable: s(() => n.selectable),
|
|
399
|
+
selected: s(() => n.selected),
|
|
400
|
+
dividers: s(() => n.dividers),
|
|
401
|
+
lines: s(() => n.lines),
|
|
402
|
+
select: (e) => r("update:selected", e)
|
|
403
|
+
});
|
|
404
|
+
let l = s(() => [
|
|
405
|
+
"flex flex-col",
|
|
406
|
+
n.segmented ? "gap-0.5 p-2" : "py-2",
|
|
407
|
+
n.nav && !n.segmented && "gap-0.5 px-3"
|
|
408
|
+
]);
|
|
409
|
+
return (e, t) => (S(), u("ul", {
|
|
410
|
+
ref_key: "listEl",
|
|
411
|
+
ref: i,
|
|
412
|
+
role: "list",
|
|
413
|
+
class: _(l.value)
|
|
414
|
+
}, [E(e.$slots, "default")], 2));
|
|
415
|
+
}
|
|
416
|
+
}), J = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, Y = ["checked", "disabled"], fe = {
|
|
417
|
+
key: 0,
|
|
418
|
+
class: "text-body-large text-on-surface"
|
|
419
|
+
}, X = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", pe = /* @__PURE__ */ m({
|
|
420
|
+
__name: "MSwitch",
|
|
421
|
+
props: {
|
|
422
|
+
modelValue: { type: Boolean },
|
|
423
|
+
disabled: {
|
|
424
|
+
type: Boolean,
|
|
425
|
+
default: !1
|
|
426
|
+
},
|
|
427
|
+
label: {},
|
|
428
|
+
color: { default: "primary" },
|
|
429
|
+
icon: {
|
|
430
|
+
type: Boolean,
|
|
431
|
+
default: !0
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
emits: ["update:modelValue"],
|
|
435
|
+
setup(e, { emit: t }) {
|
|
436
|
+
let n = e, r = t, a = {
|
|
437
|
+
primary: "border-primary bg-primary",
|
|
438
|
+
secondary: "border-secondary bg-secondary",
|
|
439
|
+
tertiary: "border-tertiary bg-tertiary",
|
|
440
|
+
error: "border-error bg-error"
|
|
441
|
+
}, f = {
|
|
442
|
+
primary: "bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container",
|
|
443
|
+
secondary: "bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container",
|
|
444
|
+
tertiary: "bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container",
|
|
445
|
+
error: "bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container"
|
|
446
|
+
}, m = {
|
|
447
|
+
primary: "text-on-primary-container",
|
|
448
|
+
secondary: "text-on-secondary-container",
|
|
449
|
+
tertiary: "text-on-tertiary-container",
|
|
450
|
+
error: "text-on-error-container"
|
|
451
|
+
}, h = {
|
|
452
|
+
primary: "bg-primary",
|
|
453
|
+
secondary: "bg-secondary",
|
|
454
|
+
tertiary: "bg-tertiary",
|
|
455
|
+
error: "bg-error"
|
|
456
|
+
}, g = w(!1);
|
|
457
|
+
function y() {
|
|
458
|
+
n.disabled || (g.value = !0);
|
|
459
|
+
}
|
|
460
|
+
function b() {
|
|
461
|
+
g.value = !1;
|
|
462
|
+
}
|
|
463
|
+
let x = s(() => g.value ? 28 / 24 : n.modelValue ? 1 : 16 / 24), C = s(() => ({
|
|
464
|
+
transform: `translateY(-50%) translateX(${n.modelValue ? 18 : 0}px) scale(${x.value})`,
|
|
465
|
+
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 280ms ease" : "transform 240ms cubic-bezier(0.2, 0, 0, 1), background-color 240ms ease"
|
|
466
|
+
})), T = s(() => ({
|
|
467
|
+
transform: `translateX(${n.modelValue ? 18 : 0}px)`,
|
|
468
|
+
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)"
|
|
469
|
+
}));
|
|
470
|
+
return (t, n) => (S(), u("label", {
|
|
471
|
+
class: _(["group inline-flex items-center gap-3 select-none", e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer"]),
|
|
472
|
+
onPointerdown: y,
|
|
473
|
+
onPointerup: b,
|
|
474
|
+
onPointerleave: b,
|
|
475
|
+
onPointercancel: b
|
|
476
|
+
}, [d("span", J, [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
|
+
d("input", {
|
|
478
|
+
type: "checkbox",
|
|
479
|
+
class: "peer sr-only",
|
|
480
|
+
checked: e.modelValue,
|
|
481
|
+
disabled: e.disabled,
|
|
482
|
+
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
483
|
+
}, null, 40, Y),
|
|
484
|
+
e.disabled ? l("", !0) : (S(), u("span", {
|
|
485
|
+
key: 0,
|
|
486
|
+
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"]),
|
|
487
|
+
style: v(T.value)
|
|
488
|
+
}, null, 6)),
|
|
489
|
+
e.disabled ? l("", !0) : (S(), u("span", {
|
|
490
|
+
key: 1,
|
|
491
|
+
class: "pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2",
|
|
492
|
+
style: v(T.value)
|
|
493
|
+
}, null, 4)),
|
|
494
|
+
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"] : X]),
|
|
496
|
+
style: v(C.value)
|
|
497
|
+
}, [p(o, {
|
|
498
|
+
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
499
|
+
"enter-from-class": "opacity-0",
|
|
500
|
+
"enter-to-class": "opacity-100",
|
|
501
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
502
|
+
"leave-from-class": "opacity-100",
|
|
503
|
+
"leave-to-class": "opacity-0"
|
|
504
|
+
}, {
|
|
505
|
+
default: ne(() => [e.modelValue && e.icon ? (S(), c(i, {
|
|
506
|
+
key: 0,
|
|
507
|
+
name: "check",
|
|
508
|
+
size: 14,
|
|
509
|
+
class: _(m[e.color])
|
|
510
|
+
}, null, 8, ["class"])) : l("", !0)]),
|
|
511
|
+
_: 1
|
|
512
|
+
})], 6)
|
|
513
|
+
], 2)]), e.label ? (S(), u("span", fe, k(e.label), 1)) : l("", !0)], 34));
|
|
514
|
+
}
|
|
515
|
+
}), Z = { class: "min-w-0 flex-1" }, Q = {
|
|
516
|
+
key: 0,
|
|
517
|
+
class: "mli-expand-grid"
|
|
518
|
+
}, $ = { class: "mli-expand-body" }, me = ["src"], he = { class: "min-w-0 flex-1" }, ge = 4, _e = 8, ve = 16, ye = /* @__PURE__ */ m({
|
|
519
|
+
__name: "MListItem",
|
|
520
|
+
props: {
|
|
521
|
+
title: {},
|
|
522
|
+
overline: {},
|
|
523
|
+
subtitle: {},
|
|
524
|
+
description: {},
|
|
525
|
+
lines: {},
|
|
526
|
+
icon: {},
|
|
527
|
+
leading: {},
|
|
528
|
+
avatarName: {},
|
|
529
|
+
image: {},
|
|
530
|
+
iconContainerColor: {},
|
|
531
|
+
trailingIcon: {},
|
|
532
|
+
trailingText: {},
|
|
533
|
+
trailing: {},
|
|
534
|
+
trailingValue: { type: Boolean },
|
|
535
|
+
value: {},
|
|
536
|
+
active: {
|
|
537
|
+
type: Boolean,
|
|
538
|
+
default: !1
|
|
539
|
+
},
|
|
540
|
+
disabled: {
|
|
541
|
+
type: Boolean,
|
|
542
|
+
default: !1
|
|
543
|
+
},
|
|
544
|
+
clickable: { type: Boolean },
|
|
545
|
+
href: {},
|
|
546
|
+
to: {},
|
|
547
|
+
expandable: {
|
|
548
|
+
type: Boolean,
|
|
549
|
+
default: !1
|
|
550
|
+
},
|
|
551
|
+
expanded: { type: Boolean }
|
|
552
|
+
},
|
|
553
|
+
emits: [
|
|
554
|
+
"click",
|
|
555
|
+
"update:trailingValue",
|
|
556
|
+
"update:expanded"
|
|
557
|
+
],
|
|
558
|
+
setup(e, { emit: t }) {
|
|
559
|
+
let r = e, a = t, f = te(), m = w(r.expanded ?? !1);
|
|
560
|
+
j(() => r.expanded, (e) => {
|
|
561
|
+
e !== void 0 && (m.value = e);
|
|
562
|
+
});
|
|
563
|
+
let v = s(() => m.value), y = h("m-list", null), b = s(() => r.lines ? r.lines : y?.lines.value ? y.lines.value : r.description || r.overline && r.subtitle ? 3 : r.subtitle || r.overline ? 2 : 1), x = s(() => r.clickable || r.href || r.to || !!f.onClick || y?.selectable.value || r.expandable), C = s(() => r.active ? !0 : y?.selectable.value && r.value != null ? y.selected.value === r.value : !1), T = s(() => r.leading ? r.leading : r.icon ? "icon" : r.avatarName ? "avatar" : r.image ? "image" : null), O = s(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), ee = {
|
|
564
|
+
primary: "bg-primary-container text-on-primary-container",
|
|
565
|
+
secondary: "bg-secondary-container text-on-secondary-container",
|
|
566
|
+
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
567
|
+
error: "bg-error-container text-on-error-container",
|
|
568
|
+
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), re = s(() => y?.dividers.value ?? !1), P = s(() => C.value ? "text-on-secondary-container" : "text-on-surface"), I = s(() => C.value ? "text-on-secondary-container" : "text-on-surface-variant"), L = s(() => A.value ? "" : b.value === 3 ? "min-h-22" : b.value === 2 ? "min-h-18" : "min-h-14"), R = s(() => [
|
|
570
|
+
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
571
|
+
N.value ? "bg-surface-container px-4" : M.value ? "rounded-full px-4" : "px-4",
|
|
572
|
+
A.value ? "py-1" : b.value === 3 ? "py-3" : "py-2",
|
|
573
|
+
L.value,
|
|
574
|
+
x.value && !r.disabled && "cursor-pointer transition-colors duration-150 hover:bg-on-surface/8 active:bg-on-surface/12",
|
|
575
|
+
C.value && "bg-secondary-container text-on-secondary-container",
|
|
576
|
+
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
577
|
+
]), z = w(null), ie = w(null), B = (e) => e && "$el" in e ? e.$el : e, V = w(!1), H = w(!1), ae = w(!1), oe = s(() => N.value ? y?.segmentPosition(B(z.value)) : void 0), se = s(() => {
|
|
578
|
+
if (M.value) return [];
|
|
579
|
+
let e = x.value && !r.disabled, t = e && H.value || C.value || e && ae.value ? ve : e && V.value ? _e : null;
|
|
580
|
+
if (t !== null) return [
|
|
581
|
+
t,
|
|
582
|
+
t,
|
|
583
|
+
t,
|
|
584
|
+
t
|
|
585
|
+
];
|
|
586
|
+
let n = oe.value, i = n === "first" || n === "single" ? ve : ge, a = n === "last" || n === "single" ? ve : ge;
|
|
587
|
+
return [
|
|
588
|
+
i,
|
|
589
|
+
i,
|
|
590
|
+
a,
|
|
591
|
+
a
|
|
592
|
+
];
|
|
593
|
+
}), { snap: ce } = n(() => se.value, (e) => {
|
|
594
|
+
let t = ie.value ?? B(z.value);
|
|
595
|
+
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
596
|
+
});
|
|
597
|
+
j([oe, M], () => ce());
|
|
598
|
+
function W(e) {
|
|
599
|
+
e.pointerType !== "touch" && (V.value = !0);
|
|
600
|
+
}
|
|
601
|
+
function G() {
|
|
602
|
+
V.value = !1, H.value = !1;
|
|
603
|
+
}
|
|
604
|
+
function K(e) {
|
|
605
|
+
e.button === 0 && (H.value = !0);
|
|
606
|
+
}
|
|
607
|
+
function q() {
|
|
608
|
+
H.value = !1;
|
|
609
|
+
}
|
|
610
|
+
function le(e) {
|
|
611
|
+
ae.value = e.currentTarget.matches(":focus-visible");
|
|
612
|
+
}
|
|
613
|
+
function ue() {
|
|
614
|
+
ae.value = !1;
|
|
615
|
+
}
|
|
616
|
+
let de = 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
|
+
function Y(e) {
|
|
618
|
+
r.disabled || (m.value = !m.value, a("update:expanded", m.value), a("click", e));
|
|
619
|
+
}
|
|
620
|
+
function fe(e) {
|
|
621
|
+
if (!r.disabled) {
|
|
622
|
+
if (r.expandable) {
|
|
623
|
+
Y(e);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
y?.selectable.value && r.value != null && y.select(r.value), a("click", e);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function X() {
|
|
630
|
+
a("update:trailingValue", !r.trailingValue);
|
|
631
|
+
}
|
|
632
|
+
return (t, n) => e.expandable ? (S(), u("li", {
|
|
633
|
+
key: 0,
|
|
634
|
+
ref_key: "rootEl",
|
|
635
|
+
ref: z,
|
|
636
|
+
role: "listitem"
|
|
637
|
+
}, [d("div", {
|
|
638
|
+
ref_key: "shapeEl",
|
|
639
|
+
ref: ie,
|
|
640
|
+
class: _(R.value),
|
|
641
|
+
onClick: fe,
|
|
642
|
+
onPointerenter: W,
|
|
643
|
+
onPointerleave: G,
|
|
644
|
+
onPointerdown: K,
|
|
645
|
+
onPointerup: q,
|
|
646
|
+
onPointercancel: q
|
|
647
|
+
}, [
|
|
648
|
+
E(t.$slots, "leading", {}, () => [T.value === "icon" ? (S(), c(i, {
|
|
649
|
+
key: 0,
|
|
650
|
+
name: e.icon,
|
|
651
|
+
size: 24,
|
|
652
|
+
class: _(["shrink-0", I.value])
|
|
653
|
+
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
654
|
+
d("div", Z, [E(t.$slots, "overline", {}, () => [e.overline ? (S(), u("p", {
|
|
655
|
+
key: 0,
|
|
656
|
+
class: _(["truncate text-label-small", I.value])
|
|
657
|
+
}, k(e.overline), 3)) : l("", !0)]), E(t.$slots, "default", {}, () => [d("p", { class: _(["truncate text-body-large", P.value]) }, k(e.title), 3), e.subtitle && b.value >= 2 ? (S(), u("p", {
|
|
658
|
+
key: 0,
|
|
659
|
+
class: _(["text-body-medium", [I.value, b.value === 2 && "truncate"]])
|
|
660
|
+
}, k(e.subtitle), 3)) : l("", !0)])]),
|
|
661
|
+
p(i, {
|
|
662
|
+
name: v.value ? "expand_less" : "expand_more",
|
|
663
|
+
size: 20,
|
|
664
|
+
class: _(["shrink-0", I.value])
|
|
665
|
+
}, null, 8, ["name", "class"])
|
|
666
|
+
], 34), p(o, { name: "mli-expand" }, {
|
|
667
|
+
default: ne(() => [v.value ? (S(), u("div", Q, [d("div", $, [E(t.$slots, "children")])])) : l("", !0)]),
|
|
668
|
+
_: 3
|
|
669
|
+
})], 512)) : (S(), c(D(de.value), g({
|
|
670
|
+
key: 1,
|
|
671
|
+
class: R.value,
|
|
672
|
+
ref_key: "rootEl",
|
|
673
|
+
ref: z
|
|
674
|
+
}, J.value, {
|
|
675
|
+
role: "listitem",
|
|
676
|
+
onClick: fe,
|
|
677
|
+
onPointerenter: W,
|
|
678
|
+
onPointerleave: G,
|
|
679
|
+
onPointerdown: K,
|
|
680
|
+
onPointerup: q,
|
|
681
|
+
onPointercancel: q,
|
|
682
|
+
onFocus: le,
|
|
683
|
+
onBlur: ue
|
|
684
|
+
}), {
|
|
685
|
+
default: ne(() => [
|
|
686
|
+
re.value ? (S(), u("div", {
|
|
687
|
+
key: 0,
|
|
688
|
+
class: _(["absolute top-0 right-0 h-px bg-outline-variant", re.value === "inset" ? "left-16" : "left-0"])
|
|
689
|
+
}, null, 2)) : l("", !0),
|
|
690
|
+
E(t.$slots, "leading", {}, () => [T.value === "icon" ? (S(), c(i, {
|
|
691
|
+
key: 0,
|
|
692
|
+
name: e.icon,
|
|
693
|
+
size: 24,
|
|
694
|
+
class: _(["shrink-0", I.value])
|
|
695
|
+
}, null, 8, ["name", "class"])) : T.value === "icon-container" ? (S(), u("div", {
|
|
696
|
+
key: 1,
|
|
697
|
+
class: _(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ee[e.iconContainerColor || "primary"]])
|
|
698
|
+
}, [p(i, {
|
|
699
|
+
name: e.icon,
|
|
700
|
+
size: 24
|
|
701
|
+
}, null, 8, ["name"])], 2)) : T.value === "avatar" ? (S(), c(F, {
|
|
702
|
+
key: 2,
|
|
703
|
+
name: e.avatarName,
|
|
704
|
+
size: 40,
|
|
705
|
+
class: "shrink-0"
|
|
706
|
+
}, null, 8, ["name"])) : T.value === "image" ? (S(), u("img", {
|
|
707
|
+
key: 3,
|
|
708
|
+
src: e.image,
|
|
709
|
+
alt: "",
|
|
710
|
+
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
711
|
+
}, null, 8, me)) : T.value === "checkbox" ? (S(), c(U, {
|
|
712
|
+
key: 4,
|
|
713
|
+
"model-value": C.value,
|
|
714
|
+
class: "shrink-0"
|
|
715
|
+
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
716
|
+
d("div", he, [E(t.$slots, "overline", {}, () => [e.overline ? (S(), u("p", {
|
|
717
|
+
key: 0,
|
|
718
|
+
class: _(["truncate text-label-small", I.value])
|
|
719
|
+
}, k(e.overline), 3)) : l("", !0)]), E(t.$slots, "default", {}, () => [
|
|
720
|
+
d("p", { class: _(["truncate text-body-large", P.value]) }, k(e.title), 3),
|
|
721
|
+
e.subtitle && b.value >= 2 ? (S(), u("p", {
|
|
722
|
+
key: 0,
|
|
723
|
+
class: _(["text-body-medium", [I.value, b.value === 2 && "truncate"]])
|
|
724
|
+
}, k(e.subtitle), 3)) : l("", !0),
|
|
725
|
+
e.description && b.value >= 3 ? (S(), u("p", {
|
|
726
|
+
key: 1,
|
|
727
|
+
class: _(["line-clamp-2 text-body-small", I.value])
|
|
728
|
+
}, k(e.description), 3)) : l("", !0)
|
|
729
|
+
])]),
|
|
730
|
+
E(t.$slots, "trailing", {}, () => [O.value === "icon" ? (S(), c(i, {
|
|
731
|
+
key: 0,
|
|
732
|
+
name: e.trailingIcon,
|
|
733
|
+
size: 24,
|
|
734
|
+
class: _(["shrink-0", I.value])
|
|
735
|
+
}, null, 8, ["name", "class"])) : O.value === "text" ? (S(), u("span", {
|
|
736
|
+
key: 1,
|
|
737
|
+
class: _(["shrink-0 text-label-small", I.value])
|
|
738
|
+
}, k(e.trailingText), 3)) : O.value === "switch" ? (S(), c(pe, {
|
|
739
|
+
key: 2,
|
|
740
|
+
"model-value": !!e.trailingValue,
|
|
741
|
+
"onUpdate:modelValue": X
|
|
742
|
+
}, null, 8, ["model-value"])) : O.value === "checkbox" ? (S(), c(U, {
|
|
743
|
+
key: 3,
|
|
744
|
+
"model-value": !!e.trailingValue,
|
|
745
|
+
"onUpdate:modelValue": X
|
|
746
|
+
}, null, 8, ["model-value"])) : l("", !0)])
|
|
747
|
+
]),
|
|
748
|
+
_: 3
|
|
749
|
+
}, 16, ["class"]));
|
|
750
|
+
}
|
|
751
|
+
}), be = {
|
|
752
|
+
key: 0,
|
|
753
|
+
class: "flex items-center justify-between"
|
|
754
|
+
}, xe = {
|
|
755
|
+
key: 0,
|
|
756
|
+
class: "text-label-large text-on-surface"
|
|
757
|
+
}, Se = {
|
|
758
|
+
key: 1,
|
|
759
|
+
class: "tabular-nums text-label-large text-on-surface-variant"
|
|
760
|
+
}, Ce = [
|
|
761
|
+
"aria-valuenow",
|
|
762
|
+
"aria-valuemin",
|
|
763
|
+
"aria-valuemax",
|
|
764
|
+
"aria-disabled",
|
|
765
|
+
"aria-orientation"
|
|
766
|
+
], we = "color-mix(in srgb, var(--color-on-surface) 38%, transparent)", Te = "color-mix(in srgb, var(--color-on-surface) 12%, transparent)", Ee = /* @__PURE__ */ m({
|
|
767
|
+
__name: "MSlider",
|
|
768
|
+
props: {
|
|
769
|
+
modelValue: {},
|
|
770
|
+
min: { default: 0 },
|
|
771
|
+
max: { default: 100 },
|
|
772
|
+
step: { default: 1 },
|
|
773
|
+
disabled: {
|
|
774
|
+
type: Boolean,
|
|
775
|
+
default: !1
|
|
776
|
+
},
|
|
777
|
+
label: {},
|
|
778
|
+
showValue: {
|
|
779
|
+
type: Boolean,
|
|
780
|
+
default: !1
|
|
781
|
+
},
|
|
782
|
+
showTooltip: {
|
|
783
|
+
type: Boolean,
|
|
784
|
+
default: !1
|
|
785
|
+
},
|
|
786
|
+
orientation: { default: "horizontal" },
|
|
787
|
+
size: { default: "xs" },
|
|
788
|
+
variant: { default: "standard" },
|
|
789
|
+
stops: {
|
|
790
|
+
type: Boolean,
|
|
791
|
+
default: !1
|
|
792
|
+
},
|
|
793
|
+
icon: {},
|
|
794
|
+
color: { default: "primary" },
|
|
795
|
+
fillColor: {},
|
|
796
|
+
thumbIcon: {},
|
|
797
|
+
thumbColor: {}
|
|
798
|
+
},
|
|
799
|
+
emits: ["update:modelValue"],
|
|
800
|
+
setup(e, { emit: t }) {
|
|
801
|
+
let n = e, r = t, f = w(), m = w(!1), h = w(!1), g = s(() => n.orientation === "vertical"), b = s(() => n.variant === "range");
|
|
802
|
+
s(() => n.variant === "centered");
|
|
803
|
+
let x = s(() => {
|
|
804
|
+
if (b.value) {
|
|
805
|
+
let e = n.modelValue;
|
|
806
|
+
return {
|
|
807
|
+
lo: Math.min(e[0], e[1]),
|
|
808
|
+
hi: Math.max(e[0], e[1])
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
return {
|
|
812
|
+
lo: n.modelValue,
|
|
813
|
+
hi: n.modelValue
|
|
814
|
+
};
|
|
815
|
+
});
|
|
816
|
+
function C(e) {
|
|
817
|
+
let t = n.max - n.min;
|
|
818
|
+
return t === 0 ? 0 : (e - n.min) / t * 100;
|
|
819
|
+
}
|
|
820
|
+
let E = s(() => C(x.value.lo)), D = s(() => C(x.value.hi)), O = s(() => C(0)), ee = s(() => n.variant === "centered" ? Math.min(E.value, O.value) <= 0 : n.variant !== "range" || E.value <= 0), te = s(() => n.variant === "centered" ? Math.max(E.value, O.value) >= 100 : n.variant === "range" ? D.value >= 100 : E.value >= 100), A = {
|
|
821
|
+
xs: {
|
|
822
|
+
track: 16,
|
|
823
|
+
thumbW: 4,
|
|
824
|
+
thumbH: 44,
|
|
825
|
+
dot: 4,
|
|
826
|
+
gap: 6,
|
|
827
|
+
hitArea: 46,
|
|
828
|
+
radius: 6,
|
|
829
|
+
dotInset: 12,
|
|
830
|
+
thumbInset: 5,
|
|
831
|
+
iconSize: 14,
|
|
832
|
+
thumbIconSize: 22
|
|
833
|
+
},
|
|
834
|
+
sm: {
|
|
835
|
+
track: 28,
|
|
836
|
+
thumbW: 4,
|
|
837
|
+
thumbH: 40,
|
|
838
|
+
dot: 5,
|
|
839
|
+
gap: 7,
|
|
840
|
+
hitArea: 46,
|
|
841
|
+
radius: 8,
|
|
842
|
+
dotInset: 13,
|
|
843
|
+
thumbInset: 6,
|
|
844
|
+
iconSize: 16,
|
|
845
|
+
thumbIconSize: 28
|
|
846
|
+
},
|
|
847
|
+
md: {
|
|
848
|
+
track: 54,
|
|
849
|
+
thumbW: 5,
|
|
850
|
+
thumbH: 62,
|
|
851
|
+
dot: 5,
|
|
852
|
+
gap: 8,
|
|
853
|
+
hitArea: 66,
|
|
854
|
+
radius: 12,
|
|
855
|
+
dotInset: 15,
|
|
856
|
+
thumbInset: 7,
|
|
857
|
+
iconSize: 20,
|
|
858
|
+
thumbIconSize: 42
|
|
859
|
+
},
|
|
860
|
+
lg: {
|
|
861
|
+
track: 72,
|
|
862
|
+
thumbW: 5,
|
|
863
|
+
thumbH: 78,
|
|
864
|
+
dot: 6,
|
|
865
|
+
gap: 10,
|
|
866
|
+
hitArea: 82,
|
|
867
|
+
radius: 14,
|
|
868
|
+
dotInset: 17,
|
|
869
|
+
thumbInset: 8,
|
|
870
|
+
iconSize: 24,
|
|
871
|
+
thumbIconSize: 52
|
|
872
|
+
},
|
|
873
|
+
xl: {
|
|
874
|
+
track: 96,
|
|
875
|
+
thumbW: 6,
|
|
876
|
+
thumbH: 98,
|
|
877
|
+
dot: 7,
|
|
878
|
+
gap: 10,
|
|
879
|
+
hitArea: 100,
|
|
880
|
+
radius: 18,
|
|
881
|
+
dotInset: 19,
|
|
882
|
+
thumbInset: 9,
|
|
883
|
+
iconSize: 28,
|
|
884
|
+
thumbIconSize: 66
|
|
885
|
+
}
|
|
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), re = {
|
|
887
|
+
primary: "var(--color-primary)",
|
|
888
|
+
secondary: "var(--color-secondary)",
|
|
889
|
+
tertiary: "var(--color-tertiary)",
|
|
890
|
+
error: "var(--color-error)"
|
|
891
|
+
};
|
|
892
|
+
function P(e, t) {
|
|
893
|
+
let n = e ?? t;
|
|
894
|
+
return re[n] ?? n;
|
|
895
|
+
}
|
|
896
|
+
let F = s(() => n.disabled ? {
|
|
897
|
+
active: we,
|
|
898
|
+
inactive: Te
|
|
899
|
+
} : {
|
|
900
|
+
active: P(n.fillColor, n.color),
|
|
901
|
+
inactive: "var(--color-secondary-container)"
|
|
902
|
+
}), I = s(() => n.disabled ? {
|
|
903
|
+
active: we,
|
|
904
|
+
inactive: Te
|
|
905
|
+
} : {
|
|
906
|
+
active: P(n.thumbColor, n.color),
|
|
907
|
+
inactive: "var(--color-secondary-container)"
|
|
908
|
+
});
|
|
909
|
+
function L(e) {
|
|
910
|
+
let t = Math.round((e - n.min) / n.step) * n.step + n.min;
|
|
911
|
+
return Math.max(n.min, Math.min(n.max, +t.toFixed(10)));
|
|
912
|
+
}
|
|
913
|
+
function R(e) {
|
|
914
|
+
if (!f.value) return 0;
|
|
915
|
+
let t = f.value.getBoundingClientRect();
|
|
916
|
+
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
|
+
}
|
|
918
|
+
function z(e) {
|
|
919
|
+
return L(n.min + R(e) * (n.max - n.min));
|
|
920
|
+
}
|
|
921
|
+
function ie(e) {
|
|
922
|
+
if (n.disabled) return;
|
|
923
|
+
e.preventDefault();
|
|
924
|
+
let t = z(e);
|
|
925
|
+
if (b.value) {
|
|
926
|
+
let e = n.modelValue, i = Math.abs(t - e[0]) <= Math.abs(t - e[1]) ? 0 : 1;
|
|
927
|
+
m.value = i;
|
|
928
|
+
let a = [e[0], e[1]];
|
|
929
|
+
a[i] = t, r("update:modelValue", a);
|
|
930
|
+
} else m.value = "single", r("update:modelValue", t);
|
|
931
|
+
window.addEventListener("pointermove", B), window.addEventListener("pointerup", V), window.addEventListener("pointercancel", V);
|
|
932
|
+
}
|
|
933
|
+
function B(e) {
|
|
934
|
+
if (m.value === !1) return;
|
|
935
|
+
let t = z(e);
|
|
936
|
+
if (b.value) {
|
|
937
|
+
let e = n.modelValue, i = [e[0], e[1]];
|
|
938
|
+
i[m.value] = t, r("update:modelValue", i);
|
|
939
|
+
} else r("update:modelValue", t);
|
|
940
|
+
}
|
|
941
|
+
function V() {
|
|
942
|
+
m.value = !1, window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V);
|
|
943
|
+
}
|
|
944
|
+
function H(e) {
|
|
945
|
+
if (n.disabled) return;
|
|
946
|
+
let t = {
|
|
947
|
+
ArrowRight: 1,
|
|
948
|
+
ArrowUp: 1,
|
|
949
|
+
ArrowLeft: -1,
|
|
950
|
+
ArrowDown: -1
|
|
951
|
+
}[e.key];
|
|
952
|
+
if (t !== void 0) {
|
|
953
|
+
if (e.preventDefault(), b.value) {
|
|
954
|
+
let e = n.modelValue;
|
|
955
|
+
r("update:modelValue", [L(e[0] + t * n.step), e[1]]);
|
|
956
|
+
} else r("update:modelValue", L(n.modelValue + t * n.step));
|
|
957
|
+
}
|
|
958
|
+
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
|
+
}
|
|
960
|
+
y(() => {
|
|
961
|
+
window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", V), window.removeEventListener("pointercancel", V);
|
|
962
|
+
});
|
|
963
|
+
let ae = s(() => {
|
|
964
|
+
if (!n.stops) return [];
|
|
965
|
+
let e = [], t = n.max - n.min, r = n.icon ? (j.value.iconSize + j.value.radius) / 2 : 0;
|
|
966
|
+
for (let i = n.min + n.step; i < n.max; i += n.step) {
|
|
967
|
+
let a = (i - n.min) / t * 100;
|
|
968
|
+
n.icon && a < r || e.push(a);
|
|
969
|
+
}
|
|
970
|
+
return e.length <= 28 ? e : [];
|
|
971
|
+
});
|
|
972
|
+
function oe(e) {
|
|
973
|
+
return `calc(${$(e)} - ${N.value}px)`;
|
|
974
|
+
}
|
|
975
|
+
function se(e) {
|
|
976
|
+
return `calc(100% - ${$(e)} - ${N.value}px)`;
|
|
977
|
+
}
|
|
978
|
+
function ce() {
|
|
979
|
+
return `calc(${$(E.value)} - ${N.value}px)`;
|
|
980
|
+
}
|
|
981
|
+
function U() {
|
|
982
|
+
return `calc(${$(E.value)} + ${N.value}px)`;
|
|
983
|
+
}
|
|
984
|
+
function W() {
|
|
985
|
+
return `calc(${$(D.value)} - ${$(E.value)} - ${N.value * 2}px)`;
|
|
986
|
+
}
|
|
987
|
+
function G() {
|
|
988
|
+
return `calc(100% - ${$(D.value)} - ${N.value}px)`;
|
|
989
|
+
}
|
|
990
|
+
function K() {
|
|
991
|
+
return E.value >= O.value ? `${O.value}%` : `calc(${$(E.value)} + ${N.value}px)`;
|
|
992
|
+
}
|
|
993
|
+
function q() {
|
|
994
|
+
return E.value >= O.value ? `calc(${$(E.value)} - ${O.value}% - ${N.value}px)` : `calc(${O.value}% - ${$(E.value)} - ${N.value}px)`;
|
|
995
|
+
}
|
|
996
|
+
function le() {
|
|
997
|
+
return E.value >= O.value ? `calc(100% - ${$(E.value)} - ${N.value}px)` : `calc(100% - ${O.value}% - ${N.value}px)`;
|
|
998
|
+
}
|
|
999
|
+
function ue() {
|
|
1000
|
+
return E.value <= O.value ? `calc(${$(E.value)} - ${N.value}px)` : `calc(${O.value}% - ${N.value}px)`;
|
|
1001
|
+
}
|
|
1002
|
+
let de = s(() => j.value.radius), J = s(() => Math.max(2, de.value / 4)), Y = s(() => de.value * 1.3);
|
|
1003
|
+
function fe() {
|
|
1004
|
+
return `${J.value}px`;
|
|
1005
|
+
}
|
|
1006
|
+
function X() {
|
|
1007
|
+
return g.value ? `${J.value}px ${J.value}px ${Y.value}px ${Y.value}px` : `${Y.value}px ${J.value}px ${J.value}px ${Y.value}px`;
|
|
1008
|
+
}
|
|
1009
|
+
function pe() {
|
|
1010
|
+
return g.value ? `${Y.value}px ${Y.value}px ${J.value}px ${J.value}px` : `${J.value}px ${Y.value}px ${Y.value}px ${J.value}px`;
|
|
1011
|
+
}
|
|
1012
|
+
let Z = s(() => m.value === !1), Q = s(() => Z.value ? "75ms ease" : "0s");
|
|
1013
|
+
function $(e) {
|
|
1014
|
+
let t = j.value.thumbInset;
|
|
1015
|
+
return `clamp(${t}px, ${e}%, calc(100% - ${t}px))`;
|
|
1016
|
+
}
|
|
1017
|
+
function me(e) {
|
|
1018
|
+
let t = g.value ? j.value.thumbH : j.value.thumbW, n = g.value ? j.value.thumbW : j.value.thumbH, r = Math.min(t, n) / 2, i = m.value !== !1, a = {
|
|
1019
|
+
position: "absolute",
|
|
1020
|
+
width: `${t}px`,
|
|
1021
|
+
height: `${n}px`,
|
|
1022
|
+
borderRadius: `${r}px`,
|
|
1023
|
+
backgroundColor: I.value.active,
|
|
1024
|
+
zIndex: "2",
|
|
1025
|
+
transition: Z.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1026
|
+
}, o = i || h.value, s = i ? 1.08 : 1, c = o ? .5 : 1;
|
|
1027
|
+
return g.value ? (a.left = "50%", a.bottom = $(e), a.transform = `translateX(-50%) translateY(50%) scaleX(${s}) scaleY(${c})`) : (a.left = $(e), a.top = "50%", a.transform = `translateX(-50%) translateY(-50%) scaleY(${s}) scaleX(${c})`), a;
|
|
1028
|
+
}
|
|
1029
|
+
function he(e) {
|
|
1030
|
+
let t = m.value === !1 ? 1 : 1.15, n = {
|
|
1031
|
+
position: "absolute",
|
|
1032
|
+
color: I.value.active,
|
|
1033
|
+
zIndex: "2",
|
|
1034
|
+
transition: Z.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1035
|
+
};
|
|
1036
|
+
return g.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;
|
|
1037
|
+
}
|
|
1038
|
+
function ge(e) {
|
|
1039
|
+
let t = j.value.track / 2 + 36, n = j.value.track / 2 + 40;
|
|
1040
|
+
return g.value ? {
|
|
1041
|
+
left: `calc(50% - ${n}px)`,
|
|
1042
|
+
bottom: $(e),
|
|
1043
|
+
transform: "translateY(50%)",
|
|
1044
|
+
transition: Z.value ? "bottom " + Q.value : "none"
|
|
1045
|
+
} : {
|
|
1046
|
+
left: $(e),
|
|
1047
|
+
top: `calc(50% - ${t}px)`,
|
|
1048
|
+
transform: "translateX(-50%)",
|
|
1049
|
+
transition: Z.value ? "left " + Q.value : "none"
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
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", be, [e.label ? (S(), u("span", xe, k(e.label), 1)) : l("", !0), e.showValue ? (S(), u("span", Se, k(_e.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: _(["flex items-center", g.value ? "flex-1 flex-col" : ""]) }, [d("div", {
|
|
1054
|
+
ref_key: "trackEl",
|
|
1055
|
+
ref: f,
|
|
1056
|
+
role: "slider",
|
|
1057
|
+
tabindex: "0",
|
|
1058
|
+
"aria-valuenow": b.value ? void 0 : e.modelValue,
|
|
1059
|
+
"aria-valuemin": e.min,
|
|
1060
|
+
"aria-valuemax": e.max,
|
|
1061
|
+
"aria-disabled": e.disabled || void 0,
|
|
1062
|
+
"aria-orientation": e.orientation,
|
|
1063
|
+
class: _(["group relative touch-none cursor-pointer outline-none", e.disabled && "cursor-not-allowed"]),
|
|
1064
|
+
style: v(g.value ? {
|
|
1065
|
+
width: `${j.value.hitArea}px`,
|
|
1066
|
+
minHeight: "160px",
|
|
1067
|
+
height: "100%"
|
|
1068
|
+
} : {
|
|
1069
|
+
height: `${j.value.hitArea}px`,
|
|
1070
|
+
width: "100%"
|
|
1071
|
+
}),
|
|
1072
|
+
onPointerdown: ie,
|
|
1073
|
+
onKeydown: H,
|
|
1074
|
+
onFocus: n[0] ||= (e) => h.value = !0,
|
|
1075
|
+
onBlur: n[1] ||= (e) => h.value = !1
|
|
1076
|
+
}, [
|
|
1077
|
+
d("div", {
|
|
1078
|
+
class: "absolute",
|
|
1079
|
+
style: v(g.value ? {
|
|
1080
|
+
left: "50%",
|
|
1081
|
+
top: "0",
|
|
1082
|
+
bottom: "0",
|
|
1083
|
+
width: `${j.value.track}px`,
|
|
1084
|
+
transform: "translateX(-50%)",
|
|
1085
|
+
borderRadius: `${Y.value}px`
|
|
1086
|
+
} : {
|
|
1087
|
+
top: "50%",
|
|
1088
|
+
left: "0",
|
|
1089
|
+
right: "0",
|
|
1090
|
+
height: `${j.value.track}px`,
|
|
1091
|
+
transform: "translateY(-50%)",
|
|
1092
|
+
borderRadius: `${Y.value}px`
|
|
1093
|
+
})
|
|
1094
|
+
}, [
|
|
1095
|
+
e.variant === "standard" ? (S(), u(a, { key: 0 }, [d("div", {
|
|
1096
|
+
class: "absolute",
|
|
1097
|
+
style: v({
|
|
1098
|
+
...g.value ? {
|
|
1099
|
+
left: 0,
|
|
1100
|
+
right: 0,
|
|
1101
|
+
bottom: 0,
|
|
1102
|
+
height: oe(E.value)
|
|
1103
|
+
} : {
|
|
1104
|
+
top: 0,
|
|
1105
|
+
bottom: 0,
|
|
1106
|
+
left: 0,
|
|
1107
|
+
width: oe(E.value)
|
|
1108
|
+
},
|
|
1109
|
+
borderRadius: X(),
|
|
1110
|
+
backgroundColor: F.value.active,
|
|
1111
|
+
transition: `all ${Q.value}`
|
|
1112
|
+
})
|
|
1113
|
+
}, null, 4), d("div", {
|
|
1114
|
+
class: "absolute",
|
|
1115
|
+
style: v({
|
|
1116
|
+
...g.value ? {
|
|
1117
|
+
left: 0,
|
|
1118
|
+
right: 0,
|
|
1119
|
+
top: 0,
|
|
1120
|
+
height: se(E.value)
|
|
1121
|
+
} : {
|
|
1122
|
+
top: 0,
|
|
1123
|
+
bottom: 0,
|
|
1124
|
+
right: 0,
|
|
1125
|
+
width: se(E.value)
|
|
1126
|
+
},
|
|
1127
|
+
borderRadius: pe(),
|
|
1128
|
+
backgroundColor: F.value.inactive,
|
|
1129
|
+
transition: `all ${Q.value}`
|
|
1130
|
+
})
|
|
1131
|
+
}, null, 4)], 64)) : e.variant === "centered" ? (S(), u(a, { key: 1 }, [
|
|
1132
|
+
d("div", {
|
|
1133
|
+
class: "absolute",
|
|
1134
|
+
style: v({
|
|
1135
|
+
...g.value ? {
|
|
1136
|
+
left: 0,
|
|
1137
|
+
right: 0,
|
|
1138
|
+
bottom: K(),
|
|
1139
|
+
height: q()
|
|
1140
|
+
} : {
|
|
1141
|
+
top: 0,
|
|
1142
|
+
bottom: 0,
|
|
1143
|
+
left: K(),
|
|
1144
|
+
width: q()
|
|
1145
|
+
},
|
|
1146
|
+
borderRadius: fe(),
|
|
1147
|
+
backgroundColor: F.value.active,
|
|
1148
|
+
transition: `all ${Q.value}`
|
|
1149
|
+
})
|
|
1150
|
+
}, null, 4),
|
|
1151
|
+
d("div", {
|
|
1152
|
+
class: "absolute",
|
|
1153
|
+
style: v({
|
|
1154
|
+
...g.value ? {
|
|
1155
|
+
left: 0,
|
|
1156
|
+
right: 0,
|
|
1157
|
+
top: 0,
|
|
1158
|
+
height: le()
|
|
1159
|
+
} : {
|
|
1160
|
+
top: 0,
|
|
1161
|
+
bottom: 0,
|
|
1162
|
+
right: 0,
|
|
1163
|
+
width: le()
|
|
1164
|
+
},
|
|
1165
|
+
borderRadius: pe(),
|
|
1166
|
+
backgroundColor: F.value.inactive,
|
|
1167
|
+
transition: `all ${Q.value}`
|
|
1168
|
+
})
|
|
1169
|
+
}, null, 4),
|
|
1170
|
+
d("div", {
|
|
1171
|
+
class: "absolute",
|
|
1172
|
+
style: v({
|
|
1173
|
+
...g.value ? {
|
|
1174
|
+
left: 0,
|
|
1175
|
+
right: 0,
|
|
1176
|
+
bottom: 0,
|
|
1177
|
+
height: ue()
|
|
1178
|
+
} : {
|
|
1179
|
+
top: 0,
|
|
1180
|
+
bottom: 0,
|
|
1181
|
+
left: 0,
|
|
1182
|
+
width: ue()
|
|
1183
|
+
},
|
|
1184
|
+
borderRadius: X(),
|
|
1185
|
+
backgroundColor: F.value.inactive,
|
|
1186
|
+
transition: `all ${Q.value}`
|
|
1187
|
+
})
|
|
1188
|
+
}, null, 4)
|
|
1189
|
+
], 64)) : e.variant === "range" ? (S(), u(a, { key: 2 }, [
|
|
1190
|
+
d("div", {
|
|
1191
|
+
class: "absolute",
|
|
1192
|
+
style: v({
|
|
1193
|
+
...g.value ? {
|
|
1194
|
+
left: 0,
|
|
1195
|
+
right: 0,
|
|
1196
|
+
bottom: 0,
|
|
1197
|
+
height: ce()
|
|
1198
|
+
} : {
|
|
1199
|
+
top: 0,
|
|
1200
|
+
bottom: 0,
|
|
1201
|
+
left: 0,
|
|
1202
|
+
width: ce()
|
|
1203
|
+
},
|
|
1204
|
+
borderRadius: X(),
|
|
1205
|
+
backgroundColor: F.value.inactive,
|
|
1206
|
+
transition: `all ${Q.value}`
|
|
1207
|
+
})
|
|
1208
|
+
}, null, 4),
|
|
1209
|
+
d("div", {
|
|
1210
|
+
class: "absolute",
|
|
1211
|
+
style: v({
|
|
1212
|
+
...g.value ? {
|
|
1213
|
+
left: 0,
|
|
1214
|
+
right: 0,
|
|
1215
|
+
bottom: U(),
|
|
1216
|
+
height: W()
|
|
1217
|
+
} : {
|
|
1218
|
+
top: 0,
|
|
1219
|
+
bottom: 0,
|
|
1220
|
+
left: U(),
|
|
1221
|
+
width: W()
|
|
1222
|
+
},
|
|
1223
|
+
borderRadius: fe(),
|
|
1224
|
+
backgroundColor: F.value.active,
|
|
1225
|
+
transition: `all ${Q.value}`
|
|
1226
|
+
})
|
|
1227
|
+
}, null, 4),
|
|
1228
|
+
d("div", {
|
|
1229
|
+
class: "absolute",
|
|
1230
|
+
style: v({
|
|
1231
|
+
...g.value ? {
|
|
1232
|
+
left: 0,
|
|
1233
|
+
right: 0,
|
|
1234
|
+
top: 0,
|
|
1235
|
+
height: G()
|
|
1236
|
+
} : {
|
|
1237
|
+
top: 0,
|
|
1238
|
+
bottom: 0,
|
|
1239
|
+
right: 0,
|
|
1240
|
+
width: G()
|
|
1241
|
+
},
|
|
1242
|
+
borderRadius: pe(),
|
|
1243
|
+
backgroundColor: F.value.inactive,
|
|
1244
|
+
transition: `all ${Q.value}`
|
|
1245
|
+
})
|
|
1246
|
+
}, null, 4)
|
|
1247
|
+
], 64)) : l("", !0),
|
|
1248
|
+
e.icon ? (S(), c(i, {
|
|
1249
|
+
key: 3,
|
|
1250
|
+
name: e.icon,
|
|
1251
|
+
size: j.value.iconSize,
|
|
1252
|
+
class: "absolute z-[1]",
|
|
1253
|
+
style: v({
|
|
1254
|
+
color: e.variant === "standard" && E.value > 0 || e.variant === "range" && E.value > 0 ? F.value.inactive : F.value.active,
|
|
1255
|
+
...g.value ? {
|
|
1256
|
+
left: "50%",
|
|
1257
|
+
bottom: `${M.value}px`,
|
|
1258
|
+
transform: "translateX(-50%)"
|
|
1259
|
+
} : {
|
|
1260
|
+
top: "50%",
|
|
1261
|
+
left: `${M.value}px`,
|
|
1262
|
+
transform: "translateY(-50%)"
|
|
1263
|
+
},
|
|
1264
|
+
transition: "color 150ms ease"
|
|
1265
|
+
})
|
|
1266
|
+
}, null, 8, [
|
|
1267
|
+
"name",
|
|
1268
|
+
"size",
|
|
1269
|
+
"style"
|
|
1270
|
+
])) : e.stops ? l("", !0) : (S(), u("div", {
|
|
1271
|
+
key: 4,
|
|
1272
|
+
class: "absolute rounded-full",
|
|
1273
|
+
style: v({
|
|
1274
|
+
width: `${j.value.dot}px`,
|
|
1275
|
+
height: `${j.value.dot}px`,
|
|
1276
|
+
backgroundColor: F.value.active,
|
|
1277
|
+
opacity: +!ee.value,
|
|
1278
|
+
...g.value ? {
|
|
1279
|
+
left: "50%",
|
|
1280
|
+
bottom: `${j.value.dotInset}px`,
|
|
1281
|
+
transform: "translateX(-50%)"
|
|
1282
|
+
} : {
|
|
1283
|
+
top: "50%",
|
|
1284
|
+
left: `${j.value.dotInset}px`,
|
|
1285
|
+
transform: "translateY(-50%)"
|
|
1286
|
+
},
|
|
1287
|
+
transition: "opacity 150ms ease"
|
|
1288
|
+
})
|
|
1289
|
+
}, null, 4)),
|
|
1290
|
+
e.stops ? l("", !0) : (S(), u("div", {
|
|
1291
|
+
key: 5,
|
|
1292
|
+
class: "absolute rounded-full",
|
|
1293
|
+
style: v({
|
|
1294
|
+
width: `${j.value.dot}px`,
|
|
1295
|
+
height: `${j.value.dot}px`,
|
|
1296
|
+
backgroundColor: F.value.active,
|
|
1297
|
+
opacity: +!te.value,
|
|
1298
|
+
...g.value ? {
|
|
1299
|
+
left: "50%",
|
|
1300
|
+
top: `${j.value.dotInset}px`,
|
|
1301
|
+
transform: "translateX(-50%)"
|
|
1302
|
+
} : {
|
|
1303
|
+
top: "50%",
|
|
1304
|
+
right: `${j.value.dotInset}px`,
|
|
1305
|
+
transform: "translateY(-50%)"
|
|
1306
|
+
},
|
|
1307
|
+
transition: "opacity 150ms ease"
|
|
1308
|
+
})
|
|
1309
|
+
}, null, 4)),
|
|
1310
|
+
e.stops ? (S(!0), u(a, { key: 6 }, T(ae.value, (e, t) => (S(), u("div", {
|
|
1311
|
+
key: t,
|
|
1312
|
+
class: "absolute rounded-full",
|
|
1313
|
+
style: v({
|
|
1314
|
+
width: `${j.value.dot}px`,
|
|
1315
|
+
height: `${j.value.dot}px`,
|
|
1316
|
+
backgroundColor: e <= E.value ? F.value.inactive : F.value.active,
|
|
1317
|
+
opacity: Math.abs(e - E.value) < .01 || b.value && Math.abs(e - D.value) < .01 ? 0 : 1,
|
|
1318
|
+
...g.value ? {
|
|
1319
|
+
left: "50%",
|
|
1320
|
+
bottom: `${e}%`,
|
|
1321
|
+
transform: "translateX(-50%) translateY(50%)"
|
|
1322
|
+
} : {
|
|
1323
|
+
top: "50%",
|
|
1324
|
+
left: `${e}%`,
|
|
1325
|
+
transform: "translateX(-50%) translateY(-50%)"
|
|
1326
|
+
}
|
|
1327
|
+
})
|
|
1328
|
+
}, null, 4))), 128)) : l("", !0)
|
|
1329
|
+
], 4),
|
|
1330
|
+
e.thumbIcon ? (S(), u(a, { key: 0 }, [p(i, {
|
|
1331
|
+
name: e.thumbIcon,
|
|
1332
|
+
size: j.value.thumbIconSize,
|
|
1333
|
+
class: "pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-primary group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1334
|
+
style: v(he(E.value))
|
|
1335
|
+
}, null, 8, [
|
|
1336
|
+
"name",
|
|
1337
|
+
"size",
|
|
1338
|
+
"style"
|
|
1339
|
+
]), b.value ? (S(), c(i, {
|
|
1340
|
+
key: 0,
|
|
1341
|
+
name: e.thumbIcon,
|
|
1342
|
+
size: j.value.thumbIconSize,
|
|
1343
|
+
class: "pointer-events-none",
|
|
1344
|
+
style: v(he(D.value))
|
|
1345
|
+
}, null, 8, [
|
|
1346
|
+
"name",
|
|
1347
|
+
"size",
|
|
1348
|
+
"style"
|
|
1349
|
+
])) : l("", !0)], 64)) : (S(), u(a, { key: 1 }, [d("div", {
|
|
1350
|
+
class: "pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-primary group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1351
|
+
style: v(me(E.value))
|
|
1352
|
+
}, null, 4), b.value ? (S(), u("div", {
|
|
1353
|
+
key: 0,
|
|
1354
|
+
class: "pointer-events-none",
|
|
1355
|
+
style: v(me(D.value))
|
|
1356
|
+
}, null, 4)) : l("", !0)], 64)),
|
|
1357
|
+
p(o, {
|
|
1358
|
+
"enter-active-class": "transition-opacity duration-100",
|
|
1359
|
+
"enter-from-class": "opacity-0",
|
|
1360
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
1361
|
+
"leave-to-class": "opacity-0"
|
|
1362
|
+
}, {
|
|
1363
|
+
default: ne(() => [e.showTooltip && m.value !== !1 ? (S(), u("div", {
|
|
1364
|
+
key: 0,
|
|
1365
|
+
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",
|
|
1366
|
+
style: v(ge(ye.value))
|
|
1367
|
+
}, k(ve.value), 5)) : l("", !0)]),
|
|
1368
|
+
_: 1
|
|
1369
|
+
})
|
|
1370
|
+
], 46, Ce)], 2)], 2));
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
//#endregion
|
|
1374
|
+
export { ue as a, F as c, P as d, de as i, re as l, ye as n, U as o, pe as r, ae as s, Ee as t, N as u };
|
|
1375
|
+
|
|
1376
|
+
//# sourceMappingURL=MSlider-CdNIH7jc.js.map
|