@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/Concertina.js
CHANGED
|
@@ -1,975 +1,1010 @@
|
|
|
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
|
-
|
|
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 */ Pe,
|
|
65
|
+
default: () => /* reexport */ Ve
|
|
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/debounce"
|
|
74
|
+
const a = require("lodash/debounce");
|
|
75
|
+
var l = e.n(a);
|
|
76
|
+
// CONCATENATED MODULE: external "lodash/take"
|
|
77
|
+
const s = require("lodash/take");
|
|
78
|
+
var c = e.n(s);
|
|
79
|
+
// CONCATENATED MODULE: external "lodash/takeRight"
|
|
80
|
+
const u = require("lodash/takeRight");
|
|
81
|
+
var f = e.n(u);
|
|
82
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
83
|
+
const p = require("@splunk/react-ui/EventListener");
|
|
84
|
+
var d = e.n(p);
|
|
85
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
86
|
+
const h = require("lodash/keys");
|
|
87
|
+
var y = e.n(h);
|
|
88
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
89
|
+
const b = require("lodash/omit");
|
|
90
|
+
var v = e.n(b);
|
|
91
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
92
|
+
const g = require("styled-components");
|
|
93
|
+
var m = e.n(g);
|
|
94
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
95
|
+
const k = require("@splunk/react-ui/Clickable");
|
|
96
|
+
var S = e.n(k);
|
|
97
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
98
|
+
const w = require("@splunk/themes");
|
|
99
|
+
// CONCATENATED MODULE: ./src/Concertina/HeadingStyles.ts
|
|
100
|
+
var C = m()(S()).withConfig({
|
|
101
|
+
displayName: "HeadingStyles__StyledClickable",
|
|
102
|
+
componentId: "sc-1h92oaj-0"
|
|
103
|
+
})([ "display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", "" ], w.variables.spacing, w.variables.lineHeight, w.variables.textColor, (0,
|
|
104
|
+
w.pickVariant)("$inner", {
|
|
105
|
+
true: (0, g.css)([ "*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}" ], w.variables.backgroundColor, w.variables.backgroundColor),
|
|
106
|
+
false: (0, g.css)([ "& + &&{border-top:2px solid ", ";}" ], w.variables.backgroundColor)
|
|
107
|
+
}), w.variables.focusShadowInset, (0, w.pickVariant)("$status", {
|
|
108
|
+
normal: (0, g.css)([ "background-color:", ";&:hover:not([disabled]){background-color:", ";}" ], (0,
|
|
109
|
+
w.pick)({
|
|
110
|
+
dark: w.variables.gray45,
|
|
111
|
+
light: w.variables.gray96
|
|
112
|
+
}), (0, w.pick)({
|
|
113
|
+
dark: w.variables.gray30,
|
|
114
|
+
light: w.variables.gray92
|
|
115
|
+
})),
|
|
116
|
+
disabled: (0, g.css)([ "background-color:", ";" ], (0, w.pick)({
|
|
117
|
+
dark: w.variables.gray80,
|
|
118
|
+
light: w.variables.gray96
|
|
119
|
+
})),
|
|
120
|
+
error: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}" ], w.variables.errorColor, w.variables.white, w.variables.errorColorD10),
|
|
121
|
+
warning: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}" ], w.variables.warningColor, w.variables.white, w.variables.warningColorD10)
|
|
122
|
+
}));
|
|
123
|
+
var O = m().span.withConfig({
|
|
124
|
+
displayName: "HeadingStyles__StyledHeadingContent",
|
|
125
|
+
componentId: "sc-1h92oaj-1"
|
|
126
|
+
})([ "display:flex;justify-content:space-between;" ]);
|
|
127
|
+
var P = m().span.withConfig({
|
|
128
|
+
displayName: "HeadingStyles__StyledDescription",
|
|
129
|
+
componentId: "sc-1h92oaj-2"
|
|
130
|
+
})([ "font-size:", ";" ], w.variables.fontSizeSmall);
|
|
131
|
+
// CONCATENATED MODULE: ./src/Concertina/Heading.tsx
|
|
132
|
+
function j(e) {
|
|
133
|
+
"@babel/helpers - typeof";
|
|
134
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
135
|
+
j = function e(t) {
|
|
136
|
+
return typeof t;
|
|
137
|
+
};
|
|
138
|
+
} else {
|
|
139
|
+
j = function e(t) {
|
|
140
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return j(e);
|
|
144
|
+
}
|
|
145
|
+
function E() {
|
|
146
|
+
E = Object.assign || function(e) {
|
|
147
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
148
|
+
var n = arguments[t];
|
|
149
|
+
for (var r in n) {
|
|
150
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
151
|
+
e[r] = n[r];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return e;
|
|
156
|
+
};
|
|
157
|
+
return E.apply(this, arguments);
|
|
158
|
+
}
|
|
159
|
+
function x(e, t) {
|
|
160
|
+
if (!(e instanceof t)) {
|
|
161
|
+
throw new TypeError("Cannot call a class as a function");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function _(e, t) {
|
|
165
|
+
for (var n = 0; n < t.length; n++) {
|
|
166
|
+
var r = t[n];
|
|
167
|
+
r.enumerable = r.enumerable || false;
|
|
168
|
+
r.configurable = true;
|
|
169
|
+
if ("value" in r) r.writable = true;
|
|
170
|
+
Object.defineProperty(e, r.key, r);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function H(e, t, n) {
|
|
174
|
+
if (t) _(e.prototype, t);
|
|
175
|
+
if (n) _(e, n);
|
|
176
|
+
return e;
|
|
177
|
+
}
|
|
178
|
+
function T(e, t) {
|
|
179
|
+
if (typeof t !== "function" && t !== null) {
|
|
180
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
181
|
+
}
|
|
182
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
183
|
+
constructor: {
|
|
184
|
+
value: e,
|
|
185
|
+
writable: true,
|
|
186
|
+
configurable: true
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
if (t) R(e, t);
|
|
190
|
+
}
|
|
191
|
+
function R(e, t) {
|
|
192
|
+
R = Object.setPrototypeOf || function e(t, n) {
|
|
193
|
+
t.__proto__ = n;
|
|
194
|
+
return t;
|
|
195
|
+
};
|
|
196
|
+
return R(e, t);
|
|
197
|
+
}
|
|
198
|
+
function I(e) {
|
|
199
|
+
var t = M();
|
|
200
|
+
return function n() {
|
|
201
|
+
var r = A(e), o;
|
|
202
|
+
if (t) {
|
|
203
|
+
var i = A(this).constructor;
|
|
204
|
+
o = Reflect.construct(r, arguments, i);
|
|
205
|
+
} else {
|
|
206
|
+
o = r.apply(this, arguments);
|
|
207
|
+
}
|
|
208
|
+
return q(this, o);
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function q(e, t) {
|
|
212
|
+
if (t && (j(t) === "object" || typeof t === "function")) {
|
|
213
|
+
return t;
|
|
214
|
+
}
|
|
215
|
+
return z(e);
|
|
216
|
+
}
|
|
217
|
+
function z(e) {
|
|
218
|
+
if (e === void 0) {
|
|
219
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
220
|
+
}
|
|
221
|
+
return e;
|
|
222
|
+
}
|
|
223
|
+
function M() {
|
|
224
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
225
|
+
if (Reflect.construct.sham) return false;
|
|
226
|
+
if (typeof Proxy === "function") return true;
|
|
227
|
+
try {
|
|
228
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
229
|
+
return true;
|
|
230
|
+
} catch (e) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function A(e) {
|
|
235
|
+
A = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
236
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
237
|
+
};
|
|
238
|
+
return A(e);
|
|
239
|
+
}
|
|
240
|
+
function W(e, t, n) {
|
|
241
|
+
if (t in e) {
|
|
242
|
+
Object.defineProperty(e, t, {
|
|
243
|
+
value: n,
|
|
244
|
+
enumerable: true,
|
|
245
|
+
configurable: true,
|
|
246
|
+
writable: true
|
|
247
|
+
});
|
|
248
|
+
} else {
|
|
249
|
+
e[t] = n;
|
|
250
|
+
}
|
|
251
|
+
return e;
|
|
252
|
+
}
|
|
253
|
+
var B = {
|
|
254
|
+
children: i().node.isRequired,
|
|
255
|
+
description: i().node,
|
|
256
|
+
/** @private */
|
|
257
|
+
index: i().number.isRequired,
|
|
258
|
+
/** @private */
|
|
259
|
+
onClick: i().func,
|
|
260
|
+
/** @private */
|
|
261
|
+
panelId: i().string,
|
|
262
|
+
/** @private */
|
|
263
|
+
position: i().oneOf([ "top", "inner", "bottom" ]),
|
|
264
|
+
status: i().oneOf([ "normal", "warning", "error", "disabled" ])
|
|
265
|
+
};
|
|
266
|
+
var D = {
|
|
267
|
+
position: "inner"
|
|
268
|
+
};
|
|
269
|
+
var N = function(e) {
|
|
270
|
+
T(n, e);
|
|
271
|
+
var t = I(n);
|
|
272
|
+
function n() {
|
|
273
|
+
var e;
|
|
274
|
+
x(this, n);
|
|
275
|
+
for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) {
|
|
276
|
+
o[i] = arguments[i];
|
|
277
|
+
}
|
|
278
|
+
e = t.call.apply(t, [ this ].concat(o));
|
|
279
|
+
W(z(e), "container", null);
|
|
280
|
+
W(z(e), "handleClick", (function(t) {
|
|
281
|
+
var n, r;
|
|
282
|
+
(n = (r = e.props).onClick) === null || n === void 0 ? void 0 : n.call(r, t, {
|
|
283
|
+
index: e.props.index,
|
|
284
|
+
panelId: e.props.panelId,
|
|
285
|
+
position: e.props.position
|
|
286
|
+
});
|
|
287
|
+
}));
|
|
288
|
+
W(z(e), "handleMount", (function(t) {
|
|
289
|
+
e.container = t;
|
|
290
|
+
}));
|
|
291
|
+
return e;
|
|
292
|
+
}
|
|
293
|
+
H(n, [ {
|
|
294
|
+
key: "focus",
|
|
295
|
+
value: function e() {
|
|
296
|
+
var t;
|
|
297
|
+
(t = this.container) === null || t === void 0 ? void 0 : t.focus();
|
|
298
|
+
}
|
|
299
|
+
}, {
|
|
300
|
+
key: "render",
|
|
301
|
+
value: function e() {
|
|
302
|
+
var t = this.props, o = t.children, i = t.description, a = t.panelId, l = t.position, s = t.status;
|
|
303
|
+
|
|
304
|
+
return r().createElement(C, E({
|
|
305
|
+
disabled: s === "disabled",
|
|
306
|
+
$inner: l === "inner",
|
|
307
|
+
$status: s,
|
|
308
|
+
onClick: this.handleClick,
|
|
309
|
+
ref: this.handleMount,
|
|
310
|
+
"data-test": "heading",
|
|
311
|
+
"data-test-panel-id": a
|
|
312
|
+
}, v()(this.props, y()(n.propTypes))), r().createElement(O, null, r().createElement("span", {
|
|
313
|
+
"data-concertina-role": "title"
|
|
314
|
+
}, o), i && r().createElement(P, {
|
|
315
|
+
"data-concertina-role": "description"
|
|
316
|
+
}, i)));
|
|
317
|
+
}
|
|
318
|
+
} ]);
|
|
319
|
+
return n;
|
|
320
|
+
}(n.Component);
|
|
321
|
+
W(N, "propTypes", B);
|
|
322
|
+
W(N, "defaultProps", D);
|
|
323
|
+
/* harmony default export */ const $ = N;
|
|
324
|
+
// CONCATENATED MODULE: external "lodash/throttle"
|
|
325
|
+
const U = require("lodash/throttle");
|
|
326
|
+
var V = e.n(U);
|
|
327
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
328
|
+
const L = require("@splunk/react-ui/Box");
|
|
329
|
+
var F = e.n(L);
|
|
330
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Scroll"
|
|
331
|
+
const G = require("@splunk/react-ui/Scroll");
|
|
332
|
+
var J = e.n(G);
|
|
333
|
+
// CONCATENATED MODULE: ./src/Concertina/ConcertinaStyles.ts
|
|
334
|
+
var K = m()(J()).withConfig({
|
|
335
|
+
displayName: "ConcertinaStyles__StyledScroll",
|
|
336
|
+
componentId: "sc-1fzuh39-0"
|
|
337
|
+
})([ "position:absolute;left:0;top:0;right:0;bottom:0;" ]);
|
|
338
|
+
var Q = m()(K.withComponent(F())).withConfig({
|
|
339
|
+
displayName: "ConcertinaStyles__StyledBox",
|
|
340
|
+
componentId: "sc-1fzuh39-1"
|
|
341
|
+
})([ "overflow:hidden;" ]);
|
|
342
|
+
var X = m().div.withConfig({
|
|
343
|
+
displayName: "ConcertinaStyles__StyledTop",
|
|
344
|
+
componentId: "sc-1fzuh39-2"
|
|
345
|
+
})([ "position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], w.variables.backgroundColor);
|
|
346
|
+
var Y = m().div.withConfig({
|
|
347
|
+
displayName: "ConcertinaStyles__StyledBottom",
|
|
348
|
+
componentId: "sc-1fzuh39-3"
|
|
349
|
+
})([ "position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], w.variables.backgroundColor);
|
|
350
|
+
var Z = m().div.withConfig({
|
|
351
|
+
displayName: "ConcertinaStyles__StyledPanelBody",
|
|
352
|
+
componentId: "sc-1fzuh39-4"
|
|
353
|
+
})([ "", "" ], (0, w.pickVariant)("$status", {
|
|
354
|
+
error: {
|
|
355
|
+
dark: (0, g.css)([ "background-color:", ";" ], w.mixins.colorWithAlpha(w.variables.errorColor, .5)),
|
|
356
|
+
light: (0, g.css)([ "background-color:", ";" ], w.variables.errorColorL50)
|
|
357
|
+
},
|
|
358
|
+
warning: {
|
|
359
|
+
dark: (0, g.css)([ "background-color:", ";" ], w.mixins.colorWithAlpha(w.variables.warningColor, .5)),
|
|
360
|
+
light: (0, g.css)([ "background-color:", ";" ], w.variables.warningColorL50)
|
|
361
|
+
},
|
|
362
|
+
disabled: (0, g.css)([ "display:none;" ])
|
|
363
|
+
}));
|
|
364
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
365
|
+
/**
|
|
110
366
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
111
367
|
*
|
|
112
368
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
113
369
|
* @param current - The new value of the ref.
|
|
114
370
|
*/
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({
|
|
218
|
-
displayName: "HeadingStyles__StyledClickable",
|
|
219
|
-
componentId: "sc-1h92oaj-0"
|
|
220
|
-
})(["display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", ""], themes_["variables"].spacing, themes_["variables"].lineHeight, themes_["variables"].textColor, Object(themes_["pickVariant"])('$inner', {
|
|
221
|
-
"true": Object(external_styled_components_["css"])(["*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}"], themes_["variables"].backgroundColor, themes_["variables"].backgroundColor),
|
|
222
|
-
"false": Object(external_styled_components_["css"])(["& + &&{border-top:2px solid ", ";}"], themes_["variables"].backgroundColor)
|
|
223
|
-
}), themes_["variables"].focusShadowInset, Object(themes_["pickVariant"])('$status', {
|
|
224
|
-
normal: Object(external_styled_components_["css"])(["background-color:", ";&:hover:not([disabled]){background-color:", ";}"], Object(themes_["pick"])({
|
|
225
|
-
dark: themes_["variables"].gray45,
|
|
226
|
-
light: themes_["variables"].gray96
|
|
227
|
-
}), Object(themes_["pick"])({
|
|
228
|
-
dark: themes_["variables"].gray30,
|
|
229
|
-
light: themes_["variables"].gray92
|
|
230
|
-
})),
|
|
231
|
-
disabled: Object(external_styled_components_["css"])(["background-color:", ";"], Object(themes_["pick"])({
|
|
232
|
-
dark: themes_["variables"].gray80,
|
|
233
|
-
light: themes_["variables"].gray96
|
|
234
|
-
})),
|
|
235
|
-
error: Object(external_styled_components_["css"])(["background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}"], themes_["variables"].errorColor, themes_["variables"].white, themes_["variables"].errorColorD10),
|
|
236
|
-
warning: Object(external_styled_components_["css"])(["background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}"], themes_["variables"].warningColor, themes_["variables"].white, themes_["variables"].warningColorD10)
|
|
237
|
-
}));
|
|
238
|
-
var StyledHeadingContent = external_styled_components_default.a.span.withConfig({
|
|
239
|
-
displayName: "HeadingStyles__StyledHeadingContent",
|
|
240
|
-
componentId: "sc-1h92oaj-1"
|
|
241
|
-
})(["display:flex;justify-content:space-between;"]);
|
|
242
|
-
var StyledDescription = external_styled_components_default.a.span.withConfig({
|
|
243
|
-
displayName: "HeadingStyles__StyledDescription",
|
|
244
|
-
componentId: "sc-1h92oaj-2"
|
|
245
|
-
})(["font-size:", ";"], themes_["variables"].fontSizeSmall);
|
|
246
|
-
|
|
247
|
-
// CONCATENATED MODULE: ./src/Concertina/Heading.tsx
|
|
248
|
-
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); }
|
|
249
|
-
|
|
250
|
-
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); }
|
|
251
|
-
|
|
252
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
253
|
-
|
|
254
|
-
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); } }
|
|
255
|
-
|
|
256
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
257
|
-
|
|
258
|
-
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); }
|
|
259
|
-
|
|
260
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
261
|
-
|
|
262
|
-
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); }; }
|
|
263
|
-
|
|
264
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
265
|
-
|
|
266
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
267
|
-
|
|
268
|
-
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; } }
|
|
269
|
-
|
|
270
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
271
|
-
|
|
272
|
-
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; }
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
var propTypes = {
|
|
280
|
-
children: external_prop_types_default.a.node.isRequired,
|
|
281
|
-
description: external_prop_types_default.a.node,
|
|
282
|
-
|
|
283
|
-
/** @private */
|
|
284
|
-
index: external_prop_types_default.a.number.isRequired,
|
|
285
|
-
|
|
286
|
-
/** @private */
|
|
287
|
-
onClick: external_prop_types_default.a.func,
|
|
288
|
-
|
|
289
|
-
/** @private */
|
|
290
|
-
panelId: external_prop_types_default.a.string,
|
|
291
|
-
|
|
292
|
-
/** @private */
|
|
293
|
-
position: external_prop_types_default.a.oneOf(['top', 'inner', 'bottom']),
|
|
294
|
-
status: external_prop_types_default.a.oneOf(['normal', 'warning', 'error', 'disabled'])
|
|
295
|
-
};
|
|
296
|
-
var defaultProps = {
|
|
297
|
-
position: 'inner'
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
var Heading_Heading = /*#__PURE__*/function (_Component) {
|
|
301
|
-
_inherits(Heading, _Component);
|
|
302
|
-
|
|
303
|
-
var _super = _createSuper(Heading);
|
|
304
|
-
|
|
305
|
-
function Heading() {
|
|
306
|
-
var _this;
|
|
307
|
-
|
|
308
|
-
_classCallCheck(this, Heading);
|
|
309
|
-
|
|
310
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
311
|
-
args[_key] = arguments[_key];
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
315
|
-
|
|
316
|
-
_defineProperty(_assertThisInitialized(_this), "container", null);
|
|
317
|
-
|
|
318
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
319
|
-
var _this$props$onClick, _this$props;
|
|
320
|
-
|
|
321
|
-
(_this$props$onClick = (_this$props = _this.props).onClick) === null || _this$props$onClick === void 0 ? void 0 : _this$props$onClick.call(_this$props, e, {
|
|
322
|
-
index: _this.props.index,
|
|
323
|
-
panelId: _this.props.panelId,
|
|
324
|
-
position: _this.props.position
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
_defineProperty(_assertThisInitialized(_this), "handleMount", function (container) {
|
|
329
|
-
_this.container = container;
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
return _this;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
_createClass(Heading, [{
|
|
336
|
-
key: "focus",
|
|
337
|
-
value: function focus() {
|
|
338
|
-
var _this$container;
|
|
339
|
-
|
|
340
|
-
(_this$container = this.container) === null || _this$container === void 0 ? void 0 : _this$container.focus();
|
|
341
|
-
}
|
|
342
|
-
}, {
|
|
343
|
-
key: "render",
|
|
344
|
-
value: function render() {
|
|
345
|
-
var _this$props2 = this.props,
|
|
346
|
-
children = _this$props2.children,
|
|
347
|
-
description = _this$props2.description,
|
|
348
|
-
panelId = _this$props2.panelId,
|
|
349
|
-
position = _this$props2.position,
|
|
350
|
-
status = _this$props2.status;
|
|
351
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
|
|
352
|
-
disabled: status === 'disabled',
|
|
353
|
-
$inner: position === 'inner',
|
|
354
|
-
$status: status,
|
|
355
|
-
onClick: this.handleClick,
|
|
356
|
-
ref: this.handleMount,
|
|
357
|
-
"data-test": "heading",
|
|
358
|
-
"data-test-panel-id": panelId
|
|
359
|
-
}, omit_default()(this.props, keys_default()(Heading.propTypes))), /*#__PURE__*/external_react_default.a.createElement(StyledHeadingContent, null, /*#__PURE__*/external_react_default.a.createElement("span", {
|
|
360
|
-
"data-concertina-role": "title"
|
|
361
|
-
}, children), description && /*#__PURE__*/external_react_default.a.createElement(StyledDescription, {
|
|
362
|
-
"data-concertina-role": "description"
|
|
363
|
-
}, description)));
|
|
364
|
-
}
|
|
365
|
-
}]);
|
|
366
|
-
|
|
367
|
-
return Heading;
|
|
368
|
-
}(external_react_["Component"]);
|
|
369
|
-
|
|
370
|
-
_defineProperty(Heading_Heading, "propTypes", propTypes);
|
|
371
|
-
|
|
372
|
-
_defineProperty(Heading_Heading, "defaultProps", defaultProps);
|
|
373
|
-
|
|
374
|
-
/* harmony default export */ var Concertina_Heading = (Heading_Heading);
|
|
375
|
-
// EXTERNAL MODULE: external "lodash/throttle"
|
|
376
|
-
var throttle_ = __webpack_require__(33);
|
|
377
|
-
var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
|
|
378
|
-
|
|
379
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Box"
|
|
380
|
-
var Box_ = __webpack_require__(6);
|
|
381
|
-
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
382
|
-
|
|
383
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Scroll"
|
|
384
|
-
var Scroll_ = __webpack_require__(89);
|
|
385
|
-
var Scroll_default = /*#__PURE__*/__webpack_require__.n(Scroll_);
|
|
386
|
-
|
|
387
|
-
// CONCATENATED MODULE: ./src/Concertina/ConcertinaStyles.ts
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
var StyledScroll = external_styled_components_default()(Scroll_default.a).withConfig({
|
|
393
|
-
displayName: "ConcertinaStyles__StyledScroll",
|
|
394
|
-
componentId: "sc-1fzuh39-0"
|
|
395
|
-
})(["position:absolute;left:0;top:0;right:0;bottom:0;"]);
|
|
396
|
-
var StyledBox = external_styled_components_default()(StyledScroll.withComponent(Box_default.a)).withConfig({
|
|
397
|
-
displayName: "ConcertinaStyles__StyledBox",
|
|
398
|
-
componentId: "sc-1fzuh39-1"
|
|
399
|
-
})(["overflow:hidden;"]);
|
|
400
|
-
var StyledTop = external_styled_components_default.a.div.withConfig({
|
|
401
|
-
displayName: "ConcertinaStyles__StyledTop",
|
|
402
|
-
componentId: "sc-1fzuh39-2"
|
|
403
|
-
})(["position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}"], themes_["variables"].backgroundColor);
|
|
404
|
-
var StyledBottom = external_styled_components_default.a.div.withConfig({
|
|
405
|
-
displayName: "ConcertinaStyles__StyledBottom",
|
|
406
|
-
componentId: "sc-1fzuh39-3"
|
|
407
|
-
})(["position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}"], themes_["variables"].backgroundColor);
|
|
408
|
-
var StyledPanelBody = external_styled_components_default.a.div.withConfig({
|
|
409
|
-
displayName: "ConcertinaStyles__StyledPanelBody",
|
|
410
|
-
componentId: "sc-1fzuh39-4"
|
|
411
|
-
})(["", ""], Object(themes_["pickVariant"])('$status', {
|
|
412
|
-
error: {
|
|
413
|
-
dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].errorColor, 0.5)),
|
|
414
|
-
light: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].errorColorL50)
|
|
415
|
-
},
|
|
416
|
-
warning: {
|
|
417
|
-
dark: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["mixins"].colorWithAlpha(themes_["variables"].warningColor, 0.5)),
|
|
418
|
-
light: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].warningColorL50)
|
|
419
|
-
},
|
|
420
|
-
disabled: Object(external_styled_components_["css"])(["display:none;"])
|
|
421
|
-
}));
|
|
422
|
-
|
|
423
|
-
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
424
|
-
var updateReactRef = __webpack_require__(10);
|
|
425
|
-
|
|
426
|
-
// CONCATENATED MODULE: ./src/Concertina/ConcertinaContext.tsx
|
|
427
|
-
|
|
428
|
-
var ConcertinaContext = /*#__PURE__*/Object(external_react_["createContext"])({});
|
|
429
|
-
ConcertinaContext.displayName = 'Concertina';
|
|
430
|
-
/* harmony default export */ var Concertina_ConcertinaContext = (ConcertinaContext);
|
|
431
|
-
// CONCATENATED MODULE: ./src/Concertina/Panel.tsx
|
|
432
|
-
function Panel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Panel_typeof = function _typeof(obj) { return typeof obj; }; } else { Panel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Panel_typeof(obj); }
|
|
433
|
-
|
|
434
|
-
function Panel_extends() { Panel_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 Panel_extends.apply(this, arguments); }
|
|
435
|
-
|
|
436
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
437
|
-
|
|
438
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
439
|
-
|
|
440
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
441
|
-
|
|
442
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
443
|
-
|
|
444
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
445
|
-
|
|
446
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
447
|
-
|
|
448
|
-
function Panel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
449
|
-
|
|
450
|
-
function Panel_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); } }
|
|
451
|
-
|
|
452
|
-
function Panel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Panel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Panel_defineProperties(Constructor, staticProps); return Constructor; }
|
|
453
|
-
|
|
454
|
-
function Panel_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) Panel_setPrototypeOf(subClass, superClass); }
|
|
455
|
-
|
|
456
|
-
function Panel_setPrototypeOf(o, p) { Panel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Panel_setPrototypeOf(o, p); }
|
|
457
|
-
|
|
458
|
-
function Panel_createSuper(Derived) { var hasNativeReflectConstruct = Panel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Panel_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Panel_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Panel_possibleConstructorReturn(this, result); }; }
|
|
459
|
-
|
|
460
|
-
function Panel_possibleConstructorReturn(self, call) { if (call && (Panel_typeof(call) === "object" || typeof call === "function")) { return call; } return Panel_assertThisInitialized(self); }
|
|
461
|
-
|
|
462
|
-
function Panel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
463
|
-
|
|
464
|
-
function Panel_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; } }
|
|
465
|
-
|
|
466
|
-
function Panel_getPrototypeOf(o) { Panel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Panel_getPrototypeOf(o); }
|
|
467
|
-
|
|
468
|
-
function Panel_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; }
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
var Panel_propTypes = {
|
|
481
|
-
children: external_prop_types_default.a.node,
|
|
482
|
-
description: external_prop_types_default.a.node,
|
|
483
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
484
|
-
|
|
485
|
-
/** @private */
|
|
486
|
-
index: external_prop_types_default.a.number,
|
|
487
|
-
panelId: external_prop_types_default.a.string,
|
|
488
|
-
status: external_prop_types_default.a.oneOf(['normal', 'warning', 'error', 'disabled']),
|
|
489
|
-
title: external_prop_types_default.a.node.isRequired
|
|
490
|
-
};
|
|
491
|
-
var Panel_defaultProps = {
|
|
492
|
-
status: 'normal'
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
var Panel_Panel = /*#__PURE__*/function (_Component) {
|
|
496
|
-
Panel_inherits(Panel, _Component);
|
|
497
|
-
|
|
498
|
-
var _super = Panel_createSuper(Panel);
|
|
499
|
-
|
|
500
|
-
// @docs-props-type PanelPropsBase
|
|
501
|
-
function Panel(props) {
|
|
502
|
-
var _this;
|
|
503
|
-
|
|
504
|
-
Panel_classCallCheck(this, Panel);
|
|
505
|
-
|
|
506
|
-
_this = _super.call(this, props);
|
|
507
|
-
|
|
508
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "lastHeight", void 0);
|
|
509
|
-
|
|
510
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "measureHeight", function (e) {
|
|
511
|
-
var _this$props$index, _this$context$onChang, _this$context;
|
|
512
|
-
|
|
513
|
-
if (!_this.state.containerEl || !_this.state.bodyEl) {
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
var newHeight = _this.state.containerEl.clientHeight;
|
|
518
|
-
|
|
519
|
-
if (newHeight === _this.lastHeight) {
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
var data = {
|
|
524
|
-
headingHeight: _this.state.containerEl.offsetHeight - _this.state.bodyEl.offsetHeight,
|
|
525
|
-
height: _this.state.containerEl.offsetHeight,
|
|
526
|
-
index: (_this$props$index = _this.props.index) !== null && _this$props$index !== void 0 ? _this$props$index : 0,
|
|
527
|
-
panelId: _this.props.panelId
|
|
528
|
-
};
|
|
529
|
-
_this.lastHeight = newHeight;
|
|
530
|
-
(_this$context$onChang = (_this$context = _this.context).onChange) === null || _this$context$onChang === void 0 ? void 0 : _this$context$onChang.call(_this$context, e, data);
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "handleResize", throttle_default()(_this.measureHeight, 300));
|
|
534
|
-
|
|
535
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "handleMount", function (el) {
|
|
536
|
-
_this.setState({
|
|
537
|
-
containerEl: el
|
|
538
|
-
});
|
|
539
|
-
|
|
540
|
-
Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "handleHeadingMount", function (heading) {
|
|
544
|
-
_this.setState({
|
|
545
|
-
heading: heading
|
|
546
|
-
});
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
Panel_defineProperty(Panel_assertThisInitialized(_this), "handleBodyMount", function (bodyEl) {
|
|
550
|
-
_this.setState({
|
|
551
|
-
bodyEl: bodyEl
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
|
|
555
|
-
_this.state = {
|
|
556
|
-
bodyEl: null,
|
|
557
|
-
containerEl: null,
|
|
558
|
-
heading: null
|
|
559
|
-
};
|
|
560
|
-
return _this;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
Panel_createClass(Panel, [{
|
|
564
|
-
key: "componentDidUpdate",
|
|
565
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
566
|
-
if (this.props.children !== prevProps.children || !prevState.containerEl) {
|
|
567
|
-
this.measureHeight();
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
}, {
|
|
571
|
-
key: "componentWillUnmount",
|
|
572
|
-
value: function componentWillUnmount() {
|
|
573
|
-
this.handleResize.cancel();
|
|
574
|
-
}
|
|
575
|
-
}, {
|
|
576
|
-
key: "focus",
|
|
577
|
-
value: function focus() {
|
|
578
|
-
var _this$state$heading;
|
|
579
|
-
|
|
580
|
-
(_this$state$heading = this.state.heading) === null || _this$state$heading === void 0 ? void 0 : _this$state$heading.focus();
|
|
581
|
-
}
|
|
582
|
-
}, {
|
|
583
|
-
key: "render",
|
|
584
|
-
value: function render() {
|
|
585
|
-
var _this$props = this.props,
|
|
586
|
-
children = _this$props.children,
|
|
587
|
-
description = _this$props.description,
|
|
588
|
-
index = _this$props.index,
|
|
589
|
-
panelId = _this$props.panelId,
|
|
590
|
-
status = _this$props.status,
|
|
591
|
-
style = _this$props.style,
|
|
592
|
-
title = _this$props.title;
|
|
593
|
-
var onHeadingClickContext = this.context.onHeadingClick;
|
|
594
|
-
return /*#__PURE__*/external_react_default.a.createElement("div", Panel_extends({
|
|
595
|
-
ref: this.handleMount,
|
|
596
|
-
"data-test": "panel",
|
|
597
|
-
"data-test-panel-id": panelId || "".concat(index)
|
|
598
|
-
}, omit_default()(this.props, [].concat(_toConsumableArray(keys_default()(Panel.propTypes)), ['style']))), /*#__PURE__*/external_react_default.a.createElement(Concertina_Heading, {
|
|
599
|
-
onClick: onHeadingClickContext,
|
|
600
|
-
ref: this.handleHeadingMount,
|
|
601
|
-
description: description,
|
|
602
|
-
index: index !== null && index !== void 0 ? index : 0,
|
|
603
|
-
panelId: panelId || "".concat(index),
|
|
604
|
-
position: "inner",
|
|
605
|
-
status: status
|
|
606
|
-
}, title), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
607
|
-
target: window,
|
|
608
|
-
eventType: "resize",
|
|
609
|
-
listener: this.handleResize
|
|
610
|
-
}), /*#__PURE__*/external_react_default.a.createElement(StyledPanelBody, {
|
|
611
|
-
$status: status,
|
|
612
|
-
"data-test": "body",
|
|
613
|
-
style: style,
|
|
614
|
-
ref: this.handleBodyMount
|
|
615
|
-
}, children));
|
|
616
|
-
}
|
|
617
|
-
}]);
|
|
618
|
-
|
|
619
|
-
return Panel;
|
|
620
|
-
}(external_react_["Component"]);
|
|
621
|
-
|
|
622
|
-
Panel_defineProperty(Panel_Panel, "propTypes", Panel_propTypes);
|
|
623
|
-
|
|
624
|
-
Panel_defineProperty(Panel_Panel, "defaultProps", Panel_defaultProps);
|
|
625
|
-
|
|
626
|
-
Panel_defineProperty(Panel_Panel, "contextType", Concertina_ConcertinaContext);
|
|
627
|
-
|
|
628
|
-
/* harmony default export */ var Concertina_Panel = (Panel_Panel);
|
|
629
|
-
// CONCATENATED MODULE: ./src/Concertina/Concertina.tsx
|
|
630
|
-
function Concertina_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Concertina_typeof = function _typeof(obj) { return typeof obj; }; } else { Concertina_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Concertina_typeof(obj); }
|
|
631
|
-
|
|
632
|
-
function Concertina_extends() { Concertina_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 Concertina_extends.apply(this, arguments); }
|
|
633
|
-
|
|
634
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
635
|
-
|
|
636
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
637
|
-
|
|
638
|
-
function Concertina_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
639
|
-
|
|
640
|
-
function Concertina_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); } }
|
|
641
|
-
|
|
642
|
-
function Concertina_createClass(Constructor, protoProps, staticProps) { if (protoProps) Concertina_defineProperties(Constructor.prototype, protoProps); if (staticProps) Concertina_defineProperties(Constructor, staticProps); return Constructor; }
|
|
643
|
-
|
|
644
|
-
function Concertina_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) Concertina_setPrototypeOf(subClass, superClass); }
|
|
645
|
-
|
|
646
|
-
function Concertina_setPrototypeOf(o, p) { Concertina_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Concertina_setPrototypeOf(o, p); }
|
|
647
|
-
|
|
648
|
-
function Concertina_createSuper(Derived) { var hasNativeReflectConstruct = Concertina_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Concertina_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Concertina_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Concertina_possibleConstructorReturn(this, result); }; }
|
|
649
|
-
|
|
650
|
-
function Concertina_possibleConstructorReturn(self, call) { if (call && (Concertina_typeof(call) === "object" || typeof call === "function")) { return call; } return Concertina_assertThisInitialized(self); }
|
|
651
|
-
|
|
652
|
-
function Concertina_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
653
|
-
|
|
654
|
-
function Concertina_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; } }
|
|
655
|
-
|
|
656
|
-
function Concertina_getPrototypeOf(o) { Concertina_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Concertina_getPrototypeOf(o); }
|
|
657
|
-
|
|
658
|
-
function Concertina_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; }
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
var Concertina_propTypes = {
|
|
671
|
-
children: external_prop_types_default.a.node,
|
|
672
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object])
|
|
673
|
-
};
|
|
674
|
-
var Concertina_defaultProps = {};
|
|
675
|
-
|
|
676
|
-
var Concertina_Concertina = /*#__PURE__*/function (_Component) {
|
|
677
|
-
Concertina_inherits(Concertina, _Component);
|
|
678
|
-
|
|
679
|
-
var _super = Concertina_createSuper(Concertina);
|
|
680
|
-
|
|
681
|
-
// @docs-props-type ConcertinaPropsBase
|
|
682
|
-
function Concertina(props) {
|
|
683
|
-
var _this;
|
|
684
|
-
|
|
685
|
-
Concertina_classCallCheck(this, Concertina);
|
|
686
|
-
|
|
687
|
-
_this = _super.call(this, props);
|
|
688
|
-
|
|
689
|
-
Concertina_defineProperty(Concertina_assertThisInitialized(_this), "panelPositions", void 0);
|
|
690
|
-
|
|
691
|
-
Concertina_defineProperty(Concertina_assertThisInitialized(_this), "handleUpdate", function (e, data) {
|
|
692
|
-
_this.panelPositions[data.index] = data;
|
|
693
|
-
var total = 0;
|
|
694
|
-
|
|
695
|
-
_this.panelPositions.forEach(function (panel) {
|
|
696
|
-
// eslint-disable-next-line no-param-reassign
|
|
697
|
-
panel.offsetTop = total;
|
|
698
|
-
total += panel.height || 0;
|
|
699
|
-
});
|
|
700
|
-
|
|
701
|
-
_this.updateHeadings();
|
|
702
|
-
});
|
|
703
|
-
|
|
704
|
-
Concertina_defineProperty(Concertina_assertThisInitialized(_this), "handleElementMount", function (scrollEl) {
|
|
705
|
-
_this.setState({
|
|
706
|
-
scrollEl: scrollEl
|
|
707
|
-
}); // The scrollEl gets unmounted during the animation, it's necessary to cache the
|
|
708
|
-
// recorded height until it is remounted.
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
if (scrollEl) {
|
|
712
|
-
_this.setState({
|
|
713
|
-
innerWidth: scrollEl.clientWidth
|
|
371
|
+
function ee(e, t) {
|
|
372
|
+
if (e) {
|
|
373
|
+
if (typeof e === "function") {
|
|
374
|
+
e(t);
|
|
375
|
+
} else {
|
|
376
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
377
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
378
|
+
e.current = t;
|
|
379
|
+
// eslint-disable-line no-param-reassign
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// CONCATENATED MODULE: ./src/Concertina/ConcertinaContext.tsx
|
|
384
|
+
var te = (0, n.createContext)({});
|
|
385
|
+
te.displayName = "Concertina";
|
|
386
|
+
/* harmony default export */ const ne = te;
|
|
387
|
+
// CONCATENATED MODULE: ./src/Concertina/Panel.tsx
|
|
388
|
+
function re(e) {
|
|
389
|
+
"@babel/helpers - typeof";
|
|
390
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
391
|
+
re = function e(t) {
|
|
392
|
+
return typeof t;
|
|
393
|
+
};
|
|
394
|
+
} else {
|
|
395
|
+
re = function e(t) {
|
|
396
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
return re(e);
|
|
400
|
+
}
|
|
401
|
+
function oe() {
|
|
402
|
+
oe = Object.assign || function(e) {
|
|
403
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
404
|
+
var n = arguments[t];
|
|
405
|
+
for (var r in n) {
|
|
406
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
407
|
+
e[r] = n[r];
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return e;
|
|
412
|
+
};
|
|
413
|
+
return oe.apply(this, arguments);
|
|
414
|
+
}
|
|
415
|
+
function ie(e) {
|
|
416
|
+
return ce(e) || se(e) || le(e) || ae();
|
|
417
|
+
}
|
|
418
|
+
function ae() {
|
|
419
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
420
|
+
}
|
|
421
|
+
function le(e, t) {
|
|
422
|
+
if (!e) return;
|
|
423
|
+
if (typeof e === "string") return ue(e, t);
|
|
424
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
425
|
+
if (n === "Object" && e.constructor) n = e.constructor.name;
|
|
426
|
+
if (n === "Map" || n === "Set") return Array.from(e);
|
|
427
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ue(e, t);
|
|
428
|
+
}
|
|
429
|
+
function se(e) {
|
|
430
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
431
|
+
}
|
|
432
|
+
function ce(e) {
|
|
433
|
+
if (Array.isArray(e)) return ue(e);
|
|
434
|
+
}
|
|
435
|
+
function ue(e, t) {
|
|
436
|
+
if (t == null || t > e.length) t = e.length;
|
|
437
|
+
for (var n = 0, r = new Array(t); n < t; n++) {
|
|
438
|
+
r[n] = e[n];
|
|
439
|
+
}
|
|
440
|
+
return r;
|
|
441
|
+
}
|
|
442
|
+
function fe(e, t) {
|
|
443
|
+
if (!(e instanceof t)) {
|
|
444
|
+
throw new TypeError("Cannot call a class as a function");
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function pe(e, t) {
|
|
448
|
+
for (var n = 0; n < t.length; n++) {
|
|
449
|
+
var r = t[n];
|
|
450
|
+
r.enumerable = r.enumerable || false;
|
|
451
|
+
r.configurable = true;
|
|
452
|
+
if ("value" in r) r.writable = true;
|
|
453
|
+
Object.defineProperty(e, r.key, r);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function de(e, t, n) {
|
|
457
|
+
if (t) pe(e.prototype, t);
|
|
458
|
+
if (n) pe(e, n);
|
|
459
|
+
return e;
|
|
460
|
+
}
|
|
461
|
+
function he(e, t) {
|
|
462
|
+
if (typeof t !== "function" && t !== null) {
|
|
463
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
464
|
+
}
|
|
465
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
466
|
+
constructor: {
|
|
467
|
+
value: e,
|
|
468
|
+
writable: true,
|
|
469
|
+
configurable: true
|
|
470
|
+
}
|
|
714
471
|
});
|
|
715
|
-
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
return {
|
|
723
|
-
innerWidth: (_state$scrollEl = state.scrollEl) === null || _state$scrollEl === void 0 ? void 0 : _state$scrollEl.clientWidth
|
|
472
|
+
if (t) ye(e, t);
|
|
473
|
+
}
|
|
474
|
+
function ye(e, t) {
|
|
475
|
+
ye = Object.setPrototypeOf || function e(t, n) {
|
|
476
|
+
t.__proto__ = n;
|
|
477
|
+
return t;
|
|
724
478
|
};
|
|
725
|
-
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
var scrollEl = _this.state.scrollEl;
|
|
744
|
-
|
|
745
|
-
if (!scrollEl) {
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
var headingsBeforeHeight = take_default()(_this.panelPositions, index).map(function (item) {
|
|
750
|
-
return item.headingHeight;
|
|
751
|
-
}).reduce(function (a, b) {
|
|
752
|
-
return a + b;
|
|
753
|
-
}, 0); // sum the heights
|
|
754
|
-
|
|
755
|
-
var headingsAfterHeight = takeRight_default()(_this.panelPositions, _this.panelPositions.length - index - 1).map(function (item) {
|
|
756
|
-
return item.headingHeight;
|
|
757
|
-
}).reduce(function (a, b) {
|
|
758
|
-
return a + b;
|
|
759
|
-
}, 0); // sum the heights
|
|
760
|
-
|
|
761
|
-
var availableHeight = scrollEl.clientHeight - headingsBeforeHeight - headingsAfterHeight;
|
|
762
|
-
var panelHeight = _this.panelPositions[index].height;
|
|
763
|
-
var topPosition = ((_this$panelPositions$ = _this.panelPositions[index].offsetTop) !== null && _this$panelPositions$ !== void 0 ? _this$panelPositions$ : 0) - headingsBeforeHeight;
|
|
764
|
-
var bottomPosition = topPosition - (availableHeight - panelHeight);
|
|
765
|
-
var shouldPartlyPopUp = availableHeight > panelHeight && (position === 'bottom' || position === 'inner'); // if the entire panel is in view, do nothing
|
|
766
|
-
|
|
767
|
-
if (shouldPartlyPopUp && bottomPosition < scrollEl.scrollTop) {
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
var targetTop = shouldPartlyPopUp ? bottomPosition : topPosition; // handleRest will shift focus;
|
|
772
|
-
|
|
773
|
-
if (position !== 'inner') {
|
|
774
|
-
e.currentTarget.blur();
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
_this.setState({
|
|
778
|
-
targetTop: targetTop
|
|
779
|
-
});
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
Concertina_defineProperty(Concertina_assertThisInitialized(_this), "updateHeadingsImpl", function () {
|
|
783
|
-
var scrollEl = _this.state.scrollEl;
|
|
784
|
-
|
|
785
|
-
if (!scrollEl) {
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
var top = scrollEl.scrollTop;
|
|
790
|
-
|
|
791
|
-
function reduceTop(show, panel) {
|
|
792
|
-
if (panel.offsetTop !== undefined && panel.offsetTop < top) {
|
|
793
|
-
top += panel.headingHeight;
|
|
794
|
-
return show + 1;
|
|
479
|
+
return ye(e, t);
|
|
480
|
+
}
|
|
481
|
+
function be(e) {
|
|
482
|
+
var t = me();
|
|
483
|
+
return function n() {
|
|
484
|
+
var r = ke(e), o;
|
|
485
|
+
if (t) {
|
|
486
|
+
var i = ke(this).constructor;
|
|
487
|
+
o = Reflect.construct(r, arguments, i);
|
|
488
|
+
} else {
|
|
489
|
+
o = r.apply(this, arguments);
|
|
490
|
+
}
|
|
491
|
+
return ve(this, o);
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function ve(e, t) {
|
|
495
|
+
if (t && (re(t) === "object" || typeof t === "function")) {
|
|
496
|
+
return t;
|
|
795
497
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
function reduceBottom(show, panel) {
|
|
803
|
-
if (panel.offsetTop !== undefined && panel.offsetTop + panel.headingHeight > bottom) {
|
|
804
|
-
bottom -= panel.headingHeight;
|
|
805
|
-
return show + 1;
|
|
498
|
+
return ge(e);
|
|
499
|
+
}
|
|
500
|
+
function ge(e) {
|
|
501
|
+
if (e === void 0) {
|
|
502
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
806
503
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
504
|
+
return e;
|
|
505
|
+
}
|
|
506
|
+
function me() {
|
|
507
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
508
|
+
if (Reflect.construct.sham) return false;
|
|
509
|
+
if (typeof Proxy === "function") return true;
|
|
510
|
+
try {
|
|
511
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
512
|
+
return true;
|
|
513
|
+
} catch (e) {
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
function ke(e) {
|
|
518
|
+
ke = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
519
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
520
|
+
};
|
|
521
|
+
return ke(e);
|
|
522
|
+
}
|
|
523
|
+
function Se(e, t, n) {
|
|
524
|
+
if (t in e) {
|
|
525
|
+
Object.defineProperty(e, t, {
|
|
526
|
+
value: n,
|
|
527
|
+
enumerable: true,
|
|
528
|
+
configurable: true,
|
|
529
|
+
writable: true
|
|
530
|
+
});
|
|
531
|
+
} else {
|
|
532
|
+
e[t] = n;
|
|
533
|
+
}
|
|
534
|
+
return e;
|
|
535
|
+
}
|
|
536
|
+
var we = {
|
|
537
|
+
children: i().node,
|
|
538
|
+
description: i().node,
|
|
539
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
540
|
+
/** @private */
|
|
541
|
+
index: i().number,
|
|
542
|
+
panelId: i().string,
|
|
543
|
+
status: i().oneOf([ "normal", "warning", "error", "disabled" ]),
|
|
544
|
+
title: i().node.isRequired
|
|
824
545
|
};
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
546
|
+
var Ce = {
|
|
547
|
+
status: "normal"
|
|
548
|
+
};
|
|
549
|
+
var Oe = function(e) {
|
|
550
|
+
he(n, e);
|
|
551
|
+
var t = be(n);
|
|
552
|
+
// @docs-props-type PanelPropsBase
|
|
553
|
+
function n(e) {
|
|
554
|
+
var r;
|
|
555
|
+
fe(this, n);
|
|
556
|
+
r = t.call(this, e);
|
|
557
|
+
Se(ge(r), "lastHeight", void 0);
|
|
558
|
+
Se(ge(r), "measureHeight", (function(e) {
|
|
559
|
+
var t, n, o;
|
|
560
|
+
if (!r.state.containerEl || !r.state.bodyEl) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
var i = r.state.containerEl.clientHeight;
|
|
564
|
+
if (i === r.lastHeight) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
var a = {
|
|
568
|
+
headingHeight: r.state.containerEl.offsetHeight - r.state.bodyEl.offsetHeight,
|
|
569
|
+
height: r.state.containerEl.offsetHeight,
|
|
570
|
+
index: (t = r.props.index) !== null && t !== void 0 ? t : 0,
|
|
571
|
+
panelId: r.props.panelId
|
|
572
|
+
};
|
|
573
|
+
r.lastHeight = i;
|
|
574
|
+
(n = (o = r.context).onChange) === null || n === void 0 ? void 0 : n.call(o, e, a);
|
|
575
|
+
}));
|
|
576
|
+
Se(ge(r), "handleResize", V()(r.measureHeight, 300));
|
|
577
|
+
Se(ge(r), "handleMount", (function(e) {
|
|
578
|
+
r.setState({
|
|
579
|
+
containerEl: e
|
|
580
|
+
});
|
|
581
|
+
ee(r.props.elementRef, e);
|
|
582
|
+
}));
|
|
583
|
+
Se(ge(r), "handleHeadingMount", (function(e) {
|
|
584
|
+
r.setState({
|
|
585
|
+
heading: e
|
|
586
|
+
});
|
|
587
|
+
}));
|
|
588
|
+
Se(ge(r), "handleBodyMount", (function(e) {
|
|
589
|
+
r.setState({
|
|
590
|
+
bodyEl: e
|
|
591
|
+
});
|
|
592
|
+
}));
|
|
593
|
+
r.state = {
|
|
594
|
+
bodyEl: null,
|
|
595
|
+
containerEl: null,
|
|
596
|
+
heading: null
|
|
597
|
+
};
|
|
598
|
+
return r;
|
|
599
|
+
}
|
|
600
|
+
de(n, [ {
|
|
601
|
+
key: "componentDidUpdate",
|
|
602
|
+
value: function e(t, n) {
|
|
603
|
+
if (this.props.children !== t.children || !n.containerEl) {
|
|
604
|
+
this.measureHeight();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}, {
|
|
608
|
+
key: "componentWillUnmount",
|
|
609
|
+
value: function e() {
|
|
610
|
+
this.handleResize.cancel();
|
|
611
|
+
}
|
|
612
|
+
}, {
|
|
613
|
+
key: "focus",
|
|
614
|
+
value: function e() {
|
|
615
|
+
var t;
|
|
616
|
+
(t = this.state.heading) === null || t === void 0 ? void 0 : t.focus();
|
|
617
|
+
}
|
|
618
|
+
}, {
|
|
619
|
+
key: "render",
|
|
620
|
+
value: function e() {
|
|
621
|
+
var t = this.props, o = t.children, i = t.description, a = t.index, l = t.panelId, s = t.status, c = t.style, u = t.title;
|
|
622
|
+
var f = this.context.onHeadingClick;
|
|
623
|
+
|
|
624
|
+
return r().createElement("div", oe({
|
|
625
|
+
ref: this.handleMount,
|
|
626
|
+
"data-test": "panel",
|
|
627
|
+
"data-test-panel-id": l || "".concat(a)
|
|
628
|
+
}, v()(this.props, [].concat(ie(y()(n.propTypes)), [ "style" ]))), r().createElement($, {
|
|
629
|
+
onClick: f,
|
|
630
|
+
ref: this.handleHeadingMount,
|
|
631
|
+
description: i,
|
|
632
|
+
index: a !== null && a !== void 0 ? a : 0,
|
|
633
|
+
panelId: l || "".concat(a),
|
|
634
|
+
position: "inner",
|
|
635
|
+
status: s
|
|
636
|
+
}, u), r().createElement(d(), {
|
|
637
|
+
target: window,
|
|
638
|
+
eventType: "resize",
|
|
639
|
+
listener: this.handleResize
|
|
640
|
+
}), r().createElement(Z, {
|
|
641
|
+
$status: s,
|
|
642
|
+
"data-test": "body",
|
|
643
|
+
style: c,
|
|
644
|
+
ref: this.handleBodyMount
|
|
645
|
+
}, o));
|
|
646
|
+
}
|
|
647
|
+
} ]);
|
|
648
|
+
return n;
|
|
649
|
+
}(n.Component);
|
|
650
|
+
Se(Oe, "propTypes", we);
|
|
651
|
+
Se(Oe, "defaultProps", Ce);
|
|
652
|
+
Se(Oe, "contextType", ne);
|
|
653
|
+
/* harmony default export */ const Pe = Oe;
|
|
654
|
+
// CONCATENATED MODULE: ./src/Concertina/Concertina.tsx
|
|
655
|
+
function je(e) {
|
|
656
|
+
"@babel/helpers - typeof";
|
|
657
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
658
|
+
je = function e(t) {
|
|
659
|
+
return typeof t;
|
|
660
|
+
};
|
|
661
|
+
} else {
|
|
662
|
+
je = function e(t) {
|
|
663
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
return je(e);
|
|
667
|
+
}
|
|
668
|
+
function Ee() {
|
|
669
|
+
Ee = Object.assign || function(e) {
|
|
670
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
671
|
+
var n = arguments[t];
|
|
672
|
+
for (var r in n) {
|
|
673
|
+
if (Object.prototype.hasOwnProperty.call(n, r)) {
|
|
674
|
+
e[r] = n[r];
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return e;
|
|
679
|
+
};
|
|
680
|
+
return Ee.apply(this, arguments);
|
|
681
|
+
}
|
|
682
|
+
function xe(e, t) {
|
|
683
|
+
if (e == null) return {};
|
|
684
|
+
var n = _e(e, t);
|
|
685
|
+
var r, o;
|
|
686
|
+
if (Object.getOwnPropertySymbols) {
|
|
687
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
688
|
+
for (o = 0; o < i.length; o++) {
|
|
689
|
+
r = i[o];
|
|
690
|
+
if (t.indexOf(r) >= 0) continue;
|
|
691
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, r)) continue;
|
|
692
|
+
n[r] = e[r];
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return n;
|
|
696
|
+
}
|
|
697
|
+
function _e(e, t) {
|
|
698
|
+
if (e == null) return {};
|
|
699
|
+
var n = {};
|
|
700
|
+
var r = Object.keys(e);
|
|
701
|
+
var o, i;
|
|
702
|
+
for (i = 0; i < r.length; i++) {
|
|
703
|
+
o = r[i];
|
|
704
|
+
if (t.indexOf(o) >= 0) continue;
|
|
705
|
+
n[o] = e[o];
|
|
706
|
+
}
|
|
707
|
+
return n;
|
|
708
|
+
}
|
|
709
|
+
function He(e, t) {
|
|
710
|
+
if (!(e instanceof t)) {
|
|
711
|
+
throw new TypeError("Cannot call a class as a function");
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function Te(e, t) {
|
|
715
|
+
for (var n = 0; n < t.length; n++) {
|
|
716
|
+
var r = t[n];
|
|
717
|
+
r.enumerable = r.enumerable || false;
|
|
718
|
+
r.configurable = true;
|
|
719
|
+
if ("value" in r) r.writable = true;
|
|
720
|
+
Object.defineProperty(e, r.key, r);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
function Re(e, t, n) {
|
|
724
|
+
if (t) Te(e.prototype, t);
|
|
725
|
+
if (n) Te(e, n);
|
|
726
|
+
return e;
|
|
727
|
+
}
|
|
728
|
+
function Ie(e, t) {
|
|
729
|
+
if (typeof t !== "function" && t !== null) {
|
|
730
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
731
|
+
}
|
|
732
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
733
|
+
constructor: {
|
|
734
|
+
value: e,
|
|
735
|
+
writable: true,
|
|
736
|
+
configurable: true
|
|
737
|
+
}
|
|
865
738
|
});
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
onChange: this.handleUpdate
|
|
739
|
+
if (t) qe(e, t);
|
|
740
|
+
}
|
|
741
|
+
function qe(e, t) {
|
|
742
|
+
qe = Object.setPrototypeOf || function e(t, n) {
|
|
743
|
+
t.__proto__ = n;
|
|
744
|
+
return t;
|
|
745
|
+
};
|
|
746
|
+
return qe(e, t);
|
|
747
|
+
}
|
|
748
|
+
function ze(e) {
|
|
749
|
+
var t = We();
|
|
750
|
+
return function n() {
|
|
751
|
+
var r = Be(e), o;
|
|
752
|
+
if (t) {
|
|
753
|
+
var i = Be(this).constructor;
|
|
754
|
+
o = Reflect.construct(r, arguments, i);
|
|
755
|
+
} else {
|
|
756
|
+
o = r.apply(this, arguments);
|
|
757
|
+
}
|
|
758
|
+
return Me(this, o);
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function Me(e, t) {
|
|
762
|
+
if (t && (je(t) === "object" || typeof t === "function")) {
|
|
763
|
+
return t;
|
|
892
764
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
765
|
+
return Ae(e);
|
|
766
|
+
}
|
|
767
|
+
function Ae(e) {
|
|
768
|
+
if (e === void 0) {
|
|
769
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
770
|
+
}
|
|
771
|
+
return e;
|
|
772
|
+
}
|
|
773
|
+
function We() {
|
|
774
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
775
|
+
if (Reflect.construct.sham) return false;
|
|
776
|
+
if (typeof Proxy === "function") return true;
|
|
777
|
+
try {
|
|
778
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
779
|
+
return true;
|
|
780
|
+
} catch (e) {
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
function Be(e) {
|
|
785
|
+
Be = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
786
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
787
|
+
};
|
|
788
|
+
return Be(e);
|
|
789
|
+
}
|
|
790
|
+
function De(e, t, n) {
|
|
791
|
+
if (t in e) {
|
|
792
|
+
Object.defineProperty(e, t, {
|
|
793
|
+
value: n,
|
|
794
|
+
enumerable: true,
|
|
795
|
+
configurable: true,
|
|
796
|
+
writable: true
|
|
797
|
+
});
|
|
798
|
+
} else {
|
|
799
|
+
e[t] = n;
|
|
800
|
+
}
|
|
801
|
+
return e;
|
|
802
|
+
}
|
|
803
|
+
var Ne = {
|
|
804
|
+
children: i().node,
|
|
805
|
+
elementRef: i().oneOfType([ i().func, i().object ])
|
|
806
|
+
};
|
|
807
|
+
var $e = {};
|
|
808
|
+
/**
|
|
809
|
+
* @deprecated
|
|
810
|
+
* Concertina has been deprecated and will be removed in a future major version.
|
|
811
|
+
*/ var Ue = function(e) {
|
|
812
|
+
Ie(o, e);
|
|
813
|
+
var t = ze(o);
|
|
814
|
+
// @docs-props-type ConcertinaPropsBase
|
|
815
|
+
function o(e) {
|
|
816
|
+
var n;
|
|
817
|
+
He(this, o);
|
|
818
|
+
n = t.call(this, e);
|
|
819
|
+
De(Ae(n), "panelPositions", void 0);
|
|
820
|
+
De(Ae(n), "handleUpdate", (function(e, t) {
|
|
821
|
+
n.panelPositions[t.index] = t;
|
|
822
|
+
var r = 0;
|
|
823
|
+
n.panelPositions.forEach((function(e) {
|
|
824
|
+
// eslint-disable-next-line no-param-reassign
|
|
825
|
+
e.offsetTop = r;
|
|
826
|
+
r += e.height || 0;
|
|
827
|
+
}));
|
|
828
|
+
n.updateHeadings();
|
|
829
|
+
}));
|
|
830
|
+
De(Ae(n), "handleElementMount", (function(e) {
|
|
831
|
+
n.setState({
|
|
832
|
+
scrollEl: e
|
|
833
|
+
});
|
|
834
|
+
// The scrollEl gets unmounted during the animation, it's necessary to cache the
|
|
835
|
+
// recorded height until it is remounted.
|
|
836
|
+
if (e) {
|
|
837
|
+
n.setState({
|
|
838
|
+
innerWidth: e.clientWidth
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
}));
|
|
842
|
+
De(Ae(n), "handleResize", (function() {
|
|
843
|
+
n.setState((function(e) {
|
|
844
|
+
var t;
|
|
845
|
+
return {
|
|
846
|
+
innerWidth: (t = e.scrollEl) === null || t === void 0 ? void 0 : t.clientWidth
|
|
847
|
+
};
|
|
848
|
+
}));
|
|
849
|
+
}));
|
|
850
|
+
De(Ae(n), "handleScroll", (function() {
|
|
851
|
+
n.updateHeadings();
|
|
852
|
+
}));
|
|
853
|
+
De(Ae(n), "handleScrollComplete", (function() {
|
|
854
|
+
n.setState({
|
|
855
|
+
targetTop: undefined
|
|
856
|
+
});
|
|
857
|
+
}));
|
|
858
|
+
De(Ae(n), "handleClick", (function(e, t) {
|
|
859
|
+
var r;
|
|
860
|
+
var o = t.index, i = t.position;
|
|
861
|
+
var a = n.state.scrollEl;
|
|
862
|
+
if (!a) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
var l = c()(n.panelPositions, o).map((function(e) {
|
|
866
|
+
return e.headingHeight;
|
|
867
|
+
})).reduce((function(e, t) {
|
|
868
|
+
return e + t;
|
|
869
|
+
}), 0);
|
|
870
|
+
// sum the heights
|
|
871
|
+
var s = f()(n.panelPositions, n.panelPositions.length - o - 1).map((function(e) {
|
|
872
|
+
return e.headingHeight;
|
|
873
|
+
})).reduce((function(e, t) {
|
|
874
|
+
return e + t;
|
|
875
|
+
}), 0);
|
|
876
|
+
// sum the heights
|
|
877
|
+
var u = a.clientHeight - l - s;
|
|
878
|
+
var p = n.panelPositions[o].height;
|
|
879
|
+
var d = ((r = n.panelPositions[o].offsetTop) !== null && r !== void 0 ? r : 0) - l;
|
|
880
|
+
var h = d - (u - p);
|
|
881
|
+
var y = u > p && (i === "bottom" || i === "inner");
|
|
882
|
+
// if the entire panel is in view, do nothing
|
|
883
|
+
if (y && h < a.scrollTop) {
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
var b = y ? h : d;
|
|
887
|
+
// handleRest will shift focus;
|
|
888
|
+
if (i !== "inner") {
|
|
889
|
+
e.currentTarget.blur();
|
|
890
|
+
}
|
|
891
|
+
n.setState({
|
|
892
|
+
targetTop: b
|
|
893
|
+
});
|
|
894
|
+
}));
|
|
895
|
+
De(Ae(n), "updateHeadingsImpl", (function() {
|
|
896
|
+
var e = n.state.scrollEl;
|
|
897
|
+
if (!e) {
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
var t = e.scrollTop;
|
|
901
|
+
function r(e, n) {
|
|
902
|
+
if (n.offsetTop !== undefined && n.offsetTop < t) {
|
|
903
|
+
t += n.headingHeight;
|
|
904
|
+
return e + 1;
|
|
905
|
+
}
|
|
906
|
+
return e;
|
|
907
|
+
}
|
|
908
|
+
var o = t + e.clientHeight;
|
|
909
|
+
function i(e, t) {
|
|
910
|
+
if (t.offsetTop !== undefined && t.offsetTop + t.headingHeight > o) {
|
|
911
|
+
o -= t.headingHeight;
|
|
912
|
+
return e + 1;
|
|
913
|
+
}
|
|
914
|
+
return e;
|
|
915
|
+
}
|
|
916
|
+
n.setState({
|
|
917
|
+
panelsTopCount: n.panelPositions.reduce(r, 0),
|
|
918
|
+
panelsBottomCount: n.panelPositions.reduceRight(i, 0)
|
|
919
|
+
});
|
|
920
|
+
}));
|
|
921
|
+
De(Ae(n), "updateHeadings", l()(n.updateHeadingsImpl, 0));
|
|
922
|
+
n.state = {
|
|
923
|
+
innerWidth: "100%",
|
|
924
|
+
panelsBottomCount: 0,
|
|
925
|
+
panelsTopCount: 0,
|
|
926
|
+
scrollEl: null
|
|
927
|
+
};
|
|
928
|
+
n.panelPositions = [];
|
|
929
|
+
return n;
|
|
930
|
+
}
|
|
931
|
+
Re(o, [ {
|
|
932
|
+
key: "componentWillUnmount",
|
|
933
|
+
value: function e() {
|
|
934
|
+
this.updateHeadings.cancel();
|
|
935
|
+
}
|
|
936
|
+
}, {
|
|
937
|
+
key: "renderHeadings",
|
|
938
|
+
value: function e(t, n) {
|
|
939
|
+
var o = this;
|
|
940
|
+
var i = t.map((function(e) {
|
|
941
|
+
var t;
|
|
942
|
+
|
|
943
|
+
return r().createElement($, {
|
|
944
|
+
onClick: o.handleClick,
|
|
945
|
+
description: e.props.description,
|
|
946
|
+
panelId: e.props.panelId,
|
|
947
|
+
index: (t = e.props.index) !== null && t !== void 0 ? t : 0,
|
|
948
|
+
position: n,
|
|
949
|
+
status: e.props.status,
|
|
950
|
+
key: e.props.panelId,
|
|
951
|
+
tabIndex: -1
|
|
952
|
+
}, e.props.title);
|
|
953
|
+
}));
|
|
954
|
+
return i;
|
|
955
|
+
}
|
|
956
|
+
}, {
|
|
957
|
+
key: "render",
|
|
958
|
+
value: function e() {
|
|
959
|
+
if (false) {}
|
|
960
|
+
var t = this.props, o = t.children, i = xe(t, [ "children" ]);
|
|
961
|
+
var a = n.Children.toArray(o).filter(n.isValidElement).map((function(e, t) {
|
|
962
|
+
|
|
963
|
+
return (0, n.cloneElement)(e, {
|
|
964
|
+
index: t
|
|
965
|
+
});
|
|
966
|
+
}));
|
|
967
|
+
var l = c()(a, this.state.panelsTopCount);
|
|
968
|
+
var s = f()(a, this.state.panelsBottomCount);
|
|
969
|
+
|
|
970
|
+
return r().createElement(Q, Ee({
|
|
971
|
+
"data-test": "concertina"
|
|
972
|
+
}, i), r().createElement(d(), {
|
|
973
|
+
target: window,
|
|
974
|
+
eventType: "resize",
|
|
975
|
+
listener: this.handleResize
|
|
976
|
+
}), this.state.panelsTopCount > 0 && r().createElement(X, {
|
|
977
|
+
style: {
|
|
978
|
+
width: this.state.innerWidth
|
|
979
|
+
},
|
|
980
|
+
"data-test": "dock-top"
|
|
981
|
+
}, this.renderHeadings(l, "top")), r().createElement(K, {
|
|
982
|
+
onScroll: this.handleScroll,
|
|
983
|
+
stopScrollPropagation: true,
|
|
984
|
+
key: "scroll-container",
|
|
985
|
+
elementRef: this.handleElementMount,
|
|
986
|
+
"data-test": "scroll",
|
|
987
|
+
top: this.state.targetTop,
|
|
988
|
+
onScrollComplete: this.handleScrollComplete
|
|
989
|
+
}, r().createElement(ne.Provider, {
|
|
990
|
+
value: {
|
|
991
|
+
onHeadingClick: this.handleClick,
|
|
992
|
+
onChange: this.handleUpdate
|
|
993
|
+
}
|
|
994
|
+
}, a)), this.state.panelsBottomCount > 0 && r().createElement(Y, {
|
|
995
|
+
style: {
|
|
996
|
+
width: this.state.innerWidth
|
|
997
|
+
},
|
|
998
|
+
"data-test": "dock-bottom"
|
|
999
|
+
}, this.renderHeadings(s, "bottom")));
|
|
1000
|
+
}
|
|
1001
|
+
} ]);
|
|
1002
|
+
return o;
|
|
1003
|
+
}(n.Component);
|
|
1004
|
+
De(Ue, "propTypes", Ne);
|
|
1005
|
+
De(Ue, "defaultProps", $e);
|
|
1006
|
+
De(Ue, "Panel", Pe);
|
|
1007
|
+
/* harmony default export */ const Ve = Ue;
|
|
1008
|
+
// CONCATENATED MODULE: ./src/Concertina/index.ts
|
|
1009
|
+
module.exports = t;
|
|
1010
|
+
/******/})();
|