mc-plus 1.0.65 → 1.0.66
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 +3 -3
- package/dist/es/mc-progress-bar-JF0Frass.js +29 -0
- package/dist/es/{mc-select-D4OYQtvg.js → mc-select-BMYoc5oT.js} +81 -81
- package/dist/es/mc-upload-Cl3mW0Hm.js +130 -0
- package/dist/es/theme/mc-progress-bar.css +1 -1
- package/dist/es/theme/mc-select.css +1 -1
- package/dist/es/theme/mc-upload.css +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components/mc-progress-bar/index.d.ts +3 -0
- package/dist/types/components/mc-progress-bar/types.d.ts +1 -0
- package/dist/types/components/mc-select-plus/index.d.ts +3 -0
- package/dist/types/components/mc-select-plus/types/mc-select.d.ts +1 -0
- package/dist/types/components/mc-upload/hooks/useLang.d.ts +1 -0
- package/dist/types/components/mc-upload/index.d.ts +11 -1
- package/dist/types/components/mc-upload/lang/en.d.ts +1 -0
- package/dist/types/components/mc-upload/lang/zh.d.ts +1 -0
- package/dist/types/components/mc-upload/types/mc-upload-dropzone.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 +1 -1
- package/dist/es/mc-progress-bar-GGuMUhLo.js +0 -29
- package/dist/es/mc-upload-D8-d7Xhv.js +0 -125
package/dist/es/index.js
CHANGED
|
@@ -18,11 +18,11 @@ import { a as A } from "./mc-loading-C311OVMI.js";
|
|
|
18
18
|
import { M as C } from "./mc-modal-header-CMNRK0Rb.js";
|
|
19
19
|
import { M as S } from "./mc-otp-BE08aHEv.js";
|
|
20
20
|
import { a as T } from "./mc-popper-B8qMu2va.js";
|
|
21
|
-
import { a as q } from "./mc-progress-bar-
|
|
21
|
+
import { a as q } from "./mc-progress-bar-JF0Frass.js";
|
|
22
22
|
import { M as z, a as B } from "./mc-radio-BPBdgFH4.js";
|
|
23
23
|
import { M as I } from "./mc-reset-hnnz6SoG.js";
|
|
24
24
|
import { M as P } from "./mc-secondary-menu-2eW8se9v.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-
|
|
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-BMYoc5oT.js";
|
|
26
26
|
import { M as L } from "./mc-status-Bbu0MyzD.js";
|
|
27
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-DKfRXGSk.js";
|
|
28
28
|
import { a as X } from "./mc-success-icon-Cj-5Hgzy.js";
|
|
@@ -35,7 +35,7 @@ import { M as rs, a as ts } from "./mc-title-C_lOz0mp.js";
|
|
|
35
35
|
import { M as cs } from "./mc-toast-DB9Y1bvS.js";
|
|
36
36
|
import { t } from "./mc-toast-DB9Y1bvS.js";
|
|
37
37
|
import { M as ps } from "./mc-tooltip-4mxkVOGx.js";
|
|
38
|
-
import { M as is, a as fs, b as es } from "./mc-upload-
|
|
38
|
+
import { M as is, a as fs, b as es } from "./mc-upload-Cl3mW0Hm.js";
|
|
39
39
|
const js = [o, r, c, p, i, j, M, l, b, n, is, d, x, g, h, y, w, k, v, A, C, S, T, q, z, B, 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);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as e, ref as r, watchEffect as s, computed as a, watch as t, useSlots as o, createElementBlock as p, openBlock as m, normalizeStyle as n, unref as i, createElementVNode as l, createCommentVNode as c, renderSlot as u, toDisplayString as d } from "vue";
|
|
2
|
+
import { b as g } from "./hooks-DghKpOue.js";
|
|
3
|
+
import { x as h } from "./vendor-CExPGg1i.js";
|
|
4
|
+
import { _ as f, w as v } from "./utils-BDbMLK9w.js";
|
|
5
|
+
const k = { key: 0, class: "mc-progress-bar-shimmer" }, y = { key: 0, class: "mc-progress-bar-remarks" }, b = f(e({ name: "McProgressBar", __name: "mc-progress-bar", props: { percentage: { default: 0 }, height: { default: "4px" }, width: { default: "100%" }, remarks: {}, showPercentage: { type: Boolean, default: false }, transitionDuration: { default: 300 }, shimmer: { type: Boolean, default: false } }, emits: ["update:percentage", "complete"], setup(e2, { expose: f2, emit: v2 }) {
|
|
6
|
+
const b2 = e2, w2 = v2, { width: _, height: P } = g(), x = r();
|
|
7
|
+
s(() => {
|
|
8
|
+
x.value && x.value.style.setProperty("--border-radius", P.value);
|
|
9
|
+
});
|
|
10
|
+
const B = a(() => {
|
|
11
|
+
const e3 = b2.percentage / 100;
|
|
12
|
+
return e3 > 1 ? 1 : e3 < 0 ? 0 : e3;
|
|
13
|
+
});
|
|
14
|
+
t(() => b2.percentage, (e3) => {
|
|
15
|
+
e3 >= 100 && w2("complete");
|
|
16
|
+
}, { immediate: true });
|
|
17
|
+
const $ = o(), j = a(() => b2.showPercentage || !!b2.remarks || !!$.remarks);
|
|
18
|
+
return f2({ updatePercentage: (e3) => {
|
|
19
|
+
w2("update:percentage", e3);
|
|
20
|
+
}, complete: () => {
|
|
21
|
+
w2("update:percentage", 100), w2("complete");
|
|
22
|
+
}, reset: () => {
|
|
23
|
+
w2("update:percentage", 0);
|
|
24
|
+
} }), (e3, r2) => (m(), p("div", { class: "mc-progress-bar", style: n({ width: i(_) }) }, [l("div", { ref_key: "progressBarRef", ref: x, class: "mc-progress-bar-wrapper", style: n({ width: i(_), height: i(P) }) }, [l("div", { class: "mc-progress-bar-inner", style: n({ transform: `scaleX(${B.value})`, transitionDuration: `${e3.transitionDuration}ms` }) }, null, 4), e3.shimmer ? (m(), p("i", k)) : c("", true)], 4), j.value ? (m(), p("div", y, [u(e3.$slots, "remarks", {}, () => [l("span", null, d(e3.remarks || `${i(h)(100 * B.value)}%`), 1)], true)])) : c("", true)], 4));
|
|
25
|
+
} }), [["__scopeId", "data-v-83b22259"]]), w = v(b);
|
|
26
|
+
export {
|
|
27
|
+
b as M,
|
|
28
|
+
w as a
|
|
29
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as e, ref as l, computed as a, watch as t, provide as s, createElementBlock as o, openBlock as u, normalizeStyle as c, normalizeClass as n, unref as
|
|
1
|
+
import { defineComponent as e, ref as l, computed as a, watch as t, provide as s, createElementBlock as o, openBlock as u, normalizeStyle as c, normalizeClass as n, unref as i, createElementVNode as r, createVNode as d, createCommentVNode as v, createBlock as p, resolveDynamicComponent as m, Fragment as h, renderList as f, withCtx as g, createTextVNode as y, toDisplayString as b, withDirectives as w, vModelText as _, Transition as V, renderSlot as k, vShow as x, inject as O, useSlots as S, onMounted as B, onBeforeUnmount as A, h as C, toRefs as M, useAttrs as R, toValue as I, getCurrentInstance as j, watchEffect as P, isRef as $, withKeys as D, withModifiers as z, nextTick as F } from "vue";
|
|
2
2
|
import { u as G, h as H, e as E, b as N, f as U } from "./hooks-DghKpOue.js";
|
|
3
3
|
import { a as T, u as K } from "./mc-form-Bf0120BQ.js";
|
|
4
4
|
import { M as W } from "./mc-icon-B_dAlj4r.js";
|
|
@@ -7,11 +7,11 @@ import { _ as q } from "./mc-tag-jYhZ-J2S.js";
|
|
|
7
7
|
import { M as J } from "./mc-checkbox-iP5RHA6x.js";
|
|
8
8
|
import { _ as Q } from "./mc-title-C_lOz0mp.js";
|
|
9
9
|
import { M as X } from "./mc-footer-DjlFAv9f.js";
|
|
10
|
-
import { c as Y, z as Z, r as ee, f as le, m as ae, b as te, a as se, y as oe, u as ue, A as ce, B as ne, i as
|
|
10
|
+
import { c as Y, z as Z, r as ee, f as le, m as ae, b as te, a as se, y as oe, u as ue, A as ce, B as ne, i as ie, C as re, D as de, E as ve } from "./vendor-CExPGg1i.js";
|
|
11
11
|
import { _ as pe, w as me } from "./utils-BDbMLK9w.js";
|
|
12
12
|
import { I as he, u as fe } from "./mc-input-C5MU4U2V.js";
|
|
13
13
|
import { M as ge } from "./mc-popper-B8qMu2va.js";
|
|
14
|
-
const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { key: 0, class: "mc-select-selected-content" }, _e = ["placeholder", "readonly", "disabled"],
|
|
14
|
+
const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { key: 0, class: "mc-select-selected-content" }, _e = ["placeholder", "readonly", "disabled"], Ve = { class: "mc-select-dropdown-header-content" }, ke = { class: "mc-select-dropdown-content" }, xe = { class: "mc-select-dropdown" }, Oe = { key: 0, class: "mc-select-no-data" }, Se = pe(e({ name: "McSelect", __name: "mc-select", props: { modelValue: {}, placeholder: { default: "Please select" }, disabled: { type: Boolean }, multiple: { type: Boolean, default: false }, width: {}, height: {}, search: { type: Boolean }, allowReset: { type: Boolean, default: true }, allowSelectAll: { type: Boolean, default: true } }, emits: ["update:modelValue", "change", "blur", "focus", "reset"], setup(e2, { emit: O2 }) {
|
|
15
15
|
const S2 = e2, B2 = O2, A2 = l(), C2 = l(), M2 = l(), R2 = a(() => S2.multiple), I2 = (e3) => R2.value && Array.isArray(e3), j2 = l([]), P2 = a(() => Y(Be2.value) ? j2.value : j2.value.filter((e3) => Z(ee(e3.label ?? e3.value)).includes(Z(Be2.value)))), { wrapperRef: $2, isFocused: D2, handleFocus: z2, handleBlur: F2 } = G(A2, { afterBlur() {
|
|
16
16
|
de2 == null ? void 0 : de2.validate("blur");
|
|
17
17
|
} }), E2 = a(() => 0 === P2.value.length), N2 = a(() => R2.value && S2.allowSelectAll && !E2.value), U2 = a(() => R2.value && S2.allowReset && !E2.value), K2 = l(false), se2 = () => {
|
|
@@ -23,7 +23,7 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
23
23
|
const ce2 = a(() => le(j2.value, (e3) => te(ue2.value, e3.value))), ne2 = a(() => {
|
|
24
24
|
var _a;
|
|
25
25
|
return R2.value ? void 0 : (_a = ce2.value) == null ? void 0 : _a[0];
|
|
26
|
-
}),
|
|
26
|
+
}), ie2 = a(() => R2.value ? ae(ce2.value, (e3) => ({ label: e3.label ?? "", value: e3.value })) : []), re2 = a(() => D2.value || Re2.value ? "minimal" : "bold"), { formItem: de2 } = T(), ve2 = a(() => {
|
|
27
27
|
switch (de2 == null ? void 0 : de2.validateStatus) {
|
|
28
28
|
case "success":
|
|
29
29
|
return "success";
|
|
@@ -69,43 +69,43 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
69
69
|
j2.value = j2.value.filter((l2) => l2.value !== e3.value);
|
|
70
70
|
}, addOption: (e3) => {
|
|
71
71
|
j2.value.push(e3);
|
|
72
|
-
} }), (e3, l2) => (u(), o("div", { class: n(["mc-select", [K2.value && !e3.disabled ? "mc-select-expand" : "mc-select-collapse", { "mc-select-disabled": e3.disabled, "mc-input-focused":
|
|
72
|
+
} }), (e3, l2) => (u(), o("div", { class: n(["mc-select", [K2.value && !e3.disabled ? "mc-select-expand" : "mc-select-collapse", { "mc-select-disabled": e3.disabled, "mc-input-focused": i(D2) && e3.search, [`mc-select--${ve2.value}`]: ve2.value, "mc-select--hover": Re2.value }]]), ref_key: "wrapperRef", ref: $2, style: c(Me2.value), onMouseenter: l2[4] || (l2[4] = (e4) => Re2.value = true), onMouseleave: l2[5] || (l2[5] = (e4) => Re2.value = false) }, [r("div", { class: "mc-select-trigger", onClick: se2, ref_key: "triggerRef", ref: M2 }, [ce2.value.length && !Ce2.value ? (u(), o("div", we, [R2.value ? (u(), o("div", { key: 1, class: "mc-select-multi-wrapper", ref_key: "tagsWrapperRef", ref: C2 }, [(u(true), o(h, null, f(ie2.value, (l3) => (u(), p(q, { key: l3.value, size: "x-small", type: "selectable", emphasis: re2.value, disabled: e3.disabled, onDelete: (e4) => ((e5) => {
|
|
73
73
|
if (I2(S2.modelValue)) {
|
|
74
74
|
const l4 = [...S2.modelValue];
|
|
75
75
|
l4.splice(l4.indexOf(e5.value), 1), B2("update:modelValue", l4);
|
|
76
76
|
}
|
|
77
|
-
})(l3) }, { default: g(() => [y(b(l3.label), 1)]), _: 2 }, 1032, ["emphasis", "disabled", "onDelete"]))), 128))], 512)) : (u(), p(m(ne2.value._vnode), { key: ne2.value.value }))])) : v("", true),
|
|
77
|
+
})(l3) }, { default: g(() => [y(b(l3.label), 1)]), _: 2 }, 1032, ["emphasis", "disabled", "onDelete"]))), 128))], 512)) : (u(), p(m(ne2.value._vnode), { key: ne2.value.value }))])) : v("", true), r("div", { class: n(["mc-select-input-wrapper", { "mc-select-input-wrapper-search": Ce2.value || Se2.value }]) }, [w(r("input", { class: n(["mc-select-input", { "mc-select-input-readonly": !e3.search }]), ref_key: "inputRef", ref: A2, type: "text", placeholder: Se2.value ? e3.placeholder : "", "onUpdate:modelValue": l2[0] || (l2[0] = (e4) => Be2.value = e4), onInput: Ae2, onFocus: l2[1] || (l2[1] = (...e4) => i(z2) && i(z2)(...e4)), onBlur: l2[2] || (l2[2] = (...e4) => i(F2) && i(F2)(...e4)), readonly: !e3.search, disabled: e3.disabled }, null, 42, _e), [[_, Be2.value]])], 2), he2.value ? (u(), o("div", { key: 1, class: n(["mc-select__status", [pe2.value ? "mc-select__status--error" : "mc-select__status--success"]]) }, [d(W, { name: pe2.value ? "Reject_02" : "Accept_02", size: 24 }, null, 8, ["name"])], 2)) : v("", true), r("div", { class: n(["mc-select-icon-wrapper", { "mc-select-icon-wrapper-expand": K2.value && !e3.disabled }]) }, [d(W, { name: "Down-Chevron", class: "mc-select-icon" })], 2)], 512), d(V, { name: "mc-select-dropdown-transition" }, { default: g(() => [w(r("div", { class: "mc-select-dropdown-wrapper", style: c({ paddingTop: N2.value ? "40px" : "0", paddingBottom: U2.value ? "48px" : "0" }) }, [N2.value ? (u(), p(Q, { key: 0, class: "mc-select-dropdown-header", "show-tool-bar": false, height: "40px" }, { default: g(() => [r("div", Ve, [d(J, { modelValue: Ie2.value, "onUpdate:modelValue": l2[3] || (l2[3] = (e4) => Ie2.value = e4), content: "Select All", "form-validate": false, partial: je2.value, onChange: Pe2 }, null, 8, ["modelValue", "partial"])])]), _: 1 })) : v("", true), r("div", ke, [r("div", xe, [k(e3.$slots, "default", {}, void 0, true), E2.value ? (u(), o("div", Oe, [k(e3.$slots, "empty", {}, () => [l2[6] || (l2[6] = y("No data"))], true)])) : v("", true)])]), U2.value ? (u(), p(X, { key: 1, class: "mc-select-dropdown-footer" }, { "right-button-group": g(() => [d(L, { type: "link", size: "small", onClick: ge2 }, { default: g(() => l2[7] || (l2[7] = [y(" Reset ")])), _: 1, __: [7] }), d(L, { type: "plain", size: "small", onClick: be2 }, { default: g(() => l2[8] || (l2[8] = [y(" Apply ")])), _: 1, __: [8] })]), _: 1 })) : v("", true)], 4), [[x, K2.value && !e3.disabled]])]), _: 3 })], 38));
|
|
78
78
|
} }), [["__scopeId", "data-v-5b70ca55"]]), Be = { class: "mc-select-option-content" }, Ae = pe(e({ name: "McSelectOption", __name: "mc-select-option", props: { value: {}, label: {}, width: {}, height: {}, _group: {}, _vnode: {} }, setup(e2, { expose: t2 }) {
|
|
79
|
-
const s2 = l(),
|
|
80
|
-
d2 == null ? void 0 : d2.handleSelect(w2(
|
|
79
|
+
const s2 = l(), i2 = e2, d2 = O(ye, void 0), p2 = O(be, void 0), m2 = a(() => d2 == null ? void 0 : d2.selectValues.value.includes(i2.value)), h2 = a(() => !!(d2 == null ? void 0 : d2.filterOptions.value.some((e3) => e3.value === i2.value))), f2 = S(), g2 = () => {
|
|
80
|
+
d2 == null ? void 0 : d2.handleSelect(w2(i2));
|
|
81
81
|
};
|
|
82
82
|
B(() => {
|
|
83
|
-
d2 == null ? void 0 : d2.addOption(w2(
|
|
83
|
+
d2 == null ? void 0 : d2.addOption(w2(i2));
|
|
84
84
|
}), A(() => {
|
|
85
|
-
d2 == null ? void 0 : d2.removeOption(w2(
|
|
85
|
+
d2 == null ? void 0 : d2.removeOption(w2(i2));
|
|
86
86
|
});
|
|
87
87
|
const w2 = (e3) => {
|
|
88
88
|
var _a;
|
|
89
89
|
return { ...e3, _group: p2 == null ? void 0 : p2.groupName, _vnode: C("div", { class: "mc-select-option-content" }, (_a = f2.default) == null ? void 0 : _a.call(f2, {})) };
|
|
90
|
-
}, _2 = a(() => ({ width:
|
|
91
|
-
return t2({ isShow: h2.value, ref: s2 }), (e3, l2) => h2.value ? (u(), o("div", { key: 0, class: n(["mc-select-dropdown-item mc-select-option", { "mc-select-option-icon-active": m2.value }]), onClick: g2, ref_key: "_ref", ref: s2, style: c(_2.value) }, [
|
|
90
|
+
}, _2 = a(() => ({ width: i2.width ?? void 0, height: i2.height ?? void 0 }));
|
|
91
|
+
return t2({ isShow: h2.value, ref: s2 }), (e3, l2) => h2.value ? (u(), o("div", { key: 0, class: n(["mc-select-dropdown-item mc-select-option", { "mc-select-option-icon-active": m2.value }]), onClick: g2, ref_key: "_ref", ref: s2, style: c(_2.value) }, [r("div", Be, [k(e3.$slots, "default", {}, () => [y(b(e3.label), 1)], true)])], 6)) : v("", true);
|
|
92
92
|
} }), [["__scopeId", "data-v-888970f9"]]), Ce = { class: "mc-select-group" }, Me = { class: "mc-select-group-content" }, Re = pe(e({ name: "McSelectGroup", __name: "mc-select-group", props: { label: {}, width: {}, height: {} }, setup(e2) {
|
|
93
93
|
const l2 = e2, t2 = O(ye, void 0);
|
|
94
94
|
s(be, { groupName: l2.label });
|
|
95
|
-
const n2 = a(() => t2 == null ? void 0 : t2.filterOptions.value.some((e3) => e3._group === l2.label)),
|
|
95
|
+
const n2 = a(() => t2 == null ? void 0 : t2.filterOptions.value.some((e3) => e3._group === l2.label)), i2 = M(R()), d2 = a(() => {
|
|
96
96
|
var _a, _b;
|
|
97
|
-
return { ...(_b = (_a = I(
|
|
97
|
+
return { ...(_b = (_a = I(i2)) == null ? void 0 : _a.style) == null ? void 0 : _b.value, width: l2.width ?? void 0, height: l2.height ?? void 0 };
|
|
98
98
|
});
|
|
99
|
-
return (e3, l3) => w((u(), o("div", Ce, [
|
|
100
|
-
} }), [["__scopeId", "data-v-d11c5ad5"]]), Ie = me(Se), je = me(Ae), Pe = me(Re), $e = "McSelectGroupPlus", De = "McSelectOptionPlus", ze = Symbol("SelectPlusContext"), Fe = ["id", "placeholder", "readonly", "disabled", "onKeydown"], Ge = { key: 0, class: "mc-select-multi-options-wrapper" }, He = { key: 1, class: "mc-select-selected-content-wrapper" }, Ee = { key: 1, class: "mc-select-placeholder" }, Ne = { key: 0, class: "mc-select-status-icon-wrapper" }, Ue = { key: 0, class: "mc-select-dropdown-header-content" }, Te = { key: 0, class: "mc-select-empty" }, Ke = pe(e({ name: "McSelectPlus", __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 }, search: { type: Boolean, default: false }, options: {}, showHeader: { type: Boolean, default: false }, showFooter: { type: Boolean, default: false }, modelValue: { type: [String, Number, Boolean, Array] }, placement: { default: "bottom-start" }, inputGroupPosition: {}, disableValidation: { type: Boolean, default: false } }, emits: ["update:modelValue", "change", "focus", "blur", "expand"], setup(e2, { emit:
|
|
101
|
-
const
|
|
99
|
+
return (e3, l3) => w((u(), o("div", Ce, [r("div", { class: "mc-select-group-label", style: c(d2.value) }, b(e3.label), 5), r("div", Me, [k(e3.$slots, "default", {}, void 0, true)])], 512)), [[x, n2.value]]);
|
|
100
|
+
} }), [["__scopeId", "data-v-d11c5ad5"]]), Ie = me(Se), je = me(Ae), Pe = me(Re), $e = "McSelectGroupPlus", De = "McSelectOptionPlus", ze = Symbol("SelectPlusContext"), Fe = ["id", "placeholder", "readonly", "disabled", "onKeydown"], Ge = { key: 0, class: "mc-select-multi-options-wrapper" }, He = { key: 1, class: "mc-select-selected-content-wrapper" }, Ee = { key: 1, class: "mc-select-placeholder" }, Ne = { key: 0, class: "mc-select-status-icon-wrapper" }, Ue = { key: 0, class: "mc-select-dropdown-header-content" }, Te = { key: 0, class: "mc-select-empty" }, Ke = pe(e({ name: "McSelectPlus", __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 }, search: { type: Boolean, default: false }, options: {}, showHeader: { type: Boolean, default: false }, showFooter: { type: Boolean, default: false }, modelValue: { type: [String, Number, Boolean, Array] }, placement: { default: "bottom-start" }, inputGroupPosition: {}, disableValidation: { type: Boolean, default: false }, hideValidationIcon: { type: Boolean, default: false } }, emits: ["update:modelValue", "change", "focus", "blur", "expand"], setup(e2, { emit: V2 }) {
|
|
101
|
+
const S2 = e2, A2 = V2, M2 = a(() => S2.multiple), R2 = l(), { wrapperRef: I2, isFocused: T2, handleFocus: Y2, handleBlur: Z2 } = G(R2), { isHovering: ee2 } = U(I2), { selectRef: pe2, width: me2, height: ye2 } = (() => {
|
|
102
102
|
const e3 = l(), { width: a2, height: s2 } = N(), o2 = () => {
|
|
103
103
|
e3.value && (e3.value.style.setProperty("--mc-select-width", a2.value), e3.value.style.setProperty("--mc-select-height", s2.value));
|
|
104
104
|
};
|
|
105
105
|
return B(() => {
|
|
106
106
|
o2();
|
|
107
107
|
}), t(() => a2.value, () => o2()), { selectRef: e3, width: a2, height: s2, setWidth: o2 };
|
|
108
|
-
})(), { selectOptions:
|
|
108
|
+
})(), { selectOptions: be2 } = (() => {
|
|
109
109
|
let e3 = [];
|
|
110
110
|
const a2 = l([]), t2 = j().proxy;
|
|
111
111
|
return P(() => {
|
|
@@ -114,11 +114,11 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
114
114
|
if (l2.length) {
|
|
115
115
|
const e4 = ((e5) => {
|
|
116
116
|
const l3 = [], a3 = (e6, t3) => {
|
|
117
|
-
|
|
117
|
+
ie(e6) && e6.forEach((e7) => {
|
|
118
118
|
var _a2, _b2, _c, _d, _e3, _f, _g;
|
|
119
119
|
const s2 = (_a2 = (e7 == null ? void 0 : e7.type) || {}) == null ? void 0 : _a2.name;
|
|
120
120
|
if (s2 === $e) {
|
|
121
|
-
const l4 =
|
|
121
|
+
const l4 = re(e7.children) || ie(e7.children) || !se((_b2 = e7.children) == null ? void 0 : _b2.default) ? e7.children : (_c = e7.children) == null ? void 0 : _c.default();
|
|
122
122
|
a3(l4, (_d = e7.props) == null ? void 0 : _d.label);
|
|
123
123
|
} else s2 === De ? l3.push({ label: (_e3 = e7.props) == null ? void 0 : _e3.label, value: (_f = e7.props) == null ? void 0 : _f.value, group: t3, context: (_g = e7.children) == null ? void 0 : _g.default }) : Array.isArray(e7.children) && a3(e7.children, t3);
|
|
124
124
|
});
|
|
@@ -133,12 +133,12 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
133
133
|
return true;
|
|
134
134
|
})(a2.value, e3) || (e3 = a2.value);
|
|
135
135
|
}), { selectOptions: a2 };
|
|
136
|
-
})(), { searchValue:
|
|
136
|
+
})(), { searchValue: we2, isSearch: _e2, hasSearchValue: Ve2, filteredOptions: ke2, filteredGroups: xe2, clearSearchValue: Oe2 } = ((e3) => {
|
|
137
137
|
const t2 = l(""), s2 = E("search"), o2 = a(() => !!s2.value), u2 = a(() => o2.value && !ue(t2.value)), c2 = a(() => (e3 == null ? void 0 : e3.value.length) ? ae(le(e3.value, (e4) => te(ne(e4.label), ne(t2.value))), (e4) => ({ value: e4.value, group: e4.group })) : []), n2 = a(() => c2.value.length ? ae(ce(c2.value, "group"), (e4) => e4.group) : []);
|
|
138
138
|
return { searchValue: t2, isSearch: o2, hasSearchValue: u2, filteredOptions: c2, filteredGroups: n2, clearSearchValue: () => {
|
|
139
139
|
t2.value = "";
|
|
140
140
|
} };
|
|
141
|
-
})(
|
|
141
|
+
})(be2), { hoverOption: Se2, setHoverOption: Be2, handlePressArrow: Ae2, clearHoverOption: Ce2 } = ((e3) => {
|
|
142
142
|
const a2 = l(), t2 = () => {
|
|
143
143
|
a2.value = void 0;
|
|
144
144
|
};
|
|
@@ -151,22 +151,22 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
151
151
|
const s2 = oe(e3 == null ? void 0 : e3.value, (e4) => e4.value === a2.value);
|
|
152
152
|
"ArrowDown" === l2.key ? a2.value = ((_b = e3.value[s2 + 1]) == null ? void 0 : _b.value) || ((_c = e3.value[0]) == null ? void 0 : _c.value) : "ArrowUp" === l2.key && (a2.value = ((_d = e3.value[s2 - 1]) == null ? void 0 : _d.value) || ((_e3 = e3.value[e3.value.length - 1]) == null ? void 0 : _e3.value));
|
|
153
153
|
}, clearHoverOption: t2 };
|
|
154
|
-
})(ke2), { formId:
|
|
154
|
+
})(ke2), { formId: Me2, formItem: Re2, formDisabled: Ie2, validateStatus: je2, validateStyle: Pe2, statusIcon: Ke2 } = K(), { isDisabled: We2 } = ((e3, l2) => {
|
|
155
155
|
const s2 = O(he, void 0), o2 = a(() => !!e3.value || !!(s2 == null ? void 0 : s2.disabled.value));
|
|
156
156
|
return t(o2, (e4) => {
|
|
157
157
|
e4 && se(l2) && l2();
|
|
158
158
|
}), { isDisabled: o2 };
|
|
159
|
-
})(
|
|
160
|
-
|
|
161
|
-
}), { isExpanded:
|
|
162
|
-
const s2 = l(false), o2 = j(), { emit: u2 } = o2, c2 = l(), n2 = O(he, void 0),
|
|
159
|
+
})(Ie2, () => {
|
|
160
|
+
Qe2(false), Oe2();
|
|
161
|
+
}), { isExpanded: Le2, popperRef: qe2, popperOptions: Je2, toggleExpand: Qe2 } = ((e3) => {
|
|
162
|
+
const s2 = l(false), o2 = j(), { emit: u2 } = o2, c2 = l(), n2 = O(he, void 0), i2 = E("inputGroupPosition"), r2 = { modifiers: [{ name: "offset", options: { offset: [a(() => n2 && i2.value ? "prefix" === i2.value ? -1 : "suffix" === i2.value ? 1 : 0 : 0).value, 0] } }] };
|
|
163
163
|
return t(s2, (e4) => {
|
|
164
164
|
var _a, _b;
|
|
165
165
|
e4 ? (_a = c2.value) == null ? void 0 : _a.show() : (_b = c2.value) == null ? void 0 : _b.hide();
|
|
166
|
-
}), { isExpanded: s2, popperRef: c2, popperOptions:
|
|
166
|
+
}), { isExpanded: s2, popperRef: c2, popperOptions: r2, toggleExpand: (l2) => {
|
|
167
167
|
e3.value ? s2.value = false : s2.value = l2, u2("expand", l2);
|
|
168
168
|
} };
|
|
169
|
-
})(
|
|
169
|
+
})(We2), { showClearIcon: Xe2, mouseOverIcon: Ye2, clear: Ze2 } = ((e3, t2) => {
|
|
170
170
|
const s2 = l(false), o2 = E("clearable");
|
|
171
171
|
return { showClearIcon: a(() => !!o2.value && s2.value && !t2.value), mouseOverIcon: (e4) => {
|
|
172
172
|
s2.value = e4;
|
|
@@ -174,45 +174,45 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
174
174
|
se(e3) && e3();
|
|
175
175
|
} };
|
|
176
176
|
})(async () => {
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
fe({ validateStatus:
|
|
180
|
-
|
|
177
|
+
We2.value || (el2.value = M2.value ? [] : void 0, Oe2(), Qe2(false), _l(), await F(), Re2 == null ? void 0 : Re2.validate("input"));
|
|
178
|
+
}, We2);
|
|
179
|
+
fe({ validateStatus: je2, isExpanded: Le2, isFocused: T2, isHovering: ee2 }), H(pe2, () => {
|
|
180
|
+
Oe2(), Qe2(false);
|
|
181
181
|
}), B(() => {
|
|
182
|
-
|
|
183
|
-
}), t(() =>
|
|
184
|
-
|
|
182
|
+
el2.value = S2.modelValue;
|
|
183
|
+
}), t(() => S2.modelValue, (e3) => {
|
|
184
|
+
el2.value = e3;
|
|
185
185
|
});
|
|
186
|
-
const
|
|
186
|
+
const el2 = l(), ll2 = a(() => {
|
|
187
187
|
var _a;
|
|
188
|
-
return
|
|
189
|
-
}),
|
|
190
|
-
const l2 = de(
|
|
188
|
+
return M2.value ? (_a = el2.value) == null ? void 0 : _a.map((e3) => tl2(e3)) : tl2(el2.value);
|
|
189
|
+
}), al2 = a(() => ke2.value.length > 0), tl2 = (e3) => {
|
|
190
|
+
const l2 = de(be2.value, (l3) => l3.value === e3);
|
|
191
191
|
return (l2 == null ? void 0 : l2.label) || (l2 == null ? void 0 : l2.value);
|
|
192
|
-
},
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
const l2 =
|
|
196
|
-
te(l2, e3) ?
|
|
197
|
-
} else
|
|
198
|
-
|
|
192
|
+
}, sl = async (e3) => {
|
|
193
|
+
if (Oe2(), !We2.value) {
|
|
194
|
+
if (M2.value) {
|
|
195
|
+
const l2 = el2.value;
|
|
196
|
+
te(l2, e3) ? el2.value = ve(l2, [e3]) : el2.value = [...l2, e3];
|
|
197
|
+
} else el2.value = e3;
|
|
198
|
+
M2.value || Qe2(false), _l(), await F(), Re2 == null ? void 0 : Re2.validate("input");
|
|
199
199
|
}
|
|
200
|
-
},
|
|
201
|
-
if (!
|
|
202
|
-
const e3 = de(
|
|
200
|
+
}, ol = a(() => {
|
|
201
|
+
if (!M2.value) {
|
|
202
|
+
const e3 = de(be2.value, (e4) => e4.value === el2.value);
|
|
203
203
|
return (e3 == null ? void 0 : e3.context) ? e3.context : C("span", { class: "mc-selected-option-label", style: { color: "inherit" } }, (e3 == null ? void 0 : e3.label) || (e3 == null ? void 0 : e3.value));
|
|
204
204
|
}
|
|
205
|
-
}),
|
|
206
|
-
t(
|
|
207
|
-
|
|
205
|
+
}), ul = a(() => !Ve2.value && !!el2.value), cl = a(() => !!S2.placeholder && !Ve2.value && yl.value), nl = a(() => T2.value ? "minimal" : "bold");
|
|
206
|
+
t(Le2, () => {
|
|
207
|
+
Ce2();
|
|
208
208
|
});
|
|
209
|
-
const
|
|
210
|
-
|
|
209
|
+
const il = () => {
|
|
210
|
+
Qe2(!Le2.value);
|
|
211
211
|
}, rl = () => {
|
|
212
|
-
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
}, { isSelectAll:
|
|
212
|
+
Ce2(), Qe2(true);
|
|
213
|
+
}, dl = () => {
|
|
214
|
+
Le2.value ? Se2.value ? sl(Se2.value) : M2.value || Qe2(false) : Qe2(true);
|
|
215
|
+
}, { isSelectAll: vl, isSelectPartial: pl, selectAll: ml } = ((e3, a2, t2, s2) => {
|
|
216
216
|
const o2 = l(false), u2 = l(false);
|
|
217
217
|
return P(() => {
|
|
218
218
|
var _a, _b;
|
|
@@ -222,33 +222,33 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
222
222
|
}), { isSelectAll: o2, isSelectPartial: u2, selectAll: () => {
|
|
223
223
|
e3.value && se(s2) && s2();
|
|
224
224
|
} };
|
|
225
|
-
})(
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
t(
|
|
229
|
-
|
|
225
|
+
})(M2, el2, be2, () => {
|
|
226
|
+
vl.value ? el2.value = be2.value.map((e3) => e3.value) : el2.value = [], _l();
|
|
227
|
+
}), hl = l([]);
|
|
228
|
+
t(Le2, () => {
|
|
229
|
+
Le2.value && M2.value && (hl.value = el2.value);
|
|
230
230
|
});
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
},
|
|
231
|
+
const fl = () => {
|
|
232
|
+
M2.value && (el2.value = hl.value, _l());
|
|
233
|
+
}, gl = () => {
|
|
234
|
+
M2.value && Qe2(false);
|
|
235
|
+
}, yl = a(() => {
|
|
236
236
|
var _a;
|
|
237
|
-
return
|
|
238
|
-
}),
|
|
239
|
-
|
|
237
|
+
return M2.value ? ((_a = el2.value) == null ? void 0 : _a.length) <= 0 : !el2.value;
|
|
238
|
+
}), bl = a(() => Xe2.value && !yl.value), wl = a(() => We2.value ? "not-allowed" : _e2.value ? "text" : "pointer"), _l = () => {
|
|
239
|
+
A2("update:modelValue", el2.value), A2("change", el2.value);
|
|
240
240
|
};
|
|
241
|
-
return s(ze, { isMulti:
|
|
242
|
-
const l4 =
|
|
243
|
-
|
|
244
|
-
})(e4) }, { default: g(() => [y(b(
|
|
245
|
-
} }), [["__scopeId", "data-v-
|
|
241
|
+
return s(ze, { isMulti: M2, selectedOption: el2, filteredOptions: ke2, filteredGroups: xe2, hoverOption: Se2, select: sl, hover: Be2 }), (e3, l2) => (u(), o("div", { ref_key: "selectRef", ref: pe2, class: n(["mc-select", { "mc-select-expanded": i(Le2) }]) }, [d(ge, { ref_key: "popperRef", ref: qe2, placement: e3.placement, trigger: "manual", class: "mc-select-popper", style: c({ width: i(me2) }), "show-arrow": false, "popper-options": i(Je2), "hide-timeout": 100 }, { default: g(() => [r("div", { ref_key: "triggerRef", ref: I2, class: n(["mc-select-trigger", { "mc-select-trigger-focused": i(T2), "mc-select-trigger-disabled": i(We2), "mc-select-trigger-hovering": i(ee2), [i(Pe2)]: i(Pe2) }]), style: c({ width: i(me2), height: i(ye2) }), onClick: il }, [r("div", { class: "mc-select-input-wrapper", style: c({ cursor: wl.value }) }, [w(r("input", { "onUpdate:modelValue": l2[0] || (l2[0] = (e4) => $(we2) ? we2.value = e4 : null), ref_key: "inputRef", ref: R2, id: i(Me2), class: "mc-select-input", style: c({ width: i(Ve2) ? "100%" : "1px" }), placeholder: e3.placeholder, readonly: !i(_e2) || i(We2), disabled: i(We2), onFocus: l2[1] || (l2[1] = (...e4) => i(Y2) && i(Y2)(...e4)), onBlur: l2[2] || (l2[2] = (...e4) => i(Z2) && i(Z2)(...e4)), onInput: rl, onKeydown: [D(z(dl, ["stop"]), ["enter"]), l2[3] || (l2[3] = D(z((...e4) => i(Ae2) && i(Ae2)(...e4), ["stop"]), ["arrow-down"])), l2[4] || (l2[4] = D(z((...e4) => i(Ae2) && i(Ae2)(...e4), ["stop"]), ["arrow-up"]))] }, null, 44, Fe), [[_, i(we2)]]), ul.value ? k(e3.$slots, "selected-content", { key: 0, selectedOption: el2.value, selectedOptionLabel: ll2.value, isDisabled: i(We2) }, () => [M2.value ? (u(), o("ul", Ge, [(u(true), o(h, null, f(el2.value, (e4) => (u(), o("li", { key: e4, class: "mc-select-multi-option" }, [d(q, { size: "x-small", type: "selectable", emphasis: nl.value, disabled: i(We2), onDelete: (l3) => ((e5) => {
|
|
242
|
+
const l4 = el2.value;
|
|
243
|
+
el2.value = ve(l4, [e5]), _l();
|
|
244
|
+
})(e4) }, { default: g(() => [y(b(tl2(e4)), 1)]), _: 2 }, 1032, ["emphasis", "disabled", "onDelete"])]))), 128))])) : (u(), o("div", He, [ol.value ? (u(), p(m(ol.value), { key: el2.value })) : v("", true)]))], true) : v("", true), cl.value ? (u(), o("p", Ee, [k(e3.$slots, "placeholder", {}, () => [y(b(e3.placeholder), 1)], true)])) : v("", true)], 4), i(Ke2) ? (u(), o("div", Ne, [i(Ke2) ? (u(), p(W, { key: 0, name: i(Ke2), size: 24 }, null, 8, ["name"])) : v("", true)])) : v("", true), r("div", { class: "mc-select-icon-wrapper", onMouseenter: l2[5] || (l2[5] = (e4) => i(Ye2)(true)), onMouseleave: l2[6] || (l2[6] = (e4) => i(Ye2)(false)) }, [w(d(W, { name: "Reject", size: 20, class: "mc-select-clear-icon", onClick: z(i(Ze2), ["stop"]) }, null, 8, ["onClick"]), [[x, bl.value]]), w(d(W, { name: "Down-Chevron", size: 24, class: n(["mc-select-chevron-icon", { "mc-select-chevron-icon-rotate": i(Le2) }]) }, null, 8, ["class"]), [[x, !bl.value]])], 32)], 6)]), content: g(() => [al2.value && e3.showHeader ? (u(), p(Q, { key: 0, class: "mc-select-dropdown-header", "show-tool-bar": false, height: "40px" }, { default: g(() => [k(e3.$slots, "option-header", {}, () => [M2.value ? (u(), o("div", Ue, [d(J, { modelValue: i(vl), "onUpdate:modelValue": l2[7] || (l2[7] = (e4) => $(vl) ? vl.value = e4 : null), content: "Select All", "form-validate": false, partial: i(pl), onChange: i(ml) }, null, 8, ["modelValue", "partial", "onChange"])])) : v("", true)], true)]), _: 3 })) : v("", true), r("ul", { class: "mc-select-list", style: c({ paddingTop: e3.showHeader ? "40px" : "0", paddingBottom: e3.showFooter ? "48px" : "0" }) }, [k(e3.$slots, "default", {}, void 0, true), al2.value ? v("", true) : (u(), o("li", Te, [k(e3.$slots, "empty", {}, () => [l2[8] || (l2[8] = r("p", { class: "mc-select-text" }, "No results found", -1))], true)]))], 4), al2.value && e3.showFooter ? (u(), p(X, { key: 1, class: "mc-select-dropdown-footer" }, { "right-button-group": g(() => [k(e3.$slots, "option-footer", {}, () => [M2.value ? (u(), o(h, { key: 0 }, [d(L, { type: "link", size: "small", onClick: fl }, { default: g(() => l2[9] || (l2[9] = [y(" Reset ")])), _: 1, __: [9] }), d(L, { type: "plain", size: "small", onClick: gl }, { default: g(() => l2[10] || (l2[10] = [y(" Apply ")])), _: 1, __: [10] })], 64)) : v("", true)], true)]), _: 3 })) : v("", true)]), _: 3 }, 8, ["placement", "style", "popper-options"])], 2));
|
|
245
|
+
} }), [["__scopeId", "data-v-a6be7883"]]), We = { class: "mc-select-multi-option" }, Le = e({ name: "McSelectMultiOption", __name: "mc-select-multi-option", props: { modelValue: { type: Boolean, default: false }, label: {} }, emits: ["update:modelValue"], setup(e2, { emit: l2 }) {
|
|
246
246
|
const a2 = l2, t2 = (e3) => {
|
|
247
247
|
a2("update:modelValue", e3);
|
|
248
248
|
};
|
|
249
249
|
return (e3, l3) => (u(), o("div", We, [d(J, { "model-value": e3.modelValue, content: e3.label, "disable-validation": "", "onUpdate:modelValue": t2 }, null, 8, ["model-value", "content"])]));
|
|
250
250
|
} }), qe = ["aria-selected"], Je = { key: 1, class: "mc-select-option-label" }, Qe = pe(e({ name: De, __name: "mc-select-option-plus", props: { label: {}, value: { type: [String, Number, Boolean] }, height: { default: 40 }, width: { default: "100%" } }, setup(e2) {
|
|
251
|
-
const t2 = e2, { height: s2, width:
|
|
251
|
+
const t2 = e2, { height: s2, width: r2 } = N(), d2 = O(ze || void 0), v2 = a(() => !!de(d2 == null ? void 0 : d2.filteredOptions.value, (e3) => e3.value === t2.value)), m2 = a(() => !!(d2 == null ? void 0 : d2.isMulti.value)), h2 = a(() => {
|
|
252
252
|
if (m2.value) {
|
|
253
253
|
const e3 = d2 == null ? void 0 : d2.selectedOption.value;
|
|
254
254
|
return te(e3, t2.value);
|
|
@@ -256,13 +256,13 @@ const ye = Symbol("selectContext"), be = Symbol("selectGroupContext"), we = { ke
|
|
|
256
256
|
return (d2 == null ? void 0 : d2.selectedOption.value) === t2.value;
|
|
257
257
|
}), f2 = l(false), g2 = a(() => t2.label), y2 = () => {
|
|
258
258
|
d2 == null ? void 0 : d2.hover(t2.value);
|
|
259
|
-
}, _2 = a(() => (d2 == null ? void 0 : d2.hoverOption.value) === t2.value),
|
|
259
|
+
}, _2 = a(() => (d2 == null ? void 0 : d2.hoverOption.value) === t2.value), V2 = () => {
|
|
260
260
|
d2 == null ? void 0 : d2.select(t2.value);
|
|
261
261
|
};
|
|
262
|
-
return (e3, l2) => w((u(), o("li", { role: "option", class: n(["mc-select-option", { "mc-select-option-actived": h2.value && !m2.value, "mc-select-option-hover": _2.value }]), style: c({ height:
|
|
262
|
+
return (e3, l2) => w((u(), o("li", { role: "option", class: n(["mc-select-option", { "mc-select-option-actived": h2.value && !m2.value, "mc-select-option-hover": _2.value }]), style: c({ height: i(s2), width: i(r2) }), "aria-selected": f2.value, onMouseenter: y2, onClick: V2 }, [k(e3.$slots, "default", { isActived: h2.value }, () => [m2.value ? (u(), p(Le, { key: 0, "model-value": h2.value, label: g2.value }, null, 8, ["model-value", "label"])) : (u(), o("span", Je, b(g2.value), 1))], true)], 46, qe)), [[x, v2.value]]);
|
|
263
263
|
} }), [["__scopeId", "data-v-326216dd"]]), Xe = { class: "mc-select-group" }, Ye = { class: "mc-select-option-list" }, Ze = pe(e({ name: $e, __name: "mc-select-group-plus", props: { label: {}, height: { default: 40 }, width: { default: "100%" } }, setup(e2) {
|
|
264
264
|
const l2 = e2, t2 = O(ze || void 0), { height: s2, width: n2 } = N(), d2 = a(() => te(t2 == null ? void 0 : t2.filteredGroups.value, l2.label));
|
|
265
|
-
return (e3, l3) => w((u(), o("ul", Xe, [
|
|
265
|
+
return (e3, l3) => w((u(), o("ul", Xe, [r("li", { class: "mc-select-group-label", style: c({ height: i(s2), width: i(n2) }) }, b(e3.label), 5), r("li", null, [r("ul", Ye, [k(e3.$slots, "default", {}, void 0, true)])])], 512)), [[x, d2.value]]);
|
|
266
266
|
} }), [["__scopeId", "data-v-0db35ade"]]), el = me(Ke), ll = me(Qe), al = me(Ze), tl = me(Le);
|
|
267
267
|
export {
|
|
268
268
|
Ie as M,
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { computed as e, defineComponent as l, ref as a, createElementBlock as o, openBlock as t, normalizeClass as i, unref as s, createElementVNode as n, renderSlot as d, createCommentVNode as c, createVNode as r, toDisplayString as m, Fragment as p, renderList as u, createBlock as f, useSlots as v, reactive as y, watch as g, normalizeStyle as h, withCtx as _ } from "vue";
|
|
2
|
+
import { e as w, j as z, c as b, b as k } from "./hooks-DghKpOue.js";
|
|
3
|
+
import { t as $ } from "./mc-toast-DB9Y1bvS.js";
|
|
4
|
+
import { M as C } from "./mc-icon-B_dAlj4r.js";
|
|
5
|
+
import { M as x } from "./mc-success-icon-Cj-5Hgzy.js";
|
|
6
|
+
import { m as M, b as S } from "./vendor-CExPGg1i.js";
|
|
7
|
+
import { _ as B, w as D } from "./utils-BDbMLK9w.js";
|
|
8
|
+
import { M as U } from "./mc-divider-BSXy8GNr.js";
|
|
9
|
+
import { M as V } from "./mc-progress-bar-JF0Frass.js";
|
|
10
|
+
const F = (e2) => parseFloat(e2).toString(), T = (e2, l2 = 2) => e2 < 1024 ? `${e2} B` : e2 < 1048576 ? `${F((e2 / 1024).toFixed(l2))} KB` : e2 < 1073741824 ? `${F((e2 / 1048576).toFixed(l2))} MB` : `${F((e2 / 1073741824).toFixed(l2))} GB`, j = (e2) => {
|
|
11
|
+
if (!e2) return "--";
|
|
12
|
+
const l2 = new Date(e2);
|
|
13
|
+
return `${l2.getFullYear()}/${String(l2.getMonth() + 1).padStart(2, "0")}/${String(l2.getDate()).padStart(2, "0")} ${String(l2.getHours()).padStart(2, "0")}:${String(l2.getMinutes()).padStart(2, "0")}:${String(l2.getSeconds()).padStart(2, "0")}`;
|
|
14
|
+
}, I = (e2, l2, a2) => {
|
|
15
|
+
const o2 = e2.get(l2);
|
|
16
|
+
e2.set(l2, { ...o2, ...a2 });
|
|
17
|
+
}, E = "[?]", R = ["jpg", "jpeg", "png", "doc", "docx", "xls", "xlsx", "pdf"], A = { upload_note: "Click to upload or drag and drop your files here", max_size: "Max file size:", max_count: "No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.", uploaded_by: "Uploaded by", uploaded_on: "Uploaded on", limit_count: `The number of files cannot exceed ${E} .`, limit_size: `The file size cannot exceed ${E} .`, limit_type: `${E} only`, limit_count_reached: `You can only upload ${E} files.` }, L = { upload_note: "单击即可上传或将文件拖放到此处", max_size: "最大文件大小:", max_count: "No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.", uploaded_by: "上传用户", uploaded_on: "上传时间", limit_count: `文件数量不能超过 ${E} 。`, limit_size: `最大文件大小:${E} 。`, limit_type: `只接受文件格式:${E}`, limit_count_reached: `您只能上传 ${E} 个文件。` }, N = () => {
|
|
18
|
+
const l2 = w("lang");
|
|
19
|
+
return { langMap: e(() => "zh" === l2.value ? L : A) };
|
|
20
|
+
}, Y = { class: "mc-upload-dropzone-area" }, q = { class: "mc-upload-dropzone-title" }, G = { class: "mc-upload-dropzone-title-text" }, H = { key: 0, class: "mc-upload-dropzone-desc" }, K = { key: 0 }, P = { key: 1 }, J = B(l({ name: "McUploadDropzone", __name: "mc-upload-dropzone", props: { title: {}, icon: { default: "Document_Upload" }, allowedFileTypes: { default: () => R }, fileSize: { default: 15728640 }, uploadUser: { default: "--" }, lang: { default: "en" }, hideDesc: { type: Boolean, default: false }, fileCount: {} }, emits: ["upload", "error:type", "error:size"], setup(l2, { expose: p2, emit: u2 }) {
|
|
21
|
+
const f2 = l2, v2 = u2, { langMap: y2 } = N(), g2 = a(), h2 = e(() => {
|
|
22
|
+
var _a;
|
|
23
|
+
return ((_a = f2.allowedFileTypes) == null ? void 0 : _a.length) ? y2.value.limit_type.replace(E, M(f2.allowedFileTypes, (e2) => e2.toUpperCase()).join(", ")) : void 0;
|
|
24
|
+
}), { isDragover: _2 } = z(g2, { onDrop: (e2) => {
|
|
25
|
+
var _a;
|
|
26
|
+
const l3 = (_a = e2.dataTransfer) == null ? void 0 : _a.files;
|
|
27
|
+
l3 && x2(l3);
|
|
28
|
+
} }), w2 = a(), b2 = () => {
|
|
29
|
+
w2.value && (w2.value.value = "");
|
|
30
|
+
}, k2 = () => {
|
|
31
|
+
var _a;
|
|
32
|
+
(_a = w2.value) == null ? void 0 : _a.click();
|
|
33
|
+
}, $2 = (e2) => {
|
|
34
|
+
const l3 = e2.target.files;
|
|
35
|
+
l3 && x2(l3);
|
|
36
|
+
}, x2 = async (e2) => {
|
|
37
|
+
let l3 = Array.from(e2);
|
|
38
|
+
const a2 = /* @__PURE__ */ new Map();
|
|
39
|
+
l3.forEach((e3) => {
|
|
40
|
+
I(a2, e3.name, { name: e3.name, size: e3.size, status: "loading", uploadBy: f2.uploadUser, uploadTime: Date.now(), file: e3 });
|
|
41
|
+
}), ((e3, l4) => {
|
|
42
|
+
const a3 = f2.fileSize;
|
|
43
|
+
if (a3 <= 0) return true;
|
|
44
|
+
let o2 = false;
|
|
45
|
+
for (let t2 = 0; t2 < e3.length; t2++) {
|
|
46
|
+
const i2 = e3[t2];
|
|
47
|
+
i2.size > a3 ? (I(l4, i2.name, { status: "failed", errorMessage: y2.value.limit_size.replace(E, `${T(a3)}`) }), v2("error:size", i2.name)) : o2 = true;
|
|
48
|
+
}
|
|
49
|
+
})(l3, a2), ((e3, l4) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const a3 = f2.allowedFileTypes;
|
|
52
|
+
if (!(a3 == null ? void 0 : a3.length)) return true;
|
|
53
|
+
let o2 = false;
|
|
54
|
+
const t2 = M(a3, (e4) => e4.toUpperCase());
|
|
55
|
+
for (let a4 = 0; a4 < e3.length; a4++) {
|
|
56
|
+
const i2 = ((_a = e3[a4].name.split(".").pop()) == null ? void 0 : _a.toUpperCase()) ?? "--";
|
|
57
|
+
S(t2, i2) ? o2 = true : (I(l4, e3[a4].name, { status: "failed", errorMessage: h2.value }), v2("error:type", e3[a4].name));
|
|
58
|
+
}
|
|
59
|
+
})(l3, a2), v2("upload", a2), b2();
|
|
60
|
+
};
|
|
61
|
+
return p2({ clearUploadInput: b2 }), (e2, l3) => (t(), o("div", { ref: "wrapperRef", class: i(["mc-upload-dropzone", { "mc-upload-dropzone-dragover": s(_2) }]), onClick: k2 }, [n("div", Y, [d(e2.$slots, "default", {}, () => [n("div", q, [d(e2.$slots, "title", {}, () => [r(C, { name: e2.icon }, null, 8, ["name"]), n("span", G, m(e2.title || s(y2).upload_note), 1)], true)]), e2.hideDesc ? c("", true) : (t(), o("div", H, [d(e2.$slots, "desc", {}, () => [e2.fileSize > 0 ? (t(), o("span", K, m(s(y2).max_size) + " " + m(s(T)(e2.fileSize)), 1)) : c("", true), h2.value ? (t(), o("span", P, m(h2.value), 1)) : c("", true)], true)]))], true)]), n("input", { ref_key: "uploadInputRef", ref: w2, type: "file", multiple: "", style: { display: "none" }, onChange: $2 }, null, 544), n("div", { class: "mc-upload-dropzone-cover", ref_key: "coverRef", ref: g2 }, null, 512)], 2));
|
|
62
|
+
} }), [["__scopeId", "data-v-c4d80f29"]]), O = { class: "mc-file-list-item-content" }, Q = { class: "mc-file-list-item-file mc-file-list-item-info" }, W = ["onClick"], X = { class: "mc-file-list-item-file-name-text" }, Z = { class: "mc-file-list-item-file-desc" }, ee = { class: "mc-file-list-item-file-size-text" }, le = { key: 0, class: "mc-file-list-item-file-progress-bar" }, ae = { key: 1, class: "mc-file-list-item-file-error" }, oe = { class: "mc-file-list-item-info" }, te = { class: "mc-file-list-item-label" }, ie = { class: "mc-file-list-item-value" }, se = { class: "mc-file-list-item-info" }, ne = { class: "mc-file-list-item-label" }, de = { class: "mc-file-list-item-value" }, ce = { class: "mc-file-list-item-actions" }, re = { class: "mc-file-list-item-compact-content" }, me = { class: "mc-file-list-item-info" }, pe = { class: "mc-file-list-item-label" }, ue = { class: "mc-file-list-item-value" }, fe = { class: "mc-file-list-item-info" }, ve = { class: "mc-file-list-item-label" }, ye = { class: "mc-file-list-item-value" }, ge = B(l({ name: "McFileList", __name: "mc-file-list", props: { modelValue: { default: () => [] }, theme: { default: "light" }, lang: { default: "en" }, downloadable: { type: Boolean, default: false }, allowCancel: { type: Boolean, default: false }, deletable: { type: Boolean, default: true } }, emits: ["update:modelValue", "change", "delete", "download", "preview", "cancel"], setup(e2, { emit: l2 }) {
|
|
63
|
+
const d2 = e2, v2 = l2, { langMap: y2 } = N(), g2 = a(false), h2 = a();
|
|
64
|
+
b(h2, ({ width: e3 }) => {
|
|
65
|
+
g2.value = e3 <= 600;
|
|
66
|
+
});
|
|
67
|
+
const _2 = (e3) => {
|
|
68
|
+
v2("update:modelValue", d2.modelValue.filter((l3) => l3.name !== e3.name));
|
|
69
|
+
};
|
|
70
|
+
return (e3, l3) => (t(), o("ul", { class: i(["mc-file-list", [`mc-file-list-${e3.theme}`, { "mc-file-list-compact": g2.value }]]), ref_key: "fileListRef", ref: h2 }, [(t(true), o(p, null, u(e3.modelValue, (l4) => (t(), o("li", { class: "mc-file-list-item", key: l4.name }, [n("div", O, [n("div", Q, [n("div", { class: "mc-file-list-item-file-name", onClick: (e4) => ((e5) => {
|
|
71
|
+
v2("preview", e5);
|
|
72
|
+
})(l4) }, [r(C, { name: "Document" }), n("span", X, m(l4.name), 1)], 8, W), n("div", Z, ["failed" !== l4.status ? (t(), o(p, { key: 0 }, [n("span", ee, m(l4.size ? s(T)(l4.size) : "--"), 1), "loading" === l4.status ? (t(), o("div", le, [r(V, { percentage: l4.progress, "transition-duration": 1e3 }, null, 8, ["percentage"])])) : c("", true)], 64)) : (t(), o("span", ae, m(l4.errorMessage || "failed to upload"), 1))])]), g2.value ? c("", true) : (t(), o(p, { key: 0 }, [n("div", oe, [n("span", te, m(s(y2).uploaded_by), 1), n("span", ie, m(l4.uploadBy || "--"), 1)]), n("div", se, [n("span", ne, m(s(y2).uploaded_on), 1), n("span", de, m(s(j)(l4.uploadTime) || "--"), 1)])], 64)), n("div", ce, ["loading" === l4.status ? (t(), o(p, { key: 0 }, [e3.allowCancel ? (t(), f(C, { key: 0, name: "Cross", class: "mc-file-list-item-icon", onClick: (e4) => ((e5) => {
|
|
73
|
+
v2("cancel", e5), _2(e5);
|
|
74
|
+
})(l4) }, null, 8, ["onClick"])) : c("", true)], 64)) : (t(), o(p, { key: 1 }, [e3.downloadable ? (t(), f(C, { key: 0, name: "Download", class: "mc-file-list-item-icon", onClick: (e4) => ((e5) => {
|
|
75
|
+
v2("download", e5);
|
|
76
|
+
})(l4) }, null, 8, ["onClick"])) : c("", true), e3.deletable ? (t(), f(C, { key: 1, name: "Trash", class: "mc-file-list-item-icon", onClick: (e4) => ((e5) => {
|
|
77
|
+
v2("delete", e5), _2(e5);
|
|
78
|
+
})(l4) }, null, 8, ["onClick"])) : c("", true)], 64))])]), g2.value ? (t(), o(p, { key: 0 }, [r(U), n("div", re, [n("div", me, [n("span", pe, m(s(y2).uploaded_by), 1), n("span", ue, m(l4.uploadBy || "--"), 1)]), n("div", fe, [n("span", ve, m(s(y2).uploaded_on), 1), n("span", ye, m(s(j)(l4.uploadTime) || "--"), 1)])])], 64)) : c("", true)]))), 128))], 2));
|
|
79
|
+
} }), [["__scopeId", "data-v-55bea4c8"]]), he = { key: 0, class: "mc-upload-content" }, _e = { class: "mc-upload-content-icon" }, we = { class: "mc-upload-content-text" }, ze = { class: "mc-upload-component" }, be = { key: 0, class: "mc-upload-dropzone-wrapper" }, ke = { class: "mc-upload-file-list-wrapper" }, $e = D(B(l({ name: "McUpload", __name: "mc-upload", props: { modelValue: { default: () => [] }, downloadable: { type: Boolean, default: false }, allowCancel: { type: Boolean, default: false }, deletable: { type: Boolean, default: true }, disabled: { type: Boolean, default: false }, theme: { default: "light" }, width: { default: "100%" }, succeed: { type: Boolean, default: false }, title: {}, icon: { default: "Document_Upload" }, allowedFileTypes: { default: () => R }, fileSize: { default: 15728640 }, uploadUser: { default: "--" }, lang: { default: "en" }, hideDesc: { type: Boolean, default: false }, fileCount: {} }, emits: ["update:modelValue", "download:all", "clear", "error:type", "error:size", "upload", "change", "delete", "download", "preview", "cancel"], setup(l2, { expose: m2, emit: p2 }) {
|
|
80
|
+
const u2 = l2, w2 = p2, { width: z2 } = k(), b2 = v(), M2 = e(() => !!b2.content), S2 = a(), B2 = y(/* @__PURE__ */ new Map()), { langMap: D2 } = N(), U2 = (e2) => 0 !== (e2 = ((e3) => {
|
|
81
|
+
if (u2.fileCount && e3.length > u2.fileCount) {
|
|
82
|
+
const l3 = D2.value.limit_count_reached.replace(E, u2.fileCount.toString());
|
|
83
|
+
return $.error(l3), e3.slice(0, u2.fileCount);
|
|
84
|
+
}
|
|
85
|
+
return e3;
|
|
86
|
+
})(e2)).length && (B2.clear(), e2.forEach((e3) => {
|
|
87
|
+
B2.set(e3.name, e3);
|
|
88
|
+
}), true);
|
|
89
|
+
g(() => u2.modelValue, (e2) => {
|
|
90
|
+
U2(e2);
|
|
91
|
+
}, { immediate: true });
|
|
92
|
+
const V2 = (e2) => Array.from([...e2.values()]), F2 = (e2) => {
|
|
93
|
+
w2("update:modelValue", e2);
|
|
94
|
+
}, T2 = (e2) => {
|
|
95
|
+
var _a;
|
|
96
|
+
(_a = S2.value) == null ? void 0 : _a.clearUploadInput();
|
|
97
|
+
const l3 = V2(e2);
|
|
98
|
+
if (!U2([...u2.modelValue, ...l3])) return;
|
|
99
|
+
const a2 = V2(B2);
|
|
100
|
+
w2("update:modelValue", a2), w2("upload", a2), w2("change", a2), q2();
|
|
101
|
+
}, j2 = (e2) => {
|
|
102
|
+
console.error("mc-upload: error:type:", e2), w2("error:type", e2);
|
|
103
|
+
}, I2 = (e2) => {
|
|
104
|
+
console.error("mc-upload: error:size:", e2), w2("error:size", e2);
|
|
105
|
+
}, R2 = (e2) => {
|
|
106
|
+
w2("preview", e2);
|
|
107
|
+
}, A2 = (e2) => {
|
|
108
|
+
w2("delete", e2);
|
|
109
|
+
}, L2 = (e2) => {
|
|
110
|
+
w2("download", e2);
|
|
111
|
+
}, Y2 = (e2) => {
|
|
112
|
+
w2("cancel", e2);
|
|
113
|
+
}, q2 = (e2 = 99, l3 = 100) => {
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
u2.modelValue.forEach((l4) => {
|
|
116
|
+
"loading" === l4.status && (l4.progress = e2);
|
|
117
|
+
});
|
|
118
|
+
}, l3);
|
|
119
|
+
}, G2 = e(() => u2.deletable && !u2.disabled);
|
|
120
|
+
return m2({ clearFiles: () => {
|
|
121
|
+
B2.clear(), w2("clear"), w2("update:modelValue", []), w2("change", []);
|
|
122
|
+
}, downloadAllFiles: () => {
|
|
123
|
+
w2("download:all", V2(B2));
|
|
124
|
+
} }), (e2, l3) => (t(), o("div", { class: "mc-upload", style: h({ width: s(z2) }) }, [n("div", { class: i([{ "mc-upload-wrapper": M2.value }, `mc-upload-wrapper-${e2.theme}`]) }, [M2.value ? (t(), o("div", he, [n("div", _e, [e2.succeed ? (t(), f(x, { key: 1, width: "24px", height: "24px" })) : (t(), f(C, { key: 0, name: "Accept" }))]), n("div", we, [d(e2.$slots, "content", {}, void 0, true)])])) : c("", true), n("div", ze, [e2.disabled ? c("", true) : (t(), o("div", be, [r(J, { ref_key: "uploadDropzoneRef", ref: S2, "upload-user": e2.uploadUser, "allowed-file-types": e2.allowedFileTypes, "file-size": e2.fileSize, icon: e2.icon, lang: e2.lang, theme: e2.theme, "hide-desc": e2.hideDesc, "file-count": e2.fileCount, onUpload: T2, "onError:type": j2, "onError:size": I2 }, { default: _(() => [d(e2.$slots, "default", {}, void 0, true)]), title: _(() => [d(e2.$slots, "title", {}, void 0, true)]), desc: _(() => [d(e2.$slots, "desc", {}, void 0, true)]), _: 3 }, 8, ["upload-user", "allowed-file-types", "file-size", "icon", "lang", "theme", "hide-desc", "file-count"])])), n("div", ke, [r(ge, { "model-value": e2.modelValue, "allow-cancel": e2.allowCancel, downloadable: e2.downloadable, lang: e2.lang, theme: e2.theme, deletable: G2.value, "onUpdate:modelValue": F2, onPreview: R2, onDelete: A2, onDownload: L2, onCancel: Y2 }, null, 8, ["model-value", "allow-cancel", "downloadable", "lang", "theme", "deletable"])])])], 2)], 4));
|
|
125
|
+
} }), [["__scopeId", "data-v-7f542598"]])), Ce = D(ge), xe = D(J);
|
|
126
|
+
export {
|
|
127
|
+
Ce as M,
|
|
128
|
+
$e as a,
|
|
129
|
+
xe as b
|
|
130
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-progress-bar[data-v-
|
|
1
|
+
.mc-progress-bar[data-v-83b22259]{width:100%}.mc-progress-bar .mc-progress-bar-wrapper[data-v-83b22259]{width:100%;--border-radius: 4px;border-radius:var(--border-radius);background-color:var(--mc-gray-100);position:relative;overflow:hidden}.mc-progress-bar .mc-progress-bar-wrapper .mc-progress-bar-inner[data-v-83b22259]{width:100%;height:100%;background-color:var(--mc-teal-500);border-radius:var(--border-radius);transform-origin:left center;transition:transform linear}.mc-progress-bar .mc-progress-bar-wrapper .mc-progress-bar-shimmer[data-v-83b22259]{display:block;position:absolute;top:0;left:-100%;width:30%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.8) 25%,transparent 100%);animation:progress-shimmer-83b22259 4s infinite linear;border-radius:var(--border-radius)}.mc-progress-bar .mc-progress-bar-remarks[data-v-83b22259]{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:0;margin-top:4px}@keyframes progress-shimmer-83b22259{0%{left:-100%}to{left:100%}}
|