@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.
Files changed (128) hide show
  1. package/README.md +1 -1
  2. package/dist/API.md +202 -10
  3. package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
  4. package/dist/MIcon-Bxh9j135.js.map +1 -0
  5. package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BfjqwcYP.js} +85 -64
  6. package/dist/MMenuItem-BfjqwcYP.js.map +1 -0
  7. package/dist/MSlider-JflHJ70q.js +1525 -0
  8. package/dist/MSlider-JflHJ70q.js.map +1 -0
  9. package/dist/{MTextField-rML9jnXs.js → MTextField-NaIB6RbM.js} +68 -66
  10. package/dist/MTextField-NaIB6RbM.js.map +1 -0
  11. package/dist/api.json +1 -1
  12. package/dist/code-editor.js +2 -2
  13. package/dist/components/MAnimatedNumber.vue.d.ts +29 -0
  14. package/dist/components/MButton.vue.d.ts +2 -0
  15. package/dist/components/MContainerTransform.vue.d.ts +59 -0
  16. package/dist/components/MDialog.vue.d.ts +8 -5
  17. package/dist/components/MFlex.vue.d.ts +1 -1
  18. package/dist/components/MIcon.vue.d.ts +2 -0
  19. package/dist/components/MIconButton.vue.d.ts +2 -0
  20. package/dist/components/MListGroup.vue.d.ts +23 -0
  21. package/dist/components/MListItem.vue.d.ts +5 -5
  22. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  23. package/dist/components/MScheduler.vue.d.ts +2 -2
  24. package/dist/components/MScheme.vue.d.ts +60 -0
  25. package/dist/components/MSparkline.vue.d.ts +41 -0
  26. package/dist/components/MSplitter.vue.d.ts +1 -1
  27. package/dist/components/MStack.vue.d.ts +1 -1
  28. package/dist/components/MToolbar.vue.d.ts +32 -5
  29. package/dist/components/MWindow.vue.d.ts +2 -2
  30. package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
  31. package/dist/components/_MToolbarFab.vue.d.ts +16 -0
  32. package/dist/composables/_containerTransform.d.ts +48 -0
  33. package/dist/composables/_useSegmentRuns.d.ts +8 -0
  34. package/dist/composables/dynamicColor.d.ts +11 -0
  35. package/dist/composables/useColorPalette.d.ts +3 -1
  36. package/dist/composables/useConfetti.d.ts +32 -0
  37. package/dist/composables/useContainerTransform.d.ts +30 -0
  38. package/dist/composables/useLocale.d.ts +9 -0
  39. package/dist/index.d.ts +10 -1
  40. package/dist/locales/index.js +35 -0
  41. package/dist/locales/index.js.map +1 -1
  42. package/dist/m3ui-vue.css +1 -1
  43. package/dist/m3ui.js +16844 -15530
  44. package/dist/m3ui.js.map +1 -1
  45. package/dist/map.js +55 -55
  46. package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
  47. package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
  48. package/dist/rich-text-editor.js +11 -11
  49. package/dist/styles.css +1 -1
  50. package/dist/terminal.js +1 -1
  51. package/dist/{useLocale-CqQrhWFl.js → useLocale-CXibICQA.js} +6 -1
  52. package/dist/useLocale-CXibICQA.js.map +1 -0
  53. package/package.json +2 -1
  54. package/src/__tests__/MAnimatedNumber.test.ts +128 -0
  55. package/src/__tests__/MContainerTransform.test.ts +279 -0
  56. package/src/__tests__/MDialog.test.ts +27 -0
  57. package/src/__tests__/MIcon.test.ts +19 -0
  58. package/src/__tests__/MListItemExpandable.test.ts +48 -0
  59. package/src/__tests__/MListItemShape.test.ts +42 -5
  60. package/src/__tests__/MListKeyboard.test.ts +90 -0
  61. package/src/__tests__/MMapTools.test.ts +2 -1
  62. package/src/__tests__/MNavigationRail.test.ts +33 -0
  63. package/src/__tests__/MScheme.test.ts +107 -0
  64. package/src/__tests__/MSlider.test.ts +161 -0
  65. package/src/__tests__/MSparkline.test.ts +96 -0
  66. package/src/__tests__/MToolbar.test.ts +157 -0
  67. package/src/__tests__/attrsFallthrough.test.ts +6 -0
  68. package/src/__tests__/hydration.test.ts +25 -0
  69. package/src/__tests__/iconButtonNames.test.ts +124 -0
  70. package/src/__tests__/ssr.test.ts +1 -0
  71. package/src/__tests__/useConfetti.test.ts +81 -0
  72. package/src/components/MAnimatedNumber.vue +327 -0
  73. package/src/components/MAutocomplete.vue +34 -4
  74. package/src/components/MBottomSheet.vue +1 -0
  75. package/src/components/MButton.vue +4 -2
  76. package/src/components/MContainerTransform.vue +321 -0
  77. package/src/components/MDataTable.vue +1 -1
  78. package/src/components/MDialog.vue +31 -6
  79. package/src/components/MFab.vue +10 -5
  80. package/src/components/MIcon.vue +11 -4
  81. package/src/components/MIconButton.vue +3 -1
  82. package/src/components/MList.vue +33 -31
  83. package/src/components/MListGroup.vue +66 -0
  84. package/src/components/MListItem.vue +138 -84
  85. package/src/components/MMaskField.vue +3 -0
  86. package/src/components/MMultiAutocomplete.vue +5 -1
  87. package/src/components/MMultiSelect.vue +19 -9
  88. package/src/components/MNavigationRail.vue +40 -10
  89. package/src/components/MScheme.vue +162 -0
  90. package/src/components/MSearchBar.vue +2 -0
  91. package/src/components/MSelect.vue +44 -10
  92. package/src/components/MSideSheet.vue +3 -0
  93. package/src/components/MSimpleCarousel.vue +6 -0
  94. package/src/components/MSlider.vue +161 -42
  95. package/src/components/MSparkline.vue +250 -0
  96. package/src/components/MSplitButton.vue +3 -0
  97. package/src/components/MSpotlightSearch.vue +1 -0
  98. package/src/components/MTable.vue +1 -0
  99. package/src/components/MTagInput.vue +4 -0
  100. package/src/components/MTextField.vue +3 -0
  101. package/src/components/MToolbar.vue +256 -15
  102. package/src/components/MTour.vue +1 -0
  103. package/src/components/MTreeTable.vue +1 -0
  104. package/src/components/_MToolbarFab.vue +14 -0
  105. package/src/components/_MTreeNode.vue +3 -0
  106. package/src/composables/_containerTransform.ts +179 -0
  107. package/src/composables/_useEscapeStack.ts +2 -0
  108. package/src/composables/_useSegmentRuns.ts +39 -0
  109. package/src/composables/dynamicColor.ts +66 -0
  110. package/src/composables/useColorPalette.ts +2 -2
  111. package/src/composables/useConfetti.ts +204 -0
  112. package/src/composables/useContainerTransform.ts +59 -0
  113. package/src/composables/useLocale.ts +14 -0
  114. package/src/index.ts +10 -1
  115. package/src/locales/de.ts +5 -0
  116. package/src/locales/es.ts +5 -0
  117. package/src/locales/fr.ts +5 -0
  118. package/src/locales/ja.ts +5 -0
  119. package/src/locales/ko.ts +5 -0
  120. package/src/locales/pt.ts +5 -0
  121. package/src/locales/zh.ts +5 -0
  122. package/dist/MIcon-DLOkQduI.js.map +0 -1
  123. package/dist/MMenuItem-DVxKEv1W.js.map +0 -1
  124. package/dist/MSlider-BXsBv0ox.js +0 -1402
  125. package/dist/MSlider-BXsBv0ox.js.map +0 -1
  126. package/dist/MTextField-rML9jnXs.js.map +0 -1
  127. package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
  128. package/dist/useLocale-CqQrhWFl.js.map +0 -1
