@nutui/nutui-react-taro 2.6.12 → 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.
@@ -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>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "2.6.12",
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",