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,52 @@
1
+ import { defineComponent as e, ref as t, onMounted as o, onUnmounted as s, createElementBlock as n, openBlock as l, normalizeClass as i, createElementVNode as a, createBlock as c, createCommentVNode as r, toDisplayString as m, isVNode as d, createVNode as y, render as p } from "vue";
2
+ import { _ as u, w as f } from "./utils-BwgRXuj9.js";
3
+ import { M as g } from "./mc-icon--CImsgxi.js";
4
+ const _ = { class: "mc-toast__title" }, v = { class: "mc-toast__message" }, C = u(e({ name: "McToast", __name: "mc-toast", props: { type: { default: "primary" }, title: { default: "" }, message: { default: "" }, icon: {}, showClose: { type: Boolean, default: true }, duration: { default: 0 }, position: { default: "top" }, onClose: {} }, emits: ["close"], setup(e2, { expose: d2, emit: y2 }) {
5
+ const p2 = e2, u2 = y2, f2 = t(), C2 = t(true), h2 = t(false);
6
+ let b2 = null;
7
+ const T2 = () => {
8
+ b2 && (clearTimeout(b2), b2 = null), h2.value = true, setTimeout(() => {
9
+ u2("close"), p2.onClose && p2.onClose();
10
+ }, 300);
11
+ };
12
+ return o(() => {
13
+ setTimeout(() => {
14
+ C2.value = false;
15
+ }, 20), p2.duration > 0 && (b2 = setTimeout(() => {
16
+ T2();
17
+ }, p2.duration));
18
+ }), s(() => {
19
+ b2 && (clearTimeout(b2), b2 = null);
20
+ }), d2({ ref: f2, close: T2 }), (e3, t2) => (l(), n("div", { ref_key: "_ref", ref: f2, class: i(["mc-toast", [C2.value ? "mc-toast--entering" : "", h2.value ? "mc-toast--leaving" : ""]]) }, [a("div", { class: i(["mc-toast__header", `mc-toast__header--${e3.type}`]) }, [e3.icon ? (l(), c(g, { key: 0, class: "mc-toast__icon", name: e3.icon }, null, 8, ["name"])) : r("", true), a("div", _, m(e3.title), 1), e3.showClose ? (l(), c(g, { key: 1, name: "Cross", class: "mc-toast__close", onClick: T2 })) : r("", true)], 2), a("div", { class: i(["mc-toast__body", `mc-toast__body--${e3.type}`]) }, [a("div", v, m(e3.message), 1)], 2)], 2));
21
+ } }), [["__scopeId", "data-v-d979c310"]]), h = {};
22
+ let b = null;
23
+ const T = (e2) => {
24
+ var _a;
25
+ let t2 = {};
26
+ t2 = "string" == typeof e2 ? { message: e2 } : d(e2) ? { message: "" } : { ...e2 }, t2.position = t2.position || "top", b || (b = document.createElement("div"), b.className = "mc-toast-overlay", b.style.position = "fixed", b.style.top = "0", b.style.left = "0", b.style.width = "100%", b.style.height = "100%", b.style.backgroundColor = "rgba(0, 0, 0, 0.5)", b.style.zIndex = "9998", b.style.transition = "opacity 0.1s ease", b.style.opacity = "0", document.body.appendChild(b), b.getBoundingClientRect(), b.style.opacity = "1");
27
+ const o2 = ((e3) => {
28
+ if (h[e3]) return h[e3];
29
+ const t3 = document.createElement("div");
30
+ return t3.className = "mc-toast-container", t3.style.position = "fixed", t3.style.left = "50%", t3.style.top = "50%", t3.style.transform = "translate(-50%, -50%)", t3.style.zIndex = "9999", t3.style.display = "flex", t3.style.flexDirection = "column", t3.style.alignItems = "center", document.body.appendChild(t3), h[e3] = t3, t3;
31
+ })(t2.position), s2 = document.createElement("div"), n2 = y(C, { ...t2, onClose: () => {
32
+ o2.childNodes.length <= 1 && b && document.body.contains(b) && (b.style.opacity = "0", setTimeout(() => {
33
+ b && document.body.contains(b) && (document.body.removeChild(b), b = null);
34
+ }, 300)), t2.onClose && t2.onClose(), setTimeout(() => {
35
+ p(null, s2), o2.contains(s2) && o2.removeChild(s2), 0 === o2.childNodes.length && (document.body.contains(o2) && document.body.removeChild(o2), delete h[t2.position]);
36
+ }, 300);
37
+ } });
38
+ p(n2, s2), o2.appendChild(s2);
39
+ const l2 = (_a = n2.component) == null ? void 0 : _a.exposed;
40
+ return { close: () => {
41
+ l2 == null ? void 0 : l2.close();
42
+ } };
43
+ }, x = T, E = (e2) => T("string" == typeof e2 ? { message: e2, type: "primary", title: "Info", icon: "Info" } : { title: "Info", icon: "Info", ...e2, type: "primary" }), I = (e2) => T("string" == typeof e2 ? { message: e2, type: "success", title: "Success", icon: "Tick" } : { title: "Success", icon: "Tick", ...e2, type: "success" }), k = (e2) => T("string" == typeof e2 ? { message: e2, type: "warning", title: "Warning", icon: "Error_02" } : { title: "Warning", icon: "Error_02", ...e2, type: "warning" }), w = (e2) => T("string" == typeof e2 ? { message: e2, type: "error", title: "Error", icon: "Error" } : { title: "Error", icon: "Error", ...e2, type: "error" }), N = f(C);
44
+ export {
45
+ N as M,
46
+ E as a,
47
+ I as b,
48
+ T as c,
49
+ k as d,
50
+ w as e,
51
+ x as t
52
+ };
@@ -0,0 +1,33 @@
1
+ import { defineComponent as e, ref as o, computed as t, watch as a, onUnmounted as l, watchEffect as i, createElementBlock as s, openBlock as r, mergeProps as u, toHandlers as p, createElementVNode as n, createVNode as v, renderSlot as c, Transition as m, withCtx as d, createCommentVNode as f, createTextVNode as g, toDisplayString as h } from "vue";
2
+ import { createPopper as _ } from "@popperjs/core";
3
+ import { u as k } from "./hooks-c7yYlQyM.js";
4
+ import { d as b, b as y, i as N } from "./vendor-CNzO2Q1s.js";
5
+ import { _ as T, w as j } from "./utils-BwgRXuj9.js";
6
+ const w = j(T(e({ name: "McTooltip", __name: "mc-tooltip", props: { content: {}, trigger: { default: "hover" }, placement: { default: "bottom" }, disabled: { type: Boolean }, popperOptions: {}, showTimeout: { default: 0 }, hideTimeout: { default: 300 }, transitionName: { default: "fade" } }, emits: ["visible:change", "click:outside"], setup(e2, { expose: T2, emit: j2 }) {
7
+ const w2 = e2, x = j2, M = o({}), O = o({}), $ = o({}), B = o(), I = o(), q = o(), z = o(false), A = (e3) => {
8
+ w2.disabled && (e3 = false), z.value = e3, x("visible:change", e3);
9
+ }, C = t(() => ({ placement: w2.placement, modifiers: [{ name: "offset", options: { offset: [0, 8] } }], ...w2.popperOptions }));
10
+ let D, E, F;
11
+ a(z, (e3) => {
12
+ e3 && I.value && q.value && (D = _(I.value, q.value, C.value));
13
+ }, { flush: "post" }), l(() => {
14
+ N(D) || (D.destroy(), D = void 0);
15
+ });
16
+ const G = t(() => "hover" === w2.trigger ? w2.showTimeout : 0), H = t(() => "hover" === w2.trigger ? w2.hideTimeout : 0);
17
+ i(() => {
18
+ M.value = {}, O.value = {}, $.value = {}, w2.disabled ? K(false) : "click" === w2.trigger ? M.value.click = () => {
19
+ z.value ? K() : J();
20
+ } : "hover" === w2.trigger && (M.value.mouseenter = () => J(), O.value.mouseleave = () => K(), $.value.mouseenter = () => J()), E = b(y(A, null, true), G.value), F = b(y(A, null, false), H.value);
21
+ });
22
+ const J = (e3 = true) => {
23
+ F == null ? void 0 : F.cancel(), e3 ? E == null ? void 0 : E() : A(false);
24
+ }, K = (e3 = true) => {
25
+ E == null ? void 0 : E.cancel(), e3 ? F == null ? void 0 : F() : A(false);
26
+ };
27
+ return k(B, () => {
28
+ x("click:outside"), "hover" !== w2.trigger && z.value && K(false);
29
+ }), T2({ show: () => J(false), hide: () => K(false) }), (e3, o2) => (r(), s("div", u({ class: "mc-tooltip", ref_key: "containerNode", ref: B }, p(O.value, true)), [n("div", u({ class: "mc-tooltip__trigger", ref_key: "triggerNode", ref: I }, p(M.value, true)), [c(e3.$slots, "default", {}, void 0, true)], 16), v(m, { name: e3.transitionName }, { default: d(() => [z.value ? (r(), s("div", u({ key: 0, class: "mc-tooltip__popper", ref_key: "popperNode", ref: q }, p($.value, true)), [c(e3.$slots, "content", {}, () => [g(h(e3.content), 1)], true)], 16)) : f("", true)]), _: 3 }, 8, ["name"])], 16));
30
+ } }), [["__scopeId", "data-v-d3a7e7be"]]));
31
+ export {
32
+ w as M
33
+ };