@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/Progress.js CHANGED
@@ -131,7 +131,7 @@ var isNumber_ = __webpack_require__(74);
131
131
  var isNumber_default = /*#__PURE__*/__webpack_require__.n(isNumber_);
132
132
 
133
133
  // EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle"
134
- var AnimationToggle_ = __webpack_require__(47);
134
+ var AnimationToggle_ = __webpack_require__(48);
135
135
 
136
136
  // EXTERNAL MODULE: external "styled-components"
137
137
  var external_styled_components_ = __webpack_require__(3);
@@ -327,7 +327,7 @@ module.exports = require("styled-components");
327
327
 
328
328
  /***/ }),
329
329
 
330
- /***/ 47:
330
+ /***/ 48:
331
331
  /***/ (function(module, exports) {
332
332
 
333
333
  module.exports = require("@splunk/react-ui/AnimationToggle");
package/Scroll.js CHANGED
@@ -190,7 +190,7 @@ var EventListener_ = __webpack_require__(17);
190
190
  var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
191
191
 
192
192
  // EXTERNAL MODULE: external "@splunk/react-ui/ScrollContainerContext"
193
- var ScrollContainerContext_ = __webpack_require__(49);
193
+ var ScrollContainerContext_ = __webpack_require__(50);
194
194
 
195
195
  // EXTERNAL MODULE: ./src/utils/updateReactRef.ts
196
196
  var updateReactRef = __webpack_require__(12);
@@ -600,17 +600,17 @@ module.exports = require("@splunk/react-ui/Animation");
600
600
 
601
601
  /***/ }),
602
602
 
603
- /***/ 49:
603
+ /***/ 5:
604
604
  /***/ (function(module, exports) {
605
605
 
606
- module.exports = require("@splunk/react-ui/ScrollContainerContext");
606
+ module.exports = require("lodash/omit");
607
607
 
608
608
  /***/ }),
609
609
 
610
- /***/ 5:
610
+ /***/ 50:
611
611
  /***/ (function(module, exports) {
612
612
 
613
- module.exports = require("lodash/omit");
613
+ module.exports = require("@splunk/react-ui/ScrollContainerContext");
614
614
 
615
615
  /***/ })
616
616
 
package/Search.js CHANGED
@@ -178,7 +178,7 @@ var external_prop_types_ = __webpack_require__(1);
178
178
  var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
179
179
 
180
180
  // EXTERNAL MODULE: external "lodash/extend"
181
- var extend_ = __webpack_require__(48);
181
+ var extend_ = __webpack_require__(49);
182
182
  var extend_default = /*#__PURE__*/__webpack_require__.n(extend_);
183
183
 
184
184
  // EXTERNAL MODULE: external "lodash/has"
@@ -214,7 +214,7 @@ var Popover_ = __webpack_require__(23);
214
214
  var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
215
215
 
216
216
  // EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
217
- var ResultsMenu_ = __webpack_require__(45);
217
+ var ResultsMenu_ = __webpack_require__(46);
218
218
  var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
219
219
 
220
220
  // EXTERNAL MODULE: external "@splunk/react-ui/Text"
@@ -804,14 +804,14 @@ module.exports = require("@splunk/ui-utils/i18n");
804
804
 
805
805
  /***/ }),
806
806
 
807
- /***/ 45:
807
+ /***/ 46:
808
808
  /***/ (function(module, exports) {
809
809
 
810
810
  module.exports = require("@splunk/react-ui/ResultsMenu");
811
811
 
812
812
  /***/ }),
813
813
 
814
- /***/ 48:
814
+ /***/ 49:
815
815
  /***/ (function(module, exports) {
816
816
 
817
817
  module.exports = require("lodash/extend");
package/Select.js CHANGED
@@ -875,7 +875,7 @@ _defineProperty(Option, "defaultProps", defaultProps);
875
875
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Search; });
876
876
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
877
877
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
878
- /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(54);
878
+ /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
879
879
  /* harmony import */ var _splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_Search__WEBPACK_IMPORTED_MODULE_1__);
880
880
  /* harmony import */ var _ThemedIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
881
881
  /* harmony import */ var _SVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
