@ng-forge/dynamic-forms 0.8.0-next.4 → 0.8.0-next.5
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/fesm2022/{ng-forge-dynamic-forms-array-field.component-CJ_OclbR.mjs → ng-forge-dynamic-forms-array-field.component-DWhbvZUO.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-array-field.component-CJ_OclbR.mjs.map → ng-forge-dynamic-forms-array-field.component-DWhbvZUO.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-container-field.component-DQ_OQLtx.mjs → ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs} +4 -9
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-container-utils-zQSTe7Jk.mjs → ng-forge-dynamic-forms-container-utils-DXRcEEkE.mjs} +4 -5
- package/fesm2022/ng-forge-dynamic-forms-container-utils-DXRcEEkE.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-2fdmbtL7.mjs → ng-forge-dynamic-forms-css-wrapper.component-ClFdxZV4.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-2fdmbtL7.mjs.map → ng-forge-dynamic-forms-css-wrapper.component-ClFdxZV4.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-pCNwBRRm.mjs → ng-forge-dynamic-forms-emit-initialization-CTpgJ-02.mjs} +3 -3
- package/fesm2022/ng-forge-dynamic-forms-emit-initialization-CTpgJ-02.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-BdLdSEHj.mjs → ng-forge-dynamic-forms-group-field.component-clrQsUyY.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-group-field.component-BdLdSEHj.mjs.map → ng-forge-dynamic-forms-group-field.component-clrQsUyY.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs +3 -4
- package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-BdMxsqmk.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs} +492 -394
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs.map +1 -0
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-C5rUo80O.mjs → ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs} +3 -3
- package/fesm2022/{ng-forge-dynamic-forms-page-field.component-C5rUo80O.mjs.map → ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs.map} +1 -1
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-lvuyTM1r.mjs → ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs} +2 -2
- package/fesm2022/{ng-forge-dynamic-forms-text-field.component-lvuyTM1r.mjs.map → ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs.map} +1 -1
- package/fesm2022/ng-forge-dynamic-forms.mjs +1 -1
- package/package.json +1 -1
- package/types/ng-forge-dynamic-forms-integration.d.ts +3 -4
- package/types/ng-forge-dynamic-forms.d.ts +68 -27
- package/fesm2022/ng-forge-dynamic-forms-container-field.component-DQ_OQLtx.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-container-utils-zQSTe7Jk.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-emit-initialization-pCNwBRRm.mjs.map +0 -1
- package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-BdMxsqmk.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, DestroyRef, Injector, EnvironmentInjector, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { i as injectFieldRegistry, E as EventBus, D as DynamicFormLogger, v as validatePageNesting, d as derivedFromDeferred, c as createFieldResolutionPipe, f as DfFieldOutlet } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-
|
|
3
|
+
import { i as injectFieldRegistry, E as EventBus, D as DynamicFormLogger, v as validatePageNesting, d as derivedFromDeferred, c as createFieldResolutionPipe, f as DfFieldOutlet } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs';
|
|
4
4
|
import { outputFromObservable } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { explicitEffect } from 'ngxtension/explicit-effect';
|
|
6
|
-
import { c as computeContainerHostClasses, s as setupContainerInitEffect } from './ng-forge-dynamic-forms-container-utils-
|
|
6
|
+
import { c as computeContainerHostClasses, s as setupContainerInitEffect } from './ng-forge-dynamic-forms-container-utils-DXRcEEkE.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders a single page in multi-page (wizard) forms.
|
|
@@ -107,4 +107,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
107
107
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: true }] }], isVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isVisible", required: true }] }], nextPage: [{ type: i0.Output, args: ["nextPage"] }], previousPage: [{ type: i0.Output, args: ["previousPage"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }] } });
|
|
108
108
|
|
|
109
109
|
export { PageFieldComponent as default };
|
|
110
|
-
//# sourceMappingURL=ng-forge-dynamic-forms-page-field.component-
|
|
110
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-page-field.component-C5rUo80O.mjs","sources":["../../../../packages/dynamic-forms/src/lib/fields/page/page-field.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, DestroyRef, EnvironmentInjector, inject, Injector, input } from '@angular/core';\nimport { DfFieldOutlet } from '../../directives/df-field-outlet.directive';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { explicitEffect } from 'ngxtension/explicit-effect';\nimport { derivedFromDeferred } from '../../utils/derived-from-deferred/derived-from-deferred';\nimport { createFieldResolutionPipe, ResolvedField } from '../../utils/resolve-field/resolve-field';\nimport { computeContainerHostClasses, setupContainerInitEffect } from '../../utils/container-utils/container-utils';\nimport { PageField, validatePageNesting } from '../../definitions/default/page-field';\nimport { injectFieldRegistry } from '../../utils/inject-field-registry/inject-field-registry';\nimport { EventBus } from '../../events/event.bus';\nimport { NextPageEvent, PageChangeEvent, PreviousPageEvent } from '../../events/constants';\nimport { FieldDef } from '../../definitions/base/field-def';\nimport { DynamicFormLogger } from '../../providers/features/logger/logger.token';\n\n/**\n * Renders a single page in multi-page (wizard) forms.\n *\n * Visibility is controlled by the PageOrchestrator via the isVisible input.\n * Pages cannot be nested within other pages - validation prevents this.\n * Field values are flattened into the parent form (no nesting under page key).\n */\n@Component({\n selector: 'section[page-field]',\n imports: [DfFieldOutlet],\n template: `\n @for (field of resolvedFields(); track field.key) {\n <ng-container *dfFieldOutlet=\"field; environmentInjector: environmentInjector\" />\n }\n `,\n styleUrl: './page-field.component.scss',\n host: {\n '[class]': 'hostClasses()',\n '[class.disabled]': 'disabled()',\n '[class.df-page-visible]': 'isVisible()',\n '[class.df-page-hidden]': '!isVisible()',\n '[attr.aria-hidden]': '!isVisible()',\n '[attr.data-page-index]': 'pageIndex()',\n '[id]': '`${key()}`',\n '[attr.data-testid]': 'key()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class PageFieldComponent {\n // ─────────────────────────────────────────────────────────────────────────────\n // Dependencies\n // ─────────────────────────────────────────────────────────────────────────────\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly fieldRegistry = injectFieldRegistry();\n private readonly injector = inject(Injector);\n protected readonly environmentInjector = inject(EnvironmentInjector);\n private readonly eventBus = inject(EventBus);\n private readonly logger = inject(DynamicFormLogger);\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Inputs\n // ─────────────────────────────────────────────────────────────────────────────\n\n field = input.required<PageField>();\n key = input.required<string>();\n className = input<string>();\n pageIndex = input.required<number>();\n isVisible = input.required<boolean>();\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Computed Signals\n // ─────────────────────────────────────────────────────────────────────────────\n\n readonly hostClasses = computed(() => computeContainerHostClasses('page-field', this.className()));\n\n readonly disabled = computed(() => this.field().disabled || false);\n\n readonly isValid = computed(() => validatePageNesting(this.field()));\n\n private readonly rawFieldRegistry = computed(() => this.fieldRegistry.raw);\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Outputs\n // ─────────────────────────────────────────────────────────────────────────────\n\n readonly nextPage = outputFromObservable(this.eventBus.on<NextPageEvent>('next-page'));\n readonly previousPage = outputFromObservable(this.eventBus.on<PreviousPageEvent>('previous-page'));\n readonly pageChange = outputFromObservable(this.eventBus.on<PageChangeEvent>('page-change'));\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Field Resolution\n // ─────────────────────────────────────────────────────────────────────────────\n\n private readonly fieldsSource = computed(() => {\n if (!this.isValid()) {\n return [];\n }\n return this.field().fields || [];\n });\n\n protected readonly resolvedFields = derivedFromDeferred(\n this.fieldsSource,\n createFieldResolutionPipe(() => ({\n loadTypeComponent: (type: string) => this.fieldRegistry.loadTypeComponent(type),\n registry: this.rawFieldRegistry(),\n injector: this.injector,\n destroyRef: this.destroyRef,\n onError: (fieldDef: FieldDef<unknown>, error: unknown) => {\n const fieldKey = fieldDef.key || '<no key>';\n this.logger.error(\n `Failed to load component for field type '${fieldDef.type}' (key: ${fieldKey}) ` +\n `within page '${this.field().key}'. Ensure the field type is registered in your field registry.`,\n error,\n );\n },\n })),\n { initialValue: [] as ResolvedField[], injector: this.injector },\n );\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────────\n\n constructor() {\n this.setupEffects();\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────────\n\n private setupEffects(): void {\n setupContainerInitEffect(this.resolvedFields, this.eventBus, 'page', () => this.field().key, this.injector);\n\n explicitEffect([this.isValid, this.field], ([valid, pageField]) => {\n if (!valid) {\n this.logger.error(\n `Invalid configuration: Page '${pageField.key}' contains nested page fields. ` +\n `Pages cannot contain other pages. Consider using groups or rows for nested structure.`,\n pageField,\n );\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;AAcA;;;;;;AAMG;AAsBW,MAAO,kBAAkB,CAAA;;;;AAKpB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,aAAa,GAAG,mBAAmB,EAAE;AACrC,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzB,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACnD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;;AAMnD,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAa;AACnC,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,yEAAU;IAC9B,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAC3B,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAU;AACpC,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAW;;;;AAM5B,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,2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AA,QAAA,EAlB3B;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,gsLAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EALS,aAAa,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,kCAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAmBJ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBArBtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,OAAA,EACtB,CAAC,aAAa,CAAC,EAAA,QAAA,EACd;;;;GAIT,EAAA,IAAA,EAEK;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC1B,wBAAA,kBAAkB,EAAE,YAAY;AAChC,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,wBAAwB,EAAE,cAAc;AACxC,wBAAA,oBAAoB,EAAE,cAAc;AACpC,wBAAA,wBAAwB,EAAE,aAAa;AACvC,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,oBAAoB,EAAE,OAAO;qBAC9B,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,gsLAAA,CAAA,EAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs","sources":["../../../../packages/dynamic-forms/src/lib/fields/page/page-field.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, DestroyRef, EnvironmentInjector, inject, Injector, input } from '@angular/core';\nimport { DfFieldOutlet } from '../../directives/df-field-outlet.directive';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { explicitEffect } from 'ngxtension/explicit-effect';\nimport { derivedFromDeferred } from '../../utils/derived-from-deferred/derived-from-deferred';\nimport { createFieldResolutionPipe, ResolvedField } from '../../utils/resolve-field/resolve-field';\nimport { computeContainerHostClasses, setupContainerInitEffect } from '../../utils/container-utils/container-utils';\nimport { PageField, validatePageNesting } from '../../definitions/default/page-field';\nimport { injectFieldRegistry } from '../../utils/inject-field-registry/inject-field-registry';\nimport { EventBus } from '../../events/event.bus';\nimport { NextPageEvent, PageChangeEvent, PreviousPageEvent } from '../../events/constants';\nimport { FieldDef } from '../../definitions/base/field-def';\nimport { DynamicFormLogger } from '../../providers/features/logger/logger.token';\n\n/**\n * Renders a single page in multi-page (wizard) forms.\n *\n * Visibility is controlled by the PageOrchestrator via the isVisible input.\n * Pages cannot be nested within other pages - validation prevents this.\n * Field values are flattened into the parent form (no nesting under page key).\n */\n@Component({\n selector: 'section[page-field]',\n imports: [DfFieldOutlet],\n template: `\n @for (field of resolvedFields(); track field.key) {\n <ng-container *dfFieldOutlet=\"field; environmentInjector: environmentInjector\" />\n }\n `,\n styleUrl: './page-field.component.scss',\n host: {\n '[class]': 'hostClasses()',\n '[class.disabled]': 'disabled()',\n '[class.df-page-visible]': 'isVisible()',\n '[class.df-page-hidden]': '!isVisible()',\n '[attr.aria-hidden]': '!isVisible()',\n '[attr.data-page-index]': 'pageIndex()',\n '[id]': '`${key()}`',\n '[attr.data-testid]': 'key()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class PageFieldComponent {\n // ─────────────────────────────────────────────────────────────────────────────\n // Dependencies\n // ─────────────────────────────────────────────────────────────────────────────\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly fieldRegistry = injectFieldRegistry();\n private readonly injector = inject(Injector);\n protected readonly environmentInjector = inject(EnvironmentInjector);\n private readonly eventBus = inject(EventBus);\n private readonly logger = inject(DynamicFormLogger);\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Inputs\n // ─────────────────────────────────────────────────────────────────────────────\n\n field = input.required<PageField>();\n key = input.required<string>();\n className = input<string>();\n pageIndex = input.required<number>();\n isVisible = input.required<boolean>();\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Computed Signals\n // ─────────────────────────────────────────────────────────────────────────────\n\n readonly hostClasses = computed(() => computeContainerHostClasses('page-field', this.className()));\n\n readonly disabled = computed(() => this.field().disabled || false);\n\n readonly isValid = computed(() => validatePageNesting(this.field()));\n\n private readonly rawFieldRegistry = computed(() => this.fieldRegistry.raw);\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Outputs\n // ─────────────────────────────────────────────────────────────────────────────\n\n readonly nextPage = outputFromObservable(this.eventBus.on<NextPageEvent>('next-page'));\n readonly previousPage = outputFromObservable(this.eventBus.on<PreviousPageEvent>('previous-page'));\n readonly pageChange = outputFromObservable(this.eventBus.on<PageChangeEvent>('page-change'));\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Field Resolution\n // ─────────────────────────────────────────────────────────────────────────────\n\n private readonly fieldsSource = computed(() => {\n if (!this.isValid()) {\n return [];\n }\n return this.field().fields || [];\n });\n\n protected readonly resolvedFields = derivedFromDeferred(\n this.fieldsSource,\n createFieldResolutionPipe(() => ({\n loadTypeComponent: (type: string) => this.fieldRegistry.loadTypeComponent(type),\n registry: this.rawFieldRegistry(),\n injector: this.injector,\n destroyRef: this.destroyRef,\n onError: (fieldDef: FieldDef<unknown>, error: unknown) => {\n const fieldKey = fieldDef.key || '<no key>';\n this.logger.error(\n `Failed to load component for field type '${fieldDef.type}' (key: ${fieldKey}) ` +\n `within page '${this.field().key}'. Ensure the field type is registered in your field registry.`,\n error,\n );\n },\n })),\n { initialValue: [] as ResolvedField[], injector: this.injector },\n );\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Constructor\n // ─────────────────────────────────────────────────────────────────────────────\n\n constructor() {\n this.setupEffects();\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // Private Methods\n // ─────────────────────────────────────────────────────────────────────────────\n\n private setupEffects(): void {\n setupContainerInitEffect(this.resolvedFields, this.eventBus, 'page', () => this.field().key, this.injector);\n\n explicitEffect([this.isValid, this.field], ([valid, pageField]) => {\n if (!valid) {\n this.logger.error(\n `Invalid configuration: Page '${pageField.key}' contains nested page fields. ` +\n `Pages cannot contain other pages. Consider using groups or rows for nested structure.`,\n pageField,\n );\n }\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;AAcA;;;;;;AAMG;AAsBW,MAAO,kBAAkB,CAAA;;;;AAKpB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,aAAa,GAAG,mBAAmB,EAAE;AACrC,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzB,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACnD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;;;;AAMnD,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAa;AACnC,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,yEAAU;IAC9B,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAC3B,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAU;AACpC,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,+EAAW;;;;AAM5B,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,2BAA2B,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,kFAAC;AAEzF,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,IAAI,KAAK,+EAAC;AAEzD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,8EAAC;AAEnD,IAAA,gBAAgB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,EAA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AAA,UAAA,EAAA,CAAA;kBArBtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAAA,OAAA,EACtB,CAAC,aAAa,CAAC,EAAA,QAAA,EACd;;;;GAIT,EAAA,IAAA,EAEK;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC1B,wBAAA,kBAAkB,EAAE,YAAY;AAChC,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,wBAAwB,EAAE,cAAc;AACxC,wBAAA,oBAAoB,EAAE,cAAc;AACpC,wBAAA,wBAAwB,EAAE,aAAa;AACvC,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,oBAAoB,EAAE,OAAO;qBAC9B,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,gsLAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { AsyncPipe } from '@angular/common';
|
|
4
|
-
import { u as DynamicTextPipe } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-
|
|
4
|
+
import { u as DynamicTextPipe } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs';
|
|
5
5
|
|
|
6
6
|
class TextFieldComponent {
|
|
7
7
|
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
@@ -116,4 +116,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
116
116
|
}], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
117
117
|
|
|
118
118
|
export { TextFieldComponent as default };
|
|
119
|
-
//# sourceMappingURL=ng-forge-dynamic-forms-text-field.component-
|
|
119
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-text-field.component-
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs","sources":["../../../../packages/dynamic-forms/src/lib/fields/text/text-field.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { AsyncPipe } from '@angular/common';\nimport { DynamicTextPipe } from '../../pipes/dynamic-text/dynamic-text.pipe';\nimport { TextProps } from '../../definitions/default/text-field';\nimport { DynamicText } from '../../models/types/dynamic-text';\n\n@Component({\n selector: 'df-text',\n template: `\n @switch (elementType()) {\n @case ('p') {\n <p class=\"df-text df-text-p\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </p>\n }\n @case ('h1') {\n <h1 class=\"df-text df-text-h1\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h1>\n }\n @case ('h2') {\n <h2 class=\"df-text df-text-h2\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h2>\n }\n @case ('h3') {\n <h3 class=\"df-text df-text-h3\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h3>\n }\n @case ('h4') {\n <h4 class=\"df-text df-text-h4\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h4>\n }\n @case ('h5') {\n <h5 class=\"df-text df-text-h5\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h5>\n }\n @case ('h6') {\n <h6 class=\"df-text df-text-h6\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </h6>\n }\n @case ('span') {\n <span class=\"df-text df-text-span\" [class]=\"className() || ''\">\n {{ label() | dynamicText | async }}\n </span>\n }\n @default {\n never;\n }\n }\n `,\n styleUrl: './text-field.component.scss',\n imports: [AsyncPipe, DynamicTextPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[id]': '`${key()}`',\n '[attr.data-testid]': 'key()',\n '[attr.hidden]': 'hidden() || null',\n },\n})\nexport default class TextFieldComponent {\n readonly key = input.required<string>();\n readonly label = input.required<DynamicText>();\n readonly className = input<string>();\n readonly tabIndex = input<number>();\n readonly hidden = input<boolean>();\n readonly props = input<TextProps>();\n\n readonly elementType = computed(() => this.props()?.elementType || 'p');\n}\n"],"names":[],"mappings":";;;;;AAgEc,MAAO,kBAAkB,CAAA;AAC5B,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,yEAAU;AAC9B,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAe;IACrC,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAC3B,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IAC1B,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAW;IACzB,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAa;AAE1B,IAAA,WAAW,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,WAAW,IAAI,GAAG,kFAAC;uGARpD,kBAAkB,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A,kBAAA,EAAA,OAAA,EAAA,aAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAxD3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CT,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,y/CAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAES,SAAS,yCAAE,eAAe,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAQjB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBA1DtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,EAAA,QAAA,EACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CT,EAAA,OAAA,EAEQ,CAAC,SAAS,EAAE,eAAe,CAAC,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,MAAM,EAAE,YAAY;AACpB,wBAAA,oBAAoB,EAAE,OAAO;AAC7B,wBAAA,eAAe,EAAE,kBAAkB;AACpC,qBAAA,EAAA,MAAA,EAAA,CAAA,y/CAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ARRAY_CONTEXT, x as AppendArrayItemEvent, B as BUILT_IN_FIELDS, y as ConsoleLogger, z as DEFAULT_PROPS, G as DEFAULT_VALIDATION_MESSAGES, a as DEFAULT_WRAPPERS, H as DynamicForm, I as DynamicFormError, D as DynamicFormLogger, u as DynamicTextPipe, E as EventBus, J as EventDispatcher, K as FIELD_REGISTRY, F as FIELD_SIGNAL_CONTEXT, L as FORM_OPTIONS, M as FormClearEvent, N as FormResetEvent, O as INITIALIZATION_TIMEOUT_MS, P as InsertArrayItemEvent, Q as MoveArrayItemEvent, S as NextPageEvent, T as NoopLogger, U as PageChangeEvent, V as PopArrayItemEvent, X as PrependArrayItemEvent, Y as PreviousPageEvent, Z as RemoveAtIndexEvent, R as RootFormRegistryService, _ as ShiftArrayItemEvent, $ as SubmitEvent, a0 as WRAPPER_REGISTRY, a1 as applyMetaToElement, a2 as applyValidator, a3 as applyValidators, a4 as arrayEvent, a5 as arrayFieldMapper, a6 as baseFieldMapper, a7 as buildBaseInputs, a8 as containerFieldMapper, a9 as createField, aa as createWrappers, w as dynamicTextToObservable, ab as evaluateNonFieldDisabled, ac as evaluateNonFieldHidden, ad as field, ae as formConfig, af as getArrayLength, ag as groupFieldMapper, ah as hasFormValue, ai as interpolateParams, aj as isArrayField, ak as isCheckedField, al as isContainerField, am as isContainerTypedField, an as isDisplayOnlyField, g as isEqual, ao as isFormStateCondition, q as isGroupField, ap as isLeafField, aq as isPageField, ar as isRowField, as as isSimplifiedArrayField, at as isValueBearingField, au as isValueField, av as isWrapperTypeDefinition, aw as isWrappersBundle, ax as omit, ay as pageFieldMapper, az as provideDynamicForm, aA as resolveNextButtonDisabled, aB as resolveNonFieldDisabled, aC as resolveNonFieldHidden, aD as resolveSubmitButtonDisabled, aE as resolveTokens, aF as rowFieldMapper, aG as textFieldMapper, aH as toReadonlyFieldTree, aI as withEventFormValue, aJ as withLoggerConfig, aK as withPreviousValue, aL as withValueExclusionDefaults, aM as wrapperProps } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-
|
|
1
|
+
export { A as ARRAY_CONTEXT, x as AppendArrayItemEvent, B as BUILT_IN_FIELDS, y as ConsoleLogger, z as DEFAULT_PROPS, G as DEFAULT_VALIDATION_MESSAGES, a as DEFAULT_WRAPPERS, H as DynamicForm, I as DynamicFormError, D as DynamicFormLogger, u as DynamicTextPipe, E as EventBus, J as EventDispatcher, K as FIELD_REGISTRY, F as FIELD_SIGNAL_CONTEXT, L as FORM_OPTIONS, M as FormClearEvent, N as FormResetEvent, O as INITIALIZATION_TIMEOUT_MS, P as InsertArrayItemEvent, Q as MoveArrayItemEvent, S as NextPageEvent, T as NoopLogger, U as PageChangeEvent, V as PopArrayItemEvent, X as PrependArrayItemEvent, Y as PreviousPageEvent, Z as RemoveAtIndexEvent, R as RootFormRegistryService, _ as ShiftArrayItemEvent, $ as SubmitEvent, a0 as WRAPPER_REGISTRY, a1 as applyMetaToElement, a2 as applyValidator, a3 as applyValidators, a4 as arrayEvent, a5 as arrayFieldMapper, a6 as baseFieldMapper, a7 as buildBaseInputs, a8 as containerFieldMapper, a9 as createField, aa as createWrappers, w as dynamicTextToObservable, ab as evaluateNonFieldDisabled, ac as evaluateNonFieldHidden, ad as field, ae as formConfig, af as getArrayLength, ag as groupFieldMapper, ah as hasFormValue, ai as interpolateParams, aj as isArrayField, ak as isCheckedField, al as isContainerField, am as isContainerTypedField, an as isDisplayOnlyField, g as isEqual, ao as isFormStateCondition, q as isGroupField, ap as isLeafField, aq as isPageField, ar as isRowField, as as isSimplifiedArrayField, at as isValueBearingField, au as isValueField, av as isWrapperTypeDefinition, aw as isWrappersBundle, ax as omit, ay as pageFieldMapper, az as provideDynamicForm, aA as resolveNextButtonDisabled, aB as resolveNonFieldDisabled, aC as resolveNonFieldHidden, aD as resolveSubmitButtonDisabled, aE as resolveTokens, aF as rowFieldMapper, aG as textFieldMapper, aH as toReadonlyFieldTree, aI as withEventFormValue, aJ as withLoggerConfig, aK as withPreviousValue, aL as withValueExclusionDefaults, aM as wrapperProps } from './ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs';
|
|
2
2
|
//# sourceMappingURL=ng-forge-dynamic-forms.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/dynamic-forms",
|
|
3
|
-
"version": "0.8.0-next.
|
|
3
|
+
"version": "0.8.0-next.5",
|
|
4
4
|
"description": "Type-safe, signal-powered dynamic forms for Angular. Build complex forms from configuration with full TypeScript inference.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -451,11 +451,10 @@ declare function buildValueFieldInputs<TProps, TValue = unknown>(fieldDef: BaseV
|
|
|
451
451
|
* - The field tree updates reactively when the root form structure changes
|
|
452
452
|
* - Newly added array items will get their field tree once the form value updates
|
|
453
453
|
*
|
|
454
|
-
* For fields with specific properties
|
|
455
|
-
* -
|
|
454
|
+
* For fields with specific properties, use the specialized mappers:
|
|
455
|
+
* - optionsFieldMapper: for fields with options (select, radio, multi-checkbox)
|
|
456
456
|
* - datepickerFieldMapper: for fields with minDate, maxDate, startAt
|
|
457
|
-
* -
|
|
458
|
-
* - sliderFieldMapper: for fields with minValue, maxValue, step
|
|
457
|
+
* - checkboxFieldMapper: for boolean fields (checkbox, toggle)
|
|
459
458
|
*
|
|
460
459
|
* @param fieldDef The value field definition
|
|
461
460
|
* @returns Signal containing Record of input names to values for ngComponentOutlet
|
|
@@ -1210,6 +1210,11 @@ interface HttpDerivationBase extends SharedDerivationFields {
|
|
|
1210
1210
|
/**
|
|
1211
1211
|
* Explicit field dependencies. Required for HTTP derivations to prevent
|
|
1212
1212
|
* wildcard triggering on every keystroke.
|
|
1213
|
+
*
|
|
1214
|
+
* The wildcard token `'*'` is rejected. The structural token `'$group'`
|
|
1215
|
+
* (and `'$group.X'`) is allowed and resolves to the field's parent container
|
|
1216
|
+
* path — be aware this fires whenever any sibling under that group changes,
|
|
1217
|
+
* so the caller owns the request frequency (consider `trigger: 'debounced'`).
|
|
1213
1218
|
*/
|
|
1214
1219
|
dependsOn: string[];
|
|
1215
1220
|
/**
|
|
@@ -1261,6 +1266,12 @@ interface AsyncFunctionDerivationBase extends SharedDerivationFields {
|
|
|
1261
1266
|
/**
|
|
1262
1267
|
* Explicit field dependencies. Required for async derivations to prevent
|
|
1263
1268
|
* wildcard triggering on every form change.
|
|
1269
|
+
*
|
|
1270
|
+
* The wildcard token `'*'` is rejected. The structural token `'$group'`
|
|
1271
|
+
* (and `'$group.X'`) is allowed and resolves to the field's parent container
|
|
1272
|
+
* path — be aware this fires whenever any sibling under that group changes,
|
|
1273
|
+
* so the caller owns the invocation frequency (handle this via
|
|
1274
|
+
* `trigger: 'debounced'` or via debouncing inside the async function).
|
|
1264
1275
|
*/
|
|
1265
1276
|
dependsOn: string[];
|
|
1266
1277
|
value?: never;
|
|
@@ -1946,6 +1957,35 @@ interface EvaluationContext<TValue = unknown, TFormValue extends Record<string,
|
|
|
1946
1957
|
customFunctions?: Record<string, (context: EvaluationContext) => unknown>;
|
|
1947
1958
|
/** Logger for diagnostic output */
|
|
1948
1959
|
logger: Logger;
|
|
1960
|
+
/**
|
|
1961
|
+
* Value of the field's nearest parent **group** (or array item, when the
|
|
1962
|
+
* field has no inner group above the array boundary).
|
|
1963
|
+
*
|
|
1964
|
+
* Complements `formValue` and `fieldValue` for derivations on fields nested
|
|
1965
|
+
* inside groups built by factory helpers, where the parent group's key
|
|
1966
|
+
* isn't known at config-authoring time. Mirrors the runtime semantics of
|
|
1967
|
+
* the `'$group'` token used in `dependsOn`.
|
|
1968
|
+
*
|
|
1969
|
+
* Resolution at evaluation time:
|
|
1970
|
+
* - Inside a group at form root: the parent group's value object (e.g.,
|
|
1971
|
+
* for `address.state`, `groupValue === formValue.address`).
|
|
1972
|
+
* - Inside nested groups: the innermost parent group's value object.
|
|
1973
|
+
* - Directly inside an array item (no inner group): the array item itself
|
|
1974
|
+
* (same shape as `formValue` in array context).
|
|
1975
|
+
* - Inside a group inside an array item: the inner group's value object
|
|
1976
|
+
* within the current item.
|
|
1977
|
+
* - Field at form root with no parent container: `undefined`.
|
|
1978
|
+
*
|
|
1979
|
+
* @example
|
|
1980
|
+
* ```typescript
|
|
1981
|
+
* // Field 'state' inside group 'address':
|
|
1982
|
+
* deriveStateFromCountry: (ctx) => {
|
|
1983
|
+
* const country = ctx.groupValue?.country; // no need to know parent key
|
|
1984
|
+
* return country === 'usa' ? 'NY' : '';
|
|
1985
|
+
* }
|
|
1986
|
+
* ```
|
|
1987
|
+
*/
|
|
1988
|
+
groupValue?: unknown;
|
|
1949
1989
|
/**
|
|
1950
1990
|
* Root form value when inside an array context.
|
|
1951
1991
|
*
|
|
@@ -3259,10 +3299,10 @@ interface RowWrapper {
|
|
|
3259
3299
|
* - Supports a `wrappers` array that chains wrapper components around the children
|
|
3260
3300
|
* - Uses imperative `ViewContainerRef.createComponent()` for the wrapper chain
|
|
3261
3301
|
*
|
|
3262
|
-
*
|
|
3263
|
-
*
|
|
3264
|
-
*
|
|
3265
|
-
*
|
|
3302
|
+
* Containers are pure layout primitives that flatten their children into the
|
|
3303
|
+
* parent form, so any registered field type may appear inside — including
|
|
3304
|
+
* pages, hidden fields, rows, and other containers (see
|
|
3305
|
+
* {@link ContainerAllowedChildren}).
|
|
3266
3306
|
*
|
|
3267
3307
|
* @example
|
|
3268
3308
|
* ```typescript
|
|
@@ -3315,7 +3355,12 @@ interface ContainerField<TFields extends readonly ContainerAllowedChildren[] = r
|
|
|
3315
3355
|
readonly logic?: ContainerLogicConfig[];
|
|
3316
3356
|
}
|
|
3317
3357
|
/**
|
|
3318
|
-
* Type guard for ContainerField with proper type narrowing
|
|
3358
|
+
* Type guard for ContainerField with proper type narrowing.
|
|
3359
|
+
*
|
|
3360
|
+
* `wrappers` is part of the type but optional in practice — many configs use
|
|
3361
|
+
* containers purely as flex/layout wrappers without any wrapper components.
|
|
3362
|
+
* Match on `type === 'container'` and the `fields` shape only, mirroring
|
|
3363
|
+
* `isPageField` / `isRowField`.
|
|
3319
3364
|
*/
|
|
3320
3365
|
declare function isContainerTypedField(field: FieldDef<any>): field is ContainerField;
|
|
3321
3366
|
|
|
@@ -3478,12 +3523,6 @@ type NarrowFields = readonly NarrowField<RegisteredFieldTypes>[];
|
|
|
3478
3523
|
* Pages can contain: rows, groups, arrays, and leaf fields (but NOT other pages)
|
|
3479
3524
|
*/
|
|
3480
3525
|
type PageAllowedChildren = LeafFieldTypes | RowField | GroupField | ArrayField | SimplifiedArrayField | ContainerField;
|
|
3481
|
-
/**
|
|
3482
|
-
* Fields that are allowed as children of Row fields
|
|
3483
|
-
* Rows can contain: groups, arrays, and leaf fields (but NOT pages, other rows, or hidden fields)
|
|
3484
|
-
* Hidden fields are excluded because rows are for horizontal layouts and hidden fields don't render
|
|
3485
|
-
*/
|
|
3486
|
-
type RowAllowedChildren = Exclude<LeafFieldTypes, HiddenField> | GroupField | ArrayField | SimplifiedArrayField | ContainerField;
|
|
3487
3526
|
/**
|
|
3488
3527
|
* Fields that are allowed as children of Group fields
|
|
3489
3528
|
* Groups can contain: rows and leaf fields (but NOT pages or other groups)
|
|
@@ -3496,23 +3535,25 @@ type GroupAllowedChildren = LeafFieldTypes | RowField | ContainerField;
|
|
|
3496
3535
|
*/
|
|
3497
3536
|
type ArrayAllowedChildren = LeafFieldTypes | RowField | GroupField | ContainerField;
|
|
3498
3537
|
/**
|
|
3499
|
-
* Fields that are allowed as children of Container fields
|
|
3500
|
-
* Containers
|
|
3501
|
-
*
|
|
3538
|
+
* Fields that are allowed as children of Container fields.
|
|
3539
|
+
* Containers are pure layout primitives that flatten their children into the
|
|
3540
|
+
* parent form, so most registered field types may appear inside — including
|
|
3541
|
+
* hidden fields and other containers — but NOT pages.
|
|
3502
3542
|
*/
|
|
3503
|
-
type ContainerAllowedChildren =
|
|
3543
|
+
type ContainerAllowedChildren = LeafFieldTypes | RowField | GroupField | ArrayField | SimplifiedArrayField | ContainerField;
|
|
3544
|
+
/**
|
|
3545
|
+
* Row is a synthetic field type that resolves to a Container at runtime, so
|
|
3546
|
+
* it accepts the same children as a Container.
|
|
3547
|
+
*/
|
|
3548
|
+
type RowAllowedChildren = ContainerAllowedChildren;
|
|
3504
3549
|
|
|
3505
3550
|
/**
|
|
3506
|
-
* Row field interface for creating horizontal layouts
|
|
3507
|
-
*
|
|
3508
|
-
*
|
|
3509
|
-
*
|
|
3510
|
-
*
|
|
3511
|
-
* TypeScript cannot enforce field nesting rules due to circular dependency limitations.
|
|
3512
|
-
* For documentation: Rows should contain groups and leaf fields, but NOT pages, other rows, or hidden fields.
|
|
3513
|
-
* Runtime validation enforces these rules.
|
|
3551
|
+
* Row field interface for creating horizontal layouts.
|
|
3552
|
+
* A row is a synthetic field type that resolves to a Container at runtime,
|
|
3553
|
+
* with a synthesized `{ type: 'row' }` wrapper applied for layout. The row
|
|
3554
|
+
* itself does not hold a value — its children flatten into the parent form.
|
|
3514
3555
|
*
|
|
3515
|
-
* Note: Rows
|
|
3556
|
+
* Note: Rows do not support `meta` since they have no native form element.
|
|
3516
3557
|
*/
|
|
3517
3558
|
interface RowField<TFields extends readonly RowAllowedChildren[] = readonly RowAllowedChildren[]> extends FieldDef<never> {
|
|
3518
3559
|
type: 'row';
|
|
@@ -3643,7 +3684,7 @@ interface FieldWrapperContract {
|
|
|
3643
3684
|
* populated via `provideDynamicForm()` and used by `ContainerFieldComponent` to
|
|
3644
3685
|
* resolve wrapper types to their component implementations.
|
|
3645
3686
|
*/
|
|
3646
|
-
declare const WRAPPER_REGISTRY: InjectionToken<Map<string, WrapperTypeDefinition<_ng_forge_dynamic_forms.CssWrapper
|
|
3687
|
+
declare const WRAPPER_REGISTRY: InjectionToken<Map<string, WrapperTypeDefinition<RowWrapper | _ng_forge_dynamic_forms.CssWrapper>>>;
|
|
3647
3688
|
|
|
3648
3689
|
/**
|
|
3649
3690
|
* Base interface for native HTML attributes that can be passed to form field elements.
|
|
@@ -6459,7 +6500,7 @@ declare class ContainerFieldComponent {
|
|
|
6459
6500
|
private readonly defaultWrappersSignal;
|
|
6460
6501
|
private readonly childrenTpl;
|
|
6461
6502
|
private readonly wrapperContainer;
|
|
6462
|
-
field: _angular_core.InputSignal<ContainerField<readonly ContainerAllowedChildren[], readonly _ng_forge_dynamic_forms.WrapperConfig[]>>;
|
|
6503
|
+
field: _angular_core.InputSignal<ContainerField<readonly _ng_forge_dynamic_forms.ContainerAllowedChildren[], readonly _ng_forge_dynamic_forms.WrapperConfig[]>>;
|
|
6463
6504
|
key: _angular_core.InputSignal<string>;
|
|
6464
6505
|
className: _angular_core.InputSignal<string | undefined>;
|
|
6465
6506
|
hidden: _angular_core.InputSignal<boolean>;
|
|
@@ -6618,4 +6659,4 @@ declare class RootFormRegistryService {
|
|
|
6618
6659
|
declare const INITIALIZATION_TIMEOUT_MS: InjectionToken<number>;
|
|
6619
6660
|
|
|
6620
6661
|
export { ARRAY_CONTEXT, AppendArrayItemEvent, ArrayFieldComponent, BUILT_IN_FIELDS, ConsoleLogger, ContainerFieldComponent, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, DEFAULT_WRAPPERS, DynamicForm, DynamicFormError, DynamicFormLogger, DynamicTextPipe, EventBus, EventDispatcher, FIELD_REGISTRY, FIELD_SIGNAL_CONTEXT, FORM_OPTIONS, FormClearEvent, FormResetEvent, GroupFieldComponent, INITIALIZATION_TIMEOUT_MS, InsertArrayItemEvent, MoveArrayItemEvent, NextPageEvent, NoopLogger, PageChangeEvent, PopArrayItemEvent, PrependArrayItemEvent, PreviousPageEvent, RemoveAtIndexEvent, RootFormRegistryService, ShiftArrayItemEvent, SubmitEvent, WRAPPER_REGISTRY, applyMetaToElement, applyValidator, applyValidators, arrayEvent, arrayFieldMapper, baseFieldMapper, buildBaseInputs, containerFieldMapper, createField, createWrappers, dynamicTextToObservable, evaluateNonFieldDisabled, evaluateNonFieldHidden, field, formConfig, getArrayLength, groupFieldMapper, hasFormValue, interpolateParams, isArrayField, isCheckedField, isContainerField, isContainerTypedField, isDisplayOnlyField, isEqual, isFormStateCondition, isGroupField, isLeafField, isPageField, isRowField, isSimplifiedArrayField, isValueBearingField, isValueField, isWrapperTypeDefinition, isWrappersBundle, omit, pageFieldMapper, provideDynamicForm, resolveNextButtonDisabled, resolveNonFieldDisabled, resolveNonFieldHidden, resolveSubmitButtonDisabled, resolveTokens, rowFieldMapper, textFieldMapper, toReadonlyFieldTree, withEventFormValue, withLoggerConfig, withPreviousValue, withValueExclusionDefaults, wrapperProps };
|
|
6621
|
-
export type { ArrayAllowedChildren, ArrayButtonConfig, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemContext, ArrayItemDefinitionTemplate, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, ButtonLogicContext, CheckedFieldComponent, ConditionalExpression, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DynamicFormFieldRegistry, DynamicText, EvaluationContext, ExtractField, ExtractFieldDefs, ExtractFormValue, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTypeDefinition, FieldWithValidation, FieldWrapperContract, FormConfig, FormEvent, FormEventConstructor, FormFieldStateMap, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, GroupAllowedChildren, GroupField, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpResourceRequest, HttpValidationResponseMapping, InferFormValue$1 as InferFormValue, InferWrapperRegistry, LeafFieldTypes, Logger, LogicConfig, MapperFn, NarrowField, NarrowFields, NextButtonOptions, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, PageAllowedChildren, PageField, Prettify, ReadonlyFieldTree, RegisteredFieldTypes, ResolvedValueExclusionConfig, RowAllowedChildren, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueHandlingMode, ValueType, WithInputSignals, WrapperConfig, WrapperFieldInputs, WrapperRegistration, WrapperTypeDefinition, WrappersBundle };
|
|
6662
|
+
export type { ArrayAllowedChildren, ArrayButtonConfig, ArrayContext, ArrayField, ArrayFieldTree, ArrayItemContext, ArrayItemDefinitionTemplate, ArrayItemTemplate, AsyncCondition, AsyncConditionFunction, AsyncCustomValidator, AsyncDerivationFunction, AsyncValidatorConfig, AvailableFieldTypes, BaseCheckedField, BaseValidatorConfig, BaseValueField, BuiltInValidatorConfig, ButtonLogicContext, CheckedFieldComponent, ConditionalExpression, ContainerAllowedChildren, ContainerField, ContainerFieldTypes, CssWrapper, CustomFnConfig, CustomValidator, CustomValidatorConfig, DeclarativeHttpValidatorConfig, DynamicFormFieldRegistry, DynamicText, EvaluationContext, ExtractField, ExtractFieldDefs, ExtractFormValue, FieldComponent, FieldDef, FieldMeta, FieldOption, FieldPathAccess, FieldRegistryContainers, FieldRegistryLeaves, FieldRegistryWrappers, FieldScope, FieldSignalContext, FieldStateContext, FieldStateInfo, FieldTypeDefinition, FieldWithValidation, FieldWrapperContract, FormConfig, FormEvent, FormEventConstructor, FormFieldStateMap, FormMode, FormModeDetectionResult, FormOptions, FormStateCondition, GroupAllowedChildren, GroupField, HttpCondition, HttpCustomValidator, HttpRequestConfig, HttpResourceRequest, HttpValidationResponseMapping, InferFormValue$1 as InferFormValue, InferWrapperRegistry, LeafFieldTypes, Logger, LogicConfig, MapperFn, NarrowField, NarrowFields, NextButtonOptions, NonFieldLogicConfig, NonFieldLogicContext, NonFieldLogicType, PageAllowedChildren, PageField, Prettify, ReadonlyFieldTree, RegisteredFieldTypes, ResolvedValueExclusionConfig, RowAllowedChildren, RowField, SchemaApplicationConfig, SchemaDefinition, SimplifiedArrayField, StateLogicConfig, SubmissionActionResult, SubmissionConfig, SubmitButtonOptions, TextElementType, TextField, TextProps, TokenContext, ValidationError, ValidationMessages, ValidatorConfig, ValueExclusionConfig, ValueFieldComponent, ValueHandlingMode, ValueType, WithInputSignals, WrapperConfig, WrapperFieldInputs, WrapperRegistration, WrapperTypeDefinition, WrappersBundle };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-container-field.component-DQ_OQLtx.mjs","sources":["../../../../packages/dynamic-forms/src/lib/fields/container/container-field.component.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n EnvironmentInjector,\n inject,\n Injector,\n input,\n TemplateRef,\n viewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport { DfFieldOutlet } from '../../directives/df-field-outlet.directive';\nimport { derivedFromDeferred } from '../../utils/derived-from-deferred/derived-from-deferred';\nimport { createFieldResolutionPipe, ResolvedField } from '../../utils/resolve-field/resolve-field';\nimport { computeContainerHostClasses, setupContainerInitEffect } from '../../utils/container-utils/container-utils';\nimport { ContainerField } from '../../definitions/default/container-field';\nimport { injectFieldRegistry } from '../../utils/inject-field-registry/inject-field-registry';\nimport { EventBus } from '../../events/event.bus';\nimport { FieldDef } from '../../definitions/base/field-def';\nimport { DynamicFormLogger } from '../../providers/features/logger/logger.token';\nimport { WRAPPER_AUTO_ASSOCIATIONS } from '../../models/wrapper-type';\nimport { DEFAULT_WRAPPERS } from '../../models/field-signal-context.token';\nimport { isSameWrapperChain, resolveWrappers } from '../../utils/resolve-wrappers/resolve-wrappers';\nimport { createWrapperChainController } from '../../utils/wrapper-chain/wrapper-chain-controller';\n\n/**\n * Layout container that wraps child fields with UI chrome.\n *\n * Resolves children like a row, then chains wrapper components around them\n * using imperative `ViewContainerRef.createComponent()` — each wrapper's\n * `#fieldComponent` slot hosts the next wrapper or the children template.\n *\n * Does not create a new form context - fields share the parent's context.\n * Field values are flattened into the parent form (no nesting under container key).\n * Purely a visual/layout container with no impact on form structure.\n */\n@Component({\n selector: 'div[container-field]',\n imports: [DfFieldOutlet],\n template: `\n <ng-template #childrenTpl>\n @for (field of resolvedFields(); track field.key) {\n <ng-container *dfFieldOutlet=\"field; environmentInjector: environmentInjector\" />\n }\n </ng-template>\n <ng-container #wrapperContainer></ng-container>\n `,\n styleUrl: './container-field.component.scss',\n host: {\n '[class]': 'hostClasses()',\n '[class.disabled]': 'disabled()',\n '[class.df-container-hidden]': 'hidden()',\n '[attr.aria-hidden]': 'hidden() || null',\n '[id]': '`${key()}`',\n '[attr.data-testid]': 'key()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class ContainerFieldComponent {\n private readonly destroyRef = inject(DestroyRef);\n private readonly fieldRegistry = injectFieldRegistry();\n private readonly injector = inject(Injector);\n protected readonly environmentInjector = inject(EnvironmentInjector);\n private readonly eventBus = inject(EventBus);\n private readonly logger = inject(DynamicFormLogger);\n private readonly wrapperAutoAssociations = inject(WRAPPER_AUTO_ASSOCIATIONS);\n private readonly defaultWrappersSignal = inject(DEFAULT_WRAPPERS, { optional: true });\n\n private readonly childrenTpl = viewChild.required('childrenTpl', { read: TemplateRef });\n private readonly wrapperContainer = viewChild.required('wrapperContainer', { read: ViewContainerRef });\n\n field = input.required<ContainerField>();\n key = input.required<string>();\n className = input<string>();\n hidden = input(false);\n\n readonly hostClasses = computed(() => computeContainerHostClasses('container', this.className()));\n readonly disabled = computed(() => this.field().disabled || false);\n\n private readonly rawFieldRegistry = computed(() => this.fieldRegistry.raw);\n private readonly fieldsSource = computed(() => (this.field().fields || []) as FieldDef<unknown>[]);\n\n protected readonly resolvedFields = derivedFromDeferred(\n this.fieldsSource,\n createFieldResolutionPipe(() => ({\n loadTypeComponent: (type: string) => this.fieldRegistry.loadTypeComponent(type),\n registry: this.rawFieldRegistry(),\n injector: this.injector,\n destroyRef: this.destroyRef,\n onError: (fieldDef: FieldDef<unknown>, error: unknown) => {\n const fieldKey = fieldDef.key || '<no key>';\n\n const containerKey = this.field().key || '<no key>';\n this.logger.error(\n `Failed to load component for field type '${fieldDef.type}' (key: ${fieldKey}) ` +\n `within container '${containerKey}'. Ensure the field type is registered in your field registry.`,\n error,\n );\n },\n })),\n { initialValue: [] as ResolvedField[], injector: this.injector },\n );\n\n private readonly wrappers = computed(() => resolveWrappers(this.field(), this.defaultWrappersSignal?.(), this.wrapperAutoAssociations), {\n equal: isSameWrapperChain,\n });\n\n constructor() {\n // `row` is a virtual field type backed by ContainerFieldComponent — at\n // runtime the spread in rowFieldMapper preserves `type: 'row'` on the\n // field input, even though the declared type is `ContainerField`. Widen\n // here so `(events)` consumers filtering by `componentType === 'row'`\n // keep receiving emissions.\n setupContainerInitEffect(\n this.resolvedFields,\n this.eventBus,\n () => ((this.field().type as string) === 'row' ? 'row' : 'container'),\n () => this.field().key,\n this.injector,\n );\n\n createWrapperChainController({\n vcr: this.wrapperContainer,\n wrappers: this.wrappers,\n renderInnermost: (slot) => slot.createEmbeddedView(this.childrenTpl()),\n });\n }\n}\n\nexport { ContainerFieldComponent };\n"],"names":[],"mappings":";;;;;AA2BA;;;;;;;;;;AAUG;AAuBW,MAAO,uBAAuB,CAAA;AACzB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,aAAa,GAAG,mBAAmB,EAAE;AACrC,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACzB,IAAA,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACnD,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAClC,IAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAC3D,qBAAqB,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEpE,IAAA,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;AACtE,IAAA,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;AAEtG,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAkB;AACxC,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,yEAAU;IAC9B,SAAS,GAA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A,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,KAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-container-utils-zQSTe7Jk.mjs","sources":["../../../../packages/dynamic-forms/src/lib/utils/container-utils/container-utils.ts"],"sourcesContent":["import { computed, Injector, Signal } from '@angular/core';\nimport { explicitEffect } from 'ngxtension/explicit-effect';\nimport { EventBus } from '../../events/event.bus';\nimport { emitComponentInitialized, InitializationComponentType } from '../emit-initialization/emit-initialization';\nimport { ResolvedField } from '../resolve-field/resolve-field';\n\n/**\n * Computes the host class string for a container component.\n *\n * All containers follow the pattern: `df-field df-{type}` + optional custom class.\n *\n * @param containerType - The CSS class suffix (e.g., 'group', 'row', 'page-field')\n * @param className - Optional custom class name to append\n * @returns The computed host class string\n */\nexport function computeContainerHostClasses(containerType: string, className: string | undefined): string {\n const base = `df-field df-${containerType}`;\n return className ? `${base} ${className}` : base;\n}\n\n/**\n * Sets up the initialization effect common to all container components.\n *\n * When resolved fields become non-empty, emits a ComponentInitializedEvent\n * via afterNextRender to signal the container is ready.\n *\n * `componentType` may be a static value or a lazy getter — the latter lets\n * virtual field types (e.g. `row`, which renders via ContainerFieldComponent)\n * preserve their original type on the emitted event instead of collapsing to\n * the host component's type.\n *\n * @param resolvedFields - Signal of resolved fields\n * @param eventBus - EventBus for dispatching initialization events\n * @param componentType - Static type, or a getter evaluated at emission time\n * @param fieldKeyFn - Function returning the field's key\n * @param injector - Injector for afterNextRender scheduling\n */\nexport function setupContainerInitEffect(\n resolvedFields: Signal<ResolvedField[]>,\n eventBus: EventBus,\n componentType: InitializationComponentType | (() => InitializationComponentType),\n fieldKeyFn: () => string,\n injector: Injector,\n): void {\n const allReady = computed(() => {\n const fields = resolvedFields();\n return fields.length > 0 && fields.every((field) => field.renderReady());\n });\n\n explicitEffect([allReady], ([ready]) => {\n if (ready) {\n const type = typeof componentType === 'function' ? componentType() : componentType;\n emitComponentInitialized(eventBus, type, fieldKeyFn(), injector);\n }\n });\n}\n"],"names":[],"mappings":";;;;AAMA;;;;;;;;AAQG;AACG,SAAU,2BAA2B,CAAC,aAAqB,EAAE,SAA6B,EAAA;AAC9F,IAAA,MAAM,IAAI,GAAG,CAAA,YAAA,EAAe,aAAa,EAAE;AAC3C,IAAA,OAAO,SAAS,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,SAAS,CAAA,CAAE,GAAG,IAAI;AAClD;AAEA;;;;;;;;;;;;;;;;AAgBG;AACG,SAAU,wBAAwB,CACtC,cAAuC,EACvC,QAAkB,EAClB,aAAgF,EAChF,UAAwB,EACxB,QAAkB,EAAA;AAElB,IAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAK;AAC7B,QAAA,MAAM,MAAM,GAAG,cAAc,EAAE;QAC/B,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC;AAC1E,IAAA,CAAC,+EAAC;IAEF,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAI;QACrC,IAAI,KAAK,EAAE;AACT,YAAA,MAAM,IAAI,GAAG,OAAO,aAAa,KAAK,UAAU,GAAG,aAAa,EAAE,GAAG,aAAa;YAClF,wBAAwB,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC;QAClE;AACF,IAAA,CAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-emit-initialization-pCNwBRRm.mjs","sources":["../../../../packages/dynamic-forms/src/lib/utils/emit-initialization/emit-initialization.ts"],"sourcesContent":["import { afterNextRender, Injector } from '@angular/core';\nimport { EventBus } from '../../events/event.bus';\nimport { ComponentInitializedEvent } from '../../events/constants/component-initialized.event';\nimport { DynamicFormLogger } from '../../providers/features/logger/logger.token';\n\n/**\n * Component type for initialization events.\n */\nexport type InitializationComponentType = 'dynamic-form' | 'group' | 'row' | 'page' | 'array' | 'container';\n\n/**\n * Emits a component initialization event after the next render cycle.\n *\n * This utility is used by container components (group, row, page, array) to signal\n * that their child fields have been resolved and rendered. The event is dispatched\n * through the EventBus and is used by the initialization tracking system.\n *\n * @param eventBus - The EventBus instance to dispatch the event on\n * @param componentType - The type of component being initialized\n * @param componentKey - The unique key/id of the component\n * @param injector - The injector to use for afterNextRender scheduling\n */\nexport function emitComponentInitialized(\n eventBus: EventBus,\n componentType: InitializationComponentType,\n componentKey: string,\n injector: Injector,\n): void {\n const logger = injector.get(DynamicFormLogger);\n\n afterNextRender(\n () => {\n try {\n eventBus.dispatch(ComponentInitializedEvent, componentType, componentKey);\n } catch (error: unknown) {\n logger.error(`Failed to emit initialization event for ${componentType} '${componentKey}'`, error);\n }\n },\n { injector },\n );\n}\n"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;AAWG;AACG,SAAU,wBAAwB,CACtC,QAAkB,EAClB,aAA0C,EAC1C,YAAoB,EACpB,QAAkB,EAAA;IAElB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAE9C,eAAe,CACb,MAAK;AACH,QAAA,IAAI;YACF,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,EAAE,aAAa,EAAE,YAAY,CAAC;QAC3E;QAAE,OAAO,KAAc,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,CAAA,wCAAA,EAA2C,aAAa,CAAA,EAAA,EAAK,YAAY,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACnG;AACF,IAAA,CAAC,EACD,EAAE,QAAQ,EAAE,CACb;AACH;;;;"}
|