1
0
mirror of synced 2024-11-29 08:36:12 +03:00
This commit is contained in:
Justin Schroeder 2020-01-28 16:53:13 -05:00
parent 4a53d17fc7
commit 5c00230bc7
8 changed files with 56 additions and 19 deletions

16
dist/formulate.esm.js vendored
View File

@ -1047,8 +1047,8 @@ function mergedValidationName () {
* @return {boolean} * @return {boolean}
*/ */
function showFieldErrors () { function showFieldErrors () {
if (this.showErrors) { if (this.showErrors || this.formShouldShowErrors) {
return this.showErrors return true
} }
return this.behavioralErrorVisibility return this.behavioralErrorVisibility
} }
@ -1178,7 +1178,7 @@ var script = {
default: 'text' default: 'text'
}, },
name: { name: {
type: [Boolean, String], type: [String, Boolean],
default: true default: true
}, },
/* eslint-disable */ /* eslint-disable */
@ -1274,6 +1274,7 @@ var script = {
localAttributes: {}, localAttributes: {},
internalModelProxy: this.formulateValue, internalModelProxy: this.formulateValue,
behavioralErrorVisibility: (this.errorBehavior === 'live'), behavioralErrorVisibility: (this.errorBehavior === 'live'),
formShouldShowErrors: false,
validationErrors: [], validationErrors: [],
pendingValidation: Promise.resolve() pendingValidation: Promise.resolve()
} }
@ -1575,7 +1576,8 @@ var script$1 = {
data: function data () { data: function data () {
return { return {
registry: {}, registry: {},
internalFormModelProxy: {} internalFormModelProxy: {},
formShouldShowErrors: false
} }
}, },
computed: { computed: {
@ -1635,8 +1637,14 @@ var script$1 = {
}, },
formSubmitted: function formSubmitted () { formSubmitted: function formSubmitted () {
// perform validation here // perform validation here
this.showErrors();
this.$emit('submit', this.formModel); this.$emit('submit', this.formModel);
}, },
showErrors: function showErrors () {
for (var fieldName in this.registry) {
this.registry[fieldName].formShouldShowErrors = true;
}
},
getFormValues: function getFormValues () { getFormValues: function getFormValues () {
return this.internalFormModelProxy return this.internalFormModelProxy
} }

16
dist/formulate.min.js vendored
View File

@ -1050,8 +1050,8 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
* @return {boolean} * @return {boolean}
*/ */
function showFieldErrors () { function showFieldErrors () {
if (this.showErrors) { if (this.showErrors || this.formShouldShowErrors) {
return this.showErrors return true
} }
return this.behavioralErrorVisibility return this.behavioralErrorVisibility
} }
@ -1181,7 +1181,7 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
default: 'text' default: 'text'
}, },
name: { name: {
type: [Boolean, String], type: [String, Boolean],
default: true default: true
}, },
/* eslint-disable */ /* eslint-disable */
@ -1277,6 +1277,7 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
localAttributes: {}, localAttributes: {},
internalModelProxy: this.formulateValue, internalModelProxy: this.formulateValue,
behavioralErrorVisibility: (this.errorBehavior === 'live'), behavioralErrorVisibility: (this.errorBehavior === 'live'),
formShouldShowErrors: false,
validationErrors: [], validationErrors: [],
pendingValidation: Promise.resolve() pendingValidation: Promise.resolve()
} }
@ -1578,7 +1579,8 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
data: function data () { data: function data () {
return { return {
registry: {}, registry: {},
internalFormModelProxy: {} internalFormModelProxy: {},
formShouldShowErrors: false
} }
}, },
computed: { computed: {
@ -1638,8 +1640,14 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
}, },
formSubmitted: function formSubmitted () { formSubmitted: function formSubmitted () {
// perform validation here // perform validation here
this.showErrors();
this.$emit('submit', this.formModel); this.$emit('submit', this.formModel);
}, },
showErrors: function showErrors () {
for (var fieldName in this.registry) {
this.registry[fieldName].formShouldShowErrors = true;
}
},
getFormValues: function getFormValues () { getFormValues: function getFormValues () {
return this.internalFormModelProxy return this.internalFormModelProxy
} }

16
dist/formulate.umd.js vendored
View File

