@atlaskit/table-tree 9.5.0 → 9.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,64 +1,6 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export interface CellWithColumnWidthProps {
4
- width?: number | string;
3
+ width?: string | number;
5
4
  columnIndex?: number;
6
5
  }
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?: number | string): 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?: number | string): 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<object>;
62
- };
63
- contextType?: React.Context<any> | undefined;
64
- };
6
+ export default function withColumnWidth<T extends object>(Cell: React.ComponentType<T>): (props: T & CellWithColumnWidthProps) => JSX.Element;
@@ -1,23 +1,23 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { Component } from 'react';
2
+ type ColumnWidth = string | number;
3
3
  interface State {
4
- columnWidths: number[];
4
+ columnWidths: ColumnWidth[];
5
5
  }
6
+ type TableTreeContext = {
7
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
8
+ getColumnWidth: (columnIndex: number) => ColumnWidth | null;
9
+ };
10
+ /**
11
+ *
12
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
13
+ * Enables composed table-tree implementations to e.g. set width on header cells only
14
+ */
15
+ export declare const TableTreeContext: React.Context<TableTreeContext>;
6
16
  export default class TableTree extends Component<any, State> {
7
- static childContextTypes: {
8
- tableTree: PropTypes.Validator<object>;
9
- };
10
17
  state: State;
11
18
  componentDidMount(): void;
12
- setColumnWidth: (columnIndex: number, width: number) => void;
13
- getColumnWidth: (columnIndex: any) => number | null;
14
- getChildContext(): {
15
- tableTree: {
16
- columnWidths: number[];
17
- setColumnWidth: (columnIndex: number, width: number) => void;
18
- getColumnWidth: (columnIndex: any) => number | null;
19
- };
20
- };
19
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
20
+ getColumnWidth: (columnIndex: any) => ColumnWidth | null;
21
21
  render(): JSX.Element;
22
22
  }
23
23
  export {};
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export interface CellProps {
3
3
  /**
4
4
  * Whether the cell contents should wrap or display on a single line and be concatenated.
@@ -16,63 +16,10 @@ export interface CellProps {
16
16
  * Class name to apply to cell.
17
17
  */
18
18
  className?: string;
19
+ /**
20
+ * Children content, used when composing table-tree from internal components
21
+ */
22
+ children?: ReactNode;
19
23
  }
20
- declare const _default: {
21
- new (props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>): {
22
- UNSAFE_componentWillMount(): void;
23
- setColumnWidth(width?: string | number | undefined): void;
24
- UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
25
- render(): JSX.Element;
26
- context: any;
27
- 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;
28
- forceUpdate(callBack?: (() => void) | undefined): void;
29
- readonly props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps> & Readonly<{
30
- children?: React.ReactNode;
31
- }>;
32
- state: Readonly<{}>;
33
- refs: {
34
- [key: string]: React.ReactInstance;
35
- };
36
- componentDidMount?(): void;
37
- shouldComponentUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
38
- componentWillUnmount?(): void;
39
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
40
- getSnapshotBeforeUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
41
- componentDidUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
42
- componentWillMount?(): void;
43
- componentWillReceiveProps?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextContext: any): void;
44
- componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
45
- UNSAFE_componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
46
- };
47
- new (props: CellProps & import("./internal/with-column-width").CellWithColumnWidthProps, context?: any): {
48
- UNSAFE_componentWillMount(): void;
49
- setColumnWidth(width?: string | number | undefined): void;
50
- UNSAFE_componentWillReceiveProps(nextProps: import("./internal/with-column-width").CellWithColumnWidthProps): void;
51
- render(): JSX.Element;
52
- context: any;
53
- 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;
54
- forceUpdate(callBack?: (() => void) | undefined): void;
55
- readonly props: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps> & Readonly<{
56
- children?: React.ReactNode;
57
- }>;
58
- state: Readonly<{}>;
59
- refs: {
60
- [key: string]: React.ReactInstance;
61
- };
62
- componentDidMount?(): void;
63
- shouldComponentUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): boolean;
64
- componentWillUnmount?(): void;
65
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
66
- getSnapshotBeforeUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>): any;
67
- componentDidUpdate?(prevProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, prevState: Readonly<{}>, snapshot?: any): void;
68
- componentWillMount?(): void;
69
- componentWillReceiveProps?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextContext: any): void;
70
- componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
71
- UNSAFE_componentWillUpdate?(nextProps: Readonly<CellProps & import("./internal/with-column-width").CellWithColumnWidthProps>, nextState: Readonly<{}>, nextContext: any): void;
72
- };
73
- contextTypes: {
74
- tableTree: import("prop-types").Validator<object>;
75
- };
76
- contextType?: React.Context<any> | undefined;
77
- };
24
+ declare const _default: (props: CellProps & import("./internal/with-column-width").CellWithColumnWidthProps) => JSX.Element;
78
25
  export default _default;
