@mobilon-dev/chotto 0.3.68 → 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/3_compounds/ChatList/ChatList.vue.js +115 -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/3_compounds/ChatList/styles/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useChatListScroll as
|
|
7
|
-
import { useChatListSelection as
|
|
8
|
-
import { useChatListFilter as
|
|
9
|
-
import { useChatListActions as
|
|
1
|
+
import { ref as D, computed as u, onMounted as H, nextTick as O, onUpdated as P, onBeforeUnmount as W, createElementBlock as l, openBlock as s, renderSlot as M, createBlock as f, createCommentVNode as n, createElementVNode as c, createVNode as Q, unref as e, toDisplayString as h, createTextVNode as j, Fragment as v, renderList as k, normalizeStyle as R, Transition as Y, withCtx as G } from "vue";
|
|
2
|
+
import _ from "../../2_chatlist_elements/ChatItem/ChatItem.vue.js";
|
|
3
|
+
import J from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
|
|
4
|
+
import K from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
|
|
5
|
+
import X from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
6
|
+
import { useChatListScroll as Z } from "./composables/useChatListScroll.js";
|
|
7
|
+
import { useChatListSelection as tt } from "./composables/useChatListSelection.js";
|
|
8
|
+
import { useChatListFilter as et } from "./composables/useChatListFilter.js";
|
|
9
|
+
import { useChatListActions as at } from "./composables/useChatListActions.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import st from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
12
|
+
const ot = { class: "chat-list" }, it = {
|
|
13
13
|
key: 2,
|
|
14
14
|
class: "chat-list__search-indicator"
|
|
15
|
-
},
|
|
15
|
+
}, lt = { class: "chat-list__search-content" }, nt = { class: "chat-list__search-text" }, rt = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "chat-list__search-progress"
|
|
18
|
-
},
|
|
18
|
+
}, ct = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "chat-list__search-query"
|
|
21
|
-
},
|
|
21
|
+
}, dt = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "chat-list__search-stats"
|
|
24
|
-
},
|
|
24
|
+
}, ut = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "chat-list__fixed-items-top"
|
|
27
|
-
},
|
|
27
|
+
}, ht = { class: "chat-list__placeholder" }, gt = { class: "chat-list__placeholder-title" }, ft = {
|
|
28
28
|
key: 0,
|
|
29
|
-
class: "chat-
|
|
30
|
-
},
|
|
29
|
+
class: "chat-list__placeholder-hint"
|
|
30
|
+
}, mt = {
|
|
31
31
|
key: 4,
|
|
32
32
|
class: "chat-list__fixed-items-bottom"
|
|
33
|
-
},
|
|
33
|
+
}, yt = {
|
|
34
34
|
__name: "ChatList",
|
|
35
35
|
props: {
|
|
36
36
|
chats: {
|
|
@@ -81,7 +81,7 @@ const O = { class: "chat-list" }, R = {
|
|
|
81
81
|
contextMenuTrigger: {
|
|
82
82
|
type: String,
|
|
83
83
|
default: "hover",
|
|
84
|
-
validator: (
|
|
84
|
+
validator: (a) => ["hover", "rightClick"].includes(a)
|
|
85
85
|
},
|
|
86
86
|
placeholderTitle: {
|
|
87
87
|
type: String,
|
|
@@ -93,121 +93,142 @@ const O = { class: "chat-list" }, R = {
|
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
emits: ["select", "action", "loadMoreChats", "expand", "tab-click", "search", "clear-search"],
|
|
96
|
-
setup(
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
} =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
96
|
+
setup(a, { emit: I }) {
|
|
97
|
+
const i = a, g = I, y = D(), T = D(0), C = u(() => i.chats), m = () => {
|
|
98
|
+
var r;
|
|
99
|
+
T.value = ((r = y.value) == null ? void 0 : r.offsetTop) ?? 0;
|
|
100
|
+
}, $ = u(() => ({
|
|
101
|
+
transform: `translateY(${-(T.value / 2)}px)`
|
|
102
|
+
})), b = u(() => {
|
|
103
|
+
var r, o, t;
|
|
104
|
+
return ((r = i.searchQuery) == null ? void 0 : r.trim()) || ((o = i.filterQuery) == null ? void 0 : o.trim()) || ((t = V.value) == null ? void 0 : t.trim()) || "";
|
|
105
|
+
}), w = u(
|
|
106
|
+
() => b.value.length > 0 && !i.isSearching
|
|
107
|
+
), N = u(() => w.value ? `Не нашли чат по запросу "${b.value}"` : i.placeholderTitle), L = u(() => w.value ? "" : i.placeholderHint), {
|
|
108
|
+
isShowButton: U,
|
|
109
|
+
scrollToTopForce: E,
|
|
110
|
+
scrollCheck: B,
|
|
111
|
+
startScrollWatch: F,
|
|
112
|
+
stopScrollWatch: A
|
|
113
|
+
} = Z({ refChatList: y, chats: C, emit: g }), {
|
|
114
|
+
selectChat: p
|
|
115
|
+
} = tt({ chats: C, emit: g }), {
|
|
116
|
+
filter: V,
|
|
117
|
+
getSortedAndFilteredChats: d,
|
|
118
|
+
getFilter: q
|
|
119
|
+
} = et({ props: i, emit: g }), {
|
|
120
|
+
expandChat: S,
|
|
121
|
+
action: x,
|
|
122
|
+
handleTabClick: z
|
|
123
|
+
} = at({ emit: g });
|
|
124
|
+
return H(async () => {
|
|
125
|
+
await O(), m(), window.addEventListener("resize", m);
|
|
126
|
+
}), P(() => {
|
|
127
|
+
m();
|
|
128
|
+
}), W(() => {
|
|
129
|
+
window.removeEventListener("resize", m);
|
|
130
|
+
}), (r, o) => (s(), l("div", ot, [
|
|
131
|
+
M(r.$slots, "header", {}, void 0, !0),
|
|
132
|
+
M(r.$slots, "sidebar", {}, void 0, !0),
|
|
133
|
+
a.filterEnabled ? (s(), f(J, {
|
|
117
134
|
key: 0,
|
|
118
135
|
class: "chat-list__filter",
|
|
119
|
-
onUpdate: e(
|
|
136
|
+
onUpdate: e(q)
|
|
120
137
|
}, null, 8, ["onUpdate"])) : n("", !0),
|
|
121
|
-
|
|
138
|
+
a.dialogTabs && a.dialogTabs.length > 0 ? (s(), f(K, {
|
|
122
139
|
key: 1,
|
|
123
|
-
tabs:
|
|
124
|
-
onTabClick: e(
|
|
140
|
+
tabs: a.dialogTabs,
|
|
141
|
+
onTabClick: e(z)
|
|
125
142
|
}, null, 8, ["tabs", "onTabClick"])) : n("", !0),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
143
|
+
a.isSearching || a.searchQuery ? (s(), l("div", it, [
|
|
144
|
+
c("div", lt, [
|
|
145
|
+
c("div", nt, [
|
|
146
|
+
a.isSearching ? (s(), l("span", rt, h(a.searchProgress || "Поиск..."), 1)) : (s(), l("span", ct, [
|
|
147
|
+
j(' Поиск "' + h(a.searchQuery) + '" завершён ', 1),
|
|
148
|
+
a.searchStats.loaded > 0 ? (s(), l("span", dt, " (" + h(a.searchStats.loaded) + " " + h(a.searchStats.total !== "?" ? `из ${a.searchStats.total}` : "") + ") ", 1)) : n("", !0)
|
|
132
149
|
]))
|
|
133
150
|
]),
|
|
134
|
-
|
|
151
|
+
a.searchQuery ? (s(), l("button", {
|
|
135
152
|
key: 0,
|
|
136
153
|
class: "chat-list__search-clear",
|
|
137
154
|
title: "Очистить поиск",
|
|
138
|
-
onClick:
|
|
139
|
-
}, [...
|
|
140
|
-
|
|
155
|
+
onClick: o[0] || (o[0] = (t) => g("clear-search"))
|
|
156
|
+
}, [...o[5] || (o[5] = [
|
|
157
|
+
c("i", { class: "pi pi-times" }, null, -1)
|
|
141
158
|
])])) : n("", !0)
|
|
142
159
|
])
|
|
143
160
|
])) : n("", !0),
|
|
144
|
-
!
|
|
145
|
-
(
|
|
161
|
+
!i.isLoading && e(d)().filter((t) => t.isFixedTop).length > 0 ? (s(), l("div", ut, [
|
|
162
|
+
(s(!0), l(v, null, k(e(d)().filter((t) => t.isFixedTop), (t) => (s(), f(_, {
|
|
146
163
|
key: t.chatId,
|
|
147
164
|
class: "chat-list__item",
|
|
148
165
|
chat: t,
|
|
149
|
-
"show-dialogs":
|
|
150
|
-
"context-menu-trigger":
|
|
151
|
-
onSelect: e(
|
|
152
|
-
onExpand: e(
|
|
153
|
-
onAction: e(
|
|
166
|
+
"show-dialogs": a.showDialogs,
|
|
167
|
+
"context-menu-trigger": i.contextMenuTrigger,
|
|
168
|
+
onSelect: e(p),
|
|
169
|
+
onExpand: e(S),
|
|
170
|
+
onAction: e(x)
|
|
154
171
|
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
155
172
|
])) : n("", !0),
|
|
156
|
-
|
|
173
|
+
c("div", {
|
|
157
174
|
ref_key: "refChatList",
|
|
158
|
-
ref:
|
|
175
|
+
ref: y,
|
|
159
176
|
class: "chat-list__items",
|
|
160
|
-
onScroll:
|
|
161
|
-
onMousedown:
|
|
162
|
-
onMouseup:
|
|
177
|
+
onScroll: o[1] || (o[1] = (...t) => e(B) && e(B)(...t)),
|
|
178
|
+
onMousedown: o[2] || (o[2] = (...t) => e(F) && e(F)(...t)),
|
|
179
|
+
onMouseup: o[3] || (o[3] = (...t) => e(A) && e(A)(...t))
|
|
163
180
|
}, [
|
|
164
|
-
|
|
181
|
+
Q(X, {
|
|
165
182
|
class: "chat-list__loading-indicator",
|
|
166
|
-
"is-loading":
|
|
183
|
+
"is-loading": i.isLoading
|
|
167
184
|
}, null, 8, ["is-loading"]),
|
|
168
|
-
!
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
!i.isLoading && e(d)().length === 0 ? (s(), l("div", {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "chat-list__no-data",
|
|
188
|
+
style: R($.value)
|
|
189
|
+
}, [
|
|
190
|
+
c("div", ht, [
|
|
191
|
+
c("p", gt, h(N.value), 1),
|
|
192
|
+
L.value ? (s(), l("p", ft, h(L.value), 1)) : n("", !0)
|
|
172
193
|
])
|
|
173
|
-
])) : (
|
|
194
|
+
], 4)) : (s(!0), l(v, { key: 1 }, k(e(d)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (s(), f(_, {
|
|
174
195
|
key: t.chatId,
|
|
175
196
|
class: "chat-list__item",
|
|
176
197
|
chat: t,
|
|
177
|
-
"show-dialogs":
|
|
178
|
-
"context-menu-trigger":
|
|
179
|
-
onSelect: e(
|
|
180
|
-
onExpand: e(
|
|
181
|
-
onAction: e(
|
|
198
|
+
"show-dialogs": a.showDialogs,
|
|
199
|
+
"context-menu-trigger": i.contextMenuTrigger,
|
|
200
|
+
onSelect: e(p),
|
|
201
|
+
onExpand: e(S),
|
|
202
|
+
onAction: e(x)
|
|
182
203
|
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
183
204
|
], 544),
|
|
184
|
-
!
|
|
185
|
-
(
|
|
205
|
+
!i.isLoading && e(d)().filter((t) => t.isFixedBottom).length > 0 ? (s(), l("div", mt, [
|
|
206
|
+
(s(!0), l(v, null, k(e(d)().filter((t) => t.isFixedBottom), (t) => (s(), f(_, {
|
|
186
207
|
key: t.chatId,
|
|
187
208
|
class: "chat-list__item",
|
|
188
209
|
chat: t,
|
|
189
|
-
"show-dialogs":
|
|
190
|
-
"context-menu-trigger":
|
|
191
|
-
onSelect: e(
|
|
192
|
-
onExpand: e(
|
|
193
|
-
onAction: e(
|
|
210
|
+
"show-dialogs": a.showDialogs,
|
|
211
|
+
"context-menu-trigger": i.contextMenuTrigger,
|
|
212
|
+
onSelect: e(p),
|
|
213
|
+
onExpand: e(S),
|
|
214
|
+
onAction: e(x)
|
|
194
215
|
}, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
|
|
195
216
|
])) : n("", !0),
|
|
196
|
-
|
|
197
|
-
default:
|
|
198
|
-
e(
|
|
217
|
+
Q(Y, null, {
|
|
218
|
+
default: G(() => [
|
|
219
|
+
e(U) ? (s(), l("button", {
|
|
199
220
|
key: 0,
|
|
200
221
|
class: "chat-list__button-up",
|
|
201
|
-
onClick:
|
|
202
|
-
}, [...
|
|
203
|
-
|
|
222
|
+
onClick: o[4] || (o[4] = (...t) => e(E) && e(E)(...t))
|
|
223
|
+
}, [...o[6] || (o[6] = [
|
|
224
|
+
c("span", { class: "pi pi-angle-up chat-list__icon-down" }, null, -1)
|
|
204
225
|
])])) : n("", !0)
|
|
205
226
|
]),
|
|
206
227
|
_: 1
|
|
207
228
|
})
|
|
208
229
|
]));
|
|
209
230
|
}
|
|
210
|
-
},
|
|
231
|
+
}, Et = /* @__PURE__ */ st(yt, [["__scopeId", "data-v-20eeef36"]]);
|
|
211
232
|
export {
|
|
212
|
-
|
|
233
|
+
Et as default
|
|
213
234
|
};
|