@nutui/nutui-react-taro 2.6.11 → 2.6.13

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +17 -4
  2. package/dist/esm/Address/style/style.css +1 -1
  3. package/dist/esm/AvatarCropper.js +1 -1
  4. package/dist/esm/Calendar.js +1 -1
  5. package/dist/esm/CalendarItem.js +1 -1
  6. package/dist/esm/Cascader/style/style.css +1 -1
  7. package/dist/esm/Drag.js +1 -1
  8. package/dist/esm/ImagePreview.js +1 -1
  9. package/dist/esm/Tabs/style/style.css +1 -1
  10. package/dist/esm/Uploader.js +1 -1
  11. package/dist/esm/{avatarcropper.taro-R3OfWq1H.js → avatarcropper.taro-CAVcFvKC.js} +2 -0
  12. package/dist/esm/{calendar.taro-DN6uEJw-.js → calendar.taro-Bf5owfGd.js} +1 -1
  13. package/dist/esm/{calendaritem.taro-CiGznRkW.js → calendaritem.taro-PLHReAvU.js} +2 -0
  14. package/dist/esm/{drag.taro-CI7ZFwaM.js → drag.taro-B_TO4Nnu.js} +8 -2
  15. package/dist/esm/{imagepreview.taro-B7eJN5Hn.js → imagepreview.taro-DtgQJEQ_.js} +16 -9
  16. package/dist/esm/nutui-react.es.js +6 -6
  17. package/dist/esm/{uploader.taro-E6R-Ow7M.js → uploader.taro-CiamsRGo.js} +3 -5
  18. package/dist/locales/base.js +1 -1
  19. package/dist/locales/en-US.js +1 -1
  20. package/dist/locales/id-ID.js +1 -1
  21. package/dist/locales/tr-TR.js +1 -1
  22. package/dist/locales/zh-CN.js +1 -1
  23. package/dist/locales/zh-TW.js +1 -1
  24. package/dist/locales/zh-UG.js +1 -1
  25. package/dist/nutui.react.es.js +55 -17
  26. package/dist/nutui.react.umd.js +55 -17
  27. package/dist/packages/tabs/tabs.scss +1 -0
  28. package/dist/style.css +1 -1
  29. package/dist/types/packages/drag/drag.d.ts +6 -0
  30. package/dist/types/packages/drag/drag.taro.d.ts +16 -0
  31. package/dist/types/packages/form/usewatch.d.ts +2 -0
  32. package/dist/types/packages/formitem/types.d.ts +1 -1
  33. package/dist/types/packages/imagepreview/imagepreview.d.ts +1 -0
  34. package/dist/types/packages/imagepreview/imagepreview.taro.d.ts +5 -0
  35. package/package.json +1 -1
@@ -1,5 +1,8 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
+ export interface DragState {
4
+ offset: [x: number, y: number];
5
+ }
3
6
  export interface DragProps extends BasicComponent {
4
7
  attract: boolean;
5
8
  direction: 'x' | 'y' | 'lock' | undefined;
@@ -9,5 +12,8 @@ export interface DragProps extends BasicComponent {
9
12
  right: number;
10
13
  bottom: number;
11
14
  };
15
+ onDragStart: () => void;
16
+ onDragEnd: (state: DragState) => void;
17
+ onDrag: (state: DragState) => void;
12
18
  }
13
19
  export declare const Drag: FunctionComponent<Partial<DragProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -1,5 +1,6 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from '../../utils/typings';
3
+ import { DragState } from './drag';
3
4
  export interface DragProps extends BasicComponent {
4
5
  /**
5
6
  * 是否开启自动吸边
@@ -21,5 +22,20 @@ export interface DragProps extends BasicComponent {
21
22
  right: number;
22
23
  bottom: number;
23
24
  }
25
+ /**
26
+ * 开始拖拽元素
27
+ * @default -
28
+ */
29
+ onDragStart: () => void
30
+ /**
31
+ * 停止拖拽元素
32
+ * @default -
33
+ */
34
+ onDragEnd: (state: DragState) => void
35
+ /**
36
+ * 拖拽元素
37
+ * @default -
38
+ */
39
+ onDrag: (state: DragState) => void
24
40
  }
25
41
  export declare const Drag: FunctionComponent<Partial<DragProps> & React.HTMLAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ import { FormInstance, NamePath } from './types';
2
+ export declare function useWatch(namePath: NamePath, form: FormInstance): undefined;
@@ -6,7 +6,7 @@ export interface FormItemRuleWithoutValidator {
6
6
  message?: string;
7
7
  }
8
8
  export interface FormItemRule extends FormItemRuleWithoutValidator {
9
- validator?: (ruleCfg: FormItemRuleWithoutValidator, value: string) => boolean | string | Promise<boolean | string>;
9
+ validator?: (ruleCfg: FormItemRuleWithoutValidator, value: any) => boolean | string | Promise<boolean | string>;
10
10
  }
11
11
  export interface BaseFormField {
12
12
  /**
@@ -20,6 +20,7 @@ export interface ImagePreviewProps extends BasicComponent {
20
20
  value?: number;
21
21
  defaultValue: number;
22
22
  closeOnContentClick: boolean;
23
+ pagination: boolean;
23
24
  indicator: boolean;
24
25
  indicatorColor: string;
25
26
  closeIcon: boolean | ReactNode;
@@ -49,6 +49,11 @@ export interface ImagePreviewProps extends BasicComponent {
49
49
  */
50
50
  closeOnContentClick: boolean
51
51
  /**
52
+ * 分页是否展示
53
+ * @default true
54
+ */
55
+ pagination: boolean
56
+ /**
52
57
  * 分页指示器是否展示
53
58
  * @default false
54
59
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.6.11",
3
+ "version": "2.6.13",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",