react-native-tree-multi-select 2.0.11 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +151 -0
  2. package/lib/module/TreeView.js +32 -2
  3. package/lib/module/TreeView.js.map +1 -1
  4. package/lib/module/components/DragOverlay.js +101 -0
  5. package/lib/module/components/DragOverlay.js.map +1 -0
  6. package/lib/module/components/DropIndicator.js +79 -0
  7. package/lib/module/components/DropIndicator.js.map +1 -0
  8. package/lib/module/components/NodeList.js +258 -32
  9. package/lib/module/components/NodeList.js.map +1 -1
  10. package/lib/module/helpers/index.js +1 -0
  11. package/lib/module/helpers/index.js.map +1 -1
  12. package/lib/module/helpers/moveTreeNode.helper.js +96 -0
  13. package/lib/module/helpers/moveTreeNode.helper.js.map +1 -0
  14. package/lib/module/helpers/toggleCheckbox.helper.js +88 -0
  15. package/lib/module/helpers/toggleCheckbox.helper.js.map +1 -1
  16. package/lib/module/hooks/useDragDrop.js +511 -0
  17. package/lib/module/hooks/useDragDrop.js.map +1 -0
  18. package/lib/module/index.js +1 -1
  19. package/lib/module/index.js.map +1 -1
  20. package/lib/module/store/treeView.store.js +19 -1
  21. package/lib/module/store/treeView.store.js.map +1 -1
  22. package/lib/module/types/dragDrop.types.js +4 -0
  23. package/lib/module/types/dragDrop.types.js.map +1 -0
  24. package/lib/typescript/src/TreeView.d.ts.map +1 -1
  25. package/lib/typescript/src/components/DragOverlay.d.ts +12 -0
  26. package/lib/typescript/src/components/DragOverlay.d.ts.map +1 -0
  27. package/lib/typescript/src/components/DropIndicator.d.ts +13 -0
  28. package/lib/typescript/src/components/DropIndicator.d.ts.map +1 -0
  29. package/lib/typescript/src/components/NodeList.d.ts.map +1 -1
  30. package/lib/typescript/src/helpers/index.d.ts +1 -0
  31. package/lib/typescript/src/helpers/index.d.ts.map +1 -1
  32. package/lib/typescript/src/helpers/moveTreeNode.helper.d.ts +13 -0
  33. package/lib/typescript/src/helpers/moveTreeNode.helper.d.ts.map +1 -0
  34. package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts +6 -0
  35. package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts.map +1 -1
  36. package/lib/typescript/src/hooks/useDragDrop.d.ts +35 -0
  37. package/lib/typescript/src/hooks/useDragDrop.d.ts.map +1 -0
  38. package/lib/typescript/src/index.d.ts +4 -2
  39. package/lib/typescript/src/index.d.ts.map +1 -1
  40. package/lib/typescript/src/store/treeView.store.d.ts +8 -0
  41. package/lib/typescript/src/store/treeView.store.d.ts.map +1 -1
  42. package/lib/typescript/src/types/dragDrop.types.d.ts +21 -0
  43. package/lib/typescript/src/types/dragDrop.types.d.ts.map +1 -0
  44. package/lib/typescript/src/types/treeView.types.d.ts +90 -0
  45. package/lib/typescript/src/types/treeView.types.d.ts.map +1 -1
  46. package/package.json +1 -1
  47. package/src/TreeView.tsx +34 -0
  48. package/src/components/DragOverlay.tsx +112 -0
  49. package/src/components/DropIndicator.tsx +95 -0
  50. package/src/components/NodeList.tsx +302 -30
  51. package/src/helpers/index.ts +2 -1
  52. package/src/helpers/moveTreeNode.helper.ts +105 -0
  53. package/src/helpers/toggleCheckbox.helper.ts +96 -0
  54. package/src/hooks/useDragDrop.ts +643 -0
  55. package/src/index.tsx +19 -2
  56. package/src/store/treeView.store.ts +32 -0
  57. package/src/types/dragDrop.types.ts +23 -0
  58. package/src/types/treeView.types.ts +106 -0
