@splunk/react-ui 4.15.0 → 4.16.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/Menu.js CHANGED
@@ -262,7 +262,7 @@ var Heading_ = __webpack_require__(77);
262
262
  var Heading_default = /*#__PURE__*/__webpack_require__.n(Heading_);
263
263
 
264
264
  // EXTERNAL MODULE: external "@splunk/themes/useSplunkTheme"
265
- var useSplunkTheme_ = __webpack_require__(52);
265
+ var useSplunkTheme_ = __webpack_require__(54);
266
266
  var useSplunkTheme_default = /*#__PURE__*/__webpack_require__.n(useSplunkTheme_);
267
267
 
268
268
  // CONCATENATED MODULE: ./src/Menu/HeadingStyles.ts
@@ -932,7 +932,7 @@ MenuStyles_Styled,
932
932
  MenuStyles_Styled, adjacentSiblingStyles);
933
933
 
934
934
  // EXTERNAL MODULE: ./src/utils/navigateList.ts
935
- var navigateList = __webpack_require__(55);
935
+ var navigateList = __webpack_require__(57);
936
936
 
937
937
  // CONCATENATED MODULE: ./src/Menu/Menu.tsx
938
938
  function Menu_extends() { Menu_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 Menu_extends.apply(this, arguments); }
@@ -1240,14 +1240,14 @@ module.exports = require("lodash/omit");
1240
1240
 
1241
1241
  /***/ }),
1242
1242
 
1243
- /***/ 52:
1243
+ /***/ 54:
1244
1244
  /***/ (function(module, exports) {
1245
1245
 
1246
1246
  module.exports = require("@splunk/themes/useSplunkTheme");
1247
1247
 
1248
1248
  /***/ }),
1249
1249
 
1250
- /***/ 55:
1250
+ /***/ 57:
1251
1251
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1252
1252
 
1253
1253
  "use strict";
package/Modal.js CHANGED
@@ -151,7 +151,7 @@ var external_prop_types_ = __webpack_require__(1);
151
151
  var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
152
152
 
153
153
  // EXTERNAL MODULE: external "lodash/defer"
154
- var defer_ = __webpack_require__(53);
154
+ var defer_ = __webpack_require__(55);
155
155
  var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
156
156
 
157
157
  // EXTERNAL MODULE: external "lodash/keys"
@@ -173,7 +173,7 @@ var focus_ = __webpack_require__(35);
173
173
  var id_ = __webpack_require__(13);
174
174
 
175
175
  // EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
176
- var ScrollContainerContext_ = __webpack_require__(49);
176
+ var ScrollContainerContext_ = __webpack_require__(50);
177
177
 
178
178
  // EXTERNAL MODULE: external "styled-components"
179
179
  var external_styled_components_ = __webpack_require__(3);
@@ -767,21 +767,21 @@ module.exports = require("@splunk/ui-utils/focus");
767
767
 
768
768
  /***/ }),
769
769
 
770
- /***/ 49:
770
+ /***/ 5:
771
771
  /***/ (function(module, exports) {
772
772
 
773
- module.exports = require("@splunk/react-ui/ScrollContainerContext");
773
+ module.exports = require("lodash/omit");
774
774
 
775
775
  /***/ }),
776
776
 
777
- /***/ 5:
777
+ /***/ 50:
778
778
  /***/ (function(module, exports) {
779
779
 
780
- module.exports = require("lodash/omit");
780
+ module.exports = require("@splunk/react-ui/ScrollContainerContext");
781
781
 
782
782
  /***/ }),
783
783
 
784
- /***/ 53:
784
+ /***/ 55:
785
785
  /***/ (function(module, exports) {
786
786
 
787
787
  module.exports = require("lodash/defer");
package/Multiselect.js CHANGED
@@ -718,7 +718,7 @@ _defineProperty(Option, "defaultProps", defaultProps);
718
718
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Search; });
719
719
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
720
720
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
721
- /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54);
721
+ /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
722
722
  /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__);
723
723
  /* harmony import */ var _ThemedIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
724
724
  /* harmony import */ var _SVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
@@ -775,29 +775,36 @@ module.exports = require("@splunk/react-ui/Link");
775
775
  /***/ }),
776
776
  /* 43 */,
777
777
  /* 44 */,