@@ -1,20 +1,20 @@
1
- import { i as e } from "./useLocale-CqQrhWFl.js";
2
- import { a as t, c as n, g as r, h as i, n as a, o } from "./MTextField-rML9jnXs.js";
3
- import { t as s } from "./MIcon-DLOkQduI.js";
1
+ import { i as e } from "./useLocale-CXibICQA.js";
2
+ import { a as t, c as n, g as r, h as i, n as a, o } from "./MTextField-NaIB6RbM.js";
3
+ import { t as s } from "./MIcon-Bxh9j135.js";
4
4
  import { t as c } from "./_plugin-vue_export-helper-B3ysoDQm.js";
5
5
  import { Fragment as l, Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, getCurrentInstance as b, inject as x, mergeProps as S, nextTick as C, normalizeClass as w, normalizeStyle as T, onBeforeUnmount as E, onMounted as D, onUnmounted as ee, openBlock as O, provide as k, ref as A, renderList as j, renderSlot as M, resolveDynamicComponent as te, toDisplayString as ne, unref as N, useId as re, useSlots as ie, watch as P, withCtx as F, withDirectives as I, withModifiers as L } from "vue";
6
6
  //#region src/composables/_useScrollLock.ts
7
- var R = 0, z = "";
8
- function ae() {
9
- R++ === 0 && (z = document.body.style.overflow, document.body.style.overflow = "hidden");
7
+ var R = 0, ae = "";
8
+ function z() {
9
+ R++ === 0 && (ae = document.body.style.overflow, document.body.style.overflow = "hidden");
10
10
  }
11
11
  function B() {
12
- R > 0 && --R === 0 && (document.body.style.overflow = z);
12
+ R > 0 && --R === 0 && (document.body.style.overflow = ae);
13
13
  }
14
14
  function V(e) {
15
15
  let t = !1;
16
16
  function n(e) {
17
- typeof document > "u" || e === t || (t = e, e ? ae() : B());
17
+ typeof document > "u" || e === t || (t = e, e ? z() : B());
18
18
  }
19
19
  return e && P(e, (e) => n(!!e), { immediate: !0 }), b() && E(() => n(!1)), { set: n };
20
20
  }
@@ -35,6 +35,7 @@ var H = "relative inline-flex items-center justify-center font-medium whitespace
35
35
  default: !1
36
36
  },
