mc-plus 1.0.23 → 1.0.25
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 +9 -9
- package/dist/es/mc-checkbox-C6TCo4xL.js +14 -0
- package/dist/es/{mc-form-GD4rKC6G.js → mc-form-CtyDHg4u.js} +3 -3
- package/dist/es/{mc-input-CgkXcWFb.js → mc-input-DgyxwBEp.js} +1 -1
- package/dist/es/{mc-lightbox-D7RM1TeY.js → mc-lightbox-mmW3PJ5_.js} +3 -3
- package/dist/es/mc-radio-FAr1EIpi.js +30 -0
- package/dist/es/{mc-select-hWzUKAC7.js → mc-select-D7ESJaoU.js} +2 -2
- package/dist/es/mc-tab-BdTzWosh.js +350 -0
- package/dist/es/mc-tooltip-CUwEXvHg.js +9 -0
- package/dist/es/theme/mc-checkbox.css +1 -1
- package/dist/es/theme/mc-radio.css +1 -1
- package/dist/es/theme/mc-tab.css +1 -1
- package/dist/es/theme/mc-tooltip.css +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components/mc-input/index.d.ts +5 -5
- package/dist/types/components/mc-radio/index.d.ts +11 -10
- package/dist/types/components/mc-radio/types.d.ts +9 -6
- package/dist/types/components/mc-table/composables/usePagination.d.ts +9 -3
- package/dist/types/components/mc-table/composables/useTableCurrentRow.d.ts +8 -0
- package/dist/types/components/mc-table/composables/useTableSelection.d.ts +18 -0
- package/dist/types/components/mc-table/index.d.ts +7 -4
- package/dist/types/components/mc-table/types.d.ts +3 -3
- package/dist/types/components/mc-tooltip/types.d.ts +1 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +3 -3
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/mc-checkbox-XTu4G8Ql.js +0 -11
- package/dist/es/mc-radio-DURuKHAH.js +0 -23
- package/dist/es/mc-tab-k42g30rE.js +0 -291
- package/dist/es/mc-tooltip-Dp_lo0jl.js +0 -9
package/dist/es/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { p as s, m } from "./utils-DVltbcaT.js";
|
|
2
2
|
import { M as o } from "./mc-alert-Dc8UZwbs.js";
|
|
3
3
|
import { M as r } from "./mc-button-BzTZwUJY.js";
|
|
4
|
-
import { M as i } from "./mc-checkbox-
|
|
4
|
+
import { M as i } from "./mc-checkbox-C6TCo4xL.js";
|
|
5
5
|
import { M as p } from "./mc-collapse-C68KTHMo.js";
|
|
6
6
|
import { a } from "./mc-collapse-C68KTHMo.js";
|
|
7
|
-
import { M as f, a as j } from "./mc-input-
|
|
7
|
+
import { M as f, a as j } from "./mc-input-DgyxwBEp.js";
|
|
8
8
|
import { M } from "./mc-message-DhaFb3_V.js";
|
|
9
9
|
import { a as a2 } from "./mc-message-DhaFb3_V.js";
|
|
10
|
-
import { M as l, a as n } from "./mc-radio-
|
|
11
|
-
import { M as g, a as x, b as h } from "./mc-select-
|
|
10
|
+
import { M as l, a as n } from "./mc-radio-FAr1EIpi.js";
|
|
11
|
+
import { M as g, a as x, b as h } from "./mc-select-D7ESJaoU.js";
|
|
12
12
|
import { M as S } from "./mc-switch-DfDHgpaw.js";
|
|
13
|
-
import { M as T, a as k, b as w } from "./mc-tab-
|
|
14
|
-
import { u, c, d } from "./mc-tab-
|
|
13
|
+
import { M as T, a as k, b as w } from "./mc-tab-BdTzWosh.js";
|
|
14
|
+
import { u, c, d } from "./mc-tab-BdTzWosh.js";
|
|
15
15
|
import { M as P } from "./mc-tag-BFd8VP2H.js";
|
|
16
16
|
import { M as q } from "./mc-toast-BfgI80SY.js";
|
|
17
17
|
import { c as c2, t, e, a as a3, b, d as d2 } from "./mc-toast-BfgI80SY.js";
|
|
18
18
|
import { M as v } from "./mc-step-DV4B5rZx.js";
|
|
19
|
-
import { M as y, b as C } from "./mc-form-
|
|
19
|
+
import { M as y, b as C } from "./mc-form-CtyDHg4u.js";
|
|
20
20
|
import { a as E } from "./mc-icon-BCR0XCJl.js";
|
|
21
21
|
import { M as I } from "./mc-success-icon-BBBRzpqR.js";
|
|
22
22
|
import { a as W, b as z } from "./mc-title-C0ioHCBh.js";
|
|
@@ -25,10 +25,10 @@ import { a as B } from "./mc-modal-header-0koUQimu.js";
|
|
|
25
25
|
import { M as D } from "./mc-drawer-B0OqoqTb.js";
|
|
26
26
|
import { M as F } from "./mc-reset-ism8Q2uZ.js";
|
|
27
27
|
import { M as G } from "./mc-divider-CetkEEWs.js";
|
|
28
|
-
import { M as H } from "./mc-lightbox-
|
|
28
|
+
import { M as H } from "./mc-lightbox-mmW3PJ5_.js";
|
|
29
29
|
import { M as J, a as K } from "./mc-upload-CLbFaxUl.js";
|
|
30
30
|
import { M as L } from "./mc-popper-DQ5aNdcl.js";
|
|
31
|
-
import { M as N } from "./mc-tooltip-
|
|
31
|
+
import { M as N } from "./mc-tooltip-CUwEXvHg.js";
|
|
32
32
|
const O = [r, p, T, S, l, n, g, x, h, i, o, M, P, q, v, y, C, f, j, E, I, W, A, z, B, D, k, w, F, G, H, J, K, L, N];
|
|
33
33
|
s();
|
|
34
34
|
const Q = m(O);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent as e, computed as c, watch as a, createElementBlock as l, openBlock as o, normalizeStyle as s, normalizeClass as t, createElementVNode as m, toDisplayString as r } from "vue";
|
|
2
|
+
import { u as n, a as d } from "./mc-form-CtyDHg4u.js";
|
|
3
|
+
import { _ as u, w as p } from "./utils-DVltbcaT.js";
|
|
4
|
+
const b = ["value", "disabled"], h = { class: "mc-checkbox__wrapper" }, k = { class: "mc-checkbox__content" }, i = { class: "mc-checkbox__content-text" }, x = { class: "mc-checkbox__content-remarks" }, _ = p(u(e({ name: "McCheckbox", __name: "mc-checkbox", props: { modelValue: { type: Boolean }, disabled: { type: Boolean }, content: {}, remarks: {}, partial: { type: Boolean } }, emits: ["change", "update:modelValue"], setup(e2, { emit: u2 }) {
|
|
5
|
+
const p2 = e2, _2 = u2, { formItem: v } = n(), V = d(), f = c(() => V.value), y = c(() => !f.value && "error" === (v == null ? void 0 : v.validateStatus)), g = () => {
|
|
6
|
+
p2.disabled || (_2("update:modelValue", !p2.modelValue), _2("change", !p2.modelValue));
|
|
7
|
+
};
|
|
8
|
+
return a(() => p2.modelValue, () => {
|
|
9
|
+
v == null ? void 0 : v.validate("change");
|
|
10
|
+
}), (e3, c2) => (o(), l("div", { class: t(["mc-checkbox", { "mc-checkbox--disabled": f.value, "mc-checkbox--error": y.value }]), style: s({ height: e3.remarks ? "40px" : "24px" }) }, [m("input", { type: "checkbox", class: "mc-checkbox__input", value: e3.modelValue, disabled: f.value }, null, 8, b), m("label", h, [m("span", { class: t(["mc-checkbox__checkbox", { "mc-checkbox__checkbox--checked": e3.modelValue, "mc-checkbox__checkbox--partial": e3.partial }]), onClick: g }, null, 2), m("div", k, [m("span", i, r(e3.content), 1), m("span", x, r(e3.remarks), 1)])])], 6));
|
|
11
|
+
} }), [["__scopeId", "data-v-39fb014e"]]));
|
|
12
|
+
export {
|
|
13
|
+
_ as M
|
|
14
|
+
};
|
|
@@ -3,7 +3,7 @@ import { a as q } from "./hooks-CaHRdMVi.js";
|
|
|
3
3
|
import { s as F, f as j, a as P, k as $, b as w, c as x, m as k, d as I, g as M, e as S, h as V, j as B } from "./vendor-DCLhrjBP.js";
|
|
4
4
|
import { _ as C, w as z } from "./utils-DVltbcaT.js";
|
|
5
5
|
import E from "async-validator";
|
|
6
|
-
import { _ as O } from "./mc-tooltip-
|
|
6
|
+
import { _ as O } from "./mc-tooltip-CUwEXvHg.js";
|
|
7
7
|
const A = Symbol("formContext"), D = Symbol("formItemContext");
|
|
8
8
|
function G() {
|
|
9
9
|
return { form: e(A, void 0), formItem: e(D, void 0) };
|
|
@@ -101,7 +101,7 @@ const J = { class: "mc-form" }, K = C(t({ name: "McForm", __name: "mc-form", pro
|
|
|
101
101
|
} }), [["__scopeId", "data-v-ac8f57c1"]]), Y = z(K), Z = z(X);
|
|
102
102
|
export {
|
|
103
103
|
Y as M,
|
|
104
|
-
|
|
104
|
+
H as a,
|
|
105
105
|
Z as b,
|
|
106
|
-
|
|
106
|
+
G as u
|
|
107
107
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject as e, computed as t, defineComponent as a, ref as u, onMounted as s, watch as l, createElementBlock as n, openBlock as r, normalizeStyle as c, normalizeClass as o, unref as i, createCommentVNode as p, createElementVNode as f, renderSlot as d, createBlock as m, createVNode as v, Fragment as y, nextTick as x, useSlots as h, reactive as _, watchEffect as g, provide as I } from "vue";
|
|
2
2
|
import { M as b } from "./mc-icon-BCR0XCJl.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as w, u as $ } from "./mc-form-CtyDHg4u.js";
|
|
4
4
|
import { b as k } from "./hooks-CaHRdMVi.js";
|
|
5
5
|
import { b as V, l as M, c as S, i as j } from "./vendor-DCLhrjBP.js";
|
|
6
6
|
import { _ as B, w as R } from "./utils-DVltbcaT.js";
|
|
@@ -2,7 +2,7 @@ import { defineComponent as e, ref as t, watch as o, nextTick as l, createElemen
|
|
|
2
2
|
import { M as h } from "./mc-overlay-BpXL4npx.js";
|
|
3
3
|
import { M as p } from "./mc-modal-header-0koUQimu.js";
|
|
4
4
|
import { M as g } from "./mc-footer-DQYguol3.js";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as x, u as b } from "./hooks-CaHRdMVi.js";
|
|
6
6
|
import { _ as y, w as _ } from "./utils-DVltbcaT.js";
|
|
7
7
|
const k = { key: 0, class: "mc-lightbox-container" }, $ = { class: "mc-lightbox-header" }, w = _(y(e({ name: "McLightbox", __name: "mc-lightbox", props: { modelValue: { type: Boolean, default: false }, title: {}, size: { default: "medium" }, maskClosable: { type: Boolean, default: true }, fixed: { type: Boolean, default: true }, portCssSelector: { default: "body" }, hideFooter: { type: Boolean, default: false } }, emits: ["update:modelValue", "close"], setup(e2, { expose: y2, emit: _2 }) {
|
|
8
8
|
const w2 = e2, C = _2, j = t(), B = t(), M = t(), R = t(), V = t(false), H = t(false), z = t(false), F = () => {
|
|
@@ -23,9 +23,9 @@ const k = { key: 0, class: "mc-lightbox-container" }, $ = { class: "mc-lightbox-
|
|
|
23
23
|
const e3 = 0.7 * window.innerHeight - 56 - B.value.offsetHeight, t2 = ((_a = R.value) == null ? void 0 : _a.offsetHeight) ?? 40;
|
|
24
24
|
M.value.style.height = `${t2 > e3 ? e3 : t2}px`;
|
|
25
25
|
};
|
|
26
|
-
return
|
|
26
|
+
return x(() => {
|
|
27
27
|
q();
|
|
28
|
-
}),
|
|
28
|
+
}), b(B, async ({ height: e3 }) => {
|
|
29
29
|
const t2 = j.value;
|
|
30
30
|
t2 && (t2.style.paddingBottom = `${e3}px`, await l(), q());
|
|
31
31
|
}), y2({ ref: j, open: I, close: L }), (e3, t2) => V.value ? (i(), a("div", k, [(i(), r(d, { to: e3.portCssSelector }, [f(u, { name: "mc-lightbox-overlay" }, { default: c(() => [f(h, { visible: H.value, fixed: e3.fixed, onClick: F }, { default: c(() => [f(u, { name: "mc-lightbox-content" }, { default: c(() => [z.value ? (i(), a("div", { key: 0, class: m(["mc-lightbox", [`mc-lightbox-${e3.size}`]]), ref_key: "lightboxRef", ref: j }, [n("div", $, [v(e3.$slots, "header", {}, () => [f(p, { title: e3.title, onClose: S }, { default: c(() => [v(e3.$slots, "header-title", {}, void 0, true)]), _: 3 }, 8, ["title"])], true)]), n("div", { class: "mc-lightbox-content-wrapper", ref_key: "wrapperRef", ref: M }, [n("div", { class: "mc-lightbox-content", ref_key: "contentRef", ref: R }, [v(e3.$slots, "default", {}, void 0, true)], 512)], 512), e3.hideFooter ? s("", true) : (i(), a("div", { key: 0, class: "mc-lightbox-footer", ref_key: "footerRef", ref: B }, [v(e3.$slots, "footer", {}, () => [f(g, null, { left: c(() => [v(e3.$slots, "footer-left", {}, void 0, true)]), right: c(() => [v(e3.$slots, "footer-right", {}, void 0, true)]), "right-button-group": c(() => [v(e3.$slots, "footer-right-button-group", {}, void 0, true)]), desc: c(() => [v(e3.$slots, "footer-desc", {}, void 0, true)]), _: 3 })], true)], 512))], 2)) : s("", true)]), _: 3 })]), _: 3 }, 8, ["visible", "fixed"])]), _: 3 })], 8, ["to"]))])) : s("", true);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as e, watch as a, provide as l, computed as o, createElementBlock as r, openBlock as s, renderSlot as d, inject as t, normalizeClass as c, createElementVNode as i, createCommentVNode as m, createTextVNode as u, toDisplayString as n, createVNode as p } from "vue";
|
|
2
|
+
import { u as v, a as b } from "./mc-form-CtyDHg4u.js";
|
|
3
|
+
import { _ as h, w as _ } from "./utils-DVltbcaT.js";
|
|
4
|
+
import { _ as f } from "./mc-tooltip-CUwEXvHg.js";
|
|
5
|
+
const k = Symbol("selectContext"), g = { class: "mc-radio-group" }, y = h(e({ name: "McRadioGroup", __name: "mc-radio-group", props: { modelValue: { type: [Number, String, Boolean] }, disabled: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: t2 }) {
|
|
6
|
+
const c2 = e2, i2 = t2, { formItem: m2 } = v();
|
|
7
|
+
return a(() => c2.modelValue, () => {
|
|
8
|
+
m2 == null ? void 0 : m2.validate("change");
|
|
9
|
+
}), l(k, { hasError: o(() => "error" === (m2 == null ? void 0 : m2.validateStatus)), modelValue: o(() => c2.modelValue), disabled: o(() => c2.disabled), handleSelect: (e3) => {
|
|
10
|
+
i2("update:modelValue", e3), i2("change", e3);
|
|
11
|
+
} }), (e3, a2) => (s(), r("div", g, [d(e3.$slots, "default", {}, void 0, true)]));
|
|
12
|
+
} }), [["__scopeId", "data-v-152cbc8e"]]), V = ["disabled"], S = { class: "mc-radio-content" }, $ = { key: 0, class: "mc-radio-help" }, B = { class: "mc-radio-remark" }, j = h(e({ name: "McRadio", __name: "mc-radio", props: { label: {}, value: { type: [Number, String, Boolean] }, disabled: { type: Boolean }, remark: {}, help: {} }, setup(e2) {
|
|
13
|
+
const a2 = e2, l2 = t(k), v2 = o(() => {
|
|
14
|
+
var _a;
|
|
15
|
+
return ((_a = l2 == null ? void 0 : l2.modelValue) == null ? void 0 : _a.value) === a2.value;
|
|
16
|
+
}), h2 = b(), _2 = o(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
return ((_a = l2 == null ? void 0 : l2.disabled) == null ? void 0 : _a.value) || h2.value;
|
|
19
|
+
}), g2 = o(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
return !_2.value && ((_a = l2 == null ? void 0 : l2.hasError) == null ? void 0 : _a.value);
|
|
22
|
+
}), y2 = () => {
|
|
23
|
+
_2.value || (l2 == null ? void 0 : l2.handleSelect(a2.value));
|
|
24
|
+
};
|
|
25
|
+
return (e3, a3) => (s(), r("div", { class: c(["mc-radio", { "mc-radio-has-remark": !!e3.remark }]) }, [i("label", { class: c(["mc-radio-label", { "mc-radio-checked": v2.value, "mc-radio-disabled": _2.value, "mc-radio-error": g2.value }]), onClick: y2 }, [i("input", { type: "radio", class: "mc-radio-input", disabled: _2.value }, null, 8, V), a3[0] || (a3[0] = i("span", { class: "mc-radio-circle" }, null, -1)), i("div", S, [d(e3.$slots, "default", {}, () => [u(n(e3.label), 1)], true)]), e3.help || e3.$slots.help ? (s(), r("div", $, [d(e3.$slots, "help", {}, () => [p(f, { content: e3.help, "icon-size": 24 }, null, 8, ["content"])], true)])) : m("", true)], 2), i("div", B, [d(e3.$slots, "remark", {}, () => [u(n(e3.remark), 1)], true)])], 2));
|
|
26
|
+
} }), [["__scopeId", "data-v-cc9e26bd"]]), I = _(y), M = _(j);
|
|
27
|
+
export {
|
|
28
|
+
M,
|
|
29
|
+
I as a
|
|
30
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as e, ref as l, computed as a, watch as t, provide as s, createElementBlock as c, openBlock as o, normalizeStyle as u, normalizeClass as i, unref as d, createElementVNode as r, createVNode as v, createCommentVNode as n, createBlock as p, resolveDynamicComponent as m, withDirectives as h, vModelText as f, Transition as _, withCtx as g, renderSlot as w, createTextVNode as y, vShow as b, inject as k, useSlots as x, onMounted as S, onBeforeUnmount as V, h as O, toDisplayString as j, toRefs as B, useAttrs as C, toValue as I } from "vue";
|
|
2
2
|
import { M } from "./mc-icon-BCR0XCJl.js";
|
|
3
3
|
import { b as $, d as R } from "./hooks-CaHRdMVi.js";
|
|
4
|
-
import {
|
|
5
|
-
import { u as G } from "./mc-input-
|
|
4
|
+
import { a as F, u as N } from "./mc-form-CtyDHg4u.js";
|
|
5
|
+
import { u as G } from "./mc-input-DgyxwBEp.js";
|
|
6
6
|
import { c as P, p as z } from "./vendor-DCLhrjBP.js";
|
|
7
7
|
import { _ as A, w as D } from "./utils-DVltbcaT.js";
|
|
8
8
|
const T = Symbol("selectContext"), U = Symbol("selectGroupContext"), q = { key: 0, class: "mc-select-selected-content" }, E = { class: "mc-select-input-wrapper" }, H = ["placeholder", "readonly", "disabled"], J = { class: "mc-select-dropdown-wrapper" }, K = { class: "mc-select-dropdown" }, L = { key: 0, class: "mc-select-no-data" }, Q = A(e({ name: "McSelect", __name: "mc-select", props: { modelValue: { default: "" }, placeholder: { default: "Please select" }, disabled: { type: Boolean }, type: { default: "single" }, width: {}, height: {}, search: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: k2 }) {
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { defineComponent as e, computed as a, createElementBlock as l, createCommentVNode as t, openBlock as n, normalizeClass as o, renderSlot as s, Fragment as i, 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, withDirectives as k, vModelSelect as S, onMounted as x, nextTick as C, toRefs as R, normalizeProps as I, guardReactiveProps as z, watchEffect as M, h as $, onUnmounted as T, resolveDynamicComponent as P } from "vue";
|
|
2
|
+
import { M as H } from "./mc-checkbox-C6TCo4xL.js";
|
|
3
|
+
import { _ as W, w as A } from "./utils-DVltbcaT.js";
|
|
4
|
+
import { M as B } from "./mc-icon-BCR0XCJl.js";
|
|
5
|
+
import { m as O, f as L, r as D, q as N } from "./vendor-DCLhrjBP.js";
|
|
6
|
+
const V = ["rowspan", "colspan"], K = W(e({ __name: "mc-table-cell", props: { row: {}, column: {}, rowIndex: {}, columnIndex: {}, pagination: {}, spanMethod: { type: Function } }, setup(e2) {
|
|
7
|
+
const u2 = e2, d2 = a(() => u2.row[u2.column.prop]), p2 = a(() => {
|
|
8
|
+
const e3 = [u2.column.className];
|
|
9
|
+
if (u2.column.align && e3.push(`is-${u2.column.align}`), u2.column.fixed) {
|
|
10
|
+
const a3 = "boolean" == typeof u2.column.fixed ? "left" : u2.column.fixed;
|
|
11
|
+
e3.push(`is-fixed-${a3}`);
|
|
12
|
+
}
|
|
13
|
+
const a2 = 0 === f2.value ? "none" : "table-cell";
|
|
14
|
+
return e3.push(`is-display-${a2}`), e3;
|
|
15
|
+
}), g2 = () => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
return ((_a = u2.pagination) == null ? void 0 : _a.currentPage) && ((_b = u2.pagination) == null ? void 0 : _b.pageSize) ? (u2.pagination.currentPage - 1) * u2.pagination.pageSize + u2.rowIndex : u2.rowIndex;
|
|
18
|
+
}, v2 = () => {
|
|
19
|
+
if (!u2.spanMethod) return null;
|
|
20
|
+
const e3 = g2();
|
|
21
|
+
return u2.spanMethod({ row: u2.row, column: u2.column, rowIndex: e3, columnIndex: u2.columnIndex });
|
|
22
|
+
}, m2 = (e3, a2) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
if (!((_a = u2.pagination) == null ? void 0 : _a.currentPage) || !((_b = u2.pagination) == null ? void 0 : _b.pageSize) || a2 <= 1) return true;
|
|
25
|
+
const l2 = (u2.pagination.currentPage - 1) * u2.pagination.pageSize, t2 = l2 + u2.pagination.pageSize - 1, n2 = e3;
|
|
26
|
+
return !(e3 + a2 - 1 < l2 || n2 > t2) && Math.max(n2, l2) === e3;
|
|
27
|
+
}, h2 = a(() => {
|
|
28
|
+
const e3 = v2();
|
|
29
|
+
if (e3) {
|
|
30
|
+
const a2 = g2();
|
|
31
|
+
let l2;
|
|
32
|
+
return l2 = Array.isArray(e3) ? e3[0] : e3.rowspan || 1, l2 > 1 ? m2(a2, l2) ? ((e4, a3) => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
if (!((_a = u2.pagination) == null ? void 0 : _a.currentPage) || !((_b = u2.pagination) == null ? void 0 : _b.pageSize) || a3 <= 1) return a3;
|
|
35
|
+
const l3 = (u2.pagination.currentPage - 1) * u2.pagination.pageSize, t2 = l3 + u2.pagination.pageSize - 1, n2 = e4, o2 = e4 + a3 - 1, s2 = Math.max(n2, l3);
|
|
36
|
+
return Math.min(o2, t2) - s2 + 1;
|
|
37
|
+
})(a2, l2) : 0 : l2;
|
|
38
|
+
}
|
|
39
|
+
if (u2.column.rowSpan) return "function" == typeof u2.column.rowSpan ? u2.column.rowSpan(u2.row, u2.column, u2.rowIndex) : u2.column.rowSpan;
|
|
40
|
+
}), f2 = a(() => {
|
|
41
|
+
const e3 = v2();
|
|
42
|
+
return e3 ? Array.isArray(e3) ? e3[1] : e3.colspan : u2.column.colSpan ? "function" == typeof u2.column.colSpan ? u2.column.colSpan(u2.row, u2.column, u2.rowIndex) : u2.column.colSpan : void 0;
|
|
43
|
+
}), b2 = a(() => {
|
|
44
|
+
const e3 = v2();
|
|
45
|
+
if (e3) {
|
|
46
|
+
const a2 = g2();
|
|
47
|
+
let l2, t2;
|
|
48
|
+
return Array.isArray(e3) ? (l2 = e3[0], t2 = e3[1]) : (l2 = e3.rowspan || 1, t2 = e3.colspan || 1), !(l2 > 1 && !m2(a2, l2) || 0 === l2 || 0 === t2);
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
});
|
|
52
|
+
return (e3, a2) => b2.value ? (n(), l("td", { key: 0, class: o(p2.value), rowspan: h2.value, colspan: f2.value }, [s(e3.$slots, "cell", { row: e3.row, column: e3.column, index: e3.rowIndex, value: d2.value, prop: e3.column.prop }, () => [s(e3.$slots, e3.column.slot || e3.column.prop, { row: e3.row, column: e3.column, index: e3.rowIndex, value: d2.value }, () => [e3.column.formatter ? (n(), l(i, { key: 0 }, [c(r(e3.column.formatter(e3.row, e3.column, d2.value, e3.rowIndex)), 1)], 64)) : (n(), l(i, { key: 1 }, [c(r(d2.value), 1)], 64))], true)], true)], 10, V)) : t("", true);
|
|
53
|
+
} }), [["__scopeId", "data-v-810a226e"]]), j = { class: "mc-table__body", cellspacing: "0", cellpadding: "0", border: "0" }, E = { key: 0, width: "50" }, F = ["width"], U = ["onClick"], q = { key: 0, class: "mc-table__selection-column" }, X = { class: "mc-table__cell" }, G = { key: 1 }, J = ["colspan"], Q = { key: 1 }, Y = W(e({ __name: "mc-table-body", props: { data: {}, columns: {}, rowKey: {}, emptyText: {}, height: {}, maxHeight: {}, pagination: {}, spanMethod: {}, getRowClass: {}, selectable: { type: Boolean, default: false }, selectedRows: {}, selectOnRowClick: { type: Boolean, default: false } }, emits: ["row-click", "select"], setup(e2, { expose: c2, emit: w2 }) {
|
|
54
|
+
const k2 = e2, S2 = u(), x2 = w2, C2 = d(), R2 = a(() => {
|
|
55
|
+
const e3 = {};
|
|
56
|
+
return k2.height && (e3.height = "number" == typeof k2.height ? `${k2.height}px` : k2.height), k2.maxHeight && (e3.maxHeight = "number" == typeof k2.maxHeight ? `${k2.maxHeight}px` : k2.maxHeight), e3;
|
|
57
|
+
}), I2 = a(() => k2.pagination), z2 = (e3, a2) => k2.rowKey ? e3[k2.rowKey] : a2, M2 = (e3, a2) => k2.getRowClass ? k2.getRowClass(e3, a2) : [], $2 = (e3) => !!k2.selectedRows && k2.selectedRows.some((a2) => k2.rowKey ? a2[k2.rowKey] === e3[k2.rowKey] : a2 === e3);
|
|
58
|
+
return c2({ bodyWrapper: C2 }), (e3, a2) => (n(), l("div", { class: "mc-table__body-wrapper", ref_key: "bodyWrapper", ref: C2, style: p(R2.value) }, [g("table", j, [g("colgroup", null, [e3.selectable ? (n(), l("col", E)) : t("", true), (n(true), l(i, null, v(e3.columns, (e4, a3) => (n(), l("col", { key: a3, width: e4.width }, null, 8, F))), 128))]), g("tbody", null, [e3.data && e3.data.length > 0 ? (n(true), l(i, { key: 0 }, v(e3.data, (a3, c3) => (n(), l("tr", { key: z2(a3, c3), class: o(M2(a3, c3)), onClick: (e4) => ((e5, a4) => {
|
|
59
|
+
x2("row-click", e5, a4);
|
|
60
|
+
})(a3, c3) }, [e3.selectable ? (n(), l("td", q, [g("div", X, [m(h(H), { "model-value": $2(a3), onChange: (e4) => ((e5, a4) => {
|
|
61
|
+
x2("select", e5, a4);
|
|
62
|
+
})(a3, e4) }, null, 8, ["model-value", "onChange"])])])) : t("", true), (n(true), l(i, null, v(e3.columns, (l2, t2) => (n(), f(K, { key: t2, row: a3, column: l2, "row-index": c3, "column-index": t2, "span-method": e3.spanMethod, pagination: I2.value }, b({ _: 2 }, [v(Object.keys(e3.$slots), (a4) => ({ name: a4, fn: _((l3) => [s(e3.$slots, a4, y({ ref_for: true }, l3), void 0, true)]) }))]), 1032, ["row", "column", "row-index", "column-index", "span-method", "pagination"]))), 128))], 10, U))), 128)) : (n(), l("tr", G, [g("td", { colspan: k2.selectable ? k2.columns.length + 1 : k2.columns.length, class: "mc-table__empty-cell" }, [h(S2).empty ? s(e3.$slots, "empty", { key: 0 }, void 0, true) : (n(), l("div", Q, r(e3.emptyText), 1))], 8, J)]))])])], 4));
|
|
63
|
+
} }), [["__scopeId", "data-v-6f0f6183"]]), Z = { class: "mc-table__header", cellspacing: "0", cellpadding: "0", border: "0" }, ee = { key: 0, width: "50" }, ae = ["width"], le = { key: 0, class: "mc-table__selection-column" }, te = { class: "mc-table__header-cell" }, ne = ["onClick"], oe = { class: "mc-table__header-cell" }, se = { class: "mc-table__header-label" }, ie = { key: 0, class: "mc-table__sort-caret" }, ce = W(e({ __name: "mc-table-header", props: { columns: {}, showHeader: { type: Boolean, default: true }, getSortOrder: { type: Function, default: () => null }, selectable: { type: Boolean, default: false }, isAllSelected: { type: Boolean, default: false }, isIndeterminate: { type: Boolean, default: false } }, emits: ["header-click", "sort-change", "select-all"], setup(e2, { expose: a2, emit: u2 }) {
|
|
64
|
+
const p2 = e2, b2 = u2, _2 = d(), y2 = (e3) => {
|
|
65
|
+
const a3 = [];
|
|
66
|
+
if (e3.headerClassName && a3.push(e3.headerClassName), e3.align && a3.push(`is-${e3.align}`), e3.fixed) {
|
|
67
|
+
const l3 = "boolean" == typeof e3.fixed ? "left" : e3.fixed;
|
|
68
|
+
a3.push(`is-fixed-${l3}`);
|
|
69
|
+
}
|
|
70
|
+
e3.sortable && a3.push("is-sortable");
|
|
71
|
+
const l2 = w2(e3.prop);
|
|
72
|
+
return l2 && a3.push(l2), a3;
|
|
73
|
+
}, w2 = (e3) => {
|
|
74
|
+
const a3 = p2.getSortOrder(e3);
|
|
75
|
+
return "asc" === a3 ? "is-sort-asc" : "desc" === a3 ? "is-sort-desc" : "";
|
|
76
|
+
}, k2 = (e3) => {
|
|
77
|
+
b2("select-all", e3);
|
|
78
|
+
};
|
|
79
|
+
return a2({ headerWrapper: _2 }), (e3, a3) => e3.showHeader ? (n(), l("div", { key: 0, class: "mc-table__header-wrapper", ref_key: "headerWrapper", ref: _2 }, [g("table", Z, [g("colgroup", null, [e3.selectable ? (n(), l("col", ee)) : t("", true), (n(true), l(i, null, v(e3.columns, (e4, a4) => (n(), l("col", { key: a4, width: e4.width }, null, 8, ae))), 128))]), g("thead", null, [g("tr", null, [e3.selectable ? (n(), l("th", le, [g("div", te, [m(h(H), { "model-value": e3.isAllSelected, partial: e3.isIndeterminate, onChange: k2 }, null, 8, ["model-value", "partial"])])])) : t("", true), (n(true), l(i, null, v(e3.columns, (a4, i2) => (n(), l("th", { key: i2, class: o(y2(a4)), onClick: (e4) => ((e5, a5) => {
|
|
80
|
+
e5.sortable && b2("sort-change", e5), b2("header-click", e5, a5);
|
|
81
|
+
})(a4, e4) }, [g("div", oe, [g("span", se, [s(e3.$slots, `header-${a4.slot || a4.prop}`, { column: a4, index: i2 }, () => [c(r(a4.label), 1)], true)]), a4.sortable ? (n(), l("span", ie, ["asc" === e3.getSortOrder(a4.prop) ? (n(), f(B, { key: 0, name: "Up-Chevron02", class: o(["mc-table__sort-icon", { "is-active": "asc" === e3.getSortOrder(a4.prop) }]) }, null, 8, ["class"])) : (n(), f(B, { key: 1, name: "Down-Chevron02", class: o(["mc-table__sort-icon", { "is-active": "desc" === e3.getSortOrder(a4.prop) }]) }, null, 8, ["class"]))])) : t("", true)])], 10, ne))), 128))])])])], 512)) : t("", true);
|
|
82
|
+
} }), [["__scopeId", "data-v-aeeaf4a9"]]), re = { class: "mc-table__loading-content" }, ue = { class: "mc-table__loading-spinner" }, de = { key: 0, class: "mc-table__spinner mc-table__spinner--default" }, pe = { key: 1, class: "mc-table__spinner mc-table__spinner--circle" }, ge = { key: 2, class: "mc-table__spinner mc-table__spinner--pulse" }, ve = ["innerHTML"], me = { key: 0, class: "mc-table__loading-text" }, he = W(e({ __name: "mc-table-loading", props: { loading: { type: Boolean, default: false }, loadingText: { default: "Loading..." }, loadingConfig: { default: () => ({ spinner: "default" }) } }, setup(e2) {
|
|
83
|
+
const i2 = e2, c2 = a(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
return ((_a = i2.loadingConfig) == null ? void 0 : _a.text) || i2.loadingText;
|
|
86
|
+
}), u2 = a(() => {
|
|
87
|
+
var _a;
|
|
88
|
+
const e3 = {};
|
|
89
|
+
return ((_a = i2.loadingConfig) == null ? void 0 : _a.background) && (e3.backgroundColor = i2.loadingConfig.background), e3;
|
|
90
|
+
});
|
|
91
|
+
return (e3, a2) => {
|
|
92
|
+
var _a;
|
|
93
|
+
return e3.loading ? (n(), l("div", { key: 0, class: o(["mc-table__loading-wrapper", ["mc-table__loading-wrapper", (_a = e3.loadingConfig) == null ? void 0 : _a.customClass]]), style: p(u2.value) }, [g("div", re, [s(e3.$slots, "loading", { loading: e3.loading, text: c2.value }, () => {
|
|
94
|
+
var _a2;
|
|
95
|
+
return [g("div", ue, [((_a2 = e3.loadingConfig) == null ? void 0 : _a2.spinner) && "default" !== e3.loadingConfig.spinner ? "circle" === e3.loadingConfig.spinner ? (n(), l("div", pe)) : "pulse" === e3.loadingConfig.spinner ? (n(), l("div", ge)) : (n(), l("div", { key: 3, class: "mc-table__spinner mc-table__spinner--custom", innerHTML: e3.loadingConfig.spinner }, null, 8, ve)) : (n(), l("div", de, a2[0] || (a2[0] = [g("div", { class: "mc-table__spinner-dot" }, null, -1), g("div", { class: "mc-table__spinner-dot" }, null, -1), g("div", { class: "mc-table__spinner-dot" }, null, -1), g("div", { class: "mc-table__spinner-dot" }, null, -1)])))]), c2.value ? (n(), l("div", me, r(c2.value), 1)) : t("", true)];
|
|
96
|
+
}, true)])], 6)) : t("", true);
|
|
97
|
+
};
|
|
98
|
+
} }), [["__scopeId", "data-v-f10577d2"]]), fe = { key: 0, class: "mc-table__pagination" }, be = { class: "mc-table__pagination-info" }, _e = { class: "mc-table__pagination-controls" }, ye = ["onClick"], we = { key: 1, class: "mc-table__pagination-ellipsis" }, ke = { class: "mc-table__pagination-size" }, Se = ["value"], xe = W(e({ __name: "mc-table-pagination", props: { pagination: {} }, emits: ["page-change"], setup(e2, { emit: s2 }) {
|
|
99
|
+
var _a, _b, _c;
|
|
100
|
+
const c2 = e2, u2 = s2, p2 = d(((_a = c2.pagination) == null ? void 0 : _a.currentPage) || 1), h2 = d(((_b = c2.pagination) == null ? void 0 : _b.pageSize) || 50), f2 = d(((_c = c2.pagination) == null ? void 0 : _c.pageSizes) || [25, 50, 75, 100]);
|
|
101
|
+
w(() => {
|
|
102
|
+
var _a2;
|
|
103
|
+
return (_a2 = c2.pagination) == null ? void 0 : _a2.currentPage;
|
|
104
|
+
}, (e3) => {
|
|
105
|
+
void 0 !== e3 && (p2.value = e3);
|
|
106
|
+
}), w(() => {
|
|
107
|
+
var _a2;
|
|
108
|
+
return (_a2 = c2.pagination) == null ? void 0 : _a2.pageSize;
|
|
109
|
+
}, (e3) => {
|
|
110
|
+
void 0 !== e3 && (h2.value = e3);
|
|
111
|
+
});
|
|
112
|
+
const b2 = a(() => c2.pagination ? Math.ceil(c2.pagination.total / h2.value) : 1), _2 = a(() => c2.pagination && 0 !== c2.pagination.total ? (p2.value - 1) * h2.value + 1 : 0), y2 = a(() => {
|
|
113
|
+
if (!c2.pagination) return 0;
|
|
114
|
+
const e3 = p2.value * h2.value;
|
|
115
|
+
return Math.min(e3, c2.pagination.total);
|
|
116
|
+
}), x2 = a(() => {
|
|
117
|
+
const e3 = b2.value, a2 = p2.value, l2 = [];
|
|
118
|
+
if (e3 <= 7) for (let a3 = 1; a3 <= e3; a3++) l2.push(a3);
|
|
119
|
+
else if (l2.push(1), a2 <= 4) {
|
|
120
|
+
for (let e4 = 2; e4 <= 5; e4++) l2.push(e4);
|
|
121
|
+
l2.push("..."), l2.push(e3);
|
|
122
|
+
} else if (a2 >= e3 - 3) {
|
|
123
|
+
l2.push("...");
|
|
124
|
+
for (let a3 = e3 - 4; a3 <= e3; a3++) l2.push(a3);
|
|
125
|
+
} else {
|
|
126
|
+
l2.push("...");
|
|
127
|
+
for (let e4 = a2 - 1; e4 <= a2 + 1; e4++) l2.push(e4);
|
|
128
|
+
l2.push("..."), l2.push(e3);
|
|
129
|
+
}
|
|
130
|
+
return l2;
|
|
131
|
+
}), C2 = (e3, a2) => {
|
|
132
|
+
e3 < 1 || e3 > b2.value || a2 || (p2.value = e3, u2("page-change", { pageSize: h2.value, pageNum: e3 }));
|
|
133
|
+
}, R2 = () => {
|
|
134
|
+
p2.value = 1, u2("page-change", { pageSize: h2.value, pageNum: 1 });
|
|
135
|
+
};
|
|
136
|
+
return (e3, a2) => e3.pagination ? (n(), l("div", fe, [g("div", be, "Showing " + r(_2.value) + "-" + r(y2.value) + " of " + r(e3.pagination.total), 1), g("div", _e, [m(B, { name: "First", class: o({ "mc-table__icon": true, "is-disabled": p2.value <= 1 }), size: 24, onClick: a2[0] || (a2[0] = (e4) => C2(1, p2.value <= 1)) }, null, 8, ["class"]), m(B, { name: "Left-Chevron", class: o({ "mc-table__icon": true, "is-disabled": p2.value <= 1 }), size: 24, onClick: a2[1] || (a2[1] = (e4) => C2(p2.value - 1, p2.value <= 1)) }, null, 8, ["class"]), (n(true), l(i, null, v(x2.value, (e4) => (n(), l(i, { key: e4 }, ["..." !== e4 ? (n(), l("button", { key: 0, class: o(["mc-table__pagination-button mc-table__pagination-button--page", { "is-active": e4 === p2.value }]), onClick: (a3) => "number" == typeof e4 ? C2(e4, false) : void 0 }, r(e4), 11, ye)) : (n(), l("span", we, "..."))], 64))), 128)), m(B, { name: "Right-Chevron", class: o({ "mc-table__icon": true, "is-disabled": p2.value >= b2.value }), size: 24, onClick: a2[2] || (a2[2] = (e4) => C2(p2.value + 1, p2.value >= b2.value)) }, null, 8, ["class"]), m(B, { name: "Last", class: o({ "mc-table__icon": true, "is-disabled": p2.value >= b2.value }), size: 24, onClick: a2[3] || (a2[3] = (e4) => C2(b2.value, p2.value >= b2.value)) }, null, 8, ["class"])]), g("div", ke, [a2[5] || (a2[5] = g("label", { class: "mc-table__pagination-size-label" }, "View per page", -1)), f2.value && f2.value.length > 0 ? k((n(), l("select", { key: 0, class: "mc-table__pagination-select", "onUpdate:modelValue": a2[4] || (a2[4] = (e4) => h2.value = e4), onChange: R2 }, [(n(true), l(i, null, v(f2.value, (e4) => (n(), l("option", { key: e4, value: e4 }, r(e4), 9, Se))), 128))], 544)), [[S, h2.value]]) : t("", true)])])) : t("", true);
|
|
137
|
+
} }), [["__scopeId", "data-v-8d46d02d"]]);
|
|
138
|
+
function Ce(e2, l2) {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
const t2 = d(((_a = l2.value) == null ? void 0 : _a.currentPage) || 1), n2 = d(((_b = l2.value) == null ? void 0 : _b.pageSize) || 50);
|
|
141
|
+
w(() => {
|
|
142
|
+
var _a2;
|
|
143
|
+
return (_a2 = l2.value) == null ? void 0 : _a2.currentPage;
|
|
144
|
+
}, (e3) => {
|
|
145
|
+
void 0 !== e3 && (t2.value = e3);
|
|
146
|
+
}), w(() => {
|
|
147
|
+
var _a2;
|
|
148
|
+
return (_a2 = l2.value) == null ? void 0 : _a2.pageSize;
|
|
149
|
+
}, (e3) => {
|
|
150
|
+
void 0 !== e3 && (n2.value = e3);
|
|
151
|
+
});
|
|
152
|
+
const o2 = a(() => {
|
|
153
|
+
if (!l2.value) return e2.value;
|
|
154
|
+
const a2 = (t2.value - 1) * n2.value, o3 = a2 + n2.value;
|
|
155
|
+
return e2.value.slice(a2, o3);
|
|
156
|
+
}), s2 = a(() => {
|
|
157
|
+
if (!l2.value) return { currentPage: 1, pageSize: e2.value.length, total: e2.value.length, totalPages: 1 };
|
|
158
|
+
const a2 = l2.value.total, o3 = Math.ceil(a2 / n2.value);
|
|
159
|
+
return { currentPage: t2.value, pageSize: n2.value, total: a2, totalPages: o3 };
|
|
160
|
+
});
|
|
161
|
+
return { currentPage: t2, pageSize: n2, paginatedData: o2, paginationInfo: s2, updatePagination: function(e3) {
|
|
162
|
+
t2.value = e3.pageNum, n2.value = e3.pageSize;
|
|
163
|
+
} };
|
|
164
|
+
}
|
|
165
|
+
function Re(e2, l2, t2) {
|
|
166
|
+
const n2 = d(false), o2 = d(null), s2 = a(() => n2.value ? e2.value : e2.value.map((e3) => ({ ...e3, fixed: void 0 })));
|
|
167
|
+
function i2() {
|
|
168
|
+
o2.value && (n2.value = o2.value.scrollWidth > o2.value.clientWidth);
|
|
169
|
+
}
|
|
170
|
+
function c2() {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
((_a = l2.value) == null ? void 0 : _a.headerWrapper) && ((_b = t2.value) == null ? void 0 : _b.bodyWrapper) && (l2.value.headerWrapper.scrollLeft = t2.value.bodyWrapper.scrollLeft);
|
|
173
|
+
}
|
|
174
|
+
function r2() {
|
|
175
|
+
C(() => {
|
|
176
|
+
var _a;
|
|
177
|
+
((_a = t2.value) == null ? void 0 : _a.bodyWrapper) && (o2.value = t2.value.bodyWrapper, i2(), new ResizeObserver(() => {
|
|
178
|
+
i2();
|
|
179
|
+
}).observe(t2.value.bodyWrapper), window.addEventListener("resize", i2), t2.value.bodyWrapper.addEventListener("scroll", c2));
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return x(() => {
|
|
183
|
+
r2();
|
|
184
|
+
}), { hasHorizontalScroll: n2, columnsWithFixed: s2, checkHorizontalScroll: i2, syncHeaderScroll: c2, initScrollSync: r2 };
|
|
185
|
+
}
|
|
186
|
+
function Ie(e2, l2, t2) {
|
|
187
|
+
const n2 = d(t2 || null);
|
|
188
|
+
return { sortedData: a(() => {
|
|
189
|
+
if (!n2.value || !n2.value.order) return e2.value;
|
|
190
|
+
const { prop: a2, order: t3 } = n2.value, o2 = l2.value.find((e3) => e3.prop === a2);
|
|
191
|
+
if (!o2) return e2.value;
|
|
192
|
+
const s2 = [...e2.value];
|
|
193
|
+
return s2.sort((e3, l3) => {
|
|
194
|
+
let n3 = e3[a2], s3 = l3[a2];
|
|
195
|
+
if (o2.sortMethod) {
|
|
196
|
+
const e4 = o2.sortMethod(n3, s3);
|
|
197
|
+
return "desc" === t3 ? -e4 : e4;
|
|
198
|
+
}
|
|
199
|
+
return null == n3 && (n3 = ""), null == s3 && (s3 = ""), "string" == typeof n3 && "string" == typeof s3 && (n3 = n3.toLowerCase(), s3 = s3.toLowerCase()), n3 < s3 ? "asc" === t3 ? -1 : 1 : n3 > s3 ? "asc" === t3 ? 1 : -1 : 0;
|
|
200
|
+
}), s2;
|
|
201
|
+
}), currentSort: n2, handleSort: function(e3) {
|
|
202
|
+
if (!e3.sortable) return;
|
|
203
|
+
const { prop: a2 } = e3;
|
|
204
|
+
let l3 = "asc";
|
|
205
|
+
return n2.value && n2.value.prop === a2 && (l3 = "asc" === n2.value.order ? "desc" : "desc" === n2.value.order ? null : "asc"), n2.value = null === l3 ? null : { prop: a2, order: l3 }, n2.value;
|
|
206
|
+
}, getSortOrder: function(e3) {
|
|
207
|
+
return n2.value && n2.value.prop === e3 ? n2.value.order : null;
|
|
208
|
+
} };
|
|
209
|
+
}
|
|
210
|
+
const ze = A(W(e({ name: "McTable", __name: "mc-table", props: { data: {}, columns: {}, showHeader: { type: Boolean, default: true }, height: {}, maxHeight: {}, rowKey: {}, emptyText: { default: "No Data" }, pagination: {}, loading: { type: Boolean, default: false }, loadingText: { default: "Loading..." }, loadingConfig: {}, highlightCurrentRow: { type: Boolean, default: false }, selectable: { type: Boolean, default: false }, selectedRows: {}, selectOnRowClick: { type: Boolean, default: false }, spanMethod: {}, isInitTableData: { type: Boolean, default: true }, initTableData: {}, defaultSort: {} }, emits: ["row-click", "header-click", "page-change", "sort-change", "current-change", "selection-change", "select", "select-all", "update:selectedRows"], setup(e2, { expose: i2, emit: c2 }) {
|
|
211
|
+
const r2 = e2, { data: u2, columns: p2, pagination: g2, spanMethod: y2, loading: k2, loadingText: S2, loadingConfig: M2, defaultSort: $2, highlightCurrentRow: T2, rowKey: P2, selectable: H2, selectedRows: W2, selectOnRowClick: A2 } = R(r2), B2 = d(u2.value), O2 = c2, L2 = d(), D2 = d(), N2 = d(), { columnsWithFixed: V2 } = Re(p2, D2, N2), { sortedData: K2, handleSort: j2, getSortOrder: E2 } = Ie(B2, V2, $2 == null ? void 0 : $2.value), { paginatedData: F2, updatePagination: U2 } = Ce(K2, g2), q2 = a(() => F2.value), { internalSelectedRows: X2, isAllSelected: G2, isIndeterminate: J2, toggleRowSelection: Q2, toggleAllSelection: Z2, clearSelection: ee2, getSelectedRows: ae2 } = function(e3, l2, t2) {
|
|
212
|
+
const n2 = d((t2 == null ? void 0 : t2.value) || []);
|
|
213
|
+
w(t2, (e4) => {
|
|
214
|
+
e4 && (n2.value = [...e4]);
|
|
215
|
+
}, { deep: true, immediate: true });
|
|
216
|
+
const o2 = (e4) => n2.value.some((a2) => l2.value ? a2[l2.value] === e4[l2.value] : a2 === e4), s2 = () => e3.value.filter((e4) => o2(e4)).length, i3 = a(() => !!e3.value.length && e3.value.every((e4) => o2(e4))), c3 = a(() => {
|
|
217
|
+
if (!e3.value.length) return false;
|
|
218
|
+
const a2 = s2();
|
|
219
|
+
return a2 > 0 && a2 < e3.value.length;
|
|
220
|
+
});
|
|
221
|
+
return { internalSelectedRows: n2, isRowSelected: o2, isAllSelected: i3, isIndeterminate: c3, toggleRowSelection: (e4, a2) => {
|
|
222
|
+
const t3 = void 0 !== a2 ? a2 : !o2(e4);
|
|
223
|
+
if (t3) o2(e4) || n2.value.push(e4);
|
|
224
|
+
else {
|
|
225
|
+
const a3 = n2.value.findIndex((a4) => l2.value ? a4[l2.value] === e4[l2.value] : a4 === e4);
|
|
226
|
+
a3 > -1 && n2.value.splice(a3, 1);
|
|
227
|
+
}
|
|
228
|
+
return t3;
|
|
229
|
+
}, toggleAllSelection: (a2) => {
|
|
230
|
+
a2 ? e3.value.forEach((e4) => {
|
|
231
|
+
o2(e4) || n2.value.push(e4);
|
|
232
|
+
}) : e3.value.forEach((e4) => {
|
|
233
|
+
const a3 = n2.value.findIndex((a4) => l2.value ? a4[l2.value] === e4[l2.value] : a4 === e4);
|
|
234
|
+
a3 > -1 && n2.value.splice(a3, 1);
|
|
235
|
+
});
|
|
236
|
+
}, clearSelection: () => {
|
|
237
|
+
n2.value = [];
|
|
238
|
+
}, getSelectedRows: () => [...n2.value], getCurrentPageSelectionInfo: () => {
|
|
239
|
+
const a2 = e3.value.length, l3 = s2();
|
|
240
|
+
return { totalCount: a2, selectedCount: l3, isAllSelected: a2 > 0 && l3 === a2, isIndeterminate: l3 > 0 && l3 < a2 };
|
|
241
|
+
} };
|
|
242
|
+
}(q2, P2, W2), { setCurrentRow: le2, getRowClass: te2 } = function(e3) {
|
|
243
|
+
const a2 = d(null);
|
|
244
|
+
return { currentRow: a2, setCurrentRow: (e4) => (a2.value = e4, a2.value), getRowClass: (l2) => {
|
|
245
|
+
const t2 = [];
|
|
246
|
+
return e3.value && a2.value === l2 && t2.push("is-current"), t2;
|
|
247
|
+
}, clearCurrentRow: () => {
|
|
248
|
+
a2.value = null;
|
|
249
|
+
} };
|
|
250
|
+
}(T2);
|
|
251
|
+
w(u2, (e3) => {
|
|
252
|
+
B2.value = e3;
|
|
253
|
+
}, { deep: true, immediate: true });
|
|
254
|
+
const ne2 = (e3, a2) => {
|
|
255
|
+
if (T2.value) {
|
|
256
|
+
const a3 = le2(e3);
|
|
257
|
+
O2("current-change", a3);
|
|
258
|
+
}
|
|
259
|
+
if (H2.value && A2.value) {
|
|
260
|
+
const a3 = Q2(e3);
|
|
261
|
+
de2(e3, a3);
|
|
262
|
+
}
|
|
263
|
+
O2("row-click", e3, a2);
|
|
264
|
+
}, oe2 = (e3, a2) => {
|
|
265
|
+
O2("header-click", e3, a2);
|
|
266
|
+
}, se2 = (e3) => {
|
|
267
|
+
const a2 = j2(e3);
|
|
268
|
+
a2 && O2("sort-change", a2);
|
|
269
|
+
}, ie2 = (e3, a2) => {
|
|
270
|
+
const l2 = Q2(e3, a2);
|
|
271
|
+
de2(e3, l2);
|
|
272
|
+
}, re2 = (e3) => {
|
|
273
|
+
Z2(e3), de2(null, e3);
|
|
274
|
+
}, ue2 = async (e3) => {
|
|
275
|
+
U2(e3), C(() => {
|
|
276
|
+
var _a;
|
|
277
|
+
((_a = N2.value) == null ? void 0 : _a.bodyWrapper) && (N2.value.bodyWrapper.scrollTop = 0);
|
|
278
|
+
}), O2("page-change", e3), await pe2();
|
|
279
|
+
}, de2 = (e3, a2) => {
|
|
280
|
+
O2("update:selectedRows", [...X2.value]), O2("selection-change", [...X2.value]), e3 ? O2("select", e3, a2) : O2("select-all", a2);
|
|
281
|
+
}, pe2 = async () => {
|
|
282
|
+
if (r2.isInitTableData && r2.initTableData && "function" == typeof r2.initTableData) {
|
|
283
|
+
const { data: e3, total: a2 } = await r2.initTableData({ pageSize: g2.value.pageSize || 10, pageNum: g2.value.currentPage || 1 });
|
|
284
|
+
B2.value = e3, g2.value.total = a2;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
return x(() => {
|
|
288
|
+
pe2();
|
|
289
|
+
}), i2({ ref: L2, clearSort: () => {
|
|
290
|
+
p2.value.forEach((e3) => {
|
|
291
|
+
e3.sortable && (e3.sortOrder = null);
|
|
292
|
+
});
|
|
293
|
+
}, toggleRowSelection: (e3, a2) => {
|
|
294
|
+
const l2 = Q2(e3, a2);
|
|
295
|
+
de2(e3, l2);
|
|
296
|
+
}, refresh: async () => {
|
|
297
|
+
g2.value.currentPage = 1, await pe2();
|
|
298
|
+
}, toggleAllSelection: (e3) => {
|
|
299
|
+
Z2(e3), de2(null, e3);
|
|
300
|
+
}, clearSelection: () => {
|
|
301
|
+
ee2(), O2("update:selectedRows", []), O2("selection-change", []);
|
|
302
|
+
}, getSelectedRows: ae2 }), (e3, a2) => {
|
|
303
|
+
var _a;
|
|
304
|
+
return n(), l("div", { ref_key: "_ref", ref: L2, class: o(["mc-table", { "mc-table--loading": h(k2) }]) }, [m(ce, { ref_key: "headerRef", ref: D2, columns: h(V2), "show-header": e3.showHeader, "get-sort-order": h(E2), selectable: h(H2), "is-all-selected": h(G2), "is-indeterminate": h(J2), onHeaderClick: oe2, onSortChange: se2, onSelectAll: re2 }, b({ _: 2 }, [v(Object.keys(e3.$slots), (a3) => ({ name: a3, fn: _((l2) => [s(e3.$slots, a3, I(z(l2)), void 0, true)]) }))]), 1032, ["columns", "show-header", "get-sort-order", "selectable", "is-all-selected", "is-indeterminate"]), m(Y, { ref_key: "bodyRef", ref: N2, data: q2.value, columns: h(V2), "row-key": h(P2), "empty-text": e3.emptyText, height: e3.height, "max-height": e3.maxHeight, "span-method": h(y2), pagination: h(g2), "get-row-class": h(te2), selectable: h(H2), "selected-rows": h(X2), "select-on-row-click": h(A2), onRowClick: ne2, onSelect: ie2 }, b({ _: 2 }, [v(Object.keys(e3.$slots), (a3) => ({ name: a3, fn: _((l2) => [s(e3.$slots, a3, I(z(l2)), void 0, true)]) }))]), 1032, ["data", "columns", "row-key", "empty-text", "height", "max-height", "span-method", "pagination", "get-row-class", "selectable", "selected-rows", "select-on-row-click"]), h(g2) && ((_a = h(g2)) == null ? void 0 : _a.total) > 0 ? (n(), f(xe, { key: 0, pagination: h(g2), onPageChange: ue2 }, null, 8, ["pagination"])) : t("", true), m(he, { class: "mc-table__loading", loading: h(k2), "loading-text": h(S2), "loading-config": h(M2) }, { loading: _((a3) => [s(e3.$slots, "loading", I(z(a3)), void 0, true)]), _: 3 }, 8, ["loading", "loading-text", "loading-config"])], 2);
|
|
305
|
+
};
|
|
306
|
+
} }), [["__scopeId", "data-v-a27b66bd"]])), Me = ["onClick"], $e = { key: 0, class: "mc-tab-nav-item-count" }, Te = W(e({ name: "McTab", __name: "mc-tab", props: { modelValue: {}, type: { default: "plain" } }, emits: ["update:modelValue", "change"], setup(e2, { expose: s2, emit: c2 }) {
|
|
307
|
+
const p2 = e2, m2 = c2, h2 = d(), b2 = d(), _2 = d(), y2 = d([]), k2 = u();
|
|
308
|
+
M(() => {
|
|
309
|
+
if (!k2.default) return void (y2.value = []);
|
|
310
|
+
let e3 = k2.default();
|
|
311
|
+
e3.length && e3[0].type === i && (e3 = [...Array.from(e3[0].children)]), y2.value = O(L(e3, (e4) => "McTabItem" === e4.type.name), (e4) => {
|
|
312
|
+
var _a, _b, _c;
|
|
313
|
+
const a2 = e4.props;
|
|
314
|
+
return { _vnode: $("div", { class: "mc-tab-content" }, (_c = (_b = (_a = e4.children) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c[0]), ...a2 };
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
const S2 = a(() => D(y2.value, (e3) => e3.name === p2.modelValue)), C2 = a(() => "plain" === p2.type);
|
|
318
|
+
x(async () => {
|
|
319
|
+
R2(p2.modelValue), setTimeout(() => {
|
|
320
|
+
I2();
|
|
321
|
+
});
|
|
322
|
+
}), T(() => {
|
|
323
|
+
I2(false);
|
|
324
|
+
});
|
|
325
|
+
const R2 = (e3) => {
|
|
326
|
+
if (!C2.value) return;
|
|
327
|
+
const a2 = _2.value, l2 = b2.value, t2 = N(y2.value, (a3) => a3.name === e3);
|
|
328
|
+
if (t2 < 0) return void (a2.style.width = "0");
|
|
329
|
+
const n2 = Array.from(l2.children)[t2], { x: o2, width: s3 } = n2.getBoundingClientRect(), { x: i2 } = l2.getBoundingClientRect();
|
|
330
|
+
a2.style.width = `${s3}px`, a2.style.transform = `translateX(${o2 - i2}px)`;
|
|
331
|
+
}, I2 = (e3 = true) => {
|
|
332
|
+
C2.value && (_2.value.style.transition = e3 ? "transform 0.3s ease-in-out" : "");
|
|
333
|
+
};
|
|
334
|
+
return w(() => p2.modelValue, (e3) => {
|
|
335
|
+
R2(e3);
|
|
336
|
+
}), s2({ ref: h2 }), (e3, a2) => {
|
|
337
|
+
var _a;
|
|
338
|
+
return n(), l("div", { class: o(["mc-tab", `mc-tab-${e3.type}`]), ref_key: "_ref", ref: h2 }, [g("div", { class: "mc-tab-nav", ref_key: "tabNavRef", ref: b2 }, [(n(true), l(i, null, v(y2.value, (a3) => (n(), l("div", { class: o(["mc-tab-nav-item", { "mc-tab-nav-item-active": a3.name === e3.modelValue, "mc-tab-nav-item-disabled": a3.disabled }]), key: a3.name, onClick: (e4) => ((e5) => {
|
|
339
|
+
e5.disabled || (m2("update:modelValue", e5.name), m2("change", e5.name));
|
|
340
|
+
})(a3) }, [g("span", null, r(a3.label), 1), a3.count ? (n(), l("span", $e, r(a3.count), 1)) : t("", true)], 10, Me))), 128)), C2.value ? (n(), l("div", { key: 0, class: "mc-tab-line", ref_key: "tabLineRef", ref: _2 }, null, 512)) : t("", true)], 512), ((_a = S2.value) == null ? void 0 : _a._vnode) ? (n(), f(P(S2.value._vnode), { key: S2.value.name })) : t("", true)], 2);
|
|
341
|
+
};
|
|
342
|
+
} }), [["__scopeId", "data-v-1e5c6675"]]), Pe = { class: "mc-tab-item" }, He = e({ name: "McTabItem", __name: "mc-tab-item", props: { name: {}, label: {}, disabled: { type: Boolean }, count: {} }, setup: (e2) => (e3, a2) => (n(), l("div", Pe, [s(e3.$slots, "default")])) }), We = A(Te), Ae = A(He);
|
|
343
|
+
export {
|
|
344
|
+
ze as M,
|
|
345
|
+
We as a,
|
|
346
|
+
Ae as b,
|
|
347
|
+
Re as c,
|
|
348
|
+
Ie as d,
|
|
349
|
+
Ce as u
|
|
350
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineComponent as o, createElementBlock as t, openBlock as e, createVNode as c, withCtx as a, renderSlot as n, createElementVNode as l, normalizeClass as s, createTextVNode as m, toDisplayString as i } from "vue";
|
|
2
|
+
import { M as p } from "./mc-icon-BCR0XCJl.js";
|
|
3
|
+
import { _ as r } from "./mc-popper-DQ5aNdcl.js";
|
|
4
|
+
import { _ as f, w as d } from "./utils-DVltbcaT.js";
|
|
5
|
+
const u = { class: "mc-tooltip" }, w = f(o({ name: "McTooltip", __name: "mc-tooltip", props: { iconSize: { default: 24 }, iconName: { default: "Info" }, content: {}, theme: { default: "light" }, placement: { default: "top" }, showArrow: { type: Boolean, default: true }, iconColor: {} }, setup: (o2) => (o3, f2) => (e(), t("div", u, [c(r, { placement: o3.placement, "show-arrow": o3.showArrow }, { content: a(() => [l("div", { class: s(["mc-tooltip-content", `mc-tooltip-content-${o3.theme}`]) }, [n(o3.$slots, "content", {}, () => [m(i(o3.content), 1)], true)], 2)]), default: a(() => [n(o3.$slots, "default", {}, () => [c(p, { class: "mc-tooltip-icon", name: o3.iconName, size: o3.iconSize, color: o3.iconColor }, null, 8, ["name", "size", "color"])], true)]), _: 3 }, 8, ["placement", "show-arrow"])])) }), [["__scopeId", "data-v-3a522e2b"]]), _ = d(w);
|
|
6
|
+
export {
|
|
7
|
+
_ as M,
|
|
8
|
+
w as _
|
|
9
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-checkbox[data-v-
|
|
1
|
+
.mc-checkbox[data-v-39fb014e]{display:flex;align-items:start;position:relative}.mc-checkbox .mc-checkbox__input[data-v-39fb014e]{width:0;height:0;margin:0;padding:0;border:0;outline:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.mc-checkbox .mc-checkbox__wrapper[data-v-39fb014e]{display:flex;align-items:center;gap:8px}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox[data-v-39fb014e]{cursor:pointer;display:flex;align-items:center;justify-content:center;width:24px;height:24px;box-sizing:border-box;border-radius:var(--mc-radius);border:1px solid var(--mc-gray-400)}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox[data-v-39fb014e]:hover{border:2px solid var(--mc-gray-500)}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--partial[data-v-39fb014e]:after{content:""}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--checked[data-v-39fb014e]:after{content:""}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--checked[data-v-39fb014e],.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--partial[data-v-39fb014e]{background-color:var(--mc-teal-500);border-color:var(--mc-teal-500);position:relative}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--checked[data-v-39fb014e]:hover,.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--partial[data-v-39fb014e]:hover{border-color:var(--mc-teal-900);background-color:var(--mc-teal-900)}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--checked[data-v-39fb014e]:after,.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__checkbox.mc-checkbox__checkbox--partial[data-v-39fb014e]:after{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;font-family:mc-iconfont!important;font-size:24px;color:var(--mc-white)}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__content[data-v-39fb014e]{font-size:14px;color:var(--mc-gray-800)}.mc-checkbox .mc-checkbox__wrapper .mc-checkbox__content-remarks[data-v-39fb014e]{position:absolute;width:100%;top:24px;left:32px;color:var(--mc-gray-500);font-size:12px}.mc-checkbox.mc-checkbox--disabled .mc-checkbox__checkbox[data-v-39fb014e]{background-color:var(--mc-gray-300)!important;border-color:var(--mc-gray-300)!important;cursor:not-allowed!important}.mc-checkbox.mc-checkbox--disabled .mc-checkbox__content-text[data-v-39fb014e]{color:var(--mc-gray-400)}.mc-checkbox.mc-checkbox--error .mc-checkbox__checkbox[data-v-39fb014e]{border-color:var(--mc-error)!important}.mc-checkbox.mc-checkbox--error .mc-checkbox__checkbox.mc-checkbox__checkbox--partial[data-v-39fb014e],.mc-checkbox.mc-checkbox--error .mc-checkbox__checkbox.mc-checkbox__checkbox--checked[data-v-39fb014e]{background-color:var(--mc-error)!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-radio-group[data-v-
|
|
1
|
+
.mc-radio-group[data-v-152cbc8e]{display:flex;align-items:start}.mc-radio[data-v-cc9e26bd]{min-height:24px}.mc-radio.mc-radio-has-remark[data-v-cc9e26bd]{min-height:40px}.mc-radio .mc-radio-label[data-v-cc9e26bd]{width:fit-content;height:24px;display:flex;align-items:center;gap:8px;cursor:pointer}.mc-radio .mc-radio-label .mc-radio-input[data-v-cc9e26bd]{margin:0;padding:0;width:0;height:0;border:none;outline:none;display:none}.mc-radio .mc-radio-label .mc-radio-circle[data-v-cc9e26bd]{width:24px;height:24px;box-sizing:border-box;border-radius:50%}.mc-radio .mc-radio-label:not(.mc-radio-checked) .mc-radio-circle[data-v-cc9e26bd]{border:1px solid var(--mc-gray-400)}.mc-radio .mc-radio-label:not(.mc-radio-checked):hover .mc-radio-circle[data-v-cc9e26bd]{border:2px solid var(--mc-gray-500)}.mc-radio .mc-radio-label.mc-radio-checked .mc-radio-circle[data-v-cc9e26bd]{border:none;background-color:var(--mc-teal-500);position:relative}.mc-radio .mc-radio-label.mc-radio-checked .mc-radio-circle[data-v-cc9e26bd]:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background-color:var(--mc-white)}.mc-radio .mc-radio-label .mc-radio-content[data-v-cc9e26bd]{color:var(--mc-gray-800);font-size:16px}.mc-radio .mc-radio-label.mc-radio-error .mc-radio-circle[data-v-cc9e26bd]{border-color:var(--mc-error)!important}.mc-radio .mc-radio-label.mc-radio-error.mc-radio-checked .mc-radio-circle[data-v-cc9e26bd]{background-color:var(--mc-error)}.mc-radio .mc-radio-label.mc-radio-disabled[data-v-cc9e26bd]{cursor:not-allowed}.mc-radio .mc-radio-label.mc-radio-disabled .mc-radio-circle[data-v-cc9e26bd]{border:none;background-color:var(--mc-gray-300)}.mc-radio .mc-radio-label.mc-radio-disabled:hover .mc-radio-circle[data-v-cc9e26bd]{border:none}.mc-radio .mc-radio-remark[data-v-cc9e26bd]{box-sizing:border-box;padding-left:32px;color:var(--mc-gray-500);font-size:12px;word-wrap:break-word;overflow-wrap:break-word}
|