@splunk/react-ui 5.0.0-beta.3 → 5.0.0-beta.4
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 +1 -1
- package/ButtonSimple.js +47 -41
- package/CHANGELOG.md +12 -2
- package/CHANGELOG.v5.mdx +38 -0
- package/Calendar.js +352 -469
- package/Chip.js +149 -280
- package/Code.js +19 -12
- package/Color.js +32 -32
- package/ComboBox.js +8 -6
- package/Date.js +1 -1
- package/DualListbox.js +298 -296
- package/File.js +294 -281
- package/FormRows.js +165 -153
- package/Image.js +124 -251
- package/Layout.d.ts +2 -0
- package/MIGRATION.v5.mdx +1 -1
- package/Menu.js +1 -1
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +2 -2
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1978 -2323
- package/NonInteractiveCheckbox.js +29 -117
- package/Number.js +114 -114
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Scroll.js +2 -2
- package/Select.js +236 -240
- package/SidePanel.js +17 -21
- package/Slider.js +366 -370
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +39 -25
- package/StepBar.js +1 -1
- package/Switch.js +70 -64
- package/TabBar.js +544 -417
- package/Table.js +1580 -1434
- package/Text.js +34 -34
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +2 -2
- package/package.json +7 -9
- 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/CardLayout/CardLayoutContext.d.ts +0 -1
- package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +1 -1
- 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/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/MessageBar/MessageBar.d.ts +5 -1
- 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 +70 -30
- package/types/src/Multiselect/Normal.d.ts +46 -57
- package/types/src/Multiselect/Option.d.ts +42 -18
- package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
- package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
- 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/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 +2 -2
- 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 +3 -2
- package/types/src/TabBar/TabBarContext.d.ts +7 -2
- 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/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/Image/icons/Cross.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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler, RowRequestRemoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
3
|
import { SelectChangeHandler } from '@splunk/react-ui/Select';
|
|
4
|
-
declare class Menu extends Component<
|
|
4
|
+
declare class Menu extends Component<object, {
|
|
5
5
|
items: React.ReactElement[];
|
|
6
6
|
}> {
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleRequestAdd: SelectChangeHandler;
|
|
9
9
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
10
10
|
handleRequestRemove: RowRequestRemoveHandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
|
-
declare class ReorderOnly extends Component<
|
|
3
|
+
declare class ReorderOnly extends Component<object, {
|
|
4
4
|
items: React.ReactElement[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -26,8 +26,6 @@ interface ImagePropsBase {
|
|
|
26
26
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
27
27
|
/** Show the component in an error state. */
|
|
28
28
|
error?: boolean;
|
|
29
|
-
/** The max-height of the preview in pixels. */
|
|
30
|
-
maxHeight?: number;
|
|
31
29
|
/** A callback for when the image changes. The function is passed an
|
|
32
30
|
* object containing two keys: `filename` and `imageDataURI`. Both are
|
|
33
31
|
* `null` if the image was removed. */
|
|
@@ -38,7 +36,7 @@ declare const isAllowedFilename: (filename: string, allowExtensions: string[]) =
|
|
|
38
36
|
/**
|
|
39
37
|
* Image provides the ability to accept image files and present a preview of the image.
|
|
40
38
|
*/
|
|
41
|
-
declare function Image({ allowExtensions, defaultFilename: defaultFilenameProp, defaultImageDataURI, disabled, error,
|
|
39
|
+
declare function Image({ allowExtensions, defaultFilename: defaultFilenameProp, defaultImageDataURI, disabled, error, onImageChange, ...otherProps }: ImageProps): React.JSX.Element;
|
|
42
40
|
declare namespace Image {
|
|
43
41
|
var propTypes: {
|
|
44
42
|
allowExtensions: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
@@ -48,7 +46,6 @@ declare namespace Image {
|
|
|
48
46
|
dropAnywhere: PropTypes.Requireable<boolean>;
|
|
49
47
|
elementRef: PropTypes.Requireable<object>;
|
|
50
48
|
error: PropTypes.Requireable<boolean>;
|
|
51
|
-
maxHeight: PropTypes.Requireable<number>;
|
|
52
49
|
onImageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
50
|
};
|
|
54
51
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { JSONTreeClickValueHandler, JSONTreeClickKeyHandler } from '@splunk/react-ui/JSONTree';
|
|
3
|
-
declare class Events extends Component<
|
|
3
|
+
declare class Events extends Component<object, {
|
|
4
4
|
key: string;
|
|
5
5
|
keyPath?: (string | number)[];
|
|
6
6
|
value: string;
|
|
7
7
|
}> {
|
|
8
|
-
constructor(props:
|
|
8
|
+
constructor(props: object);
|
|
9
9
|
onClickJSONValue: JSONTreeClickValueHandler;
|
|
10
10
|
onClickJSONKey: JSONTreeClickKeyHandler;
|
|
11
11
|
render(): React.JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const External: import("styled-components").StyledComponent<({ children, variant, ...otherprops }: import("@splunk/react-icons/ArrowSquareTopRightInset").IconBaseProps) => import("react").JSX.Element | null, any, {}, never>;
|
|
1
|
+
declare const External: import("styled-components").StyledComponent<({ children, variant, ...otherprops }: import("@splunk/react-icons/ArrowSquareTopRightInset").IconBaseProps) => React.JSX.Element | null, any, import("@splunk/themes").OptionalThemedProps<import("@splunk/themes").AnyTheme>, never>;
|
|
3
2
|
export default External;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentProps } from '../utils/types';
|
|
3
|
-
type DividerProps = ComponentProps<
|
|
3
|
+
type DividerProps = ComponentProps<object, 'div'>;
|
|
4
4
|
/**
|
|
5
5
|
* A non-interactive menu item used to visually separate groups of items in the menu.
|
|
6
6
|
*/
|
|
@@ -6,6 +6,10 @@ interface MessageBarPropsBase {
|
|
|
6
6
|
* Text is required and should be concise.
|
|
7
7
|
*/
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
11
|
+
*/
|
|
12
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
9
13
|
/**
|
|
10
14
|
* Includes a close button. Always consider including a close button.
|
|
11
15
|
*/
|
|
@@ -16,7 +20,7 @@ interface MessageBarPropsBase {
|
|
|
16
20
|
type: 'info' | 'warning' | 'error' | 'success';
|
|
17
21
|
}
|
|
18
22
|
type MessageBarProps = ComponentProps<MessageBarPropsBase, 'div'>;
|
|
19
|
-
declare function MessageBar({ children,
|
|
23
|
+
declare function MessageBar({ children, elementRef, onRequestClose, type, ...otherProps }: MessageBarProps): React.JSX.Element;
|
|
20
24
|
declare namespace MessageBar {
|
|
21
25
|
var propTypes: {
|
|
22
26
|
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from './Multiselect';
|
|
4
|
-
import Option from './Option';
|
|
5
4
|
import { SelectBaseProps } from '../Select/SelectBase';
|
|
6
|
-
import {
|
|
5
|
+
import { ComponentProps } from '../utils/types';
|
|
7
6
|
interface CompactPropsBase {
|
|
8
7
|
animateLoading?: boolean;
|
|
9
8
|
/**
|
|
@@ -151,23 +150,49 @@ interface CompactPropsBase {
|
|
|
151
150
|
/** @private */
|
|
152
151
|
toggle?: SelectBaseProps['toggle'];
|
|
153
152
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
153
|
+
type CompactProps = ComponentProps<CompactPropsBase, 'button'>;
|
|
154
|
+
declare function Compact({ allowNewValues, animateLoading, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, filter, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onOpen, onScroll, onScrollBottom, placeholder, repositionMode, selectAllAppearance, showSelectedValuesFirst, tabConfirmsNewValue, values, virtualization, ...otherProps }: CompactProps): React.JSX.Element;
|
|
155
|
+
declare namespace Compact {
|
|
156
|
+
var propTypes: {
|
|
157
|
+
allowNewValues: PropTypes.Requireable<boolean>;
|
|
158
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
159
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
160
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
161
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
162
|
+
defaultValues: PropTypes.Requireable<any[]>;
|
|
163
|
+
describedBy: PropTypes.Requireable<string>;
|
|
164
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
165
|
+
elementRef: PropTypes.Requireable<object>;
|
|
166
|
+
error: PropTypes.Requireable<boolean>;
|
|
167
|
+
filter: PropTypes.Requireable<string | boolean>;
|
|
168
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
169
|
+
inline: PropTypes.Requireable<boolean>;
|
|
170
|
+
inputId: PropTypes.Requireable<string>;
|
|
171
|
+
inputRef: PropTypes.Requireable<object>;
|
|
172
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
173
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
174
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
175
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
176
|
+
name: PropTypes.Requireable<string>;
|
|
177
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
178
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
179
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
180
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
181
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
182
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
183
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
184
|
+
placeholder: PropTypes.Requireable<string>;
|
|
185
|
+
repositionMode: PropTypes.Requireable<string>;
|
|
186
|
+
selectAllAppearance: PropTypes.Requireable<string>;
|
|
187
|
+
showSelectedValuesFirst: PropTypes.Requireable<string>;
|
|
188
|
+
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
189
|
+
values: PropTypes.Requireable<any[]>;
|
|
190
|
+
/** @private */
|
|
191
|
+
virtualization: PropTypes.Requireable<number>;
|
|
192
|
+
};
|
|
193
|
+
var Option: typeof import("./Option").default;
|
|
194
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
195
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
171
196
|
}
|
|
172
197
|
export default Compact;
|
|
173
198
|
export { CompactPropsBase };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import { Heading, Divider } from '@splunk/react-ui/Menu';
|
|
3
4
|
import { SelectBaseChangeReason } from '@splunk/react-ui/Select/SelectBase';
|
|
4
5
|
import { CompactPropsBase } from './Compact';
|
|
5
6
|
import Option from './Option';
|
|
6
|
-
import {
|
|
7
|
+
import { ComponentProps } from '../utils/types';
|
|
7
8
|
/** @public */
|
|
8
9
|
type MultiselectFilterChangeHandler = (event: React.ChangeEvent<HTMLInputElement> | React.FocusEvent<HTMLInputElement> | React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent, data: {
|
|
9
10
|
keyword: string;
|
|
@@ -17,11 +18,11 @@ type MultiselectChangeHandler = (event: React.MouseEvent<HTMLButtonElement> | Re
|
|
|
17
18
|
/** @public */
|
|
18
19
|
type MultiselectScrollBottomHandler = (event: React.UIEvent<HTMLDivElement> | React.KeyboardEvent<HTMLInputElement> | null) => void;
|
|
19
20
|
interface MultiselectPropsBase {
|
|
20
|
-
animateLoading?: boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Allow the user to add arbitrary values.
|
|
23
23
|
*/
|
|
24
24
|
allowNewValues?: boolean;
|
|
25
|
+
animateLoading?: boolean;
|
|
25
26
|
/**
|
|
26
27
|
* When compact, options are shown as checkboxes and the input is a single line. This is
|
|
27
28
|
* useful when placing the Multiselect in a horizontal bar, such as a filter.
|
|
@@ -97,13 +98,15 @@ interface MultiselectPropsBase {
|
|
|
97
98
|
* the menu should it need to be wider than the toggle Button. */
|
|
98
99
|
menuStyle?: React.CSSProperties;
|
|
99
100
|
/** The name is returned with onChange events, which can be used to identify the
|
|
100
|
-
* control when multiple controls share an onChange callback.
|
|
101
|
+
* control when multiple controls share an onChange callback.
|
|
102
|
+
*/
|
|
101
103
|
name?: string;
|
|
102
104
|
/**
|
|
103
105
|
* The noOptionsMessage is shown when there are no children and it's not loading, such as when
|
|
104
106
|
* there are no Options matching the filter. This can be customized to the type of content,
|
|
105
107
|
* for example: "No matching dashboards". You can insert other content, such as an error message, or
|
|
106
|
-
* communicate a minimum number of characters to enter to see results.
|
|
108
|
+
* communicate a minimum number of characters to enter to see results.
|
|
109
|
+
*/
|
|
107
110
|
noOptionsMessage?: React.ReactNode;
|
|
108
111
|
/**
|
|
109
112
|
* A callback to receive the change events. If values is set, this callback is required.
|
|
@@ -111,31 +114,31 @@ interface MultiselectPropsBase {
|
|
|
111
114
|
*/
|
|
112
115
|
onChange?: MultiselectChangeHandler;
|
|
113
116
|
/**
|
|
114
|
-
* A callback function invoked when the
|
|
115
|
-
*/
|
|
116
|
-
onScroll?: React.UIEventHandler<Element>;
|
|
117
|
-
/**
|
|
118
|
-
* A callback function for loading additional list items.
|
|
119
|
-
* Called when the list is scrolled to the bottom or all items in the list are visible.
|
|
120
|
-
* This is called with an event argument if this is the result of a scroll.
|
|
121
|
-
*
|
|
122
|
-
* This should be set this to `null` when all items are loaded.
|
|
117
|
+
* A callback function invoked when the popover closes.
|
|
123
118
|
*/
|
|
124
|
-
|
|
119
|
+
onClose?: () => void;
|
|
125
120
|
/**
|
|
126
121
|
* A callback with the change event and value of the filter box. Providing this callback and
|
|
127
122
|
* setting controlledFilter to true enables you to filter and update the children by other
|
|
128
123
|
* criteria.
|
|
129
124
|
*/
|
|
130
125
|
onFilterChange?: MultiselectFilterChangeHandler;
|
|
131
|
-
/**
|
|
132
|
-
* A callback function invoked when the popover closes.
|
|
133
|
-
*/
|
|
134
|
-
onClose?: () => void;
|
|
135
126
|
/**
|
|
136
127
|
* A callback function invoked when the popover opens.
|
|
137
128
|
*/
|
|
138
129
|
onOpen?: () => void;
|
|
130
|
+
/**
|
|
131
|
+
* A callback function invoked when the menu is scrolled.
|
|
132
|
+
*/
|
|
133
|
+
onScroll?: React.UIEventHandler<Element>;
|
|
134
|
+
/**
|
|
135
|
+
* A callback function for loading additional list items.
|
|
136
|
+
* Called when the list is scrolled to the bottom or all items in the list are visible.
|
|
137
|
+
* This is called with an event argument if this is the result of a scroll.
|
|
138
|
+
*
|
|
139
|
+
* This should be set this to `null` when all items are loaded.
|
|
140
|
+
*/
|
|
141
|
+
onScrollBottom?: MultiselectScrollBottomHandler;
|
|
139
142
|
/**
|
|
140
143
|
* If 'value' is undefined or doesn't match an item, the Button will display this text.
|
|
141
144
|
*/
|
|
@@ -177,7 +180,6 @@ interface MultiselectPropsBase {
|
|
|
177
180
|
*/
|
|
178
181
|
virtualization?: number;
|
|
179
182
|
}
|
|
180
|
-
declare const defaultProps: Required<Pick<MultiselectPropsBase, 'allowNewValues' | 'animateLoading' | 'compact' | 'defaultPlacement' | 'disabled' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'noOptionsMessage' | 'placeholder' | 'repositionMode' | 'tabConfirmsNewValue' | 'useClickawayOverlay'>>;
|
|
181
183
|
interface MultiselectPropsBaseControlled extends MultiselectPropsBase {
|
|
182
184
|
defaultValues?: never;
|
|
183
185
|
onChange: MultiselectChangeHandler;
|
|
@@ -199,17 +201,55 @@ interface MultiselectPropsBaseCompact extends MultiselectPropsBase {
|
|
|
199
201
|
/** @private */
|
|
200
202
|
toggle?: CompactPropsBase['toggle'];
|
|
201
203
|
}
|
|
202
|
-
type MultiselectNormalProps =
|
|
203
|
-
type MultiselectCompactProps =
|
|
204
|
+
type MultiselectNormalProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseNormal, 'div'>;
|
|
205
|
+
type MultiselectCompactProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseCompact, 'button'>;
|
|
204
206
|
type MultiselectProps = MultiselectNormalProps | MultiselectCompactProps;
|
|
205
|
-
declare
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
declare function Multiselect({ allowNewValues, animateLoading, compact, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, filter, footerMessage, inline, inputId, inputRef, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onOpen, onScroll, onScrollBottom, placeholder, repositionMode, selectAllAppearance, showSelectedValuesFirst, tabConfirmsNewValue, useClickawayOverlay, values, virtualization, ...otherProps }: MultiselectProps): React.JSX.Element;
|
|
208
|
+
declare namespace Multiselect {
|
|
209
|
+
var componentType: string;
|
|
210
|
+
var Option: typeof import("./Option").default;
|
|
211
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
212
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
213
|
+
var propTypes: {
|
|
214
|
+
allowNewValues: PropTypes.Requireable<boolean>;
|
|
215
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
216
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
217
|
+
compact: PropTypes.Requireable<boolean>;
|
|
218
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
219
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
220
|
+
defaultValues: PropTypes.Requireable<any[]>;
|
|
221
|
+
describedBy: PropTypes.Requireable<string>;
|
|
222
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
223
|
+
elementRef: PropTypes.Requireable<object>;
|
|
224
|
+
error: PropTypes.Requireable<boolean>;
|
|
225
|
+
filter: PropTypes.Requireable<string | boolean>;
|
|
226
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
227
|
+
inline: PropTypes.Requireable<boolean>;
|
|
228
|
+
inputId: PropTypes.Requireable<string>;
|
|
229
|
+
inputRef: PropTypes.Requireable<object>;
|
|
230
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
231
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
232
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
233
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
234
|
+
name: PropTypes.Requireable<string>;
|
|
235
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
236
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
237
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
238
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
239
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
240
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
241
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
242
|
+
placeholder: PropTypes.Requireable<string>;
|
|
243
|
+
repositionMode: PropTypes.Requireable<string>;
|
|
244
|
+
selectAllAppearance: PropTypes.Requireable<string>;
|
|
245
|
+
showSelectedValuesFirst: PropTypes.Requireable<string>;
|
|
246
|
+
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
247
|
+
useClickawayOverlay: PropTypes.Requireable<boolean>;
|
|
248
|
+
values: PropTypes.Requireable<any[]>;
|
|
249
|
+
/** @private */
|
|
250
|
+
virtualization: PropTypes.Requireable<number>;
|
|
251
|
+
};
|
|
213
252
|
}
|
|
214
253
|
export default Multiselect;
|
|
215
254
|
export { Divider, Heading, MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler, Option, };
|
|
255
|
+
export type { MultiselectPropsBase, MultiselectProps };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from './Multiselect';
|
|
4
|
-
import
|
|
5
|
-
import { ClassComponentProps } from '../utils/types';
|
|
4
|
+
import { ComponentProps } from '../utils/types';
|
|
6
5
|
interface NormalPropsBase {
|
|
7
|
-
animateLoading?: boolean;
|
|
8
6
|
/**
|
|
9
7
|
* Allow the user to add arbitrary values.
|
|
10
8
|
*/
|
|
11
9
|
allowNewValues?: boolean;
|
|
10
|
+
animateLoading?: boolean;
|
|
12
11
|
/**
|
|
13
12
|
* `children` should be `Multiselect.Option`, `Multiselect.Heading`, or
|
|
14
13
|
* `Multiselect.Divider`.
|
|
@@ -127,57 +126,47 @@ interface NormalPropsBase {
|
|
|
127
126
|
*/
|
|
128
127
|
values?: (string | number | boolean)[];
|
|
129
128
|
}
|
|
130
|
-
declare const
|
|
131
|
-
type NormalProps =
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Place focus on the text input.
|
|
174
|
-
*/
|
|
175
|
-
focus(): void;
|
|
176
|
-
private addValue;
|
|
177
|
-
private removeValue;
|
|
178
|
-
private renderButtons;
|
|
179
|
-
private renderMenu;
|
|
180
|
-
private getSelectedItemsContent;
|
|
181
|
-
render(): React.JSX.Element;
|
|
129
|
+
export declare const getInlineMenuStyle: (({ anchorWidth, maxHeight, menuStyle }: any) => any) & import("lodash").MemoizedFunction;
|
|
130
|
+
type NormalProps = ComponentProps<NormalPropsBase, 'div'>;
|
|
131
|
+
declare function Normal({ allowNewValues, animateLoading, children, controlledFilter, defaultPlacement, defaultValues, describedBy, disabled, elementRef, error, footerMessage, inline, inputId, inputRef: inputRefProp, isLoadingOptions, labelledBy, loadingMessage, menuStyle, name, noOptionsMessage, onChange, onClose, onFilterChange, onScroll, onScrollBottom, onOpen, placeholder, required, repositionMode, tabConfirmsNewValue, useClickawayOverlay, values, ...otherProps }: NormalProps): React.JSX.Element;
|
|
132
|
+
declare namespace Normal {
|
|
133
|
+
var propTypes: {
|
|
134
|
+
allowNewValues: PropTypes.Requireable<boolean>;
|
|
135
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
136
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
137
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
138
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
139
|
+
defaultValues: PropTypes.Requireable<any[]>;
|
|
140
|
+
describedBy: PropTypes.Requireable<string>;
|
|
141
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
142
|
+
elementRef: PropTypes.Requireable<object>;
|
|
143
|
+
error: PropTypes.Requireable<boolean>;
|
|
144
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
145
|
+
inline: PropTypes.Requireable<boolean>;
|
|
146
|
+
inputId: PropTypes.Requireable<string>;
|
|
147
|
+
inputRef: PropTypes.Requireable<object>;
|
|
148
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
149
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
150
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
151
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
152
|
+
name: PropTypes.Requireable<string>;
|
|
153
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
154
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
155
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
156
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
157
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
158
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
159
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
160
|
+
placeholder: PropTypes.Requireable<string>;
|
|
161
|
+
/** @private. */
|
|
162
|
+
required: PropTypes.Requireable<boolean>;
|
|
163
|
+
repositionMode: PropTypes.Requireable<string>;
|
|
164
|
+
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
165
|
+
useClickawayOverlay: PropTypes.Requireable<boolean>;
|
|
166
|
+
values: PropTypes.Requireable<any[]>;
|
|
167
|
+
};
|
|
168
|
+
var Option: typeof import("./Option").default;
|
|
169
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
170
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
182
171
|
}
|
|
183
172
|
export default Normal;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ComponentProps } from '../utils/types';
|
|
3
4
|
type OptionClickHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
|
|
4
5
|
value: string | number | boolean;
|
|
5
6
|
}) => void;
|
|
@@ -28,6 +29,10 @@ interface OptionPropsBase {
|
|
|
28
29
|
* If disabled=true, the option is grayed out and cannot be clicked.
|
|
29
30
|
*/
|
|
30
31
|
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
34
|
+
*/
|
|
35
|
+
elementRef?: React.Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
31
36
|
/**
|
|
32
37
|
* Adding hidden options can be useful for resolving the selected display label and icon,
|
|
33
38
|
* when the option should not be in the list. This scenario can arise when Select's filter is
|
|
@@ -77,24 +82,43 @@ interface OptionPropsBase {
|
|
|
77
82
|
*/
|
|
78
83
|
value: string | number | boolean;
|
|
79
84
|
}
|
|
80
|
-
|
|
81
|
-
type OptionProps = ClassComponentProps<OptionPropsBase, typeof defaultProps, 'button'>;
|
|
85
|
+
type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
82
86
|
/**
|
|
83
|
-
* An option within a `Multiselect`.
|
|
84
|
-
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
85
|
-
* so any elements passed to it must also be pure.
|
|
87
|
+
* An option within a `Multiselect`.
|
|
86
88
|
*/
|
|
87
|
-
declare
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
declare function Option({ compact, children, description, descriptionPosition, disabled, elementRef, hidden, icon, label, matchRanges, role, selected, truncate, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
90
|
+
declare namespace Option {
|
|
91
|
+
var propTypes: {
|
|
92
|
+
/** @private */
|
|
93
|
+
active: PropTypes.Requireable<boolean>;
|
|
94
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
95
|
+
/**
|
|
96
|
+
* @private this is passed down from Multiselect.
|
|
97
|
+
*/
|
|
98
|
+
compact: PropTypes.Requireable<boolean>;
|
|
99
|
+
description: PropTypes.Requireable<string>;
|
|
100
|
+
descriptionPosition: PropTypes.Requireable<string>;
|
|
101
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
102
|
+
elementRef: PropTypes.Requireable<object>;
|
|
103
|
+
hidden: PropTypes.Requireable<boolean>;
|
|
104
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
105
|
+
label: PropTypes.Validator<string>;
|
|
106
|
+
matchRanges: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
107
|
+
start: PropTypes.Validator<number>;
|
|
108
|
+
end: PropTypes.Validator<number>;
|
|
109
|
+
}> | null | undefined)[]>;
|
|
110
|
+
/** @private */
|
|
111
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
112
|
+
/** @private */
|
|
113
|
+
role: PropTypes.Requireable<string>;
|
|
114
|
+
/** @private */
|
|
115
|
+
selected: PropTypes.Requireable<boolean>;
|
|
116
|
+
selectedAppearance: PropTypes.Requireable<string>;
|
|
117
|
+
selectedBackgroundColor: PropTypes.Requireable<string>;
|
|
118
|
+
selectedForegroundColor: PropTypes.Requireable<string>;
|
|
119
|
+
truncate: PropTypes.Requireable<boolean>;
|
|
120
|
+
value: PropTypes.Validator<NonNullable<NonNullable<string | number | boolean | null | undefined>>>;
|
|
121
|
+
};
|
|
98
122
|
}
|
|
99
123
|
export default Option;
|
|
100
124
|
export { OptionClickHandler };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { MultiselectChangeHandler } from '@splunk/react-ui/Multiselect';
|
|
3
|
-
declare class Children extends Component<
|
|
3
|
+
declare class Children extends Component<object, {
|
|
4
4
|
values: (string | number | boolean)[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: MultiselectChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { MultiselectChangeHandler } from '@splunk/react-ui/Multiselect';
|
|
3
|
-
declare class Controlled extends Component<
|
|
3
|
+
declare class Controlled extends Component<object, {
|
|
4
4
|
values: (string | number | boolean)[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: MultiselectChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { MultiselectChangeHandler } from '@splunk/react-ui/Multiselect';
|
|
3
|
-
declare class CustomizeSelected extends Component<
|
|
3
|
+
declare class CustomizeSelected extends Component<object, {
|
|
4
4
|
values: (string | number | boolean)[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: MultiselectChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { MultiselectChangeHandler } from '@splunk/react-ui/Multiselect';
|
|
3
|
-
declare class Disabled extends Component<
|
|
3
|
+
declare class Disabled extends Component<object, {
|
|
4
4
|
values: (string | number | boolean)[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: MultiselectChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { MultiselectChangeHandler } from '@splunk/react-ui/Multiselect';
|
|
3
|
-
declare class MultiselectError extends Component<
|
|
3
|
+
declare class MultiselectError extends Component<object, {
|
|
4
4
|
values: (string | number | boolean)[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: MultiselectChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|