@atlaskit/dynamic-table 14.2.3 → 14.4.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 +39 -0
- package/dist/cjs/components/Body.js +2 -2
- package/dist/cjs/components/LoadingContainer.js +1 -1
- package/dist/cjs/components/LoadingContainerAdvanced.js +4 -4
- package/dist/cjs/components/Stateful.js +5 -3
- package/dist/cjs/components/Stateless.js +6 -4
- package/dist/cjs/components/TableHead.js +1 -1
- package/dist/cjs/components/TableHeadCell.js +18 -48
- package/dist/cjs/components/TableRow.js +4 -1
- package/dist/cjs/components/managedPagination.js +1 -1
- package/dist/cjs/components/rankable/Body.js +2 -2
- package/dist/cjs/components/rankable/TableCell.js +5 -5
- package/dist/cjs/components/rankable/TableHeadCell.js +3 -5
- package/dist/cjs/components/rankable/TableRow.js +5 -5
- package/dist/cjs/hoc/withDimensions.js +3 -5
- package/dist/cjs/hoc/withSortedPageRows.js +4 -6
- package/dist/cjs/styled/DynamicTable.js +80 -50
- package/dist/cjs/styled/EmptyBody.js +23 -28
- package/dist/cjs/styled/LoadingContainer.js +41 -36
- package/dist/cjs/styled/LoadingContainerAdvanced.js +42 -36
- package/dist/cjs/styled/TableCell.js +21 -15
- package/dist/cjs/styled/TableHead.js +157 -45
- package/dist/cjs/styled/TableRow.js +36 -42
- package/dist/cjs/styled/constants.js +33 -118
- package/dist/cjs/styled/rankable/RowPlaceholder.js +11 -12
- package/dist/cjs/styled/rankable/TableCell.js +18 -27
- package/dist/cjs/styled/rankable/TableRow.js +32 -54
- package/dist/cjs/theme.js +33 -20
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Body.js +1 -1
- package/dist/es2019/components/LoadingContainerAdvanced.js +2 -4
- package/dist/es2019/components/Stateful.js +4 -2
- package/dist/es2019/components/Stateless.js +5 -3
- package/dist/es2019/components/TableHeadCell.js +18 -22
- package/dist/es2019/components/TableRow.js +4 -1
- package/dist/es2019/components/rankable/Body.js +1 -1
- 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/hoc/withDimensions.js +2 -4
- package/dist/es2019/hoc/withSortedPageRows.js +2 -4
- 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 -88
- 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 +25 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Body.js +2 -2
- package/dist/esm/components/LoadingContainer.js +1 -1
- package/dist/esm/components/LoadingContainerAdvanced.js +4 -4
- package/dist/esm/components/Stateful.js +5 -3
- package/dist/esm/components/Stateless.js +6 -4
- package/dist/esm/components/TableHead.js +1 -1
- package/dist/esm/components/TableHeadCell.js +19 -47
- package/dist/esm/components/TableRow.js +4 -1
- package/dist/esm/components/managedPagination.js +1 -1
- package/dist/esm/components/rankable/Body.js +2 -2
- package/dist/esm/components/rankable/TableCell.js +5 -5
- package/dist/esm/components/rankable/TableHeadCell.js +3 -5
- package/dist/esm/components/rankable/TableRow.js +5 -5
- package/dist/esm/hoc/withDimensions.js +3 -5
- package/dist/esm/hoc/withSortedPageRows.js +4 -6
- package/dist/esm/styled/DynamicTable.js +75 -46
- package/dist/esm/styled/EmptyBody.js +23 -26
- package/dist/esm/styled/LoadingContainer.js +40 -36
- package/dist/esm/styled/LoadingContainerAdvanced.js +41 -35
- package/dist/esm/styled/TableCell.js +21 -15
- package/dist/esm/styled/TableHead.js +152 -41
- package/dist/esm/styled/TableRow.js +38 -42
- package/dist/esm/styled/constants.js +28 -108
- package/dist/esm/styled/rankable/RowPlaceholder.js +12 -14
- package/dist/esm/styled/rankable/TableCell.js +18 -27
- package/dist/esm/styled/rankable/TableRow.js +33 -54
- package/dist/esm/theme.js +25 -18
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Body.d.ts +22 -22
- package/dist/types/components/LoadingContainerAdvanced.d.ts +2 -2
- package/dist/types/components/Stateless.d.ts +3 -3
- package/dist/types/components/TableHeadCell.d.ts +4 -9
- package/dist/types/components/rankable/Body.d.ts +22 -22
- 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/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 +15 -9
- package/dist/types/types.d.ts +18 -6
- package/package.json +15 -9
|
@@ -1,90 +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
|
-
return css`
|
|
49
|
-
& > span {
|
|
50
|
-
position: relative;
|
|
51
|
-
&::before {
|
|
52
|
-
${pseudoBase};
|
|
53
|
-
border-bottom: 3px solid
|
|
54
|
-
${sortOrder === ASC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
|
|
55
|
-
bottom: 8px;
|
|
56
|
-
content: ' ';
|
|
57
|
-
}
|
|
58
|
-
&::after {
|
|
59
|
-
${pseudoBase};
|
|
60
|
-
border-top: 3px solid
|
|
61
|
-
${sortOrder === DESC ? arrow.selectedColor(props) : arrow.defaultColor(props)};
|
|
62
|
-
bottom: 0;
|
|
63
|
-
content: ' ';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&:hover > span {
|
|
68
|
-
&::before {
|
|
69
|
-
border-bottom: 3px solid
|
|
70
|
-
${sortOrder === ASC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
|
|
71
|
-
}
|
|
72
|
-
&::after {
|
|
73
|
-
border-top: 3px solid
|
|
74
|
-
${sortOrder === DESC ? arrow.selectedColor(props) : arrow.hoverColor(props)};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
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]: `${width}%`
|
|
20
|
+
};
|
|
78
21
|
};
|
|
79
|
-
export const
|
|
80
|
-
border: none
|
|
81
|
-
padding:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
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
|
|
89
31
|
}
|
|
90
|
-
|
|
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,44 +1,51 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
2
|
import { themed } from '@atlaskit/theme/components';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
4
|
+
export const MSThemeColors = {
|
|
5
|
+
Background: 'Canvas',
|
|
6
|
+
Text: 'CanvasText',
|
|
7
|
+
SelectedBackground: 'Highlight',
|
|
8
|
+
SelectedText: 'HighlightText'
|
|
9
|
+
};
|
|
3
10
|
export const arrow = {
|
|
4
11
|
defaultColor: themed({
|
|
5
|
-
light: colors.N40,
|
|
6
|
-
dark: colors.DN40
|
|
12
|
+
light: token('color.background.subtleNeutral.resting', colors.N40),
|
|
13
|
+
dark: token('color.background.subtleNeutral.resting', colors.DN40)
|
|
7
14
|
}),
|
|
8
15
|
selectedColor: themed({
|
|
9
|
-
light: colors.N300,
|
|
10
|
-
dark: colors.DN300
|
|
16
|
+
light: token('color.text.lowEmphasis', colors.N300),
|
|
17
|
+
dark: token('color.text.lowEmphasis', colors.DN300)
|
|
11
18
|
}),
|
|
12
19
|
hoverColor: themed({
|
|
13
|
-
light: colors.N60,
|
|
14
|
-
dark: colors.DN60
|
|
20
|
+
light: token('color.background.subtleNeutral.pressed', colors.N60),
|
|
21
|
+
dark: token('color.background.subtleNeutral.pressed', colors.DN60)
|
|
15
22
|
})
|
|
16
23
|
};
|
|
17
24
|
export const row = {
|
|
18
25
|
focusOutline: themed({
|
|
19
|
-
light: colors.B100,
|
|
20
|
-
dark: colors.B100
|
|
26
|
+
light: token('color.border.focus', colors.B100),
|
|
27
|
+
dark: token('color.border.focus', colors.B100)
|
|
21
28
|
}),
|
|
22
29
|
highlightedBackground: themed({
|
|
23
|
-
light: colors.
|
|
24
|
-
dark: colors.DN50
|
|
30
|
+
light: token('color.background.selected.resting', colors.B50),
|
|
31
|
+
dark: token('color.background.selected.resting', colors.DN50)
|
|
25
32
|
}),
|
|
26
33
|
hoverBackground: themed({
|
|
27
|
-
light: colors.N10,
|
|
28
|
-
dark: colors.DN40
|
|
34
|
+
light: token('color.background.subtleBorderedNeutral.resting', colors.N10),
|
|
35
|
+
dark: token('color.background.subtleBorderedNeutral.resting', colors.DN40)
|
|
29
36
|
}),
|
|
30
37
|
hoverHighlightedBackground: themed({
|
|
31
|
-
light: colors.
|
|
32
|
-
dark: colors.DN60
|
|
38
|
+
light: token('color.background.selected.hover', colors.B75),
|
|
39
|
+
dark: token('color.background.selected.hover', colors.DN60)
|
|
33
40
|
})
|
|
34
41
|
};
|
|
35
42
|
export const head = {
|
|
36
43
|
borderColor: themed({
|
|
37
|
-
light: colors.N40,
|
|
38
|
-
dark: colors.DN50
|
|
44
|
+
light: token('color.border.neutral', colors.N40),
|
|
45
|
+
dark: token('color.border.neutral', colors.DN50)
|
|
39
46
|
}),
|
|
40
47
|
textColor: themed({
|
|
41
|
-
light: colors.N300,
|
|
42
|
-
dark: colors.DN300
|
|
48
|
+
light: token('color.text.lowEmphasis', colors.N300),
|
|
49
|
+
dark: token('color.text.lowEmphasis', colors.DN300)
|
|
43
50
|
})
|
|
44
51
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,7 +6,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
6
6
|
|
|
7
7
|
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); }; }
|
|
8
8
|
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
9
|
+
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; } }
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import withSortedPageRows from '../hoc/withSortedPageRows';
|
|
@@ -40,7 +40,7 @@ var Body = /*#__PURE__*/function (_React$Component) {
|
|
|
40
40
|
isFixedSize: isFixedSize,
|
|
41
41
|
key: row.key || rowIndex,
|
|
42
42
|
row: row,
|
|
43
|
-
isHighlighted: highlightedRowIndex === rowIndex,
|
|
43
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
44
44
|
testId: testId
|
|
45
45
|
});
|
|
46
46
|
}));
|
|
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
|
|
8
8
|
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); }; }
|
|
9
9
|
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
10
|
+
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; } }
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
|
|
10
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
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 {
|
|
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
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { findDOMNode } from 'react-dom';
|
|
@@ -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,
|
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
|
|
9
9
|
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); }; }
|
|
10
10
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
11
|
+
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; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { reorderRows } from '../internal/helpers';
|
|
@@ -135,7 +135,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
135
135
|
paginationi18n = _this$props.paginationi18n,
|
|
136
136
|
onRankStart = _this$props.onRankStart,
|
|
137
137
|
onPageRowsUpdate = _this$props.onPageRowsUpdate,
|
|
138
|
-
testId = _this$props.testId
|
|
138
|
+
testId = _this$props.testId,
|
|
139
|
+
label = _this$props.label;
|
|
139
140
|
return /*#__PURE__*/React.createElement(DynamicTableStateless, {
|
|
140
141
|
paginationi18n: paginationi18n,
|
|
141
142
|
caption: caption,
|
|
@@ -157,7 +158,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
157
158
|
onRankEnd: this.onRankEnd,
|
|
158
159
|
onRankStart: onRankStart,
|
|
159
160
|
onPageRowsUpdate: onPageRowsUpdate,
|
|
160
|
-
testId: testId
|
|
161
|
+
testId: testId,
|
|
162
|
+
label: label
|
|
161
163
|
});
|
|
162
164
|
}
|
|
163
165
|
}]);
|
|
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
|
|
10
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
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 {
|
|
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
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -24,7 +24,7 @@ import ManagedPagination from './managedPagination';
|
|
|
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.0";
|
|
28
28
|
|
|
29
29
|
function toggleSortOrder(currentSortOrder) {
|
|
30
30
|
switch (currentSortOrder) {
|
|
@@ -188,7 +188,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
188
188
|
paginationi18n = _this$props4.paginationi18n,
|
|
189
189
|
onPageRowsUpdate = _this$props4.onPageRowsUpdate,
|
|
190
190
|
testId = _this$props4.testId,
|
|
191
|
-
passedDownTotalRows = _this$props4.totalRows
|
|
191
|
+
passedDownTotalRows = _this$props4.totalRows,
|
|
192
|
+
label = _this$props4.label;
|
|
192
193
|
var rowsLength = rows && rows.length;
|
|
193
194
|
var totalPages; // set a flag to denote the dynamic table might get only one page of data
|
|
194
195
|
// for paginated data
|
|
@@ -237,7 +238,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
237
238
|
testId: testId
|
|
238
239
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
239
240
|
isFixedSize: isFixedSize,
|
|
240
|
-
"data-testid": testId && "".concat(testId, "--table")
|
|
241
|
+
"data-testid": testId && "".concat(testId, "--table"),
|
|
242
|
+
"aria-label": label
|
|
241
243
|
}, !!caption && /*#__PURE__*/React.createElement(Caption, null, caption), head && /*#__PURE__*/React.createElement(TableHead, {
|
|
242
244
|
head: head,
|
|
243
245
|
onSort: this.onSort,
|
|
@@ -10,7 +10,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
10
10
|
|
|
11
11
|
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); }; }
|
|
12
12
|
|
|
13
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
13
|
+
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; } }
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { validateSortKey } from '../internal/helpers';
|
|
@@ -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 { Date.prototype.toString.call(Reflect.construct(Date, [], 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;
|
|
@@ -15,7 +15,10 @@ var Row = function Row(_ref) {
|
|
|
15
15
|
restRowProps = _objectWithoutProperties(row, ["cells"]);
|
|
16
16
|
|
|
17
17
|
return /*#__PURE__*/React.createElement(TableBodyRow, _extends({}, restRowProps, {
|
|
18
|
-
isHighlighted: isHighlighted
|
|
18
|
+
isHighlighted: isHighlighted
|
|
19
|
+
}, isHighlighted ? {
|
|
20
|
+
'data-ts--dynamic-table--table-row--highlighted': true
|
|
21
|
+
} : null, {
|
|
19
22
|
"data-testid": testId && "".concat(testId, "--row-").concat(restRowProps.key)
|
|
20
23
|
}), cells.map(function (cell, cellIndex) {
|
|
21
24
|
var content = cell.content,
|
|
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
|
|
10
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
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 {
|
|
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
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import Pagination from '@atlaskit/pagination';
|
|
@@ -9,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
|
|
10
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
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 {
|
|
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
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
|
@@ -114,7 +114,7 @@ export var RankableBody = /*#__PURE__*/function (_React$Component) {
|
|
|
114
114
|
rowIndex: rowIndex,
|
|
115
115
|
row: row,
|
|
116
116
|
isRankingDisabled: isRankingDisabled,
|
|
117
|
-
isHighlighted: highlightedRowIndex === rowIndex
|
|
117
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1)
|
|
118
118
|
});
|
|
119
119
|
}), provided.placeholder);
|
|
120
120
|
}));
|
|
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
|
|
9
9
|
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); }; }
|
|
10
10
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
11
|
+
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; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import withDimensions from '../../hoc/withDimensions';
|
|
@@ -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
|
}]);
|
|
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
|
|
9
9
|
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); }; }
|
|
10
10
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
11
|
+
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; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import withDimensions from '../../hoc/withDimensions';
|
|
@@ -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
|
}]);
|