react-scrollbars-custom
Advanced tools
Comparing version 4.0.25 to 4.0.27
@@ -1,2 +0,1 @@ | ||
import * as PropTypes from "prop-types"; | ||
import * as React from "react"; | ||
@@ -67,51 +66,2 @@ import Emittr from "./Emittr"; | ||
static contextType: React.Context<ScrollbarContextValue>; | ||
static propTypes: { | ||
createContext: PropTypes.Requireable<boolean>; | ||
rtl: PropTypes.Requireable<boolean>; | ||
native: PropTypes.Requireable<boolean>; | ||
mobileNative: PropTypes.Requireable<boolean>; | ||
momentum: PropTypes.Requireable<boolean>; | ||
noDefaultStyles: PropTypes.Requireable<boolean>; | ||
disableTracksMousewheelScrolling: PropTypes.Requireable<boolean>; | ||
disableTrackXMousewheelScrolling: PropTypes.Requireable<boolean>; | ||
disableTrackYMousewheelScrolling: PropTypes.Requireable<boolean>; | ||
disableTracksWidthCompensation: PropTypes.Requireable<boolean>; | ||
disableTrackXWidthCompensation: PropTypes.Requireable<boolean>; | ||
disableTrackYWidthCompensation: PropTypes.Requireable<boolean>; | ||
minimalThumbSize: PropTypes.Requireable<number>; | ||
maximalThumbSize: PropTypes.Requireable<number>; | ||
minimalThumbXSize: PropTypes.Requireable<number>; | ||
maximalThumbXSize: PropTypes.Requireable<number>; | ||
minimalThumbYSize: PropTypes.Requireable<number>; | ||
maximalThumbYSize: PropTypes.Requireable<number>; | ||
noScrollX: PropTypes.Requireable<boolean>; | ||
noScrollY: PropTypes.Requireable<boolean>; | ||
noScroll: PropTypes.Requireable<boolean>; | ||
permanentTrackX: PropTypes.Requireable<boolean>; | ||
permanentTrackY: PropTypes.Requireable<boolean>; | ||
permanentTracks: PropTypes.Requireable<boolean>; | ||
translateContentSizesToHolder: PropTypes.Requireable<boolean>; | ||
translateContentSizeYToHolder: PropTypes.Requireable<boolean>; | ||
translateContentSizeXToHolder: PropTypes.Requireable<boolean>; | ||
removeTracksWhenNotUsed: PropTypes.Requireable<boolean>; | ||
removeTrackYWhenNotUsed: PropTypes.Requireable<boolean>; | ||
removeTrackXWhenNotUsed: PropTypes.Requireable<boolean>; | ||
trackClickBehavior: PropTypes.Requireable<TRACK_CLICK_BEHAVIOR>; | ||
scrollbarWidth: PropTypes.Requireable<number>; | ||
fallbackScrollbarWidth: PropTypes.Requireable<number>; | ||
scrollDetectionThreshold: PropTypes.Requireable<number>; | ||
scrollTop: PropTypes.Requireable<number>; | ||
scrollLeft: PropTypes.Requireable<number>; | ||
className: PropTypes.Requireable<string>; | ||
wrapperProps: PropTypes.Requireable<object>; | ||
contentProps: PropTypes.Requireable<object>; | ||
trackXProps: PropTypes.Requireable<object>; | ||
trackYProps: PropTypes.Requireable<object>; | ||
thumbXProps: PropTypes.Requireable<object>; | ||
thumbYProps: PropTypes.Requireable<object>; | ||
onUpdate: PropTypes.Requireable<(...args: any[]) => any>; | ||
onScroll: PropTypes.Requireable<(...args: any[]) => any>; | ||
onScrollStart: PropTypes.Requireable<(...args: any[]) => any>; | ||
onScrollStop: PropTypes.Requireable<(...args: any[]) => any>; | ||
}; | ||
static defaultProps: { | ||
@@ -118,0 +68,0 @@ momentum: boolean; |
@@ -1,2 +0,1 @@ | ||
import * as PropTypes from "prop-types"; | ||
import * as React from "react"; | ||
@@ -14,10 +13,2 @@ import { DraggableData, DraggableEvent } from "react-draggable"; | ||
export default class ScrollbarThumb extends React.Component<ScrollbarThumbProps, {}> { | ||
static propTypes: { | ||
axis: PropTypes.Requireable<AXIS_DIRECTION>; | ||
onDrag: PropTypes.Requireable<(...args: any[]) => any>; | ||
onDragStart: PropTypes.Requireable<(...args: any[]) => any>; | ||
onDragEnd: PropTypes.Requireable<(...args: any[]) => any>; | ||
elementRef: PropTypes.Requireable<(...args: any[]) => any>; | ||
renderer: PropTypes.Requireable<(...args: any[]) => any>; | ||
}; | ||
initialOffsetX: number; | ||
@@ -29,2 +20,3 @@ initialOffsetY: number; | ||
private prevOnSelectStart; | ||
private elementRefHack; | ||
private static selectStartReplacer; | ||
@@ -38,4 +30,3 @@ componentDidMount(): void; | ||
render(): React.ReactElement<any> | null; | ||
private elementRefHack; | ||
private elementRef; | ||
} |
@@ -1,2 +0,1 @@ | ||
import * as PropTypes from "prop-types"; | ||
import * as React from "react"; | ||
@@ -14,8 +13,2 @@ import { AXIS_DIRECTION, ElementPropsWithElementRefAndRenderer } from "./types"; | ||
export default class ScrollbarTrack extends React.Component<ScrollbarTrackProps, {}> { | ||
static propTypes: { | ||
axis: PropTypes.Requireable<AXIS_DIRECTION>; | ||
onClick: PropTypes.Requireable<(...args: any[]) => any>; | ||
elementRef: PropTypes.Requireable<(...args: any[]) => any>; | ||
renderer: PropTypes.Requireable<(...args: any[]) => any>; | ||
}; | ||
element: HTMLDivElement | null; | ||
@@ -22,0 +15,0 @@ componentDidMount(): void; |
@@ -1,2 +0,1 @@ | ||
import * as PropTypes from "prop-types"; | ||
import * as React from "react"; | ||
@@ -7,3 +6,2 @@ export declare enum AXIS_DIRECTION { | ||
} | ||
export declare const AXIS_DIRECTION_PROP_TYPE: PropTypes.Requireable<AXIS_DIRECTION>; | ||
export declare enum TRACK_CLICK_BEHAVIOR { | ||
@@ -13,3 +11,2 @@ JUMP = "jump", | ||
} | ||
export declare const TRACK_CLICK_BEHAVIOR_PROP_TYPE: PropTypes.Requireable<TRACK_CLICK_BEHAVIOR>; | ||
export declare type ElementRef<T = HTMLDivElement> = (element: T | null) => void; | ||
@@ -16,0 +13,0 @@ export declare type ElementPropsWithElementRef<T = HTMLDivElement> = React.HTMLProps<T> & { |
@@ -66,4 +66,4 @@ import * as React from "react"; | ||
interface GetScrollbarWidthFN { | ||
_cache?: number; | ||
(force?: boolean): number | undefined; | ||
_cache?: number; | ||
} | ||
@@ -75,4 +75,4 @@ /** | ||
interface ShouldReverseRtlScroll { | ||
_cache?: boolean; | ||
(force?: boolean): boolean; | ||
_cache?: boolean; | ||
} | ||
@@ -79,0 +79,0 @@ /** |
{ | ||
"name": "react-scrollbars-custom", | ||
"description": "The best React custom scrollbars component", | ||
"version": "4.0.25", | ||
"version": "4.0.27", | ||
"funding": { | ||
@@ -40,4 +40,3 @@ "type": "patreon", | ||
"peerDependencies": { | ||
"prop-types": "^15.0.0", | ||
"react": "^16.0.0" | ||
"react": ">=16.0.0" | ||
}, | ||
@@ -67,3 +66,2 @@ "dependencies": { | ||
"pretty-quick": "^2.0.1", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.13.1", | ||
@@ -79,7 +77,2 @@ "react-dom": "^16.13.1", | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
}, | ||
"scripts": { | ||
@@ -86,0 +79,0 @@ "format": "prettier --write \"src/**/*.[tj]s?(x)\" \"tests/**/*.[tj]s?(x)\" \"*.[tj]s?(x)\"", |
@@ -53,2 +53,4 @@ <div align="center"> | ||
```typescript jsx | ||
import { Scrollbar } from "react-scrollbars-custom"; | ||
<Scrollbar style={{ width: 250, height: 250 }}> | ||
@@ -88,3 +90,3 @@ <p>Hello world!</p> | ||
In some situations you may want to make the scrollbars block of variable sizes - just pass `translateContentSize*ToHolder` prop and component will automatically translate corresponding `contentElement`'s sizes to the `holderElement`. | ||
If you are using default styles - it'll be handy to pass `compensateScrollbarsWidth={false}` props, to avoid infinite shrinking when it's not supposed to. | ||
If you are using default styles - it'll be handy to pass `disableTracksWidthCompensation` props, to avoid infinite shrinking when it's not supposed to. | ||
_Note:_ This wont work for native mode. | ||
@@ -106,3 +108,3 @@ | ||
## Customisation | ||
## Customization | ||
@@ -285,6 +287,6 @@ In some cases you may want to change the default className or tagName of elements or add extra markup or whatever. For these purposes `react-scrollbars-custom` made fully customizable. | ||
**removeTrackYWhenNotUsed** _`:boolean`_ = undefined | ||
Whether to remove horizontal track if scrolling is not possible/blocked and tracks are not permanent. | ||
Whether to remove vertical track if scrolling is not possible/blocked and tracks are not permanent. | ||
**removeTrackXWhenNotUsed** _`:boolean`_ = undefined | ||
Whether to remove vertical track if scrolling is not possible/blocked and tracks are not permanent. | ||
Whether to remove horizontal track if scrolling is not possible/blocked and tracks are not permanent. | ||
@@ -346,12 +348,12 @@ **translateContentSizesToHolder** _`:boolean`_ = undefined | ||
**onUpdate** _`:function(scrollValues: ScrollValues, prevScrollValues: ScrollValues)`_ = undefined | ||
**onUpdate** _`:function(scrollValues: ScrollState, prevScrollValues: ScrollState)`_ = undefined | ||
Function called each time any of scroll values changed and component performed an update. It is called after component's update. | ||
**onScroll** _`:function(scrollValues: ScrollValues, prevScrollValues: ScrollValues)`_ = undefined | ||
**onScroll** _`:function(scrollValues: ScrollState, prevScrollValues: ScrollState)`_ = undefined | ||
Function called each time scrollTop or scrollLeft has changed. It is called after component's update and even if scrollTop/scrollLeft has been changed through the code (not by user). | ||
**onScrollStart** _`:function(scrollValues: ScrollValues)`_ = undefined | ||
**onScrollStart** _`:function(scrollValues: ScrollState)`_ = undefined | ||
Callback that called immediately when user started scrolling (no matter how, thumb dragging, keyboard, mousewheel and etc.). | ||
**onScrollStop** _`:function(scrollValues: ScrollValues)`_ = undefined | ||
**onScrollStop** _`:function(scrollValues: ScrollState)`_ = undefined | ||
Callback that called after `props.scrollDetectionThreshold` milliseconds after last scroll event. | ||
@@ -358,0 +360,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
26
488
234665
16
5030