@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
@@ -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
- return { slots };
15
- },
16
- render() {
17
- const { slots } = this;
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 ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar` },
33
- renderListHeader(),
34
- (0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__content` },
35
- (0, vue_1.h)(ChatListItems_1.default, { 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 }, {
36
- chatItemStatus: slots.chatItemStatus
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
- 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
  }>;
@@ -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);