@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
package/dist/index.js CHANGED
@@ -15406,6 +15406,8 @@
15406
15406
  typingText: "Typing...",
15407
15407
  retryText: "Resend",
15408
15408
  closeButtonText: "Close chat",
15409
+ shareButtonTooltip: "Share chat",
15410
+ profileButtonTooltip: "View profile",
15409
15411
  unreadNotificationText: "new messages"
15410
15412
  }
15411
15413
  };
@@ -15541,6 +15543,8 @@
15541
15543
  typingText: "Typing...",
15542
15544
  retryText: "Resend",
15543
15545
  closeButtonText: "Close chat",
15546
+ shareButtonTooltip: "Share chat",
15547
+ profileButtonTooltip: "View profile",
15544
15548
  unreadNotificationText: "new messages"
15545
15549
  }
15546
15550
  };
@@ -15677,6 +15681,8 @@
15677
15681
  typingText: "Typing...",
15678
15682
  retryText: "Resend",
15679
15683
  closeButtonText: "Close chat",
15684
+ shareButtonTooltip: "Share chat",
15685
+ profileButtonTooltip: "View profile",
15680
15686
  unreadNotificationText: "new messages"
15681
15687
  }
15682
15688
  };
@@ -15817,6 +15823,8 @@
15817
15823
  typingText: "\u041F\u0435\u0447\u0430\u0442\u0430\u0435\u0442...",
15818
15824
  retryText: "\u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",
15819
15825
  closeButtonText: "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u0447\u0430\u0442",
15826
+ shareButtonTooltip: "\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u044C\u0441\u044F \u0447\u0430\u0442\u043E\u043C",
15827
+ profileButtonTooltip: "\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C",
15820
15828
  unreadNotificationText: "\u043D\u043E\u0432\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439"
15821
15829
  }
15822
15830
  };
@@ -15953,6 +15961,8 @@
15953
15961
  typingText: "Typing...",
15954
15962
  retryText: "Resend",
15955
15963
  closeButtonText: "Close chat",
15964
+ shareButtonTooltip: "Share chat",
15965
+ profileButtonTooltip: "View profile",
15956
15966
  unreadNotificationText: "new messages"
15957
15967
  }
15958
15968
  };
@@ -16091,6 +16101,8 @@
16091
16101
  typingText: "Typing...",
16092
16102
  retryText: "Resend",
16093
16103
  closeButtonText: "Close chat",
16104
+ shareButtonTooltip: "Share chat",
16105
+ profileButtonTooltip: "View profile",
16094
16106
  unreadNotificationText: "new messages"
16095
16107
  }
16096
16108
  };
@@ -16229,6 +16241,8 @@
16229
16241
  typingText: "Typing...",
16230
16242
  retryText: "Resend",
16231
16243
  closeButtonText: "Close chat",
16244
+ shareButtonTooltip: "Share chat",
16245
+ profileButtonTooltip: "View profile",
16232
16246
  unreadNotificationText: "new messages"
16233
16247
  }
16234
16248
  };
@@ -16368,6 +16382,8 @@
16368
16382
  typingText: "Typing...",
16369
16383
  retryText: "Resend",
16370
16384
  closeButtonText: "Close chat",
16385
+ shareButtonTooltip: "Share chat",
16386
+ profileButtonTooltip: "View profile",
16371
16387
  unreadNotificationText: "new messages"
16372
16388
  }
16373
16389
  };
@@ -16503,6 +16519,8 @@
16503
16519
  typingText: "Typing...",
16504
16520
  retryText: "Resend",
16505
16521
  closeButtonText: "Close chat",
16522
+ shareButtonTooltip: "Share chat",
16523
+ profileButtonTooltip: "View profile",
16506
16524
  unreadNotificationText: "new messages"
16507
16525
  }
16508
16526
  };
@@ -16642,6 +16660,8 @@
16642
16660
  typingText: "Typing...",
16643
16661
  retryText: "Resend",
16644
16662
  closeButtonText: "Close chat",
16663
+ shareButtonTooltip: "Share chat",
16664
+ profileButtonTooltip: "View profile",
16645
16665
  unreadNotificationText: "new messages"
16646
16666
  }
16647
16667
  };
@@ -16779,6 +16799,8 @@
16779
16799
  typingText: "Typing...",
16780
16800
  retryText: "Resend",
16781
16801
  closeButtonText: "Close chat",
16802
+ shareButtonTooltip: "Share chat",
16803
+ profileButtonTooltip: "View profile",
16782
16804
  unreadNotificationText: "new messages"
16783
16805
  }
16784
16806
  };
@@ -16914,6 +16936,8 @@
16914
16936
  typingText: "Typing...",
16915
16937
  retryText: "Resend",
16916
16938
  closeButtonText: "Close chat",
16939
+ shareButtonTooltip: "Share chat",
16940
+ profileButtonTooltip: "View profile",
16917
16941
  unreadNotificationText: "new messages"
16918
16942
  }
16919
16943
  };
@@ -17053,6 +17077,8 @@
17053
17077
  typingText: "Typing...",
17054
17078
  retryText: "Resend",
17055
17079
  closeButtonText: "Close chat",
17080
+ shareButtonTooltip: "Share chat",
17081
+ profileButtonTooltip: "View profile",
17056
17082
  unreadNotificationText: "new messages"
17057
17083
  }
17058
17084
  };
@@ -17191,6 +17217,8 @@
17191
17217
  typingText: "Typing...",
17192
17218
  retryText: "Resend",
17193
17219
  closeButtonText: "Close chat",
17220
+ shareButtonTooltip: "Share chat",
17221
+ profileButtonTooltip: "View profile",
17194
17222
  unreadNotificationText: "new messages"
17195
17223
  }
17196
17224
  };
@@ -17330,6 +17358,8 @@
17330
17358
  typingText: "Typing...",
17331
17359
  retryText: "Resend",
17332
17360
  closeButtonText: "Close chat",
17361
+ shareButtonTooltip: "Share chat",
17362
+ profileButtonTooltip: "View profile",
17333
17363
  unreadNotificationText: "new messages"
17334
17364
  }
17335
17365
  };
@@ -17466,6 +17496,8 @@
17466
17496
  typingText: "Typing...",
17467
17497
  retryText: "Resend",
17468
17498
  closeButtonText: "Close chat",
17499
+ shareButtonTooltip: "Share chat",
17500
+ profileButtonTooltip: "View profile",
17469
17501
  unreadNotificationText: "new messages"
17470
17502
  }
17471
17503
  };
@@ -17604,6 +17636,8 @@
17604
17636
  typingText: "Typing...",
17605
17637
  retryText: "Resend",
17606
17638
  closeButtonText: "Close chat",
17639
+ shareButtonTooltip: "Share chat",
17640
+ profileButtonTooltip: "View profile",
17607
17641
  unreadNotificationText: "new messages"
17608
17642
  }
17609
17643
  };
@@ -17739,6 +17773,8 @@
17739
17773
  typingText: "Typing...",
17740
17774
  retryText: "Resend",
17741
17775
  closeButtonText: "Close chat",
17776
+ shareButtonTooltip: "Share chat",
17777
+ profileButtonTooltip: "View profile",
17742
17778
  unreadNotificationText: "new messages"
17743
17779
  }
17744
17780
  };
@@ -17878,6 +17914,8 @@
17878
17914
  typingText: "Typing...",
17879
17915
  retryText: "Resend",
17880
17916
  closeButtonText: "Close chat",
17917
+ shareButtonTooltip: "Share chat",
17918
+ profileButtonTooltip: "View profile",
17881
17919
  unreadNotificationText: "new messages"
17882
17920
  }
17883
17921
  };
@@ -18013,6 +18051,8 @@
18013
18051
  typingText: "Typing...",
18014
18052
  retryText: "Resend",
18015
18053
  closeButtonText: "Close chat",
18054
+ shareButtonTooltip: "Share chat",
18055
+ profileButtonTooltip: "View profile",
18016
18056
  unreadNotificationText: "new messages"
18017
18057
  }
18018
18058
  };
@@ -18149,6 +18189,8 @@
18149
18189
  typingText: "Typing...",
18150
18190
  retryText: "Resend",
18151
18191
  closeButtonText: "Close chat",
18192
+ shareButtonTooltip: "Share chat",
18193
+ profileButtonTooltip: "View profile",
18152
18194
  unreadNotificationText: "new messages"
18153
18195
  }
18154
18196
  };
@@ -18286,6 +18328,8 @@
18286
18328
  typingText: "Typing...",
18287
18329
  retryText: "Resend",
18288
18330
  closeButtonText: "Close chat",
18331
+ shareButtonTooltip: "Share chat",
18332
+ profileButtonTooltip: "View profile",
18289
18333
  unreadNotificationText: "new messages"
18290
18334
  }
18291
18335
  };
@@ -18421,6 +18465,8 @@
18421
18465
  typingText: "Typing...",
18422
18466
  retryText: "Resend",
18423
18467
  closeButtonText: "Close chat",
18468
+ shareButtonTooltip: "Share chat",
18469
+ profileButtonTooltip: "View profile",
18424
18470
  unreadNotificationText: "new messages"
18425
18471
  }
18426
18472
  };
@@ -18556,6 +18602,8 @@
18556
18602
  typingText: "Typing...",
18557
18603
  retryText: "Resend",
18558
18604
  closeButtonText: "Close chat",
18605
+ shareButtonTooltip: "Share chat",
18606
+ profileButtonTooltip: "View profile",
18559
18607
  unreadNotificationText: "new messages"
18560
18608
  }
18561
18609
  };
@@ -18691,6 +18739,8 @@
18691
18739
  typingText: "Typing...",
18692
18740
  retryText: "Resend",
18693
18741
  closeButtonText: "Close chat",
18742
+ shareButtonTooltip: "Share chat",
18743
+ profileButtonTooltip: "View profile",
18694
18744
  unreadNotificationText: "new messages"
18695
18745
  }
18696
18746
  };
@@ -40075,7 +40125,8 @@
40075
40125
  Input: inputLight,
40076
40126
  Button: buttonLight,
40077
40127
  TimePicker: timePickerLight,
40078
- Scrollbar: scrollbarLight
40128
+ Scrollbar: scrollbarLight,
40129
+ Select: internalSelectionLight
40079
40130
  },
40080
40131
  self: self$Q
40081
40132
  });
@@ -40087,7 +40138,8 @@
40087
40138
  Input: inputDark,
40088
40139
  Button: buttonDark,
40089
40140
  TimePicker: timePickerDark,
40090
- Scrollbar: scrollbarDark
40141
+ Scrollbar: scrollbarDark,
40142
+ Select: internalSelectionDark
40091
40143
  },
40092
40144
  self: self$Q
40093
40145
  };
@@ -59451,6 +59503,36 @@
59451
59503
  }
59452
59504
  });
59453
59505
 
59506
+ const scrollbarProps = {
59507
+ ...useTheme.props,
59508
+ trigger: String,
59509
+ xScrollable: Boolean,
59510
+ onScroll: Function,
59511
+ size: Number
59512
+ };
59513
+ const Scrollbar = vue.defineComponent({
59514
+ name: "Scrollbar",
59515
+ props: scrollbarProps,
59516
+ setup() {
59517
+ const scrollbarInstRef = vue.ref(null);
59518
+ const exposedMethods = {
59519
+ scrollTo: (...args) => {
59520
+ scrollbarInstRef.value?.scrollTo(args[0], args[1]);
59521
+ },
59522
+ scrollBy: (...args) => {
59523
+ scrollbarInstRef.value?.scrollBy(args[0], args[1]);
59524
+ }
59525
+ };
59526
+ return {
59527
+ ...exposedMethods,
59528
+ scrollbarInstRef
59529
+ };
59530
+ },
59531
+ render() {
59532
+ return /* @__PURE__ */ vue.h(Scrollbar$1, { ref: "scrollbarInstRef", ...this.$props }, this.$slots);
59533
+ }
59534
+ });
59535
+
59454
59536
  var style$13 = c$1([cB("align-start", `
59455
59537
  align-self: self-start;
59456
59538
  `), cB("align-center", `
@@ -60138,11 +60220,11 @@
60138
60220
  gap: 8px;
60139
60221
  `), cE("content", `
60140
60222
  flex: 1;
60141
- overflow-y: auto;
60142
60223
  min-height: 0;
60143
- padding: 16px;
60144
- padding-top: 8px;
60145
- `), cE("item", `
60224
+ `, [c$1(".u-scrollbar-content", `
60225
+ padding: 16px;
60226
+ padding-top: 8px;
60227
+ `)]), cE("item", `
60146
60228
  padding: 12px 16px;
60147
60229
  width: 100%;
60148
60230
  cursor: pointer;
@@ -60264,8 +60346,19 @@
60264
60346
  `), cE("header-title", `
60265
60347
  margin-top: 9px;
60266
60348
  color: var(--u-header-title-color);
60349
+ flex: 1;
60350
+ min-width: 0;
60351
+ overflow: hidden;
60352
+ text-overflow: ellipsis;
60353
+ white-space: nowrap;
60354
+ display: block;
60355
+ margin-right: 16px;
60267
60356
  `), cE("header-actions", `
60268
60357
  padding: 4px;
60358
+ flex-shrink: 0;
60359
+ display: flex;
60360
+ align-items: center;
60361
+ gap: 8px;
60269
60362
  `), cE("unread-notification", `
60270
60363
  background-color: var(--u-unread-notification-background-color);
60271
60364
  color: var(--u-unread-notification-text-color);
@@ -60900,10 +60993,10 @@
60900
60993
  var ChatSidebar = vue.defineComponent({
60901
60994
  name: "ChatSidebar",
60902
60995
  setup(props, { slots }) {
60903
- return { slots };
60904
- },
60905
- render() {
60906
- const { slots } = this;
60996
+ const sidebarContentRef = vue.ref();
60997
+ const lastScrollTop = vue.ref(0);
60998
+ const scrollTopFired = vue.ref(false);
60999
+ const scrollBottomFired = vue.ref(false);
60907
61000
  const {
60908
61001
  mergedClsPrefixRef,
60909
61002
  mergedThemeRef,
@@ -60917,9 +61010,35 @@
60917
61010
  listItemAvatarPropsRef,
60918
61011
  listItemBadgePropsRef,
60919
61012
  notificationsShownSetRef,
60920
- handleChatSelect
61013
+ handleChatSelect,
61014
+ onChatItemsScrollToTop,
61015
+ onChatItemsScrollToBottom
60921
61016
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
60922
61017
  } = vue.inject(chatInjectionKey);
61018
+ const handleSidebarScroll = (e) => {
61019
+ const target = e.target;
61020
+ if (!target) return;
61021
+ const { scrollTop, scrollHeight, clientHeight } = target;
61022
+ const threshold = 5;
61023
+ const scrollDirection = scrollTop > lastScrollTop.value ? "down" : "up";
61024
+ const nearTop = scrollTop <= threshold;
61025
+ const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
61026
+ if (scrollTop > threshold) {
61027
+ scrollTopFired.value = false;
61028
+ }
61029
+ if (scrollHeight - (scrollTop + clientHeight) > threshold) {
61030
+ scrollBottomFired.value = false;
61031
+ }
61032
+ if (nearTop && scrollDirection === "up" && !scrollTopFired.value) {
61033
+ scrollTopFired.value = true;
61034
+ onChatItemsScrollToTop?.value?.();
61035
+ }
61036
+ if (nearBottom && scrollDirection === "down" && !scrollBottomFired.value) {
61037
+ scrollBottomFired.value = true;
61038
+ onChatItemsScrollToBottom?.value?.();
61039
+ }
61040
+ lastScrollTop.value = scrollTop;
61041
+ };
60923
61042
  const renderListHeader = () => {
60924
61043
  return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__header` }, /* @__PURE__ */ vue.h(
60925
61044
  UFlex,
@@ -60954,55 +61073,56 @@
60954
61073
  }
60955
61074
  ));
