@enact/ui 4.5.2 → 4.6.1

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 (222) 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 +8 -28
  8. package/BodyText/tests/BodyText-specs.js +0 -19
  9. package/Button/Button.js +33 -63
  10. package/Button/tests/Button-specs.js +0 -26
  11. package/CHANGELOG.md +45 -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/package.json +3 -0
  25. package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
  26. package/FloatingLayer/tests/Scrim-specs.js +0 -9
  27. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
  28. package/FloatingLayer/useFloatingLayer.js +3 -14
  29. package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
  30. package/ForwardRef/ForwardRef.js +1 -10
  31. package/GridListImageItem/GridListImageItem.js +18 -51
  32. package/Group/Group.js +5 -36
  33. package/Group/GroupItem.js +16 -33
  34. package/Group/tests/Group-specs.js +0 -32
  35. package/Heading/Heading.js +8 -36
  36. package/Heading/tests/Heading-specs.js +81 -14
  37. package/Icon/Icon.js +19 -53
  38. package/Icon/tests/Icon-specs.js +0 -22
  39. package/IconButton/IconButton.js +24 -57
  40. package/IconButton/tests/IconButton-specs.js +0 -7
  41. package/Image/Image.js +17 -46
  42. package/Image/tests/Image-specs.js +0 -14
  43. package/ImageItem/ImageItem.js +18 -47
  44. package/ImageItem/tests/ImageItem-specs.js +0 -25
  45. package/Item/Item.js +9 -33
  46. package/Item/tests/Item-specs.js +0 -24
  47. package/LabeledIcon/LabeledIcon.js +22 -53
  48. package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
  49. package/Layout/Cell.js +18 -44
  50. package/Layout/Layout.js +23 -46
  51. package/Layout/tests/Layout-specs.js +10 -39
  52. package/Marquee/MarqueeBase.js +29 -63
  53. package/Marquee/MarqueeController.js +11 -72
  54. package/Marquee/MarqueeDecorator.js +70 -196
  55. package/Marquee/index.js +1 -5
  56. package/Marquee/tests/Marquee-specs.js +295 -87
  57. package/Measurable/Measurable.js +12 -34
  58. package/Measurable/tests/Measurable-specs.js +115 -0
  59. package/Media/Media.js +15 -65
  60. package/Media/tests/Media-specs.js +168 -0
  61. package/Placeholder/PlaceholderControllerDecorator.js +7 -43
  62. package/Placeholder/PlaceholderDecorator.js +7 -38
  63. package/Placeholder/index.js +1 -5
  64. package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
  65. package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
  66. package/ProgressBar/ProgressBar.js +14 -45
  67. package/ProgressBar/tests/ProgressBar-specs.js +0 -17
  68. package/RadioDecorator/RadioControllerDecorator.js +7 -29
  69. package/RadioDecorator/RadioDecorator.js +9 -42
  70. package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
  71. package/Repeater/Repeater.js +9 -33
  72. package/Repeater/tests/Repeater-specs.js +0 -38
  73. package/Resizable/Resizable.js +9 -37
  74. package/Resizable/tests/Resizable-specs.js +34 -0
  75. package/Routable/Link.js +11 -47
  76. package/Routable/Routable.js +12 -35
  77. package/Routable/Route.js +0 -6
  78. package/Routable/Router.js +15 -58
  79. package/Routable/tests/Routable-specs.js +7 -33
  80. package/Routable/tests/Router-specs.js +18 -44
  81. package/Routable/useLink.js +4 -8
  82. package/Routable/util.js +18 -24
  83. package/Scrollable/ScrollAnimator.js +49 -65
  84. package/Scrollable/ScrollThumb.js +2 -13
  85. package/Scrollable/Scrollable.js +180 -387
  86. package/Scrollable/ScrollableNative.js +189 -392
  87. package/Scrollable/Scrollbar.js +30 -102
  88. package/Scroller/Scroller.js +15 -39
  89. package/Scroller/ScrollerBasic.js +34 -89
  90. package/Scroller/UiScrollerBase.js +37 -84
  91. package/Scroller/tests/Scroller-specs.js +56 -0
  92. package/Skinnable/Skinnable.js +11 -38
  93. package/Skinnable/tests/Skinnable-specs.js +3 -74
  94. package/Skinnable/tests/useSkins-specs.js +1 -13
  95. package/Skinnable/tests/util-specs.js +0 -14
  96. package/Skinnable/useSkins.js +8 -15
  97. package/Skinnable/util.js +9 -20
  98. package/Slider/Knob.js +5 -24
  99. package/Slider/PositionDecorator.js +16 -54
  100. package/Slider/Slider.js +29 -67
  101. package/Slider/tests/Slider-specs.js +94 -7
  102. package/Slider/utils.js +0 -2
  103. package/SlotItem/SlotItem.js +23 -45
  104. package/SlotItem/tests/SlotItem-specs.js +0 -5
  105. package/Slottable/Slottable.js +4 -12
  106. package/Slottable/tests/Slottable-specs.js +19 -46
  107. package/Slottable/tests/useSlots-specs.js +27 -65
  108. package/Slottable/useSlots.js +8 -33
  109. package/Spinner/Spinner.js +16 -43
  110. package/Spinner/tests/Spinner-specs.js +0 -15
  111. package/ToggleIcon/ToggleIcon.js +10 -36
  112. package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
  113. package/ToggleItem/ToggleItem.js +24 -57
  114. package/ToggleItem/tests/ToggleItem-specs.js +0 -30
  115. package/Toggleable/Toggle.js +1 -15
  116. package/Toggleable/Toggleable.js +12 -45
  117. package/Toggleable/tests/Toggleable-specs.js +28 -96
  118. package/Toggleable/useToggle.js +3 -19
  119. package/Touchable/ClickAllow.js +5 -14
  120. package/Touchable/Drag.js +16 -54
  121. package/Touchable/Flick.js +11 -42
  122. package/Touchable/Hold.js +21 -68
  123. package/Touchable/Pinch.js +185 -0
  124. package/Touchable/Touch.js +71 -76
  125. package/Touchable/Touchable.js +95 -75
  126. package/Touchable/config.js +27 -24
  127. package/Touchable/tests/Touchable-specs.js +360 -119
  128. package/Touchable/tests/useTouch-specs.js +6 -80
  129. package/Touchable/useTouch.js +57 -65
  130. package/Transition/Transition.js +37 -118
  131. package/Transition/tests/Transition-specs.js +20 -60
  132. package/ViewManager/Arranger.js +10 -22
  133. package/ViewManager/TransitionGroup.js +32 -107
  134. package/ViewManager/View.js +35 -91
  135. package/ViewManager/ViewManager.js +20 -84
  136. package/ViewManager/tests/View-specs.js +0 -17
  137. package/ViewManager/tests/ViewManager-specs.js +236 -305
  138. package/ViewManager/tests/test-utils.js +0 -8
  139. package/VirtualList/UiVirtualListBase.js +265 -409
  140. package/VirtualList/VirtualList.js +29 -69
  141. package/VirtualList/VirtualListBase.js +0 -3
  142. package/VirtualList/VirtualListBasic.js +273 -431
  143. package/VirtualList/tests/VirtualGridList-native-specs.js +161 -0
  144. package/VirtualList/tests/VirtualGridList-specs.js +614 -0
  145. package/VirtualList/tests/VirtualList-native-specs.js +152 -0
  146. package/VirtualList/tests/VirtualList-specs.js +423 -95
  147. package/internal/IdProvider/IdProvider.js +7 -21
  148. package/internal/IdProvider/Provider.js +4 -17
  149. package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
  150. package/internal/IdProvider/tests/useId-specs.js +6 -20
  151. package/internal/IdProvider/useId.js +0 -6
  152. package/internal/Pure/Pure.js +3 -30
  153. package/internal/Pure/tests/Pure-specs.js +88 -0
  154. package/internal/localized-fonts/localized-fonts.js +33 -62
  155. package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
  156. package/internal/selection/selection.js +1 -6
  157. package/internal/selection/tests/selection-specs.js +6 -4
  158. package/internal/validators/tests/validators-specs.js +80 -0
  159. package/internal/validators/validators.js +14 -34
  160. package/package.json +9 -3
  161. package/resolution/ResolutionDecorator.js +4 -40
  162. package/resolution/index.js +0 -7
  163. package/resolution/resolution.js +42 -80
  164. package/resolution/tests/ResolutionDecorator-specs.js +4 -11
  165. package/resolution/tests/resolution-specs.js +2 -2
  166. package/useControlledState/tests/useControlledState-specs.js +15 -46
  167. package/useControlledState/useControlledState.js +11 -22
  168. package/useScroll/ScrollAnimator.js +49 -65
  169. package/useScroll/Scrollbar.js +22 -58
  170. package/useScroll/ScrollbarTrack.js +3 -19
  171. package/useScroll/useScroll.js +267 -454
  172. package/useScroll/utilDOM.js +8 -14
  173. package/useScroll/utilEvent.js +0 -4
  174. package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
  175. package/BodyText/BodyText.d.ts +0 -66
  176. package/Button/Button.d.ts +0 -125
  177. package/Cancelable/Cancelable.d.ts +0 -64
  178. package/Changeable/Changeable.d.ts +0 -54
  179. package/ComponentOverride/ComponentOverride.d.ts +0 -52
  180. package/ForwardRef/ForwardRef.d.ts +0 -22
  181. package/GridListImageItem/GridListImageItem.d.ts +0 -85
  182. package/Group/Group.d.ts +0 -107
  183. package/Heading/Heading.d.ts +0 -90
  184. package/Icon/Icon.d.ts +0 -88
  185. package/IconButton/IconButton.d.ts +0 -115
  186. package/Image/Image.d.ts +0 -113
  187. package/ImageItem/ImageItem.d.ts +0 -83
  188. package/Item/Item.d.ts +0 -64
  189. package/LabeledIcon/LabeledIcon.d.ts +0 -130
  190. package/Layout/Layout.d.ts +0 -247
  191. package/Marquee/index.d.ts +0 -258
  192. package/Measurable/Measurable.d.ts +0 -26
  193. package/Media/Media.d.ts +0 -99
  194. package/Placeholder/index.d.ts +0 -53
  195. package/ProgressBar/ProgressBar.d.ts +0 -92
  196. package/RadioDecorator/RadioDecorator.d.ts +0 -35
  197. package/Repeater/Repeater.d.ts +0 -83
  198. package/Resizable/Resizable.d.ts +0 -31
  199. package/Routable/Routable.d.ts +0 -148
  200. package/Scrollable/Scrollable.d.ts +0 -0
  201. package/Scroller/Scroller.d.ts +0 -276
  202. package/Skinnable/Skinnable.d.ts +0 -94
  203. package/Slider/Slider.d.ts +0 -202
  204. package/SlotItem/SlotItem.d.ts +0 -118
  205. package/Slottable/Slottable.d.ts +0 -22
  206. package/Spinner/Spinner.d.ts +0 -95
  207. package/ToggleIcon/ToggleIcon.d.ts +0 -90
  208. package/ToggleItem/ToggleItem.d.ts +0 -134
  209. package/Toggleable/Toggleable.d.ts +0 -103
  210. package/Touchable/Touchable.d.ts +0 -175
  211. package/Transition/Transition.d.ts +0 -196
  212. package/ViewManager/ViewManager.d.ts +0 -191
  213. package/VirtualList/VirtualList.d.ts +0 -530
  214. package/index.d.ts +0 -0
  215. package/internal/IdProvider/IdProvider.d.ts +0 -0
  216. package/internal/Pure/Pure.d.ts +0 -0
  217. package/internal/localized-fonts/localized-fonts.d.ts +0 -53
  218. package/internal/selection/selection.d.ts +0 -0
  219. package/internal/validators/validators.d.ts +0 -0
  220. package/resolution/index.d.ts +0 -187
  221. package/useControlledState/useControlledState.d.ts +0 -0
  222. package/useScroll/useScroll.d.ts +0 -0
