@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.
Files changed (136) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +151 -169
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +28 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +371 -412
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +266 -303
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1589 -1902
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +50 -58
  57. package/Scroll.js +209 -244
  58. package/Search.js +379 -391
  59. package/Select.js +1077 -1345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +176 -205
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +379 -493
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +14 -14
  82. package/types/src/Button/Button.d.ts +5 -1
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +2 -2
  86. package/types/src/Color/Palette.d.ts +4 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -2
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Menu/Item.d.ts +18 -5
  93. package/types/src/Menu/Menu.d.ts +3 -3
  94. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  95. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  96. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  97. package/types/src/Multiselect/Option.d.ts +2 -0
  98. package/types/src/Number/Number.d.ts +3 -3
  99. package/types/src/Popover/Popover.d.ts +3 -4
  100. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  101. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  102. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  103. package/types/src/Search/Option.d.ts +9 -3
  104. package/types/src/Select/Option.d.ts +3 -1
  105. package/types/src/Select/OptionBase.d.ts +7 -5
  106. package/types/src/Select/Select.d.ts +1 -1
  107. package/types/src/Select/SelectAllOption.d.ts +4 -4
  108. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  109. package/types/src/Slider/Slider.d.ts +2 -2
  110. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  111. package/types/src/StepBar/Step.d.ts +1 -2
  112. package/types/src/Switch/Switch.d.ts +0 -1
  113. package/types/src/TabBar/Tab.d.ts +1 -1
  114. package/types/src/TabBar/TabBar.d.ts +3 -1
  115. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  116. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  117. package/types/src/Table/Table.d.ts +0 -1
  118. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  119. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  120. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  121. package/types/src/Text/Text.d.ts +2 -2
  122. package/types/src/TextArea/TextArea.d.ts +2 -2
  123. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  124. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  125. package/useForceUpdate.js +30 -32
  126. package/useKeyPress.js +1 -1
  127. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  128. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  129. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  130. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  131. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  132. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  133. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  134. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  135. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  136. /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 */ W,
65
- default: () => /* reexport */ ie
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 y = require("react-spring");
86
+ const v = require("react-spring");
87
87
  // CONCATENATED MODULE: external "@splunk/react-ui/Animation"
88
- const v = require("@splunk/react-ui/Animation");
88
+ const y = require("@splunk/react-ui/Animation");
89
89
  // CONCATENATED MODULE: external "styled-components"
