mc-plus 1.0.7 → 1.0.9

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.
Files changed (71) hide show
  1. package/dist/es/hooks-c7yYlQyM.js +15 -0
  2. package/dist/es/index.js +46 -10
  3. package/dist/es/mc-alert-DoOso0Gr.js +12 -0
  4. package/dist/es/{mc-button-D6IV1cvA.js → mc-button-CUHRxe0J.js} +3 -3
  5. package/dist/es/mc-checkbox-B38O15cu.js +11 -0
  6. package/dist/es/{mc-collapse-DE4emHTm.js → mc-collapse-HNiVA8cx.js} +2 -2
  7. package/dist/es/{mc-icon-B0xq3JPC.js → mc-icon--CImsgxi.js} +1 -1
  8. package/dist/es/mc-input-C0-hVMB4.js +16 -0
  9. package/dist/es/mc-message-CypXiHrq.js +51 -0
  10. package/dist/es/mc-radio-BZwvlo2W.js +23 -0
  11. package/dist/es/mc-select-AXjlPhsg.js +52 -0
  12. package/dist/es/mc-switch-B6sZH0JJ.js +11 -0
  13. package/dist/es/mc-table-CT4Mb5B4.js +252 -0
  14. package/dist/es/mc-tag-aW5PUBk2.js +33 -0
  15. package/dist/es/mc-toast-CmkXAYH6.js +52 -0
  16. package/dist/es/mc-tooltip-CSuvzJyd.js +33 -0
  17. package/dist/es/theme/index.css +1 -1
  18. package/dist/es/theme/mc-alert.css +1 -0
  19. package/dist/es/theme/mc-checkbox.css +1 -0
  20. package/dist/es/theme/mc-input.css +1 -0
  21. package/dist/es/theme/mc-message.css +1 -0
  22. package/dist/es/theme/mc-radio.css +1 -0
  23. package/dist/es/theme/mc-select.css +1 -0
  24. package/dist/es/theme/mc-switch.css +1 -0
  25. package/dist/es/theme/mc-table.css +1 -0
  26. package/dist/es/theme/mc-tag.css +1 -0
  27. package/dist/es/theme/mc-toast.css +1 -0
  28. package/dist/es/theme/mc-tooltip.css +1 -0
  29. package/dist/es/{utils-CDDTlenj.js → utils-BwgRXuj9.js} +1 -1
  30. package/dist/es/vendor-CNzO2Q1s.js +506 -0
  31. package/dist/index.css +1 -1
  32. package/dist/types/components/index.d.ts +12 -1
  33. package/dist/types/components/mc-alert/index.d.ts +49 -0
  34. package/dist/types/components/mc-alert/types.d.ts +17 -0
  35. package/dist/types/components/mc-checkbox/index.d.ts +29 -0
  36. package/dist/types/components/mc-checkbox/types.d.ts +15 -0
  37. package/dist/types/components/mc-form/constanst.d.ts +4 -0
  38. package/dist/types/components/mc-form/types.d.ts +47 -0
  39. package/dist/types/components/mc-input/index.d.ts +57 -0
  40. package/dist/types/components/mc-input/types.d.ts +17 -0
  41. package/dist/types/components/mc-message/index.d.ts +61 -0
  42. package/dist/types/components/mc-message/types.d.ts +34 -0
  43. package/dist/types/components/mc-radio/constant.d.ts +3 -0
  44. package/dist/types/components/mc-radio/index.d.ts +51 -0
  45. package/dist/types/components/mc-radio/types.d.ts +20 -0
  46. package/dist/types/components/mc-select/constant.d.ts +4 -0
  47. package/dist/types/components/mc-select/index.d.ts +93 -0
  48. package/dist/types/components/mc-select/types.d.ts +42 -0
  49. package/dist/types/components/mc-switch/index.d.ts +45 -0
  50. package/dist/types/components/mc-switch/types.d.ts +15 -0
  51. package/dist/types/components/mc-table/composables/usePagination.d.ts +11 -0
  52. package/dist/types/components/mc-table/composables/useTableScroll.d.ts +13 -0
  53. package/dist/types/components/mc-table/composables/useTableSort.d.ts +17 -0
  54. package/dist/types/components/mc-table/index.d.ts +7 -0
  55. package/dist/types/components/mc-table/types.d.ts +168 -0
  56. package/dist/types/components/mc-tag/index.d.ts +60 -0
  57. package/dist/types/components/mc-tag/types.d.ts +28 -0
  58. package/dist/types/components/mc-toast/index.d.ts +61 -0
  59. package/dist/types/components/mc-toast/toast.d.ts +19 -0
  60. package/dist/types/components/mc-toast/types.d.ts +21 -0
  61. package/dist/types/components/mc-tooltip/index.d.ts +65 -0
  62. package/dist/types/components/mc-tooltip/types.d.ts +20 -0
  63. package/dist/types/hooks/index.d.ts +2 -0
  64. package/dist/types/hooks/useClickOutside.d.ts +2 -0
  65. package/dist/types/hooks/useEventListener.d.ts +2 -0
  66. package/dist/umd/index.css +1 -1
  67. package/dist/umd/index.css.gz +0 -0
  68. package/dist/umd/index.umd.cjs +3 -1
  69. package/dist/umd/index.umd.cjs.gz +0 -0
  70. package/package.json +4 -1
  71. package/dist/es/vendor-D4RgMZ9r.js +0 -171
@@ -0,0 +1,15 @@
1
+ import { isRef as e, watch as t, onMounted as n, onBeforeUnmount as r, unref as v } from "vue";
2
+ function a(a2, i) {
3
+ var o, s, u;
4
+ o = document, s = "click", u = (e2) => {
5
+ a2.value && e2.target && (a2.value.contains(e2.target) || i(e2));
6
+ }, e(o) ? t(o, (e2, t2) => {
7
+ t2 == null ? void 0 : t2.removeEventListener(s, u), e2 == null ? void 0 : e2.addEventListener(s, u);
8
+ }) : n(() => o == null ? void 0 : o.addEventListener(s, u)), r(() => {
9
+ var _a;
10
+ return (_a = v(o)) == null ? void 0 : _a.removeEventListener(s, u);
11
+ });
12
+ }
13
+ export {
14
+ a as u
15
+ };
package/dist/es/index.js CHANGED
@@ -1,15 +1,51 @@
1
- import { p as o, m as s } from "./utils-CDDTlenj.js";
2
- import { M as m } from "./mc-button-D6IV1cvA.js";
3
- import { a as t } from "./mc-icon-B0xq3JPC.js";
4
- import { M as r } from "./mc-collapse-DE4emHTm.js";
5
- import { a } from "./mc-collapse-DE4emHTm.js";
6
- const c = [m, t, r];
7
- o();
8
- const p = s(c);
1
+ import { p as s, m as o } from "./utils-BwgRXuj9.js";
2
+ import { M } from "./mc-alert-DoOso0Gr.js";
3
+ import { M as m } from "./mc-button-CUHRxe0J.js";
4
+ import { M as r } from "./mc-collapse-HNiVA8cx.js";
5
+ import { a } from "./mc-collapse-HNiVA8cx.js";
6
+ import { a as p } from "./mc-icon--CImsgxi.js";
7
+ import { M as i } from "./mc-input-C0-hVMB4.js";
8
+ import { M as M2, a as a2 } from "./mc-message-CypXiHrq.js";
9
+ import { M as f, a as l } from "./mc-radio-BZwvlo2W.js";
10
+ import { M as j, a as n, b as g } from "./mc-select-AXjlPhsg.js";
11
+ import { M as x } from "./mc-switch-B6sZH0JJ.js";
12
+ import "vue";
13
+ import { M as T } from "./mc-checkbox-B38O15cu.js";
14
+ import { M as M3, u, a as a3, b } from "./mc-table-CT4Mb5B4.js";
15
+ import { M as M4 } from "./mc-tag-aW5PUBk2.js";
16
+ import { M as M5, c, t, e, a as a4, b as b2, d } from "./mc-toast-CmkXAYH6.js";
17
+ import { M as h } from "./mc-tooltip-CSuvzJyd.js";
18
+ const S = [m, p, r, h, x, i, f, l, j, n, g, T];
19
+ s();
20
+ const P = o(S);
9
21
  export {
22
+ M as McAlert,
10
23
  m as McButton,
24
+ T as McCheckbox,
11
25
  r as McCollapse,
12
26
  a as McCollapseItem,
13
- t as McIcon,
14
- p as default
27
+ p as McIcon,
28
+ i as McInput,
29
+ M2 as McMessage,
30
+ f as McRadio,
31
+ l as McRadioGroup,
32
+ j as McSelect,
33
+ n as McSelectGroup,
34
+ g as McSelectOption,
35
+ x as McSwitch,
36
+ M3 as McTable,
37
+ M4 as McTag,
38
+ M5 as McToast,
39
+ h as McTooltip,
40
+ a2 as Message,
41
+ c as createToast,
42
+ P as default,
43
+ t as toast,
44
+ e as toastError,
45
+ a4 as toastPrimary,
46
+ b2 as toastSuccess,
47
+ d as toastWarning,
48
+ u as usePagination,
49
+ a3 as useTableScroll,
50
+ b as useTableSort
15
51
  };
