@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.
- package/Accordion.js +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +7 -2
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1808 -2084
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1066 -1069
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +891 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1105 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3550 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +610 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +494 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +744 -650
- package/Select.js +2442 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +669 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +726 -680
- package/TabLayout.js +406 -322
- package/Table.js +4842 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +5 -5
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/Scroll.js
CHANGED
|
@@ -1,475 +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
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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
|
-
|
|
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
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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
|
+
/******/})();
|