@matechat/core 1.9.0 → 1.10.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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-8b1b116f]{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-8b1b116f]{animation:rotating-8b1b116f 1s linear infinite}.mc-button.mousedown[data-v-8b1b116f]:not(:disabled){transform:scale(.95)}.mc-button.mc-button-simple[data-v-8b1b116f]{width:32px;padding:6px;flex-shrink:0;border-radius:100%}.mc-button.mc-button-simple svg[data-v-8b1b116f]{margin-right:0}.mc-button[data-v-8b1b116f]:hover{background-color:var(--devui-primary-hover, #7693f5)}.mc-button[data-v-8b1b116f]:active{background-color:var(--devui-primary-active, #344899)}.mc-button[data-v-8b1b116f]:disabled{color:var(--devui-light-text, #ffffff);background-color:var(--devui-primary-disabled, #beccfa);cursor:not-allowed}.mc-button .mc-button-content[data-v-8b1b116f]{display:inline-flex;align-items:center;font-size:var(--devui-font-size, 14px)}.mc-button .mc-button-water-wave[data-v-8b1b116f]{position:absolute;background-color:var(--devui-base-bg, #ffffff);border-radius:50%;opacity:0;width:20px;height:20px;transform:translate(-50%,-50%);animation:waterWave-8b1b116f var(--devui-animation-duration-slow, .3s) var(--devui-animation-linear, cubic-bezier(0, 0, 1, 1))}.mc-button svg[data-v-8b1b116f]{margin-right:4px}.mc-button svg[data-v-8b1b116f] path{fill:var(--devui-light-text, #ffffff)}@keyframes rotating-8b1b116f{0%{transform:rotate(0)}to{transform:rotate(180deg)}}@keyframes waterWave-8b1b116f{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)}
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 S, defineComponent as $, inject as K, computed as M, watch as P, onMounted as I, withDirectives as O, createElementBlock as m, openBlock as f, normalizeClass as k, normalizeStyle as F, unref as r, isRef as U, vModelText as W, nextTick as G, createElementVNode as g, reactive as X, createCommentVNode as b, createBlock as T, toDisplayString as w, provide as q, renderSlot as L, createVNode as _ } from "vue";
3
- import { useMcI18n as N } from "@matechat/core/Locale";
4
- var x = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(x || {}), H = /* @__PURE__ */ ((e) => (e.Bordered = "bordered", e.BorderLess = "borderless", e))(H || {}), E = /* @__PURE__ */ ((e) => (e.Simple = "simple", e.Full = "full", e))(E || {}), y = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.ShiftEnter = "shiftEnter", e))(y || {});
5
- const J = {
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
- }, Q = {
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
- }, e1 = ["change", "submit", "cancel", "focus", "blur"], z = "mc-input", t1 = [
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
- ], o1 = `
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 n1(e) {
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: t1.map(
93
- (d) => `${d}:${o.getPropertyValue(d)}`
96
+ return { contextStyle: o1.map(
97
+ (u) => `${u}:${o.getPropertyValue(u)}`
94
98
  ).join(";"), paddingSize: t, borderSize: n, boxSizing: s };
95
99
  }
96
- function s1(e, o = 1, s) {
97
- const { contextStyle: t, paddingSize: n, borderSize: a, boxSizing: d } = n1(e), l = document.createElement("textarea");
98
- l.setAttribute("style", `${t};${o1}`), l.value = e.value || e.placeholder || "", document.body.appendChild(l);
99
- let c = l.scrollHeight;
100
- const i = {
101
- height: `${c}px`
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
- l.value = " ";
105
- const h = l.scrollHeight - n;
108
+ r.value = " ";
109
+ const i = r.scrollHeight - n;
106
110
  if (o !== void 0) {
107
- let u = h * o;
108
- d === "border-box" && (u = u + n + a), c = Math.max(u, c), i.minHeight = `${u}px`;
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 u = h * s;
112
- d === "border-box" && (u = u + n + a), c > u ? (c = u, i.overflowY = "auto") : i.overflowY = "hidden";
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 i.height = `${c}px`, l.remove(), i;
119
+ return f.height = `${d}px`, r.remove(), f;
116
120
  }
117
- function i1(e) {
118
- const { textareaRef: o, autosize: s } = e, t = S({}), n = () => typeof s == "boolean" ? J : s;
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 d = n(), l = s1(
130
+ const u = n(), r = i1(
127
131
  o.value,
128
- d.minRows,
129
- d.maxRows
132
+ u.minRows,
133
+ u.maxRows
130
134
  );
131
135
  t.value = {
132
- ...l,
136
+ ...r,
133
137
  resize: "none"
134
138
  };
135
139
  }
136
140
  };
137
141
  }
138
- const a1 = ["placeholder", "disabled", "maxlength"], r1 = /* @__PURE__ */ $({
142
+ const r1 = ["placeholder", "disabled", "maxlength"], l1 = /* @__PURE__ */ M({
139
143
  __name: "textarea",
140
144
  setup(e) {
141
- const { t: o } = N(), s = S(null), { inputValue: t, rootProps: n, rootEmits: a } = K(z), d = M(() => {
142
- let p = "", v = "";
143
- return n.submitShortKey === y.Enter && (p = "Enter", v = "Shift + Enter"), n.submitShortKey === y.ShiftEnter && (p = "Shift + Enter", v = "Enter"), n.placeholder ?? (p ? o("Input.pleaseEnterPlaceholder", { enterKey: p, shiftEnterKey: v }) : o("Input.pleaseEnter"));
144
- }), { textareaStyle: l, updateTextareaStyle: c } = i1({
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
- P(
152
+ F(
149
153
  () => t.value,
150
154
  () => {
151
- c();
155
+ f();
152
156
  }
153
- ), I(() => {
154
- c();
157
+ ), T(() => {
158
+ f();
155
159
  });
156
160
  let i = !1;
157
- const h = () => {
158
- G(() => {
161
+ const p = () => {
162
+ X(() => {
159
163
  a("change", t.value);
160
164
  });
161
- }, u = () => {
162
- i || h();
163
- }, C = () => {
165
+ }, v = () => {
166
+ i || p();
167
+ }, L = () => {
164
168
  i = !0;
165
- }, A = () => {
169
+ }, D = () => {
166
170
  setTimeout(() => {
167
- i = !1, h();
171
+ i = !1, p();
168
172
  }, 10);
169
- }, D = (p) => {
173
+ }, R = (c) => {
170
174
  if (n.submitShortKey === null)
171
175
  return;
172
- (n.submitShortKey === y.Enter ? !p.shiftKey : n.submitShortKey === y.ShiftEnter ? p.shiftKey : !1) && p.key === "Enter" && !i && (p.preventDefault(), a("submit", t.value), t.value = "", a("change", t.value));
173
- }, R = (p) => {
174
- a("focus", p);
175
- }, Y = (p) => {
176
- a("blur", p);
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 I(() => {
182
+ return T(() => {
179
183
  n.autofocus && s.value && !n.disabled && s.value.focus();
180
- }), (p, v) => O((f(), m("textarea", {
184
+ }), (c, g) => U((m(), h("textarea", {
181
185
  ref_key: "textareaRef",
182
186
  ref: s,
183
- "onUpdate:modelValue": v[0] || (v[0] = (j) => U(t) ? t.value = j : null),
184
- placeholder: d.value,
185
- disabled: r(n).disabled,
186
- maxlength: r(n).maxLength,
187
- style: F(r(l)),
188
- class: k([
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": r(n).displayType === r(x).Simple, "mc-textarea-disabled": r(n).disabled }
194
+ { "mc-textarea-simple": l(n).displayType === l(S).Simple, "mc-textarea-disabled": l(n).disabled }
191
195
  ]),
192
- onInput: u,
193
- onCompositionstart: C,
194
- onCompositionend: A,
195
- onKeydown: D,
196
- onFocus: R,
197
- onBlur: Y
198
- }, null, 46, a1)), [
199
- [W, r(t)]
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
- }, l1 = {}, u1 = {
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 f(), m("svg", u1, [...o[0] || (o[0] = [
216
- g(
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
- g("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" })
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 p1 = /* @__PURE__ */ B(l1, [["render", d1]]), c1 = {}, f1 = {
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 m1(e, o) {
240
- return f(), m("svg", f1, [...o[0] || (o[0] = [
241
- g(
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
- g("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" })
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 h1 = /* @__PURE__ */ B(c1, [["render", m1]]), v1 = ["disabled"], g1 = { class: "mc-button-content" }, C1 = { key: 2 }, L1 = /* @__PURE__ */ $({
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 } = N(), { inputValue: s, rootProps: t, rootEmits: n } = K(
264
+ const { t: o } = A(), { inputValue: s, rootProps: t, rootEmits: n, clearInputAfterSubmit: a } = P(
261
265
  z
262
- ), a = S(!1), d = S(!1), l = X({
266
+ ), u = _(!1), r = _(!1), d = q({
263
267
  top: "0px",
264
268
  left: "0px"
265
- }), c = M(() => ({
269
+ }), f = k(() => ({
266
270
  "mc-button": !0,
267
271
  "mc-button-loading": t.loading,
268
- mousedown: a.value,
269
- "mc-button-simple": t.sendBtnVariant === E.Simple
270
- })), i = (u) => {
271
- l.left = u.offsetX + "px", l.top = u.offsetY + "px", d.value = !0, setTimeout(() => {
272
- d.value = !1;
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
- }, h = (u) => {
275
- i(u), t.loading ? n("cancel") : (n("submit", s.value), s.value = "", n("change", s.value));
278
+ }, p = (v) => {
279
+ i(v), t.loading ? n("cancel") : (n("submit", s.value), a(), n("change", s.value));
276
280
  };
277
- return (u, C) => (f(), m("button", {
278
- disabled: r(t).disabled || !r(t).loading && !r(s),
279
- class: k(c.value),
280
- onClick: h,
281
- onMousedown: C[0] || (C[0] = () => a.value = !0),
282
- onMouseup: C[1] || (C[1] = () => a.value = !1)
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
- g("span", g1, [
285
- r(t).loading ? (f(), T(p1, { key: 0 })) : (f(), T(h1, { key: 1 })),
286
- r(t).sendBtnVariant === r(E).Full ? (f(), m(
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
- C1,
289
- w(r(t).loading ? r(o)("Input.pauseAnswer") : r(o)("Input.send")),
292
+ L1,
293
+ E(l(t).loading ? l(o)("Input.pauseAnswer") : l(o)("Input.send")),
290
294
  1
291
295
  /* TEXT */
292
- )) : b("v-if", !0)
296
+ )) : x("v-if", !0)
293
297
  ]),
294
- d.value ? (f(), m(
298
+ r.value ? (m(), h(
295
299
  "div",
296
300
  {
297
301
  key: 0,
298
302
  class: "mc-button-water-wave",
299
- style: F(l)
303
+ style: N(d)
300
304
  },
301
305
  null,
302
306
  4
303
307
  /* STYLE */
304
- )) : b("v-if", !0)
305
- ], 42, v1));
308
+ )) : x("v-if", !0)
309
+ ], 42, g1));
306
310
  }
307
- }), Z = /* @__PURE__ */ B(L1, [["__scopeId", "data-v-8b1b116f"]]), y1 = { class: "mc-input-content" }, b1 = {
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
- }, x1 = { class: "mc-input-foot-left" }, S1 = {
314
+ }, S1 = { class: "mc-input-foot-left" }, _1 = {
311
315
  key: 0,
312
316
  class: "mc-input-foot-count"
313
- }, V = /* @__PURE__ */ $({
317
+ }, K = /* @__PURE__ */ M({
314
318
  __name: "Input",
315
- props: Q,
316
- emits: e1,
319
+ props: e1,
320
+ emits: t1,
317
321
  setup(e, { expose: o, emit: s }) {
318
- const t = e, n = s, a = S(""), d = M(() => ({
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 === x.Simple,
325
+ "mc-input-simple": t.displayType === S.Simple,
322
326
  "mc-input-borderless": t.variant === H.BorderLess
323
- })), l = () => {
327
+ })), r = () => {
324
328
  a.value = "";
325
- }, c = () => a.value;
326
- return P(
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: l, getInput: c }), q(z, { inputValue: a, rootProps: t, rootEmits: n }), (i, h) => (f(), m(
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: k(d.value)
341
+ class: I(u.value)
336
342
  },
337
343
  [
338
- L(i.$slots, "head"),
339
- g("div", y1, [
340
- L(i.$slots, "prefix"),
341
- _(r1),
342
- L(i.$slots, "suffix"),
343
- i.displayType === r(x).Simple ? L(i.$slots, "button", { key: 0 }, () => [
344
- _(Z)
345
- ]) : b("v-if", !0)
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 === r(x).Full ? (f(), m("div", b1, [
348
- g("div", x1, [
349
- L(i.$slots, "extra"),
350
- i.showCount ? (f(), m(
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
- S1,
353
- w(a.value.length) + w(i.maxLength ?? !1 ? `/${i.maxLength}` : ""),
358
+ _1,
359
+ E(a.value.length) + E(i.maxLength ?? !1 ? `/${i.maxLength}` : ""),
354
360
  1
355
361
  /* TEXT */
356
- )) : b("v-if", !0)
362
+ )) : x("v-if", !0)
357
363
  ]),
358
- L(i.$slots, "button", {}, () => [
359
- _(Z)
364
+ y(i.$slots, "button", {}, () => [
365
+ w(V)
360
366
  ])
361
- ])) : b("v-if", !0)
367
+ ])) : x("v-if", !0)
362
368
  ],
363
369
  2
364
370
  /* CLASS */
365
371
  ));
366
372
  }
367
373
  });
368
- V.install = (e) => {
369
- e.component("McInput", V);
374
+ K.install = (e) => {
375
+ e.component("McInput", K);
370
376
  };
371
377
  export {
372
- V as McInput
378
+ K as McInput
373
379
  };