@mobilon-dev/chotto 0.3.62 → 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/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/SideBar/SideBar.vue.d.ts +3 -1
- package/package.json +1 -1
|
@@ -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
|
};
|