@clderystd/m3-ui 0.0.0-stage → 0.1.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 +92 -2
- package/dist/components/M3Avatar.vue.d.ts +20 -0
- package/dist/components/M3Button.vue.d.ts +57 -0
- package/dist/components/M3Card.vue.d.ts +37 -0
- package/dist/components/M3Chip.vue.d.ts +25 -0
- package/dist/components/M3Dialog.vue.d.ts +41 -0
- package/dist/components/M3Divider.vue.d.ts +10 -0
- package/dist/components/M3Fab.vue.d.ts +31 -0
- package/dist/components/M3Icon.vue.d.ts +30 -0
- package/dist/components/M3IconButton.vue.d.ts +33 -0
- package/dist/components/M3List.vue.d.ts +22 -0
- package/dist/components/M3ListItem.vue.d.ts +52 -0
- package/dist/components/M3Menu.vue.d.ts +61 -0
- package/dist/components/M3MenuItem.vue.d.ts +39 -0
- package/dist/components/M3SegmentedButton.vue.d.ts +23 -0
- package/dist/components/M3Sheet.vue.d.ts +44 -0
- package/dist/components/M3Switch.vue.d.ts +30 -0
- package/dist/components/M3Tooltip.vue.d.ts +24 -0
- package/dist/components/M3TopAppBar.vue.d.ts +41 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/composables/useModal.d.ts +16 -0
- package/dist/directives/reveal.d.ts +15 -0
- package/dist/directives/ripple.d.ts +6 -0
- package/dist/icons/index.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1011 -0
- package/dist/m3-ui.css +2 -0
- package/dist/types.d.ts +11 -0
- package/package.json +45 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, h as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDirective as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, watch as E, withCtx as D, withDirectives as O, withKeys as k, withModifiers as A } from "vue";
|
|
2
|
+
// src/components/M3Avatar.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var ee = ["src", "alt"], j = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "md-avatar__initials",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, te = /*@__PURE__*/ u({
|
|
8
|
+
__name: "M3Avatar",
|
|
9
|
+
props: {
|
|
10
|
+
src: { default: void 0 },
|
|
11
|
+
name: { default: "" },
|
|
12
|
+
alt: { default: void 0 },
|
|
13
|
+
size: { default: 40 },
|
|
14
|
+
ring: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(e) {
|
|
20
|
+
let t = e, n = y(!1), i = y(!1), a = y(null), s = r(() => typeof t.size == "number" ? t.size + "px" : t.size), c = r(() => {
|
|
21
|
+
let e = (t.name ?? "").trim();
|
|
22
|
+
if (!e) return "?";
|
|
23
|
+
let n = e.split(/\s+/).filter(Boolean);
|
|
24
|
+
return n.length > 1 ? (n[0][0] + n[1][0]).toUpperCase() : e.slice(0, 2).toUpperCase();
|
|
25
|
+
}), l = r(() => !!t.src && !n.value);
|
|
26
|
+
return _(() => {
|
|
27
|
+
a.value?.complete && (i.value = !0);
|
|
28
|
+
}), (t, r) => (v(), o("span", {
|
|
29
|
+
class: m(["md-avatar", { "md-avatar--ring": e.ring }]),
|
|
30
|
+
style: h({
|
|
31
|
+
width: s.value,
|
|
32
|
+
height: s.value,
|
|
33
|
+
fontSize: "calc(" + s.value + " * 0.36)"
|
|
34
|
+
})
|
|
35
|
+
}, [l.value ? (v(), o("img", {
|
|
36
|
+
key: 0,
|
|
37
|
+
ref_key: "imageEl",
|
|
38
|
+
ref: a,
|
|
39
|
+
class: m(["md-avatar__img", { "is-loaded": i.value }]),
|
|
40
|
+
src: e.src,
|
|
41
|
+
alt: e.alt ?? e.name ?? "",
|
|
42
|
+
loading: "lazy",
|
|
43
|
+
decoding: "async",
|
|
44
|
+
onLoad: r[0] ||= (e) => i.value = !0,
|
|
45
|
+
onError: r[1] ||= (e) => n.value = !0
|
|
46
|
+
}, null, 42, ee)) : (v(), o("span", j, w(c.value), 1))], 6));
|
|
47
|
+
}
|
|
48
|
+
}), M = (e, t) => {
|
|
49
|
+
let n = e.__vccOpts || e;
|
|
50
|
+
for (let [e, r] of t) n[e] = r;
|
|
51
|
+
return n;
|
|
52
|
+
}, ne = /*#__PURE__*/ M(te, [["__scopeId", "data-v-11c06ce9"]]), N = [
|
|
53
|
+
"role",
|
|
54
|
+
"aria-label",
|
|
55
|
+
"aria-hidden"
|
|
56
|
+
], P = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
57
|
+
__name: "M3Icon",
|
|
58
|
+
props: {
|
|
59
|
+
icon: { default: null },
|
|
60
|
+
size: { default: 24 },
|
|
61
|
+
label: { default: void 0 }
|
|
62
|
+
},
|
|
63
|
+
setup(e) {
|
|
64
|
+
let t = e, n = r(() => typeof t.size == "number" ? t.size + "px" : t.size);
|
|
65
|
+
return (t, r) => (v(), o("span", {
|
|
66
|
+
class: "md-icon",
|
|
67
|
+
style: h({ fontSize: n.value }),
|
|
68
|
+
role: e.label ? "img" : void 0,
|
|
69
|
+
"aria-label": e.label,
|
|
70
|
+
"aria-hidden": e.label ? void 0 : "true"
|
|
71
|
+
}, [e.icon ? (v(), i(C(e.icon), {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "md-icon__svg"
|
|
74
|
+
})) : x(t.$slots, "default", {}, void 0, !0, 1)], 12, N));
|
|
75
|
+
}
|
|
76
|
+
}), [["__scopeId", "data-v-d4d0e18f"]]), re = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "md-btn__spinner",
|
|
79
|
+
"aria-hidden": "true"
|
|
80
|
+
}, ie = { class: "md-btn__label" }, ae = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
81
|
+
__name: "M3Button",
|
|
82
|
+
props: {
|
|
83
|
+
variant: { default: "filled" },
|
|
84
|
+
size: { default: "md" },
|
|
85
|
+
icon: { default: null },
|
|
86
|
+
trailingIcon: { default: null },
|
|
87
|
+
disabled: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !1
|
|
90
|
+
},
|
|
91
|
+
loading: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: !1
|
|
94
|
+
},
|
|
95
|
+
href: { default: void 0 },
|
|
96
|
+
target: { default: void 0 },
|
|
97
|
+
rel: { default: void 0 },
|
|
98
|
+
type: { default: "button" },
|
|
99
|
+
block: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
setup(e) {
|
|
105
|
+
let t = e, n = r(() => t.href ? "a" : "button"), c = r(() => t.size === "lg" ? 24 : 18), l = r(() => !!t.href), u = r(() => t.disabled || t.loading);
|
|
106
|
+
return (t, r) => {
|
|
107
|
+
let d = S("ripple");
|
|
108
|
+
return O((v(), i(C(n.value), {
|
|
109
|
+
class: m(["md-btn", [
|
|
110
|
+
"md-btn--" + e.variant,
|
|
111
|
+
"md-btn--" + e.size,
|
|
112
|
+
{
|
|
113
|
+
"md-btn--block": e.block,
|
|
114
|
+
"is-disabled": u.value,
|
|
115
|
+
"is-loading": e.loading
|
|
116
|
+
}
|
|
117
|
+
]]),
|
|
118
|
+
href: e.href,
|
|
119
|
+
target: l.value ? e.target : void 0,
|
|
120
|
+
rel: l.value ? e.rel : void 0,
|
|
121
|
+
type: l.value ? void 0 : e.type,
|
|
122
|
+
disabled: !l.value && u.value ? !0 : void 0,
|
|
123
|
+
"aria-disabled": u.value ? "true" : void 0,
|
|
124
|
+
"aria-busy": e.loading ? "true" : void 0,
|
|
125
|
+
tabindex: u.value && l.value ? -1 : void 0
|
|
126
|
+
}, {
|
|
127
|
+
default: D(() => [
|
|
128
|
+
e.loading ? (v(), o("span", re)) : e.icon ? (v(), i(P, {
|
|
129
|
+
key: 1,
|
|
130
|
+
icon: e.icon,
|
|
131
|
+
size: c.value,
|
|
132
|
+
class: "md-btn__icon"
|
|
133
|
+
}, null, 8, ["icon", "size"])) : a("", !0),
|
|
134
|
+
s("span", ie, [x(t.$slots, "default", {}, void 0, !0)]),
|
|
135
|
+
e.trailingIcon && !e.loading ? (v(), i(P, {
|
|
136
|
+
key: 2,
|
|
137
|
+
icon: e.trailingIcon,
|
|
138
|
+
size: c.value,
|
|
139
|
+
class: "md-btn__icon"
|
|
140
|
+
}, null, 8, ["icon", "size"])) : a("", !0)
|
|
141
|
+
]),
|
|
142
|
+
_: 3
|
|
143
|
+
}, 8, [
|
|
144
|
+
"class",
|
|
145
|
+
"href",
|
|
146
|
+
"target",
|
|
147
|
+
"rel",
|
|
148
|
+
"type",
|
|
149
|
+
"disabled",
|
|
150
|
+
"aria-disabled",
|
|
151
|
+
"aria-busy",
|
|
152
|
+
"tabindex"
|
|
153
|
+
])), [[d]]);
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}), [["__scopeId", "data-v-99ea0895"]]), oe = {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: "md-card__media"
|
|
159
|
+
}, se = { class: "md-card__content" }, ce = {
|
|
160
|
+
key: 1,
|
|
161
|
+
class: "md-card__actions"
|
|
162
|
+
}, le = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
163
|
+
__name: "M3Card",
|
|
164
|
+
props: {
|
|
165
|
+
variant: { default: "elevated" },
|
|
166
|
+
interactive: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: !1
|
|
169
|
+
},
|
|
170
|
+
shape: { default: "medium" },
|
|
171
|
+
href: { default: void 0 },
|
|
172
|
+
target: { default: void 0 },
|
|
173
|
+
rel: { default: void 0 }
|
|
174
|
+
},
|
|
175
|
+
setup(e) {
|
|
176
|
+
return (t, n) => (v(), i(C(e.href ? "a" : "div"), {
|
|
177
|
+
class: m(["md-card", [
|
|
178
|
+
"md-card--" + e.variant,
|
|
179
|
+
"md-card--shape-" + e.shape,
|
|
180
|
+
{ "md-card--interactive": e.interactive }
|
|
181
|
+
]]),
|
|
182
|
+
href: e.href,
|
|
183
|
+
target: e.href ? e.target : void 0,
|
|
184
|
+
rel: e.href ? e.rel : void 0
|
|
185
|
+
}, {
|
|
186
|
+
default: D(() => [
|
|
187
|
+
t.$slots.media ? (v(), o("div", oe, [x(t.$slots, "media", {}, void 0, !0)])) : a("", !0),
|
|
188
|
+
s("div", se, [x(t.$slots, "default", {}, void 0, !0)]),
|
|
189
|
+
t.$slots.actions ? (v(), o("div", ce, [x(t.$slots, "actions", {}, void 0, !0)])) : a("", !0)
|
|
190
|
+
]),
|
|
191
|
+
_: 3
|
|
192
|
+
}, 8, [
|
|
193
|
+
"class",
|
|
194
|
+
"href",
|
|
195
|
+
"target",
|
|
196
|
+
"rel"
|
|
197
|
+
]));
|
|
198
|
+
}
|
|
199
|
+
}), [["__scopeId", "data-v-330a5bd2"]]);
|
|
200
|
+
// src/icons/index.ts
|
|
201
|
+
function F(e, t) {
|
|
202
|
+
let n = () => d("svg", {
|
|
203
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
204
|
+
viewBox: "0 0 24 24",
|
|
205
|
+
"aria-hidden": "true"
|
|
206
|
+
}, [d("path", {
|
|
207
|
+
fill: "currentColor",
|
|
208
|
+
d: e
|
|
209
|
+
})]);
|
|
210
|
+
return n.displayName = t, n;
|
|
211
|
+
}
|
|
212
|
+
var I = F("m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z", "IconCheck"), L = F("M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z", "IconClose"), ue = F("m12 15.375l-6-6l1.4-1.4l4.6 4.6l4.6-4.6l1.4 1.4z", "IconExpandMore"), de = ["disabled", "aria-pressed"], fe = { class: "md-chip__label" }, R = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
213
|
+
__name: "M3Chip",
|
|
214
|
+
props: {
|
|
215
|
+
label: {},
|
|
216
|
+
variant: { default: "assist" },
|
|
217
|
+
selected: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
default: !1
|
|
220
|
+
},
|
|
221
|
+
icon: { default: null },
|
|
222
|
+
disabled: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
default: !1
|
|
225
|
+
},
|
|
226
|
+
toggle: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: !1
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
emits: ["remove"],
|
|
232
|
+
setup(e, { emit: t }) {
|
|
233
|
+
let n = e, r = t, c = n.variant === "filter" || n.toggle;
|
|
234
|
+
return (t, n) => {
|
|
235
|
+
let u = S("ripple");
|
|
236
|
+
return O((v(), o("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
class: m(["md-chip", ["md-chip--" + e.variant, {
|
|
239
|
+
"is-selected": e.selected,
|
|
240
|
+
"is-disabled": e.disabled
|
|
241
|
+
}]]),
|
|
242
|
+
disabled: e.disabled,
|
|
243
|
+
"aria-pressed": T(c) ? e.selected : void 0
|
|
244
|
+
}, [
|
|
245
|
+
e.selected && T(c) ? (v(), i(P, {
|
|
246
|
+
key: 0,
|
|
247
|
+
icon: T(I),
|
|
248
|
+
size: 18,
|
|
249
|
+
class: "md-chip__icon md-chip__icon--check"
|
|
250
|
+
}, null, 8, ["icon"])) : e.icon ? (v(), i(P, {
|
|
251
|
+
key: 1,
|
|
252
|
+
icon: e.icon,
|
|
253
|
+
size: 18,
|
|
254
|
+
class: "md-chip__icon"
|
|
255
|
+
}, null, 8, ["icon"])) : a("", !0),
|
|
256
|
+
s("span", fe, w(e.label), 1),
|
|
257
|
+
e.variant === "input" ? (v(), o("span", {
|
|
258
|
+
key: 2,
|
|
259
|
+
class: "md-chip__trailing",
|
|
260
|
+
role: "button",
|
|
261
|
+
tabindex: "0",
|
|
262
|
+
"aria-label": "移除",
|
|
263
|
+
onClick: n[0] ||= A((e) => r("remove"), ["stop"]),
|
|
264
|
+
onKeydown: [n[1] ||= k(A((e) => r("remove"), ["stop", "prevent"]), ["enter"]), n[2] ||= k(A((e) => r("remove"), ["stop", "prevent"]), ["space"])]
|
|
265
|
+
}, [l(P, {
|
|
266
|
+
icon: T(L),
|
|
267
|
+
size: 18
|
|
268
|
+
}, null, 8, ["icon"])], 32)) : a("", !0)
|
|
269
|
+
], 10, de)), [[u]]);
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}), [["__scopeId", "data-v-d96f2b0a"]]), z = "a[href],button:not([disabled]),input:not([disabled]):not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])", B = 0, V = "";
|
|
273
|
+
function pe() {
|
|
274
|
+
B === 0 && (V = document.body.style.overflow, document.body.style.overflow = "hidden"), B += 1;
|
|
275
|
+
}
|
|
276
|
+
function H() {
|
|
277
|
+
B = Math.max(0, B - 1), B === 0 && (document.body.style.overflow = V);
|
|
278
|
+
}
|
|
279
|
+
function U(e, t, n) {
|
|
280
|
+
let r = null;
|
|
281
|
+
function i() {
|
|
282
|
+
let e = t.value;
|
|
283
|
+
return e ? Array.from(e.querySelectorAll(z)).filter((e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e === document.activeElement) : [];
|
|
284
|
+
}
|
|
285
|
+
function a() {
|
|
286
|
+
(i()[0] ?? t.value)?.focus({ preventScroll: !0 });
|
|
287
|
+
}
|
|
288
|
+
function o(e) {
|
|
289
|
+
if (e.key === "Escape") {
|
|
290
|
+
e.stopPropagation(), n.onClose();
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
if (e.key !== "Tab") return;
|
|
294
|
+
let r = i();
|
|
295
|
+
if (r.length === 0) {
|
|
296
|
+
e.preventDefault(), t.value?.focus({ preventScroll: !0 });
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
let a = r[0], o = r[r.length - 1], s = document.activeElement, c = s !== null && t.value?.contains(s) === !0;
|
|
300
|
+
e.shiftKey && (!c || s === a) ? (e.preventDefault(), o.focus()) : !e.shiftKey && c && s === o && (e.preventDefault(), a.focus());
|
|
301
|
+
}
|
|
302
|
+
return E(e, (e) => {
|
|
303
|
+
e ? (r = document.activeElement ?? null, pe(), document.addEventListener("keydown", o, !0), requestAnimationFrame(() => requestAnimationFrame(a))) : (H(), document.removeEventListener("keydown", o, !0), n.restoreFocus !== !1 && r?.isConnected && r.focus({ preventScroll: !0 }), r = null);
|
|
304
|
+
}, { immediate: !0 }), g(() => {
|
|
305
|
+
e.value && (H(), document.removeEventListener("keydown", o, !0));
|
|
306
|
+
}), { focusFirst: a };
|
|
307
|
+
}
|
|
308
|
+
// src/components/M3Dialog.vue?vue&type=script&setup=true&lang.ts
|
|
309
|
+
var me = ["aria-label"], he = {
|
|
310
|
+
key: 0,
|
|
311
|
+
class: "md-dialog__icon"
|
|
312
|
+
}, ge = {
|
|
313
|
+
key: 1,
|
|
314
|
+
class: "md-dialog__headline md-typescale-headline-small"
|
|
315
|
+
}, _e = { class: "md-dialog__body md-typescale-body-medium" }, ve = {
|
|
316
|
+
key: 2,
|
|
317
|
+
class: "md-dialog__actions"
|
|
318
|
+
}, ye = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
319
|
+
__name: "M3Dialog",
|
|
320
|
+
props: {
|
|
321
|
+
modelValue: { type: Boolean },
|
|
322
|
+
title: { default: void 0 },
|
|
323
|
+
icon: { default: null },
|
|
324
|
+
dismissible: {
|
|
325
|
+
type: Boolean,
|
|
326
|
+
default: !0
|
|
327
|
+
},
|
|
328
|
+
ariaLabel: { default: void 0 }
|
|
329
|
+
},
|
|
330
|
+
emits: ["update:modelValue"],
|
|
331
|
+
setup(e, { emit: c }) {
|
|
332
|
+
let u = e, d = c, f = y(null);
|
|
333
|
+
return U(r(() => u.modelValue), f, { onClose: () => {
|
|
334
|
+
u.dismissible && d("update:modelValue", !1);
|
|
335
|
+
} }), (r, c) => (v(), i(t, { to: "body" }, [l(n, { name: "md-scrim" }, {
|
|
336
|
+
default: D(() => [e.modelValue ? (v(), o("div", {
|
|
337
|
+
key: 0,
|
|
338
|
+
class: "md-scrim",
|
|
339
|
+
onClick: c[0] ||= (t) => e.dismissible && d("update:modelValue", !1)
|
|
340
|
+
})) : a("", !0)]),
|
|
341
|
+
_: 1
|
|
342
|
+
}), l(n, { name: "md-dialog-pop" }, {
|
|
343
|
+
default: D(() => [e.modelValue ? (v(), o("div", {
|
|
344
|
+
key: 0,
|
|
345
|
+
ref_key: "panelRef",
|
|
346
|
+
ref: f,
|
|
347
|
+
class: "md-dialog",
|
|
348
|
+
role: "dialog",
|
|
349
|
+
"aria-modal": "true",
|
|
350
|
+
"aria-label": e.ariaLabel ?? e.title,
|
|
351
|
+
tabindex: "-1"
|
|
352
|
+
}, [
|
|
353
|
+
e.icon ? (v(), o("div", he, [l(P, {
|
|
354
|
+
icon: e.icon,
|
|
355
|
+
size: 24
|
|
356
|
+
}, null, 8, ["icon"])])) : a("", !0),
|
|
357
|
+
e.title ? (v(), o("h2", ge, w(e.title), 1)) : a("", !0),
|
|
358
|
+
s("div", _e, [x(r.$slots, "default", {}, void 0, !0)]),
|
|
359
|
+
r.$slots.actions ? (v(), o("div", ve, [x(r.$slots, "actions", {}, void 0, !0)])) : a("", !0)
|
|
360
|
+
], 8, me)) : a("", !0)]),
|
|
361
|
+
_: 3
|
|
362
|
+
})]));
|
|
363
|
+
}
|
|
364
|
+
}), [["__scopeId", "data-v-a4a34fd3"]]), be = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
365
|
+
__name: "M3Divider",
|
|
366
|
+
props: {
|
|
367
|
+
inset: { default: "none" },
|
|
368
|
+
vertical: {
|
|
369
|
+
type: Boolean,
|
|
370
|
+
default: !1
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
setup(e) {
|
|
374
|
+
return (t, n) => (v(), o("hr", { class: m(["md-hr", ["md-hr--" + e.inset, { "md-hr--vertical": e.vertical }]]) }, null, 2));
|
|
375
|
+
}
|
|
376
|
+
}), [["__scopeId", "data-v-cad24e3a"]]), xe = {
|
|
377
|
+
key: 0,
|
|
378
|
+
class: "md-fab__label"
|
|
379
|
+
}, Se = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
380
|
+
__name: "M3Fab",
|
|
381
|
+
props: {
|
|
382
|
+
icon: {},
|
|
383
|
+
size: { default: "md" },
|
|
384
|
+
variant: { default: "primary-container" },
|
|
385
|
+
label: { default: void 0 },
|
|
386
|
+
fixed: {
|
|
387
|
+
type: Boolean,
|
|
388
|
+
default: !1
|
|
389
|
+
},
|
|
390
|
+
colored: {
|
|
391
|
+
type: Boolean,
|
|
392
|
+
default: !0
|
|
393
|
+
},
|
|
394
|
+
href: { default: void 0 },
|
|
395
|
+
target: { default: void 0 },
|
|
396
|
+
rel: { default: void 0 },
|
|
397
|
+
type: { default: "button" },
|
|
398
|
+
ariaLabel: { default: void 0 }
|
|
399
|
+
},
|
|
400
|
+
setup(e) {
|
|
401
|
+
let t = e, n = r(() => t.href ? "a" : "button"), s = r(() => !!t.href), c = r(() => t.size === "lg" ? 36 : 24), u = r(() => typeof t.label == "string" && t.label.length > 0);
|
|
402
|
+
return (t, r) => {
|
|
403
|
+
let d = S("ripple");
|
|
404
|
+
return O((v(), i(C(n.value), {
|
|
405
|
+
class: m(["md-fab", [
|
|
406
|
+
"md-fab--" + e.size,
|
|
407
|
+
"md-fab--" + e.variant,
|
|
408
|
+
{
|
|
409
|
+
"md-fab--extended": u.value,
|
|
410
|
+
"md-fab--fixed": e.fixed,
|
|
411
|
+
"md-fab--flat": !e.colored
|
|
412
|
+
}
|
|
413
|
+
]]),
|
|
414
|
+
href: e.href,
|
|
415
|
+
target: s.value ? e.target : void 0,
|
|
416
|
+
rel: s.value ? e.rel : void 0,
|
|
417
|
+
type: s.value ? void 0 : e.type,
|
|
418
|
+
"aria-label": u.value ? void 0 : e.ariaLabel ?? "操作"
|
|
419
|
+
}, {
|
|
420
|
+
default: D(() => [l(P, {
|
|
421
|
+
icon: e.icon,
|
|
422
|
+
size: c.value,
|
|
423
|
+
class: "md-fab__icon"
|
|
424
|
+
}, null, 8, ["icon", "size"]), u.value ? (v(), o("span", xe, w(e.label), 1)) : a("", !0)]),
|
|
425
|
+
_: 1
|
|
426
|
+
}, 8, [
|
|
427
|
+
"class",
|
|
428
|
+
"href",
|
|
429
|
+
"target",
|
|
430
|
+
"rel",
|
|
431
|
+
"type",
|
|
432
|
+
"aria-label"
|
|
433
|
+
])), [[d]]);
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
}), [["__scopeId", "data-v-aeda7579"]]), W = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
437
|
+
__name: "M3IconButton",
|
|
438
|
+
props: {
|
|
439
|
+
icon: {},
|
|
440
|
+
selectedIcon: { default: null },
|
|
441
|
+
variant: { default: "standard" },
|
|
442
|
+
size: { default: "md" },
|
|
443
|
+
label: {},
|
|
444
|
+
selected: {
|
|
445
|
+
type: Boolean,
|
|
446
|
+
default: !1
|
|
447
|
+
},
|
|
448
|
+
disabled: {
|
|
449
|
+
type: Boolean,
|
|
450
|
+
default: !1
|
|
451
|
+
},
|
|
452
|
+
href: { default: void 0 },
|
|
453
|
+
target: { default: void 0 },
|
|
454
|
+
rel: { default: void 0 },
|
|
455
|
+
type: { default: "button" },
|
|
456
|
+
shape: { default: "full" }
|
|
457
|
+
},
|
|
458
|
+
setup(e) {
|
|
459
|
+
let t = e, n = r(() => t.href ? "a" : "button"), a = r(() => !!t.href), o = r(() => t.selected && t.selectedIcon ? t.selectedIcon : t.icon), s = r(() => t.size === "lg" ? 24 : t.size === "sm" ? 18 : 24), c = r(() => t.selected && t.variant === "standard" ? "tonal" : t.variant);
|
|
460
|
+
return (t, r) => {
|
|
461
|
+
let u = S("ripple");
|
|
462
|
+
return O((v(), i(C(n.value), {
|
|
463
|
+
class: m(["md-icon-btn", [
|
|
464
|
+
"md-icon-btn--" + c.value,
|
|
465
|
+
"md-icon-btn--" + e.size,
|
|
466
|
+
"md-icon-btn--shape-" + e.shape,
|
|
467
|
+
{
|
|
468
|
+
"is-selected": e.selected,
|
|
469
|
+
"is-disabled": e.disabled
|
|
470
|
+
}
|
|
471
|
+
]]),
|
|
472
|
+
href: e.href,
|
|
473
|
+
target: a.value ? e.target : void 0,
|
|
474
|
+
rel: a.value ? e.rel : void 0,
|
|
475
|
+
type: a.value ? void 0 : e.type,
|
|
476
|
+
disabled: !a.value && e.disabled ? !0 : void 0,
|
|
477
|
+
"aria-label": e.label,
|
|
478
|
+
"aria-pressed": e.selectedIcon ? e.selected : void 0,
|
|
479
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
480
|
+
tabindex: e.disabled && a.value ? -1 : void 0,
|
|
481
|
+
title: e.label
|
|
482
|
+
}, {
|
|
483
|
+
default: D(() => [l(P, {
|
|
484
|
+
icon: o.value,
|
|
485
|
+
size: s.value
|
|
486
|
+
}, null, 8, ["icon", "size"])]),
|
|
487
|
+
_: 1
|
|
488
|
+
}, 8, [
|
|
489
|
+
"class",
|
|
490
|
+
"href",
|
|
491
|
+
"target",
|
|
492
|
+
"rel",
|
|
493
|
+
"type",
|
|
494
|
+
"disabled",
|
|
495
|
+
"aria-label",
|
|
496
|
+
"aria-pressed",
|
|
497
|
+
"aria-disabled",
|
|
498
|
+
"tabindex",
|
|
499
|
+
"title"
|
|
500
|
+
])), [[u]]);
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}), [["__scopeId", "data-v-04092efa"]]), Ce = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
504
|
+
__name: "M3List",
|
|
505
|
+
props: { dense: {
|
|
506
|
+
type: Boolean,
|
|
507
|
+
default: !1
|
|
508
|
+
} },
|
|
509
|
+
setup(e) {
|
|
510
|
+
return (t, n) => (v(), o("ul", {
|
|
511
|
+
class: m(["md-list", { "md-list--dense": e.dense }]),
|
|
512
|
+
role: "list"
|
|
513
|
+
}, [x(t.$slots, "default", {}, void 0, !0)], 2));
|
|
514
|
+
}
|
|
515
|
+
}), [["__scopeId", "data-v-8bd5e4fe"]]), we = { class: "md-list-item__wrap" }, Te = {
|
|
516
|
+
key: 0,
|
|
517
|
+
class: "md-list-item__leading"
|
|
518
|
+
}, Ee = { class: "md-list-item__text" }, De = { class: "md-list-item__headline md-typescale-body-large" }, Oe = {
|
|
519
|
+
key: 0,
|
|
520
|
+
class: "md-list-item__supporting md-typescale-body-medium"
|
|
521
|
+
}, ke = {
|
|
522
|
+
key: 1,
|
|
523
|
+
class: "md-list-item__trailing"
|
|
524
|
+
}, Ae = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
525
|
+
inheritAttrs: !1,
|
|
526
|
+
__name: "M3ListItem",
|
|
527
|
+
props: {
|
|
528
|
+
headline: { default: void 0 },
|
|
529
|
+
supporting: { default: void 0 },
|
|
530
|
+
leadingIcon: { default: null },
|
|
531
|
+
href: { default: void 0 },
|
|
532
|
+
target: { default: void 0 },
|
|
533
|
+
rel: { default: void 0 },
|
|
534
|
+
clickable: {
|
|
535
|
+
type: Boolean,
|
|
536
|
+
default: !1
|
|
537
|
+
},
|
|
538
|
+
selected: {
|
|
539
|
+
type: Boolean,
|
|
540
|
+
default: !1
|
|
541
|
+
},
|
|
542
|
+
disabled: {
|
|
543
|
+
type: Boolean,
|
|
544
|
+
default: !1
|
|
545
|
+
},
|
|
546
|
+
lines: { default: void 0 },
|
|
547
|
+
padded: {
|
|
548
|
+
type: Boolean,
|
|
549
|
+
default: !1
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
setup(e) {
|
|
553
|
+
let t = e, n = r(() => t.href ? "a" : t.clickable ? "button" : "div"), l = r(() => !!t.href);
|
|
554
|
+
return (t, r) => {
|
|
555
|
+
let u = S("ripple");
|
|
556
|
+
return v(), o("li", we, [O((v(), i(C(n.value), f(t.$attrs, {
|
|
557
|
+
class: ["md-list-item", ["md-list-item--lines-" + (e.lines ?? (e.supporting ? 2 : 1)), {
|
|
558
|
+
"is-selected": e.selected,
|
|
559
|
+
"is-disabled": e.disabled,
|
|
560
|
+
"md-list-item--padded": e.padded
|
|
561
|
+
}]],
|
|
562
|
+
href: e.href,
|
|
563
|
+
target: l.value ? e.target : void 0,
|
|
564
|
+
rel: l.value ? e.rel : void 0,
|
|
565
|
+
type: !l.value && e.clickable ? "button" : void 0,
|
|
566
|
+
disabled: !l.value && e.clickable && e.disabled ? !0 : void 0,
|
|
567
|
+
"aria-current": e.selected ? "true" : void 0,
|
|
568
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
569
|
+
tabindex: e.disabled && l.value ? -1 : void 0
|
|
570
|
+
}), {
|
|
571
|
+
default: D(() => [
|
|
572
|
+
e.leadingIcon || t.$slots.leading ? (v(), o("span", Te, [x(t.$slots, "leading", {}, () => [e.leadingIcon ? (v(), i(P, {
|
|
573
|
+
key: 0,
|
|
574
|
+
icon: e.leadingIcon,
|
|
575
|
+
size: 24
|
|
576
|
+
}, null, 8, ["icon"])) : a("", !0)], !0)])) : a("", !0),
|
|
577
|
+
s("span", Ee, [s("span", De, [x(t.$slots, "default", {}, () => [c(w(e.headline), 1)], !0)]), e.supporting || t.$slots.supporting ? (v(), o("span", Oe, [x(t.$slots, "supporting", {}, () => [c(w(e.supporting), 1)], !0)])) : a("", !0)]),
|
|
578
|
+
t.$slots.trailing ? (v(), o("span", ke, [x(t.$slots, "trailing", {}, void 0, !0)])) : a("", !0)
|
|
579
|
+
]),
|
|
580
|
+
_: 3
|
|
581
|
+
}, 16, [
|
|
582
|
+
"class",
|
|
583
|
+
"href",
|
|
584
|
+
"target",
|
|
585
|
+
"rel",
|
|
586
|
+
"type",
|
|
587
|
+
"disabled",
|
|
588
|
+
"aria-current",
|
|
589
|
+
"aria-disabled",
|
|
590
|
+
"tabindex"
|
|
591
|
+
])), [[u]])]);
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
}), [["__scopeId", "data-v-aa124957"]]), je = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
595
|
+
__name: "M3Menu",
|
|
596
|
+
props: {
|
|
597
|
+
placement: { default: "bottom-start" },
|
|
598
|
+
gap: { default: 4 },
|
|
599
|
+
minWidth: { default: 112 },
|
|
600
|
+
maxWidth: { default: 720 },
|
|
601
|
+
matchTriggerWidth: {
|
|
602
|
+
type: Boolean,
|
|
603
|
+
default: !1
|
|
604
|
+
},
|
|
605
|
+
padded: {
|
|
606
|
+
type: Boolean,
|
|
607
|
+
default: !0
|
|
608
|
+
},
|
|
609
|
+
closeOnSelect: {
|
|
610
|
+
type: Boolean,
|
|
611
|
+
default: !0
|
|
612
|
+
},
|
|
613
|
+
closeOnScroll: {
|
|
614
|
+
type: Boolean,
|
|
615
|
+
default: !1
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
setup(r, { expose: c }) {
|
|
619
|
+
let u = r, d = y(!1), f = y(null), _ = y(null), b = y({
|
|
620
|
+
top: "0px",
|
|
621
|
+
left: "0px",
|
|
622
|
+
minWidth: "112px"
|
|
623
|
+
});
|
|
624
|
+
function S() {
|
|
625
|
+
let e = f.value;
|
|
626
|
+
if (!e) return;
|
|
627
|
+
let t = e.getBoundingClientRect(), n = _.value, r = n ? n.offsetWidth : u.minWidth, i = n ? n.offsetHeight : 0, a = t.left;
|
|
628
|
+
u.placement === "bottom-end" ? a = t.right - r : u.placement === "bottom" && (a = t.left + t.width / 2 - r / 2), a = Math.min(Math.max(a, 8), Math.max(8, window.innerWidth - r - 8));
|
|
629
|
+
let o = t.bottom + u.gap, s = i > 0 && o + i > window.innerHeight - 8, c = t.top - u.gap - i > 8;
|
|
630
|
+
s && c && (o = t.top - u.gap - i), b.value = {
|
|
631
|
+
top: o + "px",
|
|
632
|
+
left: a + "px",
|
|
633
|
+
minWidth: (u.matchTriggerWidth ? t.width : u.minWidth) + "px"
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function C() {
|
|
637
|
+
d.value = !1;
|
|
638
|
+
}
|
|
639
|
+
function w() {
|
|
640
|
+
d.value = !d.value;
|
|
641
|
+
}
|
|
642
|
+
function T(e) {
|
|
643
|
+
let t = e.target;
|
|
644
|
+
t && (_.value?.contains(t) || f.value?.contains(t) || C());
|
|
645
|
+
}
|
|
646
|
+
function O(e) {
|
|
647
|
+
e.key === "Escape" && d.value && (C(), (f.value?.querySelector("button, a"))?.focus());
|
|
648
|
+
}
|
|
649
|
+
function k() {
|
|
650
|
+
u.closeOnScroll ? C() : S();
|
|
651
|
+
}
|
|
652
|
+
function A(e) {
|
|
653
|
+
u.closeOnSelect && e.target?.closest("a, button, [role=\"menuitem\"]") && C();
|
|
654
|
+
}
|
|
655
|
+
return E(d, async (e) => {
|
|
656
|
+
e ? (await p(), S(), window.addEventListener("resize", S), window.addEventListener("scroll", k, !0), document.addEventListener("pointerdown", T, !0), document.addEventListener("keydown", O)) : (window.removeEventListener("resize", S), window.removeEventListener("scroll", k, !0), document.removeEventListener("pointerdown", T, !0), document.removeEventListener("keydown", O));
|
|
657
|
+
}), g(() => {
|
|
658
|
+
window.removeEventListener("resize", S), window.removeEventListener("scroll", k, !0), document.removeEventListener("pointerdown", T, !0), document.removeEventListener("keydown", O);
|
|
659
|
+
}), c({
|
|
660
|
+
open: d,
|
|
661
|
+
close: C,
|
|
662
|
+
toggle: w
|
|
663
|
+
}), (c, u) => (v(), o(e, null, [s("span", {
|
|
664
|
+
ref_key: "anchorRef",
|
|
665
|
+
ref: f,
|
|
666
|
+
class: "md-menu-anchor",
|
|
667
|
+
onClick: w
|
|
668
|
+
}, [x(c.$slots, "trigger", {
|
|
669
|
+
open: d.value,
|
|
670
|
+
toggle: w,
|
|
671
|
+
close: C
|
|
672
|
+
}, void 0, !0)], 512), (v(), i(t, { to: "body" }, [l(n, { name: "md-menu-pop" }, {
|
|
673
|
+
default: D(() => [d.value ? (v(), o("div", {
|
|
674
|
+
key: 0,
|
|
675
|
+
ref_key: "panelRef",
|
|
676
|
+
ref: _,
|
|
677
|
+
class: m(["md-menu", { "md-menu--padded": r.padded }]),
|
|
678
|
+
role: "menu",
|
|
679
|
+
style: h({
|
|
680
|
+
...b.value,
|
|
681
|
+
maxWidth: "min(calc(100vw - 16px), " + r.maxWidth + "px)"
|
|
682
|
+
}),
|
|
683
|
+
onClick: A
|
|
684
|
+
}, [x(c.$slots, "default", { close: C }, void 0, !0)], 6)) : a("", !0)]),
|
|
685
|
+
_: 3
|
|
686
|
+
})]))], 64));
|
|
687
|
+
}
|
|
688
|
+
}), [["__scopeId", "data-v-6d1a0bfc"]]), Me = { class: "md-menu-item__text" }, Ne = { class: "md-menu-item__label md-typescale-label-large" }, Pe = {
|
|
689
|
+
key: 0,
|
|
690
|
+
class: "md-menu-item__supporting md-typescale-body-medium"
|
|
691
|
+
}, Fe = {
|
|
692
|
+
key: 1,
|
|
693
|
+
class: "md-menu-item__trailing md-typescale-label-large"
|
|
694
|
+
}, Ie = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
695
|
+
__name: "M3MenuItem",
|
|
696
|
+
props: {
|
|
697
|
+
label: { default: void 0 },
|
|
698
|
+
supporting: { default: void 0 },
|
|
699
|
+
icon: { default: null },
|
|
700
|
+
trailingText: { default: void 0 },
|
|
701
|
+
href: { default: void 0 },
|
|
702
|
+
target: { default: void 0 },
|
|
703
|
+
rel: { default: void 0 },
|
|
704
|
+
disabled: {
|
|
705
|
+
type: Boolean,
|
|
706
|
+
default: !1
|
|
707
|
+
},
|
|
708
|
+
selected: {
|
|
709
|
+
type: Boolean,
|
|
710
|
+
default: !1
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
setup(e) {
|
|
714
|
+
let t = e, n = r(() => t.href ? "a" : "button"), l = r(() => !!t.href);
|
|
715
|
+
return (t, r) => {
|
|
716
|
+
let u = S("ripple");
|
|
717
|
+
return O((v(), i(C(n.value), {
|
|
718
|
+
class: m(["md-menu-item", {
|
|
719
|
+
"is-disabled": e.disabled,
|
|
720
|
+
"md-menu-item--two-line": e.supporting
|
|
721
|
+
}]),
|
|
722
|
+
href: e.href,
|
|
723
|
+
target: l.value ? e.target : void 0,
|
|
724
|
+
rel: l.value ? e.rel : void 0,
|
|
725
|
+
type: l.value ? void 0 : "button",
|
|
726
|
+
disabled: !l.value && e.disabled ? !0 : void 0,
|
|
727
|
+
role: "menuitem",
|
|
728
|
+
tabindex: e.disabled ? -1 : 0,
|
|
729
|
+
"aria-checked": e.selected ? "true" : void 0
|
|
730
|
+
}, {
|
|
731
|
+
default: D(() => [
|
|
732
|
+
e.icon ? (v(), i(P, {
|
|
733
|
+
key: 0,
|
|
734
|
+
icon: e.icon,
|
|
735
|
+
size: 24,
|
|
736
|
+
class: "md-menu-item__icon"
|
|
737
|
+
}, null, 8, ["icon"])) : a("", !0),
|
|
738
|
+
s("span", Me, [s("span", Ne, [x(t.$slots, "default", {}, () => [c(w(e.label), 1)], !0)]), e.supporting ? (v(), o("span", Pe, w(e.supporting), 1)) : a("", !0)]),
|
|
739
|
+
e.trailingText ? (v(), o("span", Fe, w(e.trailingText), 1)) : a("", !0)
|
|
740
|
+
]),
|
|
741
|
+
_: 3
|
|
742
|
+
}, 8, [
|
|
743
|
+
"class",
|
|
744
|
+
"href",
|
|
745
|
+
"target",
|
|
746
|
+
"rel",
|
|
747
|
+
"type",
|
|
748
|
+
"disabled",
|
|
749
|
+
"tabindex",
|
|
750
|
+
"aria-checked"
|
|
751
|
+
])), [[u]]);
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
}), [["__scopeId", "data-v-ac2d7164"]]), Le = ["aria-label"], Re = ["aria-checked", "onClick"], ze = { class: "md-segmented__label" }, Be = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
755
|
+
__name: "M3SegmentedButton",
|
|
756
|
+
props: {
|
|
757
|
+
options: {},
|
|
758
|
+
modelValue: {},
|
|
759
|
+
block: {
|
|
760
|
+
type: Boolean,
|
|
761
|
+
default: !1
|
|
762
|
+
},
|
|
763
|
+
ariaLabel: { default: void 0 }
|
|
764
|
+
},
|
|
765
|
+
emits: ["update:modelValue"],
|
|
766
|
+
setup(t, { emit: n }) {
|
|
767
|
+
let r = n;
|
|
768
|
+
return (n, c) => {
|
|
769
|
+
let l = S("ripple");
|
|
770
|
+
return v(), o("div", {
|
|
771
|
+
class: m(["md-segmented", { "md-segmented--block": t.block }]),
|
|
772
|
+
role: "radiogroup",
|
|
773
|
+
"aria-label": t.ariaLabel
|
|
774
|
+
}, [(v(!0), o(e, null, b(t.options, (e) => O((v(), o("button", {
|
|
775
|
+
key: e.value,
|
|
776
|
+
type: "button",
|
|
777
|
+
role: "radio",
|
|
778
|
+
class: m(["md-segmented__item", { "is-selected": e.value === t.modelValue }]),
|
|
779
|
+
"aria-checked": e.value === t.modelValue,
|
|
780
|
+
onClick: (t) => r("update:modelValue", e.value)
|
|
781
|
+
}, [e.value === t.modelValue ? (v(), i(P, {
|
|
782
|
+
key: 0,
|
|
783
|
+
icon: T(I),
|
|
784
|
+
size: 18,
|
|
785
|
+
class: "md-segmented__check"
|
|
786
|
+
}, null, 8, ["icon"])) : e.icon ? (v(), i(P, {
|
|
787
|
+
key: 1,
|
|
788
|
+
icon: e.icon,
|
|
789
|
+
size: 18,
|
|
790
|
+
class: "md-segmented__check"
|
|
791
|
+
}, null, 8, ["icon"])) : a("", !0), s("span", ze, w(e.label), 1)], 10, Re)), [[l]])), 128))], 10, Le);
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
}), [["__scopeId", "data-v-aefd896c"]]), Ve = ["aria-label"], He = {
|
|
795
|
+
key: 0,
|
|
796
|
+
class: "md-sheet__header"
|
|
797
|
+
}, Ue = {
|
|
798
|
+
key: 0,
|
|
799
|
+
class: "md-sheet__title md-typescale-title-large"
|
|
800
|
+
}, We = {
|
|
801
|
+
key: 1,
|
|
802
|
+
class: "md-sheet__title"
|
|
803
|
+
}, Ge = { class: "md-sheet__body" }, Ke = {
|
|
804
|
+
key: 1,
|
|
805
|
+
class: "md-sheet__footer"
|
|
806
|
+
}, qe = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
807
|
+
__name: "M3Sheet",
|
|
808
|
+
props: {
|
|
809
|
+
modelValue: { type: Boolean },
|
|
810
|
+
side: { default: "start" },
|
|
811
|
+
size: { default: "360px" },
|
|
812
|
+
title: { default: void 0 },
|
|
813
|
+
bare: {
|
|
814
|
+
type: Boolean,
|
|
815
|
+
default: !1
|
|
816
|
+
},
|
|
817
|
+
hideClose: {
|
|
818
|
+
type: Boolean,
|
|
819
|
+
default: !1
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
emits: ["update:modelValue"],
|
|
823
|
+
setup(e, { emit: c }) {
|
|
824
|
+
let u = e, d = c, f = y(null);
|
|
825
|
+
U(r(() => u.modelValue), f, { onClose: () => d("update:modelValue", !1) });
|
|
826
|
+
let p = r(() => {
|
|
827
|
+
let e = {};
|
|
828
|
+
return u.side === "bottom" ? (e.height = "auto", e.maxHeight = u.size) : e.width = u.size, e;
|
|
829
|
+
}), g = r(() => "md-sheet-" + u.side);
|
|
830
|
+
return (r, c) => (v(), i(t, { to: "body" }, [l(n, { name: "md-scrim" }, {
|
|
831
|
+
default: D(() => [e.modelValue ? (v(), o("div", {
|
|
832
|
+
key: 0,
|
|
833
|
+
class: "md-scrim",
|
|
834
|
+
onClick: c[0] ||= (e) => d("update:modelValue", !1)
|
|
835
|
+
})) : a("", !0)]),
|
|
836
|
+
_: 1
|
|
837
|
+
}), l(n, { name: g.value }, {
|
|
838
|
+
default: D(() => [e.modelValue ? (v(), o("div", {
|
|
839
|
+
key: 0,
|
|
840
|
+
ref_key: "panelRef",
|
|
841
|
+
ref: f,
|
|
842
|
+
class: m(["md-sheet", "md-sheet--" + e.side]),
|
|
843
|
+
style: h(p.value),
|
|
844
|
+
role: "dialog",
|
|
845
|
+
"aria-modal": "true",
|
|
846
|
+
"aria-label": e.title,
|
|
847
|
+
tabindex: "-1"
|
|
848
|
+
}, [
|
|
849
|
+
e.bare ? a("", !0) : (v(), o("header", He, [e.title ? (v(), o("h2", Ue, w(e.title), 1)) : (v(), o("span", We)), e.hideClose ? a("", !0) : (v(), i(W, {
|
|
850
|
+
key: 2,
|
|
851
|
+
icon: T(L),
|
|
852
|
+
label: "关闭",
|
|
853
|
+
variant: "standard",
|
|
854
|
+
onClick: c[1] ||= (e) => d("update:modelValue", !1)
|
|
855
|
+
}, null, 8, ["icon"]))])),
|
|
856
|
+
s("div", Ge, [x(r.$slots, "default", {}, void 0, !0)]),
|
|
857
|
+
r.$slots.footer ? (v(), o("footer", Ke, [x(r.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
858
|
+
], 14, Ve)) : a("", !0)]),
|
|
859
|
+
_: 3
|
|
860
|
+
}, 8, ["name"])]));
|
|
861
|
+
}
|
|
862
|
+
}), [["__scopeId", "data-v-22b2ddea"]]), Je = [
|
|
863
|
+
"aria-checked",
|
|
864
|
+
"aria-label",
|
|
865
|
+
"disabled"
|
|
866
|
+
], Ye = { class: "md-switch__track" }, Xe = { class: "md-switch__thumb" }, Ze = {
|
|
867
|
+
key: 0,
|
|
868
|
+
class: "md-switch__thumb-icon"
|
|
869
|
+
}, Qe = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
870
|
+
__name: "M3Switch",
|
|
871
|
+
props: {
|
|
872
|
+
modelValue: { type: Boolean },
|
|
873
|
+
label: { default: void 0 },
|
|
874
|
+
disabled: {
|
|
875
|
+
type: Boolean,
|
|
876
|
+
default: !1
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
emits: ["update:modelValue"],
|
|
880
|
+
setup(e, { emit: t }) {
|
|
881
|
+
let n = e, r = t;
|
|
882
|
+
function i() {
|
|
883
|
+
n.disabled || r("update:modelValue", !n.modelValue);
|
|
884
|
+
}
|
|
885
|
+
return (t, n) => (v(), o("button", {
|
|
886
|
+
type: "button",
|
|
887
|
+
role: "switch",
|
|
888
|
+
class: m(["md-switch", {
|
|
889
|
+
"is-checked": e.modelValue,
|
|
890
|
+
"is-disabled": e.disabled
|
|
891
|
+
}]),
|
|
892
|
+
"aria-checked": e.modelValue,
|
|
893
|
+
"aria-label": e.label,
|
|
894
|
+
disabled: e.disabled,
|
|
895
|
+
onClick: i
|
|
896
|
+
}, [s("span", Ye, [n[0] ||= s("span", { class: "md-switch__state" }, null, -1), s("span", Xe, [e.modelValue ? (v(), o("span", Ze, [x(t.$slots, "on-icon", {}, void 0, !0)])) : a("", !0)])])], 10, Je));
|
|
897
|
+
}
|
|
898
|
+
}), [["__scopeId", "data-v-ff3f9765"]]), $e = {
|
|
899
|
+
class: "md-tooltip__bubble",
|
|
900
|
+
role: "tooltip"
|
|
901
|
+
}, et = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
902
|
+
__name: "M3Tooltip",
|
|
903
|
+
props: {
|
|
904
|
+
text: {},
|
|
905
|
+
placement: { default: "top" }
|
|
906
|
+
},
|
|
907
|
+
setup(e) {
|
|
908
|
+
return (t, n) => (v(), o("span", { class: m(["md-tooltip", "md-tooltip--" + e.placement]) }, [x(t.$slots, "default", {}, void 0, !0), s("span", $e, w(e.text), 1)], 2));
|
|
909
|
+
}
|
|
910
|
+
}), [["__scopeId", "data-v-3da4dbf8"]]), tt = {
|
|
911
|
+
class: "md-top-bar__background",
|
|
912
|
+
"aria-hidden": "true"
|
|
913
|
+
}, nt = { class: "md-top-bar__inner md-container" }, G = { class: "md-top-bar__leading" }, rt = { class: "md-top-bar__title" }, it = { class: "md-top-bar__actions" }, at = /*#__PURE__*/ M(/* @__PURE__ */ u({
|
|
914
|
+
__name: "M3TopAppBar",
|
|
915
|
+
props: {
|
|
916
|
+
scrolled: {
|
|
917
|
+
type: Boolean,
|
|
918
|
+
default: !1
|
|
919
|
+
},
|
|
920
|
+
elevated: {
|
|
921
|
+
type: Boolean,
|
|
922
|
+
default: !1
|
|
923
|
+
},
|
|
924
|
+
size: { default: "small" },
|
|
925
|
+
centered: {
|
|
926
|
+
type: Boolean,
|
|
927
|
+
default: !1
|
|
928
|
+
},
|
|
929
|
+
sticky: {
|
|
930
|
+
type: Boolean,
|
|
931
|
+
default: !0
|
|
932
|
+
},
|
|
933
|
+
overlay: {
|
|
934
|
+
type: Boolean,
|
|
935
|
+
default: !1
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
setup(e) {
|
|
939
|
+
return (t, n) => (v(), o("header", { class: m(["md-top-bar", ["md-top-bar--" + e.size, {
|
|
940
|
+
"is-scrolled": e.scrolled || e.elevated,
|
|
941
|
+
"md-top-bar--centered": e.centered,
|
|
942
|
+
"md-top-bar--sticky": e.sticky,
|
|
943
|
+
"md-top-bar--overlay": e.overlay
|
|
944
|
+
}]]) }, [s("div", tt, [x(t.$slots, "background", {}, void 0, !0)]), s("div", nt, [
|
|
945
|
+
s("div", G, [x(t.$slots, "leading", {}, void 0, !0)]),
|
|
946
|
+
s("div", rt, [x(t.$slots, "default", {}, void 0, !0)]),
|
|
947
|
+
s("div", it, [x(t.$slots, "actions", {}, void 0, !0)])
|
|
948
|
+
])], 2));
|
|
949
|
+
}
|
|
950
|
+
}), [["__scopeId", "data-v-9d6607f8"]]);
|
|
951
|
+
// src/directives/ripple.ts
|
|
952
|
+
function ot(e) {
|
|
953
|
+
return e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true" || e.classList.contains("md-disabled");
|
|
954
|
+
}
|
|
955
|
+
function st(e, t) {
|
|
956
|
+
let n = e.getBoundingClientRect();
|
|
957
|
+
if (n.width === 0 || n.height === 0) return;
|
|
958
|
+
let r = Math.max(n.width, n.height) * 2, i = t.clientX - n.left, a = t.clientY - n.top, o = document.createElement("span");
|
|
959
|
+
o.className = "md-ripple", o.style.width = o.style.height = `${r}px`, o.style.left = `${i - r / 2}px`, o.style.top = `${a - r / 2}px`, o.addEventListener("animationend", () => o.remove()), window.setTimeout(() => o.remove(), 1e3), e.appendChild(o);
|
|
960
|
+
}
|
|
961
|
+
var ct = {
|
|
962
|
+
mounted(e) {
|
|
963
|
+
e.classList.add("md-ripple-host");
|
|
964
|
+
let t = (t) => {
|
|
965
|
+
ot(e) || st(e, t);
|
|
966
|
+
};
|
|
967
|
+
e.__mdRippleHandler = t, e.addEventListener("pointerdown", t);
|
|
968
|
+
},
|
|
969
|
+
unmounted(e) {
|
|
970
|
+
e.__mdRippleHandler && (e.removeEventListener("pointerdown", e.__mdRippleHandler), delete e.__mdRippleHandler);
|
|
971
|
+
}
|
|
972
|
+
}, K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new Set(), J = 64, Y = !1, X = 0;
|
|
973
|
+
function Z() {
|
|
974
|
+
window.clearTimeout(X), window.removeEventListener("scroll", $), window.removeEventListener("resize", $);
|
|
975
|
+
}
|
|
976
|
+
function lt() {
|
|
977
|
+
Y = !1;
|
|
978
|
+
let e = window.innerHeight, t = window.scrollY + e >= document.documentElement.scrollHeight - 1 ? e : e - J;
|
|
979
|
+
q.forEach((e) => {
|
|
980
|
+
let n = e.getBoundingClientRect();
|
|
981
|
+
n.bottom > 0 && n.top < t && (e.classList.add("is-revealed"), q.delete(e));
|
|
982
|
+
}), q.size === 0 && Z();
|
|
983
|
+
}
|
|
984
|
+
function Q() {
|
|
985
|
+
Y || (Y = !0, requestAnimationFrame(lt));
|
|
986
|
+
}
|
|
987
|
+
function $() {
|
|
988
|
+
window.clearTimeout(X), X = window.setTimeout(() => {
|
|
989
|
+
q.size === 0 ? Z() : Q();
|
|
990
|
+
}, 120);
|
|
991
|
+
}
|
|
992
|
+
var ut = {
|
|
993
|
+
mounted(e, t) {
|
|
994
|
+
let n = t.value, r = typeof n == "number" ? { delay: n } : n ?? {};
|
|
995
|
+
if (e.classList.add("md-reveal"), r.blur && e.classList.add("md-reveal--blur"), r.delay && (e.style.transitionDelay = r.delay + "ms"), r.y !== void 0 && e.style.setProperty("--md-reveal-y", r.y + "px"), r.scale !== void 0 && e.style.setProperty("--md-reveal-scale", String(r.scale)), typeof IntersectionObserver > "u" || typeof window > "u") {
|
|
996
|
+
e.classList.add("is-revealed");
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
let i = new IntersectionObserver((e) => {
|
|
1000
|
+
for (let t of e) t.isIntersecting ? (t.target.classList.add("is-revealed"), q.delete(t.target), r.once !== !1 && i.unobserve(t.target)) : r.once === !1 && t.target.classList.remove("is-revealed");
|
|
1001
|
+
}, {
|
|
1002
|
+
threshold: 0,
|
|
1003
|
+
rootMargin: `0px 0px -${J}px 0px`
|
|
1004
|
+
});
|
|
1005
|
+
i.observe(e), K.set(e, i), q.add(e), window.addEventListener("scroll", $, { passive: !0 }), window.addEventListener("resize", $), Q();
|
|
1006
|
+
},
|
|
1007
|
+
unmounted(e) {
|
|
1008
|
+
q.delete(e), K.get(e)?.disconnect(), K.delete(e);
|
|
1009
|
+
}
|
|
1010
|
+
};
|
|
1011
|
+
export { I as IconCheck, L as IconClose, ue as IconExpandMore, ne as M3Avatar, ae as M3Button, le as M3Card, R as M3Chip, ye as M3Dialog, be as M3Divider, Se as M3Fab, P as M3Icon, W as M3IconButton, Ce as M3List, Ae as M3ListItem, je as M3Menu, Ie as M3MenuItem, Be as M3SegmentedButton, qe as M3Sheet, Qe as M3Switch, et as M3Tooltip, at as M3TopAppBar, U as useModal, ut as vReveal, ct as vRipple };
|