3.1.1 • Published 8 years ago

apeman-react-upload v3.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

apeman-react-upload

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for file upload components.

Installation

$ npm install apeman-react-upload --save

Demo

Live demo is hosted on GitHub Pages.

Demo Image

Usage

'use strict'

import React from 'react'
import {ApUpload, ApUploadStyle} from 'apeman-react-upload'

const ExampleComponent = React.createClass({
  render () {
    const s = this
    return (
      <div>
        <ApUploadStyle/>
        <ApUpload multiple={ false }
                  id="demo-file-upload-01"
                  name="file-input-01"
                  accept="image/*"
                  onLoad={ s.handleLoaded }
                  onError={ s.handleError }/>
      </div>
    )
  },
  handleLoaded (urls) {
    console.log('Image urls:', urls)
    /* ... */
  },
  handleError (err) {
    /* ... */
  }
})

Components

ApUploadStyle

Props

NameTypeDefaultDescription
styleobject{}
highlightColorstringApStyle.DEFAULT_HIGHLIGHT_COLOR
backgroundColorstringApStyle.DEFAULT_BACKGROUND_COLOR

ApUpload

Props

NameTypeDefaultDescription
namestringnullName of input
idstring`ap-upload-${uuid.v4()}`DOM id of input
multipleboolfalseAllow multiple upload
onChangefuncnullHandler for change event
onLoadfuncnullHandler for load event
onErrorfuncnullHandler for error event
widthnumber180Image width
heightnumber180Image height
textstring'Upload file'Guide text
acceptstringnullAccept file type
iconstring'fa fa-cloud-upload'Guide icon
closeIconstring'fa fa-close'Icon for close images
spinnerstringSpinner theme
valuestringarrayValue of input
spinnerIconApSpinner.DEFAULT_THEME

License

This software is released under the MIT License.

Links

3.1.1

8 years ago

3.1.0

8 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago