@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.
Files changed (118) hide show
  1. package/dist/index.js +586 -265
  2. package/dist/index.prod.js +2 -2
  3. package/es/chat/index.d.ts +1 -1
  4. package/es/chat/src/Chat.d.ts +233 -11
  5. package/es/chat/src/Chat.js +73 -22
  6. package/es/chat/src/ChatParts/ChatAttachment.js +14 -12
  7. package/es/chat/src/ChatParts/MainArea.d.ts +1 -0
  8. package/es/chat/src/ChatParts/MainArea.js +95 -57
  9. package/es/chat/src/ChatParts/Sidebar.d.ts +920 -0
  10. package/es/chat/src/ChatParts/Sidebar.js +63 -12
  11. package/es/chat/src/interface.d.ts +24 -3
  12. package/es/chat/src/styles/index.cssr.js +13 -2
  13. package/es/date-picker/src/DatePicker.d.ts +1308 -43
  14. package/es/date-picker/src/DatePicker.js +54 -29
  15. package/es/date-picker/src/interface.d.ts +1 -0
  16. package/es/date-picker/src/panel/date.d.ts +141 -0
  17. package/es/date-picker/src/panel/daterange.d.ts +141 -0
  18. package/es/date-picker/src/panel/datetime.d.ts +141 -0
  19. package/es/date-picker/src/panel/datetimerange.d.ts +141 -0
  20. package/es/date-picker/src/panel/panelMonth.d.ts +282 -0
  21. package/es/date-picker/src/panel/panelMonthContent.d.ts +141 -0
  22. package/es/date-picker/src/panel/panelYear.d.ts +282 -0
  23. package/es/date-picker/src/panel/panelYearContent.d.ts +141 -0
  24. package/es/date-picker/src/panel/use-calendar.d.ts +141 -0
  25. package/es/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
  26. package/es/date-picker/src/panel/use-panel-common.d.ts +141 -0
  27. package/es/date-picker/styles/dark.js +3 -1
  28. package/es/date-picker/styles/light.d.ts +123 -0
  29. package/es/date-picker/styles/light.js +3 -1
  30. package/es/descriptions/src/Descriptions.d.ts +30 -0
  31. package/es/descriptions/src/Descriptions.js +18 -10
  32. package/es/locales/common/arDZ.js +2 -0
  33. package/es/locales/common/deDE.js +2 -0
  34. package/es/locales/common/enGB.js +2 -0
  35. package/es/locales/common/enUS.d.ts +2 -0
  36. package/es/locales/common/enUS.js +2 -0
  37. package/es/locales/common/eo.js +2 -0
  38. package/es/locales/common/esAR.js +2 -0
  39. package/es/locales/common/faIR.js +2 -0
  40. package/es/locales/common/frFR.js +2 -0
  41. package/es/locales/common/idID.js +2 -0
  42. package/es/locales/common/itIT.js +2 -0
  43. package/es/locales/common/jaJP.js +2 -0
  44. package/es/locales/common/koKR.js +2 -0
  45. package/es/locales/common/nbNO.js +2 -0
  46. package/es/locales/common/nlNL.js +2 -0
  47. package/es/locales/common/plPL.js +2 -0
  48. package/es/locales/common/ptBR.js +2 -0
  49. package/es/locales/common/ruRU.js +2 -0
  50. package/es/locales/common/skSK.js +2 -0
  51. package/es/locales/common/svSE.js +2 -0
  52. package/es/locales/common/thTH.js +2 -0
  53. package/es/locales/common/trTR.js +2 -0
  54. package/es/locales/common/ukUA.js +2 -0
  55. package/es/locales/common/viVN.js +2 -0
  56. package/es/locales/common/zhCN.js +2 -0
  57. package/es/locales/common/zhTW.js +2 -0
  58. package/es/version.d.ts +1 -1
  59. package/es/version.js +1 -1
  60. package/lib/chat/index.d.ts +1 -1
  61. package/lib/chat/src/Chat.d.ts +233 -11
  62. package/lib/chat/src/Chat.js +73 -22
  63. package/lib/chat/src/ChatParts/ChatAttachment.js +14 -12
  64. package/lib/chat/src/ChatParts/MainArea.d.ts +1 -0
  65. package/lib/chat/src/ChatParts/MainArea.js +94 -56
  66. package/lib/chat/src/ChatParts/Sidebar.d.ts +920 -0
  67. package/lib/chat/src/ChatParts/Sidebar.js +62 -11
  68. package/lib/chat/src/interface.d.ts +24 -3
  69. package/lib/chat/src/styles/index.cssr.js +13 -2
  70. package/lib/date-picker/src/DatePicker.d.ts +1308 -43
  71. package/lib/date-picker/src/DatePicker.js +53 -28
  72. package/lib/date-picker/src/interface.d.ts +1 -0
  73. package/lib/date-picker/src/panel/date.d.ts +141 -0
  74. package/lib/date-picker/src/panel/daterange.d.ts +141 -0
  75. package/lib/date-picker/src/panel/datetime.d.ts +141 -0
  76. package/lib/date-picker/src/panel/datetimerange.d.ts +141 -0
  77. package/lib/date-picker/src/panel/panelMonth.d.ts +282 -0
  78. package/lib/date-picker/src/panel/panelMonthContent.d.ts +141 -0
  79. package/lib/date-picker/src/panel/panelYear.d.ts +282 -0
  80. package/lib/date-picker/src/panel/panelYearContent.d.ts +141 -0
  81. package/lib/date-picker/src/panel/use-calendar.d.ts +141 -0
  82. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
  83. package/lib/date-picker/src/panel/use-panel-common.d.ts +141 -0
  84. package/lib/date-picker/styles/dark.js +3 -1
  85. package/lib/date-picker/styles/light.d.ts +123 -0
  86. package/lib/date-picker/styles/light.js +3 -1
  87. package/lib/descriptions/src/Descriptions.d.ts +30 -0
  88. package/lib/descriptions/src/Descriptions.js +18 -10
  89. package/lib/locales/common/arDZ.js +2 -0
  90. package/lib/locales/common/deDE.js +2 -0
  91. package/lib/locales/common/enGB.js +2 -0
  92. package/lib/locales/common/enUS.d.ts +2 -0
  93. package/lib/locales/common/enUS.js +2 -0
  94. package/lib/locales/common/eo.js +2 -0
  95. package/lib/locales/common/esAR.js +2 -0
  96. package/lib/locales/common/faIR.js +2 -0
  97. package/lib/locales/common/frFR.js +2 -0
  98. package/lib/locales/common/idID.js +2 -0
  99. package/lib/locales/common/itIT.js +2 -0
  100. package/lib/locales/common/jaJP.js +2 -0
  101. package/lib/locales/common/koKR.js +2 -0
  102. package/lib/locales/common/nbNO.js +2 -0
  103. package/lib/locales/common/nlNL.js +2 -0
  104. package/lib/locales/common/plPL.js +2 -0
  105. package/lib/locales/common/ptBR.js +2 -0
  106. package/lib/locales/common/ruRU.js +2 -0
  107. package/lib/locales/common/skSK.js +2 -0
  108. package/lib/locales/common/svSE.js +2 -0
  109. package/lib/locales/common/thTH.js +2 -0
  110. package/lib/locales/common/trTR.js +2 -0
  111. package/lib/locales/common/ukUA.js +2 -0
  112. package/lib/locales/common/viVN.js +2 -0
  113. package/lib/locales/common/zhCN.js +2 -0
  114. package/lib/locales/common/zhTW.js +2 -0
  115. package/lib/version.d.ts +1 -1
  116. package/lib/version.js +1 -1
  117. package/package.json +3 -3
  118. package/web-types.json +95 -4