@@ -10,63 +10,36 @@ Object.defineProperty(exports, "ScrollThumb", {
10
10
  }
11
11
  });
12
12
  exports["default"] = exports.ScrollbarBase = exports.Scrollbar = void 0;
13
-
14
13
  var _classnames = _interopRequireDefault(require("classnames"));
15
-
16
14
  var _util = require("@enact/core/util");
17
-
18
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
16
  var _react = require("react");
21
-
22
17
  var _reactDom = _interopRequireDefault(require("react-dom"));
23
-
24
18
  var _resolution = _interopRequireDefault(require("../resolution"));
25
-
26
19
  var _ScrollThumb = _interopRequireDefault(require("./ScrollThumb"));
27
-
28
20
  var _ScrollbarModule = _interopRequireDefault(require("./Scrollbar.module.css"));
29
-
30
21
  var _jsxRuntime = require("react/jsx-runtime");
31
-
32
22
  var _excluded = ["childRenderer", "className", "corner", "css", "vertical"];
33
-
34
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
-
36
24
  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; }
37
-
38
25
  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; }
39
-
40
26
  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; }
41
-
42
27
  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; }
43
-
44
28
  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; }
45
-
46
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
47
-
48
30
  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); } }
49
-
50
31
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
51
-
52
32
  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); }
