@ng-modular-forms/core 0.8.0 → 0.8.1
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 +24 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,13 +52,28 @@ npm install @ng-modular-forms/core
|
|
|
52
52
|
npm install @ng-modular-forms/material
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
+
## Styles Setup
|
|
56
|
+
Add the corresponding styles to your application's angular.json file under the styles array. Only include the files for the packages you are actively using:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
"styles": [
|
|
60
|
+
"src/styles.css",
|
|
61
|
+
|
|
62
|
+
// Required ONLY if using @ng-modular-forms/core native controls
|
|
63
|
+
"node_modules/@ng-modular-forms/core/styles/form-controls.css",
|
|
64
|
+
|
|
65
|
+
// Required ONLY if using @ng-modular-forms/material
|
|
66
|
+
"node_modules/@ng-modular-forms/material/styles/form-controls.css"
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
|
|
55
70
|
## Core Primitives
|
|
56
71
|
|
|
57
72
|
### FormOrchestrator
|
|
58
73
|
|
|
59
74
|
Coordinates form structure and lifecycle.
|
|
60
75
|
|
|
61
|
-
```
|
|
76
|
+
```typescript
|
|
62
77
|
import {
|
|
63
78
|
FormOrchestrator, FormHydrator, FormSerializer
|
|
64
79
|
} from '@ng-modular-forms/core';
|
|
@@ -114,7 +129,7 @@ export class ExampleComponent extends FormOrchestrator {
|
|
|
114
129
|
```
|
|
115
130
|
|
|
116
131
|
Optional component for Section A to house the form controls.
|
|
117
|
-
```
|
|
132
|
+
```typescript
|
|
118
133
|
import { InputTextComponent } from '@ng-modular-forms/core';
|
|
119
134
|
|
|
120
135
|
@Component({
|
|
@@ -136,7 +151,7 @@ export class SectionAComponent {
|
|
|
136
151
|
|
|
137
152
|
Encapsulates cross-field reactive behavior. Keeps UI logic out of the component.
|
|
138
153
|
|
|
139
|
-
```
|
|
154
|
+
```typescript
|
|
140
155
|
import { Subscription } from 'rxjs';
|
|
141
156
|
import { FormHandlerBase } from '@ng-modular-forms/core';
|
|
142
157
|
|
|
@@ -177,7 +192,7 @@ export class SectionAHandler extends FormHandlerBase<Controls> {
|
|
|
177
192
|
|
|
178
193
|
Handles transformations between API and form. `FormHydrator` and `FormSerializer` will call these automatically.
|
|
179
194
|
|
|
180
|
-
```
|
|
195
|
+
```typescript
|
|
181
196
|
import { FormMapperBase, getControlValue } from '@ng-modular-forms/core';
|
|
182
197
|
|
|
183
198
|
export class SectionAMapper extends FormMapperBase<
|
|
@@ -240,7 +255,7 @@ This helps centralize API ↔ form transformations and reduces repetitive patchi
|
|
|
240
255
|
Patches form controls from a model.
|
|
241
256
|
|
|
242
257
|
Standalone usage:
|
|
243
|
-
```
|
|
258
|
+
```typescript
|
|
244
259
|
import { FormHydrator } from '@ng-modular-forms/core';
|
|
245
260
|
|
|
246
261
|
@Component({...})
|
|
@@ -258,7 +273,7 @@ export class ExampleComponent {
|
|
|
258
273
|
```
|
|
259
274
|
|
|
260
275
|
FormOrchestrator usage:
|
|
261
|
-
```
|
|
276
|
+
```typescript
|
|
262
277
|
import {
|
|
263
278
|
FormOrchestrator, FormHydrator, FormSerializer
|
|
264
279
|
} from '@ng-modular-forms/core';
|
|
@@ -288,7 +303,7 @@ export class ExampleComponent extends FormOrchestrator {
|
|
|
288
303
|
Serializes form controls to a model.
|
|
289
304
|
|
|
290
305
|
Standalone usage:
|
|
291
|
-
```
|
|
306
|
+
```typescript
|
|
292
307
|
import { FormSerializer } from '@ng-modular-forms/core';
|
|
293
308
|
|
|
294
309
|
@Component({...})
|
|
@@ -311,7 +326,7 @@ export class ExampleComponent {
|
|
|
311
326
|
```
|
|
312
327
|
|
|
313
328
|
FormOrchestrator usage:
|
|
314
|
-
```
|
|
329
|
+
```typescript
|
|
315
330
|
import {
|
|
316
331
|
FormOrchestrator, FormHydrator, FormSerializer
|
|
317
332
|
} from '@ng-modular-forms/core';
|
|
@@ -341,7 +356,7 @@ export class ExampleComponent extends FormOrchestrator {
|
|
|
341
356
|
|
|
342
357
|
## Input Component Example (No Orchestration)
|
|
343
358
|
|
|
344
|
-
```
|
|
359
|
+
```typescript
|
|
345
360
|
import {
|
|
346
361
|
InputTextComponent, InputCurrencyComponent
|
|
347
362
|
} from '@ng-modular-forms/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-modular-forms/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Composable Angular reactive form primitives, custom controls, and Material-compatible components for building enterprise-ready, complex typed forms.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|