@splunk/react-ui 5.0.0-beta.3 → 5.0.0-beta.5
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 +185 -243
- package/Animation.js +2 -2
- package/Button.js +4 -2
- package/ButtonSimple.js +47 -41
- package/CHANGELOG.md +15 -2
- package/CHANGELOG.v5.mdx +73 -0
- package/Calendar.js +352 -469
- package/Card.js +163 -162
- package/Chip.js +171 -356
- package/Clickable.js +79 -76
- package/Code.js +19 -12
- package/Color.js +32 -32
- package/ComboBox.js +9 -7
- package/Date.js +160 -184
- package/DualListbox.js +549 -612
- package/File.js +546 -408
- package/FormRows.js +170 -157
- package/Image.js +124 -251
- package/JSONTree.js +496 -521
- package/Layer.js +162 -97
- package/Layout.d.ts +2 -0
- package/Link.js +20 -13
- package/MIGRATION.v5.mdx +48 -1
- package/Markdown.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +132 -177
- package/MessageBar.js +121 -290
- package/Modal.js +2 -2
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1982 -2334
- package/NonInteractiveCheckbox.js +29 -117
- package/Number.js +114 -114
- package/Popover.js +328 -326
- package/Progress.js +68 -54
- package/RadioBar.js +139 -136
- package/RadioList.js +67 -65
- package/Resize.js +377 -265
- package/ResultsMenu.js +573 -661
- package/Scroll.js +2 -2
- package/ScrollContainerContext.js +13 -9
- package/Search.js +1 -1
- package/Select.js +364 -361
- package/SidePanel.js +17 -21
- package/Slider.js +494 -372
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +39 -25
- package/StepBar.js +3 -3
- package/Switch.js +136 -129
- package/TabBar.js +598 -466
- package/TabLayout.js +34 -34
- package/Table.js +1648 -1479
- package/Text.js +51 -50
- package/TextArea.js +280 -154
- package/Tooltip.js +413 -563
- package/TransitionOpen.js +2 -2
- package/Tree.js +2 -2
- package/Typography.js +30 -28
- package/WaitSpinner.js +6 -11
- package/cypress/support/commands.ts +14 -4
- package/cypress/support/index.d.ts +1 -1
- package/package.json +9 -11
- package/stubs-splunkui.d.ts +0 -4
- package/types/src/Accordion/Accordion.d.ts +14 -21
- package/types/src/Accordion/AccordionContext.d.ts +0 -1
- package/types/src/Animation/Animation.d.ts +2 -3
- package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
- package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
- package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
- package/types/src/Button/Button.d.ts +1 -1
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Calendar/Calendar.d.ts +2 -2
- package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
- package/types/src/Calendar/Day.d.ts +8 -4
- package/types/src/Card/Card.d.ts +3 -1
- package/types/src/Card/Header.d.ts +2 -0
- package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
- package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +12 -4
- package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
- package/types/src/ComboBox/ComboBox.d.ts +3 -3
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +4 -4
- package/types/src/File/FileContext.d.ts +0 -1
- package/types/src/File/Item.d.ts +11 -3
- package/types/src/File/ItemIcon.d.ts +2 -1
- package/types/src/File/docs/examples/Disabled.d.ts +2 -2
- package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
- package/types/src/File/docs/examples/Multi.d.ts +2 -2
- package/types/src/File/docs/examples/Single.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +4 -4
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/SortableRow.d.ts +1 -1
- package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
- package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
- package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
- package/types/src/Image/Image.d.ts +1 -4
- package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
- package/types/src/Layout/Layout.d.ts +1 -0
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/icons/External.d.ts +1 -2
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/MenuContext.d.ts +0 -1
- package/types/src/Message/Message.d.ts +1 -1
- package/types/src/MessageBar/MessageBar.d.ts +6 -2
- package/types/src/Modal/ModalContext.d.ts +0 -1
- package/types/src/Multiselect/Compact.d.ts +46 -21
- package/types/src/Multiselect/Multiselect.d.ts +69 -36
- package/types/src/Multiselect/Normal.d.ts +45 -62
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
- package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +8 -7
- package/types/src/Number/docs/examples/Basic.d.ts +2 -2
- package/types/src/Number/docs/examples/Limits.d.ts +2 -2
- package/types/src/Number/docs/examples/Locale.d.ts +2 -2
- package/types/src/Popover/Popover.d.ts +1 -1
- package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
- package/types/src/RadioList/RadioListContext.d.ts +0 -1
- package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
- package/types/src/Scroll/Inner.d.ts +1 -1
- package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Search/Search.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +4 -4
- package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
- package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
- package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +15 -2
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/StepBar/StepBarContext.d.ts +0 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
- package/types/src/TabBar/Tab.d.ts +12 -5
- package/types/src/TabBar/TabBar.d.ts +11 -7
- package/types/src/TabBar/TabBarContext.d.ts +8 -3
- package/types/src/TabLayout/TabLayout.d.ts +8 -5
- package/types/src/Table/Head.d.ts +4 -15
- package/types/src/Table/HeadCell.d.ts +23 -25
- package/types/src/Table/HeadDropdownCell.d.ts +23 -26
- package/types/src/Table/HeadInner.d.ts +4 -10
- package/types/src/Table/Row.d.ts +6 -6
- package/types/src/Table/Table.d.ts +3 -8
- package/types/src/Table/TableContext.d.ts +0 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Tree/TreeContext.d.ts +0 -1
- package/types/src/Typography/Typography.d.ts +27 -22
- package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
- package/types/src/utils/types.d.ts +2 -3
- package/useResizeObserver.js +26 -19
- package/types/src/Date/Icon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
- package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
- package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
- package/types/src/Tooltip/InfoIcon.d.ts +0 -4
- /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
- /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
4
4
|
type ResultsMenuScrollBottomHandler = (event: React.UIEvent<HTMLDivElement> | null) => void;
|
|
5
5
|
interface ResultsMenuPropsBase {
|
|
6
6
|
/**
|
|
@@ -29,6 +29,7 @@ interface ResultsMenuPropsBase {
|
|
|
29
29
|
* - `roving`: Does not retain focus inside the menu. One tab stop. Uses up/down arrow keys to navigate and loop inside the menu.
|
|
30
30
|
*/
|
|
31
31
|
focusMode?: 'roving' | 'normal' | 'never';
|
|
32
|
+
footerMessage?: React.ReactNode;
|
|
32
33
|
/**
|
|
33
34
|
* Whether or not to show the loading message and/or wait spinner. It's not recommended to
|
|
34
35
|
* pass old children when loading new children. The loading animation will show below any
|
|
@@ -36,6 +37,7 @@ interface ResultsMenuPropsBase {
|
|
|
36
37
|
*/
|
|
37
38
|
isLoading?: boolean;
|
|
38
39
|
loadingMessage?: React.ReactNode;
|
|
40
|
+
menuId?: string;
|
|
39
41
|
noOptionsMessage?: React.ReactNode;
|
|
40
42
|
onScroll?: React.UIEventHandler<Element>;
|
|
41
43
|
/**
|
|
@@ -47,8 +49,6 @@ interface ResultsMenuPropsBase {
|
|
|
47
49
|
*/
|
|
48
50
|
onScrollBottom?: ResultsMenuScrollBottomHandler;
|
|
49
51
|
placement?: string;
|
|
50
|
-
footerMessage?: React.ReactNode;
|
|
51
|
-
menuId?: string;
|
|
52
52
|
}
|
|
53
53
|
declare const propTypes: {
|
|
54
54
|
animateLoading: PropTypes.Requireable<boolean>;
|
|
@@ -59,41 +59,30 @@ declare const propTypes: {
|
|
|
59
59
|
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
60
60
|
isLoading: PropTypes.Requireable<boolean>;
|
|
61
61
|
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
62
|
+
menuId: PropTypes.Requireable<string>;
|
|
62
63
|
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
63
64
|
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
64
65
|
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
65
66
|
placement: PropTypes.Requireable<string>;
|
|
66
|
-
menuId: PropTypes.Requireable<string>;
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
private handleMount;
|
|
87
|
-
private handleMouseEnter;
|
|
88
|
-
private handleMouseLeave;
|
|
89
|
-
private handleScroll;
|
|
90
|
-
private handleWheelMenu;
|
|
91
|
-
private handleScrollBottomOnFullMenu;
|
|
92
|
-
private handleScrollBottom;
|
|
93
|
-
private checkFullHeight;
|
|
94
|
-
private renderFooterMessage;
|
|
95
|
-
private createMenuContextValue;
|
|
96
|
-
render(): React.JSX.Element;
|
|
68
|
+
type ResultsMenuProps = ComponentProps<ResultsMenuPropsBase, 'div'>;
|
|
69
|
+
declare function ResultsMenu({ animateLoading, 'aria-multiselectable': ariaMultiselectable, children, childrenStart, elementRef, focusMode, footerMessage, isLoading, loadingMessage, menuId, noOptionsMessage, onScroll, onScrollBottom, placement, style, tabIndex, ...otherProps }: ResultsMenuProps): React.JSX.Element;
|
|
70
|
+
declare namespace ResultsMenu {
|
|
71
|
+
var propTypes: {
|
|
72
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
73
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
74
|
+
childrenStart: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
75
|
+
elementRef: PropTypes.Requireable<object>;
|
|
76
|
+
focusMode: PropTypes.Requireable<string>;
|
|
77
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
78
|
+
isLoading: PropTypes.Requireable<boolean>;
|
|
79
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
80
|
+
menuId: PropTypes.Requireable<string>;
|
|
81
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
82
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
84
|
+
placement: PropTypes.Requireable<string>;
|
|
85
|
+
};
|
|
97
86
|
}
|
|
98
87
|
export default ResultsMenu;
|
|
99
88
|
export { propTypes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { SpringValue } from 'react-spring';
|
|
3
|
+
import { SpringValue } from '@react-spring/web';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface InnerPropsBase {
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
declare class Basic extends Component<
|
|
2
|
+
declare class Basic extends Component<object, {
|
|
3
3
|
top?: number;
|
|
4
4
|
}> {
|
|
5
5
|
private scrollEl;
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleClickDown: () => void;
|
|
8
8
|
handleClickUp: () => void;
|
|
9
9
|
handleScrollComplete: () => void;
|
|
@@ -104,8 +104,8 @@ declare function Search({ animateLoading, children, defaultPlacement, defaultVal
|
|
|
104
104
|
declare namespace Search {
|
|
105
105
|
var propTypes: React.WeakValidationMap<SearchPropsBase>;
|
|
106
106
|
var Option: typeof import("./Option").default;
|
|
107
|
-
var Divider: typeof import("
|
|
108
|
-
var Heading: typeof import("
|
|
107
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
108
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
109
109
|
}
|
|
110
110
|
export default Search;
|
|
111
111
|
export { SearchBlurHandler, SearchChangeHandler, SearchFocusHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
|
|
@@ -218,8 +218,8 @@ interface ControlsProps extends Pick<SelectBaseProps, 'inputId' | 'inputRef' | '
|
|
|
218
218
|
filterKeyword: string;
|
|
219
219
|
hasChildren: boolean;
|
|
220
220
|
menuListboxId: string;
|
|
221
|
-
onClearAll: React.MouseEventHandler<HTMLButtonElement
|
|
222
|
-
onSelectAll: React.MouseEventHandler<HTMLButtonElement
|
|
221
|
+
onClearAll: React.MouseEventHandler<HTMLButtonElement>;
|
|
222
|
+
onSelectAll: React.MouseEventHandler<HTMLButtonElement>;
|
|
223
223
|
onTextBlur: TextBlurHandler;
|
|
224
224
|
onTextChange: TextChangeHandler;
|
|
225
225
|
onTextFocus: TextFocusHandler;
|
|
@@ -282,8 +282,8 @@ declare namespace SelectBase {
|
|
|
282
282
|
};
|
|
283
283
|
var componentType: string;
|
|
284
284
|
var Option: typeof import("./OptionBase").default;
|
|
285
|
-
var Divider: typeof import("
|
|
286
|
-
var Heading: typeof import("
|
|
285
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
286
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
287
287
|
}
|
|
288
288
|
export default SelectBase;
|
|
289
289
|
export { Controls, ChildrenElement, Divider, Heading, Option, SelectBaseChangeHandler, SelectBaseChangeReason, SelectBaseFilterChangeHandler, SelectBaseProps, isOption, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SliderChangeHandler } from '@splunk/react-ui/Slider';
|
|
3
3
|
import { NumberChangeHandler } from '@splunk/react-ui/Number';
|
|
4
|
-
declare class Controlled extends Component<
|
|
4
|
+
declare class Controlled extends Component<object, {
|
|
5
5
|
value?: number;
|
|
6
6
|
}> {
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleSliderChange: SliderChangeHandler;
|
|
9
9
|
handleNumberChange: NumberChangeHandler;
|
|
10
10
|
render(): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SliderChangeHandler } from '@splunk/react-ui/Slider';
|
|
3
|
-
declare class CustomLabels extends Component<
|
|
3
|
+
declare class CustomLabels extends Component<object, {
|
|
4
4
|
displayValue: string;
|
|
5
5
|
value: number;
|
|
6
6
|
}> {
|
|
7
7
|
static convertValueToLabel(value: number): string;
|
|
8
|
-
constructor(props:
|
|
8
|
+
constructor(props: object);
|
|
9
9
|
handleChange: SliderChangeHandler;
|
|
10
10
|
render(): React.JSX.Element;
|
|
11
11
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnyTheme, InterpolationResult } from '@splunk/themes';
|
|
2
|
+
declare function getStepMarksBackground<T extends AnyTheme, A extends object>({ stepWidth, thumbPosition, beforeThumbStepColor, afterThumbStepColor, }: {
|
|
3
|
+
stepWidth: number;
|
|
4
|
+
thumbPosition?: number;
|
|
5
|
+
beforeThumbStepColor: InterpolationResult<T, A>;
|
|
6
|
+
afterThumbStepColor: InterpolationResult<T, A>;
|
|
7
|
+
}): import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<import("@splunk/themes").ThemedProps<T> & A, any>>;
|
|
8
|
+
export default getStepMarksBackground;
|
|
@@ -22,7 +22,7 @@ interface PanelPropsBase {
|
|
|
22
22
|
/**
|
|
23
23
|
* A unique `id` for this panel and used by the SlidingPanels to keep track of the open panel.
|
|
24
24
|
*/
|
|
25
|
-
panelId:
|
|
25
|
+
panelId: string | number;
|
|
26
26
|
}
|
|
27
27
|
type PanelProps = ComponentProps<PanelPropsBase, 'div'>;
|
|
28
28
|
/**
|
|
@@ -37,7 +37,7 @@ declare namespace Panel {
|
|
|
37
37
|
onMount: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
38
|
/** @private */
|
|
39
39
|
onUnmount: PropTypes.Requireable<(...args: any[]) => any>;
|
|
40
|
-
panelId: PropTypes.Validator<
|
|
40
|
+
panelId: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
export default Panel;
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Panel from './Panel';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface SlidingPanelsPropsBase {
|
|
6
|
-
activePanelId:
|
|
6
|
+
activePanelId: string | number;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
@@ -23,7 +23,7 @@ type SlidingPanelsProps = ComponentProps<SlidingPanelsPropsBase, 'div'>;
|
|
|
23
23
|
declare function SlidingPanels({ activePanelId, children, elementRef, innerClassName, innerStyle, onAnimationEnd, outerClassName, outerStyle, transition, ...otherProps }: SlidingPanelsProps): React.JSX.Element;
|
|
24
24
|
declare namespace SlidingPanels {
|
|
25
25
|
var propTypes: {
|
|
26
|
-
activePanelId: PropTypes.Validator<
|
|
26
|
+
activePanelId: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
27
27
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
28
28
|
elementRef: PropTypes.Requireable<object>;
|
|
29
29
|
innerClassName: PropTypes.Requireable<string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
declare class Basic extends Component<
|
|
2
|
+
declare class Basic extends Component<object, {
|
|
3
3
|
activePanelId: string;
|
|
4
4
|
transition: 'forward' | 'backward';
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
goBack: () => void;
|
|
8
8
|
goForward: () => void;
|
|
9
9
|
render(): React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
declare class DropdownExample extends Component<
|
|
2
|
+
declare class DropdownExample extends Component<object, {
|
|
3
3
|
activePanelId: string;
|
|
4
4
|
transition: 'forward' | 'backward';
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
goBack: () => void;
|
|
8
8
|
goForward: () => void;
|
|
9
9
|
render(): React.JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
+
/** @public */
|
|
5
|
+
type ItemClickHandler = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>, data: {
|
|
6
|
+
action?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
value?: any;
|
|
10
|
+
}) => void;
|
|
4
11
|
interface ItemPropsBase {
|
|
5
12
|
/**
|
|
6
13
|
* Changes the style if isMain=true, passed from SplitButton.
|
|
@@ -19,6 +26,10 @@ interface ItemPropsBase {
|
|
|
19
26
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
20
27
|
*/
|
|
21
28
|
elementRef?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
29
|
+
/**
|
|
30
|
+
* Applies an icon in front of the label.
|
|
31
|
+
*/
|
|
32
|
+
icon?: React.ReactNode;
|
|
22
33
|
/**
|
|
23
34
|
* Becomes the main button. If no `Item`s have this prop, the first `Item` is the main button.
|
|
24
35
|
*/
|
|
@@ -26,21 +37,23 @@ interface ItemPropsBase {
|
|
|
26
37
|
/**
|
|
27
38
|
* A callback for when an item is clicked.
|
|
28
39
|
*/
|
|
29
|
-
onClick?:
|
|
40
|
+
onClick?: ItemClickHandler;
|
|
30
41
|
}
|
|
31
42
|
type ItemProps = ComponentProps<ItemPropsBase, 'button'>;
|
|
32
43
|
/**
|
|
33
44
|
* An item within a `SplitButton`.
|
|
34
45
|
*/
|
|
35
|
-
declare function Item({ appearance, disabled, elementRef, isMain, children, onClick, ...otherProps }: ItemProps): React.JSX.Element;
|
|
46
|
+
declare function Item({ appearance, disabled, elementRef, icon: iconProp, isMain, children, onClick, ...otherProps }: ItemProps): React.JSX.Element;
|
|
36
47
|
declare namespace Item {
|
|
37
48
|
var propTypes: {
|
|
38
49
|
appearance: PropTypes.Requireable<string>;
|
|
39
50
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
51
|
disabled: PropTypes.Requireable<boolean>;
|
|
41
52
|
elementRef: PropTypes.Requireable<object>;
|
|
53
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
42
54
|
isMain: PropTypes.Requireable<boolean>;
|
|
43
55
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
56
|
};
|
|
45
57
|
}
|
|
46
58
|
export default Item;
|
|
59
|
+
export { ItemClickHandler };
|
|
@@ -13,7 +13,7 @@ interface StepPropsBase {
|
|
|
13
13
|
* A unique `id` for this step and used by the `StepBar` to keep track of the open `Step`.
|
|
14
14
|
* Defaults to a zero-based index matching the component's position in `StepBar`.
|
|
15
15
|
*/
|
|
16
|
-
stepId?:
|
|
16
|
+
stepId?: number;
|
|
17
17
|
}
|
|
18
18
|
type StepProps = ComponentProps<StepPropsBase, 'li'>;
|
|
19
19
|
declare function Step({ children, elementRef, error, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SwitchClickHandler } from '@splunk/react-ui/Switch';
|
|
3
|
-
declare class Basic extends Component<
|
|
3
|
+
declare class Basic extends Component<object, {
|
|
4
4
|
values: number[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleClick: SwitchClickHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SwitchClickHandler } from '@splunk/react-ui/Switch';
|
|
3
|
-
declare class Disabled extends Component<
|
|
3
|
+
declare class Disabled extends Component<object, {
|
|
4
4
|
values: number[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleClick: SwitchClickHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -8,8 +8,6 @@ type TabFocusHandler = (event: React.FocusEvent<HTMLButtonElement>, data: {
|
|
|
8
8
|
tabId: string;
|
|
9
9
|
}) => void;
|
|
10
10
|
interface TabPropsBase {
|
|
11
|
-
/** @private. Is the tab active. */
|
|
12
|
-
active?: boolean;
|
|
13
11
|
/**
|
|
14
12
|
* The ariaControls prop is the element `id` of the content displayed when the tab is selected.
|
|
15
13
|
*/
|
|
@@ -53,13 +51,16 @@ interface TabPropsBase {
|
|
|
53
51
|
* The `menu` prop is only supported in horizontal layout due to both design constraints as well as keyboard support.
|
|
54
52
|
*/
|
|
55
53
|
menu?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
* Internal prop injected by TabBar to track focus order.
|
|
57
|
+
*/
|
|
58
|
+
index?: number;
|
|
56
59
|
}
|
|
57
60
|
type TabProps = ComponentProps<TabPropsBase, 'div'>;
|
|
58
61
|
declare const Tab: {
|
|
59
|
-
({
|
|
62
|
+
({ ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, index, ...otherProps }: TabProps): React.JSX.Element;
|
|
60
63
|
propTypes: {
|
|
61
|
-
/** @private. Is the tab active. */
|
|
62
|
-
active: PropTypes.Requireable<boolean>;
|
|
63
64
|
ariaControls: PropTypes.Requireable<string>;
|
|
64
65
|
count: PropTypes.Requireable<number>;
|
|
65
66
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -79,7 +80,13 @@ declare const Tab: {
|
|
|
79
80
|
* The `menu` prop is only supported in horizontal layout due to both design constraints as well as keyboard support.
|
|
80
81
|
*/
|
|
81
82
|
menu: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
83
|
+
/**
|
|
84
|
+
* @private
|
|
85
|
+
* Internal prop injected by TabBar to track order.
|
|
86
|
+
*/
|
|
87
|
+
index: PropTypes.Requireable<number>;
|
|
82
88
|
};
|
|
89
|
+
as: string;
|
|
83
90
|
};
|
|
84
91
|
export default Tab;
|
|
85
92
|
export { TabClickHandler, TabFocusHandler };
|
|
@@ -21,17 +21,20 @@ interface TabBarPropsBase {
|
|
|
21
21
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
22
22
|
*/
|
|
23
23
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Position of icon in `TabBar.Tab` if it has an icon. Defaults to "left".
|
|
26
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
27
|
+
*/
|
|
25
28
|
iconPosition?: 'above' | 'left';
|
|
26
29
|
/** The layout of tabs. */
|
|
27
30
|
layout?: 'horizontal' | 'vertical';
|
|
31
|
+
/** Max width of each `TabBar.Tab` in pixels. Leave blank for auto max width. */
|
|
32
|
+
maxTabWidth?: number;
|
|
28
33
|
/** A callback that receives the event and data (`selectedTabId`). */
|
|
29
34
|
onChange?: TabBarChangeHandler;
|
|
30
|
-
/** Width of each `TabBar.Tab` in pixels. Must be greater than 50 pixels. Leave blank for auto width. */
|
|
31
|
-
tabWidth?: number;
|
|
32
35
|
}
|
|
33
36
|
type TabBarProps = ComponentProps<TabBarPropsBase, 'div'>;
|
|
34
|
-
declare function TabBar({ activeTabId, autoActivate, children, disabled, elementRef, iconPosition, layout,
|
|
37
|
+
declare function TabBar({ activeTabId, autoActivate, children, disabled, elementRef, iconPosition, layout, maxTabWidth, onChange, ...otherProps }: TabBarProps): React.JSX.Element;
|
|
35
38
|
declare namespace TabBar {
|
|
36
39
|
var propTypes: {
|
|
37
40
|
autoActivate: PropTypes.Requireable<boolean>;
|
|
@@ -42,13 +45,12 @@ declare namespace TabBar {
|
|
|
42
45
|
elementRef: PropTypes.Requireable<object>;
|
|
43
46
|
iconPosition: PropTypes.Requireable<string>;
|
|
44
47
|
layout: PropTypes.Requireable<string>;
|
|
48
|
+
maxTabWidth: PropTypes.Requireable<number>;
|
|
45
49
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
-
tabWidth: PropTypes.Requireable<number>;
|
|
47
50
|
};
|
|
48
51
|
var Tab: {
|
|
49
|
-
({
|
|
52
|
+
({ ariaControls, count, disabled, elementRef, icon, label, maxCount, tabId: tabIdProp, to, tooltip, menu, index, ...otherProps }: import("./Tab").TabPropsBase & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" | "css" | keyof import("./Tab").TabPropsBase>): React.JSX.Element;
|
|
50
53
|
propTypes: {
|
|
51
|
-
active: PropTypes.Requireable<boolean>;
|
|
52
54
|
ariaControls: PropTypes.Requireable<string>;
|
|
53
55
|
count: PropTypes.Requireable<number>;
|
|
54
56
|
disabled: PropTypes.Requireable<boolean>;
|
|
@@ -61,7 +63,9 @@ declare namespace TabBar {
|
|
|
61
63
|
to: PropTypes.Requireable<string>;
|
|
62
64
|
tooltip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
63
65
|
menu: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
66
|
+
index: PropTypes.Requireable<number>;
|
|
64
67
|
};
|
|
68
|
+
as: string;
|
|
65
69
|
};
|
|
66
70
|
}
|
|
67
71
|
export default TabBar;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DropdownRequestCloseHandler } from '@splunk/react-ui/Dropdown';
|
|
3
2
|
import type { TabClickHandler, TabFocusHandler } from './Tab';
|
|
4
3
|
export interface TabBarContext {
|
|
5
4
|
active?: string;
|
|
6
5
|
disabled?: boolean;
|
|
7
|
-
focusedTabId
|
|
6
|
+
focusedTabId?: string;
|
|
8
7
|
iconPosition?: 'above' | 'left';
|
|
9
8
|
layout?: 'horizontal' | 'vertical';
|
|
9
|
+
maxTabWidth?: number | null;
|
|
10
10
|
onClick?: TabClickHandler;
|
|
11
11
|
onFocus?: TabFocusHandler;
|
|
12
|
-
width?: number | null;
|
|
13
12
|
onMenuOpen: (menusTabId: string) => void;
|
|
14
13
|
onMenuClose: DropdownRequestCloseHandler;
|
|
15
14
|
isMenuOpen: boolean;
|
|
15
|
+
registerTab: ({ tabId, element, index, }: {
|
|
16
|
+
tabId: string;
|
|
17
|
+
element: HTMLButtonElement | HTMLAnchorElement | null;
|
|
18
|
+
index: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
activeTabId?: string;
|
|
16
21
|
}
|
|
17
22
|
export declare const TabBarContext: import("react").Context<TabBarContext>;
|
|
18
23
|
export default TabBarContext;
|
|
@@ -23,14 +23,17 @@ interface TabLayoutPropsBase {
|
|
|
23
23
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
24
24
|
*/
|
|
25
25
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Position of icon in `TabBar.Tab` if it has an icon. Defaults to "left".
|
|
28
|
+
* @deprecated This prop is deprecated and will be removed in the next major version.
|
|
29
|
+
*/
|
|
27
30
|
iconPosition?: 'above' | 'left';
|
|
28
31
|
/**
|
|
29
32
|
* The layout direction for tabs.
|
|
30
33
|
*/
|
|
31
34
|
layout?: 'horizontal' | 'vertical';
|
|
32
|
-
/**
|
|
33
|
-
|
|
35
|
+
/** Max width of each `TabBar.Tab` in pixels. Leave blank for auto max width. */
|
|
36
|
+
maxTabWidth?: number;
|
|
34
37
|
/**
|
|
35
38
|
* A callback that receives the event and data (`selectedPanelId`). If activePanelId is set,
|
|
36
39
|
* this callback is required.
|
|
@@ -55,7 +58,7 @@ type TabLayoutProps = ComponentProps<TabLayoutPropsBaseControlled | TabLayoutPro
|
|
|
55
58
|
* The `TabLayout` is a group of managed `Panels`. Only one panel can be open at a time.
|
|
56
59
|
* `TabLayout` supports both the controlled and uncontrolled patterns.
|
|
57
60
|
*/
|
|
58
|
-
declare function TabLayout({ autoActivate, activePanelId: activePanelIdProp, children, defaultActivePanelId, elementRef, iconPosition, layout,
|
|
61
|
+
declare function TabLayout({ autoActivate, activePanelId: activePanelIdProp, children, defaultActivePanelId, elementRef, iconPosition, layout, maxTabWidth, onChange, ...otherProps }: TabLayoutProps): React.JSX.Element;
|
|
59
62
|
declare namespace TabLayout {
|
|
60
63
|
var Panel: typeof import("./Panel").default;
|
|
61
64
|
var propTypes: {
|
|
@@ -66,8 +69,8 @@ declare namespace TabLayout {
|
|
|
66
69
|
elementRef: PropTypes.Requireable<object>;
|
|
67
70
|
iconPosition: PropTypes.Requireable<string>;
|
|
68
71
|
layout: PropTypes.Requireable<string>;
|
|
72
|
+
maxTabWidth: PropTypes.Requireable<number>;
|
|
69
73
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
|
-
tabWidth: PropTypes.Requireable<number>;
|
|
71
74
|
};
|
|
72
75
|
}
|
|
73
76
|
export default TabLayout;
|
|
@@ -3,15 +3,12 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { TableRequestMoveColumnHandler } from './Table';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
|
|
6
|
-
columnId
|
|
6
|
+
columnId?: string;
|
|
7
7
|
index: number;
|
|
8
8
|
}) => void;
|
|
9
|
-
type HeadDragStartHandler = (data: {
|
|
10
|
-
dragIndex?: number;
|
|
11
|
-
}) => void;
|
|
12
9
|
type HeadRequestMoveColumnHandler = TableRequestMoveColumnHandler;
|
|
13
10
|
type HeadRequestResizeColumnHandler = (event: React.KeyboardEvent<HTMLHRElement> | MouseEvent, data: {
|
|
14
|
-
columnId
|
|
11
|
+
columnId?: string;
|
|
15
12
|
id?: string;
|
|
16
13
|
index: number;
|
|
17
14
|
width: number;
|
|
@@ -32,16 +29,12 @@ interface HeadPropsBase {
|
|
|
32
29
|
*/
|
|
33
30
|
elementRef?: React.Ref<HTMLTableSectionElement>;
|
|
34
31
|
/** @private. */
|
|
35
|
-
guidelineIndex?: number;
|
|
36
|
-
/** @private. */
|
|
37
32
|
hasDragColumn?: boolean;
|
|
38
33
|
/** @private. */
|
|
39
34
|
hasInfoColumn?: boolean;
|
|
40
35
|
/** @private. */
|
|
41
36
|
onAutosizeColumn?: HeadAutosizeColumnHandler;
|
|
42
37
|
/** @private. */
|
|
43
|
-
onDragStart?: HeadDragStartHandler;
|
|
44
|
-
/** @private. */
|
|
45
38
|
onRequestMoveColumn?: HeadRequestMoveColumnHandler;
|
|
46
39
|
/** @private. */
|
|
47
40
|
onRequestResizeColumn?: HeadRequestResizeColumnHandler;
|
|
@@ -52,7 +45,7 @@ interface HeadPropsBase {
|
|
|
52
45
|
}
|
|
53
46
|
type HeadProps = ComponentProps<HeadPropsBase, 'thead'>;
|
|
54
47
|
declare const getCellWidths: (headEl: HTMLTableSectionElement | null) => number[];
|
|
55
|
-
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef,
|
|
48
|
+
declare function Head({ actions, actionsColumnWidth, cellMinWidth, children, elementRef, hasDragColumn, hasInfoColumn, onAutosizeColumn, onRequestMoveColumn, onRequestResizeColumn, onRequestToggleAllRows, rowSelection, ...otherProps }: HeadProps): React.JSX.Element;
|
|
56
49
|
declare namespace Head {
|
|
57
50
|
var propTypes: {
|
|
58
51
|
/** @private. */
|
|
@@ -64,16 +57,12 @@ declare namespace Head {
|
|
|
64
57
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
65
58
|
elementRef: PropTypes.Requireable<object>;
|
|
66
59
|
/** @private. */
|
|
67
|
-
guidelineIndex: PropTypes.Requireable<number>;
|
|
68
|
-
/** @private. */
|
|
69
60
|
hasDragColumn: PropTypes.Requireable<boolean>;
|
|
70
61
|
/** @private. */
|
|
71
62
|
hasInfoColumn: PropTypes.Requireable<boolean>;
|
|
72
63
|
/** @private. */
|
|
73
64
|
onAutosizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
65
|
/** @private. */
|
|
75
|
-
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
76
|
-
/** @private. */
|
|
77
66
|
onRequestMoveColumn: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
67
|
/** @private. */
|
|
79
68
|
onRequestResizeColumn: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -85,4 +74,4 @@ declare namespace Head {
|
|
|
85
74
|
var splunkUiType: string;
|
|
86
75
|
}
|
|
87
76
|
export default Head;
|
|
88
|
-
export { HeadAutosizeColumnHandler,
|
|
77
|
+
export { HeadAutosizeColumnHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler, getCellWidths, };
|