@atlaskit/table 0.5.2 → 0.6.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 +14 -1
- package/LICENSE.md +6 -8
- package/README.md +40 -38
- package/dist/cjs/body.js +3 -1
- package/dist/cjs/expandable-cell.js +5 -0
- package/dist/cjs/head-cell.js +5 -0
- package/dist/cjs/row.js +5 -0
- package/dist/cjs/selectable-cell.js +5 -0
- package/dist/cjs/sortable-column.js +6 -2
- package/dist/cjs/table.js +5 -0
- package/dist/cjs/thead.js +5 -0
- package/dist/cjs/ui/base-cell.js +2 -0
- package/dist/cjs/ui/expand-icon.js +5 -0
- package/dist/cjs/ui/sort-icon.js +5 -0
- package/dist/cjs/ui/table.js +5 -0
- package/dist/cjs/ui/tbody.js +6 -0
- package/dist/cjs/ui/td.js +4 -0
- package/dist/cjs/ui/thead.js +7 -2
- package/dist/cjs/ui/tr.js +5 -0
- package/dist/es2019/body.js +5 -0
- package/dist/es2019/expandable-cell.js +5 -0
- package/dist/es2019/head-cell.js +4 -0
- package/dist/es2019/row.js +5 -0
- package/dist/es2019/selectable-cell.js +5 -0
- package/dist/es2019/sortable-column.js +7 -2
- package/dist/es2019/table.js +5 -0
- package/dist/es2019/thead.js +4 -0
- package/dist/es2019/ui/base-cell.js +2 -0
- package/dist/es2019/ui/expand-icon.js +5 -0
- package/dist/es2019/ui/sort-icon.js +5 -0
- package/dist/es2019/ui/table.js +4 -0
- package/dist/es2019/ui/tbody.js +5 -0
- package/dist/es2019/ui/td.js +4 -0
- package/dist/es2019/ui/thead.js +6 -2
- package/dist/es2019/ui/tr.js +4 -0
- package/dist/esm/body.js +5 -0
- package/dist/esm/expandable-cell.js +5 -0
- package/dist/esm/head-cell.js +4 -0
- package/dist/esm/row.js +5 -0
- package/dist/esm/selectable-cell.js +5 -0
- package/dist/esm/sortable-column.js +7 -2
- package/dist/esm/table.js +5 -0
- package/dist/esm/thead.js +4 -0
- package/dist/esm/ui/base-cell.js +2 -0
- package/dist/esm/ui/expand-icon.js +5 -0
- package/dist/esm/ui/sort-icon.js +5 -0
- package/dist/esm/ui/table.js +4 -0
- package/dist/esm/ui/tbody.js +5 -0
- package/dist/esm/ui/td.js +4 -0
- package/dist/esm/ui/thead.js +6 -2
- package/dist/esm/ui/tr.js +4 -0
- package/dist/types/body.d.ts +4 -1
- package/dist/types/expandable-row.d.ts +1 -1
- package/dist/types/head-cell.d.ts +3 -0
- package/dist/types/hooks/use-expand-content.d.ts +1 -1
- package/dist/types/row.d.ts +3 -0
- package/dist/types/sortable-column.d.ts +3 -0
- package/dist/types/table.d.ts +3 -0
- package/dist/types/thead.d.ts +3 -0
- package/dist/types/ui/sort-icon.d.ts +3 -0
- package/dist/types/ui/table.d.ts +3 -0
- package/dist/types/ui/tbody.d.ts +3 -0
- package/dist/types/ui/td.d.ts +3 -0
- package/dist/types/ui/thead.d.ts +3 -0
- package/dist/types/ui/tr.d.ts +3 -0
- package/dist/types-ts4.5/body.d.ts +4 -1
- package/dist/types-ts4.5/expandable-row.d.ts +1 -1
- package/dist/types-ts4.5/head-cell.d.ts +3 -0
- package/dist/types-ts4.5/hooks/use-expand-content.d.ts +1 -1
- package/dist/types-ts4.5/row.d.ts +3 -0
- package/dist/types-ts4.5/sortable-column.d.ts +3 -0
- package/dist/types-ts4.5/table.d.ts +3 -0
- package/dist/types-ts4.5/thead.d.ts +3 -0
- package/dist/types-ts4.5/ui/sort-icon.d.ts +3 -0
- package/dist/types-ts4.5/ui/table.d.ts +3 -0
- package/dist/types-ts4.5/ui/tbody.d.ts +3 -0
- package/dist/types-ts4.5/ui/td.d.ts +3 -0
- package/dist/types-ts4.5/ui/thead.d.ts +3 -0
- package/dist/types-ts4.5/ui/tr.d.ts +3 -0
- package/extract-react-types/row.tsx +2 -2
- package/extract-react-types/table.tsx +2 -2
- package/package.json +102 -102
- package/report.api.md +53 -57
package/package.json
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1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
-
}
|
|
2
|
+
"name": "@atlaskit/table",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "A table is used to display data.",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://atlassian.design/components/table",
|
|
11
|
+
"atlassian": {
|
|
12
|
+
"team": "Design System Team",
|
|
13
|
+
"inPublicMirror": false,
|
|
14
|
+
"releaseModel": "continuous",
|
|
15
|
+
"website": {
|
|
16
|
+
"name": "Table",
|
|
17
|
+
"category": "Components",
|
|
18
|
+
"status": {
|
|
19
|
+
"type": "alpha"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"runReact18": true
|
|
23
|
+
},
|
|
24
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
25
|
+
"main": "dist/cjs/index.js",
|
|
26
|
+
"module": "dist/esm/index.js",
|
|
27
|
+
"module:es2019": "dist/es2019/index.js",
|
|
28
|
+
"types": "dist/types/index.d.ts",
|
|
29
|
+
"typesVersions": {
|
|
30
|
+
">=4.5 <4.9": {
|
|
31
|
+
"*": [
|
|
32
|
+
"dist/types-ts4.5/*",
|
|
33
|
+
"dist/types-ts4.5/index.d.ts"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"atlaskit:src": "src/index.tsx",
|
|
39
|
+
"af:exports": {
|
|
40
|
+
".": "./src/index.tsx",
|
|
41
|
+
"./primitives": "./src/ui/index.tsx"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@atlaskit/button": "^17.17.0",
|
|
45
|
+
"@atlaskit/checkbox": "^13.4.0",
|
|
46
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
47
|
+
"@atlaskit/focus-ring": "^1.5.0",
|
|
48
|
+
"@atlaskit/icon": "^22.4.0",
|
|
49
|
+
"@atlaskit/primitives": "^7.4.0",
|
|
50
|
+
"@atlaskit/tokens": "^1.51.0",
|
|
51
|
+
"@atlaskit/tooltip": "^18.5.0",
|
|
52
|
+
"@atlaskit/visually-hidden": "^1.4.0",
|
|
53
|
+
"@babel/runtime": "^7.0.0",
|
|
54
|
+
"@emotion/react": "^11.7.1",
|
|
55
|
+
"tiny-invariant": "^1.2.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@af/accessibility-testing": "*",
|
|
62
|
+
"@atlaskit/ssr": "*",
|
|
63
|
+
"@atlaskit/visual-regression": "*",
|
|
64
|
+
"@testing-library/react": "^12.1.5",
|
|
65
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
66
|
+
"react-dom": "^16.8.0",
|
|
67
|
+
"storybook-addon-designs": "^6.3.1",
|
|
68
|
+
"typescript": "~5.4.2",
|
|
69
|
+
"wait-for-expect": "^1.2.0"
|
|
70
|
+
},
|
|
71
|
+
"techstack": {
|
|
72
|
+
"@atlassian/frontend": {
|
|
73
|
+
"import-structure": [
|
|
74
|
+
"atlassian-conventions"
|
|
75
|
+
],
|
|
76
|
+
"circular-dependencies": [
|
|
77
|
+
"file-and-folder-level"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"@repo/internal": {
|
|
81
|
+
"dom-events": "use-bind-event-listener",
|
|
82
|
+
"analytics": [
|
|
83
|
+
"analytics-next"
|
|
84
|
+
],
|
|
85
|
+
"design-tokens": [
|
|
86
|
+
"color",
|
|
87
|
+
"spacing"
|
|
88
|
+
],
|
|
89
|
+
"theming": [
|
|
90
|
+
"react-context"
|
|
91
|
+
],
|
|
92
|
+
"ui-components": [
|
|
93
|
+
"lite-mode"
|
|
94
|
+
],
|
|
95
|
+
"design-system": "v1",
|
|
96
|
+
"deprecation": "no-deprecated-imports",
|
|
97
|
+
"styling": [
|
|
98
|
+
"emotion",
|
|
99
|
+
"emotion"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/table"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -27,40 +28,37 @@ import { ReactNode } from 'react';
|
|
|
27
28
|
|
|
28
29
|
// @public (undocumented)
|
|
29
30
|
type BaseCellProps = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} & Pick<
|
|
38
|
-
BoxProps<any>,
|
|
39
|
-
'backgroundColor' | 'paddingBlock' | 'paddingInline' | 'xcss'
|
|
40
|
-
>;
|
|
31
|
+
width?: string;
|
|
32
|
+
align?: 'icon' | 'number' | 'text';
|
|
33
|
+
as?: 'td' | 'th';
|
|
34
|
+
scope?: 'col' | 'row';
|
|
35
|
+
testId?: string;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
colSpan?: number;
|
|
38
|
+
} & Pick<BoxProps<any>, 'backgroundColor' | 'paddingBlock' | 'paddingInline' | 'xcss'>;
|
|
41
39
|
|
|
42
40
|
// @public (undocumented)
|
|
43
41
|
type BodyProps<Item extends object> =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
| {
|
|
43
|
+
rows: Item[];
|
|
44
|
+
children: (row: Item) => ReactElement;
|
|
45
|
+
}
|
|
46
|
+
| {
|
|
47
|
+
rows?: never;
|
|
48
|
+
children: ReactElement | ReactElement[];
|
|
49
|
+
};
|
|
52
50
|
|
|
53
51
|
// @public
|
|
54
52
|
export const Cell: FC<Omit<BaseCellProps, 'as'>>;
|
|
55
53
|
|
|
56
54
|
// @public (undocumented)
|
|
57
55
|
interface CellProps {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
// (undocumented)
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
name: string;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
onClick?: React.MouseEventHandler;
|
|
61
|
+
testId?: string;
|
|
64
62
|
}
|
|
65
63
|
|
|
66
64
|
// @public
|
|
@@ -68,26 +66,24 @@ export const ExpandableCell: MemoExoticComponent<() => jsx.JSX.Element>;
|
|
|
68
66
|
|
|
69
67
|
// @public
|
|
70
68
|
export const ExpandableRow: ({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
children,
|
|
70
|
+
isExpanded,
|
|
71
|
+
isDefaultExpanded,
|
|
74
72
|
}: ExpandableRowProps) => JSX.Element;
|
|
75
73
|
|
|
76
74
|
// @public
|
|
77
|
-
export const ExpandableRowContent: ({
|
|
78
|
-
children,
|
|
79
|
-
}: ExpandableRowContentProps) => JSX.Element;
|
|
75
|
+
export const ExpandableRowContent: ({ children }: ExpandableRowContentProps) => JSX.Element;
|
|
80
76
|
|
|
81
77
|
// @public (undocumented)
|
|
82
78
|
type ExpandableRowContentProps = {
|
|
83
|
-
|
|
79
|
+
children?: React_2.ReactNode;
|
|
84
80
|
};
|
|
85
81
|
|
|
86
82
|
// @public (undocumented)
|
|
87
83
|
type ExpandableRowProps = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
children: React_2.ReactNode;
|
|
85
|
+
isExpanded?: boolean;
|
|
86
|
+
isDefaultExpanded?: boolean;
|
|
91
87
|
};
|
|
92
88
|
|
|
93
89
|
// @public
|
|
@@ -98,8 +94,8 @@ export const Row: FC<RowProps>;
|
|
|
98
94
|
|
|
99
95
|
// @public (undocumented)
|
|
100
96
|
type RowProps = {
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
testId?: string;
|
|
98
|
+
children?: ReactNode;
|
|
103
99
|
};
|
|
104
100
|
|
|
105
101
|
// @public
|
|
@@ -110,32 +106,32 @@ type SortKey<Key extends number | string | symbol> = 'unset' | Key;
|
|
|
110
106
|
|
|
111
107
|
// @public
|
|
112
108
|
function Table<ItemType extends object = object>({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
children,
|
|
110
|
+
isSelectable,
|
|
111
|
+
sortKey,
|
|
112
|
+
testId,
|
|
117
113
|
}: TableProps<ItemType>): jsx.JSX.Element;
|
|
118
114
|
export default Table;
|
|
119
115
|
|
|
120
116
|
// @public (undocumented)
|
|
121
117
|
type TableProps<ItemType extends object = {}> = {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
testId?: string;
|
|
119
|
+
sortKey?: SortKey<keyof ItemType>;
|
|
120
|
+
children: ReactElement | ReactElement[];
|
|
125
121
|
} & (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
| {
|
|
123
|
+
isSelectable: true;
|
|
124
|
+
defaultSelected?: number;
|
|
125
|
+
}
|
|
126
|
+
| {
|
|
127
|
+
isSelectable?: false;
|
|
128
|
+
}
|
|
133
129
|
);
|
|
134
130
|
|
|
135
131
|
// @public
|
|
136
132
|
export function TBody<ObjectType extends object>({
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
rows,
|
|
134
|
+
children,
|
|
139
135
|
}: BodyProps<ObjectType>): jsx.JSX.Element;
|
|
140
136
|
|
|
141
137
|
// @public (undocumented)
|
|
@@ -143,8 +139,8 @@ export const THead: FC<THeadProps>;
|
|
|
143
139
|
|
|
144
140
|
// @public (undocumented)
|
|
145
141
|
type THeadProps = {
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
actions?: (selected: number[]) => ReactNode;
|
|
143
|
+
children?: ReactNode;
|
|
148
144
|
};
|
|
149
145
|
|
|
150
146
|
// @public (undocumented)
|
|
@@ -161,7 +157,7 @@ type THProps = Omit<BaseCellProps, 'as'>;
|
|
|
161
157
|
|
|
162
158
|
```json
|
|
163
159
|
{
|
|
164
|
-
|
|
160
|
+
"react": "^16.8.0"
|
|
165
161
|
}
|
|
166
162
|
```
|
|
167
163
|
|