@formio/js 5.1.0-dev.6067.676f8e2 → 5.1.0-dev.6068.aa2e893
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 +3 -3
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +3 -3
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +27 -2
- package/lib/cjs/components/_classes/component/Component.js +62 -32
- package/lib/cjs/components/form/Form.d.ts +0 -1
- package/lib/cjs/components/form/Form.js +12 -20
- package/lib/cjs/components/survey/Survey.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +27 -2
- package/lib/mjs/components/_classes/component/Component.js +62 -32
- package/lib/mjs/components/form/Form.d.ts +0 -1
- package/lib/mjs/components/form/Form.js +12 -20
- package/lib/mjs/components/survey/Survey.js +1 -1
- package/package.json +1 -1
@@ -163,8 +163,18 @@ declare class Component extends Element {
|
|
163
163
|
*/
|
164
164
|
info: any;
|
165
165
|
get componentsMap(): object;
|
166
|
+
/**
|
167
|
+
* Returns if the parent should conditionally clear.
|
168
|
+
*
|
169
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
170
|
+
*/
|
166
171
|
parentShouldConditionallyClear(): boolean;
|
167
172
|
parentConditionallyHidden(): boolean;
|
173
|
+
/**
|
174
|
+
* Returns true if any of the parents default their component "hidden" property to true.
|
175
|
+
* @returns {boolean} - If any parent defaults the hidden property to true.
|
176
|
+
*/
|
177
|
+
anyParentDefaultsHidden(): boolean;
|
168
178
|
set data(value: any);
|
169
179
|
get data(): any;
|
170
180
|
mergeSchema(component?: {}): any;
|
@@ -228,8 +238,23 @@ declare class Component extends Element {
|
|
228
238
|
get visible(): boolean;
|
229
239
|
get logicallyHidden(): any;
|
230
240
|
_logicallyHidden: any;
|
231
|
-
|
232
|
-
|
241
|
+
/**
|
242
|
+
* Determines if the component should clear its value when the root form is pristine.
|
243
|
+
* @returns {boolean} - If the component should clear its value when the root form is pristine.
|
244
|
+
*/
|
245
|
+
shouldConditionallyClearOnPristine(): boolean;
|
246
|
+
/**
|
247
|
+
* Returns if the component should clear its value when conditionally hidden.
|
248
|
+
* @returns {boolean} - If the component should clear its value when conditionally hidden.
|
249
|
+
*/
|
250
|
+
shouldConditionallyClear(): boolean;
|
251
|
+
_conditionallyClear: boolean | undefined;
|
252
|
+
/**
|
253
|
+
* Returns if the component is conditionally hidden.
|
254
|
+
* @returns {boolean} - If the component is conditionally hidden.
|
255
|
+
*/
|
256
|
+
conditionallyHidden(): boolean;
|
257
|
+
_conditionallyHidden: boolean | undefined;
|
233
258
|
set currentForm(instance: any);
|
234
259
|
get currentForm(): any;
|
235
260
|
_currentForm: any;
|
@@ -458,10 +458,16 @@ class Component extends Element_1.default {
|
|
458
458
|
var _a;
|
459
459
|
return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.childComponentsMap) || {};
|
460
460
|
}
|
461
|
+
/**
|
462
|
+
* Returns if the parent should conditionally clear.
|
463
|
+
*
|
464
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
465
|
+
*/
|
461
466
|
parentShouldConditionallyClear() {
|
462
467
|
let currentParent = this.parent;
|
463
468
|
while (currentParent) {
|
464
|
-
if (currentParent.
|
469
|
+
if ((currentParent.allowData && currentParent._conditionallyClear) ||
|
470
|
+
(!currentParent.allowData && currentParent._conditionallyHidden)) {
|
465
471
|
return true;
|
466
472
|
}
|
467
473
|
currentParent = currentParent.parent;
|
@@ -471,7 +477,21 @@ class Component extends Element_1.default {
|
|
471
477
|
parentConditionallyHidden() {
|
472
478
|
let currentParent = this.parent;
|
473
479
|
while (currentParent) {
|
474
|
-
if (currentParent.
|
480
|
+
if (currentParent._conditionallyHidden) {
|
481
|
+
return true;
|
482
|
+
}
|
483
|
+
currentParent = currentParent.parent;
|
484
|
+
}
|
485
|
+
return false;
|
486
|
+
}
|
487
|
+
/**
|
488
|
+
* Returns true if any of the parents default their component "hidden" property to true.
|
489
|
+
* @returns {boolean} - If any parent defaults the hidden property to true.
|
490
|
+
*/
|
491
|
+
anyParentDefaultsHidden() {
|
492
|
+
let currentParent = this.parent;
|
493
|
+
while (currentParent) {
|
494
|
+
if (currentParent.component.hidden) {
|
475
495
|
return true;
|
476
496
|
}
|
477
497
|
currentParent = currentParent.parent;
|
@@ -689,48 +709,58 @@ class Component extends Element_1.default {
|
|
689
709
|
}
|
690
710
|
return this._logicallyHidden;
|
691
711
|
}
|
692
|
-
|
712
|
+
/**
|
713
|
+
* Determines if the component should clear its value when the root form is pristine.
|
714
|
+
* @returns {boolean} - If the component should clear its value when the root form is pristine.
|
715
|
+
*/
|
716
|
+
shouldConditionallyClearOnPristine() {
|
717
|
+
// If the form is pristine, we should NOT clear the value of a conditionally hidden child component
|
718
|
+
// of a layout component that defaults to hidden using the "hidden" component property.
|
719
|
+
return !this.anyParentDefaultsHidden();
|
720
|
+
}
|
721
|
+
/**
|
722
|
+
* Returns if the component should clear its value when conditionally hidden.
|
723
|
+
* @returns {boolean} - If the component should clear its value when conditionally hidden.
|
724
|
+
*/
|
725
|
+
shouldConditionallyClear() {
|
693
726
|
// Skip if this component has clearOnHide set to false.
|
694
727
|
if (this.component.clearOnHide === false) {
|
695
|
-
|
728
|
+
this._conditionallyClear = false;
|
729
|
+
return this._conditionallyClear;
|
696
730
|
}
|
697
731
|
// If the component is logically hidden, then it is conditionally hidden and should clear.
|
698
732
|
if (this.logicallyHidden) {
|
699
|
-
|
733
|
+
this._conditionallyClear = true;
|
734
|
+
return this._conditionallyClear;
|
700
735
|
}
|
701
736
|
// If we have a condition and it is not conditionally visible, the it should conditionally clear.
|
702
|
-
if (this.hasCondition() &&
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
return false;
|
708
|
-
}
|
709
|
-
// If this component has a set value, then it should ONLY clear if a parent is hidden
|
710
|
-
// and has the clearOnHide set to true.
|
711
|
-
if (this.hasSetValue) {
|
712
|
-
return this.parentShouldConditionallyClear();
|
737
|
+
if (this.hasCondition() &&
|
738
|
+
!this.conditionallyVisible() &&
|
739
|
+
(!this.rootPristine || this.shouldConditionallyClearOnPristine())) {
|
740
|
+
this._conditionallyClear = true;
|
741
|
+
return this._conditionallyClear;
|
713
742
|
}
|
714
|
-
|
715
|
-
return this.
|
743
|
+
this._conditionallyClear = this.hasSetValue ? false : this.parentShouldConditionallyClear();
|
744
|
+
return this._conditionallyClear;
|
716
745
|
}
|
717
|
-
|
746
|
+
/**
|
747
|
+
* Returns if the component is conditionally hidden.
|
748
|
+
* @returns {boolean} - If the component is conditionally hidden.
|
749
|
+
*/
|
750
|
+
conditionallyHidden() {
|
751
|
+
// If it is logically hidden, then it is conditionally hidden.
|
718
752
|
if (this.logicallyHidden) {
|
719
|
-
|
720
|
-
|
721
|
-
if (!this.hasCondition() && !skipParent) {
|
722
|
-
return this.parentConditionallyHidden();
|
753
|
+
this._conditionallyHidden = true;
|
754
|
+
return this._conditionallyHidden;
|
723
755
|
}
|
724
|
-
//
|
725
|
-
if (!this.conditionallyVisible()) {
|
726
|
-
|
727
|
-
|
728
|
-
if (skipParent) {
|
729
|
-
// Stop recurrsion for the parent checks.
|
730
|
-
return false;
|
756
|
+
// If it has a condition, and is not conditionally visible, then it is conditionally hidden.
|
757
|
+
if (this.hasCondition() && !this.conditionallyVisible()) {
|
758
|
+
this._conditionallyHidden = true;
|
759
|
+
return this._conditionallyHidden;
|
731
760
|
}
|
732
|
-
//
|
733
|
-
|
761
|
+
// It is conditionally hidden if its parent is conditionally hidden.
|
762
|
+
this._conditionallyHidden = this.parentConditionallyHidden();
|
763
|
+
return this._conditionallyHidden;
|
734
764
|
}
|
735
765
|
get currentForm() {
|
736
766
|
return this._currentForm;
|
@@ -98,7 +98,6 @@ export default class FormComponent extends Component {
|
|
98
98
|
* @returns {void}
|
99
99
|
*/
|
100
100
|
onSetSubFormValue(submission: object | null | undefined, flags: object | null | undefined): void;
|
101
|
-
areAllComponentsEmpty(data: any): boolean;
|
102
101
|
updateSubFormVisibility(): void;
|
103
102
|
/**
|
104
103
|
* Determines if this form is a Nested Wizard
|
@@ -101,6 +101,9 @@ class FormComponent extends Component_1.default {
|
|
101
101
|
}
|
102
102
|
return this.createSubForm();
|
103
103
|
}
|
104
|
+
shouldConditionallyClearOnPristine() {
|
105
|
+
return !this.hasSetValue && super.shouldConditionallyClearOnPristine();
|
106
|
+
}
|
104
107
|
get dataReady() {
|
105
108
|
var _a;
|
106
109
|
return ((_a = this.subForm) === null || _a === void 0 ? void 0 : _a.dataReady) || this.subFormReady || Promise.resolve();
|
@@ -290,11 +293,13 @@ class FormComponent extends Component_1.default {
|
|
290
293
|
}
|
291
294
|
this.subForm.attach(element);
|
292
295
|
this.valueChanged = this.hasSetValue;
|
293
|
-
if (!this.
|
294
|
-
this.
|
295
|
-
|
296
|
-
|
297
|
-
|
296
|
+
if (!this.shouldConditionallyClear()) {
|
297
|
+
if (!this.valueChanged && this.dataValue.state !== 'submitted') {
|
298
|
+
this.setDefaultValue();
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
this.restoreValue();
|
302
|
+
}
|
298
303
|
}
|
299
304
|
}
|
300
305
|
if (!this.builderMode && this.component.modalEdit) {
|
@@ -411,7 +416,7 @@ class FormComponent extends Component_1.default {
|
|
411
416
|
lodash_1.default.assign(componentsMap, formComponentsMap);
|
412
417
|
this.component.components = this.subForm.components.map((comp) => comp.component);
|
413
418
|
this.subForm.on('change', () => {
|
414
|
-
if (this.subForm) {
|
419
|
+
if (this.subForm && !this.shouldConditionallyClear()) {
|
415
420
|
this.dataValue = this.subForm.getValue();
|
416
421
|
this.triggerChange({
|
417
422
|
noEmit: true
|
@@ -679,20 +684,7 @@ class FormComponent extends Component_1.default {
|
|
679
684
|
}
|
680
685
|
}
|
681
686
|
isEmpty(value = this.dataValue) {
|
682
|
-
return value === null || lodash_1.default.isEqual(value, this.emptyValue)
|
683
|
-
}
|
684
|
-
areAllComponentsEmpty(data) {
|
685
|
-
let res = true;
|
686
|
-
if (this.subForm) {
|
687
|
-
this.subForm.everyComponent((comp) => {
|
688
|
-
const componentValue = lodash_1.default.get(data, comp.key);
|
689
|
-
res &= comp.isEmpty(componentValue);
|
690
|
-
});
|
691
|
-
}
|
692
|
-
else {
|
693
|
-
res = false;
|
694
|
-
}
|
695
|
-
return res;
|
687
|
+
return value === null || lodash_1.default.isEqual(value, this.emptyValue);
|
696
688
|
}
|
697
689
|
getValue() {
|
698
690
|
if (this.subForm) {
|
@@ -120,7 +120,7 @@ class SurveyComponent extends Field_1.default {
|
|
120
120
|
return this.component.questions.reduce((result, question) => result && Boolean(value[question.value]), true);
|
121
121
|
}
|
122
122
|
getInputName(question) {
|
123
|
-
return `${this.options.name}[${question.value}]
|
123
|
+
return `${this.options.name}[${question.value}]`;
|
124
124
|
}
|
125
125
|
getValueAsString(value, options) {
|
126
126
|
if (options === null || options === void 0 ? void 0 : options.email) {
|
@@ -163,8 +163,18 @@ declare class Component extends Element {
|
|
163
163
|
*/
|
164
164
|
info: any;
|
165
165
|
get componentsMap(): object;
|
166
|
+
/**
|
167
|
+
* Returns if the parent should conditionally clear.
|
168
|
+
*
|
169
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
170
|
+
*/
|
166
171
|
parentShouldConditionallyClear(): boolean;
|
167
172
|
parentConditionallyHidden(): boolean;
|
173
|
+
/**
|
174
|
+
* Returns true if any of the parents default their component "hidden" property to true.
|
175
|
+
* @returns {boolean} - If any parent defaults the hidden property to true.
|
176
|
+
*/
|
177
|
+
anyParentDefaultsHidden(): boolean;
|
168
178
|
set data(value: any);
|
169
179
|
get data(): any;
|
170
180
|
mergeSchema(component?: {}): any;
|
@@ -228,8 +238,23 @@ declare class Component extends Element {
|
|
228
238
|
get visible(): boolean;
|
229
239
|
get logicallyHidden(): any;
|
230
240
|
_logicallyHidden: any;
|
231
|
-
|
232
|
-
|
241
|
+
/**
|
242
|
+
* Determines if the component should clear its value when the root form is pristine.
|
243
|
+
* @returns {boolean} - If the component should clear its value when the root form is pristine.
|
244
|
+
*/
|
245
|
+
shouldConditionallyClearOnPristine(): boolean;
|
246
|
+
/**
|
247
|
+
* Returns if the component should clear its value when conditionally hidden.
|
248
|
+
* @returns {boolean} - If the component should clear its value when conditionally hidden.
|
249
|
+
*/
|
250
|
+
shouldConditionallyClear(): boolean;
|
251
|
+
_conditionallyClear: boolean | undefined;
|
252
|
+
/**
|
253
|
+
* Returns if the component is conditionally hidden.
|
254
|
+
* @returns {boolean} - If the component is conditionally hidden.
|
255
|
+
*/
|
256
|
+
conditionallyHidden(): boolean;
|
257
|
+
_conditionallyHidden: boolean | undefined;
|
233
258
|
set currentForm(instance: any);
|
234
259
|
get currentForm(): any;
|
235
260
|
_currentForm: any;
|
@@ -422,10 +422,16 @@ export default class Component extends Element {
|
|
422
422
|
get componentsMap() {
|
423
423
|
return this.root?.childComponentsMap || {};
|
424
424
|
}
|
425
|
+
/**
|
426
|
+
* Returns if the parent should conditionally clear.
|
427
|
+
*
|
428
|
+
* @returns {boolean} - If the parent should conditionally clear.
|
429
|
+
*/
|
425
430
|
parentShouldConditionallyClear() {
|
426
431
|
let currentParent = this.parent;
|
427
432
|
while (currentParent) {
|
428
|
-
if (currentParent.
|
433
|
+
if ((currentParent.allowData && currentParent._conditionallyClear) ||
|
434
|
+
(!currentParent.allowData && currentParent._conditionallyHidden)) {
|
429
435
|
return true;
|
430
436
|
}
|
431
437
|
currentParent = currentParent.parent;
|
@@ -435,7 +441,21 @@ export default class Component extends Element {
|
|
435
441
|
parentConditionallyHidden() {
|
436
442
|
let currentParent = this.parent;
|
437
443
|
while (currentParent) {
|
438
|
-
if (currentParent.
|
444
|
+
if (currentParent._conditionallyHidden) {
|
445
|
+
return true;
|
446
|
+
}
|
447
|
+
currentParent = currentParent.parent;
|
448
|
+
}
|
449
|
+
return false;
|
450
|
+
}
|
451
|
+
/**
|
452
|
+
* Returns true if any of the parents default their component "hidden" property to true.
|
453
|
+
* @returns {boolean} - If any parent defaults the hidden property to true.
|
454
|
+
*/
|
455
|
+
anyParentDefaultsHidden() {
|
456
|
+
let currentParent = this.parent;
|
457
|
+
while (currentParent) {
|
458
|
+
if (currentParent.component.hidden) {
|
439
459
|
return true;
|
440
460
|
}
|
441
461
|
currentParent = currentParent.parent;
|
@@ -653,48 +673,58 @@ export default class Component extends Element {
|
|
653
673
|
}
|
654
674
|
return this._logicallyHidden;
|
655
675
|
}
|
656
|
-
|
676
|
+
/**
|
677
|
+
* Determines if the component should clear its value when the root form is pristine.
|
678
|
+
* @returns {boolean} - If the component should clear its value when the root form is pristine.
|
679
|
+
*/
|
680
|
+
shouldConditionallyClearOnPristine() {
|
681
|
+
// If the form is pristine, we should NOT clear the value of a conditionally hidden child component
|
682
|
+
// of a layout component that defaults to hidden using the "hidden" component property.
|
683
|
+
return !this.anyParentDefaultsHidden();
|
684
|
+
}
|
685
|
+
/**
|
686
|
+
* Returns if the component should clear its value when conditionally hidden.
|
687
|
+
* @returns {boolean} - If the component should clear its value when conditionally hidden.
|
688
|
+
*/
|
689
|
+
shouldConditionallyClear() {
|
657
690
|
// Skip if this component has clearOnHide set to false.
|
658
691
|
if (this.component.clearOnHide === false) {
|
659
|
-
|
692
|
+
this._conditionallyClear = false;
|
693
|
+
return this._conditionallyClear;
|
660
694
|
}
|
661
695
|
// If the component is logically hidden, then it is conditionally hidden and should clear.
|
662
696
|
if (this.logicallyHidden) {
|
663
|
-
|
697
|
+
this._conditionallyClear = true;
|
698
|
+
return this._conditionallyClear;
|
664
699
|
}
|
665
700
|
// If we have a condition and it is not conditionally visible, the it should conditionally clear.
|
666
|
-
if (this.hasCondition() &&
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
return false;
|
672
|
-
}
|
673
|
-
// If this component has a set value, then it should ONLY clear if a parent is hidden
|
674
|
-
// and has the clearOnHide set to true.
|
675
|
-
if (this.hasSetValue) {
|
676
|
-
return this.parentShouldConditionallyClear();
|
701
|
+
if (this.hasCondition() &&
|
702
|
+
!this.conditionallyVisible() &&
|
703
|
+
(!this.rootPristine || this.shouldConditionallyClearOnPristine())) {
|
704
|
+
this._conditionallyClear = true;
|
705
|
+
return this._conditionallyClear;
|
677
706
|
}
|
678
|
-
|
679
|
-
return this.
|
707
|
+
this._conditionallyClear = this.hasSetValue ? false : this.parentShouldConditionallyClear();
|
708
|
+
return this._conditionallyClear;
|
680
709
|
}
|
681
|
-
|
710
|
+
/**
|
711
|
+
* Returns if the component is conditionally hidden.
|
712
|
+
* @returns {boolean} - If the component is conditionally hidden.
|
713
|
+
*/
|
714
|
+
conditionallyHidden() {
|
715
|
+
// If it is logically hidden, then it is conditionally hidden.
|
682
716
|
if (this.logicallyHidden) {
|
683
|
-
|
684
|
-
|
685
|
-
if (!this.hasCondition() && !skipParent) {
|
686
|
-
return this.parentConditionallyHidden();
|
717
|
+
this._conditionallyHidden = true;
|
718
|
+
return this._conditionallyHidden;
|
687
719
|
}
|
688
|
-
//
|
689
|
-
if (!this.conditionallyVisible()) {
|
690
|
-
|
691
|
-
|
692
|
-
if (skipParent) {
|
693
|
-
// Stop recurrsion for the parent checks.
|
694
|
-
return false;
|
720
|
+
// If it has a condition, and is not conditionally visible, then it is conditionally hidden.
|
721
|
+
if (this.hasCondition() && !this.conditionallyVisible()) {
|
722
|
+
this._conditionallyHidden = true;
|
723
|
+
return this._conditionallyHidden;
|
695
724
|
}
|
696
|
-
//
|
697
|
-
|
725
|
+
// It is conditionally hidden if its parent is conditionally hidden.
|
726
|
+
this._conditionallyHidden = this.parentConditionallyHidden();
|
727
|
+
return this._conditionallyHidden;
|
698
728
|
}
|
699
729
|
get currentForm() {
|
700
730
|
return this._currentForm;
|
@@ -98,7 +98,6 @@ export default class FormComponent extends Component {
|
|
98
98
|
* @returns {void}
|
99
99
|
*/
|
100
100
|
onSetSubFormValue(submission: object | null | undefined, flags: object | null | undefined): void;
|
101
|
-
areAllComponentsEmpty(data: any): boolean;
|
102
101
|
updateSubFormVisibility(): void;
|
103
102
|
/**
|
104
103
|
* Determines if this form is a Nested Wizard
|
@@ -96,6 +96,9 @@ export default class FormComponent extends Component {
|
|
96
96
|
}
|
97
97
|
return this.createSubForm();
|
98
98
|
}
|
99
|
+
shouldConditionallyClearOnPristine() {
|
100
|
+
return !this.hasSetValue && super.shouldConditionallyClearOnPristine();
|
101
|
+
}
|
99
102
|
get dataReady() {
|
100
103
|
return this.subForm?.dataReady || this.subFormReady || Promise.resolve();
|
101
104
|
}
|
@@ -286,11 +289,13 @@ export default class FormComponent extends Component {
|
|
286
289
|
}
|
287
290
|
this.subForm.attach(element);
|
288
291
|
this.valueChanged = this.hasSetValue;
|
289
|
-
if (!this.
|
290
|
-
this.
|
291
|
-
|
292
|
-
|
293
|
-
|
292
|
+
if (!this.shouldConditionallyClear()) {
|
293
|
+
if (!this.valueChanged && this.dataValue.state !== 'submitted') {
|
294
|
+
this.setDefaultValue();
|
295
|
+
}
|
296
|
+
else {
|
297
|
+
this.restoreValue();
|
298
|
+
}
|
294
299
|
}
|
295
300
|
}
|
296
301
|
if (!this.builderMode && this.component.modalEdit) {
|
@@ -405,7 +410,7 @@ export default class FormComponent extends Component {
|
|
405
410
|
_.assign(componentsMap, formComponentsMap);
|
406
411
|
this.component.components = this.subForm.components.map((comp) => comp.component);
|
407
412
|
this.subForm.on('change', () => {
|
408
|
-
if (this.subForm) {
|
413
|
+
if (this.subForm && !this.shouldConditionallyClear()) {
|
409
414
|
this.dataValue = this.subForm.getValue();
|
410
415
|
this.triggerChange({
|
411
416
|
noEmit: true
|
@@ -668,20 +673,7 @@ export default class FormComponent extends Component {
|
|
668
673
|
}
|
669
674
|
}
|
670
675
|
isEmpty(value = this.dataValue) {
|
671
|
-
return value === null || _.isEqual(value, this.emptyValue)
|
672
|
-
}
|
673
|
-
areAllComponentsEmpty(data) {
|
674
|
-
let res = true;
|
675
|
-
if (this.subForm) {
|
676
|
-
this.subForm.everyComponent((comp) => {
|
677
|
-
const componentValue = _.get(data, comp.key);
|
678
|
-
res &= comp.isEmpty(componentValue);
|
679
|
-
});
|
680
|
-
}
|
681
|
-
else {
|
682
|
-
res = false;
|
683
|
-
}
|
684
|
-
return res;
|
676
|
+
return value === null || _.isEqual(value, this.emptyValue);
|
685
677
|
}
|
686
678
|
getValue() {
|
687
679
|
if (this.subForm) {
|
@@ -118,7 +118,7 @@ export default class SurveyComponent extends Field {
|
|
118
118
|
return this.component.questions.reduce((result, question) => result && Boolean(value[question.value]), true);
|
119
119
|
}
|
120
120
|
getInputName(question) {
|
121
|
-
return `${this.options.name}[${question.value}]
|
121
|
+
return `${this.options.name}[${question.value}]`;
|
122
122
|
}
|
123
123
|
getValueAsString(value, options) {
|
124
124
|
if (options?.email) {
|