@progress/kendo-react-sortable 6.1.1 → 7.0.0-develop.2

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.
Files changed (73) hide show
  1. package/LICENSE.md +1 -1
  2. package/{dist/npm/Sortable.d.ts → Sortable.d.ts} +8 -4
  3. package/dist/cdn/js/kendo-react-sortable.js +5 -1
  4. package/events/BaseEvent.d.ts +13 -0
  5. package/{dist/es/events → events}/PreventableEvent.d.ts +4 -0
  6. package/{dist/npm/events → events}/SortableOnDragEndEvent.d.ts +4 -0
  7. package/{dist/npm/events → events}/SortableOnDragOverEvent.d.ts +4 -0
  8. package/{dist/npm/events → events}/SortableOnDragStartEvent.d.ts +4 -0
  9. package/{dist/es/events → events}/SortableOnNavigateEvent.d.ts +4 -0
  10. package/index.d.ts +13 -0
  11. package/index.js +5 -0
  12. package/index.mjs +485 -0
  13. package/{dist/es/interfaces → interfaces}/SortableDefaultProps.d.ts +4 -1
  14. package/interfaces/SortableEmptyItemUIProps.d.ts +13 -0
  15. package/{dist/npm/interfaces → interfaces}/SortableItemUIProps.d.ts +4 -1
  16. package/{dist/es/interfaces → interfaces}/SortableProps.d.ts +4 -1
  17. package/messages/index.d.ts +14 -0
  18. package/package-metadata.d.ts +9 -0
  19. package/package.json +27 -37
  20. package/{dist/npm/utils → utils}/utils.d.ts +4 -0
  21. package/about.md +0 -3
  22. package/dist/es/Sortable.d.ts +0 -206
  23. package/dist/es/Sortable.js +0 -691
  24. package/dist/es/events/BaseEvent.d.ts +0 -10
  25. package/dist/es/events/BaseEvent.js +0 -1
  26. package/dist/es/events/PreventableEvent.js +0 -28
  27. package/dist/es/events/SortableOnDragEndEvent.d.ts +0 -27
  28. package/dist/es/events/SortableOnDragEndEvent.js +0 -16
  29. package/dist/es/events/SortableOnDragOverEvent.d.ts +0 -27
  30. package/dist/es/events/SortableOnDragOverEvent.js +0 -16
  31. package/dist/es/events/SortableOnDragStartEvent.d.ts +0 -24
  32. package/dist/es/events/SortableOnDragStartEvent.js +0 -34
  33. package/dist/es/events/SortableOnNavigateEvent.js +0 -16
  34. package/dist/es/interfaces/SortableDefaultProps.js +0 -1
  35. package/dist/es/interfaces/SortableEmptyItemUIProps.d.ts +0 -9
  36. package/dist/es/interfaces/SortableEmptyItemUIProps.js +0 -1
  37. package/dist/es/interfaces/SortableItemUIProps.d.ts +0 -38
  38. package/dist/es/interfaces/SortableItemUIProps.js +0 -1
  39. package/dist/es/interfaces/SortableProps.js +0 -1
  40. package/dist/es/main.d.ts +0 -9
  41. package/dist/es/main.js +0 -6
  42. package/dist/es/messages/index.d.ts +0 -10
  43. package/dist/es/messages/index.js +0 -11
  44. package/dist/es/package-metadata.d.ts +0 -5
  45. package/dist/es/package-metadata.js +0 -11
  46. package/dist/es/utils/utils.d.ts +0 -29
  47. package/dist/es/utils/utils.js +0 -84
  48. package/dist/npm/Sortable.js +0 -694
  49. package/dist/npm/events/BaseEvent.d.ts +0 -10
  50. package/dist/npm/events/BaseEvent.js +0 -2
  51. package/dist/npm/events/PreventableEvent.d.ts +0 -18
  52. package/dist/npm/events/PreventableEvent.js +0 -31
  53. package/dist/npm/events/SortableOnDragEndEvent.js +0 -19
  54. package/dist/npm/events/SortableOnDragOverEvent.js +0 -19
  55. package/dist/npm/events/SortableOnDragStartEvent.js +0 -37
  56. package/dist/npm/events/SortableOnNavigateEvent.d.ts +0 -27
  57. package/dist/npm/events/SortableOnNavigateEvent.js +0 -19
  58. package/dist/npm/interfaces/SortableDefaultProps.d.ts +0 -25
  59. package/dist/npm/interfaces/SortableDefaultProps.js +0 -2
  60. package/dist/npm/interfaces/SortableEmptyItemUIProps.d.ts +0 -9
  61. package/dist/npm/interfaces/SortableEmptyItemUIProps.js +0 -2
  62. package/dist/npm/interfaces/SortableItemUIProps.js +0 -2
  63. package/dist/npm/interfaces/SortableProps.d.ts +0 -60
  64. package/dist/npm/interfaces/SortableProps.js +0 -2
  65. package/dist/npm/main.d.ts +0 -9
  66. package/dist/npm/main.js +0 -13
  67. package/dist/npm/messages/index.d.ts +0 -10
  68. package/dist/npm/messages/index.js +0 -14
  69. package/dist/npm/package-metadata.d.ts +0 -5
  70. package/dist/npm/package-metadata.js +0 -14
  71. package/dist/npm/utils/utils.js +0 -93
  72. package/dist/systemjs/kendo-react-sortable.js +0 -1
  73. package/e2e-next/basic.tests.ts +0 -23
