@uzum-tech/ui 2.4.4 → 2.4.5

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 (102) hide show
  1. package/dist/index.js +115 -41
  2. package/dist/index.mjs +115 -41
  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/cascader/src/CascaderSubmenu.d.ts +2 -0
  13. package/es/chat/src/Chat.d.ts +12 -24
  14. package/es/chat/src/ChatMainArea.d.ts +4 -7
  15. package/es/chat/src/ChatMainArea.mjs +12 -37
  16. package/es/chat/src/interface.d.ts +2 -0
  17. package/es/components.d.ts +88 -31
  18. package/es/data-table/src/DataTable.d.ts +14 -0
  19. package/es/data-table/src/DataTable.mjs +2 -0
  20. package/es/data-table/src/TableParts/Body.d.ts +2 -0
  21. package/es/data-table/src/interface.d.ts +7 -0
  22. package/es/data-table/src/interface.mjs +6 -0
  23. package/es/data-table/src/use-scroll.d.ts +1 -0
  24. package/es/data-table/src/use-scroll.mjs +8 -1
  25. package/es/date-picker/src/DatePicker.d.ts +11 -0
  26. package/es/date-picker/src/DatePicker.mjs +8 -4
  27. package/es/date-picker-v2/src/DatePickerV2.d.ts +1 -0
  28. package/es/date-picker-v2/src/DatePickerV2.mjs +6 -2
  29. package/es/date-picker-v2/src/composables/useCalendarScroll.d.ts +96 -0
  30. package/es/date-picker-v2/src/panel/CalendarPanel.d.ts +96 -0
  31. package/es/date-picker-v2/src/panel/CalendarRangePanel.d.ts +96 -0
  32. package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +2 -0
  33. package/es/infinite-scroll/src/InfiniteScroll.d.ts +2 -0
  34. package/es/input/src/Input.d.ts +2 -0
  35. package/es/kanban/src/Kanban.d.ts +1 -1
  36. package/es/layout/src/Layout.d.ts +4 -0
  37. package/es/layout/src/LayoutContent.d.ts +2 -0
  38. package/es/layout/src/LayoutSider.d.ts +2 -0
  39. package/es/legacy-transfer/src/TransferList.d.ts +2 -0
  40. package/es/log/src/Log.d.ts +2 -0
  41. package/es/modal/src/BodyWrapper.d.ts +2 -0
  42. package/es/modal-fullscreen/src/ModalFull.d.ts +2 -0
  43. package/es/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +13 -0
  44. package/es/safe-top-scrollbar/src/SafeTopScrollbar.mjs +7 -0
  45. package/es/scrollbar/src/Scrollbar.d.ts +13 -0
  46. package/es/scrollbar/src/Scrollbar.mjs +7 -0
  47. package/es/time-picker/src/TimePicker.d.ts +8 -0
  48. package/es/transfer/src/TransferList.d.ts +2 -0
  49. package/es/tree/src/Tree.d.ts +2 -0
  50. package/es/version.d.ts +1 -1
  51. package/es/version.mjs +1 -1
  52. package/es/virtual-list/src/VirtualList.d.ts +2 -0
  53. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +21 -0
  54. package/lib/_internal/safe-top-scrollbar/src/SafeTopScrollbar.js +9 -2
  55. package/lib/_internal/scrollbar/src/Scrollbar.d.ts +21 -0
  56. package/lib/_internal/scrollbar/src/Scrollbar.js +9 -2
  57. package/lib/_internal/select-menu/src/SelectMenuParts/List.d.ts +2 -0
  58. package/lib/_utils/composable/use-scroll-edge-detector.d.ts +9 -0
  59. package/lib/_utils/composable/use-scroll-edge-detector.js +42 -0
  60. package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
  61. package/lib/chat/src/Chat.d.ts +12 -24
  62. package/lib/chat/src/ChatMainArea.d.ts +4 -7
  63. package/lib/chat/src/ChatMainArea.js +6 -36
  64. package/lib/chat/src/interface.d.ts +2 -0
  65. package/lib/components.d.ts +88 -31
  66. package/lib/data-table/src/DataTable.d.ts +14 -0
  67. package/lib/data-table/src/DataTable.js +2 -1
  68. package/lib/data-table/src/TableParts/Body.d.ts +2 -0
  69. package/lib/data-table/src/interface.d.ts +7 -0
  70. package/lib/data-table/src/interface.js +4 -1
  71. package/lib/data-table/src/use-scroll.d.ts +1 -0
  72. package/lib/data-table/src/use-scroll.js +5 -1
  73. package/lib/date-picker/src/DatePicker.d.ts +11 -0
  74. package/lib/date-picker/src/DatePicker.js +6 -2
  75. package/lib/date-picker-v2/src/DatePickerV2.d.ts +1 -0
  76. package/lib/date-picker-v2/src/DatePickerV2.js +6 -2
  77. package/lib/date-picker-v2/src/composables/useCalendarScroll.d.ts +96 -0
  78. package/lib/date-picker-v2/src/panel/CalendarPanel.d.ts +96 -0
  79. package/lib/date-picker-v2/src/panel/CalendarRangePanel.d.ts +96 -0
  80. package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +2 -0
  81. package/lib/infinite-scroll/src/InfiniteScroll.d.ts +2 -0
  82. package/lib/input/src/Input.d.ts +2 -0
  83. package/lib/kanban/src/Kanban.d.ts +1 -1
  84. package/lib/layout/src/Layout.d.ts +4 -0
  85. package/lib/layout/src/LayoutContent.d.ts +2 -0
  86. package/lib/layout/src/LayoutSider.d.ts +2 -0
  87. package/lib/legacy-transfer/src/TransferList.d.ts +2 -0
  88. package/lib/log/src/Log.d.ts +2 -0
  89. package/lib/modal/src/BodyWrapper.d.ts +2 -0
  90. package/lib/modal-fullscreen/src/ModalFull.d.ts +2 -0
  91. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.d.ts +13 -0
  92. package/lib/safe-top-scrollbar/src/SafeTopScrollbar.js +5 -1
  93. package/lib/scrollbar/src/Scrollbar.d.ts +13 -0
  94. package/lib/scrollbar/src/Scrollbar.js +5 -1
  95. package/lib/time-picker/src/TimePicker.d.ts +8 -0
  96. package/lib/transfer/src/TransferList.d.ts +2 -0
  97. package/lib/tree/src/Tree.d.ts +2 -0
  98. package/lib/version.d.ts +1 -1
  99. package/lib/version.js +1 -1
  100. package/lib/virtual-list/src/VirtualList.d.ts +2 -0
  101. package/package.json +1 -1
  102. package/web-types.json +61 -1
