@formio/js 5.1.0-dev.6181.dd734d1 → 5.1.0-dev.6192.9d1d8f4

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
  }
@@ -160,6 +160,13 @@ class TagsComponent extends Input_1.default {
160
160
  this.refs.input[0].parentNode.lastChild.focus();
161
161
  }
162
162
  }
163
+ getValue() {
164
+ if (this.choices) {
165
+ const value = this.choices.getValue(true);
166
+ return value.join(`${this.delimiter}`);
167
+ }
168
+ return super.getValue();
169
+ }
163
170
  getValueAsString(value) {
164
171
  if (!value) {
165
172
  return '';
@@ -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
  }
@@ -158,6 +158,13 @@ export default class TagsComponent extends Input {
158
158
  this.refs.input[0].parentNode.lastChild.focus();
159
159
  }
160
160
  }
161
+ getValue() {
162
+ if (this.choices) {
163
+ const value = this.choices.getValue(true);
164
+ return value.join(`${this.delimiter}`);
165
+ }
166
+ return super.getValue();
167
+ }
161
168
  getValueAsString(value) {
162
169
  if (!value) {
163
170
  return '';
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.6192.9d1d8f4",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {