react-native-tree-multi-select 3.0.0-beta.3 → 3.0.0-beta.4

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 (96) hide show
  1. package/README.md +84 -24
  2. package/lib/module/TreeView.js +36 -31
  3. package/lib/module/TreeView.js.map +1 -1
  4. package/lib/module/components/CheckboxView.js +8 -4
  5. package/lib/module/components/CheckboxView.js.map +1 -1
  6. package/lib/module/components/CustomExpandCollapseIcon.js +2 -2
  7. package/lib/module/components/CustomExpandCollapseIcon.js.map +1 -1
  8. package/lib/module/components/DragOverlay.js +17 -5
  9. package/lib/module/components/DragOverlay.js.map +1 -1
  10. package/lib/module/components/DropIndicator.js +2 -2
  11. package/lib/module/components/DropIndicator.js.map +1 -1
  12. package/lib/module/components/NodeList.js +74 -57
  13. package/lib/module/components/NodeList.js.map +1 -1
  14. package/lib/module/constants/treeView.constants.js +3 -0
  15. package/lib/module/constants/treeView.constants.js.map +1 -1
  16. package/lib/module/helpers/expandCollapse.helper.js.map +1 -1
  17. package/lib/module/helpers/moveTreeNode.helper.js +30 -0
  18. package/lib/module/helpers/moveTreeNode.helper.js.map +1 -1
  19. package/lib/module/helpers/selectAll.helper.js.map +1 -1
  20. package/lib/module/helpers/toggleCheckbox.helper.js +43 -60
  21. package/lib/module/helpers/toggleCheckbox.helper.js.map +1 -1
  22. package/lib/module/hooks/useDragDrop.js +114 -19
  23. package/lib/module/hooks/useDragDrop.js.map +1 -1
  24. package/lib/module/{handlers/ScrollToNodeHandler.js → hooks/useScrollToNode.js} +27 -26
  25. package/lib/module/hooks/useScrollToNode.js.map +1 -0
  26. package/lib/module/index.js +1 -0
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/jest.setup.js +14 -1
  29. package/lib/module/jest.setup.js.map +1 -1
  30. package/lib/module/store/treeView.store.js +3 -0
  31. package/lib/module/store/treeView.store.js.map +1 -1
  32. package/lib/module/utils/typedMemo.js +3 -3
  33. package/lib/module/utils/typedMemo.js.map +1 -1
  34. package/lib/module/utils/useDeepCompareEffect.js +5 -5
  35. package/lib/module/utils/useDeepCompareEffect.js.map +1 -1
  36. package/lib/typescript/src/TreeView.d.ts +3 -3
  37. package/lib/typescript/src/TreeView.d.ts.map +1 -1
  38. package/lib/typescript/src/components/CheckboxView.d.ts +1 -2
  39. package/lib/typescript/src/components/CheckboxView.d.ts.map +1 -1
  40. package/lib/typescript/src/components/CustomExpandCollapseIcon.d.ts +1 -2
  41. package/lib/typescript/src/components/CustomExpandCollapseIcon.d.ts.map +1 -1
  42. package/lib/typescript/src/components/DragOverlay.d.ts +1 -0
  43. package/lib/typescript/src/components/DragOverlay.d.ts.map +1 -1
  44. package/lib/typescript/src/components/DropIndicator.d.ts +1 -2
  45. package/lib/typescript/src/components/DropIndicator.d.ts.map +1 -1
  46. package/lib/typescript/src/components/NodeList.d.ts.map +1 -1
  47. package/lib/typescript/src/constants/treeView.constants.d.ts +2 -0
  48. package/lib/typescript/src/constants/treeView.constants.d.ts.map +1 -1
  49. package/lib/typescript/src/helpers/expandCollapse.helper.d.ts +2 -2
  50. package/lib/typescript/src/helpers/expandCollapse.helper.d.ts.map +1 -1
  51. package/lib/typescript/src/helpers/moveTreeNode.helper.d.ts.map +1 -1
  52. package/lib/typescript/src/helpers/selectAll.helper.d.ts +4 -4
  53. package/lib/typescript/src/helpers/selectAll.helper.d.ts.map +1 -1
  54. package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts +3 -0
  55. package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts.map +1 -1
  56. package/lib/typescript/src/hooks/useDragDrop.d.ts +18 -7
  57. package/lib/typescript/src/hooks/useDragDrop.d.ts.map +1 -1
  58. package/lib/typescript/src/{handlers/ScrollToNodeHandler.d.ts → hooks/useScrollToNode.d.ts} +13 -15
  59. package/lib/typescript/src/hooks/useScrollToNode.d.ts.map +1 -0
  60. package/lib/typescript/src/index.d.ts +4 -3
  61. package/lib/typescript/src/index.d.ts.map +1 -1
  62. package/lib/typescript/src/jest.setup.d.ts +1 -1
  63. package/lib/typescript/src/jest.setup.d.ts.map +1 -1
  64. package/lib/typescript/src/store/treeView.store.d.ts +2 -1
  65. package/lib/typescript/src/store/treeView.store.d.ts.map +1 -1
  66. package/lib/typescript/src/types/dragDrop.types.d.ts +10 -0
  67. package/lib/typescript/src/types/dragDrop.types.d.ts.map +1 -1
  68. package/lib/typescript/src/types/treeView.types.d.ts +69 -41
  69. package/lib/typescript/src/types/treeView.types.d.ts.map +1 -1
  70. package/lib/typescript/src/utils/typedMemo.d.ts +1 -1
  71. package/lib/typescript/src/utils/typedMemo.d.ts.map +1 -1
  72. package/lib/typescript/src/utils/useDeepCompareEffect.d.ts +2 -2
  73. package/lib/typescript/src/utils/useDeepCompareEffect.d.ts.map +1 -1
  74. package/package.json +32 -15
  75. package/src/TreeView.tsx +57 -35
  76. package/src/components/CheckboxView.tsx +7 -4
  77. package/src/components/CustomExpandCollapseIcon.tsx +2 -2
  78. package/src/components/DragOverlay.tsx +19 -6
  79. package/src/components/DropIndicator.tsx +2 -2
  80. package/src/components/NodeList.tsx +83 -59
  81. package/src/constants/treeView.constants.ts +4 -1
  82. package/src/helpers/expandCollapse.helper.ts +5 -5
  83. package/src/helpers/moveTreeNode.helper.ts +33 -0
  84. package/src/helpers/selectAll.helper.ts +10 -10
  85. package/src/helpers/toggleCheckbox.helper.ts +56 -68
  86. package/src/hooks/useDragDrop.ts +152 -30
  87. package/src/{handlers/ScrollToNodeHandler.tsx → hooks/useScrollToNode.ts} +48 -45
  88. package/src/index.tsx +9 -0
  89. package/src/jest.setup.ts +14 -1
  90. package/src/store/treeView.store.ts +6 -1
  91. package/src/types/dragDrop.types.ts +12 -0
  92. package/src/types/treeView.types.ts +76 -43
  93. package/src/utils/typedMemo.ts +3 -3
  94. package/src/utils/useDeepCompareEffect.ts +13 -7
  95. package/lib/module/handlers/ScrollToNodeHandler.js.map +0 -1
  96. package/lib/typescript/src/handlers/ScrollToNodeHandler.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # react-native-tree-multi-select
2
2
 
