@atlaskit/dynamic-table 14.7.1 → 14.8.1
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/CHANGELOG.md +17 -0
- package/dist/cjs/components/stateless.js +1 -1
- package/dist/cjs/styled/constants.js +5 -5
- package/dist/cjs/styled/dynamic-table.js +9 -9
- package/dist/cjs/styled/empty-body.js +5 -5
- package/dist/cjs/styled/loading-container-advanced.js +7 -7
- package/dist/cjs/styled/loading-container.js +7 -7
- package/dist/cjs/styled/rankable/row-placeholder.js +3 -3
- package/dist/cjs/styled/rankable/table-cell.js +3 -3
- package/dist/cjs/styled/rankable/table-row.js +5 -5
- package/dist/cjs/styled/table-cell.js +2 -2
- package/dist/cjs/styled/table-head.js +10 -10
- package/dist/cjs/styled/table-row.js +5 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/stateless.js +1 -1
- package/dist/es2019/styled/constants.js +1 -1
- package/dist/es2019/styled/dynamic-table.js +1 -1
- package/dist/es2019/styled/empty-body.js +1 -1
- package/dist/es2019/styled/loading-container-advanced.js +1 -1
- package/dist/es2019/styled/loading-container.js +1 -1
- package/dist/es2019/styled/rankable/row-placeholder.js +1 -1
- package/dist/es2019/styled/rankable/table-cell.js +1 -1
- package/dist/es2019/styled/rankable/table-row.js +1 -1
- package/dist/es2019/styled/table-cell.js +1 -1
- package/dist/es2019/styled/table-head.js +1 -1
- package/dist/es2019/styled/table-row.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/stateless.js +1 -1
- package/dist/esm/styled/constants.js +1 -1
- package/dist/esm/styled/dynamic-table.js +1 -1
- package/dist/esm/styled/empty-body.js +1 -1
- package/dist/esm/styled/loading-container-advanced.js +1 -1
- package/dist/esm/styled/loading-container.js +1 -1
- package/dist/esm/styled/rankable/row-placeholder.js +1 -1
- package/dist/esm/styled/rankable/table-cell.js +1 -1
- package/dist/esm/styled/rankable/table-row.js +1 -1
- package/dist/esm/styled/table-cell.js +1 -1
- package/dist/esm/styled/table-head.js +1 -1
- package/dist/esm/styled/table-row.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/stateless.d.ts +2 -2
- package/dist/types/styled/constants.d.ts +5 -4
- package/dist/types/styled/dynamic-table.d.ts +1 -1
- package/dist/types/styled/loading-container-advanced.d.ts +3 -2
- package/dist/types/styled/table-head.d.ts +1 -1
- package/dist/types/styled/table-row.d.ts +1 -0
- package/dist/types-ts4.0/components/body.d.ts +112 -0
- package/dist/types-ts4.0/components/loading-container-advanced.d.ts +43 -0
- package/dist/types-ts4.0/components/loading-container.d.ts +18 -0
- package/dist/types-ts4.0/components/managed-pagination.d.ts +15 -0
- package/dist/types-ts4.0/components/rankable/body.d.ts +122 -0
- package/dist/types-ts4.0/components/rankable/table-cell.d.ts +14 -0
- package/dist/types-ts4.0/components/rankable/table-head-cell.d.ts +5 -0
- package/dist/types-ts4.0/components/rankable/table-row.d.ts +18 -0
- package/dist/types-ts4.0/components/stateful.d.ts +60 -0
- package/dist/types-ts4.0/components/stateless.d.ts +58 -0
- package/dist/types-ts4.0/components/table-head-cell.d.ts +17 -0
- package/dist/types-ts4.0/components/table-head.d.ts +19 -0
- package/dist/types-ts4.0/components/table-row.d.ts +11 -0
- package/dist/types-ts4.0/hoc/with-dimensions.d.ts +12 -0
- package/dist/types-ts4.0/hoc/with-sorted-page-rows.d.ts +117 -0
- package/dist/types-ts4.0/index.d.ts +2 -0
- package/dist/types-ts4.0/internal/constants.d.ts +5 -0
- package/dist/types-ts4.0/internal/helpers.d.ts +7 -0
- package/dist/types-ts4.0/styled/constants.d.ts +17 -0
- package/dist/types-ts4.0/styled/dynamic-table.d.ts +15 -0
- package/dist/types-ts4.0/styled/empty-body.d.ts +4 -0
- package/dist/types-ts4.0/styled/loading-container-advanced.d.ts +6 -0
- package/dist/types-ts4.0/styled/loading-container.d.ts +9 -0
- package/dist/types-ts4.0/styled/rankable/row-placeholder.d.ts +3 -0
- package/dist/types-ts4.0/styled/rankable/table-cell.d.ts +8 -0
- package/dist/types-ts4.0/styled/rankable/table-row.d.ts +11 -0
- package/dist/types-ts4.0/styled/table-cell.d.ts +4 -0
- package/dist/types-ts4.0/styled/table-head.d.ts +15 -0
- package/dist/types-ts4.0/styled/table-row.d.ts +9 -0
- package/dist/types-ts4.0/theme.d.ts +22 -0
- package/dist/types-ts4.0/types.d.ts +345 -0
- package/package.json +16 -10
- package/theme/package.json +8 -1
- package/types/package.json +8 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC, HTMLProps } from 'react';
|
|
3
|
+
import { SortOrderType } from '../types';
|
|
4
|
+
import { TruncateStyleProps } from './constants';
|
|
5
|
+
interface HeadProps {
|
|
6
|
+
isRanking?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Head: FC<HeadProps>;
|
|
9
|
+
declare type HeadCellProps = TruncateStyleProps & HTMLProps<HTMLTableCellElement> & {
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
isSortable?: boolean;
|
|
12
|
+
sortOrder?: SortOrderType;
|
|
13
|
+
};
|
|
14
|
+
export declare const HeadCell: import("react").ForwardRefExoticComponent<Pick<HeadCellProps, "rows" | "isFixedSize" | "sortOrder" | "testId" | "label" | "cite" | "data" | "form" | "span" | "style" | "summary" | "title" | "pattern" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "isSortable" | "width" | "shouldTruncate" | "height" | "content" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "wmode" | "wrap" | "innerRef"> & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
export declare type ITableRowProps = {
|
|
4
|
+
isHighlighted?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const TableBodyRow: import("react").ForwardRefExoticComponent<ITableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const MSThemeColors: {
|
|
2
|
+
Background: string;
|
|
3
|
+
Text: string;
|
|
4
|
+
SelectedBackground: string;
|
|
5
|
+
SelectedText: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const arrow: {
|
|
8
|
+
defaultColor: "var(--ds-icon-disabled)";
|
|
9
|
+
selectedColor: "var(--ds-icon-subtle)";
|
|
10
|
+
};
|
|
11
|
+
export declare const row: {
|
|
12
|
+
focusOutline: "var(--ds-border-focused)";
|
|
13
|
+
highlightedBackground: "var(--ds-background-selected)";
|
|
14
|
+
hoverBackground: "var(--ds-background-neutral-subtle-hovered)";
|
|
15
|
+
hoverHighlightedBackground: "var(--ds-background-selected-hovered)";
|
|
16
|
+
};
|
|
17
|
+
export declare const head: {
|
|
18
|
+
textColor: "var(--ds-text-subtlest)";
|
|
19
|
+
};
|
|
20
|
+
export declare const tableBorder: {
|
|
21
|
+
borderColor: "var(--ds-border)";
|
|
22
|
+
};
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
|
+
import { UIAnalyticsEvent, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import type { Size as SizeType } from '@atlaskit/spinner';
|
|
4
|
+
export interface RowCellType {
|
|
5
|
+
/**
|
|
6
|
+
* Key to resolve sorting this cell in its column.
|
|
7
|
+
*/
|
|
8
|
+
key?: string | number;
|
|
9
|
+
/**
|
|
10
|
+
* The number of columns a cell should span. Defaults to 1, and maxes out at the total column width of the table.
|
|
11
|
+
*/
|
|
12
|
+
colSpan?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The content of the cell.
|
|
15
|
+
*/
|
|
16
|
+
content?: React.ReactNode | string;
|
|
17
|
+
/**
|
|
18
|
+
* Hook for automated testing.
|
|
19
|
+
*/
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface I18nShape {
|
|
23
|
+
/**
|
|
24
|
+
* Accessible label applied to the previous page button in the pagination component.
|
|
25
|
+
*/
|
|
26
|
+
prev: string;
|
|
27
|
+
/**
|
|
28
|
+
* Accessible label applied to the next page button in the pagination component.
|
|
29
|
+
*/
|
|
30
|
+
next: string;
|
|
31
|
+
/**
|
|
32
|
+
* Accessible label applied to the current page button in the pagination component.
|
|
33
|
+
*/
|
|
34
|
+
label: string;
|
|
35
|
+
}
|
|
36
|
+
export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
37
|
+
/**
|
|
38
|
+
* Caption for the table styled as a heading.
|
|
39
|
+
*/
|
|
40
|
+
caption?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Cells to be placed in the head of the table.
|
|
43
|
+
* Each element in the head creates a new column.
|
|
44
|
+
*/
|
|
45
|
+
head?: HeadType;
|
|
46
|
+
/**
|
|
47
|
+
* Rows to be placed in the table.
|
|
48
|
+
* Each row contains cells which should map to the ones defined in the head.
|
|
49
|
+
*
|
|
50
|
+
* Ensure each cell has a unique `key` per column - this is used for both Reacts reconcilation of lists and column sorting.
|
|
51
|
+
*/
|
|
52
|
+
rows?: Array<RowType>;
|
|
53
|
+
/**
|
|
54
|
+
* Shown when the table has no content.
|
|
55
|
+
*/
|
|
56
|
+
emptyView?: React.ReactElement<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Configuration of the loading spinner shown when `isLoading` is true.
|
|
59
|
+
* Defaults to `"large"` when a page has more than two rows, else `"small"`.
|
|
60
|
+
*/
|
|
61
|
+
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
62
|
+
/**
|
|
63
|
+
* Displays a loading spinner overlaid on top of the current page.
|
|
64
|
+
*/
|
|
65
|
+
isLoading?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Displays columns as their initial width regardless of the content that loads in.
|
|
68
|
+
*/
|
|
69
|
+
isFixedSize?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Controls how many rows should be displayed per page.
|
|
72
|
+
*/
|
|
73
|
+
rowsPerPage?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Total number of rows, in case of paginated data.
|
|
76
|
+
*/
|
|
77
|
+
totalRows?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Callback fired when the table page has changed,
|
|
80
|
+
* useful when wanting to control the pagination of the table.
|
|
81
|
+
*/
|
|
82
|
+
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Callback fired when a column heading has been sorted,
|
|
85
|
+
* useful when wanting to control the sort order of the table.
|
|
86
|
+
*/
|
|
87
|
+
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Callback fired when the rows displayed on a page have changed.
|
|
90
|
+
*/
|
|
91
|
+
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Page the table should show. Set by default to 1, so never undefined.
|
|
94
|
+
*/
|
|
95
|
+
page?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Column key that the rows should be sorted by.
|
|
98
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
99
|
+
*/
|
|
100
|
+
sortKey?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Column sort order.
|
|
103
|
+
*/
|
|
104
|
+
sortOrder?: SortOrderType;
|
|
105
|
+
/**
|
|
106
|
+
* Enables drag & drop sorting of table rows.
|
|
107
|
+
*/
|
|
108
|
+
isRankable?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Disables being able to drop rows on the table.
|
|
111
|
+
* Drag will still function.
|
|
112
|
+
*/
|
|
113
|
+
isRankingDisabled?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Callback fired when a drag of a row has started.
|
|
116
|
+
*/
|
|
117
|
+
onRankStart?: (rankStart: RankStart) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Callback fired when a drop of a row has completed.
|
|
120
|
+
*/
|
|
121
|
+
onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Labels for the pagination wrapper, previous and next buttons used in pagination.
|
|
124
|
+
* Defaults to `"pagination"`, `"previous"` and `"next"`.
|
|
125
|
+
*/
|
|
126
|
+
paginationi18n?: I18nShape;
|
|
127
|
+
/**
|
|
128
|
+
* Will highlight a row(s) of the table. Should be used to draw attention to a row; not to indicate selection.
|
|
129
|
+
*/
|
|
130
|
+
highlightedRowIndex?: number | number[];
|
|
131
|
+
/**
|
|
132
|
+
* A `testId` prop is provided for specified elements,
|
|
133
|
+
* which is a unique string that appears as a data attribute
|
|
134
|
+
* `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
135
|
+
*
|
|
136
|
+
* The value of `testId` is used to prefix `testId` props in given elements.
|
|
137
|
+
* - `{testId}--table` - Table.
|
|
138
|
+
* - `{testId}--head` - Table header.
|
|
139
|
+
* - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
|
|
140
|
+
* - `{testId}--row--{index - content of the first cell}` - Table row.
|
|
141
|
+
* - `{testId}--body` - Table body.
|
|
142
|
+
* - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
|
|
143
|
+
* - `{testId}--loadingSpinner` - The spinner overlaid when loading.
|
|
144
|
+
* - `{testId}--pagination` - The table pagination.
|
|
145
|
+
*/
|
|
146
|
+
testId?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Used to provide a better description of the table for users with assistive technologies.
|
|
149
|
+
* Rather than a screen reader speaking "Entering table", passing in an label
|
|
150
|
+
* allows a custom message like "Entering Sample Numerical Data table".
|
|
151
|
+
*/
|
|
152
|
+
label?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
155
|
+
/**
|
|
156
|
+
* Caption for the table styled as a heading.
|
|
157
|
+
*/
|
|
158
|
+
caption?: React.ReactNode;
|
|
159
|
+
/**
|
|
160
|
+
* Cells to be placed in the head of the table.
|
|
161
|
+
* Each element in the head creates a new column.
|
|
162
|
+
*/
|
|
163
|
+
head?: HeadType;
|
|
164
|
+
/**
|
|
165
|
+
* Rows to be placed in the table.
|
|
166
|
+
* Each row contains cells which should map to the ones defined in the head.
|
|
167
|
+
* Rows accept standard HTML <tr> props in addition to those listed below.
|
|
168
|
+
* Ensure each cell has a unique `key` per column - this is used for both React's reconciliation of lists and column sorting.
|
|
169
|
+
*/
|
|
170
|
+
rows?: Array<RowType>;
|
|
171
|
+
/**
|
|
172
|
+
* Shown when the table has no content.
|
|
173
|
+
*/
|
|
174
|
+
emptyView?: React.ReactElement<any>;
|
|
175
|
+
/**
|
|
176
|
+
* Configuration of the loading spinner shown when `isLoading` is true.
|
|
177
|
+
* Defaults to `"large"` when a page has more than two rows, else `"small"`.
|
|
178
|
+
*/
|
|
179
|
+
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
180
|
+
/**
|
|
181
|
+
* Displays a loading spinner overlaid on top of the current page.
|
|
182
|
+
*/
|
|
183
|
+
isLoading?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Displays columns as their initial width regardless of the content that loads in.
|
|
186
|
+
*/
|
|
187
|
+
isFixedSize?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Controls how many rows should be displayed per page. If set, also turns on pagination, if there is more than one page to show.
|
|
190
|
+
*/
|
|
191
|
+
rowsPerPage?: number;
|
|
192
|
+
/**
|
|
193
|
+
* Callback fired when the table page has changed,
|
|
194
|
+
* useful when wanting to control dynamic table.
|
|
195
|
+
*/
|
|
196
|
+
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Callback fired when a column heading has been sorted,
|
|
199
|
+
* useful when wanting to control dynamic table.
|
|
200
|
+
*/
|
|
201
|
+
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Callback fired when the rows displayed on a page have changed.
|
|
204
|
+
*/
|
|
205
|
+
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Page the table should show.
|
|
208
|
+
* Useful when wanting to control dynamic table.
|
|
209
|
+
*/
|
|
210
|
+
page?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Default page dynamic table should show when initially rendering.
|
|
213
|
+
*/
|
|
214
|
+
defaultPage?: number;
|
|
215
|
+
/**
|
|
216
|
+
* Column key that the rows should be sorted by.
|
|
217
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
218
|
+
* Useful when wanting to control dynamic table.
|
|
219
|
+
*/
|
|
220
|
+
sortKey?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Default column sort key that the rows should be sorted by.
|
|
223
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
224
|
+
*/
|
|
225
|
+
defaultSortKey?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Column sort order.
|
|
228
|
+
* Useful when wanting to control dynamic table.
|
|
229
|
+
*/
|
|
230
|
+
sortOrder?: SortOrderType;
|
|
231
|
+
/**
|
|
232
|
+
* Default column sort order used when initially rendering.
|
|
233
|
+
* Defaults to `"ASC"`.
|
|
234
|
+
*/
|
|
235
|
+
defaultSortOrder?: SortOrderType;
|
|
236
|
+
/**
|
|
237
|
+
* Enables drag & drop sorting of table rows.
|
|
238
|
+
*/
|
|
239
|
+
isRankable?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Disables being able to drop rows on the table.
|
|
242
|
+
* Drag will still function.
|
|
243
|
+
*/
|
|
244
|
+
isRankingDisabled?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Callback fired when a drag of a row has started.
|
|
247
|
+
*/
|
|
248
|
+
onRankStart?: (rankStart: RankStart) => void;
|
|
249
|
+
/**
|
|
250
|
+
* Callback fired when a drop of a row has completed.
|
|
251
|
+
*/
|
|
252
|
+
onRankEnd?: (rankEnd: RankEnd) => void;
|
|
253
|
+
/**
|
|
254
|
+
* Labels for the previous and next buttons used in pagination.
|
|
255
|
+
* Defaults to `"previous"` and `"next"`.
|
|
256
|
+
*/
|
|
257
|
+
paginationi18n?: I18nShape;
|
|
258
|
+
/**
|
|
259
|
+
* Will highlight a row(s) of the table.
|
|
260
|
+
*/
|
|
261
|
+
highlightedRowIndex?: number | number[];
|
|
262
|
+
/**
|
|
263
|
+
* A `testId` prop is provided for specified elements,
|
|
264
|
+
* which is a unique string that appears as a data attribute
|
|
265
|
+
* `data-testid` in the rendered code, serving as a hook for automated tests.
|
|
266
|
+
* The value of `testId` is used to prefix `testId` props in given elements.
|
|
267
|
+
* - `{testId}--table` - Table.
|
|
268
|
+
* - `{testId}--head` - Table header.
|
|
269
|
+
* - `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
|
|
270
|
+
* - `{testId}--row--{index - content of the first cell}` - Table row.
|
|
271
|
+
* - `{testId}--body` - Table body.
|
|
272
|
+
* - `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
|
|
273
|
+
* - `{testId}--loadingSpinner` - The spinner overlaid when loading.
|
|
274
|
+
* - `{testId}--pagination` - The table pagination.
|
|
275
|
+
*/
|
|
276
|
+
testId?: string;
|
|
277
|
+
/**
|
|
278
|
+
* Used to provide a better description of the table for users with assistive technologies.
|
|
279
|
+
* Rather than a screen reader speaking "Entering table", passing in an label
|
|
280
|
+
* allows a custom message like "Entering Sample Numerical Data table".
|
|
281
|
+
*/
|
|
282
|
+
label?: string;
|
|
283
|
+
}
|
|
284
|
+
export interface RowType extends React.ComponentPropsWithoutRef<'tr'> {
|
|
285
|
+
cells: Array<RowCellType>;
|
|
286
|
+
key?: string;
|
|
287
|
+
/**
|
|
288
|
+
* A mouse handler to support interaction of a row.
|
|
289
|
+
*/
|
|
290
|
+
onClick?: React.MouseEventHandler;
|
|
291
|
+
/**
|
|
292
|
+
* A key event handler to support interaction of a row.
|
|
293
|
+
*/
|
|
294
|
+
onKeyPress?: React.KeyboardEventHandler;
|
|
295
|
+
/**
|
|
296
|
+
* Highlights the row. Should be used to draw attention to a row; not to indicate selection.
|
|
297
|
+
*/
|
|
298
|
+
isHighlighted?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Hook for automated testing.
|
|
301
|
+
*/
|
|
302
|
+
testId?: string;
|
|
303
|
+
ref?: Ref<HTMLTableRowElement>;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Enum style type to determine whether sort results are ascending or descending.
|
|
307
|
+
*/
|
|
308
|
+
export declare type SortOrderType = 'ASC' | 'DESC';
|
|
309
|
+
/**
|
|
310
|
+
* Determines the size of the table loading spinner.
|
|
311
|
+
* This matches the underlying `Size` type in `@atlaskit/spinner`
|
|
312
|
+
*/
|
|
313
|
+
export declare type SpinnerSizeType = SizeType;
|
|
314
|
+
export declare type LoadingSpinnerSizeType = 'small' | 'large';
|
|
315
|
+
export interface HeadCellType extends RowCellType {
|
|
316
|
+
/**
|
|
317
|
+
* Whether the column the cell sits above is sortable.
|
|
318
|
+
*/
|
|
319
|
+
isSortable?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* The width of the cell as a percentage.
|
|
322
|
+
*/
|
|
323
|
+
width?: number;
|
|
324
|
+
/**
|
|
325
|
+
* Whether the text in the cell will truncate or not if constrained.
|
|
326
|
+
*/
|
|
327
|
+
shouldTruncate?: boolean;
|
|
328
|
+
}
|
|
329
|
+
export interface RankEndLocation {
|
|
330
|
+
index: number;
|
|
331
|
+
afterKey?: string;
|
|
332
|
+
beforeKey?: string;
|
|
333
|
+
}
|
|
334
|
+
export interface RankEnd {
|
|
335
|
+
sourceIndex: number;
|
|
336
|
+
sourceKey: string;
|
|
337
|
+
destination?: RankEndLocation;
|
|
338
|
+
}
|
|
339
|
+
export interface RankStart {
|
|
340
|
+
index: number;
|
|
341
|
+
key: string;
|
|
342
|
+
}
|
|
343
|
+
export interface HeadType {
|
|
344
|
+
cells: Array<HeadCellType>;
|
|
345
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dynamic-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.8.1",
|
|
4
4
|
"description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
"module": "dist/esm/index.js",
|
|
14
14
|
"module:es2019": "dist/es2019/index.js",
|
|
15
15
|
"types": "dist/types/index.d.ts",
|
|
16
|
+
"typesVersions": {
|
|
17
|
+
">=4.0 <4.5": {
|
|
18
|
+
"*": [
|
|
19
|
+
"dist/types-ts4.0/*"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
16
23
|
"sideEffects": false,
|
|
17
24
|
"atlaskit:src": "src/index.tsx",
|
|
18
25
|
"atlassian": {
|
|
@@ -27,12 +34,12 @@
|
|
|
27
34
|
"dependencies": {
|
|
28
35
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
29
36
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
30
|
-
"@atlaskit/pagination": "^14.
|
|
37
|
+
"@atlaskit/pagination": "^14.2.0",
|
|
31
38
|
"@atlaskit/spinner": "^15.0.0",
|
|
32
|
-
"@atlaskit/theme": "^12.
|
|
39
|
+
"@atlaskit/theme": "^12.2.0",
|
|
33
40
|
"@atlaskit/tokens": "^0.10.0",
|
|
34
41
|
"@babel/runtime": "^7.0.0",
|
|
35
|
-
"@emotion/
|
|
42
|
+
"@emotion/react": "^11.7.1",
|
|
36
43
|
"react-beautiful-dnd": "^12.1.1"
|
|
37
44
|
},
|
|
38
45
|
"peerDependencies": {
|
|
@@ -43,18 +50,17 @@
|
|
|
43
50
|
"@atlaskit/avatar": "^21.0.0",
|
|
44
51
|
"@atlaskit/button": "^16.3.0",
|
|
45
52
|
"@atlaskit/docs": "*",
|
|
46
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
53
|
+
"@atlaskit/dropdown-menu": "^11.5.0",
|
|
47
54
|
"@atlaskit/ssr": "*",
|
|
48
|
-
"@atlaskit/toggle": "^12.
|
|
55
|
+
"@atlaskit/toggle": "^12.5.0",
|
|
49
56
|
"@atlaskit/visual-regression": "*",
|
|
50
57
|
"@atlaskit/webdriver-runner": "*",
|
|
51
58
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
52
|
-
"@emotion/styled": "^
|
|
53
|
-
"@testing-library/react": "^
|
|
59
|
+
"@emotion/styled": "^11.0.0",
|
|
60
|
+
"@testing-library/react": "^12.1.5",
|
|
54
61
|
"enzyme": "^3.10.0",
|
|
55
62
|
"react-dom": "^16.8.0",
|
|
56
|
-
"
|
|
57
|
-
"typescript": "4.3.5",
|
|
63
|
+
"typescript": "4.5.5",
|
|
58
64
|
"uuid": "^3.1.0"
|
|
59
65
|
},
|
|
60
66
|
"techstack": {
|
package/theme/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/theme.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/theme.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/theme.d.ts"
|
|
7
|
+
"types": "../dist/types/theme.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/theme.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/types.d.ts"
|
|
7
|
+
"types": "../dist/types/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|