@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/ModalLayer.js
CHANGED
|
@@ -1,348 +1,331 @@
|
|
|
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
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 225);
|
|
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
|
-
/***/ 2:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("react");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 225:
|
|
112
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
|
-
|
|
114
|
-
"use strict";
|
|
115
|
-
// ESM COMPAT FLAG
|
|
116
|
-
__webpack_require__.r(__webpack_exports__);
|
|
117
|
-
|
|
118
|
-
// EXPORTS
|
|
119
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_ModalLayer_ModalLayer; });
|
|
120
|
-
|
|
121
|
-
// EXTERNAL MODULE: external "react"
|
|
122
|
-
var external_react_ = __webpack_require__(2);
|
|
123
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
124
|
-
|
|
125
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
126
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
127
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
128
|
-
|
|
129
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Animation"
|
|
130
|
-
var Animation_ = __webpack_require__(43);
|
|
131
|
-
|
|
132
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Layer"
|
|
133
|
-
var Layer_ = __webpack_require__(85);
|
|
134
|
-
var Layer_default = /*#__PURE__*/__webpack_require__.n(Layer_);
|
|
135
|
-
|
|
136
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
137
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
138
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
139
|
-
|
|
140
|
-
// EXTERNAL MODULE: external "react-spring"
|
|
141
|
-
var external_react_spring_ = __webpack_require__(24);
|
|
142
|
-
|
|
143
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
144
|
-
var themes_ = __webpack_require__(0);
|
|
145
|
-
|
|
146
|
-
// CONCATENATED MODULE: ./src/ModalLayer/ModalLayerStyles.ts
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var overlay = Object(external_styled_components_["css"])(["", ";position:fixed;top:0;right:0;bottom:0;left:0;"], themes_["mixins"].reset('block'));
|
|
151
|
-
var StyledClickAwayOverlay = external_styled_components_default()(external_react_spring_["animated"].div).withConfig({
|
|
152
|
-
displayName: "ModalLayerStyles__StyledClickAwayOverlay",
|
|
153
|
-
componentId: "sc-1sa3n1j-0"
|
|
154
|
-
})(["", ";background-color:", ";z-index:", ";"], overlay, themes_["variables"].backgroundColorScrim, themes_["variables"].zindexModalBackdrop);
|
|
155
|
-
|
|
156
|
-
// CONCATENATED MODULE: ./src/ModalLayer/ModalLayer.tsx
|
|
157
|
-
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); }
|
|
158
|
-
|
|
159
|
-
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; }
|
|
160
|
-
|
|
161
|
-
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; }
|
|
162
|
-
|
|
163
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
164
|
-
|
|
165
|
-
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); } }
|
|
166
|
-
|
|
167
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
168
|
-
|
|
169
|
-
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); }
|
|
170
|
-
|
|
171
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
172
|
-
|
|
173
|
-
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); }; }
|
|
174
|
-
|
|
175
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
176
|
-
|
|
177
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
178
|
-
|
|
179
|
-
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; } }
|
|
180
|
-
|
|
181
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
182
|
-
|
|
183
|
-
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; }
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
var propTypes = {
|
|
191
|
-
childrenInAnimation: external_prop_types_default.a.bool,
|
|
192
|
-
getDefaultMotionStyle: external_prop_types_default.a.func,
|
|
193
|
-
getMotionStyle: external_prop_types_default.a.func,
|
|
194
|
-
onRequestClose: external_prop_types_default.a.func,
|
|
195
|
-
open: external_prop_types_default.a.bool,
|
|
196
|
-
renderModal: external_prop_types_default.a.func.isRequired,
|
|
197
|
-
useLayerForClickAway: external_prop_types_default.a.bool
|
|
198
|
-
};
|
|
199
|
-
var defaultProps = {
|
|
200
|
-
childrenInAnimation: false,
|
|
201
|
-
open: false,
|
|
202
|
-
useLayerForClickAway: true
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var ModalLayer_ModalLayer = /*#__PURE__*/function (_Component) {
|
|
206
|
-
_inherits(ModalLayer, _Component);
|
|
207
|
-
|
|
208
|
-
var _super = _createSuper(ModalLayer);
|
|
209
|
-
|
|
210
|
-
function ModalLayer(props) {
|
|
211
|
-
var _this;
|
|
212
|
-
|
|
213
|
-
_classCallCheck(this, ModalLayer);
|
|
214
|
-
|
|
215
|
-
_this = _super.call(this, props);
|
|
216
|
-
|
|
217
|
-
_defineProperty(_assertThisInitialized(_this), "allowAnimationUpdates", true);
|
|
218
|
-
|
|
219
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickAway", function (event) {
|
|
220
|
-
var _this$props$onRequest, _this$props;
|
|
221
|
-
|
|
222
|
-
(_this$props$onRequest = (_this$props = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, {
|
|
223
|
-
reason: 'clickAway',
|
|
224
|
-
event: event
|
|
225
|
-
});
|
|
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
|
+
default: () => /* reexport */ E
|
|
226
65
|
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const r = require("react");
|
|
68
|
+
var n = e.n(r);
|
|
69
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
+
const o = require("prop-types");
|
|
71
|
+
var i = e.n(o);
|
|
72
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Animation"
|
|
73
|
+
const a = require("@splunk/react-ui/Animation");
|
|
74
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Layer"
|
|
75
|
+
const l = require("@splunk/react-ui/Layer");
|
|
76
|
+
var u = e.n(l);
|
|
77
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
78
|
+
const c = require("styled-components");
|
|
79
|
+
var s = e.n(c);
|
|
80
|
+
// CONCATENATED MODULE: external "react-spring"
|
|
81
|
+
const f = require("react-spring");
|
|
82
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
83
|
+
const p = require("@splunk/themes");
|
|
84
|
+
// CONCATENATED MODULE: ./src/ModalLayer/ModalLayerStyles.ts
|
|
85
|
+
var y = (0, c.css)([ "", ";position:fixed;top:0;right:0;bottom:0;left:0;" ], p.mixins.reset("block"));
|
|
86
|
+
var d = s()(f.animated.div).withConfig({
|
|
87
|
+
displayName: "ModalLayerStyles__StyledClickAwayOverlay",
|
|
88
|
+
componentId: "sc-1sa3n1j-0"
|
|
89
|
+
})([ "", ";background-color:", ";z-index:", ";" ], y, p.variables.backgroundColorScrim, p.variables.zindexModalBackdrop);
|
|
90
|
+
// CONCATENATED MODULE: ./src/ModalLayer/ModalLayer.tsx
|
|
91
|
+
function b(e) {
|
|
92
|
+
"@babel/helpers - typeof";
|
|
93
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
94
|
+
b = function e(t) {
|
|
95
|
+
return typeof t;
|
|
96
|
+
};
|
|
97
|
+
} else {
|
|
98
|
+
b = function e(t) {
|
|
99
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return b(e);
|
|
103
|
+
}
|
|
104
|
+
function v(e, t) {
|
|
105
|
+
var r = Object.keys(e);
|
|
106
|
+
if (Object.getOwnPropertySymbols) {
|
|
107
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
108
|
+
if (t) n = n.filter((function(t) {
|
|
109
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
110
|
+
}));
|
|
111
|
+
r.push.apply(r, n);
|
|
112
|
+
}
|
|
113
|
+
return r;
|
|
114
|
+
}
|
|
115
|
+
function m(e) {
|
|
116
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
117
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
118
|
+
if (t % 2) {
|
|
119
|
+
v(Object(r), true).forEach((function(t) {
|
|
120
|
+
_(e, t, r[t]);
|
|
121
|
+
}));
|
|
122
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
123
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
124
|
+
} else {
|
|
125
|
+
v(Object(r)).forEach((function(t) {
|
|
126
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return e;
|
|
131
|
+
}
|
|
132
|
+
function O(e, t) {
|
|
133
|
+
if (!(e instanceof t)) {
|
|
134
|
+
throw new TypeError("Cannot call a class as a function");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function h(e, t) {
|
|
138
|
+
for (var r = 0; r < t.length; r++) {
|
|
139
|
+
var n = t[r];
|
|
140
|
+
n.enumerable = n.enumerable || false;
|
|
141
|
+
n.configurable = true;
|
|
142
|
+
if ("value" in n) n.writable = true;
|
|
143
|
+
Object.defineProperty(e, n.key, n);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function g(e, t, r) {
|
|
147
|
+
if (t) h(e.prototype, t);
|
|
148
|
+
if (r) h(e, r);
|
|
149
|
+
return e;
|
|
150
|
+
}
|
|
151
|
+
function w(e, t) {
|
|
152
|
+
if (typeof t !== "function" && t !== null) {
|
|
153
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
154
|
+
}
|
|
155
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
156
|
+
constructor: {
|
|
157
|
+
value: e,
|
|
158
|
+
writable: true,
|
|
159
|
+
configurable: true
|
|
160
|
+
}
|
|
232
161
|
});
|
|
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
|
-
style: {
|
|
261
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
262
|
-
opacity: interpolatedStyle.overlayOpacity
|
|
263
|
-
}
|
|
264
|
-
}));
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
_this.state = {
|
|
269
|
-
animating: false,
|
|
270
|
-
prevOpen: props.open // eslint-disable-line react/no-unused-state
|
|
271
|
-
|
|
272
|
-
};
|
|
273
|
-
return _this;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
_createClass(ModalLayer, [{
|
|
277
|
-
key: "componentWillUnmount",
|
|
278
|
-
value: function componentWillUnmount() {
|
|
279
|
-
this.allowAnimationUpdates = false;
|
|
162
|
+
if (t) j(e, t);
|
|
163
|
+
}
|
|
164
|
+
function j(e, t) {
|
|
165
|
+
j = Object.setPrototypeOf || function e(t, r) {
|
|
166
|
+
t.__proto__ = r;
|
|
167
|
+
return t;
|
|
168
|
+
};
|
|
169
|
+
return j(e, t);
|
|
170
|
+
}
|
|
171
|
+
function S(e) {
|
|
172
|
+
var t = A();
|
|
173
|
+
return function r() {
|
|
174
|
+
var n = C(e), o;
|
|
175
|
+
if (t) {
|
|
176
|
+
var i = C(this).constructor;
|
|
177
|
+
o = Reflect.construct(n, arguments, i);
|
|
178
|
+
} else {
|
|
179
|
+
o = n.apply(this, arguments);
|
|
180
|
+
}
|
|
181
|
+
return P(this, o);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function P(e, t) {
|
|
185
|
+
if (t && (b(t) === "object" || typeof t === "function")) {
|
|
186
|
+
return t;
|
|
187
|
+
}
|
|
188
|
+
return k(e);
|
|
280
189
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
var open = this.props.open || this.state.animating || this.props.childrenInAnimation;
|
|
287
|
-
return /*#__PURE__*/external_react_default.a.createElement(Layer_default.a, {
|
|
288
|
-
open: open,
|
|
289
|
-
closeReasons: ['escapeKey'],
|
|
290
|
-
onRequestClose: this.props.onRequestClose
|
|
291
|
-
}, open && this.renderLayer());
|
|
190
|
+
function k(e) {
|
|
191
|
+
if (e === void 0) {
|
|
192
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
193
|
+
}
|
|
194
|
+
return e;
|
|
292
195
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
196
|
+
function A() {
|
|
197
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
198
|
+
if (Reflect.construct.sham) return false;
|
|
199
|
+
if (typeof Proxy === "function") return true;
|
|
200
|
+
try {
|
|
201
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
202
|
+
return true;
|
|
203
|
+
} catch (e) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function C(e) {
|
|
208
|
+
C = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
209
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
210
|
+
};
|
|
211
|
+
return C(e);
|
|
212
|
+
}
|
|
213
|
+
function _(e, t, r) {
|
|
214
|
+
if (t in e) {
|
|
215
|
+
Object.defineProperty(e, t, {
|
|
216
|
+
value: r,
|
|
217
|
+
enumerable: true,
|
|
218
|
+
configurable: true,
|
|
219
|
+
writable: true
|
|
220
|
+
});
|
|
221
|
+
} else {
|
|
222
|
+
e[t] = r;
|
|
223
|
+
}
|
|
224
|
+
return e;
|
|
225
|
+
}
|
|
226
|
+
var R = {
|
|
227
|
+
childrenInAnimation: i().bool,
|
|
228
|
+
getDefaultMotionStyle: i().func,
|
|
229
|
+
getMotionStyle: i().func,
|
|
230
|
+
onRequestClose: i().func,
|
|
231
|
+
open: i().bool,
|
|
232
|
+
renderModal: i().func.isRequired,
|
|
233
|
+
useLayerForClickAway: i().bool
|
|
234
|
+
};
|
|
235
|
+
var q = {
|
|
236
|
+
childrenInAnimation: false,
|
|
237
|
+
open: false,
|
|
238
|
+
useLayerForClickAway: true
|
|
307
239
|
};
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
240
|
+
var M = function(e) {
|
|
241
|
+
w(r, e);
|
|
242
|
+
var t = S(r);
|
|
243
|
+
function r(e) {
|
|
244
|
+
var o;
|
|
245
|
+
O(this, r);
|
|
246
|
+
o = t.call(this, e);
|
|
247
|
+
_(k(o), "allowAnimationUpdates", true);
|
|
248
|
+
_(k(o), "handleClickAway", (function(e) {
|
|
249
|
+
var t, r;
|
|
250
|
+
(t = (r = o.props).onRequestClose) === null || t === void 0 ? void 0 : t.call(r, {
|
|
251
|
+
reason: "clickAway",
|
|
252
|
+
event: e
|
|
253
|
+
});
|
|
254
|
+
}));
|
|
255
|
+
_(k(o), "handleAnimationEnd", (function() {
|
|
256
|
+
if (o.allowAnimationUpdates) {
|
|
257
|
+
o.setState({
|
|
258
|
+
animating: false
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}));
|
|
262
|
+
_(k(o), "renderLayer", (function() {
|
|
263
|
+
var e = o.props, t = e.getDefaultMotionStyle, r = e.getMotionStyle, i = e.renderModal, l = e.useLayerForClickAway;
|
|
264
|
+
var u = o.props.open || o.state.animating;
|
|
265
|
+
|
|
266
|
+
return n().createElement(a.Spring, {
|
|
267
|
+
from: m(m({}, t === null || t === void 0 ? void 0 : t()), {}, {
|
|
268
|
+
overlayOpacity: 0,
|
|
269
|
+
opacity: 0
|
|
270
|
+
}),
|
|
271
|
+
to: m(m({}, r === null || r === void 0 ? void 0 : r()), {}, {
|
|
272
|
+
overlayOpacity: o.props.open ? 1 : 0,
|
|
273
|
+
opacity: o.props.open ? 1 : 0
|
|
274
|
+
}),
|
|
275
|
+
onRest: o.handleAnimationEnd
|
|
276
|
+
}, (function(e) {
|
|
277
|
+
|
|
278
|
+
return n().createElement("div", null,
|
|
279
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
280
|
+
i(e), u && l && n().createElement(d, {
|
|
281
|
+
"data-test": "modal-overlay",
|
|
282
|
+
onMouseDown: o.handleClickAway,
|
|
283
|
+
key: "clickAway",
|
|
284
|
+
style: {
|
|
285
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
286
|
+
opacity: e.overlayOpacity
|
|
287
|
+
}
|
|
288
|
+
}));
|
|
289
|
+
}));
|
|
290
|
+
}));
|
|
291
|
+
o.state = {
|
|
292
|
+
animating: false,
|
|
293
|
+
prevOpen: e.open
|
|
294
|
+
};
|
|
295
|
+
return o;
|
|
296
|
+
}
|
|
297
|
+
g(r, [ {
|
|
298
|
+
key: "componentWillUnmount",
|
|
299
|
+
value: function e() {
|
|
300
|
+
this.allowAnimationUpdates = false;
|
|
301
|
+
}
|
|
302
|
+
}, {
|
|
303
|
+
key: "render",
|
|
304
|
+
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
|
305
|
+
value: function e() {
|
|
306
|
+
var t = this.props.open || this.state.animating || this.props.childrenInAnimation;
|
|
307
|
+
|
|
308
|
+
return n().createElement(u(), {
|
|
309
|
+
open: t,
|
|
310
|
+
closeReasons: [ "escapeKey" ],
|
|
311
|
+
onRequestClose: this.props.onRequestClose
|
|
312
|
+
}, t && this.renderLayer());
|
|
313
|
+
}
|
|
314
|
+
} ]);
|
|
315
|
+
return r;
|
|
316
|
+
}(r.Component);
|
|
317
|
+
_(M, "propTypes", R);
|
|
318
|
+
_(M, "defaultProps", q);
|
|
319
|
+
_(M, "getDerivedStateFromProps", (function(e, t) {
|
|
320
|
+
if (e.open !== t.prevOpen) {
|
|
321
|
+
return {
|
|
322
|
+
animating: true,
|
|
323
|
+
prevOpen: e.open
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
return null;
|
|
327
|
+
}));
|
|
328
|
+
/* harmony default export */ const E = M;
|
|
329
|
+
// CONCATENATED MODULE: ./src/ModalLayer/index.ts
|
|
330
|
+
module.exports = t;
|
|
331
|
+
/******/})();
|