@atlaskit/table-tree 9.0.9 → 9.0.13

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/cjs/components/cell.js +79 -0
  3. package/dist/cjs/components/{Header.js → header.js} +22 -8
  4. package/dist/cjs/components/{Headers.js → headers.js} +12 -8
  5. package/dist/cjs/components/{Chevron.js → internal/chevron.js} +8 -4
  6. package/dist/cjs/components/internal/common-cell.js +45 -0
  7. package/dist/cjs/components/{Item.js → internal/item.js} +9 -9
  8. package/dist/cjs/components/{Items.js → internal/items.js} +11 -7
  9. package/dist/cjs/components/{LoaderItem.js → internal/loader-item.js} +17 -13
  10. package/dist/cjs/components/internal/overflow-container.js +35 -0
  11. package/dist/cjs/components/internal/styled.js +92 -0
  12. package/dist/cjs/components/{withColumnWidth.js → internal/with-column-width.js} +13 -6
  13. package/dist/cjs/components/{Row.js → row.js} +12 -8
  14. package/dist/cjs/components/{Rows.js → rows.js} +9 -6
  15. package/dist/cjs/components/{TableTree.js → table-tree.js} +17 -15
  16. package/dist/cjs/index.js +14 -14
  17. package/dist/cjs/utils/{TableTreeDataHelper.js → table-tree-data-helper.js} +1 -3
  18. package/dist/cjs/utils/{toItemId.js → to-item-id.js} +0 -0
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/components/cell.js +31 -0
  21. package/dist/es2019/components/header.js +35 -0
  22. package/dist/es2019/components/headers.js +24 -0
  23. package/dist/es2019/components/internal/chevron.js +51 -0
  24. package/dist/es2019/components/internal/common-cell.js +30 -0
  25. package/dist/es2019/components/internal/item.js +46 -0
  26. package/dist/es2019/components/internal/items.js +76 -0
  27. package/dist/es2019/components/internal/loader-item.js +60 -0
  28. package/dist/es2019/components/internal/overflow-container.js +21 -0
  29. package/dist/es2019/components/internal/styled.js +63 -0
  30. package/dist/es2019/components/internal/with-column-width.js +40 -0
  31. package/dist/es2019/components/row.js +148 -0
  32. package/dist/es2019/components/rows.js +15 -0
  33. package/dist/es2019/components/table-tree.js +107 -0
  34. package/dist/es2019/index.js +7 -0
  35. package/dist/es2019/utils/table-tree-data-helper.js +130 -0
  36. package/dist/es2019/utils/to-item-id.js +3 -0
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/esm/components/{Cell.js → cell.js} +22 -8
  39. package/dist/esm/components/{Header.js → header.js} +23 -7
  40. package/dist/esm/components/{Headers.js → headers.js} +14 -6
  41. package/dist/esm/components/{Chevron.js → internal/chevron.js} +4 -2
  42. package/dist/esm/components/internal/common-cell.js +33 -0
  43. package/dist/esm/components/{Item.js → internal/item.js} +11 -7
  44. package/dist/esm/components/{Items.js → internal/items.js} +3 -3
  45. package/dist/esm/components/{LoaderItem.js → internal/loader-item.js} +12 -11
  46. package/dist/esm/components/internal/overflow-container.js +24 -0
  47. package/dist/esm/components/internal/styled.js +72 -0
  48. package/dist/esm/components/{withColumnWidth.js → internal/with-column-width.js} +7 -4
  49. package/dist/esm/components/{Row.js → row.js} +6 -6
  50. package/dist/esm/components/{Rows.js → rows.js} +2 -3
  51. package/dist/esm/components/{TableTree.js → table-tree.js} +7 -8
  52. package/dist/esm/index.js +7 -7
  53. package/dist/esm/utils/{TableTreeDataHelper.js → table-tree-data-helper.js} +1 -5
  54. package/dist/esm/utils/{toItemId.js → to-item-id.js} +0 -0
  55. package/dist/esm/version.json +1 -1
  56. package/dist/types/components/cell.d.ts +66 -0
  57. package/dist/types/components/header.d.ts +60 -0
  58. package/dist/types/components/headers.d.ts +5 -0
  59. package/dist/types/components/internal/chevron.d.ts +17 -0
  60. package/dist/types/components/internal/common-cell.d.ts +10 -0
  61. package/dist/types/components/internal/item.d.ts +12 -0
  62. package/dist/types/components/internal/items.d.ts +24 -0
  63. package/dist/types/components/internal/loader-item.d.ts +20 -0
  64. package/dist/types/components/internal/overflow-container.d.ts +10 -0
  65. package/dist/types/components/internal/styled.d.ts +25 -0
  66. package/dist/types/components/internal/with-column-width.d.ts +64 -0
  67. package/dist/types/components/row.d.ts +19 -0
  68. package/dist/types/components/rows.d.ts +12 -0
  69. package/dist/types/components/table-tree.d.ts +23 -0
  70. package/dist/types/index.d.ts +10 -0
  71. package/dist/types/utils/table-tree-data-helper.d.ts +25 -0
  72. package/dist/types/utils/to-item-id.d.ts +1 -0
  73. package/package.json +31 -14
  74. package/dist/cjs/components/Cell.js +0 -60
  75. package/dist/cjs/styled.js +0 -107
  76. package/dist/esm/styled.js +0 -68
  77. package/styled/package.json +0 -6