package/README.md CHANGED
@@ -44,6 +44,7 @@ Make sure to follow the native-related installation instructions for these depen
44
44
  - 🌳 **Multi-Level Selection**: Select individual nodes or entire branches with ease.
45
45
  - 📦 **Supports Large Datasets**: Efficiently handles large trees without much performance degradation.
46
46
  - 🔒 **TypeScript Support**: Full TypeScript support for better developer experience.
47
+ - 🔀 **Drag-and-Drop**: Long-press to drag nodes and reorder or nest them anywhere in the tree.
47
48
  - 💻 **Cross-Platform**: Works seamlessly across iOS, Android, and web (with React Native Web).
48
49
 
49
50
  ## Usage
@@ -112,6 +113,46 @@ export function TreeViewUsageExample(){
112
113
  }
113
114
  ```
114
115
 
116
+ ### Drag-and-Drop Usage
117
+
118
+ ```tsx
119
+ import {
120
+ TreeView,
121
+ type TreeNode,
122
+ type TreeViewRef,
123
+ type DragEndEvent
124
+ } from 'react-native-tree-multi-select';
125
+
126
+ const myData: TreeNode[] = [...];
127
+
128
+ export function DragDropExample(){
129
+ const [data, setData] = React.useState<TreeNode[]>(myData);
130
+ const treeViewRef = React.useRef<TreeViewRef | null>(null);
131
+
132
+ const handleDragEnd = (event: DragEndEvent) => {
133
+ // event.newTreeData contains the reordered tree — just set it
134
+ setData(event.newTreeData);
135
+ };
136
+
137
+ return(
138
+ <TreeView
139
+ ref={treeViewRef}
140
+ data={data}
141
+ onCheck={(checked, indeterminate) => { /* ... */ }}
142
+ onExpand={(expanded) => { /* ... */ }}
143
+ dragEnabled={true}
144
+ onDragEnd={handleDragEnd}
145
+ />
146
+ );
147
+ }
148
+ ```
149
+
150
+ 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
+
152
+ For visual customizations (overlay styles, indicator colors, or fully custom components), see the [`dragDropCustomizations`](#dragdropcustomizationsid) prop.
153
+
154
+ ---
155
+
115
156
  ### Properties
116
157
 
117
158
  #### TreeViewProps`<ID = string>`
@@ -134,6 +175,14 @@ export function TreeViewUsageExample(){
134
175
  | `ExpandCollapseIconComponent` | `ComponentType<`[ExpandIconProps](#expandiconprops)`>` | No | A custom expand/collapse icon component |
135
176
  | `ExpandCollapseTouchableComponent` | `ComponentType<`[TouchableOpacityProps](https://reactnative.dev/docs/touchableopacity#props)`>` | No | A custom expand/collapse touchable component |
136
177
  | `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) |
137
186
 
138
187
  ##### Notes
139
188
 
@@ -262,6 +311,107 @@ Type: `boolean` OR `"indeterminate"`
262
311
  | `isExpanded` | `boolean` | Yes | Whether the node is expanded or not |
263
312
  | `onCheck` | `() => void` | Yes | Function to be called when the checkbox is pressed |
