@atlaskit/dynamic-table 14.3.1 → 14.4.2
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 +34 -0
- package/README.md +2 -2
- package/dist/cjs/components/LoadingContainerAdvanced.js +3 -3
- package/dist/cjs/components/Stateful.js +26 -0
- package/dist/cjs/components/Stateless.js +2 -2
- package/dist/cjs/components/TableHeadCell.js +18 -48
- package/dist/cjs/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/cjs/components/rankable/TableCell.js +4 -4
- package/dist/cjs/components/rankable/TableHeadCell.js +2 -4
- package/dist/cjs/components/rankable/TableRow.js +3 -3
- package/dist/cjs/internal/constants.js +1 -5
- package/dist/cjs/styled/DynamicTable.js +80 -16
- package/dist/cjs/styled/EmptyBody.js +23 -10
- package/dist/cjs/styled/LoadingContainer.js +41 -8
- package/dist/cjs/styled/LoadingContainerAdvanced.js +42 -8
- package/dist/cjs/styled/TableCell.js +21 -7
- package/dist/cjs/styled/TableHead.js +161 -25
- package/dist/cjs/styled/TableRow.js +36 -18
- package/dist/cjs/styled/constants.js +33 -40
- package/dist/cjs/styled/rankable/RowPlaceholder.js +11 -4
- package/dist/cjs/styled/rankable/TableCell.js +18 -13
- package/dist/cjs/styled/rankable/TableRow.js +32 -20
- package/dist/cjs/theme.js +20 -18
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LoadingContainerAdvanced.js +2 -4
- package/dist/es2019/components/Stateful.js +27 -0
- package/dist/es2019/components/Stateless.js +2 -2
- package/dist/es2019/components/TableHeadCell.js +18 -22
- package/dist/es2019/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/es2019/components/rankable/TableCell.js +4 -4
- package/dist/es2019/components/rankable/TableHeadCell.js +1 -3
- package/dist/es2019/components/rankable/TableRow.js +3 -3
- package/dist/es2019/internal/constants.js +0 -2
- package/dist/es2019/styled/DynamicTable.js +75 -27
- package/dist/es2019/styled/EmptyBody.js +21 -11
- package/dist/es2019/styled/LoadingContainer.js +39 -18
- package/dist/es2019/styled/LoadingContainerAdvanced.js +38 -20
- package/dist/es2019/styled/TableCell.js +20 -5
- package/dist/es2019/styled/TableHead.js +160 -33
- package/dist/es2019/styled/TableRow.js +34 -20
- package/dist/es2019/styled/constants.js +30 -116
- package/dist/es2019/styled/rankable/RowPlaceholder.js +10 -4
- package/dist/es2019/styled/rankable/TableCell.js +16 -9
- package/dist/es2019/styled/rankable/TableRow.js +32 -24
- package/dist/es2019/theme.js +19 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/LoadingContainerAdvanced.js +3 -3
- package/dist/esm/components/Stateful.js +26 -0
- package/dist/esm/components/Stateless.js +2 -2
- package/dist/esm/components/TableHeadCell.js +19 -47
- package/dist/esm/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/esm/components/rankable/TableCell.js +4 -4
- package/dist/esm/components/rankable/TableHeadCell.js +2 -4
- package/dist/esm/components/rankable/TableRow.js +3 -3
- package/dist/esm/internal/constants.js +0 -2
- package/dist/esm/styled/DynamicTable.js +77 -10
- package/dist/esm/styled/EmptyBody.js +23 -8
- package/dist/esm/styled/LoadingContainer.js +40 -8
- package/dist/esm/styled/LoadingContainerAdvanced.js +41 -7
- package/dist/esm/styled/TableCell.js +21 -7
- package/dist/esm/styled/TableHead.js +160 -21
- package/dist/esm/styled/TableRow.js +36 -12
- package/dist/esm/styled/constants.js +28 -30
- package/dist/esm/styled/rankable/RowPlaceholder.js +11 -5
- package/dist/esm/styled/rankable/TableCell.js +18 -9
- package/dist/esm/styled/rankable/TableRow.js +31 -14
- package/dist/esm/theme.js +19 -18
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Body.d.ts +21 -21
- package/dist/types/components/LoadingContainer.d.ts +3 -3
- package/dist/types/components/LoadingContainerAdvanced.d.ts +3 -3
- package/dist/types/components/Stateful.d.ts +26 -0
- package/dist/types/components/Stateless.d.ts +3 -3
- package/dist/types/components/TableHeadCell.d.ts +4 -9
- package/dist/types/components/{managedPagination.d.ts → managed-pagination.d.ts} +4 -7
- package/dist/types/components/rankable/Body.d.ts +21 -21
- package/dist/types/components/rankable/TableHeadCell.d.ts +1 -1
- package/dist/types/components/rankable/TableRow.d.ts +3 -3
- package/dist/types/hoc/withDimensions.d.ts +2 -2
- package/dist/types/hoc/withSortedPageRows.d.ts +20 -20
- package/dist/types/internal/constants.d.ts +0 -2
- package/dist/types/styled/DynamicTable.d.ts +13 -6
- package/dist/types/styled/EmptyBody.d.ts +4 -3
- package/dist/types/styled/LoadingContainer.d.ts +8 -7
- package/dist/types/styled/LoadingContainerAdvanced.d.ts +5 -4
- package/dist/types/styled/TableCell.d.ts +3 -2
- package/dist/types/styled/TableHead.d.ts +8 -5
- package/dist/types/styled/TableRow.d.ts +7 -4
- package/dist/types/styled/constants.d.ts +13 -10
- package/dist/types/styled/rankable/RowPlaceholder.d.ts +3 -2
- package/dist/types/styled/rankable/TableCell.d.ts +8 -6
- package/dist/types/styled/rankable/TableRow.d.ts +9 -6
- package/dist/types/theme.d.ts +9 -9
- package/dist/types/types.d.ts +76 -37
- package/package.json +16 -9
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { row } from '../theme';
|
|
3
|
-
const outlineWidth = '2px';
|
|
4
|
-
export const TableBodyRow = styled.tr`
|
|
5
|
-
${({
|
|
6
|
-
isHighlighted
|
|
7
|
-
}) => isHighlighted && css`
|
|
8
|
-
background-color: ${row.highlightedBackground};
|
|
9
|
-
`}
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
10
2
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
|
+
import { tableRowCSSVars as cssVars } from './DynamicTable';
|
|
8
|
+
const rowStyles = css({
|
|
9
|
+
'&:focus': {
|
|
10
|
+
outline: `2px solid ${token('color.border.focus', `var(${cssVars.CSS_VAR_HOVER_BACKGROUND})`)}`,
|
|
11
|
+
outlineOffset: `-2px`
|
|
17
12
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
});
|
|
14
|
+
const rowBackgroundStyles = css({
|
|
15
|
+
'&:hover': {
|
|
16
|
+
backgroundColor: token('color.background.transparentNeutral.hover', `var(${cssVars.CSS_VAR_HOVER_BACKGROUND})`)
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const rowHighlightedBackgroundStyles = css({
|
|
20
|
+
backgroundColor: token('color.background.selected.resting', `var(${cssVars.CSS_VAR_HIGHLIGHTED_BACKGROUND})`),
|
|
21
|
+
'&:hover': {
|
|
22
|
+
backgroundColor: token('color.background.selected.hover', `var(${cssVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND})`)
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
});
|
|
25
|
+
export const TableBodyRow = /*#__PURE__*/forwardRef(({
|
|
26
|
+
isHighlighted,
|
|
27
|
+
children,
|
|
28
|
+
style,
|
|
29
|
+
...rest
|
|
30
|
+
}, ref) => {
|
|
31
|
+
return jsx("tr", _extends({
|
|
32
|
+
style: style,
|
|
33
|
+
css: [rowStyles, isHighlighted ? rowHighlightedBackgroundStyles : rowBackgroundStyles]
|
|
34
|
+
}, rest, {
|
|
35
|
+
ref: ref
|
|
36
|
+
}), children);
|
|
37
|
+
});
|
|
@@ -1,118 +1,32 @@
|
|
|
1
|
-
import { css } from '
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`;
|
|
22
|
-
export const onClickStyle = ({
|
|
23
|
-
onClick
|
|
24
|
-
}) => onClick && css`
|
|
25
|
-
&:hover {
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
background-color: ${N30A};
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
export const arrowsStyle = props => {
|
|
31
|
-
const {
|
|
32
|
-
isSortable,
|
|
33
|
-
sortOrder
|
|
34
|
-
} = props;
|
|
35
|
-
|
|
36
|
-
if (!isSortable) {
|
|
37
|
-
return '';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const pseudoBase = css`
|
|
41
|
-
border: 3px solid transparent;
|
|
42
|
-
display: block;
|
|
43
|
-
height: 0;
|
|
44
|
-
position: absolute;
|
|
45
|
-
right: -${gridSize}px;
|
|
46
|
-
width: 0;
|
|
47
|
-
|
|
48
|
-
@media (forced-colors: active) {
|
|
49
|
-
border: 3px solid ${MSThemeColors.Background};
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
return css`
|
|
53
|
-
& > span {
|
|
54
|
-
position: relative;
|
|
55
|
-
&::before {
|
|
56
|
-
${pseudoBase};
|
|
57
|
-
border-bottom: 3px solid
|
|
58
|
-
${sortOrder === ASC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
|
|
59
|
-
bottom: 8px;
|
|
60
|
-
content: ' ';
|
|
61
|
-
}
|
|
62
|
-
&::after {
|
|
63
|
-
${pseudoBase};
|
|
64
|
-
border-top: 3px solid
|
|
65
|
-
${sortOrder === DESC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
|
|
66
|
-
bottom: 0;
|
|
67
|
-
content: ' ';
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&:hover > span {
|
|
72
|
-
&::before {
|
|
73
|
-
border-bottom: 3px solid
|
|
74
|
-
${sortOrder === ASC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
|
|
75
|
-
}
|
|
76
|
-
&::after {
|
|
77
|
-
border-top: 3px solid
|
|
78
|
-
${sortOrder === DESC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@media (forced-colors: active) {
|
|
83
|
-
& > span {
|
|
84
|
-
&::before {
|
|
85
|
-
border-bottom: 3px solid
|
|
86
|
-
${sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
|
|
87
|
-
}
|
|
88
|
-
&::after {
|
|
89
|
-
border-top: 3px solid
|
|
90
|
-
${sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:hover > span {
|
|
95
|
-
&::before {
|
|
96
|
-
border-bottom: 3px solid
|
|
97
|
-
${sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
|
|
98
|
-
}
|
|
99
|
-
&::after {
|
|
100
|
-
border-top: 3px solid
|
|
101
|
-
${sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
1
|
+
import { css } from '@emotion/core';
|
|
2
|
+
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
3
|
+
const CSS_VAR_WIDTH = '--local-dynamic-table-width';
|
|
4
|
+
const gridSize = getGridSize();
|
|
5
|
+
export const truncationWidthStyles = css({
|
|
6
|
+
width: `var(${CSS_VAR_WIDTH})`
|
|
7
|
+
});
|
|
8
|
+
export const fixedSizeTruncateStyles = css({
|
|
9
|
+
textOverflow: 'ellipsis',
|
|
10
|
+
whiteSpace: 'nowrap'
|
|
11
|
+
});
|
|
12
|
+
export const overflowTruncateStyles = css({
|
|
13
|
+
overflow: 'hidden'
|
|
14
|
+
});
|
|
15
|
+
export const getTruncationStyleVars = ({
|
|
16
|
+
width
|
|
17
|
+
}) => {
|
|
18
|
+
return {
|
|
19
|
+
[CSS_VAR_WIDTH]: typeof width !== 'undefined' ? `${width}%` : undefined
|
|
20
|
+
};
|
|
106
21
|
};
|
|
107
|
-
export const
|
|
108
|
-
border: none
|
|
109
|
-
padding:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
padding-right: 0;
|
|
22
|
+
export const cellStyles = css({
|
|
23
|
+
border: 'none',
|
|
24
|
+
padding: `${gridSize / 2}px ${gridSize}px`,
|
|
25
|
+
textAlign: 'left',
|
|
26
|
+
'&:first-of-type': {
|
|
27
|
+
paddingLeft: 0
|
|
28
|
+
},
|
|
29
|
+
'&:last-child': {
|
|
30
|
+
paddingRight: 0
|
|
117
31
|
}
|
|
118
|
-
|
|
32
|
+
});
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
5
|
+
const rowPlaceholderStyles = css({
|
|
6
|
+
padding: 0
|
|
7
|
+
});
|
|
8
|
+
export const RowPlaceholderCell = props => jsx("td", _extends({
|
|
9
|
+
css: rowPlaceholderStyles
|
|
10
|
+
}, props));
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
2
5
|
import { TableBodyCell } from '../TableCell';
|
|
3
|
-
const rankingStyles = css
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const RankableTableBodyCell =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const rankingStyles = css({
|
|
7
|
+
boxSizing: 'border-box'
|
|
8
|
+
});
|
|
9
|
+
export const RankableTableBodyCell = ({
|
|
10
|
+
isRanking,
|
|
11
|
+
innerRef,
|
|
12
|
+
...props
|
|
13
|
+
}) => jsx(TableBodyCell, _extends({
|
|
14
|
+
css: isRanking && rankingStyles
|
|
15
|
+
}, props, {
|
|
16
|
+
innerRef: innerRef
|
|
17
|
+
}));
|
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
6
|
+
import { B100, N20, N50A, N60A } from '@atlaskit/theme/colors';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
4
8
|
import { TableBodyRow } from '../TableRow';
|
|
5
|
-
const rankingStyles = css
|
|
6
|
-
display: block
|
|
7
|
-
|
|
9
|
+
const rankingStyles = css({
|
|
10
|
+
display: 'block'
|
|
11
|
+
});
|
|
12
|
+
const elevationStyle = token('shadow.overlay', `0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`);
|
|
8
13
|
/**
|
|
9
14
|
* TODO: Pass the props here to get particular theme for the table
|
|
10
15
|
* Skipping it for now as it may impact migration as util-shared-styles does not support this feature
|
|
11
16
|
*/
|
|
12
17
|
|
|
13
|
-
const rankingItemStyles = css
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const draggableStyles = ({
|
|
18
|
+
const rankingItemStyles = css({
|
|
19
|
+
backgroundColor: token('color.background.subtleNeutral.resting', N20),
|
|
20
|
+
boxShadow: elevationStyle,
|
|
21
|
+
borderRadius: '2px'
|
|
22
|
+
});
|
|
23
|
+
const draggableStyles = css({
|
|
24
|
+
'&:focus': {
|
|
25
|
+
outlineStyle: 'solid',
|
|
26
|
+
outlineColor: token('color.border.focus', B100)
|
|
27
|
+
},
|
|
28
|
+
outlineWidth: '2px'
|
|
29
|
+
});
|
|
30
|
+
export const RankableTableBodyRow = /*#__PURE__*/forwardRef(({
|
|
19
31
|
isRanking,
|
|
20
|
-
isRankingItem
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export const RankableTableBodyRow = styled(TableBodyRow)`
|
|
30
|
-
${draggableStyles};
|
|
31
|
-
`;
|
|
32
|
+
isRankingItem,
|
|
33
|
+
...props
|
|
34
|
+
}, ref) => {
|
|
35
|
+
return jsx(TableBodyRow, _extends({
|
|
36
|
+
css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
|
|
37
|
+
ref: ref
|
|
38
|
+
}, props));
|
|
39
|
+
});
|
package/dist/es2019/theme.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
2
|
import { themed } from '@atlaskit/theme/components';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export const MSThemeColors = {
|
|
4
5
|
Background: 'Canvas',
|
|
5
6
|
Text: 'CanvasText',
|
|
@@ -8,43 +9,43 @@ export const MSThemeColors = {
|
|
|
8
9
|
};
|
|
9
10
|
export const arrow = {
|
|
10
11
|
defaultColor: themed({
|
|
11
|
-
light: colors.N40,
|
|
12
|
-
dark: colors.DN40
|
|
12
|
+
light: token('color.background.subtleNeutral.resting', colors.N40),
|
|
13
|
+
dark: token('color.background.subtleNeutral.resting', colors.DN40)
|
|
13
14
|
}),
|
|
14
15
|
selectedColor: themed({
|
|
15
|
-
light: colors.N300,
|
|
16
|
-
dark: colors.DN300
|
|
16
|
+
light: token('color.text.lowEmphasis', colors.N300),
|
|
17
|
+
dark: token('color.text.lowEmphasis', colors.DN300)
|
|
17
18
|
}),
|
|
18
19
|
hoverColor: themed({
|
|
19
|
-
light: colors.N60,
|
|
20
|
-
dark: colors.DN60
|
|
20
|
+
light: token('color.background.subtleNeutral.pressed', colors.N60),
|
|
21
|
+
dark: token('color.background.subtleNeutral.pressed', colors.DN60)
|
|
21
22
|
})
|
|
22
23
|
};
|
|
23
24
|
export const row = {
|
|
24
25
|
focusOutline: themed({
|
|
25
|
-
light: colors.B100,
|
|
26
|
-
dark: colors.B100
|
|
26
|
+
light: token('color.border.focus', colors.B100),
|
|
27
|
+
dark: token('color.border.focus', colors.B100)
|
|
27
28
|
}),
|
|
28
29
|
highlightedBackground: themed({
|
|
29
|
-
light: colors.B50,
|
|
30
|
-
dark: colors.DN50
|
|
30
|
+
light: token('color.background.selected.resting', colors.B50),
|
|
31
|
+
dark: token('color.background.selected.resting', colors.DN50)
|
|
31
32
|
}),
|
|
32
33
|
hoverBackground: themed({
|
|
33
|
-
light: colors.N10,
|
|
34
|
-
dark: colors.DN40
|
|
34
|
+
light: token('color.background.subtleBorderedNeutral.resting', colors.N10),
|
|
35
|
+
dark: token('color.background.subtleBorderedNeutral.resting', colors.DN40)
|
|
35
36
|
}),
|
|
36
37
|
hoverHighlightedBackground: themed({
|
|
37
|
-
light: colors.B75,
|
|
38
|
-
dark: colors.DN60
|
|
38
|
+
light: token('color.background.selected.hover', colors.B75),
|
|
39
|
+
dark: token('color.background.selected.hover', colors.DN60)
|
|
39
40
|
})
|
|
40
41
|
};
|
|
41
42
|
export const head = {
|
|
42
43
|
borderColor: themed({
|
|
43
|
-
light: colors.N40,
|
|
44
|
-
dark: colors.DN50
|
|
44
|
+
light: token('color.border.neutral', colors.N40),
|
|
45
|
+
dark: token('color.border.neutral', colors.DN50)
|
|
45
46
|
}),
|
|
46
47
|
textColor: themed({
|
|
47
|
-
light: colors.N300,
|
|
48
|
-
dark: colors.DN300
|
|
48
|
+
light: token('color.text.lowEmphasis', colors.N300),
|
|
49
|
+
dark: token('color.text.lowEmphasis', colors.DN300)
|
|
49
50
|
})
|
|
50
51
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -89,7 +89,7 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
_defineProperty(_assertThisInitialized(_this), "getSpinnerNode", function () {
|
|
92
|
-
return safeFindDOMNode(_this.
|
|
92
|
+
return safeFindDOMNode(_this.spinnerRef);
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
_defineProperty(_assertThisInitialized(_this), "hasTargetNode", function (nextProps) {
|
|
@@ -237,8 +237,8 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
|
|
|
237
237
|
_this2.children = el;
|
|
238
238
|
}
|
|
239
239
|
}), isLoading && /*#__PURE__*/React.createElement(SpinnerBackdrop, null, /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
240
|
-
|
|
241
|
-
_this2.
|
|
240
|
+
ref: function ref(el) {
|
|
241
|
+
return _this2.spinnerRef = el;
|
|
242
242
|
}
|
|
243
243
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
244
244
|
size: spinnerSize,
|
|
@@ -14,6 +14,32 @@ import React from 'react';
|
|
|
14
14
|
import { reorderRows } from '../internal/helpers';
|
|
15
15
|
import DynamicTableStateless from './Stateless';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* __Dynamic Table__
|
|
19
|
+
*
|
|
20
|
+
* A table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
|
|
21
|
+
*
|
|
22
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
23
|
+
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```jsx
|
|
27
|
+
* import DynamicTable from '@atlaskit/dynamic-table';
|
|
28
|
+
*
|
|
29
|
+
* export default function TableUncontrolled() {
|
|
30
|
+
* return (
|
|
31
|
+
* <DynamicTable
|
|
32
|
+
* head={head}
|
|
33
|
+
* rows={rows}
|
|
34
|
+
* rowsPerPage={10}
|
|
35
|
+
* defaultPage={1}
|
|
36
|
+
* loadingSpinnerSize="large"
|
|
37
|
+
* isLoading={false}
|
|
38
|
+
* />
|
|
39
|
+
* );
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
17
43
|
var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
18
44
|
_inherits(DynamicTable, _React$Component);
|
|
19
45
|
|
|
@@ -20,11 +20,11 @@ import { EmptyViewContainer, EmptyViewWithFixedHeight } from '../styled/EmptyBod
|
|
|
20
20
|
import Body from './Body';
|
|
21
21
|
import LoadingContainer from './LoadingContainer';
|
|
22
22
|
import LoadingContainerAdvanced from './LoadingContainerAdvanced';
|
|
23
|
-
import ManagedPagination from './
|
|
23
|
+
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.4.2";
|
|
28
28
|
|
|
29
29
|
function toggleSortOrder(currentSortOrder) {
|
|
30
30
|
switch (currentSortOrder) {
|
|
@@ -1,54 +1,26 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
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
|
-
|
|
14
3
|
import React from 'react';
|
|
15
4
|
import { HeadCell } from '../styled/TableHead';
|
|
16
5
|
|
|
17
|
-
var TableHeadCell =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return /*#__PURE__*/React.createElement(HeadCell, _extends({
|
|
38
|
-
style: inlineStyles,
|
|
39
|
-
"data-testid": testId && "".concat(testId, "--head--cell")
|
|
40
|
-
}, rest, {
|
|
41
|
-
tabIndex: rest.isSortable ? 0 : undefined
|
|
42
|
-
}), /*#__PURE__*/React.createElement("span", null, content));
|
|
43
|
-
}
|
|
44
|
-
}]);
|
|
45
|
-
|
|
46
|
-
return TableHeadCell;
|
|
47
|
-
}(React.Component);
|
|
48
|
-
|
|
49
|
-
_defineProperty(TableHeadCell, "defaultProps", {
|
|
50
|
-
innerRef: function innerRef() {},
|
|
51
|
-
inlineStyles: {}
|
|
52
|
-
});
|
|
6
|
+
var TableHeadCell = function TableHeadCell(_ref) {
|
|
7
|
+
var content = _ref.content,
|
|
8
|
+
inlineStyles = _ref.inlineStyles,
|
|
9
|
+
testId = _ref.testId,
|
|
10
|
+
isRanking = _ref.isRanking,
|
|
11
|
+
innerRef = _ref.innerRef,
|
|
12
|
+
isSortable = _ref.isSortable,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"]);
|
|
14
|
+
|
|
15
|
+
return /*#__PURE__*/React.createElement(HeadCell, _extends({
|
|
16
|
+
style: inlineStyles,
|
|
17
|
+
"data-testid": testId && "".concat(testId, "--head--cell"),
|
|
18
|
+
ref: typeof innerRef !== 'string' ? innerRef : null // string refs must be discarded as LegacyRefs are not compatible with FC forwardRefs
|
|
19
|
+
|
|
20
|
+
}, rest, {
|
|
21
|
+
tabIndex: isSortable ? 0 : undefined,
|
|
22
|
+
isSortable: isSortable
|
|
23
|
+
}), /*#__PURE__*/React.createElement("span", null, content));
|
|
24
|
+
};
|
|
53
25
|
|
|
54
26
|
export default TableHeadCell;
|
|
File without changes
|
|
@@ -33,8 +33,8 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
33
33
|
head = _this$props.head,
|
|
34
34
|
isFixedSize = _this$props.isFixedSize,
|
|
35
35
|
isRanking = _this$props.isRanking,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
refWidth = _this$props.refWidth,
|
|
37
|
+
innerRef = _this$props.innerRef;
|
|
38
38
|
|
|
39
39
|
var content = cell.content,
|
|
40
40
|
restCellProps = _objectWithoutProperties(cell, ["content"]);
|
|
@@ -50,10 +50,10 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
50
50
|
width: width,
|
|
51
51
|
isRanking: isRanking,
|
|
52
52
|
style: inlineStyles,
|
|
53
|
-
innerRef: innerRef,
|
|
54
53
|
onKeyDown: function onKeyDown(e) {
|
|
55
54
|
return e.stopPropagation();
|
|
56
|
-
}
|
|
55
|
+
},
|
|
56
|
+
innerRef: innerRef
|
|
57
57
|
}), content);
|
|
58
58
|
}
|
|
59
59
|
}]);
|
|
@@ -33,13 +33,11 @@ var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
|
33
33
|
isRanking = _this$props.isRanking,
|
|
34
34
|
refHeight = _this$props.refHeight,
|
|
35
35
|
refWidth = _this$props.refWidth,
|
|
36
|
-
|
|
37
|
-
restProps = _objectWithoutProperties(_this$props, ["isRanking", "refHeight", "refWidth", "innerRef"]);
|
|
36
|
+
restProps = _objectWithoutProperties(_this$props, ["isRanking", "refHeight", "refWidth"]);
|
|
38
37
|
|
|
39
38
|
var inlineStyles = inlineStylesIfRanking(isRanking, refWidth);
|
|
40
39
|
return /*#__PURE__*/React.createElement(HeadCell, _extends({
|
|
41
|
-
inlineStyles: inlineStyles
|
|
42
|
-
innerRef: innerRef
|
|
40
|
+
inlineStyles: inlineStyles
|
|
43
41
|
}, restProps));
|
|
44
42
|
}
|
|
45
43
|
}]);
|
|
@@ -42,7 +42,7 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
42
42
|
return function (ref) {
|
|
43
43
|
innerRefFn(ref);
|
|
44
44
|
|
|
45
|
-
if (_this.props.innerRef) {
|
|
45
|
+
if (typeof _this.props.innerRef === 'function') {
|
|
46
46
|
_this.props.innerRef(ref);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -78,12 +78,12 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
return /*#__PURE__*/React.createElement(Draggable, {
|
|
81
|
-
draggableId: key ||
|
|
81
|
+
draggableId: key || rowIndex.toString(),
|
|
82
82
|
index: rowIndex,
|
|
83
83
|
isDragDisabled: isRankingDisabled
|
|
84
84
|
}, function (provided, snapshot) {
|
|
85
85
|
return /*#__PURE__*/React.createElement(RankableTableBodyRow, _extends({}, restRowProps, provided.dragHandleProps, provided.draggableProps, {
|
|
86
|
-
|
|
86
|
+
ref: _this2.innerRef(provided.innerRef),
|
|
87
87
|
style: _objectSpread(_objectSpread({}, provided.draggableProps.style), inlineStyles),
|
|
88
88
|
isHighlighted: isHighlighted,
|
|
89
89
|
isRanking: isRanking,
|