@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,17 +7,46 @@ const vue_1 = require("vue");
|
|
|
7
7
|
const interface_1 = require("../interface");
|
|
8
8
|
const flex_1 = require("../../../flex");
|
|
9
9
|
const select_1 = require("../../../select");
|
|
10
|
+
const scrollbar_1 = require("../../../scrollbar");
|
|
10
11
|
const ChatListItems_1 = __importDefault(require("../ChatListItems"));
|
|
11
12
|
exports.default = (0, vue_1.defineComponent)({
|
|
12
13
|
name: 'ChatSidebar',
|
|
13
14
|
setup(props, { slots }) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const { mergedClsPrefixRef, mergedThemeRef, chatItemsRef, chatItemsLoadingRef, chatItemsLoadingCountRef, listEmptyPropsRef, selectedChatIdRef, typingChatIdsRef, typingTextRef, listItemAvatarPropsRef, listItemBadgePropsRef, notificationsShownSetRef, handleChatSelect
|
|
15
|
+
const sidebarContentRef = (0, vue_1.ref)();
|
|
16
|
+
const lastScrollTop = (0, vue_1.ref)(0);
|
|
17
|
+
const scrollTopFired = (0, vue_1.ref)(false);
|
|
18
|
+
const scrollBottomFired = (0, vue_1.ref)(false);
|
|
19
|
+
const { mergedClsPrefixRef, mergedThemeRef, chatItemsRef, chatItemsLoadingRef, chatItemsLoadingCountRef, listEmptyPropsRef, selectedChatIdRef, typingChatIdsRef, typingTextRef, listItemAvatarPropsRef, listItemBadgePropsRef, notificationsShownSetRef, handleChatSelect, onChatItemsScrollToTop, onChatItemsScrollToBottom
|
|
19
20
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
21
|
} = (0, vue_1.inject)(interface_1.chatInjectionKey);
|
|
22
|
+
const handleSidebarScroll = (e) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const target = e.target;
|
|
25
|
+
if (!target)
|
|
26
|
+
return;
|
|
27
|
+
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
28
|
+
const threshold = 5;
|
|
29
|
+
const scrollDirection = scrollTop > lastScrollTop.value ? 'down' : 'up';
|
|
30
|
+
const nearTop = scrollTop <= threshold;
|
|
31
|
+
const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
|
|
32
|
+
if (scrollTop > threshold) {
|
|
33
|
+
scrollTopFired.value = false;
|
|
34
|
+
}
|
|
35
|
+
if (scrollHeight - (scrollTop + clientHeight) > threshold) {
|
|
36
|
+
scrollBottomFired.value = false;
|
|
37
|
+
}
|
|
38
|
+
if (nearTop && scrollDirection === 'up' && !scrollTopFired.value) {
|
|
39
|
+
scrollTopFired.value = true;
|
|
40
|
+
(_a = onChatItemsScrollToTop === null || onChatItemsScrollToTop === void 0 ? void 0 : onChatItemsScrollToTop.value) === null || _a === void 0 ? void 0 : _a.call(onChatItemsScrollToTop);
|
|
41
|
+
}
|
|
42
|
+
if (nearBottom &&
|
|
43
|
+
scrollDirection === 'down' &&
|
|
44
|
+
!scrollBottomFired.value) {
|
|
45
|
+
scrollBottomFired.value = true;
|
|
46
|
+
(_b = onChatItemsScrollToBottom === null || onChatItemsScrollToBottom === void 0 ? void 0 : onChatItemsScrollToBottom.value) === null || _b === void 0 ? void 0 : _b.call(onChatItemsScrollToBottom);
|
|
47
|
+
}
|
|
48
|
+
lastScrollTop.value = scrollTop;
|
|
49
|
+
};
|
|
21
50
|
const renderListHeader = () => {
|
|
22
51
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__header` },
|
|
23
52
|
(0, vue_1.h)(flex_1.UFlex, { align: "center", justify: "space-between", class: `${mergedClsPrefixRef.value}-chat-sidebar__header-container`, style: { width: '100%' } }, {
|
|
@@ -29,11 +58,33 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
29
58
|
}
|
|
30
59
|
})));
|
|
31
60
|
};
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
61
|
+
return {
|
|
62
|
+
slots,
|
|
63
|
+
sidebarContentRef,
|
|
64
|
+
renderListHeader,
|
|
65
|
+
handleSidebarScroll,
|
|
66
|
+
mergedClsPrefixRef,
|
|
67
|
+
mergedThemeRef,
|
|
68
|
+
chatItemsRef,
|
|
69
|
+
chatItemsLoadingRef,
|
|
70
|
+
chatItemsLoadingCountRef,
|
|
71
|
+
listEmptyPropsRef,
|
|
72
|
+
selectedChatIdRef,
|
|
73
|
+
typingChatIdsRef,
|
|
74
|
+
typingTextRef,
|
|
75
|
+
listItemAvatarPropsRef,
|
|
76
|
+
listItemBadgePropsRef,
|
|
77
|
+
notificationsShownSetRef,
|
|
78
|
+
handleChatSelect
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
render() {
|
|
82
|
+
return ((0, vue_1.h)("div", { class: `${this.mergedClsPrefixRef}-chat-sidebar` },
|
|
83
|
+
this.renderListHeader(),
|
|
84
|
+
(0, vue_1.h)(scrollbar_1.UScrollbar, { ref: "sidebarContentRef", class: `${this.mergedClsPrefixRef}-chat-sidebar__content`, onScroll: this.handleSidebarScroll }, {
|
|
85
|
+
default: () => ((0, vue_1.h)(ChatListItems_1.default, { chatItems: this.chatItemsRef, selectedChatId: this.selectedChatIdRef, typingChatIds: this.typingChatIdsRef, typingText: this.typingTextRef, loading: this.chatItemsLoadingRef, loadingCount: this.chatItemsLoadingCountRef, emptyProps: this.listEmptyPropsRef, avatarProps: this.listItemAvatarPropsRef, badgeProps: this.listItemBadgePropsRef, notificationsShown: this.notificationsShownSetRef, onChatSelect: this.handleChatSelect }, {
|
|
86
|
+
chatItemStatus: this.slots.chatItemStatus
|
|
87
|
+
}))
|
|
88
|
+
})));
|
|
38
89
|
}
|
|
39
90
|
});
|
|
@@ -137,6 +137,11 @@ export interface ChatProps {
|
|
|
137
137
|
unreadCount?: number;
|
|
138
138
|
headerButtonProps?: Partial<ButtonProps>;
|
|
139
139
|
headerIconProps?: Partial<IconProps>;
|
|
140
|
+
headerShareButtonProps?: Partial<ButtonProps>;
|
|
141
|
+
headerProfileButtonProps?: Partial<ButtonProps>;
|
|
142
|
+
headerCloseButtonProps?: Partial<ButtonProps>;
|
|
143
|
+
headerShareIconProps?: Partial<IconProps>;
|
|
144
|
+
headerProfileIconProps?: Partial<IconProps>;
|
|
140
145
|
messageSenderAvatarProps?: Partial<AvatarProps>;
|
|
141
146
|
messageUploadProps?: Partial<UploadProps>;
|
|
142
147
|
messageButtonProps?: Partial<ButtonProps>;
|
|
@@ -149,6 +154,8 @@ export interface ChatProps {
|
|
|
149
154
|
retryText?: string;
|
|
150
155
|
typingText?: string;
|
|
151
156
|
closeButtonText?: string;
|
|
157
|
+
shareButtonTooltip?: string;
|
|
158
|
+
profileButtonTooltip?: string;
|
|
152
159
|
unreadNotificationText?: string;
|
|
153
160
|
chatItemsLoading?: boolean;
|
|
154
161
|
chatItemsLoadingCount?: number;
|
|
@@ -159,10 +166,14 @@ export interface ChatProps {
|
|
|
159
166
|
onMessageRetry?: (message: ChatMessageData) => void;
|
|
160
167
|
onAttachmentUpload?: OnAttachmentUpload;
|
|
161
168
|
onFilterChange?: OnFilterChange;
|
|
162
|
-
|
|
169
|
+
onFooterInputChange?: (value: string, chatId: ChatId) => void;
|
|
163
170
|
onNetworkError?: OnNetworkError;
|
|
164
171
|
onUploadError?: OnUploadError;
|
|
165
172
|
onSendError?: OnSendError;
|
|
173
|
+
onChatItemsScrollToTop?: () => void;
|
|
174
|
+
onChatItemsScrollToBottom?: () => void;
|
|
175
|
+
onMessagesScrollToTop?: () => void;
|
|
176
|
+
onMessagesScrollToBottom?: () => void;
|
|
166
177
|
}
|
|
167
178
|
export interface ChatSlots {
|
|
168
179
|
header?: () => VNodeChild;
|
|
@@ -218,7 +229,6 @@ export type OnFilterChange = (filter: {
|
|
|
218
229
|
type: string;
|
|
219
230
|
value: any;
|
|
220
231
|
}) => void;
|
|
221
|
-
export type OnLoadMoreChats = (offset: number, limit: number) => void;
|
|
222
232
|
export type OnNetworkError = (error: {
|
|
223
233
|
code: string;
|
|
224
234
|
message: string;
|
|
@@ -274,6 +284,8 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
274
284
|
retryTextRef: Ref<string>;
|
|
275
285
|
typingTextRef: Ref<string>;
|
|
276
286
|
closeButtonTextRef: Ref<string>;
|
|
287
|
+
shareButtonTooltipRef: Ref<string>;
|
|
288
|
+
profileButtonTooltipRef: Ref<string>;
|
|
277
289
|
unreadNotificationTextRef: Ref<string>;
|
|
278
290
|
notificationsShownSetRef: Ref<Set<ChatId>>;
|
|
279
291
|
unreadCountsBeforeReadRef: Ref<Record<ChatId, number>>;
|
|
@@ -281,12 +293,12 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
281
293
|
handleChatSelect: (chatId: ChatId) => void;
|
|
282
294
|
handleMessageSend: (content: string, attachments?: ChatAttachment[]) => void;
|
|
283
295
|
handleMessageRetry: (message: ChatMessageData) => void;
|
|
296
|
+
handleFooterInputChange: (value: string, chatId: ChatId) => void;
|
|
284
297
|
markMessagesAsRead?: (chatId: ChatId) => void;
|
|
285
298
|
handleFilterChange: (filter: {
|
|
286
299
|
type: string;
|
|
287
300
|
value: string | number | boolean;
|
|
288
301
|
}) => void;
|
|
289
|
-
handleLoadMoreChats: (offset: number, limit: number) => void;
|
|
290
302
|
handleNetworkError: (error: {
|
|
291
303
|
code: string;
|
|
292
304
|
message: string;
|
|
@@ -302,4 +314,13 @@ export declare const chatInjectionKey: InjectionKey<{
|
|
|
302
314
|
onChatClose?: Ref<(() => void) | undefined>;
|
|
303
315
|
onChatShare?: Ref<(() => void) | undefined>;
|
|
304
316
|
onUserProfile?: Ref<(() => void) | undefined>;
|
|
317
|
+
onChatItemsScrollToTop?: Ref<(() => void) | undefined>;
|
|
318
|
+
onChatItemsScrollToBottom?: Ref<(() => void) | undefined>;
|
|
319
|
+
onMessagesScrollToTop?: Ref<(() => void) | undefined>;
|
|
320
|
+
onMessagesScrollToBottom?: Ref<(() => void) | undefined>;
|
|
321
|
+
headerShareButtonPropsRef: Ref<Partial<ButtonProps> | undefined>;
|
|
322
|
+
headerProfileButtonPropsRef: Ref<Partial<ButtonProps> | undefined>;
|
|
323
|
+
headerCloseButtonPropsRef: Ref<Partial<ButtonProps> | undefined>;
|
|
324
|
+
headerShareIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
325
|
+
headerProfileIconPropsRef: Ref<Partial<IconProps> | undefined>;
|
|
305
326
|
}>;
|
|
@@ -41,11 +41,11 @@ exports.default = (0, cssr_1.cB)('chat', `
|
|
|
41
41
|
gap: 8px;
|
|
42
42
|
`), (0, cssr_1.cE)('content', `
|
|
43
43
|
flex: 1;
|
|
44
|
-
overflow-y: auto;
|
|
45
44
|
min-height: 0;
|
|
45
|
+
`, [(0, cssr_1.c)('.u-scrollbar-content', `
|
|
46
46
|
padding: 16px;
|
|
47
47
|
padding-top: 8px;
|
|
48
|
-
`), (0, cssr_1.cE)('item', `
|
|
48
|
+
`)]), (0, cssr_1.cE)('item', `
|
|
49
49
|
padding: 12px 16px;
|
|
50
50
|
width: 100%;
|
|
51
51
|
cursor: pointer;
|
|
@@ -167,8 +167,19 @@ exports.default = (0, cssr_1.cB)('chat', `
|
|
|
167
167
|
`), (0, cssr_1.cE)('header-title', `
|
|
168
168
|
margin-top: 9px;
|
|
169
169
|
color: var(--u-header-title-color);
|
|
170
|
+
flex: 1;
|
|
171
|
+
min-width: 0;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
text-overflow: ellipsis;
|
|
174
|
+
white-space: nowrap;
|
|
175
|
+
display: block;
|
|
176
|
+
margin-right: 16px;
|
|
170
177
|
`), (0, cssr_1.cE)('header-actions', `
|
|
171
178
|
padding: 4px;
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
gap: 8px;
|
|
172
183
|
`), (0, cssr_1.cE)('unread-notification', `
|
|
173
184
|
background-color: var(--u-unread-notification-background-color);
|
|
174
185
|
color: var(--u-unread-notification-text-color);
|