@enact/ui 4.5.2 → 4.5.4

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.
Files changed (167) hide show
  1. package/AnnounceDecorator/Announce.js +1 -40
  2. package/AnnounceDecorator/AnnounceDecorator.js +3 -21
  3. package/AnnounceDecorator/tests/Announce-specs.js +2 -7
  4. package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
  5. package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
  6. package/AnnounceDecorator/useAnnounce.js +0 -6
  7. package/BodyText/BodyText.js +6 -26
  8. package/BodyText/tests/BodyText-specs.js +0 -19
  9. package/Button/Button.js +26 -56
  10. package/Button/tests/Button-specs.js +0 -26
  11. package/CHANGELOG.md +10 -0
  12. package/Cancelable/Cancelable.js +8 -47
  13. package/Cancelable/cancelHandler.js +5 -12
  14. package/Cancelable/modalHandler.js +3 -11
  15. package/Cancelable/tests/Cancelable-specs.js +3 -57
  16. package/Changeable/Changeable.js +2 -34
  17. package/Changeable/tests/Changeable-specs.js +20 -66
  18. package/ComponentOverride/ComponentOverride.js +1 -13
  19. package/FloatingLayer/FloatingLayer.js +17 -73
  20. package/FloatingLayer/FloatingLayerContainer.js +0 -15
  21. package/FloatingLayer/FloatingLayerDecorator.js +4 -17
  22. package/FloatingLayer/Scrim.js +9 -53
  23. package/FloatingLayer/index.js +0 -4
  24. package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
  25. package/FloatingLayer/tests/Scrim-specs.js +0 -9
  26. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
  27. package/FloatingLayer/useFloatingLayer.js +3 -14
  28. package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
  29. package/ForwardRef/ForwardRef.js +1 -10
  30. package/GridListImageItem/GridListImageItem.js +17 -50
  31. package/Group/Group.js +4 -35
  32. package/Group/GroupItem.js +15 -32
  33. package/Group/tests/Group-specs.js +0 -32
  34. package/Heading/Heading.js +7 -35
  35. package/Heading/tests/Heading-specs.js +81 -14
  36. package/Icon/Icon.js +14 -48
  37. package/Icon/tests/Icon-specs.js +0 -22
  38. package/IconButton/IconButton.js +12 -50
  39. package/IconButton/tests/IconButton-specs.js +0 -7
  40. package/Image/Image.js +16 -45
  41. package/Image/tests/Image-specs.js +0 -14
  42. package/ImageItem/ImageItem.js +17 -46
  43. package/ImageItem/tests/ImageItem-specs.js +0 -25
  44. package/Item/Item.js +8 -32
  45. package/Item/tests/Item-specs.js +0 -24
  46. package/LabeledIcon/LabeledIcon.js +19 -50
  47. package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
  48. package/Layout/Cell.js +11 -37
  49. package/Layout/Layout.js +14 -37
  50. package/Layout/tests/Layout-specs.js +10 -39
  51. package/Marquee/MarqueeBase.js +29 -63
  52. package/Marquee/MarqueeController.js +11 -72
  53. package/Marquee/MarqueeDecorator.js +62 -196
  54. package/Marquee/index.js +1 -5
  55. package/Marquee/tests/Marquee-specs.js +258 -87
  56. package/Measurable/Measurable.js +12 -34
  57. package/Measurable/tests/Measurable-specs.js +115 -0
  58. package/Media/Media.js +15 -65
  59. package/Media/tests/Media-specs.js +168 -0
  60. package/Placeholder/PlaceholderControllerDecorator.js +7 -43
  61. package/Placeholder/PlaceholderDecorator.js +7 -38
  62. package/Placeholder/index.js +0 -4
  63. package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
  64. package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
  65. package/ProgressBar/ProgressBar.js +13 -44
  66. package/ProgressBar/tests/ProgressBar-specs.js +0 -17
  67. package/RadioDecorator/RadioControllerDecorator.js +1 -29
  68. package/RadioDecorator/RadioDecorator.js +4 -42
  69. package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
  70. package/Repeater/Repeater.js +9 -33
  71. package/Repeater/tests/Repeater-specs.js +0 -38
  72. package/Resizable/Resizable.js +7 -35
  73. package/Resizable/tests/Resizable-specs.js +34 -0
  74. package/Routable/Link.js +8 -44
  75. package/Routable/Routable.js +10 -33
  76. package/Routable/Route.js +0 -6
  77. package/Routable/Router.js +13 -56
  78. package/Routable/tests/Routable-specs.js +7 -33
  79. package/Routable/tests/Router-specs.js +18 -44
  80. package/Routable/useLink.js +4 -8
  81. package/Routable/util.js +18 -24
  82. package/Scrollable/ScrollAnimator.js +49 -65
  83. package/Scrollable/ScrollThumb.js +2 -13
  84. package/Scrollable/Scrollable.js +179 -386
  85. package/Scrollable/ScrollableNative.js +188 -391
  86. package/Scrollable/Scrollbar.js +28 -100
  87. package/Scroller/Scroller.js +15 -39
  88. package/Scroller/ScrollerBasic.js +34 -89
  89. package/Scroller/UiScrollerBase.js +31 -84
  90. package/Skinnable/Skinnable.js +11 -38
  91. package/Skinnable/tests/Skinnable-specs.js +3 -74
  92. package/Skinnable/tests/useSkins-specs.js +1 -13
  93. package/Skinnable/tests/util-specs.js +0 -14
  94. package/Skinnable/useSkins.js +8 -15
  95. package/Skinnable/util.js +9 -20
  96. package/Slider/Knob.js +5 -24
  97. package/Slider/PositionDecorator.js +16 -54
  98. package/Slider/Slider.js +26 -64
  99. package/Slider/tests/Slider-specs.js +94 -7
  100. package/Slider/utils.js +0 -2
  101. package/SlotItem/SlotItem.js +15 -41
  102. package/SlotItem/tests/SlotItem-specs.js +0 -5
  103. package/Slottable/Slottable.js +4 -12
  104. package/Slottable/tests/Slottable-specs.js +19 -46
  105. package/Slottable/tests/useSlots-specs.js +27 -65
  106. package/Slottable/useSlots.js +8 -33
  107. package/Spinner/Spinner.js +15 -42
  108. package/Spinner/tests/Spinner-specs.js +0 -15
  109. package/ToggleIcon/ToggleIcon.js +10 -36
  110. package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
  111. package/ToggleItem/ToggleItem.js +15 -52
  112. package/ToggleItem/tests/ToggleItem-specs.js +0 -30
  113. package/Toggleable/Toggle.js +1 -15
  114. package/Toggleable/Toggleable.js +12 -45
  115. package/Toggleable/tests/Toggleable-specs.js +28 -96
  116. package/Toggleable/useToggle.js +3 -19
  117. package/Touchable/ClickAllow.js +5 -14
  118. package/Touchable/Drag.js +16 -54
  119. package/Touchable/Flick.js +11 -42
  120. package/Touchable/Hold.js +21 -68
  121. package/Touchable/Touch.js +37 -65
  122. package/Touchable/Touchable.js +32 -71
  123. package/Touchable/config.js +8 -22
  124. package/Touchable/tests/Touchable-specs.js +270 -119
  125. package/Touchable/tests/useTouch-specs.js +6 -80
  126. package/Touchable/useTouch.js +17 -34
  127. package/Transition/Transition.js +37 -118
  128. package/Transition/tests/Transition-specs.js +20 -60
  129. package/ViewManager/Arranger.js +10 -22
  130. package/ViewManager/TransitionGroup.js +31 -106
  131. package/ViewManager/View.js +35 -91
  132. package/ViewManager/ViewManager.js +19 -83
  133. package/ViewManager/tests/View-specs.js +0 -17
  134. package/ViewManager/tests/ViewManager-specs.js +236 -305
  135. package/ViewManager/tests/test-utils.js +0 -8
  136. package/VirtualList/UiVirtualListBase.js +256 -406
  137. package/VirtualList/VirtualList.js +29 -69
  138. package/VirtualList/VirtualListBase.js +0 -3
  139. package/VirtualList/VirtualListBasic.js +270 -428
  140. package/VirtualList/tests/VirtualList-specs.js +9 -37
  141. package/internal/IdProvider/IdProvider.js +7 -21
  142. package/internal/IdProvider/Provider.js +4 -17
  143. package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
  144. package/internal/IdProvider/tests/useId-specs.js +7 -22
  145. package/internal/IdProvider/useId.js +0 -6
  146. package/internal/Pure/Pure.js +3 -30
  147. package/internal/Pure/tests/Pure-specs.js +88 -0
  148. package/internal/localized-fonts/localized-fonts.js +33 -62
  149. package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
  150. package/internal/selection/selection.js +1 -6
  151. package/internal/selection/tests/selection-specs.js +6 -4
  152. package/internal/validators/tests/validators-specs.js +80 -0
  153. package/internal/validators/validators.js +14 -34
  154. package/package.json +8 -2
  155. package/resolution/ResolutionDecorator.js +4 -40
  156. package/resolution/index.js +0 -7
  157. package/resolution/resolution.js +42 -80
  158. package/resolution/tests/ResolutionDecorator-specs.js +4 -11
  159. package/resolution/tests/resolution-specs.js +2 -2
  160. package/useControlledState/tests/useControlledState-specs.js +15 -46
  161. package/useControlledState/useControlledState.js +11 -22
  162. package/useScroll/ScrollAnimator.js +49 -65
  163. package/useScroll/Scrollbar.js +22 -58
  164. package/useScroll/ScrollbarTrack.js +3 -19
  165. package/useScroll/useScroll.js +325 -502
  166. package/useScroll/utilDOM.js +8 -14
  167. package/useScroll/utilEvent.js +0 -4
