@formio/js 5.1.0-rc.20 → 5.1.0-rc.22

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.
Files changed (38) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +21 -10
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +3 -1
  7. package/dist/formio.full.js +22 -11
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +3 -1
  10. package/dist/formio.js +14 -14
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +2 -2
  13. package/dist/formio.utils.js +12 -1
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +3 -1
  16. package/lib/cjs/Embed.js +1 -1
  17. package/lib/cjs/Formio.js +1 -1
  18. package/lib/cjs/WebformBuilder.js +1 -1
  19. package/lib/cjs/Wizard.js +1 -1
  20. package/lib/cjs/components/_classes/component/Component.d.ts +2 -7
  21. package/lib/cjs/components/_classes/component/Component.js +23 -17
  22. package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -5
  23. package/lib/cjs/components/editgrid/EditGrid.js +0 -4
  24. package/lib/cjs/components/form/Form.js +5 -9
  25. package/lib/cjs/components/html/HTML.js +1 -2
  26. package/lib/cjs/components/tabs/Tabs.js +1 -0
  27. package/lib/mjs/Embed.js +1 -1
  28. package/lib/mjs/Formio.js +1 -1
  29. package/lib/mjs/WebformBuilder.js +1 -1
  30. package/lib/mjs/Wizard.js +1 -1
  31. package/lib/mjs/components/_classes/component/Component.d.ts +2 -7
  32. package/lib/mjs/components/_classes/component/Component.js +23 -17
  33. package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -5
  34. package/lib/mjs/components/editgrid/EditGrid.js +0 -4
  35. package/lib/mjs/components/form/Form.js +5 -9
  36. package/lib/mjs/components/html/HTML.js +1 -2
  37. package/lib/mjs/components/tabs/Tabs.js +1 -0
  38. package/package.json +2 -2
@@ -20,7 +20,9 @@
20
20
 
21
21
  /*! @license DOMPurify 3.2.3 | (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.3/LICENSE */
22
22
 
23
- /*! formiojs v5.1.0-rc.20 | https://unpkg.com/formiojs@5.1.0-rc.20/LICENSE.txt */
23
+ /*! @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 */
24
+
25
+ /*! formiojs v5.1.0-rc.22 | https://unpkg.com/formiojs@5.1.0-rc.22/LICENSE.txt */
24
26
 
25
27
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
26
28
 
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.1.0-rc.20';
421
+ Formio.version = '5.1.0-rc.22';
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.1.0-rc.20';
14
+ sdk_1.Formio.version = '5.1.0-rc.22';
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) {
@@ -1634,7 +1634,7 @@ class WebformBuilder extends Component_1.default {
1634
1634
  info.type);
1635
1635
  }
1636
1636
  hasEditTabs(type) {
1637
- const editTabs = (0, formUtils_1.getComponent)(Components_1.default.components[type].editForm().components, 'tabs', true).components;
1637
+ const editTabs = (0, formUtils_1.getComponent)(Components_1.default.components[type === 'custom' ? 'unknown' : type].editForm().components, 'tabs', true).components;
1638
1638
  const hiddenEditTabs = lodash_1.default.filter(lodash_1.default.get(this.options, `editForm.${type}`, []), 'ignore');
1639
1639
  return lodash_1.default.intersectionBy(editTabs, hiddenEditTabs, 'key').length !== editTabs.length;
1640
1640
  }
package/lib/cjs/Wizard.js CHANGED
@@ -602,7 +602,7 @@ class Wizard extends Webform_1.default {
602
602
  }
