@splunk/react-ui 4.5.2 → 4.7.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 +10 -9
- package/Anchor.js +2 -2
- package/Animation.js +2 -2
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +13 -13
- package/ButtonGroup.js +4 -4
- package/ButtonSimple.js +6 -6
- package/CHANGELOG.md +42 -1
- package/Calendar.js +16 -16
- package/Card.js +48 -53
- package/CardLayout.js +4 -4
- package/Chip.js +10 -10
- package/Clickable.js +41 -15
- package/CloseButton.js +8 -8
- package/Code.js +8 -7
- package/CollapsiblePanel.js +11 -14
- package/Color.js +48 -48
- package/ColumnLayout.js +4 -4
- package/ComboBox.js +8 -8
- package/Concertina.js +15 -15
- package/ControlGroup.js +30 -37
- package/Date.js +10 -10
- package/DefinitionList.js +2 -2
- package/Dropdown.js +4 -4
- package/EventListener.js +4 -4
- package/FetchOptions.js +8 -8
- package/File.js +27 -27
- package/FormRows.js +21 -23
- package/Heading.js +2 -2
- package/Image.js +14 -14
- package/JSONTree.js +4 -4
- package/Layer.js +10 -10
- package/Link.js +6 -6
- package/List.js +2 -2
- package/Markdown.js +28 -16
- package/Menu.js +135 -70
- package/Message.js +246 -305
- package/MessageBar.d.ts +2 -0
- package/MessageBar.js +789 -0
- package/Modal.js +95 -61
- package/ModalLayer.js +5 -4
- package/Monogram.js +4 -4
- package/Multiselect.js +293 -42
- package/Number.js +8 -8
- package/Paginator.js +24 -24
- package/Paragraph.js +2 -2
- package/Popover.js +12 -12
- package/Progress.js +6 -6
- package/RadioBar.js +4 -4
- package/RadioList.js +2 -2
- package/Resize.js +8 -8
- package/ResultsMenu.js +25 -23
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +6 -6
- package/ScrollContainerContext.js +2 -2
- package/Search.js +14 -14
- package/Select.js +286 -36
- package/SidePanel.js +6 -6
- package/Slider.js +20 -14
- package/SlidingPanels.js +4 -4
- package/StaticContent.js +2 -2
- package/StepBar.js +18 -18
- package/Switch.js +17 -31
- package/TabBar.js +60 -46
- package/TabLayout.js +4 -4
- package/Table.js +63 -55
- package/Text.js +163 -146
- package/Tooltip.js +14 -14
- package/TransitionOpen.js +69 -44
- package/WaitSpinner.js +2 -2
- package/cypress/plugins/index.ts +15 -0
- package/cypress/support/commands.ts +1 -0
- package/cypress/support/index.ts +10 -0
- package/cypress.json +12 -0
- package/package.json +18 -5
- package/types/src/Animation/Animation.d.ts +0 -1
- package/types/src/Calendar/DateTable.d.ts +0 -1
- package/types/src/Clickable/Clickable.d.ts +12 -2
- package/types/src/Clickable/NavigationProvider.d.ts +12 -2
- package/types/src/Color/Color.d.ts +3 -3
- package/types/src/Date/Date.d.ts +3 -3
- package/types/src/Date/Icon.d.ts +0 -1
- package/types/src/File/Icon.d.ts +0 -1
- package/types/src/File/IconCloud.d.ts +0 -1
- package/types/src/File/PaperClip.d.ts +0 -1
- package/types/src/File/Retry.d.ts +0 -1
- package/types/src/File/Trash.d.ts +0 -1
- package/types/src/Markdown/renderers/MarkdownCode.d.ts +0 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +0 -1
- package/types/src/Markdown/renderers/MarkdownImage.d.ts +0 -1
- package/types/src/Menu/Divider.d.ts +0 -1
- package/types/src/Message/Link.d.ts +2 -0
- package/types/src/Message/Message.d.ts +6 -1
- package/types/src/MessageBar/MessageBar.d.ts +28 -0
- package/types/src/MessageBar/index.d.ts +2 -0
- package/types/src/Modal/Modal.d.ts +3 -0
- package/types/src/Modal/ModalContext.d.ts +6 -0
- package/types/src/Monogram/Monogram.d.ts +2 -2
- package/types/src/Multiselect/Multiselect.d.ts +1 -0
- package/types/src/Number/IncrementIcon.d.ts +0 -1
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Paginator/PageSeparator.d.ts +0 -1
- package/types/src/Popover/Popover.d.ts +1 -2
- package/types/src/RadioBar/RadioBar.d.ts +3 -3
- package/types/src/Select/Select.d.ts +8 -3
- package/types/src/Select/SelectBase.d.ts +17 -5
- package/types/src/Select/matchUtils.d.ts +12 -0
- package/types/src/Slider/Slider.d.ts +3 -3
- package/types/src/Switch/CheckIcon.d.ts +0 -1
- package/types/src/Switch/Switch.d.ts +7 -7
- package/types/src/Table/DragHandle.d.ts +0 -1
- package/types/src/Table/HeadExpandRowsIcon.d.ts +0 -1
- package/types/src/Table/Toggle.d.ts +0 -1
- package/types/src/Text/IconOutlinedHide.d.ts +0 -1
- package/types/src/Text/IconOutlinedView.d.ts +0 -1
- package/types/src/Text/Text.d.ts +12 -5
- package/types/src/Tooltip/InfoIcon.d.ts +0 -1
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -0
- package/types/src/icons/Alert.d.ts +0 -1
- package/types/src/icons/AlertFilled.d.ts +0 -1
- package/types/src/icons/CaretDown.d.ts +0 -1
- package/types/src/icons/CaretRight.d.ts +0 -1
- package/types/src/icons/Check.d.ts +0 -1
- package/types/src/icons/ChevronDown.d.ts +0 -1
- package/types/src/icons/ChevronLeft.d.ts +0 -1
- package/types/src/icons/ChevronRight.d.ts +0 -1
- package/types/src/icons/CrossMark.d.ts +0 -1
- package/types/src/icons/External.d.ts +0 -1
- package/types/src/icons/InfoFilled.d.ts +0 -1
- package/types/src/icons/More.d.ts +0 -1
- package/types/src/icons/MoreVertical.d.ts +0 -1
- package/types/src/icons/Plus.d.ts +0 -1
- package/types/src/icons/SVG.d.ts +0 -1
- package/types/src/icons/Search.d.ts +0 -1
- package/types/src/icons/Sort.d.ts +0 -1
- package/types/src/icons/SortedDown.d.ts +0 -1
- package/types/src/icons/SortedUp.d.ts +0 -1
- package/types/src/icons/Success.d.ts +0 -1
- package/types/src/icons/SuccessFilled.d.ts +0 -1
- package/types/src/icons/WarningFilled.d.ts +0 -1
- package/types/src/utils/types.d.ts +0 -1
- package/unit-test-setup-testing-library.ts +9 -0
- package/usePrevious.js +2 -2
- package/types/src/Message/Banner.d.ts +0 -8
package/Modal.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 118);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,14 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 10:
|
|
105
|
+
/***/ (function(module, exports) {
|
|
106
|
+
|
|
107
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
108
|
+
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
111
|
+
/***/ 118:
|
|
105
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
113
|
|
|
107
114
|
"use strict";
|
|
@@ -126,11 +133,14 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
|
|
|
126
133
|
var external_lodash_ = __webpack_require__(4);
|
|
127
134
|
|
|
128
135
|
// EXTERNAL MODULE: external "@splunk/react-ui/ModalLayer"
|
|
129
|
-
var ModalLayer_ = __webpack_require__(
|
|
136
|
+
var ModalLayer_ = __webpack_require__(77);
|
|
130
137
|
var ModalLayer_default = /*#__PURE__*/__webpack_require__.n(ModalLayer_);
|
|
131
138
|
|
|
132
139
|
// EXTERNAL MODULE: external "@splunk/ui-utils/focus"
|
|
133
|
-
var focus_ = __webpack_require__(
|
|
140
|
+
var focus_ = __webpack_require__(26);
|
|
141
|
+
|
|
142
|
+
// EXTERNAL MODULE: external "@splunk/ui-utils/id"
|
|
143
|
+
var id_ = __webpack_require__(10);
|
|
134
144
|
|
|
135
145
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
|
|
136
146
|
var ScrollContainerContext_ = __webpack_require__(35);
|
|
@@ -153,7 +163,7 @@ var themes_ = __webpack_require__(0);
|
|
|
153
163
|
var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
154
164
|
displayName: "BodyStyles__StyledBox",
|
|
155
165
|
componentId: "lv54z7-0"
|
|
156
|
-
})(["background-color:", ";", "
|
|
166
|
+
})(["background-color:", ";", " flex:0 1 auto;overflow:auto;@media all and (-ms-high-contrast:none){*::-ms-backdrop,&{max-height:calc(100vh - 180px);}}"], Object(themes_["pick"])({
|
|
157
167
|
enterprise: themes_["variables"].backgroundColor,
|
|
158
168
|
prisma: themes_["variables"].backgroundColorDialog
|
|
159
169
|
}), Object(themes_["pick"])({
|
|
@@ -165,8 +175,6 @@ var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
|
165
175
|
comfortable: Object(external_styled_components_["css"])(["padding:12px 24px;&:first-child{padding-top:36px;}&:last-child{padding-bottom:36px;}"]),
|
|
166
176
|
compact: Object(external_styled_components_["css"])(["padding:8px 24px;&:first-child{padding-top:26px;}&:last-child{padding-bottom:26px;}"])
|
|
167
177
|
}
|
|
168
|
-
}), Object(themes_["pick"])({
|
|
169
|
-
prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorActive)
|
|
170
178
|
}));
|
|
171
179
|
|
|
172
180
|
// CONCATENATED MODULE: ./src/Modal/Body.tsx
|
|
@@ -271,7 +279,7 @@ function Footer(_ref) {
|
|
|
271
279
|
Footer.propTypes = Footer_propTypes;
|
|
272
280
|
/* harmony default export */ var Modal_Footer = (Footer);
|
|
273
281
|
// EXTERNAL MODULE: external "@splunk/react-ui/CloseButton"
|
|
274
|
-
var CloseButton_ = __webpack_require__(
|
|
282
|
+
var CloseButton_ = __webpack_require__(67);
|
|
275
283
|
var CloseButton_default = /*#__PURE__*/__webpack_require__.n(CloseButton_);
|
|
276
284
|
|
|
277
285
|
// CONCATENATED MODULE: ./src/Modal/HeaderStyles.ts
|
|
@@ -312,10 +320,10 @@ var StyledTitleWrapper = external_styled_components_default.a.div.withConfig({
|
|
|
312
320
|
displayName: "HeaderStyles__StyledTitleWrapper",
|
|
313
321
|
componentId: "sc-1y722ut-1"
|
|
314
322
|
})(["", ";flex-direction:column;"], themes_["mixins"].reset('flex'));
|
|
315
|
-
var StyledIcon = external_styled_components_default.a.
|
|
323
|
+
var StyledIcon = external_styled_components_default.a.div.withConfig({
|
|
316
324
|
displayName: "HeaderStyles__StyledIcon",
|
|
317
325
|
componentId: "sc-1y722ut-2"
|
|
318
|
-
})(["margin-right:
|
|
326
|
+
})(["display:inline-flex;align-items:center;justify-content:center;margin-right:", ";", " width:", ";height:", ";flex-shrink:0;"], themes_["variables"].spacingLarge, Object(themes_["pick"])({
|
|
319
327
|
prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].transparent)
|
|
320
328
|
}), Object(themes_["pick"])({
|
|
321
329
|
comfortable: '40px',
|
|
@@ -364,6 +372,10 @@ var StyledClose = external_styled_components_default.a.div.withConfig({
|
|
|
364
372
|
componentId: "sc-1y722ut-6"
|
|
365
373
|
})(["", ";position:absolute;right:0;top:0;transform:rotate(90deg) translate(-50%,-50%);"], themes_["mixins"].reset('block'));
|
|
366
374
|
|
|
375
|
+
// CONCATENATED MODULE: ./src/Modal/ModalContext.tsx
|
|
376
|
+
|
|
377
|
+
var ModalContext = /*#__PURE__*/Object(external_react_["createContext"])({});
|
|
378
|
+
/* harmony default export */ var Modal_ModalContext = (ModalContext);
|
|
367
379
|
// CONCATENATED MODULE: ./src/Modal/Header.tsx
|
|
368
380
|
function Header_extends() { Header_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Header_extends.apply(this, arguments); }
|
|
369
381
|
|
|
@@ -375,6 +387,7 @@ function Header_objectWithoutPropertiesLoose(source, excluded) { if (source == n
|
|
|
375
387
|
|
|
376
388
|
|
|
377
389
|
|
|
390
|
+
|
|
378
391
|
var Header_propTypes = {
|
|
379
392
|
children: external_prop_types_default.a.node,
|
|
380
393
|
icon: external_prop_types_default.a.node,
|
|
@@ -395,10 +408,14 @@ function Header(_ref) {
|
|
|
395
408
|
otherProps = Header_objectWithoutProperties(_ref, ["children", "icon", "onRequestClose", "subtitle", "title"]);
|
|
396
409
|
|
|
397
410
|
// @docs-props-type StepPropsBase
|
|
411
|
+
var _useContext = Object(external_react_["useContext"])(Modal_ModalContext),
|
|
412
|
+
titleIdContext = _useContext.titleId;
|
|
413
|
+
|
|
398
414
|
return /*#__PURE__*/external_react_default.a.createElement(HeaderStyles_StyledBox, Header_extends({
|
|
399
415
|
$close: !!onRequestClose,
|
|
400
416
|
"data-test": "header"
|
|
401
417
|
}, otherProps), icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, null, icon), title ? /*#__PURE__*/external_react_default.a.createElement(StyledTitleWrapper, null, title && /*#__PURE__*/external_react_default.a.createElement(StyledTitle, {
|
|
418
|
+
id: titleIdContext,
|
|
402
419
|
"data-test": "title"
|
|
403
420
|
}, title), subtitle && /*#__PURE__*/external_react_default.a.createElement(StyledSubtitle, {
|
|
404
421
|
"data-test": "subtitle"
|
|
@@ -422,7 +439,7 @@ var Styled = external_styled_components_default()(external_react_spring_["animat
|
|
|
422
439
|
componentId: "sc-5fn8ds-0"
|
|
423
440
|
})(["", ";flex-direction:column;position:fixed;left:50%;transform:translateX(-50%);z-index:", ";", ""], themes_["mixins"].reset('flex'), themes_["variables"].zindexModal, Object(themes_["pick"])({
|
|
424
441
|
enterprise: Object(external_styled_components_["css"])(["box-shadow:0 1px 5px ", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);"], themes_["variables"].black, themes_["variables"].spacing, themes_["variables"].spacing),
|
|
425
|
-
prisma: Object(external_styled_components_["css"])(["box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);"], themes_["variables"].modalShadow, themes_["variables"].spacingXLarge, themes_["variables"].spacingXLarge)
|
|
442
|
+
prisma: Object(external_styled_components_["css"])(["box-shadow:", ";max-height:calc(100vh - ", " * 4);max-width:calc(100vw - ", " * 4);border-radius:", ";overflow:hidden;"], themes_["variables"].modalShadow, themes_["variables"].spacingXLarge, themes_["variables"].spacingXLarge, themes_["variables"].borderRadius)
|
|
426
443
|
}));
|
|
427
444
|
|
|
428
445
|
// CONCATENATED MODULE: ./src/Modal/Modal.tsx
|
|
@@ -477,6 +494,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
477
494
|
|
|
478
495
|
|
|
479
496
|
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
/** @public */
|
|
500
|
+
|
|
480
501
|
var Modal_propTypes = {
|
|
481
502
|
children: external_prop_types_default.a.node,
|
|
482
503
|
initialFocus: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.oneOf(['first', 'container'])]),
|
|
@@ -493,16 +514,14 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
493
514
|
|
|
494
515
|
var _super = _createSuper(Modal);
|
|
495
516
|
|
|
496
|
-
|
|
517
|
+
// @docs-props-type ModalPropsBase
|
|
518
|
+
// this timeout ensures that the Modal is finished rendering before setting the focus
|
|
519
|
+
function Modal(props) {
|
|
497
520
|
var _this;
|
|
498
521
|
|
|
499
522
|
_classCallCheck(this, Modal);
|
|
500
523
|
|
|
501
|
-
|
|
502
|
-
args[_key] = arguments[_key];
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
524
|
+
_this = _super.call(this, props);
|
|
506
525
|
|
|
507
526
|
_defineProperty(_assertThisInitialized(_this), "el", null);
|
|
508
527
|
|
|
@@ -510,6 +529,8 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
510
529
|
|
|
511
530
|
_defineProperty(_assertThisInitialized(_this), "initialFocus", null);
|
|
512
531
|
|
|
532
|
+
_defineProperty(_assertThisInitialized(_this), "headerTitleId", void 0);
|
|
533
|
+
|
|
513
534
|
_defineProperty(_assertThisInitialized(_this), "getDefaultMotionStyle", function () {
|
|
514
535
|
return {
|
|
515
536
|
top: 0
|
|
@@ -529,35 +550,43 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
529
550
|
});
|
|
530
551
|
|
|
531
552
|
_defineProperty(_assertThisInitialized(_this), "handleInitialFocus", function () {
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
// doesn't work for all values of "initialFocus"
|
|
536
|
-
// and it has a nested defer() call, which we want to avoid
|
|
537
|
-
|
|
538
|
-
if (_this.initialFocus !== initialFocus) {
|
|
539
|
-
if (initialFocus === 'first') {
|
|
540
|
-
if (_this.el) {
|
|
541
|
-
/* eslint-disable prefer-destructuring */
|
|
542
|
-
|
|
543
|
-
/* prefer-desturucting leads to harder-to-read syntax in this case */
|
|
544
|
-
focusTarget = Object(focus_["getSortedTabbableElements"])(_this.el)[0];
|
|
545
|
-
/* eslint-enable prefer-destructuring */
|
|
546
|
-
}
|
|
547
|
-
} else if (initialFocus === 'container') {
|
|
548
|
-
focusTarget = _this.el;
|
|
549
|
-
} else if (_typeof(initialFocus) === 'object') {
|
|
550
|
-
focusTarget = initialFocus;
|
|
551
|
-
} // Typescript isn't happy with optional chaining here
|
|
553
|
+
var _this$props = _this.props,
|
|
554
|
+
initialFocus = _this$props.initialFocus,
|
|
555
|
+
open = _this$props.open;
|
|
552
556
|
|
|
557
|
+
if (open) {
|
|
558
|
+
_this.initialFocusTimeoutId = Object(external_lodash_["defer"])(function () {
|
|
559
|
+
var focusTarget; // not using the takeFocus() util here because it
|
|
560
|
+
// doesn't work for all values of "initialFocus"
|
|
561
|
+
// and it has a nested defer() call, which we want to avoid
|
|
562
|
+
|
|
563
|
+
if (_this.initialFocus !== initialFocus) {
|
|
564
|
+
if (initialFocus === 'first') {
|
|
565
|
+
if (_this.el) {
|
|
566
|
+
/* eslint-disable prefer-destructuring */
|
|
567
|
+
|
|
568
|
+
/* prefer-desturucting leads to harder-to-read syntax in this case */
|
|
569
|
+
focusTarget = Object(focus_["getSortedTabbableElements"])(_this.el)[0];
|
|
570
|
+
/* eslint-enable prefer-destructuring */
|
|
571
|
+
}
|
|
572
|
+
} else if (initialFocus === 'container') {
|
|
573
|
+
focusTarget = _this.el;
|
|
574
|
+
} else if (_typeof(initialFocus) === 'object') {
|
|
575
|
+
focusTarget = initialFocus;
|
|
576
|
+
} // Typescript isn't happy with optional chaining here
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
if (focusTarget != null && 'focus' in focusTarget) {
|
|
580
|
+
focusTarget.focus();
|
|
581
|
+
}
|
|
553
582
|
|
|
554
|
-
|
|
555
|
-
focusTarget.focus();
|
|
583
|
+
_this.initialFocus = initialFocus;
|
|
556
584
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
585
|
+
});
|
|
586
|
+
} else {
|
|
587
|
+
_this.initialFocus = null;
|
|
588
|
+
clearTimeout(_this.initialFocusTimeoutId);
|
|
589
|
+
}
|
|
561
590
|
});
|
|
562
591
|
|
|
563
592
|
_defineProperty(_assertThisInitialized(_this), "handleModalMount", function (element) {
|
|
@@ -571,16 +600,16 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
571
600
|
});
|
|
572
601
|
|
|
573
602
|
_defineProperty(_assertThisInitialized(_this), "handleRequestClose", function (e) {
|
|
574
|
-
var _this$props$onRequest, _this$
|
|
603
|
+
var _this$props$onRequest, _this$props2;
|
|
575
604
|
|
|
576
605
|
_this.initialFocus = null;
|
|
577
|
-
(_this$props$onRequest = (_this$
|
|
606
|
+
(_this$props$onRequest = (_this$props2 = _this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props2, e);
|
|
578
607
|
});
|
|
579
608
|
|
|
580
609
|
_defineProperty(_assertThisInitialized(_this), "renderModal", function (interpolatedStyle) {
|
|
581
|
-
var _this$
|
|
582
|
-
style = _this$
|
|
583
|
-
children = _this$
|
|
610
|
+
var _this$props3 = _this.props,
|
|
611
|
+
style = _this$props3.style,
|
|
612
|
+
children = _this$props3.children;
|
|
584
613
|
var top = interpolatedStyle.top,
|
|
585
614
|
opacity = interpolatedStyle.opacity;
|
|
586
615
|
var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
|
|
@@ -594,19 +623,28 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
594
623
|
}),
|
|
595
624
|
tabIndex: -1,
|
|
596
625
|
onKeyDown: _this.handleModalKeyDown,
|
|
597
|
-
role: "dialog"
|
|
598
|
-
|
|
626
|
+
role: "dialog",
|
|
627
|
+
"aria-labelledby": _this.headerTitleId
|
|
628
|
+
}, Object(external_lodash_["omit"])(_this.props, [].concat(_toConsumableArray(Object(external_lodash_["keys"])(Modal.propTypes)), ['style']))), /*#__PURE__*/external_react_default.a.createElement(Modal_ModalContext.Provider, {
|
|
629
|
+
value: {
|
|
630
|
+
titleId: _this.headerTitleId
|
|
631
|
+
}
|
|
632
|
+
}, clonedChildren));
|
|
599
633
|
});
|
|
600
634
|
|
|
635
|
+
_this.headerTitleId = Object(id_["createDOMID"])('titleId');
|
|
601
636
|
return _this;
|
|
602
637
|
}
|
|
603
638
|
|
|
604
639
|
_createClass(Modal, [{
|
|
640
|
+
key: "componentDidMount",
|
|
641
|
+
value: function componentDidMount() {
|
|
642
|
+
this.handleInitialFocus();
|
|
643
|
+
}
|
|
644
|
+
}, {
|
|
605
645
|
key: "componentDidUpdate",
|
|
606
646
|
value: function componentDidUpdate(prevProps) {
|
|
607
|
-
var
|
|
608
|
-
initialFocus = _this$props3.initialFocus,
|
|
609
|
-
open = _this$props3.open;
|
|
647
|
+
var initialFocus = this.props.initialFocus;
|
|
610
648
|
|
|
611
649
|
if (prevProps.initialFocus !== initialFocus) {
|
|
612
650
|
// cancel the defer() set up in handleInitialFocus()
|
|
@@ -614,11 +652,7 @@ var Modal_Modal = /*#__PURE__*/function (_Component) {
|
|
|
614
652
|
clearTimeout(this.initialFocusTimeoutId);
|
|
615
653
|
}
|
|
616
654
|
|
|
617
|
-
|
|
618
|
-
this.handleInitialFocus();
|
|
619
|
-
} else {
|
|
620
|
-
this.initialFocus = null;
|
|
621
|
-
}
|
|
655
|
+
this.handleInitialFocus();
|
|
622
656
|
}
|
|
623
657
|
}, {
|
|
624
658
|
key: "render",
|
|
@@ -668,7 +702,7 @@ module.exports = require("react");
|
|
|
668
702
|
|
|
669
703
|
/***/ }),
|
|
670
704
|
|
|
671
|
-
/***/
|
|
705
|
+
/***/ 26:
|
|
672
706
|
/***/ (function(module, exports) {
|
|
673
707
|
|
|
674
708
|
module.exports = require("@splunk/ui-utils/focus");
|
|
@@ -696,14 +730,14 @@ module.exports = require("lodash");
|
|
|
696
730
|
|
|
697
731
|
/***/ }),
|
|
698
732
|
|
|
699
|
-
/***/
|
|
733
|
+
/***/ 67:
|
|
700
734
|
/***/ (function(module, exports) {
|
|
701
735
|
|
|
702
736
|
module.exports = require("@splunk/react-ui/CloseButton");
|
|
703
737
|
|
|
704
738
|
/***/ }),
|
|
705
739
|
|
|
706
|
-
/***/
|
|
740
|
+
/***/ 77:
|
|
707
741
|
/***/ (function(module, exports) {
|
|
708
742
|
|
|
709
743
|
module.exports = require("@splunk/react-ui/ModalLayer");
|
package/ModalLayer.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 163);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 163:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
|
@@ -123,7 +123,7 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
|
|
|
123
123
|
var Animation_ = __webpack_require__(30);
|
|
124
124
|
|
|
125
125
|
// EXTERNAL MODULE: external "@splunk/react-ui/Layer"
|
|
126
|
-
var Layer_ = __webpack_require__(
|
|
126
|
+
var Layer_ = __webpack_require__(55);
|
|
127
127
|
var Layer_default = /*#__PURE__*/__webpack_require__.n(Layer_);
|
|
128
128
|
|
|
129
129
|
// EXTERNAL MODULE: external "styled-components"
|
|
@@ -243,6 +243,7 @@ var ModalLayer_ModalLayer = /*#__PURE__*/function (_Component) {
|
|
|
243
243
|
return /*#__PURE__*/external_react_default.a.createElement("div", null,
|
|
244
244
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
245
245
|
renderModal(interpolatedStyle), open && useLayerForClickAway && /*#__PURE__*/external_react_default.a.createElement(StyledClickAwayOverlay, {
|
|
246
|
+
"data-test": "modal-overlay",
|
|
246
247
|
onMouseDown: _this.handleClickAway,
|
|
247
248
|
key: "clickAway",
|
|
248
249
|
style: {
|
|
@@ -328,7 +329,7 @@ module.exports = require("@splunk/react-ui/Animation");
|
|
|
328
329
|
|
|
329
330
|
/***/ }),
|
|
330
331
|
|
|
331
|
-
/***/
|
|
332
|
+
/***/ 55:
|
|
332
333
|
/***/ (function(module, exports) {
|
|
333
334
|
|
|
334
335
|
module.exports = require("@splunk/react-ui/Layer");
|
package/Monogram.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 164);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,14 +101,14 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 11:
|
|
105
105
|
/***/ (function(module, exports) {
|
|
106
106
|
|
|
107
107
|
module.exports = require("@splunk/react-ui/Clickable");
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 164:
|
|
112
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
113
|
|
|
114
114
|
"use strict";
|
|
@@ -135,7 +135,7 @@ var external_styled_components_ = __webpack_require__(3);
|
|
|
135
135
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
136
136
|
|
|
137
137
|
// EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
|
|
138
|
-
var Clickable_ = __webpack_require__(
|
|
138
|
+
var Clickable_ = __webpack_require__(11);
|
|
139
139
|
var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
|
|
140
140
|
|
|
141
141
|
// EXTERNAL MODULE: external "@splunk/themes"
|