Class Dropzone

Fork of: https://github.com/donmccurdy/simple-dropzone updated: Mar 2021 The MIT License (MIT) Copyright (c) 2018 Don McCurdy

Changes: Convert to typescript. webkitRelativePath for file input select. Removed unzip and dependency(done in importer).

Watches an element for file drops, parses to create a filemap hierarchy, and emits the result.

Constructors

Properties

_el?: HTMLElement
_inputEl?: HTMLInputElement
_listeners: Record<DropEventType, ListenerCallback[]>
USE_DATA_TRANSFER_ITEMS: boolean = true

Use dataTransfer.items when available instead of dataTransfer.files (when files are dropped)

Set to false to use dataTransfer.files only. This is useful for environments where files cannot be read from FileSystemEntry like in figma plugins/widgets.

Accessors

Methods

  • Iterates through a list of FileSystemEntry objects, creates the fileMap tree, and emits the result.

    Parameters

    • fileMap: Map<string, DropFile>
    • entries: (null | FileSystemEntry)[]
    • e: DragEvent

    Returns void

Generated using TypeDoc