@splunk/react-ui 4.9.0 → 4.12.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 +4 -4
- package/Anchor.js +2 -2
- package/Animation.js +4 -4
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +24 -48
- package/ButtonGroup.js +6 -27
- package/ButtonSimple.js +4 -4
- package/CHANGELOG.md +63 -6
- package/Calendar.js +39 -39
- package/Card.js +54 -68
- package/CardLayout.js +14 -35
- package/Chip.js +19 -19
- package/Clickable.js +28 -13
- package/CloseButton.js +15 -15
- package/Code.js +8 -5
- package/CollapsiblePanel.js +6 -6
- package/Color.js +21 -21
- package/ColumnLayout.js +7 -7
- package/ComboBox.js +19 -14
- package/Concertina.js +13 -13
- package/ControlGroup.js +28 -18
- package/Date.js +10 -10
- package/DefinitionList.js +2 -2
- package/Dropdown.js +6 -6
- package/EventListener.js +4 -4
- package/File.js +31 -31
- package/FormRows.js +11 -11
- package/Heading.js +2 -2
- package/Image.js +21 -21
- package/JSONTree.js +40 -22
- package/Layer.js +72 -22
- package/Link.js +9 -9
- package/List.js +2 -2
- package/Markdown.js +26 -29
- package/Menu.js +53 -53
- package/Message.js +33 -33
- package/MessageBar.js +46 -39
- package/Modal.js +8 -8
- package/ModalLayer.js +16 -7
- package/Monogram.js +27 -15
- package/Multiselect.js +101 -97
- package/Number.js +6 -6
- package/Paginator.js +46 -49
- package/Paragraph.js +2 -2
- package/Popover.js +18 -13
- package/Progress.js +8 -8
- package/RadioBar.js +145 -41
- package/RadioList.js +2 -2
- package/Resize.js +4 -4
- package/ResultsMenu.js +62 -41
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +6 -6
- package/ScrollContainerContext.js +2 -2
- package/Search.js +19 -18
- package/Select.js +81 -79
- package/SidePanel.js +4 -4
- package/Slider.js +8 -8
- package/SlidingPanels.js +16 -7
- package/StaticContent.js +2 -2
- package/StepBar.js +8 -8
- package/Switch.js +8 -8
- package/TabBar.js +15 -15
- package/TabLayout.js +4 -4
- package/Table.js +119 -92
- package/Text.js +121 -241
- package/TextArea.js +1444 -0
- package/Tooltip.js +17 -6
- package/TransitionOpen.js +20 -10
- package/Typography.js +225 -0
- package/WaitSpinner.js +4 -4
- package/cypress.json +1 -0
- package/package.json +21 -8
- package/stubs-splunkui.d.ts +13 -0
- package/test-runner-jest.config.js +38 -0
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Button/Button.d.ts +0 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/Card/Body.d.ts +6 -1
- package/types/src/Card/Card.d.ts +0 -2
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/Clickable/Clickable.d.ts +5 -0
- package/types/src/ComboBox/ComboBox.d.ts +15 -5
- package/types/src/Concertina/ConcertinaContext.d.ts +0 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +9 -2
- package/types/src/Date/Date.d.ts +3 -3
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/FormRows/FormRows.d.ts +1 -1
- package/types/src/FormRows/FormRowsContext.d.ts +0 -1
- package/types/src/FormRows/Row.d.ts +1 -1
- package/types/src/JSONTree/JSONTree.d.ts +2 -2
- package/types/src/JSONTree/TreeNode.d.ts +1 -1
- package/types/src/JSONTree/docs/examples/WithShiftModifier.d.ts +1 -0
- package/types/src/Layer/LayerStack.d.ts +8 -2
- package/types/src/Markdown/Markdown.d.ts +2 -3
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/ModalLayer/ModalLayer.d.ts +2 -0
- package/types/src/Monogram/Monogram.d.ts +2 -2
- package/types/src/Multiselect/Compact.d.ts +11 -4
- package/types/src/Multiselect/Multiselect.d.ts +14 -5
- package/types/src/Multiselect/Normal.d.ts +11 -4
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +1 -0
- package/types/src/Popover/PopoverContext.d.ts +0 -1
- package/types/src/RadioBar/Option.d.ts +10 -2
- package/types/src/RadioBar/RadioBar.d.ts +4 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/ResultsMenu/ResultsMenu.d.ts +8 -2
- package/types/src/Search/Search.d.ts +4 -0
- package/types/src/Select/Select.d.ts +13 -4
- package/types/src/Select/SelectBase.d.ts +12 -4
- package/types/src/SidePanel/SidePanel.d.ts +2 -1
- package/types/src/Slider/Slider.d.ts +3 -3
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -0
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/TabBar/TabBarContext.d.ts +0 -1
- package/types/src/Table/HeadCell.d.ts +7 -3
- package/types/src/Table/Table.d.ts +2 -3
- package/types/src/Table/TableContext.d.ts +5 -0
- package/types/src/Text/Text.d.ts +22 -12
- package/types/src/TextArea/TextArea.d.ts +190 -0
- package/types/src/TextArea/docs/examples/Basic.d.ts +2 -0
- package/types/src/TextArea/docs/examples/Disabled.d.ts +2 -0
- package/types/src/TextArea/docs/examples/Error.d.ts +2 -0
- package/types/src/TextArea/docs/examples/Inline.d.ts +2 -0
- package/types/src/TextArea/docs/examples/Uncontrolled.d.ts +2 -0
- package/types/src/TextArea/index.d.ts +2 -0
- package/types/src/{Text → TextArea}/syncHeightWithShadow.d.ts +1 -2
- package/types/src/Tooltip/Tooltip.d.ts +8 -5
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -0
- package/types/src/TransitionOpen/index.d.ts +1 -0
- package/types/src/Typography/Typography.d.ts +78 -0
- package/types/src/Typography/docs/examples/Basic.d.ts +2 -0
- package/types/src/Typography/docs/examples/Variants.d.ts +2 -0
- package/types/src/Typography/index.d.ts +2 -0
- package/types/src/Typography/test/Typography.unit.d.ts +1 -0
- package/types/src/fixtures/FetchOptions.d.ts +82 -2
- package/usePrevious.js +2 -2
- package/FetchOptions.js +0 -359
- package/types/src/FetchOptions/FetchOptions.d.ts +0 -82
- package/types/src/FetchOptions/index.d.ts +0 -2
package/RadioBar.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 = 125);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,14 +101,14 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 12:
|
|
105
105
|
/***/ (function(module, exports) {
|
|
106
106
|
|
|
107
107
|
module.exports = require("@splunk/react-ui/Clickable");
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 125:
|
|
112
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
113
|
|
|
114
114
|
"use strict";
|
|
@@ -130,15 +130,14 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
|
|
|
130
130
|
// EXTERNAL MODULE: external "lodash"
|
|
131
131
|
var external_lodash_ = __webpack_require__(4);
|
|
132
132
|
|
|
133
|
+
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
134
|
+
var keyboard_ = __webpack_require__(9);
|
|
135
|
+
|
|
133
136
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
134
137
|
var themes_ = __webpack_require__(0);
|
|
135
138
|
|
|
136
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Box"
|
|
137
|
-
var Box_ = __webpack_require__(8);
|
|
138
|
-
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
139
|
-
|
|
140
139
|
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
141
|
-
var Button_ = __webpack_require__(
|
|
140
|
+
var Button_ = __webpack_require__(16);
|
|
142
141
|
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
143
142
|
|
|
144
143
|
// EXTERNAL MODULE: external "styled-components"
|
|
@@ -146,7 +145,7 @@ var external_styled_components_ = __webpack_require__(3);
|
|
|
146
145
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
147
146
|
|
|
148
147
|
// EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
|
|
149
|
-
var Clickable_ = __webpack_require__(
|
|
148
|
+
var Clickable_ = __webpack_require__(12);
|
|
150
149
|
var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
|
|
151
150
|
|
|
152
151
|
// CONCATENATED MODULE: ./src/RadioBar/OptionStyles.ts
|
|
@@ -156,10 +155,10 @@ var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
|
|
|
156
155
|
var StyledClickable = external_styled_components_default()(Clickable_default.a).withConfig({
|
|
157
156
|
displayName: "OptionStyles__StyledClickable",
|
|
158
157
|
componentId: "fyq77p-0"
|
|
159
|
-
})(["border-radius:3px;flex:1 1 auto;display:flex;justify-content:center;align-items:center;color:", ";padding:2px 12px;height:calc(", " - 6px);position:relative;gap:
|
|
158
|
+
})(["border-radius:3px;flex:1 1 auto;display:flex;justify-content:center;align-items:center;color:", ";padding:2px 12px;height:calc(", " - 6px);position:relative;gap:", ";& + &{margin-left:2px;}", " ", " &:focus{color:", ";box-shadow:", ";z-index:2;&:active{background-color:", ";}}", " ", ""], themes_["variables"].contentColorDefault, themes_["variables"].inputHeight, themes_["variables"].spacingXSmall, function (_ref) {
|
|
160
159
|
var $selected = _ref.$selected;
|
|
161
160
|
return $selected && Object(external_styled_components_["css"])(["color:", ";background-color:", ";box-shadow:", ";"], themes_["variables"].contentColorActive, Object(themes_["pick"])({
|
|
162
|
-
dark:
|
|
161
|
+
dark: themes_["variables"].interactiveColorOverlaySelected,
|
|
163
162
|
light: themes_["variables"].white
|
|
164
163
|
}), themes_["variables"].embossShadow);
|
|
165
164
|
}, function (_ref2) {
|
|
@@ -181,13 +180,15 @@ var StyledIcon = external_styled_components_default.a.div.withConfig({
|
|
|
181
180
|
var StyledLabel = external_styled_components_default.a.div.withConfig({
|
|
182
181
|
displayName: "OptionStyles__StyledLabel",
|
|
183
182
|
componentId: "fyq77p-2"
|
|
184
|
-
})(["flex:0 1 auto;", "
|
|
185
|
-
enterprise:
|
|
183
|
+
})(["", " flex:0 1 auto;", ""], themes_["mixins"].ellipsis, Object(themes_["pick"])({
|
|
184
|
+
enterprise: Object(external_styled_components_["css"])(["&:not(:first-child){margin-left:", ";}"], themes_["variables"].spacingXSmall)
|
|
186
185
|
}));
|
|
187
186
|
var StyledAdornment = external_styled_components_default.a.div.withConfig({
|
|
188
187
|
displayName: "OptionStyles__StyledAdornment",
|
|
189
188
|
componentId: "fyq77p-3"
|
|
190
|
-
})(["flex:0 0 auto;"])
|
|
189
|
+
})(["flex:0 0 auto;", ""], Object(themes_["pick"])({
|
|
190
|
+
enterprise: Object(external_styled_components_["css"])(["&:not(:first-child){margin-left:", ";}"], themes_["variables"].spacingXSmall)
|
|
191
|
+
}));
|
|
191
192
|
|
|
192
193
|
// CONCATENATED MODULE: ./src/RadioBar/RadioBarContext.tsx
|
|
193
194
|
|
|
@@ -234,10 +235,25 @@ function Option(_ref) {
|
|
|
234
235
|
var _useContext = Object(external_react_["useContext"])(RadioBar_RadioBarContext),
|
|
235
236
|
onClickContext = _useContext.onClick,
|
|
236
237
|
appearanceContext = _useContext.appearance,
|
|
237
|
-
errorContext = _useContext.error
|
|
238
|
+
errorContext = _useContext.error,
|
|
239
|
+
onKeyDownContext = _useContext.onKeyDown,
|
|
240
|
+
firstValueContext = _useContext.firstValue,
|
|
241
|
+
selectedValueContext = _useContext.selectedValue;
|
|
238
242
|
|
|
239
243
|
if (false) {}
|
|
240
244
|
|
|
245
|
+
var tabIndex = -1;
|
|
246
|
+
|
|
247
|
+
if (selectedValueContext) {
|
|
248
|
+
if (value === selectedValueContext) {
|
|
249
|
+
tabIndex = 0;
|
|
250
|
+
}
|
|
251
|
+
} else if (value === firstValueContext) {
|
|
252
|
+
tabIndex = 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
var focusedTabIndex = tabIndex;
|
|
256
|
+
|
|
241
257
|
if (appearanceContext === 'prisma') {
|
|
242
258
|
return /*#__PURE__*/external_react_default.a.createElement(StyledClickable, _extends({
|
|
243
259
|
"data-test": "option",
|
|
@@ -252,8 +268,14 @@ function Option(_ref) {
|
|
|
252
268
|
role: "radio",
|
|
253
269
|
"aria-checked": selected,
|
|
254
270
|
$selected: selected,
|
|
255
|
-
tabIndex:
|
|
256
|
-
disabled: disabled
|
|
271
|
+
tabIndex: focusedTabIndex,
|
|
272
|
+
disabled: disabled,
|
|
273
|
+
onKeyDown: function onKeyDown(e) {
|
|
274
|
+
return onKeyDownContext === null || onKeyDownContext === void 0 ? void 0 : onKeyDownContext(e, {
|
|
275
|
+
value: value,
|
|
276
|
+
label: label
|
|
277
|
+
});
|
|
278
|
+
}
|
|
257
279
|
}), icon && /*#__PURE__*/external_react_default.a.createElement(StyledIcon, null, icon), startAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, null, startAdornment), label && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, null, label), endAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, null, endAdornment));
|
|
258
280
|
}
|
|
259
281
|
|
|
@@ -275,12 +297,22 @@ function Option(_ref) {
|
|
|
275
297
|
},
|
|
276
298
|
role: "radio",
|
|
277
299
|
"aria-checked": selected,
|
|
278
|
-
tabIndex:
|
|
300
|
+
tabIndex: focusedTabIndex,
|
|
301
|
+
onKeyDown: function onKeyDown(e) {
|
|
302
|
+
return onKeyDownContext === null || onKeyDownContext === void 0 ? void 0 : onKeyDownContext(e, {
|
|
303
|
+
value: value,
|
|
304
|
+
label: label
|
|
305
|
+
});
|
|
306
|
+
}
|
|
279
307
|
}), startAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, null, startAdornment), label && /*#__PURE__*/external_react_default.a.createElement(StyledLabel, null, label), endAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, null, endAdornment));
|
|
280
308
|
}
|
|
281
309
|
|
|
282
310
|
Option.propTypes = propTypes;
|
|
283
311
|
/* harmony default export */ var RadioBar_Option = (Option);
|
|
312
|
+
// EXTERNAL MODULE: external "@splunk/react-ui/Box"
|
|
313
|
+
var Box_ = __webpack_require__(8);
|
|
314
|
+
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
315
|
+
|
|
284
316
|
// CONCATENATED MODULE: ./src/RadioBar/RadioBarStyles.ts
|
|
285
317
|
|
|
286
318
|
|
|
@@ -288,13 +320,18 @@ Option.propTypes = propTypes;
|
|
|
288
320
|
var StyledRadioBar = external_styled_components_default()(Box_default.a).withConfig({
|
|
289
321
|
displayName: "RadioBarStyles__StyledRadioBar",
|
|
290
322
|
componentId: "gg1b79-0"
|
|
291
|
-
})(["height:", ";
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
323
|
+
})(["height:", ";", " [data-inline] + &{margin-left:", ";}"], themes_["variables"].inputHeight, Object(themes_["pick"])({
|
|
324
|
+
prisma: Object(external_styled_components_["css"])(["padding:2px;border-radius:", ";border:1px solid ", ";background:", ";"], themes_["variables"].borderRadius, function (_ref) {
|
|
325
|
+
var $error = _ref.$error;
|
|
326
|
+
return $error ? themes_["variables"].accentColorNegative : 'transparent';
|
|
327
|
+
}, function (_ref2) {
|
|
328
|
+
var $disabled = _ref2.$disabled;
|
|
329
|
+
return $disabled ? themes_["variables"].interactiveColorBackgroundDisabled : themes_["variables"].interactiveColorBackground;
|
|
330
|
+
})
|
|
331
|
+
}), Object(themes_["pick"])({
|
|
332
|
+
enterprise: themes_["variables"].spacingHalf,
|
|
333
|
+
prisma: themes_["variables"].spacingSmall
|
|
334
|
+
}));
|
|
298
335
|
|
|
299
336
|
// CONCATENATED MODULE: ./src/RadioBar/RadioBar.tsx
|
|
300
337
|
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); }
|
|
@@ -372,6 +409,7 @@ var RadioBar_RadioBar = /*#__PURE__*/function (_Component) {
|
|
|
372
409
|
var _super = _createSuper(RadioBar);
|
|
373
410
|
|
|
374
411
|
// @docs-props-type RadioBarPropsBase
|
|
412
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
375
413
|
function RadioBar(props) {
|
|
376
414
|
var _this;
|
|
377
415
|
|
|
@@ -381,15 +419,66 @@ var RadioBar_RadioBar = /*#__PURE__*/function (_Component) {
|
|
|
381
419
|
|
|
382
420
|
_defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0);
|
|
383
421
|
|
|
422
|
+
_defineProperty(_assertThisInitialized(_this), "filteredValues", []);
|
|
423
|
+
|
|
384
424
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e, data) {
|
|
385
|
-
|
|
425
|
+
_this.handleOnChange(e, data);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
_defineProperty(_assertThisInitialized(_this), "handleOnKeyDown", function (e, _ref) {
|
|
429
|
+
var value = _ref.value,
|
|
430
|
+
label = _ref.label;
|
|
431
|
+
var eventKeyCode = Object(keyboard_["keycode"])(e.nativeEvent);
|
|
432
|
+
var myTarget = e.currentTarget;
|
|
433
|
+
var nextTarget = null;
|
|
434
|
+
var nextIndex = 0;
|
|
435
|
+
|
|
436
|
+
var currentIndex = _this.filteredValues.indexOf(value);
|
|
437
|
+
|
|
438
|
+
if (eventKeyCode === 'down' || eventKeyCode === 'right') {
|
|
439
|
+
var _myTarget$parentEleme;
|
|
440
|
+
|
|
441
|
+
e.preventDefault();
|
|
442
|
+
nextIndex = currentIndex + 1;
|
|
386
443
|
|
|
444
|
+
if (nextIndex > _this.filteredValues.length - 1) {
|
|
445
|
+
nextIndex = 0;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
nextTarget = myTarget.nextSibling ? myTarget.nextSibling : (_myTarget$parentEleme = myTarget.parentElement) === null || _myTarget$parentEleme === void 0 ? void 0 : _myTarget$parentEleme.firstElementChild;
|
|
449
|
+
} else if (eventKeyCode === 'up' || eventKeyCode === 'left') {
|
|
450
|
+
var _myTarget$parentEleme2;
|
|
451
|
+
|
|
452
|
+
e.preventDefault();
|
|
453
|
+
nextIndex = currentIndex - 1;
|
|
454
|
+
|
|
455
|
+
if (nextIndex < 0) {
|
|
456
|
+
nextIndex = _this.filteredValues.length - 1;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
nextTarget = myTarget.previousSibling ? myTarget.previousSibling : (_myTarget$parentEleme2 = myTarget.parentElement) === null || _myTarget$parentEleme2 === void 0 ? void 0 : _myTarget$parentEleme2.lastElementChild;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (nextTarget) {
|
|
463
|
+
var _nextTarget;
|
|
464
|
+
|
|
465
|
+
(_nextTarget = nextTarget) === null || _nextTarget === void 0 ? void 0 : _nextTarget.focus();
|
|
466
|
+
var nextValue = _this.filteredValues[nextIndex];
|
|
467
|
+
|
|
468
|
+
_this.handleOnChange(e, {
|
|
469
|
+
value: nextValue,
|
|
470
|
+
label: label
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
_defineProperty(_assertThisInitialized(_this), "handleOnChange", function (e, data) {
|
|
387
476
|
if (_this.props.value !== data.value) {
|
|
388
477
|
var _this$props$onChange, _this$props;
|
|
389
478
|
|
|
390
|
-
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, _objectSpread(
|
|
391
|
-
name: name
|
|
392
|
-
}));
|
|
479
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, _objectSpread({
|
|
480
|
+
name: _this.props.name
|
|
481
|
+
}, data));
|
|
393
482
|
|
|
394
483
|
if (!_this.isControlled()) {
|
|
395
484
|
_this.setState({
|
|
@@ -427,6 +516,8 @@ var RadioBar_RadioBar = /*#__PURE__*/function (_Component) {
|
|
|
427
516
|
}, {
|
|
428
517
|
key: "render",
|
|
429
518
|
value: function render() {
|
|
519
|
+
var _this2 = this;
|
|
520
|
+
|
|
430
521
|
var _this$props2 = this.props,
|
|
431
522
|
appearance = _this$props2.appearance,
|
|
432
523
|
children = _this$props2.children,
|
|
@@ -442,13 +533,11 @@ var RadioBar_RadioBar = /*#__PURE__*/function (_Component) {
|
|
|
442
533
|
var selectedValue = this.isControlled() ? value : this.state.value;
|
|
443
534
|
var isPrisma = splunkTheme.isPrisma;
|
|
444
535
|
var disabled = true;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
var childrenFormatted = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (item, i, _ref) {
|
|
451
|
-
var length = _ref.length;
|
|
536
|
+
this.filteredValues = [];
|
|
537
|
+
var childrenFormatted = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (item, i, _ref2) {
|
|
538
|
+
var length = _ref2.length;
|
|
539
|
+
|
|
540
|
+
_this2.filteredValues.push(item.props.value);
|
|
452
541
|
|
|
453
542
|
if (item.props && !item.props.disabled) {
|
|
454
543
|
disabled = false;
|
|
@@ -461,16 +550,24 @@ var RadioBar_RadioBar = /*#__PURE__*/function (_Component) {
|
|
|
461
550
|
prepend: i > 0
|
|
462
551
|
});
|
|
463
552
|
});
|
|
464
|
-
var
|
|
465
|
-
|
|
553
|
+
var firstItemValue = this.filteredValues[0];
|
|
554
|
+
var contextValue = {
|
|
555
|
+
appearance: isPrisma ? 'prisma' : appearance,
|
|
556
|
+
onClick: this.handleClick,
|
|
557
|
+
error: isPrisma ? false : error,
|
|
558
|
+
onKeyDown: this.handleOnKeyDown,
|
|
559
|
+
firstValue: firstItemValue,
|
|
560
|
+
selectedValue: selectedValue
|
|
561
|
+
};
|
|
562
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledRadioBar, RadioBar_extends({
|
|
563
|
+
flex: true,
|
|
466
564
|
$disabled: disabled,
|
|
467
565
|
$error: error,
|
|
468
566
|
"data-test": "radio-bar",
|
|
469
567
|
"data-test-value": selectedValue,
|
|
470
568
|
role: "radiogroup",
|
|
471
569
|
"aria-labelledby": labelledBy,
|
|
472
|
-
"aria-describedby": describedBy
|
|
473
|
-
flex: true
|
|
570
|
+
"aria-describedby": describedBy
|
|
474
571
|
}, Object(external_lodash_["omit"])(otherProps, 'onChange')), /*#__PURE__*/external_react_default.a.createElement(RadioBar_RadioBarContext.Provider, {
|
|
475
572
|
value: contextValue
|
|
476
573
|
}, childrenFormatted));
|
|
@@ -498,7 +595,7 @@ RadioBarWithThemeOption.Option = RadioBar_Option;
|
|
|
498
595
|
|
|
499
596
|
/***/ }),
|
|
500
597
|
|
|
501
|
-
/***/
|
|
598
|
+
/***/ 16:
|
|
502
599
|
/***/ (function(module, exports) {
|
|
503
600
|
|
|
504
601
|
module.exports = require("@splunk/react-ui/Button");
|
|
@@ -531,6 +628,13 @@ module.exports = require("lodash");
|
|
|
531
628
|
|
|
532
629
|
module.exports = require("@splunk/react-ui/Box");
|
|
533
630
|
|
|
631
|
+
/***/ }),
|
|
632
|
+
|
|
633
|
+
/***/ 9:
|
|
634
|
+
/***/ (function(module, exports) {
|
|
635
|
+
|
|
636
|
+
module.exports = require("@splunk/ui-utils/keyboard");
|
|
637
|
+
|
|
534
638
|
/***/ })
|
|
535
639
|
|
|
536
640
|
/******/ });
|
package/RadioList.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 = 126);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -108,7 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 126:
|
|
112
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
113
|
|
|
114
114
|
"use strict";
|
package/Resize.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 = 165);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 11:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
|
@@ -142,7 +142,7 @@ module.exports = require("@splunk/react-ui/EventListener");
|
|
|
142
142
|
|
|
143
143
|
/***/ }),
|
|
144
144
|
|
|
145
|
-
/***/
|
|
145
|
+
/***/ 165:
|
|
146
146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
147
147
|
|
|
148
148
|
"use strict";
|
|
@@ -267,7 +267,7 @@ var StyledResize = external_styled_components_default.a.button.withConfig({
|
|
|
267
267
|
}));
|
|
268
268
|
|
|
269
269
|
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
270
|
-
var updateReactRef = __webpack_require__(
|
|
270
|
+
var updateReactRef = __webpack_require__(11);
|
|
271
271
|
|
|
272
272
|
// CONCATENATED MODULE: ./src/Resize/Resize.tsx
|
|
273
273
|
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); }
|
package/ResultsMenu.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 = 166);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,21 +101,14 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("@splunk/ui-utils/userAgent");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 103:
|
|
104
|
+
/***/ 100:
|
|
112
105
|
/***/ (function(module, exports) {
|
|
113
106
|
|
|
114
107
|
module.exports = require("@splunk/react-ui/WaitSpinner");
|
|
115
108
|
|
|
116
109
|
/***/ }),
|
|
117
110
|
|
|
118
|
-
/***/
|
|
111
|
+
/***/ 11:
|
|
119
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
113
|
|
|
121
114
|
"use strict";
|
|
@@ -149,7 +142,7 @@ module.exports = require("@splunk/react-ui/Menu");
|
|
|
149
142
|
|
|
150
143
|
/***/ }),
|
|
151
144
|
|
|
152
|
-
/***/
|
|
145
|
+
/***/ 166:
|
|
153
146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
154
147
|
|
|
155
148
|
"use strict";
|
|
@@ -174,7 +167,7 @@ var external_lodash_ = __webpack_require__(4);
|
|
|
174
167
|
var i18n_ = __webpack_require__(5);
|
|
175
168
|
|
|
176
169
|
// EXTERNAL MODULE: external "@splunk/ui-utils/userAgent"
|
|
177
|
-
var userAgent_ = __webpack_require__(
|
|
170
|
+
var userAgent_ = __webpack_require__(99);
|
|
178
171
|
|
|
179
172
|
// EXTERNAL MODULE: external "@splunk/react-ui/Menu"
|
|
180
173
|
var Menu_ = __webpack_require__(13);
|
|
@@ -185,7 +178,7 @@ var external_styled_components_ = __webpack_require__(3);
|
|
|
185
178
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
186
179
|
|
|
187
180
|
// EXTERNAL MODULE: external "@splunk/react-ui/WaitSpinner"
|
|
188
|
-
var WaitSpinner_ = __webpack_require__(
|
|
181
|
+
var WaitSpinner_ = __webpack_require__(100);
|
|
189
182
|
var WaitSpinner_default = /*#__PURE__*/__webpack_require__.n(WaitSpinner_);
|
|
190
183
|
|
|
191
184
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
@@ -246,7 +239,7 @@ var StyledLoadingMessage = external_styled_components_default.a.div.withConfig({
|
|
|
246
239
|
}));
|
|
247
240
|
|
|
248
241
|
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
249
|
-
var updateReactRef = __webpack_require__(
|
|
242
|
+
var updateReactRef = __webpack_require__(11);
|
|
250
243
|
|
|
251
244
|
// CONCATENATED MODULE: ./src/ResultsMenu/ResultsMenu.tsx
|
|
252
245
|
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); }
|
|
@@ -296,6 +289,7 @@ var propTypes = {
|
|
|
296
289
|
loadingMessage: external_prop_types_default.a.node,
|
|
297
290
|
maxHeight: external_prop_types_default.a.number,
|
|
298
291
|
noOptionsMessage: external_prop_types_default.a.node,
|
|
292
|
+
onScroll: external_prop_types_default.a.func,
|
|
299
293
|
onScrollBottom: external_prop_types_default.a.func,
|
|
300
294
|
placement: external_prop_types_default.a.string
|
|
301
295
|
};
|
|
@@ -350,13 +344,19 @@ var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
|
350
344
|
});
|
|
351
345
|
|
|
352
346
|
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (e) {
|
|
353
|
-
|
|
354
|
-
var bottomScrollMenu = _this.state.menuEl.scrollHeight - _this.state.menuEl.offsetHeight - _this.scrollBottomOffset; // Adding 1 due to border of menu item.
|
|
347
|
+
var _this$props$onScroll, _this$props;
|
|
355
348
|
|
|
356
|
-
|
|
357
|
-
|
|
349
|
+
if (_this.props.onScrollBottom != null) {
|
|
350
|
+
if (e.target && _this.state.menuEl) {
|
|
351
|
+
var bottomScrollMenu = _this.state.menuEl.scrollHeight - _this.state.menuEl.offsetHeight - _this.scrollBottomOffset; // Adding 1 due to border of menu item.
|
|
352
|
+
|
|
353
|
+
if (_this.state.menuEl.scrollTop + 1 >= bottomScrollMenu) {
|
|
354
|
+
_this.handleScrollBottom(e);
|
|
355
|
+
}
|
|
358
356
|
}
|
|
359
357
|
}
|
|
358
|
+
|
|
359
|
+
(_this$props$onScroll = (_this$props = _this.props).onScroll) === null || _this$props$onScroll === void 0 ? void 0 : _this$props$onScroll.call(_this$props, e);
|
|
360
360
|
});
|
|
361
361
|
|
|
362
362
|
_defineProperty(_assertThisInitialized(_this), "handleWheelMenu", function (e) {
|
|
@@ -369,21 +369,27 @@ var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
|
369
369
|
var currentChildrenCount = external_react_["Children"].count(_this.props.children);
|
|
370
370
|
var _this$state = _this.state,
|
|
371
371
|
childrenCount = _this$state.childrenCount,
|
|
372
|
-
menuEl = _this$state.menuEl,
|
|
373
372
|
menuMaxHeight = _this$state.menuMaxHeight; // If menu is full length, load more items.
|
|
374
373
|
|
|
375
|
-
if (
|
|
376
|
-
_this.handleScrollBottom();
|
|
377
|
-
}
|
|
374
|
+
if (_this.checkFullHeight()) {
|
|
375
|
+
_this.handleScrollBottom(null);
|
|
376
|
+
} // avoid triggering this logic if this.state.childrenCount is null
|
|
377
|
+
// because that's not a real change in the number of children
|
|
378
|
+
// and thus we want to avoid resetting the value of scrollBottomTriggered
|
|
378
379
|
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
|
|
381
|
+
if (menuMaxHeight && currentChildrenCount != null && currentChildrenCount !== childrenCount) {
|
|
381
382
|
_this.setState({
|
|
382
383
|
numberOfItemsLoaded: currentChildrenCount - (childrenCount !== null && childrenCount !== void 0 ? childrenCount : 0),
|
|
383
|
-
childrenCount: currentChildrenCount,
|
|
384
384
|
scrollBottomTriggered: false
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
+
|
|
388
|
+
if (currentChildrenCount !== childrenCount) {
|
|
389
|
+
_this.setState({
|
|
390
|
+
childrenCount: currentChildrenCount
|
|
391
|
+
});
|
|
392
|
+
}
|
|
387
393
|
});
|
|
388
394
|
|
|
389
395
|
_this.state = {
|
|
@@ -434,14 +440,20 @@ var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
|
434
440
|
value: function handleScrollBottom(e) {
|
|
435
441
|
// Prevent multiple calls to onScrollBottom.
|
|
436
442
|
if (!this.state.scrollBottomTriggered) {
|
|
437
|
-
var _this$props$onScrollB, _this$
|
|
443
|
+
var _this$props$onScrollB, _this$props2;
|
|
438
444
|
|
|
439
445
|
this.setState({
|
|
440
446
|
scrollBottomTriggered: true
|
|
441
447
|
});
|
|
442
|
-
(_this$props$onScrollB = (_this$
|
|
448
|
+
(_this$props$onScrollB = (_this$props2 = this.props).onScrollBottom) === null || _this$props$onScrollB === void 0 ? void 0 : _this$props$onScrollB.call(_this$props2, e);
|
|
443
449
|
}
|
|
444
450
|
}
|
|
451
|
+
}, {
|
|
452
|
+
key: "checkFullHeight",
|
|
453
|
+
value: function checkFullHeight() {
|
|
454
|
+
var menuEl = this.state.menuEl;
|
|
455
|
+
return menuEl && menuEl.scrollHeight === menuEl.offsetHeight;
|
|
456
|
+
}
|
|
445
457
|
}, {
|
|
446
458
|
key: "renderFooterMessage",
|
|
447
459
|
value: function renderFooterMessage() {
|
|
@@ -454,24 +466,25 @@ var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
|
454
466
|
}, {
|
|
455
467
|
key: "render",
|
|
456
468
|
value: function render() {
|
|
457
|
-
var _this$
|
|
458
|
-
animateLoading = _this$
|
|
459
|
-
children = _this$
|
|
460
|
-
controlledExternally = _this$
|
|
461
|
-
childrenStart = _this$
|
|
462
|
-
isLoading = _this$
|
|
463
|
-
loadingMessage = _this$
|
|
464
|
-
noOptionsMessage = _this$
|
|
465
|
-
onScrollBottom = _this$
|
|
466
|
-
placement = _this$
|
|
467
|
-
style = _this$
|
|
468
|
-
tabIndex = _this$
|
|
469
|
+
var _this$props3 = this.props,
|
|
470
|
+
animateLoading = _this$props3.animateLoading,
|
|
471
|
+
children = _this$props3.children,
|
|
472
|
+
controlledExternally = _this$props3.controlledExternally,
|
|
473
|
+
childrenStart = _this$props3.childrenStart,
|
|
474
|
+
isLoading = _this$props3.isLoading,
|
|
475
|
+
loadingMessage = _this$props3.loadingMessage,
|
|
476
|
+
noOptionsMessage = _this$props3.noOptionsMessage,
|
|
477
|
+
onScrollBottom = _this$props3.onScrollBottom,
|
|
478
|
+
placement = _this$props3.placement,
|
|
479
|
+
style = _this$props3.style,
|
|
480
|
+
tabIndex = _this$props3.tabIndex;
|
|
469
481
|
var otherProps = Object(external_lodash_["omit"])(this.props, Object(external_lodash_["keys"])(ResultsMenu.propTypes));
|
|
470
482
|
// Assumption: that you cannot be filtered if you are a result
|
|
471
483
|
var hasResults = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).some(function (_ref) {
|
|
472
484
|
var type = _ref.type;
|
|
473
485
|
return !(type === Menu_["Divider"] && type.filterFirst || (type === Menu_["Divider"] || type === Menu_["Heading"]) && (type.filterLast || type.filterConsecutive));
|
|
474
486
|
});
|
|
487
|
+
var fullHeight = this.checkFullHeight();
|
|
475
488
|
/* eslint-disable jsx-a11y/aria-role */
|
|
476
489
|
|
|
477
490
|
return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
|
|
@@ -494,16 +507,17 @@ var ResultsMenu_ResultsMenu = /*#__PURE__*/function (_Component) {
|
|
|
494
507
|
},
|
|
495
508
|
controlledExternally: controlledExternally,
|
|
496
509
|
elementRef: this.handleMenuMount,
|
|
497
|
-
onScroll:
|
|
510
|
+
onScroll: this.handleScroll,
|
|
498
511
|
stopScrollPropagation: true,
|
|
499
512
|
tabIndex: tabIndex
|
|
500
513
|
}, !hasResults && noOptionsMessage && !isLoading && /*#__PURE__*/external_react_default.a.createElement(Menu_default.a.Item, {
|
|
501
514
|
"data-test": "no-results-message",
|
|
502
515
|
disabled: true
|
|
503
|
-
}, noOptionsMessage), children, onScrollBottom &&
|
|
516
|
+
}, noOptionsMessage), children, onScrollBottom && !fullHeight &&
|
|
504
517
|
/*#__PURE__*/
|
|
505
518
|
// Bottom spacer fills in the space of new items being loaded by using the minimum possible height x menuItems.
|
|
506
519
|
external_react_default.a.createElement("div", {
|
|
520
|
+
"data-test": "results-menu-bottom-spacer",
|
|
507
521
|
style: {
|
|
508
522
|
height: this.state.scrollBottomTriggered ? this.state.numberOfItemsLoaded * this.itemMinHeight || 0 : 0
|
|
509
523
|
}
|
|
@@ -551,6 +565,13 @@ module.exports = require("lodash");
|
|
|
551
565
|
|
|
552
566
|
module.exports = require("@splunk/ui-utils/i18n");
|
|
553
567
|
|
|
568
|
+
/***/ }),
|
|
569
|
+
|
|
570
|
+
/***/ 99:
|
|
571
|
+
/***/ (function(module, exports) {
|
|
572
|
+
|
|
573
|
+
module.exports = require("@splunk/ui-utils/userAgent");
|
|
574
|
+
|
|
554
575
|
/***/ })
|
|
555
576
|
|
|
556
577
|
/******/ });
|
package/ScreenReaderContent.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 = 167);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 167:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|