@splunk/react-ui 4.29.0 → 4.31.0
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 +1 -0
- package/CHANGELOG.md +39 -3
- package/Card.js +17 -17
- package/Chip.js +5 -5
- package/Clickable.js +107 -87
- package/Code.js +10 -22
- package/CollapsiblePanel.js +8 -8
- package/ComboBox.js +43 -38
- package/Date.js +6 -6
- package/Divider.js +96 -45
- package/DualListbox.js +1 -1
- package/Link.js +77 -75
- package/MIGRATION.mdx +51 -1
- package/Markdown.js +10 -9
- package/Menu.js +5 -5
- package/Message.js +160 -149
- package/ModalLayer.js +2 -1
- package/Multiselect.js +9 -6
- package/Number.js +19 -18
- package/Paginator.js +239 -223
- package/RadioBar.js +43 -39
- package/ResultsMenu.js +14 -11
- package/Search.js +227 -220
- package/Select.js +77 -72
- package/SidePanel.js +1 -1
- package/StepBar.js +1 -1
- package/Table.js +2082 -1594
- package/Text.js +1 -0
- package/TextArea.d.ts +1 -1
- package/cypress/support/component.ts +2 -2
- package/package.json +21 -20
- package/test-runner-jest.config.js +1 -0
- package/types/src/Accordion/Accordion.d.ts +3 -7
- package/types/src/Accordion/Panel.d.ts +2 -2
- package/types/src/Anchor/Anchor.d.ts +1 -1
- package/types/src/AnimationToggle/AnimationToggle.d.ts +3 -3
- package/types/src/Box/Box.d.ts +1 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/Button/Button.d.ts +5 -5
- package/types/src/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +10 -10
- package/types/src/Calendar/Calendar.d.ts +3 -3
- package/types/src/Calendar/DateTable.d.ts +2 -2
- package/types/src/Calendar/Day.d.ts +3 -3
- package/types/src/Calendar/MonthHeader.d.ts +6 -6
- package/types/src/Card/Body.d.ts +1 -1
- package/types/src/Card/Card.d.ts +6 -6
- package/types/src/Card/Footer.d.ts +1 -1
- package/types/src/Card/Header.d.ts +1 -1
- package/types/src/CardLayout/CardLayout.d.ts +4 -4
- package/types/src/Chip/Chip.d.ts +5 -5
- package/types/src/Clickable/Clickable.d.ts +12 -4
- package/types/src/Clickable/NavigationProvider.d.ts +26 -5
- package/types/src/CloseButton/CloseButton.d.ts +1 -1
- package/types/src/Code/Code.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +9 -5
- package/types/src/CollapsiblePanel/SingleOpenPanelGroup.d.ts +2 -2
- package/types/src/CollapsiblePanel/docs/examples/SingleOpenPanelGroupInset.d.ts +2 -0
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +8 -8
- package/types/src/Color/Swatch.d.ts +2 -2
- package/types/src/ColumnLayout/Column.d.ts +1 -1
- package/types/src/ColumnLayout/ColumnLayout.d.ts +1 -1
- package/types/src/ColumnLayout/Row.d.ts +1 -1
- package/types/src/ComboBox/ComboBox.d.ts +7 -6
- package/types/src/ComboBox/Option.d.ts +3 -3
- package/types/src/Concertina/Concertina.d.ts +2 -2
- package/types/src/Concertina/Heading.d.ts +3 -3
- package/types/src/Concertina/Panel.d.ts +4 -4
- package/types/src/Concertina/types.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +5 -5
- package/types/src/Date/Date.d.ts +10 -10
- package/types/src/DefinitionList/DefinitionList.d.ts +2 -2
- package/types/src/DefinitionList/Description.d.ts +1 -1
- package/types/src/DefinitionList/Term.d.ts +1 -1
- package/types/src/Divider/Divider.d.ts +7 -2
- package/types/src/Divider/docs/examples/Decorative.d.ts +2 -0
- package/types/src/Dropdown/Dropdown.d.ts +10 -10
- package/types/src/DualListbox/DualListbox.d.ts +4 -4
- package/types/src/DualListbox/DualListboxContext.d.ts +7 -7
- package/types/src/DualListbox/Label.d.ts +2 -2
- package/types/src/DualListbox/Listbox.d.ts +4 -4
- package/types/src/DualListbox/ListboxContext.d.ts +3 -3
- package/types/src/DualListbox/Option.d.ts +2 -2
- package/types/src/DualListbox/ToolbarButton.d.ts +3 -3
- package/types/src/DualListbox/ToolbarContext.d.ts +3 -3
- package/types/src/EventListener/EventListener.d.ts +1 -1
- package/types/src/File/File.d.ts +8 -8
- package/types/src/File/Item.d.ts +2 -2
- package/types/src/FormRows/FormRows.d.ts +6 -6
- package/types/src/FormRows/Row.d.ts +2 -2
- package/types/src/FormRows/RowInternal.d.ts +1 -1
- package/types/src/FormRows/SortableList.d.ts +1 -1
- package/types/src/FormRows/SortableRow.d.ts +3 -3
- package/types/src/Heading/Heading.d.ts +2 -2
- package/types/src/Image/Image.d.ts +2 -2
- package/types/src/JSONTree/JSONTree.d.ts +6 -6
- package/types/src/JSONTree/JSONTreeItem.d.ts +3 -3
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Layer/Layer.d.ts +3 -3
- package/types/src/Link/Link.d.ts +4 -4
- package/types/src/List/Item.d.ts +1 -1
- package/types/src/List/List.d.ts +3 -3
- package/types/src/Markdown/Markdown.d.ts +18 -12
- package/types/src/Markdown/renderers/MarkdownAnchorHeading.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCode.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownImage.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownItem.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownList.d.ts +3 -3
- package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +1 -1
- package/types/src/Menu/Divider.d.ts +1 -1
- package/types/src/Menu/Heading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +10 -10
- package/types/src/Menu/Menu.d.ts +9 -9
- package/types/src/Message/Link.d.ts +3 -3
- package/types/src/Message/Message.d.ts +1 -1
- package/types/src/MessageBar/MessageBar.d.ts +2 -2
- package/types/src/Modal/Body.d.ts +1 -1
- package/types/src/Modal/Footer.d.ts +1 -1
- package/types/src/Modal/Header.d.ts +1 -1
- package/types/src/Modal/Modal.d.ts +4 -4
- package/types/src/ModalLayer/ModalLayer.d.ts +3 -3
- package/types/src/Monogram/Monogram.d.ts +5 -5
- package/types/src/Multiselect/Compact.d.ts +2 -2
- package/types/src/Multiselect/Multiselect.d.ts +7 -7
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Multiselect/Option.d.ts +3 -3
- package/types/src/Multiselect/docs/examples/Fetching.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +1 -1
- package/types/src/Number/Number.d.ts +22 -22
- package/types/src/Paginator/Button.d.ts +3 -3
- package/types/src/Paginator/Compact.d.ts +4 -4
- package/types/src/Paginator/PageControl.d.ts +2 -2
- package/types/src/Paginator/PageSelect.d.ts +2 -2
- package/types/src/Paginator/Paginator.d.ts +2 -2
- package/types/src/Paragraph/Paragraph.d.ts +1 -1
- package/types/src/Popover/Popover.d.ts +11 -11
- package/types/src/Popover/PopoverHitArea.d.ts +1 -1
- package/types/src/Progress/Progress.d.ts +1 -1
- package/types/src/RadioBar/Option.d.ts +8 -4
- package/types/src/RadioBar/RadioBar.d.ts +8 -8
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioList.d.ts +3 -3
- package/types/src/Resize/Resize.d.ts +4 -4
- package/types/src/Resize/docs/examples/Basic.d.ts +2 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +7 -5
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedItem.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ResultsMenu/VirtualizedResultsMenu/injectVirtualizedItem.d.ts +2 -2
- package/types/src/ScreenReaderContent/ScreenReaderContent.d.ts +2 -2
- package/types/src/Scroll/Inner.d.ts +3 -3
- package/types/src/Scroll/Scroll.d.ts +2 -2
- package/types/src/Search/Option.d.ts +8 -8
- package/types/src/Search/Search.d.ts +4 -4
- package/types/src/Select/Option.d.ts +2 -2
- package/types/src/Select/OptionBase.d.ts +8 -8
- package/types/src/Select/Select.d.ts +5 -5
- package/types/src/Select/SelectAllOption.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +9 -8
- package/types/src/SidePanel/SidePanel.d.ts +3 -3
- package/types/src/Slider/Slider.d.ts +8 -8
- package/types/src/SlidingPanels/Panel.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
- package/types/src/SplitButton/Item.d.ts +2 -2
- package/types/src/SplitButton/SplitButton.d.ts +1 -1
- package/types/src/StaticContent/StaticContent.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -1
- package/types/src/StepBar/StepBar.d.ts +1 -1
- package/types/src/Switch/Switch.d.ts +4 -8
- package/types/src/TabBar/Tab.d.ts +7 -8
- package/types/src/TabBar/TabBar.d.ts +5 -5
- package/types/src/TabLayout/Panel.d.ts +2 -2
- package/types/src/TabLayout/TabLayout.d.ts +3 -3
- package/types/src/Table/Body.d.ts +4 -8
- package/types/src/Table/Caption.d.ts +2 -2
- package/types/src/Table/Cell.d.ts +3 -3
- package/types/src/Table/DragHandle.d.ts +1 -1
- package/types/src/Table/Head.d.ts +6 -6
- package/types/src/Table/HeadCell.d.ts +9 -9
- package/types/src/Table/HeadDropdownCell.d.ts +11 -11
- package/types/src/Table/HeadInner.d.ts +5 -5
- package/types/src/Table/HeadTable.d.ts +2 -2
- package/types/src/Table/KeyboardSensor.d.ts +79 -0
- package/types/src/Table/Row.d.ts +12 -14
- package/types/src/Table/RowDragCell.d.ts +9 -40
- package/types/src/Table/Table.d.ts +12 -10
- package/types/src/Table/Toggle.d.ts +1 -1
- package/types/src/Table/docs/examples/FilterColumnValues.d.ts +1 -1
- package/types/src/Text/Text.d.ts +13 -11
- package/types/src/TextArea/TextArea.d.ts +10 -10
- package/types/src/Tooltip/Tooltip.d.ts +9 -9
- package/types/src/TransitionOpen/TransitionOpen.d.ts +2 -2
- package/types/src/Tree/Tree.d.ts +3 -3
- package/types/src/Tree/TreeItem.d.ts +4 -4
- package/types/src/Typography/Typography.d.ts +5 -5
- package/types/src/WaitSpinner/WaitSpinner.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -2
- package/types/src/useKeyPress/index.d.ts +2 -2
- package/types/src/utils/types.d.ts +4 -4
- package/types/src/Divider/docs/examples/AriaHidden.d.ts +0 -2
- package/types/src/Resize/docs/examples/Typical.d.ts +0 -2
|
@@ -2,12 +2,10 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { RowRequestMoveRowHandler } from './Row';
|
|
4
4
|
import { ClassComponentProps } from '../utils/types';
|
|
5
|
-
|
|
5
|
+
type BodyRequestMoveRowHandler = RowRequestMoveRowHandler;
|
|
6
6
|
interface BodyPropsBase {
|
|
7
7
|
/** @private. Generally passed by Table rather than added directly. */
|
|
8
8
|
actions?: boolean;
|
|
9
|
-
/** @private. Generally passed by Table rather than added directly. */
|
|
10
|
-
activeElementId?: string;
|
|
11
9
|
/**
|
|
12
10
|
* Must be `Table.Row`.
|
|
13
11
|
*/
|
|
@@ -28,14 +26,12 @@ interface BodyPropsBase {
|
|
|
28
26
|
stripeRows?: boolean;
|
|
29
27
|
}
|
|
30
28
|
declare const defaultProps: Required<Pick<BodyPropsBase, 'actions' | 'rowExpansion' | 'stripeRows'>>;
|
|
31
|
-
|
|
32
|
-
declare function BodyBase({
|
|
29
|
+
type BodyProps = ClassComponentProps<BodyPropsBase, typeof defaultProps, 'tbody'>;
|
|
30
|
+
declare function BodyBase({ actions, children, elementRef, movableColumns, onRequestMoveRow, rowExpansion, primaryColumnIndex, stripeRows, ...otherProps }: BodyProps): JSX.Element | null;
|
|
33
31
|
declare namespace BodyBase {
|
|
34
32
|
var propTypes: {
|
|
35
33
|
/** @private. Generally passed by Table rather than added directly. */
|
|
36
34
|
actions: PropTypes.Requireable<boolean>;
|
|
37
|
-
/** @private. Generally passed by Table rather than added directly. */
|
|
38
|
-
activeElementId: PropTypes.Requireable<string>;
|
|
39
35
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
40
36
|
elementRef: PropTypes.Requireable<object>;
|
|
41
37
|
/** @private. Generally passed by Table rather than added directly. */
|
|
@@ -56,7 +52,7 @@ declare class Body extends Component<BodyProps, {}> {
|
|
|
56
52
|
private rowHeight?;
|
|
57
53
|
private rows?;
|
|
58
54
|
static splunkUiType: string;
|
|
59
|
-
static propTypes: React.WeakValidationMap<
|
|
55
|
+
static propTypes: React.WeakValidationMap<BodyProps>;
|
|
60
56
|
static defaultProps: Required<Pick<BodyPropsBase, "actions" | "rowExpansion" | "stripeRows">>;
|
|
61
57
|
render(): JSX.Element;
|
|
62
58
|
}
|
|
@@ -6,7 +6,7 @@ interface CaptionPropsBase {
|
|
|
6
6
|
/** The location of the caption relative to the table. */
|
|
7
7
|
side?: 'top' | 'bottom';
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
type CaptionProps = ComponentProps<CaptionPropsBase, 'caption'>;
|
|
10
10
|
/**
|
|
11
11
|
* Tables that use a docked header must place the caption on the bottom side.
|
|
12
12
|
* Tables that use a fixed header cannot use captions.
|
|
@@ -14,7 +14,7 @@ declare type CaptionProps = ComponentProps<CaptionPropsBase, 'caption'>;
|
|
|
14
14
|
declare function Caption({ children, side, ...otherProps }: CaptionProps): JSX.Element;
|
|
15
15
|
declare namespace Caption {
|
|
16
16
|
var propTypes: {
|
|
17
|
-
children: PropTypes.Validator<
|
|
17
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
18
18
|
side: PropTypes.Requireable<string>;
|
|
19
19
|
};
|
|
20
20
|
var splunkUiType: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { ClassComponentProps } from '../utils/types';
|
|
3
3
|
/** @public */
|
|
4
|
-
|
|
4
|
+
type CellClickHandler = (event: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>, data?: any) => void;
|
|
5
5
|
interface CellPropsBase {
|
|
6
6
|
/** Align the text in the cell. */
|
|
7
7
|
align?: 'left' | 'center' | 'right';
|
|
@@ -40,11 +40,11 @@ interface CellPropsBase {
|
|
|
40
40
|
variant?: 'toggle' | 'expand' | 'drag' | 'actions';
|
|
41
41
|
}
|
|
42
42
|
declare const defaultProps: Required<Pick<CellPropsBase, 'align'>>;
|
|
43
|
-
|
|
43
|
+
type CellProps = ClassComponentProps<CellPropsBase, typeof defaultProps, 'td'>;
|
|
44
44
|
declare class Cell extends Component<CellProps, {}> {
|
|
45
45
|
private el;
|
|
46
46
|
static splunkUiType: string;
|
|
47
|
-
static propTypes: React.WeakValidationMap<
|
|
47
|
+
static propTypes: React.WeakValidationMap<CellProps>;
|
|
48
48
|
static defaultProps: Required<Pick<CellPropsBase, "align">>;
|
|
49
49
|
private handleMount;
|
|
50
50
|
private handleClick;
|
|
@@ -3,7 +3,7 @@ interface DragHandlePropsBase {
|
|
|
3
3
|
screenReaderContent?: string;
|
|
4
4
|
}
|
|
5
5
|
declare const defaultProps: {};
|
|
6
|
-
|
|
6
|
+
type DragHandleProps = DragHandlePropsBase & typeof defaultProps;
|
|
7
7
|
declare function DragHandle({ screenReaderContent }: DragHandleProps): JSX.Element;
|
|
8
8
|
declare namespace DragHandle {
|
|
9
9
|
var propTypes: {
|
|
@@ -2,15 +2,15 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { TableRequestMoveColumnHandler } from './Table';
|
|
3
3
|
import TableContext from './TableContext';
|
|
4
4
|
import { ClassComponentProps } from '../utils/types';
|
|
5
|
-
|
|
5
|
+
type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
|
|
6
6
|
columnId: any;
|
|
7
7
|
index: number;
|
|
8
8
|
}) => void;
|
|
9
|
-
|
|
9
|
+
type HeadDragStartHandler = (data: {
|
|
10
10
|
dragIndex?: number;
|
|
11
11
|
}) => void;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type HeadRequestMoveColumnHandler = TableRequestMoveColumnHandler;
|
|
13
|
+
type HeadRequestResizeColumnHandler = (event: React.KeyboardEvent<HTMLHRElement> | MouseEvent, data: {
|
|
14
14
|
columnId: any;
|
|
15
15
|
id?: string;
|
|
16
16
|
index: number;
|
|
@@ -55,7 +55,7 @@ interface HeadPropsBase {
|
|
|
55
55
|
resizableFillLayout?: boolean;
|
|
56
56
|
}
|
|
57
57
|
declare const defaultProps: Required<Pick<HeadPropsBase, 'actions' | 'cellMinWidth'>>;
|
|
58
|
-
|
|
58
|
+
type HeadProps = ClassComponentProps<HeadPropsBase, typeof defaultProps, 'thead'>;
|
|
59
59
|
interface HeadState {
|
|
60
60
|
dragColumnId: any;
|
|
61
61
|
}
|
|
@@ -66,7 +66,7 @@ declare class Head extends Component<HeadProps, HeadState> {
|
|
|
66
66
|
context: React.ContextType<typeof TableContext>;
|
|
67
67
|
static contextType: React.Context<TableContext>;
|
|
68
68
|
static splunkUiType: string;
|
|
69
|
-
static propTypes: React.WeakValidationMap<
|
|
69
|
+
static propTypes: React.WeakValidationMap<HeadProps>;
|
|
70
70
|
static defaultProps: Required<Pick<HeadPropsBase, "actions" | "cellMinWidth">>;
|
|
71
71
|
constructor(props: Readonly<HeadProps>);
|
|
72
72
|
componentDidUpdate(): void;
|
|
@@ -2,23 +2,23 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { HeadAutosizeColumnHandler, HeadRequestMoveColumnHandler, HeadRequestResizeColumnHandler } from './Head';
|
|
3
3
|
import { ClassComponentProps } from '../utils/types';
|
|
4
4
|
import TableContext from './TableContext';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type HeadCellAutosizeColumnHandler = HeadAutosizeColumnHandler;
|
|
6
|
+
type HeadCellDragStartHandler = (index: number | undefined, columnId: any) => void;
|
|
7
|
+
type HeadCellKeyDownHandler = (event: React.KeyboardEvent<HTMLTableCellElement>, data: {
|
|
8
8
|
columnId: any;
|
|
9
9
|
index: number;
|
|
10
10
|
}) => void;
|
|
11
|
-
|
|
11
|
+
type HeadCellRequestMoveColumnHandler = HeadRequestMoveColumnHandler;
|
|
12
12
|
/** @public */
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type HeadCellSortDir = 'asc' | 'desc' | 'none';
|
|
14
|
+
type HeadCellSortHandler = (event: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>, data: {
|
|
15
15
|
columnId: any;
|
|
16
16
|
id?: string;
|
|
17
17
|
index: number;
|
|
18
18
|
sortDir: HeadCellSortDir;
|
|
19
19
|
sortKey?: string;
|
|
20
20
|
}) => void;
|
|
21
|
-
|
|
21
|
+
type HeadCellRequestResizeHandler = HeadRequestResizeColumnHandler;
|
|
22
22
|
interface HeadCellPropsBase {
|
|
23
23
|
/** Align the text in the label. */
|
|
24
24
|
align?: 'left' | 'center' | 'right';
|
|
@@ -95,13 +95,13 @@ interface HeadCellPropsBase {
|
|
|
95
95
|
zIndex?: number;
|
|
96
96
|
}
|
|
97
97
|
declare const defaultProps: Required<Pick<HeadCellPropsBase, 'align' | 'resizable' | 'showGuideline' | 'sortDir' | 'truncate' | 'visible' | 'zIndex'>>;
|
|
98
|
-
|
|
98
|
+
type HeadCellProps = ClassComponentProps<HeadCellPropsBase, typeof defaultProps, 'th'>;
|
|
99
99
|
interface HeadCellState {
|
|
100
100
|
isDragging: boolean;
|
|
101
101
|
}
|
|
102
102
|
declare class HeadCell extends Component<HeadCellProps, HeadCellState> {
|
|
103
103
|
static splunkUiType: string;
|
|
104
|
-
static propTypes: React.WeakValidationMap<
|
|
104
|
+
static propTypes: React.WeakValidationMap<HeadCellProps>;
|
|
105
105
|
static defaultProps: Required<Pick<HeadCellPropsBase, "align" | "zIndex" | "visible" | "truncate" | "resizable" | "sortDir" | "showGuideline">>;
|
|
106
106
|
context: React.ContextType<typeof TableContext>;
|
|
107
107
|
static contextType: React.Context<TableContext>;
|
|
@@ -4,24 +4,24 @@ import { HeadCellDragStartHandler, HeadCellKeyDownHandler } from './HeadCell';
|
|
|
4
4
|
import { ClassComponentProps } from '../utils/types';
|
|
5
5
|
import TableContext from './TableContext';
|
|
6
6
|
/** @public */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
type HeadDropdownCellPossibleCloseReason = 'clickAway' | 'contentClick' | 'escapeKey' | 'offScreen' | 'tabKey' | 'toggleClick';
|
|
8
|
+
type HeadDropdownCellAutosizeColumnHandler = HeadAutosizeColumnHandler;
|
|
9
|
+
type HeadDropdownCellDragStartHandler = HeadCellDragStartHandler;
|
|
10
|
+
type HeadDropdownCellKeyDownHandler = HeadCellKeyDownHandler;
|
|
11
11
|
/** @public */
|
|
12
|
-
|
|
12
|
+
type HeadDropdownCellRequestCloseHandler = (event: React.MouseEvent<HTMLTableHeaderCellElement | HTMLDivElement> | React.KeyboardEvent<HTMLTableHeaderCellElement> | MouseEvent | KeyboardEvent | TouchEvent | undefined, data: {
|
|
13
13
|
columnId: any;
|
|
14
14
|
index: number;
|
|
15
15
|
reason: HeadDropdownCellPossibleCloseReason;
|
|
16
16
|
}) => void;
|
|
17
|
-
|
|
17
|
+
type HeadDropdownCellRequestMoveColumnHandler = HeadRequestMoveColumnHandler;
|
|
18
18
|
/** @public */
|
|
19
|
-
|
|
19
|
+
type HeadDropdownCellRequestOpenHandler = (event: React.MouseEvent<HTMLTableHeaderCellElement> | React.KeyboardEvent<HTMLTableHeaderCellElement>, data: {
|
|
20
20
|
columnId: any;
|
|
21
21
|
index: number;
|
|
22
22
|
reason: 'toggleClick';
|
|
23
23
|
}) => void;
|
|
24
|
-
|
|
24
|
+
type HeadDropdownCellRequestResizeHandler = HeadRequestResizeColumnHandler;
|
|
25
25
|
interface HeadDropdownCellPropsBase {
|
|
26
26
|
/** Align the text in the label. */
|
|
27
27
|
align?: 'left' | 'center' | 'right';
|
|
@@ -135,7 +135,7 @@ interface HeadDropdownCellPropsBase {
|
|
|
135
135
|
zIndex?: number;
|
|
136
136
|
}
|
|
137
137
|
declare const defaultProps: Required<Pick<HeadDropdownCellPropsBase, 'align' | 'canCoverHead' | 'closeReasons' | 'defaultPlacement' | 'focusToggleReasons' | 'repositionMode' | 'resizable' | 'retainFocus' | 'takeFocus' | 'truncate' | 'visible' | 'zIndex'>>;
|
|
138
|
-
|
|
138
|
+
type HeadDropdownCellProps = ClassComponentProps<HeadDropdownCellPropsBase, typeof defaultProps, 'th'>;
|
|
139
139
|
interface HeadDropdownCellState {
|
|
140
140
|
clientX?: number;
|
|
141
141
|
el: HTMLTableCellElement | null;
|
|
@@ -152,8 +152,8 @@ declare class HeadDropdownCell extends Component<HeadDropdownCellProps, HeadDrop
|
|
|
152
152
|
* 'clickAway', 'escapeKey', and 'offScreen' are inherited from Popover, but repeated here for
|
|
153
153
|
* docs extraction.
|
|
154
154
|
*/
|
|
155
|
-
static possibleCloseReasons:
|
|
156
|
-
static propTypes: React.WeakValidationMap<
|
|
155
|
+
static possibleCloseReasons: HeadDropdownCellPossibleCloseReason[];
|
|
156
|
+
static propTypes: React.WeakValidationMap<HeadDropdownCellProps>;
|
|
157
157
|
static defaultProps: Required<Pick<HeadDropdownCellPropsBase, "align" | "zIndex" | "retainFocus" | "takeFocus" | "visible" | "closeReasons" | "defaultPlacement" | "repositionMode" | "focusToggleReasons" | "truncate" | "resizable" | "canCoverHead">>;
|
|
158
158
|
context: React.ContextType<typeof TableContext>;
|
|
159
159
|
static contextType: React.Context<TableContext>;
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
4
|
import { HeadAutosizeColumnHandler, HeadRequestResizeColumnHandler } from './Head';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type HeadInnerAutosizeColumnHandler = HeadAutosizeColumnHandler;
|
|
6
|
+
type HeadInnerDragStartHandler = (index: number | undefined, columnId: any) => void;
|
|
7
|
+
type HeadInnerRequestResizeHandler = HeadRequestResizeColumnHandler;
|
|
8
8
|
interface HeadInnerPropsBase {
|
|
9
9
|
align?: 'left' | 'center' | 'right';
|
|
10
10
|
columnId?: any;
|
|
@@ -22,7 +22,7 @@ interface HeadInnerPropsBase {
|
|
|
22
22
|
truncate?: boolean;
|
|
23
23
|
width?: number | 'auto';
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
type HeadInnerProps = ComponentProps<HeadInnerPropsBase, 'span'>;
|
|
26
26
|
declare function HeadInner({ index, columnId, id, width: widthProp, onDragEnd, onAutosizeColumn, align, label, hasActionsHead, isMenu, onDragStart, onRequestResize, resizable, sortDir, truncate, ...otherProps }: HeadInnerProps): JSX.Element;
|
|
27
27
|
declare namespace HeadInner {
|
|
28
28
|
var propTypes: {
|
|
@@ -40,7 +40,7 @@ declare namespace HeadInner {
|
|
|
40
40
|
resizable: PropTypes.Requireable<boolean>;
|
|
41
41
|
sortDir: PropTypes.Requireable<string>;
|
|
42
42
|
truncate: PropTypes.Requireable<boolean>;
|
|
43
|
-
width: PropTypes.Requireable<
|
|
43
|
+
width: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export default HeadInner;
|
|
@@ -19,7 +19,7 @@ interface HeadTablePropsBase {
|
|
|
19
19
|
width: number;
|
|
20
20
|
}
|
|
21
21
|
declare const defaultProps: Required<Pick<HeadTablePropsBase, 'horizontalOffset'>>;
|
|
22
|
-
|
|
22
|
+
type HeadTableProps = ClassComponentProps<HeadTablePropsBase, typeof defaultProps, 'table'>;
|
|
23
23
|
/**
|
|
24
24
|
* @private
|
|
25
25
|
* HeadTable is an internal component that provides a detached table head that can
|
|
@@ -27,7 +27,7 @@ declare type HeadTableProps = ClassComponentProps<HeadTablePropsBase, typeof def
|
|
|
27
27
|
*/
|
|
28
28
|
declare class HeadTable extends Component<HeadTableProps, {}> {
|
|
29
29
|
private head;
|
|
30
|
-
static propTypes: React.WeakValidationMap<
|
|
30
|
+
static propTypes: React.WeakValidationMap<HeadTableProps>;
|
|
31
31
|
static defaultProps: Required<Pick<HeadTablePropsBase, "horizontalOffset">>;
|
|
32
32
|
getHead(): Head | null;
|
|
33
33
|
private handleHeadMount;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Transform } from '@dnd-kit/utilities';
|
|
2
|
+
import { Activators, SensorInstance, SensorProps, SensorOptions, KeyboardCodes, KeyboardCoordinateGetter } from '@dnd-kit/core';
|
|
3
|
+
import { Coordinates } from '@dnd-kit/core/dist/types/';
|
|
4
|
+
export declare class Listeners {
|
|
5
|
+
private target;
|
|
6
|
+
private listeners;
|
|
7
|
+
constructor(target: EventTarget | null);
|
|
8
|
+
add<T extends Event>(eventName: string, handler: (event: T) => void, options?: AddEventListenerOptions | boolean): void;
|
|
9
|
+
removeAll: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function parseTransform(transform: string): Transform | null;
|
|
12
|
+
type ClientRect = Pick<DOMRect, 'width' | 'height' | 'top' | 'right' | 'bottom' | 'left'>;
|
|
13
|
+
export declare function inverseTransform(rect: DOMRect, transform: string, transformOrigin: string): ClientRect;
|
|
14
|
+
interface Options {
|
|
15
|
+
ignoreTransform?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function getClientRect(element: Element, options?: Options): {
|
|
18
|
+
top: number;
|
|
19
|
+
left: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
bottom: number;
|
|
23
|
+
right: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function getScrollElementRect(element: Element): {
|
|
26
|
+
top: number;
|
|
27
|
+
left: number;
|
|
28
|
+
right: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
export declare function isDocumentScrollingElement(element: Element | null): boolean;
|
|
34
|
+
export declare function getScrollPosition(scrollingContainer: Element): {
|
|
35
|
+
isTop: boolean;
|
|
36
|
+
isLeft: boolean;
|
|
37
|
+
isBottom: boolean;
|
|
38
|
+
isRight: boolean;
|
|
39
|
+
maxScroll: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
minScroll: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const defaultCoordinates: Coordinates;
|
|
49
|
+
export declare function isFixed(node: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;
|
|
50
|
+
export declare function isScrollable(element: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;
|
|
51
|
+
export declare function getScrollableAncestors(element: Node | null, limit?: number): Element[];
|
|
52
|
+
export declare function getFirstScrollableAncestor(node: Node | null): Element | null;
|
|
53
|
+
export declare function scrollIntoViewIfNeeded(element: HTMLElement | null | undefined, measure?: (node: HTMLElement) => ClientRect): void;
|
|
54
|
+
export interface KeyboardSensorOptions extends SensorOptions {
|
|
55
|
+
coordinateGetter: KeyboardCoordinateGetter;
|
|
56
|
+
keyboardCodes?: KeyboardCodes;
|
|
57
|
+
scrollBehavior?: ScrollBehavior;
|
|
58
|
+
onActivation?({ event }: {
|
|
59
|
+
event: KeyboardEvent;
|
|
60
|
+
}): void;
|
|
61
|
+
}
|
|
62
|
+
export type KeyboardSensorProps = SensorProps<KeyboardSensorOptions>;
|
|
63
|
+
export default class KeyboardSensor implements SensorInstance {
|
|
64
|
+
private readonly props;
|
|
65
|
+
autoScrollEnabled: boolean;
|
|
66
|
+
private referenceCoordinates;
|
|
67
|
+
private listeners;
|
|
68
|
+
private windowListeners;
|
|
69
|
+
constructor(props: KeyboardSensorProps);
|
|
70
|
+
private attach;
|
|
71
|
+
private handleStart;
|
|
72
|
+
private handleKeyDown;
|
|
73
|
+
private handleMove;
|
|
74
|
+
private handleEnd;
|
|
75
|
+
private handleCancel;
|
|
76
|
+
private detach;
|
|
77
|
+
static activators: Activators<KeyboardSensorOptions>;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
package/types/src/Table/Row.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { DragStartEvent } from '@dnd-kit/core';
|
|
4
3
|
import { TableRequestMoveRowHandler } from './Table';
|
|
5
4
|
import { ClassComponentProps } from '../utils/types';
|
|
6
5
|
/** @public */
|
|
7
|
-
|
|
6
|
+
type RowActionPrimaryClickHandler = (event: React.MouseEvent, data?: any) => void;
|
|
8
7
|
/** @public */
|
|
9
|
-
|
|
8
|
+
type RowActionSecondaryClickHandler = (event: React.MouseEvent, data?: any) => void;
|
|
10
9
|
/** @public */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare type RowExpansionHandler = (event: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>, data?: any) => void;
|
|
10
|
+
type RowClickHandler = (event: React.MouseEvent<HTMLTableRowElement> | React.KeyboardEvent<HTMLTableRowElement>, data?: any) => void;
|
|
11
|
+
type RowRequestMoveRowHandler = TableRequestMoveRowHandler;
|
|
12
|
+
type RowExpansionHandler = (event: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>, data?: any) => void;
|
|
15
13
|
/** @public */
|
|
16
|
-
|
|
14
|
+
type RowRequestExpansionHandler = (event: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>, data?: any) => void;
|
|
17
15
|
/** @public */
|
|
18
|
-
|
|
16
|
+
type RowRequestToggleHandler = (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>, data?: any) => void;
|
|
19
17
|
interface RowPropsBase {
|
|
20
18
|
/** @private. Generally passed by Table rather than added directly. */
|
|
21
19
|
activeElementId?: string;
|
|
@@ -94,7 +92,7 @@ interface RowPropsBase {
|
|
|
94
92
|
stripe?: 'odd' | 'even' | 'none';
|
|
95
93
|
}
|
|
96
94
|
declare const defaultProps: Required<Pick<RowPropsBase, 'stripe' | 'primaryColumnIndex'>>;
|
|
97
|
-
|
|
95
|
+
type RowProps = ClassComponentProps<RowPropsBase, typeof defaultProps, 'tr'>;
|
|
98
96
|
declare function RowBase(props: RowProps): JSX.Element;
|
|
99
97
|
declare namespace RowBase {
|
|
100
98
|
var propTypes: {
|
|
@@ -105,7 +103,7 @@ declare namespace RowBase {
|
|
|
105
103
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
106
104
|
data: PropTypes.Requireable<any>;
|
|
107
105
|
/** @private. Generally passed by Table rather than added directly. */
|
|
108
|
-
dataId: PropTypes.Requireable<
|
|
106
|
+
dataId: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
109
107
|
disabled: PropTypes.Requireable<boolean>;
|
|
110
108
|
/** @private. Generally passed by Table rather than added directly. */
|
|
111
109
|
draggable: PropTypes.Requireable<boolean>;
|
|
@@ -113,7 +111,7 @@ declare namespace RowBase {
|
|
|
113
111
|
/** @private. */
|
|
114
112
|
expandable: PropTypes.Requireable<boolean>;
|
|
115
113
|
expanded: PropTypes.Requireable<boolean>;
|
|
116
|
-
expansionRow: PropTypes.Requireable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[]
|
|
114
|
+
expansionRow: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[] | null | undefined>>;
|
|
117
115
|
/** @private. Indicates whether the table has an actions column. */
|
|
118
116
|
actions: PropTypes.Requireable<boolean>;
|
|
119
117
|
/** @private. Generally passed by `Table` rather than added directly. */
|
|
@@ -137,10 +135,10 @@ declare namespace RowBase {
|
|
|
137
135
|
}
|
|
138
136
|
declare class Row extends Component<RowProps, {}> {
|
|
139
137
|
static splunkUiType: string;
|
|
140
|
-
static propTypes: React.WeakValidationMap<
|
|
138
|
+
static propTypes: React.WeakValidationMap<RowProps>;
|
|
141
139
|
static defaultProps: Required<Pick<RowPropsBase, "stripe" | "primaryColumnIndex">>;
|
|
142
140
|
render(): JSX.Element;
|
|
143
141
|
}
|
|
144
142
|
export default Row;
|
|
145
143
|
export { RowActionPrimaryClickHandler, RowActionSecondaryClickHandler, RowBase, // exporting the base component for testing purpose
|
|
146
|
-
RowClickHandler,
|
|
144
|
+
RowClickHandler, RowRequestExpansionHandler, RowRequestMoveRowHandler, RowRequestToggleHandler, RowExpansionHandler, };
|
|
@@ -1,49 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
2
|
+
import type { DraggableSyntheticListeners } from '@dnd-kit/core';
|
|
4
3
|
import { ComponentProps } from '../utils/types';
|
|
5
|
-
declare type RowDragCellKeyDownHandler = (event: React.KeyboardEvent<HTMLTableCellElement>, data: {
|
|
6
|
-
dataId?: string | number;
|
|
7
|
-
index: number;
|
|
8
|
-
}) => void;
|
|
9
|
-
declare type RowDragCellRequestMoveRowHandler = TableRequestMoveRowHandler;
|
|
10
4
|
interface RowDragCellPropsBase {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
activeElementId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* unique-ID of the data-object in input array
|
|
17
|
-
*/
|
|
18
|
-
dataId?: string | number;
|
|
19
|
-
/**
|
|
20
|
-
* index of the data-object in input array
|
|
21
|
-
*/
|
|
22
|
-
index?: number;
|
|
23
|
-
/**
|
|
24
|
-
* event-handler for keyboard events
|
|
25
|
-
*/
|
|
26
|
-
onKeyDown?: RowDragCellKeyDownHandler;
|
|
27
|
-
/**
|
|
28
|
-
* callback for reordering the rows
|
|
29
|
-
*/
|
|
30
|
-
onRequestMoveRow?: RowDragCellRequestMoveRowHandler;
|
|
31
|
-
/**
|
|
32
|
-
* no of rows a cell expands to. applies when a table is rendered with expandable rows option
|
|
33
|
-
*/
|
|
34
|
-
rowSpan?: number;
|
|
5
|
+
setActivatorNodeRef: (element: HTMLElement | null) => void;
|
|
6
|
+
listeners?: DraggableSyntheticListeners;
|
|
35
7
|
}
|
|
36
|
-
|
|
37
|
-
declare function RowDragCell({
|
|
8
|
+
type RowDragCellProps = ComponentProps<RowDragCellPropsBase, 'td'>;
|
|
9
|
+
declare function RowDragCell({ listeners, setActivatorNodeRef, ...otherProps }: RowDragCellProps): JSX.Element;
|
|
38
10
|
declare namespace RowDragCell {
|
|
39
11
|
var propTypes: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onRequestMoveRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
-
rowSpan: PropTypes.Requireable<number>;
|
|
12
|
+
setActivatorNodeRef: PropTypes.Validator<(...args: any[]) => any>;
|
|
13
|
+
listeners: PropTypes.Requireable<{
|
|
14
|
+
[x: string]: ((...args: any[]) => any) | null | undefined;
|
|
15
|
+
}>;
|
|
46
16
|
};
|
|
47
17
|
}
|
|
48
18
|
export default RowDragCell;
|
|
49
|
-
export { RowDragCellRequestMoveRowHandler };
|
|
@@ -9,19 +9,19 @@ import HeadDropdownCell, { HeadDropdownCellPossibleCloseReason, HeadDropdownCell
|
|
|
9
9
|
import Row, { RowActionPrimaryClickHandler, RowActionSecondaryClickHandler, RowClickHandler, RowRequestToggleHandler } from './Row';
|
|
10
10
|
import { ClassComponentProps } from '../utils/types';
|
|
11
11
|
/** @public */
|
|
12
|
-
|
|
12
|
+
type TableRequestMoveColumnHandler = (data: {
|
|
13
13
|
columnId: any;
|
|
14
14
|
fromIndex: number;
|
|
15
15
|
toIndex: number;
|
|
16
16
|
}) => void;
|
|
17
17
|
/** @public */
|
|
18
|
-
|
|
18
|
+
type TableRequestMoveRowHandler = (data: {
|
|
19
19
|
dataId?: string | number;
|
|
20
20
|
fromIndex: number;
|
|
21
21
|
toIndex: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
/** @public */
|
|
24
|
-
|
|
24
|
+
type TableRequestResizeColumnHandler = (event: React.MouseEvent<HTMLHRElement> | React.KeyboardEvent<HTMLHRElement> | MouseEvent, data: {
|
|
25
25
|
columnId: any;
|
|
26
26
|
id?: string;
|
|
27
27
|
index: number;
|
|
@@ -112,13 +112,16 @@ interface TablePropsBase {
|
|
|
112
112
|
*/
|
|
113
113
|
tableStyle?: React.CSSProperties;
|
|
114
114
|
/**
|
|
115
|
-
* An event handler for handle the re
|
|
115
|
+
* An event handler for handle the re-order action of Table. The function is passed an
|
|
116
116
|
* options object with `fromIndex` and `toIndex`.
|
|
117
117
|
*/
|
|
118
118
|
onRequestMoveColumn?: TableRequestMoveColumnHandler;
|
|
119
119
|
/**
|
|
120
120
|
* An event handler to handle the reorder rows action of Table. The function is passed an
|
|
121
|
-
* options object with `fromIndex` and `toIndex`.
|
|
121
|
+
* options object with `dataId`, `fromIndex` and `toIndex`.
|
|
122
|
+
*
|
|
123
|
+
* This property requires a unique `key` to be passed to `Table.Row`.
|
|
124
|
+
* Using the row index as the `key` will lead to issues with animations and focus restoration.
|
|
122
125
|
*/
|
|
123
126
|
onRequestMoveRow?: TableRequestMoveRowHandler;
|
|
124
127
|
/**
|
|
@@ -132,7 +135,7 @@ interface TablePropsBase {
|
|
|
132
135
|
resizableFillLayout?: boolean;
|
|
133
136
|
}
|
|
134
137
|
declare const defaultProps: Required<Pick<TablePropsBase, 'actions' | 'dockOffset' | 'headType' | 'rowExpansion' | 'rowSelection' | 'resizableFillLayout' | 'primaryColumnIndex'>>;
|
|
135
|
-
|
|
138
|
+
type TableProps = ClassComponentProps<TablePropsBase, typeof defaultProps, 'div'>;
|
|
136
139
|
declare function TableBase(props: TableProps): JSX.Element;
|
|
137
140
|
declare namespace TableBase {
|
|
138
141
|
var propTypes: {
|
|
@@ -159,7 +162,7 @@ declare namespace TableBase {
|
|
|
159
162
|
};
|
|
160
163
|
}
|
|
161
164
|
declare class Table extends Component<TableProps, {}> {
|
|
162
|
-
static propTypes: React.WeakValidationMap<
|
|
165
|
+
static propTypes: React.WeakValidationMap<TableProps>;
|
|
163
166
|
static defaultProps: Required<Pick<TablePropsBase, "actions" | "headType" | "rowSelection" | "resizableFillLayout" | "primaryColumnIndex" | "dockOffset" | "rowExpansion">>;
|
|
164
167
|
static Caption: typeof Caption;
|
|
165
168
|
static Head: typeof Head;
|
|
@@ -171,6 +174,5 @@ declare class Table extends Component<TableProps, {}> {
|
|
|
171
174
|
render(): JSX.Element;
|
|
172
175
|
}
|
|
173
176
|
export default Table;
|
|
174
|
-
export { Body, Caption, Cell, Head, HeadCell, HeadDropdownCell, Row };
|
|
175
|
-
export type { CellClickHandler, HeadCellSortHandler, HeadDropdownCellPossibleCloseReason, HeadDropdownCellRequestCloseHandler, HeadDropdownCellRequestOpenHandler, RowActionPrimaryClickHandler, RowActionSecondaryClickHandler, RowClickHandler, RowRequestToggleHandler,
|
|
176
|
-
TableRequestMoveColumnHandler, TableRequestMoveRowHandler, TableRequestResizeColumnHandler, };
|
|
177
|
+
export { Body, Caption, Cell, Head, HeadCell, HeadDropdownCell, Row, TableBase };
|
|
178
|
+
export type { CellClickHandler, HeadCellSortHandler, HeadDropdownCellPossibleCloseReason, HeadDropdownCellRequestCloseHandler, HeadDropdownCellRequestOpenHandler, RowActionPrimaryClickHandler, RowActionSecondaryClickHandler, RowClickHandler, RowRequestToggleHandler, TableRequestMoveColumnHandler, TableRequestMoveRowHandler, TableRequestResizeColumnHandler, };
|
|
@@ -7,7 +7,7 @@ interface TogglePropsBase {
|
|
|
7
7
|
onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
8
8
|
selected?: boolean | 'some';
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type ToggleProps = ComponentProps<TogglePropsBase, 'button'>;
|
|
11
11
|
declare function Toggle({ allRows, disabled, onClick, selected, ...otherProps }: ToggleProps): JSX.Element;
|
|
12
12
|
declare namespace Toggle {
|
|
13
13
|
var propTypes: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
declare const kindValues: readonly ["Amazon S3", "Index", "Indexer", "Lookup", "View"];
|
|
3
|
-
|
|
3
|
+
type Kind = typeof kindValues[number];
|
|
4
4
|
interface ExampleState {
|
|
5
5
|
filter?: Kind[];
|
|
6
6
|
}
|