@m3ui-vue/m3ui-vue 1.6.0 → 1.6.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 +940 -33
- package/dist/{MButton-CPghlKb0.js → MButton-OQ4wIERQ.js} +2 -2
- package/dist/{MButton-CPghlKb0.js.map → MButton-OQ4wIERQ.js.map} +1 -1
- package/dist/MColorPickerModal-NtkihoK6.js +577 -0
- package/dist/MColorPickerModal-NtkihoK6.js.map +1 -0
- package/dist/{MDialog-X50At1Gk.js → MDialog-DYMnaBlt.js} +3 -3
- package/dist/{MDialog-X50At1Gk.js.map → MDialog-DYMnaBlt.js.map} +1 -1
- package/dist/{MListItem-DVi1j1QI.js → MListItem-D2cNUyzP.js} +211 -168
- package/dist/MListItem-D2cNUyzP.js.map +1 -0
- package/dist/{MLoadingIndicator-vooA3110.js → MLoadingIndicator-DWUj0BAB.js} +2 -2
- package/dist/{MLoadingIndicator-vooA3110.js.map → MLoadingIndicator-DWUj0BAB.js.map} +1 -1
- package/dist/{MMenuItem-CRNZkVVr.js → MMenuItem-BuxYoASE.js} +133 -151
- package/dist/MMenuItem-BuxYoASE.js.map +1 -0
- package/dist/{MSeekBar-BL2W5_rD.js → MSeekBar-C4cn9RIF.js} +2 -2
- package/dist/{MSeekBar-BL2W5_rD.js.map → MSeekBar-C4cn9RIF.js.map} +1 -1
- package/dist/{MSlider-B9NcKTmZ.js → MSlider-BIkA6DiE.js} +2 -2
- package/dist/{MSlider-B9NcKTmZ.js.map → MSlider-BIkA6DiE.js.map} +1 -1
- package/dist/{MSpinner-_XpTRkAg.js → MSpinner-DZkXZJpc.js} +2 -2
- package/dist/{MSpinner-_XpTRkAg.js.map → MSpinner-DZkXZJpc.js.map} +1 -1
- package/dist/{MTextField-DpcPmR5B.js → MTextField-CNH-byir.js} +2 -2
- package/dist/{MTextField-DpcPmR5B.js.map → MTextField-CNH-byir.js.map} +1 -1
- package/dist/MTooltip-CK39Zon4.js +183 -0
- package/dist/MTooltip-CK39Zon4.js.map +1 -0
- package/dist/{_useEscapeStack-C5-BYr8y.js → _popupPosition-nL8SVKPK.js} +20 -2
- package/dist/_popupPosition-nL8SVKPK.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAddressField.vue.d.ts +54 -0
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +51 -0
- package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
- package/dist/components/MCameraCapture.vue.d.ts +51 -0
- package/dist/components/MCollapse.vue.d.ts +32 -0
- package/dist/components/MCountrySelect.vue.d.ts +41 -0
- package/dist/components/MCronField.vue.d.ts +26 -0
- package/dist/components/MDashboardGrid.vue.d.ts +65 -0
- package/dist/components/MDiffViewer.vue.d.ts +56 -0
- package/dist/components/MExpansionPanel.vue.d.ts +26 -3
- package/dist/components/MFilterBuilder.vue.d.ts +22 -0
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MMapCluster.vue.d.ts +80 -0
- package/dist/components/MMapDraw.vue.d.ts +79 -0
- package/dist/components/MMentionField.vue.d.ts +102 -0
- package/dist/components/MNotificationCenter.vue.d.ts +57 -0
- package/dist/components/MQRScanner.vue.d.ts +52 -0
- package/dist/components/MQuiz.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +39 -0
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MVideoPlayer.vue.d.ts +1 -1
- package/dist/components/_MFilterGroup.vue.d.ts +17 -0
- package/dist/composables/_caretPosition.d.ts +6 -0
- package/dist/composables/_useCamera.d.ts +16 -0
- package/dist/composables/_useFollowAnchor.d.ts +15 -0
- package/dist/composables/cron.d.ts +29 -0
- package/dist/composables/dashboardLayout.d.ts +28 -0
- package/dist/composables/filterBuilder.d.ts +55 -0
- package/dist/composables/mapAdapters.d.ts +6 -1
- package/dist/composables/mapSearch.d.ts +1 -0
- package/dist/composables/textDiff.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +108 -0
- package/dist/draw.js +28 -27
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/locales/index.js +749 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10444 -7495
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +5 -0
- package/dist/map.js +1509 -617
- package/dist/map.js.map +1 -1
- package/dist/media.js +5 -5
- package/dist/pdf.js +5 -5
- package/dist/rich-text-editor.js +5 -5
- package/dist/styles.css +1 -1
- package/dist/{useLocale-COav9m8C.js → useLocale-DaVSTdm0.js} +108 -1
- package/dist/useLocale-DaVSTdm0.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAddressField.test.ts +149 -0
- package/src/__tests__/MAudioRecorder.test.ts +125 -0
- package/src/__tests__/MCameraCapture.test.ts +154 -0
- package/src/__tests__/MCountrySelect.test.ts +67 -0
- package/src/__tests__/MCronField.test.ts +100 -0
- package/src/__tests__/MDashboardGrid.test.ts +122 -0
- package/src/__tests__/MDiffViewer.test.ts +68 -0
- package/src/__tests__/MExpansionPanel.test.ts +107 -0
- package/src/__tests__/MFilterBuilder.test.ts +130 -0
- package/src/__tests__/MMapCluster.test.ts +127 -0
- package/src/__tests__/MMapDraw.test.ts +188 -0
- package/src/__tests__/MMapLayers.test.ts +56 -0
- package/src/__tests__/MMentionField.test.ts +163 -0
- package/src/__tests__/MNotificationCenter.test.ts +94 -0
- package/src/__tests__/_fakeMaplibre.ts +14 -3
- package/src/__tests__/attrsFallthrough.test.ts +4 -0
- package/src/__tests__/cron.test.ts +68 -0
- package/src/__tests__/dashboardLayout.test.ts +45 -0
- package/src/__tests__/filterBuilder.test.ts +91 -0
- package/src/__tests__/followAnchor.test.ts +162 -0
- package/src/__tests__/ssr.test.ts +3 -0
- package/src/__tests__/textDiff.test.ts +37 -0
- package/src/components/MAddressField.vue +301 -0
- package/src/components/MAudioRecorder.vue +334 -0
- package/src/components/MAutocomplete.vue +3 -7
- package/src/components/MCameraCapture.vue +156 -0
- package/src/components/MCollapse.vue +91 -0
- package/src/components/MColorPicker.vue +4 -8
- package/src/components/MCountrySelect.vue +89 -0
- package/src/components/MCronField.vue +251 -0
- package/src/components/MDashboardGrid.vue +382 -0
- package/src/components/MDatePicker.vue +10 -7
- package/src/components/MDateRangePicker.vue +10 -7
- package/src/components/MDiffViewer.vue +234 -0
- package/src/components/MExpansionPanel.vue +56 -48
- package/src/components/MFilterBuilder.vue +47 -0
- package/src/components/MMapBaseLayers.vue +29 -28
- package/src/components/MMapCluster.vue +295 -0
- package/src/components/MMapDraw.vue +601 -0
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMapSearch.vue +1 -9
- package/src/components/MMentionField.vue +373 -0
- package/src/components/MMultiAutocomplete.vue +3 -7
- package/src/components/MMultiSelect.vue +3 -7
- package/src/components/MNotificationCenter.vue +252 -0
- package/src/components/MPhoneInput.vue +3 -10
- package/src/components/MQRScanner.vue +177 -0
- package/src/components/MSelect.vue +3 -7
- package/src/components/MTimePicker.vue +10 -7
- package/src/components/MTimezoneSelect.vue +116 -0
- package/src/components/_MFilterGroup.vue +210 -0
- package/src/composables/_caretPosition.ts +44 -0
- package/src/composables/_useCamera.ts +66 -0
- package/src/composables/_useFollowAnchor.ts +109 -0
- package/src/composables/cron.ts +179 -0
- package/src/composables/dashboardLayout.ts +94 -0
- package/src/composables/filterBuilder.ts +195 -0
- package/src/composables/mapAdapters.ts +29 -15
- package/src/composables/mapSearch.ts +10 -0
- package/src/composables/textDiff.ts +106 -0
- package/src/composables/useLocale.ts +215 -0
- package/src/index.ts +25 -0
- package/src/locales/de.ts +107 -0
- package/src/locales/es.ts +107 -0
- package/src/locales/fr.ts +107 -0
- package/src/locales/ja.ts +107 -0
- package/src/locales/ko.ts +107 -0
- package/src/locales/pt.ts +107 -0
- package/src/locales/zh.ts +107 -0
- package/src/map.ts +5 -0
- package/dist/MListItem-DVi1j1QI.js.map +0 -1
- package/dist/MMenuItem-CRNZkVVr.js.map +0 -1
- package/dist/MTooltip-BL3jPYPT.js +0 -754
- package/dist/MTooltip-BL3jPYPT.js.map +0 -1
- package/dist/_useEscapeStack-C5-BYr8y.js.map +0 -1
- package/dist/useLocale-COav9m8C.js.map +0 -1
|
@@ -1,9 +1,52 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-DaVSTdm0.js";
|
|
2
2
|
import { a as t, i as n, s as r } from "./MIconButton-BBggVwBV.js";
|
|
3
3
|
import { t as i } from "./MIcon-DpajuUTJ.js";
|
|
4
|
-
import { Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, h, inject as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b,
|
|
4
|
+
import { Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, h, inject as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, onUnmounted as C, onUpdated as w, openBlock as T, provide as E, ref as D, renderSlot as O, resolveDynamicComponent as ee, shallowRef as k, toDisplayString as A, unref as j, useId as te, useSlots as M, watch as N, withCtx as P, withModifiers as F } from "vue";
|
|
5
|
+
// src/composables/_useFollowAnchor.ts
|
|
6
|
+
var I = /(auto|scroll|hidden|clip)/;
|
|
7
|
+
function L(e) {
|
|
8
|
+
if (!e.isConnected) return !0;
|
|
9
|
+
let t = e.getBoundingClientRect(), n = t.top, r = t.left, i = t.bottom, a = t.right;
|
|
10
|
+
for (let t = e.parentElement; t && t !== document.body && t !== document.documentElement; t = t.parentElement) {
|
|
11
|
+
let e = getComputedStyle(t);
|
|
12
|
+
if (e.position === "fixed") break;
|
|
13
|
+
if (!I.test(e.overflow + e.overflowX + e.overflowY)) continue;
|
|
14
|
+
let o = t.getBoundingClientRect();
|
|
15
|
+
n = Math.max(n, o.top), r = Math.max(r, o.left), i = Math.min(i, o.bottom), a = Math.min(a, o.right);
|
|
16
|
+
}
|
|
17
|
+
return n = Math.max(n, 0), r = Math.max(r, 0), i = Math.min(i, window.innerHeight), a = Math.min(a, window.innerWidth), i <= n || a <= r;
|
|
18
|
+
}
|
|
19
|
+
function R(e) {
|
|
20
|
+
let t = 0, n = null, r = !1;
|
|
21
|
+
function i() {
|
|
22
|
+
if (t = 0, !e.open()) return;
|
|
23
|
+
let n = e.anchor.value;
|
|
24
|
+
if (!n || L(n)) {
|
|
25
|
+
e.close();
|
|
26
|
+
let t = document.activeElement;
|
|
27
|
+
n && t instanceof HTMLElement && n.contains(t) && t.blur();
|
|
28
|
+
} else e.place();
|
|
29
|
+
}
|
|
30
|
+
function a() {
|
|
31
|
+
t ||= requestAnimationFrame(i);
|
|
32
|
+
}
|
|
33
|
+
function o(t) {
|
|
34
|
+
let n = t.target;
|
|
35
|
+
n instanceof Node && e.popup.value?.contains(n) || a();
|
|
36
|
+
}
|
|
37
|
+
function s() {
|
|
38
|
+
r || typeof window > "u" || (r = !0, window.addEventListener("scroll", o, {
|
|
39
|
+
capture: !0,
|
|
40
|
+
passive: !0
|
|
41
|
+
}), window.addEventListener("resize", a), window.visualViewport?.addEventListener("resize", a), window.visualViewport?.addEventListener("scroll", a), typeof ResizeObserver < "u" && e.anchor.value && (n = new ResizeObserver(a), n.observe(e.anchor.value)));
|
|
42
|
+
}
|
|
43
|
+
function c() {
|
|
44
|
+
r && (r = !1, window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", a), window.visualViewport?.removeEventListener("resize", a), window.visualViewport?.removeEventListener("scroll", a), n?.disconnect(), n = null, t && cancelAnimationFrame(t), t = 0);
|
|
45
|
+
}
|
|
46
|
+
N(e.open, (e) => e ? s() : c(), { immediate: !0 }), x(c);
|
|
47
|
+
}
|
|
5
48
|
// src/components/MAvatar.vue
|
|
6
|
-
var
|
|
49
|
+
var z = /* @__PURE__ */ p({
|
|
7
50
|
__name: "MAvatar",
|
|
8
51
|
props: {
|
|
9
52
|
name: {},
|
|
@@ -18,32 +61,32 @@ var ne = /* @__PURE__ */ p({
|
|
|
18
61
|
}
|
|
19
62
|
return t.fallback || "?";
|
|
20
63
|
});
|
|
21
|
-
return (t, r) => (
|
|
64
|
+
return (t, r) => (T(), l("div", {
|
|
22
65
|
class: "inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
23
66
|
style: b({
|
|
24
67
|
width: `${e.size}px`,
|
|
25
68
|
height: `${e.size}px`,
|
|
26
69
|
fontSize: `${Math.round(e.size * .4)}px`
|
|
27
70
|
})
|
|
28
|
-
},
|
|
71
|
+
}, A(n.value), 5));
|
|
29
72
|
}
|
|
30
|
-
}),
|
|
73
|
+
}), ne = [
|
|
31
74
|
"role",
|
|
32
75
|
"tabindex",
|
|
33
76
|
"aria-disabled"
|
|
34
|
-
],
|
|
77
|
+
], B = ["src", "alt"], V = {
|
|
35
78
|
key: 1,
|
|
36
79
|
class: "px-4 pt-4 pb-2"
|
|
37
|
-
},
|
|
80
|
+
}, H = {
|
|
38
81
|
key: 2,
|
|
39
82
|
class: "px-4 pt-4 pb-2"
|
|
40
|
-
}, re = { class: "text-title-large font-medium text-on-surface" },
|
|
83
|
+
}, re = { class: "text-title-large font-medium text-on-surface" }, U = {
|
|
41
84
|
key: 0,
|
|
42
85
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
43
|
-
},
|
|
86
|
+
}, W = {
|
|
44
87
|
key: 3,
|
|
45
88
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
46
|
-
},
|
|
89
|
+
}, ie = "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__ */ p({
|
|
47
90
|
__name: "MCard",
|
|
48
91
|
props: {
|
|
49
92
|
variant: { default: "elevated" },
|
|
@@ -86,13 +129,13 @@ var ne = /* @__PURE__ */ p({
|
|
|
86
129
|
function d(e) {
|
|
87
130
|
s.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
88
131
|
}
|
|
89
|
-
return (t, o) => (
|
|
132
|
+
return (t, o) => (T(), l("div", {
|
|
90
133
|
class: y(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
91
134
|
i.value,
|
|
92
135
|
s.value ? [
|
|
93
136
|
"cursor-pointer",
|
|
94
137
|
a[n.value],
|
|
95
|
-
|
|
138
|
+
ie
|
|
96
139
|
] : "",
|
|
97
140
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
98
141
|
]]),
|
|
@@ -102,28 +145,28 @@ var ne = /* @__PURE__ */ p({
|
|
|
102
145
|
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
103
146
|
onKeydown: d
|
|
104
147
|
}, [
|
|
105
|
-
e.image || t.$slots.media ? (
|
|
148
|
+
e.image || t.$slots.media ? (T(), l("div", {
|
|
106
149
|
key: 0,
|
|
107
150
|
class: y(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
108
|
-
}, [e.image ? (
|
|
151
|
+
}, [e.image ? (T(), l("img", {
|
|
109
152
|
key: 0,
|
|
110
153
|
src: e.image,
|
|
111
154
|
alt: e.imageAlt ?? "",
|
|
112
155
|
class: "h-full w-full object-cover"
|
|
113
|
-
}, null, 8,
|
|
114
|
-
t.$slots.header ? (
|
|
115
|
-
|
|
116
|
-
t.$slots.actions ? (
|
|
117
|
-
], 46,
|
|
156
|
+
}, null, 8, B)) : O(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : c("", !0),
|
|
157
|
+
t.$slots.header ? (T(), l("div", V, [O(t.$slots, "header")])) : e.title ? (T(), l("div", H, [u("h3", re, A(e.title), 1), e.subtitle ? (T(), l("p", U, A(e.subtitle), 1)) : c("", !0)])) : c("", !0),
|
|
158
|
+
O(t.$slots, "default"),
|
|
159
|
+
t.$slots.actions ? (T(), l("div", W, [O(t.$slots, "actions")])) : c("", !0)
|
|
160
|
+
], 46, ne));
|
|
118
161
|
}
|
|
119
|
-
}),
|
|
162
|
+
}), oe = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, G = [
|
|
120
163
|
"checked",
|
|
121
164
|
"disabled",
|
|
122
165
|
"aria-label"
|
|
123
|
-
],
|
|
166
|
+
], se = {
|
|
124
167
|
key: 1,
|
|
125
168
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
126
|
-
},
|
|
169
|
+
}, ce = /* @__PURE__ */ p({
|
|
127
170
|
__name: "MCheckbox",
|
|
128
171
|
props: {
|
|
129
172
|
modelValue: { type: Boolean },
|
|
@@ -152,7 +195,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
152
195
|
tertiary: "bg-tertiary",
|
|
153
196
|
error: "bg-error"
|
|
154
197
|
};
|
|
155
|
-
return (t, o) => (
|
|
198
|
+
return (t, o) => (T(), l("label", { class: y(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [u("span", oe, [
|
|
156
199
|
u("input", {
|
|
157
200
|
type: "checkbox",
|
|
158
201
|
class: "peer sr-only",
|
|
@@ -160,23 +203,23 @@ var ne = /* @__PURE__ */ p({
|
|
|
160
203
|
disabled: e.disabled,
|
|
161
204
|
"aria-label": e.ariaLabel,
|
|
162
205
|
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
163
|
-
}, null, 40,
|
|
164
|
-
e.disabled ? c("", !0) : (
|
|
206
|
+
}, null, 40, G),
|
|
207
|
+
e.disabled ? c("", !0) : (T(), l("span", {
|
|
165
208
|
key: 0,
|
|
166
209
|
class: y(["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
210
|
}, null, 2)),
|
|
168
|
-
e.disabled ? c("", !0) : (
|
|
211
|
+
e.disabled ? c("", !0) : (T(), l("span", se)),
|
|
169
212
|
u("span", { class: y(["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"]) }, [f(i, {
|
|
170
213
|
name: e.indeterminate ? "remove" : "check",
|
|
171
214
|
size: 18,
|
|
172
215
|
class: y(["transition-[opacity,transform] duration-150", e.modelValue || e.indeterminate ? "scale-100 opacity-100" : "scale-0 opacity-0"])
|
|
173
216
|
}, null, 8, ["name", "class"])], 2)
|
|
174
|
-
]), e.label || t.$slots.default ? (
|
|
217
|
+
]), e.label || t.$slots.default ? (T(), l("span", {
|
|
175
218
|
key: 0,
|
|
176
219
|
class: y(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
177
|
-
}, [
|
|
220
|
+
}, [O(t.$slots, "default", {}, () => [d(A(e.label), 1)])], 2)) : c("", !0)], 2));
|
|
178
221
|
}
|
|
179
|
-
}),
|
|
222
|
+
}), le = ["disabled", "aria-pressed"], K = { class: "whitespace-nowrap" }, ue = ["aria-label", "disabled"], de = ["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__ */ p({
|
|
180
223
|
__name: "MChip",
|
|
181
224
|
props: {
|
|
182
225
|
tone: { default: "neutral" },
|
|
@@ -217,7 +260,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
217
260
|
"error",
|
|
218
261
|
"tertiary",
|
|
219
262
|
"secondary"
|
|
220
|
-
], m = a, h = d, g = e(), _ =
|
|
263
|
+
], m = a, h = d, g = e(), _ = M(), v = o(() => !!m.tone && !p.includes(m.tone)), x = o(() => {
|
|
221
264
|
if (v.value) return {
|
|
222
265
|
"--chip-bg": m.tone + "22",
|
|
223
266
|
"--chip-color": m.tone
|
|
@@ -235,54 +278,54 @@ var ne = /* @__PURE__ */ p({
|
|
|
235
278
|
tertiary: "border border-transparent bg-tertiary-container text-on-tertiary-container"
|
|
236
279
|
};
|
|
237
280
|
return e[m.tone ?? "neutral"] ?? e.neutral;
|
|
238
|
-
}), C = o(() => m.selected ? "rounded-full" : "rounded-md"),
|
|
239
|
-
let e =
|
|
281
|
+
}), C = o(() => m.selected ? "rounded-full" : "rounded-md"), w = o(() => m.type === "filter" || m.type === "input"), E = o(() => m.type === "input" && !!_.avatar), k = o(() => !!m.trailingIcon || m.type === "input" && m.removable), A = o(() => {
|
|
282
|
+
let e = w.value && m.selected;
|
|
240
283
|
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
284
|
if (e) return ["bg-secondary-container text-on-secondary-container", m.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
242
285
|
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
243
286
|
return m.elevated && m.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
244
|
-
}),
|
|
245
|
-
r(() => m.type === "filter" || m.type === "input" ? [
|
|
246
|
-
|
|
247
|
-
}, t), r(() =>
|
|
248
|
-
|
|
287
|
+
}), te = o(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), N = o(() => m.type === "input" ? [E.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", k.value ? "pr-2" : "pr-3"] : [m.icon || z.value ? "pl-2" : "pl-4", k.value ? "pr-2" : "pr-4"]), I = D(!1), L = D(), R = D(), z = o(() => m.type === "filter" && !m.icon);
|
|
288
|
+
r(() => m.type === "filter" || m.type === "input" ? [I.value ? 8 : m.selected ? 16 : 12, z.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
289
|
+
L.value && e !== void 0 && (L.value.style.borderRadius = `${e}px`), R.value && t !== void 0 && (R.value.style.width = `${t}px`);
|
|
290
|
+
}, t), r(() => z.value ? [+!!m.selected] : [], ([e]) => {
|
|
291
|
+
R.value && e !== void 0 && (R.value.style.opacity = String(e));
|
|
249
292
|
}, n);
|
|
250
|
-
function
|
|
251
|
-
m.disabled || (
|
|
293
|
+
function ne() {
|
|
294
|
+
m.disabled || (w.value && h("update:selected", !m.selected), h("click"));
|
|
252
295
|
}
|
|
253
|
-
return (e, t) => a.type ? (
|
|
296
|
+
return (e, t) => a.type ? (T(), l("span", {
|
|
254
297
|
key: 0,
|
|
255
298
|
ref_key: "typedEl",
|
|
256
|
-
ref:
|
|
257
|
-
class: y(["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", [
|
|
299
|
+
ref: L,
|
|
300
|
+
class: y(["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", [A.value, a.type === "assist" || a.type === "suggestion" ? "rounded-sm" : "rounded-md"]])
|
|
258
301
|
}, [u("button", {
|
|
259
302
|
type: "button",
|
|
260
|
-
class: y(["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", [
|
|
303
|
+
class: y(["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", [N.value, a.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"]]),
|
|
261
304
|
disabled: a.disabled,
|
|
262
|
-
"aria-pressed":
|
|
263
|
-
onPointerdown: t[0] ||= (e) =>
|
|
264
|
-
onPointerup: t[1] ||= (e) =>
|
|
265
|
-
onPointerleave: t[2] ||= (e) =>
|
|
266
|
-
onPointercancel: t[3] ||= (e) =>
|
|
267
|
-
onClick:
|
|
305
|
+
"aria-pressed": w.value ? a.selected : void 0,
|
|
306
|
+
onPointerdown: t[0] ||= (e) => I.value = !0,
|
|
307
|
+
onPointerup: t[1] ||= (e) => I.value = !1,
|
|
308
|
+
onPointerleave: t[2] ||= (e) => I.value = !1,
|
|
309
|
+
onPointercancel: t[3] ||= (e) => I.value = !1,
|
|
310
|
+
onClick: ne
|
|
268
311
|
}, [
|
|
269
|
-
|
|
312
|
+
E.value ? (T(), l("span", {
|
|
270
313
|
key: 0,
|
|
271
314
|
class: y(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", a.disabled ? "opacity-38" : ""])
|
|
272
|
-
}, [
|
|
315
|
+
}, [O(e.$slots, "avatar")], 2)) : a.icon ? (T(), s(i, {
|
|
273
316
|
key: 1,
|
|
274
317
|
name: a.icon,
|
|
275
318
|
size: 18,
|
|
276
319
|
filled: a.type === "filter" && a.selected,
|
|
277
|
-
class: y(["shrink-0",
|
|
320
|
+
class: y(["shrink-0", te.value])
|
|
278
321
|
}, null, 8, [
|
|
279
322
|
"name",
|
|
280
323
|
"filled",
|
|
281
324
|
"class"
|
|
282
|
-
])) :
|
|
325
|
+
])) : z.value ? (T(), l("span", {
|
|
283
326
|
key: 2,
|
|
284
327
|
ref_key: "checkEl",
|
|
285
|
-
ref:
|
|
328
|
+
ref: R,
|
|
286
329
|
class: "-mr-2 flex shrink-0 overflow-hidden",
|
|
287
330
|
style: {
|
|
288
331
|
width: "8px",
|
|
@@ -292,56 +335,56 @@ var ne = /* @__PURE__ */ p({
|
|
|
292
335
|
}, [f(i, {
|
|
293
336
|
name: "check",
|
|
294
337
|
size: 18,
|
|
295
|
-
class: y(["shrink-0",
|
|
338
|
+
class: y(["shrink-0", te.value])
|
|
296
339
|
}, null, 8, ["class"])], 512)) : c("", !0),
|
|
297
|
-
u("span",
|
|
298
|
-
a.trailingIcon ? (
|
|
340
|
+
u("span", K, [O(e.$slots, "default")]),
|
|
341
|
+
a.trailingIcon ? (T(), s(i, {
|
|
299
342
|
key: 3,
|
|
300
343
|
name: a.trailingIcon,
|
|
301
344
|
size: 18,
|
|
302
|
-
class: y(["shrink-0", a.disabled ? "" : a.selected &&
|
|
345
|
+
class: y(["shrink-0", a.disabled ? "" : a.selected && w.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
303
346
|
}, null, 8, ["name", "class"])) : c("", !0)
|
|
304
|
-
], 42,
|
|
347
|
+
], 42, le), a.type === "input" && a.removable ? (T(), l("button", {
|
|
305
348
|
key: 0,
|
|
306
349
|
type: "button",
|
|
307
350
|
class: y(["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":
|
|
351
|
+
"aria-label": j(g).remove,
|
|
309
352
|
disabled: a.disabled,
|
|
310
|
-
onClick: t[4] ||=
|
|
353
|
+
onClick: t[4] ||= F((e) => h("remove"), ["stop"])
|
|
311
354
|
}, [f(i, {
|
|
312
355
|
name: "close",
|
|
313
356
|
size: 18
|
|
314
|
-
})], 10,
|
|
357
|
+
})], 10, ue)) : c("", !0)], 2)) : (T(), s(ee(a.clickable ? "button" : "span"), {
|
|
315
358
|
key: 1,
|
|
316
359
|
type: a.clickable ? "button" : void 0,
|
|
317
360
|
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
318
361
|
class: y(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
319
362
|
C.value,
|
|
320
363
|
S.value,
|
|
321
|
-
a.clickable && !a.disabled ?
|
|
364
|
+
a.clickable && !a.disabled ? fe : "",
|
|
322
365
|
a.disabled ? "cursor-not-allowed" : ""
|
|
323
366
|
]]),
|
|
324
367
|
style: b(x.value),
|
|
325
368
|
onClick: t[6] ||= (e) => a.clickable && !a.disabled && h("click")
|
|
326
369
|
}, {
|
|
327
|
-
default:
|
|
328
|
-
a.icon ? (
|
|
370
|
+
default: P(() => [
|
|
371
|
+
a.icon ? (T(), s(i, {
|
|
329
372
|
key: 0,
|
|
330
373
|
name: a.icon,
|
|
331
374
|
size: 18
|
|
332
375
|
}, null, 8, ["name"])) : c("", !0),
|
|
333
|
-
|
|
334
|
-
a.removable ? (
|
|
376
|
+
O(e.$slots, "default"),
|
|
377
|
+
a.removable ? (T(), l("button", {
|
|
335
378
|
key: 1,
|
|
336
379
|
type: "button",
|
|
337
380
|
class: "-mr-1 ml-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12",
|
|
338
|
-
"aria-label":
|
|
381
|
+
"aria-label": j(g).remove,
|
|
339
382
|
disabled: a.disabled,
|
|
340
|
-
onClick: t[5] ||=
|
|
383
|
+
onClick: t[5] ||= F((e) => h("remove"), ["stop"])
|
|
341
384
|
}, [f(i, {
|
|
342
385
|
name: "close",
|
|
343
386
|
size: 16
|
|
344
|
-
})], 8,
|
|
387
|
+
})], 8, de)) : c("", !0)
|
|
345
388
|
]),
|
|
346
389
|
_: 3
|
|
347
390
|
}, 8, [
|
|
@@ -354,7 +397,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
354
397
|
});
|
|
355
398
|
// src/composables/_useSegmentRuns.ts
|
|
356
399
|
function q(e) {
|
|
357
|
-
let t =
|
|
400
|
+
let t = k(/* @__PURE__ */ new Map());
|
|
358
401
|
function n() {
|
|
359
402
|
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
360
403
|
r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
|
|
@@ -363,12 +406,12 @@ function q(e) {
|
|
|
363
406
|
i(), t.value = n;
|
|
364
407
|
}
|
|
365
408
|
let r;
|
|
366
|
-
return
|
|
409
|
+
return S(() => {
|
|
367
410
|
n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
|
|
368
|
-
}),
|
|
411
|
+
}), C(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
|
|
369
412
|
}
|
|
370
413
|
// src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
371
|
-
var
|
|
414
|
+
var J = ["role"], Y = /* @__PURE__ */ p({
|
|
372
415
|
__name: "MList",
|
|
373
416
|
props: {
|
|
374
417
|
dense: {
|
|
@@ -396,8 +439,8 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
396
439
|
},
|
|
397
440
|
emits: ["update:selected"],
|
|
398
441
|
setup(e, { emit: t }) {
|
|
399
|
-
let n = e, r = t, i =
|
|
400
|
-
|
|
442
|
+
let n = e, r = t, i = D(), a = q(i);
|
|
443
|
+
E("m-list", {
|
|
401
444
|
segmentPosition: a,
|
|
402
445
|
dense: o(() => n.dense),
|
|
403
446
|
nav: o(() => n.nav),
|
|
@@ -421,24 +464,24 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
421
464
|
let e = s();
|
|
422
465
|
e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
|
|
423
466
|
}
|
|
424
|
-
|
|
467
|
+
S(u), w(() => v(u));
|
|
425
468
|
let d = o(() => [
|
|
426
469
|
"flex flex-col",
|
|
427
470
|
n.segmented ? "gap-0.5 p-2" : "py-2",
|
|
428
471
|
n.nav && !n.segmented && "gap-0.5 px-3"
|
|
429
472
|
]);
|
|
430
|
-
return (t, n) => (
|
|
473
|
+
return (t, n) => (T(), l("ul", {
|
|
431
474
|
ref_key: "listEl",
|
|
432
475
|
ref: i,
|
|
433
476
|
role: e.selectable ? "listbox" : "list",
|
|
434
477
|
class: y(d.value),
|
|
435
478
|
onKeydown: c
|
|
436
|
-
}, [
|
|
479
|
+
}, [O(t.$slots, "default")], 42, J));
|
|
437
480
|
}
|
|
438
|
-
}),
|
|
481
|
+
}), me = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], ge = {
|
|
439
482
|
key: 0,
|
|
440
483
|
class: "text-body-large text-on-surface"
|
|
441
|
-
}, X = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant",
|
|
484
|
+
}, X = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", _e = /* @__PURE__ */ p({
|
|
442
485
|
__name: "MSwitch",
|
|
443
486
|
props: {
|
|
444
487
|
modelValue: { type: Boolean },
|
|
@@ -475,7 +518,7 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
475
518
|
secondary: "bg-secondary",
|
|
476
519
|
tertiary: "bg-tertiary",
|
|
477
520
|
error: "bg-error"
|
|
478
|
-
}, g =
|
|
521
|
+
}, g = D(!1);
|
|
479
522
|
function _() {
|
|
480
523
|
n.disabled || (g.value = !0);
|
|
481
524
|
}
|
|
@@ -489,26 +532,26 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
489
532
|
transform: `translateX(${n.modelValue ? 18 : 0}px)`,
|
|
490
533
|
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)"
|
|
491
534
|
}));
|
|
492
|
-
return (t, n) => (
|
|
535
|
+
return (t, n) => (T(), l("label", {
|
|
493
536
|
class: y(["group inline-flex items-center gap-3 select-none", e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer"]),
|
|
494
537
|
onPointerdown: _,
|
|
495
538
|
onPointerup: v,
|
|
496
539
|
onPointerleave: v,
|
|
497
540
|
onPointercancel: v
|
|
498
|
-
}, [u("span",
|
|
541
|
+
}, [u("span", me, [u("span", { class: y(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? d[e.color] : "border-outline bg-surface-container-highest"]) }, [
|
|
499
542
|
u("input", {
|
|
500
543
|
type: "checkbox",
|
|
501
544
|
class: "peer sr-only",
|
|
502
545
|
checked: e.modelValue,
|
|
503
546
|
disabled: e.disabled,
|
|
504
547
|
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
505
|
-
}, null, 40,
|
|
506
|
-
e.disabled ? c("", !0) : (
|
|
548
|
+
}, null, 40, he),
|
|
549
|
+
e.disabled ? c("", !0) : (T(), l("span", {
|
|
507
550
|
key: 0,
|
|
508
551
|
class: y(["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"]),
|
|
509
552
|
style: b(C.value)
|
|
510
553
|
}, null, 6)),
|
|
511
|
-
e.disabled ? c("", !0) : (
|
|
554
|
+
e.disabled ? c("", !0) : (T(), l("span", {
|
|
512
555
|
key: 1,
|
|
513
556
|
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",
|
|
514
557
|
style: b(C.value)
|
|
@@ -524,7 +567,7 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
524
567
|
"leave-from-class": "opacity-100",
|
|
525
568
|
"leave-to-class": "opacity-0"
|
|
526
569
|
}, {
|
|
527
|
-
default:
|
|
570
|
+
default: P(() => [e.modelValue && e.icon ? (T(), s(i, {
|
|
528
571
|
key: 0,
|
|
529
572
|
name: "check",
|
|
530
573
|
size: 14,
|
|
@@ -532,14 +575,14 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
532
575
|
}, null, 8, ["class"])) : c("", !0)]),
|
|
533
576
|
_: 1
|
|
534
577
|
})], 6)
|
|
535
|
-
], 2)]), e.label ? (
|
|
578
|
+
], 2)]), e.label ? (T(), l("span", ge, A(e.label), 1)) : c("", !0)], 34));
|
|
536
579
|
}
|
|
537
|
-
}),
|
|
580
|
+
}), ve = [
|
|
538
581
|
"tabindex",
|
|
539
582
|
"aria-expanded",
|
|
540
583
|
"aria-controls",
|
|
541
584
|
"aria-disabled"
|
|
542
|
-
],
|
|
585
|
+
], ye = { class: "min-w-0 flex-1" }, be = ["id"], xe = ["src"], Se = { class: "min-w-0 flex-1" }, Ce = 4, we = 8, Te = 16, Ee = "button, a, input, select, textarea, label, [role=\"button\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"link\"], [tabindex]", Z = /* @__PURE__ */ p({
|
|
543
586
|
inheritAttrs: !1,
|
|
544
587
|
__name: "MListItem",
|
|
545
588
|
props: {
|
|
@@ -582,79 +625,79 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
582
625
|
"update:expanded"
|
|
583
626
|
],
|
|
584
627
|
setup(e, { emit: t }) {
|
|
585
|
-
let n = e, d = t, p = m(), v = () => !!p?.vnode.props?.onClick, x =
|
|
586
|
-
|
|
628
|
+
let n = e, d = t, p = m(), v = () => !!p?.vnode.props?.onClick, x = D(n.expanded ?? !1);
|
|
629
|
+
N(() => n.expanded, (e) => {
|
|
587
630
|
e !== void 0 && (x.value = e);
|
|
588
631
|
});
|
|
589
|
-
let S = o(() => x.value), C = g("m-list", null),
|
|
590
|
-
if (
|
|
632
|
+
let S = o(() => x.value), C = g("m-list", null), w = o(() => n.lines ? n.lines : C?.lines.value ? C.lines.value : n.description || n.overline && n.subtitle ? 3 : n.subtitle || n.overline ? 2 : 1), E = o(() => n.clickable || n.href || n.to || v() || C?.selectable.value || n.expandable), k = o(() => !!C?.selectable.value && n.value != null && !n.href && !n.to && !n.expandable), M = o(() => !!(n.href || n.to)), F = o(() => !k.value && !M.value && !n.expandable && (n.clickable || v())), I = o(() => M.value || F.value), L = o(() => k.value ? "option" : F.value ? "button" : M.value ? void 0 : "listitem"), R = o(() => {
|
|
633
|
+
if (k.value) return B.value && !n.disabled ? 0 : -1;
|
|
591
634
|
if (F.value) return n.disabled ? -1 : 0;
|
|
592
635
|
});
|
|
593
|
-
function
|
|
594
|
-
(
|
|
636
|
+
function ne(e) {
|
|
637
|
+
(k.value || F.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), $(e)));
|
|
595
638
|
}
|
|
596
|
-
let
|
|
639
|
+
let B = o(() => n.active ? !0 : C?.selectable.value && n.value != null ? C.selected.value === n.value : !1), V = o(() => n.leading ? n.leading : n.icon ? "icon" : n.avatarName ? "avatar" : n.image ? "image" : null), H = o(() => n.expandable ? "expand" : n.trailing ? n.trailing : n.trailingIcon ? "icon" : n.trailingText ? "text" : null), re = {
|
|
597
640
|
primary: "bg-primary-container text-on-primary-container",
|
|
598
641
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
599
642
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
600
643
|
error: "bg-error-container text-on-error-container",
|
|
601
644
|
success: "bg-success-container text-on-success-container"
|
|
602
|
-
},
|
|
645
|
+
}, U = o(() => C?.dense.value ?? !1), W = o(() => C?.nav.value ?? !1), ie = o(() => C?.segmented.value ?? !1), ae = o(() => C?.dividers.value ?? !1), oe = o(() => B.value ? "text-on-secondary-container" : "text-on-surface"), G = o(() => B.value ? "text-on-secondary-container" : "text-on-surface-variant"), se = o(() => U.value ? "" : w.value === 3 ? "min-h-22" : w.value === 2 ? "min-h-18" : "min-h-14"), le = o(() => [
|
|
603
646
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
647
|
+
ie.value ? "bg-surface-container px-4" : W.value ? "rounded-full px-4" : "px-4",
|
|
648
|
+
U.value ? "py-1" : w.value === 3 ? "py-3" : "py-2",
|
|
649
|
+
se.value,
|
|
650
|
+
E.value && !n.disabled && "cursor-pointer",
|
|
651
|
+
B.value && "bg-secondary-container text-on-secondary-container",
|
|
609
652
|
n.disabled && "opacity-[0.38] pointer-events-none"
|
|
610
|
-
]), K =
|
|
653
|
+
]), K = D(null), ue = D(null), de = (e, { slots: t }) => I.value ? h("li", {
|
|
611
654
|
role: "listitem",
|
|
612
655
|
ref: (e) => {
|
|
613
|
-
|
|
656
|
+
ue.value = e;
|
|
614
657
|
}
|
|
615
|
-
}, t.default?.()) : t.default?.(),
|
|
616
|
-
if (
|
|
617
|
-
let e =
|
|
658
|
+
}, t.default?.()) : t.default?.(), fe = D(null), pe = (e) => e && "$el" in e ? e.$el : e, q = D(!1), J = D(!1), Y = D(!1), me = o(() => ie.value ? C?.segmentPosition(I.value ? ue.value : pe(K.value)) : void 0), he = o(() => {
|
|
659
|
+
if (W.value) return [];
|
|
660
|
+
let e = E.value && !n.disabled, t = e && J.value || B.value || e && Y.value ? Te : e && q.value ? we : null;
|
|
618
661
|
if (t !== null) return [
|
|
619
662
|
t,
|
|
620
663
|
t,
|
|
621
664
|
t,
|
|
622
665
|
t
|
|
623
666
|
];
|
|
624
|
-
let r =
|
|
667
|
+
let r = me.value, i = r === "first" || r === "single" ? Te : Ce, a = r === "last" || r === "single" ? Te : Ce;
|
|
625
668
|
return [
|
|
626
669
|
i,
|
|
627
670
|
i,
|
|
628
671
|
a,
|
|
629
672
|
a
|
|
630
673
|
];
|
|
631
|
-
}), { snap:
|
|
632
|
-
let t =
|
|
674
|
+
}), { snap: ge } = r(() => he.value, (e) => {
|
|
675
|
+
let t = fe.value ?? pe(K.value);
|
|
633
676
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
634
677
|
});
|
|
635
|
-
|
|
636
|
-
function
|
|
637
|
-
let t = e.currentTarget, n = e.target?.closest?.(
|
|
678
|
+
N([me, W], () => ge());
|
|
679
|
+
function X(e) {
|
|
680
|
+
let t = e.currentTarget, n = e.target?.closest?.(Ee);
|
|
638
681
|
return !!n && n !== t && t.contains(n) && !n.closest("[data-mli-part]");
|
|
639
682
|
}
|
|
640
683
|
function Z(e) {
|
|
641
|
-
e.pointerType !== "touch" && (
|
|
684
|
+
e.pointerType !== "touch" && (q.value = !X(e));
|
|
642
685
|
}
|
|
643
686
|
function De() {
|
|
644
|
-
|
|
687
|
+
q.value = !1, J.value = !1;
|
|
645
688
|
}
|
|
646
689
|
function Oe(e) {
|
|
647
|
-
e.button === 0 && !
|
|
690
|
+
e.button === 0 && !X(e) && (J.value = !0);
|
|
648
691
|
}
|
|
649
692
|
function Q() {
|
|
650
|
-
|
|
693
|
+
J.value = !1;
|
|
651
694
|
}
|
|
652
|
-
let ke = o(() => !
|
|
695
|
+
let ke = o(() => !E.value || n.disabled ? 0 : J.value ? .12 : q.value ? .08 : 0), Ae = o(() => n.indent === void 0 ? void 0 : { paddingLeft: typeof n.indent == "number" ? `${n.indent}px` : n.indent });
|
|
653
696
|
function je(e) {
|
|
654
|
-
|
|
697
|
+
Y.value = e.currentTarget.matches(":focus-visible");
|
|
655
698
|
}
|
|
656
699
|
function Me() {
|
|
657
|
-
|
|
700
|
+
Y.value = !1;
|
|
658
701
|
}
|
|
659
702
|
let Ne = o(() => n.href ? "a" : n.to ? "router-link" : F.value ? "div" : "li"), Pe = o(() => n.href ? { href: n.href } : n.to ? { to: n.to } : {}), Fe = te();
|
|
660
703
|
function Ie(e) {
|
|
@@ -666,7 +709,7 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
666
709
|
function $(e) {
|
|
667
710
|
if (!n.disabled) {
|
|
668
711
|
if (n.expandable) {
|
|
669
|
-
if (
|
|
712
|
+
if (X(e)) return;
|
|
670
713
|
Le(e);
|
|
671
714
|
} else C?.selectable.value && n.value != null && C.select(n.value), d("click", e);
|
|
672
715
|
}
|
|
@@ -674,17 +717,17 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
674
717
|
function Re() {
|
|
675
718
|
d("update:trailingValue", !n.trailingValue);
|
|
676
719
|
}
|
|
677
|
-
return (t, n) => e.expandable ? (
|
|
720
|
+
return (t, n) => e.expandable ? (T(), l("li", _({
|
|
678
721
|
key: 0,
|
|
679
722
|
ref_key: "rootEl",
|
|
680
723
|
ref: K
|
|
681
724
|
}, t.$attrs, { role: "listitem" }), [u("div", {
|
|
682
725
|
ref_key: "shapeEl",
|
|
683
|
-
ref:
|
|
726
|
+
ref: fe,
|
|
684
727
|
role: "button",
|
|
685
728
|
tabindex: e.disabled ? -1 : 0,
|
|
686
729
|
"aria-expanded": S.value,
|
|
687
|
-
"aria-controls":
|
|
730
|
+
"aria-controls": j(Fe),
|
|
688
731
|
"aria-disabled": e.disabled || void 0,
|
|
689
732
|
class: y(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", le.value]),
|
|
690
733
|
onClick: $,
|
|
@@ -699,41 +742,41 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
699
742
|
onPointercancel: Q
|
|
700
743
|
}, [
|
|
701
744
|
u("span", {
|
|
702
|
-
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
745
|
+
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
703
746
|
style: b({ opacity: ke.value }),
|
|
704
747
|
"aria-hidden": "true"
|
|
705
748
|
}, null, 6),
|
|
706
|
-
|
|
749
|
+
O(t.$slots, "leading", {}, () => [V.value === "icon" ? (T(), s(i, {
|
|
707
750
|
key: 0,
|
|
708
751
|
name: e.icon,
|
|
709
752
|
size: 24,
|
|
710
753
|
class: y(["shrink-0", G.value])
|
|
711
754
|
}, null, 8, ["name", "class"])) : c("", !0)]),
|
|
712
|
-
u("div",
|
|
755
|
+
u("div", ye, [O(t.$slots, "overline", {}, () => [e.overline ? (T(), l("p", {
|
|
713
756
|
key: 0,
|
|
714
757
|
class: y(["truncate text-label-small", G.value])
|
|
715
|
-
},
|
|
758
|
+
}, A(e.overline), 3)) : c("", !0)]), O(t.$slots, "default", {}, () => [u("p", { class: y(["truncate text-body-large", oe.value]) }, A(e.title), 3), e.subtitle && w.value >= 2 ? (T(), l("p", {
|
|
716
759
|
key: 0,
|
|
717
|
-
class: y(["text-body-medium", [G.value,
|
|
718
|
-
},
|
|
719
|
-
|
|
760
|
+
class: y(["text-body-medium", [G.value, w.value === 2 && "truncate"]])
|
|
761
|
+
}, A(e.subtitle), 3)) : c("", !0)])]),
|
|
762
|
+
O(t.$slots, "trailing"),
|
|
720
763
|
f(i, {
|
|
721
764
|
name: S.value ? "expand_less" : "expand_more",
|
|
722
765
|
size: 20,
|
|
723
766
|
class: y(["shrink-0", G.value])
|
|
724
767
|
}, null, 8, ["name", "class"])
|
|
725
|
-
], 42,
|
|
726
|
-
default:
|
|
768
|
+
], 42, ve), f(a, { name: "mli-expand" }, {
|
|
769
|
+
default: P(() => [S.value ? (T(), l("div", {
|
|
727
770
|
key: 0,
|
|
728
|
-
id:
|
|
771
|
+
id: j(Fe),
|
|
729
772
|
class: "mli-expand-grid"
|
|
730
773
|
}, [u("div", {
|
|
731
774
|
class: "mli-expand-body",
|
|
732
775
|
style: b(Ae.value)
|
|
733
|
-
}, [
|
|
776
|
+
}, [O(t.$slots, "children")], 4)], 8, be)) : c("", !0)]),
|
|
734
777
|
_: 3
|
|
735
|
-
})], 16)) : (
|
|
736
|
-
default:
|
|
778
|
+
})], 16)) : (T(), s(de, { key: 1 }, {
|
|
779
|
+
default: P(() => [(T(), s(ee(Ne.value), _({
|
|
737
780
|
class: le.value,
|
|
738
781
|
ref_key: "rootEl",
|
|
739
782
|
ref: K
|
|
@@ -743,10 +786,10 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
743
786
|
}, {
|
|
744
787
|
role: L.value,
|
|
745
788
|
tabindex: R.value,
|
|
746
|
-
"aria-selected":
|
|
747
|
-
"aria-disabled": (
|
|
789
|
+
"aria-selected": k.value ? B.value : void 0,
|
|
790
|
+
"aria-disabled": (k.value || F.value) && e.disabled ? "true" : void 0,
|
|
748
791
|
onClick: $,
|
|
749
|
-
onKeydown:
|
|
792
|
+
onKeydown: ne,
|
|
750
793
|
onPointerenter: Z,
|
|
751
794
|
onPointermove: Z,
|
|
752
795
|
onPointerleave: De,
|
|
@@ -756,70 +799,70 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
756
799
|
onFocus: je,
|
|
757
800
|
onBlur: Me
|
|
758
801
|
}), {
|
|
759
|
-
default:
|
|
802
|
+
default: P(() => [
|
|
760
803
|
u("span", {
|
|
761
|
-
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]",
|
|
804
|
+
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
762
805
|
style: b({ opacity: ke.value }),
|
|
763
806
|
"aria-hidden": "true"
|
|
764
807
|
}, null, 6),
|
|
765
|
-
|
|
808
|
+
ae.value ? (T(), l("div", {
|
|
766
809
|
key: 0,
|
|
767
|
-
class: y(["absolute top-0 right-0 h-px bg-outline-variant",
|
|
810
|
+
class: y(["absolute top-0 right-0 h-px bg-outline-variant", ae.value === "inset" ? "left-16" : "left-0"])
|
|
768
811
|
}, null, 2)) : c("", !0),
|
|
769
|
-
|
|
812
|
+
O(t.$slots, "leading", {}, () => [V.value === "icon" ? (T(), s(i, {
|
|
770
813
|
key: 0,
|
|
771
814
|
name: e.icon,
|
|
772
815
|
size: 24,
|
|
773
816
|
class: y(["shrink-0", G.value])
|
|
774
|
-
}, null, 8, ["name", "class"])) :
|
|
817
|
+
}, null, 8, ["name", "class"])) : V.value === "icon-container" ? (T(), l("div", {
|
|
775
818
|
key: 1,
|
|
776
|
-
class: y(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full",
|
|
819
|
+
class: y(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", re[e.iconContainerColor || "primary"]])
|
|
777
820
|
}, [f(i, {
|
|
778
821
|
name: e.icon,
|
|
779
822
|
size: 24
|
|
780
|
-
}, null, 8, ["name"])], 2)) :
|
|
823
|
+
}, null, 8, ["name"])], 2)) : V.value === "avatar" ? (T(), s(z, {
|
|
781
824
|
key: 2,
|
|
782
825
|
name: e.avatarName,
|
|
783
826
|
size: 40,
|
|
784
827
|
class: "shrink-0"
|
|
785
|
-
}, null, 8, ["name"])) :
|
|
828
|
+
}, null, 8, ["name"])) : V.value === "image" ? (T(), l("img", {
|
|
786
829
|
key: 3,
|
|
787
830
|
src: e.image,
|
|
788
831
|
alt: "",
|
|
789
832
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
790
|
-
}, null, 8,
|
|
833
|
+
}, null, 8, xe)) : V.value === "checkbox" ? (T(), s(ce, {
|
|
791
834
|
key: 4,
|
|
792
|
-
"model-value":
|
|
835
|
+
"model-value": B.value,
|
|
793
836
|
class: "shrink-0",
|
|
794
837
|
"data-mli-part": ""
|
|
795
838
|
}, null, 8, ["model-value"])) : c("", !0)]),
|
|
796
|
-
u("div",
|
|
839
|
+
u("div", Se, [O(t.$slots, "overline", {}, () => [e.overline ? (T(), l("p", {
|
|
797
840
|
key: 0,
|
|
798
841
|
class: y(["truncate text-label-small", G.value])
|
|
799
|
-
},
|
|
800
|
-
u("p", { class: y(["truncate text-body-large",
|
|
801
|
-
e.subtitle &&
|
|
842
|
+
}, A(e.overline), 3)) : c("", !0)]), O(t.$slots, "default", {}, () => [
|
|
843
|
+
u("p", { class: y(["truncate text-body-large", oe.value]) }, A(e.title), 3),
|
|
844
|
+
e.subtitle && w.value >= 2 ? (T(), l("p", {
|
|
802
845
|
key: 0,
|
|
803
|
-
class: y(["text-body-medium", [G.value,
|
|
804
|
-
},
|
|
805
|
-
e.description &&
|
|
846
|
+
class: y(["text-body-medium", [G.value, w.value === 2 && "truncate"]])
|
|
847
|
+
}, A(e.subtitle), 3)) : c("", !0),
|
|
848
|
+
e.description && w.value >= 3 ? (T(), l("p", {
|
|
806
849
|
key: 1,
|
|
807
850
|
class: y(["line-clamp-2 text-body-small", G.value])
|
|
808
|
-
},
|
|
851
|
+
}, A(e.description), 3)) : c("", !0)
|
|
809
852
|
])]),
|
|
810
|
-
|
|
853
|
+
O(t.$slots, "trailing", {}, () => [H.value === "icon" ? (T(), s(i, {
|
|
811
854
|
key: 0,
|
|
812
855
|
name: e.trailingIcon,
|
|
813
856
|
size: 24,
|
|
814
857
|
class: y(["shrink-0", G.value])
|
|
815
|
-
}, null, 8, ["name", "class"])) :
|
|
858
|
+
}, null, 8, ["name", "class"])) : H.value === "text" ? (T(), l("span", {
|
|
816
859
|
key: 1,
|
|
817
860
|
class: y(["shrink-0 text-label-small", G.value])
|
|
818
|
-
},
|
|
861
|
+
}, A(e.trailingText), 3)) : H.value === "switch" ? (T(), s(_e, {
|
|
819
862
|
key: 2,
|
|
820
863
|
"model-value": !!e.trailingValue,
|
|
821
864
|
"onUpdate:modelValue": Re
|
|
822
|
-
}, null, 8, ["model-value"])) :
|
|
865
|
+
}, null, 8, ["model-value"])) : H.value === "checkbox" ? (T(), s(ce, {
|
|
823
866
|
key: 3,
|
|
824
867
|
"model-value": !!e.trailingValue,
|
|
825
868
|
"onUpdate:modelValue": Re
|
|
@@ -837,6 +880,6 @@ var ue = ["role"], de = /* @__PURE__ */ p({
|
|
|
837
880
|
}));
|
|
838
881
|
}
|
|
839
882
|
});
|
|
840
|
-
export {
|
|
883
|
+
export { pe as a, z as c, q as i, R as l, _e as n, ce as o, Y as r, ae as s, Z as t };
|
|
841
884
|
|
|
842
|
-
//# sourceMappingURL=MListItem-
|
|
885
|
+
//# sourceMappingURL=MListItem-D2cNUyzP.js.map
|