@mobilon-dev/chotto 0.3.55 → 0.3.56

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.
@@ -1,18 +1,18 @@
1
- import { ref as I, computed as M, createElementBlock as i, openBlock as a, renderSlot as L, createBlock as h, createCommentVNode as n, createElementVNode as r, createVNode as w, unref as e, toDisplayString as u, createTextVNode as D, Fragment as y, renderList as p, Transition as Q, withCtx as N } from "vue";
1
+ import { ref as I, computed as M, createElementBlock as o, openBlock as a, renderSlot as L, createBlock as u, createCommentVNode as n, createElementVNode as r, createVNode as w, unref as e, toDisplayString as d, createTextVNode as D, Fragment as y, renderList as p, Transition as Q, withCtx as N } from "vue";
2
2
  import x from "../../2_chatlist_elements/ChatItem/ChatItem.vue.js";
3
3
  import V from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
4
4
  import $ from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
5
5
  import q from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
6
- import { useChatListScroll as P } from "./composables/useChatListScroll.js";
7
- import { useChatListSelection as U } from "./composables/useChatListSelection.js";
8
- import { useChatListFilter as W } from "./composables/useChatListFilter.js";
9
- import { useChatListActions as j } from "./composables/useChatListActions.js";
6
+ import { useChatListScroll as H } from "./composables/useChatListScroll.js";
7
+ import { useChatListSelection as P } from "./composables/useChatListSelection.js";
8
+ import { useChatListFilter as U } from "./composables/useChatListFilter.js";
9
+ import { useChatListActions as W } from "./composables/useChatListActions.js";
10
10
  /* empty css */
