mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #27923 from acemac/rst
react-sortable-tree missing prop 'shouldCopyOnOutsideDrop'
This commit is contained in:
Vendored
+8
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Wouter Hardeman <https://github.com/wouterhardeman>
|
||||
// Jovica Zoric <https://github.com/jzoric>
|
||||
// Kevin Perrine <https://github.com/kevinsperrine>
|
||||
// Alex Maclean <https://github.com/acemac>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -70,6 +71,12 @@ export interface OnDragPreviousAndNextLocation extends PreviousAndNextLocation {
|
||||
nextParent: TreeItem | null;
|
||||
}
|
||||
|
||||
export interface ShouldCopyData {
|
||||
node: TreeNode;
|
||||
prevPath: NumberArrayOrStringArray;
|
||||
prevTreeIndex: number;
|
||||
}
|
||||
|
||||
export interface OnMovePreviousAndNextLocation extends PreviousAndNextLocation {
|
||||
nextParentNode: TreeItem | null;
|
||||
}
|
||||
@@ -186,6 +193,7 @@ export interface ReactSortableTreeProps {
|
||||
dndType?: string;
|
||||
placeholderRenderer?: PlaceholderRenderer;
|
||||
theme?: ThemeProps;
|
||||
shouldCopyOnOutsideDrop?: boolean | ((data: ShouldCopyData) => boolean);
|
||||
}
|
||||
|
||||
declare const SortableTree: React.ComponentClass<ReactSortableTreeProps>;
|
||||
|
||||
@@ -69,11 +69,13 @@ class Test extends React.Component {
|
||||
dndType="testNodeType"
|
||||
placeholderRenderer={PlaceholderRenderer}
|
||||
theme={theme}
|
||||
shouldCopyOnOutsideDrop={true}
|
||||
/>
|
||||
<SortableTreeWithoutDndContext
|
||||
treeData={[{title: "Title", subtitle: "Subtitle", children: []}]}
|
||||
onChange={(treeData: TreeItem[]) => {}}
|
||||
style={{width: "100px"}}
|
||||
shouldCopyOnOutsideDrop={() => false}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user