@@ -9,14 +9,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
 
10
10
  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
11
 
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
+
14
+ /* eslint-disable @repo/internal/react/consistent-props-definitions */
13
15
 
14
16
  /* eslint-disable react/prop-types */
15
17
  import React, { Component } from 'react';
16
18
  import Button from '@atlaskit/button';
17
19
  import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
18
20
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
19
- import { ChevronContainer, ChevronIconContainer, iconColor } from '../styled';
21
+ import { ChevronContainer, ChevronIconContainer, iconColor } from './styled';
20
22
 
21
23
  var Chevron = /*#__PURE__*/function (_Component) {
22
24
  _inherits(Chevron, _Component);
@@ -0,0 +1,33 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+
4
+ /** @jsx jsx */
5
+ import { css, jsx } from '@emotion/core';
6
+ import { N800 } from '@atlaskit/theme/colors';
7
+ var commonStyles = css({
8
+ display: 'flex',
9
+ boxSizing: 'border-box',
10
+ minHeight: 40,
11
+ padding: '10px 25px 10px var(--indent, 25px)',
12
+ position: 'relative',
13
+ alignItems: 'flex-start',
14
+ color: "var(--ds-text-highEmphasis, ".concat(N800, ")"),
15
+ lineHeight: '20px'
16
+ });
17
+
18
+ /**
19
+ * __Common cell__
20
+ */
21
+ var CommonCell = function CommonCell(_ref) {
22
+ var indent = _ref.indent,
23
+ props = _objectWithoutProperties(_ref, ["indent"]);
24
+
25
+ return jsx("div", _extends({
26
+ style: {
27
+ '--indent': indent
28
+ },
29
+ css: commonStyles
30
+ }, props));
31
+ };
32
+
33
+ export default CommonCell;
@@ -7,11 +7,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
 
8
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); }; }
9
9
 
10
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
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; } }
11
11
 
12
- import React, { Component } from 'react';
13
- import toItemId from '../utils/toItemId';
14
- import Items from './Items';
12
+ /** @jsx jsx */
13
+
14
+ /* eslint-disable @repo/internal/react/no-clone-element */
15
+ import { cloneElement, Component } from 'react';
16
+ import { jsx } from '@emotion/core';
17
+ import toItemId from '../../utils/to-item-id';
18
+ import Items from './items';
15
19
 
