@formio/js 5.0.0-dev.5840.acb2be3 → 5.0.0-dev.5842.5155aaa
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 +27 -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/_classes/list/ListComponent.js +1 -0
- package/lib/cjs/components/day/Day.js +4 -3
- package/lib/cjs/components/radio/Radio.js +8 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +1 -0
- package/lib/mjs/components/day/Day.js +4 -3
- package/lib/mjs/components/radio/Radio.js +8 -0
- package/package.json +1 -1
|
@@ -497,26 +497,27 @@ class DayComponent extends Field_1.default {
|
|
|
497
497
|
defaults = defaultValue.split('/').map(x => parseInt(x, 10));
|
|
498
498
|
}
|
|
499
499
|
if (this.showDay && this.refs.day) {
|
|
500
|
-
day = parseInt(this.refs.day.value, 10);
|
|
500
|
+
day = this.refs.day.value === '' ? '' : parseInt(this.refs.day.value, 10);
|
|
501
501
|
}
|
|
502
502
|
if (day === undefined || lodash_1.default.isNaN(day)) {
|
|
503
503
|
day = defaults[DAY] && !lodash_1.default.isNaN(defaults[DAY]) ? defaults[DAY] : 0;
|
|
504
504
|
}
|
|
505
505
|
if (this.showMonth && this.refs.month) {
|
|
506
506
|
// Months are 0 indexed.
|
|
507
|
-
month = parseInt(this.refs.month.value, 10);
|
|
507
|
+
month = this.refs.month.value === '' ? '' : parseInt(this.refs.month.value, 10);
|
|
508
508
|
}
|
|
509
509
|
if (month === undefined || lodash_1.default.isNaN(month)) {
|
|
510
510
|
month = defaults[MONTH] && !lodash_1.default.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;
|
|
511
511
|
}
|
|
512
512
|
if (this.showYear && this.refs.year) {
|
|
513
|
-
year = parseInt(this.refs.year.value);
|
|
513
|
+
year = this.refs.year.value === '' ? '' : parseInt(this.refs.year.value);
|
|
514
514
|
}
|
|
515
515
|
if (year === undefined || lodash_1.default.isNaN(year)) {
|
|
516
516
|
year = defaults[YEAR] && !lodash_1.default.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;
|
|
517
517
|
}
|
|
518
518
|
let result;
|
|
519
519
|
if (!day && !month && !year) {
|
|
520
|
+
this.dataValue = this.emptyValue;
|
|
520
521
|
return null;
|
|
521
522
|
}
|
|
522
523
|
// add trailing zeros if the data is showed
|
|
@@ -79,6 +79,14 @@ class RadioComponent extends ListComponent_1.default {
|
|
|
79
79
|
}
|
|
80
80
|
return defaultValue;
|
|
81
81
|
}
|
|
82
|
+
resetValue() {
|
|
83
|
+
this.unset();
|
|
84
|
+
this.setValue(this.emptyValue, {
|
|
85
|
+
noUpdateEvent: true,
|
|
86
|
+
noValidate: true,
|
|
87
|
+
resetValue: true
|
|
88
|
+
});
|
|
89
|
+
}
|
|
82
90
|
get inputInfo() {
|
|
83
91
|
var _a;
|
|
84
92
|
const info = super.elementInfo();
|
|
@@ -495,26 +495,27 @@ export default class DayComponent extends Field {
|
|
|
495
495
|
defaults = defaultValue.split('/').map(x => parseInt(x, 10));
|
|
496
496
|
}
|
|
497
497
|
if (this.showDay && this.refs.day) {
|
|
498
|
-
day = parseInt(this.refs.day.value, 10);
|
|
498
|
+
day = this.refs.day.value === '' ? '' : parseInt(this.refs.day.value, 10);
|
|
499
499
|
}
|
|
500
500
|
if (day === undefined || _.isNaN(day)) {
|
|
501
501
|
day = defaults[DAY] && !_.isNaN(defaults[DAY]) ? defaults[DAY] : 0;
|
|
502
502
|
}
|
|
503
503
|
if (this.showMonth && this.refs.month) {
|
|
504
504
|
// Months are 0 indexed.
|
|
505
|
-
month = parseInt(this.refs.month.value, 10);
|
|
505
|
+
month = this.refs.month.value === '' ? '' : parseInt(this.refs.month.value, 10);
|
|
506
506
|
}
|
|
507
507
|
if (month === undefined || _.isNaN(month)) {
|
|
508
508
|
month = defaults[MONTH] && !_.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;
|
|
509
509
|
}
|
|
510
510
|
if (this.showYear && this.refs.year) {
|
|
511
|
-
year = parseInt(this.refs.year.value);
|
|
511
|
+
year = this.refs.year.value === '' ? '' : parseInt(this.refs.year.value);
|
|
512
512
|
}
|
|
513
513
|
if (year === undefined || _.isNaN(year)) {
|
|
514
514
|
year = defaults[YEAR] && !_.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;
|
|
515
515
|
}
|
|
516
516
|
let result;
|
|
517
517
|
if (!day && !month && !year) {
|
|
518
|
+
this.dataValue = this.emptyValue;
|
|
518
519
|
return null;
|
|
519
520
|
}
|
|
520
521
|
// add trailing zeros if the data is showed
|
|
@@ -80,6 +80,14 @@ export default class RadioComponent extends ListComponent {
|
|
|
80
80
|
}
|
|
81
81
|
return defaultValue;
|
|
82
82
|
}
|
|
83
|
+
resetValue() {
|
|
84
|
+
this.unset();
|
|
85
|
+
this.setValue(this.emptyValue, {
|
|
86
|
+
noUpdateEvent: true,
|
|
87
|
+
noValidate: true,
|
|
88
|
+
resetValue: true
|
|
89
|
+
});
|
|
90
|
+
}
|
|
83
91
|
get inputInfo() {
|
|
84
92
|
const info = super.elementInfo();
|
|
85
93
|
info.type = 'input';
|