@formio/js 5.0.0-dev.5836.bcc14e7 → 5.0.0-dev.5838.99aa253

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.
@@ -214,16 +214,6 @@ class AddressComponent extends Container_1.default {
214
214
  isValueInLegacyFormat(value) {
215
215
  return value && !value.mode;
216
216
  }
217
- set dataValue(value) {
218
- super.dataValue = value;
219
- }
220
- get dataValue() {
221
- const resultValue = lodash_1.default.get(this._data, this.component.path);
222
- if (!lodash_1.default.isArray(resultValue) && this.component.multiple) {
223
- return [resultValue];
224
- }
225
- return super.dataValue;
226
- }
227
217
  normalizeValue(value) {
228
218
  return (this.manualModeEnabled && this.isValueInLegacyFormat(value))
229
219
  ? {
@@ -500,20 +500,26 @@ class DayComponent extends Field_1.default {
500
500
  day = parseInt(this.refs.day.value, 10);
501
501
  }
502
502
  if (day === undefined || lodash_1.default.isNaN(day)) {
503
- day = defaults[DAY] && !lodash_1.default.isNaN(defaults[DAY]) ? defaults[DAY] : 0;
503
+ day = (defaults.length !== 3 && value) ?
504
+ this.getDayWithHiddenFields(defaults).day
505
+ : (defaults[DAY] && !lodash_1.default.isNaN(defaults[DAY]) ? defaults[DAY] : 0);
504
506
  }
505
507
  if (this.showMonth && this.refs.month) {
506
508
  // Months are 0 indexed.
507
509
  month = parseInt(this.refs.month.value, 10);
508
510
  }
509
511
  if (month === undefined || lodash_1.default.isNaN(month)) {
510
- month = defaults[MONTH] && !lodash_1.default.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;
512
+ month = (defaults.length !== 3 && value) ?
513
+ this.getDayWithHiddenFields(defaults).month
514
+ : (defaults[MONTH] && !lodash_1.default.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0);
511
515
  }
512
516
  if (this.showYear && this.refs.year) {
513
517
  year = parseInt(this.refs.year.value);
514
518
  }
515
519
  if (year === undefined || lodash_1.default.isNaN(year)) {
516
- year = defaults[YEAR] && !lodash_1.default.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;
520
+ year = (defaults.length !== 3 && value) ?
521
+ this.getDayWithHiddenFields(defaults).year
522
+ : (defaults[YEAR] && !lodash_1.default.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0);
517
523
  }
518
524
  let result;
519
525
  if (!day && !month && !year) {
@@ -210,16 +210,6 @@ export default class AddressComponent extends ContainerComponent {
210
210
  isValueInLegacyFormat(value) {
211
211
  return value && !value.mode;
212
212
  }
213
- set dataValue(value) {
214
- super.dataValue = value;
215
- }
216
- get dataValue() {
217
- const resultValue = _.get(this._data, this.component.path);
218
- if (!_.isArray(resultValue) && this.component.multiple) {
219
- return [resultValue];
220
- }
221
- return super.dataValue;
222
- }
223
213
  normalizeValue(value) {
224
214
  return (this.manualModeEnabled && this.isValueInLegacyFormat(value))
225
215
  ? {
@@ -498,20 +498,26 @@ export default class DayComponent extends Field {
498
498
  day = parseInt(this.refs.day.value, 10);
499
499
  }
500
500
  if (day === undefined || _.isNaN(day)) {
501
- day = defaults[DAY] && !_.isNaN(defaults[DAY]) ? defaults[DAY] : 0;
501
+ day = (defaults.length !== 3 && value) ?
502
+ this.getDayWithHiddenFields(defaults).day
503
+ : (defaults[DAY] && !_.isNaN(defaults[DAY]) ? defaults[DAY] : 0);
502
504
  }
503
505
  if (this.showMonth && this.refs.month) {
504
506
  // Months are 0 indexed.
505
507
  month = parseInt(this.refs.month.value, 10);
506
508
  }
507
509
  if (month === undefined || _.isNaN(month)) {
508
- month = defaults[MONTH] && !_.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;
510
+ month = (defaults.length !== 3 && value) ?
511
+ this.getDayWithHiddenFields(defaults).month
512
+ : (defaults[MONTH] && !_.isNaN(defaults[MONTH]) ? defaults[MONTH] : 0);
509
513
  }
510
514
  if (this.showYear && this.refs.year) {
511
515
  year = parseInt(this.refs.year.value);
512
516
  }
513
517
  if (year === undefined || _.isNaN(year)) {
514
- year = defaults[YEAR] && !_.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;
518
+ year = (defaults.length !== 3 && value) ?
519
+ this.getDayWithHiddenFields(defaults).year
520
+ : (defaults[YEAR] && !_.isNaN(defaults[YEAR]) ? defaults[YEAR] : 0);
515
521
  }
516
522
  let result;
517
523
  if (!day && !month && !year) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5836.bcc14e7",
3
+ "version": "5.0.0-dev.5838.99aa253",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {