@atlaskit/dynamic-table 14.9.1 → 14.9.2

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 (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/stateless.js +1 -1
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/components/stateless.js +1 -1
  5. package/dist/es2019/version.json +1 -1
  6. package/dist/esm/components/stateless.js +1 -1
  7. package/dist/esm/version.json +1 -1
  8. package/dist/types-ts4.5/components/body.d.ts +112 -0
  9. package/dist/types-ts4.5/components/loading-container-advanced.d.ts +43 -0
  10. package/dist/types-ts4.5/components/loading-container.d.ts +18 -0
  11. package/dist/types-ts4.5/components/managed-pagination.d.ts +15 -0
  12. package/dist/types-ts4.5/components/rankable/body.d.ts +122 -0
  13. package/dist/types-ts4.5/components/rankable/table-cell.d.ts +14 -0
  14. package/dist/types-ts4.5/components/rankable/table-head-cell.d.ts +5 -0
  15. package/dist/types-ts4.5/components/rankable/table-row.d.ts +18 -0
  16. package/dist/types-ts4.5/components/stateful.d.ts +60 -0
  17. package/dist/types-ts4.5/components/stateless.d.ts +58 -0
  18. package/dist/types-ts4.5/components/table-head-cell.d.ts +19 -0
  19. package/dist/types-ts4.5/components/table-head.d.ts +18 -0
  20. package/dist/types-ts4.5/components/table-row.d.ts +11 -0
  21. package/dist/types-ts4.5/hoc/with-dimensions.d.ts +12 -0
  22. package/dist/types-ts4.5/hoc/with-sorted-page-rows.d.ts +117 -0
  23. package/dist/types-ts4.5/index.d.ts +2 -0
  24. package/dist/types-ts4.5/internal/constants.d.ts +5 -0
  25. package/dist/types-ts4.5/internal/helpers.d.ts +7 -0
  26. package/dist/types-ts4.5/styled/constants.d.ts +17 -0
  27. package/dist/types-ts4.5/styled/dynamic-table.d.ts +20 -0
  28. package/dist/types-ts4.5/styled/empty-body.d.ts +13 -0
  29. package/dist/types-ts4.5/styled/loading-container-advanced.d.ts +14 -0
  30. package/dist/types-ts4.5/styled/loading-container.d.ts +14 -0
  31. package/dist/types-ts4.5/styled/rankable/table-cell.d.ts +9 -0
  32. package/dist/types-ts4.5/styled/rankable/table-row.d.ts +13 -0
  33. package/dist/types-ts4.5/styled/table-cell.d.ts +4 -0
  34. package/dist/types-ts4.5/styled/table-head.d.ts +18 -0
  35. package/dist/types-ts4.5/styled/table-row.d.ts +10 -0
  36. package/dist/types-ts4.5/theme.d.ts +22 -0
  37. package/dist/types-ts4.5/types.d.ts +345 -0
  38. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/dynamic-table
2
2
 
3
+ ## 14.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
3
9
  ## 14.9.1
4
10
 
5
11
  ### Patch Changes
@@ -29,7 +29,7 @@ var _tableHead = _interopRequireDefault(require("./table-head"));
29
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
30
30
  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; } }
31
31
  var packageName = "@atlaskit/dynamic-table";
