@m3ui-vue/m3ui-vue 1.6.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +1224 -28
- package/dist/{MColorPickerModal-NtkihoK6.js → MColorPickerModal-H8nuX0Wu.js} +3 -4
- package/dist/{MColorPickerModal-NtkihoK6.js.map → MColorPickerModal-H8nuX0Wu.js.map} +1 -1
- package/dist/MDialog-B42Mhn8W.js +331 -0
- package/dist/MDialog-B42Mhn8W.js.map +1 -0
- package/dist/{MListItem-D2cNUyzP.js → MListItem-DiOAxaN7.js} +431 -325
- package/dist/MListItem-DiOAxaN7.js.map +1 -0
- package/dist/{MLoadingIndicator-DWUj0BAB.js → MLoadingIndicator-CuTZYFFj.js} +2 -2
- package/dist/{MLoadingIndicator-DWUj0BAB.js.map → MLoadingIndicator-CuTZYFFj.js.map} +1 -1
- package/dist/{MSeekBar-C4cn9RIF.js → MSeekBar-BCDQTx2t.js} +2 -2
- package/dist/{MSeekBar-C4cn9RIF.js.map → MSeekBar-BCDQTx2t.js.map} +1 -1
- package/dist/MSegmentedButton-BXzRsg1S.js +105 -0
- package/dist/MSegmentedButton-BXzRsg1S.js.map +1 -0
- package/dist/MSignaturePad-BTqGaPXA.js +313 -0
- package/dist/MSignaturePad-BTqGaPXA.js.map +1 -0
- package/dist/MSlider-D_O8J9YH.js +739 -0
- package/dist/MSlider-D_O8J9YH.js.map +1 -0
- package/dist/{MSpinner-DZkXZJpc.js → MSpinner-UCdtSOHP.js} +2 -2
- package/dist/{MSpinner-DZkXZJpc.js.map → MSpinner-UCdtSOHP.js.map} +1 -1
- package/dist/{MTextField-CNH-byir.js → MTextField-CYk9yFvi.js} +162 -115
- package/dist/MTextField-CYk9yFvi.js.map +1 -0
- package/dist/_useFieldValidation-B0B44M_t.js +191 -0
- package/dist/_useFieldValidation-B0B44M_t.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +184 -103
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +18 -3
- package/dist/components/MAppBarWithSearch.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +2 -2
- package/dist/components/MAutocomplete.vue.d.ts +22 -3
- package/dist/components/MCheckbox.vue.d.ts +23 -1
- package/dist/components/MCodeEditor.vue.d.ts +23 -1
- package/dist/components/MColorPicker.vue.d.ts +24 -3
- package/dist/components/MConfirmDialog.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +13 -2
- package/dist/components/MCreditCardInput.vue.d.ts +33 -0
- package/dist/components/MCronField.vue.d.ts +23 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MDatePicker.vue.d.ts +24 -3
- package/dist/components/MDateRangePicker.vue.d.ts +24 -3
- package/dist/components/MFileUpload.vue.d.ts +23 -2
- package/dist/components/MForm.vue.d.ts +61 -0
- package/dist/components/MFormBuilder.vue.d.ts +22 -0
- package/dist/components/MFormRenderer.vue.d.ts +151 -0
- package/dist/components/MJsonEditor.vue.d.ts +23 -1
- package/dist/components/MMapRoute.vue.d.ts +176 -0
- package/dist/components/MMaskField.vue.d.ts +20 -2
- package/dist/components/MMentionField.vue.d.ts +13 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +22 -3
- package/dist/components/MMultiSelect.vue.d.ts +22 -3
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +2 -2
- package/dist/components/MNumberField.vue.d.ts +20 -2
- package/dist/components/MPdfSigner.vue.d.ts +499 -0
- package/dist/components/MPdfViewer.vue.d.ts +12 -0
- package/dist/components/MPhoneInput.vue.d.ts +19 -4
- package/dist/components/MPinInput.vue.d.ts +24 -3
- package/dist/components/MPosKeypad.vue.d.ts +3 -3
- package/dist/components/MRadioGroup.vue.d.ts +23 -1
- package/dist/components/MRating.vue.d.ts +23 -1
- package/dist/components/MRichTextEditor.vue.d.ts +23 -1
- package/dist/components/MSearchBar.vue.d.ts +1 -1
- package/dist/components/MSegmentedButton.vue.d.ts +23 -2
- package/dist/components/MSelect.vue.d.ts +22 -3
- package/dist/components/MSignaturePad.vue.d.ts +19 -0
- package/dist/components/MSlider.vue.d.ts +23 -1
- package/dist/components/MSpreadsheet.vue.d.ts +137 -0
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +23 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +20 -2
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +26 -3
- package/dist/components/MTimePicker.vue.d.ts +24 -3
- package/dist/components/MTimezoneSelect.vue.d.ts +13 -2
- package/dist/components/MTour.vue.d.ts +2 -2
- package/dist/components/MTrackingTimeline.vue.d.ts +75 -0
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/composables/_routeGeometry.d.ts +26 -0
- package/dist/composables/_useFieldValidation.d.ts +91 -0
- package/dist/composables/mapRouting.d.ts +35 -0
- package/dist/composables/pdfSign.d.ts +52 -0
- package/dist/composables/spreadsheetFormula.d.ts +55 -0
- package/dist/composables/useLocale.d.ts +177 -0
- package/dist/composables/validation.d.ts +82 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +2 -2
- package/dist/index.d.ts +12 -0
- package/dist/locales/index.js +693 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +15507 -12417
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +4 -0
- package/dist/map.js +1207 -745
- package/dist/map.js.map +1 -1
- package/dist/media.js +4 -4
- package/dist/pdf.d.ts +3 -0
- package/dist/pdf.js +1228 -687
- package/dist/pdf.js.map +1 -1
- package/dist/rich-text-editor.js +188 -146
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-DaVSTdm0.js → useLocale-DL96OFgr.js} +99 -1
- package/dist/useLocale-DL96OFgr.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MForm.test.ts +325 -0
- package/src/__tests__/MFormRenderer.test.ts +157 -0
- package/src/__tests__/MMapRoute.test.ts +418 -0
- package/src/__tests__/MPdfSigner.test.ts +175 -0
- package/src/__tests__/MPhoneInput.test.ts +5 -2
- package/src/__tests__/MRichTextEditor.test.ts +2 -1
- package/src/__tests__/MSpreadsheet.test.ts +223 -0
- package/src/__tests__/MTrackingTimeline.test.ts +66 -0
- package/src/__tests__/_fakeMaplibre.ts +4 -1
- package/src/__tests__/_osrmRoutes.ts +10 -0
- package/src/__tests__/attrsFallthrough.test.ts +11 -0
- package/src/__tests__/fieldsValidation.test.ts +229 -0
- package/src/__tests__/spreadsheetFormula.test.ts +77 -0
- package/src/__tests__/ssr.test.ts +4 -0
- package/src/__tests__/validation.test.ts +77 -0
- package/src/components/MAddressField.vue +45 -8
- package/src/components/MAutocomplete.vue +69 -23
- package/src/components/MCheckbox.vue +80 -17
- package/src/components/MCodeEditor.vue +59 -2
- package/src/components/MColorPicker.vue +65 -16
- package/src/components/MCountrySelect.vue +17 -3
- package/src/components/MCreditCardInput.vue +76 -7
- package/src/components/MCronField.vue +60 -10
- package/src/components/MDatePicker.vue +65 -16
- package/src/components/MDateRangePicker.vue +66 -16
- package/src/components/MFileUpload.vue +71 -8
- package/src/components/MForm.vue +208 -0
- package/src/components/MFormBuilder.vue +417 -0
- package/src/components/MFormRenderer.vue +324 -0
- package/src/components/MJsonEditor.vue +57 -3
- package/src/components/MMapRoute.vue +523 -0
- package/src/components/MMaskField.vue +55 -13
- package/src/components/MMentionField.vue +17 -2
- package/src/components/MMultiAutocomplete.vue +70 -23
- package/src/components/MMultiSelect.vue +70 -23
- package/src/components/MNumberField.vue +58 -16
- package/src/components/MPdfSigner.vue +433 -0
- package/src/components/MPdfViewer.vue +12 -0
- package/src/components/MPhoneInput.vue +60 -18
- package/src/components/MPinInput.vue +58 -10
- package/src/components/MRadioGroup.vue +65 -4
- package/src/components/MRating.vue +62 -6
- package/src/components/MRichTextEditor.vue +64 -4
- package/src/components/MSegmentedButton.vue +59 -2
- package/src/components/MSelect.vue +72 -26
- package/src/components/MSignaturePad.vue +71 -6
- package/src/components/MSlider.vue +61 -10
- package/src/components/MSpreadsheet.vue +992 -0
- package/src/components/MSwitch.vue +63 -8
- package/src/components/MTagInput.vue +67 -25
- package/src/components/MTextField.vue +68 -14
- package/src/components/MTimePicker.vue +65 -16
- package/src/components/MTimezoneSelect.vue +17 -3
- package/src/components/MTrackingTimeline.vue +257 -0
- package/src/composables/_routeGeometry.ts +140 -0
- package/src/composables/_useFieldValidation.ts +287 -0
- package/src/composables/mapRouting.ts +55 -0
- package/src/composables/pdfSign.ts +141 -0
- package/src/composables/spreadsheetFormula.ts +459 -0
- package/src/composables/useLocale.ts +277 -0
- package/src/composables/validation.ts +178 -0
- package/src/index.ts +12 -0
- package/src/locales/de.ts +98 -0
- package/src/locales/es.ts +105 -7
- package/src/locales/fr.ts +98 -0
- package/src/locales/ja.ts +98 -0
- package/src/locales/ko.ts +98 -0
- package/src/locales/pt.ts +98 -0
- package/src/locales/zh.ts +98 -0
- package/src/map.ts +4 -0
- package/src/pdf.ts +3 -0
- package/dist/MButton-OQ4wIERQ.js +0 -171
- package/dist/MButton-OQ4wIERQ.js.map +0 -1
- package/dist/MDialog-DYMnaBlt.js +0 -167
- package/dist/MDialog-DYMnaBlt.js.map +0 -1
- package/dist/MListItem-D2cNUyzP.js.map +0 -1
- package/dist/MProgressBar-BWly1UKN.js +0 -179
- package/dist/MProgressBar-BWly1UKN.js.map +0 -1
- package/dist/MSegmentedButton-BEB4gXLA.js +0 -64
- package/dist/MSegmentedButton-BEB4gXLA.js.map +0 -1
- package/dist/MSlider-BIkA6DiE.js +0 -690
- package/dist/MSlider-BIkA6DiE.js.map +0 -1
- package/dist/MTextField-CNH-byir.js.map +0 -1
- package/dist/useLocale-DaVSTdm0.js.map +0 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-DL96OFgr.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 {
|
|
4
|
+
import { n as a } from "./_useFieldValidation-B0B44M_t.js";
|
|
5
|
+
import { Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, h as g, inject as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onUnmounted as w, onUpdated as T, openBlock as E, provide as D, ref as O, renderSlot as k, resolveDynamicComponent as ee, shallowRef as A, toDisplayString as j, unref as M, useId as te, useSlots as N, watch as P, withCtx as F, withModifiers as I } from "vue";
|
|
5
6
|
// src/composables/_useFollowAnchor.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
7
|
+
var L = /(auto|scroll|hidden|clip)/;
|
|
8
|
+
function R(e) {
|
|
8
9
|
if (!e.isConnected) return !0;
|
|
9
10
|
let t = e.getBoundingClientRect(), n = t.top, r = t.left, i = t.bottom, a = t.right;
|
|
10
11
|
for (let t = e.parentElement; t && t !== document.body && t !== document.documentElement; t = t.parentElement) {
|
|
11
12
|
let e = getComputedStyle(t);
|
|
12
13
|
if (e.position === "fixed") break;
|
|
13
|
-
if (!
|
|
14
|
+
if (!L.test(e.overflow + e.overflowX + e.overflowY)) continue;
|
|
14
15
|
let o = t.getBoundingClientRect();
|
|
15
16
|
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
|
}
|
|
17
18
|
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
|
}
|
|
19
|
-
function
|
|
20
|
+
function z(e) {
|
|
20
21
|
let t = 0, n = null, r = !1;
|
|
21
22
|
function i() {
|
|
22
23
|
if (t = 0, !e.open()) return;
|
|
23
24
|
let n = e.anchor.value;
|
|
24
|
-
if (!n ||
|
|
25
|
+
if (!n || R(n)) {
|
|
25
26
|
e.close();
|
|
26
27
|
let t = document.activeElement;
|
|
27
28
|
n && t instanceof HTMLElement && n.contains(t) && t.blur();
|
|
@@ -43,10 +44,10 @@ function R(e) {
|
|
|
43
44
|
function c() {
|
|
44
45
|
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
|
}
|
|
46
|
-
|
|
47
|
+
P(e.open, (e) => e ? s() : c(), { immediate: !0 }), S(c);
|
|
47
48
|
}
|
|
48
49
|
// src/components/MAvatar.vue
|
|
49
|
-
var
|
|
50
|
+
var ne = /* @__PURE__ */ m({
|
|
50
51
|
__name: "MAvatar",
|
|
51
52
|
props: {
|
|
52
53
|
name: {},
|
|
@@ -54,39 +55,39 @@ var z = /* @__PURE__ */ p({
|
|
|
54
55
|
size: { default: 40 }
|
|
55
56
|
},
|
|
56
57
|
setup(e) {
|
|
57
|
-
let t = e, n =
|
|
58
|
+
let t = e, n = s(() => {
|
|
58
59
|
if (t.name) {
|
|
59
60
|
let e = t.name.trim().split(/\s+/).filter(Boolean);
|
|
60
61
|
return ((e[0]?.[0] ?? "") + (e.length > 1 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase() || t.fallback || "?";
|
|
61
62
|
}
|
|
62
63
|
return t.fallback || "?";
|
|
63
64
|
});
|
|
64
|
-
return (t, r) => (
|
|
65
|
+
return (t, r) => (E(), u("div", {
|
|
65
66
|
class: "inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
66
|
-
style:
|
|
67
|
+
style: x({
|
|
67
68
|
width: `${e.size}px`,
|
|
68
69
|
height: `${e.size}px`,
|
|
69
70
|
fontSize: `${Math.round(e.size * .4)}px`
|
|
70
71
|
})
|
|
71
|
-
},
|
|
72
|
+
}, j(n.value), 5));
|
|
72
73
|
}
|
|
73
|
-
}),
|
|
74
|
+
}), B = [
|
|
74
75
|
"role",
|
|
75
76
|
"tabindex",
|
|
76
77
|
"aria-disabled"
|
|
77
|
-
],
|
|
78
|
+
], V = ["src", "alt"], H = {
|
|
78
79
|
key: 1,
|
|
79
80
|
class: "px-4 pt-4 pb-2"
|
|
80
|
-
},
|
|
81
|
+
}, re = {
|
|
81
82
|
key: 2,
|
|
82
83
|
class: "px-4 pt-4 pb-2"
|
|
83
|
-
},
|
|
84
|
+
}, ie = { class: "text-title-large font-medium text-on-surface" }, U = {
|
|
84
85
|
key: 0,
|
|
85
86
|
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
86
87
|
}, W = {
|
|
87
88
|
key: 3,
|
|
88
89
|
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
89
|
-
},
|
|
90
|
+
}, ae = "relative before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-on-surface before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] active:before:opacity-[0.12]", oe = /* @__PURE__ */ m({
|
|
90
91
|
__name: "MCard",
|
|
91
92
|
props: {
|
|
92
93
|
variant: { default: "elevated" },
|
|
@@ -109,11 +110,11 @@ var z = /* @__PURE__ */ p({
|
|
|
109
110
|
subtitle: {}
|
|
110
111
|
},
|
|
111
112
|
setup(e) {
|
|
112
|
-
let t = e, n =
|
|
113
|
+
let t = e, n = s(() => t.elevated ? "elevated" : t.variant), r = {
|
|
113
114
|
elevated: "var(--color-surface-container-low)",
|
|
114
115
|
filled: "var(--color-surface-container-highest)",
|
|
115
116
|
outlined: "var(--color-surface)"
|
|
116
|
-
}, i =
|
|
117
|
+
}, i = s(() => (t.disabled ? {
|
|
117
118
|
elevated: "bg-surface/38 shadow-none",
|
|
118
119
|
filled: "bg-surface-variant/38",
|
|
119
120
|
outlined: "bg-surface border border-outline/12"
|
|
@@ -125,48 +126,58 @@ var z = /* @__PURE__ */ p({
|
|
|
125
126
|
elevated: "hover:shadow-elevation-2 active:shadow-elevation-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
126
127
|
filled: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
127
128
|
outlined: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:border-on-surface"
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
|
|
129
|
+
}, o = s(() => t.clickable && !t.disabled);
|
|
130
|
+
function c(e) {
|
|
131
|
+
o.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
131
132
|
}
|
|
132
|
-
return (t,
|
|
133
|
-
class:
|
|
133
|
+
return (t, s) => (E(), u("div", {
|
|
134
|
+
class: b(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
134
135
|
i.value,
|
|
135
|
-
|
|
136
|
+
o.value ? [
|
|
136
137
|
"cursor-pointer",
|
|
137
138
|
a[n.value],
|
|
138
|
-
|
|
139
|
+
ae
|
|
139
140
|
] : "",
|
|
140
141
|
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
141
142
|
]]),
|
|
142
|
-
style:
|
|
143
|
+
style: x({ "--field-bg": r[n.value] }),
|
|
143
144
|
role: e.clickable ? "button" : void 0,
|
|
144
|
-
tabindex:
|
|
145
|
+
tabindex: o.value ? 0 : void 0,
|
|
145
146
|
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
146
|
-
onKeydown:
|
|
147
|
+
onKeydown: c
|
|
147
148
|
}, [
|
|
148
|
-
e.image || t.$slots.media ? (
|
|
149
|
+
e.image || t.$slots.media ? (E(), u("div", {
|
|
149
150
|
key: 0,
|
|
150
|
-
class:
|
|
151
|
-
}, [e.image ? (
|
|
151
|
+
class: b(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
152
|
+
}, [e.image ? (E(), u("img", {
|
|
152
153
|
key: 0,
|
|
153
154
|
src: e.image,
|
|
154
155
|
alt: e.imageAlt ?? "",
|
|
155
156
|
class: "h-full w-full object-cover"
|
|
156
|
-
}, null, 8,
|
|
157
|
-
t.$slots.header ? (
|
|
158
|
-
|
|
159
|
-
t.$slots.actions ? (
|
|
160
|
-
], 46,
|
|
157
|
+
}, null, 8, V)) : k(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : l("", !0),
|
|
158
|
+
t.$slots.header ? (E(), u("div", H, [k(t.$slots, "header")])) : e.title ? (E(), u("div", re, [d("h3", ie, j(e.title), 1), e.subtitle ? (E(), u("p", U, j(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
159
|
+
k(t.$slots, "default"),
|
|
160
|
+
t.$slots.actions ? (E(), u("div", W, [k(t.$slots, "actions")])) : l("", !0)
|
|
161
|
+
], 46, B));
|
|
161
162
|
}
|
|
162
|
-
}),
|
|
163
|
+
}), G = [
|
|
163
164
|
"checked",
|
|
164
165
|
"disabled",
|
|
165
|
-
"
|
|
166
|
+
"name",
|
|
167
|
+
"required",
|
|
168
|
+
"aria-label",
|
|
169
|
+
"aria-invalid",
|
|
170
|
+
"aria-describedby"
|
|
166
171
|
], se = {
|
|
167
172
|
key: 1,
|
|
168
173
|
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
169
|
-
}, ce =
|
|
174
|
+
}, ce = {
|
|
175
|
+
key: 0,
|
|
176
|
+
class: "flex flex-col"
|
|
177
|
+
}, K = {
|
|
178
|
+
key: 0,
|
|
179
|
+
class: "text-error"
|
|
180
|
+
}, le = ["id"], ue = "border-error bg-error text-on-error", de = /* @__PURE__ */ m({
|
|
170
181
|
__name: "MCheckbox",
|
|
171
182
|
props: {
|
|
172
183
|
modelValue: { type: Boolean },
|
|
@@ -180,46 +191,88 @@ var z = /* @__PURE__ */ p({
|
|
|
180
191
|
},
|
|
181
192
|
label: {},
|
|
182
193
|
color: { default: "primary" },
|
|
183
|
-
ariaLabel: {}
|
|
194
|
+
ariaLabel: {},
|
|
195
|
+
error: { type: [Boolean, String] },
|
|
196
|
+
errorLabel: {},
|
|
197
|
+
required: { type: Boolean },
|
|
198
|
+
rules: {},
|
|
199
|
+
validateOn: {},
|
|
200
|
+
validateDebounce: {},
|
|
201
|
+
name: {}
|
|
184
202
|
},
|
|
185
|
-
emits: ["update:modelValue"],
|
|
186
|
-
setup(e, {
|
|
187
|
-
let n =
|
|
203
|
+
emits: ["update:modelValue", "blur"],
|
|
204
|
+
setup(e, { expose: t, emit: n }) {
|
|
205
|
+
let r = e, o = n, s = O(null), c = a({
|
|
206
|
+
value: () => r.modelValue,
|
|
207
|
+
rules: () => r.rules,
|
|
208
|
+
required: () => r.required,
|
|
209
|
+
error: () => r.error,
|
|
210
|
+
errorLabel: () => r.errorLabel,
|
|
211
|
+
name: () => r.name,
|
|
212
|
+
validateOn: () => r.validateOn,
|
|
213
|
+
validateDebounce: () => r.validateDebounce,
|
|
214
|
+
disabled: () => r.disabled,
|
|
215
|
+
focus: () => {
|
|
216
|
+
s.value?.focus();
|
|
217
|
+
},
|
|
218
|
+
el: () => s.value,
|
|
219
|
+
setValue: (e) => o("update:modelValue", e)
|
|
220
|
+
}), m = c.disabled, { hasError: h, message: g, messageId: _ } = c, v = {
|
|
188
221
|
primary: "border-primary bg-primary text-on-primary",
|
|
189
222
|
secondary: "border-secondary bg-secondary text-on-secondary",
|
|
190
223
|
tertiary: "border-tertiary bg-tertiary text-on-tertiary",
|
|
191
224
|
error: "border-error bg-error text-on-error"
|
|
192
|
-
},
|
|
225
|
+
}, y = {
|
|
193
226
|
primary: "bg-primary",
|
|
194
227
|
secondary: "bg-secondary",
|
|
195
228
|
tertiary: "bg-tertiary",
|
|
196
229
|
error: "bg-error"
|
|
197
230
|
};
|
|
198
|
-
return
|
|
199
|
-
|
|
231
|
+
return t({
|
|
232
|
+
validate: c.validate,
|
|
233
|
+
resetValidation: c.resetValidation
|
|
234
|
+
}), (t, n) => (E(), u("label", { class: b(["group inline-flex gap-2 select-none", [M(m) ? "cursor-not-allowed" : "cursor-pointer", M(g) ? "items-start" : "items-center"]]) }, [d("span", {
|
|
235
|
+
class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full",
|
|
236
|
+
style: x(M(g) ? { marginTop: "-8px" } : void 0)
|
|
237
|
+
}, [
|
|
238
|
+
d("input", {
|
|
200
239
|
type: "checkbox",
|
|
201
240
|
class: "peer sr-only",
|
|
202
241
|
checked: e.modelValue,
|
|
203
|
-
disabled:
|
|
242
|
+
disabled: M(m),
|
|
243
|
+
ref_key: "inputEl",
|
|
244
|
+
ref: s,
|
|
245
|
+
name: e.name,
|
|
246
|
+
required: e.required,
|
|
204
247
|
"aria-label": e.ariaLabel,
|
|
205
|
-
|
|
248
|
+
"aria-invalid": M(h) || void 0,
|
|
249
|
+
"aria-describedby": M(g) ? M(_) : void 0,
|
|
250
|
+
onChange: n[0] ||= (t) => o("update:modelValue", !e.modelValue),
|
|
251
|
+
onBlur: n[1] ||= (e) => {
|
|
252
|
+
M(c).onBlur(), o("blur", e);
|
|
253
|
+
}
|
|
206
254
|
}, null, 40, G),
|
|
207
|
-
|
|
255
|
+
M(m) ? l("", !0) : (E(), u("span", {
|
|
208
256
|
key: 0,
|
|
209
|
-
class:
|
|
257
|
+
class: b(["pointer-events-none absolute inset-0 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12]", M(h) ? "bg-error" : e.modelValue || e.indeterminate ? y[e.color] : "bg-on-surface"])
|
|
210
258
|
}, null, 2)),
|
|
211
|
-
|
|
212
|
-
|
|
259
|
+
M(m) ? l("", !0) : (E(), u("span", se)),
|
|
260
|
+
d("span", { class: b(["relative inline-flex h-4.5 w-4.5 items-center justify-center rounded-[2px] border-2 transition-colors", M(m) ? e.modelValue || e.indeterminate ? "border-on-surface/38 bg-on-surface/38 text-surface" : "border-on-surface/38 text-transparent" : M(h) ? e.modelValue || e.indeterminate ? ue : "border-error text-transparent" : e.modelValue || e.indeterminate ? v[e.color] : "border-on-surface-variant text-transparent group-hover:border-on-surface group-active:border-on-surface"]) }, [p(i, {
|
|
213
261
|
name: e.indeterminate ? "remove" : "check",
|
|
214
262
|
size: 18,
|
|
215
|
-
class:
|
|
263
|
+
class: b(["transition-[opacity,transform] duration-150", e.modelValue || e.indeterminate ? "scale-100 opacity-100" : "scale-0 opacity-0"])
|
|
216
264
|
}, null, 8, ["name", "class"])], 2)
|
|
217
|
-
]), e.label || t.$slots.default ? (
|
|
265
|
+
], 4), e.label || t.$slots.default || M(g) ? (E(), u("span", ce, [e.label || t.$slots.default ? (E(), u("span", {
|
|
218
266
|
key: 0,
|
|
219
|
-
class:
|
|
220
|
-
}, [
|
|
267
|
+
class: b(["text-body-large", M(m) ? "text-on-surface/38" : "text-on-surface"])
|
|
268
|
+
}, [k(t.$slots, "default", {}, () => [f(j(e.label), 1)]), e.required ? (E(), u("span", K, "\xA0*")) : l("", !0)], 2)) : l("", !0), M(g) ? (E(), u("span", {
|
|
269
|
+
key: 1,
|
|
270
|
+
id: M(_),
|
|
271
|
+
role: "alert",
|
|
272
|
+
class: "text-body-small text-error"
|
|
273
|
+
}, j(M(g)), 9, le)) : l("", !0)])) : l("", !0)], 2));
|
|
221
274
|
}
|
|
222
|
-
}),
|
|
275
|
+
}), fe = ["disabled", "aria-pressed"], pe = { class: "whitespace-nowrap" }, q = ["aria-label", "disabled"], J = ["aria-label", "disabled"], Y = "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", me = /* @__PURE__ */ m({
|
|
223
276
|
__name: "MChip",
|
|
224
277
|
props: {
|
|
225
278
|
tone: { default: "neutral" },
|
|
@@ -252,20 +305,20 @@ var z = /* @__PURE__ */ p({
|
|
|
252
305
|
"remove",
|
|
253
306
|
"update:selected"
|
|
254
307
|
],
|
|
255
|
-
setup(a, { emit:
|
|
256
|
-
let
|
|
308
|
+
setup(a, { emit: o }) {
|
|
309
|
+
let f = [
|
|
257
310
|
"neutral",
|
|
258
311
|
"primary",
|
|
259
312
|
"success",
|
|
260
313
|
"error",
|
|
261
314
|
"tertiary",
|
|
262
315
|
"secondary"
|
|
263
|
-
], m = a, h =
|
|
316
|
+
], m = a, h = o, g = e(), _ = N(), v = s(() => !!m.tone && !f.includes(m.tone)), y = s(() => {
|
|
264
317
|
if (v.value) return {
|
|
265
318
|
"--chip-bg": m.tone + "22",
|
|
266
319
|
"--chip-color": m.tone
|
|
267
320
|
};
|
|
268
|
-
}), S =
|
|
321
|
+
}), S = s(() => {
|
|
269
322
|
if (m.disabled) return m.tone === "neutral" && !m.selected && !v.value ? "border border-on-surface/10 bg-transparent text-on-surface/38" : "border border-transparent bg-on-surface/12 text-on-surface/38";
|
|
270
323
|
if (v.value) return "border border-transparent bg-[var(--chip-bg)] text-[var(--chip-color)]";
|
|
271
324
|
if (m.tone === "neutral" && !m.selected) return "border border-outline-variant bg-transparent text-on-surface-variant";
|
|
@@ -278,14 +331,14 @@ var z = /* @__PURE__ */ p({
|
|
|
278
331
|
tertiary: "border border-transparent bg-tertiary-container text-on-tertiary-container"
|
|
279
332
|
};
|
|
280
333
|
return e[m.tone ?? "neutral"] ?? e.neutral;
|
|
281
|
-
}), C =
|
|
334
|
+
}), C = s(() => m.selected ? "rounded-full" : "rounded-md"), w = s(() => m.type === "filter" || m.type === "input"), T = s(() => m.type === "input" && !!_.avatar), D = s(() => !!m.trailingIcon || m.type === "input" && m.removable), A = s(() => {
|
|
282
335
|
let e = w.value && m.selected;
|
|
283
336
|
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";
|
|
284
337
|
if (e) return ["bg-secondary-container text-on-secondary-container", m.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
285
338
|
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
286
339
|
return m.elevated && m.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
287
|
-
}),
|
|
288
|
-
r(() => m.type === "filter" || m.type === "input" ? [
|
|
340
|
+
}), j = s(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), te = s(() => m.type === "input" ? [T.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", D.value ? "pr-2" : "pr-3"] : [m.icon || z.value ? "pl-2" : "pl-4", D.value ? "pr-2" : "pr-4"]), P = O(!1), L = O(), R = O(), z = s(() => m.type === "filter" && !m.icon);
|
|
341
|
+
r(() => m.type === "filter" || m.type === "input" ? [P.value ? 8 : m.selected ? 16 : 12, z.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
289
342
|
L.value && e !== void 0 && (L.value.style.borderRadius = `${e}px`), R.value && t !== void 0 && (R.value.style.width = `${t}px`);
|
|
290
343
|
}, t), r(() => z.value ? [+!!m.selected] : [], ([e]) => {
|
|
291
344
|
R.value && e !== void 0 && (R.value.style.opacity = String(e));
|
|
@@ -293,36 +346,36 @@ var z = /* @__PURE__ */ p({
|
|
|
293
346
|
function ne() {
|
|
294
347
|
m.disabled || (w.value && h("update:selected", !m.selected), h("click"));
|
|
295
348
|
}
|
|
296
|
-
return (e, t) => a.type ? (
|
|
349
|
+
return (e, t) => a.type ? (E(), u("span", {
|
|
297
350
|
key: 0,
|
|
298
351
|
ref_key: "typedEl",
|
|
299
352
|
ref: L,
|
|
300
|
-
class:
|
|
301
|
-
}, [
|
|
353
|
+
class: b(["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"]])
|
|
354
|
+
}, [d("button", {
|
|
302
355
|
type: "button",
|
|
303
|
-
class:
|
|
356
|
+
class: b(["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", [te.value, a.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"]]),
|
|
304
357
|
disabled: a.disabled,
|
|
305
358
|
"aria-pressed": w.value ? a.selected : void 0,
|
|
306
|
-
onPointerdown: t[0] ||= (e) =>
|
|
307
|
-
onPointerup: t[1] ||= (e) =>
|
|
308
|
-
onPointerleave: t[2] ||= (e) =>
|
|
309
|
-
onPointercancel: t[3] ||= (e) =>
|
|
359
|
+
onPointerdown: t[0] ||= (e) => P.value = !0,
|
|
360
|
+
onPointerup: t[1] ||= (e) => P.value = !1,
|
|
361
|
+
onPointerleave: t[2] ||= (e) => P.value = !1,
|
|
362
|
+
onPointercancel: t[3] ||= (e) => P.value = !1,
|
|
310
363
|
onClick: ne
|
|
311
364
|
}, [
|
|
312
|
-
|
|
365
|
+
T.value ? (E(), u("span", {
|
|
313
366
|
key: 0,
|
|
314
|
-
class:
|
|
315
|
-
}, [
|
|
367
|
+
class: b(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", a.disabled ? "opacity-38" : ""])
|
|
368
|
+
}, [k(e.$slots, "avatar")], 2)) : a.icon ? (E(), c(i, {
|
|
316
369
|
key: 1,
|
|
317
370
|
name: a.icon,
|
|
318
371
|
size: 18,
|
|
319
372
|
filled: a.type === "filter" && a.selected,
|
|
320
|
-
class:
|
|
373
|
+
class: b(["shrink-0", j.value])
|
|
321
374
|
}, null, 8, [
|
|
322
375
|
"name",
|
|
323
376
|
"filled",
|
|
324
377
|
"class"
|
|
325
|
-
])) : z.value ? (
|
|
378
|
+
])) : z.value ? (E(), u("span", {
|
|
326
379
|
key: 2,
|
|
327
380
|
ref_key: "checkEl",
|
|
328
381
|
ref: R,
|
|
@@ -332,59 +385,59 @@ var z = /* @__PURE__ */ p({
|
|
|
332
385
|
opacity: "0"
|
|
333
386
|
},
|
|
334
387
|
"aria-hidden": "true"
|
|
335
|
-
}, [
|
|
388
|
+
}, [p(i, {
|
|
336
389
|
name: "check",
|
|
337
390
|
size: 18,
|
|
338
|
-
class:
|
|
339
|
-
}, null, 8, ["class"])], 512)) :
|
|
340
|
-
|
|
341
|
-
a.trailingIcon ? (
|
|
391
|
+
class: b(["shrink-0", j.value])
|
|
392
|
+
}, null, 8, ["class"])], 512)) : l("", !0),
|
|
393
|
+
d("span", pe, [k(e.$slots, "default")]),
|
|
394
|
+
a.trailingIcon ? (E(), c(i, {
|
|
342
395
|
key: 3,
|
|
343
396
|
name: a.trailingIcon,
|
|
344
397
|
size: 18,
|
|
345
|
-
class:
|
|
346
|
-
}, null, 8, ["name", "class"])) :
|
|
347
|
-
], 42,
|
|
398
|
+
class: b(["shrink-0", a.disabled ? "" : a.selected && w.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
399
|
+
}, null, 8, ["name", "class"])) : l("", !0)
|
|
400
|
+
], 42, fe), a.type === "input" && a.removable ? (E(), u("button", {
|
|
348
401
|
key: 0,
|
|
349
402
|
type: "button",
|
|
350
|
-
class:
|
|
351
|
-
"aria-label":
|
|
403
|
+
class: b(["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"]),
|
|
404
|
+
"aria-label": M(g).remove,
|
|
352
405
|
disabled: a.disabled,
|
|
353
|
-
onClick: t[4] ||=
|
|
354
|
-
}, [
|
|
406
|
+
onClick: t[4] ||= I((e) => h("remove"), ["stop"])
|
|
407
|
+
}, [p(i, {
|
|
355
408
|
name: "close",
|
|
356
409
|
size: 18
|
|
357
|
-
})], 10,
|
|
410
|
+
})], 10, q)) : l("", !0)], 2)) : (E(), c(ee(a.clickable ? "button" : "span"), {
|
|
358
411
|
key: 1,
|
|
359
412
|
type: a.clickable ? "button" : void 0,
|
|
360
413
|
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
361
|
-
class:
|
|
414
|
+
class: b(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
362
415
|
C.value,
|
|
363
416
|
S.value,
|
|
364
|
-
a.clickable && !a.disabled ?
|
|
417
|
+
a.clickable && !a.disabled ? Y : "",
|
|
365
418
|
a.disabled ? "cursor-not-allowed" : ""
|
|
366
419
|
]]),
|
|
367
|
-
style:
|
|
420
|
+
style: x(y.value),
|
|
368
421
|
onClick: t[6] ||= (e) => a.clickable && !a.disabled && h("click")
|
|
369
422
|
}, {
|
|
370
|
-
default:
|
|
371
|
-
a.icon ? (
|
|
423
|
+
default: F(() => [
|
|
424
|
+
a.icon ? (E(), c(i, {
|
|
372
425
|
key: 0,
|
|
373
426
|
name: a.icon,
|
|
374
427
|
size: 18
|
|
375
|
-
}, null, 8, ["name"])) :
|
|
376
|
-
|
|
377
|
-
a.removable ? (
|
|
428
|
+
}, null, 8, ["name"])) : l("", !0),
|
|
429
|
+
k(e.$slots, "default"),
|
|
430
|
+
a.removable ? (E(), u("button", {
|
|
378
431
|
key: 1,
|
|
379
432
|
type: "button",
|
|
380
433
|
class: "-mr-1 ml-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12",
|
|
381
|
-
"aria-label":
|
|
434
|
+
"aria-label": M(g).remove,
|
|
382
435
|
disabled: a.disabled,
|
|
383
|
-
onClick: t[5] ||=
|
|
384
|
-
}, [
|
|
436
|
+
onClick: t[5] ||= I((e) => h("remove"), ["stop"])
|
|
437
|
+
}, [p(i, {
|
|
385
438
|
name: "close",
|
|
386
439
|
size: 16
|
|
387
|
-
})], 8,
|
|
440
|
+
})], 8, J)) : l("", !0)
|
|
388
441
|
]),
|
|
389
442
|
_: 3
|
|
390
443
|
}, 8, [
|
|
@@ -394,10 +447,162 @@ var z = /* @__PURE__ */ p({
|
|
|
394
447
|
"style"
|
|
395
448
|
]));
|
|
396
449
|
}
|
|
450
|
+
}), he = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, ge = [
|
|
451
|
+
"checked",
|
|
452
|
+
"disabled",
|
|
453
|
+
"name",
|
|
454
|
+
"required",
|
|
455
|
+
"aria-invalid",
|
|
456
|
+
"aria-describedby"
|
|
457
|
+
], X = {
|
|
458
|
+
key: 0,
|
|
459
|
+
class: "text-body-large text-on-surface"
|
|
460
|
+
}, Z = {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: "text-error"
|
|
463
|
+
}, _e = ["id"], ve = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", ye = /* @__PURE__ */ m({
|
|
464
|
+
__name: "MSwitch",
|
|
465
|
+
props: {
|
|
466
|
+
modelValue: { type: Boolean },
|
|
467
|
+
disabled: {
|
|
468
|
+
type: Boolean,
|
|
469
|
+
default: !1
|
|
470
|
+
},
|
|
471
|
+
label: {},
|
|
472
|
+
color: { default: "primary" },
|
|
473
|
+
icon: {
|
|
474
|
+
type: Boolean,
|
|
475
|
+
default: !0
|
|
476
|
+
},
|
|
477
|
+
error: { type: [Boolean, String] },
|
|
478
|
+
errorLabel: {},
|
|
479
|
+
required: { type: Boolean },
|
|
480
|
+
rules: {},
|
|
481
|
+
validateOn: {},
|
|
482
|
+
validateDebounce: {},
|
|
483
|
+
name: {}
|
|
484
|
+
},
|
|
485
|
+
emits: ["update:modelValue", "blur"],
|
|
486
|
+
setup(e, { expose: t, emit: n }) {
|
|
487
|
+
let r = e, m = n, h = O(null), g = a({
|
|
488
|
+
value: () => r.modelValue,
|
|
489
|
+
rules: () => r.rules,
|
|
490
|
+
required: () => r.required,
|
|
491
|
+
error: () => r.error,
|
|
492
|
+
errorLabel: () => r.errorLabel,
|
|
493
|
+
name: () => r.name,
|
|
494
|
+
validateOn: () => r.validateOn,
|
|
495
|
+
validateDebounce: () => r.validateDebounce,
|
|
496
|
+
disabled: () => r.disabled,
|
|
497
|
+
focus: () => {
|
|
498
|
+
h.value?.focus();
|
|
499
|
+
},
|
|
500
|
+
el: () => h.value,
|
|
501
|
+
setValue: (e) => m("update:modelValue", e)
|
|
502
|
+
}), _ = g.disabled, { hasError: v, message: y, messageId: S } = g, C = {
|
|
503
|
+
primary: "border-primary bg-primary",
|
|
504
|
+
secondary: "border-secondary bg-secondary",
|
|
505
|
+
tertiary: "border-tertiary bg-tertiary",
|
|
506
|
+
error: "border-error bg-error"
|
|
507
|
+
}, w = {
|
|
508
|
+
primary: "bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container",
|
|
509
|
+
secondary: "bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container",
|
|
510
|
+
tertiary: "bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container",
|
|
511
|
+
error: "bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container"
|
|
512
|
+
}, T = {
|
|
513
|
+
primary: "text-on-primary-container",
|
|
514
|
+
secondary: "text-on-secondary-container",
|
|
515
|
+
tertiary: "text-on-tertiary-container",
|
|
516
|
+
error: "text-on-error-container"
|
|
517
|
+
}, D = {
|
|
518
|
+
primary: "bg-primary",
|
|
519
|
+
secondary: "bg-secondary",
|
|
520
|
+
tertiary: "bg-tertiary",
|
|
521
|
+
error: "bg-error"
|
|
522
|
+
}, k = O(!1);
|
|
523
|
+
function ee() {
|
|
524
|
+
_.value || (k.value = !0);
|
|
525
|
+
}
|
|
526
|
+
function A() {
|
|
527
|
+
k.value = !1;
|
|
528
|
+
}
|
|
529
|
+
let te = s(() => k.value ? 28 / 24 : r.modelValue ? 1 : 16 / 24), N = s(() => ({
|
|
530
|
+
transform: `translateY(-50%) translateX(${r.modelValue ? 18 : 0}px) scale(${te.value})`,
|
|
531
|
+
transition: r.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"
|
|
532
|
+
})), P = s(() => ({
|
|
533
|
+
transform: `translateX(${r.modelValue ? 18 : 0}px)`,
|
|
534
|
+
transition: r.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)"
|
|
535
|
+
}));
|
|
536
|
+
return t({
|
|
537
|
+
validate: g.validate,
|
|
538
|
+
resetValidation: g.resetValidation
|
|
539
|
+
}), (t, n) => (E(), u("label", {
|
|
540
|
+
class: b(["group inline-flex gap-3 select-none", [M(_) ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer", M(y) ? "items-start" : "items-center"]]),
|
|
541
|
+
onPointerdown: ee,
|
|
542
|
+
onPointerup: A,
|
|
543
|
+
onPointerleave: A,
|
|
544
|
+
onPointercancel: A
|
|
545
|
+
}, [d("span", he, [d("span", { class: b(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? C[e.color] : "border-outline bg-surface-container-highest"]) }, [
|
|
546
|
+
d("input", {
|
|
547
|
+
type: "checkbox",
|
|
548
|
+
class: "peer sr-only",
|
|
549
|
+
checked: e.modelValue,
|
|
550
|
+
disabled: M(_),
|
|
551
|
+
ref_key: "inputEl",
|
|
552
|
+
ref: h,
|
|
553
|
+
role: "switch",
|
|
554
|
+
name: e.name,
|
|
555
|
+
required: e.required,
|
|
556
|
+
"aria-invalid": M(v) || void 0,
|
|
557
|
+
"aria-describedby": M(y) ? M(S) : void 0,
|
|
558
|
+
onChange: n[0] ||= (t) => m("update:modelValue", !e.modelValue),
|
|
559
|
+
onBlur: n[1] ||= (e) => {
|
|
560
|
+
M(g).onBlur(), m("blur", e);
|
|
561
|
+
}
|
|
562
|
+
}, null, 40, ge),
|
|
563
|
+
M(_) ? l("", !0) : (E(), u("span", {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: b(["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 ? D[e.color] : "bg-on-surface-variant"]),
|
|
566
|
+
style: x(P.value)
|
|
567
|
+
}, null, 6)),
|
|
568
|
+
M(_) ? l("", !0) : (E(), u("span", {
|
|
569
|
+
key: 1,
|
|
570
|
+
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",
|
|
571
|
+
style: x(P.value)
|
|
572
|
+
}, null, 4)),
|
|
573
|
+
d("span", {
|
|
574
|
+
class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [w[e.color], "shadow-sm"] : ve]),
|
|
575
|
+
style: x(N.value)
|
|
576
|
+
}, [p(o, {
|
|
577
|
+
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
578
|
+
"enter-from-class": "opacity-0",
|
|
579
|
+
"enter-to-class": "opacity-100",
|
|
580
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
581
|
+
"leave-from-class": "opacity-100",
|
|
582
|
+
"leave-to-class": "opacity-0"
|
|
583
|
+
}, {
|
|
584
|
+
default: F(() => [e.modelValue && e.icon ? (E(), c(i, {
|
|
585
|
+
key: 0,
|
|
586
|
+
name: "check",
|
|
587
|
+
size: 14,
|
|
588
|
+
class: b(T[e.color])
|
|
589
|
+
}, null, 8, ["class"])) : l("", !0)]),
|
|
590
|
+
_: 1
|
|
591
|
+
})], 6)
|
|
592
|
+
], 2)]), e.label || M(y) ? (E(), u("span", {
|
|
593
|
+
key: 0,
|
|
594
|
+
class: b(["flex flex-col", M(y) && "pt-1"])
|
|
595
|
+
}, [e.label ? (E(), u("span", X, [f(j(e.label), 1), e.required ? (E(), u("span", Z, "\xA0*")) : l("", !0)])) : l("", !0), M(y) ? (E(), u("span", {
|
|
596
|
+
key: 1,
|
|
597
|
+
id: M(S),
|
|
598
|
+
role: "alert",
|
|
599
|
+
class: "text-body-small text-error"
|
|
600
|
+
}, j(M(y)), 9, _e)) : l("", !0)], 2)) : l("", !0)], 34));
|
|
601
|
+
}
|
|
397
602
|
});
|
|
398
603
|
// src/composables/_useSegmentRuns.ts
|
|
399
|
-
function
|
|
400
|
-
let t =
|
|
604
|
+
function Q(e) {
|
|
605
|
+
let t = A(/* @__PURE__ */ new Map());
|
|
401
606
|
function n() {
|
|
402
607
|
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
403
608
|
r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
|
|
@@ -406,12 +611,12 @@ function q(e) {
|
|
|
406
611
|
i(), t.value = n;
|
|
407
612
|
}
|
|
408
613
|
let r;
|
|
409
|
-
return
|
|
614
|
+
return C(() => {
|
|
410
615
|
n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
|
|
411
|
-
}),
|
|
616
|
+
}), w(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
|
|
412
617
|
}
|
|
413
618
|
// src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
414
|
-
var
|
|
619
|
+
var be = ["role"], xe = /* @__PURE__ */ m({
|
|
415
620
|
__name: "MList",
|
|
416
621
|
props: {
|
|
417
622
|
dense: {
|
|
@@ -439,150 +644,51 @@ var J = ["role"], Y = /* @__PURE__ */ p({
|
|
|
439
644
|
},
|
|
440
645
|
emits: ["update:selected"],
|
|
441
646
|
setup(e, { emit: t }) {
|
|
442
|
-
let n = e, r = t, i =
|
|
443
|
-
|
|
647
|
+
let n = e, r = t, i = O(), a = Q(i);
|
|
648
|
+
D("m-list", {
|
|
444
649
|
segmentPosition: a,
|
|
445
|
-
dense:
|
|
446
|
-
nav:
|
|
447
|
-
segmented:
|
|
448
|
-
selectable:
|
|
449
|
-
selected:
|
|
450
|
-
dividers:
|
|
451
|
-
lines:
|
|
650
|
+
dense: s(() => n.dense),
|
|
651
|
+
nav: s(() => n.nav),
|
|
652
|
+
segmented: s(() => n.segmented),
|
|
653
|
+
selectable: s(() => n.selectable),
|
|
654
|
+
selected: s(() => n.selected),
|
|
655
|
+
dividers: s(() => n.dividers),
|
|
656
|
+
lines: s(() => n.lines),
|
|
452
657
|
select: (e) => r("update:selected", e)
|
|
453
658
|
});
|
|
454
|
-
let
|
|
659
|
+
let o = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
|
|
455
660
|
function c(e) {
|
|
456
661
|
if (!n.selectable) return;
|
|
457
|
-
let t =
|
|
662
|
+
let t = o(), r = t.indexOf(document.activeElement);
|
|
458
663
|
if (r < 0) return;
|
|
459
664
|
let i = e.key === "ArrowDown" ? t[r + 1] : e.key === "ArrowUp" ? t[r - 1] : e.key === "Home" ? t[0] : e.key === "End" ? t[t.length - 1] : void 0;
|
|
460
665
|
i && (e.preventDefault(), i.focus());
|
|
461
666
|
}
|
|
462
|
-
function
|
|
667
|
+
function l() {
|
|
463
668
|
if (!n.selectable) return;
|
|
464
|
-
let e =
|
|
669
|
+
let e = o();
|
|
465
670
|
e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
|
|
466
671
|
}
|
|
467
|
-
|
|
468
|
-
let d =
|
|
672
|
+
C(l), T(() => y(l));
|
|
673
|
+
let d = s(() => [
|
|
469
674
|
"flex flex-col",
|
|
470
675
|
n.segmented ? "gap-0.5 p-2" : "py-2",
|
|
471
676
|
n.nav && !n.segmented && "gap-0.5 px-3"
|
|
472
677
|
]);
|
|
473
|
-
return (t, n) => (
|
|
678
|
+
return (t, n) => (E(), u("ul", {
|
|
474
679
|
ref_key: "listEl",
|
|
475
680
|
ref: i,
|
|
476
681
|
role: e.selectable ? "listbox" : "list",
|
|
477
|
-
class:
|
|
682
|
+
class: b(d.value),
|
|
478
683
|
onKeydown: c
|
|
479
|
-
}, [
|
|
480
|
-
}
|
|
481
|
-
}), me = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], ge = {
|
|
482
|
-
key: 0,
|
|
483
|
-
class: "text-body-large text-on-surface"
|
|
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({
|
|
485
|
-
__name: "MSwitch",
|
|
486
|
-
props: {
|
|
487
|
-
modelValue: { type: Boolean },
|
|
488
|
-
disabled: {
|
|
489
|
-
type: Boolean,
|
|
490
|
-
default: !1
|
|
491
|
-
},
|
|
492
|
-
label: {},
|
|
493
|
-
color: { default: "primary" },
|
|
494
|
-
icon: {
|
|
495
|
-
type: Boolean,
|
|
496
|
-
default: !0
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
emits: ["update:modelValue"],
|
|
500
|
-
setup(e, { emit: t }) {
|
|
501
|
-
let n = e, r = t, d = {
|
|
502
|
-
primary: "border-primary bg-primary",
|
|
503
|
-
secondary: "border-secondary bg-secondary",
|
|
504
|
-
tertiary: "border-tertiary bg-tertiary",
|
|
505
|
-
error: "border-error bg-error"
|
|
506
|
-
}, p = {
|
|
507
|
-
primary: "bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container",
|
|
508
|
-
secondary: "bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container",
|
|
509
|
-
tertiary: "bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container",
|
|
510
|
-
error: "bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container"
|
|
511
|
-
}, m = {
|
|
512
|
-
primary: "text-on-primary-container",
|
|
513
|
-
secondary: "text-on-secondary-container",
|
|
514
|
-
tertiary: "text-on-tertiary-container",
|
|
515
|
-
error: "text-on-error-container"
|
|
516
|
-
}, h = {
|
|
517
|
-
primary: "bg-primary",
|
|
518
|
-
secondary: "bg-secondary",
|
|
519
|
-
tertiary: "bg-tertiary",
|
|
520
|
-
error: "bg-error"
|
|
521
|
-
}, g = D(!1);
|
|
522
|
-
function _() {
|
|
523
|
-
n.disabled || (g.value = !0);
|
|
524
|
-
}
|
|
525
|
-
function v() {
|
|
526
|
-
g.value = !1;
|
|
527
|
-
}
|
|
528
|
-
let x = o(() => g.value ? 28 / 24 : n.modelValue ? 1 : 16 / 24), S = o(() => ({
|
|
529
|
-
transform: `translateY(-50%) translateX(${n.modelValue ? 18 : 0}px) scale(${x.value})`,
|
|
530
|
-
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"
|
|
531
|
-
})), C = o(() => ({
|
|
532
|
-
transform: `translateX(${n.modelValue ? 18 : 0}px)`,
|
|
533
|
-
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)"
|
|
534
|
-
}));
|
|
535
|
-
return (t, n) => (T(), l("label", {
|
|
536
|
-
class: y(["group inline-flex items-center gap-3 select-none", e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer"]),
|
|
537
|
-
onPointerdown: _,
|
|
538
|
-
onPointerup: v,
|
|
539
|
-
onPointerleave: v,
|
|
540
|
-
onPointercancel: v
|
|
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"]) }, [
|
|
542
|
-
u("input", {
|
|
543
|
-
type: "checkbox",
|
|
544
|
-
class: "peer sr-only",
|
|
545
|
-
checked: e.modelValue,
|
|
546
|
-
disabled: e.disabled,
|
|
547
|
-
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
548
|
-
}, null, 40, he),
|
|
549
|
-
e.disabled ? c("", !0) : (T(), l("span", {
|
|
550
|
-
key: 0,
|
|
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"]),
|
|
552
|
-
style: b(C.value)
|
|
553
|
-
}, null, 6)),
|
|
554
|
-
e.disabled ? c("", !0) : (T(), l("span", {
|
|
555
|
-
key: 1,
|
|
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",
|
|
557
|
-
style: b(C.value)
|
|
558
|
-
}, null, 4)),
|
|
559
|
-
u("span", {
|
|
560
|
-
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]),
|
|
561
|
-
style: b(S.value)
|
|
562
|
-
}, [f(a, {
|
|
563
|
-
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
564
|
-
"enter-from-class": "opacity-0",
|
|
565
|
-
"enter-to-class": "opacity-100",
|
|
566
|
-
"leave-active-class": "transition-opacity duration-75",
|
|
567
|
-
"leave-from-class": "opacity-100",
|
|
568
|
-
"leave-to-class": "opacity-0"
|
|
569
|
-
}, {
|
|
570
|
-
default: P(() => [e.modelValue && e.icon ? (T(), s(i, {
|
|
571
|
-
key: 0,
|
|
572
|
-
name: "check",
|
|
573
|
-
size: 14,
|
|
574
|
-
class: y(m[e.color])
|
|
575
|
-
}, null, 8, ["class"])) : c("", !0)]),
|
|
576
|
-
_: 1
|
|
577
|
-
})], 6)
|
|
578
|
-
], 2)]), e.label ? (T(), l("span", ge, A(e.label), 1)) : c("", !0)], 34));
|
|
684
|
+
}, [k(t.$slots, "default")], 42, be));
|
|
579
685
|
}
|
|
580
|
-
}),
|
|
686
|
+
}), Se = [
|
|
581
687
|
"tabindex",
|
|
582
688
|
"aria-expanded",
|
|
583
689
|
"aria-controls",
|
|
584
690
|
"aria-disabled"
|
|
585
|
-
],
|
|
691
|
+
], Ce = { class: "min-w-0 flex-1" }, we = ["id"], Te = ["src"], Ee = { class: "min-w-0 flex-1" }, De = 4, Oe = 8, ke = 16, Ae = "button, a, input, select, textarea, label, [role=\"button\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"link\"], [tabindex]", je = /* @__PURE__ */ m({
|
|
586
692
|
inheritAttrs: !1,
|
|
587
693
|
__name: "MListItem",
|
|
588
694
|
props: {
|
|
@@ -625,46 +731,46 @@ var J = ["role"], Y = /* @__PURE__ */ p({
|
|
|
625
731
|
"update:expanded"
|
|
626
732
|
],
|
|
627
733
|
setup(e, { emit: t }) {
|
|
628
|
-
let n = e,
|
|
629
|
-
|
|
630
|
-
e !== void 0 && (
|
|
734
|
+
let n = e, a = t, f = h(), m = () => !!f?.vnode.props?.onClick, y = O(n.expanded ?? !1);
|
|
735
|
+
P(() => n.expanded, (e) => {
|
|
736
|
+
e !== void 0 && (y.value = e);
|
|
631
737
|
});
|
|
632
|
-
let S =
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
738
|
+
let S = s(() => y.value), C = _("m-list", null), w = s(() => n.lines ? n.lines : C?.lines.value ? C.lines.value : n.description || n.overline && n.subtitle ? 3 : n.subtitle || n.overline ? 2 : 1), T = s(() => n.clickable || n.href || n.to || m() || C?.selectable.value || n.expandable), D = s(() => !!C?.selectable.value && n.value != null && !n.href && !n.to && !n.expandable), A = s(() => !!(n.href || n.to)), N = s(() => !D.value && !A.value && !n.expandable && (n.clickable || m())), I = s(() => A.value || N.value), L = s(() => D.value ? "option" : N.value ? "button" : A.value ? void 0 : "listitem"), R = s(() => {
|
|
739
|
+
if (D.value) return B.value && !n.disabled ? 0 : -1;
|
|
740
|
+
if (N.value) return n.disabled ? -1 : 0;
|
|
635
741
|
});
|
|
636
|
-
function
|
|
637
|
-
(
|
|
742
|
+
function z(e) {
|
|
743
|
+
(D.value || N.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), $(e)));
|
|
638
744
|
}
|
|
639
|
-
let B =
|
|
745
|
+
let B = s(() => n.active ? !0 : C?.selectable.value && n.value != null ? C.selected.value === n.value : !1), V = s(() => n.leading ? n.leading : n.icon ? "icon" : n.avatarName ? "avatar" : n.image ? "image" : null), H = s(() => n.expandable ? "expand" : n.trailing ? n.trailing : n.trailingIcon ? "icon" : n.trailingText ? "text" : null), re = {
|
|
640
746
|
primary: "bg-primary-container text-on-primary-container",
|
|
641
747
|
secondary: "bg-secondary-container text-on-secondary-container",
|
|
642
748
|
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
643
749
|
error: "bg-error-container text-on-error-container",
|
|
644
750
|
success: "bg-success-container text-on-success-container"
|
|
645
|
-
},
|
|
751
|
+
}, ie = s(() => C?.dense.value ?? !1), U = s(() => C?.nav.value ?? !1), W = s(() => C?.segmented.value ?? !1), ae = s(() => C?.dividers.value ?? !1), oe = s(() => B.value ? "text-on-secondary-container" : "text-on-surface"), G = s(() => B.value ? "text-on-secondary-container" : "text-on-surface-variant"), se = s(() => ie.value ? "" : w.value === 3 ? "min-h-22" : w.value === 2 ? "min-h-18" : "min-h-14"), ce = s(() => [
|
|
646
752
|
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
647
|
-
|
|
648
|
-
|
|
753
|
+
W.value ? "bg-surface-container px-4" : U.value ? "rounded-full px-4" : "px-4",
|
|
754
|
+
ie.value ? "py-1" : w.value === 3 ? "py-3" : "py-2",
|
|
649
755
|
se.value,
|
|
650
|
-
|
|
756
|
+
T.value && !n.disabled && "cursor-pointer",
|
|
651
757
|
B.value && "bg-secondary-container text-on-secondary-container",
|
|
652
758
|
n.disabled && "opacity-[0.38] pointer-events-none"
|
|
653
|
-
]), K =
|
|
759
|
+
]), K = O(null), le = O(null), ue = (e, { slots: t }) => I.value ? g("li", {
|
|
654
760
|
role: "listitem",
|
|
655
761
|
ref: (e) => {
|
|
656
|
-
|
|
762
|
+
le.value = e;
|
|
657
763
|
}
|
|
658
|
-
}, t.default?.()) : t.default?.(), fe =
|
|
659
|
-
if (
|
|
660
|
-
let e =
|
|
764
|
+
}, t.default?.()) : t.default?.(), fe = O(null), pe = (e) => e && "$el" in e ? e.$el : e, q = O(!1), J = O(!1), Y = O(!1), me = s(() => W.value ? C?.segmentPosition(I.value ? le.value : pe(K.value)) : void 0), he = s(() => {
|
|
765
|
+
if (U.value) return [];
|
|
766
|
+
let e = T.value && !n.disabled, t = e && J.value || B.value || e && Y.value ? ke : e && q.value ? Oe : null;
|
|
661
767
|
if (t !== null) return [
|
|
662
768
|
t,
|
|
663
769
|
t,
|
|
664
770
|
t,
|
|
665
771
|
t
|
|
666
772
|
];
|
|
667
|
-
let r = me.value, i = r === "first" || r === "single" ?
|
|
773
|
+
let r = me.value, i = r === "first" || r === "single" ? ke : De, a = r === "last" || r === "single" ? ke : De;
|
|
668
774
|
return [
|
|
669
775
|
i,
|
|
670
776
|
i,
|
|
@@ -675,109 +781,109 @@ var J = ["role"], Y = /* @__PURE__ */ p({
|
|
|
675
781
|
let t = fe.value ?? pe(K.value);
|
|
676
782
|
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
677
783
|
});
|
|
678
|
-
|
|
784
|
+
P([me, U], () => ge());
|
|
679
785
|
function X(e) {
|
|
680
|
-
let t = e.currentTarget, n = e.target?.closest?.(
|
|
786
|
+
let t = e.currentTarget, n = e.target?.closest?.(Ae);
|
|
681
787
|
return !!n && n !== t && t.contains(n) && !n.closest("[data-mli-part]");
|
|
682
788
|
}
|
|
683
789
|
function Z(e) {
|
|
684
790
|
e.pointerType !== "touch" && (q.value = !X(e));
|
|
685
791
|
}
|
|
686
|
-
function
|
|
792
|
+
function _e() {
|
|
687
793
|
q.value = !1, J.value = !1;
|
|
688
794
|
}
|
|
689
|
-
function
|
|
795
|
+
function ve(e) {
|
|
690
796
|
e.button === 0 && !X(e) && (J.value = !0);
|
|
691
797
|
}
|
|
692
798
|
function Q() {
|
|
693
799
|
J.value = !1;
|
|
694
800
|
}
|
|
695
|
-
let
|
|
801
|
+
let be = s(() => !T.value || n.disabled ? 0 : J.value ? .12 : q.value ? .08 : 0), xe = s(() => n.indent === void 0 ? void 0 : { paddingLeft: typeof n.indent == "number" ? `${n.indent}px` : n.indent });
|
|
696
802
|
function je(e) {
|
|
697
803
|
Y.value = e.currentTarget.matches(":focus-visible");
|
|
698
804
|
}
|
|
699
805
|
function Me() {
|
|
700
806
|
Y.value = !1;
|
|
701
807
|
}
|
|
702
|
-
let Ne =
|
|
808
|
+
let Ne = s(() => n.href ? "a" : n.to ? "router-link" : N.value ? "div" : "li"), Pe = s(() => n.href ? { href: n.href } : n.to ? { to: n.to } : {}), Fe = te();
|
|
703
809
|
function Ie(e) {
|
|
704
810
|
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), $(e));
|
|
705
811
|
}
|
|
706
812
|
function Le(e) {
|
|
707
|
-
n.disabled || (
|
|
813
|
+
n.disabled || (y.value = !y.value, a("update:expanded", y.value), a("click", e));
|
|
708
814
|
}
|
|
709
815
|
function $(e) {
|
|
710
816
|
if (!n.disabled) {
|
|
711
817
|
if (n.expandable) {
|
|
712
818
|
if (X(e)) return;
|
|
713
819
|
Le(e);
|
|
714
|
-
} else C?.selectable.value && n.value != null && C.select(n.value),
|
|
820
|
+
} else C?.selectable.value && n.value != null && C.select(n.value), a("click", e);
|
|
715
821
|
}
|
|
716
822
|
}
|
|
717
823
|
function Re() {
|
|
718
|
-
|
|
824
|
+
a("update:trailingValue", !n.trailingValue);
|
|
719
825
|
}
|
|
720
|
-
return (t, n) => e.expandable ? (
|
|
826
|
+
return (t, n) => e.expandable ? (E(), u("li", v({
|
|
721
827
|
key: 0,
|
|
722
828
|
ref_key: "rootEl",
|
|
723
829
|
ref: K
|
|
724
|
-
}, t.$attrs, { role: "listitem" }), [
|
|
830
|
+
}, t.$attrs, { role: "listitem" }), [d("div", {
|
|
725
831
|
ref_key: "shapeEl",
|
|
726
832
|
ref: fe,
|
|
727
833
|
role: "button",
|
|
728
834
|
tabindex: e.disabled ? -1 : 0,
|
|
729
835
|
"aria-expanded": S.value,
|
|
730
|
-
"aria-controls":
|
|
836
|
+
"aria-controls": M(Fe),
|
|
731
837
|
"aria-disabled": e.disabled || void 0,
|
|
732
|
-
class:
|
|
838
|
+
class: b(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", ce.value]),
|
|
733
839
|
onClick: $,
|
|
734
840
|
onKeydown: Ie,
|
|
735
841
|
onFocus: je,
|
|
736
842
|
onBlur: Me,
|
|
737
843
|
onPointerenter: Z,
|
|
738
844
|
onPointermove: Z,
|
|
739
|
-
onPointerleave:
|
|
740
|
-
onPointerdown:
|
|
845
|
+
onPointerleave: _e,
|
|
846
|
+
onPointerdown: ve,
|
|
741
847
|
onPointerup: Q,
|
|
742
848
|
onPointercancel: Q
|
|
743
849
|
}, [
|
|
744
|
-
|
|
745
|
-
class:
|
|
746
|
-
style:
|
|
850
|
+
d("span", {
|
|
851
|
+
class: b(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
852
|
+
style: x({ opacity: be.value }),
|
|
747
853
|
"aria-hidden": "true"
|
|
748
854
|
}, null, 6),
|
|
749
|
-
|
|
855
|
+
k(t.$slots, "leading", {}, () => [V.value === "icon" ? (E(), c(i, {
|
|
750
856
|
key: 0,
|
|
751
857
|
name: e.icon,
|
|
752
858
|
size: 24,
|
|
753
|
-
class:
|
|
754
|
-
}, null, 8, ["name", "class"])) :
|
|
755
|
-
|
|
859
|
+
class: b(["shrink-0", G.value])
|
|
860
|
+
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
861
|
+
d("div", Ce, [k(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
756
862
|
key: 0,
|
|
757
|
-
class:
|
|
758
|
-
},
|
|
863
|
+
class: b(["truncate text-label-small", G.value])
|
|
864
|
+
}, j(e.overline), 3)) : l("", !0)]), k(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large", oe.value]) }, j(e.title), 3), e.subtitle && w.value >= 2 ? (E(), u("p", {
|
|
759
865
|
key: 0,
|
|
760
|
-
class:
|
|
761
|
-
},
|
|
762
|
-
|
|
763
|
-
|
|
866
|
+
class: b(["text-body-medium", [G.value, w.value === 2 && "truncate"]])
|
|
867
|
+
}, j(e.subtitle), 3)) : l("", !0)])]),
|
|
868
|
+
k(t.$slots, "trailing"),
|
|
869
|
+
p(i, {
|
|
764
870
|
name: S.value ? "expand_less" : "expand_more",
|
|
765
871
|
size: 20,
|
|
766
|
-
class:
|
|
872
|
+
class: b(["shrink-0", G.value])
|
|
767
873
|
}, null, 8, ["name", "class"])
|
|
768
|
-
], 42,
|
|
769
|
-
default:
|
|
874
|
+
], 42, Se), p(o, { name: "mli-expand" }, {
|
|
875
|
+
default: F(() => [S.value ? (E(), u("div", {
|
|
770
876
|
key: 0,
|
|
771
|
-
id:
|
|
877
|
+
id: M(Fe),
|
|
772
878
|
class: "mli-expand-grid"
|
|
773
|
-
}, [
|
|
879
|
+
}, [d("div", {
|
|
774
880
|
class: "mli-expand-body",
|
|
775
|
-
style:
|
|
776
|
-
}, [
|
|
881
|
+
style: x(xe.value)
|
|
882
|
+
}, [k(t.$slots, "children")], 4)], 8, we)) : l("", !0)]),
|
|
777
883
|
_: 3
|
|
778
|
-
})], 16)) : (
|
|
779
|
-
default:
|
|
780
|
-
class:
|
|
884
|
+
})], 16)) : (E(), c(ue, { key: 1 }, {
|
|
885
|
+
default: F(() => [(E(), c(ee(Ne.value), v({
|
|
886
|
+
class: ce.value,
|
|
781
887
|
ref_key: "rootEl",
|
|
782
888
|
ref: K
|
|
783
889
|
}, {
|
|
@@ -786,87 +892,87 @@ var J = ["role"], Y = /* @__PURE__ */ p({
|
|
|
786
892
|
}, {
|
|
787
893
|
role: L.value,
|
|
788
894
|
tabindex: R.value,
|
|
789
|
-
"aria-selected":
|
|
790
|
-
"aria-disabled": (
|
|
895
|
+
"aria-selected": D.value ? B.value : void 0,
|
|
896
|
+
"aria-disabled": (D.value || N.value) && e.disabled ? "true" : void 0,
|
|
791
897
|
onClick: $,
|
|
792
|
-
onKeydown:
|
|
898
|
+
onKeydown: z,
|
|
793
899
|
onPointerenter: Z,
|
|
794
900
|
onPointermove: Z,
|
|
795
|
-
onPointerleave:
|
|
796
|
-
onPointerdown:
|
|
901
|
+
onPointerleave: _e,
|
|
902
|
+
onPointerdown: ve,
|
|
797
903
|
onPointerup: Q,
|
|
798
904
|
onPointercancel: Q,
|
|
799
905
|
onFocus: je,
|
|
800
906
|
onBlur: Me
|
|
801
907
|
}), {
|
|
802
|
-
default:
|
|
803
|
-
|
|
804
|
-
class:
|
|
805
|
-
style:
|
|
908
|
+
default: F(() => [
|
|
909
|
+
d("span", {
|
|
910
|
+
class: b(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", B.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
911
|
+
style: x({ opacity: be.value }),
|
|
806
912
|
"aria-hidden": "true"
|
|
807
913
|
}, null, 6),
|
|
808
|
-
ae.value ? (
|
|
914
|
+
ae.value ? (E(), u("div", {
|
|
809
915
|
key: 0,
|
|
810
|
-
class:
|
|
811
|
-
}, null, 2)) :
|
|
812
|
-
|
|
916
|
+
class: b(["absolute top-0 right-0 h-px bg-outline-variant", ae.value === "inset" ? "left-16" : "left-0"])
|
|
917
|
+
}, null, 2)) : l("", !0),
|
|
918
|
+
k(t.$slots, "leading", {}, () => [V.value === "icon" ? (E(), c(i, {
|
|
813
919
|
key: 0,
|
|
814
920
|
name: e.icon,
|
|
815
921
|
size: 24,
|
|
816
|
-
class:
|
|
817
|
-
}, null, 8, ["name", "class"])) : V.value === "icon-container" ? (
|
|
922
|
+
class: b(["shrink-0", G.value])
|
|
923
|
+
}, null, 8, ["name", "class"])) : V.value === "icon-container" ? (E(), u("div", {
|
|
818
924
|
key: 1,
|
|
819
|
-
class:
|
|
820
|
-
}, [
|
|
925
|
+
class: b(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", re[e.iconContainerColor || "primary"]])
|
|
926
|
+
}, [p(i, {
|
|
821
927
|
name: e.icon,
|
|
822
928
|
size: 24
|
|
823
|
-
}, null, 8, ["name"])], 2)) : V.value === "avatar" ? (
|
|
929
|
+
}, null, 8, ["name"])], 2)) : V.value === "avatar" ? (E(), c(ne, {
|
|
824
930
|
key: 2,
|
|
825
931
|
name: e.avatarName,
|
|
826
932
|
size: 40,
|
|
827
933
|
class: "shrink-0"
|
|
828
|
-
}, null, 8, ["name"])) : V.value === "image" ? (
|
|
934
|
+
}, null, 8, ["name"])) : V.value === "image" ? (E(), u("img", {
|
|
829
935
|
key: 3,
|
|
830
936
|
src: e.image,
|
|
831
937
|
alt: "",
|
|
832
938
|
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
833
|
-
}, null, 8,
|
|
939
|
+
}, null, 8, Te)) : V.value === "checkbox" ? (E(), c(de, {
|
|
834
940
|
key: 4,
|
|
835
941
|
"model-value": B.value,
|
|
836
942
|
class: "shrink-0",
|
|
837
943
|
"data-mli-part": ""
|
|
838
|
-
}, null, 8, ["model-value"])) :
|
|
839
|
-
|
|
944
|
+
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
945
|
+
d("div", Ee, [k(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
840
946
|
key: 0,
|
|
841
|
-
class:
|
|
842
|
-
},
|
|
843
|
-
|
|
844
|
-
e.subtitle && w.value >= 2 ? (
|
|
947
|
+
class: b(["truncate text-label-small", G.value])
|
|
948
|
+
}, j(e.overline), 3)) : l("", !0)]), k(t.$slots, "default", {}, () => [
|
|
949
|
+
d("p", { class: b(["truncate text-body-large", oe.value]) }, j(e.title), 3),
|
|
950
|
+
e.subtitle && w.value >= 2 ? (E(), u("p", {
|
|
845
951
|
key: 0,
|
|
846
|
-
class:
|
|
847
|
-
},
|
|
848
|
-
e.description && w.value >= 3 ? (
|
|
952
|
+
class: b(["text-body-medium", [G.value, w.value === 2 && "truncate"]])
|
|
953
|
+
}, j(e.subtitle), 3)) : l("", !0),
|
|
954
|
+
e.description && w.value >= 3 ? (E(), u("p", {
|
|
849
955
|
key: 1,
|
|
850
|
-
class:
|
|
851
|
-
},
|
|
956
|
+
class: b(["line-clamp-2 text-body-small", G.value])
|
|
957
|
+
}, j(e.description), 3)) : l("", !0)
|
|
852
958
|
])]),
|
|
853
|
-
|
|
959
|
+
k(t.$slots, "trailing", {}, () => [H.value === "icon" ? (E(), c(i, {
|
|
854
960
|
key: 0,
|
|
855
961
|
name: e.trailingIcon,
|
|
856
962
|
size: 24,
|
|
857
|
-
class:
|
|
858
|
-
}, null, 8, ["name", "class"])) : H.value === "text" ? (
|
|
963
|
+
class: b(["shrink-0", G.value])
|
|
964
|
+
}, null, 8, ["name", "class"])) : H.value === "text" ? (E(), u("span", {
|
|
859
965
|
key: 1,
|
|
860
|
-
class:
|
|
861
|
-
},
|
|
966
|
+
class: b(["shrink-0 text-label-small", G.value])
|
|
967
|
+
}, j(e.trailingText), 3)) : H.value === "switch" ? (E(), c(ye, {
|
|
862
968
|
key: 2,
|
|
863
969
|
"model-value": !!e.trailingValue,
|
|
864
970
|
"onUpdate:modelValue": Re
|
|
865
|
-
}, null, 8, ["model-value"])) : H.value === "checkbox" ? (
|
|
971
|
+
}, null, 8, ["model-value"])) : H.value === "checkbox" ? (E(), c(de, {
|
|
866
972
|
key: 3,
|
|
867
973
|
"model-value": !!e.trailingValue,
|
|
868
974
|
"onUpdate:modelValue": Re
|
|
869
|
-
}, null, 8, ["model-value"])) :
|
|
975
|
+
}, null, 8, ["model-value"])) : l("", !0)])
|
|
870
976
|
]),
|
|
871
977
|
_: 3
|
|
872
978
|
}, 16, [
|
|
@@ -880,6 +986,6 @@ var J = ["role"], Y = /* @__PURE__ */ p({
|
|
|
880
986
|
}));
|
|
881
987
|
}
|
|
882
988
|
});
|
|
883
|
-
export {
|
|
989
|
+
export { me as a, ne as c, ye as i, z as l, xe as n, de as o, Q as r, oe as s, je as t };
|
|
884
990
|
|
|
885
|
-
//# sourceMappingURL=MListItem-
|
|
991
|
+
//# sourceMappingURL=MListItem-DiOAxaN7.js.map
|