778
- /* 45 */
778
+ /* 45 */,
779
+ /* 46 */
779
780
  /***/ (function(module, exports) {
780
781
 
781
782
  module.exports = require("@splunk/react-ui/ResultsMenu");
782
783
 
783
784
  /***/ }),
784
- /* 46 */,
785
785
  /* 47 */,
786
- /* 48 */
786
+ /* 48 */,
787
+ /* 49 */
787
788
  /***/ (function(module, exports) {
788
789
 
789
790
  module.exports = require("lodash/extend");
790
791
 
791
792
  /***/ }),
792
- /* 49 */,
793
- /* 50 */
793
+ /* 50 */,
794
+ /* 51 */
795
+ /***/ (function(module, exports) {
796
+
797
+ module.exports = require("lodash/find");
798
+
799
+ /***/ }),
800
+ /* 52 */
794
801
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
795
802
 
796
803
  "use strict";
797
804
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CaretDown; });
798
805
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
799
806
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
800
- /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
807
+ /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53);
801
808
  /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__);
802
809
  /* harmony import */ var _ThemedIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
803
810
  /* harmony import */ var _SVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
@@ -827,39 +834,32 @@ function CaretDown(props) {
827
834
  }
828
835
 
829
836
  /***/ }),
830
- /* 51 */
837
+ /* 53 */
831
838
  /***/ (function(module, exports) {
832
839
 
833
840
  module.exports = require("@splunk/react-icons/Caret");
834
841
 
835
842
  /***/ }),
836
- /* 52 */,
837
- /* 53 */
843
+ /* 54 */,
844
+ /* 55 */
838
845
  /***/ (function(module, exports) {
839
846
 
840
847
  module.exports = require("lodash/defer");
841
848
 
842
849
  /***/ }),
843
- /* 54 */
850
+ /* 56 */
844
851
  /***/ (function(module, exports) {
845
852
 
846
853
  module.exports = require("@splunk/react-icons/Search");
847
854
 
848
855
  /***/ }),
849
- /* 55 */,
850
- /* 56 */
856
+ /* 57 */,
857
+ /* 58 */
851
858
  /***/ (function(module, exports) {
852
859
 
853
860
  module.exports = require("lodash/without");
854
861
 
855
862
  /***/ }),
856
- /* 57 */
857
- /***/ (function(module, exports) {
858
-
859
- module.exports = require("lodash/find");
860
-
861
- /***/ }),
862
- /* 58 */,
863
863
  /* 59 */
864
864
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
865
865
 
@@ -885,7 +885,7 @@ var castArray_ = __webpack_require__(62);
885
885
  var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_);
886
886
 
887
887
  // EXTERNAL MODULE: external "lodash/find"
888
- var find_ = __webpack_require__(57);
888
+ var find_ = __webpack_require__(51);
889
889
  var find_default = /*#__PURE__*/__webpack_require__.n(find_);
890
890
 
891
891
  // EXTERNAL MODULE: external "lodash/forEachRight"
@@ -921,7 +921,7 @@ var uniq_ = __webpack_require__(105);
921
921
  var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_);
922
922
 
923
923
  // EXTERNAL MODULE: external "lodash/without"
924
- var without_ = __webpack_require__(56);
924
+ var without_ = __webpack_require__(58);
925
925
  var without_default = /*#__PURE__*/__webpack_require__.n(without_);
926
926
 
927
927
  // EXTERNAL MODULE: external "@splunk/ui-utils/filter"
@@ -948,7 +948,7 @@ var Link_default = /*#__PURE__*/__webpack_require__.n(Link_);
948
948
  var Menu_ = __webpack_require__(15);
949
949
 
950
950
  // EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
951
- var ResultsMenu_ = __webpack_require__(45);
951
+ var ResultsMenu_ = __webpack_require__(46);
952
952
  var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
953
953
 
954
954
  // EXTERNAL MODULE: external "@splunk/react-ui/Text"
@@ -956,7 +956,7 @@ var Text_ = __webpack_require__(30);
956
956
  var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
957
957
 
958
958
  // EXTERNAL MODULE: ./src/icons/CaretDown.tsx
959
- var CaretDown = __webpack_require__(50);
959
+ var CaretDown = __webpack_require__(52);
960
960
 
