@m3ui-vue/m3ui-vue 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +135 -5
- package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
- package/dist/MIcon-Bxh9j135.js.map +1 -0
- package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BckcR0nW.js} +4 -4
- package/dist/{MMenuItem-DVxKEv1W.js.map → MMenuItem-BckcR0nW.js.map} +1 -1
- package/dist/{MSlider-BXsBv0ox.js → MSlider-LyH_gy8D.js} +56 -47
- package/dist/MSlider-LyH_gy8D.js.map +1 -0
- package/dist/{MTextField-rML9jnXs.js → MTextField-FCPOTB0o.js} +65 -64
- package/dist/{MTextField-rML9jnXs.js.map → MTextField-FCPOTB0o.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MAnimatedNumber.vue.d.ts +27 -0
- package/dist/components/MIcon.vue.d.ts +2 -0
- package/dist/components/MListGroup.vue.d.ts +23 -0
- package/dist/components/MScheduler.vue.d.ts +2 -2
- package/dist/components/MScheme.vue.d.ts +60 -0
- package/dist/components/MSparkline.vue.d.ts +41 -0
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
- package/dist/composables/_useSegmentRuns.d.ts +8 -0
- package/dist/composables/dynamicColor.d.ts +11 -0
- package/dist/composables/useColorPalette.d.ts +3 -1
- package/dist/composables/useConfetti.d.ts +32 -0
- package/dist/composables/useLocale.d.ts +6 -0
- package/dist/index.d.ts +7 -1
- package/dist/locales/index.js +21 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +16187 -15377
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +45 -45
- package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
- package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
- package/dist/rich-text-editor.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-CqQrhWFl.js → useLocale-SfQHnJfp.js} +4 -1
- package/dist/useLocale-SfQHnJfp.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAnimatedNumber.test.ts +106 -0
- package/src/__tests__/MIcon.test.ts +19 -0
- package/src/__tests__/MListItemShape.test.ts +34 -0
- package/src/__tests__/MScheme.test.ts +107 -0
- package/src/__tests__/MSparkline.test.ts +96 -0
- package/src/__tests__/iconButtonNames.test.ts +124 -0
- package/src/__tests__/ssr.test.ts +1 -0
- package/src/__tests__/useConfetti.test.ts +81 -0
- package/src/components/MAnimatedNumber.vue +301 -0
- package/src/components/MAutocomplete.vue +34 -4
- package/src/components/MBottomSheet.vue +1 -0
- package/src/components/MDataTable.vue +1 -1
- package/src/components/MIcon.vue +11 -4
- package/src/components/MList.vue +8 -30
- package/src/components/MListGroup.vue +66 -0
- package/src/components/MMaskField.vue +3 -0
- package/src/components/MMultiAutocomplete.vue +5 -1
- package/src/components/MMultiSelect.vue +19 -9
- package/src/components/MScheme.vue +162 -0
- package/src/components/MSearchBar.vue +2 -0
- package/src/components/MSelect.vue +44 -10
- package/src/components/MSideSheet.vue +3 -0
- package/src/components/MSimpleCarousel.vue +6 -0
- package/src/components/MSparkline.vue +250 -0
- package/src/components/MSplitButton.vue +3 -0
- package/src/components/MSpotlightSearch.vue +1 -0
- package/src/components/MTable.vue +1 -0
- package/src/components/MTagInput.vue +4 -0
- package/src/components/MTextField.vue +3 -0
- package/src/components/MTour.vue +1 -0
- package/src/components/MTreeTable.vue +1 -0
- package/src/components/_MTreeNode.vue +3 -0
- package/src/composables/_useSegmentRuns.ts +39 -0
- package/src/composables/dynamicColor.ts +66 -0
- package/src/composables/useColorPalette.ts +2 -2
- package/src/composables/useConfetti.ts +204 -0
- package/src/composables/useLocale.ts +9 -0
- package/src/index.ts +7 -1
- package/src/locales/de.ts +3 -0
- package/src/locales/es.ts +3 -0
- package/src/locales/fr.ts +3 -0
- package/src/locales/ja.ts +3 -0
- package/src/locales/ko.ts +3 -0
- package/src/locales/pt.ts +3 -0
- package/src/locales/zh.ts +3 -0
- package/dist/MIcon-DLOkQduI.js.map +0 -1
- package/dist/MSlider-BXsBv0ox.js.map +0 -1
- package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
- package/dist/useLocale-CqQrhWFl.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import { t } from "./MIcon-
|
|
1
|
+
import { i as e } from "./useLocale-SfQHnJfp.js";
|
|
2
|
+
import { t } from "./MIcon-Bxh9j135.js";
|
|
3
3
|
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, useSlots as S, watch as C, withCtx as w, withDirectives as T } from "vue";
|
|
4
4
|
//#region src/directives/vRipple.ts
|
|
5
5
|
function E(e) {
|
|
@@ -38,7 +38,7 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
|
|
|
38
38
|
"width",
|
|
39
39
|
"height",
|
|
40
40
|
"viewBox"
|
|
41
|
-
],
|
|
41
|
+
], ee = ["d", "stroke-dasharray"], N = 3, P = 9, F = /* @__PURE__ */ l({
|
|
42
42
|
__name: "MSpinner",
|
|
43
43
|
props: {
|
|
44
44
|
size: { default: 20 },
|
|
@@ -49,10 +49,10 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
|
|
|
49
49
|
label: {}
|
|
50
50
|
},
|
|
51
51
|
setup(t) {
|
|
52
|
-
let r = t, i = e(), s = n(() => (r.size / 2 - 1 -
|
|
52
|
+
let r = t, i = e(), s = n(() => (r.size / 2 - 1 - N / 2) / 1.25), c = n(() => r.size / 2), l = n(() => {
|
|
53
53
|
let e = c.value, t = s.value, n = t * .08, r = [], i = 0, a = 0, o = 0;
|
|
54
54
|
for (let s = 0; s <= 216; s++) {
|
|
55
|
-
let c = 2 * Math.PI * s / 216 - Math.PI / 2, l = t + n * Math.sin(
|
|
55
|
+
let c = 2 * Math.PI * s / 216 - Math.PI / 2, l = t + n * Math.sin(P * c), u = e + l * Math.cos(c), d = e + l * Math.sin(c);
|
|
56
56
|
s > 0 && (i += Math.sqrt((u - a) ** 2 + (d - o) ** 2)), r.push(`${s === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), a = u, o = d;
|
|
57
57
|
}
|
|
58
58
|
let l = i * .58, u = i - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
|
|
@@ -81,14 +81,14 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
|
|
|
81
81
|
}, [o("path", {
|
|
82
82
|
d: l.value.path,
|
|
83
83
|
stroke: "currentColor",
|
|
84
|
-
"stroke-width":
|
|
84
|
+
"stroke-width": N,
|
|
85
85
|
"stroke-linecap": "round",
|
|
86
86
|
"stroke-dasharray": l.value.dash,
|
|
87
87
|
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
88
88
|
style: d({ "--m3-wave-len": l.value.len })
|
|
89
|
-
}, null, 12,
|
|
89
|
+
}, null, 12, ee)], 12, M)) : (h(), a("span", j))], 12, A));
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
91
|
+
}), I = [
|
|
92
92
|
"bg-surface-container-highest",
|
|
93
93
|
"bg-surface-container-high",
|
|
94
94
|
"bg-surface-container-low",
|
|
@@ -115,11 +115,11 @@ var O = /* @__PURE__ */ new WeakMap(), k = {
|
|
|
115
115
|
"bg-tertiary",
|
|
116
116
|
"bg-error"
|
|
117
117
|
];
|
|
118
|
-
function
|
|
119
|
-
for (let t of
|
|
118
|
+
function L(e) {
|
|
119
|
+
for (let t of I) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
|
|
120
120
|
return null;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function R(e) {
|
|
123
123
|
if (!e || e === "transparent") return !0;
|
|
124
124
|
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
125
125
|
if (t) {
|
|
@@ -136,7 +136,7 @@ function z(e, t) {
|
|
|
136
136
|
function a() {
|
|
137
137
|
let t = e.value?.parentElement ?? null;
|
|
138
138
|
for (; t;) {
|
|
139
|
-
let e =
|
|
139
|
+
let e = L(t);
|
|
140
140
|
if (e) {
|
|
141
141
|
i(e);
|
|
142
142
|
return;
|
|
@@ -146,7 +146,7 @@ function z(e, t) {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
let n = getComputedStyle(t).backgroundColor;
|
|
149
|
-
if (!
|
|
149
|
+
if (!R(n)) {
|
|
150
150
|
i(n);
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
@@ -534,13 +534,13 @@ var Z = W(.4, 0, .2, 1), Q = "relative inline-flex shrink-0 items-center justify
|
|
|
534
534
|
}, $ = {
|
|
535
535
|
key: 3,
|
|
536
536
|
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
537
|
-
}, se = {
|
|
537
|
+
}, se = ["aria-label"], ce = {
|
|
538
538
|
key: 0,
|
|
539
539
|
class: "px-4 text-body-small text-error"
|
|
540
|
-
},
|
|
540
|
+
}, le = {
|
|
541
541
|
key: 1,
|
|
542
542
|
class: "px-4 text-body-small text-on-surface-variant"
|
|
543
|
-
},
|
|
543
|
+
}, ue = /* @__PURE__ */ l({
|
|
544
544
|
__name: "MTextField",
|
|
545
545
|
props: {
|
|
546
546
|
modelValue: {},
|
|
@@ -564,108 +564,109 @@ var Z = W(.4, 0, .2, 1), Q = "relative inline-flex shrink-0 items-center justify
|
|
|
564
564
|
debounce: { default: 0 }
|
|
565
565
|
},
|
|
566
566
|
emits: ["update:modelValue", "debounced"],
|
|
567
|
-
setup(
|
|
568
|
-
let
|
|
569
|
-
let e = !!
|
|
567
|
+
setup(r, { emit: l }) {
|
|
568
|
+
let f = e(), p = r, m = l, v = x(), C = S(), w = g(null), { resolvedFieldBg: T } = z(w, () => p.fieldBg), { debounced: E, cancel: D } = B((e) => m("debounced", e), p.debounce), O = n(() => p.clearable && String(p.modelValue).length > 0 && !p.disabled), k = n(() => {
|
|
569
|
+
let e = !!C.trailing || p.clearable, t = p.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", r = p.multiline ? "resize-y min-h-[56px]" : "h-14", i = [
|
|
570
570
|
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
571
571
|
"transition-[border-color,border-width] duration-150",
|
|
572
572
|
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
573
|
-
|
|
573
|
+
p.error ? "caret-error" : "caret-primary",
|
|
574
574
|
r,
|
|
575
575
|
t,
|
|
576
576
|
n
|
|
577
577
|
];
|
|
578
|
-
return
|
|
578
|
+
return p.variant === "outlined" ? [
|
|
579
579
|
...i,
|
|
580
580
|
"rounded-xs border bg-transparent py-4",
|
|
581
|
-
|
|
581
|
+
p.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
582
582
|
"disabled:border-on-surface/12"
|
|
583
583
|
].join(" ") : [
|
|
584
584
|
...i,
|
|
585
585
|
"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
|
|
586
|
-
|
|
586
|
+
p.error ? "border-error focus:border-b-2 focus:border-error" : "border-on-surface-variant hover:border-on-surface focus:border-b-2 focus:border-primary",
|
|
587
587
|
"disabled:border-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
|
|
588
588
|
].join(" ");
|
|
589
|
-
}),
|
|
589
|
+
}), A = n(() => {
|
|
590
590
|
let e = [
|
|
591
591
|
"pointer-events-none absolute truncate transition-all duration-200",
|
|
592
|
-
|
|
592
|
+
p.leadingIcon ? p.variant === "outlined" ? "left-11" : "left-12" : p.variant === "outlined" ? "left-3" : "left-4",
|
|
593
593
|
"right-4",
|
|
594
|
-
`${
|
|
594
|
+
`${p.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
|
|
595
595
|
];
|
|
596
|
-
return
|
|
596
|
+
return p.variant === "outlined" ? [
|
|
597
597
|
...e,
|
|
598
598
|
"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1",
|
|
599
599
|
"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]",
|
|
600
600
|
"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
|
|
601
|
-
|
|
601
|
+
p.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
602
602
|
"peer-disabled:text-on-surface/38"
|
|
603
603
|
].join(" ") : [
|
|
604
604
|
...e,
|
|
605
605
|
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
|
|
606
606
|
"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
|
|
607
|
-
|
|
607
|
+
p.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
608
608
|
"peer-disabled:text-on-surface/38"
|
|
609
609
|
].join(" ");
|
|
610
610
|
});
|
|
611
|
-
function
|
|
611
|
+
function j(e) {
|
|
612
612
|
let t = e.target;
|
|
613
|
-
|
|
613
|
+
m("update:modelValue", t.value), p.debounce > 0 && E(t.value);
|
|
614
614
|
}
|
|
615
|
-
return (
|
|
615
|
+
return (e, n) => (h(), a("div", ne, [o("div", {
|
|
616
616
|
ref_key: "fieldBgEl",
|
|
617
|
-
ref:
|
|
618
|
-
class: u(["relative",
|
|
619
|
-
style: d(
|
|
617
|
+
ref: w,
|
|
618
|
+
class: u(["relative", r.variant === "outlined" ? "mt-2" : ""]),
|
|
619
|
+
style: d(r.variant === "outlined" ? { "--field-bg": b(T) } : void 0)
|
|
620
620
|
}, [
|
|
621
|
-
|
|
621
|
+
r.leadingIcon ? (h(), a("div", {
|
|
622
622
|
key: 0,
|
|
623
|
-
class: u(["pointer-events-none absolute left-3.5", [
|
|
623
|
+
class: u(["pointer-events-none absolute left-3.5", [r.multiline ? "top-[55%] -translate-y-1/2" : r.variant === "filled" ? "top-4.5" : "top-4", r.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
|
|
624
624
|
}, [c(t, {
|
|
625
|
-
name:
|
|
625
|
+
name: r.leadingIcon,
|
|
626
626
|
size: 24
|
|
627
627
|
}, null, 8, ["name"])], 2)) : i("", !0),
|
|
628
|
-
|
|
628
|
+
r.multiline ? (h(), a("textarea", {
|
|
629
629
|
key: 1,
|
|
630
|
-
id: b(
|
|
631
|
-
value: String(
|
|
632
|
-
rows:
|
|
633
|
-
disabled:
|
|
634
|
-
required:
|
|
630
|
+
id: b(v),
|
|
631
|
+
value: String(r.modelValue),
|
|
632
|
+
rows: r.rows,
|
|
633
|
+
disabled: r.disabled,
|
|
634
|
+
required: r.required,
|
|
635
635
|
placeholder: " ",
|
|
636
|
-
class: u(
|
|
637
|
-
onInput:
|
|
636
|
+
class: u(k.value),
|
|
637
|
+
onInput: j
|
|
638
638
|
}, null, 42, re)) : (h(), a("input", {
|
|
639
639
|
key: 2,
|
|
640
|
-
id: b(
|
|
641
|
-
type:
|
|
642
|
-
value:
|
|
643
|
-
disabled:
|
|
644
|
-
required:
|
|
645
|
-
autocomplete:
|
|
640
|
+
id: b(v),
|
|
641
|
+
type: r.type,
|
|
642
|
+
value: r.modelValue,
|
|
643
|
+
disabled: r.disabled,
|
|
644
|
+
required: r.required,
|
|
645
|
+
autocomplete: r.autocomplete,
|
|
646
646
|
placeholder: " ",
|
|
647
|
-
class: u(
|
|
648
|
-
onInput:
|
|
647
|
+
class: u(k.value),
|
|
648
|
+
onInput: j
|
|
649
649
|
}, null, 42, ie)),
|
|
650
650
|
o("label", {
|
|
651
|
-
for: b(
|
|
652
|
-
class: u(
|
|
653
|
-
}, [s(y(
|
|
654
|
-
|
|
651
|
+
for: b(v),
|
|
652
|
+
class: u(A.value)
|
|
653
|
+
}, [s(y(r.label), 1), r.required ? (h(), a("span", oe, "\xA0*")) : i("", !0)], 10, ae),
|
|
654
|
+
e.$slots.trailing ? (h(), a("div", $, [_(e.$slots, "trailing")])) : O.value ? (h(), a("button", {
|
|
655
655
|
key: 4,
|
|
656
|
+
"aria-label": b(f).clear,
|
|
656
657
|
type: "button",
|
|
657
658
|
class: "absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface",
|
|
658
|
-
onClick:
|
|
659
|
-
b(
|
|
659
|
+
onClick: n[0] ||= (e) => {
|
|
660
|
+
b(D)(), m("update:modelValue", "");
|
|
660
661
|
}
|
|
661
662
|
}, [c(t, {
|
|
662
663
|
name: "close",
|
|
663
664
|
size: 18
|
|
664
|
-
})])) : i("", !0)
|
|
665
|
-
], 6),
|
|
665
|
+
})], 8, se)) : i("", !0)
|
|
666
|
+
], 6), r.error && r.errorLabel ? (h(), a("p", ce, y(r.errorLabel), 1)) : r.hint ? (h(), a("p", le, y(r.hint), 1)) : i("", !0)]));
|
|
666
667
|
}
|
|
667
668
|
});
|
|
668
669
|
//#endregion
|
|
669
|
-
export { K as a, X as c, H as d, V as f, k as g,
|
|
670
|
+
export { K as a, X as c, H as d, V as f, k as g, F as h, J as i, W as l, z as m, te as n, G as o, B as p, q as r, Z as s, ue as t, U as u };
|
|
670
671
|
|
|
671
|
-
//# sourceMappingURL=MTextField-
|
|
672
|
+
//# sourceMappingURL=MTextField-FCPOTB0o.js.map
|