53
-
54
33
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
55
-
56
34
  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); }; }
57
-
58
35
  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); }
59
-
60
36
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
61
-
62
37
  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; } }
63
-
64
38
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
65
-
66
39
  var minThumbSize = 18,
67
- // Size in pixels
68
- nop = function nop() {},
69
- thumbHidingDelay = 400; // in milliseconds
40
+ // Size in pixels
41
+ nop = function nop() {},
42
+ thumbHidingDelay = 400; // in milliseconds
70
43
 
71
44
  /*
72
45
  * Set CSS Varaible value.
@@ -76,94 +49,72 @@ nop = function nop() {},
76
49
  * @param {String} variable - CSS Variable property.
77
50
  * @param {String} value - CSS Variable value.
78
51
  */
79
-
80
-
81
52
  var setCSSVariable = function setCSSVariable(element, variable, value) {
82
53
  _reactDom["default"].findDOMNode(element).style.setProperty(variable, value); // eslint-disable-line react/no-find-dom-node
83
-
84
54
  };
55
+
85
56
  /**
86
- * An unstyled base component for a scroll bar. It is used in [Scrollable]{@link ui/Scrollable.Scrollable}.
57
+ * An unstyled base component for a scroll bar. It is used in {@link ui/Scrollable.Scrollable|Scrollable}.
87
58
  *
88
59
  * @class ScrollbarBase
89
60
  * @memberof ui/Scrollable
90
61
  * @ui
91
62
  * @private
92
63
  */
