@atlaskit/dynamic-table 14.6.0 → 14.7.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 +27 -0
- package/dist/cjs/components/{Body.js → body.js} +3 -3
- package/dist/cjs/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +3 -3
- package/dist/cjs/components/{LoadingContainer.js → loading-container.js} +3 -3
- package/dist/cjs/components/rankable/{Body.js → body.js} +3 -3
- package/dist/cjs/components/rankable/{TableCell.js → table-cell.js} +3 -3
- package/dist/cjs/components/rankable/{TableHeadCell.js → table-head-cell.js} +3 -3
- package/dist/cjs/components/rankable/{TableRow.js → table-row.js} +5 -5
- package/dist/cjs/components/{Stateful.js → stateful.js} +6 -4
- package/dist/cjs/components/{Stateless.js → stateless.js} +32 -23
- package/dist/cjs/components/{TableHeadCell.js → table-head-cell.js} +5 -3
- package/dist/cjs/components/{TableHead.js → table-head.js} +7 -6
- package/dist/cjs/components/{TableRow.js → table-row.js} +6 -5
- package/dist/cjs/hoc/{withDimensions.js → with-dimensions.js} +0 -0
- package/dist/cjs/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/styled/constants.js +2 -2
- package/dist/cjs/styled/{DynamicTable.js → dynamic-table.js} +19 -25
- package/dist/cjs/styled/{EmptyBody.js → empty-body.js} +4 -2
- package/dist/cjs/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +10 -6
- package/dist/cjs/styled/{LoadingContainer.js → loading-container.js} +5 -3
- package/dist/cjs/styled/rankable/{RowPlaceholder.js → row-placeholder.js} +6 -4
- package/dist/cjs/styled/rankable/{TableCell.js → table-cell.js} +5 -4
- package/dist/cjs/styled/rankable/{TableRow.js → table-row.js} +10 -9
- package/dist/cjs/styled/{TableCell.js → table-cell.js} +3 -1
- package/dist/cjs/styled/{TableHead.js → table-head.js} +73 -95
- package/dist/cjs/styled/{TableRow.js → table-row.js} +7 -6
- package/dist/cjs/theme.js +13 -40
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/{Body.js → body.js} +2 -2
- package/dist/es2019/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +3 -1
- package/dist/es2019/components/{LoadingContainer.js → loading-container.js} +1 -1
- package/dist/es2019/components/rankable/{Body.js → body.js} +2 -2
- package/dist/es2019/components/rankable/{TableCell.js → table-cell.js} +2 -2
- package/dist/es2019/components/rankable/{TableHeadCell.js → table-head-cell.js} +2 -2
- package/dist/es2019/components/rankable/{TableRow.js → table-row.js} +3 -3
- package/dist/es2019/components/{Stateful.js → stateful.js} +4 -3
- package/dist/es2019/components/{Stateless.js → stateless.js} +24 -16
- package/dist/es2019/components/{TableHeadCell.js → table-head-cell.js} +4 -2
- package/dist/es2019/components/{TableHead.js → table-head.js} +5 -4
- package/dist/es2019/components/{TableRow.js → table-row.js} +4 -3
- package/dist/es2019/hoc/{withDimensions.js → with-dimensions.js} +0 -0
- package/dist/es2019/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/styled/constants.js +4 -6
- package/dist/es2019/styled/{DynamicTable.js → dynamic-table.js} +24 -27
- package/dist/es2019/styled/{EmptyBody.js → empty-body.js} +4 -2
- package/dist/es2019/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +7 -4
- package/dist/es2019/styled/{LoadingContainer.js → loading-container.js} +5 -3
- package/dist/es2019/styled/rankable/row-placeholder.js +12 -0
- package/dist/es2019/styled/rankable/{TableCell.js → table-cell.js} +5 -3
- package/dist/es2019/styled/rankable/{TableRow.js → table-row.js} +9 -8
- package/dist/es2019/styled/{TableCell.js → table-cell.js} +4 -2
- package/dist/es2019/styled/table-head.js +138 -0
- package/dist/es2019/styled/{TableRow.js → table-row.js} +3 -2
- package/dist/es2019/theme.js +10 -37
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/{Body.js → body.js} +2 -2
- package/dist/esm/components/{LoadingContainerAdvanced.js → loading-container-advanced.js} +2 -1
- package/dist/esm/components/{LoadingContainer.js → loading-container.js} +1 -1
- package/dist/esm/components/rankable/{Body.js → body.js} +2 -2
- package/dist/esm/components/rankable/{TableCell.js → table-cell.js} +2 -2
- package/dist/esm/components/rankable/{TableHeadCell.js → table-head-cell.js} +2 -2
- package/dist/esm/components/rankable/{TableRow.js → table-row.js} +3 -3
- package/dist/esm/components/{Stateful.js → stateful.js} +4 -3
- package/dist/esm/components/{Stateless.js → stateless.js} +24 -16
- package/dist/esm/components/{TableHeadCell.js → table-head-cell.js} +4 -2
- package/dist/esm/components/{TableHead.js → table-head.js} +5 -4
- package/dist/esm/components/{TableRow.js → table-row.js} +4 -3
- package/dist/esm/hoc/{withDimensions.js → with-dimensions.js} +0 -0
- package/dist/esm/hoc/{withSortedPageRows.js → with-sorted-page-rows.js} +0 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/styled/constants.js +2 -2
- package/dist/esm/styled/{DynamicTable.js → dynamic-table.js} +22 -25
- package/dist/esm/styled/{EmptyBody.js → empty-body.js} +4 -2
- package/dist/esm/styled/{LoadingContainerAdvanced.js → loading-container-advanced.js} +10 -6
- package/dist/esm/styled/{LoadingContainer.js → loading-container.js} +5 -3
- package/dist/esm/styled/rankable/{RowPlaceholder.js → row-placeholder.js} +7 -4
- package/dist/esm/styled/rankable/{TableCell.js → table-cell.js} +5 -3
- package/dist/esm/styled/rankable/{TableRow.js → table-row.js} +9 -8
- package/dist/esm/styled/{TableCell.js → table-cell.js} +4 -2
- package/dist/esm/styled/{TableHead.js → table-head.js} +75 -94
- package/dist/esm/styled/{TableRow.js → table-row.js} +3 -2
- package/dist/esm/theme.js +10 -37
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/{Body.d.ts → body.d.ts} +23 -23
- package/dist/types/components/{LoadingContainerAdvanced.d.ts → loading-container-advanced.d.ts} +5 -5
- package/dist/types/components/{LoadingContainer.d.ts → loading-container.d.ts} +0 -0
- package/dist/types/components/rankable/body.d.ts +122 -0
- package/dist/types/components/rankable/table-cell.d.ts +14 -0
- package/dist/types/components/rankable/table-head-cell.d.ts +5 -0
- package/dist/types/components/rankable/table-row.d.ts +18 -0
- package/dist/types/components/{Stateful.d.ts → stateful.d.ts} +3 -2
- package/dist/types/components/{Stateless.d.ts → stateless.d.ts} +11 -10
- package/dist/types/components/{TableHeadCell.d.ts → table-head-cell.d.ts} +2 -2
- package/dist/types/components/{TableHead.d.ts → table-head.d.ts} +3 -3
- package/dist/types/components/{TableRow.d.ts → table-row.d.ts} +2 -2
- package/dist/types/hoc/{withDimensions.d.ts → with-dimensions.d.ts} +0 -0
- package/dist/types/hoc/{withSortedPageRows.d.ts → with-sorted-page-rows.d.ts} +23 -23
- package/dist/types/index.d.ts +2 -2
- package/dist/types/styled/constants.d.ts +2 -2
- package/dist/types/styled/{DynamicTable.d.ts → dynamic-table.d.ts} +2 -1
- package/dist/types/styled/{EmptyBody.d.ts → empty-body.d.ts} +0 -0
- package/dist/types/styled/{LoadingContainerAdvanced.d.ts → loading-container-advanced.d.ts} +1 -1
- package/dist/types/styled/{LoadingContainer.d.ts → loading-container.d.ts} +0 -0
- package/dist/types/styled/rankable/{RowPlaceholder.d.ts → row-placeholder.d.ts} +0 -0
- package/dist/types/styled/rankable/{TableCell.d.ts → table-cell.d.ts} +0 -0
- package/dist/types/styled/rankable/{TableRow.d.ts → table-row.d.ts} +1 -1
- package/dist/types/styled/{TableCell.d.ts → table-cell.d.ts} +0 -0
- package/dist/types/styled/{TableHead.d.ts → table-head.d.ts} +1 -3
- package/dist/types/styled/{TableRow.d.ts → table-row.d.ts} +0 -0
- package/dist/types/theme.d.ts +10 -9
- package/dist/types/types.d.ts +37 -33
- package/package.json +9 -5
- package/report.api.md +508 -0
- package/dist/es2019/styled/TableHead.js +0 -160
- package/dist/es2019/styled/rankable/RowPlaceholder.js +0 -10
- package/dist/types/components/rankable/Body.d.ts +0 -122
- package/dist/types/components/rankable/TableCell.d.ts +0 -14
- package/dist/types/components/rankable/TableHeadCell.d.ts +0 -5
- package/dist/types/components/rankable/TableRow.d.ts +0 -18
package/dist/es2019/version.json
CHANGED
|
@@ -9,8 +9,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import withSortedPageRows from '../hoc/
|
|
13
|
-
import TableRow from './
|
|
12
|
+
import withSortedPageRows from '../hoc/with-sorted-page-rows';
|
|
13
|
+
import TableRow from './table-row';
|
|
14
14
|
|
|
15
15
|
var Body = /*#__PURE__*/function (_React$Component) {
|
|
16
16
|
_inherits(Body, _React$Component);
|
|
@@ -11,11 +11,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
|
+
/* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import { findDOMNode } from 'react-dom';
|
|
16
17
|
import Spinner from '@atlaskit/spinner';
|
|
17
18
|
import { LARGE, LOADING_CONTENTS_OPACITY } from '../internal/constants';
|
|
18
|
-
import { Container, SpinnerBackdrop, SpinnerContainer } from '../styled/
|
|
19
|
+
import { Container, SpinnerBackdrop, SpinnerContainer } from '../styled/loading-container-advanced';
|
|
19
20
|
|
|
20
21
|
// there is a bug with findDOMNode and Suspense in React < 16.9: https://github.com/facebook/react/issues/14188
|
|
21
22
|
var safeFindDOMNode = function safeFindDOMNode(component) {
|
|
@@ -12,7 +12,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import Spinner from '@atlaskit/spinner';
|
|
14
14
|
import { LARGE, LOADING_CONTENTS_OPACITY } from '../internal/constants';
|
|
15
|
-
import { Container, ContentsContainer, SpinnerContainer } from '../styled/
|
|
15
|
+
import { Container, ContentsContainer, SpinnerContainer } from '../styled/loading-container';
|
|
16
16
|
|
|
17
17
|
var LoadingContainer = /*#__PURE__*/function (_React$Component) {
|
|
18
18
|
_inherits(LoadingContainer, _React$Component);
|
|
@@ -13,8 +13,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
|
16
|
-
import withSortedPageRows from '../../hoc/
|
|
17
|
-
import TableRow from './
|
|
16
|
+
import withSortedPageRows from '../../hoc/with-sorted-page-rows';
|
|
17
|
+
import TableRow from './table-row';
|
|
18
18
|
|
|
19
19
|
// computes destination of ranking
|
|
20
20
|
// - if drag was cancelled returns undefined
|
|
@@ -12,9 +12,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import withDimensions from '../../hoc/
|
|
15
|
+
import withDimensions from '../../hoc/with-dimensions';
|
|
16
16
|
import { inlineStylesIfRanking } from '../../internal/helpers';
|
|
17
|
-
import { RankableTableBodyCell } from '../../styled/rankable/
|
|
17
|
+
import { RankableTableBodyCell } from '../../styled/rankable/table-cell';
|
|
18
18
|
export var RankableTableCell = /*#__PURE__*/function (_React$Component) {
|
|
19
19
|
_inherits(RankableTableCell, _React$Component);
|
|
20
20
|
|
|
@@ -12,9 +12,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import withDimensions from '../../hoc/
|
|
15
|
+
import withDimensions from '../../hoc/with-dimensions';
|
|
16
16
|
import { inlineStylesIfRanking } from '../../internal/helpers';
|
|
17
|
-
import HeadCell from '../
|
|
17
|
+
import HeadCell from '../table-head-cell';
|
|
18
18
|
|
|
19
19
|
var RankableTableHeadCell = /*#__PURE__*/function (_React$Component) {
|
|
20
20
|
_inherits(RankableTableHeadCell, _React$Component);
|
|
@@ -19,10 +19,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
19
19
|
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import { Draggable } from 'react-beautiful-dnd';
|
|
22
|
-
import withDimensions from '../../hoc/
|
|
22
|
+
import withDimensions from '../../hoc/with-dimensions';
|
|
23
23
|
import { inlineStylesIfRanking } from '../../internal/helpers';
|
|
24
|
-
import { RankableTableBodyRow } from '../../styled/rankable/
|
|
25
|
-
import TableCell from './
|
|
24
|
+
import { RankableTableBodyRow } from '../../styled/rankable/table-row';
|
|
25
|
+
import TableCell from './table-cell';
|
|
26
26
|
export var RankableTableRow = /*#__PURE__*/function (_React$Component) {
|
|
27
27
|
_inherits(RankableTableRow, _React$Component);
|
|
28
28
|
|
|
@@ -11,8 +11,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
14
15
|
import { reorderRows } from '../internal/helpers';
|
|
15
|
-
import DynamicTableStateless from './
|
|
16
|
+
import DynamicTableStateless from './stateless';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* __Dynamic Table__
|
|
@@ -198,8 +199,8 @@ _defineProperty(DynamicTable, "defaultProps", {
|
|
|
198
199
|
isLoading: false,
|
|
199
200
|
isFixedSize: false,
|
|
200
201
|
isRankable: false,
|
|
201
|
-
onSetPage:
|
|
202
|
-
onSort:
|
|
202
|
+
onSetPage: noop,
|
|
203
|
+
onSort: noop,
|
|
203
204
|
rowsPerPage: Infinity
|
|
204
205
|
});
|
|
205
206
|
|
|
@@ -13,18 +13,19 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
|
+
import noop from '@atlaskit/ds-lib/noop';
|
|
16
17
|
import { ASC, DESC, LARGE, SMALL } from '../internal/constants';
|
|
17
18
|
import { assertIsSortable, getPageRows, validateSortKey } from '../internal/helpers';
|
|
18
|
-
import { Caption, PaginationWrapper, Table } from '../styled/
|
|
19
|
-
import { EmptyViewContainer, EmptyViewWithFixedHeight } from '../styled/
|
|
20
|
-
import Body from './
|
|
21
|
-
import LoadingContainer from './
|
|
22
|
-
import LoadingContainerAdvanced from './
|
|
19
|
+
import { Caption, PaginationWrapper, Table } from '../styled/dynamic-table';
|
|
20
|
+
import { EmptyViewContainer, EmptyViewWithFixedHeight } from '../styled/empty-body';
|
|
21
|
+
import Body from './body';
|
|
22
|
+
import LoadingContainer from './loading-container';
|
|
23
|
+
import LoadingContainerAdvanced from './loading-container-advanced';
|
|
23
24
|
import ManagedPagination from './managed-pagination';
|
|
24
|
-
import RankableTableBody from './rankable/
|
|
25
|
-
import TableHead from './
|
|
25
|
+
import RankableTableBody from './rankable/body';
|
|
26
|
+
import TableHead from './table-head';
|
|
26
27
|
var packageName = "@atlaskit/dynamic-table";
|
|
27
|
-
var packageVersion = "14.
|
|
28
|
+
var packageVersion = "14.7.1";
|
|
28
29
|
|
|
29
30
|
function toggleSortOrder(currentSortOrder) {
|
|
30
31
|
switch (currentSortOrder) {
|
|
@@ -209,6 +210,9 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
209
210
|
totalPages = rowsLength && rowsPerPage ? Math.ceil(rowsLength / rowsPerPage) : 0;
|
|
210
211
|
}
|
|
211
212
|
|
|
213
|
+
totalPages = totalPages < 1 ? 1 : totalPages;
|
|
214
|
+
var getPageNumber = page > totalPages ? totalPages : page; // page! required, because typescript can't yet see defaultProps to know that this won't be undefined
|
|
215
|
+
|
|
212
216
|
var bodyProps = {
|
|
213
217
|
highlightedRowIndex: highlightedRowIndex,
|
|
214
218
|
rows: rows,
|
|
@@ -216,7 +220,7 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
216
220
|
sortKey: sortKey,
|
|
217
221
|
sortOrder: sortOrder,
|
|
218
222
|
rowsPerPage: rowsPerPage,
|
|
219
|
-
page:
|
|
223
|
+
page: getPageNumber,
|
|
220
224
|
isFixedSize: isFixedSize || false,
|
|
221
225
|
onPageRowsUpdate: onPageRowsUpdate,
|
|
222
226
|
isTotalPagesControlledExternally: isTotalPagesControlledExternally,
|
|
@@ -239,7 +243,8 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
239
243
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
240
244
|
isFixedSize: isFixedSize,
|
|
241
245
|
"data-testid": testId && "".concat(testId, "--table"),
|
|
242
|
-
"aria-label": label
|
|
246
|
+
"aria-label": label,
|
|
247
|
+
hasDataRow: rowsExist
|
|
243
248
|
}, !!caption && /*#__PURE__*/React.createElement(Caption, null, caption), head && /*#__PURE__*/React.createElement(TableHead, {
|
|
244
249
|
head: head,
|
|
245
250
|
onSort: this.onSort,
|
|
@@ -253,8 +258,11 @@ var DynamicTable = /*#__PURE__*/function (_React$Component) {
|
|
|
253
258
|
onRankStart: this.onRankStart,
|
|
254
259
|
onRankEnd: this.onRankEnd,
|
|
255
260
|
isRankingDisabled: isRankingDisabled || isLoading || false
|
|
256
|
-
})) : /*#__PURE__*/React.createElement(Body, bodyProps)))),
|
|
257
|
-
|
|
261
|
+
})) : /*#__PURE__*/React.createElement(Body, bodyProps)))), totalPages <= 1 ? null :
|
|
262
|
+
/*#__PURE__*/
|
|
263
|
+
// only show pagination if there's MORE than 1 page
|
|
264
|
+
React.createElement(PaginationWrapper, null, /*#__PURE__*/React.createElement(ManagedPagination, {
|
|
265
|
+
value: getPageNumber,
|
|
258
266
|
onChange: this.onSetPage,
|
|
259
267
|
total: totalPages,
|
|
260
268
|
i18n: paginationi18n,
|
|
@@ -274,13 +282,13 @@ _defineProperty(DynamicTable, "defaultProps", {
|
|
|
274
282
|
isLoading: false,
|
|
275
283
|
isFixedSize: false,
|
|
276
284
|
rowsPerPage: Infinity,
|
|
277
|
-
onSetPage:
|
|
278
|
-
onSort:
|
|
285
|
+
onSetPage: noop,
|
|
286
|
+
onSort: noop,
|
|
279
287
|
page: 1,
|
|
280
288
|
isRankable: false,
|
|
281
289
|
isRankingDisabled: false,
|
|
282
|
-
onRankStart:
|
|
283
|
-
onRankEnd:
|
|
290
|
+
onRankStart: noop,
|
|
291
|
+
onRankEnd: noop,
|
|
284
292
|
paginationi18n: {
|
|
285
293
|
prev: 'Prev',
|
|
286
294
|
next: 'Next',
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["content", "inlineStyles", "testId", "isRanking", "innerRef", "isSortable"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { HeadCell } from '../styled/
|
|
5
|
+
import { HeadCell } from '../styled/table-head';
|
|
6
6
|
|
|
7
7
|
var TableHeadCell = function TableHeadCell(_ref) {
|
|
8
8
|
var content = _ref.content,
|
|
@@ -17,11 +17,13 @@ var TableHeadCell = function TableHeadCell(_ref) {
|
|
|
17
17
|
style: inlineStyles,
|
|
18
18
|
"data-testid": testId && "".concat(testId, "--head--cell"),
|
|
19
19
|
ref: typeof innerRef !== 'string' ? innerRef : null // string refs must be discarded as LegacyRefs are not compatible with FC forwardRefs
|
|
20
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
20
21
|
|
|
21
22
|
}, rest, {
|
|
22
23
|
tabIndex: isSortable ? 0 : undefined,
|
|
23
24
|
isSortable: isSortable
|
|
24
25
|
}), /*#__PURE__*/React.createElement("span", null, content));
|
|
25
|
-
};
|
|
26
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
27
|
+
|
|
26
28
|
|
|
27
29
|
export default TableHeadCell;
|
|
@@ -16,9 +16,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
16
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import { validateSortKey } from '../internal/helpers';
|
|
19
|
-
import { Head } from '../styled/
|
|
20
|
-
import RankableHeadCell from './rankable/
|
|
21
|
-
import HeadCell from './
|
|
19
|
+
import { Head } from '../styled/table-head';
|
|
20
|
+
import RankableHeadCell from './rankable/table-head-cell';
|
|
21
|
+
import HeadCell from './table-head-cell';
|
|
22
22
|
|
|
23
23
|
var TableHead = /*#__PURE__*/function (_React$Component) {
|
|
24
24
|
_inherits(TableHead, _React$Component);
|
|
@@ -104,6 +104,7 @@ var TableHead = /*#__PURE__*/function (_React$Component) {
|
|
|
104
104
|
}]);
|
|
105
105
|
|
|
106
106
|
return TableHead;
|
|
107
|
-
}(React.Component);
|
|
107
|
+
}(React.Component); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
108
|
+
|
|
108
109
|
|
|
109
110
|
export default TableHead;
|
|
@@ -3,8 +3,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["cells"],
|
|
4
4
|
_excluded2 = ["content"];
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { TableBodyCell } from '../styled/
|
|
7
|
-
import { TableBodyRow } from '../styled/
|
|
6
|
+
import { TableBodyCell } from '../styled/table-cell';
|
|
7
|
+
import { TableBodyRow } from '../styled/table-row';
|
|
8
8
|
|
|
9
9
|
var Row = function Row(_ref) {
|
|
10
10
|
var row = _ref.row,
|
|
@@ -42,6 +42,7 @@ var Row = function Row(_ref) {
|
|
|
42
42
|
width: width
|
|
43
43
|
}), content);
|
|
44
44
|
}));
|
|
45
|
-
};
|
|
45
|
+
}; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
46
|
+
|
|
46
47
|
|
|
47
48
|
export default Row;
|
|
File without changes
|
|
File without changes
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './components/
|
|
2
|
-
export { default as DynamicTableStateless } from './components/
|
|
1
|
+
export { default } from './components/stateful';
|
|
2
|
+
export { default as DynamicTableStateless } from './components/stateless';
|
|
@@ -15,11 +15,11 @@ export var overflowTruncateStyles = css({
|
|
|
15
15
|
});
|
|
16
16
|
export var getTruncationStyleVars = function getTruncationStyleVars(_ref) {
|
|
17
17
|
var width = _ref.width;
|
|
18
|
-
return
|
|
18
|
+
return typeof width !== 'undefined' ? _defineProperty({}, CSS_VAR_WIDTH, "".concat(width, "%")) : undefined;
|
|
19
19
|
};
|
|
20
20
|
export var cellStyles = css({
|
|
21
|
-
border: 'none',
|
|
22
21
|
padding: "".concat(gridSize / 2, "px ").concat(gridSize, "px"),
|
|
22
|
+
border: 'none',
|
|
23
23
|
textAlign: 'left',
|
|
24
24
|
'&:first-of-type': {
|
|
25
25
|
paddingLeft: 0
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["isFixedSize", "children"];
|
|
4
|
+
var _excluded = ["isFixedSize", "hasDataRow", "children"];
|
|
5
|
+
|
|
6
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
5
7
|
|
|
6
8
|
/** @jsx jsx */
|
|
7
9
|
import { forwardRef } from 'react';
|
|
8
10
|
import { css, jsx } from '@emotion/core';
|
|
9
|
-
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
10
11
|
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
11
|
-
import { row } from '../theme';
|
|
12
|
+
import { row, tableBorder } from '../theme';
|
|
12
13
|
var gridSize = getGridSize();
|
|
13
14
|
// CSS vars for table row
|
|
14
15
|
// these are declared here to avoid being re-declared in each table row
|
|
@@ -22,46 +23,42 @@ var fixedSizeTableStyles = css({
|
|
|
22
23
|
tableLayout: 'fixed'
|
|
23
24
|
});
|
|
24
25
|
var tableStyles = css({
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
width: '100%',
|
|
27
|
+
borderCollapse: 'separate',
|
|
28
|
+
borderSpacing: '0px'
|
|
29
|
+
});
|
|
30
|
+
var bodyBorder = css({
|
|
31
|
+
borderBottom: "2px solid ".concat(tableBorder.borderColor)
|
|
27
32
|
});
|
|
28
33
|
export var Table = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
29
34
|
var _ref2;
|
|
30
35
|
|
|
31
36
|
var isFixedSize = _ref.isFixedSize,
|
|
37
|
+
hasDataRow = _ref.hasDataRow,
|
|
32
38
|
children = _ref.children,
|
|
33
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
40
|
|
|
35
|
-
var theme = useGlobalTheme();
|
|
36
41
|
return jsx("table", _extends({
|
|
37
|
-
style: (_ref2 = {}, _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, row.hoverBackground(
|
|
38
|
-
|
|
39
|
-
})), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, row.highlightedBackground({
|
|
40
|
-
theme: theme
|
|
41
|
-
})), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, row.hoverHighlightedBackground({
|
|
42
|
-
theme: theme
|
|
43
|
-
})), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_ROW_FOCUS_OUTLINE, row.focusOutline({
|
|
44
|
-
theme: theme
|
|
45
|
-
})), _ref2),
|
|
46
|
-
css: [tableStyles, isFixedSize && fixedSizeTableStyles],
|
|
42
|
+
style: (_ref2 = {}, _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_BACKGROUND, row.hoverBackground), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, row.highlightedBackground), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, row.hoverHighlightedBackground), _defineProperty(_ref2, tableRowCSSVars.CSS_VAR_ROW_FOCUS_OUTLINE, row.focusOutline), _ref2),
|
|
43
|
+
css: [tableStyles, isFixedSize && fixedSizeTableStyles, hasDataRow && bodyBorder],
|
|
47
44
|
ref: ref
|
|
48
45
|
}, rest), children);
|
|
49
46
|
});
|
|
50
47
|
var captionStyles = css({
|
|
48
|
+
marginTop: "".concat(gridSize * 3.5, "px"),
|
|
49
|
+
marginBottom: "".concat(gridSize, "px"),
|
|
51
50
|
fontSize: '1.42857143em',
|
|
52
|
-
|
|
53
|
-
/* there is a bug in Safari: if element which creates a new stacking context
|
|
54
|
-
is a child of a table, table caption re-renders in bad wrong position
|
|
55
|
-
https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom
|
|
56
|
-
*/
|
|
57
|
-
willChange: 'transform',
|
|
58
51
|
fontStyle: 'inherit',
|
|
59
52
|
fontWeight: 500,
|
|
60
53
|
letterSpacing: '-0.008em',
|
|
61
54
|
lineHeight: 1.2,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
textAlign: 'left',
|
|
56
|
+
|
|
57
|
+
/* there is a bug in Safari: if element which creates a new stacking context
|
|
58
|
+
is a child of a table, table caption re-renders in bad wrong position
|
|
59
|
+
https://stackoverflow.com/questions/44009186/safari-bug-translating-table-row-group-using-gsap-make-caption-jump-to-bottom
|
|
60
|
+
*/
|
|
61
|
+
willChange: 'transform'
|
|
65
62
|
});
|
|
66
63
|
export var Caption = function Caption(_ref3) {
|
|
67
64
|
var children = _ref3.children;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
2
|
+
|
|
1
3
|
/** @jsx jsx */
|
|
2
4
|
import { css, jsx } from '@emotion/core';
|
|
3
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -11,10 +13,10 @@ export var EmptyViewWithFixedHeight = function EmptyViewWithFixedHeight(_ref) {
|
|
|
11
13
|
}, children);
|
|
12
14
|
};
|
|
13
15
|
var emptyViewContainerStyles = css({
|
|
16
|
+
width: '50%',
|
|
14
17
|
margin: 'auto',
|
|
15
18
|
padding: '10px',
|
|
16
|
-
textAlign: 'center'
|
|
17
|
-
width: '50%'
|
|
19
|
+
textAlign: 'center'
|
|
18
20
|
});
|
|
19
21
|
export var EmptyViewContainer = function EmptyViewContainer(_ref2) {
|
|
20
22
|
var children = _ref2.children;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
4
|
+
|
|
3
5
|
/** @jsx jsx */
|
|
4
6
|
import { forwardRef } from 'react';
|
|
5
7
|
import { css, jsx } from '@emotion/core';
|
|
@@ -9,20 +11,22 @@ var containerStyles = css({
|
|
|
9
11
|
position: 'relative'
|
|
10
12
|
});
|
|
11
13
|
export var Container = function Container(props) {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
15
|
+
jsx("div", _extends({
|
|
16
|
+
css: containerStyles
|
|
17
|
+
}, props))
|
|
18
|
+
);
|
|
15
19
|
};
|
|
16
20
|
var spinnerBackdropStyles = css({
|
|
17
|
-
|
|
21
|
+
display: 'flex',
|
|
18
22
|
position: 'absolute',
|
|
19
23
|
top: 0,
|
|
20
24
|
right: 0,
|
|
21
25
|
bottom: 0,
|
|
22
26
|
left: 0,
|
|
23
|
-
display: 'flex',
|
|
24
27
|
alignItems: 'center',
|
|
25
|
-
justifyContent: 'center'
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
pointerEvents: 'none'
|
|
26
30
|
});
|
|
27
31
|
export var SpinnerBackdrop = function SpinnerBackdrop(_ref) {
|
|
28
32
|
var children = _ref.children;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
4
|
+
|
|
3
5
|
/** @jsx jsx */
|
|
4
6
|
import { css, jsx } from '@emotion/core';
|
|
5
7
|
var CSS_VAR_CONTENTS_OPACITY = '--contents-opacity';
|
|
@@ -13,8 +15,8 @@ export var Container = function Container(_ref) {
|
|
|
13
15
|
}, children);
|
|
14
16
|
};
|
|
15
17
|
var contentsContainerStyles = css({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
opacity: "var(".concat(CSS_VAR_CONTENTS_OPACITY, ")"),
|
|
19
|
+
pointerEvents: 'none'
|
|
18
20
|
});
|
|
19
21
|
export var ContentsContainer = function ContentsContainer(_ref2) {
|
|
20
22
|
var contentsOpacity = _ref2.contentsOpacity,
|
|
@@ -25,12 +27,12 @@ export var ContentsContainer = function ContentsContainer(_ref2) {
|
|
|
25
27
|
}, children);
|
|
26
28
|
};
|
|
27
29
|
var spinnerContainerStyles = css({
|
|
30
|
+
display: 'flex',
|
|
28
31
|
position: 'absolute',
|
|
29
32
|
top: 0,
|
|
30
33
|
right: 0,
|
|
31
34
|
bottom: 0,
|
|
32
35
|
left: 0,
|
|
33
|
-
display: 'flex',
|
|
34
36
|
alignItems: 'center',
|
|
35
37
|
justifyContent: 'center'
|
|
36
38
|
});
|
|
@@ -4,9 +4,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
var rowPlaceholderStyles = css({
|
|
6
6
|
padding: 0
|
|
7
|
-
});
|
|
7
|
+
}); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
8
|
+
|
|
8
9
|
export var RowPlaceholderCell = function RowPlaceholderCell(props) {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
return (// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
11
|
+
jsx("td", _extends({
|
|
12
|
+
css: rowPlaceholderStyles
|
|
13
|
+
}, props))
|
|
14
|
+
);
|
|
12
15
|
};
|
|
@@ -4,17 +4,19 @@ var _excluded = ["isRanking", "innerRef"];
|
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { css, jsx } from '@emotion/core';
|
|
7
|
-
import { TableBodyCell } from '../
|
|
7
|
+
import { TableBodyCell } from '../table-cell';
|
|
8
8
|
var rankingStyles = css({
|
|
9
9
|
boxSizing: 'border-box'
|
|
10
|
-
});
|
|
10
|
+
}); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
11
|
+
|
|
11
12
|
export var RankableTableBodyCell = function RankableTableBodyCell(_ref) {
|
|
12
13
|
var isRanking = _ref.isRanking,
|
|
13
14
|
innerRef = _ref.innerRef,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
|
|
16
17
|
return jsx(TableBodyCell, _extends({
|
|
17
|
-
css: isRanking && rankingStyles
|
|
18
|
+
css: isRanking && rankingStyles // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
19
|
+
|
|
18
20
|
}, props, {
|
|
19
21
|
innerRef: innerRef
|
|
20
22
|
}));
|
|
@@ -6,7 +6,7 @@ var _excluded = ["isRanking", "isRankingItem"];
|
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/core';
|
|
8
8
|
import { B100, N20, N50A, N60A } from '@atlaskit/theme/colors';
|
|
9
|
-
import { TableBodyRow } from '../
|
|
9
|
+
import { TableBodyRow } from '../table-row';
|
|
10
10
|
var rankingStyles = css({
|
|
11
11
|
display: 'block'
|
|
12
12
|
});
|
|
@@ -18,16 +18,17 @@ var elevationStyle = "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".conc
|
|
|
18
18
|
|
|
19
19
|
var rankingItemStyles = css({
|
|
20
20
|
backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
borderRadius: '2px',
|
|
22
|
+
boxShadow: elevationStyle
|
|
23
23
|
});
|
|
24
24
|
var draggableStyles = css({
|
|
25
|
+
outlineWidth: '2px',
|
|
25
26
|
'&:focus': {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
outlineColor: "var(--ds-border-focused, ".concat(B100, ")"),
|
|
28
|
+
outlineStyle: 'solid'
|
|
29
|
+
}
|
|
30
|
+
}); // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
31
|
+
|
|
31
32
|
export var RankableTableBodyRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
32
33
|
var isRanking = _ref.isRanking,
|
|
33
34
|
isRankingItem = _ref.isRankingItem,
|
|
@@ -4,7 +4,8 @@ var _excluded = ["width", "isFixedSize", "shouldTruncate", "innerRef"];
|
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
|
-
import { cellStyles, fixedSizeTruncateStyles, getTruncationStyleVars, overflowTruncateStyles, truncationWidthStyles } from './constants';
|
|
7
|
+
import { cellStyles, fixedSizeTruncateStyles, getTruncationStyleVars, overflowTruncateStyles, truncationWidthStyles } from './constants'; // eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
8
|
+
|
|
8
9
|
export var TableBodyCell = function TableBodyCell(_ref) {
|
|
9
10
|
var width = _ref.width,
|
|
10
11
|
isFixedSize = _ref.isFixedSize,
|
|
@@ -19,6 +20,7 @@ export var TableBodyCell = function TableBodyCell(_ref) {
|
|
|
19
20
|
css: [truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, cellStyles] // HOC withDimensions complains about the types but it is working fine
|
|
20
21
|
// @ts-ignore
|
|
21
22
|
,
|
|
22
|
-
ref: innerRef
|
|
23
|
+
ref: innerRef // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
24
|
+
|
|
23
25
|
}, props));
|
|
24
26
|
};
|