@matechat/core 1.9.0 → 1.10.0-alpha.1
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/Attachment/index.css +1 -0
- package/Attachment/index.js +387 -0
- package/FileList/index.css +1 -0
- package/FileList/index.js +1332 -0
- package/Input/index.css +1 -1
- package/Input/index.js +143 -137
- package/Locale/index.js +85 -35
- package/MarkdownCard/index.css +1 -1
- package/MarkdownCard/index.js +159 -155
- package/mate-chat.js +6 -0
- package/package.json +1 -1
package/Input/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.mc-textarea{width:100%;height:64px;padding:4px 0;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);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-
|
|
1
|
+
@charset "UTF-8";.mc-textarea{width:100%;height:64px;padding:4px 0;color:var(--devui-text, #252b3a);font-size:var(--devui-font-size, 14px);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-dbbf3b38]{position:relative;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:32px;line-height:1.5;color:var(--devui-light-text, #ffffff);font-size:var(--devui-font-size, 14px);padding:0 12px;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-dbbf3b38]{animation:rotating-dbbf3b38 1s linear infinite}.mc-button.mousedown[data-v-dbbf3b38]:not(:disabled){transform:scale(.95)}.mc-button.mc-button-simple[data-v-dbbf3b38]{width:32px;padding:6px;flex-shrink:0;border-radius:100%}.mc-button.mc-button-simple svg[data-v-dbbf3b38]{margin-right:0}.mc-button[data-v-dbbf3b38]:hover{background-color:var(--devui-primary-hover, #7693f5)}.mc-button[data-v-dbbf3b38]:active{background-color:var(--devui-primary-active, #344899)}.mc-button[data-v-dbbf3b38]:disabled{color:var(--devui-light-text, #ffffff);background-color:var(--devui-primary-disabled, #beccfa);cursor:not-allowed}.mc-button .mc-button-content[data-v-dbbf3b38]{display:inline-flex;align-items:center;font-size:var(--devui-font-size, 14px)}.mc-button .mc-button-water-wave[data-v-dbbf3b38]{position:absolute;background-color:var(--devui-base-bg, #ffffff);border-radius:50%;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);animation:waterWave-dbbf3b38 var(--devui-animation-duration-slow, .3s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.mc-button svg[data-v-dbbf3b38]{margin-right:4px}.mc-button svg[data-v-dbbf3b38] path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-dbbf3b38{0%{transform:rotate(0)}to{transform:rotate(180deg)}}@keyframes waterWave-dbbf3b38{0%{opacity:.2;width:30px;height:30px}to{opacity:0;width:200px;height:200px}}body[ui-theme=infinity-theme]{--mc-text: #aeaeae;--mc-box-shadow: rgba(25, 25, 25, .06)}body[ui-theme=galaxy-theme]{--mc-text: #4e5057;--mc-box-shadow: rgba(206, 209, 219, .06)}.mc-input{display:flex;flex-direction:column;width:100%;padding:12px 0;border:1px solid var(--devui-form-control-line, #d7d8da);border-radius:16px;box-sizing:border-box;background-color:var(--devui-base-bg, #ffffff)}.mc-input.mc-input-simple{border-radius:24px}.mc-input.mc-input-simple .mc-input-content{padding:0 20px}.mc-input.mc-input-borderless{border:none;box-shadow:0 1px 8px 0 var(--mc-box-shadow, rgba(25, 25, 25, .06))}.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 16px}.mc-input .mc-input-foot{display:flex;justify-content:space-between;align-items:center;height:32px;padding:0 16px}.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(--mc-text, #aeaeae);font-size:var(--devui-font-size-sm, 12px)}
|
package/Input/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useMcI18n as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
2
|
+
import { ref as _, defineComponent as M, inject as P, computed as k, watch as F, onMounted as T, withDirectives as U, createElementBlock as h, openBlock as m, normalizeClass as I, normalizeStyle as N, unref as l, isRef as W, vModelText as G, nextTick as X, createElementVNode as C, reactive as q, createCommentVNode as x, createBlock as Z, toDisplayString as E, provide as J, renderSlot as y, createVNode as w } from "vue";
|
|
3
|
+
import { useMcI18n as A } from "@matechat/core/Locale";
|
|
4
|
+
var S = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(S || {}), H = /* @__PURE__ */ ((e) => (e.Bordered = "bordered", e.BorderLess = "borderless", e))(H || {}), $ = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))($ || {}), b = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(b || {});
|
|
5
|
+
const Q = {
|
|
6
6
|
minRows: 1,
|
|
7
7
|
maxRows: 5
|
|
8
|
-
},
|
|
8
|
+
}, e1 = {
|
|
9
9
|
value: {
|
|
10
10
|
type: String,
|
|
11
11
|
default: ""
|
|
@@ -55,8 +55,12 @@ const J = {
|
|
|
55
55
|
autosize: {
|
|
56
56
|
type: [Boolean, Object],
|
|
57
57
|
default: !1
|
|
58
|
+
},
|
|
59
|
+
autoClear: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !0
|
|
58
62
|
}
|
|
59
|
-
},
|
|
63
|
+
}, t1 = ["change", "submit", "cancel", "focus", "blur"], z = "mc-input", o1 = [
|
|
60
64
|
"letter-spacing",
|
|
61
65
|
"line-height",
|
|
62
66
|
"padding-top",
|
|
@@ -75,7 +79,7 @@ const J = {
|
|
|
75
79
|
"box-sizing",
|
|
76
80
|
"word-break",
|
|
77
81
|
"white-space"
|
|
78
|
-
],
|
|
82
|
+
], n1 = `
|
|
79
83
|
min-height:0 !important;
|
|
80
84
|
max-height:none !important;
|
|
81
85
|
height:0 !important;
|
|
@@ -87,35 +91,35 @@ const J = {
|
|
|
87
91
|
right:0 !important;
|
|
88
92
|
pointer-events: none !important;
|
|
89
93
|
`;
|
|
90
|
-
function
|
|
94
|
+
function s1(e) {
|
|
91
95
|
const o = window.getComputedStyle(e), s = o.getPropertyValue("box-sizing"), t = Number.parseFloat(o.getPropertyValue("padding-top")) + Number.parseFloat(o.getPropertyValue("padding-bottom")), n = Number.parseFloat(o.getPropertyValue("border-top-width")) + Number.parseFloat(o.getPropertyValue("border-bottom-width"));
|
|
92
|
-
return { contextStyle:
|
|
93
|
-
(
|
|
96
|
+
return { contextStyle: o1.map(
|
|
97
|
+
(u) => `${u}:${o.getPropertyValue(u)}`
|
|
94
98
|
).join(";"), paddingSize: t, borderSize: n, boxSizing: s };
|
|
95
99
|
}
|
|
96
|
-
function
|
|
97
|
-
const { contextStyle: t, paddingSize: n, borderSize: a, boxSizing:
|
|
98
|
-
|
|
99
|
-
let
|
|
100
|
-
const
|
|
101
|
-
height: `${
|
|
100
|
+
function i1(e, o = 1, s) {
|
|
101
|
+
const { contextStyle: t, paddingSize: n, borderSize: a, boxSizing: u } = s1(e), r = document.createElement("textarea");
|
|
102
|
+
r.setAttribute("style", `${t};${n1}`), r.value = e.value || e.placeholder || "", document.body.appendChild(r);
|
|
103
|
+
let d = r.scrollHeight;
|
|
104
|
+
const f = {
|
|
105
|
+
height: `${d}px`
|
|
102
106
|
};
|
|
103
107
|
if (o !== void 0 || s !== void 0) {
|
|
104
|
-
|
|
105
|
-
const
|
|
108
|
+
r.value = " ";
|
|
109
|
+
const i = r.scrollHeight - n;
|
|
106
110
|
if (o !== void 0) {
|
|
107
|
-
let
|
|
108
|
-
|
|
111
|
+
let p = i * o;
|
|
112
|
+
u === "border-box" && (p = p + n + a), d = Math.max(p, d), f.minHeight = `${p}px`;
|
|
109
113
|
}
|
|
110
114
|
if (s !== void 0) {
|
|
111
|
-
let
|
|
112
|
-
|
|
115
|
+
let p = i * s;
|
|
116
|
+
u === "border-box" && (p = p + n + a), d > p ? (d = p, f.overflowY = "auto") : f.overflowY = "hidden";
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
return
|
|
119
|
+
return f.height = `${d}px`, r.remove(), f;
|
|
116
120
|
}
|
|
117
|
-
function
|
|
118
|
-
const { textareaRef: o, autosize: s } = e, t =
|
|
121
|
+
function a1(e) {
|
|
122
|
+
const { textareaRef: o, autosize: s } = e, t = _({}), n = () => typeof s == "boolean" ? Q : s;
|
|
119
123
|
return {
|
|
120
124
|
textareaStyle: t,
|
|
121
125
|
updateTextareaStyle: () => {
|
|
@@ -123,80 +127,80 @@ function i1(e) {
|
|
|
123
127
|
t.value = {};
|
|
124
128
|
return;
|
|
125
129
|
}
|
|
126
|
-
const
|
|
130
|
+
const u = n(), r = i1(
|
|
127
131
|
o.value,
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
u.minRows,
|
|
133
|
+
u.maxRows
|
|
130
134
|
);
|
|
131
135
|
t.value = {
|
|
132
|
-
...
|
|
136
|
+
...r,
|
|
133
137
|
resize: "none"
|
|
134
138
|
};
|
|
135
139
|
}
|
|
136
140
|
};
|
|
137
141
|
}
|
|
138
|
-
const
|
|
142
|
+
const r1 = ["placeholder", "disabled", "maxlength"], l1 = /* @__PURE__ */ M({
|
|
139
143
|
__name: "textarea",
|
|
140
144
|
setup(e) {
|
|
141
|
-
const { t: o } =
|
|
142
|
-
let
|
|
143
|
-
return n.submitShortKey ===
|
|
144
|
-
}), { textareaStyle:
|
|
145
|
+
const { t: o } = A(), s = _(null), { inputValue: t, rootProps: n, rootEmits: a, clearInputAfterSubmit: u } = P(z), r = k(() => {
|
|
146
|
+
let c = "", g = "";
|
|
147
|
+
return n.submitShortKey === b.Enter && (c = "Enter", g = "Shift + Enter"), n.submitShortKey === b.ShiftEnter && (c = "Shift + Enter", g = "Enter"), n.placeholder ?? (c ? o("Input.pleaseEnterPlaceholder", { enterKey: c, shiftEnterKey: g }) : o("Input.pleaseEnter"));
|
|
148
|
+
}), { textareaStyle: d, updateTextareaStyle: f } = a1({
|
|
145
149
|
textareaRef: s,
|
|
146
150
|
autosize: n.autosize
|
|
147
151
|
});
|
|
148
|
-
|
|
152
|
+
F(
|
|
149
153
|
() => t.value,
|
|
150
154
|
() => {
|
|
151
|
-
|
|
155
|
+
f();
|
|
152
156
|
}
|
|
153
|
-
),
|
|
154
|
-
|
|
157
|
+
), T(() => {
|
|
158
|
+
f();
|
|
155
159
|
});
|
|
156
160
|
let i = !1;
|
|
157
|
-
const
|
|
158
|
-
|
|
161
|
+
const p = () => {
|
|
162
|
+
X(() => {
|
|
159
163
|
a("change", t.value);
|
|
160
164
|
});
|
|
161
|
-
},
|
|
162
|
-
i ||
|
|
163
|
-
},
|
|
165
|
+
}, v = () => {
|
|
166
|
+
i || p();
|
|
167
|
+
}, L = () => {
|
|
164
168
|
i = !0;
|
|
165
|
-
},
|
|
169
|
+
}, D = () => {
|
|
166
170
|
setTimeout(() => {
|
|
167
|
-
i = !1,
|
|
171
|
+
i = !1, p();
|
|
168
172
|
}, 10);
|
|
169
|
-
},
|
|
173
|
+
}, R = (c) => {
|
|
170
174
|
if (n.submitShortKey === null)
|
|
171
175
|
return;
|
|
172
|
-
(n.submitShortKey ===
|
|
173
|
-
},
|
|
174
|
-
a("focus",
|
|
175
|
-
},
|
|
176
|
-
a("blur",
|
|
176
|
+
(n.submitShortKey === b.Enter ? !c.shiftKey : n.submitShortKey === b.ShiftEnter ? c.shiftKey : !1) && c.key === "Enter" && !i && (c.preventDefault(), a("submit", t.value), u(), a("change", t.value));
|
|
177
|
+
}, Y = (c) => {
|
|
178
|
+
a("focus", c);
|
|
179
|
+
}, j = (c) => {
|
|
180
|
+
a("blur", c);
|
|
177
181
|
};
|
|
178
|
-
return
|
|
182
|
+
return T(() => {
|
|
179
183
|
n.autofocus && s.value && !n.disabled && s.value.focus();
|
|
180
|
-
}), (
|
|
184
|
+
}), (c, g) => U((m(), h("textarea", {
|
|
181
185
|
ref_key: "textareaRef",
|
|
182
186
|
ref: s,
|
|
183
|
-
"onUpdate:modelValue":
|
|
184
|
-
placeholder:
|
|
185
|
-
disabled:
|
|
186
|
-
maxlength:
|
|
187
|
-
style:
|
|
188
|
-
class:
|
|
187
|
+
"onUpdate:modelValue": g[0] || (g[0] = (O) => W(t) ? t.value = O : null),
|
|
188
|
+
placeholder: r.value,
|
|
189
|
+
disabled: l(n).disabled,
|
|
190
|
+
maxlength: l(n).maxLength,
|
|
191
|
+
style: N(l(d)),
|
|
192
|
+
class: I([
|
|
189
193
|
"mc-textarea",
|
|
190
|
-
{ "mc-textarea-simple":
|
|
194
|
+
{ "mc-textarea-simple": l(n).displayType === l(S).Simple, "mc-textarea-disabled": l(n).disabled }
|
|
191
195
|
]),
|
|
192
|
-
onInput:
|
|
193
|
-
onCompositionstart:
|
|
194
|
-
onCompositionend:
|
|
195
|
-
onKeydown:
|
|
196
|
-
onFocus:
|
|
197
|
-
onBlur:
|
|
198
|
-
}, null, 46,
|
|
199
|
-
[
|
|
196
|
+
onInput: v,
|
|
197
|
+
onCompositionstart: L,
|
|
198
|
+
onCompositionend: D,
|
|
199
|
+
onKeydown: R,
|
|
200
|
+
onFocus: Y,
|
|
201
|
+
onBlur: j
|
|
202
|
+
}, null, 46, r1)), [
|
|
203
|
+
[G, l(t)]
|
|
200
204
|
]);
|
|
201
205
|
}
|
|
202
206
|
}), B = (e, o) => {
|
|
@@ -204,7 +208,7 @@ const a1 = ["placeholder", "disabled", "maxlength"], r1 = /* @__PURE__ */ $({
|
|
|
204
208
|
for (const [t, n] of o)
|
|
205
209
|
s[t] = n;
|
|
206
210
|
return s;
|
|
207
|
-
},
|
|
211
|
+
}, u1 = {}, p1 = {
|
|
208
212
|
width: "16px",
|
|
209
213
|
height: "16px",
|
|
210
214
|
viewBox: "0 0 16 16",
|
|
@@ -212,8 +216,8 @@ const a1 = ["placeholder", "disabled", "maxlength"], r1 = /* @__PURE__ */ $({
|
|
|
212
216
|
xmlns: "http://www.w3.org/2000/svg"
|
|
213
217
|
};
|
|
214
218
|
function d1(e, o) {
|
|
215
|
-
return
|
|
216
|
-
|
|
219
|
+
return m(), h("svg", p1, [...o[0] || (o[0] = [
|
|
220
|
+
C(
|
|
217
221
|
"g",
|
|
218
222
|
{
|
|
219
223
|
stroke: "none",
|
|
@@ -222,23 +226,23 @@ function d1(e, o) {
|
|
|
222
226
|
"fill-rule": "evenodd"
|
|
223
227
|
},
|
|
224
228
|
[
|
|
225
|
-
|
|
229
|
+
C("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" })
|
|
226
230
|
],
|
|
227
231
|
-1
|
|
228
232
|
/* CACHED */
|
|
229
233
|
)
|
|
230
234
|
])]);
|
|
231
235
|
}
|
|
232
|
-
const
|
|
236
|
+
const c1 = /* @__PURE__ */ B(u1, [["render", d1]]), f1 = {}, m1 = {
|
|
233
237
|
width: "16px",
|
|
234
238
|
height: "16px",
|
|
235
239
|
viewBox: "0 0 16 16",
|
|
236
240
|
version: "1.1",
|
|
237
241
|
xmlns: "http://www.w3.org/2000/svg"
|
|
238
242
|
};
|
|
239
|
-
function
|
|
240
|
-
return
|
|
241
|
-
|
|
243
|
+
function h1(e, o) {
|
|
244
|
+
return m(), h("svg", m1, [...o[0] || (o[0] = [
|
|
245
|
+
C(
|
|
242
246
|
"g",
|
|
243
247
|
{
|
|
244
248
|
stroke: "none",
|
|
@@ -247,127 +251,129 @@ function m1(e, o) {
|
|
|
247
251
|
"fill-rule": "evenodd"
|
|
248
252
|
},
|
|
249
253
|
[
|
|
250
|
-
|
|
254
|
+
C("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" })
|
|
251
255
|
],
|
|
252
256
|
-1
|
|
253
257
|
/* CACHED */
|
|
254
258
|
)
|
|
255
259
|
])]);
|
|
256
260
|
}
|
|
257
|
-
const
|
|
261
|
+
const v1 = /* @__PURE__ */ B(f1, [["render", h1]]), g1 = ["disabled"], C1 = { class: "mc-button-content" }, L1 = { key: 2 }, y1 = /* @__PURE__ */ M({
|
|
258
262
|
__name: "button",
|
|
259
263
|
setup(e) {
|
|
260
|
-
const { t: o } =
|
|
264
|
+
const { t: o } = A(), { inputValue: s, rootProps: t, rootEmits: n, clearInputAfterSubmit: a } = P(
|
|
261
265
|
z
|
|
262
|
-
),
|
|
266
|
+
), u = _(!1), r = _(!1), d = q({
|
|
263
267
|
top: "0px",
|
|
264
268
|
left: "0px"
|
|
265
|
-
}),
|
|
269
|
+
}), f = k(() => ({
|
|
266
270
|
"mc-button": !0,
|
|
267
271
|
"mc-button-loading": t.loading,
|
|
268
|
-
mousedown:
|
|
269
|
-
"mc-button-simple": t.sendBtnVariant ===
|
|
270
|
-
})), i = (
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
mousedown: u.value,
|
|
273
|
+
"mc-button-simple": t.sendBtnVariant === $.Simple
|
|
274
|
+
})), i = (v) => {
|
|
275
|
+
d.left = v.offsetX + "px", d.top = v.offsetY + "px", r.value = !0, setTimeout(() => {
|
|
276
|
+
r.value = !1;
|
|
273
277
|
}, 300);
|
|
274
|
-
},
|
|
275
|
-
i(
|
|
278
|
+
}, p = (v) => {
|
|
279
|
+
i(v), t.loading ? n("cancel") : (n("submit", s.value), a(), n("change", s.value));
|
|
276
280
|
};
|
|
277
|
-
return (
|
|
278
|
-
disabled:
|
|
279
|
-
class:
|
|
280
|
-
onClick:
|
|
281
|
-
onMousedown:
|
|
282
|
-
onMouseup:
|
|
281
|
+
return (v, L) => (m(), h("button", {
|
|
282
|
+
disabled: l(t).disabled || !l(t).loading && !l(s),
|
|
283
|
+
class: I(f.value),
|
|
284
|
+
onClick: p,
|
|
285
|
+
onMousedown: L[0] || (L[0] = () => u.value = !0),
|
|
286
|
+
onMouseup: L[1] || (L[1] = () => u.value = !1)
|
|
283
287
|
}, [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
C("span", C1, [
|
|
289
|
+
l(t).loading ? (m(), Z(c1, { key: 0 })) : (m(), Z(v1, { key: 1 })),
|
|
290
|
+
l(t).sendBtnVariant === l($).Full ? (m(), h(
|
|
287
291
|
"span",
|
|
288
|
-
|
|
289
|
-
|
|
292
|
+
L1,
|
|
293
|
+
E(l(t).loading ? l(o)("Input.pauseAnswer") : l(o)("Input.send")),
|
|
290
294
|
1
|
|
291
295
|
/* TEXT */
|
|
292
|
-
)) :
|
|
296
|
+
)) : x("v-if", !0)
|
|
293
297
|
]),
|
|
294
|
-
|
|
298
|
+
r.value ? (m(), h(
|
|
295
299
|
"div",
|
|
296
300
|
{
|
|
297
301
|
key: 0,
|
|
298
302
|
class: "mc-button-water-wave",
|
|
299
|
-
style:
|
|
303
|
+
style: N(d)
|
|
300
304
|
},
|
|
301
305
|
null,
|
|
302
306
|
4
|
|
303
307
|
/* STYLE */
|
|
304
|
-
)) :
|
|
305
|
-
], 42,
|
|
308
|
+
)) : x("v-if", !0)
|
|
309
|
+
], 42, g1));
|
|
306
310
|
}
|
|
307
|
-
}),
|
|
311
|
+
}), V = /* @__PURE__ */ B(y1, [["__scopeId", "data-v-dbbf3b38"]]), b1 = { class: "mc-input-content" }, x1 = {
|
|
308
312
|
key: 0,
|
|
309
313
|
class: "mc-input-foot"
|
|
310
|
-
},
|
|
314
|
+
}, S1 = { class: "mc-input-foot-left" }, _1 = {
|
|
311
315
|
key: 0,
|
|
312
316
|
class: "mc-input-foot-count"
|
|
313
|
-
},
|
|
317
|
+
}, K = /* @__PURE__ */ M({
|
|
314
318
|
__name: "Input",
|
|
315
|
-
props:
|
|
316
|
-
emits:
|
|
319
|
+
props: e1,
|
|
320
|
+
emits: t1,
|
|
317
321
|
setup(e, { expose: o, emit: s }) {
|
|
318
|
-
const t = e, n = s, a =
|
|
322
|
+
const t = e, n = s, a = _(""), u = k(() => ({
|
|
319
323
|
"mc-input": !0,
|
|
320
324
|
"mc-input-disabled": t.disabled,
|
|
321
|
-
"mc-input-simple": t.displayType ===
|
|
325
|
+
"mc-input-simple": t.displayType === S.Simple,
|
|
322
326
|
"mc-input-borderless": t.variant === H.BorderLess
|
|
323
|
-
})),
|
|
327
|
+
})), r = () => {
|
|
324
328
|
a.value = "";
|
|
325
|
-
},
|
|
326
|
-
|
|
329
|
+
}, d = () => {
|
|
330
|
+
t.autoClear && r();
|
|
331
|
+
}, f = () => a.value;
|
|
332
|
+
return F(
|
|
327
333
|
() => t.value,
|
|
328
334
|
() => {
|
|
329
335
|
a.value = t.value;
|
|
330
336
|
},
|
|
331
337
|
{ immediate: !0 }
|
|
332
|
-
), o({ clearInput:
|
|
338
|
+
), o({ clearInput: r, getInput: f }), J(z, { inputValue: a, rootProps: t, rootEmits: n, clearInputAfterSubmit: d }), (i, p) => (m(), h(
|
|
333
339
|
"div",
|
|
334
340
|
{
|
|
335
|
-
class:
|
|
341
|
+
class: I(u.value)
|
|
336
342
|
},
|
|
337
343
|
[
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
i.displayType ===
|
|
344
|
-
|
|
345
|
-
]) :
|
|
344
|
+
y(i.$slots, "head"),
|
|
345
|
+
C("div", b1, [
|
|
346
|
+
y(i.$slots, "prefix"),
|
|
347
|
+
w(l1),
|
|
348
|
+
y(i.$slots, "suffix"),
|
|
349
|
+
i.displayType === l(S).Simple ? y(i.$slots, "button", { key: 0 }, () => [
|
|
350
|
+
w(V)
|
|
351
|
+
]) : x("v-if", !0)
|
|
346
352
|
]),
|
|
347
|
-
i.displayType ===
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
i.showCount ? (
|
|
353
|
+
i.displayType === l(S).Full ? (m(), h("div", x1, [
|
|
354
|
+
C("div", S1, [
|
|
355
|
+
y(i.$slots, "extra"),
|
|
356
|
+
i.showCount ? (m(), h(
|
|
351
357
|
"span",
|
|
352
|
-
|
|
353
|
-
|
|
358
|
+
_1,
|
|
359
|
+
E(a.value.length) + E(i.maxLength ?? !1 ? `/${i.maxLength}` : ""),
|
|
354
360
|
1
|
|
355
361
|
/* TEXT */
|
|
356
|
-
)) :
|
|
362
|
+
)) : x("v-if", !0)
|
|
357
363
|
]),
|
|
358
|
-
|
|
359
|
-
|
|
364
|
+
y(i.$slots, "button", {}, () => [
|
|
365
|
+
w(V)
|
|
360
366
|
])
|
|
361
|
-
])) :
|
|
367
|
+
])) : x("v-if", !0)
|
|
362
368
|
],
|
|
363
369
|
2
|
|
364
370
|
/* CLASS */
|
|
365
371
|
));
|
|
366
372
|
}
|
|
367
373
|
});
|
|
368
|
-
|
|
369
|
-
e.component("McInput",
|
|
374
|
+
K.install = (e) => {
|
|
375
|
+
e.component("McInput", K);
|
|
370
376
|
};
|
|
371
377
|
export {
|
|
372
|
-
|
|
378
|
+
K as McInput
|
|
373
379
|
};
|