@atlaskit/dynamic-table 14.4.1 → 14.5.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/components/Body.js +1 -1
  4. package/dist/cjs/components/Stateless.js +1 -1
  5. package/dist/cjs/components/TableHead.js +5 -2
  6. package/dist/cjs/components/TableHeadCell.js +3 -1
  7. package/dist/cjs/components/TableRow.js +5 -2
  8. package/dist/cjs/components/rankable/TableCell.js +3 -1
  9. package/dist/cjs/components/rankable/TableHeadCell.js +3 -1
  10. package/dist/cjs/components/rankable/TableRow.js +5 -3
  11. package/dist/cjs/hoc/withSortedPageRows.js +5 -3
  12. package/dist/cjs/index.js +4 -4
  13. package/dist/cjs/internal/constants.js +1 -1
  14. package/dist/cjs/internal/helpers.js +1 -1
  15. package/dist/cjs/styled/DynamicTable.js +3 -3
  16. package/dist/cjs/styled/EmptyBody.js +1 -1
  17. package/dist/cjs/styled/TableCell.js +3 -2
  18. package/dist/cjs/styled/TableHead.js +13 -12
  19. package/dist/cjs/styled/TableRow.js +6 -8
  20. package/dist/cjs/styled/constants.js +2 -2
  21. package/dist/cjs/styled/rankable/TableCell.js +2 -2
  22. package/dist/cjs/styled/rankable/TableRow.js +5 -7
  23. package/dist/cjs/theme.js +19 -21
  24. package/dist/cjs/version.json +1 -1
  25. package/dist/es2019/components/Body.js +1 -1
  26. package/dist/es2019/components/Stateless.js +1 -1
  27. package/dist/es2019/styled/TableHead.js +5 -6
  28. package/dist/es2019/styled/TableRow.js +4 -5
  29. package/dist/es2019/styled/constants.js +1 -1
  30. package/dist/es2019/styled/rankable/TableRow.js +3 -4
  31. package/dist/es2019/theme.js +18 -19
  32. package/dist/es2019/version.json +1 -1
  33. package/dist/esm/components/Body.js +1 -1
  34. package/dist/esm/components/Stateless.js +1 -1
  35. package/dist/esm/components/TableHead.js +4 -2
  36. package/dist/esm/components/TableHeadCell.js +2 -1
  37. package/dist/esm/components/TableRow.js +4 -2
  38. package/dist/esm/components/rankable/TableCell.js +2 -1
  39. package/dist/esm/components/rankable/TableHeadCell.js +2 -1
  40. package/dist/esm/components/rankable/TableRow.js +4 -3
  41. package/dist/esm/hoc/withSortedPageRows.js +4 -3
  42. package/dist/esm/styled/DynamicTable.js +2 -1
  43. package/dist/esm/styled/TableCell.js +2 -1
  44. package/dist/esm/styled/TableHead.js +11 -10
  45. package/dist/esm/styled/TableRow.js +6 -6
  46. package/dist/esm/styled/constants.js +1 -1
  47. package/dist/esm/styled/rankable/TableCell.js +2 -1
  48. package/dist/esm/styled/rankable/TableRow.js +5 -5
  49. package/dist/esm/theme.js +18 -19
  50. package/dist/esm/version.json +1 -1
  51. package/dist/types/components/TableRow.d.ts +1 -0
  52. package/dist/types/styled/constants.d.ts +1 -1
  53. package/dist/types/theme.d.ts +9 -9
  54. package/dist/types/types.d.ts +28 -24
  55. package/package.json +10 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Rows can now also be highlighted using the isHighlighted property inside the rows data
