@nutui/nutui-react-taro 1.3.3 → 1.3.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.
- package/CHANGELOG.md +21 -0
- package/README.md +3 -2
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Audio.js +6 -7
- package/dist/esm/Avatar.js +2 -2
- package/dist/esm/BackTop.js +2 -2
- package/dist/esm/Badge.js +2 -2
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Button.js +2 -2
- package/dist/esm/Calendar.js +3 -3
- package/dist/esm/Card.js +3 -3
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/Cell.js +2 -2
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/CircleProgress.js +2 -2
- package/dist/esm/CollapseItem.js +2 -2
- package/dist/esm/DatePicker.js +4 -4
- package/dist/esm/Dialog.js +3 -3
- package/dist/esm/FixedNav.js +2 -2
- package/dist/esm/GridItem.js +2 -2
- package/dist/esm/ImagePreview.js +5 -5
- package/dist/esm/Infiniteloading.js +4 -2
- package/dist/esm/Input.js +2 -2
- package/dist/esm/InputNumber.js +2 -2
- package/dist/esm/Menu.js +2 -2
- package/dist/esm/MenuItem.js +2 -2
- package/dist/esm/NavBar.js +2 -2
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/Notify.js +2 -3
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Picker.js +3 -3
- package/dist/esm/Popover.js +2 -2
- package/dist/esm/Popup.js +2 -2
- package/dist/esm/Progress.js +2 -2
- package/dist/esm/PullToRefresh.js +2 -2
- package/dist/esm/Radio.js +2 -2
- package/dist/esm/Range.js +3 -5
- package/dist/esm/Rate.js +2 -2
- package/dist/esm/SearchBar.js +2 -2
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/Signature.js +3 -3
- package/dist/esm/Skeleton.js +3 -3
- package/dist/esm/Step.js +2 -2
- package/dist/esm/Sticky/style/index.js +2 -0
- package/dist/esm/Sticky.js +5 -0
- package/dist/esm/Swiper.js +3 -3
- package/dist/esm/TabbarItem.js +2 -2
- package/dist/esm/Table.js +2 -2
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/Tag.js +2 -2
- package/dist/esm/TimeSelect.js +3 -3
- package/dist/esm/Toast.js +2 -4
- package/dist/esm/Uploader.js +8 -4
- package/dist/esm/{actionsheet.taro-08b7eab2.js → actionsheet.taro-360d8d34.js} +1 -1
- package/dist/esm/{address.taro-5f8dbfc3.js → address.taro-7540c626.js} +8 -6
- package/dist/esm/{audio.taro-327472dc.js → audio.taro-ab2528b2.js} +105 -148
- package/dist/esm/{avatar.taro-766690a4.js → avatar.taro-ec620cdd.js} +5 -3
- package/dist/esm/{backtop.taro-c414da6c.js → backtop.taro-aa8b2bc5.js} +5 -3
- package/dist/esm/{badge.taro-351d0088.js → badge.taro-38684262.js} +5 -3
- package/dist/esm/{barrage.taro-efac8422.js → barrage.taro-d86c367a.js} +3 -10
- package/dist/esm/{button.taro-7074924f.js → button.taro-a9ebb937.js} +7 -5
- package/dist/esm/{calendar.taro-156a74c0.js → calendar.taro-438940bd.js} +1 -1
- package/dist/esm/{card.taro-f81f1b5c.js → card.taro-1bc35ebe.js} +1 -1
- package/dist/esm/{cascader.taro-39402f43.js → cascader.taro-35387092.js} +2 -2
- package/dist/esm/{cell.taro-075998e0.js → cell.taro-a4c3bb7b.js} +7 -5
- package/dist/esm/{checkbox.taro-62677b5e.js → checkbox.taro-104557c1.js} +2 -2
- package/dist/esm/{circleprogress.taro-1a38e1c6.js → circleprogress.taro-3c89a157.js} +85 -51
- package/dist/esm/{collapseitem-246e1699.js → collapseitem-75843a5e.js} +13 -9
- package/dist/esm/{datepicker.taro-e0e58f39.js → datepicker.taro-1acec61f.js} +1 -1
- package/dist/esm/{dialog.taro-7e9249e7.js → dialog.taro-54c67e08.js} +8 -6
- package/dist/esm/{fixednav.taro-9ee2dbea.js → fixednav.taro-582322a1.js} +5 -3
- package/dist/esm/{griditem.taro-a2ad1edd.js → griditem.taro-866cd288.js} +5 -3
- package/dist/esm/{imagepreview.taro-99659d6a.js → imagepreview.taro-3f1c7638.js} +2 -2
- package/dist/esm/{infiniteloading.taro-aa47eb1e.js → infiniteloading.taro-9701755f.js} +84 -113
- package/dist/esm/{input.taro-32fac7f7.js → input.taro-2453d7c4.js} +9 -7
- package/dist/esm/{inputnumber.taro-83d108b3.js → inputnumber.taro-0cf7c1b7.js} +7 -5
- package/dist/esm/{menu.taro-8330048e.js → menu.taro-9345dcfd.js} +5 -3
- package/dist/esm/{menuitem.taro-818c9e83.js → menuitem.taro-fc0961b7.js} +31 -14
- package/dist/esm/{navbar.taro-05d293bb.js → navbar.taro-c931c078.js} +7 -5
- package/dist/esm/{noticebar.taro-6845f9ab.js → noticebar.taro-1fa04a96.js} +9 -7
- package/dist/esm/{notify.taro-22b8f4cd.js → notify.taro-0d9cfb07.js} +38 -5
- package/dist/esm/{numberkeyboard.taro-6ff18124.js → numberkeyboard.taro-53c350b8.js} +1 -1
- package/dist/esm/nutui-react.es.js +54 -53
- package/dist/esm/{picker.taro-a3f311a0.js → picker.taro-6a4dad23.js} +1 -1
- package/dist/esm/{popover.taro-604c3116.js → popover.taro-eddd0bd2.js} +5 -3
- package/dist/esm/{popup.taro-d74c3422.js → popup.taro-33d0bbc8.js} +5 -3
- package/dist/esm/{progress.taro-57e1a455.js → progress.taro-623bc807.js} +5 -3
- package/dist/esm/{pulltorefresh.taro-8846f019.js → pulltorefresh.taro-e66c78ad.js} +0 -0
- package/dist/esm/{radio.taro-64546f70.js → radio.taro-95d43860.js} +5 -3
- package/dist/esm/{range.taro-ef3b30f0.js → range.taro-141a0163.js} +35 -12
- package/dist/esm/{rate.taro-0119c0e9.js → rate.taro-5077b962.js} +7 -5
- package/dist/esm/{searchbar.taro-2fff1f66.js → searchbar.taro-f134fb96.js} +5 -3
- package/dist/esm/{shortpassword.taro-d39e038d.js → shortpassword.taro-2e96ca22.js} +6 -4
- package/dist/esm/{sidenavbar.taro-48b136b4.js → sidenavbar.taro-87f056cd.js} +1 -1
- package/dist/esm/{signature.taro-3dbc7030.js → signature.taro-a9286cd1.js} +1 -1
- package/dist/esm/{skeleton.taro-112de52a.js → skeleton.taro-b9ff84b9.js} +1 -1
- package/dist/esm/{step.taro-8c2ba0bb.js → step.taro-f1057500.js} +5 -3
- package/dist/esm/sticky.taro-30d4e453.js +23 -0
- package/dist/esm/{swiper.taro-448cd0ad.js → swiper.taro-58ed323b.js} +4 -4
- package/dist/esm/{tabbaritem.taro-8c0a0a3b.js → tabbaritem.taro-94cd62c2.js} +5 -3
- package/dist/esm/{table.taro-04f9ec51.js → table.taro-7ac89a6c.js} +5 -3
- package/dist/esm/{tabs.taro-7bb22cb5.js → tabs.taro-86186dff.js} +12 -13
- package/dist/esm/{tag.taro-81dcc92d.js → tag.taro-95d7f5c2.js} +5 -3
- package/dist/esm/{timeselect.taro-5b6ed203.js → timeselect.taro-73796bfc.js} +1 -1
- package/dist/esm/toast.taro-cd22a0d7.js +167 -0
- package/dist/esm/types/src/packages/audio/audio.taro.d.ts +13 -14
- package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
- package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
- package/dist/esm/types/src/packages/drag/drag.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.taro.d.ts +4 -6
- package/dist/esm/types/src/packages/input/input.d.ts +1 -1
- package/dist/esm/types/src/packages/input/input.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
- package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +4 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
- package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/toast.taro.d.ts +11 -17
- package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +39 -19
- package/dist/esm/types/src/utils/date.d.ts +1 -1
- package/dist/esm/types/src/utils/useWatch.d.ts +6 -0
- package/dist/esm/{uploader.taro-4fd5dd3c.js → uploader.taro-6184abe7.js} +181 -131
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +1357 -1235
- package/dist/nutui.react.umd.js +1356 -1233
- package/dist/packages/barrage/barrage.scss +7 -2
- package/dist/packages/circleprogress/circleprogress.scss +3 -0
- package/dist/packages/sticky/sticky.scss +0 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +75 -64
- package/dist/types/nutui.taro.react.build.ts +3 -1
- package/package.json +10 -5
- package/dist/esm/render-4a3856cb.js +0 -32
- package/dist/esm/toast.taro-d4ecd6af.js +0 -300
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { FunctionComponent, MouseEventHandler } from 'react';
|
|
2
2
|
import RadioGroup from '@/packages/radiogroup/index.taro';
|
|
3
|
+
import { IComponent } from '@/utils/typings';
|
|
3
4
|
declare type Shape = 'button' | 'round';
|
|
4
5
|
declare type Position = 'right' | 'left';
|
|
5
|
-
import { IComponent } from '@/utils/typings';
|
|
6
6
|
export interface RadioProps extends IComponent {
|
|
7
7
|
className: string;
|
|
8
8
|
style: React.CSSProperties;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
3
|
+
export interface StickyProps extends IComponent {
|
|
4
|
+
container?: React.RefObject<HTMLElement>;
|
|
5
|
+
position?: 'top' | 'bottom';
|
|
6
|
+
className?: string;
|
|
7
|
+
top?: number;
|
|
8
|
+
bottom?: number;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
onChange?: (val: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Sticky: FunctionComponent<StickyProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
2
3
|
declare class Title {
|
|
3
4
|
title: string;
|
|
4
5
|
paneKey: string;
|
|
@@ -7,7 +8,6 @@ declare class Title {
|
|
|
7
8
|
constructor();
|
|
8
9
|
}
|
|
9
10
|
export declare type TabsSize = 'large' | 'normal' | 'small';
|
|
10
|
-
import { IComponent } from '@/utils/typings';
|
|
11
11
|
export interface TabsProps extends IComponent {
|
|
12
12
|
className: string;
|
|
13
13
|
style: React.CSSProperties;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
2
3
|
declare class Title {
|
|
3
4
|
title: string;
|
|
4
5
|
paneKey: string;
|
|
@@ -7,7 +8,6 @@ declare class Title {
|
|
|
7
8
|
constructor();
|
|
8
9
|
}
|
|
9
10
|
export declare type TabsSize = 'large' | 'normal' | 'small';
|
|
10
|
-
import { IComponent } from '@/utils/typings';
|
|
11
11
|
export interface TabsProps extends IComponent {
|
|
12
12
|
className: string;
|
|
13
13
|
style: React.CSSProperties;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Toast from './toast.taro';
|
|
1
|
+
import { Toast } from './toast.taro';
|
|
2
2
|
export default Toast;
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
2
|
export interface ToastProps {
|
|
3
|
-
id
|
|
4
|
-
|
|
3
|
+
id?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
icon: string | null;
|
|
6
|
+
iconSize: string;
|
|
7
|
+
msg: string | React.ReactNode;
|
|
8
|
+
bottom: number | string;
|
|
5
9
|
duration: number;
|
|
6
10
|
center: boolean;
|
|
7
11
|
type: string;
|
|
12
|
+
title: string;
|
|
8
13
|
customClass: string;
|
|
9
|
-
bottom: number;
|
|
10
14
|
size: string | number;
|
|
11
|
-
icon: string;
|
|
12
15
|
textAlignCenter: boolean;
|
|
13
|
-
loadingRotate: boolean;
|
|
14
16
|
bgColor: string;
|
|
15
|
-
onClose: () => void;
|
|
16
17
|
cover: boolean;
|
|
17
18
|
coverColor: string;
|
|
18
19
|
closeOnClickOverlay: boolean;
|
|
20
|
+
visible: boolean;
|
|
21
|
+
onClose: () => void;
|
|
19
22
|
}
|
|
20
|
-
declare const
|
|
21
|
-
text(msg: string | React.ReactNode, option?: {}): void;
|
|
22
|
-
success(msg: string | React.ReactNode, option?: {}): void;
|
|
23
|
-
fail(msg: string | React.ReactNode, option?: {}): void;
|
|
24
|
-
loading(msg: string | React.ReactNode, option?: {}): void;
|
|
25
|
-
warn(msg: string | React.ReactNode, option?: {}): void;
|
|
26
|
-
customIcon(msg: string | React.ReactNode, option?: {}): void;
|
|
27
|
-
hide(): void;
|
|
28
|
-
};
|
|
29
|
-
export default _default;
|
|
23
|
+
export declare const Toast: FunctionComponent<Partial<ToastProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare class UploadOptions {
|
|
2
2
|
url: string;
|
|
3
3
|
name: string;
|
|
4
|
+
fileType?: string | undefined;
|
|
4
5
|
formData?: FormData;
|
|
6
|
+
sourceFile: any;
|
|
5
7
|
method: string;
|
|
6
8
|
xhrState: string | number;
|
|
7
9
|
timeout: number;
|
|
@@ -12,9 +14,11 @@ export declare class UploadOptions {
|
|
|
12
14
|
onProgress?: Function;
|
|
13
15
|
onSuccess?: Function;
|
|
14
16
|
onFailure?: Function;
|
|
17
|
+
beforeXhrUpload?: Function;
|
|
15
18
|
}
|
|
16
19
|
export declare class Upload {
|
|
17
20
|
options: UploadOptions;
|
|
18
21
|
constructor(options: UploadOptions);
|
|
19
22
|
upload(): void;
|
|
23
|
+
uploadTaro(uploadFile: Function, env: string): void;
|
|
20
24
|
}
|
|
@@ -31,29 +31,31 @@ export interface UploaderProps extends IComponent {
|
|
|
31
31
|
className: string;
|
|
32
32
|
defaultImg: string;
|
|
33
33
|
style: React.CSSProperties;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
onStart?: (option: UploadOptions) => void;
|
|
35
|
+
onRemove?: (file: FileItem, fileList: FileItem[]) => void;
|
|
36
|
+
onSuccess?: (param: {
|
|
37
37
|
responseText: XMLHttpRequest['responseText'];
|
|
38
38
|
option: UploadOptions;
|
|
39
39
|
}) => void;
|
|
40
|
-
|
|
40
|
+
onProgress?: (param: {
|
|
41
41
|
e: ProgressEvent<XMLHttpRequestEventTarget>;
|
|
42
42
|
option: UploadOptions;
|
|
43
|
+
percentage: string | number;
|
|
43
44
|
}) => void;
|
|
44
|
-
|
|
45
|
+
onFailure?: (param: {
|
|
45
46
|
responseText: XMLHttpRequest['responseText'];
|
|
46
47
|
option: UploadOptions;
|
|
47
48
|
}) => void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
fileList:
|
|
49
|
+
onUpdate?: (fileList: FileItem[]) => void;
|
|
50
|
+
onOversize?: (file: File[]) => void;
|
|
51
|
+
onChange?: (param: {
|
|
52
|
+
fileList: FileItem[];
|
|
52
53
|
event: React.ChangeEvent<HTMLInputElement>;
|
|
53
54
|
}) => void;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
onBeforeUpload?: (file: File[]) => Promise<File[]>;
|
|
56
|
+
onBeforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
|
|
57
|
+
onBeforeDelete?: (file: FileItem, files: FileItem[]) => boolean;
|
|
58
|
+
onFileItemClick?: (file: FileItem) => void;
|
|
57
59
|
}
|
|
58
60
|
export declare class FileItem {
|
|
59
61
|
status: FileItemStatus;
|
|
@@ -62,6 +64,8 @@ export declare class FileItem {
|
|
|
62
64
|
name?: string;
|
|
63
65
|
url?: string;
|
|
64
66
|
type?: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
percentage: string | number;
|
|
65
69
|
formData: FormData;
|
|
66
70
|
}
|
|
67
71
|
export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
|
|
@@ -1,59 +1,76 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Taro from '@tarojs/taro';
|
|
2
3
|
import { UploadOptions } from './upload';
|
|
3
4
|
export declare type FileType<T> = {
|
|
4
5
|
[key: string]: T;
|
|
5
6
|
};
|
|
6
7
|
export declare type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
8
|
+
/** 图片的尺寸 */
|
|
9
|
+
interface sizeType {
|
|
10
|
+
/** 原图 */
|
|
11
|
+
original: string;
|
|
12
|
+
/** compressed */
|
|
13
|
+
compressed: string;
|
|
14
|
+
}
|
|
15
|
+
/** 图片的来源 */
|
|
16
|
+
interface sourceType {
|
|
17
|
+
/** 从相册选图 */
|
|
18
|
+
album: string;
|
|
19
|
+
/** 使用相机 */
|
|
20
|
+
camera: string;
|
|
21
|
+
/** 使用前置摄像头(仅H5纯浏览器使用) */
|
|
22
|
+
user: string;
|
|
23
|
+
/** 使用后置摄像头(仅H5纯浏览器) */
|
|
24
|
+
environment: string;
|
|
25
|
+
}
|
|
7
26
|
import { IComponent } from '@/utils/typings';
|
|
8
27
|
export interface UploaderProps extends IComponent {
|
|
9
28
|
url: string;
|
|
10
29
|
maximum: string | number;
|
|
30
|
+
sizeType: (keyof sizeType)[];
|
|
31
|
+
sourceType: (keyof sourceType)[];
|
|
11
32
|
maximize: number;
|
|
12
33
|
defaultFileList: FileType<string>[];
|
|
13
34
|
listType: string;
|
|
14
35
|
uploadIcon: string;
|
|
15
36
|
uploadIconSize: string | number;
|
|
16
37
|
name: string;
|
|
17
|
-
accept: string;
|
|
18
38
|
disabled: boolean;
|
|
19
39
|
autoUpload: boolean;
|
|
20
|
-
multiple: boolean;
|
|
21
40
|
timeout: number;
|
|
22
41
|
data: object;
|
|
23
42
|
method: string;
|
|
24
43
|
xhrState: number | string;
|
|
25
44
|
headers: object;
|
|
26
|
-
withCredentials: boolean;
|
|
27
|
-
clearInput: boolean;
|
|
28
45
|
isPreview: boolean;
|
|
29
46
|
isDeletable: boolean;
|
|
30
|
-
capture: boolean;
|
|
31
47
|
className: string;
|
|
32
48
|
defaultImg: string;
|
|
33
49
|
style: React.CSSProperties;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
50
|
+
onStart?: (option: UploadOptions) => void;
|
|
51
|
+
onRemove?: (file: FileItem, fileList: FileType<string>[]) => void;
|
|
52
|
+
onSuccess?: (param: {
|
|
37
53
|
responseText: XMLHttpRequest['responseText'];
|
|
38
54
|
option: UploadOptions;
|
|
39
55
|
}) => void;
|
|
40
|
-
|
|
56
|
+
onProgress?: (param: {
|
|
41
57
|
e: ProgressEvent<XMLHttpRequestEventTarget>;
|
|
42
58
|
option: UploadOptions;
|
|
59
|
+
percentage: string | number;
|
|
43
60
|
}) => void;
|
|
44
|
-
|
|
61
|
+
onFailure?: (param: {
|
|
45
62
|
responseText: XMLHttpRequest['responseText'];
|
|
46
63
|
option: UploadOptions;
|
|
47
64
|
}) => void;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
fileList:
|
|
52
|
-
event: React.ChangeEvent<HTMLInputElement>;
|
|
65
|
+
onUpdate?: (fileList: FileType<string>[]) => void;
|
|
66
|
+
onOversize?: (file: Taro.chooseImage.ImageFile[]) => void;
|
|
67
|
+
onChange?: (param: {
|
|
68
|
+
fileList: FileType<string>[];
|
|
53
69
|
}) => void;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
70
|
+
onBeforeUpload?: (file: Taro.chooseImage.ImageFile[]) => Promise<any[]>;
|
|
71
|
+
onBeforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
|
|
72
|
+
onBeforeDelete?: (file: FileItem, files: FileType<string>[]) => boolean;
|
|
73
|
+
onFileItemClick?: (file: FileItem) => void;
|
|
57
74
|
}
|
|
58
75
|
export declare class FileItem {
|
|
59
76
|
status: FileItemStatus;
|
|
@@ -62,8 +79,11 @@ export declare class FileItem {
|
|
|
62
79
|
name?: string;
|
|
63
80
|
url?: string;
|
|
64
81
|
type?: string;
|
|
65
|
-
|
|
82
|
+
path?: string;
|
|
83
|
+
percentage: string | number;
|
|
84
|
+
formData: any;
|
|
66
85
|
}
|
|
67
86
|
export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
|
|
68
87
|
children?: React.ReactNode;
|
|
69
88
|
} & React.RefAttributes<unknown>>;
|
|
89
|
+
export {};
|