@@ -13,11 +13,15 @@ export type ScrollBy = ScrollTo;
13
13
  export interface ScrollbarInst {
14
14
  scrollTo: ScrollTo;
15
15
  scrollBy: ScrollBy;
16
+ resetScrollEdgeState: () => void;
16
17
  }
17
18
  export declare const scrollbarProps: {
18
19
  readonly trigger: PropType<"none" | "hover">;
19
20
  readonly xScrollable: BooleanConstructor;
20
21
  readonly onScroll: PropType<(e: Event) => void>;
22
+ readonly onScrollToTop: PropType<() => void>;
23
+ readonly onScrollToBottom: PropType<() => void>;
24
+ readonly scrollThreshold: NumberConstructor;
21
25
  readonly contentClass: StringConstructor;
22
26
  readonly contentStyle: PropType<string | Record<string, any>>;
23
27
  readonly size: NumberConstructor;
@@ -71,6 +75,9 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
71
75
  readonly trigger: PropType<"none" | "hover">;
72
76
  readonly xScrollable: BooleanConstructor;
73
77
  readonly onScroll: PropType<(e: Event) => void>;
78
+ readonly onScrollToTop: PropType<() => void>;
79
+ readonly onScrollToBottom: PropType<() => void>;
80
+ readonly scrollThreshold: NumberConstructor;
74
81
  readonly contentClass: StringConstructor;
75
82
  readonly contentStyle: PropType<string | Record<string, any>>;
76
83
  readonly size: NumberConstructor;
@@ -130,6 +137,7 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
130
137
  sync: () => void;
131
138
  handleMouseEnterWrapper: () => void;
132
139
  handleMouseLeaveWrapper: () => void;
140
+ resetScrollEdgeState: () => void;
133
141
  } | null, InternalScrollbarInst | {
134
142
  $el: HTMLElement;
135
143
  containerRef: HTMLElement | null;
@@ -141,13 +149,18 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
141
149
  sync: () => void;
142
150
  handleMouseEnterWrapper: () => void;
143
151
  handleMouseLeaveWrapper: () => void;
152
+ resetScrollEdgeState: () => void;
144
153
  } | null>;
