@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.
Files changed (88) hide show
  1. package/dist/API.md +135 -5
  2. package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
  3. package/dist/MIcon-Bxh9j135.js.map +1 -0
  4. package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BckcR0nW.js} +4 -4
  5. package/dist/{MMenuItem-DVxKEv1W.js.map → MMenuItem-BckcR0nW.js.map} +1 -1
  6. package/dist/{MSlider-BXsBv0ox.js → MSlider-LyH_gy8D.js} +56 -47
  7. package/dist/MSlider-LyH_gy8D.js.map +1 -0
  8. package/dist/{MTextField-rML9jnXs.js → MTextField-FCPOTB0o.js} +65 -64
  9. package/dist/{MTextField-rML9jnXs.js.map → MTextField-FCPOTB0o.js.map} +1 -1
  10. package/dist/api.json +1 -1
  11. package/dist/code-editor.js +2 -2
  12. package/dist/components/MAnimatedNumber.vue.d.ts +27 -0
  13. package/dist/components/MIcon.vue.d.ts +2 -0
  14. package/dist/components/MListGroup.vue.d.ts +23 -0
  15. package/dist/components/MScheduler.vue.d.ts +2 -2
  16. package/dist/components/MScheme.vue.d.ts +60 -0
  17. package/dist/components/MSparkline.vue.d.ts +41 -0
  18. package/dist/components/MWindow.vue.d.ts +2 -2
  19. package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
  20. package/dist/composables/_useSegmentRuns.d.ts +8 -0
  21. package/dist/composables/dynamicColor.d.ts +11 -0
  22. package/dist/composables/useColorPalette.d.ts +3 -1
  23. package/dist/composables/useConfetti.d.ts +32 -0
  24. package/dist/composables/useLocale.d.ts +6 -0
  25. package/dist/index.d.ts +7 -1
  26. package/dist/locales/index.js +21 -0
  27. package/dist/locales/index.js.map +1 -1
  28. package/dist/m3ui-vue.css +1 -1
  29. package/dist/m3ui.js +16187 -15377
  30. package/dist/m3ui.js.map +1 -1
  31. package/dist/map.js +45 -45
  32. package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
  33. package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
  34. package/dist/rich-text-editor.js +4 -4
  35. package/dist/styles.css +1 -1
  36. package/dist/terminal.js +1 -1
  37. package/dist/{useLocale-CqQrhWFl.js → useLocale-SfQHnJfp.js} +4 -1
  38. package/dist/useLocale-SfQHnJfp.js.map +1 -0
  39. package/package.json +1 -1
  40. package/src/__tests__/MAnimatedNumber.test.ts +106 -0
  41. package/src/__tests__/MIcon.test.ts +19 -0
  42. package/src/__tests__/MListItemShape.test.ts +34 -0
  43. package/src/__tests__/MScheme.test.ts +107 -0
  44. package/src/__tests__/MSparkline.test.ts +96 -0
  45. package/src/__tests__/iconButtonNames.test.ts +124 -0
  46. package/src/__tests__/ssr.test.ts +1 -0
  47. package/src/__tests__/useConfetti.test.ts +81 -0
  48. package/src/components/MAnimatedNumber.vue +301 -0
  49. package/src/components/MAutocomplete.vue +34 -4
  50. package/src/components/MBottomSheet.vue +1 -0
  51. package/src/components/MDataTable.vue +1 -1
  52. package/src/components/MIcon.vue +11 -4
  53. package/src/components/MList.vue +8 -30
  54. package/src/components/MListGroup.vue +66 -0
  55. package/src/components/MMaskField.vue +3 -0
  56. package/src/components/MMultiAutocomplete.vue +5 -1
  57. package/src/components/MMultiSelect.vue +19 -9
  58. package/src/components/MScheme.vue +162 -0
  59. package/src/components/MSearchBar.vue +2 -0
  60. package/src/components/MSelect.vue +44 -10
  61. package/src/components/MSideSheet.vue +3 -0
  62. package/src/components/MSimpleCarousel.vue +6 -0
  63. package/src/components/MSparkline.vue +250 -0
  64. package/src/components/MSplitButton.vue +3 -0
  65. package/src/components/MSpotlightSearch.vue +1 -0
  66. package/src/components/MTable.vue +1 -0
  67. package/src/components/MTagInput.vue +4 -0
  68. package/src/components/MTextField.vue +3 -0
  69. package/src/components/MTour.vue +1 -0
  70. package/src/components/MTreeTable.vue +1 -0
  71. package/src/components/_MTreeNode.vue +3 -0
  72. package/src/composables/_useSegmentRuns.ts +39 -0
  73. package/src/composables/dynamicColor.ts +66 -0
  74. package/src/composables/useColorPalette.ts +2 -2
  75. package/src/composables/useConfetti.ts +204 -0
  76. package/src/composables/useLocale.ts +9 -0
  77. package/src/index.ts +7 -1
  78. package/src/locales/de.ts +3 -0
  79. package/src/locales/es.ts +3 -0
  80. package/src/locales/fr.ts +3 -0
  81. package/src/locales/ja.ts +3 -0
  82. package/src/locales/ko.ts +3 -0
  83. package/src/locales/pt.ts +3 -0
  84. package/src/locales/zh.ts +3 -0
  85. package/dist/MIcon-DLOkQduI.js.map +0 -1
  86. package/dist/MSlider-BXsBv0ox.js.map +0 -1
  87. package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
  88. package/dist/useLocale-CqQrhWFl.js.map +0 -1
