@splunk/react-ui 4.21.0 → 4.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +24 -3
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1807 -2084
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1068 -1068
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +903 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1104 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3564 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +634 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +479 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +756 -650
- package/Select.js +2446 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +680 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +741 -680
- package/TabLayout.js +406 -322
- package/Table.js +4974 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +7 -7
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/Modal.js
CHANGED
|
@@ -1,641 +1,817 @@
|
|
|
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
|
-
const
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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 r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
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
|
+
Body: () => /* reexport */ F,
|
|
65
|
+
Footer: () => /* reexport */ K,
|
|
66
|
+
Header: () => /* reexport */ ae,
|
|
67
|
+
default: () => /* reexport */ qe
|
|
68
|
+
});
|
|
69
|
+
// CONCATENATED MODULE: external "react"
|
|
70
|
+
const r = require("react");
|
|
71
|
+
var n = e.n(r);
|
|
72
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
73
|
+
const o = require("prop-types");
|
|
74
|
+
var i = e.n(o);
|
|
75
|
+
// CONCATENATED MODULE: external "lodash/defer"
|
|
76
|
+
const a = require("lodash/defer");
|
|
77
|
+
var l = e.n(a);
|
|
78
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
79
|
+
const c = require("lodash/keys");
|
|
80
|
+
var s = e.n(c);
|
|
81
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
82
|
+
const u = require("lodash/omit");
|
|
83
|
+
var p = e.n(u);
|
|
84
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ModalLayer"
|
|
85
|
+
const f = require("@splunk/react-ui/ModalLayer");
|
|
86
|
+
var d = e.n(f);
|
|
87
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/focus"
|
|
88
|
+
const y = require("@splunk/ui-utils/focus");
|
|
89
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/id"
|
|
90
|
+
const b = require("@splunk/ui-utils/id");
|
|
91
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScrollContainerContext"
|
|
92
|
+
const m = require("@splunk/react-ui/ScrollContainerContext");
|
|
93
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
94
|
+
const v = require("styled-components");
|
|
95
|
+
var h = e.n(v);
|
|
96
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
97
|
+
const g = require("@splunk/react-ui/Box");
|
|
98
|
+
var x = e.n(g);
|
|
99
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
100
|
+
const O = require("@splunk/themes");
|
|
101
|
+
// CONCATENATED MODULE: ./src/Modal/BodyStyles.ts
|
|
102
|
+
var w = h()(x()).withConfig({
|
|
103
|
+
displayName: "BodyStyles__StyledBox",
|
|
104
|
+
componentId: "lv54z7-0"
|
|
105
|
+
})([ "background-color:", ";", " flex:0 1 auto;overflow:auto;@media all and (-ms-high-contrast:none){*::-ms-backdrop,&{max-height:calc(100vh - 180px);}}" ], (0,
|
|
106
|
+
O.pick)({
|
|
107
|
+
enterprise: O.variables.backgroundColor,
|
|
108
|
+
prisma: O.variables.backgroundColorDialog
|
|
109
|
+
}), (0, O.pick)({
|
|
110
|
+
enterprise: {
|
|
111
|
+
comfortable: (0, v.css)([ "padding:28px;" ]),
|
|
112
|
+
compact: (0, v.css)([ "padding:24px;" ])
|
|
113
|
+
},
|
|
114
|
+
prisma: {
|
|
115
|
+
comfortable: (0, v.css)([ "padding:12px 24px;&:first-child{padding-top:36px;}&:last-child{padding-bottom:36px;}" ]),
|
|
116
|
+
compact: (0, v.css)([ "padding:8px 24px;&:first-child{padding-top:26px;}&:last-child{padding-bottom:26px;}" ])
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
// CONCATENATED MODULE: ./src/Modal/Body.tsx
|
|
120
|
+
function S() {
|
|
121
|
+
S = Object.assign || function(e) {
|
|
122
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
123
|
+
var r = arguments[t];
|
|
124
|
+
for (var n in r) {
|
|
125
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
126
|
+
e[n] = r[n];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return e;
|
|
131
|
+
};
|
|
132
|
+
return S.apply(this, arguments);
|
|
133
|
+
}
|
|
134
|
+
function k(e, t) {
|
|
135
|
+
return _(e) || P(e, t) || C(e, t) || j();
|
|
136
|
+
}
|
|
137
|
+
function j() {
|
|
138
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
139
|
+
}
|
|
140
|
+
function C(e, t) {
|
|
141
|
+
if (!e) return;
|
|
142
|
+
if (typeof e === "string") return I(e, t);
|
|
143
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
144
|
+
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
145
|
+
if (r === "Map" || r === "Set") return Array.from(e);
|
|
146
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return I(e, t);
|
|
147
|
+
}
|
|
148
|
+
function I(e, t) {
|
|
149
|
+
if (t == null || t > e.length) t = e.length;
|
|
150
|
+
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
151
|
+
n[r] = e[r];
|
|
152
|
+
}
|
|
153
|
+
return n;
|
|
154
|
+
}
|
|
155
|
+
function P(e, t) {
|
|
156
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
157
|
+
var r = [];
|
|
158
|
+
var n = true;
|
|
159
|
+
var o = false;
|
|
160
|
+
var i = undefined;
|
|
161
|
+
try {
|
|
162
|
+
for (var a = e[Symbol.iterator](), l; !(n = (l = a.next()).done); n = true) {
|
|
163
|
+
r.push(l.value);
|
|
164
|
+
if (t && r.length === t) break;
|
|
165
|
+
}
|
|
166
|
+
} catch (e) {
|
|
167
|
+
o = true;
|
|
168
|
+
i = e;
|
|
169
|
+
} finally {
|
|
170
|
+
try {
|
|
171
|
+
if (!n && a["return"] != null) a["return"]();
|
|
172
|
+
} finally {
|
|
173
|
+
if (o) throw i;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return r;
|
|
177
|
+
}
|
|
178
|
+
function _(e) {
|
|
179
|
+
if (Array.isArray(e)) return e;
|
|
180
|
+
}
|
|
181
|
+
function E(e, t) {
|
|
182
|
+
if (e == null) return {};
|
|
183
|
+
var r = T(e, t);
|
|
184
|
+
var n, o;
|
|
185
|
+
if (Object.getOwnPropertySymbols) {
|
|
186
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
187
|
+
for (o = 0; o < i.length; o++) {
|
|
188
|
+
n = i[o];
|
|
189
|
+
if (t.indexOf(n) >= 0) continue;
|
|
190
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
191
|
+
r[n] = e[n];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return r;
|
|
195
|
+
}
|
|
196
|
+
function T(e, t) {
|
|
197
|
+
if (e == null) return {};
|
|
198
|
+
var r = {};
|
|
199
|
+
var n = Object.keys(e);
|
|
200
|
+
var o, i;
|
|
201
|
+
for (i = 0; i < n.length; i++) {
|
|
202
|
+
o = n[i];
|
|
203
|
+
if (t.indexOf(o) >= 0) continue;
|
|
204
|
+
r[o] = e[o];
|
|
205
|
+
}
|
|
206
|
+
return r;
|
|
207
|
+
}
|
|
208
|
+
var M = {
|
|
209
|
+
children: i().node
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
141
212
|
* A styled container for `Modal` body content.
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
213
|
+
*/ function q(e) {
|
|
214
|
+
var t = e.children, o = E(e, [ "children" ]);
|
|
215
|
+
// @docs-props-type BodyPropsBase
|
|
216
|
+
var i = (0, r.useState)(), a = k(i, 2), l = a[0], c = a[1];
|
|
217
|
+
var s = (0, r.useCallback)((function(e) {
|
|
218
|
+
c(e);
|
|
219
|
+
}), []);
|
|
220
|
+
|
|
221
|
+
return n().createElement(w, S({
|
|
222
|
+
"data-test": "body"
|
|
223
|
+
}, o, {
|
|
224
|
+
elementRef: s
|
|
225
|
+
}), n().createElement(m.ScrollContainerProvider, {
|
|
226
|
+
value: l
|
|
227
|
+
}, t));
|
|
228
|
+
}
|
|
229
|
+
q.propTypes = M;
|
|
230
|
+
/* harmony default export */ const F = q;
|
|
231
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Divider"
|
|
232
|
+
const D = require("@splunk/react-ui/Divider");
|
|
233
|
+
var R = e.n(D);
|
|
234
|
+
// CONCATENATED MODULE: ./src/Modal/FooterStyles.ts
|
|
235
|
+
var A = h()(x()).withConfig({
|
|
236
|
+
displayName: "FooterStyles__StyledBox",
|
|
237
|
+
componentId: "yszcmv-0"
|
|
238
|
+
})([ "flex:0 0 auto;text-align:right;padding:", ";background-color:", ";& > button{min-width:80px;}" ], (0,
|
|
239
|
+
O.pick)({
|
|
240
|
+
enterprise: O.variables.spacing,
|
|
241
|
+
prisma: {
|
|
242
|
+
comfortable: "24px",
|
|
243
|
+
compact: "18px 24px"
|
|
244
|
+
}
|
|
245
|
+
}), (0, O.pick)({
|
|
246
|
+
enterprise: O.variables.backgroundColor,
|
|
247
|
+
prisma: O.variables.backgroundColorDialog
|
|
248
|
+
}));
|
|
249
|
+
// CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
|
|
250
|
+
var B = (0, r.createContext)({});
|
|
251
|
+
/* harmony default export */ const H = B;
|
|
252
|
+
// CONCATENATED MODULE: ./src/Modal/Footer.tsx
|
|
253
|
+
function N() {
|
|
254
|
+
N = Object.assign || function(e) {
|
|
255
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
256
|
+
var r = arguments[t];
|
|
257
|
+
for (var n in r) {
|
|
258
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
259
|
+
e[n] = r[n];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return e;
|
|
264
|
+
};
|
|
265
|
+
return N.apply(this, arguments);
|
|
266
|
+
}
|
|
267
|
+
function z(e, t) {
|
|
268
|
+
if (e == null) return {};
|
|
269
|
+
var r = L(e, t);
|
|
270
|
+
var n, o;
|
|
271
|
+
if (Object.getOwnPropertySymbols) {
|
|
272
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
273
|
+
for (o = 0; o < i.length; o++) {
|
|
274
|
+
n = i[o];
|
|
275
|
+
if (t.indexOf(n) >= 0) continue;
|
|
276
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
277
|
+
r[n] = e[n];
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return r;
|
|
281
|
+
}
|
|
282
|
+
function L(e, t) {
|
|
283
|
+
if (e == null) return {};
|
|
284
|
+
var r = {};
|
|
285
|
+
var n = Object.keys(e);
|
|
286
|
+
var o, i;
|
|
287
|
+
for (i = 0; i < n.length; i++) {
|
|
288
|
+
o = n[i];
|
|
289
|
+
if (t.indexOf(o) >= 0) continue;
|
|
290
|
+
r[o] = e[o];
|
|
291
|
+
}
|
|
292
|
+
return r;
|
|
293
|
+
}
|
|
294
|
+
var X = {
|
|
295
|
+
children: i().node
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
209
298
|
* A styled container for `Modal` footer content.
|
|
210
|
-
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
})
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}));
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
var
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
299
|
+
*/ function $(e) {
|
|
300
|
+
var t = e.children, o = z(e, [ "children" ]);
|
|
301
|
+
// @docs-props-type FooterPropsBase
|
|
302
|
+
var i = (0, r.useContext)(H), a = i.divider;
|
|
303
|
+
var l = a === "both" || a === "footer";
|
|
304
|
+
|
|
305
|
+
return n().createElement(n().Fragment, null, l && n().createElement(R(), {
|
|
306
|
+
"aria-hidden": true
|
|
307
|
+
}), n().createElement(A, N({
|
|
308
|
+
"data-test": "footer"
|
|
309
|
+
}, o), t));
|
|
310
|
+
}
|
|
311
|
+
$.propTypes = X;
|
|
312
|
+
/* harmony default export */ const K = $;
|
|
313
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/CloseButton"
|
|
314
|
+
const U = require("@splunk/react-ui/CloseButton");
|
|
315
|
+
var W = e.n(U);
|
|
316
|
+
// CONCATENATED MODULE: ./src/Modal/HeaderStyles.ts
|
|
317
|
+
var V = h()(x()).withConfig({
|
|
318
|
+
displayName: "HeaderStyles__StyledBox",
|
|
319
|
+
componentId: "sc-1y722ut-0"
|
|
320
|
+
})([ "", ";flex:0 0 auto;position:relative;min-height:", ";background-color:", ";padding:", ";align-items:center;padding-right:", ";" ], O.mixins.reset("flex"), (0,
|
|
321
|
+
O.pick)({
|
|
322
|
+
enterprise: "30px",
|
|
323
|
+
prisma: {
|
|
324
|
+
comfortable: "60px",
|
|
325
|
+
compact: "52px"
|
|
326
|
+
}
|
|
327
|
+
}), (0, O.pick)({
|
|
328
|
+
enterprise: O.variables.backgroundColor,
|
|
329
|
+
prisma: O.variables.backgroundColorDialog
|
|
330
|
+
}), (0, O.pick)({
|
|
331
|
+
enterprise: "25px 28px",
|
|
332
|
+
prisma: {
|
|
333
|
+
comfortable: "18px 24px",
|
|
334
|
+
compact: "14px 24px"
|
|
335
|
+
}
|
|
336
|
+
}), (function(e) {
|
|
337
|
+
var t = e.$close;
|
|
338
|
+
return t && (0, O.pick)({
|
|
339
|
+
enterprise: "54px",
|
|
340
|
+
prisma: {
|
|
341
|
+
comfortable: "64px",
|
|
342
|
+
compact: "56px"
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}));
|
|
346
|
+
var G = h().div.withConfig({
|
|
347
|
+
displayName: "HeaderStyles__StyledTitleWrapper",
|
|
348
|
+
componentId: "sc-1y722ut-1"
|
|
349
|
+
})([ "", ";flex-direction:column;" ], O.mixins.reset("flex"));
|
|
350
|
+
var J = h().div.withConfig({
|
|
351
|
+
displayName: "HeaderStyles__StyledIcon",
|
|
352
|
+
componentId: "sc-1y722ut-2"
|
|
353
|
+
})([ "", ";align-items:center;justify-content:center;margin-right:", ";", " width:", ";height:", ";flex-shrink:0;" ], O.mixins.reset("inline-flex"), O.variables.spacingLarge, (0,
|
|
354
|
+
O.pick)({
|
|
355
|
+
prisma: (0, v.css)([ "background-color:", ";" ], O.variables.transparent)
|
|
356
|
+
}), (0, O.pick)({
|
|
357
|
+
comfortable: "40px",
|
|
358
|
+
compact: "32px"
|
|
359
|
+
}), (0, O.pick)({
|
|
360
|
+
comfortable: "40px",
|
|
361
|
+
compact: "32px"
|
|
362
|
+
}));
|
|
363
|
+
var Q = h().div.withConfig({
|
|
364
|
+
displayName: "HeaderStyles__StyledTitle",
|
|
365
|
+
componentId: "sc-1y722ut-3"
|
|
366
|
+
})([ "", ";font-size:20px;margin:0;overflow-wrap:break-word;font-weight:", ";", "" ], O.mixins.reset("block"), O.variables.fontWeightSemiBold, (0,
|
|
367
|
+
O.pick)({
|
|
368
|
+
enterprise: (0, v.css)([ "line-height:22px;" ]),
|
|
369
|
+
prisma: (0, v.css)([ "color:", ";line-height:24px;" ], O.variables.contentColorActive)
|
|
370
|
+
}));
|
|
371
|
+
var Y = h().div.withConfig({
|
|
372
|
+
displayName: "HeaderStyles__StyledSubtitle",
|
|
373
|
+
componentId: "sc-1y722ut-4"
|
|
374
|
+
})([ "", ";font-size:14px;overflow-wrap:break-word;line-height:", ";" ], O.mixins.reset("block"), (0,
|
|
375
|
+
O.pick)({
|
|
376
|
+
enterprise: O.variables.lineHeight,
|
|
377
|
+
prisma: "20px"
|
|
378
|
+
}));
|
|
379
|
+
var Z = h().div.withConfig({
|
|
380
|
+
displayName: "HeaderStyles__StyledButtonsWrapper",
|
|
381
|
+
componentId: "sc-1y722ut-5"
|
|
382
|
+
})([ "", ";position:absolute;top:", ";right:", ";bottom:50%;", " max-height:35px;transform-origin:bottom right;transform:rotate(-90deg) translateX(100%);" ], O.mixins.reset("block"), (0,
|
|
383
|
+
O.pick)({
|
|
384
|
+
enterprise: 0,
|
|
385
|
+
prisma: {
|
|
386
|
+
comfortable: "-2px",
|
|
387
|
+
compact: "-6px"
|
|
388
|
+
}
|
|
389
|
+
}), (0, O.pick)({
|
|
390
|
+
enterprise: 0,
|
|
391
|
+
prisma: {
|
|
392
|
+
comfortable: "-2px",
|
|
393
|
+
compact: "-6px"
|
|
394
|
+
}
|
|
395
|
+
}), (0, O.pick)({
|
|
396
|
+
prisma: {
|
|
397
|
+
comfortable: (0, v.css)([ "min-height:35px;" ]),
|
|
398
|
+
compact: (0, v.css)([ "min-height:30px;" ])
|
|
399
|
+
}
|
|
400
|
+
}));
|
|
401
|
+
var ee = h().div.withConfig({
|
|
402
|
+
displayName: "HeaderStyles__StyledClose",
|
|
403
|
+
componentId: "sc-1y722ut-6"
|
|
404
|
+
})([ "", ";position:absolute;right:0;top:0;transform:rotate(90deg) translate(-50%,-50%);" ], O.mixins.reset("block"));
|
|
405
|
+
// CONCATENATED MODULE: ./src/Modal/Header.tsx
|
|
406
|
+
function te() {
|
|
407
|
+
te = Object.assign || function(e) {
|
|
408
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
409
|
+
var r = arguments[t];
|
|
410
|
+
for (var n in r) {
|
|
411
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
412
|
+
e[n] = r[n];
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return e;
|
|
417
|
+
};
|
|
418
|
+
return te.apply(this, arguments);
|
|
419
|
+
}
|
|
420
|
+
function re(e, t) {
|
|
421
|
+
if (e == null) return {};
|
|
422
|
+
var r = ne(e, t);
|
|
423
|
+
var n, o;
|
|
424
|
+
if (Object.getOwnPropertySymbols) {
|
|
425
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
426
|
+
for (o = 0; o < i.length; o++) {
|
|
427
|
+
n = i[o];
|
|
428
|
+
if (t.indexOf(n) >= 0) continue;
|
|
429
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
430
|
+
r[n] = e[n];
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return r;
|
|
434
|
+
}
|
|
435
|
+
function ne(e, t) {
|
|
436
|
+
if (e == null) return {};
|
|
437
|
+
var r = {};
|
|
438
|
+
var n = Object.keys(e);
|
|
439
|
+
var o, i;
|
|
440
|
+
for (i = 0; i < n.length; i++) {
|
|
441
|
+
o = n[i];
|
|
442
|
+
if (t.indexOf(o) >= 0) continue;
|
|
443
|
+
r[o] = e[o];
|
|
444
|
+
}
|
|
445
|
+
return r;
|
|
446
|
+
}
|
|
447
|
+
var oe = {
|
|
448
|
+
children: i().node,
|
|
449
|
+
icon: i().node,
|
|
450
|
+
onRequestClose: i().func,
|
|
451
|
+
subtitle: i().node,
|
|
452
|
+
title: i().string
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
342
455
|
* A styled container for `Modal` header content.
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
;// CONCATENATED MODULE: ./src/Modal/Modal.tsx
|
|
391
|
-
function Modal_extends() { Modal_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 Modal_extends.apply(this, arguments); }
|
|
392
|
-
|
|
393
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Modal_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
394
|
-
|
|
395
|
-
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."); }
|
|
396
|
-
|
|
397
|
-
function Modal_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Modal_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 Modal_arrayLikeToArray(o, minLen); }
|
|
398
|
-
|
|
399
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
400
|
-
|
|
401
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Modal_arrayLikeToArray(arr); }
|
|
402
|
-
|
|
403
|
-
function Modal_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; }
|
|
404
|
-
|
|
405
|
-
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; }
|
|
406
|
-
|
|
407
|
-
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) { _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; }
|
|
408
|
-
|
|
409
|
-
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); }
|
|
410
|
-
|
|
411
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
412
|
-
|
|
413
|
-
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); } }
|
|
414
|
-
|
|
415
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
416
|
-
|
|
417
|
-
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); }
|
|
418
|
-
|
|
419
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
420
|
-
|
|
421
|
-
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); }; }
|
|
422
|
-
|
|
423
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
424
|
-
|
|
425
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
426
|
-
|
|
427
|
-
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; } }
|
|
428
|
-
|
|
429
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
430
|
-
|
|
431
|
-
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; }
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
/** @public */
|
|
447
|
-
|
|
448
|
-
var Modal_propTypes = {
|
|
449
|
-
children: (external_prop_types_default()).node,
|
|
450
|
-
initialFocus: external_prop_types_default().oneOfType([(external_prop_types_default()).object, external_prop_types_default().oneOf(['first', 'container'])]),
|
|
451
|
-
onRequestClose: (external_prop_types_default()).func,
|
|
452
|
-
open: (external_prop_types_default()).bool,
|
|
453
|
-
divider: external_prop_types_default().oneOf(['header', 'footer', 'both', 'none'])
|
|
454
|
-
};
|
|
455
|
-
var defaultProps = {
|
|
456
|
-
initialFocus: 'first',
|
|
457
|
-
open: false,
|
|
458
|
-
divider: 'both'
|
|
459
|
-
};
|
|
460
|
-
|
|
461
|
-
var Modal = /*#__PURE__*/function (_Component) {
|
|
462
|
-
_inherits(Modal, _Component);
|
|
463
|
-
|
|
464
|
-
var _super = _createSuper(Modal);
|
|
465
|
-
|
|
466
|
-
// @docs-props-type ModalPropsBase
|
|
467
|
-
// this timeout ensures that the Modal is finished rendering before setting the focus
|
|
468
|
-
function Modal(props) {
|
|
469
|
-
var _this;
|
|
470
|
-
|
|
471
|
-
_classCallCheck(this, Modal);
|
|
472
|
-
|
|
473
|
-
_this = _super.call(this, props);
|
|
474
|
-
|
|
475
|
-
_defineProperty(_assertThisInitialized(_this), "el", null);
|
|
476
|
-
|
|
477
|
-
_defineProperty(_assertThisInitialized(_this), "initialFocusTimeoutId", undefined);
|
|
478
|
-
|
|
479
|
-
_defineProperty(_assertThisInitialized(_this), "initialFocus", null);
|
|
480
|
-
|
|
481
|
-
_defineProperty(_assertThisInitialized(_this), "headerTitleId", void 0);
|
|
482
|
-
|
|
483
|
-
_defineProperty(_assertThisInitialized(_this), "getDefaultMotionStyle", function () {
|
|
484
|
-
return {
|
|
485
|
-
top: 0
|
|
486
|
-
};
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
_defineProperty(_assertThisInitialized(_this), "getMotionStyle", function () {
|
|
490
|
-
if (_this.props.open) {
|
|
491
|
-
return {
|
|
492
|
-
top: 40
|
|
456
|
+
*/ function ie(e) {
|
|
457
|
+
var t = e.children, o = e.icon, i = e.onRequestClose, a = e.subtitle, l = e.title, c = re(e, [ "children", "icon", "onRequestClose", "subtitle", "title" ]);
|
|
458
|
+
// @docs-props-type StepPropsBase
|
|
459
|
+
var s = (0, r.useContext)(H), u = s.titleId, p = s.divider;
|
|
460
|
+
var f = p === "both" || p === "header";
|
|
461
|
+
|
|
462
|
+
return n().createElement(n().Fragment, null, n().createElement(V, te({
|
|
463
|
+
$close: !!i,
|
|
464
|
+
"data-test": "header"
|
|
465
|
+
}, c), o && n().createElement(J, null, o), l ? n().createElement(G, null, l && n().createElement(Q, {
|
|
466
|
+
id: u,
|
|
467
|
+
"data-test": "title"
|
|
468
|
+
}, l), a && n().createElement(Y, {
|
|
469
|
+
"data-test": "subtitle"
|
|
470
|
+
}, a)) : t, i && n().createElement(Z, null, i && n().createElement(ee, null, n().createElement(W(), {
|
|
471
|
+
onClick: i,
|
|
472
|
+
"data-test": "close"
|
|
473
|
+
})))), f && n().createElement(R(), {
|
|
474
|
+
"aria-hidden": true
|
|
475
|
+
}));
|
|
476
|
+
}
|
|
477
|
+
ie.propTypes = oe;
|
|
478
|
+
/* harmony default export */ const ae = ie;
|
|
479
|
+
// CONCATENATED MODULE: external "react-spring"
|
|
480
|
+
const le = require("react-spring");
|
|
481
|
+
// CONCATENATED MODULE: ./src/Modal/ModalStyles.ts
|
|
482
|
+
var ce = h()(le.animated.div).withConfig({
|
|
483
|
+
displayName: "ModalStyles__Styled",
|
|
484
|
+
componentId: "sc-5fn8ds-0"
|
|
485
|
+
})([ "", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";", "" ], O.mixins.reset("flex"), O.variables.zindexModal, (0,
|
|
486
|
+
O.pick)({
|
|
487
|
+
enterprise: (0, v.css)([ "box-shadow:0 1px 5px ", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);" ], O.variables.black, O.variables.spacing, O.variables.spacing),
|
|
488
|
+
prisma: (0, v.css)([ "box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;" ], O.variables.modalShadow, O.variables.spacingXLarge, O.variables.spacingXLarge, O.variables.borderRadius)
|
|
489
|
+
}));
|
|
490
|
+
// CONCATENATED MODULE: ./src/Modal/Modal.tsx
|
|
491
|
+
function se() {
|
|
492
|
+
se = Object.assign || function(e) {
|
|
493
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
494
|
+
var r = arguments[t];
|
|
495
|
+
for (var n in r) {
|
|
496
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
497
|
+
e[n] = r[n];
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return e;
|
|
493
502
|
};
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
503
|
+
return se.apply(this, arguments);
|
|
504
|
+
}
|
|
505
|
+
function ue(e) {
|
|
506
|
+
return ye(e) || de(e) || fe(e) || pe();
|
|
507
|
+
}
|
|
508
|
+
function pe() {
|
|
509
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
510
|
+
}
|
|
511
|
+
function fe(e, t) {
|
|
512
|
+
if (!e) return;
|
|
513
|
+
if (typeof e === "string") return be(e, t);
|
|
514
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
515
|
+
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
516
|
+
if (r === "Map" || r === "Set") return Array.from(e);
|
|
517
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return be(e, t);
|
|
518
|
+
}
|
|
519
|
+
function de(e) {
|
|
520
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
521
|
+
}
|
|
522
|
+
function ye(e) {
|
|
523
|
+
if (Array.isArray(e)) return be(e);
|
|
524
|
+
}
|
|
525
|
+
function be(e, t) {
|
|
526
|
+
if (t == null || t > e.length) t = e.length;
|
|
527
|
+
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
528
|
+
n[r] = e[r];
|
|
529
|
+
}
|
|
530
|
+
return n;
|
|
531
|
+
}
|
|
532
|
+
function me(e, t) {
|
|
533
|
+
var r = Object.keys(e);
|
|
534
|
+
if (Object.getOwnPropertySymbols) {
|
|
535
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
536
|
+
if (t) n = n.filter((function(t) {
|
|
537
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
538
|
+
}));
|
|
539
|
+
r.push.apply(r, n);
|
|
540
|
+
}
|
|
541
|
+
return r;
|
|
542
|
+
}
|
|
543
|
+
function ve(e) {
|
|
544
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
545
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
546
|
+
if (t % 2) {
|
|
547
|
+
me(Object(r), true).forEach((function(t) {
|
|
548
|
+
_e(e, t, r[t]);
|
|
549
|
+
}));
|
|
550
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
551
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
552
|
+
} else {
|
|
553
|
+
me(Object(r)).forEach((function(t) {
|
|
554
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
555
|
+
}));
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return e;
|
|
559
|
+
}
|
|
560
|
+
function he(e) {
|
|
561
|
+
"@babel/helpers - typeof";
|
|
562
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
563
|
+
he = function e(t) {
|
|
564
|
+
return typeof t;
|
|
565
|
+
};
|
|
566
|
+
} else {
|
|
567
|
+
he = function e(t) {
|
|
568
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
return he(e);
|
|
572
|
+
}
|
|
573
|
+
function ge(e, t) {
|
|
574
|
+
if (!(e instanceof t)) {
|
|
575
|
+
throw new TypeError("Cannot call a class as a function");
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function xe(e, t) {
|
|
579
|
+
for (var r = 0; r < t.length; r++) {
|
|
580
|
+
var n = t[r];
|
|
581
|
+
n.enumerable = n.enumerable || false;
|
|
582
|
+
n.configurable = true;
|
|
583
|
+
if ("value" in n) n.writable = true;
|
|
584
|
+
Object.defineProperty(e, n.key, n);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function Oe(e, t, r) {
|
|
588
|
+
if (t) xe(e.prototype, t);
|
|
589
|
+
if (r) xe(e, r);
|
|
590
|
+
return e;
|
|
591
|
+
}
|
|
592
|
+
function we(e, t) {
|
|
593
|
+
if (typeof t !== "function" && t !== null) {
|
|
594
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
595
|
+
}
|
|
596
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
597
|
+
constructor: {
|
|
598
|
+
value: e,
|
|
599
|
+
writable: true,
|
|
600
|
+
configurable: true
|
|
530
601
|
}
|
|
531
|
-
|
|
532
|
-
_this.initialFocus = initialFocus;
|
|
533
|
-
}
|
|
534
602
|
});
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
style = _this$props3.style,
|
|
561
|
-
children = _this$props3.children,
|
|
562
|
-
divider = _this$props3.divider;
|
|
563
|
-
var top = interpolatedStyle.top,
|
|
564
|
-
opacity = interpolatedStyle.opacity;
|
|
565
|
-
var clonedChildren = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
566
|
-
return /*#__PURE__*/external_react_default().createElement(Styled // eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
|
|
567
|
-
, Modal_extends({
|
|
568
|
-
ref: _this.handleModalMount,
|
|
569
|
-
"data-test": "modal",
|
|
570
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
571
|
-
top: top,
|
|
572
|
-
opacity: opacity
|
|
573
|
-
}),
|
|
574
|
-
tabIndex: -1,
|
|
575
|
-
onKeyDown: _this.handleModalKeyDown,
|
|
576
|
-
role: "dialog",
|
|
577
|
-
"aria-labelledby": _this.headerTitleId
|
|
578
|
-
}, omit_default()(_this.props, [].concat(_toConsumableArray(keys_default()(Modal.propTypes)), ['style']))), /*#__PURE__*/external_react_default().createElement(Modal_ModalContext.Provider, {
|
|
579
|
-
value: {
|
|
580
|
-
titleId: _this.headerTitleId,
|
|
581
|
-
divider: divider
|
|
603
|
+
if (t) Se(e, t);
|
|
604
|
+
}
|
|
605
|
+
function Se(e, t) {
|
|
606
|
+
Se = Object.setPrototypeOf || function e(t, r) {
|
|
607
|
+
t.__proto__ = r;
|
|
608
|
+
return t;
|
|
609
|
+
};
|
|
610
|
+
return Se(e, t);
|
|
611
|
+
}
|
|
612
|
+
function ke(e) {
|
|
613
|
+
var t = Ie();
|
|
614
|
+
return function r() {
|
|
615
|
+
var n = Pe(e), o;
|
|
616
|
+
if (t) {
|
|
617
|
+
var i = Pe(this).constructor;
|
|
618
|
+
o = Reflect.construct(n, arguments, i);
|
|
619
|
+
} else {
|
|
620
|
+
o = n.apply(this, arguments);
|
|
621
|
+
}
|
|
622
|
+
return je(this, o);
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
function je(e, t) {
|
|
626
|
+
if (t && (he(t) === "object" || typeof t === "function")) {
|
|
627
|
+
return t;
|
|
582
628
|
}
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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
|
-
;
|
|
629
|
+
return Ce(e);
|
|
630
|
+
}
|
|
631
|
+
function Ce(e) {
|
|
632
|
+
if (e === void 0) {
|
|
633
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
634
|
+
}
|
|
635
|
+
return e;
|
|
636
|
+
}
|
|
637
|
+
function Ie() {
|
|
638
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
639
|
+
if (Reflect.construct.sham) return false;
|
|
640
|
+
if (typeof Proxy === "function") return true;
|
|
641
|
+
try {
|
|
642
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
643
|
+
return true;
|
|
644
|
+
} catch (e) {
|
|
645
|
+
return false;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
function Pe(e) {
|
|
649
|
+
Pe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
650
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
651
|
+
};
|
|
652
|
+
return Pe(e);
|
|
653
|
+
}
|
|
654
|
+
function _e(e, t, r) {
|
|
655
|
+
if (t in e) {
|
|
656
|
+
Object.defineProperty(e, t, {
|
|
657
|
+
value: r,
|
|
658
|
+
enumerable: true,
|
|
659
|
+
configurable: true,
|
|
660
|
+
writable: true
|
|
661
|
+
});
|
|
662
|
+
} else {
|
|
663
|
+
e[t] = r;
|
|
664
|
+
}
|
|
665
|
+
return e;
|
|
666
|
+
}
|
|
667
|
+
/** @public */ var Ee = {
|
|
668
|
+
children: i().node,
|
|
669
|
+
initialFocus: i().oneOfType([ i().object, i().oneOf([ "first", "container" ]) ]),
|
|
670
|
+
onRequestClose: i().func,
|
|
671
|
+
open: i().bool,
|
|
672
|
+
divider: i().oneOf([ "header", "footer", "both", "none" ])
|
|
673
|
+
};
|
|
674
|
+
var Te = {
|
|
675
|
+
initialFocus: "first",
|
|
676
|
+
open: false,
|
|
677
|
+
divider: "both"
|
|
678
|
+
};
|
|
679
|
+
var Me = function(e) {
|
|
680
|
+
we(o, e);
|
|
681
|
+
var t = ke(o);
|
|
682
|
+
// @docs-props-type ModalPropsBase
|
|
683
|
+
// this timeout ensures that the Modal is finished rendering before setting the focus
|
|
684
|
+
function o(e) {
|
|
685
|
+
var i;
|
|
686
|
+
ge(this, o);
|
|
687
|
+
i = t.call(this, e);
|
|
688
|
+
_e(Ce(i), "el", null);
|
|
689
|
+
_e(Ce(i), "initialFocusTimeoutId", undefined);
|
|
690
|
+
_e(Ce(i), "initialFocus", null);
|
|
691
|
+
_e(Ce(i), "headerTitleId", void 0);
|
|
692
|
+
_e(Ce(i), "getDefaultMotionStyle", (function() {
|
|
693
|
+
return {
|
|
694
|
+
top: 0
|
|
695
|
+
};
|
|
696
|
+
}));
|
|
697
|
+
_e(Ce(i), "getMotionStyle", (function() {
|
|
698
|
+
if (i.props.open) {
|
|
699
|
+
return {
|
|
700
|
+
top: 40
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
return {
|
|
704
|
+
top: 0
|
|
705
|
+
};
|
|
706
|
+
}));
|
|
707
|
+
_e(Ce(i), "handleInitialFocus", (function() {
|
|
708
|
+
var e = i.props, t = e.initialFocus, r = e.open;
|
|
709
|
+
if (r) {
|
|
710
|
+
i.initialFocusTimeoutId = l()((function() {
|
|
711
|
+
var e;
|
|
712
|
+
// not using the takeFocus() util here because it
|
|
713
|
+
// doesn't work for all values of "initialFocus"
|
|
714
|
+
// and it has a nested defer() call, which we want to avoid
|
|
715
|
+
if (i.initialFocus !== t) {
|
|
716
|
+
if (t === "first") {
|
|
717
|
+
if (i.el) {
|
|
718
|
+
/* eslint-disable prefer-destructuring */
|
|
719
|
+
/* prefer-desturucting leads to harder-to-read syntax in this case */
|
|
720
|
+
e = (0, y.getSortedTabbableElements)(i.el)[0];
|
|
721
|
+
/* eslint-enable prefer-destructuring */ }
|
|
722
|
+
} else if (t === "container") {
|
|
723
|
+
e = i.el;
|
|
724
|
+
} else if (he(t) === "object") {
|
|
725
|
+
e = t;
|
|
726
|
+
}
|
|
727
|
+
// Typescript isn't happy with optional chaining here
|
|
728
|
+
if (e != null && "focus" in e) {
|
|
729
|
+
e.focus();
|
|
730
|
+
}
|
|
731
|
+
i.initialFocus = t;
|
|
732
|
+
}
|
|
733
|
+
}));
|
|
734
|
+
} else {
|
|
735
|
+
i.initialFocus = null;
|
|
736
|
+
clearTimeout(i.initialFocusTimeoutId);
|
|
737
|
+
}
|
|
738
|
+
}));
|
|
739
|
+
_e(Ce(i), "handleModalMount", (function(e) {
|
|
740
|
+
i.el = e;
|
|
741
|
+
}));
|
|
742
|
+
_e(Ce(i), "handleModalKeyDown", (function(e) {
|
|
743
|
+
if (i.el !== null) {
|
|
744
|
+
(0, y.handleTab)(i.el, e.nativeEvent);
|
|
745
|
+
}
|
|
746
|
+
}));
|
|
747
|
+
_e(Ce(i), "handleRequestClose", (function(e) {
|
|
748
|
+
var t, r;
|
|
749
|
+
i.initialFocus = null;
|
|
750
|
+
(t = (r = i.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
751
|
+
}));
|
|
752
|
+
_e(Ce(i), "renderModal", (function(e) {
|
|
753
|
+
var t = i.props, a = t.style, l = t.children, c = t.divider;
|
|
754
|
+
var u = e.top, f = e.opacity;
|
|
755
|
+
var d = r.Children.toArray(l).filter(r.isValidElement);
|
|
756
|
+
|
|
757
|
+
return n().createElement(ce, se({
|
|
758
|
+
ref: i.handleModalMount,
|
|
759
|
+
"data-test": "modal",
|
|
760
|
+
style: ve(ve({}, a), {}, {
|
|
761
|
+
top: u,
|
|
762
|
+
opacity: f
|
|
763
|
+
}),
|
|
764
|
+
tabIndex: -1,
|
|
765
|
+
onKeyDown: i.handleModalKeyDown,
|
|
766
|
+
role: "dialog",
|
|
767
|
+
"aria-labelledby": i.headerTitleId
|
|
768
|
+
}, p()(i.props, [].concat(ue(s()(o.propTypes)), [ "style" ]))), n().createElement(H.Provider, {
|
|
769
|
+
value: {
|
|
770
|
+
titleId: i.headerTitleId,
|
|
771
|
+
divider: c
|
|
772
|
+
}
|
|
773
|
+
}, d));
|
|
774
|
+
}));
|
|
775
|
+
i.headerTitleId = (0, b.createDOMID)("titleId");
|
|
776
|
+
return i;
|
|
777
|
+
}
|
|
778
|
+
Oe(o, [ {
|
|
779
|
+
key: "componentDidMount",
|
|
780
|
+
value: function e() {
|
|
781
|
+
this.handleInitialFocus();
|
|
782
|
+
}
|
|
783
|
+
}, {
|
|
784
|
+
key: "componentDidUpdate",
|
|
785
|
+
value: function e(t) {
|
|
786
|
+
var r = this.props.initialFocus;
|
|
787
|
+
if (t.initialFocus !== r) {
|
|
788
|
+
// cancel the defer() set up in handleInitialFocus()
|
|
789
|
+
// so that focus won't jump around if "initialFocus" changes
|
|
790
|
+
clearTimeout(this.initialFocusTimeoutId);
|
|
791
|
+
}
|
|
792
|
+
this.handleInitialFocus();
|
|
793
|
+
}
|
|
794
|
+
}, {
|
|
795
|
+
key: "render",
|
|
796
|
+
value: function e() {
|
|
797
|
+
|
|
798
|
+
return n().createElement(d(), {
|
|
799
|
+
open: this.props.open,
|
|
800
|
+
getDefaultMotionStyle: this.getDefaultMotionStyle,
|
|
801
|
+
renderModal: this.renderModal,
|
|
802
|
+
getMotionStyle: this.getMotionStyle,
|
|
803
|
+
onRequestClose: this.handleRequestClose
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
} ]);
|
|
807
|
+
return o;
|
|
808
|
+
}(r.Component);
|
|
809
|
+
_e(Me, "propTypes", Ee);
|
|
810
|
+
_e(Me, "defaultProps", Te);
|
|
811
|
+
_e(Me, "Header", ae);
|
|
812
|
+
_e(Me, "Body", F);
|
|
813
|
+
_e(Me, "Footer", K);
|
|
814
|
+
/* harmony default export */ const qe = Me;
|
|
815
|
+
// CONCATENATED MODULE: ./src/Modal/index.ts
|
|
816
|
+
module.exports = t;
|
|
817
|
+
/******/})();
|