@atlaskit/dynamic-table 14.15.0 → 14.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#81825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81825) [`6d27545ac997`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6d27545ac997) - Dynamic table now also respects test IDs when passed in at the row level.
8
+
3
9
  ## 14.15.0
4
10
 
5
11
  ### Minor Changes
@@ -114,7 +114,7 @@ var RankableBody = exports.RankableBody = /*#__PURE__*/function (_React$Componen
114
114
  row: row,
115
115
  isRankingDisabled: isRankingDisabled,
116
116
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
117
- testId: "".concat(testId, "--rankable--table--row")
117
+ testId: testId && "".concat(testId, "--rankable--table--row")
118
118
  });
119
119
  }), provided.placeholder);
120
120
  }));
@@ -20,7 +20,7 @@ var _withDimensions = _interopRequireDefault(require("../../hoc/with-dimensions"
20
20
  var _helpers = require("../../internal/helpers");
21
21
  var _tableRow = require("../../styled/rankable/table-row");
22
22
  var _tableCell = _interopRequireDefault(require("./table-cell"));
23
- var _excluded = ["cells", "key", "isHighlighted"];
23
+ var _excluded = ["cells", "testId", "key", "isHighlighted"];
24
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
26
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -61,6 +61,7 @@ var RankableTableRow = exports.RankableTableRow = /*#__PURE__*/function (_React$
61
61
  isHighlighted = _this$props.isHighlighted,
62
62
  testId = _this$props.testId;
63
63
  var cells = row.cells,
64
+ rowTestId = row.testId,
64
65
  key = row.key,
65
66
  isRowHighlighted = row.isHighlighted,
66
67
  restRowProps = (0, _objectWithoutProperties2.default)(row, _excluded);
@@ -83,7 +84,7 @@ var RankableTableRow = exports.RankableTableRow = /*#__PURE__*/function (_React$
83
84
  isHighlighted: isHighlighted || isRowHighlighted,
84
85
  isRanking: isRanking,
85
86
  isRankingItem: snapshot.isDragging,
86
- testId: testId && "".concat(testId, "--rankable--table--body--row")
87
+ testId: rowTestId || testId && "".concat(testId, "--rankable--table--body--row")
87
88
  }), cells.map(function (cell, cellIndex) {
88
89
  var headCell = (head || {
89
90
  cells: []
@@ -35,7 +35,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
35
35
  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); }; }
36
36
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
37
37
  var packageName = "@atlaskit/dynamic-table";
38
- var packageVersion = "14.15.0";
38
+ var packageVersion = "14.16.0";
39
39
  function toggleSortOrder(currentSortOrder) {
40
40
  switch (currentSortOrder) {
41
41
  case _constants.DESC:
@@ -25,7 +25,7 @@ var Row = function Row(_ref) {
25
25
  }, isHighlighted ? {
26
26
  'data-ts--dynamic-table--table-row--highlighted': true
27
27
  } : null, {
28
- testId: testId && "".concat(testId, "--row-").concat(restRowProps.key)
28
+ testId: row.testId || testId && "".concat(testId, "--row-").concat(restRowProps.key)
29
29
  }), cells.map(function (cell, cellIndex) {
30
30
  var content = cell.content,
31
31
  cellTestId = cell.testId,
@@ -105,7 +105,7 @@ export class RankableBody extends React.Component {
105
105
  row: row,
106
106
  isRankingDisabled: isRankingDisabled,
107
107
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
108
- testId: `${testId}--rankable--table--row`
108
+ testId: testId && `${testId}--rankable--table--row`
109
109
  })), provided.placeholder)));
110
110
  }
111
111
  }
@@ -33,6 +33,7 @@ export class RankableTableRow extends React.Component {
33
33
  } = this.props;
