@formio/js 5.1.0-dev.6181.dd734d1 → 5.1.0-dev.6194.87d4d3f

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.
@@ -454,18 +454,20 @@ class PDFBuilder extends WebformBuilder_1.default {
454
454
  const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
455
455
  // update elements which path was duplicated if any pathes have been changed
456
456
  if (!lodash_1.default.isEqual(this.repeatablePathsComps, repeatablePathsComps)) {
457
- (0, utils_1.eachComponent)(this.webform.getComponents(), (comp) => {
458
- if (this.repeatablePathsComps.includes(comp.component)) {
459
- this.webform.postMessage({ name: 'updateElement', data: comp.component });
460
- }
461
- });
457
+ if (!lodash_1.default.isEmpty(this.repeatablePathsComps)) {
458
+ (0, utils_1.eachComponent)(this.webform.getComponents(), (comp) => {
459
+ if (this.repeatablePathsComps.includes(comp.component)) {
460
+ this.webform.postMessage({ name: 'updateElement', data: comp.component });
461
+ }
462
+ });
463
+ }
462
464
  this.repeatablePathsComps = repeatablePathsComps;
463
465
  }
464
466
  if (!repeatablePathsComps.length) {
465
467
  return;
466
468
  }
467
469
  (0, utils_1.eachComponent)(this.webform.getComponents(), (comp) => {
468
- if (this.repeatablePathsComps.includes(comp)) {
470
+ if (this.repeatablePathsComps.includes(comp.component)) {
469
471
  this.webform.postMessage({
470
472
  name: 'showBuilderErrors',
471
473
  data: {
@@ -2563,7 +2563,7 @@ class Component extends Element_1.default {
2563
2563
  if ((value !== null) && (value !== undefined)) {
2564
2564
  value = this.hook('setDataValue', value, this.key, this._data);
2565
2565
  }
2566
- if ((value === null) || (value === undefined)) {
2566
+ if ((value === null) || (value === undefined) || lodash_1.default.isNaN(value)) {
2567
2567
  this.unset();
2568
2568
  return;
2569
2569
  }
@@ -571,11 +571,11 @@ class AddressComponent extends Container_1.default {
571
571
  }
572
572
  if (valueInManualMode) {
573
573
  if (this.component.manualModeViewString) {
574
- return this.interpolate(this.component.manualModeViewString, {
574
+ return this.evaluate(this.component.manualModeViewString, {
575
575
  address,
576
- data: this.data,
576
+ data: value,
577
577
  component: this.component,
578
- });
578
+ }, 'value');
579
579
  }
580
580
  return this.getComponents()
581
581
  .filter((component) => component.hasValue(address))
@@ -147,7 +147,7 @@ exports.default = [
147
147
  key: 'manualModeViewString',
148
148
  label: 'Manual Mode View String',
149
149
  placeholder: 'Enter Manual Mode View String',
150
- description: '"address" variable references component value, "data" - submission data and "component" - address component schema.',
150
+ description: '"data.address" references component value and "component" - address component schema.',
151
151
  weight: 60,
152
152
  rows: 5,
153
153
  editor: 'ace',
@@ -447,18 +447,20 @@ export default class PDFBuilder extends WebformBuilder {
447
447
  const repeatablePathsComps = this.findComponentsWithRepeatablePaths();
448
448
  // update elements which path was duplicated if any pathes have been changed
449
449
  if (!_.isEqual(this.repeatablePathsComps, repeatablePathsComps)) {
450
- eachComponent(this.webform.getComponents(), (comp) => {
451
- if (this.repeatablePathsComps.includes(comp.component)) {
452
- this.webform.postMessage({ name: 'updateElement', data: comp.component });
453
- }
454
- });
450
+ if (!_.isEmpty(this.repeatablePathsComps)) {
451
+ eachComponent(this.webform.getComponents(), (comp) => {
452
+ if (this.repeatablePathsComps.includes(comp.component)) {
453
+ this.webform.postMessage({ name: 'updateElement', data: comp.component });
454
+ }
455
+ });
456
+ }
455
457
  this.repeatablePathsComps = repeatablePathsComps;
456
458
  }
457
459
  if (!repeatablePathsComps.length) {
458
460
  return;
459
461
  }
460
462
  eachComponent(this.webform.getComponents(), (comp) => {
461
- if (this.repeatablePathsComps.includes(comp)) {
463
+ if (this.repeatablePathsComps.includes(comp.component)) {
462
464
  this.webform.postMessage({
463
465
  name: 'showBuilderErrors',
464
466
  data: {
@@ -2555,7 +2555,7 @@ export default class Component extends Element {
2555
2555
  if ((value !== null) && (value !== undefined)) {
2556
2556
  value = this.hook('setDataValue', value, this.key, this._data);
2557
2557
  }
2558
- if ((value === null) || (value === undefined)) {
2558
+ if ((value === null) || (value === undefined) || _.isNaN(value)) {
2559
2559
  this.unset();
2560
2560
  return;
2561
2561
  }
@@ -564,11 +564,11 @@ export default class AddressComponent extends ContainerComponent {
564
564
  }
565
565
  if (valueInManualMode) {
566
566
  if (this.component.manualModeViewString) {
567
- return this.interpolate(this.component.manualModeViewString, {
567
+ return this.evaluate(this.component.manualModeViewString, {
568
568
  address,
569
- data: this.data,
569
+ data: value,
570
570
  component: this.component,
571
- });
571
+ }, 'value');
572
572
  }
573
573
  return this.getComponents()
574
574
  .filter((component) => component.hasValue(address))
@@ -142,7 +142,7 @@ export default [
142
142
  key: 'manualModeViewString',
143
143
  label: 'Manual Mode View String',
144
144
  placeholder: 'Enter Manual Mode View String',
145
- description: '"address" variable references component value, "data" - submission data and "component" - address component schema.',
145
+ description: '"data.address" references component value and "component" - address component schema.',
146
146
  weight: 60,
147
147
  rows: 5,
148
148
  editor: 'ace',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6181.dd734d1",
3
+ "version": "5.1.0-dev.6194.87d4d3f",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {