@splunk/react-ui 4.1.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +4 -4
- package/Anchor.js +2 -2
- package/Animation.js +26 -35
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +22 -22
- package/ButtonGroup.js +2 -2
- package/ButtonSimple.js +12 -6
- package/CHANGELOG.md +69 -2
- package/Calendar.js +23 -23
- package/Card.js +15 -15
- package/CardLayout.js +2 -2
- package/Chip.js +13 -13
- package/Clickable.js +4 -4
- package/CloseButton.js +8 -8
- package/Code.js +1279 -1120
- package/CollapsiblePanel.js +11 -11
- package/Color.js +111 -172
- package/ColumnLayout.js +6 -6
- package/ComboBox.js +63 -30
- package/Concertina.js +2 -2
- package/ControlGroup.js +61 -20
- package/Date.js +66 -29
- package/DefinitionList.js +2 -2
- package/Dropdown.js +6 -6
- package/FetchOptions.js +8 -8
- package/File.js +87 -72
- package/FormRows.js +219 -331
- package/Heading.js +2 -2
- package/Image.js +15 -15
- package/JSONTree.js +63 -20
- package/Layer.js +8 -8
- package/Link.js +13 -13
- package/List.js +2 -2
- package/Markdown.js +19 -19
- package/Menu.js +315 -230
- package/Message.js +19 -19
- package/Modal.js +22 -11
- package/ModalLayer.js +25 -11
- package/Monogram.js +7 -7
- package/Multiselect.js +1931 -1057
- package/Number.js +40 -27
- package/Paginator.js +67 -49
- package/Paragraph.js +2 -2
- package/Popover.js +62 -35
- package/Progress.js +9 -21
- package/RadioBar.js +6 -6
- package/RadioList.js +2 -2
- package/ResultsMenu.js +18 -10
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +37 -19
- package/ScrollContainerContext.js +2 -2
- package/Select.js +1309 -562
- package/SidePanel.js +22 -17
- package/Slider.js +8 -8
- package/SlidingPanels.js +63 -47
- package/StaticContent.js +2 -2
- package/StepBar.js +8 -8
- package/Switch.js +20 -11
- package/TabBar.js +54 -40
- package/TabLayout.js +4 -4
- package/Table.js +148 -85
- package/Text.js +474 -356
- package/Tooltip.js +6 -6
- package/TransitionOpen.js +26 -24
- package/WaitSpinner.js +4 -4
- package/package.json +8 -7
- package/stubs-splunkui.d.ts +1 -0
- package/types/src/Accordion/Accordion.d.ts +2 -2
- package/types/src/Animation/Animation.d.ts +6 -5
- package/types/src/Button/Button.d.ts +2 -2
- package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
- package/types/src/Calendar/DateTable.d.ts +1 -0
- package/types/src/Calendar/MonthHeader.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -2
- package/types/src/Color/Color.d.ts +5 -4
- package/types/src/Color/Swatch.d.ts +4 -15
- package/types/src/ComboBox/ComboBox.d.ts +2 -2
- package/types/src/ControlGroup/ControlGroup.d.ts +7 -2
- package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
- package/types/src/Date/Date.d.ts +7 -5
- package/types/src/Date/Icon.d.ts +1 -0
- package/types/src/Dropdown/Dropdown.d.ts +1 -1
- package/types/src/File/File.d.ts +2 -2
- package/types/src/File/FileContext.d.ts +9 -0
- package/types/src/File/Icon.d.ts +1 -0
- package/types/src/File/IconCloud.d.ts +1 -0
- package/types/src/File/Item.d.ts +5 -10
- package/types/src/File/PaperClip.d.ts +1 -0
- package/types/src/File/Retry.d.ts +1 -0
- package/types/src/File/Trash.d.ts +1 -0
- package/types/src/FormRows/FormRows.d.ts +11 -69
- package/types/src/FormRows/FormRowsContext.d.ts +9 -0
- package/types/src/FormRows/Row.d.ts +7 -20
- package/types/src/JSONTree/JSONTree.d.ts +14 -2
- package/types/src/JSONTree/TreeNode.d.ts +4 -1
- package/types/src/Menu/Divider.d.ts +1 -0
- package/types/src/Menu/Heading.d.ts +3 -1
- package/types/src/Menu/Item.d.ts +22 -6
- package/types/src/Menu/Menu.d.ts +17 -18
- package/types/src/Menu/MenuContext.d.ts +6 -0
- package/types/src/Menu/index.d.ts +1 -0
- package/types/src/Multiselect/Compact.d.ts +7 -26
- package/types/src/Multiselect/Multiselect.d.ts +7 -2
- package/types/src/Multiselect/Normal.d.ts +8 -2
- package/types/src/Multiselect/Option.d.ts +4 -1
- package/types/src/Number/IncrementIcon.d.ts +1 -0
- package/types/src/Number/Number.d.ts +4 -4
- package/types/src/Paginator/PageSeparator.d.ts +3 -0
- package/types/src/Popover/Popover.d.ts +5 -5
- package/types/src/Popover/PopoverContext.d.ts +6 -0
- package/types/src/Popover/index.d.ts +1 -0
- package/types/src/RadioBar/RadioBar.d.ts +5 -5
- package/types/src/RadioList/RadioListContext.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +4 -0
- package/types/src/Scroll/Inner.d.ts +4 -3
- package/types/src/Scroll/Scroll.d.ts +1 -1
- package/types/src/Select/Option.d.ts +2 -5
- package/types/src/Select/OptionBase.d.ts +94 -0
- package/types/src/Select/Select.d.ts +12 -37
- package/types/src/Select/SelectBase.d.ts +221 -0
- package/types/src/SidePanel/SidePanel.d.ts +4 -0
- package/types/src/Slider/Slider.d.ts +4 -4
- package/types/src/SlidingPanels/SlidingPanels.d.ts +0 -1
- package/types/src/Switch/CheckIcon.d.ts +1 -0
- package/types/src/Switch/Switch.d.ts +3 -7
- package/types/src/TabBar/Tab.d.ts +4 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -2
- package/types/src/Table/DragHandle.d.ts +1 -0
- package/types/src/Table/Head.d.ts +2 -0
- package/types/src/Table/HeadCell.d.ts +2 -2
- package/types/src/Table/HeadDropdownCell.d.ts +1 -1
- package/types/src/Table/HeadExpandRowsIcon.d.ts +1 -0
- package/types/src/Table/HeadInner.d.ts +3 -3
- package/types/src/Table/Table.d.ts +7 -3
- package/types/src/Table/Toggle.d.ts +1 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -0
- package/types/src/Text/IconOutlinedView.d.ts +1 -0
- package/types/src/Text/Text.d.ts +28 -12
- package/types/src/Tooltip/InfoIcon.d.ts +1 -0
- package/types/src/Tooltip/Tooltip.d.ts +3 -3
- package/types/src/icons/Alert.d.ts +1 -0
- package/types/src/icons/AlertFilled.d.ts +1 -0
- package/types/src/icons/CaretDown.d.ts +1 -0
- package/types/src/icons/CaretRight.d.ts +1 -0
- package/types/src/icons/Check.d.ts +1 -0
- package/types/src/icons/ChevronDown.d.ts +1 -0
- package/types/src/icons/ChevronLeft.d.ts +1 -0
- package/types/src/icons/ChevronRight.d.ts +1 -0
- package/types/src/icons/CrossMark.d.ts +1 -0
- package/types/src/icons/External.d.ts +1 -0
- package/types/src/icons/InfoFilled.d.ts +1 -0
- package/types/src/icons/More.d.ts +1 -0
- package/types/src/icons/MoreVertical.d.ts +1 -0
- package/types/src/icons/Plus.d.ts +1 -0
- package/types/src/icons/SVG.d.ts +1 -0
- package/types/src/icons/Search.d.ts +1 -0
- package/types/src/icons/SortedDown.d.ts +1 -0
- package/types/src/icons/SortedUp.d.ts +1 -0
- package/types/src/icons/Success.d.ts +1 -0
- package/types/src/icons/SuccessFilled.d.ts +1 -0
- package/types/src/icons/WarningFilled.d.ts +1 -0
- package/types/src/utils/types.d.ts +1 -0
package/ColumnLayout.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 = 113);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,7 +101,7 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 113:
|
|
105
105
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
106
|
|
|
107
107
|
"use strict";
|
|
@@ -122,7 +122,7 @@ var external_prop_types_ = __webpack_require__(1);
|
|
|
122
122
|
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
123
123
|
|
|
124
124
|
// EXTERNAL MODULE: external "@splunk/themes/useSplunkTheme"
|
|
125
|
-
var useSplunkTheme_ = __webpack_require__(
|
|
125
|
+
var useSplunkTheme_ = __webpack_require__(38);
|
|
126
126
|
var useSplunkTheme_default = /*#__PURE__*/__webpack_require__.n(useSplunkTheme_);
|
|
127
127
|
|
|
128
128
|
// EXTERNAL MODULE: external "lodash"
|
|
@@ -144,7 +144,7 @@ var Styled = external_styled_components_default.a.div.withConfig({
|
|
|
144
144
|
})(["", ";"], themes_["mixins"].reset('block'));
|
|
145
145
|
|
|
146
146
|
// EXTERNAL MODULE: ./src/utils/types.ts
|
|
147
|
-
var types = __webpack_require__(
|
|
147
|
+
var types = __webpack_require__(48);
|
|
148
148
|
|
|
149
149
|
// CONCATENATED MODULE: ./src/ColumnLayout/Column.tsx
|
|
150
150
|
function _extends() { _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 _extends.apply(this, arguments); }
|
|
@@ -428,7 +428,7 @@ module.exports = require("styled-components");
|
|
|
428
428
|
|
|
429
429
|
/***/ }),
|
|
430
430
|
|
|
431
|
-
/***/
|
|
431
|
+
/***/ 38:
|
|
432
432
|
/***/ (function(module, exports) {
|
|
433
433
|
|
|
434
434
|
module.exports = require("@splunk/themes/useSplunkTheme");
|
|
@@ -442,7 +442,7 @@ module.exports = require("lodash");
|
|
|
442
442
|
|
|
443
443
|
/***/ }),
|
|
444
444
|
|
|
445
|
-
/***/
|
|
445
|
+
/***/ 48:
|
|
446
446
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
447
447
|
|
|
448
448
|
"use strict";
|
package/ComboBox.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 = 151);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -135,7 +135,7 @@ module.exports = require("@splunk/react-ui/Menu");
|
|
|
135
135
|
|
|
136
136
|
/***/ }),
|
|
137
137
|
|
|
138
|
-
/***/
|
|
138
|
+
/***/ 151:
|
|
139
139
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
140
140
|
|
|
141
141
|
"use strict";
|
|
@@ -160,7 +160,7 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
|
|
|
160
160
|
var external_lodash_ = __webpack_require__(4);
|
|
161
161
|
|
|
162
162
|
// EXTERNAL MODULE: external "@splunk/ui-utils/filter"
|
|
163
|
-
var filter_ = __webpack_require__(
|
|
163
|
+
var filter_ = __webpack_require__(23);
|
|
164
164
|
|
|
165
165
|
// EXTERNAL MODULE: external "@splunk/ui-utils/id"
|
|
166
166
|
var id_ = __webpack_require__(10);
|
|
@@ -175,15 +175,15 @@ var keyboard_ = __webpack_require__(9);
|
|
|
175
175
|
var Menu_ = __webpack_require__(13);
|
|
176
176
|
|
|
177
177
|
// EXTERNAL MODULE: external "@splunk/react-ui/Popover"
|
|
178
|
-
var Popover_ = __webpack_require__(
|
|
178
|
+
var Popover_ = __webpack_require__(17);
|
|
179
179
|
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
|
|
180
180
|
|
|
181
181
|
// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
182
|
-
var ResultsMenu_ = __webpack_require__(
|
|
182
|
+
var ResultsMenu_ = __webpack_require__(39);
|
|
183
183
|
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
|
|
184
184
|
|
|
185
185
|
// EXTERNAL MODULE: external "@splunk/react-ui/Text"
|
|
186
|
-
var Text_ = __webpack_require__(
|
|
186
|
+
var Text_ = __webpack_require__(26);
|
|
187
187
|
var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
|
|
188
188
|
|
|
189
189
|
// CONCATENATED MODULE: ./src/ComboBox/Option.tsx
|
|
@@ -333,6 +333,10 @@ function ComboBox_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol ===
|
|
|
333
333
|
|
|
334
334
|
function ComboBox_extends() { ComboBox_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 ComboBox_extends.apply(this, arguments); }
|
|
335
335
|
|
|
336
|
+
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; }
|
|
337
|
+
|
|
338
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { ComboBox_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
339
|
+
|
|
336
340
|
function ComboBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
337
341
|
|
|
338
342
|
function ComboBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -445,8 +449,6 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
445
449
|
|
|
446
450
|
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "activeItemId", void 0);
|
|
447
451
|
|
|
448
|
-
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "activeDisplayValue", void 0);
|
|
449
|
-
|
|
450
452
|
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "activeValue", void 0);
|
|
451
453
|
|
|
452
454
|
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "availableOptionCount", 0);
|
|
@@ -495,17 +497,21 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
495
497
|
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleChange", function (e, _ref2) {
|
|
496
498
|
var _this$props$onChange, _this$props2;
|
|
497
499
|
|
|
498
|
-
var value = _ref2.value
|
|
500
|
+
var value = _ref2.value,
|
|
501
|
+
selectedOption = _ref2.selectedOption;
|
|
499
502
|
var name = _this.props.name;
|
|
503
|
+
var typedValue = selectedOption ? undefined : value;
|
|
500
504
|
|
|
501
|
-
if (
|
|
505
|
+
if (_this.isControlled()) {
|
|
502
506
|
_this.setState({
|
|
503
|
-
|
|
504
|
-
|
|
507
|
+
activeIndex: 0,
|
|
508
|
+
typedValue: typedValue
|
|
505
509
|
});
|
|
506
510
|
} else {
|
|
507
511
|
_this.setState({
|
|
508
|
-
|
|
512
|
+
value: value,
|
|
513
|
+
activeIndex: 0,
|
|
514
|
+
typedValue: typedValue
|
|
509
515
|
});
|
|
510
516
|
}
|
|
511
517
|
|
|
@@ -516,7 +522,9 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
516
522
|
});
|
|
517
523
|
|
|
518
524
|
ComboBox_defineProperty(ComboBox_assertThisInitialized(_this), "handleSelectOption", function (e, data) {
|
|
519
|
-
_this.handleChange(e, data)
|
|
525
|
+
_this.handleChange(e, _objectSpread(_objectSpread({}, data), {}, {
|
|
526
|
+
selectedOption: true
|
|
527
|
+
}));
|
|
520
528
|
|
|
521
529
|
_this.focusCalledInternally = true;
|
|
522
530
|
|
|
@@ -622,26 +630,41 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
622
630
|
isLoadingOptions = _this$props5.isLoadingOptions,
|
|
623
631
|
menuStyle = _this$props5.menuStyle,
|
|
624
632
|
onScrollBottom = _this$props5.onScrollBottom;
|
|
625
|
-
var
|
|
633
|
+
var _this$state = _this.state,
|
|
634
|
+
activeIndex = _this$state.activeIndex,
|
|
635
|
+
typedValue = _this$state.typedValue;
|
|
626
636
|
|
|
627
637
|
var value = _this.getValue();
|
|
628
638
|
|
|
629
639
|
var initialOptions = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]);
|
|
630
640
|
var hasExactMatch = Object(external_lodash_["some"])(initialOptions, function (option) {
|
|
631
|
-
|
|
641
|
+
if (option.type === Menu_["Heading"]) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if (option.props.label === undefined) {
|
|
646
|
+
return option.props.value === value;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
if (option.props.label !== undefined && typedValue !== undefined) {
|
|
650
|
+
return option.props.label === value;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return option.props.value === value;
|
|
632
654
|
});
|
|
633
655
|
|
|
634
656
|
if (!hasExactMatch && value) {
|
|
635
657
|
initialOptions.unshift( /*#__PURE__*/external_react_default.a.createElement(ComboBox_Option, {
|
|
636
|
-
key: "
|
|
637
|
-
value: value
|
|
658
|
+
key: "currentValueOption",
|
|
659
|
+
value: value,
|
|
660
|
+
"data-test-current-value-option": value
|
|
638
661
|
}));
|
|
639
662
|
} // Highlight Active
|
|
640
663
|
|
|
641
664
|
|
|
642
665
|
_this.availableOptionCount = 0;
|
|
643
666
|
_this.activeValue = undefined;
|
|
644
|
-
var keywords = Object(filter_["stringToKeywords"])(value);
|
|
667
|
+
var keywords = Object(filter_["stringToKeywords"])(typedValue ? value : _this.getDisplayValue());
|
|
645
668
|
_this.options = (controlledFilter ? initialOptions : initialOptions.filter(function (option) {
|
|
646
669
|
if (option.props.label !== undefined) {
|
|
647
670
|
return Object(filter_["testPhrase"])(option.props.label, keywords);
|
|
@@ -662,7 +685,8 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
662
685
|
_this.availableOptionCount += 1;
|
|
663
686
|
var matchRangePhrase = option.props.label !== undefined ? option.props.label : option.props.value;
|
|
664
687
|
var matchRangesProp = option.props.matchRanges;
|
|
665
|
-
var matchRanges = !controlledFilter && value && (hasExactMatch || index > 0) ? Object(filter_["keywordLocations"])(matchRangePhrase, keywords)
|
|
688
|
+
var matchRanges = !controlledFilter && value && (hasExactMatch || index > 0) ? Object(filter_["keywordLocations"])(matchRangePhrase, keywords) || undefined // keywordLocations can return false, matchRanges must be an array or undefined
|
|
689
|
+
: undefined;
|
|
666
690
|
|
|
667
691
|
if (active) {
|
|
668
692
|
_this.activeValue = option.props.value;
|
|
@@ -685,6 +709,7 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
685
709
|
overflow: 'auto',
|
|
686
710
|
width: Math.max(anchorWidth !== null && anchorWidth !== void 0 ? anchorWidth : 0, 200)
|
|
687
711
|
}, menuStyle),
|
|
712
|
+
controlledExternally: true,
|
|
688
713
|
maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : undefined,
|
|
689
714
|
onScrollBottom: onScrollBottom ? _this.handleScrollBottom : undefined,
|
|
690
715
|
isLoading: isLoadingOptions
|
|
@@ -694,6 +719,7 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
694
719
|
_this.state = {
|
|
695
720
|
activeIndex: 0,
|
|
696
721
|
anchor: null,
|
|
722
|
+
typedValue: undefined,
|
|
697
723
|
open: false,
|
|
698
724
|
value: props.defaultValue || ''
|
|
699
725
|
};
|
|
@@ -722,11 +748,17 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
722
748
|
key: "getDisplayValue",
|
|
723
749
|
value: function getDisplayValue() {
|
|
724
750
|
var value = this.getValue();
|
|
751
|
+
var typedValue = this.state.typedValue;
|
|
725
752
|
var initialOptions = external_react_["Children"].toArray(this.props.children).filter(external_react_["isValidElement"]);
|
|
726
|
-
var optionForValue = initialOptions.find(function (option) {
|
|
727
|
-
return option.props.label === value;
|
|
753
|
+
var optionForValue = !typedValue && initialOptions.find(function (option) {
|
|
754
|
+
return option.props.label !== undefined && option.props.value === value;
|
|
728
755
|
});
|
|
729
|
-
|
|
756
|
+
|
|
757
|
+
if (optionForValue) {
|
|
758
|
+
return optionForValue === null || optionForValue === void 0 ? void 0 : optionForValue.props.label;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return value;
|
|
730
762
|
}
|
|
731
763
|
}, {
|
|
732
764
|
key: "open",
|
|
@@ -775,9 +807,9 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
775
807
|
key: "render",
|
|
776
808
|
value: function render() {
|
|
777
809
|
var defaultPlacement = this.props.defaultPlacement;
|
|
778
|
-
var _this$
|
|
779
|
-
anchor = _this$
|
|
780
|
-
open = _this$
|
|
810
|
+
var _this$state2 = this.state,
|
|
811
|
+
anchor = _this$state2.anchor,
|
|
812
|
+
open = _this$state2.open;
|
|
781
813
|
var currentValue = this.getValue();
|
|
782
814
|
var currentDisplayValue = this.getDisplayValue();
|
|
783
815
|
return /*#__PURE__*/external_react_default.a.createElement(Text_default.a, ComboBox_extends({
|
|
@@ -789,6 +821,7 @@ var ComboBox_ComboBox = /*#__PURE__*/function (_Component) {
|
|
|
789
821
|
"data-test": "combo-box"
|
|
790
822
|
}, Object(external_lodash_["omit"])(this.props, 'animateLoading', 'className', 'controlledFilter', 'defaultValue', 'footerMessage', 'isLoadingOptions', 'loadingMessage', 'menuStyle', 'noOptionsMessage', 'onClose', 'onOpen', 'onScrollBottom', 'spellCheck'), {
|
|
791
823
|
"data-test-popover-id": this.popoverId,
|
|
824
|
+
"data-test-label": currentDisplayValue,
|
|
792
825
|
"data-test-value": currentValue,
|
|
793
826
|
"data-test-open": open && !!anchor,
|
|
794
827
|
onFocus: this.handleInputFocus,
|
|
@@ -837,7 +870,7 @@ ComboBox_defineProperty(ComboBox_ComboBox, "Heading", Menu_["Heading"]);
|
|
|
837
870
|
|
|
838
871
|
/***/ }),
|
|
839
872
|
|
|
840
|
-
/***/
|
|
873
|
+
/***/ 17:
|
|
841
874
|
/***/ (function(module, exports) {
|
|
842
875
|
|
|
843
876
|
module.exports = require("@splunk/react-ui/Popover");
|
|
@@ -851,21 +884,21 @@ module.exports = require("react");
|
|
|
851
884
|
|
|
852
885
|
/***/ }),
|
|
853
886
|
|
|
854
|
-
/***/
|
|
887
|
+
/***/ 23:
|
|
855
888
|
/***/ (function(module, exports) {
|
|
856
889
|
|
|
857
890
|
module.exports = require("@splunk/ui-utils/filter");
|
|
858
891
|
|
|
859
892
|
/***/ }),
|
|
860
893
|
|
|
861
|
-
/***/
|
|
894
|
+
/***/ 26:
|
|
862
895
|
/***/ (function(module, exports) {
|
|
863
896
|
|
|
864
897
|
module.exports = require("@splunk/react-ui/Text");
|
|
865
898
|
|
|
866
899
|
/***/ }),
|
|
867
900
|
|
|
868
|
-
/***/
|
|
901
|
+
/***/ 39:
|
|
869
902
|
/***/ (function(module, exports) {
|
|
870
903
|
|
|
871
904
|
module.exports = require("@splunk/react-ui/ResultsMenu");
|
package/Concertina.js
CHANGED
|
@@ -311,7 +311,7 @@ var Box_ = __webpack_require__(8);
|
|
|
311
311
|
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
312
312
|
|
|
313
313
|
// EXTERNAL MODULE: external "@splunk/react-ui/Scroll"
|
|
314
|
-
var Scroll_ = __webpack_require__(
|
|
314
|
+
var Scroll_ = __webpack_require__(58);
|
|
315
315
|
var Scroll_default = /*#__PURE__*/__webpack_require__.n(Scroll_);
|
|
316
316
|
|
|
317
317
|
// CONCATENATED MODULE: ./src/Concertina/ConcertinaStyles.ts
|
|
@@ -892,7 +892,7 @@ module.exports = require("lodash");
|
|
|
892
892
|
|
|
893
893
|
/***/ }),
|
|
894
894
|
|
|
895
|
-
/***/
|
|
895
|
+
/***/ 58:
|
|
896
896
|
/***/ (function(module, exports) {
|
|
897
897
|
|
|
898
898
|
module.exports = require("@splunk/react-ui/Scroll");
|
package/ControlGroup.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 = 135);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -108,14 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 146:
|
|
111
|
+
/***/ 135:
|
|
119
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
113
|
|
|
121
114
|
"use strict";
|
|
@@ -124,6 +117,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
124
117
|
|
|
125
118
|
// EXPORTS
|
|
126
119
|
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_ControlGroup_ControlGroup; });
|
|
120
|
+
__webpack_require__.d(__webpack_exports__, "ControlGroupContext", function() { return /* reexport */ ControlGroup_ControlGroupContext; });
|
|
127
121
|
|
|
128
122
|
// EXTERNAL MODULE: external "react"
|
|
129
123
|
var external_react_ = __webpack_require__(2);
|
|
@@ -151,7 +145,7 @@ var ScreenReaderContent_ = __webpack_require__(14);
|
|
|
151
145
|
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
152
146
|
|
|
153
147
|
// EXTERNAL MODULE: external "@splunk/react-ui/Tooltip"
|
|
154
|
-
var Tooltip_ = __webpack_require__(
|
|
148
|
+
var Tooltip_ = __webpack_require__(45);
|
|
155
149
|
var Tooltip_default = /*#__PURE__*/__webpack_require__.n(Tooltip_);
|
|
156
150
|
|
|
157
151
|
// EXTERNAL MODULE: external "styled-components"
|
|
@@ -173,8 +167,8 @@ var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
|
173
167
|
}
|
|
174
168
|
}), Object(themes_["pick"])({
|
|
175
169
|
prisma: {
|
|
176
|
-
comfortable: Object(external_styled_components_["css"])(["&:first-child{margin-top:
|
|
177
|
-
compact: Object(external_styled_components_["css"])(["&:first-child{margin-top:
|
|
170
|
+
comfortable: Object(external_styled_components_["css"])(["&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}"], themes_["variables"].spacingMedium, themes_["variables"].spacingMedium),
|
|
171
|
+
compact: Object(external_styled_components_["css"])(["&:first-child{margin-top:", ";}&:last-child{margin-bottom:", ";}"], themes_["variables"].spacingSmall, themes_["variables"].spacingSmall)
|
|
178
172
|
}
|
|
179
173
|
}), Object(themes_["pick"])({
|
|
180
174
|
enterprise: themes_["variables"].textColor,
|
|
@@ -194,7 +188,8 @@ var StyledLabelWrapper = external_styled_components_default.a.div.withConfig({
|
|
|
194
188
|
displayName: "ControlGroupStyles__StyledLabelWrapper",
|
|
195
189
|
componentId: "wjnyif-2"
|
|
196
190
|
})(["display:inline-flex;align-items:center;", ""], Object(themes_["pick"])({
|
|
197
|
-
enterprise: Object(external_styled_components_["css"])(["justify-content:flex-end;"])
|
|
191
|
+
enterprise: Object(external_styled_components_["css"])(["justify-content:flex-end;"]),
|
|
192
|
+
prisma: Object(external_styled_components_["css"])(["min-height:", ";"], themes_["variables"].inputHeight)
|
|
198
193
|
}));
|
|
199
194
|
var StyledLabelWrapperLeft = external_styled_components_default()(StyledLabelWrapper).withConfig({
|
|
200
195
|
displayName: "ControlGroupStyles__StyledLabelWrapperLeft",
|
|
@@ -207,10 +202,6 @@ var StyledLabel = external_styled_components_default.a.label.withConfig({
|
|
|
207
202
|
enterprise: {
|
|
208
203
|
comfortable: '6px 0',
|
|
209
204
|
compact: '4px 0'
|
|
210
|
-
},
|
|
211
|
-
prisma: {
|
|
212
|
-
comfortable: '10px 0',
|
|
213
|
-
compact: '6px 0'
|
|
214
205
|
}
|
|
215
206
|
}), Object(themes_["pick"])({
|
|
216
207
|
enterprise: 'right',
|
|
@@ -224,6 +215,17 @@ var StyledHelp = external_styled_components_default.a.div.withConfig({
|
|
|
224
215
|
prisma: '4px'
|
|
225
216
|
}));
|
|
226
217
|
|
|
218
|
+
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroupContext.tsx
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* A React context used to inform subcomponets of ControlGroup of parent component values.
|
|
223
|
+
* The context interface is `ControlGroupContextValue`.
|
|
224
|
+
* Defaults to `'{}'`.
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
var ControlGroupContext = /*#__PURE__*/external_react_default.a.createContext({});
|
|
228
|
+
/* harmony default export */ var ControlGroup_ControlGroupContext = (ControlGroupContext);
|
|
227
229
|
// CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
|
|
228
230
|
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); }
|
|
229
231
|
|
|
@@ -276,6 +278,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
276
278
|
|
|
277
279
|
|
|
278
280
|
|
|
281
|
+
// props ControlGroup may access and/or override on children
|
|
282
|
+
|
|
279
283
|
var propTypes = {
|
|
280
284
|
children: external_prop_types_default.a.node,
|
|
281
285
|
controlsLayout: external_prop_types_default.a.oneOf(['fill', 'fillJoin', 'none', 'stack']),
|
|
@@ -288,6 +292,9 @@ var propTypes = {
|
|
|
288
292
|
labelPosition: external_prop_types_default.a.oneOf(['left', 'top']),
|
|
289
293
|
labelWidth: external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.string]),
|
|
290
294
|
size: external_prop_types_default.a.oneOf(['small', 'medium']),
|
|
295
|
+
|
|
296
|
+
/** @private */
|
|
297
|
+
splunkTheme: external_prop_types_default.a.object,
|
|
291
298
|
tooltip: external_prop_types_default.a.node
|
|
292
299
|
};
|
|
293
300
|
var defaultProps = {
|
|
@@ -334,6 +341,8 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
334
341
|
|
|
335
342
|
_defineProperty(_assertThisInitialized(_this), "labelId", void 0);
|
|
336
343
|
|
|
344
|
+
_defineProperty(_assertThisInitialized(_this), "contextValue", void 0);
|
|
345
|
+
|
|
337
346
|
_defineProperty(_assertThisInitialized(_this), "hasInputId", function (item) {
|
|
338
347
|
return item.type && item.type.propTypes && Object.prototype.hasOwnProperty.call(item.type.propTypes, 'inputId');
|
|
339
348
|
});
|
|
@@ -370,10 +379,32 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
370
379
|
|
|
371
380
|
_this.labelId = Object(id_["createDOMID"])('label');
|
|
372
381
|
_this.helpId = Object(id_["createDOMID"])('help');
|
|
382
|
+
_this.contextValue = _this.createContextValue();
|
|
373
383
|
return _this;
|
|
374
384
|
}
|
|
375
385
|
|
|
376
386
|
_createClass(ControlGroup, [{
|
|
387
|
+
key: "createContextValue",
|
|
388
|
+
value: function createContextValue() {
|
|
389
|
+
return {
|
|
390
|
+
labelAttrs: {
|
|
391
|
+
text: this.props.label,
|
|
392
|
+
id: this.labelId
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
}, {
|
|
397
|
+
key: "getContextValue",
|
|
398
|
+
value: function getContextValue() {
|
|
399
|
+
var _this$contextValue$la, _this$contextValue$la2;
|
|
400
|
+
|
|
401
|
+
if (this.props.label !== ((_this$contextValue$la = this.contextValue.labelAttrs) === null || _this$contextValue$la === void 0 ? void 0 : _this$contextValue$la.text) || this.labelId !== ((_this$contextValue$la2 = this.contextValue.labelAttrs) === null || _this$contextValue$la2 === void 0 ? void 0 : _this$contextValue$la2.id)) {
|
|
402
|
+
this.contextValue = this.createContextValue();
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return this.contextValue;
|
|
406
|
+
}
|
|
407
|
+
}, {
|
|
377
408
|
key: "render",
|
|
378
409
|
value: function render() {
|
|
379
410
|
var _this2 = this;
|
|
@@ -514,7 +545,9 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
514
545
|
return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
|
|
515
546
|
"data-test": "control-group",
|
|
516
547
|
$error: error
|
|
517
|
-
}, writableOtherProps),
|
|
548
|
+
}, writableOtherProps), /*#__PURE__*/external_react_default.a.createElement(ControlGroup_ControlGroupContext.Provider, {
|
|
549
|
+
value: this.getContextValue()
|
|
550
|
+
}, hideLabel ? /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, styledLabel) : styledLabel, /*#__PURE__*/external_react_default.a.createElement(StyledControlsComponent, {
|
|
518
551
|
"data-test": "controls",
|
|
519
552
|
flex: controlsLayout !== 'none',
|
|
520
553
|
style: contentMarginStyle
|
|
@@ -522,7 +555,7 @@ var ControlGroup_ControlGroup = /*#__PURE__*/function (_Component) {
|
|
|
522
555
|
"data-test": "help",
|
|
523
556
|
id: this.helpId,
|
|
524
557
|
style: contentMarginStyle
|
|
525
|
-
}, help));
|
|
558
|
+
}, help)));
|
|
526
559
|
}
|
|
527
560
|
}]);
|
|
528
561
|
|
|
@@ -536,10 +569,18 @@ _defineProperty(ControlGroup_ControlGroup, "defaultProps", defaultProps);
|
|
|
536
569
|
var ControlGroupWithTheme = Object(themes_["withSplunkTheme"])(ControlGroup_ControlGroup);
|
|
537
570
|
ControlGroupWithTheme.propTypes = ControlGroup_ControlGroup.propTypes;
|
|
538
571
|
/* harmony default export */ var src_ControlGroup_ControlGroup = (ControlGroupWithTheme);
|
|
572
|
+
|
|
539
573
|
// CONCATENATED MODULE: ./src/ControlGroup/index.ts
|
|
540
574
|
|
|
541
575
|
|
|
542
576
|
|
|
577
|
+
/***/ }),
|
|
578
|
+
|
|
579
|
+
/***/ 14:
|
|
580
|
+
/***/ (function(module, exports) {
|
|
581
|
+
|
|
582
|
+
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
583
|
+
|
|
543
584
|
/***/ }),
|
|
544
585
|
|
|
545
586
|
/***/ 2:
|
|
@@ -563,7 +604,7 @@ module.exports = require("lodash");
|
|
|
563
604
|
|
|
564
605
|
/***/ }),
|
|
565
606
|
|
|
566
|
-
/***/
|
|
607
|
+
/***/ 45:
|
|
567
608
|
/***/ (function(module, exports) {
|
|
568
609
|
|
|
569
610
|
module.exports = require("@splunk/react-ui/Tooltip");
|