8
+
9
+ ### Patch Changes
10
+
11
+ - [`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
12
+ - Updated dependencies
13
+
14
+ ## 14.4.4
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
20
+ ## 14.4.3
21
+
22
+ ### Patch Changes
23
+
24
+ - [`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.
25
+ - Updated dependencies
26
+
27
+ ## 14.4.2
28
+
29
+ ### Patch Changes
30
+
31
+ - [`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.
32
+
3
33
  ## 14.4.1
4
34
 
5
35
  ### Patch Changes
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Dynamic-table
1
+ # Dynamic table
2
2
 
3
3
  Table component with pagination and sorting functionality.
4
4
 
@@ -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.4.1";
55
+ var packageVersion = "14.5.0";
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, ["cells"]);
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, ["isSortable", "key"]);
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, ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"]);
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, ["cells"]);
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, ["content"]);
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, ["content"]);
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, ["isRanking", "refHeight", "refWidth"]);
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
- 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
+ var _excluded = ["cells", "key"];
41
41
 
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; }
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, ["cells", "key"]);
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
- 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
+ var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page"];
37
37
 
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; }
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, ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page"]);
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, "default", {
8
+ Object.defineProperty(exports, "DynamicTableStateless", {
9
9
  enumerable: true,
10
10
  get: function get() {
11
- return _Stateful.default;
11
+ return _Stateless.default;
12
12
  }
13
13
  });
14
- Object.defineProperty(exports, "DynamicTableStateless", {
14
+ Object.defineProperty(exports, "default", {
15
15
  enumerable: true,
16
16
  get: function get() {
17
- return _Stateless.default;
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.LOADING_CONTENTS_OPACITY = exports.LARGE = exports.SMALL = exports.DESC = exports.ASC = void 0;
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.reorderRows = exports.computeIndex = exports.inlineStylesIfRanking = exports.validateSortKey = exports.assertIsSortable = exports.getPageRows = void 0;
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.PaginationWrapper = exports.Caption = exports.Table = exports.tableRowCSSVars = void 0;
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
- /** @jsx jsx */
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, ["isFixedSize", "children"]);
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({
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EmptyViewContainer = exports.EmptyViewWithFixedHeight = void 0;
6
+ exports.EmptyViewWithFixedHeight = exports.EmptyViewContainer = void 0;
7
7
 
8
8
  var _core = require("@emotion/core");
9
9
 
@@ -15,13 +15,14 @@ var _core = require("@emotion/core");
15
15
 
16
16
  var _constants = require("./constants");
17
17
 
18
- /** @jsx jsx */
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, ["width", "isFixedSize", "shouldTruncate", "innerRef"]);
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.HeadCell = exports.getArrowStyles = exports.Head = void 0;
8
+ exports.getArrowStyles = exports.HeadCell = exports.Head = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -23,17 +23,18 @@ var _components = require("@atlaskit/theme/components");
23
23
 
24
24
  var _constants = require("@atlaskit/theme/constants");
25
25
 
26
- var _tokens = require("@atlaskit/tokens");
27
-
28
26
  var _constants2 = require("../internal/constants");
29
27
 
30
28
  var _theme = require("../theme");
31
29
 
32
30
  var _constants3 = require("./constants");
33
31
 
34
- 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; }
32
+ var _excluded = ["isRanking"],
33
+ _excluded2 = ["width", "children", "isSortable", "sortOrder", "isFixedSize", "shouldTruncate", "onClick", "style"];
34
+
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; }
35
36
 
36
- 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; }
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; }
37
38
 
38
39
  var gridSize = (0, _constants.gridSize)();
39
40
  var CSS_VAR_TEXT_COLOR = '--local-dynamic-table-text-color';
@@ -43,15 +44,15 @@ var rankingStyles = (0, _core.css)({
43
44
 
44
45
  var getHeadStyles = function getHeadStyles(theme) {
45
46
  return (0, _core.css)({
46
- borderBottom: "2px solid ".concat((0, _tokens.token)('color.border.neutral', _theme.head.borderColor({
47
+ borderBottom: "2px solid ".concat("var(--ds-border, ".concat(_theme.head.borderColor({
47
48
  theme: theme
48
- })))
49
+ }), ")"))
49
50
  });
50
51
  };
51
52
 
52
53
  var Head = function Head(_ref) {
53
54
  var isRanking = _ref.isRanking,
54
- props = (0, _objectWithoutProperties2.default)(_ref, ["isRanking"]);
55
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
55
56
  var theme = (0, _components.useGlobalTheme)();
56
57
  return (0, _core.jsx)("thead", (0, _extends2.default)({
57
58
  css: [getHeadStyles(theme), isRanking && rankingStyles]
@@ -67,9 +68,9 @@ var headCellStyles = (0, _core.css)([_constants3.cellStyles, {
67
68
  position: 'relative',
68
69
  textAlign: 'left',
69
70
  verticalAlign: 'top',
70
- color: (0, _tokens.token)('color.text.lowEmphasis', "var(".concat(CSS_VAR_TEXT_COLOR, ")")),
71
+ color: "var(--ds-text-subtlest, ".concat("var(".concat(CSS_VAR_TEXT_COLOR, ")"), ")"),
71
72
  '&:focus': {
72
- outline: "solid 2px ".concat((0, _tokens.token)('color.border.focus', _colors.B100))
73
+ outline: "solid 2px ".concat("var(--ds-border-focused, ".concat(_colors.B100, ")"))
73
74
  }
74
75
  }]); // this needs to be made static: https://product-fabric.atlassian.net/browse/DSP-2011
75
76
 
@@ -153,7 +154,7 @@ exports.getArrowStyles = getArrowStyles;
153
154
  var onClickStyles = (0, _core.css)({
154
155
  '&:hover': {
155
156
  cursor: 'pointer',
156
- backgroundColor: (0, _tokens.token)('color.background.subtleNeutral.hover', _colors.N30A)
157
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")")
157
158
  }
158
159
  });
159
160
  var HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
@@ -165,7 +166,7 @@ var HeadCell = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
165
166
  shouldTruncate = _ref2.shouldTruncate,
166
167
  onClick = _ref2.onClick,
167
168
  style = _ref2.style,
168
- rest = (0, _objectWithoutProperties2.default)(_ref2, ["width", "children", "isSortable", "sortOrder", "isFixedSize", "shouldTruncate", "onClick", "style"]);
169
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
169
170
  var theme = (0, _components.useGlobalTheme)();
170
171
 
171
172
  var mergedStyles = _objectSpread(_objectSpread(_objectSpread({}, style), width && (0, _constants3.getTruncationStyleVars)({
@@ -15,33 +15,31 @@ var _react = require("react");
15
15
 
16
16
  var _core = require("@emotion/core");
17
17
 
18
- var _tokens = require("@atlaskit/tokens");
19
-
20
18
  var _DynamicTable = require("./DynamicTable");
21
19
 
22
- /** @jsx jsx */
20
+ var _excluded = ["isHighlighted", "children", "style"];
23
21
  var rowStyles = (0, _core.css)({
24
22
  '&:focus': {
25
- outline: "2px solid ".concat((0, _tokens.token)('color.border.focus', "var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"))),
23
+ outline: "2px solid ".concat("var(--ds-border-focused, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"), ")")),
26
24
  outlineOffset: "-2px"
27
25
  }
28
26
  });
29
27
  var rowBackgroundStyles = (0, _core.css)({
30
28
  '&:hover': {
31
- backgroundColor: (0, _tokens.token)('color.background.transparentNeutral.hover', "var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"))
29
+ backgroundColor: "var(--ds-background-neutral-subtle-hovered, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, ")"), ")")
32
30
  }
33
31
  });
34
32
  var rowHighlightedBackgroundStyles = (0, _core.css)({
35
- backgroundColor: (0, _tokens.token)('color.background.selected.resting', "var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, ")")),
33
+ backgroundColor: "var(--ds-background-brand, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, ")"), ")"),
36
34
  '&:hover': {
37
- backgroundColor: (0, _tokens.token)('color.background.selected.hover', "var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, ")"))
35
+ backgroundColor: "var(--ds-background-brand-hovered, ".concat("var(".concat(_DynamicTable.tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, ")"), ")")
38
36
  }
39
37
  });
40
38
  var TableBodyRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
41
39
  var isHighlighted = _ref.isHighlighted,
42
40
  children = _ref.children,
43
41
  style = _ref.style,
44
- rest = (0, _objectWithoutProperties2.default)(_ref, ["isHighlighted", "children", "style"]);
42
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
45
43
  return (0, _core.jsx)("tr", (0, _extends2.default)({
46
44
  style: style,
47
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.cellStyles = exports.getTruncationStyleVars = exports.overflowTruncateStyles = exports.fixedSizeTruncateStyles = exports.truncationWidthStyles = void 0;
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
 
@@ -31,7 +31,7 @@ exports.overflowTruncateStyles = overflowTruncateStyles;
31
31
 
32
32
  var getTruncationStyleVars = function getTruncationStyleVars(_ref) {
33
33
  var width = _ref.width;
34
- return (0, _defineProperty2.default)({}, CSS_VAR_WIDTH, "".concat(width, "%"));
34
+ return (0, _defineProperty2.default)({}, CSS_VAR_WIDTH, typeof width !== 'undefined' ? "".concat(width, "%") : undefined);
35
35
  };
36
36
 
37
37
  exports.getTruncationStyleVars = getTruncationStyleVars;
@@ -15,7 +15,7 @@ var _core = require("@emotion/core");
15
15
 
16
16
  var _TableCell = require("../TableCell");
17
17
 
18
- /** @jsx jsx */
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, ["isRanking", "innerRef"]);
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, {
@@ -17,36 +17,34 @@ var _core = require("@emotion/core");
17
17
 
18
18
  var _colors = require("@atlaskit/theme/colors");
19
19
 
20
- var _tokens = require("@atlaskit/tokens");
21
-
22
20
  var _TableRow = require("../TableRow");
23
21
 
24
- /** @jsx jsx */
22
+ var _excluded = ["isRanking", "isRankingItem"];
25
23
  var rankingStyles = (0, _core.css)({
26
24
  display: 'block'
27
25
  });
28
- var elevationStyle = (0, _tokens.token)('shadow.overlay', "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), ")");
29
27
  /**
30
28
  * TODO: Pass the props here to get particular theme for the table
31
29
  * Skipping it for now as it may impact migration as util-shared-styles does not support this feature
32
30
  */
33
31
 
34
32
  var rankingItemStyles = (0, _core.css)({
35
- backgroundColor: (0, _tokens.token)('color.background.subtleNeutral.resting', _colors.N20),
33
+ backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
36
34
  boxShadow: elevationStyle,
37
35
  borderRadius: '2px'
38
36
  });
39
37
  var draggableStyles = (0, _core.css)({
40
38
  '&:focus': {
41
39
  outlineStyle: 'solid',
42
- outlineColor: (0, _tokens.token)('color.border.focus', _colors.B100)
40
+ outlineColor: "var(--ds-border-focused, ".concat(_colors.B100, ")")
43
41
  },
44
42
  outlineWidth: '2px'
45
43
  });
46
44
  var RankableTableBodyRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
47
45
  var isRanking = _ref.isRanking,
48
46
  isRankingItem = _ref.isRankingItem,
49
- props = (0, _objectWithoutProperties2.default)(_ref, ["isRanking", "isRankingItem"]);
47
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
50
48
  return (0, _core.jsx)(_TableRow.TableBodyRow, (0, _extends2.default)({
51
49
  css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
52
50
  ref: ref
package/dist/cjs/theme.js CHANGED
@@ -5,14 +5,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.head = exports.row = exports.arrow = exports.MSThemeColors = void 0;
8
+ exports.row = exports.head = exports.arrow = exports.MSThemeColors = void 0;
9
9
 
10
10
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
11
 
12
12
  var _components = require("@atlaskit/theme/components");
13
13
 
14
- var _tokens = require("@atlaskit/tokens");
15
-
16
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
15
 
18
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -26,46 +24,46 @@ var MSThemeColors = {
26
24
  exports.MSThemeColors = MSThemeColors;
27
25
  var arrow = {
28
26
  defaultColor: (0, _components.themed)({
29
- light: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N40),
30
- dark: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.DN40)
27
+ light: "var(--ds-background-neutral, ".concat(colors.N40, ")"),
28
+ dark: "var(--ds-background-neutral, ".concat(colors.DN40, ")")
31
29
  }),
32
30
  selectedColor: (0, _components.themed)({
33
- light: (0, _tokens.token)('color.text.lowEmphasis', colors.N300),
34
- dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN300)
31
+ light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
32
+ dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
35
33
  }),
36
34
  hoverColor: (0, _components.themed)({
37
- light: (0, _tokens.token)('color.background.subtleNeutral.pressed', colors.N60),
38
- dark: (0, _tokens.token)('color.background.subtleNeutral.pressed', colors.DN60)
35
+ light: "var(--ds-background-neutral-pressed, ".concat(colors.N60, ")"),
36
+ dark: "var(--ds-background-neutral-pressed, ".concat(colors.DN60, ")")
39
37
  })
40
38
  };
41
39
  exports.arrow = arrow;
42
40
  var row = {
43
41
  focusOutline: (0, _components.themed)({
44
- light: (0, _tokens.token)('color.border.focus', colors.B100),
45
- dark: (0, _tokens.token)('color.border.focus', colors.B100)
42
+ light: "var(--ds-border-focused, ".concat(colors.B100, ")"),
43
+ dark: "var(--ds-border-focused, ".concat(colors.B100, ")")
46
44
  }),
47
45
  highlightedBackground: (0, _components.themed)({
48
- light: (0, _tokens.token)('color.background.selected.resting', colors.B50),
49
- dark: (0, _tokens.token)('color.background.selected.resting', colors.DN50)
46
+ light: "var(--ds-background-brand, ".concat(colors.B50, ")"),
47
+ dark: "var(--ds-background-brand, ".concat(colors.DN50, ")")
50
48
  }),
51
49
  hoverBackground: (0, _components.themed)({
52
- light: (0, _tokens.token)('color.background.subtleBorderedNeutral.resting', colors.N10),
53
- dark: (0, _tokens.token)('color.background.subtleBorderedNeutral.resting', colors.DN40)
50
+ light: "var(--ds-background-input, ".concat(colors.N10, ")"),
51
+ dark: "var(--ds-background-input, ".concat(colors.DN40, ")")
54
52
  }),
55
53
  hoverHighlightedBackground: (0, _components.themed)({
56
- light: (0, _tokens.token)('color.background.selected.hover', colors.B75),
57
- dark: (0, _tokens.token)('color.background.selected.hover', colors.DN60)
54
+ light: "var(--ds-background-brand-hovered, ".concat(colors.B75, ")"),
55
+ dark: "var(--ds-background-brand-hovered, ".concat(colors.DN60, ")")
58
56
  })
59
57
  };
60
58
  exports.row = row;
61
59
  var head = {
62
60
  borderColor: (0, _components.themed)({
63
- light: (0, _tokens.token)('color.border.neutral', colors.N40),
64
- dark: (0, _tokens.token)('color.border.neutral', colors.DN50)
61
+ light: "var(--ds-border, ".concat(colors.N40, ")"),
62
+ dark: "var(--ds-border, ".concat(colors.DN50, ")")
65
63
  }),
66
64
  textColor: (0, _components.themed)({
67
- light: (0, _tokens.token)('color.text.lowEmphasis', colors.N300),
68
- dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN300)
65
+ light: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
66
+ dark: "var(--ds-text-subtlest, ".concat(colors.DN300, ")")
69
67
  })
70
68
  };
71
69
  exports.head = head;