@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.
- package/Accordion.js +425 -441
- package/Anchor.js +147 -193
- package/Animation.js +142 -166
- package/AnimationToggle.js +197 -253
- package/Box.js +145 -194
- package/Breadcrumbs.js +288 -298
- package/Button.js +488 -613
- package/ButtonGroup.js +160 -212
- package/ButtonSimple.js +543 -562
- package/CHANGELOG.md +26 -0
- package/Calendar.js +1107 -1195
- package/Card.js +771 -746
- package/CardLayout.js +205 -223
- package/Chip.js +509 -612
- package/Clickable.js +416 -472
- package/CloseButton.js +165 -250
- package/Code.js +1808 -2172
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -675
- package/Color.js +1066 -1297
- package/ColumnLayout.js +402 -465
- package/ComboBox.js +892 -969
- package/Concertina.js +998 -963
- package/ControlGroup.js +687 -718
- package/Date.js +567 -697
- package/DefinitionList.js +308 -310
- package/Divider.js +149 -194
- package/Dropdown.js +459 -558
- package/DualListbox.js +1480 -1735
- package/EventListener.js +94 -165
- package/File.js +1051 -1173
- package/FormRows.js +885 -880
- package/Heading.js +216 -263
- package/Image.js +446 -558
- package/JSONTree.js +690 -699
- package/Layer.js +442 -582
- package/Link.js +336 -361
- package/List.js +213 -237
- package/Markdown.js +510 -612
- package/Menu.js +1109 -1331
- package/Message.js +474 -629
- package/MessageBar.js +387 -561
- package/Modal.js +810 -798
- package/ModalLayer.js +326 -343
- package/Monogram.js +308 -368
- package/Multiselect.js +3558 -3998
- package/Number.js +729 -843
- package/Paginator.js +510 -615
- package/Paragraph.js +145 -188
- package/Popover.js +1470 -1693
- package/Progress.js +301 -362
- package/RadioBar.js +610 -651
- package/RadioList.js +483 -544
- package/Resize.js +530 -623
- package/ResultsMenu.js +494 -597
- package/ScreenReaderContent.js +142 -187
- package/Scroll.js +595 -598
- package/ScrollContainerContext.js +197 -278
- package/Search.js +745 -817
- package/Select.js +2441 -2746
- package/SidePanel.js +390 -392
- package/Slider.js +668 -825
- package/SlidingPanels.js +639 -645
- package/SplitButton.js +464 -499
- package/StaticContent.js +161 -217
- package/StepBar.js +386 -466
- package/Switch.js +710 -764
- package/TabBar.js +724 -815
- package/TabLayout.js +406 -438
- package/Table.js +4842 -5121
- package/Text.js +1169 -1351
- package/TextArea.js +1097 -1307
- package/Tooltip.js +624 -721
- package/TransitionOpen.js +489 -546
- package/Typography.js +176 -229
- package/WaitSpinner.js +230 -298
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +112 -146
- package/useKeyPress.js +74 -128
- package/usePrevious.js +65 -129
- package/useRovingFocus.js +122 -218
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/SlidingPanels.js
CHANGED
|
@@ -1,671 +1,665 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
/******/
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
/******/
|
|
48
|
-
/******/
|
|
49
|
-
/******/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/******/
|
|
53
|
-
/******/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/******/
|
|
57
|
-
/******/
|
|
58
|
-
/******/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
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
|
-
|
|
271
|
-
};
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
/**
|
|
261
|
+
onUnmount: i().func
|
|
262
|
+
};
|
|
263
|
+
var N = {};
|
|
264
|
+
/**
|
|
275
265
|
* Container for arbitrary content.
|
|
276
|
-
*/
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
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
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
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
|
+
/******/})();
|