@uzum-tech/ui 2.4.4 → 2.4.6

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 (114) hide show
  1. package/dist/index.js +118 -43
  2. package/dist/index.mjs +118 -43
  3. package/dist/index.prod.js +3 -3
  4. package/dist/index.prod.mjs +3 -3
  5. package/es/_internal/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +21 -0
  6. package/es/_internal/safe-top-scrollbar/src/SafeTopScrollbar.mjs +14 -1
  7. package/es/_internal/scrollbar/src/Scrollbar.d.ts +21 -0
  8. package/es/_internal/scrollbar/src/Scrollbar.mjs +14 -1
  9. package/es/_internal/select-menu/src/SelectMenuParts/List.d.ts +2 -0
  10. package/es/_utils/composable/use-scroll-edge-detector.d.ts +9 -0
  11. package/es/_utils/composable/use-scroll-edge-detector.mjs +44 -0
  12. package/es/button/src/Button.d.ts +4 -0
  13. package/es/button/src/Button.mjs +4 -2
  14. package/es/cascader/src/CascaderSubmenu.d.ts +2 -0
  15. package/es/chat/src/Chat.d.ts +12 -24
  16. package/es/chat/src/ChatMainArea.d.ts +4 -7
  17. package/es/chat/src/ChatMainArea.mjs +12 -37
  18. package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +1 -1
  19. package/es/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +1 -1
  20. package/es/chat/src/interface.d.ts +2 -0
  21. package/es/components.d.ts +92 -32
  22. package/es/data-table/src/DataTable.d.ts +14 -0
  23. package/es/data-table/src/DataTable.mjs +2 -0
  24. package/es/data-table/src/TableParts/Body.d.ts +2 -0
  25. package/es/data-table/src/interface.d.ts +7 -0
  26. package/es/data-table/src/interface.mjs +6 -0
  27. package/es/data-table/src/use-scroll.d.ts +1 -0
  28. package/es/data-table/src/use-scroll.mjs +8 -1
  29. package/es/date-picker/src/DatePicker.d.ts +11 -0
  30. package/es/date-picker/src/DatePicker.mjs +8 -4
  31. package/es/date-picker-v2/src/DatePickerV2.d.ts +1 -0
  32. package/es/date-picker-v2/src/DatePickerV2.mjs +6 -2
  33. package/es/date-picker-v2/src/composables/useCalendarScroll.d.ts +96 -0
  34. package/es/date-picker-v2/src/panel/CalendarPanel.d.ts +96 -0
  35. package/es/date-picker-v2/src/panel/CalendarRangePanel.d.ts +96 -0
  36. package/es/dialog/src/DialogProvider.d.ts +1 -1579
  37. package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +2 -0
  38. package/es/infinite-scroll/src/InfiniteScroll.d.ts +2 -0
  39. package/es/input/src/Input.d.ts +2 -0
  40. package/es/kanban/src/Kanban.d.ts +1 -1
  41. package/es/layout/src/Layout.d.ts +4 -0
  42. package/es/layout/src/LayoutContent.d.ts +2 -0
  43. package/es/layout/src/LayoutSider.d.ts +2 -0
  44. package/es/legacy-transfer/src/TransferList.d.ts +2 -0
  45. package/es/log/src/Log.d.ts +2 -0
  46. package/es/modal/src/BodyWrapper.d.ts +2 -0
  47. package/es/modal-fullscreen/src/ModalFull.d.ts +2 -0
  48. package/es/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +13 -0
  49. package/es/safe-top-scrollbar/src/SafeTopScrollbar.mjs +7 -0
  50. package/es/scrollbar/src/Scrollbar.d.ts +13 -0
  51. package/es/scrollbar/src/Scrollbar.mjs +7 -0
  52. package/es/time-picker/src/TimePicker.d.ts +8 -0
  53. package/es/transfer/src/TransferList.d.ts +2 -0
  54. package/es/tree/src/Tree.d.ts +2 -0
  55. package/es/typography/src/text.d.ts +1 -1
  56. package/es/version.d.ts +1 -1
  57. package/es/version.mjs +1 -1
  58. package/es/virtual-list/src/VirtualList.d.ts +2 -0
  59. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +21 -0
  60. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.js +9 -2
  61. package/lib/_internal/scrollbar/src/Scrollbar.d.ts +21 -0
  62. package/lib/_internal/scrollbar/src/Scrollbar.js +9 -2
  63. package/lib/_internal/select-menu/src/SelectMenuParts/List.d.ts +2 -0
  64. package/lib/_utils/composable/use-scroll-edge-detector.d.ts +9 -0
  65. package/lib/_utils/composable/use-scroll-edge-detector.js +42 -0
  66. package/lib/button/src/Button.d.ts +4 -0
  67. package/lib/button/src/Button.js +8 -3
  68. package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
  69. package/lib/chat/src/Chat.d.ts +12 -24
  70. package/lib/chat/src/ChatMainArea.d.ts +4 -7
  71. package/lib/chat/src/ChatMainArea.js +6 -36
  72. package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +1 -1
  73. package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +1 -1
  74. package/lib/chat/src/interface.d.ts +2 -0
  75. package/lib/components.d.ts +92 -32
  76. package/lib/data-table/src/DataTable.d.ts +14 -0
  77. package/lib/data-table/src/DataTable.js +2 -1
  78. package/lib/data-table/src/TableParts/Body.d.ts +2 -0
  79. package/lib/data-table/src/interface.d.ts +7 -0
  80. package/lib/data-table/src/interface.js +4 -1
  81. package/lib/data-table/src/use-scroll.d.ts +1 -0
  82. package/lib/data-table/src/use-scroll.js +5 -1
  83. package/lib/date-picker/src/DatePicker.d.ts +11 -0
  84. package/lib/date-picker/src/DatePicker.js +6 -2
  85. package/lib/date-picker-v2/src/DatePickerV2.d.ts +1 -0
  86. package/lib/date-picker-v2/src/DatePickerV2.js +6 -2
  87. package/lib/date-picker-v2/src/composables/useCalendarScroll.d.ts +96 -0
  88. package/lib/date-picker-v2/src/panel/CalendarPanel.d.ts +96 -0
  89. package/lib/date-picker-v2/src/panel/CalendarRangePanel.d.ts +96 -0
  90. package/lib/dialog/src/DialogProvider.d.ts +1 -1579
  91. package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +2 -0
  92. package/lib/infinite-scroll/src/InfiniteScroll.d.ts +2 -0
  93. package/lib/input/src/Input.d.ts +2 -0
  94. package/lib/kanban/src/Kanban.d.ts +1 -1
  95. package/lib/layout/src/Layout.d.ts +4 -0
  96. package/lib/layout/src/LayoutContent.d.ts +2 -0
  97. package/lib/layout/src/LayoutSider.d.ts +2 -0
  98. package/lib/legacy-transfer/src/TransferList.d.ts +2 -0
  99. package/lib/log/src/Log.d.ts +2 -0
  100. package/lib/modal/src/BodyWrapper.d.ts +2 -0
  101. package/lib/modal-fullscreen/src/ModalFull.d.ts +2 -0
  102. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +13 -0
  103. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.js +5 -1
  104. package/lib/scrollbar/src/Scrollbar.d.ts +13 -0
  105. package/lib/scrollbar/src/Scrollbar.js +5 -1
  106. package/lib/time-picker/src/TimePicker.d.ts +8 -0
  107. package/lib/transfer/src/TransferList.d.ts +2 -0
  108. package/lib/tree/src/Tree.d.ts +2 -0
  109. package/lib/typography/src/text.d.ts +1 -1
  110. package/lib/version.d.ts +1 -1
  111. package/lib/version.js +1 -1
  112. package/lib/virtual-list/src/VirtualList.d.ts +2 -0
  113. package/package.json +1 -1
  114. package/web-types.json +72 -2