32
- var packageVersion = "14.9.1";
32
+ var packageVersion = "14.9.2";
33
33
  function toggleSortOrder(currentSortOrder) {
34
34
  switch (currentSortOrder) {
35
35
  case _constants.DESC:
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.1",
3
+ "version": "14.9.2",
4
4
  "sideEffects": false
5
5
  }
@@ -14,7 +14,7 @@ import ManagedPagination from './managed-pagination';
14
14
  import RankableTableBody from './rankable/body';
15
15
  import TableHead from './table-head';
16
16
  const packageName = "@atlaskit/dynamic-table";
17
- const packageVersion = "14.9.1";
17
+ const packageVersion = "14.9.2";
18
18
  function toggleSortOrder(currentSortOrder) {
19
19
  switch (currentSortOrder) {
20
20
  case DESC:
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.1",
3
+ "version": "14.9.2",
4
4
  "sideEffects": false
5
5
  }
@@ -22,7 +22,7 @@ import ManagedPagination from './managed-pagination';
22
22
  import RankableTableBody from './rankable/body';
23
23
  import TableHead from './table-head';
24
24
  var packageName = "@atlaskit/dynamic-table";
25
- var packageVersion = "14.9.1";
25
+ var packageVersion = "14.9.2";
26
26
  function toggleSortOrder(currentSortOrder) {
27
27
  switch (currentSortOrder) {
28
28
  case DESC:
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dynamic-table",
3
- "version": "14.9.1",
3
+ "version": "14.9.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,112 @@
1
+ import React from 'react';
2
+ import { WithSortedPageRowsProps } from '../hoc/with-sorted-page-rows';
3
+ import { HeadType } from '../types';
4
+ interface BodyProps extends WithSortedPageRowsProps {
5
+ head?: HeadType;
6
+ highlightedRowIndex?: number | number[];
7
+ isFixedSize: boolean;
8
+ testId?: string;
9
+ }
10
+ declare const _default: {
11
+ new (props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>): {
12
+ state: {
13
+ pageRows: never[];
14
+ };
15
+ componentDidMount(): void;
16
+ componentDidUpdate(_prevProps: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
17
+ pageRows: import("../types").RowType[];
18
+ }): void;
19
+ render(): JSX.Element;
20
+ context: any;
21
+ setState<K extends "pageRows">(state: {
22
+ pageRows: import("../types").RowType[];
23
+ } | ((prevState: Readonly<{
24
+ pageRows: import("../types").RowType[];
25
+ }>, props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
26
+ pageRows: import("../types").RowType[];
27
+ } | Pick<{
28
+ pageRows: import("../types").RowType[];
29
+ }, K> | null) | Pick<{
30
+ pageRows: import("../types").RowType[];
31
+ }, K> | null, callback?: (() => void) | undefined): void;
32
+ forceUpdate(callBack?: (() => void) | undefined): void;
33
+ readonly props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
34
+ children?: React.ReactNode;
35
+ }>;
36
+ refs: {
37
+ [key: string]: React.ReactInstance;
38
+ };
39
+ shouldComponentUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
40
+ pageRows: import("../types").RowType[];
41
+ }>, nextContext: any): boolean;
42
+ componentWillUnmount?(): void;
43
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
44
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
45
+ pageRows: import("../types").RowType[];
46
+ }>): any;
47
+ componentWillMount?(): void;
48
+ UNSAFE_componentWillMount?(): void;
49
+ componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
50
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
51
+ componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
52
+ pageRows: import("../types").RowType[];
53
+ }>, nextContext: any): void;
54
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
55
+ pageRows: import("../types").RowType[];
56
+ }>, nextContext: any): void;
57
+ };
58
+ new (props: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, context?: any): {
59
+ state: {
60
+ pageRows: never[];
61
+ };
62
+ componentDidMount(): void;
63
+ componentDidUpdate(_prevProps: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
64
+ pageRows: import("../types").RowType[];
65
+ }): void;
66
+ render(): JSX.Element;
67
+ context: any;
68
+ setState<K extends "pageRows">(state: {
69
+ pageRows: import("../types").RowType[];
70
+ } | ((prevState: Readonly<{
71
+ pageRows: import("../types").RowType[];
72
+ }>, props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
73
+ pageRows: import("../types").RowType[];
74
+ } | Pick<{
75
+ pageRows: import("../types").RowType[];
76
+ }, K> | null) | Pick<{
77
+ pageRows: import("../types").RowType[];
78
+ }, K> | null, callback?: (() => void) | undefined): void;
79
+ forceUpdate(callBack?: (() => void) | undefined): void;
80
+ readonly props: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
81
+ children?: React.ReactNode;
82
+ }>;
83
+ refs: {
84
+ [key: string]: React.ReactInstance;
85
+ };
86
+ shouldComponentUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
87
+ pageRows: import("../types").RowType[];
88
+ }>, nextContext: any): boolean;
89
+ componentWillUnmount?(): void;
90
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
91
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
92
+ pageRows: import("../types").RowType[];
93
+ }>): any;
94
+ componentWillMount?(): void;
95
+ UNSAFE_componentWillMount?(): void;
96
+ componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
97
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
98
+ componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
99
+ pageRows: import("../types").RowType[];
100
+ }>, nextContext: any): void;
101
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
102
+ pageRows: import("../types").RowType[];
103
+ }>, nextContext: any): void;
104
+ };
105
+ getDerivedStateFromProps(props: Omit<BodyProps & import("../hoc/with-sorted-page-rows").TableProps, "pageRows">, state: {
106
+ pageRows: import("../types").RowType[];
107
+ }): {
108
+ pageRows: import("../types").RowType[];
109
+ };
110
+ contextType?: React.Context<any> | undefined;
111
+ };
112
+ export default _default;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import type { SpinnerSizeType } from '../types';
3
+ export interface LoadingContainerAdvancedProps {
4
+ children: React.ReactElement<any>;
5
+ isLoading?: boolean;
6
+ spinnerSize?: SpinnerSizeType;
7
+ contentsOpacity: number | string;
8
+ targetRef?: () => HTMLDivElement | undefined;
9
+ testId?: string;
10
+ }
11
+ export default class LoadingContainerAdvanced extends React.Component<LoadingContainerAdvancedProps, {}> {
12
+ children?: HTMLElement;
13
+ spinnerRef?: HTMLDivElement;
14
+ static defaultProps: {
15
+ isLoading: boolean;
16
+ spinnerSize: string;
17
+ contentsOpacity: "var(--ds-opacity-loading)";
18
+ };
19
+ componentDidMount: () => void;
20
+ UNSAFE_componentWillReceiveProps: (nextProps: LoadingContainerAdvancedProps) => void;
21
+ componentDidUpdate: () => void;
22
+ componentWillUnmount: () => void;
23
+ getTargetNode: (nextProps?: LoadingContainerAdvancedProps) => Element | Text | null;
24
+ getThisNode: () => Element | Text | null;
25
+ getSpinnerNode: () => Element | Text | null;
26
+ hasTargetNode: (nextProps?: LoadingContainerAdvancedProps) => boolean;
27
+ isVerticallyVisible: (elementRect: {
28
+ top: number;
29
+ bottom: number;
30
+ }, viewportHeight: number) => boolean;
31
+ isFullyVerticallyVisible: (elementRect: {
32
+ top: number;
33
+ bottom: number;
34
+ }, viewportHeight: number) => boolean;
35
+ attachListeners(): void;
36
+ detachListeners(): void;
37
+ handleResize: () => void;
38
+ handleScroll: () => void;
39
+ translateSpinner: (spinnerNode: HTMLElement, transformY: number, isFixed?: boolean) => void;
40
+ updateTargetAppearance: () => void;
41
+ updateSpinnerPosition(): void;
42
+ render(): JSX.Element;
43
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { SpinnerSizeType } from '../types';
3
+ interface LoadingContainerProps {
4
+ children: React.ReactNode;
5
+ isLoading?: boolean;
6
+ spinnerSize?: SpinnerSizeType;
7
+ contentsOpacity: number;
8
+ testId?: string;
9
+ }
10
+ export default class LoadingContainer extends React.Component<LoadingContainerProps> {
11
+ static defaultProps: {
12
+ isLoading: boolean;
13
+ spinnerSize: string;
14
+ contentsOpacity: number;
15
+ };
16
+ render(): JSX.Element;
17
+ }
18
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import type { I18nShape } from '../types';
4
+ interface ManagedPaginationProps {
5
+ value?: number;
6
+ onChange: (newValue: any, analyticsEvent?: UIAnalyticsEvent) => void;
7
+ total: number;
8
+ i18n?: I18nShape;
9
+ testId?: string;
10
+ }
11
+ export default class ManagedPagination extends React.Component<ManagedPaginationProps> {
12
+ onChange: (_event: any, newValue: any, analyticsEvent?: UIAnalyticsEvent) => void;
13
+ render(): JSX.Element;
14
+ }
15
+ export {};
@@ -0,0 +1,122 @@
1
+ import React from 'react';
2
+ import { DragStart, DropResult } from 'react-beautiful-dnd';
3
+ import { WithSortedPageRowsProps } from '../../hoc/with-sorted-page-rows';
4
+ import { HeadType, RankEnd, RankStart, RowType } from '../../types';
5
+ export interface RankableBodyProps extends WithSortedPageRowsProps {
6
+ highlightedRowIndex?: number | number[];
7
+ onRankStart: (rankStart: RankStart) => void;
8
+ onRankEnd: (rankEnd: RankEnd) => void;
9
+ isFixedSize: boolean;
10
+ isRanking: boolean;
11
+ isRankingDisabled: boolean;
12
+ head?: HeadType;
13
+ testId?: string;
14
+ }
15
+ export declare class RankableBody extends React.Component<RankableBodyProps, {}> {
16
+ onBeforeDragStart: (dragStart: DragStart) => void;
17
+ onDragEnd: (result: DropResult) => void;
18
+ render(): JSX.Element;
19
+ }
20
+ declare const _default: {
21
+ new (props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>): {
22
+ state: {
23
+ pageRows: never[];
24
+ };
25
+ componentDidMount(): void;
26
+ componentDidUpdate(_prevProps: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
27
+ pageRows: RowType[];
28
+ }): void;
29
+ render(): JSX.Element;
30
+ context: any;
31
+ setState<K extends "pageRows">(state: {
32
+ pageRows: RowType[];
33
+ } | ((prevState: Readonly<{
34
+ pageRows: RowType[];
35
+ }>, props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
36
+ pageRows: RowType[];
37
+ } | Pick<{
38
+ pageRows: RowType[];
39
+ }, K> | null) | Pick<{
40
+ pageRows: RowType[];
41
+ }, K> | null, callback?: (() => void) | undefined): void;
42
+ forceUpdate(callBack?: (() => void) | undefined): void;
43
+ readonly props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
44
+ children?: React.ReactNode;
45
+ }>;
46
+ refs: {
47
+ [key: string]: React.ReactInstance;
48
+ };
49
+ shouldComponentUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
50
+ pageRows: RowType[];
51
+ }>, nextContext: any): boolean;
52
+ componentWillUnmount?(): void;
53
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
54
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
55
+ pageRows: RowType[];
56
+ }>): any;
57
+ componentWillMount?(): void;
58
+ UNSAFE_componentWillMount?(): void;
59
+ componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
60
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
61
+ componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
62
+ pageRows: RowType[];
63
+ }>, nextContext: any): void;
64
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
65
+ pageRows: RowType[];
66
+ }>, nextContext: any): void;
67
+ };
68
+ new (props: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, context?: any): {
69
+ state: {
70
+ pageRows: never[];
71
+ };
72
+ componentDidMount(): void;
73
+ componentDidUpdate(_prevProps: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, prevState: {
74
+ pageRows: RowType[];
75
+ }): void;
76
+ render(): JSX.Element;
77
+ context: any;
78
+ setState<K extends "pageRows">(state: {
79
+ pageRows: RowType[];
80
+ } | ((prevState: Readonly<{
81
+ pageRows: RowType[];
82
+ }>, props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>) => {
83
+ pageRows: RowType[];
84
+ } | Pick<{
85
+ pageRows: RowType[];
86
+ }, K> | null) | Pick<{
87
+ pageRows: RowType[];
88
+ }, K> | null, callback?: (() => void) | undefined): void;
89
+ forceUpdate(callBack?: (() => void) | undefined): void;
90
+ readonly props: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">> & Readonly<{
91
+ children?: React.ReactNode;
92
+ }>;
93
+ refs: {
94
+ [key: string]: React.ReactInstance;
95
+ };
96
+ shouldComponentUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
97
+ pageRows: RowType[];
98
+ }>, nextContext: any): boolean;
99
+ componentWillUnmount?(): void;
100
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
101
+ getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, prevState: Readonly<{
102
+ pageRows: RowType[];
103
+ }>): any;
104
+ componentWillMount?(): void;
105
+ UNSAFE_componentWillMount?(): void;
106
+ componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
107
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextContext: any): void;
108
+ componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
109
+ pageRows: RowType[];
110
+ }>, nextContext: any): void;
111
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">>, nextState: Readonly<{
112
+ pageRows: RowType[];
113
+ }>, nextContext: any): void;
114
+ };
115
+ getDerivedStateFromProps(props: Omit<RankableBodyProps & import("../../hoc/with-sorted-page-rows").TableProps, "pageRows">, state: {
116
+ pageRows: RowType[];
117
+ }): {
118
+ pageRows: RowType[];
119
+ };
120
+ contextType?: React.Context<any> | undefined;
121
+ };
122
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { WithDimensionsProps } from '../../hoc/with-dimensions';
3
+ import { HeadCellType, RowCellType } from '../../types';
4
+ export interface RankableTableCellProps extends WithDimensionsProps {
5
+ head?: HeadCellType;
6
+ cell: RowCellType;
7
+ isFixedSize: boolean;
8
+ testId?: string;
9
+ }
10
+ export declare class RankableTableCell extends React.Component<RankableTableCellProps, {}> {
11
+ render(): JSX.Element;
12
+ }
13
+ declare const _default: React.ComponentClass<Omit<RankableTableCellProps, "innerRef" | "refWidth" | "refHeight">, import("../../hoc/with-dimensions").State>;
14
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { WithDimensionsProps } from '../../hoc/with-dimensions';
3
+ import { TableHeadCellProps } from '../table-head-cell';
4
+ declare const _default: React.ComponentClass<Omit<WithDimensionsProps & TableHeadCellProps, "innerRef" | "refWidth" | "refHeight">, import("../../hoc/with-dimensions").State>;
5
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { WithDimensionsProps } from '../../hoc/with-dimensions';
3
+ import { HeadType, RowType } from '../../types';
4
+ export interface RankableTableRowProps extends WithDimensionsProps {
5
+ head?: HeadType;
6
+ isFixedSize: boolean;
7
+ row: RowType;
8
+ rowIndex: number;
9
+ isRankingDisabled: boolean;
10
+ isHighlighted?: boolean;
11
+ testId?: string;
12
+ }
13
+ export declare class RankableTableRow extends React.Component<RankableTableRowProps> {
14
+ innerRef: (innerRefFn: Function) => (ref: HTMLTableRowElement) => void;
15
+ render(): JSX.Element;
16
+ }
17
+ declare const _default: React.ComponentClass<Omit<RankableTableRowProps, "innerRef" | "refWidth" | "refHeight">, import("../../hoc/with-dimensions").State>;
18
+ export default _default;
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import noop from '@atlaskit/ds-lib/noop';
4
+ import { RankEnd, RowType, SortOrderType, StatefulProps } from '../types';
5
+ interface State {
6
+ page?: number;
7
+ sortKey?: string;
8
+ sortOrder?: SortOrderType;
9
+ rows?: RowType[];
10
+ }
11
+ /**
12
+ * __Dynamic Table__
13
+ *
14
+ * A table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
15
+ *
16
+ * - [Examples](https://atlaskit.atlassian.com/packages/design-system/dynamic-table)
17
+ * - [Code](https://bitbucket.org/atlassian/atlassian-frontend/packages/design-system/dynamic-table)
18
+ *
19
+ * @example
20
+ * ```jsx
21
+ * import DynamicTable from '@atlaskit/dynamic-table';
22
+ *
23
+ * export default function TableUncontrolled() {
24
+ * return (
25
+ * <DynamicTable
26
+ * head={head}
27
+ * rows={rows}
28
+ * rowsPerPage={10}
29
+ * defaultPage={1}
30
+ * loadingSpinnerSize="large"
31
+ * isLoading={false}
32
+ * />
33
+ * );
34
+ * }
35
+ * ```
36
+ */
37
+ export default class DynamicTable extends React.Component<StatefulProps, State> {
38
+ static defaultProps: {
39
+ defaultPage: number;
40
+ isLoading: boolean;
41
+ isFixedSize: boolean;
42
+ isRankable: boolean;
43
+ onSetPage: typeof noop;
44
+ onSort: typeof noop;
45
+ rowsPerPage: number;
46
+ };
47
+ state: {
48
+ page: number | undefined;
49
+ sortKey: string | undefined;
50
+ sortOrder: SortOrderType | undefined;
51
+ rows: RowType[] | undefined;
52
+ };
53
+ UNSAFE_componentWillReceiveProps(newProps: StatefulProps): void;
54
+ onSetPageHandler: (page: number, analyticsEvent?: UIAnalyticsEvent) => void;
55
+ onSortHandler: ({ key, item, sortOrder }: any, analyticsEvent?: UIAnalyticsEvent) => void;
56
+ onRankEndIfExistsHandler: (params: RankEnd) => void;
57
+ onRankEndHandler: (params: RankEnd) => void;
58
+ render(): JSX.Element;
59
+ }
60
+ export {};
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ import noop from '@atlaskit/ds-lib/noop';
4
+ import { StatelessProps as Props, RankEnd, RankStart, RowCellType } from '../types';
5
+ export interface State {
6
+ isRanking: boolean;
7
+ }
8
+ declare class DynamicTable extends React.Component<Props, State> {
9
+ tableBody?: HTMLDivElement;
10
+ state: {
11
+ isRanking: boolean;
12
+ };
13
+ static defaultProps: {
14
+ isLoading: boolean;
15
+ isFixedSize: boolean;
16
+ rowsPerPage: number;
17
+ onSetPage: typeof noop;
18
+ onSort: typeof noop;
19
+ page: number;
20
+ isRankable: boolean;
21
+ isRankingDisabled: boolean;
22
+ onRankStart: typeof noop;
23
+ onRankEnd: typeof noop;
24
+ paginationi18n: {
25
+ prev: string;
26
+ next: string;
27
+ label: string;
28
+ };
29
+ };
30
+ UNSAFE_componentWillMount(): void;
31
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
32
+ onSortHandler: (item: RowCellType) => () => void;
33
+ onSetPageHandler: (page: number, event?: UIAnalyticsEvent) => void;
34
+ onRankStartHandler: (params: RankStart) => void;
35
+ onRankEndHandler: (params: RankEnd) => void;
36
+ getSpinnerSize: () => import("../types").LoadingSpinnerSizeType;
37
+ renderEmptyBody: () => JSX.Element | undefined;
38
+ render(): JSX.Element;
39
+ }
40
+ export { DynamicTable as DynamicTableWithoutAnalytics };
41
+ declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "totalRows" | "onPageRowsUpdate" | "sortKey" | "sortOrder" | "highlightedRowIndex" | "testId" | "label"> & Partial<Pick<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isLoading" | "isFixedSize" | "rowsPerPage" | "onSetPage" | "onSort" | "page" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n">> & Partial<Pick<{
42
+ isLoading: boolean;
43
+ isFixedSize: boolean;
44
+ rowsPerPage: number;
45
+ onSetPage: typeof noop;
46
+ onSort: typeof noop;
47
+ page: number;
48
+ isRankable: boolean;
49
+ isRankingDisabled: boolean;
50
+ onRankStart: typeof noop;
51
+ onRankEnd: typeof noop;
52
+ paginationi18n: {
53
+ prev: string;
54
+ next: string;
55
+ label: string;
56
+ };
57
+ }, never>> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "head" | "caption" | "rows" | "emptyView" | "loadingSpinnerSize" | "isLoading" | "isFixedSize" | "rowsPerPage" | "totalRows" | "onSetPage" | "onSort" | "onPageRowsUpdate" | "page" | "sortKey" | "sortOrder" | "isRankable" | "isRankingDisabled" | "onRankStart" | "onRankEnd" | "paginationi18n" | "highlightedRowIndex" | "testId" | "label" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
58
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import React, { FC, LegacyRef } from 'react';
2
+ import { SortOrderType } from '../types';
3
+ export interface TableHeadCellProps {
4
+ colSpan?: number;
5
+ sortKey?: string;
6
+ isSortable?: boolean;
7
+ sortOrder?: SortOrderType;
8
+ isFixedSize?: boolean;
9
+ innerRef?: LegacyRef<HTMLTableCellElement>;
10
+ inlineStyles?: {};
11
+ content?: React.ReactNode;
12
+ onClick?: () => void;
13
+ shouldTruncate?: boolean;
14
+ testId?: string;
15
+ width?: number;
16
+ isRanking?: boolean;
17
+ }
18
+ declare const TableHeadCell: FC<TableHeadCellProps>;
19
+ export default TableHeadCell;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { HeadType, RowCellType, SortOrderType } from '../types';
3
+ interface TableHeadProps {
4
+ head: HeadType;
5
+ sortKey?: string;
6
+ sortOrder?: SortOrderType;
7
+ isFixedSize?: boolean;
8
+ onSort: (item: RowCellType) => () => void;
9
+ isRankable?: boolean;
10
+ isRanking: boolean;
11
+ testId?: string;
12
+ }
13
+ declare class TableHead extends React.Component<TableHeadProps, {}> {
14
+ UNSAFE_componentWillMount(): void;
15
+ UNSAFE_componentWillReceiveProps(nextProps: TableHeadProps): void;
16
+ render(): JSX.Element | null;
17
+ }
18
+ export default TableHead;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { HeadType, RowType } from '../types';
3
+ interface RowProps {
4
+ head?: HeadType;
5
+ isFixedSize: boolean;
6
+ isHighlighted?: boolean;
7
+ row: RowType;
8
+ testId?: string;
9
+ }
10
+ declare const Row: ({ row, head, testId, isFixedSize, isHighlighted }: RowProps) => JSX.Element;
11
+ export default Row;
@@ -0,0 +1,12 @@
1
+ import React, { LegacyRef } from 'react';
2
+ export interface State {
3
+ refWidth: number;
4
+ refHeight: number;
5
+ }
6
+ export interface WithDimensionsProps {
7
+ innerRef?: LegacyRef<HTMLTableCellElement | HTMLTableRowElement>;
8
+ isRanking: boolean;
9
+ refWidth: number;
10
+ refHeight: number;
11
+ }
12
+ export default function withDimensions<WrappedComponentProps extends WithDimensionsProps>(WrappedComponent: React.ComponentType<WrappedComponentProps>): React.ComponentClass<Omit<WrappedComponentProps, 'refWidth' | 'refHeight' | 'innerRef'>, State>;