vue-formular
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -1,6 +0,6 @@ | ||
module.exports = function(item, show) { | ||
module.exports = function(item, show, rule) { | ||
var unique = true; | ||
this.$parent.errors.forEach(function(error, i) { | ||
if (error.name==item.name) { | ||
if (error.name==item.name && error.rule==rule) { | ||
this.$parent.errors[i].show = show; | ||
@@ -7,0 +7,0 @@ unique = false; |
@@ -30,2 +30,3 @@ var validator = require('../../validation/rules/*.js',{mode:'hash'}) | ||
if (this.inForm()) this.removeFormError(formError); | ||
} else { | ||
@@ -37,4 +38,5 @@ | ||
} | ||
if (this.inForm()) this.addFormError(formError,!this.pristine); | ||
if (this.inForm()) { | ||
this.addFormError(formError,!this.pristine, rule); | ||
} | ||
} | ||
@@ -41,0 +43,0 @@ |
@@ -5,5 +5,2 @@ module.exports = { | ||
methods: { | ||
isString: function(message) { | ||
return typeof message=='string'; | ||
}, | ||
showError: function(error) { | ||
@@ -24,19 +21,14 @@ | ||
computed: { | ||
content: function() { | ||
if (this.$parent.statusbarMessage && !this.showableErrors.length) | ||
return this.$parent.statusbarMessage; | ||
if (this.$parent.serverErrors.length && !this.showableErrors.length) { | ||
return this.$parent.serverErrors; | ||
} | ||
errors: function() { | ||
if (this.showableErrors.length) { | ||
this.$parent.serverErrors = ''; | ||
this.$parent.statusbarMessage = ''; | ||
this.$parent.status = 'danger'; | ||
this.$parent.statusbarMessage = ''; | ||
this.$parent.serverErrors = []; | ||
return this.showableErrors; | ||
return this.showableErrors; | ||
} | ||
return ''; | ||
if (this.$parent.serverErrors.length) | ||
return this.$parent.serverErrors; | ||
return []; | ||
}, | ||
@@ -58,2 +50,3 @@ showableErrors: function() { | ||
errorText: function() { | ||
var texts = this.$parent.options.texts; | ||
@@ -60,0 +53,0 @@ var count = this.showableErrors.length?this.showableErrors.length:this.$parent.serverErrors.length; |
@@ -13,2 +13,4 @@ module.exports = function() { | ||
this.$dispatch('vue-formular.sending', data); | ||
this.serverErrors = ''; | ||
this.status = 'info'; | ||
@@ -15,0 +17,0 @@ this.statusbarMessage = this.options.texts.sending; |
{ | ||
"name": "vue-formular", | ||
"description": "a comprehensive vue.js form component", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "vue", |
# Vue Formular | ||
[![Build Status](https://travis-ci.org/matfish2/vue-formular.svg?branch=master)](https://travis-ci.org/matfish2/vue-formular) | ||
[![npm version](https://badge.fury.io/js/vue-formular.svg)](https://badge.fury.io/js/vue-formular) [![Build Status](https://travis-ci.org/matfish2/vue-formular.svg?branch=master)](https://travis-ci.org/matfish2/vue-formular) | ||
@@ -24,4 +24,6 @@ This vue.js package offers a comperhensive solution for HTML form management, including presentation, validation and submitting the form using an AJAX request. | ||
## Option 1 (Recommended) - using `browserify` with the `stringify` and `require-globify` transforms. | ||
## Option 1 (Recommended) | ||
Compilation requires `browserify` with the `stringify` and `require-globify` transforms. | ||
npm install vue-formular | ||
@@ -237,2 +239,3 @@ | ||
* `labelWidth` `number` relevant only for horizontal layout. The number of grid columns allocated for the label. Defaults to `3`. | ||
* `showClientErrorsInStatusBar` `boolean` Show client errors in the status bar, with links to the relevant fields, in addition to the error shown under each field. Useful for long forms. Deault: `false` | ||
* `additionalPayload` `object` Custom data you want to send along with the form. Serves a similar purpose to that of a hidden input field | ||
@@ -239,0 +242,0 @@ * `customRules` `object` See [above](#custom-rules) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42972
251
893