@@ -4,113 +4,77 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = exports.constants = exports.ScrollableBase = exports.Scrollable = void 0;
7
-
8
7
  var _classnames = _interopRequireDefault(require("classnames"));
9
-
10
8
  var _handle = _interopRequireWildcard(require("@enact/core/handle"));
11
-
12
9
  var _keymap = require("@enact/core/keymap");
13
-
14
10
  var _Registry = _interopRequireDefault(require("@enact/core/internal/Registry"));
15
-
16
11
  var _util = require("@enact/core/util");
17
-
18
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
13
  var _clamp = _interopRequireDefault(require("ramda/src/clamp"));
21
-
22
14
  var _react = require("react");
23
-
24
15
  var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
25
-
26
16
  var _Resizable = require("../Resizable");
27
-
28
17
  var _resolution = _interopRequireDefault(require("../resolution"));
29
-
30
18
  var _Touchable = _interopRequireDefault(require("../Touchable"));
31
-
32
19
  var _ScrollAnimator = _interopRequireDefault(require("./ScrollAnimator"));
33
-
34
20
  var _Scrollbar = _interopRequireDefault(require("./Scrollbar"));
35
-
36
21
  var _ScrollableModule = _interopRequireDefault(require("./Scrollable.module.css"));
37
-
38
22
  var _jsxRuntime = require("react/jsx-runtime");
39
-
40
23
  var _excluded = ["className", "containerRenderer", "noScrollByDrag", "rtl", "style"],
41
- _excluded2 = ["childRenderer"];
42
-
24
+ _excluded2 = ["childRenderer"];
43
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
44
-
45
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
46
-
47
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
48
-
49
28
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
50
-
51
29
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
52
-
53
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
54
-
55
31
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
56
-
57
32
  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; }
58
-
59
33
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
60
-
61
34
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
62
-
63
35
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
64
-
65
36
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
66
-
67
37
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
68
-
69
38
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
70
-
71
39
  function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
72
-
73
40
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
74
-
75
41
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
76
-
77
42
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
78
-
79
43
  var constants = {
80
- animationDuration: 1000,
81
- epsilon: 1,
82
- flickConfig: {
83
- maxDuration: null
44
+ animationDuration: 1000,
45
+ epsilon: 1,
46
+ flickConfig: {
47
+ maxDuration: null
48
+ },
49
+ isPageDown: (0, _keymap.is)('pageDown'),
50
+ isPageUp: (0, _keymap.is)('pageUp'),
51
+ nop: function nop() {},
52
+ overscrollTypeNone: 0,
53
+ overscrollTypeHold: 1,
54
+ overscrollTypeOnce: 2,
55
+ overscrollTypeDone: 9,
56
+ paginationPageMultiplier: 0.66,
57
+ scrollStopWaiting: 200,
58
+ scrollWheelPageMultiplierForMaxPixel: 0.2 // The ratio of the maximum distance scrolled by wheel to the size of the viewport.
84
59
  },
85
- isPageDown: (0, _keymap.is)('pageDown'),
86
- isPageUp: (0, _keymap.is)('pageUp'),
87
- nop: function nop() {},
88
- overscrollTypeNone: 0,
89
- overscrollTypeHold: 1,
90
- overscrollTypeOnce: 2,
91
- overscrollTypeDone: 9,
92
- paginationPageMultiplier: 0.66,
93
- scrollStopWaiting: 200,
94
- scrollWheelPageMultiplierForMaxPixel: 0.2 // The ratio of the maximum distance scrolled by wheel to the size of the viewport.
95
-
96
- },
97
- animationDuration = constants.animationDuration,
98
- epsilon = constants.epsilon,
99
- flickConfig = constants.flickConfig,
100
- isPageDown = constants.isPageDown,
101
- isPageUp = constants.isPageUp,
102
- nop = constants.nop,
103
- overscrollTypeDone = constants.overscrollTypeDone,
104
- overscrollTypeHold = constants.overscrollTypeHold,
105
- overscrollTypeNone = constants.overscrollTypeNone,
106
- overscrollTypeOnce = constants.overscrollTypeOnce,
107
- paginationPageMultiplier = constants.paginationPageMultiplier,
108
- scrollStopWaiting = constants.scrollStopWaiting,
109
- scrollWheelPageMultiplierForMaxPixel = constants.scrollWheelPageMultiplierForMaxPixel;
60
+ animationDuration = constants.animationDuration,
61
+ epsilon = constants.epsilon,
62
+ flickConfig = constants.flickConfig,
63
+ isPageDown = constants.isPageDown,
64
+ isPageUp = constants.isPageUp,
65
+ nop = constants.nop,
66
+ overscrollTypeDone = constants.overscrollTypeDone,
67
+ overscrollTypeHold = constants.overscrollTypeHold,
68
+ overscrollTypeNone = constants.overscrollTypeNone,
69
+ overscrollTypeOnce = constants.overscrollTypeOnce,
70
+ paginationPageMultiplier = constants.paginationPageMultiplier,
71
+ scrollStopWaiting = constants.scrollStopWaiting,
72
+ scrollWheelPageMultiplierForMaxPixel = constants.scrollWheelPageMultiplierForMaxPixel;
110
73
  exports.constants = constants;
111
74
  var TouchableDiv = (0, _ForwardRef["default"])({
112
75
  prop: 'ref'
113
76
  }, (0, _Touchable["default"])('div'));
77
+
114
78
  /**
115
79
  * An unstyled component that passes scrollable behavior information as its render prop's arguments.
116
80
  *
@@ -119,28 +83,20 @@ var TouchableDiv = (0, _ForwardRef["default"])({
119
83
  * @ui
120
84
  * @private
121
85
  */
