@ngx-formly/core 6.3.8 → 6.3.10
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/esm2020/lib/extensions/field-expression/field-expression.mjs +4 -4
- package/esm2020/lib/models/fieldconfig.cache.mjs +1 -1
- package/esm2020/lib/models/fieldconfig.mjs +1 -1
- package/esm2020/lib/services/formly.builder.mjs +3 -3
- package/esm2020/lib/templates/field-array.type.mjs +2 -2
- package/esm2020/lib/utils.mjs +2 -2
- package/fesm2015/ngx-formly-core.mjs +7 -6
- package/fesm2015/ngx-formly-core.mjs.map +1 -1
- package/fesm2020/ngx-formly-core.mjs +6 -6
- package/fesm2020/ngx-formly-core.mjs.map +1 -1
- package/lib/models/fieldconfig.cache.d.ts +4 -1
- package/lib/models/fieldconfig.d.ts +10 -8
- package/package.json +1 -1
|
@@ -133,7 +133,7 @@ function clone(value) {
|
|
|
133
133
|
isObservable(value) ||
|
|
134
134
|
value instanceof TemplateRef ||
|
|
135
135
|
/* instanceof SafeHtmlImpl */ value.changingThisBreaksApplicationSecurity ||
|
|
136
|
-
['RegExp', 'FileList', 'File', 'Blob'].indexOf(value.constructor
|
|
136
|
+
['RegExp', 'FileList', 'File', 'Blob'].indexOf(value.constructor?.name) !== -1) {
|
|
137
137
|
return value;
|
|
138
138
|
}
|
|
139
139
|
if (value instanceof Set) {
|
|
@@ -569,7 +569,7 @@ class FormlyFormBuilder {
|
|
|
569
569
|
if (field.parent && isHiddenField(field)) {
|
|
570
570
|
// when hide is used in expression set defaul value will not be set until detect hide changes
|
|
571
571
|
// which causes default value not set on new item is added
|
|
572
|
-
options._hiddenFieldsForCheck?.push(field);
|
|
572
|
+
options._hiddenFieldsForCheck?.push({ field, default: false });
|
|
573
573
|
}
|
|
574
574
|
options.checkExpressions?.(field, true);
|
|
575
575
|
options._detectChanges?.(field);
|
|
@@ -1555,7 +1555,7 @@ class FieldArrayType extends FieldType {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
f.fieldGroup?.forEach((c) => this.markFieldForCheck(c));
|
|
1557
1557
|
if (f.hide === false) {
|
|
1558
|
-
this.options._hiddenFieldsForCheck.push(f);
|
|
1558
|
+
this.options._hiddenFieldsForCheck.push({ field: f });
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
@@ -1641,7 +1641,7 @@ class FieldExpressionExtension {
|
|
|
1641
1641
|
defineHiddenProp(field, '_hide', !!currentValue);
|
|
1642
1642
|
if (!firstChange || (firstChange && currentValue === true)) {
|
|
1643
1643
|
field.props.hidden = currentValue;
|
|
1644
|
-
field.options._hiddenFieldsForCheck.push(field);
|
|
1644
|
+
field.options._hiddenFieldsForCheck.push({ field });
|
|
1645
1645
|
}
|
|
1646
1646
|
});
|
|
1647
1647
|
if (field.hideExpression) {
|
|
@@ -1687,8 +1687,8 @@ class FieldExpressionExtension {
|
|
|
1687
1687
|
const fieldChanged = this.checkExpressions(f, ignoreCache);
|
|
1688
1688
|
const options = field.options;
|
|
1689
1689
|
options._hiddenFieldsForCheck
|
|
1690
|
-
.sort((f) => (f.hide ? -1 : 1))
|
|
1691
|
-
.forEach((f) => this.changeHideState(f, f.hide, !ignoreCache));
|
|
1690
|
+
.sort((f) => (f.field.hide ? -1 : 1))
|
|
1691
|
+
.forEach((f) => this.changeHideState(f.field, f.field.hide ?? f.default, !ignoreCache));
|
|
1692
1692
|
options._hiddenFieldsForCheck = [];
|
|
1693
1693
|
if (fieldChanged) {
|
|
1694
1694
|
this.checkExpressions(field);
|