@ngx-formly/core 5.10.26 → 5.10.27
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/bundles/ngx-formly-core.umd.js +21 -14
- package/bundles/ngx-formly-core.umd.js.map +1 -1
- package/bundles/ngx-formly-core.umd.min.js +1 -1
- package/bundles/ngx-formly-core.umd.min.js.map +1 -1
- package/esm2015/lib/extensions/field-expression/field-expression.js +14 -14
- package/esm2015/lib/extensions/field-form/utils.js +11 -4
- package/esm5/lib/extensions/field-expression/field-expression.js +14 -14
- package/esm5/lib/extensions/field-form/utils.js +11 -4
- package/fesm2015/ngx-formly-core.js +23 -16
- package/fesm2015/ngx-formly-core.js.map +1 -1
- package/fesm5/ngx-formly-core.js +24 -17
- package/fesm5/ngx-formly-core.js.map +1 -1
- package/package.json +1 -1
package/fesm5/ngx-formly-core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|
|
4
4
|
import { debounceTime, switchMap, distinctUntilChanged, take, startWith, map } from 'rxjs/operators';
|
|
5
5
|
import { AbstractControl, FormArray, FormGroup, FormControl, FormGroupDirective, Validators } from '@angular/forms';
|
|
6
6
|
import { isObservable, Subject, of, Observable } from 'rxjs';
|
|
7
|
-
import { __extends,
|
|
7
|
+
import { __extends, __assign, __spread, __rest, __read, __values } from 'tslib';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @fileoverview added by tsickle
|
|
@@ -923,13 +923,18 @@ var FormlyFormBuilder = /** @class */ (function () {
|
|
|
923
923
|
function unregisterControl(field, emitEvent) {
|
|
924
924
|
if (emitEvent === void 0) { emitEvent = false; }
|
|
925
925
|
/** @type {?} */
|
|
926
|
-
var
|
|
926
|
+
var control = field.formControl;
|
|
927
|
+
/** @type {?} */
|
|
928
|
+
var fieldIndex = control['_fields'] ? control['_fields'].indexOf(field) : -1;
|
|
929
|
+
if (fieldIndex !== -1) {
|
|
930
|
+
control['_fields'].splice(fieldIndex, 1);
|
|
931
|
+
}
|
|
932
|
+
/** @type {?} */
|
|
933
|
+
var form = (/** @type {?} */ (control.parent));
|
|
927
934
|
if (!form) {
|
|
928
935
|
return;
|
|
929
936
|
}
|
|
930
937
|
/** @type {?} */
|
|
931
|
-
var control = field.formControl;
|
|
932
|
-
/** @type {?} */
|
|
933
938
|
var opts = { emitEvent: emitEvent };
|
|
934
939
|
if (form instanceof FormArray) {
|
|
935
940
|
/** @type {?} */
|
|
@@ -1116,6 +1121,8 @@ function updateControl(form, opts, action) {
|
|
|
1116
1121
|
*/
|
|
1117
1122
|
function clearControl(form) {
|
|
1118
1123
|
form['_fields'] && delete form['_fields'];
|
|
1124
|
+
form.setValidators(null);
|
|
1125
|
+
form.setAsyncValidators(null);
|
|
1119
1126
|
if (form instanceof FormGroup || form instanceof FormArray) {
|
|
1120
1127
|
Object.keys(form.controls)
|
|
1121
1128
|
.forEach((/**
|
|
@@ -3061,6 +3068,19 @@ FieldExpressionExtension = /** @class */ (function () {
|
|
|
3061
3068
|
*/
|
|
3062
3069
|
function (field, hide, resetOnHide) {
|
|
3063
3070
|
var _this = this;
|
|
3071
|
+
if (field.fieldGroup) {
|
|
3072
|
+
field.fieldGroup
|
|
3073
|
+
.filter((/**
|
|
3074
|
+
* @param {?} f
|
|
3075
|
+
* @return {?}
|
|
3076
|
+
*/
|
|
3077
|
+
function (f) { return !f.hideExpression; }))
|
|
3078
|
+
.forEach((/**
|
|
3079
|
+
* @param {?} f
|
|
3080
|
+
* @return {?}
|
|
3081
|
+
*/
|
|
3082
|
+
function (f) { return _this.toggleFormControl(f, hide, resetOnHide); }));
|
|
3083
|
+
}
|
|
3064
3084
|
if (field.formControl && field.key) {
|
|
3065
3085
|
defineHiddenProp(field, '_hide', !!(hide || field.hide));
|
|
3066
3086
|
/** @type {?} */
|
|
@@ -3094,19 +3114,6 @@ FieldExpressionExtension = /** @class */ (function () {
|
|
|
3094
3114
|
}
|
|
3095
3115
|
}
|
|
3096
3116
|
}
|
|
3097
|
-
if (field.fieldGroup) {
|
|
3098
|
-
field.fieldGroup
|
|
3099
|
-
.filter((/**
|
|
3100
|
-
* @param {?} f
|
|
3101
|
-
* @return {?}
|
|
3102
|
-
*/
|
|
3103
|
-
function (f) { return !f.hideExpression; }))
|
|
3104
|
-
.forEach((/**
|
|
3105
|
-
* @param {?} f
|
|
3106
|
-
* @return {?}
|
|
3107
|
-
*/
|
|
3108
|
-
function (f) { return _this.toggleFormControl(f, hide, resetOnHide); }));
|
|
3109
|
-
}
|
|
3110
3117
|
if (field.options.fieldChanges) {
|
|
3111
3118
|
field.options.fieldChanges.next((/** @type {?} */ ({ field: field, type: 'hidden', value: hide })));
|
|
3112
3119
|
}
|