@micromag/element-scroll 0.3.347 → 0.3.349

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/es/index.js CHANGED
@@ -20,7 +20,8 @@ var propTypes = {
20
20
  contain: PropTypes.bool,
21
21
  scrollContainerRef: PropTypes.any,
22
22
  // eslint-disable-line
23
- withShadow: PropTypes.bool
23
+ withShadow: PropTypes.bool,
24
+ withArrow: PropTypes.bool
24
25
  };
25
26
  var defaultProps = {
26
27
  width: null,
@@ -33,7 +34,8 @@ var defaultProps = {
33
34
  onScrolledNotBottom: null,
34
35
  contain: false,
35
36
  scrollContainerRef: null,
36
- withShadow: false
37
+ withShadow: false,
38
+ withArrow: true
37
39
  };
38
40
  function Scroll(_ref) {
39
41
  var _ref3;
@@ -47,7 +49,8 @@ function Scroll(_ref) {
47
49
  onScrolledNotBottom = _ref.onScrolledNotBottom,
48
50
  contain = _ref.contain,
49
51
  scrollContainerRef = _ref.scrollContainerRef,
50
- withShadow = _ref.withShadow;
52
+ withShadow = _ref.withShadow,
53
+ showArrow = _ref.withArrow;
51
54
  var finalStyle = {
52
55
  width: width,
53
56
  height: height
@@ -92,7 +95,7 @@ function Scroll(_ref) {
92
95
  }
93
96
  scrolledNotBottomOnce.current = true;
94
97
  }
95
- if (newWithArrow !== withArrow) {
98
+ if (newWithArrow !== withArrow && showArrow) {
96
99
  setWithArrow(newWithArrow);
97
100
  }
98
101
  reachedBottom.current = nowReachedBottom;
@@ -121,7 +124,7 @@ function Scroll(_ref) {
121
124
  }
122
125
  }, [scrollableHeight, scrolleeHeight, setWithArrow, disabled]);
123
126
  return /*#__PURE__*/React.createElement("div", {
124
- className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, styles.withScroll, !disabled), _defineProperty(_ref3, styles.containOverscroll, contain), _defineProperty(_ref3, className, className !== null), _defineProperty(_ref3, styles[verticalAlign], verticalAlign !== null), _defineProperty(_ref3, styles.withArrow, withArrow), _defineProperty(_ref3, styles.withShadow, withShadow), _ref3)]),
127
+ className: classNames([styles.container, (_ref3 = {}, _defineProperty(_ref3, styles.withScroll, !disabled), _defineProperty(_ref3, styles.containOverscroll, contain), _defineProperty(_ref3, className, className !== null), _defineProperty(_ref3, styles[verticalAlign], verticalAlign !== null), _defineProperty(_ref3, styles.withArrow, showArrow && withArrow), _defineProperty(_ref3, styles.withShadow, withShadow), _ref3)]),
125
128
  style: finalStyle
