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.
Files changed (88) hide show
  1. package/dist/components/alert/MochiAlert.vue.d.ts +0 -1
  2. package/dist/components/alert/MochiAlert.vue_vue_type_script_setup_true_lang.js +25 -23
  3. package/dist/components/anchor/MochiAnchor.vue.d.ts +0 -1
  4. package/dist/components/anchor/MochiAnchor.vue_vue_type_script_setup_true_lang.js +40 -39
  5. package/dist/components/auto-complete/MochiAutoComplete.vue.d.ts +0 -1
  6. package/dist/components/auto-complete/MochiAutoComplete.vue_vue_type_script_setup_true_lang.js +65 -64
  7. package/dist/components/avatar-group/MochiAvatarGroup.vue.d.ts +0 -1
  8. package/dist/components/avatar-group/MochiAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -26
  9. package/dist/components/back-top/MochiBackTop.vue.d.ts +0 -1
  10. package/dist/components/back-top/MochiBackTop.vue_vue_type_script_setup_true_lang.js +22 -21
  11. package/dist/components/banner/MochiBanner.vue.d.ts +0 -1
  12. package/dist/components/banner/MochiBanner.vue_vue_type_script_setup_true_lang.js +33 -32
  13. package/dist/components/breadcrumb/MochiBreadcrumb.vue.d.ts +1 -3
  14. package/dist/components/breadcrumb/MochiBreadcrumb.vue_vue_type_script_setup_true_lang.js +21 -19
  15. package/dist/components/calendar/MochiCalendar.vue.d.ts +1 -3
  16. package/dist/components/calendar/MochiCalendar.vue_vue_type_script_setup_true_lang.js +63 -70
  17. package/dist/components/carousel/MochiCarousel.vue.d.ts +0 -1
  18. package/dist/components/carousel/MochiCarousel.vue_vue_type_script_setup_true_lang.js +75 -74
  19. package/dist/components/cascader/MochiCascader.vue.d.ts +1 -3
  20. package/dist/components/cascader/MochiCascader.vue_vue_type_script_setup_true_lang.js +54 -53
  21. package/dist/components/code-input/MochiCodeInput.vue_vue_type_script_setup_true_lang.js +46 -45
  22. package/dist/components/color-picker/MochiColorPicker.vue_vue_type_script_setup_true_lang.js +99 -98
  23. package/dist/components/command-palette/MochiCommandPalette.vue.d.ts +0 -2
  24. package/dist/components/command-palette/MochiCommandPalette.vue_vue_type_script_setup_true_lang.js +78 -77
  25. package/dist/components/countdown/MochiCountdown.vue.d.ts +1 -3
  26. package/dist/components/countdown/MochiCountdown.vue_vue_type_script_setup_true_lang.js +33 -32
  27. package/dist/components/date-picker/MochiDatePicker.vue.d.ts +1 -3
  28. package/dist/components/date-picker/MochiDatePicker.vue_vue_type_script_setup_true_lang.js +41 -40
  29. package/dist/components/drawer/MochiDrawer.vue.d.ts +0 -1
  30. package/dist/components/drawer/MochiDrawer.vue_vue_type_script_setup_true_lang.js +33 -32
  31. package/dist/components/empty/MochiEmpty.vue.d.ts +1 -3
  32. package/dist/components/empty/MochiEmpty.vue_vue_type_script_setup_true_lang.js +15 -13
  33. package/dist/components/image/MochiImage.vue_vue_type_script_setup_true_lang.js +44 -43
  34. package/dist/components/input-number/MochiInputNumber.vue_vue_type_script_setup_true_lang.js +47 -46
  35. package/dist/components/load-more/MochiLoadMore.vue.d.ts +0 -3
  36. package/dist/components/load-more/MochiLoadMore.vue_vue_type_script_setup_true_lang.js +20 -19
  37. package/dist/components/mentions/MochiMentions.vue_vue_type_script_setup_true_lang.js +80 -79
  38. package/dist/components/modal/MochiModal.vue.d.ts +0 -1
  39. package/dist/components/modal/MochiModal.vue_vue_type_script_setup_true_lang.js +34 -33
  40. package/dist/components/pagination/MochiPagination.vue_vue_type_script_setup_true_lang.js +39 -38
  41. package/dist/components/popconfirm/MochiPopconfirm.vue.d.ts +0 -2
  42. package/dist/components/popconfirm/MochiPopconfirm.vue_vue_type_script_setup_true_lang.js +34 -33
  43. package/dist/components/popover/MochiPopover.vue_vue_type_script_setup_true_lang.js +51 -50
  44. package/dist/components/progress/MochiProgress.vue.d.ts +0 -1
  45. package/dist/components/progress/MochiProgress.vue_vue_type_script_setup_true_lang.js +23 -22
  46. package/dist/components/progress-ring/MochiProgressRing.vue.d.ts +0 -1
  47. package/dist/components/progress-ring/MochiProgressRing.vue_vue_type_script_setup_true_lang.js +50 -49
  48. package/dist/components/qrcode/MochiQRCode.vue_vue_type_script_setup_true_lang.js +31 -30
  49. package/dist/components/rate/MochiRate.vue.d.ts +0 -1
  50. package/dist/components/rate/MochiRate.vue_vue_type_script_setup_true_lang.js +31 -30
  51. package/dist/components/select/MochiSelect.module.js +1 -1
  52. package/dist/components/select/MochiSelect.vue.d.ts +9 -1
  53. package/dist/components/select/MochiSelect.vue_vue_type_script_setup_true_lang.js +107 -98
  54. package/dist/components/slider/MochiSlider.vue.d.ts +0 -1
  55. package/dist/components/slider/MochiSlider.vue_vue_type_script_setup_true_lang.js +36 -35
  56. package/dist/components/spinner/MochiSpinner.vue.d.ts +0 -1
  57. package/dist/components/spinner/MochiSpinner.vue_vue_type_script_setup_true_lang.js +14 -12
  58. package/dist/components/table/MochiTable.module.js +1 -1
  59. package/dist/components/table/MochiTable.vue.d.ts +15 -1
  60. package/dist/components/table/MochiTable.vue_vue_type_script_setup_true_lang.js +77 -51
  61. package/dist/components/tag/MochiTag.vue.d.ts +0 -1
  62. package/dist/components/tag/MochiTag.vue_vue_type_script_setup_true_lang.js +17 -15
  63. package/dist/components/tag-input/MochiTagInput.vue.d.ts +0 -1
  64. package/dist/components/tag-input/MochiTagInput.vue_vue_type_script_setup_true_lang.js +64 -63
  65. package/dist/components/time-picker/MochiTimePicker.vue.d.ts +1 -3
  66. package/dist/components/time-picker/MochiTimePicker.vue_vue_type_script_setup_true_lang.js +63 -62
  67. package/dist/components/toast/MochiToastHost.vue_vue_type_script_setup_true_lang.js +18 -16
  68. package/dist/components/toast/ToastCard.vue_vue_type_script_setup_true_lang.js +38 -37
  69. package/dist/components/transfer/MochiTransfer.vue.d.ts +0 -2
  70. package/dist/components/transfer/MochiTransfer.vue_vue_type_script_setup_true_lang.js +85 -84
  71. package/dist/components/tree/MochiTree.module.js +1 -1
  72. package/dist/components/tree/MochiTree.vue.d.ts +7 -1
  73. package/dist/components/tree/MochiTree.vue_vue_type_script_setup_true_lang.js +37 -26
  74. package/dist/components/tree/MochiTreeRow.vue.d.ts +2 -0
  75. package/dist/components/tree/MochiTreeRow.vue_vue_type_script_setup_true_lang.js +43 -37
  76. package/dist/components/tree-select/MochiTreeSelect.vue.d.ts +0 -1
  77. package/dist/components/tree-select/MochiTreeSelect.vue_vue_type_script_setup_true_lang.js +45 -44
  78. package/dist/components/upload/MochiUpload.vue.d.ts +0 -1
  79. package/dist/components/upload/MochiUpload.vue_vue_type_script_setup_true_lang.js +58 -57
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.js +78 -77
  82. package/dist/locale.d.ts +175 -0
  83. package/dist/locale.js +199 -0
  84. package/dist/style.css +1 -1
  85. package/dist/styles/virtual.d.ts +21 -0
  86. package/dist/styles/virtual.js +8 -0
  87. package/dist/styles/virtual.module.js +3 -0
  88. 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 "../../internal/ToneGlyph.js";
