mc-plus 1.0.66 → 1.0.67
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/dist/es/index.js +46 -46
- package/dist/es/{mc-alert-message-D5xabGCX.js → mc-alert-message-DwgLFtPe.js} +5 -5
- package/dist/es/{mc-button-B-2mob1r.js → mc-button-B1kM6MYx.js} +5 -5
- package/dist/es/{mc-checkbox-iP5RHA6x.js → mc-checkbox-BWoyMnoA.js} +22 -22
- package/dist/es/{mc-collapse-C2oWrpLp.js → mc-collapse-BL5o15vK.js} +3 -3
- package/dist/es/{mc-copy-Baim9vBo.js → mc-copy-D4859gtF.js} +6 -6
- package/dist/es/{mc-count-BqyWuWKT.js → mc-count-CdBygnvR.js} +4 -4
- package/dist/es/mc-currency-icon-xnrW9wod.js +10 -0
- package/dist/es/mc-divider-Cw1ISWty.js +7 -0
- package/dist/es/mc-drawer-D2NftdN1.js +28 -0
- package/dist/es/mc-footer-C7-SDeDK.js +10 -0
- package/dist/es/{mc-form-Bf0120BQ.js → mc-form-CfApB10d.js} +14 -14
- package/dist/es/mc-icon-C6rCR5VX.js +20 -0
- package/dist/es/{mc-input-C5MU4U2V.js → mc-input-Bp8XYQh8.js} +52 -52
- package/dist/es/{mc-lightbox-8zpx4nrJ.js → mc-lightbox-dHFB7w2f.js} +12 -12
- package/dist/es/mc-loading-fglQjQA5.js +11 -0
- package/dist/es/mc-modal-header-BxfKCG2W.js +12 -0
- package/dist/es/{mc-otp-BE08aHEv.js → mc-otp-CjMj1gcB.js} +12 -12
- package/dist/es/mc-overlay-CdYepe9d.js +11 -0
- package/dist/es/{mc-popper-B8qMu2va.js → mc-popper-B3uS-9Xe.js} +12 -12
- package/dist/es/mc-progress-bar-DxbHOkya.js +29 -0
- package/dist/es/mc-radio-DTTX4iB4.js +26 -0
- package/dist/es/mc-reset-Bs-GPOyA.js +13 -0
- package/dist/es/{mc-secondary-menu-2eW8se9v.js → mc-secondary-menu-D7JAP8G_.js} +7 -7
- package/dist/es/{mc-select-BMYoc5oT.js → mc-select-UXUYAH93.js} +65 -65
- package/dist/es/mc-status-C_kdjImi.js +7 -0
- package/dist/es/{mc-step-DKfRXGSk.js → mc-step-DNJ1Pwse.js} +35 -35
- package/dist/es/mc-success-icon-F1vPHt2W.js +7 -0
- package/dist/es/mc-switch-FUBHNx8q.js +14 -0
- package/dist/es/{mc-tab-D_pxBB3w.js → mc-tab-2FN_eMen.js} +51 -51
- package/dist/es/{mc-tag-jYhZ-J2S.js → mc-tag-2QfPxVDW.js} +5 -5
- package/dist/es/mc-textarea-C2tV5hyv.js +17 -0
- package/dist/es/mc-title-DG7E3cnZ.js +22 -0
- package/dist/es/{mc-toast-DB9Y1bvS.js → mc-toast-DJc_MSTA.js} +14 -14
- package/dist/es/mc-tooltip-BeK9T6ZC.js +12 -0
- package/dist/es/{mc-upload-Cl3mW0Hm.js → mc-upload-BUe3Nr_q.js} +34 -34
- package/dist/es/theme/mc-alert-message.css +1 -1
- package/dist/es/theme/mc-button.css +1 -1
- package/dist/es/theme/mc-checkbox.css +1 -1
- package/dist/es/theme/mc-copy.css +1 -1
- package/dist/es/theme/mc-count.css +1 -1
- package/dist/es/theme/mc-currency-icon.css +1 -1
- package/dist/es/theme/mc-divider.css +1 -1
- package/dist/es/theme/mc-drawer.css +1 -1
- package/dist/es/theme/mc-footer.css +1 -1
- package/dist/es/theme/mc-form.css +1 -1
- package/dist/es/theme/mc-icon.css +1 -1
- package/dist/es/theme/mc-input.css +1 -1
- package/dist/es/theme/mc-lightbox.css +1 -1
- package/dist/es/theme/mc-loading.css +1 -1
- package/dist/es/theme/mc-modal-header.css +1 -1
- package/dist/es/theme/mc-otp.css +1 -1
- package/dist/es/theme/mc-overlay.css +1 -1
- package/dist/es/theme/mc-popper.css +1 -1
- package/dist/es/theme/mc-progress-bar.css +1 -1
- package/dist/es/theme/mc-radio.css +1 -1
- package/dist/es/theme/mc-reset.css +1 -1
- package/dist/es/theme/mc-secondary-menu.css +1 -1
- package/dist/es/theme/mc-select.css +1 -1
- package/dist/es/theme/mc-status.css +1 -1
- package/dist/es/theme/mc-step.css +1 -1
- package/dist/es/theme/mc-success-icon.css +1 -1
- package/dist/es/theme/mc-switch.css +1 -1
- package/dist/es/theme/mc-tab.css +1 -1
- package/dist/es/theme/mc-tag.css +1 -1
- package/dist/es/theme/mc-textarea.css +1 -1
- package/dist/es/theme/mc-title.css +1 -1
- package/dist/es/theme/mc-toast.css +1 -1
- package/dist/es/theme/mc-tooltip.css +1 -1
- package/dist/es/theme/mc-upload.css +1 -1
- package/dist/es/utils-DhYrNPrr.js +35 -0
- package/dist/es/{vendor-CExPGg1i.js → vendor-CfcDHsSD.js} +167 -175
- package/dist/index.css +1 -1
- package/dist/types/components/mc-input/index.d.ts +3 -3
- package/dist/types/components/mc-select-plus/index.d.ts +3 -3
- package/dist/types/components/mc-table/index.d.ts +62 -11
- package/dist/types/components/mc-table-plus/hooks/useTableCell.d.ts +1 -1
- package/dist/types/components/mc-textarea/index.d.ts +3 -3
- package/dist/types/components/mc-upload/index.d.ts +57 -11
- package/dist/types/hooks/index.d.ts +12 -12
- package/dist/types/hooks/src/useClickOutside.d.ts +3 -0
- package/dist/types/hooks/src/useEventListener.d.ts +3 -0
- package/dist/types/hooks/{useFocus.d.ts → src/useFocus.d.ts} +2 -2
- package/dist/types/hooks/{useHover.d.ts → src/useHover.d.ts} +1 -1
- package/dist/types/hooks/{useResizeObserver.d.ts → src/useResizeObserver.d.ts} +1 -1
- package/dist/types/hooks/src/useWindowResize.d.ts +2 -0
- package/dist/types/hooks/vite.config.d.ts +2 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +4 -4
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +60 -56
- package/dist/es/hooks-DghKpOue.js +0 -125
- package/dist/es/mc-currency-icon-Do56_Rk9.js +0 -10
- package/dist/es/mc-divider-BSXy8GNr.js +0 -7
- package/dist/es/mc-drawer-CeCN5c5X.js +0 -28
- package/dist/es/mc-footer-DjlFAv9f.js +0 -10
- package/dist/es/mc-icon-B_dAlj4r.js +0 -20
- package/dist/es/mc-loading-C311OVMI.js +0 -11
- package/dist/es/mc-modal-header-CMNRK0Rb.js +0 -12
- package/dist/es/mc-overlay-BHxTmf2H.js +0 -11
- package/dist/es/mc-progress-bar-JF0Frass.js +0 -29
- package/dist/es/mc-radio-BPBdgFH4.js +0 -26
- package/dist/es/mc-reset-hnnz6SoG.js +0 -13
- package/dist/es/mc-status-Bbu0MyzD.js +0 -7
- package/dist/es/mc-success-icon-Cj-5Hgzy.js +0 -7
- package/dist/es/mc-switch-fuT3qt1P.js +0 -13
- package/dist/es/mc-textarea-DtsztsBR.js +0 -17
- package/dist/es/mc-title-C_lOz0mp.js +0 -22
- package/dist/es/mc-tooltip-4mxkVOGx.js +0 -12
- package/dist/es/utils-BDbMLK9w.js +0 -36
- package/dist/types/hooks/useClickOutside.d.ts +0 -2
- package/dist/types/hooks/useEventListener.d.ts +0 -2
- package/dist/types/hooks/useWindowResize.d.ts +0 -2
- /package/dist/types/hooks/{useCDNPath.d.ts → src/useCDNPath.d.ts} +0 -0
- /package/dist/types/hooks/{useDragover.d.ts → src/useDragover.d.ts} +0 -0
- /package/dist/types/hooks/{useId.d.ts → src/useId.d.ts} +0 -0
- /package/dist/types/hooks/{usePolling.d.ts → src/usePolling.d.ts} +0 -0
- /package/dist/types/hooks/{useProp.d.ts → src/useProp.d.ts} +0 -0
- /package/dist/types/hooks/{useWidthHeight.d.ts → src/useWidthHeight.d.ts} +0 -0
package/dist/es/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { p as s, m } from "./utils-
|
|
2
|
-
import { M as o } from "./mc-alert-message-
|
|
3
|
-
import { a as r } from "./mc-button-
|
|
4
|
-
import { a as c, b as p } from "./mc-checkbox-
|
|
5
|
-
import { M as i } from "./mc-collapse-
|
|
6
|
-
import { a } from "./mc-collapse-
|
|
7
|
-
import { M as j } from "./mc-copy-
|
|
8
|
-
import { M } from "./mc-count-
|
|
9
|
-
import { M as l } from "./mc-currency-icon-
|
|
10
|
-
import { a as b } from "./mc-divider-
|
|
11
|
-
import { M as n } from "./mc-drawer-
|
|
12
|
-
import { a as d } from "./mc-footer-
|
|
13
|
-
import { M as x, b as g } from "./mc-form-
|
|
14
|
-
import { b as h, c as y } from "./mc-icon-
|
|
15
|
-
import { M as w, a as k } from "./mc-input-
|
|
16
|
-
import { M as v } from "./mc-lightbox-
|
|
17
|
-
import { a as
|
|
18
|
-
import { M as
|
|
19
|
-
import { M as
|
|
20
|
-
import { a as
|
|
21
|
-
import { a as
|
|
22
|
-
import { M as
|
|
23
|
-
import { M as I } from "./mc-reset-
|
|
24
|
-
import { M as P } from "./mc-secondary-menu-
|
|
25
|
-
import { M as D, a as E, b as F, c as G, d as H, e as J, f as K } from "./mc-select-
|
|
26
|
-
import { M as L } from "./mc-status-
|
|
27
|
-
import { M as N, a as O, b as Q, c as R, d as U, e as V, f as W } from "./mc-step-
|
|
28
|
-
import { a as X } from "./mc-success-icon-
|
|
29
|
-
import { M as Y } from "./mc-switch-
|
|
30
|
-
import { M as Z, a as $, b as _, c as ss, d as ms } from "./mc-tab-
|
|
31
|
-
import { u, e, f } from "./mc-tab-
|
|
32
|
-
import { M as as } from "./mc-tag-
|
|
33
|
-
import { M as os } from "./mc-textarea-
|
|
34
|
-
import { M as rs, a as ts } from "./mc-title-
|
|
35
|
-
import { M as cs } from "./mc-toast-
|
|
36
|
-
import { t } from "./mc-toast-
|
|
37
|
-
import { M as ps } from "./mc-tooltip-
|
|
38
|
-
import { M as is, a as fs, b as es } from "./mc-upload-
|
|
39
|
-
const js = [o, r, c, p, i, j, M, l, b, n, is, d, x, g, h, y, w, k, v,
|
|
1
|
+
import { p as s, m } from "./utils-DhYrNPrr.js";
|
|
2
|
+
import { M as o } from "./mc-alert-message-DwgLFtPe.js";
|
|
3
|
+
import { a as r } from "./mc-button-B1kM6MYx.js";
|
|
4
|
+
import { a as c, b as p } from "./mc-checkbox-BWoyMnoA.js";
|
|
5
|
+
import { M as i } from "./mc-collapse-BL5o15vK.js";
|
|
6
|
+
import { a } from "./mc-collapse-BL5o15vK.js";
|
|
7
|
+
import { M as j } from "./mc-copy-D4859gtF.js";
|
|
8
|
+
import { M } from "./mc-count-CdBygnvR.js";
|
|
9
|
+
import { M as l } from "./mc-currency-icon-xnrW9wod.js";
|
|
10
|
+
import { a as b } from "./mc-divider-Cw1ISWty.js";
|
|
11
|
+
import { M as n } from "./mc-drawer-D2NftdN1.js";
|
|
12
|
+
import { a as d } from "./mc-footer-C7-SDeDK.js";
|
|
13
|
+
import { M as x, b as g } from "./mc-form-CfApB10d.js";
|
|
14
|
+
import { b as h, c as y } from "./mc-icon-C6rCR5VX.js";
|
|
15
|
+
import { M as w, a as k } from "./mc-input-Bp8XYQh8.js";
|
|
16
|
+
import { M as v } from "./mc-lightbox-dHFB7w2f.js";
|
|
17
|
+
import { a as z } from "./mc-loading-fglQjQA5.js";
|
|
18
|
+
import { M as S } from "./mc-modal-header-BxfKCG2W.js";
|
|
19
|
+
import { M as T } from "./mc-otp-CjMj1gcB.js";
|
|
20
|
+
import { a as q } from "./mc-popper-B3uS-9Xe.js";
|
|
21
|
+
import { a as A } from "./mc-progress-bar-DxbHOkya.js";
|
|
22
|
+
import { M as B, a as C } from "./mc-radio-DTTX4iB4.js";
|
|
23
|
+
import { M as I } from "./mc-reset-Bs-GPOyA.js";
|
|
24
|
+
import { M as P } from "./mc-secondary-menu-D7JAP8G_.js";
|
|
25
|
+
import { M as D, a as E, b as F, c as G, d as H, e as J, f as K } from "./mc-select-UXUYAH93.js";
|
|
26
|
+
import { M as L } from "./mc-status-C_kdjImi.js";
|
|
27
|
+
import { M as N, a as O, b as Q, c as R, d as U, e as V, f as W } from "./mc-step-DNJ1Pwse.js";
|
|
28
|
+
import { a as X } from "./mc-success-icon-F1vPHt2W.js";
|
|
29
|
+
import { M as Y } from "./mc-switch-FUBHNx8q.js";
|
|
30
|
+
import { M as Z, a as $, b as _, c as ss, d as ms } from "./mc-tab-2FN_eMen.js";
|
|
31
|
+
import { u, e, f } from "./mc-tab-2FN_eMen.js";
|
|
32
|
+
import { M as as } from "./mc-tag-2QfPxVDW.js";
|
|
33
|
+
import { M as os } from "./mc-textarea-C2tV5hyv.js";
|
|
34
|
+
import { M as rs, a as ts } from "./mc-title-DG7E3cnZ.js";
|
|
35
|
+
import { M as cs } from "./mc-toast-DJc_MSTA.js";
|
|
36
|
+
import { t } from "./mc-toast-DJc_MSTA.js";
|
|
37
|
+
import { M as ps } from "./mc-tooltip-BeK9T6ZC.js";
|
|
38
|
+
import { M as is, a as fs, b as es } from "./mc-upload-BUe3Nr_q.js";
|
|
39
|
+
const js = [o, r, c, p, i, j, M, l, b, n, is, d, x, g, h, y, w, k, v, z, S, T, q, A, B, C, I, P, D, E, F, G, H, J, K, N, O, Q, R, U, V, W, L, X, Y, Z, $, as, _, ss, ms, os, rs, ts, cs, ps, fs, es];
|
|
40
40
|
s();
|
|
41
41
|
const Ms = m(js);
|
|
42
42
|
export {
|
|
@@ -60,13 +60,13 @@ export {
|
|
|
60
60
|
w as McInput,
|
|
61
61
|
k as McInputGroup,
|
|
62
62
|
v as McLightbox,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
z as McLoading,
|
|
64
|
+
S as McModalHeader,
|
|
65
|
+
T as McOtp,
|
|
66
|
+
q as McPopper,
|
|
67
|
+
A as McProgressBar,
|
|
68
|
+
B as McRadio,
|
|
69
|
+
C as McRadioGroup,
|
|
70
70
|
I as McReset,
|
|
71
71
|
P as McSecondaryMenu,
|
|
72
72
|
D as McSelect,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as e, ref as a, useSlots as s, computed as t, createElementBlock as l, openBlock as o, normalizeStyle as c, normalizeClass as n, createElementVNode as r, createCommentVNode as i, renderSlot as m, createVNode as d, createTextVNode as u, toDisplayString as p, createBlock as g, withModifiers as v, Transition as f, withCtx as y } from "vue";
|
|
2
|
-
import { M as h } from "./mc-icon-
|
|
3
|
-
import { _ as x, w as _ } from "./utils-
|
|
4
|
-
const
|
|
2
|
+
import { M as h } from "./mc-icon-C6rCR5VX.js";
|
|
3
|
+
import { _ as x, w as _ } from "./utils-DhYrNPrr.js";
|
|
4
|
+
const b = { class: "mc-alert-message-header" }, k = { class: "mc-alert-message-title-container" }, w = { key: 0, class: "mc-alert-message-icon-group" }, z = { class: "mc-alert-message-icon-wrapper" }, B = { class: "mc-alert-message-icon-wrapper" }, C = { key: 0, class: "mc-alert-message-body" }, I = _(x(e({ name: "McAlertMessage", __name: "mc-alert-message", props: { modelValue: { type: Boolean, default: true }, width: {}, height: {}, type: { default: "info" }, message: {}, content: {}, closable: { type: Boolean, default: false }, hideIcon: { type: Boolean, default: false }, expandable: { type: Boolean, default: false } }, emits: ["click", "close", "update:modelValue", "expand"], setup(e2, { expose: x2, emit: _2 }) {
|
|
5
5
|
const I2 = e2, M = _2, $ = a(), V = s(), j = t(() => I2.content || V.content), A = t(() => H.value || V.icon), E = a(false), D = t(() => !I2.expandable || E.value), H = t(() => {
|
|
6
6
|
if (!I2.hideIcon) switch (I2.type) {
|
|
7
7
|
case "success":
|
|
@@ -24,8 +24,8 @@ const k = { class: "mc-alert-message-header" }, b = { class: "mc-alert-message-t
|
|
|
24
24
|
E.value = true;
|
|
25
25
|
}, hide: () => {
|
|
26
26
|
E.value = false;
|
|
27
|
-
} }), (
|
|
28
|
-
} }), [["__scopeId", "data-v-
|
|
27
|
+
} }), (a2, s2) => (o(), l("div", { ref_key: "_ref", ref: $, class: n(["mc-alert-message", [`mc-alert-message-${e2.type}`]]), style: c({ width: e2.width, height: e2.height, cursor: e2.expandable ? "pointer" : "default" }), onClick: S }, [r("div", b, [r("div", k, [A.value ? (o(), l("div", { key: 0, class: "mc-alert-message-icon", style: c({ height: j.value ? "30px" : "24px" }) }, [m(a2.$slots, "icon", {}, () => [d(h, { name: H.value, size: 24 }, null, 8, ["name"])], true)], 4)) : i("", true), r("div", { class: "mc-alert-message-title", style: c({ fontSize: j.value ? "18px" : "16px", fontWeight: j.value ? "600" : "400", lineHeight: j.value ? "30px" : "24px" }) }, [m(a2.$slots, "default", {}, () => [u(p(e2.message), 1)], true)], 4)]), e2.closable || e2.expandable ? (o(), l("div", w, [r("div", z, [e2.expandable ? (o(), g(h, { key: 0, name: "Down-Chevron", size: 24, class: "mc-alert-message-tool-icon mc-alert-message-tool-icon-expand", style: c({ transform: D.value ? "rotate(180deg)" : "rotate(0deg)" }) }, null, 8, ["style"])) : i("", true)]), r("div", B, [e2.closable ? (o(), g(h, { key: 0, name: "Cross", size: 24, class: "mc-alert-message-tool-icon mc-alert-message-tool-icon-close", onClick: v(L, ["stop"]) })) : i("", true)])])) : i("", true)]), j.value ? (o(), l("div", C, [d(f, { name: "mc-alert-message-content-transition" }, { default: y(() => [D.value ? (o(), l("div", { key: 0, class: "mc-alert-message-content", style: c({ paddingLeft: A.value ? "48px" : "16px" }) }, [m(a2.$slots, "content", {}, () => [u(p(e2.content), 1)], true)], 4)) : i("", true)]), _: 3 })])) : i("", true)], 6));
|
|
28
|
+
} }), [["__scopeId", "data-v-b2a3a627"]]));
|
|
29
29
|
export {
|
|
30
30
|
I as M
|
|
31
31
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as e, toRefs as t, ref as o, useAttrs as a, computed as i, toValue as l, createElementBlock as n, openBlock as s, unref as d, normalizeClass as u, normalizeStyle as r, createBlock as c, createCommentVNode as m, createElementVNode as p, createVNode as v, renderSlot as f } from "vue";
|
|
2
|
-
import { M as y } from "./mc-icon-
|
|
3
|
-
import { t as h } from "./vendor-
|
|
4
|
-
import { _ as b, w as g } from "./utils-
|
|
2
|
+
import { M as y } from "./mc-icon-C6rCR5VX.js";
|
|
3
|
+
import { t as h } from "./vendor-CfcDHsSD.js";
|
|
4
|
+
import { _ as b, w as g } from "./utils-DhYrNPrr.js";
|
|
5
5
|
const k = ["type", "disabled"], I = { key: 1, class: "loading-icon" }, _ = { class: "mc-button-text" }, w = b(e({ name: "McButton", __name: "mc-button", props: { type: { default: "primary" }, nativeType: { default: "button" }, size: { default: "medium" }, disabled: { type: Boolean }, loading: { type: Boolean }, useThrottle: { type: Boolean, default: true }, throttleDuration: { default: 500 }, leftIcon: {}, rightIcon: {}, content: {}, height: {}, width: {} }, emits: ["click"], setup(e2, { expose: b2, emit: g2 }) {
|
|
6
6
|
const w2 = e2, { loading: z2, disabled: B, throttleDuration: T, height: j, width: x } = t(w2), M = g2, $ = o(), D = t(a()), C = i(() => ({ ...l(D).style, width: x.value ? x.value : void 0, height: j.value ? j.value : void 0 })), L = (e3) => {
|
|
7
7
|
z2.value || B.value || M("click", e3);
|
|
8
8
|
}, q = h(L, T.value, { trailing: false });
|
|
9
|
-
return b2({ ref: $ }), (
|
|
10
|
-
} }), [["__scopeId", "data-v-
|
|
9
|
+
return b2({ ref: $ }), (t2, o2) => (s(), n("button", { ref_key: "_ref", ref: $, style: r(C.value), class: u(["mc-button", { [`mc-button--${e2.type}`]: e2.type, [`mc-button--${e2.size}`]: e2.size, "is-loading": d(z2), "is-disabled": d(B) }]), type: e2.nativeType, disabled: !(!d(B) && !d(z2)) || void 0, onClick: o2[0] || (o2[0] = (t3) => e2.useThrottle ? d(q)(t3) : L(t3)) }, [e2.leftIcon && !d(z2) ? (s(), c(y, { key: 0, name: e2.leftIcon }, null, 8, ["name"])) : m("", true), d(z2) && !d(B) ? (s(), n("span", I, [v(y, { name: "Loading", size: 16 })])) : m("", true), p("div", _, [f(t2.$slots, "default", {}, void 0, true)]), e2.rightIcon ? (s(), c(y, { key: 2, name: e2.rightIcon }, null, 8, ["name"])) : m("", true)], 14, k));
|
|
10
|
+
} }), [["__scopeId", "data-v-5a3cd884"]]), z = g(w);
|
|
11
11
|
export {
|
|
12
12
|
w as M,
|
|
13
13
|
z as a
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { inject as e, computed as a, defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { u as v, a as y } from "./mc-form-
|
|
4
|
-
import {
|
|
5
|
-
import { _ as g, w as B } from "./utils-
|
|
6
|
-
const G = Symbol("CheckboxGroupContext"), I = { class: "mc-checkbox" }, w = ["id", "value", "disabled", "onKeypress"], $ = { key: 0, class: "mc-checkbox-content" },
|
|
7
|
-
const x2 =
|
|
8
|
-
const
|
|
1
|
+
import { inject as e, computed as a, defineComponent as l, ref as o, createElementBlock as c, openBlock as s, createElementVNode as t, createCommentVNode as d, withModifiers as u, normalizeClass as r, unref as m, withKeys as n, renderSlot as i, createTextVNode as p, toDisplayString as b, nextTick as h, watch as k, provide as x } from "vue";
|
|
2
|
+
import { useFocus as f } from "@mc-plus/hooks";
|
|
3
|
+
import { u as v, a as y } from "./mc-form-CfApB10d.js";
|
|
4
|
+
import { i as V, a as C, b as S, c as _ } from "./vendor-CfcDHsSD.js";
|
|
5
|
+
import { _ as g, w as B } from "./utils-DhYrNPrr.js";
|
|
6
|
+
const G = Symbol("CheckboxGroupContext"), I = { class: "mc-checkbox" }, w = ["id", "value", "disabled", "onKeypress"], $ = { key: 0, class: "mc-checkbox-content" }, D = { key: 0, class: "mc-checkbox-remarks" }, j = g(l({ name: "McCheckbox", __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(l2, { emit: k2 }) {
|
|
7
|
+
const x2 = l2, y2 = k2, _2 = o(), { wrapperRef: g2, isFocused: B2, handleFocus: j2, handleBlur: F2 } = f(_2), { checkboxGroupDisabled: M2, isCheckboxGroup: R2, isCheckboxSelected: K2, handleCheckboxSelect: q } = (() => {
|
|
8
|
+
const l3 = e(G, void 0), o2 = a(() => {
|
|
9
9
|
var _a;
|
|
10
|
-
return !!((_a =
|
|
11
|
-
}), c2 = a(() => !!
|
|
12
|
-
return { checkboxGroupCtx:
|
|
10
|
+
return !!((_a = l3 == null ? void 0 : l3.disabled) == null ? void 0 : _a.value);
|
|
11
|
+
}), c2 = a(() => !!l3 && V(l3 == null ? void 0 : l3.handleSelect));
|
|
12
|
+
return { checkboxGroupCtx: l3, checkboxGroupDisabled: o2, isCheckboxGroup: c2, isCheckboxSelected: (e2) => {
|
|
13
13
|
var _a;
|
|
14
|
-
return !S(e2) && C((_a =
|
|
14
|
+
return !S(e2) && C((_a = l3 == null ? void 0 : l3.modelValue) == null ? void 0 : _a.value, e2);
|
|
15
15
|
}, handleCheckboxSelect: (e2) => {
|
|
16
|
-
|
|
16
|
+
l3 == null ? void 0 : l3.handleSelect(e2);
|
|
17
17
|
} };
|
|
18
18
|
})(), { formId: z, formItem: A, formDisabled: E, validateStyle: H } = v({ externalDisabled: M2 }), J = a(() => R2.value ? K2(x2.value) : !!x2.modelValue), L = async () => {
|
|
19
19
|
E.value || (R2.value ? q(x2.value) : (y2("update:modelValue", !x2.modelValue), y2("change", !x2.modelValue), await h(), A == null ? void 0 : A.validate("input")));
|
|
20
20
|
};
|
|
21
|
-
return (e2, a2) => (s(), c("div", I, [t("label", { ref_key: "checkboxRef", ref: g2, class: r(["mc-checkbox-wrapper", { "mc-checkbox-disabled": m(E), "mc-checkbox-checked": J.value, "mc-checkbox-partial":
|
|
22
|
-
} }), [["__scopeId", "data-v-
|
|
23
|
-
const
|
|
24
|
-
return k(() =>
|
|
21
|
+
return (e2, a2) => (s(), c("div", I, [t("label", { ref_key: "checkboxRef", ref: g2, class: r(["mc-checkbox-wrapper", { "mc-checkbox-disabled": m(E), "mc-checkbox-checked": J.value, "mc-checkbox-partial": l2.partial, "mc-checkbox-focused": m(B2), [m(H)]: m(H) }]), onClick: u(L, ["prevent"]) }, [t("input", { ref_key: "checkboxInputRef", ref: _2, id: m(z), type: "checkbox", class: "mc-checkbox-input", value: J.value, disabled: m(E), onKeypress: n(u(L, ["prevent", "stop"]), ["enter"]), onFocus: a2[0] || (a2[0] = (...e3) => m(j2) && m(j2)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => m(F2) && m(F2)(...e3)) }, null, 40, w), a2[2] || (a2[2] = t("div", { class: "mc-checkbox-box" }, null, -1)), l2.content || e2.$slots.default ? (s(), c("div", $, [i(e2.$slots, "default", {}, () => [p(b(l2.content), 1)], true)])) : d("", true)], 2), l2.remarks || e2.$slots.remarks ? (s(), c("div", D, [i(e2.$slots, "remarks", {}, () => [p(b(l2.remarks), 1)], true)])) : d("", true)]));
|
|
22
|
+
} }), [["__scopeId", "data-v-1954f4c9"]]), F = ["id"], M = l({ name: "McCheckboxGroup", __name: "mc-checkbox-group", props: { modelValue: { default: () => [] }, disabled: { type: Boolean, default: false } }, emits: ["update:modelValue", "change"], setup(e2, { emit: l2 }) {
|
|
23
|
+
const o2 = e2, t2 = l2, { formId: d2, formItem: u2 } = y();
|
|
24
|
+
return k(() => o2.modelValue, () => {
|
|
25
25
|
u2 == null ? void 0 : u2.validate("change");
|
|
26
|
-
}), x(G, { modelValue: a(() =>
|
|
26
|
+
}), x(G, { modelValue: a(() => o2.modelValue), disabled: a(() => o2.disabled), handleSelect: async (e3) => {
|
|
27
27
|
if (!e3) return;
|
|
28
|
-
const a2 = [...
|
|
29
|
-
|
|
28
|
+
const a2 = [...o2.modelValue], l3 = _(a2, e3);
|
|
29
|
+
l3 > -1 ? a2.splice(l3, 1) : a2.push(e3), t2("update:modelValue", a2), t2("change", a2), await h(), u2 == null ? void 0 : u2.validate("input");
|
|
30
30
|
} }), (e3, a2) => (s(), c("div", { class: "mc-checkbox-group", id: m(d2) }, [i(e3.$slots, "default")], 8, F));
|
|
31
|
-
} }), R = B(
|
|
31
|
+
} }), R = B(j), K = B(M);
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
j as M,
|
|
34
34
|
R as a,
|
|
35
35
|
K as b
|
|
36
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as e, ref as a, watchEffect as l, watch as s, provide as o, createElementBlock as c, openBlock as t, renderSlot as i, inject as m, computed as d, normalizeClass as n, createElementVNode as p, withDirectives as u, createTextVNode as r, toDisplayString as v, createVNode as _, vShow as h } from "vue";
|
|
2
|
-
import { d as f, _ as C, w as V } from "./utils-
|
|
3
|
-
import { M as b } from "./mc-icon-
|
|
2
|
+
import { d as f, _ as C, w as V } from "./utils-DhYrNPrr.js";
|
|
3
|
+
import { M as b } from "./mc-icon-C6rCR5VX.js";
|
|
4
4
|
const g = Symbol("COLLAPSE_CONTEXT"), I = "McCollapse", M = { class: "mc-collapse" }, k = C(e({ name: I, __name: "mc-collapse", props: { modelValue: {}, accordion: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: m2 }) {
|
|
5
5
|
const d2 = a(e2.modelValue), n2 = m2;
|
|
6
6
|
l(() => {
|
|
@@ -24,7 +24,7 @@ const g = Symbol("COLLAPSE_CONTEXT"), I = "McCollapse", M = { class: "mc-collaps
|
|
|
24
24
|
}), s2 = () => {
|
|
25
25
|
e2.disabled || (a2 == null ? void 0 : a2.handleItemClick(e2.name));
|
|
26
26
|
};
|
|
27
|
-
return (
|
|
27
|
+
return (a3, o2) => (t(), c("div", { class: n(["mc-collapse-item", { "mc-collapse-item--active": l2.value }]), onClick: s2 }, [p("div", w, [p("span", y, [i(a3.$slots, "title", {}, () => [r(v(e2.title), 1)], true)]), p("span", N, [_(b, { name: "Down-Chevron" })])]), u(p("div", O, [p("div", $, [i(a3.$slots, "default", {}, void 0, true)])], 512), [[h, l2.value]])], 2));
|
|
28
28
|
} }), [["__scopeId", "data-v-8937850f"]]), x = V(k), B = V(j);
|
|
29
29
|
export {
|
|
30
30
|
x as M,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as t, createElementBlock as s, openBlock as o, renderSlot as e, createVNode as a, createElementVNode as c, toDisplayString as r } from "vue";
|
|
2
|
-
import { M as p } from "./mc-icon-
|
|
3
|
-
import { t as m } from "./mc-toast-
|
|
4
|
-
import { _ as l, w as i } from "./utils-
|
|
2
|
+
import { M as p } from "./mc-icon-C6rCR5VX.js";
|
|
3
|
+
import { t as m } from "./mc-toast-DJc_MSTA.js";
|
|
4
|
+
import { _ as l, w as i } from "./utils-DhYrNPrr.js";
|
|
5
5
|
const u = { class: "mc-copy" }, n = { class: "mc-copy-text" }, x = i(l(t({ name: "McCopy", __name: "mc-copy", props: { text: {}, showToast: { type: Boolean, default: false }, toastSuccessText: { default: "copy succeed" }, toastErrorText: { default: "copy failed" }, manual: { type: Boolean, default: false } }, emits: ["copy", "success", "error"], setup(t2, { emit: l2 }) {
|
|
6
|
-
const i2 = t2, x2 = l2,
|
|
6
|
+
const i2 = t2, x2 = l2, f = async () => {
|
|
7
7
|
if (i2.text) if (i2.manual) x2("copy", i2.text);
|
|
8
8
|
else try {
|
|
9
9
|
await navigator.clipboard.writeText(i2.text), x2("success", i2.text), i2.showToast && m.success(i2.toastSuccessText);
|
|
@@ -11,8 +11,8 @@ const u = { class: "mc-copy" }, n = { class: "mc-copy-text" }, x = i(l(t({ name:
|
|
|
11
11
|
console.error(t3), x2("error", i2.text, t3), i2.showToast && m.error(i2.toastErrorText);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
return (
|
|
15
|
-
} }), [["__scopeId", "data-v-
|
|
14
|
+
return (m2, l3) => (o(), s("div", u, [e(m2.$slots, "default", {}, () => [c("span", n, r(t2.text), 1)], true), a(p, { name: "Duplicate", class: "mc-copy-icon", onClick: f })]));
|
|
15
|
+
} }), [["__scopeId", "data-v-ea4f8711"]]));
|
|
16
16
|
export {
|
|
17
17
|
x as M
|
|
18
18
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as e, computed as a, watch as t, createElementBlock as u, createCommentVNode as n, openBlock as m, normalizeClass as o, toDisplayString as c } from "vue";
|
|
2
|
-
import { _ as s, w as l } from "./utils-
|
|
2
|
+
import { _ as s, w as l } from "./utils-DhYrNPrr.js";
|
|
3
3
|
const r = { key: 0, class: "mc-count-number" }, d = l(s(e({ name: "McCount", __name: "mc-count", props: { value: {}, theme: { default: "red" }, type: { default: "medium" }, hiddenZero: { type: Boolean, default: true }, max: { default: 99 } }, emits: ["change"], setup(e2, { emit: s2 }) {
|
|
4
4
|
const l2 = e2, d2 = s2, i = a(() => {
|
|
5
5
|
const e3 = Number(l2.value);
|
|
6
6
|
return isNaN(e3) ? (console.warn("mc-count: value is not a number"), 0) : e3;
|
|
7
|
-
}), p = a(() => !l2.hiddenZero || i.value > 0), v = a(() => l2.max && i.value > l2.max ? `${l2.max}+` : `${i.value}`),
|
|
7
|
+
}), p = a(() => !l2.hiddenZero || i.value > 0), v = a(() => l2.max && i.value > l2.max ? `${l2.max}+` : `${i.value}`), f = a(() => "tiny" === l2.type);
|
|
8
8
|
return t(() => l2.value, (e3, a2) => {
|
|
9
9
|
e3 !== a2 && d2("change", e3);
|
|
10
|
-
}), (
|
|
11
|
-
} }), [["__scopeId", "data-v-
|
|
10
|
+
}), (a2, t2) => p.value ? (m(), u("i", { key: 0, class: o(["mc-count", [`mc-count-${e2.theme}`, `mc-count-${e2.type}`]]) }, [f.value ? n("", true) : (m(), u("span", r, c(v.value), 1))], 2)) : n("", true);
|
|
11
|
+
} }), [["__scopeId", "data-v-1f678123"]]));
|
|
12
12
|
export {
|
|
13
13
|
d as M
|
|
14
14
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineComponent as c, createElementBlock as r, openBlock as n, normalizeStyle as e, unref as s, createElementVNode as i, renderSlot as t, normalizeClass as o, toDisplayString as l } from "vue";
|
|
2
|
+
import { useCDNPath as u, useWidthHeight as a } from "@mc-plus/hooks";
|
|
3
|
+
import { _ as d, w as m } from "./utils-DhYrNPrr.js";
|
|
4
|
+
const y = { class: "mc-currency-icon-img-wrapper" }, p = ["src", "alt"], f = { class: "mc-currency-icon-label" }, h = { class: "mc-currency-icon-text" }, g = m(d(c({ name: "McCurrencyIcon", __name: "mc-currency-icon", props: { currency: {}, direction: { default: "horizontal" }, desc: {}, cdnUrl: {}, suffix: { default: "svg" }, height: {}, width: {} }, setup(c2) {
|
|
5
|
+
const d2 = c2, { generateFileUrl: m2 } = u(d2.cdnUrl, d2.suffix), { width: g2, height: v } = a();
|
|
6
|
+
return (u2, a2) => (n(), r("div", { class: "mc-currency-icon", style: e({ width: s(g2), height: s(v) }) }, [i("div", y, [t(u2.$slots, "icon", {}, () => [i("img", { src: s(m2)(c2.currency), class: "mc-currency-icon-img", alt: `${c2.currency}-icon` }, null, 8, p)], true)]), i("div", { class: o(["mc-currency-icon-content", [`mc-currency-icon-content-${c2.direction}`]]) }, [i("div", f, [t(u2.$slots, "default", {}, () => [i("span", null, l(c2.currency), 1)], true)]), i("div", h, [t(u2.$slots, "desc", {}, () => [i("span", null, l(c2.desc), 1)], true)])], 2)], 4));
|
|
7
|
+
} }), [["__scopeId", "data-v-f792a3dc"]]));
|
|
8
|
+
export {
|
|
9
|
+
g as M
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { defineComponent as i, createElementBlock as e, openBlock as a, normalizeClass as s } from "vue";
|
|
2
|
+
import { _ as d, w as m } from "./utils-DhYrNPrr.js";
|
|
3
|
+
const r = d(i({ name: "McDivider", __name: "mc-divider", props: { size: { default: "small" }, emphasis: { default: "minimal" }, orientation: { default: "horizontal" } }, setup: (i2) => (d2, m2) => (a(), e("div", { class: s(["mc-divider", [`mc-divider-${i2.orientation}`, `mc-divider-${i2.size}`, `mc-divider-${i2.emphasis}`]]) }, null, 2)) }), [["__scopeId", "data-v-1397051d"]]), t = m(r);
|
|
4
|
+
export {
|
|
5
|
+
r as M,
|
|
6
|
+
t as a
|
|
7
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as e, ref as o, watch as t, createElementBlock as a, createCommentVNode as r, openBlock as s, createBlock as l, Teleport as d, createVNode as i, Transition as m, withCtx as f, normalizeClass as c, createElementVNode as u, renderSlot as n, nextTick as p } from "vue";
|
|
2
|
+
import { M as v } from "./mc-overlay-CdYepe9d.js";
|
|
3
|
+
import { _ as w } from "./mc-modal-header-BxfKCG2W.js";
|
|
4
|
+
import { M as h } from "./mc-footer-C7-SDeDK.js";
|
|
5
|
+
import { useResizeObserver as y } from "@mc-plus/hooks";
|
|
6
|
+
import { _, w as b } from "./utils-DhYrNPrr.js";
|
|
7
|
+
const $ = { key: 0, class: "mc-drawer-container" }, g = { class: "mc-drawer-header" }, k = { class: "mc-drawer-content-wrapper" }, B = { class: "mc-drawer-content" }, x = b(_(e({ name: "McDrawer", __name: "mc-drawer", props: { modelValue: { type: Boolean }, title: {}, size: { default: "medium" }, maskClosable: { type: Boolean, default: true }, fixed: { type: Boolean, default: true }, portCssSelector: { default: "body" }, showBorder: { type: Boolean, default: true }, hideFooter: { type: Boolean, default: false }, position: { default: "right" } }, emits: ["update:modelValue", "close"], setup(e2, { expose: _2, emit: b2 }) {
|
|
8
|
+
const x2 = e2, C = o(false), j = o(false), M = o(false), V = async () => {
|
|
9
|
+
C.value = true, j.value = true, await p(), M.value = true;
|
|
10
|
+
}, z = async () => {
|
|
11
|
+
M.value = false, await p(), j.value = false, await p(), C.value = false, F("close"), F("update:modelValue", false);
|
|
12
|
+
};
|
|
13
|
+
t(() => x2.modelValue, (e3, o2) => {
|
|
14
|
+
!o2 && e3 ? V() : z();
|
|
15
|
+
}, { immediate: true, flush: "post" });
|
|
16
|
+
const F = b2, S = () => {
|
|
17
|
+
x2.maskClosable && z();
|
|
18
|
+
}, D = () => {
|
|
19
|
+
z();
|
|
20
|
+
}, I = o(), R = o();
|
|
21
|
+
return y(R, ({ height: e3 }) => {
|
|
22
|
+
const o2 = I.value;
|
|
23
|
+
o2 && (o2.style.paddingBottom = `${e3}px`);
|
|
24
|
+
}), _2({ ref: I, open: V, close: z }), (o2, t2) => C.value ? (s(), a("div", $, [(s(), l(d, { to: e2.portCssSelector }, [i(m, { name: "mc-drawer-overlay" }, { default: f(() => [i(v, { visible: j.value, fixed: e2.fixed, onClick: S }, { default: f(() => [i(m, { name: `mc-drawer-content-${e2.position}` }, { default: f(() => [M.value ? (s(), a("div", { key: 0, class: c(["mc-drawer", [`mc-drawer-${e2.size}`, `mc-drawer-${e2.position}`]]), ref_key: "_ref", ref: I }, [u("div", g, [n(o2.$slots, "header", {}, () => [i(w, { title: e2.title, "show-border": e2.showBorder, onClose: D }, { default: f(() => [n(o2.$slots, "header-title", {}, void 0, true)]), _: 3 }, 8, ["title", "show-border"])], true)]), u("div", k, [u("div", B, [n(o2.$slots, "default", {}, void 0, true)])]), e2.hideFooter ? r("", true) : (s(), a("div", { key: 0, class: "mc-drawer-footer", ref_key: "footerRef", ref: R }, [n(o2.$slots, "footer", {}, () => [i(h, null, { left: f(() => [n(o2.$slots, "footer-left", {}, void 0, true)]), right: f(() => [n(o2.$slots, "footer-right", {}, void 0, true)]), "right-button-group": f(() => [n(o2.$slots, "footer-right-button-group", {}, void 0, true)]), desc: f(() => [n(o2.$slots, "footer-desc", {}, void 0, true)]), _: 3 })], true)], 512))], 2)) : r("", true)]), _: 3 }, 8, ["name"])]), _: 3 }, 8, ["visible", "fixed"])]), _: 3 })], 8, ["to"]))])) : r("", true);
|
|
25
|
+
} }), [["__scopeId", "data-v-7bbfa2be"]]));
|
|
26
|
+
export {
|
|
27
|
+
x as M
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineComponent as t, ref as o, createElementBlock as e, openBlock as s, normalizeStyle as r, normalizeClass as i, createCommentVNode as c, createElementVNode as d, renderSlot as a } from "vue";
|
|
2
|
+
import { _ as l, w as p } from "./utils-DhYrNPrr.js";
|
|
3
|
+
const f = { key: 0, class: "mc-footer-content" }, h = { class: "mc-footer-bottom" }, m = { class: "mc-footer-bottom-content" }, n = { class: "mc-footer-left" }, v = { class: "mc-footer-right" }, w = { class: "mc-footer-right-button-group" }, g = l(t({ name: "McFooter", __name: "mc-footer", props: { width: {}, height: {}, wrapperWidth: {}, showborder: { type: Boolean, default: true } }, setup(t2, { expose: l2 }) {
|
|
4
|
+
const p2 = o();
|
|
5
|
+
return l2({ ref: p2 }), (o2, l3) => (s(), e("section", { class: i(["mc-footer", { "mc-footer-border": t2.showborder }]), style: r({ width: t2.width, height: t2.height }), ref_key: "_ref", ref: p2 }, [o2.$slots.desc ? (s(), e("div", f, [d("div", { class: "mc-footer-wrapper", style: r({ width: t2.wrapperWidth }) }, [a(o2.$slots, "desc", {}, void 0, true)], 4)])) : c("", true), d("div", h, [d("div", { class: "mc-footer-wrapper", style: r({ width: t2.wrapperWidth }) }, [d("div", m, [d("div", n, [a(o2.$slots, "left", {}, void 0, true)]), d("div", v, [a(o2.$slots, "right", {}, () => [d("div", w, [a(o2.$slots, "right-button-group", {}, void 0, true)])], true)])])], 4)])], 6));
|
|
6
|
+
} }), [["__scopeId", "data-v-54785ade"]]), u = p(g);
|
|
7
|
+
export {
|
|
8
|
+
g as M,
|
|
9
|
+
u as a
|
|
10
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { onMounted as e, onBeforeUnmount as r, computed as a, inject as t, watch as o, defineComponent as l, reactive as s, toRefs as i, provide as d, createElementBlock as n, openBlock as c, createElementVNode as m, withModifiers as u, renderSlot as v, ref as p, onUnmounted as f, normalizeClass as b, createCommentVNode as h, toDisplayString as I, createVNode as y, createTextVNode as g, Transition as x, withCtx as _, nextTick as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as O, _ as R, w as G } from "./utils-
|
|
1
|
+
import { onMounted as e, onBeforeUnmount as r, computed as a, inject as t, watch as o, defineComponent as l, reactive as s, toRefs as i, provide as d, createElementBlock as n, openBlock as c, createElementVNode as m, withModifiers as u, renderSlot as v, ref as p, onUnmounted as f, normalizeClass as b, createCommentVNode as h, toDisplayString as I, createVNode as y, createTextVNode as g, Transition as x, withCtx as _, nextTick as q } from "vue";
|
|
2
|
+
import { useId as j, useProp as F } from "@mc-plus/hooks";
|
|
3
|
+
import { i as V, k as w, h as P, f as S, s as $, d as D, a as k, b as B, m as E, e as M, g as z, j as C, l as T, n as A } from "./vendor-CfcDHsSD.js";
|
|
4
|
+
import { a as O, _ as R, w as G } from "./utils-DhYrNPrr.js";
|
|
5
5
|
import H from "async-validator";
|
|
6
|
-
import { _ as J } from "./mc-tooltip-
|
|
6
|
+
import { _ as J } from "./mc-tooltip-BeK9T6ZC.js";
|
|
7
7
|
const K = Symbol("formContext"), L = Symbol("formItemContext"), N = ({ externalId: o2, externalDisabled: l2, disableValidation: s2 } = {}) => {
|
|
8
8
|
const i2 = F("disableValidation"), d2 = a(() => !!i2.value || !!(s2 == null ? void 0 : s2.value)), n2 = t(K, void 0), c2 = d2.value ? void 0 : t(L, void 0), m2 = c2 ? (({ formItem: a2, externalId: t2 }) => {
|
|
9
|
-
const o3 =
|
|
9
|
+
const o3 = j(t2 == null ? void 0 : t2.value);
|
|
10
10
|
return e(() => {
|
|
11
11
|
a2 && (a2.id = o3);
|
|
12
12
|
}), r(() => {
|
|
@@ -65,8 +65,8 @@ const K = Symbol("formContext"), L = Symbol("formItemContext"), N = ({ externalI
|
|
|
65
65
|
D(p2(l2, e3), (e4) => e4.clearValidate());
|
|
66
66
|
} }), (e3, r3) => (c(), n("div", U, [m("form", { onSubmit: r3[0] || (r3[0] = u(() => {
|
|
67
67
|
}, ["prevent"])) }, [v(e3.$slots, "default", {}, void 0, true)], 32)]));
|
|
68
|
-
} }), [["__scopeId", "data-v-
|
|
69
|
-
const l2 = r2, i2 = t(K, void 0), u2 = p("init"),
|
|
68
|
+
} }), [["__scopeId", "data-v-51b3729a"]]), X = { class: "mc-form-item-label-wrapper" }, Y = { key: 0, class: "mc-form-item-label" }, Z = { key: 0, class: "mc-form-item-help" }, ee = { key: 0, class: "mc-form-item-desc" }, re = { class: "mc-form-item__content" }, ae = { key: 0, class: "mc-form-item__error" }, te = R(l({ name: "McFormItem", __name: "mc-form-item", props: { prop: { default: "" }, label: {}, disabled: { type: Boolean, default: false }, required: { type: Boolean, default: false }, rules: {}, help: {}, desc: {} }, setup(r2, { expose: o2 }) {
|
|
69
|
+
const l2 = r2, i2 = t(K, void 0), u2 = p("init"), j2 = p(""), F2 = (e2) => e2 && l2.prop && !B(z(e2, l2.prop)) ? z(e2, l2.prop) : null, V2 = a(() => {
|
|
70
70
|
const e2 = i2 == null ? void 0 : i2.model;
|
|
71
71
|
return F2(e2);
|
|
72
72
|
}), P2 = a(() => {
|
|
@@ -100,9 +100,9 @@ const K = Symbol("formContext"), L = Symbol("formItemContext"), N = ({ externalI
|
|
|
100
100
|
u2.value = "validating";
|
|
101
101
|
const t2 = ((e3) => {
|
|
102
102
|
const r4 = l2.prop;
|
|
103
|
-
return r4 ? new H({ [r4]: e3 }).validate({ [r4]: V2.value }, { firstFields: true }).then(() => (u2.value = "success", i2 == null ? void 0 : i2.emits("validate", l2, true, ""),
|
|
103
|
+
return r4 ? new H({ [r4]: e3 }).validate({ [r4]: V2.value }, { firstFields: true }).then(() => (u2.value = "success", i2 == null ? void 0 : i2.emits("validate", l2, true, ""), j2.value = "", true)).catch((e4) => {
|
|
104
104
|
const { errors: r5 } = e4;
|
|
105
|
-
return u2.value = "error",
|
|
105
|
+
return u2.value = "error", j2.value = r5 && $(r5) > 0 ? r5[0].message ?? "" : "", i2 == null ? void 0 : i2.emits("validate", l2, false, j2.value), Promise.reject(e4);
|
|
106
106
|
}) : null;
|
|
107
107
|
})(a2);
|
|
108
108
|
return t2 ? t2.then(() => (r3 == null ? void 0 : r3(true), true)).catch((e3) => {
|
|
@@ -111,18 +111,18 @@ const K = Symbol("formContext"), L = Symbol("formItemContext"), N = ({ externalI
|
|
|
111
111
|
}) : Promise.reject(false);
|
|
112
112
|
}, U2 = () => {
|
|
113
113
|
const e2 = i2 == null ? void 0 : i2.model;
|
|
114
|
-
e2 && l2.prop && !B(z(e2, l2.prop)) && (N2 = true, C(e2, l2.prop, T(G2))),
|
|
114
|
+
e2 && l2.prop && !B(z(e2, l2.prop)) && (N2 = true, C(e2, l2.prop, T(G2))), q(() => {
|
|
115
115
|
W2();
|
|
116
116
|
});
|
|
117
117
|
}, W2 = () => {
|
|
118
|
-
u2.value = "init",
|
|
118
|
+
u2.value = "init", j2.value = "", N2 = false;
|
|
119
119
|
}, te2 = s({ id: p(""), prop: a(() => l2.prop ?? ""), validateStatus: a(() => u2.value), disabled: R2, validate: Q2, resetField: U2, clearValidate: W2 }), oe2 = a(() => "horizontal" === (i2 == null ? void 0 : i2.direction));
|
|
120
120
|
return d(L, te2), e(() => {
|
|
121
121
|
l2.prop && (i2 == null ? void 0 : i2.addField(te2), G2 = V2.value);
|
|
122
122
|
}), f(() => {
|
|
123
123
|
l2.prop && (i2 == null ? void 0 : i2.removeField(te2));
|
|
124
|
-
}), o2({ validateMessage:
|
|
125
|
-
} }), [["__scopeId", "data-v-
|
|
124
|
+
}), o2({ validateMessage: j2, validateStatus: u2, validate: Q2, resetField: U2, clearValidate: W2 }), (e2, a2) => (c(), n("div", { class: b(["mc-form-item", { "mc-form-item-horizontal": oe2.value }]) }, [v(e2.$slots, "label", { required: O2.value }, () => [m("div", null, [m("div", X, [r2.label ? (c(), n("label", Y, [m("span", { class: b(["mc-form-item-lable-text", { "mc-form-item-label-required": O2.value }]) }, I(r2.label), 3), r2.help || e2.$slots.help ? (c(), n("div", Z, [v(e2.$slots, "help", {}, () => [y(J, { content: r2.help, "icon-size": 20 }, null, 8, ["content"])], true)])) : h("", true)])) : h("", true), v(e2.$slots, "tool", {}, void 0, true)]), r2.desc || e2.$slots.desc ? (c(), n("div", ee, [v(e2.$slots, "desc", {}, () => [g(I(r2.desc), 1)], true)])) : h("", true)])], true), m("div", re, [v(e2.$slots, "default", {}, void 0, true), y(x, { name: "mc-form-item-error" }, { default: _(() => [j2.value ? (c(), n("div", ae, I(j2.value), 1)) : h("", true)]), _: 1 })])], 2));
|
|
125
|
+
} }), [["__scopeId", "data-v-c9ad6150"]]), oe = G(W), le = G(te);
|
|
126
126
|
export {
|
|
127
127
|
oe as M,
|
|
128
128
|
N as a,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent as e, ref as c, createElementBlock as s, openBlock as o, normalizeStyle as i, createElementVNode as t, normalizeClass as l, computed as a } from "vue";
|
|
2
|
+
import { _ as n, w as r } from "./utils-DhYrNPrr.js";
|
|
3
|
+
import { useWidthHeight as m } from "@mc-plus/hooks";
|
|
4
|
+
const p = n(e({ name: "McIcon", __name: "mc-icon", props: { name: {}, size: { default: 24 }, color: {} }, emits: ["click"], setup(e2, { expose: a2, emit: n2 }) {
|
|
5
|
+
const r2 = n2, m2 = c();
|
|
6
|
+
return a2({ ref: m2 }), (c2, a3) => (o(), s("span", { class: "mc-icon", style: i({ fontSize: `${e2.size}px`, width: `${e2.size}px`, height: `${e2.size}px`, color: e2.color }) }, [t("i", { ref_key: "_ref", ref: m2, class: l(["mc-iconfont", `mc-icon--${e2.name}`]), onClick: a3[0] || (a3[0] = (e3) => ((e4) => {
|
|
7
|
+
r2("click", e4);
|
|
8
|
+
})(e3)) }, null, 2)], 4));
|
|
9
|
+
} }), [["__scopeId", "data-v-95f0c9d3"]]), u = r(p), f = n(e({ name: "McIconPlus", __name: "mc-icon-plus", props: { name: {}, size: { default: 24 }, width: {}, height: {}, color: {}, cursor: { default: "default" } }, emits: ["click"], setup(e2, { emit: c2 }) {
|
|
10
|
+
const n2 = e2, r2 = c2, { width: p2, height: u2 } = m(), f2 = a(() => n2.width ? p2.value : `${n2.size}px`), h2 = a(() => n2.height ? u2.value : `${n2.size}px`), d = () => {
|
|
11
|
+
r2("click", n2.name);
|
|
12
|
+
};
|
|
13
|
+
return (c3, a2) => (o(), s("span", { class: "mc-icon-plus", style: i({ fontSize: `${e2.size}px`, width: f2.value, height: h2.value, color: e2.color, cursor: e2.cursor }), onClick: d }, [t("i", { class: l(["mc-iconfont-plus", `mc-icon-plus-${e2.name}`]) }, null, 2)], 4));
|
|
14
|
+
} }), [["__scopeId", "data-v-3c7ebbd0"]]), h = r(f);
|
|
15
|
+
export {
|
|
16
|
+
p as M,
|
|
17
|
+
f as a,
|
|
18
|
+
u as b,
|
|
19
|
+
h as c
|
|
20
|
+
};
|