@antscorp/antsomi-ui 1.3.5-beta.296 → 1.3.5-beta.298

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.
@@ -19,7 +19,7 @@ const THUMB_SIZE = 4;
19
19
  const MARGIN = 3;
20
20
  export const Scrollbars = props => {
21
21
  // Props
22
- const { autoHide = true, autoHeightMax = 0 } = props, restProps = __rest(props, ["autoHide", "autoHeightMax"]);
22
+ const { autoHide = true, autoHeightMax = 0, className } = props, restProps = __rest(props, ["autoHide", "autoHeightMax", "className"]);
23
23
  // Refs
24
24
  const ref = useRef(null);
25
25
  /**
@@ -51,8 +51,15 @@ export const Scrollbars = props => {
51
51
  ref.current.thumbHorizontal.style.width = `${thumbWidth}px`;
52
52
  ref.current.thumbHorizontal.style.transform = `translateX(${thumbHorizontalPosition}px)`;
53
53
  }
54
+ // Handle show hide track bar
55
+ if (scrollHeight <= clientHeight) {
56
+ ref.current.horizontalTrack.style.visibility = 'hidden';
57
+ }
58
+ if (scrollWidth <= clientWidth) {
59
+ ref.current.verticalTrack.style.visibility = 'hidden';
60
+ }
54
61
  };
55
- return (React.createElement(CustomScrollbars, Object.assign({ className: "custom-scrollbars", ref: ref, autoHide: autoHide, autoHeightMax: autoHeightMax, renderThumbVertical: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-vertical" }, props)), renderThumbHorizontal: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-horizontal" }, props)), renderTrackVertical: (_a) => {
62
+ return (React.createElement(CustomScrollbars, Object.assign({ className: `custom-scrollbars ${className || ''}`, ref: ref, autoHide: autoHide, autoHeightMax: autoHeightMax, renderThumbVertical: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-vertical" }, props)), renderThumbHorizontal: props => React.createElement(ThumbBar, Object.assign({ className: "thumb-horizontal" }, props)), renderTrackVertical: (_a) => {
56
63
  var { style } = _a, restOfProps = __rest(_a, ["style"]);
57
64
  return (React.createElement(VerticalTrack, Object.assign({ className: "scrollbar-track" }, restOfProps, { style: Object.assign(Object.assign({}, style), { display: 'block' }) })));
58
65
  }, renderTrackHorizontal: (_a) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.296",
3
+ "version": "1.3.5-beta.298",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",