mediacube-ui-v2 0.0.266 → 0.0.268
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/assets/components/templates/McDrawer/index.css +1 -0
- package/dist/components/templates/McDrawer/McDrawer.vue.js +2 -2
- package/dist/components/templates/McDrawer/McDrawerContainer/McDrawerContainer.vue.js +5 -0
- package/dist/components/templates/McDrawer/McDrawerContainer/McDrawerContainer.vue2.js +93 -0
- package/dist/components/templates/McDrawer/McDrawerContainer/index.js +6 -0
- package/dist/components/templates/McDrawer/index.js +3 -4
- package/dist/components/templates/McModal/McModal.vue.js +1 -1
- package/dist/components/templates/McModal/McModalContainer/McModalContainer.vue.js +5 -0
- package/dist/components/templates/McModal/McModalContainer/McModalContainer.vue2.js +72 -0
- package/dist/components/templates/McModal/McModalContainer/index.js +6 -0
- package/dist/components/templates/McModal/index.js +2 -3
- package/dist/composables/useDrawer.js +1 -1
- package/dist/composables/useModal.js +20 -22
- package/dist/types/components/templates/McDrawer/{McDrawerContainer.vue.d.ts → McDrawerContainer/McDrawerContainer.vue.d.ts} +1 -1
- package/dist/types/components/templates/McDrawer/McDrawerContainer/index.d.ts +48 -0
- package/dist/types/components/templates/McDrawer/index.d.ts +0 -47
- package/dist/types/components/templates/McModal/{McModalContainer.vue.d.ts → McModalContainer/McModalContainer.vue.d.ts} +7 -3
- package/dist/types/components/templates/McModal/McModalContainer/index.d.ts +34 -0
- package/dist/types/components/templates/McModal/index.d.ts +1 -30
- package/package.json +1 -1
- package/dist/assets/components/templates/McDrawer/McDrawer.css +0 -1
- package/dist/components/templates/McDrawer/McDrawerContainer.vue.js +0 -5
- package/dist/components/templates/McDrawer/McDrawerContainer.vue2.js +0 -93
- package/dist/components/templates/McModal/McModalContainer.vue.js +0 -5
- package/dist/components/templates/McModal/McModalContainer.vue2.js +0 -73
- /package/dist/assets/components/templates/McDrawer/{McDrawerContainer.css → McDrawerContainer/index.css} +0 -0
- /package/dist/assets/components/templates/McModal/{McModalContainer.css → McModalContainer/index.css} +0 -0
- /package/dist/assets/components/templates/McModal/{McModal.css → index.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.mc-drawer[data-v-57618f5c]{position:absolute;top:0;bottom:0;background:#fff;height:100%;box-shadow:0 4px 12px #00000029;display:flex;flex-direction:column;overflow:hidden;z-index:2;pointer-events:all}.mc-drawer__overlay[data-v-57618f5c]{position:absolute;inset:0;background:#00000026;display:flex;justify-content:flex-start;pointer-events:all}.mc-drawer__overlay--hidden[data-v-57618f5c]{background:transparent;pointer-events:none}.mc-drawer__wrapper[data-v-57618f5c]{position:absolute;inset:0;z-index:1;overflow:hidden}.mc-drawer__wrapper--hidden[data-v-57618f5c]{background:transparent;pointer-events:none}.mc-drawer__btn-close[data-v-57618f5c]{z-index:1;padding:.5rem!important}.mc-drawer__btn-close[data-v-57618f5c]{color:#8f99a3}.mc-drawer__btn-close[data-v-57618f5c]:hover,.mc-drawer__btn-close[data-v-57618f5c]:focus{color:#202427}.mc-drawer__btn-close[data-v-57618f5c]:active{color:#32393d}.mc-drawer__btn-close[data-v-57618f5c]{position:absolute;top:.5rem;inset-inline-end:.5rem}.mc-drawer__btn-close[data-v-57618f5c]{box-sizing:border-box;display:block;margin:0;padding:0;white-space:nowrap;vertical-align:middle;user-select:none;text-align:center;text-decoration:none;text-transform:none;border-radius:0;border:none;background-color:transparent;background-image:none;cursor:pointer;outline:0;font-size:0;line-height:0;font-family:inherit;-webkit-appearance:none;-webkit-text-fill-color:currentColor}.mc-drawer__btn-close[data-v-57618f5c]:focus{outline:0}.mc-drawer__icon-close[data-v-57618f5c]{height:1.5rem;width:1.5rem}.mc-drawer__icon-close--small[data-v-57618f5c]{display:none}@media (max-width: 767px){.mc-drawer .mc-drawer__icon-close[data-v-57618f5c]{display:none}.mc-drawer .mc-drawer__icon-close--small[data-v-57618f5c]{display:block}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./McDrawer.vue2.js";
|
|
2
|
-
import '../../../assets/components/templates/McDrawer/
|
|
2
|
+
import '../../../assets/components/templates/McDrawer/index.css';/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-57618f5c"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -0,0 +1,93 @@
|
|
|
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({
|
|
4
|
+
__name: "McDrawerContainer",
|
|
5
|
+
props: {
|
|
6
|
+
drawerServiceState: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
},
|
|
10
|
+
drawersCascadeIndent: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 50
|
|
13
|
+
},
|
|
14
|
+
drawersMaxInCascade: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 7
|
|
17
|
+
},
|
|
18
|
+
reactiveProps: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => ({})
|
|
21
|
+
}
|
|
22
|
+
},
|
|
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(
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
28
|
+
(v) => !v?.drawerProps.hasOwnProperty("showOverlay") || v.drawerProps?.showOverlay
|
|
29
|
+
);
|
|
30
|
+
return {
|
|
31
|
+
...r,
|
|
32
|
+
indent_coefficient: e,
|
|
33
|
+
real_coefficient: s,
|
|
34
|
+
indent: s * l.drawersCascadeIndent,
|
|
35
|
+
can_show_overlay: t === d
|
|
36
|
+
};
|
|
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) {
|
|
46
|
+
const t = n.value[n.value.length - 1];
|
|
47
|
+
if (t.drawerProps?.disableBgClick) return;
|
|
48
|
+
t.close();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return g(() => {
|
|
52
|
+
document.addEventListener("keyup", p);
|
|
53
|
+
}), S(() => {
|
|
54
|
+
document.removeEventListener("keyup", p);
|
|
55
|
+
}), (r, t) => (a(), f("div", {
|
|
56
|
+
class: "mc-drawer-container",
|
|
57
|
+
style: x(h.value)
|
|
58
|
+
}, [
|
|
59
|
+
(a(!0), f(V, null, b(n.value, (e, s) => (a(), i(k(w), _({
|
|
60
|
+
key: e.id,
|
|
61
|
+
modelValue: e.modelValue,
|
|
62
|
+
"onUpdate:modelValue": (d) => e.modelValue = d
|
|
63
|
+
}, { ref_for: !0 }, e.drawerProps, {
|
|
64
|
+
"show-overlay": e.can_show_overlay,
|
|
65
|
+
onClose: () => c(e),
|
|
66
|
+
class: ["mc-drawer-container__item", { "mc-drawer-container__item--multiple": n.value.length - 1 !== s }],
|
|
67
|
+
style: e.indent ? { transform: `translateX(-${e.indent}px)` } : {}
|
|
68
|
+
}), {
|
|
69
|
+
default: m(() => [
|
|
70
|
+
(a(), i(D, null, {
|
|
71
|
+
default: m(() => [
|
|
72
|
+
E(M, {
|
|
73
|
+
onErrorCaptured: () => c(e)
|
|
74
|
+
}, {
|
|
75
|
+
default: m(() => [
|
|
76
|
+
(a(), i(I(e.component), _({ ref_for: !0 }, e.componentProps, {
|
|
77
|
+
onCloseDrawer: () => c(e)
|
|
78
|
+
}), null, 16, ["onCloseDrawer"]))
|
|
79
|
+
]),
|
|
80
|
+
_: 2
|
|
81
|
+
}, 1032, ["onErrorCaptured"])
|
|
82
|
+
]),
|
|
83
|
+
_: 2
|
|
84
|
+
}, 1024))
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "show-overlay", "onClose", "class", "style"]))), 128))
|
|
88
|
+
], 4));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
export {
|
|
92
|
+
O as default
|
|
93
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineAsyncComponent as o } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const r = o(() => import("./McDrawer.vue.js"));
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t as default
|
|
4
|
+
r as McDrawer,
|
|
5
|
+
r as default
|
|
7
6
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
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({
|
|
4
|
+
__name: "McModalContainer",
|
|
5
|
+
props: {
|
|
6
|
+
modalServiceState: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
},
|
|
10
|
+
reactiveProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({ modals: [] })
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(p) {
|
|
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();
|
|
22
|
+
}, 300);
|
|
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
|
+
}
|
|
29
|
+
}, v = (t) => {
|
|
30
|
+
typeof window > "u" || (document.body.style.overflow = t ? "hidden" : "");
|
|
31
|
+
};
|
|
32
|
+
return k(() => {
|
|
33
|
+
document.addEventListener("keyup", s), C(
|
|
34
|
+
() => o.value.length,
|
|
35
|
+
(t) => v(!!t),
|
|
36
|
+
{ immediate: !0 }
|
|
37
|
+
);
|
|
38
|
+
}), _(() => {
|
|
39
|
+
document.removeEventListener("keyup", s);
|
|
40
|
+
}), (t, n) => (l(), c("div", {
|
|
41
|
+
class: "mc-modal-container",
|
|
42
|
+
style: h(m.value)
|
|
43
|
+
}, [
|
|
44
|
+
(l(!0), c(S, null, B(o.value, (e) => (l(), c("div", {
|
|
45
|
+
key: e.id,
|
|
46
|
+
onClose: () => r(e)
|
|
47
|
+
}, [
|
|
48
|
+
(l(), u(V, null, {
|
|
49
|
+
default: i(() => [
|
|
50
|
+
g(E, {
|
|
51
|
+
onErrorCaptured: () => r(e)
|
|
52
|
+
}, {
|
|
53
|
+
default: i(() => [
|
|
54
|
+
(l(), u(P(e.component), w({
|
|
55
|
+
modelValue: e.modelValue,
|
|
56
|
+
"onUpdate:modelValue": (f) => e.modelValue = f
|
|
57
|
+
}, { ref_for: !0 }, e.componentProps, {
|
|
58
|
+
onClosed: () => r(e)
|
|
59
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onClosed"]))
|
|
60
|
+
]),
|
|
61
|
+
_: 2
|
|
62
|
+
}, 1032, ["onErrorCaptured"])
|
|
63
|
+
]),
|
|
64
|
+
_: 2
|
|
65
|
+
}, 1024))
|
|
66
|
+
], 40, b))), 128))
|
|
67
|
+
], 4));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
L as default
|
|
72
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineAsyncComponent as o } from "vue";
|
|
2
|
-
const
|
|
2
|
+
const e = o(() => import("./McModal.vue.js"));
|
|
3
3
|
export {
|
|
4
4
|
e as McModal,
|
|
5
|
-
|
|
6
|
-
n as default
|
|
5
|
+
e as default
|
|
7
6
|
};
|
|
@@ -24,7 +24,7 @@ const o = p({
|
|
|
24
24
|
})), s[r];
|
|
25
25
|
}, _ = async () => {
|
|
26
26
|
if (typeof window > "u" || document.getElementById("drawer-container")) return;
|
|
27
|
-
d || (d = (await import("../components/templates/McDrawer/McDrawerContainer.vue.js")).default);
|
|
27
|
+
d || (d = (await import("../components/templates/McDrawer/McDrawerContainer/McDrawerContainer.vue.js")).default);
|
|
28
28
|
const e = document.createElement("div");
|
|
29
29
|
e.id = "drawer-container", document.body.appendChild(e);
|
|
30
30
|
const r = E(d, {
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getStoredAppContext as
|
|
1
|
+
import { defineAsyncComponent as u, reactive as f, shallowRef as v, inject as h, markRaw as S, h as O, render as g } from "vue";
|
|
2
|
+
import { getStoredAppContext as p } from "../storedAppContext.js";
|
|
3
3
|
import { useHelper as y } from "./useHelper2.js";
|
|
4
|
-
|
|
5
|
-
import '../assets/components/templates/McModal/McModalContainer.css';/* empty css */
|
|
6
|
-
const i = y(), d = {}, a = u({
|
|
4
|
+
const E = u(() => import("../components/templates/McModal/McModalContainer/McModalContainer.vue.js")), i = y(), d = {}, a = f({
|
|
7
5
|
isOpen: !1,
|
|
8
6
|
activeModal: null,
|
|
9
7
|
closeServiceState: () => {
|
|
10
8
|
a.isOpen = !1, e.modals = [];
|
|
11
9
|
}
|
|
12
|
-
}),
|
|
10
|
+
}), C = v({}), e = f({ modals: [] }), w = { name: "McModalAsyncError", render: () => null }, A = (o) => {
|
|
13
11
|
if (!o) return o;
|
|
14
12
|
const t = o.toString();
|
|
15
13
|
if (d[t]) return d[t];
|
|
16
14
|
let l = o;
|
|
17
|
-
return typeof o == "function" && (l =
|
|
15
|
+
return typeof o == "function" && (l = u({
|
|
18
16
|
loader: () => {
|
|
19
17
|
const n = o();
|
|
20
18
|
return n != null && typeof n.then == "function" ? n : Promise.resolve(n);
|
|
@@ -34,11 +32,11 @@ const i = y(), d = {}, a = u({
|
|
|
34
32
|
modalServiceState: a,
|
|
35
33
|
reactiveProps: e
|
|
36
34
|
});
|
|
37
|
-
t.appContext =
|
|
35
|
+
t.appContext = p(), g(t, o);
|
|
38
36
|
}, R = () => {
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
const l =
|
|
37
|
+
p() && x();
|
|
38
|
+
}, L = (o, t = {}) => {
|
|
39
|
+
const l = C.value[o];
|
|
42
40
|
if (!l)
|
|
43
41
|
return console.warn(`Modal ${o} not registered`);
|
|
44
42
|
R();
|
|
@@ -47,8 +45,8 @@ const i = y(), d = {}, a = u({
|
|
|
47
45
|
n.modelValue = !0, a.activeModal = n;
|
|
48
46
|
return;
|
|
49
47
|
}
|
|
50
|
-
const
|
|
51
|
-
component:
|
|
48
|
+
const M = S(A(l)), c = o, m = {
|
|
49
|
+
component: M,
|
|
52
50
|
componentName: o,
|
|
53
51
|
componentProps: t,
|
|
54
52
|
modelValue: !0,
|
|
@@ -61,19 +59,19 @@ const i = y(), d = {}, a = u({
|
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
e.modals.push(m), a.isOpen = !0, a.activeModal = m;
|
|
64
|
-
},
|
|
62
|
+
}, V = (o) => {
|
|
65
63
|
(i.findLastSafe(e.modals, (l) => l.componentName === o) || e.modals[e.modals.length - 1])?.close();
|
|
66
|
-
},
|
|
64
|
+
}, P = () => {
|
|
67
65
|
e.modals.forEach((o) => o.close());
|
|
68
66
|
};
|
|
69
|
-
function
|
|
70
|
-
const o =
|
|
71
|
-
return o.modalComponents && (
|
|
72
|
-
showModal:
|
|
73
|
-
closeModal:
|
|
74
|
-
closeAllModals:
|
|
67
|
+
function j() {
|
|
68
|
+
const o = h("dsOptions", {});
|
|
69
|
+
return o.modalComponents && (C.value = o.modalComponents), {
|
|
70
|
+
showModal: L,
|
|
71
|
+
closeModal: V,
|
|
72
|
+
closeAllModals: P
|
|
75
73
|
};
|
|
76
74
|
}
|
|
77
75
|
export {
|
|
78
|
-
|
|
76
|
+
j as useModal
|
|
79
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { IDrawerServiceState, IDrawerState } from '
|
|
2
|
+
import { IDrawerServiceState, IDrawerState } from '../../../../types/IDrawer';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
drawerServiceState: {
|
|
5
5
|
type: PropType<IDrawerServiceState>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const McDrawerContainer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
drawerServiceState: {
|
|
3
|
+
type: import('vue').PropType<import('../../../../types/IDrawer').IDrawerServiceState>;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
drawersCascadeIndent: {
|
|
7
|
+
type: import('vue').PropType<number>;
|
|
8
|
+
default: number;
|
|
9
|
+
};
|
|
10
|
+
drawersMaxInCascade: {
|
|
11
|
+
type: import('vue').PropType<number>;
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
reactiveProps: {
|
|
15
|
+
type: () => {
|
|
16
|
+
drawers: import('../../../../types/IDrawer').IDrawerState[];
|
|
17
|
+
};
|
|
18
|
+
default: () => {};
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
21
|
+
drawerServiceState: {
|
|
22
|
+
type: import('vue').PropType<import('../../../../types/IDrawer').IDrawerServiceState>;
|
|
23
|
+
default: () => {};
|
|
24
|
+
};
|
|
25
|
+
drawersCascadeIndent: {
|
|
26
|
+
type: import('vue').PropType<number>;
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
drawersMaxInCascade: {
|
|
30
|
+
type: import('vue').PropType<number>;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
reactiveProps: {
|
|
34
|
+
type: () => {
|
|
35
|
+
drawers: import('../../../../types/IDrawer').IDrawerState[];
|
|
36
|
+
};
|
|
37
|
+
default: () => {};
|
|
38
|
+
};
|
|
39
|
+
}>> & Readonly<{}>, {
|
|
40
|
+
drawerServiceState: import('../../../../types/IDrawer').IDrawerServiceState;
|
|
41
|
+
drawersCascadeIndent: number;
|
|
42
|
+
drawersMaxInCascade: number;
|
|
43
|
+
reactiveProps: {
|
|
44
|
+
drawers: import('../../../../types/IDrawer').IDrawerState[];
|
|
45
|
+
};
|
|
46
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
47
|
+
export { McDrawerContainer };
|
|
48
|
+
export default McDrawerContainer;
|
|
@@ -167,51 +167,4 @@ declare const McDrawer: {
|
|
|
167
167
|
};
|
|
168
168
|
});
|
|
169
169
|
export { McDrawer };
|
|
170
|
-
declare const McDrawerContainer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
171
|
-
drawerServiceState: {
|
|
172
|
-
type: import('vue').PropType<import('../../../types/IDrawer').IDrawerServiceState>;
|
|
173
|
-
default: () => {};
|
|
174
|
-
};
|
|
175
|
-
drawersCascadeIndent: {
|
|
176
|
-
type: import('vue').PropType<number>;
|
|
177
|
-
default: number;
|
|
178
|
-
};
|
|
179
|
-
drawersMaxInCascade: {
|
|
180
|
-
type: import('vue').PropType<number>;
|
|
181
|
-
default: number;
|
|
182
|
-
};
|
|
183
|
-
reactiveProps: {
|
|
184
|
-
type: () => {
|
|
185
|
-
drawers: import('../../../types/IDrawer').IDrawerState[];
|
|
186
|
-
};
|
|
187
|
-
default: () => {};
|
|
188
|
-
};
|
|
189
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
190
|
-
drawerServiceState: {
|
|
191
|
-
type: import('vue').PropType<import('../../../types/IDrawer').IDrawerServiceState>;
|
|
192
|
-
default: () => {};
|
|
193
|
-
};
|
|
194
|
-
drawersCascadeIndent: {
|
|
195
|
-
type: import('vue').PropType<number>;
|
|
196
|
-
default: number;
|
|
197
|
-
};
|
|
198
|
-
drawersMaxInCascade: {
|
|
199
|
-
type: import('vue').PropType<number>;
|
|
200
|
-
default: number;
|
|
201
|
-
};
|
|
202
|
-
reactiveProps: {
|
|
203
|
-
type: () => {
|
|
204
|
-
drawers: import('../../../types/IDrawer').IDrawerState[];
|
|
205
|
-
};
|
|
206
|
-
default: () => {};
|
|
207
|
-
};
|
|
208
|
-
}>> & Readonly<{}>, {
|
|
209
|
-
drawerServiceState: import('../../../types/IDrawer').IDrawerServiceState;
|
|
210
|
-
drawersCascadeIndent: number;
|
|
211
|
-
drawersMaxInCascade: number;
|
|
212
|
-
reactiveProps: {
|
|
213
|
-
drawers: import('../../../types/IDrawer').IDrawerState[];
|
|
214
|
-
};
|
|
215
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
216
|
-
export { McDrawerContainer };
|
|
217
170
|
export default McDrawer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { IModalServiceState, IModalState } from '
|
|
2
|
+
import { IModalServiceState, IModalState } from '../../../../types/IModal';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
modalServiceState: {
|
|
5
5
|
type: PropType<IModalServiceState>;
|
|
@@ -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,34 @@
|
|
|
1
|
+
declare const McModalContainer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
modalServiceState: {
|
|
3
|
+
type: import('vue').PropType<import('../../../../types/IModal').IModalServiceState>;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
reactiveProps: {
|
|
7
|
+
type: () => {
|
|
8
|
+
modals: import('../../../../types/IModal').IModalState[];
|
|
9
|
+
};
|
|
10
|
+
default: () => {
|
|
11
|
+
modals: import('../../../../types/IModal').IModalState[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
15
|
+
modalServiceState: {
|
|
16
|
+
type: import('vue').PropType<import('../../../../types/IModal').IModalServiceState>;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
19
|
+
reactiveProps: {
|
|
20
|
+
type: () => {
|
|
21
|
+
modals: import('../../../../types/IModal').IModalState[];
|
|
22
|
+
};
|
|
23
|
+
default: () => {
|
|
24
|
+
modals: import('../../../../types/IModal').IModalState[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{}>, {
|
|
28
|
+
reactiveProps: {
|
|
29
|
+
modals: import('../../../../types/IModal').IModalState[];
|
|
30
|
+
};
|
|
31
|
+
modalServiceState: import('../../../../types/IModal').IModalServiceState;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
33
|
+
export { McModalContainer };
|
|
34
|
+
export default McModalContainer;
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
declare const McModalContainer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
-
modalServiceState: {
|
|
3
|
-
type: import('vue').PropType<import('../../../types/IModal').IModalServiceState>;
|
|
4
|
-
default: () => {};
|
|
5
|
-
};
|
|
6
|
-
reactiveProps: {
|
|
7
|
-
type: () => {
|
|
8
|
-
modals: import('../../../types/IModal').IModalState[];
|
|
9
|
-
};
|
|
10
|
-
default: () => {};
|
|
11
|
-
};
|
|
12
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
-
modalServiceState: {
|
|
14
|
-
type: import('vue').PropType<import('../../../types/IModal').IModalServiceState>;
|
|
15
|
-
default: () => {};
|
|
16
|
-
};
|
|
17
|
-
reactiveProps: {
|
|
18
|
-
type: () => {
|
|
19
|
-
modals: import('../../../types/IModal').IModalState[];
|
|
20
|
-
};
|
|
21
|
-
default: () => {};
|
|
22
|
-
};
|
|
23
|
-
}>> & Readonly<{}>, {
|
|
24
|
-
reactiveProps: {
|
|
25
|
-
modals: import('../../../types/IModal').IModalState[];
|
|
26
|
-
};
|
|
27
|
-
modalServiceState: import('../../../types/IModal').IModalServiceState;
|
|
28
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
29
|
-
export { McModalContainer };
|
|
30
1
|
declare const McModal: {
|
|
31
2
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
32
3
|
modelValue: {
|
|
@@ -310,4 +281,4 @@ declare const McModal: {
|
|
|
310
281
|
};
|
|
311
282
|
});
|
|
312
283
|
export { McModal };
|
|
313
|
-
export default
|
|
284
|
+
export default McModal;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";.mc-drawer[data-v-ddef1a64]{position:absolute;top:0;bottom:0;background:#fff;height:100%;box-shadow:0 4px 12px #00000029;display:flex;flex-direction:column;overflow:hidden;z-index:2;pointer-events:all}.mc-drawer__overlay[data-v-ddef1a64]{position:absolute;inset:0;background:#00000026;display:flex;justify-content:flex-start;pointer-events:all}.mc-drawer__overlay--hidden[data-v-ddef1a64]{background:transparent;pointer-events:none}.mc-drawer__wrapper[data-v-ddef1a64]{position:absolute;inset:0;z-index:1;overflow:hidden}.mc-drawer__wrapper--hidden[data-v-ddef1a64]{background:transparent;pointer-events:none}.mc-drawer__btn-close[data-v-ddef1a64]{z-index:1;padding:.5rem!important}.mc-drawer__btn-close[data-v-ddef1a64]{color:#8f99a3}.mc-drawer__btn-close[data-v-ddef1a64]:hover,.mc-drawer__btn-close[data-v-ddef1a64]:focus{color:#202427}.mc-drawer__btn-close[data-v-ddef1a64]:active{color:#32393d}.mc-drawer__btn-close[data-v-ddef1a64]{position:absolute;top:.5rem;inset-inline-end:.5rem}.mc-drawer__btn-close[data-v-ddef1a64]{box-sizing:border-box;display:block;margin:0;padding:0;white-space:nowrap;vertical-align:middle;user-select:none;text-align:center;text-decoration:none;text-transform:none;border-radius:0;border:none;background-color:transparent;background-image:none;cursor:pointer;outline:0;font-size:0;line-height:0;font-family:inherit;-webkit-appearance:none;-webkit-text-fill-color:currentColor}.mc-drawer__btn-close[data-v-ddef1a64]:focus{outline:0}.mc-drawer__icon-close[data-v-ddef1a64]{height:1.5rem;width:1.5rem}.mc-drawer__icon-close--small[data-v-ddef1a64]{display:none}@media (max-width: 767px){.mc-drawer .mc-drawer__icon-close[data-v-ddef1a64]{display:none}.mc-drawer .mc-drawer__icon-close--small[data-v-ddef1a64]{display:block}}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { defineComponent as h, defineAsyncComponent as C, computed as m, onMounted as P, onBeforeUnmount as g, openBlock as a, createElementBlock as v, normalizeStyle as S, Fragment as x, renderList as V, createBlock as d, unref as b, mergeProps as f, withCtx as i, Suspense as k, createVNode as D, resolveDynamicComponent as E } from "vue";
|
|
2
|
-
import I from "./McDrawerSafeComponent.vue.js";
|
|
3
|
-
const O = /* @__PURE__ */ h({
|
|
4
|
-
__name: "McDrawerContainer",
|
|
5
|
-
props: {
|
|
6
|
-
drawerServiceState: {
|
|
7
|
-
type: Object,
|
|
8
|
-
default: () => ({})
|
|
9
|
-
},
|
|
10
|
-
drawersCascadeIndent: {
|
|
11
|
-
type: Number,
|
|
12
|
-
default: 50
|
|
13
|
-
},
|
|
14
|
-
drawersMaxInCascade: {
|
|
15
|
-
type: Number,
|
|
16
|
-
default: 7
|
|
17
|
-
},
|
|
18
|
-
reactiveProps: {
|
|
19
|
-
type: Object,
|
|
20
|
-
default: () => ({})
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
setup(_) {
|
|
24
|
-
const y = C(() => import("./McDrawer.vue.js")), r = _, n = m(() => r.reactiveProps.drawers.map((o, t) => {
|
|
25
|
-
const e = r.reactiveProps.drawers.length - 1 - t, s = Math.min(e, r.drawersMaxInCascade - 1), c = r.reactiveProps.drawers.findLastIndex(
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
28
|
-
(p) => !p?.drawerProps.hasOwnProperty("showOverlay") || p.drawerProps?.showOverlay
|
|
29
|
-
);
|
|
30
|
-
return {
|
|
31
|
-
...o,
|
|
32
|
-
indent_coefficient: e,
|
|
33
|
-
real_coefficient: s,
|
|
34
|
-
indent: s * r.drawersCascadeIndent,
|
|
35
|
-
can_show_overlay: t === c
|
|
36
|
-
};
|
|
37
|
-
})), w = m(() => ({
|
|
38
|
-
zIndex: r.reactiveProps.drawers.length ? 10004 : -1,
|
|
39
|
-
visibility: r.reactiveProps.drawers.length ? "visible" : "hidden"
|
|
40
|
-
})), l = (o) => {
|
|
41
|
-
o.close(), setTimeout(() => {
|
|
42
|
-
n.value.every((t) => !t.modelValue) && r.drawerServiceState.closeServiceState();
|
|
43
|
-
}, o?.drawerProps?.duration || 300);
|
|
44
|
-
}, u = (o) => {
|
|
45
|
-
if (o.code === "Escape" && n.value?.length) {
|
|
46
|
-
const t = n.value[n.value.length - 1];
|
|
47
|
-
if (t.drawerProps?.disableBgClick) return;
|
|
48
|
-
t.close();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
return P(() => {
|
|
52
|
-
document.addEventListener("keyup", u);
|
|
53
|
-
}), g(() => {
|
|
54
|
-
document.removeEventListener("keyup", u);
|
|
55
|
-
}), (o, t) => (a(), v("div", {
|
|
56
|
-
class: "mc-drawer-container",
|
|
57
|
-
style: S(w.value)
|
|
58
|
-
}, [
|
|
59
|
-
(a(!0), v(x, null, V(n.value, (e, s) => (a(), d(b(y), f({
|
|
60
|
-
key: e.id,
|
|
61
|
-
modelValue: e.modelValue,
|
|
62
|
-
"onUpdate:modelValue": (c) => e.modelValue = c
|
|
63
|
-
}, { ref_for: !0 }, e.drawerProps, {
|
|
64
|
-
"show-overlay": e.can_show_overlay,
|
|
65
|
-
onClose: () => l(e),
|
|
66
|
-
class: ["mc-drawer-container__item", { "mc-drawer-container__item--multiple": n.value.length - 1 !== s }],
|
|
67
|
-
style: e.indent ? { transform: `translateX(-${e.indent}px)` } : {}
|
|
68
|
-
}), {
|
|
69
|
-
default: i(() => [
|
|
70
|
-
(a(), d(k, null, {
|
|
71
|
-
default: i(() => [
|
|
72
|
-
D(I, {
|
|
73
|
-
onErrorCaptured: () => l(e)
|
|
74
|
-
}, {
|
|
75
|
-
default: i(() => [
|
|
76
|
-
(a(), d(E(e.component), f({ ref_for: !0 }, e.componentProps, {
|
|
77
|
-
onCloseDrawer: () => l(e)
|
|
78
|
-
}), null, 16, ["onCloseDrawer"]))
|
|
79
|
-
]),
|
|
80
|
-
_: 2
|
|
81
|
-
}, 1032, ["onErrorCaptured"])
|
|
82
|
-
]),
|
|
83
|
-
_: 2
|
|
84
|
-
}, 1024))
|
|
85
|
-
]),
|
|
86
|
-
_: 2
|
|
87
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "show-overlay", "onClose", "class", "style"]))), 128))
|
|
88
|
-
], 4));
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
export {
|
|
92
|
-
O as default
|
|
93
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { defineComponent as v, computed as f, onMounted as y, watch as k, onBeforeUnmount as C, openBlock as r, createElementBlock as c, normalizeStyle as _, Fragment as h, renderList as P, createBlock as d, Suspense as S, withCtx as i, createVNode as B, resolveDynamicComponent as V, mergeProps as g } from "vue";
|
|
2
|
-
import w from "./McModalSafeComponent.vue.js";
|
|
3
|
-
const E = ["onClose"], x = /* @__PURE__ */ v({
|
|
4
|
-
__name: "McModalContainer",
|
|
5
|
-
props: {
|
|
6
|
-
modalServiceState: {
|
|
7
|
-
type: Object,
|
|
8
|
-
default: () => ({})
|
|
9
|
-
},
|
|
10
|
-
reactiveProps: {
|
|
11
|
-
type: Object,
|
|
12
|
-
default: () => ({})
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
setup(p) {
|
|
16
|
-
const t = p, m = f(() => ({
|
|
17
|
-
zIndex: t.reactiveProps.modals.length ? 99999 : -1,
|
|
18
|
-
visibility: t.reactiveProps.modals.length ? "visible" : "hidden"
|
|
19
|
-
})), l = (o) => {
|
|
20
|
-
o.close(), setTimeout(() => {
|
|
21
|
-
t.reactiveProps.modals.every((n) => !n.modelValue) && t.modalServiceState.closeServiceState();
|
|
22
|
-
}, 300);
|
|
23
|
-
}, s = (o) => {
|
|
24
|
-
const n = t.reactiveProps?.modals;
|
|
25
|
-
if (o.code === "Escape" && n?.length) {
|
|
26
|
-
const e = n[n.length - 1];
|
|
27
|
-
if (!(!e?.componentProps?.hasOwnProperty("clickBackdropToClose") || e?.componentProps?.clickBackdropToClose)) return;
|
|
28
|
-
e.close();
|
|
29
|
-
}
|
|
30
|
-
}, u = (o) => {
|
|
31
|
-
typeof window > "u" || (document.body.style.overflow = o ? "hidden" : "");
|
|
32
|
-
};
|
|
33
|
-
return y(() => {
|
|
34
|
-
document.addEventListener("keyup", s), k(
|
|
35
|
-
() => t.reactiveProps.modals.length,
|
|
36
|
-
(o) => u(!!o),
|
|
37
|
-
{ immediate: !0 }
|
|
38
|
-
);
|
|
39
|
-
}), C(() => {
|
|
40
|
-
document.removeEventListener("keyup", s);
|
|
41
|
-
}), (o, n) => (r(), c("div", {
|
|
42
|
-
class: "mc-modal-container",
|
|
43
|
-
style: _(m.value)
|
|
44
|
-
}, [
|
|
45
|
-
(r(!0), c(h, null, P(t.reactiveProps.modals, (e) => (r(), c("div", {
|
|
46
|
-
key: e.id,
|
|
47
|
-
onClose: () => l(e)
|
|
48
|
-
}, [
|
|
49
|
-
(r(), d(S, null, {
|
|
50
|
-
default: i(() => [
|
|
51
|
-
B(w, {
|
|
52
|
-
onErrorCaptured: () => l(e)
|
|
53
|
-
}, {
|
|
54
|
-
default: i(() => [
|
|
55
|
-
(r(), d(V(e.component), g({
|
|
56
|
-
modelValue: e.modelValue,
|
|
57
|
-
"onUpdate:modelValue": (a) => e.modelValue = a
|
|
58
|
-
}, { ref_for: !0 }, e.componentProps, {
|
|
59
|
-
onClosed: () => l(e)
|
|
60
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onClosed"]))
|
|
61
|
-
]),
|
|
62
|
-
_: 2
|
|
63
|
-
}, 1032, ["onErrorCaptured"])
|
|
64
|
-
]),
|
|
65
|
-
_: 2
|
|
66
|
-
}, 1024))
|
|
67
|
-
], 40, E))), 128))
|
|
68
|
-
], 4));
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
export {
|
|
72
|
-
x as default
|
|
73
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|