package/index.mjs ADDED
@@ -0,0 +1,485 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as p from "react";
6
+ import * as U from "react-dom";
7
+ import * as h from "prop-types";
8
+ import { hasRelativeStackingContext as M, getter as x, getActiveElement as O, Keys as f, getTabIndex as P, validatePackage as B, Draggable as F } from "@progress/kendo-react-common";
9
+ import { provideLocalizationService as k, registerForLocalization as L } from "@progress/kendo-react-intl";
10
+ class K {
11
+ constructor() {
12
+ this.prevented = !1;
13
+ }
14
+ /* eslint-disable max-len */
15
+ /**
16
+ * Prevents the default action for a specified event.
17
+ * In this way, the source component suppresses the built-in behavior that follows the event.
18
+ */
19
+ preventDefault() {
20
+ this.prevented = !0;
21
+ }
22
+ /**
23
+ * Returns `true` if the event was prevented by any of its subscribers.
24
+ *
25
+ * @returns - Returns `true` if the default action was prevented.
26
+ * Otherwise, returns `false`.
27
+ */
28
+ isDefaultPrevented() {
29
+ return this.prevented;
30
+ }
31
+ }
32
+ class X extends K {
33
+ /**
34
+ * @hidden
35
+ */
36
+ constructor(n, t, e) {
37
+ super(), this.target = n, this.prevIndex = t, this.element = e;
38
+ }
39
+ }
40
+ class Y {
41
+ /**
42
+ * @hidden
43
+ */
44
+ constructor(n, t, e, s) {
45
+ this.target = n, this.prevIndex = t, this.nextIndex = e, this.newState = s;
46
+ }
47
+ }
48
+ class _ {
49
+ /**
50
+ * @hidden
51
+ */
52
+ constructor(n, t, e, s) {
53
+ this.target = n, this.prevIndex = t, this.nextIndex = e, this.newState = s;
54
+ }
55
+ }
56
+ class z {
57
+ /**
58
+ * @hidden
59
+ */
60
+ constructor(n, t, e, s) {
61
+ this.target = n, this.prevIndex = t, this.nextIndex = e, this.newState = s;
62
+ }
63
+ }
64
+ const S = "sortable.noData", W = {
65
+ [S]: "No Data"
66
+ }, H = (o, n) => {
67
+ for (let t = 0; t < o.length; t++)
68
+ if (n(o[t]))
69
+ return o[t];
70
+ }, C = (o, n) => {
71
+ for (let t = 0; t < o.length; t++)
72
+ if (n(o[t]))
73
+ return t;
74
+ return -1;
75
+ }, w = (o) => String(o).trim().split(" "), q = (o, n) => {
76
+ const t = w(n);
77
+ return !!w(o.className).find((e) => t.indexOf(e) >= 0);
78
+ }, G = /^(?:a|input|select|option|textarea|button|object)$/i, $ = (o) => {
79
+ if (o.tagName) {
80
+ const n = o.tagName.toLowerCase(), t = o.getAttribute("tabIndex"), e = t === "-1";
81
+ let s = t !== null && !e;
82
+ return G.test(n) && (s = !o.disabled && !e), s;
83
+ }
84
+ return !1;
85
+ }, j = (o, n) => {
86
+ for (; o && !n(o); )
87
+ o = o.parentNode;
88
+ return o;
89
+ }, V = M(), J = (o) => {
90
+ if (!o || !V)
91
+ return null;
92
+ let n = o.parentElement;
93
+ for (; n; ) {
94
+ if (window.getComputedStyle(n).transform !== "none")
95
+ return n;
96
+ n = n.parentElement;
97
+ }
98
+ }, Q = {
99
+ name: "@progress/kendo-react-sortable",
100
+ productName: "KendoReact",
101
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
102
+ publishDate: 1700573232,
103
+ version: "",
104
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
105
+ }, y = 200, D = "data-sortable-id", A = "data-sortable-component", Z = { [A]: !0 };
106
+ class E extends p.Component {
107
+ constructor(n) {
108
+ super(n), this.state = {
109
+ clientX: 0,
110
+ clientY: 0,
111
+ isDragging: !1,
112
+ activeId: "",
113
+ dragCueWidth: 0,
114
+ dragCueHeight: 0
115
+ }, this.isRtl = !1, this.itemRefsMap = {}, this.oldSizesMap = {}, this.animatingItemMap = {}, this.draggableRef = null, this.isUnmounted = !1, this.focusActiveId = !1, this.isKeyboardNavigated = !1, this.isDragPrevented = !1, this.swapItems = (t, e, s) => {
116
+ let i = t[e];
117
+ return t[e] = t[s], t[s] = i, e = s, e;
118
+ }, this.generateNewState = (t, e) => {
119
+ const { data: s } = this.props, i = [...s];
120
+ if (t > e)
121
+ for (let l = t - 1; l >= e; l--) {
122
+ const c = s[l];
123
+ this.isItemDisabled(c) || (t = this.swapItems(i, t, l));
124
+ }
125
+ else
126
+ for (let l = t + 1; l <= e; l++) {
127
+ const c = s[l];
128
+ this.isItemDisabled(c) || (t = this.swapItems(i, t, l));
129
+ }
130
+ return i;
131
+ }, this.closestSortableItem = (t) => {
132
+ let e = t;
133
+ for (; e; ) {
134
+ const s = e.getAttribute(D);
135
+ if (s && this.itemRefsMap[s] === e)
136
+ return {
137
+ id: s,
138
+ element: e
139
+ };
140
+ e = e.parentElement;
141
+ }
142
+ return {
143
+ id: "",
144
+ element: null
145
+ };
146
+ }, this.isSortable = (t) => !!t.hasAttribute(A), this.closestSortable = (t) => {
147
+ let e = t;
148
+ for (; e; ) {
149
+ if (this.isSortable(e))
150
+ return e;
151
+ e = e.parentElement;
152
+ }
153
+ return null;
154
+ }, this.isSameSortable = (t) => this.closestSortable(t) === this.container, this.idComparer = (t, e) => t + "" == e + "", this.findItem = (t) => {
155
+ const { data: e, idField: s } = this.props;
156
+ if (!(t + ""))
157
+ return;
158
+ const i = x(s);
159
+ return H(e, (r) => this.idComparer(i(r), t));
160
+ }, this.findIndex = (t) => {
161
+ const { data: e, idField: s } = this.props;
162
+ return t + "" ? C(e, (i) => this.idComparer(i[s], t)) : -1;
163
+ }, this.isItemDisabled = (t) => t && t[this.props.disabledField || ""] === !0, this.shouldResetActive = () => {
164
+ const t = O(document);
165
+ return t instanceof HTMLElement ? !this.closestSortableItem(t).element : !1;
166
+ }, this.widgetTarget = (t) => {
167
+ const e = j(t, (s) => q(s, "k-widget") || this.isSortable(s));
168
+ return e && !this.isSortable(e);
169
+ }, this.allowDrag = (t) => t.hasAttribute(D) || !($(t) || this.widgetTarget(t)), this.onDragStart = (t) => {
170
+ const { event: e } = t, { onDragStart: s } = this.props, i = document.elementFromPoint(e.clientX, e.clientY), { id: r, element: l } = this.closestSortableItem(i), c = this.findItem(r);
171
+ if (!r || c && this.isItemDisabled(c) || !this.allowDrag(i) || !this.isSameSortable(i)) {
172
+ this.isDragPrevented = !0;
173
+ return;
174
+ }
175
+ e.isTouch && e.originalEvent.preventDefault();
176
+ const a = new X(
177
+ this,
178
+ this.findIndex(r),
179
+ i
180
+ );
181
+ s && s.call(void 0, a), this.isDragPrevented = a.isDefaultPrevented(), this.isDragPrevented ? e.originalEvent.preventDefault() : (this.offsetParent = J(this.container), this.setState({
182
+ activeId: r,
183
+ dragCueWidth: l && l.clientWidth || 0,
184
+ dragCueHeight: l && l.clientHeight || 0
185
+ }));
186
+ }, this.onDragOver = (t) => {
187
+ const { event: e } = t, { onDragOver: s, data: i } = this.props;
188
+ if (this.isDragPrevented)
189
+ return;
190
+ e.originalEvent.preventDefault();
191
+ const r = this.findIndex(this.state.activeId);
192
+ if (r === -1) {
193
+ this.resetState();
194
+ return;
195
+ }
196
+ const l = document.elementFromPoint(e.clientX, e.clientY), c = this.closestSortableItem(l), a = this.findIndex(c.id), d = i[a];
197
+ if (s && a > -1 && r !== a && !this.isItemDisabled(d) && !this.animatingItemMap[c.id] && this.shouldReorder(c.element, e.clientX, e.clientY)) {
198
+ const m = new Y(
199
+ this,
200
+ r,
201
+ a,
202
+ this.generateNewState(r, a)
203
+ );
204
+ s.call(void 0, m);
205
+ }
206
+ const g = this.parentOffset();
207
+ this.setState({
208
+ clientX: e.clientX - g.left,
209
+ clientY: e.clientY - g.top,
210
+ isDragging: !0
211
+ });
212
+ }, this.onDragEnd = (t) => {
213
+ const { event: e } = t, s = this.shouldResetActive();
214
+ if (this.isDragPrevented)
215
+ return;
216
+ const { onDragEnd: i, data: r } = this.props, l = document.elementFromPoint(e.clientX, e.clientY), c = this.closestSortableItem(l);
217
+ let a = this.findIndex(c.id), d = this.findIndex(this.state.activeId);
218
+ const g = this.isItemDisabled(r[a]);
219
+ if ((a === -1 || g) && (a = d), i) {
220
+ let m = this.generateNewState(d, a);
221
+ if (!g) {
222
+ const u = this.thresholdRect(c.element);
223
+ if (u && (e.clientX < u.left || e.clientX > u.right || e.clientY < u.top || e.clientY > u.bottom)) {
224
+ const b = d;
225
+ d = a, a = b, m = this.props.data.slice();
226
+ }
227
+ }
228
+ const I = new _(
229
+ this,
230
+ d,
231
+ a,
232
+ m
233
+ );
234
+ i.call(void 0, I);
235
+ }
236
+ this.resetState(s);
237
+ }, this.shouldReorder = (t, e, s) => {
238
+ const i = this.thresholdRect(t);
239
+ return i && e > i.left && e < i.right && s > i.top && s < i.bottom;
240
+ }, this.thresholdRect = (t) => {
241
+ const e = this.state.activeId, s = this.container, r = (s ? Array.from(s.childNodes) : []).find(
242
+ (u) => u instanceof HTMLElement && u.getAttribute(D) === e
243
+ );
244
+ if (!t || !r)
245
+ return null;
246
+ const { width: l, height: c } = r.getBoundingClientRect(), a = t.getBoundingClientRect(), d = a.top + a.height / 2 - c / 2, g = a.left + a.width / 2 - l / 2, m = d + c, I = g + l;
247
+ return { top: d, left: g, bottom: m, right: I };
248
+ }, this.onItemBlur = () => {
249
+ window.setTimeout(() => {
250
+ this.isUnmounted || this.shouldResetActive() && !this.state.isDragging && this.setState({
251
+ activeId: ""
252
+ // what happends on destroyed component
253
+ });
254
+ });
255
+ }, this.onItemFocus = (t) => {
256
+ const { id: e, element: s } = this.closestSortableItem(t.currentTarget);
257
+ !this.idComparer(e, this.state.activeId) && this.isSameSortable(t.target) && s === t.target && this.setState({
258
+ activeId: e
259
+ });
260
+ }, this.onKeyDown = (t) => {
261
+ const { data: e, idField: s, onNavigate: i, navigation: r } = this.props, { activeId: l } = this.state;
262
+ if (!r || !l || !this.isSameSortable(t.target))
263
+ return;
264
+ const c = this.isRtl, a = e.filter((v) => !this.isItemDisabled(v)), d = C(a, (v) => this.idComparer(v[s], l)), g = a.length - 1;
265
+ let m = d;
266
+ switch (t.keyCode === f.left && (c ? t.keyCode = f.down : t.keyCode = f.up), t.keyCode === f.right && (c ? t.keyCode = f.up : t.keyCode = f.down), t.keyCode) {
267
+ case f.up:
268
+ d > 0 && (m = d - 1);
269
+ break;
270
+ case f.down:
271
+ d < g && (m = d + 1);
272
+ break;
273
+ }
274
+ if (m === d)
275
+ return;
276
+ t.stopPropagation(), t.preventDefault();
277
+ const I = a[m], u = I ? I[s] : "", b = a[d], N = b ? b[s] : "";
278
+ if (t.ctrlKey) {
279
+ if (i) {
280
+ const v = this.findIndex(N), R = this.findIndex(u), T = new z(
281
+ this,
282
+ v,
283
+ R,
284
+ this.generateNewState(v, R)
285
+ );
286
+ this.isKeyboardNavigated = !0, i.call(void 0, T);
287
+ }
288
+ } else
289
+ this.focusActiveId = !0, this.setState({
290
+ activeId: u + ""
291
+ });
292
+ }, this.resetState = (t) => {
293
+ this.isDragPrevented = !1, this.setState({
294
+ clientX: 0,
295
+ clientY: 0,
296
+ isDragging: !1,
297
+ dragCueWidth: 0,
298
+ dragCueHeight: 0,
299
+ activeId: t ? "" : this.state.activeId
300
+ });
301
+ }, this.renderData = () => {
302
+ const {
303
+ data: t,
304
+ itemUI: e,
305
+ idField: s,
306
+ tabIndex: i
307
+ } = this.props;
308
+ return t.map((r) => {
309
+ const c = x(s)(r), a = this.isItemDisabled(r), d = this.idComparer(this.state.activeId, c);
310
+ return /* @__PURE__ */ p.createElement(
311
+ e,
312
+ {
313
+ key: c,
314
+ forwardRef: (g) => this.refAssign(g, c),
315
+ dataItem: r,
316
+ isDisabled: a,
317
+ isActive: d,
318
+ isDragged: d && this.state.isDragging,
319
+ isDragCue: !1,
320
+ attributes: {
321
+ [D]: c,
322
+ ["aria-disabled"]: a,
323
+ ["aria-grabbed"]: d && this.state.isDragging && !this.isDragPrevented,
324
+ ["aria-dropeffect"]: a ? "none" : "move",
325
+ tabIndex: P(i, a),
326
+ onFocus: this.onItemFocus,
327
+ onBlur: this.onItemBlur
328
+ },
329
+ style: {
330
+ cursor: a ? "auto" : "move",
331
+ MozUserSelect: "none",
332
+ msUserSelect: "none",
333
+ WebkitUserSelect: "none",
334
+ userSelect: "none"
335
+ }
336
+ }
337
+ );
338
+ });
339
+ }, this.renderNoData = () => {
340
+ const { emptyItemUI: t } = this.props, s = k(this).toLanguageString(S, W[S]);
341
+ if (t)
342
+ return /* @__PURE__ */ p.createElement(t, { message: s });
343
+ }, this.renderDragCue = () => {
344
+ const { itemUI: t } = this.props, { isDragging: e, activeId: s, clientX: i, clientY: r } = this.state, l = this.findItem(s);
345
+ if (!(!e || !l))
346
+ return /* @__PURE__ */ p.createElement(
347
+ t,
348
+ {
349
+ dataItem: l,
350
+ isDisabled: !1,
351
+ isActive: !0,
352
+ isDragged: !0,
353
+ isDragCue: !0,
354
+ style: {
355
+ position: "fixed",
356
+ top: r + 10,
357
+ left: i + 10,
358
+ width: this.state.dragCueWidth,
359
+ height: this.state.dragCueHeight
360
+ },
361
+ attributes: {}
362
+ }
363
+ );
364
+ }, this.refAssign = (t, e) => {
365
+ t ? this.itemRefsMap[e] = t : delete this.itemRefsMap[e];
366
+ }, this.draggableRefAssign = (t) => {
367
+ this.draggableRef = t;
368
+ }, B(Q);
369
+ }
370
+ get container() {
371
+ return this.draggableRef && this.draggableRef.element;
372
+ }
373
+ /**
374
+ * @hidden
375
+ */
376
+ getSnapshotBeforeUpdate() {
377
+ const { idField: n, animation: t } = this.props;
378
+ return this.oldSizesMap = {}, t && this.props.data.forEach((e) => {
379
+ const s = e[n], i = this.itemRefsMap[s], r = U.findDOMNode(i);
380
+ r && (this.oldSizesMap[s] = r.getBoundingClientRect());
381
+ }), null;
382
+ }
383
+ /**
384
+ * @hidden
385
+ */
386
+ componentDidUpdate(n) {
387
+ const { idField: t, animation: e } = this.props;
388
+ this.focusActiveId && (this.focusActiveId = !1, this.itemRefsMap[this.state.activeId].focus()), !(!e || !this.state.isDragging && !this.isKeyboardNavigated) && (this.isKeyboardNavigated = !1, n.data.forEach((s) => {
389
+ const i = s[t], r = this.itemRefsMap[i];
390
+ if (!r)
391
+ return;
392
+ const l = r.getBoundingClientRect(), c = this.oldSizesMap[i], a = c.left - l.left, d = c.top - l.top;
393
+ a === 0 && d === 0 || requestAnimationFrame(() => {
394
+ this.animatingItemMap[i] = !0, r.style.transform = `translate(${a}px, ${d}px)`, r.style.transition = "transform 0s", requestAnimationFrame(() => {
395
+ r.style.transform = "", r.style.transition = `transform ${y}ms cubic-bezier(0.2, 0, 0, 1) 0s`, window.setTimeout(() => this.animatingItemMap[i] = !1, y);
396
+ });
397
+ });
398
+ }));
399
+ }
400
+ /**
401
+ * @hidden
402
+ */
403
+ componentDidMount() {
404
+ this.isRtl = this.container && getComputedStyle(this.container).direction === "rtl" || !1;
405
+ }
406
+ /**
407
+ * @hidden
408
+ */
409
+ componentWillUnmount() {
410
+ this.isUnmounted = !0;
411
+ }
412
+ /**
413
+ * @hidden
414
+ */
415
+ parentOffset() {
416
+ const n = this.offsetParent;
417
+ if (n && n.ownerDocument && n !== n.ownerDocument.body) {
418
+ const t = n.getBoundingClientRect();
419
+ return {
420
+ left: t.left - n.scrollLeft,
421
+ top: t.top - n.scrollTop
422
+ };
423
+ }
424
+ return { left: 0, top: 0 };
425
+ }
426
+ /**
427
+ * @hidden
428
+ */
429
+ render() {
430
+ const { data: n, style: t, className: e, itemsWrapUI: s } = this.props, i = s || "div";
431
+ return /* @__PURE__ */ p.createElement(
432
+ F,
433
+ {
434
+ onDragStart: this.onDragStart,
435
+ onDrag: this.onDragOver,
436
+ onDragEnd: this.onDragEnd,
437
+ ref: this.draggableRefAssign
438
+ },
439
+ /* @__PURE__ */ p.createElement(
440
+ i,
441
+ {
442
+ ...Z,
443
+ className: e,
444
+ style: {
445
+ touchAction: "none",
446
+ ...t
447
+ },
448
+ onKeyDown: this.onKeyDown
449
+ },
450
+ n && n.length ? this.renderData() : this.renderNoData(),
451
+ this.renderDragCue()
452
+ )
453
+ );
454
+ }
455
+ }
456
+ E.defaultProps = {
457
+ navigation: !0,
458
+ animation: !0,
459
+ emptyItemUI: (o) => /* @__PURE__ */ p.createElement("div", null, o.message)
460
+ };
461
+ E.propTypes = {
462
+ idField: h.string.isRequired,
463
+ disabledField: h.string,
464
+ data: h.array.isRequired,
465
+ tabIndex: h.number,
466
+ navigation: h.bool,
467
+ animation: h.bool,
468
+ itemsWrapUI: h.any,
469
+ itemUI: h.func.isRequired,
470
+ emptyItemUI: h.func,
471
+ style: h.object,
472
+ className: h.string,
473
+ onDragStart: h.func,
474
+ onDragOver: h.func,
475
+ onDragEnd: h.func,
476
+ onNavigate: h.func
477
+ };
478
+ L(E);
479
+ export {
480
+ E as Sortable,
481
+ _ as SortableOnDragEndEvent,
482
+ Y as SortableOnDragOverEvent,
483
+ X as SortableOnDragStartEvent,
484
+ z as SortableOnNavigateEvent
485
+ };
@@ -1,4 +1,7 @@
1
- /// <reference types="react" />
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
2
5
  import { SortableEmptyItemUIProps } from './SortableEmptyItemUIProps';