3
- ⚡️Super-fast Tree view with multi-selection capabilities, using checkboxes and search filtering.
3
+ ⚡️Super-fast Tree view with drag-and-drop reordering, multi-selection capabilities, using checkboxes and search filtering.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/react-native-tree-multi-select)](https://badge.fury.io/js/react-native-tree-multi-select) [![License](https://img.shields.io/github/license/JairajJangle/react-native-tree-multi-select)](https://github.com/JairajJangle/react-native-tree-multi-select/blob/main/LICENSE) [![Workflow Status](https://github.com/JairajJangle/react-native-tree-multi-select/actions/workflows/ci.yml/badge.svg)](https://github.com/JairajJangle/react-native-tree-multi-select/actions/workflows/ci.yml) [![cov](https://raw.githubusercontent.com/JairajJangle/react-native-tree-multi-select/gh-pages/badges/coverage.svg)](https://github.com/JairajJangle/react-native-tree-multi-select/actions/workflows/ci.yml) ![Android](https://img.shields.io/badge/-Android-555555?logo=android&logoColor=3DDC84) ![iOS](https://img.shields.io/badge/-iOS-555555?logo=apple&logoColor=white) ![Web](https://img.shields.io/badge/-Web-555555?logo=google-chrome&logoColor=0096FF) [![GitHub issues](https://img.shields.io/github/issues/JairajJangle/react-native-tree-multi-select)](https://github.com/JairajJangle/react-native-tree-multi-select/issues?q=is%3Aopen+is%3Aissue) ![TS](https://img.shields.io/badge/TypeScript-strict_💪-blue) [![Known Vulnerabilities](https://snyk.io/test/github/jairajjangle/react-native-tree-multi-select/badge.svg)](https://snyk.io/test/github/jairajjangle/react-native-tree-multi-select) [![Expo Snack](https://img.shields.io/badge/Expo%20Snack-555555?style=flat&logo=expo&logoColor=white)](https://snack.expo.dev/@futurejj/react-native-tree-multi-select-example) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-native-tree-multi-select) [![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=flat&logo=github-sponsors)](https://github.com/sponsors/JairajJangle)
6
6
 
@@ -47,6 +47,8 @@ Make sure to follow the native-related installation instructions for these depen
47
47
  - 🔀 **Drag-and-Drop**: Long-press to drag nodes and reorder or nest them anywhere in the tree.
48
48
  - 💻 **Cross-Platform**: Works seamlessly across iOS, Android, and web (with React Native Web).
49
49
 
50
+ > **Note**: Drag-and-drop is currently supported on iOS and Android only. Web support for drag-and-drop is a work in progress.
51
+
50
52
  ## Usage
51
53
 
52
54
  ```tsx
@@ -140,8 +142,9 @@ export function DragDropExample(){
140
142
  data={data}
141
143
  onCheck={(checked, indeterminate) => { /* ... */ }}
142
144
  onExpand={(expanded) => { /* ... */ }}
143
- dragEnabled={true}
144
- onDragEnd={handleDragEnd}
145
+ dragAndDrop={{
146
+ onDragEnd: handleDragEnd,
147
+ }}
145
148
  />
146
149
  );
147
150
  }
@@ -149,7 +152,9 @@ export function DragDropExample(){
149
152
 
150
153
  Long-press a node to start dragging. Drag over other nodes to see drop indicators. Drop above/below to reorder as siblings, or drop inside a parent node to nest it. The tree auto-scrolls when dragging near the edges.
151
154
 
152
- For visual customizations (overlay styles, indicator colors, or fully custom components), see the [`dragDropCustomizations`](#dragdropcustomizationsid) prop.
155
+ **Search + drag**: Drag-and-drop works while a search filter is active. You can drag visible (filtered) nodes and drop them onto other visible nodes. The move is applied to the full tree, so nodes hidden by the filter are not affected. After the drop, the search filter remains active and the view updates to reflect the new tree structure.
156
+
157
+ For visual customizations (overlay styles, indicator colors, or fully custom components), see the [`dragAndDrop.customizations`](#dragdropcustomizationsid) option.
153
158
 
154
159
  ---
155
160
 
@@ -175,14 +180,26 @@ For visual customizations (overlay styles, indicator colors, or fully custom com
175
180
  | `ExpandCollapseIconComponent` | `ComponentType<`[ExpandIconProps](#expandiconprops)`>` | No | A custom expand/collapse icon component |
176
181
  | `ExpandCollapseTouchableComponent` | `ComponentType<`[TouchableOpacityProps](https://reactnative.dev/docs/touchableopacity#props)`>` | No | A custom expand/collapse touchable component |
177
182
  | `CustomNodeRowComponent` | `React.ComponentType<`[NodeRowProps](#noderowpropsid--string)`<ID>>` | No | Custom row item component |
178
- | `dragEnabled` | `boolean` | No | Enable drag-and-drop reordering |
179
- | `onDragEnd` | `(event: `[DragEndEvent](#dragendeventid--string)`<ID>) => void` | No | Callback fired after a node is dropped at a new position |
180
- | `longPressDuration` | `number` | No | Long press duration in ms to start drag (default: 400) |
181
- | `autoScrollThreshold` | `number` | No | Distance from edge (px) to trigger auto-scroll (default: 60) |
182
- | `autoScrollSpeed` | `number` | No | Speed multiplier for auto-scroll (default: 1.0) |
183
- | `dragOverlayOffset` | `number` | No | Overlay offset from the finger, in item-height units (default: -1, i.e. one row above finger) |
184
- | `autoExpandDelay` | `number` | No | Delay in ms before auto-expanding a collapsed node during drag hover (default: 800) |
185
- | `dragDropCustomizations` | [DragDropCustomizations](#dragdropcustomizationsid)`<ID>` | No | Customizations for drag-and-drop visuals (overlay, indicator, opacity) |
183
+ | `dragAndDrop` | [DragAndDropOptions](#draganddropoptionstid--string)`<ID>` | No | Drag-and-drop configuration (see below) |
184
+
185
+ #### DragAndDropOptions`<ID = string>`
186
+
187
+ | Property | Type | Required | Description |
188
+ | --------------------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ |
189
+ | `enabled` | `boolean` | No | Enable drag-and-drop reordering (default: true when `dragAndDrop` is provided). Set to `false` to temporarily disable at runtime. |
190
+ | `onDragStart` | `(event: `[DragStartEvent](#dragstarteventid--string)`<ID>) => void` | No | Callback fired when a drag operation begins |
191
+ | `onDragEnd` | `(event: `[DragEndEvent](#dragendeventid--string)`<ID>) => void` | No | Callback fired after a node is successfully dropped at a new position |
192
+ | `onDragCancel` | `(event: `[DragCancelEvent](#dragcanceleventid--string)`<ID>) => void` | No | Callback fired when a drag is cancelled without a successful drop |
193
+ | `longPressDuration` | `number` | No | Long press duration in ms to start drag (default: 400) |
194
+ | `autoScrollThreshold` | `number` | No | Distance from edge (px) to trigger auto-scroll (default: 60) |
195
+ | `autoScrollSpeed` | `number` | No | Speed multiplier for auto-scroll (default: 1.0) |
196
+ | `dragOverlayOffset` | `number` | No | Overlay offset from the finger, in item-height units (default: -4, i.e. four rows above finger) |
197
+ | `autoExpandDelay` | `number` | No | Delay in ms before auto-expanding a collapsed node during drag hover (default: 800) |
198
+ | `customizations` | [DragDropCustomizations](#dragdropcustomizationsid)`<ID>` | No | Customizations for drag-and-drop visuals (overlay, indicator, opacity) |
199
+ | `canDrop` | `(draggedNode, targetNode, position) => boolean` | No | Callback to determine if a node can be dropped on a specific target |
200
+ | `maxDepth` | `number` | No | Maximum nesting depth allowed. Drops exceeding this are suppressed |
201
+ | `canNodeHaveChildren` | `(node: TreeNode<ID>) => boolean` | No | Callback to determine if a node can accept children |
202
+ | `canDrag` | `(node: TreeNode<ID>) => boolean` | No | Callback to determine if a node can be dragged (default: all nodes) |
186
203
 
187
204
  ##### Notes
188
205
 
@@ -193,7 +210,8 @@ For visual customizations (overlay styles, indicator colors, or fully custom com
193
210
  1. `CheckboxComponent`
194
211
  1. `BuiltInCheckBoxViewStyleProps`
195
212
  1. `ExpandCollapseIconComponent`
196
- 1. `ExpandCollapseTouchableComponent`.
213
+ 1. `ExpandCollapseTouchableComponent`
214
+ 1. `dragAndDrop.customizations.draggedNodeOpacity` / `invalidTargetOpacity` — the custom component receives `isDraggedNode`, `isInvalidDropTarget`, and `isDragging` props and is responsible for its own drag-state visuals.
197
215
 
198
216
  - ⚠️ If the tree view doesn't scroll if rendered in a complex nested scroll view/s then try setting the `renderScrollComponent` value in `treeFlashListProps` to `ScrollView` from `react-native-gesture-handler`.
199
217
 
@@ -227,10 +245,11 @@ For visual customizations (overlay styles, indicator colors, or fully custom com
227
245
  | `expandNodes` | `(ids: ID[]) => void` | Expands specified nodes |
228
246
  | `collapseNodes` | `(ids: ID[]) => void` | Collapses specified nodes |
229
247
  | `selectNodes` | `(ids: ID[]) => void` | Selects specified nodes |
230
- | `unSelectNodes` | `(ids: ID[]) => void` | Unselects specified nodes |
248
+ | `unselectNodes` | `(ids: ID[]) => void` | Unselects specified nodes |
231
249
  | `setSearchText` | `(searchText: string, searchKeys?: string[]) => void` | Set the search text and optionally the search keys. Default search key is "name"<br /><br />Recommended to call this inside a debounced function if you find any performance issue otherwise. |
232
250
  | `scrollToNodeID` | `(params: `[ScrollToNodeParams](#scrolltonodeparams)`<ID>) => void;` | Scrolls the tree view to the node of the specified ID. |
233
251
  | `getChildToParentMap` | `() => Map<ID, ID>` | Get the child to parent tree view map. |
252
+ | `moveNode` | `(nodeId: ID, targetNodeId: ID, position: `[DropPosition](#dropposition)`) => void` | Programmatically move a node to a new position. Works like drag-and-drop without user interaction. Useful for undo/redo or external state management. |
234
253
 
235
254
  #### ScrollToNodeParams
236
255
  | Property | Type | Required | Description |
@@ -311,9 +330,34 @@ Type: `boolean` OR `"indeterminate"`
311
330
  | `isExpanded` | `boolean` | Yes | Whether the node is expanded or not |
312
331
  | `onCheck` | `() => void` | Yes | Function to be called when the checkbox is pressed |
313
332
  | `onExpand` | `() => void` | Yes | Function to be called when the expand button is pressed |
314
- | `isDragTarget` | `boolean` | No | Whether this node is the current drop target during drag |
333
+ | `isInvalidDropTarget` | `boolean` | No | Whether this node is an invalid drop target during drag |
334
+ | `isDropTarget` | `boolean` | No | Whether this node is the current valid drop target |
335
+ | `dropPosition` | `DropPosition` | No | The drop position if this node is the current drop target |
315
336
  | `isDragging` | `boolean` | No | Whether a drag operation is in progress |
316
337
  | `isDraggedNode`| `boolean` | No | Whether this node is the one being dragged |
338
+ | `dragHandleProps`| [DragHandleProps](#draghandleprops) | No | Touch handlers to spread on a drag handle element. Only present when drag-and-drop is enabled. Attach to a specific View to make only that area initiate drag, or spread on the root for whole-row drag. |
339
+
340
+ ---
341
+
342
+ #### DragHandleProps
343
+
344
+ *Touch handlers to spread on a drag handle element within a custom node row.*
345
+
346
+ | Property | Type | Required | Description |
347
+ | -------------- | ------------------- | -------- | ------------------------------ |
348
+ | `onTouchStart` | `(e: any) => void` | Yes | Touch start handler for drag |
349
+ | `onTouchEnd` | `() => void` | Yes | Touch end handler |
350
+ | `onTouchCancel`| `() => void` | Yes | Touch cancel handler |
351
+
352
+ ---
353
+
354
+ #### DragStartEvent`<ID = string>`
355
+
356
+ *The event object passed to the `onDragStart` callback when a drag begins.*
357
+
358
+ | Property | Type | Description |
359
+ | --------------- | --------------------------------------- | ------------------------------------------------------------ |
360
+ | `draggedNodeId` | `ID` | The id of the node being dragged |
317
361
 
318
362
  ---
319
363
 
@@ -328,6 +372,14 @@ Type: `boolean` OR `"indeterminate"`
328
372
  | `position` | [DropPosition](#dropposition) | Where relative to the target: `above`/`below` = sibling, `inside` = child |
329
373
  | `newTreeData` | `TreeNode<ID>[]` | The reordered tree data after the move |
330
374
 
375
+ #### DragCancelEvent`<ID = string>`
376
+
377
+ *The event object passed to the `onDragCancel` callback when a drag is cancelled without a successful drop.*
378
+
379
+ | Property | Type | Description |
380
+ | --------------- | --------------------------------------- | ------------------------------------------------------------ |
381
+ | `draggedNodeId` | `ID` | The id of the node that was being dragged |
382
+
331
383
  #### DropPosition
332
384
 
333
385
  Type: `"above"` | `"below"` | `"inside"`
@@ -340,7 +392,8 @@ Type: `"above"` | `"below"` | `"inside"`
340
392
 
341
393
  | Property | Type | Required | Description |
342
394
  | ------------------------------ | ------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------- |
343
- | `draggedNodeOpacity` | `number` | No | Opacity of the dragged node and invalid targets (default: 0.3) |
395
+ | `draggedNodeOpacity` | `number` | No | Opacity of the node being dragged (default: 0.3) |
396
+ | `invalidTargetOpacity` | `number` | No | Opacity of invalid drop targets during drag (default: 0.3) |
344
397
  | `dropIndicatorStyleProps` | [DropIndicatorStyleProps](#dropindicatorstyleprops) | No | Style props for the built-in drop indicator |
345
398
  | `dragOverlayStyleProps` | [DragOverlayStyleProps](#dragoverlaystyleprops) | No | Style props for the drag overlay (lifted node ghost) |
346
399
  | `CustomDropIndicatorComponent` | `ComponentType<`[DropIndicatorComponentProps](#dropindicatorcomponentprops)`>` | No | Fully custom drop indicator component |
@@ -381,9 +434,11 @@ Type: `"above"` | `"below"` | `"inside"`
381
434
 
382
435
  *Props passed to a custom drop indicator component (when using `CustomDropIndicatorComponent`).*
383
436
 
384
- | Property | Type | Required | Description |
385
- | ---------- | ----------------------------- | -------- | ------------------------------------------------------------ |
386
- | `position` | [DropPosition](#dropposition) | Yes | Whether the indicator is above, below, or inside the target |
437
+ | Property | Type | Required | Description |
438
+ | ------------------------ | ----------------------------- | -------- | ------------------------------------------------------------ |
439
+ | `position` | [DropPosition](#dropposition) | Yes | Whether the indicator is above, below, or inside the target |
440
+ | `level` | `number` | Yes | The nesting level of the target node (useful for indenting) |
441
+ | `indentationMultiplier` | `number` | Yes | Pixels per nesting level |
387
442
 
388
443
  ---
389
444
 
@@ -391,10 +446,11 @@ Type: `"above"` | `"below"` | `"inside"`
391
446
 
392
447
  *Props passed to a custom drag overlay component (when using `CustomDragOverlayComponent`).*
393
448
 
394
- | Property | Type | Required | Description |
395
- | -------- | --------------- | -------- | ------------------------------ |
396
- | `node` | `TreeNode<ID>` | Yes | The node being dragged |
397
- | `level` | `number` | Yes | The nesting level of the node |
449
+ | Property | Type | Required | Description |
450
+ | -------------- | ----------------------------------------- | -------- | ---------------------------------------- |
451
+ | `node` | `TreeNode<ID>` | Yes | The node being dragged |
452
+ | `level` | `number` | Yes | The nesting level of the node |
453
+ | `checkedValue` | [CheckboxValueType](#checkboxvaluetype) | Yes | The current checkbox value of the node |
398
454
 
399
455
  ---
400
456
 
@@ -424,7 +480,7 @@ Moves a node within a tree structure. Returns a new tree (no mutation). Useful i
424
480
  - [x] Ref function to programatically expand/collapse a certain node
425
481
  - [x] Ref function to programatically un/check a certain node
426
482
  - [x] Ref function to auto-scroll to a certain node's position - available in 1.9.0+
427
- - [x] Drag-and-drop reordering with customizable visuals
483
+ - [x] Drag-and-drop reordering with customizable visuals. Can now be done using `dragAndDrop` prop 🎉
428
484
 
429
485
  If you do not see what you want in the planned feature list, raise a feature request.
430
486
 
@@ -459,6 +515,10 @@ MIT
459
515
  <a href="https://www.paypal.com/paypalme/jairajjangle001/usd">
460
516
  <img src=".github/assets/paypal_donate.png" alt="Paypal_Donation_Button" height="50" >
461
517
  </a>
518
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
519
+ <a href="https://github.com/sponsors/JairajJangle">
520
+ <img src=".github/assets/github_sponsor.svg" alt="GitHub_Sponsor_Button" height="50" >
521
+ </a>
462
522
  </p>
463
523
 
464
524
 
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import React, { startTransition, useId } from "react";
3
+ import { forwardRef, startTransition, useCallback, useEffect, useId, useImperativeHandle, useRef } from "react";
4
4
  import NodeList from "./components/NodeList.js";
5
- import { selectAll, selectAllFiltered, unselectAll, unselectAllFiltered, initializeNodeMaps, expandAll, collapseAll, toggleCheckboxes, expandNodes, collapseNodes } from "./helpers/index.js";
6
- import { getTreeViewStore, useTreeViewStore } from "./store/treeView.store.js";
5
+ import { selectAll, selectAllFiltered, unselectAll, unselectAllFiltered, initializeNodeMaps, expandAll, collapseAll, toggleCheckboxes, expandNodes, collapseNodes, recalculateCheckedStates, moveTreeNode } from "./helpers/index.js";
6
+ import { deleteTreeViewStore, getTreeViewStore, useTreeViewStore } from "./store/treeView.store.js";
7
7
  import usePreviousState from "./utils/usePreviousState.js";
8
8
  import { useShallow } from "zustand/react/shallow";
9
9
  import useDeepCompareEffect from "./utils/useDeepCompareEffect.js";
@@ -26,15 +26,9 @@ function _innerTreeView(props, ref) {
26
26
  ExpandCollapseIconComponent,
27
27
  ExpandCollapseTouchableComponent,
28
28
  CustomNodeRowComponent,
29
- dragEnabled,
30
- onDragEnd,
31
- longPressDuration,
32
- autoScrollThreshold,
33
- autoScrollSpeed,
34
- dragOverlayOffset,
35
- autoExpandDelay,
36
- dragDropCustomizations
29
+ dragAndDrop
37
30
  } = props;
31
+ const onDragEnd = dragAndDrop?.onDragEnd;
38
32
  const storeId = useId();
39
33
  const {
40
34
  expanded,
@@ -61,7 +55,7 @@ function _innerTreeView(props, ref) {
61
55
  setSelectionPropagation: state.setSelectionPropagation,
62
56
  cleanUpTreeViewStore: state.cleanUpTreeViewStore
63
57
  })));
64
- React.useImperativeHandle(ref, () => ({
58
+ useImperativeHandle(ref, () => ({
65
59
  selectAll: () => selectAll(storeId),
66
60
  unselectAll: () => unselectAll(storeId),
67
61
  selectAllFiltered: () => selectAllFiltered(storeId),
@@ -74,14 +68,15 @@ function _innerTreeView(props, ref) {
74
68
  unselectNodes: ids => unselectNodes(ids),
75
69
  setSearchText,
76
70
  scrollToNodeID,
77
- getChildToParentMap
71
+ getChildToParentMap,
72
+ moveNode
78
73
  }));
79
- const scrollToNodeHandlerRef = React.useRef(null);
74
+ const scrollToNodeHandlerRef = useRef(null);
80
75
  const prevSearchText = usePreviousState(searchText);
81
- const internalDataRef = React.useRef(null);
76
+ const internalDataRef = useRef(null);
82
77
 
83
78
  // Wrap onDragEnd to set internalDataRef before calling consumer's callback
84
- const wrappedOnDragEnd = React.useCallback(event => {
79
+ const wrappedOnDragEnd = useCallback(event => {
85
80
  internalDataRef.current = event.newTreeData;
86
81
  onDragEnd?.(event);
87
82
  }, [onDragEnd]);
@@ -120,20 +115,33 @@ function _innerTreeView(props, ref) {
120
115
  const treeViewStore = getTreeViewStore(storeId);
121
116
  return treeViewStore.getState().childToParentMap;
122
117
  }
123
- const getIds = React.useCallback(node => {
118
+ function moveNode(nodeId, targetNodeId, position) {
119
+ const store = getTreeViewStore(storeId);
120
+ const currentData = store.getState().initialTreeViewData;
121
+ const newData = moveTreeNode(currentData, nodeId, targetNodeId, position);
122
+ store.getState().updateInitialTreeViewData(newData);
123
+ initializeNodeMaps(storeId, newData);
124
+ recalculateCheckedStates(storeId);
125
+ if (position === "inside") {
126
+ expandNodes(storeId, [targetNodeId]);
127
+ }
128
+ expandNodes(storeId, [nodeId], true);
129
+ internalDataRef.current = newData;
130
+ }
131
+ const getIds = useCallback(node => {
124
132
  if (!node.children || node.children.length === 0) {
125
133
  return [node.id];
126
134
  } else {
127
135
  return [node.id, ...node.children.flatMap(item => getIds(item))];
128
136
  }
129
137
  }, []);
130
- React.useEffect(() => {
138
+ useEffect(() => {
131
139
  onCheck?.(Array.from(checked), Array.from(indeterminate));
132
140
  }, [onCheck, checked, indeterminate]);
133
- React.useEffect(() => {
141
+ useEffect(() => {
134
142
  onExpand?.(Array.from(expanded));
135
143
  }, [onExpand, expanded]);
136
- React.useEffect(() => {
144
+ useEffect(() => {
137
145
  if (searchText) {
138
146
  startTransition(() => {
139
147
  updateExpanded(new Set(initialTreeViewData.flatMap(item => getIds(item))));
@@ -146,11 +154,12 @@ function _innerTreeView(props, ref) {
146
154
  });
147
155
  }
148
156
  }, [getIds, initialTreeViewData, prevSearchText, searchText, updateExpanded]);
149
- React.useEffect(() => {
157
+ useEffect(() => {
150
158
  return () => {
151
159
  cleanUpTreeViewStore();
160
+ deleteTreeViewStore(storeId);
152
161
  };
153
- }, [cleanUpTreeViewStore]);
162
+ }, [cleanUpTreeViewStore, storeId]);
154
163
  return /*#__PURE__*/_jsx(NodeList, {
155
164
  storeId: storeId,
156
165
  scrollToNodeHandlerRef: scrollToNodeHandlerRef,
@@ -162,16 +171,12 @@ function _innerTreeView(props, ref) {
162
171
  ExpandCollapseIconComponent: ExpandCollapseIconComponent,
163
172
  ExpandCollapseTouchableComponent: ExpandCollapseTouchableComponent,
164
173
  CustomNodeRowComponent: CustomNodeRowComponent,
165
- dragEnabled: dragEnabled,
166
- onDragEnd: wrappedOnDragEnd,
167
- longPressDuration: longPressDuration,
168
- autoScrollThreshold: autoScrollThreshold,
169
- autoScrollSpeed: autoScrollSpeed,
170
- dragOverlayOffset: dragOverlayOffset,
171
- autoExpandDelay: autoExpandDelay,
172
- dragDropCustomizations: dragDropCustomizations
174
+ dragAndDrop: dragAndDrop && {
175
+ ...dragAndDrop,
176
+ onDragEnd: wrappedOnDragEnd
177
+ }
173
178
  });
174
179
  }
175
- const _TreeView = /*#__PURE__*/React.forwardRef(_innerTreeView);
180
+ const _TreeView = /*#__PURE__*/forwardRef(_innerTreeView);
176
181
  export const TreeView = typedMemo(_TreeView);
177
182
  //# sourceMappingURL=TreeView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","startTransition","useId","NodeList","selectAll","selectAllFiltered","unselectAll","unselectAllFiltered","initializeNodeMaps","expandAll","collapseAll","toggleCheckboxes","expandNodes","collapseNodes","getTreeViewStore","useTreeViewStore","usePreviousState","useShallow","useDeepCompareEffect","typedMemo","fastIsEqual","jsx","_jsx","_innerTreeView","props","ref","data","onCheck","onExpand","selectionPropagation","preselectedIds","preExpandedIds","initialScrollNodeID","treeFlashListProps","checkBoxViewStyleProps","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","ExpandCollapseTouchableComponent","CustomNodeRowComponent","dragEnabled","onDragEnd","longPressDuration","autoScrollThreshold","autoScrollSpeed","dragOverlayOffset","autoExpandDelay","dragDropCustomizations","storeId","expanded","updateExpanded","initialTreeViewData","updateInitialTreeViewData","searchText","updateSearchText","updateSearchKeys","checked","indeterminate","setSelectionPropagation","cleanUpTreeViewStore","state","useImperativeHandle","ids","selectNodes","unselectNodes","setSearchText","scrollToNodeID","getChildToParentMap","scrollToNodeHandlerRef","useRef","prevSearchText","internalDataRef","wrappedOnDragEnd","useCallback","event","current","newTreeData","text","keys","params","treeViewStore","getState","childToParentMap","getIds","node","children","length","id","flatMap","item","useEffect","Array","from","Set","_TreeView","forwardRef","TreeView"],"sourceRoot":"../../src","sources":["TreeView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,eAAe,EAAEC,KAAK,QAAQ,OAAO;AAMrD,OAAOC,QAAQ,MAAM,0BAAuB;AAC5C,SACCC,SAAS,EACTC,iBAAiB,EACjBC,WAAW,EACXC,mBAAmB,EACnBC,kBAAkB,EAClBC,SAAS,EACTC,WAAW,EACXC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,QACP,oBAAW;AAClB,SAASC,gBAAgB,EAAE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AC,MACI,IAAInB,cAAc,IAAIA,cAAc,KAAK,EAAE,EAAE;MACjD;AACH;MACGrE,eAAe,CAAC,MAAM;QACrBiD,cAAc,CAAC,IAAI2C,GAAG,CAAC,CAAC,CAAC;MAC1B,CAAC,CAAC;IACH;EACD,CAAC,EAAE,CACFV,MAAM,EACNhC,mBAAmB,EACnBmB,cAAc,EACdjB,UAAU,EACVH,cAAc,CACd,CAAC;EAEFlD,KAAK,CAAC0F,SAAS,CAAC,MAAM;IACrB,OAAO,MAAM;MACZ/B,oBAAoB,CAAC,CAAC;IACvB,CAAC;EACF,CAAC,EAAE,CAACA,oBAAoB,CAAC,CAAC;EAE1B,oBACCrC,IAAA,CAACnB,QAAQ;IACR6C,OAAO,EAAEA,OAAQ;IAEjBoB,sBAAsB,EAAEA,sBAAuB;IAC/CpC,mBAAmB,EAAEA,mBAAoB;IAEzCC,kBAAkB,EAAEA,kBAAmB;IACvCC,sBAAsB,EAAEA,sBAAuB;IAC/CC,qBAAqB,EAAEA,qBAAsB;IAE7CC,iBAAiB,EAAEA,iBAAkB;IACrCC,2BAA2B,EAAEA,2BAA4B;IACzDC,gCAAgC,EAAEA,gCAAiC;IAEnEC,sBAAsB,EAAEA,sBAAuB;IAE/CC,WAAW,EAAEA,WAAY;IACzBC,SAAS,EAAE+B,gBAAiB;IAC5B9B,iBAAiB,EAAEA,iBAAkB;IACrCC,mBAAmB,EAAEA,mBAAoB;IACzCC,eAAe,EAAEA,eAAgB;IACjCC,iBAAiB,EAAEA,iBAAkB;IACrCC,eAAe,EAAEA,eAAgB;IACjCC,sBAAsB,EAAEA;EAAuB,CAC/C,CAAC;AAEJ;AAEA,MAAM+C,SAAS,gBAAG9F,KAAK,CAAC+F,UAAU,CAACxE,cAAc,CAEX;AAEtC,OAAO,MAAMyE,QAAQ,GAAG7E,SAAS,CAAmB2E,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","startTransition","useCallback","useEffect","useId","useImperativeHandle","useRef","NodeList","selectAll","selectAllFiltered","unselectAll","unselectAllFiltered","initializeNodeMaps","expandAll","collapseAll","toggleCheckboxes","expandNodes","collapseNodes","recalculateCheckedStates","moveTreeNode","deleteTreeViewStore","getTreeViewStore","useTreeViewStore","usePreviousState","useShallow","useDeepCompareEffect","typedMemo","fastIsEqual","jsx","_jsx","_innerTreeView","props","ref","data","onCheck","onExpand","selectionPropagation","preselectedIds","preExpandedIds","initialScrollNodeID","treeFlashListProps","checkBoxViewStyleProps","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","ExpandCollapseTouchableComponent","CustomNodeRowComponent","dragAndDrop","onDragEnd","storeId","expanded","updateExpanded","initialTreeViewData","updateInitialTreeViewData","searchText","updateSearchText","updateSearchKeys","checked","indeterminate","setSelectionPropagation","cleanUpTreeViewStore","state","ids","selectNodes","unselectNodes","setSearchText","scrollToNodeID","getChildToParentMap","moveNode","scrollToNodeHandlerRef","prevSearchText","internalDataRef","wrappedOnDragEnd","event","current","newTreeData","text","keys","params","treeViewStore","getState","childToParentMap","nodeId","targetNodeId","position","store","currentData","newData","getIds","node","children","length","id","flatMap","item","Array","from","Set","_TreeView","TreeView"],"sourceRoot":"../../src","sources":["TreeView.tsx"],"mappings":";;AAAA,SACCA,UAAU,EACVC,eAAe,EACfC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,mBAAmB,EACnBC,MAAM,QAEA,OAAO;AAMd,OAAOC,QAAQ,MAAM,0BAAuB;AAC5C,SACCC,SAAS,EACTC,iBAAiB,EACjBC,WAAW,EACXC,mBAAmB,EACnBC,kBAAkB,EAClBC,SAAS,EACTC,WAAW,EACXC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,wBAAwB,EACxBC,YAAY,QACN,oBAAW;AAClB,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,2BAAwB;AAChG,OAAOC,gBAAgB,MAAM,6BAA0B;AACvD,SAASC,UAAU,QAAQ,uBAAuB;AAClD,OAAOC,oB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AW,IAAI;MAC3B,GAAGA,WAAW;MACdC,SAAS,EAAEwB;IACZ;EAAE,CACF,CAAC;AAEJ;AAEA,MAAM0B,SAAS,gBAAGlG,UAAU,CAAC8B,cAAc,CAEL;AAEtC,OAAO,MAAMqE,QAAQ,GAAGzE,SAAS,CAAmBwE,SAAS,CAAC","ignoreList":[]}
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import React from "react";
3
+ import { memo, useCallback } from "react";
4
4
  import { Platform, StyleSheet, Text, TouchableOpacity, View } from "react-native";
5
5
  import { Checkbox } from "@futurejj/react-native-checkbox";
6
+
7
+ // Intentionally narrow: only re-render when the checkbox value or label text changes.
8
+ // Other props (callbacks, styles) are stable references from parent memoization.
6
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
10
  function arePropsEqual(prevProps, nextProps) {
8
11
  return prevProps.value === nextProps.value && prevProps.text === nextProps.text;
9
12
  }
10
- export const CheckboxView = /*#__PURE__*/React.memo(_CheckboxView, arePropsEqual);
13
+ export const CheckboxView = /*#__PURE__*/memo(_CheckboxView, arePropsEqual);
11
14
  function _CheckboxView(props) {
12
15
  const {
13
16
  value,
@@ -23,7 +26,7 @@ function _CheckboxView(props) {
23
26
  ellipsizeMode: "middle"
24
27
  }
25
28
  } = props;
26
- const customCheckboxValToCheckboxValType = React.useCallback(customCheckboxValueType => {
29
+ const customCheckboxValToCheckboxValType = useCallback(customCheckboxValueType => {
27
30
  return customCheckboxValueType === "indeterminate" ? "indeterminate" : customCheckboxValueType ? "checked" : "unchecked";
28
31
  }, []);
29
32
 
@@ -33,7 +36,7 @@ function _CheckboxView(props) {
33
36
  *
34
37
  * @param newValue This represents the updated CheckBox value after it's clicked.
35
38
  */
36
- const onValueChangeModifier = React.useCallback(() => {
39
+ const onValueChangeModifier = useCallback(() => {
37
40
  // If the previous state was 'indeterminate', set checked to true
38
41
  if (value === "indeterminate") onValueChange(true);else onValueChange(!value);
39
42
  }, [onValueChange, value]);
@@ -73,6 +76,7 @@ export const defaultCheckboxViewStyles = StyleSheet.create({
73
76
  },
74
77
  checkboxTextStyle: {
75
78
  color: "black",
79
+ /* istanbul ignore next -- Platform.OS is never "android" in jest */
76
80
  marginTop: Platform.OS === "android" ? 2 : undefined
77
81
  }
78
82
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","StyleSheet","Text","TouchableOpacity","View","Checkbox","jsx","_jsx","jsxs","_jsxs","arePropsEqual","prevProps","nextProps","value","text","CheckboxView","memo","_CheckboxView","props","onValueChange","outermostParentViewStyle","defaultCheckboxViewStyles","mainView","checkboxParentViewStyle","checkboxView","textTouchableStyle","checkboxProps","textProps","style","checkboxTextStyle","numberOfLines","ellipsizeMode","customCheckboxValToCheckboxValType","useCallback","customCheckboxValueType","onValueChangeModifier","children","testID","status","onPress","create","alignSelf","alignItems","flexDirection","marginEnd","marginStart","transform","scale","color","marginTop","OS","undefined"],"sourceRoot":"../../../src","sources":["components/CheckboxView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACIC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QACD,cAAc;AAMrB,SAASC,QAAQ,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3D,SAASC,aAAaA,CAClBC,SAAmC,EACnCC,SAAmC,EACrC;EACE,OACID,SAAS,CAACE,KAAK,KAAKD,SAAS,CAACC,KAAK,IACnCF,SAAS,CAACG,IAAI,KAAKF,SAAS,CAACE,IAAI;AAEzC;AAEA,OAAO,MAAMC,YAAY,gBAAGhB,KAAK,CAACiB,IAAI,CAACC,aAAa,EAAEP,aAAa,CAAC;AAEpE,SAASO,aAAaA,CAACC,KAA+B,EAAE;EACpD,MAAM;IACFL,KAAK;IACLM,aAAa;IACbL,IAAI;IAEJM,wBAAwB,GAAGC,yBAAyB,CAACC,QAAQ;IAC7DC,uBAAuB,GAAGF,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IAAC,CACO,CAAC,GACnB,IAAI;EAAA,CACN,CAAC;AAEf;AAEA,OAAO,MAAMO,yBAAyB,GAAGpB,UAAU,CAACuC,MAAM,CAAC;EACvDlB,QAAQ,EAAE;IACNmB,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IAEpBC,SAAS,EAAE;EACf,CAAC;EACDpB,YAAY,EAAE;IACVqB,WAAW,EAAE,CAAC;IACdC,SAAS,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAI,CAAC;EAC9B,CAAC;EACDlB,iBAAiB,EAAE;IACfmB,KAAK,EAAE,OAAO;IACdC,SAAS,EAAEjD,QAAQ,CAACkD,EAAE,KAAK,SAAS,GAAG,CAAC,GAAGC;EAC/C;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["memo","useCallback","Platform","StyleSheet","Text","TouchableOpacity","View","Checkbox","jsx","_jsx","jsxs","_jsxs","arePropsEqual","prevProps","nextProps","value","text","CheckboxView","_CheckboxView","props","onValueChange","outermostParentViewStyle","defaultCheckboxViewStyles","mainView","checkboxParentViewStyle","checkboxView","textTouchableStyle","checkboxProps","textProps","style","checkboxTextStyle","numberOfLines","ellipsizeMode","customCheckboxValToCheckboxValType","customCheckboxValueType","onValueChangeModifier","children","testID","status","onPress","create","alignSelf","alignItems","flexDirection","marginEnd","marginStart","transform","scale","color","marginTop","OS","undefined"],"sourceRoot":"../../../src","sources":["components/CheckboxView.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SACIC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QACD,cAAc;AAMrB,SAASC,QAAQ,QAAQ,iCAAiC;;AAE1D;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,SAASC,aAAaA,CAClBC,SAAmC,EACnCC,SAAmC,EACrC;EACE,OACID,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E;QAClDwB,OAAO,EAAEJ;MAAsB,CAAE;IAAC,CACpC,CAAC,EAENnB,IAAI,gBACDP,IAAA,CAACJ,gBAAgB;MACbgC,MAAM,EAAE,kBAAkBlB,KAAK,CAACkB,MAAM,EAAG;MACzCR,KAAK,EAAEH,kBAAmB;MAC1Ba,OAAO,EAAEJ,qBAAsB;MAAAC,QAAA,eAC/B3B,IAAA,CAACL,IAAI;QAAA,GACGwB,SAAS;QAAAQ,QAAA,EACZpB;MAAI,CACH;IAAC,CACO,CAAC,GACnB,IAAI;EAAA,CACN,CAAC;AAEf;AAEA,OAAO,MAAMM,yBAAyB,GAAGnB,UAAU,CAACqC,MAAM,CAAC;EACvDjB,QAAQ,EAAE;IACNkB,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IAEpBC,SAAS,EAAE;EACf,CAAC;EACDnB,YAAY,EAAE;IACVoB,WAAW,EAAE,CAAC;IACdC,SAAS,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAI,CAAC;EAC9B,CAAC;EACDjB,iBAAiB,EAAE;IACfkB,KAAK,EAAE,OAAO;IACd;IACAC,SAAS,EAAE/C,QAAQ,CAACgD,EAAE,KAAK,SAAS,GAAG,CAAC,GAAGC;EAC/C;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import React from "react";
3
+ import { memo } from "react";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  // Function to dynamically load FontAwesomeIcon from either Expo or React Native
6
6
  function loadFontAwesomeIcon() {
@@ -18,7 +18,7 @@ function loadFontAwesomeIcon() {
18
18
 
19
19
  // Load the FontAwesomeIcon component
20
20
  const FontAwesomeIcon = loadFontAwesomeIcon();
21
- export const CustomExpandCollapseIcon = /*#__PURE__*/React.memo(_CustomExpandCollapseIcon);
21
+ export const CustomExpandCollapseIcon = /*#__PURE__*/memo(_CustomExpandCollapseIcon);
22
22
  function _CustomExpandCollapseIcon(props) {
23
23
  const {
24
24
  isExpanded
@@ -1 +1 @@
1
- {"version":3,"names":["React","jsx","_jsx","loadFontAwesomeIcon","require","default","e","error","console","FontAwesomeIcon","CustomExpandCollapseIcon","memo","_CustomExpandCollapseIcon","props","isExpanded","warn","name","size","color"],"sourceRoot":"../../../src","sources":["components/CustomExpandCollapseIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG1B;AACA,SAASC,mBAAmBA,CAAA,EAAG;EAC3B,IAAI;IACA,OAAOC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EAC5D,CAAC,CAAC,OAAOC,CAAC,EAAE;IACR,IAAI;MACA,OAAOF,OAAO,CAAC,uCAAuC,CAAC,CAACC,OAAO;IACnE,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZC,OAAO,CAACD,KAAK,CACT,0GACJ,CAAC;MACD,OAAO,IAAI;IACf;EACJ;AACJ;;AAEA;AACA,MAAME,eAAe,GAAGN,mBAAmB,CAAC,CAAC;AAE7C,OAAO,MAAMO,wBAAwB,gBAAGV,KAAK,CAACW,IAAI,CAC9CC,yBACJ,CAAC;AAED,SAASA,yBAAyBA,CAACC,KAAsB,EAAE;EACvD,MAAM;IAAEC;EAAW,CAAC,GAAGD,KAAK;;EAE5B;EACA,IAAI,CAACJ,eAAe,EAAE;IAClBD,OAAO,CAACO,IAAI,CAAC,kCAAkC,CAAC;IAChD,OAAO,IAAI;EACf;EAEA,oBACIb,IAAA,CAACO,eAAe;IACZO,IAAI,EACAF,UAAU,GACJ,YAAY,GACZ,aACT;IACDG,IAAI,EAAE,EAAG;IACTC,KAAK,EAAC;EAAO,CAChB,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["memo","jsx","_jsx","loadFontAwesomeIcon","require","default","e","error","console","FontAwesomeIcon","CustomExpandCollapseIcon","_CustomExpandCollapseIcon","props","isExpanded","warn","name","size","color"],"sourceRoot":"../../../src","sources":["components/CustomExpandCollapseIcon.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG7B;AACA,SAASC,mBAAmBA,CAAA,EAAG;EAC3B,IAAI;IACA,OAAOC,OAAO,CAAC,gCAAgC,CAAC,CAACC,OAAO;EAC5D,CAAC,CAAC,OAAOC,CAAC,EAAE;IACR,IAAI;MACA,OAAOF,OAAO,CAAC,uCAAuC,CAAC,CAACC,OAAO;IACnE,CAAC,CAAC,OAAOE,KAAK,EAAE;MACZC,OAAO,CAACD,KAAK,CACT,0GACJ,CAAC;MACD,OAAO,IAAI;IACf;EACJ;AACJ;;AAEA;AACA,MAAME,eAAe,GAAGN,mBAAmB,CAAC,CAAC;AAE7C,OAAO,MAAMO,wBAAwB,gBAAGV,IAAI,CACxCW,yBACJ,CAAC;AAED,SAASA,yBAAyBA,CAACC,KAAsB,EAAE;EACvD,MAAM;IAAEC;EAAW,CAAC,GAAGD,KAAK;;EAE5B;EACA,IAAI,CAACH,eAAe,EAAE;IAClBD,OAAO,CAACM,IAAI,CAAC,kCAAkC,CAAC;IAChD,OAAO,IAAI;EACf;EAEA,oBACIZ,IAAA,CAACO,eAAe;IACZM,IAAI,EACAF,UAAU,GACJ,YAAY,GACZ,aACT;IACDG,IAAI,EAAE,EAAG;IACTC,KAAK,EAAC;EAAO,CAChB,CAAC;AAEV","ignoreList":[]}
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import React from "react";
4
3
  import { Animated, StyleSheet, View } from "react-native";
5
4
  import { CheckboxView } from "./CheckboxView.js";
6
5
  import { CustomExpandCollapseIcon } from "./CustomExpandCollapseIcon.js";
7
6
  import { defaultIndentationMultiplier } from "../constants/treeView.constants.js";
7
+ import { getTreeViewStore } from "../store/treeView.store.js";
8
+ import { getCheckboxValue } from "../helpers/index.js";
9
+ import { typedMemo } from "../utils/typedMemo.js";
8
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
11
  function _DragOverlay(props) {
10
12
  const {
13
+ storeId,
11
14
  overlayY,
12
15
  overlayX,
13
16
  node,
@@ -19,6 +22,14 @@ function _DragOverlay(props) {
19
22
  checkBoxViewStyleProps,
20
23
  dragDropCustomizations
21
24
  } = props;
25
+
26
+ // Read the actual checked state for the dragged node
27
+ const store = getTreeViewStore(storeId);
28
+ const {
29
+ checked,
30
+ indeterminate
31
+ } = store.getState();
32
+ const checkedValue = getCheckboxValue(checked.has(node.id), indeterminate.has(node.id));
22
33
  const overlayStyleProps = dragDropCustomizations?.dragOverlayStyleProps;
23
34
  const CustomOverlay = dragDropCustomizations?.CustomDragOverlayComponent;
24
35
  return /*#__PURE__*/_jsx(Animated.View, {
@@ -48,11 +59,12 @@ function _DragOverlay(props) {
48
59
  }],
49
60
  children: CustomOverlay ? /*#__PURE__*/_jsx(CustomOverlay, {
50
61
  node: node,
51
- level: level
62
+ level: level,
63
+ checkedValue: checkedValue
52
64
  }) : CustomNodeRowComponent ? /*#__PURE__*/_jsx(CustomNodeRowComponent, {
53
65
  node: node,
54
66
  level: level,
55
- checkedValue: false,
67
+ checkedValue: checkedValue,
56
68
  isExpanded: false,
57
69
  onCheck: () => {},
58
70
  onExpand: () => {}
@@ -63,7 +75,7 @@ function _DragOverlay(props) {
63
75
  children: [/*#__PURE__*/_jsx(CheckboxComponent, {
64
76
  text: node.name,
65
77
  onValueChange: () => {},
66
- value: false,
78
+ value: checkedValue,
67
79
  ...checkBoxViewStyleProps
68
80
  }), node.children?.length ? /*#__PURE__*/_jsx(View, {
69
81
  style: styles.expandArrow,
@@ -74,7 +86,7 @@ function _DragOverlay(props) {
74
86
  })
75
87
  });
76
88
  }
77
- export const DragOverlay = /*#__PURE__*/React.memo(_DragOverlay);
89
+ export const DragOverlay = typedMemo(_DragOverlay);
78
90
  const styles = StyleSheet.create({
79
91
  overlay: {
80
92
  position: "absolute",
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","StyleSheet","View","CheckboxView","CustomExpandCollapseIcon","defaultIndentationMultiplier","jsx","_jsx","jsxs","_jsxs","_DragOverlay","props","overlayY","overlayX","node","level","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","CustomNodeRowComponent","checkBoxViewStyleProps","dragDropCustomizations","overlayStyleProps","dragOverlayStyleProps","CustomOverlay","CustomDragOverlayComponent","pointerEvents","style","styles","overlay","backgroundColor","shadowColor","shadowOpacity","shadowRadius","elevation","transform","translateX","translateY","children","checkedValue","isExpanded","onCheck","onExpand","nodeRow","paddingStart","text","name","onValueChange","value","length","expandArrow","DragOverlay","memo","create","position","left","right","zIndex","shadowOffset","width","height","flex","flexDirection","alignItems","minWidth"],"sourceRoot":"../../../src","sources":["components/DragOverlay.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAQzD,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,wBAAwB,QAAQ,+BAA4B;AACrE,SAASC,4BAA4B,QAAQ,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU/E,SAASC,YAAYA,CAAKC,KAA2B,EAAE;EACnD,MAAM;IACFC,QAAQ;IACRC,QAAQ;IACRC,IAAI;IACJC,KAAK;IACLC,qBAAqB,GAAGX,4BAA4B;IACpDY,iBAAiB,GAAGd,YAAsD;IAC1Ee,2BAA2B,GAAGd,wBAAwB;IACtDe,sBAAsB;IACtBC,sBAAsB;IACtBC;EACJ,CAAC,GAAGV,KAAK;EAET,MAAMW,iBAAiB,GAAGD,sBAAsB,EAAEE,qBAAqB;EACvE,MAAMC,aAAa,GAAGH,sBAAsB,EAAEI,0BAA0B;EAExE,oBACIlB,IAAA,CAACP,QAAQ,CAACE,IAAI;IACVwB,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CACHC,MAAM,CAACC,OAAO,EACdP,iBAAiB,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AAiB;QACd4B,IAAI,EAAE/B,IAAI,CAACgC,IAAK;QAChBC,aAAa,EAAEA,CAAA,KAAM,CAAC,CAAE;QACxBC,KAAK,EAAE,KAAM;QAAA,GACT5B;MAAsB,CAC7B,CAAC,EACDN,IAAI,CAACwB,QAAQ,EAAEW,MAAM,gBAClB1C,IAAA,CAACL,IAAI;QAACyB,KAAK,EAAEC,MAAM,CAACsB,WAAY;QAAAZ,QAAA,eAC5B/B,IAAA,CAACW,2BAA2B;UAACsB,UAAU,EAAE;QAAM,CAAE;MAAC,CAChD,CAAC,GACP,IAAI;IAAA,CACN;EACT,CACU,CAAC;AAExB;AAEA,OAAO,MAAMW,WAAW,gBAAGpD,KAAK,CAACqD,IAAI,CAAC1C,YAAY,CAAwB;AAE1E,MAAMkB,MAAM,GAAG3B,UAAU,CAACoD,MAAM,CAAC;EAC7BxB,OAAO,EAAE;IACLyB,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,IAAI;IACZvB,SAAS,EAAE,EAAE;IACbH,WAAW,EAAE,MAAM;IACnB2B,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrC5B,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfH,eAAe,EAAE;EACrB,CAAC;EACDa,OAAO,EAAE;IACLkB,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,QAAQ,EAAE;EACd,CAAC;EACDd,WAAW,EAAE;IACTW,IAAI,EAAE;EACV;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Animated","StyleSheet","View","CheckboxView","CustomExpandCollapseIcon","defaultIndentationMultiplier","getTreeViewStore","getCheckboxValue","typedMemo","jsx","_jsx","jsxs","_jsxs","_DragOverlay","props","storeId","overlayY","overlayX","node","level","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","CustomNodeRowComponent","checkBoxViewStyleProps","dragDropCustomizations","store","checked","indeterminate","getState","checkedValue","has","id","overlayStyleProps","dragOverlayStyleProps","CustomOverlay","CustomDragOverlayComponent","pointerEvents","style","styles","overlay","backgroundColor","shadowColor","shadowOpacity","shadowRadius","elevation","transform","translateX","translateY","children","isExpanded","onCheck","onExpand","nodeRow","paddingStart","text","name","onValueChange","value","length","expandArrow","DragOverlay","create","position","left","right","zIndex","shadowOffset","width","height","flex","flexDirection","alignItems","minWidth"],"sourceRoot":"../../../src","sources":["components/DragOverlay.tsx"],"mappings":";;AACA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAQzD,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,wBAAwB,QAAQ,+BAA4B;AACrE,SAASC,4BAA4B,QAAQ,oCAAiC;AAC9E,SAASC,gBAAgB,QAAQ,4BAAyB;AAC1D,SAASC,gBAAgB,QAAQ,qBAAY;AAC7C,SAASC,SAAS,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW/C,SAASC,YAAYA,CAAKC,KAA2B,EAAE;EACnD,MAAM;IACFC,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,IAAI;IACJC,KAAK;IACLC,qBAAqB,GAAGf,4BAA4B;IACpDgB,iBAAiB,GAAGlB,YAAgD;IACpEmB,2BAA2B,GAAGlB,wBAAwB;IACtDmB,sBAAsB;IACtBC,sBAAsB;IACtBC;EACJ,CAAC,GAAGX,KAAK;;EAET;EACA,MAAMY,KAAK,GAAGpB,gBAAgB,CAAKS,OAAO,CAAC;EAC3C,MAAM;IAAEY,OAAO;IAAEC;EAAc,CAAC,GAAGF,KAAK,CAACG,QAAQ,CAAC,CAAC;EACnD,MAAMC,YAAY,GAAGvB,gBAAgB,CAACoB,OAAO,CAACI,GAAG,CAACb,IAAI,CAACc,EAAE,CAAC,EAAEJ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,EAAE,QAAQ;IACpBC,QAAQ,EAAE;EACd,CAAC;EACDb,WAAW,EAAE;IACTU,IAAI,EAAE;EACV;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import React from "react";
3
+ import { memo } from "react";
4
4
  import { Animated, View, StyleSheet } from "react-native";
5
5
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- export const DropIndicator = /*#__PURE__*/React.memo(function DropIndicator(props) {
6
+ export const DropIndicator = /*#__PURE__*/memo(function DropIndicator(props) {
7
7
  const {
8
8
  position,
9
9
  overlayY,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","View","StyleSheet","jsx","_jsx","jsxs","_jsxs","DropIndicator","memo","props","position","overlayY","itemHeight","targetLevel","indentationMultiplier","indent","pointerEvents","style","styles","highlightIndicator","transform","translateY","height","left","lineOffset","lineContainer","add","children","lineCircle","line","create","right","backgroundColor","borderWidth","borderColor","borderRadius","zIndex","flexDirection","alignItems","width","marginLeft","marginTop","flex"],"sourceRoot":"../../../src","sources":["components/DropIndicator.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW1D,OAAO,MAAMC,aAAa,gBAAGR,KAAK,CAACS,IAAI,CAAC,SAASD,aAAaA,CAC1DE,KAAyB,EAC3B;EACE,MAAM;IACFC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,WAAW;IACXC;EACJ,CAAC,GAAGL,KAAK;EAET,MAAMM,MAAM,GAAGF,WAAW,GAAGC,qBAAqB;EAElD,IAAIJ,QAAQ,KAAK,QAAQ,EAAE;IACvB,oBACIN,IAAA,CAACJ,QAAQ,CAACC,IAAI;MACVe,aAAa,EAAC,MAAM;MACpBC,KAAK,EAAE,CACHC,MAAM,CAACC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AAM,EAAE,EAAE;IACVa,YAAY,EAAE,CAAC;IACfH,eAAe,EAAE,SAAS;IAC1BQ,UAAU,EAAE,CAAC,CAAC;IACdC,SAAS,EAAE,CAAC;EAChB,CAAC;EACDZ,IAAI,EAAE;IACFa,IAAI,EAAE,CAAC;IACPpB,MAAM,EAAE,CAAC;IACTU,eAAe,EAAE;EACrB;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["memo","Animated","View","StyleSheet","jsx","_jsx","jsxs","_jsxs","DropIndicator","props","position","overlayY","itemHeight","targetLevel","indentationMultiplier","indent","pointerEvents","style","styles","highlightIndicator","transform","translateY","height","left","lineOffset","lineContainer","add","children","lineCircle","line","create","right","backgroundColor","borderWidth","borderColor","borderRadius","zIndex","flexDirection","alignItems","width","marginLeft","marginTop","flex"],"sourceRoot":"../../../src","sources":["components/DropIndicator.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,QAAQ,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW1D,OAAO,MAAMC,aAAa,gBAAGR,IAAI,CAAC,SAASQ,aAAaA,CACpDC,KAAyB,EAC3B;EACE,MAAM;IACFC,QAAQ;IACRC,QAAQ;IACRC,UAAU;IACVC,WAAW;IACXC;EACJ,CAAC,GAAGL,KAAK;EAET,MAAMM,MAAM,GAAGF,WAAW,GAAGC,qBAAqB;EAElD,IAAIJ,QAAQ,KAAK,QAAQ,EAAE;IACvB,oBACIL,IAAA,CAACJ,QAAQ,CAACC,IAAI;MACVc,aAAa,EAAC,MAAM;MACpBC,KAAK,EAAE,CACHC,MAAM,CAACC,kBAAkB,EACzB;QACIC,SAAS,EAAE,CAAC;UAAEC,UAAU,EAAEV;QAAS,CAAC,CAAC;QACrCW,MAAM,EAAEV,UAAU;QAClBW,IAAI,EAAER;MACV,CAAC;IACH,CACL,CAAC;EAEV;;EA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