vue-element-ui-x 0.2.2 → 1.0.2

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 (97) hide show
  1. package/lib/components/Attachments/index.js +18 -18
  2. package/lib/components/Bubble/index.js +145 -155
  3. package/lib/components/BubbleList/index.js +180 -207
  4. package/lib/components/Conversations/index.js +14370 -14370
  5. package/lib/components/FilesCard/index.js +5 -5
  6. package/lib/components/Prompts/index.js +25 -25
  7. package/lib/components/Sender/index.js +1606 -1459
  8. package/lib/components/Thinking/index.js +157 -23
  9. package/lib/components/ThoughtChain/index.js +143 -144
  10. package/lib/components/Typewriter/index.js +124 -125
  11. package/lib/components/Welcome/index.js +5 -5
  12. package/lib/index.common.js +1 -1
  13. package/lib/index.esm.js +1 -1
  14. package/lib/index.js +817 -389
  15. package/lib/index.umd.js +1 -1
  16. package/lib/locale/index.js +97 -0
  17. package/lib/locale/lang/ar-SA.js +18 -0
  18. package/lib/locale/lang/ar-SA.umd.js +26 -0
  19. package/lib/locale/lang/ar.js +18 -0
  20. package/lib/locale/lang/ar.umd.js +26 -0
  21. package/lib/locale/lang/de-DE.js +18 -0
  22. package/lib/locale/lang/de-DE.umd.js +26 -0
  23. package/lib/locale/lang/de.js +18 -0
  24. package/lib/locale/lang/de.umd.js +26 -0
  25. package/lib/locale/lang/en.js +18 -0
  26. package/lib/locale/lang/en.umd.js +26 -0
  27. package/lib/locale/lang/es-ES.js +18 -0
  28. package/lib/locale/lang/es-ES.umd.js +26 -0
  29. package/lib/locale/lang/es.js +18 -0
  30. package/lib/locale/lang/es.umd.js +26 -0
  31. package/lib/locale/lang/fr-FR.js +18 -0
  32. package/lib/locale/lang/fr-FR.umd.js +26 -0
  33. package/lib/locale/lang/fr.js +18 -0
  34. package/lib/locale/lang/fr.umd.js +26 -0
  35. package/lib/locale/lang/index.js +50 -0
  36. package/lib/locale/lang/it-IT.js +18 -0
  37. package/lib/locale/lang/it-IT.umd.js +26 -0
  38. package/lib/locale/lang/it.js +18 -0
  39. package/lib/locale/lang/it.umd.js +26 -0
  40. package/lib/locale/lang/ja-JP.js +18 -0
  41. package/lib/locale/lang/ja-JP.umd.js +26 -0
  42. package/lib/locale/lang/ja.js +18 -0
  43. package/lib/locale/lang/ja.umd.js +26 -0
  44. package/lib/locale/lang/ko-KR.js +18 -0
  45. package/lib/locale/lang/ko-KR.umd.js +26 -0
  46. package/lib/locale/lang/ko.js +18 -0
  47. package/lib/locale/lang/ko.umd.js +26 -0
  48. package/lib/locale/lang/pt-BR.js +18 -0
  49. package/lib/locale/lang/pt-BR.umd.js +26 -0
  50. package/lib/locale/lang/ru-RU.js +18 -0
  51. package/lib/locale/lang/ru-RU.umd.js +26 -0
  52. package/lib/locale/lang/zh-CN.js +18 -0
  53. package/lib/locale/lang/zh-CN.umd.js +26 -0
  54. package/lib/locale/lang/zh-TW.js +18 -0
  55. package/lib/locale/lang/zh-TW.umd.js +26 -0
  56. package/lib/locale/mixin.js +9 -0
  57. package/package.json +15 -10
  58. package/src/components/Attachments/src/main.vue +2 -10
  59. package/src/components/Bubble/src/main.vue +288 -299
  60. package/src/components/BubbleList/src/main.vue +2 -19
  61. package/src/components/Conversations/src/main.vue +0 -41
  62. package/src/components/Prompts/src/main.vue +248 -248
  63. package/src/components/Sender/src/components/LoadingButton.vue +37 -39
  64. package/src/components/Sender/src/components/SpeechLoadingButton.vue +41 -43
  65. package/src/components/Sender/src/main.vue +13 -3
  66. package/src/components/Thinking/src/main.vue +13 -9
  67. package/src/components/ThoughtChain/src/main.vue +1 -3
  68. package/src/components/Typewriter/src/main.vue +3 -7
  69. package/src/components/Welcome/src/main.vue +151 -151
  70. package/src/index.js +23 -6
  71. package/src/locale/index.js +97 -0
  72. package/src/locale/lang/ar.js +18 -0
  73. package/src/locale/lang/de.js +18 -0
  74. package/src/locale/lang/en.js +18 -0
  75. package/src/locale/lang/es.js +18 -0
  76. package/src/locale/lang/fr.js +18 -0
  77. package/src/locale/lang/index.js +62 -0
  78. package/src/locale/lang/it.js +18 -0
  79. package/src/locale/lang/ja.js +18 -0
  80. package/src/locale/lang/ko.js +18 -0
  81. package/src/locale/lang/pt-br.js +18 -0
  82. package/src/locale/lang/ru-RU.js +18 -0
  83. package/src/locale/lang/zh-CN.js +18 -0
  84. package/src/locale/lang/zh-TW.js +18 -0
  85. package/src/locale/mixin.js +9 -0
  86. package/src/styles/Attachments.scss +236 -236
  87. package/src/styles/Bubble.scss +5 -4
  88. package/src/styles/BubbleList.scss +148 -148
  89. package/src/styles/Conversations.scss +260 -260
  90. package/src/styles/FilesCard.scss +222 -221
  91. package/src/styles/Prompts.scss +197 -195
  92. package/src/styles/Sender.scss +207 -199
  93. package/src/styles/Thinking.scss +36 -6
  94. package/src/styles/ThoughtChain.scss +113 -113
  95. package/src/styles/Typewriter.scss +66 -66
  96. package/src/styles/var.scss +4 -5
  97. package/src/theme/var.scss +183 -72
