@ng-simplicity/forms-core 1.1.2 → 1.1.3
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 +13 -1
- package/fesm2022/ng-simplicity-forms-core.mjs +68 -15
- package/fesm2022/ng-simplicity-forms-core.mjs.map +1 -1
- package/index.d.ts +69 -46
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -9,12 +9,13 @@ The core engine package for **NG-Simplicity Forms**. This package manages form s
|
|
|
9
9
|
This core package is extended by styling integration packages that provide prebuilt themed form components:
|
|
10
10
|
- **[@ng-simplicity/forms-bootstrap](../forms-bootstrap/README.md)**: Dynamic forms pre-styled with Bootstrap form fields and layouts.
|
|
11
11
|
- **[@ng-simplicity/forms-material](../forms-material/README.md)**: Dynamic forms pre-styled with Angular Material inputs and controls.
|
|
12
|
+
- **[@ng-simplicity/forms-tailwind](../forms-tailwind/README.md)**: Dynamic forms styled with Tailwind CSS utility classes, with every class overridable through `provideNgsFormsTailwindClasses()`.
|
|
12
13
|
|
|
13
14
|
## Compatibility
|
|
14
15
|
|
|
15
16
|
| Package | Package version | Angular support |
|
|
16
17
|
|---|---:|---|
|
|
17
|
-
| `@ng-simplicity/forms-core` | `1.1.
|
|
18
|
+
| `@ng-simplicity/forms-core` | `1.1.3` | `17.x`–`22.x` |
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
@@ -26,6 +27,16 @@ Add this package to your Angular application:
|
|
|
26
27
|
npm install @ng-simplicity/forms-core
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
To render prebuilt inputs, add one styling package and register its components:
|
|
31
|
+
|
|
32
|
+
| Styling | Install | Register |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Bootstrap 5 | `npm install @ng-simplicity/forms-bootstrap bootstrap` | `NgsFormsBootstrapModule.registerAllBootStrapComponents(registry)` |
|
|
35
|
+
| Angular Material | `npm install @ng-simplicity/forms-material` (after `ng add @angular/material`) | `NgsFormsMaterialModule.registerAllMaterialComponents(registry)` |
|
|
36
|
+
| Tailwind CSS | `npm install @ng-simplicity/forms-tailwind`, then add `@source '../node_modules/@ng-simplicity/forms-tailwind';` to your Tailwind stylesheet | `NgsFormsTailwindModule.registerAllTailwindComponents(registry)` |
|
|
37
|
+
|
|
38
|
+
Each `registerAll…` helper also registers the core structural components, so it is the only registration call you need. See each package's README for full setup.
|
|
39
|
+
|
|
29
40
|
---
|
|
30
41
|
|
|
31
42
|
## Architecture Overview
|
|
@@ -521,6 +532,7 @@ Ensure your custom configuration type extends one of these core interfaces for f
|
|
|
521
532
|
Fully functional example applications demonstrating the form engine functionality are located in the [`apps/`](../../apps) folder of this monorepo:
|
|
522
533
|
- **`forms-bootstrap-demo`**: Integrates and showcases the `@ng-simplicity/forms-bootstrap` package.
|
|
523
534
|
- **`forms-material-demo`**: Integrates and showcases the `@ng-simplicity/forms-material` package.
|
|
535
|
+
- **`forms-tailwind-demo`**: Integrates and showcases the `@ng-simplicity/forms-tailwind` package.
|
|
524
536
|
|
|
525
537
|
---
|
|
526
538
|
|
|
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { Directive, InjectionToken, inject, Injectable, ChangeDetectorRef, Injector, ViewContainerRef, Input, computed, ChangeDetectionStrategy, Component, ElementRef, Sanitizer, SecurityContext, NgModule } from '@angular/core';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
5
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { UntypedFormGroup, FormControl, UntypedFormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { UntypedFormGroup, FormControl, FormGroup, FormArray, UntypedFormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
9
9
|
/** Base class that ties RxJS subscriptions to the component's lifetime. */
|
|
@@ -74,8 +74,11 @@ function ngsDefaults(target, ...sources) {
|
|
|
74
74
|
class NgsFormsBaseClassFormComponent extends NgsSubscriber {
|
|
75
75
|
/** Registry key the component is registered under. */
|
|
76
76
|
static key;
|
|
77
|
-
/**
|
|
78
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Element id for this component, handy for `id` and `for` attributes. The config's `id` when it sets one,
|
|
79
|
+
* otherwise a generated unique id.
|
|
80
|
+
*/
|
|
81
|
+
id;
|
|
79
82
|
/** The item's configuration. */
|
|
80
83
|
config;
|
|
81
84
|
/** The full form item: `uuid`, `type` and `config`. */
|
|
@@ -84,6 +87,7 @@ class NgsFormsBaseClassFormComponent extends NgsSubscriber {
|
|
|
84
87
|
super();
|
|
85
88
|
this.itemData = inject(NGS_FORMS_ITEM_DATA);
|
|
86
89
|
this.config = this.itemData.config;
|
|
90
|
+
this.id = this.config.id || v4();
|
|
87
91
|
}
|
|
88
92
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsBaseClassFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
89
93
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.19", type: NgsFormsBaseClassFormComponent, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
@@ -267,6 +271,9 @@ class NgsFormsInternalService {
|
|
|
267
271
|
return this.formGroup$.value.valid;
|
|
268
272
|
}
|
|
269
273
|
setFormData(formConfig) {
|
|
274
|
+
const state = { ...(formConfig.initialState ?? {}) };
|
|
275
|
+
state['global'] = { ...(formConfig.globalState ?? {}) };
|
|
276
|
+
this.state.next(state);
|
|
270
277
|
this.formGroup$.next(new UntypedFormGroup({}));
|
|
271
278
|
this.formConfig$.next(formConfig);
|
|
272
279
|
this.isSubmitted$.next(false);
|
|
@@ -277,13 +284,24 @@ class NgsFormsInternalService {
|
|
|
277
284
|
this.state.value[key] = updated;
|
|
278
285
|
this.state.next(this.state.value);
|
|
279
286
|
}
|
|
287
|
+
/** Sets a component's state from its config's `initialState`, unless state for `uuid` already exists. */
|
|
288
|
+
seedComponentState(uuid, initialState) {
|
|
289
|
+
if (!uuid || !initialState || this.state.value[uuid])
|
|
290
|
+
return;
|
|
291
|
+
this.mergeState(uuid, initialState);
|
|
292
|
+
}
|
|
280
293
|
updateGlobalState(state) {
|
|
281
294
|
this.mergeState('global', state);
|
|
282
295
|
}
|
|
283
296
|
updateComponentState(componentKey, state) {
|
|
284
297
|
this.mergeState(componentKey, state);
|
|
285
298
|
}
|
|
286
|
-
|
|
299
|
+
/**
|
|
300
|
+
* Merged state for one component: its own (by `uuid`), then by `name`, then global.
|
|
301
|
+
* `initialState` seeds the component's own state unless state for `uuid` already exists.
|
|
302
|
+
*/
|
|
303
|
+
subscribeToState(uuid, name, initialState) {
|
|
304
|
+
this.seedComponentState(uuid, initialState);
|
|
287
305
|
let last = '';
|
|
288
306
|
return this.state.pipe(map((allState) => {
|
|
289
307
|
const stateByUuid = allState[uuid] || {};
|
|
@@ -305,8 +323,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImpo
|
|
|
305
323
|
}] });
|
|
306
324
|
|
|
307
325
|
/**
|
|
308
|
-
* Base class for items that own a form control. Creates the control
|
|
309
|
-
*
|
|
326
|
+
* Base class for items that own a form control. Creates the control (seeded with `value` when the config has one),
|
|
327
|
+
* applies `validators` / `validators$` and `disabled` / `disabled$`, registers it with the parent group under
|
|
328
|
+
* `config.name` and keeps `errorMessage` up to date.
|
|
310
329
|
*/
|
|
311
330
|
class NgsFormsFormItemWithVisibleAndValidatorsBase extends NgsFormsBaseClassFormComponent {
|
|
312
331
|
/** The item's form control. Bind it with `[formControl]`. */
|
|
@@ -321,14 +340,16 @@ class NgsFormsFormItemWithVisibleAndValidatorsBase extends NgsFormsBaseClassForm
|
|
|
321
340
|
changeDetectorRef = inject(ChangeDetectorRef);
|
|
322
341
|
/** Whether the form has been marked as submitted with `NgsFormsService.setIsSubmitted()`. */
|
|
323
342
|
submitted = toSignal(this.privateService.isSubmitted$, { initialValue: false });
|
|
343
|
+
/** The latest value of `disabled` / `disabled$`, or `undefined` when the config sets neither. */
|
|
344
|
+
disabledFromConfig;
|
|
324
345
|
ngOnInit() {
|
|
325
346
|
if (!this.control) {
|
|
326
|
-
|
|
347
|
+
const initialValue = this.config.value;
|
|
348
|
+
this.control = new FormControl(initialValue, { validators: [] });
|
|
327
349
|
}
|
|
328
|
-
//this.bindVisible();
|
|
329
350
|
this.bindValidators();
|
|
330
|
-
//this.bindControlValidityChange();
|
|
331
351
|
this.formAddRemoveFns.add(this.control, this.config.name);
|
|
352
|
+
this.bindDisabled();
|
|
332
353
|
// Listen to changes and update error message dynamically
|
|
333
354
|
this.subscribe(merge(this.control.valueChanges, this.control.statusChanges, this.privateService.isSubmitted$), () => {
|
|
334
355
|
this.updateErrorMessage();
|
|
@@ -369,6 +390,34 @@ class NgsFormsFormItemWithVisibleAndValidatorsBase extends NgsFormsBaseClassForm
|
|
|
369
390
|
this.subscribe(this.config.validators$, (validators) => this.control.setValidators(validators));
|
|
370
391
|
}
|
|
371
392
|
}
|
|
393
|
+
bindDisabled() {
|
|
394
|
+
const disabled$ = this.config.disabled$ ?? (this.config.disabled !== undefined ? of(this.config.disabled) : undefined);
|
|
395
|
+
if (!disabled$)
|
|
396
|
+
return;
|
|
397
|
+
const control = this.control;
|
|
398
|
+
this.subscribe(disabled$, (disabled) => {
|
|
399
|
+
this.disabledFromConfig = !!disabled;
|
|
400
|
+
this.applyDisabled(control);
|
|
401
|
+
});
|
|
402
|
+
// Child controls are added to groups and arrays after the container has been disabled, and adding an enabled
|
|
403
|
+
// child re-enables its parent. Re-apply the configured state whenever a container's status changes.
|
|
404
|
+
if (control instanceof FormGroup || control instanceof FormArray) {
|
|
405
|
+
this.subscribe(control.statusChanges, () => {
|
|
406
|
+
if (this.disabledFromConfig && control.enabled) {
|
|
407
|
+
control.disable();
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
applyDisabled(control) {
|
|
413
|
+
if (this.disabledFromConfig && !control.disabled) {
|
|
414
|
+
control.disable();
|
|
415
|
+
}
|
|
416
|
+
else if (!this.disabledFromConfig && control.disabled) {
|
|
417
|
+
control.enable();
|
|
418
|
+
}
|
|
419
|
+
this.changeDetectorRef.markForCheck();
|
|
420
|
+
}
|
|
372
421
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsFormItemWithVisibleAndValidatorsBase, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
373
422
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.19", type: NgsFormsFormItemWithVisibleAndValidatorsBase, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
374
423
|
}
|
|
@@ -387,13 +436,15 @@ class NgsFormsBaseClassFormInputComponent extends NgsFormsFormItemWithVisibleAnd
|
|
|
387
436
|
myFormService = inject(NgsFormsService);
|
|
388
437
|
internalService = inject(NgsFormsInternalService);
|
|
389
438
|
/** Merged state for this component: its own state, then state by name, then global state. */
|
|
390
|
-
commonState = toSignal(this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name), { initialValue: {} });
|
|
439
|
+
commonState = toSignal(this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name, this.config.initialState), { initialValue: {} });
|
|
391
440
|
/**
|
|
392
|
-
* Switches between input and summary display.
|
|
393
|
-
*
|
|
394
|
-
* @notImplemented
|
|
441
|
+
* Switches this component between `input` and `summary` display by updating its own state.
|
|
442
|
+
* With no argument it flips the current mode.
|
|
395
443
|
*/
|
|
396
444
|
toggleDisplayMode(setTo) {
|
|
445
|
+
const current = this.commonState().displayMode ?? 'input';
|
|
446
|
+
const displayMode = setTo ?? (current === 'summary' ? 'input' : 'summary');
|
|
447
|
+
this.internalService.updateComponentState(this.itemData.uuid || this.config.name, { displayMode });
|
|
397
448
|
}
|
|
398
449
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: NgsFormsBaseClassFormInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
399
450
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.19", type: NgsFormsBaseClassFormInputComponent, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
@@ -452,11 +503,13 @@ class NgsFormItemController extends NgsSubscriber {
|
|
|
452
503
|
super.ngOnDestroy();
|
|
453
504
|
}
|
|
454
505
|
bindVisibility() {
|
|
455
|
-
|
|
506
|
+
const config = this.itemData.config;
|
|
507
|
+
const visible$ = config.visible$ ?? (config.visible !== undefined ? of(config.visible) : undefined);
|
|
508
|
+
if (!visible$) {
|
|
456
509
|
Promise.resolve().then(() => this.create());
|
|
457
510
|
return;
|
|
458
511
|
}
|
|
459
|
-
this.subscribe(
|
|
512
|
+
this.subscribe(visible$, (visible) => {
|
|
460
513
|
if (this.lastVisible === visible)
|
|
461
514
|
return;
|
|
462
515
|
this.lastVisible = visible;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n/** Base class that ties RxJS subscriptions to the component's lifetime. */\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n /** Subscribes to `subscribeTo` until the component is destroyed. */\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\n/** Injection token for the `NgsFormsFormItem` a component is rendering. */\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\n/**\n * @internal\n */\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\n/** Injection token for the row index when a component is rendered inside a form array list. */\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\n/**\n * @internal\n */\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\n/**\n * @internal\n */\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\n/**\n * Returns a copy of `target` with any `undefined` properties filled in from `source`. A dependency free\n * alternative to lodash `defaults`, handy for applying default config values in custom components.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n/**\n * Root base class for every form item component. Reads the item's configuration from `NGS_FORMS_ITEM_DATA`.\n *\n * @remarks Extend it for components that do not own a form control, such as static content or buttons. Declare a\n * `static key` and a `static create(config)` factory so the component can be registered and used in configs.\n */\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n /** Registry key the component is registered under. */\n static key: string;\n /** Unique id for this component instance, handy for `id` and `for` attributes. */\n id = uuidv4();\n /** The item's configuration. */\n protected config: T;\n /** The full form item: `uuid`, `type` and `config`. */\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n/**\n * Maps registry keys (the `type` of an `NgsFormsFormItem`) to the Angular components that render them.\n *\n * @remarks The service is provided in the `platform` injector, so there is one registry per page. Registering a\n * key again replaces the previous component, which is how a theme package or your own component can override a\n * built-in one. Register components before the form renders, typically in the constructor of the component that\n * hosts `<ngs-form>`.\n * @example\n * ```ts\n * constructor(registry: NgsFormsComponentRegistryService) {\n * NgsFormsBootstrapModule.registerAllBootStrapComponents(registry);\n * registry.register(MyRatingComponent.key, MyRatingComponent);\n * }\n * ```\n */\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n /** Returns the component registered for `key`, or `undefined` when nothing is registered. */\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n /** Registers `component` under `key`, replacing any component already registered for it. */\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * The public API of a form. Provide it on the component that hosts `<ngs-form>` so each form gets its own instance.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'app-profile',\n * imports: [NgsFormComponent],\n * providers: [NgsFormsService],\n * template: `<ngs-form />`,\n * })\n * export class ProfileComponent {\n * private readonly forms = inject(NgsFormsService);\n * readonly value = toSignal(this.forms.formValue$);\n * }\n * ```\n */\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n /**\n * @internal\n */\n attempt = 0;\n /**\n * Emits the root form group's value every time it changes. Combine with `toSignal()` to read it in a template.\n *\n * @remarks The value is keyed by the root group's `name`, for example `{ profile: { firstName: 'Ada' } }`.\n */\n formValue$ = new BehaviorSubject<any>({});\n /** The latest value emitted by `formValue$`. */\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n /** `true` once the user has changed any control in the form. */\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n /** `true` when every rendered control passes its validators. Hidden items are not validated. */\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n /** `true` once `<ngs-form>` has connected to this service. */\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n /**\n * Renders a form from `formConfig`, replacing any form that is already shown and resetting the submitted state.\n *\n * @remarks It is safe to call before `<ngs-form>` has initialised (for example in `ngOnInit`): the call is retried\n * every 25 ms for about half a second until the form component is available.\n */\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n /**\n * @internal\n */\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n /**\n * Marks the form as submitted (or not). While submitted, every invalid control shows its error message even if\n * the user never touched it.\n */\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n /**\n * Merges `state` into the state of one component, identified by its `uuid` or control `name`.\n * Components read the merged result through `commonState`.\n */\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n /** Merges `state` into the state shared by every component in the form. */\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n /**\n * Patches values into the form, using the same shape as `formValue$` (including the root group name).\n *\n * @remarks Only controls that are currently rendered receive values. Patch again after a conditional item becomes\n * visible, and make sure a form array has enough rows (see `initialItemCount`) before patching array values.\n */\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n/**\n * Per form state holder that connects `<ngs-form>`, its items and `NgsFormsService`.\n *\n * @remarks Provided by `NgsFormComponent`. Application code should use `NgsFormsService` instead; this service is\n * exported for authors of custom components and may change between minor versions.\n */\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n subscribeToState(uuid: string, name?: string) {\n let last = '';\n return this.state.pipe(\n map((allState) => {\n const stateByUuid = allState[uuid] || {};\n const stateByName = name ? (allState[name] || {}) : {};\n const globalState = allState['global'] || {};\n return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));\n }),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal, ChangeDetectorRef } from '@angular/core';\nimport { FormControl, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { merge } from 'rxjs';\n\n/**\n * Base class for items that own a form control. Creates the control, applies `validators` / `validators$`,\n * registers it with the parent group under `config.name` and keeps `errorMessage` up to date.\n */\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n /** The item's form control. Bind it with `[formControl]`. */\n control: UntypedFormControl | undefined;\n /**\n * Message for the control's first error, taken from `errorMessageMap`. Empty while the control is valid, or\n * before it is touched, dirty or submitted.\n */\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n /** Whether the form has been marked as submitted with `NgsFormsService.setIsSubmitted()`. */\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n\n ngOnInit() {\n if (!this.control) {\n this.control = new FormControl(undefined, { validators: [] });\n }\n //this.bindVisible();\n this.bindValidators();\n //this.bindControlValidityChange();\n this.formAddRemoveFns.add(this.control, this.config.name);\n\n // Listen to changes and update error message dynamically\n this.subscribe(\n merge(\n this.control.valueChanges,\n this.control.statusChanges,\n this.privateService.isSubmitted$\n ),\n () => {\n this.updateErrorMessage();\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n private updateErrorMessage() {\n if (!this.control) {\n this.errorMessage = '';\n return;\n }\n const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());\n if (!showErrors) {\n this.errorMessage = '';\n return;\n }\n const errors = this.control.errors;\n if (!errors) {\n this.errorMessage = '';\n return;\n }\n const firstErrorKey = Object.keys(errors)[0];\n const map = this.config.errorMessageMap;\n this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n /*\n private bindVisible() {\n this.subscribe(this.parentVisibility$, (isVisible) => {\n if (this.isVisible === isVisible) return;\n this.isVisible = isVisible;\n if (isVisible) {\n this.formGroup.addControl(this.config.name, this.control);\n return;\n }\n this.formGroup.removeControl(this.config.name);\n });\n }\n */\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n/**\n * Base class for input components. Adds access to the form's `NgsFormsService` and the merged component state.\n *\n * @remarks This is the class to extend when you build your own input. See the Custom components guide.\n */\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n /** The `NgsFormsService` of the form this input belongs to. */\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n /** Merged state for this component: its own state, then state by name, then global state. */\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n /**\n * Switches between input and summary display.\n *\n * @notImplemented\n */\n toggleDisplayMode(setTo: 'summary' | 'input'){\n\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n/** Base class for container items that render `config.items` without owning a form control. */\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n/**\n * Base class for inputs with options. Exposes `options` as a signal that follows `options$` when given and falls\n * back to the static `options`.\n */\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n /** The current options. */\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ChangeDetectorRef, ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number,\n private readonly changeDetectorRef?: ChangeDetectorRef\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n if (!this.itemData.config.visible$) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.subscribe(this.itemData.config.visible$, (visible: any) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.componentRef.changeDetectorRef?.detectChanges();\n this.changeDetectorRef?.markForCheck();\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n this.changeDetectorRef?.markForCheck();\n }\n}\n","import { ChangeDetectorRef, Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Structural building block that looks up a form item's component in the registry and renders it.\n *\n * @remarks Use it inside custom container components to render child items:\n * `<ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"group\"></ng-container>`.\n */\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n /** The item to render. */\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n /** Form group that the item's control is added to. */\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n /** Form array that the item's control is added to. */\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n /**\n * Index of the item inside a form array row, provided to children as `NGS_FORMS_ITEM_INDEX`.\n */\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(\n this.injector,\n this.viewContainerRef,\n this.itemData,\n addRemoveFn,\n this.index,\n this.changeDetectorRef\n );\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n/**\n * Renders the form described by the `NgsFormsFormConfig` given to the nearest `NgsFormsService`.\n *\n * @remarks Place it in the template of the component that provides `NgsFormsService`. It takes no inputs.\n * @example\n * ```html\n * <ngs-form></ngs-form>\n * ```\n */\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n /** The root item to render with the form group it belongs to (empty until a config is set). */\n readonly rendered = computed(() => {\n const group = this.formGroup();\n const root = this.formConfig()?.root;\n return group && root ? [{ group, root }] : [];\n });\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","<!-- Tracking by form group re-creates the tree whenever setFormConfig() is called again, since each call creates a new group. -->\n@for (entry of rendered(); track entry.group) {\n <ng-container [ngs-form-group]=\"entry.group\" [ngs-form-item]=\"entry.root\"></ng-container>\n}\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n/**\n * Renders its items one after another without any wrapper markup. Useful as a grouping node inside a row.\n *\n * @remarks Registry key: `column`. Does not create a form control.\n */\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n /** Creates a `column` item. */\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\n\n/**\n * Lays out items side by side. Each item is wrapped in a div whose class comes from `columnClass` (same for every\n * item) or `columnClasses` (one per item), so it works with any CSS grid system.\n *\n * @remarks Registry key: `form-row`. Does not create a form control.\n * @example\n * ```ts\n * NgsFormsRowComponent.create({\n * containerClass: 'row g-3',\n * columnClasses: ['col-md-6', 'col-md-6'],\n * items: [firstName, lastName],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n /** Creates a `form-row` item. */\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormGroupConfig } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n/**\n * A named group of items backed by an `UntypedFormGroup`. Its value is nested under `name` in the form value.\n *\n * @remarks Registry key: `form-group`. Usually the `root` of a form, and also useful for nesting related fields\n * (an address, for example) or for hiding a whole group with `visible$`.\n * @example\n * ```ts\n * NgsFormsFormGroupComponent.create({\n * name: 'address',\n * items: [addressLine1, city, postcode],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig>\n implements OnInit\n{\n static override key = 'form-group';\n\n /** Creates a `form-group` item. */\n static create(\n config: NgsFormsFormGroupConfig\n ): NgsFormsFormItem<NgsFormsFormGroupConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\nimport { NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\nimport { Subject } from 'rxjs';\n\n/**\n * Holds the `UntypedFormArray` of one `NgsFormsFormArrayContainerComponent` and is shared with its list and buttons.\n *\n * @remarks Inject it in a custom component placed inside a form array to add or remove rows programmatically.\n */\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n /** Emits after a row is added or removed. */\n readonly itemsChanged = new Subject<void>();\n\n constructor() {\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n }\n\n /** Removes the row at `index`, unless that would go below `minItems`. */\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n this.itemsChanged.next();\n }\n /** Appends an empty row, unless the array already has `maxItems` rows. */\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.push(new UntypedFormGroup({}));\n this.itemsChanged.next();\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A button that appends a row to the enclosing form array, up to `maxItems`.\n *\n * @remarks Registry key: `form-array-add-item`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n /** Creates a `form-array-add-item` item. */\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { UntypedFormControl } from '@angular/forms';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A repeatable list of rows backed by an `UntypedFormArray`. Its value is an array under `name`.\n *\n * @remarks Registry key: `form-array`. Put an `NgsFormsFormArrayListComponent` inside `items` to render the rows,\n * and `NgsFormsFormArrayAddItemComponent` / `NgsFormsFormArrayRemoveItemComponent` to let users change them.\n */\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n\n constructor(private formArrayService: NgsFormsFormArrayInternalService) {\n super();\n this.control = this.formArrayService.formArray as unknown as UntypedFormControl;\n }\n\n /** Creates a `form-array` item. */\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnInit } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective } from '../../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\n\n/**\n * Renders one copy of `templateItem` for every row of the enclosing form array. Each row gets its own form group,\n * so the controls in the template become the properties of each array entry.\n *\n * @remarks Registry key: `form-array-list`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n ngOnInit() {\n this.subscribe(this.internalArrayService.itemsChanged, () => {\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /** Creates a `form-array-list` item. */\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n/**\n * A button that removes its own row from the enclosing form array, down to `minItems`.\n *\n * @remarks Registry key: `form-array-remove-item`. Place it inside the `templateItem` of an\n * `NgsFormsFormArrayListComponent` so each row gets one.\n */\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n private elementRef = inject(ElementRef);\n private indexFromDi = inject<number>(NGS_FORMS_ITEM_INDEX, { optional: true });\n\n /** Index of the row this button belongs to. */\n get myIndex(): number {\n if (this.indexFromDi !== null && this.indexFromDi !== undefined) {\n return this.indexFromDi;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n const container = el.closest('[data-index]');\n if (container) {\n const idxAttr = container.getAttribute('data-index');\n if (idxAttr !== null) {\n return parseInt(idxAttr, 10);\n }\n }\n return 0;\n }\n\n constructor() {\n super();\n }\n\n /** Creates a `form-array-remove-item` item. */\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders a line of static text, such as a heading or a hint, inside the form.\n *\n * @remarks Registry key: `text-div`. Config: `text` and optional `classes`.\n */\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n /** Creates a `text-div` item. */\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n /**\n * Shortcut for a heading: creates a `text-div` with `text` and the given class (default `h2`).\n */\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{ config.classes }}\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders an HTML string inside the form. The HTML is passed through Angular's sanitizer.\n *\n * @remarks Registry key: `content-html`. Registered by `registerCoreNgsFormComponents()`, which the theme packages'\n * `registerAll…` helpers call for you.\n */\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n /** Creates a `content-html` item. */\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Groups items under a title and optional subtitle. Does not create a form control, so child values stay in the\n * parent group.\n *\n * @remarks Registry key: `section`. Config: `title`, `subtitle`, `titleClass` (default `h3`),\n * `subtitleClass` (default `lead`) and `items`.\n */\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n /** Creates a `section` item. */\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\n/** Base configuration shared by every form item (inputs, containers and content items). */\nexport interface NgsFormsFormItemConfigBase {\n /**\n * Stable identifier for the item. Generated with `uuid` by the `create()` factories when omitted.\n * Component state set with `NgsFormsService.updateComponentState()` can be keyed by this value.\n */\n uuid?: string;\n /**\n * Static visibility flag.\n *\n * @notImplemented\n * @remarks Reserved for future use: the renderer currently ignores it. Use `visible$` to show or hide an item.\n */\n visible?: boolean;\n /**\n * Stream that controls whether the item is rendered.\n *\n * @remarks When the stream emits `false` the item's component is destroyed and its control is removed from the\n * parent form group, so hidden fields are excluded from the form value and from validation. When it emits `true`\n * the component is created again with a fresh control. Items without `visible$` are always rendered.\n * @example\n * ```ts\n * visible$: this.forms.formValue$.pipe(map((v) => v?.profile?.contactMethod === 'email'))\n * ```\n */\n visible$?: Observable<boolean>;\n /**\n * Initial component state for this item.\n *\n * @notImplemented\n * @remarks Reserved for future use.\n */\n initialState?: any;\n}\n\n/**\n * Configuration for items that render a list of child items without creating a form control of their own\n * (for example sections and columns).\n */\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n /** The child items to render, in order. */\n items: Array<NgsFormsFormItem<any>>\n}\n\n/**\n * Configuration for `NgsFormsFormGroupComponent`: a named group of child items backed by an `UntypedFormGroup`.\n */\nexport interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {}\n\n/** Base configuration for items that own a form control (inputs, groups and arrays). */\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n /**\n * Control name inside the parent form group. Becomes the key of this item's value in `NgsFormsService.formValue$`.\n */\n name: string;\n /**\n * Maps validator error keys (for example `required`, `minlength`, `email`) to the message shown to the user.\n *\n * @remarks Only the first error on the control is displayed. Errors without an entry fall back to\n * `Field is invalid: <errorKey>`. Messages appear once the control is touched or dirty, or after\n * `NgsFormsService.setIsSubmitted(true)`.\n */\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n /**\n * Static disabled flag.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components do not read it yet.\n */\n disabled?: boolean;\n /**\n * Stream that controls the disabled state.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components do not read it yet.\n */\n disabled$?: Observable<boolean>;\n /**\n * Angular validators applied to the item's control. Takes precedence over `validators$` when both are set.\n */\n validators?: Array<ValidatorFn>;\n /**\n * Stream of validator arrays. Each emission replaces the control's validators, which lets rules depend on other\n * values in the form. Ignored when `validators` is also set.\n *\n * @remarks The control's validity is recalculated on its next value change, so call `updateValueAndValidity()`\n * yourself if you need the new rules to apply immediately.\n */\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\n/** Base configuration for a labelled input control. */\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n /**\n * Optional element id.\n *\n * @notImplemented\n * @remarks Reserved for future use: the built-in components generate their own ids.\n */\n id?: string;\n /** Label text shown next to or above the control. */\n label: string;\n /**\n * Initial value.\n *\n * @notImplemented\n * @remarks Reserved for future use. Set initial values with `NgsFormsService.patchValue()` after the form renders.\n */\n value?: unknown;\n}\n\n// ---\n\n/** Base configuration for single line text inputs. */\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n /** Placeholder text shown while the input is empty. */\n placeholder?: string;\n /**\n * The HTML input type.\n * @defaultValue 'text'\n */\n type?: 'text' | 'email' | 'password'\n}\n\n\n/**\n * Base configuration for inputs that choose from a list of options (radio groups and selects).\n */\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n /** Static list of options. Used as the initial value when `options$` is also set. */\n options?: Array<NgsFormsFormInputOption>;\n /**\n * Stream of options. Each emission replaces the rendered options, which makes cascading selects and\n * server-loaded option lists possible.\n */\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\nimport { NgsFormsHtmlContentComponent } from './components/shared-form-components/html-content/html-content.component';\n\n\n/** Registration helpers for the structural components in `@ng-simplicity/forms-core`. */\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n /**\n * Registers the structural components: `form-group`, `form-row`, `column`, `form-array`, `form-array-list`,\n * `form-array-add-item`, `form-array-remove-item`, `text-div`, `content-html` and `section`.\n *\n * @remarks The theme packages call this for you from their own `registerAll…` helpers.\n */\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n registryService.register(\n NgsFormsHtmlContentComponent.key,\n NgsFormsHtmlContentComponent\n );\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4","i1.NgsFormsFormArrayInternalService"],"mappings":";;;;;;;;AAGA;MAEsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;;IAG5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAdoB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADlC;;;ACDD;MACa,mBAAmB,GAAG,IAAI,cAAc,CAAC,qBAAqB;AAC3E;;AAEG;MACU,+BAA+B,GAAG,IAAI,cAAc,CAAC,4BAA4B;AAC9F;MACa,oBAAoB,GAAG,IAAI,cAAc,CAAC,sBAAsB;AAe7E;;AAEG;AACI,MAAM,qCAAqC,GAAsC;AACtF,IAAA,SAAS,EAAE,CAAC,SAAS,MAAM;AACzB,QAAA,GAAG,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC,UAAU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5B,wBAAwB,CACzB;QACD,eAAe,CAAC,QAAQ,CACtB,4BAA4B,CAAC,GAAG,EAChC,4BAA4B,CAC7B;QACD,eAAe,CAAC,QAAQ,CACtB,4BAA4B,CAAC,GAAG,EAChC,4BAA4B,CAC7B;IACH;wGA5CW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;AAE7C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;;4FAE7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC1D,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-simplicity-forms-core.mjs","sources":["../../../../libs/forms-core/src/classes/base/subscriber.class.ts","../../../../libs/forms-core/src/misc/injection-tokens.constants.ts","../../../../libs/forms-core/src/misc/defaults.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component.class.ts","../../../../libs/forms-core/src/services/form-component-registry/form-component-registry.service.ts","../../../../libs/forms-core/src/services/forms/forms.service.ts","../../../../libs/forms-core/src/services/internal/internal-forms.service.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-item-with-visible-and-validators-base.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-items-container.class.ts","../../../../libs/forms-core/src/classes/form-component-base/form-component-input-with-options-base.class.ts","../../../../libs/forms-core/src/controllers/form-item/form-item.controller.ts","../../../../libs/forms-core/src/components/core/form-item/form-item.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.ts","../../../../libs/forms-core/src/components/core/form/form.component.html","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.ts","../../../../libs/forms-core/src/components/shared-form-components/column/form-column.component.html","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.ts","../../../../libs/forms-core/src/components/shared-form-components/row/form-row.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-group/form-group.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/service/form-array-internal.service.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/add-item/form-array-add-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/container/form-array.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/list/form-array-list.component.html","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.ts","../../../../libs/forms-core/src/components/shared-form-components/form-array/remove-item/form-array-remove-item.component.html","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.ts","../../../../libs/forms-core/src/components/shared-form-components/text-div/text-div.component.html","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.ts","../../../../libs/forms-core/src/components/shared-form-components/html-content/html-content.component.html","../../../../libs/forms-core/src/components/shared-form-components/section/section-config.interface.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.ts","../../../../libs/forms-core/src/components/shared-form-components/section/section.component.html","../../../../libs/forms-core/src/models/item-config-bases/form-item-config-base.model.ts","../../../../libs/forms-core/src/forms-core.module.ts","../../../../libs/forms-core/src/ng-simplicity-forms-core.ts"],"sourcesContent":["import { Observable, Subject, Subscription, takeUntil } from 'rxjs';\nimport { Directive } from '@angular/core';\n\n/** Base class that ties RxJS subscriptions to the component's lifetime. */\n@Directive() // No-op, just for Angular compiler\nexport abstract class NgsSubscriber {\n protected readonly destroy$ = new Subject<void>();\n\n protected subscriptions: Subscription[] = [];\n\n /** Subscribes to `subscribeTo` until the component is destroyed. */\n subscribe<T>(subscribeTo: Observable<T>, nextObserver: (value: T) => void): void {\n subscribeTo.pipe(takeUntil(this.destroy$)).subscribe(nextObserver);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.subscriptions.forEach((subscriber) => subscriber.unsubscribe());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';\n\n/** Injection token for the `NgsFormsFormItem` a component is rendering. */\nexport const NGS_FORMS_ITEM_DATA = new InjectionToken('ngs-forms-item-data');\n/**\n * @internal\n */\nexport const NGS_FORMS_CONTROL_ADD_REMOVE_FN = new InjectionToken('ngs-form-control-remove-fn');\n/** Injection token for the row index when a component is rendered inside a form array list. */\nexport const NGS_FORMS_ITEM_INDEX = new InjectionToken('ngs-forms-item-index');\n\ntype FormControlAddRemoveFn = (control: AbstractControl, controlName: string) => void;\n\n/**\n * @internal\n */\nexport interface INgsFormsFormControlAddRemove {\n add: FormControlAddRemoveFn;\n remove: FormControlAddRemoveFn;\n}\ninterface IControlAddRemoveFunctionsBuilder {\n formGroup: (formGroup: UntypedFormGroup) => INgsFormsFormControlAddRemove;\n formArray: (formArray: UntypedFormArray) => INgsFormsFormControlAddRemove;\n}\n/**\n * @internal\n */\nexport const NgsFormsFormControlAddRemoveFunctions: IControlAddRemoveFunctionsBuilder = {\n formGroup: (formGroup) => ({\n add: (control, controlName) => formGroup.addControl(controlName, control),\n remove: (control, controlName) => formGroup.removeControl(controlName),\n }),\n formArray: (formArray: UntypedFormArray) => ({\n add: (control, controlName) => formArray.controls.push(control),\n remove: (control, controlName) => {\n const index = formArray.controls.indexOf(control);\n formArray.controls.splice(index, 1);\n },\n }),\n};\n","/**\n * Simple alternative to lodash.defaults.\n * Returns a new object with properties from source assigned to target\n * if the properties are undefined or missing on target.\n */\n/**\n * Returns a copy of `target` with any `undefined` properties filled in from `source`. A dependency free\n * alternative to lodash `defaults`, handy for applying default config values in custom components.\n */\nexport function ngsDefaults<T extends object, U extends object>(target: T, source: U): T & U;\nexport function ngsDefaults(target: any, ...sources: any[]): any {\n const result = target ? { ...target } : {};\n for (const source of sources) {\n if (!source) continue;\n for (const key of Object.keys(source)) {\n if (result[key] === undefined) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n","import { Directive, inject, Injector } from '@angular/core';\nimport { v4 as uuidv4 } from 'uuid';\nimport { NgsSubscriber } from '../base/subscriber.class';\nimport { NGS_FORMS_ITEM_DATA } from '../../misc';\nimport { NgsFormsFormItem, NgsFormsFormItemConfigBase } from '../../models';\n\n/**\n * Root base class for every form item component. Reads the item's configuration from `NGS_FORMS_ITEM_DATA`.\n *\n * @remarks Extend it for components that do not own a form control, such as static content or buttons. Declare a\n * `static key` and a `static create(config)` factory so the component can be registered and used in configs.\n */\n@Directive({})\nexport abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {\n /** Registry key the component is registered under. */\n static key: string;\n /**\n * Element id for this component, handy for `id` and `for` attributes. The config's `id` when it sets one,\n * otherwise a generated unique id.\n */\n id: string;\n /** The item's configuration. */\n protected config: T;\n /** The full form item: `uuid`, `type` and `config`. */\n protected readonly itemData: NgsFormsFormItem<T>;\n constructor() {\n super();\n this.itemData = inject<NgsFormsFormItem<T>>(NGS_FORMS_ITEM_DATA);\n this.config = this.itemData.config;\n this.id = (this.config as { id?: string }).id || uuidv4();\n }\n}\n","import { Injectable, Type } from '@angular/core';\n\n/**\n * Maps registry keys (the `type` of an `NgsFormsFormItem`) to the Angular components that render them.\n *\n * @remarks The service is provided in the `platform` injector, so there is one registry per page. Registering a\n * key again replaces the previous component, which is how a theme package or your own component can override a\n * built-in one. Register components before the form renders, typically in the constructor of the component that\n * hosts `<ngs-form>`.\n * @example\n * ```ts\n * constructor(registry: NgsFormsComponentRegistryService) {\n * NgsFormsBootstrapModule.registerAllBootStrapComponents(registry);\n * registry.register(MyRatingComponent.key, MyRatingComponent);\n * }\n * ```\n */\n@Injectable({ providedIn: 'platform' })\nexport class NgsFormsComponentRegistryService {\n private readonly itemComponentRegistry: TItemComponentRegistry = {};\n /** Returns the component registered for `key`, or `undefined` when nothing is registered. */\n getComponentTypeForKey(key: string): Type<unknown> | undefined {\n return this.itemComponentRegistry[key];\n }\n /** Registers `component` under `key`, replacing any component already registered for it. */\n register(key: string, component: Type<unknown>): void {\n this.itemComponentRegistry[key] = component;\n }\n}\n\ntype TItemComponentRegistry = { [key: string]: Type<unknown> };\n","import { UntypedFormGroup } from '@angular/forms';\nimport { BehaviorSubject, Subject, Subscription } from 'rxjs';\nimport { NgsFormsFormConfig } from '../../models';\nimport { NgsFormsInternalService } from '../internal/internal-forms.service';\nimport { Injectable, OnDestroy } from '@angular/core';\n\n/**\n * The public API of a form. Provide it on the component that hosts `<ngs-form>` so each form gets its own instance.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'app-profile',\n * imports: [NgsFormComponent],\n * providers: [NgsFormsService],\n * template: `<ngs-form />`,\n * })\n * export class ProfileComponent {\n * private readonly forms = inject(NgsFormsService);\n * readonly value = toSignal(this.forms.formValue$);\n * }\n * ```\n */\n@Injectable()\nexport class NgsFormsService implements OnDestroy {\n /**\n * @internal\n */\n attempt = 0;\n /**\n * Emits the root form group's value every time it changes. Combine with `toSignal()` to read it in a template.\n *\n * @remarks The value is keyed by the root group's `name`, for example `{ profile: { firstName: 'Ada' } }`.\n */\n formValue$ = new BehaviorSubject<any>({});\n /** The latest value emitted by `formValue$`. */\n formValue: any = {};\n private internalFormService: NgsFormsInternalService | undefined;\n private formGroupSubscriptions: Array<Subscription> = [];\n private formGroup = new UntypedFormGroup({});\n\n /** `true` once the user has changed any control in the form. */\n get dirty(): boolean {\n return this.formGroup?.dirty ?? false;\n }\n /** `true` when every rendered control passes its validators. Hidden items are not validated. */\n get isValid(): boolean {\n if (!this.internalServiceIsSet) return false;\n return this.internalFormService!.checkIsValid();\n }\n /** `true` once `<ngs-form>` has connected to this service. */\n get internalServiceIsSet(): boolean {\n return !!this.internalFormService;\n }\n\n /**\n * Renders a form from `formConfig`, replacing any form that is already shown and resetting the submitted state.\n *\n * @remarks It is safe to call before `<ngs-form>` has initialised (for example in `ngOnInit`): the call is retried\n * every 25 ms for about half a second until the form component is available.\n */\n setFormConfig(formConfig: NgsFormsFormConfig): void {\n if (!this.internalServiceIsSet) {\n if (this.attempt > 20) {\n console.error('Internal form service is unavailable. Is the ngs-form root tag added to the page?');\n return;\n }\n this.attempt++;\n setTimeout(() => this.setFormConfig(formConfig), 25);\n return;\n }\n this.internalFormService!.setFormData(formConfig);\n }\n\n /**\n * @internal\n */\n setInternalService(internalFormsService: NgsFormsInternalService): void {\n this.internalFormService = internalFormsService;\n this.bindFormGroup();\n }\n\n /**\n * Marks the form as submitted (or not). While submitted, every invalid control shows its error message even if\n * the user never touched it.\n */\n setIsSubmitted(isSubmitted: boolean): void {\n if (!this.internalServiceIsSet) return;\n this.internalFormService!.setIsSubmitted(isSubmitted);\n }\n\n private bindFormGroup(): void {\n this.internalFormService!.formGroup$.subscribe((fg) => {\n this.formGroup = fg;\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n\n this.formGroupSubscriptions.push(\n this.formGroup.valueChanges.subscribe((v) => {\n this.formValue = v;\n this.formValue$.next(v);\n })\n );\n });\n }\n /**\n * Merges `state` into the state of one component, identified by its `uuid` or control `name`.\n * Components read the merged result through `commonState`.\n */\n updateComponentState(componentKey: string, state: any): void {\n this.internalFormService?.updateComponentState(componentKey, state);\n }\n /** Merges `state` into the state shared by every component in the form. */\n updateGlobalState(state: any): void {\n this.internalFormService?.updateGlobalState(state);\n }\n ngOnDestroy() {\n this.formGroupSubscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n\n /**\n * Patches values into the form, using the same shape as `formValue$` (including the root group name).\n *\n * @remarks Only controls that are currently rendered receive values. Patch again after a conditional item becomes\n * visible, and make sure a form array has enough rows (see `initialItemCount`) before patching array values.\n */\n patchValue(entityData: any) {\n this.formGroup.patchValue(entityData);\n }\n}\n","import { BehaviorSubject, filter, map } from 'rxjs';\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormsFormConfig } from '../../models';\nimport { Injectable } from '@angular/core';\nimport { NgsFormsGlobalFormState } from '../../models/global-state.interface';\nimport { ngsDefaults } from '../../misc/defaults';\n\n/**\n * Per form state holder that connects `<ngs-form>`, its items and `NgsFormsService`.\n *\n * @remarks Provided by `NgsFormComponent`. Application code should use `NgsFormsService` instead; this service is\n * exported for authors of custom components and may change between minor versions.\n */\n@Injectable()\nexport class NgsFormsInternalService {\n formGroup$ = new BehaviorSubject<FormGroup>(new UntypedFormGroup({}));\n formConfig$ = new BehaviorSubject<NgsFormsFormConfig | undefined>(undefined);\n isSubmitted$ = new BehaviorSubject<boolean>(false);\n state = new BehaviorSubject<{ [key: string]: any }>({});\n setIsSubmitted(isSubmitted: boolean): void {\n this.isSubmitted$.next(isSubmitted);\n }\n\n checkIsValid(): boolean {\n if (!this.formGroup$.value) return false;\n return this.formGroup$.value.valid;\n }\n\n setFormData(formConfig: NgsFormsFormConfig) {\n const state: { [key: string]: any } = { ...(formConfig.initialState ?? {}) };\n state['global'] = { ...(formConfig.globalState ?? {}) };\n this.state.next(state);\n this.formGroup$.next(new UntypedFormGroup({}));\n this.formConfig$.next(formConfig);\n this.isSubmitted$.next(false);\n }\n private mergeState(key: string, update: any): void {\n const obj = this.state.value[key] || {};\n const updated = ngsDefaults(update, obj);\n this.state.value[key] = updated;\n this.state.next(this.state.value);\n }\n /** Sets a component's state from its config's `initialState`, unless state for `uuid` already exists. */\n seedComponentState(uuid: string, initialState: any) {\n if (!uuid || !initialState || this.state.value[uuid]) return;\n this.mergeState(uuid, initialState);\n }\n updateGlobalState(state: NgsFormsGlobalFormState) {\n this.mergeState('global', state);\n }\n updateComponentState(componentKey: string, state: any) {\n this.mergeState(componentKey, state);\n }\n\n /**\n * Merged state for one component: its own (by `uuid`), then by `name`, then global.\n * `initialState` seeds the component's own state unless state for `uuid` already exists.\n */\n subscribeToState(uuid: string, name?: string, initialState?: any) {\n this.seedComponentState(uuid, initialState);\n let last = '';\n return this.state.pipe(\n map((allState) => {\n const stateByUuid = allState[uuid] || {};\n const stateByName = name ? (allState[name] || {}) : {};\n const globalState = allState['global'] || {};\n return ngsDefaults(stateByUuid, ngsDefaults(stateByName, globalState));\n }),\n filter((currentState) => {\n const stringifiedState = JSON.stringify(currentState);\n const isUpdated = stringifiedState !== last;\n last = stringifiedState;\n return isUpdated;\n })\n );\n }\n}\n","import { Directive, inject, OnDestroy, OnInit, Signal, ChangeDetectorRef } from '@angular/core';\nimport { AbstractControl, FormArray, FormControl, FormGroup, UntypedFormControl, ValidatorFn } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN } from '../../misc';\nimport { NgsFormsInternalService } from '../../services';\nimport { NgsFormsFormItemConfigBaseItemWithNameAndValidators } from '../../models/item-config-bases/';\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { merge, of } from 'rxjs';\n\n/**\n * Base class for items that own a form control. Creates the control (seeded with `value` when the config has one),\n * applies `validators` / `validators$` and `disabled` / `disabled$`, registers it with the parent group under\n * `config.name` and keeps `errorMessage` up to date.\n */\n@Directive({})\nexport class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {\n /** The item's form control. Bind it with `[formControl]`. */\n control: UntypedFormControl | undefined;\n /**\n * Message for the control's first error, taken from `errorMessageMap`. Empty while the control is valid, or\n * before it is touched, dirty or submitted.\n */\n errorMessage = '';\n private formAddRemoveFns = inject<INgsFormsFormControlAddRemove>(NGS_FORMS_CONTROL_ADD_REMOVE_FN);\n private privateService = inject<NgsFormsInternalService>(NgsFormsInternalService);\n private changeDetectorRef = inject(ChangeDetectorRef);\n /** Whether the form has been marked as submitted with `NgsFormsService.setIsSubmitted()`. */\n readonly submitted: Signal<boolean> = toSignal(this.privateService.isSubmitted$, { initialValue: false });\n /** The latest value of `disabled` / `disabled$`, or `undefined` when the config sets neither. */\n private disabledFromConfig: boolean | undefined;\n\n ngOnInit() {\n if (!this.control) {\n const initialValue = (this.config as { value?: unknown }).value;\n this.control = new FormControl(initialValue, { validators: [] });\n }\n this.bindValidators();\n this.formAddRemoveFns.add(this.control, this.config.name);\n this.bindDisabled();\n\n // Listen to changes and update error message dynamically\n this.subscribe(\n merge(\n this.control.valueChanges,\n this.control.statusChanges,\n this.privateService.isSubmitted$\n ),\n () => {\n this.updateErrorMessage();\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n private updateErrorMessage() {\n if (!this.control) {\n this.errorMessage = '';\n return;\n }\n const showErrors = this.control.invalid && (this.control.touched || this.control.dirty || this.submitted());\n if (!showErrors) {\n this.errorMessage = '';\n return;\n }\n const errors = this.control.errors;\n if (!errors) {\n this.errorMessage = '';\n return;\n }\n const firstErrorKey = Object.keys(errors)[0];\n const map = this.config.errorMessageMap;\n this.errorMessage = map?.[firstErrorKey] || `Field is invalid: ${firstErrorKey}`;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n this.formAddRemoveFns.remove(this.control!, this.config.name);\n }\n\n private bindValidators() {\n if (!this.config.validators && !this.config.validators$) return;\n if (this.config.validators) {\n this.control!.setValidators(this.config.validators);\n return;\n }\n if (this.config.validators$) {\n this.subscribe(this.config.validators$!, (validators: Array<ValidatorFn>) => this.control!.setValidators(validators));\n }\n }\n\n private bindDisabled() {\n const disabled$ = this.config.disabled$ ?? (this.config.disabled !== undefined ? of(this.config.disabled) : undefined);\n if (!disabled$) return;\n const control: AbstractControl = this.control!;\n this.subscribe(disabled$, (disabled: boolean) => {\n this.disabledFromConfig = !!disabled;\n this.applyDisabled(control);\n });\n // Child controls are added to groups and arrays after the container has been disabled, and adding an enabled\n // child re-enables its parent. Re-apply the configured state whenever a container's status changes.\n if (control instanceof FormGroup || control instanceof FormArray) {\n this.subscribe(control.statusChanges, () => {\n if (this.disabledFromConfig && control.enabled) {\n control.disable();\n }\n });\n }\n }\n\n private applyDisabled(control: AbstractControl) {\n if (this.disabledFromConfig && !control.disabled) {\n control.disable();\n } else if (!this.disabledFromConfig && control.disabled) {\n control.enable();\n }\n this.changeDetectorRef.markForCheck();\n }\n}\n\n","import { NgsFormsCommonComponentState, NgsFormsFormItemConfigBaseInput } from '../../models';\nimport { Directive, inject, Signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from './form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsInternalService, NgsFormsService } from '../../services';\n\n/**\n * Base class for input components. Adds access to the form's `NgsFormsService` and the merged component state.\n *\n * @remarks This is the class to extend when you build your own input. See the Custom components guide.\n */\n@Directive({}) // for compiler\nexport abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFormItemConfigBaseInput> extends NgsFormsFormItemWithVisibleAndValidatorsBase<T> {\n /** The `NgsFormsService` of the form this input belongs to. */\n readonly myFormService = inject(NgsFormsService);\n private readonly internalService = inject(NgsFormsInternalService);\n\n /** Merged state for this component: its own state, then state by name, then global state. */\n readonly commonState: Signal<NgsFormsCommonComponentState> = toSignal(\n this.internalService.subscribeToState(this.itemData.uuid || '', this.config.name, this.config.initialState),\n { initialValue: {} as NgsFormsCommonComponentState }\n );\n\n /**\n * Switches this component between `input` and `summary` display by updating its own state.\n * With no argument it flips the current mode.\n */\n toggleDisplayMode(setTo?: 'summary' | 'input') {\n const current = this.commonState().displayMode ?? 'input';\n const displayMode = setTo ?? (current === 'summary' ? 'input' : 'summary');\n this.internalService.updateComponentState(this.itemData.uuid || this.config.name, { displayMode });\n }\n}\n\n","import { NgsFormsFormItemContainerConfigBase } from '../../models';\n\nimport { NgsFormsBaseClassFormComponent } from './form-component.class';\nimport { Directive, OnDestroy } from '@angular/core';\n\n/** Base class for container items that render `config.items` without owning a form control. */\n@Directive({}) // no op for compiler\nexport class NgsFormsBaseClassItemsContainerBase<T extends NgsFormsFormItemContainerConfigBase> extends NgsFormsBaseClassFormComponent<T> implements OnDestroy {}\n","import { Directive, Signal } from '@angular/core';\nimport { NgsFormsBaseClassFormInputComponent } from './form-component-input.class';\nimport { NgsFormsFormInputOption, NgsFormsFormItemConfigBaseInputWithOptions } from '../../models';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { of } from 'rxjs';\n\n/**\n * Base class for inputs with options. Exposes `options` as a signal that follows `options$` when given and falls\n * back to the static `options`.\n */\n@Directive()\nexport class NgsFormsBaseClassFormItemInputWithOptionsComponent<T extends NgsFormsFormItemConfigBaseInputWithOptions> extends NgsFormsBaseClassFormInputComponent<T> {\n /** The current options. */\n options: Signal<Array<NgsFormsFormInputOption>> = toSignal(\n this.config.options$ ?? of(this.config.options ?? []),\n { initialValue: this.config.options ?? [] }\n );\n}\n\n","import { ChangeDetectorRef, ComponentRef, Injector, Provider, ViewContainerRef } from '@angular/core';\nimport { NgsFormsFormItem } from '../../models';\nimport { NgsSubscriber } from '../../classes/base/subscriber.class';\nimport { INgsFormsFormControlAddRemove, NGS_FORMS_CONTROL_ADD_REMOVE_FN, NGS_FORMS_ITEM_DATA, NGS_FORMS_ITEM_INDEX } from '../../misc';\nimport { BehaviorSubject, of } from 'rxjs';\nimport { NgsFormsComponentRegistryService } from '../../services/form-component-registry/form-component-registry.service';\n\nexport class NgsFormItemController extends NgsSubscriber {\n private componentRef: ComponentRef<unknown> | undefined;\n private parentVisibility = new BehaviorSubject<boolean>(false);\n private lastVisible: boolean | undefined;\n\n constructor(\n private readonly injector: Injector,\n private readonly viewContainerRef: ViewContainerRef,\n private readonly itemData: NgsFormsFormItem<any>,\n private readonly addRemoveControlFn?: INgsFormsFormControlAddRemove,\n private readonly index?: number,\n private readonly changeDetectorRef?: ChangeDetectorRef\n ) {\n super();\n this.bindVisibility();\n }\n\n destroy() {\n this.detach();\n super.ngOnDestroy();\n }\n\n private bindVisibility() {\n const config = this.itemData.config;\n const visible$ = config.visible$ ?? (config.visible !== undefined ? of(config.visible) : undefined);\n if (!visible$) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.subscribe(visible$, (visible: any) => {\n if (this.lastVisible === visible) return;\n\n this.lastVisible = visible;\n if (visible) {\n Promise.resolve().then(() => this.create());\n return;\n }\n this.detach();\n });\n }\n\n private create() {\n const providers: Provider[] = [{ provide: NGS_FORMS_ITEM_DATA, useValue: this.itemData }];\n if (this.index !== undefined) {\n providers.push({ provide: NGS_FORMS_ITEM_INDEX, useValue: this.index });\n }\n if (this.addRemoveControlFn) {\n providers.push({ provide: NGS_FORMS_CONTROL_ADD_REMOVE_FN, useValue: this.addRemoveControlFn });\n }\n const myInjector = Injector.create({\n parent: this.injector,\n providers,\n });\n const componentType = this.injector.get(NgsFormsComponentRegistryService).getComponentTypeForKey(this.itemData.type);\n if (!componentType) {\n console.error(`Ngs form component type ${this.itemData.type} not registered.`);\n return;\n }\n this.componentRef = this.viewContainerRef.createComponent(componentType, { injector: myInjector });\n this.componentRef.changeDetectorRef?.detectChanges();\n this.changeDetectorRef?.markForCheck();\n this.parentVisibility.next(true);\n }\n\n private detach() {\n this.parentVisibility.next(false);\n this.componentRef?.destroy();\n this.changeDetectorRef?.markForCheck();\n }\n}\n","import { ChangeDetectorRef, Directive, inject, Injector, Input, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemController } from '../../../controllers';\nimport { INgsFormsFormControlAddRemove, NgsFormsFormControlAddRemoveFunctions } from '../../../misc';\nimport { NgsFormsComponentRegistryService } from '../../../services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Structural building block that looks up a form item's component in the registry and renders it.\n *\n * @remarks Use it inside custom container components to render child items:\n * `<ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"group\"></ng-container>`.\n */\n@Directive({\n selector: '[ngs-form-item]',\n //templateUrl: \"./form-item.component.html\",\n})\n\nexport class NgsFormsFormItemDirective implements OnInit, OnDestroy {\n /** The item to render. */\n @Input('ngs-form-item')\n itemData: NgsFormsFormItem<any> | undefined = undefined;\n\n /** Form group that the item's control is added to. */\n @Input('ngs-form-group')\n formGroup?: UntypedFormGroup;\n\n /** Form array that the item's control is added to. */\n @Input('ngs-form-array')\n formArray?: UntypedFormArray;\n\n /**\n * Index of the item inside a form array row, provided to children as `NGS_FORMS_ITEM_INDEX`.\n */\n @Input('ngs-form-index')\n index?: number;\n\n controller: NgsFormItemController | undefined;\n\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n private readonly formComponentRegistryService = inject(NgsFormsComponentRegistryService);\n\n ngOnInit(): void {\n if (!this.itemData) {\n return console.error('Form item without form data');\n }\n let addRemoveFn: INgsFormsFormControlAddRemove | undefined = undefined;\n if (this.formArray) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formArray(this.formArray);\n }\n if (this.formGroup) {\n addRemoveFn = NgsFormsFormControlAddRemoveFunctions.formGroup(this.formGroup);\n }\n this.controller = new NgsFormItemController(\n this.injector,\n this.viewContainerRef,\n this.itemData,\n addRemoveFn,\n this.index,\n this.changeDetectorRef\n );\n }\n\n ngOnDestroy() {\n this.controller?.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgsFormsService } from '../../../services/forms/forms.service';\nimport { NgsFormsInternalService } from '../../../services/internal/internal-forms.service';\nimport { NgsFormsFormItemDirective } from '../form-item/form-item.component';\n\n/**\n * Renders the form described by the `NgsFormsFormConfig` given to the nearest `NgsFormsService`.\n *\n * @remarks Place it in the template of the component that provides `NgsFormsService`. It takes no inputs.\n * @example\n * ```html\n * <ngs-form></ngs-form>\n * ```\n */\n@Component({\n selector: 'ngs-form',\n templateUrl: './form.component.html',\n providers: [NgsFormsInternalService],\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormComponent {\n private readonly ngsInternalFormsService = inject(NgsFormsInternalService);\n readonly ngsFormsService = inject(NgsFormsService);\n\n readonly formGroup = toSignal(this.ngsInternalFormsService.formGroup$);\n readonly formConfig = toSignal(this.ngsInternalFormsService.formConfig$);\n\n /** The root item to render with the form group it belongs to (empty until a config is set). */\n readonly rendered = computed(() => {\n const group = this.formGroup();\n const root = this.formConfig()?.root;\n return group && root ? [{ group, root }] : [];\n });\n\n constructor() {\n this.ngsFormsService.setInternalService(this.ngsInternalFormsService);\n }\n}\n\n","<!-- Tracking by form group re-creates the tree whenever setFormConfig() is called again, since each call creates a new group. -->\n@for (entry of rendered(); track entry.group) {\n <ng-container [ngs-form-group]=\"entry.group\" [ngs-form-item]=\"entry.root\"></ng-container>\n}\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormItem, NgsFormsFormItemContainerConfigBase } from '../../../models';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\n\n/**\n * Renders its items one after another without any wrapper markup. Useful as a grouping node inside a row.\n *\n * @remarks Registry key: `column`. Does not create a form control.\n */\n@Component({\n selector: 'ngs-form-component-column',\n templateUrl: './form-column.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsColumnComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormItemContainerConfigBase> {\n static override key = 'column';\n\n /** Creates a `column` item. */\n static create(config: NgsFormsFormItemContainerConfigBase): NgsFormsFormItem<NgsFormsFormItemContainerConfigBase> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsColumnComponent.key,\n config,\n };\n }\n}\n","@for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n}\n","import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormItemRowConfig } from './form-row-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\n\n/**\n * Lays out items side by side. Each item is wrapped in a div whose class comes from `columnClass` (same for every\n * item) or `columnClasses` (one per item), so it works with any CSS grid system.\n *\n * @remarks Registry key: `form-row`. Does not create a form control.\n * @example\n * ```ts\n * NgsFormsRowComponent.create({\n * containerClass: 'row g-3',\n * columnClasses: ['col-md-6', 'col-md-6'],\n * items: [firstName, lastName],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-row-component',\n templateUrl: './form-row.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n\nexport class NgsFormsRowComponent extends NgsFormsBaseClassFormComponent<NgsFormItemRowConfig> {\n static override key = 'form-row';\n constructor(\n ) {\n super();\n }\n getIndividualRowDivClass(index: number) {\n if (this.config.columnClass) {\n return this.config.columnClass;\n }\n if (!this.config.columnClasses?.length) {\n return '';\n }\n return this.config.columnClasses[index];\n }\n /** Creates a `form-row` item. */\n static create(config: NgsFormItemRowConfig): NgsFormsFormItem<NgsFormItemRowConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsRowComponent.key,\n config: config,\n };\n }\n}\n","<div class=\"{{config.containerClass}}\">\n @for(item of config.items; track item; let i = $index){\n <div class=\"{{getIndividualRowDivClass(i)}}\">\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n </div>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, inject, Injector, OnInit, ViewContainerRef } from '@angular/core';\nimport {\n UntypedFormControl,\n UntypedFormGroup,\n} from '@angular/forms';\nimport { v4 } from 'uuid';\n\nimport { NgsFormsFormItem, NgsFormsFormGroupConfig } from '../../../models';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\n\nimport { NgsFormsFormItemDirective } from '../../core';\n\n\n/**\n * A named group of items backed by an `UntypedFormGroup`. Its value is nested under `name` in the form value.\n *\n * @remarks Registry key: `form-group`. Usually the `root` of a form, and also useful for nesting related fields\n * (an address, for example) or for hiding a whole group with `visible$`.\n * @example\n * ```ts\n * NgsFormsFormGroupComponent.create({\n * name: 'address',\n * items: [addressLine1, city, postcode],\n * })\n * ```\n */\n@Component({\n selector: 'ngs-forms-form-group',\n templateUrl: './form-group.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormGroupComponent\n extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormsFormGroupConfig>\n implements OnInit\n{\n static override key = 'form-group';\n\n /** Creates a `form-group` item. */\n static create(\n config: NgsFormsFormGroupConfig\n ): NgsFormsFormItem<NgsFormsFormGroupConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormGroupComponent.key,\n config,\n };\n }\n\n get formGroupControl(): UntypedFormGroup {\n return this.control as unknown as UntypedFormGroup;\n }\n\n constructor() {\n super();\n this.control = new UntypedFormGroup({}) as unknown as UntypedFormControl;\n }\n}\n\n","@if (config.items) {\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\" [ngs-form-group]=\"formGroupControl\"></ng-container>\n }\n}\n","import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { UntypedFormArray, UntypedFormGroup } from '@angular/forms';\nimport { NgsFormItemArrayConfig } from '../container';\nimport { NGS_FORMS_ITEM_DATA } from '../../../../misc';\nimport { NgsFormsFormItem } from '../../../../models/index';\nimport { Subject } from 'rxjs';\n\n/**\n * Holds the `UntypedFormArray` of one `NgsFormsFormArrayContainerComponent` and is shared with its list and buttons.\n *\n * @remarks Inject it in a custom component placed inside a form array to add or remove rows programmatically.\n */\n@Injectable()\nexport class NgsFormsFormArrayInternalService implements OnDestroy {\n config = inject<NgsFormsFormItem<NgsFormItemArrayConfig>>(NGS_FORMS_ITEM_DATA).config;\n\n readonly formArray = new UntypedFormArray([]);\n /** Emits after a row is added or removed. */\n readonly itemsChanged = new Subject<void>();\n\n constructor() {\n if (this.config.initialItemCount) {\n for (let i = 0; i < this.config.initialItemCount; i++) {\n this.addItem();\n }\n }\n }\n\n ngOnDestroy() {\n }\n\n /** Removes the row at `index`, unless that would go below `minItems`. */\n removeAt(index: number) {\n if (this.config?.minItems && this.formArray.controls.length <= this.config!.minItems!) {\n return;\n }\n if (!this.formArray.controls.length) {\n return;\n }\n this.formArray.removeAt(index);\n this.itemsChanged.next();\n }\n /** Appends an empty row, unless the array already has `maxItems` rows. */\n addItem() {\n if (this.config?.maxItems && this.formArray.controls.length >= this.config!.maxItems) {\n return;\n }\n this.formArray.push(new UntypedFormGroup({}));\n this.itemsChanged.next();\n }\n}\n","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayAddItemConfig } from './form-array-add-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A button that appends a row to the enclosing form array, up to `maxItems`.\n *\n * @remarks Registry key: `form-array-add-item`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-add-item',\n templateUrl: './form-array-add-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayAddItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayAddItemConfig> {\n static override key = 'form-array-add-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n\n /** Creates a `form-array-add-item` item. */\n static create(config: NgsFormItemArrayAddItemConfig): NgsFormsFormItem<NgsFormItemArrayAddItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayAddItemComponent.key,\n config: config,\n };\n }\n\n addItem() {\n this.internalArrayService.addItem();\n }\n}\n","<button\n (click)=\"addItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-primary'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Add Item' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { UntypedFormControl } from '@angular/forms';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormsFormItemDirective } from '../../../core/index';\nimport { NgsFormItemArrayConfig } from './form-array-config.model';\nimport { NgsFormsFormItemWithVisibleAndValidatorsBase } from '../../../../classes/form-component-base/form-component-item-with-visible-and-validators-base.class';\nimport { NgsFormsFormArrayInternalService } from '../service/form-array-internal.service';\nimport { v4 } from 'uuid';\n\n/**\n * A repeatable list of rows backed by an `UntypedFormArray`. Its value is an array under `name`.\n *\n * @remarks Registry key: `form-array`. Put an `NgsFormsFormArrayListComponent` inside `items` to render the rows,\n * and `NgsFormsFormArrayAddItemComponent` / `NgsFormsFormArrayRemoveItemComponent` to let users change them.\n */\n@Component({\n selector: 'ngs-forms-form-array',\n imports: [NgsFormsFormItemDirective],\n templateUrl: './form-array.component.html',\n providers: [NgsFormsFormArrayInternalService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayContainerComponent extends NgsFormsFormItemWithVisibleAndValidatorsBase<NgsFormItemArrayConfig> {\n static override key = 'form-array';\n\n constructor(private formArrayService: NgsFormsFormArrayInternalService) {\n super();\n this.control = this.formArrayService.formArray as unknown as UntypedFormControl;\n }\n\n /** Creates a `form-array` item. */\n static create(\n config: NgsFormItemArrayConfig\n ): NgsFormsFormItem<NgsFormItemArrayConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayContainerComponent.key,\n config: config,\n };\n }\n}\n","<div [class]=\"config.containerClass || ''\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n</div>\n","import { Component, inject, ChangeDetectionStrategy, ChangeDetectorRef, OnInit } from '@angular/core';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { AbstractControl, FormArray, UntypedFormGroup } from '@angular/forms';\n\nimport { v4 } from 'uuid';\nimport { NgsFormsFormArrayListConfig } from './form-array-list.config';\nimport { NgsFormsFormItemDirective } from '../../../core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\n\n/**\n * Renders one copy of `templateItem` for every row of the enclosing form array. Each row gets its own form group,\n * so the controls in the template become the properties of each array entry.\n *\n * @remarks Registry key: `form-array-list`. Must be placed inside an `NgsFormsFormArrayContainerComponent`.\n */\n@Component({\n selector: 'ngs-forms-form-array-list',\n templateUrl: './form-array-list.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayListComponent extends NgsFormsBaseClassFormComponent<NgsFormsFormArrayListConfig> implements OnInit {\n static override key = 'form-array-list';\n public internalArrayService = inject<NgsFormsFormArrayInternalService>(\n NgsFormsFormArrayInternalService\n );\n public myFormArray: FormArray<any> = this.internalArrayService.formArray;\n private changeDetectorRef = inject(ChangeDetectorRef);\n\n ngOnInit() {\n this.subscribe(this.internalArrayService.itemsChanged, () => {\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /** Creates a `form-array-list` item. */\n static create(\n config: NgsFormsFormArrayListConfig\n ): NgsFormsFormItem<NgsFormsFormArrayListConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayListComponent.key,\n config: config,\n };\n }\n\n castToFormGroup(control: AbstractControl): UntypedFormGroup {\n return control as UntypedFormGroup;\n }\n}\n","@for (formGroup of myFormArray.controls; track formGroup; let i = $index) {\n <div [attr.data-index]=\"$index\" [class]=\"config.containerClass || ''\">\n <ng-container [ngs-form-group]=\"castToFormGroup(formGroup)\" [ngs-form-index]=\"i\"\n [ngs-form-item]=\"config.templateItem\"></ng-container>\n </div>\n}\n","import { Component, inject, ChangeDetectionStrategy, ElementRef } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../../classes/form-component-base/form-component.class';\nimport { NgsFormsFormItem } from '../../../../models';\nimport { NgsFormItemArrayRemoveItemConfig } from './form-array-remove-item-config.model';\nimport { NgsFormsFormArrayInternalService } from '../service';\nimport { NGS_FORMS_ITEM_INDEX } from '../../../../misc';\nimport { v4 } from 'uuid';\n\n/**\n * A button that removes its own row from the enclosing form array, down to `minItems`.\n *\n * @remarks Registry key: `form-array-remove-item`. Place it inside the `templateItem` of an\n * `NgsFormsFormArrayListComponent` so each row gets one.\n */\n@Component({\n selector: 'ngs-forms-form-array-remove-item',\n templateUrl: './form-array-remove-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormArrayRemoveItemComponent extends NgsFormsBaseClassFormComponent<NgsFormItemArrayRemoveItemConfig> {\n static override key = 'form-array-remove-item';\n internalArrayService = inject(NgsFormsFormArrayInternalService);\n private elementRef = inject(ElementRef);\n private indexFromDi = inject<number>(NGS_FORMS_ITEM_INDEX, { optional: true });\n\n /** Index of the row this button belongs to. */\n get myIndex(): number {\n if (this.indexFromDi !== null && this.indexFromDi !== undefined) {\n return this.indexFromDi;\n }\n const el = this.elementRef.nativeElement as HTMLElement;\n const container = el.closest('[data-index]');\n if (container) {\n const idxAttr = container.getAttribute('data-index');\n if (idxAttr !== null) {\n return parseInt(idxAttr, 10);\n }\n }\n return 0;\n }\n\n constructor() {\n super();\n }\n\n /** Creates a `form-array-remove-item` item. */\n static create(config: NgsFormItemArrayRemoveItemConfig): NgsFormsFormItem<NgsFormItemArrayRemoveItemConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormArrayRemoveItemComponent.key,\n config,\n };\n }\n\n removeItem() {\n this.internalArrayService.removeAt(this.myIndex);\n }\n}\n","<button\n (click)=\"removeItem()\"\n [class]=\"config.buttonClass || 'btn btn-outline-danger btn-sm'\"\n type=\"button\">\n @if (config.buttonIcon) {\n <i [class]=\"config.buttonIcon\" aria-hidden=\"true\"></i>\n }\n {{ config.buttonText || 'Remove' }}\n</button>\n","import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormsTextDivConfig } from './text-div-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders a line of static text, such as a heading or a hint, inside the form.\n *\n * @remarks Registry key: `text-div`. Config: `text` and optional `classes`.\n */\n@Component({\n selector: 'ngs-form-component-text-div',\n imports: [],\n templateUrl: './text-div.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsTextDivComponent extends NgsFormsBaseClassFormComponent<NgsFormsTextDivConfig> {\n static override key = 'text-div';\n\n /** Creates a `text-div` item. */\n static create(\n config: NgsFormsTextDivConfig\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsTextDivComponent.key,\n config: config,\n };\n }\n /**\n * Shortcut for a heading: creates a `text-div` with `text` and the given class (default `h2`).\n */\n static title(\n title: string,\n divClass = 'h2'\n ): NgsFormsFormItem<NgsFormsTextDivConfig> {\n return NgsFormsTextDivComponent.create({\n text: title,\n classes: divClass,\n });\n }\n}\n","<div class=\"{{ config.classes }}\">{{ config.text }}</div>\n","import { Component, ChangeDetectionStrategy, inject, Sanitizer, SecurityContext } from '@angular/core';\nimport { NgsFormsBaseClassFormComponent } from '../../../classes/form-component-base/form-component.class';\nimport { NgsFormItemHtmlContentConfig } from './html-content-config.model';\nimport { NgsFormsFormItem } from '../../../models';\nimport { v4 } from 'uuid';\n\n/**\n * Renders an HTML string inside the form. The HTML is passed through Angular's sanitizer.\n *\n * @remarks Registry key: `content-html`. Registered by `registerCoreNgsFormComponents()`, which the theme packages'\n * `registerAll…` helpers call for you.\n */\n@Component({\n selector: 'ngs-form-component-html-content',\n imports: [],\n templateUrl: './html-content.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsHtmlContentComponent extends NgsFormsBaseClassFormComponent<NgsFormItemHtmlContentConfig> {\n static override key = 'content-html';\n contentConfig = this.config as NgsFormItemHtmlContentConfig;\n html: string;\n\n constructor() {\n super();\n const sanitizer = inject(Sanitizer);\n this.html =\n sanitizer.sanitize(SecurityContext.HTML, this.contentConfig.html) ||\n '';\n }\n\n /** Creates a `content-html` item. */\n static create(\n config: NgsFormItemHtmlContentConfig\n ): NgsFormsFormItem<NgsFormItemHtmlContentConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsHtmlContentComponent.key,\n config,\n };\n }\n}\n","<div [innerHTML]=\"html\"></div>\n","import { NgsFormsFormItemContainerConfigBase } from '../../../models/index';\n\nexport interface NgsFormsFormSectionConfig extends NgsFormsFormItemContainerConfigBase {\n title: string;\n titleClass?: string;\n subtitle?: string;\n subtitleClass?: string;\n}\n\nexport const sectionConfigDefaults: Partial<NgsFormsFormSectionConfig> = {\n titleClass: 'h3',\n subtitleClass: 'lead',\n};\n","import { NgsFormsBaseClassItemsContainerBase } from '../../../classes/form-component-base/form-component-items-container.class';\nimport { NgsFormsFormSectionConfig, sectionConfigDefaults } from './section-config.interface';\nimport { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { ngsDefaults } from '../../../misc/defaults';\nimport { v4 } from 'uuid';\nimport { NgsFormsFormItemDirective } from '../../core';\nimport { NgsFormsFormItem } from '../../../models';\n\n/**\n * Groups items under a title and optional subtitle. Does not create a form control, so child values stay in the\n * parent group.\n *\n * @remarks Registry key: `section`. Config: `title`, `subtitle`, `titleClass` (default `h3`),\n * `subtitleClass` (default `lead`) and `items`.\n */\n@Component({\n selector: 'ngs-forms-form-section',\n templateUrl: './section.component.html',\n imports: [NgsFormsFormItemDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgsFormsFormSectionComponent extends NgsFormsBaseClassItemsContainerBase<NgsFormsFormSectionConfig> implements OnInit {\n static override key = 'section';\n\n /** Creates a `section` item. */\n static create(config: NgsFormsFormSectionConfig): NgsFormsFormItem<NgsFormsFormSectionConfig> {\n return {\n uuid: config.uuid || v4(),\n type: NgsFormsFormSectionComponent.key,\n config: config,\n };\n }\n\n ngOnInit() {\n this.config = ngsDefaults(this.config, sectionConfigDefaults);\n }\n}\n","<div class=\"form-section\">\n <div class=\"form-section-title {{config.titleClass}}\">{{ config.title }}</div>\n @if (config.subtitle) {\n <div class=\"form-section-subtitle {{config.subtitleClass}}\">{{ config.subtitle }}</div>\n }\n @if (config.items.length) {\n <div class=\"form-section-items\">\n @for (item of config.items; track item.uuid) {\n <ng-container [ngs-form-item]=\"item\"></ng-container>\n }\n </div>\n }\n</div>\n","// eslint-disable-next-line @typescript-eslint/no-empty-interface\nimport { NgsFormsFormErrorKeyValueMap } from '../errors';\nimport { Observable } from 'rxjs';\nimport { ValidatorFn } from '@angular/forms';\nimport { NgsFormsFormInputOption } from './form-item-option.model';\nimport { NgsFormsFormItem } from '../form-config';\n\n/** Base configuration shared by every form item (inputs, containers and content items). */\nexport interface NgsFormsFormItemConfigBase {\n /**\n * Stable identifier for the item. Generated with `uuid` by the `create()` factories when omitted.\n * Component state set with `NgsFormsService.updateComponentState()` can be keyed by this value.\n */\n uuid?: string;\n /**\n * Static visibility flag. `false` keeps the item out of the form, as if `visible$` had emitted `false`.\n *\n * @remarks Ignored when `visible$` is also set.\n */\n visible?: boolean;\n /**\n * Stream that controls whether the item is rendered.\n *\n * @remarks When the stream emits `false` the item's component is destroyed and its control is removed from the\n * parent form group, so hidden fields are excluded from the form value and from validation. When it emits `true`\n * the component is created again with a fresh control. Items without `visible$` are always rendered.\n * @example\n * ```ts\n * visible$: this.forms.formValue$.pipe(map((v) => v?.profile?.contactMethod === 'email'))\n * ```\n */\n visible$?: Observable<boolean>;\n /**\n * Initial component state for this item, read by input components through `commonState()`.\n *\n * @remarks Applied when the component is first created, unless state for this item's `uuid` was already set.\n * It takes precedence over state set by `name` and over global state.\n * @example\n * ```ts\n * initialState: { displayMode: 'summary', showEditToggle: true }\n * ```\n */\n initialState?: any;\n}\n\n/**\n * Configuration for items that render a list of child items without creating a form control of their own\n * (for example sections and columns).\n */\nexport interface NgsFormsFormItemContainerConfigBase extends NgsFormsFormItemConfigBase {\n /** The child items to render, in order. */\n items: Array<NgsFormsFormItem<any>>\n}\n\n/**\n * Configuration for `NgsFormsFormGroupComponent`: a named group of child items backed by an `UntypedFormGroup`.\n */\nexport interface NgsFormsFormGroupConfig extends NgsFormsFormItemConfigBaseItemWithNameAndValidators, NgsFormsFormItemContainerConfigBase {}\n\n/** Base configuration for items that own a form control (inputs, groups and arrays). */\nexport interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFormItemConfigBase{\n /**\n * Control name inside the parent form group. Becomes the key of this item's value in `NgsFormsService.formValue$`.\n */\n name: string;\n /**\n * Maps validator error keys (for example `required`, `minlength`, `email`) to the message shown to the user.\n *\n * @remarks Only the first error on the control is displayed. Errors without an entry fall back to\n * `Field is invalid: <errorKey>`. Messages appear once the control is touched or dirty, or after\n * `NgsFormsService.setIsSubmitted(true)`.\n */\n errorMessageMap?: NgsFormsFormErrorKeyValueMap;\n /**\n * Static disabled flag. `true` disables the item's control (and, for groups and arrays, every control inside).\n *\n * @remarks Ignored when `disabled$` is also set. Disabled controls are left out of `NgsFormsService.formValue$`\n * and skip validation, which is how Angular reactive forms treat them.\n */\n disabled?: boolean;\n /**\n * Stream that controls the disabled state. Each emission disables (`true`) or enables (`false`) the control.\n *\n * @example\n * ```ts\n * disabled$: this.forms.formValue$.pipe(map((v) => !v?.profile?.hasCompany))\n * ```\n */\n disabled$?: Observable<boolean>;\n /**\n * Angular validators applied to the item's control. Takes precedence over `validators$` when both are set.\n */\n validators?: Array<ValidatorFn>;\n /**\n * Stream of validator arrays. Each emission replaces the control's validators, which lets rules depend on other\n * values in the form. Ignored when `validators` is also set.\n *\n * @remarks The control's validity is recalculated on its next value change, so call `updateValueAndValidity()`\n * yourself if you need the new rules to apply immediately.\n */\n validators$? :Observable<Array<ValidatorFn>>;\n}\n\n// ---\n\n/** Base configuration for a labelled input control. */\nexport interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {\n /**\n * Element id for the input. When omitted the component generates a unique one.\n *\n * @remarks Must be unique on the page, so avoid it inside form array rows.\n */\n id?: string;\n /** Label text shown next to or above the control. */\n label: string;\n /**\n * Initial value of the control. Applied when the control is created, including when a `visible$` item is shown\n * again.\n */\n value?: unknown;\n}\n\n// ---\n\n/** Base configuration for single line text inputs. */\nexport interface NgsFormsFormItemConfigBaseTextInput extends NgsFormsFormItemConfigBaseInput {\n /** Placeholder text shown while the input is empty. */\n placeholder?: string;\n /**\n * The HTML input type.\n * @defaultValue 'text'\n */\n type?: 'text' | 'email' | 'password'\n}\n\n\n/**\n * Base configuration for inputs that choose from a list of options (radio groups and selects).\n */\nexport interface NgsFormsFormItemConfigBaseInputWithOptions extends NgsFormsFormItemConfigBaseInput {\n /** Static list of options. Used as the initial value when `options$` is also set. */\n options?: Array<NgsFormsFormInputOption>;\n /**\n * Stream of options. Each emission replaces the rendered options, which makes cascading selects and\n * server-loaded option lists possible.\n */\n options$?: Observable<Array<NgsFormsFormInputOption>>;\n}\n// --\n","import { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { NgsFormsColumnComponent } from './components/shared-form-components/column';\nimport { NgsFormsComponentRegistryService } from './services/form-component-registry/form-component-registry.service';\nimport { NgsFormsFormArrayAddItemComponent } from './components/shared-form-components/form-array/add-item';\nimport { NgsFormsFormArrayContainerComponent } from './components/shared-form-components/form-array/container';\nimport { NgsFormsFormArrayListComponent } from './components/shared-form-components/form-array/list';\nimport { NgsFormsFormArrayRemoveItemComponent } from './components/shared-form-components/form-array/remove-item';\nimport { NgsFormsFormSectionComponent } from './components/shared-form-components/section/section.component';\nimport { NgsFormsRowComponent } from './components/shared-form-components/row';\nimport { NgsFormsTextDivComponent } from './components/shared-form-components/text-div';\nimport { NgsFormsFormGroupComponent } from './components/shared-form-components/form-group';\nimport { NgsFormsHtmlContentComponent } from './components/shared-form-components/html-content/html-content.component';\n\n\n/** Registration helpers for the structural components in `@ng-simplicity/forms-core`. */\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule],\n})\nexport class NgsFormsCoreModule {\n /**\n * Registers the structural components: `form-group`, `form-row`, `column`, `form-array`, `form-array-list`,\n * `form-array-add-item`, `form-array-remove-item`, `text-div`, `content-html` and `section`.\n *\n * @remarks The theme packages call this for you from their own `registerAll…` helpers.\n */\n static registerCoreNgsFormComponents(\n registryService: NgsFormsComponentRegistryService\n ) {\n registryService.register(NgsFormsFormGroupComponent.key, NgsFormsFormGroupComponent);\n registryService.register(NgsFormsRowComponent.key, NgsFormsRowComponent);\n registryService.register(\n NgsFormsColumnComponent.key,\n NgsFormsColumnComponent\n );\n registryService.register(\n NgsFormsFormArrayContainerComponent.key,\n NgsFormsFormArrayContainerComponent\n );\n registryService.register(\n NgsFormsFormArrayAddItemComponent.key,\n NgsFormsFormArrayAddItemComponent\n );\n registryService.register(\n NgsFormsFormArrayRemoveItemComponent.key,\n NgsFormsFormArrayRemoveItemComponent\n );\n registryService.register(\n NgsFormsFormArrayListComponent.key,\n NgsFormsFormArrayListComponent\n );\n registryService.register(\n NgsFormsTextDivComponent.key,\n NgsFormsTextDivComponent\n );\n registryService.register(\n NgsFormsHtmlContentComponent.key,\n NgsFormsHtmlContentComponent\n );\n registryService.register(\n NgsFormsFormSectionComponent.key,\n NgsFormsFormSectionComponent\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["uuidv4","i1.NgsFormsFormArrayInternalService"],"mappings":";;;;;;;;AAGA;MAEsB,aAAa,CAAA;AACd,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;IAEvC,aAAa,GAAmB,EAAE;;IAG5C,SAAS,CAAI,WAA0B,EAAE,YAAgC,EAAA;AACvE,QAAA,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;IACpE;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACpB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;AACxB,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;IACtE;wGAdoB,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADlC;;;ACDD;MACa,mBAAmB,GAAG,IAAI,cAAc,CAAC,qBAAqB;AAC3E;;AAEG;MACU,+B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eAAe,CAAC,QAAQ,CACtB,wBAAwB,CAAC,GAAG,EAC5B,wBAAwB,CACzB;QACD,eAAe,CAAC,QAAQ,CACtB,4BAA4B,CAAC,GAAG,EAChC,4BAA4B,CAC7B;QACD,eAAe,CAAC,QAAQ,CACtB,4BAA4B,CAAC,GAAG,EAChC,4BAA4B,CAC7B;IACH;wGA5CW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;AAE7C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAAA,OAAA,EAAA,CAFnB,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAA,EAAA,CAAA;;4FAE7C,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC1D,iBAAA;;;ACnBD;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -55,10 +55,9 @@ interface NgsFormsFormItemConfigBase {
|
|
|
55
55
|
*/
|
|
56
56
|
uuid?: string;
|
|
57
57
|
/**
|
|
58
|
-
* Static visibility flag.
|
|
58
|
+
* Static visibility flag. `false` keeps the item out of the form, as if `visible$` had emitted `false`.
|
|
59
59
|
*
|
|
60
|
-
* @
|
|
61
|
-
* @remarks Reserved for future use: the renderer currently ignores it. Use `visible$` to show or hide an item.
|
|
60
|
+
* @remarks Ignored when `visible$` is also set.
|
|
62
61
|
*/
|
|
63
62
|
visible?: boolean;
|
|
64
63
|
/**
|
|
@@ -74,10 +73,14 @@ interface NgsFormsFormItemConfigBase {
|
|
|
74
73
|
*/
|
|
75
74
|
visible$?: Observable<boolean>;
|
|
76
75
|
/**
|
|
77
|
-
* Initial component state for this item
|
|
76
|
+
* Initial component state for this item, read by input components through `commonState()`.
|
|
78
77
|
*
|
|
79
|
-
* @
|
|
80
|
-
*
|
|
78
|
+
* @remarks Applied when the component is first created, unless state for this item's `uuid` was already set.
|
|
79
|
+
* It takes precedence over state set by `name` and over global state.
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* initialState: { displayMode: 'summary', showEditToggle: true }
|
|
83
|
+
* ```
|
|
81
84
|
*/
|
|
82
85
|
initialState?: any;
|
|
83
86
|
}
|
|
@@ -109,17 +112,19 @@ interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFo
|
|
|
109
112
|
*/
|
|
110
113
|
errorMessageMap?: NgsFormsFormErrorKeyValueMap;
|
|
111
114
|
/**
|
|
112
|
-
* Static disabled flag.
|
|
115
|
+
* Static disabled flag. `true` disables the item's control (and, for groups and arrays, every control inside).
|
|
113
116
|
*
|
|
114
|
-
* @
|
|
115
|
-
*
|
|
117
|
+
* @remarks Ignored when `disabled$` is also set. Disabled controls are left out of `NgsFormsService.formValue$`
|
|
118
|
+
* and skip validation, which is how Angular reactive forms treat them.
|
|
116
119
|
*/
|
|
117
120
|
disabled?: boolean;
|
|
118
121
|
/**
|
|
119
|
-
* Stream that controls the disabled state.
|
|
122
|
+
* Stream that controls the disabled state. Each emission disables (`true`) or enables (`false`) the control.
|
|
120
123
|
*
|
|
121
|
-
* @
|
|
122
|
-
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* disabled$: this.forms.formValue$.pipe(map((v) => !v?.profile?.hasCompany))
|
|
127
|
+
* ```
|
|
123
128
|
*/
|
|
124
129
|
disabled$?: Observable<boolean>;
|
|
125
130
|
/**
|
|
@@ -138,19 +143,16 @@ interface NgsFormsFormItemConfigBaseItemWithNameAndValidators extends NgsFormsFo
|
|
|
138
143
|
/** Base configuration for a labelled input control. */
|
|
139
144
|
interface NgsFormsFormItemConfigBaseInput extends NgsFormsFormItemConfigBaseItemWithNameAndValidators {
|
|
140
145
|
/**
|
|
141
|
-
*
|
|
146
|
+
* Element id for the input. When omitted the component generates a unique one.
|
|
142
147
|
*
|
|
143
|
-
* @
|
|
144
|
-
* @remarks Reserved for future use: the built-in components generate their own ids.
|
|
148
|
+
* @remarks Must be unique on the page, so avoid it inside form array rows.
|
|
145
149
|
*/
|
|
146
150
|
id?: string;
|
|
147
151
|
/** Label text shown next to or above the control. */
|
|
148
152
|
label: string;
|
|
149
153
|
/**
|
|
150
|
-
* Initial value.
|
|
151
|
-
*
|
|
152
|
-
* @notImplemented
|
|
153
|
-
* @remarks Reserved for future use. Set initial values with `NgsFormsService.patchValue()` after the form renders.
|
|
154
|
+
* Initial value of the control. Applied when the control is created, including when a `visible$` item is shown
|
|
155
|
+
* again.
|
|
154
156
|
*/
|
|
155
157
|
value?: unknown;
|
|
156
158
|
}
|
|
@@ -194,8 +196,19 @@ interface NgsFormsFormItem<T extends NgsFormsFormItemConfigBase> {
|
|
|
194
196
|
config: T;
|
|
195
197
|
}
|
|
196
198
|
|
|
199
|
+
/**
|
|
200
|
+
* State that components read through `commonState()`. Set it with `globalState` / `initialState` in the config, or
|
|
201
|
+
* at runtime with `NgsFormsService.updateGlobalState()` and `updateComponentState()`.
|
|
202
|
+
*
|
|
203
|
+
* @remarks The built-in theme components do not read these yet. They are a contract for your own components.
|
|
204
|
+
*/
|
|
197
205
|
interface NgsFormsCommonComponentState {
|
|
206
|
+
/**
|
|
207
|
+
* `input` shows the editable control. `summary` shows a compact, read-only display of the current value, for
|
|
208
|
+
* example to save space on small screens.
|
|
209
|
+
*/
|
|
198
210
|
displayMode?: 'input' | 'summary';
|
|
211
|
+
/** Whether to show a control that lets the user switch between `summary` and `input`. */
|
|
199
212
|
showEditToggle?: boolean;
|
|
200
213
|
}
|
|
201
214
|
|
|
@@ -222,19 +235,30 @@ interface NgsFormsFormConfig<T = NgsFormsFormItem<any>> {
|
|
|
222
235
|
* @remarks Reserved for future use: values currently update on every change.
|
|
223
236
|
*/
|
|
224
237
|
inputUpdateDebounce: number;
|
|
225
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* Initial state shared by every component in the form. Applied each time `setFormConfig()` is called; change it
|
|
240
|
+
* later with `NgsFormsService.updateGlobalState()`.
|
|
241
|
+
*/
|
|
226
242
|
globalState: NgsFormsGlobalFormState;
|
|
227
243
|
/**
|
|
228
244
|
* The root item, usually an `NgsFormsFormGroupComponent`, whose form group backs the whole form.
|
|
229
245
|
*/
|
|
230
246
|
root: T;
|
|
231
247
|
/**
|
|
232
|
-
* Initial
|
|
248
|
+
* Initial state for individual components, keyed by item `uuid` or control `name`.
|
|
233
249
|
*
|
|
234
|
-
* @
|
|
235
|
-
*
|
|
250
|
+
* @remarks Applied each time `setFormConfig()` is called, together with `globalState`. Same as calling
|
|
251
|
+
* `NgsFormsService.updateComponentState(key, state)` for each entry before the form renders.
|
|
252
|
+
* @example
|
|
253
|
+
* ```ts
|
|
254
|
+
* initialState: { email: { displayMode: 'input' } }
|
|
255
|
+
* ```
|
|
236
256
|
*/
|
|
237
|
-
initialState?:
|
|
257
|
+
initialState?: {
|
|
258
|
+
[componentKey: string]: NgsFormsCommonComponentState & {
|
|
259
|
+
[key: string]: any;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
238
262
|
}
|
|
239
263
|
|
|
240
264
|
/**
|
|
@@ -246,7 +270,10 @@ interface NgsFormsFormConfig<T = NgsFormsFormItem<any>> {
|
|
|
246
270
|
declare abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItemConfigBase> extends NgsSubscriber {
|
|
247
271
|
/** Registry key the component is registered under. */
|
|
248
272
|
static key: string;
|
|
249
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Element id for this component, handy for `id` and `for` attributes. The config's `id` when it sets one,
|
|
275
|
+
* otherwise a generated unique id.
|
|
276
|
+
*/
|
|
250
277
|
id: string;
|
|
251
278
|
/** The item's configuration. */
|
|
252
279
|
protected config: T;
|
|
@@ -258,8 +285,9 @@ declare abstract class NgsFormsBaseClassFormComponent<T extends NgsFormsFormItem
|
|
|
258
285
|
}
|
|
259
286
|
|
|
260
287
|
/**
|
|
261
|
-
* Base class for items that own a form control. Creates the control
|
|
262
|
-
*
|
|
288
|
+
* Base class for items that own a form control. Creates the control (seeded with `value` when the config has one),
|
|
289
|
+
* applies `validators` / `validators$` and `disabled` / `disabled$`, registers it with the parent group under
|
|
290
|
+
* `config.name` and keeps `errorMessage` up to date.
|
|
263
291
|
*/
|
|
264
292
|
declare class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFormItemConfigBaseItemWithNameAndValidators> extends NgsFormsBaseClassFormComponent<T> implements OnInit, OnDestroy {
|
|
265
293
|
/** The item's form control. Bind it with `[formControl]`. */
|
|
@@ -274,10 +302,14 @@ declare class NgsFormsFormItemWithVisibleAndValidatorsBase<T extends NgsFormsFor
|
|
|
274
302
|
private changeDetectorRef;
|
|
275
303
|
/** Whether the form has been marked as submitted with `NgsFormsService.setIsSubmitted()`. */
|
|
276
304
|
readonly submitted: Signal<boolean>;
|
|
305
|
+
/** The latest value of `disabled` / `disabled$`, or `undefined` when the config sets neither. */
|
|
306
|
+
private disabledFromConfig;
|
|
277
307
|
ngOnInit(): void;
|
|
278
308
|
private updateErrorMessage;
|
|
279
309
|
ngOnDestroy(): void;
|
|
280
310
|
private bindValidators;
|
|
311
|
+
private bindDisabled;
|
|
312
|
+
private applyDisabled;
|
|
281
313
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsFormItemWithVisibleAndValidatorsBase<any>, never>;
|
|
282
314
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgsFormsFormItemWithVisibleAndValidatorsBase<any>, never, never, {}, {}, never, never, true, never>;
|
|
283
315
|
}
|
|
@@ -324,9 +356,15 @@ declare class NgsFormsInternalService {
|
|
|
324
356
|
checkIsValid(): boolean;
|
|
325
357
|
setFormData(formConfig: NgsFormsFormConfig): void;
|
|
326
358
|
private mergeState;
|
|
359
|
+
/** Sets a component's state from its config's `initialState`, unless state for `uuid` already exists. */
|
|
360
|
+
seedComponentState(uuid: string, initialState: any): void;
|
|
327
361
|
updateGlobalState(state: NgsFormsGlobalFormState): void;
|
|
328
362
|
updateComponentState(componentKey: string, state: any): void;
|
|
329
|
-
|
|
363
|
+
/**
|
|
364
|
+
* Merged state for one component: its own (by `uuid`), then by `name`, then global.
|
|
365
|
+
* `initialState` seeds the component's own state unless state for `uuid` already exists.
|
|
366
|
+
*/
|
|
367
|
+
subscribeToState(uuid: string, name?: string, initialState?: any): rxjs.Observable<any>;
|
|
330
368
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsInternalService, never>;
|
|
331
369
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgsFormsInternalService>;
|
|
332
370
|
}
|
|
@@ -418,11 +456,10 @@ declare abstract class NgsFormsBaseClassFormInputComponent<T extends NgsFormsFor
|
|
|
418
456
|
/** Merged state for this component: its own state, then state by name, then global state. */
|
|
419
457
|
readonly commonState: Signal<NgsFormsCommonComponentState>;
|
|
420
458
|
/**
|
|
421
|
-
* Switches between input and summary display.
|
|
422
|
-
*
|
|
423
|
-
* @notImplemented
|
|
459
|
+
* Switches this component between `input` and `summary` display by updating its own state.
|
|
460
|
+
* With no argument it flips the current mode.
|
|
424
461
|
*/
|
|
425
|
-
toggleDisplayMode(setTo
|
|
462
|
+
toggleDisplayMode(setTo?: 'summary' | 'input'): void;
|
|
426
463
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgsFormsBaseClassFormInputComponent<any>, never>;
|
|
427
464
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgsFormsBaseClassFormInputComponent<any>, never, never, {}, {}, never, never, true, never>;
|
|
428
465
|
}
|
|
@@ -663,13 +700,6 @@ interface NgsFormItemArrayAddItemConfig extends NgsFormsFormItemConfigBase {
|
|
|
663
700
|
buttonClass?: string;
|
|
664
701
|
/** Class of an `<i>` icon shown before the label, for example `bi bi-plus`. */
|
|
665
702
|
buttonIcon?: string;
|
|
666
|
-
/**
|
|
667
|
-
* Callback after a row is added.
|
|
668
|
-
*
|
|
669
|
-
* @notImplemented
|
|
670
|
-
* @remarks Reserved for future use.
|
|
671
|
-
*/
|
|
672
|
-
onAddItem?: () => void;
|
|
673
703
|
}
|
|
674
704
|
|
|
675
705
|
/** Configuration for `NgsFormsFormArrayContainerComponent`. */
|
|
@@ -785,13 +815,6 @@ interface NgsFormItemArrayRemoveItemConfig extends NgsFormsFormItemConfigBase {
|
|
|
785
815
|
buttonClass?: string;
|
|
786
816
|
/** Class of an `<i>` icon shown before the label, for example `bi bi-trash`. */
|
|
787
817
|
buttonIcon?: string;
|
|
788
|
-
/**
|
|
789
|
-
* Callback after a row is removed.
|
|
790
|
-
*
|
|
791
|
-
* @notImplemented
|
|
792
|
-
* @remarks Reserved for future use.
|
|
793
|
-
*/
|
|
794
|
-
onRemoveItem?: () => void;
|
|
795
818
|
}
|
|
796
819
|
|
|
797
820
|
/**
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-simplicity/forms-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/BryanGWalsh/NgSimplicityForms.git",
|
|
8
8
|
"directory": "libs/forms-core"
|
|
9
9
|
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
10
13
|
"peerDependencies": {
|
|
11
14
|
"@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|
|
12
15
|
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
|