gknoy / ember-frost-file-picker

A file picker component

Home Page:http://ciena-frost.github.io/ember-frost-file-picker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ember-frost-file-picker

A component for picking files

Dependencies

Ember NPM

Health

Travis Coveralls

Security

bitHound

Ember Observer score

EmberObserver

Installation

ember install ember-frost-file-picker

API

Attribute Type Value Description
accept string <file-extension> Comma separated list of file types accepted
onChange string <action-name> Triggers action when file selection changes
placeholderText string <input-placeholder> Defines input placeholder text. Default is 'Drop your file here'
validate string <action-name> Action to trigger to validate file content
validateDrag string <action-name> Action to trigger to determine if isDragging should be applied. In Chrome, you can check event.dataTransfer.items[0] for information on the item being dragged

Testing with ember-hook

The file picker component is accessible using ember-hook with the top level hook name or you can access the internal components as well -

  • Default top level hook - $hook('file-picker')
  • Browse button hook - $hook('<hook-name>-button')
  • Input field hook - $hook('<hook-name>-input')

Examples

Detailed API and example usage can be found in the sample application in tests/dummy, which is also running at http://ciena-frost.github.io/ember-frost-file-picker

Development

Setup

git clone git@github.com:ciena-frost/ember-frost-file-picker.git
cd ember-frost-file-picker
npm install && bower install

Development Server

A dummy application for development is available under ember-frost-file-picker/tests/dummy. To run the server run ember server (or npm start) from the root of the repository and visit the app at http://localhost:4200.

Testing

Run npm test from the root of the project to run linting checks as well as execute the test suite and output code coverage.

About

A file picker component

http://ciena-frost.github.io/ember-frost-file-picker/

License:MIT License


Languages

Language:JavaScript 69.0%Language:HTML 15.5%Language:CSS 8.6%Language:Shell 6.9%