93
-
94
-
95
64
  var ScrollbarBase = /*#__PURE__*/function (_PureComponent) {
96
65
  _inherits(ScrollbarBase, _PureComponent);
97
-
98
66
  var _super = _createSuper(ScrollbarBase);
99
-
100
67
  function ScrollbarBase(props) {
101
68
  var _this;
102
-
103
69
  _classCallCheck(this, ScrollbarBase);
104
-
105
70
  _this = _super.call(this, props);
106
71
  _this.minThumbSizeRatio = 0;
107
72
  _this.ignoreMode = false;
108
-
109
73
  _this.update = function (bounds) {
110
74
  var vertical = _this.props.vertical,
111
- clientWidth = bounds.clientWidth,
112
- clientHeight = bounds.clientHeight,
113
- scrollWidth = bounds.scrollWidth,
114
- scrollHeight = bounds.scrollHeight,
115
- scrollLeft = bounds.scrollLeft,
116
- scrollTop = bounds.scrollTop,
117
- clientSize = vertical ? clientHeight : clientWidth,
118
- scrollSize = vertical ? scrollHeight : scrollWidth,
119
- scrollOrigin = vertical ? scrollTop : scrollLeft,
120
- thumbSizeRatioBase = clientSize / scrollSize,
121
- scrollThumbPositionRatio = scrollOrigin / (scrollSize - clientSize),
122
- scrollThumbSizeRatio = Math.max(_this.minThumbSizeRatio, Math.min(1, thumbSizeRatioBase));
75
+ clientWidth = bounds.clientWidth,
76
+ clientHeight = bounds.clientHeight,
77
+ scrollWidth = bounds.scrollWidth,
78
+ scrollHeight = bounds.scrollHeight,
79
+ scrollLeft = bounds.scrollLeft,
80
+ scrollTop = bounds.scrollTop,
81
+ clientSize = vertical ? clientHeight : clientWidth,
82
+ scrollSize = vertical ? scrollHeight : scrollWidth,
83
+ scrollOrigin = vertical ? scrollTop : scrollLeft,
84
+ thumbSizeRatioBase = clientSize / scrollSize,
85
+ scrollThumbPositionRatio = scrollOrigin / (scrollSize - clientSize),
86
+ scrollThumbSizeRatio = Math.max(_this.minThumbSizeRatio, Math.min(1, thumbSizeRatioBase));
123
87
  setCSSVariable(_this.thumbRef.current, '--scrollbar-size-ratio', scrollThumbSizeRatio);
124
88
  setCSSVariable(_this.thumbRef.current, '--scrollbar-progress-ratio', scrollThumbPositionRatio);
125
89
  };
126
-
127
90
  _this.showThumb = function () {
128
91
  _this.hideThumbJob.stop();
129
-
130
92
  _reactDom["default"].findDOMNode(_this.thumbRef.current).classList.add(_this.props.css.thumbShown); // eslint-disable-line react/no-find-dom-node
131
-
132
93
  };
133
-
134
94
  _this.startHidingThumb = function () {
135
95
  _this.hideThumbJob.start();
136
96
  };
137
-
138
97
  _this.hideThumb = function () {
139
98
  _reactDom["default"].findDOMNode(_this.thumbRef.current).classList.remove(_this.props.css.thumbShown); // eslint-disable-line react/no-find-dom-node
140
-
141
99
  };
142
-
143
100
  _this.hideThumbJob = new _util.Job(_this.hideThumb.bind(_assertThisInitialized(_this)), thumbHidingDelay);
144
-
145
101
  _this.calculateMetrics = function () {
146
102
  var primaryDimenstion = _this.props.vertical ? 'clientHeight' : 'clientWidth';
147
103
  var trackSize;
148
-
149
104
  if (_this.props.clientSize) {
150
105
  trackSize = _this.props.clientSize[primaryDimenstion];
151
106
  } else {
152
107
  trackSize = _this.containerRef.current[primaryDimenstion];
153
108
  }
154
-
155
109
  _this.minThumbSizeRatio = _resolution["default"].scale(minThumbSize) / trackSize;
156
110
  };
157
-
158
111
  _this.getContainerRef = function () {
159
112
  return _this.containerRef;
160
113
  };
161
-
162
114
  _this.containerRef = /*#__PURE__*/(0, _react.createRef)();
163
115
  _this.thumbRef = /*#__PURE__*/(0, _react.createRef)();
164
116
  return _this;
165
117
  }
166
-
167
118
  _createClass(ScrollbarBase, [{
168
119
  key: "componentDidMount",
169
120
  value: function componentDidMount() {
@@ -183,14 +134,13 @@ var ScrollbarBase = /*#__PURE__*/function (_PureComponent) {
183
134
  key: "render",
184
135
  value: function render() {
185
136
  var _this$props = this.props,
186
- childRenderer = _this$props.childRenderer,
187
- className = _this$props.className,
188
- corner = _this$props.corner,
189
- css = _this$props.css,
190
- vertical = _this$props.vertical,
191
- rest = _objectWithoutProperties(_this$props, _excluded),
192
- containerClassName = (0, _classnames["default"])(className, css.scrollbar, corner ? css.corner : null, vertical ? css.vertical : css.horizontal);
193
-
137
+ childRenderer = _this$props.childRenderer,
138
+ className = _this$props.className,
139
+ corner = _this$props.corner,
140
+ css = _this$props.css,
141
+ vertical = _this$props.vertical,
142
+ rest = _objectWithoutProperties(_this$props, _excluded),
143
+ containerClassName = (0, _classnames["default"])(className, css.scrollbar, corner ? css.corner : null, vertical ? css.vertical : css.horizontal);
194
144
  delete rest.clientSize;
195
145
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
196
146
  className: containerClassName,
@@ -202,24 +152,19 @@ var ScrollbarBase = /*#__PURE__*/function (_PureComponent) {
202
152
  }));
203
153
  }
204
154
  }]);
205
-
206
155
  return ScrollbarBase;
207
156
  }(_react.PureComponent);
