@m3ui-vue/m3ui-vue 1.4.1 → 1.4.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 +251 -9
- package/dist/{MButton-DQMTIlaV.js → MButton-D7M324r9.js} +2 -2
- package/dist/{MButton-DQMTIlaV.js.map → MButton-D7M324r9.js.map} +1 -1
- package/dist/{MDialog-cdgapGfZ.js → MDialog-DuOnNF9s.js} +2 -2
- package/dist/{MDialog-cdgapGfZ.js.map → MDialog-DuOnNF9s.js.map} +1 -1
- package/dist/{MListItem-ZkSGIIrb.js → MListItem-Bb84X6ex.js} +144 -120
- package/dist/{MListItem-ZkSGIIrb.js.map → MListItem-Bb84X6ex.js.map} +1 -1
- package/dist/{MLoadingIndicator-U6_oGx8z.js → MLoadingIndicator-BUGRo2Tu.js} +2 -2
- package/dist/{MLoadingIndicator-U6_oGx8z.js.map → MLoadingIndicator-BUGRo2Tu.js.map} +1 -1
- package/dist/{MSeekBar-DTZVizZg.js → MSeekBar-BQUvUqb9.js} +2 -2
- package/dist/{MSeekBar-DTZVizZg.js.map → MSeekBar-BQUvUqb9.js.map} +1 -1
- package/dist/{MSlider-CqJkEYRZ.js → MSlider-SFdjE1Hy.js} +2 -2
- package/dist/{MSlider-CqJkEYRZ.js.map → MSlider-SFdjE1Hy.js.map} +1 -1
- package/dist/{MSpinner-Btgc-0nb.js → MSpinner-DKGNN64_.js} +2 -2
- package/dist/{MSpinner-Btgc-0nb.js.map → MSpinner-DKGNN64_.js.map} +1 -1
- package/dist/{MTextField-B6M0gJEO.js → MTextField-Utsef6Kk.js} +2 -2
- package/dist/{MTextField-B6M0gJEO.js.map → MTextField-Utsef6Kk.js.map} +1 -1
- package/dist/{MTooltip-Dspji4XG.js → MTooltip-BhTFQ9Z2.js} +4 -4
- package/dist/{MTooltip-Dspji4XG.js.map → MTooltip-BhTFQ9Z2.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +120 -0
- package/dist/components/MDatePicker.vue.d.ts +5 -0
- package/dist/components/MDatePickerModal.vue.d.ts +5 -0
- package/dist/components/MDateRangePicker.vue.d.ts +5 -0
- package/dist/components/MDateRangePickerModal.vue.d.ts +5 -0
- package/dist/components/MLightbox.vue.d.ts +1 -1
- package/dist/components/MListItem.vue.d.ts +10 -6
- package/dist/components/MMeterGroup.vue.d.ts +98 -0
- package/dist/components/MPhoneInput.vue.d.ts +72 -0
- package/dist/components/MSeekBar.vue.d.ts +1 -1
- package/dist/components/MTreeTable.vue.d.ts +1 -1
- package/dist/components/MTypewriter.vue.d.ts +57 -0
- package/dist/components/MVideoPlayer.vue.d.ts +1 -1
- package/dist/components/_MMonthYearButton.vue.d.ts +16 -0
- package/dist/components/_MYearGrid.vue.d.ts +19 -0
- package/dist/composables/_useCalendarMonth.d.ts +7 -0
- package/dist/composables/phoneNumber.d.ts +39 -0
- package/dist/composables/useLocale.d.ts +18 -0
- package/dist/data/phone-countries.d.ts +2 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/locales/index.js +63 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3615 -1999
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +5 -5
- package/dist/media.js +4 -4
- package/dist/pdf.js +4 -4
- package/dist/rich-text-editor.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/{useLocale-DLKJIRFi.js → useLocale-B8YKWg-H.js} +10 -1
- package/dist/useLocale-B8YKWg-H.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MCalendarHeatmap.test.ts +79 -0
- package/src/__tests__/MListItemNestedControl.test.ts +88 -0
- package/src/__tests__/MMeterGroup.test.ts +43 -0
- package/src/__tests__/MPhoneInput.test.ts +97 -0
- package/src/__tests__/MTypewriter.test.ts +50 -0
- package/src/__tests__/calendarMonth.test.ts +104 -0
- package/src/__tests__/ssr.test.ts +4 -0
- package/src/components/MCalendarHeatmap.vue +349 -0
- package/src/components/MDatePicker.vue +74 -34
- package/src/components/MDatePickerModal.vue +79 -36
- package/src/components/MDateRangePicker.vue +73 -33
- package/src/components/MDateRangePickerModal.vue +75 -35
- package/src/components/MListItem.vue +54 -8
- package/src/components/MMeterGroup.vue +196 -0
- package/src/components/MPhoneInput.vue +480 -0
- package/src/components/MTypewriter.vue +195 -0
- package/src/components/_MMonthYearButton.vue +36 -0
- package/src/components/_MYearGrid.vue +106 -0
- package/src/composables/_useCalendarMonth.ts +32 -2
- package/src/composables/phoneNumber.ts +137 -0
- package/src/composables/useLocale.ts +27 -0
- package/src/data/phone-countries.ts +62 -0
- package/src/index.ts +8 -0
- package/src/locales/de.ts +9 -0
- package/src/locales/es.ts +9 -0
- package/src/locales/fr.ts +9 -0
- package/src/locales/ja.ts +9 -0
- package/src/locales/ko.ts +9 -0
- package/src/locales/pt.ts +9 -0
- package/src/locales/zh.ts +9 -0
- package/dist/useLocale-DLKJIRFi.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-B8YKWg-H.js";
|
|
2
2
|
import { a as t, i as n, s as r } from "./MIconButton-DoNotQ9v.js";
|
|
3
3
|
import { t as i } from "./MIcon-Bxh9j135.js";
|
|
4
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, onMounted as x, onUnmounted as S, onUpdated as C, openBlock as w, provide as T, ref as E, renderSlot as D, resolveDynamicComponent as ee, shallowRef as O, toDisplayString as k, unref as A, useId as te, useSlots as j, watch as M, withCtx as N, withModifiers as P } from "vue";
|
|
@@ -38,13 +38,13 @@ var ne = /* @__PURE__ */ p({
|
|
|
38
38
|
}, R = {
|
|
39
39
|
key: 2,
|
|
40
40
|
class: "px-4 pt-4 pb-2"
|
|
41
|
-
},
|
|
41
|
+
}, re = { class: "text-title-large font-medium text-on-surface" }, z = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
44
|
-
},
|
|
44
|
+
}, B = {
|
|
45
45
|
key: 3,
|
|
46
46
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
47
|
-
},
|
|
47
|
+
}, V = "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]", ie = /* @__PURE__ */ p({
|
|
48
48
|
__name: "MCard",
|
|
49
49
|
props: {
|
|
50
50
|
variant: { default: "elevated" },
|
|
@@ -93,7 +93,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
93
93
|
s.value ? [
|
|
94
94
|
"cursor-pointer",
|
|
95
95
|
a[n.value],
|
|
96
|
-
|
|
96
|
+
V
|
|
97
97
|
] : "",
|
|
98
98
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
99
99
|
]]),
|
|
@@ -112,19 +112,19 @@ var ne = /* @__PURE__ */ p({
|
|
|
112
112
|
alt: e.imageAlt ?? "",
|
|
113
113
|
class: "h-full w-full object-cover"
|
|
114
114
|
}, null, 8, I)) : D(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : c("", !0),
|
|
115
|
-
t.$slots.header ? (w(), l("div", L, [D(t.$slots, "header")])) : e.title ? (w(), l("div", R, [u("h3",
|
|
115
|
+
t.$slots.header ? (w(), l("div", L, [D(t.$slots, "header")])) : e.title ? (w(), l("div", R, [u("h3", re, k(e.title), 1), e.subtitle ? (w(), l("p", z, k(e.subtitle), 1)) : c("", !0)])) : c("", !0),
|
|
116
116
|
D(t.$slots, "default"),
|
|
117
|
-
t.$slots.actions ? (w(), l("div",
|
|
117
|
+
t.$slots.actions ? (w(), l("div", B, [D(t.$slots, "actions")])) : c("", !0)
|
|
118
118
|
], 46, F));
|
|
119
119
|
}
|
|
120
|
-
}), H = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" },
|
|
120
|
+
}), H = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, U = [
|
|
121
121
|
"checked",
|
|
122
122
|
"disabled",
|
|
123
123
|
"aria-label"
|
|
124
|
-
],
|
|
124
|
+
], W = {
|
|
125
125
|
key: 1,
|
|
126
126
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
127
|
-
},
|
|
127
|
+
}, ae = /* @__PURE__ */ p({
|
|
128
128
|
__name: "MCheckbox",
|
|
129
129
|
props: {
|
|
130
130
|
modelValue: { type: Boolean },
|
|
@@ -161,12 +161,12 @@ var ne = /* @__PURE__ */ p({
|
|
|
161
161
|
disabled: e.disabled,
|
|
162
162
|
"aria-label": e.ariaLabel,
|
|
163
163
|
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
164
|
-
}, null, 40,
|
|
164
|
+
}, null, 40, U),
|
|
165
165
|
e.disabled ? c("", !0) : (w(), l("span", {
|
|
166
166
|
key: 0,
|
|
167
167
|
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"])
|
|
168
168
|
}, null, 2)),
|
|
169
|
-
e.disabled ? c("", !0) : (w(), l("span",
|
|
169
|
+
e.disabled ? c("", !0) : (w(), l("span", W)),
|
|
170
170
|
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, {
|
|
171
171
|
name: e.indeterminate ? "remove" : "check",
|
|
172
172
|
size: 18,
|
|
@@ -177,7 +177,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
177
177
|
class: y(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
178
178
|
}, [D(t.$slots, "default", {}, () => [d(k(e.label), 1)])], 2)) : c("", !0)], 2));
|
|
179
179
|
}
|
|
180
|
-
}),
|
|
180
|
+
}), oe = ["disabled", "aria-pressed"], se = { class: "whitespace-nowrap" }, G = ["aria-label", "disabled"], ce = ["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", K = /* @__PURE__ */ p({
|
|
181
181
|
__name: "MChip",
|
|
182
182
|
props: {
|
|
183
183
|
tone: { default: "neutral" },
|
|
@@ -248,7 +248,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
248
248
|
}, t), r(() => R.value ? [+!!m.selected] : [], ([e]) => {
|
|
249
249
|
L.value && e !== void 0 && (L.value.style.opacity = String(e));
|
|
250
250
|
}, n);
|
|
251
|
-
function
|
|
251
|
+
function re() {
|
|
252
252
|
m.disabled || (T.value && h("update:selected", !m.selected), h("click"));
|
|
253
253
|
}
|
|
254
254
|
return (e, t) => a.type ? (w(), l("span", {
|
|
@@ -265,7 +265,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
265
265
|
onPointerup: t[1] ||= (e) => F.value = !1,
|
|
266
266
|
onPointerleave: t[2] ||= (e) => F.value = !1,
|
|
267
267
|
onPointercancel: t[3] ||= (e) => F.value = !1,
|
|
268
|
-
onClick:
|
|
268
|
+
onClick: re
|
|
269
269
|
}, [
|
|
270
270
|
O.value ? (w(), l("span", {
|
|
271
271
|
key: 0,
|
|
@@ -295,14 +295,14 @@ var ne = /* @__PURE__ */ p({
|
|
|
295
295
|
size: 18,
|
|
296
296
|
class: y(["shrink-0", M.value])
|
|
297
297
|
}, null, 8, ["class"])], 512)) : c("", !0),
|
|
298
|
-
u("span",
|
|
298
|
+
u("span", se, [D(e.$slots, "default")]),
|
|
299
299
|
a.trailingIcon ? (w(), s(i, {
|
|
300
300
|
key: 3,
|
|
301
301
|
name: a.trailingIcon,
|
|
302
302
|
size: 18,
|
|
303
303
|
class: y(["shrink-0", a.disabled ? "" : a.selected && T.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
304
304
|
}, null, 8, ["name", "class"])) : c("", !0)
|
|
305
|
-
], 42,
|
|
305
|
+
], 42, oe), a.type === "input" && a.removable ? (w(), l("button", {
|
|
306
306
|
key: 0,
|
|
307
307
|
type: "button",
|
|
308
308
|
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"]),
|
|
@@ -312,14 +312,14 @@ var ne = /* @__PURE__ */ p({
|
|
|
312
312
|
}, [f(i, {
|
|
313
313
|
name: "close",
|
|
314
314
|
size: 18
|
|
315
|
-
})], 10,
|
|
315
|
+
})], 10, G)) : c("", !0)], 2)) : (w(), s(ee(a.clickable ? "button" : "span"), {
|
|
316
316
|
key: 1,
|
|
317
317
|
type: a.clickable ? "button" : void 0,
|
|
318
318
|
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
319
319
|
class: y(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
320
320
|
C.value,
|
|
321
321
|
S.value,
|
|
322
|
-
a.clickable && !a.disabled ?
|
|
322
|
+
a.clickable && !a.disabled ? le : "",
|
|
323
323
|
a.disabled ? "cursor-not-allowed" : ""
|
|
324
324
|
]]),
|
|
325
325
|
style: b(x.value),
|
|
@@ -342,7 +342,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
342
342
|
}, [f(i, {
|
|
343
343
|
name: "close",
|
|
344
344
|
size: 16
|
|
345
|
-
})], 8,
|
|
345
|
+
})], 8, ce)) : c("", !0)
|
|
346
346
|
]),
|
|
347
347
|
_: 3
|
|
348
348
|
}, 8, [
|
|
@@ -355,7 +355,7 @@ var ne = /* @__PURE__ */ p({
|
|
|
355
355
|
});
|
|
356
356
|
//#endregion
|
|
357
357
|
//#region src/composables/_useSegmentRuns.ts
|
|
358
|
-
function
|
|
358
|
+
function q(e) {
|
|
359
359
|
let t = O(/* @__PURE__ */ new Map());
|
|
360
360
|
function n() {
|
|
361
361
|
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
@@ -371,7 +371,7 @@ function ce(e) {
|
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
373
|
//#region src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
-
var
|
|
374
|
+
var ue = ["role"], de = /* @__PURE__ */ p({
|
|
375
375
|
__name: "MList",
|
|
376
376
|
props: {
|
|
377
377
|
dense: {
|
|
@@ -399,7 +399,7 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
399
399
|
},
|
|
400
400
|
emits: ["update:selected"],
|
|
401
401
|
setup(e, { emit: t }) {
|
|
402
|
-
let n = e, r = t, i = E(), a =
|
|
402
|
+
let n = e, r = t, i = E(), a = q(i);
|
|
403
403
|
T("m-list", {
|
|
404
404
|
segmentPosition: a,
|
|
405
405
|
dense: o(() => n.dense),
|
|
@@ -436,12 +436,12 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
436
436
|
role: e.selectable ? "listbox" : "list",
|
|
437
437
|
class: y(d.value),
|
|
438
438
|
onKeydown: c
|
|
439
|
-
}, [D(t.$slots, "default")], 42,
|
|
439
|
+
}, [D(t.$slots, "default")], 42, ue));
|
|
440
440
|
}
|
|
441
|
-
}),
|
|
441
|
+
}), fe = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, J = ["checked", "disabled"], Y = {
|
|
442
442
|
key: 0,
|
|
443
443
|
class: "text-body-large text-on-surface"
|
|
444
|
-
},
|
|
444
|
+
}, X = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", pe = /* @__PURE__ */ p({
|
|
445
445
|
__name: "MSwitch",
|
|
446
446
|
props: {
|
|
447
447
|
modelValue: { type: Boolean },
|
|
@@ -498,14 +498,14 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
498
498
|
onPointerup: v,
|
|
499
499
|
onPointerleave: v,
|
|
500
500
|
onPointercancel: v
|
|
501
|
-
}, [u("span",
|
|
501
|
+
}, [u("span", fe, [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"]) }, [
|
|
502
502
|
u("input", {
|
|
503
503
|
type: "checkbox",
|
|
504
504
|
class: "peer sr-only",
|
|
505
505
|
checked: e.modelValue,
|
|
506
506
|
disabled: e.disabled,
|
|
507
507
|
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
508
|
-
}, null, 40,
|
|
508
|
+
}, null, 40, J),
|
|
509
509
|
e.disabled ? c("", !0) : (w(), l("span", {
|
|
510
510
|
key: 0,
|
|
511
511
|
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"]),
|
|
@@ -517,7 +517,7 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
517
517
|
style: b(C.value)
|
|
518
518
|
}, null, 4)),
|
|
519
519
|
u("span", {
|
|
520
|
-
class: y(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [p[e.color], "shadow-sm"] :
|
|
520
|
+
class: y(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [p[e.color], "shadow-sm"] : X]),
|
|
521
521
|
style: b(S.value)
|
|
522
522
|
}, [f(a, {
|
|
523
523
|
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
@@ -535,14 +535,14 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
535
535
|
}, null, 8, ["class"])) : c("", !0)]),
|
|
536
536
|
_: 1
|
|
537
537
|
})], 6)
|
|
538
|
-
], 2)]), e.label ? (w(), l("span",
|
|
538
|
+
], 2)]), e.label ? (w(), l("span", Y, k(e.label), 1)) : c("", !0)], 34));
|
|
539
539
|
}
|
|
540
|
-
}),
|
|
540
|
+
}), me = [
|
|
541
541
|
"tabindex",
|
|
542
542
|
"aria-expanded",
|
|
543
543
|
"aria-controls",
|
|
544
544
|
"aria-disabled"
|
|
545
|
-
],
|
|
545
|
+
], he = { class: "min-w-0 flex-1" }, ge = ["id"], _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = 4, be = 8, xe = 16, Se = "button, a, input, select, textarea, label, [role=\"button\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"link\"], [tabindex]", Ce = /* @__PURE__ */ p({
|
|
546
546
|
inheritAttrs: !1,
|
|
547
547
|
__name: "MListItem",
|
|
548
548
|
props: {
|
|
@@ -576,7 +576,8 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
576
576
|
type: Boolean,
|
|
577
577
|
default: !1
|
|
578
578
|
},
|
|
579
|
-
expanded: { type: Boolean }
|
|
579
|
+
expanded: { type: Boolean },
|
|
580
|
+
indent: {}
|
|
580
581
|
},
|
|
581
582
|
emits: [
|
|
582
583
|
"click",
|
|
@@ -584,166 +585,188 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
584
585
|
"update:expanded"
|
|
585
586
|
],
|
|
586
587
|
setup(e, { emit: t }) {
|
|
587
|
-
let n = e, d = t, p = m(), v = () => !!p?.vnode.props?.onClick,
|
|
588
|
+
let n = e, d = t, p = m(), v = () => !!p?.vnode.props?.onClick, x = E(n.expanded ?? !1);
|
|
588
589
|
M(() => n.expanded, (e) => {
|
|
589
|
-
e !== void 0 && (
|
|
590
|
+
e !== void 0 && (x.value = e);
|
|
590
591
|
});
|
|
591
|
-
let
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
592
|
+
let S = o(() => x.value), C = g("m-list", null), T = o(() => n.lines ? n.lines : C?.lines.value ? C.lines.value : n.description || n.overline && n.subtitle ? 3 : n.subtitle || n.overline ? 2 : 1), O = o(() => n.clickable || n.href || n.to || v() || C?.selectable.value || n.expandable), j = o(() => !!C?.selectable.value && n.value != null && !n.href && !n.to && !n.expandable), P = o(() => !!(n.href || n.to)), F = o(() => !j.value && !P.value && !n.expandable && (n.clickable || v())), I = o(() => P.value || F.value), L = o(() => j.value ? "option" : F.value ? "button" : P.value ? void 0 : "listitem"), R = o(() => {
|
|
593
|
+
if (j.value) return z.value && !n.disabled ? 0 : -1;
|
|
594
|
+
if (F.value) return n.disabled ? -1 : 0;
|
|
594
595
|
});
|
|
595
|
-
function
|
|
596
|
-
(
|
|
596
|
+
function re(e) {
|
|
597
|
+
(j.value || F.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), $(e)));
|
|
597
598
|
}
|
|
598
|
-
let z = o(() => n.active ? !0 :
|
|
599
|
+
let z = o(() => n.active ? !0 : C?.selectable.value && n.value != null ? C.selected.value === n.value : !1), B = o(() => n.leading ? n.leading : n.icon ? "icon" : n.avatarName ? "avatar" : n.image ? "image" : null), V = o(() => n.expandable ? "expand" : n.trailing ? n.trailing : n.trailingIcon ? "icon" : n.trailingText ? "text" : null), ie = {
|
|
599
600
|
primary: "bg-primary-container text-on-primary-container",
|
|
600
601
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
601
602
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
602
603
|
error: "bg-error-container text-on-error-container",
|
|
603
604
|
success: "bg-success-container text-on-success-container"
|
|
604
|
-
},
|
|
605
|
+
}, H = o(() => C?.dense.value ?? !1), U = o(() => C?.nav.value ?? !1), W = o(() => C?.segmented.value ?? !1), oe = o(() => C?.dividers.value ?? !1), se = o(() => z.value ? "text-on-secondary-container" : "text-on-surface"), G = o(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), ce = o(() => H.value ? "" : T.value === 3 ? "min-h-22" : T.value === 2 ? "min-h-18" : "min-h-14"), le = o(() => [
|
|
605
606
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
W.value ? "bg-surface-container px-4" : U.value ? "rounded-full px-4" : "px-4",
|
|
608
|
+
H.value ? "py-1" : T.value === 3 ? "py-3" : "py-2",
|
|
609
|
+
ce.value,
|
|
610
|
+
O.value && !n.disabled && "cursor-pointer",
|
|
610
611
|
z.value && "bg-secondary-container text-on-secondary-container",
|
|
611
612
|
n.disabled && "opacity-[0.38] pointer-events-none"
|
|
612
|
-
]),
|
|
613
|
+
]), K = E(null), q = E(null), ue = (e, { slots: t }) => I.value ? h("li", {
|
|
613
614
|
role: "listitem",
|
|
614
615
|
ref: (e) => {
|
|
615
|
-
|
|
616
|
+
q.value = e;
|
|
616
617
|
}
|
|
617
|
-
}, t.default?.()) : t.default?.(),
|
|
618
|
-
if (
|
|
619
|
-
let e =
|
|
618
|
+
}, t.default?.()) : t.default?.(), de = E(null), fe = (e) => e && "$el" in e ? e.$el : e, J = E(!1), Y = E(!1), X = E(!1), Ce = o(() => W.value ? C?.segmentPosition(I.value ? q.value : fe(K.value)) : void 0), we = o(() => {
|
|
619
|
+
if (U.value) return [];
|
|
620
|
+
let e = O.value && !n.disabled, t = e && Y.value || z.value || e && X.value ? xe : e && J.value ? be : null;
|
|
620
621
|
if (t !== null) return [
|
|
621
622
|
t,
|
|
622
623
|
t,
|
|
623
624
|
t,
|
|
624
625
|
t
|
|
625
626
|
];
|
|
626
|
-
let r =
|
|
627
|
+
let r = Ce.value, i = r === "first" || r === "single" ? xe : ye, a = r === "last" || r === "single" ? xe : ye;
|
|
627
628
|
return [
|
|
628
629
|
i,
|
|
629
630
|
i,
|
|
630
631
|
a,
|
|
631
632
|
a
|
|
632
633
|
];
|
|
633
|
-
}), { snap:
|
|
634
|
-
let t =
|
|
634
|
+
}), { snap: Te } = r(() => we.value, (e) => {
|
|
635
|
+
let t = de.value ?? fe(K.value);
|
|
635
636
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
636
637
|
});
|
|
637
|
-
M([
|
|
638
|
-
function
|
|
639
|
-
|
|
638
|
+
M([Ce, U], () => Te());
|
|
639
|
+
function Ee(e) {
|
|
640
|
+
let t = e.currentTarget, n = e.target?.closest?.(Se);
|
|
641
|
+
return !!n && n !== t && t.contains(n) && !n.closest("[data-mli-part]");
|
|
640
642
|
}
|
|
641
|
-
function
|
|
642
|
-
|
|
643
|
+
function Z(e) {
|
|
644
|
+
e.pointerType !== "touch" && (J.value = !Ee(e));
|
|
643
645
|
}
|
|
644
|
-
function
|
|
645
|
-
|
|
646
|
+
function De() {
|
|
647
|
+
J.value = !1, Y.value = !1;
|
|
648
|
+
}
|
|
649
|
+
function Oe(e) {
|
|
650
|
+
e.button === 0 && !Ee(e) && (Y.value = !0);
|
|
646
651
|
}
|
|
647
652
|
function Q() {
|
|
648
|
-
|
|
653
|
+
Y.value = !1;
|
|
649
654
|
}
|
|
650
|
-
|
|
651
|
-
|
|
655
|
+
let ke = o(() => !O.value || n.disabled ? 0 : Y.value ? .12 : J.value ? .08 : 0), Ae = o(() => n.indent === void 0 ? void 0 : { paddingLeft: typeof n.indent == "number" ? `${n.indent}px` : n.indent });
|
|
656
|
+
function je(e) {
|
|
657
|
+
X.value = e.currentTarget.matches(":focus-visible");
|
|
652
658
|
}
|
|
653
|
-
function
|
|
654
|
-
|
|
659
|
+
function Me() {
|
|
660
|
+
X.value = !1;
|
|
655
661
|
}
|
|
656
|
-
let
|
|
657
|
-
function
|
|
662
|
+
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();
|
|
663
|
+
function Ie(e) {
|
|
658
664
|
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), $(e));
|
|
659
665
|
}
|
|
660
|
-
function
|
|
661
|
-
n.disabled || (
|
|
666
|
+
function Le(e) {
|
|
667
|
+
n.disabled || (x.value = !x.value, d("update:expanded", x.value), d("click", e));
|
|
662
668
|
}
|
|
663
669
|
function $(e) {
|
|
664
670
|
if (!n.disabled) {
|
|
665
671
|
if (n.expandable) {
|
|
666
|
-
|
|
672
|
+
if (Ee(e)) return;
|
|
673
|
+
Le(e);
|
|
667
674
|
return;
|
|
668
675
|
}
|
|
669
|
-
|
|
676
|
+
C?.selectable.value && n.value != null && C.select(n.value), d("click", e);
|
|
670
677
|
}
|
|
671
678
|
}
|
|
672
|
-
function
|
|
679
|
+
function Re() {
|
|
673
680
|
d("update:trailingValue", !n.trailingValue);
|
|
674
681
|
}
|
|
675
682
|
return (t, n) => e.expandable ? (w(), l("li", _({
|
|
676
683
|
key: 0,
|
|
677
684
|
ref_key: "rootEl",
|
|
678
|
-
ref:
|
|
685
|
+
ref: K
|
|
679
686
|
}, t.$attrs, { role: "listitem" }), [u("div", {
|
|
680
687
|
ref_key: "shapeEl",
|
|
681
|
-
ref:
|
|
688
|
+
ref: de,
|
|
682
689
|
role: "button",
|
|
683
690
|
tabindex: e.disabled ? -1 : 0,
|
|
684
|
-
"aria-expanded":
|
|
685
|
-
"aria-controls": A(
|
|
691
|
+
"aria-expanded": S.value,
|
|
692
|
+
"aria-controls": A(Fe),
|
|
686
693
|
"aria-disabled": e.disabled || void 0,
|
|
687
|
-
class: y(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
|
|
694
|
+
class: y(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", le.value]),
|
|
688
695
|
onClick: $,
|
|
689
|
-
onKeydown:
|
|
690
|
-
onFocus:
|
|
691
|
-
onBlur:
|
|
692
|
-
onPointerenter:
|
|
693
|
-
|
|
694
|
-
|
|
696
|
+
onKeydown: Ie,
|
|
697
|
+
onFocus: je,
|
|
698
|
+
onBlur: Me,
|
|
699
|
+
onPointerenter: Z,
|
|
700
|
+
onPointermove: Z,
|
|
701
|
+
onPointerleave: De,
|
|
702
|
+
onPointerdown: Oe,
|
|
695
703
|
onPointerup: Q,
|
|
696
704
|
onPointercancel: Q
|
|
697
705
|
}, [
|
|
706
|
+
u("span", {
|
|
707
|
+
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", z.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
708
|
+
style: b({ opacity: ke.value }),
|
|
709
|
+
"aria-hidden": "true"
|
|
710
|
+
}, null, 6),
|
|
698
711
|
D(t.$slots, "leading", {}, () => [B.value === "icon" ? (w(), s(i, {
|
|
699
712
|
key: 0,
|
|
700
713
|
name: e.icon,
|
|
701
714
|
size: 24,
|
|
702
715
|
class: y(["shrink-0", G.value])
|
|
703
716
|
}, null, 8, ["name", "class"])) : c("", !0)]),
|
|
704
|
-
u("div",
|
|
717
|
+
u("div", he, [D(t.$slots, "overline", {}, () => [e.overline ? (w(), l("p", {
|
|
705
718
|
key: 0,
|
|
706
719
|
class: y(["truncate text-label-small", G.value])
|
|
707
|
-
}, k(e.overline), 3)) : c("", !0)]), D(t.$slots, "default", {}, () => [u("p", { class: y(["truncate text-body-large",
|
|
720
|
+
}, k(e.overline), 3)) : c("", !0)]), D(t.$slots, "default", {}, () => [u("p", { class: y(["truncate text-body-large", se.value]) }, k(e.title), 3), e.subtitle && T.value >= 2 ? (w(), l("p", {
|
|
708
721
|
key: 0,
|
|
709
|
-
class: y(["text-body-medium", [G.value,
|
|
722
|
+
class: y(["text-body-medium", [G.value, T.value === 2 && "truncate"]])
|
|
710
723
|
}, k(e.subtitle), 3)) : c("", !0)])]),
|
|
724
|
+
D(t.$slots, "trailing"),
|
|
711
725
|
f(i, {
|
|
712
|
-
name:
|
|
726
|
+
name: S.value ? "expand_less" : "expand_more",
|
|
713
727
|
size: 20,
|
|
714
728
|
class: y(["shrink-0", G.value])
|
|
715
729
|
}, null, 8, ["name", "class"])
|
|
716
|
-
], 42,
|
|
717
|
-
default: N(() => [
|
|
730
|
+
], 42, me), f(a, { name: "mli-expand" }, {
|
|
731
|
+
default: N(() => [S.value ? (w(), l("div", {
|
|
718
732
|
key: 0,
|
|
719
|
-
id: A(
|
|
733
|
+
id: A(Fe),
|
|
720
734
|
class: "mli-expand-grid"
|
|
721
|
-
}, [u("div",
|
|
735
|
+
}, [u("div", {
|
|
736
|
+
class: "mli-expand-body",
|
|
737
|
+
style: b(Ae.value)
|
|
738
|
+
}, [D(t.$slots, "children")], 4)], 8, ge)) : c("", !0)]),
|
|
722
739
|
_: 3
|
|
723
|
-
})], 16)) : (w(), s(
|
|
724
|
-
default: N(() => [(w(), s(ee(
|
|
725
|
-
class:
|
|
740
|
+
})], 16)) : (w(), s(ue, { key: 1 }, {
|
|
741
|
+
default: N(() => [(w(), s(ee(Ne.value), _({
|
|
742
|
+
class: le.value,
|
|
726
743
|
ref_key: "rootEl",
|
|
727
|
-
ref:
|
|
744
|
+
ref: K
|
|
728
745
|
}, {
|
|
729
|
-
...
|
|
746
|
+
...Pe.value,
|
|
730
747
|
...t.$attrs
|
|
731
748
|
}, {
|
|
732
|
-
role:
|
|
733
|
-
tabindex:
|
|
734
|
-
"aria-selected":
|
|
735
|
-
"aria-disabled": (
|
|
749
|
+
role: L.value,
|
|
750
|
+
tabindex: R.value,
|
|
751
|
+
"aria-selected": j.value ? z.value : void 0,
|
|
752
|
+
"aria-disabled": (j.value || F.value) && e.disabled ? "true" : void 0,
|
|
736
753
|
onClick: $,
|
|
737
|
-
onKeydown:
|
|
738
|
-
onPointerenter:
|
|
739
|
-
|
|
740
|
-
|
|
754
|
+
onKeydown: re,
|
|
755
|
+
onPointerenter: Z,
|
|
756
|
+
onPointermove: Z,
|
|
757
|
+
onPointerleave: De,
|
|
758
|
+
onPointerdown: Oe,
|
|
741
759
|
onPointerup: Q,
|
|
742
760
|
onPointercancel: Q,
|
|
743
|
-
onFocus:
|
|
744
|
-
onBlur:
|
|
761
|
+
onFocus: je,
|
|
762
|
+
onBlur: Me
|
|
745
763
|
}), {
|
|
746
764
|
default: N(() => [
|
|
765
|
+
u("span", {
|
|
766
|
+
class: y(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", z.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
767
|
+
style: b({ opacity: ke.value }),
|
|
768
|
+
"aria-hidden": "true"
|
|
769
|
+
}, null, 6),
|
|
747
770
|
oe.value ? (w(), l("div", {
|
|
748
771
|
key: 0,
|
|
749
772
|
class: y(["absolute top-0 right-0 h-px bg-outline-variant", oe.value === "inset" ? "left-16" : "left-0"])
|
|
@@ -755,7 +778,7 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
755
778
|
class: y(["shrink-0", G.value])
|
|
756
779
|
}, null, 8, ["name", "class"])) : B.value === "icon-container" ? (w(), l("div", {
|
|
757
780
|
key: 1,
|
|
758
|
-
class: y(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full",
|
|
781
|
+
class: y(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ie[e.iconContainerColor || "primary"]])
|
|
759
782
|
}, [f(i, {
|
|
760
783
|
name: e.icon,
|
|
761
784
|
size: 24
|
|
@@ -769,21 +792,22 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
769
792
|
src: e.image,
|
|
770
793
|
alt: "",
|
|
771
794
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
772
|
-
}, null, 8, _e)) : B.value === "checkbox" ? (w(), s(
|
|
795
|
+
}, null, 8, _e)) : B.value === "checkbox" ? (w(), s(ae, {
|
|
773
796
|
key: 4,
|
|
774
797
|
"model-value": z.value,
|
|
775
|
-
class: "shrink-0"
|
|
798
|
+
class: "shrink-0",
|
|
799
|
+
"data-mli-part": ""
|
|
776
800
|
}, null, 8, ["model-value"])) : c("", !0)]),
|
|
777
801
|
u("div", ve, [D(t.$slots, "overline", {}, () => [e.overline ? (w(), l("p", {
|
|
778
802
|
key: 0,
|
|
779
803
|
class: y(["truncate text-label-small", G.value])
|
|
780
804
|
}, k(e.overline), 3)) : c("", !0)]), D(t.$slots, "default", {}, () => [
|
|
781
|
-
u("p", { class: y(["truncate text-body-large",
|
|
782
|
-
e.subtitle &&
|
|
805
|
+
u("p", { class: y(["truncate text-body-large", se.value]) }, k(e.title), 3),
|
|
806
|
+
e.subtitle && T.value >= 2 ? (w(), l("p", {
|
|
783
807
|
key: 0,
|
|
784
|
-
class: y(["text-body-medium", [G.value,
|
|
808
|
+
class: y(["text-body-medium", [G.value, T.value === 2 && "truncate"]])
|
|
785
809
|
}, k(e.subtitle), 3)) : c("", !0),
|
|
786
|
-
e.description &&
|
|
810
|
+
e.description && T.value >= 3 ? (w(), l("p", {
|
|
787
811
|
key: 1,
|
|
788
812
|
class: y(["line-clamp-2 text-body-small", G.value])
|
|
789
813
|
}, k(e.description), 3)) : c("", !0)
|
|
@@ -796,14 +820,14 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
796
820
|
}, null, 8, ["name", "class"])) : V.value === "text" ? (w(), l("span", {
|
|
797
821
|
key: 1,
|
|
798
822
|
class: y(["shrink-0 text-label-small", G.value])
|
|
799
|
-
}, k(e.trailingText), 3)) : V.value === "switch" ? (w(), s(
|
|
823
|
+
}, k(e.trailingText), 3)) : V.value === "switch" ? (w(), s(pe, {
|
|
800
824
|
key: 2,
|
|
801
825
|
"model-value": !!e.trailingValue,
|
|
802
|
-
"onUpdate:modelValue":
|
|
803
|
-
}, null, 8, ["model-value"])) : V.value === "checkbox" ? (w(), s(
|
|
826
|
+
"onUpdate:modelValue": Re
|
|
827
|
+
}, null, 8, ["model-value"])) : V.value === "checkbox" ? (w(), s(ae, {
|
|
804
828
|
key: 3,
|
|
805
829
|
"model-value": !!e.trailingValue,
|
|
806
|
-
"onUpdate:modelValue":
|
|
830
|
+
"onUpdate:modelValue": Re
|
|
807
831
|
}, null, 8, ["model-value"])) : c("", !0)])
|
|
808
832
|
]),
|
|
809
833
|
_: 3
|
|
@@ -819,6 +843,6 @@ var le = ["role"], ue = /* @__PURE__ */ p({
|
|
|
819
843
|
}
|
|
820
844
|
});
|
|
821
845
|
//#endregion
|
|
822
|
-
export {
|
|
846
|
+
export { K as a, ne as c, q as i, pe as n, ae as o, de as r, ie as s, Ce as t };
|
|
823
847
|
|
|
824
|
-
//# sourceMappingURL=MListItem-
|
|
848
|
+
//# sourceMappingURL=MListItem-Bb84X6ex.js.map
|