@@ -0,0 +1,12 @@
1
+ import { _ as e, w as t } from "./utils-BwgRXuj9.js";
2
+ import { defineComponent as s, ref as l, useAttrs as c, computed as o, createElementBlock as r, createCommentVNode as a, openBlock as i, normalizeClass as n, normalizeStyle as _, createElementVNode as d, createBlock as m, renderSlot as p, toDisplayString as y } from "vue";
3
+ import { M as f } from "./mc-icon--CImsgxi.js";
4
+ const v = { class: "mc-alert__content" }, h = { class: "mc-alert__header" }, u = { class: "mc-alert__header-left" }, k = { key: 1, class: "mc-alert__title" }, w = { key: 0, class: "mc-alert__description" }, g = { key: 1, class: "mc-alert__description" }, I = t(e(s({ name: "McAlert", __name: "mc-alert", props: { type: { default: "info" }, title: {}, description: {}, closable: { type: Boolean, default: true }, showIcon: { type: Boolean, default: true }, height: {}, width: {} }, emits: ["close"], setup(e2, { expose: t2, emit: s2 }) {
5
+ const I2 = e2, b = s2, M = l(), $ = l(true), j = c(), x = o(() => ({ ...j.style || {}, width: I2.width, height: I2.height })), A = { success: "Accept_02", info: "Info_02", warning: "Error_02", error: "Error_04" }, B = (e3) => {
6
+ $.value = false, b("close", e3);
7
+ };
8
+ return t2({ ref: M }), (e3, t3) => $.value ? (i(), r("div", { key: 0, ref_key: "_ref", ref: M, style: _(x.value), class: n(["mc-alert", [`mc-alert--${e3.type}`]]) }, [d("div", v, [d("div", h, [d("div", u, [e3.showIcon ? (i(), m(f, { key: 0, name: A[e3.type], class: "mc-alert__icon" }, null, 8, ["name"])) : a("", true), e3.title ? (i(), r("div", k, y(e3.title), 1)) : p(e3.$slots, "title", { key: 2 }, void 0, true)]), e3.closable ? (i(), m(f, { key: 0, name: "Cross", class: "mc-alert__close", onClick: B })) : a("", true)]), e3.description ? (i(), r("div", w, y(e3.description), 1)) : (i(), r("div", g, [p(e3.$slots, "description", {}, void 0, true)]))])], 6)) : a("", true);
9
+ } }), [["__scopeId", "data-v-826b2649"]]));
10
+ export {
11
+ I as M
12
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as e, toRefs as t, ref as o, useAttrs as a, computed as i, toValue as l, createElementBlock as n, openBlock as s, unref as d, normalizeClass as u, normalizeStyle as r, createBlock as c, createCommentVNode as m, renderSlot as p, createVNode as f } from "vue";
2
- import { M as v } from "./mc-icon-B0xq3JPC.js";
3
- import { t as y } from "./vendor-D4RgMZ9r.js";
4
- import { _ as h, w as g } from "./utils-CDDTlenj.js";
2
+ import { M as v } from "./mc-icon--CImsgxi.js";
3
+ import { t as y } from "./vendor-CNzO2Q1s.js";
4
+ import { _ as h, w as g } from "./utils-BwgRXuj9.js";
5
5
  const b = ["type", "disabled"], k = { key: 1, class: "loading-icon" }, I = g(h(e({ name: "McButton", __name: "mc-button", props: { type: { default: "primary" }, nativeType: { default: "button" }, size: { default: "medium" }, disabled: { type: Boolean }, loading: { type: Boolean }, useThrottle: { type: Boolean, default: true }, throttleDuration: { default: 500 }, leftIcon: {}, rightIcon: {}, content: {}, height: {}, width: {} }, emits: ["click"], setup(e2, { expose: h2, emit: g2 }) {
6
6
  const I2 = e2, { loading: _, disabled: w, throttleDuration: B, height: T, width: j } = t(I2), z = g2, M = o(), $ = t(a()), x = i(() => ({ ...l($).style, width: j.value ? j.value : void 0, height: T.value ? T.value : void 0 })), D = (e3) => {
7
7
  _.value || w.value || z("click", e3);
@@ -0,0 +1,11 @@
1
+ import { defineComponent as e, createElementBlock as c, openBlock as a, normalizeStyle as l, normalizeClass as o, createElementVNode as s, toDisplayString as t } from "vue";
2
+ import { _ as m, w as d } from "./utils-BwgRXuj9.js";
3
+ const n = ["value", "disabled"], b = { class: "mc-checkbox__wrapper" }, p = { class: "mc-checkbox__content" }, k = { class: "mc-checkbox__content-text" }, h = { class: "mc-checkbox__content-remarks" }, i = d(m(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: m2 }) {
4
+ const d2 = e2, i2 = m2, r = () => {
5
+ d2.disabled || (i2("update:modelValue", !d2.modelValue), i2("change", !d2.modelValue));
6
+ };
7
+ return (e3, m3) => (a(), c("div", { class: o(["mc-checkbox", { "mc-checkbox--disabled": e3.disabled }]), style: l({ height: e3.remarks ? "40px" : "24px" }) }, [s("input", { type: "checkbox", class: "mc-checkbox__input", value: e3.modelValue, disabled: e3.disabled }, null, 8, n), s("label", b, [s("span", { class: o(["mc-checkbox__checkbox", { "mc-checkbox__checkbox--checked": e3.modelValue, "mc-checkbox__checkbox--partial": e3.partial }]), onClick: r }, null, 2), s("div", p, [s("span", k, t(e3.content), 1), s("span", h, t(e3.remarks), 1)])])], 6));
8
+ } }), [["__scopeId", "data-v-edb5c81c"]]));
9
+ export {
10
+ i as M
11
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as e, ref as a, watchEffect as l, watch as s, provide as o, createElementBlock as c, openBlock as t, renderSlot as i, inject as m, computed as d, normalizeClass as n, createElementVNode as p, withDirectives as u, createTextVNode as r, toDisplayString as v, createVNode as _, vShow as h } from "vue";
2
- import { d as f, _ as C, w as V } from "./utils-CDDTlenj.js";
3
- import { M as b } from "./mc-icon-B0xq3JPC.js";
2
+ import { d as f, _ as C, w as V } from "./utils-BwgRXuj9.js";
3
+ import { M as b } from "./mc-icon--CImsgxi.js";
4
4
  const g = Symbol("COLLAPSE_CONTEXT"), I = "McCollapse", M = { class: "mc-collapse" }, k = C(e({ name: I, __name: "mc-collapse", props: { modelValue: {}, accordion: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(e2, { emit: m2 }) {
5
5
  const d2 = a(e2.modelValue), n2 = m2;
6
6
  l(() => {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as c, ref as e, createElementBlock as o, openBlock as s, normalizeClass as n } from "vue";
2
- import { _ as m, w as a } from "./utils-CDDTlenj.js";
2
+ import { _ as m, w as a } from "./utils-BwgRXuj9.js";
3
3
  const i = m(c({ name: "McIcon", __name: "mc-icon", props: { name: {} }, emits: ["click"], setup(c2, { expose: m2, emit: a2 }) {
4
4
  const i2 = a2, r2 = e();
5
5
  return m2({ ref: r2 }), (c3, e2) => (s(), o("i", { ref_key: "_ref", ref: r2, class: n(["mc-iconfont", `mc-icon--${c3.name}`]), onClick: e2[0] || (e2[0] = (c4) => ((c5) => {
@@ -0,0 +1,16 @@
1
+ import { defineComponent as e, ref as a, watch as l, createElementBlock as s, openBlock as o, normalizeClass as p, renderSlot as t, withDirectives as u, createCommentVNode as n, createVNode as d, createElementVNode as c, withModifiers as i, vModelDynamic as m } from "vue";
2
+ import { M as r } from "./mc-icon--CImsgxi.js";
3
+ import { _ as v, w as h } from "./utils-BwgRXuj9.js";
4
+ const b = { key: 0, class: "mc-input-icon" }, y = ["type", "placeholder", "disabled"], f = { key: 0, class: "mc-input-icon mc-input-icon-eye" }, w = h(v(e({ name: "McInput", __name: "mc-input", props: { modelValue: {}, search: { type: Boolean }, disabled: { type: Boolean }, password: { type: Boolean }, placeholder: { default: "Please input" } }, emits: ["update:modelValue", "input", "change", "focus", "blur"], setup(e2, { emit: v2 }) {
5
+ const h2 = e2, w2 = v2, _ = a(h2.modelValue ?? "");
6
+ l(() => h2.modelValue, (e3) => {
7
+ _.value = e3, w2("change", e3);
8
+ });
9
+ const V = a(false), B = () => {
10
+ w2("update:modelValue", _.value), w2("input", _.value);
11
+ };
12
+ return (e3, a2) => (o(), s("div", { class: p(["mc-input", { "mc-input--disabled": e3.disabled }]) }, [t(e3.$slots, "pre", {}, () => [e3.search ? (o(), s("span", b, [d(r, { name: "Search" })])) : n("", true)], true), u(c("input", { class: "mc-input__inner", type: V.value && e3.password ? "password" : "text", "onUpdate:modelValue": a2[0] || (a2[0] = (e4) => _.value = e4), placeholder: e3.placeholder, disabled: e3.disabled, onInput: i(B, ["stop"]), onFocus: a2[1] || (a2[1] = i((e4) => w2("focus", e4), ["stop"])), onBlur: a2[2] || (a2[2] = i((e4) => w2("blur", e4), ["stop"])) }, null, 40, y), [[m, _.value]]), t(e3.$slots, "default", { class: "post" }, () => [e3.password ? (o(), s("span", f, [d(r, { name: V.value ? "Review-Hidden" : "Review", onClick: a2[3] || (a2[3] = (e4) => V.value = !V.value) }, null, 8, ["name"])])) : n("", true)], true)], 2));
13
+ } }), [["__scopeId", "data-v-5e55909a"]]));
14
+ export {
15
+ w as M
16
+ };
@@ -0,0 +1,51 @@
1
+ import { _ as e, w as s } from "./utils-BwgRXuj9.js";
2
+ import { defineComponent as o, ref as n, toRefs as t, useAttrs as a, computed as c, toValue as r, onMounted as l, createBlock as m, openBlock as i, Transition as d, withCtx as u, withDirectives as p, createElementVNode as f, normalizeStyle as g, normalizeClass as _, createCommentVNode as y, toDisplayString as v, vShow as h, render as C, createVNode as w } from "vue";
3
+ import { M as b } from "./mc-icon--CImsgxi.js";
4
+ const E = { class: "mc-message__content" }, I = { class: "mc-message__title" }, k = e(o({ name: "McMessage", __name: "mc-message", props: { type: { default: "info" }, message: { default: "" }, duration: { default: 3e3 }, showIcon: { type: Boolean, default: true }, closable: { type: Boolean, default: false }, onClose: {} }, emits: ["close"], setup(e2, { expose: s2, emit: o2 }) {
5
+ const C2 = e2, w2 = o2, k2 = n(), x2 = n(true), M2 = t(a()), A2 = c(() => ({ ...r(M2).style })), B2 = { success: "Accept_02", info: "Info_02", warning: "Error_02", error: "Error_04" }, j2 = () => {
6
+ var _a;
7
+ x2.value = false, w2("close"), (_a = C2.onClose) == null ? void 0 : _a.call(C2);
8
+ };
9
+ return l(() => {
10
+ C2.duration > 0 && setTimeout(() => {
11
+ j2();
12
+ }, C2.duration);
13
+ }), s2({ ref: k2, handleClose: j2 }), (e3, s3) => (i(), m(d, { name: "mc-message-fade" }, { default: u(() => [p(f("div", { ref_key: "_ref", ref: k2, class: _(["mc-message", [`mc-message--${e3.type}`]]), style: g(A2.value) }, [f("div", E, [e3.showIcon ? (i(), m(b, { key: 0, name: B2[e3.type], class: "mc-message__icon" }, null, 8, ["name"])) : y("", true), f("div", I, v(e3.message), 1)]), e3.closable ? (i(), m(b, { key: 0, name: "Cross", class: "mc-message__close", onClick: j2 })) : y("", true)], 6), [[h, x2.value]])]), _: 1 }));
14
+ } }), [["__scopeId", "data-v-65d094a9"]]), x = s(k);
15
+ let M = 1;
16
+ const A = [], B = () => {
17
+ let e2 = document.getElementById("mc-message-container");
18
+ return e2 || (e2 = document.createElement("div"), e2.id = "mc-message-container", document.body.appendChild(e2)), e2;
19
+ }, j = { info: (e2) => L(e2, "info"), success: (e2) => L(e2, "success"), warning: (e2) => L(e2, "warning"), error: (e2) => L(e2, "error"), close: (e2) => T(e2), closeAll: () => {
20
+ [...A].forEach((e2) => {
21
+ var _a, _b;
22
+ const s2 = (_a = e2.vm.component) == null ? void 0 : _a.exposed;
23
+ (_b = s2 == null ? void 0 : s2.handleClose) == null ? void 0 : _b.call(s2);
24
+ });
25
+ } };
26
+ function L(e2, s2) {
27
+ "string" == typeof e2 && (e2 = { message: e2 });
28
+ const o2 = "message_" + M++, n2 = e2.onClose, t2 = B(), a2 = document.createElement("div");
29
+ a2.setAttribute("data-message-id", o2), a2.classList.add("mc-message-item");
30
+ const c2 = { ...e2, type: s2, id: o2, onClose: () => {
31
+ n2 == null ? void 0 : n2(), T(o2);
32
+ } };
33
+ A.length >= 20 && T(A[0].id);
34
+ const r2 = w(k, c2);
35
+ return C(r2, a2), t2.appendChild(a2), A.push({ vm: r2, id: o2, wrapper: a2 }), { close: () => {
36
+ T(o2);
37
+ } };
38
+ }
39
+ function T(e2) {
40
+ const s2 = A.findIndex((s3) => s3.id === e2);
41
+ if (-1 === s2) return;
42
+ const o2 = A[s2];
43
+ if (!o2) return;
44
+ C(null, o2.wrapper);
45
+ const n2 = B();
46
+ n2.contains(o2.wrapper) && n2.removeChild(o2.wrapper), A.splice(s2, 1), 0 === A.length && document.body.contains(n2) && document.body.removeChild(n2);
47
+ }
48
+ export {
49
+ x as M,
50
+ j as a
51
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as a, provide as e, computed as l, createElementBlock as d, openBlock as s, renderSlot as o, inject as r, normalizeClass as i, createElementVNode as c, createTextVNode as m, toDisplayString as t } from "vue";
2
+ import { _ as u, w as n } from "./utils-BwgRXuj9.js";
3
+ const p = Symbol("selectContext"), b = { class: "mc-radio-group" }, v = u(a({ name: "McRadioGroup", __name: "mc-radio-group", props: { modelValue: {}, disabled: { type: Boolean } }, emits: ["update:modelValue", "change"], setup(a2, { emit: r2 }) {
4
+ const i2 = a2, c2 = r2;
5
+ return e(p, { modelValue: l(() => i2.modelValue), disabled: l(() => i2.disabled), handleSelect: (a3) => {
6
+ c2("update:modelValue", a3), c2("change", a3);
7
+ } }), (a3, e2) => (s(), d("div", b, [o(a3.$slots, "default", {}, void 0, true)]));
8
+ } }), [["__scopeId", "data-v-3a9261c9"]]), _ = ["disabled"], k = { class: "mc-radio-content" }, h = { class: "mc-radio-remark" }, V = u(a({ name: "McRadio", __name: "mc-radio", props: { label: {}, value: {}, disabled: { type: Boolean }, remark: {} }, setup(a2) {
9
+ const e2 = a2, u2 = r(p), n2 = l(() => {
10
+ var _a;
11
+ return ((_a = u2 == null ? void 0 : u2.modelValue) == null ? void 0 : _a.value) === e2.value;
12
+ }), b2 = l(() => {
13
+ var _a;
14
+ return ((_a = u2 == null ? void 0 : u2.disabled) == null ? void 0 : _a.value) || e2.disabled;
15
+ }), v2 = () => {
16
+ b2.value || (u2 == null ? void 0 : u2.handleSelect(e2.value));
17
+ };
18
+ return (a3, e3) => (s(), d("div", { class: i(["mc-radio", { "mc-radio-has-remark": !!a3.remark }]) }, [c("label", { class: i(["mc-radio-label", { "mc-radio-checked": n2.value, "mc-radio-disabled": b2.value }]), onClick: v2 }, [c("input", { type: "radio", class: "mc-radio-input", disabled: a3.disabled }, null, 8, _), e3[0] || (e3[0] = c("span", { class: "mc-radio-circle" }, null, -1)), c("div", k, [o(a3.$slots, "default", {}, () => [m(t(a3.label), 1)], true)])], 2), c("div", h, [o(a3.$slots, "remark", {}, () => [m(t(a3.remark), 1)], true)])], 2));
19
+ } }), [["__scopeId", "data-v-536bb974"]]), f = n(v), g = n(V);
20
+ export {
21
+ g as M,
22
+ f as a
23
+ };
@@ -0,0 +1,52 @@
1
+ import { defineComponent as e, ref as l, computed as a, watch as t, provide as s, createElementBlock as o, openBlock as c, normalizeStyle as d, normalizeClass as i, createElementVNode as u, createVNode as n, createCommentVNode as v, createBlock as r, resolveDynamicComponent as p, withDirectives as m, vModelText as h, Transition as f, withCtx as g, renderSlot as _, createTextVNode as b, vShow as y, inject as w, useSlots as k, onMounted as V, onBeforeUnmount as O, h as S, toDisplayString as x, toRefs as C, useAttrs as M, toValue as j } from "vue";
2
+ import { M as I } from "./mc-icon--CImsgxi.js";
3
+ import { u as $ } from "./hooks-c7yYlQyM.js";
4
+ import { i as A, l as N } from "./vendor-CNzO2Q1s.js";
5
+ import { _ as B, w as G } from "./utils-BwgRXuj9.js";
6
+ const D = Symbol("selectContext"), P = Symbol("selectGroupContext"), T = { key: 0, class: "mc-select-selected-content" }, U = { class: "mc-select-input-wrapper" }, q = ["placeholder", "readonly", "disabled"], z = { class: "mc-select-dropdown-wrapper" }, E = { class: "mc-select-dropdown" }, F = { key: 0, class: "mc-select-no-data" }, H = B(e({ name: "McSelect", inheritAttrs: false, __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: w2 }) {
7
+ const k2 = e2, V2 = w2, O2 = l([]), S2 = a(() => A(P2.value) ? O2.value : O2.value.filter((e3) => N(e3.label ?? e3.value).includes(N(P2.value)))), x2 = a(() => 0 === S2.value.length), C2 = l(false), M2 = () => {
8
+ C2.value = !C2.value;
9
+ }, j2 = l([k2.modelValue]);
10
+ t(() => k2.modelValue, () => {
11
+ j2.value = [k2.modelValue];
12
+ });
13
+ const B2 = a(() => O2.value.find((e3) => e3.value === j2.value[0])), G2 = a(() => B2.value ? "" : k2.placeholder), P2 = l(""), H2 = () => {
14
+ C2.value = true;
15
+ }, J2 = a(() => ({ width: k2.width ?? void 0, height: k2.height ?? void 0 })), K2 = l();
16
+ return $(K2, () => {
17
+ C2.value = false;
18
+ }), s(D, { filterOptions: S2, selectValues: j2, handleSelect: (e3) => {
19
+ C2.value = false, P2.value = "", V2("update:modelValue", e3.value), V2("change", e3.value);
20
+ }, removeOption: (e3) => {
21
+ O2.value = O2.value.filter((l2) => l2.value !== e3.value);
22
+ }, addOption: (e3) => {
23
+ O2.value.push(e3);
24
+ } }), (e3, l2) => (c(), o("div", { class: i(["mc-select", [C2.value && !e3.disabled ? "mc-select-expand" : "mc-select-collapse", { "mc-select-disabled": e3.disabled }]]), ref_key: "_ref", ref: K2, style: d(J2.value) }, [u("div", { class: "mc-select-trigger", onClick: M2 }, [B2.value && !P2.value ? (c(), o("div", T, [(c(), r(p(B2.value._vnode), { key: B2.value.value }))])) : v("", true), u("div", U, [m(u("input", { class: i(["mc-select-input", { "mc-select-input-readonly": !e3.search }]), type: "text", placeholder: G2.value, "onUpdate:modelValue": l2[0] || (l2[0] = (e4) => P2.value = e4), onInput: H2, readonly: !e3.search, disabled: e3.disabled }, null, 42, q), [[h, P2.value]])]), u("div", { class: i(["mc-select-icon-wrapper", { "mc-select-icon-wrapper-expand": C2.value && !e3.disabled }]) }, [n(I, { name: "Down-Chevron" })], 2)]), n(f, { name: "mc-select-dropdown-transition" }, { default: g(() => [m(u("div", z, [u("div", E, [_(e3.$slots, "default", {}, void 0, true), x2.value ? (c(), o("div", F, [_(e3.$slots, "empty", {}, () => [l2[1] || (l2[1] = b("No data"))], true)])) : v("", true)])], 512), [[y, C2.value && !e3.disabled]])]), _: 3 })], 6));
25
+ } }), [["__scopeId", "data-v-68f002c5"]]), J = { class: "mc-select-option-content" }, K = { class: "mc-select-option-icon" }, L = B(e({ name: "McSelectOption", inheritAttrs: false, __name: "mc-select-option", props: { value: {}, label: {}, width: {}, height: {}, _group: {}, _vnode: {} }, setup(e2, { expose: t2 }) {
26
+ const s2 = l(), n2 = e2, p2 = w(D, void 0), m2 = w(P, void 0), h2 = a(() => p2 == null ? void 0 : p2.selectValues.value.includes(n2.value)), f2 = a(() => !!(p2 == null ? void 0 : p2.filterOptions.value.some((e3) => e3.value === n2.value))), g2 = k(), y2 = () => {
27
+ p2 == null ? void 0 : p2.handleSelect(C2(n2));
28
+ };
29
+ V(() => {
30
+ p2 == null ? void 0 : p2.addOption(C2(n2));
31
+ }), O(() => {
32
+ p2 == null ? void 0 : p2.removeOption(C2(n2));
33
+ });
34
+ const C2 = (e3) => {
35
+ var _a;
36
+ return { ...e3, _group: m2 == null ? void 0 : m2.groupName, _vnode: S("div", { class: "mc-select-option-content" }, (_a = g2.default) == null ? void 0 : _a.call(g2, {})) };
37
+ }, M2 = a(() => ({ width: n2.width ?? void 0, height: n2.height ?? void 0 }));
38
+ return t2({ isShow: f2.value, ref: s2 }), (e3, l2) => f2.value ? (c(), o("div", { key: 0, class: i(["mc-select-dropdown-item mc-select-option", { "mc-select-option-icon-active": h2.value }]), onClick: y2, ref_key: "_ref", ref: s2, style: d(M2.value) }, [u("div", J, [_(e3.$slots, "default", {}, () => [b(x(e3.label), 1)], true)]), u("div", K, [h2.value ? (c(), r(I, { key: 0, name: "Tick" })) : v("", true)])], 6)) : v("", true);
39
+ } }), [["__scopeId", "data-v-7ead0f93"]]), Q = { class: "mc-select-group" }, R = { class: "mc-select-group-content" }, W = B(e({ name: "McSelectGroup", inheritAttrs: false, __name: "mc-select-group", props: { label: {}, width: {}, height: {} }, setup(e2) {
40
+ const l2 = e2, t2 = w(D, void 0);
41
+ s(P, { groupName: l2.label });
42
+ const i2 = a(() => t2 == null ? void 0 : t2.filterOptions.value.some((e3) => e3._group === l2.label)), n2 = C(M()), v2 = a(() => {
43
+ var _a, _b;
44
+ return { ...(_b = (_a = j(n2)) == null ? void 0 : _a.style) == null ? void 0 : _b.value, width: l2.width ?? void 0, height: l2.height ?? void 0 };
45
+ });
46
+ return (e3, l3) => m((c(), o("div", Q, [u("div", { class: "mc-select-group-label", style: d(v2.value) }, x(e3.label), 5), u("div", R, [_(e3.$slots, "default", {}, void 0, true)])], 512)), [[y, i2.value]]);
47
+ } }), [["__scopeId", "data-v-2c1cb992"]]), X = G(H), Y = G(L), Z = G(W);
48
+ export {
49
+ X as M,
50
+ Z as a,
51
+ Y as b
52
+ };
@@ -0,0 +1,11 @@
1
+ import { defineComponent as e, ref as l, createElementBlock as a, openBlock as s, createElementVNode as t, normalizeClass as d, createCommentVNode as o, normalizeStyle as c, toDisplayString as i, renderSlot as m, createTextVNode as u } from "vue";
2
+ import { _ as p, w as n } from "./utils-BwgRXuj9.js";
3
+ const f = { class: "mc-switch-wrapper" }, r = ["disabled", "value"], b = { key: 0, class: "mc-switch-text" }, h = { key: 0, class: "mc-switch-label" }, w = n(p(e({ name: "McSwitch", __name: "mc-switch", props: { modelValue: { type: Boolean, default: false }, width: {}, label: {}, disabled: { type: Boolean, default: false }, onText: {}, offText: {} }, emits: ["update:modelValue"], setup(e2, { expose: p2, emit: n2 }) {
4
+ const w2 = e2, x = n2, y = l(), V = () => {
5
+ w2.disabled || x("update:modelValue", !w2.modelValue);
6
+ };
7
+ return p2({ ref: y }), (e3, l2) => (s(), a("div", f, [t("label", { ref_key: "_ref", ref: y, class: d(["mc-switch", { "is-active": e3.modelValue, "is-disabled": e3.disabled }]) }, [t("input", { type: "checkbox", class: "mc-switch-input", disabled: e3.disabled, value: e3.modelValue, onChange: V }, null, 40, r), t("span", { class: "mc-switch-core", style: c({ width: e3.width }) }, [e3.onText || e3.offText ? (s(), a("span", b, i(e3.modelValue ? e3.onText : e3.offText), 1)) : o("", true)], 4), e3.$slots.default || e3.label ? (s(), a("span", h, [m(e3.$slots, "default", {}, () => [u(i(e3.label), 1)], true)])) : o("", true)], 2)]));
8
+ } }), [["__scopeId", "data-v-04a4d333"]]));
9
+ export {
10
+ w as M
11
+ };
@@ -0,0 +1,252 @@
1
+ import { defineComponent as e, computed as a, createElementBlock as l, createCommentVNode as n, openBlock as t, normalizeClass as o, renderSlot as i, Fragment as s, createTextVNode as c, toDisplayString as r, useSlots as u, ref as p, normalizeStyle as d, createElementVNode as g, renderList as m, createVNode as v, unref as h, createBlock as f, createSlots as _, withCtx as b, mergeProps as y, watch as w, withDirectives as x, vModelSelect as k, onMounted as S, nextTick as C, toRefs as I, normalizeProps as z, guardReactiveProps as M } from "vue";
2
+ import { M as R } from "./mc-checkbox-B38O15cu.js";
3
+ import { _ as $ } from "./utils-BwgRXuj9.js";
4
+ import { M as P } from "./mc-icon--CImsgxi.js";
5
+ const H = ["rowspan", "colspan"], W = $(e({ __name: "mc-table-cell", props: { row: {}, column: {}, rowIndex: {}, columnIndex: {}, pagination: {}, spanMethod: { type: Function } }, setup(e2) {
6
+ const u2 = e2, p2 = a(() => {
7
+ if (u2.spanMethod) {
8
+ const e3 = u2.pagination && u2.pagination.currentPage && u2.pagination.pageSize ? (u2.pagination.currentPage - 1) * u2.pagination.pageSize + u2.rowIndex : u2.rowIndex, a2 = u2.spanMethod({ row: u2.row, column: u2.column, rowIndex: e3, columnIndex: u2.columnIndex });
9
+ if (a2) {
10
+ let l2;
11
+ if (l2 = Array.isArray(a2) ? a2[0] : a2.rowspan || 1, u2.pagination && u2.pagination.currentPage && u2.pagination.pageSize && l2 > 1) {
12
+ const a3 = (u2.pagination.currentPage - 1) * u2.pagination.pageSize, n2 = a3 + u2.pagination.pageSize - 1, t2 = e3, o2 = e3 + l2 - 1;
13
+ if (o2 < a3 || t2 > n2) return 0;
14
+ const i2 = Math.max(t2, a3), s2 = Math.min(o2, n2);
15
+ return i2 === e3 ? s2 - i2 + 1 : 0;
16
+ }
17
+ return l2;
18
+ }
19
+ }
20
+ if (u2.column.rowSpan) return "function" == typeof u2.column.rowSpan ? u2.column.rowSpan(u2.row, u2.column, u2.rowIndex) : u2.column.rowSpan;
21
+ }), d2 = a(() => {
22
+ if (u2.spanMethod) {
23
+ const e3 = u2.pagination && u2.pagination.currentPage && u2.pagination.pageSize ? (u2.pagination.currentPage - 1) * u2.pagination.pageSize + u2.rowIndex : u2.rowIndex, a2 = u2.spanMethod({ row: u2.row, column: u2.column, rowIndex: e3, columnIndex: u2.columnIndex });
24
+ if (a2) return Array.isArray(a2) ? a2[1] : a2.colspan;
25
+ }
26
+ if (u2.column.colSpan) return "function" == typeof u2.column.colSpan ? u2.column.colSpan(u2.row, u2.column, u2.rowIndex) : u2.column.colSpan;
27
+ }), g2 = a(() => {
28
+ if (u2.spanMethod) {
29
+ const e3 = u2.pagination && u2.pagination.currentPage && u2.pagination.pageSize ? (u2.pagination.currentPage - 1) * u2.pagination.pageSize + u2.rowIndex : u2.rowIndex, a2 = u2.spanMethod({ row: u2.row, column: u2.column, rowIndex: e3, columnIndex: u2.columnIndex });
30
+ if (a2) {
31
+ let l2, n2;
32
+ if (Array.isArray(a2) ? (l2 = a2[0], n2 = a2[1]) : (l2 = a2.rowspan || 1, n2 = a2.colspan || 1), u2.pagination && u2.pagination.currentPage && u2.pagination.pageSize && l2 > 1) {
33
+ const a3 = (u2.pagination.currentPage - 1) * u2.pagination.pageSize, n3 = a3 + u2.pagination.pageSize - 1, t2 = e3;
34
+ if (e3 + l2 - 1 < a3 || t2 > n3) return false;
35
+ if (Math.max(t2, a3) !== e3) return false;
36
+ }
37
+ return !(0 === l2 || 0 === n2);
38
+ }
39
+ }
40
+ return true;
41
+ });
42
+ return (e3, a2) => g2.value ? (t(), l("td", { key: 0, class: o([e3.column.className, e3.column.align ? `is-${e3.column.align}` : "", e3.column.fixed ? `is-fixed-${"boolean" == typeof e3.column.fixed ? "left" : e3.column.fixed}` : "", "is-display-" + (0 === d2.value ? "none" : "table-cell")]), rowspan: p2.value, colspan: d2.value }, [i(e3.$slots, "cell", { row: e3.row, column: e3.column, $index: e3.rowIndex, value: e3.row[e3.column.prop], prop: e3.column.prop }, () => [i(e3.$slots, e3.column.slot || e3.column.prop, { row: e3.row, column: e3.column, $index: e3.rowIndex, value: e3.row[e3.column.prop] }, () => [e3.column.formatter ? (t(), l(s, { key: 0 }, [c(r(e3.column.formatter(e3.row, e3.column, e3.row[e3.column.prop], e3.rowIndex)), 1)], 64)) : (t(), l(s, { key: 1 }, [c(r(e3.row[e3.column.prop]), 1)], 64))], true)], true)], 10, H)) : n("", true);
43
+ } }), [["__scopeId", "data-v-4e83cc0c"]]), O = { class: "mc-table__body", cellspacing: "0", cellpadding: "0", border: "0" }, D = { key: 0, width: "50" }, B = ["width"], L = ["onClick"], T = { key: 0, class: "mc-table__selection-column" }, A = { class: "mc-table__cell" }, K = { key: 1 }, N = ["colspan"], j = { key: 1 }, E = $(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 }) {
44
+ const x2 = e2, k2 = u(), S2 = w2, C2 = p(), I2 = a(() => {
45
+ const e3 = {};
46
+ return x2.height && (e3.height = "number" == typeof x2.height ? `${x2.height}px` : x2.height), x2.maxHeight && (e3.maxHeight = "number" == typeof x2.maxHeight ? `${x2.maxHeight}px` : x2.maxHeight), e3;
47
+ }), z2 = (e3) => !!x2.selectedRows && x2.selectedRows.some((a2) => x2.rowKey ? a2[x2.rowKey] === e3[x2.rowKey] : a2 === e3);
48
+ return c2({ bodyWrapper: C2 }), (e3, a2) => (t(), l("div", { class: "mc-table__body-wrapper", ref_key: "bodyWrapper", ref: C2, style: d(I2.value) }, [g("table", O, [g("colgroup", null, [e3.selectable ? (t(), l("col", D)) : n("", true), (t(true), l(s, null, m(e3.columns, (e4, a3) => (t(), l("col", { key: a3, width: e4.width }, null, 8, B))), 128))]), g("tbody", null, [e3.data && e3.data.length > 0 ? (t(true), l(s, { key: 0 }, m(e3.data, (a3, c3) => (t(), l("tr", { key: e3.rowKey ? a3[e3.rowKey] : c3, class: o(e3.getRowClass ? e3.getRowClass(a3, c3) : []), onClick: (e4) => function(e5, a4) {
49
+ S2("row-click", e5, a4);
50
+ }(a3, c3) }, [e3.selectable ? (t(), l("td", T, [g("div", A, [v(h(R), { "model-value": z2(a3), onChange: (e4) => function(e5, a4) {
51
+ S2("select", e5, a4);
52
+ }(a3, e4) }, null, 8, ["model-value", "onChange"])])])) : n("", true), (t(true), l(s, null, m(e3.columns, (l2, n2) => (t(), f(W, { key: n2, row: a3, column: l2, "row-index": c3, "column-index": n2, "span-method": e3.spanMethod, pagination: e3.pagination }, _({ _: 2 }, [m(Object.keys(e3.$slots), (a4) => ({ name: a4, fn: b((l3) => [i(e3.$slots, a4, y({ ref_for: true }, l3), void 0, true)]) }))]), 1032, ["row", "column", "row-index", "column-index", "span-method", "pagination"]))), 128))], 10, L))), 128)) : (t(), l("tr", K, [g("td", { colspan: e3.selectable ? e3.columns.length + 1 : e3.columns.length, class: "mc-table__empty-cell" }, [h(k2).empty ? i(e3.$slots, "empty", { key: 0 }, void 0, true) : (t(), l("div", j, r(e3.emptyText), 1))], 8, N)]))])])], 4));
53
+ } }), [["__scopeId", "data-v-27218502"]]), F = { class: "mc-table__header", cellspacing: "0", cellpadding: "0", border: "0" }, U = { key: 0, width: "50" }, V = ["width"], q = { key: 0, class: "mc-table__selection-column" }, G = { class: "mc-table__header-cell" }, J = ["onClick"], Q = { class: "mc-table__header-cell" }, X = { class: "mc-table__header-label" }, Y = { key: 0, class: "mc-table__sort-caret" }, Z = $(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 }) {
54
+ const d2 = e2, _2 = u2, b2 = p(), y2 = (e3) => {
55
+ _2("select-all", e3);
56
+ }, w2 = (e3) => {
57
+ const a3 = d2.getSortOrder(e3);
58
+ return "asc" === a3 ? "is-sort-asc" : "desc" === a3 ? "is-sort-desc" : "";
59
+ };
60
+ return a2({ headerWrapper: b2 }), (e3, a3) => e3.showHeader ? (t(), l("div", { key: 0, class: "mc-table__header-wrapper", ref_key: "headerWrapper", ref: b2 }, [g("table", F, [g("colgroup", null, [e3.selectable ? (t(), l("col", U)) : n("", true), (t(true), l(s, null, m(e3.columns, (e4, a4) => (t(), l("col", { key: a4, width: e4.width }, null, 8, V))), 128))]), g("thead", null, [g("tr", null, [e3.selectable ? (t(), l("th", q, [g("div", G, [v(h(R), { "model-value": e3.isAllSelected, partial: e3.isIndeterminate, onChange: y2 }, null, 8, ["model-value", "partial"])])])) : n("", true), (t(true), l(s, null, m(e3.columns, (a4, s2) => (t(), l("th", { key: s2, class: o([a4.headerClassName, a4.align ? `is-${a4.align}` : "", a4.fixed ? `is-fixed-${"boolean" == typeof a4.fixed ? "left" : a4.fixed}` : "", a4.sortable ? "is-sortable" : "", w2(a4.prop)]), onClick: (e4) => ((e5, a5) => {
61
+ e5.sortable && _2("sort-change", e5), _2("header-click", e5, a5);
62
+ })(a4, e4) }, [g("div", Q, [g("span", X, [i(e3.$slots, `header-${a4.slot || a4.prop}`, { column: a4, index: s2 }, () => [c(r(a4.label), 1)], true)]), a4.sortable ? (t(), l("span", Y, ["asc" === e3.getSortOrder(a4.prop) ? (t(), f(P, { key: 0, name: "Up-Chevron02", class: o(["mc-table__sort-icon", { "is-active": "asc" === e3.getSortOrder(a4.prop) }]) }, null, 8, ["class"])) : (t(), f(P, { key: 1, name: "Down-Chevron02", class: o(["mc-table__sort-icon", { "is-active": "desc" === e3.getSortOrder(a4.prop) }]) }, null, 8, ["class"]))])) : n("", true)])], 10, J))), 128))])])])], 512)) : n("", true);
63
+ } }), [["__scopeId", "data-v-824d6509"]]), ee = { class: "mc-table__loading-content" }, ae = { class: "mc-table__loading-spinner" }, le = { key: 0, class: "mc-table__spinner mc-table__spinner--default" }, ne = { key: 1, class: "mc-table__spinner mc-table__spinner--circle" }, te = { key: 2, class: "mc-table__spinner mc-table__spinner--pulse" }, oe = ["innerHTML"], ie = { key: 0, class: "mc-table__loading-text" }, se = $(e({ __name: "mc-table-loading", props: { loading: { type: Boolean, default: false }, loadingText: { default: "Loading..." }, loadingConfig: { default: () => ({ spinner: "default" }) } }, setup(e2) {
64
+ const s2 = e2, c2 = a(() => {
65
+ var _a;
66
+ return ((_a = s2.loadingConfig) == null ? void 0 : _a.text) || s2.loadingText;
67
+ }), u2 = a(() => {
68
+ var _a;
69
+ const e3 = {};
70
+ return ((_a = s2.loadingConfig) == null ? void 0 : _a.background) && (e3.backgroundColor = s2.loadingConfig.background), e3;
71
+ });
72
+ return (e3, a2) => {
73
+ var _a;
74
+ return e3.loading ? (t(), l("div", { key: 0, class: o(["mc-table__loading-wrapper", ["mc-table__loading-wrapper", (_a = e3.loadingConfig) == null ? void 0 : _a.customClass]]), style: d(u2.value) }, [g("div", ee, [i(e3.$slots, "loading", { loading: e3.loading, text: c2.value }, () => {
75
+ var _a2;
76
+ return [g("div", ae, [((_a2 = e3.loadingConfig) == null ? void 0 : _a2.spinner) && "default" !== e3.loadingConfig.spinner ? "circle" === e3.loadingConfig.spinner ? (t(), l("div", ne)) : "pulse" === e3.loadingConfig.spinner ? (t(), l("div", te)) : (t(), l("div", { key: 3, class: "mc-table__spinner mc-table__spinner--custom", innerHTML: e3.loadingConfig.spinner }, null, 8, oe)) : (t(), l("div", le, 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 ? (t(), l("div", ie, r(c2.value), 1)) : n("", true)];
77
+ }, true)])], 6)) : n("", true);
78
+ };
79
+ } }), [["__scopeId", "data-v-f10577d2"]]), ce = { key: 0, class: "mc-table__pagination" }, re = { class: "mc-table__pagination-info" }, ue = { class: "mc-table__pagination-controls" }, pe = ["onClick"], de = { key: 1, class: "mc-table__pagination-ellipsis" }, ge = { class: "mc-table__pagination-size" }, me = ["value"], ve = $(e({ __name: "mc-table-pagination", props: { pagination: {} }, emits: ["page-change"], setup(e2, { emit: i2 }) {
80
+ var _a, _b, _c;
81
+ const c2 = e2, u2 = i2, d2 = p(((_a = c2.pagination) == null ? void 0 : _a.currentPage) || 1), h2 = p(((_b = c2.pagination) == null ? void 0 : _b.pageSize) || 50), f2 = p(((_c = c2.pagination) == null ? void 0 : _c.pageSizes) || [25, 50, 75, 100]);
82
+ w(() => {
83
+ var _a2;
84
+ return (_a2 = c2.pagination) == null ? void 0 : _a2.currentPage;
85
+ }, (e3) => {
86
+ void 0 !== e3 && (d2.value = e3);
87
+ }), w(() => {
88
+ var _a2;
89
+ return (_a2 = c2.pagination) == null ? void 0 : _a2.pageSize;
90
+ }, (e3) => {
91
+ void 0 !== e3 && (h2.value = e3);
92
+ });
93
+ const _2 = a(() => c2.pagination ? Math.ceil(c2.pagination.total / h2.value) : 1), b2 = a(() => c2.pagination && 0 !== c2.pagination.total ? (d2.value - 1) * h2.value + 1 : 0), y2 = a(() => {
94
+ if (!c2.pagination) return 0;
95
+ const e3 = d2.value * h2.value;
96
+ return Math.min(e3, c2.pagination.total);
97
+ }), S2 = a(() => {
98
+ const e3 = _2.value, a2 = d2.value, l2 = [];
99
+ if (e3 <= 7) for (let a3 = 1; a3 <= e3; a3++) l2.push(a3);
100
+ else if (l2.push(1), a2 <= 4) {
101
+ for (let e4 = 2; e4 <= 5; e4++) l2.push(e4);
102
+ l2.push("..."), l2.push(e3);
103
+ } else if (a2 >= e3 - 3) {
104
+ l2.push("...");
105
+ for (let a3 = e3 - 4; a3 <= e3; a3++) l2.push(a3);
106
+ } else {
107
+ l2.push("...");
108
+ for (let e4 = a2 - 1; e4 <= a2 + 1; e4++) l2.push(e4);
109
+ l2.push("..."), l2.push(e3);
110
+ }
111
+ return l2;
112
+ }), C2 = (e3) => {
113
+ e3 < 1 || e3 > _2.value || (d2.value = e3, u2("page-change", { pageSize: h2.value, pageNum: e3 }));
114
+ }, I2 = () => {
115
+ d2.value = 1, u2("page-change", { pageSize: h2.value, pageNum: 1 });
116
+ };
117
+ return (e3, a2) => e3.pagination ? (t(), l("div", ce, [g("div", re, "Showing " + r(b2.value) + "-" + r(y2.value) + " of " + r(e3.pagination.total), 1), g("div", ue, [v(P, { name: "First", class: o({ "mc-table__icon": true, "is-disabled": d2.value <= 1 }), onClick: a2[0] || (a2[0] = (e4) => C2(1)) }, null, 8, ["class"]), v(P, { name: "Left-Chevron", class: o({ "mc-table__icon": true, "is-disabled": d2.value <= 1 }), onClick: a2[1] || (a2[1] = (e4) => C2(d2.value - 1)) }, null, 8, ["class"]), (t(true), l(s, null, m(S2.value, (e4) => (t(), l(s, { key: e4 }, ["..." !== e4 ? (t(), l("button", { key: 0, class: o(["mc-table__pagination-button mc-table__pagination-button--page", { "is-active": e4 === d2.value }]), onClick: (a3) => "number" == typeof e4 ? C2(e4) : void 0 }, r(e4), 11, pe)) : (t(), l("span", de, "..."))], 64))), 128)), v(P, { name: "Right-Chevron", class: o({ "mc-table__icon": true, "is-disabled": d2.value >= _2.value }), onClick: a2[2] || (a2[2] = (e4) => C2(d2.value + 1)) }, null, 8, ["class"]), v(P, { name: "Last", class: o({ "mc-table__icon": true, "is-disabled": d2.value >= _2.value }), onClick: a2[3] || (a2[3] = (e4) => C2(_2.value)) }, null, 8, ["class"])]), g("div", ge, [a2[5] || (a2[5] = g("label", { class: "mc-table__pagination-size-label" }, "View per page", -1)), f2.value && f2.value.length > 0 ? x((t(), l("select", { key: 0, class: "mc-table__pagination-select", "onUpdate:modelValue": a2[4] || (a2[4] = (e4) => h2.value = e4), onChange: I2 }, [(t(true), l(s, null, m(f2.value, (e4) => (t(), l("option", { key: e4, value: e4 }, r(e4), 9, me))), 128))], 544)), [[k, h2.value]]) : n("", true)])])) : n("", true);
118
+ } }), [["__scopeId", "data-v-23c6882e"]]);
119
+ function he(e2, l2) {
120
+ var _a, _b;
121
+ const n2 = p(((_a = l2.value) == null ? void 0 : _a.currentPage) || 1), t2 = p(((_b = l2.value) == null ? void 0 : _b.pageSize) || 50);
122
+ w(() => {
123
+ var _a2;
124
+ return (_a2 = l2.value) == null ? void 0 : _a2.currentPage;
125
+ }, (e3) => {
126
+ void 0 !== e3 && (n2.value = e3);
127
+ }), w(() => {
128
+ var _a2;
129
+ return (_a2 = l2.value) == null ? void 0 : _a2.pageSize;
130
+ }, (e3) => {
131
+ void 0 !== e3 && (t2.value = e3);
132
+ });
133
+ const o2 = a(() => e2.value);
134
+ return { currentPage: n2, pageSize: t2, paginatedData: o2, updatePagination: function(e3) {
135
+ n2.value = e3.pageNum, t2.value = e3.pageSize;
136
+ } };
137
+ }
138
+ function fe(e2, l2, n2) {
139
+ const t2 = p(false), o2 = p(null), i2 = a(() => t2.value ? e2.value : e2.value.map((e3) => ({ ...e3, fixed: void 0 })));
140
+ function s2() {
141
+ o2.value && (t2.value = o2.value.scrollWidth > o2.value.clientWidth);
142
+ }
143
+ function c2() {
144
+ var _a, _b;
145
+ ((_a = l2.value) == null ? void 0 : _a.headerWrapper) && ((_b = n2.value) == null ? void 0 : _b.bodyWrapper) && (l2.value.headerWrapper.scrollLeft = n2.value.bodyWrapper.scrollLeft);
146
+ }
147
+ function r2() {
148
+ C(() => {
149
+ var _a;
150
+ ((_a = n2.value) == null ? void 0 : _a.bodyWrapper) && (o2.value = n2.value.bodyWrapper, s2(), new ResizeObserver(() => {
151
+ s2();
152
+ }).observe(n2.value.bodyWrapper), window.addEventListener("resize", s2), n2.value.bodyWrapper.addEventListener("scroll", c2));
153
+ });
154
+ }
155
+ return S(() => {
156
+ r2();
157
+ }), { hasHorizontalScroll: t2, columnsWithFixed: i2, checkHorizontalScroll: s2, syncHeaderScroll: c2, initScrollSync: r2 };
158
+ }
159
+ function _e(e2, l2, n2) {
160
+ const t2 = p(n2 || null);
161
+ return { sortedData: a(() => {
162
+ if (!t2.value || !t2.value.order) return e2.value;
163
+ const { prop: a2, order: n3 } = t2.value, o2 = l2.value.find((e3) => e3.prop === a2);
164
+ if (!o2) return e2.value;
165
+ const i2 = [...e2.value];
166
+ return i2.sort((e3, l3) => {
167
+ let t3 = e3[a2], i3 = l3[a2];
168
+ if (o2.sortMethod) {
169
+ const e4 = o2.sortMethod(t3, i3);
170
+ return "desc" === n3 ? -e4 : e4;
171
+ }
172
+ return null == t3 && (t3 = ""), null == i3 && (i3 = ""), "string" == typeof t3 && "string" == typeof i3 && (t3 = t3.toLowerCase(), i3 = i3.toLowerCase()), t3 < i3 ? "asc" === n3 ? -1 : 1 : t3 > i3 ? "asc" === n3 ? 1 : -1 : 0;
173
+ }), i2;
174
+ }), currentSort: t2, handleSort: function(e3) {
175
+ if (!e3.sortable) return;
176
+ const { prop: a2 } = e3;
177
+ let l3 = "asc";
178
+ return t2.value && t2.value.prop === a2 && (l3 = "asc" === t2.value.order ? "desc" : "desc" === t2.value.order ? null : "asc"), t2.value = null === l3 ? null : { prop: a2, order: l3 }, t2.value;
179
+ }, getSortOrder: function(e3) {
180
+ return t2.value && t2.value.prop === e3 ? t2.value.order : null;
181
+ } };
182
+ }
183
+ const be = $(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: {}, initData: {}, defaultSort: {} }, emits: ["row-click", "header-click", "page-change", "page-size-change", "sort-change", "current-change", "selection-change", "select", "select-all", "update:selectedRows"], setup(e2, { expose: s2, emit: c2 }) {
184
+ const r2 = e2, { data: u2, columns: d2, pagination: g2, spanMethod: y2, loading: x2, loadingText: k2, loadingConfig: S2, defaultSort: R2, highlightCurrentRow: $2, rowKey: P2, selectable: H2, selectedRows: W2, selectOnRowClick: O2 } = I(r2), D2 = c2, B2 = p(), L2 = p(), T2 = p(), { columnsWithFixed: A2 } = fe(d2, L2, T2), { sortedData: K2, handleSort: N2, getSortOrder: j2 } = _e(u2, A2, R2 == null ? void 0 : R2.value), { paginatedData: F2, updatePagination: U2 } = he(K2, g2), V2 = a(() => F2.value), q2 = p(null), G2 = p((W2 == null ? void 0 : W2.value) || []);
185
+ w(W2, (e3) => {
186
+ e3 && (G2.value = [...e3]);
187
+ }, { deep: true, immediate: true });
188
+ const J2 = a(() => !!V2.value.length && V2.value.every((e3) => G2.value.some((a2) => P2.value ? a2[P2.value] === e3[P2.value] : a2 === e3))), Q2 = a(() => {
189
+ if (!V2.value.length) return false;
190
+ const e3 = V2.value.filter((e4) => G2.value.some((a2) => P2.value ? a2[P2.value] === e4[P2.value] : a2 === e4)).length;
191
+ return e3 > 0 && e3 < V2.value.length;
192
+ }), X2 = (e3) => {
193
+ const a2 = [];
194
+ return $2.value && q2.value === e3 && a2.push("is-current"), a2;
195
+ }, Y2 = (e3) => G2.value.some((a2) => P2.value ? a2[P2.value] === e3[P2.value] : a2 === e3), ee2 = (e3, a2) => {
196
+ const l2 = void 0 !== a2 ? a2 : !Y2(e3);
197
+ if (l2) Y2(e3) || G2.value.push(e3);
198
+ else {
199
+ const a3 = G2.value.findIndex((a4) => P2.value ? a4[P2.value] === e3[P2.value] : a4 === e3);
200
+ a3 > -1 && G2.value.splice(a3, 1);
201
+ }
202
+ D2("update:selectedRows", [...G2.value]), D2("selection-change", [...G2.value]), D2("select", e3, l2);
203
+ }, ae2 = (e3) => {
204
+ e3 ? V2.value.forEach((e4) => {
205
+ Y2(e4) || G2.value.push(e4);
206
+ }) : V2.value.forEach((e4) => {
207
+ const a2 = G2.value.findIndex((a3) => P2.value ? a3[P2.value] === e4[P2.value] : a3 === e4);
208
+ a2 > -1 && G2.value.splice(a2, 1);
209
+ }), D2("update:selectedRows", [...G2.value]), D2("selection-change", [...G2.value]), D2("select-all", e3);
210
+ }, le2 = (e3, a2) => {
211
+ if ($2.value) {
212
+ const a3 = ((e4) => (q2.value = e4, q2.value))(e3);
213
+ D2("current-change", a3);
214
+ }
215
+ H2.value && O2.value && ee2(e3), D2("row-click", e3, a2);
216
+ }, ne2 = (e3, a2) => {
217
+ D2("header-click", e3, a2);
218
+ }, te2 = (e3) => {
219
+ const a2 = N2(e3);
220
+ a2 && D2("sort-change", a2);
221
+ }, oe2 = (e3, a2) => {
222
+ ee2(e3, a2);
223
+ }, ie2 = (e3) => {
224
+ ae2(e3);
225
+ }, ce2 = async (e3) => {
226
+ U2(e3), C(() => {
227
+ var _a;
228
+ ((_a = T2.value) == null ? void 0 : _a.bodyWrapper) && (T2.value.bodyWrapper.scrollTop = 0);
229
+ }), D2("page-change", e3), r2.initData && "function" == typeof r2.initData && await r2.initData(e3);
230
+ };
231
+ return s2({ ref: B2, refresh: async () => {
232
+ if (r2.initData && "function" == typeof r2.initData && g2.value) {
233
+ const { data: e3, total: a2 } = await r2.initData({ pageSize: g2.value.pageSize || 10, pageNum: g2.value.currentPage || 1 });
234
+ u2.value = e3, g2.value.total = a2;
235
+ }
236
+ }, clearSort: () => {
237
+ d2.value.forEach((e3) => {
238
+ e3.sortable && (e3.sortOrder = null);
239
+ });
240
+ }, toggleRowSelection: ee2, toggleAllSelection: ae2, clearSelection: () => {
241
+ G2.value = [], D2("update:selectedRows", []), D2("selection-change", []);
242
+ }, getSelectedRows: () => [...G2.value] }), (e3, a2) => {
243
+ var _a;
244
+ return t(), l("div", { ref_key: "_ref", ref: B2, class: o(["mc-table", { "mc-table--loading": h(x2) }]) }, [v(Z, { ref_key: "headerRef", ref: L2, columns: h(A2), "show-header": e3.showHeader, "get-sort-order": h(j2), selectable: h(H2), "is-all-selected": J2.value, "is-indeterminate": Q2.value, onHeaderClick: ne2, onSortChange: te2, onSelectAll: ie2 }, _({ _: 2 }, [m(Object.keys(e3.$slots), (a3) => ({ name: a3, fn: b((l2) => [i(e3.$slots, a3, z(M(l2)), void 0, true)]) }))]), 1032, ["columns", "show-header", "get-sort-order", "selectable", "is-all-selected", "is-indeterminate"]), v(E, { ref_key: "bodyRef", ref: T2, data: V2.value, columns: h(A2), "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": X2, selectable: h(H2), "selected-rows": G2.value, "select-on-row-click": h(O2), onRowClick: le2, onSelect: oe2 }, _({ _: 2 }, [m(Object.keys(e3.$slots), (a3) => ({ name: a3, fn: b((l2) => [i(e3.$slots, a3, z(M(l2)), void 0, true)]) }))]), 1032, ["data", "columns", "row-key", "empty-text", "height", "max-height", "span-method", "pagination", "selectable", "selected-rows", "select-on-row-click"]), h(g2) && ((_a = h(g2)) == null ? void 0 : _a.total) > 0 ? (t(), f(ve, { key: 0, pagination: h(g2), onPageChange: ce2 }, null, 8, ["pagination"])) : n("", true), v(se, { class: "mc-table__loading", loading: h(x2), "loading-text": h(k2), "loading-config": h(S2) }, { loading: b((a3) => [i(e3.$slots, "loading", z(M(a3)), void 0, true)]), _: 3 }, 8, ["loading", "loading-text", "loading-config"])], 2);
245
+ };
246
+ } }), [["__scopeId", "data-v-dc87e5f5"]]);
247
+ export {
248
+ be as M,
249
+ fe as a,
250
+ _e as b,
251
+ he as u
252
+ };
@@ -0,0 +1,33 @@
1
+ import { _ as e, w as t } from "./utils-BwgRXuj9.js";
2
+ import { defineComponent as a, ref as o, toRefs as l, computed as r, createElementBlock as c, createCommentVNode as s, openBlock as u, normalizeStyle as i, normalizeClass as d, unref as n, createBlock as m, renderSlot as f } from "vue";
3
+ import { M as h } from "./mc-icon--CImsgxi.js";
4
+ const v = t(e(a({ __name: "mc-tag", props: { type: { default: "primary" }, size: { default: "medium" }, disabled: { type: Boolean, default: false }, closable: { type: Boolean, default: false }, color: {}, textColor: {}, backgroundColor: {}, selectedTextColor: {}, selectedBackgroundColor: {}, radius: { default: "default" }, height: {}, width: {}, icon: {}, selected: { type: Boolean } }, emits: ["click", "close"], setup(e2, { expose: t2, emit: a2 }) {
5
+ const v2 = o(), g = e2, p = a2, x = o(true), { type: b, size: y, disabled: C, closable: M, color: k, textColor: $, backgroundColor: _, selectedTextColor: B, selectedBackgroundColor: w, radius: W, height: j, width: z, icon: I, selected: T } = l(g), E = r(() => {
6
+ const e3 = {};
7
+ return (z == null ? void 0 : z.value) && (e3.width = z.value), (j == null ? void 0 : j.value) && (e3.height = j.value), (k == null ? void 0 : k.value) ? (e3["--tag-color"] = k.value, e3["--tag-hover-color"] = S(k.value, 0.7), e3["--tag-text-color"] = "#ffffff", e3["--tag-hover-text-color"] = "#ffffff") : (($ == null ? void 0 : $.value) && (e3["--tag-text-color"] = $.value), (_ == null ? void 0 : _.value) && (e3["--tag-color"] = _.value), (B == null ? void 0 : B.value) && (e3["--tag-hover-text-color"] = B.value), (w == null ? void 0 : w.value) && (e3["--tag-hover-color"] = w.value)), e3;
8
+ }), F = (e3) => {
9
+ C.value || p("click", e3);
10
+ }, N = (e3) => {
11
+ C.value || (x.value = false, p("close", e3));
12
+ }, S = (e3, t3 = 0.7) => {
13
+ var _a;
14
+ if (!e3 || "transparent" === e3) return e3;
15
+ if (e3.startsWith("var(--")) return e3;
16
+ if (e3.startsWith("#")) {
17
+ const a4 = e3.slice(1), o3 = parseInt(a4, 16), l2 = o3 >> 16 & 255, r2 = o3 >> 8 & 255, c2 = 255 & o3;
18
+ return `rgb(${Math.max(0, Math.floor(l2 * t3))}, ${Math.max(0, Math.floor(r2 * t3))}, ${Math.max(0, Math.floor(c2 * t3))})`;
19
+ }
20
+ const a3 = document.createElement("div");
21
+ a3.style.color = e3, document.body.appendChild(a3);
22
+ const o2 = getComputedStyle(a3).color;
23
+ if (document.body.removeChild(a3), o2.startsWith("rgb") || o2.startsWith("rgba")) {
24
+ const e4 = ((_a = o2.match(/\d+/g)) == null ? void 0 : _a.map(Number)) || [0, 0, 0], a4 = Math.max(0, Math.floor(e4[0] * t3)), l2 = Math.max(0, Math.floor(e4[1] * t3)), r2 = Math.max(0, Math.floor(e4[2] * t3));
25
+ return o2.includes("a") ? `rgba(${a4}, ${l2}, ${r2}, ${parseFloat(o2.split(",")[3].trim().replace(")", ""))})` : `rgb(${a4}, ${l2}, ${r2})`;
26
+ }
27
+ return e3;
28
+ };
29
+ return t2({ ref: v2 }), (e3, t3) => x.value ? (u(), c("div", { key: 0, ref_key: "_ref", ref: v2, class: d(["mc-tag", ["mc-tag--" + n(b), "mc-tag--" + n(y), "mc-tag-radius--" + n(W), { "is-disabled": n(C), "is-selected": n(T) }]]), style: i(E.value), onClick: F }, [n(I) ? (u(), m(h, { key: 0, class: "mc-tag__icon", name: n(I) }, null, 8, ["name"])) : s("", true), f(e3.$slots, "default", {}, void 0, true), n(M) && !n(C) ? (u(), m(h, { key: 1, name: "Cross", class: "mc-tag__close-icon", onClick: N })) : s("", true)], 6)) : s("", true);
30
+ } }), [["__scopeId", "data-v-79a1adca"]]));
31
+ export {
32
+ v as M
33
+ };