@atlaskit/dynamic-table 14.4.3 → 14.5.1
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 +23 -0
- package/dist/cjs/components/Body.js +1 -1
- package/dist/cjs/components/Stateless.js +1 -1
- package/dist/cjs/components/TableHead.js +5 -2
- package/dist/cjs/components/TableHeadCell.js +3 -1
- package/dist/cjs/components/TableRow.js +5 -2
- package/dist/cjs/components/rankable/TableCell.js +3 -1
- package/dist/cjs/components/rankable/TableHeadCell.js +3 -1
- package/dist/cjs/components/rankable/TableRow.js +5 -3
- package/dist/cjs/hoc/withSortedPageRows.js +5 -3
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/internal/constants.js +1 -1
- package/dist/cjs/internal/helpers.js +1 -1
- package/dist/cjs/styled/DynamicTable.js +3 -3
- package/dist/cjs/styled/EmptyBody.js +1 -1
- package/dist/cjs/styled/TableCell.js +3 -2
- package/dist/cjs/styled/TableHead.js +12 -9
- package/dist/cjs/styled/TableRow.js +6 -6
- package/dist/cjs/styled/constants.js +1 -1
- package/dist/cjs/styled/rankable/TableCell.js +2 -2
- package/dist/cjs/styled/rankable/TableRow.js +5 -5
- package/dist/cjs/theme.js +19 -19
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Body.js +1 -1
- package/dist/es2019/components/Stateless.js +1 -1
- package/dist/es2019/styled/TableHead.js +4 -4
- package/dist/es2019/styled/TableRow.js +4 -4
- package/dist/es2019/styled/rankable/TableRow.js +3 -3
- package/dist/es2019/theme.js +18 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Body.js +1 -1
- package/dist/esm/components/Stateless.js +1 -1
- package/dist/esm/components/TableHead.js +4 -2
- package/dist/esm/components/TableHeadCell.js +2 -1
- package/dist/esm/components/TableRow.js +4 -2
- package/dist/esm/components/rankable/TableCell.js +2 -1
- package/dist/esm/components/rankable/TableHeadCell.js +2 -1
- package/dist/esm/components/rankable/TableRow.js +4 -3
- package/dist/esm/hoc/withSortedPageRows.js +4 -3
- package/dist/esm/styled/DynamicTable.js +2 -1
- package/dist/esm/styled/TableCell.js +2 -1
- package/dist/esm/styled/TableHead.js +10 -8
- package/dist/esm/styled/TableRow.js +6 -5
- package/dist/esm/styled/rankable/TableCell.js +2 -1
- package/dist/esm/styled/rankable/TableRow.js +5 -4
- package/dist/esm/theme.js +18 -18
- package/dist/esm/version.json +1 -1
- package/dist/types/components/TableRow.d.ts +1 -0
- package/dist/types/styled/TableHead.d.ts +1 -1
- package/dist/types/styled/constants.d.ts +4 -4
- package/dist/types/theme.d.ts +9 -9
- package/dist/types/types.d.ts +4 -0
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 14.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 14.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Rows can now also be highlighted using the isHighlighted property inside the rows data
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates usage of deprecated token names so they're aligned with the latest naming conventions. No UI or visual changes
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## 14.4.4
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 14.4.3
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -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 && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
57
|
+
isHighlighted: row.isHighlighted || !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
58
58
|
testId: testId
|
|
59
59
|
});
|
|
60
60
|
}));
|
|
@@ -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.
|
|
55
|
+
var packageVersion = "14.5.1";
|
|
56
56
|
|
|
57
57
|
function toggleSortOrder(currentSortOrder) {
|
|
58
58
|
switch (currentSortOrder) {
|
|
@@ -35,6 +35,9 @@ var _TableHeadCell = _interopRequireDefault(require("./rankable/TableHeadCell"))
|
|
|
35
35
|
|
|
36
36
|
var _TableHeadCell2 = _interopRequireDefault(require("./TableHeadCell"));
|
|
37
37
|
|
|
38
|
+
var _excluded = ["cells"],
|
|
39
|
+
_excluded2 = ["isSortable", "key"];
|
|
40
|
+
|
|
38
41
|
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
42
|
|
|
40
43
|
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; } }
|
|
@@ -93,14 +96,14 @@ var TableHead = /*#__PURE__*/function (_React$Component) {
|
|
|
93
96
|
|
|
94
97
|
var HeadCellComponent = isRankable ? _TableHeadCell.default : _TableHeadCell2.default;
|
|
95
98
|
var cells = head.cells,
|
|
96
|
-
rest = (0, _objectWithoutProperties2.default)(head,
|
|
99
|
+
rest = (0, _objectWithoutProperties2.default)(head, _excluded);
|
|
97
100
|
return /*#__PURE__*/_react.default.createElement(_TableHead.Head, (0, _extends2.default)({}, rest, {
|
|
98
101
|
isRanking: isRanking,
|
|
99
102
|
"data-testid": testId && "".concat(testId, "--head")
|
|
100
103
|
}), /*#__PURE__*/_react.default.createElement("tr", null, cells.map(function (cell, index) {
|
|
101
104
|
var isSortable = cell.isSortable,
|
|
102
105
|
key = cell.key,
|
|
103
|
-
restCellProps = (0, _objectWithoutProperties2.default)(cell,
|
|
106
|
+
restCellProps = (0, _objectWithoutProperties2.default)(cell, _excluded2);
|
|
104
107
|
return /*#__PURE__*/_react.default.createElement(HeadCellComponent, (0, _extends2.default)({
|
|
105
108
|
isFixedSize: isFixedSize,
|
|
106
109
|
isSortable: !!isSortable,
|
|
@@ -15,6 +15,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _TableHead = require("../styled/TableHead");
|
|
17
17
|
|
|
18
|
+
var _excluded = ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"];
|
|
19
|
+
|
|
18
20
|
var TableHeadCell = function TableHeadCell(_ref) {
|
|
19
21
|
var content = _ref.content,
|
|
20
22
|
inlineStyles = _ref.inlineStyles,
|
|
@@ -22,7 +24,7 @@ var TableHeadCell = function TableHeadCell(_ref) {
|
|
|
22
24
|
isRanking = _ref.isRanking,
|
|
23
25
|
innerRef = _ref.innerRef,
|
|
24
26
|
isSortable = _ref.isSortable,
|
|
25
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
27
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
28
|
return /*#__PURE__*/_react.default.createElement(_TableHead.HeadCell, (0, _extends2.default)({
|
|
27
29
|
style: inlineStyles,
|
|
28
30
|
"data-testid": testId && "".concat(testId, "--head--cell"),
|
|
@@ -17,6 +17,9 @@ var _TableCell = require("../styled/TableCell");
|
|
|
17
17
|
|
|
18
18
|
var _TableRow = require("../styled/TableRow");
|
|
19
19
|
|
|
20
|
+
var _excluded = ["cells"],
|
|
21
|
+
_excluded2 = ["content"];
|
|
22
|
+
|
|
20
23
|
var Row = function Row(_ref) {
|
|
21
24
|
var row = _ref.row,
|
|
22
25
|
head = _ref.head,
|
|
@@ -24,7 +27,7 @@ var Row = function Row(_ref) {
|
|
|
24
27
|
isFixedSize = _ref.isFixedSize,
|
|
25
28
|
isHighlighted = _ref.isHighlighted;
|
|
26
29
|
var cells = row.cells,
|
|
27
|
-
restRowProps = (0, _objectWithoutProperties2.default)(row,
|
|
30
|
+
restRowProps = (0, _objectWithoutProperties2.default)(row, _excluded);
|
|
28
31
|
return /*#__PURE__*/_react.default.createElement(_TableRow.TableBodyRow, (0, _extends2.default)({}, restRowProps, {
|
|
29
32
|
isHighlighted: isHighlighted
|
|
30
33
|
}, isHighlighted ? {
|
|
@@ -33,7 +36,7 @@ var Row = function Row(_ref) {
|
|
|
33
36
|
"data-testid": testId && "".concat(testId, "--row-").concat(restRowProps.key)
|
|
34
37
|
}), cells.map(function (cell, cellIndex) {
|
|
35
38
|
var content = cell.content,
|
|
36
|
-
restCellProps = (0, _objectWithoutProperties2.default)(cell,
|
|
39
|
+
restCellProps = (0, _objectWithoutProperties2.default)(cell, _excluded2);
|
|
37
40
|
|
|
38
41
|
var _ref2 = (head || {
|
|
39
42
|
cells: []
|
|
@@ -29,6 +29,8 @@ var _helpers = require("../../internal/helpers");
|
|
|
29
29
|
|
|
30
30
|
var _TableCell = require("../../styled/rankable/TableCell");
|
|
31
31
|
|
|
32
|
+
var _excluded = ["content"];
|
|
33
|
+
|
|
32
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); }; }
|
|
33
35
|
|
|
34
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; } }
|
|
@@ -54,7 +56,7 @@ var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
54
56
|
refWidth = _this$props.refWidth,
|
|
55
57
|
innerRef = _this$props.innerRef;
|
|
56
58
|
var content = cell.content,
|
|
57
|
-
restCellProps = (0, _objectWithoutProperties2.default)(cell,
|
|
59
|
+
restCellProps = (0, _objectWithoutProperties2.default)(cell, _excluded);
|
|
58
60
|
|
|
59
61
|
var _ref = head || {},
|
|
60
62
|
shouldTruncate = _ref.shouldTruncate,
|
|
@@ -29,6 +29,8 @@ var _helpers = require("../../internal/helpers");
|
|
|
29
29
|
|
|
30
30
|
var _TableHeadCell = _interopRequireDefault(require("../TableHeadCell"));
|
|
31
31
|
|
|
32
|
+
var _excluded = ["isRanking", "refHeight", "refWidth"];
|
|
33
|
+
|
|
32
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); }; }
|
|
33
35
|
|
|
34
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; } }
|
|
@@ -50,7 +52,7 @@ var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
|
50
52
|
isRanking = _this$props.isRanking,
|
|
51
53
|
refHeight = _this$props.refHeight,
|
|
52
54
|
refWidth = _this$props.refWidth,
|
|
53
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$props,
|
|
55
|
+
restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
54
56
|
var inlineStyles = (0, _helpers.inlineStylesIfRanking)(isRanking, refWidth);
|
|
55
57
|
return /*#__PURE__*/_react.default.createElement(_TableHeadCell.default, (0, _extends2.default)({
|
|
56
58
|
inlineStyles: inlineStyles
|
|
@@ -37,9 +37,11 @@ var _TableRow = require("../../styled/rankable/TableRow");
|
|
|
37
37
|
|
|
38
38
|
var _TableCell = _interopRequireDefault(require("./TableCell"));
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
var _excluded = ["cells", "key"];
|
|
41
41
|
|
|
42
|
-
function
|
|
42
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
|
+
|
|
44
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
43
45
|
|
|
44
46
|
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
47
|
|
|
@@ -89,7 +91,7 @@ var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
89
91
|
testId = _this$props.testId;
|
|
90
92
|
var cells = row.cells,
|
|
91
93
|
key = row.key,
|
|
92
|
-
restRowProps = (0, _objectWithoutProperties2.default)(row,
|
|
94
|
+
restRowProps = (0, _objectWithoutProperties2.default)(row, _excluded);
|
|
93
95
|
var inlineStyles = (0, _helpers.inlineStylesIfRanking)(isRanking, refWidth);
|
|
94
96
|
|
|
95
97
|
if (typeof key !== 'string' && !isRankingDisabled) {
|
|
@@ -33,9 +33,11 @@ var _constants = require("../internal/constants");
|
|
|
33
33
|
|
|
34
34
|
var _helpers = require("../internal/helpers");
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page"];
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
41
|
|
|
40
42
|
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
43
|
|
|
@@ -165,7 +167,7 @@ function withSortedPageRows(WrappedComponent) {
|
|
|
165
167
|
sortOrder = _this$props.sortOrder,
|
|
166
168
|
rowsPerPage = _this$props.rowsPerPage,
|
|
167
169
|
page = _this$props.page,
|
|
168
|
-
restProps = (0, _objectWithoutProperties2.default)(_this$props,
|
|
170
|
+
restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
169
171
|
return /*#__PURE__*/_react.default.createElement(WrappedComponent //@ts-expect-error TODO Fix legit TypeScript 3.9.6 improved inference error
|
|
170
172
|
, (0, _extends2.default)({
|
|
171
173
|
pageRows: this.state.pageRows,
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,16 +5,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "DynamicTableStateless", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _Stateless.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "default", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return
|
|
17
|
+
return _Stateful.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SMALL = exports.LOADING_CONTENTS_OPACITY = exports.LARGE = exports.DESC = exports.ASC = void 0;
|
|
7
7
|
var ASC = 'ASC';
|
|
8
8
|
exports.ASC = ASC;
|
|
9
9
|
var DESC = 'DESC';
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.validateSortKey = exports.reorderRows = exports.inlineStylesIfRanking = exports.getPageRows = exports.computeIndex = exports.assertIsSortable = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.tableRowCSSVars = exports.Table = exports.PaginationWrapper = exports.Caption = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -23,7 +23,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
23
23
|
|
|
24
24
|
var _theme = require("../theme");
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
var _excluded = ["isFixedSize", "children"];
|
|
27
27
|
var gridSize = (0, _constants.gridSize)();
|
|
28
28
|
// CSS vars for table row
|
|
29
29
|
// these are declared here to avoid being re-declared in each table row
|
|
@@ -46,7 +46,7 @@ var Table = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
46
46
|
|
|
47
47
|
var isFixedSize = _ref.isFixedSize,
|
|
48
48
|
children = _ref.children,
|
|
49
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
49
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
50
50
|
var theme = (0, _components.useGlobalTheme)();
|
|
51
51
|
return (0, _core.jsx)("table", (0, _extends2.default)({
|
|
52
52
|
style: (_ref2 = {}, (0, _defineProperty2.default)(_ref2, tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, _theme.row.hoverBackground({
|
|
@@ -15,13 +15,14 @@ var _core = require("@emotion/core");
|
|
|
15
15
|
|
|
16
16
|
var _constants = require("./constants");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var _excluded = ["width", "isFixedSize", "shouldTruncate", "innerRef"];
|
|
19
|
+
|
|
19
20
|
var TableBodyCell = function TableBodyCell(_ref) {
|
|
20
21
|
var width = _ref.width,
|
|
21
22
|
isFixedSize = _ref.isFixedSize,
|
|
22
23
|
shouldTruncate = _ref.shouldTruncate,
|
|
23
24
|
innerRef = _ref.innerRef,
|
|
24
|
-
props = (0, _objectWithoutProperties2.default)(_ref,
|
|
25
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
26
|
return (0, _core.jsx)("td", (0, _extends2.default)({
|
|
26
27
|
style: (0, _constants.getTruncationStyleVars)({
|
|
27
28
|
width: width
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getArrowStyles = exports.HeadCell = exports.Head = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -29,9 +29,12 @@ var _theme = require("../theme");
|
|
|
29
29
|
|
|
30
30
|
var _constants3 = require("./constants");
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
var _excluded = ["isRanking"],
|
|
33
|
+
_excluded2 = ["width", "children", "isSortable", "sortOrder", "isFixedSize", "shouldTruncate", "onClick", "style"];
|
|
33
34
|
|
|
34
|
-
function
|
|
35
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
36
|
+
|
|
37
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35
38
|
|
|
36
39
|
var gridSize = (0, _constants.gridSize)();
|
|
37
40
|
var CSS_VAR_TEXT_COLOR = '--local-dynamic-table-text-color';
|
|
@@ -41,7 +44,7 @@ var rankingStyles = (0, _core.css)({
|
|
|
41
44
|
|
|
42
45
|
var getHeadStyles = function getHeadStyles(theme) {
|
|
43
46
|
return (0, _core.css)({
|
|
44
|
-
borderBottom: "2px solid ".concat("var(--ds-border
|
|
47
|
+
borderBottom: "2px solid ".concat("var(--ds-border, ".concat(_theme.head.borderColor({
|
|
45
48
|
theme: theme
|
|
46
49
|
}), ")"))
|
|
47
50
|
});
|
|
@@ -49,7 +52,7 @@ var getHeadStyles = function getHeadStyles(theme) {
|
|
|
49
52
|
|
|
50
53
|
var Head = function Head(_ref) {
|
|
51
54
|
var isRanking = _ref.isRanking,
|
|
52
|
-
props = (0, _objectWithoutProperties2.default)(_ref,
|
|
55
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
56
|
var theme = (0, _components.useGlobalTheme)();
|
|
54
57
|
return (0, _core.jsx)("thead", (0, _extends2.default)({
|
|
55
58
|
css: [getHeadStyles(theme), isRanking && rankingStyles]
|
|
@@ -65,9 +68,9 @@ var headCellStyles = (0, _core.css)([_constants3.cellStyles, {
|
|
|
65
68
|
position: 'relative',
|
|
66
69
|
textAlign: 'left',
|
|
67
70
|
verticalAlign: 'top',
|
|
68
|
-
color: "var(--ds-text-
|
|
71
|
+
color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
|
|
69
72
|
'&:focus': {
|
|
70
|
-
outline: "solid 2px ".concat("var(--ds-border-
|
|
73
|
+
outline: "solid 2px ".concat("var(--ds-border-focused, ".concat(_colors.B100, ")"))
|
|
71
74
|
}
|
|
72
75
|
}]); // this needs to be made static: https://product-fabric.atlassian.net/browse/DSP-2011
|
|
73
76
|
|
|
@@ -151,7 +154,7 @@ exports.getArrowStyles = getArrowStyles;
|
|
|
151
154
|
var onClickStyles = (0, _core.css)({
|
|
152
155
|
'&:hover': {
|
|
153
156
|
cursor: 'pointer',
|
|
154
|
-
backgroundColor: "var(--ds-background-
|
|
157
|
+
backgroundColor: "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")")
|
|
155
158
|
}
|
|
156
159
|
});
|
|
157
160
|
var HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
@@ -163,7 +166,7 @@ var HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
163
166
|
shouldTruncate = _ref2.shouldTruncate,
|
|
164
167
|
onClick = _ref2.onClick,
|
|
165
168
|
style = _ref2.style,
|
|
166
|
-
rest = (0, _objectWithoutProperties2.default)(_ref2,
|
|
169
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
167
170
|
var theme = (0, _components.useGlobalTheme)();
|
|
168
171
|
|
|
169
172
|
var mergedStyles = _objectSpread(_objectSpread(_objectSpread({}, style), width && (0, _constants3.getTruncationStyleVars)({
|
|
@@ -17,29 +17,29 @@ var _core = require("@emotion/core");
|
|
|
17
17
|
|
|
18
18
|
var _DynamicTable = require("./DynamicTable");
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _excluded = ["isHighlighted", "children", "style"];
|
|
21
21
|
var rowStyles = (0, _core.css)({
|
|
22
22
|
'&:focus': {
|
|
23
|
-
outline: "2px solid ".concat("var(--ds-border-
|
|
23
|
+
outline: "2px solid ".concat("var(--ds-border-focused, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"), ")")),
|
|
24
24
|
outlineOffset: "-2px"
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
var rowBackgroundStyles = (0, _core.css)({
|
|
28
28
|
'&:hover': {
|
|
29
|
-
backgroundColor: "var(--ds-background-
|
|
29
|
+
backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"), ")")
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
var rowHighlightedBackgroundStyles = (0, _core.css)({
|
|
33
|
-
backgroundColor: "var(--ds-background-
|
|
33
|
+
backgroundColor: "var(--ds-background-brand, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, ")"), ")"),
|
|
34
34
|
'&:hover': {
|
|
35
|
-
backgroundColor: "var(--ds-background-
|
|
35
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, ")"), ")")
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
var TableBodyRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
39
39
|
var isHighlighted = _ref.isHighlighted,
|
|
40
40
|
children = _ref.children,
|
|
41
41
|
style = _ref.style,
|
|
42
|
-
rest = (0, _objectWithoutProperties2.default)(_ref,
|
|
42
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
43
|
return (0, _core.jsx)("tr", (0, _extends2.default)({
|
|
44
44
|
style: style,
|
|
45
45
|
css: [rowStyles, isHighlighted ? rowHighlightedBackgroundStyles : rowBackgroundStyles]
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.truncationWidthStyles = exports.overflowTruncateStyles = exports.getTruncationStyleVars = exports.fixedSizeTruncateStyles = exports.cellStyles = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ var _core = require("@emotion/core");
|
|
|
15
15
|
|
|
16
16
|
var _TableCell = require("../TableCell");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var _excluded = ["isRanking", "innerRef"];
|
|
19
19
|
var rankingStyles = (0, _core.css)({
|
|
20
20
|
boxSizing: 'border-box'
|
|
21
21
|
});
|
|
@@ -23,7 +23,7 @@ var rankingStyles = (0, _core.css)({
|
|
|
23
23
|
var RankableTableBodyCell = function RankableTableBodyCell(_ref) {
|
|
24
24
|
var isRanking = _ref.isRanking,
|
|
25
25
|
innerRef = _ref.innerRef,
|
|
26
|
-
props = (0, _objectWithoutProperties2.default)(_ref,
|
|
26
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
27
|
return (0, _core.jsx)(_TableCell.TableBodyCell, (0, _extends2.default)({
|
|
28
28
|
css: isRanking && rankingStyles
|
|
29
29
|
}, props, {
|
|
@@ -19,32 +19,32 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
19
19
|
|
|
20
20
|
var _TableRow = require("../TableRow");
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
var _excluded = ["isRanking", "isRankingItem"];
|
|
23
23
|
var rankingStyles = (0, _core.css)({
|
|
24
24
|
display: 'block'
|
|
25
25
|
});
|
|
26
|
-
var elevationStyle = "var(--ds-overlay, ".concat("0 20px 32px -8px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")");
|
|
26
|
+
var elevationStyle = "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")");
|
|
27
27
|
/**
|
|
28
28
|
* TODO: Pass the props here to get particular theme for the table
|
|
29
29
|
* Skipping it for now as it may impact migration as util-shared-styles does not support this feature
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
var rankingItemStyles = (0, _core.css)({
|
|
33
|
-
backgroundColor: "var(--ds-background-
|
|
33
|
+
backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
34
34
|
boxShadow: elevationStyle,
|
|
35
35
|
borderRadius: '2px'
|
|
36
36
|
});
|
|
37
37
|
var draggableStyles = (0, _core.css)({
|
|
38
38
|
'&:focus': {
|
|
39
39
|
outlineStyle: 'solid',
|
|
40
|
-
outlineColor: "var(--ds-border-
|
|
40
|
+
outlineColor: "var(--ds-border-focused, ".concat(_colors.B100, ")")
|
|
41
41
|
},
|
|
42
42
|
outlineWidth: '2px'
|
|
43
43
|
});
|
|
44
44
|
var RankableTableBodyRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
45
45
|
var isRanking = _ref.isRanking,
|
|
46
46
|
isRankingItem = _ref.isRankingItem,
|
|
47
|
-
props = (0, _objectWithoutProperties2.default)(_ref,
|
|
47
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
48
|
return (0, _core.jsx)(_TableRow.TableBodyRow, (0, _extends2.default)({
|
|
49
49
|
css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
|
|
50
50
|
ref: ref
|
package/dist/cjs/theme.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.row = exports.head = exports.arrow = exports.MSThemeColors = void 0;
|
|
9
9
|
|
|
10
10
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
11
11
|
|
|
@@ -24,46 +24,46 @@ var MSThemeColors = {
|
|
|
24
24
|
exports.MSThemeColors = MSThemeColors;
|
|
25
25
|
var arrow = {
|
|
26
26
|
defaultColor: (0, _components.themed)({
|
|
27
|
-
light: "var(--ds-background-
|
|
28
|
-
dark: "var(--ds-background-
|
|
27
|
+
light: "var(--ds-background-neutral, ".concat(colors.N40, ")"),
|
|
28
|
+
dark: "var(--ds-background-neutral, ".concat(colors.DN40, ")")
|
|
29
29
|
}),
|
|
30
30
|
selectedColor: (0, _components.themed)({
|
|
31
|
-
light: "var(--ds-text-
|
|
32
|
-
dark: "var(--ds-text-
|
|
31
|
+
light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
|
|
32
|
+
dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
|
|
33
33
|
}),
|
|
34
34
|
hoverColor: (0, _components.themed)({
|
|
35
|
-
light: "var(--ds-background-
|
|
36
|
-
dark: "var(--ds-background-
|
|
35
|
+
light: "var(--ds-background-neutral-pressed, ".concat(colors.N60, ")"),
|
|
36
|
+
dark: "var(--ds-background-neutral-pressed, ".concat(colors.DN60, ")")
|
|
37
37
|
})
|
|
38
38
|
};
|
|
39
39
|
exports.arrow = arrow;
|
|
40
40
|
var row = {
|
|
41
41
|
focusOutline: (0, _components.themed)({
|
|
42
|
-
light: "var(--ds-border-
|
|
43
|
-
dark: "var(--ds-border-
|
|
42
|
+
light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
|
|
43
|
+
dark: "var(--ds-border-focused, ".concat(colors.B100, ")")
|
|
44
44
|
}),
|
|
45
45
|
highlightedBackground: (0, _components.themed)({
|
|
46
|
-
light: "var(--ds-background-
|
|
47
|
-
dark: "var(--ds-background-
|
|
46
|
+
light: "var(--ds-background-brand, ".concat(colors.B50, ")"),
|
|
47
|
+
dark: "var(--ds-background-brand, ".concat(colors.DN50, ")")
|
|
48
48
|
}),
|
|
49
49
|
hoverBackground: (0, _components.themed)({
|
|
50
|
-
light: "var(--ds-background-
|
|
51
|
-
dark: "var(--ds-background-
|
|
50
|
+
light: "var(--ds-background-input, ".concat(colors.N10, ")"),
|
|
51
|
+
dark: "var(--ds-background-input, ".concat(colors.DN40, ")")
|
|
52
52
|
}),
|
|
53
53
|
hoverHighlightedBackground: (0, _components.themed)({
|
|
54
|
-
light: "var(--ds-background-
|
|
55
|
-
dark: "var(--ds-background-
|
|
54
|
+
light: "var(--ds-background-brand-hovered, ".concat(colors.B75, ")"),
|
|
55
|
+
dark: "var(--ds-background-brand-hovered, ".concat(colors.DN60, ")")
|
|
56
56
|
})
|
|
57
57
|
};
|
|
58
58
|
exports.row = row;
|
|
59
59
|
var head = {
|
|
60
60
|
borderColor: (0, _components.themed)({
|
|
61
|
-
light: "var(--ds-border
|
|
62
|
-
dark: "var(--ds-border
|
|
61
|
+
light: "var(--ds-border, ".concat(colors.N40, ")"),
|
|
62
|
+
dark: "var(--ds-border, ".concat(colors.DN50, ")")
|
|
63
63
|
}),
|
|
64
64
|
textColor: (0, _components.themed)({
|
|
65
|
-
light: "var(--ds-text-
|
|
66
|
-
dark: "var(--ds-text-
|
|
65
|
+
light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
|
|
66
|
+
dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
|
|
67
67
|
})
|
|
68
68
|
};
|
|
69
69
|
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 && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
21
|
+
isHighlighted: row.isHighlighted || !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
|
|
22
22
|
testId: testId
|
|
23
23
|
})));
|
|
24
24
|
}
|
|
@@ -13,7 +13,7 @@ import ManagedPagination from './managed-pagination';
|
|
|
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.5.1";
|
|
17
17
|
|
|
18
18
|
function toggleSortOrder(currentSortOrder) {
|
|
19
19
|
switch (currentSortOrder) {
|