@mobilon-dev/chotto 0.3.116 → 0.3.118
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/chotto.css +1 -1
- package/dist/components/1_icons/VerifiedBadge.vue.js +31 -0
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +12 -15
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +197 -187
- package/dist/components/2_elements/ChatInfo/ChatInfo.vue.js +43 -40
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +243 -232
- package/dist/index.js +325 -323
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/src/components/1_icons/VerifiedBadge.vue.d.ts +2 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/ChatItem.vue.d.ts +11 -1
- package/dist/types/src/components/2_chatlist_elements/ChatItem/stories/ChatItem.stories.d.ts +1 -0
- package/dist/types/src/components/2_chatlist_elements/ChatItem/styles/types.d.ts +35 -3
- package/dist/types/src/components/2_chatlist_elements/ChatItem/types.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/ChatInfo.vue.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/stories/ChatInfo.stories.d.ts +2 -0
- package/dist/types/src/components/2_elements/ChatInfo/styles/types.d.ts +20 -0
- package/dist/types/src/components/3_compounds/ChatInput/styles/types.d.ts +32 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/test-utils/withSetup.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getStatus as
|
|
1
|
+
import { defineComponent as Ht, inject as Nt, useId as Ut, ref as E, computed as l, watch as Ft, onMounted as Pt, nextTick as F, onUnmounted as Rt, createElementBlock as a, openBlock as o, createElementVNode as m, createCommentVNode as c, withModifiers as Wt, normalizeClass as P, normalizeStyle as nt, createVNode as R, createBlock as d, renderSlot as $t, withCtx as W, toDisplayString as f, resolveDynamicComponent as it, unref as h, Teleport as jt, Fragment as Xt, renderList as Yt } from "vue";
|
|
2
|
+
import { getStatus as zt, statuses as Ot } from "../../../functions/getStatusMessage.js";
|
|
3
3
|
import "../../../functions/parseMarkdown.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import { resolveMessageDraftStore as
|
|
6
|
-
import { useTheme as
|
|
7
|
-
import { useEmojiNative as
|
|
4
|
+
import { t as A } from "../../../locale/useLocale.js";
|
|
5
|
+
import { resolveMessageDraftStore as qt } from "../../../hooks/useMessageDraft.js";
|
|
6
|
+
import { useTheme as Gt } from "../../../hooks/useTheme.js";
|
|
7
|
+
import { useEmojiNative as Jt } from "../../../hooks/useEmojiNative.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
12
12
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
13
|
-
import { textToAppleEmojiHtml as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
13
|
+
import { textToAppleEmojiHtml as $, textContainsEmoji as ot } from "../../../functions/renderAppleEmojis.js";
|
|
14
|
+
import at from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
15
|
+
import Kt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
|
|
16
|
+
import Qt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
17
|
+
import Zt from "../../1_icons/AvatarIcon.vue.js";
|
|
18
|
+
import te from "../../1_icons/VerifiedBadge.vue.js";
|
|
19
|
+
import ee from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
|
|
20
|
+
import ne from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
|
|
21
|
+
import ie from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
|
|
22
|
+
import oe from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
|
|
23
|
+
import ae from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
|
|
24
|
+
import st from "./icons/AudioIcon.vue.js";
|
|
24
25
|
import j from "./icons/FileIcon.vue.js";
|
|
25
26
|
import ct from "./icons/ImageIcon.vue.js";
|
|
26
|
-
import
|
|
27
|
+
import se from "./icons/MissedCallIcon.vue.js";
|
|
27
28
|
import X from "./icons/StickerIcon.vue.js";
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
const
|
|
29
|
+
import rt from "./icons/VideoIcon.vue.js";
|
|
30
|
+
import lt from "./icons/VoiceIcon.vue.js";
|
|
31
|
+
const ce = ["data-chat-id"], re = { class: "chat-item__avatar-container" }, le = ["src"], ue = {
|
|
31
32
|
key: 1,
|
|
32
33
|
class: "chat-item__avatar-placeholder"
|
|
33
|
-
},
|
|
34
|
+
}, me = { class: "chat-item__info-container" }, de = { class: "chat-item__title-row" }, he = ["innerHTML"], fe = {
|
|
34
35
|
key: 1,
|
|
35
36
|
class: "chat-item__name"
|
|
36
|
-
},
|
|
37
|
+
}, ve = {
|
|
37
38
|
key: 0,
|
|
38
39
|
class: "chat-item__last-message"
|
|
39
|
-
},
|
|
40
|
+
}, ge = {
|
|
40
41
|
key: 1,
|
|
41
42
|
class: "chat-item__last-message-text chat-item__last-message-text--draft"
|
|
42
|
-
},
|
|
43
|
+
}, ye = { class: "chat-item__draft-label" }, pe = ["innerHTML"], _e = {
|
|
43
44
|
key: 2,
|
|
44
45
|
class: "chat-item__draft-text"
|
|
45
|
-
},
|
|
46
|
+
}, ke = ["innerHTML"], xe = {
|
|
46
47
|
key: 3,
|
|
47
48
|
class: "chat-item__last-message-text"
|
|
48
|
-
},
|
|
49
|
+
}, we = { class: "chat-item__details-container" }, Ce = {
|
|
49
50
|
key: 0,
|
|
50
51
|
class: "chat-item__time"
|
|
51
|
-
},
|
|
52
|
+
}, Ie = { class: "chat-item__status-unread-container" }, Te = {
|
|
52
53
|
key: 1,
|
|
53
54
|
class: "chat-item__unread"
|
|
54
|
-
},
|
|
55
|
+
}, Me = {
|
|
55
56
|
key: 2,
|
|
56
57
|
class: "chat-item__status-chat-container"
|
|
57
|
-
},
|
|
58
|
+
}, Ee = {
|
|
58
59
|
key: 0,
|
|
59
60
|
class: "chat-item__fixed pi pi-thumbtack"
|
|
60
|
-
},
|
|
61
|
+
}, Se = {
|
|
61
62
|
key: 0,
|
|
62
63
|
id: "noSelectButton",
|
|
63
64
|
class: "chat-item__menu-button"
|
|
64
|
-
},
|
|
65
|
+
}, Le = {
|
|
65
66
|
key: 1,
|
|
66
67
|
id: "noSelectButton",
|
|
67
68
|
class: "chat-item__menu-button"
|
|
68
|
-
},
|
|
69
|
+
}, be = {
|
|
69
70
|
key: 0,
|
|
70
71
|
class: "dialog__container"
|
|
71
|
-
},
|
|
72
|
+
}, Ae = ["onClick"], Be = ["src"], Ve = {
|
|
72
73
|
key: 1,
|
|
73
74
|
class: "dialog__icon pi pi-user"
|
|
74
|
-
},
|
|
75
|
+
}, De = { class: "dialog__text-container" }, He = { class: "dialog__name" }, Ne = { class: "dialog__time" }, fn = /* @__PURE__ */ Ht({
|
|
75
76
|
__name: "ChatItem",
|
|
76
77
|
props: {
|
|
77
78
|
chat: {},
|
|
@@ -79,59 +80,64 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
|
|
|
79
80
|
contextMenuTrigger: { default: "hover" }
|
|
80
81
|
},
|
|
81
82
|
emits: ["select", "action", "expand"],
|
|
82
|
-
setup(
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
setup(s, { emit: ut }) {
|
|
84
|
+
const S = Nt("chatAppId"), { getTheme: Y } = Gt(S), { isNative: z, emojiSrc: B } = Jt(S), mt = qt(String(S ?? "")), n = s, L = ut, y = Ut(), p = E(!1), k = E(!1), V = E(!1), dt = E(null), x = l(
|
|
85
|
+
() => {
|
|
86
|
+
var t;
|
|
87
|
+
return (((t = n.chat.actions) == null ? void 0 : t.length) ?? 0) > 0;
|
|
88
|
+
}
|
|
89
|
+
), ht = () => {
|
|
90
|
+
V.value = !0;
|
|
87
91
|
}, ft = (t) => {
|
|
88
|
-
|
|
89
|
-
}, vt = (
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
+
V.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && L("select", { chat: n.chat, dialog: null }), V.value = !1;
|
|
93
|
+
}, vt = (t) => {
|
|
94
|
+
L("select", { chat: n.chat, dialog: t });
|
|
95
|
+
}, gt = () => n.chat.isSelected ? "chat-item__selected" : "", yt = (t) => t.isSelected ? "dialog__selected" : "", O = (t) => {
|
|
96
|
+
n.contextMenuTrigger === "rightClick" && D(), L("action", { chat: n.chat, ...t });
|
|
97
|
+
}, D = () => {
|
|
92
98
|
const t = document.getElementById("context-menu-rightclick-" + y);
|
|
93
99
|
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.display = "none"), k.value = !1;
|
|
94
|
-
},
|
|
100
|
+
}, pt = () => {
|
|
95
101
|
document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((e) => {
|
|
96
102
|
const i = e;
|
|
97
103
|
i.id !== "context-menu-rightclick-" + y && (i.style.top = "0", i.style.left = "0", i.style.opacity = "0", i.style.display = "none");
|
|
98
104
|
});
|
|
99
|
-
},
|
|
100
|
-
let
|
|
101
|
-
const _ =
|
|
102
|
-
var
|
|
105
|
+
}, _t = () => n.chat.dialogs ? [...n.chat.dialogs].sort((t, e) => Number(t["lastActivity.timestamp"]) > Number(e["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(e["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(e["lastActivity.timestamp"]), 0)) : [], kt = l(() => zt(n.chat["lastMessage.status"])), xt = l(() => n.chat.showEmptyIndicator || n.chat.countUnread > 0), wt = l(() => n.chat.countUnread > 0 ? n.chat.countUnread > 99 ? "99+" : n.chat.countUnread : n.chat.showEmptyIndicator ? "" : void 0);
|
|
106
|
+
let b;
|
|
107
|
+
const _ = E(0), q = [A("component.ChatItem.typing") + ".", A("component.ChatItem.typing") + "..", A("component.ChatItem.typing") + "..."], G = (t) => {
|
|
108
|
+
var u, r, v;
|
|
103
109
|
if (typeof t == "string")
|
|
104
110
|
return t;
|
|
105
111
|
if ((t == null ? void 0 : t.type) === "message.sticker")
|
|
106
112
|
return "Стикер";
|
|
107
113
|
if ((t == null ? void 0 : t.type) === "message.audio")
|
|
108
|
-
return (t.isVoiceMessage || ((
|
|
114
|
+
return (t.isVoiceMessage || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
|
|
109
115
|
if ((t == null ? void 0 : t.type) === "message.missedCall")
|
|
110
116
|
return "Пропущенный звонок";
|
|
111
|
-
const e = (
|
|
117
|
+
const e = (r = t == null ? void 0 : t.data) == null ? void 0 : r.text;
|
|
112
118
|
if (e)
|
|
113
119
|
return e;
|
|
114
120
|
const i = (v = t == null ? void 0 : t.data) == null ? void 0 : v.filename;
|
|
115
121
|
return i || "";
|
|
116
|
-
},
|
|
122
|
+
}, Ct = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, H = A("component.ChatItem.draft"), N = l(() => {
|
|
117
123
|
var e;
|
|
118
|
-
const t =
|
|
124
|
+
const t = mt.getChatDraft(String(S ?? ""), n.chat.chatId);
|
|
119
125
|
if (!(!t || t.edit) && !(!t.listPreviewText && !t.listPreviewFile) && !(!(t.text || "").trim() && !t.file && !((e = t.files) != null && e.length)))
|
|
120
126
|
return t;
|
|
121
|
-
}),
|
|
127
|
+
}), w = l(() => !!N.value), g = l(() => {
|
|
122
128
|
var e;
|
|
123
|
-
const t =
|
|
129
|
+
const t = N.value;
|
|
124
130
|
return t ? t.file ? (((e = t.listPreviewFile) == null ? void 0 : e.name) || t.file.name || "").trim() : (t.listPreviewText || "").trim() : "";
|
|
125
|
-
}),
|
|
126
|
-
const t =
|
|
131
|
+
}), J = l(() => {
|
|
132
|
+
const t = N.value;
|
|
127
133
|
if (!(t != null && t.file)) return null;
|
|
128
|
-
const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(),
|
|
129
|
-
return i === "sticker" ||
|
|
130
|
-
}),
|
|
131
|
-
var e, i,
|
|
132
|
-
if (n.chat.typing ||
|
|
134
|
+
const e = t.listPreviewFile, i = ((e == null ? void 0 : e.type) || t.file.type || "").toLowerCase(), u = ((e == null ? void 0 : e.name) || t.file.name || "").toLowerCase();
|
|
135
|
+
return i === "sticker" || u.endsWith(".tgs") || u.endsWith(".webp") ? X : i === "image" || i.includes("image") ? ct : i === "video" || i.includes("video") ? rt : i === "audio" || i.includes("audio") ? u.includes("voice") || u.includes("голос") ? lt : st : i === "file" || u ? j : j;
|
|
136
|
+
}), It = l(() => $(g.value || "", null, B.value)), K = l(() => {
|
|
137
|
+
var e, i, u;
|
|
138
|
+
if (n.chat.typing || w.value)
|
|
133
139
|
return null;
|
|
134
|
-
const t =
|
|
140
|
+
const t = Ct(n.chat.lastMessage);
|
|
135
141
|
if (!t)
|
|
136
142
|
return null;
|
|
137
143
|
if (t === "message.sticker")
|
|
@@ -139,226 +145,230 @@ const oe = ["data-chat-id"], ae = { class: "chat-item__avatar-container" }, ce =
|
|
|
139
145
|
if (t === "message.image")
|
|
140
146
|
return ct;
|
|
141
147
|
if (t === "message.video")
|
|
142
|
-
return
|
|
148
|
+
return rt;
|
|
143
149
|
if (t === "message.audio") {
|
|
144
|
-
const
|
|
145
|
-
return (
|
|
150
|
+
const r = n.chat.lastMessage;
|
|
151
|
+
return (r.isVoiceMessage || ((e = r == null ? void 0 : r.data) == null ? void 0 : e.isVoiceMessage)) === !0 ? lt : st;
|
|
146
152
|
}
|
|
147
153
|
if (t === "message.missedCall")
|
|
148
|
-
return
|
|
154
|
+
return se;
|
|
149
155
|
if (t === "message.file") {
|
|
150
|
-
const
|
|
156
|
+
const r = n.chat.lastMessage, v = ((u = (i = r == null ? void 0 : r.data) == null ? void 0 : i.filename) == null ? void 0 : u.toLowerCase()) || "";
|
|
151
157
|
return v.endsWith(".tgs") || v.endsWith(".webp") ? X : j;
|
|
152
158
|
}
|
|
153
159
|
return null;
|
|
154
|
-
}),
|
|
155
|
-
() =>
|
|
156
|
-
),
|
|
157
|
-
() =>
|
|
158
|
-
),
|
|
159
|
-
|
|
160
|
+
}), Tt = l(() => n.chat.typing ? q[_.value] : w.value ? g.value ? `${H} ${g.value}` : H : G(n.chat.lastMessage)), U = l(() => n.chat.typing ? q[_.value] : G(n.chat.lastMessage)), Q = l(
|
|
161
|
+
() => !z.value && ot(g.value || U.value || "")
|
|
162
|
+
), Mt = l(
|
|
163
|
+
() => !z.value && ot(n.chat.name || "")
|
|
164
|
+
), Et = l(() => $(U.value || "", null, B.value)), St = l(() => $(n.chat.name || "", null, B.value));
|
|
165
|
+
Ft(
|
|
160
166
|
() => n.chat.typing,
|
|
161
167
|
() => {
|
|
162
|
-
n.chat.typing ?
|
|
168
|
+
n.chat.typing ? b = setInterval(() => {
|
|
163
169
|
_.value < 2 ? _.value += 1 : _.value = 0;
|
|
164
|
-
}, 1e3) : (_.value = 0,
|
|
170
|
+
}, 1e3) : (_.value = 0, b && (clearInterval(b), b = void 0));
|
|
165
171
|
},
|
|
166
172
|
{ immediate: !0 }
|
|
167
173
|
);
|
|
168
|
-
const
|
|
169
|
-
n.contextMenuTrigger === "hover" && (p.value = !0);
|
|
170
|
-
}, Lt = (t) => {
|
|
171
|
-
n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
|
|
174
|
+
const Lt = () => {
|
|
175
|
+
n.contextMenuTrigger === "hover" && x.value && (p.value = !0);
|
|
172
176
|
}, bt = (t) => {
|
|
173
|
-
n.contextMenuTrigger === "
|
|
177
|
+
n.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
|
|
174
178
|
}, At = (t) => {
|
|
175
|
-
|
|
179
|
+
n.contextMenuTrigger === "rightClick" && x.value && Bt(t);
|
|
180
|
+
}, Bt = (t) => {
|
|
181
|
+
pt(), k.value = !0, F(() => {
|
|
176
182
|
const e = document.getElementById("context-menu-rightclick-" + y);
|
|
177
183
|
if (e) {
|
|
178
|
-
const i = t.clientX,
|
|
184
|
+
const i = t.clientX, u = t.clientY;
|
|
179
185
|
e.style.display = "inherit";
|
|
180
|
-
const
|
|
181
|
-
e.style.display = "none",
|
|
182
|
-
const v = window.innerWidth,
|
|
183
|
-
let
|
|
184
|
-
|
|
186
|
+
const r = e.getBoundingClientRect();
|
|
187
|
+
e.style.display = "none", F(() => {
|
|
188
|
+
const v = window.innerWidth, et = window.innerHeight, C = window.scrollX || window.pageXOffset, I = window.scrollY || window.pageYOffset;
|
|
189
|
+
let T = i + C, M = u + I;
|
|
190
|
+
T + r.width > v + C && (T = i + C - r.width), M + r.height > et + I && (M = u + I - r.height), T < C && (T = C), M < I && (M = I), e.style.top = M + "px", e.style.left = T + "px", e.style.opacity = "1", e.style.display = "inherit";
|
|
185
191
|
});
|
|
186
192
|
}
|
|
187
193
|
});
|
|
188
|
-
}, Bt = () => {
|
|
189
194
|
}, Vt = () => {
|
|
190
|
-
},
|
|
195
|
+
}, Dt = () => {
|
|
196
|
+
}, Z = (t) => {
|
|
191
197
|
if (n.contextMenuTrigger === "rightClick" && k.value) {
|
|
192
198
|
const e = t.target, i = document.getElementById("context-menu-rightclick-" + y);
|
|
193
|
-
(!i || !i.contains(e)) &&
|
|
199
|
+
(!i || !i.contains(e)) && D();
|
|
194
200
|
}
|
|
195
|
-
},
|
|
196
|
-
n.contextMenuTrigger === "rightClick" && k.value &&
|
|
201
|
+
}, tt = () => {
|
|
202
|
+
n.contextMenuTrigger === "rightClick" && k.value && D();
|
|
197
203
|
};
|
|
198
|
-
return
|
|
199
|
-
n.contextMenuTrigger === "rightClick" && (document.addEventListener("click",
|
|
204
|
+
return Pt(() => {
|
|
205
|
+
n.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Z), window.addEventListener("scroll", tt, !0), F(() => {
|
|
200
206
|
const t = document.getElementById("context-menu-rightclick-" + y);
|
|
201
207
|
t && (t.style.display = "none", t.style.opacity = "0");
|
|
202
208
|
}));
|
|
203
|
-
}),
|
|
204
|
-
document.removeEventListener("click",
|
|
205
|
-
}), (t, e) => (o(),
|
|
209
|
+
}), Rt(() => {
|
|
210
|
+
document.removeEventListener("click", Z), window.removeEventListener("scroll", tt, !0);
|
|
211
|
+
}), (t, e) => (o(), a("div", null, [
|
|
206
212
|
m("div", {
|
|
207
213
|
ref_key: "containerRef",
|
|
208
|
-
ref:
|
|
209
|
-
class:
|
|
214
|
+
ref: dt,
|
|
215
|
+
class: P(["chat-item__container", gt()]),
|
|
210
216
|
"data-testid": "chat-item",
|
|
211
217
|
"data-chat-id": n.chat.chatId,
|
|
212
|
-
onMouseenter:
|
|
213
|
-
onMouseleave:
|
|
214
|
-
onClick:
|
|
215
|
-
onContextmenu:
|
|
218
|
+
onMouseenter: Lt,
|
|
219
|
+
onMouseleave: bt,
|
|
220
|
+
onClick: ft,
|
|
221
|
+
onContextmenu: Wt(At, ["prevent"])
|
|
216
222
|
}, [
|
|
217
|
-
m("div",
|
|
223
|
+
m("div", re, [
|
|
218
224
|
m("span", {
|
|
219
225
|
class: "chat-item__status-user",
|
|
220
|
-
style:
|
|
226
|
+
style: nt({ backgroundColor: n.chat.status })
|
|
221
227
|
}, null, 4),
|
|
222
|
-
n.chat.avatar ? (o(),
|
|
228
|
+
n.chat.avatar ? (o(), a("img", {
|
|
223
229
|
key: 0,
|
|
224
230
|
src: n.chat.avatar,
|
|
225
231
|
height: "48",
|
|
226
232
|
width: "48"
|
|
227
|
-
}, null, 8,
|
|
228
|
-
|
|
233
|
+
}, null, 8, le)) : (o(), a("div", ue, [
|
|
234
|
+
R(Zt)
|
|
229
235
|
]))
|
|
230
236
|
]),
|
|
231
|
-
m("div",
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
237
|
+
m("div", me, [
|
|
238
|
+
m("div", de, [
|
|
239
|
+
R(at, {
|
|
240
|
+
text: s.chat.name,
|
|
241
|
+
position: "bottom"
|
|
242
|
+
}, {
|
|
243
|
+
default: W(() => [
|
|
244
|
+
Mt.value ? (o(), a("div", {
|
|
245
|
+
key: 0,
|
|
246
|
+
class: "chat-item__name",
|
|
247
|
+
innerHTML: St.value
|
|
248
|
+
}, null, 8, he)) : (o(), a("div", fe, f(s.chat.name), 1))
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["text"]),
|
|
252
|
+
s.chat.verified ? (o(), d(te, { key: 0 })) : c("", !0),
|
|
253
|
+
$t(t.$slots, "name-suffix", {}, void 0, !0)
|
|
254
|
+
]),
|
|
255
|
+
R(at, {
|
|
256
|
+
text: Tt.value,
|
|
247
257
|
position: "bottom"
|
|
248
258
|
}, {
|
|
249
|
-
default:
|
|
250
|
-
|
|
251
|
-
|
|
259
|
+
default: W(() => [
|
|
260
|
+
s.chat.lastMessage || s.chat.typing || w.value ? (o(), a("div", ve, [
|
|
261
|
+
K.value && !w.value ? (o(), d(it(K.value), {
|
|
252
262
|
key: 0,
|
|
253
263
|
class: "chat-item__message-icon"
|
|
254
|
-
})) :
|
|
255
|
-
|
|
256
|
-
m("span",
|
|
257
|
-
|
|
264
|
+
})) : c("", !0),
|
|
265
|
+
w.value ? (o(), a("span", ge, [
|
|
266
|
+
m("span", ye, f(h(H)), 1),
|
|
267
|
+
J.value ? (o(), d(it(J.value), {
|
|
258
268
|
key: 0,
|
|
259
269
|
class: "chat-item__message-icon"
|
|
260
|
-
})) :
|
|
261
|
-
g.value &&
|
|
270
|
+
})) : c("", !0),
|
|
271
|
+
g.value && Q.value ? (o(), a("span", {
|
|
262
272
|
key: 1,
|
|
263
273
|
class: "chat-item__draft-text",
|
|
264
|
-
innerHTML:
|
|
265
|
-
}, null, 8,
|
|
266
|
-
])) :
|
|
274
|
+
innerHTML: It.value
|
|
275
|
+
}, null, 8, pe)) : g.value ? (o(), a("span", _e, f(g.value), 1)) : c("", !0)
|
|
276
|
+
])) : Q.value ? (o(), a("span", {
|
|
267
277
|
key: 2,
|
|
268
278
|
class: "chat-item__last-message-text",
|
|
269
|
-
innerHTML:
|
|
270
|
-
}, null, 8,
|
|
271
|
-
])) :
|
|
279
|
+
innerHTML: Et.value
|
|
280
|
+
}, null, 8, ke)) : (o(), a("span", xe, f(U.value), 1))
|
|
281
|
+
])) : c("", !0)
|
|
272
282
|
]),
|
|
273
283
|
_: 1
|
|
274
284
|
}, 8, ["text"])
|
|
275
285
|
]),
|
|
276
|
-
m("div",
|
|
277
|
-
|
|
278
|
-
p.value &&
|
|
286
|
+
m("div", we, [
|
|
287
|
+
s.chat["lastActivity.time"] && (!x.value || !p.value) ? (o(), a("div", Ce, f(s.chat["lastActivity.time"]), 1)) : c("", !0),
|
|
288
|
+
p.value && x.value && s.contextMenuTrigger === "hover" ? (o(), d(Kt, {
|
|
279
289
|
key: 1,
|
|
280
290
|
mode: "click",
|
|
281
291
|
"menu-side": "bottom-right",
|
|
282
|
-
actions:
|
|
283
|
-
onClick:
|
|
284
|
-
onButtonClick:
|
|
292
|
+
actions: s.chat.actions,
|
|
293
|
+
onClick: O,
|
|
294
|
+
onButtonClick: ht,
|
|
285
295
|
onMenuMouseLeave: e[0] || (e[0] = (i) => p.value = !1)
|
|
286
296
|
}, {
|
|
287
|
-
default:
|
|
297
|
+
default: W(() => [...e[2] || (e[2] = [
|
|
288
298
|
m("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
|
|
289
299
|
])]),
|
|
290
300
|
_: 1
|
|
291
|
-
}, 8, ["actions"])) :
|
|
292
|
-
(o(), d(
|
|
293
|
-
|
|
301
|
+
}, 8, ["actions"])) : c("", !0),
|
|
302
|
+
(o(), d(jt, { to: "body" }, [
|
|
303
|
+
s.contextMenuTrigger === "rightClick" && x.value && k.value ? (o(), d(Qt, {
|
|
294
304
|
key: 0,
|
|
295
305
|
id: "context-menu-rightclick-" + h(y),
|
|
296
|
-
actions:
|
|
306
|
+
actions: s.chat.actions,
|
|
297
307
|
"data-theme": h(Y)().theme ? h(Y)().theme : "light",
|
|
298
|
-
onClick:
|
|
299
|
-
onMouseenter:
|
|
300
|
-
onMouseleave:
|
|
301
|
-
}, null, 8, ["id", "actions", "data-theme"])) :
|
|
308
|
+
onClick: O,
|
|
309
|
+
onMouseenter: Vt,
|
|
310
|
+
onMouseleave: Dt
|
|
311
|
+
}, null, 8, ["id", "actions", "data-theme"])) : c("", !0)
|
|
302
312
|
])),
|
|
303
|
-
m("div",
|
|
304
|
-
h(
|
|
313
|
+
m("div", Ie, [
|
|
314
|
+
h(Ot).includes(s.chat["lastMessage.status"]) ? (o(), a("div", {
|
|
305
315
|
key: 0,
|
|
306
|
-
class:
|
|
316
|
+
class: P(["chat-item__status-message", kt.value])
|
|
307
317
|
}, [
|
|
308
|
-
|
|
309
|
-
], 2)) :
|
|
310
|
-
|
|
318
|
+
s.chat["lastMessage.status"] === "pending" ? (o(), d(h(ne), { key: 0 })) : s.chat["lastMessage.status"] === "error" ? (o(), d(h(ee), { key: 1 })) : s.chat["lastMessage.status"] === "read" ? (o(), d(h(ie), { key: 2 })) : s.chat["lastMessage.status"] === "received" ? (o(), d(h(oe), { key: 3 })) : (o(), d(h(ae), { key: 4 }))
|
|
319
|
+
], 2)) : c("", !0),
|
|
320
|
+
xt.value ? (o(), a("div", Te, f(wt.value), 1)) : c("", !0)
|
|
311
321
|
]),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
])) :
|
|
322
|
+
s.chat.countUnread < 1 ? (o(), a("div", Me, [
|
|
323
|
+
s.chat.isFixedTop || s.chat.isFixedBottom ? (o(), a("span", Ee)) : c("", !0)
|
|
324
|
+
])) : c("", !0)
|
|
315
325
|
]),
|
|
316
|
-
n.showDialogs &&
|
|
326
|
+
n.showDialogs && s.chat.dialogs ? (o(), a("div", {
|
|
317
327
|
key: 0,
|
|
318
328
|
class: "chat-item__dialog-buttons",
|
|
319
|
-
onClick: e[1] || (e[1] = (i) =>
|
|
329
|
+
onClick: e[1] || (e[1] = (i) => L("expand", n.chat))
|
|
320
330
|
}, [
|
|
321
|
-
n.showDialogs && !
|
|
331
|
+
n.showDialogs && !s.chat.dialogsExpanded ? (o(), a("button", Se, [...e[3] || (e[3] = [
|
|
322
332
|
m("span", {
|
|
323
333
|
id: "noSelectButton",
|
|
324
334
|
class: "pi pi-angle-down"
|
|
325
335
|
}, null, -1)
|
|
326
|
-
])])) :
|
|
327
|
-
n.showDialogs &&
|
|
336
|
+
])])) : c("", !0),
|
|
337
|
+
n.showDialogs && s.chat.dialogsExpanded ? (o(), a("button", Le, [...e[4] || (e[4] = [
|
|
328
338
|
m("span", {
|
|
329
339
|
id: "noSelectButton",
|
|
330
340
|
class: "pi pi-angle-up"
|
|
331
341
|
}, null, -1)
|
|
332
|
-
])])) :
|
|
333
|
-
])) :
|
|
334
|
-
], 42,
|
|
335
|
-
n.showDialogs &&
|
|
336
|
-
(o(!0),
|
|
342
|
+
])])) : c("", !0)
|
|
343
|
+
])) : c("", !0)
|
|
344
|
+
], 42, ce),
|
|
345
|
+
n.showDialogs && s.chat.dialogsExpanded ? (o(), a("div", be, [
|
|
346
|
+
(o(!0), a(Xt, null, Yt(_t(), (i) => (o(), a("div", {
|
|
337
347
|
key: i.dialogId,
|
|
338
|
-
class:
|
|
339
|
-
onClick: (
|
|
348
|
+
class: P(["dialog__item", yt(i)]),
|
|
349
|
+
onClick: (u) => vt(i)
|
|
340
350
|
}, [
|
|
341
|
-
i.icon ? (o(),
|
|
351
|
+
i.icon ? (o(), a("img", {
|
|
342
352
|
key: 0,
|
|
343
353
|
class: "dialog__icon",
|
|
344
354
|
src: i.icon,
|
|
345
355
|
height: "16",
|
|
346
356
|
width: "16"
|
|
347
|
-
}, null, 8,
|
|
348
|
-
m("div",
|
|
349
|
-
m("div",
|
|
350
|
-
m("div",
|
|
357
|
+
}, null, 8, Be)) : (o(), a("span", Ve)),
|
|
358
|
+
m("div", De, [
|
|
359
|
+
m("div", He, f(i.name), 1),
|
|
360
|
+
m("div", Ne, f(i["lastActivity.time"]), 1)
|
|
351
361
|
]),
|
|
352
|
-
i.countUnread > 0 ? (o(),
|
|
362
|
+
i.countUnread > 0 ? (o(), a("div", {
|
|
353
363
|
key: 2,
|
|
354
364
|
class: "chat-item__unread",
|
|
355
|
-
style:
|
|
356
|
-
}, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) :
|
|
357
|
-
], 10,
|
|
358
|
-
])) :
|
|
365
|
+
style: nt(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
|
|
366
|
+
}, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : c("", !0)
|
|
367
|
+
], 10, Ae))), 128))
|
|
368
|
+
])) : c("", !0)
|
|
359
369
|
]));
|
|
360
370
|
}
|
|
361
371
|
});
|
|
362
372
|
export {
|
|
363
|
-
|
|
373
|
+
fn as default
|
|
364
374
|
};
|