@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/SlidingPanels.js
CHANGED
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(t, {
|
|
64
|
-
Panel: () => /* reexport */
|
|
65
|
-
default: () => /* reexport */
|
|
64
|
+
Panel: () => /* reexport */ X,
|
|
65
|
+
default: () => /* reexport */ ce
|
|
66
66
|
});
|
|
67
67
|
// CONCATENATED MODULE: external "react"
|
|
68
68
|
const n = require("react");
|
|
@@ -83,23 +83,23 @@
|
|
|
83
83
|
const p = require("lodash/values");
|
|
84
84
|
var d = e.n(p);
|
|
85
85
|
// CONCATENATED MODULE: external "react-spring"
|
|
86
|
-
const
|
|
86
|
+
const v = require("react-spring");
|
|
87
87
|
// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
|
|
88
|
-
const
|
|
88
|
+
const y = require("@splunk/react-ui/Animation");
|
|
89
89
|
// CONCATENATED MODULE: external "styled-components"
|
|
90
|
-
const
|
|
91
|
-
var
|
|
90
|
+
const b = require("styled-components");
|
|
91
|
+
var m = e.n(b);
|
|
92
92
|
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
93
|
-
const
|
|
94
|
-
var g = e.n(
|
|
93
|
+
const h = require("@splunk/react-ui/Box");
|
|
94
|
+
var g = e.n(h);
|
|
95
95
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
96
96
|
const O = require("@splunk/themes");
|
|
97
97
|
// CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanelsStyles.ts
|
|
98
|
-
var P =
|
|
98
|
+
var P = m()((0, v.animated)(g())).withConfig({
|
|
99
99
|
displayName: "SlidingPanelsStyles__StyledBox",
|
|
100
100
|
componentId: "su6isq-0"
|
|
101
101
|
})([ "overflow:hidden;position:relative;" ]);
|
|
102
|
-
var w =
|
|
102
|
+
var w = m()(v.animated.div).withConfig({
|
|
103
103
|
displayName: "SlidingPanelsStyles__Styled",
|
|
104
104
|
componentId: "su6isq-1"
|
|
105
105
|
})([ "", ";", ";" ], O.mixins.reset("block"), O.mixins.clearfix());
|
|
@@ -125,126 +125,111 @@
|
|
|
125
125
|
// CONCATENATED MODULE: ./src/SlidingPanels/Panel.tsx
|
|
126
126
|
function S(e) {
|
|
127
127
|
"@babel/helpers - typeof";
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
S = function e(t) {
|
|
134
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
return S(e);
|
|
128
|
+
return S = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
129
|
+
return typeof e;
|
|
130
|
+
} : function(e) {
|
|
131
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
132
|
+
}, S(e);
|
|
138
133
|
}
|
|
139
|
-
function
|
|
140
|
-
|
|
134
|
+
function E() {
|
|
135
|
+
return E = Object.assign ? Object.assign.bind() : function(e) {
|
|
141
136
|
for (var t = 1; t < arguments.length; t++) {
|
|
142
137
|
var n = arguments[t];
|
|
143
138
|
for (var r in n) {
|
|
144
|
-
|
|
145
|
-
e[r] = n[r];
|
|
146
|
-
}
|
|
139
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
147
140
|
}
|
|
148
141
|
}
|
|
149
142
|
return e;
|
|
150
|
-
};
|
|
151
|
-
return I.apply(this, arguments);
|
|
143
|
+
}, E.apply(null, arguments);
|
|
152
144
|
}
|
|
153
|
-
function
|
|
154
|
-
if (!(e instanceof t))
|
|
155
|
-
throw new TypeError("Cannot call a class as a function");
|
|
156
|
-
}
|
|
145
|
+
function I(e, t) {
|
|
146
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
157
147
|
}
|
|
158
|
-
function
|
|
148
|
+
function _(e, t) {
|
|
159
149
|
for (var n = 0; n < t.length; n++) {
|
|
160
150
|
var r = t[n];
|
|
161
|
-
r.enumerable = r.enumerable ||
|
|
162
|
-
r.
|
|
163
|
-
if ("value" in r) r.writable = true;
|
|
164
|
-
Object.defineProperty(e, r.key, r);
|
|
151
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
152
|
+
Object.defineProperty(e, U(r.key), r);
|
|
165
153
|
}
|
|
166
154
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
function k(e, t, n) {
|
|
156
|
+
return t && _(e.prototype, t), n && _(e, n), Object.defineProperty(e, "prototype", {
|
|
157
|
+
writable: !1
|
|
158
|
+
}), e;
|
|
171
159
|
}
|
|
172
|
-
function
|
|
173
|
-
if (typeof t !== "
|
|
174
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
175
|
-
}
|
|
160
|
+
function T(e, t) {
|
|
161
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
176
162
|
e.prototype = Object.create(t && t.prototype, {
|
|
177
163
|
constructor: {
|
|
178
164
|
value: e,
|
|
179
|
-
writable:
|
|
180
|
-
configurable:
|
|
165
|
+
writable: !0,
|
|
166
|
+
configurable: !0
|
|
181
167
|
}
|
|
182
|
-
})
|
|
183
|
-
|
|
168
|
+
}), Object.defineProperty(e, "prototype", {
|
|
169
|
+
writable: !1
|
|
170
|
+
}), t && q(e, t);
|
|
184
171
|
}
|
|
185
172
|
function q(e, t) {
|
|
186
|
-
q = Object.setPrototypeOf
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
return q(e, t);
|
|
173
|
+
return q = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
174
|
+
return e.__proto__ = t, e;
|
|
175
|
+
}, q(e, t);
|
|
191
176
|
}
|
|
192
177
|
function A(e) {
|
|
193
|
-
var t =
|
|
194
|
-
return function
|
|
195
|
-
var r =
|
|
178
|
+
var t = M();
|
|
179
|
+
return function() {
|
|
180
|
+
var n, r = x(e);
|
|
196
181
|
if (t) {
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
-
} else
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
return C(this, o);
|
|
182
|
+
var o = x(this).constructor;
|
|
183
|
+
n = Reflect.construct(r, arguments, o);
|
|
184
|
+
} else n = r.apply(this, arguments);
|
|
185
|
+
return C(this, n);
|
|
203
186
|
};
|
|
204
187
|
}
|
|
205
188
|
function C(e, t) {
|
|
206
|
-
if (t && (S(t)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return T(e);
|
|
189
|
+
if (t && ("object" == S(t) || "function" == typeof t)) return t;
|
|
190
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
191
|
+
return R(e);
|
|
210
192
|
}
|
|
211
|
-
function
|
|
212
|
-
if (
|
|
213
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
214
|
-
}
|
|
193
|
+
function R(e) {
|
|
194
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
215
195
|
return e;
|
|
216
196
|
}
|
|
217
|
-
function
|
|
218
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
219
|
-
if (Reflect.construct.sham) return false;
|
|
220
|
-
if (typeof Proxy === "function") return true;
|
|
197
|
+
function M() {
|
|
221
198
|
try {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return
|
|
226
|
-
}
|
|
199
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
200
|
+
} catch (e) {}
|
|
201
|
+
return (M = function t() {
|
|
202
|
+
return !!e;
|
|
203
|
+
})();
|
|
227
204
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
205
|
+
function x(e) {
|
|
206
|
+
return x = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
207
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
208
|
+
}, x(e);
|
|
209
|
+
}
|
|
210
|
+
function N(e, t, n) {
|
|
211
|
+
return (t = U(t)) in e ? Object.defineProperty(e, t, {
|
|
212
|
+
value: n,
|
|
213
|
+
enumerable: !0,
|
|
214
|
+
configurable: !0,
|
|
215
|
+
writable: !0
|
|
216
|
+
}) : e[t] = n, e;
|
|
217
|
+
}
|
|
218
|
+
function U(e) {
|
|
219
|
+
var t = D(e, "string");
|
|
220
|
+
return "symbol" == S(t) ? t : t + "";
|
|
221
|
+
}
|
|
222
|
+
function D(e, t) {
|
|
223
|
+
if ("object" != S(e) || !e) return e;
|
|
224
|
+
var n = e[Symbol.toPrimitive];
|
|
225
|
+
if (void 0 !== n) {
|
|
226
|
+
var r = n.call(e, t || "default");
|
|
227
|
+
if ("object" != S(r)) return r;
|
|
228
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
244
229
|
}
|
|
245
|
-
return e;
|
|
230
|
+
return ("string" === t ? String : Number)(e);
|
|
246
231
|
}
|
|
247
|
-
var
|
|
232
|
+
var B = {
|
|
248
233
|
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
249
234
|
panelId: i().any.isRequired,
|
|
250
235
|
/**
|
|
@@ -260,27 +245,28 @@
|
|
|
260
245
|
*/
|
|
261
246
|
onUnmount: i().func
|
|
262
247
|
};
|
|
263
|
-
var
|
|
248
|
+
var L = {};
|
|
264
249
|
/**
|
|
265
250
|
* Container for arbitrary content.
|
|
266
|
-
*/ var
|
|
267
|
-
|
|
251
|
+
*/ var W = function(e) {
|
|
252
|
+
T(n, e);
|
|
268
253
|
var t = A(n);
|
|
269
254
|
function n() {
|
|
270
255
|
var e;
|
|
271
|
-
|
|
256
|
+
I(this, n);
|
|
272
257
|
for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) {
|
|
273
258
|
o[i] = arguments[i];
|
|
274
259
|
}
|
|
275
260
|
e = t.call.apply(t, [ this ].concat(o));
|
|
276
|
-
|
|
277
|
-
|
|
261
|
+
N(R(e), "el", null);
|
|
262
|
+
N(R(e), "handleMount", (function(t) {
|
|
278
263
|
e.el = t;
|
|
279
264
|
j(e.props.elementRef, t);
|
|
280
265
|
}));
|
|
281
266
|
return e;
|
|
282
267
|
}
|
|
283
|
-
|
|
268
|
+
// @docs-props-type PanelPropsBase
|
|
269
|
+
k(n, [ {
|
|
284
270
|
key: "componentDidMount",
|
|
285
271
|
value: function e() {
|
|
286
272
|
var t, n;
|
|
@@ -292,13 +278,15 @@
|
|
|
292
278
|
var t, n;
|
|
293
279
|
(t = (n = this.props).onUnmount) === null || t === void 0 ? void 0 : t.call(n, this);
|
|
294
280
|
}
|
|
295
|
-
|
|
281
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
282
|
+
}, {
|
|
296
283
|
key: "getHeight",
|
|
297
284
|
value: function e() {
|
|
298
285
|
var t;
|
|
299
286
|
return (t = this.el) === null || t === void 0 ? void 0 : t.clientHeight;
|
|
300
287
|
}
|
|
301
|
-
|
|
288
|
+
// eslint-disable-next-line react/no-unused-class-component-methods
|
|
289
|
+
}, {
|
|
302
290
|
key: "getWidth",
|
|
303
291
|
value: function e() {
|
|
304
292
|
var t;
|
|
@@ -309,7 +297,7 @@
|
|
|
309
297
|
value: function e() {
|
|
310
298
|
var t = this.props.panelId;
|
|
311
299
|
|
|
312
|
-
return r().createElement(w,
|
|
300
|
+
return r().createElement(w, E({
|
|
313
301
|
"data-test": "panel",
|
|
314
302
|
"data-test-panel-id": t
|
|
315
303
|
}, f()(this.props, c()(n.propTypes)), {
|
|
@@ -319,160 +307,138 @@
|
|
|
319
307
|
} ]);
|
|
320
308
|
return n;
|
|
321
309
|
}(n.Component);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
/* harmony default export */ const
|
|
310
|
+
N(W, "propTypes", B);
|
|
311
|
+
N(W, "defaultProps", L);
|
|
312
|
+
/* harmony default export */ const X = W;
|
|
325
313
|
// CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanels.tsx
|
|
326
|
-
function
|
|
314
|
+
function H(e) {
|
|
327
315
|
"@babel/helpers - typeof";
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
X = function e(t) {
|
|
334
|
-
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
return X(e);
|
|
316
|
+
return H = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
317
|
+
return typeof e;
|
|
318
|
+
} : function(e) {
|
|
319
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
320
|
+
}, H(e);
|
|
338
321
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
322
|
+
function V() {
|
|
323
|
+
return V = Object.assign ? Object.assign.bind() : function(e) {
|
|
341
324
|
for (var t = 1; t < arguments.length; t++) {
|
|
342
325
|
var n = arguments[t];
|
|
343
326
|
for (var r in n) {
|
|
344
|
-
|
|
345
|
-
e[r] = n[r];
|
|
346
|
-
}
|
|
327
|
+
({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
347
328
|
}
|
|
348
329
|
}
|
|
349
330
|
return e;
|
|
350
|
-
};
|
|
351
|
-
return H.apply(this, arguments);
|
|
331
|
+
}, V.apply(null, arguments);
|
|
352
332
|
}
|
|
353
|
-
function
|
|
333
|
+
function F(e, t) {
|
|
354
334
|
var n = Object.keys(e);
|
|
355
335
|
if (Object.getOwnPropertySymbols) {
|
|
356
336
|
var r = Object.getOwnPropertySymbols(e);
|
|
357
|
-
|
|
337
|
+
t && (r = r.filter((function(t) {
|
|
358
338
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
359
|
-
}));
|
|
360
|
-
n.push.apply(n, r);
|
|
339
|
+
}))), n.push.apply(n, r);
|
|
361
340
|
}
|
|
362
341
|
return n;
|
|
363
342
|
}
|
|
364
|
-
function
|
|
343
|
+
function z(e) {
|
|
365
344
|
for (var t = 1; t < arguments.length; t++) {
|
|
366
|
-
var n = arguments[t]
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
Object.defineProperties(e, Object.getOwnPropertyDescriptors(n));
|
|
373
|
-
} else {
|
|
374
|
-
B(Object(n)).forEach((function(t) {
|
|
375
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
376
|
-
}));
|
|
377
|
-
}
|
|
345
|
+
var n = null != arguments[t] ? arguments[t] : {};
|
|
346
|
+
t % 2 ? F(Object(n), !0).forEach((function(t) {
|
|
347
|
+
re(e, t, n[t]);
|
|
348
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : F(Object(n)).forEach((function(t) {
|
|
349
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
350
|
+
}));
|
|
378
351
|
}
|
|
379
352
|
return e;
|
|
380
353
|
}
|
|
381
|
-
function
|
|
382
|
-
if (!(e instanceof t))
|
|
383
|
-
throw new TypeError("Cannot call a class as a function");
|
|
384
|
-
}
|
|
354
|
+
function G(e, t) {
|
|
355
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
385
356
|
}
|
|
386
|
-
function
|
|
357
|
+
function J(e, t) {
|
|
387
358
|
for (var n = 0; n < t.length; n++) {
|
|
388
359
|
var r = t[n];
|
|
389
|
-
r.enumerable = r.enumerable ||
|
|
390
|
-
r.
|
|
391
|
-
if ("value" in r) r.writable = true;
|
|
392
|
-
Object.defineProperty(e, r.key, r);
|
|
360
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
|
|
361
|
+
Object.defineProperty(e, oe(r.key), r);
|
|
393
362
|
}
|
|
394
363
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
364
|
+
function K(e, t, n) {
|
|
365
|
+
return t && J(e.prototype, t), n && J(e, n), Object.defineProperty(e, "prototype", {
|
|
366
|
+
writable: !1
|
|
367
|
+
}), e;
|
|
399
368
|
}
|
|
400
|
-
function
|
|
401
|
-
if (typeof t !== "
|
|
402
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
403
|
-
}
|
|
369
|
+
function Q(e, t) {
|
|
370
|
+
if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
|
|
404
371
|
e.prototype = Object.create(t && t.prototype, {
|
|
405
372
|
constructor: {
|
|
406
373
|
value: e,
|
|
407
|
-
writable:
|
|
408
|
-
configurable:
|
|
374
|
+
writable: !0,
|
|
375
|
+
configurable: !0
|
|
409
376
|
}
|
|
410
|
-
})
|
|
411
|
-
|
|
377
|
+
}), Object.defineProperty(e, "prototype", {
|
|
378
|
+
writable: !1
|
|
379
|
+
}), t && Y(e, t);
|
|
412
380
|
}
|
|
413
|
-
function
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
};
|
|
418
|
-
return K(e, t);
|
|
381
|
+
function Y(e, t) {
|
|
382
|
+
return Y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
383
|
+
return e.__proto__ = t, e;
|
|
384
|
+
}, Y(e, t);
|
|
419
385
|
}
|
|
420
|
-
function
|
|
421
|
-
var t =
|
|
422
|
-
return function
|
|
423
|
-
var r =
|
|
386
|
+
function Z(e) {
|
|
387
|
+
var t = te();
|
|
388
|
+
return function() {
|
|
389
|
+
var n, r = ne(e);
|
|
424
390
|
if (t) {
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
} else
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
return Y(this, o);
|
|
391
|
+
var o = ne(this).constructor;
|
|
392
|
+
n = Reflect.construct(r, arguments, o);
|
|
393
|
+
} else n = r.apply(this, arguments);
|
|
394
|
+
return $(this, n);
|
|
431
395
|
};
|
|
432
396
|
}
|
|
433
|
-
function
|
|
434
|
-
if (t && (
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return Z(e);
|
|
397
|
+
function $(e, t) {
|
|
398
|
+
if (t && ("object" == H(t) || "function" == typeof t)) return t;
|
|
399
|
+
if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
|
|
400
|
+
return ee(e);
|
|
438
401
|
}
|
|
439
|
-
function
|
|
440
|
-
if (
|
|
441
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
442
|
-
}
|
|
402
|
+
function ee(e) {
|
|
403
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
443
404
|
return e;
|
|
444
405
|
}
|
|
445
|
-
function
|
|
446
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
447
|
-
if (Reflect.construct.sham) return false;
|
|
448
|
-
if (typeof Proxy === "function") return true;
|
|
406
|
+
function te() {
|
|
449
407
|
try {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
return
|
|
454
|
-
}
|
|
408
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
|
|
409
|
+
} catch (e) {}
|
|
410
|
+
return (te = function t() {
|
|
411
|
+
return !!e;
|
|
412
|
+
})();
|
|
455
413
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
458
|
-
return
|
|
459
|
-
};
|
|
460
|
-
return ee(e);
|
|
414
|
+
function ne(e) {
|
|
415
|
+
return ne = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
416
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
417
|
+
}, ne(e);
|
|
461
418
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
419
|
+
function re(e, t, n) {
|
|
420
|
+
return (t = oe(t)) in e ? Object.defineProperty(e, t, {
|
|
421
|
+
value: n,
|
|
422
|
+
enumerable: !0,
|
|
423
|
+
configurable: !0,
|
|
424
|
+
writable: !0
|
|
425
|
+
}) : e[t] = n, e;
|
|
426
|
+
}
|
|
427
|
+
function oe(e) {
|
|
428
|
+
var t = ie(e, "string");
|
|
429
|
+
return "symbol" == H(t) ? t : t + "";
|
|
430
|
+
}
|
|
431
|
+
function ie(e, t) {
|
|
432
|
+
if ("object" != H(e) || !e) return e;
|
|
433
|
+
var n = e[Symbol.toPrimitive];
|
|
434
|
+
if (void 0 !== n) {
|
|
435
|
+
var r = n.call(e, t || "default");
|
|
436
|
+
if ("object" != H(r)) return r;
|
|
437
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
472
438
|
}
|
|
473
|
-
return e;
|
|
439
|
+
return ("string" === t ? String : Number)(e);
|
|
474
440
|
}
|
|
475
|
-
var
|
|
441
|
+
var ae = {
|
|
476
442
|
activePanelId: i().any.isRequired,
|
|
477
443
|
children: i().node,
|
|
478
444
|
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
@@ -483,25 +449,42 @@
|
|
|
483
449
|
outerStyle: i().object,
|
|
484
450
|
transition: i().oneOf([ "forward", "backward" ])
|
|
485
451
|
};
|
|
486
|
-
var
|
|
452
|
+
var le = {
|
|
487
453
|
transition: "forward"
|
|
488
454
|
};
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
var t =
|
|
492
|
-
|
|
493
|
-
|
|
455
|
+
var ue = function(e) {
|
|
456
|
+
Q(o, e);
|
|
457
|
+
var t = Z(o);
|
|
458
|
+
K(o, null, [ {
|
|
459
|
+
key: "getDerivedStateFromProps",
|
|
460
|
+
// @docs-props-type SlidingPanelsPropsBase
|
|
461
|
+
value: function e(t, n) {
|
|
462
|
+
if (t.activePanelId !== n.prevActivePanelId) {
|
|
463
|
+
// instead of using panelId, assign each sliding event an id and
|
|
464
|
+
// use it as the key to make sure new panelA will transit as expected if
|
|
465
|
+
// old panelA has not fully left yet
|
|
466
|
+
return {
|
|
467
|
+
animating: true,
|
|
468
|
+
panelLoading: true,
|
|
469
|
+
prevActivePanelId: t.activePanelId,
|
|
470
|
+
slidingId: n.slidingId + 1
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
475
|
+
} ]);
|
|
476
|
+
function o(e) {
|
|
494
477
|
var i;
|
|
495
|
-
|
|
478
|
+
G(this, o);
|
|
496
479
|
i = t.call(this, e);
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
480
|
+
re(ee(i), "panelInstances", {});
|
|
481
|
+
re(ee(i), "allowAnimationUpdates", true);
|
|
482
|
+
re(ee(i), "willEnter", (function() {
|
|
500
483
|
return {
|
|
501
484
|
translateX: 0
|
|
502
485
|
};
|
|
503
486
|
}));
|
|
504
|
-
|
|
487
|
+
re(ee(i), "willLeave", (function(e) {
|
|
505
488
|
return e ? {
|
|
506
489
|
translateX: -1,
|
|
507
490
|
position: "absolute",
|
|
@@ -511,7 +494,7 @@
|
|
|
511
494
|
translateX: -1
|
|
512
495
|
};
|
|
513
496
|
}));
|
|
514
|
-
|
|
497
|
+
re(ee(i), "handlePanelMount", (function(e) {
|
|
515
498
|
i.panelInstances[e.props.panelId] = e;
|
|
516
499
|
if (e.props.panelId === i.props.activePanelId) {
|
|
517
500
|
i.setState({
|
|
@@ -520,10 +503,10 @@
|
|
|
520
503
|
});
|
|
521
504
|
}
|
|
522
505
|
}));
|
|
523
|
-
|
|
506
|
+
re(ee(i), "handlePanelUnmount", (function(e) {
|
|
524
507
|
delete i.panelInstances[e.props.panelId];
|
|
525
508
|
}));
|
|
526
|
-
|
|
509
|
+
re(ee(i), "handleAnimationEnd", (function() {
|
|
527
510
|
var e, t;
|
|
528
511
|
if (i.allowAnimationUpdates) {
|
|
529
512
|
i.setState({
|
|
@@ -532,20 +515,20 @@
|
|
|
532
515
|
}
|
|
533
516
|
(e = (t = i.props).onAnimationEnd) === null || e === void 0 ? void 0 : e.call(t);
|
|
534
517
|
}));
|
|
535
|
-
|
|
518
|
+
re(ee(i), "renderPanel", (function(e, t, o) {
|
|
536
519
|
var a;
|
|
537
520
|
var l = i.props, u = l.children, c = l.transition;
|
|
538
521
|
var s = n.Children.toArray(u).filter(n.isValidElement).find((function(e) {
|
|
539
522
|
return e.props.panelId === t;
|
|
540
523
|
}));
|
|
541
|
-
|
|
524
|
+
// TODO: Fix Interplation<string | number> can't be cast to string
|
|
542
525
|
var f = (a = e.translateX) === null || a === void 0 ? void 0 : a.to((function(e) {
|
|
543
526
|
return "translateX(".concat(e * o * (c === "forward" ? 1 : -1), "px)");
|
|
544
527
|
}));
|
|
545
|
-
var p = s ? r().createElement(
|
|
528
|
+
var p = s ? r().createElement(v.animated.div, {
|
|
546
529
|
style: e
|
|
547
530
|
}, (0, n.cloneElement)(s, {
|
|
548
|
-
style:
|
|
531
|
+
style: z(z({}, s.props.style), {}, {
|
|
549
532
|
transform: f
|
|
550
533
|
}),
|
|
551
534
|
onMount: i.handlePanelMount,
|
|
@@ -553,10 +536,10 @@
|
|
|
553
536
|
})) : null;
|
|
554
537
|
return p;
|
|
555
538
|
}));
|
|
556
|
-
|
|
557
|
-
var t = i.props, a = t.activePanelId, u = t.children, s = t.elementRef, p = t.outerClassName,
|
|
539
|
+
re(ee(i), "renderOuterContainer", (function(e) {
|
|
540
|
+
var t = i.props, a = t.activePanelId, u = t.children, s = t.elementRef, p = t.outerClassName, b = t.outerStyle, m = t.innerClassName, h = t.innerStyle;
|
|
558
541
|
var g = i.state.animating;
|
|
559
|
-
var O =
|
|
542
|
+
var O = z(z({}, b), g ? {
|
|
560
543
|
width: e.width,
|
|
561
544
|
height: e.height
|
|
562
545
|
} : {});
|
|
@@ -570,7 +553,7 @@
|
|
|
570
553
|
var S = l()(d()(i.panelInstances), (function(e) {
|
|
571
554
|
return !!e;
|
|
572
555
|
}));
|
|
573
|
-
var
|
|
556
|
+
var E = S.map((function(e) {
|
|
574
557
|
var t;
|
|
575
558
|
var n = i.panelInstances[e.props.panelId];
|
|
576
559
|
return n ? (t = n.getWidth()) !== null && t !== void 0 ? t : 0 : 0;
|
|
@@ -578,24 +561,25 @@
|
|
|
578
561
|
return Math.max(e, t);
|
|
579
562
|
}), 0);
|
|
580
563
|
|
|
581
|
-
return r().createElement(P,
|
|
564
|
+
return r().createElement(P, V({
|
|
582
565
|
className: p,
|
|
583
566
|
"data-test-active-panel-id": a,
|
|
584
567
|
"data-test": "sliding-panels",
|
|
585
568
|
elementRef: s,
|
|
586
569
|
style: O
|
|
587
|
-
}, f()(i.props, c()(o.propTypes))), r().createElement(
|
|
570
|
+
}, f()(i.props, c()(o.propTypes))), r().createElement(y.Transition, {
|
|
588
571
|
from: j,
|
|
589
572
|
enter: i.willEnter(),
|
|
590
573
|
leave: i.willLeave(g),
|
|
591
574
|
items: a
|
|
592
|
-
}, (
|
|
575
|
+
}, (
|
|
576
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
593
577
|
function(e, t) {
|
|
594
578
|
|
|
595
|
-
return r().createElement(
|
|
596
|
-
style:
|
|
597
|
-
className:
|
|
598
|
-
}, i.renderPanel(e, t,
|
|
579
|
+
return r().createElement(v.animated.div, {
|
|
580
|
+
style: h,
|
|
581
|
+
className: m
|
|
582
|
+
}, i.renderPanel(e, t, E));
|
|
599
583
|
})));
|
|
600
584
|
}));
|
|
601
585
|
i.state = {
|
|
@@ -607,7 +591,7 @@
|
|
|
607
591
|
};
|
|
608
592
|
return i;
|
|
609
593
|
}
|
|
610
|
-
|
|
594
|
+
K(o, [ {
|
|
611
595
|
key: "componentWillUnmount",
|
|
612
596
|
value: function e() {
|
|
613
597
|
this.allowAnimationUpdates = false;
|
|
@@ -618,7 +602,7 @@
|
|
|
618
602
|
var t = this.state, n = t.activePanel, o = t.panelLoading;
|
|
619
603
|
var i = n ? n.getWidth() : 0;
|
|
620
604
|
var a = n ? n.getHeight() : 0;
|
|
621
|
-
|
|
605
|
+
// When a new panel is loading, the activePanel is about to be removed. The height and/or
|
|
622
606
|
// width of that panel may have changed since the last render. To ensure that the next
|
|
623
607
|
// panel animates from the current height and width (rather than the previously loaded one),
|
|
624
608
|
// we only set the style when panelLoading is true (immediate prop prevents animation if true).
|
|
@@ -627,39 +611,23 @@
|
|
|
627
611
|
height: a
|
|
628
612
|
};
|
|
629
613
|
|
|
630
|
-
return r().createElement(
|
|
614
|
+
return r().createElement(y.Spring, {
|
|
631
615
|
to: l,
|
|
632
616
|
onRest: this.handleAnimationEnd,
|
|
633
617
|
immediate: o,
|
|
634
618
|
config: {
|
|
635
619
|
precision: 1
|
|
636
620
|
}
|
|
637
|
-
},
|
|
638
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
621
|
+
}, /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
639
622
|
this.renderOuterContainer);
|
|
640
623
|
}
|
|
641
624
|
} ]);
|
|
642
625
|
return o;
|
|
643
626
|
}(n.Component);
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
if (e.activePanelId !== t.prevActivePanelId) {
|
|
649
|
-
// instead of using panelId, assign each sliding event an id and
|
|
650
|
-
// use it as the key to make sure new panelA will transit as expected if
|
|
651
|
-
// old panelA has not fully left yet
|
|
652
|
-
return {
|
|
653
|
-
animating: true,
|
|
654
|
-
panelLoading: true,
|
|
655
|
-
prevActivePanelId: e.activePanelId,
|
|
656
|
-
slidingId: t.slidingId + 1
|
|
657
|
-
};
|
|
658
|
-
}
|
|
659
|
-
// Return null to indicate no change to state
|
|
660
|
-
return null;
|
|
661
|
-
}));
|
|
662
|
-
/* harmony default export */ const ie = oe;
|
|
627
|
+
re(ue, "propTypes", ae);
|
|
628
|
+
re(ue, "defaultProps", le);
|
|
629
|
+
re(ue, "Panel", X);
|
|
630
|
+
/* harmony default export */ const ce = ue;
|
|
663
631
|
// CONCATENATED MODULE: ./src/SlidingPanels/index.ts
|
|
664
632
|
module.exports = t;
|
|
665
633
|
/******/})();
|