603
603
  this.redraw().then(() => {
604
604
  this.checkData(this.submission.data);
605
- this.triggerCaptcha(this.currentPanel.componets);
605
+ this.triggerCaptcha(this.currentPanel.components);
606
606
  const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
607
607
  if (this.alert) {
608
608
  this.showErrors(errors, true, true);
@@ -119,13 +119,6 @@ declare class Component extends Element {
119
119
  */
120
120
  paths: import('@formio/core').ComponentPaths;
121
121
  _path: string;
122
- /**
123
- * Determines if this component is conditionally hidden. Should generally not be set outside of conditional logic pipeline.
124
- * This is necessary because of clearOnHide behavior that only clears when conditionally hidden - we need to track
125
- * conditionallyHidden separately from "regular" visibility.
126
- */
127
- _parentConditionallyHidden: any;
128
- _conditionallyHidden: any;
129
122
  /**
130
123
  * Determines if this component is visible, or not.
131
124
  */
@@ -170,6 +163,7 @@ declare class Component extends Element {
170
163
  */
171
164
  info: any;
172
165
  get componentsMap(): object;
166
+ get parentConditionallyHidden(): any;
173
167
  set data(value: any);
174
168
  get data(): any;
175
169
  mergeSchema(component?: {}): any;
@@ -239,6 +233,7 @@ declare class Component extends Element {
239
233
  * @returns {boolean} - Whether the component is conditionally hidden.
240
234
  */
241
235
  checkConditionallyHidden(data?: object, row?: object): boolean;
236
+ _conditionallyHidden: any;
242
237
  set currentForm(instance: any);
243
238
  get currentForm(): any;
244
239
  _currentForm: any;
@@ -346,8 +346,7 @@ class Component extends Element_1.default {
346
346
  * This is necessary because of clearOnHide behavior that only clears when conditionally hidden - we need to track
347
347
  * conditionallyHidden separately from "regular" visibility.
348
348
  */
349
- this._parentConditionallyHidden = this.options.hasOwnProperty('parentConditionallyHidden') ? this.options.parentConditionallyHidden : false;
350
- this._conditionallyHidden = this.checkConditionallyHidden(null, data) || this._parentConditionallyHidden;
349
+ this.checkConditionallyHidden(null, data);
351
350
  /**
352
351
  * Determines if this component is visible, or not.
353
352
  */
@@ -452,6 +451,18 @@ class Component extends Element_1.default {
452
451
  var _a;
453
452
  return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.childComponentsMap) || {};
454
453
  }
454
+ get parentConditionallyHidden() {
455
+ let parentHidden = false;
456
+ let currentParent = this.parent;
457
+ while (currentParent) {
458
+ parentHidden = parentHidden || currentParent._conditionallyHidden;
459
+ if (parentHidden) {
460
+ break;
461
+ }
462
+ currentParent = currentParent.parent;
463
+ }
464
+ return parentHidden;
465
+ }
455
466
  get data() {
456
467
  return this._data;
457
468
  }
@@ -492,7 +503,7 @@ class Component extends Element_1.default {
492
503
  init() {
493
504
  var _a;
494
505
  this.disabled = this.shouldDisabled;
495
- this._conditionallyHidden = this.checkConditionallyHidden();
506
+ this.checkConditionallyHidden();
496
507
  this._visible = (this.hasCondition() ? !this.conditionallyHidden : !this.component.hidden);
497
508
  if ((_a = this.component.addons) === null || _a === void 0 ? void 0 : _a.length) {
498
509
  this.component.addons.forEach((addon) => this.createAddon(addon));
@@ -656,7 +667,7 @@ class Component extends Element_1.default {
656
667
  return this._visible && this._parentVisible;
657
668
  }
658
669
  get conditionallyHidden() {
659
- return this._conditionallyHidden || this._parentConditionallyHidden;
670
+ return this._conditionallyHidden || this.parentConditionallyHidden;
660
671
  }
661
672
  /**
662
673
  * Evaluates whether the component is conditionally hidden (as opposed to intentionally hidden, e.g. via the `hidden` component schema property).
@@ -665,10 +676,13 @@ class Component extends Element_1.default {
665
676
  * @returns {boolean} - Whether the component is conditionally hidden.
666
677
  */
667
678
  checkConditionallyHidden(data = null, row = null) {
679
+ this._conditionallyHidden = false;
668
680
  if (!this.hasCondition()) {
669
- return false;
681
+ this._conditionallyHidden = this.parentConditionallyHidden;
682
+ return this._conditionallyHidden;
670
683
  }
671
- return !this.conditionallyVisible(data, row);
684
+ this._conditionallyHidden = !this.conditionallyVisible(data, row) || this.parentConditionallyHidden;
685
+ return this._conditionallyHidden;
672
686
  }
673
687
  get currentForm() {
674
688
  return this._currentForm;
@@ -1937,12 +1951,7 @@ class Component extends Element_1.default {
1937
1951
  this.redraw();
1938
1952
  }
1939
1953
  // Check advanced conditions (and cache the result)
1940
- const isConditionallyHidden = this.checkConditionallyHidden(data, row) || this._parentConditionallyHidden;
1941
- let shouldClear = false;
1942
- if (isConditionallyHidden !== this._conditionallyHidden) {
1943
- this._conditionallyHidden = isConditionallyHidden;
1944
- shouldClear = true;
1945
- }
1954
+ const shouldClear = this.checkConditionallyHidden(data, row);
1946
1955
  // Check visibility
1947
1956
  const visible = (this.hasCondition() ? !this.conditionallyHidden : !this.component.hidden);
1948
1957
  if (this.visible !== visible) {
@@ -2471,8 +2480,7 @@ class Component extends Element_1.default {
2471
2480
  * @returns {*} - The value for this component.
2472
2481
  */
2473
2482
  get dataValue() {
2474
- if (!this.key ||
2475
- (this.conditionallyHidden && this.component.clearOnHide && !this.rootPristine)) {
2483
+ if (!this.key) {
2476
2484
  return this.emptyValue;
2477
2485
  }
2478
2486
  if (!this.hasValue() && this.shouldAddDefaultValue) {
@@ -2489,9 +2497,7 @@ class Component extends Element_1.default {
2489
2497
  * @param {*} value - The value to set for this component.
2490
2498
  */
2491
2499
  set dataValue(value) {
2492
- if (!this.allowData ||
2493
- !this.key ||
2494
- (this.conditionallyHidden && this.component.clearOnHide && !this.rootPristine)) {
2500
+ if (!this.allowData || !this.key) {
2495
2501
  return;
2496
2502
  }
2497
2503
  if ((value !== null) && (value !== undefined)) {
@@ -85,18 +85,16 @@ class NestedComponent extends Field_1.default {
85
85
  const visibilityChanged = this._visible !== value;
86
86
  this._visible = value;
87
87
  const isVisible = this.visible;
88
- const isConditionallyHidden = this.checkConditionallyHidden();
88
+ this.checkConditionallyHidden();
89
89
  const forceShow = this.shouldForceShow();
90
90
  const forceHide = this.shouldForceHide();
91
91
  this.components.forEach((component) => {
92
92
  // Set the parent visibility first since we may have nested components within nested components
93
93
  // and they need to be able to determine their visibility based on the parent visibility.
94
94
  component.parentVisible = isVisible;
95
- component._parentConditionallyHidden = isConditionallyHidden;
96
95
  let visible;
97
96
  if (component.hasCondition()) {
98
- component._conditionallyHidden = component.checkConditionallyHidden() || component._parentConditionallyHidden;
99
- visible = !component.conditionallyHidden;
97
+ visible = !component.checkConditionallyHidden();
100
98
  }
101
99
  else {
102
100
  visible = !component.component.hidden;
@@ -377,7 +375,6 @@ class NestedComponent extends Field_1.default {
377
375
  data = data || this.data;
378
376
  options.parent = this;
379
377
  options.parentVisible = this.visible;
380
- options.parentConditionallyHidden = this.conditionallyHidden;
381
378
  options.root = (options === null || options === void 0 ? void 0 : options.root) || this.root || this;
382
379
  options.localRoot = this.localRoot;
383
380
  options.skipInit = true;
@@ -1141,9 +1141,6 @@ class EditGridComponent extends NestedArrayComponent_1.default {
1141
1141
  }
1142
1142
  }
1143
1143
  const changed = this.hasChanged(value, this.dataValue);
1144
- if (this.parent) {
1145
- this.parent.checkComponentConditions();
1146
- }
1147
1144
  this.dataValue = value;
1148
1145
  // Refresh editRow data when data changes.
1149
1146
  this.dataValue.forEach((row, rowIndex) => {
@@ -1174,7 +1171,6 @@ class EditGridComponent extends NestedArrayComponent_1.default {
1174
1171
  this.editRows = this.editRows.slice(0, dataLength);
1175
1172
  this.openWhenEmpty();
1176
1173
  this.updateOnChange(flags, changed);
1177
- this.checkData();
1178
1174
  this.changeState(changed, flags);
1179
1175
  return changed;
1180
1176
  }
@@ -591,20 +591,16 @@ class FormComponent extends Component_1.default {
591
591
  return Promise.resolve(this.dataValue);
592
592
  }
593
593
  // we need to load a hidden form (when clearOnHide is disabled) in order to get and submit (if needed) its data
594
- const loadHiddenForm = !this.subForm && !this.component.clearOnHide;
595
- if ((this.isSubFormLazyLoad() || loadHiddenForm) && !this.subFormLoading) {
594
+ const loadHiddenForm = !this.component.clearOnHide;
595
+ if ((this.isSubFormLazyLoad() || loadHiddenForm) && !this.subFormLoading && !this.subForm) {
596
596
  return this.createSubForm(true, true)
597
- .then(this.submitSubForm(false))
598
- .then(() => {
599
- return this.dataValue;
600
- })
597
+ .then(() => this.submitSubForm(false))
598
+ .then(() => this.dataValue)
601
599
  .then(() => super.beforeSubmit());
602
600
  }
603
601
  else {
604
602
  return this.submitSubForm(false)
605
- .then(() => {
606
- return this.dataValue;
607
- })
603
+ .then(() => this.dataValue)
608
604
  .then(() => super.beforeSubmit());
609
605
  }
610
606
  }
@@ -58,8 +58,7 @@ class HTMLComponent extends Component_1.default {
58
58
  super.checkRefreshOn(changed);
59
59
  let visible;
60
60
  if (this.hasCondition()) {
61
- this._conditionallyHidden = this.checkConditionallyHidden();
62
- visible = !this.conditionallyHidden;
61
+ visible = !this.checkConditionallyHidden();
63
62
  }
64
63
  else {
65
64
  visible = !this.component.hidden;
@@ -143,6 +143,7 @@ class TabsComponent extends NestedComponent_1.default {
143
143
  this.addClass(this.refs[this.tabLinkKey][index], 'active');
144
144
  this.addClass(this.refs[this.tabLinkKey][index], 'formio-tab-link-active');
145
145
  }
146
+ this.setValue(this.data);
146
147
  this.triggerChange();
147
148
  }
148
149
  beforeFocus(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.1.0-rc.20';
17
+ static version = '5.1.0-rc.22';
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.1.0-rc.20';
7
+ FormioCore.version = '5.1.0-rc.22';
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) {
@@ -1637,7 +1637,7 @@ export default class WebformBuilder extends Component {
1637
1637
  info.type);
1638
1638
  }
1639
1639
  hasEditTabs(type) {
1640
- const editTabs = getComponent(Components.components[type].editForm().components, 'tabs', true).components;
1640
+ const editTabs = getComponent(Components.components[type === 'custom' ? 'unknown' : type].editForm().components, 'tabs', true).components;
1641
1641
  const hiddenEditTabs = _.filter(_.get(this.options, `editForm.${type}`, []), 'ignore');
1642
1642
  return _.intersectionBy(editTabs, hiddenEditTabs, 'key').length !== editTabs.length;
1643
1643
  }
package/lib/mjs/Wizard.js CHANGED
@@ -594,7 +594,7 @@ export default class Wizard extends Webform {
594
594
  }
595
595
  this.redraw().then(() => {
596
596
  this.checkData(this.submission.data);
597
- this.triggerCaptcha(this.currentPanel.componets);
597
+ this.triggerCaptcha(this.currentPanel.components);
598
598
  const errors = this.submitted ? this.validate(this.localData, { dirty: true }) : this.validateCurrentPage();
599
599
  if (this.alert) {
600
600
  this.showErrors(errors, true, true);
@@ -119,13 +119,6 @@ declare class Component extends Element {
119
119
  */
120
120
  paths: import('@formio/core').ComponentPaths;
121
121
  _path: string;
122
- /**
123
- * Determines if this component is conditionally hidden. Should generally not be set outside of conditional logic pipeline.
124
- * This is necessary because of clearOnHide behavior that only clears when conditionally hidden - we need to track
125
- * conditionallyHidden separately from "regular" visibility.
126
- */
127
- _parentConditionallyHidden: any;
128
- _conditionallyHidden: any;
129
122
  /**
130
123
  * Determines if this component is visible, or not.
131
124
  */
@@ -170,6 +163,7 @@ declare class Component extends Element {
170
163
  */
171
164
  info: any;
172
165
  get componentsMap(): object;
166
+ get parentConditionallyHidden(): any;
173
167
  set data(value: any);
174
168
  get data(): any;
175
169
  mergeSchema(component?: {}): any;
@@ -239,6 +233,7 @@ declare class Component extends Element {
239
233
  * @returns {boolean} - Whether the component is conditionally hidden.
240
234
  */
241
235
  checkConditionallyHidden(data?: object, row?: object): boolean;
236
+ _conditionallyHidden: any;
242
237
  set currentForm(instance: any);
243
238
  get currentForm(): any;
244
239
  _currentForm: any;
@@ -320,8 +320,7 @@ export default class Component extends Element {
320
320
  * This is necessary because of clearOnHide behavior that only clears when conditionally hidden - we need to track
321
321
  * conditionallyHidden separately from "regular" visibility.
322
322
  */
323
- this._parentConditionallyHidden = this.options.hasOwnProperty('parentConditionallyHidden') ? this.options.parentConditionallyHidden : false;
324
- this._conditionallyHidden = this.checkConditionallyHidden(null, data) || this._parentConditionallyHidden;
323
+ this.checkConditionallyHidden(null, data);
325
324
  /**
326
325
  * Determines if this component is visible, or not.
327
326
  */
@@ -425,6 +424,18 @@ export default class Component extends Element {
425
424
  get componentsMap() {
426
425
  return this.root?.childComponentsMap || {};
427
426
  }
427
+ get parentConditionallyHidden() {
428
+ let parentHidden = false;
429
+ let currentParent = this.parent;
430
+ while (currentParent) {
431
+ parentHidden = parentHidden || currentParent._conditionallyHidden;
432
+ if (parentHidden) {
433
+ break;
434
+ }
435
+ currentParent = currentParent.parent;
436
+ }
437
+ return parentHidden;
438
+ }
428
439
  get data() {
429
440
  return this._data;
430
441
  }
@@ -464,7 +475,7 @@ export default class Component extends Element {
464
475
  }
465
476
  init() {
466
477
  this.disabled = this.shouldDisabled;
467
- this._conditionallyHidden = this.checkConditionallyHidden();
478
+ this.checkConditionallyHidden();
468
479
  this._visible = (this.hasCondition() ? !this.conditionallyHidden : !this.component.hidden);
469
480
  if (this.component.addons?.length) {
470
481
  this.component.addons.forEach((addon) => this.createAddon(addon));
@@ -629,7 +640,7 @@ export default class Component extends Element {
629
640
  return this._visible && this._parentVisible;
630
641
  }
631
642
  get conditionallyHidden() {
632
- return this._conditionallyHidden || this._parentConditionallyHidden;
643
+ return this._conditionallyHidden || this.parentConditionallyHidden;
633
644
  }
634
645
  /**
635
646
  * Evaluates whether the component is conditionally hidden (as opposed to intentionally hidden, e.g. via the `hidden` component schema property).
@@ -638,10 +649,13 @@ export default class Component extends Element {
638
649
  * @returns {boolean} - Whether the component is conditionally hidden.
639
650
  */
640
651
  checkConditionallyHidden(data = null, row = null) {
652
+ this._conditionallyHidden = false;
641
653
  if (!this.hasCondition()) {
642
- return false;
654
+ this._conditionallyHidden = this.parentConditionallyHidden;
655
+ return this._conditionallyHidden;
643
656
  }
644
- return !this.conditionallyVisible(data, row);
657
+ this._conditionallyHidden = !this.conditionallyVisible(data, row) || this.parentConditionallyHidden;
658
+ return this._conditionallyHidden;
645
659
  }
646
660
  get currentForm() {
647
661
  return this._currentForm;
@@ -1912,12 +1926,7 @@ export default class Component extends Element {
1912
1926
  this.redraw();
1913
1927
  }
1914
1928
  // Check advanced conditions (and cache the result)
1915
- const isConditionallyHidden = this.checkConditionallyHidden(data, row) || this._parentConditionallyHidden;
1916
- let shouldClear = false;
1917
- if (isConditionallyHidden !== this._conditionallyHidden) {
1918
- this._conditionallyHidden = isConditionallyHidden;
1919
- shouldClear = true;
1920
- }
1929
+ const shouldClear = this.checkConditionallyHidden(data, row);
1921
1930
  // Check visibility
1922
1931
  const visible = (this.hasCondition() ? !this.conditionallyHidden : !this.component.hidden);
1923
1932
  if (this.visible !== visible) {
@@ -2451,8 +2460,7 @@ export default class Component extends Element {
2451
2460
  * @returns {*} - The value for this component.
2452
2461
  */
2453
2462
  get dataValue() {
2454
- if (!this.key ||
2455
- (this.conditionallyHidden && this.component.clearOnHide && !this.rootPristine)) {
2463
+ if (!this.key) {
2456
2464
  return this.emptyValue;
2457
2465
  }
2458
2466
  if (!this.hasValue() && this.shouldAddDefaultValue) {
@@ -2469,9 +2477,7 @@ export default class Component extends Element {
2469
2477
  * @param {*} value - The value to set for this component.
2470
2478
  */
2471
2479
  set dataValue(value) {
2472
- if (!this.allowData ||
2473
- !this.key ||
2474
- (this.conditionallyHidden && this.component.clearOnHide && !this.rootPristine)) {
2480
+ if (!this.allowData || !this.key) {
2475
2481
  return;
2476
2482
  }
2477
2483
  if ((value !== null) && (value !== undefined)) {
@@ -81,18 +81,16 @@ export default class NestedComponent extends Field {
81
81
  const visibilityChanged = this._visible !== value;
82
82
  this._visible = value;
83
83
  const isVisible = this.visible;
84
- const isConditionallyHidden = this.checkConditionallyHidden();
84
+ this.checkConditionallyHidden();
85
85
  const forceShow = this.shouldForceShow();
86
86
  const forceHide = this.shouldForceHide();
87
87
  this.components.forEach((component) => {
88
88
  // Set the parent visibility first since we may have nested components within nested components
89
89
  // and they need to be able to determine their visibility based on the parent visibility.
90
90
  component.parentVisible = isVisible;
91
- component._parentConditionallyHidden = isConditionallyHidden;
92
91
  let visible;
93
92
  if (component.hasCondition()) {
94
- component._conditionallyHidden = component.checkConditionallyHidden() || component._parentConditionallyHidden;
95
- visible = !component.conditionallyHidden;
93
+ visible = !component.checkConditionallyHidden();
96
94
  }
97
95
  else {
98
96
  visible = !component.component.hidden;
@@ -373,7 +371,6 @@ export default class NestedComponent extends Field {
373
371
  data = data || this.data;
374
372
  options.parent = this;
375
373
  options.parentVisible = this.visible;
376
- options.parentConditionallyHidden = this.conditionallyHidden;
377
374
  options.root = options?.root || this.root || this;
378
375
  options.localRoot = this.localRoot;
379
376
  options.skipInit = true;
@@ -1132,9 +1132,6 @@ export default class EditGridComponent extends NestedArrayComponent {
1132
1132
  }
1133
1133
  }
1134
1134
  const changed = this.hasChanged(value, this.dataValue);
1135
- if (this.parent) {
1136
- this.parent.checkComponentConditions();
1137
- }
1138
1135
  this.dataValue = value;
1139
1136
  // Refresh editRow data when data changes.
1140
1137
  this.dataValue.forEach((row, rowIndex) => {
@@ -1165,7 +1162,6 @@ export default class EditGridComponent extends NestedArrayComponent {
1165
1162
  this.editRows = this.editRows.slice(0, dataLength);
1166
1163
  this.openWhenEmpty();
1167
1164
  this.updateOnChange(flags, changed);
1168
- this.checkData();
1169
1165
  this.changeState(changed, flags);
1170
1166
  return changed;
1171
1167
  }
@@ -584,20 +584,16 @@ export default class FormComponent extends Component {
584
584
  return Promise.resolve(this.dataValue);
585
585
  }
586
586
  // we need to load a hidden form (when clearOnHide is disabled) in order to get and submit (if needed) its data
587
- const loadHiddenForm = !this.subForm && !this.component.clearOnHide;
588
- if ((this.isSubFormLazyLoad() || loadHiddenForm) && !this.subFormLoading) {
587
+ const loadHiddenForm = !this.component.clearOnHide;
588
+ if ((this.isSubFormLazyLoad() || loadHiddenForm) && !this.subFormLoading && !this.subForm) {
589
589
  return this.createSubForm(true, true)
590
- .then(this.submitSubForm(false))
591
- .then(() => {
592
- return this.dataValue;
593
- })
590
+ .then(() => this.submitSubForm(false))
591
+ .then(() => this.dataValue)
594
592
  .then(() => super.beforeSubmit());
595
593
  }
596
594
  else {
597
595
  return this.submitSubForm(false)
598
- .then(() => {
599
- return this.dataValue;
600
- })
596
+ .then(() => this.dataValue)
601
597
  .then(() => super.beforeSubmit());
602
598
  }
603
599
  }
@@ -53,8 +53,7 @@ export default class HTMLComponent extends Component {
53
53
  super.checkRefreshOn(changed);
54
54
  let visible;
55
55
  if (this.hasCondition()) {
56
- this._conditionallyHidden = this.checkConditionallyHidden();
57
- visible = !this.conditionallyHidden;
56
+ visible = !this.checkConditionallyHidden();
58
57
  }
59
58
  else {
60
59
  visible = !this.component.hidden;
@@ -138,6 +138,7 @@ export default class TabsComponent extends NestedComponent {
138
138
  this.addClass(this.refs[this.tabLinkKey][index], 'active');
139
139
  this.addClass(this.refs[this.tabLinkKey][index], 'formio-tab-link-active');
140
140
  }
141
+ this.setValue(this.data);
141
142
  this.triggerChange();
142
143
  }
143
144
  beforeFocus(component) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-rc.20",
3
+ "version": "5.1.0-rc.22",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@formio/bootstrap": "3.1.0-rc.2",
83
83
  "@formio/choices.js": "^10.2.1",
84
- "@formio/core": "2.4.0-rc.11",
84
+ "@formio/core": "2.4.0-rc.12",
85
85
  "@formio/text-mask-addons": "^3.8.0-formio.4",
86
86
  "@formio/vanilla-text-mask": "^5.1.1-formio.1",
87
87
  "abortcontroller-polyfill": "^1.7.5",