@matechat/core 1.10.0 → 1.11.0-alpha.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 (120) hide show
  1. package/Attachment/Attachment.vue.d.ts +121 -0
  2. package/Attachment/attachment-types.d.ts +103 -0
  3. package/Attachment/drop-area.vue.d.ts +13 -0
  4. package/Attachment/index.css +1 -1
  5. package/Attachment/index.d.ts +2 -0
  6. package/Attachment/index.js +211 -311
  7. package/Attachment/uploader.d.ts +11 -0
  8. package/Attachment/use-upload.d.ts +8 -0
  9. package/Bubble/Bubble.vue.d.ts +75 -0
  10. package/Bubble/BubbleLoading.vue.d.ts +3 -0
  11. package/Bubble/bubble-constants.d.ts +4 -0
  12. package/Bubble/bubble-types.d.ts +38 -0
  13. package/Bubble/components/Avatar.vue.d.ts +57 -0
  14. package/Bubble/components/AvatarBodyIcon.vue.d.ts +24 -0
  15. package/Bubble/components/AvatarNoBodyIcon.vue.d.ts +24 -0
  16. package/Bubble/components/avatar-types.d.ts +25 -0
  17. package/Bubble/index.css +1 -1
  18. package/Bubble/index.d.ts +2 -0
  19. package/Bubble/index.js +142 -148
  20. package/FileList/FileIcon/CodeFile.vue.d.ts +10 -0
  21. package/FileList/FileIcon/CompressedFile.vue.d.ts +10 -0
  22. package/FileList/FileIcon/DefaultFileIcon.vue.d.ts +10 -0
  23. package/FileList/FileIcon/Document.vue.d.ts +10 -0
  24. package/FileList/FileIcon/DrawingBoard.vue.d.ts +10 -0
  25. package/FileList/FileIcon/EmailFile.vue.d.ts +10 -0
  26. package/FileList/FileIcon/Excel.vue.d.ts +10 -0
  27. package/FileList/FileIcon/FlowChart.vue.d.ts +10 -0
  28. package/FileList/FileIcon/FolderClosed.vue.d.ts +10 -0
  29. package/FileList/FileIcon/FolderOpen.vue.d.ts +10 -0
  30. package/FileList/FileIcon/Image.vue.d.ts +10 -0
  31. package/FileList/FileIcon/Markdown.vue.d.ts +10 -0
  32. package/FileList/FileIcon/Mind.vue.d.ts +10 -0
  33. package/FileList/FileIcon/Mp4.vue.d.ts +10 -0
  34. package/FileList/FileIcon/MultidimentionalTable.vue.d.ts +10 -0
  35. package/FileList/FileIcon/Page.vue.d.ts +10 -0
  36. package/FileList/FileIcon/Pdf.vue.d.ts +10 -0
  37. package/FileList/FileIcon/Ppt.vue.d.ts +10 -0
  38. package/FileList/FileIcon/Unknown.vue.d.ts +10 -0
  39. package/FileList/FileIcon/Wrong.vue.d.ts +10 -0
  40. package/FileList/FileList.vue.d.ts +36 -0
  41. package/FileList/fileList-types.d.ts +21 -0
  42. package/FileList/index.d.ts +2 -0
  43. package/FileList/index.js +220 -228
  44. package/Header/Header.vue.d.ts +47 -0
  45. package/Header/header-types.d.ts +14 -0
  46. package/Header/index.d.ts +2 -0
  47. package/Header/index.js +0 -1
  48. package/Input/Input.vue.d.ts +165 -0
  49. package/Input/components/EditableBlock.vue.d.ts +101 -0
  50. package/Input/components/InputTag.vue.d.ts +30 -0
  51. package/Input/components/LoadingIcon.vue.d.ts +3 -0
  52. package/Input/components/SendIcon.vue.d.ts +3 -0
  53. package/Input/components/button.vue.d.ts +3 -0
  54. package/Input/components/textarea-utils.d.ts +17 -0
  55. package/Input/components/textarea.vue.d.ts +3 -0
  56. package/Input/components/use-textarea-autosize.d.ts +12 -0
  57. package/Input/components/util.d.ts +3 -0
  58. package/Input/index.css +1 -1
  59. package/Input/index.d.ts +2 -0
  60. package/Input/index.js +114 -252
  61. package/Input/input-types.d.ts +118 -0
  62. package/Introduction/Introduction.vue.d.ts +88 -0
  63. package/Introduction/index.css +1 -1
  64. package/Introduction/index.d.ts +2 -0
  65. package/Introduction/index.js +8 -9
  66. package/Introduction/introduction-types.d.ts +37 -0
  67. package/Layout/Aside.vue.d.ts +13 -0
  68. package/Layout/Content.vue.d.ts +13 -0
  69. package/Layout/Header.vue.d.ts +13 -0
  70. package/Layout/Layout.vue.d.ts +13 -0
  71. package/Layout/Sender.vue.d.ts +13 -0
  72. package/Layout/index.d.ts +6 -0
  73. package/Layout/index.js +0 -1
  74. package/List/List.vue.d.ts +98 -0
  75. package/List/const.d.ts +5 -0
  76. package/List/index.css +1 -1
  77. package/List/index.d.ts +3 -0
  78. package/List/index.js +51 -54
  79. package/List/list-types.d.ts +52 -0
  80. package/List/use-list.d.ts +13 -0
  81. package/Locale/i18n.d.ts +21 -0
  82. package/Locale/index.d.ts +7 -0
  83. package/Locale/index.js +35 -103
  84. package/Locale/lang/en-us.d.ts +34 -0
  85. package/Locale/lang/zh-cn.d.ts +34 -0
  86. package/MarkdownCard/CodeBlock.vue.d.ts +76 -0
  87. package/MarkdownCard/MDCardParser.d.ts +12 -0
  88. package/MarkdownCard/MDCardService.d.ts +14 -0
  89. package/MarkdownCard/MermaidService.d.ts +22 -0
  90. package/MarkdownCard/index.css +1 -1
  91. package/MarkdownCard/index.d.ts +2 -0
  92. package/MarkdownCard/index.js +205 -559
  93. package/MarkdownCard/mdCard.types.d.ts +88 -0
  94. package/MarkdownCard/mdCard.vue.d.ts +29 -0
  95. package/Mention/Mention.vue.d.ts +51 -0
  96. package/Mention/const.d.ts +4 -0
  97. package/Mention/index.d.ts +2 -0
  98. package/Mention/index.js +0 -1
  99. package/Mention/mention-types.d.ts +24 -0
  100. package/Mention/use-mention.d.ts +10 -0
  101. package/Prompt/Prompt.vue.d.ts +38 -0
  102. package/Prompt/PromptItem.vue.d.ts +11 -0
  103. package/Prompt/components/Icon.vue.d.ts +42 -0
  104. package/Prompt/components/icon-types.d.ts +18 -0
  105. package/Prompt/index.d.ts +2 -0
  106. package/Prompt/prompt-types.d.ts +33 -0
  107. package/README.md +12 -8
  108. package/Toolbar/Toolbar.vue.d.ts +68 -0
  109. package/Toolbar/icon/CopyIcon.vue.d.ts +42 -0
  110. package/Toolbar/icon/DeleteIcon.vue.d.ts +42 -0
  111. package/Toolbar/icon/DislikeIcon.vue.d.ts +46 -0
  112. package/Toolbar/icon/LikeIcon.vue.d.ts +46 -0
  113. package/Toolbar/icon/RefreshIcon.vue.d.ts +42 -0
  114. package/Toolbar/icon/ShareIcon.vue.d.ts +42 -0
  115. package/Toolbar/index.css +1 -0
  116. package/Toolbar/index.d.ts +8 -0
  117. package/Toolbar/index.js +519 -0
  118. package/Toolbar/toolbar.types.d.ts +60 -0
  119. package/mate-chat.js +0 -6
  120. package/package.json +4 -1
