@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 14.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`dc35866892f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc35866892f) - [ux] Instrumented dynamic-table with the new theming package, @atlaskit/tokens.
|
|
8
|
+
|
|
9
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
10
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
11
|
+
|
|
12
|
+
- [`ca00a7783a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ca00a7783a9) - Removes `styled-components` as a peer dependency in favour of a direct dependency on `emotion`.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 14.3.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Internal changes to remove `@atlaskit/theme/math` usage.
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
25
|
+
## 14.3.1
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
30
|
+
|
|
31
|
+
## 14.3.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- [`7da3e890032`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7da3e890032) - [ux] `highlightedRowIndex` now can be a list of numbers (`number[]`), as well as `number`. Also highlighted rows now have B50/B75 colour.
|
|
36
|
+
- [`aa66648082f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aa66648082f) - Add support for aria attributes on the table
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- [`bf041942c3a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bf041942c3a) - Added styles to `HeadCell` to be visible when windows high contrast mode is turned on.
|
|
41
|
+
|
|
3
42
|
## 14.2.3
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
|
@@ -25,7 +25,7 @@ var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
|
25
25
|
|
|
26
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
27
|
|
|
28
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
28
|
+
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; } }
|
|
29
29
|
|
|
30
30
|
var Body = /*#__PURE__*/function (_React$Component) {
|
|
31
31
|
(0, _inherits2.default)(Body, _React$Component);
|
|
@@ -54,7 +54,7 @@ var Body = /*#__PURE__*/function (_React$Component) {
|
|
|
54
54
|
isFixedSize: isFixedSize,
|
|
55
55
|
key: row.key || rowIndex,
|
|
56
56
|
row: row,
|
|
57
|
-
isHighlighted: highlightedRowIndex === rowIndex,
|
|
57
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
58
58
|
testId: testId
|
|
59
59
|
});
|
|
60
60
|
}));
|
|
@@ -29,7 +29,7 @@ var _LoadingContainer = require("../styled/LoadingContainer");
|
|
|
29
29
|
|
|
30
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
32
|
+
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; } }
|
|
33
33
|
|
|
34
34
|
var LoadingContainer = /*#__PURE__*/function (_React$Component) {
|
|
35
35
|
(0, _inherits2.default)(LoadingContainer, _React$Component);
|
|
@@ -35,7 +35,7 @@ var _LoadingContainerAdvanced = require("../styled/LoadingContainerAdvanced");
|
|
|
35
35
|
|
|
36
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
37
37
|
|
|
38
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
38
|
+
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; } }
|
|
39
39
|
|
|
40
40
|
// there is a bug with findDOMNode and Suspense in React < 16.9: https://github.com/facebook/react/issues/14188
|
|
41
41
|
var safeFindDOMNode = function safeFindDOMNode(component) {
|
|
@@ -102,7 +102,7 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
|
|
|
102
102
|
return safeFindDOMNode((0, _assertThisInitialized2.default)(_this));
|
|
103
103
|
});
|
|
104
104
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSpinnerNode", function () {
|
|
105
|
-
return safeFindDOMNode(_this.
|
|
105
|
+
return safeFindDOMNode(_this.spinnerRef);
|
|
106
106
|
});
|
|
107
107
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasTargetNode", function (nextProps) {
|
|
108
108
|
return !!_this.getTargetNode(nextProps);
|
|
@@ -242,8 +242,8 @@ var LoadingContainerAdvanced = /*#__PURE__*/function (_React$Component) {
|
|
|
242
242
|
_this2.children = el;
|
|
243
243
|
}
|
|
244
244
|
}), isLoading && /*#__PURE__*/_react.default.createElement(_LoadingContainerAdvanced.SpinnerBackdrop, null, /*#__PURE__*/_react.default.createElement(_LoadingContainerAdvanced.SpinnerContainer, {
|
|
245
|
-
|
|
246
|
-
_this2.
|
|
245
|
+
ref: function ref(el) {
|
|
246
|
+
return _this2.spinnerRef = el;
|
|
247
247
|
}
|
|
248
248
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
249
249
|
size: spinnerSize,
|
|
@@ -29,7 +29,7 @@ var _Stateless = _interopRequireDefault(require("./Stateless"));
|
|
|
29
29
|
|
|
30
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
32
|
+
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; } }
|
|
33
33
|
|
|
34
34
|
var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
35
35
|
(0, _inherits2.default)(DynamicTable, _React$Component);
|
|
@@ -146,7 +146,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
146
146
|
paginationi18n = _this$props.paginationi18n,
|
|
147
147
|
onRankStart = _this$props.onRankStart,
|
|
148
148
|
onPageRowsUpdate = _this$props.onPageRowsUpdate,
|
|
149
|
-
testId = _this$props.testId
|
|
149
|
+
testId = _this$props.testId,
|
|
150
|
+
label = _this$props.label;
|
|
150
151
|
return /*#__PURE__*/_react.default.createElement(_Stateless.default, {
|
|
151
152
|
paginationi18n: paginationi18n,
|
|
152
153
|
caption: caption,
|
|
@@ -168,7 +169,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
168
169
|
onRankEnd: this.onRankEnd,
|
|
169
170
|
onRankStart: onRankStart,
|
|
170
171
|
onPageRowsUpdate: onPageRowsUpdate,
|
|
171
|
-
testId: testId
|
|
172
|
+
testId: testId,
|
|
173
|
+
label: label
|
|
172
174
|
});
|
|
173
175
|
}
|
|
174
176
|
}]);
|
|
@@ -49,10 +49,10 @@ var _TableHead = _interopRequireDefault(require("./TableHead"));
|
|
|
49
49
|
|
|
50
50
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
51
|
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
52
|
+
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; } }
|
|
53
53
|
|
|
54
54
|
var packageName = "@atlaskit/dynamic-table";
|
|
55
|
-
var packageVersion = "14.
|
|
55
|
+
var packageVersion = "14.4.0";
|
|
56
56
|
|
|
57
57
|
function toggleSortOrder(currentSortOrder) {
|
|
58
58
|
switch (currentSortOrder) {
|
|
@@ -208,7 +208,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
208
208
|
paginationi18n = _this$props4.paginationi18n,
|
|
209
209
|
onPageRowsUpdate = _this$props4.onPageRowsUpdate,
|
|
210
210
|
testId = _this$props4.testId,
|
|
211
|
-
passedDownTotalRows = _this$props4.totalRows
|
|
211
|
+
passedDownTotalRows = _this$props4.totalRows,
|
|
212
|
+
label = _this$props4.label;
|
|
212
213
|
var rowsLength = rows && rows.length;
|
|
213
214
|
var totalPages; // set a flag to denote the dynamic table might get only one page of data
|
|
214
215
|
// for paginated data
|
|
@@ -257,7 +258,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
257
258
|
testId: testId
|
|
258
259
|
}, /*#__PURE__*/_react.default.createElement(_DynamicTable.Table, {
|
|
259
260
|
isFixedSize: isFixedSize,
|
|
260
|
-
"data-testid": testId && "".concat(testId, "--table")
|
|
261
|
+
"data-testid": testId && "".concat(testId, "--table"),
|
|
262
|
+
"aria-label": label
|
|
261
263
|
}, !!caption && /*#__PURE__*/_react.default.createElement(_DynamicTable.Caption, null, caption), head && /*#__PURE__*/_react.default.createElement(_TableHead.default, {
|
|
262
264
|
head: head,
|
|
263
265
|
onSort: this.onSort,
|
|
@@ -37,7 +37,7 @@ var _TableHeadCell2 = _interopRequireDefault(require("./TableHeadCell"));
|
|
|
37
37
|
|
|
38
38
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
39
|
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
40
|
+
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; } }
|
|
41
41
|
|
|
42
42
|
var TableHead = /*#__PURE__*/function (_React$Component) {
|
|
43
43
|
(0, _inherits2.default)(TableHead, _React$Component);
|
|
@@ -11,58 +11,28 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
14
|
var _react = _interopRequireDefault(require("react"));
|
|
27
15
|
|
|
28
16
|
var _TableHead = require("../styled/TableHead");
|
|
29
17
|
|
|
30
|
-
|
|
18
|
+
var TableHeadCell = function TableHeadCell(_ref) {
|
|
19
|
+
var content = _ref.content,
|
|
20
|
+
inlineStyles = _ref.inlineStyles,
|
|
21
|
+
testId = _ref.testId,
|
|
22
|
+
isRanking = _ref.isRanking,
|
|
23
|
+
innerRef = _ref.innerRef,
|
|
24
|
+
isSortable = _ref.isSortable,
|
|
25
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"]);
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_TableHead.HeadCell, (0, _extends2.default)({
|
|
27
|
+
style: inlineStyles,
|
|
28
|
+
"data-testid": testId && "".concat(testId, "--head--cell"),
|
|
29
|
+
ref: typeof innerRef !== 'string' ? innerRef : null // string refs must be discarded as LegacyRefs are not compatible with FC forwardRefs
|
|
30
|
+
|
|
31
|
+
}, rest, {
|
|
32
|
+
tabIndex: isSortable ? 0 : undefined,
|
|
33
|
+
isSortable: isSortable
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, content));
|
|
35
|
+
};
|
|
31
36
|
|
|
32
|
-
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; } }
|
|
33
|
-
|
|
34
|
-
var TableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
35
|
-
(0, _inherits2.default)(TableHeadCell, _React$Component);
|
|
36
|
-
|
|
37
|
-
var _super = _createSuper(TableHeadCell);
|
|
38
|
-
|
|
39
|
-
function TableHeadCell() {
|
|
40
|
-
(0, _classCallCheck2.default)(this, TableHeadCell);
|
|
41
|
-
return _super.apply(this, arguments);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
(0, _createClass2.default)(TableHeadCell, [{
|
|
45
|
-
key: "render",
|
|
46
|
-
value: function render() {
|
|
47
|
-
var _this$props = this.props,
|
|
48
|
-
content = _this$props.content,
|
|
49
|
-
inlineStyles = _this$props.inlineStyles,
|
|
50
|
-
testId = _this$props.testId,
|
|
51
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props, ["content", "inlineStyles", "testId"]);
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_TableHead.HeadCell, (0, _extends2.default)({
|
|
53
|
-
style: inlineStyles,
|
|
54
|
-
"data-testid": testId && "".concat(testId, "--head--cell")
|
|
55
|
-
}, rest, {
|
|
56
|
-
tabIndex: rest.isSortable ? 0 : undefined
|
|
57
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, content));
|
|
58
|
-
}
|
|
59
|
-
}]);
|
|
60
|
-
return TableHeadCell;
|
|
61
|
-
}(_react.default.Component);
|
|
62
|
-
|
|
63
|
-
(0, _defineProperty2.default)(TableHeadCell, "defaultProps", {
|
|
64
|
-
innerRef: function innerRef() {},
|
|
65
|
-
inlineStyles: {}
|
|
66
|
-
});
|
|
67
37
|
var _default = TableHeadCell;
|
|
68
38
|
exports.default = _default;
|
|
@@ -26,7 +26,10 @@ var Row = function Row(_ref) {
|
|
|
26
26
|
var cells = row.cells,
|
|
27
27
|
restRowProps = (0, _objectWithoutProperties2.default)(row, ["cells"]);
|
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_TableRow.TableBodyRow, (0, _extends2.default)({}, restRowProps, {
|
|
29
|
-
isHighlighted: isHighlighted
|
|
29
|
+
isHighlighted: isHighlighted
|
|
30
|
+
}, isHighlighted ? {
|
|
31
|
+
'data-ts--dynamic-table--table-row--highlighted': true
|
|
32
|
+
} : null, {
|
|
30
33
|
"data-testid": testId && "".concat(testId, "--row-").concat(restRowProps.key)
|
|
31
34
|
}), cells.map(function (cell, cellIndex) {
|
|
32
35
|
var content = cell.content,
|
|
@@ -29,7 +29,7 @@ var _pagination = _interopRequireDefault(require("@atlaskit/pagination"));
|
|
|
29
29
|
|
|
30
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
31
31
|
|
|
32
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
32
|
+
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; } }
|
|
33
33
|
|
|
34
34
|
var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
35
35
|
(0, _inherits2.default)(ManagedPagination, _React$Component);
|
|
@@ -33,7 +33,7 @@ var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
|
33
33
|
|
|
34
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
35
|
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
36
|
+
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; } }
|
|
37
37
|
|
|
38
38
|
// computes destination of ranking
|
|
39
39
|
// - if drag was cancelled returns undefined
|
|
@@ -130,7 +130,7 @@ var RankableBody = /*#__PURE__*/function (_React$Component) {
|
|
|
130
130
|
rowIndex: rowIndex,
|
|
131
131
|
row: row,
|
|
132
132
|
isRankingDisabled: isRankingDisabled,
|
|
133
|
-
isHighlighted: highlightedRowIndex === rowIndex
|
|
133
|
+
isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1)
|
|
134
134
|
});
|
|
135
135
|
}), provided.placeholder);
|
|
136
136
|
}));
|
|
@@ -31,7 +31,7 @@ var _TableCell = require("../../styled/rankable/TableCell");
|
|
|
31
31
|
|
|
32
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
33
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
34
|
+
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; } }
|
|
35
35
|
|
|
36
36
|
var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
37
37
|
(0, _inherits2.default)(RankableTableCell, _React$Component);
|
|
@@ -51,8 +51,8 @@ var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
51
51
|
head = _this$props.head,
|
|
52
52
|
isFixedSize = _this$props.isFixedSize,
|
|
53
53
|
isRanking = _this$props.isRanking,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
refWidth = _this$props.refWidth,
|
|
55
|
+
innerRef = _this$props.innerRef;
|
|
56
56
|
var content = cell.content,
|
|
57
57
|
restCellProps = (0, _objectWithoutProperties2.default)(cell, ["content"]);
|
|
58
58
|
|
|
@@ -67,10 +67,10 @@ var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
67
67
|
width: width,
|
|
68
68
|
isRanking: isRanking,
|
|
69
69
|
style: inlineStyles,
|
|
70
|
-
innerRef: innerRef,
|
|
71
70
|
onKeyDown: function onKeyDown(e) {
|
|
72
71
|
return e.stopPropagation();
|
|
73
|
-
}
|
|
72
|
+
},
|
|
73
|
+
innerRef: innerRef
|
|
74
74
|
}), content);
|
|
75
75
|
}
|
|
76
76
|
}]);
|
|
@@ -31,7 +31,7 @@ var _TableHeadCell = _interopRequireDefault(require("../TableHeadCell"));
|
|
|
31
31
|
|
|
32
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
33
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
34
|
+
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; } }
|
|
35
35
|
|
|
36
36
|
var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
37
37
|
(0, _inherits2.default)(RankableTableHeadCell, _React$Component);
|
|
@@ -50,12 +50,10 @@ var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
|
50
50
|
isRanking = _this$props.isRanking,
|
|
51
51
|
refHeight = _this$props.refHeight,
|
|
52
52
|
refWidth = _this$props.refWidth,
|
|
53
|
-
|
|
54
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$props, ["isRanking", "refHeight", "refWidth", "innerRef"]);
|
|
53
|
+
restProps = (0, _objectWithoutProperties2.default)(_this$props, ["isRanking", "refHeight", "refWidth"]);
|
|
55
54
|
var inlineStyles = (0, _helpers.inlineStylesIfRanking)(isRanking, refWidth);
|
|
56
55
|
return /*#__PURE__*/_react.default.createElement(_TableHeadCell.default, (0, _extends2.default)({
|
|
57
|
-
inlineStyles: inlineStyles
|
|
58
|
-
innerRef: innerRef
|
|
56
|
+
inlineStyles: inlineStyles
|
|
59
57
|
}, restProps));
|
|
60
58
|
}
|
|
61
59
|
}]);
|
|
@@ -37,13 +37,13 @@ var _TableRow = require("../../styled/rankable/TableRow");
|
|
|
37
37
|
|
|
38
38
|
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
39
39
|
|
|
40
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
41
41
|
|
|
42
42
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
43
43
|
|
|
44
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
45
45
|
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
46
|
+
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; } }
|
|
47
47
|
|
|
48
48
|
var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
49
49
|
(0, _inherits2.default)(RankableTableRow, _React$Component);
|
|
@@ -64,7 +64,7 @@ var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
64
64
|
return function (ref) {
|
|
65
65
|
innerRefFn(ref);
|
|
66
66
|
|
|
67
|
-
if (_this.props.innerRef) {
|
|
67
|
+
if (typeof _this.props.innerRef === 'function') {
|
|
68
68
|
_this.props.innerRef(ref);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -97,12 +97,12 @@ var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
return /*#__PURE__*/_react.default.createElement(_reactBeautifulDnd.Draggable, {
|
|
100
|
-
draggableId: key ||
|
|
100
|
+
draggableId: key || rowIndex.toString(),
|
|
101
101
|
index: rowIndex,
|
|
102
102
|
isDragDisabled: isRankingDisabled
|
|
103
103
|
}, function (provided, snapshot) {
|
|
104
104
|
return /*#__PURE__*/_react.default.createElement(_TableRow.RankableTableBodyRow, (0, _extends2.default)({}, restRowProps, provided.dragHandleProps, provided.draggableProps, {
|
|
105
|
-
|
|
105
|
+
ref: _this2.innerRef(provided.innerRef),
|
|
106
106
|
style: _objectSpread(_objectSpread({}, provided.draggableProps.style), inlineStyles),
|
|
107
107
|
isHighlighted: isHighlighted,
|
|
108
108
|
isRanking: isRanking,
|
|
@@ -27,13 +27,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
27
27
|
|
|
28
28
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
29
|
|
|
30
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
30
|
+
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; } }
|
|
31
31
|
|
|
32
32
|
// Compute height and width of wrapped component before ranking
|
|
33
33
|
function withDimensions(WrappedComponent) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return _temp = /*#__PURE__*/function (_React$Component) {
|
|
34
|
+
return /*#__PURE__*/function (_React$Component) {
|
|
37
35
|
(0, _inherits2.default)(WithDimensions, _React$Component);
|
|
38
36
|
|
|
39
37
|
var _super = _createSuper(WithDimensions);
|
|
@@ -103,5 +101,5 @@ function withDimensions(WrappedComponent) {
|
|
|
103
101
|
}
|
|
104
102
|
}]);
|
|
105
103
|
return WithDimensions;
|
|
106
|
-
}(_react.default.Component)
|
|
104
|
+
}(_react.default.Component);
|
|
107
105
|
}
|
|
@@ -33,13 +33,13 @@ var _constants = require("../internal/constants");
|
|
|
33
33
|
|
|
34
34
|
var _helpers = require("../internal/helpers");
|
|
35
35
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
37
37
|
|
|
38
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
39
39
|
|
|
40
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
41
41
|
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
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; } }
|
|
43
43
|
|
|
44
44
|
// sort all rows based on sort key and order
|
|
45
45
|
var getSortedRows = function getSortedRows(head, rows, sortKey, sortOrder) {
|
|
@@ -122,9 +122,7 @@ var getSortedRows = function getSortedRows(head, rows, sortKey, sortOrder) {
|
|
|
122
122
|
|
|
123
123
|
// get one page of data in table, sorting all rows previously
|
|
124
124
|
function withSortedPageRows(WrappedComponent) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return _temp = /*#__PURE__*/function (_React$Component) {
|
|
125
|
+
return /*#__PURE__*/function (_React$Component) {
|
|
128
126
|
(0, _inherits2.default)(WithSortedPageRows, _React$Component);
|
|
129
127
|
|
|
130
128
|
var _super = _createSuper(WithSortedPageRows);
|
|
@@ -202,5 +200,5 @@ function withSortedPageRows(WrappedComponent) {
|
|
|
202
200
|
}
|
|
203
201
|
}]);
|
|
204
202
|
return WithSortedPageRows;
|
|
205
|
-
}(_react.default.Component)
|
|
203
|
+
}(_react.default.Component);
|
|
206
204
|
}
|
|
@@ -1,73 +1,103 @@
|
|
|
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", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports.PaginationWrapper = exports.Caption = exports.Table = void 0;
|
|
11
|
-
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
17
|
-
|
|
18
|
-
var _math = require("@atlaskit/theme/math");
|
|
19
|
-
|
|
20
|
-
function _templateObject4() {
|
|
21
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n"]);
|
|
22
|
-
|
|
23
|
-
_templateObject4 = function _templateObject4() {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
8
|
+
exports.PaginationWrapper = exports.Caption = exports.Table = exports.tableRowCSSVars = void 0;
|
|
29
9
|
|
|
30
|
-
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n font-size: 1.42857143em;\n /* there is a bug in Safari: if element which creates a new stacking context\n is a child of a table, table caption re-renders in bad wrong position\n https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom\n */\n will-change: transform;\n font-style: inherit;\n font-weight: 500;\n letter-spacing: -0.008em;\n line-height: 1.2;\n margin-bottom: ", "px;\n margin-top: ", "px;\n text-align: left;\n"]);
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
32
11
|
|
|
33
|
-
|
|
34
|
-
return data;
|
|
35
|
-
};
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
36
13
|
|
|
37
|
-
|
|
38
|
-
}
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
39
15
|
|
|
40
|
-
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n table-layout: fixed;\n "]);
|
|
16
|
+
var _react = require("react");
|
|
42
17
|
|
|
43
|
-
|
|
44
|
-
return data;
|
|
45
|
-
};
|
|
18
|
+
var _core = require("@emotion/core");
|
|
46
19
|
|
|
47
|
-
|
|
48
|
-
}
|
|
20
|
+
var _components = require("@atlaskit/theme/components");
|
|
49
21
|
|
|
50
|
-
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n border-collapse: collapse;\n width: 100%;\n"]);
|
|
52
|
-
|
|
53
|
-
_templateObject = function _templateObject() {
|
|
54
|
-
return data;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
22
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
59
23
|
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
24
|
+
var _theme = require("../theme");
|
|
25
|
+
|
|
26
|
+
/** @jsx jsx */
|
|
27
|
+
var gridSize = (0, _constants.gridSize)();
|
|
28
|
+
// CSS vars for table row
|
|
29
|
+
// these are declared here to avoid being re-declared in each table row
|
|
30
|
+
var tableRowCSSVars = {
|
|
31
|
+
CSS_VAR_HOVER_BACKGROUND: '--local-dynamic-table-hover-bg',
|
|
32
|
+
CSS_VAR_HIGHLIGHTED_BACKGROUND: '--local-dynamic-table-highlighted-bg',
|
|
33
|
+
CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND: '--local-dynamic-table-hover-highlighted-bg',
|
|
34
|
+
CSS_VAR_ROW_FOCUS_OUTLINE: '--local-dynamic-table-row-focus-outline'
|
|
35
|
+
};
|
|
36
|
+
exports.tableRowCSSVars = tableRowCSSVars;
|
|
37
|
+
var fixedSizeTableStyles = (0, _core.css)({
|
|
38
|
+
tableLayout: 'fixed'
|
|
39
|
+
});
|
|
40
|
+
var tableStyles = (0, _core.css)({
|
|
41
|
+
borderCollapse: 'collapse',
|
|
42
|
+
width: '100%'
|
|
43
|
+
});
|
|
44
|
+
var Table = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
45
|
+
var _ref2;
|
|
46
|
+
|
|
47
|
+
var isFixedSize = _ref.isFixedSize,
|
|
48
|
+
children = _ref.children,
|
|
49
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, ["isFixedSize", "children"]);
|
|
50
|
+
var theme = (0, _components.useGlobalTheme)();
|
|
51
|
+
return (0, _core.jsx)("table", (0, _extends2.default)({
|
|
52
|
+
style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, _theme.row.hoverBackground({
|
|
53
|
+
theme: theme
|
|
54
|
+
})), (0, _defineProperty2.default)(_ref2, tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, _theme.row.highlightedBackground({
|
|
55
|
+
theme: theme
|
|
56
|
+
})), (0, _defineProperty2.default)(_ref2, tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, _theme.row.hoverHighlightedBackground({
|
|
57
|
+
theme: theme
|
|
58
|
+
})), (0, _defineProperty2.default)(_ref2, tableRowCSSVars.CSS_VAR_ROW_FOCUS_OUTLINE, _theme.row.focusOutline({
|
|
59
|
+
theme: theme
|
|
60
|
+
})), _ref2),
|
|
61
|
+
css: [tableStyles, isFixedSize && fixedSizeTableStyles],
|
|
62
|
+
ref: ref
|
|
63
|
+
}, rest), children);
|
|
63
64
|
});
|
|
64
|
-
|
|
65
65
|
exports.Table = Table;
|
|
66
|
+
var captionStyles = (0, _core.css)({
|
|
67
|
+
fontSize: '1.42857143em',
|
|
68
|
+
|
|
69
|
+
/* there is a bug in Safari: if element which creates a new stacking context
|
|
70
|
+
is a child of a table, table caption re-renders in bad wrong position
|
|
71
|
+
https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom
|
|
72
|
+
*/
|
|
73
|
+
willChange: 'transform',
|
|
74
|
+
fontStyle: 'inherit',
|
|
75
|
+
fontWeight: 500,
|
|
76
|
+
letterSpacing: '-0.008em',
|
|
77
|
+
lineHeight: 1.2,
|
|
78
|
+
marginBottom: "".concat(gridSize, "px"),
|
|
79
|
+
marginTop: "".concat(gridSize * 3.5, "px"),
|
|
80
|
+
textAlign: 'left'
|
|
81
|
+
});
|
|
66
82
|
|
|
67
|
-
var Caption =
|
|
83
|
+
var Caption = function Caption(_ref3) {
|
|
84
|
+
var children = _ref3.children;
|
|
85
|
+
return (0, _core.jsx)("caption", {
|
|
86
|
+
css: captionStyles
|
|
87
|
+
}, children);
|
|
88
|
+
};
|
|
68
89
|
|
|
69
90
|
exports.Caption = Caption;
|
|
91
|
+
var paginationWrapperStyles = (0, _core.css)({
|
|
92
|
+
display: 'flex',
|
|
93
|
+
justifyContent: 'center'
|
|
94
|
+
});
|
|
70
95
|
|
|
71
|
-
var PaginationWrapper =
|
|
96
|
+
var PaginationWrapper = function PaginationWrapper(_ref4) {
|
|
97
|
+
var children = _ref4.children;
|
|
98
|
+
return (0, _core.jsx)("div", {
|
|
99
|
+
css: paginationWrapperStyles
|
|
100
|
+
}, children);
|
|
101
|
+
};
|
|
72
102
|
|
|
73
103
|
exports.PaginationWrapper = PaginationWrapper;
|