@jiaozhiye/qm-design-react 2.0.3 → 2.0.4

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,12 +1,20 @@
1
1
  import React, { Component } from 'react';
2
2
  import type { UploadProps, ButtonProps } from '../../antd';
3
- type IProps = UploadProps & {
3
+ export interface UploadFile {
4
+ uid: string;
5
+ name: string;
6
+ fileName?: string;
7
+ url?: string;
8
+ thumbUrl?: string;
9
+ status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
10
+ }
11
+ type IProps = Omit<UploadProps, 'onPreview'> & {
4
12
  fileTypes?: string[];
5
13
  fileSize?: number;
6
- allowDownloadOnDisable?: boolean;
7
14
  button?: {
8
15
  text?: string;
9
16
  } & ButtonProps;
17
+ onPreview?: (file: UploadFile, cb: (file?: UploadFile) => void) => void;
10
18
  };
11
19
  export type UploadFileProps = IProps;
12
20
  declare class QmUploadFile extends Component<IProps> {
@@ -14,12 +22,14 @@ declare class QmUploadFile extends Component<IProps> {
14
22
  name: string;
15
23
  multiple: boolean;
16
24
  showUploadList: {
25
+ showPreviewIcon: boolean;
17
26
  showDownloadIcon: boolean;
18
- downloadIcon: React.JSX.Element;
27
+ showRemoveIcon: boolean;
19
28
  };
20
29
  };
21
30
  beforeUpload: (file: any, fileList: any) => Promise<any>;
22
31
  downloadFile(url: string, fileName?: string): Promise<void>;
32
+ doDownload: (file: any) => Promise<void>;
23
33
  render(): React.JSX.Element;
24
34
  }
25
35
  export default QmUploadFile;
@@ -1,12 +1,20 @@
1
1
  import React, { Component } from 'react';
2
2
  import type { UploadProps } from '../../antd';
3
+ export interface UploadFile {
4
+ uid: string;
5
+ name: string;
6
+ fileName?: string;
7
+ url?: string;
8
+ thumbUrl?: string;
9
+ status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
10
+ }
3
11
  type IProps = UploadProps & {
4
12
  fixedSize?: [number, number] | undefined;
5
13
  quality?: number;
6
14
  fileTypes?: string[];
7
15
  fileSize?: number;
8
16
  openCropper?: boolean;
9
- beforeCrop?: (file: any, fileList: any[]) => Promise<boolean>;
17
+ beforeCrop?: (file: UploadFile, fileList: UploadFile[]) => Promise<boolean>;
10
18
  };
11
19
  type IState = {
12
20
  previewVisible: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiaozhiye/qm-design-react",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A Component Library for React",
5
5
  "keywords": [
6
6
  "React",