d-file-select

1.0.0 • Public • Published

Derby File Select

A Derby JS component for selecting files.

Installation

$ npm install d-file-select --save

Usage

Create a view:

<index: element="file-select">
  <div as="dropzone">
    <input type="file" as="input">
  </div>

Associate your view with the component:

app.component('file-select', require('d-file-select'));

Elements

dropzone - The region that a file can be dragged and dropped onto.

input - The <input type="file"> element that can select a new image.

Data

The following path data is available to views implementing the component:

files - The uploaded files.

Options

accept - Accepted file types.

Functions

change($event) - Use if you have multiple file inputs that must implement the change event.

clear() - Clear selected files.

dragenter($event) - Use if you have multiple dropzones that must implement the dragenter event.

dragover($event) - Use if you have multiple dropzones that must implement the dragover event.

drop($event) - Use if you have multiple dropzones that must implement the drag event.

Events

clear() - Event emitted after clearing the files.

select(files) - Event emitted after files are selected.

Package Sidebar

Install

npm i d-file-select

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • psirenny