@splunk/react-ui 4.15.0 → 4.16.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/Animation.js +2 -2
- package/Button.js +32 -30
- package/ButtonSimple.js +54 -50
- package/CHANGELOG.md +27 -2
- package/Calendar.js +12 -12
- package/Card.js +10 -10
- package/Chip.js +10 -10
- package/CloseButton.js +8 -8
- package/CollapsiblePanel.js +8 -8
- package/Color.js +14 -14
- package/ColumnLayout.js +2 -2
- package/ComboBox.js +4 -4
- package/ControlGroup.js +26 -16
- package/Date.js +10 -5
- package/Dropdown.js +56 -15
- package/File.js +33 -24
- package/FormRows.js +6 -6
- package/Heading.js +10 -46
- package/Image.js +13 -13
- package/Link.js +2 -2
- package/MIGRATION.md +21 -0
- package/Menu.js +20 -20
- package/Message.js +24 -24
- package/MessageBar.js +24 -24
- package/Modal.js +7 -7
- package/Multiselect.js +197 -177
- package/Number.js +5 -5
- package/Paginator.js +19 -19
- package/Popover.js +7 -7
- package/Progress.js +2 -2
- package/Scroll.js +5 -5
- package/Search.js +4 -4
- package/Select.js +187 -167
- package/SplitButton.js +2 -2
- package/StepBar.js +10 -10
- package/Switch.js +4 -4
- package/TabBar.js +2 -2
- package/TabLayout.js +3 -0
- package/Table.js +95 -46
- package/Text.js +19 -19
- package/TextArea.js +15 -15
- package/Tooltip.js +5 -5
- package/Typography.js +1 -1
- package/WaitSpinner.js +2 -2
- package/package.json +6 -7
- package/types/src/Button/Button.d.ts +5 -2
- package/types/src/Button/docs/examples/Basic.d.ts +2 -2
- package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -11
- package/types/src/Date/Icon.d.ts +1 -1
- package/types/src/Dropdown/Dropdown.d.ts +12 -7
- package/types/src/File/Icon.d.ts +1 -1
- package/types/src/File/IconCloud.d.ts +1 -1
- package/types/src/File/PaperClip.d.ts +1 -1
- package/types/src/File/Retry.d.ts +1 -1
- package/types/src/File/Trash.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +4 -0
- package/types/src/Multiselect/Multiselect.d.ts +4 -1
- package/types/src/Number/IncrementIcon.d.ts +1 -1
- package/types/src/Select/Select.d.ts +4 -2
- package/types/src/Select/SelectBase.d.ts +13 -1
- package/types/src/TabLayout/Panel.d.ts +3 -0
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/Body.d.ts +2 -0
- package/types/src/Table/Row.d.ts +11 -3
- package/types/src/Table/Table.d.ts +5 -3
- package/types/src/Text/IconOutlinedHide.d.ts +1 -1
- package/types/src/Text/IconOutlinedView.d.ts +1 -1
- package/types/src/Tooltip/InfoIcon.d.ts +1 -1
- package/types/src/Typography/Typography.d.ts +1 -1
package/Multiselect.js
CHANGED
|
@@ -236,8 +236,8 @@ function Icon(_ref) {
|
|
|
236
236
|
|
|
237
237
|
|
|
238
238
|
if (prismaSize === 'small') {
|
|
239
|
-
var
|
|
240
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
|
|
239
|
+
var SVGEnterprise = Prisma16 || Prisma24;
|
|
240
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(SVGEnterprise, _extends({
|
|
241
241
|
width: "16",
|
|
242
242
|
height: "16"
|
|
243
243
|
}, prismaProps));
|
|
@@ -245,9 +245,9 @@ function Icon(_ref) {
|
|
|
245
245
|
|
|
246
246
|
|
|
247
247
|
if (density === 'compact') {
|
|
248
|
-
var
|
|
248
|
+
var _SVGEnterprise = Prisma20 || Prisma24;
|
|
249
249
|
|
|
250
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
|
|
250
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_SVGEnterprise, _extends({
|
|
251
251
|
width: "20",
|
|
252
252
|
height: "20"
|
|
253
253
|
}, prismaProps));
|
|
@@ -718,8 +718,8 @@ _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
|
|
722
|
-
/* harmony import */ var
|
|
721
|
+
/* harmony import */ var _splunk_react_icons_enterprise_Search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56);
|
|
722
|
+
/* harmony import */ var _splunk_react_icons_enterprise_Search__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_enterprise_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);
|
|
725
725
|
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); }
|
|
@@ -753,7 +753,7 @@ function Prisma16(_ref2) {
|
|
|
753
753
|
|
|
754
754
|
function Search(props) {
|
|
755
755
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ThemedIcon__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], _extends({
|
|
756
|
-
Enterprise:
|
|
756
|
+
Enterprise: _splunk_react_icons_enterprise_Search__WEBPACK_IMPORTED_MODULE_1___default.a,
|
|
757
757
|
Prisma16: Prisma16,
|
|
758
758
|
Prisma24: Prisma24
|
|
759
759
|
}, props));
|
|
@@ -775,30 +775,37 @@ 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
|
-
/*
|
|
793
|
-
/*
|
|
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
|
|
801
|
-
/* harmony import */ var
|
|
807
|
+
/* harmony import */ var _splunk_react_icons_enterprise_Caret__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53);
|
|
808
|
+
/* harmony import */ var _splunk_react_icons_enterprise_Caret__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_enterprise_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);
|
|
804
811
|
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); }
|
|
@@ -821,45 +828,38 @@ function Prisma24(_ref) {
|
|
|
821
828
|
|
|
822
829
|
function CaretDown(props) {
|
|
823
830
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ThemedIcon__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], _extends({
|
|
824
|
-
Enterprise:
|
|
831
|
+
Enterprise: _splunk_react_icons_enterprise_Caret__WEBPACK_IMPORTED_MODULE_1___default.a,
|
|
825
832
|
Prisma24: Prisma24
|
|
826
833
|
}, props));
|
|
827
834
|
}
|
|
828
835
|
|
|
829
836
|
/***/ }),
|
|
830
|
-
/* 51 */
|
|
831
|
-
/***/ (function(module, exports) {
|
|
832
|
-
|
|
833
|
-
module.exports = require("@splunk/react-icons/Caret");
|
|
834
|
-
|
|
835
|
-
/***/ }),
|
|
836
|
-
/* 52 */,
|
|
837
837
|
/* 53 */
|
|
838
838
|
/***/ (function(module, exports) {
|
|
839
839
|
|
|
840
|
-
module.exports = require("
|
|
840
|
+
module.exports = require("@splunk/react-icons/enterprise/Caret");
|
|
841
841
|
|
|
842
842
|
/***/ }),
|
|
843
|
-
/* 54
|
|
843
|
+
/* 54 */,
|
|
844
|
+
/* 55 */
|
|
844
845
|
/***/ (function(module, exports) {
|
|
845
846
|
|
|
846
|
-
module.exports = require("
|
|
847
|
+
module.exports = require("lodash/defer");
|
|
847
848
|
|
|
848
849
|
/***/ }),
|
|
849
|
-
/* 55 */,
|
|
850
850
|
/* 56 */
|
|
851
851
|
/***/ (function(module, exports) {
|
|
852
852
|
|
|
853
|
-
module.exports = require("
|
|
853
|
+
module.exports = require("@splunk/react-icons/enterprise/Search");
|
|
854
854
|
|
|
855
855
|
/***/ }),
|
|
856
|
-
/* 57
|
|
856
|
+
/* 57 */,
|
|
857
|
+
/* 58 */
|
|
857
858
|
/***/ (function(module, exports) {
|
|
858
859
|
|
|
859
|
-
module.exports = require("lodash/
|
|
860
|
+
module.exports = require("lodash/without");
|
|
860
861
|
|
|
861
862
|
/***/ }),
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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$
|
|
1604
|
-
allowKeyMatching = _this$
|
|
1605
|
-
allowNewValues = _this$
|
|
1606
|
-
filter = _this$
|
|
1607
|
-
multiple = _this$
|
|
1608
|
-
showSelectedValuesFirst = _this$
|
|
1609
|
-
isLoadingOptions = _this$
|
|
1610
|
-
onScrollBottom = _this$
|
|
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$
|
|
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$
|
|
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$
|
|
2017
|
+
var _this$getCurrentValue6, _this$props$onChange3, _this$props14;
|
|
1892
2018
|
|
|
1893
|
-
var values = (_this$
|
|
2019
|
+
var values = (_this$getCurrentValue6 = this.getCurrentValues()) !== null && _this$getCurrentValue6 !== void 0 ? _this$getCurrentValue6 : [];
|
|
1894
2020
|
var currentIndex = values.indexOf(value);
|
|
1895
|
-
var _this$
|
|
1896
|
-
name = _this$
|
|
1897
|
-
multiple = _this$
|
|
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$
|
|
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$
|
|
1958
|
-
inputId = _this$
|
|
1959
|
-
inputRef = _this$
|
|
1960
|
-
multiple = _this$
|
|
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$
|
|
2138
|
+
var _this$getCurrentValue7,
|
|
2013
2139
|
_this2 = this;
|
|
2014
2140
|
|
|
2015
|
-
var _this$
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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,
|
|
@@ -2174,6 +2193,7 @@ var SelectBase_SelectBase = /*#__PURE__*/function (_Component) {
|
|
|
2174
2193
|
onRequestOpen: this.handleRequestOpen,
|
|
2175
2194
|
onRequestClose: this.handleRequestClose,
|
|
2176
2195
|
open: this.state.open,
|
|
2196
|
+
openWithArrowKeys: true,
|
|
2177
2197
|
repositionMode: repositionMode,
|
|
2178
2198
|
defaultPlacement: filterEnabled ? defaultPlacement : undefined,
|
|
2179
2199
|
canCoverAnchor: Object(ssrWindow["a" /* getWindow */])().innerHeight < 500,
|
|
@@ -2703,11 +2723,11 @@ Compact_defineProperty(Compact_Compact, "Heading", Menu_["Heading"]);
|
|
|
2703
2723
|
|
|
2704
2724
|
/* harmony default export */ var Multiselect_Compact = (Compact_Compact);
|
|
2705
2725
|
// EXTERNAL MODULE: external "lodash/defer"
|
|
2706
|
-
var defer_ = __webpack_require__(
|
|
2726
|
+
var defer_ = __webpack_require__(55);
|
|
2707
2727
|
var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
|
|
2708
2728
|
|
|
2709
2729
|
// EXTERNAL MODULE: external "lodash/extend"
|
|
2710
|
-
var extend_ = __webpack_require__(
|
|
2730
|
+
var extend_ = __webpack_require__(49);
|
|
2711
2731
|
var extend_default = /*#__PURE__*/__webpack_require__.n(extend_);
|
|
2712
2732
|
|
|
2713
2733
|
// EXTERNAL MODULE: external "lodash/get"
|
|
@@ -2739,7 +2759,7 @@ var pickBy_ = __webpack_require__(71);
|
|
|
2739
2759
|
var pickBy_default = /*#__PURE__*/__webpack_require__.n(pickBy_);
|
|
2740
2760
|
|
|
2741
2761
|
// EXTERNAL MODULE: external "lodash/without"
|
|
2742
|
-
var without_ = __webpack_require__(
|
|
2762
|
+
var without_ = __webpack_require__(58);
|
|
2743
2763
|
var without_default = /*#__PURE__*/__webpack_require__.n(without_);
|
|
2744
2764
|
|
|
2745
2765
|
// EXTERNAL MODULE: external "@splunk/ui-utils/filter"
|
|
@@ -2756,7 +2776,7 @@ var Chip_ = __webpack_require__(142);
|
|
|
2756
2776
|
var Chip_default = /*#__PURE__*/__webpack_require__.n(Chip_);
|
|
2757
2777
|
|
|
2758
2778
|
// EXTERNAL MODULE: external "@splunk/react-ui/ResultsMenu"
|
|
2759
|
-
var ResultsMenu_ = __webpack_require__(
|
|
2779
|
+
var ResultsMenu_ = __webpack_require__(46);
|
|
2760
2780
|
var ResultsMenu_default = /*#__PURE__*/__webpack_require__.n(ResultsMenu_);
|
|
2761
2781
|
|
|
2762
2782
|
// EXTERNAL MODULE: external "@splunk/react-ui/Popover"
|
package/Number.js
CHANGED
|
@@ -165,9 +165,9 @@ var keyboard_ = __webpack_require__(9);
|
|
|
165
165
|
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
166
166
|
var i18n_ = __webpack_require__(4);
|
|
167
167
|
|
|
168
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/
|
|
169
|
-
var
|
|
170
|
-
var
|
|
168
|
+
// EXTERNAL MODULE: external "@splunk/react-icons/SVGEnterprise"
|
|
169
|
+
var SVGEnterprise_ = __webpack_require__(32);
|
|
170
|
+
var SVGEnterprise_default = /*#__PURE__*/__webpack_require__.n(SVGEnterprise_);
|
|
171
171
|
|
|
172
172
|
// CONCATENATED MODULE: ./src/Number/IncrementIcon.tsx
|
|
173
173
|
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); }
|
|
@@ -177,7 +177,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
177
177
|
/* eslint-disable max-len */
|
|
178
178
|
|
|
179
179
|
function SortedUp(props) {
|
|
180
|
-
return /*#__PURE__*/external_react_default.a.createElement(
|
|
180
|
+
return /*#__PURE__*/external_react_default.a.createElement(SVGEnterprise_default.a, _extends({
|
|
181
181
|
viewBox: "0 0 933 600"
|
|
182
182
|
}, props), /*#__PURE__*/external_react_default.a.createElement("path", {
|
|
183
183
|
fill: "currentColor",
|
|
@@ -835,7 +835,7 @@ module.exports = require("@splunk/react-ui/Text");
|
|
|
835
835
|
/***/ 32:
|
|
836
836
|
/***/ (function(module, exports) {
|
|
837
837
|
|
|
838
|
-
module.exports = require("@splunk/react-icons/
|
|
838
|
+
module.exports = require("@splunk/react-icons/SVGEnterprise");
|
|
839
839
|
|
|
840
840
|
/***/ }),
|
|
841
841
|
|