From 715b70bc017dffb2c014692cff8e9e423612d1e6 Mon Sep 17 00:00:00 2001 From: Alex Regan Date: Sat, 16 Sep 2017 15:58:26 -0700 Subject: [PATCH] feat: add customizeable class names for dragging --- README.md | 16 ++++++++++++---- package.json | 10 +++------- src/classes/VTransmitFile.js | 3 +-- src/components/VueTransmit.vue | 34 +++++++++++++++++++++++----------- src/core/props.js | 6 +++++- test/index.php | 5 ++++- 6 files changed, 48 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 2c0e7af..cc5bcd9 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![GitHub issues](https://img.shields.io/github/issues/alexsasharegan/vue-transmit.svg?style=flat)](https://github.com/alexsasharegan/vue-transmit/issues) [![GitHub stars](https://img.shields.io/github/stars/alexsasharegan/vue-transmit.svg)](https://github.com/alexsasharegan/vue-transmit/stargazers) [![GitHub forks](https://img.shields.io/github/forks/alexsasharegan/vue-transmit.svg)](https://github.com/alexsasharegan/vue-transmit/network) +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) [![Twitter](https://img.shields.io/twitter/url/https/github.com/alexsasharegan/vue-transmit.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Falexsasharegan%2Fvue-transmit) A Vue.js drag & drop uploader based on Dropzone.js (`~26kB`, `~9kB` gzipped). Many thanks to [Matias Meno](https://gitlab.com/meno/dropzone/tree/master) for paving the way with the original Dropzone.js! [Check it out](https://gitlab.com/meno/dropzone/tree/master) for any of your non-vue projects. 🙌 @@ -29,7 +30,7 @@ Also, a special File class has been written (`VTransmitFile`) to add useful info |Property|Type|Default| |---|---|---| |tag|String|"div"| -|dropZoneClasses|Array, Object, String|null| +|uploadAreaClasses|Array, Object, String|null| |url|String|undefined| |method|String|"post"| |withCredentials|Boolean|false| @@ -113,7 +114,8 @@ This slot receives a number of props: addedFiles: VTransmitFile[], queuedFiles: VTransmitFile[], uploadingFiles: VTransmitFile[], - activeFiles: VTransmitFile[] + activeFiles: VTransmitFile[], + isUploading: Boolean } ``` @@ -148,7 +150,6 @@ This slot receives a number of props: "height": 700, "xhr": {}, "dataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAgAElEQVR4XlS9B7RmZ3UluG/...=", - "VERSION": "1.0.5" } ``` @@ -177,7 +178,14 @@ This slot receives a number of props:
-
{{ file | json }}
+
+

{{ file.name }}

+
+
+
+
{{ file | json }} 
+
diff --git a/package.json b/package.json index 7cd217e..77f4657 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,7 @@ "module": "index.js", "jsnext:main": "index.js", "main": "dist/vue-transmit.min.js", - "keywords": [ - "dragndrop", - "drag and drop", - "file upload", - "upload" - ], + "keywords": ["dragndrop", "drag and drop", "file upload", "upload"], "directories": { "test": "test" }, @@ -19,7 +14,8 @@ "dev": "cross-env NODE_ENV=development webpack --progress --hide-modules -w", "test": "php -S localhost:3000 -t ./test/", "lib-size": "gzip -c dist/vue-transmit.min.js | wc -c", - "release": "standard-version" + "release": "standard-version", + "release:publish": "git push --follow-tags origin master; npm publish" }, "dependencies": { "lodash-es": "^4.17.4", diff --git a/src/classes/VTransmitFile.js b/src/classes/VTransmitFile.js index 3f5fef8..2bf84f9 100644 --- a/src/classes/VTransmitFile.js +++ b/src/classes/VTransmitFile.js @@ -105,8 +105,7 @@ export default class VTransmitFile { height: undefined, xhr: undefined, dataUrl: undefined, - errorMessage: undefined, - VERSION: VERSION + errorMessage: undefined } } diff --git a/src/components/VueTransmit.vue b/src/components/VueTransmit.vue index 9d882b9..b40f1ca 100644 --- a/src/components/VueTransmit.vue +++ b/src/components/VueTransmit.vue @@ -1,8 +1,8 @@