@matechat/core 0.0.1-alpha → 0.0.1-alpha.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.
- package/README.md +423 -0
- package/mate-chat.css +1 -1
- package/mate-chat.js +486 -342
- package/package.json +17 -7
package/mate-chat.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import "./mate-chat.css";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { Avatar as
|
|
2
|
+
import { defineComponent as T, openBlock as l, createElementBlock as d, createElementVNode as _, normalizeClass as $, createCommentVNode as h, toDisplayString as S, renderSlot as y, useSlots as Se, computed as U, createVNode as I, unref as u, normalizeProps as ue, guardReactiveProps as ke, createTextVNode as fe, inject as me, createBlock as B, isRef as Te, nextTick as pe, withCtx as x, ref as j, watch as ge, provide as we, Fragment as D, renderList as ve, onMounted as ye, mergeProps as Ee, Comment as Ie, Text as Me, h as Ae, withDirectives as Pe, cloneVNode as Oe, reactive as Be, onBeforeUnmount as je, Teleport as Ve, Transition as He, normalizeStyle as Ke } from "vue";
|
|
3
|
+
import { Avatar as Ne } from "vue-devui/avatar";
|
|
4
4
|
import "vue-devui/avatar/style.css";
|
|
5
|
-
import { Textarea as
|
|
5
|
+
import { Textarea as Re } from "vue-devui/textarea";
|
|
6
6
|
import "vue-devui/textarea/style.css";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as Ze } from "vue-devui/button";
|
|
8
8
|
import "vue-devui/button/style.css";
|
|
9
|
-
import { Icon as
|
|
9
|
+
import { Icon as ze } from "vue-devui/icon";
|
|
10
10
|
import "vue-devui/icon/style.css";
|
|
11
|
-
import { isObject as
|
|
12
|
-
import { computePosition as
|
|
13
|
-
|
|
14
|
-
const Re = {
|
|
11
|
+
import { isObject as De } from "@vue/shared";
|
|
12
|
+
import { computePosition as We, offset as Fe } from "@floating-ui/dom";
|
|
13
|
+
const Ue = {
|
|
15
14
|
logoImg: {
|
|
16
15
|
type: String,
|
|
17
16
|
default: ""
|
|
@@ -24,38 +23,38 @@ const Re = {
|
|
|
24
23
|
type: Boolean,
|
|
25
24
|
default: !1
|
|
26
25
|
}
|
|
27
|
-
},
|
|
26
|
+
}, xe = { class: "mc-header" }, Ge = ["src", "alt"], qe = { class: "mc-header-title" }, Xe = { class: "mc-header-operation" }, Je = /* @__PURE__ */ T({
|
|
28
27
|
__name: "Header",
|
|
29
|
-
props:
|
|
28
|
+
props: Ue,
|
|
30
29
|
emits: ["logoClicked"],
|
|
31
30
|
setup(e, { emit: t }) {
|
|
32
|
-
const n = t,
|
|
33
|
-
|
|
31
|
+
const n = t, i = e, c = () => {
|
|
32
|
+
i.logoClickable && n("logoClicked");
|
|
34
33
|
};
|
|
35
|
-
return (o,
|
|
36
|
-
|
|
37
|
-
class:
|
|
38
|
-
onClick:
|
|
34
|
+
return (o, r) => (l(), d("div", xe, [
|
|
35
|
+
_("div", {
|
|
36
|
+
class: $(["mc-header-logo-container", { clickable: o.logoClickable }]),
|
|
37
|
+
onClick: c
|
|
39
38
|
}, [
|
|
40
|
-
o.logoImg ? (l(),
|
|
39
|
+
o.logoImg ? (l(), d("img", {
|
|
41
40
|
key: 0,
|
|
42
41
|
class: "mc-header-logo",
|
|
43
42
|
src: o.logoImg,
|
|
44
43
|
alt: o.logoImg
|
|
45
|
-
}, null, 8,
|
|
46
|
-
|
|
44
|
+
}, null, 8, Ge)) : h("", !0),
|
|
45
|
+
_("div", qe, S(o.title), 1)
|
|
47
46
|
], 2),
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
_("div", Xe, [
|
|
48
|
+
y(o.$slots, "operationArea", {}, void 0, !0)
|
|
50
49
|
])
|
|
51
50
|
]));
|
|
52
51
|
}
|
|
53
|
-
}),
|
|
52
|
+
}), L = (e, t) => {
|
|
54
53
|
const n = e.__vccOpts || e;
|
|
55
|
-
for (const [
|
|
56
|
-
n[
|
|
54
|
+
for (const [i, c] of t)
|
|
55
|
+
n[i] = c;
|
|
57
56
|
return n;
|
|
58
|
-
},
|
|
57
|
+
}, Qe = /* @__PURE__ */ L(Je, [["__scopeId", "data-v-2eda62d1"]]), Ye = {
|
|
59
58
|
content: {
|
|
60
59
|
type: String,
|
|
61
60
|
default: ""
|
|
@@ -79,77 +78,77 @@ const Re = {
|
|
|
79
78
|
avatarConfig: {
|
|
80
79
|
type: Object
|
|
81
80
|
}
|
|
82
|
-
},
|
|
83
|
-
function
|
|
84
|
-
return l(),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
}, et = 36, tt = 36, nt = "name", ot = "imgSrc", rt = {}, it = { class: "mc-bubble-loading" };
|
|
82
|
+
function at(e, t) {
|
|
83
|
+
return l(), d("div", it, t[0] || (t[0] = [
|
|
84
|
+
_("div", { class: "loading-dot dot-start" }, null, -1),
|
|
85
|
+
_("div", { class: "loading-dot dot-middle" }, null, -1),
|
|
86
|
+
_("div", { class: "loading-dot dot-end" }, null, -1)
|
|
88
87
|
]));
|
|
89
88
|
}
|
|
90
|
-
const
|
|
89
|
+
const st = /* @__PURE__ */ L(rt, [["render", at], ["__scopeId", "data-v-f976c7b6"]]), lt = {
|
|
91
90
|
key: 0,
|
|
92
91
|
class: "mc-bubble-avatar-name"
|
|
93
|
-
},
|
|
92
|
+
}, ct = {
|
|
94
93
|
key: 1,
|
|
95
94
|
class: "loading-container"
|
|
96
|
-
},
|
|
95
|
+
}, dt = /* @__PURE__ */ T({
|
|
97
96
|
__name: "Bubble",
|
|
98
|
-
props:
|
|
97
|
+
props: Ye,
|
|
99
98
|
setup(e) {
|
|
100
|
-
const t =
|
|
99
|
+
const t = Se(), n = e, i = U(() => [
|
|
101
100
|
`mc-bubble-avatar-${n.avatarPosition}`,
|
|
102
101
|
`mc-bubble-${n.align}`,
|
|
103
102
|
n.loading ? "mc-bubble-loading" : ""
|
|
104
|
-
]),
|
|
103
|
+
]), c = U(() => {
|
|
105
104
|
if (n.avatarConfig) {
|
|
106
|
-
const o = Object.keys(n.avatarConfig),
|
|
107
|
-
return o.length < 1 || !
|
|
105
|
+
const o = Object.keys(n.avatarConfig), r = o.some((a) => a === nt || a === ot);
|
|
106
|
+
return o.length < 1 || !r;
|
|
108
107
|
} else
|
|
109
108
|
return !0;
|
|
110
109
|
});
|
|
111
|
-
return (o,
|
|
112
|
-
var
|
|
113
|
-
return l(),
|
|
114
|
-
class:
|
|
110
|
+
return (o, r) => {
|
|
111
|
+
var a, s, f;
|
|
112
|
+
return l(), d("div", {
|
|
113
|
+
class: $(["mc-bubble", i.value])
|
|
115
114
|
}, [
|
|
116
|
-
o.avatarConfig ? (l(),
|
|
115
|
+
o.avatarConfig ? (l(), d("div", {
|
|
117
116
|
key: 0,
|
|
118
|
-
class:
|
|
117
|
+
class: $(["mc-bubble-avatar", { "empty-avatar": c.value }])
|
|
119
118
|
}, [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
width: ((
|
|
123
|
-
height: ((
|
|
119
|
+
I(u(Ne), ue(ke(
|
|
120
|
+
c.value ? {
|
|
121
|
+
width: ((a = o.avatarConfig) == null ? void 0 : a.width) || u(et),
|
|
122
|
+
height: ((s = o.avatarConfig) == null ? void 0 : s.height) || u(tt)
|
|
124
123
|
} : o.avatarConfig
|
|
125
124
|
)), null, 16),
|
|
126
|
-
o.avatarPosition === "top" ? (l(),
|
|
127
|
-
], 2)) :
|
|
128
|
-
|
|
129
|
-
class:
|
|
125
|
+
o.avatarPosition === "top" ? (l(), d("span", lt, S((f = o.avatarConfig) == null ? void 0 : f.displayName), 1)) : h("", !0)
|
|
126
|
+
], 2)) : h("", !0),
|
|
127
|
+
_("div", {
|
|
128
|
+
class: $(["mc-bubble-content-container", { "with-avatar": o.avatarConfig }])
|
|
130
129
|
}, [
|
|
131
|
-
o.loading ?
|
|
132
|
-
o.loading ? (l(),
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
o.loading ? h("", !0) : y(o.$slots, "top", { key: 0 }, void 0, !0),
|
|
131
|
+
o.loading ? (l(), d("div", ct, [
|
|
132
|
+
y(o.$slots, "loadingTpl", {}, () => [
|
|
133
|
+
I(st)
|
|
135
134
|
], !0)
|
|
136
|
-
])) :
|
|
137
|
-
(
|
|
135
|
+
])) : h("", !0),
|
|
136
|
+
(u(t).default || o.content) && !o.loading ? (l(), d("div", {
|
|
138
137
|
key: 2,
|
|
139
|
-
class:
|
|
138
|
+
class: $(["mc-bubble-content", [o.variant]])
|
|
140
139
|
}, [
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
y(o.$slots, "default", {}, () => [
|
|
141
|
+
fe(S(o.content), 1)
|
|
143
142
|
], !0)
|
|
144
|
-
], 2)) :
|
|
145
|
-
o.loading ?
|
|
143
|
+
], 2)) : h("", !0),
|
|
144
|
+
o.loading ? h("", !0) : y(o.$slots, "bottom", { key: 3 }, void 0, !0)
|
|
146
145
|
], 2)
|
|
147
146
|
], 2);
|
|
148
147
|
};
|
|
149
148
|
}
|
|
150
|
-
}),
|
|
151
|
-
var
|
|
152
|
-
const
|
|
149
|
+
}), ut = /* @__PURE__ */ L(dt, [["__scopeId", "data-v-817ff41e"]]);
|
|
150
|
+
var G = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(G || {}), z = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(z || {});
|
|
151
|
+
const ft = {
|
|
153
152
|
value: {
|
|
154
153
|
type: String,
|
|
155
154
|
default: ""
|
|
@@ -182,106 +181,144 @@ const at = {
|
|
|
182
181
|
default: "enter"
|
|
183
182
|
/* Enter */
|
|
184
183
|
}
|
|
185
|
-
},
|
|
184
|
+
}, mt = ["change", "submit", "cancel"], oe = "mc-input", pt = /* @__PURE__ */ T({
|
|
186
185
|
__name: "textarea",
|
|
187
186
|
setup(e) {
|
|
188
|
-
const { inputValue: t, rootProps: n, rootEmits:
|
|
189
|
-
let
|
|
190
|
-
return n.submitShortKey ===
|
|
187
|
+
const { inputValue: t, rootProps: n, rootEmits: i } = me(oe), c = U(() => {
|
|
188
|
+
let m = "", b = "";
|
|
189
|
+
return n.submitShortKey === z.Enter && (m = "Enter", b = "Shift + Enter"), n.submitShortKey === z.ShiftEnter && (m = "Shift + Enter", b = "Enter"), n.placeholder ?? (m ? `请输入您的问题,并按${m}发送,按${b}换行` : "请输入您的问题...");
|
|
191
190
|
});
|
|
192
191
|
let o = !1;
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
const r = () => {
|
|
193
|
+
pe(() => {
|
|
194
|
+
i("change", t.value);
|
|
196
195
|
});
|
|
197
|
-
},
|
|
198
|
-
o ||
|
|
199
|
-
},
|
|
196
|
+
}, a = () => {
|
|
197
|
+
o || r();
|
|
198
|
+
}, s = () => {
|
|
200
199
|
o = !0;
|
|
201
|
-
},
|
|
202
|
-
o = !1,
|
|
203
|
-
}, g = (
|
|
200
|
+
}, f = () => {
|
|
201
|
+
o = !1, r();
|
|
202
|
+
}, g = (m) => {
|
|
204
203
|
if (n.submitShortKey === null)
|
|
205
204
|
return;
|
|
206
|
-
(n.submitShortKey ===
|
|
205
|
+
(n.submitShortKey === z.Enter ? !m.shiftKey : n.submitShortKey === z.ShiftEnter ? m.shiftKey : !1) && m.code === "Enter" && (m.preventDefault(), i("submit", t.value), t.value = "");
|
|
207
206
|
};
|
|
208
|
-
return (
|
|
209
|
-
modelValue:
|
|
210
|
-
"onUpdate:modelValue":
|
|
211
|
-
placeholder:
|
|
207
|
+
return (m, b) => (l(), B(u(Re), {
|
|
208
|
+
modelValue: u(t),
|
|
209
|
+
"onUpdate:modelValue": b[0] || (b[0] = (w) => Te(t) ? t.value = w : null),
|
|
210
|
+
placeholder: c.value,
|
|
212
211
|
showGlowStyle: !1,
|
|
213
|
-
disabled:
|
|
214
|
-
maxlength:
|
|
215
|
-
class:
|
|
216
|
-
onInput:
|
|
217
|
-
onCompositionstart:
|
|
218
|
-
onCompositionend:
|
|
212
|
+
disabled: u(n).disabled,
|
|
213
|
+
maxlength: u(n).maxLength,
|
|
214
|
+
class: $(["mc-textarea", { "mc-textarea-simple": u(n).displayType === u(G).Simple }]),
|
|
215
|
+
onInput: a,
|
|
216
|
+
onCompositionstart: s,
|
|
217
|
+
onCompositionend: f,
|
|
219
218
|
onKeydown: g
|
|
220
219
|
}, null, 8, ["modelValue", "placeholder", "disabled", "maxlength", "class"]));
|
|
221
220
|
}
|
|
222
|
-
}),
|
|
221
|
+
}), gt = {}, vt = {
|
|
222
|
+
width: "16px",
|
|
223
|
+
height: "16px",
|
|
224
|
+
viewBox: "0 0 16 16",
|
|
225
|
+
version: "1.1",
|
|
226
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
227
|
+
};
|
|
228
|
+
function yt(e, t) {
|
|
229
|
+
return l(), d("svg", vt, t[0] || (t[0] = [
|
|
230
|
+
_("g", {
|
|
231
|
+
stroke: "none",
|
|
232
|
+
"stroke-width": "1",
|
|
233
|
+
fill: "none",
|
|
234
|
+
"fill-rule": "evenodd"
|
|
235
|
+
}, [
|
|
236
|
+
_("path", { d: "M8,12 C8.27614237,12 8.5,12.2238576 8.5,12.5 L8.5,14.5 C8.5,14.7761424 8.27614237,15 8,15 C7.72385763,15 7.5,14.7761424 7.5,14.5 L7.5,12.5 C7.5,12.2238576 7.72385763,12 8,12 Z M11.0495421,11.3466838 L12.2251126,12.9647178 C12.3874251,13.1881217 12.3379006,13.5008065 12.1144968,13.663119 C11.8910929,13.8254314 11.5784081,13.775907 11.4160956,13.5525031 L10.2405251,11.9344691 C10.0782127,11.7110652 10.1277371,11.3983804 10.351141,11.236068 C10.5745449,11.0737556 10.8872297,11.12328 11.0495421,11.3466838 Z M5.64885899,11.236068 C5.87226287,11.3983804 5.92178728,11.7110652 5.75947486,11.9344691 L4.58390436,13.5525031 C4.42159194,13.775907 4.10890711,13.8254314 3.88550323,13.663119 C3.66209936,13.5008065 3.61257495,13.1881217 3.77488736,12.9647178 L4.95045787,11.3466838 C5.11277028,11.12328 5.42545512,11.0737556 5.64885899,11.236068 Z M12.4342628,8.91504822 L14.3363759,9.53308221 C14.5990029,9.61841489 14.7427283,9.90049196 14.6573956,10.163119 C14.5720629,10.425746 14.2899859,10.5694714 14.0273589,10.4841387 L12.1252458,9.86610473 C11.8626188,9.78077205 11.7188934,9.49869498 11.8042261,9.23606798 C11.8895588,8.97344097 12.1716358,8.82971553 12.4342628,8.91504822 Z M4.19577393,9.23606798 C4.28110662,9.49869498 4.13738118,9.78077205 3.87475417,9.86610473 L1.97264114,10.4841387 C1.71001414,10.5694714 1.42793707,10.425746 1.34260439,10.163119 C1.2572717,9.90049196 1.40099714,9.61841489 1.66362415,9.53308221 L3.56573718,8.91504822 C3.82836418,8.82971553 4.11044125,8.97344097 4.19577393,9.23606798 Z M14.6573956,5.83688104 C14.7427283,6.09950804 14.5990029,6.38158511 14.3363759,6.46691779 L12.4342628,7.08495178 C12.1716358,7.17028447 11.8895588,7.02655903 11.8042261,6.76393202 C11.7188934,6.50130502 11.8626188,6.21922795 12.1252458,6.13389527 L14.0273589,5.51586128 C14.2899859,5.43052859 14.5720629,5.57425403 14.6573956,5.83688104 Z M1.97264114,5.51586128 L3.87475417,6.13389527 C4.13738118,6.21922795 4.28110662,6.50130502 4.19577393,6.76393202 C4.11044125,7.02655903 3.82836418,7.17028447 3.56573718,7.08495178 L1.66362415,6.46691779 C1.40099714,6.38158511 1.2572717,6.09950804 1.34260439,5.83688104 C1.42793707,5.57425403 1.71001414,5.43052859 1.97264114,5.51586128 Z M12.1144968,2.33688104 C12.3379006,2.49919345 12.3874251,2.81187829 12.2251126,3.03528216 L11.0495421,4.65331615 C10.8872297,4.87672003 10.5745449,4.92624444 10.351141,4.76393202 C10.1277371,4.60161961 10.0782127,4.28893477 10.2405251,4.0655309 L11.4160956,2.44749691 C11.5784081,2.22409304 11.8910929,2.17456862 12.1144968,2.33688104 Z M4.58390436,2.44749691 L5.75947486,4.0655309 C5.92178728,4.28893477 5.87226287,4.60161961 5.64885899,4.76393202 C5.42545512,4.92624444 5.11277028,4.87672003 4.95045787,4.65331615 L3.77488736,3.03528216 C3.61257495,2.81187829 3.66209936,2.49919345 3.88550323,2.33688104 C4.10890711,2.17456862 4.42159194,2.22409304 4.58390436,2.44749691 Z M8,1 C8.27614237,1 8.5,1.22385763 8.5,1.5 L8.5,3.5 C8.5,3.77614237 8.27614237,4 8,4 C7.72385763,4 7.5,3.77614237 7.5,3.5 L7.5,1.5 C7.5,1.22385763 7.72385763,1 8,1 Z" })
|
|
237
|
+
], -1)
|
|
238
|
+
]));
|
|
239
|
+
}
|
|
240
|
+
const ht = /* @__PURE__ */ L(gt, [["render", yt]]), bt = {}, _t = {
|
|
241
|
+
width: "16px",
|
|
242
|
+
height: "16px",
|
|
243
|
+
viewBox: "0 0 16 16",
|
|
244
|
+
version: "1.1",
|
|
245
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
246
|
+
};
|
|
247
|
+
function Ct(e, t) {
|
|
248
|
+
return l(), d("svg", _t, t[0] || (t[0] = [
|
|
249
|
+
_("g", {
|
|
250
|
+
stroke: "none",
|
|
251
|
+
"stroke-width": "1",
|
|
252
|
+
fill: "none",
|
|
253
|
+
"fill-rule": "evenodd"
|
|
254
|
+
}, [
|
|
255
|
+
_("path", { d: "M13.5105149,2.56164948 C14.1211149,2.35546948 14.7829149,2.68328948 14.9892149,3.29376948 C15.0349149,3.42925948 15.0552149,3.57159948 15.0495149,3.71368948 L15.0495149,3.71368948 L15.0351149,3.85546948 L13.6575149,12.2717195 C13.5237149,13.0892195 12.7524149,13.6435195 11.9348149,13.5097195 C11.8542149,13.4965195 11.7751149,13.4768195 11.6980149,13.4508195 L11.6980149,13.4508195 L11.5840149,13.4071195 L9.3049349,12.4260195 L8.4482449,13.5422195 C8.1958049,13.8708195 7.8205549,14.0786195 7.4128449,14.1207195 L7.4128449,14.1207195 L7.2585449,14.1286195 C6.4787649,14.1286195 5.8381349,13.5337195 5.7653849,12.7731195 L5.7653849,12.7731195 L5.7585449,12.6286195 L5.7602549,10.5258195 L5.7756349,10.4384195 L5.7944349,10.3824195 L5.8266649,10.3168995 L5.8735349,10.2503695 L5.9177249,10.2039195 L12.6909149,3.89392948 L2.3403349,7.38903948 C2.2329149,7.42529948 2.1418449,7.49676948 2.0808149,7.59063948 L2.0808149,7.59063948 L2.0412649,7.66497948 C1.9440949,7.89044948 2.0258749,8.14788948 2.2236349,8.27917948 L2.2236349,8.27917948 L2.3029749,8.32214948 L4.4799849,9.26177948 C4.7333949,9.37121948 4.8503449,9.66546948 4.7409649,9.91894948 C4.6435549,10.1443495 4.4003949,10.2616595 4.1694349,10.2081295 L4.1694349,10.2081295 L4.0837449,10.1798795 L1.9072249,9.24047948 C1.1462449,8.91284948 0.795166898,8.03039948 1.1225549,7.26953948 C1.2700249,6.92755948 1.5380849,6.65435948 1.8730449,6.50018948 L1.8730449,6.50018948 L2.0205049,6.44158948 Z M6.7578149,11.3299195 L6.7585449,12.6286195 L6.7666013,12.7185103 C6.80894095,12.9517898 7.0131049,13.1286195 7.2585449,13.1286195 C7.3828149,13.1286195 7.5014649,13.0824195 7.5925349,13.0008195 L7.5925349,13.0008195 L7.6550349,12.9332195 L8.3569349,12.0179195 L6.7578149,11.3299195 Z M13.9888149,4.05090948 L7.1599149,10.4129195 L11.9795149,12.4886195 C11.9980149,12.4966195 12.0173149,12.5035195 12.0369149,12.5093195 L12.0369149,12.5093195 L12.0964149,12.5228195 C12.3386149,12.5624195 12.5686149,12.4209195 12.6482149,12.1975195 L12.6482149,12.1975195 L12.6706149,12.1101195 L13.9888149,4.05090948 Z" })
|
|
256
|
+
], -1)
|
|
257
|
+
]));
|
|
258
|
+
}
|
|
259
|
+
const Lt = /* @__PURE__ */ L(bt, [["render", Ct]]), $t = /* @__PURE__ */ T({
|
|
223
260
|
__name: "button",
|
|
224
261
|
setup(e) {
|
|
225
|
-
const { inputValue: t, rootProps: n, rootEmits:
|
|
226
|
-
n.loading ?
|
|
262
|
+
const { inputValue: t, rootProps: n, rootEmits: i } = me(oe), c = () => {
|
|
263
|
+
n.loading ? i("cancel") : (i("submit", t.value), t.value = "");
|
|
227
264
|
};
|
|
228
|
-
return (o,
|
|
265
|
+
return (o, r) => (l(), B(u(Ze), {
|
|
229
266
|
variant: "solid",
|
|
230
|
-
icon: d(n).loading ? "icon-loading-2" : "publish-new",
|
|
231
267
|
shape: "round",
|
|
232
|
-
disabled:
|
|
233
|
-
class:
|
|
234
|
-
onClick:
|
|
268
|
+
disabled: u(n).disabled || !u(n).loading && !u(t),
|
|
269
|
+
class: $(["mc-button", { "mc-button-loading": u(n).loading }]),
|
|
270
|
+
onClick: c
|
|
235
271
|
}, {
|
|
236
|
-
default:
|
|
237
|
-
|
|
272
|
+
default: x(() => [
|
|
273
|
+
u(n).loading ? (l(), B(ht, { key: 0 })) : (l(), B(Lt, { key: 1 })),
|
|
274
|
+
_("span", null, S(u(n).loading ? "暂停回答" : "发送"), 1)
|
|
238
275
|
]),
|
|
239
276
|
_: 1
|
|
240
|
-
}, 8, ["
|
|
277
|
+
}, 8, ["disabled", "class"]));
|
|
241
278
|
}
|
|
242
|
-
}),
|
|
279
|
+
}), ae = /* @__PURE__ */ L($t, [["__scopeId", "data-v-4b65a940"]]), St = { class: "mc-input-content" }, kt = {
|
|
243
280
|
key: 0,
|
|
244
281
|
class: "mc-input-foot"
|
|
245
|
-
},
|
|
282
|
+
}, Tt = { class: "mc-input-foot-left" }, wt = {
|
|
246
283
|
key: 0,
|
|
247
284
|
class: "mc-input-foot-count"
|
|
248
|
-
},
|
|
285
|
+
}, Et = /* @__PURE__ */ T({
|
|
249
286
|
__name: "Input",
|
|
250
|
-
props:
|
|
251
|
-
emits:
|
|
287
|
+
props: ft,
|
|
288
|
+
emits: mt,
|
|
252
289
|
setup(e, { expose: t, emit: n }) {
|
|
253
|
-
const
|
|
290
|
+
const i = e, c = n, o = j(""), r = () => {
|
|
254
291
|
o.value = "";
|
|
255
|
-
},
|
|
256
|
-
return
|
|
257
|
-
() =>
|
|
292
|
+
}, a = () => o.value;
|
|
293
|
+
return ge(
|
|
294
|
+
() => i.value,
|
|
258
295
|
() => {
|
|
259
|
-
o.value =
|
|
296
|
+
o.value = i.value;
|
|
260
297
|
},
|
|
261
298
|
{ immediate: !0 }
|
|
262
|
-
), t({ clearInput:
|
|
263
|
-
class:
|
|
299
|
+
), t({ clearInput: r, getInput: a }), we(oe, { inputValue: o, rootProps: i, rootEmits: c }), (s, f) => (l(), d("div", {
|
|
300
|
+
class: $(["mc-input", { "mc-input-disabled": s.disabled }])
|
|
264
301
|
}, [
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
]) :
|
|
302
|
+
y(s.$slots, "head"),
|
|
303
|
+
_("div", St, [
|
|
304
|
+
y(s.$slots, "prefix"),
|
|
305
|
+
I(pt),
|
|
306
|
+
s.displayType === u(G).Simple ? y(s.$slots, "button", { key: 0 }, () => [
|
|
307
|
+
I(ae)
|
|
308
|
+
]) : h("", !0)
|
|
272
309
|
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
310
|
+
s.displayType === u(G).Full ? (l(), d("div", kt, [
|
|
311
|
+
_("div", Tt, [
|
|
312
|
+
y(s.$slots, "extra"),
|
|
313
|
+
s.showCount ? (l(), d("span", wt, S(o.value.length) + S(s.maxLength ?? !1 ? `/${s.maxLength}` : ""), 1)) : h("", !0)
|
|
277
314
|
]),
|
|
278
|
-
|
|
279
|
-
|
|
315
|
+
y(s.$slots, "button", {}, () => [
|
|
316
|
+
I(ae)
|
|
280
317
|
])
|
|
281
|
-
])) :
|
|
318
|
+
])) : h("", !0)
|
|
282
319
|
], 2));
|
|
283
320
|
}
|
|
284
|
-
}),
|
|
321
|
+
}), It = {
|
|
285
322
|
logoImg: {
|
|
286
323
|
type: String,
|
|
287
324
|
default: ""
|
|
@@ -306,37 +343,37 @@ const at = {
|
|
|
306
343
|
type: String,
|
|
307
344
|
default: "center"
|
|
308
345
|
}
|
|
309
|
-
},
|
|
346
|
+
}, Mt = { class: "mc-introduction-logo-container" }, At = ["src", "alt"], Pt = { class: "mc-introduction-title" }, Ot = {
|
|
310
347
|
key: 0,
|
|
311
348
|
class: "mc-introduction-sub-title"
|
|
312
|
-
},
|
|
349
|
+
}, Bt = {
|
|
313
350
|
key: 1,
|
|
314
351
|
class: "mc-introduction-description"
|
|
315
|
-
},
|
|
352
|
+
}, jt = /* @__PURE__ */ T({
|
|
316
353
|
__name: "Introduction",
|
|
317
|
-
props:
|
|
354
|
+
props: It,
|
|
318
355
|
setup(e) {
|
|
319
|
-
return (t, n) => (l(),
|
|
320
|
-
class:
|
|
356
|
+
return (t, n) => (l(), d("div", {
|
|
357
|
+
class: $(["mc-introduction", [t.align, t.background]])
|
|
321
358
|
}, [
|
|
322
|
-
|
|
323
|
-
t.logoImg ? (l(),
|
|
359
|
+
_("div", Mt, [
|
|
360
|
+
t.logoImg ? (l(), d("img", {
|
|
324
361
|
key: 0,
|
|
325
362
|
src: t.logoImg,
|
|
326
363
|
alt: t.title
|
|
327
|
-
}, null, 8,
|
|
328
|
-
|
|
364
|
+
}, null, 8, At)) : h("", !0),
|
|
365
|
+
_("div", Pt, S(t.title), 1)
|
|
329
366
|
]),
|
|
330
|
-
t.subTitle ? (l(),
|
|
331
|
-
t.description.length ? (l(),
|
|
332
|
-
(l(!0),
|
|
333
|
-
])) :
|
|
334
|
-
|
|
367
|
+
t.subTitle ? (l(), d("div", Ot, S(t.subTitle), 1)) : h("", !0),
|
|
368
|
+
t.description.length ? (l(), d("div", Bt, [
|
|
369
|
+
(l(!0), d(D, null, ve(t.description, (i, c) => (l(), d("div", { key: c }, S(i), 1))), 128))
|
|
370
|
+
])) : h("", !0),
|
|
371
|
+
y(t.$slots, "default", {}, void 0, !0)
|
|
335
372
|
], 2));
|
|
336
373
|
}
|
|
337
|
-
}),
|
|
338
|
-
var
|
|
339
|
-
const
|
|
374
|
+
}), Vt = /* @__PURE__ */ L(jt, [["__scopeId", "data-v-48b255c7"]]);
|
|
375
|
+
var W = /* @__PURE__ */ ((e) => (e.Horizontal = "horizontal", e.Vertical = "vertical", e))(W || {}), re = /* @__PURE__ */ ((e) => (e.Transparent = "transparent", e.Filled = "filled", e.Bordered = "bordered", e.None = "none", e))(re || {});
|
|
376
|
+
const Ht = {
|
|
340
377
|
direction: {
|
|
341
378
|
type: String,
|
|
342
379
|
default: "vertical"
|
|
@@ -370,79 +407,79 @@ const St = {
|
|
|
370
407
|
type: Boolean,
|
|
371
408
|
default: !0
|
|
372
409
|
}
|
|
373
|
-
},
|
|
374
|
-
function
|
|
375
|
-
const n =
|
|
376
|
-
if (!
|
|
410
|
+
}, Kt = 50, Nt = ["TEXTAREA", "INPUT"], Rt = "ArrowUp", Zt = "ArrowDown", zt = "Enter";
|
|
411
|
+
function Dt(e, t) {
|
|
412
|
+
const n = j(e.enableShortKey ? 0 : -1), i = (r) => {
|
|
413
|
+
if (!r.disabled) {
|
|
377
414
|
if (e.selectable)
|
|
378
|
-
for (let
|
|
379
|
-
e.data[
|
|
380
|
-
t("select", { ...
|
|
415
|
+
for (let a = 0; a < e.data.length; a++)
|
|
416
|
+
e.data[a].active = e.data[a].value === r.value;
|
|
417
|
+
t("select", { ...r });
|
|
381
418
|
}
|
|
382
|
-
},
|
|
383
|
-
if (!e.enableLazyLoad || e.direction !==
|
|
419
|
+
}, c = (r) => {
|
|
420
|
+
if (!e.enableLazyLoad || e.direction !== W.Vertical)
|
|
384
421
|
return;
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
}, o = (
|
|
388
|
-
|
|
422
|
+
const a = r.target, s = a.scrollHeight, f = a.clientHeight, g = a.scrollTop;
|
|
423
|
+
s - f - g < Kt && t("loadMore", r);
|
|
424
|
+
}, o = (r) => {
|
|
425
|
+
r.code === Rt && (n.value = n.value === 0 ? e.data.length - 1 : n.value - 1), r.code === Zt && (n.value = n.value === e.data.length - 1 ? 0 : n.value + 1), r.code === zt && (e.selectable && (e.data[n.value].active = !0), t("select", { ...e.data[n.value] }));
|
|
389
426
|
};
|
|
390
|
-
return
|
|
391
|
-
let
|
|
427
|
+
return ye(() => {
|
|
428
|
+
let r;
|
|
392
429
|
if (e.inputEl) {
|
|
393
|
-
const
|
|
394
|
-
|
|
430
|
+
const a = e.inputEl.$el ?? e.inputEl;
|
|
431
|
+
Nt.includes(a.tagName) ? r = a : r = a.querySelector("textarea") || a.querySelector("input") || document;
|
|
395
432
|
} else
|
|
396
|
-
|
|
397
|
-
e.enableShortKey &&
|
|
398
|
-
}), { preSelectIndex: n, onItemClick:
|
|
433
|
+
r = document;
|
|
434
|
+
e.enableShortKey && r.addEventListener("keydown", o);
|
|
435
|
+
}), { preSelectIndex: n, onItemClick: i, onListScroll: c };
|
|
399
436
|
}
|
|
400
|
-
function
|
|
401
|
-
return { listClasses:
|
|
437
|
+
function Wt(e) {
|
|
438
|
+
return { listClasses: U(() => ({
|
|
402
439
|
"mc-list": !0,
|
|
403
|
-
"mc-list-horizontal": e.direction ===
|
|
404
|
-
"mc-list-nowrap": e.direction ===
|
|
440
|
+
"mc-list-horizontal": e.direction === W.Horizontal,
|
|
441
|
+
"mc-list-nowrap": e.direction === W.Horizontal && !e.autoWrap
|
|
405
442
|
})) };
|
|
406
443
|
}
|
|
407
|
-
const
|
|
444
|
+
const Ft = ["onClick"], Ut = /* @__PURE__ */ T({
|
|
408
445
|
__name: "List",
|
|
409
|
-
props:
|
|
446
|
+
props: Ht,
|
|
410
447
|
emits: ["select", "loadMore"],
|
|
411
448
|
setup(e, { emit: t }) {
|
|
412
|
-
const n = e,
|
|
413
|
-
return (
|
|
414
|
-
class:
|
|
415
|
-
onScroll:
|
|
416
|
-
(...g) =>
|
|
449
|
+
const n = e, i = t, { listClasses: c } = Wt(n), { preSelectIndex: o, onItemClick: r, onListScroll: a } = Dt(n, i);
|
|
450
|
+
return (s, f) => (l(), d("div", {
|
|
451
|
+
class: $(u(c)),
|
|
452
|
+
onScroll: f[0] || (f[0] = //@ts-ignore
|
|
453
|
+
(...g) => u(a) && u(a)(...g))
|
|
417
454
|
}, [
|
|
418
|
-
(l(!0),
|
|
419
|
-
|
|
455
|
+
(l(!0), d(D, null, ve(s.data, (g, m) => (l(), d(D, { key: m }, [
|
|
456
|
+
s.variant === u(re).None ? y(s.$slots, "item", {
|
|
420
457
|
key: 0,
|
|
421
458
|
item: g
|
|
422
|
-
}, void 0, !0) : (l(),
|
|
459
|
+
}, void 0, !0) : (l(), d("div", {
|
|
423
460
|
key: 1,
|
|
424
|
-
class:
|
|
461
|
+
class: $([
|
|
425
462
|
"mc-list-item",
|
|
426
463
|
{
|
|
427
464
|
"mc-list-item-disabled": g.disabled,
|
|
428
465
|
"mc-list-item-active": g.active,
|
|
429
|
-
"mc-list-item-pre-selection":
|
|
466
|
+
"mc-list-item-pre-selection": m === u(o)
|
|
430
467
|
},
|
|
431
|
-
|
|
468
|
+
s.variant
|
|
432
469
|
]),
|
|
433
|
-
onClick: () =>
|
|
470
|
+
onClick: () => u(r)(g)
|
|
434
471
|
}, [
|
|
435
|
-
|
|
436
|
-
|
|
472
|
+
y(s.$slots, "item", { item: g }, () => [
|
|
473
|
+
fe(S(g.label), 1)
|
|
437
474
|
], !0)
|
|
438
|
-
], 10,
|
|
475
|
+
], 10, Ft))
|
|
439
476
|
], 64))), 128))
|
|
440
477
|
], 34));
|
|
441
478
|
}
|
|
442
|
-
}),
|
|
479
|
+
}), he = /* @__PURE__ */ L(Ut, [["__scopeId", "data-v-adad50a4"]]), xt = {
|
|
443
480
|
direction: {
|
|
444
481
|
type: String,
|
|
445
|
-
default:
|
|
482
|
+
default: W.Vertical
|
|
446
483
|
},
|
|
447
484
|
list: {
|
|
448
485
|
type: Array,
|
|
@@ -450,57 +487,57 @@ const At = ["onClick"], Pt = /* @__PURE__ */ C({
|
|
|
450
487
|
},
|
|
451
488
|
variant: {
|
|
452
489
|
type: String,
|
|
453
|
-
default:
|
|
490
|
+
default: re.Filled
|
|
454
491
|
}
|
|
455
|
-
},
|
|
492
|
+
}, Gt = {
|
|
456
493
|
prompt: {
|
|
457
494
|
type: Object
|
|
458
495
|
}
|
|
459
|
-
},
|
|
496
|
+
}, qt = { class: "mc-prompt-item" }, Xt = {
|
|
460
497
|
key: 0,
|
|
461
498
|
class: "mc-prompt-item-content"
|
|
462
|
-
},
|
|
499
|
+
}, Jt = {
|
|
463
500
|
key: 0,
|
|
464
501
|
class: "mc-prompt-item-label"
|
|
465
|
-
},
|
|
502
|
+
}, Qt = {
|
|
466
503
|
key: 1,
|
|
467
504
|
class: "mc-prompt-item-description"
|
|
468
|
-
},
|
|
505
|
+
}, Yt = /* @__PURE__ */ T({
|
|
469
506
|
__name: "PromptItem",
|
|
470
|
-
props:
|
|
507
|
+
props: Gt,
|
|
471
508
|
setup(e) {
|
|
472
509
|
return (t, n) => {
|
|
473
|
-
var
|
|
474
|
-
return l(),
|
|
475
|
-
|
|
476
|
-
class:
|
|
510
|
+
var i, c, o, r, a, s, f, g, m;
|
|
511
|
+
return l(), d("div", qt, [
|
|
512
|
+
_("div", {
|
|
513
|
+
class: $(["mc-prompt-item-icon", { "no-description": !((i = t.prompt) != null && i.desc) }])
|
|
477
514
|
}, [
|
|
478
|
-
(
|
|
515
|
+
(c = t.prompt) != null && c.iconConfig ? (l(), B(u(ze), ue(Ee({ key: 0 }, (o = t.prompt) == null ? void 0 : o.iconConfig)), null, 16)) : h("", !0)
|
|
479
516
|
], 2),
|
|
480
|
-
(
|
|
481
|
-
(
|
|
482
|
-
(g = t.prompt) != null && g.desc ? (l(),
|
|
483
|
-
])) :
|
|
517
|
+
(r = t.prompt) != null && r.label || (a = t.prompt) != null && a.desc ? (l(), d("div", Xt, [
|
|
518
|
+
(s = t.prompt) != null && s.label ? (l(), d("div", Jt, S((f = t.prompt) == null ? void 0 : f.label), 1)) : h("", !0),
|
|
519
|
+
(g = t.prompt) != null && g.desc ? (l(), d("div", Qt, S((m = t.prompt) == null ? void 0 : m.desc), 1)) : h("", !0)
|
|
520
|
+
])) : h("", !0)
|
|
484
521
|
]);
|
|
485
522
|
};
|
|
486
523
|
}
|
|
487
|
-
}),
|
|
524
|
+
}), en = /* @__PURE__ */ L(Yt, [["__scopeId", "data-v-5f016595"]]), tn = { class: "mc-prompt" }, nn = /* @__PURE__ */ T({
|
|
488
525
|
__name: "Prompt",
|
|
489
|
-
props:
|
|
526
|
+
props: xt,
|
|
490
527
|
emits: ["itemClick"],
|
|
491
528
|
setup(e, { emit: t }) {
|
|
492
|
-
const n = t,
|
|
493
|
-
return (
|
|
494
|
-
|
|
495
|
-
data:
|
|
496
|
-
direction:
|
|
497
|
-
variant:
|
|
529
|
+
const n = t, i = e;
|
|
530
|
+
return (c, o) => (l(), d("div", tn, [
|
|
531
|
+
I(he, {
|
|
532
|
+
data: i.list,
|
|
533
|
+
direction: i.direction,
|
|
534
|
+
variant: i.variant,
|
|
498
535
|
selectable: !1
|
|
499
536
|
}, {
|
|
500
|
-
item:
|
|
501
|
-
|
|
502
|
-
prompt:
|
|
503
|
-
onClick: (
|
|
537
|
+
item: x(({ item: r }) => [
|
|
538
|
+
I(en, {
|
|
539
|
+
prompt: r,
|
|
540
|
+
onClick: (a) => n("itemClick", r)
|
|
504
541
|
}, null, 8, ["prompt", "onClick"])
|
|
505
542
|
]),
|
|
506
543
|
_: 1
|
|
@@ -508,41 +545,41 @@ const At = ["onClick"], Pt = /* @__PURE__ */ C({
|
|
|
508
545
|
]));
|
|
509
546
|
}
|
|
510
547
|
});
|
|
511
|
-
function
|
|
512
|
-
return
|
|
548
|
+
function se(e) {
|
|
549
|
+
return Ae("span", {}, e);
|
|
513
550
|
}
|
|
514
|
-
function
|
|
551
|
+
function be(e) {
|
|
515
552
|
for (const t of e) {
|
|
516
|
-
if (
|
|
517
|
-
if (t.type ===
|
|
553
|
+
if (De(t)) {
|
|
554
|
+
if (t.type === Ie)
|
|
518
555
|
continue;
|
|
519
|
-
return t.type === "svg" || t.type ===
|
|
556
|
+
return t.type === "svg" || t.type === Me ? se(t) : t.type === D ? be(t.children) : t;
|
|
520
557
|
}
|
|
521
|
-
return
|
|
558
|
+
return se(t);
|
|
522
559
|
}
|
|
523
560
|
return null;
|
|
524
561
|
}
|
|
525
|
-
const
|
|
562
|
+
const on = /* @__PURE__ */ T({
|
|
526
563
|
setup(e, t) {
|
|
527
564
|
const {
|
|
528
565
|
slots: n,
|
|
529
|
-
attrs:
|
|
530
|
-
expose:
|
|
531
|
-
} = t, o =
|
|
532
|
-
return
|
|
566
|
+
attrs: i,
|
|
567
|
+
expose: c
|
|
568
|
+
} = t, o = j();
|
|
569
|
+
return c({
|
|
533
570
|
triggerEl: o
|
|
534
571
|
}), () => {
|
|
535
|
-
var
|
|
536
|
-
const
|
|
537
|
-
if (!
|
|
572
|
+
var s;
|
|
573
|
+
const r = (s = n.default) == null ? void 0 : s.call(n, i);
|
|
574
|
+
if (!r)
|
|
538
575
|
return null;
|
|
539
|
-
const
|
|
540
|
-
return
|
|
541
|
-
mounted(
|
|
542
|
-
o.value =
|
|
576
|
+
const a = be(r);
|
|
577
|
+
return a ? Pe(Oe(a, i), [[{
|
|
578
|
+
mounted(f) {
|
|
579
|
+
o.value = f;
|
|
543
580
|
},
|
|
544
|
-
updated(
|
|
545
|
-
o.value =
|
|
581
|
+
updated(f) {
|
|
582
|
+
o.value = f;
|
|
546
583
|
},
|
|
547
584
|
unmounted() {
|
|
548
585
|
o.value = null;
|
|
@@ -550,7 +587,7 @@ const jt = /* @__PURE__ */ C({
|
|
|
550
587
|
}]]) : null;
|
|
551
588
|
};
|
|
552
589
|
}
|
|
553
|
-
}),
|
|
590
|
+
}), rn = {
|
|
554
591
|
modelValue: {
|
|
555
592
|
type: Boolean,
|
|
556
593
|
default: !1
|
|
@@ -566,160 +603,267 @@ const jt = /* @__PURE__ */ C({
|
|
|
566
603
|
menuClass: {
|
|
567
604
|
type: String
|
|
568
605
|
}
|
|
569
|
-
},
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
606
|
+
}, an = ["update:modelValue", "searchChange", "toggleChange"];
|
|
607
|
+
var sn = typeof global == "object" && global && global.Object === Object && global, ln = typeof self == "object" && self && self.Object === Object && self, _e = sn || ln || Function("return this")(), q = _e.Symbol, Ce = Object.prototype, cn = Ce.hasOwnProperty, dn = Ce.toString, Z = q ? q.toStringTag : void 0;
|
|
608
|
+
function un(e) {
|
|
609
|
+
var t = cn.call(e, Z), n = e[Z];
|
|
610
|
+
try {
|
|
611
|
+
e[Z] = void 0;
|
|
612
|
+
var i = !0;
|
|
613
|
+
} catch {
|
|
614
|
+
}
|
|
615
|
+
var c = dn.call(e);
|
|
616
|
+
return i && (t ? e[Z] = n : delete e[Z]), c;
|
|
617
|
+
}
|
|
618
|
+
var fn = Object.prototype, mn = fn.toString;
|
|
619
|
+
function pn(e) {
|
|
620
|
+
return mn.call(e);
|
|
621
|
+
}
|
|
622
|
+
var gn = "[object Null]", vn = "[object Undefined]", le = q ? q.toStringTag : void 0;
|
|
623
|
+
function yn(e) {
|
|
624
|
+
return e == null ? e === void 0 ? vn : gn : le && le in Object(e) ? un(e) : pn(e);
|
|
625
|
+
}
|
|
626
|
+
function hn(e) {
|
|
627
|
+
return e != null && typeof e == "object";
|
|
628
|
+
}
|
|
629
|
+
var bn = "[object Symbol]";
|
|
630
|
+
function _n(e) {
|
|
631
|
+
return typeof e == "symbol" || hn(e) && yn(e) == bn;
|
|
632
|
+
}
|
|
633
|
+
var Cn = /\s/;
|
|
634
|
+
function Ln(e) {
|
|
635
|
+
for (var t = e.length; t-- && Cn.test(e.charAt(t)); )
|
|
636
|
+
;
|
|
637
|
+
return t;
|
|
638
|
+
}
|
|
639
|
+
var $n = /^\s+/;
|
|
640
|
+
function Sn(e) {
|
|
641
|
+
return e && e.slice(0, Ln(e) + 1).replace($n, "");
|
|
642
|
+
}
|
|
643
|
+
function X(e) {
|
|
644
|
+
var t = typeof e;
|
|
645
|
+
return e != null && (t == "object" || t == "function");
|
|
646
|
+
}
|
|
647
|
+
var ce = NaN, kn = /^[-+]0x[0-9a-f]+$/i, Tn = /^0b[01]+$/i, wn = /^0o[0-7]+$/i, En = parseInt;
|
|
648
|
+
function de(e) {
|
|
649
|
+
if (typeof e == "number")
|
|
650
|
+
return e;
|
|
651
|
+
if (_n(e))
|
|
652
|
+
return ce;
|
|
653
|
+
if (X(e)) {
|
|
654
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
655
|
+
e = X(t) ? t + "" : t;
|
|
656
|
+
}
|
|
657
|
+
if (typeof e != "string")
|
|
658
|
+
return e === 0 ? e : +e;
|
|
659
|
+
e = Sn(e);
|
|
660
|
+
var n = Tn.test(e);
|
|
661
|
+
return n || wn.test(e) ? En(e.slice(2), n ? 2 : 8) : kn.test(e) ? ce : +e;
|
|
662
|
+
}
|
|
663
|
+
var te = function() {
|
|
664
|
+
return _e.Date.now();
|
|
665
|
+
}, In = "Expected a function", Mn = Math.max, An = Math.min;
|
|
666
|
+
function Pn(e, t, n) {
|
|
667
|
+
var i, c, o, r, a, s, f = 0, g = !1, m = !1, b = !0;
|
|
668
|
+
if (typeof e != "function")
|
|
669
|
+
throw new TypeError(In);
|
|
670
|
+
t = de(t) || 0, X(n) && (g = !!n.leading, m = "maxWait" in n, o = m ? Mn(de(n.maxWait) || 0, t) : o, b = "trailing" in n ? !!n.trailing : b);
|
|
671
|
+
function w(v) {
|
|
672
|
+
var k = i, E = c;
|
|
673
|
+
return i = c = void 0, f = v, r = e.apply(E, k), r;
|
|
674
|
+
}
|
|
675
|
+
function J(v) {
|
|
676
|
+
return f = v, a = setTimeout(A, t), g ? w(v) : r;
|
|
677
|
+
}
|
|
678
|
+
function Q(v) {
|
|
679
|
+
var k = v - s, E = v - f, F = t - k;
|
|
680
|
+
return m ? An(F, o - E) : F;
|
|
681
|
+
}
|
|
682
|
+
function V(v) {
|
|
683
|
+
var k = v - s, E = v - f;
|
|
684
|
+
return s === void 0 || k >= t || k < 0 || m && E >= o;
|
|
685
|
+
}
|
|
686
|
+
function A() {
|
|
687
|
+
var v = te();
|
|
688
|
+
if (V(v))
|
|
689
|
+
return M(v);
|
|
690
|
+
a = setTimeout(A, Q(v));
|
|
691
|
+
}
|
|
692
|
+
function M(v) {
|
|
693
|
+
return a = void 0, b && i ? w(v) : (i = c = void 0, r);
|
|
694
|
+
}
|
|
695
|
+
function Y() {
|
|
696
|
+
a !== void 0 && clearTimeout(a), f = 0, i = s = c = a = void 0;
|
|
697
|
+
}
|
|
698
|
+
function H() {
|
|
699
|
+
return a === void 0 ? r : M(te());
|
|
700
|
+
}
|
|
701
|
+
function P() {
|
|
702
|
+
var v = te(), k = V(v);
|
|
703
|
+
if (i = arguments, c = this, s = v, k) {
|
|
704
|
+
if (a === void 0)
|
|
705
|
+
return J(s);
|
|
706
|
+
if (m)
|
|
707
|
+
return clearTimeout(a), a = setTimeout(A, t), w(s);
|
|
708
|
+
}
|
|
709
|
+
return a === void 0 && (a = setTimeout(A, t)), r;
|
|
710
|
+
}
|
|
711
|
+
return P.cancel = Y, P.flush = H, P;
|
|
712
|
+
}
|
|
713
|
+
const ne = " ", On = "ArrowLeft", Bn = "ArrowRight", jn = "Escape";
|
|
714
|
+
function Vn(e, t) {
|
|
715
|
+
const n = j(), i = j(), c = j(), o = Be({ top: "0px", left: "0px", width: "" });
|
|
716
|
+
let r, a, s, f, g = "", m, b;
|
|
717
|
+
const w = async () => {
|
|
718
|
+
if (!i.value || !c.value)
|
|
575
719
|
return;
|
|
576
|
-
const { x:
|
|
720
|
+
const { x: p, y: C } = await We(i.value, c.value, {
|
|
577
721
|
strategy: "fixed",
|
|
578
722
|
placement: "top-start",
|
|
579
|
-
middleware: [
|
|
723
|
+
middleware: [Fe(4)]
|
|
580
724
|
});
|
|
581
|
-
o.top = `${
|
|
582
|
-
},
|
|
583
|
-
const { width:
|
|
584
|
-
o.width = `${
|
|
585
|
-
},
|
|
586
|
-
e.fitHostWidth && typeof window < "u" &&
|
|
587
|
-
},
|
|
588
|
-
|
|
725
|
+
o.top = `${C}px`, o.left = `${p}px`;
|
|
726
|
+
}, J = () => {
|
|
727
|
+
const { width: p } = i.value.getBoundingClientRect();
|
|
728
|
+
o.width = `${p}px`, w();
|
|
729
|
+
}, Q = () => {
|
|
730
|
+
e.fitHostWidth && typeof window < "u" && i.value && (b = new window.ResizeObserver(J), b.observe(i.value));
|
|
731
|
+
}, V = () => {
|
|
732
|
+
i.value && (b == null || b.unobserve(i.value));
|
|
589
733
|
};
|
|
590
|
-
|
|
734
|
+
ge(
|
|
591
735
|
() => e.modelValue,
|
|
592
|
-
(
|
|
593
|
-
|
|
736
|
+
(p, C) => {
|
|
737
|
+
p ? (pe(w), Q(), typeof window < "u" && window.addEventListener("scroll", E, !0)) : (V(), typeof window < "u" && window.removeEventListener("scroll", E, !0)), C !== void 0 && t("toggleChange", p);
|
|
594
738
|
},
|
|
595
739
|
{ immediate: !0 }
|
|
596
740
|
);
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
},
|
|
600
|
-
t("update:modelValue",
|
|
601
|
-
},
|
|
602
|
-
if (!
|
|
741
|
+
const A = () => {
|
|
742
|
+
a = null, s = -1, f = -1, g = "";
|
|
743
|
+
}, M = (p) => {
|
|
744
|
+
t("update:modelValue", p);
|
|
745
|
+
}, Y = () => {
|
|
746
|
+
if (!r)
|
|
603
747
|
return;
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
|
|
748
|
+
const p = r.value.replace(/[\r\n]/g, ne) || "", C = r.selectionStart;
|
|
749
|
+
if (!p.trim() || !C) {
|
|
750
|
+
A();
|
|
607
751
|
return;
|
|
608
752
|
}
|
|
609
|
-
for (let
|
|
610
|
-
const
|
|
611
|
-
let
|
|
612
|
-
if (typeof
|
|
613
|
-
|
|
614
|
-
else if (
|
|
615
|
-
|
|
753
|
+
for (let O = 0; O < e.prefix.length; O++) {
|
|
754
|
+
const K = e.prefix[O];
|
|
755
|
+
let N = "", ie = !1;
|
|
756
|
+
if (typeof K == "string")
|
|
757
|
+
N = K;
|
|
758
|
+
else if (X(K))
|
|
759
|
+
N = K.key, ie = !!K.onlyInputStart;
|
|
616
760
|
else
|
|
617
761
|
continue;
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
|
|
762
|
+
const R = p.lastIndexOf(N, C), Le = p.lastIndexOf(ne, C), ee = p.substring(R, C), $e = ee.charAt(ee.length - 1);
|
|
763
|
+
if (R < 0 || R > 0 && ie || R < Le || $e === ne)
|
|
764
|
+
A();
|
|
621
765
|
else {
|
|
622
|
-
|
|
766
|
+
a = N, s = R, f = C, g = ee.slice(N.length);
|
|
623
767
|
return;
|
|
624
768
|
}
|
|
625
769
|
}
|
|
626
|
-
},
|
|
627
|
-
if (
|
|
628
|
-
|
|
770
|
+
}, H = () => {
|
|
771
|
+
if (Y(), !a) {
|
|
772
|
+
M(!1);
|
|
629
773
|
return;
|
|
630
774
|
}
|
|
631
|
-
t("searchChange", { value: g, trigger:
|
|
632
|
-
},
|
|
633
|
-
(
|
|
634
|
-
|
|
635
|
-
})),
|
|
636
|
-
},
|
|
637
|
-
var
|
|
638
|
-
e.modelValue ? (
|
|
775
|
+
t("searchChange", { value: g, trigger: a, triggerIndex: s, cursorIndex: f }), M(!0);
|
|
776
|
+
}, P = Pn(H, 300), v = (p) => {
|
|
777
|
+
(p.code === On || p.code === Bn) && (m = setTimeout(() => {
|
|
778
|
+
H(), m && (m = void 0, clearTimeout(m));
|
|
779
|
+
})), p.code === jn && M(!1);
|
|
780
|
+
}, k = (p) => {
|
|
781
|
+
var C, O;
|
|
782
|
+
e.modelValue ? (C = i.value) != null && C.contains(p.target) || M(!1) : (O = i.value) != null && O.contains(p.target) && H();
|
|
639
783
|
};
|
|
640
|
-
function
|
|
641
|
-
const
|
|
642
|
-
|
|
784
|
+
function E(p) {
|
|
785
|
+
const C = p.target;
|
|
786
|
+
C != null && C.contains(i.value) && w();
|
|
643
787
|
}
|
|
644
|
-
const
|
|
645
|
-
|
|
788
|
+
const F = () => {
|
|
789
|
+
i.value && (r = i.value.querySelector("textarea") || i.value.querySelector("input"), r && (r.addEventListener("input", P), r.addEventListener("keydown", v))), document.addEventListener("click", k);
|
|
646
790
|
};
|
|
647
|
-
return
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
}),
|
|
651
|
-
|
|
652
|
-
}), { popperTriggerEl: n, overlayEl:
|
|
791
|
+
return ye(() => {
|
|
792
|
+
const p = n.value.triggerEl;
|
|
793
|
+
i.value = p.$el ?? p, F();
|
|
794
|
+
}), je(() => {
|
|
795
|
+
M(!1), r == null || r.removeEventListener("input", P), r == null || r.removeEventListener("keydown", v), document.removeEventListener("click", k), typeof window < "u" && window.removeEventListener("scroll", E, !0), V();
|
|
796
|
+
}), { popperTriggerEl: n, overlayEl: c, overlayStyle: o };
|
|
653
797
|
}
|
|
654
|
-
const
|
|
798
|
+
const Hn = /* @__PURE__ */ T({
|
|
655
799
|
__name: "Mention",
|
|
656
|
-
props:
|
|
657
|
-
emits:
|
|
800
|
+
props: rn,
|
|
801
|
+
emits: an,
|
|
658
802
|
setup(e, { emit: t }) {
|
|
659
|
-
const n = e,
|
|
660
|
-
return (
|
|
661
|
-
|
|
803
|
+
const n = e, i = t, { popperTriggerEl: c, overlayEl: o, overlayStyle: r } = Vn(n, i);
|
|
804
|
+
return (a, s) => (l(), d(D, null, [
|
|
805
|
+
I(u(on), {
|
|
662
806
|
ref_key: "popperTriggerEl",
|
|
663
|
-
ref:
|
|
807
|
+
ref: c
|
|
664
808
|
}, {
|
|
665
|
-
default:
|
|
666
|
-
|
|
809
|
+
default: x(() => [
|
|
810
|
+
y(a.$slots, "default", {}, void 0, !0)
|
|
667
811
|
]),
|
|
668
812
|
_: 3
|
|
669
813
|
}, 512),
|
|
670
|
-
(l(),
|
|
671
|
-
|
|
672
|
-
default:
|
|
673
|
-
|
|
814
|
+
(l(), B(Ve, { to: "body" }, [
|
|
815
|
+
I(He, { name: "mc-mention-fade" }, {
|
|
816
|
+
default: x(() => [
|
|
817
|
+
a.modelValue ? (l(), d("div", {
|
|
674
818
|
key: 0,
|
|
675
819
|
ref_key: "overlayEl",
|
|
676
820
|
ref: o,
|
|
677
|
-
class:
|
|
678
|
-
style:
|
|
821
|
+
class: $(["mc-mention", a.menuClass]),
|
|
822
|
+
style: Ke(u(r))
|
|
679
823
|
}, [
|
|
680
|
-
|
|
681
|
-
], 6)) :
|
|
824
|
+
y(a.$slots, "menu", {}, void 0, !0)
|
|
825
|
+
], 6)) : h("", !0)
|
|
682
826
|
]),
|
|
683
827
|
_: 3
|
|
684
828
|
})
|
|
685
829
|
]))
|
|
686
830
|
], 64));
|
|
687
831
|
}
|
|
688
|
-
}),
|
|
689
|
-
function
|
|
690
|
-
return l(),
|
|
691
|
-
|
|
832
|
+
}), Kn = /* @__PURE__ */ L(Hn, [["__scopeId", "data-v-196371c8"]]), Nn = {}, Rn = { class: "mc-layout" };
|
|
833
|
+
function Zn(e, t) {
|
|
834
|
+
return l(), d("div", Rn, [
|
|
835
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
692
836
|
]);
|
|
693
837
|
}
|
|
694
|
-
const
|
|
695
|
-
function
|
|
696
|
-
return l(),
|
|
697
|
-
|
|
838
|
+
const zn = /* @__PURE__ */ L(Nn, [["render", Zn], ["__scopeId", "data-v-f08e803e"]]), Dn = {}, Wn = { class: "mc-layout-content" };
|
|
839
|
+
function Fn(e, t) {
|
|
840
|
+
return l(), d("div", Wn, [
|
|
841
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
698
842
|
]);
|
|
699
843
|
}
|
|
700
|
-
const
|
|
701
|
-
function
|
|
702
|
-
return l(),
|
|
703
|
-
|
|
844
|
+
const Un = /* @__PURE__ */ L(Dn, [["render", Fn], ["__scopeId", "data-v-74f98b9a"]]), xn = {}, Gn = { class: "mc-layout-header" };
|
|
845
|
+
function qn(e, t) {
|
|
846
|
+
return l(), d("div", Gn, [
|
|
847
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
704
848
|
]);
|
|
705
849
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
708
|
-
return l(),
|
|
709
|
-
|
|
850
|
+
const Xn = /* @__PURE__ */ L(xn, [["render", qn], ["__scopeId", "data-v-cfa1505b"]]), Jn = {}, Qn = { class: "mc-layout-aside" };
|
|
851
|
+
function Yn(e, t) {
|
|
852
|
+
return l(), d("div", Qn, [
|
|
853
|
+
y(e.$slots, "default")
|
|
710
854
|
]);
|
|
711
855
|
}
|
|
712
|
-
const
|
|
713
|
-
function
|
|
714
|
-
return l(),
|
|
715
|
-
|
|
856
|
+
const eo = /* @__PURE__ */ L(Jn, [["render", Yn]]), to = {}, no = { class: "mc-layout-sender" };
|
|
857
|
+
function oo(e, t) {
|
|
858
|
+
return l(), d("div", no, [
|
|
859
|
+
y(e.$slots, "default")
|
|
716
860
|
]);
|
|
717
861
|
}
|
|
718
|
-
const
|
|
862
|
+
const ro = /* @__PURE__ */ L(to, [["render", oo]]), yo = {
|
|
719
863
|
install(e) {
|
|
720
|
-
e.component("McHeader",
|
|
864
|
+
e.component("McHeader", Qe), e.component("McBubble", ut), e.component("McInput", Et), e.component("McIntroduction", Vt), e.component("McPrompt", nn), e.component("McList", he), e.component("McMention", Kn), e.component("McLayout", zn), e.component("McLayoutContent", Un), e.component("McLayoutHeader", Xn), e.component("McLayoutAside", eo), e.component("McLayoutSender", ro);
|
|
721
865
|
}
|
|
722
866
|
};
|
|
723
867
|
export {
|
|
724
|
-
|
|
868
|
+
yo as default
|
|
725
869
|
};
|