2
- import t from "./MochiAlert.module.js";
3
- import { createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d } from "vue";
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 f = ["data-tone"], p = ["aria-label"], m = /*@__PURE__*/ o({
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: { default: "关闭" }
16
+ closeLabel: {}
16
17
  },
17
18
  emits: ["close"],
18
- setup(o) {
19
- return (m, h) => (c(), r("div", {
20
- class: s(d(t).root),
21
- "data-tone": o.tone,
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
- i("span", {
25
- class: s(d(t).badge),
26
+ a("span", {
27
+ class: c(f(n).badge),
26
28
  "aria-hidden": "true"
27
- }, [a(e, { tone: o.tone }, null, 8, ["tone"])], 2),
28
- i("div", { class: s(d(t).body) }, [o.title ? (c(), r("p", {
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: s(d(t).title)
31
- }, u(o.title), 3)) : n("", !0), i("div", { class: s(d(t).text) }, [l(m.$slots, "default")], 2)], 2),
32
- o.closable ? (c(), r("button", {
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: s(d(t).close),
36
+ class: c(f(n).close),
35
37
  type: "button",
36
- "aria-label": o.closeLabel,
37
- onClick: h[0] ||= (e) => m.$emit("close")
38
- }, [...h[1] ||= [i("svg", {
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
- }, [i("path", { d: "M2 2 L8 8 M8 2 L2 8" })], -1)]], 10, p)) : n("", !0)
43
- ], 10, f));
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 { m as default };
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 "./MochiAnchor.module.js";
2
- import { Fragment as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, nextTick as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, useModel as g, watch as _, withModifiers as v } from "vue";
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 y = ["aria-label"], b = [
5
+ var b = ["aria-label"], x = [
5
6
  "href",
6
7
  "data-key",
7
8
  "aria-current",
8
9
  "onClick"
9
- ], x = /*@__PURE__*/ i({
10
+ ], S = /*@__PURE__*/ a({
10
11
  name: "MochiAnchor",
11
12
  __name: "MochiAnchor",
12
- props: /*@__PURE__*/ a({
13
+ props: /*@__PURE__*/ o({
13
14
  items: {},
14
15
  offset: { default: 80 },
15
- label: { default: "页内导航" }
16
+ label: {}
16
17
  }, {
17
18
  active: { default: "" },
18
19
  activeModifiers: {}
19
20
  }),
20
21
  emits: ["update:active"],
21
- setup(i) {
22
- let a = i, x = g(i, "active"), S = f(), C = f({
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 w() {
27
- let e = S.value?.querySelector(`[data-key="${x.value}"]`);
28
- C.value = e ? {
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 T() {
37
+ function D() {
37
38
  let e = "";
38
- for (let t of a.items) {
39
+ for (let t of S.items) {
39
40
  let n = document.getElementById(t.id);
40
- n && n.getBoundingClientRect().top <= a.offset && (e = t.id);
41
+ n && n.getBoundingClientRect().top <= S.offset && (e = t.id);
41
42
  }
42
- e !== x.value && (x.value = e);
43
+ e !== C.value && (C.value = e);
43
44
  }
44
- function E(e) {
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 D() {
52
- T();
52
+ function k() {
53
+ D();
53
54
  }
54
- return u(() => {
55
- T(), window.addEventListener("scroll", D, { passive: !0 }), window.addEventListener("resize", D), o(w);
56
- }), l(() => {
57
- window.removeEventListener("scroll", D), window.removeEventListener("resize", D);
58
- }), _(x, () => o(w)), (a, o) => (d(), n("nav", {
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: S,
61
- class: s(h(e).root),
62
- "aria-label": i.label
63
- }, [r("span", {
64
- class: s(h(e).indicator),
65
- style: c({
66
- transform: `translateY(${C.value.top}px)`,
67
- height: `${C.value.height}px`
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), r("ul", { class: s(h(e).list) }, [(d(!0), n(t, null, p(i.items, (t) => (d(), n("li", { key: t.id }, [r("a", {
71
- class: s(h(e).link),
72
- href: `#${t.id}`,
73
- "data-key": t.id,
74
- "aria-current": x.value === t.id ? "true" : void 0,
75
- onClick: v((e) => E(t), ["prevent"])
76
- }, m(t.label), 11, b)]))), 128))], 2)], 10, y));
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 { x as default };
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;
@@ -1,9 +1,10 @@
1
- import e from "../../internal/FieldShell.js";
2
- import t from "../popover/MochiPopover.js";
3
- import n from "./MochiAutoComplete.module.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, normalizeStyle as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, useId as y, useModel as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withKeys as T, withModifiers as E } from "vue";
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 D = [
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
- ], O = ["id", "aria-label"], k = [
15
+ ], k = ["id", "aria-label"], A = [
15
16
  "aria-selected",
16
17
  "data-active",
17
18
  "onClick",
18
19
  "onMousemove"
19
- ], A = /*@__PURE__*/ u({
20
+ ], j = /*@__PURE__*/ d({
20
21
  name: "MochiAutoComplete",
21
22
  __name: "MochiAutoComplete",
22
- props: /*@__PURE__*/ d({
23
+ props: /*@__PURE__*/ f({
23
24
  options: {},
24
25
  label: {},
25
26
  hint: {},
26
- placeholder: { default: "输入以筛选" },
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__*/ d(["select"], ["update:modelValue"]),
35
- setup(u, { emit: d }) {
36
- let A = u, j = d, M = b(u, "modelValue"), N = h(!1), P = h(-1), F = y(), I = i(() => `${F}-list`), L = i(() => `${F}-hint`), R = i(() => {
37
- let e = M.value.trim().toLowerCase();
38
- return (e ? A.options.filter((t) => t.toLowerCase().includes(e)) : A.options).slice(0, A.limit);
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 z(e) {
41
- if (!R.value.length) return;
42
- let t = R.value.length;
43
- P.value = (P.value + e + t) % t;
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 B(e) {
46
- M.value = e, P.value = -1, N.value = !1, j("select", e);
46
+ function H(e) {
47
+ P.value = e, I.value = -1, F.value = !1, N("select", e);
47
48
  }
48
- function V() {
49
- let e = R.value[P.value];
50
- e && B(e);
49
+ function U() {
50
+ let e = B.value[I.value];
51
+ e && H(e);
51
52
  }
52
- return S([N, M], () => {
53
- P.value = -1;
54
- }), (i, d) => (m(), a(e, {
55
- label: u.label,
56
- hint: u.hint,
57
- "field-id": v(F),
58
- "hint-id": L.value,
59
- invalid: u.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: C(() => [l(t, {
62
- open: N.value,
63
- "onUpdate:open": d[5] ||= (e) => N.value = e,
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: C(() => [w(c("input", {
68
- id: v(F),
69
- "onUpdate:modelValue": d[0] ||= (e) => M.value = e,
70
- class: f(v(n).control),
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: u.placeholder,
73
- disabled: u.disabled,
74
- invalid: u.invalid || void 0,
73
+ placeholder: d.placeholder ?? y(j).autoCompletePlaceholder,
74
+ disabled: d.disabled,
75
+ invalid: d.invalid || void 0,
75
76
  role: "combobox",
76
- "aria-expanded": N.value ? "true" : "false",
77
+ "aria-expanded": F.value ? "true" : "false",
77
78
  "aria-autocomplete": "list",
78
- "aria-controls": I.value,
79
+ "aria-controls": R.value,
79
80
  autocomplete: "off",
80
- onFocus: d[1] ||= (e) => N.value = !0,
81
- onInput: d[2] ||= (e) => N.value = !0,
81
+ onFocus: a[1] ||= (e) => F.value = !0,
82
+ onInput: a[2] ||= (e) => F.value = !0,
82
83
  onKeydown: [
83
- d[3] ||= T(E((e) => z(1), ["prevent"]), ["down"]),
84
- d[4] ||= T(E((e) => z(-1), ["prevent"]), ["up"]),
85
- T(E(V, ["prevent"]), ["enter"])
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, D), [[x, M.value]])]),
88
- default: C(() => [c("ul", {
89
- id: I.value,
90
- class: f(v(n).list),
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": u.label || "建议"
93
- }, [(m(!0), s(r, null, g(R.value, (e, t) => (m(), s("li", { key: e }, [c("button", {
94
- class: f(v(n).option),
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 === P.value || void 0,
98
- "data-active": t === P.value || void 0,
99
- style: p({ "--_i": t }),
100
- onClick: (t) => B(e),
101
- onMousemove: (e) => P.value = t
102
- }, _(e), 47, k)]))), 128)), R.value.length ? o("", !0) : (m(), s("li", {
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: f(v(n).empty)
105
- }, "没有匹配的项", 2))], 10, O)]),
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 { A as default };
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;
@@ -1,43 +1,44 @@
1
- import e from "../avatar/MochiAvatar.js";
2
- import t from "./MochiAvatarGroup.module.js";
3
- import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderList as f, toDisplayString as p, unref as m } from "vue";
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 h = ["data-size", "aria-label"], g = ["title"], _ = /*@__PURE__*/ c({
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: { default: "成员" }
13
+ label: {}
13
14
  },
14
- setup(c) {
15
- let _ = c, v = r(() => _.items.slice(0, Math.max(1, _.max))), y = r(() => _.items.length - v.value.length);
16
- return (r, _) => (d(), a("div", {
17
- class: l(m(t).root),
18
- "data-size": c.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": `${c.label},共 ${c.items.length} 位`
21
- }, [(d(!0), a(n, null, f(v.value, (n, r) => (d(), a("span", {
22
- key: n.name,
23
- class: l(m(t).item),
24
- style: u({ "--_i": r })
25
- }, [s(e, {
26
- name: n.name,
27
- src: n.src,
28
- size: c.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)), y.value > 0 ? (d(), a("span", {
34
+ ])], 6))), 128)), x.value > 0 ? (f(), o("span", {
34
35
  key: 0,
35
- class: l([m(t).item, m(t).more]),
36
- title: `其余 ${y.value} 位`
37
- }, [o("span", {
38
- class: l(m(t).moreText),
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
- }, "+" + p(y.value), 3)], 10, g)) : i("", !0)], 10, h));
41
+ }, "+" + m(x.value), 3)], 10, _)) : a("", !0)], 10, g));
41
42
  }
42
43
  });
43
- export { _ as default };
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 "./MochiBackTop.module.js";
2
- import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, onBeforeUnmount as u, onMounted as d, openBlock as f, ref as p, unref as m, withCtx as h } from "vue";
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 g = ["aria-label"], _ = /*@__PURE__*/ c({
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: { default: "回到顶部" }
10
+ label: {}
10
11
  },
11
- setup(c) {
12
- let _ = c, v = p(!1);
13
- function y() {
14
- v.value = window.scrollY > _.threshold;
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 b() {
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 d(() => {
24
- y(), window.addEventListener("scroll", y, { passive: !0 });
25
- }), u(() => window.removeEventListener("scroll", y)), (u, d) => (f(), r(t, { to: "body" }, [s(n, {
26
- "enter-active-class": m(e).in,
27
- "leave-active-class": m(e).out
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: h(() => [v.value ? (f(), a("button", {
30
+ default: g(() => [b.value ? (p(), o("button", {
30
31
  key: 0,
31
- class: l(m(e).root),
32
+ class: u(h(t).root),
32
33
  type: "button",
33
- "aria-label": c.label,
34
- onClick: b
35
- }, [...d[0] ||= [o("svg", {
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
- }, [o("path", { d: "M2.5 7 L6 3.5 L9.5 7" })], -1)]], 10, g)) : i("", !0)]),
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 { _ as default };
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>;