@synerise/ds-scrollbar 0.7.2 → 0.8.0

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,25 @@
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.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.7.3...@synerise/ds-scrollbar@0.8.0) (2024-02-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **layout:** add useNativeScroll prop for main content column ([699f3b2](https://github.com/Synerise/synerise-design/commit/699f3b2980f816905046b69c36f1cc0ca7a2d98b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.7.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.7.2...@synerise/ds-scrollbar@0.7.3) (2024-01-24)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-scrollbar
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.7.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-scrollbar@0.7.1...@synerise/ds-scrollbar@0.7.2) (2024-01-17)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-scrollbar
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- declare const Scrollbar: React.ForwardRefExoticComponent<import("./Scrollbar.types").ScrollbarAdditionalProps & {
3
- children: React.ReactNode;
4
- } & React.RefAttributes<HTMLElement>>;
2
+ import { ScrollbarProps, VirtualScrollbarProps } from './Scrollbar.types';
3
+ declare const Scrollbar: React.ForwardRefExoticComponent<(ScrollbarProps | VirtualScrollbarProps) & React.RefAttributes<HTMLElement>>;
5
4
  export default Scrollbar;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { ScrollBarProps } from 'react-perfect-scrollbar';
2
3
  export type ScrollbarAdditionalProps = {
3
4
  absolute?: boolean;
4
5
  classes?: string;
@@ -16,3 +17,6 @@ export type ScrollbarAdditionalProps = {
16
17
  export type ScrollbarProps = ScrollbarAdditionalProps & {
17
18
  children: React.ReactNode | string;
18
19
  };
20
+ export type VirtualScrollbarProps = ScrollbarProps & {
21
+ scrollbarOptions?: ScrollBarProps['options'];
22
+ };
@@ -1,5 +1,8 @@
1
+ /// <reference types="perfect-scrollbar" />
1
2
  import React from 'react';
2
3
  import './style/index.less';
3
4
  export declare const VirtualScrollbar: React.ForwardRefExoticComponent<import("../Scrollbar.types").ScrollbarAdditionalProps & {
4
5
  children: React.ReactNode;
6
+ } & {
7
+ scrollbarOptions?: import("perfect-scrollbar").default.Options | undefined;
5
8
  } & React.RefAttributes<HTMLElement>>;
@@ -1,5 +1,11 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
1
7
  import React, { useCallback, forwardRef, useRef, useEffect, useState } from 'react';
2
- import PerfectScrollbar from 'react-perfect-scrollbar';
8
+ import PerfectScrollbar from '@ofsajd/react-perfect-scrollbar';
3
9
  import { debounce } from 'lodash';
4
10
  import { useCombinedRefs } from '@synerise/ds-utils';
5
11
  import "./style/index.css";
@@ -17,6 +23,7 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
17
23
  style = _ref.style,
18
24
  fetchData = _ref.fetchData,
19
25
  onScroll = _ref.onScroll,
26
+ scrollbarOptions = _ref.scrollbarOptions,
20
27
  onYReachEnd = _ref.onYReachEnd;
21
28
  var scrollRef = useRef();
22
29
  var wrapperRef = useRef(null);
@@ -77,9 +84,9 @@ export var VirtualScrollbar = forwardRef(function (_ref, forwardedRef) {
77
84
  ,
78
85
  onScroll: onScroll,
79
86
  onScrollUp: handleScrollUp,
80
- options: {
87
+ options: _objectSpread({}, scrollbarOptions, {
81
88
  minScrollbarLength: 48
82
- },
89
+ }),
83
90
  onYReachEnd: handleReachEnd,
84
91
  className: "" + (largeSize ? 'large-size' : '')
85
92
  }, /*#__PURE__*/React.createElement(S.ScrollbarContent, {
@@ -1 +1 @@
1
- @import '~react-perfect-scrollbar/dist/css/styles.css';.ps__rail-x.ps__rail-x{opacity:1;height:11px;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden;margin-right:12px}.ps__rail-y.ps__rail-y{opacity:1;width:11px;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,.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
+ @import '~@ofsajd/react-perfect-scrollbar/dist/css/styles.css';.ps{overscroll-behavior:contain}.ps__rail-x.ps__rail-x{opacity:1;height:11px;position:absolute;width:calc(100% - 8px)!important;transform:translateX(-4px);overflow:hidden;margin-right:12px}.ps__rail-y.ps__rail-y{opacity:1;width:11px;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,.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": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "description": "Scrollbar UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -33,8 +33,8 @@
33
33
  ],
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
- "@synerise/ds-icon": "^0.59.1",
37
- "react-perfect-scrollbar": "^1.5.8"
36
+ "@ofsajd/react-perfect-scrollbar": "1.0.0",
37
+ "@synerise/ds-icon": "^0.60.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@synerise/ds-core": "*",
@@ -46,5 +46,5 @@
46
46
  "@testing-library/jest-dom": "5.1.1",
47
47
  "@types/resize-observer-browser": "^0.1.7"
48
48
  },
49
- "gitHead": "16918244eff3f4e37db24ae3d90687d4e6a233a4"
49
+ "gitHead": "17e3bca1d4d134a28aaa186f0e2637616ca86174"
50
50
  }