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.
- package/README.md +151 -0
- package/lib/module/TreeView.js +32 -2
- package/lib/module/TreeView.js.map +1 -1
- package/lib/module/components/DragOverlay.js +101 -0
- package/lib/module/components/DragOverlay.js.map +1 -0
- package/lib/module/components/DropIndicator.js +79 -0
- package/lib/module/components/DropIndicator.js.map +1 -0
- package/lib/module/components/NodeList.js +258 -32
- package/lib/module/components/NodeList.js.map +1 -1
- package/lib/module/helpers/index.js +1 -0
- package/lib/module/helpers/index.js.map +1 -1
- package/lib/module/helpers/moveTreeNode.helper.js +96 -0
- package/lib/module/helpers/moveTreeNode.helper.js.map +1 -0
- package/lib/module/helpers/toggleCheckbox.helper.js +88 -0
- package/lib/module/helpers/toggleCheckbox.helper.js.map +1 -1
- package/lib/module/hooks/useDragDrop.js +511 -0
- package/lib/module/hooks/useDragDrop.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/store/treeView.store.js +19 -1
- package/lib/module/store/treeView.store.js.map +1 -1
- package/lib/module/types/dragDrop.types.js +4 -0
- package/lib/module/types/dragDrop.types.js.map +1 -0
- package/lib/typescript/src/TreeView.d.ts.map +1 -1
- package/lib/typescript/src/components/DragOverlay.d.ts +12 -0
- package/lib/typescript/src/components/DragOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/DropIndicator.d.ts +13 -0
- package/lib/typescript/src/components/DropIndicator.d.ts.map +1 -0
- package/lib/typescript/src/components/NodeList.d.ts.map +1 -1
- package/lib/typescript/src/helpers/index.d.ts +1 -0
- package/lib/typescript/src/helpers/index.d.ts.map +1 -1
- package/lib/typescript/src/helpers/moveTreeNode.helper.d.ts +13 -0
- package/lib/typescript/src/helpers/moveTreeNode.helper.d.ts.map +1 -0
- package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts +6 -0
- package/lib/typescript/src/helpers/toggleCheckbox.helper.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useDragDrop.d.ts +35 -0
- package/lib/typescript/src/hooks/useDragDrop.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/store/treeView.store.d.ts +8 -0
- package/lib/typescript/src/store/treeView.store.d.ts.map +1 -1
- package/lib/typescript/src/types/dragDrop.types.d.ts +21 -0
- package/lib/typescript/src/types/dragDrop.types.d.ts.map +1 -0
- package/lib/typescript/src/types/treeView.types.d.ts +90 -0
- package/lib/typescript/src/types/treeView.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TreeView.tsx +34 -0
- package/src/components/DragOverlay.tsx +112 -0
- package/src/components/DropIndicator.tsx +95 -0
- package/src/components/NodeList.tsx +302 -30
- package/src/helpers/index.ts +2 -1
- package/src/helpers/moveTreeNode.helper.ts +105 -0
- package/src/helpers/toggleCheckbox.helper.ts +96 -0
- package/src/hooks/useDragDrop.ts +643 -0
- package/src/index.tsx +19 -2
- package/src/store/treeView.store.ts +32 -0
- package/src/types/dragDrop.types.ts +23 -0
- package/src/types/treeView.types.ts +106 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Animated } from "react-native";
|
|
2
|
+
import type { __FlattenedTreeNode__, DragDropCustomizations, TreeItemCustomizations } from "../types/treeView.types";
|
|
3
|
+
interface DragOverlayProps<ID> extends TreeItemCustomizations<ID> {
|
|
4
|
+
overlayY: Animated.Value;
|
|
5
|
+
node: __FlattenedTreeNode__<ID>;
|
|
6
|
+
level: number;
|
|
7
|
+
dragDropCustomizations?: DragDropCustomizations<ID>;
|
|
8
|
+
}
|
|
9
|
+
declare function _DragOverlay<ID>(props: DragOverlayProps<ID>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const DragOverlay: typeof _DragOverlay;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=DragOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragOverlay.d.ts","sourceRoot":"","sources":["../../../../src/components/DragOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EACR,qBAAqB,EAErB,sBAAsB,EACtB,sBAAsB,EACzB,MAAM,yBAAyB,CAAC;AAKjC,UAAU,gBAAgB,CAAC,EAAE,CAAE,SAAQ,sBAAsB,CAAC,EAAE,CAAC;IAC7D,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;IACzB,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;CACvD;AAED,iBAAS,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,2CAiEpD;AAED,eAAO,MAAM,WAAW,EAA+B,OAAO,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Animated } from "react-native";
|
|
3
|
+
import type { DropPosition } from "../types/dragDrop.types";
|
|
4
|
+
interface DropIndicatorProps {
|
|
5
|
+
position: DropPosition;
|
|
6
|
+
overlayY: Animated.Value;
|
|
7
|
+
itemHeight: number;
|
|
8
|
+
targetLevel: number;
|
|
9
|
+
indentationMultiplier: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const DropIndicator: React.NamedExoticComponent<DropIndicatorProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=DropIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/DropIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,UAAU,kBAAkB;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,aAAa,gDAgDxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeList.d.ts","sourceRoot":"","sources":["../../../../src/components/NodeList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeList.d.ts","sourceRoot":"","sources":["../../../../src/components/NodeList.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIR,aAAa,EAGhB,MAAM,yBAAyB,CAAC;AAoBjC,QAAA,MAAM,QAAQ,kBAAuB,CAAC;AACtC,eAAe,QAAQ,CAAC;AAExB,iBAAS,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,2CAuN9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TreeNode } from "../types/treeView.types";
|
|
2
|
+
import type { DropPosition } from "../types/dragDrop.types";
|
|
3
|
+
/**
|
|
4
|
+
* Move a node within a tree structure. Returns a new tree (no mutation).
|
|
5
|
+
*
|
|
6
|
+
* @param data - The current tree data
|
|
7
|
+
* @param draggedNodeId - The ID of the node to move
|
|
8
|
+
* @param targetNodeId - The ID of the target node
|
|
9
|
+
* @param position - Where to place relative to target: "above", "below", or "inside"
|
|
10
|
+
* @returns New tree data with the node moved, or the original data if the move is invalid
|
|
11
|
+
*/
|
|
12
|
+
export declare function moveTreeNode<ID>(data: TreeNode<ID>[], draggedNodeId: ID, targetNodeId: ID, position: DropPosition): TreeNode<ID>[];
|
|
13
|
+
//# sourceMappingURL=moveTreeNode.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moveTreeNode.helper.d.ts","sourceRoot":"","sources":["../../../../src/helpers/moveTreeNode.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAC3B,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,EACpB,aAAa,EAAE,EAAE,EACjB,YAAY,EAAE,EAAE,EAChB,QAAQ,EAAE,YAAY,GACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,CAehB"}
|
|
@@ -6,4 +6,10 @@
|
|
|
6
6
|
* If not provided, the check state will be toggled based on the current state.
|
|
7
7
|
*/
|
|
8
8
|
export declare function toggleCheckboxes<ID>(storeId: string, ids: ID[], forceCheck?: boolean): void;
|
|
9
|
+
/**
|
|
10
|
+
* Recalculates checked/indeterminate state for all parent nodes bottom-up.
|
|
11
|
+
* Should be called after tree structure changes (e.g., drag-drop moves) to ensure
|
|
12
|
+
* parent states correctly reflect their children's checked states.
|
|
13
|
+
*/
|
|
14
|
+
export declare function recalculateCheckedStates<ID>(storeId: string): void;
|
|
9
15
|
//# sourceMappingURL=toggleCheckbox.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleCheckbox.helper.d.ts","sourceRoot":"","sources":["../../../../src/helpers/toggleCheckbox.helper.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAC/B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,EAAE,EAAE,EACT,UAAU,CAAC,EAAE,OAAO,QA6LvB"}
|
|
1
|
+
{"version":3,"file":"toggleCheckbox.helper.d.ts","sourceRoot":"","sources":["../../../../src/helpers/toggleCheckbox.helper.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAC/B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,EAAE,EAAE,EACT,UAAU,CAAC,EAAE,OAAO,QA6LvB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,QAyF3D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Animated, type PanResponderInstance } from "react-native";
|
|
2
|
+
import type { FlashList } from "@shopify/flash-list";
|
|
3
|
+
import type { __FlattenedTreeNode__, TreeNode } from "../types/treeView.types";
|
|
4
|
+
import type { DragEndEvent, DropTarget } from "../types/dragDrop.types";
|
|
5
|
+
interface UseDragDropParams<ID> {
|
|
6
|
+
storeId: string;
|
|
7
|
+
flattenedNodes: __FlattenedTreeNode__<ID>[];
|
|
8
|
+
flashListRef: React.RefObject<FlashList<__FlattenedTreeNode__<ID>> | null>;
|
|
9
|
+
containerRef: React.RefObject<{
|
|
10
|
+
measureInWindow: (cb: (x: number, y: number, w: number, h: number) => void) => void;
|
|
11
|
+
} | null>;
|
|
12
|
+
dragEnabled: boolean;
|
|
13
|
+
onDragEnd?: (event: DragEndEvent<ID>) => void;
|
|
14
|
+
longPressDuration: number;
|
|
15
|
+
autoScrollThreshold: number;
|
|
16
|
+
autoScrollSpeed: number;
|
|
17
|
+
internalDataRef: React.MutableRefObject<TreeNode<ID>[] | null>;
|
|
18
|
+
measuredItemHeightRef: React.MutableRefObject<number>;
|
|
19
|
+
dragOverlayOffset: number;
|
|
20
|
+
autoExpandDelay: number;
|
|
21
|
+
}
|
|
22
|
+
interface UseDragDropReturn<ID> {
|
|
23
|
+
panResponder: PanResponderInstance;
|
|
24
|
+
overlayY: Animated.Value;
|
|
25
|
+
isDragging: boolean;
|
|
26
|
+
draggedNode: __FlattenedTreeNode__<ID> | null;
|
|
27
|
+
dropTarget: DropTarget<ID> | null;
|
|
28
|
+
handleNodeTouchStart: (nodeId: ID, pageY: number, locationY: number, nodeIndex: number) => void;
|
|
29
|
+
cancelLongPressTimer: () => void;
|
|
30
|
+
scrollOffsetRef: React.MutableRefObject<number>;
|
|
31
|
+
headerOffsetRef: React.MutableRefObject<number>;
|
|
32
|
+
}
|
|
33
|
+
export declare function useDragDrop<ID>(params: UseDragDropParams<ID>): UseDragDropReturn<ID>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=useDragDrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDragDrop.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDragDrop.ts"],"names":[],"mappings":"AACA,OAAO,EACH,QAAQ,EAER,KAAK,oBAAoB,EAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKxE,UAAU,iBAAiB,CAAC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AS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,KAChB,IAAI,CAAC;IACV,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChD,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,wBAAgB,WAAW,CAAC,EAAE,EAC1B,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC,GAC9B,iBAAiB,CAAC,EAAE,CAAC,CAilBvB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { TreeNode, NodeRowProps, TreeViewProps, TreeViewRef, TreeFlatListProps, ExpandIconProps, CheckBoxViewProps, CheckboxValueType, BuiltInCheckBoxViewStyleProps, SelectionPropagation } from "./types/treeView.types";
|
|
1
|
+
import type { TreeNode, NodeRowProps, TreeViewProps, TreeViewRef, TreeFlatListProps, ExpandIconProps, CheckBoxViewProps, CheckboxValueType, BuiltInCheckBoxViewStyleProps, SelectionPropagation, DragDropCustomizations, DragOverlayStyleProps, DragOverlayComponentProps, DropIndicatorStyleProps, DropIndicatorComponentProps } from "./types/treeView.types";
|
|
2
|
+
import type { DragEndEvent, DropPosition } from "./types/dragDrop.types";
|
|
2
3
|
export * from "./TreeView";
|
|
3
4
|
export * from "./components/CheckboxView";
|
|
4
|
-
export
|
|
5
|
+
export { moveTreeNode } from "./helpers/moveTreeNode.helper";
|
|
6
|
+
export type { TreeNode, NodeRowProps, TreeViewProps, TreeViewRef, TreeFlatListProps, ExpandIconProps, CheckBoxViewProps, CheckboxValueType, BuiltInCheckBoxViewStyleProps, SelectionPropagation, DragEndEvent, DropPosition, DragDropCustomizations, DragOverlayStyleProps, DragOverlayComponentProps, DropIndicatorStyleProps, DropIndicatorComponentProps, };
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,oBAAoB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACR,YAAY,EACZ,YAAY,EACf,MAAM,wBAAwB,CAAC;AAEhC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,YAAY,EACR,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,GAC9B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SelectionPropagation, TreeNode } from "../types/treeView.types";
|
|
2
|
+
import type { DropPosition } from "../types/dragDrop.types";
|
|
2
3
|
import { type StoreApi, type UseBoundStore } from "zustand";
|
|
3
4
|
export type TreeViewState<ID> = {
|
|
4
5
|
checked: Set<ID>;
|
|
@@ -21,6 +22,13 @@ export type TreeViewState<ID> = {
|
|
|
21
22
|
updateInnerMostChildrenIds: (innerMostChildrenIds: ID[]) => void;
|
|
22
23
|
selectionPropagation: SelectionPropagation;
|
|
23
24
|
setSelectionPropagation: (selectionPropagation: SelectionPropagation) => void;
|
|
25
|
+
draggedNodeId: ID | null;
|
|
26
|
+
updateDraggedNodeId: (draggedNodeId: ID | null) => void;
|
|
27
|
+
invalidDragTargetIds: Set<ID>;
|
|
28
|
+
updateInvalidDragTargetIds: (invalidDragTargetIds: Set<ID>) => void;
|
|
29
|
+
dropTargetNodeId: ID | null;
|
|
30
|
+
dropPosition: DropPosition | null;
|
|
31
|
+
updateDropTarget: (nodeId: ID | null, position: DropPosition | null) => void;
|
|
24
32
|
cleanUpTreeViewStore: () => void;
|
|
25
33
|
};
|
|
26
34
|
export declare function getTreeViewStore<ID>(id: string): UseBoundStore<StoreApi<TreeViewState<ID>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeView.store.d.ts","sourceRoot":"","sources":["../../../../src/store/treeView.store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAU,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,MAAM,aAAa,CAAC,EAAE,IAAI;IAE5B,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACjB,aAAa,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAG1C,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IACvB,mBAAmB,EAAE,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAGtD,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,cAAc,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,C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E,CAAC;IACrB,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAGjD,oBAAoB,EAAE,EAAE,EAAE,CAAC;IAC3B,0BAA0B,EAAE,CAAC,oBAAoB,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;IAEjE,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,uBAAuB,EAAE,CACrB,oBAAoB,EAAE,oBAAoB,KACzC,IAAI,CAAC;IAGV,aAAa,EAAE,EAAE,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,CAAC,aAAa,EAAE,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAExD,oBAAoB,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,0BAA0B,EAAE,CAAC,oBAAoB,EAAE,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IAGpE,gBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAC;IAG7E,oBAAoB,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAOF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAkF3F;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,MAAM,8CAEvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TreeNode } from "./treeView.types";
|
|
2
|
+
export type DropPosition = "above" | "below" | "inside";
|
|
3
|
+
export interface DragEndEvent<ID = string> {
|
|
4
|
+
/** The id of the node that was dragged */
|
|
5
|
+
draggedNodeId: ID;
|
|
6
|
+
/** The id of the target node where the dragged node was dropped */
|
|
7
|
+
targetNodeId: ID;
|
|
8
|
+
/** Where relative to the target: above/below = sibling, inside = child */
|
|
9
|
+
position: DropPosition;
|
|
10
|
+
/** The reordered tree data after the move */
|
|
11
|
+
newTreeData: TreeNode<ID>[];
|
|
12
|
+
}
|
|
13
|
+
export interface DropTarget<ID = string> {
|
|
14
|
+
targetNodeId: ID;
|
|
15
|
+
targetIndex: number;
|
|
16
|
+
position: DropPosition;
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
targetLevel: number;
|
|
19
|
+
indicatorTop: number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=dragDrop.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragDrop.types.d.ts","sourceRoot":"","sources":["../../../../src/types/dragDrop.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,YAAY,CAAC,EAAE,GAAG,MAAM;IACrC,0CAA0C;IAC1C,aAAa,EAAE,EAAE,CAAC;IAClB,mEAAmE;IACnE,YAAY,EAAE,EAAE,CAAC;IACjB,0EAA0E;IAC1E,QAAQ,EAAE,YAAY,CAAC;IACvB,6CAA6C;IAC7C,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU,CAAC,EAAE,GAAG,MAAM;IACnC,YAAY,EAAE,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -2,6 +2,7 @@ import type { StyleProp, TextProps, TouchableOpacityProps, ViewStyle } from "rea
|
|
|
2
2
|
import type { FlashListProps } from "@shopify/flash-list";
|
|
3
3
|
import type { ScrollToNodeHandlerRef, ScrollToNodeParams } from "../handlers/ScrollToNodeHandler";
|
|
4
4
|
import type { CheckboxProps as _CheckboxProps } from "@futurejj/react-native-checkbox";
|
|
5
|
+
import type { DragEndEvent, DropPosition } from "./dragDrop.types";
|
|
5
6
|
export type CheckboxValueType = boolean | "indeterminate";
|
|
6
7
|
export interface ExpandIconProps {
|
|
7
8
|
isExpanded: boolean;
|
|
@@ -23,6 +24,9 @@ export interface NodeRowProps<ID = string> {
|
|
|
23
24
|
isExpanded: boolean;
|
|
24
25
|
onCheck: () => void;
|
|
25
26
|
onExpand: () => void;
|
|
27
|
+
isDragTarget?: boolean;
|
|
28
|
+
isDragging?: boolean;
|
|
29
|
+
isDraggedNode?: boolean;
|
|
26
30
|
}
|
|
27
31
|
export interface TreeItemCustomizations<ID> {
|
|
28
32
|
checkBoxViewStyleProps?: BuiltInCheckBoxViewStyleProps;
|
|
@@ -36,12 +40,31 @@ export interface NodeProps<ID> extends TreeItemCustomizations<ID> {
|
|
|
36
40
|
node: __FlattenedTreeNode__<ID>;
|
|
37
41
|
level: number;
|
|
38
42
|
storeId: string;
|
|
43
|
+
nodeIndex?: number;
|
|
44
|
+
dragEnabled?: boolean;
|
|
45
|
+
isDragging?: boolean;
|
|
46
|
+
onNodeTouchStart?: (nodeId: ID, pageY: number, locationY: number, nodeIndex: number) => void;
|
|
47
|
+
onNodeTouchEnd?: () => void;
|
|
48
|
+
longPressDuration?: number;
|
|
49
|
+
onItemLayout?: (height: number) => void;
|
|
50
|
+
dragDropCustomizations?: DragDropCustomizations<ID>;
|
|
39
51
|
}
|
|
40
52
|
export interface NodeListProps<ID> extends TreeItemCustomizations<ID> {
|
|
41
53
|
treeFlashListProps?: TreeFlatListProps;
|
|
42
54
|
scrollToNodeHandlerRef: React.RefObject<ScrollToNodeHandlerRef<ID>>;
|
|
43
55
|
initialScrollNodeID?: ID;
|
|
44
56
|
storeId: string;
|
|
57
|
+
dragEnabled?: boolean;
|
|
58
|
+
onDragEnd?: (event: DragEndEvent<ID>) => void;
|
|
59
|
+
longPressDuration?: number;
|
|
60
|
+
autoScrollThreshold?: number;
|
|
61
|
+
autoScrollSpeed?: number;
|
|
62
|
+
/** Offset of the dragged overlay from the finger, in item-height units. Default: -1 (one item above finger) */
|
|
63
|
+
dragOverlayOffset?: number;
|
|
64
|
+
/** Delay in ms before auto-expanding a collapsed node during drag hover. Default: 800 */
|
|
65
|
+
autoExpandDelay?: number;
|
|
66
|
+
/** Customizations for drag-and-drop visuals (overlay, indicator, opacity) */
|
|
67
|
+
dragDropCustomizations?: DragDropCustomizations<ID>;
|
|
45
68
|
}
|
|
46
69
|
export interface TreeViewProps<ID = string> extends Omit<NodeListProps<ID>, "storeId" | "scrollToNodeHandlerRef"> {
|
|
47
70
|
data: TreeNode<ID>[];
|
|
@@ -50,6 +73,20 @@ export interface TreeViewProps<ID = string> extends Omit<NodeListProps<ID>, "sto
|
|
|
50
73
|
preselectedIds?: ID[];
|
|
51
74
|
preExpandedIds?: ID[];
|
|
52
75
|
selectionPropagation?: SelectionPropagation;
|
|
76
|
+
/** Enable drag-and-drop reordering */
|
|
77
|
+
dragEnabled?: boolean;
|
|
78
|
+
/** Callback fired after a node is dropped at a new position */
|
|
79
|
+
onDragEnd?: (event: DragEndEvent<ID>) => void;
|
|
80
|
+
/** Long press duration in ms to start drag. Default: 400 */
|
|
81
|
+
longPressDuration?: number;
|
|
82
|
+
/** Distance from edge (px) to trigger auto-scroll. Default: 60 */
|
|
83
|
+
autoScrollThreshold?: number;
|
|
84
|
+
/** Speed multiplier for auto-scroll. Default: 1.0 */
|
|
85
|
+
autoScrollSpeed?: number;
|
|
86
|
+
/** Offset of the dragged overlay from the finger, in item-height units. Default: -1 (one item above finger) */
|
|
87
|
+
dragOverlayOffset?: number;
|
|
88
|
+
/** Delay in ms before auto-expanding a collapsed node during drag hover. Default: 800 */
|
|
89
|
+
autoExpandDelay?: number;
|
|
53
90
|
}
|
|
54
91
|
type CheckboxProps = Omit<_CheckboxProps, "onPress" | "status">;
|
|
55
92
|
export interface CheckBoxViewProps {
|
|
@@ -85,5 +122,58 @@ export interface SelectionPropagation {
|
|
|
85
122
|
toChildren?: boolean;
|
|
86
123
|
toParents?: boolean;
|
|
87
124
|
}
|
|
125
|
+
/** Props for the drop indicator rendered on the target node during drag */
|
|
126
|
+
export interface DropIndicatorComponentProps {
|
|
127
|
+
/** Whether the indicator is above, below, or inside the target node */
|
|
128
|
+
position: DropPosition;
|
|
129
|
+
}
|
|
130
|
+
/** Style props for customizing the built-in drop indicator appearance */
|
|
131
|
+
export interface DropIndicatorStyleProps {
|
|
132
|
+
/** Color of the line indicator (above/below). Default: "#0078FF" */
|
|
133
|
+
lineColor?: string;
|
|
134
|
+
/** Thickness of the line indicator. Default: 3 */
|
|
135
|
+
lineThickness?: number;
|
|
136
|
+
/** Diameter of the circle at the line's start. Default: 10 */
|
|
137
|
+
circleSize?: number;
|
|
138
|
+
/** Background color of the "inside" highlight. Default: "rgba(0, 120, 255, 0.15)" */
|
|
139
|
+
highlightColor?: string;
|
|
140
|
+
/** Border color of the "inside" highlight. Default: "rgba(0, 120, 255, 0.5)" */
|
|
141
|
+
highlightBorderColor?: string;
|
|
142
|
+
}
|
|
143
|
+
/** Style props for customizing the drag overlay (the "lifted" node ghost) */
|
|
144
|
+
export interface DragOverlayStyleProps {
|
|
145
|
+
/** Background color of the overlay. Default: "rgba(255, 255, 255, 0.95)" */
|
|
146
|
+
backgroundColor?: string;
|
|
147
|
+
/** Shadow color. Default: "#000" */
|
|
148
|
+
shadowColor?: string;
|
|
149
|
+
/** Shadow opacity. Default: 0.25 */
|
|
150
|
+
shadowOpacity?: number;
|
|
151
|
+
/** Shadow radius. Default: 4 */
|
|
152
|
+
shadowRadius?: number;
|
|
153
|
+
/** Android elevation. Default: 10 */
|
|
154
|
+
elevation?: number;
|
|
155
|
+
/** Custom style applied to the overlay container */
|
|
156
|
+
style?: StyleProp<ViewStyle>;
|
|
157
|
+
}
|
|
158
|
+
/** Combined drag-and-drop customization props */
|
|
159
|
+
export interface DragDropCustomizations<ID = string> {
|
|
160
|
+
/** Opacity applied to the dragged node and its invalid drop targets. Default: 0.3 */
|
|
161
|
+
draggedNodeOpacity?: number;
|
|
162
|
+
/** Style props for the built-in drop indicator */
|
|
163
|
+
dropIndicatorStyleProps?: DropIndicatorStyleProps;
|
|
164
|
+
/** Style props for the drag overlay (lifted node ghost) */
|
|
165
|
+
dragOverlayStyleProps?: DragOverlayStyleProps;
|
|
166
|
+
/** Fully custom drop indicator component — replaces the built-in line/highlight */
|
|
167
|
+
CustomDropIndicatorComponent?: React.ComponentType<DropIndicatorComponentProps>;
|
|
168
|
+
/** Fully custom drag overlay component — replaces the built-in ghost node */
|
|
169
|
+
CustomDragOverlayComponent?: React.ComponentType<DragOverlayComponentProps<ID>>;
|
|
170
|
+
}
|
|
171
|
+
/** Props passed to a custom drag overlay component */
|
|
172
|
+
export interface DragOverlayComponentProps<ID = string> {
|
|
173
|
+
/** The node being dragged */
|
|
174
|
+
node: __FlattenedTreeNode__<ID>;
|
|
175
|
+
/** The nesting level of the dragged node */
|
|
176
|
+
level: number;
|
|
177
|
+
}
|
|
88
178
|
export {};
|
|
89
179
|
//# sourceMappingURL=treeView.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeView.types.d.ts","sourceRoot":"","sources":["../../../../src/types/treeView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,SAAS,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EACR,sBAAsB,EACtB,kBAAkB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACR,aAAa,IAAI,cAAc,EAClC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"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,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED,iDAAiD;AACjD,MAAM,WAAW,sBAAsB,CAAC,EAAE,GAAG,MAAM;IAC/C,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,2DAA2D;IAC3D,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,mFAAmF;IACnF,4BAA4B,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;IAChF,6EAA6E;IAC7E,0BAA0B,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC;CACnF;AAED,sDAAsD;AACtD,MAAM,WAAW,yBAAyB,CAAC,EAAE,GAAG,MAAM;IAClD,6BAA6B;IAC7B,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;IAChC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tree-multi-select",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"description": "A super-fast, customizable tree view component for React Native with multi-selection, checkboxes, and search filtering capabilities.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
package/src/TreeView.tsx
CHANGED
|
@@ -26,6 +26,8 @@ import type {
|
|
|
26
26
|
ScrollToNodeHandlerRef,
|
|
27
27
|
ScrollToNodeParams
|
|
28
28
|
} from "./handlers/ScrollToNodeHandler";
|
|
29
|
+
import type { DragEndEvent } from "./types/dragDrop.types";
|
|
30
|
+
import { fastIsEqual } from "fast-is-equal";
|
|
29
31
|
|
|
30
32
|
function _innerTreeView<ID>(
|
|
31
33
|
props: TreeViewProps<ID>,
|
|
@@ -54,6 +56,15 @@ function _innerTreeView<ID>(
|
|
|
54
56
|
ExpandCollapseTouchableComponent,
|
|
55
57
|
|
|
56
58
|
CustomNodeRowComponent,
|
|
59
|
+
|
|
60
|
+
dragEnabled,
|
|
61
|
+
onDragEnd,
|
|
62
|
+
longPressDuration,
|
|
63
|
+
autoScrollThreshold,
|
|
64
|
+
autoScrollSpeed,
|
|
65
|
+
dragOverlayOffset,
|
|
66
|
+
autoExpandDelay,
|
|
67
|
+
dragDropCustomizations,
|
|
57
68
|
} = props;
|
|
58
69
|
|
|
59
70
|
const storeId = useId();
|
|
@@ -123,8 +134,22 @@ function _innerTreeView<ID>(
|
|
|
123
134
|
|
|
124
135
|
const scrollToNodeHandlerRef = React.useRef<ScrollToNodeHandlerRef<ID>>(null);
|
|
125
136
|
const prevSearchText = usePreviousState(searchText);
|
|
137
|
+
const internalDataRef = React.useRef<TreeNode<ID>[] | null>(null);
|
|
138
|
+
|
|
139
|
+
// Wrap onDragEnd to set internalDataRef before calling consumer's callback
|
|
140
|
+
const wrappedOnDragEnd = React.useCallback((event: DragEndEvent<ID>) => {
|
|
141
|
+
internalDataRef.current = event.newTreeData;
|
|
142
|
+
onDragEnd?.(event);
|
|
143
|
+
}, [onDragEnd]);
|
|
126
144
|
|
|
127
145
|
useDeepCompareEffect(() => {
|
|
146
|
+
// If data matches what was set internally from a drag-drop, skip reinitialize
|
|
147
|
+
if (internalDataRef.current !== null && fastIsEqual(data, internalDataRef.current)) {
|
|
148
|
+
internalDataRef.current = null;
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
internalDataRef.current = null;
|
|
152
|
+
|
|
128
153
|
cleanUpTreeViewStore();
|
|
129
154
|
|
|
130
155
|
updateInitialTreeViewData(data);
|
|
@@ -227,6 +252,15 @@ function _innerTreeView<ID>(
|
|
|
227
252
|
ExpandCollapseTouchableComponent={ExpandCollapseTouchableComponent}
|
|
228
253
|
|
|
229
254
|
CustomNodeRowComponent={CustomNodeRowComponent}
|
|
255
|
+
|
|
256
|
+
dragEnabled={dragEnabled}
|
|
257
|
+
onDragEnd={wrappedOnDragEnd}
|
|
258
|
+
longPressDuration={longPressDuration}
|
|
259
|
+
autoScrollThreshold={autoScrollThreshold}
|
|
260
|
+
autoScrollSpeed={autoScrollSpeed}
|
|
261
|
+
dragOverlayOffset={dragOverlayOffset}
|
|
262
|
+
autoExpandDelay={autoExpandDelay}
|
|
263
|
+
dragDropCustomizations={dragDropCustomizations}
|
|
230
264
|
/>
|
|
231
265
|
);
|
|
232
266
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Animated, StyleSheet, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
__FlattenedTreeNode__,
|
|
6
|
+
CheckBoxViewProps,
|
|
7
|
+
DragDropCustomizations,
|
|
8
|
+
TreeItemCustomizations,
|
|
9
|
+
} from "../types/treeView.types";
|
|
10
|
+
import { CheckboxView } from "./CheckboxView";
|
|
11
|
+
import { CustomExpandCollapseIcon } from "./CustomExpandCollapseIcon";
|
|
12
|
+
import { defaultIndentationMultiplier } from "../constants/treeView.constants";
|
|
13
|
+
|
|
14
|
+
interface DragOverlayProps<ID> extends TreeItemCustomizations<ID> {
|
|
15
|
+
overlayY: Animated.Value;
|
|
16
|
+
node: __FlattenedTreeNode__<ID>;
|
|
17
|
+
level: number;
|
|
18
|
+
dragDropCustomizations?: DragDropCustomizations<ID>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _DragOverlay<ID>(props: DragOverlayProps<ID>) {
|
|
22
|
+
const {
|
|
23
|
+
overlayY,
|
|
24
|
+
node,
|
|
25
|
+
level,
|
|
26
|
+
indentationMultiplier = defaultIndentationMultiplier,
|
|
27
|
+
CheckboxComponent = CheckboxView as React.ComponentType<CheckBoxViewProps>,
|
|
28
|
+
ExpandCollapseIconComponent = CustomExpandCollapseIcon,
|
|
29
|
+
CustomNodeRowComponent,
|
|
30
|
+
checkBoxViewStyleProps,
|
|
31
|
+
dragDropCustomizations,
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
const overlayStyleProps = dragDropCustomizations?.dragOverlayStyleProps;
|
|
35
|
+
const CustomOverlay = dragDropCustomizations?.CustomDragOverlayComponent;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Animated.View
|
|
39
|
+
pointerEvents="none"
|
|
40
|
+
style={[
|
|
41
|
+
styles.overlay,
|
|
42
|
+
overlayStyleProps && {
|
|
43
|
+
...(overlayStyleProps.backgroundColor != null && { backgroundColor: overlayStyleProps.backgroundColor }),
|
|
44
|
+
...(overlayStyleProps.shadowColor != null && { shadowColor: overlayStyleProps.shadowColor }),
|
|
45
|
+
...(overlayStyleProps.shadowOpacity != null && { shadowOpacity: overlayStyleProps.shadowOpacity }),
|
|
46
|
+
...(overlayStyleProps.shadowRadius != null && { shadowRadius: overlayStyleProps.shadowRadius }),
|
|
47
|
+
...(overlayStyleProps.elevation != null && { elevation: overlayStyleProps.elevation }),
|
|
48
|
+
},
|
|
49
|
+
overlayStyleProps?.style,
|
|
50
|
+
{ transform: [{ translateY: overlayY }] },
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
{CustomOverlay ? (
|
|
54
|
+
<CustomOverlay node={node} level={level} />
|
|
55
|
+
) : CustomNodeRowComponent ? (
|
|
56
|
+
<CustomNodeRowComponent
|
|
57
|
+
node={node}
|
|
58
|
+
level={level}
|
|
59
|
+
checkedValue={false}
|
|
60
|
+
isExpanded={false}
|
|
61
|
+
onCheck={() => {}}
|
|
62
|
+
onExpand={() => {}}
|
|
63
|
+
/>
|
|
64
|
+
) : (
|
|
65
|
+
<View
|
|
66
|
+
style={[
|
|
67
|
+
styles.nodeRow,
|
|
68
|
+
{ paddingStart: level * indentationMultiplier },
|
|
69
|
+
]}
|
|
70
|
+
>
|
|
71
|
+
<CheckboxComponent
|
|
72
|
+
text={node.name}
|
|
73
|
+
onValueChange={() => {}}
|
|
74
|
+
value={false}
|
|
75
|
+
{...checkBoxViewStyleProps}
|
|
76
|
+
/>
|
|
77
|
+
{node.children?.length ? (
|
|
78
|
+
<View style={styles.expandArrow}>
|
|
79
|
+
<ExpandCollapseIconComponent isExpanded={false} />
|
|
80
|
+
</View>
|
|
81
|
+
) : null}
|
|
82
|
+
</View>
|
|
83
|
+
)}
|
|
84
|
+
</Animated.View>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const DragOverlay = React.memo(_DragOverlay) as typeof _DragOverlay;
|
|
89
|
+
|
|
90
|
+
const styles = StyleSheet.create({
|
|
91
|
+
overlay: {
|
|
92
|
+
position: "absolute",
|
|
93
|
+
left: 0,
|
|
94
|
+
right: 0,
|
|
95
|
+
zIndex: 9999,
|
|
96
|
+
elevation: 10,
|
|
97
|
+
shadowColor: "#000",
|
|
98
|
+
shadowOffset: { width: 0, height: 2 },
|
|
99
|
+
shadowOpacity: 0.25,
|
|
100
|
+
shadowRadius: 4,
|
|
101
|
+
backgroundColor: "rgba(255, 255, 255, 0.95)",
|
|
102
|
+
},
|
|
103
|
+
nodeRow: {
|
|
104
|
+
flex: 1,
|
|
105
|
+
flexDirection: "row",
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
minWidth: "100%",
|
|
108
|
+
},
|
|
109
|
+
expandArrow: {
|
|
110
|
+
flex: 1,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Animated, View, StyleSheet } from "react-native";
|
|
3
|
+
import type { DropPosition } from "../types/dragDrop.types";
|
|
4
|
+
|
|
5
|
+
interface DropIndicatorProps {
|
|
6
|
+
position: DropPosition;
|
|
7
|
+
overlayY: Animated.Value;
|
|
8
|
+
itemHeight: number;
|
|
9
|
+
targetLevel: number;
|
|
10
|
+
indentationMultiplier: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const DropIndicator = React.memo(function DropIndicator(
|
|
14
|
+
props: DropIndicatorProps
|
|
15
|
+
) {
|
|
16
|
+
const {
|
|
17
|
+
position,
|
|
18
|
+
overlayY,
|
|
19
|
+
itemHeight,
|
|
20
|
+
targetLevel,
|
|
21
|
+
indentationMultiplier,
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
const indent = targetLevel * indentationMultiplier;
|
|
25
|
+
|
|
26
|
+
if (position === "inside") {
|
|
27
|
+
return (
|
|
28
|
+
<Animated.View
|
|
29
|
+
pointerEvents="none"
|
|
30
|
+
style={[
|
|
31
|
+
styles.highlightIndicator,
|
|
32
|
+
{
|
|
33
|
+
transform: [{ translateY: overlayY }],
|
|
34
|
+
height: itemHeight,
|
|
35
|
+
left: indent,
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// For "above", the line is at the overlay's top edge (offset 0)
|
|
43
|
+
// For "below", the line is at the overlay's bottom edge (offset +itemHeight)
|
|
44
|
+
const lineOffset = position === "above" ? 0 : itemHeight;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<Animated.View
|
|
48
|
+
pointerEvents="none"
|
|
49
|
+
style={[
|
|
50
|
+
styles.lineContainer,
|
|
51
|
+
{
|
|
52
|
+
transform: [{ translateY: Animated.add(overlayY, lineOffset - 1) }],
|
|
53
|
+
left: indent,
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
>
|
|
57
|
+
<View style={styles.lineCircle} />
|
|
58
|
+
<View style={styles.line} />
|
|
59
|
+
</Animated.View>
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
highlightIndicator: {
|
|
65
|
+
position: "absolute",
|
|
66
|
+
left: 0,
|
|
67
|
+
right: 0,
|
|
68
|
+
backgroundColor: "rgba(0, 200, 0, 0.2)",
|
|
69
|
+
borderWidth: 2,
|
|
70
|
+
borderColor: "rgba(0, 200, 0, 0.6)",
|
|
71
|
+
borderRadius: 4,
|
|
72
|
+
zIndex: 9998,
|
|
73
|
+
},
|
|
74
|
+
lineContainer: {
|
|
75
|
+
position: "absolute",
|
|
76
|
+
right: 0,
|
|
77
|
+
flexDirection: "row",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
height: 3,
|
|
80
|
+
zIndex: 9998,
|
|
81
|
+
},
|
|
82
|
+
lineCircle: {
|
|
83
|
+
width: 10,
|
|
84
|
+
height: 10,
|
|
85
|
+
borderRadius: 5,
|
|
86
|
+
backgroundColor: "#00CC00",
|
|
87
|
+
marginLeft: -5,
|
|
88
|
+
marginTop: -4,
|
|
89
|
+
},
|
|
90
|
+
line: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
height: 3,
|
|
93
|
+
backgroundColor: "#00CC00",
|
|
94
|
+
},
|
|
95
|
+
});
|