@m3ui-vue/m3ui-vue 1.1.2 → 1.1.4
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/README.md +1 -1
- package/dist/API.md +202 -10
- package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
- package/dist/MIcon-Bxh9j135.js.map +1 -0
- package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BfjqwcYP.js} +85 -64
- package/dist/MMenuItem-BfjqwcYP.js.map +1 -0
- package/dist/MSlider-JflHJ70q.js +1525 -0
- package/dist/MSlider-JflHJ70q.js.map +1 -0
- package/dist/{MTextField-rML9jnXs.js → MTextField-NaIB6RbM.js} +68 -66
- package/dist/MTextField-NaIB6RbM.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MAnimatedNumber.vue.d.ts +29 -0
- package/dist/components/MButton.vue.d.ts +2 -0
- package/dist/components/MContainerTransform.vue.d.ts +59 -0
- package/dist/components/MDialog.vue.d.ts +8 -5
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +2 -0
- package/dist/components/MIconButton.vue.d.ts +2 -0
- package/dist/components/MListGroup.vue.d.ts +23 -0
- package/dist/components/MListItem.vue.d.ts +5 -5
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- 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/MSplitter.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +32 -5
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
- package/dist/components/_MToolbarFab.vue.d.ts +16 -0
- package/dist/composables/_containerTransform.d.ts +48 -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/useContainerTransform.d.ts +30 -0
- package/dist/composables/useLocale.d.ts +9 -0
- package/dist/index.d.ts +10 -1
- package/dist/locales/index.js +35 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +16844 -15530
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +55 -55
- 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 +11 -11
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-CqQrhWFl.js → useLocale-CXibICQA.js} +6 -1
- package/dist/useLocale-CXibICQA.js.map +1 -0
- package/package.json +2 -1
- package/src/__tests__/MAnimatedNumber.test.ts +128 -0
- package/src/__tests__/MContainerTransform.test.ts +279 -0
- package/src/__tests__/MDialog.test.ts +27 -0
- package/src/__tests__/MIcon.test.ts +19 -0
- package/src/__tests__/MListItemExpandable.test.ts +48 -0
- package/src/__tests__/MListItemShape.test.ts +42 -5
- package/src/__tests__/MListKeyboard.test.ts +90 -0
- package/src/__tests__/MMapTools.test.ts +2 -1
- package/src/__tests__/MNavigationRail.test.ts +33 -0
- package/src/__tests__/MScheme.test.ts +107 -0
- package/src/__tests__/MSlider.test.ts +161 -0
- package/src/__tests__/MSparkline.test.ts +96 -0
- package/src/__tests__/MToolbar.test.ts +157 -0
- package/src/__tests__/attrsFallthrough.test.ts +6 -0
- package/src/__tests__/hydration.test.ts +25 -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 +327 -0
- package/src/components/MAutocomplete.vue +34 -4
- package/src/components/MBottomSheet.vue +1 -0
- package/src/components/MButton.vue +4 -2
- package/src/components/MContainerTransform.vue +321 -0
- package/src/components/MDataTable.vue +1 -1
- package/src/components/MDialog.vue +31 -6
- package/src/components/MFab.vue +10 -5
- package/src/components/MIcon.vue +11 -4
- package/src/components/MIconButton.vue +3 -1
- package/src/components/MList.vue +33 -31
- package/src/components/MListGroup.vue +66 -0
- package/src/components/MListItem.vue +138 -84
- package/src/components/MMaskField.vue +3 -0
- package/src/components/MMultiAutocomplete.vue +5 -1
- package/src/components/MMultiSelect.vue +19 -9
- package/src/components/MNavigationRail.vue +40 -10
- 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/MSlider.vue +161 -42
- 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/MToolbar.vue +256 -15
- package/src/components/MTour.vue +1 -0
- package/src/components/MTreeTable.vue +1 -0
- package/src/components/_MToolbarFab.vue +14 -0
- package/src/components/_MTreeNode.vue +3 -0
- package/src/composables/_containerTransform.ts +179 -0
- package/src/composables/_useEscapeStack.ts +2 -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/useContainerTransform.ts +59 -0
- package/src/composables/useLocale.ts +14 -0
- package/src/index.ts +10 -1
- package/src/locales/de.ts +5 -0
- package/src/locales/es.ts +5 -0
- package/src/locales/fr.ts +5 -0
- package/src/locales/ja.ts +5 -0
- package/src/locales/ko.ts +5 -0
- package/src/locales/pt.ts +5 -0
- package/src/locales/zh.ts +5 -0
- package/dist/MIcon-DLOkQduI.js.map +0 -1
- package/dist/MMenuItem-DVxKEv1W.js.map +0 -1
- package/dist/MSlider-BXsBv0ox.js +0 -1402
- package/dist/MSlider-BXsBv0ox.js.map +0 -1
- package/dist/MTextField-rML9jnXs.js.map +0 -1
- package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
- package/dist/useLocale-CqQrhWFl.js.map +0 -1
package/dist/map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as u } from "./useLocale-
|
|
3
|
-
import { f as d, h as f, n as p, t as m } from "./MTextField-
|
|
4
|
-
import { t as h } from "./MIcon-
|
|
1
|
+
import { c as e, d as t, f as n, h as r, i, n as a, o, p as s, t as c, u as l } from "./MSlider-JflHJ70q.js";
|
|
2
|
+
import { i as u } from "./useLocale-CXibICQA.js";
|
|
3
|
+
import { f as d, h as f, n as p, t as m } from "./MTextField-NaIB6RbM.js";
|
|
4
|
+
import { t as h } from "./MIcon-Bxh9j135.js";
|
|
5
5
|
import { Fragment as g, Transition as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as C, createTextVNode as w, createVNode as T, defineComponent as E, getCurrentInstance as D, inject as O, markRaw as k, mergeProps as A, normalizeClass as j, normalizeStyle as M, onBeforeUnmount as N, onMounted as P, onUnmounted as ee, openBlock as F, provide as I, reactive as L, ref as R, renderList as z, renderSlot as B, shallowRef as V, toDisplayString as H, unref as U, useId as te, useSlots as ne, watch as W, withCtx as G, withModifiers as K } from "vue";
|
|
6
6
|
//#region src/composables/useMap.ts
|
|
7
7
|
var q = Symbol("m3-map");
|
|
@@ -65,13 +65,13 @@ var re = { class: "hidden" }, ie = {
|
|
|
65
65
|
},
|
|
66
66
|
emits: ["update:expanded"],
|
|
67
67
|
setup(e, { emit: r }) {
|
|
68
|
-
let
|
|
69
|
-
W(() =>
|
|
68
|
+
let i = e, a = r, o = ne(), c = R(), { onReady: u } = J(), f = R(i.expanded);
|
|
69
|
+
W(() => i.expanded, (e) => {
|
|
70
70
|
f.value = e;
|
|
71
71
|
});
|
|
72
|
-
let p = v(() => f.value && !!
|
|
72
|
+
let p = v(() => f.value && !!o.panel);
|
|
73
73
|
function m(e) {
|
|
74
|
-
e !== f.value && (f.value = e,
|
|
74
|
+
e !== f.value && (f.value = e, a("update:expanded", e));
|
|
75
75
|
}
|
|
76
76
|
let h = () => m(!f.value), g = () => m(!1);
|
|
77
77
|
function _(e) {
|
|
@@ -96,13 +96,13 @@ var re = { class: "hidden" }, ie = {
|
|
|
96
96
|
function k() {
|
|
97
97
|
let e = c.value;
|
|
98
98
|
if (!e || C) return;
|
|
99
|
-
let
|
|
100
|
-
b && (
|
|
99
|
+
let n = O();
|
|
100
|
+
b && (n.w !== b.w || n.h !== b.h) && i.animate && !t() && j(e, b, n), b = n;
|
|
101
101
|
}
|
|
102
|
-
function j(e,
|
|
103
|
-
if (T =
|
|
104
|
-
width: `${
|
|
105
|
-
height: `${
|
|
102
|
+
function j(e, t, n) {
|
|
103
|
+
if (T = t, E = n, w = s(0, 1, 0, d.standard.defaultSpatial, .002), e.style.overflow = "hidden", C = l(e, w, (e) => ({
|
|
104
|
+
width: `${t.w + (n.w - t.w) * e}px`,
|
|
105
|
+
height: `${t.h + (n.h - t.h) * e}px`
|
|
106
106
|
})), !C) return M(e);
|
|
107
107
|
C.onfinish = () => M(e);
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ var re = { class: "hidden" }, ie = {
|
|
|
113
113
|
}
|
|
114
114
|
function ee() {
|
|
115
115
|
if (!c.value || !C) return;
|
|
116
|
-
let e =
|
|
116
|
+
let e = n(w, C.currentTime), t = {
|
|
117
117
|
w: T.w + (E.w - T.w) * e,
|
|
118
118
|
h: T.h + (E.h - T.h) * e
|
|
119
119
|
};
|
|
@@ -125,8 +125,8 @@ var re = { class: "hidden" }, ie = {
|
|
|
125
125
|
onRemove: () => c.value?.remove()
|
|
126
126
|
};
|
|
127
127
|
return u((e) => {
|
|
128
|
-
I = e, c.value && e.addControl(L,
|
|
129
|
-
}), W(() =>
|
|
128
|
+
I = e, c.value && e.addControl(L, i.position);
|
|
129
|
+
}), W(() => i.position, (e) => {
|
|
130
130
|
I && c.value && (I.removeControl(L), I.addControl(L, e));
|
|
131
131
|
}), P(() => {
|
|
132
132
|
document.addEventListener("pointerdown", _, !0), !(typeof ResizeObserver > "u" || !c.value) && (D = new ResizeObserver(k), D.observe(c.value));
|
|
@@ -655,15 +655,15 @@ function be(e) {
|
|
|
655
655
|
let t = () => {
|
|
656
656
|
let t = getComputedStyle(document.documentElement);
|
|
657
657
|
return Object.fromEntries(e.map((e) => [e, t.getPropertyValue(`--color-${e}`).trim()]));
|
|
658
|
-
}, n = R(typeof document > "u" ? Object.fromEntries(e.map((e) => [e, ""])) : t()),
|
|
658
|
+
}, n = R(typeof document > "u" ? Object.fromEntries(e.map((e) => [e, ""])) : t()), i, a;
|
|
659
659
|
return P(() => {
|
|
660
|
-
let
|
|
660
|
+
let o = () => {
|
|
661
661
|
let r = t();
|
|
662
662
|
e.some((e) => r[e] !== n.value[e]) && (n.value = r);
|
|
663
|
-
}, s = (e) => (e instanceof Element ? e : e?.parentElement)?.id ===
|
|
664
|
-
|
|
665
|
-
e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (
|
|
666
|
-
}),
|
|
663
|
+
}, s = (e) => (e instanceof Element ? e : e?.parentElement)?.id === r;
|
|
664
|
+
i = new MutationObserver((e) => {
|
|
665
|
+
e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (o(), clearTimeout(a), a = setTimeout(o, 300));
|
|
666
|
+
}), i.observe(document.documentElement, {
|
|
667
667
|
attributes: !0,
|
|
668
668
|
attributeFilter: [
|
|
669
669
|
"class",
|
|
@@ -671,13 +671,13 @@ function be(e) {
|
|
|
671
671
|
"data-palette",
|
|
672
672
|
"data-contrast"
|
|
673
673
|
]
|
|
674
|
-
}),
|
|
674
|
+
}), i.observe(document.head, {
|
|
675
675
|
childList: !0,
|
|
676
676
|
characterData: !0,
|
|
677
677
|
subtree: !0
|
|
678
678
|
});
|
|
679
679
|
}), N(() => {
|
|
680
|
-
|
|
680
|
+
i?.disconnect(), clearTimeout(a);
|
|
681
681
|
}), n;
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
@@ -1832,38 +1832,38 @@ var Ft = { class: "flex flex-wrap gap-2" }, It = /* @__PURE__ */ E({
|
|
|
1832
1832
|
modelValue: {}
|
|
1833
1833
|
},
|
|
1834
1834
|
emits: ["update:modelValue"],
|
|
1835
|
-
setup(
|
|
1836
|
-
let
|
|
1835
|
+
setup(e, { emit: t }) {
|
|
1836
|
+
let n = e, r = t, { onReady: i, styleVersion: a } = J(), { setFilter: s, valuesOf: c } = Pt(), l = R([]), u = v(() => n.values ?? l.value), d = R([]), f = v(() => n.modelValue ?? d.value);
|
|
1837
1837
|
function p() {
|
|
1838
1838
|
let e = f.value;
|
|
1839
|
-
s(
|
|
1839
|
+
s(n.layer, e.length ? [
|
|
1840
1840
|
"in",
|
|
1841
|
-
["get",
|
|
1841
|
+
["get", n.property],
|
|
1842
1842
|
["literal", e]
|
|
1843
1843
|
] : null);
|
|
1844
1844
|
}
|
|
1845
1845
|
function m(e) {
|
|
1846
1846
|
let t = f.value.includes(e) ? f.value.filter((t) => t !== e) : [...f.value, e];
|
|
1847
|
-
d.value = t,
|
|
1847
|
+
d.value = t, r("update:modelValue", t);
|
|
1848
1848
|
}
|
|
1849
1849
|
function h(e) {
|
|
1850
1850
|
let t = () => {
|
|
1851
|
-
|
|
1851
|
+
n.values || (l.value = c(n.layer, n.property));
|
|
1852
1852
|
};
|
|
1853
1853
|
t(), e.once("idle", t);
|
|
1854
1854
|
}
|
|
1855
|
-
return
|
|
1855
|
+
return i((e) => {
|
|
1856
1856
|
h(e), p();
|
|
1857
|
-
}), W(f, p, { deep: !0 }), W(
|
|
1857
|
+
}), W(f, p, { deep: !0 }), W(a, () => p()), W(() => [n.layer, n.property], ([e], [t]) => {
|
|
1858
1858
|
e !== t && s(t, null), p();
|
|
1859
|
-
}), N(() => s(
|
|
1860
|
-
key:
|
|
1859
|
+
}), N(() => s(n.layer, null)), (t, n) => (F(), x("div", Ft, [(F(!0), x(g, null, z(u.value, (t) => (F(), y(o, {
|
|
1860
|
+
key: t,
|
|
1861
1861
|
type: "filter",
|
|
1862
1862
|
clickable: "",
|
|
1863
|
-
selected: f.value.includes(
|
|
1864
|
-
onClick: (e) => m(
|
|
1863
|
+
selected: f.value.includes(t),
|
|
1864
|
+
onClick: (e) => m(t)
|
|
1865
1865
|
}, {
|
|
1866
|
-
default: G(() => [w(H(
|
|
1866
|
+
default: G(() => [w(H(e.labels?.[String(t)] ?? t), 1)]),
|
|
1867
1867
|
_: 2
|
|
1868
1868
|
}, 1032, ["selected", "onClick"]))), 128))]));
|
|
1869
1869
|
}
|
|
@@ -1925,8 +1925,8 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
1925
1925
|
}
|
|
1926
1926
|
},
|
|
1927
1927
|
emits: ["select"],
|
|
1928
|
-
setup(
|
|
1929
|
-
let
|
|
1928
|
+
setup(t, { emit: n }) {
|
|
1929
|
+
let r = t, o = n, s = u(), { map: c } = J(), l = v(() => r.provider ?? Lt()), d = R(""), m = V([]), _ = R(!1), C = R(!1), w = R(!1), E = V(null), D, O;
|
|
1930
1930
|
async function k() {
|
|
1931
1931
|
let e = d.value.trim();
|
|
1932
1932
|
if (!e) return;
|
|
@@ -1944,18 +1944,18 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
1944
1944
|
}
|
|
1945
1945
|
function A(e) {
|
|
1946
1946
|
if (d.value = e, !e) return M();
|
|
1947
|
-
|
|
1947
|
+
r.instant && (clearTimeout(O), O = setTimeout(k, 350));
|
|
1948
1948
|
}
|
|
1949
1949
|
function j(e) {
|
|
1950
1950
|
E.value = e, w.value = !1;
|
|
1951
1951
|
let t = c.value;
|
|
1952
1952
|
e.bbox && e.bbox[0] !== e.bbox[2] ? t?.fitBounds([[e.bbox[0], e.bbox[1]], [e.bbox[2], e.bbox[3]]], {
|
|
1953
1953
|
padding: 48,
|
|
1954
|
-
maxZoom:
|
|
1954
|
+
maxZoom: r.zoom
|
|
1955
1955
|
}) : t?.flyTo({
|
|
1956
1956
|
center: e.lngLat,
|
|
1957
|
-
zoom:
|
|
1958
|
-
}),
|
|
1957
|
+
zoom: r.zoom
|
|
1958
|
+
}), o("select", e);
|
|
1959
1959
|
}
|
|
1960
1960
|
function M() {
|
|
1961
1961
|
D?.abort(), clearTimeout(O), d.value = "", m.value = [], C.value = !1, _.value = !1, w.value = !1, E.value = null;
|
|
@@ -1991,11 +1991,11 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
1991
1991
|
country: "public",
|
|
1992
1992
|
state: "map"
|
|
1993
1993
|
}, ee = (e) => e && P[e] || "location_on";
|
|
1994
|
-
return (
|
|
1995
|
-
position:
|
|
1994
|
+
return (n, r) => (F(), x("div", Rt, [T(ae, {
|
|
1995
|
+
position: t.position,
|
|
1996
1996
|
group: !1
|
|
1997
1997
|
}, {
|
|
1998
|
-
default: G(() => [T(
|
|
1998
|
+
default: G(() => [T(e, {
|
|
1999
1999
|
variant: "elevated",
|
|
2000
2000
|
class: "w-80 max-w-[calc(100vw-5rem)] overflow-hidden"
|
|
2001
2001
|
}, {
|
|
@@ -2013,11 +2013,11 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
2013
2013
|
value: d.value,
|
|
2014
2014
|
type: "search",
|
|
2015
2015
|
enterkeyhint: "search",
|
|
2016
|
-
placeholder:
|
|
2017
|
-
"aria-label":
|
|
2016
|
+
placeholder: t.placeholder ?? U(s).mapSearchPlaces,
|
|
2017
|
+
"aria-label": t.placeholder ?? U(s).mapSearchPlaces,
|
|
2018
2018
|
class: "min-w-0 flex-1 bg-transparent py-2 text-body-medium text-on-surface outline-none placeholder:text-on-surface-variant [&::-webkit-search-cancel-button]:hidden",
|
|
2019
|
-
onInput:
|
|
2020
|
-
onFocus:
|
|
2019
|
+
onInput: r[0] ||= (e) => A(e.target.value),
|
|
2020
|
+
onFocus: r[1] ||= (e) => w.value = C.value && !E.value
|
|
2021
2021
|
}, null, 40, zt),
|
|
2022
2022
|
_.value ? (F(), y(f, {
|
|
2023
2023
|
key: 0,
|
|
@@ -2026,11 +2026,11 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
2026
2026
|
})) : d.value ? (F(), y(p, {
|
|
2027
2027
|
key: 1,
|
|
2028
2028
|
icon: "close",
|
|
2029
|
-
label: U(
|
|
2029
|
+
label: U(s).clearSearch,
|
|
2030
2030
|
size: "sm",
|
|
2031
2031
|
onClick: M
|
|
2032
2032
|
}, null, 8, ["label"])) : b("", !0)
|
|
2033
|
-
], 32), w.value && C.value && !_.value ? (F(), x("div", Bt, [m.value.length ? (F(), y(
|
|
2033
|
+
], 32), w.value && C.value && !_.value ? (F(), x("div", Bt, [m.value.length ? (F(), y(i, {
|
|
2034
2034
|
key: 0,
|
|
2035
2035
|
class: "max-h-72 overflow-y-auto"
|
|
2036
2036
|
}, {
|
|
@@ -2051,11 +2051,11 @@ var Rt = { class: "hidden" }, zt = [
|
|
|
2051
2051
|
name: "search_off",
|
|
2052
2052
|
size: 28,
|
|
2053
2053
|
class: "text-on-surface-variant"
|
|
2054
|
-
}), S("span", Ht, H(U(
|
|
2054
|
+
}), S("span", Ht, H(U(s).noResults), 1)]))])) : b("", !0)]),
|
|
2055
2055
|
_: 1
|
|
2056
2056
|
})]),
|
|
2057
2057
|
_: 1
|
|
2058
|
-
}, 8, ["position"]),
|
|
2058
|
+
}, 8, ["position"]), t.marker && E.value ? (F(), y(_e, {
|
|
2059
2059
|
key: 0,
|
|
2060
2060
|
"lng-lat": E.value.lngLat
|
|
2061
2061
|
}, null, 8, ["lng-lat"])) : b("", !0)]));
|