11
- import O from "../../../_virtual/_plugin-vue_export-helper.js";
12
- const R = { class: "chat-list" }, z = {
11
+ import j from "../../../_virtual/_plugin-vue_export-helper.js";
12
+ const O = { class: "chat-list" }, R = {
13
13
  key: 2,
14
14
  class: "chat-list__search-indicator"
15
- }, G = { class: "chat-list__search-content" }, H = { class: "chat-list__search-text" }, J = {
15
+ }, z = { class: "chat-list__search-content" }, G = { class: "chat-list__search-text" }, J = {
16
16
  key: 0,
17
17
  class: "chat-list__search-progress"
18
18
  }, K = {
@@ -27,10 +27,10 @@ const R = { class: "chat-list" }, z = {
27
27
  }, Z = {
28
28
  key: 0,
29
29
  class: "chat-list__no-data"
30
- }, tt = {
30
+ }, tt = { class: "chat-list__placeholder" }, et = { class: "chat-list__placeholder-title" }, st = { class: "chat-list__placeholder-hint" }, at = {
31
31
  key: 4,
32
32
  class: "chat-list__fixed-items-bottom"
33
- }, et = {
33
+ }, it = {
34
34
  __name: "ChatList",
35
35
  props: {
36
36
  chats: {
@@ -82,59 +82,67 @@ const R = { class: "chat-list" }, z = {
82
82
  type: String,
83
83
  default: "hover",
84
84
  validator: (s) => ["hover", "rightClick"].includes(s)
85
+ },
86
+ placeholderTitle: {
87
+ type: String,
88
+ default: "Нет контактных данных, чтобы начать чат"
89
+ },
90
+ placeholderHint: {
91
+ type: String,
92
+ default: "Добавьте номер телефона и Имя в карточку контакта"
85
93
  }
86
94
  },
87
95
  emits: ["select", "action", "loadMoreChats", "expand", "tab-click", "search", "clear-search"],
88
96
  setup(s, { emit: F }) {
89
- const l = s, d = F, S = I(), k = M(() => l.chats), {
97
+ const l = s, h = F, S = I(), k = M(() => l.chats), {
90
98
  isShowButton: B,
91
- scrollToTopForce: C,
92
- scrollCheck: _,
93
- startScrollWatch: b,
94
- stopScrollWatch: T
95
- } = P({ refChatList: S, chats: k, emit: d }), {
99
+ scrollToTopForce: _,
100
+ scrollCheck: C,
101
+ startScrollWatch: T,
102
+ stopScrollWatch: b
103
+ } = H({ refChatList: S, chats: k, emit: h }), {
96
104
  selectChat: g
97
- } = U({ chats: k, emit: d }), {
105
+ } = P({ chats: k, emit: h }), {
98
106
  getSortedAndFilteredChats: c,
99
107
  getFilter: A
100
- } = W({ props: l, emit: d }), {
108
+ } = U({ props: l, emit: h }), {
101
109
  expandChat: m,
102
110
  action: f,
103
111
  handleTabClick: E
104
- } = j({ emit: d });
105
- return (v, o) => (a(), i("div", R, [
112
+ } = W({ emit: h });
113
+ return (v, i) => (a(), o("div", O, [
106
114
  L(v.$slots, "header", {}, void 0, !0),
107
115
  L(v.$slots, "sidebar", {}, void 0, !0),
108
- s.filterEnabled ? (a(), h(V, {
116
+ s.filterEnabled ? (a(), u(V, {
109
117
  key: 0,
110
118
  class: "chat-list__filter",
111
119
  onUpdate: e(A)
112
120
  }, null, 8, ["onUpdate"])) : n("", !0),
113
- s.dialogTabs && s.dialogTabs.length > 0 ? (a(), h($, {
121
+ s.dialogTabs && s.dialogTabs.length > 0 ? (a(), u($, {
114
122
  key: 1,
115
123
  tabs: s.dialogTabs,
116
124
  onTabClick: e(E)
117
125
  }, null, 8, ["tabs", "onTabClick"])) : n("", !0),
118
- s.isSearching || s.searchQuery ? (a(), i("div", z, [
119
- r("div", G, [
120
- r("div", H, [
121
- s.isSearching ? (a(), i("span", J, u(s.searchProgress || "Поиск..."), 1)) : (a(), i("span", K, [
122
- D(' Поиск "' + u(s.searchQuery) + '" завершён ', 1),
123
- s.searchStats.loaded > 0 ? (a(), i("span", X, " (" + u(s.searchStats.loaded) + " " + u(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
126
+ s.isSearching || s.searchQuery ? (a(), o("div", R, [
127
+ r("div", z, [
128
+ r("div", G, [
129
+ s.isSearching ? (a(), o("span", J, d(s.searchProgress || "Поиск..."), 1)) : (a(), o("span", K, [
130
+ D(' Поиск "' + d(s.searchQuery) + '" завершён ', 1),
131
+ s.searchStats.loaded > 0 ? (a(), o("span", X, " (" + d(s.searchStats.loaded) + " " + d(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
124
132
  ]))
125
133
  ]),
126
- s.searchQuery ? (a(), i("button", {
134
+ s.searchQuery ? (a(), o("button", {
127
135
  key: 0,
128
136
  class: "chat-list__search-clear",
129
137
  title: "Очистить поиск",
130
- onClick: o[0] || (o[0] = (t) => d("clear-search"))
131
- }, [...o[5] || (o[5] = [
138
+ onClick: i[0] || (i[0] = (t) => h("clear-search"))
139
+ }, [...i[5] || (i[5] = [
132
140
  r("i", { class: "pi pi-times" }, null, -1)
133
141
  ])])) : n("", !0)
134
142
  ])
135
143
  ])) : n("", !0),
136
- !l.isLoading && e(c)().filter((t) => t.isFixedTop).length > 0 ? (a(), i("div", Y, [
137
- (a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedTop), (t) => (a(), h(x, {
144
+ !l.isLoading && e(c)().filter((t) => t.isFixedTop).length > 0 ? (a(), o("div", Y, [
145
+ (a(!0), o(y, null, p(e(c)().filter((t) => t.isFixedTop), (t) => (a(), u(x, {
138
146
  key: t.chatId,
139
147
  class: "chat-list__item",
140
148
  chat: t,
@@ -149,20 +157,20 @@ const R = { class: "chat-list" }, z = {
149
157
  ref_key: "refChatList",
150
158
  ref: S,
151
159
  class: "chat-list__items",
152
- onScroll: o[1] || (o[1] = (...t) => e(_) && e(_)(...t)),
153
- onMousedown: o[2] || (o[2] = (...t) => e(b) && e(b)(...t)),
154
- onMouseup: o[3] || (o[3] = (...t) => e(T) && e(T)(...t))
160
+ onScroll: i[1] || (i[1] = (...t) => e(C) && e(C)(...t)),
161
+ onMousedown: i[2] || (i[2] = (...t) => e(T) && e(T)(...t)),
162
+ onMouseup: i[3] || (i[3] = (...t) => e(b) && e(b)(...t))
155
163
  }, [
156
164
  w(q, {
157
165
  class: "chat-list__loading-indicator",
158
166
  "is-loading": l.isLoading
159
167
  }, null, 8, ["is-loading"]),
160
- !l.isLoading && e(c)().length === 0 ? (a(), i("div", Z, [...o[6] || (o[6] = [
161
- r("div", { class: "chat-list__placeholder" }, [
162
- r("p", { class: "chat-list__placeholder-title" }, " Нет контактных данных, чтобы начать чат "),
163
- r("p", { class: "chat-list__placeholder-hint" }, " Добавьте номер телефона или имя Telegram в карточку контакта ")
164
- ], -1)
165
- ])])) : (a(!0), i(y, { key: 1 }, p(e(c)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), h(x, {
168
+ !l.isLoading && e(c)().length === 0 ? (a(), o("div", Z, [
169
+ r("div", tt, [
170
+ r("p", et, d(s.placeholderTitle), 1),
171
+ r("p", st, d(s.placeholderHint), 1)
172
+ ])
173
+ ])) : (a(!0), o(y, { key: 1 }, p(e(c)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), u(x, {
166
174
  key: t.chatId,
167
175
  class: "chat-list__item",
168
176
  chat: t,
@@ -173,8 +181,8 @@ const R = { class: "chat-list" }, z = {
173
181
  onAction: e(f)
174
182
  }, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
175
183
  ], 544),
176
- !l.isLoading && e(c)().filter((t) => t.isFixedBottom).length > 0 ? (a(), i("div", tt, [
177
- (a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedBottom), (t) => (a(), h(x, {
184
+ !l.isLoading && e(c)().filter((t) => t.isFixedBottom).length > 0 ? (a(), o("div", at, [
185
+ (a(!0), o(y, null, p(e(c)().filter((t) => t.isFixedBottom), (t) => (a(), u(x, {
178
186
  key: t.chatId,
179
187
  class: "chat-list__item",
180
188
  chat: t,
@@ -187,11 +195,11 @@ const R = { class: "chat-list" }, z = {
187
195
  ])) : n("", !0),
188
196
  w(Q, null, {
189
197
  default: N(() => [
190
- e(B) ? (a(), i("button", {
198
+ e(B) ? (a(), o("button", {
191
199
  key: 0,
192
200
  class: "chat-list__button-up",
193
- onClick: o[4] || (o[4] = (...t) => e(C) && e(C)(...t))
194
- }, [...o[7] || (o[7] = [
201
+ onClick: i[4] || (i[4] = (...t) => e(_) && e(_)(...t))
202
+ }, [...i[6] || (i[6] = [
195
203
  r("span", { class: "pi pi-angle-up chat-list__icon-down" }, null, -1)
196
204
  ])])) : n("", !0)
197
205
  ]),
@@ -199,7 +207,7 @@ const R = { class: "chat-list" }, z = {
199
207
  })
200
208
  ]));
201
209
  }
202
- }, gt = /* @__PURE__ */ O(et, [["__scopeId", "data-v-60e0e8be"]]);
210
+ }, yt = /* @__PURE__ */ j(it, [["__scopeId", "data-v-53a4e79e"]]);
203
211
  export {
204
- gt as default
212
+ yt as default
205
213
  };
@@ -17,6 +17,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
17
17
  isSearching: boolean;
18
18
  searchProgress: string;
19
19
  searchStats: Record<string, any>;
20
+ placeholderTitle: string;
21
+ placeholderHint: string;
20
22
  $props: {
21
23
  readonly chats?: unknown[] | undefined;
22
24
  readonly searchQuery?: string | undefined;
@@ -30,6 +32,8 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
30
32
  readonly isSearching?: boolean | undefined;
31
33
  readonly searchProgress?: string | undefined;
32
34
  readonly searchStats?: Record<string, any> | undefined;
35
+ readonly placeholderTitle?: string | undefined;
36
+ readonly placeholderHint?: string | undefined;
33
37
  };
34
38
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
39
  type __VLS_Slots = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilon-dev/chotto",
3
- "version": "0.3.55",
3
+ "version": "0.3.56",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",