@matechat/core 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Bubble/index.css CHANGED
@@ -1 +1 @@
1
- .mc-bubble-loading[data-v-f976c7b6]{display:flex;align-items:center;gap:8px}.mc-bubble-loading .loading-dot[data-v-f976c7b6]{width:8px;height:8px;border-radius:5px;background-color:#9880ff}.mc-bubble-loading .loading-dot.dot-start[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:0s}.mc-bubble-loading .loading-dot.dot-middle[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:.5s}.mc-bubble-loading .loading-dot.dot-end[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:1s}@keyframes dotFlashing-f976c7b6{0%{background-color:#9880ff}to{background-color:#ebe6ff}}.mc-bubble[data-v-817ff41e]{display:flex;gap:4px}.mc-bubble .mc-bubble-content[data-v-817ff41e]{word-wrap:break-word}.mc-bubble .mc-bubble-content.filled[data-v-817ff41e],.mc-bubble .mc-bubble-content.bordered[data-v-817ff41e]{padding:12px 16px;border-radius:12px}.mc-bubble .mc-bubble-content.filled[data-v-817ff41e]{background-color:var(--devui-global-bg, #f6f6f8)}.mc-bubble .mc-bubble-content.bordered[data-v-817ff41e]{border:1px solid var(--devui-dividing-line, #f2f2f3)}.mc-bubble .mc-bubble-avatar[data-v-817ff41e]{flex-shrink:0;display:flex;gap:4px}.mc-bubble .mc-bubble-avatar .mc-bubble-avatar-name[data-v-817ff41e]{font-size:14px}.mc-bubble .mc-bubble-avatar.empty-avatar[data-v-817ff41e]{visibility:hidden}.mc-bubble.mc-bubble-avatar-top .mc-bubble-avatar[data-v-817ff41e]{align-items:center}.mc-bubble .mc-bubble-content-container[data-v-817ff41e]{max-width:100%}.mc-bubble.mc-bubble-avatar-top[data-v-817ff41e]{flex-direction:column}.mc-bubble.mc-bubble-loading.mc-bubble-avatar-side[data-v-817ff41e]{align-items:center}.mc-bubble.mc-bubble-avatar-side.mc-bubble-right[data-v-817ff41e]{flex-direction:row-reverse;justify-content:end}.mc-bubble.mc-bubble-avatar-top .mc-bubble-avatar[data-v-817ff41e],.mc-bubble.mc-bubble-avatar-top .mc-bubble-content-container[data-v-817ff41e]{display:flex}.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-avatar[data-v-817ff41e],.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-content-container[data-v-817ff41e]{justify-content:end}.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-avatar[data-v-817ff41e]{flex-direction:row-reverse}
1
+ .mc-bubble-avatar-wrapper{display:inline-block}.mc-bubble-avatar-wrapper .mc-bubble-avatar-style{display:inline-block;text-align:center;color:var(--devui-light-text, #ffffff)}.mc-bubble-avatar-wrapper .mc-bubble-avatar-background-0{background-color:#ff8b87}.mc-bubble-avatar-wrapper .mc-bubble-avatar-background-1{background-color:#7693f5}.mc-bubble-loading[data-v-f976c7b6]{display:flex;align-items:center;gap:8px}.mc-bubble-loading .loading-dot[data-v-f976c7b6]{width:8px;height:8px;border-radius:5px;background-color:#9880ff}.mc-bubble-loading .loading-dot.dot-start[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:0s}.mc-bubble-loading .loading-dot.dot-middle[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:.5s}.mc-bubble-loading .loading-dot.dot-end[data-v-f976c7b6]{animation:dotFlashing-f976c7b6 1s infinite linear alternate;animation-delay:1s}@keyframes dotFlashing-f976c7b6{0%{background-color:#9880ff}to{background-color:#ebe6ff}}.mc-bubble[data-v-6deee2c7]{display:flex;gap:4px}.mc-bubble .mc-bubble-content[data-v-6deee2c7]{word-wrap:break-word}.mc-bubble .mc-bubble-content.filled[data-v-6deee2c7],.mc-bubble .mc-bubble-content.bordered[data-v-6deee2c7]{padding:12px 16px;border-radius:12px}.mc-bubble .mc-bubble-content.filled[data-v-6deee2c7]{background-color:var(--devui-global-bg, #f6f6f8)}.mc-bubble .mc-bubble-content.bordered[data-v-6deee2c7]{border:1px solid var(--devui-dividing-line, #f2f2f3)}.mc-bubble .mc-bubble-avatar[data-v-6deee2c7]{flex-shrink:0;display:flex;gap:4px}.mc-bubble .mc-bubble-avatar .mc-bubble-avatar-name[data-v-6deee2c7]{font-size:14px}.mc-bubble .mc-bubble-avatar.empty-avatar[data-v-6deee2c7]{visibility:hidden}.mc-bubble.mc-bubble-avatar-top .mc-bubble-avatar[data-v-6deee2c7]{align-items:center}.mc-bubble .mc-bubble-content-container[data-v-6deee2c7]{max-width:100%}.mc-bubble.mc-bubble-avatar-top[data-v-6deee2c7]{flex-direction:column}.mc-bubble.mc-bubble-loading.mc-bubble-avatar-side[data-v-6deee2c7]{align-items:center}.mc-bubble.mc-bubble-avatar-side.mc-bubble-right[data-v-6deee2c7]{flex-direction:row-reverse;justify-content:end}.mc-bubble.mc-bubble-avatar-top .mc-bubble-avatar[data-v-6deee2c7],.mc-bubble.mc-bubble-avatar-top .mc-bubble-content-container[data-v-6deee2c7]{display:flex}.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-avatar[data-v-6deee2c7],.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-content-container[data-v-6deee2c7]{justify-content:end}.mc-bubble.mc-bubble-avatar-top.mc-bubble-right .mc-bubble-avatar[data-v-6deee2c7]{flex-direction:row-reverse}
package/Bubble/index.js CHANGED
@@ -1,8 +1,314 @@
1
1
  import "./index.css";
2
- import { createElementBlock as l, openBlock as s, createElementVNode as v, defineComponent as _, useSlots as k, computed as p, normalizeClass as d, createCommentVNode as n, createVNode as y, unref as c, normalizeProps as T, guardReactiveProps as S, toDisplayString as A, renderSlot as u, createTextVNode as V } from "vue";
3
- import { Avatar as $ } from "vue-devui/avatar";
4
- import "vue-devui/avatar/style.css";
5
- const B = {
2
+ import { defineComponent as M, createElementBlock as l, openBlock as r, normalizeStyle as h, createElementVNode as v, ref as p, watch as N, createCommentVNode as u, normalizeClass as b, toDisplayString as A, createVNode as w, useSlots as B, computed as $, normalizeProps as R, guardReactiveProps as E, unref as Z, renderSlot as y, createTextVNode as F } from "vue";
3
+ const T = {
4
+ name: {
5
+ type: String,
6
+ default: ""
7
+ },
8
+ gender: {
9
+ type: String
10
+ },
11
+ width: {
12
+ type: Number,
13
+ default: 36
14
+ },
15
+ height: {
16
+ type: Number,
17
+ default: 36
18
+ },
19
+ isRound: {
20
+ type: Boolean,
21
+ default: !0
22
+ },
23
+ imgSrc: {
24
+ type: String,
25
+ default: ""
26
+ }
27
+ }, _ = /* @__PURE__ */ M({
28
+ __name: "AvatarBodyIcon",
29
+ props: {
30
+ width: {
31
+ type: Number,
32
+ default: 16
33
+ },
34
+ height: {
35
+ type: Number,
36
+ default: 16
37
+ }
38
+ },
39
+ setup(i) {
40
+ return (a, s) => (r(), l(
41
+ "svg",
42
+ {
43
+ style: h({
44
+ width: `${i.width}px`,
45
+ height: `${i.height}px`,
46
+ verticalAlign: "middle"
47
+ }),
48
+ viewBox: "0 0 30 30",
49
+ version: "1.1",
50
+ xmlns: "http://www.w3.org/2000/svg"
51
+ },
52
+ s[0] || (s[0] = [
53
+ v(
54
+ "g",
55
+ {
56
+ stroke: "none",
57
+ "stroke-width": "1",
58
+ fill: "none",
59
+ "fill-rule": "evenodd"
60
+ },
61
+ [
62
+ v("circle", {
63
+ id: "Oval",
64
+ fill: "#CACFD8",
65
+ cx: "15",
66
+ cy: "15",
67
+ r: "15"
68
+ }),
69
+ v("path", {
70
+ d: "M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866, 11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068, 7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068, 16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296, 16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",
71
+ fill: "#FFFFFF"
72
+ })
73
+ ],
74
+ -1
75
+ /* HOISTED */
76
+ )
77
+ ]),
78
+ 4
79
+ /* STYLE */
80
+ ));
81
+ }
82
+ }), D = /* @__PURE__ */ M({
83
+ __name: "AvatarNoBodyIcon",
84
+ props: {
85
+ width: {
86
+ type: Number,
87
+ default: 16
88
+ },
89
+ height: {
90
+ type: Number,
91
+ default: 16
92
+ }
93
+ },
94
+ setup(i) {
95
+ return (a, s) => (r(), l(
96
+ "svg",
97
+ {
98
+ style: h({
99
+ width: `${i.width}px`,
100
+ height: `${i.height}px`,
101
+ verticalAlign: "middle"
102
+ }),
103
+ viewBox: "0 0 30 30",
104
+ version: "1.1",
105
+ xmlns: "http://www.w3.org/2000/svg"
106
+ },
107
+ s[0] || (s[0] = [
108
+ v(
109
+ "g",
110
+ {
111
+ stroke: "none",
112
+ "stroke-width": "1",
113
+ fill: "none",
114
+ "fill-rule": "evenodd"
115
+ },
116
+ [
117
+ v("path", {
118
+ d: `M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81, 19.2474562 L18.06,19.2474562 L18.06,17.7474562
119
+ L20.81,17.7474562 L20.81, 14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06, 19.2474562
120
+ L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053, 14.9974562 10.4297866,12.9827376 10.4297866,10.4974562
121
+ C10.4297866, 8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068, 5.9974562 19.4297866,8.01217483
122
+ 19.4297866,10.4974562 C19.4297866, 12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866, 20.2474562
123
+ L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296, 15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562
124
+ 17.9612467,15.983021 19.2414296, 16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z`,
125
+ fill: "#959EB2"
126
+ }),
127
+ v("path", {
128
+ d: `M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,
129
+ 16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,
130
+ 15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,
131
+ 19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074,
132
+ 20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262,
133
+ 18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316,
134
+ 22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754,
135
+ 24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134,
136
+ 22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519,
137
+ 25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498,
138
+ 26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559,
139
+ 25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119,
140
+ 27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461,
141
+ 28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647,
142
+ 27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912,
143
+ 28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667,
144
+ 29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021,
145
+ 29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912,
146
+ 30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361,
147
+ 28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774,
148
+ 28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362,
149
+ 30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387,
150
+ 28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875,
151
+ 28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762,
152
+ 29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928,
153
+ 26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678,
154
+ 26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087,
155
+ 28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421,
156
+ 24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873,
157
+ 24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583,
158
+ 25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738,
159
+ 21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855,
160
+ 20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445,
161
+ 22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136,
162
+ 18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978,
163
+ 17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977,
164
+ 18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743,
165
+ 15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956,
166
+ 15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088,
167
+ 13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30,
168
+ 15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616,
169
+ 10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852,
170
+ 9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108,
171
+ 11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241,
172
+ 7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761,
173
+ 5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788,
174
+ 7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639,
175
+ 4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554,
176
+ 3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089,
177
+ 4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008,
178
+ 2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722,
179
+ 1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506,
180
+ 2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842,
181
+ 1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964,
182
+ 0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329,
183
+ 0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052,
184
+ 1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685,
185
+ 1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162,
186
+ 1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509,
187
+ 0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354,
188
+ 0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801,
189
+ 1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954,
190
+ 0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123,
191
+ 1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975,
192
+ 3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073,
193
+ 2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842,
194
+ 4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416,
195
+ 5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885,
196
+ 5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775,
197
+ 7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977,
198
+ 8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243,
199
+ 8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456,
200
+ 11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484,
201
+ 12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486,12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z`,
202
+ fill: "#CACFD8",
203
+ "fill-rule": "nonzero"
204
+ })
205
+ ],
206
+ -1
207
+ /* HOISTED */
208
+ )
209
+ ]),
210
+ 4
211
+ /* STYLE */
212
+ ));
213
+ }
214
+ }), I = { class: "mc-bubble-avatar-wrapper" }, z = ["src"], P = /* @__PURE__ */ M({
215
+ __name: "Avatar",
216
+ props: T,
217
+ setup(i) {
218
+ const a = i, s = p(!1), n = p(!0), c = p(1), t = p(12), o = p(), g = (e) => {
219
+ if (a.gender) {
220
+ a.gender.toLowerCase() === "male" ? c.value = 1 : a.gender.toLowerCase() === "female" && (c.value = 0);
221
+ return;
222
+ }
223
+ const d = e.charCodeAt(0);
224
+ c.value = d % 2;
225
+ }, L = (e, d) => {
226
+ if (e.length < 2)
227
+ o.value = e;
228
+ else if (/^[\u4e00-\u9fa5]/.test(e))
229
+ o.value = e.substr(e.length - 2, 2);
230
+ else if (/^[A-Za-z]/.test(e))
231
+ if (/[_ -]/.test(e)) {
232
+ const C = e.split(/_|-|\s+/)[0], m = e.split(/_|-|\s+/)[1];
233
+ o.value = C.substr(0, 1).toUpperCase() + m.substr(0, 1).toUpperCase();
234
+ } else
235
+ o.value = e.substr(0, 2).toUpperCase();
236
+ else
237
+ o.value = e.substr(0, 2);
238
+ d < 30 && (o.value = e.substr(0, 1).toUpperCase()), g(e.substr(0, 1));
239
+ }, f = (e) => {
240
+ const d = e, C = Math.min(a.width, a.height);
241
+ d ? (n.value = !1, L(d, C)) : d === "" ? (n.value = !1, o.value = "") : n.value = !0, t.value = C / 4 + 3;
242
+ };
243
+ return f(a.name), N([() => a.name, () => a.width, () => a.height, () => a.gender], () => {
244
+ f(a.name);
245
+ }), (e, d) => {
246
+ var C, m;
247
+ return r(), l("span", I, [
248
+ e.imgSrc && !s.value ? (r(), l("img", {
249
+ key: 0,
250
+ src: e.imgSrc,
251
+ alt: "",
252
+ onError: d[0] || (d[0] = () => s.value = !0),
253
+ style: h({
254
+ height: `${e.height}px`,
255
+ width: `${e.width}px`,
256
+ borderRadius: e.isRound ? "100%" : "0"
257
+ })
258
+ }, null, 44, z)) : u("v-if", !0),
259
+ !e.imgSrc && !n.value && ((C = o.value) == null ? void 0 : C.length) !== 0 ? (r(), l(
260
+ "span",
261
+ {
262
+ key: 1,
263
+ class: b(["mc-bubble-avatar-style", `mc-bubble-avatar-background-${c.value}`]),
264
+ style: h({
265
+ height: `${e.height}px`,
266
+ width: `${e.width}px`,
267
+ lineHeight: `${e.height}px`,
268
+ fontSize: `${t.value}px`,
269
+ borderRadius: e.isRound ? "100%" : "0"
270
+ })
271
+ },
272
+ A(o.value),
273
+ 7
274
+ /* TEXT, CLASS, STYLE */
275
+ )) : u("v-if", !0),
276
+ !e.imgSrc && !n.value && ((m = o.value) == null ? void 0 : m.length) === 0 ? (r(), l(
277
+ "span",
278
+ {
279
+ key: 2,
280
+ class: "mc-bubble-avatar-style",
281
+ style: h({ borderRadius: e.isRound ? "100%" : "0" })
282
+ },
283
+ [
284
+ w(_, {
285
+ width: e.width,
286
+ height: e.height
287
+ }, null, 8, ["width", "height"])
288
+ ],
289
+ 4
290
+ /* STYLE */
291
+ )) : u("v-if", !0),
292
+ !e.imgSrc && n.value || e.imgSrc && s.value ? (r(), l(
293
+ "span",
294
+ {
295
+ key: 3,
296
+ class: "mc-bubble-avatar-style",
297
+ style: h({ borderRadius: e.isRound ? "100%" : "0" })
298
+ },
299
+ [
300
+ w(D, {
301
+ width: e.width,
302
+ height: e.height
303
+ }, null, 8, ["width", "height"])
304
+ ],
305
+ 4
306
+ /* STYLE */
307
+ )) : u("v-if", !0)
308
+ ]);
309
+ };
310
+ }
311
+ }), U = {
6
312
  content: {
7
313
  type: String,
8
314
  default: ""
@@ -26,14 +332,14 @@ const B = {
26
332
  avatarConfig: {
27
333
  type: Object
28
334
  }
29
- }, E = 36, N = 36, P = "name", I = "imgSrc", C = (a, o) => {
30
- const e = a.__vccOpts || a;
31
- for (const [b, r] of o)
32
- e[b] = r;
33
- return e;
34
- }, R = {}, w = { class: "mc-bubble-loading" };
35
- function D(a, o) {
36
- return s(), l("div", w, o[0] || (o[0] = [
335
+ }, H = 36, O = 36, j = "name", G = "imgSrc", k = (i, a) => {
336
+ const s = i.__vccOpts || i;
337
+ for (const [n, c] of a)
338
+ s[n] = c;
339
+ return s;
340
+ }, W = {}, q = { class: "mc-bubble-loading" };
341
+ function J(i, a) {
342
+ return r(), l("div", q, a[0] || (a[0] = [
37
343
  v(
38
344
  "div",
39
345
  { class: "loading-dot dot-start" },
@@ -57,86 +363,86 @@ function D(a, o) {
57
363
  )
58
364
  ]));
59
365
  }
60
- const M = /* @__PURE__ */ C(R, [["render", D], ["__scopeId", "data-v-f976c7b6"]]), H = {
366
+ const K = /* @__PURE__ */ k(W, [["render", J], ["__scopeId", "data-v-f976c7b6"]]), Q = {
61
367
  key: 0,
62
368
  class: "mc-bubble-avatar-name"
63
- }, L = {
369
+ }, X = {
64
370
  key: 1,
65
371
  class: "loading-container"
66
- }, O = /* @__PURE__ */ _({
372
+ }, Y = /* @__PURE__ */ M({
67
373
  __name: "Bubble",
68
- props: B,
69
- setup(a) {
70
- const o = k(), e = a, b = p(() => [
71
- `mc-bubble-avatar-${e.avatarPosition}`,
72
- `mc-bubble-${e.align}`,
73
- e.loading ? "mc-bubble-loading" : ""
74
- ]), r = p(() => {
75
- if (e.avatarConfig) {
76
- const t = Object.keys(e.avatarConfig), f = t.some((i) => i === P || i === I);
77
- return t.length < 1 || !f;
374
+ props: U,
375
+ setup(i) {
376
+ const a = B(), s = i, n = $(() => [
377
+ `mc-bubble-avatar-${s.avatarPosition}`,
378
+ `mc-bubble-${s.align}`,
379
+ s.loading ? "mc-bubble-loading" : ""
380
+ ]), c = $(() => {
381
+ if (s.avatarConfig) {
382
+ const t = Object.keys(s.avatarConfig), o = t.some((g) => g === j || g === G);
383
+ return t.length < 1 || !o;
78
384
  } else
79
385
  return !0;
80
386
  });
81
- return (t, f) => {
82
- var i, g, m;
83
- return s(), l(
387
+ return (t, o) => {
388
+ var g, L, f;
389
+ return r(), l(
84
390
  "div",
85
391
  {
86
- class: d(["mc-bubble", b.value])
392
+ class: b(["mc-bubble", n.value])
87
393
  },
88
394
  [
89
- t.avatarConfig ? (s(), l(
395
+ t.avatarConfig ? (r(), l(
90
396
  "div",
91
397
  {
92
398
  key: 0,
93
- class: d(["mc-bubble-avatar", { "empty-avatar": r.value }])
399
+ class: b(["mc-bubble-avatar", { "empty-avatar": c.value }])
94
400
  },
95
401
  [
96
- y(
97
- c($),
98
- T(S(
99
- r.value ? {
100
- width: ((i = t.avatarConfig) == null ? void 0 : i.width) || c(E),
101
- height: ((g = t.avatarConfig) == null ? void 0 : g.height) || c(N)
402
+ w(
403
+ P,
404
+ R(E(
405
+ c.value ? {
406
+ width: ((g = t.avatarConfig) == null ? void 0 : g.width) || Z(H),
407
+ height: ((L = t.avatarConfig) == null ? void 0 : L.height) || Z(O)
102
408
  } : t.avatarConfig
103
409
  )),
104
410
  null,
105
411
  16
106
412
  /* FULL_PROPS */
107
413
  ),
108
- t.avatarPosition === "top" ? (s(), l(
414
+ t.avatarPosition === "top" ? (r(), l(
109
415
  "span",
110
- H,
111
- A((m = t.avatarConfig) == null ? void 0 : m.displayName),
416
+ Q,
417
+ A((f = t.avatarConfig) == null ? void 0 : f.displayName),
112
418
  1
113
419
  /* TEXT */
114
- )) : n("v-if", !0)
420
+ )) : u("v-if", !0)
115
421
  ],
116
422
  2
117
423
  /* CLASS */
118
- )) : n("v-if", !0),
424
+ )) : u("v-if", !0),
119
425
  v(
120
426
  "div",
121
427
  {
122
- class: d(["mc-bubble-content-container", { "with-avatar": t.avatarConfig }])
428
+ class: b(["mc-bubble-content-container", { "with-avatar": t.avatarConfig }])
123
429
  },
124
430
  [
125
- t.loading ? n("v-if", !0) : u(t.$slots, "top", { key: 0 }, void 0, !0),
126
- t.loading ? (s(), l("div", L, [
127
- u(t.$slots, "loadingTpl", {}, () => [
128
- y(M)
431
+ t.loading ? u("v-if", !0) : y(t.$slots, "top", { key: 0 }, void 0, !0),
432
+ t.loading ? (r(), l("div", X, [
433
+ y(t.$slots, "loadingTpl", {}, () => [
434
+ w(K)
129
435
  ], !0)
130
- ])) : n("v-if", !0),
131
- (c(o).default || t.content) && !t.loading ? (s(), l(
436
+ ])) : u("v-if", !0),
437
+ (Z(a).default || t.content) && !t.loading ? (r(), l(
132
438
  "div",
133
439
  {
134
440
  key: 2,
135
- class: d(["mc-bubble-content", [t.variant]])
441
+ class: b(["mc-bubble-content", [t.variant]])
136
442
  },
137
443
  [
138
- u(t.$slots, "default", {}, () => [
139
- V(
444
+ y(t.$slots, "default", {}, () => [
445
+ F(
140
446
  A(t.content),
141
447
  1
142
448
  /* TEXT */
@@ -145,8 +451,8 @@ const M = /* @__PURE__ */ C(R, [["render", D], ["__scopeId", "data-v-f976c7b6"]]
145
451
  ],
146
452
  2
147
453
  /* CLASS */
148
- )) : n("v-if", !0),
149
- t.loading ? n("v-if", !0) : u(t.$slots, "bottom", { key: 3 }, void 0, !0)
454
+ )) : u("v-if", !0),
455
+ t.loading ? u("v-if", !0) : y(t.$slots, "bottom", { key: 3 }, void 0, !0)
150
456
  ],
151
457
  2
152
458
  /* CLASS */
@@ -157,10 +463,10 @@ const M = /* @__PURE__ */ C(R, [["render", D], ["__scopeId", "data-v-f976c7b6"]]
157
463
  );
158
464
  };
159
465
  }
160
- }), h = /* @__PURE__ */ C(O, [["__scopeId", "data-v-817ff41e"]]);
161
- h.install = (a) => {
162
- a.component("McBubble", h);
466
+ }), S = /* @__PURE__ */ k(Y, [["__scopeId", "data-v-6deee2c7"]]);
467
+ S.install = (i) => {
468
+ i.component("McBubble", S);
163
469
  };
164
470
  export {
165
- h as McBubble
471
+ S as McBubble
166
472
  };
package/Input/index.css CHANGED
@@ -1 +1 @@
1
- .mc-textarea.devui-textarea{height:64px;padding-left:0;padding-right:0;border:none}.mc-textarea.devui-textarea.mc-textarea-simple{height:32px}.mc-textarea.devui-textarea::placeholder{color:var(--devui-placeholder, #babbc0)}.mc-button.devui-button[data-v-d9d29965]{border:none}.mc-button.devui-button.mc-button-loading[data-v-d9d29965] svg{animation:rotating-d9d29965 1s linear infinite}.mc-button.devui-button[data-v-d9d29965] .button-content{display:inline-flex;align-items:center}.mc-button.devui-button[data-v-d9d29965] .button-content svg{margin-right:4px}.mc-button.devui-button[data-v-d9d29965] .button-content svg path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-d9d29965{0%{transform:rotate(0)}to{transform:rotate(180deg)}}.mc-input{display:flex;flex-direction:column;width:100%;padding:4px 0;border:1px solid var(--devui-form-control-line, #d7d8da);border-radius:14px;box-sizing:border-box}.mc-input.mc-input-disabled{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-input .mc-input-content{display:flex;align-items:flex-end;padding:0 8px}.mc-input .mc-input-foot{display:flex;justify-content:space-between;align-items:center;height:32px;padding:0 8px}.mc-input .mc-input-foot .mc-input-foot-left{flex:1;height:100%;display:flex;align-items:center}.mc-input .mc-input-foot .mc-input-foot-left .mc-input-foot-count{color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 12px)}
1
+ .mc-textarea{width:100%;height:64px;padding:4px 0;color:var(--devui-text, #252b3a);background-color:var(--devui-form-control-bg, #ffffff);vertical-align:middle;outline:none;box-sizing:border-box;resize:none;border:none}.mc-textarea.mc-textarea-simple{height:32px}.mc-textarea.mc-textarea-disabled{color:var(--devui-disabled-text, #cfd0d3);background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-textarea::placeholder{color:var(--devui-placeholder, #babbc0)}.mc-button[data-v-b128331d]{position:relative;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-width:64px;height:32px;line-height:1.5;color:var(--devui-light-text, #ffffff);font-size:var(--devui-font-size-md, 12px);padding:0 16px;border-radius:20px;background-color:var(--devui-primary, #5e7ce0);overflow:hidden;border:none;cursor:pointer;transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.mc-button.mc-button-loading svg[data-v-b128331d]{animation:rotating-b128331d 1s linear infinite}.mc-button.mousedown[data-v-b128331d]:not(:disabled){transform:scale(.95)}.mc-button[data-v-b128331d]:hover{background-color:var(--devui-primary-hover, #7693f5)}.mc-button[data-v-b128331d]:active{background-color:var(--devui-primary-active, #344899)}.mc-button[data-v-b128331d]:disabled{color:var(--devui-light-text, #ffffff);background-color:var(--devui-primary-disabled, #beccfa);cursor:not-allowed}.mc-button .mc-button-content[data-v-b128331d]{display:inline-flex;align-items:center}.mc-button .mc-button-water-wave[data-v-b128331d]{position:absolute;background-color:var(--devui-base-bg, #ffffff);border-radius:50%;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);animation:waterWave-b128331d var(--devui-animation-duration-slow, .3s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.mc-button svg[data-v-b128331d]{margin-right:4px}.mc-button svg[data-v-b128331d] path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-b128331d{0%{transform:rotate(0)}to{transform:rotate(180deg)}}@keyframes waterWave-b128331d{0%{opacity:.2;width:30px;height:30px}to{opacity:0;width:200px;height:200px}}.mc-input{display:flex;flex-direction:column;width:100%;padding:4px 0;border:1px solid var(--devui-form-control-line, #d7d8da);border-radius:14px;box-sizing:border-box}.mc-input.mc-input-disabled{background-color:var(--devui-disabled-bg, #f5f5f5);cursor:not-allowed}.mc-input .mc-input-content{display:flex;align-items:flex-end;padding:0 8px}.mc-input .mc-input-foot{display:flex;justify-content:space-between;align-items:center;height:32px;padding:0 8px}.mc-input .mc-input-foot .mc-input-foot-left{flex:1;height:100%;display:flex;align-items:center}.mc-input .mc-input-foot .mc-input-foot-left .mc-input-foot-count{color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 12px)}