@atlaskit/table 0.2.8 → 0.3.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/body.js +0 -2
- package/dist/cjs/expandable-cell.js +45 -0
- package/dist/cjs/expandable-row-content.js +21 -0
- package/dist/cjs/expandable-row.js +25 -0
- package/dist/cjs/head-cell.js +3 -3
- package/dist/cjs/hooks/selection-provider.js +0 -4
- package/dist/cjs/hooks/use-expand-content.js +33 -0
- package/dist/cjs/hooks/use-expand.js +50 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/row.js +19 -3
- package/dist/cjs/thead.js +2 -7
- package/dist/cjs/ui/base-cell.js +21 -14
- package/dist/cjs/ui/expand-icon.js +41 -0
- package/dist/cjs/ui/expandable-cell.js +28 -0
- package/dist/cjs/ui/index.js +14 -0
- package/dist/cjs/ui/selectable-cell.js +2 -9
- package/dist/cjs/ui/th.js +9 -13
- package/dist/cjs/ui/tr.js +6 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/body.js +0 -2
- package/dist/es2019/expandable-cell.js +35 -0
- package/dist/es2019/expandable-row-content.js +14 -0
- package/dist/es2019/expandable-row.js +18 -0
- package/dist/es2019/head-cell.js +3 -3
- package/dist/es2019/hooks/selection-provider.js +0 -4
- package/dist/es2019/hooks/use-expand-content.js +23 -0
- package/dist/es2019/hooks/use-expand.js +32 -0
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/row.js +21 -3
- package/dist/es2019/thead.js +2 -7
- package/dist/es2019/ui/base-cell.js +21 -14
- package/dist/es2019/ui/expand-icon.js +34 -0
- package/dist/es2019/ui/expandable-cell.js +22 -0
- package/dist/es2019/ui/index.js +2 -0
- package/dist/es2019/ui/selectable-cell.js +2 -8
- package/dist/es2019/ui/th.js +1 -4
- package/dist/es2019/ui/tr.js +6 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/body.js +0 -2
- package/dist/esm/expandable-cell.js +34 -0
- package/dist/esm/expandable-row-content.js +13 -0
- package/dist/esm/expandable-row.js +17 -0
- package/dist/esm/head-cell.js +3 -3
- package/dist/esm/hooks/selection-provider.js +0 -4
- package/dist/esm/hooks/use-expand-content.js +22 -0
- package/dist/esm/hooks/use-expand.js +38 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/row.js +19 -3
- package/dist/esm/thead.js +2 -7
- package/dist/esm/ui/base-cell.js +21 -14
- package/dist/esm/ui/expand-icon.js +33 -0
- package/dist/esm/ui/expandable-cell.js +21 -0
- package/dist/esm/ui/index.js +2 -0
- package/dist/esm/ui/selectable-cell.js +2 -9
- package/dist/esm/ui/th.js +9 -13
- package/dist/esm/ui/tr.js +6 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/expandable-cell.d.ts +10 -0
- package/dist/types/expandable-row-content.d.ts +12 -0
- package/dist/types/expandable-row.d.ts +19 -0
- package/dist/types/head-cell.d.ts +3 -3
- package/dist/types/hooks/selection-provider.d.ts +0 -4
- package/dist/types/hooks/use-expand-content.d.ts +15 -0
- package/dist/types/hooks/use-expand.d.ts +17 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/ui/base-cell.d.ts +11 -3
- package/dist/types/ui/expand-icon.d.ts +10 -0
- package/dist/types/ui/expandable-cell.d.ts +14 -0
- package/dist/types/ui/index.d.ts +2 -0
- package/dist/types/ui/selectable-cell.d.ts +3 -2
- package/dist/types/ui/td.d.ts +1 -1
- package/dist/types/ui/thead.d.ts +1 -1
- package/dist/types/ui/tr.d.ts +5 -1
- package/package.json +2 -1
- package/report.api.md +36 -3
- package/tmp/api-report-tmp.d.ts +30 -3
package/dist/esm/ui/base-cell.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import Box from '@atlaskit/ds-explorations/box';
|
|
6
|
-
import Inline from '@atlaskit/primitives/inline';
|
|
7
|
-
var alignMap = {
|
|
8
|
-
text: 'start',
|
|
9
|
-
number: 'end',
|
|
10
|
-
icon: 'center'
|
|
11
|
-
};
|
|
12
6
|
var baseResetStyles = css({
|
|
13
7
|
display: 'table-cell',
|
|
14
8
|
verticalAlign: 'middle',
|
|
@@ -19,6 +13,20 @@ var baseResetStyles = css({
|
|
|
19
13
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
20
14
|
}
|
|
21
15
|
});
|
|
16
|
+
var alignLeftStyles = css({
|
|
17
|
+
textAlign: 'left'
|
|
18
|
+
});
|
|
19
|
+
var alignCenterStyles = css({
|
|
20
|
+
textAlign: 'center'
|
|
21
|
+
});
|
|
22
|
+
var alignRightStyles = css({
|
|
23
|
+
textAlign: 'right'
|
|
24
|
+
});
|
|
25
|
+
var alignMap = {
|
|
26
|
+
text: alignLeftStyles,
|
|
27
|
+
number: alignRightStyles,
|
|
28
|
+
icon: alignCenterStyles
|
|
29
|
+
};
|
|
22
30
|
|
|
23
31
|
/**
|
|
24
32
|
* __BaseCell__
|
|
@@ -36,14 +44,15 @@ export var BaseCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
36
44
|
_ref$paddingBlock = _ref.paddingBlock,
|
|
37
45
|
paddingBlock = _ref$paddingBlock === void 0 ? 'space.100' : _ref$paddingBlock,
|
|
38
46
|
_ref$paddingInline = _ref.paddingInline,
|
|
39
|
-
paddingInline = _ref$paddingInline === void 0 ? 'space.
|
|
47
|
+
paddingInline = _ref$paddingInline === void 0 ? 'space.100' : _ref$paddingInline,
|
|
40
48
|
backgroundColor = _ref.backgroundColor,
|
|
41
49
|
scope = _ref.scope,
|
|
42
50
|
width = _ref.width,
|
|
43
51
|
className = _ref.className,
|
|
44
|
-
sortDirection = _ref.sortDirection
|
|
52
|
+
sortDirection = _ref.sortDirection,
|
|
53
|
+
colSpan = _ref.colSpan;
|
|
45
54
|
return jsx(Box, {
|
|
46
|
-
css: baseResetStyles,
|
|
55
|
+
css: [baseResetStyles, alignMap[align]],
|
|
47
56
|
ref: ref,
|
|
48
57
|
scope: scope,
|
|
49
58
|
backgroundColor: backgroundColor,
|
|
@@ -55,9 +64,7 @@ export var BaseCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
55
64
|
UNSAFE_style: width ? {
|
|
56
65
|
width: width
|
|
57
66
|
} : undefined,
|
|
58
|
-
"aria-sort": sortDirection
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
space: "0"
|
|
62
|
-
}, children));
|
|
67
|
+
"aria-sort": sortDirection,
|
|
68
|
+
colSpan: colSpan
|
|
69
|
+
}, children);
|
|
63
70
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
|
|
6
|
+
// TODO: Using HipChat icons as the standard icon set is missing large
|
|
7
|
+
// versions of `chevron-up` and `chevron-down`, despite already including
|
|
8
|
+
// `chevron-left-large` and `chevron-right-large`...
|
|
9
|
+
import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
|
|
10
|
+
import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* __Expand icon__
|
|
14
|
+
*
|
|
15
|
+
* An icon used to display the expanded state in an `<ExpandableCell>`.
|
|
16
|
+
*/
|
|
17
|
+
export var ExpandIcon = /*#__PURE__*/memo(function (_ref) {
|
|
18
|
+
var isExpanded = _ref.isExpanded;
|
|
19
|
+
switch (isExpanded) {
|
|
20
|
+
case true:
|
|
21
|
+
return jsx(ChevronUpIcon, {
|
|
22
|
+
size: "small",
|
|
23
|
+
label: "",
|
|
24
|
+
primaryColor: "inherit"
|
|
25
|
+
});
|
|
26
|
+
case false:
|
|
27
|
+
return jsx(ChevronDownIcon, {
|
|
28
|
+
size: "small",
|
|
29
|
+
label: "",
|
|
30
|
+
primaryColor: "inherit"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import { BaseCell } from './base-cell';
|
|
5
|
+
var spacingStyles = css({
|
|
6
|
+
width: 24,
|
|
7
|
+
padding: "var(--ds-space-0, 0px)"
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* __Expandable cell__
|
|
11
|
+
*
|
|
12
|
+
* An expandable cell primitive designed to be used for light weight composition.
|
|
13
|
+
*/
|
|
14
|
+
export var ExpandableCell = function ExpandableCell(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
as = _ref.as;
|
|
17
|
+
return jsx(BaseCell, {
|
|
18
|
+
as: as,
|
|
19
|
+
css: spacingStyles
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export { TR } from './tr';
|
|
|
7
7
|
export { TD } from './td';
|
|
8
8
|
export { TH } from './th';
|
|
9
9
|
export { SelectableCell } from './selectable-cell';
|
|
10
|
+
export { ExpandableCell } from './expandable-cell';
|
|
11
|
+
export { ExpandIcon } from './expand-icon';
|
|
10
12
|
export { THead } from './thead';
|
|
11
13
|
export { BulkActionOverlay } from './bulk-action-overlay';
|
|
12
14
|
export { SortIcon } from './sort-icon';
|
|
@@ -4,13 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import { BaseCell } from './base-cell';
|
|
5
5
|
var spacingStyles = css({
|
|
6
6
|
width: 32,
|
|
7
|
-
padding: "var(--ds-space-0, 0px)"
|
|
8
|
-
paddingLeft: "var(--ds-space-100, 8px)",
|
|
9
|
-
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
10
|
-
'& + *': {
|
|
11
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
|
|
12
|
-
paddingLeft: '8px !important'
|
|
13
|
-
}
|
|
7
|
+
padding: "var(--ds-space-0, 0px)"
|
|
14
8
|
});
|
|
15
9
|
/**
|
|
16
10
|
* __Selectable cell__
|
|
@@ -19,8 +13,7 @@ var spacingStyles = css({
|
|
|
19
13
|
*/
|
|
20
14
|
export var SelectableCell = function SelectableCell(_ref) {
|
|
21
15
|
var children = _ref.children,
|
|
22
|
-
|
|
23
|
-
as = _ref$as === void 0 ? 'td' : _ref$as;
|
|
16
|
+
as = _ref.as;
|
|
24
17
|
return jsx(BaseCell, {
|
|
25
18
|
as: as,
|
|
26
19
|
css: spacingStyles
|
package/dist/esm/ui/th.js
CHANGED
|
@@ -15,17 +15,13 @@ export var TH = function TH(_ref) {
|
|
|
15
15
|
backgroundColor = _ref.backgroundColor,
|
|
16
16
|
width = _ref.width,
|
|
17
17
|
sortDirection = _ref.sortDirection;
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
backgroundColor: backgroundColor,
|
|
28
|
-
sortDirection: sortDirection
|
|
29
|
-
}, children)
|
|
30
|
-
);
|
|
18
|
+
return /*#__PURE__*/React.createElement(BaseCell, {
|
|
19
|
+
as: "th",
|
|
20
|
+
testId: testId,
|
|
21
|
+
align: align,
|
|
22
|
+
scope: scope,
|
|
23
|
+
width: width,
|
|
24
|
+
backgroundColor: backgroundColor,
|
|
25
|
+
sortDirection: sortDirection
|
|
26
|
+
}, children);
|
|
31
27
|
};
|
package/dist/esm/ui/tr.js
CHANGED
|
@@ -16,6 +16,9 @@ var selectedStyles = css({
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
var subitemStyles = css({
|
|
20
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)"
|
|
21
|
+
});
|
|
19
22
|
var bodyRowStyles = css({
|
|
20
23
|
borderBottom: "1px solid ".concat("var(--ds-border, #eee)"),
|
|
21
24
|
'&:hover': {
|
|
@@ -37,13 +40,14 @@ export var TR = function TR(_ref) {
|
|
|
37
40
|
testId = _ref.testId,
|
|
38
41
|
isSelected = _ref.isSelected,
|
|
39
42
|
_ref$isBodyRow = _ref.isBodyRow,
|
|
40
|
-
isBodyRow = _ref$isBodyRow === void 0 ? true : _ref$isBodyRow
|
|
43
|
+
isBodyRow = _ref$isBodyRow === void 0 ? true : _ref$isBodyRow,
|
|
44
|
+
isSubitem = _ref.isSubitem;
|
|
41
45
|
return jsx(FocusRing, {
|
|
42
46
|
isInset: true
|
|
43
47
|
}, jsx("tr", {
|
|
44
48
|
tabIndex: -1,
|
|
45
49
|
"aria-selected": isSelected,
|
|
46
50
|
"data-testid": testId,
|
|
47
|
-
css: [baseStyles, isBodyRow && bodyRowStyles, isSelected && selectedStyles]
|
|
51
|
+
css: [baseStyles, isBodyRow && bodyRowStyles, isSelected && selectedStyles, isSubitem && subitemStyles]
|
|
48
52
|
}, children));
|
|
49
53
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
/**
|
|
4
|
+
* __Expandable cell__
|
|
5
|
+
*
|
|
6
|
+
* A cell with an expand button that controls the expanded state
|
|
7
|
+
* of the `<ExpandableRow>`.
|
|
8
|
+
*/
|
|
9
|
+
declare const ExpandableCell: import("react").MemoExoticComponent<() => jsx.JSX.Element>;
|
|
10
|
+
export default ExpandableCell;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ExpandableRowContentProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* __Expandable row content__
|
|
7
|
+
*
|
|
8
|
+
* Contains expandable content. Uses a context provider to allow children
|
|
9
|
+
* to identify if they are expandable content.
|
|
10
|
+
*/
|
|
11
|
+
declare const ExpandableRowContent: ({ children }: ExpandableRowContentProps) => JSX.Element;
|
|
12
|
+
export default ExpandableRowContent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ExpandableRowProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Controlled: If the row is expanded.
|
|
6
|
+
*/
|
|
7
|
+
isExpanded?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Uncontrolled: If the row is expanded by default.
|
|
10
|
+
*/
|
|
11
|
+
isDefaultExpanded?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* __Expandable row__
|
|
15
|
+
*
|
|
16
|
+
* A context provider for `<Row>` to support expandable content.
|
|
17
|
+
*/
|
|
18
|
+
declare const ExpandableRow: ({ children, isExpanded, isDefaultExpanded, }: ExpandableRowProps) => JSX.Element;
|
|
19
|
+
export default ExpandableRow;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { FC } from 'react';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
import { THProps } from './ui/th';
|
|
4
4
|
/**
|
|
5
5
|
* __HeadCell__
|
|
6
6
|
*
|
|
7
7
|
* HeadCell element
|
|
8
8
|
*/
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const HeadCell: FC<THProps>;
|
|
10
|
+
export default HeadCell;
|
|
@@ -12,10 +12,6 @@ declare const SelectionContext: React.Context<SelectionContext>;
|
|
|
12
12
|
* __Selection provider__
|
|
13
13
|
*
|
|
14
14
|
* A selection provider injects selection specific state into the table.
|
|
15
|
-
*
|
|
16
|
-
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
17
|
-
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
18
|
-
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
19
15
|
*/
|
|
20
16
|
declare const SelectionProvider: FC<{
|
|
21
17
|
children: ReactNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ExpandContentContext = {
|
|
3
|
+
isExpandableContent: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const ExpandContentContext: React.Context<ExpandContentContext>;
|
|
6
|
+
/**
|
|
7
|
+
* __Expand content provider__
|
|
8
|
+
*
|
|
9
|
+
* An expand content provider allows `<Row>` to determine if it is a subitem.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ExpandContentContextProvider: ({ children, }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) => JSX.Element;
|
|
14
|
+
declare const useExpandContent: () => ExpandContentContext;
|
|
15
|
+
export default useExpandContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ExpandContextState = {
|
|
3
|
+
isExpanded: boolean;
|
|
4
|
+
toggleExpanded(): void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* __Expand context provider__
|
|
8
|
+
*
|
|
9
|
+
* An expand context provider.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ExpandContextProvider: ({ children, isExpanded: isExpandedProp, isDefaultExpanded, }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
isExpanded?: boolean | undefined;
|
|
14
|
+
isDefaultExpanded?: boolean | undefined;
|
|
15
|
+
}) => JSX.Element;
|
|
16
|
+
declare const useExpand: () => ExpandContextState;
|
|
17
|
+
export default useExpand;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export { default } from './table';
|
|
|
2
2
|
export { default as TBody } from './body';
|
|
3
3
|
export { default as Row } from './row';
|
|
4
4
|
export { TD as Cell } from './ui';
|
|
5
|
+
export { default as ExpandableCell } from './expandable-cell';
|
|
6
|
+
export { default as ExpandableRow } from './expandable-row';
|
|
7
|
+
export { default as ExpandableRowContent } from './expandable-row-content';
|
|
5
8
|
export { default as HeadCell } from './head-cell';
|
|
6
9
|
export { default as SortableColumn } from './sortable-column';
|
|
7
10
|
export { default as THead } from './thead';
|
|
@@ -29,15 +29,19 @@ export declare type BaseCellProps = {
|
|
|
29
29
|
* Content of the cell.
|
|
30
30
|
*/
|
|
31
31
|
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Number of columns to span.
|
|
34
|
+
*/
|
|
35
|
+
colSpan?: number;
|
|
32
36
|
} & Pick<BoxProps, 'paddingBlock' | 'paddingInline' | 'backgroundColor' | 'className'>;
|
|
33
37
|
/**
|
|
34
38
|
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
|
|
35
39
|
*/
|
|
36
40
|
export declare type SortDirection = 'ascending' | 'descending' | 'none' | 'other';
|
|
37
41
|
declare const alignMap: {
|
|
38
|
-
readonly text: "
|
|
39
|
-
readonly number: "
|
|
40
|
-
readonly icon: "
|
|
42
|
+
readonly text: import("@emotion/react").SerializedStyles;
|
|
43
|
+
readonly number: import("@emotion/react").SerializedStyles;
|
|
44
|
+
readonly icon: import("@emotion/react").SerializedStyles;
|
|
41
45
|
};
|
|
42
46
|
/**
|
|
43
47
|
* __BaseCell__
|
|
@@ -74,6 +78,10 @@ export declare const BaseCell: import("react").ForwardRefExoticComponent<{
|
|
|
74
78
|
* Content of the cell.
|
|
75
79
|
*/
|
|
76
80
|
children?: ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Number of columns to span.
|
|
83
|
+
*/
|
|
84
|
+
colSpan?: number | undefined;
|
|
77
85
|
} & Pick<BoxProps<"div">, "className" | "backgroundColor" | "paddingBlock" | "paddingInline"> & {
|
|
78
86
|
sortDirection?: SortDirection | undefined;
|
|
79
87
|
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
/**
|
|
4
|
+
* __Expand icon__
|
|
5
|
+
*
|
|
6
|
+
* An icon used to display the expanded state in an `<ExpandableCell>`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ExpandIcon: import("react").MemoExoticComponent<({ isExpanded }: {
|
|
9
|
+
isExpanded: boolean;
|
|
10
|
+
}) => jsx.JSX.Element>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
declare type ExpandableCellProps = {
|
|
5
|
+
as: 'td' | 'th';
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* __Expandable cell__
|
|
10
|
+
*
|
|
11
|
+
* An expandable cell primitive designed to be used for light weight composition.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ExpandableCell: ({ children, as }: ExpandableCellProps) => jsx.JSX.Element;
|
|
14
|
+
export {};
|
package/dist/types/ui/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { TR } from './tr';
|
|
|
7
7
|
export { TD } from './td';
|
|
8
8
|
export { TH } from './th';
|
|
9
9
|
export { SelectableCell } from './selectable-cell';
|
|
10
|
+
export { ExpandableCell } from './expandable-cell';
|
|
11
|
+
export { ExpandIcon } from './expand-icon';
|
|
10
12
|
export { THead } from './thead';
|
|
11
13
|
export { BulkActionOverlay } from './bulk-action-overlay';
|
|
12
14
|
export { SortIcon } from './sort-icon';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import {
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
declare type SelectableCellProps = {
|
|
4
5
|
as: 'td' | 'th';
|
|
5
6
|
children?: ReactNode;
|
|
@@ -9,5 +10,5 @@ declare type SelectableCellProps = {
|
|
|
9
10
|
*
|
|
10
11
|
* A selectable cell primitive designed to be used for light weight composition.
|
|
11
12
|
*/
|
|
12
|
-
export declare const SelectableCell:
|
|
13
|
+
export declare const SelectableCell: ({ children, as }: SelectableCellProps) => jsx.JSX.Element;
|
|
13
14
|
export {};
|
package/dist/types/ui/td.d.ts
CHANGED
package/dist/types/ui/thead.d.ts
CHANGED
package/dist/types/ui/tr.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { FC, ReactNode } from 'react';
|
|
3
3
|
interface TRProps {
|
|
4
4
|
/**
|
|
5
5
|
* A `testId` prop is a unique string that appears as a data attribute `data-testid`
|
|
@@ -18,6 +18,10 @@ interface TRProps {
|
|
|
18
18
|
* Content of the row.
|
|
19
19
|
*/
|
|
20
20
|
children?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* If the row is a subitem (an expandable row nested under a parent).
|
|
23
|
+
*/
|
|
24
|
+
isSubitem?: boolean;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* __Row__
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A table is used to display data.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@atlaskit/ds-lib": "*",
|
|
58
58
|
"@atlaskit/dynamic-table": "*",
|
|
59
59
|
"@atlaskit/lozenge": "*",
|
|
60
|
+
"@atlaskit/section-message": "^6.3.0",
|
|
60
61
|
"@atlaskit/ssr": "*",
|
|
61
62
|
"@atlaskit/visual-regression": "*",
|
|
62
63
|
"@atlaskit/webdriver-runner": "*",
|
package/report.api.md
CHANGED
|
@@ -15,17 +15,22 @@
|
|
|
15
15
|
<!--SECTION START: Main Entry Types-->
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
+
/// <reference types="react" />
|
|
19
|
+
|
|
18
20
|
import { BoxProps } from '@atlaskit/ds-explorations/box';
|
|
19
21
|
import { FC } from 'react';
|
|
20
22
|
import { jsx } from '@emotion/react';
|
|
23
|
+
import { MemoExoticComponent } from 'react';
|
|
24
|
+
import { default as React_2 } from 'react';
|
|
21
25
|
import { ReactElement } from 'react';
|
|
22
26
|
import { ReactNode } from 'react';
|
|
27
|
+
import { SerializedStyles } from '@emotion/react';
|
|
23
28
|
|
|
24
29
|
// @public (undocumented)
|
|
25
30
|
const alignMap: {
|
|
26
|
-
readonly text:
|
|
27
|
-
readonly number:
|
|
28
|
-
readonly icon:
|
|
31
|
+
readonly text: SerializedStyles;
|
|
32
|
+
readonly number: SerializedStyles;
|
|
33
|
+
readonly icon: SerializedStyles;
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
// @public (undocumented)
|
|
@@ -36,6 +41,7 @@ type BaseCellProps = {
|
|
|
36
41
|
scope?: 'col' | 'row';
|
|
37
42
|
testId?: string;
|
|
38
43
|
children?: ReactNode;
|
|
44
|
+
colSpan?: number;
|
|
39
45
|
} & Pick<
|
|
40
46
|
BoxProps,
|
|
41
47
|
'backgroundColor' | 'className' | 'paddingBlock' | 'paddingInline'
|
|
@@ -65,6 +71,33 @@ interface CellProps {
|
|
|
65
71
|
testId?: string;
|
|
66
72
|
}
|
|
67
73
|
|
|
74
|
+
// @public
|
|
75
|
+
export const ExpandableCell: MemoExoticComponent<() => jsx.JSX.Element>;
|
|
76
|
+
|
|
77
|
+
// @public
|
|
78
|
+
export const ExpandableRow: ({
|
|
79
|
+
children,
|
|
80
|
+
isExpanded,
|
|
81
|
+
isDefaultExpanded,
|
|
82
|
+
}: ExpandableRowProps) => JSX.Element;
|
|
83
|
+
|
|
84
|
+
// @public
|
|
85
|
+
export const ExpandableRowContent: ({
|
|
86
|
+
children,
|
|
87
|
+
}: ExpandableRowContentProps) => JSX.Element;
|
|
88
|
+
|
|
89
|
+
// @public (undocumented)
|
|
90
|
+
type ExpandableRowContentProps = {
|
|
91
|
+
children?: React_2.ReactNode;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// @public (undocumented)
|
|
95
|
+
type ExpandableRowProps = {
|
|
96
|
+
children: React_2.ReactNode;
|
|
97
|
+
isExpanded?: boolean;
|
|
98
|
+
isDefaultExpanded?: boolean;
|
|
99
|
+
};
|
|
100
|
+
|
|
68
101
|
// @public
|
|
69
102
|
export const HeadCell: FC<THProps>;
|
|
70
103
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
7
9
|
import { BoxProps } from '@atlaskit/ds-explorations/box';
|
|
8
10
|
import { FC } from 'react';
|
|
9
11
|
import { jsx } from '@emotion/react';
|
|
12
|
+
import { MemoExoticComponent } from 'react';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
10
14
|
import { ReactElement } from 'react';
|
|
11
15
|
import { ReactNode } from 'react';
|
|
16
|
+
import { SerializedStyles } from '@emotion/react';
|
|
12
17
|
|
|
13
18
|
// @public (undocumented)
|
|
14
19
|
const alignMap: {
|
|
15
|
-
readonly text:
|
|
16
|
-
readonly number:
|
|
17
|
-
readonly icon:
|
|
20
|
+
readonly text: SerializedStyles;
|
|
21
|
+
readonly number: SerializedStyles;
|
|
22
|
+
readonly icon: SerializedStyles;
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
// @public (undocumented)
|
|
@@ -25,6 +30,7 @@ type BaseCellProps = {
|
|
|
25
30
|
scope?: 'col' | 'row';
|
|
26
31
|
testId?: string;
|
|
27
32
|
children?: ReactNode;
|
|
33
|
+
colSpan?: number;
|
|
28
34
|
} & Pick<BoxProps, 'backgroundColor' | 'className' | 'paddingBlock' | 'paddingInline'>;
|
|
29
35
|
|
|
30
36
|
// @public (undocumented)
|
|
@@ -49,6 +55,27 @@ interface CellProps {
|
|
|
49
55
|
testId?: string;
|
|
50
56
|
}
|
|
51
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
|
+
|
|
52
79
|
// @public
|
|
53
80
|
export const HeadCell: FC<THProps>;
|
|
54
81
|
|