@m3ui-vue/m3ui-vue 0.9.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -29
- package/dist/API.md +177 -18
- package/dist/{MTextField-DKtgPymd.js → MTextField-TZ7lfr09.js} +233 -108
- package/dist/MTextField-TZ7lfr09.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAppBarWithSearch.vue.d.ts +70 -0
- package/dist/components/MBottomAppBar.vue.d.ts +37 -0
- package/dist/components/MBottomSheetScaffold.vue.d.ts +40 -0
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MChip.vue.d.ts +19 -2
- package/dist/components/MContainer.vue.d.ts +1 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MDialog.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +13 -4
- package/dist/components/MListItem.vue.d.ts +2 -2
- package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
- package/dist/components/MNavigationRail.vue.d.ts +6 -0
- package/dist/components/MSearchBar.vue.d.ts +5 -3
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +33 -2
- package/dist/composables/_searchAppBar.d.ts +6 -0
- package/dist/composables/_themeTransition.d.ts +2 -0
- package/dist/composables/_useSpring.d.ts +3 -5
- package/dist/composables/motion.d.ts +101 -0
- package/dist/composables/useColorPalette.d.ts +10 -0
- package/dist/composables/useLocale.d.ts +3 -0
- package/dist/index.d.ts +8 -1
- package/dist/locales/index.js +21 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +6772 -5931
- package/dist/m3ui.js.map +1 -1
- package/dist/plugin.d.ts +7 -0
- package/dist/rich-text-editor.js +2 -2
- package/dist/styles/palettes-contrast.css +7764 -0
- package/dist/styles/theme.css +46 -2
- package/dist/styles.css +1 -1
- package/dist/{useLocale-Cn9MVIdw.js → useLocale-CuvWRZ1h.js} +4 -1
- package/dist/useLocale-CuvWRZ1h.js.map +1 -0
- package/package.json +3 -1
- package/src/__tests__/MAppBarWithSearch.test.ts +96 -0
- package/src/__tests__/MBottomAppBar.test.ts +71 -0
- package/src/__tests__/MBottomSheetScaffold.test.ts +101 -0
- package/src/__tests__/MChip.test.ts +63 -0
- package/src/__tests__/MFab.test.ts +36 -0
- package/src/__tests__/MNavigationRail.test.ts +77 -0
- package/src/__tests__/MTopAppBar.test.ts +99 -0
- package/src/__tests__/contrast.test.ts +64 -0
- package/src/__tests__/dynamicColor.test.ts +17 -0
- package/src/__tests__/motion.test.ts +37 -0
- package/src/__tests__/themeTransition.test.ts +119 -0
- package/src/components/MAppBarWithSearch.vue +236 -0
- package/src/components/MBottomAppBar.vue +181 -0
- package/src/components/MBottomSheetScaffold.vue +296 -0
- package/src/components/MBreadcrumbs.vue +1 -1
- package/src/components/MChip.vue +137 -5
- package/src/components/MFab.vue +73 -12
- package/src/components/MNavigationDrawer.vue +2 -2
- package/src/components/MNavigationRail.vue +135 -8
- package/src/components/MSearchBar.vue +28 -12
- package/src/components/MTopAppBar.vue +252 -28
- package/src/composables/_searchAppBar.ts +9 -0
- package/src/composables/_themeColor.ts +11 -4
- package/src/composables/_themeTransition.ts +71 -0
- package/src/composables/_useSpring.ts +11 -21
- package/src/composables/motion.ts +73 -0
- package/src/composables/useColorPalette.ts +103 -20
- package/src/composables/useLocale.ts +6 -0
- package/src/composables/useTheme.ts +4 -12
- package/src/index.ts +8 -1
- package/src/locales/de.ts +3 -0
- package/src/locales/es.ts +3 -0
- package/src/locales/fr.ts +3 -0
- package/src/locales/ja.ts +3 -0
- package/src/locales/ko.ts +3 -0
- package/src/locales/pt.ts +3 -0
- package/src/locales/zh.ts +3 -0
- package/src/plugin.ts +9 -1
- package/src/styles/palettes-contrast.css +7764 -0
- package/src/styles/theme.css +46 -2
- package/dist/MTextField-DKtgPymd.js.map +0 -1
- package/dist/useLocale-Cn9MVIdw.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-CuvWRZ1h.js";
|
|
2
2
|
import { t } from "./MIcon-DLOkQduI.js";
|
|
3
3
|
import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
4
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, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useId as A, useSlots as j, watch as ee, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
|
|
@@ -185,18 +185,156 @@ function q(e, t) {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
|
-
//#region src/composables/
|
|
188
|
+
//#region src/composables/motion.ts
|
|
189
189
|
var J = {
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
standard: {
|
|
191
|
+
fastSpatial: {
|
|
192
|
+
dampingRatio: .9,
|
|
193
|
+
stiffness: 1400
|
|
194
|
+
},
|
|
195
|
+
defaultSpatial: {
|
|
196
|
+
dampingRatio: .9,
|
|
197
|
+
stiffness: 700
|
|
198
|
+
},
|
|
199
|
+
slowSpatial: {
|
|
200
|
+
dampingRatio: .9,
|
|
201
|
+
stiffness: 300
|
|
202
|
+
},
|
|
203
|
+
fastEffects: {
|
|
204
|
+
dampingRatio: 1,
|
|
205
|
+
stiffness: 3800
|
|
206
|
+
},
|
|
207
|
+
defaultEffects: {
|
|
208
|
+
dampingRatio: 1,
|
|
209
|
+
stiffness: 1600
|
|
210
|
+
},
|
|
211
|
+
slowEffects: {
|
|
212
|
+
dampingRatio: 1,
|
|
213
|
+
stiffness: 800
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
expressive: {
|
|
217
|
+
fastSpatial: {
|
|
218
|
+
dampingRatio: .6,
|
|
219
|
+
stiffness: 800
|
|
220
|
+
},
|
|
221
|
+
defaultSpatial: {
|
|
222
|
+
dampingRatio: .8,
|
|
223
|
+
stiffness: 380
|
|
224
|
+
},
|
|
225
|
+
slowSpatial: {
|
|
226
|
+
dampingRatio: .8,
|
|
227
|
+
stiffness: 200
|
|
228
|
+
},
|
|
229
|
+
fastEffects: {
|
|
230
|
+
dampingRatio: 1,
|
|
231
|
+
stiffness: 3800
|
|
232
|
+
},
|
|
233
|
+
defaultEffects: {
|
|
234
|
+
dampingRatio: 1,
|
|
235
|
+
stiffness: 1600
|
|
236
|
+
},
|
|
237
|
+
slowEffects: {
|
|
238
|
+
dampingRatio: 1,
|
|
239
|
+
stiffness: 800
|
|
240
|
+
}
|
|
241
|
+
}
|
|
192
242
|
}, Y = {
|
|
193
|
-
|
|
194
|
-
|
|
243
|
+
emphasized: [
|
|
244
|
+
.2,
|
|
245
|
+
0,
|
|
246
|
+
0,
|
|
247
|
+
1
|
|
248
|
+
],
|
|
249
|
+
emphasizedDecelerate: [
|
|
250
|
+
.05,
|
|
251
|
+
.7,
|
|
252
|
+
.1,
|
|
253
|
+
1
|
|
254
|
+
],
|
|
255
|
+
emphasizedAccelerate: [
|
|
256
|
+
.3,
|
|
257
|
+
0,
|
|
258
|
+
.8,
|
|
259
|
+
.15
|
|
260
|
+
],
|
|
261
|
+
standard: [
|
|
262
|
+
.2,
|
|
263
|
+
0,
|
|
264
|
+
0,
|
|
265
|
+
1
|
|
266
|
+
],
|
|
267
|
+
standardDecelerate: [
|
|
268
|
+
0,
|
|
269
|
+
0,
|
|
270
|
+
0,
|
|
271
|
+
1
|
|
272
|
+
],
|
|
273
|
+
standardAccelerate: [
|
|
274
|
+
.3,
|
|
275
|
+
0,
|
|
276
|
+
1,
|
|
277
|
+
1
|
|
278
|
+
],
|
|
279
|
+
legacy: [
|
|
280
|
+
.4,
|
|
281
|
+
0,
|
|
282
|
+
.2,
|
|
283
|
+
1
|
|
284
|
+
],
|
|
285
|
+
legacyDecelerate: [
|
|
286
|
+
0,
|
|
287
|
+
0,
|
|
288
|
+
.2,
|
|
289
|
+
1
|
|
290
|
+
],
|
|
291
|
+
legacyAccelerate: [
|
|
292
|
+
.4,
|
|
293
|
+
0,
|
|
294
|
+
1,
|
|
295
|
+
1
|
|
296
|
+
],
|
|
297
|
+
linear: [
|
|
298
|
+
0,
|
|
299
|
+
0,
|
|
300
|
+
1,
|
|
301
|
+
1
|
|
302
|
+
]
|
|
195
303
|
}, X = {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
304
|
+
short1: 50,
|
|
305
|
+
short2: 100,
|
|
306
|
+
short3: 150,
|
|
307
|
+
short4: 200,
|
|
308
|
+
medium1: 250,
|
|
309
|
+
medium2: 300,
|
|
310
|
+
medium3: 350,
|
|
311
|
+
medium4: 400,
|
|
312
|
+
long1: 450,
|
|
313
|
+
long2: 500,
|
|
314
|
+
long3: 550,
|
|
315
|
+
long4: 600,
|
|
316
|
+
extraLong1: 700,
|
|
317
|
+
extraLong2: 800,
|
|
318
|
+
extraLong3: 900,
|
|
319
|
+
extraLong4: 1e3
|
|
320
|
+
};
|
|
321
|
+
function ie(e, t, n, r) {
|
|
322
|
+
return (i) => {
|
|
323
|
+
if (i <= 0) return 0;
|
|
324
|
+
if (i >= 1) return 1;
|
|
325
|
+
let a = i;
|
|
326
|
+
for (let t = 0; t < 8; t++) {
|
|
327
|
+
let t = 3 * a * (1 - a) ** 2 * e + 3 * a ** 2 * (1 - a) * n + a ** 3 - i, r = 3 * (1 - a) ** 2 * e + 6 * a * (1 - a) * (n - e) + 3 * a ** 2 * (1 - n);
|
|
328
|
+
if (Math.abs(r) < 1e-6) break;
|
|
329
|
+
a -= t / r;
|
|
330
|
+
}
|
|
331
|
+
return 3 * a * (1 - a) ** 2 * t + 3 * a ** 2 * (1 - a) * r + a ** 3;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/composables/_useSpring.ts
|
|
336
|
+
var ae = J.standard.fastSpatial, oe = J.standard.fastEffects, se = J.standard.defaultEffects, ce = J.standard.defaultSpatial, Z = .004;
|
|
337
|
+
function Q(e, t, n = ae) {
|
|
200
338
|
let r = [...e()], i = r.map(() => 0), a = 0, o = 0;
|
|
201
339
|
function s(c) {
|
|
202
340
|
let l = Math.min((c - o) / 1e3, 1 / 30);
|
|
@@ -205,7 +343,7 @@ function Z(e, t, n = J) {
|
|
|
205
343
|
u.length !== r.length && (r = [...u], i = u.map(() => 0));
|
|
206
344
|
let d = n.stiffness, f = 2 * n.dampingRatio * Math.sqrt(d);
|
|
207
345
|
for (; l > 0;) {
|
|
208
|
-
let e = Math.min(l,
|
|
346
|
+
let e = Math.min(l, Z);
|
|
209
347
|
l -= e;
|
|
210
348
|
for (let t = 0; t < u.length; t++) i[t] += (-d * (r[t] - u[t]) - f * i[t]) * e, r[t] += i[t] * e;
|
|
211
349
|
}
|
|
@@ -220,20 +358,7 @@ function Z(e, t, n = J) {
|
|
|
220
358
|
}
|
|
221
359
|
return ee(() => e().join(","), c), b(() => t(r)), x(() => cancelAnimationFrame(a)), { snap: l };
|
|
222
360
|
}
|
|
223
|
-
|
|
224
|
-
if (e <= 0) return 0;
|
|
225
|
-
if (e >= 1) return 1;
|
|
226
|
-
let t = e;
|
|
227
|
-
for (let n = 0; n < 8; n++) {
|
|
228
|
-
let n = 3 * t * (1 - t) ** 2 * .4 + 3 * t ** 2 * (1 - t) * .2 + t ** 3 - e, r = 3 * (1 - t) ** 2 * .4 + 6 * t * (1 - t) * -.2 + 3 * t ** 2 * .8;
|
|
229
|
-
if (Math.abs(r) < 1e-6) break;
|
|
230
|
-
t -= n / r;
|
|
231
|
-
}
|
|
232
|
-
return 3 * t ** 2 * (1 - t) + t ** 3;
|
|
233
|
-
}
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region src/components/MIconButton.vue?vue&type=script&setup=true&lang.ts
|
|
236
|
-
var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 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]", se = /* @__PURE__ */ p({
|
|
361
|
+
var le = ie(.4, 0, .2, 1), ue = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 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]", de = /* @__PURE__ */ p({
|
|
237
362
|
__name: "MIconButton",
|
|
238
363
|
props: {
|
|
239
364
|
icon: {},
|
|
@@ -308,9 +433,9 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
308
433
|
let e = u.value, t = e.px / 2;
|
|
309
434
|
return p.value ? e.pressed : r.checked ? r.shape === "squared" ? t : e.checkedRound : r.shape === "squared" ? e.square : t;
|
|
310
435
|
}
|
|
311
|
-
|
|
436
|
+
Q(() => a.value ? [m()] : [], (e) => {
|
|
312
437
|
d.value instanceof HTMLElement && (d.value.style.borderRadius = e.length ? `${e[0]}px` : "");
|
|
313
|
-
},
|
|
438
|
+
}, se);
|
|
314
439
|
function h() {
|
|
315
440
|
a.value && !r.disabled && (p.value = !0);
|
|
316
441
|
}
|
|
@@ -353,7 +478,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
353
478
|
"aria-pressed": a.value ? e.checked : void 0,
|
|
354
479
|
disabled: e.disabled,
|
|
355
480
|
class: _([
|
|
356
|
-
|
|
481
|
+
ue,
|
|
357
482
|
x.value,
|
|
358
483
|
T.value,
|
|
359
484
|
b.value
|
|
@@ -391,7 +516,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
391
516
|
color: e.rippleColor
|
|
392
517
|
}]]);
|
|
393
518
|
}
|
|
394
|
-
}),
|
|
519
|
+
}), fe = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 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]", pe = /* @__PURE__ */ p({
|
|
395
520
|
__name: "MButton",
|
|
396
521
|
props: {
|
|
397
522
|
variant: { default: "filled" },
|
|
@@ -495,7 +620,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
495
620
|
type: e.to ? void 0 : e.type,
|
|
496
621
|
disabled: e.disabled || e.loading,
|
|
497
622
|
class: _([
|
|
498
|
-
|
|
623
|
+
fe,
|
|
499
624
|
C.value,
|
|
500
625
|
g.value,
|
|
501
626
|
x.value,
|
|
@@ -535,25 +660,25 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
535
660
|
color: e.rippleColor
|
|
536
661
|
}]]);
|
|
537
662
|
}
|
|
538
|
-
}),
|
|
663
|
+
}), me = { class: "relative px-6 pt-6 pb-2" }, he = {
|
|
539
664
|
key: 0,
|
|
540
665
|
class: "absolute right-4 top-4"
|
|
541
|
-
},
|
|
666
|
+
}, ge = {
|
|
542
667
|
key: 1,
|
|
543
668
|
class: "mb-4 flex justify-center text-secondary"
|
|
544
|
-
},
|
|
669
|
+
}, _e = {
|
|
545
670
|
key: 0,
|
|
546
671
|
class: "shrink-0 border-t border-outline-variant"
|
|
547
|
-
},
|
|
672
|
+
}, ve = {
|
|
548
673
|
key: 1,
|
|
549
674
|
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
550
|
-
},
|
|
675
|
+
}, ye = {
|
|
551
676
|
key: 0,
|
|
552
677
|
class: "dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
|
|
553
|
-
},
|
|
678
|
+
}, be = { class: "flex h-14 shrink-0 items-center gap-2 px-2" }, xe = { class: "flex-1 text-title-large font-medium text-on-surface" }, Se = {
|
|
554
679
|
key: 1,
|
|
555
680
|
class: "flex items-center gap-2"
|
|
556
|
-
},
|
|
681
|
+
}, Ce = { class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant" }, we = /*#__PURE__*/ n(/* @__PURE__ */ p({
|
|
557
682
|
__name: "MDialog",
|
|
558
683
|
props: {
|
|
559
684
|
modelValue: { type: Boolean },
|
|
@@ -604,16 +729,16 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
604
729
|
name: "m3-dialog-fs",
|
|
605
730
|
appear: ""
|
|
606
731
|
}, {
|
|
607
|
-
default: M(() => [t.modelValue ? (S(), l("div",
|
|
608
|
-
t.persistent ? c("", !0) : (S(), s(
|
|
732
|
+
default: M(() => [t.modelValue ? (S(), l("div", ye, [u("div", be, [
|
|
733
|
+
t.persistent ? c("", !0) : (S(), s(de, {
|
|
609
734
|
key: 0,
|
|
610
735
|
icon: "close",
|
|
611
736
|
label: t.closeLabel ?? k(p).close,
|
|
612
737
|
onClick: C
|
|
613
738
|
}, null, 8, ["label"])),
|
|
614
|
-
u("h2",
|
|
615
|
-
e.$slots.actions ? (S(), l("div",
|
|
616
|
-
]), u("div",
|
|
739
|
+
u("h2", xe, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)]),
|
|
740
|
+
e.$slots.actions ? (S(), l("div", Se, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
741
|
+
]), u("div", Ce, [E(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
617
742
|
_: 3
|
|
618
743
|
})) : (S(), s(a, {
|
|
619
744
|
key: 0,
|
|
@@ -628,13 +753,13 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
628
753
|
class: _(["dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3", h.value]),
|
|
629
754
|
style: v(y.value)
|
|
630
755
|
}, [
|
|
631
|
-
u("div",
|
|
632
|
-
t.closable && !t.persistent ? (S(), l("div",
|
|
756
|
+
u("div", me, [
|
|
757
|
+
t.closable && !t.persistent ? (S(), l("div", he, [f(de, {
|
|
633
758
|
icon: "close",
|
|
634
759
|
label: t.closeLabel ?? k(p).close,
|
|
635
760
|
onClick: C
|
|
636
761
|
}, null, 8, ["label"])])) : c("", !0),
|
|
637
|
-
e.$slots.icon ? (S(), l("div",
|
|
762
|
+
e.$slots.icon ? (S(), l("div", ge, [E(e.$slots, "icon", {}, void 0, !0)])) : c("", !0),
|
|
638
763
|
u("h2", { class: _(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]]) }, [E(e.$slots, "title", {}, () => [d(O(t.title), 1)], !0)], 2)
|
|
639
764
|
]),
|
|
640
765
|
u("div", {
|
|
@@ -646,25 +771,25 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
646
771
|
ref_key: "contentInnerEl",
|
|
647
772
|
ref: A
|
|
648
773
|
}, [E(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
649
|
-
j.value && e.$slots.actions ? (S(), l("div",
|
|
650
|
-
e.$slots.actions ? (S(), l("div",
|
|
774
|
+
j.value && e.$slots.actions ? (S(), l("div", _e)) : c("", !0),
|
|
775
|
+
e.$slots.actions ? (S(), l("div", ve, [E(e.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
651
776
|
], 6)])) : c("", !0)]),
|
|
652
777
|
_: 3
|
|
653
778
|
}))]));
|
|
654
779
|
}
|
|
655
|
-
}), [["__scopeId", "data-v-0aac9ebd"]]),
|
|
780
|
+
}), [["__scopeId", "data-v-0aac9ebd"]]), Te = { class: "my-1 border-outline-variant" }, Ee = /* @__PURE__ */ p({
|
|
656
781
|
__name: "MMenuDivider",
|
|
657
782
|
props: { gap: {
|
|
658
783
|
type: Boolean,
|
|
659
784
|
default: !1
|
|
660
785
|
} },
|
|
661
786
|
setup(e) {
|
|
662
|
-
return (e, t) => (S(), l("hr",
|
|
787
|
+
return (e, t) => (S(), l("hr", Te));
|
|
663
788
|
}
|
|
664
|
-
}),
|
|
789
|
+
}), De = { class: "flex-1 truncate" }, Oe = { key: "root" }, ke = {
|
|
665
790
|
key: 0,
|
|
666
791
|
class: "flex flex-col gap-1 px-1.5"
|
|
667
|
-
},
|
|
792
|
+
}, Ae = { class: "overflow-hidden rounded-lg bg-surface-container" }, je = 220, $ = 1 / 240, Me = /* @__PURE__ */ p({
|
|
668
793
|
inheritAttrs: !1,
|
|
669
794
|
__name: "MMenu",
|
|
670
795
|
props: {
|
|
@@ -680,13 +805,13 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
680
805
|
return t;
|
|
681
806
|
}
|
|
682
807
|
function O(e) {
|
|
683
|
-
if (e.type !==
|
|
808
|
+
if (e.type !== Ee) return !1;
|
|
684
809
|
let t = e.props?.gap;
|
|
685
810
|
return t === "" || t === !0 || t === "true";
|
|
686
811
|
}
|
|
687
812
|
let k = o(() => {
|
|
688
813
|
if (d.variant !== "expressive") return null;
|
|
689
|
-
let e = y(p.default?.({ close:
|
|
814
|
+
let e = y(p.default?.({ close: Z }) ?? []), t = [[]];
|
|
690
815
|
for (let n of e) O(n) ? t.push([]) : t[t.length - 1].push(n);
|
|
691
816
|
return t.filter((e) => e.length > 0);
|
|
692
817
|
}), A = o(() => !!k.value && k.value.length > 1), N = w([]), P = o(() => N.value[N.value.length - 1]), F = w("forward");
|
|
@@ -698,7 +823,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
698
823
|
transform: "translateX(0%)",
|
|
699
824
|
opacity: 1
|
|
700
825
|
}], {
|
|
701
|
-
duration:
|
|
826
|
+
duration: je,
|
|
702
827
|
easing: "cubic-bezier(0.05,0.7,0.1,1)"
|
|
703
828
|
});
|
|
704
829
|
r.onfinish = t;
|
|
@@ -713,7 +838,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
713
838
|
transform: `translateX(${n * 100}%)`,
|
|
714
839
|
opacity: .4
|
|
715
840
|
}], {
|
|
716
|
-
duration:
|
|
841
|
+
duration: je,
|
|
717
842
|
easing: "cubic-bezier(0.3,0,0.8,0.15)"
|
|
718
843
|
});
|
|
719
844
|
i.onfinish = t;
|
|
@@ -761,10 +886,10 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
761
886
|
H(e, t, !1);
|
|
762
887
|
}
|
|
763
888
|
function ne(e) {
|
|
764
|
-
F.value = "forward", N.value.push(e), g(() =>
|
|
889
|
+
F.value = "forward", N.value.push(e), g(() => oe());
|
|
765
890
|
}
|
|
766
891
|
function re() {
|
|
767
|
-
F.value = "backward", N.value.pop(), g(() =>
|
|
892
|
+
F.value = "backward", N.value.pop(), g(() => oe());
|
|
768
893
|
}
|
|
769
894
|
let G = w(!1), K = w(null), q = w(null), J = w({}), Y = m("m-menu-panel-registry", /* @__PURE__ */ new Set());
|
|
770
895
|
C("m-menu-panel-registry", Y), ee(q, (e, t) => {
|
|
@@ -779,55 +904,55 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
779
904
|
let e = K.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` };
|
|
780
905
|
n ? r.bottom = `${window.innerHeight - e.top + 4}px` : r.top = `${e.bottom + 4}px`, d.align === "right" ? r.right = `${window.innerWidth - e.right}px` : r.left = `${e.left}px`, J.value = r;
|
|
781
906
|
}
|
|
782
|
-
function
|
|
907
|
+
function ae() {
|
|
783
908
|
return q.value ? Array.from(q.value.querySelectorAll("button:not(:disabled), a[href]")) : [];
|
|
784
909
|
}
|
|
785
|
-
function
|
|
786
|
-
g(() =>
|
|
910
|
+
function oe() {
|
|
911
|
+
g(() => ae()[0]?.focus());
|
|
787
912
|
}
|
|
788
|
-
function
|
|
789
|
-
let t =
|
|
913
|
+
function se(e) {
|
|
914
|
+
let t = ae();
|
|
790
915
|
if (!t.length) return;
|
|
791
916
|
let n = t.indexOf(document.activeElement);
|
|
792
917
|
(n === -1 ? e === 1 ? t[0] : t[t.length - 1] : t[(n + e + t.length) % t.length])?.focus();
|
|
793
918
|
}
|
|
794
|
-
function
|
|
795
|
-
G.value ? X?.current ===
|
|
919
|
+
function ce() {
|
|
920
|
+
G.value ? X?.current === Z && (X.current = null) : (X && X.current && X.current !== Z && X.current(), X && (X.current = Z), ie(), N.value = []), G.value = !G.value, G.value && oe();
|
|
796
921
|
}
|
|
797
|
-
function
|
|
798
|
-
X?.current ===
|
|
922
|
+
function Z() {
|
|
923
|
+
X?.current === Z && (X.current = null), G.value = !1;
|
|
799
924
|
}
|
|
800
|
-
C("m-menu-close",
|
|
925
|
+
C("m-menu-close", Z), C("m-menu-nav", {
|
|
801
926
|
mode: d.submenuMode,
|
|
802
927
|
push: ne
|
|
803
928
|
}), n({
|
|
804
|
-
close:
|
|
929
|
+
close: Z,
|
|
805
930
|
open: G
|
|
806
931
|
});
|
|
807
|
-
function
|
|
932
|
+
function Q(e) {
|
|
808
933
|
let t = e.target;
|
|
809
934
|
if (!K.value?.contains(t)) {
|
|
810
935
|
for (let e of Y) if (e.contains(t)) return;
|
|
811
|
-
t.closest?.(".m3-submenu") ||
|
|
936
|
+
t.closest?.(".m3-submenu") || Z();
|
|
812
937
|
}
|
|
813
938
|
}
|
|
814
939
|
function le(e) {
|
|
815
940
|
if (!G.value) return;
|
|
816
941
|
let t = e.target;
|
|
817
942
|
for (let e of Y) if (e.contains(t)) return;
|
|
818
|
-
t.closest?.(".m3-submenu") ||
|
|
943
|
+
t.closest?.(".m3-submenu") || Z();
|
|
819
944
|
}
|
|
820
945
|
function ue(e) {
|
|
821
946
|
if (e.key === "Escape") {
|
|
822
|
-
N.value.length ? re() :
|
|
947
|
+
N.value.length ? re() : Z();
|
|
823
948
|
return;
|
|
824
949
|
}
|
|
825
|
-
G.value && (e.key === "ArrowDown" ? (e.preventDefault(),
|
|
950
|
+
G.value && (e.key === "ArrowDown" ? (e.preventDefault(), se(1)) : e.key === "ArrowUp" && (e.preventDefault(), se(-1)));
|
|
826
951
|
}
|
|
827
952
|
b(() => {
|
|
828
|
-
document.addEventListener("mousedown",
|
|
953
|
+
document.addEventListener("mousedown", Q), document.addEventListener("keydown", ue), window.addEventListener("scroll", le, !0);
|
|
829
954
|
}), x(() => {
|
|
830
|
-
document.removeEventListener("mousedown",
|
|
955
|
+
document.removeEventListener("mousedown", Q), document.removeEventListener("keydown", ue), window.removeEventListener("scroll", le, !0), V ? V() : B?.();
|
|
831
956
|
});
|
|
832
957
|
let de = o(() => d.align === "right" ? "top right" : "top left");
|
|
833
958
|
return (n, o) => (S(), l(r, null, [u("div", h({
|
|
@@ -835,7 +960,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
835
960
|
ref: K
|
|
836
961
|
}, n.$attrs, {
|
|
837
962
|
class: "inline-block",
|
|
838
|
-
onClick:
|
|
963
|
+
onClick: ce
|
|
839
964
|
}), [E(n.$slots, "trigger", { open: G.value })], 16), (S(), s(i, { to: "body" }, [f(a, {
|
|
840
965
|
css: !1,
|
|
841
966
|
onEnter: U,
|
|
@@ -874,20 +999,20 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
874
999
|
size: 20,
|
|
875
1000
|
class: "shrink-0 text-on-surface-variant"
|
|
876
1001
|
}, null, 8, ["name"])) : c("", !0),
|
|
877
|
-
u("span",
|
|
878
|
-
]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div",
|
|
1002
|
+
u("span", De, [(S(), s(D(() => P.value?.header?.())))])
|
|
1003
|
+
]), (S(), s(D(() => P.value?.content?.())))])) : (S(), l("div", Oe, [A.value ? (S(), l("div", ke, [(S(!0), l(r, null, T(k.value, (e, t) => (S(), l("div", {
|
|
879
1004
|
key: t,
|
|
880
1005
|
class: "rounded-lg shadow-elevation-2"
|
|
881
|
-
}, [u("div",
|
|
1006
|
+
}, [u("div", Ae, [(S(), s(D(() => e)))])]))), 128))])) : E(n.$slots, "default", { close: Z }, void 0, void 0, 1)]))]),
|
|
882
1007
|
_: 3
|
|
883
1008
|
})], 4)], 2)], 6)) : c("", !0)]),
|
|
884
1009
|
_: 3
|
|
885
1010
|
})]))], 64));
|
|
886
1011
|
}
|
|
887
|
-
}),
|
|
1012
|
+
}), Ne = ["data-m3-menu-choice"], Pe = { class: "flex-1" }, Fe = {
|
|
888
1013
|
key: 2,
|
|
889
1014
|
class: "ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60"
|
|
890
|
-
},
|
|
1015
|
+
}, Ie = { class: "overflow-hidden rounded-xs bg-surface-container py-1" }, Le = 32, Re = /* @__PURE__ */ p({
|
|
891
1016
|
__name: "MMenuItem",
|
|
892
1017
|
props: {
|
|
893
1018
|
icon: {},
|
|
@@ -939,19 +1064,19 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
939
1064
|
t
|
|
940
1065
|
];
|
|
941
1066
|
}
|
|
942
|
-
let { snap: F } =
|
|
1067
|
+
let { snap: F } = Q(() => h.value ? [...P(), C.value && y.value ? Le : 0] : [], ([e, t, n, r, i]) => {
|
|
943
1068
|
let a = H.value instanceof HTMLElement ? H.value : H.value?.$el;
|
|
944
1069
|
a && r !== void 0 && (a.style.borderRadius = `${e}px ${t}px ${n}px ${r}px`), U.value && i !== void 0 && (U.value.style.width = `${i}px`);
|
|
945
|
-
},
|
|
1070
|
+
}, ae);
|
|
946
1071
|
ee(A, () => F());
|
|
947
1072
|
let te = null;
|
|
948
1073
|
b(() => {
|
|
949
1074
|
N();
|
|
950
1075
|
let e = V.value?.parentElement;
|
|
951
1076
|
e && (te = new MutationObserver(N), te.observe(e, { childList: !0 }));
|
|
952
|
-
}), x(() => te?.disconnect()), ee(h, () => g(N)),
|
|
1077
|
+
}), x(() => te?.disconnect()), ee(h, () => g(N)), Q(() => C.value ? [+!!y.value] : [], ([e]) => {
|
|
953
1078
|
U.value && e !== void 0 && (U.value.style.opacity = String(e));
|
|
954
|
-
},
|
|
1079
|
+
}, oe);
|
|
955
1080
|
let I = j(), L = o(() => r.to ? "RouterLink" : "button"), R = o(() => !!I.children), z = m("m-menu-close", null), B = m("m-menu-nav", null), V = w(), H = w(), U = w(), W = w(!1), ne = w({});
|
|
956
1081
|
function re() {
|
|
957
1082
|
if (!V.value) return;
|
|
@@ -986,10 +1111,10 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
986
1111
|
function q(e) {
|
|
987
1112
|
e.pointerType === "mouse" && R.value && !r.disabled && (re(), W.value = !0);
|
|
988
1113
|
}
|
|
989
|
-
function
|
|
1114
|
+
function J(e) {
|
|
990
1115
|
e.pointerType === "mouse" && (e.relatedTarget?.closest(".m3-submenu") || (W.value = !1));
|
|
991
1116
|
}
|
|
992
|
-
function
|
|
1117
|
+
function Y(e) {
|
|
993
1118
|
if (e.pointerType !== "mouse") return;
|
|
994
1119
|
let t = e.relatedTarget;
|
|
995
1120
|
t?.closest(".m3-submenu") || V.value?.contains(t) || (W.value = !1);
|
|
@@ -999,7 +1124,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
999
1124
|
ref: V,
|
|
1000
1125
|
"data-m3-menu-choice": h.value || void 0,
|
|
1001
1126
|
onPointerenter: q,
|
|
1002
|
-
onPointerleave:
|
|
1127
|
+
onPointerleave: J
|
|
1003
1128
|
}, [(S(), s(D(L.value), {
|
|
1004
1129
|
ref_key: "controlEl",
|
|
1005
1130
|
ref: H,
|
|
@@ -1047,8 +1172,8 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1047
1172
|
"filled",
|
|
1048
1173
|
"class"
|
|
1049
1174
|
])) : c("", !0),
|
|
1050
|
-
u("span",
|
|
1051
|
-
e.shortcut && !R.value ? (S(), l("span",
|
|
1175
|
+
u("span", Pe, [E(n.$slots, "default")]),
|
|
1176
|
+
e.shortcut && !R.value ? (S(), l("span", Fe, O(e.shortcut), 1)) : c("", !0),
|
|
1052
1177
|
R.value ? (S(), s(t, {
|
|
1053
1178
|
key: 3,
|
|
1054
1179
|
name: "chevron_right",
|
|
@@ -1079,37 +1204,37 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1079
1204
|
key: 0,
|
|
1080
1205
|
class: "m3-submenu min-w-44 rounded-xs shadow-elevation-2",
|
|
1081
1206
|
style: v(ne.value),
|
|
1082
|
-
onPointerleave:
|
|
1083
|
-
}, [u("div",
|
|
1207
|
+
onPointerleave: Y
|
|
1208
|
+
}, [u("div", Ie, [E(n.$slots, "children")])], 36)) : c("", !0)]),
|
|
1084
1209
|
_: 3
|
|
1085
|
-
})])) : c("", !0)], 40,
|
|
1210
|
+
})])) : c("", !0)], 40, Ne));
|
|
1086
1211
|
}
|
|
1087
|
-
}),
|
|
1212
|
+
}), ze = { class: "flex flex-col gap-1" }, Be = [
|
|
1088
1213
|
"id",
|
|
1089
1214
|
"value",
|
|
1090
1215
|
"rows",
|
|
1091
1216
|
"disabled",
|
|
1092
1217
|
"required"
|
|
1093
|
-
],
|
|
1218
|
+
], Ve = [
|
|
1094
1219
|
"id",
|
|
1095
1220
|
"type",
|
|
1096
1221
|
"value",
|
|
1097
1222
|
"disabled",
|
|
1098
1223
|
"required",
|
|
1099
1224
|
"autocomplete"
|
|
1100
|
-
],
|
|
1225
|
+
], He = ["for"], Ue = {
|
|
1101
1226
|
key: 0,
|
|
1102
1227
|
class: "text-error"
|
|
1103
|
-
},
|
|
1228
|
+
}, We = {
|
|
1104
1229
|
key: 3,
|
|
1105
1230
|
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
1106
|
-
},
|
|
1231
|
+
}, Ge = {
|
|
1107
1232
|
key: 0,
|
|
1108
1233
|
class: "px-4 text-body-small text-error"
|
|
1109
|
-
},
|
|
1234
|
+
}, Ke = {
|
|
1110
1235
|
key: 1,
|
|
1111
1236
|
class: "px-4 text-body-small text-on-surface-variant"
|
|
1112
|
-
},
|
|
1237
|
+
}, qe = /* @__PURE__ */ p({
|
|
1113
1238
|
__name: "MTextField",
|
|
1114
1239
|
props: {
|
|
1115
1240
|
modelValue: {},
|
|
@@ -1181,7 +1306,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1181
1306
|
let t = e.target;
|
|
1182
1307
|
i("update:modelValue", t.value), r.debounce > 0 && h(t.value);
|
|
1183
1308
|
}
|
|
1184
|
-
return (n, r) => (S(), l("div",
|
|
1309
|
+
return (n, r) => (S(), l("div", ze, [u("div", {
|
|
1185
1310
|
ref_key: "fieldBgEl",
|
|
1186
1311
|
ref: p,
|
|
1187
1312
|
class: _(["relative", e.variant === "outlined" ? "mt-2" : ""]),
|
|
@@ -1204,7 +1329,7 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1204
1329
|
placeholder: " ",
|
|
1205
1330
|
class: _(b.value),
|
|
1206
1331
|
onInput: C
|
|
1207
|
-
}, null, 42,
|
|
1332
|
+
}, null, 42, Be)) : (S(), l("input", {
|
|
1208
1333
|
key: 2,
|
|
1209
1334
|
id: k(a),
|
|
1210
1335
|
type: e.type,
|
|
@@ -1215,12 +1340,12 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1215
1340
|
placeholder: " ",
|
|
1216
1341
|
class: _(b.value),
|
|
1217
1342
|
onInput: C
|
|
1218
|
-
}, null, 42,
|
|
1343
|
+
}, null, 42, Ve)),
|
|
1219
1344
|
u("label", {
|
|
1220
1345
|
for: k(a),
|
|
1221
1346
|
class: _(x.value)
|
|
1222
|
-
}, [d(O(e.label), 1), e.required ? (S(), l("span",
|
|
1223
|
-
n.$slots.trailing ? (S(), l("div",
|
|
1347
|
+
}, [d(O(e.label), 1), e.required ? (S(), l("span", Ue, "\xA0*")) : c("", !0)], 10, He),
|
|
1348
|
+
n.$slots.trailing ? (S(), l("div", We, [E(n.$slots, "trailing")])) : y.value ? (S(), l("button", {
|
|
1224
1349
|
key: 4,
|
|
1225
1350
|
type: "button",
|
|
1226
1351
|
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",
|
|
@@ -1231,10 +1356,10 @@ var oe = "relative inline-flex shrink-0 items-center justify-center overflow-hid
|
|
|
1231
1356
|
name: "close",
|
|
1232
1357
|
size: 18
|
|
1233
1358
|
})])) : c("", !0)
|
|
1234
|
-
], 6), e.error && e.errorLabel ? (S(), l("p",
|
|
1359
|
+
], 6), e.error && e.errorLabel ? (S(), l("p", Ge, O(e.errorLabel), 1)) : e.hint ? (S(), l("p", Ke, O(e.hint), 1)) : c("", !0)]));
|
|
1235
1360
|
}
|
|
1236
1361
|
});
|
|
1237
1362
|
//#endregion
|
|
1238
|
-
export {
|
|
1363
|
+
export { J as _, we as a, W as b, se as c, ae as d, le as f, Y as g, X as h, Ee as i, ce as l, ie as m, Re as n, pe as o, Q as p, Me as r, de as s, qe as t, oe as u, q as v, L as x, K as y };
|
|
1239
1364
|
|
|
1240
|
-
//# sourceMappingURL=MTextField-
|
|
1365
|
+
//# sourceMappingURL=MTextField-TZ7lfr09.js.map
|