@formio/js 5.2.1-rc.8 → 5.2.1-rc.9

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.
@@ -20,7 +20,7 @@
20
20
 
21
21
  /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
22
22
 
23
- /*! formiojs v5.2.1-rc.8 | https://unpkg.com/formiojs@5.2.1-rc.8/LICENSE.txt */
23
+ /*! formiojs v5.2.1-rc.9 | https://unpkg.com/formiojs@5.2.1-rc.9/LICENSE.txt */
24
24
 
25
25
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
26
 
package/lib/cjs/Embed.js CHANGED
@@ -418,7 +418,7 @@ Formio.formioReady = new Promise((ready, reject) => {
418
418
  _a._formioReady = ready;
419
419
  _a._formioReadyReject = reject;
420
420
  });
421
- Formio.version = '5.2.1-rc.8';
421
+ Formio.version = '5.2.1-rc.9';
422
422
  // Create a report.
423
423
  Formio.Report = {
424
424
  create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
package/lib/cjs/Formio.js CHANGED
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
11
11
  const providers_1 = __importDefault(require("./providers"));
12
12
  sdk_1.Formio.cdn = new CDN_1.default();
13
13
  sdk_1.Formio.Providers = providers_1.default;
14
- sdk_1.Formio.version = '5.2.1-rc.8';
14
+ sdk_1.Formio.version = '5.2.1-rc.9';
15
15
  CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
16
16
  const isNil = (val) => val === null || val === undefined;
17
17
  sdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -840,9 +840,6 @@ class NestedComponent extends Field_1.default {
840
840
  }
841
841
  }
842
842
  setValue(value, flags = {}) {
843
- if (!value) {
844
- return false;
845
- }
846
843
  // If the value is equal to the empty value, then this means we need to reset the values.
847
844
  if (lodash_1.default.isEqual(value, this.emptyValue)) {
848
845
  // TO-DO: For a future major release, we need to investigate removing the need for the
@@ -477,11 +477,18 @@ class DataGridComponent extends NestedArrayComponent_1.default {
477
477
  options.row = `${rowIndex}-${colIndex}`;
478
478
  options.rowIndex = rowIndex;
479
479
  options.onChange = (flags, changed, modified) => {
480
+ var _a, _b;
480
481
  if (changed.component.type === 'form') {
481
482
  const formComp = (0, utils_1.getComponent)(this.component.components, changed.component.key);
482
483
  lodash_1.default.set(formComp, 'components', changed.component.components);
483
484
  }
484
- this.triggerChange({ modified });
485
+ // If we're in a nested form we need to ensure our changes are triggered upstream
486
+ if (((_a = changed.instance.root) === null || _a === void 0 ? void 0 : _a.id) && (((_b = this.root) === null || _b === void 0 ? void 0 : _b.id) !== changed.instance.root.id)) {
487
+ changed.instance.root.triggerChange(flags, changed, modified);
488
+ }
489
+ else {
490
+ this.triggerChange({ modified });
491
+ }
485
492
  };
486
493
  let columnComponent;
487
494
  if (this.builderMode) {
@@ -142,7 +142,7 @@ class RadioComponent extends ListComponent_1.default {
142
142
  });
143
143
  this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';
144
144
  this.loadedOptions = [];
145
- if (!this.visible) {
145
+ if (!this.visible || this.optionsLoaded) {
146
146
  this.itemsLoadedResolve();
147
147
  }
148
148
  // Get the template keys for this radio component.
package/lib/mjs/Embed.js CHANGED
@@ -14,7 +14,7 @@ export class Formio {
14
14
  Formio._formioReady = ready;
15
15
  Formio._formioReadyReject = reject;
16
16
  });
17
- static version = '5.2.1-rc.8';
17
+ static version = '5.2.1-rc.9';
18
18
  static setLicense(license, norecurse = false) {
19
19
  Formio.license = license;
20
20
  if (!norecurse && Formio.FormioClass) {
package/lib/mjs/Formio.js CHANGED
@@ -4,7 +4,7 @@ import CDN from './CDN';
4
4
  import Providers from './providers';
5
5
  FormioCore.cdn = new CDN();
6
6
  FormioCore.Providers = Providers;
7
- FormioCore.version = '5.2.1-rc.8';
7
+ FormioCore.version = '5.2.1-rc.9';
8
8
  CDN.defaultCDN = FormioCore.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';
9
9
  const isNil = (val) => val === null || val === undefined;
10
10
  FormioCore.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {
@@ -834,9 +834,6 @@ export default class NestedComponent extends Field {
834
834
  }
835
835
  }
836
836
  setValue(value, flags = {}) {
837
- if (!value) {
838
- return false;
839
- }
840
837
  // If the value is equal to the empty value, then this means we need to reset the values.
841
838
  if (_.isEqual(value, this.emptyValue)) {
842
839
  // TO-DO: For a future major release, we need to investigate removing the need for the
@@ -477,7 +477,13 @@ export default class DataGridComponent extends NestedArrayComponent {
477
477
  const formComp = getComponent(this.component.components, changed.component.key);
478
478
  _.set(formComp, 'components', changed.component.components);
479
479
  }
480
- this.triggerChange({ modified });
480
+ // If we're in a nested form we need to ensure our changes are triggered upstream
481
+ if (changed.instance.root?.id && (this.root?.id !== changed.instance.root.id)) {
482
+ changed.instance.root.triggerChange(flags, changed, modified);
483
+ }
484
+ else {
485
+ this.triggerChange({ modified });
486
+ }
481
487
  };
482
488
  let columnComponent;
483
489
  if (this.builderMode) {
@@ -142,7 +142,7 @@ export default class RadioComponent extends ListComponent {
142
142
  });
143
143
  this.optionsLoaded = !this.component.dataSrc || this.component.dataSrc === 'values';
144
144
  this.loadedOptions = [];
145
- if (!this.visible) {
145
+ if (!this.visible || this.optionsLoaded) {
146
146
  this.itemsLoadedResolve();
147
147
  }
148
148
  // Get the template keys for this radio component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.2.1-rc.8",
3
+ "version": "5.2.1-rc.9",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -80,7 +80,7 @@
80
80
  "homepage": "https://github.com/formio/formio.js#readme",
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.1.2-rc.3",
83
- "@formio/core": "2.5.1-rc.7",
83
+ "@formio/core": "2.5.1-rc.8",
84
84
  "@formio/text-mask-addons": "^3.8.0-formio.4",
85
85
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
86
86
  "abortcontroller-polyfill": "^1.7.5",