264
313
  | `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 |
315
+ | `isDragging` | `boolean` | No | Whether a drag operation is in progress |
316
+ | `isDraggedNode`| `boolean` | No | Whether this node is the one being dragged |
317
+
318
+ ---
319
+
320
+ #### DragEndEvent`<ID = string>`
321
+
322
+ *The event object passed to the `onDragEnd` callback after a successful drop.*
323
+
324
+ | Property | Type | Description |
325
+ | --------------- | --------------------------------------- | ------------------------------------------------------------ |
326
+ | `draggedNodeId` | `ID` | The id of the node that was dragged |
327
+ | `targetNodeId` | `ID` | The id of the target node where the dragged node was dropped |
328
+ | `position` | [DropPosition](#dropposition) | Where relative to the target: `above`/`below` = sibling, `inside` = child |
329
+ | `newTreeData` | `TreeNode<ID>[]` | The reordered tree data after the move |
330
+
331
+ #### DropPosition
332
+
333
+ Type: `"above"` | `"below"` | `"inside"`
334
+
335
+ ---
336
+
337
+ #### DragDropCustomizations`<ID>`
338
+
339
+ *Customizations for drag-and-drop visuals.*
340
+
341
+ | Property | Type | Required | Description |
342
+ | ------------------------------ | ------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------- |
343
+ | `draggedNodeOpacity` | `number` | No | Opacity of the dragged node and invalid targets (default: 0.3) |
344
+ | `dropIndicatorStyleProps` | [DropIndicatorStyleProps](#dropindicatorstyleprops) | No | Style props for the built-in drop indicator |
345
+ | `dragOverlayStyleProps` | [DragOverlayStyleProps](#dragoverlaystyleprops) | No | Style props for the drag overlay (lifted node ghost) |
346
+ | `CustomDropIndicatorComponent` | `ComponentType<`[DropIndicatorComponentProps](#dropindicatorcomponentprops)`>` | No | Fully custom drop indicator component |
347
+ | `CustomDragOverlayComponent` | `ComponentType<`[DragOverlayComponentProps](#dragoverlaycomponentpropsid--string)`<ID>>`| No | Fully custom drag overlay component |
348
+
349
+ ---
350
+
351
+ #### DropIndicatorStyleProps
352
+
353
+ *Style props for customizing the built-in drop indicator appearance.*
354
+
355
+ | Property | Type | Required | Description |
356
+ | --------------------- | -------- | -------- | -------------------------------------------------------------- |
357
+ | `lineColor` | `string` | No | Color of the line indicator for above/below (default: `"#0078FF"`) |
358
+ | `lineThickness` | `number` | No | Thickness of the line indicator (default: 3) |
359
+ | `circleSize` | `number` | No | Diameter of the circle at the line's start (default: 10) |
360
+ | `highlightColor` | `string` | No | Background color of the "inside" highlight (default: `"rgba(0, 120, 255, 0.15)"`) |
361
+ | `highlightBorderColor`| `string` | No | Border color of the "inside" highlight (default: `"rgba(0, 120, 255, 0.5)"`) |
362
+
363
+ ---
364
+
365
+ #### DragOverlayStyleProps
366
+
367
+ *Style props for customizing the drag overlay (the "lifted" node ghost).*
368
+
369
+ | Property | Type | Required | Description |
370
+ | --------------- | ---------------------- | -------- | ------------------------------------------------ |
371
+ | `backgroundColor`| `string` | No | Background color (default: `"rgba(255, 255, 255, 0.95)"`) |
372
+ | `shadowColor` | `string` | No | Shadow color (default: `"#000"`) |
373
+ | `shadowOpacity` | `number` | No | Shadow opacity (default: 0.25) |
374
+ | `shadowRadius` | `number` | No | Shadow radius (default: 4) |
375
+ | `elevation` | `number` | No | Android elevation (default: 10) |
376
+ | `style` | `StyleProp<ViewStyle>` | No | Custom style applied to the overlay container |
377
+
378
+ ---
379
+
380
+ #### DropIndicatorComponentProps
381
+
382
+ *Props passed to a custom drop indicator component (when using `CustomDropIndicatorComponent`).*
383
+
384
+ | Property | Type | Required | Description |
385
+ | ---------- | ----------------------------- | -------- | ------------------------------------------------------------ |
386
+ | `position` | [DropPosition](#dropposition) | Yes | Whether the indicator is above, below, or inside the target |
387
+
388
+ ---
389
+
390
+ #### DragOverlayComponentProps`<ID = string>`
391
+
392
+ *Props passed to a custom drag overlay component (when using `CustomDragOverlayComponent`).*
393
+
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 |
398
+
399
+ ---
400
+
401
+ ### Exported Utilities
402
+
403
+ #### `moveTreeNode`
404
+
405
+ ```typescript
406
+ moveTreeNode<ID>(
407
+ data: TreeNode<ID>[],
408
+ draggedNodeId: ID,
409
+ targetNodeId: ID,
410
+ position: DropPosition
411
+ ): TreeNode<ID>[]
412
+ ```
413
+
414
+ Moves a node within a tree structure. Returns a new tree (no mutation). Useful if you want to perform tree moves manually outside of the `onDragEnd` callback.
265
415
 
266
416
  ---
267
417
 
@@ -274,6 +424,7 @@ Type: `boolean` OR `"indeterminate"`
274
424
  - [x] Ref function to programatically expand/collapse a certain node
275
425
  - [x] Ref function to programatically un/check a certain node
276
426
  - [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
277
428
 
278
429
  If you do not see what you want in the planned feature list, raise a feature request.
279
430
 
@@ -8,6 +8,7 @@ import usePreviousState from "./utils/usePreviousState.js";
8
8
  import { useShallow } from "zustand/react/shallow";
9
9
  import useDeepCompareEffect from "./utils/useDeepCompareEffect.js";
10
10
  import { typedMemo } from "./utils/typedMemo.js";
11
+ import { fastIsEqual } from "fast-is-equal";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  function _innerTreeView(props, ref) {
13
14
  const {
@@ -24,7 +25,15 @@ function _innerTreeView(props, ref) {
24
25
  CheckboxComponent,
25
26
  ExpandCollapseIconComponent,
26
27
  ExpandCollapseTouchableComponent,
27
- CustomNodeRowComponent
28
+ CustomNodeRowComponent,
29
+ dragEnabled,
30
+ onDragEnd,
31
+ longPressDuration,
32
+ autoScrollThreshold,
33
+ autoScrollSpeed,
34
+ dragOverlayOffset,
35
+ autoExpandDelay,
36
+ dragDropCustomizations
28
37
  } = props;
29
38
  const storeId = useId();
30
39
  const {
@@ -69,7 +78,20 @@ function _innerTreeView(props, ref) {
69
78
  }));
70
79
  const scrollToNodeHandlerRef = React.useRef(null);
71
80
  const prevSearchText = usePreviousState(searchText);
81
+ const internalDataRef = React.useRef(null);
82
+
83
+ // Wrap onDragEnd to set internalDataRef before calling consumer's callback
84
+ const wrappedOnDragEnd = React.useCallback(event => {
85
+ internalDataRef.current = event.newTreeData;
86
+ onDragEnd?.(event);
87
+ }, [onDragEnd]);
72
88
  useDeepCompareEffect(() => {
89
+ // If data matches what was set internally from a drag-drop, skip reinitialize
90
+ if (internalDataRef.current !== null && fastIsEqual(data, internalDataRef.current)) {
91
+ internalDataRef.current = null;
92
+ return;
93
+ }
94
+ internalDataRef.current = null;
73
95
  cleanUpTreeViewStore();
74
96
  updateInitialTreeViewData(data);
75
97
  if (selectionPropagation) setSelectionPropagation(selectionPropagation);
@@ -139,7 +161,15 @@ function _innerTreeView(props, ref) {
139
161
  CheckboxComponent: CheckboxComponent,
140
162
  ExpandCollapseIconComponent: ExpandCollapseIconComponent,
141
163
  ExpandCollapseTouchableComponent: ExpandCollapseTouchableComponent,
142
- CustomNodeRowComponent: CustomNodeRowComponent
164
+ 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
143
173
  });
144
174
  }
145
175
  const _TreeView = /*#__PURE__*/React.forwardRef(_innerTreeView);
@@ -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","jsx","_jsx","_innerTreeView","props","ref","data","onCheck","onExpand","selectionPropagation","preselectedIds","preExpandedIds","initialScrollNodeID","treeFlashListProps","checkBoxViewStyleProps","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","ExpandCollapseTouchableComponent","CustomNodeRowComponent","storeId","expanded","updateExpanded","initialTreeViewData","updateInitialTreeViewData","searchText","updateSearchText","updateSearchKeys","checked","indeterminate","setSelectionPropagation","cleanUpTreeViewStore","state","useImperativeHandle","ids","selectNodes","unselectNodes","setSearchText","scrollToNodeID","getChildToParentMap","scrollToNodeHandlerRef","useRef","prevSearchText","text","keys","params","current","treeViewStore","getState","childToParentMap","getIds","useCallback","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,a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,EAAEA,sBAAuB;IAC/CC,qBAAqB,EAAEA,qBAAsB;IAE7CC,iBAAiB,EAAEA,iBAAkB;IACrCC,2BAA2B,EAAEA,2BAA4B;IACzDC,gCAAgC,EAAEA,gCAAiC;IAEnEC,sBAAsB,EAAEA;EAAuB,CAC/C,CAAC;AAEJ;AAEA,MAAM2C,SAAS,gBAAGjF,KAAK,CAACkF,UAAU,CAAC5D,cAAc,CAEX;AAEtC,OAAO,MAAM6D,QAAQ,GAAGhE,SAAS,CAAmB8D,SAAS,CAAC","ignoreList":[]}
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,O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MAAM+C,SAAS,gBAAG9F,KAAK,CAAC+F,UAAU,CAACxE,cAAc,CAEX;AAEtC,OAAO,MAAMyE,QAAQ,GAAG7E,SAAS,CAAmB2E,SAAS,CAAC","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Animated, StyleSheet, View } from "react-native";
5
+ import { CheckboxView } from "./CheckboxView.js";
6
+ import { CustomExpandCollapseIcon } from "./CustomExpandCollapseIcon.js";
7
+ import { defaultIndentationMultiplier } from "../constants/treeView.constants.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ function _DragOverlay(props) {
10
+ const {
11
+ overlayY,
12
+ node,
13
+ level,
14
+ indentationMultiplier = defaultIndentationMultiplier,
15
+ CheckboxComponent = CheckboxView,
16
+ ExpandCollapseIconComponent = CustomExpandCollapseIcon,
17
+ CustomNodeRowComponent,
18
+ checkBoxViewStyleProps,
19
+ dragDropCustomizations
20
+ } = props;
21
+ const overlayStyleProps = dragDropCustomizations?.dragOverlayStyleProps;
22
+ const CustomOverlay = dragDropCustomizations?.CustomDragOverlayComponent;
23
+ return /*#__PURE__*/_jsx(Animated.View, {
24
+ pointerEvents: "none",
25
+ style: [styles.overlay, overlayStyleProps && {
26
+ ...(overlayStyleProps.backgroundColor != null && {
27
+ backgroundColor: overlayStyleProps.backgroundColor
28
+ }),
29
+ ...(overlayStyleProps.shadowColor != null && {
30
+ shadowColor: overlayStyleProps.shadowColor
31
+ }),
32
+ ...(overlayStyleProps.shadowOpacity != null && {
33
+ shadowOpacity: overlayStyleProps.shadowOpacity
34
+ }),
35
+ ...(overlayStyleProps.shadowRadius != null && {
36
+ shadowRadius: overlayStyleProps.shadowRadius
37
+ }),
38
+ ...(overlayStyleProps.elevation != null && {
39
+ elevation: overlayStyleProps.elevation
40
+ })
41
+ }, overlayStyleProps?.style, {
42
+ transform: [{
43
+ translateY: overlayY
44
+ }]
45
+ }],
46
+ children: CustomOverlay ? /*#__PURE__*/_jsx(CustomOverlay, {
47
+ node: node,
48
+ level: level
49
+ }) : CustomNodeRowComponent ? /*#__PURE__*/_jsx(CustomNodeRowComponent, {
50
+ node: node,
51
+ level: level,
52
+ checkedValue: false,
53
+ isExpanded: false,
54
+ onCheck: () => {},
55
+ onExpand: () => {}
56
+ }) : /*#__PURE__*/_jsxs(View, {
57
+ style: [styles.nodeRow, {
58
+ paddingStart: level * indentationMultiplier
59
+ }],
60
+ children: [/*#__PURE__*/_jsx(CheckboxComponent, {
61
+ text: node.name,
62
+ onValueChange: () => {},
63
+ value: false,
64
+ ...checkBoxViewStyleProps
65
+ }), node.children?.length ? /*#__PURE__*/_jsx(View, {
66
+ style: styles.expandArrow,
67
+ children: /*#__PURE__*/_jsx(ExpandCollapseIconComponent, {
68
+ isExpanded: false
69
+ })
70
+ }) : null]
71
+ })
72
+ });
73
+ }
74
+ export const DragOverlay = /*#__PURE__*/React.memo(_DragOverlay);
75
+ const styles = StyleSheet.create({
76
+ overlay: {
77
+ position: "absolute",
78
+ left: 0,
79
+ right: 0,
80
+ zIndex: 9999,
81
+ elevation: 10,
82
+ shadowColor: "#000",
83
+ shadowOffset: {
84
+ width: 0,
85
+ height: 2
86
+ },
87
+ shadowOpacity: 0.25,
88
+ shadowRadius: 4,
89
+ backgroundColor: "rgba(255, 255, 255, 0.95)"
90
+ },
91
+ nodeRow: {
92
+ flex: 1,
93
+ flexDirection: "row",
94
+ alignItems: "center",
95
+ minWidth: "100%"
96
+ },
97
+ expandArrow: {
98
+ flex: 1
99
+ }
100
+ });
101
+ //# sourceMappingURL=DragOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Animated","StyleSheet","View","CheckboxView","CustomExpandCollapseIcon","defaultIndentationMultiplier","jsx","_jsx","jsxs","_jsxs","_DragOverlay","props","overlayY","node","level","indentationMultiplier","CheckboxComponent","ExpandCollapseIconComponent","CustomNodeRowComponent","checkBoxViewStyleProps","dragDropCustomizations","overlayStyleProps","dragOverlayStyleProps","CustomOverlay","CustomDragOverlayComponent","pointerEvents","style","styles","overlay","backgroundColor","shadowColor","shadowOpacity","shadowRadius","elevation","transform","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;AAS/E,SAASC,YAAYA,CAAKC,KAA2B,EAAE;EACnD,MAAM;IACFC,QAAQ;IACRC,IAAI;IACJC,KAAK;IACLC,qBAAqB,GAAGV,4BAA4B;IACpDW,iBAAiB,GAAGb,YAAsD;IAC1Ec,2BAA2B,GAAGb,wBAAwB;IACtDc,sBAAsB;IACtBC,sBAAsB;IACtBC;EACJ,CAAC,GAAGT,KAAK;EAET,MAAMU,iBAAiB,GAAGD,sBAAsB,EAAEE,qBAAqB;EACvE,MAAMC,aAAa,GAAGH,sBAAsB,EAAEI,0BAA0B;EAExE,oBACIjB,IAAA,CAACP,QAAQ,CAACE,IAAI;IACVuB,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CACHC,MAAM,CAACC,OAAO,EACdP,iBAAiB,IAAI;MACjB,IAAIA,iBAAiB,CAACQ,eAAe,IAAI,IAAI,IAAI;QAAEA,eAAe,EAAER,iBAAiB,CAACQ;MAAgB,CAAC,CAAC;MACxG,IAAIR,iBAAiB,CAACS,WAAW,IAAI,IAAI,IAAI;QAAEA,WAAW,EAAET,iBAAiB,CAACS;MAAY,CAAC,CAA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AY;QAAAZ,QAAA,eAC5B7B,IAAA,CAACU,2BAA2B;UAACqB,UAAU,EAAE;QAAM,CAAE;MAAC,CAChD,CAAC,GACP,IAAI;IAAA,CACN;EACT,CACU,CAAC;AAExB;AAEA,OAAO,MAAMW,WAAW,gBAAGlD,KAAK,CAACmD,IAAI,CAACxC,YAAY,CAAwB;AAE1E,MAAMiB,MAAM,GAAG1B,UAAU,CAACkD,MAAM,CAAC;EAC7BvB,OAAO,EAAE;IACLwB,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,IAAI;IACZtB,SAAS,EAAE,EAAE;IACbH,WAAW,EAAE,MAAM;IACnB0B,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrC3B,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfH,eAAe,EAAE;EACrB,CAAC;EACDY,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":[]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ import React from "react";
4
+ import { Animated, View, StyleSheet } from "react-native";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export const DropIndicator = /*#__PURE__*/React.memo(function DropIndicator(props) {
7
+ const {
8
+ position,
9
+ overlayY,
10
+ itemHeight,
11
+ targetLevel,
12
+ indentationMultiplier
13
+ } = props;
14
+ const indent = targetLevel * indentationMultiplier;
15
+ if (position === "inside") {
16
+ return /*#__PURE__*/_jsx(Animated.View, {
17
+ pointerEvents: "none",
18
+ style: [styles.highlightIndicator, {
19
+ transform: [{
20
+ translateY: overlayY
21
+ }],
22
+ height: itemHeight,
23
+ left: indent
24
+ }]
25
+ });
26
+ }
27
+
28
+ // For "above", the line is at the overlay's top edge (offset 0)
29
+ // For "below", the line is at the overlay's bottom edge (offset +itemHeight)
30
+ const lineOffset = position === "above" ? 0 : itemHeight;
31
+ return /*#__PURE__*/_jsxs(Animated.View, {
32
+ pointerEvents: "none",
33
+ style: [styles.lineContainer, {
34
+ transform: [{
35
+ translateY: Animated.add(overlayY, lineOffset - 1)
36
+ }],
37
+ left: indent
38
+ }],
39
+ children: [/*#__PURE__*/_jsx(View, {
40
+ style: styles.lineCircle
41
+ }), /*#__PURE__*/_jsx(View, {
42
+ style: styles.line
43
+ })]
44
+ });
45
+ });
46
+ const styles = StyleSheet.create({
47
+ highlightIndicator: {
48
+ position: "absolute",
49
+ left: 0,
50
+ right: 0,
51
+ backgroundColor: "rgba(0, 200, 0, 0.2)",
52
+ borderWidth: 2,
53
+ borderColor: "rgba(0, 200, 0, 0.6)",
54
+ borderRadius: 4,
55
+ zIndex: 9998
56
+ },
57
+ lineContainer: {
58
+ position: "absolute",
59
+ right: 0,
60
+ flexDirection: "row",
61
+ alignItems: "center",
62
+ height: 3,
63
+ zIndex: 9998
64
+ },
65
+ lineCircle: {
66
+ width: 10,
67
+ height: 10,
68
+ borderRadius: 5,
69
+ backgroundColor: "#00CC00",
70
+ marginLeft: -5,
71
+ marginTop: -4
72
+ },
73
+ line: {
74
+ flex: 1,
75
+ height: 3,
76
+ backgroundColor: "#00CC00"
77
+ }
78
+ });
79
+ //# sourceMappingURL=DropIndicator.js.map
@@ -0,0 +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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