mc-plus 1.0.80 → 1.0.82

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 (43) hide show
  1. package/dist/es/index.js +40 -40
  2. package/dist/es/{mc-checkbox-OfLD1859.js → mc-checkbox-CnZgOlqy.js} +10 -9
  3. package/dist/es/{mc-checkbox-group-CKNQQMNj.js → mc-checkbox-group-Bcb22OxF.js} +9 -7
  4. package/dist/es/mc-form-DHiUJW30.js +77 -0
  5. package/dist/es/{mc-form-item-BVTQeSJh.js → mc-form-item-BdDiwk3J.js} +1 -1
  6. package/dist/es/{mc-input-C3tEJiVq.js → mc-input-DHG9UpMy.js} +26 -20
  7. package/dist/es/{mc-input-group-ibNkzqnG.js → mc-input-group-Bm5RSk_9.js} +1 -1
  8. package/dist/es/mc-otp-uorpadQp.js +74 -0
  9. package/dist/es/mc-radio-CxDJR40q.js +23 -0
  10. package/dist/es/{mc-radio-group-B0X5zf9C.js → mc-radio-group-BRgNGg1o.js} +1 -1
  11. package/dist/es/{mc-richtext-BAFC11Tx.js → mc-richtext-jEtR3SjP.js} +3 -3
  12. package/dist/es/{mc-select-DRczB_Lf.js → mc-select-DJRqoHto.js} +20 -17
  13. package/dist/es/{mc-select-group-B872eYgp.js → mc-select-group-Bei-NLQN.js} +1 -1
  14. package/dist/es/{mc-select-group-plus-V22fqkfw.js → mc-select-group-plus-APP_78wJ.js} +1 -1
  15. package/dist/es/{mc-select-multi-option-DFEin7_N.js → mc-select-multi-option-D7n9oExC.js} +1 -1
  16. package/dist/es/{mc-select-option-DeyzEQPx.js → mc-select-option-Bawxolt8.js} +2 -2
  17. package/dist/es/{mc-select-option-plus-Cc3PofO7.js → mc-select-option-plus-5glbaxM8.js} +2 -2
  18. package/dist/es/{mc-select-plus-D8g9xcTv.js → mc-select-plus-CAmogpfF.js} +19 -17
  19. package/dist/es/{mc-switch-Dp9hPXzl.js → mc-switch-CuxgS0BZ.js} +9 -8
  20. package/dist/es/{mc-table-DLMNj3Gx.js → mc-table-DaY8VrDo.js} +1 -1
  21. package/dist/es/{mc-textarea-ve5-u8Ny.js → mc-textarea-WAuVeRJH.js} +9 -8
  22. package/dist/es/theme/mc-checkbox.css +1 -1
  23. package/dist/es/theme/mc-input.css +1 -1
  24. package/dist/es/theme/mc-otp.css +1 -1
  25. package/dist/es/theme/mc-radio.css +1 -1
  26. package/dist/es/theme/mc-select-plus.css +1 -1
  27. package/dist/es/theme/mc-select.css +1 -1
  28. package/dist/es/theme/mc-switch.css +1 -1
  29. package/dist/es/theme/mc-textarea.css +1 -1
  30. package/dist/index.css +1 -1
  31. package/dist/types/mc-form/hooks/types.d.ts +4 -4
  32. package/dist/types/mc-form/hooks/useFormDisabled.d.ts +1 -1
  33. package/dist/types/mc-form/hooks/useFormId.d.ts +1 -1
  34. package/dist/types/mc-form/hooks/useFormItem.d.ts +39 -4
  35. package/dist/types/mc-form/hooks/useFormValidate.d.ts +42 -8
  36. package/dist/umd/index.css +1 -1
  37. package/dist/umd/index.css.gz +0 -0
  38. package/dist/umd/index.umd.cjs +12 -12
  39. package/dist/umd/index.umd.cjs.gz +0 -0
  40. package/package.json +1 -1
  41. package/dist/es/mc-form-DkWNoAUZ.js +0 -79
  42. package/dist/es/mc-otp-BZQLwIxa.js +0 -72
  43. package/dist/es/mc-radio-BFi0Obap.js +0 -22
package/dist/es/index.js CHANGED
@@ -3,10 +3,10 @@ import { M as E } from "./mc-alert-message-CaYxL1Yi.js";
3
3
  import { a } from "./mc-alert-message-CaYxL1Yi.js";
4
4
  import { M as O } from "./mc-button-Bg4Yihn7.js";
5
5
  import { a as a2 } from "./mc-button-Bg4Yihn7.js";
6
- import { M as L } from "./mc-checkbox-OfLD1859.js";
7
- import { a as a3 } from "./mc-checkbox-OfLD1859.js";
8
- import { M as x } from "./mc-checkbox-group-CKNQQMNj.js";
9
- import { C, a as a4 } from "./mc-checkbox-group-CKNQQMNj.js";
6
+ import { M as L } from "./mc-checkbox-CnZgOlqy.js";
7
+ import { a as a3 } from "./mc-checkbox-CnZgOlqy.js";
8
+ import { M as x } from "./mc-checkbox-group-Bcb22OxF.js";
9
+ import { C, a as a4 } from "./mc-checkbox-group-Bcb22OxF.js";
10
10
  import { M as R } from "./mc-collapse-D8JEfYOu.js";
11
11
  import { C as C2, a as a5 } from "./mc-collapse-D8JEfYOu.js";
12
12
  import { M as P } from "./mc-collapse-item-B_qKeVrY.js";
@@ -23,18 +23,18 @@ import { M as G } from "./mc-drawer-DJk754RT.js";
23
23
  import { a as a11 } from "./mc-drawer-DJk754RT.js";
24
24
  import { M as Y } from "./mc-footer-BeEDYFlH.js";
25
25
  import { a as a12 } from "./mc-footer-BeEDYFlH.js";
26
- import { M as X } from "./mc-form-DkWNoAUZ.js";
27
- import { F, b } from "./mc-form-DkWNoAUZ.js";
28
- import { M as H } from "./mc-form-item-BVTQeSJh.js";
29
- import { F as F2, a as a13 } from "./mc-form-item-BVTQeSJh.js";
26
+ import { M as X } from "./mc-form-DHiUJW30.js";
27
+ import { F, b } from "./mc-form-DHiUJW30.js";
28
+ import { M as H } from "./mc-form-item-BdDiwk3J.js";
29
+ import { F as F2, a as a13 } from "./mc-form-item-BdDiwk3J.js";
30
30
  import { M as K } from "./mc-icon-CmYW61Q0.js";
31
31
  import { a as a14 } from "./mc-icon-CmYW61Q0.js";
32
32
  import { M as y } from "./mc-icon-plus-BFYVRrKw.js";
33
33
  import { b as b2 } from "./mc-icon-plus-BFYVRrKw.js";
34
- import { M as v } from "./mc-input-C3tEJiVq.js";
35
- import { a as a15 } from "./mc-input-C3tEJiVq.js";
36
- import { M as w } from "./mc-input-group-ibNkzqnG.js";
37
- import { I, a as a16 } from "./mc-input-group-ibNkzqnG.js";
34
+ import { M as v } from "./mc-input-DHG9UpMy.js";
35
+ import { a as a15 } from "./mc-input-DHG9UpMy.js";
36
+ import { M as w } from "./mc-input-group-Bm5RSk_9.js";
37
+ import { I, a as a16 } from "./mc-input-group-Bm5RSk_9.js";
38
38
  import { M as J } from "./mc-lightbox-DRiJSWar.js";
