@splunk/react-ui 4.20.0 → 4.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/SlidingPanels.js CHANGED
@@ -1,671 +1,665 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 207);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 10:
105
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
106
-
107
- "use strict";
108
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
109
- /**
1
+ /******/ (() => {
2
+ // webpackBootstrap
3
+ /******/ "use strict";
4
+ /******/ // The require scope
5
+ /******/ var e = {};
6
+ /******/
7
+ /************************************************************************/
8
+ /******/ /* webpack/runtime/compat get default export */
9
+ /******/ (() => {
10
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
11
+ /******/ e.n = t => {
12
+ /******/ var n = t && t.__esModule ?
13
+ /******/ () => t["default"]
14
+ /******/ : () => t
15
+ /******/;
16
+ e.d(n, {
17
+ a: n
18
+ });
19
+ /******/ return n;
20
+ /******/ };
21
+ /******/ })();
22
+ /******/
23
+ /******/ /* webpack/runtime/define property getters */
24
+ /******/ (() => {
25
+ /******/ // define getter functions for harmony exports
26
+ /******/ e.d = (t, n) => {
27
+ /******/ for (var r in n) {
28
+ /******/ if (e.o(n, r) && !e.o(t, r)) {
29
+ /******/ Object.defineProperty(t, r, {
30
+ enumerable: true,
31
+ get: n[r]
32
+ });
33
+ /******/ }
34
+ /******/ }
35
+ /******/ };
36
+ /******/ })();
37
+ /******/
38
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
39
+ /******/ (() => {
40
+ /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
41
+ /******/;
42
+ })();
43
+ /******/
44
+ /******/ /* webpack/runtime/make namespace object */
45
+ /******/ (() => {
46
+ /******/ // define __esModule on exports
47
+ /******/ e.r = e => {
48
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
49
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
50
+ value: "Module"
51
+ });
52
+ /******/ }
53
+ /******/ Object.defineProperty(e, "__esModule", {
54
+ value: true
55
+ });
56
+ /******/ };
57
+ /******/ })();
58
+ /******/
59
+ /************************************************************************/ var t = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(t);
62
+ // EXPORTS
63
+ e.d(t, {
64
+ Panel: () => /* reexport */ W,
65
+ default: () => /* reexport */ ie
66
+ });
67
+ // CONCATENATED MODULE: external "react"
68
+ const n = require("react");
69
+ var r = e.n(n);
70
+ // CONCATENATED MODULE: external "prop-types"
71
+ const o = require("prop-types");
72
+ var i = e.n(o);
73
+ // CONCATENATED MODULE: external "lodash/filter"
74
+ const a = require("lodash/filter");
75
+ var l = e.n(a);
76
+ // CONCATENATED MODULE: external "lodash/keys"
77
+ const u = require("lodash/keys");
78
+ var c = e.n(u);
79
+ // CONCATENATED MODULE: external "lodash/omit"
80
+ const s = require("lodash/omit");
81
+ var f = e.n(s);
82
+ // CONCATENATED MODULE: external "lodash/values"
83
+ const p = require("lodash/values");
84
+ var d = e.n(p);
85
+ // CONCATENATED MODULE: external "react-spring"
86
+ const y = require("react-spring");
87
+ // CONCATENATED MODULE: external "@splunk/react-ui/Animation"
88
+ const v = require("@splunk/react-ui/Animation");
89
+ // CONCATENATED MODULE: external "styled-components"
90
+ const m = require("styled-components");
91
+ var h = e.n(m);
92
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
93
+ const b = require("@splunk/react-ui/Box");
94
+ var g = e.n(b);
95
+ // CONCATENATED MODULE: external "@splunk/themes"
96
+ const O = require("@splunk/themes");
97
+ // CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanelsStyles.ts
98
+ var P = h()((0, y.animated)(g())).withConfig({
99
+ displayName: "SlidingPanelsStyles__StyledBox",
100
+ componentId: "su6isq-0"
101
+ })([ "overflow:hidden;position:relative;" ]);
102
+ var w = h()(y.animated.div).withConfig({
103
+ displayName: "SlidingPanelsStyles__Styled",
104
+ componentId: "su6isq-1"
105
+ })([ "", ";", ";" ], O.mixins.reset("block"), O.mixins.clearfix());
106
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
107
+ /**
110
108
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
111
109
  *
112
110
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
113
111
  * @param current - The new value of the ref.
114
112
  */
