@gravitee/ui-particles-angular 7.16.0-theme-submenu-c7158a3 → 7.16.1-fix-ps-132525d
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/gio-form-json-schema/gio-form-json-schema.component.mjs +21 -22
- package/fesm2015/gravitee-ui-particles-angular.mjs +18 -19
- package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-particles-angular.mjs +20 -21
- package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2979,8 +2979,27 @@ class GioFormJsonSchemaComponent {
|
|
|
2979
2979
|
return this.isValid$.pipe(takeUntil(this.unsubscribe$), take(1), map(isValid => (isValid ? null : { invalid: true })));
|
|
2980
2980
|
});
|
|
2981
2981
|
this.ngControl?.control?.updateValueAndValidity({ emitEvent: false });
|
|
2982
|
+
// When the parent form is touched, mark all the sub formGroup as touched if not already touched
|
|
2983
|
+
const parentControl = this.ngControl?.control?.parent;
|
|
2984
|
+
parentControl?.statusChanges
|
|
2985
|
+
?.pipe(takeUntil(this.unsubscribe$), map(() => parentControl?.touched), filter(touched => touched === true), distinctUntilChanged())
|
|
2986
|
+
.subscribe(() => {
|
|
2987
|
+
if (this.isDisabled) {
|
|
2988
|
+
return;
|
|
2989
|
+
}
|
|
2990
|
+
this.formGroup.markAllAsTouched();
|
|
2991
|
+
this.stateChanges$.next();
|
|
2992
|
+
});
|
|
2993
|
+
// Group all valueChanges events emit by formly in a single one
|
|
2994
|
+
merge(this.formGroup.statusChanges, this.formGroup.valueChanges)
|
|
2995
|
+
.pipe(takeUntil(this.unsubscribe$), debounceTime(100))
|
|
2996
|
+
.subscribe(() => {
|
|
2997
|
+
this.stateChanges$.next();
|
|
2998
|
+
});
|
|
2999
|
+
}
|
|
3000
|
+
ngAfterViewInit() {
|
|
2982
3001
|
// Subscribe to state changes to manage touches, status and value
|
|
2983
|
-
this.stateChanges$.pipe(takeUntil(this.unsubscribe$)
|
|
3002
|
+
this.stateChanges$.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
|
|
2984
3003
|
const { status, value, touched } = this.formGroup;
|
|
2985
3004
|
if (this.isDisabled) {
|
|
2986
3005
|
return;
|
|
@@ -3003,26 +3022,6 @@ class GioFormJsonSchemaComponent {
|
|
|
3003
3022
|
this.ngControl?.control?.updateValueAndValidity({ emitEvent: false });
|
|
3004
3023
|
this.changeDetectorRef.detectChanges();
|
|
3005
3024
|
});
|
|
3006
|
-
// When the parent form is touched, mark all the sub formGroup as touched if not already touched
|
|
3007
|
-
const parentControl = this.ngControl?.control?.parent;
|
|
3008
|
-
parentControl?.statusChanges
|
|
3009
|
-
?.pipe(takeUntil(this.unsubscribe$), map(() => parentControl?.touched), filter(touched => touched === true), distinctUntilChanged())
|
|
3010
|
-
.subscribe(() => {
|
|
3011
|
-
if (this.isDisabled) {
|
|
3012
|
-
return;
|
|
3013
|
-
}
|
|
3014
|
-
this.formGroup.markAllAsTouched();
|
|
3015
|
-
this.stateChanges$.next();
|
|
3016
|
-
});
|
|
3017
|
-
// Group all valueChanges events emit by formly in a single one
|
|
3018
|
-
merge(this.formGroup.statusChanges, this.formGroup.valueChanges)
|
|
3019
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
3020
|
-
.subscribe(() => {
|
|
3021
|
-
this.stateChanges$.next();
|
|
3022
|
-
});
|
|
3023
|
-
}
|
|
3024
|
-
ngAfterViewInit() {
|
|
3025
|
-
this.stateChanges$.next();
|
|
3026
3025
|
}
|
|
3027
3026
|
ngOnDestroy() {
|
|
3028
3027
|
this.unsubscribe$.next();
|