@@ -583,46 +583,5 @@
583
583
  </script>
584
584
 
585
585
  <style lang="scss">
586
- // 引入外部样式文件
587
586
  @import '../../../styles/Conversations.scss';
588
-
589
- /* 自定义滚动条样式 */
590
- .el-x-conversations-scrollbar {
591
- height: 100%;
592
- overflow-y: auto;
593
-
594
- /* 隐藏默认滚动条 */
595
- &::-webkit-scrollbar {
596
- width: 6px;
597
- }
598
-
599
- &::-webkit-scrollbar-thumb {
600
- background-color: transparent;
601
- border-radius: 3px;
602
- transition: background-color 0.3s ease;
603
- }
604
-
605
- &::-webkit-scrollbar-track {
606
- background-color: transparent;
607
- }
608
-
609
- /* 鼠标悬停时显示滚动条 */
610
- &:hover {
611
- &::-webkit-scrollbar-thumb {
612
- background-color: #e0e0e0;
613
- }
614
- }
615
- }
616
-
617
- /* 为Firefox添加滚动条样式 */
618
- @supports (scrollbar-width: thin) {
619
- .el-x-conversations-scrollbar {
620
- scrollbar-width: thin;
621
- scrollbar-color: transparent transparent;
622
-
623
- &:hover {
624
- scrollbar-color: #e0e0e0 transparent;
625
- }
626
- }
627
- }
628
587
  </style>
