@nosferatu500/react-sortable-tree
Advanced tools
Comparing version 4.0.0-beta.0 to 4.0.0-beta.1
import React from 'react'; | ||
import { ConnectDragPreview, ConnectDragSource } from 'react-dnd'; | ||
import './node-renderer-default.css'; | ||
import { NodeData, TreeItem, NumberOrStringArray } from '.'; | ||
import { ConnectDragPreview, ConnectDragSource } from 'react-dnd'; | ||
import { NodeData, TreeItem } from '.'; | ||
export interface NodeRendererProps { | ||
node: TreeItem; | ||
path: NumberOrStringArray; | ||
path: number[]; | ||
treeIndex: number; | ||
@@ -9,0 +9,0 @@ isSearchMatch: boolean; |
@@ -1,2 +0,2 @@ | ||
import 'react-virtualized/styles.css'; | ||
/// <reference types="react" /> | ||
import './react-sortable-tree.css'; | ||
@@ -3,0 +3,0 @@ declare const SortableTreeWithoutDndContext: (props: any) => JSX.Element; |
import React from 'react'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import './tree-node.css'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import { NumberOrStringArray, TreeItem, TreePath } from '.'; | ||
import { TreeItem, TreePath } from '.'; | ||
export interface TreeNode { | ||
@@ -30,5 +30,5 @@ node: TreeItem; | ||
node: TreeItem; | ||
path: NumberOrStringArray; | ||
path: number[]; | ||
} | ||
declare const TreeNode: React.FC<TreeRendererProps>; | ||
export default TreeNode; |
import React from 'react'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import { TreeItem } from '.'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
declare type TreePlaceholderProps = { | ||
@@ -5,0 +5,0 @@ children: any; |
import React from 'react'; | ||
import { ConnectDragPreview, ConnectDragSource } from 'react-dnd'; | ||
import './node-renderer-default.css'; | ||
import { NodeData, TreeItem, NumberOrStringArray } from '.'; | ||
import { ConnectDragPreview, ConnectDragSource } from 'react-dnd'; | ||
import { NodeData, TreeItem } from '.'; | ||
export interface NodeRendererProps { | ||
node: TreeItem; | ||
path: NumberOrStringArray; | ||
path: number[]; | ||
treeIndex: number; | ||
@@ -9,0 +9,0 @@ isSearchMatch: boolean; |
{ | ||
"name": "@nosferatu500/react-sortable-tree", | ||
"version": "4.0.0-beta.0", | ||
"version": "4.0.0-beta.1", | ||
"description": "Drag-and-drop sortable component for nested data and hierarchies", | ||
"main": "./index.js", | ||
"module": "./esm/index.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./": "./", | ||
".": { | ||
"types": "./index.d.ts", | ||
"module": "./esm/index.js", | ||
"import": "./esm/index.js", | ||
"import": "./esm/index.mjs", | ||
"default": "./index.js" | ||
@@ -22,2 +20,5 @@ } | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"repository": { | ||
@@ -43,13 +44,12 @@ "type": "git", | ||
"dependencies": { | ||
"@nosferatu500/react-dnd-scrollzone": "^2.0.0", | ||
"@nosferatu500/react-dnd-scrollzone": "^2.0.2", | ||
"lodash.isequal": "^4.5.0", | ||
"prop-types": "^15.7.2", | ||
"react-dnd": "^14.0.2", | ||
"react-dnd-html5-backend": "^14.0.0", | ||
"react-lifecycles-compat": "^3.0.4", | ||
"react-virtualized": "^9.22.3" | ||
"react-dnd": "^14.0.4", | ||
"react-dnd-html5-backend": "^14.0.2", | ||
"react-virtuoso": "^2.2.1" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=17.0.0", | ||
"react-dnd": ">=11.0.0", | ||
"react-dnd": ">=14.0.0", | ||
"react-dom": ">=17.0.0" | ||
@@ -61,3 +61,3 @@ }, | ||
"not dead", | ||
"not ie <= 11", | ||
"not ie", | ||
"not op_mini all" | ||
@@ -64,0 +64,0 @@ ], |
@@ -1,2 +0,2 @@ | ||
import 'react-virtualized/styles.css'; | ||
/// <reference types="react" /> | ||
import './react-sortable-tree.css'; | ||
@@ -3,0 +3,0 @@ declare const SortableTreeWithoutDndContext: (props: any) => JSX.Element; |
@@ -128,14 +128,9 @@ # Note | ||
| shouldCopyOnOutsideDrop | func or bool | Return true, or a callback returning true, and dropping nodes to react-dnd drop targets outside of the tree will not remove them from the tree. Defaults to `false`. <div>`({ node: object, prevPath: number[] or string[], prevTreeIndex: number, }): bool`</div> | | ||
| reactVirtualizedListProps | object | Custom properties to hand to the internal [react-virtualized List](https://github.com/bvaughn/react-virtualized/blob/master/docs/List.md#prop-types) | | ||
| style | object | Style applied to the container wrapping the tree (style defaults to `{height: '100%'}`) | | ||
| innerStyle | object | Style applied to the inner, scrollable container (for padding, etc.) | | ||
| className | string | Class name for the container wrapping the tree | | ||
| rowHeight | number or func | Used by react-sortable-tree. Defaults to `62`. Either a fixed row height (number) or a function that returns the height of a row given its index: `({ treeIndex: number, node: object, path: number[] or string[] }): number` | | ||
| slideRegionSize | number | Size in px of the region near the edges that initiates scrolling on dragover. Defaults to `100`. | | ||
| scaffoldBlockPxWidth | number | The width of the blocks containing the lines representing the structure of the tree. Defaults to `44`. | | ||
| isVirtualized | bool | Set to false to disable virtualization. Defaults to `true`. **NOTE**: Auto-scrolling while dragging, and scrolling to the `searchFocusOffset` will be disabled. | | ||
| nodeContentRenderer | any | Override the default component ([`NodeRendererDefault`](https://github.com/nosferatu500/react-sortable-tree/blob/master/src/node-renderer-default.js)) for rendering nodes (but keep the scaffolding generator). This is a last resort for customization - most custom styling should be able to be solved with `generateNodeProps`, a `theme` or CSS rules. If you must use it, is best to copy the component in `node-renderer-default.js` to use as a base, and customize as needed. | | ||
| placeholderRenderer | any | Override the default placeholder component ([`PlaceholderRendererDefault`](https://github.com/nosferatu500/react-sortable-tree/blob/master/src/placeholder-renderer-default.js)) which is displayed when the tree is empty. This is an advanced option, and in most cases should probably be solved with a `theme` or custom CSS instead. | | ||
| cssNonce | string | Content-Security-Policy nonce to use with inline `<style>` tags in virtualized mode. | | ||
## Data Helper Functions | ||
@@ -142,0 +137,0 @@ |
import React from 'react'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import './tree-node.css'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import { NumberOrStringArray, TreeItem, TreePath } from '.'; | ||
import { TreeItem, TreePath } from '.'; | ||
export interface TreeNode { | ||
@@ -30,5 +30,5 @@ node: TreeItem; | ||
node: TreeItem; | ||
path: NumberOrStringArray; | ||
path: number[]; | ||
} | ||
declare const TreeNode: React.FC<TreeRendererProps>; | ||
export default TreeNode; |
import React from 'react'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
import { TreeItem } from '.'; | ||
import { ConnectDropTarget } from 'react-dnd'; | ||
declare type TreePlaceholderProps = { | ||
@@ -5,0 +5,0 @@ children: any; |
@@ -1,6 +0,6 @@ | ||
/// <reference types="react" /> | ||
import { ReactNode } from 'react'; | ||
export interface GetTreeItemChildren { | ||
done: (children: TreeItem[]) => void; | ||
node: TreeItem; | ||
path: NumberOrStringArray; | ||
path: number[]; | ||
lowerSiblingCounts: number[]; | ||
@@ -11,6 +11,5 @@ treeIndex: number; | ||
export declare type GetNodeKeyFunction = (data: TreeIndex & TreeNode) => string | number; | ||
export declare type NumberOrStringArray = Array<string | number>; | ||
export interface TreeItem { | ||
title?: React.ReactNode | undefined; | ||
subtitle?: React.ReactNode | undefined; | ||
title?: ReactNode | undefined; | ||
subtitle?: ReactNode | undefined; | ||
expanded?: boolean | undefined; | ||
@@ -24,3 +23,3 @@ children?: TreeItem[] | GetTreeItemChildrenFn | undefined; | ||
export interface TreePath { | ||
path: NumberOrStringArray | number; | ||
path: number[]; | ||
} | ||
@@ -36,5 +35,5 @@ export interface TreeIndex { | ||
export interface SearchData extends NodeData { | ||
searchQuery: any; | ||
searchQuery: string; | ||
} | ||
export declare const defaultGetNodeKey: ({ treeIndex }: TreeIndex) => number; | ||
export declare const defaultSearchMethod: ({ node, path, treeIndex, searchQuery, }: SearchData) => boolean; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
286647
9
7938
234
+ Addedreact-virtuoso@^2.2.1
+ Added@virtuoso.dev/react-urx@0.2.13(transitive)
+ Added@virtuoso.dev/urx@0.2.13(transitive)
+ Addedreact-virtuoso@2.19.1(transitive)
- Removedreact-lifecycles-compat@^3.0.4
- Removedreact-virtualized@^9.22.3
- Removedclsx@1.2.1(transitive)
- Removedcsstype@3.1.3(transitive)
- Removeddom-helpers@5.2.1(transitive)
- Removedreact@18.3.1(transitive)
- Removedreact-dom@18.3.1(transitive)
- Removedreact-lifecycles-compat@3.0.4(transitive)
- Removedreact-virtualized@9.22.5(transitive)
- Removedscheduler@0.23.2(transitive)
Updatedreact-dnd@^14.0.4