90
- const m = require("styled-components");
91
- var h = e.n(m);
90
+ const b = require("styled-components");
91
+ var m = e.n(b);
92
92
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
93
- const b = require("@splunk/react-ui/Box");
94
- var g = e.n(b);
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 = h()((0, y.animated)(g())).withConfig({
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 = h()(y.animated.div).withConfig({
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
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
129
- S = function e(t) {
130
- return typeof t;
131
- };
132
- } else {
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 I() {
140
- I = Object.assign || function(e) {
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
- if (Object.prototype.hasOwnProperty.call(n, r)) {
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 _(e, t) {
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 E(e, t) {
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 || false;
162
- r.configurable = true;
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 R(e, t, n) {
168
- if (t) E(e.prototype, t);
169
- if (n) E(e, n);
170
- return e;
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 k(e, t) {
173
- if (typeof t !== "function" && t !== null) {
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: true,
180
- configurable: true
165
+ writable: !0,
166
+ configurable: !0
181
167
  }
182
- });
183
- if (t) q(e, t);
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 || function e(t, n) {
187
- t.__proto__ = n;
188
- return t;
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 = x();
194
- return function n() {
195
- var r = M(e), o;
178
+ var t = M();
179
+ return function() {
180
+ var n, r = x(e);
196
181
  if (t) {
197
- var i = M(this).constructor;
198
- o = Reflect.construct(r, arguments, i);
199
- } else {
200
- o = r.apply(this, arguments);
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) === "object" || typeof t === "function")) {
207
- return t;
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 T(e) {
212
- if (e === void 0) {
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 x() {
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
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
223
- return true;
224
- } catch (e) {
225
- return false;
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 M(e) {
229
- M = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
230
- return t.__proto__ || Object.getPrototypeOf(t);
231
- };
232
- return M(e);
233
- }
234
- function D(e, t, n) {
235
- if (t in e) {
236
- Object.defineProperty(e, t, {
237
- value: n,
238
- enumerable: true,
239
- configurable: true,
240
- writable: true
241
- });
242
- } else {
243
- e[t] = n;
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 U = {
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 N = {};
248
+ var L = {};
264
249
  /**
265
250
  * Container for arbitrary content.
266
- */ var L = function(e) {
267
- k(n, e);
251
+ */ var W = function(e) {
252
+ T(n, e);
268
253
  var t = A(n);
269
254
  function n() {
270
255
  var e;
271
- _(this, n);
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
- D(T(e), "el", null);
277
- D(T(e), "handleMount", (function(t) {
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
- R(n, [ {
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, I({
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
- D(L, "propTypes", U);
323
- D(L, "defaultProps", N);
324
- /* harmony default export */ const W = L;
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 X(e) {
314
+ function H(e) {
327
315
  "@babel/helpers - typeof";
328
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
329
- X = function e(t) {
330
- return typeof t;
331
- };
332
- } else {
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 H() {
340
- H = Object.assign || function(e) {
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
- if (Object.prototype.hasOwnProperty.call(n, r)) {
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 B(e, t) {
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
- if (t) r = r.filter((function(t) {
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 V(e) {
343
+ function z(e) {
365
344
  for (var t = 1; t < arguments.length; t++) {
366
- var n = arguments[t] != null ? arguments[t] : {};
367
- if (t % 2) {
368
- B(Object(n), true).forEach((function(t) {
369
- te(e, t, n[t]);
370
- }));
371
- } else if (Object.getOwnPropertyDescriptors) {
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 F(e, t) {
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 z(e, t) {
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 || false;
390
- r.configurable = true;
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 G(e, t, n) {
396
- if (t) z(e.prototype, t);
397
- if (n) z(e, n);
398
- return e;
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 J(e, t) {
401
- if (typeof t !== "function" && t !== null) {
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: true,
408
- configurable: true
374
+ writable: !0,
375
+ configurable: !0
409
376
  }
410
- });
411
- if (t) K(e, t);
377
+ }), Object.defineProperty(e, "prototype", {
378
+ writable: !1
379
+ }), t && Y(e, t);
412
380
  }
413
- function K(e, t) {
414
- K = Object.setPrototypeOf || function e(t, n) {
415
- t.__proto__ = n;
416
- return t;
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 Q(e) {
421
- var t = $();
422
- return function n() {
423
- var r = ee(e), o;
386
+ function Z(e) {
387
+ var t = te();
388
+ return function() {
389
+ var n, r = ne(e);
424
390
  if (t) {
425
- var i = ee(this).constructor;
426
- o = Reflect.construct(r, arguments, i);
427
- } else {
428
- o = r.apply(this, arguments);
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 Y(e, t) {
434
- if (t && (X(t) === "object" || typeof t === "function")) {
435
- return t;
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 Z(e) {
440
- if (e === void 0) {
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
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
451
- return true;
452
- } catch (e) {
453
- return false;
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 ee(e) {
457
- ee = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
458
- return t.__proto__ || Object.getPrototypeOf(t);
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 te(e, t, n) {
463
- if (t in e) {
464
- Object.defineProperty(e, t, {
465
- value: n,
466
- enumerable: true,
467
- configurable: true,
468
- writable: true
469
- });
470
- } else {
471
- e[t] = n;
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 ne = {
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 re = {
452
+ var le = {
487
453
  transition: "forward"
488
454
  };
489
- var oe = function(e) {
490
- J(o, e);
491
- var t = Q(o);
492
- // @docs-props-type SlidingPanelsPropsBase
493
- function o(e) {
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
- F(this, o);
478
+ G(this, o);
496
479
  i = t.call(this, e);
497
- te(Z(i), "panelInstances", {});
498
- te(Z(i), "allowAnimationUpdates", true);
499
- te(Z(i), "willEnter", (function() {
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
- te(Z(i), "willLeave", (function(e) {
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
- te(Z(i), "handlePanelMount", (function(e) {
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
- te(Z(i), "handlePanelUnmount", (function(e) {
506
+ re(ee(i), "handlePanelUnmount", (function(e) {
524
507
  delete i.panelInstances[e.props.panelId];
525
508
  }));
526
- te(Z(i), "handleAnimationEnd", (function() {
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
- te(Z(i), "renderPanel", (function(e, t, o) {
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
- // TODO: Fix Interplation<string | number> can't be cast to string
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(y.animated.div, {
528
+ var p = s ? r().createElement(v.animated.div, {
546
529
  style: e
547
530
  }, (0, n.cloneElement)(s, {
548
- style: V(V({}, s.props.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
- te(Z(i), "renderOuterContainer", (function(e) {
557
- var t = i.props, a = t.activePanelId, u = t.children, s = t.elementRef, p = t.outerClassName, m = t.outerStyle, h = t.innerClassName, b = t.innerStyle;
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 = V(V({}, m), g ? {
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 I = S.map((function(e) {
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, H({
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(v.Transition, {
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
- }, (// eslint-disable-next-line @typescript-eslint/no-explicit-any
575
+ }, (
576
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
593
577
  function(e, t) {
594
578
 
595
- return r().createElement(y.animated.div, {
596
- style: b,
597
- className: h
598
- }, i.renderPanel(e, t, I));
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
- G(o, [ {
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
- // When a new panel is loading, the activePanel is about to be removed. The height and/or
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(v.Spring, {
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
- te(oe, "propTypes", ne);
645
- te(oe, "defaultProps", re);
646
- te(oe, "Panel", W);
647
- te(oe, "getDerivedStateFromProps", (function(e, t) {
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
  /******/})();