@atlaskit/table-tree 11.2.2 → 12.1.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 +30 -0
- package/dist/cjs/components/cell.js +1 -2
- package/dist/cjs/components/header.compiled.css +3 -0
- package/dist/cjs/components/header.js +14 -16
- package/dist/cjs/components/headers.compiled.css +2 -0
- package/dist/cjs/components/headers.js +21 -25
- package/dist/cjs/components/internal/common-cell.compiled.css +10 -0
- package/dist/cjs/components/internal/common-cell.js +18 -25
- package/dist/cjs/components/internal/item.js +6 -10
- package/dist/cjs/components/internal/loader-item.js +1 -1
- package/dist/cjs/components/internal/overflow-container.compiled.css +4 -0
- package/dist/cjs/components/internal/overflow-container.js +11 -15
- package/dist/cjs/components/internal/styled.compiled.css +8 -0
- package/dist/cjs/components/internal/styled.js +32 -43
- package/dist/cjs/components/row.compiled.css +1 -0
- package/dist/cjs/components/row.js +10 -17
- package/dist/cjs/utils/table-tree-data-helper.js +4 -49
- package/dist/es2019/components/cell.js +1 -2
- package/dist/es2019/components/header.compiled.css +3 -0
- package/dist/es2019/components/header.js +8 -15
- package/dist/es2019/components/headers.compiled.css +2 -0
- package/dist/es2019/components/headers.js +9 -17
- package/dist/es2019/components/internal/common-cell.compiled.css +10 -0
- package/dist/es2019/components/internal/common-cell.js +7 -23
- package/dist/es2019/components/internal/item.js +3 -10
- package/dist/es2019/components/internal/loader-item.js +2 -2
- package/dist/es2019/components/internal/overflow-container.compiled.css +4 -0
- package/dist/es2019/components/internal/overflow-container.js +8 -16
- package/dist/es2019/components/internal/styled.compiled.css +8 -0
- package/dist/es2019/components/internal/styled.js +19 -43
- package/dist/es2019/components/row.compiled.css +1 -0
- package/dist/es2019/components/row.js +10 -16
- package/dist/es2019/utils/table-tree-data-helper.js +2 -42
- package/dist/esm/components/cell.js +1 -2
- package/dist/esm/components/header.compiled.css +3 -0
- package/dist/esm/components/header.js +11 -15
- package/dist/esm/components/headers.compiled.css +2 -0
- package/dist/esm/components/headers.js +18 -24
- package/dist/esm/components/internal/common-cell.compiled.css +10 -0
- package/dist/esm/components/internal/common-cell.js +15 -26
- package/dist/esm/components/internal/item.js +3 -10
- package/dist/esm/components/internal/loader-item.js +2 -2
- package/dist/esm/components/internal/overflow-container.compiled.css +4 -0
- package/dist/esm/components/internal/overflow-container.js +8 -16
- package/dist/esm/components/internal/styled.compiled.css +8 -0
- package/dist/esm/components/internal/styled.js +28 -43
- package/dist/esm/components/row.compiled.css +1 -0
- package/dist/esm/components/row.js +10 -16
- package/dist/esm/utils/table-tree-data-helper.js +2 -47
- package/dist/types/components/headers.d.ts +1 -2
- package/dist/types/components/internal/common-cell.d.ts +1 -1
- package/dist/types/components/internal/item.d.ts +2 -6
- package/dist/types/components/internal/overflow-container.d.ts +1 -1
- package/dist/types/components/internal/styled.d.ts +1 -2
- package/dist/types/components/row.d.ts +1 -2
- package/dist/types/utils/table-tree-data-helper.d.ts +2 -4
- package/dist/types-ts4.5/components/headers.d.ts +1 -2
- package/dist/types-ts4.5/components/internal/common-cell.d.ts +1 -1
- package/dist/types-ts4.5/components/internal/item.d.ts +2 -6
- package/dist/types-ts4.5/components/internal/overflow-container.d.ts +1 -1
- package/dist/types-ts4.5/components/internal/styled.d.ts +1 -2
- package/dist/types-ts4.5/components/row.d.ts +1 -2
- package/dist/types-ts4.5/utils/table-tree-data-helper.d.ts +2 -4
- package/package.json +5 -6
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
1
|
+
/* headers.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./headers.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import { Children, cloneElement } from 'react';
|
|
6
|
+
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
|
-
var containerStyles = css({
|
|
11
|
-
display: 'flex',
|
|
12
|
-
borderBlockEnd: "solid 2px ".concat("var(--ds-border, #dfe1e6)")
|
|
13
|
-
});
|
|
8
|
+
var containerStyles = null;
|
|
14
9
|
/**
|
|
15
10
|
* __Headers__
|
|
16
11
|
*
|
|
@@ -21,18 +16,17 @@ var containerStyles = css({
|
|
|
21
16
|
*/
|
|
22
17
|
var Headers = function Headers(_ref) {
|
|
23
18
|
var children = _ref.children;
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
role: "row",
|
|
21
|
+
className: ax(["_179r1avd _1e0c1txw"]),
|
|
22
|
+
style: {
|
|
23
|
+
"--_zailfs": ix("solid 2px ".concat("var(--ds-border, #dfe1e6)"))
|
|
24
|
+
}
|
|
25
|
+
}, Children.map(children, function (header, index) {
|
|
26
|
+
return /*#__PURE__*/cloneElement(header, {
|
|
27
|
+
key: index,
|
|
28
|
+
columnIndex: index
|
|
29
|
+
});
|
|
30
|
+
}));
|
|
37
31
|
};
|
|
38
32
|
export default Headers;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._1yt41p08{padding:var(--_1s9siax)}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._1nmz1hna{word-break:break-word}
|
|
5
|
+
._1tke1ylp{min-height:40px}
|
|
6
|
+
._4cvr1h6o{align-items:center}
|
|
7
|
+
._ct361wug{-ms-hyphens:auto;hyphens:auto}
|
|
8
|
+
._kqswh2mm{position:relative}
|
|
9
|
+
._syaz1o8f{color:var(--_ggxzyp)}
|
|
10
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
+
/* common-cell.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
5
|
var _excluded = ["indent", "width"];
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
6
|
+
import "./common-cell.compiled.css";
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
|
+
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; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
import { N800 } from '@atlaskit/theme/colors';
|
|
12
|
-
|
|
13
|
-
var commonStyles = css({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
boxSizing: 'border-box',
|
|
16
|
-
minHeight: 40,
|
|
17
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
|
-
padding: "var(--ds-space-100, 10px)".concat(" ", indentBase, " ", "var(--ds-space-100, 10px)", " var(--indent, ").concat(indentBase, ")"),
|
|
19
|
-
position: 'relative',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
color: "var(--ds-text, ".concat(N800, ")"),
|
|
22
|
-
font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
23
|
-
hyphens: 'auto',
|
|
24
|
-
wordBreak: 'break-word'
|
|
25
|
-
});
|
|
12
|
+
var commonStyles = null;
|
|
26
13
|
/**
|
|
27
14
|
* __Common cell__
|
|
28
15
|
*/
|
|
@@ -30,16 +17,18 @@ var CommonCell = function CommonCell(_ref) {
|
|
|
30
17
|
var indent = _ref.indent,
|
|
31
18
|
width = _ref.width,
|
|
32
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
return
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
34
21
|
role: "gridcell"
|
|
35
22
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
36
23
|
}, props, {
|
|
37
|
-
|
|
38
|
-
style: {
|
|
24
|
+
className: ax(["_1yt41p08 _11c82smr _1e0c1txw _vchhusvi _1tke1ylp _kqswh2mm _4cvr1h6o _syaz1o8f _ct361wug _1nmz1hna"]),
|
|
25
|
+
style: _objectSpread(_objectSpread({}, {
|
|
39
26
|
'--indent': indent,
|
|
40
27
|
width: width
|
|
41
|
-
},
|
|
42
|
-
|
|
28
|
+
}), {}, {
|
|
29
|
+
"--_1s9siax": ix("var(--ds-space-100, 10px)".concat(" ", "var(--ds-space-300, 25px)", " ", "var(--ds-space-100, 10px)", " var(--indent, ", "var(--ds-space-300, 25px)", ")")),
|
|
30
|
+
"--_ggxzyp": ix("var(--ds-text, ".concat(N800, ")"))
|
|
31
|
+
})
|
|
43
32
|
}));
|
|
44
33
|
};
|
|
45
34
|
export default CommonCell;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
6
|
-
import { cloneElement } 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, { cloneElement } from 'react';
|
|
10
3
|
import toItemId from '../../utils/to-item-id';
|
|
11
4
|
import Items from './items';
|
|
12
5
|
/**
|
|
@@ -32,9 +25,9 @@ function Item(_ref) {
|
|
|
32
25
|
data: data,
|
|
33
26
|
loadingLabel: loadingLabel,
|
|
34
27
|
renderChildren: function renderChildren() {
|
|
35
|
-
return
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
29
|
id: !!itemId ? toItemId(itemId) : undefined
|
|
37
|
-
},
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Items, {
|
|
38
31
|
depth: depth,
|
|
39
32
|
items: items,
|
|
40
33
|
render: render,
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import Spinner from '@atlaskit/spinner';
|
|
5
5
|
import CommonCell from './common-cell';
|
|
6
|
-
import {
|
|
6
|
+
import { LoaderItemContainer, TreeRowContainer } from './styled';
|
|
7
7
|
var LoaderItem = function LoaderItem(_ref) {
|
|
8
8
|
var _ref$depth = _ref.depth,
|
|
9
9
|
depth = _ref$depth === void 0 ? 1 : _ref$depth,
|
|
@@ -23,7 +23,7 @@ var LoaderItem = function LoaderItem(_ref) {
|
|
|
23
23
|
}
|
|
24
24
|
}, [isCompleting, onComplete, phase]);
|
|
25
25
|
return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(CommonCell, {
|
|
26
|
-
indent: "calc(".concat(
|
|
26
|
+
indent: "calc(".concat("var(--ds-space-300, 25px)", " * ", depth, ")"),
|
|
27
27
|
width: "100%"
|
|
28
28
|
}, /*#__PURE__*/React.createElement(LoaderItemContainer, {
|
|
29
29
|
isRoot: depth === 1
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
+
/* overflow-container.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
var _excluded = ["isSingleLine"];
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
var overflowContainerStyles = css({
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
textOverflow: 'ellipsis',
|
|
14
|
-
whiteSpace: 'nowrap'
|
|
15
|
-
});
|
|
5
|
+
import "./overflow-container.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
+
var overflowContainerStyles = null;
|
|
16
9
|
|
|
17
10
|
/**
|
|
18
11
|
* __Overflow container__
|
|
@@ -20,9 +13,8 @@ var overflowContainerStyles = css({
|
|
|
20
13
|
var OverflowContainer = function OverflowContainer(_ref) {
|
|
21
14
|
var isSingleLine = _ref.isSingleLine,
|
|
22
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, props));
|
|
16
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
17
|
+
className: ax([isSingleLine && "_1reo15vq _18m915vq _1bto1l2s _o5721q9c"])
|
|
18
|
+
}));
|
|
27
19
|
};
|
|
28
20
|
export default OverflowContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
._179rskuj{border-block-end:var(--_1prvtx9)}
|
|
2
|
+
._1bsb1osq{width:100%}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._1pfhj39m{margin-block-start:-3px}
|
|
5
|
+
._4cvr1h6o{align-items:center}
|
|
6
|
+
._ahbq1dum{margin-inline-start:var(--_1izje1g)}
|
|
7
|
+
._bozg1ssb{padding-inline-start:50%}
|
|
8
|
+
._kqswstnw{position:absolute}
|
|
@@ -1,60 +1,43 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
4
|
var _excluded = ["isRoot"];
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
5
|
+
import "./styled.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
11
8
|
import { N30 } from '@atlaskit/theme/colors';
|
|
12
|
-
|
|
13
|
-
var treeRowContainerStyles = css({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
borderBlockEnd: "1px solid ".concat("var(--ds-border, ".concat(N30, ")"))
|
|
16
|
-
});
|
|
9
|
+
var treeRowContainerStyles = null;
|
|
17
10
|
|
|
18
11
|
/**
|
|
19
12
|
* __Tree row container__
|
|
20
13
|
*/
|
|
21
14
|
export var TreeRowContainer = function TreeRowContainer(props) {
|
|
22
|
-
return
|
|
23
|
-
role: "row"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
16
|
+
role: "row"
|
|
17
|
+
}, props, {
|
|
18
|
+
className: ax(["_179rskuj _1e0c1txw"]),
|
|
19
|
+
style: {
|
|
20
|
+
"--_1prvtx9": ix("1px solid ".concat("var(--ds-border, ".concat(N30, ")")))
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
27
23
|
};
|
|
28
|
-
var commonCellElementStyles =
|
|
29
|
-
|
|
30
|
-
position: 'absolute',
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
// indentBase is re-used elsewhere and is primarily used as positive value; we need to negate it here
|
|
33
|
-
marginInlineStart: "calc(".concat(indentBase, " * -1)")
|
|
34
|
-
});
|
|
35
|
-
var commonChevronContainerStyles = css({
|
|
36
|
-
// Aligns position:absolute chevron button with the adjacent text. Any future visual breaking changes
|
|
37
|
-
// should consider setting this to `-2px` for better alignment, or refactor completely
|
|
38
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
39
|
-
marginBlockStart: -3
|
|
40
|
-
});
|
|
24
|
+
var commonCellElementStyles = null;
|
|
25
|
+
var commonChevronContainerStyles = null;
|
|
41
26
|
/**
|
|
42
27
|
* __Chevron container__
|
|
43
28
|
*
|
|
44
29
|
* A wrapper container around the expand table tree button.
|
|
45
30
|
*/
|
|
46
31
|
export var ChevronContainer = function ChevronContainer(props) {
|
|
47
|
-
return
|
|
48
|
-
|
|
32
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
33
|
+
className: ax(["_1e0c1txw _kqswstnw _4cvr1h6o _ahbq1dum", "_1pfhj39m"]),
|
|
34
|
+
style: {
|
|
35
|
+
"--_1izje1g": ix("calc(".concat("var(--ds-space-300, 25px)", " * -1)"))
|
|
36
|
+
}
|
|
49
37
|
}));
|
|
50
38
|
};
|
|
51
|
-
var loadingItemContainerStyles =
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
var paddingLeftStyles = css({
|
|
55
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
56
|
-
paddingInlineStart: '50%'
|
|
57
|
-
});
|
|
39
|
+
var loadingItemContainerStyles = null;
|
|
40
|
+
var paddingLeftStyles = null;
|
|
58
41
|
/**
|
|
59
42
|
* __Loader item container__
|
|
60
43
|
*
|
|
@@ -63,8 +46,10 @@ var paddingLeftStyles = css({
|
|
|
63
46
|
export var LoaderItemContainer = function LoaderItemContainer(_ref) {
|
|
64
47
|
var isRoot = _ref.isRoot,
|
|
65
48
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
50
|
+
className: ax(["_1e0c1txw _kqswstnw _4cvr1h6o _ahbq1dum", "_1bsb1osq", isRoot && "_bozg1ssb"]),
|
|
51
|
+
style: {
|
|
52
|
+
"--_1izje1g": ix("calc(".concat("var(--ds-space-300, 25px)", " * -1)"))
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
70
55
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._80omtlke{cursor:pointer}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
/* row.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
3
|
+
import "./row.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
5
|
import React, { Fragment, useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
6
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
11
7
|
import toItemId from '../utils/to-item-id';
|
|
12
8
|
import Chevron from './internal/chevron';
|
|
13
9
|
import { TreeRowContainer } from './internal/styled';
|
|
14
|
-
var treeRowClickableStyles =
|
|
15
|
-
cursor: 'pointer'
|
|
16
|
-
});
|
|
10
|
+
var treeRowClickableStyles = null;
|
|
17
11
|
var getExtendedLabel = function getExtendedLabel(cellContent, cellIndex, mainColumnForExpandCollapseLabel) {
|
|
18
12
|
/**
|
|
19
13
|
* First condition - when we pass data via `items` property in `<TableTree />`
|
|
@@ -58,7 +52,7 @@ function Row(_ref) {
|
|
|
58
52
|
actionSubject: 'tableTree',
|
|
59
53
|
componentName: 'row',
|
|
60
54
|
packageName: "@atlaskit/table-tree",
|
|
61
|
-
packageVersion: "
|
|
55
|
+
packageVersion: "12.1.0"
|
|
62
56
|
});
|
|
63
57
|
var onCollapse = usePlatformLeafEventHandler({
|
|
64
58
|
fn: function fn(value) {
|
|
@@ -68,7 +62,7 @@ function Row(_ref) {
|
|
|
68
62
|
actionSubject: 'tableTree',
|
|
69
63
|
componentName: 'row',
|
|
70
64
|
packageName: "@atlaskit/table-tree",
|
|
71
|
-
packageVersion: "
|
|
65
|
+
packageVersion: "12.1.0"
|
|
72
66
|
});
|
|
73
67
|
|
|
74
68
|
/**
|
|
@@ -107,7 +101,7 @@ function Row(_ref) {
|
|
|
107
101
|
var cellContent = cell.props.children || [];
|
|
108
102
|
var extendedLabel = getExtendedLabel(cellContent, cellIndex, mainColumnForExpandCollapseLabel);
|
|
109
103
|
if (isFirstCell && hasChildren) {
|
|
110
|
-
cellContent = [
|
|
104
|
+
cellContent = [/*#__PURE__*/React.createElement(Chevron, {
|
|
111
105
|
key: "chevron",
|
|
112
106
|
expandLabel: expandLabel,
|
|
113
107
|
collapseLabel: collapseLabel,
|
|
@@ -125,11 +119,11 @@ function Row(_ref) {
|
|
|
125
119
|
indentLevel: indentLevel
|
|
126
120
|
}, cellContent);
|
|
127
121
|
};
|
|
128
|
-
return
|
|
129
|
-
css: hasChildren && shouldExpandOnClick ? treeRowClickableStyles : undefined,
|
|
122
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TreeRowContainer, {
|
|
130
123
|
onClick: hasChildren && shouldExpandOnClick ? onClickHandler : undefined,
|
|
131
124
|
"aria-expanded": hasChildren ? isExpandedState : undefined,
|
|
132
|
-
"aria-level": depth ? depth : undefined
|
|
125
|
+
"aria-level": depth ? depth : undefined,
|
|
126
|
+
className: ax([hasChildren && shouldExpandOnClick && "_80omtlke"])
|
|
133
127
|
}, React.Children.map(children, function (cell, index) {
|
|
134
128
|
return renderCell(cell, index);
|
|
135
129
|
})), hasChildren && (isProvidedExpanded !== undefined ? isProvidedExpanded : isExpandedState) && renderChildren && renderChildren());
|
|
@@ -4,49 +4,8 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
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; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore?tab=readme-ov-file#_get
|
|
11
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13126
|
|
12
|
-
export var internalGet = function internalGet(obj, path) {
|
|
13
|
-
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
14
|
-
var travel = function travel(regexp) {
|
|
15
|
-
return String.prototype.split.call(path, regexp).filter(Boolean).reduce(function (res, key) {
|
|
16
|
-
return res !== null && res !== undefined ? res[key] : res;
|
|
17
|
-
}, obj);
|
|
18
|
-
};
|
|
19
|
-
var result = travel(/[,[\]]+?/) || travel(/[,[\].]+?/);
|
|
20
|
-
return result === undefined || result === obj ? defaultValue : result;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// https://stackoverflow.com/a/54733755/14857724
|
|
24
|
-
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13673
|
|
25
|
-
export var internalSet = function internalSet(obj, providedPath, value) {
|
|
26
|
-
// When obj is not an object, fail gracefully
|
|
27
|
-
if (Object(obj) !== obj) {
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// If not yet an array, get the keys from the string-path
|
|
32
|
-
var path = !Array.isArray(providedPath) ? providedPath.toString().match(/[^.[\]]+/g) || [] : providedPath;
|
|
33
|
-
|
|
34
|
-
// Iterate all of them except the last one
|
|
35
|
-
var result = path.slice(0, -1).reduce(function (acc, c, index) {
|
|
36
|
-
// Does the key exist and is its value an object?
|
|
37
|
-
return Object(acc[c]) === acc[c] ? acc[c] // Yes: then follow that path
|
|
38
|
-
:
|
|
39
|
-
// No: create the key. Is the next key a potential array-index?
|
|
40
|
-
acc[c] = Math.abs(parseInt(path[index + 1])) >> 0 === +path[index + 1] ? [] // Yes: assign a new array object
|
|
41
|
-
: {}; // No: assign a new plain object
|
|
42
|
-
}, obj);
|
|
43
|
-
|
|
44
|
-
// Finally assign the value to the last key
|
|
45
|
-
result[path[path.length - 1]] = value;
|
|
46
|
-
|
|
47
|
-
// Return the top-level object to allow chaining
|
|
48
|
-
return obj;
|
|
49
|
-
};
|
|
7
|
+
import get from 'lodash/get';
|
|
8
|
+
import set from 'lodash/set';
|
|
50
9
|
function updateRootItems(rootItems) {
|
|
51
10
|
var allItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
52
11
|
var _ref = arguments.length > 2 ? arguments[2] : undefined,
|
|
@@ -74,10 +33,6 @@ function updateChildItems(newitems, allTableItems, itemParent, _ref2) {
|
|
|
74
33
|
var key = _ref2.key,
|
|
75
34
|
keysCache = _ref2.keysCache,
|
|
76
35
|
operation = _ref2.operation;
|
|
77
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
78
|
-
var get = fg('dst-a11y-remove-lodash-from-table-tree') ? internalGet : lodashGet;
|
|
79
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
80
|
-
var set = fg('dst-a11y-remove-lodash-from-table-tree') ? internalSet : lodashSet;
|
|
81
36
|
var newKeysCache = _objectSpread({}, keysCache);
|
|
82
37
|
var parentCacheKey = itemParent[key];
|
|
83
38
|
if (parentCacheKey === undefined) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactElement } from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
6
|
interface HeadersProps {
|
|
8
7
|
children: ReactElement | ReactElement[];
|
|
9
8
|
}
|
|
@@ -15,5 +14,5 @@ interface HeadersProps {
|
|
|
15
14
|
* - [Examples](https://atlassian.design/components/table-tree/examples#advanced)
|
|
16
15
|
* - [Code](https://atlassian.design/components/table-tree/code#headers-props)
|
|
17
16
|
*/
|
|
18
|
-
declare const Headers: ({ children }: HeadersProps) =>
|
|
17
|
+
declare const Headers: ({ children }: HeadersProps) => JSX.Element;
|
|
19
18
|
export default Headers;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type ReactElement } from 'react';
|
|
1
|
+
import React, { type ReactElement } from 'react';
|
|
6
2
|
import { type RowProps } from '../row';
|
|
7
3
|
import { type RowsProps } from '../rows';
|
|
8
4
|
type ItemProps<Item> = {
|
|
@@ -25,5 +21,5 @@ type ItemProps<Item> = {
|
|
|
25
21
|
*/
|
|
26
22
|
declare function Item<Item extends {
|
|
27
23
|
id: string;
|
|
28
|
-
}>({ depth, data, render, loadingLabel, }: ItemProps<Item>): ReactElement<RowProps<Item> | RowsProps<Item>, string |
|
|
24
|
+
}>({ depth, data, render, loadingLabel, }: ItemProps<Item>): React.ReactElement<RowProps<Item> | RowsProps<Item>, string | React.JSXElementConstructor<any>> | null;
|
|
29
25
|
export default Item;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React, { type ReactNode } from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
6
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
8
7
|
export interface RowProps<Item> {
|
|
9
8
|
/**
|
|
@@ -81,5 +80,5 @@ export interface RowProps<Item> {
|
|
|
81
80
|
}
|
|
82
81
|
declare function Row<Item extends {
|
|
83
82
|
id: string;
|
|
84
|
-
}>({ shouldExpandOnClick, hasChildren, depth, renderChildren, isDefaultExpanded, data, onExpand: providedOnExpand, onCollapse: providedOnCollapse, mainColumnForExpandCollapseLabel, expandLabel, collapseLabel, itemId, children, isExpanded: isProvidedExpanded, }: RowProps<Item>):
|
|
83
|
+
}>({ shouldExpandOnClick, hasChildren, depth, renderChildren, isDefaultExpanded, data, onExpand: providedOnExpand, onCollapse: providedOnCollapse, mainColumnForExpandCollapseLabel, expandLabel, collapseLabel, itemId, children, isExpanded: isProvidedExpanded, }: RowProps<Item>): JSX.Element;
|
|
85
84
|
export default Row;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const internalGet: (obj: Object, path: Array<any> | string, defaultValue?: any) => any;
|
|
2
|
-
export declare const internalSet: (obj: Object, providedPath: Array<any> | string, value: any) => any;
|
|
3
1
|
/**
|
|
4
2
|
* This helper class will create a cache of all the id's in the items object and
|
|
5
3
|
* path to the object.
|
|
@@ -22,6 +20,6 @@ export default class TableTreeDataHelper<T extends any = any> {
|
|
|
22
20
|
constructor({ key }?: {
|
|
23
21
|
key?: keyof T | undefined;
|
|
24
22
|
});
|
|
25
|
-
updateItems(items: T[], allItems?: T[], parentItem?: T | null):
|
|
26
|
-
appendItems(items: T[], allItems?: T[], parentItem?: T | null):
|
|
23
|
+
updateItems(items: T[], allItems?: T[], parentItem?: T | null): T[];
|
|
24
|
+
appendItems(items: T[], allItems?: T[], parentItem?: T | null): T[];
|
|
27
25
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactElement } from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
6
|
interface HeadersProps {
|
|
8
7
|
children: ReactElement | ReactElement[];
|
|
9
8
|
}
|
|
@@ -15,5 +14,5 @@ interface HeadersProps {
|
|
|
15
14
|
* - [Examples](https://atlassian.design/components/table-tree/examples#advanced)
|
|
16
15
|
* - [Code](https://atlassian.design/components/table-tree/code#headers-props)
|
|
17
16
|
*/
|
|
18
|
-
declare const Headers: ({ children }: HeadersProps) =>
|
|
17
|
+
declare const Headers: ({ children }: HeadersProps) => JSX.Element;
|
|
19
18
|
export default Headers;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { type ReactElement } from 'react';
|
|
1
|
+
import React, { type ReactElement } from 'react';
|
|
6
2
|
import { type RowProps } from '../row';
|
|
7
3
|
import { type RowsProps } from '../rows';
|
|
8
4
|
type ItemProps<Item> = {
|
|
@@ -25,5 +21,5 @@ type ItemProps<Item> = {
|
|
|
25
21
|
*/
|
|
26
22
|
declare function Item<Item extends {
|
|
27
23
|
id: string;
|
|
28
|
-
}>({ depth, data, render, loadingLabel, }: ItemProps<Item>): ReactElement<RowProps<Item> | RowsProps<Item>, string |
|
|
24
|
+
}>({ depth, data, render, loadingLabel, }: ItemProps<Item>): React.ReactElement<RowProps<Item> | RowsProps<Item>, string | React.JSXElementConstructor<any>> | null;
|
|
29
25
|
export default Item;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React, { type ReactNode } from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
6
|
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
8
7
|
export interface RowProps<Item> {
|
|
9
8
|
/**
|
|
@@ -81,5 +80,5 @@ export interface RowProps<Item> {
|
|
|
81
80
|
}
|
|
82
81
|
declare function Row<Item extends {
|
|
83
82
|
id: string;
|
|
84
|
-
}>({ shouldExpandOnClick, hasChildren, depth, renderChildren, isDefaultExpanded, data, onExpand: providedOnExpand, onCollapse: providedOnCollapse, mainColumnForExpandCollapseLabel, expandLabel, collapseLabel, itemId, children, isExpanded: isProvidedExpanded, }: RowProps<Item>):
|
|
83
|
+
}>({ shouldExpandOnClick, hasChildren, depth, renderChildren, isDefaultExpanded, data, onExpand: providedOnExpand, onCollapse: providedOnCollapse, mainColumnForExpandCollapseLabel, expandLabel, collapseLabel, itemId, children, isExpanded: isProvidedExpanded, }: RowProps<Item>): JSX.Element;
|
|
85
84
|
export default Row;
|