@nutui/nutui-react-taro 1.4.9-beta.0 → 1.4.9-beta.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 +27 -0
- package/dist/esm/ActionSheet.js +3 -3
- package/dist/esm/Address.js +3 -3
- package/dist/esm/Badge.js +3 -2
- package/dist/esm/Calendar.js +4 -4
- package/dist/esm/CalendarItem.js +3 -2
- package/dist/esm/Card.js +3 -3
- package/dist/esm/Cascader.js +4 -4
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/CheckboxGroup.js +2 -2
- package/dist/esm/CircleProgress.js +3 -2
- package/dist/esm/Collapse.js +3 -2
- package/dist/esm/DatePicker.js +5 -4
- package/dist/esm/Form/style/index.js +1 -1
- package/dist/esm/FormItem/style/index.js +1 -1
- package/dist/esm/Grid.js +3 -2
- package/dist/esm/GridItem.js +3 -2
- package/dist/esm/ImagePreview.js +3 -3
- package/dist/esm/Indicator.js +2 -2
- package/dist/esm/MenuItem/style/index.js +1 -1
- package/dist/esm/NavBar/style/index.js +1 -1
- package/dist/esm/NumberKeyboard/style/index.js +1 -1
- package/dist/esm/NumberKeyboard.js +3 -3
- package/dist/esm/Picker.js +3 -3
- package/dist/esm/Popover/style/index.js +2 -1
- package/dist/esm/Popup.js +2 -2
- package/dist/esm/Rate.js +3 -2
- package/dist/esm/SearchBar/style/index.js +1 -1
- package/dist/esm/ShortPassword.js +3 -3
- package/dist/esm/SideNavBar/style/index.js +1 -1
- package/dist/esm/SideNavBar.js +3 -3
- package/dist/esm/Skeleton/style/index.js +1 -1
- package/dist/esm/Sticky.js +6 -3
- package/dist/esm/Swipe.js +3 -2
- package/dist/esm/Table/style/index.js +1 -1
- package/dist/esm/Tabs/style/index.js +2 -1
- package/dist/esm/Tabs.js +3 -2
- package/dist/esm/TimeSelect/style/index.js +1 -0
- package/dist/esm/TimeSelect.js +3 -3
- package/dist/esm/Uploader/style/index.js +1 -0
- package/dist/esm/Uploader.js +4 -2
- package/dist/esm/{actionsheet.taro-166ce936.js → actionsheet.taro-c5ccaf4e.js} +1 -1
- package/dist/esm/{address.taro-55f308f1.js → address.taro-f977bad0.js} +1 -1
- package/dist/esm/{badge.taro-116b2521.js → badge.taro-a2e7dd5a.js} +5 -2
- package/dist/esm/{calendar.taro-c95e6998.js → calendar.taro-2dee4f90.js} +2 -2
- package/dist/esm/{calendaritem.taro-86412398.js → calendaritem.taro-f5da0936.js} +6 -2
- package/dist/esm/{card.taro-a03f0dfc.js → card.taro-4fb6bc4e.js} +2 -1
- package/dist/esm/{cascader.taro-e0fb7e63.js → cascader.taro-a2ee549c.js} +2 -2
- package/dist/esm/{checkbox.taro-b76b1c82.js → checkbox.taro-6aab93c3.js} +60 -69
- package/dist/esm/{circleprogress.taro-47db537c.js → circleprogress.taro-897ea24b.js} +1 -2
- package/dist/esm/{collapse.taro-af58206c.js → collapse.taro-c903a060.js} +2 -1
- package/dist/esm/{datepicker.taro-c61c6586.js → datepicker.taro-e5f3aa90.js} +11 -10
- package/dist/esm/{grid.taro-e6decfce.js → grid.taro-9410ff69.js} +4 -1
- package/dist/esm/{griditem.taro-5406bd2c.js → griditem.taro-26863577.js} +9 -2
- package/dist/esm/{imagepreview.taro-2d23d0ae.js → imagepreview.taro-3a5722e8.js} +1 -1
- package/dist/esm/index-a90733f9.js +7 -0
- package/dist/esm/{indicator.taro-183ea169.js → indicator.taro-25682172.js} +1 -1
- package/dist/esm/{numberkeyboard.taro-c6b5b0e1.js → numberkeyboard.taro-78224b3a.js} +1 -1
- package/dist/esm/nutui-react.es.js +28 -27
- package/dist/esm/{picker.taro-fa937ea1.js → picker.taro-4298ce4e.js} +2 -2
- package/dist/esm/{popup.taro-4c18f46c.js → popup.taro-6e81162a.js} +1 -1
- package/dist/esm/{rate.taro-17b84a51.js → rate.taro-f18381f3.js} +5 -2
- package/dist/esm/{shortpassword.taro-53b7ee7b.js → shortpassword.taro-e8ea4593.js} +1 -1
- package/dist/esm/{sidenavbar.taro-51a133e6.js → sidenavbar.taro-e03a5287.js} +1 -1
- package/dist/esm/{sticky.taro-2d9b2804.js → sticky.taro-b15d1173.js} +9 -4
- package/dist/esm/{swipe.taro-6532405d.js → swipe.taro-9375a9a1.js} +2 -1
- package/dist/esm/{tabs.taro-4629d66c.js → tabs.taro-95edd45d.js} +2 -0
- package/dist/esm/{timeselect.taro-4fb46162.js → timeselect.taro-f276b0a9.js} +1 -1
- package/dist/esm/types/src/packages/checkbox/checkbox.d.ts +2 -7
- package/dist/esm/types/src/packages/checkbox/checkbox.taro.d.ts +2 -7
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.d.ts +4 -5
- package/dist/esm/types/src/packages/checkboxgroup/checkboxgroup.taro.d.ts +4 -5
- package/dist/esm/types/src/packages/checkboxgroup/context.d.ts +10 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +4 -1
- package/dist/esm/types/src/packages/tabs/tabs.taro.d.ts +4 -1
- package/dist/esm/types/src/packages/uploader/upload.d.ts +3 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +4 -1
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +15 -6
- package/dist/esm/types/src/utils/Interceptor.d.ts +6 -0
- package/dist/esm/types/src/utils/index.d.ts +2 -0
- package/dist/esm/{uploader.taro-c830b573.js → uploader.taro-77396b5d.js} +183 -81
- 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/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +320 -219
- package/dist/nutui.react.umd.js +319 -218
- package/dist/packages/datepicker/datepicker.scss +0 -3
- package/dist/packages/form/form.scss +1 -0
- package/dist/packages/formitem/formitem.scss +13 -0
- package/dist/packages/menuitem/menuitem.scss +4 -0
- package/dist/packages/navbar/navbar.scss +24 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +1 -0
- package/dist/packages/picker/picker.scss +47 -14
- package/dist/packages/searchbar/searchbar.scss +1 -0
- package/dist/packages/sidenavbar/sidenavbar.scss +13 -0
- package/dist/packages/skeleton/skeleton.scss +7 -0
- package/dist/packages/table/table.scss +22 -0
- package/dist/packages/tabs/tabs.scss +65 -35
- package/dist/packages/timeselect/timeselect.scss +7 -0
- package/dist/packages/uploader/uploader.scss +85 -28
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +95 -21
- package/dist/types/index.d.ts +28 -21
- package/package.json +1 -1
- package/dist/esm/types/src/packages/tabbar/use-props-value.d.ts +0 -7
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import CheckboxGroup from '@/packages/checkboxgroup';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
|
-
interface InheritParentProps {
|
|
5
|
-
getParentVals?: () => string[] | undefined;
|
|
6
|
-
max?: number | undefined;
|
|
7
|
-
}
|
|
8
4
|
export interface CheckboxProps extends BasicComponent {
|
|
9
5
|
checked: boolean;
|
|
10
6
|
disabled: boolean;
|
|
@@ -16,10 +12,9 @@ export interface CheckboxProps extends BasicComponent {
|
|
|
16
12
|
iconClassPrefix: string;
|
|
17
13
|
iconFontClassName: string;
|
|
18
14
|
indeterminate: boolean;
|
|
19
|
-
label: string;
|
|
15
|
+
label: string | number;
|
|
20
16
|
onChange: (state: boolean, label: string) => void;
|
|
21
17
|
}
|
|
22
|
-
export declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'
|
|
18
|
+
export declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
|
|
23
19
|
Group: typeof CheckboxGroup;
|
|
24
20
|
};
|
|
25
|
-
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import CheckboxGroup from '@/packages/checkboxgroup/index.taro';
|
|
3
3
|
import { BasicComponent } from '@/utils/typings';
|
|
4
|
-
interface InheritParentProps {
|
|
5
|
-
getParentVals?: () => string[] | undefined;
|
|
6
|
-
max?: number | undefined;
|
|
7
|
-
}
|
|
8
4
|
export interface CheckboxProps extends BasicComponent {
|
|
9
5
|
checked: boolean;
|
|
10
6
|
disabled: boolean;
|
|
@@ -16,10 +12,9 @@ export interface CheckboxProps extends BasicComponent {
|
|
|
16
12
|
iconClassPrefix: string;
|
|
17
13
|
iconFontClassName: string;
|
|
18
14
|
indeterminate: boolean;
|
|
19
|
-
label: string;
|
|
15
|
+
label: string | number;
|
|
20
16
|
onChange: (state: boolean, label: string) => void;
|
|
21
17
|
}
|
|
22
|
-
export declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'
|
|
18
|
+
export declare const Checkbox: FunctionComponent<Partial<CheckboxProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>> & {
|
|
23
19
|
Group: typeof CheckboxGroup;
|
|
24
20
|
};
|
|
25
|
-
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RadioGroupOptionType } from '@/packages/radiogroup/type';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
3
|
+
export type CheckboxTextPosition = 'left' | 'right';
|
|
4
|
+
export type CheckboxDirection = 'horizontal' | 'vertical';
|
|
5
5
|
export interface CheckboxGroupProps {
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
checkedValue: string[];
|
|
8
8
|
max: number | undefined;
|
|
9
|
-
textPosition:
|
|
10
|
-
direction:
|
|
9
|
+
textPosition: CheckboxTextPosition;
|
|
10
|
+
direction: CheckboxDirection;
|
|
11
11
|
onChange: (value: string[]) => void;
|
|
12
12
|
options: RadioGroupOptionType[];
|
|
13
13
|
}
|
|
14
14
|
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<unknown>>;
|
|
15
|
-
export {};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RadioGroupOptionType } from '@/packages/radiogroup/type';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
3
|
+
export type CheckboxTextPosition = 'left' | 'right';
|
|
4
|
+
export type CheckboxDirection = 'horizontal' | 'vertical';
|
|
5
5
|
export interface CheckboxGroupProps {
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
checkedValue: string[];
|
|
8
8
|
max: number | undefined;
|
|
9
|
-
textPosition:
|
|
10
|
-
direction:
|
|
9
|
+
textPosition: CheckboxTextPosition;
|
|
10
|
+
direction: CheckboxDirection;
|
|
11
11
|
onChange: (value: string[]) => void;
|
|
12
12
|
options: RadioGroupOptionType[];
|
|
13
13
|
}
|
|
14
14
|
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Partial<CheckboxGroupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<unknown>>;
|
|
15
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const CheckboxGroupContext: import("react").Context<{
|
|
3
|
+
textPosition: 'left' | 'right';
|
|
4
|
+
disabled: boolean | undefined;
|
|
5
|
+
checkedValue: string[];
|
|
6
|
+
max: number | undefined;
|
|
7
|
+
check: (value: string) => void;
|
|
8
|
+
uncheck: (value: string) => void;
|
|
9
|
+
} | null>;
|
|
10
|
+
export default CheckboxGroupContext;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import TabPane from '@/packages/tabpane';
|
|
3
4
|
declare class Title {
|
|
4
5
|
title: string;
|
|
5
6
|
paneKey: string;
|
|
@@ -29,5 +30,7 @@ export interface TabsProps extends BasicComponent {
|
|
|
29
30
|
autoHeight: boolean;
|
|
30
31
|
children?: React.ReactNode;
|
|
31
32
|
}
|
|
32
|
-
export declare const Tabs: FunctionComponent<Partial<TabsProps
|
|
33
|
+
export declare const Tabs: FunctionComponent<Partial<TabsProps>> & {
|
|
34
|
+
TabPane: typeof TabPane;
|
|
35
|
+
};
|
|
33
36
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
|
+
import TabPane from '@/packages/tabpane/index.taro';
|
|
3
4
|
declare class Title {
|
|
4
5
|
title: string;
|
|
5
6
|
paneKey: string;
|
|
@@ -29,5 +30,7 @@ export interface TabsProps extends BasicComponent {
|
|
|
29
30
|
autoHeight: boolean;
|
|
30
31
|
children?: React.ReactNode;
|
|
31
32
|
}
|
|
32
|
-
export declare const Tabs: FunctionComponent<Partial<TabsProps
|
|
33
|
+
export declare const Tabs: FunctionComponent<Partial<TabsProps>> & {
|
|
34
|
+
TabPane: typeof TabPane;
|
|
35
|
+
};
|
|
33
36
|
export {};
|
|
@@ -20,5 +20,8 @@ export declare class Upload {
|
|
|
20
20
|
options: UploadOptions;
|
|
21
21
|
constructor(options: UploadOptions);
|
|
22
22
|
upload(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class UploaderTaro extends Upload {
|
|
25
|
+
constructor(options: UploadOptions);
|
|
23
26
|
uploadTaro(uploadFile: Function, env: string): void;
|
|
24
27
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { UploadOptions } from './upload';
|
|
3
|
+
import { BasicComponent } from '@/utils/typings';
|
|
3
4
|
export type FileType<T> = {
|
|
4
5
|
[key: string]: T;
|
|
5
6
|
};
|
|
6
7
|
export type FileItemStatus = 'ready' | 'uploading' | 'success' | 'error' | 'removed';
|
|
7
|
-
import { BasicComponent } from '@/utils/typings';
|
|
8
8
|
export interface UploaderProps extends BasicComponent {
|
|
9
9
|
url: string;
|
|
10
10
|
maximum: string | number;
|
|
@@ -13,6 +13,7 @@ export interface UploaderProps extends BasicComponent {
|
|
|
13
13
|
listType: string;
|
|
14
14
|
uploadIcon: string;
|
|
15
15
|
uploadIconSize: string | number;
|
|
16
|
+
uploadIconTip: string;
|
|
16
17
|
name: string;
|
|
17
18
|
accept: string;
|
|
18
19
|
disabled: boolean;
|
|
@@ -36,6 +37,7 @@ export interface UploaderProps extends BasicComponent {
|
|
|
36
37
|
onSuccess?: (param: {
|
|
37
38
|
responseText: XMLHttpRequest['responseText'];
|
|
38
39
|
option: UploadOptions;
|
|
40
|
+
fileList: FileItem[];
|
|
39
41
|
}) => void;
|
|
40
42
|
onProgress?: (param: {
|
|
41
43
|
e: ProgressEvent<XMLHttpRequestEventTarget>;
|
|
@@ -45,6 +47,7 @@ export interface UploaderProps extends BasicComponent {
|
|
|
45
47
|
onFailure?: (param: {
|
|
46
48
|
responseText: XMLHttpRequest['responseText'];
|
|
47
49
|
option: UploadOptions;
|
|
50
|
+
fileList: FileItem[];
|
|
48
51
|
}) => void;
|
|
49
52
|
onUpdate?: (fileList: FileItem[]) => void;
|
|
50
53
|
onOversize?: (file: File[]) => void;
|
|
@@ -19,22 +19,29 @@ interface sourceType {
|
|
|
19
19
|
album: string;
|
|
20
20
|
/** 使用相机 */
|
|
21
21
|
camera: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
}
|
|
23
|
+
/** 视频的来源 */
|
|
24
|
+
interface mediaType {
|
|
25
|
+
/** 只能拍摄图片或从相册选择图片 */
|
|
26
|
+
image: string;
|
|
27
|
+
/** 只能拍摄视频或从相册选择视频 */
|
|
28
|
+
video: string;
|
|
26
29
|
}
|
|
27
30
|
export interface UploaderProps extends BasicComponent {
|
|
28
31
|
url: string;
|
|
29
32
|
maximum: string | number;
|
|
30
33
|
sizeType: (keyof sizeType)[];
|
|
31
34
|
sourceType: (keyof sourceType)[];
|
|
35
|
+
mediaType: (keyof mediaType)[];
|
|
36
|
+
camera: string;
|
|
32
37
|
maximize: number;
|
|
33
38
|
defaultFileList: FileType<string>[];
|
|
34
39
|
listType: string;
|
|
35
40
|
uploadIcon: string;
|
|
36
41
|
uploadIconSize: string | number;
|
|
42
|
+
uploadIconTip: string;
|
|
37
43
|
name: string;
|
|
44
|
+
accept: string;
|
|
38
45
|
disabled: boolean;
|
|
39
46
|
autoUpload: boolean;
|
|
40
47
|
multiple: boolean;
|
|
@@ -47,12 +54,14 @@ export interface UploaderProps extends BasicComponent {
|
|
|
47
54
|
isDeletable: boolean;
|
|
48
55
|
className: string;
|
|
49
56
|
defaultImg: string;
|
|
57
|
+
maxDuration: number;
|
|
50
58
|
style: React.CSSProperties;
|
|
51
59
|
onStart?: (option: UploadOptions) => void;
|
|
52
60
|
onRemove?: (file: FileItem, fileList: FileType<string>[]) => void;
|
|
53
61
|
onSuccess?: (param: {
|
|
54
62
|
responseText: XMLHttpRequest['responseText'];
|
|
55
63
|
option: UploadOptions;
|
|
64
|
+
fileList: FileType<string>[];
|
|
56
65
|
}) => void;
|
|
57
66
|
onProgress?: (param: {
|
|
58
67
|
e: ProgressEvent<XMLHttpRequestEventTarget>;
|
|
@@ -62,13 +71,13 @@ export interface UploaderProps extends BasicComponent {
|
|
|
62
71
|
onFailure?: (param: {
|
|
63
72
|
responseText: XMLHttpRequest['responseText'];
|
|
64
73
|
option: UploadOptions;
|
|
74
|
+
fileList: FileType<string>[];
|
|
65
75
|
}) => void;
|
|
66
76
|
onUpdate?: (fileList: FileType<string>[]) => void;
|
|
67
|
-
onOversize?: (
|
|
77
|
+
onOversize?: (files: Taro.chooseImage.ImageFile[] | Taro.chooseMedia.ChooseMedia[] | any) => void;
|
|
68
78
|
onChange?: (param: {
|
|
69
79
|
fileList: FileType<string>[];
|
|
70
80
|
}) => void;
|
|
71
|
-
onBeforeUpload?: (file: Taro.chooseImage.ImageFile[]) => Promise<any[]>;
|
|
72
81
|
onBeforeXhrUpload?: (xhr: XMLHttpRequest, options: any) => void;
|
|
73
82
|
onBeforeDelete?: (file: FileItem, files: FileType<string>[]) => boolean;
|
|
74
83
|
onFileItemClick?: (file: FileItem) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Interceptor = (...args: any[]) => Promise<boolean> | boolean | undefined | void;
|
|
2
|
+
export declare const funcInterceptor: (interceptor: Interceptor | undefined, { args, done, canceled, }: {
|
|
3
|
+
args?: unknown[] | undefined;
|
|
4
|
+
done: (val?: any) => void;
|
|
5
|
+
canceled?: (() => void) | undefined;
|
|
6
|
+
}) => void;
|