@atlaskit/table-tree 9.1.8 → 9.2.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/header.js +10 -4
  3. package/dist/cjs/components/headers.js +10 -4
  4. package/dist/cjs/components/internal/common-cell.js +11 -5
  5. package/dist/cjs/components/internal/item.js +3 -3
  6. package/dist/cjs/components/internal/overflow-container.js +14 -5
  7. package/dist/cjs/components/internal/styled.js +37 -20
  8. package/dist/cjs/components/row.js +1 -1
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/components/header.js +8 -3
  11. package/dist/es2019/components/headers.js +10 -3
  12. package/dist/es2019/components/internal/common-cell.js +9 -6
  13. package/dist/es2019/components/internal/item.js +1 -1
  14. package/dist/es2019/components/internal/overflow-container.js +10 -6
  15. package/dist/es2019/components/internal/styled.js +28 -16
  16. package/dist/es2019/components/row.js +1 -1
  17. package/dist/es2019/version.json +1 -1
  18. package/dist/esm/components/header.js +8 -3
  19. package/dist/esm/components/headers.js +8 -3
  20. package/dist/esm/components/internal/common-cell.js +9 -6
  21. package/dist/esm/components/internal/item.js +1 -1
  22. package/dist/esm/components/internal/overflow-container.js +12 -6
  23. package/dist/esm/components/internal/styled.js +31 -17
  24. package/dist/esm/components/row.js +1 -1
  25. package/dist/esm/version.json +1 -1
  26. package/dist/types/components/cell.d.ts +12 -0
  27. package/dist/types/components/headers.d.ts +2 -1
  28. package/dist/types/components/internal/item.d.ts +2 -1
  29. package/extract-react-types/table-tree-cell.tsx +7 -0
  30. package/extract-react-types/table-tree-header.tsx +20 -0
  31. package/extract-react-types/table-tree-row.tsx +85 -0
  32. package/extract-react-types/table-tree-rows.tsx +34 -0
  33. package/extract-react-types/table-tree.tsx +6 -5
  34. package/package.json +12 -9
  35. package/report.api.md +369 -0
