@uzum-tech/ui 1.9.0 → 1.9.1
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/index.js +586 -265
- package/dist/index.prod.js +2 -2
- package/es/chat/index.d.ts +1 -1
- package/es/chat/src/Chat.d.ts +233 -11
- package/es/chat/src/Chat.js +73 -22
- package/es/chat/src/ChatParts/ChatAttachment.js +14 -12
- package/es/chat/src/ChatParts/MainArea.d.ts +1 -0
- package/es/chat/src/ChatParts/MainArea.js +95 -57
- package/es/chat/src/ChatParts/Sidebar.d.ts +920 -0
- package/es/chat/src/ChatParts/Sidebar.js +63 -12
- package/es/chat/src/interface.d.ts +24 -3
- package/es/chat/src/styles/index.cssr.js +13 -2
- package/es/date-picker/src/DatePicker.d.ts +1308 -43
- package/es/date-picker/src/DatePicker.js +54 -29
- package/es/date-picker/src/interface.d.ts +1 -0
- package/es/date-picker/src/panel/date.d.ts +141 -0
- package/es/date-picker/src/panel/daterange.d.ts +141 -0
- package/es/date-picker/src/panel/datetime.d.ts +141 -0
- package/es/date-picker/src/panel/datetimerange.d.ts +141 -0
- package/es/date-picker/src/panel/panelMonth.d.ts +282 -0
- package/es/date-picker/src/panel/panelMonthContent.d.ts +141 -0
- package/es/date-picker/src/panel/panelYear.d.ts +282 -0
- package/es/date-picker/src/panel/panelYearContent.d.ts +141 -0
- package/es/date-picker/src/panel/use-calendar.d.ts +141 -0
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
- package/es/date-picker/src/panel/use-panel-common.d.ts +141 -0
- package/es/date-picker/styles/dark.js +3 -1
- package/es/date-picker/styles/light.d.ts +123 -0
- package/es/date-picker/styles/light.js +3 -1
- package/es/descriptions/src/Descriptions.d.ts +30 -0
- package/es/descriptions/src/Descriptions.js +18 -10
- package/es/locales/common/arDZ.js +2 -0
- package/es/locales/common/deDE.js +2 -0
- package/es/locales/common/enGB.js +2 -0
- package/es/locales/common/enUS.d.ts +2 -0
- package/es/locales/common/enUS.js +2 -0
- package/es/locales/common/eo.js +2 -0
- package/es/locales/common/esAR.js +2 -0
- package/es/locales/common/faIR.js +2 -0
- package/es/locales/common/frFR.js +2 -0
- package/es/locales/common/idID.js +2 -0
- package/es/locales/common/itIT.js +2 -0
- package/es/locales/common/jaJP.js +2 -0
- package/es/locales/common/koKR.js +2 -0
- package/es/locales/common/nbNO.js +2 -0
- package/es/locales/common/nlNL.js +2 -0
- package/es/locales/common/plPL.js +2 -0
- package/es/locales/common/ptBR.js +2 -0
- package/es/locales/common/ruRU.js +2 -0
- package/es/locales/common/skSK.js +2 -0
- package/es/locales/common/svSE.js +2 -0
- package/es/locales/common/thTH.js +2 -0
- package/es/locales/common/trTR.js +2 -0
- package/es/locales/common/ukUA.js +2 -0
- package/es/locales/common/viVN.js +2 -0
- package/es/locales/common/zhCN.js +2 -0
- package/es/locales/common/zhTW.js +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/chat/index.d.ts +1 -1
- package/lib/chat/src/Chat.d.ts +233 -11
- package/lib/chat/src/Chat.js +73 -22
- package/lib/chat/src/ChatParts/ChatAttachment.js +14 -12
- package/lib/chat/src/ChatParts/MainArea.d.ts +1 -0
- package/lib/chat/src/ChatParts/MainArea.js +94 -56
- package/lib/chat/src/ChatParts/Sidebar.d.ts +920 -0
- package/lib/chat/src/ChatParts/Sidebar.js +62 -11
- package/lib/chat/src/interface.d.ts +24 -3
- package/lib/chat/src/styles/index.cssr.js +13 -2
- package/lib/date-picker/src/DatePicker.d.ts +1308 -43
- package/lib/date-picker/src/DatePicker.js +53 -28
- package/lib/date-picker/src/interface.d.ts +1 -0
- package/lib/date-picker/src/panel/date.d.ts +141 -0
- package/lib/date-picker/src/panel/daterange.d.ts +141 -0
- package/lib/date-picker/src/panel/datetime.d.ts +141 -0
- package/lib/date-picker/src/panel/datetimerange.d.ts +141 -0
- package/lib/date-picker/src/panel/panelMonth.d.ts +282 -0
- package/lib/date-picker/src/panel/panelMonthContent.d.ts +141 -0
- package/lib/date-picker/src/panel/panelYear.d.ts +282 -0
- package/lib/date-picker/src/panel/panelYearContent.d.ts +141 -0
- package/lib/date-picker/src/panel/use-calendar.d.ts +141 -0
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
- package/lib/date-picker/src/panel/use-panel-common.d.ts +141 -0
- package/lib/date-picker/styles/dark.js +3 -1
- package/lib/date-picker/styles/light.d.ts +123 -0
- package/lib/date-picker/styles/light.js +3 -1
- package/lib/descriptions/src/Descriptions.d.ts +30 -0
- package/lib/descriptions/src/Descriptions.js +18 -10
- package/lib/locales/common/arDZ.js +2 -0
- package/lib/locales/common/deDE.js +2 -0
- package/lib/locales/common/enGB.js +2 -0
- package/lib/locales/common/enUS.d.ts +2 -0
- package/lib/locales/common/enUS.js +2 -0
- package/lib/locales/common/eo.js +2 -0
- package/lib/locales/common/esAR.js +2 -0
- package/lib/locales/common/faIR.js +2 -0
- package/lib/locales/common/frFR.js +2 -0
- package/lib/locales/common/idID.js +2 -0
- package/lib/locales/common/itIT.js +2 -0
- package/lib/locales/common/jaJP.js +2 -0
- package/lib/locales/common/koKR.js +2 -0
- package/lib/locales/common/nbNO.js +2 -0
- package/lib/locales/common/nlNL.js +2 -0
- package/lib/locales/common/plPL.js +2 -0
- package/lib/locales/common/ptBR.js +2 -0
- package/lib/locales/common/ruRU.js +2 -0
- package/lib/locales/common/skSK.js +2 -0
- package/lib/locales/common/svSE.js +2 -0
- package/lib/locales/common/thTH.js +2 -0
- package/lib/locales/common/trTR.js +2 -0
- package/lib/locales/common/ukUA.js +2 -0
- package/lib/locales/common/viVN.js +2 -0
- package/lib/locales/common/zhCN.js +2 -0
- package/lib/locales/common/zhTW.js +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/web-types.json +95 -4
|
@@ -7,30 +7,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { h, defineComponent, inject, computed, ref, watch, nextTick,
|
|
10
|
+
import { h, defineComponent, inject, computed, ref, watch, nextTick, Fragment } from 'vue';
|
|
11
11
|
import { MessageStatus, ChatMessageType, chatInjectionKey } from '../interface';
|
|
12
12
|
import { UInput } from '../../../input';
|
|
13
13
|
import { UButton } from '../../../button';
|
|
14
14
|
import { UIcon } from '../../../icon';
|
|
15
15
|
import { UScrollbar } from '../../../scrollbar';
|
|
16
|
+
import { UTooltip } from '../../../tooltip';
|
|
16
17
|
import { UUpload, UUploadTrigger } from '../../../upload';
|
|
17
18
|
import { UFlex } from '../../../flex';
|
|
18
19
|
import { resolveSlot } from '../../../_utils';
|
|
19
20
|
import { UText } from '../../../typography';
|
|
20
21
|
import UChatMessages from '../ChatMessages';
|
|
21
22
|
import { ArrowHookUpRight, PersonNote, AttachIcon } from '../../../_internal/icons';
|
|
22
|
-
const SCROLL_DELAY = 50;
|
|
23
23
|
const SENDING_DELAY = 100;
|
|
24
24
|
export default defineComponent({
|
|
25
25
|
name: 'ChatMainArea',
|
|
26
26
|
setup(_, { slots }) {
|
|
27
|
-
const { mergedClsPrefixRef, mergedThemeRef, selectedChatRef, messagesRef, typingChatIdsRef, messagesLoadingRef, messagesLoadingCountRef, headerButtonPropsRef, headerIconPropsRef, messageUploadPropsRef, footerInputPropsRef, footerButtonPropsRef, footerUploadPropsRef, footerIconPropsRef, inputPlaceholderRef, retryTextRef, typingTextRef, closeButtonTextRef, unreadNotificationTextRef, notificationsShownSetRef, unreadCountsBeforeReadRef, markNotificationShown, handleMessageSend, handleMessageRetry, onChatClose, onChatShare, onUserProfile
|
|
27
|
+
const { mergedClsPrefixRef, mergedThemeRef, selectedChatRef, messagesRef, typingChatIdsRef, messagesLoadingRef, messagesLoadingCountRef, headerButtonPropsRef, headerIconPropsRef, headerShareButtonPropsRef, headerProfileButtonPropsRef, headerCloseButtonPropsRef, headerShareIconPropsRef, headerProfileIconPropsRef, messageUploadPropsRef, footerInputPropsRef, footerButtonPropsRef, footerUploadPropsRef, footerIconPropsRef, inputPlaceholderRef, retryTextRef, typingTextRef, closeButtonTextRef, shareButtonTooltipRef, profileButtonTooltipRef, unreadNotificationTextRef, notificationsShownSetRef, unreadCountsBeforeReadRef, markNotificationShown, handleMessageSend, handleMessageRetry, handleFooterInputChange, onChatClose, onChatShare, onUserProfile, onMessagesScrollToTop, onMessagesScrollToBottom
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
29
|
} = inject(chatInjectionKey);
|
|
30
30
|
const messagesBodyRef = ref();
|
|
31
31
|
const inputRef = ref();
|
|
32
32
|
const inputValue = ref('');
|
|
33
33
|
const attachmentFileList = ref([]);
|
|
34
|
+
const lastScrollTop = ref(0);
|
|
35
|
+
const scrollTopFired = ref(false);
|
|
36
|
+
const scrollBottomFired = ref(false);
|
|
34
37
|
const unreadMessagesCount = computed(() => {
|
|
35
38
|
if (!messagesRef.value)
|
|
36
39
|
return 0;
|
|
@@ -41,12 +44,17 @@ export default defineComponent({
|
|
|
41
44
|
const unreadCountOnOpen = ref(0);
|
|
42
45
|
const chatInputs = ref({});
|
|
43
46
|
const lastMessageId = ref(null);
|
|
47
|
+
const shouldScrollOnLoad = ref(false);
|
|
44
48
|
watch(selectedChatRef, (newChat, oldChat) => {
|
|
45
49
|
if (newChat && newChat.id !== (oldChat === null || oldChat === void 0 ? void 0 : oldChat.id)) {
|
|
46
50
|
inputValue.value = chatInputs.value[newChat.id] || '';
|
|
47
51
|
const unreadBeforeRead = unreadCountsBeforeReadRef.value[newChat.id] || 0;
|
|
48
52
|
unreadCountOnOpen.value = unreadBeforeRead;
|
|
49
53
|
lastMessageId.value = null;
|
|
54
|
+
lastScrollTop.value = 0;
|
|
55
|
+
scrollTopFired.value = false;
|
|
56
|
+
scrollBottomFired.value = false;
|
|
57
|
+
shouldScrollOnLoad.value = true;
|
|
50
58
|
if (unreadBeforeRead > 0 &&
|
|
51
59
|
!notificationsShownSetRef.value.has(newChat.id)) {
|
|
52
60
|
hasUnreadMessages.value = true;
|
|
@@ -57,12 +65,6 @@ export default defineComponent({
|
|
|
57
65
|
hasUnreadMessages.value = false;
|
|
58
66
|
showNotificationManually.value = false;
|
|
59
67
|
}
|
|
60
|
-
void nextTick(() => {
|
|
61
|
-
scrollToBottom();
|
|
62
|
-
});
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
scrollToBottom();
|
|
65
|
-
}, SCROLL_DELAY);
|
|
66
68
|
}
|
|
67
69
|
}, { immediate: true });
|
|
68
70
|
watch(messagesRef, (newMessages) => {
|
|
@@ -72,19 +74,18 @@ export default defineComponent({
|
|
|
72
74
|
}
|
|
73
75
|
const currentLastMessage = newMessages[newMessages.length - 1];
|
|
74
76
|
const currentLastId = currentLastMessage === null || currentLastMessage === void 0 ? void 0 : currentLastMessage.id;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
const hasLastMessageChanged = currentLastId !== lastMessageId.value;
|
|
78
|
+
if (hasLastMessageChanged &&
|
|
79
|
+
currentLastMessage &&
|
|
80
|
+
!currentLastMessage.isOwn &&
|
|
81
|
+
currentLastMessage.status === MessageStatus.UNREAD) {
|
|
82
|
+
unreadCountOnOpen.value = unreadMessagesCount.value;
|
|
83
|
+
}
|
|
84
|
+
if (shouldScrollOnLoad.value && newMessages.length > 0) {
|
|
85
|
+
shouldScrollOnLoad.value = false;
|
|
77
86
|
void nextTick(() => {
|
|
78
87
|
scrollToBottom();
|
|
79
88
|
});
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
scrollToBottom();
|
|
82
|
-
}, SCROLL_DELAY);
|
|
83
|
-
if (currentLastMessage &&
|
|
84
|
-
!currentLastMessage.isOwn &&
|
|
85
|
-
currentLastMessage.status === MessageStatus.UNREAD) {
|
|
86
|
-
unreadCountOnOpen.value = unreadMessagesCount.value;
|
|
87
|
-
}
|
|
88
89
|
}
|
|
89
90
|
lastMessageId.value = currentLastId !== null && currentLastId !== void 0 ? currentLastId : null;
|
|
90
91
|
}, { deep: true, flush: 'post' });
|
|
@@ -97,17 +98,42 @@ export default defineComponent({
|
|
|
97
98
|
notificationsShownSetRef.value = newSet;
|
|
98
99
|
}
|
|
99
100
|
});
|
|
101
|
+
watch(inputValue, (newValue) => {
|
|
102
|
+
if (selectedChatRef.value) {
|
|
103
|
+
handleFooterInputChange(newValue, selectedChatRef.value.id);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
100
106
|
const showUnreadNotification = computed(() => {
|
|
101
107
|
return hasUnreadMessages.value && showNotificationManually.value;
|
|
102
108
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
const handleMessagesScroll = (e) => {
|
|
110
|
+
var _a, _b;
|
|
111
|
+
const target = e.target;
|
|
112
|
+
if (!target)
|
|
113
|
+
return;
|
|
114
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
115
|
+
const threshold = 5;
|
|
116
|
+
const scrollDirection = scrollTop > lastScrollTop.value ? 'down' : 'up';
|
|
117
|
+
const nearTop = scrollTop <= threshold;
|
|
118
|
+
const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
|
|
119
|
+
if (scrollTop > threshold) {
|
|
120
|
+
scrollTopFired.value = false;
|
|
121
|
+
}
|
|
122
|
+
if (scrollHeight - (scrollTop + clientHeight) > threshold) {
|
|
123
|
+
scrollBottomFired.value = false;
|
|
124
|
+
}
|
|
125
|
+
if (nearTop && scrollDirection === 'up' && !scrollTopFired.value) {
|
|
126
|
+
scrollTopFired.value = true;
|
|
127
|
+
(_a = onMessagesScrollToTop === null || onMessagesScrollToTop === void 0 ? void 0 : onMessagesScrollToTop.value) === null || _a === void 0 ? void 0 : _a.call(onMessagesScrollToTop);
|
|
128
|
+
}
|
|
129
|
+
if (nearBottom &&
|
|
130
|
+
scrollDirection === 'down' &&
|
|
131
|
+
!scrollBottomFired.value) {
|
|
132
|
+
scrollBottomFired.value = true;
|
|
133
|
+
(_b = onMessagesScrollToBottom === null || onMessagesScrollToBottom === void 0 ? void 0 : onMessagesScrollToBottom.value) === null || _b === void 0 ? void 0 : _b.call(onMessagesScrollToBottom);
|
|
134
|
+
}
|
|
135
|
+
lastScrollTop.value = scrollTop;
|
|
136
|
+
};
|
|
111
137
|
const scrollToBottom = () => {
|
|
112
138
|
const el = messagesBodyRef.value;
|
|
113
139
|
if (!el)
|
|
@@ -129,27 +155,50 @@ export default defineComponent({
|
|
|
129
155
|
};
|
|
130
156
|
const renderHeader = () => {
|
|
131
157
|
return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__header` },
|
|
132
|
-
h(UFlex, { justify: "space-between", align: "flex-start" }, {
|
|
158
|
+
h(UFlex, { justify: "space-between", align: "flex-start", wrap: false }, {
|
|
133
159
|
default: () => (h(Fragment, null,
|
|
134
160
|
h(UText, { variant: "heading-s-bold", class: `${mergedClsPrefixRef.value}-chat-main__header-title`, theme: mergedThemeRef.value.peers.Typography, themeOverrides: mergedThemeRef.value.peerOverrides.Typography }, {
|
|
135
|
-
default: () => { var _a; return ((_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title)
|
|
161
|
+
default: () => { var _a, _b; return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : ''; }
|
|
136
162
|
}),
|
|
137
163
|
h(UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__header-actions` }, {
|
|
138
|
-
default: () => resolveSlot(slots.headerActions, () =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
default: () => resolveSlot(slots.headerActions, () => {
|
|
165
|
+
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
166
|
+
const profileButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerProfileButtonPropsRef.value);
|
|
167
|
+
const closeButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerCloseButtonPropsRef.value);
|
|
168
|
+
const shareIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerShareIconPropsRef.value);
|
|
169
|
+
const profileIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerProfileIconPropsRef.value);
|
|
170
|
+
const buttons = [];
|
|
171
|
+
if (shareButtonProps.disabled !== true) {
|
|
172
|
+
buttons.push(h(UTooltip, null, {
|
|
173
|
+
trigger: () => (h(UButton, Object.assign({ secondary: true, circle: true, size: "large" }, shareButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
174
|
+
.Button, onClick: () => { var _a; return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare); } }), {
|
|
175
|
+
default: () => (h(UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers.Icon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
176
|
+
.Icon }), {
|
|
177
|
+
default: () => (h(ArrowHookUpRight, null))
|
|
178
|
+
}))
|
|
179
|
+
})),
|
|
180
|
+
default: () => shareButtonTooltipRef.value
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
if (profileButtonProps.disabled !== true) {
|
|
184
|
+
buttons.push(h(UTooltip, null, {
|
|
185
|
+
trigger: () => (h(UButton, Object.assign({ secondary: true, circle: true, size: "large" }, profileButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
186
|
+
.Button, onClick: () => { var _a; return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile); } }), {
|
|
187
|
+
default: () => (h(UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers.Icon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
188
|
+
.Icon }), {
|
|
189
|
+
default: () => h(PersonNote, null)
|
|
190
|
+
}))
|
|
191
|
+
})),
|
|
192
|
+
default: () => profileButtonTooltipRef.value
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
195
|
+
if (closeButtonProps.disabled !== true) {
|
|
196
|
+
buttons.push(h(UButton, Object.assign({ type: "primary", size: "large", round: true }, closeButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: () => { var _a; return (_a = onChatClose === null || onChatClose === void 0 ? void 0 : onChatClose.value) === null || _a === void 0 ? void 0 : _a.call(onChatClose); } }), {
|
|
197
|
+
default: () => closeButtonTextRef.value
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
return buttons;
|
|
201
|
+
})
|
|
153
202
|
})))
|
|
154
203
|
})));
|
|
155
204
|
};
|
|
@@ -196,12 +245,6 @@ export default defineComponent({
|
|
|
196
245
|
chatInputs.value[selectedChatRef.value.id] = '';
|
|
197
246
|
hasUnreadMessages.value = false;
|
|
198
247
|
showNotificationManually.value = false;
|
|
199
|
-
void nextTick(() => {
|
|
200
|
-
scrollToBottom();
|
|
201
|
-
});
|
|
202
|
-
setTimeout(() => {
|
|
203
|
-
scrollToBottom();
|
|
204
|
-
}, SCROLL_DELAY);
|
|
205
248
|
}
|
|
206
249
|
finally {
|
|
207
250
|
setTimeout(() => {
|
|
@@ -241,12 +284,6 @@ export default defineComponent({
|
|
|
241
284
|
handleMessageSend('', attachments);
|
|
242
285
|
pendingFiles.value = [];
|
|
243
286
|
attachmentFileList.value = [];
|
|
244
|
-
void nextTick(() => {
|
|
245
|
-
scrollToBottom();
|
|
246
|
-
});
|
|
247
|
-
setTimeout(() => {
|
|
248
|
-
scrollToBottom();
|
|
249
|
-
}, SCROLL_DELAY);
|
|
250
287
|
}
|
|
251
288
|
}, SENDING_DELAY);
|
|
252
289
|
}
|
|
@@ -286,6 +323,7 @@ export default defineComponent({
|
|
|
286
323
|
inputRef,
|
|
287
324
|
inputValue,
|
|
288
325
|
handleSendMessage,
|
|
326
|
+
handleMessagesScroll,
|
|
289
327
|
scrollToBottom
|
|
290
328
|
};
|
|
291
329
|
},
|
|
@@ -294,7 +332,7 @@ export default defineComponent({
|
|
|
294
332
|
const { mergedClsPrefixRef } = inject(chatInjectionKey);
|
|
295
333
|
return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main` },
|
|
296
334
|
this.renderHeader(),
|
|
297
|
-
h(UScrollbar, { ref: "messagesBodyRef", class: `${mergedClsPrefixRef.value}-chat-main__body
|
|
335
|
+
h(UScrollbar, { ref: "messagesBodyRef", class: `${mergedClsPrefixRef.value}-chat-main__body`, onScroll: this.handleMessagesScroll }, {
|
|
298
336
|
default: () => this.renderMessages()
|
|
299
337
|
}),
|
|
300
338
|
this.renderFooter()));
|