122
-
123
86
  var ScrollableBase = /*#__PURE__*/function (_Component) {
124
87
  _inherits(ScrollableBase, _Component);
125
-
126
88
  var _super = _createSuper(ScrollableBase);
127
-
128
89
  function ScrollableBase(props) {
129
90
  var _this;
130
-
131
91
  _classCallCheck(this, ScrollableBase);
132
-
133
92
  _this = _super.call(this, props);
134
-
135
93
  _this.handleResizeWindow = function () {
136
94
  // `handleSize` in `ui/resolution.ResolutionDecorator` should be executed first.
137
95
  setTimeout(function () {
138
96
  var handleResizeWindow = _this.props.handleResizeWindow;
139
-
140
97
  if (handleResizeWindow) {
141
98
  handleResizeWindow();
142
99
  }
143
-
144
100
  _this.scrollTo({
145
101
  position: {
146
102
  x: 0,
@@ -148,11 +104,9 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
148
104
  },
149
105
  animate: false
150
106
  });
151
-
152
107
  _this.enqueueForceUpdate();
153
108
  });
154
109
  };
155
-
156
110
  _this.pixelPerLine = 39;
157
111
  _this.scrollWheelMultiplierForDeltaPixel = 1.5;
158
112
  _this.deferScrollTo = true;
@@ -198,30 +152,23 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
198
152
  _this.scrollToInfo = null;
199
153
  _this.childRefCurrent = null;
200
154
  _this.animator = new _ScrollAnimator["default"]();
201
-
202
155
  _this.getRtlX = function (x) {
203
156
  return _this.props.rtl ? -x : x;
204
157
  };
205
-
206
158
  _this.onMouseDown = (0, _handle["default"])((0, _handle.forwardWithPrevent)('onMouseDown'), _this.stop).bindAs(_assertThisInitialized(_this), 'onMouseDown');
207
-
208
159
  _this.onDragStart = function (ev) {
209
160
  if (ev.type === 'dragstart') return;
210
161
  (0, _handle.forward)('onDragStart', ev, _this.props);
211
-
212
162
  _this.stop();
213
-
214
163
  _this.isDragging = true;
215
164
  _this.dragStartX = _this.scrollLeft + _this.getRtlX(ev.x);
216
165
  _this.dragStartY = _this.scrollTop + ev.y;
217
166
  };
218
-
219
167
  _this.onDrag = function (ev) {
220
168
  if (ev.type === 'drag') return;
221
169
  var direction = _this.props.direction;
222
170
  _this.lastInputType = 'drag';
223
171
  (0, _handle.forward)('onDrag', ev, _this.props);
224
-
225
172
  _this.start({
226
173
  targetX: direction === 'vertical' ? 0 : _this.dragStartX - _this.getRtlX(ev.x),
227
174
  // 'horizontal' or 'both'
@@ -231,20 +178,17 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
231
178
  overscrollEffect: _this.props.overscrollEffectOn.drag
232
179
  });
233
180
  };
234
-
235
181
  _this.onDragEnd = function (ev) {
236
182
  if (ev.type === 'dragend') return;
237
183
  _this.isDragging = false;
238
184
  (0, _handle.forward)('onDragEnd', ev, _this.props);
239
-
240
185
  if (_this.flickTarget) {
241
186
  var _this$flickTarget = _this.flickTarget,
242
- targetX = _this$flickTarget.targetX,
243
- targetY = _this$flickTarget.targetY,
244
- duration = _this$flickTarget.duration;
187
+ targetX = _this$flickTarget.targetX,
188
+ targetY = _this$flickTarget.targetY,
189
+ duration = _this$flickTarget.duration;
245
190
  _this.lastInputType = 'drag';
246
191
  _this.isScrollAnimationTargetAccumulated = false;
247
-
248
192
  _this.start({
249
193
  targetX: targetX,
250
194
  targetY: targetY,
@@ -254,84 +198,67 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
254
198
  } else {
255
199
  _this.stop();
256
200
  }
257
-
258
201
  if (_this.overscrollEnabled) {
259
202
  // not check this.props.overscrollEffectOn.drag for safety
260
203
  _this.clearAllOverscrollEffects();
261
204
  }
262
-
263
205
  _this.flickTarget = null;
264
206
  };
265
-
266
207
  _this.onFlick = function (ev) {
267
208
  var direction = _this.props.direction;
268
209
  _this.flickTarget = _this.animator.simulate(_this.scrollLeft, _this.scrollTop, direction !== 'vertical' ? _this.getRtlX(-ev.velocityX) : 0, direction !== 'horizontal' ? -ev.velocityY : 0);
269
-
270
210
  if (_this.props.onFlick) {
271
211
  (0, _handle.forward)('onFlick', ev, _this.props);
272
212
  }
273
213
  };
274
-
275
214
  _this.onWheel = function (ev) {
276
215
  if (_this.isDragging) {
277
216
  ev.preventDefault();
278
217
  ev.stopPropagation();
279
218
  } else {
280
219
  var _assertThisInitialize = _assertThisInitialized(_this),
281
- verticalScrollbarRef = _assertThisInitialize.verticalScrollbarRef,
282
- horizontalScrollbarRef = _assertThisInitialize.horizontalScrollbarRef,
283
- bounds = _this.getScrollBounds(),
284
- canScrollHorizontally = _this.canScrollHorizontally(bounds),
285
- canScrollVertically = _this.canScrollVertically(bounds),
286
- eventDeltaMode = ev.deltaMode,
287
- eventDelta = -ev.wheelDeltaY || ev.deltaY;
288
-
220
+ verticalScrollbarRef = _assertThisInitialize.verticalScrollbarRef,
221
+ horizontalScrollbarRef = _assertThisInitialize.horizontalScrollbarRef,
222
+ bounds = _this.getScrollBounds(),
223
+ canScrollHorizontally = _this.canScrollHorizontally(bounds),
224
+ canScrollVertically = _this.canScrollVertically(bounds),
225
+ eventDeltaMode = ev.deltaMode,
226
+ eventDelta = -ev.wheelDeltaY || ev.deltaY;
289
227
  var delta = 0,
290
- direction;
228
+ direction;
291
229
  _this.lastInputType = 'wheel';
292
-
293
230
  if (_this.props.noScrollByWheel) {
294
231
  return;
295
232
  }
296
-
297
233
  if (canScrollVertically) {
298
234
  delta = _this.calculateDistanceByWheel(eventDeltaMode, eventDelta, bounds.clientHeight * scrollWheelPageMultiplierForMaxPixel);
299
235
  } else if (canScrollHorizontally) {
300
236
  delta = _this.calculateDistanceByWheel(eventDeltaMode, eventDelta, bounds.clientWidth * scrollWheelPageMultiplierForMaxPixel);
301
237
  }
302
-
303
238
  direction = Math.sign(delta);
304
-
305
239
  if (direction !== _this.wheelDirection) {
306
240
  _this.isScrollAnimationTargetAccumulated = false;
307
241
  _this.wheelDirection = direction;
308
242
  }
309
-
310
243
  (0, _handle.forward)('onWheel', {
311
244
  delta: delta,
312
245
  horizontalScrollbarRef: horizontalScrollbarRef,
313
246
  verticalScrollbarRef: verticalScrollbarRef
314
247
  }, _this.props);
315
-
316
248
  if (delta !== 0) {
317
249
  _this.scrollToAccumulatedTarget(delta, canScrollVertically, _this.props.overscrollEffectOn.wheel);
318
-
319
250
  ev.preventDefault();
320
251
  ev.stopPropagation();
321
252
  }
322
253
  }
323
254
  };
324
-
325
255
  _this.scrollByPage = function (keyCode) {
326
256
  var bounds = _this.getScrollBounds(),
327
- canScrollVertically = _this.canScrollVertically(bounds),
328
- pageDistance = (isPageUp(keyCode) ? -1 : 1) * (canScrollVertically ? bounds.clientHeight : bounds.clientWidth) * paginationPageMultiplier;
329
-
257
+ canScrollVertically = _this.canScrollVertically(bounds),
258
+ pageDistance = (isPageUp(keyCode) ? -1 : 1) * (canScrollVertically ? bounds.clientHeight : bounds.clientWidth) * paginationPageMultiplier;
330
259
  _this.lastInputType = 'pageKey';
331
-
332
260
  _this.scrollToAccumulatedTarget(pageDistance, canScrollVertically, _this.props.overscrollEffectOn.pageKey);
333
261
  };
334
-
335
262
  _this.onKeyDown = function (ev) {
336
263
  if (_this.props.onKeyDown) {
337
264
  (0, _handle.forward)('onKeyDown', ev, _this.props);
@@ -339,27 +266,23 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
339
266
  _this.scrollByPage(ev.keyCode);
340
267
  }
341
268
  };
342
-
343
269
  _this.scrollToAccumulatedTarget = function (delta, vertical, overscrollEffect) {
344
270
  if (!_this.isScrollAnimationTargetAccumulated) {
345
271
  _this.accumulatedTargetX = _this.scrollLeft;
346
272
  _this.accumulatedTargetY = _this.scrollTop;
347
273
  _this.isScrollAnimationTargetAccumulated = true;
348
274
  }
349
-
350
275
  if (vertical) {
351
276
  _this.accumulatedTargetY += delta;
352
277
  } else {
353
278
  _this.accumulatedTargetX += delta;
354
279
  }
355
-
356
280
  _this.start({
357
281
  targetX: _this.accumulatedTargetX,
358
282
  targetY: _this.accumulatedTargetY,
359
283
  overscrollEffect: overscrollEffect
360
284
  });
361
285
  };
362
-
363
286
  _this.getEdgeFromPosition = function (position, maxPosition) {
364
287
  if (position <= 0) {
365
288
  return 'before';
@@ -369,25 +292,20 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
369
292
  return null;
370
293
  }
371
294
  };
372
-
373
295
  _this.setOverscrollStatus = function (orientation, edge, type, ratio) {
374
296
  var status = _this.overscrollStatus[orientation][edge];
375
297
  status.type = type;
376
298
  status.ratio = ratio;
377
299
  };
378
-
379
300
  _this.getOverscrollStatus = function (orientation, edge) {
380
301
  return _this.overscrollStatus[orientation][edge];
381
302
  };
382
-
383
303
  _this.calculateOverscrollRatio = function (orientation, position) {
384
304
  var bounds = _this.getScrollBounds(),
385
- isVertical = orientation === 'vertical',
386
- baseSize = isVertical ? bounds.clientHeight : bounds.clientWidth,
387
- maxPos = bounds[isVertical ? 'maxTop' : 'maxLeft'];
388
-
305
+ isVertical = orientation === 'vertical',
306
+ baseSize = isVertical ? bounds.clientHeight : bounds.clientWidth,
307
+ maxPos = bounds[isVertical ? 'maxTop' : 'maxLeft'];
389
308
  var overDistance = 0;
390
-
391
309
  if (position < 0) {
392
310
  overDistance = -position;
393
311
  } else if (position > maxPos) {
@@ -395,23 +313,17 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
395
313
  } else {
396
314
  return 0;
397
315
  }
398
-
399
316
  return Math.min(1, 2 * overDistance / baseSize);
400
317
  };
401
-
402
318
  _this.applyOverscrollEffect = function (orientation, edge, type, ratio) {
403
319
  _this.props.applyOverscrollEffect(orientation, edge, type, ratio);
404
-
405
320
  _this.setOverscrollStatus(orientation, edge, type === overscrollTypeOnce ? overscrollTypeDone : type, ratio);
406
321
  };
407
-
408
322
  _this.checkAndApplyOverscrollEffect = function (orientation, edge, type) {
409
323
  var ratio = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
410
-
411
324
  var isVertical = orientation === 'vertical',
412
- curPos = isVertical ? _this.scrollTop : _this.scrollLeft,
413
- maxPos = _this.getScrollBounds()[isVertical ? 'maxTop' : 'maxLeft'];
414
-
325
+ curPos = isVertical ? _this.scrollTop : _this.scrollLeft,
326
+ maxPos = _this.getScrollBounds()[isVertical ? 'maxTop' : 'maxLeft'];
415
327
  if (edge === 'before' && curPos <= 0 || edge === 'after' && curPos >= maxPos) {
416
328
  // Already on the edge
417
329
  _this.applyOverscrollEffect(orientation, edge, type, ratio);
@@ -419,7 +331,6 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
419
331
  _this.setOverscrollStatus(orientation, edge, type, ratio);
420
332
  }
421
333
  };
422
-
423
334
  _this.clearOverscrollEffect = function (orientation, edge) {
424
335
  if (_this.getOverscrollStatus(orientation, edge).type !== overscrollTypeNone) {
425
336
  if (_this.props.clearOverscrollEffect) {
@@ -429,7 +340,6 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
429
340
  }
430
341
  }
431
342
  };
432
-
433
343
  _this.clearAllOverscrollEffects = function () {
434
344
  ['horizontal', 'vertical'].forEach(function (orientation) {
435
345
  ['before', 'after'].forEach(function (edge) {
@@ -437,34 +347,27 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
437
347
  });
438
348
  });
439
349
  };
440
-
441
350
  _this.applyOverscrollEffectOnDrag = function (orientation, edge, targetPosition, type) {
442
351
  if (edge) {
443
352
  var oppositeEdge = edge === 'before' ? 'after' : 'before',
444
- ratio = _this.calculateOverscrollRatio(orientation, targetPosition);
445
-
353
+ ratio = _this.calculateOverscrollRatio(orientation, targetPosition);
446
354
  _this.applyOverscrollEffect(orientation, edge, type, ratio);
447
-
448
355
  _this.clearOverscrollEffect(orientation, oppositeEdge);
449
356
  } else {
450
357
  _this.clearOverscrollEffect(orientation, 'before');
451
-
452
358
  _this.clearOverscrollEffect(orientation, 'after');
453
359
  }
454
360
  };
455
-
456
361
  _this.checkAndApplyOverscrollEffectOnScroll = function (orientation) {
457
362
  ['before', 'after'].forEach(function (edge) {
458
363
  var _this$getOverscrollSt = _this.getOverscrollStatus(orientation, edge),
459
- ratio = _this$getOverscrollSt.ratio,
460
- type = _this$getOverscrollSt.type;
461
-
364
+ ratio = _this$getOverscrollSt.ratio,
365
+ type = _this$getOverscrollSt.type;
462
366
  if (type === overscrollTypeOnce) {
463
367
  _this.checkAndApplyOverscrollEffect(orientation, edge, type, ratio);
464
368
  }
465
369
  });
466
370
  };
467
-
468
371
  _this.checkAndApplyOverscrollEffectOnStart = function (orientation, edge, targetPosition) {
469
372
  if (_this.isDragging) {
470
373
  _this.applyOverscrollEffectOnDrag(orientation, edge, targetPosition, overscrollTypeHold);
@@ -472,20 +375,17 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
472
375
  _this.checkAndApplyOverscrollEffect(orientation, edge, overscrollTypeOnce);
473
376
  }
474
377
  };
475
-
476
378
  _this.getReachedEdgeInfo = function () {
477
379
  var bounds = _this.getScrollBounds(),
478
- reachedEdgeInfo = {
479
- bottom: false,
480
- left: false,
481
- right: false,
482
- top: false
483
- };
484
-
380
+ reachedEdgeInfo = {
381
+ bottom: false,
382
+ left: false,
383
+ right: false,
384
+ top: false
385
+ };
485
386
  if (_this.canScrollHorizontally(bounds)) {
486
387
  var rtl = _this.props.rtl,
487
- edge = _this.getEdgeFromPosition(_this.scrollLeft, bounds.maxLeft);
488
-
388
+ edge = _this.getEdgeFromPosition(_this.scrollLeft, bounds.maxLeft);
489
389
  if (edge) {
490
390
  // if edge is null, no need to check which edge is reached.
491
391
  if (edge === 'before' && !rtl || edge === 'after' && rtl) {
@@ -495,104 +395,80 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
495
395
  }
496
396
  }
497
397
  }
498
-
499
398
  if (_this.canScrollVertically(bounds)) {
500
399
  var _edge = _this.getEdgeFromPosition(_this.scrollTop, bounds.maxTop);
501
-
502
400
  if (_edge === 'before') {
503
401
  reachedEdgeInfo.top = true;
504
402
  } else if (_edge === 'after') {
505
403
  reachedEdgeInfo.bottom = true;
506
404
  }
507
405
  }
508
-
509
406
  return reachedEdgeInfo;
510
407
  };
511
-
512
408
  _this.doScrollStop = function () {
513
409
  _this.scrolling = false;
514
-
515
410
  _this.forwardScrollEvent('onScrollStop', _this.getReachedEdgeInfo());
516
411
  };
517
-
518
412
  _this.scrollStopJob = new _util.Job(_this.doScrollStop, scrollStopWaiting);
519
-
520
413
  _this.scrollAnimation = function (animationInfo) {
521
414
  return function (curTime) {
522
415
  var sourceX = animationInfo.sourceX,
523
- sourceY = animationInfo.sourceY,
524
- targetX = animationInfo.targetX,
525
- targetY = animationInfo.targetY,
526
- duration = animationInfo.duration,
527
- bounds = _this.getScrollBounds();
528
-
416
+ sourceY = animationInfo.sourceY,
417
+ targetX = animationInfo.targetX,
418
+ targetY = animationInfo.targetY,
419
+ duration = animationInfo.duration,
420
+ bounds = _this.getScrollBounds();
529
421
  if (curTime < duration) {
530
422
  var toBeContinued = false,
531
- curTargetX = sourceX,
532
- curTargetY = sourceY;
533
-
423
+ curTargetX = sourceX,
424
+ curTargetY = sourceY;
534
425
  if (_this.canScrollHorizontally(bounds)) {
535
426
  curTargetX = _this.animator.timingFunction(sourceX, targetX, duration, curTime);
536
-
537
427
  if (Math.abs(curTargetX - targetX) < epsilon) {
538
428
  curTargetX = targetX;
539
429
  } else {
540
430
  toBeContinued = true;
541
431
  }
542
432
  }
543
-
544
433
  if (_this.canScrollVertically(bounds)) {
545
434
  curTargetY = _this.animator.timingFunction(sourceY, targetY, duration, curTime);
546
-
547
435
  if (Math.abs(curTargetY - targetY) < epsilon) {
548
436
  curTargetY = targetY;
549
437
  } else {
550
438
  toBeContinued = true;
551
439
  }
552
440
  }
553
-
554
441
  _this.scroll(curTargetX, curTargetY, targetX, targetY);
555
-
556
442
  if (!toBeContinued) {
557
443
  _this.stop();
558
444
  }
559
445
  } else {
560
446
  _this.scroll(targetX, targetY, targetX, targetY);
561
-
562
447
  _this.stop();
563
448
  }
564
449
  };
565
450
  };
566
-
567
451
  _this.scroll = function (left, top) {
568
452
  var _this$childRefCurrent;
569
-
570
453
  if (left !== _this.scrollLeft) {
571
454
  _this.setScrollLeft(left);
572
455
  }
573
-
574
456
  if (top !== _this.scrollTop) {
575
457
  _this.setScrollTop(top);
576
458
  }
577
-
578
459
  for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
579
460
  rest[_key - 2] = arguments[_key];
580
461
  }
581
-
582
462
  (_this$childRefCurrent = _this.childRefCurrent).setScrollPosition.apply(_this$childRefCurrent, [_this.scrollLeft, _this.scrollTop, _this.props.rtl].concat(rest));
583
-
584
463
  _this.forwardScrollEvent('onScroll');
585
464
  };
586
-
587
465
  _this.getPositionForScrollTo = function (opt) {
588
466
  var bounds = _this.getScrollBounds(),
589
- canScrollHorizontally = _this.canScrollHorizontally(bounds),
590
- canScrollVertically = _this.canScrollVertically(bounds);
591
-
467
+ canScrollHorizontally = _this.canScrollHorizontally(bounds),
468
+ canScrollVertically = _this.canScrollVertically(bounds);
592
469
  var itemPos,
593
- left = null,
594
- top = null;
595
-
470
+ left = null,
471
+ top = null;
596
472
  if (opt instanceof Object) {
597
473
  if (opt.position instanceof Object) {
598
474
  if (canScrollHorizontally) {
@@ -601,7 +477,6 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
601
477
  } else {
602
478
  left = 0;
603
479
  }
604
-
605
480
  if (canScrollVertically) {
606
481
  // We need '!=' to check if opt.position.y is null or undefined
607
482
  top = opt.position.y != null ? opt.position.y : _this.scrollTop;
@@ -616,7 +491,6 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
616
491
  left = bounds.maxLeft;
617
492
  }
618
493
  }
619
-
620
494
  if (canScrollVertically) {
621
495
  if (opt.align.includes('top')) {
622
496
  top = 0;
@@ -632,37 +506,30 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
632
506
  itemPos = _this.childRefCurrent.getNodePosition(opt.node);
633
507
  }
634
508
  }
635
-
636
509
  if (itemPos) {
637
510
  if (canScrollHorizontally) {
638
511
  left = itemPos.left;
639
512
  }
640
-
641
513
  if (canScrollVertically) {
642
514
  top = itemPos.top;
643
515
  }
644
516
  }
645
517
  }
646
518
  }
647
-
648
519
  return {
649
520
  left: left,
650
521
  top: top
651
522
  };
652
523
  };
653
-
654
524
  _this.scrollTo = function (opt) {
655
525
  if (!_this.deferScrollTo) {
656
526
  var _this$getPositionForS = _this.getPositionForScrollTo(opt),
657
- left = _this$getPositionForS.left,
658
- top = _this$getPositionForS.top;
659
-
527
+ left = _this$getPositionForS.left,
528
+ top = _this$getPositionForS.top;
660
529
  if (_this.props.scrollTo) {
661
530
  _this.props.scrollTo(opt);
662
531
  }
663
-
664
532
  _this.scrollToInfo = null;
665
-
666
533
  _this.start({
667
534
  targetX: left !== null ? left : _this.scrollLeft,
668
535
  targetY: top !== null ? top : _this.scrollTop,
@@ -672,43 +539,37 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
672
539
  _this.scrollToInfo = opt;
673
540
  }
674
541
  };
675
-
676
542
  _this.canScrollHorizontally = function (bounds) {
677
543
  var direction = _this.props.direction;
678
544
  return (direction === 'horizontal' || direction === 'both') && bounds.scrollWidth > bounds.clientWidth && !isNaN(bounds.scrollWidth);
679
545
  };
680
-
681
546
  _this.canScrollVertically = function (bounds) {
682
547
  var direction = _this.props.direction;
683
548
  return (direction === 'vertical' || direction === 'both') && bounds.scrollHeight > bounds.clientHeight && !isNaN(bounds.scrollHeight);
684
549
  };
685
-
686
550
  _this.startHidingThumb = function () {
687
551
  if (_this.state.isHorizontalScrollbarVisible && _this.horizontalScrollbarRef.current) {
688
552
  _this.horizontalScrollbarRef.current.startHidingThumb();
689
553
  }
690
-
691
554
  if (_this.state.isVerticalScrollbarVisible && _this.verticalScrollbarRef.current) {
692
555
  _this.verticalScrollbarRef.current.startHidingThumb();
693
556
  }
694
557
  };
695
-
696
558
  _this.updateScrollbars = function () {
697
559
  var _this$props = _this.props,
698
- horizontalScrollbar = _this$props.horizontalScrollbar,
699
- verticalScrollbar = _this$props.verticalScrollbar,
700
- _this$state = _this.state,
701
- isHorizontalScrollbarVisible = _this$state.isHorizontalScrollbarVisible,
702
- isVerticalScrollbarVisible = _this$state.isVerticalScrollbarVisible,
703
- bounds = _this.getScrollBounds(),
704
- canScrollHorizontally = _this.canScrollHorizontally(bounds),
705
- canScrollVertically = _this.canScrollVertically(bounds),
706
- curHorizontalScrollbarVisible = horizontalScrollbar === 'auto' ? canScrollHorizontally : horizontalScrollbar === 'visible',
707
- curVerticalScrollbarVisible = verticalScrollbar === 'auto' ? canScrollVertically : verticalScrollbar === 'visible'; // determine if we should hide or show any scrollbars
708
-
709
-
560
+ horizontalScrollbar = _this$props.horizontalScrollbar,
561
+ verticalScrollbar = _this$props.verticalScrollbar,
562
+ _this$state = _this.state,
563
+ isHorizontalScrollbarVisible = _this$state.isHorizontalScrollbarVisible,
564
+ isVerticalScrollbarVisible = _this$state.isVerticalScrollbarVisible,
565
+ bounds = _this.getScrollBounds(),
566
+ canScrollHorizontally = _this.canScrollHorizontally(bounds),
567
+ canScrollVertically = _this.canScrollVertically(bounds),
568
+ curHorizontalScrollbarVisible = horizontalScrollbar === 'auto' ? canScrollHorizontally : horizontalScrollbar === 'visible',
569
+ curVerticalScrollbarVisible = verticalScrollbar === 'auto' ? canScrollVertically : verticalScrollbar === 'visible';
570
+
571
+ // determine if we should hide or show any scrollbars
710
572
  var isVisibilityChanged = isHorizontalScrollbarVisible !== curHorizontalScrollbarVisible || isVerticalScrollbarVisible !== curVerticalScrollbarVisible;
711
-
712
573
  if (isVisibilityChanged) {
713
574
  // one or both scrollbars have changed visibility
714
575
  _this.setState({
@@ -720,17 +581,15 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
720
581
  _this.isUpdatedScrollThumb = _this.updateScrollThumbSize();
721
582
  }
722
583
  };
723
-
724
584
  _this.updateScrollThumbSize = function () {
725
585
  var _this$props2 = _this.props,
726
- horizontalScrollbar = _this$props2.horizontalScrollbar,
727
- verticalScrollbar = _this$props2.verticalScrollbar,
728
- bounds = _this.getScrollBounds(),
729
- canScrollHorizontally = _this.canScrollHorizontally(bounds),
730
- canScrollVertically = _this.canScrollVertically(bounds),
731
- curHorizontalScrollbarVisible = horizontalScrollbar === 'auto' ? canScrollHorizontally : horizontalScrollbar === 'visible',
732
- curVerticalScrollbarVisible = verticalScrollbar === 'auto' ? canScrollVertically : verticalScrollbar === 'visible';
733
-
586
+ horizontalScrollbar = _this$props2.horizontalScrollbar,
587
+ verticalScrollbar = _this$props2.verticalScrollbar,
588
+ bounds = _this.getScrollBounds(),
589
+ canScrollHorizontally = _this.canScrollHorizontally(bounds),
590
+ canScrollVertically = _this.canScrollVertically(bounds),
591
+ curHorizontalScrollbarVisible = horizontalScrollbar === 'auto' ? canScrollHorizontally : horizontalScrollbar === 'visible',
592
+ curVerticalScrollbarVisible = verticalScrollbar === 'auto' ? canScrollVertically : verticalScrollbar === 'visible';
734
593
  if (curHorizontalScrollbarVisible || curVerticalScrollbarVisible) {
735
594
  // no visibility change but need to notify whichever scrollbars are visible of the
736
595
  // updated bounds and scroll position
@@ -738,39 +597,33 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
738
597
  scrollLeft: _this.scrollLeft,
739
598
  scrollTop: _this.scrollTop
740
599
  });
741
-
742
600
  if (curHorizontalScrollbarVisible && _this.horizontalScrollbarRef.current) {
743
601
  _this.horizontalScrollbarRef.current.update(updatedBounds);
744
602
  }
745
-
746
603
  if (curVerticalScrollbarVisible && _this.verticalScrollbarRef.current) {
747
604
  _this.verticalScrollbarRef.current.update(updatedBounds);
748
605
  }
749
-
750
606
  return true;
751
607
  }
752
-
753
608
  return false;
754
609
  };
755
-
756
610
  _this.initChildRef = function (ref) {
757
611
  if (ref) {
758
612
  _this.childRefCurrent = ref;
759
613
  }
760
614
  };
761
-
762
615
  _this.handleScroll = function () {
763
- var childRefCurrent = _this.childRefCurrent; // Prevent scroll by focus.
616
+ var childRefCurrent = _this.childRefCurrent;
617
+
618
+ // Prevent scroll by focus.
764
619
  // VirtualList and VirtualGridList DO NOT receive `onscroll` event.
765
620
  // Only Scroller could get `onscroll` event.
766
-
767
621
  if (!_this.animator.isAnimating() && childRefCurrent && childRefCurrent.containerRef.current && childRefCurrent.getRtlPositionX && !_this.isDragging) {
768
622
  // For Scroller
769
623
  childRefCurrent.containerRef.current.scrollTop = _this.scrollTop;
770
624
  childRefCurrent.containerRef.current.scrollLeft = childRefCurrent.getRtlPositionX(_this.scrollLeft);
771
625
  }
772
626
  };
773
-
774
627
  _this.state = {
775
628
  remeasure: false,
776
629
  isHorizontalScrollbarVisible: props.horizontalScrollbar === 'visible',
@@ -789,14 +642,14 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
789
642
  vertical: true,
790
643
  clientSize: props.clientSize
791
644
  };
792
- _this.overscrollEnabled = !!props.applyOverscrollEffect; // Enable the early bail out of repeated scrolling to the same position
645
+ _this.overscrollEnabled = !!props.applyOverscrollEffect;
793
646
 
647
+ // Enable the early bail out of repeated scrolling to the same position
794
648
  _this.animationInfo = null;
795
649
  _this.resizeRegistry = _Registry["default"].create(_this.handleResize.bind(_assertThisInitialized(_this)));
796
650
  props.cbScrollTo(_this.scrollTo);
797
651
  return _this;
798
652
  }
799
-
800
653
  _createClass(ScrollableBase, [{
801
654
  key: "componentDidMount",
802
655
  value: function componentDidMount() {
@@ -808,10 +661,11 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
808
661
  key: "componentDidUpdate",
809
662
  value: function componentDidUpdate(prevProps, prevState) {
810
663
  var _this$state2 = this.state,
811
- isHorizontalScrollbarVisible = _this$state2.isHorizontalScrollbarVisible,
812
- isVerticalScrollbarVisible = _this$state2.isVerticalScrollbarVisible,
813
- hasDataSizeChanged = this.childRefCurrent.hasDataSizeChanged; // Need to sync calculated client size if it is different from the real size
664
+ isHorizontalScrollbarVisible = _this$state2.isHorizontalScrollbarVisible,
665
+ isVerticalScrollbarVisible = _this$state2.isVerticalScrollbarVisible,
666
+ hasDataSizeChanged = this.childRefCurrent.hasDataSizeChanged;
814
667
 
668
+ // Need to sync calculated client size if it is different from the real size
815
669
  if (this.childRefCurrent.syncClientSize) {
816
670
  // If we actually synced, we need to reset scroll position.
817
671
  if (this.childRefCurrent.syncClientSize()) {
@@ -819,27 +673,23 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
819
673
  this.setScrollTop(0);
820
674
  }
821
675
  }
822
-
823
676
  this.clampScrollPosition();
824
677
  this.addEventListeners();
825
-
826
678
  if (hasDataSizeChanged === false && (isHorizontalScrollbarVisible && !prevState.isHorizontalScrollbarVisible || isVerticalScrollbarVisible && !prevState.isVerticalScrollbarVisible)) {
827
679
  this.deferScrollTo = false;
828
680
  this.isUpdatedScrollThumb = this.updateScrollThumbSize();
829
681
  } else {
830
682
  this.updateScrollbars();
831
683
  }
832
-
833
684
  if (this.scrollToInfo !== null) {
834
685
  if (!this.deferScrollTo) {
835
686
  this.scrollTo(this.scrollToInfo);
836
687
  }
837
- } // publish container resize changes
838
-
688
+ }
839
689
 
690
+ // publish container resize changes
840
691
  var horizontal = isHorizontalScrollbarVisible !== prevState.isHorizontalScrollbarVisible;
841
692
  var vertical = isVerticalScrollbarVisible !== prevState.isVerticalScrollbarVisible;
842
-
843
693
  if (horizontal || vertical) {
844
694
  this.resizeRegistry.notify({});
845
695
  }
@@ -847,18 +697,15 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
847
697
  }, {
848
698
  key: "componentWillUnmount",
849
699
  value: function componentWillUnmount() {
850
- this.resizeRegistry.parent = null; // Before call cancelAnimationFrame, you must send scrollStop Event.
851
-
700
+ this.resizeRegistry.parent = null;
701
+ // Before call cancelAnimationFrame, you must send scrollStop Event.
852
702
  if (this.scrolling) {
853
703
  this.forwardScrollEvent('onScrollStop', this.getReachedEdgeInfo());
854
704
  }
855
-
856
705
  this.scrollStopJob.stop();
857
-
858
706
  if (this.animator.isAnimating()) {
859
707
  this.animator.stop();
860
708
  }
861
-
862
709
  this.removeEventListeners();
863
710
  }
864
711
  }, {
@@ -870,7 +717,8 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
870
717
  }
871
718
  }, {
872
719
  key: "enqueueForceUpdate",
873
- value: // TODO: consider replacing forceUpdate() by storing bounds in state rather than a non-
720
+ value:
721
+ // TODO: consider replacing forceUpdate() by storing bounds in state rather than a non-
874
722
  // state member.
875
723
  function enqueueForceUpdate() {
876
724
  this.childRefCurrent.calculateMetrics(this.childRefCurrent.props);
@@ -880,16 +728,15 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
880
728
  key: "clampScrollPosition",
881
729
  value: function clampScrollPosition() {
882
730
  var bounds = this.getScrollBounds();
883
-
884
731
  if (this.scrollTop > bounds.maxTop) {
885
732
  this.scrollTop = bounds.maxTop;
886
733
  }
887
-
888
734
  if (this.scrollLeft > bounds.maxLeft) {
889
735
  this.scrollLeft = bounds.maxLeft;
890
736
  }
891
- } // constants
737
+ }
892
738
 
739
+ // constants
893
740
  }, {
894
741
  key: "calculateDistanceByWheel",
895
742
  value: function calculateDistanceByWheel(deltaMode, delta, maxPixel) {
@@ -902,12 +749,13 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
902
749
  // page
903
750
  delta = delta < 0 ? -maxPixel : maxPixel;
904
751
  }
905
-
906
752
  return delta;
907
753
  }
908
754
  }, {
909
755
  key: "forwardScrollEvent",
910
- value: // call scroll callbacks
756
+ value:
757
+ // call scroll callbacks
758
+
911
759
  function forwardScrollEvent(type, reachedEdgeInfo) {
912
760
  (0, _handle.forward)(type, {
913
761
  type: type,
@@ -916,18 +764,17 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
916
764
  moreInfo: this.getMoreInfo(),
917
765
  reachedEdgeInfo: reachedEdgeInfo
918
766
  }, this.props);
919
- } // update scroll position
767
+ }
920
768
 
769
+ // update scroll position
921
770
  }, {
922
771
  key: "setScrollLeft",
923
772
  value: function setScrollLeft(value) {
924
773
  var bounds = this.getScrollBounds();
925
774
  this.scrollLeft = (0, _clamp["default"])(0, bounds.maxLeft, value);
926
-
927
775
  if (this.overscrollEnabled && this.props.overscrollEffectOn[this.lastInputType]) {
928
776
  this.checkAndApplyOverscrollEffectOnScroll('horizontal');
929
777
  }
930
-
931
778
  if (this.state.isHorizontalScrollbarVisible) {
932
779
  this.updateThumb(this.horizontalScrollbarRef, bounds);
933
780
  }
@@ -937,11 +784,9 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
937
784
  value: function setScrollTop(value) {
938
785
  var bounds = this.getScrollBounds();
939
786
  this.scrollTop = (0, _clamp["default"])(0, bounds.maxTop, value);
940
-
941
787
  if (this.overscrollEnabled && this.props.overscrollEffectOn[this.lastInputType]) {
942
788
  this.checkAndApplyOverscrollEffectOnScroll('vertical');
943
789
  }
944
-
945
790
  if (this.state.isVerticalScrollbarVisible) {
946
791
  this.updateThumb(this.verticalScrollbarRef, bounds);
947
792
  }
@@ -950,60 +795,52 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
950
795
  key: "start",
951
796
  value: function start(_ref) {
952
797
  var targetX = _ref.targetX,
953
- targetY = _ref.targetY,
954
- _ref$animate = _ref.animate,
955
- animate = _ref$animate === void 0 ? true : _ref$animate,
956
- _ref$duration = _ref.duration,
957
- duration = _ref$duration === void 0 ? animationDuration : _ref$duration,
958
- _ref$overscrollEffect = _ref.overscrollEffect,
959
- overscrollEffect = _ref$overscrollEffect === void 0 ? false : _ref$overscrollEffect;
798
+ targetY = _ref.targetY,
799
+ _ref$animate = _ref.animate,
800
+ animate = _ref$animate === void 0 ? true : _ref$animate,
801
+ _ref$duration = _ref.duration,
802
+ duration = _ref$duration === void 0 ? animationDuration : _ref$duration,
803
+ _ref$overscrollEffect = _ref.overscrollEffect,
804
+ overscrollEffect = _ref$overscrollEffect === void 0 ? false : _ref$overscrollEffect;
960
805
  var scrollLeft = this.scrollLeft,
961
- scrollTop = this.scrollTop,
962
- bounds = this.getScrollBounds(),
963
- maxLeft = bounds.maxLeft,
964
- maxTop = bounds.maxTop;
806
+ scrollTop = this.scrollTop,
807
+ bounds = this.getScrollBounds(),
808
+ maxLeft = bounds.maxLeft,
809
+ maxTop = bounds.maxTop;
965
810
  var updatedAnimationInfo = {
966
811
  sourceX: scrollLeft,
967
812
  sourceY: scrollTop,
968
813
  targetX: targetX,
969
814
  targetY: targetY,
970
815
  duration: duration
971
- }; // bail early when scrolling to the same position
816
+ };
972
817
 
818
+ // bail early when scrolling to the same position
973
819
  if (this.animator.isAnimating() && this.animationInfo && this.animationInfo.targetX === targetX && this.animationInfo.targetY === targetY) {
974
820
  return;
975
821
  }
976
-
977
822
  this.animationInfo = updatedAnimationInfo;
978
823
  this.animator.stop();
979
-
980
824
  if (!this.scrolling) {
981
825
  this.scrolling = true;
982
826
  this.forwardScrollEvent('onScrollStart');
983
827
  }
984
-
985
828
  this.scrollStopJob.stop();
986
-
987
829
  if (Math.abs(maxLeft - targetX) < epsilon) {
988
830
  targetX = maxLeft;
989
831
  }
990
-
991
832
  if (Math.abs(maxTop - targetY) < epsilon) {
992
833
  targetY = maxTop;
993
834
  }
994
-
995
835
  if (this.overscrollEnabled && overscrollEffect) {
996
836
  if (scrollLeft !== targetX && this.canScrollHorizontally(bounds)) {
997
837
  this.checkAndApplyOverscrollEffectOnStart('horizontal', this.getEdgeFromPosition(targetX, maxLeft), targetX);
998
838
  }
999
-
1000
839
  if (scrollTop !== targetY && this.canScrollVertically(bounds)) {
1001
840
  this.checkAndApplyOverscrollEffectOnStart('vertical', this.getEdgeFromPosition(targetY, maxTop), targetY);
1002
841
  }
1003
842
  }
1004
-
1005
843
  this.showThumb(bounds);
1006
-
1007
844
  if (animate) {
1008
845
  this.animator.animate(this.scrollAnimation(this.animationInfo));
1009
846
  } else {
@@ -1018,29 +855,28 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
1018
855
  this.lastInputType = null;
1019
856
  this.isScrollAnimationTargetAccumulated = false;
1020
857
  this.startHidingThumb();
1021
-
1022
858
  if (this.overscrollEnabled && !this.isDragging) {
1023
859
  // not check this.props.overscrollEffectOn for safety
1024
860
  this.clearAllOverscrollEffects();
1025
861
  }
1026
-
1027
862
  if (this.props.stop) {
1028
863
  this.props.stop();
1029
864
  }
1030
-
1031
865
  if (this.scrolling) {
1032
866
  this.scrollStopJob.start();
1033
867
  }
1034
- } // scrollTo API
868
+ }
1035
869
 
870
+ // scrollTo API
1036
871
  }, {
1037
872
  key: "showThumb",
1038
- value: // scroll bar
873
+ value:
874
+ // scroll bar
875
+
1039
876
  function showThumb(bounds) {
1040
877
  if (this.state.isHorizontalScrollbarVisible && this.canScrollHorizontally(bounds) && this.horizontalScrollbarRef.current) {
1041
878
  this.horizontalScrollbarRef.current.showThumb();
1042
879
  }
1043
-
1044
880
  if (this.state.isVerticalScrollbarVisible && this.canScrollVertically(bounds) && this.verticalScrollbarRef.current) {
1045
881
  this.verticalScrollbarRef.current.showThumb();
1046
882
  }
@@ -1055,7 +891,9 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
1055
891
  }
1056
892
  }, {
1057
893
  key: "getScrollBounds",
1058
- value: // ref
894
+ value:
895
+ // ref
896
+
1059
897
  function getScrollBounds() {
1060
898
  if (this.childRefCurrent && typeof this.childRefCurrent.getScrollBounds === 'function') {
1061
899
  return this.childRefCurrent.getScrollBounds();
@@ -1067,75 +905,71 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
1067
905
  if (this.childRefCurrent && typeof this.childRefCurrent.getMoreInfo === 'function') {
1068
906
  return this.childRefCurrent.getMoreInfo();
1069
907
  }
1070
- } // FIXME setting event handlers directly to work on the V8 snapshot.
908
+ }
1071
909
 
910
+ // FIXME setting event handlers directly to work on the V8 snapshot.
1072
911
  }, {
1073
912
  key: "addEventListeners",
1074
913
  value: function addEventListeners() {
1075
914
  var childRefCurrent = this.childRefCurrent,
1076
- containerRef = this.containerRef;
1077
-
915
+ containerRef = this.containerRef;
1078
916
  if (containerRef.current && containerRef.current.addEventListener) {
1079
917
  containerRef.current.addEventListener('wheel', this.onWheel);
1080
918
  containerRef.current.addEventListener('keydown', this.onKeyDown);
1081
919
  containerRef.current.addEventListener('mousedown', this.onMouseDown);
1082
920
  }
1083
-
1084
921
  if (this.props.addEventListeners) {
1085
922
  this.props.addEventListeners(childRefCurrent.containerRef);
1086
923
  }
1087
-
1088
924
  if (window) {
1089
925
  window.addEventListener('resize', this.handleResizeWindow);
1090
926
  }
1091
- } // FIXME setting event handlers directly to work on the V8 snapshot.
927
+ }
1092
928
 
929
+ // FIXME setting event handlers directly to work on the V8 snapshot.
1093
930
  }, {
1094
931
  key: "removeEventListeners",
1095
932
  value: function removeEventListeners() {
1096
933
  var childRefCurrent = this.childRefCurrent,
1097
- containerRef = this.containerRef;
1098
-
934
+ containerRef = this.containerRef;
1099
935
  if (containerRef.current && containerRef.current.removeEventListener) {
1100
936
  containerRef.current.removeEventListener('wheel', this.onWheel);
1101
937
  containerRef.current.removeEventListener('keydown', this.onKeyDown);
1102
938
  containerRef.current.removeEventListener('mousedown', this.onMouseDown);
1103
939
  }
1104
-
1105
940
  if (this.props.removeEventListeners) {
1106
941
  this.props.removeEventListeners(childRefCurrent.containerRef);
1107
942
  }
1108
-
1109
943
  if (window) {
1110
944
  window.removeEventListener('resize', this.handleResizeWindow);
1111
945
  }
1112
- } // render
946
+ }
1113
947
 
948
+ // render
1114
949
  }, {
1115
950
  key: "render",
1116
951
  value: function render() {
1117
952
  var _this$props3 = this.props,
1118
- className = _this$props3.className,
1119
- containerRenderer = _this$props3.containerRenderer,
1120
- noScrollByDrag = _this$props3.noScrollByDrag,
1121
- rtl = _this$props3.rtl,
1122
- style = _this$props3.style,
1123
- rest = _objectWithoutProperties(_this$props3, _excluded),
1124
- _this$state3 = this.state,
1125
- isHorizontalScrollbarVisible = _this$state3.isHorizontalScrollbarVisible,
1126
- isVerticalScrollbarVisible = _this$state3.isVerticalScrollbarVisible,
1127
- scrollableClasses = (0, _classnames["default"])(_ScrollableModule["default"].scrollable, className),
1128
- childWrapper = noScrollByDrag ? 'div' : TouchableDiv,
1129
- childWrapperProps = _objectSpread({
1130
- className: _ScrollableModule["default"].content
1131
- }, !noScrollByDrag && {
1132
- flickConfig: flickConfig,
1133
- onDrag: this.onDrag,
1134
- onDragEnd: this.onDragEnd,
1135
- onDragStart: this.onDragStart,
1136
- onFlick: this.onFlick
1137
- });
1138
-
953
+ className = _this$props3.className,
954
+ containerRenderer = _this$props3.containerRenderer,
955
+ noScrollByDrag = _this$props3.noScrollByDrag,
956
+ rtl = _this$props3.rtl,
957
+ style = _this$props3.style,
958
+ rest = _objectWithoutProperties(_this$props3, _excluded),
959
+ _this$state3 = this.state,
960
+ isHorizontalScrollbarVisible = _this$state3.isHorizontalScrollbarVisible,
961
+ isVerticalScrollbarVisible = _this$state3.isVerticalScrollbarVisible,
962
+ scrollableClasses = (0, _classnames["default"])(_ScrollableModule["default"].scrollable, className),
963
+ childWrapper = noScrollByDrag ? 'div' : TouchableDiv,
964
+ childWrapperProps = _objectSpread({
965
+ className: _ScrollableModule["default"].content
966
+ }, !noScrollByDrag && {
967
+ flickConfig: flickConfig,
968
+ onDrag: this.onDrag,
969
+ onDragEnd: this.onDragEnd,
970
+ onDragStart: this.onDragStart,
971
+ onFlick: this.onFlick
972
+ });
1139
973
  delete rest.addEventListeners;
1140
974
  delete rest.applyOverscrollEffect;
1141
975
  delete rest.cbScrollTo;
@@ -1178,7 +1012,6 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
1178
1012
  });
1179
1013
  }
1180
1014
  }]);
