@dsivd/prestations-ng 19.0.5-beta.2 → 19.0.5-beta.3
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.
|
Binary file
|
|
@@ -793,6 +793,16 @@ class FoehnInputComponent {
|
|
|
793
793
|
this.modelEffect = effect(() => {
|
|
794
794
|
this.onModelChange(this.model());
|
|
795
795
|
}, ...(ngDevMode ? [{ debugName: "modelEffect" }] : /* istanbul ignore next */ []));
|
|
796
|
+
this.patchModel = (patch) => {
|
|
797
|
+
this.model.update((current) => {
|
|
798
|
+
if (current &&
|
|
799
|
+
typeof current === 'object' &&
|
|
800
|
+
!Array.isArray(current)) {
|
|
801
|
+
return { ...current, ...patch };
|
|
802
|
+
}
|
|
803
|
+
throw new Error('patchModel can only be used with object models.');
|
|
804
|
+
});
|
|
805
|
+
};
|
|
796
806
|
}
|
|
797
807
|
get errors() {
|
|
798
808
|
return this._errors?.sort((a, b) => ObjectHelper.stripHtml(a.message).localeCompare(ObjectHelper.stripHtml(b.message)));
|
|
@@ -831,16 +841,6 @@ class FoehnInputComponent {
|
|
|
831
841
|
this.model.set(value);
|
|
832
842
|
}
|
|
833
843
|
}
|
|
834
|
-
patchModel(patch) {
|
|
835
|
-
this.model.update((current) => {
|
|
836
|
-
if (current &&
|
|
837
|
-
typeof current === 'object' &&
|
|
838
|
-
!Array.isArray(current)) {
|
|
839
|
-
return { ...current, ...patch };
|
|
840
|
-
}
|
|
841
|
-
throw new Error('patchModel can only be used with object models.');
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
844
|
hasErrorsToDisplay() {
|
|
845
845
|
return (this.hasErrors() &&
|
|
846
846
|
(!this.disabled() || this.showErrorWhenDisabled()));
|