145
154
  scrollTo: ScrollTo;
146
155
  scrollBy: ScrollBy;
156
+ resetScrollEdgeState: () => void;
147
157
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
148
158
  readonly trigger: PropType<"none" | "hover">;
149
159
  readonly xScrollable: BooleanConstructor;
150
160
  readonly onScroll: PropType<(e: Event) => void>;
161
+ readonly onScrollToTop: PropType<() => void>;
162
+ readonly onScrollToBottom: PropType<() => void>;
163
+ readonly scrollThreshold: NumberConstructor;
151
164
  readonly contentClass: StringConstructor;
152
165
  readonly contentStyle: PropType<string | Record<string, any>>;
153
166
  readonly size: NumberConstructor;
@@ -5,6 +5,9 @@ export const scrollbarProps = Object.assign(Object.assign({}, useTheme.props), {
5
5
  trigger: String,
6
6
  xScrollable: Boolean,
7
7
  onScroll: Function,
8
+ onScrollToTop: Function,
9
+ onScrollToBottom: Function,
10
+ scrollThreshold: Number,
8
11
  contentClass: String,
9
12
  contentStyle: [Object, String],
10
13
  size: Number,
@@ -30,6 +33,10 @@ const Scrollbar = defineComponent({
30
33
  scrollBy: (...args) => {
31
34
  var _a;
32
35
  (_a = scrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.scrollBy(args[0], args[1]);
36
+ },
37
+ resetScrollEdgeState: () => {
38
+ var _a;
39
+ (_a = scrollbarInstRef.value) === null || _a === void 0 ? void 0 : _a.resetScrollEdgeState();
33
40
  }
34
41
  };
35
42
  return Object.assign(Object.assign({}, exposedMethods), {
@@ -2146,6 +2146,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2146
2146
  sync: () => void;
2147
2147
  handleMouseEnterWrapper: () => void;
2148
2148
  handleMouseLeaveWrapper: () => void;
2149
+ resetScrollEdgeState: () => void;
2149
2150
  } | undefined;
2150
2151
  minuteScrollRef?: {
2151
2152
  $el: HTMLElement;
@@ -2158,6 +2159,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2158
2159
  sync: () => void;
2159
2160
  handleMouseEnterWrapper: () => void;
2160
2161
  handleMouseLeaveWrapper: () => void;
2162
+ resetScrollEdgeState: () => void;
2161
2163
  } | undefined;
2162
2164
  secondScrollRef?: {
2163
2165
  $el: HTMLElement;
@@ -2170,6 +2172,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2170
2172
  sync: () => void;
2171
2173
  handleMouseEnterWrapper: () => void;
2172
2174
  handleMouseLeaveWrapper: () => void;
2175
+ resetScrollEdgeState: () => void;
2173
2176
  } | undefined;
2174
2177
  amPmScrollRef?: {
2175
2178
  $el: HTMLElement;
@@ -2182,6 +2185,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2182
2185
  sync: () => void;
2183
2186
  handleMouseEnterWrapper: () => void;
2184
2187
  handleMouseLeaveWrapper: () => void;
2188
+ resetScrollEdgeState: () => void;
2185
2189
  } | undefined;
2186
2190
  } | null, PanelRef | {
2187
2191
  $el: HTMLElement;
@@ -2196,6 +2200,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2196
2200
  sync: () => void;
2197
2201
  handleMouseEnterWrapper: () => void;
2198
2202
  handleMouseLeaveWrapper: () => void;
2203
+ resetScrollEdgeState: () => void;
2199
2204
  } | undefined;
2200
2205
  minuteScrollRef?: {
2201
2206
  $el: HTMLElement;
@@ -2208,6 +2213,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2208
2213
  sync: () => void;
2209
2214
  handleMouseEnterWrapper: () => void;
2210
2215
  handleMouseLeaveWrapper: () => void;
2216
+ resetScrollEdgeState: () => void;
2211
2217
  } | undefined;
2212
2218
  secondScrollRef?: {
2213
2219
  $el: HTMLElement;
@@ -2220,6 +2226,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2220
2226
  sync: () => void;
2221
2227
  handleMouseEnterWrapper: () => void;
2222
2228
  handleMouseLeaveWrapper: () => void;
2229
+ resetScrollEdgeState: () => void;
2223
2230
  } | undefined;
2224
2231
  amPmScrollRef?: {
2225
2232
  $el: HTMLElement;
@@ -2232,6 +2239,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
2232
2239
  sync: () => void;
2233
2240
  handleMouseEnterWrapper: () => void;
2234
2241
  handleMouseLeaveWrapper: () => void;
2242
+ resetScrollEdgeState: () => void;
2235
2243
  } | undefined;
2236
2244
  } | null>;
2237
2245
  adjustedTo: import("vue").ComputedRef<string | HTMLElement>;
@@ -916,6 +916,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
916
916
  sync: () => void;
917
917
  handleMouseEnterWrapper: () => void;
918
918
  handleMouseLeaveWrapper: () => void;
919
+ resetScrollEdgeState: () => void;
919
920
  } | null, ScrollbarInst | {
920
921
  $el: HTMLElement;
921
922
  containerRef: HTMLElement | null;
@@ -927,6 +928,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
927
928
  sync: () => void;
928
929
  handleMouseEnterWrapper: () => void;
929
930
  handleMouseLeaveWrapper: () => void;
931
+ resetScrollEdgeState: () => void;
930
932
  } | null>;
931
933
  vlInstRef: import("vue").Ref<{
932
934
  listElRef: HTMLElement;
@@ -1366,6 +1366,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1366
1366
  sync: () => void;
1367
1367
  handleMouseEnterWrapper: () => void;
1368
1368
  handleMouseLeaveWrapper: () => void;
1369
+ resetScrollEdgeState: () => void;
1369
1370
  } | null, ScrollbarInst | {
1370
1371
  $el: HTMLElement;
1371
1372
  containerRef: HTMLElement | null;
@@ -1377,6 +1378,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1377
1378
  sync: () => void;
1378
1379
  handleMouseEnterWrapper: () => void;
1379
1380
  handleMouseLeaveWrapper: () => void;
1381
+ resetScrollEdgeState: () => void;
1380
1382
  } | null>;
1381
1383
  handleFocusout: (event: FocusEvent) => void;
1382
1384
  handleDragLeaveTree: (event: DragEvent) => void;
package/es/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "2.4.4";
1
+ declare const _default: "2.4.5";
2
2
  export default _default;
package/es/version.mjs CHANGED
@@ -1 +1 @@
1
- export default '2.4.4';
1
+ export default '2.4.5';
@@ -89,6 +89,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
89
89
  sync: () => void;
90
90
  handleMouseEnterWrapper: () => void;
91
91
  handleMouseLeaveWrapper: () => void;
92
+ resetScrollEdgeState: () => void;
92
93
  } | null, ScrollbarInst | {
93
94
  $el: HTMLElement;
94
95
  containerRef: HTMLElement | null;
@@ -100,6 +101,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
100
101
  sync: () => void;
101
102
  handleMouseEnterWrapper: () => void;
102
103
  handleMouseLeaveWrapper: () => void;
104
+ resetScrollEdgeState: () => void;
103
105
  } | null>;
104
106
  virtualListInstRef: import("vue").Ref<{
105
107
  listElRef: HTMLElement;
@@ -46,6 +46,7 @@ export interface SafeTopScrollbarInstMethods {
46
46
  clientHeight: number;
47
47
  };
48
48
  adjustScrollTop: (heightDiff: number) => void;
49
+ resetScrollEdgeState: () => void;
49
50
  }
50
51
  export interface SafeTopScrollbarInst extends SafeTopScrollbarInstMethods {
51
52
  $el: HTMLElement;
@@ -80,6 +81,12 @@ declare const safeTopscrollbarProps: {
80
81
  readonly onScroll: PropType<(e: Event) => void>;
81
82
  readonly onWheel: PropType<(e: WheelEvent) => void>;
82
83
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
84
+ readonly onScrollToTop: PropType<() => void>;
85
+ readonly onScrollToBottom: PropType<() => void>;
86
+ readonly scrollThreshold: {
87
+ readonly type: NumberConstructor;
88
+ readonly default: 5;
89
+ };
83
90
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
84
91
  readonly internalHoistYRail: BooleanConstructor;
85
92
  readonly yPlacement: {
@@ -156,6 +163,12 @@ declare const SafeTopScrollbar: import("vue").DefineComponent<import("vue").Extr
156
163
  readonly onScroll: PropType<(e: Event) => void>;
157
164
  readonly onWheel: PropType<(e: WheelEvent) => void>;
158
165
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
166
+ readonly onScrollToTop: PropType<() => void>;
167
+ readonly onScrollToBottom: PropType<() => void>;
168
+ readonly scrollThreshold: {
169
+ readonly type: NumberConstructor;
170
+ readonly default: 5;
171
+ };
159
172
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
160
173
  readonly internalHoistYRail: BooleanConstructor;
161
174
  readonly yPlacement: {
@@ -264,6 +277,7 @@ declare const SafeTopScrollbar: import("vue").DefineComponent<import("vue").Extr
264
277
  clientHeight: number;
265
278
  };
266
279
  adjustScrollTop: (heightDiff: number) => void;
280
+ resetScrollEdgeState: () => void;
267
281
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
268
282
  readonly duration: {
269
283
  readonly type: NumberConstructor;
@@ -291,6 +305,12 @@ declare const SafeTopScrollbar: import("vue").DefineComponent<import("vue").Extr
291
305
  readonly onScroll: PropType<(e: Event) => void>;
292
306
  readonly onWheel: PropType<(e: WheelEvent) => void>;
293
307
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
308
+ readonly onScrollToTop: PropType<() => void>;
309
+ readonly onScrollToBottom: PropType<() => void>;
310
+ readonly scrollThreshold: {
311
+ readonly type: NumberConstructor;
312
+ readonly default: 5;
313
+ };
294
314
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
295
315
  readonly internalHoistYRail: BooleanConstructor;
296
316
  readonly yPlacement: {
@@ -344,6 +364,7 @@ declare const SafeTopScrollbar: import("vue").DefineComponent<import("vue").Extr
344
364
  readonly trigger: "none" | "hover";
345
365
  readonly useUnifiedContainer: boolean;
346
366
  readonly triggerDisplayManually: boolean;
367
+ readonly scrollThreshold: number;
347
368
  readonly internalHoistYRail: boolean;
348
369
  readonly yPlacement: "left" | "right";
349
370
  readonly xPlacement: "top" | "bottom";
@@ -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 safeTopscrollbarProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { duration: {
@@ -24,7 +25,10 @@ const safeTopscrollbarProps = Object.assign(Object.assign({}, _mixins_1.useTheme
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: {
@@ -65,6 +69,7 @@ const SafeTopScrollbar = (0, vue_1.defineComponent)({
65
69
  let memoMouseY = 0;
66
70
  let previousScrollHeight = 0;
67
71
  let previousScrollTop = 0;
72
+ const { detectScrollEdges, resetScrollEdgeState } = (0, use_scroll_edge_detector_1.useScrollEdgeDetector)(() => props);
68
73
  const isIos = (0, vooks_1.useIsIos)();
69
74
  const themeRef = (0, _mixins_1.useTheme)('SafeTopScrollbar', '-safe-top-scrollbar', index_cssr_1.default, styles_1.scrollbarLight, props, mergedClsPrefixRef);
70
75
  const yBarSizeRef = (0, vue_1.computed)(() => {
@@ -327,6 +332,7 @@ const SafeTopScrollbar = (0, vue_1.defineComponent)({
327
332
  previousScrollTop = container.scrollTop;
328
333
  }
329
334
  syncScrollState();
335
+ detectScrollEdges(e);
330
336
  }
331
337
  function syncScrollState() {
332
338
  // only collect scroll state, do not trigger any dom event
@@ -617,7 +623,8 @@ const SafeTopScrollbar = (0, vue_1.defineComponent)({
617
623
  handleMouseEnterWrapper,
618
624
  handleMouseLeaveWrapper,
619
625
  getScrollState,
620
- adjustScrollTop
626
+ adjustScrollTop,
627
+ resetScrollEdgeState
621
628
  };
622
629
  return Object.assign(Object.assign({}, exposedMethods), { mergedClsPrefix: mergedClsPrefixRef, rtlEnabled: rtlEnabledRef, containerScrollTop: containerScrollTopRef, wrapperRef,
623
630
  containerRef,
@@ -40,6 +40,7 @@ export interface ScrollbarInstMethods {
40
40
  sync: () => void;
41
41
  handleMouseEnterWrapper: () => void;
42
42
  handleMouseLeaveWrapper: () => void;
43
+ resetScrollEdgeState: () => void;
43
44
  }
44
45
  export interface ScrollbarInst extends ScrollbarInstMethods {
45
46
  $el: HTMLElement;
@@ -74,6 +75,12 @@ declare const scrollbarProps: {
74
75
  readonly onScroll: PropType<(e: Event) => void>;
75
76
  readonly onWheel: PropType<(e: WheelEvent) => void>;
76
77
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
78
+ readonly onScrollToTop: PropType<() => void>;
79
+ readonly onScrollToBottom: PropType<() => void>;
80
+ readonly scrollThreshold: {
81
+ readonly type: NumberConstructor;
82
+ readonly default: 5;
83
+ };
77
84
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
78
85
  readonly internalHoistYRail: BooleanConstructor;
79
86
  readonly yPlacement: {
@@ -150,6 +157,12 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
150
157
  readonly onScroll: PropType<(e: Event) => void>;
151
158
  readonly onWheel: PropType<(e: WheelEvent) => void>;
152
159
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
160
+ readonly onScrollToTop: PropType<() => void>;
161
+ readonly onScrollToBottom: PropType<() => void>;
162
+ readonly scrollThreshold: {
163
+ readonly type: NumberConstructor;
164
+ readonly default: 5;
165
+ };
153
166
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
154
167
  readonly internalHoistYRail: BooleanConstructor;
155
168
  readonly yPlacement: {
@@ -252,6 +265,7 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
252
265
  sync: () => void;
253
266
  handleMouseEnterWrapper: () => void;
254
267
  handleMouseLeaveWrapper: () => void;
268
+ resetScrollEdgeState: () => void;
255
269
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
256
270
  readonly duration: {
257
271
  readonly type: NumberConstructor;
@@ -279,6 +293,12 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
279
293
  readonly onScroll: PropType<(e: Event) => void>;
280
294
  readonly onWheel: PropType<(e: WheelEvent) => void>;
281
295
  readonly onResize: PropType<(e: ResizeObserverEntry) => void>;
296
+ readonly onScrollToTop: PropType<() => void>;
297
+ readonly onScrollToBottom: PropType<() => void>;
298
+ readonly scrollThreshold: {
299
+ readonly type: NumberConstructor;
300
+ readonly default: 5;
301
+ };
282
302
  readonly internalOnUpdateScrollLeft: PropType<(scrollLeft: number) => void>;
283
303
  readonly internalHoistYRail: BooleanConstructor;
284
304
  readonly yPlacement: {
@@ -332,6 +352,7 @@ declare const Scrollbar: import("vue").DefineComponent<import("vue").ExtractProp
332
352
  readonly trigger: "none" | "hover";
333
353
  readonly useUnifiedContainer: boolean;
334
354
  readonly triggerDisplayManually: boolean;
355
+ readonly scrollThreshold: number;
335
356
  readonly internalHoistYRail: boolean;
336
357
  readonly yPlacement: "left" | "right";
337
358
  readonly xPlacement: "top" | "bottom";
@@ -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
+ }
@@ -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: {