115
- function updateReactRef(ref, current) {
116
- if (ref) {
117
- if (typeof ref === 'function') {
118
- ref(current);
119
- } else {
120
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
121
- // the intention here is to signal "we will take care of setting 'current', not you".
122
- ref.current = current; // eslint-disable-line no-param-reassign
113
+ function j(e, t) {
114
+ if (e) {
115
+ if (typeof e === "function") {
116
+ e(t);
117
+ } else {
118
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
119
+ // the intention here is to signal "we will take care of setting 'current', not you".
120
+ e.current = t;
121
+ // eslint-disable-line no-param-reassign
122
+ }
123
+ }
124
+ }
125
+ // CONCATENATED MODULE: ./src/SlidingPanels/Panel.tsx
126
+ function S(e) {
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);
138
+ }
139
+ function I() {
140
+ I = Object.assign || function(e) {
141
+ for (var t = 1; t < arguments.length; t++) {
142
+ var n = arguments[t];
143
+ for (var r in n) {
144
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
145
+ e[r] = n[r];
146
+ }
147
+ }
148
+ }
149
+ return e;
150
+ };
151
+ return I.apply(this, arguments);
152
+ }
153
+ function _(e, t) {
154
+ if (!(e instanceof t)) {
155
+ throw new TypeError("Cannot call a class as a function");
156
+ }
157
+ }
158
+ function E(e, t) {
159
+ for (var n = 0; n < t.length; n++) {
160
+ 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);
165
+ }
166
+ }
167
+ function R(e, t, n) {
168
+ if (t) E(e.prototype, t);
169
+ if (n) E(e, n);
170
+ return e;
171
+ }
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
+ }
176
+ e.prototype = Object.create(t && t.prototype, {
177
+ constructor: {
178
+ value: e,
179
+ writable: true,
180
+ configurable: true
181
+ }
182
+ });
183
+ if (t) q(e, t);
184
+ }
185
+ 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);
123
191
  }
