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