@ -1053,8 +1053,8 @@
* @return {boolean} * @return {boolean}
*/ */
function showFieldErrors () { function showFieldErrors () {
if (this.showErrors) { if (this.showErrors || this.formShouldShowErrors) {
return this.showErrors return true
} }
return this.behavioralErrorVisibility return this.behavioralErrorVisibility
} }
@ -1184,7 +1184,7 @@
default: 'text' default: 'text'
}, },
name: { name: {
type: [Boolean, String], type: [String, Boolean],
default: true default: true
}, },
/* eslint-disable */ /* eslint-disable */
@ -1280,6 +1280,7 @@
localAttributes: {}, localAttributes: {},
internalModelProxy: this.formulateValue, internalModelProxy: this.formulateValue,
behavioralErrorVisibility: (this.errorBehavior === 'live'), behavioralErrorVisibility: (this.errorBehavior === 'live'),
formShouldShowErrors: false,
validationErrors: [], validationErrors: [],
pendingValidation: Promise.resolve() pendingValidation: Promise.resolve()
} }
@ -1581,7 +1582,8 @@
data: function data () { data: function data () {
return { return {
registry: {}, registry: {},
internalFormModelProxy: {} internalFormModelProxy: {},
formShouldShowErrors: false
} }
}, },
computed: { computed: {
@ -1641,8 +1643,14 @@
}, },
formSubmitted: function formSubmitted () { formSubmitted: function formSubmitted () {
// perform validation here // perform validation here
this.showErrors();
this.$emit('submit', this.formModel); this.$emit('submit', this.formModel);
}, },
showErrors: function showErrors () {
for (var fieldName in this.registry) {
this.registry[fieldName].formShouldShowErrors = true;
}
},
getFormValues: function getFormValues () { getFormValues: function getFormValues () {
return this.internalFormModelProxy return this.internalFormModelProxy
} }

7
dist/snow.css vendored
View File

@ -150,12 +150,17 @@
min-width: 0; min-width: 0;
width: auto; width: auto;
font-weight: bold; font-weight: bold;
cursor: pointer; } cursor: pointer;
display: inline-flex;
align-items: center; }
.formulate-input[data-classification='button'] button::placeholder { .formulate-input[data-classification='button'] button::placeholder {
color: #a8a8a8; } color: #a8a8a8; }
.formulate-input[data-classification='button'] button:focus { .formulate-input[data-classification='button'] button:focus {
outline: 0; outline: 0;
border: 1px solid #41b883; } border: 1px solid #41b883; }
.formulate-input[data-classification='button'] button[disabled] {
background-color: #cecece;
border-color: #cecece; }
.formulate-input[data-classification='button'] button:active { .formulate-input[data-classification='button'] button:active {
background-color: #64c89b; background-color: #64c89b;
border-color: #64c89b; } border-color: #64c89b; }

4
dist/snow.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,8 @@ export default {
data () { data () {
return { return {
registry: {}, registry: {},
internalFormModelProxy: {} internalFormModelProxy: {},
formShouldShowErrors: false
} }
}, },
computed: { computed: {
@ -93,8 +94,14 @@ export default {
}, },
formSubmitted () { formSubmitted () {
// perform validation here // perform validation here
this.showErrors()
this.$emit('submit', this.formModel) this.$emit('submit', this.formModel)
}, },
showErrors () {
for (const fieldName in this.registry) {
this.registry[fieldName].formShouldShowErrors = true
}
},
getFormValues () { getFormValues () {
return this.internalFormModelProxy return this.internalFormModelProxy
} }

View File

@ -76,7 +76,7 @@ export default {
default: 'text' default: 'text'
}, },
name: { name: {
type: [Boolean, String], type: [String, Boolean],
default: true default: true
}, },
/* eslint-disable */ /* eslint-disable */
@ -172,6 +172,7 @@ export default {
localAttributes: {}, localAttributes: {},
internalModelProxy: this.formulateValue, internalModelProxy: this.formulateValue,
behavioralErrorVisibility: (this.errorBehavior === 'live'), behavioralErrorVisibility: (this.errorBehavior === 'live'),
formShouldShowErrors: false,
validationErrors: [], validationErrors: [],
pendingValidation: Promise.resolve() pendingValidation: Promise.resolve()
} }

View File

@ -116,8 +116,8 @@ function mergedValidationName () {
* @return {boolean} * @return {boolean}
*/ */
function showFieldErrors () { function showFieldErrors () {
if (this.showErrors) { if (this.showErrors || this.formShouldShowErrors) {
return this.showErrors return true
} }
return this.behavioralErrorVisibility return this.behavioralErrorVisibility
} }