0.0.8 • Published 7 years ago

@miasta/vue-file-tray v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

vue-file-tray

Part of the M2 UI suite.

Component to process, upload and interact with files.

This component is used to process files. Most common use case is of course uploading files to server, but file-tray does not do any uploading on it's own. Instead, it stores the files data in accessible files property, so you can process them however you like.

Front end users can add files to file-tray by dropping them over it, or using standard browser dialog.

file-tray can take care of validation, will generate data for thumbnails, or for crunched version of images. How to further upload or process the files is up to the you.

file-tray is a single element component – it's just a plain <div> – this means that you can style it whatever you like. it also has a default slot, so you can have content in it. This makes file-tray a very flexible component. Remember to add some styling when you render it, otherwise it will not be visible.


props

propertytypedefaultcomment
maxFileSizeNumber10Max file size in MB.
maxFilesNumber10Max number of files you can add.
acceptedArray['image/*']Accepted mime types.
dragAddBooleantrueAllow for adding files by drag and drop.
clickAddBooleantrueOpen file dialog on click
thumbsBooleantrueShould genereate thumbnails
thumbSizesArray[300,300][width, height] in px
processImagesBooleanfalseShould generate processed images
maxEdgeNumber1200Processed images largest dimenssion (px)
qualityNumber0.92JPEG processing quality 0-1

data

propertycomment
filesArray of files in the file-tray. Also contains thumb Blob, thumb url, processed Blob and processed url.
overBoolean – whether files are dragged over.

methods

methodargscomment
openFinder()Open file dialog.

events

namepayloadcomment
error:acceptedRejected mime type.
error:maxFileSizeFile too large.
error:maxFilesToo many files.
file:addedFile added. Payload is file ID.
files:changedAny changes to files property
0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago