@leafer-ui/interaction 1.9.1 → 1.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/interaction",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "@leafer-ui/interaction",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,12 +22,12 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.9.1",
26
- "@leafer-ui/draw": "1.9.1",
27
- "@leafer-ui/event": "1.9.1"
25
+ "@leafer/core": "1.9.3",
26
+ "@leafer-ui/draw": "1.9.3",
27
+ "@leafer-ui/event": "1.9.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.9.1",
31
- "@leafer-ui/interface": "1.9.1"
30
+ "@leafer/interface": "1.9.3",
31
+ "@leafer-ui/interface": "1.9.3"
32
32
  }
33
33
  }
package/src/Dragger.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IPointerEvent, IDragEvent, ILeaf, ILeafList, ITimer, IFunction, IPointDataMap, IMoveEvent } from '@leafer/interface'
2
- import { PointHelper, LeafList, LeafHelper, isNumber } from '@leafer/core'
2
+ import { PointHelper, LeafList, LeafHelper, isNumber, isString } from '@leafer/core'
3
3
 
4
4
  import { MoveEvent, DragEvent, DropEvent, PointerButton } from '@leafer-ui/event'
5
5
 
@@ -123,8 +123,9 @@ export class Dragger {
123
123
  const checkLimitMove = !dragLimitAnimate || !!isDragEnd
124
124
  list.forEach(leaf => {
125
125
  if (leaf.draggable) {
126
- const move = DragEvent.getValidMove(leaf, this.dragStartPoints[leaf.innerId], { x: totalX, y: totalY }, checkLimitMove)
127
- if (dragLimitAnimate && isDragEnd) LeafHelper.animateMove(leaf, move, isNumber(dragLimitAnimate) ? dragLimitAnimate : 0.3)
126
+ const axisDrag = isString(leaf.draggable)
127
+ const move = DragEvent.getValidMove(leaf, this.dragStartPoints[leaf.innerId], { x: totalX, y: totalY }, checkLimitMove || axisDrag)
128
+ if (dragLimitAnimate && !axisDrag && isDragEnd) LeafHelper.animateMove(leaf, move, isNumber(dragLimitAnimate) ? dragLimitAnimate : 0.3)
128
129
  else leaf.move(move)
129
130
  }
130
131
  })
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { InteractionBase } from './Interaction'
2
2
  export { InteractionHelper } from './InteractionHelper'
3
3
  export { Cursor } from './Cursor'
4
- export { Dragger } from './Dragger'
4
+ export { Dragger } from './Dragger'