mochi-island-ui 1.0.0 → 1.2.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/dist/components/alert/MochiAlert.vue.d.ts +0 -1
- package/dist/components/alert/MochiAlert.vue_vue_type_script_setup_true_lang.js +25 -23
- package/dist/components/anchor/MochiAnchor.vue.d.ts +0 -1
- package/dist/components/anchor/MochiAnchor.vue_vue_type_script_setup_true_lang.js +40 -39
- package/dist/components/auto-complete/MochiAutoComplete.vue.d.ts +0 -1
- package/dist/components/auto-complete/MochiAutoComplete.vue_vue_type_script_setup_true_lang.js +65 -64
- package/dist/components/avatar-group/MochiAvatarGroup.vue.d.ts +0 -1
- package/dist/components/avatar-group/MochiAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/components/back-top/MochiBackTop.vue.d.ts +0 -1
- package/dist/components/back-top/MochiBackTop.vue_vue_type_script_setup_true_lang.js +22 -21
- package/dist/components/banner/MochiBanner.vue.d.ts +0 -1
- package/dist/components/banner/MochiBanner.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/components/breadcrumb/MochiBreadcrumb.vue.d.ts +1 -3
- package/dist/components/breadcrumb/MochiBreadcrumb.vue_vue_type_script_setup_true_lang.js +21 -19
- package/dist/components/calendar/MochiCalendar.vue.d.ts +1 -3
- package/dist/components/calendar/MochiCalendar.vue_vue_type_script_setup_true_lang.js +63 -70
- package/dist/components/carousel/MochiCarousel.vue.d.ts +0 -1
- package/dist/components/carousel/MochiCarousel.vue_vue_type_script_setup_true_lang.js +75 -74
- package/dist/components/cascader/MochiCascader.vue.d.ts +1 -3
- package/dist/components/cascader/MochiCascader.vue_vue_type_script_setup_true_lang.js +54 -53
- package/dist/components/code-input/MochiCodeInput.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/components/color-picker/MochiColorPicker.vue_vue_type_script_setup_true_lang.js +99 -98
- package/dist/components/command-palette/MochiCommandPalette.vue.d.ts +0 -2
- package/dist/components/command-palette/MochiCommandPalette.vue_vue_type_script_setup_true_lang.js +78 -77
- package/dist/components/countdown/MochiCountdown.vue.d.ts +1 -3
- package/dist/components/countdown/MochiCountdown.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/components/date-picker/MochiDatePicker.vue.d.ts +1 -3
- package/dist/components/date-picker/MochiDatePicker.vue_vue_type_script_setup_true_lang.js +41 -40
- package/dist/components/drawer/MochiDrawer.vue.d.ts +0 -1
- package/dist/components/drawer/MochiDrawer.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/components/empty/MochiEmpty.vue.d.ts +1 -3
- package/dist/components/empty/MochiEmpty.vue_vue_type_script_setup_true_lang.js +15 -13
- package/dist/components/image/MochiImage.vue_vue_type_script_setup_true_lang.js +44 -43
- package/dist/components/input-number/MochiInputNumber.vue_vue_type_script_setup_true_lang.js +47 -46
- package/dist/components/load-more/MochiLoadMore.vue.d.ts +0 -3
- package/dist/components/load-more/MochiLoadMore.vue_vue_type_script_setup_true_lang.js +20 -19
- package/dist/components/mentions/MochiMentions.vue_vue_type_script_setup_true_lang.js +80 -79
- package/dist/components/modal/MochiModal.vue.d.ts +0 -1
- package/dist/components/modal/MochiModal.vue_vue_type_script_setup_true_lang.js +34 -33
- package/dist/components/pagination/MochiPagination.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/components/popconfirm/MochiPopconfirm.vue.d.ts +0 -2
- package/dist/components/popconfirm/MochiPopconfirm.vue_vue_type_script_setup_true_lang.js +34 -33
- package/dist/components/popover/MochiPopover.vue_vue_type_script_setup_true_lang.js +51 -50
- package/dist/components/progress/MochiProgress.vue.d.ts +0 -1
- package/dist/components/progress/MochiProgress.vue_vue_type_script_setup_true_lang.js +23 -22
- package/dist/components/progress-ring/MochiProgressRing.vue.d.ts +0 -1
- package/dist/components/progress-ring/MochiProgressRing.vue_vue_type_script_setup_true_lang.js +50 -49
- package/dist/components/qrcode/MochiQRCode.vue_vue_type_script_setup_true_lang.js +31 -30
- package/dist/components/rate/MochiRate.vue.d.ts +0 -1
- package/dist/components/rate/MochiRate.vue_vue_type_script_setup_true_lang.js +31 -30
- package/dist/components/select/MochiSelect.module.js +1 -1
- package/dist/components/select/MochiSelect.vue.d.ts +9 -1
- package/dist/components/select/MochiSelect.vue_vue_type_script_setup_true_lang.js +107 -98
- package/dist/components/slider/MochiSlider.vue.d.ts +0 -1
- package/dist/components/slider/MochiSlider.vue_vue_type_script_setup_true_lang.js +36 -35
- package/dist/components/spinner/MochiSpinner.vue.d.ts +0 -1
- package/dist/components/spinner/MochiSpinner.vue_vue_type_script_setup_true_lang.js +14 -12
- package/dist/components/table/MochiTable.module.js +1 -1
- package/dist/components/table/MochiTable.vue.d.ts +15 -1
- package/dist/components/table/MochiTable.vue_vue_type_script_setup_true_lang.js +77 -51
- package/dist/components/tag/MochiTag.vue.d.ts +0 -1
- package/dist/components/tag/MochiTag.vue_vue_type_script_setup_true_lang.js +17 -15
- package/dist/components/tag-input/MochiTagInput.vue.d.ts +0 -1
- package/dist/components/tag-input/MochiTagInput.vue_vue_type_script_setup_true_lang.js +64 -63
- package/dist/components/time-picker/MochiTimePicker.vue.d.ts +1 -3
- package/dist/components/time-picker/MochiTimePicker.vue_vue_type_script_setup_true_lang.js +63 -62
- package/dist/components/toast/MochiToastHost.vue_vue_type_script_setup_true_lang.js +18 -16
- package/dist/components/toast/ToastCard.vue_vue_type_script_setup_true_lang.js +38 -37
- package/dist/components/transfer/MochiTransfer.vue.d.ts +0 -2
- package/dist/components/transfer/MochiTransfer.vue_vue_type_script_setup_true_lang.js +85 -84
- package/dist/components/tree/MochiTree.module.js +1 -1
- package/dist/components/tree/MochiTree.vue.d.ts +7 -1
- package/dist/components/tree/MochiTree.vue_vue_type_script_setup_true_lang.js +37 -26
- package/dist/components/tree/MochiTreeRow.vue.d.ts +2 -0
- package/dist/components/tree/MochiTreeRow.vue_vue_type_script_setup_true_lang.js +43 -37
- package/dist/components/tree-select/MochiTreeSelect.vue.d.ts +0 -1
- package/dist/components/tree-select/MochiTreeSelect.vue_vue_type_script_setup_true_lang.js +45 -44
- package/dist/components/upload/MochiUpload.vue.d.ts +0 -1
- package/dist/components/upload/MochiUpload.vue_vue_type_script_setup_true_lang.js +58 -57
- package/dist/index.d.ts +2 -0
- package/dist/index.js +78 -77
- package/dist/locale.d.ts +175 -0
- package/dist/locale.js +199 -0
- package/dist/style.css +1 -1
- package/dist/styles/virtual.d.ts +21 -0
- package/dist/styles/virtual.js +8 -0
- package/dist/styles/virtual.module.js +3 -0
- package/package.json +7 -3
|
@@ -16,7 +16,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
16
16
|
}>, {
|
|
17
17
|
tone: MochiAlertTone;
|
|
18
18
|
closable: boolean;
|
|
19
|
-
closeLabel: string;
|
|
20
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
1
|
+
import { useMessages as e } from "../../locale.js";
|
|
2
|
+
import t from "../../internal/ToneGlyph.js";
|
|
3
|
+
import n from "./MochiAlert.module.js";
|
|
4
|
+
import { createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f } from "vue";
|
|
4
5
|
// src/components/alert/MochiAlert.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var p = ["data-tone"], m = ["aria-label"], h = /*@__PURE__*/ s({
|
|
6
7
|
name: "MochiAlert",
|
|
7
8
|
__name: "MochiAlert",
|
|
8
9
|
props: {
|
|
@@ -12,35 +13,36 @@ var f = ["data-tone"], p = ["aria-label"], m = /*@__PURE__*/ o({
|
|
|
12
13
|
type: Boolean,
|
|
13
14
|
default: !1
|
|
14
15
|
},
|
|
15
|
-
closeLabel: {
|
|
16
|
+
closeLabel: {}
|
|
16
17
|
},
|
|
17
18
|
emits: ["close"],
|
|
18
|
-
setup(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
setup(s) {
|
|
20
|
+
let h = e();
|
|
21
|
+
return (e, g) => (l(), i("div", {
|
|
22
|
+
class: c(f(n).root),
|
|
23
|
+
"data-tone": s.tone,
|
|
22
24
|
role: "status"
|
|
23
25
|
}, [
|
|
24
|
-
|
|
25
|
-
class:
|
|
26
|
+
a("span", {
|
|
27
|
+
class: c(f(n).badge),
|
|
26
28
|
"aria-hidden": "true"
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
+
}, [o(t, { tone: s.tone }, null, 8, ["tone"])], 2),
|
|
30
|
+
a("div", { class: c(f(n).body) }, [s.title ? (l(), i("p", {
|
|
29
31
|
key: 0,
|
|
30
|
-
class:
|
|
31
|
-
},
|
|
32
|
-
|
|
32
|
+
class: c(f(n).title)
|
|
33
|
+
}, d(s.title), 3)) : r("", !0), a("div", { class: c(f(n).text) }, [u(e.$slots, "default")], 2)], 2),
|
|
34
|
+
s.closable ? (l(), i("button", {
|
|
33
35
|
key: 0,
|
|
34
|
-
class:
|
|
36
|
+
class: c(f(n).close),
|
|
35
37
|
type: "button",
|
|
36
|
-
"aria-label":
|
|
37
|
-
onClick:
|
|
38
|
-
}, [...
|
|
38
|
+
"aria-label": s.closeLabel ?? f(h).close,
|
|
39
|
+
onClick: g[0] ||= (t) => e.$emit("close")
|
|
40
|
+
}, [...g[1] ||= [a("svg", {
|
|
39
41
|
viewBox: "0 0 10 10",
|
|
40
42
|
"aria-hidden": "true",
|
|
41
43
|
focusable: "false"
|
|
42
|
-
}, [
|
|
43
|
-
], 10,
|
|
44
|
+
}, [a("path", { d: "M2 2 L8 8 M8 2 L2 8" })], -1)]], 10, m)) : r("", !0)
|
|
45
|
+
], 10, p));
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
|
-
export {
|
|
48
|
+
export { h as default };
|
|
@@ -13,7 +13,6 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
13
13
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
14
|
"onUpdate:active"?: ((value: string) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
label: string;
|
|
17
16
|
offset: number;
|
|
18
17
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
18
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { useMessages as e } from "../../locale.js";
|
|
2
|
+
import t from "./MochiAnchor.module.js";
|
|
3
|
+
import { Fragment as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, nextTick as s, normalizeClass as c, normalizeStyle as l, onBeforeUnmount as u, onMounted as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, useModel as _, watch as v, withModifiers as y } from "vue";
|
|
3
4
|
// src/components/anchor/MochiAnchor.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var b = ["aria-label"], x = [
|
|
5
6
|
"href",
|
|
6
7
|
"data-key",
|
|
7
8
|
"aria-current",
|
|
8
9
|
"onClick"
|
|
9
|
-
],
|
|
10
|
+
], S = /*@__PURE__*/ a({
|
|
10
11
|
name: "MochiAnchor",
|
|
11
12
|
__name: "MochiAnchor",
|
|
12
|
-
props: /*@__PURE__*/
|
|
13
|
+
props: /*@__PURE__*/ o({
|
|
13
14
|
items: {},
|
|
14
15
|
offset: { default: 80 },
|
|
15
|
-
label: {
|
|
16
|
+
label: {}
|
|
16
17
|
}, {
|
|
17
18
|
active: { default: "" },
|
|
18
19
|
activeModifiers: {}
|
|
19
20
|
}),
|
|
20
21
|
emits: ["update:active"],
|
|
21
|
-
setup(
|
|
22
|
-
let
|
|
22
|
+
setup(a) {
|
|
23
|
+
let o = e(), S = a, C = _(a, "active"), w = p(), T = p({
|
|
23
24
|
top: 0,
|
|
24
25
|
height: 0
|
|
25
26
|
});
|
|
26
|
-
function
|
|
27
|
-
let e =
|
|
28
|
-
|
|
27
|
+
function E() {
|
|
28
|
+
let e = w.value?.querySelector(`[data-key="${C.value}"]`);
|
|
29
|
+
T.value = e ? {
|
|
29
30
|
top: e.offsetTop,
|
|
30
31
|
height: e.offsetHeight
|
|
31
32
|
} : {
|
|
@@ -33,47 +34,47 @@ var y = ["aria-label"], b = [
|
|
|
33
34
|
height: 0
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function D() {
|
|
37
38
|
let e = "";
|
|
38
|
-
for (let t of
|
|
39
|
+
for (let t of S.items) {
|
|
39
40
|
let n = document.getElementById(t.id);
|
|
40
|
-
n && n.getBoundingClientRect().top <=
|
|
41
|
+
n && n.getBoundingClientRect().top <= S.offset && (e = t.id);
|
|
41
42
|
}
|
|
42
|
-
e !==
|
|
43
|
+
e !== C.value && (C.value = e);
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function O(e) {
|
|
45
46
|
let t = typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
46
47
|
document.getElementById(e.id)?.scrollIntoView({
|
|
47
48
|
behavior: t ? "auto" : "smooth",
|
|
48
49
|
block: "start"
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
52
|
+
function k() {
|
|
53
|
+
D();
|
|
53
54
|
}
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
}),
|
|
57
|
-
window.removeEventListener("scroll",
|
|
58
|
-
}),
|
|
55
|
+
return d(() => {
|
|
56
|
+
D(), window.addEventListener("scroll", k, { passive: !0 }), window.addEventListener("resize", k), s(E);
|
|
57
|
+
}), u(() => {
|
|
58
|
+
window.removeEventListener("scroll", k), window.removeEventListener("resize", k);
|
|
59
|
+
}), v(C, () => s(E)), (e, s) => (f(), r("nav", {
|
|
59
60
|
ref_key: "root",
|
|
60
|
-
ref:
|
|
61
|
-
class:
|
|
62
|
-
"aria-label":
|
|
63
|
-
}, [
|
|
64
|
-
class:
|
|
65
|
-
style:
|
|
66
|
-
transform: `translateY(${
|
|
67
|
-
height: `${
|
|
61
|
+
ref: w,
|
|
62
|
+
class: c(g(t).root),
|
|
63
|
+
"aria-label": a.label ?? g(o).anchorLabel
|
|
64
|
+
}, [i("span", {
|
|
65
|
+
class: c(g(t).indicator),
|
|
66
|
+
style: l({
|
|
67
|
+
transform: `translateY(${T.value.top}px)`,
|
|
68
|
+
height: `${T.value.height}px`
|
|
68
69
|
}),
|
|
69
70
|
"aria-hidden": "true"
|
|
70
|
-
}, null, 6),
|
|
71
|
-
class:
|
|
72
|
-
href: `#${
|
|
73
|
-
"data-key":
|
|
74
|
-
"aria-current":
|
|
75
|
-
onClick:
|
|
76
|
-
},
|
|
71
|
+
}, null, 6), i("ul", { class: c(g(t).list) }, [(f(!0), r(n, null, m(a.items, (e) => (f(), r("li", { key: e.id }, [i("a", {
|
|
72
|
+
class: c(g(t).link),
|
|
73
|
+
href: `#${e.id}`,
|
|
74
|
+
"data-key": e.id,
|
|
75
|
+
"aria-current": C.value === e.id ? "true" : void 0,
|
|
76
|
+
onClick: y((t) => O(e), ["prevent"])
|
|
77
|
+
}, h(e.label), 11, x)]))), 128))], 2)], 10, b));
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
|
-
export {
|
|
80
|
+
export { S as default };
|
|
@@ -19,7 +19,6 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
19
19
|
onSelect?: ((args_0: string) => any) | undefined;
|
|
20
20
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
|
-
placeholder: string;
|
|
23
22
|
limit: number;
|
|
24
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
24
|
declare const _default: typeof __VLS_export;
|
package/dist/components/auto-complete/MochiAutoComplete.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
1
|
+
import { useMessages as e } from "../../locale.js";
|
|
2
|
+
import t from "../../internal/FieldShell.js";
|
|
3
|
+
import n from "../popover/MochiPopover.js";
|
|
4
|
+
import r from "./MochiAutoComplete.module.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, normalizeClass as p, normalizeStyle as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, useId as b, useModel as x, vModelText as S, watch as C, withCtx as w, withDirectives as T, withKeys as E, withModifiers as D } from "vue";
|
|
5
6
|
// src/components/auto-complete/MochiAutoComplete.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var O = [
|
|
7
8
|
"id",
|
|
8
9
|
"placeholder",
|
|
9
10
|
"disabled",
|
|
@@ -11,19 +12,19 @@ var D = [
|
|
|
11
12
|
"aria-expanded",
|
|
12
13
|
"aria-controls",
|
|
13
14
|
"onKeydown"
|
|
14
|
-
],
|
|
15
|
+
], k = ["id", "aria-label"], A = [
|
|
15
16
|
"aria-selected",
|
|
16
17
|
"data-active",
|
|
17
18
|
"onClick",
|
|
18
19
|
"onMousemove"
|
|
19
|
-
],
|
|
20
|
+
], j = /*@__PURE__*/ d({
|
|
20
21
|
name: "MochiAutoComplete",
|
|
21
22
|
__name: "MochiAutoComplete",
|
|
22
|
-
props: /*@__PURE__*/
|
|
23
|
+
props: /*@__PURE__*/ f({
|
|
23
24
|
options: {},
|
|
24
25
|
label: {},
|
|
25
26
|
hint: {},
|
|
26
|
-
placeholder: {
|
|
27
|
+
placeholder: {},
|
|
27
28
|
disabled: { type: Boolean },
|
|
28
29
|
invalid: { type: Boolean },
|
|
29
30
|
limit: { default: 8 }
|
|
@@ -31,78 +32,78 @@ var D = [
|
|
|
31
32
|
modelValue: { default: "" },
|
|
32
33
|
modelModifiers: {}
|
|
33
34
|
}),
|
|
34
|
-
emits: /*@__PURE__*/
|
|
35
|
-
setup(
|
|
36
|
-
let
|
|
37
|
-
let e =
|
|
38
|
-
return (e ?
|
|
35
|
+
emits: /*@__PURE__*/ f(["select"], ["update:modelValue"]),
|
|
36
|
+
setup(d, { emit: f }) {
|
|
37
|
+
let j = e(), M = d, N = f, P = x(d, "modelValue"), F = g(!1), I = g(-1), L = b(), R = a(() => `${L}-list`), z = a(() => `${L}-hint`), B = a(() => {
|
|
38
|
+
let e = P.value.trim().toLowerCase();
|
|
39
|
+
return (e ? M.options.filter((t) => t.toLowerCase().includes(e)) : M.options).slice(0, M.limit);
|
|
39
40
|
});
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
42
|
-
let t =
|
|
43
|
-
|
|
41
|
+
function V(e) {
|
|
42
|
+
if (!B.value.length) return;
|
|
43
|
+
let t = B.value.length;
|
|
44
|
+
I.value = (I.value + e + t) % t;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
46
|
+
function H(e) {
|
|
47
|
+
P.value = e, I.value = -1, F.value = !1, N("select", e);
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
let e =
|
|
50
|
-
e &&
|
|
49
|
+
function U() {
|
|
50
|
+
let e = B.value[I.value];
|
|
51
|
+
e && H(e);
|
|
51
52
|
}
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
}), (
|
|
55
|
-
label:
|
|
56
|
-
hint:
|
|
57
|
-
"field-id":
|
|
58
|
-
"hint-id":
|
|
59
|
-
invalid:
|
|
53
|
+
return C([F, P], () => {
|
|
54
|
+
I.value = -1;
|
|
55
|
+
}), (e, a) => (h(), o(t, {
|
|
56
|
+
label: d.label,
|
|
57
|
+
hint: d.hint,
|
|
58
|
+
"field-id": y(L),
|
|
59
|
+
"hint-id": z.value,
|
|
60
|
+
invalid: d.invalid
|
|
60
61
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
open:
|
|
63
|
-
"onUpdate:open":
|
|
62
|
+
default: w(() => [u(n, {
|
|
63
|
+
open: F.value,
|
|
64
|
+
"onUpdate:open": a[5] ||= (e) => F.value = e,
|
|
64
65
|
width: "100%",
|
|
65
66
|
bare: ""
|
|
66
67
|
}, {
|
|
67
|
-
trigger:
|
|
68
|
-
id:
|
|
69
|
-
"onUpdate:modelValue":
|
|
70
|
-
class:
|
|
68
|
+
trigger: w(() => [T(l("input", {
|
|
69
|
+
id: y(L),
|
|
70
|
+
"onUpdate:modelValue": a[0] ||= (e) => P.value = e,
|
|
71
|
+
class: p(y(r).control),
|
|
71
72
|
type: "text",
|
|
72
|
-
placeholder:
|
|
73
|
-
disabled:
|
|
74
|
-
invalid:
|
|
73
|
+
placeholder: d.placeholder ?? y(j).autoCompletePlaceholder,
|
|
74
|
+
disabled: d.disabled,
|
|
75
|
+
invalid: d.invalid || void 0,
|
|
75
76
|
role: "combobox",
|
|
76
|
-
"aria-expanded":
|
|
77
|
+
"aria-expanded": F.value ? "true" : "false",
|
|
77
78
|
"aria-autocomplete": "list",
|
|
78
|
-
"aria-controls":
|
|
79
|
+
"aria-controls": R.value,
|
|
79
80
|
autocomplete: "off",
|
|
80
|
-
onFocus:
|
|
81
|
-
onInput:
|
|
81
|
+
onFocus: a[1] ||= (e) => F.value = !0,
|
|
82
|
+
onInput: a[2] ||= (e) => F.value = !0,
|
|
82
83
|
onKeydown: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
a[3] ||= E(D((e) => V(1), ["prevent"]), ["down"]),
|
|
85
|
+
a[4] ||= E(D((e) => V(-1), ["prevent"]), ["up"]),
|
|
86
|
+
E(D(U, ["prevent"]), ["enter"])
|
|
86
87
|
]
|
|
87
|
-
}, null, 42,
|
|
88
|
-
default:
|
|
89
|
-
id:
|
|
90
|
-
class:
|
|
88
|
+
}, null, 42, O), [[S, P.value]])]),
|
|
89
|
+
default: w(() => [l("ul", {
|
|
90
|
+
id: R.value,
|
|
91
|
+
class: p(y(r).list),
|
|
91
92
|
role: "listbox",
|
|
92
|
-
"aria-label":
|
|
93
|
-
}, [(
|
|
94
|
-
class:
|
|
93
|
+
"aria-label": d.label ?? y(j).autoCompleteList
|
|
94
|
+
}, [(h(!0), c(i, null, _(B.value, (e, t) => (h(), c("li", { key: e }, [l("button", {
|
|
95
|
+
class: p(y(r).option),
|
|
95
96
|
type: "button",
|
|
96
97
|
role: "option",
|
|
97
|
-
"aria-selected": t ===
|
|
98
|
-
"data-active": t ===
|
|
99
|
-
style:
|
|
100
|
-
onClick: (t) =>
|
|
101
|
-
onMousemove: (e) =>
|
|
102
|
-
},
|
|
98
|
+
"aria-selected": t === I.value || void 0,
|
|
99
|
+
"data-active": t === I.value || void 0,
|
|
100
|
+
style: m({ "--_i": t }),
|
|
101
|
+
onClick: (t) => H(e),
|
|
102
|
+
onMousemove: (e) => I.value = t
|
|
103
|
+
}, v(e), 47, A)]))), 128)), B.value.length ? s("", !0) : (h(), c("li", {
|
|
103
104
|
key: 0,
|
|
104
|
-
class:
|
|
105
|
-
},
|
|
105
|
+
class: p(y(r).empty)
|
|
106
|
+
}, v(y(j).autoCompleteEmpty), 3))], 10, k)]),
|
|
106
107
|
_: 1
|
|
107
108
|
}, 8, ["open"])]),
|
|
108
109
|
_: 1
|
|
@@ -115,4 +116,4 @@ var D = [
|
|
|
115
116
|
]));
|
|
116
117
|
}
|
|
117
118
|
});
|
|
118
|
-
export {
|
|
119
|
+
export { j as default };
|
|
@@ -9,7 +9,6 @@ type __VLS_Props = {
|
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
11
|
size: import('../avatar').MochiAvatarSize;
|
|
12
|
-
label: string;
|
|
13
12
|
max: number;
|
|
14
13
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
14
|
declare const _default: typeof __VLS_export;
|
package/dist/components/avatar-group/MochiAvatarGroup.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
1
|
+
import { useMessages as e } from "../../locale.js";
|
|
2
|
+
import t from "../avatar/MochiAvatar.js";
|
|
3
|
+
import n from "./MochiAvatarGroup.module.js";
|
|
4
|
+
import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, toDisplayString as m, unref as h } from "vue";
|
|
4
5
|
// src/components/avatar-group/MochiAvatarGroup.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var g = ["data-size", "aria-label"], _ = ["title"], v = /*@__PURE__*/ l({
|
|
6
7
|
name: "MochiAvatarGroup",
|
|
7
8
|
__name: "MochiAvatarGroup",
|
|
8
9
|
props: {
|
|
9
10
|
items: {},
|
|
10
11
|
max: { default: 4 },
|
|
11
12
|
size: { default: "md" },
|
|
12
|
-
label: {
|
|
13
|
+
label: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
let
|
|
16
|
-
return (
|
|
17
|
-
class:
|
|
18
|
-
"data-size":
|
|
15
|
+
setup(l) {
|
|
16
|
+
let v = e(), y = l, b = i(() => y.items.slice(0, Math.max(1, y.max))), x = i(() => y.items.length - b.value.length);
|
|
17
|
+
return (e, i) => (f(), o("div", {
|
|
18
|
+
class: u(h(n).root),
|
|
19
|
+
"data-size": l.size,
|
|
19
20
|
role: "group",
|
|
20
|
-
"aria-label": `${
|
|
21
|
-
}, [(
|
|
22
|
-
key:
|
|
23
|
-
class:
|
|
24
|
-
style:
|
|
25
|
-
}, [
|
|
26
|
-
name:
|
|
27
|
-
src:
|
|
28
|
-
size:
|
|
21
|
+
"aria-label": `${l.label ?? h(v).avatarGroupLabel} · ${l.items.length}`
|
|
22
|
+
}, [(f(!0), o(r, null, p(b.value, (e, r) => (f(), o("span", {
|
|
23
|
+
key: e.name,
|
|
24
|
+
class: u(h(n).item),
|
|
25
|
+
style: d({ "--_i": r })
|
|
26
|
+
}, [c(t, {
|
|
27
|
+
name: e.name,
|
|
28
|
+
src: e.src,
|
|
29
|
+
size: l.size
|
|
29
30
|
}, null, 8, [
|
|
30
31
|
"name",
|
|
31
32
|
"src",
|
|
32
33
|
"size"
|
|
33
|
-
])], 6))), 128)),
|
|
34
|
+
])], 6))), 128)), x.value > 0 ? (f(), o("span", {
|
|
34
35
|
key: 0,
|
|
35
|
-
class:
|
|
36
|
-
title: `其余 ${
|
|
37
|
-
}, [
|
|
38
|
-
class:
|
|
36
|
+
class: u([h(n).item, h(n).more]),
|
|
37
|
+
title: `其余 ${x.value} 位`
|
|
38
|
+
}, [s("span", {
|
|
39
|
+
class: u(h(n).moreText),
|
|
39
40
|
"aria-hidden": "true"
|
|
40
|
-
}, "+" +
|
|
41
|
+
}, "+" + m(x.value), 3)], 10, _)) : a("", !0)], 10, g));
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
|
-
export {
|
|
44
|
+
export { v as default };
|
|
@@ -3,7 +3,6 @@ type __VLS_Props = {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
-
label: string;
|
|
7
6
|
threshold: number;
|
|
8
7
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
8
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { useMessages as e } from "../../locale.js";
|
|
2
|
+
import t from "./MochiBackTop.module.js";
|
|
3
|
+
import { Teleport as n, Transition as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, unref as h, withCtx as g } from "vue";
|
|
3
4
|
// src/components/back-top/MochiBackTop.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var _ = ["aria-label"], v = /*@__PURE__*/ l({
|
|
5
6
|
name: "MochiBackTop",
|
|
6
7
|
__name: "MochiBackTop",
|
|
7
8
|
props: {
|
|
8
9
|
threshold: { default: 320 },
|
|
9
|
-
label: {
|
|
10
|
+
label: {}
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
|
|
12
|
+
setup(l) {
|
|
13
|
+
let v = e(), y = l, b = m(!1);
|
|
14
|
+
function x() {
|
|
15
|
+
b.value = window.scrollY > y.threshold;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function S() {
|
|
17
18
|
let e = typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
18
19
|
window.scrollTo({
|
|
19
20
|
top: 0,
|
|
20
21
|
behavior: e ? "auto" : "smooth"
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
"enter-active-class":
|
|
27
|
-
"leave-active-class":
|
|
24
|
+
return f(() => {
|
|
25
|
+
x(), window.addEventListener("scroll", x, { passive: !0 });
|
|
26
|
+
}), d(() => window.removeEventListener("scroll", x)), (e, d) => (p(), i(n, { to: "body" }, [c(r, {
|
|
27
|
+
"enter-active-class": h(t).in,
|
|
28
|
+
"leave-active-class": h(t).out
|
|
28
29
|
}, {
|
|
29
|
-
default:
|
|
30
|
+
default: g(() => [b.value ? (p(), o("button", {
|
|
30
31
|
key: 0,
|
|
31
|
-
class:
|
|
32
|
+
class: u(h(t).root),
|
|
32
33
|
type: "button",
|
|
33
|
-
"aria-label":
|
|
34
|
-
onClick:
|
|
35
|
-
}, [...d[0] ||= [
|
|
34
|
+
"aria-label": l.label ?? h(v).backTopLabel,
|
|
35
|
+
onClick: S
|
|
36
|
+
}, [...d[0] ||= [s("svg", {
|
|
36
37
|
viewBox: "0 0 12 12",
|
|
37
38
|
"aria-hidden": "true"
|
|
38
|
-
}, [
|
|
39
|
+
}, [s("path", { d: "M2.5 7 L6 3.5 L9.5 7" })], -1)]], 10, _)) : a("", !0)]),
|
|
39
40
|
_: 1
|
|
40
41
|
}, 8, ["enter-active-class", "leave-active-class"])]));
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
|
-
export {
|
|
44
|
+
export { v as default };
|
|
@@ -24,7 +24,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
24
24
|
}>, {
|
|
25
25
|
tone: "danger" | "info" | "success" | "warning";
|
|
26
26
|
closable: boolean;
|
|
27
|
-
closeLabel: string;
|
|
28
27
|
sticky: boolean;
|
|
29
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
29
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|