@atlaskit/table 0.4.27 → 0.4.28
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 +7 -0
- package/dist/cjs/body.js +2 -5
- package/dist/cjs/expandable-cell.js +2 -5
- package/dist/cjs/row.js +4 -6
- package/dist/cjs/selectable-cell.js +2 -5
- package/dist/cjs/sortable-column.js +4 -3
- package/dist/cjs/table.js +2 -5
- package/dist/cjs/thead.js +7 -7
- package/dist/es2019/body.js +2 -2
- package/dist/es2019/expandable-cell.js +2 -2
- package/dist/es2019/row.js +4 -3
- package/dist/es2019/selectable-cell.js +2 -2
- package/dist/es2019/sortable-column.js +4 -3
- package/dist/es2019/table.js +2 -2
- package/dist/es2019/thead.js +7 -4
- package/dist/esm/body.js +2 -2
- package/dist/esm/expandable-cell.js +2 -2
- package/dist/esm/row.js +4 -3
- package/dist/esm/selectable-cell.js +2 -2
- package/dist/esm/sortable-column.js +4 -3
- package/dist/esm/table.js +2 -2
- package/dist/esm/thead.js +7 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/table
|
|
2
2
|
|
|
3
|
+
## 0.4.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#92007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92007) [`85525725cb0d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/85525725cb0d) - Migrated to the new button component
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 0.4.27
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/body.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -15,10 +14,8 @@ var _selectionProvider = require("./hooks/selection-provider");
|
|
|
15
14
|
var _useRowId = require("./hooks/use-row-id");
|
|
16
15
|
var _useTable2 = require("./hooks/use-table");
|
|
17
16
|
var _useTableBody = require("./hooks/use-table-body");
|
|
18
|
-
var
|
|
17
|
+
var _ui = require("./ui");
|
|
19
18
|
var _excluded = ["idx"];
|
|
20
|
-
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); }
|
|
21
|
-
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; }
|
|
22
19
|
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
20
|
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; } /* eslint-disable @repo/internal/react/no-clone-element */ /** @jsx jsx */
|
|
24
21
|
/**
|
|
@@ -57,7 +54,7 @@ function TBody(_ref) {
|
|
|
57
54
|
}, [rows, sortFn]);
|
|
58
55
|
return (0, _react2.jsx)(_useTableBody.TableBodyProvider, {
|
|
59
56
|
value: true
|
|
60
|
-
}, (0, _react2.jsx)(
|
|
57
|
+
}, (0, _react2.jsx)(_ui.TBody, null, typeof children === 'function' && sortedRows ? sortedRows.map(function (_ref2) {
|
|
61
58
|
var idx = _ref2.idx,
|
|
62
59
|
row = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
63
60
|
return (0, _react2.jsx)(_useRowId.RowProvider, {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -12,9 +11,7 @@ var _new = require("@atlaskit/button/new");
|
|
|
12
11
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-down"));
|
|
13
12
|
var _chevronUp = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-up"));
|
|
14
13
|
var _useExpand2 = _interopRequireDefault(require("./hooks/use-expand"));
|
|
15
|
-
var
|
|
16
|
-
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); }
|
|
17
|
-
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; }
|
|
14
|
+
var _expandableCell = require("./ui/expandable-cell");
|
|
18
15
|
/** @jsx jsx */
|
|
19
16
|
|
|
20
17
|
/**
|
|
@@ -30,7 +27,7 @@ var ExpandableCell = /*#__PURE__*/(0, _react.memo)(function () {
|
|
|
30
27
|
var handleClick = (0, _react.useCallback)(function () {
|
|
31
28
|
toggleExpanded();
|
|
32
29
|
}, [toggleExpanded]);
|
|
33
|
-
return (0, _react2.jsx)(
|
|
30
|
+
return (0, _react2.jsx)(_expandableCell.ExpandableCell, {
|
|
34
31
|
as: "td"
|
|
35
32
|
}, (0, _react2.jsx)(_new.IconButton, {
|
|
36
33
|
spacing: "compact",
|
package/dist/cjs/row.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -16,9 +15,8 @@ var _useRowId = require("./hooks/use-row-id");
|
|
|
16
15
|
var _useTable2 = require("./hooks/use-table");
|
|
17
16
|
var _useTableBody = require("./hooks/use-table-body");
|
|
18
17
|
var _selectableCell = _interopRequireDefault(require("./selectable-cell"));
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
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; }
|
|
18
|
+
var _selectableCell2 = require("./ui/selectable-cell");
|
|
19
|
+
var _tr = require("./ui/tr");
|
|
22
20
|
/** @jsx jsx */
|
|
23
21
|
|
|
24
22
|
/**
|
|
@@ -57,11 +55,11 @@ var Row = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
57
55
|
}
|
|
58
56
|
var selectableCell = isSelectable && (0, _react2.jsx)(_selectableCell.default, null);
|
|
59
57
|
if (isSelectable && isExpandableContent) {
|
|
60
|
-
selectableCell = (0, _react2.jsx)(
|
|
58
|
+
selectableCell = (0, _react2.jsx)(_selectableCell2.SelectableCell, {
|
|
61
59
|
as: "td"
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
|
-
return (0, _react2.jsx)(
|
|
62
|
+
return (0, _react2.jsx)(_tr.TR, {
|
|
65
63
|
isSelected: isSelected,
|
|
66
64
|
testId: testId,
|
|
67
65
|
isSubitem: isExpandableContent
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -13,9 +12,7 @@ var _checkbox = _interopRequireDefault(require("@atlaskit/checkbox"));
|
|
|
13
12
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
14
13
|
var _selectionProvider = require("./hooks/selection-provider");
|
|
15
14
|
var _useRowId = require("./hooks/use-row-id");
|
|
16
|
-
var
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
15
|
+
var _ui = require("./ui");
|
|
19
16
|
/** @jsx jsx */
|
|
20
17
|
|
|
21
18
|
var SelectableCell = function SelectableCell() {
|
|
@@ -32,7 +29,7 @@ var SelectableCell = function SelectableCell() {
|
|
|
32
29
|
var onChange = (0, _react.useCallback)(function (e) {
|
|
33
30
|
return toggleSelection === null || toggleSelection === void 0 ? void 0 : toggleSelection(idx, e.nativeEvent.shiftKey);
|
|
34
31
|
}, [idx, toggleSelection]);
|
|
35
|
-
return (0, _react2.jsx)(
|
|
32
|
+
return (0, _react2.jsx)(_ui.SelectableCell, {
|
|
36
33
|
as: "td"
|
|
37
34
|
}, (0, _react2.jsx)(_checkbox.default, {
|
|
38
35
|
isChecked: isChecked,
|
|
@@ -12,7 +12,8 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
13
13
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
14
14
|
var _useTable2 = require("./hooks/use-table");
|
|
15
|
-
var
|
|
15
|
+
var _sortIcon = require("./ui/sort-icon");
|
|
16
|
+
var _th = require("./ui/th");
|
|
16
17
|
var _excluded = ["name", "testId", "onClick", "children"];
|
|
17
18
|
/* eslint-disable no-unused-vars */
|
|
18
19
|
/** @jsx jsx */
|
|
@@ -68,7 +69,7 @@ var SortableColumn = function SortableColumn(_ref) {
|
|
|
68
69
|
function () {
|
|
69
70
|
return setSortState(name);
|
|
70
71
|
}, [setSortState, name]);
|
|
71
|
-
return (0, _react2.jsx)(
|
|
72
|
+
return (0, _react2.jsx)(_th.TH, (0, _extends2.default)({
|
|
72
73
|
testId: testId,
|
|
73
74
|
sortDirection: sortKey === name ? sortDirection : 'none'
|
|
74
75
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -80,7 +81,7 @@ var SortableColumn = function SortableColumn(_ref) {
|
|
|
80
81
|
testId: "".concat(testId, "--button"),
|
|
81
82
|
spacing: "compact",
|
|
82
83
|
appearance: "subtle",
|
|
83
|
-
iconAfter: (0, _react2.jsx)(
|
|
84
|
+
iconAfter: (0, _react2.jsx)(_sortIcon.SortIcon, {
|
|
84
85
|
name: name
|
|
85
86
|
})
|
|
86
87
|
}, tooltipProps, {
|
package/dist/cjs/table.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,9 +10,7 @@ var _react2 = require("@emotion/react");
|
|
|
11
10
|
var _selectionProvider = _interopRequireDefault(require("./hooks/selection-provider"));
|
|
12
11
|
var _useSorting2 = require("./hooks/use-sorting");
|
|
13
12
|
var _useTable = require("./hooks/use-table");
|
|
14
|
-
var
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
13
|
+
var _ui = require("./ui");
|
|
17
14
|
/** @jsx jsx */
|
|
18
15
|
|
|
19
16
|
/**
|
|
@@ -45,7 +42,7 @@ function Table(_ref) {
|
|
|
45
42
|
}, [isSelectable, localSortKey, setSortState, sortDirection, sortFn]);
|
|
46
43
|
return (0, _react2.jsx)(_useTable.TableProvider, {
|
|
47
44
|
state: tableProviderState
|
|
48
|
-
}, (0, _react2.jsx)(
|
|
45
|
+
}, (0, _react2.jsx)(_ui.Table, {
|
|
49
46
|
testId: testId
|
|
50
47
|
}, isSelectable ? (0, _react2.jsx)(_selectionProvider.default, null, children) : children));
|
|
51
48
|
}
|
package/dist/cjs/thead.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -13,9 +12,10 @@ var _inline = _interopRequireDefault(require("@atlaskit/primitives/inline"));
|
|
|
13
12
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
14
13
|
var _selectionProvider = require("./hooks/selection-provider");
|
|
15
14
|
var _useTable2 = require("./hooks/use-table");
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var _bulkActionOverlay = require("./ui/bulk-action-overlay");
|
|
16
|
+
var _selectableCell = require("./ui/selectable-cell");
|
|
17
|
+
var _thead = require("./ui/thead");
|
|
18
|
+
var _tr = require("./ui/tr");
|
|
19
19
|
/** @jsx jsx */
|
|
20
20
|
|
|
21
21
|
var THead = function THead(_ref) {
|
|
@@ -30,9 +30,9 @@ var THead = function THead(_ref) {
|
|
|
30
30
|
setAll = _useSelection2$.setAll,
|
|
31
31
|
removeAll = _useSelection2$.removeAll;
|
|
32
32
|
var isChecked = state.allChecked || state.anyChecked;
|
|
33
|
-
return (0, _react.jsx)(
|
|
33
|
+
return (0, _react.jsx)(_thead.THead, null, (0, _react.jsx)(_tr.TR, {
|
|
34
34
|
isBodyRow: false
|
|
35
|
-
}, isSelectable && (0, _react.jsx)(
|
|
35
|
+
}, isSelectable && (0, _react.jsx)(_selectableCell.SelectableCell, {
|
|
36
36
|
as: "th"
|
|
37
37
|
}, (0, _react.jsx)(_checkbox.default, {
|
|
38
38
|
label: (0, _react.jsx)(_visuallyHidden.default, {
|
|
@@ -41,7 +41,7 @@ var THead = function THead(_ref) {
|
|
|
41
41
|
onChange: isChecked ? removeAll : setAll,
|
|
42
42
|
isChecked: isChecked,
|
|
43
43
|
isIndeterminate: state.anyChecked && !state.allChecked
|
|
44
|
-
})), children, isSelectable && isChecked && (0, _react.jsx)(
|
|
44
|
+
})), children, isSelectable && isChecked && (0, _react.jsx)(_bulkActionOverlay.BulkActionOverlay, null, (0, _react.jsx)("span", {
|
|
45
45
|
style: {
|
|
46
46
|
color: "var(--ds-text, #172B4D)",
|
|
47
47
|
/* @ts-ignore migrate to Text */
|
package/dist/es2019/body.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useSelection } from './hooks/selection-provider';
|
|
|
6
6
|
import { RowProvider } from './hooks/use-row-id';
|
|
7
7
|
import { useTable } from './hooks/use-table';
|
|
8
8
|
import { TableBodyProvider } from './hooks/use-table-body';
|
|
9
|
-
import
|
|
9
|
+
import { TBody as TBodyPrimitive } from './ui';
|
|
10
10
|
/**
|
|
11
11
|
* __Table body__
|
|
12
12
|
*/
|
|
@@ -40,7 +40,7 @@ function TBody({
|
|
|
40
40
|
})).sort(sortFn), [rows, sortFn]);
|
|
41
41
|
return jsx(TableBodyProvider, {
|
|
42
42
|
value: true
|
|
43
|
-
}, jsx(
|
|
43
|
+
}, jsx(TBodyPrimitive, null, typeof children === 'function' && sortedRows ? sortedRows.map(({
|
|
44
44
|
idx,
|
|
45
45
|
...row
|
|
46
46
|
}) => jsx(RowProvider, {
|
|
@@ -5,7 +5,7 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
5
5
|
import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
|
|
6
6
|
import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
7
7
|
import useExpand from './hooks/use-expand';
|
|
8
|
-
import
|
|
8
|
+
import { ExpandableCell as ExpandableCellPrimitive } from './ui/expandable-cell';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* __Expandable cell__
|
|
@@ -21,7 +21,7 @@ const ExpandableCell = /*#__PURE__*/memo(() => {
|
|
|
21
21
|
const handleClick = useCallback(() => {
|
|
22
22
|
toggleExpanded();
|
|
23
23
|
}, [toggleExpanded]);
|
|
24
|
-
return jsx(
|
|
24
|
+
return jsx(ExpandableCellPrimitive, {
|
|
25
25
|
as: "td"
|
|
26
26
|
}, jsx(IconButton, {
|
|
27
27
|
spacing: "compact",
|
package/dist/es2019/row.js
CHANGED
|
@@ -8,7 +8,8 @@ import { useRowId } from './hooks/use-row-id';
|
|
|
8
8
|
import { useTable } from './hooks/use-table';
|
|
9
9
|
import { useTableBody } from './hooks/use-table-body';
|
|
10
10
|
import SelectableCell from './selectable-cell';
|
|
11
|
-
import
|
|
11
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui/selectable-cell';
|
|
12
|
+
import { TR as TRPrimitive } from './ui/tr';
|
|
12
13
|
/**
|
|
13
14
|
* __Row__
|
|
14
15
|
*
|
|
@@ -48,11 +49,11 @@ const Row = /*#__PURE__*/memo(({
|
|
|
48
49
|
}
|
|
49
50
|
let selectableCell = isSelectable && jsx(SelectableCell, null);
|
|
50
51
|
if (isSelectable && isExpandableContent) {
|
|
51
|
-
selectableCell = jsx(
|
|
52
|
+
selectableCell = jsx(SelectableCellPrimitive, {
|
|
52
53
|
as: "td"
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
return jsx(
|
|
56
|
+
return jsx(TRPrimitive, {
|
|
56
57
|
isSelected: isSelected,
|
|
57
58
|
testId: testId,
|
|
58
59
|
isSubitem: isExpandableContent
|
|
@@ -5,7 +5,7 @@ import Checkbox from '@atlaskit/checkbox';
|
|
|
5
5
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
6
6
|
import { useSelection } from './hooks/selection-provider';
|
|
7
7
|
import { useRowId } from './hooks/use-row-id';
|
|
8
|
-
import
|
|
8
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui';
|
|
9
9
|
const SelectableCell = () => {
|
|
10
10
|
const [{
|
|
11
11
|
allChecked,
|
|
@@ -16,7 +16,7 @@ const SelectableCell = () => {
|
|
|
16
16
|
const idx = useRowId();
|
|
17
17
|
const isChecked = useMemo(() => allChecked || checked.includes(idx), [allChecked, checked, idx]);
|
|
18
18
|
const onChange = useCallback(e => toggleSelection === null || toggleSelection === void 0 ? void 0 : toggleSelection(idx, e.nativeEvent.shiftKey), [idx, toggleSelection]);
|
|
19
|
-
return jsx(
|
|
19
|
+
return jsx(SelectableCellPrimitive, {
|
|
20
20
|
as: "td"
|
|
21
21
|
}, jsx(Checkbox, {
|
|
22
22
|
isChecked: isChecked,
|
|
@@ -6,7 +6,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
6
6
|
import Button from '@atlaskit/button';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
8
|
import { useTable } from './hooks/use-table';
|
|
9
|
-
import { SortIcon
|
|
9
|
+
import { SortIcon as SortIconPrimitive } from './ui/sort-icon';
|
|
10
|
+
import { TH as THPrimitive } from './ui/th';
|
|
10
11
|
/**
|
|
11
12
|
* TODO these need to be i18n supported
|
|
12
13
|
*/
|
|
@@ -59,7 +60,7 @@ const SortableColumn = ({
|
|
|
59
60
|
const updateSortState = useCallback(
|
|
60
61
|
// @ts-expect-error: TODO: Our `name` typing is off; refer to `SortKey`
|
|
61
62
|
() => setSortState(name), [setSortState, name]);
|
|
62
|
-
return jsx(
|
|
63
|
+
return jsx(THPrimitive, _extends({
|
|
63
64
|
testId: testId,
|
|
64
65
|
sortDirection: sortKey === name ? sortDirection : 'none'
|
|
65
66
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -70,7 +71,7 @@ const SortableColumn = ({
|
|
|
70
71
|
testId: `${testId}--button`,
|
|
71
72
|
spacing: "compact",
|
|
72
73
|
appearance: "subtle",
|
|
73
|
-
iconAfter: jsx(
|
|
74
|
+
iconAfter: jsx(SortIconPrimitive, {
|
|
74
75
|
name: name
|
|
75
76
|
})
|
|
76
77
|
}, tooltipProps, {
|
package/dist/es2019/table.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import SelectionProvider from './hooks/selection-provider';
|
|
5
5
|
import { useSorting } from './hooks/use-sorting';
|
|
6
6
|
import { TableProvider } from './hooks/use-table';
|
|
7
|
-
import
|
|
7
|
+
import { Table as TablePrimitive } from './ui';
|
|
8
8
|
/**
|
|
9
9
|
* __Table__
|
|
10
10
|
*
|
|
@@ -33,7 +33,7 @@ function Table({
|
|
|
33
33
|
}), [isSelectable, localSortKey, setSortState, sortDirection, sortFn]);
|
|
34
34
|
return jsx(TableProvider, {
|
|
35
35
|
state: tableProviderState
|
|
36
|
-
}, jsx(
|
|
36
|
+
}, jsx(TablePrimitive, {
|
|
37
37
|
testId: testId
|
|
38
38
|
}, isSelectable ? jsx(SelectionProvider, null, children) : children));
|
|
39
39
|
}
|
package/dist/es2019/thead.js
CHANGED
|
@@ -6,7 +6,10 @@ import Inline from '@atlaskit/primitives/inline';
|
|
|
6
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
7
|
import { useSelection } from './hooks/selection-provider';
|
|
8
8
|
import { useTable } from './hooks/use-table';
|
|
9
|
-
import
|
|
9
|
+
import { BulkActionOverlay as BulkActionOverlayPrimitive } from './ui/bulk-action-overlay';
|
|
10
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui/selectable-cell';
|
|
11
|
+
import { THead as THeadPrimitive } from './ui/thead';
|
|
12
|
+
import { TR as TRPrimitive } from './ui/tr';
|
|
10
13
|
const THead = ({
|
|
11
14
|
actions,
|
|
12
15
|
children
|
|
@@ -19,9 +22,9 @@ const THead = ({
|
|
|
19
22
|
removeAll
|
|
20
23
|
}] = useSelection();
|
|
21
24
|
const isChecked = state.allChecked || state.anyChecked;
|
|
22
|
-
return jsx(
|
|
25
|
+
return jsx(THeadPrimitive, null, jsx(TRPrimitive, {
|
|
23
26
|
isBodyRow: false
|
|
24
|
-
}, isSelectable && jsx(
|
|
27
|
+
}, isSelectable && jsx(SelectableCellPrimitive, {
|
|
25
28
|
as: "th"
|
|
26
29
|
}, jsx(Checkbox, {
|
|
27
30
|
label: jsx(VisuallyHidden, {
|
|
@@ -30,7 +33,7 @@ const THead = ({
|
|
|
30
33
|
onChange: isChecked ? removeAll : setAll,
|
|
31
34
|
isChecked: isChecked,
|
|
32
35
|
isIndeterminate: state.anyChecked && !state.allChecked
|
|
33
|
-
})), children, isSelectable && isChecked && jsx(
|
|
36
|
+
})), children, isSelectable && isChecked && jsx(BulkActionOverlayPrimitive, null, jsx("span", {
|
|
34
37
|
style: {
|
|
35
38
|
color: "var(--ds-text, #172B4D)",
|
|
36
39
|
/* @ts-ignore migrate to Text */
|
package/dist/esm/body.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useSelection } from './hooks/selection-provider';
|
|
|
12
12
|
import { RowProvider } from './hooks/use-row-id';
|
|
13
13
|
import { useTable } from './hooks/use-table';
|
|
14
14
|
import { TableBodyProvider } from './hooks/use-table-body';
|
|
15
|
-
import
|
|
15
|
+
import { TBody as TBodyPrimitive } from './ui';
|
|
16
16
|
/**
|
|
17
17
|
* __Table body__
|
|
18
18
|
*/
|
|
@@ -49,7 +49,7 @@ function TBody(_ref) {
|
|
|
49
49
|
}, [rows, sortFn]);
|
|
50
50
|
return jsx(TableBodyProvider, {
|
|
51
51
|
value: true
|
|
52
|
-
}, jsx(
|
|
52
|
+
}, jsx(TBodyPrimitive, null, typeof children === 'function' && sortedRows ? sortedRows.map(function (_ref2) {
|
|
53
53
|
var idx = _ref2.idx,
|
|
54
54
|
row = _objectWithoutProperties(_ref2, _excluded);
|
|
55
55
|
return jsx(RowProvider, {
|
|
@@ -5,7 +5,7 @@ import { IconButton } from '@atlaskit/button/new';
|
|
|
5
5
|
import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
|
|
6
6
|
import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
7
7
|
import useExpand from './hooks/use-expand';
|
|
8
|
-
import
|
|
8
|
+
import { ExpandableCell as ExpandableCellPrimitive } from './ui/expandable-cell';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* __Expandable cell__
|
|
@@ -20,7 +20,7 @@ var ExpandableCell = /*#__PURE__*/memo(function () {
|
|
|
20
20
|
var handleClick = useCallback(function () {
|
|
21
21
|
toggleExpanded();
|
|
22
22
|
}, [toggleExpanded]);
|
|
23
|
-
return jsx(
|
|
23
|
+
return jsx(ExpandableCellPrimitive, {
|
|
24
24
|
as: "td"
|
|
25
25
|
}, jsx(IconButton, {
|
|
26
26
|
spacing: "compact",
|
package/dist/esm/row.js
CHANGED
|
@@ -9,7 +9,8 @@ import { useRowId } from './hooks/use-row-id';
|
|
|
9
9
|
import { useTable } from './hooks/use-table';
|
|
10
10
|
import { useTableBody } from './hooks/use-table-body';
|
|
11
11
|
import SelectableCell from './selectable-cell';
|
|
12
|
-
import
|
|
12
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui/selectable-cell';
|
|
13
|
+
import { TR as TRPrimitive } from './ui/tr';
|
|
13
14
|
/**
|
|
14
15
|
* __Row__
|
|
15
16
|
*
|
|
@@ -46,11 +47,11 @@ var Row = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
47
|
}
|
|
47
48
|
var selectableCell = isSelectable && jsx(SelectableCell, null);
|
|
48
49
|
if (isSelectable && isExpandableContent) {
|
|
49
|
-
selectableCell = jsx(
|
|
50
|
+
selectableCell = jsx(SelectableCellPrimitive, {
|
|
50
51
|
as: "td"
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
return jsx(
|
|
54
|
+
return jsx(TRPrimitive, {
|
|
54
55
|
isSelected: isSelected,
|
|
55
56
|
testId: testId,
|
|
56
57
|
isSubitem: isExpandableContent
|
|
@@ -6,7 +6,7 @@ import Checkbox from '@atlaskit/checkbox';
|
|
|
6
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
7
|
import { useSelection } from './hooks/selection-provider';
|
|
8
8
|
import { useRowId } from './hooks/use-row-id';
|
|
9
|
-
import
|
|
9
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui';
|
|
10
10
|
var SelectableCell = function SelectableCell() {
|
|
11
11
|
var _useSelection = useSelection(),
|
|
12
12
|
_useSelection2 = _slicedToArray(_useSelection, 2),
|
|
@@ -21,7 +21,7 @@ var SelectableCell = function SelectableCell() {
|
|
|
21
21
|
var onChange = useCallback(function (e) {
|
|
22
22
|
return toggleSelection === null || toggleSelection === void 0 ? void 0 : toggleSelection(idx, e.nativeEvent.shiftKey);
|
|
23
23
|
}, [idx, toggleSelection]);
|
|
24
|
-
return jsx(
|
|
24
|
+
return jsx(SelectableCellPrimitive, {
|
|
25
25
|
as: "td"
|
|
26
26
|
}, jsx(Checkbox, {
|
|
27
27
|
isChecked: isChecked,
|
|
@@ -8,7 +8,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
8
8
|
import Button from '@atlaskit/button';
|
|
9
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
10
|
import { useTable } from './hooks/use-table';
|
|
11
|
-
import { SortIcon
|
|
11
|
+
import { SortIcon as SortIconPrimitive } from './ui/sort-icon';
|
|
12
|
+
import { TH as THPrimitive } from './ui/th';
|
|
12
13
|
/**
|
|
13
14
|
* TODO these need to be i18n supported
|
|
14
15
|
*/
|
|
@@ -61,7 +62,7 @@ var SortableColumn = function SortableColumn(_ref) {
|
|
|
61
62
|
function () {
|
|
62
63
|
return setSortState(name);
|
|
63
64
|
}, [setSortState, name]);
|
|
64
|
-
return jsx(
|
|
65
|
+
return jsx(THPrimitive, _extends({
|
|
65
66
|
testId: testId,
|
|
66
67
|
sortDirection: sortKey === name ? sortDirection : 'none'
|
|
67
68
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
@@ -73,7 +74,7 @@ var SortableColumn = function SortableColumn(_ref) {
|
|
|
73
74
|
testId: "".concat(testId, "--button"),
|
|
74
75
|
spacing: "compact",
|
|
75
76
|
appearance: "subtle",
|
|
76
|
-
iconAfter: jsx(
|
|
77
|
+
iconAfter: jsx(SortIconPrimitive, {
|
|
77
78
|
name: name
|
|
78
79
|
})
|
|
79
80
|
}, tooltipProps, {
|
package/dist/esm/table.js
CHANGED
|
@@ -4,7 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import SelectionProvider from './hooks/selection-provider';
|
|
5
5
|
import { useSorting } from './hooks/use-sorting';
|
|
6
6
|
import { TableProvider } from './hooks/use-table';
|
|
7
|
-
import
|
|
7
|
+
import { Table as TablePrimitive } from './ui';
|
|
8
8
|
/**
|
|
9
9
|
* __Table__
|
|
10
10
|
*
|
|
@@ -34,7 +34,7 @@ function Table(_ref) {
|
|
|
34
34
|
}, [isSelectable, localSortKey, setSortState, sortDirection, sortFn]);
|
|
35
35
|
return jsx(TableProvider, {
|
|
36
36
|
state: tableProviderState
|
|
37
|
-
}, jsx(
|
|
37
|
+
}, jsx(TablePrimitive, {
|
|
38
38
|
testId: testId
|
|
39
39
|
}, isSelectable ? jsx(SelectionProvider, null, children) : children));
|
|
40
40
|
}
|
package/dist/esm/thead.js
CHANGED
|
@@ -7,7 +7,10 @@ import Inline from '@atlaskit/primitives/inline';
|
|
|
7
7
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
8
8
|
import { useSelection } from './hooks/selection-provider';
|
|
9
9
|
import { useTable } from './hooks/use-table';
|
|
10
|
-
import
|
|
10
|
+
import { BulkActionOverlay as BulkActionOverlayPrimitive } from './ui/bulk-action-overlay';
|
|
11
|
+
import { SelectableCell as SelectableCellPrimitive } from './ui/selectable-cell';
|
|
12
|
+
import { THead as THeadPrimitive } from './ui/thead';
|
|
13
|
+
import { TR as TRPrimitive } from './ui/tr';
|
|
11
14
|
var THead = function THead(_ref) {
|
|
12
15
|
var actions = _ref.actions,
|
|
13
16
|
children = _ref.children;
|
|
@@ -20,9 +23,9 @@ var THead = function THead(_ref) {
|
|
|
20
23
|
setAll = _useSelection2$.setAll,
|
|
21
24
|
removeAll = _useSelection2$.removeAll;
|
|
22
25
|
var isChecked = state.allChecked || state.anyChecked;
|
|
23
|
-
return jsx(
|
|
26
|
+
return jsx(THeadPrimitive, null, jsx(TRPrimitive, {
|
|
24
27
|
isBodyRow: false
|
|
25
|
-
}, isSelectable && jsx(
|
|
28
|
+
}, isSelectable && jsx(SelectableCellPrimitive, {
|
|
26
29
|
as: "th"
|
|
27
30
|
}, jsx(Checkbox, {
|
|
28
31
|
label: jsx(VisuallyHidden, {
|
|
@@ -31,7 +34,7 @@ var THead = function THead(_ref) {
|
|
|
31
34
|
onChange: isChecked ? removeAll : setAll,
|
|
32
35
|
isChecked: isChecked,
|
|
33
36
|
isIndeterminate: state.anyChecked && !state.allChecked
|
|
34
|
-
})), children, isSelectable && isChecked && jsx(
|
|
37
|
+
})), children, isSelectable && isChecked && jsx(BulkActionOverlayPrimitive, null, jsx("span", {
|
|
35
38
|
style: {
|
|
36
39
|
color: "var(--ds-text, #172B4D)",
|
|
37
40
|
/* @ts-ignore migrate to Text */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/table",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.28",
|
|
4
4
|
"description": "A table is used to display data.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"./primitives": "./src/ui/index.tsx"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@atlaskit/button": "^17.
|
|
43
|
+
"@atlaskit/button": "^17.14.0",
|
|
44
44
|
"@atlaskit/checkbox": "^13.1.0",
|
|
45
|
-
"@atlaskit/ds-lib": "^2.
|
|
45
|
+
"@atlaskit/ds-lib": "^2.3.0",
|
|
46
46
|
"@atlaskit/focus-ring": "^1.3.0",
|
|
47
47
|
"@atlaskit/icon": "^22.1.0",
|
|
48
|
-
"@atlaskit/primitives": "^5.
|
|
49
|
-
"@atlaskit/tokens": "^1.
|
|
50
|
-
"@atlaskit/tooltip": "^18.
|
|
48
|
+
"@atlaskit/primitives": "^5.6.0",
|
|
49
|
+
"@atlaskit/tokens": "^1.43.0",
|
|
50
|
+
"@atlaskit/tooltip": "^18.2.0",
|
|
51
51
|
"@atlaskit/visually-hidden": "^1.2.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1",
|