@m3ui-vue/m3ui-vue 0.4.1 → 0.4.2

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.
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./MIcon-CaEooCmZ.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, ref as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useId as E, useSlots as D, watch as O, withCtx as k, withModifiers as A } from "vue";
3
+ import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, reactive as x, ref as S, renderSlot as C, resolveDynamicComponent as w, toDisplayString as T, toValue as E, unref as D, useId as O, useSlots as k, watch as A, watchEffect as j, withCtx as M, withModifiers as N } from "vue";
4
4
  //#region src/composables/useLocale.ts
5
- var j = {
5
+ var P = {
6
6
  search: "Search...",
7
7
  noResults: "No results",
8
8
  close: "Close",
@@ -71,24 +71,23 @@ var j = {
71
71
  insertImage: "Insert image",
72
72
  imageUrlLabel: "Image URL",
73
73
  insert: "Insert"
74
- }, M = Symbol("m3-locale");
75
- function N() {
76
- let e = p(M, {});
77
- return {
78
- ...j,
79
- ...e
80
- };
74
+ }, F = Symbol("m3-locale");
75
+ function I() {
76
+ let e = p(F, {}), t = x({ ...P });
77
+ return j(() => {
78
+ Object.assign(t, P, E(e));
79
+ }), t;
81
80
  }
82
81
  //#endregion
83
82
  //#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
84
- var P = ["aria-label"], F = {
83
+ var ee = ["aria-label"], L = {
85
84
  key: 0,
86
85
  class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
87
- }, I = [
86
+ }, R = [
88
87
  "width",
89
88
  "height",
90
89
  "viewBox"
91
- ], L = ["d", "stroke-dasharray"], R = 3, z = 9, B = /* @__PURE__ */ f({
90
+ ], z = ["d", "stroke-dasharray"], B = 3, V = 9, H = /* @__PURE__ */ f({
92
91
  __name: "MSpinner",
93
92
  props: {
94
93
  size: { default: 20 },
@@ -99,10 +98,10 @@ var P = ["aria-label"], F = {
99
98
  label: {}
100
99
  },
101
100
  setup(e) {
102
- let t = e, n = N(), r = a(() => (t.size / 2 - 1 - R / 2) / 1.25), i = a(() => t.size / 2), o = a(() => {
103
- let e = i.value, t = r.value, n = t * .08, a = z * 24, o = [], s = 0, c = 0, l = 0;
101
+ let t = e, n = I(), r = a(() => (t.size / 2 - 1 - B / 2) / 1.25), i = a(() => t.size / 2), o = a(() => {
102
+ let e = i.value, t = r.value, n = t * .08, a = V * 24, o = [], s = 0, c = 0, l = 0;
104
103
  for (let r = 0; r <= a; r++) {
105
- let i = 2 * Math.PI * r / a - Math.PI / 2, u = t + n * Math.sin(z * i), d = e + u * Math.cos(i), f = e + u * Math.sin(i);
104
+ let i = 2 * Math.PI * r / a - Math.PI / 2, u = t + n * Math.sin(V * i), d = e + u * Math.cos(i), f = e + u * Math.sin(i);
106
105
  r > 0 && (s += Math.sqrt((d - c) ** 2 + (f - l) ** 2)), o.push(`${r === 0 ? "M" : "L"}${d.toFixed(2)},${f.toFixed(2)}`), c = d, l = f;
107
106
  }
108
107
  let u = s * .58, d = s - u, f = `${u.toFixed(1)} ${d.toFixed(1)}`;
@@ -119,7 +118,7 @@ var P = ["aria-label"], F = {
119
118
  height: `${e.size}px`
120
119
  }),
121
120
  role: "status",
122
- "aria-label": e.label ?? T(n).loading
121
+ "aria-label": e.label ?? D(n).loading
123
122
  }, [e.wavy ? (y(), c("svg", {
124
123
  key: 1,
125
124
  width: e.size,
@@ -131,14 +130,14 @@ var P = ["aria-label"], F = {
131
130
  }, [l("path", {
132
131
  d: o.value.path,
133
132
  stroke: "currentColor",
134
- "stroke-width": R,
133
+ "stroke-width": B,
135
134
  "stroke-linecap": "round",
136
135
  "stroke-dasharray": o.value.dash,
137
136
  class: "animate-[m3-wavy-travel_2s_linear_infinite]",
138
137
  style: h({ "--m3-wave-len": o.value.len })
139
- }, null, 12, L)], 12, I)) : (y(), c("span", F))], 12, P));
138
+ }, null, 12, z)], 12, R)) : (y(), c("span", L))], 12, ee));
140
139
  }