126
129
  }, /*#__PURE__*/React.createElement("div", Object.assign({
127
130
  className: styles.scrollable,
@@ -129,7 +132,7 @@ function Scroll(_ref) {
129
132
  }, bind()), /*#__PURE__*/React.createElement("div", {
130
133
  className: styles.scrollee,
131
134
  ref: scrolleeRef
132
- }, children)), !disabled ? /*#__PURE__*/React.createElement("div", {
135
+ }, children)), !disabled && showArrow ? /*#__PURE__*/React.createElement("div", {
133
136
  className: styles.arrowContainer
134
137
  }, /*#__PURE__*/React.createElement("svg", {
135
138
  xmlns: "http://www.w3.org/2000/svg",
package/lib/index.js CHANGED
@@ -30,7 +30,8 @@ var propTypes = {
30
30
  contain: PropTypes__default["default"].bool,
31
31
  scrollContainerRef: PropTypes__default["default"].any,
32
32
  // eslint-disable-line
33
- withShadow: PropTypes__default["default"].bool
33
+ withShadow: PropTypes__default["default"].bool,
34
+ withArrow: PropTypes__default["default"].bool
34
35
  };
35
36
  var defaultProps = {
36
37
  width: null,
@@ -43,7 +44,8 @@ var defaultProps = {
43
44
  onScrolledNotBottom: null,
44
45
  contain: false,
45
46
  scrollContainerRef: null,
46
- withShadow: false
47
+ withShadow: false,
48
+ withArrow: true
47
49
  };
48
50
  function Scroll(_ref) {
49
51
  var _ref3;
@@ -57,7 +59,8 @@ function Scroll(_ref) {
57
59
  onScrolledNotBottom = _ref.onScrolledNotBottom,
58
60
  contain = _ref.contain,
59
61
  scrollContainerRef = _ref.scrollContainerRef,
60
- withShadow = _ref.withShadow;
62
+ withShadow = _ref.withShadow,
63
+ showArrow = _ref.withArrow;
61
64
  var finalStyle = {
62
65
  width: width,
63
66
  height: height
@@ -102,7 +105,7 @@ function Scroll(_ref) {
102
105
  }
103
106
  scrolledNotBottomOnce.current = true;
104
107
  }
105
- if (newWithArrow !== withArrow) {
108
+ if (newWithArrow !== withArrow && showArrow) {
106
109
  setWithArrow(newWithArrow);
107
110
  }
108
111
  reachedBottom.current = nowReachedBottom;
@@ -131,7 +134,7 @@ function Scroll(_ref) {
131
134
  }
132
135
  }, [scrollableHeight, scrolleeHeight, setWithArrow, disabled]);
133
136
  return /*#__PURE__*/React__default["default"].createElement("div", {
134
- className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, styles.withScroll, !disabled), _defineProperty__default["default"](_ref3, styles.containOverscroll, contain), _defineProperty__default["default"](_ref3, className, className !== null), _defineProperty__default["default"](_ref3, styles[verticalAlign], verticalAlign !== null), _defineProperty__default["default"](_ref3, styles.withArrow, withArrow), _defineProperty__default["default"](_ref3, styles.withShadow, withShadow), _ref3)]),
137
+ className: classNames__default["default"]([styles.container, (_ref3 = {}, _defineProperty__default["default"](_ref3, styles.withScroll, !disabled), _defineProperty__default["default"](_ref3, styles.containOverscroll, contain), _defineProperty__default["default"](_ref3, className, className !== null), _defineProperty__default["default"](_ref3, styles[verticalAlign], verticalAlign !== null), _defineProperty__default["default"](_ref3, styles.withArrow, showArrow && withArrow), _defineProperty__default["default"](_ref3, styles.withShadow, withShadow), _ref3)]),
135
138
  style: finalStyle
136
139
  }, /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
137
140
  className: styles.scrollable,
@@ -139,7 +142,7 @@ function Scroll(_ref) {
139
142
  }, bind()), /*#__PURE__*/React__default["default"].createElement("div", {
140
143
  className: styles.scrollee,
141
144
  ref: scrolleeRef
142
- }, children)), !disabled ? /*#__PURE__*/React__default["default"].createElement("div", {
145
+ }, children)), !disabled && showArrow ? /*#__PURE__*/React__default["default"].createElement("div", {
143
146
  className: styles.arrowContainer
144
147
  }, /*#__PURE__*/React__default["default"].createElement("svg", {
145
148
  xmlns: "http://www.w3.org/2000/svg",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-scroll",
3
- "version": "0.3.347",
3
+ "version": "0.3.349",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -52,7 +52,7 @@
52
52
  "@fortawesome/fontawesome-svg-core": "^1.2.32",
53
53
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
54
54
  "@fortawesome/react-fontawesome": "^0.1.13",
55
- "@micromag/core": "^0.3.347",
55
+ "@micromag/core": "^0.3.348",
56
56
  "@use-gesture/react": "^10.2.4",
57
57
  "classnames": "^2.2.6",
58
58
  "lodash": "^4.17.21",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "63a7e46763ae34c4143f0aa29a4c9467126e7734"
66
+ "gitHead": "5e3c2c33b7e3c1833b1c43f97792b11d746864b1"
67
67
  }