@mobilon-dev/chotto 0.3.61 → 0.3.63
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/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +76 -46
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +161 -131
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/Feed.vue2.js +94 -94
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +99 -77
- 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/components/2_feed_elements/StickerMessage/utils/stickerUtils.d.ts +5 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +2 -2
- package/dist/types/components/3_compounds/SideBar/SideBar.vue.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as me, ref as k, computed as l, inject as w, unref as o, watch as fe, nextTick as j, onMounted as ge, createElementBlock as c, openBlock as i, createVNode as g, createBlock as f, createCommentVNode as u, normalizeStyle as K, renderSlot as x, withDirectives as ye, createElementVNode as h, vShow as pe, Transition as v, withCtx as S, Fragment as be, renderList as ke, resolveDynamicComponent as he, toDisplayString as ve, Teleport as Se } from "vue";
|
|
2
2
|
import Re from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
3
|
import Be from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
4
|
import Ie from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
@@ -17,10 +17,10 @@ import { useFeedScrollTo as Oe } from "./composables/useFeedScrollTo.js";
|
|
|
17
17
|
import { useStickyDate as Ve } from "./composables/useStickyDate.js";
|
|
18
18
|
import { throttle as $e } from "./functions/throttle.js";
|
|
19
19
|
import qe from "./assets/chat-background.svg.js";
|
|
20
|
-
const ze = ["id"],
|
|
20
|
+
const ze = { class: "message-feed-wrapper" }, Ee = ["id"], Pe = { class: "message-feed__loading" }, We = ["id", "data-timestamp", "onDblclick"], Ne = { style: { margin: "auto" } }, Ge = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "message-feed__unread-amount"
|
|
23
|
-
},
|
|
23
|
+
}, ut = /* @__PURE__ */ me({
|
|
24
24
|
__name: "Feed",
|
|
25
25
|
props: {
|
|
26
26
|
objects: {
|
|
@@ -98,24 +98,24 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
98
98
|
"smsInvite",
|
|
99
99
|
"delimiterRead"
|
|
100
100
|
],
|
|
101
|
-
setup(e, { emit:
|
|
101
|
+
setup(e, { emit: L }) {
|
|
102
102
|
const a = e, b = k(), r = k(), R = k(), {
|
|
103
|
-
isShowButton:
|
|
104
|
-
isKeyboardPlace:
|
|
105
|
-
checkButtonVisibility:
|
|
103
|
+
isShowButton: O,
|
|
104
|
+
isKeyboardPlace: V,
|
|
105
|
+
checkButtonVisibility: $
|
|
106
106
|
} = Fe({
|
|
107
107
|
feedRef: r,
|
|
108
108
|
keyboardRef: R
|
|
109
|
-
}), { componentsMap:
|
|
110
|
-
objects:
|
|
111
|
-
}), y = w("chatAppId"), B = w("selectedChat", void 0), I =
|
|
109
|
+
}), { componentsMap: q } = Ce(), z = l(() => a.reactionsEnabled), { groupedObjects: E } = De({
|
|
110
|
+
objects: l(() => a.objects)
|
|
111
|
+
}), y = w("chatAppId"), B = w("selectedChat", void 0), I = l(() => {
|
|
112
112
|
if (B)
|
|
113
113
|
return o(B);
|
|
114
114
|
});
|
|
115
|
-
function
|
|
115
|
+
function P(s) {
|
|
116
116
|
return s.timestamp;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function W(s) {
|
|
119
119
|
var m;
|
|
120
120
|
const n = s;
|
|
121
121
|
if (!n.dialogId || !((m = I.value) != null && m.dialogs))
|
|
@@ -123,65 +123,65 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
123
123
|
const t = I.value.dialogs.find((p) => p.dialogId === n.dialogId);
|
|
124
124
|
return t == null ? void 0 : t.channelId;
|
|
125
125
|
}
|
|
126
|
-
const d =
|
|
127
|
-
checkScrollPosition:
|
|
126
|
+
const d = L, {
|
|
127
|
+
checkScrollPosition: N,
|
|
128
128
|
startScrollWatch: T,
|
|
129
129
|
stopScrollWatch: A,
|
|
130
|
-
resetAllowFlags:
|
|
130
|
+
resetAllowFlags: G
|
|
131
131
|
} = je({
|
|
132
132
|
feedRef: r,
|
|
133
133
|
emit: d,
|
|
134
|
-
isLoadingMoreRef:
|
|
134
|
+
isLoadingMoreRef: l(() => a.isLoadingMore)
|
|
135
135
|
}), {
|
|
136
136
|
getMessage: M,
|
|
137
|
-
messageAction:
|
|
138
|
-
handleClickReplied:
|
|
139
|
-
feedObjectDoubleClick:
|
|
140
|
-
handleResetReply:
|
|
137
|
+
messageAction: U,
|
|
138
|
+
handleClickReplied: H,
|
|
139
|
+
feedObjectDoubleClick: J,
|
|
140
|
+
handleResetReply: Q
|
|
141
141
|
} = xe({
|
|
142
142
|
enableDoubleClickReply: a.enableDoubleClickReply,
|
|
143
143
|
emit: d
|
|
144
144
|
});
|
|
145
|
-
function
|
|
145
|
+
function X(s) {
|
|
146
146
|
d("smsInvite", s);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Y(s) {
|
|
149
149
|
d("delimiterRead", s);
|
|
150
150
|
}
|
|
151
151
|
const {
|
|
152
|
-
showKeyboard:
|
|
153
|
-
keyboardAction:
|
|
154
|
-
feedKeyboardAction:
|
|
152
|
+
showKeyboard: Z,
|
|
153
|
+
keyboardAction: _,
|
|
154
|
+
feedKeyboardAction: ee
|
|
155
155
|
} = we({
|
|
156
|
-
isKeyboardPlace:
|
|
157
|
-
objects:
|
|
156
|
+
isKeyboardPlace: V,
|
|
157
|
+
objects: l(() => a.objects),
|
|
158
158
|
emit: d
|
|
159
159
|
}), {
|
|
160
|
-
showStickyDate:
|
|
161
|
-
stickyDateText:
|
|
162
|
-
show:
|
|
160
|
+
showStickyDate: te,
|
|
161
|
+
stickyDateText: oe,
|
|
162
|
+
show: se
|
|
163
163
|
} = Ve({
|
|
164
164
|
feedRef: r,
|
|
165
165
|
trackingObjects: b
|
|
166
166
|
}), {
|
|
167
|
-
isInitialized:
|
|
168
|
-
performScrollToBottom:
|
|
167
|
+
isInitialized: ne,
|
|
168
|
+
performScrollToBottom: ae,
|
|
169
169
|
ensureScrollToBottom: F,
|
|
170
170
|
initializeScroll: ie,
|
|
171
|
-
smoothScrollToBottom:
|
|
171
|
+
smoothScrollToBottom: le
|
|
172
172
|
} = Le({
|
|
173
173
|
feedRef: r,
|
|
174
|
-
objectsRef:
|
|
175
|
-
scrollToBottomRef:
|
|
176
|
-
}), C =
|
|
174
|
+
objectsRef: l(() => a.objects),
|
|
175
|
+
scrollToBottomRef: l(() => a.scrollToBottom)
|
|
176
|
+
}), C = l(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(qe)}`);
|
|
177
177
|
function D(s = !0) {
|
|
178
|
-
|
|
178
|
+
$(), N(s), se();
|
|
179
179
|
}
|
|
180
|
-
const
|
|
181
|
-
function
|
|
182
|
-
d("forceScrollToBottom"),
|
|
180
|
+
const re = $e(() => D(), 250);
|
|
181
|
+
function de() {
|
|
182
|
+
d("forceScrollToBottom"), le();
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ce(s) {
|
|
185
185
|
const n = a.objects;
|
|
186
186
|
if (s.startsWith("mid-")) {
|
|
187
187
|
const t = parseInt(s.slice(4), 10);
|
|
@@ -189,30 +189,30 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
189
189
|
}
|
|
190
190
|
return n.find((t) => t.messageId === s);
|
|
191
191
|
}
|
|
192
|
-
const { restartObserving:
|
|
192
|
+
const { restartObserving: ue } = Ke({
|
|
193
193
|
trackingObjects: b,
|
|
194
194
|
chatAppId: y,
|
|
195
|
-
getMessageById:
|
|
195
|
+
getMessageById: ce,
|
|
196
196
|
onMessageVisible: (s) => d("messageVisible", s)
|
|
197
197
|
});
|
|
198
|
-
return
|
|
198
|
+
return fe(
|
|
199
199
|
() => a.objects,
|
|
200
200
|
() => {
|
|
201
201
|
j(() => {
|
|
202
202
|
requestAnimationFrame(() => {
|
|
203
|
-
|
|
203
|
+
G(), D(!1), b.value = document.querySelectorAll(".tracking-message"), ue();
|
|
204
204
|
});
|
|
205
205
|
});
|
|
206
206
|
},
|
|
207
207
|
{ immediate: !0 }
|
|
208
208
|
), Oe({
|
|
209
|
-
targetIdRef:
|
|
209
|
+
targetIdRef: l(() => a.scrollTo),
|
|
210
210
|
feedContainerId: `feed-container-${y}`
|
|
211
|
-
}),
|
|
211
|
+
}), ge(() => {
|
|
212
212
|
j(() => {
|
|
213
|
-
a.objects.length > 0 && !
|
|
213
|
+
a.objects.length > 0 && !ne.value && ie();
|
|
214
214
|
const s = new ResizeObserver(() => {
|
|
215
|
-
a.scrollToBottom && (
|
|
215
|
+
a.scrollToBottom && (ae(), setTimeout(() => {
|
|
216
216
|
F();
|
|
217
217
|
}, 200), setTimeout(() => {
|
|
218
218
|
F();
|
|
@@ -220,63 +220,63 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
220
220
|
});
|
|
221
221
|
r.value && s.observe(r.value);
|
|
222
222
|
});
|
|
223
|
-
}), (s, n) => (
|
|
224
|
-
e.objects.length > 0 || e.typing ? (
|
|
223
|
+
}), (s, n) => (i(), c("div", ze, [
|
|
224
|
+
e.objects.length > 0 || e.typing ? (i(), c("div", {
|
|
225
225
|
key: 0,
|
|
226
226
|
id: "feed-container-" + o(y),
|
|
227
227
|
ref_key: "refFeed",
|
|
228
228
|
ref: r,
|
|
229
229
|
class: "message-feed",
|
|
230
|
-
style:
|
|
231
|
-
onScroll: n[0] || (n[0] = (t) => o(
|
|
230
|
+
style: K({ backgroundImage: `url(${C.value})` }),
|
|
231
|
+
onScroll: n[0] || (n[0] = (t) => o(re)()),
|
|
232
232
|
onMousedown: n[1] || (n[1] = //@ts-ignore
|
|
233
233
|
(...t) => o(T) && o(T)(...t)),
|
|
234
234
|
onMouseup: n[2] || (n[2] = //@ts-ignore
|
|
235
235
|
(...t) => o(A) && o(A)(...t))
|
|
236
236
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
x(s.$slots, "prepend", {}, void 0, !0),
|
|
238
|
+
ye(h("div", Pe, [
|
|
239
239
|
g(Me, {
|
|
240
240
|
"is-loading": e.isLoadingMore,
|
|
241
241
|
size: "small",
|
|
242
242
|
position: "top"
|
|
243
243
|
}, null, 8, ["is-loading"])
|
|
244
244
|
], 512), [
|
|
245
|
-
[
|
|
245
|
+
[pe, e.isLoadingMore]
|
|
246
246
|
]),
|
|
247
247
|
g(v, null, {
|
|
248
248
|
default: S(() => [
|
|
249
|
-
o(
|
|
249
|
+
o(te) && !e.isLoadingMore ? (i(), f(Re, {
|
|
250
250
|
key: 0,
|
|
251
251
|
class: "message-feed__sticky-date",
|
|
252
|
-
text: o(
|
|
252
|
+
text: o(oe)
|
|
253
253
|
}, null, 8, ["text"])) : u("", !0)
|
|
254
254
|
]),
|
|
255
255
|
_: 1
|
|
256
256
|
}),
|
|
257
|
-
(
|
|
257
|
+
(i(!0), c(be, null, ke(o(E), (t, m) => (i(), c("div", {
|
|
258
258
|
id: "msg-" + (t.messageId ?? "mid-" + m),
|
|
259
259
|
key: t.messageId ?? "mid-" + m,
|
|
260
|
-
"data-timestamp":
|
|
260
|
+
"data-timestamp": P(t),
|
|
261
261
|
class: "tracking-message",
|
|
262
|
-
onDblclick: (p) => o(
|
|
262
|
+
onDblclick: (p) => o(J)(p, t)
|
|
263
263
|
}, [
|
|
264
|
-
(
|
|
264
|
+
(i(), f(he(o(q)(t.type)), {
|
|
265
265
|
key: t.messageId ?? "mid-" + m,
|
|
266
266
|
class: "message-feed__message",
|
|
267
267
|
message: t,
|
|
268
268
|
"apply-style": e.applyStyle,
|
|
269
269
|
"is-first-in-series": t.isFirstInSeries,
|
|
270
|
-
"reactions-enabled":
|
|
270
|
+
"reactions-enabled": z.value,
|
|
271
271
|
"subtext-tooltip-data": e.subtextTooltipData,
|
|
272
|
-
channel:
|
|
273
|
-
onAction: o(
|
|
274
|
-
onReply: o(
|
|
275
|
-
onSmsInvite: (p) =>
|
|
276
|
-
onRead:
|
|
272
|
+
channel: W(t),
|
|
273
|
+
onAction: o(U),
|
|
274
|
+
onReply: o(H),
|
|
275
|
+
onSmsInvite: (p) => X(t),
|
|
276
|
+
onRead: Y
|
|
277
277
|
}, null, 40, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
278
|
-
], 40,
|
|
279
|
-
e.typing ? (
|
|
278
|
+
], 40, We))), 128)),
|
|
279
|
+
e.typing ? (i(), f(Ae, {
|
|
280
280
|
key: 0,
|
|
281
281
|
message: {
|
|
282
282
|
subText: e.typing.title,
|
|
@@ -285,61 +285,61 @@ const ze = ["id"], Ee = { class: "message-feed__loading" }, Pe = ["id", "data-ti
|
|
|
285
285
|
}, null, 8, ["message"])) : u("", !0),
|
|
286
286
|
g(v, null, {
|
|
287
287
|
default: S(() => [
|
|
288
|
-
o(
|
|
288
|
+
o(Z) ? (i(), f(Ie, {
|
|
289
289
|
key: 0,
|
|
290
290
|
ref_key: "keyboardRef",
|
|
291
291
|
ref: R,
|
|
292
292
|
class: "message-feed__keyboard",
|
|
293
293
|
keyboard: e.objects[e.objects.length - 1].keyboard,
|
|
294
294
|
align: e.keyboardAlign,
|
|
295
|
-
onAction: o(
|
|
295
|
+
onAction: o(_)
|
|
296
296
|
}, null, 8, ["keyboard", "align", "onAction"])) : u("", !0)
|
|
297
297
|
]),
|
|
298
298
|
_: 1
|
|
299
299
|
}),
|
|
300
|
-
|
|
301
|
-
default: S(() => [
|
|
302
|
-
o(V) ? (l(), c("button", {
|
|
303
|
-
key: 0,
|
|
304
|
-
class: "message-feed__button-down",
|
|
305
|
-
onClick: ce
|
|
306
|
-
}, [
|
|
307
|
-
e.buttonParams ? (l(), c("div", We, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
|
|
308
|
-
n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
309
|
-
])) : u("", !0)
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
}),
|
|
313
|
-
e.feedKeyboards && e.feedKeyboards.length > 0 ? (l(), f(Te, {
|
|
300
|
+
e.feedKeyboards && e.feedKeyboards.length > 0 ? (i(), f(Te, {
|
|
314
301
|
key: 1,
|
|
315
302
|
buttons: e.feedKeyboards,
|
|
316
303
|
align: e.feedKeyboardAlign,
|
|
317
|
-
onAction: o(
|
|
304
|
+
onAction: o(ee)
|
|
318
305
|
}, null, 8, ["buttons", "align", "onAction"])) : u("", !0)
|
|
319
|
-
], 44,
|
|
306
|
+
], 44, Ee)) : (i(), c("div", {
|
|
320
307
|
key: 1,
|
|
321
308
|
ref_key: "refFeed",
|
|
322
309
|
ref: r,
|
|
323
310
|
class: "message-feed",
|
|
324
|
-
style:
|
|
311
|
+
style: K({ backgroundImage: `url(${C.value})` })
|
|
325
312
|
}, [
|
|
326
313
|
h("div", Ne, [
|
|
327
|
-
|
|
314
|
+
x(s.$slots, "empty-feed", {}, void 0, !0)
|
|
328
315
|
])
|
|
329
316
|
], 4)),
|
|
330
|
-
|
|
317
|
+
g(v, null, {
|
|
318
|
+
default: S(() => [
|
|
319
|
+
o(O) ? (i(), c("button", {
|
|
320
|
+
key: 0,
|
|
321
|
+
class: "message-feed__button-down",
|
|
322
|
+
onClick: de
|
|
323
|
+
}, [
|
|
324
|
+
e.buttonParams ? (i(), c("div", Ge, ve(e.buttonParams.unreadAmount), 1)) : u("", !0),
|
|
325
|
+
n[3] || (n[3] = h("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
326
|
+
])) : u("", !0)
|
|
327
|
+
]),
|
|
328
|
+
_: 1
|
|
329
|
+
}),
|
|
330
|
+
o(M)().reply ? (i(), f(Se, {
|
|
331
331
|
key: 2,
|
|
332
332
|
to: "#chat-input-reply-line-" + o(y)
|
|
333
333
|
}, [
|
|
334
334
|
g(Be, {
|
|
335
335
|
class: "chat-input-reply",
|
|
336
336
|
message: o(M)().reply,
|
|
337
|
-
onReset: o(
|
|
337
|
+
onReset: o(Q)
|
|
338
338
|
}, null, 8, ["message", "onReset"])
|
|
339
339
|
], 8, ["to"])) : u("", !0)
|
|
340
|
-
]
|
|
340
|
+
]));
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
343
|
export {
|
|
344
|
-
|
|
344
|
+
ut as default
|
|
345
345
|
};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { toRef as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { toRef as E, computed as T, ref as f, onMounted as W, nextTick as q, onUnmounted as J, watch as K, createElementBlock as a, openBlock as o, normalizeClass as s, createCommentVNode as u, createElementVNode as d, normalizeStyle as O, Fragment as A, renderList as w, createBlock as y, withCtx as k, toDisplayString as M, createVNode as R } from "vue";
|
|
2
|
+
import Q from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
|
|
3
|
+
import F from "../../1_icons/SettingsIcon.vue.js";
|
|
4
|
+
import L from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import X from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const Z = ["onClick"], $ = ["src", "alt"], ee = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "sidebar__notification-count"
|
|
10
|
-
},
|
|
10
|
+
}, te = { class: "sidebar__scroll-container" }, ne = ["onClick"], oe = ["src", "alt"], ie = ["src"], ae = { key: 2 }, se = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "sidebar__settings-container"
|
|
13
|
-
},
|
|
13
|
+
}, re = {
|
|
14
|
+
class: "sidebar__settings-btn",
|
|
15
|
+
type: "button"
|
|
16
|
+
}, le = {
|
|
14
17
|
__name: "SideBar",
|
|
15
18
|
props: {
|
|
16
19
|
sidebarItems: {
|
|
@@ -32,160 +35,179 @@ const X = ["onClick"], Z = ["src", "alt"], $ = {
|
|
|
32
35
|
type: Boolean,
|
|
33
36
|
required: !1,
|
|
34
37
|
default: !0
|
|
38
|
+
},
|
|
39
|
+
settingsButtonMode: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: !1,
|
|
42
|
+
default: "menu"
|
|
43
|
+
// 'menu' | 'action'
|
|
35
44
|
}
|
|
36
45
|
},
|
|
37
|
-
emits: ["selectItem"],
|
|
38
|
-
setup(i, { emit:
|
|
39
|
-
const
|
|
40
|
-
() =>
|
|
41
|
-
),
|
|
42
|
-
() =>
|
|
43
|
-
),
|
|
44
|
-
const t =
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
46
|
+
emits: ["selectItem", "settingsClick"],
|
|
47
|
+
setup(i, { emit: N }) {
|
|
48
|
+
const C = i, m = E(C, "sidebarItems"), p = E(C, "menuActions"), z = N, x = T(
|
|
49
|
+
() => m.value.filter((e) => e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
|
|
50
|
+
), V = T(
|
|
51
|
+
() => m.value.filter((e) => !e.isFixedBottom).sort((e, t) => t.notificationCount - e.notificationCount)
|
|
52
|
+
), H = (e) => {
|
|
53
|
+
const t = m.value.find((n) => n.itemId === e);
|
|
54
|
+
z("selectItem", t);
|
|
55
|
+
}, B = (e, t) => {
|
|
56
|
+
P(e.currentTarget), H(t);
|
|
57
|
+
}, Y = (e) => {
|
|
49
58
|
const t = e.split(" ");
|
|
50
59
|
return t.length > 2 ? t.slice(0, 2).join(" ") : e;
|
|
51
|
-
},
|
|
60
|
+
}, j = (e) => {
|
|
52
61
|
console.log("Выбрано действие:", e), typeof e.action == "function" && e.action();
|
|
53
|
-
},
|
|
62
|
+
}, D = () => {
|
|
54
63
|
console.log("Кнопка меню была нажата");
|
|
55
|
-
},
|
|
64
|
+
}, G = () => {
|
|
65
|
+
var t;
|
|
66
|
+
z("settingsClick");
|
|
67
|
+
const e = (t = p.value) == null ? void 0 : t[0];
|
|
68
|
+
e && typeof e.action == "function" && !e.disabled && e.action();
|
|
69
|
+
}, l = f(null), h = f(!1), v = f(0), g = f(40), b = f(!1), I = (e) => {
|
|
56
70
|
const t = l.value;
|
|
57
71
|
if (!t || !e) return 0;
|
|
58
|
-
const
|
|
59
|
-
return Math.max(0,
|
|
72
|
+
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), U = r.top + r.height / 2 - n.top - g.value / 2;
|
|
73
|
+
return Math.max(0, U);
|
|
60
74
|
}, _ = () => {
|
|
61
75
|
if (!l.value) return;
|
|
62
76
|
const t = l.value.querySelector(".sidebar__image--active");
|
|
63
|
-
t ? (
|
|
64
|
-
},
|
|
77
|
+
t ? (v.value = I(t), h.value = !0) : h.value = !1;
|
|
78
|
+
}, P = (e) => {
|
|
65
79
|
try {
|
|
66
80
|
if (!e || !l.value) return;
|
|
67
81
|
const t = e.querySelector(".sidebar__image");
|
|
68
82
|
if (!t) return;
|
|
69
|
-
const
|
|
70
|
-
b.value = !0,
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
const n = I(t), r = 12, c = 160;
|
|
84
|
+
b.value = !0, g.value = r, setTimeout(() => {
|
|
85
|
+
v.value = n, requestAnimationFrame(() => {
|
|
86
|
+
g.value = 40, setTimeout(() => {
|
|
73
87
|
b.value = !1;
|
|
74
88
|
}, c);
|
|
75
89
|
});
|
|
76
90
|
}, c);
|
|
77
91
|
} catch {
|
|
78
92
|
}
|
|
79
|
-
},
|
|
80
|
-
return
|
|
93
|
+
}, S = () => _();
|
|
94
|
+
return W(() => {
|
|
81
95
|
var t;
|
|
82
|
-
|
|
96
|
+
q(_), window.addEventListener("resize", S);
|
|
83
97
|
const e = (t = l.value) == null ? void 0 : t.querySelector(".sidebar__scroll-container");
|
|
84
98
|
e && e.addEventListener("scroll", _);
|
|
85
|
-
}),
|
|
99
|
+
}), J(() => {
|
|
86
100
|
var t;
|
|
87
|
-
window.removeEventListener("resize",
|
|
101
|
+
window.removeEventListener("resize", S);
|
|
88
102
|
const e = (t = l.value) == null ? void 0 : t.querySelector(".sidebar__scroll-container");
|
|
89
103
|
e && e.removeEventListener("scroll", _);
|
|
90
|
-
}),
|
|
104
|
+
}), K(() => m.value.map((e) => e.selected), () => q(_)), (e, t) => (o(), a("div", {
|
|
91
105
|
ref_key: "containerRef",
|
|
92
106
|
ref: l,
|
|
93
107
|
class: s(["sidebar__container", { "sidebar-horizontal__container": i.horizontal }])
|
|
94
108
|
}, [
|
|
95
|
-
!i.horizontal &&
|
|
109
|
+
!i.horizontal && h.value ? (o(), a("span", {
|
|
96
110
|
key: 0,
|
|
97
111
|
class: s(["sidebar__selected-bar", { "is-animating": b.value }]),
|
|
98
|
-
style:
|
|
112
|
+
style: O({ top: v.value + "px", height: g.value + "px" })
|
|
99
113
|
}, null, 6)) : u("", !0),
|
|
100
|
-
|
|
114
|
+
x.value.length > 0 ? (o(), a("ul", {
|
|
101
115
|
key: 1,
|
|
102
116
|
class: s(["sidebar__list-fixed", { "sidebar-horizontal__list-fixed": i.horizontal }])
|
|
103
117
|
}, [
|
|
104
|
-
(
|
|
118
|
+
(o(!0), a(A, null, w(x.value, (n, r) => (o(), a("li", {
|
|
105
119
|
key: r,
|
|
106
120
|
class: s(["sidebar__item-fixed", { "sidebar-horizontal__item": i.horizontal }]),
|
|
107
|
-
onClick: (c) =>
|
|
121
|
+
onClick: (c) => B(c, n.itemId)
|
|
108
122
|
}, [
|
|
109
|
-
|
|
123
|
+
n.name ? (o(), y(L, {
|
|
110
124
|
key: 0,
|
|
111
|
-
text:
|
|
125
|
+
text: Y(n.name),
|
|
112
126
|
position: "right",
|
|
113
127
|
offset: 8
|
|
114
128
|
}, {
|
|
115
|
-
default:
|
|
129
|
+
default: k(() => [
|
|
116
130
|
d("img", {
|
|
117
|
-
src:
|
|
118
|
-
alt:
|
|
131
|
+
src: n.icon,
|
|
132
|
+
alt: n.name,
|
|
119
133
|
class: s(["sidebar__image", {
|
|
120
|
-
"sidebar__image--active":
|
|
134
|
+
"sidebar__image--active": n.selected === !0,
|
|
121
135
|
"sidebar-horizontal__image": i.horizontal
|
|
122
136
|
}])
|
|
123
|
-
}, null, 10,
|
|
137
|
+
}, null, 10, $),
|
|
124
138
|
t[0] || (t[0] = d("p", null, "Мои", -1))
|
|
125
139
|
]),
|
|
126
140
|
_: 2
|
|
127
141
|
}, 1032, ["text"])) : u("", !0),
|
|
128
|
-
|
|
129
|
-
], 10,
|
|
142
|
+
n.notificationCount ? (o(), a("span", ee, M(n.notificationCount > 99 ? "99+" : n.notificationCount), 1)) : u("", !0)
|
|
143
|
+
], 10, Z))), 128))
|
|
130
144
|
], 2)) : u("", !0),
|
|
131
|
-
d("div",
|
|
145
|
+
d("div", te, [
|
|
132
146
|
d("ul", {
|
|
133
147
|
class: s(["sidebar__list", { "sidebar-horizontal__list": i.horizontal }])
|
|
134
148
|
}, [
|
|
135
|
-
(
|
|
149
|
+
(o(!0), a(A, null, w(V.value, (n, r) => (o(), a("li", {
|
|
136
150
|
key: r,
|
|
137
151
|
class: s(["sidebar__item", { "sidebar-horizontal__item": i.horizontal }]),
|
|
138
|
-
onClick: (c) =>
|
|
152
|
+
onClick: (c) => B(c, n.itemId)
|
|
139
153
|
}, [
|
|
140
|
-
|
|
154
|
+
n.name ? (o(), y(L, {
|
|
141
155
|
key: 0,
|
|
142
|
-
text:
|
|
156
|
+
text: n.name,
|
|
143
157
|
position: "right",
|
|
144
158
|
offset: 8
|
|
145
159
|
}, {
|
|
146
|
-
default:
|
|
160
|
+
default: k(() => [
|
|
147
161
|
d("img", {
|
|
148
|
-
src:
|
|
149
|
-
alt:
|
|
162
|
+
src: n.icon,
|
|
163
|
+
alt: n.name,
|
|
150
164
|
class: s(["sidebar__image", {
|
|
151
|
-
"sidebar__image--active":
|
|
165
|
+
"sidebar__image--active": n.selected === !0,
|
|
152
166
|
"sidebar-horizontal__image": i.horizontal
|
|
153
167
|
}])
|
|
154
168
|
}, null, 10, oe)
|
|
155
169
|
]),
|
|
156
170
|
_: 2
|
|
157
|
-
}, 1032, ["text"])) : (
|
|
171
|
+
}, 1032, ["text"])) : (o(), a("img", {
|
|
158
172
|
key: 1,
|
|
159
|
-
src:
|
|
173
|
+
src: n.icon,
|
|
160
174
|
alt: "icon",
|
|
161
175
|
class: s(["sidebar__image", {
|
|
162
|
-
"sidebar__image--active":
|
|
176
|
+
"sidebar__image--active": n.selected === !0,
|
|
163
177
|
"sidebar-horizontal__image": i.horizontal
|
|
164
178
|
}])
|
|
165
|
-
}, null, 10,
|
|
166
|
-
|
|
167
|
-
], 10,
|
|
179
|
+
}, null, 10, ie)),
|
|
180
|
+
n.notificationCount ? (o(), a("span", ae, M(n.notificationCount > 99 ? "99+" : n.notificationCount), 1)) : u("", !0)
|
|
181
|
+
], 10, ne))), 128))
|
|
168
182
|
], 2)
|
|
169
183
|
]),
|
|
170
|
-
i.showSettings ? (
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
i.showSettings ? (o(), a("div", se, [
|
|
185
|
+
i.settingsButtonMode === "menu" ? (o(), y(Q, {
|
|
186
|
+
key: 0,
|
|
187
|
+
actions: p.value,
|
|
173
188
|
mode: "click",
|
|
174
189
|
"menu-side": "top-right",
|
|
175
|
-
onClick:
|
|
176
|
-
onButtonClick:
|
|
190
|
+
onClick: j,
|
|
191
|
+
onButtonClick: D
|
|
177
192
|
}, {
|
|
178
|
-
default:
|
|
179
|
-
d("button",
|
|
180
|
-
|
|
193
|
+
default: k(() => [
|
|
194
|
+
d("button", re, [
|
|
195
|
+
R(F)
|
|
181
196
|
])
|
|
182
197
|
]),
|
|
183
198
|
_: 1
|
|
184
|
-
}, 8, ["actions"])
|
|
199
|
+
}, 8, ["actions"])) : (o(), a("button", {
|
|
200
|
+
key: 1,
|
|
201
|
+
class: "sidebar__settings-btn",
|
|
202
|
+
type: "button",
|
|
203
|
+
onClick: G
|
|
204
|
+
}, [
|
|
205
|
+
R(F)
|
|
206
|
+
]))
|
|
185
207
|
])) : u("", !0)
|
|
186
208
|
], 2));
|
|
187
209
|
}
|
|
188
|
-
},
|
|
210
|
+
}, ge = /* @__PURE__ */ X(le, [["__scopeId", "data-v-eb5412c6"]]);
|
|
189
211
|
export {
|
|
190
|
-
|
|
212
|
+
ge as default
|
|
191
213
|
};
|