@synerise/ds-scrollbar 1.1.0 → 1.1.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 +298 -1067
- package/README.md +1 -0
- package/dist/DnDScrollbar/DnDScrollbar.d.ts +1 -1
- package/dist/DnDScrollbar/DnDScrollbar.js +4 -4
- package/dist/DnDScrollbar/DnDScrollbar.styles.js +1 -1
- package/dist/Scrollbar.d.ts +1 -1
- package/dist/Scrollbar.js +3 -2
- package/dist/Scrollbar.types.d.ts +2 -2
- package/dist/VirtualScrollbar/VirtualScrollbar.js +2 -3
- package/dist/style/index.css +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ import Scrollbar from '@synerise/ds-scrollbar'
|
|
|
27
27
|
<iframe src="/storybook-static/iframe.html?id=components-scrollbar--default"></iframe>
|
|
28
28
|
|
|
29
29
|
## API
|
|
30
|
+
|
|
30
31
|
| Property | Description | Type | Default |
|
|
31
32
|
| ------------- | -------------------------------------------------------------------------------- | ------------------------ | ------- |
|
|
32
33
|
| absolute | Whether the scrollbar is over content | boolean | `true` |
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ScrollbarProps } from '../Scrollbar.types';
|
|
2
|
+
import { type ScrollbarProps } from '../Scrollbar.types';
|
|
3
3
|
export declare const DnDScrollbar: ({ children, classes, maxHeight, absolute, loading, largeSize, onScroll, onYReachEnd, fetchData, hasMore, confineScroll, ...props }: ScrollbarProps) => React.JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var _excluded = ["children", "classes", "maxHeight", "absolute", "loading", "largeSize", "onScroll", "onYReachEnd", "fetchData", "hasMore", "confineScroll"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import * as S from './DnDScrollbar.styles';
|
|
6
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
7
6
|
export var DnDScrollbar = function DnDScrollbar(_ref) {
|
|
8
7
|
var children = _ref.children,
|
|
9
8
|
classes = _ref.classes,
|
|
@@ -69,7 +68,9 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
|
|
|
69
68
|
var handleThumbMousedown = useCallback(function (event) {
|
|
70
69
|
event.stopPropagation();
|
|
71
70
|
setScrollStartPosition(event.clientY);
|
|
72
|
-
if (contentRef.current)
|
|
71
|
+
if (contentRef.current) {
|
|
72
|
+
setInitialScrollTop(contentRef.current.scrollTop);
|
|
73
|
+
}
|
|
73
74
|
setIsDragging(true);
|
|
74
75
|
}, []);
|
|
75
76
|
var handleThumbMouseup = useCallback(function (event) {
|
|
@@ -125,7 +126,6 @@ export var DnDScrollbar = function DnDScrollbar(_ref) {
|
|
|
125
126
|
var ref = wrapperRef.current;
|
|
126
127
|
var content = contentRef.current;
|
|
127
128
|
var trackSize = scrollTrackRef.current.clientHeight;
|
|
128
|
-
// eslint-disable-next-line no-undef
|
|
129
129
|
observer.current = new ResizeObserver(function () {
|
|
130
130
|
handleResize(trackSize);
|
|
131
131
|
});
|
|
@@ -10,7 +10,7 @@ export var ScrollbarContent = styled.div.withConfig({
|
|
|
10
10
|
export var ScrollbarWrapper = styled.div.withConfig({
|
|
11
11
|
displayName: "DnDScrollbarstyles__ScrollbarWrapper",
|
|
12
12
|
componentId: "sc-12t6y2d-2"
|
|
13
|
-
})(["padding-right:", ";padding-bottom:", ";& > *{opacity:", ";transition:
|
|
13
|
+
})(["padding-right:", ";padding-bottom:", ";& > *{opacity:", ";transition:opacity 0.25s ease-in-out;}"], function (props) {
|
|
14
14
|
if (props.absolute) {
|
|
15
15
|
return '';
|
|
16
16
|
}
|
package/dist/Scrollbar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ScrollbarProps, VirtualScrollbarProps } from './Scrollbar.types';
|
|
2
|
+
import { type ScrollbarProps, type VirtualScrollbarProps } from './Scrollbar.types';
|
|
3
3
|
declare const Scrollbar: React.ForwardRefExoticComponent<(ScrollbarProps | VirtualScrollbarProps) & React.RefAttributes<HTMLElement>>;
|
|
4
4
|
export default Scrollbar;
|
package/dist/Scrollbar.js
CHANGED
|
@@ -2,10 +2,10 @@ var _excluded = ["children", "className", "loading", "withDnd", "fetchData"];
|
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
|
+
import { useTheme } from '@synerise/ds-core';
|
|
5
6
|
import Icon, { SpinnerM } from '@synerise/ds-icon';
|
|
6
|
-
import { theme } from '@synerise/ds-core';
|
|
7
|
-
import * as S from './Scrollbar.styles';
|
|
8
7
|
import { DnDScrollbar } from './DnDScrollbar';
|
|
8
|
+
import * as S from './Scrollbar.styles';
|
|
9
9
|
import { VirtualScrollbar } from './VirtualScrollbar';
|
|
10
10
|
var Scrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
11
11
|
var children = _ref.children,
|
|
@@ -14,6 +14,7 @@ var Scrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
14
14
|
withDnd = _ref.withDnd,
|
|
15
15
|
fetchData = _ref.fetchData,
|
|
16
16
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
|
+
var theme = useTheme();
|
|
17
18
|
var Component = withDnd ? DnDScrollbar : VirtualScrollbar;
|
|
18
19
|
return /*#__PURE__*/React.createElement(S.ScrollbarContainer, {
|
|
19
20
|
className: className
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode, UIEvent } from 'react';
|
|
2
|
-
import { ScrollBarProps } from '@ofsajd/react-perfect-scrollbar';
|
|
1
|
+
import { type CSSProperties, type ReactNode, type UIEvent } from 'react';
|
|
2
|
+
import { type ScrollBarProps } from '@ofsajd/react-perfect-scrollbar';
|
|
3
3
|
export type ScrollbarAdditionalProps = {
|
|
4
4
|
absolute?: boolean;
|
|
5
5
|
classes?: string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useCallback, forwardRef, useRef, useEffect, useState } from 'react';
|
|
3
|
-
import PerfectScrollbar from '@ofsajd/react-perfect-scrollbar';
|
|
4
2
|
import classnames from 'classnames';
|
|
3
|
+
import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import PerfectScrollbar from '@ofsajd/react-perfect-scrollbar';
|
|
5
5
|
import { useCombinedRefs, useResizeObserver } from '@synerise/ds-utils';
|
|
6
6
|
import "../style/index.css";
|
|
7
7
|
import * as S from './VirtualScrollbar.styles';
|
|
8
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
9
8
|
export var VirtualScrollbar = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
10
9
|
var _ref$absolute = _ref.absolute,
|
|
11
10
|
absolute = _ref$absolute === void 0 ? false : _ref$absolute,
|
package/dist/style/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ps{overscroll-behavior:contain}.ps__rail-x.ps__rail-x{opacity:1;height:11px;top:unset!important;bottom:0;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden;margin-right:12px}.ps{overscroll-behavior:contain}.ps__rail-y.ps__rail-y{opacity:1;width:11px;left:unset!important;right:0;position:absolute;height:calc(100% - 8px)!important;transform:translateY(4px);overflow:hidden;margin-bottom:12px}.ps:hover .ps__rail-x,.ps:hover .ps__rail-y{opacity:1}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:unset}.ps__thumb-x{background-color:#dbe0e3;border-radius:3px;height:3px;bottom:4px;margin:0 4px}.ps__thumb-y{background-color:#dbe0e3;border-radius:3px;width:3px;right:4px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#949ea6;height:3px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#949ea6;width:3px}.large-size .ps__rail-x.ps__rail-x,.large-size .ps__rail-y.ps__rail-y{opacity:1;width:26px;height:26px;position:absolute;overflow:hidden}.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y,.large-size .ps__thumb-x,.large-size .ps__thumb-y,.large-size .ps__thumb-y--clicking,.large-size .ps__thumb-y:hover{background-color:#f4faff;border-radius:3px;width:16px;height:16px;border:1px solid #dbe0e3}.large-size .ps__rail-x.ps--clicking .ps__thumb-x,.large-size .ps__rail-x:focus>.ps__thumb-x,.large-size .ps__rail-x:hover>.ps__thumb-x,.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y{background-color:#d9eeff;border:1px solid #b5bdc3;height:16px}
|
|
1
|
+
.ps{overflow:hidden!important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto}.ps__rail-x{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;height:15px;bottom:0;position:absolute}.ps__rail-y{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;width:15px;right:0;position:absolute}.ps--active-x>.ps__rail-x,.ps--active-y>.ps__rail-y{display:block;background-color:transparent}.ps--focus>.ps__rail-x,.ps--focus>.ps__rail-y,.ps--scrolling-x>.ps__rail-x,.ps--scrolling-y>.ps__rail-y,.ps:hover>.ps__rail-x,.ps:hover>.ps__rail-y{opacity:.6}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:#eee;opacity:.9}.ps__thumb-x{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px;position:absolute}.ps__thumb-y{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px;position:absolute}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#999;height:11px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#999;width:11px}@supports (-ms-overflow-style:none){.ps{overflow:auto!important}}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.ps{overflow:auto!important}}.scrollbar-container{position:relative;height:100%}.ps{overscroll-behavior:contain}.ps__rail-x.ps__rail-x{opacity:1;height:11px;top:unset!important;bottom:0;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden;margin-right:12px}.ps{overscroll-behavior:contain}.ps__rail-y.ps__rail-y{opacity:1;width:11px;left:unset!important;right:0;position:absolute;height:calc(100% - 8px)!important;transform:translateY(4px);overflow:hidden;margin-bottom:12px}.ps:hover .ps__rail-x,.ps:hover .ps__rail-y{opacity:1}.ps .ps__rail-x.ps--clicking,.ps .ps__rail-x:focus,.ps .ps__rail-x:hover,.ps .ps__rail-y.ps--clicking,.ps .ps__rail-y:focus,.ps .ps__rail-y:hover{background-color:unset}.ps__thumb-x{background-color:#dbe0e3;border-radius:3px;height:3px;bottom:4px;margin:0 4px}.ps__thumb-y{background-color:#dbe0e3;border-radius:3px;width:3px;right:4px}.ps__rail-x.ps--clicking .ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x:hover>.ps__thumb-x{background-color:#949ea6;height:3px}.ps__rail-y.ps--clicking .ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y:hover>.ps__thumb-y{background-color:#949ea6;width:3px}.large-size .ps__rail-x.ps__rail-x,.large-size .ps__rail-y.ps__rail-y{opacity:1;width:26px;height:26px;position:absolute;overflow:hidden}.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y,.large-size .ps__thumb-x,.large-size .ps__thumb-y,.large-size .ps__thumb-y--clicking,.large-size .ps__thumb-y:hover{background-color:#f4faff;border-radius:3px;width:16px;height:16px;border:1px solid #dbe0e3}.large-size .ps__rail-x.ps--clicking .ps__thumb-x,.large-size .ps__rail-x:focus>.ps__thumb-x,.large-size .ps__rail-x:hover>.ps__thumb-x,.large-size .ps__rail-y.ps--clicking .ps__thumb-y,.large-size .ps__rail-y:focus>.ps__thumb-y,.large-size .ps__rail-y:hover>.ps__thumb-y{background-color:#d9eeff;border:1px solid #b5bdc3;height:16px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-scrollbar",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Scrollbar UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@ofsajd/react-perfect-scrollbar": "1.0.0",
|
|
38
|
-
"@synerise/ds-icon": "^1.5.
|
|
39
|
-
"@synerise/ds-utils": "^1.3.
|
|
38
|
+
"@synerise/ds-icon": "^1.5.4",
|
|
39
|
+
"@synerise/ds-utils": "^1.3.1",
|
|
40
40
|
"classnames": "^2.3.2",
|
|
41
41
|
"lodash": "^4.7.21"
|
|
42
42
|
},
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"react": ">=16.9.0 <= 18.3.1",
|
|
46
46
|
"styled-components": "^5.3.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "4512641033ba3581a3df208143c547fcfed45895"
|
|
49
49
|
}
|