@atlaskit/dynamic-table 14.20.3 → 15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -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 +1 -1
- 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 +21 -41
- package/dist/cjs/components/table-head.js +1 -1
- 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 +1 -1
- package/dist/es2019/components/stateless.js +19 -40
- 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 +1 -1
- 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 +19 -40
- package/dist/esm/components/table-head.js +1 -1
- package/dist/esm/hoc/with-dimensions.js +1 -1
- package/dist/esm/hoc/with-sorted-page-rows.js +1 -1
- package/dist/types/components/stateless.d.ts +3 -13
- package/dist/types-ts4.5/components/stateless.d.ts +3 -13
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/dynamic-table
|
|
2
2
|
|
|
3
|
+
## 15.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#140090](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/140090)
|
|
8
|
+
[`2f4fd6db3e451`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f4fd6db3e451) -
|
|
9
|
+
Adds `@types/react-beautiful-dnd` which was previously missing
|
|
10
|
+
|
|
11
|
+
## 15.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [#137785](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137785)
|
|
16
|
+
[`5fee01201ba15`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5fee01201ba15) -
|
|
17
|
+
Removes usage of legacy analytics-next APIs internally in favor of the new APIs which do not
|
|
18
|
+
depend on legacy react context. This should not require any changes to consumers of the package,
|
|
19
|
+
however behaviors of the new APIs may result in different behavior in some cases.
|
|
20
|
+
|
|
3
21
|
## 14.20.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
14
14
|
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
|
-
function _createSuper(
|
|
17
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
18
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 BodyComponent = /*#__PURE__*/function (_React$Component) {
|
|
20
20
|
(0, _inherits2.default)(BodyComponent, _React$Component);
|
|
@@ -11,7 +11,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
function _createSuper(
|
|
14
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
15
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);
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
18
18
|
var _constants = require("../internal/constants");
|
|
19
19
|
var _loadingContainerAdvanced = require("../styled/loading-container-advanced");
|
|
20
|
-
function _createSuper(
|
|
20
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
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);
|
|
@@ -15,7 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
16
16
|
var _constants = require("../internal/constants");
|
|
17
17
|
var _loadingContainer = require("../styled/loading-container");
|
|
18
|
-
function _createSuper(
|
|
18
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
19
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);
|
|
@@ -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
|
var _pagination = _interopRequireDefault(require("@atlaskit/pagination"));
|
|
18
|
-
function _createSuper(
|
|
18
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
19
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);
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
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
|
-
function _createSuper(
|
|
20
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
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
|
|
@@ -17,7 +17,7 @@ var _withDimensions = _interopRequireDefault(require("../../hoc/with-dimensions"
|
|
|
17
17
|
var _helpers = require("../../internal/helpers");
|
|
18
18
|
var _tableCell = require("../../styled/rankable/table-cell");
|
|
19
19
|
var _excluded = ["content", "testId"];
|
|
20
|
-
function _createSuper(
|
|
20
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
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);
|
|
@@ -17,7 +17,7 @@ var _withDimensions = _interopRequireDefault(require("../../hoc/with-dimensions"
|
|
|
17
17
|
var _helpers = require("../../internal/helpers");
|
|
18
18
|
var _tableHeadCell = _interopRequireDefault(require("../table-head-cell"));
|
|
19
19
|
var _excluded = ["isRanking", "refHeight", "refWidth"];
|
|
20
|
-
function _createSuper(
|
|
20
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
21
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 RankableTableHeadCellComponent = /*#__PURE__*/function (_React$Component) {
|
|
23
23
|
(0, _inherits2.default)(RankableTableHeadCellComponent, _React$Component);
|
|
@@ -23,7 +23,7 @@ var _tableCell = _interopRequireDefault(require("./table-cell"));
|
|
|
23
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
|
-
function _createSuper(
|
|
26
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
27
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) {
|
|
@@ -16,7 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
17
17
|
var _helpers = require("../internal/helpers");
|
|
18
18
|
var _stateless = _interopRequireDefault(require("./stateless"));
|
|
19
|
-
function _createSuper(
|
|
19
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
20
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__
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -24,9 +24,7 @@ var _managedPagination = _interopRequireDefault(require("./managed-pagination"))
|
|
|
24
24
|
var _tableHead = _interopRequireDefault(require("./table-head"));
|
|
25
25
|
var _excluded = ["isRankable", "isRanking", "onRankStart", "onRankEnd", "isRankingDisabled"];
|
|
26
26
|
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); }
|
|
27
|
-
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 &&
|
|
28
|
-
var packageName = "@atlaskit/dynamic-table";
|
|
29
|
-
var packageVersion = "14.20.3";
|
|
27
|
+
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 && {}.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; }
|
|
30
28
|
function toggleSortOrder(currentSortOrder) {
|
|
31
29
|
switch (currentSortOrder) {
|
|
32
30
|
case _constants.DESC:
|
|
@@ -37,7 +35,7 @@ function toggleSortOrder(currentSortOrder) {
|
|
|
37
35
|
return currentSortOrder;
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
|
-
var DynamicTable =
|
|
38
|
+
var DynamicTable = function DynamicTable(_ref) {
|
|
41
39
|
var caption = _ref.caption,
|
|
42
40
|
head = _ref.head,
|
|
43
41
|
highlightedRowIndex = _ref.highlightedRowIndex,
|
|
@@ -58,7 +56,7 @@ var DynamicTable = exports.DynamicTableWithoutAnalytics = function DynamicTable(
|
|
|
58
56
|
_ref$onSetPage = _ref.onSetPage,
|
|
59
57
|
onSetPage = _ref$onSetPage === void 0 ? _noop.default : _ref$onSetPage,
|
|
60
58
|
_ref$onSort = _ref.onSort,
|
|
61
|
-
|
|
59
|
+
providedOnSort = _ref$onSort === void 0 ? _noop.default : _ref$onSort,
|
|
62
60
|
_ref$page = _ref.page,
|
|
63
61
|
page = _ref$page === void 0 ? 1 : _ref$page,
|
|
64
62
|
emptyView = _ref.emptyView,
|
|
@@ -69,7 +67,7 @@ var DynamicTable = exports.DynamicTableWithoutAnalytics = function DynamicTable(
|
|
|
69
67
|
_ref$onRankStart = _ref.onRankStart,
|
|
70
68
|
onRankStart = _ref$onRankStart === void 0 ? _noop.default : _ref$onRankStart,
|
|
71
69
|
_ref$onRankEnd = _ref.onRankEnd,
|
|
72
|
-
|
|
70
|
+
providedOnRankEnd = _ref$onRankEnd === void 0 ? _noop.default : _ref$onRankEnd,
|
|
73
71
|
loadingSpinnerSize = _ref.loadingSpinnerSize,
|
|
74
72
|
_ref$paginationi18n = _ref.paginationi18n,
|
|
75
73
|
paginationi18n = _ref$paginationi18n === void 0 ? {
|
|
@@ -83,6 +81,20 @@ var DynamicTable = exports.DynamicTableWithoutAnalytics = function DynamicTable(
|
|
|
83
81
|
isRanking = _useState2[0],
|
|
84
82
|
setIsRanking = _useState2[1];
|
|
85
83
|
var tableBodyRef = (0, _react.useRef)(null);
|
|
84
|
+
var onSort = (0, _analyticsNext.usePlatformLeafEventHandler)({
|
|
85
|
+
fn: providedOnSort,
|
|
86
|
+
action: 'sorted',
|
|
87
|
+
componentName: 'dynamicTable',
|
|
88
|
+
packageName: "@atlaskit/dynamic-table",
|
|
89
|
+
packageVersion: "15.0.1"
|
|
90
|
+
});
|
|
91
|
+
var onRankEnd = (0, _analyticsNext.usePlatformLeafEventHandler)({
|
|
92
|
+
fn: providedOnRankEnd,
|
|
93
|
+
action: 'ranked',
|
|
94
|
+
componentName: 'dynamicTable',
|
|
95
|
+
packageName: "@atlaskit/dynamic-table",
|
|
96
|
+
packageVersion: "15.0.1"
|
|
97
|
+
});
|
|
86
98
|
(0, _react.useEffect)(function () {
|
|
87
99
|
(0, _helpers.validateSortKey)(sortKey, head);
|
|
88
100
|
(0, _helpers.assertIsSortable)(head);
|
|
@@ -264,38 +276,6 @@ var TableBody = /*#__PURE__*/(0, _react.forwardRef)(function TableBody(_ref2, re
|
|
|
264
276
|
isRankingDisabled: isRankingDisabled
|
|
265
277
|
})))) : nonRankableBody;
|
|
266
278
|
});
|
|
267
|
-
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
268
279
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
* A stateless table that requires consumers to manage the sorting, drag and drop, and pagination.
|
|
273
|
-
*
|
|
274
|
-
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
275
|
-
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
276
|
-
*/
|
|
277
|
-
var DynamicTableStateless = (0, _analyticsNext.withAnalyticsContext)({
|
|
278
|
-
componentName: 'dynamicTable',
|
|
279
|
-
packageName: packageName,
|
|
280
|
-
packageVersion: packageVersion
|
|
281
|
-
})((0, _analyticsNext.withAnalyticsEvents)({
|
|
282
|
-
onSort: createAndFireEventOnAtlaskit({
|
|
283
|
-
action: 'sorted',
|
|
284
|
-
actionSubject: 'dynamicTable',
|
|
285
|
-
attributes: {
|
|
286
|
-
componentName: 'dynamicTable',
|
|
287
|
-
packageName: packageName,
|
|
288
|
-
packageVersion: packageVersion
|
|
289
|
-
}
|
|
290
|
-
}),
|
|
291
|
-
onRankEnd: createAndFireEventOnAtlaskit({
|
|
292
|
-
action: 'ranked',
|
|
293
|
-
actionSubject: 'dynamicTable',
|
|
294
|
-
attributes: {
|
|
295
|
-
componentName: 'dynamicTable',
|
|
296
|
-
packageName: packageName,
|
|
297
|
-
packageVersion: packageVersion
|
|
298
|
-
}
|
|
299
|
-
})
|
|
300
|
-
})(DynamicTable));
|
|
301
|
-
var _default = exports.default = DynamicTableStateless;
|
|
280
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
281
|
+
var _default = exports.default = DynamicTable;
|
|
@@ -19,7 +19,7 @@ var _tableHeadCell = _interopRequireDefault(require("./rankable/table-head-cell"
|
|
|
19
19
|
var _tableHeadCell2 = _interopRequireDefault(require("./table-head-cell"));
|
|
20
20
|
var _excluded = ["cells"],
|
|
21
21
|
_excluded2 = ["colSpan", "content", "isSortable", "key", "shouldTruncate", "testId", "width"];
|
|
22
|
-
function _createSuper(
|
|
22
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
23
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);
|
|
@@ -14,7 +14,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
function _createSuper(
|
|
17
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
18
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,7 +21,7 @@ var _helpers = require("../internal/helpers");
|
|
|
21
21
|
var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page", "forwardedRef"];
|
|
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
|
-
function _createSuper(
|
|
24
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
25
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++) {
|
package/dist/cjs/theme.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.tableBorder = exports.row = exports.head = exports.arrow = exports.MSThemeColors = void 0;
|
|
8
8
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
9
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 &&
|
|
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 && {}.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',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, lazy, Suspense, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { ASC, DESC, LARGE, SMALL } from '../internal/constants';
|
|
6
6
|
import { assertIsSortable, getPageRows, validateSortKey } from '../internal/helpers';
|
|
@@ -12,8 +12,6 @@ import LoadingContainer from './loading-container';
|
|
|
12
12
|
import LoadingContainerAdvanced from './loading-container-advanced';
|
|
13
13
|
import ManagedPagination from './managed-pagination';
|
|
14
14
|
import TableHead from './table-head';
|
|
15
|
-
const packageName = "@atlaskit/dynamic-table";
|
|
16
|
-
const packageVersion = "14.20.3";
|
|
17
15
|
function toggleSortOrder(currentSortOrder) {
|
|
18
16
|
switch (currentSortOrder) {
|
|
19
17
|
case DESC:
|
|
@@ -40,13 +38,13 @@ const DynamicTable = ({
|
|
|
40
38
|
isFixedSize = false,
|
|
41
39
|
rowsPerPage = Infinity,
|
|
42
40
|
onSetPage = noop,
|
|
43
|
-
onSort = noop,
|
|
41
|
+
onSort: providedOnSort = noop,
|
|
44
42
|
page = 1,
|
|
45
43
|
emptyView,
|
|
46
44
|
isRankable = false,
|
|
47
45
|
isRankingDisabled = false,
|
|
48
46
|
onRankStart = noop,
|
|
49
|
-
onRankEnd = noop,
|
|
47
|
+
onRankEnd: providedOnRankEnd = noop,
|
|
50
48
|
loadingSpinnerSize,
|
|
51
49
|
paginationi18n = {
|
|
52
50
|
prev: 'Previous',
|
|
@@ -57,6 +55,20 @@ const DynamicTable = ({
|
|
|
57
55
|
}) => {
|
|
58
56
|
const [isRanking, setIsRanking] = useState(false);
|
|
59
57
|
const tableBodyRef = useRef(null);
|
|
58
|
+
const onSort = usePlatformLeafEventHandler({
|
|
59
|
+
fn: providedOnSort,
|
|
60
|
+
action: 'sorted',
|
|
61
|
+
componentName: 'dynamicTable',
|
|
62
|
+
packageName: "@atlaskit/dynamic-table",
|
|
63
|
+
packageVersion: "15.0.1"
|
|
64
|
+
});
|
|
65
|
+
const onRankEnd = usePlatformLeafEventHandler({
|
|
66
|
+
fn: providedOnRankEnd,
|
|
67
|
+
action: 'ranked',
|
|
68
|
+
componentName: 'dynamicTable',
|
|
69
|
+
packageName: "@atlaskit/dynamic-table",
|
|
70
|
+
packageVersion: "15.0.1"
|
|
71
|
+
});
|
|
60
72
|
useEffect(() => {
|
|
61
73
|
validateSortKey(sortKey, head);
|
|
62
74
|
assertIsSortable(head);
|
|
@@ -229,39 +241,6 @@ const TableBody = /*#__PURE__*/forwardRef(function TableBody({
|
|
|
229
241
|
isRankingDisabled: isRankingDisabled
|
|
230
242
|
})))) : nonRankableBody;
|
|
231
243
|
});
|
|
232
|
-
export { DynamicTable as DynamicTableWithoutAnalytics };
|
|
233
|
-
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
234
244
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
*
|
|
238
|
-
* A stateless table that requires consumers to manage the sorting, drag and drop, and pagination.
|
|
239
|
-
*
|
|
240
|
-
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
241
|
-
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
242
|
-
*/
|
|
243
|
-
const DynamicTableStateless = withAnalyticsContext({
|
|
244
|
-
componentName: 'dynamicTable',
|
|
245
|
-
packageName,
|
|
246
|
-
packageVersion
|
|
247
|
-
})(withAnalyticsEvents({
|
|
248
|
-
onSort: createAndFireEventOnAtlaskit({
|
|
249
|
-
action: 'sorted',
|
|
250
|
-
actionSubject: 'dynamicTable',
|
|
251
|
-
attributes: {
|
|
252
|
-
componentName: 'dynamicTable',
|
|
253
|
-
packageName,
|
|
254
|
-
packageVersion
|
|
255
|
-
}
|
|
256
|
-
}),
|
|
257
|
-
onRankEnd: createAndFireEventOnAtlaskit({
|
|
258
|
-
action: 'ranked',
|
|
259
|
-
actionSubject: 'dynamicTable',
|
|
260
|
-
attributes: {
|
|
261
|
-
componentName: 'dynamicTable',
|
|
262
|
-
packageName,
|
|
263
|
-
packageVersion
|
|
264
|
-
}
|
|
265
|
-
})
|
|
266
|
-
})(DynamicTable));
|
|
267
|
-
export default DynamicTableStateless;
|
|
245
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
246
|
+
export default DynamicTable;
|
|
@@ -4,7 +4,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
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
|
-
function _createSuper(
|
|
7
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
8
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';
|
|
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
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
|
-
function _createSuper(
|
|
6
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
7
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) {
|
|
@@ -6,7 +6,7 @@ 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
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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';
|
|
@@ -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
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
function _createSuper(
|
|
7
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
8
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';
|
|
@@ -6,7 +6,7 @@ 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
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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';
|
|
@@ -6,7 +6,7 @@ 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
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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
|
|
|
@@ -6,7 +6,7 @@ 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
8
|
var _excluded = ["content", "testId"];
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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';
|
|
@@ -6,7 +6,7 @@ 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
8
|
var _excluded = ["isRanking", "refHeight", "refWidth"];
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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';
|
|
@@ -10,7 +10,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
10
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
|
-
function _createSuper(
|
|
13
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
14
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
|
|
|
@@ -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
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(
|
|
8
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
9
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';
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
var _excluded = ["isRankable", "isRanking", "onRankStart", "onRankEnd", "isRankingDisabled"];
|
|
5
5
|
import React, { forwardRef, lazy, Suspense, useEffect, useRef, useState } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
7
7
|
import noop from '@atlaskit/ds-lib/noop';
|
|
8
8
|
import { ASC, DESC, LARGE, SMALL } from '../internal/constants';
|
|
9
9
|
import { assertIsSortable, getPageRows, validateSortKey } from '../internal/helpers';
|
|
@@ -15,8 +15,6 @@ import LoadingContainer from './loading-container';
|
|
|
15
15
|
import LoadingContainerAdvanced from './loading-container-advanced';
|
|
16
16
|
import ManagedPagination from './managed-pagination';
|
|
17
17
|
import TableHead from './table-head';
|
|
18
|
-
var packageName = "@atlaskit/dynamic-table";
|
|
19
|
-
var packageVersion = "14.20.3";
|
|
20
18
|
function toggleSortOrder(currentSortOrder) {
|
|
21
19
|
switch (currentSortOrder) {
|
|
22
20
|
case DESC:
|
|
@@ -48,7 +46,7 @@ var DynamicTable = function DynamicTable(_ref) {
|
|
|
48
46
|
_ref$onSetPage = _ref.onSetPage,
|
|
49
47
|
onSetPage = _ref$onSetPage === void 0 ? noop : _ref$onSetPage,
|
|
50
48
|
_ref$onSort = _ref.onSort,
|
|
51
|
-
|
|
49
|
+
providedOnSort = _ref$onSort === void 0 ? noop : _ref$onSort,
|
|
52
50
|
_ref$page = _ref.page,
|
|
53
51
|
page = _ref$page === void 0 ? 1 : _ref$page,
|
|
54
52
|
emptyView = _ref.emptyView,
|
|
@@ -59,7 +57,7 @@ var DynamicTable = function DynamicTable(_ref) {
|
|
|
59
57
|
_ref$onRankStart = _ref.onRankStart,
|
|
60
58
|
onRankStart = _ref$onRankStart === void 0 ? noop : _ref$onRankStart,
|
|
61
59
|
_ref$onRankEnd = _ref.onRankEnd,
|
|
62
|
-
|
|
60
|
+
providedOnRankEnd = _ref$onRankEnd === void 0 ? noop : _ref$onRankEnd,
|
|
63
61
|
loadingSpinnerSize = _ref.loadingSpinnerSize,
|
|
64
62
|
_ref$paginationi18n = _ref.paginationi18n,
|
|
65
63
|
paginationi18n = _ref$paginationi18n === void 0 ? {
|
|
@@ -73,6 +71,20 @@ var DynamicTable = function DynamicTable(_ref) {
|
|
|
73
71
|
isRanking = _useState2[0],
|
|
74
72
|
setIsRanking = _useState2[1];
|
|
75
73
|
var tableBodyRef = useRef(null);
|
|
74
|
+
var onSort = usePlatformLeafEventHandler({
|
|
75
|
+
fn: providedOnSort,
|
|
76
|
+
action: 'sorted',
|
|
77
|
+
componentName: 'dynamicTable',
|
|
78
|
+
packageName: "@atlaskit/dynamic-table",
|
|
79
|
+
packageVersion: "15.0.1"
|
|
80
|
+
});
|
|
81
|
+
var onRankEnd = usePlatformLeafEventHandler({
|
|
82
|
+
fn: providedOnRankEnd,
|
|
83
|
+
action: 'ranked',
|
|
84
|
+
componentName: 'dynamicTable',
|
|
85
|
+
packageName: "@atlaskit/dynamic-table",
|
|
86
|
+
packageVersion: "15.0.1"
|
|
87
|
+
});
|
|
76
88
|
useEffect(function () {
|
|
77
89
|
validateSortKey(sortKey, head);
|
|
78
90
|
assertIsSortable(head);
|
|
@@ -252,39 +264,6 @@ var TableBody = /*#__PURE__*/forwardRef(function TableBody(_ref2, ref) {
|
|
|
252
264
|
isRankingDisabled: isRankingDisabled
|
|
253
265
|
})))) : nonRankableBody;
|
|
254
266
|
});
|
|
255
|
-
export { DynamicTable as DynamicTableWithoutAnalytics };
|
|
256
|
-
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
257
267
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
*
|
|
261
|
-
* A stateless table that requires consumers to manage the sorting, drag and drop, and pagination.
|
|
262
|
-
*
|
|
263
|
-
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
264
|
-
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
265
|
-
*/
|
|
266
|
-
var DynamicTableStateless = withAnalyticsContext({
|
|
267
|
-
componentName: 'dynamicTable',
|
|
268
|
-
packageName: packageName,
|
|
269
|
-
packageVersion: packageVersion
|
|
270
|
-
})(withAnalyticsEvents({
|
|
271
|
-
onSort: createAndFireEventOnAtlaskit({
|
|
272
|
-
action: 'sorted',
|
|
273
|
-
actionSubject: 'dynamicTable',
|
|
274
|
-
attributes: {
|
|
275
|
-
componentName: 'dynamicTable',
|
|
276
|
-
packageName: packageName,
|
|
277
|
-
packageVersion: packageVersion
|
|
278
|
-
}
|
|
279
|
-
}),
|
|
280
|
-
onRankEnd: createAndFireEventOnAtlaskit({
|
|
281
|
-
action: 'ranked',
|
|
282
|
-
actionSubject: 'dynamicTable',
|
|
283
|
-
attributes: {
|
|
284
|
-
componentName: 'dynamicTable',
|
|
285
|
-
packageName: packageName,
|
|
286
|
-
packageVersion: packageVersion
|
|
287
|
-
}
|
|
288
|
-
})
|
|
289
|
-
})(DynamicTable));
|
|
290
|
-
export default DynamicTableStateless;
|
|
268
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
269
|
+
export default DynamicTable;
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
var _excluded = ["cells"],
|
|
9
9
|
_excluded2 = ["colSpan", "content", "isSortable", "key", "shouldTruncate", "testId", "width"];
|
|
10
|
-
function _createSuper(
|
|
10
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
11
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';
|
|
@@ -6,7 +6,7 @@ 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
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(
|
|
9
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
10
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
|
|
@@ -11,7 +11,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
11
11
|
var _excluded = ["rows", "head", "sortKey", "sortOrder", "rowsPerPage", "page", "forwardedRef"];
|
|
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
|
-
function _createSuper(
|
|
14
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
15
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';
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type StatelessProps as Props } from '../types';
|
|
3
|
-
declare const DynamicTable: ({ caption, head, highlightedRowIndex, rows, sortKey, sortOrder, loadingLabel, onPageRowsUpdate, testId, totalRows: passedDownTotalRows, label, isLoading, isFixedSize, rowsPerPage, onSetPage, onSort, page, emptyView, isRankable, isRankingDisabled, onRankStart, onRankEnd, loadingSpinnerSize, paginationi18n, }: Props) => JSX.Element;
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
6
|
-
* __Dynamic table stateless__
|
|
7
|
-
*
|
|
8
|
-
* A stateless table that requires consumers to manage the sorting, drag and drop, and pagination.
|
|
9
|
-
*
|
|
10
|
-
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
11
|
-
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
12
|
-
*/
|
|
13
|
-
declare const DynamicTableStateless: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "isLoading" | "loadingLabel" | "isFixedSize" | "rowsPerPage" | "totalRows" | "onSetPage" | "onSort" | "onPageRowsUpdate" | "page" | "sortKey" | "sortOrder" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n" | "highlightedRowIndex" | "testId" | "label" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
14
|
-
export default DynamicTableStateless;
|
|
3
|
+
declare const DynamicTable: ({ caption, head, highlightedRowIndex, rows, sortKey, sortOrder, loadingLabel, onPageRowsUpdate, testId, totalRows: passedDownTotalRows, label, isLoading, isFixedSize, rowsPerPage, onSetPage, onSort: providedOnSort, page, emptyView, isRankable, isRankingDisabled, onRankStart, onRankEnd: providedOnRankEnd, loadingSpinnerSize, paginationi18n, }: Props) => JSX.Element;
|
|
4
|
+
export default DynamicTable;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { type StatelessProps as Props } from '../types';
|
|
3
|
-
declare const DynamicTable: ({ caption, head, highlightedRowIndex, rows, sortKey, sortOrder, loadingLabel, onPageRowsUpdate, testId, totalRows: passedDownTotalRows, label, isLoading, isFixedSize, rowsPerPage, onSetPage, onSort, page, emptyView, isRankable, isRankingDisabled, onRankStart, onRankEnd, loadingSpinnerSize, paginationi18n, }: Props) => JSX.Element;
|
|
4
|
-
export
|
|
5
|
-
/**
|
|
6
|
-
* __Dynamic table stateless__
|
|
7
|
-
*
|
|
8
|
-
* A stateless table that requires consumers to manage the sorting, drag and drop, and pagination.
|
|
9
|
-
*
|
|
10
|
-
* - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
|
|
11
|
-
* - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
|
|
12
|
-
*/
|
|
13
|
-
declare const DynamicTableStateless: React.ForwardRefExoticComponent<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "isLoading" | "loadingLabel" | "isFixedSize" | "rowsPerPage" | "totalRows" | "onSetPage" | "onSort" | "onPageRowsUpdate" | "page" | "sortKey" | "sortOrder" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n" | "highlightedRowIndex" | "testId" | "label" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
14
|
-
export default DynamicTableStateless;
|
|
3
|
+
declare const DynamicTable: ({ caption, head, highlightedRowIndex, rows, sortKey, sortOrder, loadingLabel, onPageRowsUpdate, testId, totalRows: passedDownTotalRows, label, isLoading, isFixedSize, rowsPerPage, onSetPage, onSort: providedOnSort, page, emptyView, isRankable, isRankingDisabled, onRankStart, onRankEnd: providedOnRankEnd, loadingSpinnerSize, paginationi18n, }: Props) => JSX.Element;
|
|
4
|
+
export default DynamicTable;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dynamic-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.1",
|
|
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/"
|
|
@@ -56,11 +56,12 @@
|
|
|
56
56
|
"@af/integration-testing": "*",
|
|
57
57
|
"@af/visual-regression": "*",
|
|
58
58
|
"@atlaskit/ssr": "*",
|
|
59
|
-
"@atlaskit/toggle": "^13.
|
|
59
|
+
"@atlaskit/toggle": "^13.4.0",
|
|
60
60
|
"@atlaskit/visual-regression": "*",
|
|
61
61
|
"@emotion/styled": "^11.0.0",
|
|
62
62
|
"@testing-library/react": "^12.1.5",
|
|
63
63
|
"@testing-library/user-event": "^14.4.3",
|
|
64
|
+
"@types/react-beautiful-dnd": "^12.2.1",
|
|
64
65
|
"react-dom": "^16.8.0",
|
|
65
66
|
"typescript": "~5.4.2"
|
|
66
67
|
},
|