mediacube-ui-v2 0.0.264 → 0.0.267
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/components/templates/McDrawer/McDrawerContainer.vue2.js +36 -35
- package/dist/components/templates/McDrawer/McDrawerSafeComponent.vue.js +10 -2
- package/dist/components/templates/McDrawer/McDrawerSafeComponent.vue2.js +2 -10
- package/dist/components/templates/McModal/McModalContainer.vue2.js +33 -33
- package/dist/components/templates/McModal/McModalSafeComponent.vue.js +12 -0
- package/dist/components/templates/McModal/McModalSafeComponent.vue2.js +4 -0
- package/dist/components/templates/McToast/McToastContainer.vue.js +87 -3
- package/dist/components/templates/McToast/McToastContainer.vue3.js +5 -0
- package/dist/composables/useModal.js +22 -20
- package/dist/composables/useToast.js +20 -18
- package/dist/types/components/templates/McModal/McModalContainer.vue.d.ts +6 -2
- package/dist/types/components/templates/McModal/McModalSafeComponent.vue.d.ts +13 -0
- package/dist/types/components/templates/McModal/index.d.ts +6 -2
- package/package.json +1 -1
- package/dist/components/templates/McToast/McToastContainer.vue2.js +0 -89
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as C, defineAsyncComponent as P, computed as u, onMounted as g, onBeforeUnmount as S, openBlock as a, createElementBlock as f, normalizeStyle as x, Fragment as V, renderList as b, createBlock as i, unref as k, mergeProps as _, withCtx as m, Suspense as D, createVNode as E, resolveDynamicComponent as I } from "vue";
|
|
2
|
+
import M from "./McDrawerSafeComponent.vue.js";
|
|
3
|
+
const O = /* @__PURE__ */ C({
|
|
3
4
|
__name: "McDrawerContainer",
|
|
4
5
|
props: {
|
|
5
6
|
drawerServiceState: {
|
|
@@ -19,61 +20,61 @@ const B = /* @__PURE__ */ S({
|
|
|
19
20
|
default: () => ({})
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
const e =
|
|
23
|
+
setup(y) {
|
|
24
|
+
const w = P(() => import("./McDrawer.vue.js")), l = y, o = u(() => l.reactiveProps.drawers ?? []), n = u(() => o.value.map((r, t) => {
|
|
25
|
+
const e = o.value.length - 1 - t, s = Math.min(e, l.drawersMaxInCascade - 1), d = o.value.findLastIndex(
|
|
25
26
|
// @ts-ignore
|
|
26
27
|
// eslint-disable-next-line no-prototype-builtins
|
|
27
|
-
(
|
|
28
|
+
(v) => !v?.drawerProps.hasOwnProperty("showOverlay") || v.drawerProps?.showOverlay
|
|
28
29
|
);
|
|
29
30
|
return {
|
|
30
|
-
...
|
|
31
|
+
...r,
|
|
31
32
|
indent_coefficient: e,
|
|
32
33
|
real_coefficient: s,
|
|
33
|
-
indent: s *
|
|
34
|
-
can_show_overlay: t ===
|
|
34
|
+
indent: s * l.drawersCascadeIndent,
|
|
35
|
+
can_show_overlay: t === d
|
|
35
36
|
};
|
|
36
|
-
})),
|
|
37
|
-
zIndex:
|
|
38
|
-
visibility:
|
|
39
|
-
})),
|
|
40
|
-
|
|
41
|
-
n.value.every((t) => !t.modelValue) &&
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
if (
|
|
37
|
+
})), h = u(() => ({
|
|
38
|
+
zIndex: o.value.length ? 10004 : -1,
|
|
39
|
+
visibility: o.value.length ? "visible" : "hidden"
|
|
40
|
+
})), c = (r) => {
|
|
41
|
+
r.close(), setTimeout(() => {
|
|
42
|
+
n.value.every((t) => !t.modelValue) && l.drawerServiceState.closeServiceState();
|
|
43
|
+
}, r?.drawerProps?.duration || 300);
|
|
44
|
+
}, p = (r) => {
|
|
45
|
+
if (r.code === "Escape" && n.value?.length) {
|
|
45
46
|
const t = n.value[n.value.length - 1];
|
|
46
47
|
if (t.drawerProps?.disableBgClick) return;
|
|
47
48
|
t.close();
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
return g(() => {
|
|
51
|
-
document.addEventListener("keyup",
|
|
52
|
-
}),
|
|
53
|
-
document.removeEventListener("keyup",
|
|
54
|
-
}), (
|
|
52
|
+
document.addEventListener("keyup", p);
|
|
53
|
+
}), S(() => {
|
|
54
|
+
document.removeEventListener("keyup", p);
|
|
55
|
+
}), (r, t) => (a(), f("div", {
|
|
55
56
|
class: "mc-drawer-container",
|
|
56
|
-
style:
|
|
57
|
+
style: x(h.value)
|
|
57
58
|
}, [
|
|
58
|
-
(a(!0), f(V, null, b(n.value, (e, s) => (a(),
|
|
59
|
+
(a(!0), f(V, null, b(n.value, (e, s) => (a(), i(k(w), _({
|
|
59
60
|
key: e.id,
|
|
60
61
|
modelValue: e.modelValue,
|
|
61
|
-
"onUpdate:modelValue": (
|
|
62
|
+
"onUpdate:modelValue": (d) => e.modelValue = d
|
|
62
63
|
}, { ref_for: !0 }, e.drawerProps, {
|
|
63
64
|
"show-overlay": e.can_show_overlay,
|
|
64
|
-
onClose: () =>
|
|
65
|
+
onClose: () => c(e),
|
|
65
66
|
class: ["mc-drawer-container__item", { "mc-drawer-container__item--multiple": n.value.length - 1 !== s }],
|
|
66
67
|
style: e.indent ? { transform: `translateX(-${e.indent}px)` } : {}
|
|
67
68
|
}), {
|
|
68
|
-
default:
|
|
69
|
-
(a(),
|
|
70
|
-
default:
|
|
71
|
-
M
|
|
72
|
-
onErrorCaptured: () =>
|
|
69
|
+
default: m(() => [
|
|
70
|
+
(a(), i(D, null, {
|
|
71
|
+
default: m(() => [
|
|
72
|
+
E(M, {
|
|
73
|
+
onErrorCaptured: () => c(e)
|
|
73
74
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
(a(),
|
|
76
|
-
onCloseDrawer: () =>
|
|
75
|
+
default: m(() => [
|
|
76
|
+
(a(), i(I(e.component), _({ ref_for: !0 }, e.componentProps, {
|
|
77
|
+
onCloseDrawer: () => c(e)
|
|
77
78
|
}), null, 16, ["onCloseDrawer"]))
|
|
78
79
|
]),
|
|
79
80
|
_: 2
|
|
@@ -88,5 +89,5 @@ const B = /* @__PURE__ */ S({
|
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
O as default
|
|
92
93
|
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as o, onErrorCaptured as n, renderSlot as a } from "vue";
|
|
2
|
+
const m = /* @__PURE__ */ o({
|
|
3
|
+
__name: "McDrawerSafeComponent",
|
|
4
|
+
emits: ["error-captured"],
|
|
5
|
+
setup(s, { emit: e }) {
|
|
6
|
+
const t = e;
|
|
7
|
+
return n((r) => (console.error(r), t("error-captured"), !1)), (r, p) => a(r.$slots, "default");
|
|
8
|
+
}
|
|
9
|
+
});
|
|
2
10
|
export {
|
|
3
|
-
|
|
11
|
+
m as default
|
|
4
12
|
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const m = /* @__PURE__ */ o({
|
|
3
|
-
__name: "McDrawerSafeComponent",
|
|
4
|
-
emits: ["error-captured"],
|
|
5
|
-
setup(s, { emit: e }) {
|
|
6
|
-
const t = e;
|
|
7
|
-
return n((r) => (console.error(r), t("error-captured"), !1)), (r, p) => a(r.$slots, "default");
|
|
8
|
-
}
|
|
9
|
-
});
|
|
1
|
+
import f from "./McDrawerSafeComponent.vue.js";
|
|
10
2
|
export {
|
|
11
|
-
|
|
3
|
+
f as default
|
|
12
4
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as y, computed as d, onMounted as k, watch as C, onBeforeUnmount as _, openBlock as l, createElementBlock as c, normalizeStyle as h, Fragment as S, renderList as B, createBlock as u, Suspense as V, withCtx as i, createVNode as g, resolveDynamicComponent as P, mergeProps as w } from "vue";
|
|
2
|
+
import E from "./McModalSafeComponent.vue.js";
|
|
3
|
+
const b = ["onClose"], L = /* @__PURE__ */ y({
|
|
3
4
|
__name: "McModalContainer",
|
|
4
5
|
props: {
|
|
5
6
|
modalServiceState: {
|
|
@@ -8,54 +9,53 @@ const M = ["onClose"], x = /* @__PURE__ */ v({
|
|
|
8
9
|
},
|
|
9
10
|
reactiveProps: {
|
|
10
11
|
type: Object,
|
|
11
|
-
default: () => ({})
|
|
12
|
+
default: () => ({ modals: [] })
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
setup(p) {
|
|
15
|
-
const
|
|
16
|
-
zIndex:
|
|
17
|
-
visibility:
|
|
18
|
-
})),
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const a = p, o = d(() => a.reactiveProps?.modals ?? []), m = d(() => ({
|
|
17
|
+
zIndex: o.value.length ? 99999 : -1,
|
|
18
|
+
visibility: o.value.length ? "visible" : "hidden"
|
|
19
|
+
})), r = (t) => {
|
|
20
|
+
t.close(), setTimeout(() => {
|
|
21
|
+
o.value.every((n) => !n.modelValue) && a.modalServiceState.closeServiceState();
|
|
21
22
|
}, 300);
|
|
22
|
-
}, s = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
e.close();
|
|
23
|
+
}, s = (t) => {
|
|
24
|
+
if (t.code === "Escape" && o.value.length) {
|
|
25
|
+
const n = o.value[o.value.length - 1];
|
|
26
|
+
if (!(!n?.componentProps?.hasOwnProperty("clickBackdropToClose") || n?.componentProps?.clickBackdropToClose)) return;
|
|
27
|
+
n.close();
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
typeof window > "u" || (document.body.style.overflow =
|
|
29
|
+
}, v = (t) => {
|
|
30
|
+
typeof window > "u" || (document.body.style.overflow = t ? "hidden" : "");
|
|
31
31
|
};
|
|
32
32
|
return k(() => {
|
|
33
|
-
document.addEventListener("keyup", s),
|
|
34
|
-
() =>
|
|
35
|
-
(
|
|
33
|
+
document.addEventListener("keyup", s), C(
|
|
34
|
+
() => o.value.length,
|
|
35
|
+
(t) => v(!!t),
|
|
36
36
|
{ immediate: !0 }
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
38
|
+
}), _(() => {
|
|
39
39
|
document.removeEventListener("keyup", s);
|
|
40
|
-
}), (
|
|
40
|
+
}), (t, n) => (l(), c("div", {
|
|
41
41
|
class: "mc-modal-container",
|
|
42
|
-
style:
|
|
42
|
+
style: h(m.value)
|
|
43
43
|
}, [
|
|
44
|
-
(
|
|
44
|
+
(l(!0), c(S, null, B(o.value, (e) => (l(), c("div", {
|
|
45
45
|
key: e.id,
|
|
46
|
-
onClose: () =>
|
|
46
|
+
onClose: () => r(e)
|
|
47
47
|
}, [
|
|
48
|
-
(
|
|
48
|
+
(l(), u(V, null, {
|
|
49
49
|
default: i(() => [
|
|
50
|
-
g(
|
|
51
|
-
onErrorCaptured: () =>
|
|
50
|
+
g(E, {
|
|
51
|
+
onErrorCaptured: () => r(e)
|
|
52
52
|
}, {
|
|
53
53
|
default: i(() => [
|
|
54
|
-
(
|
|
54
|
+
(l(), u(P(e.component), w({
|
|
55
55
|
modelValue: e.modelValue,
|
|
56
|
-
"onUpdate:modelValue": (
|
|
56
|
+
"onUpdate:modelValue": (f) => e.modelValue = f
|
|
57
57
|
}, { ref_for: !0 }, e.componentProps, {
|
|
58
|
-
onClosed: () =>
|
|
58
|
+
onClosed: () => r(e)
|
|
59
59
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "onClosed"]))
|
|
60
60
|
]),
|
|
61
61
|
_: 2
|
|
@@ -63,10 +63,10 @@ const M = ["onClose"], x = /* @__PURE__ */ v({
|
|
|
63
63
|
]),
|
|
64
64
|
_: 2
|
|
65
65
|
}, 1024))
|
|
66
|
-
], 40,
|
|
66
|
+
], 40, b))), 128))
|
|
67
67
|
], 4));
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
L as default
|
|
72
72
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineComponent as t, onErrorCaptured as n, renderSlot as a } from "vue";
|
|
2
|
+
const m = /* @__PURE__ */ t({
|
|
3
|
+
__name: "McModalSafeComponent",
|
|
4
|
+
emits: ["error-captured"],
|
|
5
|
+
setup(s, { emit: r }) {
|
|
6
|
+
const o = r;
|
|
7
|
+
return n((e) => (console.error(e), o("error-captured"), !1)), (e, p) => a(e.$slots, "default");
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
m as default
|
|
12
|
+
};
|
|
@@ -1,5 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as P, defineAsyncComponent as B, computed as c, openBlock as t, createElementBlock as n, Fragment as i, renderList as a, createBlock as u, unref as _, mergeProps as d, createCommentVNode as m } from "vue";
|
|
2
|
+
import { ToastPositions as p } from "../../../enums/Toast2.js";
|
|
3
|
+
const T = { class: "mc-toasts-container" }, $ = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "mc-toasts-container__top mc-toasts-container__top--left"
|
|
6
|
+
}, L = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "mc-toasts-container__top mc-toasts-container__top--center"
|
|
9
|
+
}, R = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "mc-toasts-container__top mc-toasts-container__top--right"
|
|
12
|
+
}, x = {
|
|
13
|
+
key: 3,
|
|
14
|
+
class: "mc-toasts-container__bottom mc-toasts-container__bottom--left"
|
|
15
|
+
}, M = {
|
|
16
|
+
key: 4,
|
|
17
|
+
class: "mc-toasts-container__bottom mc-toasts-container__bottom--center"
|
|
18
|
+
}, j = {
|
|
19
|
+
key: 5,
|
|
20
|
+
class: "mc-toasts-container__bottom mc-toasts-container__bottom--right"
|
|
21
|
+
}, N = /* @__PURE__ */ P({
|
|
22
|
+
__name: "McToastContainer",
|
|
23
|
+
props: {
|
|
24
|
+
reactiveProps: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({
|
|
27
|
+
toasts: []
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setup(b) {
|
|
32
|
+
const r = B(() => import("./McToast.vue.js")), s = b, f = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopLeft).reverse()), C = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopCenter).reverse()), h = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopRight).reverse()), k = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomLeft)), y = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomCenter)), g = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomRight)), l = (o) => {
|
|
33
|
+
o.close();
|
|
34
|
+
};
|
|
35
|
+
return (o, A) => (t(), n("div", T, [
|
|
36
|
+
f.value.length ? (t(), n("div", $, [
|
|
37
|
+
(t(!0), n(i, null, a(f.value, (e) => (t(), u(_(r), d({
|
|
38
|
+
key: e.id
|
|
39
|
+
}, { ref_for: !0 }, e, {
|
|
40
|
+
toast: e,
|
|
41
|
+
onClosed: (v) => l(e)
|
|
42
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
43
|
+
])) : m("", !0),
|
|
44
|
+
C.value.length ? (t(), n("div", L, [
|
|
45
|
+
(t(!0), n(i, null, a(C.value, (e) => (t(), u(_(r), d({
|
|
46
|
+
key: e.id
|
|
47
|
+
}, { ref_for: !0 }, e, {
|
|
48
|
+
toast: e,
|
|
49
|
+
onClosed: (v) => l(e)
|
|
50
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
51
|
+
])) : m("", !0),
|
|
52
|
+
h.value.length ? (t(), n("div", R, [
|
|
53
|
+
(t(!0), n(i, null, a(h.value, (e) => (t(), u(_(r), d({
|
|
54
|
+
key: e.id
|
|
55
|
+
}, { ref_for: !0 }, e, {
|
|
56
|
+
toast: e,
|
|
57
|
+
onClosed: (v) => l(e)
|
|
58
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
59
|
+
])) : m("", !0),
|
|
60
|
+
k.value.length ? (t(), n("div", x, [
|
|
61
|
+
(t(!0), n(i, null, a(k.value, (e) => (t(), u(_(r), d({
|
|
62
|
+
key: e.id
|
|
63
|
+
}, { ref_for: !0 }, e, {
|
|
64
|
+
toast: e,
|
|
65
|
+
onClosed: (v) => l(e)
|
|
66
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
67
|
+
])) : m("", !0),
|
|
68
|
+
y.value.length ? (t(), n("div", M, [
|
|
69
|
+
(t(!0), n(i, null, a(y.value, (e) => (t(), u(_(r), d({
|
|
70
|
+
key: e.id
|
|
71
|
+
}, { ref_for: !0 }, e, {
|
|
72
|
+
toast: e,
|
|
73
|
+
onClosed: (v) => l(e)
|
|
74
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
75
|
+
])) : m("", !0),
|
|
76
|
+
g.value.length ? (t(), n("div", j, [
|
|
77
|
+
(t(!0), n(i, null, a(g.value, (e) => (t(), u(_(r), d({
|
|
78
|
+
key: e.id
|
|
79
|
+
}, { ref_for: !0 }, e, {
|
|
80
|
+
toast: e,
|
|
81
|
+
onClosed: (v) => l(e)
|
|
82
|
+
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
83
|
+
])) : m("", !0)
|
|
84
|
+
]));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
3
87
|
export {
|
|
4
|
-
|
|
88
|
+
N as default
|
|
5
89
|
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getStoredAppContext as
|
|
1
|
+
import { reactive as u, shallowRef as M, inject as v, markRaw as h, defineAsyncComponent as S, h as O, render as g } from "vue";
|
|
2
|
+
import { getStoredAppContext as f } from "../storedAppContext.js";
|
|
3
3
|
import { useHelper as y } from "./useHelper2.js";
|
|
4
|
-
|
|
4
|
+
import E from "../components/templates/McModal/McModalContainer.vue2.js";
|
|
5
|
+
import '../assets/components/templates/McModal/McModalContainer.css';/* empty css */
|
|
6
|
+
const i = y(), d = {}, a = u({
|
|
5
7
|
isOpen: !1,
|
|
6
8
|
activeModal: null,
|
|
7
9
|
closeServiceState: () => {
|
|
8
10
|
a.isOpen = !1, e.modals = [];
|
|
9
11
|
}
|
|
10
|
-
}),
|
|
12
|
+
}), p = M({}), e = u({ modals: [] }), w = { name: "McModalAsyncError", render: () => null }, A = (o) => {
|
|
11
13
|
if (!o) return o;
|
|
12
14
|
const t = o.toString();
|
|
13
15
|
if (d[t]) return d[t];
|
|
14
16
|
let l = o;
|
|
15
|
-
return typeof o == "function" && (l =
|
|
17
|
+
return typeof o == "function" && (l = S({
|
|
16
18
|
loader: () => {
|
|
17
19
|
const n = o();
|
|
18
20
|
return n != null && typeof n.then == "function" ? n : Promise.resolve(n);
|
|
@@ -32,11 +34,11 @@ const E = u(() => import("../components/templates/McModal/McModalContainer.vue.j
|
|
|
32
34
|
modalServiceState: a,
|
|
33
35
|
reactiveProps: e
|
|
34
36
|
});
|
|
35
|
-
t.appContext =
|
|
37
|
+
t.appContext = f(), g(t, o);
|
|
36
38
|
}, R = () => {
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
const l =
|
|
39
|
+
f() && x();
|
|
40
|
+
}, _ = (o, t = {}) => {
|
|
41
|
+
const l = p.value[o];
|
|
40
42
|
if (!l)
|
|
41
43
|
return console.warn(`Modal ${o} not registered`);
|
|
42
44
|
R();
|
|
@@ -45,8 +47,8 @@ const E = u(() => import("../components/templates/McModal/McModalContainer.vue.j
|
|
|
45
47
|
n.modelValue = !0, a.activeModal = n;
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
|
-
const
|
|
49
|
-
component:
|
|
50
|
+
const C = h(A(l)), c = o, m = {
|
|
51
|
+
component: C,
|
|
50
52
|
componentName: o,
|
|
51
53
|
componentProps: t,
|
|
52
54
|
modelValue: !0,
|
|
@@ -59,19 +61,19 @@ const E = u(() => import("../components/templates/McModal/McModalContainer.vue.j
|
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
e.modals.push(m), a.isOpen = !0, a.activeModal = m;
|
|
62
|
-
},
|
|
64
|
+
}, L = (o) => {
|
|
63
65
|
(i.findLastSafe(e.modals, (l) => l.componentName === o) || e.modals[e.modals.length - 1])?.close();
|
|
64
|
-
},
|
|
66
|
+
}, V = () => {
|
|
65
67
|
e.modals.forEach((o) => o.close());
|
|
66
68
|
};
|
|
67
|
-
function
|
|
68
|
-
const o =
|
|
69
|
-
return o.modalComponents && (
|
|
70
|
-
showModal:
|
|
71
|
-
closeModal:
|
|
72
|
-
closeAllModals:
|
|
69
|
+
function z() {
|
|
70
|
+
const o = v("dsOptions", {});
|
|
71
|
+
return o.modalComponents && (p.value = o.modalComponents), {
|
|
72
|
+
showModal: _,
|
|
73
|
+
closeModal: L,
|
|
74
|
+
closeAllModals: V
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
77
|
export {
|
|
76
|
-
|
|
78
|
+
z as useModal
|
|
77
79
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { useRandomNumber as
|
|
2
|
-
import {
|
|
3
|
-
import { ToastPositions as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useRandomNumber as C } from "./useRandomNumber2.js";
|
|
2
|
+
import { ref as w, shallowRef as y, reactive as b, inject as O, h as _, render as x } from "vue";
|
|
3
|
+
import { ToastPositions as B } from "../enums/Toast2.js";
|
|
4
|
+
import { useTheme as P } from "./useTheme2.js";
|
|
5
|
+
import R from "../components/templates/McToast/McToastContainer.vue.js";
|
|
6
|
+
import '../assets/components/templates/McToast/McToastContainer.css';/* empty css */
|
|
7
|
+
const e = {
|
|
8
|
+
position: B.BottomCenter,
|
|
7
9
|
duration: 3e3
|
|
8
|
-
}, r = w({}), a =
|
|
10
|
+
}, r = w({}), a = y({
|
|
9
11
|
duration: e.duration,
|
|
10
12
|
position: e.position
|
|
11
|
-
}), i =
|
|
13
|
+
}), i = b({
|
|
12
14
|
toasts: []
|
|
13
15
|
});
|
|
14
16
|
class c {
|
|
@@ -35,10 +37,10 @@ class c {
|
|
|
35
37
|
closable: p,
|
|
36
38
|
show_time: f,
|
|
37
39
|
actions: v = [],
|
|
38
|
-
onClose:
|
|
40
|
+
onClose: E,
|
|
39
41
|
onTimeEnd: T
|
|
40
42
|
}) {
|
|
41
|
-
this.id = o ||
|
|
43
|
+
this.id = o || C().timestamp(5), this.duration = s || a.value.duration || e.duration, this.position = n || a.value.position || e.position, this.variation = m, this.icon = u, this.title = l, this.description = h, this.closable = p || !1, this.show_time = f || !1, this.actions = v, this.onClose = E, this.onTimeEnd = T;
|
|
42
44
|
}
|
|
43
45
|
destroy = () => {
|
|
44
46
|
i.toasts = i.toasts.filter((o) => o.id !== this.id);
|
|
@@ -63,22 +65,22 @@ function j(t) {
|
|
|
63
65
|
function k() {
|
|
64
66
|
i.toasts.forEach((t) => t.destroy());
|
|
65
67
|
}
|
|
66
|
-
const
|
|
68
|
+
const A = () => {
|
|
67
69
|
const t = document.createElement("div");
|
|
68
70
|
t.id = "toast-container", document.body.appendChild(t);
|
|
69
|
-
const o =
|
|
70
|
-
|
|
71
|
+
const o = _(R, { reactiveProps: i });
|
|
72
|
+
x(o, t);
|
|
71
73
|
}, d = () => {
|
|
72
|
-
document.getElementById("toast-container") ||
|
|
74
|
+
document.getElementById("toast-container") || A();
|
|
73
75
|
};
|
|
74
|
-
function
|
|
75
|
-
const t =
|
|
76
|
-
return r.value =
|
|
76
|
+
function G() {
|
|
77
|
+
const t = O("dsOptions", {});
|
|
78
|
+
return r.value = P("toast"), t.toasts && (a.value = t.toasts), {
|
|
77
79
|
show: g,
|
|
78
80
|
info: j,
|
|
79
81
|
hideAll: k
|
|
80
82
|
};
|
|
81
83
|
}
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
G as useToast
|
|
84
86
|
};
|
|
@@ -9,7 +9,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
9
9
|
type: () => {
|
|
10
10
|
modals: IModalState[];
|
|
11
11
|
};
|
|
12
|
-
default: () => {
|
|
12
|
+
default: () => {
|
|
13
|
+
modals: IModalState[];
|
|
14
|
+
};
|
|
13
15
|
};
|
|
14
16
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
15
17
|
modalServiceState: {
|
|
@@ -20,7 +22,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
20
22
|
type: () => {
|
|
21
23
|
modals: IModalState[];
|
|
22
24
|
};
|
|
23
|
-
default: () => {
|
|
25
|
+
default: () => {
|
|
26
|
+
modals: IModalState[];
|
|
27
|
+
};
|
|
24
28
|
};
|
|
25
29
|
}>> & Readonly<{}>, {
|
|
26
30
|
reactiveProps: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
|
+
"error-captured": (...args: any[]) => void;
|
|
3
|
+
}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
"onError-captured"?: ((...args: any[]) => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
}>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -7,7 +7,9 @@ declare const McModalContainer: import('vue').DefineComponent<import('vue').Extr
|
|
|
7
7
|
type: () => {
|
|
8
8
|
modals: import('../../../types/IModal').IModalState[];
|
|
9
9
|
};
|
|
10
|
-
default: () => {
|
|
10
|
+
default: () => {
|
|
11
|
+
modals: import('../../../types/IModal').IModalState[];
|
|
12
|
+
};
|
|
11
13
|
};
|
|
12
14
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
15
|
modalServiceState: {
|
|
@@ -18,7 +20,9 @@ declare const McModalContainer: import('vue').DefineComponent<import('vue').Extr
|
|
|
18
20
|
type: () => {
|
|
19
21
|
modals: import('../../../types/IModal').IModalState[];
|
|
20
22
|
};
|
|
21
|
-
default: () => {
|
|
23
|
+
default: () => {
|
|
24
|
+
modals: import('../../../types/IModal').IModalState[];
|
|
25
|
+
};
|
|
22
26
|
};
|
|
23
27
|
}>> & Readonly<{}>, {
|
|
24
28
|
reactiveProps: {
|
package/package.json
CHANGED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { defineComponent as P, defineAsyncComponent as B, computed as c, openBlock as t, createElementBlock as n, Fragment as i, renderList as a, createBlock as u, unref as _, mergeProps as d, createCommentVNode as m } from "vue";
|
|
2
|
-
import { ToastPositions as p } from "../../../enums/Toast2.js";
|
|
3
|
-
const T = { class: "mc-toasts-container" }, $ = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "mc-toasts-container__top mc-toasts-container__top--left"
|
|
6
|
-
}, L = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "mc-toasts-container__top mc-toasts-container__top--center"
|
|
9
|
-
}, R = {
|
|
10
|
-
key: 2,
|
|
11
|
-
class: "mc-toasts-container__top mc-toasts-container__top--right"
|
|
12
|
-
}, x = {
|
|
13
|
-
key: 3,
|
|
14
|
-
class: "mc-toasts-container__bottom mc-toasts-container__bottom--left"
|
|
15
|
-
}, M = {
|
|
16
|
-
key: 4,
|
|
17
|
-
class: "mc-toasts-container__bottom mc-toasts-container__bottom--center"
|
|
18
|
-
}, j = {
|
|
19
|
-
key: 5,
|
|
20
|
-
class: "mc-toasts-container__bottom mc-toasts-container__bottom--right"
|
|
21
|
-
}, N = /* @__PURE__ */ P({
|
|
22
|
-
__name: "McToastContainer",
|
|
23
|
-
props: {
|
|
24
|
-
reactiveProps: {
|
|
25
|
-
type: Object,
|
|
26
|
-
default: () => ({
|
|
27
|
-
toasts: []
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
setup(b) {
|
|
32
|
-
const r = B(() => import("./McToast.vue.js")), s = b, f = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopLeft).reverse()), C = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopCenter).reverse()), h = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.TopRight).reverse()), k = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomLeft)), y = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomCenter)), g = c(() => s.reactiveProps.toasts.filter((o) => o.position === p.BottomRight)), l = (o) => {
|
|
33
|
-
o.close();
|
|
34
|
-
};
|
|
35
|
-
return (o, A) => (t(), n("div", T, [
|
|
36
|
-
f.value.length ? (t(), n("div", $, [
|
|
37
|
-
(t(!0), n(i, null, a(f.value, (e) => (t(), u(_(r), d({
|
|
38
|
-
key: e.id
|
|
39
|
-
}, { ref_for: !0 }, e, {
|
|
40
|
-
toast: e,
|
|
41
|
-
onClosed: (v) => l(e)
|
|
42
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
43
|
-
])) : m("", !0),
|
|
44
|
-
C.value.length ? (t(), n("div", L, [
|
|
45
|
-
(t(!0), n(i, null, a(C.value, (e) => (t(), u(_(r), d({
|
|
46
|
-
key: e.id
|
|
47
|
-
}, { ref_for: !0 }, e, {
|
|
48
|
-
toast: e,
|
|
49
|
-
onClosed: (v) => l(e)
|
|
50
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
51
|
-
])) : m("", !0),
|
|
52
|
-
h.value.length ? (t(), n("div", R, [
|
|
53
|
-
(t(!0), n(i, null, a(h.value, (e) => (t(), u(_(r), d({
|
|
54
|
-
key: e.id
|
|
55
|
-
}, { ref_for: !0 }, e, {
|
|
56
|
-
toast: e,
|
|
57
|
-
onClosed: (v) => l(e)
|
|
58
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
59
|
-
])) : m("", !0),
|
|
60
|
-
k.value.length ? (t(), n("div", x, [
|
|
61
|
-
(t(!0), n(i, null, a(k.value, (e) => (t(), u(_(r), d({
|
|
62
|
-
key: e.id
|
|
63
|
-
}, { ref_for: !0 }, e, {
|
|
64
|
-
toast: e,
|
|
65
|
-
onClosed: (v) => l(e)
|
|
66
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
67
|
-
])) : m("", !0),
|
|
68
|
-
y.value.length ? (t(), n("div", M, [
|
|
69
|
-
(t(!0), n(i, null, a(y.value, (e) => (t(), u(_(r), d({
|
|
70
|
-
key: e.id
|
|
71
|
-
}, { ref_for: !0 }, e, {
|
|
72
|
-
toast: e,
|
|
73
|
-
onClosed: (v) => l(e)
|
|
74
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
75
|
-
])) : m("", !0),
|
|
76
|
-
g.value.length ? (t(), n("div", j, [
|
|
77
|
-
(t(!0), n(i, null, a(g.value, (e) => (t(), u(_(r), d({
|
|
78
|
-
key: e.id
|
|
79
|
-
}, { ref_for: !0 }, e, {
|
|
80
|
-
toast: e,
|
|
81
|
-
onClosed: (v) => l(e)
|
|
82
|
-
}), null, 16, ["toast", "onClosed"]))), 128))
|
|
83
|
-
])) : m("", !0)
|
|
84
|
-
]));
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
export {
|
|
88
|
-
N as default
|
|
89
|
-
};
|