@formio/js 5.0.0-dev.5647.4cf82e8 → 5.0.0-dev.5650.f58394c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +1 -0
- package/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/Webform.js +8 -1
- package/lib/cjs/components/file/File.js +1 -2
- package/lib/mjs/Webform.js +7 -1
- package/lib/mjs/components/file/File.js +1 -2
- package/package.json +1 -1
package/lib/cjs/Webform.js
CHANGED
|
@@ -1222,9 +1222,16 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1222
1222
|
* @param flags
|
|
1223
1223
|
*/
|
|
1224
1224
|
onChange(flags, changed, modified, changes) {
|
|
1225
|
+
var _a;
|
|
1225
1226
|
flags = flags || {};
|
|
1226
1227
|
let isChangeEventEmitted = false;
|
|
1227
|
-
|
|
1228
|
+
// If this Webform is a nested form, continue to bubble `modified` change to the root
|
|
1229
|
+
if (((_a = this.parent) === null || _a === void 0 ? void 0 : _a.subForm) === this) {
|
|
1230
|
+
super.onChange(Object.assign(Object.assign({}, flags), { modified }), false);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
super.onChange(flags, true);
|
|
1234
|
+
}
|
|
1228
1235
|
const value = lodash_1.default.clone(this.submission);
|
|
1229
1236
|
flags.changed = value.changed = changed;
|
|
1230
1237
|
flags.changes = changes;
|
|
@@ -652,8 +652,7 @@ class FileComponent extends Field_1.default {
|
|
|
652
652
|
// Check if file with the same name is being uploaded
|
|
653
653
|
const fileWithSameNameUploading = this.filesToSync.filesToUpload
|
|
654
654
|
.some(fileToSync => { var _a; return ((_a = fileToSync.file) === null || _a === void 0 ? void 0 : _a.name) === file.name; });
|
|
655
|
-
const fileWithSameNameUploaded = this.dataValue
|
|
656
|
-
.some(fileStatus => fileStatus.originalName === file.name);
|
|
655
|
+
const fileWithSameNameUploaded = lodash_1.default.some(this.dataValue, fileStatus => fileStatus.originalName === file.name);
|
|
657
656
|
return fileWithSameNameUploaded || fileWithSameNameUploading
|
|
658
657
|
? {
|
|
659
658
|
status: 'error',
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -1226,7 +1226,13 @@ export default class Webform extends NestedDataComponent {
|
|
|
1226
1226
|
onChange(flags, changed, modified, changes) {
|
|
1227
1227
|
flags = flags || {};
|
|
1228
1228
|
let isChangeEventEmitted = false;
|
|
1229
|
-
|
|
1229
|
+
// If this Webform is a nested form, continue to bubble `modified` change to the root
|
|
1230
|
+
if (this.parent?.subForm === this) {
|
|
1231
|
+
super.onChange({ ...flags, modified }, false);
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
super.onChange(flags, true);
|
|
1235
|
+
}
|
|
1230
1236
|
const value = _.clone(this.submission);
|
|
1231
1237
|
flags.changed = value.changed = changed;
|
|
1232
1238
|
flags.changes = changes;
|
|
@@ -649,8 +649,7 @@ export default class FileComponent extends Field {
|
|
|
649
649
|
// Check if file with the same name is being uploaded
|
|
650
650
|
const fileWithSameNameUploading = this.filesToSync.filesToUpload
|
|
651
651
|
.some(fileToSync => fileToSync.file?.name === file.name);
|
|
652
|
-
const fileWithSameNameUploaded = this.dataValue
|
|
653
|
-
.some(fileStatus => fileStatus.originalName === file.name);
|
|
652
|
+
const fileWithSameNameUploaded = _.some(this.dataValue, fileStatus => fileStatus.originalName === file.name);
|
|
654
653
|
return fileWithSameNameUploaded || fileWithSameNameUploading
|
|
655
654
|
? {
|
|
656
655
|
status: 'error',
|