Updated build packages for alpha 2
This commit is contained in:
parent
839f0936ed
commit
bfa94fc24a
25
dist/formulate.esm.js
vendored
25
dist/formulate.esm.js
vendored
@ -458,7 +458,7 @@ function cloneDeep (obj) {
|
|||||||
var newObj = {};
|
var newObj = {};
|
||||||
for (var key in obj) {
|
for (var key in obj) {
|
||||||
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
||||||
newObj[key] = obj;
|
newObj[key] = obj[key];
|
||||||
} else {
|
} else {
|
||||||
newObj[key] = cloneDeep(obj[key]);
|
newObj[key] = cloneDeep(obj[key]);
|
||||||
}
|
}
|
||||||
@ -1664,10 +1664,10 @@ FormSubmission.prototype.values = function values () {
|
|||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var pending = [];
|
var pending = [];
|
||||||
var values = cloneDeep(this$1.form.internalModelProxy);
|
var values = cloneDeep(this$1.form.internalFormModelProxy);
|
||||||
for (var key in values) {
|
for (var key in values) {
|
||||||
if (typeof this$1.form.internalModelProxy[key] === 'object' && this$1.form.internalModelProxy[key] instanceof FileUpload) {
|
if (typeof this$1.form.internalFormModelProxy[key] === 'object' && this$1.form.internalFormModelProxy[key] instanceof FileUpload) {
|
||||||
pending.push(this$1.form.internalModelProxy[key].upload());
|
pending.push(this$1.form.internalFormModelProxy[key].upload());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1759,11 +1759,20 @@ var script$1 = {
|
|||||||
},
|
},
|
||||||
register: function register (field, component) {
|
register: function register (field, component) {
|
||||||
this.registry[field] = component;
|
this.registry[field] = component;
|
||||||
if (!component.$options.propsData.hasOwnProperty('formulateValue') && this.hasFormulateValue && this.formulateValue[field]) {
|
var hasVModelValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'formulateValue');
|
||||||
|
var hasValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'value');
|
||||||
|
if (
|
||||||
|
!hasVModelValue &&
|
||||||
|
this.hasFormulateValue &&
|
||||||
|
this.formulateValue[field]
|
||||||
|
) {
|
||||||
// In the case that the form is carrying an initial value and the
|
// In the case that the form is carrying an initial value and the
|
||||||
// element is not, set it directly.
|
// element is not, set it directly.
|
||||||
component.context.model = this.formulateValue[field];
|
component.context.model = this.formulateValue[field];
|
||||||
} else if (component.$options.propsData.hasOwnProperty('formulateValue') && !shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])) {
|
} else if (
|
||||||
|
(hasVModelValue || hasValue) &&
|
||||||
|
!shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])
|
||||||
|
) {
|
||||||
this.setFieldValue(field, component.internalModelProxy);
|
this.setFieldValue(field, component.internalModelProxy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1774,9 +1783,9 @@ var script$1 = {
|
|||||||
this.showErrors();
|
this.showErrors();
|
||||||
var submission = new FormSubmission(this);
|
var submission = new FormSubmission(this);
|
||||||
this.$emit('submit-raw', submission);
|
this.$emit('submit-raw', submission);
|
||||||
submission.hasValidationErrors()
|
return submission.hasValidationErrors()
|
||||||
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
||||||
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; });
|
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; })
|
||||||
},
|
},
|
||||||
showErrors: function showErrors () {
|
showErrors: function showErrors () {
|
||||||
for (var fieldName in this.registry) {
|
for (var fieldName in this.registry) {
|
||||||
|
25
dist/formulate.min.js
vendored
25
dist/formulate.min.js
vendored
@ -461,7 +461,7 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
|
|||||||
var newObj = {};
|
var newObj = {};
|
||||||
for (var key in obj) {
|
for (var key in obj) {
|
||||||
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
||||||
newObj[key] = obj;
|
newObj[key] = obj[key];
|
||||||
} else {
|
} else {
|
||||||
newObj[key] = cloneDeep(obj[key]);
|
newObj[key] = cloneDeep(obj[key]);
|
||||||
}
|
}
|
||||||
@ -1667,10 +1667,10 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
|
|||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var pending = [];
|
var pending = [];
|
||||||
var values = cloneDeep(this$1.form.internalModelProxy);
|
var values = cloneDeep(this$1.form.internalFormModelProxy);
|
||||||
for (var key in values) {
|
for (var key in values) {
|
||||||
if (typeof this$1.form.internalModelProxy[key] === 'object' && this$1.form.internalModelProxy[key] instanceof FileUpload) {
|
if (typeof this$1.form.internalFormModelProxy[key] === 'object' && this$1.form.internalFormModelProxy[key] instanceof FileUpload) {
|
||||||
pending.push(this$1.form.internalModelProxy[key].upload());
|
pending.push(this$1.form.internalFormModelProxy[key].upload());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1762,11 +1762,20 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
|
|||||||
},
|
},
|
||||||
register: function register (field, component) {
|
register: function register (field, component) {
|
||||||
this.registry[field] = component;
|
this.registry[field] = component;
|
||||||
if (!component.$options.propsData.hasOwnProperty('formulateValue') && this.hasFormulateValue && this.formulateValue[field]) {
|
var hasVModelValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'formulateValue');
|
||||||
|
var hasValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'value');
|
||||||
|
if (
|
||||||
|
!hasVModelValue &&
|
||||||
|
this.hasFormulateValue &&
|
||||||
|
this.formulateValue[field]
|
||||||
|
) {
|
||||||
// In the case that the form is carrying an initial value and the
|
// In the case that the form is carrying an initial value and the
|
||||||
// element is not, set it directly.
|
// element is not, set it directly.
|
||||||
component.context.model = this.formulateValue[field];
|
component.context.model = this.formulateValue[field];
|
||||||
} else if (component.$options.propsData.hasOwnProperty('formulateValue') && !shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])) {
|
} else if (
|
||||||
|
(hasVModelValue || hasValue) &&
|
||||||
|
!shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])
|
||||||
|
) {
|
||||||
this.setFieldValue(field, component.internalModelProxy);
|
this.setFieldValue(field, component.internalModelProxy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1777,9 +1786,9 @@ var Formulate = (function (exports, isUrl, nanoid, isPlainObject) {
|
|||||||
this.showErrors();
|
this.showErrors();
|
||||||
var submission = new FormSubmission(this);
|
var submission = new FormSubmission(this);
|
||||||
this.$emit('submit-raw', submission);
|
this.$emit('submit-raw', submission);
|
||||||
submission.hasValidationErrors()
|
return submission.hasValidationErrors()
|
||||||
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
||||||
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; });
|
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; })
|
||||||
},
|
},
|
||||||
showErrors: function showErrors () {
|
showErrors: function showErrors () {
|
||||||
for (var fieldName in this.registry) {
|
for (var fieldName in this.registry) {
|
||||||
|
25
dist/formulate.umd.js
vendored
25
dist/formulate.umd.js
vendored
@ -464,7 +464,7 @@
|
|||||||
var newObj = {};
|
var newObj = {};
|
||||||
for (var key in obj) {
|
for (var key in obj) {
|
||||||
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
if (obj[key] instanceof FileUpload || isValueType(obj[key])) {
|
||||||
newObj[key] = obj;
|
newObj[key] = obj[key];
|
||||||
} else {
|
} else {
|
||||||
newObj[key] = cloneDeep(obj[key]);
|
newObj[key] = cloneDeep(obj[key]);
|
||||||
}
|
}
|
||||||
@ -1670,10 +1670,10 @@
|
|||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var pending = [];
|
var pending = [];
|
||||||
var values = cloneDeep(this$1.form.internalModelProxy);
|
var values = cloneDeep(this$1.form.internalFormModelProxy);
|
||||||
for (var key in values) {
|
for (var key in values) {
|
||||||
if (typeof this$1.form.internalModelProxy[key] === 'object' && this$1.form.internalModelProxy[key] instanceof FileUpload) {
|
if (typeof this$1.form.internalFormModelProxy[key] === 'object' && this$1.form.internalFormModelProxy[key] instanceof FileUpload) {
|
||||||
pending.push(this$1.form.internalModelProxy[key].upload());
|
pending.push(this$1.form.internalFormModelProxy[key].upload());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1765,11 +1765,20 @@
|
|||||||
},
|
},
|
||||||
register: function register (field, component) {
|
register: function register (field, component) {
|
||||||
this.registry[field] = component;
|
this.registry[field] = component;
|
||||||
if (!component.$options.propsData.hasOwnProperty('formulateValue') && this.hasFormulateValue && this.formulateValue[field]) {
|
var hasVModelValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'formulateValue');
|
||||||
|
var hasValue = Object.prototype.hasOwnProperty.call(component.$options.propsData, 'value');
|
||||||
|
if (
|
||||||
|
!hasVModelValue &&
|
||||||
|
this.hasFormulateValue &&
|
||||||
|
this.formulateValue[field]
|
||||||
|
) {
|
||||||
// In the case that the form is carrying an initial value and the
|
// In the case that the form is carrying an initial value and the
|
||||||
// element is not, set it directly.
|
// element is not, set it directly.
|
||||||
component.context.model = this.formulateValue[field];
|
component.context.model = this.formulateValue[field];
|
||||||
} else if (component.$options.propsData.hasOwnProperty('formulateValue') && !shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])) {
|
} else if (
|
||||||
|
(hasVModelValue || hasValue) &&
|
||||||
|
!shallowEqualObjects(component.internalModelProxy, this.formulateValue[field])
|
||||||
|
) {
|
||||||
this.setFieldValue(field, component.internalModelProxy);
|
this.setFieldValue(field, component.internalModelProxy);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1780,9 +1789,9 @@
|
|||||||
this.showErrors();
|
this.showErrors();
|
||||||
var submission = new FormSubmission(this);
|
var submission = new FormSubmission(this);
|
||||||
this.$emit('submit-raw', submission);
|
this.$emit('submit-raw', submission);
|
||||||
submission.hasValidationErrors()
|
return submission.hasValidationErrors()
|
||||||
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
.then(function (hasErrors) { return hasErrors ? false : submission.values(); })
|
||||||
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; });
|
.then(function (json) { return json !== false ? this$1.$emit('submit', json) : null; })
|
||||||
},
|
},
|
||||||
showErrors: function showErrors () {
|
showErrors: function showErrors () {
|
||||||
for (var fieldName in this.registry) {
|
for (var fieldName in this.registry) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user