@ngx-formbar/core 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/fesm2022/ngx-formbar-core.mjs +2429 -0
- package/fesm2022/ngx-formbar-core.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/form/ngxfb-form.component.d.ts +28 -0
- package/lib/composables/computed-value.d.ts +8 -0
- package/lib/composables/disabled.state.d.ts +36 -0
- package/lib/composables/dynamic-label.d.ts +9 -0
- package/lib/composables/dynamic-title.d.ts +9 -0
- package/lib/composables/hidden.state.d.ts +68 -0
- package/lib/composables/readonly.state.d.ts +19 -0
- package/lib/composables/testId.d.ts +16 -0
- package/lib/composables/update-strategy.d.ts +20 -0
- package/lib/composables/validators.d.ts +22 -0
- package/lib/config/config.d.ts +7 -0
- package/lib/config/provide-formbar.d.ts +38 -0
- package/lib/directives/ngxfb-abstract-control.directive.d.ts +53 -0
- package/lib/directives/ngxfb-block.directive.d.ts +124 -0
- package/lib/directives/ngxfb-control.directive.d.ts +203 -0
- package/lib/directives/ngxfb-group.directive.d.ts +253 -0
- package/lib/helper/control-container-view-providers.d.ts +33 -0
- package/lib/index.d.ts +23 -0
- package/lib/services/component-registration.service.d.ts +8 -0
- package/lib/services/configuration.service.d.ts +8 -0
- package/lib/services/expression.service.d.ts +148 -0
- package/lib/services/form.service.d.ts +10 -0
- package/lib/services/validator-registration.service.d.ts +10 -0
- package/lib/tokens/component-registrations.d.ts +2 -0
- package/lib/tokens/component-resolver.d.ts +3 -0
- package/lib/tokens/default-update-strategy.d.ts +3 -0
- package/lib/tokens/global-config.d.ts +5 -0
- package/lib/tokens/validator-registrations.d.ts +8 -0
- package/lib/tokens/validator-resolver.d.ts +3 -0
- package/lib/types/component-resolver.type.d.ts +4 -0
- package/lib/types/content.type.d.ts +137 -0
- package/lib/types/expression.type.d.ts +2 -0
- package/lib/types/form.type.d.ts +4 -0
- package/lib/types/functions.type.d.ts +4 -0
- package/lib/types/global-configuration.type.d.ts +4 -0
- package/lib/types/provide.type.d.ts +42 -0
- package/lib/types/registration.type.d.ts +18 -0
- package/lib/types/validation.type.d.ts +59 -0
- package/lib/types/validator-resolver.type.d.ts +6 -0
- package/package.json +52 -0
- package/public-api.d.ts +1 -0
- package/schematics/block/files/__componentName@dasherize__.component.html.template +1 -0
- package/schematics/block/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/block/files/__interfaceName@dasherize__.type.ts.template +6 -0
- package/schematics/block/index.d.ts +3 -0
- package/schematics/block/index.js +11 -0
- package/schematics/block/index.js.map +1 -0
- package/schematics/block/schema.json +62 -0
- package/schematics/collection.json +31 -0
- package/schematics/control/files/__componentName@dasherize__.component.html.template +0 -0
- package/schematics/control/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/control/files/__interfaceName@dasherize__.type.ts.template +6 -0
- package/schematics/control/index.d.ts +3 -0
- package/schematics/control/index.js +11 -0
- package/schematics/control/index.js.map +1 -0
- package/schematics/control/schema.json +61 -0
- package/schematics/group/files/__componentName@dasherize__.component.html.template +5 -0
- package/schematics/group/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/group/files/__interfaceName@dasherize__.type.ts.template +5 -0
- package/schematics/group/index.d.ts +3 -0
- package/schematics/group/index.js +11 -0
- package/schematics/group/index.js.map +1 -0
- package/schematics/group/schema.json +62 -0
- package/schematics/ng-add/files/config-registrations/async-validator-registrations.ts.template +4 -0
- package/schematics/ng-add/files/config-registrations/component-registrations.ts.template +4 -0
- package/schematics/ng-add/files/config-registrations/index.ts.template +3 -0
- package/schematics/ng-add/files/config-registrations/validator-registrations.ts.template +4 -0
- package/schematics/ng-add/files/helper/block.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/control.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/group.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/index.ts.template +4 -0
- package/schematics/ng-add/files/helper/view-provider.ts.template +9 -0
- package/schematics/ng-add/files/provider-config/config/__providerConfigFileName__.ts.template +9 -0
- package/schematics/ng-add/files/provider-config/inline/__providerConfigFileName__.ts.template +8 -0
- package/schematics/ng-add/files/provider-config/token/__providerConfigFileName__.ts.template +4 -0
- package/schematics/ng-add/files/schematics-config/__schematicConfigFileName__.json.template +1 -0
- package/schematics/ng-add/files/token-registrations/async-validator-registrations.ts.template +8 -0
- package/schematics/ng-add/files/token-registrations/component-registrations.ts.template +8 -0
- package/schematics/ng-add/files/token-registrations/index.ts.template +3 -0
- package/schematics/ng-add/files/token-registrations/validator-registrations.ts.template +8 -0
- package/schematics/ng-add/helper.d.ts +11 -0
- package/schematics/ng-add/helper.js +198 -0
- package/schematics/ng-add/helper.js.map +1 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +68 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.js +32 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js +30 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-helper-files.rule.d.ts +6 -0
- package/schematics/ng-add/rules/create-helper-files.rule.js +22 -0
- package/schematics/ng-add/rules/create-helper-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.js +42 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.js +32 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/include-templates.rule.d.ts +3 -0
- package/schematics/ng-add/rules/include-templates.rule.js +11 -0
- package/schematics/ng-add/rules/include-templates.rule.js.map +1 -0
- package/schematics/ng-add/rules/install-dependencies.rule.d.ts +2 -0
- package/schematics/ng-add/rules/install-dependencies.rule.js +12 -0
- package/schematics/ng-add/rules/install-dependencies.rule.js.map +1 -0
- package/schematics/ng-add/rules/update-app-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/update-app-config.rule.js +48 -0
- package/schematics/ng-add/rules/update-app-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.d.ts +6 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.js +28 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +23 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +81 -0
- package/schematics/register/component-info.type.d.ts +11 -0
- package/schematics/register/component-info.type.js +3 -0
- package/schematics/register/component-info.type.js.map +1 -0
- package/schematics/register/discover-components.d.ts +19 -0
- package/schematics/register/discover-components.js +267 -0
- package/schematics/register/discover-components.js.map +1 -0
- package/schematics/register/index.d.ts +3 -0
- package/schematics/register/index.js +49 -0
- package/schematics/register/index.js.map +1 -0
- package/schematics/register/register-components.d.ts +3 -0
- package/schematics/register/register-components.js +38 -0
- package/schematics/register/register-components.js.map +1 -0
- package/schematics/register/schema.d.ts +14 -0
- package/schematics/register/schema.js +3 -0
- package/schematics/register/schema.js.map +1 -0
- package/schematics/register/schema.json +44 -0
- package/schematics/shared/ast/decorators.d.ts +9 -0
- package/schematics/shared/ast/decorators.js +182 -0
- package/schematics/shared/ast/decorators.js.map +1 -0
- package/schematics/shared/ast/imports.d.ts +3 -0
- package/schematics/shared/ast/imports.js +93 -0
- package/schematics/shared/ast/imports.js.map +1 -0
- package/schematics/shared/ast/parse.d.ts +3 -0
- package/schematics/shared/ast/parse.js +17 -0
- package/schematics/shared/ast/parse.js.map +1 -0
- package/schematics/shared/ast/registrations.d.ts +22 -0
- package/schematics/shared/ast/registrations.js +654 -0
- package/schematics/shared/ast/registrations.js.map +1 -0
- package/schematics/shared/ast/types.d.ts +3 -0
- package/schematics/shared/ast/types.js +58 -0
- package/schematics/shared/ast/types.js.map +1 -0
- package/schematics/shared/file.d.ts +4 -0
- package/schematics/shared/file.js +60 -0
- package/schematics/shared/file.js.map +1 -0
- package/schematics/shared/helper.d.ts +2 -0
- package/schematics/shared/helper.js +29 -0
- package/schematics/shared/helper.js.map +1 -0
- package/schematics/shared/rules/create-component.rule.d.ts +3 -0
- package/schematics/shared/rules/create-component.rule.js +15 -0
- package/schematics/shared/rules/create-component.rule.js.map +1 -0
- package/schematics/shared/rules/register-control.rule.d.ts +3 -0
- package/schematics/shared/rules/register-control.rule.js +30 -0
- package/schematics/shared/rules/register-control.rule.js.map +1 -0
- package/schematics/shared/rules/register-type-map.rule.d.ts +3 -0
- package/schematics/shared/rules/register-type-map.rule.js +46 -0
- package/schematics/shared/rules/register-type-map.rule.js.map +1 -0
- package/schematics/shared/rules/register-type-token.rule.d.ts +3 -0
- package/schematics/shared/rules/register-type-token.rule.js +49 -0
- package/schematics/shared/rules/register-type-token.rule.js.map +1 -0
- package/schematics/shared/rules/scaffold-and-register.rule.d.ts +3 -0
- package/schematics/shared/rules/scaffold-and-register.rule.js +134 -0
- package/schematics/shared/rules/scaffold-and-register.rule.js.map +1 -0
- package/schematics/shared/schema.d.ts +32 -0
- package/schematics/shared/schema.js +3 -0
- package/schematics/shared/schema.js.map +1 -0
- package/schematics/tests/generators.spec.d.ts +1 -0
- package/schematics/tests/generators.spec.js +450 -0
- package/schematics/tests/generators.spec.js.map +1 -0
- package/schematics/tests/helper.d.ts +20 -0
- package/schematics/tests/helper.js +275 -0
- package/schematics/tests/helper.js.map +1 -0
- package/schematics/tests/ng-add.spec.d.ts +1 -0
- package/schematics/tests/ng-add.spec.js +380 -0
- package/schematics/tests/ng-add.spec.js.map +1 -0
- package/schematics/tests/register.spec.d.ts +1 -0
- package/schematics/tests/register.spec.js +340 -0
- package/schematics/tests/register.spec.js.map +1 -0
- package/schematics/tests/workspace-setup.d.ts +21 -0
- package/schematics/tests/workspace-setup.js +255 -0
- package/schematics/tests/workspace-setup.js.map +1 -0
- package/shared/ast.d.ts +10 -0
- package/shared/ast.js +93 -0
- package/shared/ast.js.map +1 -0
- package/shared/constants.d.ts +16 -0
- package/shared/constants.js +20 -0
- package/shared/constants.js.map +1 -0
- package/shared/shared-config.type.d.ts +20 -0
- package/shared/shared-config.type.js +3 -0
- package/shared/shared-config.type.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-formbar-core.mjs","sources":["../../../projects/core/src/lib/services/form.service.ts","../../../projects/core/src/lib/helper/control-container-view-providers.ts","../../../projects/core/src/lib/tokens/component-resolver.ts","../../../projects/core/src/lib/directives/ngxfb-abstract-control.directive.ts","../../../projects/core/src/lib/components/form/ngxfb-form.component.ts","../../../projects/core/src/lib/components/form/ngxfb-form.component.html","../../../projects/core/src/lib/config/config.ts","../../../projects/core/src/lib/tokens/component-registrations.ts","../../../projects/core/src/lib/services/component-registration.service.ts","../../../projects/core/src/lib/tokens/validator-registrations.ts","../../../projects/core/src/lib/services/validator-registration.service.ts","../../../projects/core/src/lib/services/expression.service.ts","../../../projects/core/src/lib/tokens/default-update-strategy.ts","../../../projects/core/src/lib/tokens/validator-resolver.ts","../../../projects/core/src/lib/tokens/global-config.ts","../../../projects/core/src/lib/config/provide-formbar.ts","../../../projects/core/src/lib/composables/readonly.state.ts","../../../projects/core/src/lib/composables/hidden.state.ts","../../../projects/core/src/lib/composables/validators.ts","../../../projects/core/src/lib/services/configuration.service.ts","../../../projects/core/src/lib/composables/testId.ts","../../../projects/core/src/lib/composables/update-strategy.ts","../../../projects/core/src/lib/composables/dynamic-title.ts","../../../projects/core/src/lib/directives/ngxfb-group.directive.ts","../../../projects/core/src/lib/composables/disabled.state.ts","../../../projects/core/src/lib/composables/computed-value.ts","../../../projects/core/src/lib/composables/dynamic-label.ts","../../../projects/core/src/lib/directives/ngxfb-control.directive.ts","../../../projects/core/src/lib/directives/ngxfb-block.directive.ts","../../../projects/core/src/public-api.ts","../../../projects/core/src/ngx-formbar-core.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ControlContainer, FormGroup } from '@angular/forms';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FormContext } from '../types/expression.type';\n\n@Injectable()\nexport class FormService {\n private controlContainer = inject(ControlContainer);\n readonly formGroup = this.controlContainer.control as FormGroup;\n readonly formValue = toSignal<FormContext>(this.formGroup.valueChanges);\n}\n","import { ControlContainer } from '@angular/forms';\nimport { inject } from '@angular/core';\n\n/**\n * Provides the parent ControlContainer to child components\n *\n * This provider configuration allows child form components to access their parent's\n * ControlContainer through dependency injection. This is particularly useful for\n * creating nested form components that inherit the parent form context without\n * explicitly passing FormGroup instances.\n *\n * @remarks\n * The `skipSelf` option ensures the provider looks for the ControlContainer in parent\n * components rather than trying to resolve it from the component where this is used.\n *\n * @example\n * ```typescript\n * @Component({\n * selector: 'app-child-form',\n * template: '...',\n * viewProviders: [controlContainerViewProviders]\n * })\n * export class ChildFormComponent {\n * // Now this component can access the parent form\n * private controlContainer = inject(ControlContainer);\n *\n * get parentFormGroup() {\n * return this.parentContainer.control as FormGroup | null;\n * }\n * }\n */\nexport const controlContainerViewProviders = [\n {\n provide: ControlContainer,\n useFactory: () => inject(ControlContainer, { skipSelf: true }),\n },\n];\n","import { InjectionToken } from '@angular/core';\nimport { ComponentResolver } from '../types/component-resolver.type';\n\nexport const NGX_FW_COMPONENT_RESOLVER = new InjectionToken<ComponentResolver>(\n 'NGX_FW_COMPONENT_RESOLVER',\n);\n","import {\n computed,\n Directive,\n effect,\n inject,\n input,\n ViewContainerRef,\n} from '@angular/core';\nimport { NgxFbBaseContent } from '../types/content.type';\nimport { NGX_FW_COMPONENT_RESOLVER } from '../tokens/component-resolver';\n\n/**\n * Structural directive that renders the appropriate component based on the control's type.\n *\n * This directive acts as a dynamic renderer for form controls, blocks, and groups.\n * It works by:\n * 1. Receiving a content configuration and name\n * 2. Looking up the registered component for the content's type\n * 3. Creating an instance of that component and binding the content and name to it\n *\n * This allows forms to be composed declaratively through configuration objects\n * rather than explicit templates.\n *\n * @example\n * ```html\n * <!-- Used with ngFor to render a list of controls -->\n * @for (control of controls(); track control[0]) {\n * <ng-template *ngxfbAbstractControl=\"control\" />\n * }\n *\n * <!-- Used directly with a specific control -->\n * <ng-template *ngxfbAbstractControl=\"['name', nameControlConfig]\" />\n * ```\n */\n@Directive({\n selector: '[ngxfbAbstractControl]',\n})\nexport class NgxfbAbstractControlDirective<T extends NgxFbBaseContent> {\n private viewContainerRef = inject(ViewContainerRef);\n\n /**\n * Service for component registration\n * Provides access to component type mappings\n */\n private readonly contentRegistrationService = inject(\n NGX_FW_COMPONENT_RESOLVER,\n );\n\n /**\n * Required input for control configuration\n * Defines properties like type, validation, and other control-specific settings\n */\n readonly content = input.required<[string, T]>({\n alias: 'ngxfbAbstractControl',\n });\n\n readonly controlName = computed(() => this.content()[0]);\n readonly controlConfig = computed(() => this.content()[1]);\n\n /**\n * Registration map of component types\n * Maps control types to component implementations\n */\n readonly registrations = this.contentRegistrationService.registrations;\n\n /**\n * Computed component type based on content.type\n * Looks up the component implementation from registrations map\n */\n readonly component = computed(() => {\n const registrations = this.registrations();\n const content = this.controlConfig();\n\n const component = registrations.get(content.type);\n return component ?? null;\n });\n\n constructor() {\n effect(() => {\n const component = this.component();\n this.viewContainerRef.clear();\n if (component) {\n const componentRef = this.viewContainerRef.createComponent(component);\n componentRef.setInput('content', this.controlConfig());\n componentRef.setInput('name', this.controlName());\n }\n });\n }\n}\n","import { Component, computed, input } from '@angular/core';\nimport { FormService } from '../../services/form.service';\nimport { controlContainerViewProviders } from '../../helper/control-container-view-providers';\nimport { NgxfbAbstractControlDirective } from '../../directives/ngxfb-abstract-control.directive';\nimport { NgxFbBaseContent, NgxFbContent } from '../../types/content.type';\nimport { NgxFbForm } from '../../types/form.type';\n\n/**\n * Ngx Formbar Form Component\n *\n * This component serves as the main container for Ngx Formbar forms:\n * - Takes a form configuration\n * - Establishes the form context through FormService provider\n * - Renders each content item using NgxfbAbstractControlDirective\n * - Handles component registration and dependency injection\n *\n * The component acts as the root element for declarative form creation,\n * processing the form content configuration and rendering the appropriate\n * components for each control defined in the configuration.\n */\n@Component({\n selector: 'ngxfb-form',\n imports: [NgxfbAbstractControlDirective],\n templateUrl: './ngxfb-form.component.html',\n providers: [FormService],\n viewProviders: [controlContainerViewProviders],\n})\nexport class NgxfbFormComponent<T extends NgxFbBaseContent = NgxFbContent> {\n /**\n * Required input containing form configuration\n */\n readonly formConfig = input.required<NgxFbForm<T>>();\n\n /**\n * Computed value containing form content\n */\n readonly formContent = computed(() =>\n Object.entries(this.formConfig().content),\n );\n}\n","@for (content of formContent(); track content[0]) {\n <ng-template *ngxfbAbstractControl=\"content\" />\n}\n","import { RegistrationRecord } from '../types/validation.type';\nimport { FormbarConfig } from '../types/provide.type';\n\n/**\n * Type helper to make it easier to use formbar.config.ts\n * accepts a direct {@link FormbarConfig} object\n */\nexport function defineFormbarConfig<\n S extends RegistrationRecord,\n A extends RegistrationRecord,\n>(config: FormbarConfig<S, A>) {\n return config;\n}\n","import { InjectionToken, Type } from '@angular/core';\n\nexport const NGX_FW_COMPONENT_REGISTRATIONS = new InjectionToken<\n ReadonlyMap<string, Type<unknown>>\n>('NGX_FW_COMPONENT_REGISTRATIONS', {\n providedIn: 'root',\n factory: () => new Map(),\n});\n","import { inject, Injectable, signal } from '@angular/core';\nimport { NGX_FW_COMPONENT_REGISTRATIONS } from '../tokens/component-registrations';\nimport { ComponentResolver } from '../types/component-resolver.type';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ComponentRegistrationService implements ComponentResolver {\n private readonly _registrations = signal(\n inject(NGX_FW_COMPONENT_REGISTRATIONS),\n );\n\n readonly registrations = this._registrations.asReadonly();\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport { AsyncValidatorFn, ValidatorFn, Validators } from '@angular/forms';\n\nexport const NGX_FW_DEFAULT_VALIDATOR_REGISTRATIONS = new InjectionToken<\n ReadonlyMap<string, ValidatorFn[]>\n>('NgxFbDefaultValidatorRegistrations', {\n providedIn: 'root',\n factory: () =>\n new Map<string, ValidatorFn[]>([\n ['required', [Validators.required]],\n ['requiredTrue', [Validators.requiredTrue]],\n ['email', [Validators.email]],\n ['nullValidator', [Validators.nullValidator]],\n ]),\n});\n\nexport const NGX_FW_DEFAULT_ASYNC_VALIDATOR_REGISTRATIONS = new InjectionToken<\n ReadonlyMap<string, AsyncValidatorFn[]>\n>('NGX_FW_DEFAULT_ASYNC_VALIDATOR_REGISTRATIONS', {\n providedIn: 'root',\n factory: () => new Map<string, AsyncValidatorFn[]>(),\n});\n\nexport const NGX_FW_VALIDATOR_REGISTRATIONS = new InjectionToken<\n ReadonlyMap<string, ValidatorFn[]>[]\n>('NGX_FW_VALIDATOR_REGISTRATIONS');\n\nexport const NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS = new InjectionToken<\n ReadonlyMap<string, AsyncValidatorFn[]>[]\n>('NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS');\n\nexport const NGX_FW_VALIDATOR_REGISTRATIONS_RESOLVED = new InjectionToken<\n ReadonlyMap<string, ValidatorFn[]>\n>('NGX_FW_VALIDATOR_REGISTRATIONS_RESOLVED', {\n providedIn: 'root',\n factory: () => {\n const base = inject(NGX_FW_DEFAULT_VALIDATOR_REGISTRATIONS);\n const extras =\n inject(NGX_FW_VALIDATOR_REGISTRATIONS, { optional: true }) ?? [];\n return mergeMapsLastWins(base, ...extras);\n },\n});\n\nexport const NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS_RESOLVED = new InjectionToken<\n ReadonlyMap<string, AsyncValidatorFn[]>\n>('NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS_RESOLVED', {\n providedIn: 'root',\n factory: () => {\n const base = inject(NGX_FW_DEFAULT_ASYNC_VALIDATOR_REGISTRATIONS);\n const extras =\n inject(NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS, { optional: true }) ?? [];\n return mergeMapsLastWins(base, ...extras);\n },\n});\n\n/** Utility: merge maps left->right, later maps override earlier keys */\nfunction mergeMapsLastWins<V>(\n ...maps: ReadonlyMap<string, V[]>[]\n): ReadonlyMap<string, V[]> {\n const out = new Map<string, V[]>();\n for (const m of maps) {\n for (const [k, v] of m) {\n out.set(k, v);\n }\n }\n return out;\n}\n","import { inject, Injectable, signal } from '@angular/core';\nimport {\n NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS_RESOLVED,\n NGX_FW_VALIDATOR_REGISTRATIONS_RESOLVED,\n} from '../tokens/validator-registrations';\nimport { ValidatorResolver } from '../types/validator-resolver.type';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ValidatorRegistrationService implements ValidatorResolver {\n private readonly _registrations = signal(\n inject(NGX_FW_VALIDATOR_REGISTRATIONS_RESOLVED),\n );\n readonly registrations = this._registrations.asReadonly();\n\n private readonly _asyncRegistrations = signal(\n inject(NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS_RESOLVED),\n );\n readonly asyncRegistrations = this._asyncRegistrations.asReadonly();\n}\n","import { Injectable } from '@angular/core';\nimport type {\n ArrayExpression,\n ArrowFunctionExpression,\n BinaryExpression,\n BinaryOperator,\n CallExpression,\n ConditionalExpression,\n Expression,\n Identifier,\n Literal,\n LogicalExpression,\n MemberExpression,\n ObjectExpression,\n PrivateIdentifier,\n Program,\n SequenceExpression,\n SpreadElement,\n Super,\n TemplateLiteral,\n UnaryExpression,\n} from 'acorn';\nimport * as acorn from 'acorn';\nimport type { FormContext } from '../types/expression.type';\n\n/**\n * Set of node types that are not supported in expressions for security or complexity reasons\n */\nconst UNSUPPORTED_NODE_TYPES = new Set([\n 'ThisExpression',\n 'Super',\n 'PrivateIdentifier',\n 'FunctionExpression',\n 'UpdateExpression',\n 'AssignmentExpression',\n 'NewExpression',\n 'YieldExpression',\n 'TaggedTemplateExpression',\n 'ClassExpression',\n 'MetaProperty',\n 'AwaitExpression',\n 'ImportExpression',\n]);\n\ntype SafeMethods = {\n string: string[];\n number: string[];\n boolean: string[];\n array: string[];\n};\n/**\n * Mapping of safe methods that can be called on various types during evaluation\n */\nconst SAFE_METHODS: SafeMethods = {\n string: [\n 'charAt',\n 'concat',\n 'includes',\n 'endsWith',\n 'indexOf',\n 'lastIndexOf',\n 'padEnd',\n 'padStart',\n 'repeat',\n 'replace',\n 'slice',\n 'split',\n 'startsWith',\n 'substring',\n 'toLowerCase',\n 'toUpperCase',\n 'trim',\n 'trimEnd',\n 'trimStart',\n 'toString',\n ],\n number: ['toFixed', 'toPrecision', 'toString'],\n boolean: ['toString'],\n array: [\n 'concat',\n 'every',\n 'filter',\n 'find',\n 'findIndex',\n 'includes',\n 'indexOf',\n 'join',\n 'lastIndexOf',\n 'map',\n 'reduce',\n 'reduceRight',\n 'slice',\n 'some',\n 'toString',\n ],\n} as const;\n\ntype ObjectWithMethod = Record<string, unknown>;\n\n/**\n * Service for parsing and evaluating JavaScript expressions within a context object\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ExpressionService {\n /**\n * Cache for parsed ASTs to avoid re-parsing the same expression\n */\n private readonly astCache = new Map<string, Program>();\n\n /**\n * Parses an expression string into an abstract syntax tree (AST)\n * @param expressionString - The expression to parse\n * @returns The parsed AST or null\n */\n parseExpressionToAst(expressionString?: string): Program | null {\n if (!expressionString) {\n return null;\n }\n const cachedAst = this.astCache.get(expressionString);\n if (cachedAst) {\n return cachedAst;\n }\n\n const ast = acorn.parse(expressionString, { ecmaVersion: 2022 });\n this.astCache.set(expressionString, ast);\n return ast;\n }\n\n /**\n * Evaluates an expression AST within the provided context\n * @param ast - The parsed AST to evaluate\n * @param context - The context containing variables and objects referenced in the expression\n * @returns The result of evaluating the expression\n */\n evaluateExpression(ast?: Program | null, context?: FormContext): unknown {\n if (!context || !ast) {\n return null;\n }\n\n const node = ast.body[0];\n if (node.type !== 'ExpressionStatement') {\n throw new TypeError(`Unsupported statement type: ${node.type}`);\n }\n\n return this.evaluateAstNode(node.expression, context);\n }\n\n /**\n * Evaluates a node in the AST\n * @param node - The AST node to evaluate\n * @param context - The context containing variables and objects\n * @returns The result of evaluating the node\n */\n private evaluateAstNode(\n node: Expression | PrivateIdentifier | Super | SpreadElement,\n context: FormContext,\n ): unknown {\n // Check if the node type is unsupported first\n if (UNSUPPORTED_NODE_TYPES.has(node.type)) {\n throw new TypeError(`${node.type} is not supported in expressions`);\n }\n\n // Handle supported node types\n switch (node.type) {\n case 'Identifier':\n return this.evaluateIdentifier(node, context);\n case 'Literal':\n return this.evaluateLiteral(node);\n case 'ArrayExpression':\n return this.evaluateArrayExpression(node, context);\n case 'UnaryExpression':\n return this.evaluateUnaryExpression(node, context);\n case 'BinaryExpression':\n return this.evaluateBinaryExpression(node, context);\n case 'LogicalExpression':\n return this.evaluateLogicalExpression(node, context);\n case 'MemberExpression':\n return this.evaluateMemberExpression(node, context);\n case 'ConditionalExpression':\n return this.evaluateConditionalExpression(node, context);\n case 'ParenthesizedExpression':\n return this.evaluateAstNode(node.expression, context);\n case 'ObjectExpression':\n return this.evaluateObjectExpression(node, context);\n case 'SequenceExpression':\n return this.evaluateSequenceExpression(node, context);\n case 'TemplateLiteral':\n return this.evaluateTemplateLiteral(node, context);\n case 'CallExpression':\n return this.evaluateCallExpression(node, context);\n case 'ArrowFunctionExpression':\n return this.evaluateArrowFunctionExpression(node, context);\n case 'ChainExpression':\n return this.evaluateAstNode(node.expression, context);\n default:\n throw new TypeError(`Unsupported node type: ${node.type}`);\n }\n }\n\n /**\n * Evaluates a literal value node\n * @param node - The literal node to evaluate\n * @returns The literal value\n */\n private evaluateLiteral(node: Literal): unknown {\n return node.value;\n }\n\n /**\n * Evaluates a binary expression (e.g., a + b, x > y)\n * @param node - The binary expression node\n * @param context - The context containing variables and objects\n * @returns The result of the binary operation\n */\n private evaluateBinaryExpression(\n node: BinaryExpression,\n context: FormContext,\n ): unknown {\n const leftValue = this.evaluateAstNode(node.left, context);\n const rightValue = this.evaluateAstNode(node.right, context);\n return this.executeBinaryOperation(leftValue, node.operator, rightValue);\n }\n\n /**\n * Executes a binary operation with the given values and operator\n * @param leftValue - The left operand\n * @param operator - The binary operator\n * @param rightValue - The right operand\n * @returns The result of applying the operator to the operands\n */\n private executeBinaryOperation(\n leftValue: unknown,\n operator: BinaryOperator,\n rightValue: unknown,\n ): unknown {\n const isNumber = (value: unknown): value is number =>\n typeof value === 'number';\n const isString = (value: unknown): value is string =>\n typeof value === 'string';\n const isObject = (value: unknown): value is object =>\n value !== null && typeof value === 'object';\n\n switch (operator) {\n // Arithmetic operators\n case '+':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue + rightValue;\n }\n\n if (isString(leftValue) || isString(rightValue)) {\n return String(leftValue) + String(rightValue);\n }\n\n throw new TypeError('+ operator requires numbers or strings');\n\n case '-':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue - rightValue;\n }\n throw new TypeError('- operator requires numbers');\n\n case '*':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue * rightValue;\n }\n throw new TypeError('* operator requires numbers');\n\n case '/':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n if (rightValue === 0) {\n throw new Error('Division by zero');\n }\n return leftValue / rightValue;\n }\n throw new TypeError('/ operator requires numbers');\n\n case '%':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n if (rightValue === 0) {\n throw new Error('Modulo by zero');\n }\n return leftValue % rightValue;\n }\n throw new TypeError('% operator requires numbers');\n\n case '**':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue ** rightValue;\n }\n throw new TypeError('** operator requires numbers');\n\n // Comparison operators\n case '<':\n if (\n (isNumber(leftValue) && isNumber(rightValue)) ||\n (isString(leftValue) && isString(rightValue))\n ) {\n return leftValue < rightValue;\n }\n throw new TypeError(\n '< operator requires operands of the same type (numbers or strings)',\n );\n\n case '>':\n if (\n (isNumber(leftValue) && isNumber(rightValue)) ||\n (isString(leftValue) && isString(rightValue))\n ) {\n return leftValue > rightValue;\n }\n throw new TypeError(\n '> operator requires operands of the same type (numbers or strings)',\n );\n\n case '<=':\n if (\n (isNumber(leftValue) && isNumber(rightValue)) ||\n (isString(leftValue) && isString(rightValue))\n ) {\n return leftValue <= rightValue;\n }\n throw new TypeError(\n '<= operator requires operands of the same type (numbers or strings)',\n );\n\n case '>=':\n if (\n (isNumber(leftValue) && isNumber(rightValue)) ||\n (isString(leftValue) && isString(rightValue))\n ) {\n return leftValue >= rightValue;\n }\n throw new TypeError(\n '>= operator requires operands of the same type (numbers or strings)',\n );\n\n // Equality operators - maintain loose behavior as per specs\n case '==':\n return leftValue == rightValue;\n case '!=':\n return leftValue != rightValue;\n case '===':\n return leftValue === rightValue;\n case '!==':\n return leftValue !== rightValue;\n\n // Bitwise operators\n case '|':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue | rightValue;\n }\n throw new TypeError('| operator requires numbers');\n\n case '&':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue & rightValue;\n }\n throw new TypeError('& operator requires numbers');\n\n case '^':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue ^ rightValue;\n }\n throw new TypeError('^ operator requires numbers');\n\n case '<<':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue << rightValue;\n }\n throw new TypeError('<< operator requires numbers');\n\n case '>>':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue >> rightValue;\n }\n throw new TypeError('>> operator requires numbers');\n\n case '>>>':\n if (isNumber(leftValue) && isNumber(rightValue)) {\n return leftValue >>> rightValue;\n }\n throw new TypeError('>>> operator requires numbers');\n\n case 'in':\n if (!isObject(rightValue)) {\n throw new TypeError(\n 'Right operand must be an object for \"in\" operator',\n );\n }\n if (!isString(leftValue)) {\n throw new TypeError(\n 'Left operand must be of type string for \"in\" operator',\n );\n }\n return leftValue in rightValue;\n\n default:\n throw new Error(`Unsupported binary operator: ${operator}`);\n }\n }\n\n /**\n * Evaluates a member expression (e.g., obj.prop, arr[0]) with improved safety\n * @param node - The member expression node\n * @param context - The context containing variables and objects\n * @returns The value of the member\n */\n private evaluateMemberExpression(\n node: MemberExpression,\n context: FormContext,\n ): unknown {\n const propertyValue = node.computed\n ? this.evaluateAstNode(node.property, context)\n : (node.property as Identifier).name;\n\n if (\n typeof propertyValue !== 'string' &&\n typeof propertyValue !== 'number'\n ) {\n throw new Error(\n `Property accessor must be a string or number, but was ${typeof propertyValue}`,\n );\n }\n\n const objectValue = this.evaluateAstNode(node.object, context);\n\n const isOptional = node.optional;\n if (objectValue === null || objectValue === undefined) {\n if (isOptional) {\n return undefined;\n }\n const readObject = node.object;\n const readingFrom =\n readObject.type === 'Identifier' ? ` from ${readObject.name}` : '';\n throw new Error(\n `Cannot access properties of null or undefined (Reading: ${propertyValue.toString()}${readingFrom})`,\n );\n }\n\n if (typeof objectValue === 'object') {\n return this.getPropertyFromObject(\n objectValue as Record<string, unknown>,\n propertyValue,\n );\n }\n\n if (typeof objectValue === 'string') {\n if (\n propertyValue === 'length' ||\n typeof String.prototype[\n propertyValue as keyof typeof String.prototype\n ] === 'function'\n ) {\n return objectValue[propertyValue as keyof string];\n }\n\n if (\n typeof propertyValue === 'number' ||\n !Number.isNaN(Number(propertyValue))\n ) {\n return objectValue[propertyValue as keyof typeof objectValue];\n }\n\n throw new Error(`Invalid property access on string: ${propertyValue}`);\n }\n\n if (typeof objectValue === 'number') {\n throw new Error(\n `Cannot access properties on a number value: ${String(objectValue)}.${String(propertyValue)}`,\n );\n }\n\n if (typeof objectValue === 'boolean') {\n throw new Error(\n `Cannot access properties on a boolean value: ${String(objectValue)}.${String(propertyValue)}`,\n );\n }\n\n return this.getPropertyFromObject(\n objectValue as Record<string, unknown>,\n propertyValue,\n );\n }\n\n /**\n * Gets a property from an object by key\n * @param object - The object to retrieve the property from\n * @param propertyKey - The property key (string or number)\n * @returns The value of the property\n */\n private getPropertyFromObject(\n object: Record<string, unknown> | null | undefined,\n propertyKey: string | number,\n ): unknown {\n return object !== null && object !== undefined\n ? object[propertyKey]\n : undefined;\n }\n\n /**\n * Evaluates an identifier node by looking it up in the context\n * @param node - The identifier node\n * @param context - The context containing variables and objects\n * @returns The value of the identifier from the context\n */\n private evaluateIdentifier(node: Identifier, context: FormContext): unknown {\n if (typeof context === 'object' && node.name in context) {\n return context[node.name];\n }\n return undefined;\n }\n\n /**\n * Evaluates an array expression node\n * @param node - The array expression node\n * @param context - The context containing variables and objects\n * @returns The evaluated array\n */\n private evaluateArrayExpression(\n node: ArrayExpression,\n context: FormContext,\n ): unknown[] {\n const resultArray: unknown[] = [];\n\n for (const element of node.elements) {\n if (element === null) {\n resultArray.push(undefined);\n continue;\n }\n\n if (element.type !== 'SpreadElement') {\n resultArray.push(this.evaluateAstNode(element, context));\n continue;\n }\n\n const spreadValue = this.evaluateAstNode(element.argument, context);\n\n if (Array.isArray(spreadValue)) {\n resultArray.push(...(spreadValue as unknown[]));\n continue;\n }\n throw new TypeError(`Cannot spread non-array value in array literal`);\n }\n\n return resultArray;\n }\n\n /**\n * Evaluates a unary expression (e.g., !x, -value, typeof obj)\n * @param node - The unary expression node\n * @param context - The context containing variables and objects\n * @returns The result of the unary operation\n */\n private evaluateUnaryExpression(\n node: UnaryExpression,\n context: FormContext,\n ): unknown {\n const argumentValue = this.evaluateAstNode(node.argument, context);\n\n switch (node.operator) {\n case '-':\n if (typeof argumentValue !== 'number') {\n throw new TypeError('Unary - operator requires a number');\n }\n return -argumentValue;\n\n case '+':\n if (typeof argumentValue === 'string') {\n const numberValue = Number(argumentValue);\n if (Number.isNaN(numberValue)) {\n throw new TypeError(\n `Cannot convert string \"${argumentValue}\" to number`,\n );\n }\n return numberValue;\n } else if (typeof argumentValue !== 'number') {\n throw new TypeError('Unary + operator requires a number or string');\n }\n return argumentValue;\n\n case '!':\n return !argumentValue;\n\n case '~':\n if (typeof argumentValue !== 'number') {\n throw new TypeError('Bitwise NOT (~) operator requires a number');\n }\n return ~argumentValue;\n\n case 'typeof':\n return typeof argumentValue;\n\n case 'void':\n return undefined;\n\n case 'delete':\n throw new Error('Delete operator is not supported in expressions');\n }\n }\n\n /**\n * Evaluates a logical expression (&&, ||, ??)\n * @param node - The logical expression node\n * @param context - The context containing variables and objects\n * @returns The result of the logical operation\n */\n private evaluateLogicalExpression(\n node: LogicalExpression,\n context: FormContext,\n ): unknown {\n const leftValue = this.evaluateAstNode(node.left, context);\n\n switch (node.operator) {\n case '&&':\n if (!leftValue) {\n return leftValue;\n }\n return this.evaluateAstNode(node.right, context);\n\n case '||':\n if (leftValue) {\n return leftValue;\n }\n return this.evaluateAstNode(node.right, context);\n\n case '??':\n if (leftValue === null || leftValue === undefined) {\n return this.evaluateAstNode(node.right, context);\n }\n return leftValue;\n }\n }\n\n /**\n * Evaluates a conditional (ternary) expression (condition ? trueValue : falseValue)\n * @param node - The conditional expression node\n * @param context - The context containing variables and objects\n * @returns The result based on the condition evaluation\n */\n private evaluateConditionalExpression(\n node: ConditionalExpression,\n context: FormContext,\n ): unknown {\n const condition = this.evaluateAstNode(node.test, context);\n const isConditionTrue = Boolean(condition);\n\n if (isConditionTrue) {\n return this.evaluateAstNode(node.consequent, context);\n }\n\n return this.evaluateAstNode(node.alternate, context);\n }\n\n /**\n * Evaluates an object expression (object literal)\n * @param node - The object expression node\n * @param context - The context containing variables and objects\n * @returns The evaluated object\n */\n private evaluateObjectExpression(\n node: ObjectExpression,\n context: FormContext,\n ): object {\n const result: Record<string, unknown> = {};\n\n for (const property of node.properties) {\n if (property.type !== 'Property') {\n continue;\n }\n\n const prop = property;\n\n let key: string;\n if (prop.key.type === 'Identifier' && !prop.computed) {\n key = prop.key.name;\n } else {\n const evaluatedKey = this.evaluateAstNode(prop.key, context);\n key = String(evaluatedKey);\n }\n\n result[key] = this.evaluateAstNode(prop.value, context);\n }\n\n return result;\n }\n\n /**\n * Evaluates a sequence expression (comma-separated expressions)\n * @param node - The sequence expression node\n * @param context - The context containing variables and objects\n * @returns The result of the last expression in the sequence\n */\n private evaluateSequenceExpression(\n node: SequenceExpression,\n context: FormContext,\n ): unknown {\n let result: unknown;\n\n for (const expression of node.expressions) {\n result = this.evaluateAstNode(expression, context);\n }\n\n return result;\n }\n\n /**\n * Evaluates a template literal\n * @param node - The template literal node\n * @param context - The context containing variables and objects\n * @returns The evaluated template string\n */\n private evaluateTemplateLiteral(\n node: TemplateLiteral,\n context: FormContext,\n ): string {\n let result = '';\n\n for (let i = 0; i < node.quasis.length; i++) {\n const cookedValue = node.quasis[i].value.cooked;\n result = result.concat(cookedValue ?? '');\n if (i < node.expressions.length) {\n const exprValue = this.evaluateAstNode(node.expressions[i], context);\n result = result.concat(String(exprValue));\n }\n }\n\n return result;\n }\n\n /**\n * Evaluates a function call expression with strict type checking\n * @param node - The function call expression node\n * @param context - The context containing variables and objects\n * @returns The result of the function call\n */\n private evaluateCallExpression(\n node: CallExpression,\n context: FormContext,\n ): unknown {\n if (node.callee.type !== 'MemberExpression') {\n throw new TypeError('Only method calls are supported');\n }\n\n const memberExpr = node.callee;\n const object = this.evaluateAstNode(memberExpr.object, context);\n\n const isOptionalCall = node.optional || memberExpr.optional;\n if (object === null || object === undefined) {\n if (isOptionalCall) {\n return undefined;\n }\n throw new Error('Cannot call methods on null || undefined');\n }\n\n let methodName: string;\n if (!memberExpr.computed && memberExpr.property.type === 'Identifier') {\n methodName = memberExpr.property.name;\n } else if (memberExpr.computed) {\n const propertyValue = this.evaluateAstNode(memberExpr.property, context);\n if (\n typeof propertyValue !== 'string' &&\n typeof propertyValue !== 'number'\n ) {\n throw new TypeError('Method name must be a string || number');\n }\n methodName = String(propertyValue);\n } else {\n throw new TypeError('Unexpected property type in method call');\n }\n\n const args: unknown[] = [];\n for (const arg of node.arguments) {\n args.push(this.evaluateAstNode(arg, context));\n }\n\n return this.callSafeMethod(object, methodName, args);\n }\n\n /**\n * Calls a method on an object after verifying it's safe to do so\n * @param object - The object to call the method on\n * @param methodName - The name of the method to call\n * @param args - The arguments to pass to the method\n * @returns The result of the method call\n */\n private callSafeMethod(\n object: unknown,\n methodName: string,\n args: unknown[],\n ): unknown {\n const objType: string = typeof object;\n const isAllowed = this.isAllowedMethod(objType, methodName, object);\n\n if (!isAllowed) {\n throw new TypeError(\n `Method ${methodName} is not supported on type ${objType}`,\n );\n }\n\n const objectWithMethod = object as ObjectWithMethod;\n const method = objectWithMethod[methodName];\n\n if (typeof method !== 'function') {\n throw new TypeError(`${methodName} is not a function`);\n }\n\n return method.apply(object, args);\n }\n\n private isAllowedMethod(\n objectType: string,\n methodName: string,\n object: unknown,\n ) {\n if (objectType === 'object' && object !== null) {\n const objectWithMethods = object as ObjectWithMethod;\n return (\n methodName in objectWithMethods &&\n typeof objectWithMethods[methodName] === 'function'\n );\n }\n\n if (!(objectType in SAFE_METHODS)) {\n return false;\n }\n return SAFE_METHODS[objectType as keyof SafeMethods].includes(methodName);\n }\n\n /**\n * Evaluates an arrow function expression\n * @param node - The arrow function expression node\n * @param context - The context containing variables and objects\n * @returns A function that can be called from other expressions\n */\n private evaluateArrowFunctionExpression(\n node: ArrowFunctionExpression,\n context: FormContext,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n ): Function {\n // We only support simple arrow functions with expression bodies\n if (\n node.body.type !== 'BlockStatement' &&\n node.body.type !== 'Identifier' &&\n node.body.type !== 'MemberExpression' &&\n node.body.type !== 'CallExpression' &&\n node.body.type !== 'BinaryExpression' &&\n node.body.type !== 'LogicalExpression' &&\n node.body.type !== 'TemplateLiteral'\n ) {\n throw new TypeError(\n `Unsupported arrow function body type: ${node.body.type}`,\n );\n }\n\n return (...args: unknown[]): unknown => {\n const arrowContext = { ...context };\n\n for (let i = 0; i < node.params.length && i < args.length; i++) {\n const param = node.params[i];\n if (param.type !== 'Identifier') {\n throw new TypeError(\n 'Only simple identifier parameters are supported in arrow functions',\n );\n }\n\n const paramName = param.name;\n arrowContext[paramName] = args[i];\n }\n\n if (node.body.type !== 'BlockStatement') {\n return this.evaluateAstNode(node.body, arrowContext);\n }\n\n throw new TypeError('Block-bodied arrow functions are not supported');\n };\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { UpdateStrategy } from '../types/content.type';\n\nexport const NGX_FW_DEFAULT_UPDATE_STRATEGY =\n new InjectionToken<UpdateStrategy>('NGX_FW_DEFAULT_UPDATE_STRATEGY', {\n providedIn: 'root',\n factory: () => 'change',\n });\n","import { InjectionToken } from '@angular/core';\nimport { ValidatorResolver } from '../types/validator-resolver.type';\n\nexport const NGX_VALIDATOR_RESOLVER = new InjectionToken<ValidatorResolver>(\n 'NGX_VALIDATOR_RESOLVER',\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { NgxFbGlobalConfiguration } from '../types/global-configuration.type';\n\nexport const NGX_FW_DEFAULT_CONFIG =\n new InjectionToken<NgxFbGlobalConfiguration>('NGX_FW_DEFAULT_CONFIG', {\n providedIn: 'root',\n factory: () => ({}) as NgxFbGlobalConfiguration,\n });\n\nexport const NGX_FW_CONFIG = new InjectionToken<\n readonly Partial<NgxFbGlobalConfiguration>[]\n>('NGX_FW_CONFIG', {\n providedIn: 'root',\n factory: () => [],\n});\n\nexport const NGX_FW_CONFIG_RESOLVED =\n new InjectionToken<NgxFbGlobalConfiguration>('NGX_FW_CONFIG_RESOLVED', {\n providedIn: 'root',\n factory: () => {\n const base = inject(NGX_FW_DEFAULT_CONFIG);\n const extras = inject(NGX_FW_CONFIG, { optional: true }) ?? [];\n return mergeDeep(base, ...extras);\n },\n });\n\nfunction mergeDeep<T>(base: T, ...partials: readonly Partial<T>[]): T {\n const out = { ...base };\n for (const p of partials) {\n for (const k of Object.keys(p) as (keyof T)[]) {\n const src = (p as unknown as Record<keyof T, unknown>)[k];\n const dst = (out as unknown as Record<keyof T, unknown>)[k];\n\n const bothObjects =\n typeof dst === 'object' &&\n dst !== null &&\n typeof src === 'object' &&\n src !== null &&\n !Array.isArray(dst) &&\n !Array.isArray(src);\n\n if (bothObjects) {\n (out as unknown as Record<keyof T, unknown>)[k] = mergeDeep(\n dst as unknown as T,\n src as Partial<T>,\n );\n continue;\n }\n (out as unknown as Record<keyof T, unknown>)[k] = src;\n }\n }\n return out;\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n Provider,\n Type,\n} from '@angular/core';\nimport { ComponentRegistrationService } from '../services/component-registration.service';\nimport { ComponentRegistrationConfig } from '../types/registration.type';\nimport { AsyncValidatorFn, ValidatorFn } from '@angular/forms';\nimport {\n AsyncValidatorConfig,\n RegistrationRecord,\n ValidatorConfig,\n ValidatorKey,\n} from '../types/validation.type';\nimport { ValidatorRegistrationService } from '../services/validator-registration.service';\nimport { ExpressionService } from '../services/expression.service';\nimport { NGX_FW_DEFAULT_UPDATE_STRATEGY } from '../tokens/default-update-strategy';\nimport { NGX_FW_COMPONENT_REGISTRATIONS } from '../tokens/component-registrations';\nimport {\n NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS,\n NGX_FW_VALIDATOR_REGISTRATIONS,\n} from '../tokens/validator-registrations';\nimport { NGX_VALIDATOR_RESOLVER } from '../tokens/validator-resolver';\nimport { NGX_FW_COMPONENT_RESOLVER } from '../tokens/component-resolver';\nimport { NGX_FW_CONFIG } from '../tokens/global-config';\nimport { FormbarConfig } from '../types/provide.type';\n\n/**\n * Configures and provides ngx-formbar to your application.\n *\n * This function is used in app.config.ts to register form components, validators,\n * and set global configuration for the formbar library.\n *\n * @param config Configuration object for ngx-formbar:\n * - componentRegistrations: Optional mapping of control types to component implementations\n * - validatorRegistrations: Optional mapping of validator names to validator functions\n * (Angular's required, requiredTrue, email, and nullValidator are registered by default)\n * - asyncValidatorRegistrations: Optional mapping of async validator names to async validator functions\n * - updateOn: Optional default update strategy for all form controls\n * - globalConfig: Optional global configuration settings\n *\n * @returns Angular environment providers to be included in application configuration\n *\n * @example\n * ```ts\n * // app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideFormbar({\n * componentRegistrations: {\n * text: TextInputComponent,\n * select: SelectComponent,\n * },\n * validatorRegistrations: {\n * customValidator: [myCustomValidator]\n * }\n * })\n * ]\n * };\n * ```\n */\nexport function provideFormbar<\n S extends RegistrationRecord,\n A extends RegistrationRecord,\n>(config?: FormbarConfig<S, A>): EnvironmentProviders {\n config ??= {};\n const {\n componentRegistrations,\n validatorRegistrations,\n asyncValidatorRegistrations,\n updateOn,\n globalConfig,\n } = config;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n {\n provide: NGX_FW_COMPONENT_RESOLVER,\n useClass: ComponentRegistrationService,\n },\n {\n provide: NGX_VALIDATOR_RESOLVER,\n useClass: ValidatorRegistrationService,\n },\n ExpressionService,\n ];\n\n if (componentRegistrations !== undefined) {\n providers.push({\n provide: NGX_FW_COMPONENT_REGISTRATIONS,\n useValue: toComponentRegistrationMap(componentRegistrations),\n });\n }\n\n if (validatorRegistrations !== undefined) {\n providers.push({\n provide: NGX_FW_VALIDATOR_REGISTRATIONS,\n useFactory: () => toValidatorRegistrationMap(validatorRegistrations),\n multi: true,\n });\n }\n\n if (asyncValidatorRegistrations !== undefined) {\n providers.push({\n provide: NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS,\n useFactory: () =>\n toAsyncValidatorRegistrationMap(asyncValidatorRegistrations),\n multi: true,\n });\n }\n\n if (updateOn !== undefined) {\n providers.push({\n provide: NGX_FW_DEFAULT_UPDATE_STRATEGY,\n useValue: updateOn,\n });\n }\n\n if (globalConfig !== undefined) {\n providers.push({\n provide: NGX_FW_CONFIG,\n useValue: globalConfig,\n multi: true,\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Converts component registration array to a lookup map\n *\n * @param componentRegistrations Array of component registration configurations\n * @returns Map of component types to component implementations\n */\nfunction toComponentRegistrationMap(\n componentRegistrations: ComponentRegistrationConfig,\n) {\n return new Map<string, Type<unknown>>(Object.entries(componentRegistrations));\n}\n\n/**\n * Converts validator configuration to a map of validator functions\n * Resolves validator keys to actual validator functions\n *\n * @param config Configuration object for validators\n * @returns Map of validator keys to validator function arrays\n */\nfunction toValidatorRegistrationMap<S extends RegistrationRecord>(\n config: ValidatorConfig<S>,\n): ReadonlyMap<string, ValidatorFn[]> {\n return toValidatorMap<S, ValidatorFn>(config);\n}\n\n/**\n * Converts async validator configuration to a map of async validator functions\n *\n * @param config Configuration object for async validators\n * @returns Map of validator keys to async validator function arrays\n */\nfunction toAsyncValidatorRegistrationMap<A extends RegistrationRecord>(\n config: AsyncValidatorConfig<A>,\n): ReadonlyMap<string, AsyncValidatorFn[]> {\n return toValidatorMap<A, AsyncValidatorFn>(config);\n}\n\n/**\n * Resolves validator references to actual validator functions\n * Supports recursive validator references and memoization\n *\n * @param validators Array of validator functions or validator keys\n * @param registrations Map of all registered validators\n * @param memo Memoization cache to avoid circular references\n * @param visiting\n * @returns Flattened array of validator functions\n */\nfunction toValidatorFn<T extends RegistrationRecord, V>(\n validators: (V | ValidatorKey<T>)[],\n registrations: Record<string, (V | ValidatorKey<T>)[]>,\n memo = new Map<string, V[]>(),\n visiting = new Set<string>(),\n): V[] {\n return validators.flatMap((v) => {\n switch (typeof v) {\n case 'string': {\n const cached = memo.get(v);\n if (cached) return cached;\n\n if (visiting.has(v))\n throw new Error(\n `Cyclic validator reference: ${[...visiting, v].join(' -> ')}`,\n );\n\n if (!Object.prototype.hasOwnProperty.call(registrations, v))\n throw new Error(`Unknown validator key: \"${v}\"`);\n const spec = registrations[v];\n\n visiting.add(v);\n const resolved = toValidatorFn(spec, registrations, memo, visiting);\n visiting.delete(v);\n memo.set(v, resolved);\n return resolved;\n }\n default:\n return v;\n }\n });\n}\n\nfunction toValidatorMap<T extends RegistrationRecord, V>(\n source: Record<string, (V | ValidatorKey<T>)[]>,\n): ReadonlyMap<string, V[]> {\n const out = new Map<string, V[]>();\n const memo = new Map<string, V[]>();\n\n for (const key in source) {\n if (!Object.prototype.hasOwnProperty.call(source, key)) {\n continue;\n }\n\n const spec = source[key];\n const cached = memo.get(key);\n if (cached) {\n out.set(key, cached);\n continue;\n }\n const resolved = toValidatorFn(spec, source, memo);\n memo.set(key, resolved);\n out.set(key, resolved);\n }\n return out;\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { NgxFbAbstractControl, NgxFbFormGroup } from '../types/content.type';\nimport { FormService } from '../services/form.service';\nimport { ExpressionService } from '../services/expression.service';\nimport { Program } from 'acorn';\nimport { FormContext } from '../types/expression.type';\nimport { NgxfbGroupDirective } from '../directives/ngxfb-group.directive';\n\n/**\n * Computes a reactive readonly state based on control content\n *\n * The readonly state is determined using the following priority:\n * 1. If content.readonly is a boolean, that value is used directly\n * 2. If content.readonly is an expression string, it's parsed to AST and evaluated\n * against the current form values\n * 3. If no readonly property is defined, the control inherits the readonly state\n * from its parent group\n *\n * This hierarchical inheritance ensures that child controls are automatically\n * set to readonly when their parent group is readonly, unless explicitly overridden.\n *\n * @param content Signal containing control configuration with potential readonly property\n * @returns Computed signal that resolves to boolean readonly state\n */\nexport function withReadonlyState(content: Signal<NgxFbAbstractControl>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n const parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n const parentGroupIsReadonly: Signal<boolean> = computed<boolean>(() => {\n const parentGroup = parentGroupDirective;\n if (!parentGroup) {\n return false;\n }\n\n return parentGroup.readonly();\n });\n\n const readonlyAst = computed<Program | null>(() => {\n const readonlyOption = content().readonly;\n if (\n typeof readonlyOption === 'boolean' ||\n typeof readonlyOption === 'function'\n ) {\n return null;\n }\n return expressionService.parseExpressionToAst(readonlyOption);\n });\n\n const readonlyBool = computed(() => {\n const readonlyOption = content().readonly;\n if (typeof readonlyOption !== 'boolean') {\n return null;\n }\n return readonlyOption;\n });\n\n const readonlyFunction = computed(() => {\n const readonlyOption = content().readonly;\n if (typeof readonlyOption !== 'function') {\n return null;\n }\n return readonlyOption;\n });\n\n return computed<boolean>(() => {\n const readonlyStatic = readonlyBool();\n\n if (readonlyStatic !== null) {\n return readonlyStatic;\n }\n\n const reactiveFormValues = formService.formValue();\n const currentSynchronousFormValues = formService.formGroup\n .value as FormContext;\n const evaluationContext =\n reactiveFormValues ?? currentSynchronousFormValues;\n\n const readonlyFn = readonlyFunction();\n\n if (readonlyFn) {\n return readonlyFn(evaluationContext);\n }\n\n const ast = readonlyAst();\n if (!ast) {\n return parentGroupIsReadonly();\n }\n\n const readonly =\n expressionService.evaluateExpression(ast, evaluationContext) ?? false;\n return readonly as boolean;\n });\n}\n","import { computed, effect, inject, Signal, untracked } from '@angular/core';\nimport {\n HideStrategy,\n NgxFbBaseContent,\n NgxFbContent,\n NgxFbFormGroup,\n ValueStrategy,\n} from '../types/content.type';\nimport { ExpressionService } from '../services/expression.service';\nimport { FormService } from '../services/form.service';\nimport { StateHandling } from '../types/registration.type';\nimport { SimpleFunction, ValueHandleFunction } from '../types/functions.type';\nimport { Program } from 'acorn';\nimport { AbstractControl, ControlContainer, FormGroup } from '@angular/forms';\nimport { FormContext } from '../types/expression.type';\nimport { NgxfbGroupDirective } from '../directives/ngxfb-group.directive';\n\n/**\n * Computes a reactive hidden state based on control content\n *\n * The hidden state is determined using the following priority:\n * 1. If content.hidden is an expression string, it's parsed to AST and evaluated\n * against the current form values\n * 2. If no hidden expression is defined, the control inherits the hidden state\n * from its parent group\n * 3. Both conditions can be combined - a control is hidden if either its own\n * condition evaluates to true OR its parent group is hidden\n *\n * @param content Signal containing control configuration with potential hidden expression\n * @returns Computed signal that resolves to boolean hidden state\n */\nexport function withHiddenState(content: Signal<NgxFbBaseContent>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n const parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n const parentGroupIsHidden: Signal<boolean> = computed<boolean>(() => {\n const parentGroup = parentGroupDirective;\n if (!parentGroup) {\n return false;\n }\n\n return parentGroup.isHidden();\n });\n\n const visibilityAst = computed<Program | null>(() => {\n const hiddenOption = content().hidden;\n if (typeof hiddenOption !== 'string') {\n return null;\n }\n return expressionService.parseExpressionToAst(hiddenOption);\n });\n\n const visibilityFunction = computed(() => {\n const visibilityOption = content().hidden;\n if (typeof visibilityOption !== 'function') {\n return null;\n }\n return visibilityOption;\n });\n\n return computed<boolean>(() => {\n const reactiveFormValues = formService.formValue();\n const currentSynchronousFormValues = formService.formGroup\n .value as FormContext;\n const evaluationContext =\n reactiveFormValues ?? currentSynchronousFormValues;\n\n const visibilityFn = visibilityFunction();\n\n if (visibilityFn) {\n return visibilityFn(evaluationContext);\n }\n\n const ast = visibilityAst();\n if (!ast) {\n return parentGroupIsHidden();\n }\n\n const isHidden: boolean =\n (expressionService.evaluateExpression(ast, evaluationContext) as\n | boolean\n | undefined) ?? false;\n return isHidden || parentGroupIsHidden();\n });\n}\n\n/**\n * Creates a computed attribute value for hidden DOM elements\n *\n * When visibilityHandling is set to 'auto', this returns a boolean attribute value\n * that can be used with Angular's [attr.hidden] binding. When set to 'manual',\n * it returns null so the attribute is not applied.\n *\n * @param options Configuration object for hidden attribute\n * @param options.hiddenSignal Signal that indicates if the control should be hidden\n * @param options.hiddenHandlingSignal Signal that determines how visibility is managed\n * @returns Computed signal that resolves to attribute value (true or null)\n */\nexport function withHiddenAttribute(options: {\n hiddenSignal: Signal<boolean>;\n hiddenHandlingSignal: Signal<StateHandling>;\n}) {\n return computed(() => {\n const isHidden = options.hiddenSignal();\n const visibilityHandling = options.hiddenHandlingSignal();\n if (visibilityHandling !== 'auto') {\n return null;\n }\n return isHidden ? true : null;\n });\n}\n\n/**\n * Creates an effect that manages control visibility in forms\n *\n * Based on visibility state and hide strategy, this effect:\n * 1. Attaches the control to the form when visible\n * 2. Detaches the control from the form when hidden and strategy is 'remove'\n * 3. Manages control values based on the specified valueStrategy when visibility changes\n *\n * @param options Configuration object for hidden effect\n * @param options.content Signal containing control configuration\n * @param options.name Signal containing the name of the control\n * @param options.controlInstance Signal with the form control instance\n * @param options.hiddenSignal Signal that indicates if the control should be hidden\n * @param options.hideStrategySignal Signal with the strategy for handling hidden controls\n * @param options.valueStrategySignal Signal with the strategy for handling control values\n * @param options.parentValueStrategySignal Signal with the parent's value strategy\n * @param options.attachFunction Function to call when control should be attached\n * @param options.detachFunction Function to call when control should be detached\n * @param options.valueHandleFunction Function to handle control value based on strategy\n */\nexport function hiddenEffect(options: {\n content: Signal<NgxFbContent>;\n name: Signal<string>;\n controlInstance: Signal<AbstractControl>;\n hiddenSignal: Signal<boolean>;\n hideStrategySignal: Signal<HideStrategy | undefined>;\n valueStrategySignal: Signal<ValueStrategy | undefined>;\n parentValueStrategySignal: Signal<ValueStrategy | undefined>;\n attachFunction: SimpleFunction;\n detachFunction: SimpleFunction;\n valueHandleFunction: ValueHandleFunction;\n}) {\n const parentContainer = inject(ControlContainer);\n const parentFormGroup = parentContainer.control as FormGroup | null;\n effect(() => {\n options.controlInstance();\n const isHidden = options.hiddenSignal();\n const hideStrategy = options.hideStrategySignal();\n const valueStrategy =\n options.valueStrategySignal() ?? options.parentValueStrategySignal();\n const formControl = untracked(() => parentFormGroup?.get(options.name()));\n\n // Re-attach control\n // On initial render the form control will not be attached, but we need it for the hide strategy \"keep\"\n if (!formControl && (!isHidden || hideStrategy === 'keep')) {\n untracked(() => {\n options.attachFunction();\n });\n return;\n }\n\n // Control is already detached\n if (hideStrategy === 'remove' && !formControl) {\n return;\n }\n\n // Remove control\n if (hideStrategy === 'remove' && isHidden) {\n untracked(() => {\n options.detachFunction();\n });\n }\n\n // Only thing left to check is value strategy\n untracked(() => {\n options.valueHandleFunction(valueStrategy);\n });\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { NGX_VALIDATOR_RESOLVER } from '../tokens/validator-resolver';\nimport { NgxFbAbstractControl } from '../types/content.type';\n\n/**\n * Computes a reactive array of validators based on control content\n *\n * Extracts validator keys from content and maps them to actual validator functions\n * by looking them up in the validator registration service.\n *\n * @param content Signal containing control configuration with validator keys\n * @returns Computed signal that resolves to an array of validator functions\n */\nexport function withValidators(content: Signal<NgxFbAbstractControl>) {\n const validatorRegistrations = inject(NGX_VALIDATOR_RESOLVER).registrations;\n\n return computed(() => {\n const validatorKeys = content().validators ?? [];\n return validatorKeys.flatMap(\n (key) => validatorRegistrations().get(key) ?? [],\n );\n });\n}\n\n/**\n * Computes a reactive array of async validators based on control content\n *\n * Extracts async validator keys from content and maps them to actual async validator\n * functions by looking them up in the validator registration service.\n *\n * @param content Signal containing control configuration with async validator keys\n * @returns Computed signal that resolves to an array of async validator functions\n */\nexport function withAsyncValidators(content: Signal<NgxFbAbstractControl>) {\n const asyncValidatorRegistrations = inject(\n NGX_VALIDATOR_RESOLVER,\n ).asyncRegistrations;\n return computed(() => {\n const validatorKeys = content().asyncValidators ?? [];\n return validatorKeys.flatMap(\n (key) => asyncValidatorRegistrations().get(key) ?? [],\n );\n });\n}\n","import { inject, Injectable } from '@angular/core';\nimport { TestIdBuilderFn } from '../types/functions.type';\nimport { NGX_FW_CONFIG_RESOLVED } from '../tokens/global-config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgxFbConfigurationService {\n private readonly _config = inject(NGX_FW_CONFIG_RESOLVED);\n\n get testIdBuilder(): TestIdBuilderFn | undefined {\n return this._config.testIdBuilderFn;\n }\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { TestIdBuilderFn } from '../types/functions.type';\nimport { NgxFbBaseContent, NgxFbFormGroup } from '../types/content.type';\nimport { NgxfbGroupDirective } from '../directives/ngxfb-group.directive';\nimport { NgxFbConfigurationService } from '../services/configuration.service';\n\n/**\n * Creates a computed signal that extracts the ID for testing purposes\n *\n * This utility function derives a test identifier from a form control's content,\n * which can be used for targeting elements in automated tests.\n *\n * @template T - Type extending NgxFbBaseContent\n * @param content - Signal containing the control or group content configuration\n * @param name - Signal containing the name of the control\n * @param testIdBuilder - Signal holding a testIdBuilder function\n * @returns Computed signal that resolves to the element's ID for testing\n */\nexport function withTestId(\n content: Signal<NgxFbBaseContent>,\n name: Signal<string>,\n testIdBuilder: Signal<TestIdBuilderFn | undefined>,\n): Signal<string> {\n const parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n const globalConfig = inject(NgxFbConfigurationService);\n const globalTestIdBuilder = globalConfig.testIdBuilder;\n\n return computed(() => {\n const contentValue = content();\n const id = name();\n const parentGroupTestId = parentGroupDirective?.testId();\n const builderFn = testIdBuilder();\n\n if (builderFn) {\n return builderFn(contentValue, id, parentGroupTestId);\n }\n\n if (globalTestIdBuilder) {\n return globalTestIdBuilder(contentValue, id, parentGroupTestId);\n }\n\n if (!parentGroupTestId) {\n return id;\n }\n return [parentGroupTestId, id].join('-');\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport {\n NgxFbAbstractControl,\n NgxFbFormGroup,\n UpdateStrategy,\n} from '../types/content.type';\nimport { NGX_FW_DEFAULT_UPDATE_STRATEGY } from '../tokens/default-update-strategy';\nimport { NgxfbGroupDirective } from '../directives/ngxfb-group.directive';\n\n/**\n * Creates a computed signal for the control's update strategy\n *\n * This function determines when form controls should update:\n * - Uses the control's specified updateOn strategy if defined\n * - Falls back to parent group's strategy when not defined in the control\n * - Handles inheritance of update strategies through the form hierarchy\n * - Uses the application's default strategy as final fallback\n *\n * Update strategies control when form values and validation happen:\n * - 'change': Update on every change event (default Angular behavior)\n * - 'blur': Update when the control loses focus\n * - 'submit': Update only when the form is submitted\n *\n * @param content Signal containing the NgxFbAbstractControl with possible updateOn configuration\n * @returns Computed signal providing the resolved update strategy\n */\nexport function withUpdateStrategy(content: Signal<NgxFbAbstractControl>) {\n const parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n const defaultUpdateStrategy = inject(NGX_FW_DEFAULT_UPDATE_STRATEGY);\n\n const parentGroupUpdateStrategy: Signal<UpdateStrategy> =\n computed<UpdateStrategy>(() => {\n return parentGroupDirective?.updateStrategy();\n });\n\n return computed<UpdateStrategy>(() => {\n return (\n content().updateOn ?? parentGroupUpdateStrategy() ?? defaultUpdateStrategy\n );\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { FormService } from '../services/form.service';\nimport { ExpressionService } from '../services/expression.service';\nimport { Program } from 'acorn';\nimport { FormContext } from '../types/expression.type';\nimport { NgxFbFormGroup } from '../types/content.type';\n\n/**\n * Computes a dynamic title for a form control based on expression evaluation\n *\n * @param content Signal containing control configuration with dynamicTitle property\n * @returns Computed signal that resolves to the evaluated dynamic title string or undefined\n */\nexport function withDynamicTitle(content: Signal<NgxFbFormGroup>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n\n const dynamicTitleAst = computed<Program | null>(() => {\n const dynamicTitleOption = content().dynamicTitle;\n if (typeof dynamicTitleOption !== 'string') {\n return null;\n }\n return expressionService.parseExpressionToAst(dynamicTitleOption);\n });\n\n const dynamicTitleFunction = computed(() => {\n const dynamicTitleOption = content().dynamicTitle;\n if (typeof dynamicTitleOption !== 'function') {\n return null;\n }\n return dynamicTitleOption;\n });\n\n return computed<string | undefined>(() => {\n const reactiveFormValues = formService.formValue();\n const currentSynchronousFormValues = formService.formGroup\n .value as FormContext;\n const evaluationContext =\n reactiveFormValues ?? currentSynchronousFormValues;\n\n const dynamicTitleFn = dynamicTitleFunction();\n\n if (dynamicTitleFn) {\n return dynamicTitleFn(evaluationContext);\n }\n\n const ast = dynamicTitleAst();\n if (!ast) {\n return undefined;\n }\n\n const title = expressionService.evaluateExpression(ast, evaluationContext);\n return title as string | undefined;\n });\n}\n","import {\n computed,\n Directive,\n inject,\n input,\n OnDestroy,\n signal,\n Signal,\n} from '@angular/core';\nimport { NgxFbFormGroup, ValueStrategy } from '../types/content.type';\nimport { ControlContainer, FormControl, FormGroup } from '@angular/forms';\nimport { StateHandling } from '../types/registration.type';\nimport {\n disabledEffect,\n withDisabledState,\n} from '../composables/disabled.state';\nimport { withReadonlyState } from '../composables/readonly.state';\nimport {\n hiddenEffect,\n withHiddenAttribute,\n withHiddenState,\n} from '../composables/hidden.state';\nimport { withAsyncValidators, withValidators } from '../composables/validators';\nimport { withTestId } from '../composables/testId';\nimport { withUpdateStrategy } from '../composables/update-strategy';\nimport { withDynamicTitle } from '../composables/dynamic-title';\nimport { TestIdBuilderFn } from '../types/functions.type';\n\n/**\n * Core directive for creating form groups in ngx-formbar.\n *\n * This directive handles the integration between Angular's reactive forms and\n * ngx-formbar's declarative configuration for FormGroups. It manages:\n *\n * - Group registration and lifecycle within parent forms\n * - State management (hidden, disabled, readonly)\n * - Validation setup\n * - Test ID generation\n * - Dynamic title support\n * - Child control management\n *\n * Use this directive with hostDirectives in your custom group components:\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * {\n * directive: NgxfbGroupDirective,\n * inputs: ['content', 'name'],\n * }\n * ],\n * })\n * export class GroupComponent {\n * private readonly control = inject(NgxfbGroupDirective<Group>);\n * readonly content = this.control.content;\n * readonly controls = this.control.controls;\n * }\n * ```\n *\n * @template T Type of the group configuration, must extend NgxFbFormGroup\n */\n@Directive({\n selector: '[ngxfbGroup]',\n host: {\n '[attr.hidden]': 'hiddenAttribute()',\n },\n})\nexport class NgxfbGroupDirective<T extends NgxFbFormGroup>\n implements OnDestroy\n{\n private parentContainer = inject(ControlContainer);\n\n private readonly parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n /**\n * Required input containing the group configuration\n * Defines properties like type, controls, validation, and state expressions\n */\n readonly content = input.required<T>();\n\n /**\n * Required input for the group's name\n * Used as the key in the parent FormGroup\n */\n readonly name = input.required<string>();\n\n /**\n * Signal for managing the visibility handling strategy ('auto' or 'manual')\n * - 'auto': directive handles visibility via hidden attribute\n * - 'manual': component handles visibility in its own template\n */\n private readonly visibilityHandling = signal<StateHandling>('auto');\n\n /**\n * Signal for managing the disabled state handling strategy ('auto' or 'manual')\n * - 'auto': directive handles disabled state via FormGroup methods\n * - 'manual': component handles disabled state in its own template\n */\n private readonly disabledHandling = signal<StateHandling>('auto');\n\n /**\n * Signal for the test ID builder function\n * Used to customize how test IDs are generated\n */\n private readonly testIdBuilder = signal<TestIdBuilderFn | undefined>(\n undefined,\n );\n\n /**\n * Computed test ID derived from the group's name\n * Used for automated testing identification\n *\n * Access this in your component template:\n * ```html\n * <div [attr.data-testid]=\"testId()\">...</div>\n * ```\n */\n readonly testId = withTestId(this.content, this.name, this.testIdBuilder);\n\n /**\n * Computed signal for the group's hide strategy\n * Determines how the group behaves when hidden (keep or remove from form)\n */\n readonly hideStrategy = computed(() => this.content().hideStrategy);\n\n /**\n * Computed signal for the group's value strategy\n * Determines how the group's values are managed when visibility changes:\n * - 'last': preserves last values\n * - 'default': reverts to default values\n * - 'reset': clears values\n */\n readonly valueStrategy: Signal<ValueStrategy | undefined> = computed(\n () => this.content().valueStrategy ?? this.parentValueStrategy(),\n );\n\n /**\n * Computed signal for the parent's value strategy\n * Used when group doesn't define its own strategy\n */\n readonly parentValueStrategy = computed(() =>\n this.parentGroupDirective?.valueStrategy(),\n );\n\n /**\n * Computed signal for the hidden state\n * True when the group should be hidden based on 'hidden' expression\n *\n * Use this in your component when implementing custom visibility handling:\n * ```typescript\n * readonly isHidden = this.control.isHidden;\n * ```\n */\n readonly isHidden = withHiddenState(this.content);\n\n /**\n * Computed signal for the hidden attribute\n * Used in DOM binding to show/hide the group element\n */\n readonly hiddenAttribute = withHiddenAttribute({\n hiddenSignal: this.isHidden,\n hiddenHandlingSignal: this.visibilityHandling,\n });\n\n /**\n * Computed signal for the disabled state\n * True when the group should be disabled based on 'disabled' expression\n *\n * Use this in your component for custom disabled state handling:\n * ```typescript\n * readonly disabled = this.control.disabled;\n * ```\n */\n readonly disabled = withDisabledState(this.content);\n\n /**\n * Computed signal for the readonly state\n * True when the group should be readonly based on 'readonly' expression\n *\n * Use this in your component to implement readonly behavior:\n * ```typescript\n * readonly readonly = this.control.readonly;\n * ```\n */\n readonly readonly = withReadonlyState(this.content);\n\n /**\n * Computed signal for the update strategy\n * Determines when form values are updated ('change', 'blur', or 'submit')\n */\n readonly updateStrategy = withUpdateStrategy(this.content);\n\n /**\n * Computed signal for the dynamic title\n * Contains the evaluated result of the dynamicTitle expression\n *\n * Use this in your component to display dynamic titles:\n * ```typescript\n * readonly displayTitle = computed(() => {\n * const dynamic = this.control.dynamicTitle();\n * return dynamic || this.content().title || '';\n * });\n * ```\n */\n readonly dynamicTitle = withDynamicTitle(this.content);\n\n /**\n * Computed signal for the validators\n * Contains validator functions derived from configuration keys\n */\n private readonly validators = withValidators(this.content);\n\n /**\n * Computed signal for the async validators\n * Contains async validator functions derived from configuration keys\n */\n private readonly asyncValidators = withAsyncValidators(this.content);\n\n /**\n * Computed signal for the form group instance\n * Creates a new FormGroup with appropriate validators and configuration\n */\n private readonly groupInstance = computed(() => {\n const validators = this.validators();\n const asyncValidators = this.asyncValidators();\n const updateOn = this.updateStrategy();\n return new FormGroup(\n {},\n {\n validators,\n asyncValidators,\n updateOn,\n },\n );\n });\n\n /**\n * Computed signal for the title of the group\n * Returns the static title from the configuration\n */\n readonly title = computed(() => this.content().title);\n\n /**\n * Computed signal for the child controls of the group\n * Returns an array of [name, control] pairs for rendering\n */\n readonly controls = computed(() => Object.entries(this.content().controls));\n\n /**\n * Access to the parent FormGroup containing this group\n */\n get parentFormGroup() {\n return this.parentContainer.control as FormGroup | null;\n }\n\n /**\n * Access to this group's FormGroup instance\n * Use this to access validation state, errors, and other FormGroup methods\n */\n get formGroup() {\n return this.parentFormGroup?.get(this.name()) as FormControl | null;\n }\n\n constructor() {\n hiddenEffect({\n content: this.content,\n name: this.name,\n controlInstance: this.groupInstance,\n hiddenSignal: this.isHidden,\n hideStrategySignal: this.hideStrategy,\n valueStrategySignal: this.valueStrategy,\n parentValueStrategySignal: this.parentValueStrategy,\n attachFunction: this.setGroup.bind(this),\n detachFunction: this.removeGroup.bind(this),\n valueHandleFunction: this.handleValue.bind(this),\n });\n\n disabledEffect({\n disabledSignal: this.disabled,\n disabledHandlingSignal: this.disabledHandling,\n enableFunction: this.enableGroup.bind(this),\n disableFunction: this.disableGroup.bind(this),\n });\n }\n\n /**\n * Sets the visibility handling strategy\n * Determines if visibility should be managed by the component (manual) or by Formbar (auto)\n *\n * Use 'manual' when implementing custom visibility handling in your component:\n * ```typescript\n * constructor() {\n * this.control.setVisibilityHandling('manual');\n * }\n * ```\n *\n * @param visibilityHandling Strategy for handling visibility ('auto' or 'manual')\n */\n setVisibilityHandling(visibilityHandling: StateHandling) {\n this.visibilityHandling.set(visibilityHandling);\n }\n\n /**\n * Sets the disabled handling strategy\n * Determines if disabled state should be managed by the component (manual) or by Formbar (auto)\n *\n * Use 'manual' when implementing custom disabled state handling in your component:\n * ```typescript\n * constructor() {\n * this.control.setDisabledHandling('manual');\n * }\n * ```\n *\n * @param disabledHandling Strategy for handling disabled state ('auto' or 'manual')\n */\n setDisabledHandling(disabledHandling: StateHandling) {\n this.disabledHandling.set(disabledHandling);\n }\n\n /**\n * Sets the function to use for building a test id.\n * This allows custom test ID generation strategies to be used.\n *\n * @param builderFn Function that returns the test id\n */\n setTestIdBuilderFn(builderFn: TestIdBuilderFn | undefined) {\n this.testIdBuilder.set(builderFn);\n }\n\n /**\n * Registers this group with the parent FormGroup\n * @private\n */\n private setGroup() {\n this.parentFormGroup?.setControl(this.name(), this.groupInstance(), {\n emitEvent: false,\n });\n }\n\n /**\n * Removes this group from the parent FormGroup\n * @private\n */\n private removeGroup() {\n const id = this.name();\n const formGroup = this.formGroup;\n // Check if control exists immediately before attempting removal\n if (formGroup) {\n this.parentFormGroup?.removeControl(id, { emitEvent: false });\n }\n }\n\n /**\n * Enables the form group\n * @private\n */\n private enableGroup() {\n const formGroup = this.groupInstance();\n formGroup.enable({ emitEvent: false });\n }\n\n /**\n * Disables the form group\n * @private\n */\n private disableGroup() {\n const formGroup = this.groupInstance();\n formGroup.disable({ emitEvent: false });\n }\n\n /**\n * Handles value changes when visibility changes\n * @param valueStrategy Strategy for handling values\n * @private\n */\n private handleValue(valueStrategy?: ValueStrategy) {\n switch (valueStrategy) {\n case 'last':\n break;\n case 'default':\n break;\n default:\n // Instead of resetting the group, we need to reset the controls individually\n // to allow them to overwrite the value strategy\n // If a control doesn't have a value strategy, we reset it\n Object.entries(this.content().controls).forEach(([name, control]) => {\n if (!('valueStrategy' in control)) {\n return;\n }\n\n if (control.valueStrategy) {\n return;\n }\n const formControl = this.formGroup?.get(name);\n if (formControl) {\n formControl.reset(undefined, { emitEvent: false });\n }\n });\n break;\n }\n }\n\n /**\n * Removes the group when the directive is destroyed\n */\n ngOnDestroy(): void {\n this.removeGroup();\n }\n}\n","import { computed, effect, inject, Signal, untracked } from '@angular/core';\nimport { Program } from 'acorn';\nimport { ExpressionService } from '../services/expression.service';\nimport { FormService } from '../services/form.service';\nimport { StateHandling } from '../types/registration.type';\nimport { SimpleFunction } from '../types/functions.type';\nimport { FormContext } from '../types/expression.type';\nimport { NgxFbAbstractControl, NgxFbFormGroup } from '../types/content.type';\nimport { NgxfbGroupDirective } from '../directives/ngxfb-group.directive';\n\n/**\n * Computes a reactive disabled state based on control content\n *\n * The disabled state is determined using the following priority:\n * 1. If content.disabled is a boolean, that value is used directly\n * 2. If content.disabled is an expression string, it's parsed to AST and evaluated\n * against the current form values\n * 3. If no disabled property is defined, the control inherits the disabled state\n * from its parent group\n *\n * This hierarchical inheritance ensures that child controls are automatically\n * disabled when their parent group is disabled, unless explicitly overridden.\n *\n * @param content Signal containing control configuration with potential disabled property\n * @returns Computed signal that resolves to boolean disabled state\n */\nexport function withDisabledState(content: Signal<NgxFbAbstractControl>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n const parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n skipSelf: true,\n });\n\n const parentGroupIsDisabled: Signal<boolean> = computed<boolean>(() => {\n const parentGroup = parentGroupDirective;\n if (!parentGroup) {\n return false;\n }\n\n return parentGroup.disabled();\n });\n\n const disabledAst = computed<Program | null>(() => {\n const disabledOption = content().disabled;\n if (typeof disabledOption !== 'string') {\n return null;\n }\n return expressionService.parseExpressionToAst(disabledOption);\n });\n\n const disabledBool = computed(() => {\n const disabledOption = content().disabled;\n if (typeof disabledOption !== 'boolean') {\n return null;\n }\n return disabledOption;\n });\n\n const disabledFunction = computed(() => {\n const disabledOption = content().disabled;\n if (typeof disabledOption !== 'function') {\n return null;\n }\n return disabledOption;\n });\n\n return computed<boolean>(() => {\n const disabledStatic = disabledBool();\n\n if (disabledStatic !== null) {\n return disabledStatic;\n }\n\n const reactiveFormValues = formService.formValue();\n const currentSynchronousFormValues = formService.formGroup\n .value as FormContext;\n const evaluationContext =\n reactiveFormValues ?? currentSynchronousFormValues;\n\n const disableFn = disabledFunction();\n if (disableFn) {\n return disableFn(evaluationContext);\n }\n\n const ast = disabledAst();\n if (!ast) {\n return parentGroupIsDisabled();\n }\n\n const disabled =\n expressionService.evaluateExpression(ast, evaluationContext) ?? false;\n return disabled as boolean;\n });\n}\n\n/**\n * Creates an effect that manages control/group disabled state\n *\n * @param options Configuration object for disabled effect\n * @param options.disabledSignal Signal that indicates if the component should be disabled\n * @param options.disabledHandlingSignal Signal that determines how disabled state changes should be handled\n * @param options.enableFunction Function to call when component should be enabled\n * @param options.disableFunction Function to call when component should be disabled\n */\nexport function disabledEffect(options: {\n disabledSignal: Signal<boolean>;\n disabledHandlingSignal: Signal<StateHandling>;\n enableFunction: SimpleFunction;\n disableFunction: SimpleFunction;\n}) {\n effect(() => {\n const disabled = options.disabledSignal();\n const disabledHandling = options.disabledHandlingSignal();\n\n if (disabledHandling === 'manual') {\n return;\n }\n\n if (!disabled) {\n untracked(() => {\n options.enableFunction();\n });\n return;\n }\n untracked(() => {\n options.disableFunction();\n });\n });\n}\n","import { computed, effect, inject, Signal } from '@angular/core';\nimport { NgxFbAbstractControl } from '../types/content.type';\nimport { FormService } from '../services/form.service';\nimport { ExpressionService } from '../services/expression.service';\nimport { Program } from 'acorn';\nimport { AbstractControl, ControlContainer } from '@angular/forms';\nimport { FormContext } from '../types/expression.type';\n\nexport function withComputedValue<T>(content: Signal<NgxFbAbstractControl>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n const parentContainer = inject(ControlContainer);\n\n const computedValueAst = computed<Program | null>(() => {\n const computedValueOption = content().computedValue;\n if (typeof computedValueOption !== 'string') {\n return null;\n }\n return expressionService.parseExpressionToAst(computedValueOption);\n });\n\n const computedValueFunction = computed(() => {\n const computedValueOption = content().computedValue;\n if (typeof computedValueOption !== 'function') {\n return null;\n }\n return computedValueOption;\n });\n\n return computed<T | undefined>(() => {\n const value =\n formService.formValue() ?? (parentContainer.value as FormContext);\n\n const computedValueFn = computedValueFunction();\n if (computedValueFn) {\n return computedValueFn(value) as T;\n }\n\n const ast = computedValueAst();\n if (!ast) {\n return undefined;\n }\n\n return expressionService.evaluateExpression(ast, value) as T;\n });\n}\n\nexport function setComputedValueEffect<T>(options: {\n controlInstance: Signal<AbstractControl>;\n computeValueSignal: Signal<T>;\n}) {\n const parentContainer = inject(ControlContainer);\n effect(() => {\n const control = options.controlInstance();\n const value = options.computeValueSignal();\n\n if (!value && parentContainer.pristine) {\n return;\n }\n control.setValue(value);\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { NgxFbControl } from '../types/content.type';\nimport { FormService } from '../services/form.service';\nimport { ExpressionService } from '../services/expression.service';\nimport { Program } from 'acorn';\nimport { FormContext } from '../types/expression.type';\n\n/**\n * Computes a dynamic label for a form control based on expression evaluation\n *\n * @param content Signal containing control configuration with dynamicLabel property\n * @returns Computed signal that resolves to the evaluated dynamic label string or undefined\n */\nexport function withDynamicLabel(content: Signal<NgxFbControl>) {\n const formService = inject(FormService);\n const expressionService = inject(ExpressionService);\n\n const dynamicLabelAst = computed<Program | null>(() => {\n const dynamicLabelOption = content().dynamicLabel;\n if (typeof dynamicLabelOption !== 'string') {\n return null;\n }\n return expressionService.parseExpressionToAst(dynamicLabelOption);\n });\n\n const dynamicLabelFunction = computed(() => {\n const dynamicLabelOption = content().dynamicLabel;\n if (typeof dynamicLabelOption !== 'function') {\n return null;\n }\n return dynamicLabelOption;\n });\n\n return computed<string | undefined>(() => {\n const reactiveFormValues = formService.formValue();\n const currentSynchronousFormValues = formService.formGroup\n .value as FormContext;\n const evaluationContext =\n reactiveFormValues ?? currentSynchronousFormValues;\n\n const dynamicLabelFn = dynamicLabelFunction();\n\n if (dynamicLabelFn) {\n return dynamicLabelFn(evaluationContext);\n }\n\n const ast = dynamicLabelAst();\n\n if (!ast) {\n return undefined;\n }\n const label = expressionService.evaluateExpression(ast, evaluationContext);\n return label as string | undefined;\n });\n}\n","import {\n computed,\n Directive,\n inject,\n input,\n OnDestroy,\n signal,\n} from '@angular/core';\nimport {\n NgxFbControl,\n NgxFbFormGroup,\n ValueStrategy,\n} from '../types/content.type';\nimport { ControlContainer, FormControl, FormGroup } from '@angular/forms';\nimport { StateHandling } from '../types/registration.type';\nimport {\n disabledEffect,\n withDisabledState,\n} from '../composables/disabled.state';\nimport { withReadonlyState } from '../composables/readonly.state';\nimport {\n hiddenEffect,\n withHiddenAttribute,\n withHiddenState,\n} from '../composables/hidden.state';\nimport { withAsyncValidators, withValidators } from '../composables/validators';\nimport { withTestId } from '../composables/testId';\nimport { withUpdateStrategy } from '../composables/update-strategy';\nimport {\n setComputedValueEffect,\n withComputedValue,\n} from '../composables/computed-value';\nimport { withDynamicLabel } from '../composables/dynamic-label';\nimport { TestIdBuilderFn } from '../types/functions.type';\nimport { NgxfbGroupDirective } from './ngxfb-group.directive';\n\n/**\n * Core directive for creating form controls in ngx-formbar.\n *\n * This directive handles the integration between Angular's reactive forms and\n * ngx-formbar's declarative configuration. It manages:\n *\n * - Control registration and lifecycle within parent form groups\n * - State management (hidden, disabled, readonly)\n * - Validation setup\n * - Dynamic value computation\n * - Test ID generation\n * - Dynamic label support\n *\n * Use this directive with hostDirectives in your custom control components:\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * {\n * directive: NgxfbControlDirective,\n * inputs: ['content', 'name'],\n * }\n * ],\n * })\n * export class TextControlComponent {\n * private readonly control = inject(NgxfbControlDirective<TextControl>);\n * readonly content = this.control.content;\n * readonly name = this.control.name;\n * }\n * ```\n *\n * @template T Type of the control configuration, must extend NgxFbControl\n */\n@Directive({\n selector: '[ngxfbControl]',\n host: {\n '[attr.hidden]': 'hiddenAttribute()',\n },\n})\nexport class NgxfbControlDirective<T extends NgxFbControl>\n implements OnDestroy\n{\n private parentContainer = inject(ControlContainer);\n\n private readonly parentGroupDirective: NgxfbGroupDirective<NgxFbFormGroup> | null =\n inject(NgxfbGroupDirective<NgxFbFormGroup>, {\n optional: true,\n });\n\n /**\n * Required input containing the control configuration\n * Defines properties like ID, default value, validation, and state expressions\n */\n readonly content = input.required<T>();\n\n /**\n * Required input for the controls name\n */\n readonly name = input.required<string>();\n\n private readonly visibilityHandling = signal<StateHandling>('auto');\n private readonly disabledHandling = signal<StateHandling>('auto');\n private readonly testIdBuilder = signal<TestIdBuilderFn | undefined>(\n undefined,\n );\n\n /**\n * Computed test ID derived from the control's ID\n * Used for automated testing identification\n *\n * Access this in your component template:\n * ```html\n * <input [attr.data-testid]=\"testId()\" ... />\n * ```\n */\n readonly testId = withTestId(this.content, this.name, this.testIdBuilder);\n\n /**\n * Computed signal for the control's hide strategy\n * Determines how the control behaves when hidden (keep or remove from form)\n */\n readonly hideStrategy = computed(() => this.content().hideStrategy);\n\n /**\n * Computed signal for the control's value strategy\n * Determines how the control's value is managed when visibility changes\n */\n readonly valueStrategy = computed(\n () => this.content().valueStrategy ?? this.parentValueStrategy(),\n );\n\n /**\n * Computed signal for the parent's value strategy\n * Used when control doesn't define its own strategy\n */\n readonly parentValueStrategy = computed(() =>\n this.parentGroupDirective?.valueStrategy(),\n );\n\n /**\n * Computed signal for the hidden state\n * True when the control should be hidden based on 'hidden' expression\n *\n * Use this in your component when implementing custom visibility handling:\n * ```typescript\n * readonly isHidden = this.control.isHidden;\n * ```\n */\n readonly isHidden = withHiddenState(this.content);\n\n /**\n * Computed signal for the hidden attribute\n * Used in DOM binding to show/hide the control element\n */\n readonly hiddenAttribute = withHiddenAttribute({\n hiddenSignal: this.isHidden,\n hiddenHandlingSignal: this.visibilityHandling,\n });\n\n /**\n * Computed signal for the disabled state\n * True when the control should be disabled based on 'disabled' expression\n *\n * Use this in your component for custom disabled state handling:\n * ```typescript\n * readonly disabled = this.control.disabled;\n * ```\n */\n readonly disabled = withDisabledState(this.content);\n\n /**\n * Computed signal for the readonly state\n * True when the control should be readonly based on 'readonly' expression\n *\n * Use this in your component to implement readonly behavior:\n * ```html\n * <input [attr.readonly]=\"readonly() || null\" ... />\n * ```\n */\n readonly readonly = withReadonlyState(this.content);\n\n /**\n * Computed signal for the update strategy\n * Determines when form values are updated ('change', 'blur', or 'submit')\n */\n readonly updateStrategy = withUpdateStrategy(this.content);\n\n /**\n * Computed signal for the dynamic label\n * Contains the evaluated result of the dynamicLabel expression\n *\n * Use this in your component to display dynamic labels:\n * ```typescript\n * readonly displayLabel = computed(() => {\n * const dynamic = this.control.dynamicLabel();\n * return dynamic || this.content().label;\n * });\n * ```\n */\n readonly dynamicLabel = withDynamicLabel(this.content);\n\n /**\n * Computed signal for the validators\n * Contains validator functions derived from configuration keys\n */\n private readonly validators = withValidators(this.content);\n\n /**\n * Computed signal for the async validators\n * Contains async validator functions derived from configuration keys\n */\n private readonly asyncValidators = withAsyncValidators(this.content);\n\n /**\n * Computed signal for the computed value\n * Contains the evaluated result of computedValue expressions\n */\n private readonly computedValue = withComputedValue(this.content);\n\n /**\n * Computed signal for the form control instance\n * Creates a new FormControl with appropriate validators and configuration\n */\n private readonly controlInstance = computed(() => {\n const content = this.content();\n\n const validators = this.validators();\n const asyncValidators = this.asyncValidators();\n const updateOn = this.updateStrategy();\n return new FormControl(content.defaultValue, {\n nonNullable: content.nonNullable,\n validators,\n asyncValidators,\n updateOn,\n });\n });\n\n /**\n * Access to the parent FormGroup containing this control\n */\n get parentFormGroup() {\n return this.parentContainer.control as FormGroup | null;\n }\n\n /**\n * Access to this control's FormControl instance\n * Use this to access validation state, errors, and other FormControl methods\n *\n * Example:\n * ```typescript\n * get hasError() {\n * return this.control.formControl?.hasError('required');\n * }\n * ```\n */\n get formControl() {\n const id = this.name();\n if (!this.parentFormGroup?.contains(id)) {\n return null;\n }\n\n return this.parentFormGroup.get(id) as FormControl | null;\n }\n\n constructor() {\n hiddenEffect({\n content: this.content,\n name: this.name,\n controlInstance: this.controlInstance,\n hiddenSignal: this.isHidden,\n hideStrategySignal: this.hideStrategy,\n valueStrategySignal: this.valueStrategy,\n parentValueStrategySignal: this.parentValueStrategy,\n attachFunction: this.setControl.bind(this),\n detachFunction: this.removeControl.bind(this),\n valueHandleFunction: this.handleValue.bind(this),\n });\n\n disabledEffect({\n disabledSignal: this.disabled,\n disabledHandlingSignal: this.disabledHandling,\n enableFunction: this.enableControl.bind(this),\n disableFunction: this.disableControl.bind(this),\n });\n\n setComputedValueEffect({\n controlInstance: this.controlInstance,\n computeValueSignal: this.computedValue,\n });\n }\n\n /**\n * Sets the visibility handling strategy\n * Determines if visibility should be managed by the component (manual) or by Formbar (auto)\n *\n * Use 'manual' when implementing custom visibility handling in your component:\n * ```typescript\n * constructor() {\n * this.control.setVisibilityHandling('manual');\n * }\n * @param visibilityHandling Strategy for handling visibility ('auto' or 'manual')\n */\n setVisibilityHandling(visibilityHandling: StateHandling) {\n this.visibilityHandling.set(visibilityHandling);\n }\n\n /**\n * Sets the disabled handling strategy\n * Determines if disabled state should be managed by the component (manual) or by Formbar (auto)\n *\n * @param disabledHandling Strategy for handling disabled state ('auto' or 'manual')\n */\n setDisabledHandling(disabledHandling: StateHandling) {\n this.disabledHandling.set(disabledHandling);\n }\n\n /**\n * Sets the function to use for building a test id.\n *\n * @param builderFn Function that returns the test id\n */\n setTestIdBuilderFn(builderFn: TestIdBuilderFn | undefined) {\n this.testIdBuilder.set(builderFn);\n }\n\n private setControl() {\n this.parentFormGroup?.setControl(this.name(), this.controlInstance(), {\n emitEvent: false,\n });\n }\n\n private removeControl() {\n const id = this.name();\n const formControl = this.formControl;\n // Check if control exists immediately before attempting removal\n if (formControl) {\n this.parentFormGroup?.removeControl(id, { emitEvent: false });\n }\n }\n\n private enableControl() {\n const formControl = this.controlInstance();\n formControl.enable({ emitEvent: false });\n }\n private disableControl() {\n const formControl = this.controlInstance();\n\n formControl.disable({ emitEvent: false });\n }\n\n private handleValue(valueStrategy?: ValueStrategy) {\n switch (valueStrategy) {\n case 'last':\n break;\n case 'reset':\n this.controlInstance().reset(undefined, { emitEvent: false });\n break;\n default:\n this.controlInstance().setValue(this.content().defaultValue);\n break;\n }\n }\n\n ngOnDestroy(): void {\n this.removeControl();\n }\n}\n","import { Directive, inject, input, signal } from '@angular/core';\nimport { ControlContainer } from '@angular/forms';\nimport { withTestId } from '../composables/testId';\nimport {\n withHiddenAttribute,\n withHiddenState,\n} from '../composables/hidden.state';\nimport { StateHandling } from '../types/registration.type';\nimport { TestIdBuilderFn } from '../types/functions.type';\nimport { NgxFbBaseContent } from '../types/content.type';\n\n/**\n * Core directive for non-form elements that appear in forms.\n *\n * Block elements represent UI components that don't contribute to the form's value\n * but provide information or functionality within forms, such as:\n * - Information blocks\n * - Images\n * - Dividers\n * - Help text\n * - Custom UI elements\n *\n * This directive handles visibility conditions and test ID generation for block elements.\n *\n * Use this directive with hostDirectives in your custom block components:\n *\n * ```typescript\n * @Component({\n * hostDirectives: [\n * {\n * directive: NgxfbBlockDirective,\n * inputs: ['content', 'name'],\n * }\n * ],\n * })\n * export class InfoBlockComponent {\n * private readonly blockDirective = inject(NgxfbBlockDirective<InfoBlock>);\n * readonly content = this.blockDirective.content;\n * readonly message = computed(() => this.content().message);\n * }\n * ```\n *\n * @template T Type of the block configuration, must extend NgxFbBaseContent\n */\n@Directive({\n selector: '[ngxfbBlock]',\n host: {\n '[attr.hidden]': 'hiddenAttribute()',\n },\n})\nexport class NgxfbBlockDirective<T extends NgxFbBaseContent> {\n /**\n * Reference to the parent form container.\n * Provides access to the form that contains this block.\n */\n private parentContainer = inject(ControlContainer);\n\n /**\n * Required input containing the block configuration.\n * Defines properties like type, hidden condition, and custom properties.\n */\n readonly content = input.required<T>();\n\n /**\n * Required input for the block's name.\n * Used as an identifier within the form.\n */\n readonly name = input.required<string>();\n\n /**\n * Signal for managing the visibility handling strategy ('auto' or 'manual').\n * - 'auto': directive handles visibility via hidden attribute\n * - 'manual': component handles visibility in its own template\n */\n private readonly visibilityHandling = signal<StateHandling>('auto');\n\n /**\n * Signal for the test ID builder function.\n * Used to customize how test IDs are generated.\n */\n private readonly testIdBuilder = signal<TestIdBuilderFn | undefined>(\n undefined,\n );\n\n /**\n * Computed test ID derived from the block's name.\n * Used for automated testing identification.\n *\n * Access this in your component template:\n * ```html\n * <div [attr.data-testid]=\"testId()\">...</div>\n * ```\n */\n readonly testId = withTestId(this.content, this.name, this.testIdBuilder);\n\n /**\n * Computed signal for the hidden state.\n * True when the block should be hidden based on 'hidden' expression.\n *\n * Use this in your component when implementing custom visibility handling:\n * ```typescript\n * readonly isHidden = this.blockDirective.isHidden;\n * ```\n */\n readonly isHidden = withHiddenState(this.content);\n\n /**\n * Computed signal for the hidden attribute.\n * Used in DOM binding to show/hide the block element.\n */\n readonly hiddenAttribute = withHiddenAttribute({\n hiddenSignal: this.isHidden,\n hiddenHandlingSignal: this.visibilityHandling,\n });\n\n /**\n * Returns the parent form container.\n * Provides access to the form instance that contains this block.\n *\n * Use this to access form data or methods:\n * ```typescript\n * const formData = this.blockDirective.rootForm.control.value;\n * ```\n */\n get rootForm() {\n return this.parentContainer;\n }\n\n /**\n * Sets the visibility handling strategy.\n * Determines if visibility should be managed by the component (manual) or by Formbar (auto).\n *\n * Use 'manual' when implementing custom visibility handling in your component:\n * ```typescript\n * constructor() {\n * this.blockDirective.setVisibilityHandling('manual');\n * }\n * ```\n *\n * @param visibilityHandling Strategy for handling visibility ('auto' or 'manual')\n */\n setVisibilityHandling(visibilityHandling: StateHandling) {\n this.visibilityHandling.set(visibilityHandling);\n }\n\n /**\n * Sets the function to use for building a test id.\n * This allows custom test ID generation strategies to be used.\n *\n * @param builderFn Function that returns the test id\n */\n setTestIdBuilderFn(builderFn: TestIdBuilderFn | undefined) {\n this.testIdBuilder.set(builderFn);\n }\n}\n","/*\n * Public API Surface of core\n */\n\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,WAAW,CAAA;AACd,IAAA,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC1C,IAAA,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAoB;IACtD,SAAS,GAAG,QAAQ,CAAc,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;wGAH5D,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAX,WAAW,EAAA,CAAA;;4FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB;;;ACFD;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACI,MAAM,6BAA6B,GAAG;AAC3C,IAAA;AACE,QAAA,OAAO,EAAE,gBAAgB;AACzB,QAAA,UAAU,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/D,KAAA;CACF;;MCjCY,yBAAyB,GAAG,IAAI,cAAc,CACzD,2BAA2B;;ACO7B;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAIU,6BAA6B,CA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AAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,IAAI,EAAE;AACJ,wBAAA,eAAe,EAAE,mBAAmB;AACrC,qBAAA;AACF,iBAAA;;;ACjDD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NgxFbBaseContent, NgxFbContent } from '../../types/content.type';
|
|
2
|
+
import { NgxFbForm } from '../../types/form.type';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Ngx Formbar Form Component
|
|
6
|
+
*
|
|
7
|
+
* This component serves as the main container for Ngx Formbar forms:
|
|
8
|
+
* - Takes a form configuration
|
|
9
|
+
* - Establishes the form context through FormService provider
|
|
10
|
+
* - Renders each content item using NgxfbAbstractControlDirective
|
|
11
|
+
* - Handles component registration and dependency injection
|
|
12
|
+
*
|
|
13
|
+
* The component acts as the root element for declarative form creation,
|
|
14
|
+
* processing the form content configuration and rendering the appropriate
|
|
15
|
+
* components for each control defined in the configuration.
|
|
16
|
+
*/
|
|
17
|
+
export declare class NgxfbFormComponent<T extends NgxFbBaseContent = NgxFbContent> {
|
|
18
|
+
/**
|
|
19
|
+
* Required input containing form configuration
|
|
20
|
+
*/
|
|
21
|
+
readonly formConfig: import("@angular/core").InputSignal<NgxFbForm<T>>;
|
|
22
|
+
/**
|
|
23
|
+
* Computed value containing form content
|
|
24
|
+
*/
|
|
25
|
+
readonly formContent: import("@angular/core").Signal<[string, T][]>;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxfbFormComponent<any>, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxfbFormComponent<any>, "ngxfb-form", never, { "formConfig": { "alias": "formConfig"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { NgxFbAbstractControl } from '../types/content.type';
|
|
3
|
+
import { AbstractControl } from '@angular/forms';
|
|
4
|
+
export declare function withComputedValue<T>(content: Signal<NgxFbAbstractControl>): Signal<T | undefined>;
|
|
5
|
+
export declare function setComputedValueEffect<T>(options: {
|
|
6
|
+
controlInstance: Signal<AbstractControl>;
|
|
7
|
+
computeValueSignal: Signal<T>;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { StateHandling } from '../types/registration.type';
|
|
3
|
+
import { SimpleFunction } from '../types/functions.type';
|
|
4
|
+
import { NgxFbAbstractControl } from '../types/content.type';
|
|
5
|
+
/**
|
|
6
|
+
* Computes a reactive disabled state based on control content
|
|
7
|
+
*
|
|
8
|
+
* The disabled state is determined using the following priority:
|
|
9
|
+
* 1. If content.disabled is a boolean, that value is used directly
|
|
10
|
+
* 2. If content.disabled is an expression string, it's parsed to AST and evaluated
|
|
11
|
+
* against the current form values
|
|
12
|
+
* 3. If no disabled property is defined, the control inherits the disabled state
|
|
13
|
+
* from its parent group
|
|
14
|
+
*
|
|
15
|
+
* This hierarchical inheritance ensures that child controls are automatically
|
|
16
|
+
* disabled when their parent group is disabled, unless explicitly overridden.
|
|
17
|
+
*
|
|
18
|
+
* @param content Signal containing control configuration with potential disabled property
|
|
19
|
+
* @returns Computed signal that resolves to boolean disabled state
|
|
20
|
+
*/
|
|
21
|
+
export declare function withDisabledState(content: Signal<NgxFbAbstractControl>): Signal<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an effect that manages control/group disabled state
|
|
24
|
+
*
|
|
25
|
+
* @param options Configuration object for disabled effect
|
|
26
|
+
* @param options.disabledSignal Signal that indicates if the component should be disabled
|
|
27
|
+
* @param options.disabledHandlingSignal Signal that determines how disabled state changes should be handled
|
|
28
|
+
* @param options.enableFunction Function to call when component should be enabled
|
|
29
|
+
* @param options.disableFunction Function to call when component should be disabled
|
|
30
|
+
*/
|
|
31
|
+
export declare function disabledEffect(options: {
|
|
32
|
+
disabledSignal: Signal<boolean>;
|
|
33
|
+
disabledHandlingSignal: Signal<StateHandling>;
|
|
34
|
+
enableFunction: SimpleFunction;
|
|
35
|
+
disableFunction: SimpleFunction;
|
|
36
|
+
}): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { NgxFbControl } from '../types/content.type';
|
|
3
|
+
/**
|
|
4
|
+
* Computes a dynamic label for a form control based on expression evaluation
|
|
5
|
+
*
|
|
6
|
+
* @param content Signal containing control configuration with dynamicLabel property
|
|
7
|
+
* @returns Computed signal that resolves to the evaluated dynamic label string or undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function withDynamicLabel(content: Signal<NgxFbControl>): Signal<string | undefined>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { NgxFbFormGroup } from '../types/content.type';
|
|
3
|
+
/**
|
|
4
|
+
* Computes a dynamic title for a form control based on expression evaluation
|
|
5
|
+
*
|
|
6
|
+
* @param content Signal containing control configuration with dynamicTitle property
|
|
7
|
+
* @returns Computed signal that resolves to the evaluated dynamic title string or undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function withDynamicTitle(content: Signal<NgxFbFormGroup>): Signal<string | undefined>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { HideStrategy, NgxFbBaseContent, NgxFbContent, ValueStrategy } from '../types/content.type';
|
|
3
|
+
import { StateHandling } from '../types/registration.type';
|
|
4
|
+
import { SimpleFunction, ValueHandleFunction } from '../types/functions.type';
|
|
5
|
+
import { AbstractControl } from '@angular/forms';
|
|
6
|
+
/**
|
|
7
|
+
* Computes a reactive hidden state based on control content
|
|
8
|
+
*
|
|
9
|
+
* The hidden state is determined using the following priority:
|
|
10
|
+
* 1. If content.hidden is an expression string, it's parsed to AST and evaluated
|
|
11
|
+
* against the current form values
|
|
12
|
+
* 2. If no hidden expression is defined, the control inherits the hidden state
|
|
13
|
+
* from its parent group
|
|
14
|
+
* 3. Both conditions can be combined - a control is hidden if either its own
|
|
15
|
+
* condition evaluates to true OR its parent group is hidden
|
|
16
|
+
*
|
|
17
|
+
* @param content Signal containing control configuration with potential hidden expression
|
|
18
|
+
* @returns Computed signal that resolves to boolean hidden state
|
|
19
|
+
*/
|
|
20
|
+
export declare function withHiddenState(content: Signal<NgxFbBaseContent>): Signal<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a computed attribute value for hidden DOM elements
|
|
23
|
+
*
|
|
24
|
+
* When visibilityHandling is set to 'auto', this returns a boolean attribute value
|
|
25
|
+
* that can be used with Angular's [attr.hidden] binding. When set to 'manual',
|
|
26
|
+
* it returns null so the attribute is not applied.
|
|
27
|
+
*
|
|
28
|
+
* @param options Configuration object for hidden attribute
|
|
29
|
+
* @param options.hiddenSignal Signal that indicates if the control should be hidden
|
|
30
|
+
* @param options.hiddenHandlingSignal Signal that determines how visibility is managed
|
|
31
|
+
* @returns Computed signal that resolves to attribute value (true or null)
|
|
32
|
+
*/
|
|
33
|
+
export declare function withHiddenAttribute(options: {
|
|
34
|
+
hiddenSignal: Signal<boolean>;
|
|
35
|
+
hiddenHandlingSignal: Signal<StateHandling>;
|
|
36
|
+
}): Signal<true | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an effect that manages control visibility in forms
|
|
39
|
+
*
|
|
40
|
+
* Based on visibility state and hide strategy, this effect:
|
|
41
|
+
* 1. Attaches the control to the form when visible
|
|
42
|
+
* 2. Detaches the control from the form when hidden and strategy is 'remove'
|
|
43
|
+
* 3. Manages control values based on the specified valueStrategy when visibility changes
|
|
44
|
+
*
|
|
45
|
+
* @param options Configuration object for hidden effect
|
|
46
|
+
* @param options.content Signal containing control configuration
|
|
47
|
+
* @param options.name Signal containing the name of the control
|
|
48
|
+
* @param options.controlInstance Signal with the form control instance
|
|
49
|
+
* @param options.hiddenSignal Signal that indicates if the control should be hidden
|
|
50
|
+
* @param options.hideStrategySignal Signal with the strategy for handling hidden controls
|
|
51
|
+
* @param options.valueStrategySignal Signal with the strategy for handling control values
|
|
52
|
+
* @param options.parentValueStrategySignal Signal with the parent's value strategy
|
|
53
|
+
* @param options.attachFunction Function to call when control should be attached
|
|
54
|
+
* @param options.detachFunction Function to call when control should be detached
|
|
55
|
+
* @param options.valueHandleFunction Function to handle control value based on strategy
|
|
56
|
+
*/
|
|
57
|
+
export declare function hiddenEffect(options: {
|
|
58
|
+
content: Signal<NgxFbContent>;
|
|
59
|
+
name: Signal<string>;
|
|
60
|
+
controlInstance: Signal<AbstractControl>;
|
|
61
|
+
hiddenSignal: Signal<boolean>;
|
|
62
|
+
hideStrategySignal: Signal<HideStrategy | undefined>;
|
|
63
|
+
valueStrategySignal: Signal<ValueStrategy | undefined>;
|
|
64
|
+
parentValueStrategySignal: Signal<ValueStrategy | undefined>;
|
|
65
|
+
attachFunction: SimpleFunction;
|
|
66
|
+
detachFunction: SimpleFunction;
|
|
67
|
+
valueHandleFunction: ValueHandleFunction;
|
|
68
|
+
}): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { NgxFbAbstractControl } from '../types/content.type';
|
|
3
|
+
/**
|
|
4
|
+
* Computes a reactive readonly state based on control content
|
|
5
|
+
*
|
|
6
|
+
* The readonly state is determined using the following priority:
|
|
7
|
+
* 1. If content.readonly is a boolean, that value is used directly
|
|
8
|
+
* 2. If content.readonly is an expression string, it's parsed to AST and evaluated
|
|
9
|
+
* against the current form values
|
|
10
|
+
* 3. If no readonly property is defined, the control inherits the readonly state
|
|
11
|
+
* from its parent group
|
|
12
|
+
*
|
|
13
|
+
* This hierarchical inheritance ensures that child controls are automatically
|
|
14
|
+
* set to readonly when their parent group is readonly, unless explicitly overridden.
|
|
15
|
+
*
|
|
16
|
+
* @param content Signal containing control configuration with potential readonly property
|
|
17
|
+
* @returns Computed signal that resolves to boolean readonly state
|
|
18
|
+
*/
|
|
19
|
+
export declare function withReadonlyState(content: Signal<NgxFbAbstractControl>): Signal<boolean>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { TestIdBuilderFn } from '../types/functions.type';
|
|
3
|
+
import { NgxFbBaseContent } from '../types/content.type';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a computed signal that extracts the ID for testing purposes
|
|
6
|
+
*
|
|
7
|
+
* This utility function derives a test identifier from a form control's content,
|
|
8
|
+
* which can be used for targeting elements in automated tests.
|
|
9
|
+
*
|
|
10
|
+
* @template T - Type extending NgxFbBaseContent
|
|
11
|
+
* @param content - Signal containing the control or group content configuration
|
|
12
|
+
* @param name - Signal containing the name of the control
|
|
13
|
+
* @param testIdBuilder - Signal holding a testIdBuilder function
|
|
14
|
+
* @returns Computed signal that resolves to the element's ID for testing
|
|
15
|
+
*/
|
|
16
|
+
export declare function withTestId(content: Signal<NgxFbBaseContent>, name: Signal<string>, testIdBuilder: Signal<TestIdBuilderFn | undefined>): Signal<string>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { NgxFbAbstractControl, UpdateStrategy } from '../types/content.type';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a computed signal for the control's update strategy
|
|
5
|
+
*
|
|
6
|
+
* This function determines when form controls should update:
|
|
7
|
+
* - Uses the control's specified updateOn strategy if defined
|
|
8
|
+
* - Falls back to parent group's strategy when not defined in the control
|
|
9
|
+
* - Handles inheritance of update strategies through the form hierarchy
|
|
10
|
+
* - Uses the application's default strategy as final fallback
|
|
11
|
+
*
|
|
12
|
+
* Update strategies control when form values and validation happen:
|
|
13
|
+
* - 'change': Update on every change event (default Angular behavior)
|
|
14
|
+
* - 'blur': Update when the control loses focus
|
|
15
|
+
* - 'submit': Update only when the form is submitted
|
|
16
|
+
*
|
|
17
|
+
* @param content Signal containing the NgxFbAbstractControl with possible updateOn configuration
|
|
18
|
+
* @returns Computed signal providing the resolved update strategy
|
|
19
|
+
*/
|
|
20
|
+
export declare function withUpdateStrategy(content: Signal<NgxFbAbstractControl>): Signal<UpdateStrategy>;
|