@atlaskit/table 0.11.6 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/body.js +9 -10
- package/dist/cjs/expandable-cell.js +7 -12
- package/dist/cjs/head-cell.js +4 -11
- package/dist/cjs/row.js +7 -12
- package/dist/cjs/selectable-cell.js +7 -12
- package/dist/cjs/sortable-column.compiled.css +6 -0
- package/dist/cjs/sortable-column.js +16 -22
- package/dist/cjs/table.js +7 -12
- package/dist/cjs/thead.js +7 -14
- package/dist/cjs/ui/expand-icon.js +6 -12
- package/dist/cjs/ui/sort-icon.js +6 -12
- package/dist/cjs/ui/table.js +4 -10
- package/dist/cjs/ui/tbody.compiled.css +7 -0
- package/dist/cjs/ui/tbody.js +13 -23
- package/dist/cjs/ui/td.js +3 -7
- package/dist/cjs/ui/thead.compiled.css +7 -0
- package/dist/cjs/ui/thead.js +13 -19
- package/dist/cjs/ui/tr.compiled.css +11 -0
- package/dist/cjs/ui/tr.js +17 -36
- package/dist/es2019/body.js +5 -13
- package/dist/es2019/expandable-cell.js +4 -11
- package/dist/es2019/head-cell.js +3 -10
- package/dist/es2019/row.js +4 -11
- package/dist/es2019/selectable-cell.js +4 -11
- package/dist/es2019/sortable-column.compiled.css +6 -0
- package/dist/es2019/sortable-column.js +12 -22
- package/dist/es2019/table.js +4 -11
- package/dist/es2019/thead.js +7 -13
- package/dist/es2019/ui/expand-icon.js +3 -11
- package/dist/es2019/ui/sort-icon.js +3 -11
- package/dist/es2019/ui/table.js +3 -9
- package/dist/es2019/ui/tbody.compiled.css +7 -0
- package/dist/es2019/ui/tbody.js +7 -22
- package/dist/es2019/ui/td.js +3 -8
- package/dist/es2019/ui/thead.compiled.css +7 -0
- package/dist/es2019/ui/thead.js +7 -18
- package/dist/es2019/ui/tr.compiled.css +11 -0
- package/dist/es2019/ui/tr.js +11 -35
- package/dist/esm/body.js +5 -13
- package/dist/esm/expandable-cell.js +4 -11
- package/dist/esm/head-cell.js +3 -10
- package/dist/esm/row.js +4 -11
- package/dist/esm/selectable-cell.js +4 -11
- package/dist/esm/sortable-column.compiled.css +6 -0
- package/dist/esm/sortable-column.js +12 -22
- package/dist/esm/table.js +4 -11
- package/dist/esm/thead.js +7 -13
- package/dist/esm/ui/expand-icon.js +3 -11
- package/dist/esm/ui/sort-icon.js +3 -11
- package/dist/esm/ui/table.js +3 -9
- package/dist/esm/ui/tbody.compiled.css +7 -0
- package/dist/esm/ui/tbody.js +10 -22
- package/dist/esm/ui/td.js +3 -8
- package/dist/esm/ui/thead.compiled.css +7 -0
- package/dist/esm/ui/thead.js +10 -18
- package/dist/esm/ui/tr.compiled.css +11 -0
- package/dist/esm/ui/tr.js +14 -35
- package/dist/types/body.d.ts +2 -7
- package/dist/types/expandable-cell.d.ts +2 -3
- package/dist/types/head-cell.d.ts +1 -5
- package/dist/types/row.d.ts +0 -4
- package/dist/types/selectable-cell.d.ts +2 -2
- package/dist/types/table.d.ts +2 -7
- package/dist/types/thead.d.ts +0 -4
- package/dist/types/ui/expand-icon.d.ts +3 -4
- package/dist/types/ui/sort-icon.d.ts +0 -4
- package/dist/types/ui/table.d.ts +0 -4
- package/dist/types/ui/td.d.ts +1 -5
- package/dist/types-ts4.5/body.d.ts +2 -7
- package/dist/types-ts4.5/expandable-cell.d.ts +2 -3
- package/dist/types-ts4.5/head-cell.d.ts +1 -5
- package/dist/types-ts4.5/row.d.ts +0 -4
- package/dist/types-ts4.5/selectable-cell.d.ts +2 -2
- package/dist/types-ts4.5/table.d.ts +2 -7
- package/dist/types-ts4.5/thead.d.ts +0 -4
- package/dist/types-ts4.5/ui/expand-icon.d.ts +3 -4
- package/dist/types-ts4.5/ui/sort-icon.d.ts +0 -4
- package/dist/types-ts4.5/ui/table.d.ts +0 -4
- package/dist/types-ts4.5/ui/td.d.ts +1 -5
- package/package.json +12 -12
package/dist/cjs/ui/tbody.js
CHANGED
|
@@ -1,30 +1,17 @@
|
|
|
1
|
+
/* tbody.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.TBody = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
-
|
|
16
|
-
var bodyStyles = (0, _react.css)({
|
|
17
|
-
position: 'relative',
|
|
18
|
-
border: 'none',
|
|
19
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
20
|
-
'&:after': {
|
|
21
|
-
position: 'absolute',
|
|
22
|
-
inset: 0,
|
|
23
|
-
boxShadow: "inset 0 -2px 0 0 ".concat("var(--ds-border, #eee)"),
|
|
24
|
-
content: "''",
|
|
25
|
-
pointerEvents: 'none'
|
|
26
|
-
}
|
|
27
|
-
});
|
|
9
|
+
require("./tbody.compiled.css");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
var bodyStyles = null;
|
|
28
15
|
|
|
29
16
|
/**
|
|
30
17
|
* __TBody__
|
|
@@ -32,7 +19,10 @@ var bodyStyles = (0, _react.css)({
|
|
|
32
19
|
*/
|
|
33
20
|
var TBody = exports.TBody = function TBody(_ref) {
|
|
34
21
|
var children = _ref.children;
|
|
35
|
-
return
|
|
36
|
-
|
|
22
|
+
return /*#__PURE__*/React.createElement("tbody", {
|
|
23
|
+
className: (0, _runtime.ax)(["_19itglyw _kqswh2mm _9v7aidpf _18postnw _8x3ud1es _aetrb3bt _11fnglyw"]),
|
|
24
|
+
style: {
|
|
25
|
+
"--_1tz90uq": (0, _runtime.ix)("inset 0 -2px 0 0 ".concat("var(--ds-border, #eee)"))
|
|
26
|
+
}
|
|
37
27
|
}, children);
|
|
38
28
|
};
|
package/dist/cjs/ui/td.js
CHANGED
|
@@ -7,14 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TD = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react = require("
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _baseCell = require("./base-cell");
|
|
12
12
|
var _excluded = ["testId"];
|
|
13
|
-
/**
|
|
14
|
-
* @jsxRuntime classic
|
|
15
|
-
* @jsx jsx
|
|
16
|
-
*/
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
13
|
/**
|
|
19
14
|
* __Cell__
|
|
20
15
|
*
|
|
@@ -26,8 +21,9 @@ var TD = exports.TD = function TD(_ref) {
|
|
|
26
21
|
var testId = _ref.testId,
|
|
27
22
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
23
|
return (
|
|
24
|
+
/*#__PURE__*/
|
|
29
25
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
30
|
-
|
|
26
|
+
_react.default.createElement(_baseCell.BaseCell, (0, _extends2.default)({
|
|
31
27
|
as: "td",
|
|
32
28
|
testId: testId
|
|
33
29
|
}, props))
|
package/dist/cjs/ui/thead.js
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
+
/* thead.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.THead = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
|
-
|
|
15
|
-
var baseStyles = (0, _react.css)({
|
|
16
|
-
position: 'sticky',
|
|
17
|
-
zIndex: 1,
|
|
18
|
-
inset: 0,
|
|
19
|
-
backgroundColor: "var(--ds-surface, white)",
|
|
20
|
-
border: 'none',
|
|
21
|
-
borderBlockEnd: "2px solid ".concat("var(--ds-border, #eee)"),
|
|
22
|
-
borderBlockStart: '2px solid transparent'
|
|
23
|
-
});
|
|
9
|
+
require("./thead.compiled.css");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
var baseStyles = null;
|
|
24
15
|
|
|
25
16
|
/**
|
|
26
17
|
* __THead__
|
|
@@ -31,7 +22,10 @@ var baseStyles = (0, _react.css)({
|
|
|
31
22
|
*/
|
|
32
23
|
var THead = exports.THead = function THead(_ref) {
|
|
33
24
|
var children = _ref.children;
|
|
34
|
-
return
|
|
35
|
-
|
|
25
|
+
return /*#__PURE__*/React.createElement("thead", {
|
|
26
|
+
className: (0, _runtime.ax)(["_1r04idpf _19itglyw _179r1n0b _mqm21vrj _kqsw1if8 _1pbykb7n _bfhkvuon"]),
|
|
27
|
+
style: {
|
|
28
|
+
"--_ukuvb0": (0, _runtime.ix)("2px solid ".concat("var(--ds-border, #eee)"))
|
|
29
|
+
}
|
|
36
30
|
}, children);
|
|
37
31
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
._19itglyw{border:none}._179rmc7d{border-block-end:var(--_1748cv6)}
|
|
3
|
+
._4t3i1wto{height:3rem}
|
|
4
|
+
._bfhkcslv{background-color:var(--ds-background-selected,#deebff88)}
|
|
5
|
+
._bfhkm7j4{background-color:var(--ds-background-neutral,#091e420f)}
|
|
6
|
+
._btyzidpf{border-spacing:0}
|
|
7
|
+
._hpylidpf{border-image-width:0}
|
|
8
|
+
._kqswh2mm{position:relative}
|
|
9
|
+
._x6vyglyw:focus-visible:after{box-shadow:none}
|
|
10
|
+
._irr3134o:hover{background-color:var(--ds-background-neutral-subtle-hovered,#f8f8f8)}
|
|
11
|
+
._irr3quvt:hover{background-color:var(--ds-background-selected-hovered,#deebff)}
|
package/dist/cjs/ui/tr.js
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
|
+
/* tr.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
5
7
|
value: true
|
|
6
8
|
});
|
|
7
9
|
exports.TR = void 0;
|
|
8
|
-
|
|
10
|
+
require("./tr.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
13
|
var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var baseStyles = (0, _react.css)({
|
|
18
|
-
height: '3rem',
|
|
19
|
-
position: 'relative',
|
|
20
|
-
border: 'none',
|
|
21
|
-
borderImageWidth: 0,
|
|
22
|
-
borderSpacing: 0
|
|
23
|
-
});
|
|
24
|
-
var selectedStyles = (0, _react.css)({
|
|
25
|
-
backgroundColor: "var(--ds-background-selected, #DEEBFF88)",
|
|
26
|
-
'&:hover': {
|
|
27
|
-
backgroundColor: "var(--ds-background-selected-hovered, #DEEBFF)" // B50
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var subitemStyles = (0, _react.css)({
|
|
31
|
-
backgroundColor: "var(--ds-background-neutral, #091E420F)"
|
|
32
|
-
});
|
|
33
|
-
var bodyRowStyles = (0, _react.css)({
|
|
34
|
-
borderBlockEnd: "1px solid ".concat("var(--ds-border, #eee)"),
|
|
35
|
-
'&:hover': {
|
|
36
|
-
backgroundColor: "var(--ds-background-neutral-subtle-hovered, #f8f8f8)"
|
|
37
|
-
},
|
|
38
|
-
'&:focus-visible::after': {
|
|
39
|
-
boxShadow: 'none'
|
|
40
|
-
}
|
|
41
|
-
});
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
var baseStyles = null;
|
|
17
|
+
var selectedStyles = null;
|
|
18
|
+
var subitemStyles = null;
|
|
19
|
+
var bodyRowStyles = null;
|
|
42
20
|
/**
|
|
43
21
|
* __Row__
|
|
44
22
|
*
|
|
@@ -53,12 +31,15 @@ var TR = exports.TR = function TR(_ref) {
|
|
|
53
31
|
_ref$isBodyRow = _ref.isBodyRow,
|
|
54
32
|
isBodyRow = _ref$isBodyRow === void 0 ? true : _ref$isBodyRow,
|
|
55
33
|
isSubitem = _ref.isSubitem;
|
|
56
|
-
return
|
|
34
|
+
return /*#__PURE__*/React.createElement(_focusRing.default, {
|
|
57
35
|
isInset: true
|
|
58
|
-
},
|
|
36
|
+
}, /*#__PURE__*/React.createElement("tr", {
|
|
59
37
|
tabIndex: -1,
|
|
60
38
|
"aria-selected": isSelected,
|
|
61
39
|
"data-testid": testId,
|
|
62
|
-
|
|
40
|
+
className: (0, _runtime.ax)(["_19itglyw _4t3i1wto _kqswh2mm _hpylidpf _btyzidpf", isBodyRow && "_179rmc7d _x6vyglyw _irr3134o", isSelected && "_bfhkcslv _irr3quvt", isSubitem && "_bfhkm7j4"]),
|
|
41
|
+
style: {
|
|
42
|
+
"--_1748cv6": (0, _runtime.ix)("1px solid ".concat("var(--ds-border, #eee)"))
|
|
43
|
+
}
|
|
63
44
|
}, children));
|
|
64
45
|
};
|
package/dist/es2019/body.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { Children, useEffect, useMemo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { Children, useEffect, useMemo } from 'react';
|
|
10
2
|
import { useSelection } from './hooks/selection-provider';
|
|
11
3
|
import { RowProvider } from './hooks/use-row-id';
|
|
12
4
|
import { useTable } from './hooks/use-table';
|
|
@@ -48,7 +40,7 @@ function TBody({
|
|
|
48
40
|
return sortedRows === null || sortedRows === void 0 ? void 0 : sortedRows.map(({
|
|
49
41
|
idx,
|
|
50
42
|
...row
|
|
51
|
-
}) =>
|
|
43
|
+
}) => /*#__PURE__*/React.createElement(RowProvider, {
|
|
52
44
|
key: idx,
|
|
53
45
|
value: idx
|
|
54
46
|
},
|
|
@@ -56,13 +48,13 @@ function TBody({
|
|
|
56
48
|
children(row)));
|
|
57
49
|
}
|
|
58
50
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
59
|
-
return childrenArray.map((row, idx) =>
|
|
51
|
+
return childrenArray.map((row, idx) => /*#__PURE__*/React.createElement(RowProvider, {
|
|
60
52
|
key: idx,
|
|
61
53
|
value: idx
|
|
62
54
|
}, row));
|
|
63
55
|
})();
|
|
64
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement(TableBodyProvider, {
|
|
65
57
|
value: true
|
|
66
|
-
},
|
|
58
|
+
}, /*#__PURE__*/React.createElement(TBodyPrimitive, null, renderedChildren));
|
|
67
59
|
}
|
|
68
60
|
export default TBody;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { memo, useCallback } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
2
|
+
import React, { memo, useCallback } from 'react';
|
|
10
3
|
import { IconButton } from '@atlaskit/button/new';
|
|
11
4
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down--hipchat-chevron-down';
|
|
12
5
|
import ChevronUpIcon from '@atlaskit/icon/utility/migration/chevron-up--hipchat-chevron-up';
|
|
@@ -28,12 +21,12 @@ const ExpandableCell = /*#__PURE__*/memo(() => {
|
|
|
28
21
|
toggleExpanded();
|
|
29
22
|
}, [toggleExpanded]);
|
|
30
23
|
const Icon = isExpanded ? ChevronUpIcon : ChevronDownIcon;
|
|
31
|
-
return
|
|
24
|
+
return /*#__PURE__*/React.createElement(ExpandableCellPrimitive, {
|
|
32
25
|
as: "td"
|
|
33
|
-
},
|
|
26
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
34
27
|
spacing: "compact",
|
|
35
28
|
appearance: "subtle",
|
|
36
|
-
icon: iconProps =>
|
|
29
|
+
icon: iconProps => /*#__PURE__*/React.createElement(Icon, _extends({}, iconProps, {
|
|
37
30
|
LEGACY_size: "small"
|
|
38
31
|
})),
|
|
39
32
|
label: "Expand row",
|
package/dist/es2019/head-cell.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React from 'react';
|
|
9
2
|
import { Text } from '@atlaskit/primitives';
|
|
10
3
|
import { TH } from './ui/th';
|
|
11
4
|
|
|
@@ -21,12 +14,12 @@ const HeadCell = ({
|
|
|
21
14
|
backgroundColor,
|
|
22
15
|
scope = 'col'
|
|
23
16
|
}) => {
|
|
24
|
-
return
|
|
17
|
+
return /*#__PURE__*/React.createElement(TH, {
|
|
25
18
|
scope: scope,
|
|
26
19
|
align: align,
|
|
27
20
|
testId: testId,
|
|
28
21
|
backgroundColor: backgroundColor
|
|
29
|
-
}, children &&
|
|
22
|
+
}, children && /*#__PURE__*/React.createElement(Text, {
|
|
30
23
|
weight: "medium"
|
|
31
24
|
}, children));
|
|
32
25
|
};
|
package/dist/es2019/row.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { memo, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { memo, useMemo } from 'react';
|
|
9
2
|
import { useSelection } from './hooks/selection-provider';
|
|
10
3
|
import useExpand from './hooks/use-expand';
|
|
11
4
|
import useExpandContent from './hooks/use-expand-content';
|
|
@@ -52,13 +45,13 @@ const Row = /*#__PURE__*/memo(({
|
|
|
52
45
|
if (isExpanded === false && isExpandableContent) {
|
|
53
46
|
return null;
|
|
54
47
|
}
|
|
55
|
-
let selectableCell = isSelectable &&
|
|
48
|
+
let selectableCell = isSelectable && /*#__PURE__*/React.createElement(SelectableCell, null);
|
|
56
49
|
if (isSelectable && isExpandableContent) {
|
|
57
|
-
selectableCell =
|
|
50
|
+
selectableCell = /*#__PURE__*/React.createElement(SelectableCellPrimitive, {
|
|
58
51
|
as: "td"
|
|
59
52
|
});
|
|
60
53
|
}
|
|
61
|
-
return
|
|
54
|
+
return /*#__PURE__*/React.createElement(TRPrimitive, {
|
|
62
55
|
isSelected: isSelected,
|
|
63
56
|
testId: testId,
|
|
64
57
|
isSubitem: isExpandableContent
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { memo, useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { memo, useCallback, useMemo } from 'react';
|
|
9
2
|
import Checkbox from '@atlaskit/checkbox';
|
|
10
3
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
11
4
|
import { useSelection } from './hooks/selection-provider';
|
|
@@ -21,12 +14,12 @@ const SelectableCellComponent = () => {
|
|
|
21
14
|
const idx = useRowId();
|
|
22
15
|
const isChecked = useMemo(() => allChecked || checked.includes(idx), [allChecked, checked, idx]);
|
|
23
16
|
const onChange = useCallback(e => toggleSelection === null || toggleSelection === void 0 ? void 0 : toggleSelection(idx, e.nativeEvent.shiftKey), [idx, toggleSelection]);
|
|
24
|
-
return
|
|
17
|
+
return /*#__PURE__*/React.createElement(SelectableCellPrimitive, {
|
|
25
18
|
as: "td"
|
|
26
|
-
},
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
27
20
|
isChecked: isChecked,
|
|
28
21
|
onChange: onChange,
|
|
29
|
-
label:
|
|
22
|
+
label: /*#__PURE__*/React.createElement(VisuallyHidden, null, "Select row ", idx + 1)
|
|
30
23
|
}));
|
|
31
24
|
};
|
|
32
25
|
const SelectableCell = /*#__PURE__*/memo(SelectableCellComponent);
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
/* sortable-column.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @jsx jsx
|
|
6
|
-
*/
|
|
3
|
+
import "./sortable-column.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
6
|
import { useCallback } from 'react';
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
11
7
|
import Button from '@atlaskit/button';
|
|
12
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
9
|
import { useTable } from './hooks/use-table';
|
|
@@ -30,13 +26,7 @@ const sortingMessages = {
|
|
|
30
26
|
number: 'Sort from 9 to 0'
|
|
31
27
|
}
|
|
32
28
|
};
|
|
33
|
-
const overrideStyles =
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
35
|
-
margin: '0 -2px !important',
|
|
36
|
-
gap: "var(--ds-space-050, 4px)",
|
|
37
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
38
|
-
paddingInline: `2px !important`
|
|
39
|
-
});
|
|
29
|
+
const overrideStyles = null;
|
|
40
30
|
|
|
41
31
|
/**
|
|
42
32
|
* __SortableColumn__
|
|
@@ -65,28 +55,28 @@ const SortableColumn = ({
|
|
|
65
55
|
const updateSortState = useCallback(
|
|
66
56
|
// @ts-expect-error: TODO: Our `name` typing is off; refer to `SortKey`
|
|
67
57
|
() => setSortState(name), [setSortState, name]);
|
|
68
|
-
return
|
|
58
|
+
return /*#__PURE__*/React.createElement(THPrimitive, _extends({
|
|
69
59
|
testId: testId,
|
|
70
60
|
sortDirection: sortKey === name ? sortDirection : 'none'
|
|
71
61
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
72
|
-
}, other),
|
|
62
|
+
}, other), /*#__PURE__*/React.createElement(Tooltip, {
|
|
73
63
|
content: getSortMessage(),
|
|
74
64
|
position: "top"
|
|
75
|
-
}, tooltipProps =>
|
|
65
|
+
}, tooltipProps => /*#__PURE__*/React.createElement(Button, _extends({
|
|
76
66
|
testId: `${testId}--button`,
|
|
77
67
|
spacing: "compact",
|
|
78
68
|
appearance: "subtle",
|
|
79
|
-
iconAfter:
|
|
69
|
+
iconAfter: /*#__PURE__*/React.createElement(SortIconPrimitive, {
|
|
80
70
|
name: name
|
|
81
71
|
})
|
|
82
72
|
}, tooltipProps, {
|
|
83
73
|
onClick: updateSortState
|
|
84
74
|
// TODO: (from codemod) Buttons with "css" or "style" prop can't be migrated for now. Please wait for the support of xcss prop.
|
|
85
75
|
,
|
|
86
|
-
|
|
76
|
+
|
|
87
77
|
// TODO: i18n support for this attr
|
|
88
|
-
,
|
|
89
|
-
|
|
78
|
+
"aria-roledescription": "Column sort button",
|
|
79
|
+
className: ax(["_19pkgrf3 _2hwxqyou _otyrgrf3 _18u0qyou _zulp1b66 _18zrud7t"])
|
|
90
80
|
}), children)));
|
|
91
81
|
};
|
|
92
82
|
export default SortableColumn;
|
package/dist/es2019/table.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
9
2
|
import SelectionProvider from './hooks/selection-provider';
|
|
10
3
|
import { useSorting } from './hooks/use-sorting';
|
|
11
4
|
import { TableProvider } from './hooks/use-table';
|
|
@@ -36,10 +29,10 @@ function Table({
|
|
|
36
29
|
setSortState,
|
|
37
30
|
sortFn
|
|
38
31
|
}), [isSelectable, localSortKey, setSortState, sortDirection, sortFn]);
|
|
39
|
-
return
|
|
32
|
+
return /*#__PURE__*/React.createElement(TableProvider, {
|
|
40
33
|
state: tableProviderState
|
|
41
|
-
},
|
|
34
|
+
}, /*#__PURE__*/React.createElement(TablePrimitive, {
|
|
42
35
|
testId: testId
|
|
43
|
-
}, isSelectable ?
|
|
36
|
+
}, isSelectable ? /*#__PURE__*/React.createElement(SelectionProvider, null, children) : children));
|
|
44
37
|
}
|
|
45
38
|
export default Table;
|
package/dist/es2019/thead.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React from 'react';
|
|
8
2
|
import Checkbox from '@atlaskit/checkbox';
|
|
9
3
|
import Inline from '@atlaskit/primitives/inline';
|
|
10
4
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
@@ -26,18 +20,18 @@ const THead = ({
|
|
|
26
20
|
removeAll
|
|
27
21
|
}] = useSelection();
|
|
28
22
|
const isChecked = state.allChecked || state.anyChecked;
|
|
29
|
-
return
|
|
23
|
+
return /*#__PURE__*/React.createElement(THeadPrimitive, null, /*#__PURE__*/React.createElement(TRPrimitive, {
|
|
30
24
|
isBodyRow: false
|
|
31
|
-
}, isSelectable &&
|
|
25
|
+
}, isSelectable && /*#__PURE__*/React.createElement(SelectableCellPrimitive, {
|
|
32
26
|
as: "th"
|
|
33
|
-
},
|
|
34
|
-
label:
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
28
|
+
label: /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
35
29
|
id: "select-all"
|
|
36
30
|
}, "Select all rows"),
|
|
37
31
|
onChange: isChecked ? removeAll : setAll,
|
|
38
32
|
isChecked: isChecked,
|
|
39
33
|
isIndeterminate: state.anyChecked && !state.allChecked
|
|
40
|
-
})), children, isSelectable && isChecked &&
|
|
34
|
+
})), children, isSelectable && isChecked && /*#__PURE__*/React.createElement(BulkActionOverlayPrimitive, null, /*#__PURE__*/React.createElement("span", {
|
|
41
35
|
style: {
|
|
42
36
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
43
37
|
color: "var(--ds-text, #172B4D)",
|
|
@@ -45,7 +39,7 @@ const THead = ({
|
|
|
45
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
46
40
|
fontWeight: "var(--ds-font-weight-medium, 500)"
|
|
47
41
|
}
|
|
48
|
-
}, state.checked.length, " selected"), actions &&
|
|
42
|
+
}, state.checked.length, " selected"), actions && /*#__PURE__*/React.createElement(Inline, {
|
|
49
43
|
alignBlock: "stretch",
|
|
50
44
|
space: "space.100"
|
|
51
45
|
}, actions(state.checked)))));
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
10
2
|
|
|
11
3
|
// TODO: Using HipChat icons as the standard icon set is missing large
|
|
12
4
|
// versions of `chevron-up` and `chevron-down`, despite already including
|
|
@@ -24,14 +16,14 @@ export const ExpandIcon = /*#__PURE__*/memo(({
|
|
|
24
16
|
}) => {
|
|
25
17
|
switch (isExpanded) {
|
|
26
18
|
case true:
|
|
27
|
-
return
|
|
19
|
+
return /*#__PURE__*/React.createElement(ChevronUpIcon, {
|
|
28
20
|
color: "currentColor",
|
|
29
21
|
LEGACY_size: "small",
|
|
30
22
|
label: "",
|
|
31
23
|
LEGACY_primaryColor: "inherit"
|
|
32
24
|
});
|
|
33
25
|
case false:
|
|
34
|
-
return
|
|
26
|
+
return /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
35
27
|
color: "currentColor",
|
|
36
28
|
LEGACY_size: "small",
|
|
37
29
|
label: "",
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
10
2
|
import ArrowDownIcon from '@atlaskit/icon/utility/migration/arrow-down';
|
|
11
3
|
import ArrowUpIcon from '@atlaskit/icon/utility/migration/arrow-up';
|
|
12
4
|
import { useTable } from '../hooks/use-table';
|
|
@@ -26,14 +18,14 @@ export const SortIcon = /*#__PURE__*/memo(({
|
|
|
26
18
|
if (sortKey === name) {
|
|
27
19
|
switch (sortDirection) {
|
|
28
20
|
case 'ascending':
|
|
29
|
-
return
|
|
21
|
+
return /*#__PURE__*/React.createElement(ArrowUpIcon, {
|
|
30
22
|
color: "currentColor",
|
|
31
23
|
LEGACY_size: "small",
|
|
32
24
|
label: "",
|
|
33
25
|
LEGACY_primaryColor: "inherit"
|
|
34
26
|
});
|
|
35
27
|
case 'descending':
|
|
36
|
-
return
|
|
28
|
+
return /*#__PURE__*/React.createElement(ArrowDownIcon, {
|
|
37
29
|
color: "currentColor",
|
|
38
30
|
LEGACY_size: "small",
|
|
39
31
|
label: "",
|
package/dist/es2019/ui/table.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React from 'react';
|
|
8
2
|
/**
|
|
9
3
|
* __Table__
|
|
10
4
|
*
|
|
@@ -20,7 +14,7 @@ export const Table = ({
|
|
|
20
14
|
testId,
|
|
21
15
|
summary
|
|
22
16
|
}) => {
|
|
23
|
-
return
|
|
17
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
24
18
|
"data-testid": testId
|
|
25
|
-
}, summary &&
|
|
19
|
+
}, summary && /*#__PURE__*/React.createElement("caption", null, summary), children);
|
|
26
20
|
};
|