@jiaozhiye/qm-design-react 1.10.0 → 1.10.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/lib/form/src/form.d.ts +5 -5
- package/lib/form/src/types.d.ts +5 -1
- package/lib/form/src/utils.d.ts +2 -2
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/style/index.css +29 -0
- package/lib/style/index.min.css +1 -1
- package/lib/table/src/table/props.d.ts +1 -1
- package/lib/table/src/table/types.d.ts +1 -1
- package/lib/table/style/table.less +373 -360
- package/lib/upload-file/src/upload-file.d.ts +20 -2
- package/lib/upload-file/style/index.less +11 -0
- package/lib/upload-img/src/upload-img.d.ts +8 -9
- package/lib/upload-img/style/index.less +3 -0
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import ConfigContext from '../../config-provider/context';
|
|
3
|
+
import type { AjaxResponse } from '../../_utils/types';
|
|
3
4
|
import type { HttpRequestHeader } from '../../download/src/download';
|
|
4
5
|
import type { UploadProps, ButtonProps } from '../../antd';
|
|
5
6
|
export interface UploadFile {
|
|
@@ -8,22 +9,30 @@ export interface UploadFile {
|
|
|
8
9
|
fileName?: string;
|
|
9
10
|
url?: string;
|
|
10
11
|
thumbUrl?: string;
|
|
12
|
+
response?: AjaxResponse;
|
|
11
13
|
status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
|
|
12
14
|
}
|
|
13
15
|
type IProps = Omit<UploadProps, 'onPreview'> & {
|
|
14
16
|
fileTypes?: string[];
|
|
15
17
|
fileSize?: number;
|
|
16
18
|
readOnly?: boolean;
|
|
19
|
+
draggable?: boolean;
|
|
20
|
+
editable?: boolean;
|
|
17
21
|
fileDirection?: 'horizontal' | 'vertical';
|
|
18
22
|
downloadWithHeaders?: boolean | HttpRequestHeader;
|
|
19
23
|
button?: {
|
|
20
24
|
text?: string;
|
|
21
25
|
} & ButtonProps;
|
|
22
26
|
onPreview?: (file: UploadFile, cb: (file?: UploadFile) => void) => void;
|
|
27
|
+
onSortChange?: (fileList: UploadFile[]) => void;
|
|
28
|
+
onEditChange?: (file: UploadFile, fileList: UploadFile[]) => void;
|
|
23
29
|
};
|
|
24
30
|
export type UploadFileProps = IProps;
|
|
31
|
+
type IState = {
|
|
32
|
+
actived: Record<string, boolean>;
|
|
33
|
+
};
|
|
25
34
|
export declare const downloadFile: (url: string, { fileName, headers, params }: any) => Promise<void>;
|
|
26
|
-
declare class QmUploadFile extends Component<IProps> {
|
|
35
|
+
declare class QmUploadFile extends Component<IProps, IState> {
|
|
27
36
|
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
28
37
|
context: React.ContextType<typeof ConfigContext>;
|
|
29
38
|
static defaultProps: {
|
|
@@ -36,9 +45,18 @@ declare class QmUploadFile extends Component<IProps> {
|
|
|
36
45
|
showRemoveIcon: boolean;
|
|
37
46
|
};
|
|
38
47
|
};
|
|
48
|
+
state: IState;
|
|
49
|
+
uploadRef: React.RefObject<HTMLSpanElement>;
|
|
50
|
+
private sortableInstance;
|
|
39
51
|
get $size(): import("../../_utils/types").ComponentSize;
|
|
52
|
+
componentDidMount(): void;
|
|
53
|
+
componentWillUnmount(): void;
|
|
54
|
+
setActiveState: (uid: string, value?: boolean) => void;
|
|
55
|
+
createSortable: () => void;
|
|
56
|
+
getFileListNode: () => Element | null;
|
|
40
57
|
beforeUpload: (file: any, fileList: any) => Promise<any>;
|
|
41
|
-
doDownload: (file:
|
|
58
|
+
doDownload: (file: UploadFile) => Promise<void>;
|
|
59
|
+
itemRender: (file: UploadFile, actions: any) => React.JSX.Element;
|
|
42
60
|
render(): React.JSX.Element;
|
|
43
61
|
}
|
|
44
62
|
export default QmUploadFile;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import ConfigContext from '../../config-provider/context';
|
|
3
|
+
import type { UploadFile } from '../../upload-file/src/upload-file';
|
|
3
4
|
import type { UploadProps } from '../../antd';
|
|
4
|
-
export interface UploadFile {
|
|
5
|
-
uid: string;
|
|
6
|
-
name: string;
|
|
7
|
-
fileName?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
thumbUrl?: string;
|
|
10
|
-
status?: 'error' | 'success' | 'done' | 'uploading' | 'removed';
|
|
11
|
-
}
|
|
12
5
|
type IProps = UploadProps & {
|
|
13
6
|
fixedSize?: [number, number] | undefined;
|
|
14
7
|
quality?: number;
|
|
15
8
|
fileTypes?: string[];
|
|
16
9
|
fileSize?: number;
|
|
10
|
+
draggable?: boolean;
|
|
17
11
|
openCropper?: boolean;
|
|
18
12
|
popupClassName?: string;
|
|
19
13
|
readOnly?: boolean;
|
|
20
14
|
beforeCrop?: (file: UploadFile, fileList: UploadFile[]) => Promise<boolean>;
|
|
15
|
+
onSortChange?: (fileList: UploadFile[]) => void;
|
|
21
16
|
};
|
|
22
17
|
type IState = {
|
|
23
18
|
previewVisible: boolean;
|
|
@@ -36,14 +31,18 @@ declare class QmUploadImg extends Component<IProps, IState> {
|
|
|
36
31
|
openCropper: boolean;
|
|
37
32
|
};
|
|
38
33
|
state: IState;
|
|
34
|
+
uploadRef: React.RefObject<HTMLSpanElement>;
|
|
35
|
+
private sortableInstance;
|
|
39
36
|
private isFocused;
|
|
40
37
|
get $size(): import("../../_utils/types").ComponentSize;
|
|
41
38
|
get showUploadButton(): boolean;
|
|
42
39
|
componentDidMount(): void;
|
|
43
40
|
componentDidUpdate(prevProps: IProps): void;
|
|
44
41
|
componentWillUnmount(): void;
|
|
42
|
+
createSortable: () => void;
|
|
43
|
+
getFileListNode: () => Element | null;
|
|
45
44
|
beforeUpload: (file: any, fileList: any) => Promise<any>;
|
|
46
|
-
handlePreview: (file:
|
|
45
|
+
handlePreview: (file: UploadFile) => void;
|
|
47
46
|
handlePaste: (ev: any) => Promise<void>;
|
|
48
47
|
render(): React.JSX.Element;
|
|
49
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiaozhiye/qm-design-react",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "A Component Library for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"React",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"react-sortablejs": "^6.1.4",
|
|
72
72
|
"resize-observer-polyfill": "^1.5.1",
|
|
73
73
|
"scroll-into-view-if-needed": "^2.2.31",
|
|
74
|
-
"sortablejs": "^1.15.
|
|
74
|
+
"sortablejs": "^1.15.2"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@babel/cli": "^7.18.6",
|