@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/hooks/useDraggable.mjs
CHANGED
|
@@ -7,298 +7,356 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { dispatchDragAndDrop as
|
|
11
|
-
import { noop as
|
|
12
|
-
import { useInheritedState as
|
|
13
|
-
import { DragAndDropContext as
|
|
14
|
-
import { useIsomorphicLayoutEffect as
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
const { onPress:
|
|
18
|
-
hint:
|
|
19
|
-
mouseOnly:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
10
|
+
import { dispatchDragAndDrop as qe, getScrollableParent as De, autoScroll as ze } from "@progress/kendo-draggable-common";
|
|
11
|
+
import { noop as m } from "../noop.mjs";
|
|
12
|
+
import { useInheritedState as Pe } from "./useInheritedState.mjs";
|
|
13
|
+
import { DragAndDropContext as Ge } from "../drag-n-drop/context/index.mjs";
|
|
14
|
+
import { useIsomorphicLayoutEffect as $e } from "./use-isomorphic-layout-effect.mjs";
|
|
15
|
+
const Je = 2e3, Ke = 16;
|
|
16
|
+
function ot(s, Re, Oe = {}) {
|
|
17
|
+
const { onPress: oe = m, onRelease: ce = m, onDragStart: se = m, onDrag: le = m, onDragEnd: ue = m } = Re, {
|
|
18
|
+
hint: d = null,
|
|
19
|
+
mouseOnly: M = !1,
|
|
20
|
+
autoTouchAction: H = !0,
|
|
21
|
+
pressHoldDelay: X = 0,
|
|
22
|
+
autoScroll: c = !0,
|
|
23
|
+
scrollContainer: f = null,
|
|
24
|
+
context: Te = Ge
|
|
25
|
+
} = Oe, [p, Ie] = t.useState(!1), [L, Me] = t.useState(!1), {
|
|
26
|
+
drop: He,
|
|
27
|
+
setDrop: Xe,
|
|
28
|
+
drag: Ye,
|
|
29
|
+
setDrag: Ae,
|
|
30
|
+
drops: w,
|
|
31
|
+
drags: D,
|
|
32
|
+
registerDrag: P,
|
|
33
|
+
deregisterDrag: R
|
|
34
|
+
} = t.useContext(Te), [Y] = Pe([He, Xe]), [A, O] = Pe([Ye, Ae]), k = t.useRef({ x: 0, y: 0 }), _ = t.useRef(void 0), T = t.useRef(!1), ae = t.useRef(void 0), h = t.useRef(void 0), S = t.useRef(!1), C = t.useRef(null), i = t.useRef(void 0), g = t.useRef(!1), l = t.useRef(null), u = t.useRef(null), j = t.useRef(!1), U = t.useRef({ x: 0, y: 0 }), B = t.useRef({ x: 0, y: 0 }), x = t.useRef({ x: 0, y: 0 }), N = t.useRef({ x: 0, y: 0 }), V = t.useRef({ x: 0, y: 0 }), F = t.useRef({ x: 0, y: 0 }), _e = !!(typeof window != "undefined" && window.PointerEvent), ie = !M && _e, b = !H && X > 0, a = t.useCallback(
|
|
35
|
+
() => s.current && s.current.element ? s.current.element : s.current,
|
|
36
|
+
[s]
|
|
37
|
+
), je = t.useCallback(
|
|
38
|
+
() => d && d.current && d.current.element ? d.current.element : d ? d.current : null,
|
|
39
|
+
[d]
|
|
40
|
+
), de = t.useCallback(
|
|
41
|
+
() => f && f.current && f.current.element ? f.current.element : f ? f.current : null,
|
|
42
|
+
[f]
|
|
43
|
+
), fe = t.useCallback(() => {
|
|
44
|
+
if (typeof c == "object" && c.boundaryElementRef && c.boundaryElementRef.current) {
|
|
45
|
+
const e = c.boundaryElementRef.current;
|
|
46
|
+
return typeof e == "object" && "element" in e ? e.element : e;
|
|
47
|
+
}
|
|
48
|
+
return u.current;
|
|
49
|
+
}, [c]), v = t.useRef(null);
|
|
50
|
+
t.useImperativeHandle(v, () => ({
|
|
46
51
|
get element() {
|
|
47
|
-
return
|
|
52
|
+
return a();
|
|
48
53
|
},
|
|
49
54
|
get hint() {
|
|
50
|
-
return
|
|
55
|
+
return je();
|
|
51
56
|
},
|
|
52
|
-
onPress:
|
|
53
|
-
onDragStart:
|
|
54
|
-
onDrag:
|
|
55
|
-
onDragEnd:
|
|
56
|
-
onRelease:
|
|
57
|
-
data:
|
|
57
|
+
onPress: Ue,
|
|
58
|
+
onDragStart: Ne,
|
|
59
|
+
onDrag: Ve,
|
|
60
|
+
onDragEnd: Fe,
|
|
61
|
+
onRelease: Be,
|
|
62
|
+
data: s.current
|
|
58
63
|
}));
|
|
59
|
-
const
|
|
60
|
-
const e =
|
|
64
|
+
const I = t.useCallback(() => {
|
|
65
|
+
const e = a();
|
|
61
66
|
return e && e.ownerDocument || document;
|
|
62
|
-
}, [
|
|
63
|
-
const e =
|
|
67
|
+
}, [a]), E = t.useCallback(() => {
|
|
68
|
+
const e = I();
|
|
64
69
|
return e && e.defaultView || window;
|
|
65
|
-
}, [
|
|
70
|
+
}, [I]), he = t.useCallback(
|
|
66
71
|
() => ({
|
|
67
72
|
get drag() {
|
|
68
|
-
return
|
|
73
|
+
return A ? A.current : null;
|
|
69
74
|
},
|
|
70
75
|
get drop() {
|
|
71
|
-
return
|
|
76
|
+
return Y ? Y.current : null;
|
|
72
77
|
},
|
|
73
78
|
get drags() {
|
|
74
|
-
return (
|
|
79
|
+
return (D != null ? D : []).map((e) => e.current);
|
|
75
80
|
},
|
|
76
81
|
get drops() {
|
|
77
|
-
return (
|
|
82
|
+
return (w != null ? w : []).map((e) => e.current);
|
|
78
83
|
},
|
|
79
|
-
pressed: !!
|
|
80
|
-
ignoreMouse:
|
|
81
|
-
scrollOffset:
|
|
82
|
-
offset:
|
|
83
|
-
pageOffset:
|
|
84
|
-
initialScrollOffset:
|
|
85
|
-
clientOffset:
|
|
86
|
-
initialClientOffset:
|
|
87
|
-
velocity:
|
|
88
|
-
autoScroll: !!(typeof
|
|
89
|
-
scrollableParent:
|
|
90
|
-
autoScrollDirection: typeof
|
|
91
|
-
isScrolling:
|
|
84
|
+
pressed: !!p,
|
|
85
|
+
ignoreMouse: T.current,
|
|
86
|
+
scrollOffset: V.current,
|
|
87
|
+
offset: U.current,
|
|
88
|
+
pageOffset: B.current,
|
|
89
|
+
initialScrollOffset: F.current,
|
|
90
|
+
clientOffset: x.current,
|
|
91
|
+
initialClientOffset: N.current,
|
|
92
|
+
velocity: k.current,
|
|
93
|
+
autoScroll: !!(typeof c == "object" ? c.enabled !== !1 : c),
|
|
94
|
+
scrollableParent: fe(),
|
|
95
|
+
autoScrollDirection: typeof c == "object" ? c.direction : { horizontal: !0, vertical: !0 },
|
|
96
|
+
isScrolling: L
|
|
92
97
|
}),
|
|
93
98
|
[
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
b,
|
|
97
|
-
p,
|
|
98
|
-
f,
|
|
99
|
+
A,
|
|
100
|
+
Y,
|
|
99
101
|
D,
|
|
102
|
+
w,
|
|
103
|
+
p,
|
|
100
104
|
T,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
V,
|
|
106
|
+
U,
|
|
107
|
+
B,
|
|
108
|
+
F,
|
|
109
|
+
x,
|
|
110
|
+
N,
|
|
111
|
+
k,
|
|
112
|
+
c,
|
|
113
|
+
L,
|
|
114
|
+
fe
|
|
110
115
|
]
|
|
111
|
-
),
|
|
112
|
-
|
|
113
|
-
}, []),
|
|
114
|
-
|
|
115
|
-
}, []),
|
|
116
|
-
|
|
117
|
-
}, []),
|
|
118
|
-
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
121
|
-
}, []),
|
|
122
|
-
|
|
123
|
-
}, []),
|
|
124
|
-
|
|
125
|
-
}, []),
|
|
126
|
-
|
|
127
|
-
}, []),
|
|
128
|
-
|
|
129
|
-
}, []),
|
|
116
|
+
), me = t.useCallback((e) => {
|
|
117
|
+
Ie(e);
|
|
118
|
+
}, []), pe = t.useCallback((e) => {
|
|
119
|
+
Me(e);
|
|
120
|
+
}, []), Ce = t.useCallback((e) => {
|
|
121
|
+
k.current = e;
|
|
122
|
+
}, []), ge = t.useCallback((e) => {
|
|
123
|
+
U.current = e;
|
|
124
|
+
}, []), be = t.useCallback((e) => {
|
|
125
|
+
x.current = e;
|
|
126
|
+
}, []), ve = t.useCallback((e) => {
|
|
127
|
+
B.current = e;
|
|
128
|
+
}, []), Ee = t.useCallback((e) => {
|
|
129
|
+
N.current = e;
|
|
130
|
+
}, []), ye = t.useCallback((e) => {
|
|
131
|
+
V.current = e;
|
|
132
|
+
}, []), ke = t.useCallback((e) => {
|
|
133
|
+
F.current = e;
|
|
134
|
+
}, []), Ue = t.useCallback(
|
|
130
135
|
(e) => {
|
|
131
|
-
|
|
136
|
+
oe(e);
|
|
132
137
|
},
|
|
133
|
-
[
|
|
134
|
-
),
|
|
138
|
+
[oe]
|
|
139
|
+
), Be = t.useCallback(
|
|
135
140
|
(e) => {
|
|
136
|
-
|
|
141
|
+
ce(e);
|
|
137
142
|
},
|
|
138
|
-
[
|
|
139
|
-
),
|
|
143
|
+
[ce]
|
|
144
|
+
), Ne = t.useCallback(
|
|
140
145
|
(e) => {
|
|
141
|
-
|
|
146
|
+
O(v, { target: s.current, event: e }), se(e);
|
|
142
147
|
},
|
|
143
|
-
[
|
|
144
|
-
),
|
|
148
|
+
[O, s, se]
|
|
149
|
+
), Ve = t.useCallback(
|
|
145
150
|
(e) => {
|
|
146
|
-
|
|
151
|
+
le(e);
|
|
147
152
|
},
|
|
148
|
-
[
|
|
149
|
-
),
|
|
153
|
+
[le]
|
|
154
|
+
), Fe = t.useCallback(
|
|
150
155
|
(e) => {
|
|
151
|
-
|
|
156
|
+
j.current || (O(null, { target: s.current, event: e }), ue(e));
|
|
152
157
|
},
|
|
153
|
-
[
|
|
154
|
-
),
|
|
158
|
+
[ue, O, s]
|
|
159
|
+
), r = t.useCallback(
|
|
155
160
|
(e) => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{ event: e, payload:
|
|
161
|
+
v.current && qe(
|
|
162
|
+
he(),
|
|
163
|
+
{ event: e, payload: v.current },
|
|
159
164
|
{
|
|
160
|
-
onVelocityChange:
|
|
161
|
-
onOffsetChange:
|
|
162
|
-
onClientOffsetChange:
|
|
163
|
-
onPageOffsetChange:
|
|
164
|
-
onInitialClientOffsetChange:
|
|
165
|
-
onScrollOffsetChange:
|
|
166
|
-
onInitialScrollOffsetChange:
|
|
167
|
-
onIsPressedChange:
|
|
168
|
-
onIsScrollingChange:
|
|
165
|
+
onVelocityChange: Ce,
|
|
166
|
+
onOffsetChange: ge,
|
|
167
|
+
onClientOffsetChange: be,
|
|
168
|
+
onPageOffsetChange: ve,
|
|
169
|
+
onInitialClientOffsetChange: Ee,
|
|
170
|
+
onScrollOffsetChange: ye,
|
|
171
|
+
onInitialScrollOffsetChange: ke,
|
|
172
|
+
onIsPressedChange: me,
|
|
173
|
+
onIsScrollingChange: pe
|
|
169
174
|
}
|
|
170
175
|
);
|
|
171
176
|
},
|
|
172
177
|
[
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
he,
|
|
179
|
+
Ce,
|
|
180
|
+
ge,
|
|
181
|
+
ve,
|
|
182
|
+
be,
|
|
183
|
+
Ee,
|
|
184
|
+
ke,
|
|
185
|
+
me,
|
|
186
|
+
ye,
|
|
187
|
+
pe
|
|
183
188
|
]
|
|
184
|
-
),
|
|
189
|
+
), y = t.useCallback(() => {
|
|
190
|
+
h.current && (window.clearTimeout(h.current), h.current = void 0), S.current = !1, C.current = null, i.current = void 0, g.current = !1, l.current = null;
|
|
191
|
+
}, []), Se = t.useCallback(
|
|
192
|
+
(e) => b && e.pointerType === "touch" && e.pointerId === i.current,
|
|
193
|
+
[b]
|
|
194
|
+
), W = t.useCallback((e, n) => {
|
|
195
|
+
u.current && (u.current.scrollTop += e.y - n.y, u.current.scrollLeft += e.x - n.x);
|
|
196
|
+
}, []), xe = t.useCallback(
|
|
185
197
|
(e) => {
|
|
186
|
-
|
|
198
|
+
i.current = e.pointerId, C.current = { x: e.clientX, y: e.clientY }, l.current = { x: e.clientX, y: e.clientY };
|
|
199
|
+
const n = a();
|
|
200
|
+
h.current = window.setTimeout(() => {
|
|
201
|
+
S.current = !0, g.current = !1;
|
|
202
|
+
try {
|
|
203
|
+
n && i.current !== void 0 && n.setPointerCapture(i.current);
|
|
204
|
+
} catch {
|
|
205
|
+
}
|
|
206
|
+
}, X);
|
|
207
|
+
},
|
|
208
|
+
[a, X]
|
|
209
|
+
), q = t.useCallback(
|
|
210
|
+
(e) => {
|
|
211
|
+
if (!e.isPrimary) {
|
|
212
|
+
r(e);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
y(), b && e.pointerType === "touch" ? xe(e) : S.current = !0, r(e);
|
|
187
216
|
},
|
|
188
|
-
[
|
|
189
|
-
),
|
|
217
|
+
[r, b, y, xe]
|
|
218
|
+
), z = t.useCallback(
|
|
190
219
|
(e) => {
|
|
191
|
-
|
|
220
|
+
if (Se(e)) {
|
|
221
|
+
if (!S.current && C.current) {
|
|
222
|
+
if (g.current) {
|
|
223
|
+
l.current && W(l.current, { x: e.clientX, y: e.clientY }), l.current = { x: e.clientX, y: e.clientY };
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const n = Math.abs(e.clientX - C.current.x), o = Math.abs(e.clientY - C.current.y);
|
|
227
|
+
if (Math.hypot(n, o) > Ke) {
|
|
228
|
+
g.current = !0, W(C.current, { x: e.clientX, y: e.clientY }), l.current = { x: e.clientX, y: e.clientY };
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (S.current) {
|
|
234
|
+
if (l.current && Math.round(e.clientX) === Math.round(l.current.x) && Math.round(e.clientY) === Math.round(l.current.y))
|
|
235
|
+
return;
|
|
236
|
+
l.current = { x: e.clientX, y: e.clientY };
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
r(e);
|
|
192
240
|
},
|
|
193
|
-
[
|
|
194
|
-
),
|
|
241
|
+
[r, Se, W]
|
|
242
|
+
), G = t.useCallback(
|
|
195
243
|
(e) => {
|
|
196
|
-
|
|
244
|
+
(i.current === void 0 || e.pointerId === i.current) && y(), r(e);
|
|
197
245
|
},
|
|
198
|
-
[
|
|
199
|
-
),
|
|
246
|
+
[r, y]
|
|
247
|
+
), $ = t.useCallback(
|
|
200
248
|
(e) => {
|
|
201
|
-
|
|
249
|
+
if (i.current !== void 0 && e.pointerId !== i.current) {
|
|
250
|
+
r(e);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const n = g.current;
|
|
254
|
+
if (y(), n) {
|
|
255
|
+
const o = new PointerEvent("pointercancel", e);
|
|
256
|
+
r(o);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
r(e);
|
|
202
260
|
},
|
|
203
|
-
[
|
|
204
|
-
),
|
|
261
|
+
[r, y]
|
|
262
|
+
), J = t.useCallback(
|
|
205
263
|
(e) => {
|
|
206
|
-
|
|
264
|
+
r(e);
|
|
207
265
|
},
|
|
208
|
-
[
|
|
209
|
-
),
|
|
266
|
+
[r]
|
|
267
|
+
), K = t.useCallback(
|
|
210
268
|
(e) => {
|
|
211
|
-
|
|
269
|
+
r(e);
|
|
212
270
|
},
|
|
213
|
-
[
|
|
214
|
-
),
|
|
271
|
+
[r]
|
|
272
|
+
), Q = t.useCallback(
|
|
215
273
|
(e) => {
|
|
216
|
-
|
|
274
|
+
r(e);
|
|
217
275
|
},
|
|
218
|
-
[
|
|
219
|
-
),
|
|
276
|
+
[r]
|
|
277
|
+
), Z = t.useCallback(
|
|
220
278
|
(e) => {
|
|
221
|
-
e.preventDefault(),
|
|
279
|
+
e.preventDefault(), r(e);
|
|
222
280
|
},
|
|
223
|
-
[
|
|
224
|
-
),
|
|
281
|
+
[r]
|
|
282
|
+
), ee = t.useCallback(
|
|
225
283
|
(e) => {
|
|
226
|
-
e.preventDefault(),
|
|
284
|
+
e.preventDefault(), r(e);
|
|
227
285
|
},
|
|
228
|
-
[
|
|
229
|
-
),
|
|
286
|
+
[r]
|
|
287
|
+
), te = t.useCallback(
|
|
230
288
|
(e) => {
|
|
231
|
-
e.preventDefault(),
|
|
289
|
+
e.preventDefault(), r(e);
|
|
232
290
|
},
|
|
233
|
-
[
|
|
234
|
-
),
|
|
291
|
+
[r]
|
|
292
|
+
), ne = t.useCallback(
|
|
235
293
|
(e) => {
|
|
236
294
|
if (e.touches.length === 0 && e.changedTouches.length === 1) {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
},
|
|
295
|
+
const n = E();
|
|
296
|
+
T.current = !0, ae.current = n.setTimeout(() => {
|
|
297
|
+
T.current = !1;
|
|
298
|
+
}, Je);
|
|
241
299
|
}
|
|
242
|
-
|
|
300
|
+
r(e);
|
|
243
301
|
},
|
|
244
|
-
[
|
|
245
|
-
),
|
|
302
|
+
[r, E]
|
|
303
|
+
), re = t.useCallback(
|
|
246
304
|
(e) => {
|
|
247
|
-
|
|
305
|
+
g.current || r(e);
|
|
248
306
|
},
|
|
249
|
-
[
|
|
250
|
-
),
|
|
251
|
-
const e =
|
|
252
|
-
if (e) {
|
|
253
|
-
const
|
|
307
|
+
[r]
|
|
308
|
+
), Le = t.useCallback(() => {
|
|
309
|
+
const e = a();
|
|
310
|
+
if (e && (H || b)) {
|
|
311
|
+
const n = e.style.touchAction;
|
|
254
312
|
return e.style.touchAction = "none", () => {
|
|
255
|
-
e.style.touchAction =
|
|
313
|
+
e.style.touchAction = n;
|
|
256
314
|
};
|
|
257
315
|
}
|
|
258
|
-
}, [
|
|
259
|
-
|
|
260
|
-
}), [
|
|
261
|
-
const e =
|
|
262
|
-
return
|
|
263
|
-
|
|
316
|
+
}, [a, H, b]), we = t.useCallback(() => (P == null || P(v), () => {
|
|
317
|
+
R == null || R(v);
|
|
318
|
+
}), [R, P]), We = () => {
|
|
319
|
+
const e = E(), n = a(), o = I();
|
|
320
|
+
return ie ? (n && (u.current = De(n), u.current && u.current.addEventListener("scroll", re, { passive: !0 }), n.addEventListener("pointerdown", q, { passive: !0 })), p && (o.addEventListener("pointermove", z), o.addEventListener("pointerup", $, !0), o.addEventListener("contextmenu", Z), o.addEventListener("pointercancel", G, { passive: !0 }))) : (e.addEventListener("touchmove", m, { capture: !1, passive: !1 }), n && (n.addEventListener("mousedown", J, { passive: !0 }), M || (n.addEventListener("touchstart", ee, { passive: !0 }), p && (n.addEventListener("touchmove", te, { passive: !0 }), n.addEventListener("touchend", ne, { passive: !0 })))), p && (o.addEventListener("mousemove", K, { passive: !0 }), o.addEventListener("mouseup", Q, { passive: !0 }))), () => {
|
|
321
|
+
u.current && u.current.removeEventListener("scroll", re), n && (n.removeEventListener("pointerdown", q), n.removeEventListener("mousedown", J), n.removeEventListener("touchstart", ee), n.removeEventListener("touchmove", te), n.removeEventListener("touchend", ne)), o.removeEventListener("pointermove", z), o.removeEventListener("pointerup", $, !0), o.removeEventListener("contextmenu", Z), o.removeEventListener("pointercancel", G), o.removeEventListener("mousemove", K), o.removeEventListener("mouseup", Q), e.removeEventListener("touchmove", m), e.clearTimeout(ae.current);
|
|
264
322
|
};
|
|
265
323
|
};
|
|
266
324
|
t.useEffect(() => {
|
|
267
|
-
const e =
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
270
|
-
document.elementFromPoint(
|
|
325
|
+
const e = E();
|
|
326
|
+
if (L) {
|
|
327
|
+
const n = de() || u.current || De(
|
|
328
|
+
document.elementFromPoint(x.current.x, x.current.y)
|
|
271
329
|
);
|
|
272
|
-
e.clearInterval(
|
|
273
|
-
|
|
330
|
+
e.clearInterval(_.current), _.current = e.setInterval(() => {
|
|
331
|
+
ze(n, { x: k.current.x, y: k.current.y });
|
|
274
332
|
}, 50);
|
|
275
333
|
}
|
|
276
334
|
return () => {
|
|
277
|
-
e.clearInterval(
|
|
335
|
+
e.clearInterval(_.current);
|
|
278
336
|
};
|
|
279
|
-
}, [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
337
|
+
}, [a, de, E, L]), t.useEffect(Le, [Le]), t.useEffect(We, [
|
|
338
|
+
p,
|
|
339
|
+
E,
|
|
340
|
+
a,
|
|
341
|
+
I,
|
|
342
|
+
M,
|
|
343
|
+
ie,
|
|
285
344
|
Z,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
_,
|
|
290
|
-
B,
|
|
291
|
-
j,
|
|
292
|
-
U,
|
|
293
|
-
V,
|
|
345
|
+
J,
|
|
346
|
+
K,
|
|
347
|
+
Q,
|
|
294
348
|
G,
|
|
295
|
-
|
|
349
|
+
q,
|
|
296
350
|
z,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
351
|
+
$,
|
|
352
|
+
ne,
|
|
353
|
+
te,
|
|
354
|
+
ee,
|
|
355
|
+
re
|
|
356
|
+
]), t.useEffect(() => (j.current = !1, () => {
|
|
357
|
+
j.current = !0, h.current && (window.clearTimeout(h.current), h.current = void 0);
|
|
358
|
+
}), []), $e(we, [we]);
|
|
301
359
|
}
|
|
302
360
|
export {
|
|
303
|
-
|
|
361
|
+
ot as useDraggable
|
|
304
362
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-common",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0-develop.1",
|
|
4
4
|
"description": "React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|