@atlaskit/table-tree 9.0.12 → 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 (76) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/components/{Cell.js → cell.js} +23 -8
  3. package/dist/cjs/components/{Header.js → header.js} +19 -9
  4. package/dist/cjs/components/{Headers.js → headers.js} +11 -11
  5. package/dist/cjs/components/{Chevron.js → internal/chevron.js} +1 -1
  6. package/dist/cjs/components/internal/common-cell.js +45 -0
  7. package/dist/cjs/components/{Item.js → internal/item.js} +7 -11
  8. package/dist/cjs/components/{Items.js → internal/items.js} +4 -4
  9. package/dist/cjs/components/{LoaderItem.js → internal/loader-item.js} +10 -10
  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} +6 -3
  13. package/dist/cjs/components/{Row.js → row.js} +5 -5
  14. package/dist/cjs/components/{Rows.js → rows.js} +2 -3
  15. package/dist/cjs/components/{TableTree.js → table-tree.js} +11 -13
  16. package/dist/cjs/index.js +14 -14
  17. package/dist/cjs/utils/{TableTreeDataHelper.js → table-tree-data-helper.js} +0 -2
  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} +21 -7
  39. package/dist/esm/components/{Header.js → header.js} +21 -5
  40. package/dist/esm/components/{Headers.js → headers.js} +13 -5
  41. package/dist/esm/components/{Chevron.js → internal/chevron.js} +3 -1
  42. package/dist/esm/components/internal/common-cell.js +33 -0
  43. package/dist/esm/components/{Item.js → internal/item.js} +10 -6
  44. package/dist/esm/components/{Items.js → internal/items.js} +2 -2
  45. package/dist/esm/components/{LoaderItem.js → internal/loader-item.js} +11 -10
  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} +6 -3
  49. package/dist/esm/components/{Row.js → row.js} +5 -5
  50. package/dist/esm/components/{Rows.js → rows.js} +1 -2
  51. package/dist/esm/components/{TableTree.js → table-tree.js} +6 -7
  52. package/dist/esm/index.js +7 -7
  53. package/dist/esm/utils/{TableTreeDataHelper.js → table-tree-data-helper.js} +0 -4
  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 +23 -6
  74. package/dist/cjs/styled.js +0 -111
  75. package/dist/esm/styled.js +0 -68
  76. package/styled/package.json +0 -6
@@ -10,10 +10,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
 
13
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
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";
@@ -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
 
@@ -11,14 +11,14 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
 
12
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.12";
21
+ var packageVersion = "9.0.13";
22
22
 
