funda-ui 4.7.723 → 4.7.730

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.
@@ -926,6 +926,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
926
926
  dragHandleSelector = _options$dragHandleSe === void 0 ? '.custom-draggable-list__handle' : _options$dragHandleSe,
927
927
  onDragStart = options.onDragStart,
928
928
  onDragOver = options.onDragOver,
929
+ onDragUpdate = options.onDragUpdate,
929
930
  onDragEnd = options.onDragEnd;
930
931
  var _useState = (0, react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
931
932
  _useState2 = _slicedToArray(_useState, 2),
@@ -934,11 +935,35 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
934
935
  var dragItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
935
936
  var dragOverItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
936
937
  var dragNode = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
938
+ var draggedElement = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
939
+ var boundaryElement = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
937
940
  var touchOffset = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
938
941
  x: 0,
939
942
  y: 0
940
943
  });
941
944
  var currentHoverItem = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
945
+ var rafId = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
946
+ var lastUpdateDragIndex = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
947
+ var lastUpdateDropIndex = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
948
+
949
+ /**
950
+ * Performance Note:
951
+ *
952
+ * Drag-over events can fire at a very high frequency, especially on touch devices
953
+ * or when dragging quickly. Directly performing DOM read/write operations in the
954
+ * event handler (e.g. `getBoundingClientRect`, `classList` changes, style updates)
955
+ * can easily cause layout thrashing and frame drops when there are many items.
956
+ *
957
+ * To mitigate this, we:
958
+ * - Collect the pointer coordinates synchronously in the event handler.
959
+ * - Schedule all DOM-intensive work inside `requestAnimationFrame`, so the browser
960
+ * batches these operations before the next paint.
961
+ * - Cancel any pending frame (`cancelAnimationFrame`) before scheduling a new one,
962
+ * ensuring there is at most one pending DOM update per frame.
963
+ *
964
+ * This keeps drag interactions smooth even with large lists.
965
+ */
966
+
942
967
  var handleDragStart = function handleDragStart(e, position) {
943
968
  var isTouch = ('touches' in e);
944
969
  var target = e.target;
@@ -991,69 +1016,127 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
991
1016
  opacity: '0.9'
992
1017
  });
993
1018
  document.body.appendChild(dragNode.current);
1019
+
1020
+ // Keep track of the original element (acts as a placeholder inside the list)
1021
+ draggedElement.current = listItem;
1022
+ boundaryElement.current = boundary;
994
1023
  setIsDragging(true);
995
1024
  listItem.classList.add('dragging-placeholder');
996
1025
  } else {
997
- // ... desktop drag logic remains the same ...
1026
+ // Desktop: use native drag image, but still record dragged element / boundary
1027
+ draggedElement.current = listItem;
1028
+ boundaryElement.current = boundary;
1029
+ setIsDragging(true);
1030
+ var dragEvent = e;
1031
+ if (dragEvent.dataTransfer) {
1032
+ dragEvent.dataTransfer.effectAllowed = 'move';
1033
+ // Optional: customize drag preview if needed
1034
+ dragEvent.dataTransfer.setData('text/plain', '');
1035
+ }
1036
+ listItem.classList.add('dragging-placeholder');
998
1037
  }
999
1038
  };
