@breadstone/mosaik-elements-angular 0.0.199 → 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,13 @@
|
|
|
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
|
+
|
|
1
11
|
## 0.0.199 (2025-12-05)
|
|
2
12
|
|
|
3
13
|
### 🩹 Fixes
|
|
@@ -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());
|
|
@@ -60744,8 +60760,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
60744
60760
|
*/
|
|
60745
60761
|
class SignalValidationBuilder {
|
|
60746
60762
|
// #region Fields
|
|
60747
|
-
|
|
60748
|
-
|
|
60763
|
+
_validator;
|
|
60764
|
+
_form;
|
|
60749
60765
|
_onEachError;
|
|
60750
60766
|
_onErrors;
|
|
60751
60767
|
_onSuccess;
|
|
@@ -60758,8 +60774,8 @@ class SignalValidationBuilder {
|
|
|
60758
60774
|
* @param form The root FieldTree object representing the form.
|
|
60759
60775
|
*/
|
|
60760
60776
|
constructor(validator, form) {
|
|
60761
|
-
this.
|
|
60762
|
-
this.
|
|
60777
|
+
this._validator = validator;
|
|
60778
|
+
this._form = form;
|
|
60763
60779
|
}
|
|
60764
60780
|
// #endregion
|
|
60765
60781
|
// #region Methods
|
|
@@ -60799,7 +60815,7 @@ class SignalValidationBuilder {
|
|
|
60799
60815
|
* @public
|
|
60800
60816
|
*/
|
|
60801
60817
|
run() {
|
|
60802
|
-
this.
|
|
60818
|
+
this._validator.validate(this._form, {
|
|
60803
60819
|
onEachError: this._onEachError,
|
|
60804
60820
|
onErrors: this._onErrors,
|
|
60805
60821
|
onSuccess: this._onSuccess
|