@progress/kendo-react-common 16.1.0-develop.9 → 16.2.0-develop.1
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/Draggable.js +1 -1
- package/Draggable.mjs +11 -9
- package/dist/cdn/js/kendo-react-common.js +1 -1
- package/hooks/useDraggable.d.ts +24 -0
- package/hooks/useDraggable.js +1 -1
- package/hooks/useDraggable.mjs +272 -214
- package/package.json +1 -1
package/Draggable.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),f=require("./hooks/useDraggable.js");function m(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(c,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return c.default=e,Object.freeze(c)}const n=m(D),u=n.forwardRef((e,c)=>{const t=n.useRef(null),r=n.useRef(null),a=n.useCallback(()=>t.current&&t.current.element?t.current.element:t.current,[t]);n.useImperativeHandle(r,()=>({element:a()||null})),n.useImperativeHandle(c,()=>r.current),n.useImperativeHandle(e.childRef,()=>t.current);const o=n.useCallback(l=>{e.onPress&&e.onPress({element:a(),target:r.current,event:l})},[a,e.onPress]),g=n.useCallback(l=>{e.onRelease&&e.onRelease({element:a(),target:r.current,event:l})},[a,e.onRelease]),i=n.useCallback(l=>{e.onDragStart&&e.onDragStart({element:a(),target:r.current,event:l})},[e,a]),s=n.useCallback(l=>{e.onDrag&&e.onDrag({element:a(),target:r.current,event:l})},[a,e.onDrag]),d=n.useCallback(l=>{e.onDragEnd&&e.onDragEnd({element:a(),target:r.current,event:l})},[a,e.onDragEnd]);return f.useDraggable(t,{onPress:o,onRelease:g,onDragStart:i,onDrag:s,onDragEnd:d},{mouseOnly:e.mouseOnly,autoTouchAction:e.autoTouchAction,pressHoldDelay:e.pressHoldDelay,autoScroll:e.autoScroll,hint:e.hint,scrollContainer:e.scrollContainer,context:e.context}),e.children?n.cloneElement(n.Children.only(e.children),{ref:t}):null});u.displayName="KendoReactDraggable";exports.Draggable=u;
|
package/Draggable.mjs
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as n from "react";
|
|
10
|
-
import { useDraggable as
|
|
11
|
-
const
|
|
10
|
+
import { useDraggable as s } from "./hooks/useDraggable.mjs";
|
|
11
|
+
const m = n.forwardRef((e, c) => {
|
|
12
12
|
const l = n.useRef(null), r = n.useRef(null), t = n.useCallback(
|
|
13
13
|
() => l.current && l.current.element ? l.current.element : l.current,
|
|
14
14
|
[l]
|
|
@@ -23,7 +23,7 @@ const s = n.forwardRef((e, c) => {
|
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
25
|
[t, e.onPress]
|
|
26
|
-
),
|
|
26
|
+
), o = n.useCallback(
|
|
27
27
|
(a) => {
|
|
28
28
|
e.onRelease && e.onRelease({
|
|
29
29
|
element: t(),
|
|
@@ -32,7 +32,7 @@ const s = n.forwardRef((e, c) => {
|
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
34
|
[t, e.onRelease]
|
|
35
|
-
),
|
|
35
|
+
), g = n.useCallback(
|
|
36
36
|
(a) => {
|
|
37
37
|
e.onDragStart && e.onDragStart({
|
|
38
38
|
element: t(),
|
|
@@ -60,17 +60,19 @@ const s = n.forwardRef((e, c) => {
|
|
|
60
60
|
},
|
|
61
61
|
[t, e.onDragEnd]
|
|
62
62
|
);
|
|
63
|
-
return
|
|
63
|
+
return s(
|
|
64
64
|
l,
|
|
65
65
|
{
|
|
66
66
|
onPress: u,
|
|
67
|
-
onRelease:
|
|
68
|
-
onDragStart:
|
|
67
|
+
onRelease: o,
|
|
68
|
+
onDragStart: g,
|
|
69
69
|
onDrag: d,
|
|
70
70
|
onDragEnd: i
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
mouseOnly: e.mouseOnly,
|
|
74
|
+
autoTouchAction: e.autoTouchAction,
|
|
75
|
+
pressHoldDelay: e.pressHoldDelay,
|
|
74
76
|
autoScroll: e.autoScroll,
|
|
75
77
|
hint: e.hint,
|
|
76
78
|
scrollContainer: e.scrollContainer,
|
|
@@ -78,7 +80,7 @@ const s = n.forwardRef((e, c) => {
|
|
|
78
80
|
}
|
|
79
81
|
), e.children ? n.cloneElement(n.Children.only(e.children), { ref: l }) : null;
|
|
80
82
|
});
|
|
81
|
-
|
|
83
|
+
m.displayName = "KendoReactDraggable";
|
|
82
84
|
export {
|
|
83
|
-
|
|
85
|
+
m as Draggable
|
|
84
86
|
};
|