@breadstone/mosaik-elements-angular 0.0.198 → 0.0.200
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 0.0.201 (2025-12-05)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for mosaik-elements-angular to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.200 (2025-12-05)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **SignalFormValidator:** update collectErrors to handle flat structures and improve readability ([25857d24b3](https://github.com/RueDeRennes/mosaik/commit/25857d24b3))
|
|
10
|
+
|
|
11
|
+
## 0.0.199 (2025-12-05)
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- **SignalFormValidator:** update collectErrors implementation for flat structures ([1a51b459a5](https://github.com/RueDeRennes/mosaik/commit/1a51b459a5))
|
|
16
|
+
- **package:** add missing newline at end of file ([e7bbe4e7c1](https://github.com/RueDeRennes/mosaik/commit/e7bbe4e7c1))
|
|
17
|
+
|
|
1
18
|
## 0.0.198 (2025-12-05)
|
|
2
19
|
|
|
3
20
|
This was a version bump only for mosaik-elements-angular to align it with other projects, there were no code changes.
|
|
@@ -60614,20 +60614,36 @@ class SignalFormValidator {
|
|
|
60614
60614
|
*/
|
|
60615
60615
|
validate(form, hooks) {
|
|
60616
60616
|
const issues = [];
|
|
60617
|
-
//
|
|
60618
|
-
this
|
|
60617
|
+
// this is the first version of this implementation,
|
|
60618
|
+
// what we know is this doesn't work with nested structures.
|
|
60619
|
+
// we have to check this in the future again.
|
|
60620
|
+
for (const [key, field] of Object.entries(form)) {
|
|
60619
60621
|
field.markAsTouched();
|
|
60620
60622
|
const errs = field.errors();
|
|
60621
60623
|
if (errs.length > 0) {
|
|
60622
60624
|
const issue = {
|
|
60623
|
-
path,
|
|
60625
|
+
path: key,
|
|
60624
60626
|
errors: errs,
|
|
60625
60627
|
fieldRef: field
|
|
60626
60628
|
};
|
|
60627
60629
|
hooks?.onEachError?.(issue);
|
|
60628
60630
|
issues.push(issue);
|
|
60629
60631
|
}
|
|
60630
|
-
}
|
|
60632
|
+
}
|
|
60633
|
+
// // Traverse and collect individual issues
|
|
60634
|
+
// this.traverse(form, '', (path, field) => {
|
|
60635
|
+
// field.markAsTouched();
|
|
60636
|
+
// const errs = field.errors();
|
|
60637
|
+
// if (errs.length > 0) {
|
|
60638
|
+
// const issue: ISignalValidationIssue = {
|
|
60639
|
+
// path,
|
|
60640
|
+
// errors: errs,
|
|
60641
|
+
// fieldRef: field
|
|
60642
|
+
// };
|
|
60643
|
+
// hooks?.onEachError?.(issue);
|
|
60644
|
+
// issues.push(issue);
|
|
60645
|
+
// }
|
|
60646
|
+
// });
|
|
60631
60647
|
// Trigger final hooks
|
|
60632
60648
|
if (issues.length === 0) {
|
|
60633
60649
|
hooks?.onSuccess?.(form().value());
|
|
@@ -60644,18 +60660,33 @@ class SignalFormValidator {
|
|
|
60644
60660
|
* @returns An array of validation issues.
|
|
60645
60661
|
*/
|
|
60646
60662
|
collectErrors(form) {
|
|
60663
|
+
// this is the first version of this implementation,
|
|
60664
|
+
// what we know is this doesn't work with nested structures.
|
|
60665
|
+
// we have to check this in the future again.
|
|
60647
60666
|
const issues = [];
|
|
60648
|
-
|
|
60667
|
+
for (const [key, field] of Object.entries(form)) {
|
|
60649
60668
|
const errs = field.errors();
|
|
60650
60669
|
if (errs.length > 0) {
|
|
60651
60670
|
issues.push({
|
|
60652
|
-
path,
|
|
60671
|
+
path: key,
|
|
60653
60672
|
errors: errs,
|
|
60654
60673
|
fieldRef: field
|
|
60655
60674
|
});
|
|
60656
60675
|
}
|
|
60657
|
-
}
|
|
60676
|
+
}
|
|
60658
60677
|
return issues;
|
|
60678
|
+
// const issues: Array<ISignalValidationIssue> = [];
|
|
60679
|
+
// this.traverse(form, '', (path, field) => {
|
|
60680
|
+
// const errs = field.errors();
|
|
60681
|
+
// if (errs.length > 0) {
|
|
60682
|
+
// issues.push({
|
|
60683
|
+
// path,
|
|
60684
|
+
// errors: errs,
|
|
60685
|
+
// fieldRef: field
|
|
60686
|
+
// });
|
|
60687
|
+
// }
|
|
60688
|
+
// // });
|
|
60689
|
+
// return issues;
|
|
60659
60690
|
}
|
|
60660
60691
|
/**
|
|
60661
60692
|
* Checks whether the form is currently valid (i.e., no issues found).
|
|
@@ -60729,8 +60760,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
60729
60760
|
*/
|
|
60730
60761
|
class SignalValidationBuilder {
|
|
60731
60762
|
// #region Fields
|
|
60732
|
-
|
|
60733
|
-
|
|
60763
|
+
_validator;
|
|
60764
|
+
_form;
|
|
60734
60765
|
_onEachError;
|
|
60735
60766
|
_onErrors;
|
|
60736
60767
|
_onSuccess;
|
|
@@ -60743,8 +60774,8 @@ class SignalValidationBuilder {
|
|
|
60743
60774
|
* @param form The root FieldTree object representing the form.
|
|
60744
60775
|
*/
|
|
60745
60776
|
constructor(validator, form) {
|
|
60746
|
-
this.
|
|
60747
|
-
this.
|
|
60777
|
+
this._validator = validator;
|
|
60778
|
+
this._form = form;
|
|
60748
60779
|
}
|
|
60749
60780
|
// #endregion
|
|
60750
60781
|
// #region Methods
|
|
@@ -60784,7 +60815,7 @@ class SignalValidationBuilder {
|
|
|
60784
60815
|
* @public
|
|
60785
60816
|
*/
|
|
60786
60817
|
run() {
|
|
60787
|
-
this.
|
|
60818
|
+
this._validator.validate(this._form, {
|
|
60788
60819
|
onEachError: this._onEachError,
|
|
60789
60820
|
onErrors: this._onErrors,
|
|
60790
60821
|
onSuccess: this._onSuccess
|