208
157
  /**
209
- * An unstyled scroll bar. It is used in [Scrollable]{@link ui/Scrollable.Scrollable}.
158
+ * An unstyled scroll bar. It is used in {@link ui/Scrollable.Scrollable|Scrollable}.
210
159
  *
211
160
  * @class Scrollbar
212
161
  * @memberof ui/Scrollable
213
162
  * @ui
214
163
  * @private
215
164
  */
216
-
217
-
218
165
  exports.ScrollbarBase = ScrollbarBase;
219
166
  ScrollbarBase.displayName = 'ui:Scrollbar';
220
- ScrollbarBase.propTypes =
221
- /** @lends ui/Scrollable.Scrollbar.prototype */
222
- {
167
+ ScrollbarBase.propTypes = /** @lends ui/Scrollable.Scrollbar.prototype */{
223
168
  /**
224
169
  * The render function for child.
225
170
  *
@@ -228,7 +173,6 @@ ScrollbarBase.propTypes =
228
173
  * @private
229
174
  */
230
175
  childRenderer: _propTypes["default"].func.isRequired,
231
-
232
176
  /**
233
177
  * Client size of the container; valid values are an object that has `clientWidth` and `clientHeight`.
234
178
  *
@@ -241,7 +185,6 @@ ScrollbarBase.propTypes =
241
185
  clientHeight: _propTypes["default"].number.isRequired,
242
186
  clientWidth: _propTypes["default"].number.isRequired
243
187
  }),
244
-
245
188
  /**
246
189
  * If `true`, add the corner between vertical and horizontal scrollbars.
247
190
  *
@@ -250,7 +193,6 @@ ScrollbarBase.propTypes =
250
193
  * @public
251
194
  */
252
195
  corner: _propTypes["default"].bool,
253
-
254
196
  /**
255
197
  * Customizes the component by mapping the supplied collection of CSS class names to the
256
198
  * corresponding internal Elements and states of this component.
@@ -263,7 +205,6 @@ ScrollbarBase.propTypes =
263
205
  * @public
264
206
  */
265
207
  css: _propTypes["default"].object,
266
-
267
208
  /**
268
209
  * If `true`, the scrollbar will be oriented vertically.
269
210
  *
@@ -280,39 +221,30 @@ ScrollbarBase.defaultProps = {
280
221
  css: _ScrollbarModule["default"],
281
222
  vertical: true
282
223
  };
283
-
284
224
  var Scrollbar = /*#__PURE__*/function (_Component) {
285
225
  _inherits(Scrollbar, _Component);
286
-
287
226
  var _super2 = _createSuper(Scrollbar);
288
-
289
227
  function Scrollbar() {
290
228
  var _this2;
291
-
292
229
  _classCallCheck(this, Scrollbar);
293
-
294
230
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
295
231
  args[_key] = arguments[_key];
296
232
  }
297
-
298
233
  _this2 = _super2.call.apply(_super2, [this].concat(args));
299
-
300
234
  _this2.setApi = function (ref) {
301
235
  if (ref) {
302
236
  var getContainerRef = ref.getContainerRef,
303
- showThumb = ref.showThumb,
304
- startHidingThumb = ref.startHidingThumb,
305
- uiUpdate = ref.update;
237
+ showThumb = ref.showThumb,
238
+ startHidingThumb = ref.startHidingThumb,
239
+ uiUpdate = ref.update;
306
240
  _this2.getContainerRef = getContainerRef;
307
241
  _this2.showThumb = showThumb;
308
242
  _this2.startHidingThumb = startHidingThumb;
309
243
  _this2.update = uiUpdate;
310
244
  }
311
245
  };
312
-
313
246
  return _this2;
314
247
  }
315
-
316
248
  _createClass(Scrollbar, [{
317
249
  key: "render",
318
250
  value: function render() {
@@ -330,14 +262,10 @@ var Scrollbar = /*#__PURE__*/function (_Component) {
330
262
  }));
331
263
  }
332
264
  }]);
