@atlaskit/dynamic-table 14.14.0 → 14.15.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 +6 -0
- package/dist/cjs/components/body.js +1 -1
- package/dist/cjs/components/error-boundary.js +1 -1
- package/dist/cjs/components/loading-container-advanced.js +1 -1
- package/dist/cjs/components/loading-container.js +1 -1
- package/dist/cjs/components/managed-pagination.js +1 -1
- package/dist/cjs/components/rankable/body.js +1 -1
- package/dist/cjs/components/rankable/table-cell.js +4 -3
- package/dist/cjs/components/rankable/table-head-cell.js +1 -1
- package/dist/cjs/components/rankable/table-row.js +1 -1
- package/dist/cjs/components/stateful.js +1 -1
- package/dist/cjs/components/stateless.js +4 -4
- package/dist/cjs/components/table-head.js +1 -1
- package/dist/cjs/components/table-row.js +3 -2
- package/dist/cjs/hoc/with-dimensions.js +1 -1
- package/dist/cjs/hoc/with-sorted-page-rows.js +1 -1
- package/dist/cjs/theme.js +2 -2
- package/dist/es2019/components/rankable/table-cell.js +2 -1
- package/dist/es2019/components/stateless.js +1 -1
- package/dist/es2019/components/table-row.js +2 -1
- package/dist/esm/components/body.js +1 -1
- package/dist/esm/components/error-boundary.js +1 -1
- package/dist/esm/components/loading-container-advanced.js +1 -1
- package/dist/esm/components/loading-container.js +1 -1
- package/dist/esm/components/managed-pagination.js +1 -1
- package/dist/esm/components/rankable/body.js +1 -1
- package/dist/esm/components/rankable/table-cell.js +4 -3
- package/dist/esm/components/rankable/table-head-cell.js +1 -1
- package/dist/esm/components/rankable/table-row.js +1 -1
- package/dist/esm/components/stateful.js +1 -1
- package/dist/esm/components/stateless.js +2 -2
- package/dist/esm/components/table-head.js +1 -1
- package/dist/esm/components/table-row.js +3 -2
- package/dist/esm/hoc/with-dimensions.js +1 -1
- package/dist/esm/hoc/with-sorted-page-rows.js +1 -1
- package/dist/types/types.d.ts +43 -45
- package/dist/types-ts4.5/types.d.ts +43 -45
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 14.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#81321](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81321) [`2579643f7ac8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2579643f7ac8) - Dynamic table now respects test IDs when passed in at the cell level. Note that there are no prefixes applied to this test ID. It is assumed that if you are providing a test ID at the cell level, you are wanting to target a single cell in an isolated context. If you're looking to gain insight to a particular cell in the context of its surrounding elements, it might be preferrable to supply a test ID to the root of the table and use the generated test IDs for querying instead.
|
|
8
|
+
|
|
3
9
|
## 14.14.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -15,7 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
var _withSortedPageRows = _interopRequireDefault(require("../hoc/with-sorted-page-rows"));
|
|
16
16
|
var _tableRow = _interopRequireDefault(require("./table-row"));
|
|
17
17
|
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); }; }
|
|
18
|
-
function _isNativeReflectConstruct() {
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
19
|
var Body = /*#__PURE__*/function (_React$Component) {
|
|
20
20
|
(0, _inherits2.default)(Body, _React$Component);
|
|
21
21
|
var _super = _createSuper(Body);
|
|
@@ -12,7 +12,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
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); }; }
|
|
15
|
-
function _isNativeReflectConstruct() {
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
16
|
var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
17
17
|
(0, _inherits2.default)(ErrorBoundary, _React$Component);
|
|
18
18
|
var _super = _createSuper(ErrorBoundary);
|
|
@@ -18,7 +18,7 @@ var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
|
18
18
|
var _constants = require("../internal/constants");
|
|
19
19
|
var _loadingContainerAdvanced = require("../styled/loading-container-advanced");
|
|
20
20
|
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); }; }
|
|
21
|
-
function _isNativeReflectConstruct() {
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
22
22
|
var LoadingContainerAdvanced = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
23
23
|
(0, _inherits2.default)(LoadingContainerAdvanced, _React$Component);
|
|
24
24
|
var _super = _createSuper(LoadingContainerAdvanced);
|
|
@@ -16,7 +16,7 @@ var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
|
16
16
|
var _constants = require("../internal/constants");
|
|
17
17
|
var _loadingContainer = require("../styled/loading-container");
|
|
18
18
|
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); }; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
var LoadingContainer = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
21
21
|
(0, _inherits2.default)(LoadingContainer, _React$Component);
|
|
22
22
|
var _super = _createSuper(LoadingContainer);
|
|
@@ -16,7 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _pagination = _interopRequireDefault(require("@atlaskit/pagination"));
|
|
18
18
|
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); }; }
|
|
19
|
-
function _isNativeReflectConstruct() {
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
var ManagedPagination = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
21
21
|
(0, _inherits2.default)(ManagedPagination, _React$Component);
|
|
22
22
|
var _super = _createSuper(ManagedPagination);
|
|
@@ -18,7 +18,7 @@ var _reactBeautifulDnd = require("react-beautiful-dnd");
|
|
|
18
18
|
var _withSortedPageRows = _interopRequireDefault(require("../../hoc/with-sorted-page-rows"));
|
|
19
19
|
var _tableRow = _interopRequireDefault(require("./table-row"));
|
|
20
20
|
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); }; }
|
|
21
|
-
function _isNativeReflectConstruct() {
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // Allowing existing usage of non Pragmatic drag and drop solution
|
|
22
22
|
// eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
|
|
23
23
|
// computes destination of ranking
|
|
24
24
|
// - if drag was cancelled returns undefined
|
|
@@ -16,9 +16,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _withDimensions = _interopRequireDefault(require("../../hoc/with-dimensions"));
|
|
17
17
|
var _helpers = require("../../internal/helpers");
|
|
18
18
|
var _tableCell = require("../../styled/rankable/table-cell");
|
|
19
|
-
var _excluded = ["content"];
|
|
19
|
+
var _excluded = ["content", "testId"];
|
|
20
20
|
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); }; }
|
|
21
|
-
function _isNativeReflectConstruct() {
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
22
|
var RankableTableCell = exports.RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
23
23
|
(0, _inherits2.default)(RankableTableCell, _React$Component);
|
|
24
24
|
var _super = _createSuper(RankableTableCell);
|
|
@@ -38,6 +38,7 @@ var RankableTableCell = exports.RankableTableCell = /*#__PURE__*/function (_Reac
|
|
|
38
38
|
innerRef = _this$props.innerRef,
|
|
39
39
|
testId = _this$props.testId;
|
|
40
40
|
var content = cell.content,
|
|
41
|
+
cellTestId = cell.testId,
|
|
41
42
|
restCellProps = (0, _objectWithoutProperties2.default)(cell, _excluded);
|
|
42
43
|
var _ref = head || {},
|
|
43
44
|
shouldTruncate = _ref.shouldTruncate,
|
|
@@ -53,7 +54,7 @@ var RankableTableCell = exports.RankableTableCell = /*#__PURE__*/function (_Reac
|
|
|
53
54
|
return e.stopPropagation();
|
|
54
55
|
},
|
|
55
56
|
innerRef: innerRef,
|
|
56
|
-
"data-testid": testId && "".concat(testId, "--rankable--table--body--cell")
|
|
57
|
+
"data-testid": cellTestId || testId && "".concat(testId, "--rankable--table--body--cell")
|
|
57
58
|
}), content);
|
|
58
59
|
}
|
|
59
60
|
}]);
|
|
@@ -18,7 +18,7 @@ var _helpers = require("../../internal/helpers");
|
|
|
18
18
|
var _tableHeadCell = _interopRequireDefault(require("../table-head-cell"));
|
|
19
19
|
var _excluded = ["isRanking", "refHeight", "refWidth"];
|
|
20
20
|
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); }; }
|
|
21
|
-
function _isNativeReflectConstruct() {
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
22
|
var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
23
23
|
(0, _inherits2.default)(RankableTableHeadCell, _React$Component);
|
|
24
24
|
var _super = _createSuper(RankableTableHeadCell);
|
|
@@ -24,7 +24,7 @@ var _excluded = ["cells", "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); }; }
|
|
27
|
-
function _isNativeReflectConstruct() {
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // Allowing existing usage of non Pragmatic drag and drop solution
|
|
28
28
|
// eslint-disable-next-line @atlaskit/design-system/no-unsupported-drag-and-drop-libraries
|
|
29
29
|
var RankableTableRow = exports.RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
30
30
|
(0, _inherits2.default)(RankableTableRow, _React$Component);
|
|
@@ -17,7 +17,7 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
|
17
17
|
var _helpers = require("../internal/helpers");
|
|
18
18
|
var _stateless = _interopRequireDefault(require("./stateless"));
|
|
19
19
|
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); }; }
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
21
|
/**
|
|
22
22
|
* __Dynamic Table__
|
|
23
23
|
*
|
|
@@ -30,12 +30,12 @@ var _loadingContainerAdvanced = _interopRequireDefault(require("./loading-contai
|
|
|
30
30
|
var _managedPagination = _interopRequireDefault(require("./managed-pagination"));
|
|
31
31
|
var _tableHead = _interopRequireDefault(require("./table-head"));
|
|
32
32
|
var _excluded = ["isRankable", "isRanking", "onRankStart", "onRankEnd", "isRankingDisabled"];
|
|
33
|
-
function _getRequireWildcardCache(
|
|
34
|
-
function _interopRequireWildcard(
|
|
33
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
34
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
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
|
-
function _isNativeReflectConstruct() {
|
|
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.
|
|
38
|
+
var packageVersion = "14.15.0";
|
|
39
39
|
function toggleSortOrder(currentSortOrder) {
|
|
40
40
|
switch (currentSortOrder) {
|
|
41
41
|
case _constants.DESC:
|
|
@@ -20,7 +20,7 @@ var _tableHeadCell2 = _interopRequireDefault(require("./table-head-cell"));
|
|
|
20
20
|
var _excluded = ["cells"],
|
|
21
21
|
_excluded2 = ["colSpan", "content", "isSortable", "key", "shouldTruncate", "testId", "width"];
|
|
22
22
|
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); }; }
|
|
23
|
-
function _isNativeReflectConstruct() {
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
24
|
var TableHead = /*#__PURE__*/function (_React$Component) {
|
|
25
25
|
(0, _inherits2.default)(TableHead, _React$Component);
|
|
26
26
|
var _super = _createSuper(TableHead);
|
|
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _tableCell = require("../styled/table-cell");
|
|
12
12
|
var _tableRow = require("../styled/table-row");
|
|
13
13
|
var _excluded = ["cells"],
|
|
14
|
-
_excluded2 = ["content"];
|
|
14
|
+
_excluded2 = ["content", "testId"];
|
|
15
15
|
var Row = function Row(_ref) {
|
|
16
16
|
var row = _ref.row,
|
|
17
17
|
head = _ref.head,
|
|
@@ -28,6 +28,7 @@ var Row = function Row(_ref) {
|
|
|
28
28
|
testId: testId && "".concat(testId, "--row-").concat(restRowProps.key)
|
|
29
29
|
}), cells.map(function (cell, cellIndex) {
|
|
30
30
|
var content = cell.content,
|
|
31
|
+
cellTestId = cell.testId,
|
|
31
32
|
restCellProps = (0, _objectWithoutProperties2.default)(cell, _excluded2);
|
|
32
33
|
var _ref2 = (head || {
|
|
33
34
|
cells: []
|
|
@@ -35,7 +36,7 @@ var Row = function Row(_ref) {
|
|
|
35
36
|
shouldTruncate = _ref2.shouldTruncate,
|
|
36
37
|
width = _ref2.width;
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_tableCell.TableBodyCell, (0, _extends2.default)({
|
|
38
|
-
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex)
|
|
39
|
+
"data-testid": cellTestId || testId && "".concat(testId, "--cell-").concat(cellIndex)
|
|
39
40
|
}, restCellProps, {
|
|
40
41
|
isFixedSize: isFixedSize,
|
|
41
42
|
key: cellIndex // eslint-disable-line react/no-array-index-key
|
|
@@ -15,7 +15,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
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); }; }
|
|
18
|
-
function _isNativeReflectConstruct() {
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
19
|
// Compute height and width of wrapped component before ranking
|
|
20
20
|
function withDimensions(WrappedComponent) {
|
|
21
21
|
return /*#__PURE__*/function (_React$Component) {
|
|
@@ -22,7 +22,7 @@ var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page",
|
|
|
22
22
|
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; }
|
|
23
23
|
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; }
|
|
24
24
|
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); }; }
|
|
25
|
-
function _isNativeReflectConstruct() {
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
26
|
var getSortingCellValue = function getSortingCellValue(cells, head, sortKey) {
|
|
27
27
|
for (var i = 0; i < cells.length; i++) {
|
|
28
28
|
var _head$cells$i;
|
package/dist/cjs/theme.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.tableBorder = exports.row = exports.head = exports.arrow = exports.MSThemeColors = void 0;
|
|
8
8
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
var MSThemeColors = exports.MSThemeColors = {
|
|
12
12
|
Background: 'Canvas',
|
|
13
13
|
Text: 'CanvasText',
|
|
@@ -16,6 +16,7 @@ export class RankableTableCell extends React.Component {
|
|
|
16
16
|
} = this.props;
|
|
17
17
|
const {
|
|
18
18
|
content,
|
|
19
|
+
testId: cellTestId,
|
|
19
20
|
...restCellProps
|
|
20
21
|
} = cell;
|
|
21
22
|
const {
|
|
@@ -31,7 +32,7 @@ export class RankableTableCell extends React.Component {
|
|
|
31
32
|
style: inlineStyles,
|
|
32
33
|
onKeyDown: e => e.stopPropagation(),
|
|
33
34
|
innerRef: innerRef,
|
|
34
|
-
"data-testid": testId && `${testId}--rankable--table--body--cell`
|
|
35
|
+
"data-testid": cellTestId || testId && `${testId}--rankable--table--body--cell`
|
|
35
36
|
}), content);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -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.
|
|
17
|
+
const packageVersion = "14.15.0";
|
|
18
18
|
function toggleSortOrder(currentSortOrder) {
|
|
19
19
|
switch (currentSortOrder) {
|
|
20
20
|
case DESC:
|
|
@@ -22,6 +22,7 @@ const Row = ({
|
|
|
22
22
|
}), cells.map((cell, cellIndex) => {
|
|
23
23
|
const {
|
|
24
24
|
content,
|
|
25
|
+
testId: cellTestId,
|
|
25
26
|
...restCellProps
|
|
26
27
|
} = cell;
|
|
27
28
|
const {
|
|
@@ -31,7 +32,7 @@ const Row = ({
|
|
|
31
32
|
cells: []
|
|
32
33
|
}).cells[cellIndex] || {};
|
|
33
34
|
return /*#__PURE__*/React.createElement(TableBodyCell, _extends({
|
|
34
|
-
"data-testid": testId && `${testId}--cell-${cellIndex}`
|
|
35
|
+
"data-testid": cellTestId || testId && `${testId}--cell-${cellIndex}`
|
|
35
36
|
}, restCellProps, {
|
|
36
37
|
isFixedSize: isFixedSize,
|
|
37
38
|
key: cellIndex // eslint-disable-line react/no-array-index-key
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
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); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import withSortedPageRows from '../hoc/with-sorted-page-rows';
|
|
11
11
|
import TableRow from './table-row';
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
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); }; }
|
|
7
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
10
10
|
_inherits(ErrorBoundary, _React$Component);
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -5,7 +5,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
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); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|
|
11
11
|
import { LARGE, LOADING_CONTENTS_OPACITY } from '../internal/constants';
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import Pagination from '@atlaskit/pagination';
|
|
13
13
|
var ManagedPagination = /*#__PURE__*/function (_React$Component) {
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
13
|
// Allowing existing usage of non Pragmatic drag and drop solution
|
|
@@ -5,9 +5,9 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
var _excluded = ["content"];
|
|
8
|
+
var _excluded = ["content", "testId"];
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import withDimensions from '../../hoc/with-dimensions';
|
|
13
13
|
import { inlineStylesIfRanking } from '../../internal/helpers';
|
|
@@ -31,6 +31,7 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
31
31
|
innerRef = _this$props.innerRef,
|
|
32
32
|
testId = _this$props.testId;
|
|
33
33
|
var content = cell.content,
|
|
34
|
+
cellTestId = cell.testId,
|
|
34
35
|
restCellProps = _objectWithoutProperties(cell, _excluded);
|
|
35
36
|
var _ref = head || {},
|
|
36
37
|
shouldTruncate = _ref.shouldTruncate,
|
|
@@ -46,7 +47,7 @@ export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
|
46
47
|
return e.stopPropagation();
|
|
47
48
|
},
|
|
48
49
|
innerRef: innerRef,
|
|
49
|
-
"data-testid": testId && "".concat(testId, "--rankable--table--body--cell")
|
|
50
|
+
"data-testid": cellTestId || testId && "".concat(testId, "--rankable--table--body--cell")
|
|
50
51
|
}), content);
|
|
51
52
|
}
|
|
52
53
|
}]);
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
var _excluded = ["isRanking", "refHeight", "refWidth"];
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import withDimensions from '../../hoc/with-dimensions';
|
|
13
13
|
import { inlineStylesIfRanking } from '../../internal/helpers';
|
|
@@ -11,7 +11,7 @@ var _excluded = ["cells", "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); }; }
|
|
14
|
-
function _isNativeReflectConstruct() {
|
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
15
|
import React from 'react';
|
|
16
16
|
|
|
17
17
|
// Allowing existing usage of non Pragmatic drag and drop solution
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
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); }; }
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
12
12
|
import { reorderRows } from '../internal/helpers';
|
|
@@ -10,7 +10,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
11
|
var _excluded = ["isRankable", "isRanking", "onRankStart", "onRankEnd", "isRankingDisabled"];
|
|
12
12
|
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); }; }
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React, { forwardRef, lazy, Suspense, useEffect, useState } from 'react';
|
|
15
15
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
16
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -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.
|
|
28
|
+
var packageVersion = "14.15.0";
|
|
29
29
|
function toggleSortOrder(currentSortOrder) {
|
|
30
30
|
switch (currentSortOrder) {
|
|
31
31
|
case DESC:
|
|
@@ -8,7 +8,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
var _excluded = ["cells"],
|
|
9
9
|
_excluded2 = ["colSpan", "content", "isSortable", "key", "shouldTruncate", "testId", "width"];
|
|
10
10
|
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); }; }
|
|
11
|
-
function _isNativeReflectConstruct() {
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { validateSortKey } from '../internal/helpers';
|
|
14
14
|
import { Head } from '../styled/table-head';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["cells"],
|
|
4
|
-
_excluded2 = ["content"];
|
|
4
|
+
_excluded2 = ["content", "testId"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { TableBodyCell } from '../styled/table-cell';
|
|
7
7
|
import { TableBodyRow } from '../styled/table-row';
|
|
@@ -21,6 +21,7 @@ var Row = function Row(_ref) {
|
|
|
21
21
|
testId: testId && "".concat(testId, "--row-").concat(restRowProps.key)
|
|
22
22
|
}), cells.map(function (cell, cellIndex) {
|
|
23
23
|
var content = cell.content,
|
|
24
|
+
cellTestId = cell.testId,
|
|
24
25
|
restCellProps = _objectWithoutProperties(cell, _excluded2);
|
|
25
26
|
var _ref2 = (head || {
|
|
26
27
|
cells: []
|
|
@@ -28,7 +29,7 @@ var Row = function Row(_ref) {
|
|
|
28
29
|
shouldTruncate = _ref2.shouldTruncate,
|
|
29
30
|
width = _ref2.width;
|
|
30
31
|
return /*#__PURE__*/React.createElement(TableBodyCell, _extends({
|
|
31
|
-
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex)
|
|
32
|
+
"data-testid": cellTestId || testId && "".concat(testId, "--cell-").concat(cellIndex)
|
|
32
33
|
}, restCellProps, {
|
|
33
34
|
isFixedSize: isFixedSize,
|
|
34
35
|
key: cellIndex // eslint-disable-line react/no-array-index-key
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
import React from 'react';
|
|
12
12
|
// Compute height and width of wrapped component before ranking
|
|
13
13
|
export default function withDimensions(WrappedComponent) {
|
|
@@ -12,7 +12,7 @@ var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page",
|
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
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); }; }
|
|
15
|
-
function _isNativeReflectConstruct() {
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import { ASC } from '../internal/constants';
|
|
18
18
|
import { getPageRows, validateSortKey } from '../internal/helpers';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ export interface I18nShape {
|
|
|
42
42
|
}
|
|
43
43
|
export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
44
44
|
/**
|
|
45
|
-
* Caption for the table styled as a heading.
|
|
45
|
+
* Caption for the table styled as a heading. This appears before the table header, and is announced when people who use assistive technology land on the table.
|
|
46
|
+
* If you don’t want the caption to appear on the page but do want it to be available for assistive technology, surround the caption with `<VisuallyHidden>`.
|
|
46
47
|
*/
|
|
47
48
|
caption?: React.ReactNode;
|
|
48
49
|
/**
|
|
@@ -62,8 +63,8 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
62
63
|
*/
|
|
63
64
|
emptyView?: React.ReactElement<any>;
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
-
* Defaults to `"large"` when a page has more than two rows,
|
|
66
|
+
* Sets the size of the loading spinner when `isLoading` is true.
|
|
67
|
+
* Defaults to `"large"` when a page has more than two rows, otherwise it will be `"small"`.
|
|
67
68
|
*/
|
|
68
69
|
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
69
70
|
/**
|
|
@@ -75,7 +76,7 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
75
76
|
*/
|
|
76
77
|
loadingLabel?: string;
|
|
77
78
|
/**
|
|
78
|
-
*
|
|
79
|
+
* Use this to force columns to use their initial width regardless of the size of the content that loads in.
|
|
79
80
|
*/
|
|
80
81
|
isFixedSize?: boolean;
|
|
81
82
|
/**
|
|
@@ -87,21 +88,20 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
87
88
|
*/
|
|
88
89
|
totalRows?: number;
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
91
|
+
* A callback that happens when the table page has changed.
|
|
92
|
+
* Use this when you want to control the pagination of the table.
|
|
92
93
|
*/
|
|
93
94
|
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
94
95
|
/**
|
|
95
|
-
*
|
|
96
|
-
* useful when wanting to control the sort order of the table.
|
|
96
|
+
* A callback that happens when a column heading has been sorted. Use this to provide custom sorting for the table.
|
|
97
97
|
*/
|
|
98
98
|
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* A callback that happens when the rows displayed on a page have changed.
|
|
101
101
|
*/
|
|
102
102
|
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
103
103
|
/**
|
|
104
|
-
* Page the table should show. Set by default to 1, so never undefined.
|
|
104
|
+
* Page the table should show. Set by default to 1, so that it's never undefined.
|
|
105
105
|
*/
|
|
106
106
|
page?: number;
|
|
107
107
|
/**
|
|
@@ -114,29 +114,29 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
114
114
|
*/
|
|
115
115
|
sortOrder?: SortOrderType;
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Use this to enable drag and drop sorting of table rows.
|
|
118
118
|
*/
|
|
119
119
|
isRankable?: boolean;
|
|
120
120
|
/**
|
|
121
121
|
* Disables being able to drop rows on the table.
|
|
122
|
-
*
|
|
122
|
+
* We recommend using `isRankable` instead of this prop, and it will be deprecated in a future release.
|
|
123
123
|
*/
|
|
124
124
|
isRankingDisabled?: boolean;
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* A callback that happens when a drag of a row has started.
|
|
127
127
|
*/
|
|
128
128
|
onRankStart?: (rankStart: RankStart) => void;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* A callback that happens when a drop of a row has completed.
|
|
131
131
|
*/
|
|
132
132
|
onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
133
133
|
/**
|
|
134
134
|
* Labels for the pagination wrapper, previous and next buttons used in pagination.
|
|
135
|
-
* Defaults to `"
|
|
135
|
+
* Defaults to `"Page"`, `"Pagination"`, `"Previous"` and `"Next"`.
|
|
136
136
|
*/
|
|
137
137
|
paginationi18n?: I18nShape;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Use this to set which rows will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
140
140
|
*/
|
|
141
141
|
highlightedRowIndex?: number | number[];
|
|
142
142
|
/**
|
|
@@ -156,19 +156,20 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
156
156
|
*/
|
|
157
157
|
testId?: string;
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* allows a custom message like "Entering
|
|
159
|
+
* If you don’t use a caption, then you’ll need to use label to describe the table for assistive technologies.
|
|
160
|
+
* Avoid using both at the same time as they may conflict.
|
|
161
|
+
* Rather than a screen reader speaking "Entering table", passing in an label allows a custom message like "Entering Jira Issues table".
|
|
162
162
|
*/
|
|
163
163
|
label?: string;
|
|
164
164
|
}
|
|
165
165
|
export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
166
166
|
/**
|
|
167
|
-
* Caption for the table styled as a heading.
|
|
167
|
+
* Caption for the table styled as a heading. This appears before the table header, and is announced when people who use assistive technology land on the table.
|
|
168
|
+
* If you don’t want the caption to appear on the page but do want it to be available for assistive technology, surround the caption with `<VisuallyHidden>`.
|
|
168
169
|
*/
|
|
169
170
|
caption?: React.ReactNode;
|
|
170
171
|
/**
|
|
171
|
-
* Cells to be placed in the head of the table.
|
|
172
|
+
* Cells to be placed in the head of the table. Never put controls, like links and buttons in the table header.
|
|
172
173
|
* Each element in the head creates a new column.
|
|
173
174
|
*/
|
|
174
175
|
head?: HeadType;
|
|
@@ -193,54 +194,51 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
193
194
|
*/
|
|
194
195
|
isLoading?: boolean;
|
|
195
196
|
/**
|
|
196
|
-
*
|
|
197
|
+
* Use this to set a label for assistive technology that describes the loading state.
|
|
198
|
+
* The default label is "Loading table". You can customize this to be more specific to your table, for example “Loading issue table”.
|
|
197
199
|
*/
|
|
198
200
|
loadingLabel?: string;
|
|
199
201
|
/**
|
|
200
|
-
*
|
|
202
|
+
* Use this to force columns to use their initial width regardless of the size of the content that loads in.
|
|
201
203
|
*/
|
|
202
204
|
isFixedSize?: boolean;
|
|
203
205
|
/**
|
|
204
|
-
*
|
|
206
|
+
* Use this to control how many rows should be displayed per page. If the number of rows exceed one page, this will enable pagination.
|
|
205
207
|
*/
|
|
206
208
|
rowsPerPage?: number;
|
|
207
209
|
/**
|
|
208
|
-
*
|
|
209
|
-
* useful when wanting to control dynamic table.
|
|
210
|
+
* A callback that happens when the table page has changed.
|
|
210
211
|
*/
|
|
211
212
|
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
212
213
|
/**
|
|
213
|
-
*
|
|
214
|
-
* useful when wanting to control dynamic table.
|
|
214
|
+
* A callback that happens when a column heading has been sorted. Use this to provide custom sorting.
|
|
215
215
|
*/
|
|
216
216
|
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
218
|
+
* A callback that happens when the rows displayed on a page have changed.
|
|
219
219
|
*/
|
|
220
220
|
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
221
221
|
/**
|
|
222
222
|
* Page the table should show.
|
|
223
|
-
* Useful when wanting to control dynamic table.
|
|
224
223
|
*/
|
|
225
224
|
page?: number;
|
|
226
225
|
/**
|
|
227
|
-
*
|
|
226
|
+
* When the table is initially rendered, use this to set which page number is shown by default.
|
|
227
|
+
* In most circumstances, people will expect this to be page `1`.
|
|
228
228
|
*/
|
|
229
229
|
defaultPage?: number;
|
|
230
230
|
/**
|
|
231
231
|
* Column key that the rows should be sorted by.
|
|
232
232
|
* Corresponds to the `key`'s defined in the `head` prop.
|
|
233
|
-
* Useful when wanting to control dynamic table.
|
|
234
233
|
*/
|
|
235
234
|
sortKey?: string;
|
|
236
235
|
/**
|
|
237
|
-
*
|
|
236
|
+
* Sets which column the rows should be sorted by when the table is initially rendered.
|
|
238
237
|
* Corresponds to the `key`'s defined in the `head` prop.
|
|
239
238
|
*/
|
|
240
239
|
defaultSortKey?: string;
|
|
241
240
|
/**
|
|
242
241
|
* Column sort order.
|
|
243
|
-
* Useful when wanting to control dynamic table.
|
|
244
242
|
*/
|
|
245
243
|
sortOrder?: SortOrderType;
|
|
246
244
|
/**
|
|
@@ -249,29 +247,29 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
249
247
|
*/
|
|
250
248
|
defaultSortOrder?: SortOrderType;
|
|
251
249
|
/**
|
|
252
|
-
*
|
|
250
|
+
* Use this to enable drag and drop sorting of table rows.
|
|
253
251
|
*/
|
|
254
252
|
isRankable?: boolean;
|
|
255
253
|
/**
|
|
256
254
|
* Disables being able to drop rows on the table.
|
|
257
|
-
*
|
|
255
|
+
* We recommend using `isRankable` instead of this prop, and it will be deprecated in a future release.
|
|
258
256
|
*/
|
|
259
257
|
isRankingDisabled?: boolean;
|
|
260
258
|
/**
|
|
261
|
-
*
|
|
259
|
+
* A callback that happens when a drag of a row has started.
|
|
262
260
|
*/
|
|
263
261
|
onRankStart?: (rankStart: RankStart) => void;
|
|
264
262
|
/**
|
|
265
|
-
*
|
|
263
|
+
* A callback that happens when a drop of a row has completed.
|
|
266
264
|
*/
|
|
267
265
|
onRankEnd?: (rankEnd: RankEnd) => void;
|
|
268
266
|
/**
|
|
269
267
|
* Labels for the previous and next buttons used in pagination.
|
|
270
|
-
* Defaults to `"
|
|
268
|
+
* Defaults to `"Previous"` and `"Next"`.
|
|
271
269
|
*/
|
|
272
270
|
paginationi18n?: I18nShape;
|
|
273
271
|
/**
|
|
274
|
-
*
|
|
272
|
+
* Use this to set if the row will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
275
273
|
*/
|
|
276
274
|
highlightedRowIndex?: number | number[];
|
|
277
275
|
/**
|
|
@@ -290,9 +288,9 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
290
288
|
*/
|
|
291
289
|
testId?: string;
|
|
292
290
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* allows a custom message like "Entering
|
|
291
|
+
* If you don’t use a caption, then you’ll need to use label to describe the table for assistive technologies.
|
|
292
|
+
* Avoid using both at the same time as they may conflict.
|
|
293
|
+
* Rather than a screen reader speaking "Entering table", passing in an label allows a custom message like "Entering Jira Issues table".
|
|
296
294
|
*/
|
|
297
295
|
label?: string;
|
|
298
296
|
}
|
|
@@ -308,7 +306,7 @@ export interface RowType extends React.ComponentPropsWithoutRef<'tr'> {
|
|
|
308
306
|
*/
|
|
309
307
|
onKeyPress?: React.KeyboardEventHandler;
|
|
310
308
|
/**
|
|
311
|
-
*
|
|
309
|
+
* Use this to set if the row will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
312
310
|
*/
|
|
313
311
|
isHighlighted?: boolean;
|
|
314
312
|
/**
|
|
@@ -337,7 +335,7 @@ export interface HeadCellType extends RowCellType {
|
|
|
337
335
|
*/
|
|
338
336
|
width?: number;
|
|
339
337
|
/**
|
|
340
|
-
* Whether the text in the cell will truncate or not if constrained.
|
|
338
|
+
* Whether the text in the cell will truncate or not if constrained. Avoid truncating content wherever possible.
|
|
341
339
|
*/
|
|
342
340
|
shouldTruncate?: boolean;
|
|
343
341
|
}
|
|
@@ -42,7 +42,8 @@ export interface I18nShape {
|
|
|
42
42
|
}
|
|
43
43
|
export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
44
44
|
/**
|
|
45
|
-
* Caption for the table styled as a heading.
|
|
45
|
+
* Caption for the table styled as a heading. This appears before the table header, and is announced when people who use assistive technology land on the table.
|
|
46
|
+
* If you don’t want the caption to appear on the page but do want it to be available for assistive technology, surround the caption with `<VisuallyHidden>`.
|
|
46
47
|
*/
|
|
47
48
|
caption?: React.ReactNode;
|
|
48
49
|
/**
|
|
@@ -62,8 +63,8 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
62
63
|
*/
|
|
63
64
|
emptyView?: React.ReactElement<any>;
|
|
64
65
|
/**
|
|
65
|
-
*
|
|
66
|
-
* Defaults to `"large"` when a page has more than two rows,
|
|
66
|
+
* Sets the size of the loading spinner when `isLoading` is true.
|
|
67
|
+
* Defaults to `"large"` when a page has more than two rows, otherwise it will be `"small"`.
|
|
67
68
|
*/
|
|
68
69
|
loadingSpinnerSize?: LoadingSpinnerSizeType;
|
|
69
70
|
/**
|
|
@@ -75,7 +76,7 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
75
76
|
*/
|
|
76
77
|
loadingLabel?: string;
|
|
77
78
|
/**
|
|
78
|
-
*
|
|
79
|
+
* Use this to force columns to use their initial width regardless of the size of the content that loads in.
|
|
79
80
|
*/
|
|
80
81
|
isFixedSize?: boolean;
|
|
81
82
|
/**
|
|
@@ -87,21 +88,20 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
87
88
|
*/
|
|
88
89
|
totalRows?: number;
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
91
|
+
* A callback that happens when the table page has changed.
|
|
92
|
+
* Use this when you want to control the pagination of the table.
|
|
92
93
|
*/
|
|
93
94
|
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
94
95
|
/**
|
|
95
|
-
*
|
|
96
|
-
* useful when wanting to control the sort order of the table.
|
|
96
|
+
* A callback that happens when a column heading has been sorted. Use this to provide custom sorting for the table.
|
|
97
97
|
*/
|
|
98
98
|
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* A callback that happens when the rows displayed on a page have changed.
|
|
101
101
|
*/
|
|
102
102
|
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
103
103
|
/**
|
|
104
|
-
* Page the table should show. Set by default to 1, so never undefined.
|
|
104
|
+
* Page the table should show. Set by default to 1, so that it's never undefined.
|
|
105
105
|
*/
|
|
106
106
|
page?: number;
|
|
107
107
|
/**
|
|
@@ -114,29 +114,29 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
114
114
|
*/
|
|
115
115
|
sortOrder?: SortOrderType;
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Use this to enable drag and drop sorting of table rows.
|
|
118
118
|
*/
|
|
119
119
|
isRankable?: boolean;
|
|
120
120
|
/**
|
|
121
121
|
* Disables being able to drop rows on the table.
|
|
122
|
-
*
|
|
122
|
+
* We recommend using `isRankable` instead of this prop, and it will be deprecated in a future release.
|
|
123
123
|
*/
|
|
124
124
|
isRankingDisabled?: boolean;
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* A callback that happens when a drag of a row has started.
|
|
127
127
|
*/
|
|
128
128
|
onRankStart?: (rankStart: RankStart) => void;
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* A callback that happens when a drop of a row has completed.
|
|
131
131
|
*/
|
|
132
132
|
onRankEnd?: (rankEnd: RankEnd, uiAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
133
133
|
/**
|
|
134
134
|
* Labels for the pagination wrapper, previous and next buttons used in pagination.
|
|
135
|
-
* Defaults to `"
|
|
135
|
+
* Defaults to `"Page"`, `"Pagination"`, `"Previous"` and `"Next"`.
|
|
136
136
|
*/
|
|
137
137
|
paginationi18n?: I18nShape;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Use this to set which rows will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
140
140
|
*/
|
|
141
141
|
highlightedRowIndex?: number | number[];
|
|
142
142
|
/**
|
|
@@ -156,19 +156,20 @@ export interface StatelessProps extends WithAnalyticsEventsProps {
|
|
|
156
156
|
*/
|
|
157
157
|
testId?: string;
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* allows a custom message like "Entering
|
|
159
|
+
* If you don’t use a caption, then you’ll need to use label to describe the table for assistive technologies.
|
|
160
|
+
* Avoid using both at the same time as they may conflict.
|
|
161
|
+
* Rather than a screen reader speaking "Entering table", passing in an label allows a custom message like "Entering Jira Issues table".
|
|
162
162
|
*/
|
|
163
163
|
label?: string;
|
|
164
164
|
}
|
|
165
165
|
export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
166
166
|
/**
|
|
167
|
-
* Caption for the table styled as a heading.
|
|
167
|
+
* Caption for the table styled as a heading. This appears before the table header, and is announced when people who use assistive technology land on the table.
|
|
168
|
+
* If you don’t want the caption to appear on the page but do want it to be available for assistive technology, surround the caption with `<VisuallyHidden>`.
|
|
168
169
|
*/
|
|
169
170
|
caption?: React.ReactNode;
|
|
170
171
|
/**
|
|
171
|
-
* Cells to be placed in the head of the table.
|
|
172
|
+
* Cells to be placed in the head of the table. Never put controls, like links and buttons in the table header.
|
|
172
173
|
* Each element in the head creates a new column.
|
|
173
174
|
*/
|
|
174
175
|
head?: HeadType;
|
|
@@ -193,54 +194,51 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
193
194
|
*/
|
|
194
195
|
isLoading?: boolean;
|
|
195
196
|
/**
|
|
196
|
-
*
|
|
197
|
+
* Use this to set a label for assistive technology that describes the loading state.
|
|
198
|
+
* The default label is "Loading table". You can customize this to be more specific to your table, for example “Loading issue table”.
|
|
197
199
|
*/
|
|
198
200
|
loadingLabel?: string;
|
|
199
201
|
/**
|
|
200
|
-
*
|
|
202
|
+
* Use this to force columns to use their initial width regardless of the size of the content that loads in.
|
|
201
203
|
*/
|
|
202
204
|
isFixedSize?: boolean;
|
|
203
205
|
/**
|
|
204
|
-
*
|
|
206
|
+
* Use this to control how many rows should be displayed per page. If the number of rows exceed one page, this will enable pagination.
|
|
205
207
|
*/
|
|
206
208
|
rowsPerPage?: number;
|
|
207
209
|
/**
|
|
208
|
-
*
|
|
209
|
-
* useful when wanting to control dynamic table.
|
|
210
|
+
* A callback that happens when the table page has changed.
|
|
210
211
|
*/
|
|
211
212
|
onSetPage?: (page: number, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
212
213
|
/**
|
|
213
|
-
*
|
|
214
|
-
* useful when wanting to control dynamic table.
|
|
214
|
+
* A callback that happens when a column heading has been sorted. Use this to provide custom sorting.
|
|
215
215
|
*/
|
|
216
216
|
onSort?: (data: any, UIAnalyticsEvent?: UIAnalyticsEvent) => void;
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
218
|
+
* A callback that happens when the rows displayed on a page have changed.
|
|
219
219
|
*/
|
|
220
220
|
onPageRowsUpdate?: (pageRows: Array<RowType>) => void;
|
|
221
221
|
/**
|
|
222
222
|
* Page the table should show.
|
|
223
|
-
* Useful when wanting to control dynamic table.
|
|
224
223
|
*/
|
|
225
224
|
page?: number;
|
|
226
225
|
/**
|
|
227
|
-
*
|
|
226
|
+
* When the table is initially rendered, use this to set which page number is shown by default.
|
|
227
|
+
* In most circumstances, people will expect this to be page `1`.
|
|
228
228
|
*/
|
|
229
229
|
defaultPage?: number;
|
|
230
230
|
/**
|
|
231
231
|
* Column key that the rows should be sorted by.
|
|
232
232
|
* Corresponds to the `key`'s defined in the `head` prop.
|
|
233
|
-
* Useful when wanting to control dynamic table.
|
|
234
233
|
*/
|
|
235
234
|
sortKey?: string;
|
|
236
235
|
/**
|
|
237
|
-
*
|
|
236
|
+
* Sets which column the rows should be sorted by when the table is initially rendered.
|
|
238
237
|
* Corresponds to the `key`'s defined in the `head` prop.
|
|
239
238
|
*/
|
|
240
239
|
defaultSortKey?: string;
|
|
241
240
|
/**
|
|
242
241
|
* Column sort order.
|
|
243
|
-
* Useful when wanting to control dynamic table.
|
|
244
242
|
*/
|
|
245
243
|
sortOrder?: SortOrderType;
|
|
246
244
|
/**
|
|
@@ -249,29 +247,29 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
249
247
|
*/
|
|
250
248
|
defaultSortOrder?: SortOrderType;
|
|
251
249
|
/**
|
|
252
|
-
*
|
|
250
|
+
* Use this to enable drag and drop sorting of table rows.
|
|
253
251
|
*/
|
|
254
252
|
isRankable?: boolean;
|
|
255
253
|
/**
|
|
256
254
|
* Disables being able to drop rows on the table.
|
|
257
|
-
*
|
|
255
|
+
* We recommend using `isRankable` instead of this prop, and it will be deprecated in a future release.
|
|
258
256
|
*/
|
|
259
257
|
isRankingDisabled?: boolean;
|
|
260
258
|
/**
|
|
261
|
-
*
|
|
259
|
+
* A callback that happens when a drag of a row has started.
|
|
262
260
|
*/
|
|
263
261
|
onRankStart?: (rankStart: RankStart) => void;
|
|
264
262
|
/**
|
|
265
|
-
*
|
|
263
|
+
* A callback that happens when a drop of a row has completed.
|
|
266
264
|
*/
|
|
267
265
|
onRankEnd?: (rankEnd: RankEnd) => void;
|
|
268
266
|
/**
|
|
269
267
|
* Labels for the previous and next buttons used in pagination.
|
|
270
|
-
* Defaults to `"
|
|
268
|
+
* Defaults to `"Previous"` and `"Next"`.
|
|
271
269
|
*/
|
|
272
270
|
paginationi18n?: I18nShape;
|
|
273
271
|
/**
|
|
274
|
-
*
|
|
272
|
+
* Use this to set if the row will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
275
273
|
*/
|
|
276
274
|
highlightedRowIndex?: number | number[];
|
|
277
275
|
/**
|
|
@@ -290,9 +288,9 @@ export interface StatefulProps extends WithAnalyticsEventsProps {
|
|
|
290
288
|
*/
|
|
291
289
|
testId?: string;
|
|
292
290
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* allows a custom message like "Entering
|
|
291
|
+
* If you don’t use a caption, then you’ll need to use label to describe the table for assistive technologies.
|
|
292
|
+
* Avoid using both at the same time as they may conflict.
|
|
293
|
+
* Rather than a screen reader speaking "Entering table", passing in an label allows a custom message like "Entering Jira Issues table".
|
|
296
294
|
*/
|
|
297
295
|
label?: string;
|
|
298
296
|
}
|
|
@@ -308,7 +306,7 @@ export interface RowType extends React.ComponentPropsWithoutRef<'tr'> {
|
|
|
308
306
|
*/
|
|
309
307
|
onKeyPress?: React.KeyboardEventHandler;
|
|
310
308
|
/**
|
|
311
|
-
*
|
|
309
|
+
* Use this to set if the row will be highlighted. Never use highlighted rows to indicate that a person has selected or focused on the row.
|
|
312
310
|
*/
|
|
313
311
|
isHighlighted?: boolean;
|
|
314
312
|
/**
|
|
@@ -337,7 +335,7 @@ export interface HeadCellType extends RowCellType {
|
|
|
337
335
|
*/
|
|
338
336
|
width?: number;
|
|
339
337
|
/**
|
|
340
|
-
* Whether the text in the cell will truncate or not if constrained.
|
|
338
|
+
* Whether the text in the cell will truncate or not if constrained. Avoid truncating content wherever possible.
|
|
341
339
|
*/
|
|
342
340
|
shouldTruncate?: boolean;
|
|
343
341
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dynamic-table",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.15.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/"
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@atlaskit/analytics-next": "^9.
|
|
43
|
+
"@atlaskit/analytics-next": "^9.2.0",
|
|
44
44
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
45
|
-
"@atlaskit/pagination": "^14.
|
|
45
|
+
"@atlaskit/pagination": "^14.6.0",
|
|
46
46
|
"@atlaskit/spinner": "^16.0.0",
|
|
47
47
|
"@atlaskit/theme": "^12.6.0",
|
|
48
|
-
"@atlaskit/tokens": "^1.
|
|
48
|
+
"@atlaskit/tokens": "^1.41.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"react-beautiful-dnd": "^12.1.1"
|