@@ -11,6 +11,7 @@ const vue_1 = require("vue");
11
11
  const vueuc_1 = require("vueuc");
12
12
  const _mixins_1 = require("../../../_mixins");
13
13
  const _utils_1 = require("../../../_utils");
14
+ const use_scroll_edge_detector_1 = require("../../../_utils/composable/use-scroll-edge-detector");
14
15
  const styles_1 = require("../styles");
15
16
  const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
16
17
  const scrollbarProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { duration: {
@@ -24,7 +25,10 @@ const scrollbarProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props)
24
25
  default: 'hover'
25
26
  }, useUnifiedContainer: Boolean, triggerDisplayManually: Boolean,
26
27
  // If container is set, resize observer won't not attached
27
- container: Function, content: Function, containerClass: String, containerStyle: [String, Object], contentClass: [String, Array], contentStyle: [String, Object], horizontalRailStyle: [String, Object], verticalRailStyle: [String, Object], onScroll: Function, onWheel: Function, onResize: Function, internalOnUpdateScrollLeft: Function, internalHoistYRail: Boolean, yPlacement: {
28
+ container: Function, content: Function, containerClass: String, containerStyle: [String, Object], contentClass: [String, Array], contentStyle: [String, Object], horizontalRailStyle: [String, Object], verticalRailStyle: [String, Object], onScroll: Function, onWheel: Function, onResize: Function, onScrollToTop: Function, onScrollToBottom: Function, scrollThreshold: {
29
+ type: Number,
30
+ default: 5
31
+ }, internalOnUpdateScrollLeft: Function, internalHoistYRail: Boolean, yPlacement: {
28
32
  type: String,
29
33
  default: 'right'
30
34
  }, xPlacement: {
@@ -63,6 +67,7 @@ const Scrollbar = (0, vue_1.defineComponent)({
63
67
  let memoXLeft = 0;
64
68
  let memoMouseX = 0;
65
69
  let memoMouseY = 0;
70
+ const { detectScrollEdges, resetScrollEdgeState } = (0, use_scroll_edge_detector_1.useScrollEdgeDetector)(() => props);
66
71
  const isIos = (0, vooks_1.useIsIos)();
67
72
  const themeRef = (0, _mixins_1.useTheme)('Scrollbar', '-scrollbar', index_cssr_1.default, styles_1.scrollbarLight, props, mergedClsPrefixRef);
68
73
  const yBarSizeRef = (0, vue_1.computed)(() => {
@@ -306,6 +311,7 @@ const Scrollbar = (0, vue_1.defineComponent)({
306
311
  if (onScroll)
307
312
  onScroll(e);
308
313
  syncScrollState();
314
+ detectScrollEdges(e);
309
315
  }
310
316
  function syncScrollState() {
311
317
  // only collect scroll state, do not trigger any dom event
@@ -565,7 +571,8 @@ const Scrollbar = (0, vue_1.defineComponent)({
565
571
  sync,
566
572
  syncUnifiedContainer,
567
573
  handleMouseEnterWrapper,
568
- handleMouseLeaveWrapper
574
+ handleMouseLeaveWrapper,
575
+ resetScrollEdgeState
569
576
  };
570
577
  return Object.assign(Object.assign({}, exposedMethods), { mergedClsPrefix: mergedClsPrefixRef, rtlEnabled: rtlEnabledRef, containerScrollTop: containerScrollTopRef, wrapperRef,
571
578
  containerRef,
@@ -66,6 +66,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
66
66
  sync: () => void;
67
67
  handleMouseEnterWrapper: () => void;
68
68
  handleMouseLeaveWrapper: () => void;
69
+ resetScrollEdgeState: () => void;
69
70
  } | null, ScrollbarInst | {
70
71
  $el: HTMLElement;
71
72
  containerRef: HTMLElement | null;
@@ -77,6 +78,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
77
78
  sync: () => void;
78
79
  handleMouseEnterWrapper: () => void;
79
80
  handleMouseLeaveWrapper: () => void;
81
+ resetScrollEdgeState: () => void;
80
82
  } | null>;
81
83
  doScroll: (e: Event) => void;
82
84
  handleVirtualListScroll: (e: Event) => void;
@@ -0,0 +1,9 @@
1
+ export interface ScrollEdgeOptions {
2
+ scrollThreshold: number;
3
+ onScrollToTop?: VoidFunction;
4
+ onScrollToBottom?: VoidFunction;
5
+ }
6
+ export declare function useScrollEdgeDetector(getOptions: () => ScrollEdgeOptions): {
7
+ detectScrollEdges: (event: Event) => void;
8
+ resetScrollEdgeState: () => void;
9
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useScrollEdgeDetector = useScrollEdgeDetector;
4
+ function useScrollEdgeDetector(getOptions) {
5
+ let lastEdgeScrollTop = 0;
6
+ let scrollTopFired = false;
7
+ let scrollBottomFired = false;
8
+ const detectScrollEdges = (event) => {
9
+ var _a, _b;
10
+ const options = getOptions();
11
+ if (!options.onScrollToTop && !options.onScrollToBottom)
12
+ return;
13
+ const target = event.target;
14
+ if (!target)
15
+ return;
16
+ const { scrollTop, scrollHeight, clientHeight } = target;
17
+ const scrollDirection = scrollTop > lastEdgeScrollTop ? 'down' : 'up';
18
+ const nearTop = scrollTop <= options.scrollThreshold;
19
+ const nearBottom = scrollHeight - (scrollTop + clientHeight) <= options.scrollThreshold;
20
+ if (scrollTop > options.scrollThreshold) {
21
+ scrollTopFired = false;
22
+ }
23
+ if (scrollHeight - (scrollTop + clientHeight) > options.scrollThreshold) {
24
+ scrollBottomFired = false;
25
+ }
26
+ if (nearTop && scrollDirection === 'up' && !scrollTopFired) {
27
+ scrollTopFired = true;
28
+ (_a = options.onScrollToTop) === null || _a === void 0 ? void 0 : _a.call(options);
29
+ }
30
+ if (nearBottom && scrollDirection === 'down' && !scrollBottomFired) {
31
+ scrollBottomFired = true;
32
+ (_b = options.onScrollToBottom) === null || _b === void 0 ? void 0 : _b.call(options);
33
+ }
34
+ lastEdgeScrollTop = scrollTop;
35
+ };
36
+ const resetScrollEdgeState = () => {
37
+ lastEdgeScrollTop = 0;
38
+ scrollTopFired = false;
39
+ scrollBottomFired = false;
40
+ };
41
+ return { detectScrollEdges, resetScrollEdgeState };
42
+ }
@@ -1,6 +1,7 @@
1
1
  import type { ButtonHTMLAttributes, ExtractPropTypes, PropType, SlotsType, VNode, VNodeChild } from 'vue';
2
2
  import type { BaseWaveRef } from '../../_internal';
3
3
  import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
4
+ import type { IconProps } from '../../icon';
4
5
  import type { ButtonSize, ButtonType } from './public-types';
5
6
  export declare const buttonProps: {
6
7
  readonly color: StringConstructor;
@@ -36,6 +37,7 @@ export declare const buttonProps: {
36
37
  };
37
38
  readonly dashed: BooleanConstructor;
38
39
  readonly renderIcon: PropType<() => VNodeChild>;
40
+ readonly iconProps: PropType<IconProps>;
39
41
  readonly iconPlacement: {
40
42
  readonly type: PropType<"left" | "right">;
41
43
  readonly default: "left";
@@ -754,6 +756,7 @@ declare const Button: import("vue").DefineComponent<ExtractPropTypes<{
754
756
  };
755
757
  readonly dashed: BooleanConstructor;
756
758
  readonly renderIcon: PropType<() => VNodeChild>;
759
+ readonly iconProps: PropType<IconProps>;
757
760
  readonly iconPlacement: {
758
761
  readonly type: PropType<"left" | "right">;
759
762
  readonly default: "left";
@@ -1528,6 +1531,7 @@ declare const Button: import("vue").DefineComponent<ExtractPropTypes<{
1528
1531
  };
1529
1532
  readonly dashed: BooleanConstructor;
1530
1533
  readonly renderIcon: PropType<() => VNodeChild>;
1534
+ readonly iconProps: PropType<IconProps>;
1531
1535
  readonly iconPlacement: {
1532
1536
  readonly type: PropType<"left" | "right">;
1533
1537
  readonly default: "left";
@@ -14,6 +14,7 @@ const _utils_1 = require("../../_utils");
14
14
  const index_1 = require("../../_utils/color/index");
15
15
  const browser_1 = require("../../_utils/env/browser");
16
16
  const context_1 = require("../../button-group/src/context");
17
+ const icon_1 = require("../../icon");
17
18
  const styles_1 = require("../styles");
18
19
  const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
19
20
  exports.buttonProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { color: String, textColor: String, text: Boolean, block: Boolean, loading: Boolean, loadingSkeleton: Boolean, disabled: Boolean, circle: Boolean, size: String, ghost: Boolean, round: Boolean, secondary: Boolean, tertiary: Boolean, quaternary: Boolean, strong: Boolean, focusable: {
@@ -28,7 +29,7 @@ exports.buttonProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
28
29
  }, type: {
29
30
  type: String,
30
31
  default: 'default'
31
- }, dashed: Boolean, renderIcon: Function, iconPlacement: {
32
+ }, dashed: Boolean, renderIcon: Function, iconProps: Object, iconPlacement: {
32
33
  type: String,
33
34
  default: 'left'
34
35
  }, attrType: {
@@ -501,11 +502,15 @@ const Button = (0, vue_1.defineComponent)({
501
502
  ], tabindex: this.mergedFocusable ? 0 : -1, type: this.attrType, style: this.cssVars, disabled: this.disabled, onClick: this.handleClick, onBlur: this.handleBlur, onMousedown: this.handleMousedown, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown },
502
503
  this.iconPlacement === 'right' && children,
503
504
  (0, vue_1.h)(_internal_1.UFadeInExpandTransition, { width: true }, {
504
- default: () => (0, _utils_1.resolveWrappedSlot)(this.$slots.icon, children => (this.loading || this.renderIcon || children) && ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-button__icon`, style: {
505
+ default: () => (0, _utils_1.resolveWrappedSlot)(this.$slots.icon, children => (this.loading
506
+ || children
507
+ || this.renderIcon
508
+ || this.iconProps) && ((0, vue_1.h)("span", { class: `${mergedClsPrefix}-button__icon`, style: {
505
509
  margin: (0, _utils_1.isSlotEmpty)(this.$slots.default) ? '0' : ''
506
510
  } },
507
511
  (0, vue_1.h)(_internal_1.UIconSwitchTransition, null, {
508
- default: () => this.loading ? ((0, vue_1.h)(_internal_1.UBaseLoading, { clsPrefix: mergedClsPrefix, key: "loading", class: `${mergedClsPrefix}-icon-slot`, strokeWidth: 20 })) : ((0, vue_1.h)("div", { key: "icon", class: `${mergedClsPrefix}-icon-slot`, role: "none" }, this.renderIcon ? this.renderIcon() : children))
512
+ default: () => this.loading ? ((0, vue_1.h)(_internal_1.UBaseLoading, { clsPrefix: mergedClsPrefix, key: "loading", class: `${mergedClsPrefix}-icon-slot`, strokeWidth: 20 })) : ((0, vue_1.h)("div", { key: "icon", class: `${mergedClsPrefix}-icon-slot`, role: "none" }, children
513
+ || (this.renderIcon ? (this.renderIcon()) : this.iconProps ? ((0, vue_1.h)(icon_1.UIcon, Object.assign({}, this.iconProps))) : null)))
509
514
  }))))
510
515
  }),
511
516
  this.iconPlacement === 'left' && children,
@@ -1248,6 +1248,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1248
1248
  sync: () => void;
1249
1249
  handleMouseEnterWrapper: () => void;
1250
1250
  handleMouseLeaveWrapper: () => void;
1251
+ resetScrollEdgeState: () => void;
1251
1252
  } | null, ScrollbarInst | {
1252
1253
  $el: HTMLElement;
1253
1254
  containerRef: HTMLElement | null;
@@ -1259,6 +1260,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1259
1260
  sync: () => void;
1260
1261
  handleMouseEnterWrapper: () => void;
1261
1262
  handleMouseLeaveWrapper: () => void;
1263
+ resetScrollEdgeState: () => void;
1262
1264
  } | null>;
1263
1265
  vlInstRef: import("vue").Ref<{
1264
1266
  listElRef: HTMLElement;
@@ -10815,11 +10815,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
10815
10815
  themeClass: import("vue").Ref<string, string>;
10816
10816
  onRender: () => void;
10817
10817
  isStandalone: boolean;
10818
- messagesBodyRef: import("vue").Ref<HTMLElement | {
10819
- $el: HTMLElement;
10820
- } | undefined, HTMLElement | {
10821
- $el: HTMLElement;
10822
- } | undefined>;
10818
+ messagesBodyRef: import("vue").Ref<import("./interface").MessagesBodyInst | undefined, import("./interface").MessagesBodyInst | undefined>;
10823
10819
  inputValue: import("vue").WritableComputedRef<string, string>;
10824
10820
  attachmentFileList: import("vue").Ref<{
10825
10821
  id: string;
@@ -10875,7 +10871,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
10875
10871
  handleFooterUpdateValue: (value: string) => void;
10876
10872
  handleFooterSend: (value: string) => void;
10877
10873
  cancelEditingMessage: () => void;
10878
- handleMessagesScroll: (e: Event) => void;
10874
+ onMessagesScrollToTop: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
10875
+ onMessagesScrollToBottom: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
10879
10876
  scrollToBottom: () => void;
10880
10877
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
10881
10878
  readonly loading: boolean;
@@ -17549,11 +17546,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
17549
17546
  themeClass: import("vue").Ref<string, string>;
17550
17547
  onRender: () => void;
17551
17548
  isStandalone: boolean;
17552
- messagesBodyRef: import("vue").Ref<HTMLElement | {
17553
- $el: HTMLElement;
17554
- } | undefined, HTMLElement | {
17555
- $el: HTMLElement;
17556
- } | undefined>;
17549
+ messagesBodyRef: import("vue").Ref<import("./interface").MessagesBodyInst | undefined, import("./interface").MessagesBodyInst | undefined>;
17557
17550
  inputValue: import("vue").WritableComputedRef<string, string>;
17558
17551
  attachmentFileList: import("vue").Ref<{
17559
17552
  id: string;
@@ -17609,7 +17602,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
17609
17602
  handleFooterUpdateValue: (value: string) => void;
17610
17603
  handleFooterSend: (value: string) => void;
17611
17604
  cancelEditingMessage: () => void;
17612
- handleMessagesScroll: (e: Event) => void;
17605
+ onMessagesScrollToTop: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
17606
+ onMessagesScrollToBottom: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
17613
17607
  scrollToBottom: () => void;
17614
17608
  }, {}, {}, {}, {
17615
17609
  readonly loading: boolean;
@@ -24276,11 +24270,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
24276
24270
  themeClass: import("vue").Ref<string, string>;
24277
24271
  onRender: () => void;
24278
24272
  isStandalone: boolean;
24279
- messagesBodyRef: import("vue").Ref<HTMLElement | {
24280
- $el: HTMLElement;
24281
- } | undefined, HTMLElement | {
24282
- $el: HTMLElement;
24283
- } | undefined>;
24273
+ messagesBodyRef: import("vue").Ref<import("./interface").MessagesBodyInst | undefined, import("./interface").MessagesBodyInst | undefined>;
24284
24274
  inputValue: import("vue").WritableComputedRef<string, string>;
24285
24275
  attachmentFileList: import("vue").Ref<{
24286
24276
  id: string;
@@ -24336,7 +24326,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
24336
24326
  handleFooterUpdateValue: (value: string) => void;
24337
24327
  handleFooterSend: (value: string) => void;
24338
24328
  cancelEditingMessage: () => void;
24339
- handleMessagesScroll: (e: Event) => void;
24329
+ onMessagesScrollToTop: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
24330
+ onMessagesScrollToBottom: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
24340
24331
  scrollToBottom: () => void;
24341
24332
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
24342
24333
  readonly loading: boolean;
@@ -31010,11 +31001,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
31010
31001
  themeClass: import("vue").Ref<string, string>;
31011
31002
  onRender: () => void;
31012
31003
  isStandalone: boolean;
31013
- messagesBodyRef: import("vue").Ref<HTMLElement | {
31014
- $el: HTMLElement;
31015
- } | undefined, HTMLElement | {
31016
- $el: HTMLElement;
31017
- } | undefined>;
31004
+ messagesBodyRef: import("vue").Ref<import("./interface").MessagesBodyInst | undefined, import("./interface").MessagesBodyInst | undefined>;
31018
31005
  inputValue: import("vue").WritableComputedRef<string, string>;
31019
31006
  attachmentFileList: import("vue").Ref<{
31020
31007
  id: string;
@@ -31070,7 +31057,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
31070
31057
  handleFooterUpdateValue: (value: string) => void;
31071
31058
  handleFooterSend: (value: string) => void;
31072
31059
  cancelEditingMessage: () => void;
31073
- handleMessagesScroll: (e: Event) => void;
31060
+ onMessagesScrollToTop: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
31061
+ onMessagesScrollToBottom: import("vue").Ref<(() => void) | undefined, (() => void) | undefined>;
31074
31062
  scrollToBottom: () => void;
31075
31063
  }, {}, {}, {}, {
31076
31064
  readonly loading: boolean;
@@ -5,7 +5,7 @@ import type { ButtonProps } from '../../button';
5
5
  import type { IconProps } from '../../icon';
6
6
  import type { InputProps } from '../../input';
7
7
  import type { UploadFileInfo, UploadProps } from '../../upload';
8
- import type { ChatBubbleAction, ChatId, ChatListItemData, ChatMessageData, HandleOnChangeType, OnAttachmentDownload, OnAttachmentUpload, OnMessageSend } from './interface';
8
+ import type { ChatBubbleAction, ChatId, ChatListItemData, ChatMessageData, HandleOnChangeType, MessagesBodyInst, OnAttachmentDownload, OnAttachmentUpload, OnMessageSend } from './interface';
9
9
  export declare const chatMainAreaProps: {
10
10
  readonly selectedChat: {
11
11
  readonly type: PropType<ChatListItemData>;
@@ -9430,11 +9430,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9430
9430
  themeClass: Ref<string, string>;
9431
9431
  onRender: () => void;
9432
9432
  isStandalone: boolean;
9433
- messagesBodyRef: Ref<HTMLElement | {
9434
- $el: HTMLElement;
9435
- } | undefined, HTMLElement | {
9436
- $el: HTMLElement;
9437
- } | undefined>;
9433
+ messagesBodyRef: Ref<MessagesBodyInst | undefined, MessagesBodyInst | undefined>;
9438
9434
  inputValue: import("vue").WritableComputedRef<string, string>;
9439
9435
  attachmentFileList: Ref<{
9440
9436
  id: string;
@@ -9490,7 +9486,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9490
9486
  handleFooterUpdateValue: (value: string) => void;
9491
9487
  handleFooterSend: (value: string) => void;
9492
9488
  cancelEditingMessage: () => void;
9493
- handleMessagesScroll: (e: Event) => void;
9489
+ onMessagesScrollToTop: Ref<(() => void) | undefined, (() => void) | undefined>;
9490
+ onMessagesScrollToBottom: Ref<(() => void) | undefined, (() => void) | undefined>;
9494
9491
  scrollToBottom: () => void;
9495
9492
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9496
9493
  readonly selectedChat: {
@@ -274,9 +274,6 @@ exports.default = (0, vue_1.defineComponent)({
274
274
  });
275
275
  const attachmentFileList = (0, vue_1.ref)([]);
276
276
  const uploadedAttachmentsMap = (0, vue_1.ref)(new Map());
277
- const lastScrollTop = (0, vue_1.ref)(0);
278
- const scrollTopFired = (0, vue_1.ref)(false);
279
- const scrollBottomFired = (0, vue_1.ref)(false);
280
277
  const editingMessage = (0, vue_1.ref)(null);
281
278
  const unreadMessagesCount = (0, vue_1.computed)(() => {
282
279
  if (!messagesRef.value)
@@ -295,9 +292,9 @@ exports.default = (0, vue_1.defineComponent)({
295
292
  const unreadBeforeRead = unreadCountsBeforeReadRef.value[newChat.id] || 0;
296
293
  unreadCountOnOpen.value = unreadBeforeRead;
297
294
  lastMessageId.value = null;
298
- lastScrollTop.value = 0;
299
- scrollTopFired.value = false;
300
- scrollBottomFired.value = false;
295
+ const scrollbarInst = messagesBodyRef.value;
296
+ if (scrollbarInst && 'resetScrollEdgeState' in scrollbarInst)
297
+ scrollbarInst.resetScrollEdgeState();
301
298
  shouldScrollOnLoad.value = true;
302
299
  attachmentFileList.value = [];
303
300
  uploadedAttachmentsMap.value.clear();
@@ -361,34 +358,6 @@ exports.default = (0, vue_1.defineComponent)({
361
358
  const showUnreadNotification = (0, vue_1.computed)(() => {
362
359
  return hasUnreadMessages.value && showNotificationManually.value;
363
360
  });
364
- const handleMessagesScroll = (e) => {
365
- var _a, _b;
366
- const target = e.target;
367
- if (!target)
368
- return;
369
- const { scrollTop, scrollHeight, clientHeight } = target;
370
- const threshold = 5;
371
- const scrollDirection = scrollTop > lastScrollTop.value ? 'down' : 'up';
372
- const nearTop = scrollTop <= threshold;
373
- const nearBottom = scrollHeight - (scrollTop + clientHeight) <= threshold;
374
- if (scrollTop > threshold) {
375
- scrollTopFired.value = false;
376
- }
377
- if (scrollHeight - (scrollTop + clientHeight) > threshold) {
378
- scrollBottomFired.value = false;
379
- }
380
- if (nearTop && scrollDirection === 'up' && !scrollTopFired.value) {
381
- scrollTopFired.value = true;
382
- (_a = onMessagesScrollToTop === null || onMessagesScrollToTop === void 0 ? void 0 : onMessagesScrollToTop.value) === null || _a === void 0 ? void 0 : _a.call(onMessagesScrollToTop);
383
- }
384
- if (nearBottom
385
- && scrollDirection === 'down'
386
- && !scrollBottomFired.value) {
387
- scrollBottomFired.value = true;
388
- (_b = onMessagesScrollToBottom === null || onMessagesScrollToBottom === void 0 ? void 0 : onMessagesScrollToBottom.value) === null || _b === void 0 ? void 0 : _b.call(onMessagesScrollToBottom);
389
- }
390
- lastScrollTop.value = scrollTop;
391
- };
392
361
  function scrollToBottom() {
393
362
  const element = messagesBodyRef.value;
394
363
  if (!element)
@@ -633,7 +602,8 @@ exports.default = (0, vue_1.defineComponent)({
633
602
  handleFooterUpdateValue,
634
603
  handleFooterSend,
635
604
  cancelEditingMessage,
636
- handleMessagesScroll,
605
+ onMessagesScrollToTop,
606
+ onMessagesScrollToBottom,
637
607
  scrollToBottom
638
608
  };
639
609
  },
@@ -646,7 +616,7 @@ exports.default = (0, vue_1.defineComponent)({
646
616
  this.isStandalone && `${mergedClsPrefix}-chat-main--standalone`
647
617
  ] },
648
618
  !this.isStandalone && ((0, vue_1.h)(ChatHeader_1.default, null, { actions: this.$slots.headerActions })),
649
- (0, vue_1.h)(safe_top_scrollbar_1.USafeTopScrollbar, { ref: "messagesBodyRef", class: `${mergedClsPrefix}-chat-main__body`, onScroll: this.handleMessagesScroll }, {
619
+ (0, vue_1.h)(safe_top_scrollbar_1.USafeTopScrollbar, { ref: "messagesBodyRef", class: `${mergedClsPrefix}-chat-main__body`, onScrollToTop: () => { var _a; return (_a = this.onMessagesScrollToTop) === null || _a === void 0 ? void 0 : _a.call(this); }, onScrollToBottom: () => { var _a; return (_a = this.onMessagesScrollToBottom) === null || _a === void 0 ? void 0 : _a.call(this); } }, {
650
620
  default: () => ((0, vue_1.h)(ChatMessagesArea_1.default, { showUnreadNotification: this.showUnreadNotification, unreadNotificationCount: this.unreadCountOnOpen }, {
651
621
  messageAttachment: this.$slots.messageAttachment,
652
622
  messageAttachmentTitle: this.$slots.messageAttachmentTitle,
@@ -9114,7 +9114,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9114
9114
  }>> & Readonly<{}>, {
9115
9115
  readonly disabled: boolean;
9116
9116
  readonly show: boolean;
9117
- readonly buttonProps: Partial<ButtonProps>;
9118
9117
  readonly iconProps: Partial<IconProps>;
9118
+ readonly buttonProps: Partial<ButtonProps>;
9119
9119
  }, SlotsType<ChatAttachmentButtonSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9120
9120
  export default _default;
@@ -9225,12 +9225,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
9225
9225
  readonly closeButtonText: string;
9226
9226
  readonly shareButtonTooltip: string;
9227
9227
  readonly profileButtonTooltip: string;
9228
+ readonly iconProps: Partial<IconProps>;
9228
9229
  readonly typingChatIds: import("../../interface").ChatId[];
9229
9230
  readonly onChatClose: VoidFunction;
9230
9231
  readonly onChatShare: VoidFunction;
9231
9232
  readonly onUserProfile: VoidFunction;
9232
9233
  readonly buttonProps: Partial<ButtonProps>;
9233
- readonly iconProps: Partial<IconProps>;
9234
9234
  readonly selectedChat: ChatListItemData;
9235
9235
  readonly shareButtonProps: Partial<ButtonProps>;
9236
9236
  readonly profileButtonProps: Partial<ButtonProps>;
@@ -7,6 +7,7 @@ import type { ButtonProps } from '../../button';
7
7
  import type { EmptyProps } from '../../empty';
8
8
  import type { IconProps } from '../../icon';
9
9
  import type { InputProps } from '../../input';
10
+ import type { SafeTopScrollbarInst } from '../../safe-top-scrollbar';
10
11
  import type { UploadProps } from '../../upload';
11
12
  import type { OnChangePayload } from '../../upload/src/interface';
12
13
  import type { ChatTheme } from '../styles';
@@ -250,6 +251,7 @@ export interface ChatListInst {
250
251
  addItem: (item: ChatListItemData) => void;
251
252
  removeItem: (key: ChatId) => void;
252
253
  }
254
+ export type MessagesBodyInst = HTMLElement | SafeTopScrollbarInst;
253
255
  export type HandleOnChangeType = ((data: OnChangePayload) => void) | undefined;
254
256
  export type OnChatSelect = (key: ChatId, item: ChatListItemData) => void;
255
257
  export type OnMessageSend = (content: string, attachments?: ChatAttachment[]) => void;