Skip to content

Commit 8263237

Browse files
Merge pull request #387 from wearebraid/release/2.5.1
Release/2.5.1
2 parents 9452009 + d46081a commit 8263237

19 files changed

+158
-54
lines changed

dist/formulate.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/specimens/SpecimenFile.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
name="file"
2121
type="file"
2222
:outer-class="['file-input-2']"
23+
:value="[{ url: 'apple.pdf' }]"
2324
help="Select any file to upload"
2425
validation="mime:application/pdf"
2526
/>

nuxt/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import fs from 'fs'
2+
import path from 'path'
3+
4+
export default function nuxtVueFormulate (moduleOptions) {
5+
let formulateOptions = Object.assign({}, this.options.formulate, moduleOptions)
6+
let configPath = false
7+
// check if we have a user-provided config path
8+
// or if a config file exists in the default location
9+
if (formulateOptions.configPath) {
10+
configPath = formulateOptions.configPath
11+
} else if (fs.existsSync(`${this.options.srcDir}/formulate.config.js`)) {
12+
configPath = '~/formulate.config.js'
13+
}
14+
// add the parsed config path back into the options object
15+
formulateOptions = Object.assign({}, formulateOptions, { configPath })
16+
// Register `plugin.js` template
17+
this.addPlugin({
18+
src: path.resolve(__dirname, 'plugin.js'),
19+
options: formulateOptions
20+
})
21+
}

nuxt/plugin.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
import VueFormulate from '@braid/vue-formulate'
3+
<% if (options.configPath) { %>
4+
import options from '<%= options.configPath %>'
5+
<% } else { %>
6+
const options = {}
7+
<% } %>
8+
9+
Vue.use(VueFormulate, options)

package-lock.json

Lines changed: 25 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@braid/vue-formulate",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "The easiest way to build forms in Vue.",
55
"main": "dist/formulate.umd.js",
66
"module": "dist/formulate.esm.js",
@@ -92,7 +92,7 @@
9292
"watch": "^1.0.2"
9393
},
9494
"dependencies": {
95-
"@braid/vue-formulate-i18n": "^1.14.0",
95+
"@braid/vue-formulate-i18n": "^1.15.0",
9696
"is-plain-object": "^3.0.1",
9797
"is-url": "^1.2.4",
9898
"nanoid": "^2.1.11"

src/FileUpload.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ class FileUpload {
227227
// Create a new mutable FileList
228228
if (this.supportsDataTransfers) {
229229
const transfer = new DataTransfer()
230-
this.files.forEach(file => transfer.items.add(file.file))
230+
this.files.forEach(file => {
231+
if (file.file instanceof File) {
232+
transfer.items.add(file.file)
233+
}
234+
})
231235
this.fileList = transfer.files
232236
this.input.files = this.fileList
233237
// Reset the merged FileList to empty

src/FormulateForm.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ export default {
6969
invalidMessage: {
7070
type: [Boolean, Function, String],
7171
default: false
72+
},
73+
debounce: {
74+
type: [Boolean, Number],
75+
default: false
7276
}
7377
},
7478
data () {
@@ -195,6 +199,7 @@ export default {
195199
created () {
196200
this.$formulate.register(this)
197201
this.applyInitialValues()
202+
this.$emit('created', this)
198203
},
199204
destroyed () {
200205
this.$formulate.deregister(this)

0 commit comments

Comments
 (0)