Interface: DropZoneOptions
Defined in: dom/src/file/drop-zone.ts:18
Properties
accept?
optional accept?: string;
Defined in: dom/src/file/drop-zone.ts:24
Which files to take, written the way the accept attribute of a file
input is: a comma separated list of extensions (.wav), MIME types
(audio/wav) and type groups (audio/*).
disabled?
optional disabled?: boolean;
Defined in: dom/src/file/drop-zone.ts:38
Refuse the drop. The drag is still swallowed rather than let through: an unhandled drop makes the browser leave the page and open the file.
Default
false
multiple?
optional multiple?: boolean;
Defined in: dom/src/file/drop-zone.ts:31
Take more than one file from a single drop. With it off, only the first
accepted file is reported, as a file input without multiple does.
Default
false
onDrop?
optional onDrop?: (files, event) => void;
Defined in: dom/src/file/drop-zone.ts:41
Called with the dropped files that match accept.
Parameters
| Parameter | Type |
|---|---|
files | File[] |
event | DragEvent |
Returns
void
onReject?
optional onReject?: (files, event) => void;
Defined in: dom/src/file/drop-zone.ts:47
Called with the dropped files that do not match accept, so that the
reason can be shown. It comes after onDrop for the same drop, so a list
of rejected files can be cleared in onDrop and filled here.
Parameters
| Parameter | Type |
|---|---|
files | File[] |
event | DragEvent |
Returns
void
onStateChange?
optional onStateChange?: (state) => void;
Defined in: dom/src/file/drop-zone.ts:49
Called whenever DropZoneInstance.state would change.
Parameters
| Parameter | Type |
|---|---|
state | DropZoneState |
Returns
void