37
37
  icon: {},
38
+ iconFilled: { type: Boolean },
38
39
  iconPos: { default: "leading" },
39
40
  size: { default: "sm" },
40
41
  shape: { default: "rounded" },
@@ -140,8 +141,13 @@ var H = "relative inline-flex items-center justify-center font-medium whitespace
140
141
  }, null, 8, ["size"])) : e.icon ? (O(), p(s, {
141
142
  key: 1,
142
143
  name: e.icon,
143
- size: y.value
144
- }, null, 8, ["name", "size"])) : m("", !0)], 64)) : m("", !0),
144
+ size: y.value,
145
+ filled: e.iconFilled
146
+ }, null, 8, [
147
+ "name",
148
+ "size",
149
+ "filled"
150
+ ])) : m("", !0)], 64)) : m("", !0),
145
151
  M(t.$slots, "default"),
146
152
  e.iconPos === "trailing" ? (O(), h(l, { key: 1 }, [e.loading ? (O(), p(i, {
147
153
  key: 0,
@@ -149,8 +155,13 @@ var H = "relative inline-flex items-center justify-center font-medium whitespace
149
155
  }, null, 8, ["size"])) : e.icon ? (O(), p(s, {
150
156
  key: 1,
151
157
  name: e.icon,
152
- size: y.value
153
- }, null, 8, ["name", "size"])) : m("", !0)], 64)) : m("", !0)
158
+ size: y.value,
159
+ filled: e.iconFilled
160
+ }, null, 8, [
161
+ "name",
162
+ "size",
163
+ "filled"
164
+ ])) : m("", !0)], 64)) : m("", !0)
154
165
  ]),
155
166
  _: 3
156
167
  }, 8, [
@@ -166,7 +177,7 @@ var H = "relative inline-flex items-center justify-center font-medium whitespace
166
177
  }
