vue-element-ui-x 0.2.0 → 0.2.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 (71) hide show
  1. package/README.md +8 -8
  2. package/lib/components/Attachments/index.js +2 -2
  3. package/lib/components/Bubble/index.js +23 -28
  4. package/lib/components/BubbleList/index.js +24 -29
  5. package/lib/components/Conversations/index.js +17 -9
  6. package/lib/components/FilesCard/index.js +1 -1
  7. package/lib/components/Prompts/index.js +21 -21
  8. package/lib/components/Sender/index.js +4 -4
  9. package/lib/components/Thinking/index.js +1 -1
  10. package/lib/components/ThoughtChain/index.js +23 -28
  11. package/lib/components/Typewriter/index.js +22 -27
  12. package/lib/components/Welcome/index.js +1 -1
  13. package/lib/index.common.js +1 -1
  14. package/lib/index.esm.js +1 -1
  15. package/lib/index.js +73 -73
  16. package/lib/index.umd.js +1 -1
  17. package/package.json +1 -1
  18. package/src/components/Attachments/index.js +8 -8
  19. package/src/components/Bubble/index.js +6 -6
  20. package/src/components/Bubble/src/main.vue +299 -299
  21. package/src/components/BubbleList/index.js +8 -8
  22. package/src/components/BubbleList/src/loading.vue +75 -75
  23. package/src/components/Conversations/index.js +8 -8
  24. package/src/components/Conversations/src/main.vue +9 -3
  25. package/src/components/FilesCard/index.js +8 -8
  26. package/src/components/FilesCard/src/fileSvg/audio.vue +38 -38
  27. package/src/components/FilesCard/src/fileSvg/code.vue +35 -35
  28. package/src/components/FilesCard/src/fileSvg/database.vue +94 -94
  29. package/src/components/FilesCard/src/fileSvg/excel.vue +38 -38
  30. package/src/components/FilesCard/src/fileSvg/file.vue +40 -40
  31. package/src/components/FilesCard/src/fileSvg/image.vue +40 -40
  32. package/src/components/FilesCard/src/fileSvg/index.js +46 -46
  33. package/src/components/FilesCard/src/fileSvg/link.vue +54 -54
  34. package/src/components/FilesCard/src/fileSvg/mark.vue +38 -38
  35. package/src/components/FilesCard/src/fileSvg/pdf.vue +38 -38
  36. package/src/components/FilesCard/src/fileSvg/ppt.vue +38 -38
  37. package/src/components/FilesCard/src/fileSvg/three.vue +38 -38
  38. package/src/components/FilesCard/src/fileSvg/txt.vue +38 -38
  39. package/src/components/FilesCard/src/fileSvg/unknown.vue +54 -54
  40. package/src/components/FilesCard/src/fileSvg/video.vue +38 -38
  41. package/src/components/FilesCard/src/fileSvg/word.vue +38 -38
  42. package/src/components/FilesCard/src/fileSvg/zip.vue +38 -38
  43. package/src/components/FilesCard/src/options.js +18 -18
  44. package/src/components/Prompts/index.js +8 -8
  45. package/src/components/Prompts/src/main.vue +248 -248
  46. package/src/components/Sender/index.js +8 -8
  47. package/src/components/Sender/src/components/ClearButton.vue +28 -28
  48. package/src/components/Sender/src/components/Loading.vue +53 -53
  49. package/src/components/Sender/src/components/LoadingButton.vue +39 -39
  50. package/src/components/Sender/src/components/SendButton.vue +26 -26
  51. package/src/components/Sender/src/components/SpeechButton.vue +24 -24
  52. package/src/components/Sender/src/components/SpeechLoading.vue +87 -87
  53. package/src/components/Sender/src/components/SpeechLoadingButton.vue +43 -43
  54. package/src/components/Thinking/index.js +8 -8
  55. package/src/components/ThoughtChain/index.js +8 -8
  56. package/src/components/Typewriter/index.js +8 -8
  57. package/src/components/Welcome/index.js +8 -8
  58. package/src/components/Welcome/src/main.vue +151 -151
  59. package/src/index.js +3 -6
  60. package/src/styles/Attachments.scss +236 -236
  61. package/src/styles/BubbleList.scss +148 -148
  62. package/src/styles/Conversations.scss +260 -260
  63. package/src/styles/FilesCard.scss +221 -221
  64. package/src/styles/Prompts.scss +195 -195
  65. package/src/styles/Sender.scss +199 -199
  66. package/src/styles/ThoughtChain.scss +113 -113
  67. package/src/styles/Typewriter.scss +66 -66
  68. package/src/styles/button.scss +302 -0
  69. package/src/styles/var.scss +1052 -0
  70. package/src/theme/var.scss +72 -72
  71. package/lib/components/Think/index.js +0 -799
