@m3ui-vue/m3ui-vue 0.5.1 → 0.5.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,93 +1,16 @@
1
- import { t as e } from "./MIcon-CaEooCmZ.js";
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, 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
- //#region src/composables/useLocale.ts
5
- var P = {
6
- search: "Search...",
7
- noResults: "No results",
8
- close: "Close",
9
- cancel: "Cancel",
10
- confirm: "Confirm",
11
- loading: "Loading",
12
- previous: "Previous",
13
- next: "Next",
14
- today: "Today",
15
- more: "more",
16
- selectedCount: "selected",
17
- recordCount: "record",
18
- expand: "Expand",
19
- columns: "Columns",
20
- exportCsv: "Export CSV",
21
- noGroup: "No group",
22
- finish: "Finish",
23
- dropText: "Drop files here or",
24
- selectText: "browse",
25
- maxSizePrefix: "Max.",
26
- remove: "Remove",
27
- selectDate: "Select date",
28
- selectTime: "Select time",
29
- selectRange: "Select range",
30
- pickStart: "Select start",
31
- pickEnd: "Select end",
32
- previousMonth: "Previous month",
33
- nextMonth: "Next month",
34
- dayView: "Day",
35
- weekView: "Week",
36
- available: "Available",
37
- selected: "Selected",
38
- noItems: "No items",
39
- moveAllRight: "Move all right",
40
- moveRight: "Move selected right",
41
- moveLeft: "Move selected left",
42
- moveAllLeft: "Move all left",
43
- searchCommand: "Search command...",
44
- navigateHint: "navigate",
45
- selectHint: "select",
46
- openHint: "open",
47
- closeHint: "close",
48
- loadingMore: "Loading...",
49
- noMoreItems: "No more items",
50
- bold: "Bold",
51
- italic: "Italic",
52
- underline: "Underline",
53
- strikethrough: "Strikethrough",
54
- highlight: "Highlight",
55
- bulletList: "Bullet list",
56
- orderedList: "Ordered list",
57
- blockquote: "Blockquote",
58
- code: "Code",
59
- alignLeft: "Align left",
60
- alignCenter: "Align center",
61
- alignRight: "Align right",
62
- undo: "Undo",
63
- redo: "Redo",
64
- link: "Link",
65
- image: "Image",
66
- paragraph: "Paragraph",
67
- heading1: "Heading 1",
68
- heading2: "Heading 2",
69
- heading3: "Heading 3",
70
- insertLink: "Insert link",
71
- insertImage: "Insert image",
72
- imageUrlLabel: "Image URL",
73
- insert: "Insert"
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;
80
- }
81
- //#endregion
1
+ import { r as e } from "./useLocale-QCIVDYWx.js";
2
+ import { t } from "./MIcon-CaEooCmZ.js";
3
+ import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
+ import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, onUnmounted as y, openBlock as b, provide as x, ref as S, renderSlot as C, resolveDynamicComponent as w, toDisplayString as T, unref as E, useId as D, useSlots as O, watch as k, withCtx as A, withModifiers as j } from "vue";
82
5
  //#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