167
178
  }), W = [];
168
179
  function G(e) {
169
- e.key === "Escape" && W.length && W[W.length - 1]();
180
+ e.key === "Escape" && W.length && (e.preventDefault(), W[W.length - 1]());
170
181
  }
171
182
  function K(e, t) {
172
183
  let n = () => t();
@@ -194,10 +205,20 @@ var q = ["aria-labelledby", "aria-label"], J = {
194
205
  }, ce = {
195
206
  key: 1,
196
207
  class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
197
- }, le = ["aria-labelledby"], ue = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, de = {
208
+ }, le = ["aria-labelledby", "aria-label"], ue = {
209
+ key: 0,
210
+ class: "min-h-0 flex-1 overflow-y-auto"
211
+ }, de = {
212
+ key: 1,
213
+ class: "flex h-14 shrink-0 items-center gap-2 px-2"
214
+ }, fe = {
198
215
  key: 1,
199
216
  class: "flex items-center gap-2"
200
- }, fe = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, Z = /*#__PURE__*/ c(/* @__PURE__ */ y({
217
+ }, Z = {
218
+ key: 2,
219
+ class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant"
220
+ }, pe = /*#__PURE__*/ c(/* @__PURE__ */ y({
221
+ inheritAttrs: !1,
201
222
  __name: "MDialog",
202
223
  props: {
203
224
  modelValue: { type: Boolean },
@@ -231,7 +252,7 @@ var q = ["aria-labelledby", "aria-label"], J = {
231
252
  function b() {
232
253
  r.persistent || y("update:modelValue", !1);
233
254
  }
234
- let x = A(), S = A(), E = A(!1), D;
255
+ let x = A(), T = A(), E = A(!1), D;
235
256
  function k() {
236
257
  let e = x.value;
237
258
  if (!e) {
@@ -243,7 +264,7 @@ var q = ["aria-labelledby", "aria-label"], J = {
243
264
  V(() => r.modelValue), K(() => r.modelValue, b);
244
265
  let j = `m3-dialog-${re()}`;
245
266
  return P(() => r.modelValue, async (e) => {
246
- typeof window > "u" || (e ? (await C(), k(), D = new ResizeObserver(k), x.value && D.observe(x.value), S.value && D.observe(S.value)) : (D?.disconnect(), D = void 0));
267
+ typeof window > "u" || (e ? (await C(), k(), D = new ResizeObserver(k), x.value && D.observe(x.value), T.value && D.observe(T.value)) : (D?.disconnect(), D = void 0));
247
268
  }, { immediate: !0 }), ee(() => {
248
269
  D?.disconnect();
249
270
  }), (e, n) => (O(), p(u, { to: "body" }, [t.fullscreen ? (O(), p(d, {
@@ -251,13 +272,13 @@ var q = ["aria-labelledby", "aria-label"], J = {
251
272
  name: "m3-dialog-fs",
252
273
  appear: ""
253
274
  }, {
254
- default: F(() => [t.modelValue ? (O(), h("div", {
255
- key: 0,
256
- class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface",
275
+ default: F(() => [t.modelValue ? (O(), h("div", S({ key: 0 }, e.$attrs, {
276
+ class: "dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col",
257
277
  role: "dialog",
258
278
  "aria-modal": "true",
259
- "aria-labelledby": e.$slots.title || t.title ? j : void 0
260
- }, [g("div", ue, [
279
+ "aria-labelledby": !t.bare && (e.$slots.title || t.title) ? j : void 0,
280
+ "aria-label": t.bare ? t.title : void 0
281
+ }), [t.bare ? (O(), h("div", ue, [M(e.$slots, "default", {}, void 0, !0)])) : (O(), h("div", de, [
261
282
  t.persistent ? m("", !0) : (O(), p(a, {
262
283
  key: 0,
263
284
  icon: "close",
@@ -268,8 +289,8 @@ var q = ["aria-labelledby", "aria-label"], J = {
268
289
  id: j,
269
290
  class: "flex-1 text-title-large font-medium text-on-surface"
270
291
  }, [M(e.$slots, "title", {}, () => [_(ne(t.title), 1)], !0)]),
271
- e.$slots.actions ? (O(), h("div", de, [M(e.$slots, "actions", {}, void 0, !0)])) : m("", !0)
272
- ]), g("div", fe, [M(e.$slots, "default", {}, void 0, !0)])], 8, le)) : m("", !0)]),
292
+ e.$slots.actions ? (O(), h("div", fe, [M(e.$slots, "actions", {}, void 0, !0)])) : m("", !0)
293
+ ])), t.bare ? m("", !0) : (O(), h("div", Z, [M(e.$slots, "default", {}, void 0, !0)]))], 16, le)) : m("", !0)]),
273
294
  _: 3
274
295
  })) : (O(), p(d, {
275
296
  key: 0,
@@ -280,14 +301,14 @@ var q = ["aria-labelledby", "aria-label"], J = {
280
301
  key: 0,
281
302
  class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
282
303
  onClick: L(b, ["self"])
283
- }, [g("div", {
284
- class: w(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", s.value]),
285
- style: T(c.value),
304
+ }, [g("div", S(e.$attrs, {
305
+ class: ["dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col", s.value],
306
+ style: c.value,
286
307
  role: "dialog",
287
308
  "aria-modal": "true",
288
309
  "aria-labelledby": !t.bare && (e.$slots.title || t.title) ? j : void 0,
289
310
  "aria-label": t.bare ? t.title : void 0
290
- }, [t.bare ? (O(), h("div", J, [M(e.$slots, "default", {}, void 0, !0)])) : (O(), h(l, { key: 1 }, [
311
+ }), [t.bare ? (O(), h("div", J, [M(e.$slots, "default", {}, void 0, !0)])) : (O(), h(l, { key: 1 }, [
291
312
  g("div", Y, [
292
313
  t.closable && !t.persistent ? (O(), h("div", X, [v(a, {
293
314
  icon: "close",
@@ -307,22 +328,22 @@ var q = ["aria-labelledby", "aria-label"], J = {
307
328
  onScroll: k
308
329
  }, [g("div", {
309
330
  ref_key: "contentInnerEl",
310
- ref: S
331
+ ref: T
311
332
  }, [M(e.$slots, "default", {}, void 0, !0)], 512)], 34),
312
333
  E.value && e.$slots.actions ? (O(), h("div", se)) : m("", !0),
313
334
  e.$slots.actions ? (O(), h("div", ce, [M(e.$slots, "actions", {}, void 0, !0)])) : m("", !0)
314
- ], 64))], 14, q)])) : m("", !0)]),
335
+ ], 64))], 16, q)])) : m("", !0)]),
315
336
  _: 3
316
337
  }))]));
317
338
  }
318
- }), [["__scopeId", "data-v-1d35a150"]]), pe = { class: "my-1 border-outline-variant" }, me = /* @__PURE__ */ y({
339
+ }), [["__scopeId", "data-v-8f788bae"]]), me = { class: "my-1 border-outline-variant" }, he = /* @__PURE__ */ y({
319
340
  __name: "MMenuDivider",
320
341
  props: { gap: {
321
342
  type: Boolean,
322
343
  default: !1
323
344
  } },
324
345
  setup(e) {
325
- return (e, t) => (O(), h("hr", pe));
346
+ return (e, t) => (O(), h("hr", me));
326
347
  }
327
348
  });
328
349
  function Q(e, t, n, r = 8) {
@@ -331,7 +352,7 @@ function Q(e, t, n, r = 8) {
331
352
  let i = e[e.length - 1] ?? r;
332
353
  return Math.min(n - r - t, Math.max(r, i));
333
354
  }
334
- function he(e, t, n, r, i = 8) {
355
+ function ge(e, t, n, r, i = 8) {
335
356
  let a = e.left, o = e.right - t, s = (e.left + e.right) / 2 < n / 2 ? i : n - i - t;
336
357
  return Q(r === "start" ? [
337
358
  a,
@@ -345,10 +366,10 @@ function he(e, t, n, r, i = 8) {
345
366
  }
346
367
  //#endregion
347
368
  //#region src/components/MMenu.vue?vue&type=script&setup=true&lang.ts
348
- var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
369
+ var _e = { class: "flex-1 truncate" }, ve = { key: "root" }, ye = {
349
370
  key: 0,
350
371
  class: "flex flex-col gap-1 px-1.5"
351
- }, ye = { class: "overflow-hidden rounded-lg bg-surface-container" }, be = 220, $ = 1 / 240, xe = /* @__PURE__ */ y({
372
+ }, be = { class: "overflow-hidden rounded-lg bg-surface-container" }, xe = 220, $ = 1 / 240, Se = /* @__PURE__ */ y({
352
373
  inheritAttrs: !1,
353
374
  __name: "MMenu",
354
375
  props: {
@@ -364,7 +385,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
364
385
  return t;
365
386
  }
366
387
  function a(e) {
367
- if (e.type !== me) return !1;
388
+ if (e.type !== he) return !1;
368
389
  let t = e.props?.gap;
369
390
  return t === "" || t === !0 || t === "true";
370
391
  }
@@ -382,7 +403,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
382
403
  transform: "translateX(0%)",
383
404
  opacity: 1
384
405
  }], {
385
- duration: be,
406
+ duration: xe,
386
407
  easing: "cubic-bezier(0.05,0.7,0.1,1)"
387
408
  });
388
409
  r.onfinish = t;
@@ -397,7 +418,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
397
418
  transform: `translateX(${n * 100}%)`,
398
419
  opacity: .4
399
420
  }], {
400
- duration: be,
421
+ duration: xe,
401
422
  easing: "cubic-bezier(0.3,0,0.8,0.15)"
402
423
  });
403
424
  i.onfinish = t;
@@ -416,7 +437,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
416
437
  }), N = e, e;
417
438
  }
418
439
  let I = 0, L = null, R = null;
419
- function z(e, t, n) {
440
+ function ae(e, t, n) {
420
441
  L?.();
421
442
  let r = e, i = re(), a = i.length - 1, o = Math.round(Math.max(0, Math.min(a, I))), s = n ? a : 0, c = n ? 1 : -1, l = [];
422
443
  for (let e = o; n ? e <= s : e >= s; e += c) l.push(i[e]);
@@ -441,11 +462,11 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
441
462
  L?.(), L = null, R = null, t();
442
463
  };
443
464
  }
444
- function ae(e, t) {
445
- ce(e), z(e, t, !0);
465
+ function z(e, t) {
466
+ ce(e), ae(e, t, !0);
446
467
  }
447
468
  function B(e, t) {
448
- z(e, t, !1);
469
+ ae(e, t, !1);
449
470
  }
450
471
  function V(e) {
451
472
  b.value = "forward", _.value.push(e), C(() => ue());
@@ -478,7 +499,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
478
499
  let se = A(n.align === "right" ? "right" : "left");
479
500
  function ce(e) {
480
501
  if (!Y) return;
481
- let t = e.offsetWidth, r = he(Y, t, window.innerWidth, n.align === "right" ? "end" : "start"), i = Math.min(t, Math.max(0, (Y.left + Y.right) / 2 - r)), a = Math.abs(r - Y.left) < 1 ? "left" : Math.abs(r + t - Y.right) < 1 ? "right" : `${i}px`;
502
+ let t = e.offsetWidth, r = ge(Y, t, window.innerWidth, n.align === "right" ? "end" : "start"), i = Math.min(t, Math.max(0, (Y.left + Y.right) / 2 - r)), a = Math.abs(r - Y.left) < 1 ? "left" : Math.abs(r + t - Y.right) < 1 ? "right" : `${i}px`;
482
503
  se.value = a, K.value = {
483
504
  ...K.value,
484
505
  left: `${r}px`
@@ -516,13 +537,13 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
516
537
  t.closest?.(".m3-submenu") || Z();
517
538
  }
518
539
  }
519
- function Q(e) {
540
+ function me(e) {
520
541
  if (!U.value) return;
521
542
  let t = e.target;
522
543
  for (let e of q) if (e.contains(t)) return;
523
544
  t.closest?.(".m3-submenu") || Z();
524
545
  }
525
- function xe(e) {
546
+ function Q(e) {
526
547
  if (e.key === "Escape") {
527
548
  _.value.length ? H() : Z();
528
549
  return;
@@ -530,9 +551,9 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
530
551
  U.value && (e.key === "ArrowDown" ? (e.preventDefault(), de(1)) : e.key === "ArrowUp" && (e.preventDefault(), de(-1)));
531
552
  }
532
553
  D(() => {
533
- document.addEventListener("mousedown", pe), document.addEventListener("keydown", xe), window.addEventListener("scroll", Q, !0);
554
+ document.addEventListener("mousedown", pe), document.addEventListener("keydown", Q), window.addEventListener("scroll", me, !0);
534
555
  }), ee(() => {
535
- document.removeEventListener("mousedown", pe), document.removeEventListener("keydown", xe), window.removeEventListener("scroll", Q, !0), R ? R() : L?.();
556
+ document.removeEventListener("mousedown", pe), document.removeEventListener("keydown", Q), window.removeEventListener("scroll", me, !0), R ? R() : L?.();
536
557
  });
537
558
  let Se = f(() => `${se.value} ${X.value ? "bottom" : "top"}`);
538
559
  return (t, n) => (O(), h(l, null, [g("div", S({
@@ -543,7 +564,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
543
564
  onClick: fe
544
565
  }), [M(t.$slots, "trigger", { open: U.value })], 16), (O(), p(u, { to: "body" }, [v(d, {
545
566
  css: !1,
546
- onEnter: ae,
567
+ onEnter: z,
547
568
  onLeave: B
548
569
  }, {
549
570
  default: F(() => [U.value ? (O(), h("div", {
@@ -579,20 +600,20 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
579
600
  size: 20,
580
601
  class: "shrink-0 text-on-surface-variant"
581
602
  }, null, 8, ["name"])) : m("", !0),
582
- g("span", ge, [(O(), p(te(() => y.value?.header?.())))])
583
- ]), (O(), p(te(() => y.value?.content?.())))])) : (O(), h("div", _e, [c.value ? (O(), h("div", ve, [(O(!0), h(l, null, j(o.value, (e, t) => (O(), h("div", {
603
+ g("span", _e, [(O(), p(te(() => y.value?.header?.())))])
604
+ ]), (O(), p(te(() => y.value?.content?.())))])) : (O(), h("div", ve, [c.value ? (O(), h("div", ye, [(O(!0), h(l, null, j(o.value, (e, t) => (O(), h("div", {
584
605
  key: t,
585
606
  class: "rounded-lg shadow-elevation-2"
586
- }, [g("div", ye, [(O(), p(te(() => e)))])]))), 128))])) : M(t.$slots, "default", { close: Z }, void 0, void 0, 1)]))]),
607
+ }, [g("div", be, [(O(), p(te(() => e)))])]))), 128))])) : M(t.$slots, "default", { close: Z }, void 0, void 0, 1)]))]),
587
608
  _: 3
588
609
  })], 4)], 2)], 6)) : m("", !0)]),
