@mobilon-dev/chotto 0.3.70 → 0.3.71
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ContactContextMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-01df48d5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as T, inject as x, useId as N, ref as f, computed as V, onMounted as R, nextTick as _, watch as j, onUnmounted as z, createElementBlock as P, openBlock as h, createElementVNode as C, normalizeClass as M, unref as a, createBlock as b, createVNode as U, Teleport as D, createCommentVNode as F } from "vue";
|
|
2
|
+
import G from "../ContextMenu/ContextMenu.vue.js";
|
|
3
3
|
import "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as H } from "../../../hooks/useTheme.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
9
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
10
10
|
import "../../../functions/parseMarkdown.js";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import J from "../../1_icons/MenuIcon.vue.js";
|
|
12
|
+
const K = { class: "contact-context-menu__wrapper" }, Q = ["id"], ce = /* @__PURE__ */ T({
|
|
13
13
|
__name: "ContactContextMenu",
|
|
14
14
|
props: {
|
|
15
15
|
actions: {
|
|
@@ -33,26 +33,26 @@ const D = { class: "contact-context-menu__wrapper" }, F = ["id"], G = { class: "
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
emits: ["click", "buttonClick", "menuMouseEnter", "menuMouseLeave"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
}, I = () => {
|
|
40
|
-
i.disabled || (i.mode == "click" && !d.value ? r() : i.mode == "click" && d.value && l(), a("buttonClick"));
|
|
36
|
+
setup(v, { expose: w, emit: A }) {
|
|
37
|
+
const B = x("chatAppId"), p = x("extChatAppId", ""), { getTheme: y } = H(B), n = v, m = N(), u = A, l = f(), s = f(), r = f(!1), i = V(() => Array.isArray(n.actions) && n.actions.length > 0), I = (t) => {
|
|
38
|
+
c(), u("click", t);
|
|
41
39
|
}, E = () => {
|
|
42
|
-
|
|
40
|
+
!n.disabled && i.value && (n.mode == "click" && !r.value ? d() : n.mode == "click" && r.value && c(), u("buttonClick"));
|
|
43
41
|
}, S = () => {
|
|
44
|
-
|
|
45
|
-
}, A = () => {
|
|
46
|
-
a("menuMouseEnter"), i.disabled || i.mode == "hover" && r();
|
|
42
|
+
!n.disabled && i.value && n.mode == "hover" && d();
|
|
47
43
|
}, q = () => {
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
!n.disabled && i.value && n.mode == "hover" && c();
|
|
45
|
+
}, L = () => {
|
|
46
|
+
u("menuMouseEnter"), !n.disabled && i.value && n.mode == "hover" && d();
|
|
47
|
+
}, O = () => {
|
|
48
|
+
u("menuMouseLeave"), !n.disabled && i.value && n.mode == "hover" && c();
|
|
49
|
+
}, d = () => {
|
|
50
|
+
if (i.value && s.value && l.value) {
|
|
51
|
+
const t = l.value, e = s.value.getBoundingClientRect();
|
|
52
52
|
t.style.display = "inherit";
|
|
53
|
-
const o =
|
|
54
|
-
t.style.display = "none",
|
|
55
|
-
const
|
|
53
|
+
const o = l.value.getBoundingClientRect();
|
|
54
|
+
t.style.display = "none", _(() => {
|
|
55
|
+
const k = {
|
|
56
56
|
left: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left - o.width - o.left },
|
|
57
57
|
right: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left + e.width - o.left },
|
|
58
58
|
bottom: { top: (e == null ? void 0 : e.bottom) - o.top, left: (e == null ? void 0 : e.left) - (o.width - e.width) / 2 - o.left },
|
|
@@ -60,56 +60,67 @@ const D = { class: "contact-context-menu__wrapper" }, F = ["id"], G = { class: "
|
|
|
60
60
|
"top-right": { top: e.top - o.height, left: e.right - o.width / 2 },
|
|
61
61
|
"bottom-left": { top: (e == null ? void 0 : e.bottom) - o.top + 10, left: e.left - o.width - o.left + 50 }
|
|
62
62
|
};
|
|
63
|
-
t.style.top =
|
|
63
|
+
t.style.top = k[n.menuSide].top + "px", t.style.left = k[n.menuSide].left + "px", t.style.opacity = "1", t.style.visibility = "visible", t.style.display = "inherit", r.value = !0;
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
},
|
|
67
|
-
if (
|
|
68
|
-
const t =
|
|
69
|
-
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.visibility = "hidden", t.style.display = "none",
|
|
66
|
+
}, c = () => {
|
|
67
|
+
if (l.value) {
|
|
68
|
+
const t = l.value;
|
|
69
|
+
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.visibility = "hidden", t.style.display = "none", r.value = !1);
|
|
70
70
|
}
|
|
71
|
-
},
|
|
72
|
-
|
|
71
|
+
}, g = (t) => {
|
|
72
|
+
n.mode == "click" && s.value && !s.value.contains(t.target) && c();
|
|
73
73
|
};
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
const t =
|
|
78
|
-
t.style.display = "none", t.style.visibility = "hidden", t.style.opacity = "0",
|
|
74
|
+
return R(() => {
|
|
75
|
+
_(() => {
|
|
76
|
+
if (l.value = document.getElementById("context-menu-" + m + p), l.value) {
|
|
77
|
+
const t = l.value;
|
|
78
|
+
t.style.display = "none", t.style.visibility = "hidden", t.style.opacity = "0", c(), document.addEventListener("click", g);
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
}), j(i, (t) => {
|
|
82
|
+
t || c();
|
|
83
|
+
}), z(() => {
|
|
84
|
+
document.removeEventListener("click", g), l.value && c();
|
|
85
|
+
}), w({
|
|
86
|
+
updatePosition: d,
|
|
87
|
+
hideMenu: c
|
|
88
|
+
}), (t, e) => (h(), P("div", K, [
|
|
89
|
+
C("button", {
|
|
90
|
+
id: "container-" + a(m) + a(p),
|
|
89
91
|
ref_key: "actionScope",
|
|
90
92
|
ref: s,
|
|
91
|
-
class:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
onClick: I
|
|
95
|
-
}, [
|
|
96
|
-
M("span", G, [
|
|
97
|
-
_(z)
|
|
93
|
+
class: M([
|
|
94
|
+
"contact-context-menu__button",
|
|
95
|
+
{ "contact-context-menu__button--no-actions": !i.value }
|
|
98
96
|
]),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
onMouseenter: S,
|
|
98
|
+
onMouseleave: q,
|
|
99
|
+
onClick: E
|
|
100
|
+
}, [
|
|
101
|
+
C("span", {
|
|
102
|
+
class: M([
|
|
103
|
+
"contact-context-menu__icon",
|
|
104
|
+
{ "contact-context-menu__icon--no-actions": !i.value }
|
|
105
|
+
])
|
|
106
|
+
}, [
|
|
107
|
+
U(J)
|
|
108
|
+
], 2),
|
|
109
|
+
(h(), b(D, { to: "body" }, [
|
|
110
|
+
i.value ? (h(), b(G, {
|
|
111
|
+
key: 0,
|
|
112
|
+
id: "context-menu-" + a(m) + a(p),
|
|
113
|
+
actions: v.actions,
|
|
114
|
+
"data-theme": a(y)().theme ? a(y)().theme : "light",
|
|
115
|
+
onMouseenter: L,
|
|
116
|
+
onMouseleave: O,
|
|
117
|
+
onClick: I
|
|
118
|
+
}, null, 8, ["id", "actions", "data-theme"])) : F("", !0)
|
|
108
119
|
]))
|
|
109
|
-
],
|
|
120
|
+
], 42, Q)
|
|
110
121
|
]));
|
|
111
122
|
}
|
|
112
123
|
});
|
|
113
124
|
export {
|
|
114
|
-
|
|
125
|
+
ce as default
|
|
115
126
|
};
|