@splunk/react-ui 4.21.0 → 4.21.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 (83) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +7 -2
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1808 -2084
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -519
  20. package/Color.js +1066 -1069
  21. package/ColumnLayout.js +402 -363
  22. package/ComboBox.js +891 -794
  23. package/Concertina.js +997 -802
  24. package/ControlGroup.js +687 -594
  25. package/Date.js +567 -547
  26. package/DefinitionList.js +308 -234
  27. package/Divider.js +149 -118
  28. package/Dropdown.js +459 -416
  29. package/DualListbox.js +1479 -1541
  30. package/EventListener.js +94 -97
  31. package/File.js +1051 -969
  32. package/FormRows.js +883 -696
  33. package/Heading.js +216 -193
  34. package/Image.js +446 -402
  35. package/JSONTree.js +690 -551
  36. package/Layer.js +437 -410
  37. package/Link.js +336 -255
  38. package/List.js +213 -161
  39. package/Markdown.js +509 -487
  40. package/Menu.js +1105 -1056
  41. package/Message.js +475 -441
  42. package/MessageBar.js +387 -373
  43. package/Modal.js +810 -634
  44. package/ModalLayer.js +326 -243
  45. package/Monogram.js +308 -276
  46. package/Multiselect.js +3550 -3364
  47. package/Number.js +729 -687
  48. package/Paginator.js +510 -449
  49. package/Paragraph.js +145 -112
  50. package/Popover.js +1459 -1432
  51. package/Progress.js +301 -246
  52. package/RadioBar.js +610 -527
  53. package/RadioList.js +483 -444
  54. package/Resize.js +530 -489
  55. package/ResultsMenu.js +494 -455
  56. package/ScreenReaderContent.js +142 -111
  57. package/Scroll.js +595 -456
  58. package/ScrollContainerContext.js +197 -206
  59. package/Search.js +744 -650
  60. package/Select.js +2442 -2345
  61. package/SidePanel.js +390 -284
  62. package/Slider.js +669 -676
  63. package/SlidingPanels.js +639 -503
  64. package/SplitButton.js +464 -367
  65. package/StaticContent.js +161 -133
  66. package/StepBar.js +386 -358
  67. package/Switch.js +710 -640
  68. package/TabBar.js +726 -680
  69. package/TabLayout.js +406 -322
  70. package/Table.js +4842 -4616
  71. package/Text.js +1170 -1138
  72. package/TextArea.js +1102 -1090
  73. package/Tooltip.js +624 -581
  74. package/TransitionOpen.js +489 -422
  75. package/Typography.js +176 -153
  76. package/WaitSpinner.js +230 -206
  77. package/package.json +5 -5
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/useForceUpdate.js +112 -82
  81. package/useKeyPress.js +74 -71
  82. package/usePrevious.js +65 -65
  83. package/useRovingFocus.js +122 -138