3
6
  /**
4
7
  * @hidden
@@ -0,0 +1,13 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Represents the props of the UI component that is rendered when no data is available.
7
+ */
8
+ export interface SortableEmptyItemUIProps {
9
+ /**
10
+ * The `noData` localization message.
11
+ */
12
+ message: string;
13
+ }
@@ -1,4 +1,7 @@
1
- /// <reference types="react" />
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
2
5
  /**
3
6
  * Represents the props of the Sortable item UI component.
4
7
  */
@@ -1,4 +1,7 @@
1
- /// <reference types="react" />
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
2
5
  import { SortableOnDragStartEvent } from './../events/SortableOnDragStartEvent';
3
6
  import { SortableOnDragOverEvent } from './../events/SortableOnDragOverEvent';
4
7
  import { SortableOnDragEndEvent } from './../events/SortableOnDragEndEvent';
@@ -0,0 +1,14 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare const noData = "sortable.noData";
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const messages: {
13
+ "sortable.noData": string;
14
+ };
@@ -0,0 +1,9 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import { PackageMetadata } from '@progress/kendo-licensing';
6
+ /**
7
+ * @hidden
8
+ */
9
+ export declare const packageMetadata: PackageMetadata;
package/package.json CHANGED
@@ -1,22 +1,29 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-sortable",
3
- "version": "6.1.1",
3
+ "version": "7.0.0-develop.2",
4
4
  "description": "React Sortable provides a sortable drag-and-drop functionality to elements within a list. KendoReact Sortable package",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/telerik/kendo-react.git"