60956
61075
  };
60957
- return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar` }, renderListHeader(), /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-sidebar__content` }, /* @__PURE__ */ vue.h(
60958
- UChatListItems,
60959
- {
60960
- chatItems: chatItemsRef.value,
60961
- selectedChatId: selectedChatIdRef.value,
60962
- typingChatIds: typingChatIdsRef.value,
60963
- typingText: typingTextRef.value,
60964
- loading: chatItemsLoadingRef.value,
60965
- loadingCount: chatItemsLoadingCountRef.value,
60966
- emptyProps: listEmptyPropsRef.value,
60967
- avatarProps: listItemAvatarPropsRef.value,
60968
- badgeProps: listItemBadgePropsRef.value,
60969
- notificationsShown: notificationsShownSetRef.value,
60970
- onChatSelect: handleChatSelect
60971
- },
60972
- {
60973
- chatItemStatus: slots.chatItemStatus
60974
- }
60975
- )));
60976
- }
60977
- });
60978
-
60979
- const scrollbarProps = {
60980
- ...useTheme.props,
60981
- trigger: String,
60982
- xScrollable: Boolean,
60983
- onScroll: Function,
60984
- size: Number
60985
- };
60986
- const Scrollbar = vue.defineComponent({
60987
- name: "Scrollbar",
60988
- props: scrollbarProps,
60989
- setup() {
60990
- const scrollbarInstRef = vue.ref(null);
60991
- const exposedMethods = {
60992
- scrollTo: (...args) => {
60993
- scrollbarInstRef.value?.scrollTo(args[0], args[1]);
60994
- },
60995
- scrollBy: (...args) => {
60996
- scrollbarInstRef.value?.scrollBy(args[0], args[1]);
60997
- }
60998
- };
60999
61076
  return {
61000
- ...exposedMethods,
61001
- scrollbarInstRef
61077
+ slots,
61078
+ sidebarContentRef,
61079
+ renderListHeader,
61080
+ handleSidebarScroll,
61081
+ mergedClsPrefixRef,
61082
+ mergedThemeRef,
61083
+ chatItemsRef,
61084
+ chatItemsLoadingRef,
61085
+ chatItemsLoadingCountRef,
61086
+ listEmptyPropsRef,
61087
+ selectedChatIdRef,
61088
+ typingChatIdsRef,
61089
+ typingTextRef,
61090
+ listItemAvatarPropsRef,
61091
+ listItemBadgePropsRef,
61092
+ notificationsShownSetRef,
61093
+ handleChatSelect
61002
61094
  };
61003
61095
  },
61004
61096
  render() {
61005
- return /* @__PURE__ */ vue.h(Scrollbar$1, { ref: "scrollbarInstRef", ...this.$props }, this.$slots);
61097
+ return /* @__PURE__ */ vue.h("div", { class: `${this.mergedClsPrefixRef}-chat-sidebar` }, this.renderListHeader(), /* @__PURE__ */ vue.h(
61098
+ Scrollbar,
61099
+ {
61100
+ ref: "sidebarContentRef",
61101
+ class: `${this.mergedClsPrefixRef}-chat-sidebar__content`,
61102
+ onScroll: this.handleSidebarScroll
61103
+ },
61104
+ {
61105
+ default: () => /* @__PURE__ */ vue.h(
61106
+ UChatListItems,
61107
+ {
61108
+ chatItems: this.chatItemsRef,
61109
+ selectedChatId: this.selectedChatIdRef,
61110
+ typingChatIds: this.typingChatIdsRef,
61111
+ typingText: this.typingTextRef,
61112
+ loading: this.chatItemsLoadingRef,
61113
+ loadingCount: this.chatItemsLoadingCountRef,
61114
+ emptyProps: this.listEmptyPropsRef,
61115
+ avatarProps: this.listItemAvatarPropsRef,
61116
+ badgeProps: this.listItemBadgePropsRef,
61117
+ notificationsShown: this.notificationsShownSetRef,
61118
+ onChatSelect: this.handleChatSelect
61119
+ },
61120
+ {
61121
+ chatItemStatus: this.slots.chatItemStatus
61122
+ }
61123
+ )
61124
+ }
61125
+ ));
61006
61126
  }
61007
61127
  });
61008
61128
 
@@ -64761,22 +64881,22 @@
64761
64881
  }
64762
64882
  },
