@uzum-tech/ui 1.9.0 → 1.10.0

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 (249) hide show
  1. package/dist/index.js +5789 -1014
  2. package/dist/index.prod.js +12 -3
  3. package/es/_internal/scrollbar/src/Scrollbar.js +19 -38
  4. package/es/auto-complete/src/AutoComplete.d.ts +1 -1
  5. package/es/cascader/src/Cascader.d.ts +1 -1
  6. package/es/chat/index.d.ts +1 -1
  7. package/es/chat/src/Chat.d.ts +233 -11
  8. package/es/chat/src/Chat.js +73 -22
  9. package/es/chat/src/ChatParts/ChatAttachment.js +14 -12
  10. package/es/chat/src/ChatParts/MainArea.d.ts +1 -0
  11. package/es/chat/src/ChatParts/MainArea.js +95 -57
  12. package/es/chat/src/ChatParts/Sidebar.d.ts +920 -0
  13. package/es/chat/src/ChatParts/Sidebar.js +63 -12
  14. package/es/chat/src/interface.d.ts +24 -3
  15. package/es/chat/src/styles/index.cssr.js +13 -2
  16. package/es/components.d.ts +2 -0
  17. package/es/components.js +2 -0
  18. package/es/config-provider/src/internal-interface.d.ts +4 -0
  19. package/es/crop/index.d.ts +3 -0
  20. package/es/crop/index.js +1 -0
  21. package/es/crop/src/Crop.d.ts +222 -0
  22. package/es/crop/src/Crop.js +157 -0
  23. package/es/crop/src/interface.d.ts +6 -0
  24. package/es/crop/src/interface.js +7 -0
  25. package/es/crop/src/styles/index.cssr.d.ts +2 -0
  26. package/es/crop/src/styles/index.cssr.js +333 -0
  27. package/es/crop/styles/_common.d.ts +4 -0
  28. package/es/crop/styles/_common.js +3 -0
  29. package/es/crop/styles/dark.d.ts +3 -0
  30. package/es/crop/styles/dark.js +9 -0
  31. package/es/crop/styles/index.d.ts +3 -0
  32. package/es/crop/styles/index.js +2 -0
  33. package/es/crop/styles/light.d.ts +14 -0
  34. package/es/crop/styles/light.js +14 -0
  35. package/es/date-picker/src/DatePicker.d.ts +1308 -43
  36. package/es/date-picker/src/DatePicker.js +54 -29
  37. package/es/date-picker/src/interface.d.ts +1 -0
  38. package/es/date-picker/src/panel/date.d.ts +141 -0
  39. package/es/date-picker/src/panel/daterange.d.ts +141 -0
  40. package/es/date-picker/src/panel/datetime.d.ts +141 -0
  41. package/es/date-picker/src/panel/datetimerange.d.ts +141 -0
  42. package/es/date-picker/src/panel/panelMonth.d.ts +283 -1
  43. package/es/date-picker/src/panel/panelMonthContent.d.ts +141 -0
  44. package/es/date-picker/src/panel/panelYear.d.ts +283 -1
  45. package/es/date-picker/src/panel/panelYearContent.d.ts +141 -0
  46. package/es/date-picker/src/panel/use-calendar.d.ts +141 -0
  47. package/es/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
  48. package/es/date-picker/src/panel/use-panel-common.d.ts +141 -0
  49. package/es/date-picker/styles/dark.js +3 -1
  50. package/es/date-picker/styles/light.d.ts +123 -0
  51. package/es/date-picker/styles/light.js +3 -1
  52. package/es/descriptions/src/Descriptions.d.ts +30 -0
  53. package/es/descriptions/src/Descriptions.js +18 -10
  54. package/es/dynamic-tags/src/DynamicTags.d.ts +30 -0
  55. package/es/dynamic-tags/styles/light.d.ts +3 -0
  56. package/es/infinite-scroll/src/InfiniteScroll.js +3 -6
  57. package/es/input/src/Input.d.ts +1 -1
  58. package/es/input-number/src/InputNumber.d.ts +1 -1
  59. package/es/legacy-transfer/src/Transfer.d.ts +1 -1
  60. package/es/locales/common/arDZ.js +2 -0
  61. package/es/locales/common/deDE.js +2 -0
  62. package/es/locales/common/enGB.js +2 -0
  63. package/es/locales/common/enUS.d.ts +2 -0
  64. package/es/locales/common/enUS.js +2 -0
  65. package/es/locales/common/eo.js +2 -0
  66. package/es/locales/common/esAR.js +2 -0
  67. package/es/locales/common/faIR.js +2 -0
  68. package/es/locales/common/frFR.js +2 -0
  69. package/es/locales/common/idID.js +2 -0
  70. package/es/locales/common/itIT.js +2 -0
  71. package/es/locales/common/jaJP.js +2 -0
  72. package/es/locales/common/koKR.js +2 -0
  73. package/es/locales/common/nbNO.js +2 -0
  74. package/es/locales/common/nlNL.js +2 -0
  75. package/es/locales/common/plPL.js +2 -0
  76. package/es/locales/common/ptBR.js +2 -0
  77. package/es/locales/common/ruRU.js +2 -0
  78. package/es/locales/common/skSK.js +2 -0
  79. package/es/locales/common/svSE.js +2 -0
  80. package/es/locales/common/thTH.js +2 -0
  81. package/es/locales/common/trTR.js +2 -0
  82. package/es/locales/common/ukUA.js +2 -0
  83. package/es/locales/common/viVN.js +2 -0
  84. package/es/locales/common/zhCN.js +2 -0
  85. package/es/locales/common/zhTW.js +2 -0
  86. package/es/modal-fullscreen/index.d.ts +2 -0
  87. package/es/modal-fullscreen/index.js +1 -0
  88. package/es/modal-fullscreen/src/ModalFull.d.ts +953 -0
  89. package/es/modal-fullscreen/src/ModalFull.js +250 -0
  90. package/es/modal-fullscreen/src/interface.d.ts +0 -0
  91. package/es/modal-fullscreen/src/interface.js +1 -0
  92. package/es/modal-fullscreen/src/styles/index.cssr.d.ts +2 -0
  93. package/es/modal-fullscreen/src/styles/index.cssr.js +85 -0
  94. package/es/modal-fullscreen/styles/_common.d.ts +12 -0
  95. package/es/modal-fullscreen/styles/_common.js +11 -0
  96. package/es/modal-fullscreen/styles/dark.d.ts +3 -0
  97. package/es/modal-fullscreen/styles/dark.js +14 -0
  98. package/es/modal-fullscreen/styles/index.d.ts +3 -0
  99. package/es/modal-fullscreen/styles/index.js +2 -0
  100. package/es/modal-fullscreen/styles/light.d.ts +100 -0
  101. package/es/modal-fullscreen/styles/light.js +19 -0
  102. package/es/rate/src/Rate.d.ts +1 -1
  103. package/es/select/src/Select.d.ts +1 -1
  104. package/es/slider/src/Slider.d.ts +1 -1
  105. package/es/switch/src/Switch.d.ts +1 -1
  106. package/es/tag/index.d.ts +2 -0
  107. package/es/tag/index.js +1 -0
  108. package/es/tag/src/Tag.d.ts +40 -0
  109. package/es/tag/src/Tag.js +3 -0
  110. package/es/tag/src/TagGroup.d.ts +644 -0
  111. package/es/tag/src/TagGroup.js +109 -0
  112. package/es/tag/src/styles/index.cssr.d.ts +1 -0
  113. package/es/tag/src/styles/index.cssr.js +8 -1
  114. package/es/tag/styles/light.d.ts +3 -0
  115. package/es/tag/styles/light.js +5 -0
  116. package/es/themes/dark.js +5 -1
  117. package/es/themes/light.js +5 -1
  118. package/es/time-picker/src/TimePicker.d.ts +1 -1
  119. package/es/transfer/src/Transfer.d.ts +1 -1
  120. package/es/tree-select/src/TreeSelect.d.ts +1 -1
  121. package/es/version.d.ts +1 -1
  122. package/es/version.js +1 -1
  123. package/es/virtual-list/index.d.ts +1 -1
  124. package/es/virtual-list/index.js +1 -1
  125. package/lib/_internal/scrollbar/src/Scrollbar.js +19 -38
  126. package/lib/auto-complete/src/AutoComplete.d.ts +1 -1
  127. package/lib/cascader/src/Cascader.d.ts +1 -1
  128. package/lib/chat/index.d.ts +1 -1
  129. package/lib/chat/src/Chat.d.ts +233 -11
  130. package/lib/chat/src/Chat.js +73 -22
  131. package/lib/chat/src/ChatParts/ChatAttachment.js +14 -12
  132. package/lib/chat/src/ChatParts/MainArea.d.ts +1 -0
  133. package/lib/chat/src/ChatParts/MainArea.js +94 -56
  134. package/lib/chat/src/ChatParts/Sidebar.d.ts +920 -0
  135. package/lib/chat/src/ChatParts/Sidebar.js +62 -11
  136. package/lib/chat/src/interface.d.ts +24 -3
  137. package/lib/chat/src/styles/index.cssr.js +13 -2
  138. package/lib/components.d.ts +2 -0
  139. package/lib/components.js +2 -0
  140. package/lib/config-provider/src/internal-interface.d.ts +4 -0
  141. package/lib/crop/index.d.ts +3 -0
  142. package/lib/crop/index.js +9 -0
  143. package/lib/crop/src/Crop.d.ts +222 -0
  144. package/lib/crop/src/Crop.js +163 -0
  145. package/lib/crop/src/interface.d.ts +6 -0
  146. package/lib/crop/src/interface.js +10 -0
  147. package/lib/crop/src/styles/index.cssr.d.ts +2 -0
  148. package/lib/crop/src/styles/index.cssr.js +338 -0
  149. package/lib/crop/styles/_common.d.ts +4 -0
  150. package/lib/crop/styles/_common.js +5 -0
  151. package/lib/crop/styles/dark.d.ts +3 -0
  152. package/lib/crop/styles/dark.js +11 -0
  153. package/lib/crop/styles/index.d.ts +3 -0
  154. package/lib/crop/styles/index.js +10 -0
  155. package/lib/crop/styles/light.d.ts +14 -0
  156. package/lib/crop/styles/light.js +21 -0
  157. package/lib/date-picker/src/DatePicker.d.ts +1308 -43
  158. package/lib/date-picker/src/DatePicker.js +53 -28
  159. package/lib/date-picker/src/interface.d.ts +1 -0
  160. package/lib/date-picker/src/panel/date.d.ts +141 -0
  161. package/lib/date-picker/src/panel/daterange.d.ts +141 -0
  162. package/lib/date-picker/src/panel/datetime.d.ts +141 -0
  163. package/lib/date-picker/src/panel/datetimerange.d.ts +141 -0
  164. package/lib/date-picker/src/panel/panelMonth.d.ts +283 -1
  165. package/lib/date-picker/src/panel/panelMonthContent.d.ts +141 -0
  166. package/lib/date-picker/src/panel/panelYear.d.ts +283 -1
  167. package/lib/date-picker/src/panel/panelYearContent.d.ts +141 -0
  168. package/lib/date-picker/src/panel/use-calendar.d.ts +141 -0
  169. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +141 -0
  170. package/lib/date-picker/src/panel/use-panel-common.d.ts +141 -0
  171. package/lib/date-picker/styles/dark.js +3 -1
  172. package/lib/date-picker/styles/light.d.ts +123 -0
  173. package/lib/date-picker/styles/light.js +3 -1
  174. package/lib/descriptions/src/Descriptions.d.ts +30 -0
  175. package/lib/descriptions/src/Descriptions.js +18 -10
  176. package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -0
  177. package/lib/dynamic-tags/styles/light.d.ts +3 -0
  178. package/lib/infinite-scroll/src/InfiniteScroll.js +3 -6
  179. package/lib/input/src/Input.d.ts +1 -1
  180. package/lib/input-number/src/InputNumber.d.ts +1 -1
  181. package/lib/legacy-transfer/src/Transfer.d.ts +1 -1
  182. package/lib/locales/common/arDZ.js +2 -0
  183. package/lib/locales/common/deDE.js +2 -0
  184. package/lib/locales/common/enGB.js +2 -0
  185. package/lib/locales/common/enUS.d.ts +2 -0
  186. package/lib/locales/common/enUS.js +2 -0
  187. package/lib/locales/common/eo.js +2 -0
  188. package/lib/locales/common/esAR.js +2 -0
  189. package/lib/locales/common/faIR.js +2 -0
  190. package/lib/locales/common/frFR.js +2 -0
  191. package/lib/locales/common/idID.js +2 -0
  192. package/lib/locales/common/itIT.js +2 -0
  193. package/lib/locales/common/jaJP.js +2 -0
  194. package/lib/locales/common/koKR.js +2 -0
  195. package/lib/locales/common/nbNO.js +2 -0
  196. package/lib/locales/common/nlNL.js +2 -0
  197. package/lib/locales/common/plPL.js +2 -0
  198. package/lib/locales/common/ptBR.js +2 -0
  199. package/lib/locales/common/ruRU.js +2 -0
  200. package/lib/locales/common/skSK.js +2 -0
  201. package/lib/locales/common/svSE.js +2 -0
  202. package/lib/locales/common/thTH.js +2 -0
  203. package/lib/locales/common/trTR.js +2 -0
  204. package/lib/locales/common/ukUA.js +2 -0
  205. package/lib/locales/common/viVN.js +2 -0
  206. package/lib/locales/common/zhCN.js +2 -0
  207. package/lib/locales/common/zhTW.js +2 -0
  208. package/lib/modal-fullscreen/index.d.ts +2 -0
  209. package/lib/modal-fullscreen/index.js +9 -0
  210. package/lib/modal-fullscreen/src/ModalFull.d.ts +953 -0
  211. package/lib/modal-fullscreen/src/ModalFull.js +256 -0
  212. package/lib/modal-fullscreen/src/interface.d.ts +0 -0
  213. package/lib/modal-fullscreen/src/interface.js +1 -0
  214. package/lib/modal-fullscreen/src/styles/index.cssr.d.ts +2 -0
  215. package/lib/modal-fullscreen/src/styles/index.cssr.js +90 -0
  216. package/lib/modal-fullscreen/styles/_common.d.ts +12 -0
  217. package/lib/modal-fullscreen/styles/_common.js +13 -0
  218. package/lib/modal-fullscreen/styles/dark.d.ts +3 -0
  219. package/lib/modal-fullscreen/styles/dark.js +16 -0
  220. package/lib/modal-fullscreen/styles/index.d.ts +3 -0
  221. package/lib/modal-fullscreen/styles/index.js +10 -0
  222. package/lib/modal-fullscreen/styles/light.d.ts +100 -0
  223. package/lib/modal-fullscreen/styles/light.js +26 -0
  224. package/lib/rate/src/Rate.d.ts +1 -1
  225. package/lib/select/src/Select.d.ts +1 -1
  226. package/lib/slider/src/Slider.d.ts +1 -1
  227. package/lib/switch/src/Switch.d.ts +1 -1
  228. package/lib/tag/index.d.ts +2 -0
  229. package/lib/tag/index.js +3 -1
  230. package/lib/tag/src/Tag.d.ts +40 -0
  231. package/lib/tag/src/Tag.js +3 -0
  232. package/lib/tag/src/TagGroup.d.ts +644 -0
  233. package/lib/tag/src/TagGroup.js +112 -0
  234. package/lib/tag/src/styles/index.cssr.d.ts +1 -0
  235. package/lib/tag/src/styles/index.cssr.js +9 -1
  236. package/lib/tag/styles/light.d.ts +3 -0
  237. package/lib/tag/styles/light.js +5 -0
  238. package/lib/themes/dark.js +5 -1
  239. package/lib/themes/light.js +5 -1
  240. package/lib/time-picker/src/TimePicker.d.ts +1 -1
  241. package/lib/transfer/src/Transfer.d.ts +1 -1
  242. package/lib/tree-select/src/TreeSelect.d.ts +1 -1
  243. package/lib/version.d.ts +1 -1
  244. package/lib/version.js +1 -1
  245. package/lib/virtual-list/index.d.ts +1 -1
  246. package/lib/virtual-list/index.js +2 -2
  247. package/package.json +4 -3
  248. package/volar.d.ts +4 -0
  249. package/web-types.json +472 -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);
