@atlaskit/table 0.4.0 → 0.4.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 +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/body.d.ts +1 -1
- package/dist/types/expandable-row-content.d.ts +1 -1
- package/dist/types/expandable-row.d.ts +1 -1
- package/dist/types/hooks/selection-provider.d.ts +1 -1
- package/dist/types/hooks/use-expand-content.d.ts +1 -1
- package/dist/types/hooks/use-expand.d.ts +1 -1
- package/dist/types/hooks/use-selectable.d.ts +2 -2
- package/dist/types/hooks/use-table.d.ts +3 -3
- package/dist/types/row.d.ts +1 -1
- package/dist/types/table.d.ts +1 -1
- package/dist/types/thead.d.ts +1 -1
- package/dist/types/ui/base-cell.d.ts +2 -2
- package/dist/types/ui/expandable-cell.d.ts +1 -1
- package/dist/types/ui/selectable-cell.d.ts +1 -1
- package/dist/types/ui/table.d.ts +1 -1
- package/dist/types/ui/th.d.ts +2 -2
- package/package.json +12 -4
- package/primitives/package.json +2 -2
- package/tmp/api-report-tmp.d.ts +130 -0
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
package/dist/types/body.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
export
|
|
4
|
+
export type BodyProps<Item extends object> = {
|
|
5
5
|
rows: Item[];
|
|
6
6
|
children: (row: Item) => ReactElement;
|
|
7
7
|
} | {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import { SelectableActions, SelectableState } from './use-selectable';
|
|
3
|
-
|
|
3
|
+
type SelectionContext = [
|
|
4
4
|
SelectableState,
|
|
5
5
|
/**
|
|
6
6
|
* Context actions will be undefined without a `SelectionProvider` mounted.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SelectableState = {
|
|
2
2
|
/**
|
|
3
3
|
* The localised ids that have been checked.
|
|
4
4
|
*/
|
|
@@ -27,7 +27,7 @@ export declare type SelectableState = {
|
|
|
27
27
|
*/
|
|
28
28
|
previousSelection: number[];
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export type SelectableActions = {
|
|
31
31
|
setAll: () => void;
|
|
32
32
|
removeAll: () => void;
|
|
33
33
|
toggleSelection: (id: number, shiftHeld: boolean) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type SortDirection = 'ascending' | 'descending';
|
|
3
|
+
export type SortKey<Key extends string | symbol | number> = Key | 'unset';
|
|
4
|
+
export type TableContext<T, K extends keyof T = keyof T> = {
|
|
5
5
|
isSelectable?: boolean;
|
|
6
6
|
sortKey: SortKey<K>;
|
|
7
7
|
sortDirection?: SortDirection;
|
package/dist/types/row.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { FC, ReactNode } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type RowProps = {
|
|
4
4
|
/**
|
|
5
5
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
6
6
|
* in the rendered code, serving as a hook for automated tests.
|
package/dist/types/table.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ReactElement } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { SortKey } from './hooks/use-table';
|
|
5
|
-
export
|
|
5
|
+
export type TableProps<ItemType extends object = {}> = {
|
|
6
6
|
/**
|
|
7
7
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
8
8
|
* in the rendered code, serving as a hook for automated tests.
|
package/dist/types/thead.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { BoxProps } from '@atlaskit/ds-explorations/box';
|
|
4
|
-
export
|
|
4
|
+
export type BaseCellProps = {
|
|
5
5
|
/**
|
|
6
6
|
* A percentage of pixel width of the table to apply to a column.
|
|
7
7
|
*/
|
|
@@ -37,7 +37,7 @@ export declare type BaseCellProps = {
|
|
|
37
37
|
/**
|
|
38
38
|
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
|
|
41
41
|
declare const alignMap: {
|
|
42
42
|
readonly text: import("@emotion/react").SerializedStyles;
|
|
43
43
|
readonly number: import("@emotion/react").SerializedStyles;
|
package/dist/types/ui/table.d.ts
CHANGED
package/dist/types/ui/th.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { BaseCellProps, SortDirection } from './base-cell';
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type THProps = Omit<BaseCellProps, 'as'>;
|
|
4
|
+
type InternalTHProps = THProps & {
|
|
5
5
|
sortDirection?: SortDirection;
|
|
6
6
|
};
|
|
7
7
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/table",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "A table is used to display data.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,6 +25,14 @@
|
|
|
25
25
|
"module": "dist/esm/index.js",
|
|
26
26
|
"module:es2019": "dist/es2019/index.js",
|
|
27
27
|
"types": "dist/types/index.d.ts",
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
">=4.5 <4.9": {
|
|
30
|
+
"*": [
|
|
31
|
+
"dist/types-ts4.5/*",
|
|
32
|
+
"dist/types-ts4.5/index.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
28
36
|
"sideEffects": false,
|
|
29
37
|
"atlaskit:src": "src/index.tsx",
|
|
30
38
|
"af:exports": {
|
|
@@ -33,13 +41,13 @@
|
|
|
33
41
|
},
|
|
34
42
|
"dependencies": {
|
|
35
43
|
"@atlaskit/button": "^16.7.0",
|
|
36
|
-
"@atlaskit/checkbox": "^12.
|
|
44
|
+
"@atlaskit/checkbox": "^12.6.0",
|
|
37
45
|
"@atlaskit/ds-explorations": "^2.1.0",
|
|
38
46
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
39
47
|
"@atlaskit/focus-ring": "^1.3.0",
|
|
40
48
|
"@atlaskit/icon": "^21.12.0",
|
|
41
49
|
"@atlaskit/primitives": "^0.9.0",
|
|
42
|
-
"@atlaskit/tokens": "^1.
|
|
50
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
43
51
|
"@atlaskit/tooltip": "^17.8.0",
|
|
44
52
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
45
53
|
"@babel/runtime": "^7.0.0",
|
|
@@ -67,7 +75,7 @@
|
|
|
67
75
|
"jest-axe": "^4.0.0",
|
|
68
76
|
"react-dom": "^16.8.0",
|
|
69
77
|
"storybook-addon-designs": "^6.3.1",
|
|
70
|
-
"typescript": "4.
|
|
78
|
+
"typescript": "~4.9.5",
|
|
71
79
|
"wait-for-expect": "^1.2.0"
|
|
72
80
|
},
|
|
73
81
|
"techstack": {
|
package/primitives/package.json
CHANGED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/table"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import { BoxProps } from '@atlaskit/ds-explorations/box';
|
|
10
|
+
import { FC } from 'react';
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
12
|
+
import { MemoExoticComponent } from 'react';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
14
|
+
import { ReactElement } from 'react';
|
|
15
|
+
import { ReactNode } from 'react';
|
|
16
|
+
import { SerializedStyles } from '@emotion/react';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
const alignMap: {
|
|
20
|
+
readonly text: SerializedStyles;
|
|
21
|
+
readonly number: SerializedStyles;
|
|
22
|
+
readonly icon: SerializedStyles;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// @public (undocumented)
|
|
26
|
+
type BaseCellProps = {
|
|
27
|
+
width?: string;
|
|
28
|
+
align?: keyof typeof alignMap;
|
|
29
|
+
as?: 'td' | 'th';
|
|
30
|
+
scope?: 'col' | 'row';
|
|
31
|
+
testId?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
colSpan?: number;
|
|
34
|
+
} & Pick<BoxProps, 'backgroundColor' | 'className' | 'paddingBlock' | 'paddingInline'>;
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
type BodyProps<Item extends object> = {
|
|
38
|
+
rows: Item[];
|
|
39
|
+
children: (row: Item) => ReactElement;
|
|
40
|
+
} | {
|
|
41
|
+
rows?: never;
|
|
42
|
+
children: ReactElement | ReactElement[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// @public
|
|
46
|
+
export const Cell: FC<Omit<BaseCellProps, 'as'>>;
|
|
47
|
+
|
|
48
|
+
// @public (undocumented)
|
|
49
|
+
interface CellProps {
|
|
50
|
+
// (undocumented)
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
name: string;
|
|
53
|
+
// (undocumented)
|
|
54
|
+
onClick?: React.MouseEventHandler;
|
|
55
|
+
testId?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// @public
|
|
59
|
+
export const ExpandableCell: MemoExoticComponent<() => jsx.JSX.Element>;
|
|
60
|
+
|
|
61
|
+
// @public
|
|
62
|
+
export const ExpandableRow: ({ children, isExpanded, isDefaultExpanded, }: ExpandableRowProps) => JSX.Element;
|
|
63
|
+
|
|
64
|
+
// @public
|
|
65
|
+
export const ExpandableRowContent: ({ children }: ExpandableRowContentProps) => JSX.Element;
|
|
66
|
+
|
|
67
|
+
// @public (undocumented)
|
|
68
|
+
type ExpandableRowContentProps = {
|
|
69
|
+
children?: React_2.ReactNode;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
type ExpandableRowProps = {
|
|
74
|
+
children: React_2.ReactNode;
|
|
75
|
+
isExpanded?: boolean;
|
|
76
|
+
isDefaultExpanded?: boolean;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// @public
|
|
80
|
+
export const HeadCell: FC<THProps>;
|
|
81
|
+
|
|
82
|
+
// @public
|
|
83
|
+
export const Row: FC<RowProps>;
|
|
84
|
+
|
|
85
|
+
// @public (undocumented)
|
|
86
|
+
type RowProps = {
|
|
87
|
+
testId?: string;
|
|
88
|
+
children?: ReactNode;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// @public
|
|
92
|
+
export const SortableColumn: FC<CellProps>;
|
|
93
|
+
|
|
94
|
+
// @public (undocumented)
|
|
95
|
+
type SortKey<Key extends number | string | symbol> = 'unset' | Key;
|
|
96
|
+
|
|
97
|
+
// @public
|
|
98
|
+
function Table<ItemType extends object = object>({ children, isSelectable, sortKey, testId, }: TableProps<ItemType>): jsx.JSX.Element;
|
|
99
|
+
export default Table;
|
|
100
|
+
|
|
101
|
+
// @public (undocumented)
|
|
102
|
+
type TableProps<ItemType extends object = {}> = {
|
|
103
|
+
testId?: string;
|
|
104
|
+
sortKey?: SortKey<keyof ItemType>;
|
|
105
|
+
children: ReactElement | ReactElement[];
|
|
106
|
+
} & ({
|
|
107
|
+
isSelectable: true;
|
|
108
|
+
defaultSelected?: number;
|
|
109
|
+
} | {
|
|
110
|
+
isSelectable?: false;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// @public
|
|
114
|
+
export function TBody<ObjectType extends object>({ rows, children, }: BodyProps<ObjectType>): jsx.JSX.Element;
|
|
115
|
+
|
|
116
|
+
// @public (undocumented)
|
|
117
|
+
export const THead: FC<THeadProps>;
|
|
118
|
+
|
|
119
|
+
// @public (undocumented)
|
|
120
|
+
type THeadProps = {
|
|
121
|
+
actions?: (selected: number[]) => ReactNode;
|
|
122
|
+
children?: ReactNode;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// @public (undocumented)
|
|
126
|
+
type THProps = Omit<BaseCellProps, 'as'>;
|
|
127
|
+
|
|
128
|
+
// (No @packageDocumentation comment for this package)
|
|
129
|
+
|
|
130
|
+
```
|