@@ -1,60 +1,3 @@
1
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<object>;
57
- };
58
- contextType?: import("react").Context<any> | undefined;
59
- };
2
+ declare const _default: (props: any) => JSX.Element;
60
3
  export default _default;
@@ -1,64 +1,6 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  export interface CellWithColumnWidthProps {
4
- width?: number | string;
3
+ width?: string | number;
5
4
  columnIndex?: number;
6
5
  }
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?: number | string): 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?: number | string): 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<object>;
62
- };
63
- contextType?: React.Context<any> | undefined;
64
- };
6
+ export default function withColumnWidth<T extends object>(Cell: React.ComponentType<T>): (props: T & CellWithColumnWidthProps) => JSX.Element;
@@ -1,23 +1,23 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
1
+ import React, { Component } from 'react';
2
+ type ColumnWidth = string | number;
3
3
  interface State {
4
- columnWidths: number[];
4
+ columnWidths: ColumnWidth[];
5
5
  }
6
+ type TableTreeContext = {
7
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
8
+ getColumnWidth: (columnIndex: number) => ColumnWidth | null;
9
+ };
10
+ /**
11
+ *
12
+ * Context provider which maintains the column widths and access methods for use in descendent table cells
13
+ * Enables composed table-tree implementations to e.g. set width on header cells only
14
+ */
15
+ export declare const TableTreeContext: React.Context<TableTreeContext>;
6
16
  export default class TableTree extends Component<any, State> {
7
- static childContextTypes: {
8
- tableTree: PropTypes.Validator<object>;
9
- };
10
17
  state: State;
11
18
  componentDidMount(): void;
12
- setColumnWidth: (columnIndex: number, width: number) => void;
13
- getColumnWidth: (columnIndex: any) => number | null;
14
- getChildContext(): {
15
- tableTree: {
16
- columnWidths: number[];
17
- setColumnWidth: (columnIndex: number, width: number) => void;
18
- getColumnWidth: (columnIndex: any) => number | null;
19
- };
20
- };
19
+ setColumnWidth: (columnIndex: number, width: ColumnWidth) => void;
20
+ getColumnWidth: (columnIndex: any) => ColumnWidth | null;
21
21
  render(): JSX.Element;
22
22
  }
23
23
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/table-tree",
3
- "version": "9.5.0",
3
+ "version": "9.6.0",
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/"
@@ -25,7 +25,7 @@
25
25
  "homepage": "https://atlassian.design/components/table-tree/",
26
26
  "atlassian": {
27
27
  "team": "Design System Team",
28
- "releaseModel": "scheduled",
28
+ "releaseModel": "continuous",
29
29
  "website": {
30
30
  "name": "Table tree",
31
31
  "category": "Components"
@@ -36,15 +36,14 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@atlaskit/analytics-next": "^9.1.0",
39
- "@atlaskit/button": "^16.7.0",
39
+ "@atlaskit/button": "^16.8.0",
40
40
  "@atlaskit/icon": "^21.12.0",
41
41
  "@atlaskit/spinner": "^15.5.0",
42
42
  "@atlaskit/theme": "^12.5.0",
43
- "@atlaskit/tokens": "^1.5.0",
43
+ "@atlaskit/tokens": "^1.10.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
- "lodash": "^4.17.21",
47
- "prop-types": "^15.5.10"
46
+ "lodash": "^4.17.21"
48
47
  },
49
48
  "peerDependencies": {
50
49
  "react": "^16.8.0"
@@ -52,7 +51,7 @@
52
51
  "devDependencies": {
53
52
  "@atlaskit/docs": "*",
54
53
  "@atlaskit/ds-lib": "^2.2.0",
55
- "@atlaskit/empty-state": "^7.5.0",
54
+ "@atlaskit/empty-state": "^7.6.0",
56
55
  "@atlaskit/section-message": "^6.4.0",
57
56
  "@atlaskit/select": "^16.5.0",
58
57
  "@atlaskit/ssr": "*",