@formio/js 5.0.0-dev.5745.3c80f7d → 5.0.0-dev.5748.cd8883d
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 +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/day/Day.d.ts +2 -2
- package/lib/cjs/components/day/Day.js +3 -3
- package/lib/cjs/components/file/File.d.ts +1 -1
- package/lib/cjs/components/file/File.js +10 -1
- package/lib/cjs/translations/en.d.ts +0 -1
- package/lib/cjs/translations/en.js +0 -1
- package/lib/mjs/components/day/Day.d.ts +2 -2
- package/lib/mjs/components/day/Day.js +3 -3
- package/lib/mjs/components/file/File.d.ts +1 -1
- package/lib/mjs/components/file/File.js +10 -1
- package/lib/mjs/translations/en.d.ts +0 -1
- package/lib/mjs/translations/en.js +0 -1
- package/package.json +1 -1
|
@@ -17,9 +17,9 @@ export default class DayComponent extends Field {
|
|
|
17
17
|
constructor(component: any, options: any, data: any);
|
|
18
18
|
/**
|
|
19
19
|
* The empty value for day component.
|
|
20
|
-
* @returns {''} - The empty value of the day component.
|
|
20
|
+
* @returns {'00/00/0000'} - The empty value of the day component.
|
|
21
21
|
*/
|
|
22
|
-
get emptyValue(): "";
|
|
22
|
+
get emptyValue(): "00/00/0000";
|
|
23
23
|
get valueMask(): RegExp;
|
|
24
24
|
get dayRequired(): any;
|
|
25
25
|
get showDay(): boolean;
|
|
@@ -64,10 +64,10 @@ class DayComponent extends Field_1.default {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* The empty value for day component.
|
|
67
|
-
* @returns {''} - The empty value of the day component.
|
|
67
|
+
* @returns {'00/00/0000'} - The empty value of the day component.
|
|
68
68
|
*/
|
|
69
69
|
get emptyValue() {
|
|
70
|
-
return '';
|
|
70
|
+
return '00/00/0000';
|
|
71
71
|
}
|
|
72
72
|
get valueMask() {
|
|
73
73
|
return /^\d{2}\/\d{2}\/\d{4}$/;
|
|
@@ -363,7 +363,7 @@ class DayComponent extends Field_1.default {
|
|
|
363
363
|
setValueAt(index, value) {
|
|
364
364
|
// temporary solution to avoid input reset
|
|
365
365
|
// on invalid date.
|
|
366
|
-
if (value === 'Invalid date') {
|
|
366
|
+
if (!value || value === 'Invalid date') {
|
|
367
367
|
return null;
|
|
368
368
|
}
|
|
369
369
|
const parts = value.split('/');
|
|
@@ -33,7 +33,7 @@ export default class FileComponent extends Field {
|
|
|
33
33
|
get dataReady(): Promise<any>;
|
|
34
34
|
loadImage(fileInfo: any): any;
|
|
35
35
|
get emptyValue(): never[];
|
|
36
|
-
getValueAsString(value: any): any;
|
|
36
|
+
getValueAsString(value: any, options: any): any;
|
|
37
37
|
get defaultValue(): any[];
|
|
38
38
|
get hasTypes(): any;
|
|
39
39
|
_fileBrowseHidden: any;
|
|
@@ -114,7 +114,12 @@ class FileComponent extends Field_1.default {
|
|
|
114
114
|
get emptyValue() {
|
|
115
115
|
return [];
|
|
116
116
|
}
|
|
117
|
-
getValueAsString(value) {
|
|
117
|
+
getValueAsString(value, options) {
|
|
118
|
+
if ((options === null || options === void 0 ? void 0 : options.review) && !this.component.uploadOnly) {
|
|
119
|
+
return lodash_1.default.map(value, (val, index) => {
|
|
120
|
+
return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
|
|
121
|
+
}).join(', ');
|
|
122
|
+
}
|
|
118
123
|
if (lodash_1.default.isArray(value)) {
|
|
119
124
|
return lodash_1.default.map(value, 'originalName').join(', ');
|
|
120
125
|
}
|
|
@@ -935,6 +940,10 @@ class FileComponent extends Field_1.default {
|
|
|
935
940
|
: response.type === 'abort'
|
|
936
941
|
? this.t('Request was aborted')
|
|
937
942
|
: response.toString();
|
|
943
|
+
this.emit('fileUploadError', {
|
|
944
|
+
fileToSync,
|
|
945
|
+
response,
|
|
946
|
+
});
|
|
938
947
|
}
|
|
939
948
|
finally {
|
|
940
949
|
delete fileToSync.progress;
|
|
@@ -77,7 +77,6 @@ exports.default = {
|
|
|
77
77
|
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
|
78
78
|
typeCount: '{{ count }} {{ type }}',
|
|
79
79
|
requiredDayField: '{{ field }} is required',
|
|
80
|
-
requiredDayEmpty: '{{ field }} is required',
|
|
81
80
|
requiredMonthField: '{{ field }} is required',
|
|
82
81
|
requiredYearField: '{{ field }} is required'
|
|
83
82
|
};
|
|
@@ -17,9 +17,9 @@ export default class DayComponent extends Field {
|
|
|
17
17
|
constructor(component: any, options: any, data: any);
|
|
18
18
|
/**
|
|
19
19
|
* The empty value for day component.
|
|
20
|
-
* @returns {''} - The empty value of the day component.
|
|
20
|
+
* @returns {'00/00/0000'} - The empty value of the day component.
|
|
21
21
|
*/
|
|
22
|
-
get emptyValue(): "";
|
|
22
|
+
get emptyValue(): "00/00/0000";
|
|
23
23
|
get valueMask(): RegExp;
|
|
24
24
|
get dayRequired(): any;
|
|
25
25
|
get showDay(): boolean;
|
|
@@ -62,10 +62,10 @@ export default class DayComponent extends Field {
|
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* The empty value for day component.
|
|
65
|
-
* @returns {''} - The empty value of the day component.
|
|
65
|
+
* @returns {'00/00/0000'} - The empty value of the day component.
|
|
66
66
|
*/
|
|
67
67
|
get emptyValue() {
|
|
68
|
-
return '';
|
|
68
|
+
return '00/00/0000';
|
|
69
69
|
}
|
|
70
70
|
get valueMask() {
|
|
71
71
|
return /^\d{2}\/\d{2}\/\d{4}$/;
|
|
@@ -361,7 +361,7 @@ export default class DayComponent extends Field {
|
|
|
361
361
|
setValueAt(index, value) {
|
|
362
362
|
// temporary solution to avoid input reset
|
|
363
363
|
// on invalid date.
|
|
364
|
-
if (value === 'Invalid date') {
|
|
364
|
+
if (!value || value === 'Invalid date') {
|
|
365
365
|
return null;
|
|
366
366
|
}
|
|
367
367
|
const parts = value.split('/');
|
|
@@ -33,7 +33,7 @@ export default class FileComponent extends Field {
|
|
|
33
33
|
get dataReady(): Promise<any>;
|
|
34
34
|
loadImage(fileInfo: any): any;
|
|
35
35
|
get emptyValue(): never[];
|
|
36
|
-
getValueAsString(value: any): any;
|
|
36
|
+
getValueAsString(value: any, options: any): any;
|
|
37
37
|
get defaultValue(): any[];
|
|
38
38
|
get hasTypes(): any;
|
|
39
39
|
_fileBrowseHidden: any;
|
|
@@ -103,7 +103,12 @@ export default class FileComponent extends Field {
|
|
|
103
103
|
get emptyValue() {
|
|
104
104
|
return [];
|
|
105
105
|
}
|
|
106
|
-
getValueAsString(value) {
|
|
106
|
+
getValueAsString(value, options) {
|
|
107
|
+
if (options?.review && !this.component.uploadOnly) {
|
|
108
|
+
return _.map(value, (val, index) => {
|
|
109
|
+
return `<a href="${val.url || '#'}" target="_blank" data-path='${this.path}' data-fileindex='${index}'>${val.originalName}</a>`;
|
|
110
|
+
}).join(', ');
|
|
111
|
+
}
|
|
107
112
|
if (_.isArray(value)) {
|
|
108
113
|
return _.map(value, 'originalName').join(', ');
|
|
109
114
|
}
|
|
@@ -931,6 +936,10 @@ export default class FileComponent extends Field {
|
|
|
931
936
|
: response.type === 'abort'
|
|
932
937
|
? this.t('Request was aborted')
|
|
933
938
|
: response.toString();
|
|
939
|
+
this.emit('fileUploadError', {
|
|
940
|
+
fileToSync,
|
|
941
|
+
response,
|
|
942
|
+
});
|
|
934
943
|
}
|
|
935
944
|
finally {
|
|
936
945
|
delete fileToSync.progress;
|
|
@@ -75,7 +75,6 @@ export default {
|
|
|
75
75
|
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
|
76
76
|
typeCount: '{{ count }} {{ type }}',
|
|
77
77
|
requiredDayField: '{{ field }} is required',
|
|
78
|
-
requiredDayEmpty: '{{ field }} is required',
|
|
79
78
|
requiredMonthField: '{{ field }} is required',
|
|
80
79
|
requiredYearField: '{{ field }} is required'
|
|
81
80
|
};
|