package/dist/map.js CHANGED
@@ -1,7 +1,7 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, p as o, s, t as c, u as l } from "./MSlider-BXsBv0ox.js";
2
- import { i as u } from "./useLocale-CqQrhWFl.js";
3
- import { f as d, h as f, n as p, t as m } from "./MTextField-rML9jnXs.js";
4
- import { t as h } from "./MIcon-DLOkQduI.js";
1
+ import { c as e, d as t, f as n, i as r, l as i, m as a, n as o, o as s, t as c, u as l } from "./MSlider-LyH_gy8D.js";
2
+ import { i as u } from "./useLocale-SfQHnJfp.js";
3
+ import { f as d, h as f, n as p, t as m } from "./MTextField-FCPOTB0o.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");
@@ -97,12 +97,12 @@ var re = { class: "hidden" }, ie = {
97
97
  let e = c.value;
98
98
  if (!e || C) return;
99
99
  let t = O();
100
- b && (t.w !== b.w || t.h !== b.h) && a.animate && !i() && j(e, b, t), b = t;
100
+ b && (t.w !== b.w || t.h !== b.h) && a.animate && !l() && j(e, b, t), b = t;
101
101
  }
102
- function j(e, r, i) {
103
- if (T = r, E = i, w = n(0, 1, 0, d.standard.defaultSpatial, .002), e.style.overflow = "hidden", C = t(e, w, (e) => ({
104
- width: `${r.w + (i.w - r.w) * e}px`,
105
- height: `${r.h + (i.h - r.h) * e}px`
102
+ function j(e, t, r) {
103
+ if (T = t, E = r, w = n(0, 1, 0, d.standard.defaultSpatial, .002), e.style.overflow = "hidden", C = i(e, w, (e) => ({
104
+ width: `${t.w + (r.w - t.w) * e}px`,
105
+ height: `${t.h + (r.h - t.h) * e}px`
106
106
  })), !C) return M(e);
107
107
  C.onfinish = () => M(e);
108
108
  }
@@ -113,11 +113,11 @@ var re = { class: "hidden" }, ie = {
113
113
  }
114
114
  function ee() {
115
115
  if (!c.value || !C) return;
116
- let e = l(w, C.currentTime), t = {
116
+ let e = t(w, C.currentTime), n = {
117
117
  w: T.w + (E.w - T.w) * e,
118
118
  h: T.h + (E.h - T.h) * e
119
119
  };
120
- C.onfinish = null, C.cancel(), C = null, b = t, k();
120
+ C.onfinish = null, C.cancel(), C = null, b = n, k();
121
121
  }
122
122
  W(p, ee, { flush: "post" });
123
123
  let I, L = {
@@ -657,12 +657,12 @@ function be(e) {
657
657
  return Object.fromEntries(e.map((e) => [e, t.getPropertyValue(`--color-${e}`).trim()]));
658
658
  }, n = R(typeof document > "u" ? Object.fromEntries(e.map((e) => [e, ""])) : t()), r, i;
659
659
  return P(() => {
660
- let a = () => {
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 === o;
663
+ }, s = (e) => (e instanceof Element ? e : e?.parentElement)?.id === a;
664
664
  r = new MutationObserver((e) => {
665
- e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (a(), clearTimeout(i), i = setTimeout(a, 300));
665
+ e.some((e) => e.target === document.documentElement || s(e.target) || Array.from(e.addedNodes).some(s)) && (o(), clearTimeout(i), i = setTimeout(o, 300));
666
666
  }), r.observe(document.documentElement, {
667
667
  attributes: !0,
668
668
  attributeFilter: [
@@ -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(t, { emit: n }) {
1836
- let r = t, i = n, { onReady: a, styleVersion: o } = J(), { setFilter: s, valuesOf: c } = Pt(), l = R([]), u = v(() => r.values ?? l.value), d = R([]), f = v(() => r.modelValue ?? d.value);
1835
+ setup(e, { emit: t }) {
1836
+ let n = e, r = t, { onReady: i, styleVersion: a } = J(), { setFilter: o, 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(r.layer, e.length ? [
1839
+ o(n.layer, e.length ? [
1840
1840
  "in",
1841
- ["get", r.property],
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, i("update:modelValue", t);
1847
+ d.value = t, r("update:modelValue", t);
1848
1848
  }
1849
1849
  function h(e) {
1850
1850
  let t = () => {
1851
- r.values || (l.value = c(r.layer, r.property));
1851
+ n.values || (l.value = c(n.layer, n.property));
1852
1852
  };
1853
1853
  t(), e.once("idle", t);
1854
1854
  }
1855
- return a((e) => {
1855
+ return i((e) => {
1856
1856
  h(e), p();
1857
- }), W(f, p, { deep: !0 }), W(o, () => p()), W(() => [r.layer, r.property], ([e], [t]) => {
1858
- e !== t && s(t, null), p();
1859
- }), N(() => s(r.layer, null)), (n, r) => (F(), x("div", Ft, [(F(!0), x(g, null, z(u.value, (n) => (F(), y(e, {
1860
- key: n,
1857
+ }), W(f, p, { deep: !0 }), W(a, () => p()), W(() => [n.layer, n.property], ([e], [t]) => {
1858
+ e !== t && o(t, null), p();
1859
+ }), N(() => o(n.layer, null)), (t, n) => (F(), x("div", Ft, [(F(!0), x(g, null, z(u.value, (t) => (F(), y(s, {
1860
+ key: t,
1861
1861
  type: "filter",
1862
1862
  clickable: "",
1863
- selected: f.value.includes(n),
1864
- onClick: (e) => m(n)
1863
+ selected: f.value.includes(t),
1864
+ onClick: (e) => m(t)
1865
1865
  }, {
1866
- default: G(() => [w(H(t.labels?.[String(n)] ?? n), 1)]),
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(e, { emit: t }) {
1929
- let n = e, i = t, o = u(), { map: c } = J(), l = v(() => n.provider ?? Lt()), d = R(""), m = V([]), _ = R(!1), C = R(!1), w = R(!1), E = V(null), D, O;
1928
+ setup(t, { emit: n }) {
1929
+ let i = t, a = n, s = u(), { map: c } = J(), l = v(() => i.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
- n.instant && (clearTimeout(O), O = setTimeout(k, 350));
1947
+ i.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: n.zoom
1954
+ maxZoom: i.zoom
1955
1955
  }) : t?.flyTo({
1956
1956
  center: e.lngLat,
1957
- zoom: n.zoom
1958
- }), i("select", e);
1957
+ zoom: i.zoom
1958
+ }), a("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 (t, n) => (F(), x("div", Rt, [T(ae, {
1995
- position: e.position,
1994
+ return (n, i) => (F(), x("div", Rt, [T(ae, {
1995
+ position: t.position,
1996
1996
  group: !1
1997
1997
  }, {
1998
- default: G(() => [T(s, {
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: e.placeholder ?? U(o).mapSearchPlaces,
2017
- "aria-label": e.placeholder ?? U(o).mapSearchPlaces,
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: n[0] ||= (e) => A(e.target.value),
2020
- onFocus: n[1] ||= (e) => w.value = C.value && !E.value
2019
+ onInput: i[0] ||= (e) => A(e.target.value),
2020
+ onFocus: i[1] ||= (e) => w.value = C.value && !E.value
2021
2021
  }, null, 40, zt),
2022
2022
  _.value ? (F(), y(f, {
2023
2023
  key: 0,
@@ -2026,7 +2026,7 @@ var Rt = { class: "hidden" }, zt = [
2026
2026
  })) : d.value ? (F(), y(p, {
2027
2027
  key: 1,
2028
2028
  icon: "close",
2029
- label: U(o).clearSearch,
2029
+ label: U(s).clearSearch,
2030
2030
  size: "sm",
2031
2031
  onClick: M
2032
2032
  }, null, 8, ["label"])) : b("", !0)
@@ -2034,7 +2034,7 @@ var Rt = { class: "hidden" }, zt = [
2034
2034
  key: 0,
2035
2035
  class: "max-h-72 overflow-y-auto"
2036
2036
  }, {
2037
- default: G(() => [(F(!0), x(g, null, z(m.value, (e, t) => (F(), y(a, {
2037
+ default: G(() => [(F(!0), x(g, null, z(m.value, (e, t) => (F(), y(o, {
2038
2038
  key: t,
2039
2039
  title: e.label,
2040
2040
  icon: ee(e.type),
@@ -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(o).noResults), 1)]))])) : b("", !0)]),
2054
+ }), S("span", Ht, H(U(s).noResults), 1)]))])) : b("", !0)]),
2055
2055
  _: 1
2056
2056
  })]),
2057
2057
  _: 1
2058
- }, 8, ["position"]), e.marker && E.value ? (F(), y(_e, {
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)]));