mc-plus 1.0.109 → 1.0.111
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 +40 -40
- package/dist/es/{mc-checkbox-BBIfknVB.js → mc-checkbox-BN4P6-DK.js} +2 -2
- package/dist/es/{mc-checkbox-group-C-eLZFBP.js → mc-checkbox-group-BifJ8Ni7.js} +1 -1
- package/dist/es/{mc-date-picker-Cy-yK5TI.js → mc-date-picker-CfborZX9.js} +1 -1
- package/dist/es/{mc-file-list-Dkj-S89y.js → mc-file-list-CHTB72Ds.js} +1 -1
- package/dist/es/{mc-form-ffIxRMtg.js → mc-form-DCKlCcDs.js} +20 -20
- package/dist/es/{mc-form-item-D44F-c3U.js → mc-form-item-Ksz0bBSl.js} +1 -1
- package/dist/es/{mc-input-DHBf3QjE.js → mc-input-BGgdD1HJ.js} +1 -1
- package/dist/es/{mc-otp-CNWg5Fwl.js → mc-otp-CXPGr4xS.js} +1 -1
- package/dist/es/{mc-radio-BESoY7cw.js → mc-radio-dZSSpnrK.js} +2 -2
- package/dist/es/{mc-radio-group-Ci5oCMVt.js → mc-radio-group-RBo73oRr.js} +1 -1
- package/dist/es/{mc-richtext-CorNrnhg.js → mc-richtext-ClxrTi6e.js} +3 -3
- package/dist/es/{mc-select-BOZyeL1v.js → mc-select-CneRu4Ql.js} +2 -2
- package/dist/es/{mc-select-group-plus-Blt_T5Yk.js → mc-select-group-plus-B8grrVXr.js} +1 -1
- package/dist/es/{mc-select-multi-option-C9b5LOmP.js → mc-select-multi-option-D7hD1igO.js} +1 -1
- package/dist/es/{mc-select-option-plus-Bn1RGeiS.js → mc-select-option-plus-CxY0GZeL.js} +2 -2
- package/dist/es/{mc-select-plus-DfguHmhz.js → mc-select-plus-BeYarza9.js} +66 -66
- package/dist/es/{mc-switch-Buj-pU4b.js → mc-switch-CJKHiSY9.js} +1 -1
- package/dist/es/{mc-table-Py-BMb04.js → mc-table-CA8JjLlo.js} +1 -1
- package/dist/es/{mc-textarea-P3jxTX7p.js → mc-textarea-CT_tmZlw.js} +1 -1
- package/dist/es/{mc-upload-q89LNkpa.js → mc-upload-DwBh_Xaf.js} +2 -2
- package/dist/umd/index.umd.cjs +18 -18
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { defineComponent as e, inject as l, computed as a, createElementBlock as t, openBlock as s, normalizeClass as o, unref as i, renderSlot as r, createBlock as n, resolveDynamicComponent as c, toDisplayString as u, Fragment as d, renderList as p, createVNode as v, withCtx as m, createTextVNode as h, ref as f, createElementVNode as y, normalizeStyle as b, withDirectives as g, withKeys as w, withModifiers as x, vShow as O, createSlots as _, watchEffect as k, createCommentVNode as V, getCurrentInstance as $, watch as B, provide as S, isRef as D } from "vue";
|
|
2
2
|
import { _ as I, u as P } from "./utils-dWwt4JKv.js";
|
|
3
|
-
import { isEmpty as T, isNumber as E, map as A, isArray as M, isString as j, isFunction as F,
|
|
4
|
-
import { useProp as
|
|
5
|
-
import { M as
|
|
6
|
-
import { M as
|
|
7
|
-
import { M as
|
|
8
|
-
import { M as
|
|
9
|
-
import { M as
|
|
10
|
-
import { a as
|
|
11
|
-
import { u as
|
|
12
|
-
import { I as
|
|
13
|
-
const
|
|
14
|
-
const { selectedOptions: d2, isDisabled: p2 } = l(
|
|
3
|
+
import { isEmpty as T, isNumber as E, map as A, isArray as M, isString as j, isFunction as F, isNil as H, includes as R, filter as C, toLower as L, uniqBy as U, findIndex as z, difference as G } from "lodash-es";
|
|
4
|
+
import { useProp as K, useFocus as N, useHover as q, useEventListener as J, useWidthHeight as Q } from "@mc-plus/hooks";
|
|
5
|
+
import { M as W } from "./mc-popper-plus-CTKgoEEE.js";
|
|
6
|
+
import { M as X } from "./mc-icon-plus-YMAi6EZM.js";
|
|
7
|
+
import { M as Y } from "./mc-tag-nPl6YzbM.js";
|
|
8
|
+
import { M as Z } from "./mc-checkbox-BN4P6-DK.js";
|
|
9
|
+
import { M as ee } from "./mc-select-group-plus-B8grrVXr.js";
|
|
10
|
+
import { a as le } from "./mc-select-option-plus-CxY0GZeL.js";
|
|
11
|
+
import { u as ae } from "./mc-form-DCKlCcDs.js";
|
|
12
|
+
import { I as te } from "./mc-input-group-BPpVTTHQ.js";
|
|
13
|
+
const se = Symbol("mc-select-plus-context"), oe = "mc-select-plus", ie = { key: 1 }, re = I(e({ name: "mc-select-selected-content", __name: "index", setup(e2) {
|
|
14
|
+
const { selectedOptions: d2, isDisabled: p2 } = l(se), v2 = a(() => T(d2.value) ? void 0 : d2.value[0]), m2 = a(() => {
|
|
15
15
|
var _a, _b;
|
|
16
16
|
return T(v2.value) ? void 0 : v2.value.label ?? ((_b = (_a = v2.value) == null ? void 0 : _a.value) == null ? void 0 : _b.toString());
|
|
17
17
|
}), h2 = a(() => T(v2.value) ? void 0 : v2.value.context);
|
|
18
18
|
return (e3, l2) => {
|
|
19
19
|
var _a;
|
|
20
|
-
return s(), t("div", { class: o(["mc-select-selected-content", { "is-disabled": i(p2) }]) }, [h2.value || e3.$slots.default ? r(e3.$slots, "default", { key: 0, selectedOption: (_a = v2.value) == null ? void 0 : _a.value, selectedOptionLabel: m2.value, isDisabled: i(p2) }, () => [(s(), n(c(h2.value)))], true) : (s(), t("span",
|
|
20
|
+
return s(), t("div", { class: o(["mc-select-selected-content", { "is-disabled": i(p2) }]) }, [h2.value || e3.$slots.default ? r(e3.$slots, "default", { key: 0, selectedOption: (_a = v2.value) == null ? void 0 : _a.value, selectedOptionLabel: m2.value, isDisabled: i(p2) }, () => [(s(), n(c(h2.value)))], true) : (s(), t("span", ie, u(m2.value), 1))], 2);
|
|
21
21
|
};
|
|
22
|
-
} }), [["__scopeId", "data-v-2417c622"]]),
|
|
23
|
-
const { isMulti: o2, selectedOptions: r2, isDisabled: n2, deleteTag: c2 } = l(
|
|
22
|
+
} }), [["__scopeId", "data-v-2417c622"]]), ne = { class: "mc-select-selected-content-multi" }, ce = I(e({ name: "mc-select-selected-content-multi", __name: "index", props: { isFocused: { type: Boolean, default: false }, isHovering: { type: Boolean, default: false }, maxTags: { default: void 0 } }, setup(e2) {
|
|
23
|
+
const { isMulti: o2, selectedOptions: r2, isDisabled: n2, deleteTag: c2 } = l(se), f2 = e2, y2 = a(() => {
|
|
24
24
|
const e3 = f2.maxTags, l2 = r2.value;
|
|
25
25
|
if (E(e3)) {
|
|
26
26
|
const a2 = l2.length - e3, t2 = [];
|
|
@@ -32,18 +32,18 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
32
32
|
}
|
|
33
33
|
return A(l2, (e4) => ({ label: `${e4.label ?? e4.value}`, item: e4.value, selectable: true }));
|
|
34
34
|
}), b2 = a(() => f2.isFocused || f2.isHovering ? "minimal" : "bold");
|
|
35
|
-
return (e3, l2) => (s(), t("ul",
|
|
35
|
+
return (e3, l2) => (s(), t("ul", ne, [(s(true), t(d, null, p(y2.value, (e4) => (s(), t("li", { key: `${e4.item}`, class: "mc-select-selected-tag" }, [v(i(Y), { size: "x-small", type: "selectable", deletable: e4.selectable, emphasis: b2.value, disabled: i(n2), onDelete: (l3) => {
|
|
36
36
|
return a2 = e4.item, void (o2.value && c2(a2));
|
|
37
37
|
var a2;
|
|
38
38
|
} }, { default: m(() => [h(u(e4.label), 1)]), _: 2 }, 1032, ["deletable", "emphasis", "disabled", "onDelete"])]))), 128))]));
|
|
39
|
-
} }), [["__scopeId", "data-v-aac507b5"]]),
|
|
40
|
-
const d2 = e2, p2 = c2, h2 = f(), { wrapperRef: k2, isFocused: V2, handleFocus: $2, handleBlur: B2 } =
|
|
39
|
+
} }), [["__scopeId", "data-v-aac507b5"]]), ue = ["value", "placeholder", "disabled", "readonly", "onKeydown"], de = { class: "mc-select-placeholder" }, pe = { class: "mc-select-trigger-toolbar" }, ve = I(e({ name: "mc-select-trigger", __name: "index", props: { search: { type: Boolean, default: false }, clearable: { type: Boolean, default: false }, placeholder: { default: "Please select" }, searchValue: { default: void 0 }, isExpanded: { type: Boolean, default: false }, maxTags: { default: void 0 }, hideValidationIcon: { type: Boolean } }, emits: ["update:searchValue", "update:isExpanded", "press:arrow", "search", "focus", "blur", "clear"], setup(e2, { emit: c2 }) {
|
|
40
|
+
const d2 = e2, p2 = c2, h2 = f(), { wrapperRef: k2, isFocused: V2, handleFocus: $2, handleBlur: B2 } = N(h2), { isHovering: S2 } = q(k2), { selectedOptions: D2, isMulti: I2, isDisabled: P2, validateStatus: T2, isTopPlacement: E2 } = l(se), A2 = a(() => M(D2.value) ? D2.value.length > 0 : !!D2.value), j2 = (e3) => {
|
|
41
41
|
const { value: l2 } = e3.target;
|
|
42
42
|
p2("update:searchValue", l2), p2("search");
|
|
43
43
|
}, F2 = () => {
|
|
44
44
|
P2.value || p2("update:isExpanded", !d2.isExpanded);
|
|
45
45
|
}, { showClearIcon: H2, mouseOverIcon: R2 } = (() => {
|
|
46
|
-
const e3 = f(false), l2 =
|
|
46
|
+
const e3 = f(false), l2 = K("clearable"), t2 = K("isDisabled");
|
|
47
47
|
return { showClearIcon: a(() => !!l2.value && e3.value && !t2.value), mouseOverIcon: (l3) => {
|
|
48
48
|
e3.value = l3;
|
|
49
49
|
} };
|
|
@@ -51,14 +51,14 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
51
51
|
p2("clear");
|
|
52
52
|
}, U2 = a(() => P2.value ? "not-allowed" : d2.search ? "text" : "pointer"), z2 = () => {
|
|
53
53
|
P2.value || p2("update:isExpanded", !d2.isExpanded);
|
|
54
|
-
},
|
|
54
|
+
}, G2 = (e3) => {
|
|
55
55
|
P2.value || p2("press:arrow", e3);
|
|
56
56
|
};
|
|
57
|
-
return (l2, a2) => (s(), t("div", { ref_key: "triggerRef", ref: k2, class: o(["mc-select-trigger", { "is-hovering": i(S2), "is-focused": i(V2), "is-expanded": e2.isExpanded, "is-disabled": i(P2), "is-error": "error" === i(T2), "is-success": "success" === i(T2), "is-top-placement": i(E2) }]), onClick: F2 }, [y("div", { class: "mc-select-trigger-selected-content", style: b({ cursor: U2.value }) }, [y("div", { class: "mc-select-trigger-input-wrapper", style: b({ width: e2.searchValue || !A2.value ? "100%" : "1em" }) }, [y("input", { value: e2.searchValue, ref_key: "inputRef", ref: h2, class: "mc-select-input", placeholder: e2.placeholder, disabled: i(P2), readonly: !e2.search || i(P2), onInput: j2, onFocus: a2[0] || (a2[0] = (...e3) => i($2) && i($2)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => i(B2) && i(B2)(...e3)), onKeydown: [w(x(z2, ["stop", "prevent"]), ["enter"]), w(x(
|
|
58
|
-
}, ["stop"])) }, [v(i(
|
|
59
|
-
} }), [["__scopeId", "data-v-61e04dfa"]]),
|
|
60
|
-
const { filteredOptions: n2, isMulti: c2, isTopPlacement: u2 } = l(
|
|
61
|
-
const { isMulti: e3, selectedOptions: a2, selectOptions: t2, selectAll: s2 } = l(
|
|
57
|
+
return (l2, a2) => (s(), t("div", { ref_key: "triggerRef", ref: k2, class: o(["mc-select-trigger", { "is-hovering": i(S2), "is-focused": i(V2), "is-expanded": e2.isExpanded, "is-disabled": i(P2), "is-error": "error" === i(T2), "is-success": "success" === i(T2), "is-top-placement": i(E2) }]), onClick: F2 }, [y("div", { class: "mc-select-trigger-selected-content", style: b({ cursor: U2.value }) }, [y("div", { class: "mc-select-trigger-input-wrapper", style: b({ width: e2.searchValue || !A2.value ? "100%" : "1em" }) }, [y("input", { value: e2.searchValue, ref_key: "inputRef", ref: h2, class: "mc-select-input", placeholder: e2.placeholder, disabled: i(P2), readonly: !e2.search || i(P2), onInput: j2, onFocus: a2[0] || (a2[0] = (...e3) => i($2) && i($2)(...e3)), onBlur: a2[1] || (a2[1] = (...e3) => i(B2) && i(B2)(...e3)), onKeydown: [w(x(z2, ["stop", "prevent"]), ["enter"]), w(x(G2, ["stop", "prevent"]), ["arrow-down"]), w(x(G2, ["stop", "prevent"]), ["arrow-up"])] }, null, 40, ue), g(y("div", de, [r(l2.$slots, "placeholder", { placeholder: e2.placeholder, isDisabled: i(P2) }, () => [y("span", null, u(e2.placeholder), 1)], true)], 512), [[O, !e2.searchValue && !A2.value]])], 4), i(I2) ? g((s(), n(ce, { key: 0, "max-tags": e2.maxTags, "is-focused": i(V2), "is-hovering": i(S2) }, null, 8, ["max-tags", "is-focused", "is-hovering"])), [[O, A2.value && !e2.searchValue]]) : g((s(), n(re, { key: 1 }, _({ _: 2 }, [l2.$slots["selected-content"] ? { name: "default", fn: m(({ selectedOption: e3, selectedOptionLabel: a3, isDisabled: t2 }) => [r(l2.$slots, "selected-content", { selectedOption: e3, selectedOptionLabel: a3, isDisabled: t2 }, void 0, true)]), key: "0" } : void 0]), 1536)), [[O, A2.value && !e2.searchValue]])], 4), y("div", pe, [g(v(i(X), { class: "mc-select-status-icon", name: "error" === i(T2) ? "reject-fail-rev" : "accept-success-rev", size: 24 }, null, 8, ["name"]), [[O, "init" !== i(T2) && !e2.hideValidationIcon]]), y("div", { class: "mc-select-icon-wrapper", onMouseenter: a2[3] || (a2[3] = (e3) => i(R2)(true)), onMouseleave: a2[4] || (a2[4] = (e3) => i(R2)(false)) }, [g(v(i(X), { class: "mc-select-chevron-icon", name: "down-chevron", size: 24, cursor: i(P2) ? "not-allowed" : "pointer" }, null, 8, ["cursor"]), [[O, !C2.value]]), g(y("div", { onClick: a2[2] || (a2[2] = x(() => {
|
|
58
|
+
}, ["stop"])) }, [v(i(X), { class: "mc-select-clear-icon", name: "rejectfail", size: 16, cursor: "pointer", onClick: L2 })], 512), [[O, C2.value]])], 32)])], 2));
|
|
59
|
+
} }), [["__scopeId", "data-v-61e04dfa"]]), me = { class: "mc-select-list-wrapper" }, he = { key: 0, class: "mc-select-list-header" }, fe = { key: 0, class: "mc-select-list-header-content" }, ye = { class: "mc-select-list-content" }, be = { key: 0, class: "mc-select-list-empty" }, ge = { key: 1, class: "mc-select-list-footer" }, we = I(e({ name: "mc-select-list", __name: "index", props: { showFooter: { type: Boolean }, showHeader: { type: Boolean } }, setup(e2) {
|
|
60
|
+
const { filteredOptions: n2, isMulti: c2, isTopPlacement: u2 } = l(se), d2 = a(() => !T(n2.value)), { isSelectAll: p2, isSelectPartial: m2, selectAll: h2 } = (() => {
|
|
61
|
+
const { isMulti: e3, selectedOptions: a2, selectOptions: t2, selectAll: s2 } = l(se), o2 = f(false), i2 = f(false);
|
|
62
62
|
return k(() => {
|
|
63
63
|
var _a, _b;
|
|
64
64
|
if (!e3.value) return;
|
|
@@ -66,11 +66,11 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
66
66
|
(l2 == null ? void 0 : l2.length) && ((_a = t2.value) == null ? void 0 : _a.length) && (l2 == null ? void 0 : l2.length) === ((_b = t2.value) == null ? void 0 : _b.length) ? (o2.value = true, i2.value = false) : (l2 == null ? void 0 : l2.length) > 0 ? (o2.value = false, i2.value = true) : (o2.value = false, i2.value = false);
|
|
67
67
|
}), { isSelectAll: o2, isSelectPartial: i2, selectAll: s2 };
|
|
68
68
|
})();
|
|
69
|
-
return (l2, a2) => (s(), t("div",
|
|
70
|
-
} }), [["__scopeId", "data-v-359e20b8"]]),
|
|
69
|
+
return (l2, a2) => (s(), t("div", me, [y("ul", { class: o(["mc-select-list", { "is-top-placement": i(u2) }]) }, [e2.showHeader ? (s(), t("li", he, [r(l2.$slots, "header", { isEmpty: !d2.value }, () => [i(c2) ? (s(), t("div", fe, [v(i(Z), { "model-value": i(p2), partial: i(m2), content: "Select All", "disable-validation": "", "onUpdate:modelValue": i(h2) }, null, 8, ["model-value", "partial", "onUpdate:modelValue"])])) : V("", true)], true)])) : V("", true), y("ul", ye, [r(l2.$slots, "default", {}, void 0, true), d2.value ? V("", true) : (s(), t("li", be, [r(l2.$slots, "empty", {}, () => [a2[0] || (a2[0] = y("p", { class: "mc-select-list-empty-text" }, "No results found", -1))], true)]))]), e2.showFooter ? (s(), t("li", ge, [r(l2.$slots, "footer", { isEmpty: !d2.value }, void 0, true)])) : V("", true)], 2)]));
|
|
70
|
+
} }), [["__scopeId", "data-v-359e20b8"]]), xe = () => {
|
|
71
71
|
const e2 = f("bottom-start"), l2 = a(() => "top-start" === e2.value);
|
|
72
72
|
return { placement: e2, isTopPlacement: l2 };
|
|
73
|
-
},
|
|
73
|
+
}, Oe = ["id"], _e = P(I(e({ name: oe, __name: "mc-select-plus", props: { width: { default: 320 }, height: { default: 40 }, placeholder: { default: "Please select" }, disabled: { type: Boolean, default: false }, clearable: { type: Boolean, default: false }, multiple: { type: Boolean, default: false }, maxTags: {}, search: { type: Boolean, default: false }, options: {}, showHeader: { type: Boolean, default: false }, showFooter: { type: Boolean, default: false }, modelValue: { type: [String, Number, Boolean, Array] }, inputGroupPosition: {}, disableValidation: { type: Boolean, default: false }, hideValidationIcon: { type: Boolean, default: false }, validateProp: {}, positionStrategy: { default: "absolute" }, teleportTo: {} }, emits: ["update:modelValue", "change", "focus", "blur", "expand"], setup(e2, { emit: o2 }) {
|
|
74
74
|
const n2 = e2, c2 = o2, u2 = f(false);
|
|
75
75
|
B(u2, (e3) => {
|
|
76
76
|
c2("expand", e3);
|
|
@@ -86,12 +86,12 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
86
86
|
const e4 = ((e5) => {
|
|
87
87
|
const l3 = [], a3 = (e6, t3) => {
|
|
88
88
|
M(e6) && e6.forEach((e7) => {
|
|
89
|
-
var _a2, _b2, _c, _d,
|
|
89
|
+
var _a2, _b2, _c, _d, _e2, _f, _g, _h;
|
|
90
90
|
const s2 = (_a2 = (e7 == null ? void 0 : e7.type) || {}) == null ? void 0 : _a2.name;
|
|
91
|
-
if (s2 ===
|
|
91
|
+
if (s2 === ee) {
|
|
92
92
|
const l4 = j(e7.children) || M(e7.children) || !F((_b2 = e7.children) == null ? void 0 : _b2.default) ? e7.children : (_c = e7.children) == null ? void 0 : _c.default();
|
|
93
93
|
a3(l4, (_d = e7.props) == null ? void 0 : _d.label);
|
|
94
|
-
} else s2 ===
|
|
94
|
+
} else s2 === le ? l3.push({ label: (_e2 = e7.props) == null ? void 0 : _e2.label, value: (_f = e7.props) == null ? void 0 : _f.value, disabled: (_g = e7.props) == null ? void 0 : _g.disabled, group: t3, context: (_h = e7.children) == null ? void 0 : _h.default }) : Array.isArray(e7.children) && a3(e7.children, t3);
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
return a3(e5), l3;
|
|
@@ -105,25 +105,25 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
105
105
|
})(l2.value, e3) || (e3 = l2.value);
|
|
106
106
|
}), { selectOptions: l2 };
|
|
107
107
|
})(), { selectedOptions: p2 } = ((e3) => {
|
|
108
|
-
const l2 =
|
|
108
|
+
const l2 = K("modelValue"), t2 = K("multiple");
|
|
109
109
|
return { selectedOptions: a(() => {
|
|
110
|
-
if (
|
|
111
|
-
if (t2.value && M(l2.value)) return e3.value.filter((e4) =>
|
|
110
|
+
if (H(l2.value)) return [];
|
|
111
|
+
if (t2.value && M(l2.value)) return e3.value.filter((e4) => R(l2.value, e4.value));
|
|
112
112
|
{
|
|
113
113
|
const a2 = e3.value.find((e4) => e4.value === l2.value);
|
|
114
114
|
return a2 ? [a2] : [];
|
|
115
115
|
}
|
|
116
116
|
}) };
|
|
117
117
|
})(d2), { searchValue: h2, isSearch: y2, filteredOptions: g2, filteredGroups: w2, clearSearchValue: x2 } = ((e3) => {
|
|
118
|
-
const l2 = f(""), t2 =
|
|
118
|
+
const l2 = f(""), t2 = K("search"), s2 = a(() => !!t2.value), o3 = a(() => (e3 == null ? void 0 : e3.value.length) ? A(C(e3.value, (e4) => R(L(e4.label), L(l2.value))), (e4) => ({ value: e4.value, group: e4.group })) : []), i2 = a(() => o3.value.length ? A(U(o3.value, "group"), (e4) => e4.group) : []);
|
|
119
119
|
return { searchValue: l2, isSearch: s2, filteredOptions: o3, filteredGroups: i2, clearSearchValue: () => {
|
|
120
120
|
l2.value = "";
|
|
121
121
|
} };
|
|
122
122
|
})(d2), O2 = async () => {
|
|
123
123
|
n2.search && (u2.value || (u2.value = true));
|
|
124
124
|
}, { selectRef: V2 } = (() => {
|
|
125
|
-
const e3 =
|
|
126
|
-
return
|
|
125
|
+
const e3 = K("multiple"), l2 = f(), a2 = f();
|
|
126
|
+
return J(document, "click", (t2) => {
|
|
127
127
|
var _a, _b, _c;
|
|
128
128
|
const s2 = t2.target;
|
|
129
129
|
if (e3.value) {
|
|
@@ -132,56 +132,56 @@ const te = Symbol("mc-select-plus-context"), se = "mc-select-plus", oe = { key:
|
|
|
132
132
|
x2(), u2.value = false;
|
|
133
133
|
}), { selectRef: l2, teleportListRef: a2 };
|
|
134
134
|
})(), I2 = () => {
|
|
135
|
-
u2.value = false, x2(),
|
|
136
|
-
}, { hoverOption: P2, setHoverOption: E2, handlePressArrow:
|
|
135
|
+
u2.value = false, x2(), ue2(n2.multiple ? [] : void 0);
|
|
136
|
+
}, { hoverOption: P2, setHoverOption: E2, handlePressArrow: N2 } = ((e3) => {
|
|
137
137
|
const l2 = f(), a2 = () => {
|
|
138
138
|
l2.value = void 0;
|
|
139
139
|
};
|
|
140
140
|
return { hoverOption: l2, setHoverOption: (e4) => {
|
|
141
141
|
l2.value = e4;
|
|
142
142
|
}, handlePressArrow: (t2) => {
|
|
143
|
-
var _a, _b, _c, _d,
|
|
143
|
+
var _a, _b, _c, _d, _e2;
|
|
144
144
|
if (!(e3 == null ? void 0 : e3.value.length)) return void a2();
|
|
145
145
|
if (!l2.value) return void (l2.value = (_a = e3.value[0]) == null ? void 0 : _a.value);
|
|
146
|
-
const s2 =
|
|
147
|
-
"ArrowDown" === t2.key ? l2.value = ((_b = e3.value[s2 + 1]) == null ? void 0 : _b.value) || ((_c = e3.value[0]) == null ? void 0 : _c.value) : "ArrowUp" === t2.key && (l2.value = ((_d = e3.value[s2 - 1]) == null ? void 0 : _d.value) || ((
|
|
146
|
+
const s2 = z(e3 == null ? void 0 : e3.value, (e4) => e4.value === l2.value);
|
|
147
|
+
"ArrowDown" === t2.key ? l2.value = ((_b = e3.value[s2 + 1]) == null ? void 0 : _b.value) || ((_c = e3.value[0]) == null ? void 0 : _c.value) : "ArrowUp" === t2.key && (l2.value = ((_d = e3.value[s2 - 1]) == null ? void 0 : _d.value) || ((_e2 = e3.value[e3.value.length - 1]) == null ? void 0 : _e2.value));
|
|
148
148
|
}, clearHoverOption: a2 };
|
|
149
|
-
})(g2), { width:
|
|
150
|
-
B(
|
|
149
|
+
})(g2), { width: q2, height: X2 } = Q(), Y2 = l(te, void 0), { formId: Z2, formDisabled: oe2, validateStatus: ie2, validateByTrigger: re2 } = ae({ externalDisabled: a(() => !!(Y2 == null ? void 0 : Y2.disabled.value)) });
|
|
150
|
+
B(oe2, (e3) => {
|
|
151
151
|
e3 && (u2.value = false, x2());
|
|
152
|
-
}), B(
|
|
153
|
-
|
|
152
|
+
}), B(ie2, (e3) => {
|
|
153
|
+
Y2 && Y2.setValidateStatus(e3);
|
|
154
154
|
});
|
|
155
|
-
const
|
|
155
|
+
const ne2 = () => {
|
|
156
156
|
c2("focus");
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
},
|
|
157
|
+
}, ce2 = () => {
|
|
158
|
+
re2("blur"), c2("blur");
|
|
159
|
+
}, ue2 = (e3) => {
|
|
160
160
|
c2("update:modelValue", e3), c2("change", e3);
|
|
161
|
-
}, { placement:
|
|
162
|
-
return S(
|
|
161
|
+
}, { placement: de2, isTopPlacement: pe2 } = xe();
|
|
162
|
+
return S(se, { isMulti: a(() => n2.multiple), isDisabled: a(() => oe2.value), validateStatus: ie2, selectOptions: d2, selectedOptions: p2, filteredOptions: g2, filteredGroups: w2, hoverOption: P2, isTopPlacement: pe2, deleteTag: async (e3) => {
|
|
163
163
|
if (!n2.multiple) return;
|
|
164
|
-
const l2 = A(p2.value, (e4) => e4.value), a2 =
|
|
165
|
-
|
|
164
|
+
const l2 = A(p2.value, (e4) => e4.value), a2 = G(l2, [e3]);
|
|
165
|
+
ue2(a2);
|
|
166
166
|
}, select: async (e3) => {
|
|
167
167
|
if (x2(), n2.multiple) {
|
|
168
168
|
const l2 = n2.modelValue;
|
|
169
|
-
if (M(l2) && !T(l2)) if (
|
|
170
|
-
const a2 =
|
|
171
|
-
|
|
172
|
-
} else
|
|
173
|
-
else
|
|
174
|
-
} else u2.value = false,
|
|
169
|
+
if (M(l2) && !T(l2)) if (R(l2, e3)) {
|
|
170
|
+
const a2 = G([...l2], [e3]);
|
|
171
|
+
ue2(a2);
|
|
172
|
+
} else ue2([...l2, e3]);
|
|
173
|
+
else ue2([e3]);
|
|
174
|
+
} else u2.value = false, ue2(e3);
|
|
175
175
|
}, selectAll: async (e3) => {
|
|
176
176
|
if (!n2.multiple) return;
|
|
177
177
|
x2();
|
|
178
178
|
const l2 = e3 ? d2.value.map((e4) => e4.value) : [];
|
|
179
|
-
|
|
180
|
-
}, hover: E2 }), (l2, a2) => (s(), t("div", { ref_key: "selectRef", ref: V2, id: i(
|
|
179
|
+
ue2(l2);
|
|
180
|
+
}, hover: E2 }), (l2, a2) => (s(), t("div", { ref_key: "selectRef", ref: V2, id: i(Z2), class: "mc-select", style: b({ width: i(q2) }) }, [v(i(W), { "is-show": u2.value, placement: i(de2), "onUpdate:placement": a2[2] || (a2[2] = (e3) => D(de2) ? de2.value = e3 : null), strategy: e2.positionStrategy, "teleport-to": e2.teleportTo }, { content: m(() => [v(we, { "show-header": e2.showHeader, "show-footer": e2.showFooter }, _({ default: m(() => [r(l2.$slots, "default", {}, void 0, true)]), _: 2 }, [l2.$slots["option-header"] ? { name: "header", fn: m(({ isEmpty: e3 }) => [r(l2.$slots, "option-header", { isEmpty: e3 }, void 0, true)]), key: "0" } : void 0, l2.$slots["option-footer"] ? { name: "footer", fn: m(({ isEmpty: e3 }) => [r(l2.$slots, "option-footer", { isEmpty: e3 }, void 0, true)]), key: "1" } : void 0, l2.$slots.empty ? { name: "empty", fn: m(() => [r(l2.$slots, "empty", {}, void 0, true)]), key: "2" } : void 0]), 1032, ["show-header", "show-footer"])]), default: m(() => [v(ve, { "search-value": i(h2), "onUpdate:searchValue": a2[0] || (a2[0] = (e3) => D(h2) ? h2.value = e3 : null), "is-expanded": u2.value, "onUpdate:isExpanded": a2[1] || (a2[1] = (e3) => u2.value = e3), search: i(y2), clearable: e2.clearable, placeholder: e2.placeholder, "max-tags": e2.maxTags, "hide-validation-icon": e2.hideValidationIcon, onSearch: O2, onClear: I2, "onPress:arrow": i(N2), onFocus: ne2, onBlur: ce2, style: b({ height: i(X2) }) }, _({ _: 2 }, [l2.$slots.placeholder ? { name: "placeholder", fn: m(({ placeholder: e3, isDisabled: a3 }) => [r(l2.$slots, "placeholder", { placeholder: e3, isDisabled: a3 }, void 0, true)]), key: "0" } : void 0, l2.$slots["selected-content"] ? { name: "selected-content", fn: m(({ selectedOption: e3, selectedOptionLabel: a3, isDisabled: t2 }) => [r(l2.$slots, "selected-content", { selectedOption: e3, selectedOptionLabel: a3, isDisabled: t2 }, void 0, true)]), key: "1" } : void 0]), 1032, ["search-value", "is-expanded", "search", "clearable", "placeholder", "max-tags", "hide-validation-icon", "onPress:arrow", "style"])]), _: 3 }, 8, ["is-show", "placement", "strategy", "teleport-to"])], 12, Oe));
|
|
181
181
|
} }), [["__scopeId", "data-v-f0fe4352"]]));
|
|
182
182
|
export {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
_e as M,
|
|
184
|
+
se as a,
|
|
185
|
+
oe as b,
|
|
186
|
+
xe as u
|
|
187
187
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, u as l } from "./utils-dWwt4JKv.js";
|
|
2
2
|
import { defineComponent as t, createElementBlock as a, openBlock as s, renderSlot as i, createCommentVNode as o, createElementVNode as c, toDisplayString as n, createVNode as p, unref as h, useSlots as d, computed as m, createBlock as b, createSlots as u, withCtx as v, normalizeStyle as r, normalizeClass as w, withKeys as y, withModifiers as f } from "vue";
|
|
3
3
|
import { M as x } from "./mc-tooltip-BlsZG-T8.js";
|
|
4
|
-
import { u as $ } from "./mc-form-
|
|
4
|
+
import { u as $ } from "./mc-form-DCKlCcDs.js";
|
|
5
5
|
const T = "mc-switch", k = "mc-switch-label", I = { class: "mc-switch-label-wrapper" }, _ = { class: "mc-switch-label" }, g = { class: "mc-switch-help" }, V = e(t({ name: k, __name: "mc-switch-label", props: { label: {}, helpText: {}, helpIcon: { default: "Info" } }, setup: (e2) => (l2, t2) => (s(), a("div", I, [e2.label || l2.$slots.label ? i(l2.$slots, "label", { key: 0 }, () => [c("span", _, n(e2.label), 1)], true) : o("", true), e2.helpText || l2.$slots.help ? i(l2.$slots, "help", { key: 1 }, () => [c("div", g, [p(h(x), { "icon-name": e2.helpIcon, content: e2.helpText, "icon-size": 22 }, null, 8, ["icon-name", "content"])])], true) : o("", true)])) }), [["__scopeId", "data-v-e1ce5008"]]), B = { class: "mc-switch" }, j = ["id", "disabled", "value", "onKeypress"], z = { class: "mc-switch-inner" }, K = { class: "mc-switch-inner-text" }, M = { class: "mc-switch-inner-text" }, P = l(e(t({ name: T, __name: "mc-switch", props: { modelValue: { type: Boolean, default: false }, width: {}, height: {}, activeText: {}, inactiveText: {}, disabled: { type: Boolean, default: false }, size: { default: "medium" }, label: {}, labelPosition: { default: "right" }, helpIcon: { default: "Info" }, helpText: {}, disableValidation: { type: Boolean }, hideValidationIcon: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: l2 }) {
|
|
6
6
|
const t2 = e2, p2 = l2, x2 = d(), { formId: T2, formDisabled: k2, validateStyle: I2, validateByTrigger: _2 } = $(), g2 = m(() => t2.modelValue), P2 = async () => {
|
|
7
7
|
k2.value || (p2("update:modelValue", !t2.modelValue), p2("change", !t2.modelValue), _2("input"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as e, computed as a, createElementBlock as l, createCommentVNode as t, openBlock as n, normalizeClass as o, renderSlot as i, Fragment as s, createTextVNode as c, toDisplayString as r, useSlots as u, ref as d, normalizeStyle as p, createElementVNode as g, renderList as v, createVNode as m, unref as h, createBlock as f, createSlots as b, withCtx as _, mergeProps as y, watch as w, onMounted as k, nextTick as S, toRefs as x, normalizeProps as C, guardReactiveProps as R } from "vue";
|
|
2
|
-
import { M as z } from "./mc-checkbox-
|
|
2
|
+
import { M as z } from "./mc-checkbox-BN4P6-DK.js";
|
|
3
3
|
import { _ as I, u as P } from "./utils-dWwt4JKv.js";
|
|
4
4
|
import { m as M } from "./mc-icon-CnpccbFi.js";
|
|
5
5
|
const H = ["rowspan", "colspan"], T = I(e({ __name: "mc-table-cell", props: { row: {}, column: {}, rowIndex: {}, columnIndex: {}, pagination: {}, spanMethod: { type: Function } }, setup(e2) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, u as a } from "./utils-dWwt4JKv.js";
|
|
2
2
|
import { defineComponent as t, ref as l, useSlots as o, computed as r, createElementBlock as d, openBlock as n, normalizeStyle as s, normalizeClass as u, unref as i, createElementVNode as m, renderSlot as c, createCommentVNode as h, toDisplayString as p, nextTick as f } from "vue";
|
|
3
3
|
import { useWidthHeight as g, useFocus as x } from "@mc-plus/hooks";
|
|
4
|
-
import { u as v } from "./mc-form-
|
|
4
|
+
import { u as v } from "./mc-form-DCKlCcDs.js";
|
|
5
5
|
const y = "mc-textarea", L = ["value", "id", "disabled", "maxlength", "placeholder"], w = { class: "mc-textarea-count" }, b = a(e(t({ name: y, __name: "mc-textarea", props: { modelValue: { default: "" }, placeholder: { default: "Please input" }, disabled: { type: Boolean, default: false }, showCount: { type: Boolean, default: true }, width: { default: "100%" }, height: { default: 88 }, resize: { default: "vertical" }, maxLength: { default: 255 }, disableValidation: { type: Boolean }, hideValidationIcon: { type: Boolean } }, emits: ["update:modelValue", "change", "focus", "blur"], setup(e2, { emit: a2 }) {
|
|
6
6
|
const t2 = e2, y2 = a2, { width: b2, height: B } = g(), V = l(), { wrapperRef: _, isFocused: k, handleFocus: I, handleBlur: z } = x(V), { formId: F, validateStyle: R, formDisabled: $, validateByTrigger: j } = v(), C = async (e3) => {
|
|
7
7
|
let a3 = e3.target.value;
|
|
@@ -4,8 +4,8 @@ import { useProp as z, useDragover as x, useWidthHeight as $ } from "@mc-plus/ho
|
|
|
4
4
|
import { M as b } from "./mc-icon-CnpccbFi.js";
|
|
5
5
|
import { M as C } from "./mc-success-icon-BgQB9Rmp.js";
|
|
6
6
|
import { map as S, includes as k } from "lodash-es";
|
|
7
|
-
import { M as D } from "./mc-file-list-
|
|
8
|
-
import { u as M } from "./mc-form-
|
|
7
|
+
import { M as D } from "./mc-file-list-CHTB72Ds.js";
|
|
8
|
+
import { u as M } from "./mc-form-DCKlCcDs.js";
|
|
9
9
|
import { t as U } from "./mc-toast-BNRX1zn4.js";
|
|
10
10
|
const B = (e2) => parseFloat(e2).toString(), F = (e2, l2 = 2) => e2 < 1024 ? `${e2} B` : e2 < 1048576 ? `${B((e2 / 1024).toFixed(l2))} KB` : e2 < 1073741824 ? `${B((e2 / 1048576).toFixed(l2))} MB` : `${B((e2 / 1073741824).toFixed(l2))} GB`, T = (e2) => {
|
|
11
11
|
if (!e2) return "--";
|