@synerise/ds-scrollbar 0.3.18 → 0.4.2
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 +32 -0
- package/dist/Scrollbar.js +11 -25
- package/dist/Scrollbar.types.js +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
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.4.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.4.1...@synerise/ds-scrollbar@0.4.2) (2021-11-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-scrollbar
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.4.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.3.19...@synerise/ds-scrollbar@0.4.1) (2021-11-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-scrollbar
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.3.19...@synerise/ds-scrollbar@0.4.0) (2021-11-09)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-scrollbar
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.3.19](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.3.17...@synerise/ds-scrollbar@0.3.19) (2021-10-26)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-scrollbar
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [0.3.18](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.3.17...@synerise/ds-scrollbar@0.3.18) (2021-10-19)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-scrollbar
|
package/dist/Scrollbar.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import PerfectScrollbar from 'react-perfect-scrollbar';
|
|
15
3
|
import { useCombinedRefs } from '@synerise/ds-utils';
|
|
16
4
|
import "./style/index.css";
|
|
17
|
-
import SpinnerM from '@synerise/ds-icon
|
|
18
|
-
import Icon from '@synerise/ds-icon';
|
|
5
|
+
import Icon, { SpinnerM } from '@synerise/ds-icon';
|
|
19
6
|
import * as S from './Scrollbar.styles';
|
|
20
7
|
var Scrollbar = React.forwardRef(function (_ref, forwardedRef) {
|
|
21
8
|
var _ref$absolute = _ref.absolute,
|
|
@@ -33,14 +20,13 @@ var Scrollbar = React.forwardRef(function (_ref, forwardedRef) {
|
|
|
33
20
|
var combinedScrollRef = useCombinedRefs(forwardedRef, scrollRef);
|
|
34
21
|
|
|
35
22
|
var _React$useState = React.useState(0),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setLastScrollTop = _React$useState2[1];
|
|
23
|
+
lastScrollTop = _React$useState[0],
|
|
24
|
+
setLastScrollTop = _React$useState[1];
|
|
39
25
|
|
|
40
26
|
var handleReachEnd = React.useCallback(function (container) {
|
|
41
27
|
var _combinedScrollRef$cu;
|
|
42
28
|
|
|
43
|
-
if ((combinedScrollRef
|
|
29
|
+
if ((combinedScrollRef == null ? void 0 : (_combinedScrollRef$cu = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu.scrollTop) === lastScrollTop) {
|
|
44
30
|
return;
|
|
45
31
|
}
|
|
46
32
|
|
|
@@ -57,12 +43,12 @@ var Scrollbar = React.forwardRef(function (_ref, forwardedRef) {
|
|
|
57
43
|
var handleScrollUp = React.useCallback(function () {
|
|
58
44
|
var _combinedScrollRef$cu2;
|
|
59
45
|
|
|
60
|
-
if ((combinedScrollRef
|
|
46
|
+
if ((combinedScrollRef == null ? void 0 : (_combinedScrollRef$cu2 = combinedScrollRef.current) == null ? void 0 : _combinedScrollRef$cu2.scrollTop) !== 0) {
|
|
61
47
|
setLastScrollTop(0);
|
|
62
48
|
}
|
|
63
49
|
}, [combinedScrollRef]);
|
|
64
50
|
var renderScrollbar = React.useMemo(function () {
|
|
65
|
-
return React.createElement(PerfectScrollbar, {
|
|
51
|
+
return /*#__PURE__*/React.createElement(PerfectScrollbar, {
|
|
66
52
|
containerRef: function containerRef(ref) {
|
|
67
53
|
combinedScrollRef.current = ref;
|
|
68
54
|
} // workaround: https://github.com/goldenyz/react-perfect-scrollbar/issues/94#issuecomment-619131257
|
|
@@ -73,21 +59,21 @@ var Scrollbar = React.forwardRef(function (_ref, forwardedRef) {
|
|
|
73
59
|
minScrollbarLength: 48
|
|
74
60
|
},
|
|
75
61
|
onYReachEnd: handleReachEnd
|
|
76
|
-
}, React.createElement(S.ScrollbarContent, {
|
|
62
|
+
}, /*#__PURE__*/React.createElement(S.ScrollbarContent, {
|
|
77
63
|
className: classes,
|
|
78
64
|
style: {
|
|
79
65
|
maxHeight: maxHeight
|
|
80
66
|
}
|
|
81
|
-
}, React.createElement(S.ScrollbarWrapper, {
|
|
67
|
+
}, /*#__PURE__*/React.createElement(S.ScrollbarWrapper, {
|
|
82
68
|
absolute: absolute,
|
|
83
69
|
loading: loading,
|
|
84
70
|
style: style
|
|
85
71
|
}, children)));
|
|
86
72
|
}, [onScroll, handleReachEnd, handleScrollUp, classes, maxHeight, absolute, loading, style, children, combinedScrollRef]);
|
|
87
|
-
return fetchData ? React.createElement(S.ScrollbarContainer, null, renderScrollbar, loading && React.createElement(S.Loader, {
|
|
73
|
+
return fetchData ? /*#__PURE__*/React.createElement(S.ScrollbarContainer, null, renderScrollbar, loading && /*#__PURE__*/React.createElement(S.Loader, {
|
|
88
74
|
loading: loading
|
|
89
|
-
}, React.createElement(Icon, {
|
|
90
|
-
component: React.createElement(SpinnerM, null),
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
76
|
+
component: /*#__PURE__*/React.createElement(SpinnerM, null),
|
|
91
77
|
color: "#6a7580"
|
|
92
78
|
}))) : renderScrollbar;
|
|
93
79
|
});
|
package/dist/Scrollbar.types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-scrollbar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Scrollbar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
35
|
+
"@synerise/ds-icon": "^0.46.2",
|
|
36
36
|
"react-perfect-scrollbar": "^1.5.8"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@synerise/ds-utils": "^0.19.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
|
|
46
46
|
}
|