mc-plus 1.0.110 → 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 +10 -10
- package/dist/es/{mc-richtext-BCslaBVv.js → mc-richtext-ClxrTi6e.js} +2 -2
- package/dist/es/{mc-select-59GKtOq3.js → mc-select-CneRu4Ql.js} +1 -1
- package/dist/es/{mc-select-group-plus-ao1R0zxC.js → mc-select-group-plus-B8grrVXr.js} +1 -1
- package/dist/es/{mc-select-option-plus-C0n5Y_eM.js → mc-select-option-plus-CxY0GZeL.js} +1 -1
- package/dist/es/{mc-select-plus-ByYup3nI.js → mc-select-plus-BeYarza9.js} +66 -66
- package/dist/umd/index.umd.cjs +5 -5
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
package/dist/es/index.js
CHANGED
|
@@ -69,18 +69,18 @@ import { M as Cs } from "./mc-removable-tag-BI8IR6RR.js";
|
|
|
69
69
|
import { a as a30 } from "./mc-removable-tag-BI8IR6RR.js";
|
|
70
70
|
import { M as is } from "./mc-reset-2g3HidL0.js";
|
|
71
71
|
import { a as a31 } from "./mc-reset-2g3HidL0.js";
|
|
72
|
-
import { M as fs } from "./mc-richtext-
|
|
73
|
-
import { F as F3, a as a32, b as b6, T } from "./mc-richtext-
|
|
72
|
+
import { M as fs } from "./mc-richtext-ClxrTi6e.js";
|
|
73
|
+
import { F as F3, a as a32, b as b6, T } from "./mc-richtext-ClxrTi6e.js";
|
|
74
74
|
import { M as Es } from "./mc-secondary-menu-DXNC7YoQ.js";
|
|
75
75
|
import { a as a33 } from "./mc-secondary-menu-DXNC7YoQ.js";
|
|
76
|
-
import { M as Ts } from "./mc-select-
|
|
77
|
-
import { a as a34, S } from "./mc-select-
|
|
78
|
-
import { M as js } from "./mc-select-plus-
|
|
79
|
-
import { b as b7, a as a35 } from "./mc-select-plus-
|
|
80
|
-
import { a as Os } from "./mc-select-group-plus-
|
|
81
|
-
import { M as M4 } from "./mc-select-group-plus-
|
|
82
|
-
import { M as ls } from "./mc-select-option-plus-
|
|
83
|
-
import { a as a36 } from "./mc-select-option-plus-
|
|
76
|
+
import { M as Ts } from "./mc-select-CneRu4Ql.js";
|
|
77
|
+
import { a as a34, S } from "./mc-select-CneRu4Ql.js";
|
|
78
|
+
import { M as js } from "./mc-select-plus-BeYarza9.js";
|
|
79
|
+
import { b as b7, a as a35 } from "./mc-select-plus-BeYarza9.js";
|
|
80
|
+
import { a as Os } from "./mc-select-group-plus-B8grrVXr.js";
|
|
81
|
+
import { M as M4 } from "./mc-select-group-plus-B8grrVXr.js";
|
|
82
|
+
import { M as ls } from "./mc-select-option-plus-CxY0GZeL.js";
|
|
83
|
+
import { a as a36 } from "./mc-select-option-plus-CxY0GZeL.js";
|
|
84
84
|
import { M as Ls } from "./mc-select-multi-option-D7hD1igO.js";
|
|
85
85
|
import { a as a37 } from "./mc-select-multi-option-D7hD1igO.js";
|
|
86
86
|
import { M as As } from "./mc-status-Bw9-cSOb.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as e, createElementBlock as t, openBlock as l, normalizeClass as a, renderSlot as o, createBlock as i, ref as s, watch as c, watchEffect as n, normalizeStyle as r, unref as m, createElementVNode as u, createVNode as d, withCtx as v, toDisplayString as p, createTextVNode as L } from "vue";
|
|
2
2
|
import { M as h, u as f, i as A, a as g, E as M } from "./vendor-BEjxar4U.js";
|
|
3
3
|
import { useWidthHeight as x } from "@mc-plus/hooks";
|
|
4
|
-
import { M as O } from "./mc-select-plus-
|
|
5
|
-
import { M as T } from "./mc-select-option-plus-
|
|
4
|
+
import { M as O } from "./mc-select-plus-BeYarza9.js";
|
|
5
|
+
import { M as T } from "./mc-select-option-plus-CxY0GZeL.js";
|
|
6
6
|
import { a as k, M as I } from "./mc-icon-plus-YMAi6EZM.js";
|
|
7
7
|
import { M as R } from "./mc-tooltip-BlsZG-T8.js";
|
|
8
8
|
import { M as b } from "./mc-input-BGgdD1HJ.js";
|
|
@@ -4,7 +4,7 @@ import { useProp as k, useFocus as S, useHover as B, useWidthHeight as T, useCli
|
|
|
4
4
|
import { M } from "./mc-popper-plus-CTKgoEEE.js";
|
|
5
5
|
import { M as j } from "./mc-icon-plus-YMAi6EZM.js";
|
|
6
6
|
import { isEmpty as E, filter as C, toLower as D, includes as P } from "lodash-es";
|
|
7
|
-
import { u as L } from "./mc-select-plus-
|
|
7
|
+
import { u as L } from "./mc-select-plus-BeYarza9.js";
|
|
8
8
|
import { u as z } from "./mc-form-DCKlCcDs.js";
|
|
9
9
|
import { I as F } from "./mc-input-group-BPpVTTHQ.js";
|
|
10
10
|
const R = Symbol("mc-select-context"), H = "mc-select", U = ["value", "placeholder", "disabled", "readonly", "onKeydown"], Y = { class: "mc-select-selected-label" }, K = { class: "mc-select-trigger-toolbar" }, J = e(s({ name: "mc-select-trigger-virtual", __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 }, hideValidationIcon: { type: Boolean, default: false } }, emits: ["update:searchValue", "update:isExpanded", "press:arrow", "search", "focus", "blur", "clear"], setup(e2, { emit: l2 }) {
|
|
@@ -2,7 +2,7 @@ import { _ as l, u as s } from "./utils-dWwt4JKv.js";
|
|
|
2
2
|
import { defineComponent as e, inject as t, computed as o, withDirectives as a, createElementBlock as u, openBlock as p, createElementVNode as r, normalizeStyle as c, unref as m, toDisplayString as i, renderSlot as d, vShow as h } from "vue";
|
|
3
3
|
import { includes as f } from "lodash-es";
|
|
4
4
|
import { useWidthHeight as g } from "@mc-plus/hooks";
|
|
5
|
-
import { a as n } from "./mc-select-plus-
|
|
5
|
+
import { a as n } from "./mc-select-plus-BeYarza9.js";
|
|
6
6
|
const v = "mc-select-group-plus", _ = { class: "mc-select-group" }, b = { class: "mc-select-option-list" }, w = s(l(e({ name: v, __name: "mc-select-group-plus", props: { label: {}, height: { default: 40 }, width: { default: "100%" } }, setup(l2) {
|
|
7
7
|
const s2 = l2, { filteredGroups: e2 } = t(n), { height: v2, width: w2 } = g(), j = o(() => f(e2.value, s2.label));
|
|
8
8
|
return (s3, e3) => a((p(), u("ul", _, [r("li", { class: "mc-select-group-label", style: c({ height: m(v2), width: m(w2) }) }, i(l2.label), 5), r("li", null, [r("ul", b, [d(s3.$slots, "default", {}, void 0, true)])])], 512)), [[h, j.value]]);
|
|
@@ -3,7 +3,7 @@ import { defineComponent as a, inject as t, computed as s, ref as o, withDirecti
|
|
|
3
3
|
import { find as h, some as f } from "lodash-es";
|
|
4
4
|
import { useWidthHeight as y } from "@mc-plus/hooks";
|
|
5
5
|
import { M as _ } from "./mc-select-multi-option-D7hD1igO.js";
|
|
6
|
-
import { a as g } from "./mc-select-plus-
|
|
6
|
+
import { a as g } from "./mc-select-plus-BeYarza9.js";
|
|
7
7
|
const k = "mc-select-option-plus", M = ["aria-selected"], O = { key: 1, class: "mc-select-option-label" }, j = l(e(a({ name: k, __name: "mc-select-option-plus", props: { label: {}, value: { type: [String, Number, Boolean] }, height: { default: 40 }, width: { default: "100%" }, disabled: { type: Boolean } }, setup(e2) {
|
|
8
8
|
const l2 = e2, { height: a2, width: k2 } = y(), { isMulti: j2, selectedOptions: w, filteredOptions: B, hoverOption: x, select: A, hover: C } = t(g), D = s(() => !!h(B.value, (e3) => e3.value === l2.value)), I = s(() => f(w.value, (e3) => e3.value === l2.value)), J = o(false), N = s(() => l2.label), S = () => {
|
|
9
9
|
C(l2.value);
|
|
@@ -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
|
};
|