@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/Layer.js
CHANGED
|
@@ -1,593 +1,453 @@
|
|
|
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
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 223);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 123:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("lodash/pull");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 15:
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("lodash/includes");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 16:
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("@splunk/react-ui/EventListener");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
|
|
125
|
-
/***/ 168:
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
var g;
|
|
129
|
-
|
|
130
|
-
// This works in non-strict mode
|
|
131
|
-
g = (function() {
|
|
132
|
-
return this;
|
|
133
|
-
})();
|
|
134
|
-
|
|
135
|
-
try {
|
|
136
|
-
// This works if eval is allowed (see CSP)
|
|
137
|
-
g = g || new Function("return this")();
|
|
138
|
-
} catch (e) {
|
|
139
|
-
// This works if the window reference is available
|
|
140
|
-
if (typeof window === "object") g = window;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// g can still be undefined, but nothing to do about it...
|
|
144
|
-
// We return undefined, instead of nothing here, so it's
|
|
145
|
-
// easier to handle this case. if(!global) { ...}
|
|
146
|
-
|
|
147
|
-
module.exports = g;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ 2:
|
|
153
|
-
/***/ (function(module, exports) {
|
|
154
|
-
|
|
155
|
-
module.exports = require("react");
|
|
156
|
-
|
|
157
|
-
/***/ }),
|
|
158
|
-
|
|
159
|
-
/***/ 223:
|
|
160
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
161
|
-
|
|
162
|
-
"use strict";
|
|
163
|
-
// ESM COMPAT FLAG
|
|
164
|
-
__webpack_require__.r(__webpack_exports__);
|
|
165
|
-
|
|
166
|
-
// EXPORTS
|
|
167
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_Layer_Layer; });
|
|
168
|
-
__webpack_require__.d(__webpack_exports__, "LayerStackContext", function() { return /* reexport */ LayerStack["b" /* LayerStackContext */]; });
|
|
169
|
-
__webpack_require__.d(__webpack_exports__, "LayerContext", function() { return /* reexport */ LayerStack["a" /* LayerContext */]; });
|
|
170
|
-
__webpack_require__.d(__webpack_exports__, "LayerStackGlobalProvider", function() { return /* reexport */ LayerStack["c" /* LayerStackGlobalProvider */]; });
|
|
171
|
-
|
|
172
|
-
// EXTERNAL MODULE: external "react"
|
|
173
|
-
var external_react_ = __webpack_require__(2);
|
|
174
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
175
|
-
|
|
176
|
-
// EXTERNAL MODULE: external "react-dom"
|
|
177
|
-
var external_react_dom_ = __webpack_require__(93);
|
|
178
|
-
|
|
179
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
180
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
181
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
182
|
-
|
|
183
|
-
// EXTERNAL MODULE: external "lodash/includes"
|
|
184
|
-
var includes_ = __webpack_require__(15);
|
|
185
|
-
var includes_default = /*#__PURE__*/__webpack_require__.n(includes_);
|
|
186
|
-
|
|
187
|
-
// EXTERNAL MODULE: external "lodash/last"
|
|
188
|
-
var last_ = __webpack_require__(94);
|
|
189
|
-
var last_default = /*#__PURE__*/__webpack_require__.n(last_);
|
|
190
|
-
|
|
191
|
-
// EXTERNAL MODULE: external "lodash/pull"
|
|
192
|
-
var pull_ = __webpack_require__(123);
|
|
193
|
-
var pull_default = /*#__PURE__*/__webpack_require__.n(pull_);
|
|
194
|
-
|
|
195
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
196
|
-
var keyboard_ = __webpack_require__(7);
|
|
197
|
-
|
|
198
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/EventListener"
|
|
199
|
-
var EventListener_ = __webpack_require__(16);
|
|
200
|
-
var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
|
|
201
|
-
|
|
202
|
-
// EXTERNAL MODULE: ./src/Layer/LayerStack.tsx
|
|
203
|
-
var LayerStack = __webpack_require__(95);
|
|
204
|
-
|
|
205
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
206
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
207
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
208
|
-
|
|
209
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
210
|
-
var themes_ = __webpack_require__(0);
|
|
211
|
-
|
|
212
|
-
// CONCATENATED MODULE: ./src/Layer/LayerStyles.ts
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var StyledLayer = external_styled_components_default.a.div.withConfig({
|
|
216
|
-
displayName: "LayerStyles__StyledLayer",
|
|
217
|
-
componentId: "ii6psl-0"
|
|
218
|
-
})(["", ""], function (_ref) {
|
|
219
|
-
var $separateStackingContexts = _ref.$separateStackingContexts;
|
|
220
|
-
return $separateStackingContexts && Object(external_styled_components_["css"])(["isolation:isolate;z-index:", ";"], themes_["variables"].zindexLayer);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
// EXTERNAL MODULE: ./src/utils/ssrDocument.ts
|
|
224
|
-
var ssrDocument = __webpack_require__(28);
|
|
225
|
-
|
|
226
|
-
// CONCATENATED MODULE: ./src/Layer/Layer.tsx
|
|
227
|
-
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); }
|
|
228
|
-
|
|
229
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
230
|
-
|
|
231
|
-
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); } }
|
|
232
|
-
|
|
233
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
234
|
-
|
|
235
|
-
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); }
|
|
236
|
-
|
|
237
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
238
|
-
|
|
239
|
-
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); }; }
|
|
240
|
-
|
|
241
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
242
|
-
|
|
243
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
244
|
-
|
|
245
|
-
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; } }
|
|
246
|
-
|
|
247
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
248
|
-
|
|
249
|
-
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; }
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
/** @public */
|
|
263
|
-
|
|
264
|
-
var possibleCloseReasons = ['clickAway', 'escapeKey'];
|
|
265
|
-
var propTypes = {
|
|
266
|
-
children: external_prop_types_default.a.node,
|
|
267
|
-
closeReasons: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOf(possibleCloseReasons)),
|
|
268
|
-
onRequestClose: external_prop_types_default.a.func,
|
|
269
|
-
open: external_prop_types_default.a.bool
|
|
270
|
-
};
|
|
271
|
-
var defaultProps = {
|
|
272
|
-
closeReasons: possibleCloseReasons,
|
|
273
|
-
open: false
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
var Layer_Layer = /*#__PURE__*/function (_Component) {
|
|
277
|
-
_inherits(Layer, _Component);
|
|
278
|
-
|
|
279
|
-
var _super = _createSuper(Layer);
|
|
280
|
-
|
|
281
|
-
// @docs-props-type LayerPropsBase
|
|
282
|
-
// eslint-disable-next-line react/sort-comp
|
|
283
|
-
// LayerStackContext (an array) keeps track of the current instances of Layer. This is
|
|
284
|
-
// used by Layer#handleKeyDown to determine if the escapeKey event should be handled by
|
|
285
|
-
// the current instance. Only the topmost Layer instance should honor the escapeKey.
|
|
286
|
-
// TODO: enable once this is sorted out within the babel/ts ecosystem
|
|
287
|
-
// declare context: React.ContextType<typeof LayerStackContext>;
|
|
288
|
-
function Layer(props) {
|
|
289
|
-
var _this;
|
|
290
|
-
|
|
291
|
-
_classCallCheck(this, Layer);
|
|
292
|
-
|
|
293
|
-
_this = _super.call(this, props);
|
|
294
|
-
|
|
295
|
-
_defineProperty(_assertThisInitialized(_this), "layerClickEvent", null);
|
|
296
|
-
|
|
297
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickOnLayer", function (_ref) {
|
|
298
|
-
var nativeEvent = _ref.nativeEvent;
|
|
299
|
-
_this.layerClickEvent = nativeEvent;
|
|
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/global */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.g = function() {
|
|
41
|
+
/******/ if (typeof globalThis === "object") return globalThis;
|
|
42
|
+
/******/ try {
|
|
43
|
+
/******/ return this || new Function("return this")();
|
|
44
|
+
/******/ } catch (e) {
|
|
45
|
+
/******/ if (typeof window === "object") return window;
|
|
46
|
+
/******/ }
|
|
47
|
+
/******/ }();
|
|
48
|
+
/******/ })();
|
|
49
|
+
/******/
|
|
50
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
51
|
+
/******/ (() => {
|
|
52
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
53
|
+
/******/;
|
|
54
|
+
})();
|
|
55
|
+
/******/
|
|
56
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
57
|
+
/******/ (() => {
|
|
58
|
+
/******/ // define __esModule on exports
|
|
59
|
+
/******/ e.r = e => {
|
|
60
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
61
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
62
|
+
value: "Module"
|
|
63
|
+
});
|
|
64
|
+
/******/ }
|
|
65
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
68
|
+
/******/ };
|
|
69
|
+
/******/ })();
|
|
70
|
+
/******/
|
|
71
|
+
/************************************************************************/ var t = {};
|
|
72
|
+
// ESM COMPAT FLAG
|
|
73
|
+
e.r(t);
|
|
74
|
+
// EXPORTS
|
|
75
|
+
e.d(t, {
|
|
76
|
+
LayerContext: () => /* reexport */ m,
|
|
77
|
+
LayerStackContext: () => /* reexport */ h,
|
|
78
|
+
LayerStackGlobalProvider: () => /* reexport */ k,
|
|
79
|
+
default: () => /* reexport */ F
|
|
300
80
|
});
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
81
|
+
// CONCATENATED MODULE: external "react"
|
|
82
|
+
const n = require("react");
|
|
83
|
+
var r = e.n(n);
|
|
84
|
+
// CONCATENATED MODULE: external "react-dom"
|
|
85
|
+
const o = require("react-dom");
|
|
86
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
87
|
+
const i = require("prop-types");
|
|
88
|
+
var a = e.n(i);
|
|
89
|
+
// CONCATENATED MODULE: external "lodash/includes"
|
|
90
|
+
const c = require("lodash/includes");
|
|
91
|
+
var u = e.n(c);
|
|
92
|
+
// CONCATENATED MODULE: external "lodash/last"
|
|
93
|
+
const l = require("lodash/last");
|
|
94
|
+
var s = e.n(l);
|
|
95
|
+
// CONCATENATED MODULE: external "lodash/pull"
|
|
96
|
+
const f = require("lodash/pull");
|
|
97
|
+
var p = e.n(f);
|
|
98
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
99
|
+
const y = require("@splunk/ui-utils/keyboard");
|
|
100
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
101
|
+
const d = require("@splunk/react-ui/EventListener");
|
|
102
|
+
var v = e.n(d);
|
|
103
|
+
// CONCATENATED MODULE: ./src/Layer/LayerStack.tsx
|
|
104
|
+
/**
|
|
105
|
+
* `LayerStackContext` is used to manage the array that `Layer` (and components that
|
|
106
|
+
* depend on it, such as `Modal`) uses to determine the order of open layers.
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
var h = r().createContext([]);
|
|
110
|
+
var m = r().createContext({});
|
|
111
|
+
var b = {
|
|
112
|
+
children: a().node,
|
|
113
|
+
name: a().string,
|
|
114
|
+
scope: a().object,
|
|
115
|
+
separateStackingContexts: a().bool
|
|
116
|
+
};
|
|
117
|
+
/* global global */
|
|
118
|
+
/**
|
|
119
|
+
* A `LayerStackContext` provider that stores a shared layer stack using a global variable.
|
|
120
|
+
* Applications should only use this provider if there's a known need to support multiple
|
|
121
|
+
* instances of this library on the same page.
|
|
122
|
+
*/ function k(t) {
|
|
123
|
+
var n = t.children, o = t.name, i = o === void 0 ? "__splunkui_layer_instances__" : o, a = t.scope, c = a === void 0 ? typeof window !== "undefined" ? window : e.g : a, u = t.separateStackingContexts, l = u === void 0 ? false : u;
|
|
124
|
+
if (!c[i]) {
|
|
125
|
+
c[i] = [];
|
|
126
|
+
// eslint-disable-line no-param-reassign
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return r().createElement(h.Provider, {
|
|
130
|
+
value: c[i]
|
|
131
|
+
}, r().createElement(m.Provider, {
|
|
132
|
+
value: {
|
|
133
|
+
separateStackingContexts: l
|
|
134
|
+
}
|
|
135
|
+
}, n));
|
|
136
|
+
}
|
|
137
|
+
k.propTypes = b;
|
|
138
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
139
|
+
const w = require("styled-components");
|
|
140
|
+
var g = e.n(w);
|
|
141
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
142
|
+
const C = require("@splunk/themes");
|
|
143
|
+
// CONCATENATED MODULE: ./src/Layer/LayerStyles.ts
|
|
144
|
+
var S = g().div.withConfig({
|
|
145
|
+
displayName: "LayerStyles__StyledLayer",
|
|
146
|
+
componentId: "ii6psl-0"
|
|
147
|
+
})([ "", "" ], (function(e) {
|
|
148
|
+
var t = e.$separateStackingContexts;
|
|
149
|
+
return t && (0, w.css)([ "isolation:isolate;z-index:", ";" ], C.variables.zindexLayer);
|
|
150
|
+
}));
|
|
151
|
+
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
152
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
153
|
+
var E = {
|
|
154
|
+
body: {
|
|
155
|
+
appendChild: function e() {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
addEventListener: function e() {},
|
|
160
|
+
removeEventListener: function e() {},
|
|
161
|
+
activeElement: {
|
|
162
|
+
blur: function e() {},
|
|
163
|
+
nodeName: ""
|
|
164
|
+
},
|
|
165
|
+
querySelector: function e() {
|
|
166
|
+
return null;
|
|
167
|
+
},
|
|
168
|
+
querySelectorAll: function e() {
|
|
169
|
+
return [];
|
|
170
|
+
},
|
|
171
|
+
getElementById: function e() {
|
|
172
|
+
return null;
|
|
173
|
+
},
|
|
174
|
+
createEvent: function e() {
|
|
175
|
+
return {
|
|
176
|
+
initEvent: function e() {}
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
createElement: function e() {
|
|
180
|
+
return {
|
|
181
|
+
children: [],
|
|
182
|
+
childNodes: [],
|
|
183
|
+
style: {},
|
|
184
|
+
setAttribute: function e() {},
|
|
185
|
+
getElementsByTagName: function e() {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
createElementNS: function e() {
|
|
191
|
+
return {};
|
|
192
|
+
},
|
|
193
|
+
importNode: function e() {
|
|
194
|
+
return null;
|
|
195
|
+
},
|
|
196
|
+
location: {
|
|
197
|
+
hash: "",
|
|
198
|
+
host: "",
|
|
199
|
+
hostname: "",
|
|
200
|
+
href: "",
|
|
201
|
+
origin: "",
|
|
202
|
+
pathname: "",
|
|
203
|
+
protocol: "",
|
|
204
|
+
search: ""
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
function O() {
|
|
208
|
+
var e = typeof document !== "undefined" ? document : E;
|
|
209
|
+
return e;
|
|
210
|
+
}
|
|
211
|
+
// CONCATENATED MODULE: ./src/Layer/Layer.tsx
|
|
212
|
+
function L(e) {
|
|
213
|
+
"@babel/helpers - typeof";
|
|
214
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
215
|
+
L = function e(t) {
|
|
216
|
+
return typeof t;
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
L = function e(t) {
|
|
220
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
return L(e);
|
|
224
|
+
}
|
|
225
|
+
function _(e, t) {
|
|
226
|
+
if (!(e instanceof t)) {
|
|
227
|
+
throw new TypeError("Cannot call a class as a function");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function x(e, t) {
|
|
231
|
+
for (var n = 0; n < t.length; n++) {
|
|
232
|
+
var r = t[n];
|
|
233
|
+
r.enumerable = r.enumerable || false;
|
|
234
|
+
r.configurable = true;
|
|
235
|
+
if ("value" in r) r.writable = true;
|
|
236
|
+
Object.defineProperty(e, r.key, r);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function P(e, t, n) {
|
|
240
|
+
if (t) x(e.prototype, t);
|
|
241
|
+
if (n) x(e, n);
|
|
242
|
+
return e;
|
|
243
|
+
}
|
|
244
|
+
function j(e, t) {
|
|
245
|
+
if (typeof t !== "function" && t !== null) {
|
|
246
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
247
|
+
}
|
|
248
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
249
|
+
constructor: {
|
|
250
|
+
value: e,
|
|
251
|
+
writable: true,
|
|
252
|
+
configurable: true
|
|
253
|
+
}
|
|
323
254
|
});
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
document.body.appendChild(Layer.layerContainer);
|
|
255
|
+
if (t) q(e, t);
|
|
256
|
+
}
|
|
257
|
+
function q(e, t) {
|
|
258
|
+
q = Object.setPrototypeOf || function e(t, n) {
|
|
259
|
+
t.__proto__ = n;
|
|
260
|
+
return t;
|
|
261
|
+
};
|
|
262
|
+
return q(e, t);
|
|
333
263
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
264
|
+
function T(e) {
|
|
265
|
+
var t = A();
|
|
266
|
+
return function n() {
|
|
267
|
+
var r = K(e), o;
|
|
268
|
+
if (t) {
|
|
269
|
+
var i = K(this).constructor;
|
|
270
|
+
o = Reflect.construct(r, arguments, i);
|
|
271
|
+
} else {
|
|
272
|
+
o = r.apply(this, arguments);
|
|
273
|
+
}
|
|
274
|
+
return R(this, o);
|
|
275
|
+
};
|
|
344
276
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
} else if (prevProps.open && !this.props.open) {
|
|
351
|
-
pull_default()(this.getLayerStack(), this);
|
|
352
|
-
}
|
|
277
|
+
function R(e, t) {
|
|
278
|
+
if (t && (L(t) === "object" || typeof t === "function")) {
|
|
279
|
+
return t;
|
|
280
|
+
}
|
|
281
|
+
return D(e);
|
|
353
282
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
283
|
+
function D(e) {
|
|
284
|
+
if (e === void 0) {
|
|
285
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
286
|
+
}
|
|
287
|
+
return e;
|
|
358
288
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
289
|
+
function A() {
|
|
290
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
291
|
+
if (Reflect.construct.sham) return false;
|
|
292
|
+
if (typeof Proxy === "function") return true;
|
|
293
|
+
try {
|
|
294
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
295
|
+
return true;
|
|
296
|
+
} catch (e) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
363
299
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
var _this$props3 = this.props,
|
|
370
|
-
children = _this$props3.children,
|
|
371
|
-
open = _this$props3.open;
|
|
372
|
-
|
|
373
|
-
if (open) {
|
|
374
|
-
var layerPortal = /*#__PURE__*/Object(external_react_dom_["createPortal"])( /*#__PURE__*/external_react_default.a.createElement(LayerStack["a" /* LayerContext */].Consumer, null, function (_ref2) {
|
|
375
|
-
var _ref2$separateStackin = _ref2.separateStackingContexts,
|
|
376
|
-
separateStackingContexts = _ref2$separateStackin === void 0 ? false : _ref2$separateStackin;
|
|
377
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledLayer // eslint-disable-line jsx-a11y/no-static-element-interactions
|
|
378
|
-
, {
|
|
379
|
-
$separateStackingContexts: separateStackingContexts,
|
|
380
|
-
"data-test": "layer",
|
|
381
|
-
onMouseDown: _this2.handleClickOnLayer,
|
|
382
|
-
onTouchStart: _this2.handleClickOnLayer
|
|
383
|
-
}, children);
|
|
384
|
-
}), Layer.layerContainer // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
|
385
|
-
);
|
|
386
|
-
return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
387
|
-
target: window,
|
|
388
|
-
eventType: "keydown",
|
|
389
|
-
listener: this.handleKeyDownOnWindow,
|
|
390
|
-
key: "eventListenerKeydown"
|
|
391
|
-
}), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
392
|
-
target: window,
|
|
393
|
-
eventType: "mousedown",
|
|
394
|
-
listener: this.handleClickOnWindow,
|
|
395
|
-
key: "eventListenerMouseDown"
|
|
396
|
-
}), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
397
|
-
target: window,
|
|
398
|
-
eventType: "touchstart",
|
|
399
|
-
listener: this.handleClickOnWindow,
|
|
400
|
-
key: "eventListenerTouchStart",
|
|
401
|
-
options: {
|
|
402
|
-
passive: true
|
|
403
|
-
}
|
|
404
|
-
}), layerPortal);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
return null;
|
|
300
|
+
function K(e) {
|
|
301
|
+
K = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
302
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
303
|
+
};
|
|
304
|
+
return K(e);
|
|
408
305
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
_defineProperty(Layer_Layer, "contextType", LayerStack["b" /* LayerStackContext */]);
|
|
423
|
-
|
|
424
|
-
/* harmony default export */ var src_Layer_Layer = (Layer_Layer);
|
|
425
|
-
// CONCATENATED MODULE: ./src/Layer/index.ts
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
/***/ }),
|
|
430
|
-
|
|
431
|
-
/***/ 28:
|
|
432
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
433
|
-
|
|
434
|
-
"use strict";
|
|
435
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
|
|
436
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ssrDocument; });
|
|
437
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
438
|
-
var ssrDocument = {
|
|
439
|
-
body: {
|
|
440
|
-
appendChild: function appendChild() {
|
|
441
|
-
return [];
|
|
306
|
+
function M(e, t, n) {
|
|
307
|
+
if (t in e) {
|
|
308
|
+
Object.defineProperty(e, t, {
|
|
309
|
+
value: n,
|
|
310
|
+
enumerable: true,
|
|
311
|
+
configurable: true,
|
|
312
|
+
writable: true
|
|
313
|
+
});
|
|
314
|
+
} else {
|
|
315
|
+
e[t] = n;
|
|
316
|
+
}
|
|
317
|
+
return e;
|
|
442
318
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
},
|
|
450
|
-
querySelector: function querySelector() {
|
|
451
|
-
return null;
|
|
452
|
-
},
|
|
453
|
-
querySelectorAll: function querySelectorAll() {
|
|
454
|
-
return [];
|
|
455
|
-
},
|
|
456
|
-
getElementById: function getElementById() {
|
|
457
|
-
return null;
|
|
458
|
-
},
|
|
459
|
-
createEvent: function createEvent() {
|
|
460
|
-
return {
|
|
461
|
-
initEvent: function initEvent() {}
|
|
319
|
+
/** @public */ var N = [ "clickAway", "escapeKey" ];
|
|
320
|
+
var W = {
|
|
321
|
+
children: a().node,
|
|
322
|
+
closeReasons: a().arrayOf(a().oneOf(N)),
|
|
323
|
+
onRequestClose: a().func,
|
|
324
|
+
open: a().bool
|
|
462
325
|
};
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
children: [],
|
|
467
|
-
childNodes: [],
|
|
468
|
-
style: {},
|
|
469
|
-
setAttribute: function setAttribute() {},
|
|
470
|
-
getElementsByTagName: function getElementsByTagName() {
|
|
471
|
-
return [];
|
|
472
|
-
}
|
|
326
|
+
var z = {
|
|
327
|
+
closeReasons: N,
|
|
328
|
+
open: false
|
|
473
329
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
var
|
|
551
|
-
var
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
330
|
+
var B = function(e) {
|
|
331
|
+
j(n, e);
|
|
332
|
+
var t = T(n);
|
|
333
|
+
// @docs-props-type LayerPropsBase
|
|
334
|
+
// eslint-disable-next-line react/sort-comp
|
|
335
|
+
// LayerStackContext (an array) keeps track of the current instances of Layer. This is
|
|
336
|
+
// used by Layer#handleKeyDown to determine if the escapeKey event should be handled by
|
|
337
|
+
// the current instance. Only the topmost Layer instance should honor the escapeKey.
|
|
338
|
+
// TODO: enable once this is sorted out within the babel/ts ecosystem
|
|
339
|
+
// declare context: React.ContextType<typeof LayerStackContext>;
|
|
340
|
+
function n(e) {
|
|
341
|
+
var r;
|
|
342
|
+
_(this, n);
|
|
343
|
+
r = t.call(this, e);
|
|
344
|
+
M(D(r), "layerClickEvent", null);
|
|
345
|
+
M(D(r), "handleClickOnLayer", (function(e) {
|
|
346
|
+
var t = e.nativeEvent;
|
|
347
|
+
r.layerClickEvent = t;
|
|
348
|
+
}));
|
|
349
|
+
M(D(r), "handleClickOnWindow", (function(e) {
|
|
350
|
+
var t, n;
|
|
351
|
+
// clicks inside the layer should not be considered clickAways
|
|
352
|
+
if (!r.props.open || !u()(r.props.closeReasons, "clickAway") || r.layerClickEvent === e) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
(t = (n = r.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(n, {
|
|
356
|
+
event: e,
|
|
357
|
+
reason: "clickAway"
|
|
358
|
+
});
|
|
359
|
+
}));
|
|
360
|
+
M(D(r), "handleKeyDownOnWindow", (function(e) {
|
|
361
|
+
if (r.props.open && (0, y.keycode)(e) === "esc" && s()(r.getLayerStack()) === D(r) && u()(r.props.closeReasons, "escapeKey")) {
|
|
362
|
+
var t, n;
|
|
363
|
+
(t = (n = r.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(n, {
|
|
364
|
+
event: e,
|
|
365
|
+
reason: "escapeKey"
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}));
|
|
369
|
+
var o = O();
|
|
370
|
+
if (!n.layerContainer) {
|
|
371
|
+
n.layerContainer = o.createElement("div");
|
|
372
|
+
n.layerContainer.setAttribute("data-test", "layer-container");
|
|
373
|
+
o.body.appendChild(n.layerContainer);
|
|
374
|
+
}
|
|
375
|
+
return r;
|
|
376
|
+
}
|
|
377
|
+
P(n, [ {
|
|
378
|
+
key: "componentDidMount",
|
|
379
|
+
value: function e() {
|
|
380
|
+
if (this.props.open) {
|
|
381
|
+
this.getLayerStack().push(this);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}, {
|
|
385
|
+
key: "componentDidUpdate",
|
|
386
|
+
value: function e(t) {
|
|
387
|
+
if (!t.open && this.props.open) {
|
|
388
|
+
this.getLayerStack().push(this);
|
|
389
|
+
} else if (t.open && !this.props.open) {
|
|
390
|
+
p()(this.getLayerStack(), this);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "componentWillUnmount",
|
|
395
|
+
value: function e() {
|
|
396
|
+
p()(this.getLayerStack(), this);
|
|
397
|
+
}
|
|
398
|
+
}, {
|
|
399
|
+
key: "getLayerStack",
|
|
400
|
+
value: function e() {
|
|
401
|
+
return this.context;
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "render",
|
|
405
|
+
value: function e() {
|
|
406
|
+
var t = this;
|
|
407
|
+
var i = this.props, a = i.children, c = i.open;
|
|
408
|
+
if (c) {
|
|
409
|
+
var u = (0, o.createPortal)( r().createElement(m.Consumer, null, (function(e) {
|
|
410
|
+
var n = e.separateStackingContexts, o = n === void 0 ? false : n;
|
|
411
|
+
|
|
412
|
+
return r().createElement(S, {
|
|
413
|
+
$separateStackingContexts: o,
|
|
414
|
+
"data-test": "layer",
|
|
415
|
+
onMouseDown: t.handleClickOnLayer,
|
|
416
|
+
onTouchStart: t.handleClickOnLayer
|
|
417
|
+
}, a);
|
|
418
|
+
})), n.layerContainer);
|
|
419
|
+
|
|
420
|
+
return r().createElement(r().Fragment, null, r().createElement(v(), {
|
|
421
|
+
target: window,
|
|
422
|
+
eventType: "keydown",
|
|
423
|
+
listener: this.handleKeyDownOnWindow,
|
|
424
|
+
key: "eventListenerKeydown"
|
|
425
|
+
}), r().createElement(v(), {
|
|
426
|
+
target: window,
|
|
427
|
+
eventType: "mousedown",
|
|
428
|
+
listener: this.handleClickOnWindow,
|
|
429
|
+
key: "eventListenerMouseDown"
|
|
430
|
+
}), r().createElement(v(), {
|
|
431
|
+
target: window,
|
|
432
|
+
eventType: "touchstart",
|
|
433
|
+
listener: this.handleClickOnWindow,
|
|
434
|
+
key: "eventListenerTouchStart",
|
|
435
|
+
options: {
|
|
436
|
+
passive: true
|
|
437
|
+
}
|
|
438
|
+
}), u);
|
|
439
|
+
}
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
} ]);
|
|
443
|
+
return n;
|
|
444
|
+
}(n.Component);
|
|
445
|
+
M(B, "layerContainer", null);
|
|
446
|
+
M(B, "possibleCloseReasons", N);
|
|
447
|
+
M(B, "propTypes", W);
|
|
448
|
+
M(B, "defaultProps", z);
|
|
449
|
+
M(B, "contextType", h);
|
|
450
|
+
/* harmony default export */ const F = B;
|
|
451
|
+
// CONCATENATED MODULE: ./src/Layer/index.ts
|
|
452
|
+
module.exports = t;
|
|
453
|
+
/******/})();
|