141
- }), V = [
140
+ }), U = [
142
141
  "bg-surface-container-highest",
143
142
  "bg-surface-container-high",
144
143
  "bg-surface-container-low",
@@ -159,11 +158,11 @@ var P = ["aria-label"], F = {
159
158
  "bg-tertiary",
160
159
  "bg-error"
161
160
  ];
162
- function H(e) {
163
- for (let t of V) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
161
+ function W(e) {
162
+ for (let t of U) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
164
163
  return null;
165
164
  }
166
- function U(e) {
165
+ function G(e) {
167
166
  if (!e || e === "transparent") return !0;
168
167
  let t = e.match(/^rgba?\(([^)]+)\)$/);
169
168
  if (t) {
@@ -172,15 +171,15 @@ function U(e) {
172
171
  }
173
172
  return !1;
174
173
  }
175
- function W(e, t) {
176
- let n = x("var(--color-surface)");
174
+ function K(e, t) {
175
+ let n = S("var(--color-surface)");
177
176
  function r(r) {
178
177
  n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
179
178
  }
180
179
  function i() {
181
180
  let t = e.value?.parentElement ?? null;
182
181
  for (; t;) {
183
- let e = H(t);
182
+ let e = W(t);
184
183
  if (e) {
185
184
  r(e);
186
185
  return;
@@ -190,7 +189,7 @@ function W(e, t) {
190
189
  return;
191
190
  }
192
191
  let n = getComputedStyle(t).backgroundColor;
193
- if (!U(n)) {
192
+ if (!G(n)) {
194
193
  r(n);
195
194
  return;
196
195
  }
@@ -212,7 +211,7 @@ function W(e, t) {
212
211
  }
213
212
  //#endregion
214
213
  //#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
215
- var G = "inline-flex shrink-0 items-center justify-center transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38]", K = /* @__PURE__ */ f({
214
+ var q = "inline-flex shrink-0 items-center justify-center transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38]", J = /* @__PURE__ */ f({
216
215
  __name: "MIconButton",
217
216
  props: {
218
217
  icon: {},
@@ -265,13 +264,13 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
265
264
  default: return "text-on-surface-variant hover:bg-on-surface/8 active:bg-on-surface/12";
266
265
  }
267
266
  });
268
- return (n, i) => (y(), o(C(r.value), {
267
+ return (n, i) => (y(), o(w(r.value), {
269
268
  to: t.to || void 0,
270
269
  type: t.to ? void 0 : "button",
271
270
  "aria-label": t.label || void 0,
272
271
  disabled: t.disabled,
273
272
  class: m([
274
- G,
273
+ q,
275
274
  c.value,
276
275
  u.value,
277
276
  "relative overflow-hidden"
@@ -282,7 +281,7 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
282
281
  }),
283
282
  onPointerdown: l
284
283
  }, {
285
- default: k(() => [d(e, {
284
+ default: M(() => [d(e, {
286
285
  name: t.icon,
287
286
  size: s.value.icon
288
287
  }, null, 8, ["name", "size"])]),
@@ -296,7 +295,7 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
296
295
  "style"
297
296
  ]));
298
297
  }
299
- }), q = "relative inline-flex items-center justify-center gap-2 font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38] disabled:shadow-none before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", J = /* @__PURE__ */ f({
298
+ }), Y = "relative inline-flex items-center justify-center gap-2 font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38] disabled:shadow-none before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", X = /* @__PURE__ */ f({
300
299
  __name: "MButton",
301
300
  props: {
302
301
  variant: { default: "filled" },
@@ -380,33 +379,33 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
380
379
  default: return "";
381
380
  }
382
381
  });
383
- function w(e) {
382
+ function S(e) {
384
383
  if (r.disabled || r.loading) return;
385
384
  let t = e.currentTarget, n = t.getBoundingClientRect(), i = Math.max(n.width, n.height) * 2, a = document.createElement("span");
386
385
  a.className = "m3-ripple", a.style.cssText = `width:${i}px;height:${i}px;top:${e.clientY - n.top - i / 2}px;left:${e.clientX - n.left - i / 2}px`, t.appendChild(a), a.addEventListener("animationend", () => a.remove(), { once: !0 });
387
386
  }
388
- return (n, r) => (y(), o(C(i.value), {
387
+ return (n, r) => (y(), o(w(i.value), {
389
388
  to: t.to || void 0,
390
389
  type: t.to ? void 0 : t.type,
391
390
  disabled: t.disabled || t.loading,
392
391
  class: m([
393
- q,
392
+ Y,
394
393
  d.value,
395
394
  g.value,
396
395
  b.value,
397
396
  x.value
398
397
  ]),
399
398
  style: h(l.value),
400
- onPointerdown: w
399
+ onPointerdown: S
401
400
  }, {
402
- default: k(() => [t.loading ? (y(), o(B, {
401
+ default: M(() => [t.loading ? (y(), o(H, {
403
402
  key: 0,
404
403
  size: v.value
405
404
  }, null, 8, ["size"])) : t.icon ? (y(), o(e, {
406
405
  key: 1,
407
406
  name: t.icon,
408
407
  size: _.value
409
- }, null, 8, ["name", "size"])) : s("", !0), S(n.$slots, "default")]),
408
+ }, null, 8, ["name", "size"])) : s("", !0), C(n.$slots, "default")]),
410
409
  _: 3
411
410
  }, 40, [
412
411
  "to",
@@ -416,16 +415,16 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
416
415
  "style"
417
416
  ]));
418
417
  }
419
- }), Y = { class: "flex items-start justify-between gap-4 px-6 pt-6 pb-2" }, X = { class: "text-headline-small text-on-surface" }, Z = { class: "overflow-y-auto px-6 py-2 text-body-medium text-on-surface-variant" }, Q = {
418
+ }), Z = { class: "flex items-start justify-between gap-4 px-6 pt-6 pb-2" }, Q = { class: "text-headline-small text-on-surface" }, te = { class: "overflow-y-auto px-6 py-2 text-body-medium text-on-surface-variant" }, ne = {
420
419
  key: 0,
421
420
  class: "flex justify-end gap-2 px-6 py-4"
422
- }, $ = {
421
+ }, re = {
423
422
  key: 0,
424
423
  class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
425
- }, ee = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, te = { class: "flex-1 text-title-large font-medium text-on-surface" }, ne = {
424
+ }, ie = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, ae = { class: "flex-1 text-title-large font-medium text-on-surface" }, oe = {
426
425
  key: 1,
427
426
  class: "flex items-center gap-2"
428
- }, re = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ie = /*#__PURE__*/ t(/* @__PURE__ */ f({
427
+ }, se = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ce = /*#__PURE__*/ t(/* @__PURE__ */ f({
429
428
  __name: "MDialog",
430
429
  props: {
431
430
  modelValue: { type: Boolean },
@@ -443,77 +442,77 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
443
442
  },
444
443
  emits: ["update:modelValue"],
445
444
  setup(e, { emit: t }) {
446
- let n = e, a = N(), d = t;
445
+ let n = e, a = I(), d = t;
447
446
  function f() {
448
447
  n.persistent || d("update:modelValue", !1);
449
448
  }
450
449
  function p(e) {
451
450
  e.key === "Escape" && f();
452
451
  }
453
- return O(() => n.modelValue, (e) => {
452
+ return A(() => n.modelValue, (e) => {
454
453
  e ? (document.addEventListener("keydown", p), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", p), document.body.style.overflow = "");
455
454
  }), (t, n) => (y(), o(r, { to: "body" }, [e.fullscreen ? (y(), o(i, {
456
455
  key: 1,
457
456
  name: "m3-dialog-fs"
458
457
  }, {
459
- default: k(() => [e.modelValue ? (y(), c("div", $, [l("div", ee, [
460
- e.persistent ? s("", !0) : (y(), o(K, {
458
+ default: M(() => [e.modelValue ? (y(), c("div", re, [l("div", ie, [
459
+ e.persistent ? s("", !0) : (y(), o(J, {
461
460
  key: 0,
462
461
  icon: "close",
463
- label: e.closeLabel ?? T(a).close,
462
+ label: e.closeLabel ?? D(a).close,
464
463
  onClick: f
465
464
  }, null, 8, ["label"])),
466
- l("h2", te, [S(t.$slots, "title", {}, () => [u(w(e.title), 1)], !0)]),
467
- t.$slots.actions ? (y(), c("div", ne, [S(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
468
- ]), l("div", re, [S(t.$slots, "default", {}, void 0, !0)])])) : s("", !0)]),
465
+ l("h2", ae, [C(t.$slots, "title", {}, () => [u(T(e.title), 1)], !0)]),
466
+ t.$slots.actions ? (y(), c("div", oe, [C(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
467
+ ]), l("div", se, [C(t.$slots, "default", {}, void 0, !0)])])) : s("", !0)]),
469
468
  _: 3
470
469
  })) : (y(), o(i, {
471
470
  key: 0,
472
471
  name: "m3-dialog"
473
472
  }, {
474
- default: k(() => [e.modelValue ? (y(), c("div", {
473
+ default: M(() => [e.modelValue ? (y(), c("div", {
475
474
  key: 0,
476
475
  class: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
477
- onClick: A(f, ["self"])
476
+ onClick: N(f, ["self"])
478
477
  }, [l("div", { class: m(["dialog-box flex max-h-[90vh] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", e.maxWidth]) }, [
479
- l("div", Y, [l("h2", X, [S(t.$slots, "title", {}, () => [u(w(e.title), 1)], !0)]), e.persistent ? s("", !0) : (y(), o(K, {
478
+ l("div", Z, [l("h2", Q, [C(t.$slots, "title", {}, () => [u(T(e.title), 1)], !0)]), e.persistent ? s("", !0) : (y(), o(J, {
480
479
  key: 0,
481
480
  icon: "close",
482
- label: e.closeLabel ?? T(a).close,
481
+ label: e.closeLabel ?? D(a).close,
483
482
  onClick: f
484
483
  }, null, 8, ["label"]))]),
485
- l("div", Z, [S(t.$slots, "default", {}, void 0, !0)]),
486
- t.$slots.actions ? (y(), c("div", Q, [S(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
484
+ l("div", te, [C(t.$slots, "default", {}, void 0, !0)]),
485
+ t.$slots.actions ? (y(), c("div", ne, [C(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
487
486
  ], 2)])) : s("", !0)]),
488
487
  _: 3
489
488
  }))]));
490
489
  }
491
- }), [["__scopeId", "data-v-2e3c3567"]]), ae = { class: "flex flex-col gap-1" }, oe = [
490
+ }), [["__scopeId", "data-v-2e3c3567"]]), le = { class: "flex flex-col gap-1" }, $ = [
492
491
  "id",
493
492
  "value",
494
493
  "rows",
495
494
  "disabled",
496
495
  "required"
497
- ], se = [
496
+ ], ue = [
498
497
  "id",
499
498
  "type",
500
499
  "value",
501
500
  "disabled",
502
501
  "required",
503
502
  "autocomplete"
504
- ], ce = ["for"], le = {
503
+ ], de = ["for"], fe = {
505
504
  key: 0,
506
505
  class: "text-error"
507
- }, ue = {
506
+ }, pe = {
508
507
  key: 3,
509
508
  class: "absolute right-2 top-1/2 -translate-y-1/2"
510
- }, de = {
509
+ }, me = {
511
510
  key: 0,
512
511
  class: "px-4 text-body-small text-error"
513
- }, fe = {
512
+ }, he = {
514
513
  key: 1,
515
514
  class: "px-4 text-body-small text-on-surface-variant"
516
- }, pe = /* @__PURE__ */ f({
515
+ }, ge = /* @__PURE__ */ f({
517
516
  __name: "MTextField",
518
517
  props: {
519
518
  modelValue: {},
@@ -536,7 +535,7 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
536
535
  },
537
536
  emits: ["update:modelValue"],
538
537
  setup(t, { emit: n }) {
539
- let r = t, i = n, o = E(), f = D(), p = x(null), { resolvedFieldBg: g } = W(p, () => r.fieldBg), _ = a(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), v = a(() => {
538
+ let r = t, i = n, o = O(), f = k(), p = S(null), { resolvedFieldBg: g } = K(p, () => r.fieldBg), _ = a(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), v = a(() => {
540
539
  let e = !!f.trailing || r.clearable, t = r.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", i = [
541
540
  "peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
542
541
  "transition-[border-color,border-width] duration-150",
@@ -574,15 +573,15 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
574
573
  r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary"
575
574
  ].join(" ");
576
575
  });
577
- function C(e) {
576
+ function x(e) {
578
577
  let t = e.target;
579
578
  i("update:modelValue", t.value);
580
579
  }
581
- return (n, r) => (y(), c("div", ae, [l("div", {
580
+ return (n, r) => (y(), c("div", le, [l("div", {
582
581
  ref_key: "fieldBgEl",
583
582
  ref: p,
584
583
  class: m(["relative", t.variant === "outlined" ? "mt-2" : ""]),
585
- style: h(t.variant === "outlined" ? { "--field-bg": T(g) } : void 0)
584
+ style: h(t.variant === "outlined" ? { "--field-bg": D(g) } : void 0)
586
585
  }, [
587
586
  t.leadingIcon ? (y(), c("div", {
588
587
  key: 0,
@@ -593,17 +592,17 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
593
592
  }, null, 8, ["name"])], 2)) : s("", !0),
594
593
  t.multiline ? (y(), c("textarea", {
595
594
  key: 1,
596
- id: T(o),
595
+ id: D(o),
597
596
  value: String(t.modelValue),
598
597
  rows: t.rows,
599
598
  disabled: t.disabled,
600
599
  required: t.required,
601
600
  placeholder: " ",
602
601
  class: m(v.value),
603
- onInput: C
604
- }, null, 42, oe)) : (y(), c("input", {
602
+ onInput: x
603
+ }, null, 42, $)) : (y(), c("input", {
605
604
  key: 2,
606
- id: T(o),
605
+ id: D(o),
607
606
  type: t.type,
608
607
  value: t.modelValue,
609
608
  disabled: t.disabled,
@@ -611,13 +610,13 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
611
610
  autocomplete: t.autocomplete,
612
611
  placeholder: " ",
613
612
  class: m(v.value),
614
- onInput: C
615
- }, null, 42, se)),
613
+ onInput: x
614
+ }, null, 42, ue)),
616
615
  l("label", {
617
- for: T(o),
616
+ for: D(o),
618
617
  class: m(b.value)
619
- }, [u(w(t.label), 1), t.required ? (y(), c("span", le, "\xA0*")) : s("", !0)], 10, ce),
620
- n.$slots.trailing ? (y(), c("div", ue, [S(n.$slots, "trailing")])) : _.value ? (y(), c("button", {
618
+ }, [u(T(t.label), 1), t.required ? (y(), c("span", fe, "\xA0*")) : s("", !0)], 10, de),
619
+ n.$slots.trailing ? (y(), c("div", pe, [C(n.$slots, "trailing")])) : _.value ? (y(), c("button", {
621
620
  key: 4,
622
621
  type: "button",
623
622
  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",
@@ -626,20 +625,20 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
626
625
  name: "close",
627
626
  size: 18
628
627
  })])) : s("", !0)
629
- ], 6), t.error ? (y(), c("p", de, w(t.error), 1)) : t.hint ? (y(), c("p", fe, w(t.hint), 1)) : s("", !0)]));
628
+ ], 6), t.error ? (y(), c("p", me, T(t.error), 1)) : t.hint ? (y(), c("p", he, T(t.hint), 1)) : s("", !0)]));
630
629
  }
631
- }), me = /* @__PURE__ */ f({
630
+ }), _e = /* @__PURE__ */ f({
632
631
  __name: "MMenu",
633
632
  props: { align: { default: "right" } },
634
633
  setup(e, { expose: t }) {
635
- let u = e, f = x(!1), p = x(null), m = x(null), g = x({});
636
- function C() {
634
+ let u = e, f = S(!1), p = S(null), m = S(null), g = S({});
635
+ function x() {
637
636
  if (!p.value) return;
638
637
  let e = p.value.getBoundingClientRect(), t = window.innerHeight - e.bottom - 8, n = t < 200 && e.top > t, r = { maxHeight: `${Math.min(n ? e.top - 12 : t, 400)}px` };
639
638
  n ? r.bottom = `${window.innerHeight - e.top + 4}px` : r.top = `${e.bottom + 4}px`, u.align === "right" ? r.right = `${window.innerWidth - e.right}px` : r.left = `${e.left}px`, g.value = r;
640
639
  }
641
640
  function w() {
642
- f.value || C(), f.value = !f.value;
641
+ f.value || x(), f.value = !f.value;
643
642
  }
644
643
  function T() {
645
644
  f.value = !1;
@@ -659,7 +658,7 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
659
658
  T();
660
659
  return;
661
660
  }
662
- C();
661
+ x();
663
662
  }
664
663
  function O(e) {
665
664
  e.key === "Escape" && T();
@@ -669,13 +668,13 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
669
668
  }), v(() => {
670
669
  document.removeEventListener("mousedown", E), document.removeEventListener("keydown", O), window.removeEventListener("scroll", D, !0);
671
670
  });
672
- let A = a(() => u.align === "right" ? "top right" : "top left");
671
+ let k = a(() => u.align === "right" ? "top right" : "top left");
673
672
  return (e, t) => (y(), c(n, null, [l("div", {
674
673
  ref_key: "triggerEl",
675
674
  ref: p,
676
675
  class: "inline-block",
677
676
  onClick: w
678
- }, [S(e.$slots, "trigger", { open: f.value })], 512), (y(), o(r, { to: "body" }, [d(i, {
677
+ }, [C(e.$slots, "trigger", { open: f.value })], 512), (y(), o(r, { to: "body" }, [d(i, {
679
678
  "enter-active-class": "transition-[opacity,transform] duration-100 ease-out",
680
679
  "enter-from-class": "opacity-0 scale-95",
681
680
  "enter-to-class": "opacity-100 scale-100",
@@ -683,23 +682,23 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
683
682
  "leave-from-class": "opacity-100 scale-100",
684
683
  "leave-to-class": "opacity-0 scale-95"
685
684
  }, {
686
- default: k(() => [f.value ? (y(), c("div", {
685
+ default: M(() => [f.value ? (y(), c("div", {
687
686
  key: 0,
688
687
  ref_key: "dropdownEl",
689
688
  ref: m,
690
689
  class: "fixed z-500 min-w-48 overflow-hidden rounded-lg bg-surface-container shadow-elevation-2",
691
690
  style: h({
692
691
  ...g.value,
693
- transformOrigin: A.value
692
+ transformOrigin: k.value
694
693
  })
695
694
  }, [l("div", {
696
695
  class: "overflow-y-auto py-1",
697
696
  style: h({ maxHeight: g.value.maxHeight })
698
- }, [S(e.$slots, "default", { close: T })], 4)], 4)) : s("", !0)]),
697
+ }, [C(e.$slots, "default", { close: T })], 4)], 4)) : s("", !0)]),
699
698
  _: 3
700
699
  })]))], 64));
701
700
  }
702
- }), he = { class: "flex-1" }, ge = /* @__PURE__ */ f({
701
+ }), ve = { class: "flex-1" }, ye = /* @__PURE__ */ f({
703
702
  __name: "MMenuItem",
704
703
  props: {
705
704
  icon: {},
@@ -715,34 +714,34 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
715
714
  },
716
715
  emits: ["click"],
717
716
  setup(t, { emit: n }) {
718
- let u = t, f = n, g = D(), _ = a(() => u.to ? "RouterLink" : "button"), v = a(() => !!g.children), b = p("m-menu-close", null);
719
- function w() {
717
+ let u = t, f = n, g = k(), _ = a(() => u.to ? "RouterLink" : "button"), v = a(() => !!g.children), b = p("m-menu-close", null);
718
+ function x() {
720
719
  u.disabled || v.value || (f("click"), b?.());
721
720
  }
722
- let T = x(!1), E = x(), O = x({});
723
- function A() {
721
+ let T = S(!1), E = S(), D = S({});
722
+ function O() {
724
723
  if (!v.value || u.disabled || (T.value = !0, !E.value)) return;
725
724
  let e = E.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
726
- O.value = {
725
+ D.value = {
727
726
  position: "fixed",
728
727
  top: `${e.top}px`,
729
728
  ...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
730
729
  zIndex: "501"
731
730
  };
732
731
  }
733
- function j(e) {
732
+ function A(e) {
734
733
  e.relatedTarget?.closest(".m3-submenu") || (T.value = !1);
735
734
  }
736
- function M(e) {
735
+ function j(e) {
737
736
  let t = e.relatedTarget;
738
737
  t?.closest(".m3-submenu") || E.value?.contains(t) || (T.value = !1);
739
738
  }
740
739
  return (n, a) => (y(), c("div", {
741
740
  ref_key: "itemEl",
742
741
  ref: E,
743
- onMouseenter: A,
744
- onMouseleave: j
745
- }, [(y(), o(C(_.value), {
742
+ onMouseenter: O,
743
+ onMouseleave: A
744
+ }, [(y(), o(w(_.value), {
746
745
  to: t.to || void 0,
747
746
  type: t.to ? void 0 : "button",
748
747
  class: m(["flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors", [
@@ -751,16 +750,16 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
751
750
  !t.disabled && !t.danger ? "text-on-surface hover:bg-on-surface/8" : ""
752
751
  ]]),
753
752
  disabled: t.disabled || void 0,
754
- onClick: w
753
+ onClick: x
755
754
  }, {
756
- default: k(() => [
755
+ default: M(() => [
757
756
  t.icon ? (y(), o(e, {
758
757
  key: 0,
759
758
  name: t.icon,
760
759
  size: 20,
761
760
  class: m(["shrink-0", t.danger ? "text-error" : "text-on-surface-variant"])
762
761
  }, null, 8, ["name", "class"])) : s("", !0),
763
- l("span", he, [S(n.$slots, "default")]),
762
+ l("span", ve, [C(n.$slots, "default")]),
764
763
  v.value ? (y(), o(e, {
765
764
  key: 1,
766
765
  name: "chevron_right",
@@ -783,17 +782,17 @@ var G = "inline-flex shrink-0 items-center justify-center transition-colors dura
783
782
  "leave-active-class": "transition-opacity duration-75",
784
783
  "leave-to-class": "opacity-0"
785
784
  }, {
786
- default: k(() => [T.value ? (y(), c("div", {
785
+ default: M(() => [T.value ? (y(), c("div", {
787
786
  key: 0,
788
787
  class: "m3-submenu min-w-44 overflow-hidden rounded-lg bg-surface-container py-1 shadow-elevation-2",
789
- style: h(O.value),
790
- onMouseleave: M
791
- }, [S(n.$slots, "children")], 36)) : s("", !0)]),
788
+ style: h(D.value),
789
+ onMouseleave: j
790
+ }, [C(n.$slots, "children")], 36)) : s("", !0)]),
792
791
  _: 3
793
792
  })])) : s("", !0)], 544));
794
793
  }
795
794
  });
796
795
  //#endregion
797
- export { J as a, B as c, N as d, ie as i, M as l, me as n, K as o, pe as r, W as s, ge as t, j as u };
796
+ export { X as a, H as c, I as d, ce as i, F as l, _e as n, J as o, ge as r, K as s, ye as t, P as u };
798
797
 
799
- //# sourceMappingURL=MMenuItem-FyttjOj_.js.map
798
+ //# sourceMappingURL=MMenuItem-BsZO5XuL.js.map