589
610
  _: 3
590
611
  })]))], 64));
591
612
  }
592
- }), Se = ["data-m3-menu-choice"], Ce = { class: "flex-1" }, we = {
613
+ }), Ce = ["data-m3-menu-choice"], we = { class: "flex-1" }, Te = {
593
614
  key: 2,
594
615
  class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
595
- }, Te = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Ee = 32, De = /* @__PURE__ */ y({
616
+ }, Ee = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, De = 32, Oe = /* @__PURE__ */ y({
596
617
  __name: "MMenuItem",
597
618
  props: {
598
619
  icon: {},
@@ -644,7 +665,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
644
665
  t
645
666
  ];
646
667
  }
647
- let { snap: j } = n(() => l.value ? [...k(), y.value && _.value ? Ee : 0] : [], ([e, t, n, r, i]) => {
668
+ let { snap: j } = n(() => l.value ? [...k(), y.value && _.value ? De : 0] : [], ([e, t, n, r, i]) => {
648
669
  let a = V.value instanceof HTMLElement ? V.value : V.value?.$el;
649
670
  a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), H.value && i !== void 0 && (H.value.style.width = `${i}px`);
650
671
  }, o);
@@ -657,7 +678,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
657
678
  }), ee(() => re?.disconnect()), P(l, () => C(E)), n(() => y.value ? [+!!_.value] : [], ([e]) => {
658
679
  H.value && e !== void 0 && (H.value.style.opacity = String(e));
659
680
  }, t);
660
- let I = ie(), L = f(() => i.to ? "RouterLink" : "button"), R = f(() => !!I.children), z = x("m-menu-close", null), ae = x("m-menu-nav", null), B = A(), V = A(), H = A(), U = A(!1), W = A({});
681
+ let I = ie(), L = f(() => i.to ? "RouterLink" : "button"), R = f(() => !!I.children), ae = x("m-menu-close", null), z = x("m-menu-nav", null), B = A(), V = A(), H = A(), U = A(!1), W = A({});
661
682
  function G() {
662
683
  if (!B.value) return;
663
684
  let e = B.value.getBoundingClientRect();
@@ -690,14 +711,14 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
690
711
  function J() {
691
712
  if (!i.disabled) {
692
713
  if (R.value) {
693
- ae?.mode === "push" ? ae.push({
714
+ z?.mode === "push" ? z.push({
694
715
  icon: i.icon,
695
716
  header: I.default,
696
717
  content: I.children
697
718
  }) : q();
698
719
  return;
699
720
  }
700
- c.value && a("update:checked", !i.checked), a("click"), (i.keepOpen ?? c.value) || z?.();
721
+ c.value && a("update:checked", !i.checked), a("click"), (i.keepOpen ?? c.value) || ae?.();
701
722
  }
702
723
  }
703
724
  function Y(e) {
@@ -764,8 +785,8 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
764
785
  "filled",
765
786
  "class"
766
787
  ])) : m("", !0),
767
- g("span", Ce, [M(t.$slots, "default")]),
768
- e.shortcut && !R.value ? (O(), h("span", we, ne(e.shortcut), 1)) : m("", !0),
788
+ g("span", we, [M(t.$slots, "default")]),
789
+ e.shortcut && !R.value ? (O(), h("span", Te, ne(e.shortcut), 1)) : m("", !0),
769
790
  R.value ? (O(), p(s, {
770
791
  key: 3,
771
792
  name: "chevron_right",
@@ -783,7 +804,7 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
783
804
  "disabled",
784
805
  "aria-haspopup",
785
806
  "aria-expanded"
786
- ])), R.value && N(ae)?.mode !== "push" ? (O(), p(u, {
807
+ ])), R.value && N(z)?.mode !== "push" ? (O(), p(u, {
787
808
  key: 0,
788
809
  to: "body"
789
810
  }, [v(d, {
@@ -798,12 +819,12 @@ var ge = { class: "flex-1 truncate" }, _e = { key: "root" }, ve = {
798
819
  class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
799
820
  style: T(W.value),
800
821
  onPointerleave: oe
801
- }, [g("div", Te, [M(t.$slots, "children")])], 36)) : m("", !0)]),
822
+ }, [g("div", Ee, [M(t.$slots, "children")])], 36)) : m("", !0)]),
802
823
  _: 3
803
- })])) : m("", !0)], 40, Se));
824
+ })])) : m("", !0)], 40, Ce));
804
825
  }
805
826
  });
806
827
  //#endregion
807
- export { me as a, V as c, Q as i, xe as n, Z as o, he as r, U as s, De as t };
828
+ export { he as a, U as c, Q as i, V as l, Se as n, pe as o, ge as r, K as s, Oe as t };
808
829
 
809
- //# sourceMappingURL=MMenuItem-DVxKEv1W.js.map
830
+ //# sourceMappingURL=MMenuItem-BfjqwcYP.js.map