@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,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
|
*/
|
|
@@ -158,12 +161,6 @@ interface MultiselectPropsBase {
|
|
|
158
161
|
showSelectedValuesFirst?: 'nextOpen' | 'immediately' | 'never';
|
|
159
162
|
/** Pressing Tab while entering an input confirms the new value. Requires `allowNewValues`. */
|
|
160
163
|
tabConfirmsNewValue?: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Specifies whether or not to add an overlay div to clickaway from the popover. This is
|
|
163
|
-
* to avoid cases where some other element is accidentally clicked when the popover is open.
|
|
164
|
-
* Note: This only works with the Normal multiselect.
|
|
165
|
-
*/
|
|
166
|
-
useClickawayOverlay?: boolean;
|
|
167
164
|
/**
|
|
168
165
|
* Value will be matched to one of the children to deduce the label and/or icon for the
|
|
169
166
|
* toggle.
|
|
@@ -177,7 +174,6 @@ interface MultiselectPropsBase {
|
|
|
177
174
|
*/
|
|
178
175
|
virtualization?: number;
|
|
179
176
|
}
|
|
180
|
-
declare const defaultProps: Required<Pick<MultiselectPropsBase, 'allowNewValues' | 'animateLoading' | 'compact' | 'defaultPlacement' | 'disabled' | 'inline' | 'isLoadingOptions' | 'menuStyle' | 'noOptionsMessage' | 'placeholder' | 'repositionMode' | 'tabConfirmsNewValue' | 'useClickawayOverlay'>>;
|
|
181
177
|
interface MultiselectPropsBaseControlled extends MultiselectPropsBase {
|
|
182
178
|
defaultValues?: never;
|
|
183
179
|
onChange: MultiselectChangeHandler;
|
|
@@ -199,17 +195,54 @@ interface MultiselectPropsBaseCompact extends MultiselectPropsBase {
|
|
|
199
195
|
/** @private */
|
|
200
196
|
toggle?: CompactPropsBase['toggle'];
|
|
201
197
|
}
|
|
202
|
-
type MultiselectNormalProps =
|
|
203
|
-
type MultiselectCompactProps =
|
|
198
|
+
type MultiselectNormalProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseNormal, 'div'>;
|
|
199
|
+
type MultiselectCompactProps = ComponentProps<(MultiselectPropsBaseControlled | MultiselectPropsBaseUncontrolled) & MultiselectPropsBaseCompact, 'button'>;
|
|
204
200
|
type MultiselectProps = MultiselectNormalProps | MultiselectCompactProps;
|
|
205
|
-
declare
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
201
|
+
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, values, virtualization, ...otherProps }: MultiselectProps): React.JSX.Element;
|
|
202
|
+
declare namespace Multiselect {
|
|
203
|
+
var componentType: string;
|
|
204
|
+
var Option: typeof import("./Option").default;
|
|
205
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
206
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
207
|
+
var propTypes: {
|
|
208
|
+
allowNewValues: PropTypes.Requireable<boolean>;
|
|
209
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
210
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
211
|
+
compact: PropTypes.Requireable<boolean>;
|
|
212
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
213
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
214
|
+
defaultValues: PropTypes.Requireable<any[]>;
|
|
215
|
+
describedBy: PropTypes.Requireable<string>;
|
|
216
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
217
|
+
elementRef: PropTypes.Requireable<object>;
|
|
218
|
+
error: PropTypes.Requireable<boolean>;
|
|
219
|
+
filter: PropTypes.Requireable<string | boolean>;
|
|
220
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
221
|
+
inline: PropTypes.Requireable<boolean>;
|
|
222
|
+
inputId: PropTypes.Requireable<string>;
|
|
223
|
+
inputRef: PropTypes.Requireable<object>;
|
|
224
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
225
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
226
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
227
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
228
|
+
name: PropTypes.Requireable<string>;
|
|
229
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
230
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
231
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
232
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
233
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
234
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
235
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
236
|
+
placeholder: PropTypes.Requireable<string>;
|
|
237
|
+
repositionMode: PropTypes.Requireable<string>;
|
|
238
|
+
selectAllAppearance: PropTypes.Requireable<string>;
|
|
239
|
+
showSelectedValuesFirst: PropTypes.Requireable<string>;
|
|
240
|
+
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
241
|
+
values: PropTypes.Requireable<any[]>;
|
|
242
|
+
/** @private */
|
|
243
|
+
virtualization: PropTypes.Requireable<number>;
|
|
244
|
+
};
|
|
213
245
|
}
|
|
214
246
|
export default Multiselect;
|
|
215
247
|
export { Divider, Heading, MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler, Option, };
|
|
248
|
+
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`.
|
|
@@ -116,68 +115,52 @@ interface NormalPropsBase {
|
|
|
116
115
|
repositionMode?: 'none' | 'flip';
|
|
117
116
|
/** Pressing tab while entering an input confirms the new value. Requires `allowNewValues`. */
|
|
118
117
|
tabConfirmsNewValue?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Specifies whether or not to add a overlay div to clickaway from the popover. This is
|
|
121
|
-
* to avoid cases where some other element is accidentally clicked when the popover is open
|
|
122
|
-
*/
|
|
123
|
-
useClickawayOverlay?: boolean;
|
|
124
118
|
/**
|
|
125
119
|
* Value will be matched to one of the children to deduce the label and/or icon for the
|
|
126
120
|
* toggle. An `onChange` callback is required.
|
|
127
121
|
*/
|
|
128
122
|
values?: (string | number | boolean)[];
|
|
129
123
|
}
|
|
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
|
-
private isControlled;
|
|
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;
|
|
124
|
+
export declare const getInlineMenuStyle: (({ anchorWidth, maxHeight, menuStyle }: any) => any) & import("lodash").MemoizedFunction;
|
|
125
|
+
type NormalProps = ComponentProps<NormalPropsBase, 'div'>;
|
|
126
|
+
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, values, ...otherProps }: NormalProps): React.JSX.Element;
|
|
127
|
+
declare namespace Normal {
|
|
128
|
+
var propTypes: {
|
|
129
|
+
allowNewValues: PropTypes.Requireable<boolean>;
|
|
130
|
+
animateLoading: PropTypes.Requireable<boolean>;
|
|
131
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
132
|
+
controlledFilter: PropTypes.Requireable<boolean>;
|
|
133
|
+
defaultPlacement: PropTypes.Requireable<string>;
|
|
134
|
+
defaultValues: PropTypes.Requireable<any[]>;
|
|
135
|
+
describedBy: PropTypes.Requireable<string>;
|
|
136
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
137
|
+
elementRef: PropTypes.Requireable<object>;
|
|
138
|
+
error: PropTypes.Requireable<boolean>;
|
|
139
|
+
footerMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
140
|
+
inline: PropTypes.Requireable<boolean>;
|
|
141
|
+
inputId: PropTypes.Requireable<string>;
|
|
142
|
+
inputRef: PropTypes.Requireable<object>;
|
|
143
|
+
isLoadingOptions: PropTypes.Requireable<boolean>;
|
|
144
|
+
labelledBy: PropTypes.Requireable<string>;
|
|
145
|
+
loadingMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
146
|
+
menuStyle: PropTypes.Requireable<object>;
|
|
147
|
+
name: PropTypes.Requireable<string>;
|
|
148
|
+
noOptionsMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
149
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
150
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
151
|
+
onFilterChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
152
|
+
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
153
|
+
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
154
|
+
onScrollBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
155
|
+
placeholder: PropTypes.Requireable<string>;
|
|
156
|
+
/** @private. */
|
|
157
|
+
required: PropTypes.Requireable<boolean>;
|
|
158
|
+
repositionMode: PropTypes.Requireable<string>;
|
|
159
|
+
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
160
|
+
values: PropTypes.Requireable<any[]>;
|
|
161
|
+
};
|
|
162
|
+
var Option: typeof import("./Option").default;
|
|
163
|
+
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
164
|
+
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
182
165
|
}
|
|
183
166
|
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,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Children extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Children(): React.JSX.Element;
|
|
10
3
|
export default Children;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Controlled extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Controlled(): React.JSX.Element;
|
|
10
3
|
export default Controlled;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class CustomizeSelected extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function CustomizeSelected(): React.JSX.Element;
|
|
10
3
|
export default CustomizeSelected;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class Disabled extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Disabled(): React.JSX.Element;
|
|
10
3
|
export default Disabled;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class MultiselectError extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function MultiselectError(): React.JSX.Element;
|
|
10
3
|
export default MultiselectError;
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
import { Movie, MovieOption } from '@splunk/react-ui/fixtures/FetchOptions';
|
|
4
|
-
interface ExampleState {
|
|
5
|
-
fullCount: number;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
options: MovieOption[];
|
|
8
|
-
values: (string | number | boolean)[];
|
|
9
|
-
}
|
|
10
|
-
declare class Fetching extends Component<{}, ExampleState> {
|
|
11
|
-
private fetchOptions;
|
|
12
|
-
constructor(props: {});
|
|
13
|
-
componentDidMount(): void;
|
|
14
|
-
componentWillUnmount(): void;
|
|
15
|
-
handleChange: MultiselectChangeHandler;
|
|
16
|
-
handleFetch: (keyword?: string) => void;
|
|
17
|
-
handleFilterChange: MultiselectFilterChangeHandler;
|
|
18
|
-
createOption: (movie: Movie | MovieOption, isSelected?: boolean) => React.JSX.Element;
|
|
19
|
-
generateOptions: () => React.JSX.Element[];
|
|
20
|
-
footerMessage: () => string | null;
|
|
21
|
-
render(): React.JSX.Element;
|
|
22
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function Fetching(): React.JSX.Element;
|
|
23
3
|
export default Fetching;
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
import { Movie, MovieOption } from '@splunk/react-ui/fixtures/FetchOptions';
|
|
4
|
-
interface ExampleState {
|
|
5
|
-
fullCount: number;
|
|
6
|
-
isLoading: boolean;
|
|
7
|
-
isLoadingMore: boolean;
|
|
8
|
-
options: MovieOption[];
|
|
9
|
-
values: (string | number | boolean)[];
|
|
10
|
-
}
|
|
11
|
-
declare class LoadMoreOnScrollBottom extends Component<{}, ExampleState> {
|
|
12
|
-
private fetchOptions;
|
|
13
|
-
constructor(props: {});
|
|
14
|
-
componentDidMount(): void;
|
|
15
|
-
componentWillUnmount(): void;
|
|
16
|
-
handleChange: MultiselectChangeHandler;
|
|
17
|
-
handleFetch: (keyword?: string) => void;
|
|
18
|
-
handleFetchMore: (currentOptions: MovieOption[]) => void;
|
|
19
|
-
handleFilterChange: MultiselectFilterChangeHandler;
|
|
20
|
-
handleScrollBottom: () => void;
|
|
21
|
-
createOption: (movie: Movie | MovieOption, isSelected?: boolean) => React.JSX.Element;
|
|
22
|
-
generateOptions: () => React.JSX.Element[];
|
|
23
|
-
footerMessage: () => string;
|
|
24
|
-
render(): React.JSX.Element;
|
|
25
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function LoadMoreOnScrollBottom(): React.JSX.Element;
|
|
26
3
|
export default LoadMoreOnScrollBottom;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class NewValues extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function NewValues(): React.JSX.Element;
|
|
10
3
|
export default NewValues;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
declare class TabInput extends Component<{}, {
|
|
4
|
-
values: (string | number | boolean)[];
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: {});
|
|
7
|
-
handleChange: MultiselectChangeHandler;
|
|
8
|
-
render(): React.JSX.Element;
|
|
9
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function TabInput(): React.JSX.Element;
|
|
10
3
|
export default TabInput;
|
|
@@ -2,20 +2,21 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
interface NonInteractiveCheckboxPropsBase {
|
|
5
|
-
disabled?: boolean
|
|
5
|
+
disabled?: boolean;
|
|
6
6
|
selected?: boolean | 'some';
|
|
7
7
|
}
|
|
8
8
|
type NonInteractiveCheckboxProps = ComponentProps<NonInteractiveCheckboxPropsBase, 'div'>;
|
|
9
9
|
/**
|
|
10
10
|
* NonInteractiveCheckbox is a private component that replaced our internal usage of Switch's interactive={false}
|
|
11
|
-
*
|
|
11
|
+
* for components like Menu.Item, Table.Toggle, etc. (SUI-6757)
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
|
-
declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
disabled: PropTypes.Requireable<
|
|
14
|
+
declare const NonInteractiveCheckbox: {
|
|
15
|
+
({ className, disabled, selected }: NonInteractiveCheckboxProps): React.JSX.Element;
|
|
16
|
+
propTypes: {
|
|
17
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
18
18
|
selected: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
19
19
|
};
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
export default NonInteractiveCheckbox;
|
|
22
|
+
export { NonInteractiveCheckboxPropsBase };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { NumberChangeHandler } from '@splunk/react-ui/Number';
|
|
3
|
-
declare class Basic extends Component<
|
|
3
|
+
declare class Basic extends Component<object, {
|
|
4
4
|
value?: number;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: NumberChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { NumberChangeHandler } from '@splunk/react-ui/Number';
|
|
3
|
-
declare class Limits extends Component<
|
|
3
|
+
declare class Limits extends Component<object, {
|
|
4
4
|
value?: number;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: NumberChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { NumberChangeHandler } from '@splunk/react-ui/Number';
|
|
3
|
-
declare class Locale extends Component<
|
|
3
|
+
declare class Locale extends Component<object, {
|
|
4
4
|
value?: number;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: NumberChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { SpringConfig } from 'react-spring';
|
|
3
|
+
import { SpringConfig } from '@react-spring/web';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
/** @public */
|
|
6
6
|
type PopoverChildrenRenderer = (data: {
|
|
@@ -64,7 +64,7 @@ type RadioBarProps = ComponentProps<RadioBarPropsBaseControlled | RadioBarPropsB
|
|
|
64
64
|
/**
|
|
65
65
|
* RadioBar is a form control that provides the ability to select one option out of a group.
|
|
66
66
|
*/
|
|
67
|
-
declare function RadioBar({ children, defaultValue: defaultValueProp, describedBy, error, labelledBy, name, onChange, required, role, value: valueProp, ...otherProps }: RadioBarProps): React.JSX.Element;
|
|
67
|
+
declare function RadioBar({ children, defaultValue: defaultValueProp, describedBy, elementRef, error, labelledBy, name, onChange, required, role, value: valueProp, ...otherProps }: RadioBarProps): React.JSX.Element;
|
|
68
68
|
declare namespace RadioBar {
|
|
69
69
|
var Option: typeof import("./Option").default;
|
|
70
70
|
var propTypes: {
|