This component provides a target on which local files can be dropped during a drag and drop operation. It is a wrapper around another ZUI component that is the actual target. Frequently the target is a TextUI which a message but it actually can be anything.
Parameters
- target:ZUI – this is the component(s) that are the actual visual target for the drop.
Attributes
- drop(onDrop:(files:File[])=>void) – this provides the onDrop function to be called whenever a drag operation drops a file or files onto the target. The files parameter will contain an array of one or more files that have been dropped.
- hoverStyle(hstyle:string) – This sets the css class to be used when a drag item hovers over the target. There is already a default hover style, but this allows it to be customized for your app.
Examples
new FileDropTargetUI( new TextUI("drop .csv file here") ).hoverStyle("CoolCSSHover");
Styling
- FileDropTargetUI-drop – this is the default style for when a droppable file is hovered over the target.