@synerise/ds-scrollbar 0.10.2 → 0.10.3

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.10.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.10.2...@synerise/ds-scrollbar@0.10.3) (2024-05-08)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-scrollbar
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.10.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.10.1...@synerise/ds-scrollbar@0.10.2) (2024-04-15)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-scrollbar
@@ -94,19 +94,19 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
94
94
  event.stopPropagation();
95
95
 
96
96
  if (isDragging && contentRef.current !== null) {
97
- var _contentRef$current2 = contentRef.current,
98
- contentScrollHeight = _contentRef$current2.scrollHeight,
99
- contentOffsetHeight = _contentRef$current2.offsetHeight;
97
+ var _contentRef$current3 = contentRef.current,
98
+ contentScrollHeight = _contentRef$current3.scrollHeight,
99
+ contentOffsetHeight = _contentRef$current3.offsetHeight;
100
100
  var deltaY = (event.clientY - scrollStartPosition) * (contentOffsetHeight / thumbHeight);
101
101
  contentRef.current.scrollTop = Math.min(initialScrollTop + deltaY, contentScrollHeight - contentOffsetHeight);
102
102
  }
103
103
  }, [initialScrollTop, isDragging, scrollStartPosition, thumbHeight]);
104
104
  var handleScroll = useCallback(function (event) {
105
105
  if (contentRef.current !== null) {
106
- var _contentRef$current3 = contentRef.current,
107
- scrollHeight = _contentRef$current3.scrollHeight,
108
- offsetHeight = _contentRef$current3.offsetHeight,
109
- scrollTop = _contentRef$current3.scrollTop;
106
+ var _contentRef$current5 = contentRef.current,
107
+ scrollHeight = _contentRef$current5.scrollHeight,
108
+ offsetHeight = _contentRef$current5.offsetHeight,
109
+ scrollTop = _contentRef$current5.scrollTop;
110
110
  var progress = Math.round((scrollTop + offsetHeight) / scrollHeight * 100) / 100;
111
111
 
112
112
  if (progress === 1 && hasMore) {
@@ -119,9 +119,9 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
119
119
  }, [fetchData, hasMore, onScroll, onYReachEnd]);
120
120
  var handleResize = useCallback(function (trackSize) {
121
121
  if (contentRef.current !== null) {
122
- var _contentRef$current4 = contentRef.current,
123
- clientHeightContent = _contentRef$current4.clientHeight,
124
- scrollHeightContent = _contentRef$current4.scrollHeight;
122
+ var _contentRef$current7 = contentRef.current,
123
+ clientHeightContent = _contentRef$current7.clientHeight,
124
+ scrollHeightContent = _contentRef$current7.scrollHeight;
125
125
 
126
126
  if (clientHeightContent === scrollHeightContent) {
127
127
  setThumbHeight(0);
@@ -57,7 +57,7 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
57
57
  var handleReachEnd = useCallback(function () {
58
58
  var _combinedScrollRef$cu;
59
59
 
60
- if ((combinedScrollRef == null ? void 0 : (_combinedScrollRef$cu = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu.scrollTop) === lastScrollTop) {
60
+ if ((combinedScrollRef == null || (_combinedScrollRef$cu = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu.scrollTop) === lastScrollTop) {
61
61
  return;
62
62
  }
63
63
 
@@ -74,7 +74,7 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
74
74
  var handleScrollUp = useCallback(function () {
75
75
  var _combinedScrollRef$cu2;
76
76
 
77
- if ((combinedScrollRef == null ? void 0 : (_combinedScrollRef$cu2 = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu2.scrollTop) !== 0) {
77
+ if ((combinedScrollRef == null || (_combinedScrollRef$cu2 = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu2.scrollTop) !== 0) {
78
78
  setLastScrollTop(0);
79
79
  }
80
80
  }, [combinedScrollRef]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-scrollbar",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Scrollbar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,7 +34,7 @@
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
36
  "@ofsajd/react-perfect-scrollbar": "1.0.0",
37
- "@synerise/ds-icon": "^0.60.7"
37
+ "@synerise/ds-icon": "^0.60.8"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@synerise/ds-core": "*",
@@ -42,9 +42,9 @@
42
42
  "styled-components": "5.0.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@synerise/ds-utils": "^0.26.3",
45
+ "@synerise/ds-utils": "^0.26.4",
46
46
  "@testing-library/jest-dom": "5.1.1",
47
47
  "@types/resize-observer-browser": "^0.1.7"
48
48
  },
49
- "gitHead": "fcc57aef73d1309a366e4c6e80ce4defdd9f20f8"
49
+ "gitHead": "1ad18b4b850f614943cd940a6b509d215ec025c7"
50
50
  }