@atlaskit/table-tree 9.1.8 → 9.1.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/table-tree
2
2
 
3
+ ## 9.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`efa50ac72ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/efa50ac72ba) - Adjusts jsdoc strings to improve prop documentation
8
+
3
9
  ## 9.1.8
4
10
 
5
11
  ### Patch Changes
@@ -44,7 +44,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
44
44
  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; } }
45
45
 
46
46
  var packageName = "@atlaskit/table-tree";
47
- var packageVersion = "9.1.8";
47
+ var packageVersion = "9.1.9";
48
48
 
49
49
  var Row = /*#__PURE__*/function (_Component) {
50
50
  (0, _inherits2.default)(Row, _Component);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.1.8",
3
+ "version": "9.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -8,7 +8,7 @@ import toItemId from '../utils/to-item-id';
8
8
  import Chevron from './internal/chevron';
9
9
  import { TreeRowContainer } from './internal/styled';
10
10
  const packageName = "@atlaskit/table-tree";
11
- const packageVersion = "9.1.8";
11
+ const packageVersion = "9.1.9";
12
12
 
13
13
  class Row extends Component {
14
14
  constructor(...args) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.1.8",
3
+ "version": "9.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -18,7 +18,7 @@ import toItemId from '../utils/to-item-id';
18
18
  import Chevron from './internal/chevron';
19
19
  import { TreeRowContainer } from './internal/styled';
20
20
  var packageName = "@atlaskit/table-tree";
21
- var packageVersion = "9.1.8";
21
+ var packageVersion = "9.1.9";
22
22
 
23
23
  var Row = /*#__PURE__*/function (_Component) {
24
24
  _inherits(Row, _Component);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.1.8",
3
+ "version": "9.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,20 @@
1
1
  import React from 'react';
2
2
  export interface CellProps {
3
+ /**
4
+ * Whether the cell contents should wrap or display on a single line and be concatenated.
5
+ */
3
6
  singleLine?: boolean;
7
+ /**
8
+ * Indent level for the cell. Each indent level adds 25px to the left padding.
9
+ */
4
10
  indentLevel?: number;
11
+ /**
12
+ * Width of the header item. Takes a string or a number representing the width in pixels.
13
+ */
5
14
  width?: number | string;
15
+ /**
16
+ * Class name to apply to cell.
17
+ */
6
18
  className?: string;
7
19
  }
8
20
  declare const _default: {
@@ -0,0 +1,7 @@
1
+ import { CellProps } from '../src/components/cell';
2
+
3
+ const TableRows = function (props: CellProps) {
4
+ return null;
5
+ };
6
+
7
+ export default TableRows;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This is hard-coded here because our actual <Header /> has no typings
3
+ * for its props.
4
+ *
5
+ * Adding types for real *might* break things so will need a little care.
6
+ *
7
+ * Defining it here for now lets us provide *something* without much headache.
8
+ */
9
+ type HeaderProps = {
10
+ /**
11
+ * Width of the header item. Takes a string, or a number representing the width in pixels.
12
+ */
13
+ width?: string | number;
14
+ };
15
+
16
+ const TableHeader = function (props: HeaderProps) {
17
+ return null;
18
+ };
19
+
20
+ export default TableHeader;
@@ -0,0 +1,85 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ import { Item } from './table-tree';
4
+
5
+ /**
6
+ * This is hard-coded here because our actual <TableTree /> has no typings
7
+ * for its props.
8
+ *
9
+ * Adding types for real *might* break things so will need a little care.
10
+ *
11
+ * Defining it here for now lets us provide *something* without much headache.
12
+ */
13
+ type RowProps = {
14
+ /**
15
+ * Whether the row has children
16
+ */
17
+ hasChildren?: boolean;
18
+ /**
19
+ * Children contained in the row. Should be one or more Cell components.
20
+ */
21
+ children?: React.ReactNode;
22
+ /**
23
+ * ID for the row item
24
+ */
25
+ itemId?: string;
26
+ // eslint-disable-next-line jsdoc/require-asterisk-prefix, jsdoc/check-alignment
27
+ /**
28
+ The data used to render the row and descendants. Pass down from `children` render prop.
29
+
30
+ In addition to these props, any other data can be added to the object, and it will
31
+ be provided as props when rendering each cell.
32
+ */
33
+ // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
34
+ items?: Item[] | null;
35
+ /**
36
+ * Controls the expanded state of the row.
37
+ */
38
+ isExpanded?: ReactNode;
39
+ /**
40
+ * Sets the default expanded state of the row.
41
+ */
42
+ isDefaultExpanded?: ReactNode;
43
+ /**
44
+ * `aria-label` attached to the expand chevron button
45
+ */
46
+ expandLabel?: string;
47
+ /**
48
+ * `aria-label` attached to the collapse chevron button
49
+ */
50
+ collapseLabel?: string;
51
+ /**
52
+ * Callback called when row collapses.
53
+ */
54
+ onCollapse?: (data: Item) => void;
55
+ /**
56
+ * Callback called when row expands.
57
+ */
58
+ onExpand?: (data: Item) => void;
59
+ /**
60
+ * Children to render under row.
61
+ * Normally set by parent Item component and does not need to be configured.
62
+ */
63
+ renderChildren?: () => React.ReactNode;
64
+ /**
65
+ * Data to render. Passed down by Item and passed into onExpand and onCollapse callbacks.
66
+ * Normally set by parent Item component and does not need to be configured.
67
+ */
68
+ // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
69
+ data?: Item;
70
+ /**
71
+ * Depth used for rendering indent.
72
+ * Normally set by parent Item component and does not need to be configured.
73
+ */
74
+ depth?: number;
75
+ };
76
+
77
+ const TableRow = function (props: RowProps) {
78
+ return null;
79
+ };
80
+
81
+ TableRow.defaultProps = {
82
+ isDefaultExpanded: false,
83
+ };
84
+
85
+ export default TableRow;
@@ -0,0 +1,34 @@
1
+ import { Item } from './table-tree';
2
+
3
+ /**
4
+ * This is hard-coded here because our actual <Rows /> has no typings
5
+ * for its props.
6
+ *
7
+ * Adding types for real *might* break things so will need a little care.
8
+ *
9
+ * Defining it here for now lets us provide *something* without much headache.
10
+ */
11
+ type RowsProps = {
12
+ // eslint-disable-next-line jsdoc/require-asterisk-prefix, jsdoc/check-alignment
13
+ /**
14
+ The data used to render the set of rows. Will be passed down via the `children` render prop.
15
+
16
+ In addition to these props, any other data can be added to the object, and it will
17
+ be provided as props when rendering each cell.
18
+ */
19
+ // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
20
+ items?: Item[] | null;
21
+ /**
22
+ * Render function for child rows. Render props will contain an item from the
23
+ * `items` prop above.
24
+ */
25
+ render?: (item: Item) => React.ReactNode;
26
+ };
27
+
28
+ const TableRows = function (props: RowsProps) {
29
+ return null;
30
+ };
31
+
32
+ TableRows.defaultProps = {};
33
+
34
+ export default TableRows;
@@ -2,9 +2,8 @@ import { ElementType, ReactNode } from 'react';
2
2
 
3
3
  class Content extends Object {}
4
4
 
5
- type Item = {
5
+ export type Item = {
6
6
  id: string;
7
- content: Content;
8
7
  hasChildren: boolean;
9
8
  children?: Item[];
10
9
  };
@@ -37,10 +36,12 @@ type TableTreeProps = {
37
36
  * The header text of the respective columns of the table.
38
37
  */
39
38
  headers?: string[];
39
+ // eslint-disable-next-line jsdoc/require-asterisk-prefix, jsdoc/check-alignment
40
40
  /**
41
- * The data used to render the table.
42
- * The type of `content` can be whatever you would like, and its value will be
43
- * provided as props when rendering each cell.
41
+ The data used to render the table.
42
+
43
+ In addition to these props, any other data can be added, and it will
44
+ be provided as props when rendering each cell.
44
45
  */
45
46
  // eslint-disable-next-line @repo/internal/react/consistent-props-definitions
46
47
  items?: Item[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.1.8",
3
+ "version": "9.1.9",
4
4
  "description": "A table tree is an expandable table for showing nested hierarchies of information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"