1181
-
1182
1015
  return ScrollableBase;
1183
1016
  }(_react.Component);
1184
1017
  /**
@@ -1190,13 +1023,9 @@ var ScrollableBase = /*#__PURE__*/function (_Component) {
1190
1023
  * @ui
1191
1024
  * @private
1192
1025
  */
1193
-
1194
-
1195
1026
  exports.ScrollableBase = ScrollableBase;
1196
1027
  ScrollableBase.displayName = 'ui:ScrollableBase';
1197
- ScrollableBase.propTypes =
1198
- /** @lends ui/Scrollable.Scrollable.prototype */
1199
- {
1028
+ ScrollableBase.propTypes = /** @lends ui/Scrollable.Scrollable.prototype */{
1200
1029
  /**
1201
1030
  * Render function.
1202
1031
  *
@@ -1205,7 +1034,6 @@ ScrollableBase.propTypes =
1205
1034
  * @private
1206
1035
  */
1207
1036
  containerRenderer: _propTypes["default"].func.isRequired,
1208
-
1209
1037
  /**
1210
1038
  * Called when adding additional event listeners in a themed component.
1211
1039
  *
@@ -1213,7 +1041,6 @@ ScrollableBase.propTypes =
1213
1041
  * @private
1214
1042
  */
1215
1043
  addEventListeners: _propTypes["default"].func,
1216
-
1217
1044
  /**
1218
1045
  * Called to execute additional logic in a themed component to show overscroll effect.
1219
1046
  *
@@ -1221,7 +1048,6 @@ ScrollableBase.propTypes =
1221
1048
  * @private
1222
1049
  */
1223
1050
  applyOverscrollEffect: _propTypes["default"].func,
1224
-
1225
1051
  /**
1226
1052
  * A callback function that receives a reference to the `scrollTo` feature.
1227
1053
  *
@@ -1253,7 +1079,6 @@ ScrollableBase.propTypes =
1253
1079
  * @public
1254
1080
  */
1255
1081
  cbScrollTo: _propTypes["default"].func,
1256
-
1257
1082
  /**
1258
1083
  * Called to execute additional logic in a themed component to clear overscroll effect.
1259
1084
  *
@@ -1261,7 +1086,6 @@ ScrollableBase.propTypes =
1261
1086
  * @private
1262
1087
  */
1263
1088
  clearOverscrollEffect: _propTypes["default"].func,
1264
-
1265
1089
  /**
1266
1090
  * Client size of the container; valid values are an object that has `clientWidth` and `clientHeight`.
1267
1091
  *
@@ -1274,7 +1098,6 @@ ScrollableBase.propTypes =
1274
1098
  clientHeight: _propTypes["default"].number.isRequired,
1275
1099
  clientWidth: _propTypes["default"].number.isRequired
1276
1100
  }),
1277
-
1278
1101
  /**
1279
1102
  * Direction of the list or the scroller.
1280
1103
  *
@@ -1289,7 +1112,6 @@ ScrollableBase.propTypes =
1289
1112
  * @private
1290
1113
  */
1291
1114
  direction: _propTypes["default"].oneOf(['both', 'horizontal', 'vertical']),
1292
-
1293
1115
  /**
1294
1116
  * Called when resizing window
1295
1117
  *
@@ -1297,7 +1119,6 @@ ScrollableBase.propTypes =
1297
1119
  * @private
1298
1120
  */
1299
1121
  handleResizeWindow: _propTypes["default"].func,
1300
-
1301
1122
  /**
1302
1123
  * Specifies how to show horizontal scrollbar.
1303
1124
  *
@@ -1311,7 +1132,6 @@ ScrollableBase.propTypes =
1311
1132
  * @public
1312
1133
  */
1313
1134
  horizontalScrollbar: _propTypes["default"].oneOf(['auto', 'visible', 'hidden']),
1314
-
1315
1135
  /**
1316
1136
  * Prevents scroll by dragging or flicking on the list or the scroller.
1317
1137
  *
@@ -1320,7 +1140,6 @@ ScrollableBase.propTypes =
1320
1140
  * @private
1321
1141
  */
1322
1142
  noScrollByDrag: _propTypes["default"].bool,
1323
-
1324
1143
  /**
1325
1144
  * Prevents scroll by wheeling on the list or the scroller.
1326
1145
  *
@@ -1329,7 +1148,6 @@ ScrollableBase.propTypes =
1329
1148
  * @public
1330
1149
  */
1331
1150
  noScrollByWheel: _propTypes["default"].bool,
1332
-
1333
1151
  /**
1334
1152
  * Called when triggering a drag event.
1335
1153
  *
@@ -1337,7 +1155,6 @@ ScrollableBase.propTypes =
1337
1155
  * @private
1338
1156
  */
1339
1157
  onDrag: _propTypes["default"].func,
1340
-
1341
1158
  /**
1342
1159
  * Called when triggering a dragend event.
1343
1160
  *
@@ -1345,7 +1162,6 @@ ScrollableBase.propTypes =
1345
1162
  * @private
1346
1163
  */
1347
1164
  onDragEnd: _propTypes["default"].func,
1348
-
1349
1165
  /**
1350
1166
  * Called when triggering a dragstart event.
1351
1167
  *
@@ -1353,7 +1169,6 @@ ScrollableBase.propTypes =
1353
1169
  * @private
1354
1170
  */
1355
1171
  onDragStart: _propTypes["default"].func,
1356
-
1357
1172
  /**
1358
1173
  * Called when flicking with a mouse or a touch screen.
1359
1174
  *
@@ -1361,7 +1176,6 @@ ScrollableBase.propTypes =
1361
1176
  * @private
1362
1177
  */
1363
1178
  onFlick: _propTypes["default"].func,
1364
-
1365
1179
  /**
1366
1180
  * Called when pressing a key.
1367
1181
  *
@@ -1369,7 +1183,6 @@ ScrollableBase.propTypes =
1369
1183
  * @private
1370
1184
  */
1371
1185
  onKeyDown: _propTypes["default"].func,
1372
-
1373
1186
  /**
1374
1187
  * Called when triggering a mousedown event.
1375
1188
  *
@@ -1377,7 +1190,6 @@ ScrollableBase.propTypes =
1377
1190
  * @private
1378
1191
  */
1379
1192
  onMouseDown: _propTypes["default"].func,
1380
-
1381
1193
  /**
1382
1194
  * Called when scrolling.
1383
1195
  *
@@ -1393,7 +1205,6 @@ ScrollableBase.propTypes =
1393
1205
  * @public
1394
1206
  */
1395
1207
  onScroll: _propTypes["default"].func,
1396
-
1397
1208
  /**
1398
1209
  * Called when scroll starts.
1399
1210
  *
@@ -1424,7 +1235,6 @@ ScrollableBase.propTypes =
1424
1235
  * @public
1425
1236
  */
1426
1237
  onScrollStart: _propTypes["default"].func,
1427
-
1428
1238
  /**
1429
1239
  * Called when scroll stops.
1430
1240
  *
@@ -1455,7 +1265,6 @@ ScrollableBase.propTypes =
1455
1265
  * @public
1456
1266
  */
1457
1267
  onScrollStop: _propTypes["default"].func,
1458
-
1459
1268
  /**
1460
1269
  * Called when wheeling.
1461
1270
  *
@@ -1463,7 +1272,6 @@ ScrollableBase.propTypes =
1463
1272
  * @private
1464
1273
  */
1465
1274
  onWheel: _propTypes["default"].func,
1466
-
1467
1275
  /**
1468
1276
  * Specifies overscroll effects shows on which type of inputs.
1469
1277
  *
@@ -1476,7 +1284,6 @@ ScrollableBase.propTypes =
1476
1284
  pageKey: _propTypes["default"].bool,
1477
1285
  wheel: _propTypes["default"].bool
1478
1286
  }),
1479
-
1480
1287
  /**
1481
1288
  * Called when removing additional event listeners in a themed component.
1482
1289
  *
@@ -1484,7 +1291,6 @@ ScrollableBase.propTypes =
1484
1291
  * @private
1485
1292
  */
1486
1293
  removeEventListeners: _propTypes["default"].func,
1487
-
1488
1294
  /**
1489
1295
  * Indicates the content's text direction is right-to-left.
1490
1296
  *
@@ -1492,7 +1298,6 @@ ScrollableBase.propTypes =
1492
1298
  * @private
1493
1299
  */
1494
1300
  rtl: _propTypes["default"].bool,
1495
-
1496
1301
  /**
1497
1302
  * Called to execute additional logic in a themed component when scrollTo is called.
1498
1303
  *
@@ -1500,7 +1305,6 @@ ScrollableBase.propTypes =
1500
1305
  * @private
1501
1306
  */
1502
1307
  scrollTo: _propTypes["default"].func,
1503
-
1504
1308
  /**
1505
1309
  * Called to execute additional logic in a themed component when scroll stops.
1506
1310
  *
@@ -1508,7 +1312,6 @@ ScrollableBase.propTypes =
1508
1312
  * @private
1509
1313
  */
1510
1314
  stop: _propTypes["default"].func,
1511
-
1512
1315
  /**
1513
1316
  * Specifies how to show vertical scrollbar.
1514
1317
  *
@@ -1539,42 +1342,36 @@ ScrollableBase.defaultProps = {
1539
1342
  verticalScrollbar: 'auto'
1540
1343
  };
1541
1344
  ScrollableBase.contextType = _Resizable.ResizeContext;
1542
-
1543
1345
  var Scrollable = /*#__PURE__*/function (_Component2) {
1544
1346
  _inherits(Scrollable, _Component2);
1545
-
1546
1347
  var _super2 = _createSuper(Scrollable);
1547
-
1548
1348
  function Scrollable() {
1549
1349
  _classCallCheck(this, Scrollable);
1550
-
1551
1350
  return _super2.apply(this, arguments);
1552
1351
  }
1553
-
1554
1352
  _createClass(Scrollable, [{
1555
1353
  key: "render",
1556
1354
  value: function render() {
1557
1355
  var _this$props4 = this.props,
1558
- childRenderer = _this$props4.childRenderer,
1559
- rest = _objectWithoutProperties(_this$props4, _excluded2);
1560
-
1356
+ childRenderer = _this$props4.childRenderer,
1357
+ rest = _objectWithoutProperties(_this$props4, _excluded2);
1561
1358
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollableBase, _objectSpread(_objectSpread({}, rest), {}, {
1562
1359
  containerRenderer: function containerRenderer(_ref2) {
1563
1360
  var childComponentProps = _ref2.childComponentProps,
1564
- ChildWrapper = _ref2.childWrapper,
1565
- childWrapperProps = _ref2.childWrapperProps,
1566
- containerRef = _ref2.containerRef,
1567
- className = _ref2.className,
1568
- componentCss = _ref2.componentCss,
1569
- handleScroll = _ref2.handleScroll,
1570
- horizontalScrollbarProps = _ref2.horizontalScrollbarProps,
1571
- initChildRef = _ref2.initChildRef,
1572
- isHorizontalScrollbarVisible = _ref2.isHorizontalScrollbarVisible,
1573
- isVerticalScrollbarVisible = _ref2.isVerticalScrollbarVisible,
1574
- rtl = _ref2.rtl,
1575
- scrollTo = _ref2.scrollTo,
1576
- style = _ref2.style,
1577
- verticalScrollbarProps = _ref2.verticalScrollbarProps;
1361
+ ChildWrapper = _ref2.childWrapper,
1362
+ childWrapperProps = _ref2.childWrapperProps,
1363
+ containerRef = _ref2.containerRef,
1364
+ className = _ref2.className,
1365
+ componentCss = _ref2.componentCss,
1366
+ handleScroll = _ref2.handleScroll,
1367
+ horizontalScrollbarProps = _ref2.horizontalScrollbarProps,
1368
+ initChildRef = _ref2.initChildRef,
1369
+ isHorizontalScrollbarVisible = _ref2.isHorizontalScrollbarVisible,
1370
+ isVerticalScrollbarVisible = _ref2.isVerticalScrollbarVisible,
1371
+ rtl = _ref2.rtl,
1372
+ scrollTo = _ref2.scrollTo,
1373
+ style = _ref2.style,
1374
+ verticalScrollbarProps = _ref2.verticalScrollbarProps;
1578
1375
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
1579
1376
  className: className,
1580
1377
  ref: containerRef,
@@ -1601,15 +1398,11 @@ var Scrollable = /*#__PURE__*/function (_Component2) {
1601
1398
  }));
1602
1399
  }
1603
1400
  }]);
1604
-
1605
1401
  return Scrollable;
1606
1402
  }(_react.Component);
1607
-
1608
1403
  exports.Scrollable = Scrollable;
1609
1404
  Scrollable.displayName = 'ui:Scrollable';
1610
- Scrollable.propTypes =
1611
- /** @lends ui/Scrollable.Scrollable.prototype */
1612
- {
1405
+ Scrollable.propTypes = /** @lends ui/Scrollable.Scrollable.prototype */{
1613
1406
  /**
1614
1407
  * Render function.
1615
1408
  *