39
39
  import { a as a17 } from "./mc-lightbox-DRiJSWar.js";
40
40
  import { M as V } from "./mc-loading-CgQDxms4.js";
@@ -43,8 +43,8 @@ import { M as Z } from "./mc-modal-header-BUvK3-bl.js";
43
43
  import { a as a19 } from "./mc-modal-header-BUvK3-bl.js";
44
44
  import { M as z } from "./mc-multi-tag-CWwyuXAy.js";
45
45
  import { a as a20 } from "./mc-multi-tag-CWwyuXAy.js";
46
- import { M as Q } from "./mc-otp-BZQLwIxa.js";
47
- import { a as a21 } from "./mc-otp-BZQLwIxa.js";
46
+ import { M as Q } from "./mc-otp-uorpadQp.js";
47
+ import { a as a21 } from "./mc-otp-uorpadQp.js";
48
48
  import { M as $ } from "./mc-overlay-CHfJL0kY.js";
49
49
  import { a as a22 } from "./mc-overlay-CHfJL0kY.js";
50
50
  import { M as ss } from "./mc-popper-CbGrFzA5.js";
@@ -57,32 +57,32 @@ import { a as rs } from "./mc-progress-indicator-item-BiQL0uXR.js";
57
57
  import { M } from "./mc-progress-indicator-item-BiQL0uXR.js";
58
58
  import { a as as } from "./mc-progress-indicator-child-item-DAKkXWWn.js";
59
59
  import { M as M2 } from "./mc-progress-indicator-child-item-DAKkXWWn.js";
60
- import { M as ts } from "./mc-radio-BFi0Obap.js";
61
- import { a as a26 } from "./mc-radio-BFi0Obap.js";
62
- import { a as ps } from "./mc-radio-group-B0X5zf9C.js";
63
- import { b as b4, M as M3 } from "./mc-radio-group-B0X5zf9C.js";
60
+ import { M as ts } from "./mc-radio-CxDJR40q.js";
61
+ import { a as a26 } from "./mc-radio-CxDJR40q.js";
62
+ import { a as ps } from "./mc-radio-group-BRgNGg1o.js";
63
+ import { b as b4, M as M3 } from "./mc-radio-group-BRgNGg1o.js";
64
64
  import { M as cs } from "./mc-removable-tag-YZpBGZiE.js";
65
65
  import { a as a27 } from "./mc-removable-tag-YZpBGZiE.js";
66
66
  import { M as es } from "./mc-reset-CJBlVip8.js";
67
67
  import { a as a28 } from "./mc-reset-CJBlVip8.js";
68
- import { M as _s } from "./mc-richtext-BAFC11Tx.js";
69
- import { F as F3, a as a29, b as b5, T } from "./mc-richtext-BAFC11Tx.js";
68
+ import { M as _s } from "./mc-richtext-jEtR3SjP.js";
69
+ import { F as F3, a as a29, b as b5, T } from "./mc-richtext-jEtR3SjP.js";
70
70
  import { M as Ms } from "./mc-secondary-menu-3p4UsHZ0.js";
71
71
  import { a as a30 } from "./mc-secondary-menu-3p4UsHZ0.js";
72
- import { M as is } from "./mc-select-DRczB_Lf.js";
73
- import { a as a31, S } from "./mc-select-DRczB_Lf.js";
74
- import { M as Cs } from "./mc-select-group-B872eYgp.js";
75
- import { a as a32, S as S2 } from "./mc-select-group-B872eYgp.js";
76
- import { M as fs } from "./mc-select-option-DeyzEQPx.js";
77
- import { a as a33 } from "./mc-select-option-DeyzEQPx.js";
78
- import { M as js } from "./mc-select-plus-D8g9xcTv.js";
79
- import { b as b6, a as a34 } from "./mc-select-plus-D8g9xcTv.js";
80
- import { a as Es } from "./mc-select-group-plus-V22fqkfw.js";
81
- import { M as M4 } from "./mc-select-group-plus-V22fqkfw.js";
82
- import { M as Ts } from "./mc-select-option-plus-Cc3PofO7.js";
83
- import { a as a35 } from "./mc-select-option-plus-Cc3PofO7.js";
84
- import { M as ls } from "./mc-select-multi-option-DFEin7_N.js";
85
- import { a as a36 } from "./mc-select-multi-option-DFEin7_N.js";
72
+ import { M as is } from "./mc-select-DJRqoHto.js";
73
+ import { a as a31, S } from "./mc-select-DJRqoHto.js";
74
+ import { M as Cs } from "./mc-select-group-Bei-NLQN.js";
75
+ import { a as a32, S as S2 } from "./mc-select-group-Bei-NLQN.js";
76
+ import { M as fs } from "./mc-select-option-Bawxolt8.js";
77
+ import { a as a33 } from "./mc-select-option-Bawxolt8.js";
78
+ import { M as js } from "./mc-select-plus-CAmogpfF.js";
79
+ import { b as b6, a as a34 } from "./mc-select-plus-CAmogpfF.js";
80
+ import { a as Es } from "./mc-select-group-plus-APP_78wJ.js";
81
+ import { M as M4 } from "./mc-select-group-plus-APP_78wJ.js";
82
+ import { M as Ts } from "./mc-select-option-plus-5glbaxM8.js";
83
+ import { a as a35 } from "./mc-select-option-plus-5glbaxM8.js";
84
+ import { M as ls } from "./mc-select-multi-option-D7n9oExC.js";
85
+ import { a as a36 } from "./mc-select-multi-option-D7n9oExC.js";
86
86
  import { M as Os } from "./mc-status-BJGdWYD5.js";
87
87
  import { a as a37 } from "./mc-status-BJGdWYD5.js";
88
88
  import { M as Ls } from "./mc-step-DRDtR0u_.js";
@@ -96,22 +96,22 @@ import { M as M6 } from "./mc-step-child-item-plus-CUT06Cwi.js";
96
96
  import { M as Ss, a as Rs, b as us } from "./mc-step-v2-C1e_kDgg.js";
97
97
  import { M as Ps } from "./mc-success-icon-BuGz3uNE.js";
98
98
  import { a as a40 } from "./mc-success-icon-BuGz3uNE.js";
99
- import { M as ns } from "./mc-switch-Dp9hPXzl.js";
100
- import { a as a41, b as b7 } from "./mc-switch-Dp9hPXzl.js";
99
+ import { M as ns } from "./mc-switch-CuxgS0BZ.js";
100
+ import { a as a41, b as b7 } from "./mc-switch-CuxgS0BZ.js";
101
101
  import { M as Ns } from "./mc-tab-BT5bQZPB.js";
102
102
  import { a as a42 } from "./mc-tab-BT5bQZPB.js";
103
103
  import { a as bs } from "./mc-tab-item-CqXL4HVs.js";
104
104
  import { M as M7 } from "./mc-tab-item-CqXL4HVs.js";
105
- import { M as Us } from "./mc-table-DLMNj3Gx.js";
106
- import { u, a as a43, b as b8 } from "./mc-table-DLMNj3Gx.js";
105
+ import { M as Us } from "./mc-table-DaY8VrDo.js";
106
+ import { u, a as a43, b as b8 } from "./mc-table-DaY8VrDo.js";
107
107
  import { M as ds } from "./mc-table-plus-mrdERsrX.js";