@@ -1,248 +1,248 @@
1
- <template>
2
- <div
3
- :class="['el-x-prompts', { 'el-x-prompts-rtl': direction === 'rtl' }, rootClassName]"
4
- :style="customStyle"
5
- >
6
- <!-- 标题 -->
7
- <h5
8
- v-if="title"
9
- class="el-x-prompts-title"
10
- :class="[classNames.title]"
11
- :style="titleStyle"
12
- >
13
- {{ title }}
14
- </h5>
15
-
16
- <!-- 提示列表 -->
17
- <div
18
- :class="[
19
- 'el-x-prompts-list',
20
- {
21
- 'el-x-prompts-list-wrap': wrap,
22
- 'el-x-prompts-list-vertical': vertical,
23
- },
24
- classNames.list,
25
- ]"
26
- :style="listStyle"
27
- >
28
- <div
29
- v-for="(info, index) in items"
30
- :key="info.key || `key_${index}`"
31
- :class="[
32
- 'el-x-prompts-item',
33
- {
34
- 'el-x-prompts-item-disabled': info.disabled,
35
- 'el-x-prompts-item-has-nest': hasChildren(info),
36
- },
37
- classNames.item,
38
- ]"
39
- :style="itemStyle"
40
- @click="handleItemClick(info)"
41
- >
42
- <!-- 图标 -->
43
- <div
44
- v-if="info.icon"
45
- class="el-x-prompts-icon"
46
- >
47
- <slot
48
- name="icon"
49
- :item="info"
50
- >
51
- <i :class="info.icon"></i>
52
- </slot>
53
- </div>
54
-
55
- <!-- 内容 -->
56
- <div
57
- :class="['el-x-prompts-content', classNames.itemContent]"
58
- :style="itemContentStyle"
59
- >
60
- <!-- 标签 -->
61
- <h6
62
- v-if="info.label"
63
- class="el-x-prompts-label"
64
- >
65
- <slot
66
- name="label"
67
- :item="info"
68
- >{{ info.label }}</slot
69
- >
70
- </h6>
71
-
72
- <!-- 描述 -->
73
- <p
74
- v-if="info.description"
75
- class="el-x-prompts-desc"
76
- >
77
- <slot
78
- name="description"
79
- :item="info"
80
- >{{ info.description }}</slot
81
- >
82
- </p>
83
-
84
- <!-- 子项 -->
85
- <component
86
- :is="$options.name"
87
- v-if="hasChildren(info)"
88
- class="el-x-prompts-nested"
89
- :items="info.children"
90
- :vertical="true"
91
- @on-item-click="$emit('on-item-click', $event)"
92
- :class-names="{
93
- list: classNames.subList,
94
- item: classNames.subItem,
95
- }"
96
- :styles="{
97
- list: styles.subList,
98
- item: styles.subItem,
99
- }"
100
- />
101
- </div>
102
- </div>
103
- </div>
104
- </div>
105
- </template>
106
-
107
- <script>
108
- export default {
109
- name: 'ElXPrompts',
110
-
111
- props: {
112
- /**
113
- * 包含多个提示项的列表
114
- */
115
- items: {
116
- type: Array,
117
- default: () => [],
118
- },
119
-
120
- /**
121
- * 显示在提示列表顶部的标题
122
- */
123
- title: {
124
- type: String,
125
- default: '',
126
- },
127
-
128
- /**
129
- * Item 提示项被点击时的回调函数
130
- */
131
- onItemClick: {
132
- type: Function,
133
- default: null,
134
- },
135
-
136
- /**
137
- * 提示列表是否垂直排列
138
- */
139
- vertical: {
140
- type: Boolean,
141
- default: false,
142
- },
143
-
144
- /**
145
- * 提示列表是否换行
146
- */
147
- wrap: {
148
- type: Boolean,
149
- default: false,
150
- },
151
-
152
- /**
153
- * 自定义样式,用于各个提示项的不同部分
154
- */
155
- styles: {
156
- type: Object,
157
- default: () => ({}),
158
- },
159
-
160
- /**
161
- * 自定义样式类名,用于各个提示项的不同部分
162
- */
163
- classNames: {
164
- type: Object,
165
- default: () => ({}),
166
- },
167
-
168
- /**
169
- * 根节点的样式类名
170
- */
171
- rootClassName: {
172
- type: String,
173
- default: '',
174
- },
175
-
176
- /**
177
- * 自定义样式
178
- */
179
- customStyle: {
180
- type: Object,
181
- default: () => ({}),
182
- },
183
-
184
- /**
185
- * 方向
186
- */
187
- direction: {
188
- type: String,
189
- default: 'ltr',
190
- },
191
- },
192
-
193
- computed: {
194
- titleStyle() {
195
- return {
196
- ...this.styles.title,
197
- };
198
- },
199
-
200
- listStyle() {
201
- return {
202
- ...this.styles.list,
203
- };
204
- },
205
-
206
- itemStyle() {
207
- return {
208
- ...this.styles.item,
209
- };
210
- },
211
-
212
- itemContentStyle() {
213
- return {
214
- ...this.styles.itemContent,
215
- };
216
- },
217
- },
218
-
219
- methods: {
220
- hasChildren(item) {
221
- return item.children && item.children.length > 0;
222
- },
223
-
224
- handleItemClick(info) {
225
- if (info.disabled) {
226
- return;
227
- }
228
- // 如果有子项,不触发点击事件
229
- if (this.hasChildren(info)) {
230
- return;
231
- }
232
- this.$emit('on-item-click', {
233
- data: info,
234
- });
235
- // 向后兼容性
236
- if (this.onItemClick) {
237
- this.onItemClick({
238
- data: info,
239
- });
240
- }
241
- },
242
- },
243
- };
244
- </script>
245
-
246
- <style lang="scss" scoped>
247
- @import '../../../styles/Prompts.scss';
248
- </style>
1
+ <template>
2
+ <div
3
+ :class="['el-x-prompts', { 'el-x-prompts-rtl': direction === 'rtl' }, rootClassName]"
4
+ :style="customStyle"
5
+ >
6
+ <!-- 标题 -->
7
+ <h5
8
+ v-if="title"
9
+ class="el-x-prompts-title"
10
+ :class="[classNames.title]"
11
+ :style="titleStyle"
12
+ >
13
+ {{ title }}
14
+ </h5>
15
+
16
+ <!-- 提示列表 -->
17
+ <div
18
+ :class="[
19
+ 'el-x-prompts-list',
20
+ {
21
+ 'el-x-prompts-list-wrap': wrap,
22
+ 'el-x-prompts-list-vertical': vertical,
23
+ },
24
+ classNames.list,
25
+ ]"
26
+ :style="listStyle"
27
+ >
28
+ <div
29
+ v-for="(info, index) in items"
30
+ :key="info.key || `key_${index}`"
31
+ :class="[
32
+ 'el-x-prompts-item',
33
+ {
34
+ 'el-x-prompts-item-disabled': info.disabled,
35
+ 'el-x-prompts-item-has-nest': hasChildren(info),
36
+ },
37
+ classNames.item,
38
+ ]"
39
+ :style="itemStyle"
40
+ @click="handleItemClick(info)"
41
+ >
42
+ <!-- 图标 -->
43
+ <div
44
+ v-if="info.icon"
45
+ class="el-x-prompts-icon"
46
+ >
47
+ <slot
48
+ name="icon"
49
+ :item="info"
50
+ >
51
+ <i :class="info.icon"></i>
52
+ </slot>
53
+ </div>
54
+
55
+ <!-- 内容 -->
56
+ <div
57
+ :class="['el-x-prompts-content', classNames.itemContent]"
58
+ :style="itemContentStyle"
59
+ >
60
+ <!-- 标签 -->
61
+ <h6
62
+ v-if="info.label"
63
+ class="el-x-prompts-label"
64
+ >
65
+ <slot
66
+ name="label"
67
+ :item="info"
68
+ >{{ info.label }}</slot
69
+ >
70
+ </h6>
71
+
72
+ <!-- 描述 -->
73
+ <p
74
+ v-if="info.description"
75
+ class="el-x-prompts-desc"
76
+ >
77
+ <slot
78
+ name="description"
79
+ :item="info"
80
+ >{{ info.description }}</slot
81
+ >
82
+ </p>
83
+
84
+ <!-- 子项 -->
85
+ <component
86
+ :is="$options.name"
87
+ v-if="hasChildren(info)"
88
+ class="el-x-prompts-nested"
89
+ :items="info.children"
90
+ :vertical="true"
91
+ @on-item-click="$emit('on-item-click', $event)"
92
+ :class-names="{
93
+ list: classNames.subList,
94
+ item: classNames.subItem,
95
+ }"
96
+ :styles="{
97
+ list: styles.subList,
98
+ item: styles.subItem,
99
+ }"
100
+ />
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </template>
106
+
107
+ <script>
108
+ export default {
109
+ name: 'ElXPrompts',
110
+
111
+ props: {
112
+ /**
113
+ * 包含多个提示项的列表
114
+ */
115
+ items: {
116
+ type: Array,
117
+ default: () => [],
118
+ },
119
+
120
+ /**
121
+ * 显示在提示列表顶部的标题
122
+ */
123
+ title: {
124
+ type: String,
125
+ default: '',
126
+ },
127
+
128
+ /**
129
+ * Item 提示项被点击时的回调函数
130
+ */
131
+ onItemClick: {
132
+ type: Function,
133
+ default: null,
134
+ },
135
+
136
+ /**
137
+ * 提示列表是否垂直排列
138
+ */
139
+ vertical: {
140
+ type: Boolean,
141
+ default: false,
142
+ },
143
+
144
+ /**
145
+ * 提示列表是否换行
146
+ */
147
+ wrap: {
148
+ type: Boolean,
149
+ default: false,
150
+ },
151
+
152
+ /**
153
+ * 自定义样式,用于各个提示项的不同部分
154
+ */
155
+ styles: {
156
+ type: Object,
157
+ default: () => ({}),
158
+ },
159
+
160
+ /**
161
+ * 自定义样式类名,用于各个提示项的不同部分
162
+ */
163
+ classNames: {
164
+ type: Object,
165
+ default: () => ({}),
166
+ },
167
+
168
+ /**
169
+ * 根节点的样式类名
170
+ */
171
+ rootClassName: {
172
+ type: String,
173
+ default: '',
174
+ },
175
+
176
+ /**
177
+ * 自定义样式
178
+ */
179
+ customStyle: {
180
+ type: Object,
181
+ default: () => ({}),
182
+ },
183
+
184
+ /**
185
+ * 方向
186
+ */
187
+ direction: {
188
+ type: String,
189
+ default: 'ltr',
190
+ },
191
+ },
192
+
193
+ computed: {
194
+ titleStyle() {
195
+ return {
196
+ ...this.styles.title,
197
+ };
198
+ },
199
+
200
+ listStyle() {
201
+ return {
202
+ ...this.styles.list,
203
+ };
204
+ },
205
+
206
+ itemStyle() {
207
+ return {
208
+ ...this.styles.item,
209
+ };
210
+ },
211
+
212
+ itemContentStyle() {
213
+ return {
214
+ ...this.styles.itemContent,
215
+ };
216
+ },
217
+ },
218
+
219
+ methods: {
220
+ hasChildren(item) {
221
+ return item.children && item.children.length > 0;
222
+ },
223
+
224
+ handleItemClick(info) {
225
+ if (info.disabled) {
226
+ return;
227
+ }
228
+ // 如果有子项,不触发点击事件
229
+ if (this.hasChildren(info)) {
230
+ return;
231
+ }
232
+ this.$emit('on-item-click', {
233
+ data: info,
234
+ });
235
+ // 向后兼容性
236
+ if (this.onItemClick) {
237
+ this.onItemClick({
238
+ data: info,
239
+ });
240
+ }
241
+ },
242
+ },
243
+ };
244
+ </script>
245
+
246
+ <style lang="scss" scoped>
247
+ @import '../../../styles/Prompts.scss';
248
+ </style>
@@ -1,39 +1,37 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- @click="$emit('cancel')"
6
- size="small"
7
- >
8
- <loading class="loading-svg" />
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import Loading from './Loading.vue';
15
-
16
- export default {
17
- name: 'LoadingButton',
18
- components: {
19
- Loading,
20
- },
21
- };
22
- </script>
23
-
24
- <style scoped lang="scss">
25
- @import '~element-ui/packages/theme-chalk/src/common/var';
26
-
27
- .el-x-send-button {
28
- height: 32px;
29
- .el-button {
30
- padding: 0;
31
- width: 32px;
32
- height: 32px;
33
- }
34
- .loading-svg {
35
- color: $--color-primary;
36
- width: 100%;
37
- }
38
- }
39
- </style>
1
+ <template>
2
+ <div class="el-x-send-button">
3
+ <el-button
4
+ circle
5
+ @click="$emit('cancel')"
6
+ size="small"
7
+ >
8
+ <loading class="loading-svg" />
9
+ </el-button>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import Loading from './Loading.vue';
15
+
16
+ export default {
17
+ name: 'LoadingButton',
18
+ components: { Loading },
19
+ };
20
+ </script>
21
+
22
+ <style scoped lang="scss">
23
+ @import '../../../../theme/var.scss';
24
+
25
+ .el-x-send-button {
26
+ height: 32px;
27
+ .el-button {
28
+ padding: 0;
29
+ width: 32px;
30
+ height: 32px;
31
+ }
32
+ .loading-svg {
33
+ color: $--color-primary;
34
+ width: 100%;
35
+ }
36
+ }
37
+ </style>