@antscorp/antsomi-ui 1.3.5-beta.286 → 1.3.5-beta.287
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.
|
@@ -13,19 +13,20 @@ import { Scrollbars as CustomScrollbars, } from 'react-custom-scrollbars';
|
|
|
13
13
|
// Libraries
|
|
14
14
|
import React from 'react';
|
|
15
15
|
// Styled
|
|
16
|
-
import { HorizontalTrack,
|
|
16
|
+
import { HorizontalTrack, ThumbBar, VerticalTrack } from './styled';
|
|
17
17
|
import { cloneDeep } from 'lodash';
|
|
18
18
|
const THUMB_SIZE = 4;
|
|
19
19
|
export const Scrollbars = props => {
|
|
20
|
-
const { autoHide = true,
|
|
21
|
-
return (React.createElement(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const { autoHide = true, autoHeightMax = 0 } = props, restProps = __rest(props, ["autoHide", "autoHeightMax"]);
|
|
21
|
+
return (React.createElement(CustomScrollbars, Object.assign({ autoHide: autoHide, autoHeightMax: autoHeightMax, renderThumbVertical: props => React.createElement(ThumbBar, Object.assign({}, props)), renderThumbHorizontal: props => React.createElement(ThumbBar, Object.assign({}, props)), renderTrackVertical: props => React.createElement(VerticalTrack, Object.assign({}, props)), renderTrackHorizontal: props => React.createElement(HorizontalTrack, Object.assign({}, props)), renderView: props => {
|
|
22
|
+
const { style } = props || {};
|
|
23
|
+
const newStyle = cloneDeep(style);
|
|
24
|
+
newStyle.marginBottom = -THUMB_SIZE;
|
|
25
|
+
newStyle.marginRight = -THUMB_SIZE;
|
|
26
|
+
newStyle.minHeight = THUMB_SIZE;
|
|
27
|
+
if (autoHeightMax) {
|
|
28
28
|
newStyle.maxHeight = parseInt(`${autoHeightMax}`) + THUMB_SIZE;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
}
|
|
30
|
+
return React.createElement("div", Object.assign({ className: "scrollbar-view" }, props, { style: newStyle }));
|
|
31
|
+
}, hideTracksWhenNotNeeded: true }, restProps)));
|
|
31
32
|
};
|