@atlaskit/dynamic-table 14.3.2 → 14.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +2 -2
- package/dist/cjs/components/LoadingContainerAdvanced.js +3 -3
- package/dist/cjs/components/Stateful.js +26 -0
- package/dist/cjs/components/Stateless.js +2 -2
- package/dist/cjs/components/TableHeadCell.js +18 -48
- package/dist/cjs/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/cjs/components/rankable/TableCell.js +4 -4
- package/dist/cjs/components/rankable/TableHeadCell.js +2 -4
- package/dist/cjs/components/rankable/TableRow.js +3 -3
- package/dist/cjs/internal/constants.js +1 -5
- package/dist/cjs/styled/DynamicTable.js +80 -14
- package/dist/cjs/styled/EmptyBody.js +23 -8
- package/dist/cjs/styled/LoadingContainer.js +41 -8
- package/dist/cjs/styled/LoadingContainerAdvanced.js +42 -8
- package/dist/cjs/styled/TableCell.js +21 -7
- package/dist/cjs/styled/TableHead.js +159 -25
- package/dist/cjs/styled/TableRow.js +35 -19
- package/dist/cjs/styled/constants.js +33 -38
- package/dist/cjs/styled/rankable/RowPlaceholder.js +11 -4
- package/dist/cjs/styled/rankable/TableCell.js +18 -13
- package/dist/cjs/styled/rankable/TableRow.js +31 -21
- package/dist/cjs/theme.js +18 -18
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LoadingContainerAdvanced.js +2 -4
- package/dist/es2019/components/Stateful.js +27 -0
- package/dist/es2019/components/Stateless.js +2 -2
- package/dist/es2019/components/TableHeadCell.js +18 -22
- package/dist/es2019/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/es2019/components/rankable/TableCell.js +4 -4
- package/dist/es2019/components/rankable/TableHeadCell.js +1 -3
- package/dist/es2019/components/rankable/TableRow.js +3 -3
- package/dist/es2019/internal/constants.js +0 -2
- package/dist/es2019/styled/DynamicTable.js +75 -26
- package/dist/es2019/styled/EmptyBody.js +21 -10
- 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 +159 -33
- package/dist/es2019/styled/TableRow.js +33 -20
- package/dist/es2019/styled/constants.js +30 -115
- 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 +31 -24
- package/dist/es2019/theme.js +18 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/LoadingContainerAdvanced.js +3 -3
- package/dist/esm/components/Stateful.js +26 -0
- package/dist/esm/components/Stateless.js +2 -2
- package/dist/esm/components/TableHeadCell.js +19 -47
- package/dist/esm/components/{managedPagination.js → managed-pagination.js} +0 -0
- package/dist/esm/components/rankable/TableCell.js +4 -4
- package/dist/esm/components/rankable/TableHeadCell.js +2 -4
- package/dist/esm/components/rankable/TableRow.js +3 -3
- package/dist/esm/internal/constants.js +0 -2
- package/dist/esm/styled/DynamicTable.js +77 -9
- package/dist/esm/styled/EmptyBody.js +23 -7
- package/dist/esm/styled/LoadingContainer.js +40 -8
- package/dist/esm/styled/LoadingContainerAdvanced.js +41 -7
- package/dist/esm/styled/TableCell.js +21 -7
- package/dist/esm/styled/TableHead.js +159 -21
- package/dist/esm/styled/TableRow.js +35 -12
- package/dist/esm/styled/constants.js +28 -29
- package/dist/esm/styled/rankable/RowPlaceholder.js +11 -5
- package/dist/esm/styled/rankable/TableCell.js +18 -9
- package/dist/esm/styled/rankable/TableRow.js +30 -14
- package/dist/esm/theme.js +18 -18
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Body.d.ts +21 -21
- package/dist/types/components/LoadingContainer.d.ts +3 -3
- package/dist/types/components/LoadingContainerAdvanced.d.ts +3 -3
- package/dist/types/components/Stateful.d.ts +26 -0
- package/dist/types/components/Stateless.d.ts +3 -3
- package/dist/types/components/TableHeadCell.d.ts +4 -9
- package/dist/types/components/{managedPagination.d.ts → managed-pagination.d.ts} +4 -7
- package/dist/types/components/rankable/Body.d.ts +21 -21
- package/dist/types/components/rankable/TableHeadCell.d.ts +1 -1
- package/dist/types/components/rankable/TableRow.d.ts +3 -3
- package/dist/types/hoc/withDimensions.d.ts +2 -2
- package/dist/types/hoc/withSortedPageRows.d.ts +20 -20
- package/dist/types/internal/constants.d.ts +0 -2
- package/dist/types/styled/DynamicTable.d.ts +13 -6
- package/dist/types/styled/EmptyBody.d.ts +4 -3
- package/dist/types/styled/LoadingContainer.d.ts +8 -7
- package/dist/types/styled/LoadingContainerAdvanced.d.ts +5 -4
- package/dist/types/styled/TableCell.d.ts +3 -2
- package/dist/types/styled/TableHead.d.ts +8 -5
- package/dist/types/styled/TableRow.d.ts +7 -4
- package/dist/types/styled/constants.d.ts +13 -10
- package/dist/types/styled/rankable/RowPlaceholder.d.ts +3 -2
- package/dist/types/styled/rankable/TableCell.d.ts +8 -6
- package/dist/types/styled/rankable/TableRow.d.ts +9 -6
- package/dist/types/theme.d.ts +9 -9
- package/dist/types/types.d.ts +76 -37
- package/package.json +18 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 14.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 14.4.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`78a7ffa81f8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/78a7ffa81f8) - Fixes a bug that meant an undefined width would still be stringifed and applied to the inline styles of table cells.
|
|
15
|
+
|
|
16
|
+
## 14.4.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`1601e51ab32`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1601e51ab32) - Fixes for internal types.
|
|
21
|
+
|
|
22
|
+
## 14.4.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- [`dc35866892f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc35866892f) - [ux] Instrumented dynamic-table with the new theming package, @atlaskit/tokens.
|
|
27
|
+
|
|
28
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
29
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
30
|
+
|
|
31
|
+
- [`ca00a7783a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ca00a7783a9) - Removes `styled-components` as a peer dependency in favour of a direct dependency on `emotion`.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies
|
|
36
|
+
|
|
3
37
|
## 14.3.2
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Dynamic
|
|
1
|
+
# Dynamic table
|
|
2
2
|
|
|
3
3
|
Table component with pagination and sorting functionality.
|
|
4
4
|
|
|
@@ -10,4 +10,4 @@ yarn add @atlaskit/dynamic-table
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
Detailed docs and example usage can be found [here](https://
|
|
13
|
+
Detailed docs and example usage can be found [here](https://atlassian.design/components/dynamic-table/usage).
|
|
@@ -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,
|
|
@@ -31,6 +31,32 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
31
31
|
|
|
32
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
|
+
/**
|
|
35
|
+
* __Dynamic Table__
|
|
36
|
+
*
|
|
37
|
+
* A table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
|
|
38
|
+
*
|
|
39
|
+
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
40
|
+
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* import DynamicTable from '@atlaskit/dynamic-table';
|
|
45
|
+
*
|
|
46
|
+
* export default function TableUncontrolled() {
|
|
47
|
+
* return (
|
|
48
|
+
* <DynamicTable
|
|
49
|
+
* head={head}
|
|
50
|
+
* rows={rows}
|
|
51
|
+
* rowsPerPage={10}
|
|
52
|
+
* defaultPage={1}
|
|
53
|
+
* loadingSpinnerSize="large"
|
|
54
|
+
* isLoading={false}
|
|
55
|
+
* />
|
|
56
|
+
* );
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
34
60
|
var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
35
61
|
(0, _inherits2.default)(DynamicTable, _React$Component);
|
|
36
62
|
|
|
@@ -41,7 +41,7 @@ var _LoadingContainer = _interopRequireDefault(require("./LoadingContainer"));
|
|
|
41
41
|
|
|
42
42
|
var _LoadingContainerAdvanced = _interopRequireDefault(require("./LoadingContainerAdvanced"));
|
|
43
43
|
|
|
44
|
-
var _managedPagination = _interopRequireDefault(require("./
|
|
44
|
+
var _managedPagination = _interopRequireDefault(require("./managed-pagination"));
|
|
45
45
|
|
|
46
46
|
var _Body2 = _interopRequireDefault(require("./rankable/Body"));
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
52
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.3
|
|
55
|
+
var packageVersion = "14.4.3";
|
|
56
56
|
|
|
57
57
|
function toggleSortOrder(currentSortOrder) {
|
|
58
58
|
switch (currentSortOrder) {
|
|
@@ -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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], 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;
|
|
File without changes
|
|
@@ -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
|
}]);
|
|
@@ -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
|
}]);
|
|
@@ -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,
|
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LOADING_CONTENTS_OPACITY = exports.
|
|
6
|
+
exports.LOADING_CONTENTS_OPACITY = exports.LARGE = exports.SMALL = exports.DESC = exports.ASC = void 0;
|
|
7
7
|
var ASC = 'ASC';
|
|
8
8
|
exports.ASC = ASC;
|
|
9
9
|
var DESC = 'DESC';
|
|
10
10
|
exports.DESC = DESC;
|
|
11
11
|
var SMALL = 'small';
|
|
12
12
|
exports.SMALL = SMALL;
|
|
13
|
-
var MEDIUM = 'medium';
|
|
14
|
-
exports.MEDIUM = MEDIUM;
|
|
15
13
|
var LARGE = 'large';
|
|
16
14
|
exports.LARGE = LARGE;
|
|
17
|
-
var XLARGE = 'xlarge';
|
|
18
|
-
exports.XLARGE = XLARGE;
|
|
19
15
|
var LOADING_CONTENTS_OPACITY = 0.22;
|
|
20
16
|
exports.LOADING_CONTENTS_OPACITY = LOADING_CONTENTS_OPACITY;
|
|
@@ -2,36 +2,102 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
exports.PaginationWrapper = exports.Caption = exports.Table = void 0;
|
|
8
|
+
exports.PaginationWrapper = exports.Caption = exports.Table = exports.tableRowCSSVars = void 0;
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
11
|
|
|
14
|
-
var
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
13
|
|
|
16
|
-
var
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _react = require("react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _core = require("@emotion/core");
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _components = require("@atlaskit/theme/components");
|
|
21
|
+
|
|
22
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
var _theme = require("../theme");
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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'
|
|
27
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;
|
|
28
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);
|
|
64
|
+
});
|
|
29
65
|
exports.Table = Table;
|
|
66
|
+
var captionStyles = (0, _core.css)({
|
|
67
|
+
fontSize: '1.42857143em',
|
|
30
68
|
|
|
31
|
-
|
|
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
|
+
});
|
|
82
|
+
|
|
83
|
+
var Caption = function Caption(_ref3) {
|
|
84
|
+
var children = _ref3.children;
|
|
85
|
+
return (0, _core.jsx)("caption", {
|
|
86
|
+
css: captionStyles
|
|
87
|
+
}, children);
|
|
88
|
+
};
|
|
32
89
|
|
|
33
90
|
exports.Caption = Caption;
|
|
91
|
+
var paginationWrapperStyles = (0, _core.css)({
|
|
92
|
+
display: 'flex',
|
|
93
|
+
justifyContent: 'center'
|
|
94
|
+
});
|
|
34
95
|
|
|
35
|
-
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
|
+
};
|
|
36
102
|
|
|
37
103
|
exports.PaginationWrapper = PaginationWrapper;
|
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.EmptyViewContainer = exports.EmptyViewWithFixedHeight = void 0;
|
|
9
7
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _core = require("@emotion/core");
|
|
13
9
|
|
|
14
10
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
var fixedHeightStyles = (0, _core.css)({
|
|
14
|
+
height: "".concat((0, _constants.gridSize)() * 18, "px")
|
|
15
|
+
});
|
|
17
16
|
|
|
18
|
-
var EmptyViewWithFixedHeight =
|
|
17
|
+
var EmptyViewWithFixedHeight = function EmptyViewWithFixedHeight(_ref) {
|
|
18
|
+
var children = _ref.children;
|
|
19
|
+
return (0, _core.jsx)("div", {
|
|
20
|
+
css: fixedHeightStyles
|
|
21
|
+
}, children);
|
|
22
|
+
};
|
|
19
23
|
|
|
20
24
|
exports.EmptyViewWithFixedHeight = EmptyViewWithFixedHeight;
|
|
25
|
+
var emptyViewContainerStyles = (0, _core.css)({
|
|
26
|
+
margin: 'auto',
|
|
27
|
+
padding: '10px',
|
|
28
|
+
textAlign: 'center',
|
|
29
|
+
width: '50%'
|
|
30
|
+
});
|
|
21
31
|
|
|
22
|
-
var EmptyViewContainer =
|
|
32
|
+
var EmptyViewContainer = function EmptyViewContainer(_ref2) {
|
|
33
|
+
var children = _ref2.children;
|
|
34
|
+
return (0, _core.jsx)("div", {
|
|
35
|
+
css: emptyViewContainerStyles
|
|
36
|
+
}, children);
|
|
37
|
+
};
|
|
23
38
|
|
|
24
39
|
exports.EmptyViewContainer = EmptyViewContainer;
|
|
@@ -7,22 +7,55 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.SpinnerContainer = exports.ContentsContainer = exports.Container = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _core = require("@emotion/core");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
var CSS_VAR_CONTENTS_OPACITY = '--contents-opacity';
|
|
16
|
+
var containerStyles = (0, _core.css)({
|
|
17
|
+
position: 'relative'
|
|
18
|
+
});
|
|
15
19
|
|
|
16
|
-
var Container =
|
|
20
|
+
var Container = function Container(_ref) {
|
|
21
|
+
var children = _ref.children;
|
|
22
|
+
return (0, _core.jsx)("div", {
|
|
23
|
+
css: containerStyles
|
|
24
|
+
}, children);
|
|
25
|
+
};
|
|
17
26
|
|
|
18
27
|
exports.Container = Container;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
var contentsContainerStyles = (0, _core.css)({
|
|
29
|
+
pointerEvents: 'none',
|
|
30
|
+
opacity: "var(".concat(CSS_VAR_CONTENTS_OPACITY, ")")
|
|
22
31
|
});
|
|
23
32
|
|
|
33
|
+
var ContentsContainer = function ContentsContainer(_ref2) {
|
|
34
|
+
var contentsOpacity = _ref2.contentsOpacity,
|
|
35
|
+
children = _ref2.children;
|
|
36
|
+
return (0, _core.jsx)("div", {
|
|
37
|
+
style: (0, _defineProperty2.default)({}, CSS_VAR_CONTENTS_OPACITY, contentsOpacity),
|
|
38
|
+
css: [contentsContainerStyles]
|
|
39
|
+
}, children);
|
|
40
|
+
};
|
|
41
|
+
|
|
24
42
|
exports.ContentsContainer = ContentsContainer;
|
|
43
|
+
var spinnerContainerStyles = (0, _core.css)({
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
top: 0,
|
|
46
|
+
right: 0,
|
|
47
|
+
bottom: 0,
|
|
48
|
+
left: 0,
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
justifyContent: 'center'
|
|
52
|
+
});
|
|
25
53
|
|
|
26
|
-
var SpinnerContainer =
|
|
54
|
+
var SpinnerContainer = function SpinnerContainer(_ref4) {
|
|
55
|
+
var children = _ref4.children;
|
|
56
|
+
return (0, _core.jsx)("div", {
|
|
57
|
+
css: spinnerContainerStyles
|
|
58
|
+
}, children);
|
|
59
|
+
};
|
|
27
60
|
|
|
28
61
|
exports.SpinnerContainer = SpinnerContainer;
|
|
@@ -7,22 +7,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.SpinnerContainer = exports.SpinnerBackdrop = exports.Container = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
|
|
14
|
+
var _core = require("@emotion/core");
|
|
13
15
|
|
|
14
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var containerStyles = (0, _core.css)({
|
|
20
|
+
marginBottom: "".concat((0, _constants.gridSize)() * 3, "px"),
|
|
21
|
+
position: 'relative'
|
|
22
|
+
});
|
|
17
23
|
|
|
18
|
-
var Container =
|
|
24
|
+
var Container = function Container(props) {
|
|
25
|
+
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
26
|
+
css: containerStyles
|
|
27
|
+
}, props));
|
|
28
|
+
};
|
|
19
29
|
|
|
20
30
|
exports.Container = Container;
|
|
31
|
+
var spinnerBackdropStyles = (0, _core.css)({
|
|
32
|
+
pointerEvents: 'none',
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
top: 0,
|
|
35
|
+
right: 0,
|
|
36
|
+
bottom: 0,
|
|
37
|
+
left: 0,
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center'
|
|
41
|
+
});
|
|
21
42
|
|
|
22
|
-
var SpinnerBackdrop =
|
|
43
|
+
var SpinnerBackdrop = function SpinnerBackdrop(_ref) {
|
|
44
|
+
var children = _ref.children;
|
|
45
|
+
return (0, _core.jsx)("div", {
|
|
46
|
+
css: spinnerBackdropStyles
|
|
47
|
+
}, children);
|
|
48
|
+
};
|
|
23
49
|
|
|
24
50
|
exports.SpinnerBackdrop = SpinnerBackdrop;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
51
|
+
var spinnerContainerStyles = (0, _core.css)({
|
|
52
|
+
position: 'relative',
|
|
53
|
+
top: 0
|
|
54
|
+
});
|
|
55
|
+
var SpinnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
56
|
+
var children = _ref2.children;
|
|
57
|
+
return (0, _core.jsx)("div", {
|
|
58
|
+
css: spinnerContainerStyles,
|
|
59
|
+
ref: ref
|
|
60
|
+
}, children);
|
|
61
|
+
});
|
|
28
62
|
exports.SpinnerContainer = SpinnerContainer;
|
|
@@ -7,16 +7,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.TableBodyCell = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _core = require("@emotion/core");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _constants = require("./constants");
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
/** @jsx jsx */
|
|
19
|
+
var TableBodyCell = function TableBodyCell(_ref) {
|
|
20
|
+
var width = _ref.width,
|
|
21
|
+
isFixedSize = _ref.isFixedSize,
|
|
22
|
+
shouldTruncate = _ref.shouldTruncate,
|
|
23
|
+
innerRef = _ref.innerRef,
|
|
24
|
+
props = (0, _objectWithoutProperties2.default)(_ref, ["width", "isFixedSize", "shouldTruncate", "innerRef"]);
|
|
25
|
+
return (0, _core.jsx)("td", (0, _extends2.default)({
|
|
26
|
+
style: (0, _constants.getTruncationStyleVars)({
|
|
27
|
+
width: width
|
|
28
|
+
}),
|
|
29
|
+
css: [_constants.truncationWidthStyles, isFixedSize && shouldTruncate && _constants.fixedSizeTruncateStyles, isFixedSize && _constants.overflowTruncateStyles, _constants.cellStyles] // HOC withDimensions complains about the types but it is working fine
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
,
|
|
32
|
+
ref: innerRef
|
|
33
|
+
}, props));
|
|
34
|
+
};
|
|
21
35
|
|
|
22
36
|
exports.TableBodyCell = TableBodyCell;
|