@@ -0,0 +1,88 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ logoImg: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ logoWidth: {
11
+ type: (StringConstructor | NumberConstructor)[];
12
+ default: string;
13
+ };
14
+ logoHeight: {
15
+ type: (StringConstructor | NumberConstructor)[];
16
+ default: string;
17
+ };
18
+ title: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ subTitle: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ description: {
27
+ type: import("vue").PropType<string[]>;
28
+ default: () => never[];
29
+ };
30
+ background: {
31
+ type: import("vue").PropType<import("./introduction-types").IntroductionBackground>;
32
+ default: string;
33
+ };
34
+ align: {
35
+ type: import("vue").PropType<import("./introduction-types").IntroductionAlign>;
36
+ default: string;
37
+ };
38
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
+ logoImg: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ logoWidth: {
44
+ type: (StringConstructor | NumberConstructor)[];
45
+ default: string;
46
+ };
47
+ logoHeight: {
48
+ type: (StringConstructor | NumberConstructor)[];
49
+ default: string;
50
+ };
51
+ title: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ subTitle: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ description: {
60
+ type: import("vue").PropType<string[]>;
61
+ default: () => never[];
62
+ };
63
+ background: {
64
+ type: import("vue").PropType<import("./introduction-types").IntroductionBackground>;
65
+ default: string;
66
+ };
67
+ align: {
68
+ type: import("vue").PropType<import("./introduction-types").IntroductionAlign>;
69
+ default: string;
70
+ };
71
+ }>> & Readonly<{}>, {
72
+ background: import("./introduction-types").IntroductionBackground;
73
+ title: string;
74
+ description: string[];
75
+ align: import("./introduction-types").IntroductionAlign;
76
+ logoImg: string;
77
+ logoWidth: string | number;
78
+ logoHeight: string | number;
79
+ subTitle: string;
80
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
81
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
82
+ declare const _default: typeof __VLS_export;
83
+ export default _default;
84
+ type __VLS_WithSlots<T, S> = T & {
85
+ new (): {
86
+ $slots: S;
87
+ };
88
+ };
@@ -1 +1 @@
1
- .mc-introduction[data-v-0c128c90]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-0c128c90]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-0c128c90]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-0c128c90]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-0c128c90]{font-size:var(--devui-font-size, 12px)}.mc-introduction .mc-introduction-description>div[data-v-0c128c90]{line-height:1.5}.mc-introduction.filled[data-v-0c128c90]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-0c128c90]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-0c128c90]{text-align:center}.mc-introduction.left[data-v-0c128c90]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-0c128c90]{text-align:left}.mc-introduction.right[data-v-0c128c90]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-0c128c90]{text-align:right}
1
+ .mc-introduction[data-v-fff875ce]{display:flex;gap:12px;flex-direction:column;color:var(--devui-text, #252b3a)}.mc-introduction .mc-introduction-logo-container[data-v-fff875ce]{display:flex;align-items:center;gap:8px}.mc-introduction .mc-introduction-logo-container .mc-introduction-title[data-v-fff875ce]{font-weight:700;font-size:32px;letter-spacing:1px}.mc-introduction .mc-introduction-sub-title[data-v-fff875ce]{font-weight:500;font-size:18px}.mc-introduction .mc-introduction-description[data-v-fff875ce]{font-size:var(--devui-font-size-sm, 12px)}.mc-introduction .mc-introduction-description>div[data-v-fff875ce]{line-height:1.5}.mc-introduction.filled[data-v-fff875ce]{background-color:var(--devui-global-bg, #f6f6f8);border-radius:8px;padding:8px 12px}.mc-introduction.center[data-v-fff875ce]{align-items:center}.mc-introduction.center .mc-introduction-description[data-v-fff875ce]{text-align:center}.mc-introduction.left[data-v-fff875ce]{align-items:flex-start}.mc-introduction.left .mc-introduction-description[data-v-fff875ce]{text-align:left}.mc-introduction.right[data-v-fff875ce]{align-items:flex-end}.mc-introduction.right .mc-introduction-description[data-v-fff875ce]{text-align:right}
@@ -0,0 +1,2 @@
1
+ import McIntroduction from './Introduction.vue.ts';
2
+ export { McIntroduction };
@@ -1,5 +1,4 @@
1
- import "./index.css";
2
- import { defineComponent as u, createElementBlock as e, openBlock as o, normalizeClass as p, createElementVNode as d, createCommentVNode as c, renderSlot as g, toDisplayString as l, Fragment as m, renderList as f } from "vue";
1
+ import { defineComponent as u, createElementBlock as e, openBlock as o, normalizeClass as p, createElementVNode as d, createCommentVNode as l, renderSlot as g, toDisplayString as c, Fragment as m, renderList as f } from "vue";
3
2
  const v = {
4
3
  logoImg: {
5
4
  type: String,
@@ -46,11 +45,11 @@ const v = {
46
45
  key: 0,
47
46
  src: t.logoImg,
48
47
  alt: t.title
49
- }, null, 8, _)) : c("v-if", !0),
48
+ }, null, 8, _)) : l("v-if", !0),
50
49
  d(
51
50
  "div",
52
51
  k,
53
- l(t.title),
52
+ c(t.title),
54
53
  1
55
54
  /* TEXT */
56
55
  )