124
- }
125
- }
126
-
127
-
128
-
129
- /***/ }),
130
-
131
- /***/ 157:
132
- /***/ (function(module, exports) {
133
-
134
- module.exports = require("lodash/filter");
135
-
136
- /***/ }),
137
-
138
- /***/ 158:
139
- /***/ (function(module, exports) {
140
-
141
- module.exports = require("lodash/values");
142
-
143
- /***/ }),
144
-
145
- /***/ 2:
146
- /***/ (function(module, exports) {
147
-
148
- module.exports = require("react");
149
-
150
- /***/ }),
151
-
152
- /***/ 207:
153
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
154
-
155
- "use strict";
156
- // ESM COMPAT FLAG
157
- __webpack_require__.r(__webpack_exports__);
158
-
159
- // EXPORTS
160
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_SlidingPanels_SlidingPanels; });
161
- __webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ SlidingPanels_Panel; });
162
-
163
- // EXTERNAL MODULE: external "react"
164
- var external_react_ = __webpack_require__(2);
165
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
166
-
167
- // EXTERNAL MODULE: external "prop-types"
168
- var external_prop_types_ = __webpack_require__(1);
169
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
170
-
171
- // EXTERNAL MODULE: external "lodash/filter"
172
- var filter_ = __webpack_require__(157);
173
- var filter_default = /*#__PURE__*/__webpack_require__.n(filter_);
174
-
175
- // EXTERNAL MODULE: external "lodash/keys"
176
- var keys_ = __webpack_require__(9);
177
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
178
-
179
- // EXTERNAL MODULE: external "lodash/omit"
180
- var omit_ = __webpack_require__(5);
181
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
182
-
183
- // EXTERNAL MODULE: external "lodash/values"
184
- var values_ = __webpack_require__(158);
185
- var values_default = /*#__PURE__*/__webpack_require__.n(values_);
186
-
187
- // EXTERNAL MODULE: external "react-spring"
188
- var external_react_spring_ = __webpack_require__(24);
189
-
190
- // EXTERNAL MODULE: external "@splunk/react-ui/Animation"
191
- var Animation_ = __webpack_require__(43);
192
-
193
- // EXTERNAL MODULE: external "styled-components"
194
- var external_styled_components_ = __webpack_require__(3);
195
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
196
-
197
- // EXTERNAL MODULE: external "@splunk/react-ui/Box"
198
- var Box_ = __webpack_require__(6);
199
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
200
-
201
- // EXTERNAL MODULE: external "@splunk/themes"
202
- var themes_ = __webpack_require__(0);
203
-
204
- // CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanelsStyles.ts
205
-
206
-
207
-
208
-
209
- var StyledBox = external_styled_components_default()(Object(external_react_spring_["animated"])(Box_default.a)).withConfig({
210
- displayName: "SlidingPanelsStyles__StyledBox",
211
- componentId: "su6isq-0"
212
- })(["overflow:hidden;position:relative;"]);
213
- var Styled = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({
214
- displayName: "SlidingPanelsStyles__Styled",
215
- componentId: "su6isq-1"
216
- })(["", ";", ";"], themes_["mixins"].reset('block'), themes_["mixins"].clearfix());
217
-
218
- // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
219
- var updateReactRef = __webpack_require__(10);
220
-
221
- // CONCATENATED MODULE: ./src/SlidingPanels/Panel.tsx
222
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
223
-
224
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
225
-
226
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
227
-
228
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
229
-
230
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
231
-
232
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
233
-
234
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
235
-
236
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
237
-
238
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
239
-
240
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
241
-
242
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
243
-
244
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
245
-
246
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- var propTypes = {
255
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
256
- panelId: external_prop_types_default.a.any.isRequired,
257
-
258
- /**
192
+ function A(e) {
193
+ var t = x();
194
+ return function n() {
195
+ var r = M(e), o;
196
+ 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);
203
+ };
204
+ }
205
+ function C(e, t) {
206
+ if (t && (S(t) === "object" || typeof t === "function")) {
207
+ return t;
208
+ }
209
+ return T(e);
210
+ }
211
+ function T(e) {
212
+ if (e === void 0) {
213
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
214
+ }
215
+ return e;
216
+ }
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;
221
+ try {
222
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
223
+ return true;
224
+ } catch (e) {
225
+ return false;
226
+ }
227
+ }
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;
244
+ }
245
+ return e;
246
+ }
247
+ var U = {
248
+ elementRef: i().oneOfType([ i().func, i().object ]),
249
+ panelId: i().any.isRequired,
250
+ /**
259
251
  * @private.
260
252
  * Used internally, func passed in from outer place is overwritten
261
253
  * by SlidingPanels during rendering
262
254
  */
263
- onMount: external_prop_types_default.a.func,
264
-
265
- /**
255
+ onMount: i().func,
256
+ /**
266
257
  * @private.
267
258
  * Used internally, func passed in from outer place is overwritten
268
259
  * by SlidingPanels during rendering
269
260
  */
270
- onUnmount: external_prop_types_default.a.func
271
- };
272
- var defaultProps = {};
273
-
274
- /**
261
+ onUnmount: i().func
262
+ };
263
+ var N = {};
264
+ /**
275
265
  * Container for arbitrary content.
276
- */
277
- var Panel_Panel = /*#__PURE__*/function (_Component) {
278
- _inherits(Panel, _Component);
279
-
280
- var _super = _createSuper(Panel);
281
-
282
- function Panel() {
283
- var _this;
284
-
285
- _classCallCheck(this, Panel);
286
-
287
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
288
- args[_key] = arguments[_key];
266
+ */ var L = function(e) {
267
+ k(n, e);
268
+ var t = A(n);
269
+ function n() {
270
+ var e;
271
+ _(this, n);
272
+ for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) {
273
+ o[i] = arguments[i];
274
+ }
275
+ e = t.call.apply(t, [ this ].concat(o));
276
+ D(T(e), "el", null);
277
+ D(T(e), "handleMount", (function(t) {
278
+ e.el = t;
279
+ j(e.props.elementRef, t);
280
+ }));
281
+ return e;
282
+ }
283
+ R(n, [ {
284
+ key: "componentDidMount",
285
+ value: function e() {
286
+ var t, n;
287
+ (t = (n = this.props).onMount) === null || t === void 0 ? void 0 : t.call(n, this);
288
+ }
289
+ }, {
290
+ key: "componentWillUnmount",
291
+ value: function e() {
292
+ var t, n;
293
+ (t = (n = this.props).onUnmount) === null || t === void 0 ? void 0 : t.call(n, this);
294
+ }
295
+ }, {
296
+ key: "getHeight",
297
+ value: function e() {
298
+ var t;
299
+ return (t = this.el) === null || t === void 0 ? void 0 : t.clientHeight;
300
+ }
301
+ }, {
302
+ key: "getWidth",
303
+ value: function e() {
304
+ var t;
305
+ return (t = this.el) === null || t === void 0 ? void 0 : t.clientWidth;
306
+ }
307
+ }, {
308
+ key: "render",
309
+ value: function e() {
310
+ var t = this.props.panelId;
311
+
312
+ return r().createElement(w, I({
313
+ "data-test": "panel",
314
+ "data-test-panel-id": t
315
+ }, f()(this.props, c()(n.propTypes)), {
316
+ ref: this.handleMount
317
+ }));
318
+ }
319
+ } ]);
320
+ return n;
321
+ }(n.Component);
322
+ D(L, "propTypes", U);
323
+ D(L, "defaultProps", N);
324
+ /* harmony default export */ const W = L;
325
+ // CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanels.tsx
326
+ function X(e) {
327
+ "@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);
289
338
  }
290
-
291
- _this = _super.call.apply(_super, [this].concat(args));
292
-
293
- _defineProperty(_assertThisInitialized(_this), "el", null);
294
-
295
- _defineProperty(_assertThisInitialized(_this), "handleMount", function (el) {
296
- _this.el = el;
297
- Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
298
- });
299
-
300
- return _this;
301
- }
302
-
303
- _createClass(Panel, [{
304
- key: "componentDidMount",
305
- value: function componentDidMount() {
306
- var _this$props$onMount, _this$props;
307
-
308
- (_this$props$onMount = (_this$props = this.props).onMount) === null || _this$props$onMount === void 0 ? void 0 : _this$props$onMount.call(_this$props, this);
339
+ function H() {
340
+ H = Object.assign || function(e) {
341
+ for (var t = 1; t < arguments.length; t++) {
342
+ var n = arguments[t];
343
+ for (var r in n) {
344
+ if (Object.prototype.hasOwnProperty.call(n, r)) {
345
+ e[r] = n[r];
346
+ }
347
+ }
348
+ }
349
+ return e;
350
+ };
351
+ return H.apply(this, arguments);
309
352
  }
310
- }, {
311
- key: "componentWillUnmount",
312
- value: function componentWillUnmount() {
313
- var _this$props$onUnmount, _this$props2;
314
-
315
- (_this$props$onUnmount = (_this$props2 = this.props).onUnmount) === null || _this$props$onUnmount === void 0 ? void 0 : _this$props$onUnmount.call(_this$props2, this);
353
+ function B(e, t) {
354
+ var n = Object.keys(e);
355
+ if (Object.getOwnPropertySymbols) {
356
+ var r = Object.getOwnPropertySymbols(e);
357
+ if (t) r = r.filter((function(t) {
358
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
359
+ }));
360
+ n.push.apply(n, r);
361
+ }
362
+ return n;
316
363
  }
317
- }, {
318
- key: "getHeight",
319
- value: function getHeight() {
320
- var _this$el;
321
-
322
- return (_this$el = this.el) === null || _this$el === void 0 ? void 0 : _this$el.clientHeight;
364
+ function V(e) {
365
+ 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
+ }
378
+ }
379
+ return e;
323
380
  }
324
- }, {
325
- key: "getWidth",
326
- value: function getWidth() {
327
- var _this$el2;
328
-
329
- return (_this$el2 = this.el) === null || _this$el2 === void 0 ? void 0 : _this$el2.clientWidth;
381
+ function F(e, t) {
382
+ if (!(e instanceof t)) {
383
+ throw new TypeError("Cannot call a class as a function");
384
+ }
330
385
  }
331
- }, {
332
- key: "render",
333
- value: function render() {
334
- var panelId = this.props.panelId;
335
- return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
336
- "data-test": "panel",
337
- "data-test-panel-id": panelId
338
- }, omit_default()(this.props, keys_default()(Panel.propTypes)), {
339
- ref: this.handleMount
340
- }));
386
+ function z(e, t) {
387
+ for (var n = 0; n < t.length; n++) {
388
+ 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);
393
+ }
341
394
  }
342
- }]);
343
-
344
- return Panel;
345
- }(external_react_["Component"]);
346
-
347
- _defineProperty(Panel_Panel, "propTypes", propTypes);
348
-
349
- _defineProperty(Panel_Panel, "defaultProps", defaultProps);
350
-
351
- /* harmony default export */ var SlidingPanels_Panel = (Panel_Panel);
352
- // CONCATENATED MODULE: ./src/SlidingPanels/SlidingPanels.tsx
353
- function SlidingPanels_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SlidingPanels_typeof = function _typeof(obj) { return typeof obj; }; } else { SlidingPanels_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SlidingPanels_typeof(obj); }
354
-
355
- function SlidingPanels_extends() { SlidingPanels_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return SlidingPanels_extends.apply(this, arguments); }
356
-
357
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
358
-
359
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { SlidingPanels_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
360
-
361
- function SlidingPanels_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
362
-
363
- function SlidingPanels_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
364
-
365
- function SlidingPanels_createClass(Constructor, protoProps, staticProps) { if (protoProps) SlidingPanels_defineProperties(Constructor.prototype, protoProps); if (staticProps) SlidingPanels_defineProperties(Constructor, staticProps); return Constructor; }
366
-
367
- function SlidingPanels_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) SlidingPanels_setPrototypeOf(subClass, superClass); }
368
-
369
- function SlidingPanels_setPrototypeOf(o, p) { SlidingPanels_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SlidingPanels_setPrototypeOf(o, p); }
370
-
371
- function SlidingPanels_createSuper(Derived) { var hasNativeReflectConstruct = SlidingPanels_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = SlidingPanels_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = SlidingPanels_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return SlidingPanels_possibleConstructorReturn(this, result); }; }
372
-
373
- function SlidingPanels_possibleConstructorReturn(self, call) { if (call && (SlidingPanels_typeof(call) === "object" || typeof call === "function")) { return call; } return SlidingPanels_assertThisInitialized(self); }
374
-
375
- function SlidingPanels_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
376
-
377
- function SlidingPanels_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
378
-
379
- function SlidingPanels_getPrototypeOf(o) { SlidingPanels_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SlidingPanels_getPrototypeOf(o); }
380
-
381
- function SlidingPanels_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
-
391
-
392
-
393
- var SlidingPanels_propTypes = {
394
- activePanelId: external_prop_types_default.a.any.isRequired,
395
- children: external_prop_types_default.a.node,
396
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
397
- innerClassName: external_prop_types_default.a.string,
398
- innerStyle: external_prop_types_default.a.object,
399
- onAnimationEnd: external_prop_types_default.a.func,
400
- outerClassName: external_prop_types_default.a.string,
401
- outerStyle: external_prop_types_default.a.object,
402
- transition: external_prop_types_default.a.oneOf(['forward', 'backward'])
403
- };
404
- var SlidingPanels_defaultProps = {
405
- transition: 'forward'
406
- };
407
-
408
- var SlidingPanels_SlidingPanels = /*#__PURE__*/function (_Component) {
409
- SlidingPanels_inherits(SlidingPanels, _Component);
410
-
411
- var _super = SlidingPanels_createSuper(SlidingPanels);
412
-
413
- // @docs-props-type SlidingPanelsPropsBase
414
- function SlidingPanels(props) {
415
- var _this;
416
-
417
- SlidingPanels_classCallCheck(this, SlidingPanels);
418
-
419
- _this = _super.call(this, props);
420
-
421
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "panelInstances", {});
422
-
423
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "allowAnimationUpdates", true);
424
-
425
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "willEnter", function () {
426
- return {
427
- translateX: 0
428
- };
429
- });
430
-
431
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "willLeave", function (animating) {
432
- return animating ? {
433
- translateX: -1,
434
- position: 'absolute',
435
- left: 0,
436
- top: 0
437
- } : {
438
- translateX: -1
439
- };
440
- });
441
-
442
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "handlePanelMount", function (panel) {
443
- _this.panelInstances[panel.props.panelId] = panel;
444
-
445
- if (panel.props.panelId === _this.props.activePanelId) {
446
- _this.setState({
447
- activePanel: panel,
448
- panelLoading: false
449
- });
450
- }
451
- });
452
-
453
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "handlePanelUnmount", function (panel) {
454
- delete _this.panelInstances[panel.props.panelId];
455
- });
456
-
457
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "handleAnimationEnd", function () {
458
- var _this$props$onAnimati, _this$props;
459
-
460
- if (_this.allowAnimationUpdates) {
461
- _this.setState({
462
- animating: false
395
+ function G(e, t, n) {
396
+ if (t) z(e.prototype, t);
397
+ if (n) z(e, n);
398
+ return e;
399
+ }
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
+ }
404
+ e.prototype = Object.create(t && t.prototype, {
405
+ constructor: {
406
+ value: e,
407
+ writable: true,
408
+ configurable: true
409
+ }
463
410
  });
464
- }
465
-
466
- (_this$props$onAnimati = (_this$props = _this.props).onAnimationEnd) === null || _this$props$onAnimati === void 0 ? void 0 : _this$props$onAnimati.call(_this$props);
467
- });
468
-
469
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "renderPanel", function (transitionStyle, activePanelId, maxWidth) {
470
- var _transitionStyle$tran;
471
-
472
- var _this$props2 = _this.props,
473
- children = _this$props2.children,
474
- transition = _this$props2.transition;
475
- var currentPanel = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).find(function (child) {
476
- return child.props.panelId === activePanelId;
477
- }); // TODO: Fix Interplation<string | number> can't be cast to string
478
-
479
- var transform = (_transitionStyle$tran = transitionStyle.translateX) === null || _transitionStyle$tran === void 0 ? void 0 : _transitionStyle$tran.to(function (x) {
480
- return "translateX(".concat(x * maxWidth * (transition === 'forward' ? 1 : -1), "px)");
481
- });
482
- var clonedPanel = currentPanel ? /*#__PURE__*/external_react_default.a.createElement(external_react_spring_["animated"].div, {
483
- style: transitionStyle
484
- }, /*#__PURE__*/Object(external_react_["cloneElement"])(currentPanel, {
485
- style: _objectSpread(_objectSpread({}, currentPanel.props.style), {}, {
486
- transform: transform
487
- }),
488
- onMount: _this.handlePanelMount,
489
- onUnmount: _this.handlePanelUnmount
490
- })) : null;
491
- return clonedPanel;
492
- });
493
-
494
- SlidingPanels_defineProperty(SlidingPanels_assertThisInitialized(_this), "renderOuterContainer", function (interpolatedOuterStyle) {
495
- var _this$props3 = _this.props,
496
- activePanelId = _this$props3.activePanelId,
497
- children = _this$props3.children,
498
- elementRef = _this$props3.elementRef,
499
- outerClassName = _this$props3.outerClassName,
500
- outerStyle = _this$props3.outerStyle,
501
- innerClassName = _this$props3.innerClassName,
502
- innerStyle = _this$props3.innerStyle;
503
- var animating = _this.state.animating;
504
-
505
- var style = _objectSpread(_objectSpread({}, outerStyle), animating ? {
506
- width: interpolatedOuterStyle.width,
507
- height: interpolatedOuterStyle.height
508
- } : {});
509
-
510
- var currentPanel = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).find(function (child) {
511
- return child.props.panelId === activePanelId;
512
- });
513
-
514
- if (false) {}
515
-
516
- var transitionStyle = animating ? {
517
- translateX: 1
518
- } : {};
519
- var currentPanelsArr = filter_default()(values_default()(_this.panelInstances), function (panel) {
520
- return !!panel;
521
- });
522
- var maxWidth = currentPanelsArr.map(function (panel) {
523
- var _p$getWidth;
524
-
525
- var p = _this.panelInstances[panel.props.panelId];
526
- return p ? (_p$getWidth = p.getWidth()) !== null && _p$getWidth !== void 0 ? _p$getWidth : 0 : 0;
527
- }).reduce(function (max, current) {
528
- return Math.max(max, current);
529
- }, 0);
530
- return /*#__PURE__*/external_react_default.a.createElement(StyledBox, SlidingPanels_extends({
531
- className: outerClassName,
532
- "data-test-active-panel-id": activePanelId,
533
- "data-test": "sliding-panels",
534
- elementRef: elementRef,
535
- style: style
536
- }, omit_default()(_this.props, keys_default()(SlidingPanels.propTypes))), /*#__PURE__*/external_react_default.a.createElement(Animation_["Transition"], {
537
- from: transitionStyle,
538
- enter: _this.willEnter(),
539
- leave: _this.willLeave(animating),
540
- items: activePanelId
541
- }, // eslint-disable-next-line @typescript-eslint/no-explicit-any
542
- function (styles, item) {
543
- return /*#__PURE__*/external_react_default.a.createElement(external_react_spring_["animated"].div, {
544
- style: innerStyle,
545
- className: innerClassName
546
- }, _this.renderPanel(styles, item, maxWidth));
547
- }));
548
- });
549
-
550
- _this.state = {
551
- animating: false,
552
- panelLoading: false,
553
- prevActivePanelId: _this.props.activePanelId,
554
- // eslint-disable-line react/no-unused-state
555
- slidingId: 0 // eslint-disable-line react/no-unused-state
556
-
557
- };
558
- return _this;
559
- }
560
-
561
- SlidingPanels_createClass(SlidingPanels, [{
562
- key: "componentWillUnmount",
563
- value: function componentWillUnmount() {
564
- this.allowAnimationUpdates = false;
411
+ if (t) K(e, t);
412
+ }
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);
419
+ }
420
+ function Q(e) {
421
+ var t = $();
422
+ return function n() {
423
+ var r = ee(e), o;
424
+ 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);
431
+ };
432
+ }
433
+ function Y(e, t) {
434
+ if (t && (X(t) === "object" || typeof t === "function")) {
435
+ return t;
436
+ }
437
+ return Z(e);
438
+ }
439
+ function Z(e) {
440
+ if (e === void 0) {
441
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
442
+ }
443
+ return e;
444
+ }
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;
449
+ try {
450
+ Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
451
+ return true;
452
+ } catch (e) {
453
+ return false;
454
+ }
455
+ }
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);
565
461
  }