1000
1039
  var handleDragOver = function handleDragOver(e) {
1040
+ // Always prevent default synchronously
1001
1041
  e.preventDefault();
1002
1042
  var isTouch = ('touches' in e);
1003
1043
  if (!isTouch) {
1004
1044
  e.dataTransfer.dropEffect = 'move';
1005
1045
  }
1006
1046
 
1007
- // Get the current pointer/touch position
1008
- var point = isTouch ? e.touches[0] : {
1009
- clientX: e.clientX,
1010
- clientY: e.clientY
1011
- };
1047
+ // Extract primitive coordinates synchronously to avoid using pooled events in async callbacks
1048
+ var clientX;
1049
+ var clientY;
1050
+ if (isTouch) {
1051
+ var touch = e.touches[0];
1052
+ clientX = touch.clientX;
1053
+ clientY = touch.clientY;
1054
+ } else {
1055
+ clientX = e.clientX;
1056
+ clientY = e.clientY;
1057
+ }
1012
1058
 
1013
- // Update dragged element position for touch events
1014
- if (isTouch && isDragging && dragNode.current) {
1015
- dragNode.current.style.left = "".concat(point.clientX - touchOffset.current.x, "px");
1016
- dragNode.current.style.top = "".concat(point.clientY - touchOffset.current.y, "px");
1059
+ // Cancel any pending frame to avoid stacking DOM operations
1060
+ if (rafId.current !== null) {
1061
+ cancelAnimationFrame(rafId.current);
1017
1062
  }
1063
+ rafId.current = requestAnimationFrame(function () {
1064
+ // Update dragged element position for touch events
1065
+ if (isTouch && isDragging && dragNode.current) {
1066
+ dragNode.current.style.left = "".concat(clientX - touchOffset.current.x, "px");
1067
+ dragNode.current.style.top = "".concat(clientY - touchOffset.current.y, "px");
1068
+ }
1018
1069
 
1019
- // Find the element below the pointer/touch
1020
- var elemBelow = document.elementFromPoint(point.clientX, point.clientY);
1021
- if (!elemBelow) return;
1070
+ // Find the element below the pointer/touch
1071
+ var elemBelow = document.elementFromPoint(clientX, clientY);
1072
+ if (!elemBelow) return;
1022
1073
 
1023
- // Find the closest list item
1024
- var listItem = elemBelow.closest(itemSelector);
1025
- if (!listItem || listItem === currentHoverItem.current) return;
1074
+ // Find the closest list item
1075
+ var listItem = elemBelow.closest(itemSelector);
1076
+ if (!listItem) return;
1026
1077
 
1027
- // Check boundary
1028
- var boundary = listItem.closest(boundarySelector);
1029
- if (!boundary) return;
1078
+ // Check boundary
1079
+ var boundary = boundaryElement.current || listItem.closest(boundarySelector);
1080
+ if (!boundary) return;
1030
1081
 
1031
- // Update hover states
1032
- if (currentHoverItem.current) {
1033
- currentHoverItem.current.classList.remove('drag-over', 'drag-over-top', 'drag-over-bottom');
1034
- }
1035
- currentHoverItem.current = listItem;
1036
- listItem.classList.add('drag-over');
1037
-
1038
- // Calculate position in list
1039
- var position = Array.from(listItem.parentNode.children).indexOf(listItem);
1040
- dragOverItem.current = position;
1041
-
1042
- // Determine drop position (top/bottom)
1043
- var rect = listItem.getBoundingClientRect();
1044
- var middleY = rect.top + rect.height / 2;
1045
- if (point.clientY < middleY) {
1046
- listItem.classList.add('drag-over-top');
1047
- } else {
1048
- listItem.classList.add('drag-over-bottom');
1049
- }
1050
- onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(dragItem.current, dragOverItem.current);
1082
+ // Update hover states
1083
+ if (currentHoverItem.current && currentHoverItem.current !== listItem) {
1084
+ currentHoverItem.current.classList.remove('drag-over', 'drag-over-top', 'drag-over-bottom');
1085
+ }
1086
+ currentHoverItem.current = listItem;
1087
+ listItem.classList.add('drag-over');
1088
+ var dragEl = draggedElement.current;
1089
+ if (!dragEl || !dragEl.parentNode) return;
1090
+ var container = boundary;
1091
+
1092
+ // Collect current ordered items in the container
1093
+ var children = Array.from(container.querySelectorAll(itemSelector));
1094
+ var currentIndex = children.indexOf(dragEl);
1095
+ var targetIndex = children.indexOf(listItem);
1096
+ if (currentIndex === -1 || targetIndex === -1) return;
1097
+
1098
+ // Determine drop position (top/bottom)
1099
+ var rect = listItem.getBoundingClientRect();
1100
+ var middleY = rect.top + rect.height / 2;
1101
+ listItem.classList.remove('drag-over-top', 'drag-over-bottom');
1102
+ var insertBefore = clientY < middleY ? listItem : listItem.nextElementSibling;
1103
+ if (clientY < middleY) {
1104
+ listItem.classList.add('drag-over-top');
1105
+ } else {
1106
+ listItem.classList.add('drag-over-bottom');
1107
+ }
1108
+
1109
+ // Only move in DOM when the effective position changes
1110
+ if (insertBefore !== dragEl && container.contains(dragEl)) {
1111
+ container.insertBefore(dragEl, insertBefore);
1112
+ }
1113
+
1114
+ // Recompute index after DOM move
1115
+ var reorderedChildren = Array.from(container.querySelectorAll(itemSelector));
1116
+ var newIndex = reorderedChildren.indexOf(dragEl);
1117
+ dragOverItem.current = newIndex;
1118
+ onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(dragItem.current, dragOverItem.current);
1119
+
1120
+ // Only fire onDragUpdate when the (dragIndex, dropIndex) pair actually changes.
1121
+ if (onDragUpdate && (dragItem.current !== lastUpdateDragIndex.current || dragOverItem.current !== lastUpdateDropIndex.current)) {
1122
+ lastUpdateDragIndex.current = dragItem.current;
1123
+ lastUpdateDropIndex.current = dragOverItem.current;
1124
+ onDragUpdate(dragItem.current, dragOverItem.current);
1125
+ }
1126
+ rafId.current = null;
1127
+ });
1051
1128
  };
1052
1129
  var handleDragEnd = function handleDragEnd(e) {
1053
1130
  var isTouch = ('touches' in e);
1054
1131
  if (isTouch && !isDragging) return;
1055
1132
  onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(dragItem.current, dragOverItem.current);
1056
1133
 
1134
+ // Cancel any pending animation frame
1135
+ if (rafId.current !== null) {
1136
+ cancelAnimationFrame(rafId.current);
1137
+ rafId.current = null;
1138
+ }
1139
+
1057
1140
  // Cleanup
1058
1141
  if (dragNode.current) {
1059
1142
  dragNode.current.remove();
@@ -1067,6 +1150,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1067
1150
  currentHoverItem.current = null;
1068
1151
  dragItem.current = null;
1069
1152
  dragOverItem.current = null;
1153
+ draggedElement.current = null;
1154
+ boundaryElement.current = null;
1070
1155
  };
1071
1156
  return {
1072
1157
  isDragging: isDragging,
@@ -1108,7 +1193,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1108
1193
  /******/
1109
1194
  /******/ // The require function
1110
1195
  /******/
1111
- function __nested_webpack_require_54634__(moduleId) {
1196
+ function __nested_webpack_require_59897__(moduleId) {
1112
1197
  /******/ // Check if module is in cache
1113
1198
  /******/var cachedModule = __webpack_module_cache__[moduleId];
1114
1199
  /******/
@@ -1127,7 +1212,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1127
1212
  /******/
1128
1213
  /******/ // Execute the module function
1129
1214
  /******/
1130
- __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_54634__);
1215
+ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_59897__);
1131
1216
  /******/
1132
1217
  /******/ // Flag the module as loaded
1133
1218
  /******/
@@ -1144,14 +1229,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1144
1229
  /******/
1145
1230
  (function () {
1146
1231
  /******/ // getDefaultExport function for compatibility with non-harmony modules
1147
- /******/__nested_webpack_require_54634__.n = function (module) {
1232
+ /******/__nested_webpack_require_59897__.n = function (module) {
1148
1233
  /******/var getter = module && module.__esModule ? /******/function () {
1149
1234
  return module['default'];
1150
1235
  } : /******/function () {
1151
1236
  return module;
1152
1237
  };
1153
1238
  /******/
1154
- __nested_webpack_require_54634__.d(getter, {
1239
+ __nested_webpack_require_59897__.d(getter, {
1155
1240
  a: getter
1156
1241
  });
1157
1242
  /******/
@@ -1165,9 +1250,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1165
1250
  /******/
1166
1251
  (function () {
1167
1252
  /******/ // define getter functions for harmony exports
1168
- /******/__nested_webpack_require_54634__.d = function (exports, definition) {
1253
+ /******/__nested_webpack_require_59897__.d = function (exports, definition) {
1169
1254
  /******/for (var key in definition) {
1170
- /******/if (__nested_webpack_require_54634__.o(definition, key) && !__nested_webpack_require_54634__.o(exports, key)) {
1255
+ /******/if (__nested_webpack_require_59897__.o(definition, key) && !__nested_webpack_require_59897__.o(exports, key)) {
1171
1256
  /******/Object.defineProperty(exports, key, {
1172
1257
  enumerable: true,
1173
1258
  get: definition[key]
@@ -1184,7 +1269,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1184
1269
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
1185
1270
  /******/
1186
1271
  (function () {
1187
- /******/__nested_webpack_require_54634__.o = function (obj, prop) {
1272
+ /******/__nested_webpack_require_59897__.o = function (obj, prop) {
1188
1273
  return Object.prototype.hasOwnProperty.call(obj, prop);
1189
1274
  };
1190
1275
  /******/
@@ -1194,7 +1279,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1194
1279
  /******/
1195
1280
  (function () {
1196
1281
  /******/ // define __esModule on exports
1197
- /******/__nested_webpack_require_54634__.r = function (exports) {
1282
+ /******/__nested_webpack_require_59897__.r = function (exports) {
1198
1283
  /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1199
1284
  /******/Object.defineProperty(exports, Symbol.toStringTag, {
1200
1285
  value: 'Module'
@@ -1213,7 +1298,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1213
1298
  /******/ /* webpack/runtime/node module decorator */
1214
1299
  /******/
1215
1300
  (function () {
1216
- /******/__nested_webpack_require_54634__.nmd = function (module) {
1301
+ /******/__nested_webpack_require_59897__.nmd = function (module) {
1217
1302
  /******/module.paths = [];
1218
1303
  /******/
1219
1304
  if (!module.children) module.children = [];
@@ -1230,30 +1315,30 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1230
1315
  (function () {
1231
1316
  "use strict";
1232
1317
 
1233
- __nested_webpack_require_54634__.r(__webpack_exports__);
1318
+ __nested_webpack_require_59897__.r(__webpack_exports__);
1234
1319
  /* harmony export */
1235
- __nested_webpack_require_54634__.d(__webpack_exports__, {
1320
+ __nested_webpack_require_59897__.d(__webpack_exports__, {
1236
1321
  /* harmony export */"default": function _default() {
1237
1322
  return __WEBPACK_DEFAULT_EXPORT__;
1238
1323
  }
1239
1324
  /* harmony export */
1240
1325
  });
1241
1326
  /* harmony import */
1242
- var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_54634__(787);
1327
+ var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_59897__(787);
1243
1328
  /* harmony import */
1244
- var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_54634__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1329
+ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_59897__.n(react__WEBPACK_IMPORTED_MODULE_0__);
1245
1330
  /* harmony import */
1246
- var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_54634__(438);
1331
+ var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_59897__(438);
1247
1332
  /* harmony import */
1248
- var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__);
1333
+ var funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_59897__.n(funda_utils_dist_cjs_tree__WEBPACK_IMPORTED_MODULE_1__);
1249
1334
  /* harmony import */
1250
- var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_54634__(188);
1335
+ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__ = __nested_webpack_require_59897__(188);
1251
1336
  /* harmony import */
1252
- var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__);
1337
+ var funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__nested_webpack_require_59897__.n(funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__);
1253
1338
  /* harmony import */
1254
- var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_54634__(759);
1339
+ var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__ = __nested_webpack_require_59897__(759);
1255
1340
  /* harmony import */
1256
- var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_54634__.n(funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__);
1341
+ var funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nested_webpack_require_59897__.n(funda_utils_dist_cjs_useBoundedDrag__WEBPACK_IMPORTED_MODULE_3__);
1257
1342
  var _excluded = ["wrapperClassName", "prefix", "data", "draggable", "handleHide", "handleIcon", "handlePos", "dragMode", "editable", "itemStyle", "hierarchical", "indentation", "doubleIndent", "alternateCollapse", "arrow", "renderOption", "onUpdate"];
1258
1343
  function _extends() {
1259
1344
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -1594,6 +1679,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1594
1679
  onDragOver: function onDragOver(dragIndex, dropIndex) {
1595
1680
  // Additional drag over logic if needed
1596
1681
  },
1682
+ onDragUpdate: function onDragUpdate(dragIndex, dropIndex) {
1683
+ // console.log(dragIndex, dropIndex);
1684
+ },
1597
1685
  onDragEnd: function onDragEnd(dragIndex, dropIndex) {
1598
1686
  if (dragIndex !== null && dropIndex !== null && dragIndex !== dropIndex) {
1599
1687
  var _newItems$dragIndex, _newItems$dragIndex2, _newItems$dropIndex;
@@ -1626,12 +1714,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1626
1714
  });
1627
1715
 
1628
1716
  // Calculate new insert position
1717
+ // Directly use dropIndex as the insertion position to avoid items snapping back
1718
+ // when dragging an item from above to directly below its neighbor.
1629
1719
  var insertIndex = dropIndex;
1630
- if (dropIndex > dragIndex) {
1631
- insertIndex -= itemsToMove.length;
1632
- }
1633
1720
 
1634
- // Insert all items
1721
+ // Insert all items (remove first, then insert at the target index;
1722
+ // JavaScript's splice will handle index shifting automatically).
1635
1723
  newItems.splice.apply(newItems, [insertIndex, 0].concat(_toConsumableArray(itemsBeingMoved)));
1636
1724
 
1637
1725
  // Rebuild tree structure
@@ -1744,6 +1832,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1744
1832
  // If the item should be hidden, the rendering is skipped
1745
1833
  if (!shouldShowItem(item)) return null;
1746
1834
 
1835
+ // Item level draggable control, default true when not specified
1836
+ var isItemDraggable = draggable && item.itemDraggable !== false;
1837
+
1747
1838
  // collapse
1748
1839
  var hasChildItems = hasChildren(item.id);
1749
1840
  var isCollapsed = collapsedItems.has(item.id);
@@ -1757,30 +1848,30 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1757
1848
  "data-listitemlabel": item.listItemLabel,
1758
1849
  className: (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.combinedCls)("".concat(prefix, "-draggable-list__item"), (0, funda_utils_dist_cjs_cls__WEBPACK_IMPORTED_MODULE_2__.clsWrite)(dragMode, 'handle'), {
1759
1850
  'disabled': item.disabled,
1760
- 'draggable': draggable,
1851
+ 'draggable': isItemDraggable,
1761
1852
  'editing': editingItem === item.id,
1762
1853
  // collapse
1763
1854
  'has-children': hasChildItems,
1764
1855
  'collapsed': isCollapsed
1765
1856
  }),
1766
- draggable: !draggable ? undefined : editingItem !== item.id && "true",
1767
- onDragStart: !draggable ? undefined : function (e) {
1857
+ draggable: !isItemDraggable ? undefined : editingItem !== item.id && "true",
1858
+ onDragStart: !isItemDraggable ? undefined : function (e) {
1768
1859
  return dragHandlers.handleDragStart(e, index);
1769
1860
  },
1770
- onDragOver: !draggable ? undefined : dragHandlers.handleDragOver,
1771
- onDragEnd: !draggable ? undefined : dragHandlers.handleDragEnd,
1772
- onTouchStart: !draggable ? undefined : function (e) {
1861
+ onDragOver: !isItemDraggable ? undefined : dragHandlers.handleDragOver,
1862
+ onDragEnd: !isItemDraggable ? undefined : dragHandlers.handleDragEnd,
1863
+ onTouchStart: !isItemDraggable ? undefined : function (e) {
1773
1864
  return dragHandlers.handleDragStart(e, index);
1774
1865
  },
1775
- onTouchMove: !draggable ? undefined : dragHandlers.handleDragOver,
1776
- onTouchEnd: !draggable ? undefined : dragHandlers.handleDragEnd,
1866
+ onTouchMove: !isItemDraggable ? undefined : dragHandlers.handleDragOver,
1867
+ onTouchEnd: !isItemDraggable ? undefined : dragHandlers.handleDragEnd,
1777
1868
  style: itemStyle,
1778
1869
  onDoubleClick: function onDoubleClick() {
1779
1870
  return handleDoubleClick(item);
1780
1871
  }
1781
1872
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
1782
1873
  className: "".concat(prefix, "-draggable-list__itemcontent")
1783
- }, renderOption ? renderOption(item, "".concat(prefix, "-draggable-list__handle"), index) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, draggable && !handleHide ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
1874
+ }, renderOption ? renderOption(item, isItemDraggable ? "".concat(prefix, "-draggable-list__handle") : '', index) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, isItemDraggable && !handleHide ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", {
1784
1875
  className: "".concat(prefix, "-draggable-list__handle ").concat(handlePos !== null && handlePos !== void 0 ? handlePos : 'left'),
1785
1876
  draggable: dragMode === 'handle',
1786
1877
  dangerouslySetInnerHTML: {