@splunk/react-ui 5.0.0-beta.2 → 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 +4 -4
- package/ButtonGroup.js +10 -11
- package/ButtonSimple.js +48 -42
- package/CHANGELOG.md +26 -0
- package/CHANGELOG.v5.mdx +81 -0
- package/Calendar.js +352 -469
- package/Card.js +178 -321
- package/Chip.js +154 -296
- package/Clickable.js +30 -30
- package/Code.js +64 -49
- package/Color.js +546 -462
- package/ComboBox.js +575 -767
- package/Date.js +144 -136
- package/Divider.js +29 -26
- package/DualListbox.js +441 -444
- package/File.js +707 -981
- package/FormRows.js +260 -286
- package/Image.js +124 -251
- package/JSONTree.js +129 -129
- package/Layout.d.ts +2 -0
- package/Link.js +12 -12
- package/MIGRATION.mdx +22 -1
- package/MIGRATION.v5.mdx +12 -1
- package/Menu.js +76 -76
- package/Message.js +77 -100
- package/MessageBar.js +141 -251
- package/Modal.js +42 -40
- package/ModalLayer.js +12 -12
- package/Multiselect.js +1989 -2362
- package/NonInteractiveCheckbox.js +30 -118
- package/Number.js +75 -73
- package/Popover.js +348 -350
- package/Progress.js +1 -1
- package/RadioBar.js +136 -136
- package/Resize.js +62 -65
- package/Scroll.js +2 -2
- package/Select.js +281 -283
- package/SidePanel.js +53 -55
- package/Slider.js +370 -364
- package/SlidingPanels.js +100 -102
- package/SplitButton.js +170 -343
- package/StaticContent.js +15 -13
- package/StepBar.js +61 -60
- package/Switch.js +150 -164
- package/TabBar.js +544 -417
- package/Table.js +1711 -1540
- package/Text.js +28 -26
- package/TextArea.js +26 -26
- package/Tooltip.js +416 -562
- package/TransitionOpen.js +179 -158
- package/Tree.d.ts +2 -0
- package/WaitSpinner.js +1 -1
- 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 +2 -2
- 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 +27 -14
- 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/Color/Color.d.ts +3 -3
- package/types/src/Color/ColorInput.d.ts +27 -0
- package/types/src/Color/Palette.d.ts +11 -18
- package/types/src/Color/Swatch.d.ts +3 -1
- package/types/src/ComboBox/ComboBox.d.ts +46 -50
- package/types/src/ComboBox/Option.d.ts +34 -18
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
- package/types/src/Date/Date.d.ts +3 -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/Divider/Divider.d.ts +14 -6
- package/types/src/Divider/docs/examples/Appearance.d.ts +3 -0
- package/types/src/DualListbox/DualListbox.d.ts +5 -1
- package/types/src/File/File.d.ts +6 -6
- 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 +7 -0
- 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 +8 -8
- package/types/src/FormRows/FormRowsContext.d.ts +1 -2
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- 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 +49 -21
- package/types/src/Multiselect/Multiselect.d.ts +73 -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 +9 -8
- package/types/src/Number/Number.d.ts +1 -0
- 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/SidePanel/SidePanel.d.ts +8 -3
- package/types/src/Slider/Slider.d.ts +1 -1
- 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 +34 -20
- package/types/src/SplitButton/SplitButton.d.ts +4 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- 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/Switch.d.ts +1 -9
- 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 +4 -3
- 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/Table/Toggle.d.ts +1 -1
- package/types/src/Text/Text.d.ts +5 -1
- package/types/src/Tooltip/Tooltip.d.ts +26 -58
- package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
- package/types/src/TransitionOpen/TransitionOpen.d.ts +6 -1
- 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/File/Icon.d.ts +0 -3
- package/types/src/File/IconCloud.d.ts +0 -3
- package/types/src/File/PaperClip.d.ts +0 -3
- package/types/src/File/Retry.d.ts +0 -2
- package/types/src/File/Trash.d.ts +0 -3
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +0 -3
- package/types/src/Image/icons/Cross.d.ts +0 -3
- package/types/src/Multiselect/docs/examples/CompactSelectAll.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,15 +1,12 @@
|
|
|
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;
|
|
5
6
|
}) => void;
|
|
6
7
|
interface OptionPropsBase {
|
|
7
8
|
/** @private */
|
|
8
9
|
active?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* When provided, `label` is rendered instead of the `value` and used for matching.
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
10
|
/**
|
|
14
11
|
* Additional information to explain the option, such as "Recommended".
|
|
15
12
|
*/
|
|
@@ -22,6 +19,10 @@ interface OptionPropsBase {
|
|
|
22
19
|
* If disabled=true, the option is grayed out and cannot be clicked.
|
|
23
20
|
*/
|
|
24
21
|
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
24
|
+
*/
|
|
25
|
+
elementRef?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
25
26
|
/**
|
|
26
27
|
* The icon to show before the label. See the @splunk/react-icons package for
|
|
27
28
|
* drop in icons.
|
|
@@ -29,6 +30,10 @@ interface OptionPropsBase {
|
|
|
29
30
|
* Caution: The element(s) passed here must be pure. All icons in the react-icons package are pure.
|
|
30
31
|
*/
|
|
31
32
|
icon?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* When provided, `label` is rendered instead of the `value` and used for matching.
|
|
35
|
+
*/
|
|
36
|
+
label?: string;
|
|
32
37
|
/**
|
|
33
38
|
* Sections of the label string to highlight as a match. This is automatically set for
|
|
34
39
|
* uncontrolled filters, so it's not normally necessary to set this property when using
|
|
@@ -49,20 +54,31 @@ interface OptionPropsBase {
|
|
|
49
54
|
*/
|
|
50
55
|
value: string;
|
|
51
56
|
}
|
|
52
|
-
|
|
53
|
-
type OptionProps = ClassComponentProps<OptionPropsBase, typeof defaultProps, 'button'>;
|
|
57
|
+
type OptionProps = ComponentProps<OptionPropsBase, 'button'>;
|
|
54
58
|
/**
|
|
55
|
-
* An option within a `ComboBox`.
|
|
56
|
-
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
57
|
-
* so any elements passed to it must also be pure.
|
|
59
|
+
* An option within a `ComboBox`.
|
|
58
60
|
*/
|
|
59
|
-
declare
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
declare function Option({ active, description, descriptionPosition, disabled, elementRef, icon, label, matchRanges, onClick, truncate, value, ...otherProps }: OptionProps): React.JSX.Element;
|
|
62
|
+
declare namespace Option {
|
|
63
|
+
var propTypes: {
|
|
64
|
+
/** @private */
|
|
65
|
+
active: PropTypes.Requireable<boolean>;
|
|
66
|
+
description: PropTypes.Requireable<string>;
|
|
67
|
+
descriptionPosition: PropTypes.Requireable<string>;
|
|
68
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
69
|
+
elementRef: PropTypes.Requireable<object>;
|
|
70
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
71
|
+
label: PropTypes.Requireable<string>;
|
|
72
|
+
matchRanges: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
73
|
+
start: PropTypes.Validator<number>;
|
|
74
|
+
end: PropTypes.Validator<number>;
|
|
75
|
+
}> | null | undefined)[]>;
|
|
76
|
+
/** @private */
|
|
77
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
|
+
truncate: PropTypes.Requireable<boolean>;
|
|
79
|
+
value: PropTypes.Validator<string>;
|
|
80
|
+
};
|
|
81
|
+
var as: string;
|
|
66
82
|
}
|
|
67
83
|
export default Option;
|
|
68
84
|
export { OptionClickHandler };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { SwitchClickHandler } from '@splunk/react-ui/Switch';
|
|
3
|
-
declare class CustomizedLabelTarget extends Component<
|
|
3
|
+
declare class CustomizedLabelTarget 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
|
}
|
package/types/src/Date/Date.d.ts
CHANGED
|
@@ -67,9 +67,10 @@ interface DatePropsBase {
|
|
|
67
67
|
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
68
68
|
onFocus?: DateFocusHandler;
|
|
69
69
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
70
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Setting this value makes the property controlled. An onChange callback is required.
|
|
71
72
|
*
|
|
72
|
-
* The value must be in the format 'YYYY-MM-DD'. To simplify creation of these strings,
|
|
73
|
+
* The value must be "" or in the format 'YYYY-MM-DD'. To simplify creation of these strings,
|
|
73
74
|
* Date provides a Moment.js formatting string:
|
|
74
75
|
* ```
|
|
75
76
|
* moment().format(Date.momentFormat);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { DateChangeHandler } from '@splunk/react-ui/Date';
|
|
3
|
-
declare class Controlled extends Component<
|
|
3
|
+
declare class Controlled extends Component<object, {
|
|
4
4
|
value: string;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: DateChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { DateChangeHandler } from '@splunk/react-ui/Date';
|
|
3
|
-
declare class HighlightToday extends Component<
|
|
3
|
+
declare class HighlightToday extends Component<object, {
|
|
4
4
|
value: string;
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleChange: DateChangeHandler;
|
|
8
8
|
render(): React.JSX.Element;
|
|
9
9
|
}
|
|
@@ -3,22 +3,30 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
interface DividerPropsBase {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Changes the border color of the `Divider`.
|
|
7
|
+
* `Divider`s with `appearance="weak"` will not meet accessibility requirements to be perceivable.
|
|
8
|
+
* If the component should be perceivable, consider the other contrast compliant `appearance` values.
|
|
9
|
+
* Otherwise, apply the `decorative` prop.
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
/** Sets the orientation of this `Divider`. */
|
|
10
|
-
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
appearance?: 'default' | 'weak' | 'strong';
|
|
11
12
|
/**
|
|
12
13
|
* Remove semantics of the divider.
|
|
13
14
|
*/
|
|
14
15
|
decorative?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
18
|
+
*/
|
|
19
|
+
elementRef?: React.Ref<HTMLHRElement>;
|
|
20
|
+
/** Sets the orientation of this `Divider`. */
|
|
21
|
+
orientation?: 'horizontal' | 'vertical';
|
|
15
22
|
}
|
|
16
23
|
type DividerProps = ComponentProps<DividerPropsBase, 'hr' | 'div'>;
|
|
17
|
-
declare function Divider({ elementRef, decorative, orientation, ...otherProps }: DividerProps): React.JSX.Element;
|
|
24
|
+
declare function Divider({ appearance, elementRef, decorative, orientation, ...otherProps }: DividerProps): React.JSX.Element;
|
|
18
25
|
declare namespace Divider {
|
|
19
26
|
var propTypes: {
|
|
20
|
-
|
|
27
|
+
appearance: PropTypes.Requireable<string>;
|
|
21
28
|
decorative: PropTypes.Requireable<boolean>;
|
|
29
|
+
elementRef: PropTypes.Requireable<object>;
|
|
22
30
|
orientation: PropTypes.Requireable<string>;
|
|
23
31
|
};
|
|
24
32
|
}
|
|
@@ -53,6 +53,10 @@ interface DualListboxPropsBase {
|
|
|
53
53
|
* When true, `Options`'s `listName` and `selected` state props are fully controlled.
|
|
54
54
|
*/
|
|
55
55
|
controlled?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
58
|
+
*/
|
|
59
|
+
elementRef?: React.Ref<HTMLDivElement>;
|
|
56
60
|
/**
|
|
57
61
|
* When true, fill height and width of the relative parent container.
|
|
58
62
|
*/
|
|
@@ -78,7 +82,7 @@ interface DualListboxPropsBase {
|
|
|
78
82
|
onSelect?: DualListboxSelectHandler;
|
|
79
83
|
}
|
|
80
84
|
type DualListboxProps = ComponentProps<DualListboxPropsBase, 'div'>;
|
|
81
|
-
declare function DualListbox({ children, controlled, fill, inline, onChange, onSelect, lists, ...otherProps }: DualListboxProps): React.JSX.Element;
|
|
85
|
+
declare function DualListbox({ children, controlled, elementRef, fill, inline, onChange, onSelect, lists, ...otherProps }: DualListboxProps): React.JSX.Element;
|
|
82
86
|
declare namespace DualListbox {
|
|
83
87
|
var propTypes: React.WeakValidationMap<DualListboxPropsBase>;
|
|
84
88
|
var Option: typeof import("./Option").default;
|
package/types/src/File/File.d.ts
CHANGED
|
@@ -9,27 +9,27 @@ type FileRequestAddHandler = (files: globalThis.File[], data: {
|
|
|
9
9
|
/** @public */
|
|
10
10
|
type FileRequestRemoveHandler = (data: {
|
|
11
11
|
event: {
|
|
12
|
-
itemId?:
|
|
12
|
+
itemId?: string;
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
15
|
filename: string;
|
|
16
16
|
index: number;
|
|
17
|
-
itemId?:
|
|
17
|
+
itemId?: string;
|
|
18
18
|
name?: string;
|
|
19
19
|
}) => void;
|
|
20
20
|
type FileRequestRetryHandler = (data: {
|
|
21
21
|
event: {
|
|
22
|
-
itemId?:
|
|
22
|
+
itemId?: string;
|
|
23
23
|
name: string;
|
|
24
24
|
};
|
|
25
25
|
filename: string;
|
|
26
26
|
index: number;
|
|
27
|
-
itemId?:
|
|
27
|
+
itemId?: string;
|
|
28
28
|
name?: string;
|
|
29
29
|
}) => void;
|
|
30
30
|
interface FilePropsBase {
|
|
31
31
|
/** The accept attribute for the file browser. This does not filter dropped items,
|
|
32
|
-
* which must be filtered manually.
|
|
32
|
+
* which must be filtered manually. File will create a default "supports" message based on this value. */
|
|
33
33
|
accept?: string;
|
|
34
34
|
/** Allow the user to upload multiple files. */
|
|
35
35
|
allowMultiple?: boolean;
|
|
@@ -74,7 +74,7 @@ type FileProps = ComponentProps<FilePropsBase, 'div'>;
|
|
|
74
74
|
* file readers, only a reference to the file. This can be used to post binary content, or
|
|
75
75
|
* upload using an array buffer.
|
|
76
76
|
*/
|
|
77
|
-
declare function File({ accept, allowMultiple, children, disabled, dropAnywhere, error, fullscreen, help, name, onRequestAdd, onRequestRemove, onRequestRetry, required, supportsMessage: supportsMessageProp, ...otherProps }: FileProps): React.JSX.Element;
|
|
77
|
+
declare function File({ accept, allowMultiple, children, disabled, dropAnywhere, elementRef, error, fullscreen, help, name, onRequestAdd, onRequestRemove, onRequestRetry, required, supportsMessage: supportsMessageProp, ...otherProps }: FileProps): React.JSX.Element;
|
|
78
78
|
declare namespace File {
|
|
79
79
|
var propTypes: {
|
|
80
80
|
accept: PropTypes.Requireable<string>;
|
package/types/src/File/Item.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
type ItemClickHandler = (data: {
|
|
5
|
-
itemId?:
|
|
5
|
+
itemId?: string;
|
|
6
6
|
name: string;
|
|
7
7
|
index: number;
|
|
8
8
|
}) => void;
|
|
@@ -14,8 +14,14 @@ interface ItemPropsBase {
|
|
|
14
14
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
15
15
|
/** Show the Item in an error state. */
|
|
16
16
|
error?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The icon or thumbnail image to show before the label.
|
|
19
|
+
* If not passed this will be generated from the filename extension.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
icon?: React.ReactNode;
|
|
17
23
|
/** A unique for this file. */
|
|
18
|
-
itemId?:
|
|
24
|
+
itemId?: string;
|
|
19
25
|
/** The name is displayed on the item. */
|
|
20
26
|
name: string;
|
|
21
27
|
/** @private */
|
|
@@ -25,13 +31,15 @@ interface ItemPropsBase {
|
|
|
25
31
|
uploadPercentage?: number;
|
|
26
32
|
}
|
|
27
33
|
type ItemProps = ComponentProps<ItemPropsBase, 'div'>;
|
|
28
|
-
declare function Item({ disabled, error, itemId, name, index, uploadPercentage, ...otherProps }: ItemProps): React.JSX.Element;
|
|
34
|
+
declare function Item({ disabled, elementRef, error, icon, itemId, name, index, uploadPercentage, ...otherProps }: ItemProps): React.JSX.Element;
|
|
29
35
|
declare namespace Item {
|
|
30
36
|
var propTypes: {
|
|
31
37
|
disabled: PropTypes.Requireable<boolean>;
|
|
32
38
|
elementRef: PropTypes.Requireable<object>;
|
|
33
39
|
error: PropTypes.Requireable<boolean>;
|
|
34
40
|
/** @private */
|
|
41
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
42
|
+
/** @private */
|
|
35
43
|
index: PropTypes.Requireable<number>;
|
|
36
44
|
itemId: PropTypes.Requireable<any>;
|
|
37
45
|
name: PropTypes.Validator<string>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class Disabled extends Component<
|
|
3
|
+
declare class Disabled extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
}> {
|
|
6
6
|
private fileReader;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleAddFiles: FileRequestAddHandler;
|
|
9
9
|
handleRemoveFile: () => void;
|
|
10
10
|
render(): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class DropAnywhere extends Component<
|
|
3
|
+
declare class DropAnywhere extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
open: boolean;
|
|
6
6
|
}> {
|
|
7
7
|
private fileReader;
|
|
8
|
-
constructor(props:
|
|
8
|
+
constructor(props: object);
|
|
9
9
|
handleAddFiles: FileRequestAddHandler;
|
|
10
10
|
handleRemoveFile: () => void;
|
|
11
11
|
handleOpen: () => void;
|
|
@@ -4,11 +4,11 @@ interface FileItem {
|
|
|
4
4
|
name: string;
|
|
5
5
|
value?: string | ArrayBuffer | null;
|
|
6
6
|
}
|
|
7
|
-
declare class Multi extends Component<
|
|
7
|
+
declare class Multi extends Component<object, {
|
|
8
8
|
files: FileItem[];
|
|
9
9
|
}> {
|
|
10
10
|
static loadFile(file: globalThis.File): FileItem;
|
|
11
|
-
constructor(props:
|
|
11
|
+
constructor(props: object);
|
|
12
12
|
handleAddFiles: FileRequestAddHandler;
|
|
13
13
|
handleRemoveFile: FileRequestRemoveHandler;
|
|
14
14
|
render(): React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class Single extends Component<
|
|
3
|
+
declare class Single extends Component<object, {
|
|
4
4
|
filename?: string;
|
|
5
5
|
}> {
|
|
6
6
|
private fileReader;
|
|
7
|
-
constructor(props:
|
|
7
|
+
constructor(props: object);
|
|
8
8
|
handleAddFiles: FileRequestAddHandler;
|
|
9
9
|
handleRemoveFile: () => void;
|
|
10
10
|
render(): React.JSX.Element;
|
|
@@ -9,11 +9,11 @@ type FormRowsRequestMoveHandler = (data: {
|
|
|
9
9
|
toIndex: number;
|
|
10
10
|
}) => void;
|
|
11
11
|
interface FormRowsPropsBase {
|
|
12
|
-
/** Label on the Add
|
|
12
|
+
/** Label on the Add row button. Ignored when menu prop is defined. */
|
|
13
13
|
addLabel?: string;
|
|
14
14
|
/** @private */
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
/** Disable the
|
|
16
|
+
/** Disable the Add row button, the Remove button and the sort/drag action. */
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
/**
|
|
19
19
|
* A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
|
|
@@ -21,15 +21,15 @@ interface FormRowsPropsBase {
|
|
|
21
21
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
22
22
|
/** Header for the rows. */
|
|
23
23
|
header?: React.ReactNode;
|
|
24
|
-
/** Replaces Add
|
|
24
|
+
/** Replaces Add row button with custom content or controls. */
|
|
25
25
|
menu?: React.ReactNode;
|
|
26
|
-
/** Callback when the
|
|
26
|
+
/** Callback when the Add row button is clicked. If `onRequestAdd` is defined, 'onRequestRemove' should be defined in `<FormRows.Row>`. Neither should be defined for a reorder-only variant of `<FormRows>`. */
|
|
27
27
|
onRequestAdd?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
28
28
|
/** Callback when sort action completes. Omit this to make rows unsortable. */
|
|
29
29
|
onRequestMove?: FormRowsRequestMoveHandler;
|
|
30
30
|
}
|
|
31
31
|
type FormRowsProps = ComponentProps<FormRowsPropsBase, 'div'>;
|
|
32
|
-
declare function FormRows({ addLabel, children, disabled, header, menu, onRequestAdd, onRequestMove, ...otherProps }: FormRowsProps): React.JSX.Element;
|
|
32
|
+
declare function FormRows({ addLabel, children, disabled, elementRef, header, menu, onRequestAdd, onRequestMove, ...otherProps }: FormRowsProps): React.JSX.Element;
|
|
33
33
|
declare namespace FormRows {
|
|
34
34
|
var propTypes: {
|
|
35
35
|
addLabel: PropTypes.Requireable<string>;
|
|
@@ -42,9 +42,9 @@ declare namespace FormRows {
|
|
|
42
42
|
onRequestMove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
43
|
};
|
|
44
44
|
var Row: typeof import("./Row").default;
|
|
45
|
-
var addRow: (element: React.ReactElement
|
|
46
|
-
var moveRow: (fromIndex: number, toIndex: number, items: React.ReactElement
|
|
47
|
-
var removeRow: (index: number, items: React.ReactElement
|
|
45
|
+
var addRow: (element: React.ReactElement, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
46
|
+
var moveRow: (fromIndex: number, toIndex: number, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
47
|
+
var removeRow: (index: number, items: React.ReactElement[]) => React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
48
48
|
}
|
|
49
49
|
export default FormRows;
|
|
50
50
|
export { Row };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RowKeyDownHandler } from './Row';
|
|
3
2
|
export interface FormRowsContext {
|
|
4
|
-
|
|
3
|
+
disabledRemoveButton: boolean | undefined;
|
|
5
4
|
onKeyDown?: RowKeyDownHandler;
|
|
6
5
|
hasOnRequestAdd?: boolean;
|
|
7
6
|
sortable: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
type RowKeyDownHandler = (event: React.KeyboardEvent<
|
|
3
|
+
type RowKeyDownHandler = (event: React.KeyboardEvent<HTMLButtonElement>, data: {
|
|
4
4
|
index: number;
|
|
5
5
|
}) => void;
|
|
6
6
|
/** @public */
|
|
@@ -15,7 +15,7 @@ interface RowPropsBase {
|
|
|
15
15
|
elementRef?: React.Ref<HTMLDivElement>;
|
|
16
16
|
/** Index of the row. This is required if the rows are sortable. */
|
|
17
17
|
index?: number;
|
|
18
|
-
/** Callback when
|
|
18
|
+
/** Callback when Remove button is clicked. */
|
|
19
19
|
onRequestRemove?: RowRequestRemoveHandler;
|
|
20
20
|
/** The contents of Row */
|
|
21
21
|
value?: React.ReactNode;
|
|
@@ -7,7 +7,7 @@ interface RowInternalPropsBase {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** Index of the row. This is required if the rows are sortable. */
|
|
9
9
|
index?: number;
|
|
10
|
-
/** Callback when
|
|
10
|
+
/** Callback when Remove button is clicked. */
|
|
11
11
|
onRequestRemove?: RowRequestRemoveHandler;
|
|
12
12
|
renderDragHandle?: () => React.ReactNode;
|
|
13
13
|
style?: React.CSSProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type RowKeyDownHandler = (event: React.KeyboardEvent<
|
|
2
|
+
type RowKeyDownHandler = (event: React.KeyboardEvent<HTMLButtonElement>, data: {
|
|
3
3
|
index: number;
|
|
4
4
|
}) => void;
|
|
5
5
|
/** @public */
|
|
@@ -8,9 +8,9 @@ type RowRequestRemoveHandler = (event: React.MouseEvent<HTMLButtonElement>, data
|
|
|
8
8
|
}) => void;
|
|
9
9
|
interface RowPropsBase {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
/** Index of the row. */
|
|
11
|
+
/** Index of the row. This is required if the rows are sortable. */
|
|
12
12
|
index?: number;
|
|
13
|
-
/** Callback when
|
|
13
|
+
/** Callback when Remove button is clicked. */
|
|
14
14
|
onRequestRemove?: RowRequestRemoveHandler;
|
|
15
15
|
/** The contents of Row */
|
|
16
16
|
value?: React.ReactNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler, RowRequestRemoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
|
-
declare class Basic extends Component<
|
|
3
|
+
declare class Basic extends Component<object, {
|
|
4
4
|
items: React.ReactElement[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleRequestAdd: () => void;
|
|
8
8
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
9
9
|
handleRequestRemove: RowRequestRemoveHandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { FormRowsRequestMoveHandler, RowRequestRemoveHandler } from '@splunk/react-ui/FormRows';
|
|
3
|
-
declare class Header extends Component<
|
|
3
|
+
declare class Header extends Component<object, {
|
|
4
4
|
items: React.ReactElement[];
|
|
5
5
|
}> {
|
|
6
|
-
constructor(props:
|
|
6
|
+
constructor(props: object);
|
|
7
7
|
handleRequestAdd: () => void;
|
|
8
8
|
handleRequestMove: FormRowsRequestMoveHandler;
|
|
9
9
|
handleRequestRemove: RowRequestRemoveHandler;
|
|
@@ -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>>;
|