5
+ "author": "Progress",
6
+ "license": "SEE LICENSE IN LICENSE.md",
7
+ "homepage": "https://www.telerik.com/kendo-react-ui",
8
+ "main": "./index.js",
9
+ "types": "./index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./index.mjs",
13
+ "require": "./index.js"
14
+ }
8
15
  },
9
- "main": "dist/npm/main.js",
10
- "types": "dist/npm/main.d.ts",
11
- "module": "dist/es/main.js",
12
- "jsnext:main": "dist/es/main.js",
13
- "scripts": {
14
- "test": "cd ../../ && npm run test -- --testPathPattern=/packages/sortable/.*",
15
- "e2e": "cd ../../ && npx jest --maxWorkers=4 --config jest.e2e.js packages/sortable/e2e/",
16
- "start": "gulp start",
17
- "build-package": "gulp build-package"
16
+ "sideEffects": false,
17
+ "peerDependencies": {
18
+ "@progress/kendo-licensing": "^1.3.0",
19
+ "@progress/kendo-react-common": "7.0.0-develop.2",
20
+ "@progress/kendo-react-intl": "7.0.0-develop.2",
21
+ "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
22
+ "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
23
+ },
24
+ "dependencies": {
25
+ "prop-types": "^15.6.0"
18
26
  },
19
- "homepage": "https://www.telerik.com/kendo-react-ui",
20
27
  "keywords": [
21
28
  "Kendo UI",
22
29
  "React",
@@ -29,32 +36,15 @@
29
36
  "React component",
30
37
  "Telerik"
31
38
  ],
32
- "peerDependencies": {
33
- "@progress/kendo-licensing": "^1.3.0",
34
- "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
35
- "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
36
- },
37
- "dependencies": {
38
- "@progress/kendo-react-common": "6.1.1",
39
- "prop-types": "^15.6.0"
40
- },
41
- "devDependencies": {
42
- "@progress/kendo-licensing": "^1.3.0",
43
- "@progress/kendo-react-dateinputs": "6.1.1",
44
- "@progress/kendo-react-form": "6.1.1",
45
- "@progress/kendo-react-grid": "6.1.1",
46
- "@progress/kendo-react-inputs": "6.1.1",
47
- "@progress/kendo-react-intl": "6.1.1",
48
- "@progress/kendo-react-labels": "6.1.1"
49
- },
50
39
  "@progress": {
51
40
  "friendlyName": "Sortable",
52
41
  "framework": "KendoReact"
53
42
  },
54
- "author": "Progress",
55
- "license": "SEE LICENSE IN LICENSE.md",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/telerik/kendo-react.git"
46
+ },
56
47
  "publishConfig": {
57
48
  "access": "public"
58
- },
59
- "sideEffects": false
60
- }
49
+ }
50
+ }
@@ -1,3 +1,7 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
1
5
  /**
2
6
  * @hidden
3
7
  */
package/about.md DELETED
@@ -1,3 +0,0 @@
1
- <a href="https://www.telerik.com/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-sortable&utm_content=banner" target="_blank">
2
- <img src="https://www.telerik.com/kendo-react-ui/components/npm-banner.svg" alt="KendoReact NPM Banner">
3
- </a>