108
108
  import { d, f, r, p, q, o, g, j, b as b9, h, l, m, n, a as a44, e, i, c as c2, k } from "./mc-table-plus-mrdERsrX.js";
109
109
  import { a as gs } from "./mc-table-column-plus-N4ocB9zX.js";
110
110
  import { M as M8 } from "./mc-table-column-plus-N4ocB9zX.js";
111
111
  import { M as Bs } from "./mc-tag-CeJarQKP.js";
112
112
  import { a as a45 } from "./mc-tag-CeJarQKP.js";
113
- import { M as Ds } from "./mc-textarea-ve5-u8Ny.js";
114
- import { a as a46 } from "./mc-textarea-ve5-u8Ny.js";
113
+ import { M as Ds } from "./mc-textarea-WAuVeRJH.js";
114
+ import { a as a46 } from "./mc-textarea-WAuVeRJH.js";
115
115
  import { M as Gs } from "./mc-title-Bp0U8n05.js";
116
116
  import { a as a47 } from "./mc-title-Bp0U8n05.js";
117
117
  import { M as hs } from "./mc-title-tool-bar-DI-TZVG5.js";
@@ -1,26 +1,27 @@
1
1
  import { _ as e, u as o } from "./utils-y7s5KtP-.js";
2
- import { inject as c, computed as a, defineComponent as l, ref as s, createElementBlock as t, openBlock as r, createElementVNode as d, createCommentVNode as u, withModifiers as m, normalizeClass as n, unref as i, withKeys as p, renderSlot as b, createTextVNode as k, toDisplayString as h, nextTick as x } from "vue";
2
+ import { inject as a, computed as c, defineComponent as l, ref as s, createElementBlock as t, openBlock as r, createElementVNode as d, createCommentVNode as u, withModifiers as m, normalizeClass as n, unref as i, withKeys as p, renderSlot as b, createTextVNode as k, toDisplayString as h, nextTick as x } from "vue";
3
3
  import { useFocus as v } from "@mc-plus/hooks";
4
4
  import { isFunction as f, includes as y, isNil as C } from "lodash-es";
5
- import { C as V } from "./mc-checkbox-group-CKNQQMNj.js";
6
- import { u as S } from "./mc-form-DkWNoAUZ.js";
5
+ import { C as V } from "./mc-checkbox-group-Bcb22OxF.js";
6
+ import { u as S } from "./mc-form-DHiUJW30.js";
7
7
  const _ = "mc-checkbox", B = { class: "mc-checkbox" }, G = ["id", "value", "disabled", "onKeypress"], D = { key: 0, class: "mc-checkbox-content" }, I = { key: 0, class: "mc-checkbox-remarks" }, $ = o(e(l({ name: _, __name: "mc-checkbox", props: { modelValue: { type: Boolean }, disabled: { type: Boolean }, content: {}, remarks: {}, partial: { type: Boolean }, disableValidation: { type: Boolean, default: false }, value: {} }, emits: ["update:modelValue", "change", "focus", "blur"], setup(e2, { emit: o2 }) {
8
8
  const l2 = e2, _2 = o2, $2 = s(), { wrapperRef: g, isFocused: j, handleFocus: w, handleBlur: F } = v($2), { checkboxGroupDisabled: R, isCheckboxGroup: K, isCheckboxSelected: M, handleCheckboxSelect: q } = (() => {
9
- const e3 = c(V, void 0), o3 = a(() => {
9
+ const e3 = a(V, void 0), o3 = c(() => {
10
10
  var _a;
11
11
  return !!((_a = e3 == null ? void 0 : e3.disabled) == null ? void 0 : _a.value);
12
- }), l3 = a(() => !!e3 && f(e3 == null ? void 0 : e3.handleSelect));
12
+ }), l3 = c(() => !!e3 && f(e3 == null ? void 0 : e3.handleSelect));
13
13
  return { checkboxGroupCtx: e3, checkboxGroupDisabled: o3, isCheckboxGroup: l3, isCheckboxSelected: (o4) => {
14
14
  var _a;
15
15
  return !C(o4) && y((_a = e3 == null ? void 0 : e3.modelValue) == null ? void 0 : _a.value, o4);
16
16
  }, handleCheckboxSelect: (o4) => {
17
17
  e3 == null ? void 0 : e3.handleSelect(o4);
18
18
  } };
19
- })(), { formId: z, formItem: A, formDisabled: E, validateStyle: H } = S({ externalDisabled: R }), J = a(() => K.value ? M(l2.value) : !!l2.modelValue), L = async () => {
20
- E.value || (K.value ? q(l2.value) : (_2("update:modelValue", !l2.modelValue), _2("change", !l2.modelValue), await x(), A == null ? void 0 : A.validate("input")));
19
+ })(), { formId: z, formItemCtx: A, formDisabled: E, validateStyle: H } = S({ externalDisabled: R }), J = c(() => K.value ? M(l2.value) : !!l2.modelValue), L = async () => {
20
+ var _a;
21
+ E.value || (K.value ? q(l2.value) : (_2("update:modelValue", !l2.modelValue), _2("change", !l2.modelValue), await x(), (_a = A.value) == null ? void 0 : _a.validate("input")));
21
22
  };
22
- return (o3, c2) => (r(), t("div", B, [d("label", { ref_key: "checkboxRef", ref: g, class: n(["mc-checkbox-wrapper", { "mc-checkbox-disabled": i(E), "mc-checkbox-checked": J.value, "mc-checkbox-partial": e2.partial, "mc-checkbox-focused": i(j), [i(H)]: i(H) }]), onClick: m(L, ["prevent"]) }, [d("input", { ref_key: "checkboxInputRef", ref: $2, id: i(z), type: "checkbox", class: "mc-checkbox-input", value: J.value, disabled: i(E), onKeypress: p(m(L, ["prevent", "stop"]), ["enter"]), onFocus: c2[0] || (c2[0] = (...e3) => i(w) && i(w)(...e3)), onBlur: c2[1] || (c2[1] = (...e3) => i(F) && i(F)(...e3)) }, null, 40, G), c2[2] || (c2[2] = d("div", { class: "mc-checkbox-box" }, null, -1)), e2.content || o3.$slots.default ? (r(), t("div", D, [b(o3.$slots, "default", {}, () => [k(h(e2.content), 1)], true)])) : u("", true)], 2), e2.remarks || o3.$slots.remarks ? (r(), t("div", I, [b(o3.$slots, "remarks", {}, () => [k(h(e2.remarks), 1)], true)])) : u("", true)]));
23
- } }), [["__scopeId", "data-v-6832c203"]]));
23
+ return (o3, a2) => (r(), t("div", B, [d("label", { ref_key: "checkboxRef", ref: g, class: n(["mc-checkbox-wrapper", { "mc-checkbox-disabled": i(E), "mc-checkbox-checked": J.value, "mc-checkbox-partial": e2.partial, "mc-checkbox-focused": i(j), [i(H)]: i(H) }]), onClick: m(L, ["prevent"]) }, [d("input", { ref_key: "checkboxInputRef", ref: $2, id: i(z), type: "checkbox", class: "mc-checkbox-input", value: J.value, disabled: i(E), onKeypress: p(m(L, ["prevent", "stop"]), ["enter"]), onFocus: a2[0] || (a2[0] = (...e3) => i(w) && i(w)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => i(F) && i(F)(...e3)) }, null, 40, G), a2[2] || (a2[2] = d("div", { class: "mc-checkbox-box" }, null, -1)), e2.content || o3.$slots.default ? (r(), t("div", D, [b(o3.$slots, "default", {}, () => [k(h(e2.content), 1)], true)])) : u("", true)], 2), e2.remarks || o3.$slots.remarks ? (r(), t("div", I, [b(o3.$slots, "remarks", {}, () => [k(h(e2.remarks), 1)], true)])) : u("", true)]));
24
+ } }), [["__scopeId", "data-v-145b644a"]]));
24
25
  export {
25
26
  $ as M,
26
27
  _ as a
@@ -1,16 +1,18 @@
1
1
  import { u as e } from "./utils-y7s5KtP-.js";
2
- import { defineComponent as a, watch as o, provide as l, computed as m, createElementBlock as t, openBlock as d, unref as s, renderSlot as c, nextTick as u } from "vue";
2
+ import { defineComponent as a, watch as o, provide as l, computed as t, createElementBlock as m, openBlock as d, unref as s, renderSlot as u, nextTick as c } from "vue";
3
3
  import { indexOf as r } from "lodash-es";
4
- import { a as i } from "./mc-form-DkWNoAUZ.js";
4
+ import { a as i } from "./mc-form-DHiUJW30.js";
5
5
  const p = Symbol("mc-checkbox-group-context"), n = "mc-checkbox-group", f = ["id"], h = e(a({ name: n, __name: "mc-checkbox-group", props: { modelValue: { default: () => [] }, disabled: { type: Boolean, default: false } }, emits: ["update:modelValue", "change"], setup(e2, { emit: a2 }) {
6
- const n2 = e2, h2 = a2, { formId: b, formItem: g } = i();
6
+ const n2 = e2, h2 = a2, { formId: b, formItemCtx: g } = i();
7
7
  return o(() => n2.modelValue, () => {
8
- g == null ? void 0 : g.validate("change");
9
- }), l(p, { modelValue: m(() => n2.modelValue), disabled: m(() => n2.disabled), handleSelect: async (e3) => {
8
+ var _a;
9
+ (_a = g.value) == null ? void 0 : _a.validate("change");
10
+ }), l(p, { modelValue: t(() => n2.modelValue), disabled: t(() => n2.disabled), handleSelect: async (e3) => {
11
+ var _a;
10
12
  if (!e3) return;
11
13
  const a3 = [...n2.modelValue], o2 = r(a3, e3);
12
- o2 > -1 ? a3.splice(o2, 1) : a3.push(e3), h2("update:modelValue", a3), h2("change", a3), await u(), g == null ? void 0 : g.validate("input");
13
- } }), (e3, a3) => (d(), t("div", { class: "mc-checkbox-group", id: s(b) }, [c(e3.$slots, "default")], 8, f));
14
+ o2 > -1 ? a3.splice(o2, 1) : a3.push(e3), h2("update:modelValue", a3), h2("change", a3), await c(), (_a = g.value) == null ? void 0 : _a.validate("input");
15
+ } }), (e3, a3) => (d(), m("div", { class: "mc-checkbox-group", id: s(b) }, [u(e3.$slots, "default")], 8, f));
14
16
  } }));