333
-
334
265
  return Scrollbar;
335
266
  }(_react.Component);
336
-
337
267
  exports.Scrollbar = Scrollbar;
338
- Scrollbar.propTypes =
339
- /** @lends ui/Scrollable.Scrollbar.prototype */
340
- {
268
+ Scrollbar.propTypes = /** @lends ui/Scrollable.Scrollbar.prototype */{
341
269
  /**
342
270
  * If `true`, the scrollbar will be oriented vertically.
343
271
  *
@@ -17,30 +17,19 @@ Object.defineProperty(exports, "ScrollerBasic", {
17
17
  }
18
18
  });
19
19
  exports["default"] = void 0;
20
-
21
20
  var _propTypes = _interopRequireDefault(require("prop-types"));
22
-
23
21
  var _Resizable = require("../Resizable");
24
-
25
22
  var _useScroll2 = _interopRequireDefault(require("../useScroll"));
26
-
27
23
  var _Scrollbar = _interopRequireDefault(require("../useScroll/Scrollbar"));
28
-
29
24
  var _ScrollerBasic = _interopRequireDefault(require("./ScrollerBasic"));
30
-
31
25
  var _UiScrollerBase = _interopRequireDefault(require("./UiScrollerBase"));
32
-
33
26
  var _jsxRuntime = require("react/jsx-runtime");
34
-
35
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
36
-
37
28
  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; }
38
-
39
29
  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; }
40
-
41
30
  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; }
42
-
43
31
  var nop = function nop() {};
32
+
44
33
  /**
45
34
  * An unstyled scroller.
46
35
  *
@@ -55,23 +44,23 @@ var nop = function nop() {};
55
44
  * @ui
56
45
  * @public
57
46
  */
58
-
59
-
60
47
  var Scroller = function Scroller(props) {
61
48
  // Hooks
49
+
62
50
  var _useScroll = (0, _useScroll2["default"])(props),
63
- scrollContentHandle = _useScroll.scrollContentHandle,
64
- ScrollContentWrapper = _useScroll.scrollContentWrapper,
65
- isHorizontalScrollbarVisible = _useScroll.isHorizontalScrollbarVisible,
66
- isVerticalScrollbarVisible = _useScroll.isVerticalScrollbarVisible,
67
- resizeContextProps = _useScroll.resizeContextProps,
68
- scrollContainerProps = _useScroll.scrollContainerProps,
69
- scrollInnerContainerProps = _useScroll.scrollInnerContainerProps,
70
- scrollContentWrapperProps = _useScroll.scrollContentWrapperProps,
71
- scrollContentProps = _useScroll.scrollContentProps,
72
- verticalScrollbarProps = _useScroll.verticalScrollbarProps,
73
- horizontalScrollbarProps = _useScroll.horizontalScrollbarProps; // Return
51
+ scrollContentHandle = _useScroll.scrollContentHandle,
52
+ ScrollContentWrapper = _useScroll.scrollContentWrapper,
53
+ isHorizontalScrollbarVisible = _useScroll.isHorizontalScrollbarVisible,
54
+ isVerticalScrollbarVisible = _useScroll.isVerticalScrollbarVisible,
55
+ resizeContextProps = _useScroll.resizeContextProps,
56
+ scrollContainerProps = _useScroll.scrollContainerProps,
57
+ scrollInnerContainerProps = _useScroll.scrollInnerContainerProps,
58
+ scrollContentWrapperProps = _useScroll.scrollContentWrapperProps,
59
+ scrollContentProps = _useScroll.scrollContentProps,
60
+ verticalScrollbarProps = _useScroll.verticalScrollbarProps,
61
+ horizontalScrollbarProps = _useScroll.horizontalScrollbarProps;
74
62
 
63
+ // Return
75
64
 
76
65
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext.Provider, _objectSpread(_objectSpread({}, resizeContextProps), {}, {
77
66
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollContainerProps), {}, {
@@ -85,12 +74,9 @@ var Scroller = function Scroller(props) {
85
74
  }))
86
75
  }));