83
- var L = ["aria-label"], R = {
6
+ var M = ["aria-label"], N = {
84
7
  key: 0,
85
8
  class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
86
- }, ee = [
9
+ }, P = [
87
10
  "width",
88
11
  "height",
89
12
  "viewBox"
90
- ], z = ["d", "stroke-dasharray"], B = 3, V = 9, H = /* @__PURE__ */ f({
13
+ ], F = ["d", "stroke-dasharray"], I = 3, L = 9, R = /* @__PURE__ */ p({
91
14
  __name: "MSpinner",
92
15
  props: {
93
16
  size: { default: 20 },
@@ -97,12 +20,12 @@ var L = ["aria-label"], R = {
97
20
  },
98
21
  label: {}
99
22
  },
100
- setup(e) {
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;
103
- for (let r = 0; r <= a; r++) {
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);
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;
23
+ setup(t) {
24
+ let n = t, r = e(), i = o(() => (n.size / 2 - 1 - I / 2) / 1.25), a = o(() => n.size / 2), s = o(() => {
25
+ let e = a.value, t = i.value, n = t * .08, r = L * 24, o = [], s = 0, c = 0, l = 0;
26
+ for (let i = 0; i <= r; i++) {
27
+ let a = 2 * Math.PI * i / r - Math.PI / 2, u = t + n * Math.sin(L * a), d = e + u * Math.cos(a), f = e + u * Math.sin(a);
28
+ i > 0 && (s += Math.sqrt((d - c) ** 2 + (f - l) ** 2)), o.push(`${i === 0 ? "M" : "L"}${d.toFixed(2)},${f.toFixed(2)}`), c = d, l = f;
106
29
  }
107
30
  let u = s * .58, d = s - u, f = `${u.toFixed(1)} ${d.toFixed(1)}`;
108
31
  return {
@@ -111,33 +34,33 @@ var L = ["aria-label"], R = {
111
34
  len: s.toFixed(1)
112
35
  };
113
36
  });
114
- return (t, r) => (y(), c("span", {
37
+ return (e, n) => (b(), l("span", {
115
38
  class: "inline-flex shrink-0 items-center justify-center",
116
- style: h({
117
- width: `${e.size}px`,
118
- height: `${e.size}px`
39
+ style: g({
40
+ width: `${t.size}px`,
41
+ height: `${t.size}px`
119
42
  }),
120
43
  role: "status",
121
- "aria-label": e.label ?? D(n).loading
122
- }, [e.wavy ? (y(), c("svg", {
44
+ "aria-label": t.label ?? E(r).loading
45
+ }, [t.wavy ? (b(), l("svg", {
123
46
  key: 1,
124
- width: e.size,
125
- height: e.size,
126
- viewBox: `0 0 ${e.size} ${e.size}`,
47
+ width: t.size,
48
+ height: t.size,
49
+ viewBox: `0 0 ${t.size} ${t.size}`,
127
50
  fill: "none",
128
51
  class: "animate-[m3-wavy-spin_2.8s_linear_infinite]",
129
- style: h(`transform-origin: ${i.value}px ${i.value}px`)
130
- }, [l("path", {
131
- d: o.value.path,
52
+ style: g(`transform-origin: ${a.value}px ${a.value}px`)
53
+ }, [u("path", {
54
+ d: s.value.path,
132
55
  stroke: "currentColor",
133
- "stroke-width": B,
56
+ "stroke-width": I,
134
57
  "stroke-linecap": "round",
135
- "stroke-dasharray": o.value.dash,
58
+ "stroke-dasharray": s.value.dash,
136
59
  class: "animate-[m3-wavy-travel_2s_linear_infinite]",
137
- style: h({ "--m3-wave-len": o.value.len })
138
- }, null, 12, z)], 12, ee)) : (y(), c("span", R))], 12, L));
60
+ style: g({ "--m3-wave-len": s.value.len })
61
+ }, null, 12, F)], 12, P)) : (b(), l("span", N))], 12, M));
139
62
  }
140
- }), U = [
63
+ }), z = [
141
64
  "bg-surface-container-highest",
142
65
  "bg-surface-container-high",
143
66
  "bg-surface-container-low",
@@ -158,11 +81,11 @@ var L = ["aria-label"], R = {
158
81
  "bg-tertiary",
159
82
  "bg-error"
160
83
  ];
161
- function W(e) {
162
- for (let t of U) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
84
+ function B(e) {
85
+ for (let t of z) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
163
86
  return null;
164
87
  }
165
- function G(e) {
88
+ function ee(e) {
166
89
  if (!e || e === "transparent") return !0;
167
90
  let t = e.match(/^rgba?\(([^)]+)\)$/);
168
91
  if (t) {
@@ -171,7 +94,7 @@ function G(e) {
171
94
  }
172
95
  return !1;
173
96
  }
174
- function K(e, t) {
97
+ function V(e, t) {
175
98
  let n = S("var(--color-surface)");
176
99
  function r(r) {
177
100
  n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
@@ -179,7 +102,7 @@ function K(e, t) {
179
102
  function i() {
180
103
  let t = e.value?.parentElement ?? null;
181
104
  for (; t;) {
182
- let e = W(t);
105
+ let e = B(t);
183
106
  if (e) {
184
107
  r(e);
185
108
  return;
@@ -189,7 +112,7 @@ function K(e, t) {
189
112
  return;
190
113
  }
191
114
  let n = getComputedStyle(t).backgroundColor;
192
- if (!G(n)) {
115
+ if (!ee(n)) {
193
116
  r(n);
194
117
  return;
195
118
  }
@@ -197,9 +120,9 @@ function K(e, t) {
197
120
  }
198
121
  r("var(--color-surface)");
199
122
  }
200
- let o = null;
201
- return _(() => {
202
- i(), o = new MutationObserver(() => i()), o.observe(document.documentElement, {
123
+ let a = null;
124
+ return v(() => {
125
+ i(), a = new MutationObserver(() => i()), a.observe(document.documentElement, {
203
126
  attributes: !0,
204
127
  attributeFilter: [
205
128
  "class",
@@ -207,11 +130,11 @@ function K(e, t) {
207
130
  "data-theme"
208
131
  ]
209
132
  });
210
- }), g(() => o?.disconnect()), { resolvedFieldBg: a(() => t() ?? n.value) };
133
+ }), _(() => a?.disconnect()), { resolvedFieldBg: o(() => t() ?? n.value) };
211
134
  }
212
135
  //#endregion
213
136
  //#region src/composables/useDebounce.ts
214
- function q(e, t) {
137
+ function H(e, t) {
215
138
  let n = null;
216
139
  function r(...r) {
217
140
  n && clearTimeout(n), n = setTimeout(() => {
@@ -221,14 +144,14 @@ function q(e, t) {
221
144
  function i() {
222
145
  n &&= (clearTimeout(n), null);
223
146
  }
224
- return g(i), {
147
+ return _(i), {
225
148
  debounced: r,
226
149
  cancel: i
227
150
  };
228
151
  }
229
152
  //#endregion
230
153
  //#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
231
- var J = "inline-flex shrink-0 items-center justify-center transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38]", Y = /* @__PURE__ */ f({
154
+ var U = "inline-flex shrink-0 items-center justify-center transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:opacity-[0.38]", W = /* @__PURE__ */ p({
232
155
  __name: "MIconButton",
233
156
  props: {
234
157
  icon: {},
@@ -242,8 +165,8 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
242
165
  },
243
166
  to: {}
244
167
  },
245
- setup(t) {
246
- let n = t, r = a(() => n.to ? "RouterLink" : "button"), i = {
168
+ setup(e) {
169
+ let n = e, r = o(() => n.to ? "RouterLink" : "button"), i = {
247
170
  xs: {
248
171
  px: 32,
249
172
  icon: 16
@@ -264,16 +187,16 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
264
187
  px: 64,
265
188
  icon: 32
266
189
  }
267
- }, s = a(() => typeof n.size == "number" ? {
190
+ }, a = o(() => typeof n.size == "number" ? {
268
191
  px: n.size,
269
192
  icon: Math.round(n.size * .55)
270
- } : i[n.size] ?? i.sm), c = a(() => n.shape === "squared" ? "rounded-md" : "rounded-full");
193
+ } : i[n.size] ?? i.sm), c = o(() => n.shape === "squared" ? "rounded-md" : "rounded-full");
271
194
  function l(e) {
272
195
  if (n.disabled) return;
273
196
  let t = e.currentTarget, r = t.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = document.createElement("span");
274
197
  a.className = "m3-ripple", a.style.cssText = `width:${i}px;height:${i}px;top:${e.clientY - r.top - i / 2}px;left:${e.clientX - r.left - i / 2}px`, t.appendChild(a), a.addEventListener("animationend", () => a.remove(), { once: !0 });
275
198
  }
276
- let u = a(() => {
199
+ let u = o(() => {
277
200
  switch (n.variant) {
278
201
  case "filled": return "bg-primary text-on-primary hover:shadow-elevation-1";
279
202
  case "tonal": return "bg-secondary-container text-on-secondary-container hover:shadow-elevation-1";
@@ -281,26 +204,26 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
281
204
  default: return "text-on-surface-variant hover:bg-on-surface/8 active:bg-on-surface/12";
282
205
  }
283
206
  });
284
- return (n, i) => (y(), o(w(r.value), {
285
- to: t.to || void 0,
286
- type: t.to ? void 0 : "button",
287
- "aria-label": t.label || void 0,
288
- disabled: t.disabled,
289
- class: m([
290
- J,
207
+ return (n, i) => (b(), s(w(r.value), {
208
+ to: e.to || void 0,
209
+ type: e.to ? void 0 : "button",
210
+ "aria-label": e.label || void 0,
211
+ disabled: e.disabled,
212
+ class: h([
213
+ U,
291
214
  c.value,
292
215
  u.value,
293
216
  "relative overflow-hidden"
294
217
  ]),
295
- style: h({
296
- width: `${s.value.px}px`,
297
- height: `${s.value.px}px`
218
+ style: g({
219
+ width: `${a.value.px}px`,
220
+ height: `${a.value.px}px`
298
221
  }),
299
222
  onPointerdown: l
300
223
  }, {
301
- default: M(() => [d(e, {
302
- name: t.icon,
303
- size: s.value.icon
224
+ default: A(() => [f(t, {
225
+ name: e.icon,
226
+ size: a.value.icon
304
227
  }, null, 8, ["name", "size"])]),
305
228
  _: 1
306
229
  }, 40, [
@@ -312,7 +235,7 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
312
235
  "style"
313
236
  ]));
314
237
  }
315
- }), X = "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]", Z = /* @__PURE__ */ f({
238
+ }), G = "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]", K = /* @__PURE__ */ p({
316
239
  __name: "MButton",
317
240
  props: {
318
241
  variant: { default: "filled" },
@@ -331,15 +254,15 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
331
254
  shape: { default: "rounded" },
332
255
  to: {}
333
256
  },
334
- setup(t) {
335
- let n = ["primary", "error"], r = t, i = a(() => r.to ? "RouterLink" : "button"), c = a(() => !!r.color && !n.includes(r.color)), l = a(() => {
336
- if (c.value) return {
257
+ setup(e) {
258
+ let n = ["primary", "error"], r = e, i = o(() => r.to ? "RouterLink" : "button"), a = o(() => !!r.color && !n.includes(r.color)), l = o(() => {
259
+ if (a.value) return {
337
260
  "--color-primary": r.color,
338
261
  "--color-on-primary": "#ffffff",
339
262
  "--color-primary-container": r.color + "33",
340
263
  "--color-on-primary-container": r.color
341
264
  };
342
- }), u = a(() => r.color === "error"), d = a(() => r.shape === "squared" ? "rounded-md" : "rounded-full"), f = {
265
+ }), u = o(() => r.color === "error"), d = o(() => r.shape === "squared" ? "rounded-md" : "rounded-full"), f = {
343
266
  xs: {
344
267
  h: "h-8",
345
268
  text: "text-label-medium",
@@ -385,7 +308,7 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
385
308
  pxIcon: "pl-7 pr-8",
386
309
  pxText: "px-4"
387
310
  }
388
- }, p = a(() => f[r.size] ?? f.sm), g = a(() => `${p.value.h} ${p.value.text}`), _ = a(() => p.value.icon), v = a(() => p.value.spinner), b = a(() => r.variant === "text" ? p.value.pxText : r.icon || r.loading ? p.value.pxIcon : p.value.px), x = a(() => {
311
+ }, p = o(() => f[r.size] ?? f.sm), m = o(() => `${p.value.h} ${p.value.text}`), _ = o(() => p.value.icon), v = o(() => p.value.spinner), y = o(() => r.variant === "text" ? p.value.pxText : r.icon || r.loading ? p.value.pxIcon : p.value.px), x = o(() => {
389
312
  let e = u.value;
390
313
  switch (r.variant) {
391
314
  case "filled": return e ? "bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
@@ -401,28 +324,28 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
401
324
  let t = e.currentTarget, n = t.getBoundingClientRect(), i = Math.max(n.width, n.height) * 2, a = document.createElement("span");
402
325
  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 });
403
326
  }
404
- return (n, r) => (y(), o(w(i.value), {
405
- to: t.to || void 0,
406
- type: t.to ? void 0 : t.type,
407
- disabled: t.disabled || t.loading,
408
- class: m([
409
- X,
327
+ return (n, r) => (b(), s(w(i.value), {
328
+ to: e.to || void 0,
329
+ type: e.to ? void 0 : e.type,
330
+ disabled: e.disabled || e.loading,
331
+ class: h([
332
+ G,
410
333
  d.value,
411
- g.value,
412
- b.value,
334
+ m.value,
335
+ y.value,
413
336
  x.value
414
337
  ]),
415
- style: h(l.value),
338
+ style: g(l.value),
416
339
  onPointerdown: S
417
340
  }, {
418
- default: M(() => [t.loading ? (y(), o(H, {
341
+ default: A(() => [e.loading ? (b(), s(R, {
419
342
  key: 0,
420
343
  size: v.value
421
- }, null, 8, ["size"])) : t.icon ? (y(), o(e, {
344
+ }, null, 8, ["size"])) : e.icon ? (b(), s(t, {
422
345
  key: 1,
423
- name: t.icon,
346
+ name: e.icon,
424
347
  size: _.value
425
- }, null, 8, ["name", "size"])) : s("", !0), C(n.$slots, "default")]),
348
+ }, null, 8, ["name", "size"])) : c("", !0), C(n.$slots, "default")]),
426
349
  _: 3
427
350
  }, 40, [
428
351
  "to",
@@ -432,16 +355,16 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
432
355
  "style"
433
356
  ]));
434
357
  }
435
- }), Q = { class: "flex items-start justify-between gap-4 px-6 pt-6 pb-2" }, te = { class: "text-headline-small text-on-surface" }, ne = { class: "overflow-y-auto px-6 py-2 text-body-medium text-on-surface-variant" }, re = {
358
+ }), q = { class: "flex items-start justify-between gap-4 px-6 pt-6 pb-2" }, J = { class: "text-headline-small text-on-surface" }, Y = { class: "overflow-y-auto px-6 py-2 text-body-medium text-on-surface-variant" }, X = {
436
359
  key: 0,
437
360
  class: "flex justify-end gap-2 px-6 py-4"
438
- }, ie = {
361
+ }, Z = {
439
362
  key: 0,
440
363
  class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
441
- }, ae = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, oe = { class: "flex-1 text-title-large font-medium text-on-surface" }, se = {
364
+ }, Q = { 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 = {
442
365
  key: 1,
443
366
  class: "flex items-center gap-2"
444
- }, ce = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, le = /*#__PURE__*/ t(/* @__PURE__ */ f({
367
+ }, re = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, ie = /*#__PURE__*/ n(/* @__PURE__ */ p({
445
368
  __name: "MDialog",
446
369
  props: {
447
370
  modelValue: { type: Boolean },
@@ -458,78 +381,78 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
458
381
  closeLabel: {}
459
382
  },
460
383
  emits: ["update:modelValue"],
461
- setup(e, { emit: t }) {
462
- let n = e, a = I(), d = t;
463
- function f() {
464
- n.persistent || d("update:modelValue", !1);
384
+ setup(t, { emit: n }) {
385
+ let r = t, o = e(), f = n;
386
+ function p() {
387
+ r.persistent || f("update:modelValue", !1);
465
388
  }
466
- function p(e) {
467
- e.key === "Escape" && f();
389
+ function m(e) {
390
+ e.key === "Escape" && p();
468
391
  }
469
- return A(() => n.modelValue, (e) => {
470
- e ? (document.addEventListener("keydown", p), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", p), document.body.style.overflow = "");
471
- }), (t, n) => (y(), o(r, { to: "body" }, [e.fullscreen ? (y(), o(i, {
392
+ return k(() => r.modelValue, (e) => {
393
+ e ? (document.addEventListener("keydown", m), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", m), document.body.style.overflow = "");
394
+ }), (e, n) => (b(), s(i, { to: "body" }, [t.fullscreen ? (b(), s(a, {
472
395
  key: 1,
473
396
  name: "m3-dialog-fs"
474
397
  }, {
475
- default: M(() => [e.modelValue ? (y(), c("div", ie, [l("div", ae, [
476
- e.persistent ? s("", !0) : (y(), o(Y, {
398
+ default: A(() => [t.modelValue ? (b(), l("div", Z, [u("div", Q, [
399
+ t.persistent ? c("", !0) : (b(), s(W, {
477
400
  key: 0,
478
401
  icon: "close",
479
- label: e.closeLabel ?? D(a).close,
480
- onClick: f
402
+ label: t.closeLabel ?? E(o).close,
403
+ onClick: p
481
404
  }, null, 8, ["label"])),
482
- l("h2", oe, [C(t.$slots, "title", {}, () => [u(T(e.title), 1)], !0)]),
483
- t.$slots.actions ? (y(), c("div", se, [C(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
484
- ]), l("div", ce, [C(t.$slots, "default", {}, void 0, !0)])])) : s("", !0)]),
405
+ u("h2", te, [C(e.$slots, "title", {}, () => [d(T(t.title), 1)], !0)]),
406
+ e.$slots.actions ? (b(), l("div", ne, [C(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
407
+ ]), u("div", re, [C(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
485
408
  _: 3
486
- })) : (y(), o(i, {
409
+ })) : (b(), s(a, {
487
410
  key: 0,
488
411
  name: "m3-dialog"
489
412
  }, {
490
- default: M(() => [e.modelValue ? (y(), c("div", {
413
+ default: A(() => [t.modelValue ? (b(), l("div", {
491
414
  key: 0,
492
415
  class: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
493
- onClick: N(f, ["self"])
494
- }, [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]) }, [
495
- l("div", Q, [l("h2", te, [C(t.$slots, "title", {}, () => [u(T(e.title), 1)], !0)]), e.persistent ? s("", !0) : (y(), o(Y, {
416
+ onClick: j(p, ["self"])
417
+ }, [u("div", { class: h(["dialog-box flex max-h-[90vh] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", t.maxWidth]) }, [
418
+ u("div", q, [u("h2", J, [C(e.$slots, "title", {}, () => [d(T(t.title), 1)], !0)]), t.persistent ? c("", !0) : (b(), s(W, {
496
419
  key: 0,
497
420
  icon: "close",
498
- label: e.closeLabel ?? D(a).close,
499
- onClick: f
421
+ label: t.closeLabel ?? E(o).close,
422
+ onClick: p
500
423
  }, null, 8, ["label"]))]),
501
- l("div", ne, [C(t.$slots, "default", {}, void 0, !0)]),
502
- t.$slots.actions ? (y(), c("div", re, [C(t.$slots, "actions", {}, void 0, !0)])) : s("", !0)
503
- ], 2)])) : s("", !0)]),
424
+ u("div", Y, [C(e.$slots, "default", {}, void 0, !0)]),
425
+ e.$slots.actions ? (b(), l("div", X, [C(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
426
+ ], 2)])) : c("", !0)]),
504
427
  _: 3
505
428
  }))]));
506
429
  }
507
- }), [["__scopeId", "data-v-2e3c3567"]]), ue = { class: "flex flex-col gap-1" }, de = [
430
+ }), [["__scopeId", "data-v-2e3c3567"]]), ae = { class: "flex flex-col gap-1" }, oe = [
508
431
  "id",
509
432
  "value",
510
433
  "rows",
511
434
  "disabled",
512
435
  "required"
513
- ], fe = [
436
+ ], se = [
514
437
  "id",
515
438
  "type",
516
439
  "value",
517
440
  "disabled",
518
441
  "required",
519
442
  "autocomplete"
520
- ], pe = ["for"], me = {
443
+ ], $ = ["for"], ce = {
521
444
  key: 0,
522
445
  class: "text-error"
523
- }, he = {
446
+ }, le = {
524
447
  key: 3,
525
448
  class: "absolute right-2 top-1/2 -translate-y-1/2"
526
- }, ge = {
449
+ }, ue = {
527
450
  key: 0,
528
451
  class: "px-4 text-body-small text-error"
529
- }, $ = {
452
+ }, de = {
530
453
  key: 1,
531
454
  class: "px-4 text-body-small text-on-surface-variant"
532
- }, _e = /* @__PURE__ */ f({
455
+ }, fe = /* @__PURE__ */ p({
533
456
  __name: "MTextField",
534
457
  props: {
535
458
  modelValue: {},
@@ -553,9 +476,9 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
553
476
  debounce: { default: 0 }
554
477
  },
555
478
  emits: ["update:modelValue", "debounced"],
556
- setup(t, { emit: n }) {
557
- let r = t, i = n, o = O(), f = k(), p = S(null), { resolvedFieldBg: g } = K(p, () => r.fieldBg), { debounced: _, cancel: v } = q((e) => i("debounced", e), r.debounce), b = a(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), x = a(() => {
558
- let e = !!f.trailing || r.clearable, t = r.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", i = [
479
+ setup(e, { emit: n }) {
480
+ let r = e, i = n, a = D(), s = O(), p = S(null), { resolvedFieldBg: m } = V(p, () => r.fieldBg), { debounced: _, cancel: v } = H((e) => i("debounced", e), r.debounce), y = o(() => r.clearable && String(r.modelValue).length > 0 && !r.disabled), x = o(() => {
481
+ let e = !!s.trailing || r.clearable, t = r.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", i = [
559
482
  "peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
560
483
  "transition-[border-color,border-width] duration-150",
561
484
  "disabled:cursor-not-allowed disabled:opacity-[0.38]",
@@ -572,7 +495,7 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
572
495
  "rounded-t-sm bg-surface-container-highest border-b pt-6 pb-2",
573
496
  r.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"
574
497
  ].join(" ");
575
- }), w = a(() => {
498
+ }), w = o(() => {
576
499
  let e = [
577
500
  "pointer-events-none absolute truncate transition-all duration-200",
578
501
  r.leadingIcon ? r.variant === "outlined" ? "left-11" : "left-12" : r.variant === "outlined" ? "left-3" : "left-4",
@@ -592,110 +515,110 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
592
515
  r.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary"
593
516
  ].join(" ");
594
517
  });
595
- function E(e) {
518
+ function k(e) {
596
519
  let t = e.target;
597
520
  i("update:modelValue", t.value), r.debounce > 0 && _(t.value);
598
521
  }
599
- return (n, r) => (y(), c("div", ue, [l("div", {
522
+ return (n, r) => (b(), l("div", ae, [u("div", {
600
523
  ref_key: "fieldBgEl",
601
524
  ref: p,
602
- class: m(["relative", t.variant === "outlined" ? "mt-2" : ""]),
603
- style: h(t.variant === "outlined" ? { "--field-bg": D(g) } : void 0)
525
+ class: h(["relative", e.variant === "outlined" ? "mt-2" : ""]),
526
+ style: g(e.variant === "outlined" ? { "--field-bg": E(m) } : void 0)
604
527
  }, [
605
- t.leadingIcon ? (y(), c("div", {
528
+ e.leadingIcon ? (b(), l("div", {
606
529
  key: 0,
607
- class: m(["pointer-events-none absolute left-3.5 text-on-surface-variant", t.multiline ? "top-[55%] -translate-y-1/2" : t.variant === "filled" ? "top-5" : "top-4.5"])
608
- }, [d(e, {
609
- name: t.leadingIcon,
530
+ class: h(["pointer-events-none absolute left-3.5 text-on-surface-variant", e.multiline ? "top-[55%] -translate-y-1/2" : e.variant === "filled" ? "top-5" : "top-4.5"])
531
+ }, [f(t, {
532
+ name: e.leadingIcon,
610
533
  size: 20
611
- }, null, 8, ["name"])], 2)) : s("", !0),
612
- t.multiline ? (y(), c("textarea", {
534
+ }, null, 8, ["name"])], 2)) : c("", !0),
535
+ e.multiline ? (b(), l("textarea", {
613
536
  key: 1,
614
- id: D(o),
615
- value: String(t.modelValue),
616
- rows: t.rows,
617
- disabled: t.disabled,
618
- required: t.required,
537
+ id: E(a),
538
+ value: String(e.modelValue),
539
+ rows: e.rows,
540
+ disabled: e.disabled,
541
+ required: e.required,
619
542
  placeholder: " ",
620
- class: m(x.value),
621
- onInput: E
622
- }, null, 42, de)) : (y(), c("input", {
543
+ class: h(x.value),
544
+ onInput: k
545
+ }, null, 42, oe)) : (b(), l("input", {
623
546
  key: 2,
624
- id: D(o),
625
- type: t.type,
626
- value: t.modelValue,
627
- disabled: t.disabled,
628
- required: t.required,
629
- autocomplete: t.autocomplete,
547
+ id: E(a),
548
+ type: e.type,
549
+ value: e.modelValue,
550
+ disabled: e.disabled,
551
+ required: e.required,
552
+ autocomplete: e.autocomplete,
630
553
  placeholder: " ",
631
- class: m(x.value),
632
- onInput: E
633
- }, null, 42, fe)),
634
- l("label", {
635
- for: D(o),
636
- class: m(w.value)
637
- }, [u(T(t.label), 1), t.required ? (y(), c("span", me, "\xA0*")) : s("", !0)], 10, pe),
638
- n.$slots.trailing ? (y(), c("div", he, [C(n.$slots, "trailing")])) : b.value ? (y(), c("button", {
554
+ class: h(x.value),
555
+ onInput: k
556
+ }, null, 42, se)),
557
+ u("label", {
558
+ for: E(a),
559
+ class: h(w.value)
560
+ }, [d(T(e.label), 1), e.required ? (b(), l("span", ce, "\xA0*")) : c("", !0)], 10, $),
561
+ n.$slots.trailing ? (b(), l("div", le, [C(n.$slots, "trailing")])) : y.value ? (b(), l("button", {
639
562
  key: 4,
640
563
  type: "button",
641
564
  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",
642
565
  onClick: r[0] ||= (e) => {
643
- D(v)(), i("update:modelValue", "");
566
+ E(v)(), i("update:modelValue", "");
644
567
  }
645
- }, [d(e, {
568
+ }, [f(t, {
646
569
  name: "close",
647
570
  size: 18
648
- })])) : s("", !0)
649
- ], 6), t.error && t.errorLabel ? (y(), c("p", ge, T(t.errorLabel), 1)) : t.hint ? (y(), c("p", $, T(t.hint), 1)) : s("", !0)]));
571
+ })])) : c("", !0)
572
+ ], 6), e.error && e.errorLabel ? (b(), l("p", ue, T(e.errorLabel), 1)) : e.hint ? (b(), l("p", de, T(e.hint), 1)) : c("", !0)]));
650
573
  }
651
- }), ve = /* @__PURE__ */ f({
574
+ }), pe = /* @__PURE__ */ p({
652
575
  __name: "MMenu",
653
576
  props: { align: { default: "right" } },
654
577
  setup(e, { expose: t }) {
655
- let u = e, f = S(!1), p = S(null), m = S(null), g = S({});
656
- function x() {
578
+ let n = e, d = S(!1), p = S(null), m = S(null), h = S({});
579
+ function _() {
657
580
  if (!p.value) return;
658
- 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` };
659
- 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;
581
+ let e = p.value.getBoundingClientRect(), t = window.innerHeight - e.bottom - 8, r = t < 200 && e.top > t, i = { maxHeight: `${Math.min(r ? e.top - 12 : t, 400)}px` };
582
+ r ? i.bottom = `${window.innerHeight - e.top + 4}px` : i.top = `${e.bottom + 4}px`, n.align === "right" ? i.right = `${window.innerWidth - e.right}px` : i.left = `${e.left}px`, h.value = i;
660
583
  }
661
584
  function w() {
662
- f.value || x(), f.value = !f.value;
585
+ d.value || _(), d.value = !d.value;
663
586
  }
664
587
  function T() {
665
- f.value = !1;
588
+ d.value = !1;
666
589
  }
667
- b("m-menu-close", T), t({
590
+ x("m-menu-close", T), t({
668
591
  close: T,
669
- open: f
592
+ open: d
670
593
  });
671
594
  function E(e) {
672
595
  let t = e.target;
673
596
  p.value?.contains(t) || m.value?.contains(t) || t.closest?.(".m3-submenu") || T();
674
597
  }
675
598
  function D(e) {
676
- if (!f.value || m.value?.contains(e.target) || !p.value) return;
599
+ if (!d.value || m.value?.contains(e.target) || !p.value) return;
677
600
  let t = p.value.getBoundingClientRect();
678
601
  if (t.bottom < 0 || t.top > window.innerHeight) {
679
602
  T();
680
603
  return;
681
604
  }
682
- x();
605
+ _();
683
606
  }
684
607
  function O(e) {
685
608
  e.key === "Escape" && T();
686
609
  }
687
- _(() => {
610
+ v(() => {
688
611
  document.addEventListener("mousedown", E), document.addEventListener("keydown", O), window.addEventListener("scroll", D, !0);
689
- }), v(() => {
612
+ }), y(() => {
690
613
  document.removeEventListener("mousedown", E), document.removeEventListener("keydown", O), window.removeEventListener("scroll", D, !0);
691
614
  });
692
- let k = a(() => u.align === "right" ? "top right" : "top left");
693
- return (e, t) => (y(), c(n, null, [l("div", {
615
+ let k = o(() => n.align === "right" ? "top right" : "top left");
616
+ return (e, t) => (b(), l(r, null, [u("div", {
694
617
  ref_key: "triggerEl",
695
618
  ref: p,
696
619
  class: "inline-block",
697
620
  onClick: w
698
- }, [C(e.$slots, "trigger", { open: f.value })], 512), (y(), o(r, { to: "body" }, [d(i, {
621
+ }, [C(e.$slots, "trigger", { open: d.value })], 512), (b(), s(i, { to: "body" }, [f(a, {
699
622
  "enter-active-class": "transition-[opacity,transform] duration-100 ease-out",
700
623
  "enter-from-class": "opacity-0 scale-95",
701
624
  "enter-to-class": "opacity-100 scale-100",
@@ -703,26 +626,26 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
703
626
  "leave-from-class": "opacity-100 scale-100",
704
627
  "leave-to-class": "opacity-0 scale-95"
705
628
  }, {
706
- default: M(() => [f.value ? (y(), c("div", {
629
+ default: A(() => [d.value ? (b(), l("div", {
707
630
  key: 0,
708
631
  ref_key: "dropdownEl",
709
632
  ref: m,
710
633
  class: "fixed z-500 min-w-48 overflow-hidden rounded-lg bg-surface-container shadow-elevation-2",
711
- style: h({
712
- ...g.value,
634
+ style: g({
635
+ ...h.value,
713
636
  transformOrigin: k.value
714
637
  })
715
- }, [l("div", {
638
+ }, [u("div", {
716
639
  class: "overflow-y-auto py-1",
717
- style: h({ maxHeight: g.value.maxHeight })
718
- }, [C(e.$slots, "default", { close: T })], 4)], 4)) : s("", !0)]),
640
+ style: g({ maxHeight: h.value.maxHeight })
641
+ }, [C(e.$slots, "default", { close: T })], 4)], 4)) : c("", !0)]),
719
642
  _: 3
720
643
  })]))], 64));
721
644
  }
722
- }), ye = { class: "flex-1" }, be = {
645
+ }), me = { class: "flex-1" }, he = {
723
646
  key: 1,
724
647
  class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
725
- }, xe = /* @__PURE__ */ f({
648
+ }, ge = /* @__PURE__ */ p({
726
649
  __name: "MMenuItem",
727
650
  props: {
728
651
  icon: {},
@@ -738,60 +661,60 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
738
661
  }
739
662
  },
740
663
  emits: ["click"],
741
- setup(t, { emit: n }) {
742
- let u = t, f = n, g = k(), _ = a(() => u.to ? "RouterLink" : "button"), v = a(() => !!g.children), b = p("m-menu-close", null);
664
+ setup(e, { emit: n }) {
665
+ let r = e, d = n, p = O(), _ = o(() => r.to ? "RouterLink" : "button"), v = o(() => !!p.children), y = m("m-menu-close", null);
743
666
  function x() {
744
- u.disabled || v.value || (f("click"), b?.());
667
+ r.disabled || v.value || (d("click"), y?.());
745
668
  }
746
- let E = S(!1), D = S(), O = S({});
747
- function A() {
748
- if (!v.value || u.disabled || (E.value = !0, !D.value)) return;
669
+ let E = S(!1), D = S(), k = S({});
670
+ function j() {
671
+ if (!v.value || r.disabled || (E.value = !0, !D.value)) return;
749
672
  let e = D.value.getBoundingClientRect(), t = e.right + 200 > window.innerWidth;
750
- O.value = {
673
+ k.value = {
751
674
  position: "fixed",
752
675
  top: `${e.top}px`,
753
676
  ...t ? { right: `${window.innerWidth - e.left}px` } : { left: `${e.right}px` },
754
677
  zIndex: "501"
755
678
  };
756
679
  }
757
- function j(e) {
680
+ function M(e) {
758
681
  e.relatedTarget?.closest(".m3-submenu") || (E.value = !1);
759
682
  }
760
683
  function N(e) {
761
684
  let t = e.relatedTarget;
762
685
  t?.closest(".m3-submenu") || D.value?.contains(t) || (E.value = !1);
763
686
  }
764
- return (n, a) => (y(), c("div", {
687
+ return (n, r) => (b(), l("div", {
765
688
  ref_key: "itemEl",
766
689
  ref: D,
767
- onMouseenter: A,
768
- onMouseleave: j
769
- }, [(y(), o(w(_.value), {
770
- to: t.to || void 0,
771
- type: t.to ? void 0 : "button",
772
- class: m(["flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors", [
773
- t.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
774
- !t.disabled && t.danger ? "text-error hover:bg-error/8" : "",
775
- !t.disabled && !t.danger ? "text-on-surface hover:bg-on-surface/8" : ""
690
+ onMouseenter: j,
691
+ onMouseleave: M
692
+ }, [(b(), s(w(_.value), {
693
+ to: e.to || void 0,
694
+ type: e.to ? void 0 : "button",
695
+ class: h(["flex w-full items-center gap-3 px-4 py-2.5 text-left text-body-large transition-colors", [
696
+ e.disabled ? "cursor-not-allowed opacity-[0.38] text-on-surface" : "cursor-pointer",
697
+ !e.disabled && e.danger ? "text-error hover:bg-error/8" : "",
698
+ !e.disabled && !e.danger ? "text-on-surface hover:bg-on-surface/8" : ""
776
699
  ]]),
777
- disabled: t.disabled || void 0,
700
+ disabled: e.disabled || void 0,
778
701
  onClick: x
779
702
  }, {
780
- default: M(() => [
781
- t.icon ? (y(), o(e, {
703
+ default: A(() => [
704
+ e.icon ? (b(), s(t, {
782
705
  key: 0,
783
- name: t.icon,
706
+ name: e.icon,
784
707
  size: 20,
785
- class: m(["shrink-0", t.danger ? "text-error" : "text-on-surface-variant"])
786
- }, null, 8, ["name", "class"])) : s("", !0),
787
- l("span", ye, [C(n.$slots, "default")]),
788
- t.shortcut && !v.value ? (y(), c("span", be, T(t.shortcut), 1)) : s("", !0),
789
- v.value ? (y(), o(e, {
708
+ class: h(["shrink-0", e.danger ? "text-error" : "text-on-surface-variant"])
709
+ }, null, 8, ["name", "class"])) : c("", !0),
710
+ u("span", me, [C(n.$slots, "default")]),
711
+ e.shortcut && !v.value ? (b(), l("span", he, T(e.shortcut), 1)) : c("", !0),
712
+ v.value ? (b(), s(t, {
790
713
  key: 2,
791
714
  name: "chevron_right",
792
715
  size: 18,
793
716
  class: "shrink-0 text-on-surface-variant"
794
- })) : s("", !0)
717
+ })) : c("", !0)
795
718
  ]),
796
719
  _: 3
797
720
  }, 8, [
@@ -799,26 +722,26 @@ var J = "inline-flex shrink-0 items-center justify-center transition-colors dura
799
722
  "type",
800
723
  "class",
801
724
  "disabled"
802
- ])), v.value ? (y(), o(r, {
725
+ ])), v.value ? (b(), s(i, {
803
726
  key: 0,
804
727
  to: "body"
805
- }, [d(i, {
728
+ }, [f(a, {
806
729
  "enter-active-class": "transition-opacity duration-100",
807
730
  "enter-from-class": "opacity-0",
808
731
  "leave-active-class": "transition-opacity duration-75",
809
732
  "leave-to-class": "opacity-0"
810
733
  }, {
811
- default: M(() => [E.value ? (y(), c("div", {
734
+ default: A(() => [E.value ? (b(), l("div", {
812
735
  key: 0,
813
736
  class: "m3-submenu min-w-44 overflow-hidden rounded-lg bg-surface-container py-1 shadow-elevation-2",
814
- style: h(O.value),
737
+ style: g(k.value),
815
738
  onMouseleave: N
816
- }, [C(n.$slots, "children")], 36)) : s("", !0)]),
739
+ }, [C(n.$slots, "children")], 36)) : c("", !0)]),
817
740
  _: 3
818
- })])) : s("", !0)], 544));
741
+ })])) : c("", !0)], 544));
819
742
  }
820
743
  });
821
744
  //#endregion
822
- export { Z as a, K as c, P as d, I as f, le as i, H as l, ve as n, Y as o, _e as r, q as s, xe as t, F as u };
745
+ export { K as a, V as c, ie as i, R as l, pe as n, W as o, fe as r, H as s, ge as t };
823
746
 
824
- //# sourceMappingURL=MMenuItem-Dw2ARZic.js.map
747
+ //# sourceMappingURL=MMenuItem-DyY4zhRA.js.map