@@ -939,7 +939,7 @@ module.exports = require("@splunk/react-ui/Link");
939
939
 
940
940
  /***/ }),
941
941
 
942
- /***/ 45:
942
+ /***/ 46:
943
943
  /***/ (function(module, exports) {
944
944
 
945
945
  module.exports = require("@splunk/react-ui/ResultsMenu");
@@ -953,14 +953,21 @@ module.exports = require("lodash/omit");
953
953
 
954
954
  /***/ }),
955
955
 
956
- /***/ 50:
956
+ /***/ 51:
957
+ /***/ (function(module, exports) {
958
+
959
+ module.exports = require("lodash/find");
960
+
961
+ /***/ }),
962
+
963
+ /***/ 52:
957
964
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
958
965
 
959
966
  "use strict";
960
967
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CaretDown; });
961
968
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
962
969
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
963
- /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51);
970
+ /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53);
964
971
  /* harmony import */ var _splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_Caret__WEBPACK_IMPORTED_MODULE_1__);
965
972
  /* harmony import */ var _ThemedIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
966
973
  /* harmony import */ var _SVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
@@ -991,34 +998,27 @@ function CaretDown(props) {
991
998
 
992
999
  /***/ }),
993
1000
 
994
- /***/ 51:
1001
+ /***/ 53:
995
1002
  /***/ (function(module, exports) {
996
1003
 
997
1004
  module.exports = require("@splunk/react-icons/Caret");
998
1005
 
999
1006
  /***/ }),
1000
1007
 
1001
- /***/ 54:
1008
+ /***/ 56:
1002
1009
  /***/ (function(module, exports) {
1003
1010
 
1004
1011
  module.exports = require("@splunk/react-icons/Search");
1005
1012
 
1006
1013
  /***/ }),
1007
1014
 
1008
- /***/ 56:
1015
+ /***/ 58:
1009
1016
  /***/ (function(module, exports) {
1010
1017
 
1011
1018
  module.exports = require("lodash/without");
1012
1019
 
1013
1020
  /***/ }),
1014
1021
 
1015
- /***/ 57:
1016
- /***/ (function(module, exports) {
1017
-
1018
- module.exports = require("lodash/find");
1019
-
1020
- /***/ }),
1021
-
1022
1022
  /***/ 59:
1023
1023
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1024
1024
 
@@ -1044,7 +1044,7 @@ var castArray_ = __webpack_require__(62);
1044
1044
  var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_);
1045
1045
 
1046
1046
  // EXTERNAL MODULE: external "lodash/find"
1047
- var find_ = __webpack_require__(57);
1047
+ var find_ = __webpack_require__(51);
1048
1048
  var find_default = /*#__PURE__*/__webpack_require__.n(find_);
1049
1049
 
1050
1050
  // EXTERNAL MODULE: external "lodash/forEachRight"
@@ -1080,7 +1080,7 @@ var uniq_ = __webpack_require__(105);
1080
1080
  var uniq_default = /*#__PURE__*/__webpack_require__.n(uniq_);
1081
1081
 
1082
1082
  // EXTERNAL MODULE: external "lodash/without"
1083
- var without_ = __webpack_require__(56);
1083
+ var without_ = __webpack_require__(58);
1084
1084
  var without_default = /*#__PURE__*/__webpack_require__.n(without_);
1085
1085
 
1086
1086
  // EXTERNAL MODULE: external "@splunk/ui-utils/filter"
@@ -1107,7 +1107,7 @@ var Link_default = /*#__PURE__*/__webpack_require__.n(Link_);
1107
1107
  var Menu_ = __webpack_require__(15);
1108
1108
 
1109
1109
  // EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
1110
- var ResultsMenu_ = __webpack_require__(45);
1110
+ var ResultsMenu_ = __webpack_require__(46);
1111
1111
  var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
1112
1112
 
1113
1113
  // EXTERNAL MODULE: external "@splunk/react-ui/Text"
@@ -1115,7 +1115,7 @@ var Text_ = __webpack_require__(30);
1115
1115
  var Text_default = /*#__PURE__*/__webpack_require__.n(Text_);