64763
64883
  setup(props, { slots }) {
64764
- const getThumbnailUrl = (att) => {
64765
- const url = [att.preview, att.thumbnail].find(
64884
+ const getThumbnailUrl = (attachment) => {
64885
+ const url = [attachment.preview, attachment.thumbnail].find(
64766
64886
  (value) => typeof value === "string"
64767
64887
  );
64768
64888
  return url ?? null;
64769
64889
  };
64770
64890
  const renderAttachment = () => {
64771
64891
  const fileList = props.attachments.map(
64772
- (att, index) => ({
64892
+ (attachment, index) => ({
64773
64893
  id: `${String(props.message.id)}-attachment-${index}`,
64774
- name: att.name,
64775
- status: att.status || "finished",
64776
- percentage: att.percentage ?? null,
64777
- url: att.url ?? null,
64778
- thumbnailUrl: getThumbnailUrl(att),
64779
- type: att.type ?? null,
64894
+ name: attachment.name,
64895
+ status: attachment.status || "finished",
64896
+ percentage: attachment.percentage ?? null,
64897
+ url: attachment.url ?? null,
64898
+ thumbnailUrl: getThumbnailUrl(attachment),
64899
+ type: attachment.type ?? null,
64780
64900
  file: null,
64781
64901
  batchId: null
64782
64902
  })
@@ -64794,10 +64914,10 @@
64794
64914
  } : void 0,
64795
64915
  showRemoveButton: false,
64796
64916
  showDownloadButton: props.attachments.some(
64797
- (att) => att.status === "finished"
64917
+ (attachment) => attachment.status === "finished" && attachment.url && attachment.url !== "#"
64798
64918
  ),
64799
64919
  showRetryButton: props.attachments.some(
64800
- (att) => att.status === "error"
64920
+ (attachment) => attachment.status === "error"
64801
64921
  ),
64802
64922
  ...props.uploadProps
64803
64923
  },
@@ -64805,10 +64925,10 @@
64805
64925
  default: () => /* @__PURE__ */ vue.h(UUploadFileList, null, {
64806
64926
  "upload-file-title": slots["upload-file-title"] ? ({ file }) => slots["upload-file-title"]?.(file) : void 0,
64807
64927
  "upload-file-subtitle": slots["upload-file-subtitle"] ? ({ file }) => slots["upload-file-subtitle"]?.(file) : ({ file }) => {
64808
- const att = props.attachments.find(
64809
- (a) => a.name === file.name
64928
+ const attachment = props.attachments.find(
64929
+ (attachment2) => attachment2.name === file.name
64810
64930
  );
64811
- return /* @__PURE__ */ vue.h("span", { style: { fontSize: "12px", color: "#999" } }, att?.size || file.file?.size);
64931
+ return /* @__PURE__ */ vue.h("span", { style: { fontSize: "12px", color: "#999" } }, attachment?.size || file.file?.size);
64812
64932
  }
64813
64933
  })
64814
64934
  }
@@ -65341,7 +65461,6 @@
65341
65461
  }
65342
65462
  });
65343
65463
 
65344
- const SCROLL_DELAY = 50;
65345
65464
  const SENDING_DELAY = 100;
65346
65465
  var ChatMainArea = vue.defineComponent({
65347
65466
  name: "ChatMainArea",
@@ -65356,6 +65475,11 @@
65356
65475
  messagesLoadingCountRef,
65357
65476
  headerButtonPropsRef,
65358
65477
  headerIconPropsRef,
65478
+ headerShareButtonPropsRef,
65479
+ headerProfileButtonPropsRef,
65480
+ headerCloseButtonPropsRef,
65481
+ headerShareIconPropsRef,
65482
+ headerProfileIconPropsRef,
65359
65483
  messageUploadPropsRef,
65360
65484
  footerInputPropsRef,
65361
65485
  footerButtonPropsRef,
@@ -65365,21 +65489,29 @@
65365
65489
  retryTextRef,
65366
65490
  typingTextRef,
65367
65491
  closeButtonTextRef,
65492
+ shareButtonTooltipRef,
65493
+ profileButtonTooltipRef,
65368
65494
  unreadNotificationTextRef,
65369
65495
  notificationsShownSetRef,
65370
65496
  unreadCountsBeforeReadRef,
65371
65497
  markNotificationShown,
65372
65498
  handleMessageSend,
65373
65499
  handleMessageRetry,
65500
+ handleFooterInputChange,
65374
65501
  onChatClose,
65375
65502
  onChatShare,
65376
- onUserProfile
65503
+ onUserProfile,
65504
+ onMessagesScrollToTop,
65505
+ onMessagesScrollToBottom
65377
65506
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
65378
65507
  } = vue.inject(chatInjectionKey);
65379
65508
  const messagesBodyRef = vue.ref();
65380
65509
  const inputRef = vue.ref();
65381
65510
  const inputValue = vue.ref("");
65382
65511
  const attachmentFileList = vue.ref([]);
65512
+ const lastScrollTop = vue.ref(0);
65513
+ const scrollTopFired = vue.ref(false);
65514
+ const scrollBottomFired = vue.ref(false);
65383
65515
  const unreadMessagesCount = vue.computed(() => {
65384
65516
  if (!messagesRef.value) return 0;
65385
65517
  return messagesRef.value.filter(
@@ -65391,6 +65523,7 @@
65391
65523
  const unreadCountOnOpen = vue.ref(0);
65392
65524
  const chatInputs = vue.ref({});
65393
65525
  const lastMessageId = vue.ref(null);
65526
+ const shouldScrollOnLoad = vue.ref(false);
65394
65527
  vue.watch(
65395
65528
  selectedChatRef,
65396
65529
  (newChat, oldChat) => {
@@ -65399,6 +65532,10 @@
65399
65532
  const unreadBeforeRead = unreadCountsBeforeReadRef.value[newChat.id] || 0;
65400
65533
  unreadCountOnOpen.value = unreadBeforeRead;
65401
65534
  lastMessageId.value = null;
65535
+ lastScrollTop.value = 0;
65536
+ scrollTopFired.value = false;
65537
+ scrollBottomFired.value = false;
65538
+ shouldScrollOnLoad.value = true;
65402
65539
  if (unreadBeforeRead > 0 && !notificationsShownSetRef.value.has(newChat.id)) {
65403
65540
  hasUnreadMessages.value = true;
65404
65541
  showNotificationManually.value = true;
@@ -65407,12 +65544,6 @@
65407
65544
  hasUnreadMessages.value = false;
65408
65545
  showNotificationManually.value = false;
65409
65546
  }
65410
- void vue.nextTick(() => {
65411
- scrollToBottom();
65412
- });
65413
- setTimeout(() => {
65414
- scrollToBottom();
65415
- }, SCROLL_DELAY);
65416
65547
  }
65417
65548
  },
65418
65549
  { immediate: true }
@@ -65426,16 +65557,15 @@
65426
65557
  }
65427
65558
  const currentLastMessage = newMessages[newMessages.length - 1];
65428
65559
  const currentLastId = currentLastMessage?.id;
65429
- if (currentLastId !== lastMessageId.value && lastMessageId.value !== null) {
65560
+ const hasLastMessageChanged = currentLastId !== lastMessageId.value;
65561
+ if (hasLastMessageChanged && currentLastMessage && !currentLastMessage.isOwn && currentLastMessage.status === MessageStatus.UNREAD) {
65562
+ unreadCountOnOpen.value = unreadMessagesCount.value;
65563
+ }
65564
+ if (shouldScrollOnLoad.value && newMessages.length > 0) {
65565
+ shouldScrollOnLoad.value = false;
65430
65566
  void vue.nextTick(() => {
65431
65567
  scrollToBottom();
65432
65568
  });
65433
- setTimeout(() => {
65434
- scrollToBottom();
65435
- }, SCROLL_DELAY);
65436
- if (currentLastMessage && !currentLastMessage.isOwn && currentLastMessage.status === MessageStatus.UNREAD) {
65437
- unreadCountOnOpen.value = unreadMessagesCount.value;
65438
- }
65439
65569
  }
65440
65570
  lastMessageId.value = currentLastId ?? null;
65441
65571
  },
@@ -65450,17 +65580,38 @@
65450
65580
  notificationsShownSetRef.value = newSet;
65451
65581
  }
65452
65582
  });
65583
+ vue.watch(inputValue, (newValue) => {
65584
+ if (selectedChatRef.value) {
65585
+ handleFooterInputChange(newValue, selectedChatRef.value.id);
65586
+ }
65587
+ });
65453
65588
  const showUnreadNotification = vue.computed(() => {
65454
65589
  return hasUnreadMessages.value && showNotificationManually.value;
65455
65590
  });
65456
- vue.onMounted(() => {
65457
- void vue.nextTick(() => {
65458
- scrollToBottom();
65459
- });
65460
- setTimeout(() => {
65461
- scrollToBottom();
65462
- }, SCROLL_DELAY);
65463
- });
65591
+ const handleMessagesScroll = (e) => {
65592
+ const target = e.target;
65593
+ if (!target) return;
65594
+ const { scrollTop, scrollHeight, clientHeight } = target;
65595
+ const threshold = 5;
65596
+ const scrollDirection = scrollTop > lastScrollTop.value ? "down" : "up";
65597
+ const nearTop = scrollTop <= threshold;
65598
+ const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
65599
+ if (scrollTop > threshold) {
65600
+ scrollTopFired.value = false;
65601
+ }
65602
+ if (scrollHeight - (scrollTop + clientHeight) > threshold) {
65603
+ scrollBottomFired.value = false;
65604
+ }
65605
+ if (nearTop && scrollDirection === "up" && !scrollTopFired.value) {
65606
+ scrollTopFired.value = true;
65607
+ onMessagesScrollToTop?.value?.();
65608
+ }
65609
+ if (nearBottom && scrollDirection === "down" && !scrollBottomFired.value) {
65610
+ scrollBottomFired.value = true;
65611
+ onMessagesScrollToBottom?.value?.();
65612
+ }
65613
+ lastScrollTop.value = scrollTop;
65614
+ };
65464
65615
  const scrollToBottom = () => {
65465
65616
  const el = messagesBodyRef.value;
65466
65617
  if (!el) return;
@@ -65480,7 +65631,7 @@
65480
65631
  }
65481
65632
  };
65482
65633
  const renderHeader = () => {
65483
- return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-main__header` }, /* @__PURE__ */ vue.h(UFlex, { justify: "space-between", align: "flex-start" }, {
65634
+ return /* @__PURE__ */ vue.h("div", { class: `${mergedClsPrefixRef.value}-chat-main__header` }, /* @__PURE__ */ vue.h(UFlex, { justify: "space-between", align: "flex-start", wrap: false }, {
65484
65635
  default: () => /* @__PURE__ */ vue.h(vue.Fragment, null, /* @__PURE__ */ vue.h(
65485
65636
  UText,
65486
65637
  {
@@ -65490,7 +65641,7 @@
65490
65641
  themeOverrides: mergedThemeRef.value.peerOverrides.Typography
65491
65642
  },
65492
65643
  {
65493
- default: () => selectedChatRef.value?.title || "Select a chat"
65644
+ default: () => selectedChatRef.value?.title ?? ""
65494
65645
  }
65495
65646
  ), /* @__PURE__ */ vue.h(
65496
65647
  UFlex,
@@ -65500,75 +65651,115 @@
65500
65651
  class: `${mergedClsPrefixRef.value}-chat-main__header-actions`
65501
65652
  },
65502
65653
  {
65503
- default: () => resolveSlot(slots.headerActions, () => [
65504
- /* @__PURE__ */ vue.h(
65505
- Button,
65506
- {
65507
- secondary: true,
65508
- circle: true,
65509
- size: "large",
65510
- ...headerButtonPropsRef.value,
65511
- theme: mergedThemeRef.value.peers.Button,
65512
- themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65513
- onClick: () => onChatShare?.value?.()
65514
- },
65515
- {
65516
- default: () => /* @__PURE__ */ vue.h(
65517
- UIcon,
65518
- {
65519
- size: 20,
65520
- ...headerIconPropsRef.value,
65521
- theme: mergedThemeRef.value.peers.Icon,
65522
- themeOverrides: mergedThemeRef.value.peerOverrides.Icon
65523
- },
65524
- {
65525
- default: () => /* @__PURE__ */ vue.h(ArrowHookUpRight, null)
65526
- }
65527
- )
65528
- }
65529
- ),
65530
- /* @__PURE__ */ vue.h(
65531
- Button,
65532
- {
65533
- secondary: true,
65534
- circle: true,
65535
- size: "large",
65536
- ...headerButtonPropsRef.value,
65537
- theme: mergedThemeRef.value.peers.Button,
65538
- themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65539
- onClick: () => onUserProfile?.value?.()
65540
- },
65541
- {
65542
- default: () => /* @__PURE__ */ vue.h(
65543
- UIcon,
65654
+ default: () => resolveSlot(slots.headerActions, () => {
65655
+ const shareButtonProps = {
65656
+ ...headerButtonPropsRef.value,
65657
+ ...headerShareButtonPropsRef.value
65658
+ };
65659
+ const profileButtonProps = {
65660
+ ...headerButtonPropsRef.value,
65661
+ ...headerProfileButtonPropsRef.value
65662
+ };
65663
+ const closeButtonProps = {
65664
+ ...headerButtonPropsRef.value,
65665
+ ...headerCloseButtonPropsRef.value
65666
+ };
65667
+ const shareIconProps = {
65668
+ ...headerIconPropsRef.value,
65669
+ ...headerShareIconPropsRef.value
65670
+ };
65671
+ const profileIconProps = {
65672
+ ...headerIconPropsRef.value,
65673
+ ...headerProfileIconPropsRef.value
65674
+ };
65675
+ const buttons = [];
65676
+ if (shareButtonProps.disabled !== true) {
65677
+ buttons.push(
65678
+ /* @__PURE__ */ vue.h(UTooltip, null, {
65679
+ trigger: () => /* @__PURE__ */ vue.h(
65680
+ Button,
65681
+ {
65682
+ secondary: true,
65683
+ circle: true,
65684
+ size: "large",
65685
+ ...shareButtonProps,
65686
+ theme: mergedThemeRef.value.peers.Button,
65687
+ themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65688
+ onClick: () => onChatShare?.value?.()
65689
+ },
65690
+ {
65691
+ default: () => /* @__PURE__ */ vue.h(
65692
+ UIcon,
65693
+ {
65694
+ size: 20,
65695
+ ...shareIconProps,
65696
+ theme: mergedThemeRef.value.peers.Icon,
65697
+ themeOverrides: mergedThemeRef.value.peerOverrides.Icon
65698
+ },
65699
+ {
65700
+ default: () => /* @__PURE__ */ vue.h(ArrowHookUpRight, null)
65701
+ }
65702
+ )
65703
+ }
65704
+ ),
65705
+ default: () => shareButtonTooltipRef.value
65706
+ })
65707
+ );
65708
+ }
65709
+ if (profileButtonProps.disabled !== true) {
65710
+ buttons.push(
65711
+ /* @__PURE__ */ vue.h(UTooltip, null, {
65712
+ trigger: () => /* @__PURE__ */ vue.h(
65713
+ Button,
65714
+ {
65715
+ secondary: true,
65716
+ circle: true,
65717
+ size: "large",
65718
+ ...profileButtonProps,
65719
+ theme: mergedThemeRef.value.peers.Button,
65720
+ themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65721
+ onClick: () => onUserProfile?.value?.()
65722
+ },
65723
+ {
65724
+ default: () => /* @__PURE__ */ vue.h(
65725
+ UIcon,
65726
+ {
65727
+ size: 20,
65728
+ ...profileIconProps,
65729
+ theme: mergedThemeRef.value.peers.Icon,
65730
+ themeOverrides: mergedThemeRef.value.peerOverrides.Icon
65731
+ },
65732
+ {
65733
+ default: () => /* @__PURE__ */ vue.h(PersonNote, null)
65734
+ }
65735
+ )
65736
+ }
65737
+ ),
65738
+ default: () => profileButtonTooltipRef.value
65739
+ })
65740
+ );
65741
+ }
65742
+ if (closeButtonProps.disabled !== true) {
65743
+ buttons.push(
65744
+ /* @__PURE__ */ vue.h(
65745
+ Button,
65544
65746
  {
65545
- size: 20,
65546
- ...headerIconPropsRef.value,
65547
- theme: mergedThemeRef.value.peers.Icon,
65548
- themeOverrides: mergedThemeRef.value.peerOverrides.Icon
65747
+ type: "primary",
65748
+ size: "large",
65749
+ round: true,
65750
+ ...closeButtonProps,
65751
+ theme: mergedThemeRef.value.peers.Button,
65752
+ themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65753
+ onClick: () => onChatClose?.value?.()
65549
65754
  },
65550
65755
  {
65551
- default: () => /* @__PURE__ */ vue.h(PersonNote, null)
65756
+ default: () => closeButtonTextRef.value
65552
65757
  }
65553
65758
  )
65554
- }
65555
- ),
65556
- /* @__PURE__ */ vue.h(
65557
- Button,
65558
- {
65559
- type: "primary",
65560
- size: "large",
65561
- round: true,
65562
- ...headerButtonPropsRef.value,
65563
- theme: mergedThemeRef.value.peers.Button,
65564
- themeOverrides: mergedThemeRef.value.peerOverrides.Button,
65565
- onClick: () => onChatClose?.value?.()
65566
- },
65567
- {
65568
- default: () => closeButtonTextRef.value
65569
- }
65570
- )
65571
- ])
65759
+ );
65760
+ }
65761
+ return buttons;
65762
+ })
65572
65763
  }
65573
65764
  ))
65574
65765
  }));
@@ -65624,12 +65815,6 @@
65624
65815
  chatInputs.value[selectedChatRef.value.id] = "";
65625
65816
  hasUnreadMessages.value = false;
65626
65817
  showNotificationManually.value = false;
65627
- void vue.nextTick(() => {
65628
- scrollToBottom();
65629
- });
65630
- setTimeout(() => {
65631
- scrollToBottom();
65632
- }, SCROLL_DELAY);
65633
65818
  } finally {
65634
65819
  setTimeout(() => {
65635
65820
  isSending.value = false;
@@ -65673,12 +65858,6 @@
65673
65858
  handleMessageSend("", attachments);
65674
65859
  pendingFiles.value = [];
65675
65860
  attachmentFileList.value = [];
65676
- void vue.nextTick(() => {
65677
- scrollToBottom();
65678
- });
65679
- setTimeout(() => {
65680
- scrollToBottom();
65681
- }, SCROLL_DELAY);
65682
65861
  }
65683
65862
  }, SENDING_DELAY);
65684
65863
  }
@@ -65770,6 +65949,7 @@
65770
65949
  inputRef,
65771
65950
  inputValue,
65772
65951
  handleSendMessage,
65952
+ handleMessagesScroll,
65773
65953
  scrollToBottom
65774
65954
  };
65775
65955
  },
@@ -65779,7 +65959,8 @@
65779
65959
  Scrollbar,
65780
65960
  {
65781
65961
  ref: "messagesBodyRef",
65782
- class: `${mergedClsPrefixRef.value}-chat-main__body`
65962
+ class: `${mergedClsPrefixRef.value}-chat-main__body`,
65963
+ onScroll: this.handleMessagesScroll
65783
65964
  },
65784
65965
  {
65785
65966
  default: () => this.renderMessages()
@@ -65854,6 +66035,26 @@
65854
66035
  type: Object,
65855
66036
  default: void 0
65856
66037
  },
66038
+ headerShareButtonProps: {
66039
+ type: Object,
66040
+ default: void 0
66041
+ },
66042
+ headerProfileButtonProps: {
66043
+ type: Object,
66044
+ default: void 0
66045
+ },
66046
+ headerCloseButtonProps: {
66047
+ type: Object,
66048
+ default: void 0
66049
+ },
66050
+ headerShareIconProps: {
66051
+ type: Object,
66052
+ default: void 0
66053
+ },
66054
+ headerProfileIconProps: {
66055
+ type: Object,
66056
+ default: void 0
66057
+ },
65857
66058
  messageSenderAvatarProps: {
65858
66059
  type: Object,
65859
66060
  default: void 0
@@ -65902,6 +66103,14 @@
65902
66103
  type: String,
65903
66104
  default: void 0
65904
66105
  },
66106
+ shareButtonTooltip: {
66107
+ type: String,
66108
+ default: void 0
66109
+ },
66110
+ profileButtonTooltip: {
66111
+ type: String,
66112
+ default: void 0
66113
+ },
65905
66114
  unreadNotificationText: {
65906
66115
  type: String,
65907
66116
  default: void 0
@@ -65954,7 +66163,7 @@
65954
66163
  type: Function,
65955
66164
  default: void 0
65956
66165
  },
65957
- onLoadMoreChats: {
66166
+ onFooterInputChange: {
65958
66167
  type: Function,
65959
66168
  default: void 0
65960
66169
  },
@@ -65969,6 +66178,22 @@
65969
66178
  onSendError: {
65970
66179
  type: Function,
65971
66180
  default: void 0
66181
+ },
66182
+ onChatItemsScrollToTop: {
66183
+ type: Function,
66184
+ default: void 0
66185
+ },
66186
+ onChatItemsScrollToBottom: {
66187
+ type: Function,
66188
+ default: void 0
66189
+ },
66190
+ onMessagesScrollToTop: {
66191
+ type: Function,
66192
+ default: void 0
66193
+ },
66194
+ onMessagesScrollToBottom: {
66195
+ type: Function,
66196
+ default: void 0
65972
66197
  }
65973
66198
  };
65974
66199
  var Chat = vue.defineComponent({
@@ -65981,12 +66206,16 @@
65981
66206
  "attachment-upload",
65982
66207
  "mark-messages-read",
65983
66208
  "filter-change",
65984
- "load-more-chats",
66209
+ "footer-input-change",
65985
66210
  "network-error",
65986
66211
  "upload-error",
65987
- "send-error"
66212
+ "send-error",
66213
+ "chat-items-scroll-to-top",
66214
+ "chat-items-scroll-to-bottom",
66215
+ "messages-scroll-to-top",
66216
+ "messages-scroll-to-bottom"
65988
66217
  ],
65989
- setup(props, { slots, emit }) {
66218
+ setup(props, { slots, emit, expose }) {
65990
66219
  const { mergedClsPrefixRef } = useConfig(props);
65991
66220
  const themeRef = useTheme(
65992
66221
  "Chat",
@@ -66149,30 +66378,24 @@
66149
66378
  };
66150
66379
  const handleMessageRetry = (message) => {
66151
66380
  emit("message-retry", message);
66152
- props.onMessageRetry?.(message);
66153
66381
  };
66154
66382
  const markMessagesAsRead = (chatId) => {
66155
66383
  emit("mark-messages-read", chatId);
66156
66384
  };
66157
66385
  const handleFilterChange = (filter) => {
66158
66386
  emit("filter-change", filter);
66159
- props.onFilterChange?.(filter);
66160
66387
  };
66161
- const handleLoadMoreChats = (offset, limit) => {
66162
- emit("load-more-chats", { offset, limit });
66163
- props.onLoadMoreChats?.(offset, limit);
66388
+ const handleFooterInputChange = (value, chatId) => {
66389
+ emit("footer-input-change", value, chatId);
66164
66390
  };
66165
66391
  const handleNetworkError = (error) => {
66166
66392
  emit("network-error", error);
66167
- props.onNetworkError?.(error);
66168
66393
  };
66169
66394
  const handleUploadError = (error) => {
66170
66395
  emit("upload-error", error);
66171
- props.onUploadError?.(error);
66172
66396
  };
66173
66397
  const handleSendError = (error) => {
66174
66398
  emit("send-error", error);
66175
- props.onSendError?.(error);
66176
66399
  };
66177
66400
  const mergedInputPlaceholderRef = vue.computed(() => {
66178
66401
  const placeholder = props.footerInputProps?.placeholder;
@@ -66190,6 +66413,12 @@
66190
66413
  const mergedCloseButtonTextRef = vue.computed(
66191
66414
  () => props.closeButtonText ?? localeRef.value.closeButtonText
66192
66415
  );
66416
+ const mergedShareButtonTooltipRef = vue.computed(
66417
+ () => props.shareButtonTooltip ?? localeRef.value.shareButtonTooltip
66418
+ );
66419
+ const mergedProfileButtonTooltipRef = vue.computed(
66420
+ () => props.profileButtonTooltip ?? localeRef.value.profileButtonTooltip
66421
+ );
66193
66422
  const mergedUnreadNotificationTextRef = vue.computed(
66194
66423
  () => props.unreadNotificationText ?? localeRef.value.unreadNotificationText
66195
66424
  );
@@ -66213,6 +66442,11 @@
66213
66442
  emptyPropsRef: vue.toRef(props, "emptyProps"),
66214
66443
  headerButtonPropsRef: vue.toRef(props, "headerButtonProps"),
66215
66444
  headerIconPropsRef: vue.toRef(props, "headerIconProps"),
66445
+ headerShareButtonPropsRef: vue.toRef(props, "headerShareButtonProps"),
66446
+ headerProfileButtonPropsRef: vue.toRef(props, "headerProfileButtonProps"),
66447
+ headerCloseButtonPropsRef: vue.toRef(props, "headerCloseButtonProps"),
66448
+ headerShareIconPropsRef: vue.toRef(props, "headerShareIconProps"),
66449
+ headerProfileIconPropsRef: vue.toRef(props, "headerProfileIconProps"),
66216
66450
  messageSenderAvatarPropsRef: vue.toRef(props, "messageSenderAvatarProps"),
66217
66451
  messageUploadPropsRef: vue.toRef(props, "messageUploadProps"),
66218
66452
  messageButtonPropsRef: vue.toRef(props, "messageButtonProps"),
@@ -66225,6 +66459,8 @@
66225
66459
  retryTextRef: mergedRetryTextRef,
66226
66460
  typingTextRef: mergedTypingTextRef,
66227
66461
  closeButtonTextRef: mergedCloseButtonTextRef,
66462
+ shareButtonTooltipRef: mergedShareButtonTooltipRef,
66463
+ profileButtonTooltipRef: mergedProfileButtonTooltipRef,
66228
66464
  unreadNotificationTextRef: mergedUnreadNotificationTextRef,
66229
66465
  notificationsShownSetRef: notificationsShownSet,
66230
66466
  unreadCountsBeforeReadRef: unreadCountsBeforeRead,
@@ -66234,20 +66470,36 @@
66234
66470
  handleMessageRetry,
66235
66471
  markMessagesAsRead,
66236
66472
  handleFilterChange,
66237
- handleLoadMoreChats,
66473
+ handleFooterInputChange,
66238
66474
  handleNetworkError,
66239
66475
  handleUploadError,
66240
66476
  handleSendError,
66241
66477
  onChatClose: vue.toRef(props, "onChatClose"),
66242
66478
  onChatShare: vue.toRef(props, "onChatShare"),
66243
- onUserProfile: vue.toRef(props, "onUserProfile")
66479
+ onUserProfile: vue.toRef(props, "onUserProfile"),
66480
+ onChatItemsScrollToTop: vue.toRef(props, "onChatItemsScrollToTop"),
66481
+ onChatItemsScrollToBottom: vue.toRef(props, "onChatItemsScrollToBottom"),
66482
+ onMessagesScrollToTop: vue.toRef(props, "onMessagesScrollToTop"),
66483
+ onMessagesScrollToBottom: vue.toRef(props, "onMessagesScrollToBottom")
66484
+ });
66485
+ const mainAreaRef = vue.ref(null);
66486
+ const scrollToBottom = () => {
66487
+ mainAreaRef.value?.scrollToBottom();
66488
+ };
66489
+ const sendMessage = (content, attachments) => {
66490
+ handleMessageSend(content, attachments);
66491
+ };
66492
+ expose({
66493
+ scrollToBottom,
66494
+ sendMessage
66244
66495
  });
66245
66496
  return {
66246
66497
  mergedClsPrefix: mergedClsPrefixRef,
66247
66498
  mergedTheme: themeRef,
66248
66499
  cssVars: cssVarsRef,
66249
66500
  themeClass: themeClassHandle?.themeClass,
66250
- onRender: themeClassHandle?.onRender
66501
+ onRender: themeClassHandle?.onRender,
66502
+ mainAreaRef
66251
66503
  };
66252
66504
  },
66253
66505
  render() {
@@ -66272,7 +66524,7 @@
66272
66524
  sidebarHeaderActions: $slots.sidebarHeaderActions
66273
66525
  })
66274
66526
  ]), this.selectedChatId && resolveSlot($slots.default, () => [
66275
- /* @__PURE__ */ vue.h(ChatMainArea, null, {
66527
+ /* @__PURE__ */ vue.h(ChatMainArea, { ref: "mainAreaRef" }, {
66276
66528
  headerActions: $slots.headerActions
66277
66529
  })
66278
66530
  ]))
@@ -105189,6 +105441,7 @@
105189
105441
  default: void 0
105190
105442
  },
105191
105443
  clearable: Boolean,
105444
+ round: Boolean,
105192
105445
  updateValueOnClose: Boolean,
105193
105446
  defaultValue: [Number, Array],
105194
105447
  defaultFormattedValue: [String, Array],
@@ -105238,6 +105491,10 @@
105238
105491
  defaultCalendarStartTime: Number,
105239
105492
  defaultCalendarEndTime: Number,
105240
105493
  bindCalendarMonths: Boolean,
105494
+ triggerPreset: {
105495
+ type: String,
105496
+ default: "input"
105497
+ },
105241
105498
  "onUpdate:show": [Function, Array],
105242
105499
  onUpdateShow: [Function, Array],
105243
105500
  "onUpdate:formattedValue": [Function, Array],
@@ -106151,84 +106408,137 @@
106151
106408
  /* @__PURE__ */ vue.h(Binder, null, {
106152
106409
  default: () => [
106153
106410
  /* @__PURE__ */ vue.h(VTarget, null, {
106154
- default: () => this.isRange ? /* @__PURE__ */ vue.h(
106155
- UInput,
106156
- {
106157
- ref: "inputInstRef",
106158
- status: this.mergedStatus,
106159
- value: [this.displayStartTime, this.displayEndTime],
106160
- placeholder: [
106161
- this.localizedStartPlaceholder,
106162
- this.localizedEndPlaceholder
106163
- ],
106164
- textDecoration: [
106165
- this.isStartValueInvalid ? "line-through" : "",
106166
- this.isEndValueInvalid ? "line-through" : ""
106167
- ],
106168
- pair: true,
106169
- onUpdateValue: this.handleRangeUpdateValue,
106170
- theme: this.mergedTheme.peers.Input,
106171
- themeOverrides: this.mergedTheme.peerOverrides.Input,
106172
- internalForceFocus: this.mergedShow,
106173
- internalDeactivateOnEnter: true,
106174
- ...commonInputProps
106175
- },
106176
- {
106177
- separator: () => this.separator === void 0 ? resolveSlot($slots.separator, () => [
106178
- /* @__PURE__ */ vue.h(
106179
- UBaseIcon,
106180
- {
106181
- clsPrefix: mergedClsPrefix,
106182
- class: `${mergedClsPrefix}-date-picker-icon`
106183
- },
106184
- {
106185
- default: () => /* @__PURE__ */ vue.h(ToIcon, null)
106186
- }
106187
- )
106188
- ]) : this.separator,
106189
- [clearable ? "clear-icon-placeholder" : "suffix"]: () => resolveSlot($slots["date-icon"], () => [
106190
- /* @__PURE__ */ vue.h(
106411
+ default: () => {
106412
+ if ($slots.trigger) {
106413
+ return $slots.trigger({
106414
+ open: this.handleTriggerClick,
106415
+ value: this.displayTime || this.localizedPlacehoder
106416
+ });
106417
+ }
106418
+ if (this.triggerPreset === "select") {
106419
+ return /* @__PURE__ */ vue.h(
106420
+ UInternalSelection,
106421
+ {
106422
+ ref: "inputInstRef",
106423
+ selectedOption: this.displayTime ? {
106424
+ label: this.displayTime,
106425
+ value: this.displayTime
106426
+ } : null,
106427
+ round: this.round,
106428
+ status: this.mergedStatus,
106429
+ clsPrefix: mergedClsPrefix,
106430
+ bordered: this.mergedBordered,
106431
+ size: this.mergedSize,
106432
+ theme: this.mergedTheme.peers.Select,
106433
+ themeOverrides: this.mergedTheme.peerOverrides.Select,
106434
+ placeholder: this.localizedPlacehoder,
106435
+ active: this.mergedShow,
106436
+ clearable: this.clearable,
106437
+ disabled: this.mergedDisabled,
106438
+ onFocus: this.handleInputFocus,
106439
+ onBlur: this.handleInputBlur,
106440
+ onClick: this.handleTriggerClick,
106441
+ onClear: this.handleClear
106442
+ },
106443
+ {
106444
+ arrow: () => this.$slots.arrow?.()
106445
+ }
106446
+ );
106447
+ }
106448
+ if (this.triggerPreset === "button") {
106449
+ return /* @__PURE__ */ vue.h(
106450
+ Button,
106451
+ {
106452
+ round: this.round,
106453
+ size: this.mergedSize,
106454
+ theme: this.mergedTheme.peers.Button,
106455
+ themeOverrides: this.mergedTheme.peerOverrides.Button,
106456
+ onClick: this.handleTriggerClick
106457
+ },
106458
+ this.displayTime || this.localizedPlacehoder
106459
+ );
106460
+ }
106461
+ return this.isRange ? /* @__PURE__ */ vue.h(
106462
+ UInput,
106463
+ {
106464
+ ref: "inputInstRef",
106465
+ round: this.round,
106466
+ status: this.mergedStatus,
106467
+ value: [this.displayStartTime, this.displayEndTime],
106468
+ placeholder: [
106469
+ this.localizedStartPlaceholder,
106470
+ this.localizedEndPlaceholder
106471
+ ],
106472
+ textDecoration: [
106473
+ this.isStartValueInvalid ? "line-through" : "",
106474
+ this.isEndValueInvalid ? "line-through" : ""
106475
+ ],
106476
+ pair: true,
106477
+ onUpdateValue: this.handleRangeUpdateValue,
106478
+ theme: this.mergedTheme.peers.Input,
106479
+ themeOverrides: this.mergedTheme.peerOverrides.Input,
106480
+ internalForceFocus: this.mergedShow,
106481
+ internalDeactivateOnEnter: true,
106482
+ ...commonInputProps
106483
+ },
106484
+ {
106485
+ separator: () => this.separator === void 0 ? resolveSlot($slots.separator, () => [
106486
+ /* @__PURE__ */ vue.h(
106487
+ UBaseIcon,
106488
+ {
106489
+ clsPrefix: mergedClsPrefix,
106490
+ class: `${mergedClsPrefix}-date-picker-icon`
106491
+ },
106492
+ {
106493
+ default: () => /* @__PURE__ */ vue.h(ToIcon, null)
106494
+ }
106495
+ )
106496
+ ]) : this.separator,
106497
+ [clearable ? "clear-icon-placeholder" : "suffix"]: () => resolveSlot($slots["date-icon"], () => [
106498
+ /* @__PURE__ */ vue.h(
106499
+ UBaseIcon,
106500
+ {
106501
+ clsPrefix: mergedClsPrefix,
106502
+ class: `${mergedClsPrefix}-date-picker-icon`
106503
+ },
106504
+ {
106505
+ default: () => /* @__PURE__ */ vue.h(DateIcon, null)
106506
+ }
106507
+ )
106508
+ ])
106509
+ }
106510
+ ) : /* @__PURE__ */ vue.h(
106511
+ UInput,
106512
+ {
106513
+ ref: "inputInstRef",
106514
+ round: this.round,
106515
+ status: this.mergedStatus,
106516
+ value: this.displayTime,
106517
+ placeholder: this.localizedPlacehoder,
106518
+ textDecoration: this.isValueInvalid && !this.isRange ? "line-through" : "",
106519
+ onUpdateValue: this.handleSingleUpdateValue,
106520
+ theme: this.mergedTheme.peers.Input,
106521
+ themeOverrides: this.mergedTheme.peerOverrides.Input,
106522
+ internalForceFocus: this.mergedShow,
106523
+ internalDeactivateOnEnter: true,
106524
+ ...commonInputProps
106525
+ },
106526
+ {
106527
+ [clearable ? "clear-icon-placeholder" : "suffix"]: () => /* @__PURE__ */ vue.h(
106191
106528
  UBaseIcon,
106192
106529
  {
106193
106530
  clsPrefix: mergedClsPrefix,
106194
106531
  class: `${mergedClsPrefix}-date-picker-icon`
106195
106532
  },
106196
106533
  {
106197
- default: () => /* @__PURE__ */ vue.h(DateIcon, null)
106534
+ default: () => resolveSlot($slots["date-icon"], () => [
106535
+ /* @__PURE__ */ vue.h(DateIcon, null)
106536
+ ])
106198
106537
  }
106199
106538
  )
106200
- ])
106201
- }
106202
- ) : /* @__PURE__ */ vue.h(
106203
- UInput,
106204
- {
106205
- ref: "inputInstRef",
106206
- status: this.mergedStatus,
106207
- value: this.displayTime,
106208
- placeholder: this.localizedPlacehoder,
106209
- textDecoration: this.isValueInvalid && !this.isRange ? "line-through" : "",
106210
- onUpdateValue: this.handleSingleUpdateValue,
106211
- theme: this.mergedTheme.peers.Input,
106212
- themeOverrides: this.mergedTheme.peerOverrides.Input,
106213
- internalForceFocus: this.mergedShow,
106214
- internalDeactivateOnEnter: true,
106215
- ...commonInputProps
106216
- },
106217
- {
106218
- [clearable ? "clear-icon-placeholder" : "suffix"]: () => /* @__PURE__ */ vue.h(
106219
- UBaseIcon,
106220
- {
106221
- clsPrefix: mergedClsPrefix,
106222
- class: `${mergedClsPrefix}-date-picker-icon`
106223
- },
106224
- {
106225
- default: () => resolveSlot($slots["date-icon"], () => [
106226
- /* @__PURE__ */ vue.h(DateIcon, null)
106227
- ])
106228
- }
106229
- )
106230
- }
106231
- )
106539
+ }
106540
+ );
106541
+ }
106232
106542
  }),
106233
106543
  /* @__PURE__ */ vue.h(
106234
106544
  VFollower,
@@ -106377,6 +106687,14 @@
106377
106687
 
106378
106688
  const descriptionsProps = {
106379
106689
  ...useTheme.props,
106690
+ skeletonProps: {
106691
+ type: Object,
106692
+ default: () => ({
106693
+ width: "50%",
106694
+ height: "25px",
106695
+ round: true
106696
+ })
106697
+ },
106380
106698
  title: String,
106381
106699
  column: {
106382
106700
  type: Number,
@@ -106400,6 +106718,7 @@
106400
106718
  default: "medium"
106401
106719
  },
106402
106720
  bordered: Boolean,
106721
+ loadingSkeleton: Boolean,
106403
106722
  labelStyle: [Object, String],
106404
106723
  contentStyle: [Object, String]
106405
106724
  };
@@ -106494,6 +106813,8 @@
106494
106813
  labelAlign,
106495
106814
  size,
106496
106815
  bordered,
106816
+ loadingSkeleton,
106817
+ skeletonProps,
106497
106818
  title,
106498
106819
  cssVars,
106499
106820
  mergedClsPrefix,
@@ -106538,7 +106859,7 @@
106538
106859
  colspan: 1,
106539
106860
  style: labelStyle
106540
106861
  },
106541
- itemLabel
106862
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : itemLabel
106542
106863
  ),
106543
106864
  /* @__PURE__ */ vue.h(
106544
106865
  "td",
@@ -106547,7 +106868,7 @@
106547
106868
  colspan: isLastIteration ? (compitableColumn - memorizedSpan) * 2 + 1 : itemSpan * 2 - 1,
106548
106869
  style: contentStyle
106549
106870
  },
106550
- itemChildren
106871
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : itemChildren
106551
106872
  )
106552
106873
  );
106553
106874
  } else {
@@ -106564,7 +106885,7 @@
106564
106885
  class: `${mergedClsPrefix}-descriptions-table-content__label`,
106565
106886
  style: labelStyle
106566
106887
  },
106567
- [
106888
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : [
106568
106889
  ...itemLabel,
106569
106890
  separator && /* @__PURE__ */ vue.h("span", { class: `${mergedClsPrefix}-descriptions-separator` }, separator)
106570
106891
  ]
@@ -106575,7 +106896,7 @@
106575
106896
  class: `${mergedClsPrefix}-descriptions-table-content__content`,
106576
106897
  style: contentStyle
106577
106898
  },
106578
- itemChildren
106899
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : itemChildren
106579
106900
  )
106580
106901
  )
106581
106902
  );
@@ -106590,7 +106911,7 @@
106590
106911
  colspan,
106591
106912
  style: labelStyle
106592
106913
  },
106593
- itemLabel
106914
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : itemLabel
106594
106915
  )
106595
106916
  );
106596
106917
  state.secondRow.push(
@@ -106601,7 +106922,7 @@
106601
106922
  colspan,
106602
106923
  style: contentStyle
106603
106924
  },
106604
- itemChildren
106925
+ loadingSkeleton ? /* @__PURE__ */ vue.h(UBaseSkeleton, { ...skeletonProps }) : itemChildren
106605
106926
  )
106606
106927
  );
106607
106928
  }
@@ -130363,7 +130684,7 @@
130363
130684
  watermarkProps: watermarkProps
130364
130685
  });
130365
130686
 
130366
- var version = "1.9.0";
130687
+ var version = "1.9.1";
130367
130688
 
130368
130689
  function create({
130369
130690
  componentPrefix = "U",