961
961
  // EXTERNAL MODULE: ./src/icons/Search.tsx
962
962
  var Search = __webpack_require__(39);
@@ -1595,19 +1595,145 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1595
1595
  }
1596
1596
  });
1597
1597
 
1598
+ _defineProperty(_assertThisInitialized(_this), "createToggle", function () {
1599
+ var _this$getCurrentValue4;
1600
+
1601
+ var _this$props11 = _this.props,
1602
+ toggle = _this$props11.toggle,
1603
+ appearance = _this$props11.appearance,
1604
+ children = _this$props11.children,
1605
+ describedBy = _this$props11.describedBy,
1606
+ disabled = _this$props11.disabled,
1607
+ elementRef = _this$props11.elementRef,
1608
+ error = _this$props11.error,
1609
+ inline = _this$props11.inline,
1610
+ labelledBy = _this$props11.labelledBy,
1611
+ labelText = _this$props11.labelText,
1612
+ multiple = _this$props11.multiple,
1613
+ placeholder = _this$props11.placeholder,
1614
+ prefixLabel = _this$props11.prefixLabel,
1615
+ required = _this$props11.required,
1616
+ suffixLabel = _this$props11.suffixLabel;
1617
+ var icon;
1618
+ var label; // Generate buttonLabels
1619
+
1620
+ var currentValues = (_this$getCurrentValue4 = _this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [];
1621
+ var childrenArray = external_react_["Children"].toArray(children);
1622
+ var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
1623
+ var matchedItem = find_default()(childrenArray, function (item) {
1624
+ return isOption(item) && item.props.value === value;
1625
+ });
1626
+
1627
+ if (matchedItem) {
1628
+ acc.push(matchedItem.props.children || matchedItem.props.label); // if not in multiple mode, add the icon
1629
+
1630
+ if (!multiple && currentValues.length === 1) {
1631
+ icon = matchedItem.props.icon;
1632
+ }
1633
+ } else if (multiple) {
1634
+ // only add values that don't match an option in "multiple" mode to preserve old behaviour
1635
+ acc.push(value);
1636
+ }
1637
+
1638
+ if (index < orig.length - 1) {
1639
+ acc.push(Object(i18n_["_"])(', '));
1640
+ }
1641
+
1642
+ return acc;
1643
+ }, []);
1644
+ label = valuesLabel; // only apply prefix / suffix if the label is not empty
1645
+
1646
+ if (label.length > 0) {
1647
+ label = _this.wrapLabel({
1648
+ prefixLabel: prefixLabel,
1649
+ label: label,
1650
+ suffixLabel: suffixLabel
1651
+ });
1652
+ } // single <Select> behaviour is to show the placeholder if all parts of the the label
1653
+ // are empty strings so we replicate this behaviour here
1654
+
1655
+
1656
+ if (label.length === 0 || !multiple && label.every(function (labelNode) {
1657
+ return labelNode === '';
1658
+ })) {
1659
+ label = [placeholder];
1660
+ }
1661
+
1662
+ var ariaLabel = label; // If there's more than one item selected, read out the selected total
1663
+ // rather than reading out each selected item
1664
+
1665
+ if (label.length > 1) {
1666
+ ariaLabel = _this.wrapLabel({
1667
+ prefixLabel: prefixLabel,
1668
+ label: ["".concat(currentValues.length, " items selected")],
1669
+ suffixLabel: suffixLabel
1670
+ });
1671
+ }
1672
+
1673
+ var commonProps = _objectSpread({
1674
+ 'aria-describedby': describedBy,
1675
+ 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel),
1676
+ 'aria-labelledby': labelText ? undefined : labelledBy,
1677
+ 'aria-multiselectable': multiple,
1678
+ 'aria-required': required,
1679
+ 'data-select-appearance': appearance,
1680
+ 'data-test': multiple ? 'multiselect' : 'select',
1681
+ disabled: disabled,
1682
+ elementRef: elementRef,
1683
+ error: error
1684
+ }, omit_default()(_this.props, keys_default()(SelectBase.propTypes)));
1685
+
1686
+ if (multiple) {
1687
+ commonProps['data-test-values'] = JSON.stringify(currentValues);
1688
+ } else {
1689
+ var _currentValues = _slicedToArray(currentValues, 1),
1690
+ dataTestValue = _currentValues[0];
1691
+
1692
+ commonProps['data-test-value'] = dataTestValue;
1693
+ }
1694
+
1695
+ if (toggle) {
1696
+ return /*#__PURE__*/Object(external_react_["cloneElement"])(toggle, commonProps);
1697
+ }
1698
+
1699
+ if (appearance === 'link') {
1700
+ return /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, {
1701
+ "data-select-appearance": "link"
1702
+ }), !!icon && /*#__PURE__*/external_react_default.a.createElement(StyledLinkIcon, null, icon), label || placeholder, /*#__PURE__*/external_react_default.a.createElement(StyledLinkCaret, null, /*#__PURE__*/external_react_default.a.createElement(CaretDown["a" /* default */], {
1703
+ enterpriseSize: 0.5,
1704
+ prismaSize: "small"
1705
+ })));
1706
+ }
1707
+
1708
+ return /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, {
1709
+ $multiple: multiple,
1710
+ appearance: appearance,
1711
+ label: label,
1712
+ error: error,
1713
+ icon: icon,
1714
+ inline: inline,
1715
+ isMenu: true,
1716
+ role: "listbox" // @ts-expect-error - accept inconsistency with Button
1717
+ ,
1718
+ onClick: _this.props.onClick
1719
+ }, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, {
1720
+ "data-role": "count"
1721
+ }, "(", currentValues.length, ")"));
1722
+ });
1723
+
1598
1724
  _defineProperty(_assertThisInitialized(_this), "createChildren", function () {
1599
1725
  var _this$state = _this.state,
1600
1726
  filterKeyword = _this$state.filterKeyword,
1601
1727
  textHasFocus = _this$state.textHasFocus,
1602
1728
  topValuesState = _this$state.topValues;
1603
- var _this$props11 = _this.props,
1604
- allowKeyMatching = _this$props11.allowKeyMatching,
1605
- allowNewValues = _this$props11.allowNewValues,
1606
- filter = _this$props11.filter,
1607
- multiple = _this$props11.multiple,
1608
- showSelectedValuesFirst = _this$props11.showSelectedValuesFirst,
1609
- isLoadingOptions = _this$props11.isLoadingOptions,
1610
- onScrollBottom = _this$props11.onScrollBottom;
1729
+ var _this$props12 = _this.props,
1730
+ allowKeyMatching = _this$props12.allowKeyMatching,
1731
+ allowNewValues = _this$props12.allowNewValues,
1732
+ filter = _this$props12.filter,
1733
+ multiple = _this$props12.multiple,
1734
+ showSelectedValuesFirst = _this$props12.showSelectedValuesFirst,
1735
+ isLoadingOptions = _this$props12.isLoadingOptions,
1736
+ onScrollBottom = _this$props12.onScrollBottom;
1611
1737
 
1612
1738
  var currentValues = _this.getCurrentValues();
1613
1739
 
@@ -1870,10 +1996,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1870
1996
  }, {
1871
1997
  key: "getTopValues",
1872
1998
  value: function getTopValues() {
1873
- var _this$getCurrentValue4;
1999
+ var _this$getCurrentValue5;
1874
2000
 
1875
2001
  // in non-multiple mode, don't move values to the top of the list
1876
- return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue4 = this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [] : [];
2002
+ return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [] : [];
1877
2003
  }
1878
2004
  }, {
1879
2005
  key: "isControlled",
@@ -1888,13 +2014,13 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1888
2014
  }, {
1889
2015
  key: "toggleValue",
1890
2016
  value: function toggleValue(e, value) {
1891
- var _this$getCurrentValue5, _this$props$onChange3, _this$props13;
2017
+ var _this$getCurrentValue6, _this$props$onChange3, _this$props14;
1892
2018
 
1893
- var values = (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [];
2019
+ var values = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [];
1894
2020
  var currentIndex = values.indexOf(value);
1895
- var _this$props12 = this.props,
1896
- name = _this$props12.name,
1897
- multiple = _this$props12.multiple;
2021
+ var _this$props13 = this.props,
2022
+ name = _this$props13.name,
2023
+ multiple = _this$props13.multiple;
1898
2024
  var newValues;
1899
2025
 
1900
2026
  if (multiple) {
@@ -1932,7 +2058,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1932
2058
  this.focus();
1933
2059
  }
1934
2060
 
1935
- (_this$props$onChange3 = (_this$props13 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props13, e, {
2061
+ (_this$props$onChange3 = (_this$props14 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props14, e, {
1936
2062
  values: newValues,
1937
2063
  name: name
1938
2064
  });
@@ -1954,10 +2080,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1954
2080
  var hasChildren = _ref4.hasChildren,
1955
2081
  placement = _ref4.placement;
1956
2082
  var filterKeyword = this.state.filterKeyword;
1957
- var _this$props14 = this.props,
1958
- inputId = _this$props14.inputId,
1959
- inputRef = _this$props14.inputRef,
1960
- multiple = _this$props14.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
2083
+ var _this$props15 = this.props,
2084
+ inputId = _this$props15.inputId,
2085
+ inputRef = _this$props15.inputRef,
2086
+ multiple = _this$props15.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
1961
2087
 
1962
2088
  var selectControls = /*#__PURE__*/external_react_default.a.createElement(StyledToggleAllControls, {
1963
2089
  $placement: placement,
@@ -2009,133 +2135,26 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2009
2135
  }, {
2010
2136
  key: "render",
2011
2137
  value: function render() {
2012
- var _this$getCurrentValue6,
2138
+ var _this$getCurrentValue7,
2013
2139
  _this2 = this;
2014
2140
 
2015
- var _this$props15 = this.props,
2016
- appearance = _this$props15.appearance,
2017
- children = _this$props15.children,
2018
- defaultPlacement = _this$props15.defaultPlacement,
2019
- describedBy = _this$props15.describedBy,
2020
- disabled = _this$props15.disabled,
2021
- elementRef = _this$props15.elementRef,
2022
- error = _this$props15.error,
2023
- inline = _this$props15.inline,
2024
- inputId = _this$props15.inputId,
2025
- labelledBy = _this$props15.labelledBy,
2026
- labelText = _this$props15.labelText,
2027
- multiple = _this$props15.multiple,
2028
- required = _this$props15.required,
2029
- placeholder = _this$props15.placeholder,
2030
- prefixLabel = _this$props15.prefixLabel,
2031
- repositionMode = _this$props15.repositionMode,
2032
- suffixLabel = _this$props15.suffixLabel;
2033
- var icon;
2034
- var label;
2141
+ var _this$props16 = this.props,
2142
+ children = _this$props16.children,
2143
+ defaultPlacement = _this$props16.defaultPlacement,
2144
+ inputId = _this$props16.inputId,
2145
+ multiple = _this$props16.multiple,
2146
+ repositionMode = _this$props16.repositionMode;
2035
2147
  var filterEnabled = this.hasFilter();
2036
- var isAnyValueSelected = false; // Generate buttonLabels
2037
-
2148
+ var currentValues = (_this$getCurrentValue7 = this.getCurrentValues()) !== null && _this$getCurrentValue7 !== void 0 ? _this$getCurrentValue7 : [];
2038
2149
  var childrenArray = external_react_["Children"].toArray(children);
2039
- var currentValues = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [];
2040
- var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
2150
+ var isAnyValueSelected = currentValues.some(function (value) {
2041
2151
  var matchedItem = find_default()(childrenArray, function (item) {
2042
2152
  return isOption(item) && item.props.value === value;
2043
2153
  });
2044
-
2045
- if (matchedItem) {
2046
- acc.push(matchedItem.props.children || matchedItem.props.label);
2047
-
2048
- if (!matchedItem.props.disabled) {
2049
- isAnyValueSelected = true;
2050
- } // if not in multiple mode, add the icon
2051
-
2052
-
2053
- if (!multiple && currentValues.length === 1) {
2054
- icon = matchedItem.props.icon;
2055
- }
2056
- } else if (multiple) {
2057
- // only add values that don't match an option in "multiple" mode to preserve old behaviour
2058
- acc.push(value);
2059
- }
2060
-
2061
- if (index < orig.length - 1) {
2062
- acc.push(Object(i18n_["_"])(', '));
2063
- }
2064
-
2065
- return acc;
2066
- }, []);
2067
- label = valuesLabel; // only apply prefix / suffix if the label is not empty
2068
-
2069
- if (label.length > 0) {
2070
- label = this.wrapLabel({
2071
- prefixLabel: prefixLabel,
2072
- label: label,
2073
- suffixLabel: suffixLabel
2074
- });
2075
- } // single <Select> behaviour is to show the placeholder if all parts of the the label
2076
- // are empty strings so we replicate this behaviour here
2077
-
2078
-
2079
- if (label.length === 0 || !multiple && label.every(function (labelNode) {
2080
- return labelNode === '';
2081
- })) {
2082
- label = [placeholder];
2083
- }
2084
-
2085
- var ariaLabel = label; // If there's more than one item selected, read out the selected total
2086
- // rather than reading out each selected item
2087
-
2088
- if (label.length > 1) {
2089
- ariaLabel = this.wrapLabel({
2090
- prefixLabel: prefixLabel,
2091
- label: ["".concat(currentValues.length, " items selected")],
2092
- suffixLabel: suffixLabel
2093
- });
2094
- }
2095
-
2154
+ return matchedItem && !matchedItem.props.disabled;
2155
+ });
2096
2156
  var finalChildren = this.createChildren();
2097
-
2098
- var commonProps = _objectSpread({
2099
- 'aria-describedby': describedBy,
2100
- 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel),
2101
- 'aria-labelledby': labelText ? undefined : labelledBy,
2102
- 'aria-multiselectable': multiple,
2103
- 'aria-required': required,
2104
- 'data-select-appearance': appearance,
2105
- 'data-test': multiple ? 'multiselect' : 'select',
2106
- disabled: disabled,
2107
- elementRef: elementRef,
2108
- error: error
2109
- }, omit_default()(this.props, keys_default()(SelectBase.propTypes)));
2110
-
2111
- if (multiple) {
2112
- commonProps['data-test-values'] = JSON.stringify(currentValues);
2113
- } else {
2114
- var _currentValues = _slicedToArray(currentValues, 1),
2115
- dataTestValue = _currentValues[0];
2116
-
2117
- commonProps['data-test-value'] = dataTestValue;
2118
- }
2119
-
2120
- var toggle = appearance === 'link' ? /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, {
2121
- "data-select-appearance": "link"
2122
- }), !!icon && /*#__PURE__*/external_react_default.a.createElement(StyledLinkIcon, null, icon), label || placeholder, /*#__PURE__*/external_react_default.a.createElement(StyledLinkCaret, null, /*#__PURE__*/external_react_default.a.createElement(CaretDown["a" /* default */], {
2123
- enterpriseSize: 0.5,
2124
- prismaSize: "small"
2125
- }))) : /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, {
2126
- $multiple: multiple,
2127
- appearance: appearance,
2128
- label: label,
2129
- error: error,
2130
- icon: icon,
2131
- inline: inline,
2132
- isMenu: true,
2133
- role: "listbox" // @ts-expect-error - accept inconsistency with Button
2134
- ,
2135
- onClick: this.props.onClick
2136
- }, pick_default()(this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, {
2137
- "data-role": "count"
2138
- }, "(", currentValues.length, ")"));
2157
+ var toggle = this.createToggle();
2139
2158
 
2140
2159
  var createMenu = function createMenu(_ref5) {
2141
2160
  var anchorWidth = _ref5.anchorWidth,
@@ -2703,11 +2722,11 @@ Compact_defineProperty(Compact_Compact, "Heading", Menu_["Heading"]);
2703
2722
 
2704
2723
  /* harmony default export */ var Multiselect_Compact = (Compact_Compact);
2705
2724
  // EXTERNAL MODULE: external "lodash/defer"
2706
- var defer_ = __webpack_require__(53);
2725
+ var defer_ = __webpack_require__(55);
2707
2726
  var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
2708
2727
 
2709
2728
  // EXTERNAL MODULE: external "lodash/extend"
2710
- var extend_ = __webpack_require__(48);
2729
+ var extend_ = __webpack_require__(49);
2711
2730
  var extend_default = /*#__PURE__*/__webpack_require__.n(extend_);
2712
2731
 
2713
2732
  // EXTERNAL MODULE: external "lodash/get"
@@ -2739,7 +2758,7 @@ var pickBy_ = __webpack_require__(71);
2739
2758
  var pickBy_default = /*#__PURE__*/__webpack_require__.n(pickBy_);
2740
2759
 
2741
2760
  // EXTERNAL MODULE: external "lodash/without"
2742
- var without_ = __webpack_require__(56);
2761
+ var without_ = __webpack_require__(58);
2743
2762
  var without_default = /*#__PURE__*/__webpack_require__.n(without_);
2744
2763
 
2745
2764
  // EXTERNAL MODULE: external "@splunk/ui-utils/filter"
@@ -2756,7 +2775,7 @@ var Chip_ = __webpack_require__(142);
2756
2775
  var Chip_default = /*#__PURE__*/__webpack_require__.n(Chip_);
2757
2776
 
2758
2777
  // EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
2759
- var ResultsMenu_ = __webpack_require__(45);
2778
+ var ResultsMenu_ = __webpack_require__(46);
2760
2779
  var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
2761
2780
 
2762
2781
  // EXTERNAL MODULE: external "@splunk/react-ui/Popover"
package/Paginator.js CHANGED
@@ -134,7 +134,7 @@ var external_prop_types_ = __webpack_require__(1);
134
134
  var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
135
135
 
136
136
  // EXTERNAL MODULE: external "@splunk/ui-utils/format"
137
- var format_ = __webpack_require__(58);
137
+ var format_ = __webpack_require__(45);
138
138
 
139
139
  // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
140
140
  var i18n_ = __webpack_require__(4);
@@ -620,17 +620,17 @@ module.exports = require("@splunk/react-icons/ChevronRight");
620
620
 
621
621
  /***/ }),
622
622
 
623
- /***/ 5:
623
+ /***/ 45:
624
624
  /***/ (function(module, exports) {
625
625
 
626
- module.exports = require("lodash/omit");
626
+ module.exports = require("@splunk/ui-utils/format");
627
627
 
628
628
  /***/ }),
629
629
 
630
- /***/ 58:
630
+ /***/ 5:
631
631
  /***/ (function(module, exports) {
632
632
 
633
- module.exports = require("@splunk/ui-utils/format");
633
+ module.exports = require("lodash/omit");
634
634
 
635
635
  /***/ }),
636
636
 
package/Popover.js CHANGED
@@ -204,7 +204,7 @@ var clamp_ = __webpack_require__(144);
204
204
  var clamp_default = /*#__PURE__*/__webpack_require__.n(clamp_);
205
205
 
206
206
  // EXTERNAL MODULE: external "lodash/defer"
207
- var defer_ = __webpack_require__(53);
207
+ var defer_ = __webpack_require__(55);
208
208
  var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
209
209
 
210
210
  // EXTERNAL MODULE: external "lodash/every"
@@ -258,7 +258,7 @@ var Layer_ = __webpack_require__(82);
258
258
  var Layer_default = /*#__PURE__*/__webpack_require__.n(Layer_);
259
259
 
260
260
  // EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
261
- var ScrollContainerContext_ = __webpack_require__(49);
261
+ var ScrollContainerContext_ = __webpack_require__(50);
262
262
  var ScrollContainerContext_default = /*#__PURE__*/__webpack_require__.n(ScrollContainerContext_);
263
263
 
264
264
  // EXTERNAL MODULE: external "@splunk/ui-utils/focus"
@@ -1469,21 +1469,21 @@ module.exports = require("@splunk/react-ui/Animation");
1469
1469
 
1470
1470
  /***/ }),
1471
1471
 
1472
- /***/ 49:
1472
+ /***/ 5:
1473
1473
  /***/ (function(module, exports) {
1474
1474
 
1475
- module.exports = require("@splunk/react-ui/ScrollContainerContext");
1475
+ module.exports = require("lodash/omit");
1476
1476
 
1477
1477
  /***/ }),
1478
1478
 
1479
- /***/ 5:
1479
+ /***/ 50:
1480
1480
  /***/ (function(module, exports) {
1481
1481
 
1482
- module.exports = require("lodash/omit");
1482
+ module.exports = require("@splunk/react-ui/ScrollContainerContext");
1483
1483
 
1484
1484
  /***/ }),
1485
1485
 
1486
- /***/ 53:
1486
+ /***/ 55:
1487
1487
  /***/ (function(module, exports) {
1488
1488
 
1489
1489
  module.exports = require("lodash/defer");