23
23
  var Row = /*#__PURE__*/function (_Component) {
24
24
  _inherits(Row, _Component);
@@ -9,7 +9,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
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;
@@ -13,12 +13,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
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';
@@ -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.12",
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 {};
@@ -0,0 +1,20 @@
1
+ import { Component } from 'react';
2
+ interface LoaderItemProps {
3
+ depth: number;
4
+ onComplete: (...args: any[]) => void;
5
+ isCompleting?: boolean;
6
+ }
7
+ export default class LoaderItem extends Component<LoaderItemProps, any> {
8
+ static defaultProps: {
9
+ depth: number;
10
+ };
11
+ state: {
12
+ phase: string;
13
+ };
14
+ static getDerivedStateFromProps(nextProps: any, prevState: any): {
15
+ phase: string;
16
+ } | null;
17
+ componentDidUpdate(prevProps: any, prevState: any): void;
18
+ render(): JSX.Element | null;
19
+ }
20
+ export {};
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import { FC, HTMLAttributes } from 'react';
3
+ interface OverflowContainerProps {
4
+ isSingleLine?: boolean;
5
+ }
6
+ /**
7
+ * __Overflow container__
8
+ */
9
+ declare const OverflowContainer: FC<OverflowContainerProps & HTMLAttributes<HTMLSpanElement>>;
10
+ export default OverflowContainer;
@@ -0,0 +1,25 @@
1
+ /** @jsx jsx */
2
+ import { FC, HTMLAttributes } from 'react';
3
+ export declare const iconColor: "var(--ds-text-highEmphasis)";
4
+ /**
5
+ * __Tree row container__
6
+ */
7
+ export declare const TreeRowContainer: FC<HTMLAttributes<HTMLDivElement>>;
8
+ /**
9
+ * __Chevron container__
10
+ */
11
+ export declare const ChevronContainer: FC<HTMLAttributes<HTMLSpanElement>>;
12
+ /**
13
+ * __Chevron icon container__
14
+ *
15
+ * A chevron icon container.
16
+ */
17
+ export declare const ChevronIconContainer: FC<HTMLAttributes<HTMLSpanElement>>;
18
+ /**
19
+ * __Loader item container__
20
+ *
21
+ * A loader item container.
22
+ */
23
+ export declare const LoaderItemContainer: FC<{
24
+ isRoot?: boolean;
25
+ }>;
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ export interface CellWithColumnWidthProps {
4
+ width?: number | string;
5
+ columnIndex?: number;
6
+ }
7
+ export default function withColumnWidth<T extends object>(Cell: React.ComponentType<T>): {
8
+ new (props: Readonly<T & CellWithColumnWidthProps>): {
9
+ UNSAFE_componentWillMount(): void;
10
+ setColumnWidth(width?: string | number | undefined): void;
11
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
12
+ render(): JSX.Element;
13
+ context: any;
14
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<T & CellWithColumnWidthProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
15
+ forceUpdate(callBack?: (() => void) | undefined): void;
16
+ readonly props: Readonly<T & CellWithColumnWidthProps> & Readonly<{
17
+ children?: React.ReactNode;
18
+ }>;
19
+ state: Readonly<{}>;
20
+ refs: {
21
+ [key: string]: React.ReactInstance;
22
+ };
23
+ componentDidMount?(): void;
24
+ shouldComponentUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
25
+ componentWillUnmount?(): void;
26
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
27
+ getSnapshotBeforeUpdate?(prevProps: Readonly<T & CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
28
+ componentDidUpdate?(prevProps: Readonly<T & CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
29
+ componentWillMount?(): void;
30
+ componentWillReceiveProps?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextContext: any): void;
31
+ componentWillUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
32
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
33
+ };
34
+ new (props: T & CellWithColumnWidthProps, context?: any): {
35
+ UNSAFE_componentWillMount(): void;
36
+ setColumnWidth(width?: string | number | undefined): void;
37
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
38
+ render(): JSX.Element;
39
+ context: any;
40
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<T & CellWithColumnWidthProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
41
+ forceUpdate(callBack?: (() => void) | undefined): void;
42
+ readonly props: Readonly<T & CellWithColumnWidthProps> & Readonly<{
43
+ children?: React.ReactNode;
44
+ }>;
45
+ state: Readonly<{}>;
46
+ refs: {
47
+ [key: string]: React.ReactInstance;
48
+ };
49
+ componentDidMount?(): void;
50
+ shouldComponentUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
51
+ componentWillUnmount?(): void;
52
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
53
+ getSnapshotBeforeUpdate?(prevProps: Readonly<T & CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
54
+ componentDidUpdate?(prevProps: Readonly<T & CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
55
+ componentWillMount?(): void;
56
+ componentWillReceiveProps?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextContext: any): void;
57
+ componentWillUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
58
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<T & CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
59
+ };
60
+ contextTypes: {
61
+ tableTree: PropTypes.Validator<any>;
62
+ };
63
+ contextType?: React.Context<any> | undefined;
64
+ };
@@ -0,0 +1,19 @@
1
+ import React, { Component } from 'react';
2
+ declare class Row extends Component<any, any> {
3
+ state: {
4
+ isExpanded: any;
5
+ };
6
+ componentDidUpdate(prevProps: any): void;
7
+ onExpandStateChange(isExpanded: boolean): void;
8
+ onExpandToggle: () => void;
9
+ isExpanded(): any;
10
+ renderCell(cell: any, cellIndex: number): React.FunctionComponentElement<{
11
+ key: number;
12
+ columnIndex: number;
13
+ indentLevel: any;
14
+ }>;
15
+ render(): JSX.Element;
16
+ }
17
+ export { Row as RowWithoutAnalytics };
18
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<any, string | number | symbol>, string | number | symbol> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, string | number | symbol> & React.RefAttributes<any>>;
19
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React, { Component } from 'react';
2
+ declare type WithChildren<T> = T & {
3
+ children?: T[] | null;
4
+ };
5
+ export interface RowsProps<T> {
6
+ items?: WithChildren<T>[];
7
+ render: (args: WithChildren<T>) => React.ReactNode;
8
+ }
9
+ export default class Rows<T> extends Component<RowsProps<T>> {
10
+ render(): JSX.Element;
11
+ }
12
+ export {};