16
20
  var Item = /*#__PURE__*/function (_Component) {
17
21
  _inherits(Item, _Component);
@@ -41,13 +45,13 @@ var Item = /*#__PURE__*/function (_Component) {
41
45
  var _renderedRow$props = renderedRow.props,
42
46
  itemId = _renderedRow$props.itemId,
43
47
  items = _renderedRow$props.items;
44
- return /*#__PURE__*/React.cloneElement(renderedRow, {
48
+ return /*#__PURE__*/cloneElement(renderedRow, {
45
49
  depth: depth,
46
50
  data: data,
47
51
  renderChildren: function renderChildren() {
48
- return /*#__PURE__*/React.createElement("div", {
52
+ return jsx("div", {
49
53
  id: toItemId(itemId)
50
- }, /*#__PURE__*/React.createElement(Items, {
54
+ }, jsx(Items, {
51
55
  parentData: data,
52
56
  depth: depth,
53
57
  items: items,
@@ -9,12 +9,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
 
10
10
  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
11
 
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
 
14
14
  /* eslint-disable react/prop-types */
15
15
  import React, { Component } from 'react';
16
- import Item from './Item';
17
- import LoaderItem from './LoaderItem';
16
+ import Item from './item';
17
+ import LoaderItem from './loader-item';
18
18
 
19
19
  var Items = /*#__PURE__*/function (_Component) {
20
20
  _inherits(Items, _Component);
@@ -8,12 +8,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
 
9
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); }; }
10
10
 
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+
13
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
12
14
 
13
15
  /* eslint-disable react/prop-types */
14
16
  import React, { Component } from 'react';
15
17
  import Spinner from '@atlaskit/spinner';
16
- import { Cell, LoaderItemContainer, TreeRowContainer } from '../styled';
18
+ import CommonCell from './common-cell';
19
+ import { LoaderItemContainer, TreeRowContainer } from './styled';
17
20
 
18
21
  var LoaderItem = /*#__PURE__*/function (_Component) {
19
22
  _inherits(LoaderItem, _Component);
@@ -50,19 +53,17 @@ var LoaderItem = /*#__PURE__*/function (_Component) {
50
53
  }, {
51
54
  key: "render",
52
55
  value: function render() {
53
- var _this$props = this.props,
54
- isCompleting = _this$props.isCompleting,
55
- depth = _this$props.depth;
56
+ var depth = this.props.depth;
56
57
  var phase = this.state.phase;
57
- return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(Cell, {
58
- indentLevel: depth,
59
- width: "100%"
58
+ return phase === 'loading' ? /*#__PURE__*/React.createElement(TreeRowContainer, null, /*#__PURE__*/React.createElement(CommonCell, {
59
+ style: {
60
+ paddingLeft: 25 * depth,
61
+ width: '100%'
62
+ }
60
63
  }, /*#__PURE__*/React.createElement(LoaderItemContainer, {
61
64
  isRoot: depth === 1
62
65
  }, /*#__PURE__*/React.createElement(Spinner, {
63
- isCompleting: isCompleting,
64
- size: "small",
65
- invertColor: false
66
+ size: "small"
66
67
  })))) : null;
67
68
  }
68
69
  }], [{
@@ -0,0 +1,24 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+
4
+ /** @jsx jsx */
5
+ import { css, jsx } from '@emotion/core';
6
+ var overflowContainerStyles = css({
7
+ overflow: 'hidden',
8
+ textOverflow: 'ellipsis',
9
+ whiteSpace: 'nowrap'
10
+ });
11
+ /**
12
+ * __Overflow container__
13
+ */
14
+
15
+ var OverflowContainer = function OverflowContainer(_ref) {
16
+ var isSingleLine = _ref.isSingleLine,
17
+ props = _objectWithoutProperties(_ref, ["isSingleLine"]);
18
+
19
+ return jsx("span", _extends({
20
+ css: isSingleLine && overflowContainerStyles
21
+ }, props));
22
+ };
23
+
24
+ export default OverflowContainer;
@@ -0,0 +1,72 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+
4
+ /** @jsx jsx */
5
+ import { css, jsx } from '@emotion/core';
6
+ import { N30, N800 } from '@atlaskit/theme/colors';
7
+ export var iconColor = "var(--ds-text-highEmphasis, ".concat(N800, ")");
8
+ var treeRowContainerStyles = css({
9
+ display: 'flex',
10
+ borderBottom: "1px solid ".concat("var(--ds-border-neutral, ".concat(N30, ")"))
11
+ });
12
+ /**
13
+ * __Tree row container__
14
+ */
15
+
16
+ export var TreeRowContainer = function TreeRowContainer(props) {
17
+ return jsx("div", _extends({
18
+ css: treeRowContainerStyles
19
+ }, props));
20
+ };
21
+ var commonChevronContainerStyles = css({
22
+ display: 'flex',
23
+ marginLeft: -25,
24
+ position: 'absolute',
25
+ top: 7,
26
+ alignItems: 'center'
27
+ });
28
+ /**
29
+ * __Chevron container__
30
+ */
31
+
32
+ export var ChevronContainer = function ChevronContainer(props) {
33
+ return jsx("span", _extends({}, props, {
34
+ css: commonChevronContainerStyles
35
+ }));
36
+ };
37
+ var chevronIconContainerStyles = css({
38
+ position: 'relative',
39
+ top: 1
40
+ });
41
+ /**
42
+ * __Chevron icon container__
43
+ *
44
+ * A chevron icon container.
45
+ */
46
+
47
+ export var ChevronIconContainer = function ChevronIconContainer(props) {
48
+ return jsx("span", _extends({}, props, {
49
+ css: chevronIconContainerStyles
50
+ }));
51
+ };
52
+ var loadingItemContainerStyles = css({
53
+ width: '100%',
54
+ paddingTop: 5
55
+ });
56
+ var paddingLeftStyles = css({
57
+ paddingLeft: '50%'
58
+ });
59
+ /**
60
+ * __Loader item container__
61
+ *
62
+ * A loader item container.
63
+ */
64
+
65
+ export var LoaderItemContainer = function LoaderItemContainer(_ref) {
66
+ var isRoot = _ref.isRoot,
67
+ props = _objectWithoutProperties(_ref, ["isRoot"]);
68
+
69
+ return jsx("span", _extends({
70
+ css: [commonChevronContainerStyles, loadingItemContainerStyles, isRoot && paddingLeftStyles]
71
+ }, props));
72
+ };
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
4
5
  import _inherits from "@babel/runtime/helpers/inherits";
@@ -8,7 +9,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
9
 
9
10
  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
 
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
13
 
13
14
  /* eslint-disable react/prop-types */
14
15
  import React, { Component } from 'react';
@@ -49,11 +50,13 @@ export default function withColumnWidth(Cell) {
49
50
  value: function render() {
50
51
  var _this$props = this.props,
51
52
  width = _this$props.width,
52
- columnIndex = _this$props.columnIndex;
53
+ columnIndex = _this$props.columnIndex,
54
+ other = _objectWithoutProperties(_this$props, ["width", "columnIndex"]);
55
+
53
56
  var columnWidth = width !== null && width !== undefined ? width : this.context.tableTree.getColumnWidth(columnIndex);
54
- return /*#__PURE__*/React.createElement(Cell, _extends({}, this.props, {
57
+ return /*#__PURE__*/React.createElement(Cell, _extends({
55
58
  width: columnWidth
56
- }));
59
+ }, other));
57
60
  }
58
61
  }]);
59
62
 
@@ -9,16 +9,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
 
10
10
  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
11
 
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
12
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
 
14
- /* eslint-disable react/prop-types */
14
+ /* eslint-disable @repo/internal/react/no-clone-element */
15
15
  import React, { Component, Fragment } from 'react';
16
16
  import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
17
- import { TreeRowContainer } from '../styled';
18
- import toItemId from '../utils/toItemId';
19
- import Chevron from './Chevron';
17
+ import toItemId from '../utils/to-item-id';
18
+ import Chevron from './internal/chevron';
19
+ import { TreeRowContainer } from './internal/styled';
20
20
  var packageName = "@atlaskit/table-tree";
21
- var packageVersion = "9.0.9";
21
+ var packageVersion = "9.0.13";
22
22
 
23
23
  var Row = /*#__PURE__*/function (_Component) {
24
24
  _inherits(Row, _Component);
@@ -6,10 +6,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
6
 
7
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); }; }
8
8
 
9
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
10
 
11
11
  import React, { Component } from 'react';
12
- import Items from './Items';
12
+ import Items from './internal/items';
13
13
 
14
14
  var Rows = /*#__PURE__*/function (_Component) {
15
15
  _inherits(Rows, _Component);
@@ -25,7 +25,6 @@ var Rows = /*#__PURE__*/function (_Component) {
25
25
  _createClass(Rows, [{
26
26
  key: "render",
27
27
  value: function render() {
28
- // eslint-disable-next-line react/prop-types
29
28
  var _this$props = this.props,
30
29
  items = _this$props.items,
31
30
  render = _this$props.render;
@@ -8,17 +8,16 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
8
 
9
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); }; }
10
10
 
11
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
13
  /* eslint-disable react/prop-types */
14
14
  import React, { Component } from 'react';
15
15
  import PropTypes from 'prop-types';
16
- import { TableTreeContainer } from '../styled';
17
- import Cell from './Cell';
18
- import Header from './Header';
19
- import Headers from './Headers';
20
- import Row from './Row';
21
- import Rows from './Rows';
16
+ import Cell from './cell';
17
+ import Header from './header';
18
+ import Headers from './headers';
19
+ import Row from './row';
20
+ import Rows from './rows';
22
21
 
23
22
  var TableTree = /*#__PURE__*/function (_Component) {
24
23
  _inherits(TableTree, _Component);
@@ -129,7 +128,7 @@ var TableTree = /*#__PURE__*/function (_Component) {
129
128
  });
130
129
  }
131
130
 
132
- return /*#__PURE__*/React.createElement(TableTreeContainer, {
131
+ return /*#__PURE__*/React.createElement("div", {
133
132
  role: "treegrid",
134
133
  "aria-readonly": true
135
134
  }, heads, rows, this.props.children);
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { default } from './components/TableTree';
2
- export { default as Headers } from './components/Headers';
3
- export { default as Header } from './components/Header';
4
- export { default as Cell } from './components/Cell';
5
- export { default as Rows } from './components/Rows';
6
- export { default as Row } from './components/Row';
7
- export { default as TableTreeDataHelper } from './utils/TableTreeDataHelper';
1
+ export { default } from './components/table-tree';
2
+ export { default as Headers } from './components/headers';
3
+ export { default as Header } from './components/header';
4
+ export { default as Cell } from './components/cell';
5
+ export { default as Rows } from './components/rows';
6
+ export { default as Row } from './components/row';
7
+ export { default as TableTreeDataHelper } from './utils/table-tree-data-helper';
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
 
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
6
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7
7
 
8
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9
9
 
@@ -93,10 +93,6 @@ var TableTreeDataHelper = /*#__PURE__*/function () {
93
93
 
94
94
  _classCallCheck(this, TableTreeDataHelper);
95
95
 
96
- _defineProperty(this, "key", void 0);
97
-
98
- _defineProperty(this, "keysCache", void 0);
99
-
100
96
  this.key = key;
101
97
  this.keysCache = {};
102
98
  }
File without changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.0.9",
3
+ "version": "9.0.13",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ export interface CellProps {
3
+ singleLine?: boolean;
4
+ indentLevel?: number;
5
+ width?: number | string;
6
+ className?: string;
7
+ }
8
+ declare const _default: {
9
+ new (props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>): {
10
+ UNSAFE_componentWillMount(): void;
11
+ setColumnWidth(width?: string | number | undefined): void;
12
+ UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
13
+ render(): JSX.Element;
14
+ context: any;
15
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
16
+ forceUpdate(callBack?: (() => void) | undefined): void;
17
+ readonly props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps> & Readonly<{
18
+ children?: React.ReactNode;
19
+ }>;
20
+ state: Readonly<{}>;
21
+ refs: {
22
+ [key: string]: React.ReactInstance;
23
+ };
24
+ componentDidMount?(): void;
25
+ shouldComponentUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
26
+ componentWillUnmount?(): void;
27
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
28
+ getSnapshotBeforeUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
29
+ componentDidUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
30
+ componentWillMount?(): void;
31
+ componentWillReceiveProps?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextContext: any): void;
32
+ componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
33
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
34
+ };
35
+ new (props: CellProps & import("./internal/with-column-width").CellWithColumnWidthProps, context?: any): {
36
+ UNSAFE_componentWillMount(): void;
37
+ setColumnWidth(width?: string | number | undefined): void;
38
+ UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
39
+ render(): JSX.Element;
40
+ context: any;
41
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
42
+ forceUpdate(callBack?: (() => void) | undefined): void;
43
+ readonly props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps> & Readonly<{
44
+ children?: React.ReactNode;
45
+ }>;
46
+ state: Readonly<{}>;
47
+ refs: {
48
+ [key: string]: React.ReactInstance;
49
+ };
50
+ componentDidMount?(): void;
51
+ shouldComponentUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
52
+ componentWillUnmount?(): void;
53
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
54
+ getSnapshotBeforeUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
55
+ componentDidUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
56
+ componentWillMount?(): void;
57
+ componentWillReceiveProps?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextContext: any): void;
58
+ componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
59
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
60
+ };
61
+ contextTypes: {
62
+ tableTree: import("prop-types").Validator<any>;
63
+ };
64
+ contextType?: React.Context<any> | undefined;
65
+ };
66
+ export default _default;
@@ -0,0 +1,60 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ new (props: Readonly<any>): {
4
+ UNSAFE_componentWillMount(): void;
5
+ setColumnWidth(width?: string | number | undefined): void;
6
+ UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
7
+ render(): JSX.Element;
8
+ context: any;
9
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
10
+ forceUpdate(callBack?: (() => void) | undefined): void;
11
+ readonly props: Readonly<any> & Readonly<{
12
+ children?: import("react").ReactNode;
13
+ }>;
14
+ state: Readonly<{}>;
15
+ refs: {
16
+ [key: string]: import("react").ReactInstance;
17
+ };
18
+ componentDidMount?(): void;
19
+ shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
20
+ componentWillUnmount?(): void;
21
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
22
+ getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
23
+ componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
24
+ componentWillMount?(): void;
25
+ componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
26
+ componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
27
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
28
+ };
29
+ new (props: any, context?: any): {
30
+ UNSAFE_componentWillMount(): void;
31
+ setColumnWidth(width?: string | number | undefined): void;
32
+ UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
33
+ render(): JSX.Element;
34
+ context: any;
35
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
36
+ forceUpdate(callBack?: (() => void) | undefined): void;
37
+ readonly props: Readonly<any> & Readonly<{
38
+ children?: import("react").ReactNode;
39
+ }>;
40
+ state: Readonly<{}>;
41
+ refs: {
42
+ [key: string]: import("react").ReactInstance;
43
+ };
44
+ componentDidMount?(): void;
45
+ shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): boolean;
46
+ componentWillUnmount?(): void;
47
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
48
+ getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>): any;
49
+ componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<{}>, snapshot?: any): void;
50
+ componentWillMount?(): void;
51
+ componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
52
+ componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
53
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<{}>, nextContext: any): void;
54
+ };
55
+ contextTypes: {
56
+ tableTree: import("prop-types").Validator<any>;
57
+ };
58
+ contextType?: import("react").Context<any> | undefined;
59
+ };
60
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /** @jsx jsx */
2
+ import { Component } from 'react';
3
+ export default class Headers extends Component<any> {
4
+ render(): JSX.Element;
5
+ }
@@ -0,0 +1,17 @@
1
+ import { Component } from 'react';
2
+ interface ChevronProps {
3
+ expandLabel: string;
4
+ collapseLabel: string;
5
+ isExpanded?: boolean;
6
+ ariaControls?: string;
7
+ onExpandToggle?: Function;
8
+ }
9
+ export default class Chevron extends Component<ChevronProps> {
10
+ static defaultProps: {
11
+ expandLabel: string;
12
+ collapseLabel: string;
13
+ };
14
+ handleClick: () => void;
15
+ render(): JSX.Element;
16
+ }
17
+ export {};
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import { FC, HTMLAttributes } from 'react';
3
+ interface CommonCellProps {
4
+ indent?: string;
5
+ }
6
+ /**
7
+ * __Common cell__
8
+ */
9
+ declare const CommonCell: FC<HTMLAttributes<HTMLDivElement> & CommonCellProps>;
10
+ export default CommonCell;
@@ -0,0 +1,12 @@
1
+ /** @jsx jsx */
2
+ import { Component } from 'react';
3
+ export default class Item extends Component<any> {
4
+ static defaultProps: {
5
+ depth: number;
6
+ };
7
+ render(): import("react").FunctionComponentElement<{
8
+ depth: any;
9
+ data: any;
10
+ renderChildren: () => JSX.Element;
11
+ }> | null;
12
+ }
@@ -0,0 +1,24 @@
1
+ import React, { Component } from 'react';
2
+ interface ItemsProps<Item = any> {
3
+ parentData?: any;
4
+ depth: number;
5
+ items?: Item[];
6
+ render: (arg: Item) => React.ReactNode;
7
+ }
8
+ interface State {
9
+ isLoaderShown: boolean;
10
+ }
11
+ export default class Items<Item> extends Component<ItemsProps<Item>, State> {
12
+ static defaultProps: {
13
+ depth: number;
14
+ };
15
+ state: State;
16
+ static getDerivedStateFromProps(nextProps: any, prevState: any): {
17
+ isLoaderShown: boolean;
18
+ } | null;
19
+ handleLoaderComplete: () => void;
20
+ renderLoader(): JSX.Element;
21
+ renderItems(): JSX.Element[] | undefined;
22
+ render(): JSX.Element;
23
+ }
24
+ export {};