@@ -58,10 +57,10 @@ const v = {
58
57
  t.subTitle ? (o(), e(
59
58
  "div",
60
59
  h,
61
- l(t.subTitle),
60
+ c(t.subTitle),
62
61
  1
63
62
  /* TEXT */
64
- )) : c("v-if", !0),
63
+ )) : l("v-if", !0),
65
64
  t.description.length ? (o(), e("div", I, [
66
65
  (o(!0), e(
67
66
  m,
@@ -69,14 +68,14 @@ const v = {
69
68
  f(t.description, (r, s) => (o(), e(
70
69
  "div",
71
70
  { key: s },
72
- l(r),
71
+ c(r),
73
72
  1
74
73
  /* TEXT */
75
74
  ))),
76
75
  128
77
76
  /* KEYED_FRAGMENT */
78
77
  ))
79
- ])) : c("v-if", !0),
78
+ ])) : l("v-if", !0),
80
79
  g(t.$slots, "default", {}, void 0, !0)
81
80
  ],
82
81
  2
@@ -88,7 +87,7 @@ const v = {
88
87
  for (const [r, s] of t)
89
88
  i[r] = s;
90
89
  return i;
91
- }, a = /* @__PURE__ */ b(S, [["__scopeId", "data-v-0c128c90"]]);
90
+ }, a = /* @__PURE__ */ b(S, [["__scopeId", "data-v-fff875ce"]]);
92
91
  a.install = (n) => {
93
92
  n.component("McIntroduction", a);
94
93
  };