package/report.api.md ADDED
@@ -0,0 +1,369 @@
1
+ ## API Report File for "@atlaskit/table-tree"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ /// <reference types="react" />
7
+
8
+ import { Component } from 'react';
9
+ import { Context } from 'react';
10
+ import { ErrorInfo } from 'react';
11
+ import PropTypes from 'prop-types';
12
+ import { default as React_2 } from 'react';
13
+ import { ReactInstance } from 'react';
14
+ import { ReactNode } from 'react';
15
+ import { Validator } from 'prop-types';
16
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
17
+ import { WithContextProps } from '@atlaskit/analytics-next';
18
+
19
+ export declare const Cell: {
20
+ new (props: Readonly<CellProps & CellWithColumnWidthProps>): {
21
+ UNSAFE_componentWillMount(): void;
22
+ setColumnWidth(width?: string | number | undefined): void;
23
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
24
+ render(): JSX.Element;
25
+ context: any;
26
+ setState<K extends never>(
27
+ state:
28
+ | {}
29
+ | ((
30
+ prevState: Readonly<{}>,
31
+ props: Readonly<CellProps & CellWithColumnWidthProps>,
32
+ ) => {} | Pick<{}, K> | null)
33
+ | Pick<{}, K>
34
+ | null,
35
+ callback?: (() => void) | undefined,
36
+ ): void;
37
+ forceUpdate(callBack?: (() => void) | undefined): void;
38
+ readonly props: Readonly<CellProps & CellWithColumnWidthProps> &
39
+ Readonly<{
40
+ children?: React_2.ReactNode;
41
+ }>;
42
+ state: Readonly<{}>;
43
+ refs: {
44
+ [key: string]: React_2.ReactInstance;
45
+ };
46
+ componentDidMount?(): void;
47
+ shouldComponentUpdate?(
48
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
49
+ nextState: Readonly<{}>,
50
+ nextContext: any,
51
+ ): boolean;
52
+ componentWillUnmount?(): void;
53
+ componentDidCatch?(error: Error, errorInfo: React_2.ErrorInfo): void;
54
+ getSnapshotBeforeUpdate?(
55
+ prevProps: Readonly<CellProps & CellWithColumnWidthProps>,
56
+ prevState: Readonly<{}>,
57
+ ): any;
58
+ componentDidUpdate?(
59
+ prevProps: Readonly<CellProps & CellWithColumnWidthProps>,
60
+ prevState: Readonly<{}>,
61
+ snapshot?: any,
62
+ ): void;
63
+ componentWillMount?(): void;
64
+ componentWillReceiveProps?(
65
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
66
+ nextContext: any,
67
+ ): void;
68
+ componentWillUpdate?(
69
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
70
+ nextState: Readonly<{}>,
71
+ nextContext: any,
72
+ ): void;
73
+ UNSAFE_componentWillUpdate?(
74
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
75
+ nextState: Readonly<{}>,
76
+ nextContext: any,
77
+ ): void;
78
+ };
79
+ new (props: CellProps & CellWithColumnWidthProps, context?: any): {
80
+ UNSAFE_componentWillMount(): void;
81
+ setColumnWidth(width?: string | number | undefined): void;
82
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
83
+ render(): JSX.Element;
84
+ context: any;
85
+ setState<K extends never>(
86
+ state:
87
+ | {}
88
+ | ((
89
+ prevState: Readonly<{}>,
90
+ props: Readonly<CellProps & CellWithColumnWidthProps>,
91
+ ) => {} | Pick<{}, K> | null)
92
+ | Pick<{}, K>
93
+ | null,
94
+ callback?: (() => void) | undefined,
95
+ ): void;
96
+ forceUpdate(callBack?: (() => void) | undefined): void;
97
+ readonly props: Readonly<CellProps & CellWithColumnWidthProps> &
98
+ Readonly<{
99
+ children?: React_2.ReactNode;
100
+ }>;
101
+ state: Readonly<{}>;
102
+ refs: {
103
+ [key: string]: React_2.ReactInstance;
104
+ };
105
+ componentDidMount?(): void;
106
+ shouldComponentUpdate?(
107
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
108
+ nextState: Readonly<{}>,
109
+ nextContext: any,
110
+ ): boolean;
111
+ componentWillUnmount?(): void;
112
+ componentDidCatch?(error: Error, errorInfo: React_2.ErrorInfo): void;
113
+ getSnapshotBeforeUpdate?(
114
+ prevProps: Readonly<CellProps & CellWithColumnWidthProps>,
115
+ prevState: Readonly<{}>,
116
+ ): any;
117
+ componentDidUpdate?(
118
+ prevProps: Readonly<CellProps & CellWithColumnWidthProps>,
119
+ prevState: Readonly<{}>,
120
+ snapshot?: any,
121
+ ): void;
122
+ componentWillMount?(): void;
123
+ componentWillReceiveProps?(
124
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
125
+ nextContext: any,
126
+ ): void;
127
+ componentWillUpdate?(
128
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
129
+ nextState: Readonly<{}>,
130
+ nextContext: any,
131
+ ): void;
132
+ UNSAFE_componentWillUpdate?(
133
+ nextProps: Readonly<CellProps & CellWithColumnWidthProps>,
134
+ nextState: Readonly<{}>,
135
+ nextContext: any,
136
+ ): void;
137
+ };
138
+ contextTypes: {
139
+ tableTree: Validator<object>;
140
+ };
141
+ contextType?: React_2.Context<any> | undefined;
142
+ };
143
+
144
+ export declare interface CellProps {
145
+ /**
146
+ * Whether the cell contents should wrap or display on a single line and be concatenated.
147
+ */
148
+ singleLine?: boolean;
149
+ /**
150
+ * Indent level for the cell. Each indent level adds 25px to the left padding.
151
+ */
152
+ indentLevel?: number;
153
+ /**
154
+ * Width of the header item. Takes a string or a number representing the width in pixels.
155
+ */
156
+ width?: number | string;
157
+ /**
158
+ * Class name to apply to cell.
159
+ */
160
+ className?: string;
161
+ }
162
+
163
+ export declare interface CellWithColumnWidthProps {
164
+ width?: number | string;
165
+ columnIndex?: number;
166
+ }
167
+
168
+ export declare const Header: {
169
+ new (props: Readonly<any>): {
170
+ UNSAFE_componentWillMount(): void;
171
+ setColumnWidth(width?: string | number | undefined): void;
172
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
173
+ render(): JSX.Element;
174
+ context: any;
175
+ setState<K extends never>(
176
+ state:
177
+ | {}
178
+ | ((
179
+ prevState: Readonly<{}>,
180
+ props: Readonly<any>,
181
+ ) => {} | Pick<{}, K> | null)
182
+ | Pick<{}, K>
183
+ | null,
184
+ callback?: (() => void) | undefined,
185
+ ): void;
186
+ forceUpdate(callBack?: (() => void) | undefined): void;
187
+ readonly props: Readonly<any> &
188
+ Readonly<{
189
+ children?: ReactNode;
190
+ }>;
191
+ state: Readonly<{}>;
192
+ refs: {
193
+ [key: string]: ReactInstance;
194
+ };
195
+ componentDidMount?(): void;
196
+ shouldComponentUpdate?(
197
+ nextProps: Readonly<any>,
198
+ nextState: Readonly<{}>,
199
+ nextContext: any,
200
+ ): boolean;
201
+ componentWillUnmount?(): void;
202
+ componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
203
+ getSnapshotBeforeUpdate?(
204
+ prevProps: Readonly<any>,
205
+ prevState: Readonly<{}>,
206
+ ): any;
207
+ componentDidUpdate?(
208
+ prevProps: Readonly<any>,
209
+ prevState: Readonly<{}>,
210
+ snapshot?: any,
211
+ ): void;
212
+ componentWillMount?(): void;
213
+ componentWillReceiveProps?(
214
+ nextProps: Readonly<any>,
215
+ nextContext: any,
216
+ ): void;
217
+ componentWillUpdate?(
218
+ nextProps: Readonly<any>,
219
+ nextState: Readonly<{}>,
220
+ nextContext: any,
221
+ ): void;
222
+ UNSAFE_componentWillUpdate?(
223
+ nextProps: Readonly<any>,
224
+ nextState: Readonly<{}>,
225
+ nextContext: any,
226
+ ): void;
227
+ };
228
+ new (props: any, context?: any): {
229
+ UNSAFE_componentWillMount(): void;
230
+ setColumnWidth(width?: string | number | undefined): void;
231
+ UNSAFE_componentWillReceiveProps(nextProps: CellWithColumnWidthProps): void;
232
+ render(): JSX.Element;
233
+ context: any;
234
+ setState<K extends never>(
235
+ state:
236
+ | {}
237
+ | ((
238
+ prevState: Readonly<{}>,
239
+ props: Readonly<any>,
240
+ ) => {} | Pick<{}, K> | null)
241
+ | Pick<{}, K>
242
+ | null,
243
+ callback?: (() => void) | undefined,
244
+ ): void;
245
+ forceUpdate(callBack?: (() => void) | undefined): void;
246
+ readonly props: Readonly<any> &
247
+ Readonly<{
248
+ children?: ReactNode;
249
+ }>;
250
+ state: Readonly<{}>;
251
+ refs: {
252
+ [key: string]: ReactInstance;
253
+ };
254
+ componentDidMount?(): void;
255
+ shouldComponentUpdate?(
256
+ nextProps: Readonly<any>,
257
+ nextState: Readonly<{}>,
258
+ nextContext: any,
259
+ ): boolean;
260
+ componentWillUnmount?(): void;
261
+ componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
262
+ getSnapshotBeforeUpdate?(
263
+ prevProps: Readonly<any>,
264
+ prevState: Readonly<{}>,
265
+ ): any;
266
+ componentDidUpdate?(
267
+ prevProps: Readonly<any>,
268
+ prevState: Readonly<{}>,
269
+ snapshot?: any,
270
+ ): void;
271
+ componentWillMount?(): void;
272
+ componentWillReceiveProps?(
273
+ nextProps: Readonly<any>,
274
+ nextContext: any,
275
+ ): void;
276
+ componentWillUpdate?(
277
+ nextProps: Readonly<any>,
278
+ nextState: Readonly<{}>,
279
+ nextContext: any,
280
+ ): void;
281
+ UNSAFE_componentWillUpdate?(
282
+ nextProps: Readonly<any>,
283
+ nextState: Readonly<{}>,
284
+ nextContext: any,
285
+ ): void;
286
+ };
287
+ contextTypes: {
288
+ tableTree: Validator<object>;
289
+ };
290
+ contextType?: Context<any> | undefined;
291
+ };
292
+
293
+ declare class Headers_2 extends Component<any> {
294
+ render(): JSX.Element;
295
+ }
296
+ export { Headers_2 as Headers };
297
+
298
+ export declare const Row: React_2.ForwardRefExoticComponent<
299
+ Pick<
300
+ Pick<Omit<any, keyof WithAnalyticsEventsProps>, string | number | symbol> &
301
+ React_2.RefAttributes<any> &
302
+ WithContextProps,
303
+ string | number | symbol
304
+ > &
305
+ React_2.RefAttributes<any>
306
+ >;
307
+
308
+ export declare class Rows<T> extends Component<RowsProps<T>> {
309
+ render(): JSX.Element;
310
+ }
311
+
312
+ export declare interface RowsProps<T> {
313
+ items?: WithChildren<T>[];
314
+ render: (args: WithChildren<T>) => React_2.ReactNode;
315
+ }
316
+
317
+ declare interface State {
318
+ columnWidths: number[];
319
+ }
320
+
321
+ declare class TableTree extends Component<any, State> {
322
+ static childContextTypes: {
323
+ tableTree: PropTypes.Validator<object>;
324
+ };
325
+ state: State;
326
+ componentDidMount(): void;
327
+ setColumnWidth: (columnIndex: number, width: number) => void;
328
+ getColumnWidth: (columnIndex: any) => number | null;
329
+ getChildContext(): {
330
+ tableTree: {
331
+ columnWidths: number[];
332
+ setColumnWidth: (columnIndex: number, width: number) => void;
333
+ getColumnWidth: (columnIndex: any) => number | null;
334
+ };
335
+ };
336
+ render(): JSX.Element;
337
+ }
338
+ export default TableTree;
339
+
340
+ /**
341
+ * This helper class will create a cache of all the id's in the items object and
342
+ * path to the object.
343
+ * Example:
344
+ * [{
345
+ * // item 1,
346
+ * id: 1,
347
+ * children:[{
348
+ * // item 1.1,
349
+ * id: '2'
350
+ * }]
351
+ * }]
352
+ *
353
+ * Cache will look something like:
354
+ * {1: 0, 2: '0.children[0]'}
355
+ */
356
+ export declare class TableTreeDataHelper<T extends any = any> {
357
+ key: keyof T;
358
+ keysCache: any;
359
+ constructor({ key }?: { key?: keyof T | undefined });
360
+ updateItems(items: T[], allItems?: T[], parentItem?: T | null): T[];
361
+ appendItems(items: T[], allItems?: T[], parentItem?: T | null): T[];
362
+ }
363
+
364
+ declare type WithChildren<T> = T & {
365
+ children?: T[] | null;
366
+ };
367
+
368
+ export {};
369
+ ```