@atlaskit/media-table 15.0.1 → 15.0.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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/component/downloadButton.d.ts +9 -0
- package/dist/types-ts4.5/component/mediaTable.d.ts +28 -0
- package/dist/types-ts4.5/component/nameCell.d.ts +7 -0
- package/dist/types-ts4.5/component/previewButton.d.ts +9 -0
- package/dist/types-ts4.5/component/styles.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +4 -0
- package/dist/types-ts4.5/types.d.ts +73 -0
- package/dist/types-ts4.5/util/constants.d.ts +3 -0
- package/dist/types-ts4.5/util/generateHeadValues.d.ts +3 -0
- package/dist/types-ts4.5/util/generateRowValues.d.ts +11 -0
- package/dist/types-ts4.5/util/getValidTableProps.d.ts +3 -0
- package/dist/types-ts4.5/util/index.d.ts +4 -0
- package/package.json +3 -3
- package/report.api.md +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
interface Props {
|
|
4
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**@jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
|
+
import { MediaTableProps, MediaTableState } from '../types';
|
|
6
|
+
export declare class MediaTable extends Component<MediaTableProps & WrappedComponentProps, MediaTableState> {
|
|
7
|
+
state: MediaTableState;
|
|
8
|
+
private subscriptions;
|
|
9
|
+
private hasBeenMounted;
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
private unsubscribe;
|
|
12
|
+
componentWillUnmount(): void;
|
|
13
|
+
private generateCellValues;
|
|
14
|
+
private onDownloadClick;
|
|
15
|
+
private onPreviewClick;
|
|
16
|
+
private onSort;
|
|
17
|
+
private renderRowValues;
|
|
18
|
+
private renderTable;
|
|
19
|
+
private openPreview;
|
|
20
|
+
private onRowEnterKeyPressed;
|
|
21
|
+
private onRowClick;
|
|
22
|
+
private safeSetState;
|
|
23
|
+
private onMediaViewerClose;
|
|
24
|
+
private renderMediaViewer;
|
|
25
|
+
render(): jsx.JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: React.ComponentType<import("@atlaskit/media-client").WithMediaClientConfigProps<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<MediaTableProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MediaType } from '@atlaskit/media-client';
|
|
3
|
+
import { TruncateProps } from '@atlaskit/media-ui/truncateText';
|
|
4
|
+
export interface NameCellProps extends TruncateProps {
|
|
5
|
+
mediaType?: MediaType;
|
|
6
|
+
}
|
|
7
|
+
export declare const NameCell: FC<NameCellProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
interface Props {
|
|
4
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Identifier, FileIdentifier, MediaClient } from '@atlaskit/media-client';
|
|
3
|
+
import { HeadType } from '@atlaskit/dynamic-table/types';
|
|
4
|
+
import { SortOrderType } from '@atlaskit/dynamic-table/types';
|
|
5
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
|
+
export type { SortOrderType };
|
|
7
|
+
export interface FileInfo {
|
|
8
|
+
fileName: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RowData {
|
|
12
|
+
[key: string]: string | React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface RowProps {
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface MediaTableItem {
|
|
18
|
+
data: RowData;
|
|
19
|
+
identifier: FileIdentifier;
|
|
20
|
+
/** An object containing props that will be applied to the row component */
|
|
21
|
+
rowProps?: RowProps;
|
|
22
|
+
}
|
|
23
|
+
export interface OnSortData {
|
|
24
|
+
key: string;
|
|
25
|
+
sortOrder: SortOrderType;
|
|
26
|
+
item: {
|
|
27
|
+
content: React.ReactNode | string;
|
|
28
|
+
isSortable: boolean;
|
|
29
|
+
key: string;
|
|
30
|
+
width: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface MediaTableProps {
|
|
34
|
+
/** The table rows to display in the current page */
|
|
35
|
+
items: MediaTableItem[];
|
|
36
|
+
mediaClient: MediaClient;
|
|
37
|
+
/** Object describing the column headings */
|
|
38
|
+
columns: HeadType;
|
|
39
|
+
/** The total number of table rows. This is used to calculate pagination */
|
|
40
|
+
totalItems: number;
|
|
41
|
+
/** The maximum number of rows per page. No maximum by default */
|
|
42
|
+
itemsPerPage?: number;
|
|
43
|
+
/** The current page number */
|
|
44
|
+
pageNumber?: number;
|
|
45
|
+
/** The property that the table items are sorted by. This must match a key in columns.cells */
|
|
46
|
+
sortKey?: string;
|
|
47
|
+
/** The direction that the table items are sorted in - ascending or descending */
|
|
48
|
+
sortOrder?: SortOrderType;
|
|
49
|
+
/** Whether to show the loading state or not */
|
|
50
|
+
isLoading?: boolean;
|
|
51
|
+
/** Called when a pagination control is clicked. Provides the new page number to paginate by */
|
|
52
|
+
onSetPage?: (pageNumber: number) => void;
|
|
53
|
+
/** Called when a column header is clicked. Provides the key of the column and the new sortOrder to sort by */
|
|
54
|
+
onSort?: (key: string, sortOrder: SortOrderType) => void;
|
|
55
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
56
|
+
/** Called when the preview is opened by the user clicking on an item in the table */
|
|
57
|
+
onPreviewOpen?: () => void;
|
|
58
|
+
/** Called when the preview is closed */
|
|
59
|
+
onPreviewClose?: () => void;
|
|
60
|
+
/** Row index that will be highlighted **/
|
|
61
|
+
highlightedRowIndex?: number[];
|
|
62
|
+
/** callback triggered when row click is passed, if returned true it will prevent default behaviour. **/
|
|
63
|
+
onRowClick?: (rowData: RowData, index: number) => boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface MediaTableState {
|
|
66
|
+
mediaViewerSelectedItem?: Identifier;
|
|
67
|
+
fileInfoState: Map<string, FileInfo>;
|
|
68
|
+
}
|
|
69
|
+
export interface ValidatedProps {
|
|
70
|
+
validPageNumber: number;
|
|
71
|
+
validTotalItems: number;
|
|
72
|
+
validItemsPerPage: number;
|
|
73
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RowType, HeadCellType, RowCellType } from '@atlaskit/dynamic-table/types';
|
|
2
|
+
export declare const generateEmptyRow: import("memoize-one").MemoizedFn<(headerCells: HeadCellType[]) => RowCellType[]>;
|
|
3
|
+
export declare const prependRows: import("memoize-one").MemoizedFn<(emptyCells: RowCellType[], itemsPerPage?: number, pageNumber?: number) => RowType[]>;
|
|
4
|
+
export declare const appendRows: import("memoize-one").MemoizedFn<(emptyCells: RowCellType[], rowsLength: number, itemsPerPage?: number, pageNumber?: number, totalItems?: number) => RowType[]>;
|
|
5
|
+
export default function generateRowValues({ itemsPerPage, pageNumber, totalItems, rowValues, headerCells, }: {
|
|
6
|
+
itemsPerPage?: number;
|
|
7
|
+
pageNumber?: number;
|
|
8
|
+
totalItems?: number;
|
|
9
|
+
rowValues: RowType[];
|
|
10
|
+
headerCells: HeadCellType[];
|
|
11
|
+
}): RowType[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as generateRowValues } from './generateRowValues';
|
|
2
|
+
export { default as getValidTableProps } from './getValidTableProps';
|
|
3
|
+
export { default as generateHeadValues } from './generateHeadValues';
|
|
4
|
+
export { CELL_KEY_DOWNLOAD, CELL_KEY_PREVIEW, ANALYTICS_MEDIA_CHANNEL, } from './constants';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-table",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"description": "Table UI component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@atlaskit/dynamic-table": "^14.9.0",
|
|
40
40
|
"@atlaskit/icon": "^21.12.0",
|
|
41
41
|
"@atlaskit/media-client": "^22.0.0",
|
|
42
|
-
"@atlaskit/media-ui": "^
|
|
43
|
-
"@atlaskit/media-viewer": "^
|
|
42
|
+
"@atlaskit/media-ui": "^23.0.0",
|
|
43
|
+
"@atlaskit/media-viewer": "^48.0.0",
|
|
44
44
|
"@atlaskit/theme": "^12.5.0",
|
|
45
45
|
"@atlaskit/tokens": "^1.4.0",
|
|
46
46
|
"@atlaskit/tooltip": "^17.8.0",
|