@splunk/react-ui 4.38.0 → 4.39.0
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 +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Scroll.js
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ ae
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const r = require("react");
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
var l = e.n(o);
|
|
72
72
|
// CONCATENATED MODULE: external "lodash/isFinite"
|
|
73
73
|
const i = require("lodash/isFinite");
|
|
74
|
-
var
|
|
74
|
+
var a = e.n(i);
|
|
75
75
|
// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
|
|
76
|
-
const
|
|
76
|
+
const u = require("@splunk/react-ui/Animation");
|
|
77
77
|
// CONCATENATED MODULE: external "styled-components"
|
|
78
78
|
const c = require("styled-components");
|
|
79
|
-
var
|
|
79
|
+
var f = e.n(c);
|
|
80
80
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
81
81
|
const s = require("@splunk/themes");
|
|
82
82
|
// CONCATENATED MODULE: external "lodash/keys"
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
const y = require("lodash/omit");
|
|
87
87
|
var v = e.n(y);
|
|
88
88
|
// CONCATENATED MODULE: external "react-spring"
|
|
89
|
-
const
|
|
89
|
+
const b = require("react-spring");
|
|
90
90
|
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
91
|
-
const
|
|
92
|
-
var m = e.n(
|
|
91
|
+
const h = require("@splunk/react-ui/EventListener");
|
|
92
|
+
var m = e.n(h);
|
|
93
93
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
|
|
94
|
-
const
|
|
94
|
+
const w = require("@splunk/react-ui/ScrollContainerContext");
|
|
95
95
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
96
96
|
/**
|
|
97
97
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
100
100
|
* @param current - The new value of the ref.
|
|
101
101
|
*/
|
|
102
|
-
function
|
|
102
|
+
function g(e, t) {
|
|
103
103
|
if (e) {
|
|
104
104
|
if (typeof e === "function") {
|
|
105
105
|
e(t);
|
|
@@ -114,126 +114,111 @@
|
|
|
114
114
|
// CONCATENATED MODULE: ./src/Scroll/Inner.tsx
|
|
115
115
|
function O(e) {
|
|
116
116
|
"@babel/helpers - typeof";
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
O = function e(t) {
|
|
123
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
return O(e);
|
|
117
|
+
return O = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
118
|
+
return typeof e;
|
|
119
|
+
} : function(e) {
|
|
120
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
121
|
+
}, O(e);
|
|
127
122
|
}
|
|
128
123
|
function S() {
|
|
129
|
-
S = Object.assign
|
|
124
|
+
return S = Object.assign ? Object.assign.bind() : function(e) {
|
|
130
125
|
for (var t = 1; t < arguments.length; t++) {
|
|
131
126
|
var r = arguments[t];
|
|
132
127
|
for (var n in r) {
|
|
133
|
-
|
|
134
|
-
e[n] = r[n];
|
|
135
|
-
}
|
|
128
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
131
|
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");
|
|
145
|
-
}
|
|
132
|
+
}, S.apply(null, arguments);
|
|
146
133
|
}
|
|
147
134
|
function j(e, t) {
|
|
135
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
136
|
+
}
|
|
137
|
+
function P(e, t) {
|
|
148
138
|
for (var r = 0; r < t.length; r++) {
|
|
149
139
|
var n = t[r];
|
|
150
|
-
n.enumerable = n.enumerable ||
|
|
151
|
-
n.
|
|
152
|
-
if ("value" in n) n.writable = true;
|
|
153
|
-
Object.defineProperty(e, n.key, n);
|
|
140
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
141
|
+
Object.defineProperty(e, q(n.key), n);
|
|
154
142
|
}
|
|
155
143
|
}
|
|
156
144
|
function T(e, t, r) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
145
|
+
return t && P(e.prototype, t), r && P(e, r), Object.defineProperty(e, "prototype", {
|
|
146
|
+
writable: !1
|
|
147
|
+
}), e;
|
|
160
148
|
}
|
|
161
149
|
function E(e, t) {
|
|
162
|
-
if (typeof t !== "
|
|
163
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
164
|
-
}
|
|
150
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
165
151
|
e.prototype = Object.create(t && t.prototype, {
|
|
166
152
|
constructor: {
|
|
167
153
|
value: e,
|
|
168
|
-
writable:
|
|
169
|
-
configurable:
|
|
154
|
+
writable: !0,
|
|
155
|
+
configurable: !0
|
|
170
156
|
}
|
|
171
|
-
})
|
|
172
|
-
|
|
157
|
+
}), Object.defineProperty(e, "prototype", {
|
|
158
|
+
writable: !1
|
|
159
|
+
}), t && _(e, t);
|
|
173
160
|
}
|
|
174
161
|
function _(e, t) {
|
|
175
|
-
_ = Object.setPrototypeOf
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
};
|
|
179
|
-
return _(e, t);
|
|
162
|
+
return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
163
|
+
return e.__proto__ = t, e;
|
|
164
|
+
}, _(e, t);
|
|
180
165
|
}
|
|
181
|
-
function
|
|
182
|
-
var t =
|
|
183
|
-
return function
|
|
184
|
-
var n =
|
|
166
|
+
function L(e) {
|
|
167
|
+
var t = M();
|
|
168
|
+
return function() {
|
|
169
|
+
var r, n = k(e);
|
|
185
170
|
if (t) {
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
} else
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
return L(this, o);
|
|
171
|
+
var o = k(this).constructor;
|
|
172
|
+
r = Reflect.construct(n, arguments, o);
|
|
173
|
+
} else r = n.apply(this, arguments);
|
|
174
|
+
return R(this, r);
|
|
192
175
|
};
|
|
193
176
|
}
|
|
194
|
-
function
|
|
195
|
-
if (t && (O(t)
|
|
196
|
-
|
|
197
|
-
}
|
|
177
|
+
function R(e, t) {
|
|
178
|
+
if (t && ("object" == O(t) || "function" == typeof t)) return t;
|
|
179
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
198
180
|
return W(e);
|
|
199
181
|
}
|
|
200
182
|
function W(e) {
|
|
201
|
-
if (
|
|
202
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
203
|
-
}
|
|
183
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
204
184
|
return e;
|
|
205
185
|
}
|
|
206
|
-
function
|
|
207
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
208
|
-
if (Reflect.construct.sham) return false;
|
|
209
|
-
if (typeof Proxy === "function") return true;
|
|
186
|
+
function M() {
|
|
210
187
|
try {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return
|
|
215
|
-
}
|
|
188
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
189
|
+
} catch (e) {}
|
|
190
|
+
return (M = function t() {
|
|
191
|
+
return !!e;
|
|
192
|
+
})();
|
|
216
193
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
return
|
|
220
|
-
};
|
|
221
|
-
return M(e);
|
|
194
|
+
function k(e) {
|
|
195
|
+
return k = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
196
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
197
|
+
}, k(e);
|
|
222
198
|
}
|
|
223
199
|
function C(e, t, r) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
200
|
+
return (t = q(t)) in e ? Object.defineProperty(e, t, {
|
|
201
|
+
value: r,
|
|
202
|
+
enumerable: !0,
|
|
203
|
+
configurable: !0,
|
|
204
|
+
writable: !0
|
|
205
|
+
}) : e[t] = r, e;
|
|
206
|
+
}
|
|
207
|
+
function q(e) {
|
|
208
|
+
var t = X(e, "string");
|
|
209
|
+
return "symbol" == O(t) ? t : t + "";
|
|
210
|
+
}
|
|
211
|
+
function X(e, t) {
|
|
212
|
+
if ("object" != O(e) || !e) return e;
|
|
213
|
+
var r = e[Symbol.toPrimitive];
|
|
214
|
+
if (void 0 !== r) {
|
|
215
|
+
var n = r.call(e, t || "default");
|
|
216
|
+
if ("object" != O(n)) return n;
|
|
217
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
233
218
|
}
|
|
234
|
-
return e;
|
|
219
|
+
return ("string" === t ? String : Number)(e);
|
|
235
220
|
}
|
|
236
|
-
var
|
|
221
|
+
var Y = {
|
|
237
222
|
children: l().node,
|
|
238
223
|
defaultLeft: l().number,
|
|
239
224
|
defaultTop: l().number,
|
|
@@ -244,17 +229,17 @@
|
|
|
244
229
|
tagName: l().string,
|
|
245
230
|
top: l().object
|
|
246
231
|
};
|
|
247
|
-
var
|
|
232
|
+
var N = {
|
|
248
233
|
defaultLeft: 0,
|
|
249
234
|
defaultTop: 0,
|
|
250
235
|
tagName: "div"
|
|
251
236
|
};
|
|
252
|
-
var
|
|
237
|
+
var x = function(e) {
|
|
253
238
|
E(r, e);
|
|
254
|
-
var t =
|
|
239
|
+
var t = L(r);
|
|
255
240
|
function r(e) {
|
|
256
241
|
var n;
|
|
257
|
-
|
|
242
|
+
j(this, r);
|
|
258
243
|
n = t.call(this, e);
|
|
259
244
|
C(W(n), "defaultWindowOverflowX", "visible");
|
|
260
245
|
C(W(n), "defaultWindowOverflowY", "visible");
|
|
@@ -263,7 +248,7 @@
|
|
|
263
248
|
if (!t) {
|
|
264
249
|
return;
|
|
265
250
|
}
|
|
266
|
-
|
|
251
|
+
// if the element is scrollable in both directions, it's not safe to stop propagation.
|
|
267
252
|
if (t.clientWidth !== t.scrollWidth && t.clientHeight !== t.scrollHeight) {
|
|
268
253
|
return;
|
|
269
254
|
}
|
|
@@ -300,7 +285,7 @@
|
|
|
300
285
|
n.setState({
|
|
301
286
|
containerEl: e
|
|
302
287
|
});
|
|
303
|
-
|
|
288
|
+
g(n.props.elementRef, e);
|
|
304
289
|
}));
|
|
305
290
|
C(W(n), "handleMouseEnter", (function() {
|
|
306
291
|
n.defaultWindowOverflowX = document.body.style.overflowX;
|
|
@@ -325,11 +310,11 @@
|
|
|
325
310
|
this.state.containerEl.scrollTop = this.props.defaultTop;
|
|
326
311
|
this.state.containerEl.scrollLeft = this.props.defaultLeft;
|
|
327
312
|
}
|
|
328
|
-
if (
|
|
313
|
+
if (a()(this.props.top)) {
|
|
329
314
|
var n;
|
|
330
315
|
this.state.containerEl.scrollTop = ((n = this.props.top) === null || n === void 0 ? void 0 : n.get()) || 0;
|
|
331
316
|
}
|
|
332
|
-
if (
|
|
317
|
+
if (a()(this.props.left)) {
|
|
333
318
|
var o;
|
|
334
319
|
this.state.containerEl.scrollLeft = ((o = this.props.left) === null || o === void 0 ? void 0 : o.get()) || 0;
|
|
335
320
|
}
|
|
@@ -338,18 +323,18 @@
|
|
|
338
323
|
}, {
|
|
339
324
|
key: "render",
|
|
340
325
|
value: function e() {
|
|
341
|
-
var t = this.props, o = t.children, l = t.onScroll, i = t.stopScrollPropagation,
|
|
326
|
+
var t = this.props, o = t.children, l = t.onScroll, i = t.stopScrollPropagation, a = t.top, u = t.left;
|
|
342
327
|
var c = this.state.containerEl;
|
|
343
|
-
var
|
|
328
|
+
var f = b.animated[this.props.tagName];
|
|
344
329
|
|
|
345
|
-
return n().createElement(n().Fragment, null, n().createElement(
|
|
330
|
+
return n().createElement(n().Fragment, null, n().createElement(f, S({}, v()(this.props, d()(r.propTypes)), {
|
|
346
331
|
ref: this.handleMount,
|
|
347
332
|
onMouseEnter: i === "window" ? this.handleMouseEnter : undefined,
|
|
348
333
|
onMouseLeave: i === "window" ? this.handleMouseLeave : undefined,
|
|
349
334
|
onScroll: l,
|
|
350
|
-
scrollTop:
|
|
351
|
-
scrollLeft:
|
|
352
|
-
}), n().createElement(
|
|
335
|
+
scrollTop: a,
|
|
336
|
+
scrollLeft: u
|
|
337
|
+
}), n().createElement(w.ScrollContainerProvider, {
|
|
353
338
|
value: c
|
|
354
339
|
}, o)), i === true && c && n().createElement(m(), {
|
|
355
340
|
target: c,
|
|
@@ -363,164 +348,144 @@
|
|
|
363
348
|
} ]);
|
|
364
349
|
return r;
|
|
365
350
|
}(r.Component);
|
|
366
|
-
C(
|
|
367
|
-
C(
|
|
368
|
-
/* harmony default export */ const
|
|
351
|
+
C(x, "propTypes", Y);
|
|
352
|
+
C(x, "defaultProps", N);
|
|
353
|
+
/* harmony default export */ const D = x;
|
|
369
354
|
// CONCATENATED MODULE: ./src/Scroll/ScrollStyles.ts
|
|
370
|
-
var
|
|
355
|
+
var H = f()(D).withConfig({
|
|
371
356
|
displayName: "ScrollStyles__StyledInner",
|
|
372
357
|
componentId: "sc-1xspttf-0"
|
|
373
358
|
})([ "", ";overflow:auto;overflow-y:auto;overflow-x:hidden;" ], s.mixins.reset("block"));
|
|
374
359
|
// CONCATENATED MODULE: ./src/Scroll/Scroll.tsx
|
|
375
|
-
function
|
|
360
|
+
function I(e) {
|
|
376
361
|
"@babel/helpers - typeof";
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
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);
|
|
362
|
+
return I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
363
|
+
return typeof e;
|
|
364
|
+
} : function(e) {
|
|
365
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
366
|
+
}, I(e);
|
|
387
367
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
368
|
+
function B() {
|
|
369
|
+
return B = Object.assign ? Object.assign.bind() : function(e) {
|
|
390
370
|
for (var t = 1; t < arguments.length; t++) {
|
|
391
371
|
var r = arguments[t];
|
|
392
372
|
for (var n in r) {
|
|
393
|
-
|
|
394
|
-
e[n] = r[n];
|
|
395
|
-
}
|
|
373
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
396
374
|
}
|
|
397
375
|
}
|
|
398
376
|
return e;
|
|
399
|
-
};
|
|
400
|
-
return N.apply(this, arguments);
|
|
377
|
+
}, B.apply(null, arguments);
|
|
401
378
|
}
|
|
402
|
-
function
|
|
403
|
-
if (
|
|
404
|
-
var r =
|
|
405
|
-
var n, o;
|
|
379
|
+
function F(e, t) {
|
|
380
|
+
if (null == e) return {};
|
|
381
|
+
var r, n, o = A(e, t);
|
|
406
382
|
if (Object.getOwnPropertySymbols) {
|
|
407
383
|
var l = Object.getOwnPropertySymbols(e);
|
|
408
|
-
for (
|
|
409
|
-
|
|
410
|
-
if (t.indexOf(n) >= 0) continue;
|
|
411
|
-
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
412
|
-
r[n] = e[n];
|
|
384
|
+
for (n = 0; n < l.length; n++) {
|
|
385
|
+
r = l[n], t.includes(r) || {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
413
386
|
}
|
|
414
387
|
}
|
|
415
|
-
return
|
|
388
|
+
return o;
|
|
416
389
|
}
|
|
417
|
-
function
|
|
418
|
-
if (
|
|
390
|
+
function A(e, t) {
|
|
391
|
+
if (null == e) return {};
|
|
419
392
|
var r = {};
|
|
420
|
-
var n
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
r[o] = e[o];
|
|
393
|
+
for (var n in e) {
|
|
394
|
+
if ({}.hasOwnProperty.call(e, n)) {
|
|
395
|
+
if (t.includes(n)) continue;
|
|
396
|
+
r[n] = e[n];
|
|
397
|
+
}
|
|
426
398
|
}
|
|
427
399
|
return r;
|
|
428
400
|
}
|
|
429
|
-
function A(e, t) {
|
|
430
|
-
if (!(e instanceof t)) {
|
|
431
|
-
throw new TypeError("Cannot call a class as a function");
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
401
|
function U(e, t) {
|
|
402
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
403
|
+
}
|
|
404
|
+
function z(e, t) {
|
|
435
405
|
for (var r = 0; r < t.length; r++) {
|
|
436
406
|
var n = t[r];
|
|
437
|
-
n.enumerable = n.enumerable ||
|
|
438
|
-
n.
|
|
439
|
-
if ("value" in n) n.writable = true;
|
|
440
|
-
Object.defineProperty(e, n.key, n);
|
|
407
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0),
|
|
408
|
+
Object.defineProperty(e, re(n.key), n);
|
|
441
409
|
}
|
|
442
410
|
}
|
|
443
|
-
function
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
411
|
+
function G(e, t, r) {
|
|
412
|
+
return t && z(e.prototype, t), r && z(e, r), Object.defineProperty(e, "prototype", {
|
|
413
|
+
writable: !1
|
|
414
|
+
}), e;
|
|
447
415
|
}
|
|
448
|
-
function
|
|
449
|
-
if (typeof t !== "
|
|
450
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
451
|
-
}
|
|
416
|
+
function J(e, t) {
|
|
417
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
452
418
|
e.prototype = Object.create(t && t.prototype, {
|
|
453
419
|
constructor: {
|
|
454
420
|
value: e,
|
|
455
|
-
writable:
|
|
456
|
-
configurable:
|
|
421
|
+
writable: !0,
|
|
422
|
+
configurable: !0
|
|
457
423
|
}
|
|
458
|
-
})
|
|
459
|
-
|
|
424
|
+
}), Object.defineProperty(e, "prototype", {
|
|
425
|
+
writable: !1
|
|
426
|
+
}), t && K(e, t);
|
|
460
427
|
}
|
|
461
|
-
function
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
};
|
|
466
|
-
return G(e, t);
|
|
428
|
+
function K(e, t) {
|
|
429
|
+
return K = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
430
|
+
return e.__proto__ = t, e;
|
|
431
|
+
}, K(e, t);
|
|
467
432
|
}
|
|
468
|
-
function
|
|
469
|
-
var t =
|
|
470
|
-
return function
|
|
471
|
-
var n =
|
|
433
|
+
function Q(e) {
|
|
434
|
+
var t = $();
|
|
435
|
+
return function() {
|
|
436
|
+
var r, n = ee(e);
|
|
472
437
|
if (t) {
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
} else
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
return K(this, o);
|
|
438
|
+
var o = ee(this).constructor;
|
|
439
|
+
r = Reflect.construct(n, arguments, o);
|
|
440
|
+
} else r = n.apply(this, arguments);
|
|
441
|
+
return V(this, r);
|
|
479
442
|
};
|
|
480
443
|
}
|
|
481
|
-
function
|
|
482
|
-
if (t && (
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
return Q(e);
|
|
444
|
+
function V(e, t) {
|
|
445
|
+
if (t && ("object" == I(t) || "function" == typeof t)) return t;
|
|
446
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
447
|
+
return Z(e);
|
|
486
448
|
}
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
490
|
-
}
|
|
449
|
+
function Z(e) {
|
|
450
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
491
451
|
return e;
|
|
492
452
|
}
|
|
493
|
-
function
|
|
494
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
495
|
-
if (Reflect.construct.sham) return false;
|
|
496
|
-
if (typeof Proxy === "function") return true;
|
|
453
|
+
function $() {
|
|
497
454
|
try {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return
|
|
502
|
-
}
|
|
455
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
456
|
+
} catch (e) {}
|
|
457
|
+
return ($ = function t() {
|
|
458
|
+
return !!e;
|
|
459
|
+
})();
|
|
503
460
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
506
|
-
return
|
|
507
|
-
};
|
|
508
|
-
return Z(e);
|
|
461
|
+
function ee(e) {
|
|
462
|
+
return ee = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
463
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
464
|
+
}, ee(e);
|
|
509
465
|
}
|
|
510
|
-
function
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
466
|
+
function te(e, t, r) {
|
|
467
|
+
return (t = re(t)) in e ? Object.defineProperty(e, t, {
|
|
468
|
+
value: r,
|
|
469
|
+
enumerable: !0,
|
|
470
|
+
configurable: !0,
|
|
471
|
+
writable: !0
|
|
472
|
+
}) : e[t] = r, e;
|
|
473
|
+
}
|
|
474
|
+
function re(e) {
|
|
475
|
+
var t = ne(e, "string");
|
|
476
|
+
return "symbol" == I(t) ? t : t + "";
|
|
477
|
+
}
|
|
478
|
+
function ne(e, t) {
|
|
479
|
+
if ("object" != I(e) || !e) return e;
|
|
480
|
+
var r = e[Symbol.toPrimitive];
|
|
481
|
+
if (void 0 !== r) {
|
|
482
|
+
var n = r.call(e, t || "default");
|
|
483
|
+
if ("object" != I(n)) return n;
|
|
484
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
520
485
|
}
|
|
521
|
-
return e;
|
|
486
|
+
return ("string" === t ? String : Number)(e);
|
|
522
487
|
}
|
|
523
|
-
var
|
|
488
|
+
var oe = {
|
|
524
489
|
children: l().node,
|
|
525
490
|
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
526
491
|
left: l().number,
|
|
@@ -530,23 +495,23 @@
|
|
|
530
495
|
tagName: l().string,
|
|
531
496
|
top: l().number
|
|
532
497
|
};
|
|
533
|
-
var
|
|
498
|
+
var le = {
|
|
534
499
|
stopScrollPropagation: false,
|
|
535
500
|
tagName: "div"
|
|
536
501
|
};
|
|
537
|
-
var
|
|
538
|
-
|
|
539
|
-
var t =
|
|
502
|
+
var ie = function(e) {
|
|
503
|
+
J(r, e);
|
|
504
|
+
var t = Q(r);
|
|
540
505
|
// @docs-props-type ScrollPropsBase
|
|
541
506
|
function r(e) {
|
|
542
507
|
var o;
|
|
543
|
-
|
|
508
|
+
U(this, r);
|
|
544
509
|
o = t.call(this, e);
|
|
545
|
-
|
|
510
|
+
te(Z(o), "handleRest", (function() {
|
|
546
511
|
var e, t;
|
|
547
512
|
(e = (t = o.props).onScrollComplete) === null || e === void 0 ? void 0 : e.call(t);
|
|
548
513
|
}));
|
|
549
|
-
|
|
514
|
+
te(Z(o), "handleScroll", (function(e) {
|
|
550
515
|
var t, r;
|
|
551
516
|
o.setState({
|
|
552
517
|
currentLeft: e.currentTarget.scrollLeft,
|
|
@@ -554,15 +519,15 @@
|
|
|
554
519
|
});
|
|
555
520
|
(t = (r = o.props).onScroll) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
556
521
|
}));
|
|
557
|
-
|
|
558
|
-
var t = o.props, r = t.children, l = t.elementRef, i = t.left,
|
|
522
|
+
te(Z(o), "renderInner", (function(e) {
|
|
523
|
+
var t = o.props, r = t.children, l = t.elementRef, i = t.left, u = t.top, c = t.onScrollComplete, f = F(t, [ "children", "elementRef", "left", "top", "onScrollComplete" ]);
|
|
559
524
|
|
|
560
|
-
return n().createElement(
|
|
525
|
+
return n().createElement(H, B({
|
|
561
526
|
"data-test": "scroll"
|
|
562
|
-
},
|
|
527
|
+
}, f, {
|
|
563
528
|
key: "inner",
|
|
564
|
-
top:
|
|
565
|
-
left:
|
|
529
|
+
top: a()(u) ? e.top : undefined,
|
|
530
|
+
left: a()(i) ? e.left : undefined,
|
|
566
531
|
elementRef: l,
|
|
567
532
|
onScroll: o.handleScroll
|
|
568
533
|
}), r);
|
|
@@ -573,30 +538,30 @@
|
|
|
573
538
|
};
|
|
574
539
|
return o;
|
|
575
540
|
}
|
|
576
|
-
|
|
541
|
+
G(r, [ {
|
|
577
542
|
key: "render",
|
|
578
543
|
value: function e() {
|
|
579
544
|
var t = this.props, r = t.left, o = t.top;
|
|
580
545
|
var l = this.state, i = l.currentLeft, c = l.currentTop;
|
|
581
|
-
var
|
|
582
|
-
|
|
583
|
-
if (
|
|
584
|
-
|
|
546
|
+
var f = {};
|
|
547
|
+
// When isFinite, the prop is defined and therefore animating.
|
|
548
|
+
if (a()(r)) {
|
|
549
|
+
f.left = r;
|
|
585
550
|
} else {
|
|
586
|
-
|
|
551
|
+
f.left = i;
|
|
587
552
|
}
|
|
588
|
-
if (
|
|
589
|
-
|
|
553
|
+
if (a()(o)) {
|
|
554
|
+
f.top = o;
|
|
590
555
|
} else {
|
|
591
|
-
|
|
556
|
+
f.top = c;
|
|
592
557
|
}
|
|
593
558
|
|
|
594
|
-
return n().createElement(
|
|
559
|
+
return n().createElement(u.Spring, {
|
|
595
560
|
from: {
|
|
596
561
|
left: 0,
|
|
597
562
|
top: 0
|
|
598
563
|
},
|
|
599
|
-
to:
|
|
564
|
+
to: f,
|
|
600
565
|
onRest: this.handleRest,
|
|
601
566
|
config: {
|
|
602
567
|
precision: 10
|
|
@@ -606,9 +571,9 @@
|
|
|
606
571
|
} ]);
|
|
607
572
|
return r;
|
|
608
573
|
}(r.Component);
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
/* harmony default export */ const
|
|
574
|
+
te(ie, "propTypes", oe);
|
|
575
|
+
te(ie, "defaultProps", le);
|
|
576
|
+
/* harmony default export */ const ae = ie;
|
|
612
577
|
// CONCATENATED MODULE: ./src/Scroll/index.ts
|
|
613
578
|
module.exports = t;
|
|
614
579
|
/******/})();
|