@@ -57,6 +57,7 @@ export * from './menu';
57
57
  export * from './mention';
58
58
  export * from './message';
59
59
  export * from './modal';
60
+ export * from './modal-fullscreen';
60
61
  export * from './notification';
61
62
  export * from './page-header';
62
63
  export * from './pagination';
@@ -96,3 +97,4 @@ export * from './discrete';
96
97
  export * from './equation';
97
98
  export * from './toggle-button';
98
99
  export * from './flex';
100
+ export * from './crop';
package/es/components.js CHANGED
@@ -57,6 +57,7 @@ export * from './menu';
57
57
  export * from './mention';
58
58
  export * from './message';
59
59
  export * from './modal';
60
+ export * from './modal-fullscreen';
60
61
  export * from './notification';
61
62
  export * from './page-header';
62
63
  export * from './pagination';
@@ -96,3 +97,4 @@ export * from './discrete';
96
97
  export * from './equation';
97
98
  export * from './toggle-button';
98
99
  export * from './flex';
100
+ export * from './crop';
@@ -102,6 +102,8 @@ import type { FlexTheme } from '../../flex/styles';
102
102
  import { CardListTheme } from '../../card-list/styles';
103
103
  import { ActionCardTheme } from '../../action-card';
104
104
  import { ChatTheme } from '../../chat/styles';
