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