@formio/js 5.1.0-dev.6114.02b6d9c → 5.1.0-dev.6115.a496b38
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.
- package/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/cjs/components/_classes/component/Component.js +2 -4
- package/lib/cjs/components/form/Form.js +13 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/mjs/components/_classes/component/Component.js +2 -4
- package/lib/mjs/components/form/Form.js +12 -1
- package/package.json +1 -1
@@ -165,6 +165,7 @@ declare class Component extends Element {
|
|
165
165
|
get componentsMap(): object;
|
166
166
|
/**
|
167
167
|
* Returns if the parent should conditionally clear.
|
168
|
+
*
|
168
169
|
* @returns {boolean} - If the parent should conditionally clear.
|
169
170
|
*/
|
170
171
|
parentShouldConditionallyClear(): boolean;
|
@@ -460,6 +460,7 @@ class Component extends Element_1.default {
|
|
460
460
|
}
|
461
461
|
/**
|
462
462
|
* Returns if the parent should conditionally clear.
|
463
|
+
*
|
463
464
|
* @returns {boolean} - If the parent should conditionally clear.
|
464
465
|
*/
|
465
466
|
parentShouldConditionallyClear() {
|
@@ -2713,16 +2714,13 @@ class Component extends Element_1.default {
|
|
2713
2714
|
}
|
2714
2715
|
const isArray = Array.isArray(value);
|
2715
2716
|
const valueInput = this.refs.fileLink || this.refs.input;
|
2716
|
-
const isFilelink = !!this.refs.fileLink;
|
2717
2717
|
if (isArray &&
|
2718
2718
|
Array.isArray(this.defaultValue) &&
|
2719
2719
|
this.refs.hasOwnProperty('input') &&
|
2720
2720
|
valueInput &&
|
2721
2721
|
(valueInput.length !== value.length) &&
|
2722
2722
|
this.visible) {
|
2723
|
-
|
2724
|
-
this.redraw();
|
2725
|
-
}
|
2723
|
+
this.redraw();
|
2726
2724
|
}
|
2727
2725
|
if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
|
2728
2726
|
this.redraw();
|
@@ -278,6 +278,9 @@ class FormComponent extends Component_1.default {
|
|
278
278
|
if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
|
279
279
|
this.createSubForm(true);
|
280
280
|
}
|
281
|
+
if (!this.subFormReady) {
|
282
|
+
return Promise.resolve();
|
283
|
+
}
|
281
284
|
return this.subFormReady.then(() => {
|
282
285
|
this.empty(element);
|
283
286
|
if (this.options.builder) {
|
@@ -408,13 +411,15 @@ class FormComponent extends Component_1.default {
|
|
408
411
|
}
|
409
412
|
// Render the form.
|
410
413
|
return (new Form_1.default(form, this.getSubOptions())).ready.then((instance) => {
|
414
|
+
var _a, _b;
|
411
415
|
this.subForm = instance;
|
412
416
|
this.subForm.currentForm = this;
|
413
417
|
this.subForm.parentVisible = this.visible;
|
414
418
|
const componentsMap = this.componentsMap;
|
415
419
|
const formComponentsMap = this.subForm.componentsMap;
|
416
420
|
lodash_1.default.assign(componentsMap, formComponentsMap);
|
417
|
-
this.component.components = this.subForm.
|
421
|
+
this.component.components = (_a = this.subForm._form) === null || _a === void 0 ? void 0 : _a.components;
|
422
|
+
this.component.display = (_b = this.subForm._form) === null || _b === void 0 ? void 0 : _b.display;
|
418
423
|
this.subForm.on('change', () => {
|
419
424
|
if (this.subForm && !this.shouldConditionallyClear()) {
|
420
425
|
this.dataValue = this.subForm.getValue();
|
@@ -699,6 +704,13 @@ class FormComponent extends Component_1.default {
|
|
699
704
|
}
|
700
705
|
return errors;
|
701
706
|
}
|
707
|
+
conditionallyHidden() {
|
708
|
+
const conditionallyHidden = super.conditionallyHidden();
|
709
|
+
if (this.subForm) {
|
710
|
+
this.subForm._conditionallyHidden = conditionallyHidden;
|
711
|
+
}
|
712
|
+
return conditionallyHidden;
|
713
|
+
}
|
702
714
|
updateSubFormVisibility() {
|
703
715
|
if (this.subForm) {
|
704
716
|
this.subForm.parentVisible = this.visible;
|
@@ -165,6 +165,7 @@ declare class Component extends Element {
|
|
165
165
|
get componentsMap(): object;
|
166
166
|
/**
|
167
167
|
* Returns if the parent should conditionally clear.
|
168
|
+
*
|
168
169
|
* @returns {boolean} - If the parent should conditionally clear.
|
169
170
|
*/
|
170
171
|
parentShouldConditionallyClear(): boolean;
|
@@ -424,6 +424,7 @@ export default class Component extends Element {
|
|
424
424
|
}
|
425
425
|
/**
|
426
426
|
* Returns if the parent should conditionally clear.
|
427
|
+
*
|
427
428
|
* @returns {boolean} - If the parent should conditionally clear.
|
428
429
|
*/
|
429
430
|
parentShouldConditionallyClear() {
|
@@ -2682,16 +2683,13 @@ export default class Component extends Element {
|
|
2682
2683
|
}
|
2683
2684
|
const isArray = Array.isArray(value);
|
2684
2685
|
const valueInput = this.refs.fileLink || this.refs.input;
|
2685
|
-
const isFilelink = !!this.refs.fileLink;
|
2686
2686
|
if (isArray &&
|
2687
2687
|
Array.isArray(this.defaultValue) &&
|
2688
2688
|
this.refs.hasOwnProperty('input') &&
|
2689
2689
|
valueInput &&
|
2690
2690
|
(valueInput.length !== value.length) &&
|
2691
2691
|
this.visible) {
|
2692
|
-
|
2693
|
-
this.redraw();
|
2694
|
-
}
|
2692
|
+
this.redraw();
|
2695
2693
|
}
|
2696
2694
|
if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {
|
2697
2695
|
this.redraw();
|
@@ -274,6 +274,9 @@ export default class FormComponent extends Component {
|
|
274
274
|
if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
|
275
275
|
this.createSubForm(true);
|
276
276
|
}
|
277
|
+
if (!this.subFormReady) {
|
278
|
+
return Promise.resolve();
|
279
|
+
}
|
277
280
|
return this.subFormReady.then(() => {
|
278
281
|
this.empty(element);
|
279
282
|
if (this.options.builder) {
|
@@ -408,7 +411,8 @@ export default class FormComponent extends Component {
|
|
408
411
|
const componentsMap = this.componentsMap;
|
409
412
|
const formComponentsMap = this.subForm.componentsMap;
|
410
413
|
_.assign(componentsMap, formComponentsMap);
|
411
|
-
this.component.components = this.subForm.components
|
414
|
+
this.component.components = this.subForm._form?.components;
|
415
|
+
this.component.display = this.subForm._form?.display;
|
412
416
|
this.subForm.on('change', () => {
|
413
417
|
if (this.subForm && !this.shouldConditionallyClear()) {
|
414
418
|
this.dataValue = this.subForm.getValue();
|
@@ -688,6 +692,13 @@ export default class FormComponent extends Component {
|
|
688
692
|
}
|
689
693
|
return errors;
|
690
694
|
}
|
695
|
+
conditionallyHidden() {
|
696
|
+
const conditionallyHidden = super.conditionallyHidden();
|
697
|
+
if (this.subForm) {
|
698
|
+
this.subForm._conditionallyHidden = conditionallyHidden;
|
699
|
+
}
|
700
|
+
return conditionallyHidden;
|
701
|
+
}
|
691
702
|
updateSubFormVisibility() {
|
692
703
|
if (this.subForm) {
|
693
704
|
this.subForm.parentVisible = this.visible;
|