package/Scroll.js CHANGED
@@ -1,475 +1,614 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- "default": () => (/* reexport */ Scroll_Scroll)
55
- });
56
-
57
- ;// CONCATENATED MODULE: external "react"
58
- const external_react_namespaceObject = require("react");
59
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
60
- ;// CONCATENATED MODULE: external "prop-types"
61
- const external_prop_types_namespaceObject = require("prop-types");
62
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
63
- ;// CONCATENATED MODULE: external "lodash/isFinite"
64
- const isFinite_namespaceObject = require("lodash/isFinite");
65
- var isFinite_default = /*#__PURE__*/__webpack_require__.n(isFinite_namespaceObject);
66
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
67
- const Animation_namespaceObject = require("@splunk/react-ui/Animation");
68
- ;// CONCATENATED MODULE: external "styled-components"
69
- const external_styled_components_namespaceObject = require("styled-components");
70
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
71
- ;// CONCATENATED MODULE: external "@splunk/themes"
72
- const themes_namespaceObject = require("@splunk/themes");
73
- ;// CONCATENATED MODULE: external "lodash/keys"
74
- const keys_namespaceObject = require("lodash/keys");
75
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_namespaceObject);
76
- ;// CONCATENATED MODULE: external "lodash/omit"
77
- const omit_namespaceObject = require("lodash/omit");
78
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
79
- ;// CONCATENATED MODULE: external "react-spring"
80
- const external_react_spring_namespaceObject = require("react-spring");
81
- ;// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
82
- const EventListener_namespaceObject = require("@splunk/react-ui/EventListener");
83
- var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_namespaceObject);
84
- ;// CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
85
- const ScrollContainerContext_namespaceObject = require("@splunk/react-ui/ScrollContainerContext");
86
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
87
- /**
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var r = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(r, {
17
+ a: r
18
+ });
19
+ /******/ return r;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, r) => {
27
+ /******/ for (var n in r) {
28
+ /******/ if (e.o(r, n) && !e.o(t, n)) {
29
+ /******/ Object.defineProperty(t, n, {
30
+ enumerable: true,
31
+ get: r[n]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ default: () => /* reexport */ ne
65
+ });
66
+ // CONCATENATED MODULE: external "react"
67
+ const r = require("react");
68
+ var n = e.n(r);
69
+ // CONCATENATED MODULE: external "prop-types"
70
+ const o = require("prop-types");
71
+ var l = e.n(o);
72
+ // CONCATENATED MODULE: external "lodash/isFinite"
73
+ const i = require("lodash/isFinite");
74
+ var u = e.n(i);
75
+ // CONCATENATED MODULE: external "@splunk/react-ui/Animation"
76
+ const f = require("@splunk/react-ui/Animation");
77
+ // CONCATENATED MODULE: external "styled-components"
78
+ const c = require("styled-components");
79
+ var a = e.n(c);
80
+ // CONCATENATED MODULE: external "@splunk/themes"
81
+ const s = require("@splunk/themes");
82
+ // CONCATENATED MODULE: external "lodash/keys"
83
+ const p = require("lodash/keys");
84
+ var d = e.n(p);
85
+ // CONCATENATED MODULE: external "lodash/omit"
86
+ const y = require("lodash/omit");
87
+ var v = e.n(y);
88
+ // CONCATENATED MODULE: external "react-spring"
89
+ const h = require("react-spring");
90
+ // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
91
+ const b = require("@splunk/react-ui/EventListener");
92
+ var m = e.n(b);
93
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
94
+ const g = require("@splunk/react-ui/ScrollContainerContext");
95
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
96
+ /**
88
97
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
89
98
  *
90
99
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
91
100
  * @param current - The new value of the ref.
92
101
  */
93
- function updateReactRef(ref, current) {
94
- if (ref) {
95
- if (typeof ref === 'function') {
96
- ref(current);
97
- } else {
98
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
99
- // the intention here is to signal "we will take care of setting 'current', not you".
100
- ref.current = current; // eslint-disable-line no-param-reassign
102
+ function w(e, t) {
103
+ if (e) {
104
+ if (typeof e === "function") {
105
+ e(t);
106
+ } else {
107
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
108
+ // the intention here is to signal "we will take care of setting 'current', not you".
109
+ e.current = t;
110
+ // eslint-disable-line no-param-reassign
111
+ }
112
+ }
101
113
  }
102
- }
103
- }
104
-
105
-
106
- ;// CONCATENATED MODULE: ./src/Scroll/Inner.tsx
107
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
108
-
109
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
110
-
111
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
112
-
113
- 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); } }
114
-
115
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
116
-
117
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
118
-
119
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
120
-
121
- 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); }; }
122
-
123
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
124
-
125
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
126
-
127
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
128
-
129
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
130
-
131
- 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; }
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- var propTypes = {
143
- children: (external_prop_types_default()).node,
144
- defaultLeft: (external_prop_types_default()).number,
145
- defaultTop: (external_prop_types_default()).number,
146
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
147
- left: (external_prop_types_default()).object,
148
- onScroll: (external_prop_types_default()).func,
149
- stopScrollPropagation: external_prop_types_default().oneOf([true, false, 'window']),
150
- tagName: (external_prop_types_default()).string,
151
- top: (external_prop_types_default()).object
152
- };
153
- var defaultProps = {
154
- defaultLeft: 0,
155
- defaultTop: 0,
156
- tagName: 'div'
157
- };
158
-
159
- var Inner = /*#__PURE__*/function (_Component) {
160
- _inherits(Inner, _Component);
161
-
162
- var _super = _createSuper(Inner);
163
-
164
- function Inner(props) {
165
- var _this;
166
-
167
- _classCallCheck(this, Inner);
168
-
169
- _this = _super.call(this, props);
170
-
171
- _defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowX", 'visible');
172
-
173
- _defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowY", 'visible');
174
-
175
- _defineProperty(_assertThisInitialized(_this), "handleWheel", function (e) {
176
- var el = _this.state.containerEl;
177
-
178
- if (!el) {
179
- return;
180
- } // if the element is scrollable in both directions, it's not safe to stop propagation.
181
-
182
-
183
- if (el.clientWidth !== el.scrollWidth && el.clientHeight !== el.scrollHeight) {
184
- return;
185
- }
186
-
187
- if (el.clientWidth !== el.scrollWidth) {
188
- if (e.deltaX < 0 && el.scrollLeft < Math.abs(e.deltaX)) {
189
- el.scrollLeft = 0;
190
- e.stopPropagation();
191
- e.preventDefault();
192
- return;
114
+ // CONCATENATED MODULE: ./src/Scroll/Inner.tsx
115
+ function O(e) {
116
+ "@babel/helpers - typeof";
117
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
118
+ O = function e(t) {
119
+ return typeof t;
120
+ };
121
+ } else {
122
+ O = function e(t) {
123
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
124
+ };
193
125
  }
194
-
195
- var maxLeft = el.scrollWidth - el.clientWidth;
196
-
197
- if (e.deltaX && e.deltaX + el.scrollLeft > maxLeft) {
198
- el.scrollLeft = maxLeft;
199
- e.stopPropagation();
200
- e.preventDefault();
126
+ return O(e);
127
+ }
128
+ function S() {
129
+ S = Object.assign || function(e) {
130
+ for (var t = 1; t < arguments.length; t++) {
131
+ var r = arguments[t];
132
+ for (var n in r) {
133
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
134
+ e[n] = r[n];
135
+ }
136
+ }
137
+ }
138
+ return e;
139
+ };
140
+ return S.apply(this, arguments);
141
+ }
142
+ function P(e, t) {
143
+ if (!(e instanceof t)) {
144
+ throw new TypeError("Cannot call a class as a function");
201
145
  }
202
- }
203
-
204
- if (el.clientHeight !== el.scrollHeight) {
205
- if (e.deltaY < 0 && el.scrollTop < Math.abs(e.deltaY)) {
206
- el.scrollTop = 0;
207
- e.stopPropagation();
208
- e.preventDefault();
209
- return;
146
+ }
147
+ function j(e, t) {
148
+ for (var r = 0; r < t.length; r++) {
149
+ var n = t[r];
150
+ n.enumerable = n.enumerable || false;
151
+ n.configurable = true;
152
+ if ("value" in n) n.writable = true;
153
+ Object.defineProperty(e, n.key, n);
210
154
  }
211
-
212
- var maxTop = el.scrollHeight - el.clientHeight;
213
-
214
- if (e.deltaY && e.deltaY + el.scrollTop > maxTop) {
215
- el.scrollTop = maxTop;
216
- e.stopPropagation();
217
- e.preventDefault();
155
+ }
156
+ function T(e, t, r) {
157
+ if (t) j(e.prototype, t);
158
+ if (r) j(e, r);
159
+ return e;
160
+ }
161
+ function E(e, t) {
162
+ if (typeof t !== "function" && t !== null) {
163
+ throw new TypeError("Super expression must either be null or a function");
218
164
  }
219
- }
220
- });
221
-
222
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
223
- _this.setState({
224
- containerEl: el
225
- });
226
-
227
- updateReactRef(_this.props.elementRef, el);
228
- });
229
-
230
- _defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function () {
231
- _this.defaultWindowOverflowX = document.body.style.overflowX;
232
- _this.defaultWindowOverflowY = document.body.style.overflowY;
233
- document.body.style.overflowX = 'hidden';
234
- document.body.style.overflowY = 'hidden';
235
- });
236
-
237
- _defineProperty(_assertThisInitialized(_this), "handleMouseLeave", function () {
238
- document.body.style.overflowX = _this.defaultWindowOverflowX;
239
- document.body.style.overflowY = _this.defaultWindowOverflowY;
240
- });
241
-
242
- _this.state = {
243
- containerEl: null
244
- };
245
- return _this;
246
- }
247
-
248
- _createClass(Inner, [{
249
- key: "componentDidUpdate",
250
- value: function componentDidUpdate(prevProps, prevState) {
251
- if (this.state.containerEl) {
252
- if (!prevState.containerEl) {
253
- this.state.containerEl.scrollTop = this.props.defaultTop;
254
- this.state.containerEl.scrollLeft = this.props.defaultLeft;
165
+ e.prototype = Object.create(t && t.prototype, {
166
+ constructor: {
167
+ value: e,
168
+ writable: true,
169
+ configurable: true
170
+ }
171
+ });
172
+ if (t) _(e, t);
173
+ }
174
+ function _(e, t) {
175
+ _ = Object.setPrototypeOf || function e(t, r) {
176
+ t.__proto__ = r;
177
+ return t;
178
+ };
179
+ return _(e, t);
180
+ }
181
+ function R(e) {
182
+ var t = k();
183
+ return function r() {
184
+ var n = M(e), o;
185
+ if (t) {
186
+ var l = M(this).constructor;
187
+ o = Reflect.construct(n, arguments, l);
188
+ } else {
189
+ o = n.apply(this, arguments);
190
+ }
191
+ return L(this, o);
192
+ };
193
+ }
194
+ function L(e, t) {
195
+ if (t && (O(t) === "object" || typeof t === "function")) {
196
+ return t;
255
197
  }
256
-
257
- if (isFinite_default()(this.props.top)) {
258
- var _this$props$top;
259
-
260
- this.state.containerEl.scrollTop = ((_this$props$top = this.props.top) === null || _this$props$top === void 0 ? void 0 : _this$props$top.get()) || 0;
198
+ return W(e);
199
+ }
200
+ function W(e) {
201
+ if (e === void 0) {
202
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
261
203
  }
262
-
263
- if (isFinite_default()(this.props.left)) {
264
- var _this$props$left;
265
-
266
- this.state.containerEl.scrollLeft = ((_this$props$left = this.props.left) === null || _this$props$left === void 0 ? void 0 : _this$props$left.get()) || 0;
204
+ return e;
205
+ }
206
+ function k() {
207
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
208
+ if (Reflect.construct.sham) return false;
209
+ if (typeof Proxy === "function") return true;
210
+ try {
211
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
212
+ return true;
213
+ } catch (e) {
214
+ return false;
267
215
  }
268
- }
269
216
  }
270
- }, {
271
- key: "render",
272
- value: function render() {
273
- var _this$props = this.props,
274
- children = _this$props.children,
275
- onScroll = _this$props.onScroll,
276
- stopScrollPropagation = _this$props.stopScrollPropagation,
277
- top = _this$props.top,
278
- left = _this$props.left;
279
- var containerEl = this.state.containerEl;
280
- var AnimatedTag = external_react_spring_namespaceObject.animated[this.props.tagName];
281
- return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement(AnimatedTag, _extends({}, omit_default()(this.props, keys_default()(Inner.propTypes)), {
282
- ref: this.handleMount,
283
- onMouseEnter: stopScrollPropagation === 'window' ? this.handleMouseEnter : undefined,
284
- onMouseLeave: stopScrollPropagation === 'window' ? this.handleMouseLeave : undefined,
285
- onScroll: onScroll,
286
- scrollTop: top,
287
- scrollLeft: left
288
- }), /*#__PURE__*/external_react_default().createElement(ScrollContainerContext_namespaceObject.ScrollContainerProvider, {
289
- value: containerEl
290
- }, children)), stopScrollPropagation === true && containerEl && /*#__PURE__*/external_react_default().createElement((EventListener_default()), {
291
- target: containerEl,
292
- eventType: "wheel",
293
- listener: this.handleWheel,
294
- options: {
295
- passive: false
217
+ function M(e) {
218
+ M = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
219
+ return t.__proto__ || Object.getPrototypeOf(t);
220
+ };
221
+ return M(e);
222
+ }
223
+ function C(e, t, r) {
224
+ if (t in e) {
225
+ Object.defineProperty(e, t, {
226
+ value: r,
227
+ enumerable: true,
228
+ configurable: true,
229
+ writable: true
230
+ });
231
+ } else {
232
+ e[t] = r;
296
233
  }
297
- }));
234
+ return e;
298
235
  }
299
- }]);
300
-
301
- return Inner;
302
- }(external_react_namespaceObject.Component);
303
-
304
- _defineProperty(Inner, "propTypes", propTypes);
305
-
306
- _defineProperty(Inner, "defaultProps", defaultProps);
307
-
308
- /* harmony default export */ const Scroll_Inner = (Inner);
309
- ;// CONCATENATED MODULE: ./src/Scroll/ScrollStyles.ts
310
-
311
-
312
-
313
- var StyledInner = external_styled_components_default()(Scroll_Inner).withConfig({
314
- displayName: "ScrollStyles__StyledInner",
315
- componentId: "sc-1xspttf-0"
316
- })(["", ";overflow:auto;overflow-y:auto;overflow-x:hidden;"], themes_namespaceObject.mixins.reset('block'));
317
-
318
- ;// CONCATENATED MODULE: ./src/Scroll/Scroll.tsx
319
- function Scroll_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Scroll_typeof = function _typeof(obj) { return typeof obj; }; } else { Scroll_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Scroll_typeof(obj); }
320
-
321
- function Scroll_extends() { Scroll_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Scroll_extends.apply(this, arguments); }
322
-
323
- 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; }
324
-
325
- 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; }
326
-
327
- function Scroll_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
328
-
329
- function Scroll_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); } }
330
-
331
- function Scroll_createClass(Constructor, protoProps, staticProps) { if (protoProps) Scroll_defineProperties(Constructor.prototype, protoProps); if (staticProps) Scroll_defineProperties(Constructor, staticProps); return Constructor; }
332
-
333
- function Scroll_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 } }); if (superClass) Scroll_setPrototypeOf(subClass, superClass); }
334
-
335
- function Scroll_setPrototypeOf(o, p) { Scroll_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Scroll_setPrototypeOf(o, p); }
336
-
337
- function Scroll_createSuper(Derived) { var hasNativeReflectConstruct = Scroll_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Scroll_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Scroll_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Scroll_possibleConstructorReturn(this, result); }; }
338
-
339
- function Scroll_possibleConstructorReturn(self, call) { if (call && (Scroll_typeof(call) === "object" || typeof call === "function")) { return call; } return Scroll_assertThisInitialized(self); }
340
-
341
- function Scroll_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
342
-
343
- function Scroll_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
344
-
345
- function Scroll_getPrototypeOf(o) { Scroll_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Scroll_getPrototypeOf(o); }
346
-
347
- function Scroll_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; }
348
-
349
-
350
-
351
-
352
-
353
-
354
- var Scroll_propTypes = {
355
- children: (external_prop_types_default()).node,
356
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
357
- left: (external_prop_types_default()).number,
358
- onScroll: (external_prop_types_default()).func,
359
- onScrollComplete: (external_prop_types_default()).func,
360
- stopScrollPropagation: external_prop_types_default().oneOf([true, false, 'window']),
361
- tagName: (external_prop_types_default()).string,
362
- top: (external_prop_types_default()).number
363
- };
364
- var Scroll_defaultProps = {
365
- stopScrollPropagation: false,
366
- tagName: 'div'
367
- };
368
-
369
- var Scroll = /*#__PURE__*/function (_Component) {
370
- Scroll_inherits(Scroll, _Component);
371
-
372
- var _super = Scroll_createSuper(Scroll);
373
-
374
- // @docs-props-type ScrollPropsBase
375
- function Scroll(props) {
376
- var _this;
377
-
378
- Scroll_classCallCheck(this, Scroll);
379
-
380
- _this = _super.call(this, props);
381
-
382
- Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleRest", function () {
383
- var _this$props$onScrollC, _this$props;
384
-
385
- (_this$props$onScrollC = (_this$props = _this.props).onScrollComplete) === null || _this$props$onScrollC === void 0 ? void 0 : _this$props$onScrollC.call(_this$props);
386
- });
387
-
388
- Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleScroll", function (e) {
389
- var _this$props$onScroll, _this$props2;
390
-
391
- _this.setState({
392
- currentLeft: e.currentTarget.scrollLeft,
393
- currentTop: e.currentTarget.scrollTop
394
- });
395
-
396
- (_this$props$onScroll = (_this$props2 = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props2, e);
397
- });
398
-
399
- Scroll_defineProperty(Scroll_assertThisInitialized(_this), "renderInner", function (targetScroll) {
400
- var _this$props3 = _this.props,
401
- children = _this$props3.children,
402
- elementRef = _this$props3.elementRef,
403
- left = _this$props3.left,
404
- top = _this$props3.top,
405
- onScrollComplete = _this$props3.onScrollComplete,
406
- otherProps = _objectWithoutProperties(_this$props3, ["children", "elementRef", "left", "top", "onScrollComplete"]);
407
-
408
- return /*#__PURE__*/external_react_default().createElement(StyledInner, Scroll_extends({
409
- "data-test": "scroll"
410
- }, otherProps, {
411
- key: "inner",
412
- top: isFinite_default()(top) ? targetScroll.top : undefined,
413
- left: isFinite_default()(left) ? targetScroll.left : undefined,
414
- elementRef: elementRef,
415
- onScroll: _this.handleScroll
416
- }), children);
417
- });
418
-
419
- _this.state = {
420
- currentLeft: 0,
421
- currentTop: 0
236
+ var q = {
237
+ children: l().node,
238
+ defaultLeft: l().number,
239
+ defaultTop: l().number,
240
+ elementRef: l().oneOfType([ l().func, l().object ]),
241
+ left: l().object,
242
+ onScroll: l().func,
243
+ stopScrollPropagation: l().oneOf([ true, false, "window" ]),
244
+ tagName: l().string,
245
+ top: l().object
246
+ };
247
+ var x = {
248
+ defaultLeft: 0,
249
+ defaultTop: 0,
250
+ tagName: "div"
422
251
  };
423
- return _this;
424
- }
425
-
426
- Scroll_createClass(Scroll, [{
427
- key: "render",
428
- value: function render() {
429
- var _this$props4 = this.props,
430
- left = _this$props4.left,
431
- top = _this$props4.top;
432
- var _this$state = this.state,
433
- currentLeft = _this$state.currentLeft,
434
- currentTop = _this$state.currentTop;
435
- var targetScroll = {}; // When isFinite, the prop is defined and therefore animating.
436
-
437
- if (isFinite_default()(left)) {
438
- targetScroll.left = left;
439
- } else {
440
- targetScroll.left = currentLeft;
441
- }
442
-
443
- if (isFinite_default()(top)) {
444
- targetScroll.top = top;
445
- } else {
446
- targetScroll.top = currentTop;
447
- }
448
-
449
- return /*#__PURE__*/external_react_default().createElement(Animation_namespaceObject.Spring, {
450
- from: {
451
- left: 0,
452
- top: 0
453
- },
454
- to: targetScroll,
455
- onRest: this.handleRest,
456
- config: {
457
- precision: 10
252
+ var X = function(e) {
253
+ E(r, e);
254
+ var t = R(r);
255
+ function r(e) {
256
+ var n;
257
+ P(this, r);
258
+ n = t.call(this, e);
259
+ C(W(n), "defaultWindowOverflowX", "visible");
260
+ C(W(n), "defaultWindowOverflowY", "visible");
261
+ C(W(n), "handleWheel", (function(e) {
262
+ var t = n.state.containerEl;
263
+ if (!t) {
264
+ return;
265
+ }
266
+ // if the element is scrollable in both directions, it's not safe to stop propagation.
267
+ if (t.clientWidth !== t.scrollWidth && t.clientHeight !== t.scrollHeight) {
268
+ return;
269
+ }
270
+ if (t.clientWidth !== t.scrollWidth) {
271
+ if (e.deltaX < 0 && t.scrollLeft < Math.abs(e.deltaX)) {
272
+ t.scrollLeft = 0;
273
+ e.stopPropagation();
274
+ e.preventDefault();
275
+ return;
276
+ }
277
+ var r = t.scrollWidth - t.clientWidth;
278
+ if (e.deltaX && e.deltaX + t.scrollLeft > r) {
279
+ t.scrollLeft = r;
280
+ e.stopPropagation();
281
+ e.preventDefault();
282
+ }
283
+ }
284
+ if (t.clientHeight !== t.scrollHeight) {
285
+ if (e.deltaY < 0 && t.scrollTop < Math.abs(e.deltaY)) {
286
+ t.scrollTop = 0;
287
+ e.stopPropagation();
288
+ e.preventDefault();
289
+ return;
290
+ }
291
+ var o = t.scrollHeight - t.clientHeight;
292
+ if (e.deltaY && e.deltaY + t.scrollTop > o) {
293
+ t.scrollTop = o;
294
+ e.stopPropagation();
295
+ e.preventDefault();
296
+ }
297
+ }
298
+ }));
299
+ C(W(n), "handleMount", (function(e) {
300
+ n.setState({
301
+ containerEl: e
302
+ });
303
+ w(n.props.elementRef, e);
304
+ }));
305
+ C(W(n), "handleMouseEnter", (function() {
306
+ n.defaultWindowOverflowX = document.body.style.overflowX;
307
+ n.defaultWindowOverflowY = document.body.style.overflowY;
308
+ document.body.style.overflowX = "hidden";
309
+ document.body.style.overflowY = "hidden";
310
+ }));
311
+ C(W(n), "handleMouseLeave", (function() {
312
+ document.body.style.overflowX = n.defaultWindowOverflowX;
313
+ document.body.style.overflowY = n.defaultWindowOverflowY;
314
+ }));
315
+ n.state = {
316
+ containerEl: null
317
+ };
318
+ return n;
458
319
  }
459
- }, this.renderInner);
320
+ T(r, [ {
321
+ key: "componentDidUpdate",
322
+ value: function e(t, r) {
323
+ if (this.state.containerEl) {
324
+ if (!r.containerEl) {
325
+ this.state.containerEl.scrollTop = this.props.defaultTop;
326
+ this.state.containerEl.scrollLeft = this.props.defaultLeft;
327
+ }
328
+ if (u()(this.props.top)) {
329
+ var n;
330
+ this.state.containerEl.scrollTop = ((n = this.props.top) === null || n === void 0 ? void 0 : n.get()) || 0;
331
+ }
332
+ if (u()(this.props.left)) {
333
+ var o;
334
+ this.state.containerEl.scrollLeft = ((o = this.props.left) === null || o === void 0 ? void 0 : o.get()) || 0;
335
+ }
336
+ }
337
+ }
338
+ }, {
339
+ key: "render",
340
+ value: function e() {
341
+ var t = this.props, o = t.children, l = t.onScroll, i = t.stopScrollPropagation, u = t.top, f = t.left;
342
+ var c = this.state.containerEl;
343
+ var a = h.animated[this.props.tagName];
344
+
345
+ return n().createElement(n().Fragment, null, n().createElement(a, S({}, v()(this.props, d()(r.propTypes)), {
346
+ ref: this.handleMount,
347
+ onMouseEnter: i === "window" ? this.handleMouseEnter : undefined,
348
+ onMouseLeave: i === "window" ? this.handleMouseLeave : undefined,
349
+ onScroll: l,
350
+ scrollTop: u,
351
+ scrollLeft: f
352
+ }), n().createElement(g.ScrollContainerProvider, {
353
+ value: c
354
+ }, o)), i === true && c && n().createElement(m(), {
355
+ target: c,
356
+ eventType: "wheel",
357
+ listener: this.handleWheel,
358
+ options: {
359
+ passive: false
360
+ }
361
+ }));
362
+ }
363
+ } ]);
364
+ return r;
365
+ }(r.Component);
366
+ C(X, "propTypes", q);
367
+ C(X, "defaultProps", x);
368
+ /* harmony default export */ const Y = X;
369
+ // CONCATENATED MODULE: ./src/Scroll/ScrollStyles.ts
370
+ var D = a()(Y).withConfig({
371
+ displayName: "ScrollStyles__StyledInner",
372
+ componentId: "sc-1xspttf-0"
373
+ })([ "", ";overflow:auto;overflow-y:auto;overflow-x:hidden;" ], s.mixins.reset("block"));
374
+ // CONCATENATED MODULE: ./src/Scroll/Scroll.tsx
375
+ function H(e) {
376
+ "@babel/helpers - typeof";
377
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
378
+ H = function e(t) {
379
+ return typeof t;
380
+ };
381
+ } else {
382
+ H = function e(t) {
383
+ return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
384
+ };
385
+ }
386
+ return H(e);
387
+ }
388
+ function N() {
389
+ N = Object.assign || function(e) {
390
+ for (var t = 1; t < arguments.length; t++) {
391
+ var r = arguments[t];
392
+ for (var n in r) {
393
+ if (Object.prototype.hasOwnProperty.call(r, n)) {
394
+ e[n] = r[n];
395
+ }
396
+ }
397
+ }
398
+ return e;
399
+ };
400
+ return N.apply(this, arguments);
460
401
  }
461
- }]);
462
-
463
- return Scroll;
464
- }(external_react_namespaceObject.Component);
465
-
466
- Scroll_defineProperty(Scroll, "propTypes", Scroll_propTypes);
467
-
468
- Scroll_defineProperty(Scroll, "defaultProps", Scroll_defaultProps);
469
-
470
- /* harmony default export */ const Scroll_Scroll = (Scroll);
471
- ;// CONCATENATED MODULE: ./src/Scroll/index.ts
472
-
473
- module.exports = __webpack_exports__;
474
- /******/ })()
475
- ;
402
+ function I(e, t) {
403
+ if (e == null) return {};
404
+ var r = F(e, t);
405
+ var n, o;
406
+ if (Object.getOwnPropertySymbols) {
407
+ var l = Object.getOwnPropertySymbols(e);
408
+ for (o = 0; o < l.length; o++) {
409
+ n = l[o];
410
+ if (t.indexOf(n) >= 0) continue;
411
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
412
+ r[n] = e[n];
413
+ }
414
+ }
415
+ return r;
416
+ }
417
+ function F(e, t) {
418
+ if (e == null) return {};
419
+ var r = {};
420
+ var n = Object.keys(e);
421
+ var o, l;
422
+ for (l = 0; l < n.length; l++) {
423
+ o = n[l];
424
+ if (t.indexOf(o) >= 0) continue;
425
+ r[o] = e[o];
426
+ }
427
+ return r;
428
+ }
429
+ function A(e, t) {
430
+ if (!(e instanceof t)) {
431
+ throw new TypeError("Cannot call a class as a function");
432
+ }
433
+ }
434
+ function U(e, t) {
435
+ for (var r = 0; r < t.length; r++) {
436
+ var n = t[r];
437
+ n.enumerable = n.enumerable || false;
438
+ n.configurable = true;
439
+ if ("value" in n) n.writable = true;
440
+ Object.defineProperty(e, n.key, n);
441
+ }
442
+ }
443
+ function z(e, t, r) {
444
+ if (t) U(e.prototype, t);
445
+ if (r) U(e, r);
446
+ return e;
447
+ }
448
+ function B(e, t) {
449
+ if (typeof t !== "function" && t !== null) {
450
+ throw new TypeError("Super expression must either be null or a function");
451
+ }
452
+ e.prototype = Object.create(t && t.prototype, {
453
+ constructor: {
454
+ value: e,
455
+ writable: true,
456
+ configurable: true
457
+ }
458
+ });
459
+ if (t) G(e, t);
460
+ }
461
+ function G(e, t) {
462
+ G = Object.setPrototypeOf || function e(t, r) {
463
+ t.__proto__ = r;
464
+ return t;
465
+ };
466
+ return G(e, t);
467
+ }
468
+ function J(e) {
469
+ var t = V();
470
+ return function r() {
471
+ var n = Z(e), o;
472
+ if (t) {
473
+ var l = Z(this).constructor;
474
+ o = Reflect.construct(n, arguments, l);
475
+ } else {
476
+ o = n.apply(this, arguments);
477
+ }
478
+ return K(this, o);
479
+ };
480
+ }
481
+ function K(e, t) {
482
+ if (t && (H(t) === "object" || typeof t === "function")) {
483
+ return t;
484
+ }
485
+ return Q(e);
486
+ }
487
+ function Q(e) {
488
+ if (e === void 0) {
489
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
490
+ }
491
+ return e;
492
+ }
493
+ function V() {
494
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
495
+ if (Reflect.construct.sham) return false;
496
+ if (typeof Proxy === "function") return true;
497
+ try {
498
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
499
+ return true;
500
+ } catch (e) {
501
+ return false;
502
+ }
503
+ }
504
+ function Z(e) {
505
+ Z = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
506
+ return t.__proto__ || Object.getPrototypeOf(t);
507
+ };
508
+ return Z(e);
509
+ }
510
+ function $(e, t, r) {
511
+ if (t in e) {
512
+ Object.defineProperty(e, t, {
513
+ value: r,
514
+ enumerable: true,
515
+ configurable: true,
516
+ writable: true
517
+ });
518
+ } else {
519
+ e[t] = r;
520
+ }
521
+ return e;
522
+ }
523
+ var ee = {
524
+ children: l().node,
525
+ elementRef: l().oneOfType([ l().func, l().object ]),
526
+ left: l().number,
527
+ onScroll: l().func,
528
+ onScrollComplete: l().func,
529
+ stopScrollPropagation: l().oneOf([ true, false, "window" ]),
530
+ tagName: l().string,
531
+ top: l().number
532
+ };
533
+ var te = {
534
+ stopScrollPropagation: false,
535
+ tagName: "div"
536
+ };
537
+ var re = function(e) {
538
+ B(r, e);
539
+ var t = J(r);
540
+ // @docs-props-type ScrollPropsBase
541
+ function r(e) {
542
+ var o;
543
+ A(this, r);
544
+ o = t.call(this, e);
545
+ $(Q(o), "handleRest", (function() {
546
+ var e, t;
547
+ (e = (t = o.props).onScrollComplete) === null || e === void 0 ? void 0 : e.call(t);
548
+ }));
549
+ $(Q(o), "handleScroll", (function(e) {
550
+ var t, r;
551
+ o.setState({
552
+ currentLeft: e.currentTarget.scrollLeft,
553
+ currentTop: e.currentTarget.scrollTop
554
+ });
555
+ (t = (r = o.props).onScroll) === null || t === void 0 ? void 0 : t.call(r, e);
556
+ }));
557
+ $(Q(o), "renderInner", (function(e) {
558
+ var t = o.props, r = t.children, l = t.elementRef, i = t.left, f = t.top, c = t.onScrollComplete, a = I(t, [ "children", "elementRef", "left", "top", "onScrollComplete" ]);
559
+
560
+ return n().createElement(D, N({
561
+ "data-test": "scroll"
562
+ }, a, {
563
+ key: "inner",
564
+ top: u()(f) ? e.top : undefined,
565
+ left: u()(i) ? e.left : undefined,
566
+ elementRef: l,
567
+ onScroll: o.handleScroll
568
+ }), r);
569
+ }));
570
+ o.state = {
571
+ currentLeft: 0,
572
+ currentTop: 0
573
+ };
574
+ return o;
575
+ }
576
+ z(r, [ {
577
+ key: "render",
578
+ value: function e() {
579
+ var t = this.props, r = t.left, o = t.top;
580
+ var l = this.state, i = l.currentLeft, c = l.currentTop;
581
+ var a = {};
582
+ // When isFinite, the prop is defined and therefore animating.
583
+ if (u()(r)) {
584
+ a.left = r;
585
+ } else {
586
+ a.left = i;
587
+ }
588
+ if (u()(o)) {
589
+ a.top = o;
590
+ } else {
591
+ a.top = c;
592
+ }
593
+
594
+ return n().createElement(f.Spring, {
595
+ from: {
596
+ left: 0,
597
+ top: 0
598
+ },
599
+ to: a,
600
+ onRest: this.handleRest,
601
+ config: {
602
+ precision: 10
603
+ }
604
+ }, this.renderInner);
605
+ }
606
+ } ]);
607
+ return r;
608
+ }(r.Component);
609
+ $(re, "propTypes", ee);
610
+ $(re, "defaultProps", te);
611
+ /* harmony default export */ const ne = re;
612
+ // CONCATENATED MODULE: ./src/Scroll/index.ts
613
+ module.exports = t;
614
+ /******/})();