@formio/js 5.1.0-dev.5983.aa8260f → 5.1.0-dev.5988.8d481cd
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/dist/formio.form.js +13 -13
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +16 -16
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/lib/cjs/Form.js +3 -1
- package/lib/cjs/Webform.d.ts +4 -1
- package/lib/cjs/Webform.js +26 -13
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/Components.d.ts +3 -0
- package/lib/cjs/components/_classes/component/Component.js +11 -2
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/utils.d.ts +1 -0
- package/lib/cjs/components/_classes/component/editForm/utils.js +3 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +3 -0
- package/lib/cjs/components/day/Day.js +7 -5
- package/lib/cjs/components/file/File.js +2 -1
- package/lib/cjs/components/form/Form.js +15 -5
- package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +2 -2
- package/lib/cjs/components/select/editForm/Select.edit.data.js +2 -2
- package/lib/cjs/providers/storage/googleDrive.js +3 -2
- package/lib/cjs/widgets/CalendarWidget.js +0 -14
- package/lib/mjs/Form.js +3 -1
- package/lib/mjs/Webform.d.ts +4 -1
- package/lib/mjs/Webform.js +26 -13
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/Components.d.ts +3 -0
- package/lib/mjs/components/_classes/component/Component.js +11 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.d.ts +1 -0
- package/lib/mjs/components/_classes/component/editForm/utils.js +3 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +3 -0
- package/lib/mjs/components/day/Day.js +7 -5
- package/lib/mjs/components/file/File.js +2 -1
- package/lib/mjs/components/form/Form.js +15 -5
- package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +2 -2
- package/lib/mjs/components/select/editForm/Select.edit.data.js +2 -2
- package/lib/mjs/providers/storage/googleDrive.js +3 -2
- package/lib/mjs/widgets/CalendarWidget.js +0 -14
- package/package.json +1 -1
@@ -53,11 +53,13 @@ export default class DayComponent extends Field {
|
|
53
53
|
// Empty value used before 9.3.x
|
54
54
|
static oldEmptyValue = '00/00/0000';
|
55
55
|
constructor(component, options, data) {
|
56
|
-
if (
|
57
|
-
component.maxDate
|
58
|
-
|
59
|
-
|
60
|
-
component.minDate
|
56
|
+
if (!options.inFormBuilder && !options.building) {
|
57
|
+
if (component.maxDate && component.maxDate.indexOf('moment(') === -1) {
|
58
|
+
component.maxDate = moment(component.maxDate, 'YYYY-MM-DD').toISOString();
|
59
|
+
}
|
60
|
+
if (component.minDate && component.minDate.indexOf('moment(') === -1) {
|
61
|
+
component.minDate = moment(component.minDate, 'YYYY-MM-DD').toISOString();
|
62
|
+
}
|
61
63
|
}
|
62
64
|
super(component, options, data);
|
63
65
|
}
|
@@ -98,7 +98,8 @@ export default class FileComponent extends Field {
|
|
98
98
|
if (this.component.privateDownload) {
|
99
99
|
fileInfo.private = true;
|
100
100
|
}
|
101
|
-
|
101
|
+
// pass the component to the downloadFile method
|
102
|
+
return this.fileService.downloadFile(fileInfo, this.component).then((result) => result.url);
|
102
103
|
}
|
103
104
|
get emptyValue() {
|
104
105
|
return [];
|
@@ -580,11 +580,21 @@ export default class FormComponent extends Component {
|
|
580
580
|
this.dataValue = submission;
|
581
581
|
return Promise.resolve(this.dataValue);
|
582
582
|
}
|
583
|
-
|
584
|
-
.
|
585
|
-
|
586
|
-
|
587
|
-
|
583
|
+
if (this.isSubFormLazyLoad() && !this.subFormLoading) {
|
584
|
+
return this.createSubForm(true)
|
585
|
+
.then(this.submitSubForm(false))
|
586
|
+
.then(() => {
|
587
|
+
return this.dataValue;
|
588
|
+
})
|
589
|
+
.then(() => super.beforeSubmit());
|
590
|
+
}
|
591
|
+
else {
|
592
|
+
return this.submitSubForm(false)
|
593
|
+
.then(() => {
|
594
|
+
return this.dataValue;
|
595
|
+
})
|
596
|
+
.then(() => super.beforeSubmit());
|
597
|
+
}
|
588
598
|
}
|
589
599
|
isSubFormLazyLoad() {
|
590
600
|
return this.root?._form?.display === 'wizard' && this.component.lazyLoad;
|
@@ -66,7 +66,7 @@ export default [
|
|
66
66
|
input: true,
|
67
67
|
weight: 20,
|
68
68
|
key: 'reference',
|
69
|
-
label: '
|
70
|
-
tooltip: '
|
69
|
+
label: 'Submit as reference',
|
70
|
+
tooltip: 'When "Submit as reference" is enabled, the form submission will be recorded against the Parent Form as well as the Child Form. When a submission recorded with "Submit as reference" is edited, the update is applied to each submission made against the Parent Form and Child Form.'
|
71
71
|
}
|
72
72
|
];
|
@@ -635,8 +635,8 @@ export default [
|
|
635
635
|
input: true,
|
636
636
|
weight: 25,
|
637
637
|
key: 'reference',
|
638
|
-
label: '
|
639
|
-
tooltip: 'Using this option will
|
638
|
+
label: 'Submit as reference',
|
639
|
+
tooltip: 'Using this option will submit this field as a reference id and link its value to the value of the origin record.',
|
640
640
|
conditional: {
|
641
641
|
json: { '===': [{ var: 'data.dataSrc' }, 'resource'] },
|
642
642
|
},
|
@@ -50,10 +50,11 @@ function googledrive(formio) {
|
|
50
50
|
xhr.send(fd);
|
51
51
|
}));
|
52
52
|
},
|
53
|
-
downloadFile(file) {
|
53
|
+
downloadFile(file, component) {
|
54
54
|
const token = formio.getToken();
|
55
|
+
// Constructed the url with the fileId, fileName, displayImage, imageSize if applicable
|
55
56
|
file.url =
|
56
|
-
`${formio.formUrl}/storage/gdrive?fileId=${file.id}&fileName=${file.originalName}${token ? `&x-jwt-token=${token}` : ''}`;
|
57
|
+
`${formio.formUrl}/storage/gdrive?fileId=${file.id}&fileName=${file.originalName}${token ? `&x-jwt-token=${token}` : ''}${component.image ? '&displayImage=true' : ''}${component.imageSize ? `&imageSize=${component.imageSize}` : ''}`;
|
57
58
|
return Promise.resolve(file);
|
58
59
|
},
|
59
60
|
deleteFile: function deleteFile(fileInfo) {
|
@@ -87,8 +87,6 @@ export default class CalendarWidget extends InputWidget {
|
|
87
87
|
this.settings.disableWeekends ? this.settings.disable.push(this.disableWeekends) : '';
|
88
88
|
this.settings.disableWeekdays ? this.settings.disable.push(this.disableWeekdays) : '';
|
89
89
|
this.settings.disableFunction ? this.settings.disable.push(this.disableFunction) : '';
|
90
|
-
this.settings.wasDefaultValueChanged = false;
|
91
|
-
this.settings.defaultValue = '';
|
92
90
|
this.settings.manualInputValue = '';
|
93
91
|
this.settings.isManuallyOverriddenValue = false;
|
94
92
|
this.settings.currentValue = '';
|
@@ -109,10 +107,6 @@ export default class CalendarWidget extends InputWidget {
|
|
109
107
|
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
110
108
|
this.emit('update');
|
111
109
|
}
|
112
|
-
if (this.settings.wasDefaultValueChanged) {
|
113
|
-
this.calendar._input.value = this.settings.defaultValue;
|
114
|
-
this.settings.wasDefaultValueChanged = false;
|
115
|
-
}
|
116
110
|
if (this.calendar) {
|
117
111
|
this.emit('blur');
|
118
112
|
}
|
@@ -351,14 +345,6 @@ export default class CalendarWidget extends InputWidget {
|
|
351
345
|
this.settings.currentValue = event.target.value;
|
352
346
|
this.emit('update');
|
353
347
|
}
|
354
|
-
if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
|
355
|
-
this.settings.wasDefaultValueChanged = true;
|
356
|
-
this.settings.defaultValue = event.target.value;
|
357
|
-
this.calendar.clear();
|
358
|
-
}
|
359
|
-
else {
|
360
|
-
this.settings.wasDefaultValueChanged = false;
|
361
|
-
}
|
362
348
|
});
|
363
349
|
if (this.calendar.daysContainer) {
|
364
350
|
this.calendar.daysContainer.addEventListener('click', () => {
|