1116
1116
 
1117
1117
  // EXTERNAL MODULE: ./src/icons/CaretDown.tsx
1118
- var CaretDown = __webpack_require__(50);
1118
+ var CaretDown = __webpack_require__(52);
1119
1119
 
1120
1120
  // EXTERNAL MODULE: ./src/icons/Search.tsx
1121
1121
  var Search = __webpack_require__(39);
@@ -1754,19 +1754,145 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
1754
1754
  }
1755
1755
  });
1756
1756
 
1757
+ _defineProperty(_assertThisInitialized(_this), "createToggle", function () {
1758
+ var _this$getCurrentValue4;
1759
+
1760
+ var _this$props11 = _this.props,
1761
+ toggle = _this$props11.toggle,
1762
+ appearance = _this$props11.appearance,
1763
+ children = _this$props11.children,
1764
+ describedBy = _this$props11.describedBy,
1765
+ disabled = _this$props11.disabled,
1766
+ elementRef = _this$props11.elementRef,
1767
+ error = _this$props11.error,
1768
+ inline = _this$props11.inline,
1769
+ labelledBy = _this$props11.labelledBy,
1770
+ labelText = _this$props11.labelText,
1771
+ multiple = _this$props11.multiple,
1772
+ placeholder = _this$props11.placeholder,
1773
+ prefixLabel = _this$props11.prefixLabel,
1774
+ required = _this$props11.required,
1775
+ suffixLabel = _this$props11.suffixLabel;
1776
+ var icon;
1777
+ var label; // Generate buttonLabels
1778
+
1779
+ var currentValues = (_this$getCurrentValue4 = _this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [];
1780
+ var childrenArray = external_react_["Children"].toArray(children);
1781
+ var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
1782
+ var matchedItem = find_default()(childrenArray, function (item) {
1783
+ return isOption(item) && item.props.value === value;
1784
+ });
1785
+
1786
+ if (matchedItem) {
1787
+ acc.push(matchedItem.props.children || matchedItem.props.label); // if not in multiple mode, add the icon
1788
+
1789
+ if (!multiple && currentValues.length === 1) {
1790
+ icon = matchedItem.props.icon;
1791
+ }
1792
+ } else if (multiple) {
1793
+ // only add values that don't match an option in "multiple" mode to preserve old behaviour
1794
+ acc.push(value);
1795
+ }
1796
+
1797
+ if (index < orig.length - 1) {
1798
+ acc.push(Object(i18n_["_"])(', '));
1799
+ }
1800
+
1801
+ return acc;
1802
+ }, []);
1803
+ label = valuesLabel; // only apply prefix / suffix if the label is not empty
1804
+
1805
+ if (label.length > 0) {
1806
+ label = _this.wrapLabel({
1807
+ prefixLabel: prefixLabel,
1808
+ label: label,
1809
+ suffixLabel: suffixLabel
1810
+ });
1811
+ } // single <Select> behaviour is to show the placeholder if all parts of the the label
1812
+ // are empty strings so we replicate this behaviour here
1813
+
1814
+
1815
+ if (label.length === 0 || !multiple && label.every(function (labelNode) {
1816
+ return labelNode === '';
1817
+ })) {
1818
+ label = [placeholder];
1819
+ }
1820
+
1821
+ var ariaLabel = label; // If there's more than one item selected, read out the selected total
1822
+ // rather than reading out each selected item
1823
+
1824
+ if (label.length > 1) {
1825
+ ariaLabel = _this.wrapLabel({
1826
+ prefixLabel: prefixLabel,
1827
+ label: ["".concat(currentValues.length, " items selected")],
1828
+ suffixLabel: suffixLabel
1829
+ });
1830
+ }
1831
+
1832
+ var commonProps = _objectSpread({
1833
+ 'aria-describedby': describedBy,
1834
+ 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel),
1835
+ 'aria-labelledby': labelText ? undefined : labelledBy,
1836
+ 'aria-multiselectable': multiple,
1837
+ 'aria-required': required,
1838
+ 'data-select-appearance': appearance,
1839
+ 'data-test': multiple ? 'multiselect' : 'select',
1840
+ disabled: disabled,
1841
+ elementRef: elementRef,
1842
+ error: error
1843
+ }, omit_default()(_this.props, keys_default()(SelectBase.propTypes)));
1844
+
1845
+ if (multiple) {
1846
+ commonProps['data-test-values'] = JSON.stringify(currentValues);
1847
+ } else {
1848
+ var _currentValues = _slicedToArray(currentValues, 1),
1849
+ dataTestValue = _currentValues[0];
1850
+
1851
+ commonProps['data-test-value'] = dataTestValue;
1852
+ }
1853
+
1854
+ if (toggle) {
1855
+ return /*#__PURE__*/Object(external_react_["cloneElement"])(toggle, commonProps);
1856
+ }
1857
+
1858
+ if (appearance === 'link') {
1859
+ return /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, {
1860
+ "data-select-appearance": "link"
1861
+ }), !!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 */], {
1862
+ enterpriseSize: 0.5,
1863
+ prismaSize: "small"
1864
+ })));
1865
+ }
1866
+
1867
+ return /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, {
1868
+ $multiple: multiple,
1869
+ appearance: appearance,
1870
+ label: label,
1871
+ error: error,
1872
+ icon: icon,
1873
+ inline: inline,
1874
+ isMenu: true,
1875
+ role: "listbox" // @ts-expect-error - accept inconsistency with Button
1876
+ ,
1877
+ onClick: _this.props.onClick
1878
+ }, pick_default()(_this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, {
1879
+ "data-role": "count"
1880
+ }, "(", currentValues.length, ")"));
1881
+ });
1882
+
1757
1883
  _defineProperty(_assertThisInitialized(_this), "createChildren", function () {
1758
1884
  var _this$state = _this.state,
1759
1885
  filterKeyword = _this$state.filterKeyword,
1760
1886
  textHasFocus = _this$state.textHasFocus,
1761
1887
  topValuesState = _this$state.topValues;
1762
- var _this$props11 = _this.props,
1763
- allowKeyMatching = _this$props11.allowKeyMatching,
1764
- allowNewValues = _this$props11.allowNewValues,
1765
- filter = _this$props11.filter,
1766
- multiple = _this$props11.multiple,
1767
- showSelectedValuesFirst = _this$props11.showSelectedValuesFirst,
1768
- isLoadingOptions = _this$props11.isLoadingOptions,
1769
- onScrollBottom = _this$props11.onScrollBottom;
1888
+ var _this$props12 = _this.props,
1889
+ allowKeyMatching = _this$props12.allowKeyMatching,
1890
+ allowNewValues = _this$props12.allowNewValues,
1891
+ filter = _this$props12.filter,
1892
+ multiple = _this$props12.multiple,
1893
+ showSelectedValuesFirst = _this$props12.showSelectedValuesFirst,
1894
+ isLoadingOptions = _this$props12.isLoadingOptions,
1895
+ onScrollBottom = _this$props12.onScrollBottom;
1770
1896
 
1771
1897
  var currentValues = _this.getCurrentValues();
1772
1898
 
@@ -2029,10 +2155,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2029
2155
  }, {
2030
2156
  key: "getTopValues",
2031
2157
  value: function getTopValues() {
2032
- var _this$getCurrentValue4;
2158
+ var _this$getCurrentValue5;
2033
2159
 
2034
2160
  // in non-multiple mode, don't move values to the top of the list
2035
- return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue4 = this.getCurrentValues()) !== null && _this$getCurrentValue4 !== void 0 ? _this$getCurrentValue4 : [] : [];
2161
+ return this.props.multiple && this.props.showSelectedValuesFirst !== 'never' ? (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [] : [];
2036
2162
  }
2037
2163
  }, {
2038
2164
  key: "isControlled",
@@ -2047,13 +2173,13 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2047
2173
  }, {
2048
2174
  key: "toggleValue",
2049
2175
  value: function toggleValue(e, value) {
2050
- var _this$getCurrentValue5, _this$props$onChange3, _this$props13;
2176
+ var _this$getCurrentValue6, _this$props$onChange3, _this$props14;
2051
2177
 
2052
- var values = (_this$getCurrentValue5 = this.getCurrentValues()) !== null && _this$getCurrentValue5 !== void 0 ? _this$getCurrentValue5 : [];
2178
+ var values = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [];
2053
2179
  var currentIndex = values.indexOf(value);
2054
- var _this$props12 = this.props,
2055
- name = _this$props12.name,
2056
- multiple = _this$props12.multiple;
2180
+ var _this$props13 = this.props,
2181
+ name = _this$props13.name,
2182
+ multiple = _this$props13.multiple;
2057
2183
  var newValues;
2058
2184
 
2059
2185
  if (multiple) {
@@ -2091,7 +2217,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2091
2217
  this.focus();
2092
2218
  }
2093
2219
 
2094
- (_this$props$onChange3 = (_this$props13 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props13, e, {
2220
+ (_this$props$onChange3 = (_this$props14 = this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props14, e, {
2095
2221
  values: newValues,
2096
2222
  name: name
2097
2223
  });
@@ -2113,10 +2239,10 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2113
2239
  var hasChildren = _ref4.hasChildren,
2114
2240
  placement = _ref4.placement;
2115
2241
  var filterKeyword = this.state.filterKeyword;
2116
- var _this$props14 = this.props,
2117
- inputId = _this$props14.inputId,
2118
- inputRef = _this$props14.inputRef,
2119
- multiple = _this$props14.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
2242
+ var _this$props15 = this.props,
2243
+ inputId = _this$props15.inputId,
2244
+ inputRef = _this$props15.inputRef,
2245
+ multiple = _this$props15.multiple; // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
2120
2246
 
2121
2247
  var selectControls = /*#__PURE__*/external_react_default.a.createElement(StyledToggleAllControls, {
2122
2248
  $placement: placement,
@@ -2168,133 +2294,26 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
2168
2294
  }, {
2169
2295
  key: "render",
2170
2296
  value: function render() {
2171
- var _this$getCurrentValue6,
2297
+ var _this$getCurrentValue7,
2172
2298
  _this2 = this;
2173
2299
 
2174
- var _this$props15 = this.props,
2175
- appearance = _this$props15.appearance,
2176
- children = _this$props15.children,
2177
- defaultPlacement = _this$props15.defaultPlacement,
2178
- describedBy = _this$props15.describedBy,
2179
- disabled = _this$props15.disabled,
2180
- elementRef = _this$props15.elementRef,
2181
- error = _this$props15.error,
2182
- inline = _this$props15.inline,
2183
- inputId = _this$props15.inputId,
2184
- labelledBy = _this$props15.labelledBy,
2185
- labelText = _this$props15.labelText,
2186
- multiple = _this$props15.multiple,
2187
- required = _this$props15.required,
2188
- placeholder = _this$props15.placeholder,
2189
- prefixLabel = _this$props15.prefixLabel,
2190
- repositionMode = _this$props15.repositionMode,
2191
- suffixLabel = _this$props15.suffixLabel;
2192
- var icon;
2193
- var label;
2300
+ var _this$props16 = this.props,
2301
+ children = _this$props16.children,
2302
+ defaultPlacement = _this$props16.defaultPlacement,
2303
+ inputId = _this$props16.inputId,
2304
+ multiple = _this$props16.multiple,
2305
+ repositionMode = _this$props16.repositionMode;
2194
2306
  var filterEnabled = this.hasFilter();
2195
- var isAnyValueSelected = false; // Generate buttonLabels
2196
-
2307
+ var currentValues = (_this$getCurrentValue7 = this.getCurrentValues()) !== null && _this$getCurrentValue7 !== void 0 ? _this$getCurrentValue7 : [];
2197
2308
  var childrenArray = external_react_["Children"].toArray(children);
2198
- var currentValues = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [];
2199
- var valuesLabel = currentValues.reduce(function (acc, value, index, orig) {
2309
+ var isAnyValueSelected = currentValues.some(function (value) {
2200
2310
  var matchedItem = find_default()(childrenArray, function (item) {
2201
2311
  return isOption(item) && item.props.value === value;
2202
2312
  });
2203
-
2204
- if (matchedItem) {
2205
- acc.push(matchedItem.props.children || matchedItem.props.label);
2206
-
2207
- if (!matchedItem.props.disabled) {
2208
- isAnyValueSelected = true;
2209
- } // if not in multiple mode, add the icon
2210
-
2211
-
2212
- if (!multiple && currentValues.length === 1) {
2213
- icon = matchedItem.props.icon;
2214
- }
2215
- } else if (multiple) {
2216
- // only add values that don't match an option in "multiple" mode to preserve old behaviour
2217
- acc.push(value);
2218
- }
2219
-
2220
- if (index < orig.length - 1) {
2221
- acc.push(Object(i18n_["_"])(', '));
2222
- }
2223
-
2224
- return acc;
2225
- }, []);
2226
- label = valuesLabel; // only apply prefix / suffix if the label is not empty
2227
-
2228
- if (label.length > 0) {
2229
- label = this.wrapLabel({
2230
- prefixLabel: prefixLabel,
2231
- label: label,
2232
- suffixLabel: suffixLabel
2233
- });
2234
- } // single <Select> behaviour is to show the placeholder if all parts of the the label
2235
- // are empty strings so we replicate this behaviour here
2236
-
2237
-
2238
- if (label.length === 0 || !multiple && label.every(function (labelNode) {
2239
- return labelNode === '';
2240
- })) {
2241
- label = [placeholder];
2242
- }
2243
-
2244
- var ariaLabel = label; // If there's more than one item selected, read out the selected total
2245
- // rather than reading out each selected item
2246
-
2247
- if (label.length > 1) {
2248
- ariaLabel = this.wrapLabel({
2249
- prefixLabel: prefixLabel,
2250
- label: ["".concat(currentValues.length, " items selected")],
2251
- suffixLabel: suffixLabel
2252
- });
2253
- }
2254
-
2313
+ return matchedItem && !matchedItem.props.disabled;
2314
+ });
2255
2315
  var finalChildren = this.createChildren();
2256
-
2257
- var commonProps = _objectSpread({
2258
- 'aria-describedby': describedBy,
2259
- 'aria-label': "".concat(labelText ? "".concat(labelText, ", ") : '').concat(ariaLabel),
2260
- 'aria-labelledby': labelText ? undefined : labelledBy,
2261
- 'aria-multiselectable': multiple,
2262
- 'aria-required': required,
2263
- 'data-select-appearance': appearance,
2264
- 'data-test': multiple ? 'multiselect' : 'select',
2265
- disabled: disabled,
2266
- elementRef: elementRef,
2267
- error: error
2268
- }, omit_default()(this.props, keys_default()(SelectBase.propTypes)));
2269
-
2270
- if (multiple) {
2271
- commonProps['data-test-values'] = JSON.stringify(currentValues);
2272
- } else {
2273
- var _currentValues = _slicedToArray(currentValues, 1),
2274
- dataTestValue = _currentValues[0];
2275
-
2276
- commonProps['data-test-value'] = dataTestValue;
2277
- }
2278
-
2279
- var toggle = appearance === 'link' ? /*#__PURE__*/external_react_default.a.createElement(Link_default.a, _extends({}, commonProps, {
2280
- "data-select-appearance": "link"
2281
- }), !!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 */], {
2282
- enterpriseSize: 0.5,
2283
- prismaSize: "small"
2284
- }))) : /*#__PURE__*/external_react_default.a.createElement(StyledButton, _extends({}, commonProps, {
2285
- $multiple: multiple,
2286
- appearance: appearance,
2287
- label: label,
2288
- error: error,
2289
- icon: icon,
2290
- inline: inline,
2291
- isMenu: true,
2292
- role: "listbox" // @ts-expect-error - accept inconsistency with Button
2293
- ,
2294
- onClick: this.props.onClick
2295
- }, pick_default()(this.props, SelectBase.invalidLinkAppearanceProps)), !!currentValues.length && multiple && /*#__PURE__*/external_react_default.a.createElement(StyledCount, {
2296
- "data-role": "count"
2297
- }, "(", currentValues.length, ")"));
2316
+ var toggle = this.createToggle();
2298
2317
 
2299
2318
  var createMenu = function createMenu(_ref5) {
2300
2319
  var anchorWidth = _ref5.anchorWidth,
package/StepBar.js CHANGED
@@ -131,7 +131,7 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
131
131
  var id_ = __webpack_require__(13);
132
132
 
133
133
  // EXTERNAL MODULE: external "@splunk/themes/useSplunkTheme"
134
- var useSplunkTheme_ = __webpack_require__(52);
134
+ var useSplunkTheme_ = __webpack_require__(54);
135
135
  var useSplunkTheme_default = /*#__PURE__*/__webpack_require__.n(useSplunkTheme_);
136
136
 
137
137
  // EXTERNAL MODULE: external "styled-components"
@@ -504,7 +504,7 @@ module.exports = require("styled-components");
504
504
 
505
505
  /***/ }),
506
506
 
507
- /***/ 52:
507
+ /***/ 54:
508
508
  /***/ (function(module, exports) {
509
509
 
510
510
  module.exports = require("@splunk/themes/useSplunkTheme");
package/Switch.js CHANGED
@@ -141,7 +141,7 @@ var external_prop_types_ = __webpack_require__(1);
141
141
  var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
142
142
 
143
143
  // EXTERNAL MODULE: external "@splunk/react-ui/AnimationToggle"
144
- var AnimationToggle_ = __webpack_require__(47);
144
+ var AnimationToggle_ = __webpack_require__(48);
145
145
  var AnimationToggle_default = /*#__PURE__*/__webpack_require__.n(AnimationToggle_);
146
146
 
147
147
  // EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
@@ -745,7 +745,7 @@ module.exports = require("styled-components");
745
745
 
746
746
  /***/ }),
747
747
 
748
- /***/ 47:
748
+ /***/ 48:
749
749
  /***/ (function(module, exports) {
750
750
 
751
751
  module.exports = require("@splunk/react-ui/AnimationToggle");
package/TabBar.js CHANGED
@@ -594,7 +594,7 @@ _defineProperty(Tab_Tab, "contextType", TabBar_TabBarContext);
594
594
 
595
595
  /* harmony default export */ var TabBar_Tab = (Tab_Tab);
596
596
  // EXTERNAL MODULE: ./src/utils/navigateList.ts
597
- var navigateList = __webpack_require__(55);
597
+ var navigateList = __webpack_require__(57);
598
598
 
599
599
  // CONCATENATED MODULE: ./src/TabBar/TabBar.tsx
600
600
  function TabBar_extends() { TabBar_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 TabBar_extends.apply(this, arguments); }
@@ -769,7 +769,7 @@ module.exports = require("styled-components");
769
769
 
770
770
  /***/ }),
771
771
 
772
- /***/ 55:
772
+ /***/ 57:
773
773
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
774
774
 
775
775
  "use strict";
package/TabLayout.js CHANGED
@@ -204,6 +204,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
204
204
 
205
205
  var propTypes = {
206
206
  children: external_prop_types_default.a.node,
207
+ count: external_prop_types_default.a.number,
207
208
  disabled: external_prop_types_default.a.bool,
208
209
  elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
209
210
  icon: external_prop_types_default.a.node,
@@ -272,6 +273,7 @@ var TabLayout_propTypes = {
272
273
  activePanelId: external_prop_types_default.a.string,
273
274
  appearance: external_prop_types_default.a.oneOf(['navigation', 'context']),
274
275
  children: external_prop_types_default.a.node,
276
+ count: external_prop_types_default.a.number,
275
277
  defaultActivePanelId: external_prop_types_default.a.string,
276
278
  elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
277
279
  iconSize: external_prop_types_default.a.oneOf(['inline', 'small', 'large']),
@@ -369,6 +371,7 @@ var TabLayout_TabLayout = /*#__PURE__*/function (_Component) {
369
371
  }
370
372
 
371
373
  return /*#__PURE__*/external_react_default.a.createElement(TabBar_default.a.Tab, {
374
+ count: props.count,
372
375
  icon: props.icon,
373
376
  key: props.panelId,
374
377
  label: props.label,