@splunk/react-ui 4.20.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.
- package/Accordion.js +425 -441
- package/Anchor.js +147 -193
- package/Animation.js +142 -166
- package/AnimationToggle.js +197 -253
- package/Box.js +145 -194
- package/Breadcrumbs.js +288 -298
- package/Button.js +488 -613
- package/ButtonGroup.js +160 -212
- package/ButtonSimple.js +543 -562
- package/CHANGELOG.md +26 -0
- package/Calendar.js +1107 -1195
- package/Card.js +771 -746
- package/CardLayout.js +205 -223
- package/Chip.js +509 -612
- package/Clickable.js +416 -472
- package/CloseButton.js +165 -250
- package/Code.js +1808 -2172
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -675
- package/Color.js +1066 -1297
- package/ColumnLayout.js +402 -465
- package/ComboBox.js +892 -969
- package/Concertina.js +998 -963
- package/ControlGroup.js +687 -718
- package/Date.js +567 -697
- package/DefinitionList.js +308 -310
- package/Divider.js +149 -194
- package/Dropdown.js +459 -558
- package/DualListbox.js +1480 -1735
- package/EventListener.js +94 -165
- package/File.js +1051 -1173
- package/FormRows.js +885 -880
- package/Heading.js +216 -263
- package/Image.js +446 -558
- package/JSONTree.js +690 -699
- package/Layer.js +442 -582
- package/Link.js +336 -361
- package/List.js +213 -237
- package/Markdown.js +510 -612
- package/Menu.js +1109 -1331
- package/Message.js +474 -629
- package/MessageBar.js +387 -561
- package/Modal.js +810 -798
- package/ModalLayer.js +326 -343
- package/Monogram.js +308 -368
- package/Multiselect.js +3558 -3998
- package/Number.js +729 -843
- package/Paginator.js +510 -615
- package/Paragraph.js +145 -188
- package/Popover.js +1470 -1693
- package/Progress.js +301 -362
- package/RadioBar.js +610 -651
- package/RadioList.js +483 -544
- package/Resize.js +530 -623
- package/ResultsMenu.js +494 -597
- package/ScreenReaderContent.js +142 -187
- package/Scroll.js +595 -598
- package/ScrollContainerContext.js +197 -278
- package/Search.js +745 -817
- package/Select.js +2441 -2746
- package/SidePanel.js +390 -392
- package/Slider.js +668 -825
- package/SlidingPanels.js +639 -645
- package/SplitButton.js +464 -499
- package/StaticContent.js +161 -217
- package/StepBar.js +386 -466
- package/Switch.js +710 -764
- package/TabBar.js +724 -815
- package/TabLayout.js +406 -438
- package/Table.js +4842 -5121
- package/Text.js +1169 -1351
- package/TextArea.js +1097 -1307
- package/Tooltip.js +624 -721
- package/TransitionOpen.js +489 -546
- package/Typography.js +176 -229
- package/WaitSpinner.js +230 -298
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +112 -146
- package/useKeyPress.js +74 -128
- package/usePrevious.js +65 -129
- package/useRovingFocus.js +122 -218
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/Scroll.js
CHANGED
|
@@ -1,617 +1,614 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
/******/
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
/******/
|
|
48
|
-
/******/
|
|
49
|
-
/******/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/******/
|
|
53
|
-
/******/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/******/
|
|
57
|
-
/******/
|
|
58
|
-
/******/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 10:
|
|
105
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
|
-
|
|
107
|
-
"use strict";
|
|
108
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
109
|
-
/**
|
|
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
|
+
/**
|
|
110
97
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
111
98
|
*
|
|
112
99
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
113
100
|
* @param current - The new value of the ref.
|
|
114
101
|
*/
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
+
}
|
|
123
113
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/***/ }),
|
|
137
|
-
|
|
138
|
-
/***/ 19:
|
|
139
|
-
/***/ (function(module, exports) {
|
|
140
|
-
|
|
141
|
-
module.exports = require("lodash/isFinite");
|
|
142
|
-
|
|
143
|
-
/***/ }),
|
|
144
|
-
|
|
145
|
-
/***/ 2:
|
|
146
|
-
/***/ (function(module, exports) {
|
|
147
|
-
|
|
148
|
-
module.exports = require("react");
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ 206:
|
|
153
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
154
|
-
|
|
155
|
-
"use strict";
|
|
156
|
-
// ESM COMPAT FLAG
|
|
157
|
-
__webpack_require__.r(__webpack_exports__);
|
|
158
|
-
|
|
159
|
-
// EXPORTS
|
|
160
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Scroll_Scroll; });
|
|
161
|
-
|
|
162
|
-
// EXTERNAL MODULE: external "react"
|
|
163
|
-
var external_react_ = __webpack_require__(2);
|
|
164
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
165
|
-
|
|
166
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
167
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
168
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
169
|
-
|
|
170
|
-
// EXTERNAL MODULE: external "lodash/isFinite"
|
|
171
|
-
var isFinite_ = __webpack_require__(19);
|
|
172
|
-
var isFinite_default = /*#__PURE__*/__webpack_require__.n(isFinite_);
|
|
173
|
-
|
|
174
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Animation"
|
|
175
|
-
var Animation_ = __webpack_require__(43);
|
|
176
|
-
|
|
177
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
178
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
179
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
180
|
-
|
|
181
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
182
|
-
var themes_ = __webpack_require__(0);
|
|
183
|
-
|
|
184
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
185
|
-
var keys_ = __webpack_require__(9);
|
|
186
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
187
|
-
|
|
188
|
-
// EXTERNAL MODULE: external "lodash/omit"
|
|
189
|
-
var omit_ = __webpack_require__(5);
|
|
190
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
191
|
-
|
|
192
|
-
// EXTERNAL MODULE: external "react-spring"
|
|
193
|
-
var external_react_spring_ = __webpack_require__(24);
|
|
194
|
-
|
|
195
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/EventListener"
|
|
196
|
-
var EventListener_ = __webpack_require__(16);
|
|
197
|
-
var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
|
|
198
|
-
|
|
199
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
|
|
200
|
-
var ScrollContainerContext_ = __webpack_require__(53);
|
|
201
|
-
|
|
202
|
-
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
203
|
-
var updateReactRef = __webpack_require__(10);
|
|
204
|
-
|
|
205
|
-
// CONCATENATED MODULE: ./src/Scroll/Inner.tsx
|
|
206
|
-
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); }
|
|
207
|
-
|
|
208
|
-
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); }
|
|
209
|
-
|
|
210
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
211
|
-
|
|
212
|
-
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); } }
|
|
213
|
-
|
|
214
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
215
|
-
|
|
216
|
-
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); }
|
|
217
|
-
|
|
218
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
219
|
-
|
|
220
|
-
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); }; }
|
|
221
|
-
|
|
222
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
223
|
-
|
|
224
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
225
|
-
|
|
226
|
-
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; } }
|
|
227
|
-
|
|
228
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
229
|
-
|
|
230
|
-
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; }
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
var propTypes = {
|
|
242
|
-
children: external_prop_types_default.a.node,
|
|
243
|
-
defaultLeft: external_prop_types_default.a.number,
|
|
244
|
-
defaultTop: external_prop_types_default.a.number,
|
|
245
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
246
|
-
left: external_prop_types_default.a.object,
|
|
247
|
-
onScroll: external_prop_types_default.a.func,
|
|
248
|
-
stopScrollPropagation: external_prop_types_default.a.oneOf([true, false, 'window']),
|
|
249
|
-
tagName: external_prop_types_default.a.string,
|
|
250
|
-
top: external_prop_types_default.a.object
|
|
251
|
-
};
|
|
252
|
-
var defaultProps = {
|
|
253
|
-
defaultLeft: 0,
|
|
254
|
-
defaultTop: 0,
|
|
255
|
-
tagName: 'div'
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
var Inner_Inner = /*#__PURE__*/function (_Component) {
|
|
259
|
-
_inherits(Inner, _Component);
|
|
260
|
-
|
|
261
|
-
var _super = _createSuper(Inner);
|
|
262
|
-
|
|
263
|
-
function Inner(props) {
|
|
264
|
-
var _this;
|
|
265
|
-
|
|
266
|
-
_classCallCheck(this, Inner);
|
|
267
|
-
|
|
268
|
-
_this = _super.call(this, props);
|
|
269
|
-
|
|
270
|
-
_defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowX", 'visible');
|
|
271
|
-
|
|
272
|
-
_defineProperty(_assertThisInitialized(_this), "defaultWindowOverflowY", 'visible');
|
|
273
|
-
|
|
274
|
-
_defineProperty(_assertThisInitialized(_this), "handleWheel", function (e) {
|
|
275
|
-
var el = _this.state.containerEl;
|
|
276
|
-
|
|
277
|
-
if (!el) {
|
|
278
|
-
return;
|
|
279
|
-
} // if the element is scrollable in both directions, it's not safe to stop propagation.
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
if (el.clientWidth !== el.scrollWidth && el.clientHeight !== el.scrollHeight) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (el.clientWidth !== el.scrollWidth) {
|
|
287
|
-
if (e.deltaX < 0 && el.scrollLeft < Math.abs(e.deltaX)) {
|
|
288
|
-
el.scrollLeft = 0;
|
|
289
|
-
e.stopPropagation();
|
|
290
|
-
e.preventDefault();
|
|
291
|
-
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
|
+
};
|
|
292
125
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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");
|
|
300
145
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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);
|
|
309
154
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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");
|
|
317
164
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (this.state.containerEl) {
|
|
351
|
-
if (!prevState.containerEl) {
|
|
352
|
-
this.state.containerEl.scrollTop = this.props.defaultTop;
|
|
353
|
-
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;
|
|
354
197
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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");
|
|
360
203
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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;
|
|
366
215
|
}
|
|
367
|
-
}
|
|
368
216
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
scrollTop: top,
|
|
386
|
-
scrollLeft: left
|
|
387
|
-
}), /*#__PURE__*/external_react_default.a.createElement(ScrollContainerContext_["ScrollContainerProvider"], {
|
|
388
|
-
value: containerEl
|
|
389
|
-
}, children)), stopScrollPropagation === true && containerEl && /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
390
|
-
target: containerEl,
|
|
391
|
-
eventType: "wheel",
|
|
392
|
-
listener: this.handleWheel,
|
|
393
|
-
options: {
|
|
394
|
-
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;
|
|
395
233
|
}
|
|
396
|
-
|
|
234
|
+
return e;
|
|
397
235
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
displayName: "ScrollStyles__StyledInner",
|
|
414
|
-
componentId: "sc-1xspttf-0"
|
|
415
|
-
})(["", ";overflow:auto;overflow-y:auto;overflow-x:hidden;"], themes_["mixins"].reset('block'));
|
|
416
|
-
|
|
417
|
-
// CONCATENATED MODULE: ./src/Scroll/Scroll.tsx
|
|
418
|
-
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); }
|
|
419
|
-
|
|
420
|
-
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); }
|
|
421
|
-
|
|
422
|
-
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; }
|
|
423
|
-
|
|
424
|
-
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; }
|
|
425
|
-
|
|
426
|
-
function Scroll_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
427
|
-
|
|
428
|
-
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); } }
|
|
429
|
-
|
|
430
|
-
function Scroll_createClass(Constructor, protoProps, staticProps) { if (protoProps) Scroll_defineProperties(Constructor.prototype, protoProps); if (staticProps) Scroll_defineProperties(Constructor, staticProps); return Constructor; }
|
|
431
|
-
|
|
432
|
-
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); }
|
|
433
|
-
|
|
434
|
-
function Scroll_setPrototypeOf(o, p) { Scroll_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Scroll_setPrototypeOf(o, p); }
|
|
435
|
-
|
|
436
|
-
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); }; }
|
|
437
|
-
|
|
438
|
-
function Scroll_possibleConstructorReturn(self, call) { if (call && (Scroll_typeof(call) === "object" || typeof call === "function")) { return call; } return Scroll_assertThisInitialized(self); }
|
|
439
|
-
|
|
440
|
-
function Scroll_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
441
|
-
|
|
442
|
-
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; } }
|
|
443
|
-
|
|
444
|
-
function Scroll_getPrototypeOf(o) { Scroll_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Scroll_getPrototypeOf(o); }
|
|
445
|
-
|
|
446
|
-
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; }
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
var Scroll_propTypes = {
|
|
454
|
-
children: external_prop_types_default.a.node,
|
|
455
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
456
|
-
left: external_prop_types_default.a.number,
|
|
457
|
-
onScroll: external_prop_types_default.a.func,
|
|
458
|
-
onScrollComplete: external_prop_types_default.a.func,
|
|
459
|
-
stopScrollPropagation: external_prop_types_default.a.oneOf([true, false, 'window']),
|
|
460
|
-
tagName: external_prop_types_default.a.string,
|
|
461
|
-
top: external_prop_types_default.a.number
|
|
462
|
-
};
|
|
463
|
-
var Scroll_defaultProps = {
|
|
464
|
-
stopScrollPropagation: false,
|
|
465
|
-
tagName: 'div'
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
var Scroll_Scroll = /*#__PURE__*/function (_Component) {
|
|
469
|
-
Scroll_inherits(Scroll, _Component);
|
|
470
|
-
|
|
471
|
-
var _super = Scroll_createSuper(Scroll);
|
|
472
|
-
|
|
473
|
-
// @docs-props-type ScrollPropsBase
|
|
474
|
-
function Scroll(props) {
|
|
475
|
-
var _this;
|
|
476
|
-
|
|
477
|
-
Scroll_classCallCheck(this, Scroll);
|
|
478
|
-
|
|
479
|
-
_this = _super.call(this, props);
|
|
480
|
-
|
|
481
|
-
Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleRest", function () {
|
|
482
|
-
var _this$props$onScrollC, _this$props;
|
|
483
|
-
|
|
484
|
-
(_this$props$onScrollC = (_this$props = _this.props).onScrollComplete) === null || _this$props$onScrollC === void 0 ? void 0 : _this$props$onScrollC.call(_this$props);
|
|
485
|
-
});
|
|
486
|
-
|
|
487
|
-
Scroll_defineProperty(Scroll_assertThisInitialized(_this), "handleScroll", function (e) {
|
|
488
|
-
var _this$props$onScroll, _this$props2;
|
|
489
|
-
|
|
490
|
-
_this.setState({
|
|
491
|
-
currentLeft: e.currentTarget.scrollLeft,
|
|
492
|
-
currentTop: e.currentTarget.scrollTop
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
(_this$props$onScroll = (_this$props2 = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props2, e);
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
Scroll_defineProperty(Scroll_assertThisInitialized(_this), "renderInner", function (targetScroll) {
|
|
499
|
-
var _this$props3 = _this.props,
|
|
500
|
-
children = _this$props3.children,
|
|
501
|
-
elementRef = _this$props3.elementRef,
|
|
502
|
-
left = _this$props3.left,
|
|
503
|
-
top = _this$props3.top,
|
|
504
|
-
onScrollComplete = _this$props3.onScrollComplete,
|
|
505
|
-
otherProps = _objectWithoutProperties(_this$props3, ["children", "elementRef", "left", "top", "onScrollComplete"]);
|
|
506
|
-
|
|
507
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledInner, Scroll_extends({
|
|
508
|
-
"data-test": "scroll"
|
|
509
|
-
}, otherProps, {
|
|
510
|
-
key: "inner",
|
|
511
|
-
top: isFinite_default()(top) ? targetScroll.top : undefined,
|
|
512
|
-
left: isFinite_default()(left) ? targetScroll.left : undefined,
|
|
513
|
-
elementRef: elementRef,
|
|
514
|
-
onScroll: _this.handleScroll
|
|
515
|
-
}), children);
|
|
516
|
-
});
|
|
517
|
-
|
|
518
|
-
_this.state = {
|
|
519
|
-
currentLeft: 0,
|
|
520
|
-
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"
|
|
521
251
|
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
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;
|
|
557
319
|
}
|
|
558
|
-
|
|
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);
|
|
559
401
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
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
|
+
/******/})();
|