0.3.2 • Published 10 years ago

react-lite-uploader v0.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

React Lite Uploader

This project is no mature, do not use it in production!

Uploader component from Talk by Teambition.

Demo http://ui.talk.ai/react-lite-uploader

Based on the work of https://github.com/mailru/FileAPI

Supposition

Contains internal business logic defined at Talk by Teambition.

Usage

npm i --save react-lite-uploader
UploadButton = require('react-lite-uploader').Button
UploadArea = require('react-lite-uploader').Area
uploadUtil = require('react-lite-uploader').util

UploadButton, UploadArea: React Components

props:

  • url, string, server url to upload files, required
  • headers, object of headers, optional
  • accept, string of accepted types, seperated by commas like jpg,png, optional, defaults to ''
  • multiple, bool, optional, defaults to false
  • onFileHover, function to response to dragging files, optional(only used handling dropping files)
  • onCreate, function, optional
  • onProgress, function, optional
  • onSuccess, function, required
  • onError, function, required

Notice: UploadArea is not suggested due to the lack of flexibility, use uploadUtil instead.

uploadUtil: utilities to handle dropping and pasting
  • uploadUtil.handleFileDropping (event, props) ->
  • uploadUtil.handlePasteEvent (targetElement, props) ->
  • uploadUtil.onFilesLoad (files, props) ->

Remember to include react-lite-uploader/src/styles.css in you project.

Read page.coffee for details.

Develop

Based on Jianliao's project template:

https://github.com/teambition/coffee-webpack-starter

License

MIT

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago