@atlaskit/media-table 13.0.1 → 13.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/media-table
2
2
 
3
+ ## 13.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+ - Updated dependencies
9
+
3
10
  ## 13.0.1
4
11
 
5
12
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.1",
3
+ "version": "13.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.1",
3
+ "version": "13.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.1",
3
+ "version": "13.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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,27 @@
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 onSort;
16
+ private renderRowValues;
17
+ private renderTable;
18
+ private openPreview;
19
+ private onRowEnterKeyPressed;
20
+ private onRowClick;
21
+ private safeSetState;
22
+ private onMediaViewerClose;
23
+ private renderMediaViewer;
24
+ render(): jsx.JSX.Element;
25
+ }
26
+ 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>>>;
27
+ 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,3 @@
1
+ export declare const nameCellWrapperStyles: import("@emotion/react").SerializedStyles;
2
+ export declare const truncateWrapperStyles: import("@emotion/react").SerializedStyles;
3
+ export declare const mediaTableWrapperStyles: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,4 @@
1
+ export { default as MediaTable } from './component/mediaTable';
2
+ export type { MediaTableProps, MediaTableItem, SortOrderType } from './types';
3
+ export { NameCell } from './component/nameCell';
4
+ export type { NameCellProps } from './component/nameCell';
@@ -0,0 +1,69 @@
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
+ }
61
+ export interface MediaTableState {
62
+ mediaViewerSelectedItem?: Identifier;
63
+ fileInfoState: Map<string, FileInfo>;
64
+ }
65
+ export interface ValidatedProps {
66
+ validPageNumber: number;
67
+ validTotalItems: number;
68
+ validItemsPerPage: number;
69
+ }
@@ -0,0 +1,2 @@
1
+ export declare const CELL_KEY_DOWNLOAD = "download";
2
+ export declare const ANALYTICS_MEDIA_CHANNEL = "media";
@@ -0,0 +1,3 @@
1
+ import { HeadType } from '@atlaskit/dynamic-table/types';
2
+ declare const _default: import("memoize-one").MemoizedFn<import("memoize-one").MemoizedFn<(columns: HeadType) => HeadType>>;
3
+ export default _default;
@@ -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 | undefined, pageNumber?: number | undefined) => RowType[]>;
4
+ export declare const appendRows: import("memoize-one").MemoizedFn<(emptyCells: RowCellType[], rowsLength: number, itemsPerPage?: number | undefined, pageNumber?: number | undefined, totalItems?: number | undefined) => 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,3 @@
1
+ import { ValidatedProps } from '../types';
2
+ declare const _default: import("memoize-one").MemoizedFn<(itemsCount: number, itemsPerPage?: number | undefined, pageNumber?: number | undefined, totalItems?: number | undefined) => ValidatedProps>;
3
+ export default _default;
@@ -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, ANALYTICS_MEDIA_CHANNEL } from './constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-table",
3
- "version": "13.0.1",
3
+ "version": "13.0.2",
4
4
  "description": "Table UI component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.ts",
17
24
  "af:exports": {
@@ -28,18 +35,18 @@
28
35
  "dependencies": {
29
36
  "@atlaskit/analytics-next": "^8.0.0",
30
37
  "@atlaskit/button": "^16.3.0",
31
- "@atlaskit/dynamic-table": "^14.7.0",
38
+ "@atlaskit/dynamic-table": "^14.8.0",
32
39
  "@atlaskit/icon": "^21.10.0",
33
40
  "@atlaskit/media-client": "^17.1.0",
34
41
  "@atlaskit/media-ui": "^22.1.0",
35
- "@atlaskit/media-viewer": "^47.0.0",
36
- "@atlaskit/theme": "^12.1.0",
42
+ "@atlaskit/media-viewer": "^47.1.0",
43
+ "@atlaskit/theme": "^12.2.0",
37
44
  "@atlaskit/tooltip": "^17.5.0",
38
45
  "@babel/runtime": "^7.0.0",
39
46
  "memoize-one": "^6.0.0"
40
47
  },
41
48
  "peerDependencies": {
42
- "@atlaskit/media-core": "^33.0.2",
49
+ "@atlaskit/media-core": "^33.0.3",
43
50
  "@emotion/react": "^11.7.1",
44
51
  "react": "^16.8.0",
45
52
  "react-dom": "^16.8.0",
@@ -59,7 +66,7 @@
59
66
  "enzyme": "^3.10.0",
60
67
  "react": "^16.8.0",
61
68
  "react-dom": "^16.8.0",
62
- "typescript": "4.3.5"
69
+ "typescript": "4.5.5"
63
70
  },
64
71
  "resolutions": {
65
72
  "lru-fast": "0.2.2"