105
+ import { ModalFullscreenTheme } from '../../modal-fullscreen/styles';
106
+ import { CropTheme } from '../../crop/styles';
105
107
  export interface GlobalThemeWithoutCommon {
106
108
  Alert?: AlertTheme;
107
109
  Anchor?: AnchorTheme;
@@ -190,6 +192,8 @@ export interface GlobalThemeWithoutCommon {
190
192
  Flex?: FlexTheme;
191
193
  CardList?: CardListTheme;
192
194
  Chat?: ChatTheme;
195
+ ModalFullscreen?: ModalFullscreenTheme;
196
+ Crop?: CropTheme;
193
197
  InternalSelectMenu?: InternalSelectMenuTheme;
194
198
  InternalSelection?: InternalSelectionTheme;
195
199
  AccountOption?: AccountOptionTheme;
@@ -0,0 +1,3 @@
1
+ export { default as UCrop, cropProps } from './src/Crop';
2
+ export type { CropProps } from './src/Crop';
3
+ export type { ViewMode } from './src/interface';
@@ -0,0 +1 @@
1
+ export { default as UCrop, cropProps } from './src/Crop';
@@ -0,0 +1,222 @@
1
+ import { PropType } from 'vue';
2
+ import { ExtractPublicPropTypes } from '../../_utils';
3
+ import { ViewMode } from './interface';
4
+ export declare const cropProps: {
5
+ src: StringConstructor;
6
+ wrapperWidth: {
7
+ type: (StringConstructor | NumberConstructor)[];
8
+ default: string;
9
+ };
10
+ wrapperHeight: {
11
+ type: (StringConstructor | NumberConstructor)[];
12
+ default: string;
13
+ };
14
+ viewMode: {
15
+ type: PropType<ViewMode>;
16
+ default: number;
17
+ };
18
+ dragMode: {
19
+ type: PropType<"crop" | "move" | "none">;
20
+ default: string;
21
+ };
22
+ aspectRatio: {
23
+ type: NumberConstructor;
24
+ default: number;
25
+ };
26
+ background: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ circleShape: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ zoomable: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ cropperThemeColor: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ cancelButtonText: {
43
+ type: StringConstructor;
44
+ default: string;
45
+ };
46
+ confirmButtonText: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
50
+ theme: PropType<import("../../_mixins").Theme<"Crop", {
51
+ wrapperBg: string;
52
+ wrapperBorderRadius: string;
53
+ wrapperMargin: string;
54
+ }, {}>>;
55
+ themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
56
+ wrapperBg: string;
57
+ wrapperBorderRadius: string;
58
+ wrapperMargin: string;
59
+ }, {}>>>;
60
+ builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
61
+ wrapperBg: string;
62
+ wrapperBorderRadius: string;
63
+ wrapperMargin: string;
64
+ }, {}>>>;
65
+ };
66
+ export type CropProps = ExtractPublicPropTypes<typeof cropProps>;
67
+ declare const _default: import("vue").DefineComponent<{
68
+ src: StringConstructor;
69
+ wrapperWidth: {
70
+ type: (StringConstructor | NumberConstructor)[];
71
+ default: string;
72
+ };
73
+ wrapperHeight: {
74
+ type: (StringConstructor | NumberConstructor)[];
75
+ default: string;
76
+ };
77
+ viewMode: {
78
+ type: PropType<ViewMode>;
79
+ default: number;
80
+ };
81
+ dragMode: {
82
+ type: PropType<"crop" | "move" | "none">;
83
+ default: string;
84
+ };
85
+ aspectRatio: {
86
+ type: NumberConstructor;
87
+ default: number;
88
+ };
89
+ background: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
93
+ circleShape: {
94
+ type: BooleanConstructor;
95
+ default: boolean;
96
+ };
97
+ zoomable: {
98
+ type: BooleanConstructor;
99
+ default: boolean;
100
+ };
101
+ cropperThemeColor: {
102
+ type: StringConstructor;
103
+ default: string;
104
+ };
105
+ cancelButtonText: {
106
+ type: StringConstructor;
107
+ default: string;
108
+ };
109
+ confirmButtonText: {
110
+ type: StringConstructor;
111
+ default: string;
112
+ };
113
+ theme: PropType<import("../../_mixins").Theme<"Crop", {
114
+ wrapperBg: string;
115
+ wrapperBorderRadius: string;
116
+ wrapperMargin: string;
117
+ }, {}>>;
118
+ themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
119
+ wrapperBg: string;
120
+ wrapperBorderRadius: string;
121
+ wrapperMargin: string;
122
+ }, {}>>>;
123
+ builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
124
+ wrapperBg: string;
125
+ wrapperBorderRadius: string;
126
+ wrapperMargin: string;
127
+ }, {}>>>;
128
+ }, {
129
+ cropWrapperRef: import("vue").Ref<HTMLDivElement | undefined>;
130
+ cropImageRef: import("vue").Ref<HTMLImageElement | undefined>;
131
+ mergedClsPrefix: import("vue").Ref<string>;
132
+ cssVars: import("vue").ComputedRef<{
133
+ '--u-wrapper-border-radius': string;
134
+ '--u-wrapper-bg-color': string;
135
+ '--u-wrapper-width': string;
136
+ '--u-wrapper-height': string;
137
+ '--u-cropper-theme-color': string;
138
+ '--u-wrapper-margin': string;
139
+ }>;
140
+ confirmCrop: () => void;
141
+ cancelCrop: () => void;
142
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
143
+ cancel: () => true;
144
+ confirm: (dataUrl: string) => true;
145
+ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
146
+ src: StringConstructor;
147
+ wrapperWidth: {
148
+ type: (StringConstructor | NumberConstructor)[];
149
+ default: string;
150
+ };
151
+ wrapperHeight: {
152
+ type: (StringConstructor | NumberConstructor)[];
153
+ default: string;
154
+ };
155
+ viewMode: {
156
+ type: PropType<ViewMode>;
157
+ default: number;
158
+ };
159
+ dragMode: {
160
+ type: PropType<"crop" | "move" | "none">;
161
+ default: string;
162
+ };
163
+ aspectRatio: {
164
+ type: NumberConstructor;
165
+ default: number;
166
+ };
167
+ background: {
168
+ type: BooleanConstructor;
169
+ default: boolean;
170
+ };
171
+ circleShape: {
172
+ type: BooleanConstructor;
173
+ default: boolean;
174
+ };
175
+ zoomable: {
176
+ type: BooleanConstructor;
177
+ default: boolean;
178
+ };
179
+ cropperThemeColor: {
180
+ type: StringConstructor;
181
+ default: string;
182
+ };
183
+ cancelButtonText: {
184
+ type: StringConstructor;
185
+ default: string;
186
+ };
187
+ confirmButtonText: {
188
+ type: StringConstructor;
189
+ default: string;
190
+ };
191
+ theme: PropType<import("../../_mixins").Theme<"Crop", {
192
+ wrapperBg: string;
193
+ wrapperBorderRadius: string;
194
+ wrapperMargin: string;
195
+ }, {}>>;
196
+ themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
197
+ wrapperBg: string;
198
+ wrapperBorderRadius: string;
199
+ wrapperMargin: string;
200
+ }, {}>>>;
201
+ builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Crop", {
202
+ wrapperBg: string;
203
+ wrapperBorderRadius: string;
204
+ wrapperMargin: string;
205
+ }, {}>>>;
206
+ }>> & {
207
+ onConfirm?: ((dataUrl: string) => any) | undefined;
208
+ onCancel?: (() => any) | undefined;
209
+ }, {
210
+ aspectRatio: number;
211
+ background: boolean;
212
+ wrapperWidth: string | number;
213
+ wrapperHeight: string | number;
214
+ viewMode: ViewMode;
215
+ dragMode: "none" | "move" | "crop";
216
+ circleShape: boolean;
217
+ zoomable: boolean;
218
+ cropperThemeColor: string;
219
+ cancelButtonText: string;
220
+ confirmButtonText: string;
221
+ }, {}>;
222
+ export default _default;
@@ -0,0 +1,157 @@
1
+ import { h, ref, watch, Fragment, computed, onMounted, defineComponent, onBeforeUnmount } from 'vue';
2
+ import Cropper from 'cropperjs';
3
+ import style from './styles/index.cssr';
4
+ import { useConfig, useTheme } from '../../_mixins';
5
+ import { cropLight } from '../styles';
6
+ import { UButton } from '../../button';
7
+ import { UFlex } from '../../flex';
8
+ export const cropProps = Object.assign(Object.assign({}, useTheme.props), { src: String, wrapperWidth: {
9
+ type: [Number, String],
10
+ default: 'auto'
11
+ }, wrapperHeight: {
12
+ type: [Number, String],
13
+ default: 'auto'
14
+ }, viewMode: {
15
+ type: Number,
16
+ default: 0
17
+ }, dragMode: {
18
+ type: String,
19
+ default: 'none'
20
+ }, aspectRatio: {
21
+ type: Number,
22
+ default: NaN
23
+ }, background: {
24
+ type: Boolean,
25
+ default: true
26
+ }, circleShape: {
27
+ type: Boolean,
28
+ default: false
29
+ }, zoomable: {
30
+ type: Boolean,
31
+ default: false
32
+ }, cropperThemeColor: {
33
+ type: String,
34
+ default: '#fff'
35
+ }, cancelButtonText: {
36
+ type: String,
37
+ default: 'Cancel'
38
+ }, confirmButtonText: {
39
+ type: String,
40
+ default: 'Save'
41
+ } });
42
+ export default defineComponent({
43
+ name: 'Crop',
44
+ inheritAttrs: false,
45
+ props: cropProps,
46
+ emits: {
47
+ cancel: () => true,
48
+ confirm: (dataUrl) => true
49
+ },
50
+ setup(props, { emit }) {
51
+ const cropWrapperRef = ref();
52
+ const cropImageRef = ref();
53
+ const cropperInstance = ref(null);
54
+ const { mergedClsPrefixRef } = useConfig(props);
55
+ const themeRef = useTheme('Crop', '-crop', style, cropLight, props, mergedClsPrefixRef);
56
+ const cssVarsRef = computed(() => {
57
+ const width = typeof props.wrapperWidth === 'string'
58
+ ? props.wrapperWidth.endsWith('px')
59
+ ? props.wrapperWidth
60
+ : `${props.wrapperWidth}px`
61
+ : `${props.wrapperWidth}px`;
62
+ const height = typeof props.wrapperHeight === 'string'
63
+ ? props.wrapperHeight.endsWith('px')
64
+ ? props.wrapperHeight
65
+ : `${props.wrapperHeight}px`
66
+ : `${props.wrapperHeight}px`;
67
+ const { self: { wrapperBorderRadius, wrapperBg, wrapperMargin } } = themeRef.value;
68
+ return {
69
+ '--u-wrapper-border-radius': wrapperBorderRadius,
70
+ '--u-wrapper-bg-color': wrapperBg,
71
+ '--u-wrapper-width': width,
72
+ '--u-wrapper-height': height,
73
+ '--u-cropper-theme-color': props.cropperThemeColor,
74
+ '--u-wrapper-margin': wrapperMargin
75
+ };
76
+ });
77
+ const initCrop = () => {
78
+ if (cropperInstance.value) {
79
+ destroyCrop();
80
+ }
81
+ if (props.src && cropWrapperRef.value && cropImageRef.value) {
82
+ cropperInstance.value = new Cropper(cropImageRef.value, {
83
+ viewMode: props.viewMode,
84
+ dragMode: props.dragMode,
85
+ aspectRatio: props.aspectRatio,
86
+ background: props.background,
87
+ guides: false,
88
+ center: false,
89
+ zoomable: props.zoomable
90
+ });
91
+ }
92
+ };
93
+ const destroyCrop = () => {
94
+ var _a;
95
+ (_a = cropperInstance.value) === null || _a === void 0 ? void 0 : _a.destroy();
96
+ cropperInstance.value = null;
97
+ };
98
+ const confirmCrop = () => {
99
+ var _a;
100
+ const sourceCanvas = (_a = cropperInstance.value) === null || _a === void 0 ? void 0 : _a.getCroppedCanvas();
101
+ if (sourceCanvas) {
102
+ if (props.circleShape) {
103
+ const canvas = document.createElement('canvas');
104
+ const context = canvas.getContext('2d');
105
+ if (context) {
106
+ const width = sourceCanvas.width;
107
+ const height = sourceCanvas.height;
108
+ canvas.width = width;
109
+ canvas.height = height;
110
+ context.imageSmoothingEnabled = true;
111
+ context.drawImage(sourceCanvas, 0, 0, width, height);
112
+ context.globalCompositeOperation = 'destination-in';
113
+ context.beginPath();
114
+ context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
115
+ context.fill();
116
+ emit('confirm', canvas.toDataURL());
117
+ }
118
+ }
119
+ else {
120
+ emit('confirm', sourceCanvas.toDataURL());
121
+ }
122
+ }
123
+ };
124
+ const cancelCrop = () => {
125
+ emit('cancel');
126
+ };
127
+ watch(props, initCrop);
128
+ onMounted(initCrop);
129
+ onBeforeUnmount(destroyCrop);
130
+ return {
131
+ cropWrapperRef,
132
+ cropImageRef,
133
+ mergedClsPrefix: mergedClsPrefixRef,
134
+ cssVars: cssVarsRef,
135
+ confirmCrop,
136
+ cancelCrop
137
+ };
138
+ },
139
+ render() {
140
+ const { src, cssVars, circleShape, mergedClsPrefix, cancelButtonText, confirmButtonText, confirmCrop, cancelCrop } = this;
141
+ return (h("div", { style: cssVars },
142
+ h("div", { ref: "cropWrapperRef", class: [
143
+ `${mergedClsPrefix}-crop-wrapper`,
144
+ circleShape ? `${mergedClsPrefix}-crop-wrapper--circle` : null
145
+ ] },
146
+ h("img", { ref: "cropImageRef", src: src, class: `${mergedClsPrefix}-crop-img` })),
147
+ h(UFlex, { justify: "end" }, {
148
+ default: () => (h(Fragment, null,
149
+ h(UButton, { secondary: true, onClick: cancelCrop }, {
150
+ default: () => cancelButtonText
151
+ }),
152
+ h(UButton, { tertiary: true, onClick: confirmCrop }, {
153
+ default: () => confirmButtonText
154
+ })))
155
+ })));
156
+ }
157
+ });
@@ -0,0 +1,6 @@
1
+ export declare enum ViewMode {
2
+ v0 = 0,
3
+ v1 = 1,
4
+ v2 = 2,
5
+ v3 = 3
6
+ }
@@ -0,0 +1,7 @@
1
+ export var ViewMode;
2
+ (function (ViewMode) {
3
+ ViewMode[ViewMode["v0"] = 0] = "v0";
4
+ ViewMode[ViewMode["v1"] = 1] = "v1";
5
+ ViewMode[ViewMode["v2"] = 2] = "v2";
6
+ ViewMode[ViewMode["v3"] = 3] = "v3";
7
+ })(ViewMode || (ViewMode = {}));
@@ -0,0 +1,2 @@
1
+ declare const _default: import("css-render").CNode;
2
+ export default _default;