@signaltree/ng-forms 9.0.0 → 9.1.0
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/README.md +9 -9
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Architecture: form() + formBridge()
|
|
8
8
|
|
|
9
|
-
SignalTree
|
|
9
|
+
SignalTree provides a layered forms architecture:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
@signaltree/core @signaltree/ng-forms
|
|
@@ -212,14 +212,14 @@ The returned `FormTree` exposes:
|
|
|
212
212
|
```typescript
|
|
213
213
|
// ✅ Simple case: types inferred automatically
|
|
214
214
|
const form = createFormTree({
|
|
215
|
-
name: '',
|
|
216
|
-
age: 0,
|
|
217
|
-
active: false,
|
|
215
|
+
name: '', // string
|
|
216
|
+
age: 0, // number
|
|
217
|
+
active: false, // boolean
|
|
218
218
|
});
|
|
219
219
|
|
|
220
|
-
form.$.name();
|
|
221
|
-
form.$.age();
|
|
222
|
-
form.form.controls.name;
|
|
220
|
+
form.$.name(); // string
|
|
221
|
+
form.$.age(); // number
|
|
222
|
+
form.form.controls.name; // FormControl<string>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
### Union Types Need Assertions
|
|
@@ -229,7 +229,7 @@ When a field can be one of several specific values, TypeScript widens the inferr
|
|
|
229
229
|
```typescript
|
|
230
230
|
// ❌ Without assertion: resolution is inferred as string
|
|
231
231
|
const form = createFormTree({
|
|
232
|
-
resolution: 'PENDING',
|
|
232
|
+
resolution: 'PENDING', // Inferred as string, not the union
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
// ✅ With assertion: resolution is the exact union type
|
|
@@ -490,7 +490,7 @@ tree.getAngularForm('profile')?.formGroup; // FormGroup
|
|
|
490
490
|
|
|
491
491
|
### Key differences
|
|
492
492
|
|
|
493
|
-
| Aspect | createFormTree() | form() + formBridge()
|
|
493
|
+
| Aspect | createFormTree() | form() + formBridge() |
|
|
494
494
|
| -------------------- | ----------------------- | ---------------------------- |
|
|
495
495
|
| **Standalone** | Always needs Angular | form() works without Angular |
|
|
496
496
|
| **Tree integration** | Separate from app state | Lives in your main tree |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaltree/ng-forms",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Angular forms as reactive JSON. Seamless SignalTree integration with FormTree creation, validators, and form state tracking.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@angular/core": "^20.0.0",
|
|
25
25
|
"@angular/forms": "^20.0.0",
|
|
26
|
-
"@signaltree/core": "
|
|
26
|
+
"@signaltree/core": "workspace:*",
|
|
27
27
|
"rxjs": "^7.0.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependenciesMeta": {},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@signaltree/core": "
|
|
32
|
-
"@signaltree/shared": "
|
|
31
|
+
"@signaltree/core": "workspace:*",
|
|
32
|
+
"@signaltree/shared": "workspace:*",
|
|
33
33
|
"jest-preset-angular": "^15.0.3"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|