@atlaskit/table-tree 9.2.7 → 9.2.9
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 +12 -0
- package/dist/cjs/components/cell.js +6 -31
- package/dist/cjs/components/header.js +0 -21
- package/dist/cjs/components/headers.js +0 -16
- package/dist/cjs/components/internal/chevron.js +4 -31
- package/dist/cjs/components/internal/common-cell.js +2 -11
- package/dist/cjs/components/internal/item.js +5 -25
- package/dist/cjs/components/internal/items.js +6 -32
- package/dist/cjs/components/internal/loader-item.js +0 -26
- package/dist/cjs/components/internal/overflow-container.js +4 -9
- package/dist/cjs/components/internal/styled.js +13 -20
- package/dist/cjs/components/internal/with-column-width.js +3 -25
- package/dist/cjs/components/row.js +7 -46
- package/dist/cjs/components/rows.js +2 -20
- package/dist/cjs/components/table-tree.js +10 -45
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/utils/table-tree-data-helper.js +20 -50
- package/dist/cjs/utils/to-item-id.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/cell.js +0 -3
- package/dist/es2019/components/header.js +0 -4
- package/dist/es2019/components/headers.js +0 -2
- package/dist/es2019/components/internal/chevron.js +0 -6
- package/dist/es2019/components/internal/common-cell.js +1 -3
- package/dist/es2019/components/internal/item.js +0 -6
- package/dist/es2019/components/internal/items.js +0 -10
- package/dist/es2019/components/internal/loader-item.js +0 -8
- package/dist/es2019/components/internal/overflow-container.js +4 -4
- package/dist/es2019/components/internal/styled.js +13 -10
- package/dist/es2019/components/internal/with-column-width.js +0 -6
- package/dist/es2019/components/row.js +1 -19
- package/dist/es2019/components/rows.js +0 -1
- package/dist/es2019/components/table-tree.js +2 -14
- package/dist/es2019/utils/table-tree-data-helper.js +9 -19
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/cell.js +6 -17
- package/dist/esm/components/header.js +0 -10
- package/dist/esm/components/headers.js +0 -11
- package/dist/esm/components/internal/chevron.js +4 -20
- package/dist/esm/components/internal/common-cell.js +3 -6
- package/dist/esm/components/internal/item.js +5 -19
- package/dist/esm/components/internal/items.js +6 -23
- package/dist/esm/components/internal/loader-item.js +0 -16
- package/dist/esm/components/internal/overflow-container.js +5 -6
- package/dist/esm/components/internal/styled.js +14 -12
- package/dist/esm/components/internal/with-column-width.js +3 -13
- package/dist/esm/components/row.js +7 -31
- package/dist/esm/components/rows.js +2 -12
- package/dist/esm/components/table-tree.js +10 -32
- package/dist/esm/utils/table-tree-data-helper.js +20 -48
- package/dist/esm/version.json +1 -1
- package/package.json +5 -4
- package/report.api.md +14 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
/* eslint-disable react/prop-types */
|
|
4
3
|
import React, { Component } from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
@@ -11,34 +10,27 @@ import Rows from './rows';
|
|
|
11
10
|
export default class TableTree extends Component {
|
|
12
11
|
constructor(...args) {
|
|
13
12
|
super(...args);
|
|
14
|
-
|
|
15
13
|
_defineProperty(this, "state", {
|
|
16
14
|
columnWidths: []
|
|
17
15
|
});
|
|
18
|
-
|
|
19
16
|
_defineProperty(this, "setColumnWidth", (columnIndex, width) => {
|
|
20
17
|
const {
|
|
21
18
|
columnWidths
|
|
22
19
|
} = this.state;
|
|
23
|
-
|
|
24
20
|
if (width === columnWidths[columnIndex]) {
|
|
25
21
|
return;
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
columnWidths[columnIndex] = width;
|
|
29
24
|
this.setState({
|
|
30
25
|
columnWidths
|
|
31
26
|
});
|
|
32
27
|
});
|
|
33
|
-
|
|
34
28
|
_defineProperty(this, "getColumnWidth", columnIndex => {
|
|
35
29
|
return this.state && this.state.columnWidths[columnIndex] || null;
|
|
36
30
|
});
|
|
37
31
|
}
|
|
38
|
-
|
|
39
32
|
componentDidMount() {
|
|
40
33
|
const widths = this.props.columnWidths;
|
|
41
|
-
|
|
42
34
|
if (widths) {
|
|
43
35
|
this.setState({
|
|
44
36
|
columnWidths: widths
|
|
@@ -55,7 +47,6 @@ export default class TableTree extends Component {
|
|
|
55
47
|
}
|
|
56
48
|
};
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
render() {
|
|
60
51
|
const {
|
|
61
52
|
items,
|
|
@@ -72,7 +63,6 @@ export default class TableTree extends Component {
|
|
|
72
63
|
width: columnWidths[index]
|
|
73
64
|
}, header)));
|
|
74
65
|
let rows = null;
|
|
75
|
-
|
|
76
66
|
if (columns && items) {
|
|
77
67
|
rows = /*#__PURE__*/React.createElement(Rows, {
|
|
78
68
|
items: items,
|
|
@@ -85,7 +75,8 @@ export default class TableTree extends Component {
|
|
|
85
75
|
itemId: id,
|
|
86
76
|
items: children,
|
|
87
77
|
hasChildren: hasChildren
|
|
88
|
-
}, columns.map((CellContent, index) => /*#__PURE__*/React.createElement(Cell
|
|
78
|
+
}, columns.map((CellContent, index) => /*#__PURE__*/React.createElement(Cell
|
|
79
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
89
80
|
, {
|
|
90
81
|
key: index,
|
|
91
82
|
columnIndex: index,
|
|
@@ -93,15 +84,12 @@ export default class TableTree extends Component {
|
|
|
93
84
|
}, /*#__PURE__*/React.createElement(CellContent, content))))
|
|
94
85
|
});
|
|
95
86
|
}
|
|
96
|
-
|
|
97
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
88
|
role: "treegrid",
|
|
99
89
|
"aria-readonly": true
|
|
100
90
|
}, heads, rows, this.props.children);
|
|
101
91
|
}
|
|
102
|
-
|
|
103
92
|
}
|
|
104
|
-
|
|
105
93
|
_defineProperty(TableTree, "childContextTypes", {
|
|
106
94
|
tableTree: PropTypes.object.isRequired
|
|
107
95
|
});
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
2
|
import set from 'lodash/set';
|
|
3
|
-
|
|
4
3
|
function updateRootItems(rootItems, allItems = [], {
|
|
5
4
|
key,
|
|
6
5
|
keysCache,
|
|
7
6
|
operation
|
|
8
7
|
}) {
|
|
9
|
-
const newKeysCache = {
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const newKeysCache = {
|
|
9
|
+
...keysCache
|
|
10
|
+
};
|
|
11
|
+
// If it is not an append operation we can ignore allItems as they will be swaped with new items
|
|
12
12
|
const allBaseItems = operation === 'UPDATE' ? [] : [...allItems];
|
|
13
13
|
const startIndexWith = allBaseItems.length;
|
|
14
14
|
rootItems.forEach((rootItem, index) => {
|
|
15
15
|
const rootItemKey = rootItem[key];
|
|
16
|
-
|
|
17
16
|
if (rootItemKey === undefined) {
|
|
18
17
|
throw new Error(`[ERROR] Property '${key}' not found in rootItem[${index}]`);
|
|
19
18
|
} else {
|
|
@@ -25,26 +24,25 @@ function updateRootItems(rootItems, allItems = [], {
|
|
|
25
24
|
items: allBaseItems.concat(rootItems)
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
function updateChildItems(newitems, allTableItems, itemParent, {
|
|
30
28
|
key,
|
|
31
29
|
keysCache,
|
|
32
30
|
operation
|
|
33
31
|
}) {
|
|
34
|
-
const newKeysCache = {
|
|
32
|
+
const newKeysCache = {
|
|
33
|
+
...keysCache
|
|
35
34
|
};
|
|
36
35
|
const parentCacheKey = itemParent[key];
|
|
37
|
-
|
|
38
36
|
if (parentCacheKey === undefined) {
|
|
39
37
|
throw new Error(`[Table Tree] Property '${key}' not found in parent item`);
|
|
40
38
|
}
|
|
41
|
-
|
|
42
39
|
const parentLocation = newKeysCache[parentCacheKey];
|
|
43
40
|
const allItemsCopy = [...allTableItems];
|
|
44
41
|
const objectToChange = get(allItemsCopy, parentLocation);
|
|
45
42
|
const baseChildrenOfObjectToChange = operation === 'UPDATE' ? [] : get(objectToChange, 'children', []);
|
|
46
|
-
objectToChange.children = baseChildrenOfObjectToChange.concat(newitems);
|
|
43
|
+
objectToChange.children = baseChildrenOfObjectToChange.concat(newitems);
|
|
47
44
|
|
|
45
|
+
// Update cache
|
|
48
46
|
newitems.forEach((item, index) => {
|
|
49
47
|
newKeysCache[item[key]] = `${parentLocation}.children[${index + baseChildrenOfObjectToChange.length}]`;
|
|
50
48
|
});
|
|
@@ -53,6 +51,7 @@ function updateChildItems(newitems, allTableItems, itemParent, {
|
|
|
53
51
|
items: set(allItemsCopy, parentLocation, objectToChange)
|
|
54
52
|
};
|
|
55
53
|
}
|
|
54
|
+
|
|
56
55
|
/**
|
|
57
56
|
* This helper class will create a cache of all the id's in the items object and
|
|
58
57
|
* path to the object.
|
|
@@ -69,8 +68,6 @@ function updateChildItems(newitems, allTableItems, itemParent, {
|
|
|
69
68
|
* Cache will look something like:
|
|
70
69
|
* {1: 0, 2: '0.children[0]'}
|
|
71
70
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
71
|
export default class TableTreeDataHelper {
|
|
75
72
|
constructor({
|
|
76
73
|
key = 'key'
|
|
@@ -78,14 +75,12 @@ export default class TableTreeDataHelper {
|
|
|
78
75
|
this.key = key;
|
|
79
76
|
this.keysCache = {};
|
|
80
77
|
}
|
|
81
|
-
|
|
82
78
|
updateItems(items, allItems = [], parentItem) {
|
|
83
79
|
const options = {
|
|
84
80
|
key: this.key,
|
|
85
81
|
keysCache: this.keysCache,
|
|
86
82
|
operation: 'UPDATE'
|
|
87
83
|
};
|
|
88
|
-
|
|
89
84
|
if (!parentItem) {
|
|
90
85
|
const {
|
|
91
86
|
keysCache,
|
|
@@ -94,7 +89,6 @@ export default class TableTreeDataHelper {
|
|
|
94
89
|
this.keysCache = keysCache;
|
|
95
90
|
return updatedRootItems;
|
|
96
91
|
}
|
|
97
|
-
|
|
98
92
|
const {
|
|
99
93
|
keysCache,
|
|
100
94
|
items: updatedItems
|
|
@@ -102,14 +96,12 @@ export default class TableTreeDataHelper {
|
|
|
102
96
|
this.keysCache = keysCache;
|
|
103
97
|
return updatedItems;
|
|
104
98
|
}
|
|
105
|
-
|
|
106
99
|
appendItems(items, allItems = [], parentItem) {
|
|
107
100
|
const options = {
|
|
108
101
|
key: this.key,
|
|
109
102
|
keysCache: this.keysCache,
|
|
110
103
|
operation: 'APPEND'
|
|
111
104
|
};
|
|
112
|
-
|
|
113
105
|
if (!parentItem) {
|
|
114
106
|
const {
|
|
115
107
|
keysCache,
|
|
@@ -118,7 +110,6 @@ export default class TableTreeDataHelper {
|
|
|
118
110
|
this.keysCache = keysCache;
|
|
119
111
|
return updatedRootItems;
|
|
120
112
|
}
|
|
121
|
-
|
|
122
113
|
const {
|
|
123
114
|
keysCache,
|
|
124
115
|
items: updatedItems
|
|
@@ -126,5 +117,4 @@ export default class TableTreeDataHelper {
|
|
|
126
117
|
this.keysCache = keysCache;
|
|
127
118
|
return updatedItems;
|
|
128
119
|
}
|
|
129
|
-
|
|
130
120
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,39 +6,30 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
var _excluded = ["children", "singleLine", "indentLevel", "width", "className"];
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
11
|
import React, { Component } from 'react';
|
|
15
12
|
import CommonCell from './internal/common-cell';
|
|
16
13
|
import OverflowContainer from './internal/overflow-container';
|
|
17
14
|
import { indentBase } from './internal/styled';
|
|
18
15
|
import withColumnWidth from './internal/with-column-width';
|
|
19
|
-
|
|
20
16
|
var Cell = /*#__PURE__*/function (_Component) {
|
|
21
17
|
_inherits(Cell, _Component);
|
|
22
|
-
|
|
23
18
|
var _super = _createSuper(Cell);
|
|
24
|
-
|
|
25
19
|
function Cell() {
|
|
26
20
|
_classCallCheck(this, Cell);
|
|
27
|
-
|
|
28
21
|
return _super.apply(this, arguments);
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
_createClass(Cell, [{
|
|
32
24
|
key: "render",
|
|
33
25
|
value: function render() {
|
|
34
26
|
var _this$props = this.props,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
children = _this$props.children,
|
|
28
|
+
singleLine = _this$props.singleLine,
|
|
29
|
+
indentLevel = _this$props.indentLevel,
|
|
30
|
+
width = _this$props.width,
|
|
31
|
+
className = _this$props.className,
|
|
32
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
|
42
33
|
return /*#__PURE__*/React.createElement(CommonCell, _extends({
|
|
43
34
|
role: "gridcell",
|
|
44
35
|
indent: indentLevel ? "calc(".concat(indentBase, " * ").concat(indentLevel, ")") : undefined,
|
|
@@ -49,8 +40,6 @@ var Cell = /*#__PURE__*/function (_Component) {
|
|
|
49
40
|
}, children));
|
|
50
41
|
}
|
|
51
42
|
}]);
|
|
52
|
-
|
|
53
43
|
return Cell;
|
|
54
44
|
}(Component);
|
|
55
|
-
|
|
56
45
|
export default withColumnWidth(Cell);
|
|
@@ -4,11 +4,8 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
9
|
/** @jsx jsx */
|
|
13
10
|
import { Component } from 'react';
|
|
14
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -22,18 +19,13 @@ var headerStyles = css({
|
|
|
22
19
|
letterSpacing: -0.1,
|
|
23
20
|
lineHeight: "var(--ds-font-lineHeight-200, 20px)"
|
|
24
21
|
});
|
|
25
|
-
|
|
26
22
|
var Header = /*#__PURE__*/function (_Component) {
|
|
27
23
|
_inherits(Header, _Component);
|
|
28
|
-
|
|
29
24
|
var _super = _createSuper(Header);
|
|
30
|
-
|
|
31
25
|
function Header() {
|
|
32
26
|
_classCallCheck(this, Header);
|
|
33
|
-
|
|
34
27
|
return _super.apply(this, arguments);
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
_createClass(Header, [{
|
|
38
30
|
key: "render",
|
|
39
31
|
value: function render() {
|
|
@@ -47,8 +39,6 @@ var Header = /*#__PURE__*/function (_Component) {
|
|
|
47
39
|
}, props), props.children);
|
|
48
40
|
}
|
|
49
41
|
}]);
|
|
50
|
-
|
|
51
42
|
return Header;
|
|
52
43
|
}(Component);
|
|
53
|
-
|
|
54
44
|
export default withColumnWidth(Header);
|
|
@@ -3,13 +3,9 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
|
|
9
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
|
|
11
8
|
/** @jsx jsx */
|
|
12
|
-
|
|
13
9
|
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
14
10
|
import { Children, cloneElement, Component } from 'react';
|
|
15
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -17,18 +13,13 @@ var containerStyles = css({
|
|
|
17
13
|
display: 'flex',
|
|
18
14
|
borderBottom: "solid 2px ".concat("var(--ds-border, #dfe1e6)")
|
|
19
15
|
});
|
|
20
|
-
|
|
21
16
|
var Headers = /*#__PURE__*/function (_Component) {
|
|
22
17
|
_inherits(Headers, _Component);
|
|
23
|
-
|
|
24
18
|
var _super = _createSuper(Headers);
|
|
25
|
-
|
|
26
19
|
function Headers() {
|
|
27
20
|
_classCallCheck(this, Headers);
|
|
28
|
-
|
|
29
21
|
return _super.apply(this, arguments);
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
_createClass(Headers, [{
|
|
33
24
|
key: "render",
|
|
34
25
|
value: function render() {
|
|
@@ -47,8 +38,6 @@ var Headers = /*#__PURE__*/function (_Component) {
|
|
|
47
38
|
}));
|
|
48
39
|
}
|
|
49
40
|
}]);
|
|
50
|
-
|
|
51
41
|
return Headers;
|
|
52
42
|
}(Component);
|
|
53
|
-
|
|
54
43
|
export { Headers as default };
|
|
@@ -6,53 +6,40 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
11
|
/* eslint-disable @repo/internal/react/consistent-props-definitions */
|
|
15
|
-
|
|
16
12
|
/* eslint-disable react/prop-types */
|
|
17
13
|
import React, { Component } from 'react';
|
|
18
14
|
import Button from '@atlaskit/button';
|
|
19
15
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
20
16
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
21
17
|
import { ChevronContainer, ChevronIconContainer, iconColor } from './styled';
|
|
22
|
-
|
|
23
18
|
var Chevron = /*#__PURE__*/function (_Component) {
|
|
24
19
|
_inherits(Chevron, _Component);
|
|
25
|
-
|
|
26
20
|
var _super = _createSuper(Chevron);
|
|
27
|
-
|
|
28
21
|
function Chevron() {
|
|
29
22
|
var _this;
|
|
30
|
-
|
|
31
23
|
_classCallCheck(this, Chevron);
|
|
32
|
-
|
|
33
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
25
|
args[_key] = arguments[_key];
|
|
35
26
|
}
|
|
36
|
-
|
|
37
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
-
|
|
39
28
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function () {
|
|
40
29
|
if (_this.props.onExpandToggle) {
|
|
41
30
|
_this.props.onExpandToggle();
|
|
42
31
|
}
|
|
43
32
|
});
|
|
44
|
-
|
|
45
33
|
return _this;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
_createClass(Chevron, [{
|
|
49
36
|
key: "render",
|
|
50
37
|
value: function render() {
|
|
51
38
|
var _this$props = this.props,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
isExpanded = _this$props.isExpanded,
|
|
40
|
+
ariaControls = _this$props.ariaControls,
|
|
41
|
+
collapseLabel = _this$props.collapseLabel,
|
|
42
|
+
expandLabel = _this$props.expandLabel;
|
|
56
43
|
var iconProps = {
|
|
57
44
|
size: 'medium',
|
|
58
45
|
primaryColor: iconColor
|
|
@@ -69,13 +56,10 @@ var Chevron = /*#__PURE__*/function (_Component) {
|
|
|
69
56
|
}, iconProps)))));
|
|
70
57
|
}
|
|
71
58
|
}]);
|
|
72
|
-
|
|
73
59
|
return Chevron;
|
|
74
60
|
}(Component);
|
|
75
|
-
|
|
76
61
|
_defineProperty(Chevron, "defaultProps", {
|
|
77
62
|
expandLabel: 'Expand',
|
|
78
63
|
collapseLabel: 'Collapse'
|
|
79
64
|
});
|
|
80
|
-
|
|
81
65
|
export { Chevron as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["indent", "width"];
|
|
4
|
-
|
|
5
4
|
/** @jsx jsx */
|
|
5
|
+
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { N800 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { indentBase } from './styled';
|
|
@@ -16,15 +16,13 @@ var commonStyles = css({
|
|
|
16
16
|
color: "var(--ds-text, ".concat(N800, ")"),
|
|
17
17
|
lineHeight: "var(--ds-font-lineHeight-200, 20px)"
|
|
18
18
|
});
|
|
19
|
-
|
|
20
19
|
/**
|
|
21
20
|
* __Common cell__
|
|
22
21
|
*/
|
|
23
22
|
var CommonCell = function CommonCell(_ref) {
|
|
24
23
|
var indent = _ref.indent,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
width = _ref.width,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
26
|
return jsx("div", _extends({}, props, {
|
|
29
27
|
style: {
|
|
30
28
|
'--indent': indent,
|
|
@@ -33,5 +31,4 @@ var CommonCell = function CommonCell(_ref) {
|
|
|
33
31
|
css: commonStyles
|
|
34
32
|
}));
|
|
35
33
|
};
|
|
36
|
-
|
|
37
34
|
export default CommonCell;
|
|
@@ -4,47 +4,36 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
|
|
8
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
|
|
10
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
|
|
12
9
|
/** @jsx jsx */
|
|
13
|
-
|
|
14
10
|
/* eslint-disable @repo/internal/react/no-clone-element */
|
|
15
11
|
import { cloneElement, Component } from 'react';
|
|
16
12
|
import { jsx } from '@emotion/react';
|
|
17
13
|
import toItemId from '../../utils/to-item-id';
|
|
18
14
|
import Items from './items';
|
|
19
|
-
|
|
20
15
|
var Item = /*#__PURE__*/function (_Component) {
|
|
21
16
|
_inherits(Item, _Component);
|
|
22
|
-
|
|
23
17
|
var _super = _createSuper(Item);
|
|
24
|
-
|
|
25
18
|
function Item() {
|
|
26
19
|
_classCallCheck(this, Item);
|
|
27
|
-
|
|
28
20
|
return _super.apply(this, arguments);
|
|
29
21
|
}
|
|
30
|
-
|
|
31
22
|
_createClass(Item, [{
|
|
32
23
|
key: "render",
|
|
33
24
|
value: function render() {
|
|
34
25
|
// eslint-disable-next-line react/prop-types
|
|
35
26
|
var _this$props = this.props,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
depth = _this$props.depth,
|
|
28
|
+
data = _this$props.data,
|
|
29
|
+
render = _this$props.render;
|
|
39
30
|
var renderedRow = render(data);
|
|
40
|
-
|
|
41
31
|
if (!renderedRow) {
|
|
42
32
|
return null;
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
var _renderedRow$props = renderedRow.props,
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
itemId = _renderedRow$props.itemId,
|
|
36
|
+
items = _renderedRow$props.items;
|
|
48
37
|
return /*#__PURE__*/cloneElement(renderedRow, {
|
|
49
38
|
depth: depth,
|
|
50
39
|
data: data,
|
|
@@ -61,12 +50,9 @@ var Item = /*#__PURE__*/function (_Component) {
|
|
|
61
50
|
});
|
|
62
51
|
}
|
|
63
52
|
}]);
|
|
64
|
-
|
|
65
53
|
return Item;
|
|
66
54
|
}(Component);
|
|
67
|
-
|
|
68
55
|
_defineProperty(Item, "defaultProps", {
|
|
69
56
|
depth: 0
|
|
70
57
|
});
|
|
71
|
-
|
|
72
58
|
export { Item as default };
|
|
@@ -6,51 +6,38 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
11
|
/* eslint-disable react/prop-types */
|
|
15
12
|
import React, { Component } from 'react';
|
|
16
13
|
import Item from './item';
|
|
17
14
|
import LoaderItem from './loader-item';
|
|
18
|
-
|
|
19
15
|
var Items = /*#__PURE__*/function (_Component) {
|
|
20
16
|
_inherits(Items, _Component);
|
|
21
|
-
|
|
22
17
|
var _super = _createSuper(Items);
|
|
23
|
-
|
|
24
18
|
function Items() {
|
|
25
19
|
var _this;
|
|
26
|
-
|
|
27
20
|
_classCallCheck(this, Items);
|
|
28
|
-
|
|
29
21
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
22
|
args[_key] = arguments[_key];
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
|
|
35
25
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
26
|
isLoaderShown: false
|
|
37
27
|
});
|
|
38
|
-
|
|
39
28
|
_defineProperty(_assertThisInitialized(_this), "handleLoaderComplete", function () {
|
|
40
29
|
_this.setState({
|
|
41
30
|
isLoaderShown: false
|
|
42
31
|
});
|
|
43
32
|
});
|
|
44
|
-
|
|
45
33
|
return _this;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
_createClass(Items, [{
|
|
49
36
|
key: "renderLoader",
|
|
50
37
|
value: function renderLoader() {
|
|
51
38
|
var _this$props = this.props,
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
depth = _this$props.depth,
|
|
40
|
+
items = _this$props.items;
|
|
54
41
|
return /*#__PURE__*/React.createElement(LoaderItem, {
|
|
55
42
|
isCompleting: !!(items && items.length),
|
|
56
43
|
onComplete: this.handleLoaderComplete,
|
|
@@ -61,10 +48,10 @@ var Items = /*#__PURE__*/function (_Component) {
|
|
|
61
48
|
key: "renderItems",
|
|
62
49
|
value: function renderItems() {
|
|
63
50
|
var _this$props2 = this.props,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
render = _this$props2.render,
|
|
52
|
+
items = _this$props2.items,
|
|
53
|
+
_this$props2$depth = _this$props2.depth,
|
|
54
|
+
depth = _this$props2$depth === void 0 ? 0 : _this$props2$depth;
|
|
68
55
|
return items && items.map(function (itemData, index) {
|
|
69
56
|
return /*#__PURE__*/React.createElement(Item, {
|
|
70
57
|
data: itemData,
|
|
@@ -94,16 +81,12 @@ var Items = /*#__PURE__*/function (_Component) {
|
|
|
94
81
|
isLoaderShown: true
|
|
95
82
|
};
|
|
96
83
|
}
|
|
97
|
-
|
|
98
84
|
return null;
|
|
99
85
|
}
|
|
100
86
|
}]);
|
|
101
|
-
|
|
102
87
|
return Items;
|
|
103
88
|
}(Component);
|
|
104
|
-
|
|
105
89
|
_defineProperty(Items, "defaultProps", {
|
|
106
90
|
depth: 0
|
|
107
91
|
});
|
|
108
|
-
|
|
109
92
|
export { Items as default };
|
|
@@ -5,40 +5,28 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
/* eslint-disable react/prop-types */
|
|
14
11
|
import React, { Component } from 'react';
|
|
15
12
|
import Spinner from '@atlaskit/spinner';
|
|
16
13
|
import CommonCell from './common-cell';
|
|
17
14
|
import { indentBase, LoaderItemContainer, TreeRowContainer } from './styled';
|
|
18
|
-
|
|
19
15
|
var LoaderItem = /*#__PURE__*/function (_Component) {
|
|
20
16
|
_inherits(LoaderItem, _Component);
|
|
21
|
-
|
|
22
17
|
var _super = _createSuper(LoaderItem);
|
|
23
|
-
|
|
24
18
|
function LoaderItem() {
|
|
25
19
|
var _this;
|
|
26
|
-
|
|
27
20
|
_classCallCheck(this, LoaderItem);
|
|
28
|
-
|
|
29
21
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
22
|
args[_key] = arguments[_key];
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
|
|
35
25
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
36
26
|
phase: 'loading'
|
|
37
27
|
});
|
|
38
|
-
|
|
39
28
|
return _this;
|
|
40
29
|
}
|
|
41
|
-
|
|
42
30
|
_createClass(LoaderItem, [{
|
|
43
31
|
key: "componentDidUpdate",
|
|
44
32
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
@@ -71,16 +59,12 @@ var LoaderItem = /*#__PURE__*/function (_Component) {
|
|
|
71
59
|
phase: 'complete'
|
|
72
60
|
};
|
|
73
61
|
}
|
|
74
|
-
|
|
75
62
|
return null;
|
|
76
63
|
}
|
|
77
64
|
}]);
|
|
78
|
-
|
|
79
65
|
return LoaderItem;
|
|
80
66
|
}(Component);
|
|
81
|
-
|
|
82
67
|
_defineProperty(LoaderItem, "defaultProps", {
|
|
83
68
|
depth: 1
|
|
84
69
|
});
|
|
85
|
-
|
|
86
70
|
export { LoaderItem as default };
|