34
34
  const {
35
35
  cells,
36
+ testId: rowTestId,
36
37
  key,
37
38
  isHighlighted: isRowHighlighted,
38
39
  // TODO: Remove `rest` props and use only what is explicitly in the API.
@@ -60,7 +61,7 @@ export class RankableTableRow extends React.Component {
60
61
  isHighlighted: isHighlighted || isRowHighlighted,
61
62
  isRanking: isRanking,
62
63
  isRankingItem: snapshot.isDragging,
63
- testId: testId && `${testId}--rankable--table--body--row`
64
+ testId: rowTestId || testId && `${testId}--rankable--table--body--row`
64
65
  }), cells.map((cell, cellIndex) => {
65
66
  const headCell = (head || {
66
67
  cells: []
@@ -14,7 +14,7 @@ import LoadingContainerAdvanced from './loading-container-advanced';
14
14
  import ManagedPagination from './managed-pagination';
15
15
  import TableHead from './table-head';
16
16
  const packageName = "@atlaskit/dynamic-table";
17
- const packageVersion = "14.15.0";
17
+ const packageVersion = "14.16.0";
18
18
  function toggleSortOrder(currentSortOrder) {
19
19
  switch (currentSortOrder) {
20
20
  case DESC:
@@ -18,7 +18,7 @@ const Row = ({
18
18
  }, isHighlighted ? {
19
19
  'data-ts--dynamic-table--table-row--highlighted': true
20
20
  } : null, {
21
- testId: testId && `${testId}--row-${restRowProps.key}`
21
+ testId: row.testId || testId && `${testId}--row-${restRowProps.key}`
22
22
  }), cells.map((cell, cellIndex) => {
23
23
  const {
24
24
  content,
@@ -109,7 +109,7 @@ export var RankableBody = /*#__PURE__*/function (_React$Component) {
109
109
  row: row,
110
110
  isRankingDisabled: isRankingDisabled,
111
111
  isHighlighted: !!highlightedRowIndex && (typeof highlightedRowIndex === 'number' ? highlightedRowIndex === rowIndex : highlightedRowIndex.indexOf(rowIndex) > -1),
112
- testId: "".concat(testId, "--rankable--table--row")
112
+ testId: testId && "".concat(testId, "--rankable--table--row")
113
113
  });
114
114
  }), provided.placeholder);
115
115
  }));
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["cells", "key", "isHighlighted"];
10
+ var _excluded = ["cells", "testId", "key", "isHighlighted"];
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -56,6 +56,7 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
56
56
  isHighlighted = _this$props.isHighlighted,
57
57
  testId = _this$props.testId;
58
58
  var cells = row.cells,
59
+ rowTestId = row.testId,
59
60
  key = row.key,
60
61
  isRowHighlighted = row.isHighlighted,
61
62
  restRowProps = _objectWithoutProperties(row, _excluded);
@@ -78,7 +79,7 @@ export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
78
79
  isHighlighted: isHighlighted || isRowHighlighted,
79
80
  isRanking: isRanking,
80
81
  isRankingItem: snapshot.isDragging,
81
- testId: testId && "".concat(testId, "--rankable--table--body--row")
82
+ testId: rowTestId || testId && "".concat(testId, "--rankable--table--body--row")
82
83
  }), cells.map(function (cell, cellIndex) {
83
84
  var headCell = (head || {
84
85
  cells: []
@@ -25,7 +25,7 @@ import LoadingContainerAdvanced from './loading-container-advanced';
25
25
  import ManagedPagination from './managed-pagination';
26
26
  import TableHead from './table-head';
27
27
  var packageName = "@atlaskit/dynamic-table";
28
- var packageVersion = "14.15.0";
28
+ var packageVersion = "14.16.0";
29
29
  function toggleSortOrder(currentSortOrder) {
30
30
  switch (currentSortOrder) {
31
31
  case DESC:
@@ -18,7 +18,7 @@ var Row = function Row(_ref) {
18
18
  }, isHighlighted ? {
19
19
  'data-ts--dynamic-table--table-row--highlighted': true
20
20
  } : null, {
21
- testId: testId && "".concat(testId, "--row-").concat(restRowProps.key)
21
+ testId: row.testId || testId && "".concat(testId, "--row-").concat(restRowProps.key)
22
22
  }), cells.map(function (cell, cellIndex) {
23
23
  var content = cell.content,
24
24
  cellTestId = cell.testId,
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { SpinnerSizeType } from '../types';
3
3
  export interface LoadingContainerAdvancedProps {
4
+ children?: React.ReactNode;
4
5
  isLoading?: boolean;
5
6
  spinnerSize?: SpinnerSizeType;
6
7
  contentsOpacity: number | string;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { SpinnerSizeType } from '../types';
3
3
  export interface LoadingContainerAdvancedProps {
4
+ children?: React.ReactNode;
4
5
  isLoading?: boolean;
5
6
  spinnerSize?: SpinnerSizeType;
6
7
  contentsOpacity: number | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.15.0",
3
+ "version": "14.16.0",
4
4
  "description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"