566
- }, {
567
- key: "render",
568
- value: function render() {
569
- var _this$state = this.state,
570
- activePanel = _this$state.activePanel,
571
- panelLoading = _this$state.panelLoading;
572
- var width = activePanel ? activePanel.getWidth() : 0;
573
- var height = activePanel ? activePanel.getHeight() : 0; // When a new panel is loading, the activePanel is about to be removed. The height and/or
574
- // width of that panel may have changed since the last render. To ensure that the next
575
- // panel animates from the current height and width (rather than the previously loaded one),
576
- // we only set the style when panelLoading is true (immediate prop prevents animation if true).
577
-
578
- var style = {
579
- width: width,
580
- height: height
581
- };
582
- return /*#__PURE__*/external_react_default.a.createElement(Animation_["Spring"], {
583
- to: style,
584
- onRest: this.handleAnimationEnd,
585
- immediate: panelLoading,
586
- config: {
587
- precision: 1
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;
588
472
  }
589
- },
590
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
591
- this.renderOuterContainer);
473
+ return e;
592
474
  }
593
- }]);
594
-
595
- return SlidingPanels;
596
- }(external_react_["Component"]);
597
-
598
- SlidingPanels_defineProperty(SlidingPanels_SlidingPanels, "propTypes", SlidingPanels_propTypes);
599
-
600
- SlidingPanels_defineProperty(SlidingPanels_SlidingPanels, "defaultProps", SlidingPanels_defaultProps);
601
-
602
- SlidingPanels_defineProperty(SlidingPanels_SlidingPanels, "Panel", SlidingPanels_Panel);
603
-
604
- SlidingPanels_defineProperty(SlidingPanels_SlidingPanels, "getDerivedStateFromProps", function (props, state) {
605
- if (props.activePanelId !== state.prevActivePanelId) {
606
- // instead of using panelId, assign each sliding event an id and
607
- // use it as the key to make sure new panelA will transit as expected if
608
- // old panelA has not fully left yet
609
- return {
610
- animating: true,
611
- panelLoading: true,
612
- prevActivePanelId: props.activePanelId,
613
- slidingId: state.slidingId + 1
475
+ var ne = {
476
+ activePanelId: i().any.isRequired,
477
+ children: i().node,
478
+ elementRef: i().oneOfType([ i().func, i().object ]),
479
+ innerClassName: i().string,
480
+ innerStyle: i().object,
481
+ onAnimationEnd: i().func,
482
+ outerClassName: i().string,
483
+ outerStyle: i().object,
484
+ transition: i().oneOf([ "forward", "backward" ])
614
485
  };
615
- } // Return null to indicate no change to state
616
-
617
-
618
- return null;
619
- });
620
-
621
- /* harmony default export */ var src_SlidingPanels_SlidingPanels = (SlidingPanels_SlidingPanels);
622
-
623
- // CONCATENATED MODULE: ./src/SlidingPanels/index.ts
624
-
625
-
626
-
627
- /***/ }),
628
-
629
- /***/ 24:
630
- /***/ (function(module, exports) {
631
-
632
- module.exports = require("react-spring");
633
-
634
- /***/ }),
635
-
636
- /***/ 3:
637
- /***/ (function(module, exports) {
638
-
639
- module.exports = require("styled-components");
640
-
641
- /***/ }),
642
-
643
- /***/ 43:
644
- /***/ (function(module, exports) {
645
-
646
- module.exports = require("@splunk/react-ui/Animation");
647
-
648
- /***/ }),
649
-
650
- /***/ 5:
651
- /***/ (function(module, exports) {
652
-
653
- module.exports = require("lodash/omit");
654
-
655
- /***/ }),
656
-
657
- /***/ 6:
658
- /***/ (function(module, exports) {
659
-
660
- module.exports = require("@splunk/react-ui/Box");
661
-
662
- /***/ }),
663
-
664
- /***/ 9:
665
- /***/ (function(module, exports) {
666
-
667
- module.exports = require("lodash/keys");
668
-
669
- /***/ })
670
-
671
- /******/ });
486
+ var re = {
487
+ transition: "forward"
488
+ };
489
+ var oe = function(e) {
490
+ J(o, e);
491
+ var t = Q(o);
492
+ // @docs-props-type SlidingPanelsPropsBase
493
+ function o(e) {
494
+ var i;
495
+ F(this, o);
496
+ i = t.call(this, e);
497
+ te(Z(i), "panelInstances", {});
498
+ te(Z(i), "allowAnimationUpdates", true);
499
+ te(Z(i), "willEnter", (function() {
500
+ return {
501
+ translateX: 0
502
+ };
503
+ }));
504
+ te(Z(i), "willLeave", (function(e) {
505
+ return e ? {
506
+ translateX: -1,
507
+ position: "absolute",
508
+ left: 0,
509
+ top: 0
510
+ } : {
511
+ translateX: -1
512
+ };
513
+ }));
514
+ te(Z(i), "handlePanelMount", (function(e) {
515
+ i.panelInstances[e.props.panelId] = e;
516
+ if (e.props.panelId === i.props.activePanelId) {
517
+ i.setState({
518
+ activePanel: e,
519
+ panelLoading: false
520
+ });
521
+ }
522
+ }));
523
+ te(Z(i), "handlePanelUnmount", (function(e) {
524
+ delete i.panelInstances[e.props.panelId];
525
+ }));
526
+ te(Z(i), "handleAnimationEnd", (function() {
527
+ var e, t;
528
+ if (i.allowAnimationUpdates) {
529
+ i.setState({
530
+ animating: false
531
+ });
532
+ }
533
+ (e = (t = i.props).onAnimationEnd) === null || e === void 0 ? void 0 : e.call(t);
534
+ }));
535
+ te(Z(i), "renderPanel", (function(e, t, o) {
536
+ var a;
537
+ var l = i.props, u = l.children, c = l.transition;
538
+ var s = n.Children.toArray(u).filter(n.isValidElement).find((function(e) {
539
+ return e.props.panelId === t;
540
+ }));
541
+ // TODO: Fix Interplation<string | number> can't be cast to string
542
+ var f = (a = e.translateX) === null || a === void 0 ? void 0 : a.to((function(e) {
543
+ return "translateX(".concat(e * o * (c === "forward" ? 1 : -1), "px)");
544
+ }));
545
+ var p = s ? r().createElement(y.animated.div, {
546
+ style: e
547
+ }, (0, n.cloneElement)(s, {
548
+ style: V(V({}, s.props.style), {}, {
549
+ transform: f
550
+ }),
551
+ onMount: i.handlePanelMount,
552
+ onUnmount: i.handlePanelUnmount
553
+ })) : null;
554
+ return p;
555
+ }));
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;
558
+ var g = i.state.animating;
559
+ var O = V(V({}, m), g ? {
560
+ width: e.width,
561
+ height: e.height
562
+ } : {});
563
+ var w = n.Children.toArray(u).filter(n.isValidElement).find((function(e) {
564
+ return e.props.panelId === a;
565
+ }));
566
+ if (false) {}
567
+ var j = g ? {
568
+ translateX: 1
569
+ } : {};
570
+ var S = l()(d()(i.panelInstances), (function(e) {
571
+ return !!e;
572
+ }));
573
+ var I = S.map((function(e) {
574
+ var t;
575
+ var n = i.panelInstances[e.props.panelId];
576
+ return n ? (t = n.getWidth()) !== null && t !== void 0 ? t : 0 : 0;
577
+ })).reduce((function(e, t) {
578
+ return Math.max(e, t);
579
+ }), 0);
580
+
581
+ return r().createElement(P, H({
582
+ className: p,
583
+ "data-test-active-panel-id": a,
584
+ "data-test": "sliding-panels",
585
+ elementRef: s,
586
+ style: O
587
+ }, f()(i.props, c()(o.propTypes))), r().createElement(v.Transition, {
588
+ from: j,
589
+ enter: i.willEnter(),
590
+ leave: i.willLeave(g),
591
+ items: a
592
+ }, (// eslint-disable-next-line @typescript-eslint/no-explicit-any
593
+ function(e, t) {
594
+
595
+ return r().createElement(y.animated.div, {
596
+ style: b,
597
+ className: h
598
+ }, i.renderPanel(e, t, I));
599
+ })));
600
+ }));
601
+ i.state = {
602
+ animating: false,
603
+ panelLoading: false,
604
+ prevActivePanelId: i.props.activePanelId,
605
+ // eslint-disable-line react/no-unused-state
606
+ slidingId: 0
607
+ };
608
+ return i;
609
+ }
610
+ G(o, [ {
611
+ key: "componentWillUnmount",
612
+ value: function e() {
613
+ this.allowAnimationUpdates = false;
614
+ }
615
+ }, {
616
+ key: "render",
617
+ value: function e() {
618
+ var t = this.state, n = t.activePanel, o = t.panelLoading;
619
+ var i = n ? n.getWidth() : 0;
620
+ var a = n ? n.getHeight() : 0;
621
+ // When a new panel is loading, the activePanel is about to be removed. The height and/or
622
+ // width of that panel may have changed since the last render. To ensure that the next
623
+ // panel animates from the current height and width (rather than the previously loaded one),
624
+ // we only set the style when panelLoading is true (immediate prop prevents animation if true).
625
+ var l = {
626
+ width: i,
627
+ height: a
628
+ };
629
+
630
+ return r().createElement(v.Spring, {
631
+ to: l,
632
+ onRest: this.handleAnimationEnd,
633
+ immediate: o,
634
+ config: {
635
+ precision: 1
636
+ }
637
+ },
638
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
639
+ this.renderOuterContainer);
640
+ }
641
+ } ]);
642
+ return o;
643
+ }(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;
663
+ // CONCATENATED MODULE: ./src/SlidingPanels/index.ts
664
+ module.exports = t;
665
+ /******/})();