@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/ModalLayer.js
CHANGED
|
@@ -1,248 +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
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
;// CONCATENATED MODULE: external "@splunk/react-ui/Layer"
|
|
66
|
-
const Layer_namespaceObject = require("@splunk/react-ui/Layer");
|
|
67
|
-
var Layer_default = /*#__PURE__*/__webpack_require__.n(Layer_namespaceObject);
|
|
68
|
-
;// CONCATENATED MODULE: external "styled-components"
|
|
69
|
-
const external_styled_components_namespaceObject = require("styled-components");
|
|
70
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
|
|
71
|
-
;// CONCATENATED MODULE: external "react-spring"
|
|
72
|
-
const external_react_spring_namespaceObject = require("react-spring");
|
|
73
|
-
;// CONCATENATED MODULE: external "@splunk/themes"
|
|
74
|
-
const themes_namespaceObject = require("@splunk/themes");
|
|
75
|
-
;// CONCATENATED MODULE: ./src/ModalLayer/ModalLayerStyles.ts
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var overlay = (0,external_styled_components_namespaceObject.css)(["", ";position:fixed;top:0;right:0;bottom:0;left:0;"], themes_namespaceObject.mixins.reset('block'));
|
|
80
|
-
var StyledClickAwayOverlay = external_styled_components_default()(external_react_spring_namespaceObject.animated.div).withConfig({
|
|
81
|
-
displayName: "ModalLayerStyles__StyledClickAwayOverlay",
|
|
82
|
-
componentId: "sc-1sa3n1j-0"
|
|
83
|
-
})(["", ";background-color:", ";z-index:", ";"], overlay, themes_namespaceObject.variables.backgroundColorScrim, themes_namespaceObject.variables.zindexModalBackdrop);
|
|
84
|
-
|
|
85
|
-
;// CONCATENATED MODULE: ./src/ModalLayer/ModalLayer.tsx
|
|
86
|
-
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); }
|
|
87
|
-
|
|
88
|
-
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; }
|
|
89
|
-
|
|
90
|
-
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; }
|
|
91
|
-
|
|
92
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
93
|
-
|
|
94
|
-
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); } }
|
|
95
|
-
|
|
96
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
97
|
-
|
|
98
|
-
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); }
|
|
99
|
-
|
|
100
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
101
|
-
|
|
102
|
-
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); }; }
|
|
103
|
-
|
|
104
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
105
|
-
|
|
106
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
107
|
-
|
|
108
|
-
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; } }
|
|
109
|
-
|
|
110
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
111
|
-
|
|
112
|
-
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; }
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var propTypes = {
|
|
120
|
-
childrenInAnimation: (external_prop_types_default()).bool,
|
|
121
|
-
getDefaultMotionStyle: (external_prop_types_default()).func,
|
|
122
|
-
getMotionStyle: (external_prop_types_default()).func,
|
|
123
|
-
onRequestClose: (external_prop_types_default()).func,
|
|
124
|
-
open: (external_prop_types_default()).bool,
|
|
125
|
-
renderModal: (external_prop_types_default()).func.isRequired,
|
|
126
|
-
useLayerForClickAway: (external_prop_types_default()).bool
|
|
127
|
-
};
|
|
128
|
-
var defaultProps = {
|
|
129
|
-
childrenInAnimation: false,
|
|
130
|
-
open: false,
|
|
131
|
-
useLayerForClickAway: true
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
var ModalLayer = /*#__PURE__*/function (_Component) {
|
|
135
|
-
_inherits(ModalLayer, _Component);
|
|
136
|
-
|
|
137
|
-
var _super = _createSuper(ModalLayer);
|
|
138
|
-
|
|
139
|
-
function ModalLayer(props) {
|
|
140
|
-
var _this;
|
|
141
|
-
|
|
142
|
-
_classCallCheck(this, ModalLayer);
|
|
143
|
-
|
|
144
|
-
_this = _super.call(this, props);
|
|
145
|
-
|
|
146
|
-
_defineProperty(_assertThisInitialized(_this), "allowAnimationUpdates", true);
|
|
147
|
-
|
|
148
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickAway", function (event) {
|
|
149
|
-
var _this$props$onRequest, _this$props;
|
|
150
|
-
|
|
151
|
-
(_this$props$onRequest = (_this$props = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props, {
|
|
152
|
-
reason: 'clickAway',
|
|
153
|
-
event: event
|
|
154
|
-
});
|
|
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
|
|
155
65
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
+
}
|
|
161
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
|
-
style: {
|
|
190
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
191
|
-
opacity: interpolatedStyle.overlayOpacity
|
|
192
|
-
}
|
|
193
|
-
}));
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
_this.state = {
|
|
198
|
-
animating: false,
|
|
199
|
-
prevOpen: props.open // eslint-disable-line react/no-unused-state
|
|
200
|
-
|
|
201
|
-
};
|
|
202
|
-
return _this;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
_createClass(ModalLayer, [{
|
|
206
|
-
key: "componentWillUnmount",
|
|
207
|
-
value: function componentWillUnmount() {
|
|
208
|
-
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);
|
|
209
189
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var open = this.props.open || this.state.animating || this.props.childrenInAnimation;
|
|
216
|
-
return /*#__PURE__*/external_react_default().createElement((Layer_default()), {
|
|
217
|
-
open: open,
|
|
218
|
-
closeReasons: ['escapeKey'],
|
|
219
|
-
onRequestClose: this.props.onRequestClose
|
|
220
|
-
}, 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;
|
|
221
195
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
|
236
239
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
+
/******/})();
|