@splunk/react-ui 4.13.0 → 4.15.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/.dockerignore +2 -0
- package/Accordion.js +41 -16
- package/Anchor.js +9 -9
- package/Animation.js +6 -6
- package/AnimationToggle.js +2 -2
- package/Box.js +9 -9
- package/Button.js +47 -46
- package/ButtonGroup.js +9 -9
- package/ButtonSimple.js +14 -14
- package/CHANGELOG.md +46 -1
- package/Calendar.js +460 -147
- package/Card.js +85 -83
- package/CardLayout.js +9 -9
- package/Chip.js +23 -23
- package/Clickable.js +39 -15
- package/CloseButton.js +23 -23
- package/Code.js +484 -436
- package/CollapsiblePanel.js +64 -35
- package/Color.js +298 -188
- package/ColumnLayout.js +18 -17
- package/ComboBox.js +81 -32
- package/Concertina.js +89 -28
- package/ControlGroup.js +85 -27
- package/Date.js +134 -58
- package/DefinitionList.js +14 -8
- package/Divider.d.ts +2 -0
- package/Divider.js +194 -0
- package/Dockerfile.enterprise.storybook +7 -0
- package/Dockerfile.prisma.storybook +7 -0
- package/Dockerfile.visual +10 -0
- package/Dropdown.js +79 -19
- package/EventListener.js +17 -17
- package/File.js +96 -43
- package/FormRows.js +40 -39
- package/Heading.js +83 -55
- package/Image.js +67 -42
- package/JSONTree.js +106 -21
- package/Layer.js +130 -28
- package/Link.js +17 -17
- package/List.js +3 -3
- package/Markdown.js +71 -65
- package/Menu.js +155 -121
- package/Message.js +135 -135
- package/MessageBar.js +136 -136
- package/Modal.js +99 -48
- package/ModalLayer.js +15 -15
- package/Monogram.js +18 -17
- package/Multiselect.js +2788 -2310
- package/Number.js +76 -37
- package/Paginator.js +99 -86
- package/Paragraph.js +10 -10
- package/Popover.js +343 -48
- package/Progress.js +23 -22
- package/RadioBar.js +32 -14
- package/RadioList.js +17 -11
- package/Resize.js +34 -21
- package/ResultsMenu.js +44 -31
- package/ScreenReaderContent.js +9 -9
- package/Scroll.js +52 -27
- package/ScrollContainerContext.js +157 -6
- package/Search.js +71 -34
- package/Select.js +347 -69
- package/SidePanel.js +37 -24
- package/Slider.js +50 -20
- package/SlidingPanels.js +56 -18
- package/SplitButton.js +27 -26
- package/StaticContent.js +9 -9
- package/StepBar.js +22 -22
- package/Switch.js +18 -13
- package/TabBar.js +28 -28
- package/TabLayout.js +43 -18
- package/Table.js +549 -158
- package/Text.js +93 -50
- package/TextArea.d.ts +2 -0
- package/TextArea.js +134 -56
- package/Tooltip.js +246 -63
- package/TransitionOpen.js +63 -26
- package/Typography.d.ts +2 -0
- package/Typography.js +17 -16
- package/WaitSpinner.js +15 -81
- package/docker-compose.yml +42 -0
- package/package.json +20 -20
- package/test-runner-jest.config.js +23 -5
- package/types/src/Accordion/AccordionContext.d.ts +1 -0
- package/types/src/Button/docs/examples/Selected.d.ts +2 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +1 -0
- package/types/src/Calendar/Calendar.d.ts +17 -2
- package/types/src/Calendar/DateTable.d.ts +7 -3
- package/types/src/Calendar/Day.d.ts +14 -5
- package/types/src/CardLayout/CardLayoutContext.d.ts +1 -0
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +7 -3
- package/types/src/Concertina/ConcertinaContext.d.ts +1 -0
- package/types/src/ControlGroup/ControlGroup.d.ts +15 -8
- package/types/src/ControlGroup/docs/examples/HelpWithErrorText.d.ts +2 -0
- package/types/src/ControlGroup/docs/examples/Required.d.ts +2 -0
- package/types/src/Date/Date.d.ts +17 -8
- package/types/src/Date/docs/examples/CustomDate.d.ts +2 -2
- package/types/src/Date/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Date/docs/examples/prisma/WithoutCalendar.d.ts +2 -0
- package/types/src/Divider/Divider.d.ts +20 -0
- package/types/src/Divider/docs/examples/AriaHidden.d.ts +2 -0
- package/types/src/Divider/docs/examples/Basic.d.ts +2 -0
- package/types/src/Divider/docs/examples/CustomStyle.d.ts +2 -0
- package/types/src/Divider/docs/examples/Vertical.d.ts +2 -0
- package/types/src/Divider/index.d.ts +1 -0
- package/types/src/File/File.d.ts +4 -2
- package/types/src/File/FileContext.d.ts +1 -0
- package/types/src/FormRows/FormRowsContext.d.ts +1 -0
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +1 -0
- package/types/src/Modal/Modal.d.ts +7 -3
- package/types/src/Modal/ModalContext.d.ts +2 -0
- package/types/src/Multiselect/Compact.d.ts +10 -1
- package/types/src/Multiselect/Multiselect.d.ts +12 -1
- package/types/src/Multiselect/Normal.d.ts +2 -0
- package/types/src/Number/Number.d.ts +5 -1
- package/types/src/Popover/Popover.d.ts +25 -5
- package/types/src/Popover/PopoverContext.d.ts +1 -0
- package/types/src/RadioBar/RadioBar.d.ts +5 -3
- package/types/src/RadioBar/RadioBarContext.d.ts +1 -0
- package/types/src/RadioList/RadioList.d.ts +5 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -0
- package/types/src/Select/SelectBase.d.ts +2 -0
- package/types/src/Slider/Slider.d.ts +5 -3
- package/types/src/SplitButton/docs/examples/Disabled.d.ts +1 -1
- package/types/src/SplitButton/docs/examples/prisma/Disabled.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/Switch/Switch.d.ts +2 -0
- package/types/src/TabBar/TabBarContext.d.ts +1 -0
- package/types/src/Table/Head.d.ts +2 -0
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/FilterColumnValues.d.ts +14 -0
- package/types/src/Text/Text.d.ts +5 -3
- package/types/src/TextArea/TextArea.d.ts +5 -3
- package/types/src/Tooltip/Tooltip.d.ts +26 -9
- package/types/src/TransitionOpen/TransitionOpen.d.ts +7 -3
- package/types/src/WaitSpinner/WaitSpinner.d.ts +1 -1
- package/types/src/useForceUpdate/useForceUpdate.d.ts +1 -0
- package/types/src/useKeyPress/index.d.ts +37 -0
- package/useForceUpdate.js +9 -9
- package/{useIsSsr.js → useKeyPress.js} +56 -49
- package/usePrevious.js +9 -9
- package/types/src/useIsSsr/index.d.ts +0 -2
- package/types/src/useIsSsr/useIsSsr.d.ts +0 -8
package/Popover.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 = 187);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,21 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
+
/***/ 10:
|
|
105
|
+
/***/ (function(module, exports) {
|
|
106
|
+
|
|
107
|
+
module.exports = require("lodash/keys");
|
|
108
|
+
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
104
111
|
/***/ 11:
|
|
112
|
+
/***/ (function(module, exports) {
|
|
113
|
+
|
|
114
|
+
module.exports = require("lodash/has");
|
|
115
|
+
|
|
116
|
+
/***/ }),
|
|
117
|
+
|
|
118
|
+
/***/ 12:
|
|
105
119
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
120
|
|
|
107
121
|
"use strict";
|
|
@@ -128,7 +142,42 @@ function updateReactRef(ref, current) {
|
|
|
128
142
|
|
|
129
143
|
/***/ }),
|
|
130
144
|
|
|
131
|
-
/***/
|
|
145
|
+
/***/ 144:
|
|
146
|
+
/***/ (function(module, exports) {
|
|
147
|
+
|
|
148
|
+
module.exports = require("lodash/clamp");
|
|
149
|
+
|
|
150
|
+
/***/ }),
|
|
151
|
+
|
|
152
|
+
/***/ 145:
|
|
153
|
+
/***/ (function(module, exports) {
|
|
154
|
+
|
|
155
|
+
module.exports = require("lodash/every");
|
|
156
|
+
|
|
157
|
+
/***/ }),
|
|
158
|
+
|
|
159
|
+
/***/ 146:
|
|
160
|
+
/***/ (function(module, exports) {
|
|
161
|
+
|
|
162
|
+
module.exports = require("lodash/intersection");
|
|
163
|
+
|
|
164
|
+
/***/ }),
|
|
165
|
+
|
|
166
|
+
/***/ 17:
|
|
167
|
+
/***/ (function(module, exports) {
|
|
168
|
+
|
|
169
|
+
module.exports = require("@splunk/react-ui/EventListener");
|
|
170
|
+
|
|
171
|
+
/***/ }),
|
|
172
|
+
|
|
173
|
+
/***/ 18:
|
|
174
|
+
/***/ (function(module, exports) {
|
|
175
|
+
|
|
176
|
+
module.exports = require("lodash/includes");
|
|
177
|
+
|
|
178
|
+
/***/ }),
|
|
179
|
+
|
|
180
|
+
/***/ 187:
|
|
132
181
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
133
182
|
|
|
134
183
|
"use strict";
|
|
@@ -148,31 +197,72 @@ var external_prop_types_ = __webpack_require__(1);
|
|
|
148
197
|
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
149
198
|
|
|
150
199
|
// EXTERNAL MODULE: external "react-dom"
|
|
151
|
-
var external_react_dom_ = __webpack_require__(
|
|
200
|
+
var external_react_dom_ = __webpack_require__(93);
|
|
201
|
+
|
|
202
|
+
// EXTERNAL MODULE: external "lodash/clamp"
|
|
203
|
+
var clamp_ = __webpack_require__(144);
|
|
204
|
+
var clamp_default = /*#__PURE__*/__webpack_require__.n(clamp_);
|
|
205
|
+
|
|
206
|
+
// EXTERNAL MODULE: external "lodash/defer"
|
|
207
|
+
var defer_ = __webpack_require__(53);
|
|
208
|
+
var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
|
|
209
|
+
|
|
210
|
+
// EXTERNAL MODULE: external "lodash/every"
|
|
211
|
+
var every_ = __webpack_require__(145);
|
|
212
|
+
var every_default = /*#__PURE__*/__webpack_require__.n(every_);
|
|
213
|
+
|
|
214
|
+
// EXTERNAL MODULE: external "lodash/has"
|
|
215
|
+
var has_ = __webpack_require__(11);
|
|
216
|
+
var has_default = /*#__PURE__*/__webpack_require__.n(has_);
|
|
217
|
+
|
|
218
|
+
// EXTERNAL MODULE: external "lodash/includes"
|
|
219
|
+
var includes_ = __webpack_require__(18);
|
|
220
|
+
var includes_default = /*#__PURE__*/__webpack_require__.n(includes_);
|
|
221
|
+
|
|
222
|
+
// EXTERNAL MODULE: external "lodash/intersection"
|
|
223
|
+
var intersection_ = __webpack_require__(146);
|
|
224
|
+
var intersection_default = /*#__PURE__*/__webpack_require__.n(intersection_);
|
|
152
225
|
|
|
153
|
-
// EXTERNAL MODULE: external "lodash"
|
|
154
|
-
var
|
|
226
|
+
// EXTERNAL MODULE: external "lodash/isFinite"
|
|
227
|
+
var isFinite_ = __webpack_require__(21);
|
|
228
|
+
var isFinite_default = /*#__PURE__*/__webpack_require__.n(isFinite_);
|
|
229
|
+
|
|
230
|
+
// EXTERNAL MODULE: external "lodash/isFunction"
|
|
231
|
+
var isFunction_ = __webpack_require__(68);
|
|
232
|
+
var isFunction_default = /*#__PURE__*/__webpack_require__.n(isFunction_);
|
|
233
|
+
|
|
234
|
+
// EXTERNAL MODULE: external "lodash/keys"
|
|
235
|
+
var keys_ = __webpack_require__(10);
|
|
236
|
+
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
237
|
+
|
|
238
|
+
// EXTERNAL MODULE: external "lodash/omit"
|
|
239
|
+
var omit_ = __webpack_require__(5);
|
|
240
|
+
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
241
|
+
|
|
242
|
+
// EXTERNAL MODULE: external "lodash/throttle"
|
|
243
|
+
var throttle_ = __webpack_require__(31);
|
|
244
|
+
var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
|
|
155
245
|
|
|
156
246
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
157
247
|
var themes_ = __webpack_require__(0);
|
|
158
248
|
|
|
159
249
|
// EXTERNAL MODULE: external "@splunk/react-ui/Animation"
|
|
160
|
-
var Animation_ = __webpack_require__(
|
|
250
|
+
var Animation_ = __webpack_require__(43);
|
|
161
251
|
|
|
162
252
|
// EXTERNAL MODULE: external "@splunk/react-ui/EventListener"
|
|
163
|
-
var EventListener_ = __webpack_require__(
|
|
253
|
+
var EventListener_ = __webpack_require__(17);
|
|
164
254
|
var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
|
|
165
255
|
|
|
166
256
|
// EXTERNAL MODULE: external "@splunk/react-ui/Layer"
|
|
167
|
-
var Layer_ = __webpack_require__(
|
|
257
|
+
var Layer_ = __webpack_require__(82);
|
|
168
258
|
var Layer_default = /*#__PURE__*/__webpack_require__.n(Layer_);
|
|
169
259
|
|
|
170
260
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
|
|
171
|
-
var ScrollContainerContext_ = __webpack_require__(
|
|
261
|
+
var ScrollContainerContext_ = __webpack_require__(49);
|
|
172
262
|
var ScrollContainerContext_default = /*#__PURE__*/__webpack_require__.n(ScrollContainerContext_);
|
|
173
263
|
|
|
174
264
|
// EXTERNAL MODULE: external "@splunk/ui-utils/focus"
|
|
175
|
-
var focus_ = __webpack_require__(
|
|
265
|
+
var focus_ = __webpack_require__(35);
|
|
176
266
|
|
|
177
267
|
// CONCATENATED MODULE: ./src/Popover/getPlacement.ts
|
|
178
268
|
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; }
|
|
@@ -454,7 +544,7 @@ function getPlacement(args) {
|
|
|
454
544
|
var PopoverContext = /*#__PURE__*/Object(external_react_["createContext"])({});
|
|
455
545
|
|
|
456
546
|
// EXTERNAL MODULE: external "react-spring"
|
|
457
|
-
var external_react_spring_ = __webpack_require__(
|
|
547
|
+
var external_react_spring_ = __webpack_require__(26);
|
|
458
548
|
|
|
459
549
|
// EXTERNAL MODULE: external "styled-components"
|
|
460
550
|
var external_styled_components_ = __webpack_require__(3);
|
|
@@ -475,8 +565,11 @@ var Styled = external_styled_components_default()(external_react_spring_["animat
|
|
|
475
565
|
var StyledBox = external_styled_components_default.a.div.withConfig({
|
|
476
566
|
displayName: "PopoverStyles__StyledBox",
|
|
477
567
|
componentId: "sc-1nahsvw-1"
|
|
478
|
-
})(["", ";", ";"], themes_["mixins"].reset('block'), function (_ref) {
|
|
479
|
-
var $
|
|
568
|
+
})(["", ";", ";", ";"], themes_["mixins"].reset('block'), function (_ref) {
|
|
569
|
+
var $open = _ref.$open;
|
|
570
|
+
return !$open && Object(external_styled_components_["css"])(["pointer-events:none;"]);
|
|
571
|
+
}, function (_ref2) {
|
|
572
|
+
var $appearance = _ref2.$appearance;
|
|
480
573
|
return $appearance !== 'none' && Object(external_styled_components_["css"])(["padding:8px;"]);
|
|
481
574
|
});
|
|
482
575
|
var StyledContent = external_styled_components_default.a.div.withConfig({
|
|
@@ -525,7 +618,10 @@ var StyledLowerRightCorner = external_styled_components_default.a.div.withConfig
|
|
|
525
618
|
})(["position:fixed;right:0;bottom:0;"]);
|
|
526
619
|
|
|
527
620
|
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
528
|
-
var updateReactRef = __webpack_require__(
|
|
621
|
+
var updateReactRef = __webpack_require__(12);
|
|
622
|
+
|
|
623
|
+
// EXTERNAL MODULE: ./src/utils/ssrWindow.ts
|
|
624
|
+
var ssrWindow = __webpack_require__(20);
|
|
529
625
|
|
|
530
626
|
// CONCATENATED MODULE: ./src/Popover/Popover.tsx
|
|
531
627
|
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); }
|
|
@@ -592,11 +688,25 @@ function Popover_defineProperty(obj, key, value) { if (key in obj) { Object.defi
|
|
|
592
688
|
|
|
593
689
|
|
|
594
690
|
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
/** @public */
|
|
703
|
+
|
|
595
704
|
var possibleCloseReasons = ['clickAway', 'escapeKey', 'offScreen', 'tabKey'];
|
|
596
705
|
var propTypes = {
|
|
597
706
|
align: external_prop_types_default.a.oneOf(['center', 'edge', 'theme', 'end']),
|
|
598
707
|
anchor: external_prop_types_default.a.object,
|
|
599
708
|
animation: external_prop_types_default.a.bool,
|
|
709
|
+
animationConfig: external_prop_types_default.a.object,
|
|
600
710
|
appearance: external_prop_types_default.a.oneOf(['normal', 'inverted', 'none']),
|
|
601
711
|
autoCloseWhenOffScreen: external_prop_types_default.a.bool,
|
|
602
712
|
canCoverAnchor: external_prop_types_default.a.bool,
|
|
@@ -605,8 +715,10 @@ var propTypes = {
|
|
|
605
715
|
defaultPlacement: external_prop_types_default.a.oneOf(['above', 'below', 'left', 'right', 'vertical', 'horizontal']),
|
|
606
716
|
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
607
717
|
id: external_prop_types_default.a.string,
|
|
718
|
+
onReposition: external_prop_types_default.a.func,
|
|
608
719
|
onRequestClose: external_prop_types_default.a.func,
|
|
609
720
|
open: external_prop_types_default.a.bool,
|
|
721
|
+
outerRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
610
722
|
pointTo: external_prop_types_default.a.shape({
|
|
611
723
|
x: external_prop_types_default.a.number,
|
|
612
724
|
y: external_prop_types_default.a.number
|
|
@@ -619,6 +731,7 @@ var propTypes = {
|
|
|
619
731
|
var defaultProps = {
|
|
620
732
|
align: 'theme',
|
|
621
733
|
animation: true,
|
|
734
|
+
animationConfig: {},
|
|
622
735
|
appearance: 'normal',
|
|
623
736
|
autoCloseWhenOffScreen: true,
|
|
624
737
|
canCoverAnchor: false,
|
|
@@ -633,8 +746,8 @@ var defaultProps = {
|
|
|
633
746
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
634
747
|
function everyApproxEqual(a, b) {
|
|
635
748
|
var threshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
636
|
-
return !!a && !!b &&
|
|
637
|
-
if (
|
|
749
|
+
return !!a && !!b && every_default()(a, function (val, key) {
|
|
750
|
+
if (isFinite_default()(val)) {
|
|
638
751
|
return Math.abs(b[key] - val) <= threshold;
|
|
639
752
|
}
|
|
640
753
|
|
|
@@ -675,7 +788,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
675
788
|
var maxVertDiff = outerContainerEl.offsetHeight / 2 - 22;
|
|
676
789
|
var minVertDiff = -(outerContainerEl.offsetHeight / 2 - 15);
|
|
677
790
|
var initVertDiff = anchorPos.center - (outerContainerStyle.top + outerContainerEl.offsetHeight / 2) - arrowHeight / 2;
|
|
678
|
-
var vertDiff =
|
|
791
|
+
var vertDiff = clamp_default()(initVertDiff, minVertDiff, maxVertDiff);
|
|
679
792
|
var horizontalDiff = anchorPos.middle - (outerContainerStyle.left + outerContainerEl.offsetWidth / 2) - arrowHeight;
|
|
680
793
|
var transformMetadata = {
|
|
681
794
|
left: {
|
|
@@ -748,8 +861,8 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
748
861
|
height: anchorEl.offsetHeight
|
|
749
862
|
};
|
|
750
863
|
var pointTo = _this.props.pointTo;
|
|
751
|
-
var pointToHorizontal = pointTo &&
|
|
752
|
-
var pointToVertical = pointTo &&
|
|
864
|
+
var pointToHorizontal = pointTo && has_default()(pointTo, 'x');
|
|
865
|
+
var pointToVertical = pointTo && has_default()(pointTo, 'y');
|
|
753
866
|
a.left = pointToHorizontal ? rect.left + ((pointTo === null || pointTo === void 0 ? void 0 : pointTo.x) || 0) : rect.left;
|
|
754
867
|
a.top = pointToVertical ? rect.top + ((pointTo === null || pointTo === void 0 ? void 0 : pointTo.y) || 0) : rect.top;
|
|
755
868
|
a.right = pointToHorizontal ? a.left + a.width : rect.left + a.width || rect.right;
|
|
@@ -760,6 +873,8 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
760
873
|
});
|
|
761
874
|
|
|
762
875
|
Popover_defineProperty(_assertThisInitialized(_this), "setPlacement", function (scrolling) {
|
|
876
|
+
var window = Object(ssrWindow["a" /* getWindow */])();
|
|
877
|
+
|
|
763
878
|
_this.setState(function (state) {
|
|
764
879
|
var _state$arrowStyleTran;
|
|
765
880
|
|
|
@@ -769,6 +884,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
769
884
|
autoCloseWhenOffScreen = _this$props.autoCloseWhenOffScreen,
|
|
770
885
|
canCoverAnchor = _this$props.canCoverAnchor,
|
|
771
886
|
defaultPlacement = _this$props.defaultPlacement,
|
|
887
|
+
onReposition = _this$props.onReposition,
|
|
772
888
|
open = _this$props.open,
|
|
773
889
|
repositionMode = _this$props.repositionMode,
|
|
774
890
|
splunkTheme = _this$props.splunkTheme;
|
|
@@ -825,12 +941,15 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
825
941
|
|
|
826
942
|
var hasArrow = _this.props.appearance !== 'none' && !isPrisma;
|
|
827
943
|
var baseCheck = everyApproxEqual(anchorPos, state.anchorPos) && everyApproxEqual(outerContainerStyle, state.outerContainerStyle) && placement === state.placement && maxHeight === state.maxHeight && maxWidth === state.maxWidth;
|
|
828
|
-
var arrowCheck = everyApproxEqual(
|
|
944
|
+
var arrowCheck = everyApproxEqual(omit_default()(arrowStyle, 'transform'), omit_default()(state.arrowStyle, 'transform')) && everyApproxEqual(arrowStyleTransformMeta !== null && arrowStyleTransformMeta !== void 0 ? arrowStyleTransformMeta : {}, (_state$arrowStyleTran = state.arrowStyleTransformMeta) !== null && _state$arrowStyleTran !== void 0 ? _state$arrowStyleTran : {}); // If none of the position data has changed, do not set state.
|
|
829
945
|
|
|
830
946
|
if (baseCheck && (!hasArrow || hasArrow && arrowCheck)) {
|
|
831
947
|
return null;
|
|
832
948
|
}
|
|
833
949
|
|
|
950
|
+
onReposition === null || onReposition === void 0 ? void 0 : onReposition({
|
|
951
|
+
placement: placement
|
|
952
|
+
});
|
|
834
953
|
return {
|
|
835
954
|
anchorPos: anchorPos,
|
|
836
955
|
arrowStyle: arrowStyle,
|
|
@@ -867,12 +986,17 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
867
986
|
_this.innerContainerEl = el;
|
|
868
987
|
|
|
869
988
|
if (el && _this.props.takeFocus) {
|
|
870
|
-
|
|
989
|
+
defer_default()(focus_["takeFocus"], el);
|
|
871
990
|
}
|
|
872
991
|
|
|
873
992
|
Object(updateReactRef["a" /* updateReactRef */])(_this.props.elementRef, el);
|
|
874
993
|
});
|
|
875
994
|
|
|
995
|
+
Popover_defineProperty(_assertThisInitialized(_this), "handleOuterContainerMount", function (el) {
|
|
996
|
+
_this.outerContainerEl = el;
|
|
997
|
+
Object(updateReactRef["a" /* updateReactRef */])(_this.props.outerRef, el);
|
|
998
|
+
});
|
|
999
|
+
|
|
876
1000
|
Popover_defineProperty(_assertThisInitialized(_this), "handleTab", function (e) {
|
|
877
1001
|
if (_this.innerContainerEl) {
|
|
878
1002
|
if (_this.props.retainFocus) {
|
|
@@ -911,6 +1035,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
911
1035
|
Popover_defineProperty(_assertThisInitialized(_this), "renderLayer", function () {
|
|
912
1036
|
var _this$props2 = _this.props,
|
|
913
1037
|
animation = _this$props2.animation,
|
|
1038
|
+
animationConfig = _this$props2.animationConfig,
|
|
914
1039
|
appearance = _this$props2.appearance,
|
|
915
1040
|
children = _this$props2.children,
|
|
916
1041
|
id = _this$props2.id,
|
|
@@ -930,11 +1055,11 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
930
1055
|
// Accommodate the arrow in the maxHeight and maxWidth.
|
|
931
1056
|
|
|
932
1057
|
if (appearance !== 'none') {
|
|
933
|
-
if (
|
|
1058
|
+
if (isFinite_default()(maxHeight)) {
|
|
934
1059
|
maxHeight -= 20;
|
|
935
1060
|
}
|
|
936
1061
|
|
|
937
|
-
if (
|
|
1062
|
+
if (isFinite_default()(maxWidth)) {
|
|
938
1063
|
maxWidth -= 20;
|
|
939
1064
|
}
|
|
940
1065
|
}
|
|
@@ -958,27 +1083,26 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
958
1083
|
opacity: animation ? 0 : 1
|
|
959
1084
|
},
|
|
960
1085
|
to: motionStyle,
|
|
961
|
-
config: {
|
|
1086
|
+
config: Popover_objectSpread({
|
|
962
1087
|
tension: 300,
|
|
963
1088
|
friction: 40
|
|
964
|
-
},
|
|
1089
|
+
}, animationConfig),
|
|
965
1090
|
onRest: _this.handleAnimationEnd
|
|
966
1091
|
}, function (interpolatedStyles) {
|
|
967
1092
|
return /*#__PURE__*/external_react_default.a.createElement(Styled, {
|
|
968
1093
|
"data-test": "outer-popover",
|
|
969
1094
|
style: Popover_objectSpread(Popover_objectSpread({}, outerContainerStyle), interpolatedStyles),
|
|
970
|
-
ref:
|
|
971
|
-
_this.outerContainerEl = c;
|
|
972
|
-
}
|
|
1095
|
+
ref: _this.handleOuterContainerMount
|
|
973
1096
|
}, (open || _this.state.animating) && /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
|
|
974
1097
|
$appearance: displayAppearance,
|
|
1098
|
+
$open: open,
|
|
975
1099
|
"data-test": "popover",
|
|
976
1100
|
ref: _this.handleInnerContainerMount,
|
|
977
1101
|
tabIndex: -1,
|
|
978
1102
|
id: id,
|
|
979
1103
|
onKeyDown: _this.handleTab // TODO: remove anchor once prop type generation is fixed
|
|
980
1104
|
|
|
981
|
-
},
|
|
1105
|
+
}, omit_default()(_this.props, ['anchor'].concat(_toConsumableArray(keys_default()(Popover.propTypes))))), /*#__PURE__*/external_react_default.a.createElement(PopoverContext.Provider, {
|
|
982
1106
|
value: {
|
|
983
1107
|
retainFocus: retainFocus
|
|
984
1108
|
}
|
|
@@ -990,7 +1114,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
990
1114
|
style: arrowStyle
|
|
991
1115
|
}), appearance !== 'none' && /*#__PURE__*/external_react_default.a.createElement(StyledContent, {
|
|
992
1116
|
$appearance: displayAppearance
|
|
993
|
-
},
|
|
1117
|
+
}, isFunction_default()(children) ? children(childData) : children))), /*#__PURE__*/external_react_default.a.createElement(StyledLowerRightCorner, {
|
|
994
1118
|
ref: function ref(el) {
|
|
995
1119
|
_this.windowSizeMeasurementEl = el;
|
|
996
1120
|
}
|
|
@@ -999,9 +1123,9 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
999
1123
|
/* eslint-enable jsx-a11y/no-static-element-interactions */
|
|
1000
1124
|
});
|
|
1001
1125
|
|
|
1002
|
-
_this.handleScroll =
|
|
1003
|
-
_this.handleWindowScroll =
|
|
1004
|
-
_this.setPlacement =
|
|
1126
|
+
_this.handleScroll = throttle_default()(_this.setPlacement.bind(_assertThisInitialized(_this), true), 0);
|
|
1127
|
+
_this.handleWindowScroll = throttle_default()(_this.setPlacement.bind(_assertThisInitialized(_this), true), 0);
|
|
1128
|
+
_this.setPlacement = throttle_default()(_this.setPlacement, 0, {
|
|
1005
1129
|
leading: false
|
|
1006
1130
|
});
|
|
1007
1131
|
_this.state = {
|
|
@@ -1049,6 +1173,8 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
1049
1173
|
}, {
|
|
1050
1174
|
key: "autoCloseWhenOffScreen",
|
|
1051
1175
|
value: function autoCloseWhenOffScreen(anchorPosition, scrollContainerPosition) {
|
|
1176
|
+
var window = Object(ssrWindow["a" /* getWindow */])();
|
|
1177
|
+
|
|
1052
1178
|
if (anchorPosition.top < 0 || anchorPosition.top > window.innerHeight || anchorPosition.left < 0 || anchorPosition.left > window.innerWidth) {
|
|
1053
1179
|
this.requestClose({
|
|
1054
1180
|
reason: 'offScreen'
|
|
@@ -1070,7 +1196,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
1070
1196
|
}, {
|
|
1071
1197
|
key: "requestClose",
|
|
1072
1198
|
value: function requestClose(data) {
|
|
1073
|
-
if (
|
|
1199
|
+
if (includes_default()(this.props.closeReasons, data.reason)) {
|
|
1074
1200
|
var _this$props$onRequest, _this$props3;
|
|
1075
1201
|
|
|
1076
1202
|
(_this$props$onRequest = (_this$props3 = this.props).onRequestClose) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props3, data);
|
|
@@ -1079,6 +1205,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
1079
1205
|
}, {
|
|
1080
1206
|
key: "render",
|
|
1081
1207
|
value: function render() {
|
|
1208
|
+
var window = Object(ssrWindow["a" /* getWindow */])();
|
|
1082
1209
|
var open = this.props.open || this.state.animating;
|
|
1083
1210
|
var scrollContainer = this.context || window;
|
|
1084
1211
|
var hasCustomizedScrollContainer = scrollContainer !== window;
|
|
@@ -1106,7 +1233,7 @@ var Popover_Popover = /*#__PURE__*/function (_Component) {
|
|
|
1106
1233
|
},
|
|
1107
1234
|
key: "eventListenerOnWindowScroll"
|
|
1108
1235
|
}), /*#__PURE__*/external_react_default.a.createElement(Layer_default.a, {
|
|
1109
|
-
closeReasons:
|
|
1236
|
+
closeReasons: intersection_default()(this.props.closeReasons.filter(function (reason) {
|
|
1110
1237
|
return reason !== 'offScreen';
|
|
1111
1238
|
}), Layer_default.a.possibleCloseReasons),
|
|
1112
1239
|
open: open,
|
|
@@ -1146,31 +1273,171 @@ PopoverWithTheme.propTypes = Popover_Popover.propTypes;
|
|
|
1146
1273
|
|
|
1147
1274
|
/***/ }),
|
|
1148
1275
|
|
|
1149
|
-
/***/
|
|
1276
|
+
/***/ 2:
|
|
1150
1277
|
/***/ (function(module, exports) {
|
|
1151
1278
|
|
|
1152
|
-
module.exports = require("
|
|
1279
|
+
module.exports = require("react");
|
|
1153
1280
|
|
|
1154
1281
|
/***/ }),
|
|
1155
1282
|
|
|
1156
|
-
/***/
|
|
1157
|
-
/***/ (function(module,
|
|
1283
|
+
/***/ 20:
|
|
1284
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1285
|
+
|
|
1286
|
+
"use strict";
|
|
1287
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; });
|
|
1288
|
+
/* unused harmony export ssrWindow */
|
|
1289
|
+
/* harmony import */ var _ssrDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
|
|
1290
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
1291
|
+
|
|
1292
|
+
var ssrWindow = {
|
|
1293
|
+
document: _ssrDocument__WEBPACK_IMPORTED_MODULE_0__[/* ssrDocument */ "b"],
|
|
1294
|
+
navigator: {
|
|
1295
|
+
userAgent: ''
|
|
1296
|
+
},
|
|
1297
|
+
location: {
|
|
1298
|
+
hash: '',
|
|
1299
|
+
host: '',
|
|
1300
|
+
hostname: '',
|
|
1301
|
+
href: '',
|
|
1302
|
+
origin: '',
|
|
1303
|
+
pathname: '',
|
|
1304
|
+
protocol: '',
|
|
1305
|
+
search: ''
|
|
1306
|
+
},
|
|
1307
|
+
history: {
|
|
1308
|
+
replaceState: function replaceState() {},
|
|
1309
|
+
pushState: function pushState() {},
|
|
1310
|
+
go: function go() {},
|
|
1311
|
+
back: function back() {}
|
|
1312
|
+
},
|
|
1313
|
+
CustomEvent: function CustomEvent() {
|
|
1314
|
+
return this;
|
|
1315
|
+
},
|
|
1316
|
+
addEventListener: function addEventListener() {},
|
|
1317
|
+
removeEventListener: function removeEventListener() {},
|
|
1318
|
+
getComputedStyle: function getComputedStyle() {
|
|
1319
|
+
return {
|
|
1320
|
+
getPropertyValue: function getPropertyValue() {
|
|
1321
|
+
return '';
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
},
|
|
1325
|
+
Image: function Image() {},
|
|
1326
|
+
Date: function Date() {},
|
|
1327
|
+
screen: {},
|
|
1328
|
+
setTimeout: function setTimeout() {},
|
|
1329
|
+
clearTimeout: function clearTimeout() {},
|
|
1330
|
+
matchMedia: function matchMedia() {
|
|
1331
|
+
return {};
|
|
1332
|
+
},
|
|
1333
|
+
requestAnimationFrame: function requestAnimationFrame(callback) {
|
|
1334
|
+
if (typeof setTimeout === 'undefined') {
|
|
1335
|
+
callback();
|
|
1336
|
+
return null;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
return setTimeout(callback, 0);
|
|
1340
|
+
},
|
|
1341
|
+
cancelAnimationFrame: function cancelAnimationFrame(id) {
|
|
1342
|
+
if (typeof setTimeout === 'undefined') {
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
clearTimeout(id);
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
function getWindow() {
|
|
1351
|
+
var win = typeof window !== 'undefined' ? window : ssrWindow;
|
|
1352
|
+
return win;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1158
1355
|
|
|
1159
|
-
module.exports = require("react-spring");
|
|
1160
1356
|
|
|
1161
1357
|
/***/ }),
|
|
1162
1358
|
|
|
1163
|
-
/***/
|
|
1359
|
+
/***/ 21:
|
|
1164
1360
|
/***/ (function(module, exports) {
|
|
1165
1361
|
|
|
1166
|
-
module.exports = require("
|
|
1362
|
+
module.exports = require("lodash/isFinite");
|
|
1167
1363
|
|
|
1168
1364
|
/***/ }),
|
|
1169
1365
|
|
|
1170
1366
|
/***/ 26:
|
|
1171
1367
|
/***/ (function(module, exports) {
|
|
1172
1368
|
|
|
1173
|
-
module.exports = require("
|
|
1369
|
+
module.exports = require("react-spring");
|
|
1370
|
+
|
|
1371
|
+
/***/ }),
|
|
1372
|
+
|
|
1373
|
+
/***/ 28:
|
|
1374
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1375
|
+
|
|
1376
|
+
"use strict";
|
|
1377
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; });
|
|
1378
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ssrDocument; });
|
|
1379
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
1380
|
+
var ssrDocument = {
|
|
1381
|
+
body: {
|
|
1382
|
+
appendChild: function appendChild() {
|
|
1383
|
+
return [];
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
addEventListener: function addEventListener() {},
|
|
1387
|
+
removeEventListener: function removeEventListener() {},
|
|
1388
|
+
activeElement: {
|
|
1389
|
+
blur: function blur() {},
|
|
1390
|
+
nodeName: ''
|
|
1391
|
+
},
|
|
1392
|
+
querySelector: function querySelector() {
|
|
1393
|
+
return null;
|
|
1394
|
+
},
|
|
1395
|
+
querySelectorAll: function querySelectorAll() {
|
|
1396
|
+
return [];
|
|
1397
|
+
},
|
|
1398
|
+
getElementById: function getElementById() {
|
|
1399
|
+
return null;
|
|
1400
|
+
},
|
|
1401
|
+
createEvent: function createEvent() {
|
|
1402
|
+
return {
|
|
1403
|
+
initEvent: function initEvent() {}
|
|
1404
|
+
};
|
|
1405
|
+
},
|
|
1406
|
+
createElement: function createElement() {
|
|
1407
|
+
return {
|
|
1408
|
+
children: [],
|
|
1409
|
+
childNodes: [],
|
|
1410
|
+
style: {},
|
|
1411
|
+
setAttribute: function setAttribute() {},
|
|
1412
|
+
getElementsByTagName: function getElementsByTagName() {
|
|
1413
|
+
return [];
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
},
|
|
1417
|
+
createElementNS: function createElementNS() {
|
|
1418
|
+
return {};
|
|
1419
|
+
},
|
|
1420
|
+
importNode: function importNode() {
|
|
1421
|
+
return null;
|
|
1422
|
+
},
|
|
1423
|
+
location: {
|
|
1424
|
+
hash: '',
|
|
1425
|
+
host: '',
|
|
1426
|
+
hostname: '',
|
|
1427
|
+
href: '',
|
|
1428
|
+
origin: '',
|
|
1429
|
+
pathname: '',
|
|
1430
|
+
protocol: '',
|
|
1431
|
+
search: ''
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
function getDocument() {
|
|
1436
|
+
var doc = typeof document !== 'undefined' ? document : ssrDocument;
|
|
1437
|
+
return doc;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
|
|
1174
1441
|
|
|
1175
1442
|
/***/ }),
|
|
1176
1443
|
|
|
@@ -1184,34 +1451,62 @@ module.exports = require("styled-components");
|
|
|
1184
1451
|
/***/ 31:
|
|
1185
1452
|
/***/ (function(module, exports) {
|
|
1186
1453
|
|
|
1454
|
+
module.exports = require("lodash/throttle");
|
|
1455
|
+
|
|
1456
|
+
/***/ }),
|
|
1457
|
+
|
|
1458
|
+
/***/ 35:
|
|
1459
|
+
/***/ (function(module, exports) {
|
|
1460
|
+
|
|
1461
|
+
module.exports = require("@splunk/ui-utils/focus");
|
|
1462
|
+
|
|
1463
|
+
/***/ }),
|
|
1464
|
+
|
|
1465
|
+
/***/ 43:
|
|
1466
|
+
/***/ (function(module, exports) {
|
|
1467
|
+
|
|
1187
1468
|
module.exports = require("@splunk/react-ui/Animation");
|
|
1188
1469
|
|
|
1189
1470
|
/***/ }),
|
|
1190
1471
|
|
|
1191
|
-
/***/
|
|
1472
|
+
/***/ 49:
|
|
1192
1473
|
/***/ (function(module, exports) {
|
|
1193
1474
|
|
|
1194
1475
|
module.exports = require("@splunk/react-ui/ScrollContainerContext");
|
|
1195
1476
|
|
|
1196
1477
|
/***/ }),
|
|
1197
1478
|
|
|
1198
|
-
/***/
|
|
1479
|
+
/***/ 5:
|
|
1199
1480
|
/***/ (function(module, exports) {
|
|
1200
1481
|
|
|
1201
|
-
module.exports = require("lodash");
|
|
1482
|
+
module.exports = require("lodash/omit");
|
|
1202
1483
|
|
|
1203
1484
|
/***/ }),
|
|
1204
1485
|
|
|
1205
|
-
/***/
|
|
1486
|
+
/***/ 53:
|
|
1206
1487
|
/***/ (function(module, exports) {
|
|
1207
1488
|
|
|
1208
|
-
module.exports = require("
|
|
1489
|
+
module.exports = require("lodash/defer");
|
|
1209
1490
|
|
|
1210
1491
|
/***/ }),
|
|
1211
1492
|
|
|
1212
1493
|
/***/ 68:
|
|
1213
1494
|
/***/ (function(module, exports) {
|
|
1214
1495
|
|
|
1496
|
+
module.exports = require("lodash/isFunction");
|
|
1497
|
+
|
|
1498
|
+
/***/ }),
|
|
1499
|
+
|
|
1500
|
+
/***/ 82:
|
|
1501
|
+
/***/ (function(module, exports) {
|
|
1502
|
+
|
|
1503
|
+
module.exports = require("@splunk/react-ui/Layer");
|
|
1504
|
+
|
|
1505
|
+
/***/ }),
|
|
1506
|
+
|
|
1507
|
+
/***/ 93:
|
|
1508
|
+
/***/ (function(module, exports) {
|
|
1509
|
+
|
|
1215
1510
|
module.exports = require("react-dom");
|
|
1216
1511
|
|
|
1217
1512
|
/***/ })
|