@mobilon-dev/chotto 0.3.65 → 0.3.67
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_atoms/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +59 -52
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +412 -342
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +445 -362
- package/dist/components/3_compounds/SideBar/SideBar.vue.js +201 -128
- 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/apps/data/messages.d.ts +235 -10
- package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +9 -0
- package/dist/types/components/2_feed_elements/AudioMessage/AudioMessage.vue.d.ts +1 -1
- package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +64 -0
- package/dist/types/components/2_feed_elements/CallMessage/CallMessage.vue.d.ts +1 -1
- package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +44 -44
- package/dist/types/components/2_feed_elements/types/messages.d.ts +31 -1
- package/dist/types/components/3_compounds/SideBar/SideBar.vue.d.ts +6 -0
- package/dist/types/components/3_compounds/SideBar/styles/types.d.ts +24 -0
- package/package.json +1 -1
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import { toRef as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { toRef as A, computed as E, ref as f, onMounted as K, nextTick as y, onUnmounted as O, watch as M, createElementBlock as s, openBlock as i, normalizeClass as r, createCommentVNode as l, createElementVNode as c, normalizeStyle as Q, Fragment as R, renderList as N, createBlock as m, withCtx as h, toDisplayString as F, createVNode as L } from "vue";
|
|
2
|
+
import X from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
|
|
3
|
+
import V from "../../1_icons/SettingsIcon.vue.js";
|
|
4
|
+
import k from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import Z from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
+
const $ = ["onClick"], tt = ["src", "alt"], et = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "sidebar__notification-count"
|
|
10
|
-
},
|
|
10
|
+
}, ot = { class: "sidebar__scroll-container" }, it = ["onClick"], nt = ["src", "alt"], st = ["src"], at = { key: 2 }, rt = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "sidebar__settings-container"
|
|
13
|
-
},
|
|
13
|
+
}, lt = {
|
|
14
14
|
class: "sidebar__settings-btn",
|
|
15
15
|
type: "button"
|
|
16
|
-
},
|
|
16
|
+
}, ct = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "sidebar__settings-indicator-anchor"
|
|
19
|
+
}, ut = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "sidebar__settings-indicator"
|
|
22
|
+
}, dt = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "sidebar__settings-indicator-anchor"
|
|
25
|
+
}, ft = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "sidebar__settings-indicator"
|
|
28
|
+
}, _t = {
|
|
17
29
|
__name: "SideBar",
|
|
18
30
|
props: {
|
|
19
31
|
sidebarItems: {
|
|
@@ -41,173 +53,234 @@ const Z = ["onClick"], $ = ["src", "alt"], ee = {
|
|
|
41
53
|
required: !1,
|
|
42
54
|
default: "menu"
|
|
43
55
|
// 'menu' | 'action'
|
|
56
|
+
},
|
|
57
|
+
showSettingsIndicator: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
required: !1,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
settingsIndicatorTooltip: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: !1,
|
|
65
|
+
default: ""
|
|
66
|
+
},
|
|
67
|
+
/** Длительность автопоказа тултипа индикатора при появлении кружка, мс */
|
|
68
|
+
settingsIndicatorTooltipAutoShowMs: {
|
|
69
|
+
type: Number,
|
|
70
|
+
required: !1,
|
|
71
|
+
default: 8e3
|
|
44
72
|
}
|
|
45
73
|
},
|
|
46
74
|
emits: ["selectItem", "settingsClick"],
|
|
47
|
-
setup(
|
|
48
|
-
const
|
|
49
|
-
() =>
|
|
50
|
-
),
|
|
51
|
-
() =>
|
|
52
|
-
),
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
},
|
|
61
|
-
console.log("Выбрано действие:",
|
|
62
|
-
},
|
|
75
|
+
setup(n, { emit: H }) {
|
|
76
|
+
const _ = n, b = A(_, "sidebarItems"), S = A(_, "menuActions"), T = H, w = E(
|
|
77
|
+
() => b.value.filter((t) => t.isFixedBottom).sort((t, e) => e.notificationCount - t.notificationCount)
|
|
78
|
+
), Y = E(
|
|
79
|
+
() => b.value.filter((t) => !t.isFixedBottom).sort((t, e) => e.notificationCount - t.notificationCount)
|
|
80
|
+
), j = (t) => {
|
|
81
|
+
const e = b.value.find((o) => o.itemId === t);
|
|
82
|
+
T("selectItem", e);
|
|
83
|
+
}, z = (t, e) => {
|
|
84
|
+
W(t.currentTarget), j(e);
|
|
85
|
+
}, D = (t) => {
|
|
86
|
+
const e = t.split(" ");
|
|
87
|
+
return e.length > 2 ? e.slice(0, 2).join(" ") : t;
|
|
88
|
+
}, G = (t) => {
|
|
89
|
+
console.log("Выбрано действие:", t), typeof t.action == "function" && t.action();
|
|
90
|
+
}, P = () => {
|
|
63
91
|
console.log("Кнопка меню была нажата");
|
|
64
|
-
},
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
const
|
|
71
|
-
if (!
|
|
72
|
-
const
|
|
73
|
-
return Math.max(0,
|
|
74
|
-
},
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
},
|
|
92
|
+
}, U = () => {
|
|
93
|
+
var e;
|
|
94
|
+
T("settingsClick");
|
|
95
|
+
const t = (e = S.value) == null ? void 0 : e[0];
|
|
96
|
+
t && typeof t.action == "function" && !t.disabled && t.action();
|
|
97
|
+
}, u = f(null), p = f(null), I = f(!1), C = f(0), v = f(40), x = f(!1), B = (t) => {
|
|
98
|
+
const e = u.value;
|
|
99
|
+
if (!e || !t) return 0;
|
|
100
|
+
const o = e.getBoundingClientRect(), a = t.getBoundingClientRect(), J = a.top + a.height / 2 - o.top - v.value / 2;
|
|
101
|
+
return Math.max(0, J);
|
|
102
|
+
}, g = () => {
|
|
103
|
+
if (!u.value) return;
|
|
104
|
+
const e = u.value.querySelector(".sidebar__image--active");
|
|
105
|
+
e ? (C.value = B(e), I.value = !0) : I.value = !1;
|
|
106
|
+
}, W = (t) => {
|
|
79
107
|
try {
|
|
80
|
-
if (!
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
108
|
+
if (!t || !u.value) return;
|
|
109
|
+
const e = t.querySelector(".sidebar__image");
|
|
110
|
+
if (!e) return;
|
|
111
|
+
const o = B(e), a = 12, d = 160;
|
|
112
|
+
x.value = !0, v.value = a, setTimeout(() => {
|
|
113
|
+
C.value = o, requestAnimationFrame(() => {
|
|
114
|
+
v.value = 40, setTimeout(() => {
|
|
115
|
+
x.value = !1;
|
|
116
|
+
}, d);
|
|
89
117
|
});
|
|
90
|
-
},
|
|
118
|
+
}, d);
|
|
91
119
|
} catch {
|
|
92
120
|
}
|
|
93
|
-
},
|
|
94
|
-
return
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
}),
|
|
100
|
-
var
|
|
101
|
-
window.removeEventListener("resize",
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
}),
|
|
121
|
+
}, q = () => g();
|
|
122
|
+
return K(() => {
|
|
123
|
+
var e;
|
|
124
|
+
y(g), window.addEventListener("resize", q);
|
|
125
|
+
const t = (e = u.value) == null ? void 0 : e.querySelector(".sidebar__scroll-container");
|
|
126
|
+
t && t.addEventListener("scroll", g);
|
|
127
|
+
}), O(() => {
|
|
128
|
+
var e;
|
|
129
|
+
window.removeEventListener("resize", q);
|
|
130
|
+
const t = (e = u.value) == null ? void 0 : e.querySelector(".sidebar__scroll-container");
|
|
131
|
+
t && t.removeEventListener("scroll", g);
|
|
132
|
+
}), M(() => b.value.map((t) => t.selected), () => y(g)), M(
|
|
133
|
+
() => _.showSettings && _.showSettingsIndicator && !!_.settingsIndicatorTooltip,
|
|
134
|
+
(t, e) => {
|
|
135
|
+
!t || e === !0 || y(() => {
|
|
136
|
+
y(() => {
|
|
137
|
+
var o, a;
|
|
138
|
+
(a = (o = p.value) == null ? void 0 : o.startAutoShow) == null || a.call(o);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
{ flush: "post", immediate: !0 }
|
|
143
|
+
), (t, e) => (i(), s("div", {
|
|
105
144
|
ref_key: "containerRef",
|
|
106
|
-
ref:
|
|
107
|
-
class:
|
|
145
|
+
ref: u,
|
|
146
|
+
class: r(["sidebar__container", { "sidebar-horizontal__container": n.horizontal }])
|
|
108
147
|
}, [
|
|
109
|
-
!
|
|
148
|
+
!n.horizontal && I.value ? (i(), s("span", {
|
|
110
149
|
key: 0,
|
|
111
|
-
class:
|
|
112
|
-
style:
|
|
113
|
-
}, null, 6)) :
|
|
114
|
-
|
|
150
|
+
class: r(["sidebar__selected-bar", { "is-animating": x.value }]),
|
|
151
|
+
style: Q({ top: C.value + "px", height: v.value + "px" })
|
|
152
|
+
}, null, 6)) : l("", !0),
|
|
153
|
+
w.value.length > 0 ? (i(), s("ul", {
|
|
115
154
|
key: 1,
|
|
116
|
-
class:
|
|
155
|
+
class: r(["sidebar__list-fixed", { "sidebar-horizontal__list-fixed": n.horizontal }])
|
|
117
156
|
}, [
|
|
118
|
-
(
|
|
119
|
-
key:
|
|
120
|
-
class:
|
|
121
|
-
onClick: (
|
|
157
|
+
(i(!0), s(R, null, N(w.value, (o, a) => (i(), s("li", {
|
|
158
|
+
key: a,
|
|
159
|
+
class: r(["sidebar__item-fixed", { "sidebar-horizontal__item": n.horizontal }]),
|
|
160
|
+
onClick: (d) => z(d, o.itemId)
|
|
122
161
|
}, [
|
|
123
|
-
|
|
162
|
+
o.name ? (i(), m(k, {
|
|
124
163
|
key: 0,
|
|
125
|
-
text:
|
|
164
|
+
text: D(o.name),
|
|
126
165
|
position: "right",
|
|
127
166
|
offset: 8
|
|
128
167
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
|
|
131
|
-
src:
|
|
132
|
-
alt:
|
|
133
|
-
class:
|
|
134
|
-
"sidebar__image--active":
|
|
135
|
-
"sidebar-horizontal__image":
|
|
168
|
+
default: h(() => [
|
|
169
|
+
c("img", {
|
|
170
|
+
src: o.icon,
|
|
171
|
+
alt: o.name,
|
|
172
|
+
class: r(["sidebar__image", {
|
|
173
|
+
"sidebar__image--active": o.selected === !0,
|
|
174
|
+
"sidebar-horizontal__image": n.horizontal
|
|
136
175
|
}])
|
|
137
|
-
}, null, 10,
|
|
138
|
-
|
|
176
|
+
}, null, 10, tt),
|
|
177
|
+
e[0] || (e[0] = c("p", null, "Мои", -1))
|
|
139
178
|
]),
|
|
140
179
|
_: 2
|
|
141
|
-
}, 1032, ["text"])) :
|
|
142
|
-
|
|
143
|
-
], 10,
|
|
144
|
-
], 2)) :
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
class:
|
|
180
|
+
}, 1032, ["text"])) : l("", !0),
|
|
181
|
+
o.notificationCount ? (i(), s("span", et, F(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : l("", !0)
|
|
182
|
+
], 10, $))), 128))
|
|
183
|
+
], 2)) : l("", !0),
|
|
184
|
+
c("div", ot, [
|
|
185
|
+
c("ul", {
|
|
186
|
+
class: r(["sidebar__list", { "sidebar-horizontal__list": n.horizontal }])
|
|
148
187
|
}, [
|
|
149
|
-
(
|
|
150
|
-
key:
|
|
151
|
-
class:
|
|
152
|
-
onClick: (
|
|
188
|
+
(i(!0), s(R, null, N(Y.value, (o, a) => (i(), s("li", {
|
|
189
|
+
key: a,
|
|
190
|
+
class: r(["sidebar__item", { "sidebar-horizontal__item": n.horizontal }]),
|
|
191
|
+
onClick: (d) => z(d, o.itemId)
|
|
153
192
|
}, [
|
|
154
|
-
|
|
193
|
+
o.name ? (i(), m(k, {
|
|
155
194
|
key: 0,
|
|
156
|
-
text:
|
|
195
|
+
text: o.name,
|
|
157
196
|
position: "right",
|
|
158
197
|
offset: 8
|
|
159
198
|
}, {
|
|
160
|
-
default:
|
|
161
|
-
|
|
162
|
-
src:
|
|
163
|
-
alt:
|
|
164
|
-
class:
|
|
165
|
-
"sidebar__image--active":
|
|
166
|
-
"sidebar-horizontal__image":
|
|
199
|
+
default: h(() => [
|
|
200
|
+
c("img", {
|
|
201
|
+
src: o.icon,
|
|
202
|
+
alt: o.name,
|
|
203
|
+
class: r(["sidebar__image", {
|
|
204
|
+
"sidebar__image--active": o.selected === !0,
|
|
205
|
+
"sidebar-horizontal__image": n.horizontal
|
|
167
206
|
}])
|
|
168
|
-
}, null, 10,
|
|
207
|
+
}, null, 10, nt)
|
|
169
208
|
]),
|
|
170
209
|
_: 2
|
|
171
|
-
}, 1032, ["text"])) : (
|
|
210
|
+
}, 1032, ["text"])) : (i(), s("img", {
|
|
172
211
|
key: 1,
|
|
173
|
-
src:
|
|
212
|
+
src: o.icon,
|
|
174
213
|
alt: "icon",
|
|
175
|
-
class:
|
|
176
|
-
"sidebar__image--active":
|
|
177
|
-
"sidebar-horizontal__image":
|
|
214
|
+
class: r(["sidebar__image", {
|
|
215
|
+
"sidebar__image--active": o.selected === !0,
|
|
216
|
+
"sidebar-horizontal__image": n.horizontal
|
|
178
217
|
}])
|
|
179
|
-
}, null, 10,
|
|
180
|
-
|
|
181
|
-
], 10,
|
|
218
|
+
}, null, 10, st)),
|
|
219
|
+
o.notificationCount ? (i(), s("span", at, F(o.notificationCount > 99 ? "99+" : o.notificationCount), 1)) : l("", !0)
|
|
220
|
+
], 10, it))), 128))
|
|
182
221
|
], 2)
|
|
183
222
|
]),
|
|
184
|
-
|
|
185
|
-
|
|
223
|
+
n.showSettings ? (i(), s("div", rt, [
|
|
224
|
+
n.settingsButtonMode === "menu" ? (i(), m(X, {
|
|
186
225
|
key: 0,
|
|
187
|
-
actions:
|
|
226
|
+
actions: S.value,
|
|
188
227
|
mode: "click",
|
|
189
228
|
"menu-side": "top-right",
|
|
190
|
-
onClick:
|
|
191
|
-
onButtonClick:
|
|
229
|
+
onClick: G,
|
|
230
|
+
onButtonClick: P
|
|
192
231
|
}, {
|
|
193
|
-
default:
|
|
194
|
-
|
|
195
|
-
|
|
232
|
+
default: h(() => [
|
|
233
|
+
c("button", lt, [
|
|
234
|
+
L(V),
|
|
235
|
+
n.showSettingsIndicator ? (i(), s("span", ct, [
|
|
236
|
+
n.settingsIndicatorTooltip ? (i(), m(k, {
|
|
237
|
+
key: 0,
|
|
238
|
+
ref_key: "settingsIndicatorTooltipRef",
|
|
239
|
+
ref: p,
|
|
240
|
+
text: n.settingsIndicatorTooltip,
|
|
241
|
+
position: "top",
|
|
242
|
+
offset: 8,
|
|
243
|
+
"max-width": "460px",
|
|
244
|
+
"auto-show-duration": n.settingsIndicatorTooltipAutoShowMs
|
|
245
|
+
}, {
|
|
246
|
+
default: h(() => [...e[1] || (e[1] = [
|
|
247
|
+
c("span", { class: "sidebar__settings-indicator" }, null, -1)
|
|
248
|
+
])]),
|
|
249
|
+
_: 1
|
|
250
|
+
}, 8, ["text", "auto-show-duration"])) : (i(), s("span", ut))
|
|
251
|
+
])) : l("", !0)
|
|
196
252
|
])
|
|
197
253
|
]),
|
|
198
254
|
_: 1
|
|
199
|
-
}, 8, ["actions"])) : (
|
|
255
|
+
}, 8, ["actions"])) : (i(), s("button", {
|
|
200
256
|
key: 1,
|
|
201
257
|
class: "sidebar__settings-btn",
|
|
202
258
|
type: "button",
|
|
203
|
-
onClick:
|
|
259
|
+
onClick: U
|
|
204
260
|
}, [
|
|
205
|
-
|
|
261
|
+
L(V),
|
|
262
|
+
n.showSettingsIndicator ? (i(), s("span", dt, [
|
|
263
|
+
n.settingsIndicatorTooltip ? (i(), m(k, {
|
|
264
|
+
key: 0,
|
|
265
|
+
ref_key: "settingsIndicatorTooltipRef",
|
|
266
|
+
ref: p,
|
|
267
|
+
text: n.settingsIndicatorTooltip,
|
|
268
|
+
position: "top",
|
|
269
|
+
offset: 8,
|
|
270
|
+
"max-width": "460px",
|
|
271
|
+
"auto-show-duration": n.settingsIndicatorTooltipAutoShowMs
|
|
272
|
+
}, {
|
|
273
|
+
default: h(() => [...e[2] || (e[2] = [
|
|
274
|
+
c("span", { class: "sidebar__settings-indicator" }, null, -1)
|
|
275
|
+
])]),
|
|
276
|
+
_: 1
|
|
277
|
+
}, 8, ["text", "auto-show-duration"])) : (i(), s("span", ft))
|
|
278
|
+
])) : l("", !0)
|
|
206
279
|
]))
|
|
207
|
-
])) :
|
|
280
|
+
])) : l("", !0)
|
|
208
281
|
], 2));
|
|
209
282
|
}
|
|
210
|
-
},
|
|
283
|
+
}, kt = /* @__PURE__ */ Z(_t, [["__scopeId", "data-v-af365b7c"]]);
|
|
211
284
|
export {
|
|
212
|
-
|
|
285
|
+
kt as default
|
|
213
286
|
};
|