@nutui/nutui-react 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
  /**
5
8
  * 是否开启自动吸边
@@ -21,5 +24,20 @@ export interface DragProps extends BasicComponent {
21
24
  right: number;
22
25
  bottom: number;
23
26
  }
27
+ /**
28
+ * 开始拖拽元素
29
+ * @default -
30
+ */
31
+ onDragStart: () => void
32
+ /**
33
+ * 停止拖拽元素
34
+ * @default -
35
+ */
36
+ onDragEnd: (state: DragState) => void
37
+ /**
38
+ * 拖拽元素
39
+ * @default -
40
+ */
41
+ onDrag: (state: DragState) => void
24
42
  }
25
43
  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
  attract: boolean;
5
6
  direction: 'x' | 'y' | 'lock' | undefined;
@@ -9,5 +10,8 @@ export interface DragProps extends BasicComponent {
9
10
  right: number;
10
11
  bottom: number;
11
12
  };
13
+ onDragStart: () => void;
14
+ onDragEnd: (state: DragState) => void;
15
+ onDrag: (state: DragState) => void;
12
16
  }
13
17
  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",
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",