wip: basic list dnd with animation

This commit is contained in:
Joao Moreno
2019-01-08 16:41:39 +01:00
parent 669b8c9cd4
commit fd3188fbb6
8 changed files with 311 additions and 59 deletions

View File

@@ -130,6 +130,23 @@ function asObjectTreeOptions<TInput, T, TFilterData>(options?: IAsyncDataTreeOpt
return options.identityProvider!.getId(el.element as T);
}
},
dnd: options.dnd && {
getDragURI(node) {
return options.dnd!.getDragURI(node.element as T);
},
getDragLabel: options.dnd!.getDragLabel && ((nodes) => {
return options.dnd!.getDragLabel!(nodes.map(node => node.element as T));
}),
onDragStart(data, originalEvent) {
return options.dnd!.onDragStart(data, originalEvent);
},
onDragOver(data, targetNode, originalEvent) {
return options.dnd!.onDragOver(data, targetNode.element as T, originalEvent);
},
drop(data, targetNode, originalEvent) {
return options.dnd!.drop(data, targetNode.element as T, originalEvent);
}
},
multipleSelectionController: options.multipleSelectionController && {
isSelectionSingleChangeEvent(e) {
return options.multipleSelectionController!.isSelectionSingleChangeEvent({ ...e, element: e.element } as any);