15
17
  export {
16
18
  p as C,
@@ -0,0 +1,77 @@
1
+ import { p as e, _ as t, u as a } from "./utils-y7s5KtP-.js";
2
+ import { onMounted as r, onBeforeUnmount as o, computed as l, defineComponent as i, reactive as s, toRefs as d, provide as m, createElementBlock as n, openBlock as c, createElementVNode as u, withModifiers as v, renderSlot as f, ref as p, inject as x, watch as b } from "vue";
3
+ import { keys as I, first as h, filter as y, size as C, includes as D, each as V, isFunction as _ } from "lodash-es";
4
+ import { useId as j, useProp as w } from "@mc-plus/hooks";
5
+ import { F } from "./mc-form-item-BdDiwk3J.js";
6
+ const S = Symbol("mc-form-context"), E = "mc-form", B = { class: "mc-form" }, P = a(t(i({ name: E, __name: "mc-form", props: { model: {}, rules: { default: () => ({}) }, disabled: { type: Boolean }, direction: { default: "vertical" }, scrollToError: { type: Boolean, default: false } }, emits: ["validate"], setup(t2, { expose: a2, emit: r2 }) {
7
+ const o2 = t2, l2 = r2, i2 = [], p2 = (e2, t3) => C(t3) ? y(e2, (e3) => D(t3, e3.prop)) : e2, x2 = s({ ...d(o2), emits: l2, addField: (e2) => {
8
+ e2.prop && i2.push(e2);
9
+ }, removeField: (e2) => {
10
+ e2.prop && i2.splice(i2.indexOf(e2), 1);
11
+ } });
12
+ return m(S, x2), a2({ validate: async (t3 = [], a3) => {
13
+ try {
14
+ return await (async (e2 = [], t4) => {
15
+ const a4 = C(e2) ? y(i2, (t5) => D(e2, t5.prop)) : i2;
16
+ try {
17
+ const e3 = await (async (e4 = []) => {
18
+ let t5 = [];
19
+ for (const a5 of e4) try {
20
+ await a5.validate();
21
+ } catch (e5) {
22
+ t5.push(e5);
23
+ }
24
+ return !C(t5) || Promise.reject(t5);
25
+ })(a4);
26
+ return true === e3 && (t4 == null ? void 0 : t4(true)), e3;
27
+ } catch (e3) {
28
+ if (e3 instanceof Error) throw e3;
29
+ const a5 = e3;
30
+ return t4 == null ? void 0 : t4(false, a5), Promise.reject(a5);
31
+ }
32
+ })(t3, a3);
33
+ } catch (t4) {
34
+ return o2.scrollToError && (async (t5) => {
35
+ const a4 = I(h(t5))[0], r3 = p2(i2, [a4])[0].id, o3 = document.getElementById(r3);
36
+ o3 == null ? void 0 : o3.scrollIntoView({ block: "center", inline: "center", behavior: "smooth" }), await e(500), o3 == null ? void 0 : o3.focus();
37
+ })(t4), Promise.reject(t4);
38
+ }
39
+ }, resetFields: (e2 = []) => {
40
+ V(p2(i2, e2), (e3) => e3.resetField());
41
+ }, clearValidate: (e2 = []) => {
42
+ V(p2(i2, e2), (e3) => e3.clearValidate());
43
+ } }), (e2, t3) => (c(), n("div", B, [u("form", { onSubmit: t3[0] || (t3[0] = v(() => {
44
+ }, ["prevent"])) }, [f(e2.$slots, "default", {}, void 0, true)], 32)]));
45
+ } }), [["__scopeId", "data-v-446fb309"]])), g = ({ externalId: e2, externalDisabled: t2 } = {}) => {
46
+ const a2 = p(x(S, void 0)), i2 = p(x(F, void 0)), s2 = (({ formItemCtx: e3, externalId: t3 }) => {
47
+ const a3 = j(t3 == null ? void 0 : t3.value);
48
+ return r(() => {
49
+ e3.value && (e3.value.id = a3);
50
+ }), o(() => {
51
+ e3.value && (e3.value.id = "");
52
+ }), a3;
53
+ })({ formItemCtx: i2, externalId: e2 }), d2 = (({ formCtx: e3, formItemCtx: t3, externalDisabled: a3 }) => {
54
+ const r2 = w("disabled");
55
+ return l(() => {
56
+ var _a, _b;
57
+ return r2.value || !!((_a = e3.value) == null ? void 0 : _a.disabled) || !!((_b = t3.value) == null ? void 0 : _b.disabled) || !!(a3 == null ? void 0 : a3.value);
58
+ });
59
+ })({ formCtx: a2, formItemCtx: i2, externalDisabled: t2 });
60
+ return { formCtx: a2, formItemCtx: i2, formId: s2, formDisabled: d2 };
61
+ }, k = ({ externalId: e2, externalDisabled: t2, disableValidation: a2, validator: r2 } = {}) => {
62
+ const o2 = w("disableValidation"), i2 = l(() => !!o2.value || !!(a2 == null ? void 0 : a2.value)), { formCtx: s2, formItemCtx: d2, formId: m2, formDisabled: n2 } = g({ externalId: e2, externalDisabled: t2 }), c2 = l(() => {
63
+ var _a;
64
+ return i2.value ? "init" : _(r2) && "error" === r2() ? "error" : ((_a = d2.value) == null ? void 0 : _a.validateStatus) || "init";
65
+ }), u2 = l(() => i2.value ? "" : `mc-form-validate-${c2.value}`), v2 = l(() => !i2.value && "error" === c2.value), f2 = l(() => !i2.value && "success" === c2.value), p2 = w(["hideValidationIcon", "hide-validation-icon"]), x2 = l(() => !i2.value && !p2.value && (v2.value ? "Reject_02" : !!f2.value && "Accept_02")), I2 = w("modelValue");
66
+ return b(() => I2.value, () => {
67
+ var _a;
68
+ i2.value || ((_a = d2.value) == null ? void 0 : _a.validate("change"));
69
+ }), { formCtx: s2, formItemCtx: d2, formId: m2, formDisabled: n2, validateStatus: c2, validateStyle: u2, isError: v2, isSuccess: f2, statusIcon: x2 };
70
+ };
71
+ export {
72
+ S as F,
73
+ P as M,
74
+ g as a,
75
+ E as b,
76
+ k as u
77
+ };
@@ -3,7 +3,7 @@ import { defineComponent as t, inject as l, ref as o, computed as s, reactive as
3
3
  import { isNil as $, filter as j, map as P, includes as k, keys as x, size as z, some as M, get as S, set as w, cloneDeep as B, isArray as V } from "lodash-es";
4
4
  import I from "async-validator";
5
5
  import { M as A } from "./mc-tooltip-BNmrE7e_.js";
6
- import { F as C } from "./mc-form-DkWNoAUZ.js";
6
+ import { F as C } from "./mc-form-DHiUJW30.js";
7
7
  const D = Symbol("mc-form-item-context"), E = "mc-form-item", G = { class: "mc-form-item-label-wrapper" }, H = { key: 0, class: "mc-form-item-label" }, J = { key: 0, class: "mc-form-item-help" }, K = { key: 0, class: "mc-form-item-desc" }, L = { class: "mc-form-item__content" }, N = { key: 0, class: "mc-form-item__error" }, O = r(e(t({ name: E, __name: "mc-form-item", props: { prop: { default: "" }, label: {}, disabled: { type: Boolean, default: false }, required: { type: Boolean, default: false }, rules: {}, help: {}, desc: {} }, setup(e2, { expose: r2 }) {
8
8
  const t2 = e2, E2 = l(C, void 0), O2 = o("init"), Q = o(""), R = (e3) => e3 && t2.prop && !$(S(e3, t2.prop)) ? S(e3, t2.prop) : null, T = s(() => {
9
9
  const e3 = E2 == null ? void 0 : E2.model;
@@ -1,12 +1,12 @@
1
1
  import { _ as e, u as t } from "./utils-y7s5KtP-.js";
2
- import { ref as a, defineComponent as l, computed as n, onMounted as u, watch as o, createElementBlock as s, openBlock as r, normalizeStyle as i, normalizeClass as c, unref as p, createCommentVNode as d, createElementVNode as f, renderSlot as m, createBlock as v, withKeys as y, createVNode as g, Fragment as x, nextTick as h } from "vue";
2
+ import { ref as a, defineComponent as l, computed as u, onMounted as n, watch as o, createElementBlock as s, openBlock as r, normalizeStyle as i, normalizeClass as c, unref as p, createCommentVNode as d, createElementVNode as f, renderSlot as m, createBlock as v, withKeys as y, createVNode as x, Fragment as g, nextTick as h } from "vue";
3
3
  import { includes as b, endsWith as _, startsWith as w, toString as I, isNil as k, isFunction as $ } from "lodash-es";
4
4
  import { useFocus as V, useHover as B } from "@mc-plus/hooks";
5
5
  import { M as S } from "./mc-icon-CmYW61Q0.js";
6
- import { u as A } from "./mc-form-DkWNoAUZ.js";
7
- import { u as C } from "./mc-input-group-ibNkzqnG.js";
6
+ import { u as C } from "./mc-form-DHiUJW30.js";
7
+ import { u as A } from "./mc-input-group-Bm5RSk_9.js";
8
8
  const R = "mc-input", j = { key: 0, class: "mc-input__prefix" }, z = ["id", "type", "disabled", "readonly", "autocomplete", "placeholder", "autofocus", "maxlength"], F = { key: 2, class: "mc-input__password" }, T = { key: 0, class: "mc-input__suffix" }, D = { key: 4, class: "mc-input-append" }, H = { class: "mc-input-append-text" }, P = t(e(l({ name: R, __name: "mc-input", props: { modelValue: {}, width: {}, height: {}, id: {}, type: { default: "text" }, disabled: { type: Boolean, default: false }, clearable: { type: Boolean, default: false }, placeholder: { default: "Please enter" }, readonly: { type: Boolean, default: false }, autocomplete: { default: "off" }, autofocus: { type: Boolean, default: false }, prefixIcon: {}, suffixIcon: {}, maxlength: {}, currencyAccuracy: {}, inputGroupPosition: {}, disableValidation: { type: Boolean, default: false }, hideValidationIcon: { type: Boolean, default: false }, textAlign: { default: "left" }, formatter: {}, parser: {} }, emits: ["update:modelValue", "input", "change", "focus", "blur", "paste", "clear", "delete"], setup(e2, { expose: t2, emit: l2 }) {
9
- const R2 = e2, { formatter: P2, parser: E } = R2, G = l2, M = a(), q = n(() => k(R2.modelValue) ? "" : I(R2.modelValue)), K = (e3) => ("number" === R2.type ? e3 = ((e4) => e4.replace(/[^\d]/g, ""))(e3) : "currency" === R2.type && (e3 = ((e4, t3 = 8) => {
9
+ const R2 = e2, { formatter: P2, parser: E } = R2, G = l2, M = a(), q = u(() => k(R2.modelValue) ? "" : I(R2.modelValue)), K = (e3) => ("number" === R2.type ? e3 = ((e4) => e4.replace(/[^\d]/g, ""))(e3) : "currency" === R2.type && (e3 = ((e4, t3 = 8) => {
10
10
  e4 = e4.replace(/(?:[^0-9.]+)/g, "");
11
11
  const [a2, ...l3] = e4.split(".");
12
12
  if (l3.length) {
@@ -23,14 +23,18 @@ const R = "mc-input", j = { key: 0, class: "mc-input__prefix" }, z = ["id", "typ
23
23
  var a2;
24
24
  e3 && e3.value !== t3 && (e3.value = t3);
25
25
  };
26
- u(() => {
26
+ n(() => {
27
27
  O();
28
28
  });
29
- const J = a(false), L = n(() => "password" === R2.type), { formItem: N, formId: Q, formDisabled: U, validateStyle: W, statusIcon: X } = A({ externalDisabled: n(() => !!(le == null ? void 0 : le.inputGroupDisabled.value)) }), { wrapperRef: Y, isFocused: Z, handleFocus: ee, handleBlur: te } = V(M, { afterBlur() {
30
- N == null ? void 0 : N.validate("blur");
31
- } }), { isHovering: ae } = B(Y), le = C({ validateStatus: n(() => (N == null ? void 0 : N.validateStatus) || "init"), isFocused: Z, isHovering: ae }), ne = () => {
29
+ const J = a(false), L = u(() => "password" === R2.type), { formItemCtx: N, formId: Q, formDisabled: U, validateStyle: W, statusIcon: X } = C({ externalDisabled: u(() => !!(le == null ? void 0 : le.inputGroupDisabled.value)) }), { wrapperRef: Y, isFocused: Z, handleFocus: ee, handleBlur: te } = V(M, { afterBlur() {
30
+ var _a;
31
+ (_a = N.value) == null ? void 0 : _a.validate("blur");
32
+ } }), { isHovering: ae } = B(Y), le = A({ validateStatus: u(() => {
33
+ var _a;
34
+ return ((_a = N.value) == null ? void 0 : _a.validateStatus) || "init";
35
+ }), isFocused: Z, isHovering: ae }), ue = () => {
32
36
  G("delete");
33
- }, ue = (e3) => {
37
+ }, ne = (e3) => {
34
38
  G("paste", e3);
35
39
  };
36
40
  o(() => R2.currencyAccuracy, () => {
@@ -40,26 +44,27 @@ const R = "mc-input", j = { key: 0, class: "mc-input__prefix" }, z = ["id", "typ
40
44
  const t3 = a();
41
45
  return { recordCursor: () => {
42
46
  if (!e3.value) return;
43
- const { selectionStart: a2, selectionEnd: l3, value: n2 } = e3.value;
47
+ const { selectionStart: a2, selectionEnd: l3, value: u2 } = e3.value;
44
48
  if (!a2 || !l3) return;
45
- const u2 = n2.slice(0, a2), o2 = n2.slice(l3);
46
- t3.value = { selectionStart: a2, selectionEnd: l3, value: n2, beforeTxt: u2, afterTxt: o2 };
49
+ const n2 = u2.slice(0, a2), o2 = u2.slice(l3);
50
+ t3.value = { selectionStart: a2, selectionEnd: l3, value: u2, beforeTxt: n2, afterTxt: o2 };
47
51
  }, setCursor: () => {
48
52
  if (!e3.value || !t3.value) return;
49
- const { value: a2 } = e3.value, { beforeTxt: l3, afterTxt: n2, selectionStart: u2 } = t3.value;
50
- if (!l3 || !n2 || !u2) return;
53
+ const { value: a2 } = e3.value, { beforeTxt: l3, afterTxt: u2, selectionStart: n2 } = t3.value;
54
+ if (!l3 || !u2 || !n2) return;
51
55
  let o2 = a2.length;
52
- if (_(a2, n2)) o2 = a2.length - n2.length;
56
+ if (_(a2, u2)) o2 = a2.length - u2.length;
53
57
  else if (w(a2, l3)) o2 = l3.length;
54
58
  else {
55
- const e4 = l3[u2 - 1], t4 = a2.indexOf(e4, u2 - 1);
59
+ const e4 = l3[n2 - 1], t4 = a2.indexOf(e4, n2 - 1);
56
60
  -1 !== t4 && (o2 = t4 + 1);
57
61
  }
58
62
  e3.value.setSelectionRange(o2, o2);
59
63
  } };
60
64
  }(M), re = async (e3) => {
65
+ var _a;
61
66
  const { value: t3 } = e3.target;
62
- oe(), G("update:modelValue", K(t3)), G("input", K(t3)), await h(), O(), se(), N == null ? void 0 : N.validate("input");
67
+ oe(), G("update:modelValue", K(t3)), G("input", K(t3)), await h(), O(), se(), (_a = N.value) == null ? void 0 : _a.validate("input");
63
68
  }, ie = (e3) => {
64
69
  const { value: t3 } = e3.target;
65
70
  G("change", K(t3));
@@ -80,9 +85,10 @@ const R = "mc-input", j = { key: 0, class: "mc-input__prefix" }, z = ["id", "typ
80
85
  var _a;
81
86
  (_a = M.value) == null ? void 0 : _a.select();
82
87
  }, clear: () => {
83
- G("update:modelValue", ""), G("input", ""), G("change", ""), G("clear"), N == null ? void 0 : N.clearValidate();
84
- } }), (t3, a2) => (r(), s("div", { class: c(["mc-input", { "mc-input--disabled": p(U), "mc-input--focused": p(Z), "mc-input--inputed": e2.modelValue, "mc-input-hovering": p(ae), [p(W)]: p(W) }]), style: i({ width: e2.width, height: e2.height }), ref_key: "wrapperRef", ref: Y }, [t3.$slots.prefix || e2.prefixIcon ? (r(), s("div", j, [m(t3.$slots, "prefix", {}, () => [e2.prefixIcon ? (r(), v(p(S), { key: 0, class: "mc-input-icon", name: e2.prefixIcon, size: 24 }, null, 8, ["name"])) : d("", true)], true)])) : d("", true), f("input", { class: "mc-input__inner", style: i({ textAlign: e2.textAlign }), ref_key: "inputRef", ref: M, id: p(Q), type: L.value ? J.value ? "text" : "password" : "text", disabled: p(U), readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, maxlength: e2.maxlength, onInput: re, onChange: ie, onFocus: a2[0] || (a2[0] = (...e3) => p(ee) && p(ee)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => p(te) && p(te)(...e3)), onKeydown: y(ne, ["delete"]), onPaste: ue }, null, 44, z), p(X) ? (r(), s("div", { key: 1, class: c(["mc-input__status", p(W)]) }, [g(p(S), { name: p(X), size: 24 }, null, 8, ["name"])], 2)) : d("", true), "password" === e2.type ? (r(), s("div", F, [g(p(S), { class: "mc-input-icon", name: J.value ? "Review-Hidden" : "Review", size: 24, onClick: ce }, null, 8, ["name"])])) : (r(), s(x, { key: 3 }, [t3.$slots.suffix || e2.suffixIcon ? (r(), s("div", T, [m(t3.$slots, "suffix", {}, () => [e2.suffixIcon ? (r(), v(p(S), { key: 0, name: e2.suffixIcon, size: 24 }, null, 8, ["name"])) : d("", true)], true)])) : d("", true)], 64)), t3.$slots.append ? (r(), s("div", D, [f("div", H, [m(t3.$slots, "append", {}, void 0, true)])])) : d("", true)], 6));
85
- } }), [["__scopeId", "data-v-40550eb9"]]));
88
+ var _a;
89
+ G("update:modelValue", ""), G("input", ""), G("change", ""), G("clear"), (_a = N.value) == null ? void 0 : _a.clearValidate();
90
+ } }), (t3, a2) => (r(), s("div", { class: c(["mc-input", { "mc-input--disabled": p(U), "mc-input--focused": p(Z), "mc-input--inputed": e2.modelValue, "mc-input-hovering": p(ae), [p(W)]: p(W) }]), style: i({ width: e2.width, height: e2.height }), ref_key: "wrapperRef", ref: Y }, [t3.$slots.prefix || e2.prefixIcon ? (r(), s("div", j, [m(t3.$slots, "prefix", {}, () => [e2.prefixIcon ? (r(), v(p(S), { key: 0, class: "mc-input-icon", name: e2.prefixIcon, size: 24 }, null, 8, ["name"])) : d("", true)], true)])) : d("", true), f("input", { class: "mc-input__inner", style: i({ textAlign: e2.textAlign }), ref_key: "inputRef", ref: M, id: p(Q), type: L.value ? J.value ? "text" : "password" : "text", disabled: p(U), readonly: e2.readonly, autocomplete: e2.autocomplete, placeholder: e2.placeholder, autofocus: e2.autofocus, maxlength: e2.maxlength, onInput: re, onChange: ie, onFocus: a2[0] || (a2[0] = (...e3) => p(ee) && p(ee)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => p(te) && p(te)(...e3)), onKeydown: y(ue, ["delete"]), onPaste: ne }, null, 44, z), p(X) ? (r(), s("div", { key: 1, class: c(["mc-input__status", p(W)]) }, [x(p(S), { name: p(X), size: 24 }, null, 8, ["name"])], 2)) : d("", true), "password" === e2.type ? (r(), s("div", F, [x(p(S), { class: "mc-input-icon", name: J.value ? "Review-Hidden" : "Review", size: 24, onClick: ce }, null, 8, ["name"])])) : (r(), s(g, { key: 3 }, [t3.$slots.suffix || e2.suffixIcon ? (r(), s("div", T, [m(t3.$slots, "suffix", {}, () => [e2.suffixIcon ? (r(), v(p(S), { key: 0, name: e2.suffixIcon, size: 24 }, null, 8, ["name"])) : d("", true)], true)])) : d("", true)], 64)), t3.$slots.append ? (r(), s("div", D, [f("div", H, [m(t3.$slots, "append", {}, void 0, true)])])) : d("", true)], 6));
91
+ } }), [["__scopeId", "data-v-cbd89afb"]]));
86
92
  export {
87
93
  P as M,
88
94
  R as a
@@ -1,7 +1,7 @@
1
1
  import { ref as e, computed as u, inject as t, watch as i, defineComponent as p, provide as r, createElementBlock as s, openBlock as o, normalizeClass as a, unref as d, createElementVNode as n, createCommentVNode as l, normalizeStyle as f, renderSlot as c } from "vue";
2
2
  import { useProp as v } from "@mc-plus/hooks";
3
3
  import { _ as x, u as m } from "./utils-y7s5KtP-.js";
4
- import { a as I } from "./mc-form-DkWNoAUZ.js";
4
+ import { a as I } from "./mc-form-DHiUJW30.js";
5
5
  const g = Symbol("mc-input-group-context"), G = "mc-input-group", A = (e2) => {
6
6
  const p2 = t(g, void 0);
7
7
  if (!p2) return;
@@ -0,0 +1,74 @@
1
+ import { _ as e, u as t } from "./utils-y7s5KtP-.js";
2
+ import { ref as o, nextTick as l, defineComponent as a, reactive as n, computed as s, onMounted as u, watch as c, watchEffect as r, createElementBlock as i, openBlock as p, normalizeClass as m, unref as d, createElementVNode as v, createBlock as f, createCommentVNode as h, Fragment as g, renderList as y, withDirectives as b, withModifiers as V, withKeys as x, vModelText as I } from "vue";
3
+ import { isNil as w, isEmpty as F } from "lodash-es";
4
+ import { M as k } from "./mc-icon-CmYW61Q0.js";
5
+ import { useClickOutside as _, useProp as j } from "@mc-plus/hooks";
6
+ import { u as D } from "./mc-form-DHiUJW30.js";
7
+ const C = "mc-otp", M = ["id"], K = { class: "mc-otp-input-list" }, U = ["onClick"], z = ["onUpdate:modelValue", "disabled", "onInput", "onKeydown"], A = t(e(a({ name: C, __name: "mc-otp", props: { modelValue: {}, disabled: { type: Boolean, default: false }, length: { default: 6 } }, emits: ["update:modelValue", "change"], setup(e2, { emit: t2 }) {
8
+ const a2 = e2, C2 = t2, A2 = o([]), B = n(new Array(a2.length)), { focusIndex: E, setFocus: P, nextFocus: S, prevFocus: q } = ((e3) => {
9
+ const t3 = o(), a3 = (e4) => {
10
+ t3.value = e4;
11
+ };
12
+ _(e3, () => {
13
+ var _a;
14
+ w(t3.value) || ((_a = H.value) == null ? void 0 : _a.validate("blur")), a3(void 0);
15
+ });
16
+ const n2 = j("length"), s2 = (o2) => {
17
+ var _a;
18
+ const l2 = n2.value ?? 0;
19
+ o2 < 0 && (o2 = 0), o2 > l2 - 1 && (o2 = l2 - 1), t3.value = o2;
20
+ const a4 = e3.value[o2], s3 = (_a = a4 == null ? void 0 : a4.children) == null ? void 0 : _a[0];
21
+ s3 == null ? void 0 : s3.focus();
22
+ }, u2 = j("modelValue");
23
+ return { focusIndex: t3, setFocusIndex: a3, setFocus: s2, nextFocus: () => {
24
+ l(() => {
25
+ var _a;
26
+ const e4 = ((_a = u2.value) == null ? void 0 : _a.length) ?? 0;
27
+ e4 < (n2.value ?? 0) && s2(e4);
28
+ });
29
+ }, prevFocus: () => {
30
+ l(() => {
31
+ var _a;
32
+ const e4 = ((_a = u2.value) == null ? void 0 : _a.length) ?? 0;
33
+ e4 - 1 >= 0 && s2(e4 - 1);
34
+ });
35
+ } };
36
+ })(A2), { formId: G, formItemCtx: H, formDisabled: J, validateStyle: L, statusIcon: N } = D({ externalDisabled: s(() => a2.disabled) }), O = (e3) => {
37
+ for (let t3 = 0; t3 < a2.length; t3++) B[t3] = (e3 == null ? void 0 : e3[t3]) || "";
38
+ };
39
+ u(() => {
40
+ O(a2.modelValue);
41
+ }), c(() => a2.modelValue, (e3) => {
42
+ O(e3);
43
+ });
44
+ const Q = async () => {
45
+ var _a;
46
+ C2("change", B.join("")), C2("update:modelValue", B.join("")), await l(), (_a = H.value) == null ? void 0 : _a.validate("input");
47
+ };
48
+ return r(() => {
49
+ var _a;
50
+ if ((((_a = a2.modelValue) == null ? void 0 : _a.length) ?? 0) > a2.length) throw new Error("modelValue length is greater than length.");
51
+ }), (e3, t3) => (p(), i("div", { id: d(G), class: m(["mc-otp", { "mc-otp-disabled": d(J), [d(L)]: d(L) }]) }, [v("ul", K, [(p(true), i(g, null, y(a2.length, (e4) => (p(), i("li", { key: e4, class: m(["mc-otp-input-item", { "mc-otp-input-item-focus": d(E) === e4 - 1 }]), ref_for: true, ref: (t4) => ((e5, t5) => {
52
+ t5 && (A2.value[e5] = t5);
53
+ })(e4 - 1, t4), onClick: (t4) => (async (e5) => {
54
+ F(B[e5]) ? S() : P(e5);
55
+ })(e4 - 1) }, [b(v("input", { "onUpdate:modelValue": (t4) => B[e4 - 1] = t4, class: "mc-otp-input", type: "number", disabled: d(J), onInput: (t4) => (async (e5, t5) => {
56
+ if (J.value) return;
57
+ const o2 = t5.target;
58
+ let l2 = o2.value.slice(0, 1);
59
+ o2.value = l2, B[e5] = l2, Q(), l2 && S();
60
+ })(e4 - 1, t4), onPaste: t3[0] || (t3[0] = (e5) => (async (e6) => {
61
+ var _a;
62
+ if (e6.preventDefault(), J.value) return;
63
+ const t4 = ((_a = e6.clipboardData) == null ? void 0 : _a.getData("text").slice(0, a2.length)) || "";
64
+ O(t4), Q(), S();
65
+ })(e5)), onKeydown: [x(V((t4) => (async (e5) => {
66
+ B[e5] = "", Q(), q();
67
+ })(e4 - 1), ["prevent", "stop"]), ["backspace"]), x(V((t4) => d(P)(e4 - 2), ["prevent", "stop"]), ["left"]), x(V((t4) => d(P)(e4), ["prevent", "stop"]), ["right"]), t3[2] || (t3[2] = x(V(() => {
68
+ }, ["prevent", "stop"]), ["tab"]))], onMousedown: t3[1] || (t3[1] = V(() => {
69
+ }, ["prevent"])) }, null, 40, z), [[I, B[e4 - 1]]])], 10, U))), 128))]), d(N) ? (p(), f(d(k), { key: 0, class: "mc-otp-status-icon", name: d(N), size: 24 }, null, 8, ["name"])) : h("", true)], 10, M));
70
+ } }), [["__scopeId", "data-v-548c5095"]]));
71
+ export {
72
+ A as M,
73
+ C as a
74
+ };
@@ -0,0 +1,23 @@
1
+ import { _ as e, u as a } from "./utils-y7s5KtP-.js";
2
+ import { defineComponent as r, inject as l, ref as o, computed as s, createElementBlock as i, openBlock as t, normalizeClass as c, createElementVNode as d, withModifiers as m, unref as p, withKeys as n, createCommentVNode as u, renderSlot as v, createTextVNode as f, toDisplayString as b, createVNode as h, nextTick as k } from "vue";
3
+ import { useFocus as y } from "@mc-plus/hooks";
4
+ import { M as _ } from "./mc-tooltip-BNmrE7e_.js";
5
+ import { M as j } from "./mc-radio-group-BRgNGg1o.js";
6
+ import { u as w } from "./mc-form-DHiUJW30.js";
7
+ const B = "mc-radio", $ = ["disabled", "onKeypress"], x = { class: "mc-radio-wrapper" }, D = { class: "mc-radio-content" }, F = { key: 0, class: "mc-radio-help" }, M = { class: "mc-radio-remark" }, R = a(e(r({ name: B, __name: "mc-radio", props: { label: {}, value: { type: [Number, String, Boolean] }, disabled: { type: Boolean }, remark: {}, help: {} }, emits: ["focus", "blur"], setup(e2) {
8
+ const a2 = e2, r2 = l(j, void 0), B2 = o(), { wrapperRef: R2, isFocused: S, handleFocus: g, handleBlur: C } = y(B2), I = s(() => {
9
+ var _a;
10
+ return ((_a = r2 == null ? void 0 : r2.modelValue) == null ? void 0 : _a.value) === a2.value;
11
+ }), { formItemCtx: K, formDisabled: z, validateStyle: N } = w({ externalDisabled: s(() => {
12
+ var _a;
13
+ return !!((_a = r2 == null ? void 0 : r2.disabled) == null ? void 0 : _a.value);
14
+ }) }), V = async () => {
15
+ var _a;
16
+ z.value || (r2 == null ? void 0 : r2.handleSelect(a2.value), await k(), (_a = K.value) == null ? void 0 : _a.validate("input"));
17
+ };
18
+ return (a3, r3) => (t(), i("div", { ref_key: "wrapperRef", ref: R2, class: c(["mc-radio", { "mc-radio-has-remark": !!e2.remark }]) }, [d("label", { class: c(["mc-radio-label", { "mc-radio-checked": I.value, "mc-radio-disabled": p(z), "mc-radio-focused": p(S), [p(N)]: p(N) }]), onClick: m(V, ["prevent"]) }, [d("input", { ref_key: "inputRef", ref: B2, type: "radio", class: "mc-radio-input", disabled: p(z), onFocus: r3[0] || (r3[0] = (...e3) => p(g) && p(g)(...e3)), onBlur: r3[1] || (r3[1] = (...e3) => p(C) && p(C)(...e3)), onKeypress: n(m(V, ["prevent", "stop"]), ["enter"]) }, null, 40, $), d("div", x, [r3[2] || (r3[2] = d("span", { class: "mc-radio-circle" }, null, -1)), d("div", D, [v(a3.$slots, "default", {}, () => [f(b(e2.label), 1)], true)]), e2.help || a3.$slots.help ? (t(), i("div", F, [v(a3.$slots, "help", {}, () => [h(p(_), { content: e2.help, "icon-size": 24 }, null, 8, ["content"])], true)])) : u("", true)])], 2), d("div", M, [v(a3.$slots, "remark", {}, () => [f(b(e2.remark), 1)], true)])], 2));
19
+ } }), [["__scopeId", "data-v-4019ac26"]]));
20
+ export {
21
+ R as M,
22
+ B as a
23
+ };
@@ -1,6 +1,6 @@
1
1
  import { _ as e, u as o } from "./utils-y7s5KtP-.js";
2
2
  import { defineComponent as a, provide as d, computed as m, createElementBlock as l, openBlock as r, unref as t, renderSlot as s } from "vue";
3
- import { u as i } from "./mc-form-DkWNoAUZ.js";
3
+ import { u as i } from "./mc-form-DHiUJW30.js";
4
4
  const u = Symbol("mc-radio-group-context"), p = "mc-radio-group", c = ["id"], n = o(e(a({ name: p, __name: "mc-radio-group", props: { modelValue: { type: [Number, String, Boolean] }, disabled: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: o2 }) {
5
5
  const a2 = e2, p2 = o2, { formId: n2 } = i();
6
6
  return d(u, { modelValue: m(() => a2.modelValue), disabled: m(() => a2.disabled), handleSelect: (e3) => {
@@ -3,11 +3,11 @@ import { useEditor as f, EditorContent as h } from "@tiptap/vue-3";
3
3
  import { useWidthHeight as A } from "@mc-plus/hooks";
4
4
  import g from "@tiptap/starter-kit";
5
5
  import x from "@tiptap/extension-image";
6
- import { M } from "./mc-select-plus-D8g9xcTv.js";
7
- import { M as O } from "./mc-select-option-plus-Cc3PofO7.js";
6
+ import { M } from "./mc-select-plus-CAmogpfF.js";
7
+ import { M as O } from "./mc-select-option-plus-5glbaxM8.js";
8
8
  import { a as T, M as k } from "./mc-icon-plus-BFYVRrKw.js";
9
9
  import { M as I } from "./mc-tooltip-BNmrE7e_.js";
10
- import { M as R } from "./mc-input-C3tEJiVq.js";
10
+ import { M as R } from "./mc-input-DHG9UpMy.js";
11
11
  import { M as _ } from "./mc-button-Bg4Yihn7.js";
12
12
  import { _ as b, u as N } from "./utils-y7s5KtP-.js";
13
13
  import { Mark as E } from "@tiptap/core";