87
76
  };
88
-
89
77
  exports.Scroller = Scroller;
90
78
  Scroller.displayName = 'ui:Scroller';
91
- Scroller.propTypes =
92
- /** @lends ui/Scroller.Scroller.prototype */
93
- {
79
+ Scroller.propTypes = /** @lends ui/Scroller.Scroller.prototype */{
94
80
  /**
95
81
  * A callback function that receives a reference to the `scrollTo` feature.
96
82
  *
@@ -119,7 +105,6 @@ Scroller.propTypes =
119
105
  * @public
120
106
  */
121
107
  cbScrollTo: _propTypes["default"].func,
122
-
123
108
  /**
124
109
  * Direction of the scroller.
125
110
  *
@@ -133,7 +118,6 @@ Scroller.propTypes =
133
118
  * @public
134
119
  */
135
120
  direction: _propTypes["default"].string,
136
-
137
121
  /**
138
122
  * Specifies how to show horizontal scrollbar.
139
123
  *
@@ -147,7 +131,6 @@ Scroller.propTypes =
147
131
  * @public
148
132
  */
149
133
  horizontalScrollbar: _propTypes["default"].oneOf(['auto', 'visible', 'hidden']),
150
-
151
134
  /**
152
135
  * Prevents scroll by dragging or flicking on the scroller.
153
136
  *
@@ -156,7 +139,6 @@ Scroller.propTypes =
156
139
  * @private
157
140
  */
158
141
  noScrollByDrag: _propTypes["default"].bool,
159
-
160
142
  /**
161
143
  * Prevents scroll by wheeling on the scroller.
162
144
  *
@@ -165,7 +147,6 @@ Scroller.propTypes =
165
147
  * @public
166
148
  */
167
149
  noScrollByWheel: _propTypes["default"].bool,
168
-
169
150
  /**
170
151
  * Called when scrolling.
171
152
  *
@@ -180,7 +161,6 @@ Scroller.propTypes =
180
161
  * @public
181
162
  */
182
163
  onScroll: _propTypes["default"].func,
183
-
184
164
  /**
185
165
  * Called when scroll starts.
186
166
  *
@@ -208,7 +188,6 @@ Scroller.propTypes =
208
188
  * @public
209
189
  */
210
190
  onScrollStart: _propTypes["default"].func,
211
-
212
191
  /**
213
192
  * Called when scroll stops.
214
193
  *
@@ -236,7 +215,6 @@ Scroller.propTypes =
236
215
  * @public
237
216
  */
238
217
  onScrollStop: _propTypes["default"].func,
239
-
240
218
  /**
241
219
  * Specifies overscroll effects shows on which type of inputs.
242
220
  *
@@ -249,7 +227,6 @@ Scroller.propTypes =
249
227
  pageKey: _propTypes["default"].bool,
250
228
  wheel: _propTypes["default"].bool
251
229
  }),
252
-
253
230
  /**
254
231
  * Specifies how to scroll.
255
232
  *
@@ -262,7 +239,6 @@ Scroller.propTypes =
262
239
  * @public
263
240
  */
264
241
  scrollMode: _propTypes["default"].string,
265
-
266
242
  /**
267
243
  * Specifies how to show vertical scrollbar.
268
244
  *