@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
|
@@ -5,130 +5,45 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.cellStyles = exports.getTruncationStyleVars = exports.overflowTruncateStyles = exports.fixedSizeTruncateStyles = exports.truncationWidthStyles = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
+
var _core = require("@emotion/core");
|
|
15
13
|
|
|
16
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
15
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function _templateObject7() {
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n & > span {\n position: relative;\n &::before {\n ", ";\n border-bottom: 3px solid\n ", ";\n bottom: 8px;\n content: ' ';\n }\n &::after {\n ", ";\n border-top: 3px solid\n ", ";\n bottom: 0;\n content: ' ';\n }\n }\n\n &:hover > span {\n &::before {\n border-bottom: 3px solid\n ", ";\n }\n &::after {\n border-top: 3px solid\n ", ";\n }\n }\n "]);
|
|
36
|
-
|
|
37
|
-
_templateObject7 = function _templateObject7() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject6() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -", "px;\n width: 0;\n "]);
|
|
46
|
-
|
|
47
|
-
_templateObject6 = function _templateObject6() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return data;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _templateObject5() {
|
|
55
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n &:hover {\n cursor: pointer;\n background-color: ", ";\n }\n "]);
|
|
56
|
-
|
|
57
|
-
_templateObject5 = function _templateObject5() {
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return data;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject4() {
|
|
65
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]);
|
|
66
|
-
|
|
67
|
-
_templateObject4 = function _templateObject4() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _templateObject3() {
|
|
75
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n "]);
|
|
76
|
-
|
|
77
|
-
_templateObject3 = function _templateObject3() {
|
|
78
|
-
return data;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return data;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _templateObject2() {
|
|
85
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n width: ", "%;\n "]);
|
|
86
|
-
|
|
87
|
-
_templateObject2 = function _templateObject2() {
|
|
88
|
-
return data;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function _templateObject() {
|
|
95
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ", " ", ";\n ", ";\n"]);
|
|
96
|
-
|
|
97
|
-
_templateObject = function _templateObject() {
|
|
98
|
-
return data;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return data;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var truncateStyle = function truncateStyle(_ref) {
|
|
105
|
-
var width = _ref.width,
|
|
106
|
-
isFixedSize = _ref.isFixedSize,
|
|
107
|
-
shouldTruncate = _ref.shouldTruncate;
|
|
108
|
-
return (0, _styledComponents.css)(_templateObject(), width ? (0, _styledComponents.css)(_templateObject2(), width) : '', isFixedSize ? (0, _styledComponents.css)(_templateObject3()) : '', isFixedSize && shouldTruncate ? (0, _styledComponents.css)(_templateObject4()) : '');
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
exports.truncateStyle = truncateStyle;
|
|
16
|
+
var CSS_VAR_WIDTH = '--local-dynamic-table-width';
|
|
17
|
+
var gridSize = (0, _constants.gridSize)();
|
|
18
|
+
var truncationWidthStyles = (0, _core.css)({
|
|
19
|
+
width: "var(".concat(CSS_VAR_WIDTH, ")")
|
|
20
|
+
});
|
|
21
|
+
exports.truncationWidthStyles = truncationWidthStyles;
|
|
22
|
+
var fixedSizeTruncateStyles = (0, _core.css)({
|
|
23
|
+
textOverflow: 'ellipsis',
|
|
24
|
+
whiteSpace: 'nowrap'
|
|
25
|
+
});
|
|
26
|
+
exports.fixedSizeTruncateStyles = fixedSizeTruncateStyles;
|
|
27
|
+
var overflowTruncateStyles = (0, _core.css)({
|
|
28
|
+
overflow: 'hidden'
|
|
29
|
+
});
|
|
30
|
+
exports.overflowTruncateStyles = overflowTruncateStyles;
|
|
112
31
|
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
return
|
|
32
|
+
var getTruncationStyleVars = function getTruncationStyleVars(_ref) {
|
|
33
|
+
var width = _ref.width;
|
|
34
|
+
return (0, _defineProperty2.default)({}, CSS_VAR_WIDTH, "".concat(width, "%"));
|
|
116
35
|
};
|
|
117
36
|
|
|
118
|
-
exports.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
37
|
+
exports.getTruncationStyleVars = getTruncationStyleVars;
|
|
38
|
+
var cellStyles = (0, _core.css)({
|
|
39
|
+
border: 'none',
|
|
40
|
+
padding: "".concat(gridSize / 2, "px ").concat(gridSize, "px"),
|
|
41
|
+
textAlign: 'left',
|
|
42
|
+
'&:first-of-type': {
|
|
43
|
+
paddingLeft: 0
|
|
44
|
+
},
|
|
45
|
+
'&:last-child': {
|
|
46
|
+
paddingRight: 0
|
|
126
47
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return (0, _styledComponents.css)(_templateObject7(), pseudoBase, sortOrder === _constants2.ASC ? _theme.arrow.selectedColor(props) : _theme.arrow.defaultColor(props), pseudoBase, sortOrder === _constants2.DESC ? _theme.arrow.selectedColor(props) : _theme.arrow.defaultColor(props), sortOrder === _constants2.ASC ? _theme.arrow.selectedColor(props) : _theme.arrow.hoverColor(props), sortOrder === _constants2.DESC ? _theme.arrow.selectedColor(props) : _theme.arrow.hoverColor(props));
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
exports.arrowsStyle = arrowsStyle;
|
|
133
|
-
var cellStyle = (0, _styledComponents.css)(_templateObject8(), (0, _math.divide)(_constants.gridSize, 2), _constants.gridSize);
|
|
134
|
-
exports.cellStyle = cellStyle;
|
|
48
|
+
});
|
|
49
|
+
exports.cellStyles = cellStyles;
|
|
@@ -7,20 +7,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.RowPlaceholderCell = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _core = require("@emotion/core");
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return data;
|
|
22
|
-
}
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
var rowPlaceholderStyles = (0, _core.css)({
|
|
16
|
+
padding: 0
|
|
17
|
+
});
|
|
23
18
|
|
|
24
|
-
var RowPlaceholderCell =
|
|
19
|
+
var RowPlaceholderCell = function RowPlaceholderCell(props) {
|
|
20
|
+
return (0, _core.jsx)("td", (0, _extends2.default)({
|
|
21
|
+
css: rowPlaceholderStyles
|
|
22
|
+
}, props));
|
|
23
|
+
};
|
|
25
24
|
|
|
26
25
|
exports.RowPlaceholderCell = RowPlaceholderCell;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -9,35 +7,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
7
|
});
|
|
10
8
|
exports.RankableTableBodyCell = void 0;
|
|
11
9
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _TableCell = require("../TableCell");
|
|
17
|
-
|
|
18
|
-
function _templateObject2() {
|
|
19
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n"]);
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
24
13
|
|
|
25
|
-
|
|
26
|
-
}
|
|
14
|
+
var _core = require("@emotion/core");
|
|
27
15
|
|
|
28
|
-
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n"]);
|
|
16
|
+
var _TableCell = require("../TableCell");
|
|
30
17
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var rankingStyles = (0, _core.css)({
|
|
20
|
+
boxSizing: 'border-box'
|
|
21
|
+
});
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
var RankableTableBodyCell = function RankableTableBodyCell(_ref) {
|
|
24
|
+
var isRanking = _ref.isRanking,
|
|
25
|
+
innerRef = _ref.innerRef,
|
|
26
|
+
props = (0, _objectWithoutProperties2.default)(_ref, ["isRanking", "innerRef"]);
|
|
27
|
+
return (0, _core.jsx)(_TableCell.TableBodyCell, (0, _extends2.default)({
|
|
28
|
+
css: isRanking && rankingStyles
|
|
29
|
+
}, props, {
|
|
30
|
+
innerRef: innerRef
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
37
33
|
|
|
38
|
-
var rankingStyles = (0, _styledComponents.css)(_templateObject());
|
|
39
|
-
var RankableTableBodyCell = (0, _styledComponents.default)(_TableCell.TableBodyCell)(_templateObject2(), function (_ref) {
|
|
40
|
-
var isRanking = _ref.isRanking;
|
|
41
|
-
return isRanking && rankingStyles;
|
|
42
|
-
});
|
|
43
34
|
exports.RankableTableBodyCell = RankableTableBodyCell;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -9,69 +7,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
7
|
});
|
|
10
8
|
exports.RankableTableBodyRow = void 0;
|
|
11
9
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
17
|
-
|
|
18
|
-
var _elevation = require("@atlaskit/theme/elevation");
|
|
19
|
-
|
|
20
|
-
var _TableRow = require("../TableRow");
|
|
21
|
-
|
|
22
|
-
function _templateObject4() {
|
|
23
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n"]);
|
|
24
|
-
|
|
25
|
-
_templateObject4 = function _templateObject4() {
|
|
26
|
-
return data;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function _templateObject3() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ", " ", " &:focus {\n outline-style: solid;\n outline-color: ", ";\n outline-width: 2px;\n }\n"]);
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
34
11
|
|
|
35
|
-
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
38
13
|
|
|
39
|
-
|
|
40
|
-
}
|
|
14
|
+
var _react = require("react");
|
|
41
15
|
|
|
42
|
-
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n ", " border-radius: 2px;\n"]);
|
|
16
|
+
var _core = require("@emotion/core");
|
|
44
17
|
|
|
45
|
-
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n"]);
|
|
18
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
54
19
|
|
|
55
|
-
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
58
21
|
|
|
59
|
-
|
|
60
|
-
}
|
|
22
|
+
var _TableRow = require("../TableRow");
|
|
61
23
|
|
|
62
|
-
|
|
24
|
+
/** @jsx jsx */
|
|
25
|
+
var rankingStyles = (0, _core.css)({
|
|
26
|
+
display: 'block'
|
|
27
|
+
});
|
|
28
|
+
var elevationStyle = (0, _tokens.token)('shadow.overlay', "0 20px 32px -8px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A));
|
|
63
29
|
/**
|
|
64
30
|
* TODO: Pass the props here to get particular theme for the table
|
|
65
31
|
* Skipping it for now as it may impact migration as util-shared-styles does not support this feature
|
|
66
32
|
*/
|
|
67
33
|
|
|
68
|
-
var rankingItemStyles = (0,
|
|
69
|
-
|
|
70
|
-
|
|
34
|
+
var rankingItemStyles = (0, _core.css)({
|
|
35
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleNeutral.resting', _colors.N20),
|
|
36
|
+
boxShadow: elevationStyle,
|
|
37
|
+
borderRadius: '2px'
|
|
38
|
+
});
|
|
39
|
+
var draggableStyles = (0, _core.css)({
|
|
40
|
+
'&:focus': {
|
|
41
|
+
outlineStyle: 'solid',
|
|
42
|
+
outlineColor: (0, _tokens.token)('color.border.focus', _colors.B100)
|
|
43
|
+
},
|
|
44
|
+
outlineWidth: '2px'
|
|
45
|
+
});
|
|
46
|
+
var RankableTableBodyRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
71
47
|
var isRanking = _ref.isRanking,
|
|
72
|
-
isRankingItem = _ref.isRankingItem
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
isRankingItem = _ref.isRankingItem,
|
|
49
|
+
props = (0, _objectWithoutProperties2.default)(_ref, ["isRanking", "isRankingItem"]);
|
|
50
|
+
return (0, _core.jsx)(_TableRow.TableBodyRow, (0, _extends2.default)({
|
|
51
|
+
css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
|
|
52
|
+
ref: ref
|
|
53
|
+
}, props));
|
|
54
|
+
});
|
|
77
55
|
exports.RankableTableBodyRow = RankableTableBodyRow;
|
package/dist/cjs/theme.js
CHANGED
|
@@ -1,58 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.head = exports.row = exports.arrow = void 0;
|
|
8
|
+
exports.head = exports.row = exports.arrow = exports.MSThemeColors = void 0;
|
|
9
9
|
|
|
10
10
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
11
11
|
|
|
12
12
|
var _components = require("@atlaskit/theme/components");
|
|
13
13
|
|
|
14
|
+
var _tokens = require("@atlaskit/tokens");
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
var MSThemeColors = {
|
|
21
|
+
Background: 'Canvas',
|
|
22
|
+
Text: 'CanvasText',
|
|
23
|
+
SelectedBackground: 'Highlight',
|
|
24
|
+
SelectedText: 'HighlightText'
|
|
25
|
+
};
|
|
26
|
+
exports.MSThemeColors = MSThemeColors;
|
|
14
27
|
var arrow = {
|
|
15
28
|
defaultColor: (0, _components.themed)({
|
|
16
|
-
light: colors.N40,
|
|
17
|
-
dark: colors.DN40
|
|
29
|
+
light: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N40),
|
|
30
|
+
dark: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.DN40)
|
|
18
31
|
}),
|
|
19
32
|
selectedColor: (0, _components.themed)({
|
|
20
|
-
light: colors.N300,
|
|
21
|
-
dark: colors.DN300
|
|
33
|
+
light: (0, _tokens.token)('color.text.lowEmphasis', colors.N300),
|
|
34
|
+
dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN300)
|
|
22
35
|
}),
|
|
23
36
|
hoverColor: (0, _components.themed)({
|
|
24
|
-
light: colors.N60,
|
|
25
|
-
dark: colors.DN60
|
|
37
|
+
light: (0, _tokens.token)('color.background.subtleNeutral.pressed', colors.N60),
|
|
38
|
+
dark: (0, _tokens.token)('color.background.subtleNeutral.pressed', colors.DN60)
|
|
26
39
|
})
|
|
27
40
|
};
|
|
28
41
|
exports.arrow = arrow;
|
|
29
42
|
var row = {
|
|
30
43
|
focusOutline: (0, _components.themed)({
|
|
31
|
-
light: colors.B100,
|
|
32
|
-
dark: colors.B100
|
|
44
|
+
light: (0, _tokens.token)('color.border.focus', colors.B100),
|
|
45
|
+
dark: (0, _tokens.token)('color.border.focus', colors.B100)
|
|
33
46
|
}),
|
|
34
47
|
highlightedBackground: (0, _components.themed)({
|
|
35
|
-
light: colors.
|
|
36
|
-
dark: colors.DN50
|
|
48
|
+
light: (0, _tokens.token)('color.background.selected.resting', colors.B50),
|
|
49
|
+
dark: (0, _tokens.token)('color.background.selected.resting', colors.DN50)
|
|
37
50
|
}),
|
|
38
51
|
hoverBackground: (0, _components.themed)({
|
|
39
|
-
light: colors.N10,
|
|
40
|
-
dark: colors.DN40
|
|
52
|
+
light: (0, _tokens.token)('color.background.subtleBorderedNeutral.resting', colors.N10),
|
|
53
|
+
dark: (0, _tokens.token)('color.background.subtleBorderedNeutral.resting', colors.DN40)
|
|
41
54
|
}),
|
|
42
55
|
hoverHighlightedBackground: (0, _components.themed)({
|
|
43
|
-
light: colors.
|
|
44
|
-
dark: colors.DN60
|
|
56
|
+
light: (0, _tokens.token)('color.background.selected.hover', colors.B75),
|
|
57
|
+
dark: (0, _tokens.token)('color.background.selected.hover', colors.DN60)
|
|
45
58
|
})
|
|
46
59
|
};
|
|
47
60
|
exports.row = row;
|
|
48
61
|
var head = {
|
|
49
62
|
borderColor: (0, _components.themed)({
|
|
50
|
-
light: colors.N40,
|
|
51
|
-
dark: colors.DN50
|
|
63
|
+
light: (0, _tokens.token)('color.border.neutral', colors.N40),
|
|
64
|
+
dark: (0, _tokens.token)('color.border.neutral', colors.DN50)
|
|
52
65
|
}),
|
|
53
66
|
textColor: (0, _components.themed)({
|
|
54
|
-
light: colors.N300,
|
|
55
|
-
dark: colors.DN300
|
|
67
|
+
light: (0, _tokens.token)('color.text.lowEmphasis', colors.N300),
|
|
68
|
+
dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN300)
|
|
56
69
|
})
|
|
57
70
|
};
|
|
58
71
|
exports.head = head;
|
package/dist/cjs/version.json
CHANGED
|
@@ -18,7 +18,7 @@ class Body extends React.Component {
|
|
|
18
18
|
isFixedSize: isFixedSize,
|
|
19
19
|
key: row.key || rowIndex,
|
|
20
20
|
row: row,
|
|
21
|
-
isHighlighted: highlightedRowIndex === rowIndex,
|
|
21
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
22
22
|
testId: testId
|
|
23
23
|
})));
|
|
24
24
|
}
|
|
@@ -61,7 +61,7 @@ export default class LoadingContainerAdvanced extends React.Component {
|
|
|
61
61
|
|
|
62
62
|
_defineProperty(this, "getThisNode", () => safeFindDOMNode(this));
|
|
63
63
|
|
|
64
|
-
_defineProperty(this, "getSpinnerNode", () => safeFindDOMNode(this.
|
|
64
|
+
_defineProperty(this, "getSpinnerNode", () => safeFindDOMNode(this.spinnerRef));
|
|
65
65
|
|
|
66
66
|
_defineProperty(this, "hasTargetNode", nextProps => !!this.getTargetNode(nextProps));
|
|
67
67
|
|
|
@@ -199,9 +199,7 @@ export default class LoadingContainerAdvanced extends React.Component {
|
|
|
199
199
|
this.children = el;
|
|
200
200
|
}
|
|
201
201
|
}), isLoading && /*#__PURE__*/React.createElement(SpinnerBackdrop, null, /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
202
|
-
|
|
203
|
-
this.spinner = el;
|
|
204
|
-
}
|
|
202
|
+
ref: el => this.spinnerRef = el
|
|
205
203
|
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
206
204
|
size: spinnerSize,
|
|
207
205
|
testId: testId && `${testId}--loadingSpinner`
|
|
@@ -112,7 +112,8 @@ export default class DynamicTable extends React.Component {
|
|
|
112
112
|
paginationi18n,
|
|
113
113
|
onRankStart,
|
|
114
114
|
onPageRowsUpdate,
|
|
115
|
-
testId
|
|
115
|
+
testId,
|
|
116
|
+
label
|
|
116
117
|
} = this.props;
|
|
117
118
|
return /*#__PURE__*/React.createElement(DynamicTableStateless, {
|
|
118
119
|
paginationi18n: paginationi18n,
|
|
@@ -135,7 +136,8 @@ export default class DynamicTable extends React.Component {
|
|
|
135
136
|
onRankEnd: this.onRankEnd,
|
|
136
137
|
onRankStart: onRankStart,
|
|
137
138
|
onPageRowsUpdate: onPageRowsUpdate,
|
|
138
|
-
testId: testId
|
|
139
|
+
testId: testId,
|
|
140
|
+
label: label
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -13,7 +13,7 @@ import ManagedPagination from './managedPagination';
|
|
|
13
13
|
import RankableTableBody from './rankable/Body';
|
|
14
14
|
import TableHead from './TableHead';
|
|
15
15
|
const packageName = "@atlaskit/dynamic-table";
|
|
16
|
-
const packageVersion = "14.
|
|
16
|
+
const packageVersion = "14.4.0";
|
|
17
17
|
|
|
18
18
|
function toggleSortOrder(currentSortOrder) {
|
|
19
19
|
switch (currentSortOrder) {
|
|
@@ -162,7 +162,8 @@ class DynamicTable extends React.Component {
|
|
|
162
162
|
paginationi18n,
|
|
163
163
|
onPageRowsUpdate,
|
|
164
164
|
testId,
|
|
165
|
-
totalRows: passedDownTotalRows
|
|
165
|
+
totalRows: passedDownTotalRows,
|
|
166
|
+
label
|
|
166
167
|
} = this.props;
|
|
167
168
|
const rowsLength = rows && rows.length;
|
|
168
169
|
let totalPages; // set a flag to denote the dynamic table might get only one page of data
|
|
@@ -210,7 +211,8 @@ class DynamicTable extends React.Component {
|
|
|
210
211
|
testId: testId
|
|
211
212
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
212
213
|
isFixedSize: isFixedSize,
|
|
213
|
-
"data-testid": testId && `${testId}--table
|
|
214
|
+
"data-testid": testId && `${testId}--table`,
|
|
215
|
+
"aria-label": label
|
|
214
216
|
}, !!caption && /*#__PURE__*/React.createElement(Caption, null, caption), head && /*#__PURE__*/React.createElement(TableHead, {
|
|
215
217
|
head: head,
|
|
216
218
|
onSort: this.onSort,
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { HeadCell } from '../styled/TableHead';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}), /*#__PURE__*/React.createElement("span", null, content));
|
|
20
|
-
}
|
|
5
|
+
const TableHeadCell = ({
|
|
6
|
+
content,
|
|
7
|
+
inlineStyles,
|
|
8
|
+
testId,
|
|
9
|
+
isRanking,
|
|
10
|
+
innerRef,
|
|
11
|
+
isSortable,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
return /*#__PURE__*/React.createElement(HeadCell, _extends({
|
|
15
|
+
style: inlineStyles,
|
|
16
|
+
"data-testid": testId && `${testId}--head--cell`,
|
|
17
|
+
ref: typeof innerRef !== 'string' ? innerRef : null // string refs must be discarded as LegacyRefs are not compatible with FC forwardRefs
|
|
21
18
|
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
19
|
+
}, rest, {
|
|
20
|
+
tabIndex: isSortable ? 0 : undefined,
|
|
21
|
+
isSortable: isSortable
|
|
22
|
+
}), /*#__PURE__*/React.createElement("span", null, content));
|
|
23
|
+
};
|
|
28
24
|
|
|
29
25
|
export default TableHeadCell;
|
|
@@ -15,7 +15,10 @@ const Row = ({
|
|
|
15
15
|
...restRowProps
|
|
16
16
|
} = row;
|
|
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 && `${testId}--row-${restRowProps.key}`
|
|
20
23
|
}), cells.map((cell, cellIndex) => {
|
|
21
24
|
const {
|
|
@@ -100,7 +100,7 @@ export class RankableBody extends React.Component {
|
|
|
100
100
|
rowIndex: rowIndex,
|
|
101
101
|
row: row,
|
|
102
102
|
isRankingDisabled: isRankingDisabled,
|
|
103
|
-
isHighlighted: highlightedRowIndex === rowIndex
|
|
103
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1)
|
|
104
104
|
})), provided.placeholder)));
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -10,8 +10,8 @@ export class RankableTableCell extends React.Component {
|
|
|
10
10
|
head,
|
|
11
11
|
isFixedSize,
|
|
12
12
|
isRanking,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
refWidth,
|
|
14
|
+
innerRef
|
|
15
15
|
} = this.props;
|
|
16
16
|
const {
|
|
17
17
|
content,
|
|
@@ -28,8 +28,8 @@ export class RankableTableCell extends React.Component {
|
|
|
28
28
|
width: width,
|
|
29
29
|
isRanking: isRanking,
|
|
30
30
|
style: inlineStyles,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
onKeyDown: e => e.stopPropagation(),
|
|
32
|
+
innerRef: innerRef
|
|
33
33
|
}), content);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -10,13 +10,11 @@ class RankableTableHeadCell extends React.Component {
|
|
|
10
10
|
isRanking,
|
|
11
11
|
refHeight,
|
|
12
12
|
refWidth,
|
|
13
|
-
innerRef,
|
|
14
13
|
...restProps
|
|
15
14
|
} = this.props;
|
|
16
15
|
const inlineStyles = inlineStylesIfRanking(isRanking, refWidth);
|
|
17
16
|
return /*#__PURE__*/React.createElement(HeadCell, _extends({
|
|
18
|
-
inlineStyles: inlineStyles
|
|
19
|
-
innerRef: innerRef
|
|
17
|
+
inlineStyles: inlineStyles
|
|
20
18
|
}, restProps));
|
|
21
19
|
}
|
|
22
20
|
|