@atlaskit/dynamic-table 14.5.4 → 14.6.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 +22 -0
- package/dist/cjs/components/Stateless.js +3 -2
- package/dist/cjs/components/managed-pagination.js +4 -2
- package/dist/cjs/styled/TableHead.js +2 -2
- package/dist/cjs/theme.js +8 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LoadingContainerAdvanced.js +2 -0
- package/dist/es2019/components/Stateless.js +3 -2
- package/dist/es2019/components/managed-pagination.js +4 -2
- package/dist/es2019/styled/TableHead.js +2 -2
- package/dist/es2019/theme.js +8 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/LoadingContainerAdvanced.js +1 -0
- package/dist/esm/components/Stateless.js +3 -2
- package/dist/esm/components/managed-pagination.js +4 -2
- package/dist/esm/styled/TableHead.js +2 -2
- package/dist/esm/theme.js +8 -8
- package/dist/esm/version.json +1 -1
- package/dist/types/components/managed-pagination.d.ts +1 -0
- package/dist/types/theme.d.ts +4 -4
- package/dist/types/types.d.ts +17 -15
- package/package.json +8 -6
- package/report.api.md +508 -0
- package/theme/package.json +1 -0
- package/types/package.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 14.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`deca22d60e1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/deca22d60e1) - Update DynamicTable HeaderCellType to make it clear that the width prop takes a percentage not a pixel value
|
|
8
|
+
|
|
9
|
+
## 14.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`1cc3c9f1c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cc3c9f1c8f) - Add test ID to table pagination so it can be queried in tests. It will be prefixed with the `testId` prop: `{testId}--pagination`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`0b545855a57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0b545855a57) - [ux] Updated tokens in `@atlaskit/dynamic-table`
|
|
18
|
+
|
|
19
|
+
## 14.5.5
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 14.5.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -52,7 +52,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
52
52
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
53
|
|
|
54
54
|
var packageName = "@atlaskit/dynamic-table";
|
|
55
|
-
var packageVersion = "14.
|
|
55
|
+
var packageVersion = "14.6.1";
|
|
56
56
|
|
|
57
57
|
function toggleSortOrder(currentSortOrder) {
|
|
58
58
|
switch (currentSortOrder) {
|
|
@@ -277,7 +277,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
277
277
|
value: page,
|
|
278
278
|
onChange: this.onSetPage,
|
|
279
279
|
total: totalPages,
|
|
280
|
-
i18n: paginationi18n
|
|
280
|
+
i18n: paginationi18n,
|
|
281
|
+
testId: testId
|
|
281
282
|
})), !rowsExist && emptyBody && /*#__PURE__*/_react.default.createElement(_LoadingContainer.default, {
|
|
282
283
|
isLoading: isLoading,
|
|
283
284
|
spinnerSize: _constants.LARGE,
|
|
@@ -59,7 +59,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
|
59
59
|
total = _this$props.total,
|
|
60
60
|
_this$props$value = _this$props.value,
|
|
61
61
|
value = _this$props$value === void 0 ? 1 : _this$props$value,
|
|
62
|
-
i18n = _this$props.i18n
|
|
62
|
+
i18n = _this$props.i18n,
|
|
63
|
+
testId = _this$props.testId;
|
|
63
64
|
var pages = (0, _toConsumableArray2.default)(Array(total)).map(function (_, index) {
|
|
64
65
|
return index + 1;
|
|
65
66
|
}); // Pagination accepts array now thus selectedIndex starts with 0
|
|
@@ -72,7 +73,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
|
72
73
|
nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
|
|
73
74
|
previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
|
|
74
75
|
onChange: this.onChange,
|
|
75
|
-
pages: pages
|
|
76
|
+
pages: pages,
|
|
77
|
+
testId: testId && "".concat(testId, "--pagination")
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
80
|
}]);
|
|
@@ -44,9 +44,9 @@ var rankingStyles = (0, _core.css)({
|
|
|
44
44
|
|
|
45
45
|
var getHeadStyles = function getHeadStyles(theme) {
|
|
46
46
|
return (0, _core.css)({
|
|
47
|
-
borderBottom: "2px solid ".concat(
|
|
47
|
+
borderBottom: "2px solid ".concat(_theme.head.borderColor({
|
|
48
48
|
theme: theme
|
|
49
|
-
})
|
|
49
|
+
}))
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
|
package/dist/cjs/theme.js
CHANGED
|
@@ -24,16 +24,16 @@ var MSThemeColors = {
|
|
|
24
24
|
exports.MSThemeColors = MSThemeColors;
|
|
25
25
|
var arrow = {
|
|
26
26
|
defaultColor: (0, _components.themed)({
|
|
27
|
-
light: "var(--ds-
|
|
28
|
-
dark: "var(--ds-
|
|
27
|
+
light: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
|
|
28
|
+
dark: "var(--ds-icon-disabled, ".concat(colors.DN40, ")")
|
|
29
29
|
}),
|
|
30
30
|
selectedColor: (0, _components.themed)({
|
|
31
|
-
light: "var(--ds-
|
|
32
|
-
dark: "var(--ds-
|
|
31
|
+
light: "var(--ds-icon-subtle, ".concat(colors.N300, ")"),
|
|
32
|
+
dark: "var(--ds-icon-subtle, ".concat(colors.DN300, ")")
|
|
33
33
|
}),
|
|
34
34
|
hoverColor: (0, _components.themed)({
|
|
35
|
-
light: "var(--ds-
|
|
36
|
-
dark: "var(--ds-
|
|
35
|
+
light: "var(--ds-icon-disabled, ".concat(colors.N60, ")"),
|
|
36
|
+
dark: "var(--ds-icon-disabled, ".concat(colors.DN60, ")")
|
|
37
37
|
})
|
|
38
38
|
};
|
|
39
39
|
exports.arrow = arrow;
|
|
@@ -47,8 +47,8 @@ var row = {
|
|
|
47
47
|
dark: "var(--ds-background-selected, ".concat(colors.DN50, ")")
|
|
48
48
|
}),
|
|
49
49
|
hoverBackground: (0, _components.themed)({
|
|
50
|
-
light: "var(--ds-background-
|
|
51
|
-
dark: "var(--ds-background-
|
|
50
|
+
light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
|
|
51
|
+
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.DN40, ")")
|
|
52
52
|
}),
|
|
53
53
|
hoverHighlightedBackground: (0, _components.themed)({
|
|
54
54
|
light: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")"),
|
package/dist/cjs/version.json
CHANGED
|
@@ -13,7 +13,7 @@ import ManagedPagination from './managed-pagination';
|
|
|
13
13
|
import RankableTableBody from './rankable/Body';
|
|
14
14
|
import TableHead from './TableHead';
|
|
15
15
|
const packageName = "@atlaskit/dynamic-table";
|
|
16
|
-
const packageVersion = "14.
|
|
16
|
+
const packageVersion = "14.6.1";
|
|
17
17
|
|
|
18
18
|
function toggleSortOrder(currentSortOrder) {
|
|
19
19
|
switch (currentSortOrder) {
|
|
@@ -230,7 +230,8 @@ class DynamicTable extends React.Component {
|
|
|
230
230
|
value: page,
|
|
231
231
|
onChange: this.onSetPage,
|
|
232
232
|
total: totalPages,
|
|
233
|
-
i18n: paginationi18n
|
|
233
|
+
i18n: paginationi18n,
|
|
234
|
+
testId: testId
|
|
234
235
|
})), !rowsExist && emptyBody && /*#__PURE__*/React.createElement(LoadingContainer, {
|
|
235
236
|
isLoading: isLoading,
|
|
236
237
|
spinnerSize: LARGE,
|
|
@@ -14,7 +14,8 @@ export default class ManagedPagination extends React.Component {
|
|
|
14
14
|
const {
|
|
15
15
|
total,
|
|
16
16
|
value = 1,
|
|
17
|
-
i18n
|
|
17
|
+
i18n,
|
|
18
|
+
testId
|
|
18
19
|
} = this.props;
|
|
19
20
|
const pages = [...Array(total)].map((_, index) => index + 1); // Pagination accepts array now thus selectedIndex starts with 0
|
|
20
21
|
// So, we are substracting value by one thus not breaking dynamic table
|
|
@@ -26,7 +27,8 @@ export default class ManagedPagination extends React.Component {
|
|
|
26
27
|
nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
|
|
27
28
|
previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
|
|
28
29
|
onChange: this.onChange,
|
|
29
|
-
pages: pages
|
|
30
|
+
pages: pages,
|
|
31
|
+
testId: testId && `${testId}--pagination`
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -16,9 +16,9 @@ const rankingStyles = css({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const getHeadStyles = theme => css({
|
|
19
|
-
borderBottom: `2px solid ${
|
|
19
|
+
borderBottom: `2px solid ${head.borderColor({
|
|
20
20
|
theme
|
|
21
|
-
})}
|
|
21
|
+
})}`
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export const Head = ({
|
package/dist/es2019/theme.js
CHANGED
|
@@ -8,16 +8,16 @@ export const MSThemeColors = {
|
|
|
8
8
|
};
|
|
9
9
|
export const arrow = {
|
|
10
10
|
defaultColor: themed({
|
|
11
|
-
light: `var(--ds-
|
|
12
|
-
dark: `var(--ds-
|
|
11
|
+
light: `var(--ds-icon-disabled, ${colors.N40})`,
|
|
12
|
+
dark: `var(--ds-icon-disabled, ${colors.DN40})`
|
|
13
13
|
}),
|
|
14
14
|
selectedColor: themed({
|
|
15
|
-
light: `var(--ds-
|
|
16
|
-
dark: `var(--ds-
|
|
15
|
+
light: `var(--ds-icon-subtle, ${colors.N300})`,
|
|
16
|
+
dark: `var(--ds-icon-subtle, ${colors.DN300})`
|
|
17
17
|
}),
|
|
18
18
|
hoverColor: themed({
|
|
19
|
-
light: `var(--ds-
|
|
20
|
-
dark: `var(--ds-
|
|
19
|
+
light: `var(--ds-icon-disabled, ${colors.N60})`,
|
|
20
|
+
dark: `var(--ds-icon-disabled, ${colors.DN60})`
|
|
21
21
|
})
|
|
22
22
|
};
|
|
23
23
|
export const row = {
|
|
@@ -30,8 +30,8 @@ export const row = {
|
|
|
30
30
|
dark: `var(--ds-background-selected, ${colors.DN50})`
|
|
31
31
|
}),
|
|
32
32
|
hoverBackground: themed({
|
|
33
|
-
light: `var(--ds-background-
|
|
34
|
-
dark: `var(--ds-background-
|
|
33
|
+
light: `var(--ds-background-neutral-subtle-hovered, ${colors.N10})`,
|
|
34
|
+
dark: `var(--ds-background-neutral-subtle-hovered, ${colors.DN40})`
|
|
35
35
|
}),
|
|
36
36
|
hoverHighlightedBackground: themed({
|
|
37
37
|
light: `var(--ds-background-selected-hovered, ${colors.B75})`,
|
package/dist/es2019/version.json
CHANGED
|
@@ -11,6 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import { findDOMNode } from 'react-dom';
|
|
16
17
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -24,7 +24,7 @@ import ManagedPagination from './managed-pagination';
|
|
|
24
24
|
import RankableTableBody from './rankable/Body';
|
|
25
25
|
import TableHead from './TableHead';
|
|
26
26
|
var packageName = "@atlaskit/dynamic-table";
|
|
27
|
-
var packageVersion = "14.
|
|
27
|
+
var packageVersion = "14.6.1";
|
|
28
28
|
|
|
29
29
|
function toggleSortOrder(currentSortOrder) {
|
|
30
30
|
switch (currentSortOrder) {
|
|
@@ -257,7 +257,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
257
257
|
value: page,
|
|
258
258
|
onChange: this.onSetPage,
|
|
259
259
|
total: totalPages,
|
|
260
|
-
i18n: paginationi18n
|
|
260
|
+
i18n: paginationi18n,
|
|
261
|
+
testId: testId
|
|
261
262
|
})), !rowsExist && emptyBody && /*#__PURE__*/React.createElement(LoadingContainer, {
|
|
262
263
|
isLoading: isLoading,
|
|
263
264
|
spinnerSize: LARGE,
|
|
@@ -44,7 +44,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
|
44
44
|
total = _this$props.total,
|
|
45
45
|
_this$props$value = _this$props.value,
|
|
46
46
|
value = _this$props$value === void 0 ? 1 : _this$props$value,
|
|
47
|
-
i18n = _this$props.i18n
|
|
47
|
+
i18n = _this$props.i18n,
|
|
48
|
+
testId = _this$props.testId;
|
|
48
49
|
|
|
49
50
|
var pages = _toConsumableArray(Array(total)).map(function (_, index) {
|
|
50
51
|
return index + 1;
|
|
@@ -59,7 +60,8 @@ var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
|
59
60
|
nextLabel: i18n === null || i18n === void 0 ? void 0 : i18n.next,
|
|
60
61
|
previousLabel: i18n === null || i18n === void 0 ? void 0 : i18n.prev,
|
|
61
62
|
onChange: this.onChange,
|
|
62
|
-
pages: pages
|
|
63
|
+
pages: pages,
|
|
64
|
+
testId: testId && "".concat(testId, "--pagination")
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
}]);
|
|
@@ -25,9 +25,9 @@ var rankingStyles = css({
|
|
|
25
25
|
|
|
26
26
|
var getHeadStyles = function getHeadStyles(theme) {
|
|
27
27
|
return css({
|
|
28
|
-
borderBottom: "2px solid ".concat(
|
|
28
|
+
borderBottom: "2px solid ".concat(head.borderColor({
|
|
29
29
|
theme: theme
|
|
30
|
-
})
|
|
30
|
+
}))
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
|
package/dist/esm/theme.js
CHANGED
|
@@ -8,16 +8,16 @@ export var MSThemeColors = {
|
|
|
8
8
|
};
|
|
9
9
|
export var arrow = {
|
|
10
10
|
defaultColor: themed({
|
|
11
|
-
light: "var(--ds-
|
|
12
|
-
dark: "var(--ds-
|
|
11
|
+
light: "var(--ds-icon-disabled, ".concat(colors.N40, ")"),
|
|
12
|
+
dark: "var(--ds-icon-disabled, ".concat(colors.DN40, ")")
|
|
13
13
|
}),
|
|
14
14
|
selectedColor: themed({
|
|
15
|
-
light: "var(--ds-
|
|
16
|
-
dark: "var(--ds-
|
|
15
|
+
light: "var(--ds-icon-subtle, ".concat(colors.N300, ")"),
|
|
16
|
+
dark: "var(--ds-icon-subtle, ".concat(colors.DN300, ")")
|
|
17
17
|
}),
|
|
18
18
|
hoverColor: themed({
|
|
19
|
-
light: "var(--ds-
|
|
20
|
-
dark: "var(--ds-
|
|
19
|
+
light: "var(--ds-icon-disabled, ".concat(colors.N60, ")"),
|
|
20
|
+
dark: "var(--ds-icon-disabled, ".concat(colors.DN60, ")")
|
|
21
21
|
})
|
|
22
22
|
};
|
|
23
23
|
export var row = {
|
|
@@ -30,8 +30,8 @@ export var row = {
|
|
|
30
30
|
dark: "var(--ds-background-selected, ".concat(colors.DN50, ")")
|
|
31
31
|
}),
|
|
32
32
|
hoverBackground: themed({
|
|
33
|
-
light: "var(--ds-background-
|
|
34
|
-
dark: "var(--ds-background-
|
|
33
|
+
light: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N10, ")"),
|
|
34
|
+
dark: "var(--ds-background-neutral-subtle-hovered, ".concat(colors.DN40, ")")
|
|
35
35
|
}),
|
|
36
36
|
hoverHighlightedBackground: themed({
|
|
37
37
|
light: "var(--ds-background-selected-hovered, ".concat(colors.B75, ")"),
|
package/dist/esm/version.json
CHANGED
|
@@ -6,6 +6,7 @@ interface ManagedPaginationProps {
|
|
|
6
6
|
onChange: (newValue: any, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
7
7
|
total: number;
|
|
8
8
|
i18n?: I18nShape;
|
|
9
|
+
testId?: string;
|
|
9
10
|
}
|
|
10
11
|
export default class ManagedPagination extends React.Component<ManagedPaginationProps> {
|
|
11
12
|
onChange: (_event: any, newValue: any, analyticsEvent?: UIAnalyticsEvent | undefined) => void;
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ export declare const MSThemeColors: {
|
|
|
5
5
|
SelectedText: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const arrow: {
|
|
8
|
-
defaultColor: import("@atlaskit/theme").ThemedValue<"var(--ds-
|
|
9
|
-
selectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-
|
|
10
|
-
hoverColor: import("@atlaskit/theme").ThemedValue<"var(--ds-
|
|
8
|
+
defaultColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-disabled)">;
|
|
9
|
+
selectedColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-subtle)">;
|
|
10
|
+
hoverColor: import("@atlaskit/theme").ThemedValue<"var(--ds-icon-disabled)">;
|
|
11
11
|
};
|
|
12
12
|
export declare const row: {
|
|
13
13
|
focusOutline: import("@atlaskit/theme").ThemedValue<"var(--ds-border-focused)">;
|
|
14
14
|
highlightedBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected)">;
|
|
15
|
-
hoverBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-
|
|
15
|
+
hoverBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-neutral-subtle-hovered)">;
|
|
16
16
|
hoverHighlightedBackground: import("@atlaskit/theme").ThemedValue<"var(--ds-background-selected-hovered)">;
|
|
17
17
|
};
|
|
18
18
|
export declare const head: {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -134,13 +134,14 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
134
134
|
`data-testid` in the rendered code, serving as a hook for automated tests.
|
|
135
135
|
|
|
136
136
|
The value of `testId` is used to prefix `testId` props in given elements.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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.
|
|
144
145
|
*/
|
|
145
146
|
testId?: string;
|
|
146
147
|
/**
|
|
@@ -265,13 +266,14 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
265
266
|
`data-testid` in the rendered code, serving as a hook for automated tests.
|
|
266
267
|
|
|
267
268
|
The value of `testId` is used to prefix `testId` props in given elements.
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
269
|
+
- `{testId}--table` - Table.
|
|
270
|
+
- `{testId}--head` - Table header.
|
|
271
|
+
- `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
|
|
272
|
+
- `{testId}--row--{index - content of the first cell}` - Table row.
|
|
273
|
+
- `{testId}--body` - Table body.
|
|
274
|
+
- `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
|
|
275
|
+
- `{testId}--loadingSpinner` - The spinner overlaid when loading.
|
|
276
|
+
- `{testId}--pagination` - The table pagination.
|
|
275
277
|
*/
|
|
276
278
|
testId?: string;
|
|
277
279
|
/**
|
|
@@ -315,7 +317,7 @@ export declare type LoadingSpinnerSizeType = 'small' | 'large';
|
|
|
315
317
|
export interface HeadCellType extends RowCellType {
|
|
316
318
|
/** Whether the column the cell sits above is sortable. */
|
|
317
319
|
isSortable?: boolean;
|
|
318
|
-
/** The
|
|
320
|
+
/** The width of the cell as a percentage. */
|
|
319
321
|
width?: number;
|
|
320
322
|
/** Whether the text in the cell will truncate or not if constrained. */
|
|
321
323
|
shouldTruncate?: boolean;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dynamic-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.6.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/"
|
|
7
7
|
},
|
|
8
8
|
"homepage": "https://atlassian.design/components/dynamic-table/",
|
|
9
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
9
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
10
10
|
"author": "Atlassian Pty Ltd",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"main": "dist/cjs/index.js",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"deprecatedAutoEntryPoints": true,
|
|
21
21
|
"releaseModel": "scheduled",
|
|
22
22
|
"website": {
|
|
23
|
-
"name": "Dynamic table"
|
|
23
|
+
"name": "Dynamic table",
|
|
24
|
+
"category": "Components"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"@atlaskit/pagination": "^14.0.0",
|
|
29
30
|
"@atlaskit/spinner": "^15.0.0",
|
|
30
31
|
"@atlaskit/theme": "^12.1.0",
|
|
31
|
-
"@atlaskit/tokens": "^0.
|
|
32
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
32
33
|
"@babel/runtime": "^7.0.0",
|
|
33
34
|
"@emotion/core": "^10.0.9",
|
|
34
35
|
"react-beautiful-dnd": "^12.1.1"
|
|
@@ -38,10 +39,10 @@
|
|
|
38
39
|
"react-dom": "^16.8.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@atlaskit/avatar": "^
|
|
42
|
+
"@atlaskit/avatar": "^21.0.0",
|
|
42
43
|
"@atlaskit/button": "^16.3.0",
|
|
43
44
|
"@atlaskit/docs": "*",
|
|
44
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
45
|
+
"@atlaskit/dropdown-menu": "^11.2.0",
|
|
45
46
|
"@atlaskit/ssr": "*",
|
|
46
47
|
"@atlaskit/toggle": "^12.4.0",
|
|
47
48
|
"@atlaskit/visual-regression": "*",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"import-structure": "atlassian-conventions"
|
|
61
62
|
},
|
|
62
63
|
"@repo/internal": {
|
|
64
|
+
"dom-events": "use-bind-event-listener",
|
|
63
65
|
"theming": "tokens",
|
|
64
66
|
"deprecation": "no-deprecated-imports",
|
|
65
67
|
"styling": [
|
package/report.api.md
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/dynamic-table"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
````ts
|
|
6
|
+
import { default as React_2 } from 'react';
|
|
7
|
+
import { Ref } from 'react';
|
|
8
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
9
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
10
|
+
import { WithContextProps } from '@atlaskit/analytics-next';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* __Dynamic Table__
|
|
14
|
+
*
|
|
15
|
+
* A table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
|
|
16
|
+
*
|
|
17
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
18
|
+
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* import DynamicTable from '@atlaskit/dynamic-table';
|
|
23
|
+
*
|
|
24
|
+
* export default function TableUncontrolled() {
|
|
25
|
+
* return (
|
|
26
|
+
* <DynamicTable
|
|
27
|
+
* head={head}
|
|
28
|
+
* rows={rows}
|
|
29
|
+
* rowsPerPage={10}
|
|
30
|
+
* defaultPage={1}
|
|
31
|
+
* loadingSpinnerSize="large"
|
|
32
|
+
* isLoading={false}
|
|
33
|
+
* />
|
|
34
|
+
* );
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare class DynamicTable extends React_2.Component<StatefulProps, State> {
|
|
39
|
+
static defaultProps: {
|
|
40
|
+
defaultPage: number;
|
|
41
|
+
isLoading: boolean;
|
|
42
|
+
isFixedSize: boolean;
|
|
43
|
+
isRankable: boolean;
|
|
44
|
+
onSetPage: () => void;
|
|
45
|
+
onSort: () => void;
|
|
46
|
+
rowsPerPage: number;
|
|
47
|
+
};
|
|
48
|
+
state: {
|
|
49
|
+
page: number | undefined;
|
|
50
|
+
sortKey: string | undefined;
|
|
51
|
+
sortOrder: SortOrderType | undefined;
|
|
52
|
+
rows: RowType[] | undefined;
|
|
53
|
+
};
|
|
54
|
+
UNSAFE_componentWillReceiveProps(newProps: StatefulProps): void;
|
|
55
|
+
onSetPage: (
|
|
56
|
+
page: number,
|
|
57
|
+
analyticsEvent?: UIAnalyticsEvent | undefined,
|
|
58
|
+
) => void;
|
|
59
|
+
onSort: (
|
|
60
|
+
{ key, item, sortOrder }: any,
|
|
61
|
+
analyticsEvent?: UIAnalyticsEvent | undefined,
|
|
62
|
+
) => void;
|
|
63
|
+
onRankEndIfExists: (params: RankEnd) => void;
|
|
64
|
+
onRankEnd: (params: RankEnd) => void;
|
|
65
|
+
render(): JSX.Element;
|
|
66
|
+
}
|
|
67
|
+
export default DynamicTable;
|
|
68
|
+
|
|
69
|
+
export declare const DynamicTableStateless: React_2.ForwardRefExoticComponent<
|
|
70
|
+
Pick<
|
|
71
|
+
Pick<
|
|
72
|
+
Omit<StatelessProps, keyof WithAnalyticsEventsProps>,
|
|
73
|
+
| 'caption'
|
|
74
|
+
| 'head'
|
|
75
|
+
| 'label'
|
|
76
|
+
| 'rows'
|
|
77
|
+
| 'sortKey'
|
|
78
|
+
| 'sortOrder'
|
|
79
|
+
| 'onPageRowsUpdate'
|
|
80
|
+
| 'testId'
|
|
81
|
+
| 'highlightedRowIndex'
|
|
82
|
+
| 'emptyView'
|
|
83
|
+
| 'loadingSpinnerSize'
|
|
84
|
+
| 'totalRows'
|
|
85
|
+
> &
|
|
86
|
+
Partial<
|
|
87
|
+
Pick<
|
|
88
|
+
Omit<StatelessProps, keyof WithAnalyticsEventsProps>,
|
|
89
|
+
| 'isFixedSize'
|
|
90
|
+
| 'page'
|
|
91
|
+
| 'rowsPerPage'
|
|
92
|
+
| 'isLoading'
|
|
93
|
+
| 'isRankingDisabled'
|
|
94
|
+
| 'onRankStart'
|
|
95
|
+
| 'onRankEnd'
|
|
96
|
+
| 'onSort'
|
|
97
|
+
| 'isRankable'
|
|
98
|
+
| 'onSetPage'
|
|
99
|
+
| 'paginationi18n'
|
|
100
|
+
>
|
|
101
|
+
> &
|
|
102
|
+
Partial<
|
|
103
|
+
Pick<
|
|
104
|
+
{
|
|
105
|
+
isLoading: boolean;
|
|
106
|
+
isFixedSize: boolean;
|
|
107
|
+
rowsPerPage: number;
|
|
108
|
+
onSetPage: () => void;
|
|
109
|
+
onSort: () => void;
|
|
110
|
+
page: number;
|
|
111
|
+
isRankable: boolean;
|
|
112
|
+
isRankingDisabled: boolean;
|
|
113
|
+
onRankStart: () => void;
|
|
114
|
+
onRankEnd: () => void;
|
|
115
|
+
paginationi18n: {
|
|
116
|
+
prev: string;
|
|
117
|
+
next: string;
|
|
118
|
+
label: string;
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
never
|
|
122
|
+
>
|
|
123
|
+
> &
|
|
124
|
+
React_2.RefAttributes<any> &
|
|
125
|
+
WithContextProps,
|
|
126
|
+
| 'caption'
|
|
127
|
+
| 'head'
|
|
128
|
+
| 'label'
|
|
129
|
+
| 'key'
|
|
130
|
+
| 'isFixedSize'
|
|
131
|
+
| 'rows'
|
|
132
|
+
| 'page'
|
|
133
|
+
| 'rowsPerPage'
|
|
134
|
+
| 'sortKey'
|
|
135
|
+
| 'sortOrder'
|
|
136
|
+
| 'onPageRowsUpdate'
|
|
137
|
+
| 'testId'
|
|
138
|
+
| 'highlightedRowIndex'
|
|
139
|
+
| 'isLoading'
|
|
140
|
+
| 'isRankingDisabled'
|
|
141
|
+
| 'onRankStart'
|
|
142
|
+
| 'onRankEnd'
|
|
143
|
+
| 'onSort'
|
|
144
|
+
| 'isRankable'
|
|
145
|
+
| 'emptyView'
|
|
146
|
+
| 'loadingSpinnerSize'
|
|
147
|
+
| 'totalRows'
|
|
148
|
+
| 'onSetPage'
|
|
149
|
+
| 'paginationi18n'
|
|
150
|
+
| 'analyticsContext'
|
|
151
|
+
> &
|
|
152
|
+
React_2.RefAttributes<any>
|
|
153
|
+
>;
|
|
154
|
+
|
|
155
|
+
declare interface HeadCellType extends RowCellType {
|
|
156
|
+
/** Whether the column the cell sits above is sortable. */
|
|
157
|
+
isSortable?: boolean;
|
|
158
|
+
/** The pixel width of the cell. */
|
|
159
|
+
width?: number;
|
|
160
|
+
/** Whether the text in the cell will truncate or not if constrained. */
|
|
161
|
+
shouldTruncate?: boolean;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare interface HeadType {
|
|
165
|
+
cells: Array<HeadCellType>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare interface I18nShape {
|
|
169
|
+
/**
|
|
170
|
+
* Accessible label applied to the previous page button in the pagination component.
|
|
171
|
+
*/
|
|
172
|
+
prev: string;
|
|
173
|
+
/**
|
|
174
|
+
* Accessible label applied to the next page button in the pagination component.
|
|
175
|
+
*/
|
|
176
|
+
next: string;
|
|
177
|
+
/**
|
|
178
|
+
* Accessible label applied to the current page button in the pagination component.
|
|
179
|
+
*/
|
|
180
|
+
label: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare type LoadingSpinnerSizeType = 'small' | 'large';
|
|
184
|
+
|
|
185
|
+
declare interface RankEnd {
|
|
186
|
+
sourceIndex: number;
|
|
187
|
+
sourceKey: string;
|
|
188
|
+
destination?: RankEndLocation;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
declare interface RankEndLocation {
|
|
192
|
+
index: number;
|
|
193
|
+
afterKey?: string;
|
|
194
|
+
beforeKey?: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare interface RankStart {
|
|
198
|
+
index: number;
|
|
199
|
+
key: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare interface RowCellType {
|
|
203
|
+
/**
|
|
204
|
+
* Key to resolve sorting this cell in its column.
|
|
205
|
+
*/
|
|
206
|
+
key?: string | number;
|
|
207
|
+
/**
|
|
208
|
+
* The number of columns a cell should span. Defaults to 1, and maxes out at the total column width of the table.
|
|
209
|
+
*/
|
|
210
|
+
colSpan?: number;
|
|
211
|
+
/**
|
|
212
|
+
* The content of the cell.
|
|
213
|
+
*/
|
|
214
|
+
content?: React_2.ReactNode | string;
|
|
215
|
+
/**
|
|
216
|
+
* Hook for automated testing.
|
|
217
|
+
*/
|
|
218
|
+
testId?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare interface RowType extends React_2.ComponentPropsWithoutRef<'tr'> {
|
|
222
|
+
cells: Array<RowCellType>;
|
|
223
|
+
key?: string;
|
|
224
|
+
/**
|
|
225
|
+
* A mouse handler to support interaction of a row.
|
|
226
|
+
*/
|
|
227
|
+
onClick?: React_2.MouseEventHandler;
|
|
228
|
+
/**
|
|
229
|
+
* A key event handler to support interaction of a row.
|
|
230
|
+
*/
|
|
231
|
+
onKeyPress?: React_2.KeyboardEventHandler;
|
|
232
|
+
/**
|
|
233
|
+
* Highlights the row. Should be used to draw attention to a row; not to indicate selection.
|
|
234
|
+
*/
|
|
235
|
+
isHighlighted?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Hook for automated testing.
|
|
238
|
+
*/
|
|
239
|
+
testId?: string;
|
|
240
|
+
ref?: Ref<HTMLTableRowElement>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Enum style type to determine whether sort results are ascending or descending.
|
|
245
|
+
*/
|
|
246
|
+
declare type SortOrderType = 'ASC' | 'DESC';
|
|
247
|
+
|
|
248
|
+
declare interface State {
|
|
249
|
+
page?: number;
|
|
250
|
+
sortKey?: string;
|
|
251
|
+
sortOrder?: SortOrderType;
|
|
252
|
+
rows?: RowType[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare interface StatefulProps extends WithAnalyticsEventsProps {
|
|
256
|
+
/**
|
|
257
|
+
* Caption for the table styled as a heading.
|
|
258
|
+
*/
|
|
259
|
+
caption?: React_2.ReactNode;
|
|
260
|
+
/**
|
|
261
|
+
* Cells to be placed in the head of the table.
|
|
262
|
+
* Each element in the head creates a new column.
|
|
263
|
+
*/
|
|
264
|
+
head?: HeadType;
|
|
265
|
+
/**
|
|
266
|
+
* Rows to be placed in the table.
|
|
267
|
+
* Each row contains cells which should map to the ones defined in the head.
|
|
268
|
+
* Rows accept standard HTML <tr> props in addition to those listed below.
|
|
269
|
+
|
|
270
|
+
* Ensure each cell has a unique `key` per column - this is used for both React's reconciliation of lists and column sorting.
|
|
271
|
+
*/
|
|
272
|
+
rows?: Array<RowType>;
|
|
273
|
+
/**
|
|
274
|
+
* Shown when the table has no content.
|
|
275
|
+
*/
|
|
276
|
+
emptyView?: React_2.ReactElement<any>;
|
|
277
|
+
/**
|
|
278
|
+
* Configuration of the loading spinner shown when `isLoading` is true.
|
|
279
|
+
* Defaults to `"large"` when a page has more than two rows, else `"small"`.
|
|
280
|
+
*/
|
|
281
|
+
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
282
|
+
/**
|
|
283
|
+
* Displays a loading spinner overlaid on top of the current page.
|
|
284
|
+
*/
|
|
285
|
+
isLoading?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Displays columns as their initial width regardless of the content that loads in.
|
|
288
|
+
*/
|
|
289
|
+
isFixedSize?: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Controls how many rows should be diplayed per page.
|
|
292
|
+
*/
|
|
293
|
+
rowsPerPage?: number;
|
|
294
|
+
/**
|
|
295
|
+
* Callback fired when the table page has changed,
|
|
296
|
+
* useful when wanting to control dynamic table.
|
|
297
|
+
*/
|
|
298
|
+
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
299
|
+
/**
|
|
300
|
+
* Callback fired when a column heading has been sorted,
|
|
301
|
+
* useful when wanting to control dynamic table.
|
|
302
|
+
*/
|
|
303
|
+
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
304
|
+
/**
|
|
305
|
+
* Callback fired when the rows displayed on a page have changed.
|
|
306
|
+
*/
|
|
307
|
+
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
308
|
+
/**
|
|
309
|
+
* Page the table should show.
|
|
310
|
+
* Useful when wanting to control dynamic table.
|
|
311
|
+
*/
|
|
312
|
+
page?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Default page dynamic table should show when initially rendering.
|
|
315
|
+
*/
|
|
316
|
+
defaultPage?: number;
|
|
317
|
+
/**
|
|
318
|
+
* Column key that the rows should be sorted by.
|
|
319
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
320
|
+
* Useful when wanting to control dynamic table.
|
|
321
|
+
*/
|
|
322
|
+
sortKey?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Default column sort key that the rows should be sorted by.
|
|
325
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
326
|
+
*/
|
|
327
|
+
defaultSortKey?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Column sort order.
|
|
330
|
+
* Useful when wanting to control dynamic table.
|
|
331
|
+
*/
|
|
332
|
+
sortOrder?: SortOrderType;
|
|
333
|
+
/**
|
|
334
|
+
* Default column sort order used when initially rendering.
|
|
335
|
+
* Defaults to `"ASC"`.
|
|
336
|
+
*/
|
|
337
|
+
defaultSortOrder?: SortOrderType;
|
|
338
|
+
/**
|
|
339
|
+
* Enables drag & drop sorting of table rows.
|
|
340
|
+
*/
|
|
341
|
+
isRankable?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* Disables being able to drop rows on the table.
|
|
344
|
+
* Drag will still function.
|
|
345
|
+
*/
|
|
346
|
+
isRankingDisabled?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Callback fired when a drag of a row has started.
|
|
349
|
+
*/
|
|
350
|
+
onRankStart?: (rankStart: RankStart) => void;
|
|
351
|
+
/**
|
|
352
|
+
* Callback fired when a drop of a row has completed.
|
|
353
|
+
*/
|
|
354
|
+
onRankEnd?: (rankEnd: RankEnd) => void;
|
|
355
|
+
/**
|
|
356
|
+
* Labels for the previous and next buttons used in pagination.
|
|
357
|
+
* Defaults to `"previous"` and `"next"`.
|
|
358
|
+
*/
|
|
359
|
+
paginationi18n?: I18nShape;
|
|
360
|
+
/**
|
|
361
|
+
* Will highlight a row(s) of the table.
|
|
362
|
+
*/
|
|
363
|
+
highlightedRowIndex?: number | number[];
|
|
364
|
+
/**
|
|
365
|
+
A `testId` prop is provided for specified elements,
|
|
366
|
+
which is a unique string that appears as a data attribute
|
|
367
|
+
`data-testid` in the rendered code, serving as a hook for automated tests.
|
|
368
|
+
|
|
369
|
+
The value of `testId` is used to prefix `testId` props in given elements.
|
|
370
|
+
- `{testId}--table` - Table.
|
|
371
|
+
- `{testId}--head` - Table header.
|
|
372
|
+
- `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
|
|
373
|
+
- `{testId}--row--{index - content of the first cell}` - Table row.
|
|
374
|
+
- `{testId}--body` - Table body.
|
|
375
|
+
- `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
|
|
376
|
+
- `{testId}--loadingSpinner` - The spinner overlaid when loading.
|
|
377
|
+
- `{testId}--pagination` - The table pagination.
|
|
378
|
+
*/
|
|
379
|
+
testId?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Used to provide a better description of the table for users with assistive technologies.
|
|
382
|
+
* Rather than a screen reader speaking "Entering table", passing in an label
|
|
383
|
+
* allows a custom message like "Entering Sample Numerical Data table".
|
|
384
|
+
*/
|
|
385
|
+
label?: string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
declare interface StatelessProps extends WithAnalyticsEventsProps {
|
|
389
|
+
/**
|
|
390
|
+
* Caption for the table styled as a heading.
|
|
391
|
+
*/
|
|
392
|
+
caption?: React_2.ReactNode;
|
|
393
|
+
/**
|
|
394
|
+
* Cells to be placed in the head of the table.
|
|
395
|
+
* Each element in the head creates a new column.
|
|
396
|
+
*/
|
|
397
|
+
head?: HeadType;
|
|
398
|
+
/**
|
|
399
|
+
* Rows to be placed in the table.
|
|
400
|
+
* Each row contains cells which should map to the ones defined in the head.
|
|
401
|
+
|
|
402
|
+
* Ensure each cell has a unique `key` per column - this is used for both Reacts reconcilation of lists and column sorting.
|
|
403
|
+
*/
|
|
404
|
+
rows?: Array<RowType>;
|
|
405
|
+
/**
|
|
406
|
+
* Shown when the table has no content.
|
|
407
|
+
*/
|
|
408
|
+
emptyView?: React_2.ReactElement<any>;
|
|
409
|
+
/**
|
|
410
|
+
* Configuration of the loading spinner shown when `isLoading` is true.
|
|
411
|
+
* Defaults to `"large"` when a page has more than two rows, else `"small"`.
|
|
412
|
+
*/
|
|
413
|
+
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
414
|
+
/**
|
|
415
|
+
* Displays a loading spinner overlaid on top of the current page.
|
|
416
|
+
*/
|
|
417
|
+
isLoading?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Displays columns as their initial width regardless of the content that loads in.
|
|
420
|
+
*/
|
|
421
|
+
isFixedSize?: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* Controls how many rows should be displayed per page.
|
|
424
|
+
*/
|
|
425
|
+
rowsPerPage?: number;
|
|
426
|
+
/**
|
|
427
|
+
* Total number of rows, in case of paginated data.
|
|
428
|
+
*/
|
|
429
|
+
totalRows?: number;
|
|
430
|
+
/**
|
|
431
|
+
* Callback fired when the table page has changed,
|
|
432
|
+
* useful when wanting to control the pagination of the table.
|
|
433
|
+
*/
|
|
434
|
+
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
435
|
+
/**
|
|
436
|
+
* Callback fired when a column heading has been sorted,
|
|
437
|
+
* useful when wanting to control the sort order of the table.
|
|
438
|
+
*/
|
|
439
|
+
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
440
|
+
/**
|
|
441
|
+
* Callback fired when the rows displayed on a page have changed.
|
|
442
|
+
*/
|
|
443
|
+
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
444
|
+
/**
|
|
445
|
+
* Page the table should show.
|
|
446
|
+
*/
|
|
447
|
+
page?: number;
|
|
448
|
+
/**
|
|
449
|
+
* Column key that the rows should be sorted by.
|
|
450
|
+
* Corresponds to the `key`'s defined in the `head` prop.
|
|
451
|
+
*/
|
|
452
|
+
sortKey?: string;
|
|
453
|
+
/**
|
|
454
|
+
* Column sort order.
|
|
455
|
+
*/
|
|
456
|
+
sortOrder?: SortOrderType;
|
|
457
|
+
/**
|
|
458
|
+
* Enables drag & drop sorting of table rows.
|
|
459
|
+
*/
|
|
460
|
+
isRankable?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* Disables being able to drop rows on the table.
|
|
463
|
+
* Drag will still function.
|
|
464
|
+
*/
|
|
465
|
+
isRankingDisabled?: boolean;
|
|
466
|
+
/**
|
|
467
|
+
* Callback fired when a drag of a row has started.
|
|
468
|
+
*/
|
|
469
|
+
onRankStart?: (rankStart: RankStart) => void;
|
|
470
|
+
/**
|
|
471
|
+
* Callback fired when a drop of a row has completed.
|
|
472
|
+
*/
|
|
473
|
+
onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
474
|
+
/**
|
|
475
|
+
* Labels for the pagination wrapper, previous and next buttons used in pagination.
|
|
476
|
+
* Defaults to `"pagination"`, `"previous"` and `"next"`.
|
|
477
|
+
*/
|
|
478
|
+
paginationi18n?: I18nShape;
|
|
479
|
+
/**
|
|
480
|
+
* Will highlight a row(s) of the table. Should be used to draw attention to a row; not to indicate selection.
|
|
481
|
+
*/
|
|
482
|
+
highlightedRowIndex?: number | number[];
|
|
483
|
+
/**
|
|
484
|
+
A `testId` prop is provided for specified elements,
|
|
485
|
+
which is a unique string that appears as a data attribute
|
|
486
|
+
`data-testid` in the rendered code, serving as a hook for automated tests.
|
|
487
|
+
|
|
488
|
+
The value of `testId` is used to prefix `testId` props in given elements.
|
|
489
|
+
- `{testId}--table` - Table.
|
|
490
|
+
- `{testId}--head` - Table header.
|
|
491
|
+
- `{testId}--head--{content of the cell}` - Table header cell can be identified by their content.
|
|
492
|
+
- `{testId}--row--{index - content of the first cell}` - Table row.
|
|
493
|
+
- `{testId}--body` - Table body.
|
|
494
|
+
- `{testId}--body--{content of the cell}` - Table body cell can be identified by their content.
|
|
495
|
+
- `{testId}--loadingSpinner` - The spinner overlaid when loading.
|
|
496
|
+
- `{testId}--pagination` - The table pagination.
|
|
497
|
+
*/
|
|
498
|
+
testId?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Used to provide a better description of the table for users with assistive technologies.
|
|
501
|
+
* Rather than a screen reader speaking "Entering table", passing in an label
|
|
502
|
+
* allows a custom message like "Entering Sample Numerical Data table".
|
|
503
|
+
*/
|
|
504
|
+
label?: string;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export {};
|
|
508
|
+
````
|
package/theme/package.json
CHANGED