@ng-modular-forms/core 0.7.9 → 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 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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
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
- ```ts
359
+ ```typescript
345
360
  import {
346
361
  InputTextComponent, InputCurrencyComponent
347
362
  } from '@ng-modular-forms/core';
@@ -369,12 +384,13 @@ All components share a consistent API and are interchangeable between Native and
369
384
  | Input Type | Native Selector | Material Selector |
370
385
  |-----------------|----------------------|-----------------------|
371
386
  | Text / Password | `nmf-text` | `nmf-mat-text` |
387
+ | Lookup | `nmf-lookup` | `nmf-mat-lookup` |
372
388
  | Number | `nmf-number` | `nmf-mat-number` |
373
389
  | Currency | `nmf-currency` | `nmf-mat-currency` |
374
390
  | Date | `nmf-datepicker` | `nmf-mat-datepicker` |
375
- | Time | `nmf-timepicker` | `nmf-mat-timepicker` |
376
391
  | Select | `nmf-select` | `nmf-mat-select` |
377
392
  | Textarea | `nmf-textarea` | `nmf-mat-textarea` |
393
+ | Time | `nmf-timepicker` | `nmf-mat-timepicker` |
378
394
 
379
395
  ### Shared Features
380
396