A component for picking files
ember install ember-frost-file-picker
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 |
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')
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
git clone [email protected]:ciena-frost/ember-frost-file-picker.git
cd ember-frost-file-picker
npm install && bower install
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.
Run npm test
from the root of the project to run linting checks as well as execute the test suite
and output code coverage.