@nutui/nutui-react-taro 2.0.19-beta.0 → 2.0.19
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 +14 -0
- package/dist/esm/Menu.js +2 -2
- package/dist/esm/MenuItem.js +1 -1
- package/dist/esm/Swiper.js +7 -1
- package/dist/esm/Uploader.js +5 -3
- package/dist/esm/{menu.taro-f419b9ef.js → menu.taro-cf8d7d5b.js} +1 -1
- package/dist/esm/{menuitem.taro-d598a86e.js → menuitem.taro-b73e5ed3.js} +2 -0
- package/dist/esm/nutui-react.es.js +3 -3
- package/dist/esm/types/src/packages/uploader/demo.taro.d.ts +0 -15
- package/dist/esm/types/src/packages/uploader/file-item.d.ts +19 -0
- package/dist/esm/types/src/packages/uploader/index.d.ts +2 -1
- package/dist/esm/types/src/packages/uploader/index.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/uploader/preview.d.ts +2 -0
- package/dist/esm/types/src/packages/uploader/preview.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +3 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +5 -23
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +10 -26
- package/dist/esm/{uploader.taro-56b2ca0d.js → uploader.taro-da0414ba.js} +148 -134
- 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/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +247 -209
- package/dist/nutui.react.umd.js +247 -209
- package/dist/style.mjs +1 -1
- package/dist/types/packages/uploader/file-item.d.ts +19 -0
- package/dist/types/packages/uploader/index.taro.d.ts +2 -1
- package/dist/types/packages/uploader/preview.taro.d.ts +2 -0
- package/dist/types/packages/uploader/upload.d.ts +3 -0
- package/dist/types/packages/uploader/uploader.taro.d.ts +10 -26
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# v2.0.19
|
|
2
|
+
`2023-09-27`
|
|
3
|
+
|
|
4
|
+
* :sparkles: feat(menu): overlay onclick 事件中调用 hideMenuItem 实现关闭 (#1505) @oasis-cloud
|
|
5
|
+
* :sparkles: feat(menu): onClose 事件增加触发来源参数 (#1502) @oasis-cloud
|
|
6
|
+
* :sparkles: feat(swiper): swiperItem 支持设置 className (#1504) @oasis-cloud
|
|
7
|
+
* :bug: fix(uploader): 受控模式调整,props 类型调整,回调参数修正 (#1500) @oasis-cloud
|
|
8
|
+
* :bug: fix: imagepreview with control (#1480) @xiaoyatong
|
|
9
|
+
* :bug: fix: indicator 超长换行 (#1486) @oasis-cloud
|
|
10
|
+
* :bug: fix: menu 在 lockscroll 的时候不需要加滚动事件 (#1509) @oasis-cloud
|
|
11
|
+
* :bug: fix: ios和android下点击button时出现半透明灰色遮罩 (#1495) @Kurisu
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
1
15
|
# v2.0.18
|
|
2
16
|
`2023-09-20`
|
|
3
17
|
|
package/dist/esm/Menu.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as Menu } from "./menu.taro-
|
|
1
|
+
import { M as Menu } from "./menu.taro-cf8d7d5b.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "classnames";
|
|
4
4
|
import "@nutui/icons-react-taro";
|
|
5
|
-
import "./menuitem.taro-
|
|
5
|
+
import "./menuitem.taro-b73e5ed3.js";
|
|
6
6
|
import "@tarojs/taro";
|
|
7
7
|
import "@tarojs/components";
|
|
8
8
|
import "react-transition-group";
|
package/dist/esm/MenuItem.js
CHANGED
package/dist/esm/Swiper.js
CHANGED
|
@@ -79,7 +79,13 @@ const Swiper = forwardRef((props, ref) => {
|
|
|
79
79
|
}, style: {
|
|
80
80
|
width: !width ? "100%" : `${width}px`,
|
|
81
81
|
height: !height ? "150px" : `${height}px`
|
|
82
|
-
}, ...rest }, Children.toArray(children).map((child, index) =>
|
|
82
|
+
}, ...rest }, Children.toArray(children).map((child, index) => {
|
|
83
|
+
let className2;
|
|
84
|
+
if (React__default.isValidElement(child)) {
|
|
85
|
+
className2 = child.props.className;
|
|
86
|
+
}
|
|
87
|
+
return React__default.createElement(SwiperItem, { className: className2, key: index }, child);
|
|
88
|
+
}))
|
|
83
89
|
),
|
|
84
90
|
renderIndicator()
|
|
85
91
|
);
|
package/dist/esm/Uploader.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { U as Uploader } from "./uploader.taro-
|
|
1
|
+
import { U as Uploader } from "./uploader.taro-da0414ba.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "classnames";
|
|
4
4
|
import "@tarojs/taro";
|
|
5
5
|
import "@nutui/icons-react-taro";
|
|
6
|
-
import "@tarojs/components";
|
|
7
6
|
import "./button.taro-25f559e1.js";
|
|
8
7
|
import "./typings-11d83a22.js";
|
|
9
|
-
import "./progress.taro-421575b9.js";
|
|
10
8
|
import "./configprovider.taro-c5ff4877.js";
|
|
11
9
|
import "./index-21e61675.js";
|
|
12
10
|
import "./index-e3184f19.js";
|
|
11
|
+
import "./use-props-value-c78cbf9b.js";
|
|
12
|
+
import "./use-force-update-9cd7c164.js";
|
|
13
|
+
import "@tarojs/components";
|
|
14
|
+
import "./progress.taro-421575b9.js";
|
|
13
15
|
export {
|
|
14
16
|
Uploader as default
|
|
15
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { ArrowUp2, ArrowDown2 } from "@nutui/icons-react-taro";
|
|
4
|
-
import { M as MenuItem } from "./menuitem.taro-
|
|
4
|
+
import { M as MenuItem } from "./menuitem.taro-b73e5ed3.js";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
...ComponentDefaults,
|
|
@@ -41,6 +41,8 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
41
41
|
}, [showPopup]);
|
|
42
42
|
const windowHeight = useMemo(() => getSystemInfoSync().windowHeight, []);
|
|
43
43
|
const updateItemOffset = useCallback(() => {
|
|
44
|
+
if (!parent.lockScroll)
|
|
45
|
+
return;
|
|
44
46
|
const p = parent.menuRef.current;
|
|
45
47
|
p.getBoundingClientRect().then((rect) => {
|
|
46
48
|
if (rect) {
|
|
@@ -33,8 +33,8 @@ import { default as default2 } from "./Form.js";
|
|
|
33
33
|
import { F as F2 } from "./formitem.taro-0dc81538.js";
|
|
34
34
|
import { I as I2 } from "./input.taro-fbcb7090.js";
|
|
35
35
|
import { I as I3 } from "./inputnumber.taro-d2fc26bd.js";
|
|
36
|
-
import { M } from "./menu.taro-
|
|
37
|
-
import { M as M2 } from "./menuitem.taro-
|
|
36
|
+
import { M } from "./menu.taro-cf8d7d5b.js";
|
|
37
|
+
import { M as M2 } from "./menuitem.taro-b73e5ed3.js";
|
|
38
38
|
import { N as N2 } from "./numberkeyboard.taro-bd6a9439.js";
|
|
39
39
|
import { P } from "./picker.taro-e08d99a3.js";
|
|
40
40
|
import { R as R2, a as a2 } from "./radio.taro-d1d370be.js";
|
|
@@ -45,7 +45,7 @@ import { S as S7 } from "./shortpassword.taro-331d270c.js";
|
|
|
45
45
|
import { S as S8 } from "./signature.taro-3e0c2694.js";
|
|
46
46
|
import { S as S9 } from "./switch.taro-74b2bd0a.js";
|
|
47
47
|
import { T as T5 } from "./textarea.taro-6ebe789c.js";
|
|
48
|
-
import { U } from "./uploader.taro-
|
|
48
|
+
import { U } from "./uploader.taro-da0414ba.js";
|
|
49
49
|
import { A as A2 } from "./actionsheet.taro-374745a3.js";
|
|
50
50
|
import { B as B3 } from "./badge.taro-ffca952e.js";
|
|
51
51
|
import { B as B4 } from "./dialog.taro-ffad380a.js";
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import '@/packages/uploader/demo.scss';
|
|
3
|
-
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
4
|
-
export type FileType<T> = {
|
|
5
|
-
[key: string]: T;
|
|
6
|
-
};
|
|
7
|
-
export declare class FileItem {
|
|
8
|
-
status: FileItemStatus;
|
|
9
|
-
message: string;
|
|
10
|
-
uid: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
url?: string;
|
|
13
|
-
path?: string;
|
|
14
|
-
type?: string;
|
|
15
|
-
percentage: string | number;
|
|
16
|
-
formData: FormData;
|
|
17
|
-
}
|
|
18
3
|
declare const UploaderDemo: () => JSX.Element;
|
|
19
4
|
export default UploaderDemo;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare class FileItem {
|
|
3
|
+
status: FileItemStatus;
|
|
4
|
+
message: string;
|
|
5
|
+
uid: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
percentage?: string | number;
|
|
11
|
+
formData?: FormData;
|
|
12
|
+
responseText?: string;
|
|
13
|
+
loadingIcon?: ReactNode;
|
|
14
|
+
failIcon?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
17
|
+
export type FileType<T> = {
|
|
18
|
+
[key: string]: T;
|
|
19
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Uploader } from './uploader';
|
|
2
|
-
export type {
|
|
2
|
+
export type { UploaderProps } from './uploader';
|
|
3
|
+
export type { FileType, FileItem, FileItemStatus } from './file-item';
|
|
3
4
|
export default Uploader;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Uploader } from './uploader.taro';
|
|
2
|
-
export type {
|
|
2
|
+
export type { UploaderProps } from './uploader.taro';
|
|
3
|
+
export type { FileType, FileItem, FileItemStatus } from './file-item';
|
|
3
4
|
export default Uploader;
|
|
@@ -16,6 +16,9 @@ export declare class UploadOptions {
|
|
|
16
16
|
onFailure?: any;
|
|
17
17
|
beforeXhrUpload?: any;
|
|
18
18
|
}
|
|
19
|
+
export declare const UPLOADING = "uploading";
|
|
20
|
+
export declare const SUCCESS = "success";
|
|
21
|
+
export declare const ERROR = "error";
|
|
19
22
|
export declare class Upload {
|
|
20
23
|
options: UploadOptions;
|
|
21
24
|
constructor(options: UploadOptions);
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadOptions } from './upload';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
|
-
|
|
5
|
-
[key: string]: T;
|
|
6
|
-
};
|
|
7
|
-
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
4
|
+
import { FileItem } from './file-item';
|
|
8
5
|
export interface UploaderProps extends BasicComponent {
|
|
9
6
|
url: string;
|
|
10
7
|
maxCount: string | number;
|
|
11
8
|
maxFileSize: number;
|
|
12
|
-
defaultValue?:
|
|
13
|
-
value?:
|
|
9
|
+
defaultValue?: FileItem[];
|
|
10
|
+
value?: FileItem[];
|
|
14
11
|
previewType: 'picture' | 'list';
|
|
15
12
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
16
13
|
uploadIcon?: React.ReactNode;
|
|
@@ -29,7 +26,7 @@ export interface UploaderProps extends BasicComponent {
|
|
|
29
26
|
clearInput: boolean;
|
|
30
27
|
preview: boolean;
|
|
31
28
|
deletable: boolean;
|
|
32
|
-
capture: boolean;
|
|
29
|
+
capture: boolean | 'user' | 'environment';
|
|
33
30
|
className: string;
|
|
34
31
|
previewUrl?: string;
|
|
35
32
|
style: React.CSSProperties;
|
|
@@ -52,27 +49,12 @@ export interface UploaderProps extends BasicComponent {
|
|
|
52
49
|
}) => void;
|
|
53
50
|
onUpdate?: (fileList: FileItem[]) => void;
|
|
54
51
|
onOversize?: (file: File[]) => void;
|
|
55
|
-
onChange?: (
|
|
56
|
-
fileList: FileItem[];
|
|
57
|
-
event: React.ChangeEvent<HTMLInputElement>;
|
|
58
|
-
}) => void;
|
|
52
|
+
onChange?: (p: FileItem[]) => void;
|
|
59
53
|
beforeUpload?: (file: File[]) => Promise<File[] | boolean>;
|
|
60
54
|
beforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
|
|
61
55
|
beforeDelete?: (file: FileItem, files: FileItem[]) => boolean;
|
|
62
56
|
onFileItemClick?: (file: FileItem) => void;
|
|
63
57
|
}
|
|
64
|
-
export declare class FileItem {
|
|
65
|
-
status: FileItemStatus;
|
|
66
|
-
message: string;
|
|
67
|
-
uid: string;
|
|
68
|
-
name?: string;
|
|
69
|
-
url?: string;
|
|
70
|
-
type?: string;
|
|
71
|
-
path?: string;
|
|
72
|
-
percentage: string | number;
|
|
73
|
-
formData: FormData;
|
|
74
|
-
responseText?: string;
|
|
75
|
-
}
|
|
76
58
|
export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
|
|
77
59
|
children?: React.ReactNode;
|
|
78
60
|
} & React.RefAttributes<unknown>>;
|
|
@@ -2,10 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
3
|
import { UploadOptions } from './upload';
|
|
4
4
|
import { BasicComponent } from '@/utils/typings';
|
|
5
|
-
|
|
6
|
-
[key: string]: T;
|
|
7
|
-
};
|
|
8
|
-
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
5
|
+
import { FileItem } from './file-item';
|
|
9
6
|
/** 图片的尺寸 */
|
|
10
7
|
interface sizeType {
|
|
11
8
|
/** 原图 */
|
|
@@ -35,8 +32,8 @@ export interface UploaderProps extends BasicComponent {
|
|
|
35
32
|
mediaType: (keyof mediaType)[];
|
|
36
33
|
camera: string;
|
|
37
34
|
maxFileSize: number;
|
|
38
|
-
defaultValue?:
|
|
39
|
-
value?:
|
|
35
|
+
defaultValue?: FileItem[];
|
|
36
|
+
value?: FileItem[];
|
|
40
37
|
previewType: 'picture' | 'list';
|
|
41
38
|
fit: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
42
39
|
uploadIcon?: React.ReactNode;
|
|
@@ -58,42 +55,29 @@ export interface UploaderProps extends BasicComponent {
|
|
|
58
55
|
maxDuration: number;
|
|
59
56
|
style: React.CSSProperties;
|
|
60
57
|
onStart?: (option: UploadOptions) => void;
|
|
61
|
-
onDelete?: (file: FileItem, fileList:
|
|
58
|
+
onDelete?: (file: FileItem, fileList: FileItem[]) => void;
|
|
62
59
|
onSuccess?: (param: {
|
|
63
60
|
responseText: XMLHttpRequest['responseText'];
|
|
64
61
|
option: UploadOptions;
|
|
65
|
-
fileList:
|
|
62
|
+
fileList: FileItem[];
|
|
66
63
|
}) => void;
|
|
67
64
|
onProgress?: (param: {
|
|
68
65
|
e: ProgressEvent<XMLHttpRequestEventTarget>;
|
|
69
66
|
option: UploadOptions;
|
|
70
|
-
percentage:
|
|
67
|
+
percentage: number | string;
|
|
71
68
|
}) => void;
|
|
72
69
|
onFailure?: (param: {
|
|
73
70
|
responseText: XMLHttpRequest['responseText'];
|
|
74
71
|
option: UploadOptions;
|
|
75
|
-
fileList:
|
|
72
|
+
fileList: FileItem[];
|
|
76
73
|
}) => void;
|
|
77
|
-
onUpdate?: (fileList:
|
|
74
|
+
onUpdate?: (fileList: FileItem[]) => void;
|
|
78
75
|
onOversize?: (files: Taro.chooseImage.ImageFile[] | Taro.chooseMedia.ChooseMedia[] | any) => void;
|
|
79
|
-
onChange?: (
|
|
80
|
-
fileList: FileType<React.ReactNode>[];
|
|
81
|
-
}) => void;
|
|
76
|
+
onChange?: (p: FileItem[]) => void;
|
|
82
77
|
beforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
|
|
83
|
-
beforeDelete?: (file: FileItem, files:
|
|
78
|
+
beforeDelete?: (file: FileItem, files: FileItem[]) => boolean;
|
|
84
79
|
onFileItemClick?: (file: FileItem) => void;
|
|
85
80
|
}
|
|
86
|
-
export declare class FileItem {
|
|
87
|
-
status: FileItemStatus;
|
|
88
|
-
message: string;
|
|
89
|
-
uid: string;
|
|
90
|
-
name?: string;
|
|
91
|
-
url?: string;
|
|
92
|
-
type?: string;
|
|
93
|
-
path?: string;
|
|
94
|
-
percentage: string | number;
|
|
95
|
-
formData: any;
|
|
96
|
-
}
|
|
97
81
|
export declare const Uploader: React.ForwardRefExoticComponent<Partial<UploaderProps> & {
|
|
98
82
|
children?: React.ReactNode;
|
|
99
83
|
} & React.RefAttributes<unknown>>;
|