@@ -0,0 +1,37 @@
1
+ import type { PropType } from 'vue';
2
+ export type IntroductionBackground = 'filled' | 'transparent';
3
+ export type IntroductionAlign = 'left' | 'center' | 'right';
4
+ export declare const props: {
5
+ logoImg: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ logoWidth: {
10
+ type: (StringConstructor | NumberConstructor)[];
11
+ default: string;
12
+ };
13
+ logoHeight: {
14
+ type: (StringConstructor | NumberConstructor)[];
15
+ default: string;
16
+ };
17
+ title: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ subTitle: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ description: {
26
+ type: PropType<string[]>;
27
+ default: () => never[];
28
+ };
29
+ background: {
30
+ type: PropType<IntroductionBackground>;
31
+ default: string;
32
+ };
33
+ align: {
34
+ type: PropType<IntroductionAlign>;
35
+ default: string;
36
+ };
37
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,6 @@
1
+ import McLayoutAside from './Aside.vue.ts';
2
+ import McLayoutContent from './Content.vue.ts';
3
+ import McLayoutHeader from './Header.vue.ts';
4
+ import McLayout from './Layout.vue.ts';
5
+ import McLayoutSender from './Sender.vue.ts';
6
+ export { McLayoutAside, McLayoutContent, McLayoutHeader, McLayout, McLayoutSender };
package/Layout/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./index.css";
2
1
  import { createElementBlock as n, openBlock as c, renderSlot as o } from "vue";
3
2
  const s = (e, t) => {
4
3
  const r = e.__vccOpts || e;
@@ -0,0 +1,98 @@
1
+ import { ListVariant } from './list-types';
2
+ declare var __VLS_1: {
3
+ item: import("./list-types").ListItemData;
4
+ }, __VLS_3: {
5
+ item: import("./list-types").ListItemData;
6
+ };
7
+ type __VLS_Slots = {} & {
8
+ item?: (props: typeof __VLS_1) => any;
9
+ } & {
10
+ item?: (props: typeof __VLS_3) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ direction: {
14
+ type: import("vue").PropType<import("./list-types").ListDirection>;
15
+ default: import("./list-types").ListDirection;
16
+ };
17
+ autoWrap: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ variant: {
22
+ type: import("vue").PropType<ListVariant>;
23
+ default: ListVariant;
24
+ };
25
+ enableLazyLoad: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ data: {
30
+ type: import("vue").PropType<import("./list-types").ListItemData[]>;
31
+ default: () => never[];
32
+ };
33
+ enableShortKey: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ inputEl: {
38
+ type: import("vue").PropType<HTMLElement>;
39
+ };
40
+ selectable: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
+ select: (...args: any[]) => void;
46
+ loadMore: (...args: any[]) => void;
47
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
48
+ direction: {
49
+ type: import("vue").PropType<import("./list-types").ListDirection>;
50
+ default: import("./list-types").ListDirection;
51
+ };
52
+ autoWrap: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ variant: {
57
+ type: import("vue").PropType<ListVariant>;
58
+ default: ListVariant;
59
+ };
60
+ enableLazyLoad: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ data: {
65
+ type: import("vue").PropType<import("./list-types").ListItemData[]>;
66
+ default: () => never[];
67
+ };
68
+ enableShortKey: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
72
+ inputEl: {
73
+ type: import("vue").PropType<HTMLElement>;
74
+ };
75
+ selectable: {
76
+ type: BooleanConstructor;
77
+ default: boolean;
78
+ };
79
+ }>> & Readonly<{
80
+ onSelect?: ((...args: any[]) => any) | undefined;
81
+ onLoadMore?: ((...args: any[]) => any) | undefined;
82
+ }>, {
83
+ variant: ListVariant;
84
+ data: import("./list-types").ListItemData[];
85
+ direction: import("./list-types").ListDirection;
86
+ autoWrap: boolean;
87
+ enableLazyLoad: boolean;
88
+ enableShortKey: boolean;
89
+ selectable: boolean;
90
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
91
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
92
+ declare const _default: typeof __VLS_export;
93
+ export default _default;
94
+ type __VLS_WithSlots<T, S> = T & {
95
+ new (): {
96
+ $slots: S;
97
+ };
98
+ };
@@ -0,0 +1,5 @@
1
+ export declare const LazyLoadThreshold = 50;
2
+ export declare const InputTagNames: string[];
3
+ export declare const ArrowUp = "ArrowUp";
4
+ export declare const ArrowDown = "ArrowDown";
5
+ export declare const Enter = "Enter";
package/List/index.css CHANGED
@@ -1 +1 @@
1
- .mc-list[data-v-1a543233]{width:100%;max-height:300px;box-sizing:border-box;overflow:auto}.mc-list.mc-list-horizontal .mc-list-item[data-v-1a543233]{width:unset}.mc-list:not(.mc-list-horizontal) .mc-list-item[data-v-1a543233]:not(:first-child){margin-top:4px}.mc-list .mc-list-item[data-v-1a543233]{width:100%;line-height:20px;padding:8px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);border-radius:var(--devui-border-radius, 2px);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-list .mc-list-item.filled[data-v-1a543233]{background-color:var(--devui-gray-form-control-bg, #f5f5f5)}.mc-list .mc-list-item.bordered[data-v-1a543233]{border:1px solid var(--devui-dividing-line, #f2f2f3)}.mc-list .mc-list-item[data-v-1a543233]:hover,.mc-list .mc-list-item.mc-list-item-pre-selection[data-v-1a543233]{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-list .mc-list-item.mc-list-item-active[data-v-1a543233]{color:var(--devui-list-item-active-text, #252b3a);background-color:var(--devui-list-item-active-bg, #f2f5fc)}.mc-list .mc-list-item.mc-list-item-disabled[data-v-1a543233]{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-list-horizontal[data-v-1a543233]{display:flex;flex-wrap:wrap;gap:12px}.mc-list-horizontal.mc-list-nowrap[data-v-1a543233]{flex-wrap:nowrap}.mc-list-horizontal.mc-list-nowrap .mc-list-item[data-v-1a543233]{flex:none}
1
+ .mc-list[data-v-1a543233]{width:100%;max-height:300px;box-sizing:border-box;overflow:auto}.mc-list.mc-list-horizontal .mc-list-item[data-v-1a543233]{width:unset}.mc-list:not(.mc-list-horizontal) .mc-list-item[data-v-1a543233]:not(:first-child){margin-top:4px}.mc-list .mc-list-item[data-v-1a543233]{width:100%;line-height:20px;padding:8px;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 12px);border-radius:var(--devui-border-radius, 2px);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-list .mc-list-item.filled[data-v-1a543233]{background-color:var(--devui-gray-form-control-bg, #f5f5f5)}.mc-list .mc-list-item.bordered[data-v-1a543233]{border:1px solid var(--devui-dividing-line, #f2f2f3)}.mc-list .mc-list-item[data-v-1a543233]:hover,.mc-list .mc-list-item.mc-list-item-pre-selection[data-v-1a543233]{color:var(--devui-list-item-hover-text, #252b3a);background-color:var(--devui-list-item-hover-bg, #f2f2f3)}.mc-list .mc-list-item.mc-list-item-active[data-v-1a543233]{color:var(--devui-list-item-active-text, #252b3a);background-color:var(--devui-list-item-active-bg, #f2f5fc)}.mc-list .mc-list-item.mc-list-item-disabled[data-v-1a543233]{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-list-horizontal[data-v-1a543233]{display:flex;flex-wrap:wrap;gap:12px}.mc-list-horizontal.mc-list-nowrap[data-v-1a543233]{flex-wrap:nowrap}.mc-list-horizontal.mc-list-nowrap .mc-list-item[data-v-1a543233]{flex:none}
@@ -0,0 +1,3 @@
1
+ import McList from './List.vue.ts';
2
+ export * from './list-types';
3
+ export { McList };
package/List/index.js CHANGED
@@ -1,7 +1,6 @@
1
- import "./index.css";
2
- import { computed as E, ref as L, onMounted as p, onUnmounted as w, defineComponent as z, createElementBlock as f, openBlock as v, unref as c, normalizeClass as g, Fragment as b, renderList as C, renderSlot as h, createTextVNode as T, toDisplayString as A } from "vue";
3
- var m = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(m || {}), k = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(k || {});
4
- const B = {
1
+ import { computed as E, ref as L, onMounted as p, defineComponent as w, createElementBlock as u, openBlock as f, unref as c, normalizeClass as g, Fragment as b, renderList as z, renderSlot as h, createTextVNode as C, toDisplayString as T } from "vue";
2
+ var v = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(v || {}), k = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(k || {});
3
+ const A = {
5
4
  direction: {
6
5
  type: String,
7
6
  default: "vertical"
@@ -35,87 +34,85 @@ const B = {
35
34
  type: Boolean,
36
35
  default: !0
37
36
  }
38
- }, H = 50, I = ["TEXTAREA", "INPUT"], _ = "ArrowUp", N = "ArrowDown", M = "Enter";
39
- function D(e, r) {
40
- let o;
41
- const l = L(e.enableShortKey ? 0 : -1), i = (t) => {
37
+ }, B = 50, H = ["TEXTAREA", "INPUT"], I = "ArrowUp", _ = "ArrowDown", N = "Enter";
38
+ function M(e, o) {
39
+ const n = L(e.enableShortKey ? 0 : -1), i = (t) => {
42
40
  if (!t.disabled) {
43
41
  if (e.selectable)
44
- for (let n = 0; n < e.data.length; n++)
45
- e.data[n].active = e.data[n].value === t.value;
46
- r("select", { ...t });
42
+ for (let l = 0; l < e.data.length; l++)
43
+ e.data[l].active = e.data[l].value === t.value;
44
+ o("select", { ...t });
47
45
  }
48
- }, y = (t) => {
49
- if (!e.enableLazyLoad || e.direction !== m.Vertical)
50
- return;
51
- const n = t.target, d = n.scrollHeight, a = n.clientHeight, u = n.scrollTop;
52
- d - a - u < H && r("loadMore", t);
53
46
  }, s = (t) => {
54
- t.code === _ && (l.value = l.value === 0 ? e.data.length - 1 : l.value - 1), t.code === N && (l.value = l.value === e.data.length - 1 ? 0 : l.value + 1), t.code === M && e.selectable && i(e.data[l.value]);
47
+ if (!e.enableLazyLoad || e.direction !== v.Vertical)
48
+ return;
49
+ const l = t.target, r = l.scrollHeight, d = l.clientHeight, a = l.scrollTop;
50
+ r - d - a < B && o("loadMore", t);
51
+ }, m = (t) => {
52
+ t.code === I && (n.value = n.value === 0 ? e.data.length - 1 : n.value - 1), t.code === _ && (n.value = n.value === e.data.length - 1 ? 0 : n.value + 1), t.code === N && (e.selectable && (e.data[n.value].active = !0), o("select", { ...e.data[n.value] }));
55
53
  };
56
54
  return p(() => {
55
+ let t;
57
56
  if (e.inputEl) {
58
- const t = e.inputEl.$el ?? e.inputEl;
59
- I.includes(t.tagName) ? o = t : o = t.querySelector("textarea") || t.querySelector("input") || document;
57
+ const l = e.inputEl.$el ?? e.inputEl;
58
+ H.includes(l.tagName) ? t = l : t = l.querySelector("textarea") || l.querySelector("input") || document;
60
59
  } else
61
- o = document;
62
- e.enableShortKey && o.addEventListener("keydown", s);
63
- }), w(() => {
64
- o.removeEventListener("keydown", s);
65
- }), { preSelectIndex: l, onItemClick: i, onListScroll: y };
60
+ t = document;
61
+ e.enableShortKey && t.addEventListener("keydown", m);
62
+ }), { preSelectIndex: n, onItemClick: i, onListScroll: s };
66
63
  }
67
- function K(e) {
64
+ function D(e) {
68
65
  return { listClasses: E(() => ({
69
66
  "mc-list": !0,
70
- "mc-list-horizontal": e.direction === m.Horizontal,
71
- "mc-list-nowrap": e.direction === m.Horizontal && !e.autoWrap
67
+ "mc-list-horizontal": e.direction === v.Horizontal,
68
+ "mc-list-nowrap": e.direction === v.Horizontal && !e.autoWrap
72
69
  })) };
73
70
  }
74
- const U = ["onClick"], $ = /* @__PURE__ */ z({
71
+ const K = ["onClick"], U = /* @__PURE__ */ w({
75
72
  __name: "List",
76
- props: B,
73
+ props: A,
77
74
  emits: ["select", "loadMore"],
78
- setup(e, { emit: r }) {
79
- const o = e, l = r, { listClasses: i } = K(o), { preSelectIndex: y, onItemClick: s, onListScroll: t } = D(o, l);
80
- return (n, d) => (v(), f(
75
+ setup(e, { emit: o }) {
76
+ const n = e, i = o, { listClasses: s } = D(n), { preSelectIndex: m, onItemClick: t, onListScroll: l } = M(n, i);
77
+ return (r, d) => (f(), u(
81
78
  "div",
82
79
  {
83
- class: g(c(i)),
80
+ class: g(c(s)),
84
81
  onScroll: d[0] || (d[0] = //@ts-ignore
85
- (...a) => c(t) && c(t)(...a))
82
+ (...a) => c(l) && c(l)(...a))
86
83
  },
87
84
  [
88
- (v(!0), f(
85
+ (f(!0), u(
89
86
  b,
90
87
  null,
91
- C(n.data, (a, u) => (v(), f(
88
+ z(r.data, (a, y) => (f(), u(
92
89
  b,
93
- { key: u },
90
+ { key: y },
94
91
  [
95
- n.variant === c(k).None ? h(n.$slots, "item", {
92
+ r.variant === c(k).None ? h(r.$slots, "item", {
96
93
  key: 0,
97
94
  item: a
98
- }, void 0, !0) : (v(), f("div", {
95
+ }, void 0, !0) : (f(), u("div", {
99
96
  key: 1,
100
97
  class: g([
101
98
  "mc-list-item",
102
99
  {
103
100
  "mc-list-item-disabled": a.disabled,
104
101
  "mc-list-item-active": a.active,
105
- "mc-list-item-pre-selection": u === c(y)
102
+ "mc-list-item-pre-selection": y === c(m)
106
103
  },
107
- n.variant
104
+ r.variant
108
105
  ]),
109
- onClick: () => c(s)(a)
106
+ onClick: () => c(t)(a)
110
107
  }, [
111
- h(n.$slots, "item", { item: a }, () => [
112
- T(
113
- A(a.label),
108
+ h(r.$slots, "item", { item: a }, () => [
109
+ C(
110
+ T(a.label),
114
111
  1
115
112
  /* TEXT */
116
113
  )
117
114
  ], !0)
118
- ], 10, U))
115
+ ], 10, K))
119
116
  ],
120
117
  64
121
118
  /* STABLE_FRAGMENT */
@@ -128,18 +125,18 @@ const U = ["onClick"], $ = /* @__PURE__ */ z({
128
125
  /* CLASS, NEED_HYDRATION */
129
126
  ));
130
127
  }
131
- }), q = (e, r) => {
132
- const o = e.__vccOpts || e;
133
- for (const [l, i] of r)
134
- o[l] = i;
135
- return o;
136
- }, S = /* @__PURE__ */ q($, [["__scopeId", "data-v-1a543233"]]);
128
+ }), $ = (e, o) => {
129
+ const n = e.__vccOpts || e;
130
+ for (const [i, s] of o)
131
+ n[i] = s;
132
+ return n;
133
+ }, S = /* @__PURE__ */ $(U, [["__scopeId", "data-v-1a543233"]]);
137
134
  S.install = (e) => {
138
135
  e.component("McList", S);
139
136
  };
140
137
  export {
141
- m as ListDirection,
138
+ v as ListDirection,
142
139
  k as ListVariant,
143
140
  S as McList,
144
- B as listProps
141
+ A as listProps
145
142
  };
@@ -0,0 +1,52 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ export declare enum ListDirection {
3
+ Horizontal = "horizontal",
4
+ Vertical = "vertical"
5
+ }
6
+ export declare enum ListVariant {
7
+ Transparent = "transparent",
8
+ Filled = "filled",
9
+ Bordered = "bordered",
10
+ None = "none"
11
+ }
12
+ export interface ListItemData {
13
+ label: string;
14
+ value: string | number;
15
+ disabled?: boolean;
16
+ active?: boolean;
17
+ [key: string]: any;
18
+ }
19
+ export declare const listProps: {
20
+ direction: {
21
+ type: PropType<ListDirection>;
22
+ default: ListDirection;
23
+ };
24
+ autoWrap: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ variant: {
29
+ type: PropType<ListVariant>;
30
+ default: ListVariant;
31
+ };
32
+ enableLazyLoad: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ data: {
37
+ type: PropType<ListItemData[]>;
38
+ default: () => never[];
39
+ };
40
+ enableShortKey: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ inputEl: {
45
+ type: PropType<HTMLElement>;
46
+ };
47
+ selectable: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ };
52
+ export type ListProps = ExtractPropTypes<typeof listProps>;
@@ -0,0 +1,13 @@
1
+ import type { ListProps, ListItemData } from './list-types';
2
+ export declare function useList(props: ListProps, emits: (event: 'select' | 'loadMore', ...args: any[]) => void): {
3
+ preSelectIndex: import("vue").Ref<number, number>;
4
+ onItemClick: (item: ListItemData) => void;
5
+ onListScroll: (e: Event) => void;
6
+ };
7
+ export declare function useListRender(props: ListProps): {
8
+ listClasses: import("vue").ComputedRef<{
9
+ 'mc-list': boolean;
10
+ 'mc-list-horizontal': boolean;
11
+ 'mc-list-nowrap': boolean;
12
+ }>;
13
+ };
@@ -0,0 +1,21 @@
1
+ export type LocaleMessages = Record<string, any>;
2
+ export interface McI18nOptions {
3
+ locale: string;
4
+ messages: LocaleMessages;
5
+ }
6
+ export declare function createMcI18n(options: McI18nOptions): McI18n;
7
+ export declare class McI18n {
8
+ locale: import("vue").Ref<string, string>;
9
+ messages: LocaleMessages;
10
+ constructor(options: McI18nOptions);
11
+ /** 切换语言 */
12
+ use: (locale: string) => void;
13
+ /** 翻译函数 */
14
+ t: (path: string, params?: {}) => any;
15
+ /** 覆盖、合并国际化翻译 */
16
+ mergeLocaleMessages: (locale: string, messages: LocaleMessages) => LocaleMessages;
17
+ }
18
+ export declare function get(path: string, params: any, messages: LocaleMessages): any;
19
+ export declare function deepMerge(target: LocaleMessages, source: LocaleMessages): {
20
+ [x: string]: any;
21
+ };