@atlaskit/table-tree 9.12.2 → 10.0.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/CHANGELOG.md +10 -0
- package/dist/cjs/components/cell.js +19 -41
- package/dist/cjs/components/header.js +23 -38
- package/dist/cjs/components/headers.js +31 -40
- package/dist/cjs/components/internal/chevron.js +32 -59
- package/dist/cjs/components/internal/item.js +38 -52
- package/dist/cjs/components/internal/items.js +31 -83
- package/dist/cjs/components/internal/loader-item.js +34 -66
- package/dist/cjs/components/internal/with-column-width.js +2 -4
- package/dist/cjs/components/row.js +120 -177
- package/dist/cjs/components/rows.js +17 -37
- package/dist/cjs/components/table-tree.js +75 -119
- package/dist/es2019/components/cell.js +18 -22
- package/dist/es2019/components/header.js +17 -21
- package/dist/es2019/components/headers.js +22 -19
- package/dist/es2019/components/internal/chevron.js +25 -35
- package/dist/es2019/components/internal/item.js +32 -36
- package/dist/es2019/components/internal/items.js +24 -60
- package/dist/es2019/components/internal/loader-item.js +29 -46
- package/dist/es2019/components/internal/with-column-width.js +2 -4
- package/dist/es2019/components/row.js +95 -147
- package/dist/es2019/components/rows.js +17 -17
- package/dist/es2019/components/table-tree.js +66 -90
- package/dist/esm/components/cell.js +19 -38
- package/dist/esm/components/header.js +17 -36
- package/dist/esm/components/headers.js +26 -40
- package/dist/esm/components/internal/chevron.js +29 -57
- package/dist/esm/components/internal/item.js +33 -53
- package/dist/esm/components/internal/items.js +32 -86
- package/dist/esm/components/internal/loader-item.js +33 -68
- package/dist/esm/components/internal/with-column-width.js +2 -4
- package/dist/esm/components/row.js +116 -179
- package/dist/esm/components/rows.js +17 -35
- package/dist/esm/components/table-tree.js +75 -121
- package/dist/types/components/header.d.ts +11 -1
- package/dist/types/components/headers.d.ts +13 -3
- package/dist/types/components/internal/chevron.d.ts +15 -13
- package/dist/types/components/internal/item.d.ts +24 -12
- package/dist/types/components/internal/items.d.ts +12 -23
- package/dist/types/components/internal/loader-item.d.ts +7 -16
- package/dist/types/components/row.d.ts +11 -39
- package/dist/types/components/rows.d.ts +15 -10
- package/dist/types/components/table-tree.d.ts +10 -20
- package/dist/types-ts4.5/components/header.d.ts +11 -1
- package/dist/types-ts4.5/components/headers.d.ts +13 -3
- package/dist/types-ts4.5/components/internal/chevron.d.ts +15 -13
- package/dist/types-ts4.5/components/internal/item.d.ts +24 -12
- package/dist/types-ts4.5/components/internal/items.d.ts +12 -23
- package/dist/types-ts4.5/components/internal/loader-item.d.ts +7 -16
- package/dist/types-ts4.5/components/row.d.ts +11 -39
- package/dist/types-ts4.5/components/rows.d.ts +15 -10
- package/dist/types-ts4.5/components/table-tree.d.ts +10 -20
- package/package.json +5 -9
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
type
|
|
3
|
-
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type RowProps } from './row';
|
|
3
|
+
type Content = {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
4
6
|
};
|
|
5
|
-
export interface RowsProps<
|
|
7
|
+
export interface RowsProps<Item> {
|
|
6
8
|
/**
|
|
7
9
|
* The data used to render the set of rows. Will be passed down via the `children` render prop.
|
|
8
10
|
*
|
|
9
11
|
* In addition to these props, any other data can be added to the object, and it will
|
|
10
12
|
* be provided as props when rendering each cell.
|
|
11
13
|
*/
|
|
12
|
-
items?:
|
|
14
|
+
items?: Item[];
|
|
13
15
|
/**
|
|
14
16
|
* Render function for child rows. Render props will contain an item from the
|
|
15
17
|
* `items` prop above.
|
|
16
18
|
*/
|
|
17
|
-
render: (args:
|
|
19
|
+
render: (args: Item & {
|
|
20
|
+
children?: Item[];
|
|
21
|
+
content?: Content;
|
|
22
|
+
}) => ReactElement<RowProps<Item>> | null;
|
|
18
23
|
/**
|
|
19
24
|
* This is an accessible name for the loading state's spinner.
|
|
20
25
|
* The default text is "Loading".
|
|
21
26
|
*/
|
|
22
27
|
loadingLabel?: string;
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
export
|
|
29
|
+
declare function Rows<T extends {
|
|
30
|
+
id: string;
|
|
31
|
+
}>({ items, render, loadingLabel }: RowsProps<T>): JSX.Element;
|
|
32
|
+
export default Rows;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ElementType, type ReactNode } from 'react';
|
|
2
2
|
import { type ColumnWidth } from './internal/context';
|
|
3
|
-
import type Item from './internal/item';
|
|
4
|
-
declare class Content extends Object {
|
|
5
|
-
}
|
|
6
3
|
/**
|
|
7
4
|
* This is hard-coded here because our actual <TableTree /> has no typings
|
|
8
5
|
* for its props.
|
|
@@ -11,7 +8,7 @@ declare class Content extends Object {
|
|
|
11
8
|
*
|
|
12
9
|
* Defining it here for now lets us provide *something* without much headache.
|
|
13
10
|
*/
|
|
14
|
-
export
|
|
11
|
+
export interface TableTreeProps<Item> {
|
|
15
12
|
/**
|
|
16
13
|
* The contents of the table.
|
|
17
14
|
* Use this when composing `Cell`, `Header`, `Headers`, `Row`, and `Rows` components.
|
|
@@ -22,11 +19,11 @@ export type TableTreeProps = {
|
|
|
22
19
|
* Each column component is used to render the cells in that column.
|
|
23
20
|
* A cell's `content` value, specified in the data passed to `items`, is provided as props.
|
|
24
21
|
*/
|
|
25
|
-
columns?: ElementType
|
|
22
|
+
columns?: ElementType[];
|
|
26
23
|
/**
|
|
27
24
|
* The widths of the columns in the table.
|
|
28
25
|
*/
|
|
29
|
-
columnWidths?:
|
|
26
|
+
columnWidths?: ColumnWidth[];
|
|
30
27
|
/**
|
|
31
28
|
* The header text of the columns of the table.
|
|
32
29
|
*/
|
|
@@ -36,11 +33,11 @@ export type TableTreeProps = {
|
|
|
36
33
|
|
|
37
34
|
If your cells contain interactive elements, always set this to `false` to avoid unexpected expanding or collapsing.
|
|
38
35
|
|
|
39
|
-
If you aren
|
|
36
|
+
If you aren't using the `items` prop, `shouldExpandOnClick` should be used on the row component instead.
|
|
40
37
|
*/
|
|
41
38
|
shouldExpandOnClick?: boolean;
|
|
42
39
|
/**
|
|
43
|
-
The data used to render the table. If you
|
|
40
|
+
The data used to render the table. If you're creating a basic table, use this prop instead of composing cell, header, headers, row, and rows components.
|
|
44
41
|
|
|
45
42
|
In addition to the `items` props, any other data can be added, and it will
|
|
46
43
|
be provided as props when rendering each cell.
|
|
@@ -62,15 +59,8 @@ export type TableTreeProps = {
|
|
|
62
59
|
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
63
60
|
*/
|
|
64
61
|
referencedLabel?: string;
|
|
65
|
-
};
|
|
66
|
-
interface State {
|
|
67
|
-
columnWidths: ColumnWidth[];
|
|
68
|
-
}
|
|
69
|
-
export default class TableTree extends Component<any, State> {
|
|
70
|
-
state: State;
|
|
71
|
-
componentDidMount(): void;
|
|
72
|
-
setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
|
|
73
|
-
getColumnWidth: (columnIndex: any) => ColumnWidth | null;
|
|
74
|
-
render(): JSX.Element;
|
|
75
62
|
}
|
|
76
|
-
|
|
63
|
+
declare function TableTree<Item extends {
|
|
64
|
+
id: string;
|
|
65
|
+
}>({ children, columns, columnWidths: defaultColumnWidths, headers, shouldExpandOnClick, items, mainColumnForExpandCollapseLabel, label, referencedLabel, }: TableTreeProps<Item>): JSX.Element;
|
|
66
|
+
export default TableTree;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/table-tree",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "A table tree is an expandable table for showing nested hierarchies of information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"releaseModel": "continuous",
|
|
20
|
-
"productPushConsumption": [
|
|
21
|
-
"jira"
|
|
22
|
-
],
|
|
23
19
|
"website": {
|
|
24
20
|
"name": "Table tree",
|
|
25
21
|
"category": "Components"
|
|
@@ -28,11 +24,12 @@
|
|
|
28
24
|
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
31
|
-
"@atlaskit/button": "^20.
|
|
32
|
-
"@atlaskit/
|
|
27
|
+
"@atlaskit/button": "^20.1.0",
|
|
28
|
+
"@atlaskit/ds-lib": "^2.5.0",
|
|
29
|
+
"@atlaskit/icon": "^22.16.0",
|
|
33
30
|
"@atlaskit/spinner": "^16.3.0",
|
|
34
31
|
"@atlaskit/theme": "^13.0.0",
|
|
35
|
-
"@atlaskit/tokens": "^1.
|
|
32
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
36
33
|
"@babel/runtime": "^7.0.0",
|
|
37
34
|
"@emotion/react": "^11.7.1",
|
|
38
35
|
"lodash": "^4.17.21"
|
|
@@ -43,7 +40,6 @@
|
|
|
43
40
|
"devDependencies": {
|
|
44
41
|
"@af/accessibility-testing": "*",
|
|
45
42
|
"@af/visual-regression": "*",
|
|
46
|
-
"@atlaskit/ds-lib": "^2.4.0",
|
|
47
43
|
"@atlaskit/ssr": "*",
|
|
48
44
|
"@atlaskit/visual-regression": "*",
|
|
49
45
|
"@atlaskit/visually-hidden": "^1.5.0",
|