@matechat/core 1.11.0 → 1.12.0-alpha

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 (45) hide show
  1. package/Attachment/Attachment.vue.d.ts +8 -8
  2. package/Attachment/attachment-types.d.ts +3 -35
  3. package/Attachment/index.css +1 -1
  4. package/Attachment/index.js +43 -45
  5. package/Bubble/index.css +1 -1
  6. package/Bubble/index.js +322 -186
  7. package/Bubble/useBubbleFoundation.d.ts +9 -0
  8. package/FileList/index.js +1 -1
  9. package/Header/index.css +1 -1
  10. package/Header/index.js +12 -11
  11. package/Input/components/EditableBlock.vue.d.ts +2 -2
  12. package/Input/index.css +1 -1
  13. package/Input/index.js +699 -108
  14. package/Introduction/index.css +1 -1
  15. package/Introduction/index.js +138 -38
  16. package/Layout/index.js +7 -6
  17. package/List/index.css +1 -1
  18. package/List/index.js +54 -51
  19. package/Locale/index.js +85 -35
  20. package/MarkdownCard/MDCardParser.d.ts +0 -10
  21. package/MarkdownCard/MermaidService-yeLQUW_e.js +142 -0
  22. package/MarkdownCard/index.css +1 -1
  23. package/MarkdownCard/index.js +735 -200
  24. package/MarkdownCard/mdCard.types.d.ts +2 -29
  25. package/MarkdownCard/mdCard.vue.d.ts +2 -2
  26. package/MarkdownCard/useMarkdownCardFoundation.d.ts +8 -0
  27. package/Mention/Mention.vue.d.ts +12 -3
  28. package/Mention/index.css +1 -1
  29. package/Mention/index.js +365 -110
  30. package/Mention/mention-types.d.ts +6 -4
  31. package/Mention/use-mention.d.ts +7 -0
  32. package/Prompt/index.js +1 -1
  33. package/README.md +8 -12
  34. package/Toolbar/index.css +1 -1
  35. package/Toolbar/index.d.ts +2 -1
  36. package/Toolbar/index.js +189 -198
  37. package/Toolbar/toolbar.types.d.ts +2 -26
  38. package/index.d.ts +18 -6
  39. package/mate-chat.js +17 -2
  40. package/package.json +1 -4
  41. package/Attachment/uploader.d.ts +0 -11
  42. package/MarkdownCard/MDCardService.d.ts +0 -14
  43. package/MarkdownCard/MermaidService-B6BcjbW_.js +0 -127
  44. package/MarkdownCard/MermaidService.d.ts +0 -22
  45. package/Mention/const.d.ts +0 -4
