@breadstone/mosaik-elements-angular 0.0.199 → 0.0.201
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,37 @@ class SignalFormValidator {
|
|
|
60614
60614
|
*/
|
|
60615
60615
|
validate(form, hooks) {
|
|
60616
60616
|
const issues = [];
|
|
60617
|
-
//
|
|
60618
|
-
this
|
|
60619
|
-
|
|
60620
|
-
|
|
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)) {
|
|
60621
|
+
const state = field();
|
|
60622
|
+
state.markAsTouched();
|
|
60623
|
+
const errs = state.errors();
|
|
60621
60624
|
if (errs.length > 0) {
|
|
60622
60625
|
const issue = {
|
|
60623
|
-
path,
|
|
60626
|
+
path: key,
|
|
60624
60627
|
errors: errs,
|
|
60625
|
-
fieldRef:
|
|
60628
|
+
fieldRef: state
|
|
60626
60629
|
};
|
|
60627
60630
|
hooks?.onEachError?.(issue);
|
|
60628
60631
|
issues.push(issue);
|
|
60629
60632
|
}
|
|
60630
|
-
}
|
|
60633
|
+
}
|
|
60634
|
+
// // Traverse and collect individual issues
|
|
60635
|
+
// this.traverse(form, '', (path, field) => {
|
|
60636
|
+
// field.markAsTouched();
|
|
60637
|
+
// const errs = field.errors();
|
|
60638
|
+
// if (errs.length > 0) {
|
|
60639
|
+
// const issue: ISignalValidationIssue = {
|
|
60640
|
+
// path,
|
|
60641
|
+
// errors: errs,
|
|
60642
|
+
// fieldRef: field
|
|
60643
|
+
// };
|
|
60644
|
+
// hooks?.onEachError?.(issue);
|
|
60645
|
+
// issues.push(issue);
|
|
60646
|
+
// }
|
|
60647
|
+
// });
|
|
60631
60648
|
// Trigger final hooks
|
|
60632
60649
|
if (issues.length === 0) {
|
|
60633
60650
|
hooks?.onSuccess?.(form().value());
|
|
@@ -60649,12 +60666,13 @@ class SignalFormValidator {
|
|
|
60649
60666
|
// we have to check this in the future again.
|
|
60650
60667
|
const issues = [];
|
|
60651
60668
|
for (const [key, field] of Object.entries(form)) {
|
|
60652
|
-
const
|
|
60669
|
+
const state = field();
|
|
60670
|
+
const errs = state.errors();
|
|
60653
60671
|
if (errs.length > 0) {
|
|
60654
60672
|
issues.push({
|
|
60655
60673
|
path: key,
|
|
60656
60674
|
errors: errs,
|
|
60657
|
-
fieldRef:
|
|
60675
|
+
fieldRef: state
|
|
60658
60676
|
});
|
|
60659
60677
|
}
|
|
60660
60678
|
}
|
|
@@ -60744,8 +60762,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImpor
|
|
|
60744
60762
|
*/
|
|
60745
60763
|
class SignalValidationBuilder {
|
|
60746
60764
|
// #region Fields
|
|
60747
|
-
|
|
60748
|
-
|
|
60765
|
+
_validator;
|
|
60766
|
+
_form;
|
|
60749
60767
|
_onEachError;
|
|
60750
60768
|
_onErrors;
|
|
60751
60769
|
_onSuccess;
|
|
@@ -60758,8 +60776,8 @@ class SignalValidationBuilder {
|
|
|
60758
60776
|
* @param form The root FieldTree object representing the form.
|
|
60759
60777
|
*/
|
|
60760
60778
|
constructor(validator, form) {
|
|
60761
|
-
this.
|
|
60762
|
-
this.
|
|
60779
|
+
this._validator = validator;
|
|
60780
|
+
this._form = form;
|
|
60763
60781
|
}
|
|
60764
60782
|
// #endregion
|
|
60765
60783
|
// #region Methods
|
|
@@ -60799,7 +60817,7 @@ class SignalValidationBuilder {
|
|
|
60799
60817
|
* @public
|
|
60800
60818
|
*/
|
|
60801
60819
|
run() {
|
|
60802
|
-
this.
|
|
60820
|
+
this._validator.validate(this._form, {
|
|
60803
60821
|
onEachError: this._onEachError,
|
|
60804
60822
|
onErrors: this._onErrors,
|
|
60805
60823
|
onSuccess: this._onSuccess
|