@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/TabBar.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 = 123);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -142,7 +142,7 @@ function updateReactRef(ref, current) {
|
|
|
142
142
|
|
|
143
143
|
/***/ }),
|
|
144
144
|
|
|
145
|
-
/***/
|
|
145
|
+
/***/ 123:
|
|
146
146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
147
147
|
|
|
148
148
|
"use strict";
|
|
@@ -198,7 +198,7 @@ var Styled = external_styled_components_default.a.div.withConfig({
|
|
|
198
198
|
var id_ = __webpack_require__(10);
|
|
199
199
|
|
|
200
200
|
// EXTERNAL MODULE: external "@splunk/react-ui/Popover"
|
|
201
|
-
var Popover_ = __webpack_require__(
|
|
201
|
+
var Popover_ = __webpack_require__(17);
|
|
202
202
|
var Popover_default = /*#__PURE__*/__webpack_require__.n(Popover_);
|
|
203
203
|
|
|
204
204
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
@@ -411,6 +411,7 @@ var propTypes = {
|
|
|
411
411
|
|
|
412
412
|
/** @private. The internal key of the tab */
|
|
413
413
|
tabKey: external_prop_types_default.a.number,
|
|
414
|
+
to: external_prop_types_default.a.string,
|
|
414
415
|
tooltip: external_prop_types_default.a.node
|
|
415
416
|
};
|
|
416
417
|
var defaultProps = {
|
|
@@ -457,14 +458,23 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
|
|
|
457
458
|
|
|
458
459
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
459
460
|
var _this$props = _this.props,
|
|
461
|
+
active = _this$props.active,
|
|
460
462
|
onClick = _this$props.onClick,
|
|
461
463
|
tabId = _this$props.tabId,
|
|
462
|
-
tabKey = _this$props.tabKey
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
464
|
+
tabKey = _this$props.tabKey,
|
|
465
|
+
to = _this$props.to; // preserve the previous behaviour from 2ad8e7eaf47 to avoid firing unnecessary onChange events
|
|
466
|
+
// while preventing the "to" prop from incorrectly triggering <Clickable>'s providedOnClick on the active tab
|
|
467
|
+
|
|
468
|
+
if (!active) {
|
|
469
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
470
|
+
tabId: tabId,
|
|
471
|
+
tabKey: tabKey
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (to == null || to != null && active) {
|
|
476
|
+
e.preventDefault();
|
|
477
|
+
}
|
|
468
478
|
});
|
|
469
479
|
|
|
470
480
|
_defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
|
|
@@ -509,8 +519,9 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
|
|
|
509
519
|
label = _this$props3.label,
|
|
510
520
|
layout = _this$props3.layout,
|
|
511
521
|
tabId = _this$props3.tabId,
|
|
522
|
+
to = _this$props3.to,
|
|
512
523
|
tooltip = _this$props3.tooltip,
|
|
513
|
-
otherProps = _objectWithoutProperties(_this$props3, ["active", "appearance", "ariaControls", "count", "disabled", "icon", "iconSize", "label", "layout", "tabId", "tooltip"]);
|
|
524
|
+
otherProps = _objectWithoutProperties(_this$props3, ["active", "appearance", "ariaControls", "count", "disabled", "icon", "iconSize", "label", "layout", "tabId", "to", "tooltip"]);
|
|
514
525
|
|
|
515
526
|
var _this$state = this.state,
|
|
516
527
|
anchor = _this$state.anchor,
|
|
@@ -526,7 +537,7 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
|
|
|
526
537
|
disabled: disabled,
|
|
527
538
|
elementRef: this.handleMount
|
|
528
539
|
}, otherProps, {
|
|
529
|
-
onClick:
|
|
540
|
+
onClick: this.handleClick,
|
|
530
541
|
onFocus: this.handleFocus,
|
|
531
542
|
onMouseEnter: this.handleTooltipOpen,
|
|
532
543
|
onBlur: this.handleTooltipClose,
|
|
@@ -536,7 +547,8 @@ var Tab_Tab = /*#__PURE__*/function (_Component) {
|
|
|
536
547
|
// prop is of type React.ReactNode, which means title
|
|
537
548
|
// can end up showing as "[object Object]"
|
|
538
549
|
,
|
|
539
|
-
title: label
|
|
550
|
+
title: label,
|
|
551
|
+
to: to
|
|
540
552
|
}), /*#__PURE__*/external_react_default.a.createElement(StyledLabel, {
|
|
541
553
|
"data-test": "label",
|
|
542
554
|
$withUnderline: appearance === 'navigation'
|
|
@@ -623,28 +635,36 @@ function TabBar(_ref) {
|
|
|
623
635
|
var previousTabKey = Object(external_react_["useMemo"])(function () {
|
|
624
636
|
return layout === 'vertical' ? 'up' : 'left';
|
|
625
637
|
}, [layout]);
|
|
626
|
-
|
|
627
|
-
var
|
|
628
|
-
var
|
|
638
|
+
|
|
639
|
+
var tabOnFocus = function tabOnFocus(e, data) {
|
|
640
|
+
var tabKey = data.tabKey;
|
|
641
|
+
|
|
642
|
+
if (tabKey != null) {
|
|
643
|
+
focusedTabKey.current = tabKey;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
if (autoActivate) {
|
|
629
647
|
onChange === null || onChange === void 0 ? void 0 : onChange(e, {
|
|
630
648
|
selectedTabId: data.tabId
|
|
631
649
|
});
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
var tabOnFocus = function tabOnFocus(e, data) {
|
|
635
|
-
var tabKey = data.tabKey;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
636
652
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
653
|
+
var tabOnClick = function tabOnClick(e, data) {
|
|
654
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e, {
|
|
655
|
+
selectedTabId: data.tabId
|
|
656
|
+
});
|
|
657
|
+
};
|
|
640
658
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}
|
|
659
|
+
var tabKeyCounter = 0;
|
|
660
|
+
var clonedChildren = external_react_["Children"].toArray(children).filter(external_react_["isValidElement"]).map(function (child) {
|
|
661
|
+
// <TabBar> allows non-<Tab> children, pass them through without any modification
|
|
662
|
+
if (typeof child.type === 'string' || child.type.name !== TabBar_Tab.name) {
|
|
663
|
+
return child;
|
|
664
|
+
}
|
|
647
665
|
|
|
666
|
+
var ref = /*#__PURE__*/external_react_default.a.createRef();
|
|
667
|
+
tabRefs.push(ref);
|
|
648
668
|
var childProps = {
|
|
649
669
|
active: activeTabId === child.props.tabId,
|
|
650
670
|
appearance: appearance,
|
|
@@ -653,19 +673,13 @@ function TabBar(_ref) {
|
|
|
653
673
|
layout: layout,
|
|
654
674
|
onClick: tabOnClick,
|
|
655
675
|
onFocus: tabOnFocus,
|
|
676
|
+
ref: ref,
|
|
656
677
|
style: tabWidth && tabWidth > minTabWidth ? {
|
|
657
678
|
width: tabWidth
|
|
658
|
-
} : child.props.style
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
var ref = /*#__PURE__*/external_react_default.a.createRef();
|
|
663
|
-
childProps.ref = ref;
|
|
664
|
-
tabRefs.push(ref);
|
|
665
|
-
childProps.tabKey = tabKeyCounter;
|
|
666
|
-
tabKeyCounter += 1;
|
|
667
|
-
}
|
|
668
|
-
|
|
679
|
+
} : child.props.style,
|
|
680
|
+
tabKey: tabKeyCounter
|
|
681
|
+
};
|
|
682
|
+
tabKeyCounter += 1;
|
|
669
683
|
return /*#__PURE__*/Object(external_react_["cloneElement"])(child, childProps);
|
|
670
684
|
});
|
|
671
685
|
return /*#__PURE__*/external_react_default.a.createElement(Styled, TabBar_extends({
|
|
@@ -718,7 +732,7 @@ module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
|
718
732
|
|
|
719
733
|
/***/ }),
|
|
720
734
|
|
|
721
|
-
/***/
|
|
735
|
+
/***/ 17:
|
|
722
736
|
/***/ (function(module, exports) {
|
|
723
737
|
|
|
724
738
|
module.exports = require("@splunk/react-ui/Popover");
|
package/TabLayout.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 = 128);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -108,7 +108,7 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 128:
|
|
112
112
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
113
|
|
|
114
114
|
"use strict";
|
|
@@ -134,7 +134,7 @@ var external_lodash_ = __webpack_require__(4);
|
|
|
134
134
|
var id_ = __webpack_require__(10);
|
|
135
135
|
|
|
136
136
|
// EXTERNAL MODULE: external "@splunk/react-ui/TabBar"
|
|
137
|
-
var TabBar_ = __webpack_require__(
|
|
137
|
+
var TabBar_ = __webpack_require__(71);
|
|
138
138
|
var TabBar_default = /*#__PURE__*/__webpack_require__.n(TabBar_);
|
|
139
139
|
|
|
140
140
|
// EXTERNAL MODULE: external "styled-components"
|
|
@@ -406,7 +406,7 @@ module.exports = require("lodash");
|
|
|
406
406
|
|
|
407
407
|
/***/ }),
|
|
408
408
|
|
|
409
|
-
/***/
|
|
409
|
+
/***/ 71:
|
|
410
410
|
/***/ (function(module, exports) {
|
|
411
411
|
|
|
412
412
|
module.exports = require("@splunk/react-ui/TabBar");
|