package/Input/index.js CHANGED
@@ -1,11 +1,20 @@
1
- import { defineComponent as E, inject as Z, computed as N, withDirectives as D, createElementBlock as d, openBlock as c, normalizeClass as S, unref as n, isRef as F, vModelText as j, nextTick as z, createElementVNode as f, ref as w, reactive as W, createCommentVNode as _, createBlock as $, toDisplayString as x, normalizeStyle as A, watch as O, provide as R, renderSlot as h, createVNode as b } from "vue";
2
- import { useMcI18n as B } from "@matechat/core/Locale";
3
- var g = /* @__PURE__ */ ((t) => (t.Simple = "simple", t.Full = "full", t))(g || {}), v = /* @__PURE__ */ ((t) => (t.Enter = "enter", t.ShiftEnter = "shiftEnter", t))(v || {});
4
- const U = {
1
+ import "./index.css";
2
+ import { ref as w, defineComponent as X, inject as oe, computed as ae, watch as Y, onMounted as te, withDirectives as be, openBlock as m, createElementBlock as x, normalizeClass as q, unref as g, normalizeStyle as ce, isRef as ye, vModelText as xe, nextTick as de, createElementVNode as $, withModifiers as le, toDisplayString as Z, resolveComponent as Ce, createCommentVNode as _, createBlock as O, withCtx as pe, renderSlot as A, Fragment as ee, renderList as Te, createTextVNode as Le, reactive as Se, provide as _e, createVNode as ie } from "vue";
3
+ import { useMcI18n as fe } from "@matechat/core/Locale";
4
+ var V = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(V || {}), me = /* @__PURE__ */ ((n) => (n.Bordered = "bordered", n.BorderLess = "borderless", n))(me || {}), ne = /* @__PURE__ */ ((n) => (n.Simple = "simple", n.Full = "full", n))(ne || {}), K = /* @__PURE__ */ ((n) => (n.Enter = "enter", n.ShiftEnter = "shiftEnter", n))(K || {});
5
+ const we = {
6
+ minRows: 1,
7
+ maxRows: 5
8
+ }, ke = {
5
9
  value: {
6
10
  type: String,
7
11
  default: ""
8
12
  },
13
+ formatContentOptions: {
14
+ type: Object,
15
+ default: () => {
16
+ }
17
+ },
9
18
  placeholder: {
10
19
  type: String
11
20
  },
@@ -18,6 +27,16 @@ const U = {
18
27
  default: "full"
19
28
  /* Full */
20
29
  },
30
+ variant: {
31
+ type: String,
32
+ default: "bordered"
33
+ /* Bordered */
34
+ },
35
+ sendBtnVariant: {
36
+ type: String,
37
+ default: "full"
38
+ /* Full */
39
+ },
21
40
  loading: {
22
41
  type: Boolean,
23
42
  default: !1
@@ -33,68 +52,552 @@ const U = {
33
52
  type: [String, null],
34
53
  default: "enter"
35
54
  /* Enter */
55
+ },
56
+ autofocus: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ autosize: {
61
+ type: [Boolean, Object],
62
+ default: !1
63
+ },
64
+ autoClear: {
65
+ type: Boolean,
66
+ default: !0
36
67
  }
37
- }, X = ["change", "submit", "cancel", "focus", "blur"], M = "mc-input", Y = ["placeholder", "disabled", "maxlength"], q = /* @__PURE__ */ E({
68
+ }, Ee = ["change", "submit", "cancel", "focus", "blur"], Q = "mc-input", Ie = [
69
+ "letter-spacing",
70
+ "line-height",
71
+ "padding-top",
72
+ "padding-bottom",
73
+ "font-family",
74
+ "font-weight",
75
+ "font-size",
76
+ "font-variant",
77
+ "text-rendering",
78
+ "text-transform",
79
+ "width",
80
+ "text-indent",
81
+ "padding-left",
82
+ "padding-right",
83
+ "border-width",
84
+ "box-sizing",
85
+ "word-break",
86
+ "white-space"
87
+ ], Be = `
88
+ min-height:0 !important;
89
+ max-height:none !important;
90
+ height:0 !important;
91
+ visibility:hidden !important;
92
+ overflow:hidden !important;
93
+ position:absolute !important;
94
+ z-index:-1000 !important;
95
+ top:0 !important;
96
+ right:0 !important;
97
+ pointer-events: none !important;
98
+ `;
99
+ function $e(n) {
100
+ const a = window.getComputedStyle(n), s = a.getPropertyValue("box-sizing"), t = Number.parseFloat(a.getPropertyValue("padding-top")) + Number.parseFloat(a.getPropertyValue("padding-bottom")), l = Number.parseFloat(a.getPropertyValue("border-top-width")) + Number.parseFloat(a.getPropertyValue("border-bottom-width"));
101
+ return { contextStyle: Ie.map(
102
+ (r) => `${r}:${a.getPropertyValue(r)}`
103
+ ).join(";"), paddingSize: t, borderSize: l, boxSizing: s };
104
+ }
105
+ function Ne(n, a = 1, s) {
106
+ const { contextStyle: t, paddingSize: l, borderSize: i, boxSizing: r } = $e(n), u = document.createElement("textarea");
107
+ u.setAttribute("style", `${t};${Be}`), u.value = n.value || n.placeholder || "", document.body.appendChild(u);
108
+ let f = u.scrollHeight;
109
+ const h = {
110
+ height: `${f}px`
111
+ };
112
+ if (a !== void 0 || s !== void 0) {
113
+ u.value = " ";
114
+ const C = u.scrollHeight - l;
115
+ if (a !== void 0) {
116
+ let d = C * a;
117
+ r === "border-box" && (d = d + l + i), f = Math.max(d, f), h.minHeight = `${d}px`;
118
+ }
119
+ if (s !== void 0) {
120
+ let d = C * s;
121
+ r === "border-box" && (d = d + l + i), f > d ? (f = d, h.overflowY = "auto") : h.overflowY = "hidden";
122
+ }
123
+ }
124
+ return h.height = `${f}px`, u.remove(), h;
125
+ }
126
+ function Me(n) {
127
+ const { textareaRef: a, autosize: s } = n, t = w({}), l = () => typeof s == "boolean" ? we : s;
128
+ return {
129
+ textareaStyle: t,
130
+ updateTextareaStyle: () => {
131
+ if (!a.value || s === !1) {
132
+ t.value = {};
133
+ return;
134
+ }
135
+ const r = l(), u = Ne(
136
+ a.value,
137
+ r.minRows,
138
+ r.maxRows
139
+ );
140
+ t.value = {
141
+ ...u,
142
+ resize: "none"
143
+ };
144
+ }
145
+ };
146
+ }
147
+ const De = ["placeholder", "disabled", "maxlength"], Re = /* @__PURE__ */ X({
38
148
  __name: "textarea",
39
- setup(t) {
40
- const { t: o } = B(), { inputValue: s, rootProps: e, rootEmits: a } = Z(M), r = N(() => {
41
- let i = "", C = "";
42
- return e.submitShortKey === v.Enter && (i = "Enter", C = "Shift + Enter"), e.submitShortKey === v.ShiftEnter && (i = "Shift + Enter", C = "Enter"), e.placeholder ?? (i ? o("Input.pleaseEnterPlaceholder", { enterKey: i, shiftEnterKey: C }) : o("Input.pleaseEnter"));
149
+ setup(n) {
150
+ const { t: a } = fe(), s = w(null), { inputValue: t, rootProps: l, rootEmits: i, clearInputAfterSubmit: r } = oe(
151
+ Q
152
+ ), u = ae(() => {
153
+ let v = "", E = "";
154
+ return l.submitShortKey === K.Enter && (v = "Enter", E = "Shift + Enter"), l.submitShortKey === K.ShiftEnter && (v = "Shift + Enter", E = "Enter"), l.placeholder ?? (v ? a("Input.pleaseEnterPlaceholder", {
155
+ enterKey: v,
156
+ shiftEnterKey: E
157
+ }) : a("Input.pleaseEnter"));
158
+ }), { textareaStyle: f, updateTextareaStyle: h } = Me({
159
+ textareaRef: s,
160
+ autosize: l.autosize
43
161
  });
44
- let u = !1;
45
- const p = () => {
46
- z(() => {
47
- a("change", s.value);
162
+ Y(
163
+ () => t.value,
164
+ () => {
165
+ h();
166
+ }
167
+ ), te(() => {
168
+ h();
169
+ });
170
+ let C = !1;
171
+ const d = () => {
172
+ de(() => {
173
+ i("change", t.value);
48
174
  });
49
- }, l = () => {
50
- u || p();
51
- }, y = () => {
52
- u = !0;
53
- }, m = () => {
54
- u = !1, p();
55
- }, L = (i) => {
56
- if (e.submitShortKey === null)
175
+ }, T = () => {
176
+ C || d();
177
+ }, b = () => {
178
+ C = !0;
179
+ }, B = () => {
180
+ setTimeout(() => {
181
+ C = !1, d();
182
+ }, 10);
183
+ }, z = (v) => {
184
+ if (l.submitShortKey === null)
57
185
  return;
58
- (e.submitShortKey === v.Enter ? !i.shiftKey : e.submitShortKey === v.ShiftEnter ? i.shiftKey : !1) && i.key === "Enter" && !u && (i.preventDefault(), a("submit", s.value), s.value = "");
59
- }, V = (i) => {
60
- a("focus", i);
61
- }, T = (i) => {
62
- a("blur", i);
186
+ (l.submitShortKey === K.Enter ? !v.shiftKey : l.submitShortKey === K.ShiftEnter ? v.shiftKey : !1) && v.key === "Enter" && !C && (v.preventDefault(), i("submit", t.value), r(), i("change", t.value));
187
+ }, F = (v) => {
188
+ i("focus", v);
189
+ }, k = (v) => {
190
+ i("blur", v);
63
191
  };
64
- return (i, C) => D((c(), d("textarea", {
65
- "onUpdate:modelValue": C[0] || (C[0] = (P) => F(s) ? s.value = P : null),
66
- placeholder: r.value,
67
- disabled: n(e).disabled,
68
- maxlength: n(e).maxLength,
69
- class: S([
192
+ return te(() => {
193
+ l.autofocus && s.value && !l.disabled && s.value.focus();
194
+ }), (v, E) => be((m(), x("textarea", {
195
+ ref_key: "textareaRef",
196
+ ref: s,
197
+ "onUpdate:modelValue": E[0] || (E[0] = (H) => ye(t) ? t.value = H : null),
198
+ placeholder: u.value,
199
+ disabled: g(l).disabled,
200
+ maxlength: g(l).maxLength,
201
+ style: ce(g(f)),
202
+ class: q([
70
203
  "mc-textarea",
71
- { "mc-textarea-simple": n(e).displayType === n(g).Simple, "mc-textarea-disabled": n(e).disabled }
204
+ { "mc-textarea-simple": g(l).displayType === g(V).Simple, "mc-textarea-disabled": g(l).disabled }
72
205
  ]),
73
- onInput: l,
74
- onCompositionstart: y,
75
- onCompositionend: m,
76
- onKeydown: L,
77
- onFocus: V,
78
- onBlur: T
79
- }, null, 42, Y)), [
80
- [j, n(s)]
206
+ onInput: T,
207
+ onCompositionstart: b,
208
+ onCompositionend: B,
209
+ onKeydown: z,
210
+ onFocus: F,
211
+ onBlur: k
212
+ }, null, 46, De)), [
213
+ [xe, g(t)]
81
214
  ]);
82
215
  }
83
- }), k = (t, o) => {
84
- const s = t.__vccOpts || t;
85
- for (const [e, a] of o)
86
- s[e] = a;
216
+ });
217
+ function he(n) {
218
+ const a = window.getSelection();
219
+ if (a && a.rangeCount > 0) {
220
+ const s = a.getRangeAt(0);
221
+ s.deleteContents();
222
+ const t = document.createTextNode(n);
223
+ s.insertNode(t), s.setStartAfter(t), s.setEndAfter(t), a.removeAllRanges(), a.addRange(s);
224
+ }
225
+ }
226
+ const Ae = (n) => {
227
+ var t;
228
+ n.preventDefault();
229
+ const s = (((t = n.clipboardData) == null ? void 0 : t.getData("text/plain")) || "").replace(/[\r\n]+/g, " ");
230
+ s && he(s);
231
+ }, Ke = (n) => {
232
+ if (n) {
233
+ const a = document.createRange(), s = window.getSelection();
234
+ a.selectNodeContents(n), a.collapse(!1), s == null || s.removeAllRanges(), s == null || s.addRange(a);
235
+ }
236
+ }, Pe = {
237
+ class: "editable-span",
238
+ contenteditable: "false"
239
+ }, ze = ["contenteditable", "placeholder"], Fe = /* @__PURE__ */ X({
240
+ __name: "InputTag",
241
+ props: {
242
+ content: String,
243
+ placeholder: {
244
+ type: String,
245
+ default: ""
246
+ },
247
+ disabled: {
248
+ type: Boolean,
249
+ default: !1
250
+ }
251
+ },
252
+ emits: ["change"],
253
+ setup(n, { emit: a }) {
254
+ const s = a, t = n, l = w(!1), i = w(t.content), r = w(null);
255
+ Y(
256
+ () => t.content,
257
+ (d) => {
258
+ i.value = d;
259
+ }
260
+ );
261
+ const u = () => {
262
+ l.value = !t.disabled;
263
+ }, f = () => {
264
+ l.value = !1;
265
+ }, h = (d) => {
266
+ var b;
267
+ const T = ((b = r.value) == null ? void 0 : b.textContent) || "";
268
+ i.value = T, s("change", T);
269
+ }, C = (d) => {
270
+ Ae(d), h();
271
+ };
272
+ return (d, T) => {
273
+ var b, B;
274
+ return m(), x("span", Pe, [
275
+ $("span", {
276
+ ref_key: "editableSpanRef",
277
+ ref: r,
278
+ contenteditable: l.value,
279
+ placeholder: n.placeholder,
280
+ class: q(["input-custom-item", { "input-custom-placeholder": !((b = i.value) != null && b.length), "inline-text": (B = i.value) == null ? void 0 : B.length }]),
281
+ tabindex: "0",
282
+ onInput: le(h, ["stop"]),
283
+ onFocus: u,
284
+ onBlur: f,
285
+ onPaste: le(C, ["stop"])
286
+ }, Z(n.content), 43, ze)
287
+ ]);
288
+ };
289
+ }
290
+ }), W = (n, a) => {
291
+ const s = n.__vccOpts || n;
292
+ for (const [t, l] of a)
293
+ s[t] = l;
87
294
  return s;
88
- }, G = {}, H = {
295
+ }, Ve = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-de0a1464"]]), Ze = ["contenteditable", "placeholder"], Oe = { contenteditable: "false" }, He = {
296
+ id: "ai-input-prefix",
297
+ class: "ai-input-prefix"
298
+ }, Ue = /* @__PURE__ */ X({
299
+ __name: "EditableBlock",
300
+ props: {
301
+ templateParts: {
302
+ type: Array,
303
+ default: () => []
304
+ },
305
+ placeholder: {
306
+ type: String,
307
+ default: ""
308
+ },
309
+ maxLength: {
310
+ type: Number,
311
+ default: 2e3
312
+ },
313
+ disabled: {
314
+ type: Boolean,
315
+ default: !1
316
+ },
317
+ submitShortKey: {
318
+ type: [String, null],
319
+ default: K.Enter
320
+ },
321
+ autofocus: {
322
+ type: Boolean,
323
+ default: !1
324
+ }
325
+ },
326
+ emits: [
327
+ "send",
328
+ "input",
329
+ "blur",
330
+ "focus",
331
+ "onBlockKeyArrowUp"
332
+ ],
333
+ setup(n, { expose: a, emit: s }) {
334
+ const { rootProps: t } = oe(Q), l = s, i = n, r = w({
335
+ themeTagText: "",
336
+ clearInput: !1,
337
+ popoverContent: "",
338
+ type: "themeTag"
339
+ }), u = w(null), f = w([...i.templateParts]);
340
+ Y(
341
+ () => i.templateParts,
342
+ (e) => {
343
+ f.value = [...e];
344
+ }
345
+ );
346
+ const h = () => {
347
+ const e = u.value;
348
+ e && (e.innerHTML = "", k());
349
+ }, C = () => {
350
+ var p;
351
+ const e = (p = u.value) == null ? void 0 : p.textContent;
352
+ e.length > i.maxLength || (l("send", e), h());
353
+ }, d = () => {
354
+ var e;
355
+ (e = u.value) == null || e.focus(), Ke(u.value);
356
+ }, T = (e) => {
357
+ l("blur", e);
358
+ }, b = (e) => {
359
+ l("focus", e);
360
+ }, B = w(!1), z = () => {
361
+ B.value = !0;
362
+ }, F = () => {
363
+ B.value = !1, k();
364
+ }, k = () => {
365
+ B.value || E();
366
+ }, v = () => {
367
+ var p, c;
368
+ let e = (p = u.value) == null ? void 0 : p.textContent;
369
+ if (r.value.themeTagText) {
370
+ const y = (c = u.value) == null ? void 0 : c.querySelector(
371
+ ".ai-input-prefix-wrapper"
372
+ );
373
+ if (y) {
374
+ const D = y.textContent || "";
375
+ e = e.replace(D, " ");
376
+ }
377
+ }
378
+ return e;
379
+ }, E = () => {
380
+ setTimeout(() => {
381
+ const e = v();
382
+ l("input", e);
383
+ }, 50);
384
+ }, H = (e) => {
385
+ const p = i.submitShortKey === K.Enter ? !e.shiftKey : i.submitShortKey === K.ShiftEnter ? e.shiftKey : !1;
386
+ if (e.key === "Enter" && p && (e.preventDefault(), C()), ["ArrowLeft", "ArrowRight", "Backspace", "Delete"].includes(e.key)) {
387
+ const c = window.getSelection();
388
+ if (!(c != null && c.rangeCount) || !c.isCollapsed)
389
+ return;
390
+ const y = c.getRangeAt(0), { startContainer: D, startOffset: J } = y, S = e.key === "ArrowLeft" || e.key === "Backspace" ? "previous" : "next", P = L(D, J, S);
391
+ if (P && P.nodeType === Node.ELEMENT_NODE) {
392
+ const N = P.querySelector(".input-custom-item");
393
+ if (!N)
394
+ return;
395
+ if (e.preventDefault(), N.contentEditable = "true", e.key === "ArrowLeft" || e.key === "ArrowRight") {
396
+ const R = document.createRange();
397
+ R.setStart(
398
+ N,
399
+ S === "previous" ? N.childNodes.length : 0
400
+ ), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
401
+ } else if (e.key === "Backspace" || e.key === "Delete")
402
+ if (N.textContent.trim()) {
403
+ const R = document.createRange();
404
+ R.setStart(
405
+ N,
406
+ S === "previous" ? N.childNodes.length : 0
407
+ ), R.collapse(!1), c.removeAllRanges(), c.addRange(R);
408
+ } else
409
+ P.remove();
410
+ }
411
+ }
412
+ e.key === "ArrowUp" && o() && l("onBlockKeyArrowUp", e);
413
+ };
414
+ function o() {
415
+ var y;
416
+ const e = window.getSelection();
417
+ if (!(e != null && e.rangeCount))
418
+ return !0;
419
+ const p = e.getRangeAt(0);
420
+ if (p.startOffset !== 0)
421
+ return !1;
422
+ let c = p.startContainer;
423
+ for (; c && !((y = c.classList) != null && y.contains("editable-container")); ) {
424
+ if (c.previousSibling)
425
+ return !1;
426
+ c = c.parentNode;
427
+ }
428
+ return !0;
429
+ }
430
+ function L(e, p, c) {
431
+ var P;
432
+ if (!e)
433
+ return null;
434
+ let y = e;
435
+ const D = (P = e.classList) == null ? void 0 : P.contains("editable-container");
436
+ if (D) {
437
+ const N = e.childNodes, R = Math.min(p, N.length - 1);
438
+ y = N[R];
439
+ }
440
+ if (!D && c === "previous" && p !== 0 || !D && c === "next" && p !== e.textContent.length)
441
+ return null;
442
+ let J = null, S = y;
443
+ for (; S; )
444
+ if (S = c === "next" ? S.nextSibling : S.previousSibling, !!S && S.nodeType !== Node.COMMENT_NODE && (S.nodeType !== Node.TEXT_NODE || S.nodeType === Node.TEXT_NODE && S.nodeValue.trim() !== "")) {
445
+ J = S;
446
+ break;
447
+ }
448
+ return J;
449
+ }
450
+ const I = (e) => {
451
+ var c;
452
+ e.preventDefault();
453
+ const p = (c = (e.originalEvent || e).clipboardData) == null ? void 0 : c.getData("text/plain");
454
+ he(p), k();
455
+ }, M = (e, p, c) => {
456
+ i.disabled || (f.value.push({
457
+ key: e,
458
+ type: "input",
459
+ placeholder: p,
460
+ content: c
461
+ }), G(), k());
462
+ }, U = (e) => {
463
+ i.disabled || (f.value = [...e], G(), k());
464
+ }, ge = (e) => {
465
+ i.disabled || (f.value.push({
466
+ type: "text",
467
+ content: e
468
+ }), G(), k());
469
+ }, ve = (e, p, c) => {
470
+ i.disabled || (r.value = {
471
+ themeTagText: e,
472
+ clearInput: c || !1,
473
+ popoverContent: p,
474
+ type: "themeTag"
475
+ });
476
+ }, se = () => {
477
+ r.value.themeTagText && r.value.clearInput ? h() : (r.value = {
478
+ themeTagText: "",
479
+ clearInput: !1,
480
+ popoverContent: "",
481
+ type: "themeTag"
482
+ }, E());
483
+ }, G = () => {
484
+ de(() => {
485
+ d();
486
+ });
487
+ };
488
+ return te(() => {
489
+ i.autofocus && u.value && !i.disabled && G();
490
+ }), a({
491
+ clearInput: h,
492
+ getInput: v,
493
+ focusInput: d,
494
+ setMixTags: U,
495
+ setText: ge,
496
+ setInputTag: M,
497
+ openTipTag: ve,
498
+ closeTipTag: se
499
+ }), (e, p) => {
500
+ const c = Ce("d-popover");
501
+ return m(), x("div", {
502
+ ref_key: "editableDivRef",
503
+ ref: u,
504
+ class: q(["editable-container", { "mc-input-disabled": i.disabled, "mc-input-simple": g(t).displayType === g(V).Simple }]),
505
+ contenteditable: !i.disabled,
506
+ spellcheck: "false",
507
+ placeholder: i.placeholder,
508
+ onInput: k,
509
+ onKeydown: H,
510
+ onPaste: I,
511
+ onCompositionstart: z,
512
+ onCompositionend: F,
513
+ onBlur: T,
514
+ onFocus: b
515
+ }, [
516
+ _(" 前置标签 "),
517
+ r.value.themeTagText ? (m(), O(c, {
518
+ key: 0,
519
+ trigger: "hover",
520
+ content: r.value.popoverContent
521
+ }, {
522
+ default: pe(() => [
523
+ $("span", Oe, [
524
+ r.value.themeTagText ? (m(), x("span", {
525
+ key: 0,
526
+ class: "ai-input-prefix-wrapper",
527
+ onClick: se,
528
+ contenteditable: "false"
529
+ }, [
530
+ A(e.$slots, "themeTag", { themeTag: r.value }, () => [
531
+ $(
532
+ "span",
533
+ He,
534
+ Z(r.value.themeTagText),
535
+ 1
536
+ /* TEXT */
537
+ )
538
+ ], !0)
539
+ ])) : _("v-if", !0),
540
+ p[0] || (p[0] = $(
541
+ "span",
542
+ {
543
+ contenteditable: "false",
544
+ style: { display: "inline-block", width: "4px" }
545
+ },
546
+ null,
547
+ -1
548
+ /* HOISTED */
549
+ ))
550
+ ])
551
+ ]),
552
+ _: 3
553
+ /* FORWARDED */
554
+ }, 8, ["content"])) : _("v-if", !0),
555
+ (m(!0), x(
556
+ ee,
557
+ null,
558
+ Te(f.value, (y, D) => (m(), x(
559
+ ee,
560
+ null,
561
+ [
562
+ y.type === "text" ? (m(), x(
563
+ ee,
564
+ { key: 0 },
565
+ [
566
+ Le(
567
+ Z(y.content),
568
+ 1
569
+ /* TEXT */
570
+ )
571
+ ],
572
+ 64
573
+ /* STABLE_FRAGMENT */
574
+ )) : y.type === "input" ? (m(), O(Ve, {
575
+ key: `input${D}`,
576
+ content: y.content,
577
+ placeholder: y.placeholder,
578
+ disabled: i.disabled,
579
+ onChange: k
580
+ }, null, 8, ["content", "placeholder", "disabled"])) : _("v-if", !0)
581
+ ],
582
+ 64
583
+ /* STABLE_FRAGMENT */
584
+ ))),
585
+ 256
586
+ /* UNKEYED_FRAGMENT */
587
+ ))
588
+ ], 42, Ze);
589
+ };
590
+ }
591
+ }), je = /* @__PURE__ */ W(Ue, [["__scopeId", "data-v-92145e12"]]), Ye = {}, Xe = {
89
592
  width: "16px",
90
593
  height: "16px",
91
594
  viewBox: "0 0 16 16",
92
595
  version: "1.1",
93
596
  xmlns: "http://www.w3.org/2000/svg"
94
597
  };
95
- function J(t, o) {
96
- return c(), d("svg", H, o[0] || (o[0] = [
97
- f(
598
+ function qe(n, a) {
599
+ return m(), x("svg", Xe, a[0] || (a[0] = [
600
+ $(
98
601
  "g",
99
602
  {
100
603
  stroke: "none",
@@ -103,23 +606,23 @@ function J(t, o) {
103
606
  "fill-rule": "evenodd"
104
607
  },
105
608
  [
106
- f("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" })
609
+ $("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" })
107
610
  ],
108
611
  -1
109
612
  /* HOISTED */
110
613
  )
111
614
  ]));
112
615
  }
113
- const Q = /* @__PURE__ */ k(G, [["render", J]]), e1 = {}, t1 = {
616
+ const We = /* @__PURE__ */ W(Ye, [["render", qe]]), Ge = {}, Je = {
114
617
  width: "16px",
115
618
  height: "16px",
116
619
  viewBox: "0 0 16 16",
117
620
  version: "1.1",
118
621
  xmlns: "http://www.w3.org/2000/svg"
119
622
  };
120
- function n1(t, o) {
121
- return c(), d("svg", t1, o[0] || (o[0] = [
122
- f(
623
+ function Qe(n, a) {
624
+ return m(), x("svg", Je, a[0] || (a[0] = [
625
+ $(
123
626
  "g",
124
627
  {
125
628
  stroke: "none",
@@ -128,103 +631,191 @@ function n1(t, o) {
128
631
  "fill-rule": "evenodd"
129
632
  },
130
633
  [
131
- f("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" })
634
+ $("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" })
132
635
  ],
133
636
  -1
134
637
  /* HOISTED */
135
638
  )
136
639
  ]));
137
640
  }
138
- const o1 = /* @__PURE__ */ k(e1, [["render", n1]]), s1 = ["disabled"], l1 = { class: "mc-button-content" }, i1 = /* @__PURE__ */ E({
641
+ const et = /* @__PURE__ */ W(Ge, [["render", Qe]]), tt = ["disabled"], nt = { class: "mc-button-content" }, ot = { key: 2 }, at = /* @__PURE__ */ X({
139
642
  __name: "button",
140
- setup(t) {
141
- const { t: o } = B(), { inputValue: s, rootProps: e, rootEmits: a } = Z(M), r = w(!1), u = w(!1), p = W({
643
+ setup(n) {
644
+ const { t: a } = fe(), { inputValue: s, rootProps: t, rootEmits: l, clearInputAfterSubmit: i } = oe(
645
+ Q
646
+ ), r = w(!1), u = w(!1), f = Se({
142
647
  top: "0px",
143
648
  left: "0px"
144
- }), l = (m) => {
145
- p.left = m.offsetX + "px", p.top = m.offsetY + "px", u.value = !0, setTimeout(() => {
649
+ }), h = ae(() => ({
650
+ "mc-button": !0,
651
+ "mc-button-loading": t.loading,
652
+ mousedown: r.value,
653
+ "mc-button-simple": t.sendBtnVariant === ne.Simple
654
+ })), C = (T) => {
655
+ f.left = T.offsetX + "px", f.top = T.offsetY + "px", u.value = !0, setTimeout(() => {
146
656
  u.value = !1;
147
657
  }, 300);
148
- }, y = (m) => {
149
- l(m), e.loading ? a("cancel") : (a("submit", s.value), s.value = "");
658
+ }, d = (T) => {
659
+ C(T), t.loading ? l("cancel") : (l("submit", s.value), i(), l("change", s.value));
150
660
  };
151
- return (m, L) => (c(), d("button", {
152
- disabled: n(e).disabled || !n(e).loading && !n(s),
153
- class: S(["mc-button", { "mc-button-loading": n(e).loading, mousedown: r.value }]),
154
- onClick: y,
155
- onMousedown: L[0] || (L[0] = () => r.value = !0),
156
- onMouseup: L[1] || (L[1] = () => r.value = !1)
661
+ return (T, b) => (m(), x("button", {
662
+ disabled: g(t).disabled || !g(t).loading && !g(s),
663
+ class: q(h.value),
664
+ onClick: d,
665
+ onMousedown: b[0] || (b[0] = () => r.value = !0),
666
+ onMouseup: b[1] || (b[1] = () => r.value = !1)
157
667
  }, [
158
- f("span", l1, [
159
- n(e).loading ? (c(), $(Q, { key: 0 })) : (c(), $(o1, { key: 1 })),
160
- f(
668
+ $("span", nt, [
669
+ g(t).loading ? (m(), O(We, { key: 0 })) : (m(), O(et, { key: 1 })),
670
+ g(t).sendBtnVariant === g(ne).Full ? (m(), x(
161
671
  "span",
162
- null,
163
- x(n(e).loading ? n(o)("Input.pauseAnswer") : n(o)("Input.send")),
672
+ ot,
673
+ Z(g(t).loading ? g(a)("Input.pauseAnswer") : g(a)("Input.send")),
164
674
  1
165
675
  /* TEXT */
166
- )
676
+ )) : _("v-if", !0)
167
677
  ]),
168
- u.value ? (c(), d(
678
+ u.value ? (m(), x(
169
679
  "div",
170
680
  {
171
681
  key: 0,
172
682
  class: "mc-button-water-wave",
173
- style: A(p)
683
+ style: ce(f)
174
684
  },
175
685
  null,
176
686
  4
177
687
  /* STYLE */
178
688
  )) : _("v-if", !0)
179
- ], 42, s1));
689
+ ], 42, tt));
180
690
  }
181
- }), I = /* @__PURE__ */ k(i1, [["__scopeId", "data-v-8051c2d3"]]), a1 = { class: "mc-input-content" }, r1 = {
691
+ }), re = /* @__PURE__ */ W(at, [["__scopeId", "data-v-dbbf3b38"]]), st = { class: "mc-input-content" }, lt = {
692
+ key: 0,
693
+ class: "editable-block-container"
694
+ }, it = {
182
695
  key: 0,
183
696
  class: "mc-input-foot"
184
- }, u1 = { class: "mc-input-foot-left" }, c1 = {
697
+ }, rt = { class: "mc-input-foot-left" }, ut = {
185
698
  key: 0,
186
699
  class: "mc-input-foot-count"
187
- }, K = /* @__PURE__ */ E({
700
+ }, j = 50, ue = /* @__PURE__ */ X({
188
701
  __name: "Input",
189
- props: U,
190
- emits: X,
191
- setup(t, { expose: o, emit: s }) {
192
- const e = t, a = s, r = w(""), u = () => {
193
- r.value = "";
194
- }, p = () => r.value;
195
- return O(
196
- () => e.value,
702
+ props: ke,
703
+ emits: Ee,
704
+ setup(n, { expose: a, emit: s }) {
705
+ const t = n, l = s, i = w(null), r = w(!1), u = w(""), f = ae(() => ({
706
+ "mc-input": !0,
707
+ "mc-input-disabled": t.disabled,
708
+ "mc-input-simple": t.displayType === V.Simple,
709
+ "mc-input-borderless": t.variant === me.BorderLess
710
+ })), h = () => {
711
+ var o;
712
+ r.value ? (o = i.value) == null || o.clearInput() : u.value = "";
713
+ }, C = () => {
714
+ t.autoClear && h();
715
+ }, d = () => {
716
+ var o;
717
+ return r.value ? (o = i.value) == null ? void 0 : o.getInput() : u.value;
718
+ }, T = (o, L, I) => {
719
+ t.disabled || (r.value = !0, setTimeout(() => {
720
+ var M;
721
+ (M = i.value) == null || M.setInputTag(o, L, I);
722
+ }, j));
723
+ }, b = (o) => {
724
+ t.disabled || (r.value = !0, setTimeout(() => {
725
+ var L;
726
+ (L = i.value) == null || L.setText(o);
727
+ }, j));
728
+ }, B = (o) => {
729
+ t.disabled || (r.value = !0, setTimeout(() => {
730
+ var L;
731
+ (L = i.value) == null || L.setMixTags(o);
732
+ }, j));
733
+ }, z = (o, L, I) => {
734
+ t.disabled || (r.value = !0, setTimeout(() => {
735
+ var M;
736
+ (M = i.value) == null || M.openTipTag(o, L, I);
737
+ }, j));
738
+ }, F = () => {
739
+ var o;
740
+ r.value && ((o = i.value) == null || o.closeTipTag());
741
+ }, k = (o) => {
742
+ o || setTimeout(() => {
743
+ r.value = !1;
744
+ }, j), u.value = o, l("change", o);
745
+ }, v = (o) => {
746
+ l("submit", o);
747
+ }, E = (o) => {
748
+ l("blur", o);
749
+ }, H = (o) => {
750
+ l("focus", o);
751
+ };
752
+ return Y(
753
+ () => t.value,
197
754
  () => {
198
- r.value = e.value;
755
+ u.value = t.value;
199
756
  },
200
757
  { immediate: !0 }
201
- ), o({ clearInput: u, getInput: p }), R(M, { inputValue: r, rootProps: e, rootEmits: a }), (l, y) => (c(), d(
758
+ ), Y(
759
+ () => t.formatContentOptions,
760
+ (o) => {
761
+ const L = o == null ? void 0 : o.formatContent, I = L.filter((U) => U.type === "themeTag");
762
+ I.length ? z(I[0].themeTagText, I[0].popoverContent, I[0].clearInput) : F();
763
+ const M = L.filter((U) => U.type !== "themeTag");
764
+ B(M);
765
+ },
766
+ { deep: !0 }
767
+ ), a({ clearInput: h, getInput: d, setInputTag: T, setText: b, setMixTags: B, openTipTag: z, closeTipTag: F }), _e(Q, { inputValue: u, rootProps: t, rootEmits: l, clearInputAfterSubmit: C }), (o, L) => (m(), x(
202
768
  "div",
203
769
  {
204
- class: S(["mc-input", { "mc-input-disabled": l.disabled }])
770
+ class: q(f.value)
205
771
  },
206
772
  [
207
- h(l.$slots, "head"),
208
- f("div", a1, [
209
- h(l.$slots, "prefix"),
210
- b(q),
211
- l.displayType === n(g).Simple ? h(l.$slots, "button", { key: 0 }, () => [
212
- b(I)
773
+ A(o.$slots, "head"),
774
+ $("div", st, [
775
+ A(o.$slots, "prefix"),
776
+ _(" 替换Textarea "),
777
+ r.value ? (m(), x("div", lt, [
778
+ _(" 可编辑块 "),
779
+ r.value ? (m(), O(je, {
780
+ key: 0,
781
+ ref_key: "editableBlockRef",
782
+ ref: i,
783
+ placeholder: t.placeholder,
784
+ maxLength: t.maxLength,
785
+ disabled: t.disabled,
786
+ "submit-short-key": t.submitShortKey,
787
+ autofocus: t.autofocus,
788
+ onInput: k,
789
+ onSend: v,
790
+ onBlur: E,
791
+ onFocus: H
792
+ }, {
793
+ themeTag: pe(({ themeTag: I }) => [
794
+ A(o.$slots, "themeTag", { themeTag: I })
795
+ ]),
796
+ _: 3
797
+ /* FORWARDED */
798
+ }, 8, ["placeholder", "maxLength", "disabled", "submit-short-key", "autofocus"])) : _("v-if", !0)
799
+ ])) : _("v-if", !0),
800
+ r.value ? _("v-if", !0) : (m(), O(Re, { key: 1 })),
801
+ A(o.$slots, "suffix"),
802
+ o.displayType === g(V).Simple ? A(o.$slots, "button", { key: 2 }, () => [
803
+ ie(re)
213
804
  ]) : _("v-if", !0)
214
805
  ]),
215
- l.displayType === n(g).Full ? (c(), d("div", r1, [
216
- f("div", u1, [
217
- h(l.$slots, "extra"),
218
- l.showCount ? (c(), d(
806
+ o.displayType === g(V).Full ? (m(), x("div", it, [
807
+ $("div", rt, [
808
+ A(o.$slots, "extra"),
809
+ o.showCount ? (m(), x(
219
810
  "span",
220
- c1,
221
- x(r.value.length) + x(l.maxLength ?? !1 ? `/${l.maxLength}` : ""),
811
+ ut,
812
+ Z(u.value.length) + Z(o.maxLength ?? !1 ? `/${o.maxLength}` : ""),
222
813
  1
223
814
  /* TEXT */
224
815
  )) : _("v-if", !0)
225
816
  ]),
226
- h(l.$slots, "button", {}, () => [
227
- b(I)
817
+ A(o.$slots, "button", {}, () => [
818
+ ie(re)
228
819
  ])
229
820
  ])) : _("v-if", !0)
230
821
  ],
@@ -233,9 +824,9 @@ const o1 = /* @__PURE__ */ k(e1, [["render", n1]]), s1 = ["disabled"], l1 = { cl
233
824
  ));
234
825
  }
235
826
  });
236
- K.install = (t) => {
237
- t.component("McInput", K);
827
+ ue.install = (n) => {
828
+ n.component("McInput", ue);
238
829
  };
239
830
  export {
240
- K as McInput
831
+ ue as McInput
241
832
  };