@@ -1,18 +1,47 @@
1
- import { h, defineComponent, inject, Fragment } from 'vue';
1
+ import { h, defineComponent, inject, Fragment, ref } from 'vue';
2
2
  import { chatInjectionKey } from '../interface';
3
3
  import { UFlex } from '../../../flex';
4
4
  import { USelect } from '../../../select';
5
+ import { UScrollbar } from '../../../scrollbar';
5
6
  import UChatListItems from '../ChatListItems';
6
7
  export default defineComponent({
7
8
  name: 'ChatSidebar',
8
9
  setup(props, { slots }) {
9
- return { slots };
10
- },
11
- render() {
12
- const { slots } = this;
13
- const { mergedClsPrefixRef, mergedThemeRef, chatItemsRef, chatItemsLoadingRef, chatItemsLoadingCountRef, listEmptyPropsRef, selectedChatIdRef, typingChatIdsRef, typingTextRef, listItemAvatarPropsRef, listItemBadgePropsRef, notificationsShownSetRef, handleChatSelect
10
+ const sidebarContentRef = ref();
11
+ const lastScrollTop = ref(0);
12
+ const scrollTopFired = ref(false);
13
+ const scrollBottomFired = ref(false);
14
+ const { mergedClsPrefixRef, mergedThemeRef, chatItemsRef, chatItemsLoadingRef, chatItemsLoadingCountRef, listEmptyPropsRef, selectedChatIdRef, typingChatIdsRef, typingTextRef, listItemAvatarPropsRef, listItemBadgePropsRef, notificationsShownSetRef, handleChatSelect, onChatItemsScrollToTop, onChatItemsScrollToBottom
14
15
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15
16
  } = inject(chatInjectionKey);
17
+ const handleSidebarScroll = (e) => {
18
+ var _a, _b;
19
+ const target = e.target;
20
+ if (!target)
21
+ return;
22
+ const { scrollTop, scrollHeight, clientHeight } = target;
23
+ const threshold = 5;
24
+ const scrollDirection = scrollTop > lastScrollTop.value ? 'down' : 'up';
25
+ const nearTop = scrollTop <= threshold;
26
+ const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
27
+ if (scrollTop > threshold) {
28
+ scrollTopFired.value = false;
29
+ }
30
+ if (scrollHeight - (scrollTop + clientHeight) > threshold) {
31
+ scrollBottomFired.value = false;
32
+ }
33
+ if (nearTop && scrollDirection === 'up' && !scrollTopFired.value) {
34
+ scrollTopFired.value = true;
35
+ (_a = onChatItemsScrollToTop === null || onChatItemsScrollToTop === void 0 ? void 0 : onChatItemsScrollToTop.value) === null || _a === void 0 ? void 0 : _a.call(onChatItemsScrollToTop);
36
+ }
37
+ if (nearBottom &&
38
+ scrollDirection === 'down' &&
39
+ !scrollBottomFired.value) {
40
+ scrollBottomFired.value = true;
41
+ (_b = onChatItemsScrollToBottom === null || onChatItemsScrollToBottom === void 0 ? void 0 : onChatItemsScrollToBottom.value) === null || _b === void 0 ? void 0 : _b.call(onChatItemsScrollToBottom);
42
+ }
43
+ lastScrollTop.value = scrollTop;
44
+ };
16
45
  const renderListHeader = () => {
17
46
  return (h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__header` },
18
47
  h(UFlex, { align: "center", justify: "space-between", class: `${mergedClsPrefixRef.value}-chat-sidebar__header-container`, style: { width: '100%' } }, {
@@ -24,11 +53,33 @@ export default defineComponent({
24
53
  }
25
54
  })));
26
55
  };
27
- return (h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar` },
28
- renderListHeader(),
29
- h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__content` },
30
- h(UChatListItems, { chatItems: chatItemsRef.value, selectedChatId: selectedChatIdRef.value, typingChatIds: typingChatIdsRef.value, typingText: typingTextRef.value, loading: chatItemsLoadingRef.value, loadingCount: chatItemsLoadingCountRef.value, emptyProps: listEmptyPropsRef.value, avatarProps: listItemAvatarPropsRef.value, badgeProps: listItemBadgePropsRef.value, notificationsShown: notificationsShownSetRef.value, onChatSelect: handleChatSelect }, {
31
- chatItemStatus: slots.chatItemStatus
32
- }))));
56
+ return {
57
+ slots,
58
+ sidebarContentRef,
59
+ renderListHeader,
60
+ handleSidebarScroll,
61
+ mergedClsPrefixRef,
62
+ mergedThemeRef,
63
+ chatItemsRef,
64
+ chatItemsLoadingRef,
65
+ chatItemsLoadingCountRef,
66
+ listEmptyPropsRef,
67
+ selectedChatIdRef,
68
+ typingChatIdsRef,
69
+ typingTextRef,
70
+ listItemAvatarPropsRef,
71
+ listItemBadgePropsRef,
72
+ notificationsShownSetRef,
73
+ handleChatSelect
74
+ };
75
+ },
76
+ render() {
77
+ return (h("div", { class: `${this.mergedClsPrefixRef}-chat-sidebar` },
78
+ this.renderListHeader(),
79
+ h(UScrollbar, { ref: "sidebarContentRef", class: `${this.mergedClsPrefixRef}-chat-sidebar__content`, onScroll: this.handleSidebarScroll }, {
80
+ default: () => (h(UChatListItems, { 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 }, {
81
+ chatItemStatus: this.slots.chatItemStatus
82
+ }))
83
+ })));
33
84
  }
34
85
  });
@@ -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
- onLoadMoreChats?: OnLoadMoreChats;
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
  }>;
@@ -36,11 +36,11 @@ export default cB('chat', `
36
36
  gap: 8px;
37
37
  `), cE('content', `
38
38
  flex: 1;
39
- overflow-y: auto;
40
39
  min-height: 0;
40
+ `, [c('.u-scrollbar-content', `
41
41
  padding: 16px;
42
42
  padding-top: 8px;
43
- `), cE('item', `
43
+ `)]), cE('item', `
44
44
  padding: 12px 16px;
45
45
  width: 100%;
46
46
  cursor: pointer;
@@ -162,8 +162,19 @@ export default cB('chat', `
162
162
  `), cE('header-title', `
163
163
  margin-top: 9px;
164
164
  color: var(--u-header-title-color);
165
+ flex: 1;
166
+ min-width: 0;
167
+ overflow: hidden;
168
+ text-overflow: ellipsis;
169
+ white-space: nowrap;
170
+ display: block;
171
+ margin-right: 16px;
165
172
  `), cE('header-actions', `
166
173
  padding: 4px;
174
+ flex-shrink: 0;
175
+ display: flex;
176
+ align-items: center;
177
+ gap: 8px;
167
178
  `), cE('unread-notification', `
168
179
  background-color: var(--u-unread-notification-background-color);
169
180
  color: var(--u-unread-notification-text-color);