@@ -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,8 +1,8 @@
1
- import ElXSender from './src/main.vue';
2
-
3
- /* istanbul ignore next */
4
- ElXSender.install = function (Vue) {
5
- Vue.component(ElXSender.name, ElXSender);
6
- };
7
-
8
- export default ElXSender;
1
+ import ElXSender from './src/main.vue';
2
+
3
+ /* istanbul ignore next */
4
+ ElXSender.install = function (Vue) {
5
+ Vue.component(ElXSender.name, ElXSender);
6
+ };
7
+
8
+ export default ElXSender;
@@ -1,28 +1,28 @@
1
- <template>
2
- <div class="el-x-send-button">
3
- <el-button
4
- circle
5
- @click="$emit('clear')"
6
- size="small"
7
- >
8
- <i class="el-icon-brush"></i>
9
- </el-button>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- export default {
15
- name: 'ClearButton',
16
- };
17
- </script>
18
-
19
- <style scoped lang="scss">
20
- .el-x-send-button {
21
- .el-button {
22
- .el-icon-brush {
23
- // 旋转180
24
- transform: rotate(180deg);
25
- }
26
- }
27
- }
28
- </style>
1
+ <template>
2
+ <div class="el-x-send-button">
3
+ <el-button
4
+ circle
5
+ @click="$emit('clear')"
6
+ size="small"
7
+ >
8
+ <i class="el-icon-brush"></i>
9
+ </el-button>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'ClearButton',
16
+ };
17
+ </script>
18
+
19
+ <style scoped lang="scss">
20
+ .el-x-send-button {
21
+ .el-button {
22
+ .el-icon-brush {
23
+ // 旋转180
24
+ transform: rotate(180deg);
25
+ }
26
+ }
27
+ }
28
+ </style>
@@ -1,53 +1,53 @@
1
- <template>
2
- <svg
3
- viewBox="0 0 1000 1000"
4
- xmlns="http://www.w3.org/2000/svg"
5
- xmlns:xlink="http://www.w3.org/1999/xlink"
6
- >
7
- <title>Loading</title>
8
- <rect
9
- fill="currentColor"
10
- height="250"
11
- rx="24"
12
- ry="24"
13
- width="250"
14
- x="375"
15
- y="375"
16
- />
17
- <circle
18
- cx="500"
19
- cy="500"
20
- fill="none"
21
- r="450"
22
- stroke="currentColor"
23
- stroke-width="100"
24
- opacity="0.45"
25
- />
26
- <circle
27
- cx="500"
28
- cy="500"
29
- fill="none"
30
- r="450"
31
- stroke="currentColor"
32
- stroke-width="100"
33
- stroke-dasharray="600 9999999"
34
- >
35
- <animateTransform
36
- attributeName="transform"
37
- dur="1s"
38
- from="0 500 500"
39
- repeatCount="indefinite"
40
- to="360 500 500"
41
- type="rotate"
42
- />
43
- </circle>
44
- </svg>
45
- </template>
46
-
47
- <script>
48
- export default {
49
- name: 'Loading',
50
- };
51
- </script>
52
-
53
- <style scoped></style>
1
+ <template>
2
+ <svg
3
+ viewBox="0 0 1000 1000"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ xmlns:xlink="http://www.w3.org/1999/xlink"
6
+ >
7
+ <title>Loading</title>
8
+ <rect
9
+ fill="currentColor"
10
+ height="250"
11
+ rx="24"
12
+ ry="24"
13
+ width="250"
14
+ x="375"
15
+ y="375"
16
+ />
17
+ <circle
18
+ cx="500"
19
+ cy="500"
20
+ fill="none"
21
+ r="450"
22
+ stroke="currentColor"
23
+ stroke-width="100"
24
+ opacity="0.45"
25
+ />
26
+ <circle
27
+ cx="500"
28
+ cy="500"
29
+ fill="none"
30
+ r="450"
31
+ stroke="currentColor"
32
+ stroke-width="100"
33
+ stroke-dasharray="600 9999999"
34
+ >
35
+ <animateTransform
36
+ attributeName="transform"
37
+ dur="1s"
38
+ from="0 500 500"
39
+ repeatCount="indefinite"
40
+ to="360 500 500"
41
+ type="rotate"
42
+ />
43
+ </circle>
44
+ </svg>
45
+ </template>
46
+
47
+ <script>
48
+ export default {
49
+ name: 'Loading',
50
+ };
51
+ </script>
52
+
53
+ <style scoped></style>