@ng-forge/dynamic-forms 0.8.0-next.5 → 0.9.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +2 -0
  2. package/fesm2022/{ng-forge-dynamic-forms-array-field.component-DWhbvZUO.mjs → ng-forge-dynamic-forms-array-field.component-CWxCWVdz.mjs} +3 -3
  3. package/fesm2022/{ng-forge-dynamic-forms-array-field.component-DWhbvZUO.mjs.map → ng-forge-dynamic-forms-array-field.component-CWxCWVdz.mjs.map} +1 -1
  4. package/fesm2022/{ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs → ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs} +3 -3
  5. package/fesm2022/{ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs.map → ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs.map} +1 -1
  6. package/fesm2022/{ng-forge-dynamic-forms-container-utils-DXRcEEkE.mjs → ng-forge-dynamic-forms-container-utils-DW_P7w-b.mjs} +2 -2
  7. package/fesm2022/{ng-forge-dynamic-forms-container-utils-DXRcEEkE.mjs.map → ng-forge-dynamic-forms-container-utils-DW_P7w-b.mjs.map} +1 -1
  8. package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-ClFdxZV4.mjs → ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs} +2 -2
  9. package/fesm2022/{ng-forge-dynamic-forms-css-wrapper.component-ClFdxZV4.mjs.map → ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs.map} +1 -1
  10. package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-CTpgJ-02.mjs → ng-forge-dynamic-forms-emit-initialization-CSx0gwFc.mjs} +2 -2
  11. package/fesm2022/{ng-forge-dynamic-forms-emit-initialization-CTpgJ-02.mjs.map → ng-forge-dynamic-forms-emit-initialization-CSx0gwFc.mjs.map} +1 -1
  12. package/fesm2022/{ng-forge-dynamic-forms-group-field.component-clrQsUyY.mjs → ng-forge-dynamic-forms-group-field.component-2yRmHAUp.mjs} +3 -3
  13. package/fesm2022/{ng-forge-dynamic-forms-group-field.component-clrQsUyY.mjs.map → ng-forge-dynamic-forms-group-field.component-2yRmHAUp.mjs.map} +1 -1
  14. package/fesm2022/ng-forge-dynamic-forms-integration.mjs +0 -35
  15. package/fesm2022/ng-forge-dynamic-forms-integration.mjs.map +1 -1
  16. package/fesm2022/{ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs → ng-forge-dynamic-forms-ng-forge-dynamic-forms-Ll4W2Z_n.mjs} +66 -43
  17. package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-Ll4W2Z_n.mjs.map +1 -0
  18. package/fesm2022/{ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs → ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs} +3 -3
  19. package/fesm2022/{ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs.map → ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs.map} +1 -1
  20. package/fesm2022/{ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs → ng-forge-dynamic-forms-text-field.component-rJMtKX2X.mjs} +2 -2
  21. package/fesm2022/{ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs.map → ng-forge-dynamic-forms-text-field.component-rJMtKX2X.mjs.map} +1 -1
  22. package/fesm2022/ng-forge-dynamic-forms.mjs +1 -1
  23. package/package.json +1 -1
  24. package/fesm2022/ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ng-forge-dynamic-forms-integration.mjs","sources":["../../../../packages/dynamic-forms/integration/src/mappers/value/value-field.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/checkbox/checkbox-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/datepicker/datepicker-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/select/options-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/textarea/textarea-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/slider/slider-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/non-field-logic.utils.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/button-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/array-button.utils.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/array-button.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/navigation-button.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/index.ts","../../../../packages/dynamic-forms/integration/src/mappers/index.ts","../../../../packages/dynamic-forms/integration/src/utils/create-resolved-errors-signal.ts","../../../../packages/dynamic-forms/integration/src/utils/should-show-errors.ts","../../../../packages/dynamic-forms/integration/src/utils/setup-meta-tracking.ts","../../../../packages/dynamic-forms/integration/src/utils/index.ts","../../../../packages/dynamic-forms/integration/src/public_api.ts","../../../../packages/dynamic-forms/integration/src/ng-forge-dynamic-forms-integration.ts"],"sourcesContent":["import { BaseValueField, FieldMeta } from '@ng-forge/dynamic-forms';\nimport { computed, inject, Signal } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\nimport { buildBaseInputs, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { FIELD_SIGNAL_CONTEXT } from '@ng-forge/dynamic-forms';\nimport { omit } from '@ng-forge/dynamic-forms';\nimport { ValidationMessages } from '@ng-forge/dynamic-forms';\n\n/**\n * Context for value field mapping, containing the injected context reference.\n * Used by specialized mappers to avoid duplicate injection.\n *\n * Note: The field tree is resolved lazily via getFieldTree() to support\n * reactive form access (e.g., for array items where the form structure\n * may not exist at injection time but becomes available later).\n */\nexport interface ValueFieldContext {\n /**\n * Gets the field tree for a given key from the form context.\n * This is reactive for array items - the form getter is evaluated each time,\n * allowing the computed to re-run when the root form structure updates.\n */\n getFieldTree: (fieldKey: string) => FieldTree<unknown> | undefined;\n}\n\n/**\n * Creates a value field context from the injected FIELD_SIGNAL_CONTEXT.\n * Must be called within an injection context.\n *\n * With direct root form binding for array items, the FIELD_SIGNAL_CONTEXT.form\n * uses a getter that evaluates reactively. This means:\n * - For regular fields: direct access to the form's FieldTree\n * - For array items: the getter resolves rootForm['arrayKey'][index] dynamically\n *\n * The returned context provides a getFieldTree function that should be called\n * inside a computed to establish proper reactive dependencies.\n *\n * @returns The value field context with reactive field tree accessor\n */\nexport function resolveValueFieldContext(): ValueFieldContext {\n const context = inject(FIELD_SIGNAL_CONTEXT);\n\n return {\n getFieldTree: (fieldKey: string) => {\n // Access context.form here (inside a function that will be called from a computed)\n // This allows the getter to be evaluated reactively\n const formRoot = context.form as Record<string, FieldTree<unknown> | undefined> | undefined;\n\n // Handle case where form is undefined (e.g., newly added array items before root form updates)\n if (!formRoot) {\n return undefined;\n }\n\n return formRoot[fieldKey];\n },\n };\n}\n\n/**\n * Builds the base inputs for a value field.\n * This is a helper function used by valueFieldMapper and specialized mappers.\n *\n * Note: This function should be called inside a computed signal to ensure\n * proper reactive dependency tracking for the field tree resolution.\n *\n * @param fieldDef The value field definition\n * @param ctx The resolved value field context\n * @param defaultProps Default props from the form configuration (may be undefined if not configured)\n * @param defaultValidationMessages Default validation messages from the form configuration (may be undefined if not configured)\n * @returns Record of input names to values\n */\nexport function buildValueFieldInputs<TProps, TValue = unknown>(\n fieldDef: BaseValueField<TProps, TValue, FieldMeta, boolean>,\n ctx: ValueFieldContext,\n defaultProps?: Record<string, unknown>,\n defaultValidationMessages?: ValidationMessages,\n): Record<string, unknown> {\n const omittedFields = omit(fieldDef, ['value']);\n const baseInputs = buildBaseInputs(omittedFields, defaultProps);\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n validationMessages: fieldDef.validationMessages ?? {},\n };\n\n if (fieldDef.placeholder !== undefined) {\n inputs['placeholder'] = fieldDef.placeholder;\n }\n\n if (defaultValidationMessages !== undefined) {\n inputs['defaultValidationMessages'] = defaultValidationMessages;\n }\n\n // Resolve field tree reactively - this call is inside a computed,\n // so it establishes the reactive dependency correctly\n const fieldTree = ctx.getFieldTree(fieldDef.key);\n if (fieldTree !== undefined) {\n inputs['field'] = fieldTree;\n }\n\n return inputs;\n}\n\n/**\n * Maps a value field definition to component inputs.\n *\n * Value fields are input fields that contribute to the form's value (text, number, etc.).\n * This mapper injects FIELD_SIGNAL_CONTEXT to access the form structure and retrieve the field proxy.\n *\n * For array items, the FIELD_SIGNAL_CONTEXT.form uses a reactive getter that resolves\n * rootForm['arrayKey'][index] dynamically. This means:\n * - Zod/StandardSchema validation errors are automatically available\n * - The field tree updates reactively when the root form structure changes\n * - Newly added array items will get their field tree once the form value updates\n *\n * For fields with specific properties, use the specialized mappers:\n * - optionsFieldMapper: for fields with options (select, radio, multi-checkbox)\n * - datepickerFieldMapper: for fields with minDate, maxDate, startAt\n * - checkboxFieldMapper: for boolean fields (checkbox, toggle)\n *\n * @param fieldDef The value field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function valueFieldMapper<TProps = unknown, TValue = unknown>(\n fieldDef: BaseValueField<TProps, TValue, FieldMeta, boolean>,\n): Signal<Record<string, unknown>> {\n // Get the context once at injection time (captures the FIELD_SIGNAL_CONTEXT reference)\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n // The computed calls ctx.getFieldTree(fieldDef.key) inside, which:\n // 1. Accesses context.form (triggering the getter for array items)\n // 2. Returns the field tree if available, or undefined if not yet\n // 3. Re-runs when the form structure updates (reactive dependency)\n return computed(() => {\n return buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n });\n}\n","import { BaseCheckedField } from '@ng-forge/dynamic-forms';\nimport { FieldDef } from '@ng-forge/dynamic-forms';\nimport { computed, inject, Signal } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\nimport { buildBaseInputs, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { FIELD_SIGNAL_CONTEXT } from '@ng-forge/dynamic-forms';\nimport { omit } from '@ng-forge/dynamic-forms';\n\n/**\n * Maps a checkbox/toggle field definition to component inputs.\n *\n * Checkbox fields are checked fields that contribute to the form's value as boolean.\n * This mapper injects FIELD_SIGNAL_CONTEXT to access the form structure and retrieve the field tree.\n *\n * @param fieldDef The checkbox field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function checkboxFieldMapper(fieldDef: BaseCheckedField<unknown>): Signal<Record<string, unknown>> {\n const context = inject(FIELD_SIGNAL_CONTEXT);\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const omittedFields = omit(fieldDef, ['value']) as FieldDef<unknown>;\n const baseInputs = buildBaseInputs(omittedFields, defaultProps());\n const validationMessages = defaultValidationMessages();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n validationMessages: fieldDef.validationMessages ?? {},\n };\n\n if (fieldDef.placeholder !== undefined) {\n inputs['placeholder'] = fieldDef.placeholder;\n }\n\n if (validationMessages !== undefined) {\n inputs['defaultValidationMessages'] = validationMessages;\n }\n\n // Access form inside computed for reactivity and to handle cases where\n // form may not be immediately available (e.g., during array item initialization)\n const formRoot = context.form as Record<string, FieldTree<unknown> | undefined> | undefined;\n const fieldTree = formRoot?.[fieldDef.key];\n if (fieldTree !== undefined) {\n inputs['field'] = fieldTree;\n }\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { DatepickerField } from '../../definitions';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Converts a date value (string, Date, or null) to a Date object or null.\n * This ensures UI libraries that expect Date objects receive the correct type.\n */\nfunction toDate(value: Date | string | null | undefined): Date | null {\n if (value === null || value === undefined) {\n return null;\n }\n if (value instanceof Date) {\n return value;\n }\n // Parse string to Date\n const date = new Date(value);\n return isNaN(date.getTime()) ? null : date;\n}\n\n/**\n * Maps a datepicker field to component inputs.\n *\n * Extends the base value field mapper by adding datepicker-specific properties:\n * - minDate: Minimum selectable date\n * - maxDate: Maximum selectable date\n * - startAt: Initial date to display when opening the picker\n *\n * Date values are automatically converted from strings to Date objects\n * since UI libraries (Material, PrimeNG, etc.) expect Date objects.\n *\n * @param fieldDef The datepicker field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function datepickerFieldMapper<TProps>(fieldDef: DatepickerField<TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const inputs = buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n\n // Add datepicker-specific properties, converting strings to Date objects\n if (fieldDef.minDate !== undefined) {\n inputs['minDate'] = toDate(fieldDef.minDate);\n }\n if (fieldDef.maxDate !== undefined) {\n inputs['maxDate'] = toDate(fieldDef.maxDate);\n }\n if (fieldDef.startAt !== undefined) {\n inputs['startAt'] = toDate(fieldDef.startAt);\n }\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { SelectField } from '../../definitions';\nimport { RadioField } from '../../definitions';\nimport { MultiCheckboxField } from '../../definitions';\nimport { BaseValueField, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, FieldMeta } from '@ng-forge/dynamic-forms';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Field types that have an options property.\n */\nexport type FieldWithOptions<T = unknown, TProps = unknown> =\n | SelectField<T, TProps>\n | RadioField<T, TProps>\n | MultiCheckboxField<T, TProps>;\n\n/**\n * Maps a field with options (select, radio, multi-checkbox) to component inputs.\n *\n * Extends the base value field mapper by adding the options property.\n *\n * @param fieldDef The field definition with options\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function optionsFieldMapper<T, TProps>(fieldDef: FieldWithOptions<T, TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n // Cast to BaseValueField - safe because all FieldWithOptions types extend BaseValueField\n const inputs = buildValueFieldInputs(\n fieldDef as BaseValueField<TProps, unknown, FieldMeta, boolean>,\n ctx,\n defaultProps(),\n defaultValidationMessages(),\n );\n\n // Add options property\n inputs['options'] = fieldDef.options;\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { TextareaField } from '../../definitions';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Maps a textarea field to component inputs.\n *\n * Extends the base value field mapper by adding textarea-specific properties:\n * - rows: Number of visible text rows\n * - cols: Number of visible text columns\n * - maxLength: Maximum character length (also used for validation)\n *\n * @param fieldDef The textarea field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function textareaFieldMapper<TProps>(fieldDef: TextareaField<TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const inputs = buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n\n // Add textarea-specific properties from props\n const props = fieldDef.props as Record<string, unknown> | undefined;\n if (props && typeof props === 'object') {\n if (props['rows'] !== undefined) {\n inputs['rows'] = props['rows'];\n }\n if (props['cols'] !== undefined) {\n inputs['cols'] = props['cols'];\n }\n }\n\n // maxLength is at field level for validation\n if (fieldDef.maxLength !== undefined) {\n inputs['maxLength'] = fieldDef.maxLength;\n }\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { SliderField } from '../../definitions';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Maps a slider field to component inputs.\n *\n * Extends the base value field mapper by adding slider-specific properties:\n * - minValue: Minimum slider value\n * - maxValue: Maximum slider value\n * - step: Step increment for the slider\n *\n * @param fieldDef The slider field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function sliderFieldMapper<TProps>(fieldDef: SliderField<TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const inputs = buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n\n // Add slider-specific properties (these are at field level, not in props)\n if (fieldDef.minValue !== undefined) {\n inputs['minValue'] = fieldDef.minValue;\n }\n if (fieldDef.maxValue !== undefined) {\n inputs['maxValue'] = fieldDef.maxValue;\n }\n if (fieldDef.step !== undefined) {\n inputs['step'] = fieldDef.step;\n }\n\n return inputs;\n });\n}\n","import {\n LogicConfig,\n NonFieldLogicConfig,\n resolveNonFieldDisabled,\n resolveNonFieldHidden,\n RootFormRegistryService,\n} from '@ng-forge/dynamic-forms';\nimport { FieldTree } from '@angular/forms/signals';\n\n/**\n * Field definition with optional hidden/disabled and logic properties.\n * This is the minimal interface needed by applyNonFieldLogic.\n */\nexport interface FieldDefWithLogic {\n hidden?: boolean;\n disabled?: boolean;\n logic?: NonFieldLogicConfig[] | LogicConfig[];\n}\n\n/**\n * Result of applying non-field logic to a field.\n * Only includes properties that have values to apply.\n */\nexport interface NonFieldLogicResult {\n hidden?: boolean;\n disabled?: boolean;\n}\n\n/**\n * Applies hidden and disabled logic to a non-form-bound field.\n * Must be called inside a computed() context (reads form signals).\n */\nexport function applyNonFieldLogic(rootFormRegistry: RootFormRegistryService, fieldDef: FieldDefWithLogic): NonFieldLogicResult {\n const result: NonFieldLogicResult = {};\n const rootForm = rootFormRegistry.rootForm();\n\n if (rootForm) {\n if (fieldDef.hidden !== undefined || fieldDef.logic?.some((l) => l.type === 'hidden')) {\n const hiddenSignal = resolveNonFieldHidden({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.hidden,\n });\n result.hidden = hiddenSignal();\n }\n\n // Resolve disabled state if explicitly set or has logic\n if (fieldDef.disabled !== undefined || fieldDef.logic?.some((l) => l.type === 'disabled')) {\n // Create the signal and READ IT to establish reactive dependencies\n const disabledSignal = resolveNonFieldDisabled({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.disabled,\n });\n result.disabled = disabledSignal();\n }\n } else {\n // Fallback to static values when rootForm is not available\n if (fieldDef.hidden !== undefined) {\n result.hidden = fieldDef.hidden;\n }\n if (fieldDef.disabled !== undefined) {\n result.disabled = fieldDef.disabled;\n }\n }\n\n return result;\n}\n\n/**\n * Applies hidden logic to a non-form-bound field.\n *\n * This is a focused utility for fields that only need hidden state resolution.\n * Use this when you need hidden logic but handle disabled separately\n * (e.g., navigation buttons with custom disabled logic).\n *\n * NOTE: This function must be called inside a computed() context.\n *\n * @param rootForm The root form FieldTree (can be undefined)\n * @param fieldDef The field definition with optional hidden/logic\n * @returns The resolved hidden boolean value, or undefined if no hidden logic\n */\nexport function resolveHiddenValue(\n rootForm: FieldTree<unknown, string | number> | undefined,\n fieldDef: FieldDefWithLogic,\n): boolean | undefined {\n if (!rootForm) {\n return fieldDef.hidden;\n }\n\n if (fieldDef.hidden !== undefined || fieldDef.logic?.some((l) => l.type === 'hidden')) {\n return resolveNonFieldHidden({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.hidden,\n // formValue omitted intentionally - resolver will read form.value() reactively\n })();\n }\n\n return undefined;\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { buildBaseInputs, DEFAULT_PROPS, FormEvent, RootFormRegistryService } from '@ng-forge/dynamic-forms';\nimport { ButtonField } from '../../definitions';\nimport { applyNonFieldLogic } from './non-field-logic.utils';\n\n/**\n * Maps a button field to component inputs.\n *\n * Unlike value field mappers, button fields do not participate in form values\n * and do not need field tree resolution or validation messages.\n *\n * Button-specific properties:\n * - event: The FormEvent constructor to emit when clicked\n * - eventArgs: Optional arguments to pass to the event constructor\n *\n * Hidden and disabled states are resolved using non-field logic resolvers which consider:\n * 1. Explicit `hidden: true` / `disabled: true` on the field definition\n * 2. Field-level `logic` array with `type: 'hidden'` or `type: 'disabled'` conditions\n *\n * @param fieldDef The button field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function buttonFieldMapper<TProps, TEvent extends FormEvent>(\n fieldDef: ButtonField<TProps, TEvent>,\n): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n\n return computed(() => {\n const inputs = buildBaseInputs(fieldDef, defaultProps());\n\n // Add button-specific properties\n inputs['event'] = fieldDef.event;\n\n if (fieldDef.eventArgs !== undefined) {\n inputs['eventArgs'] = fieldDef.eventArgs;\n }\n\n // Apply hidden/disabled logic\n return {\n ...inputs,\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { ARRAY_CONTEXT, ArrayAllowedChildren, DynamicFormLogger } from '@ng-forge/dynamic-forms';\n\n/**\n * Context for array button mapping, containing resolved array information.\n * Used by array button mappers to build event context.\n */\nexport interface ArrayButtonContext {\n /** The target array key (from explicit arrayKey or ARRAY_CONTEXT) */\n targetArrayKey: string | undefined;\n /** Computed signal that returns the current array index (-1 if not inside array) */\n indexSignal: Signal<number>;\n /** The current form value for token resolution */\n formValue: Record<string, unknown>;\n /** Whether this button is inside an array context */\n isInsideArray: boolean;\n}\n\n/**\n * Event context passed to button components for array operations.\n */\nexport interface ArrayButtonEventContext {\n /** The button field key */\n key: string;\n /** The current array index (-1 if outside array) */\n index: number;\n /** The target array key */\n arrayKey: string;\n /** The form value for token resolution */\n formValue: Record<string, unknown>;\n /**\n * Optional template for add operations.\n * Can be a single field (primitive item) or array of fields (object item).\n */\n template?: ArrayAllowedChildren | readonly ArrayAllowedChildren[];\n}\n\n/**\n * Resolves array button context for button mappers.\n *\n * Handles both inside-array (context from ARRAY_CONTEXT) and\n * outside-array (explicit arrayKey) placements.\n *\n * Must be called in injection context.\n *\n * @param fieldKey The button field key (for logging)\n * @param buttonType The button type name (for logging)\n * @param explicitArrayKey Optional explicit arrayKey from field definition\n * @returns The array button context with reactive index signal\n */\nexport function resolveArrayButtonContext(fieldKey: string, buttonType: string, explicitArrayKey?: string): ArrayButtonContext {\n const arrayContext = inject(ARRAY_CONTEXT, { optional: true });\n const logger = inject(DynamicFormLogger);\n\n // Priority: explicit arrayKey from fieldDef > arrayKey from context\n const targetArrayKey = explicitArrayKey ?? arrayContext?.arrayKey;\n\n if (!targetArrayKey) {\n logger.warn(\n `${buttonType} button \"${fieldKey}\" has no array context. ` +\n 'Either place it inside an array field, or provide an explicit arrayKey property.',\n );\n }\n\n // Create index signal once at injection time - computed to track arrayContext.index changes\n const indexSignal = computed(() => {\n if (!arrayContext) return -1;\n return arrayContext.index();\n });\n\n return {\n targetArrayKey,\n indexSignal,\n formValue: (arrayContext?.formValue ?? {}) as Record<string, unknown>,\n isInsideArray: arrayContext !== null,\n };\n}\n\n/**\n * Builds the event context passed to the button component.\n *\n * Should be called inside a computed to track index signal changes.\n *\n * @param fieldKey The button field key\n * @param ctx The resolved array button context\n * @param template Optional template for add operations (single field or array of fields)\n * @returns The event context for the button component\n */\nexport function buildArrayButtonEventContext(\n fieldKey: string,\n ctx: ArrayButtonContext,\n template?: ArrayAllowedChildren | readonly ArrayAllowedChildren[],\n): ArrayButtonEventContext {\n const eventContext: ArrayButtonEventContext = {\n key: fieldKey,\n index: ctx.indexSignal(), // Evaluated inside computed\n arrayKey: ctx.targetArrayKey ?? '',\n formValue: ctx.formValue,\n };\n\n if (template) {\n eventContext.template = template;\n }\n\n return eventContext;\n}\n\n/**\n * Event argument type - supports static values and tokens.\n * Tokens: $key, $index, $arrayKey, $template, formValue\n */\nexport type EventArg = string | number | boolean | null | undefined;\n\n/**\n * Resolves eventArgs with defaults for array buttons.\n *\n * @param fieldEventArgs The eventArgs from field definition (may be undefined)\n * @param defaultEventArgs The default eventArgs to use if not specified\n * @returns The resolved eventArgs array\n */\nexport function resolveArrayButtonEventArgs(\n fieldEventArgs: readonly EventArg[] | undefined,\n defaultEventArgs: readonly EventArg[] = ['$arrayKey', '$template'],\n): readonly EventArg[] {\n return fieldEventArgs ?? defaultEventArgs;\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport {\n AppendArrayItemEvent,\n ArrayAllowedChildren,\n buildBaseInputs,\n DEFAULT_PROPS,\n InsertArrayItemEvent,\n NonFieldLogicConfig,\n PopArrayItemEvent,\n PrependArrayItemEvent,\n RemoveAtIndexEvent,\n RootFormRegistryService,\n ShiftArrayItemEvent,\n} from '@ng-forge/dynamic-forms';\nimport { buildArrayButtonEventContext, EventArg, resolveArrayButtonContext, resolveArrayButtonEventArgs } from './array-button.utils';\nimport { applyNonFieldLogic } from './non-field-logic.utils';\n\n// =============================================================================\n// Base Interfaces\n// =============================================================================\n\n/**\n * Base interface for array add button fields (append, prepend, insert).\n * Template is required to define the structure for new items.\n */\nexport interface BaseArrayAddButtonField<TProps = unknown> {\n key: string;\n type: string;\n label?: string;\n disabled?: boolean;\n hidden?: boolean;\n className?: string;\n props?: TProps;\n /** Target array key (required when outside array, optional inside) */\n arrayKey?: string;\n /**\n * Template defining the field structure for new items. REQUIRED.\n * - Single field (ArrayAllowedChildren): Creates a primitive item (field's value is extracted directly)\n * - Array of fields (ArrayAllowedChildren[]): Creates an object item (fields merged into object)\n */\n template: ArrayAllowedChildren | readonly ArrayAllowedChildren[];\n /** Optional custom eventArgs */\n eventArgs?: readonly EventArg[];\n /** Logic rules for dynamic hidden/disabled state (only hidden and disabled are supported) */\n logic?: NonFieldLogicConfig[];\n}\n\n/**\n * Base interface for array remove button fields (remove, pop, shift).\n * No template needed - removes existing items.\n */\nexport interface BaseArrayRemoveButtonField<TProps = unknown> {\n key: string;\n type: string;\n label?: string;\n disabled?: boolean;\n hidden?: boolean;\n className?: string;\n props?: TProps;\n /** Target array key (required when outside array, optional inside) */\n arrayKey?: string;\n /** Optional custom eventArgs */\n eventArgs?: readonly EventArg[];\n /** Logic rules for dynamic hidden/disabled state (only hidden and disabled are supported) */\n logic?: NonFieldLogicConfig[];\n}\n\n/**\n * Interface for insert array item button fields.\n * Extends add button with required index.\n */\nexport interface BaseInsertArrayItemButtonField<TProps = unknown> extends BaseArrayAddButtonField<TProps> {\n /** The index at which to insert the new item */\n index: number;\n}\n\n// =============================================================================\n// Add Array Item Mappers\n// =============================================================================\n\n/**\n * Mapper for add array item button — appends new item to end of array.\n * Template is REQUIRED to define the field structure for new items.\n */\nexport function addArrayItemButtonMapper<TProps>(fieldDef: BaseArrayAddButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'addArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: AppendArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/**\n * Mapper for prepend array item button — inserts new item at beginning of array.\n * Template is REQUIRED to define the field structure for new items.\n */\nexport function prependArrayItemButtonMapper<TProps>(fieldDef: BaseArrayAddButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'prependArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: PrependArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/**\n * Mapper for insert array item button — inserts new item at specific index.\n * Template and index are REQUIRED.\n */\nexport function insertArrayItemButtonMapper<TProps>(fieldDef: BaseInsertArrayItemButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'insertArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: InsertArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', fieldDef.index, '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n// =============================================================================\n// Remove Array Item Mappers\n// =============================================================================\n\n/**\n * Mapper for remove array item button.\n * Inside array: RemoveAtIndexEvent. Outside array: PopArrayItemEvent.\n */\nexport function removeArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'removeArrayItem', fieldDef.arrayKey);\n\n // Choose event type based on context:\n // - Inside array: RemoveAtIndexEvent (remove specific item)\n // - Outside array: PopArrayItemEvent (remove last item)\n const eventType = ctx.isInsideArray ? RemoveAtIndexEvent : PopArrayItemEvent;\n const defaultEventArgs = ctx.isInsideArray ? ['$arrayKey', '$index'] : ['$arrayKey'];\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: eventType,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, defaultEventArgs),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/** Mapper for pop array item button — removes the last item from array. */\nexport function popArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'popArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: PopArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/** Mapper for shift array item button — removes the first item from array. */\nexport function shiftArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'shiftArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: ShiftArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport {\n buildBaseInputs,\n DEFAULT_PROPS,\n FieldDef,\n FieldWithValidation,\n FIELD_SIGNAL_CONTEXT,\n FORM_OPTIONS,\n NextPageEvent,\n PreviousPageEvent,\n resolveNextButtonDisabled,\n resolveSubmitButtonDisabled,\n RootFormRegistryService,\n} from '@ng-forge/dynamic-forms';\nimport { ButtonField } from '../../definitions';\nimport { resolveHiddenValue } from './non-field-logic.utils';\n\n// =============================================================================\n// Base Interfaces\n// =============================================================================\n\n/**\n * Base interface for navigation button fields (submit, next, previous).\n */\nexport type BaseNavigationButtonField<TProps = unknown> = ButtonField<TProps, SubmitEvent | NextPageEvent | PreviousPageEvent> & {\n type: string;\n /** Logic rules for dynamic disabled state */\n logic?: FieldWithValidation['logic'];\n};\n\n// =============================================================================\n// Submit Button Mapper\n// =============================================================================\n\n/**\n * Mapper for submit button — configures native form submission via type=\"submit\".\n * Triggers native form submission rather than dispatching events directly.\n */\nexport function submitButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const rootFormRegistry = inject(RootFormRegistryService);\n const defaultProps = inject(DEFAULT_PROPS);\n const formOptions = inject(FORM_OPTIONS);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm()!;\n\n // Use rootForm (not fieldSignalContext.form) — submit needs root form validity (#157)\n const disabled = resolveSubmitButtonDisabled({\n form: rootForm,\n formOptions: formOptions(),\n fieldLogic: fieldWithLogic.logic,\n explicitlyDisabled: fieldDef.disabled,\n })();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n // type=\"submit\" triggers native form submission (no event dispatch needed)\n props: { ...(fieldDef.props as Record<string, unknown>), type: 'submit' },\n disabled,\n };\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n\n// =============================================================================\n// Next Page Button Mapper\n// =============================================================================\n\n/** Mapper for next page button — preconfigures NextPageEvent. */\nexport function nextButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const fieldSignalContext = inject(FIELD_SIGNAL_CONTEXT);\n const rootFormRegistry = inject(RootFormRegistryService);\n const defaultProps = inject(DEFAULT_PROPS);\n const formOptions = inject(FORM_OPTIONS);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm();\n\n const disabled = resolveNextButtonDisabled({\n form: fieldSignalContext.form,\n formOptions: formOptions(),\n fieldLogic: fieldWithLogic.logic,\n currentPageValid: fieldSignalContext.currentPageValid,\n })();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n event: NextPageEvent,\n disabled,\n };\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n\n// =============================================================================\n// Previous Page Button Mapper\n// =============================================================================\n\n/** Mapper for previous page button — preconfigures PreviousPageEvent. */\nexport function previousButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n event: PreviousPageEvent,\n };\n\n // Add disabled binding only if explicitly set by user\n if (fieldDef.disabled !== undefined) {\n inputs['disabled'] = fieldDef.disabled;\n }\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n","// Button field mapper (generic)\nexport { buttonFieldMapper } from './button-field-mapper';\n\n// Array button utilities\nexport { resolveArrayButtonContext, buildArrayButtonEventContext, resolveArrayButtonEventArgs } from './array-button.utils';\nexport type { ArrayButtonContext, ArrayButtonEventContext, EventArg } from './array-button.utils';\n\n// Non-field logic utilities (for hidden/disabled state on non-form-bound elements)\nexport { applyNonFieldLogic, resolveHiddenValue } from './non-field-logic.utils';\nexport type { FieldDefWithLogic, NonFieldLogicResult } from './non-field-logic.utils';\n\n// Array button mappers\nexport {\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n} from './array-button.mapper';\nexport type { BaseArrayAddButtonField, BaseArrayRemoveButtonField, BaseInsertArrayItemButtonField } from './array-button.mapper';\n\n// Navigation button mappers\nexport { submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper } from './navigation-button.mapper';\nexport type { BaseNavigationButtonField } from './navigation-button.mapper';\n","// UI-specific field mappers\nexport { valueFieldMapper, buildValueFieldInputs, resolveValueFieldContext } from './value/value-field.mapper';\nexport type { ValueFieldContext } from './value/value-field.mapper';\nexport { checkboxFieldMapper } from './checkbox/checkbox-field-mapper';\nexport { datepickerFieldMapper } from './datepicker/datepicker-field-mapper';\nexport { optionsFieldMapper } from './select/options-field-mapper';\nexport type { FieldWithOptions } from './select/options-field-mapper';\nexport { textareaFieldMapper } from './textarea/textarea-field-mapper';\nexport { sliderFieldMapper } from './slider/slider-field-mapper';\n\n// Button field mappers\nexport {\n buttonFieldMapper,\n // Array button utilities\n resolveArrayButtonContext,\n buildArrayButtonEventContext,\n resolveArrayButtonEventArgs,\n // Array button mappers\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n // Navigation button mappers\n submitButtonFieldMapper,\n nextButtonFieldMapper,\n previousButtonFieldMapper,\n} from './button';\nexport type {\n ArrayButtonContext,\n ArrayButtonEventContext,\n BaseArrayAddButtonField,\n BaseArrayRemoveButtonField,\n BaseInsertArrayItemButtonField,\n BaseNavigationButtonField,\n EventArg,\n} from './button';\n","import { computed, inject, Injector, signal, Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { FieldTree, ValidationError } from '@angular/forms/signals';\nimport { combineLatest, Observable, of } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { ValidationMessages } from '@ng-forge/dynamic-forms';\nimport { dynamicTextToObservable } from '@ng-forge/dynamic-forms';\nimport { interpolateParams } from '@ng-forge/dynamic-forms';\nimport { DynamicFormLogger } from '@ng-forge/dynamic-forms';\nimport type { Logger } from '@ng-forge/dynamic-forms';\n\n/**\n * Resolved validation error with interpolated message\n */\nexport interface ResolvedError {\n kind: string;\n message: string;\n}\n\n/**\n * Factory function that creates a signal of resolved validation errors\n * Handles async resolution of DynamicText validation messages\n *\n * @param field - Signal containing FieldTree\n * @param validationMessages - Signal containing custom field-level validation messages\n * @param defaultValidationMessages - Signal containing default validation messages (fallback)\n * @param injector - Optional injector for DynamicText resolution\n * @returns Signal<ResolvedError[]> - Reactively resolved error messages\n *\n * @example\n * ```typescript\n * readonly resolvedErrors = createResolvedErrorsSignal(\n * this.field,\n * this.validationMessages,\n * this.defaultValidationMessages\n * );\n * ```\n */\nexport function createResolvedErrorsSignal<T>(\n field: Signal<FieldTree<T>>,\n validationMessages: Signal<ValidationMessages | undefined>,\n defaultValidationMessages: Signal<ValidationMessages | undefined> = signal(undefined),\n injector = inject(Injector),\n): Signal<ResolvedError[]> {\n // Get logger from injector\n const logger = injector.get(DynamicFormLogger);\n\n // Ensure validationMessages is never undefined (mappers pass {} if not defined)\n const messages = computed(() => validationMessages() ?? {});\n const defaultMessages = computed(() => defaultValidationMessages() ?? {});\n\n // Create a computed signal that reads the actual errors from the field\n // This ensures the signal tracks changes to field().errors(), not just the field reference\n const errors = computed(() => {\n const control = field()();\n return control.errors();\n });\n\n // Convert signals to observables using toObservable with injector\n const errors$ = toObservable(errors, { injector });\n const messages$ = toObservable(messages, { injector });\n const defaultMessages$ = toObservable(defaultMessages, { injector });\n\n // Combine observables and process errors\n const resolvedErrors$ = combineLatest([errors$, messages$, defaultMessages$]).pipe(\n switchMap(([currentErrors, msgs, defaultMsgs]) => {\n // No errors - return empty array\n if (!currentErrors || currentErrors.length === 0) {\n return of([]);\n }\n\n // Create observable for each error's resolved message\n const errorResolvers = currentErrors.map((error: ValidationError) => resolveErrorMessage(error, msgs, defaultMsgs, injector, logger));\n\n // Combine all error message observables into single array emission, filtering out nulls\n return errorResolvers.length > 0\n ? combineLatest(errorResolvers).pipe(map((errors) => errors.filter((e): e is ResolvedError => e !== null)))\n : of([]);\n }),\n );\n\n // Convert observable back to signal using toSignal with injector\n // toSignal properly handles the injection context and manages subscriptions\n return toSignal(resolvedErrors$, { initialValue: [] as ResolvedError[], injector });\n}\n\n/**\n * Resolves a single error message from DynamicText sources with fallback logic\n * Priority: field-level message → default message → error.message → no message (logs warning)\n *\n * The error.message fallback enables schema validation libraries (Zod, Valibot, etc.)\n * to provide their own messages without requiring explicit validationMessages configuration.\n * Users who want translations can still override by configuring validationMessages.\n *\n * @internal\n */\nfunction resolveErrorMessage(\n error: ValidationError,\n fieldMessages: ValidationMessages,\n defaultMessages: ValidationMessages,\n injector: Injector,\n logger: Logger,\n): Observable<ResolvedError | null> {\n // Check for field-level custom message first\n const fieldMessage = fieldMessages[error.kind];\n\n // Fall back to default message if no field-level message exists\n const defaultMessage = defaultMessages[error.kind];\n\n // Determine which message to use: field-level → default → error.message (from schema validators)\n const messageToUse = fieldMessage ?? defaultMessage ?? error.message;\n\n // If no message found, log warning and return null (will be filtered out)\n if (!messageToUse) {\n logger.warn(\n `No validation message found for error kind \"${error.kind}\". ` +\n `Please provide a message via field-level validationMessages or form-level defaultValidationMessages.`,\n );\n return of(null);\n }\n\n // If using error.message directly (from schema validators), wrap in of() instead of dynamicTextToObservable\n // error.message is always a plain string, not DynamicText\n const isSchemaMessage = fieldMessage === undefined && defaultMessage === undefined;\n const messageObservable = isSchemaMessage\n ? of(messageToUse as string) // error.message is always string\n : dynamicTextToObservable(messageToUse, injector);\n\n // Apply parameter interpolation to support {{param}} syntax\n return messageObservable.pipe(\n map((msg) => ({\n kind: error.kind,\n message: interpolateParams(msg, error),\n })),\n );\n}\n","import { Signal, computed } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\n\n/**\n * Computed signal that determines if errors should be displayed.\n * Based on field's invalid, touched, and error count.\n *\n * @param field - Signal containing FieldTree\n * @returns Signal<boolean> - True if errors should be displayed\n */\nexport function shouldShowErrors<T>(field: Signal<FieldTree<T>>): Signal<boolean> {\n return computed(() => {\n const fieldTree = field();\n const control = fieldTree();\n\n return control.invalid() && control.touched() && control.errors().length > 0;\n });\n}\n","import { afterRenderEffect, ElementRef, Signal } from '@angular/core';\nimport { applyMetaToElement, FieldMeta, isEqual } from '@ng-forge/dynamic-forms';\n\n/**\n * Configuration options for setupMetaTracking.\n */\nexport interface MetaTrackingOptions {\n /**\n * CSS selector for target elements within the host.\n * If not provided, meta attributes are applied directly to the host element.\n *\n * @example\n * // Apply to internal radio inputs\n * selector: 'input[type=\"radio\"]'\n *\n * // Apply to host element (for Shadow DOM components)\n * selector: undefined\n */\n selector?: string;\n\n /**\n * Additional signals to track that should trigger re-application of meta.\n * Useful for components where DOM elements are dynamically created (e.g., radio options).\n *\n * @example\n * // Re-apply when options change\n * dependents: [this.options]\n */\n dependents?: Signal<unknown>[];\n}\n\n/**\n * Sets up automatic meta attribute tracking and application for wrapped components.\n *\n * This utility creates an `afterRenderEffect` that applies meta attributes to DOM elements\n * after Angular's render cycle. It efficiently tracks signal dependencies and only re-applies\n * when the meta signal or any dependent signals change.\n *\n * Use this instead of MutationObserver for better performance and integration with Angular's\n * change detection.\n *\n * @param elementRef - Reference to the host element\n * @param meta - Signal containing meta attributes to apply\n * @param options - Configuration options\n *\n * @example\n * ```typescript\n * // For a radio group with dynamic options\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta, {\n * selector: 'input[type=\"radio\"]',\n * dependents: [this.options]\n * });\n * }\n *\n * // For a simple checkbox\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta, {\n * selector: 'input[type=\"checkbox\"]'\n * });\n * }\n *\n * // For Shadow DOM components (apply to host)\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta);\n * }\n * ```\n */\nexport function setupMetaTracking(\n elementRef: ElementRef<HTMLElement>,\n meta: Signal<FieldMeta | undefined>,\n options?: MetaTrackingOptions,\n): void {\n let appliedAttributes = new Set<string>();\n let previousMeta: FieldMeta | undefined;\n let previousDeps: unknown[] | undefined;\n\n afterRenderEffect({\n write: () => {\n // Read dependents to establish signal tracking and collect their values\n const currentDeps = options?.dependents?.map((dep) => dep());\n\n const currentMeta = meta();\n const hostElement = elementRef.nativeElement;\n\n // Early exit if nothing changed (using deep equality for meta)\n const metaChanged = !isEqual(currentMeta, previousMeta);\n const depsChanged =\n !previousDeps || currentDeps?.length !== previousDeps.length || currentDeps?.some((d, i) => d !== previousDeps![i]);\n\n if (!metaChanged && !depsChanged) {\n return;\n }\n\n previousMeta = currentMeta;\n previousDeps = currentDeps;\n\n if (options?.selector) {\n // Apply to elements matching selector\n const elements = hostElement.querySelectorAll(options.selector);\n const allApplied = new Set<string>();\n\n elements.forEach((el) => {\n const applied = applyMetaToElement(el, currentMeta, appliedAttributes);\n applied.forEach((attr) => allApplied.add(attr));\n });\n\n appliedAttributes = allApplied;\n } else {\n // Apply to host element (for Shadow DOM components)\n appliedAttributes = applyMetaToElement(hostElement, currentMeta, appliedAttributes);\n }\n },\n });\n}\n","// Error display utilities for field components\nexport { createResolvedErrorsSignal } from './create-resolved-errors-signal';\nexport type { ResolvedError } from './create-resolved-errors-signal';\nexport { shouldShowErrors } from './should-show-errors';\n\n// Value comparison utilities - re-exported from main library\nexport { isEqual } from '@ng-forge/dynamic-forms';\n\n// Meta tracking utilities\nexport { setupMetaTracking } from './setup-meta-tracking';\nexport type { MetaTrackingOptions } from './setup-meta-tracking';\n","/**\n * @ng-forge/dynamic-forms/integration\n *\n * Integration API for UI library authors building field implementations\n * (Material, Bootstrap, PrimeNG, Ionic, etc.)\n *\n * This entrypoint provides:\n * - Specific field type definitions (InputField, SelectField, etc.)\n * - Field mappers for creating FieldTypeDefinition\n * - Error display utilities for field components\n */\n\n// =============================================================================\n// Field Type Definitions\n// =============================================================================\n\nexport type {\n ButtonField,\n EventArgs,\n CheckboxField,\n DatepickerField,\n DatepickerProps,\n InputField,\n InputProps,\n InputType,\n InputTypeToValueType,\n InferInputValue,\n NumericInputType,\n StringInputType,\n HtmlInputType,\n InputMeta,\n AutocompleteValue,\n InputMode,\n EnterKeyHint,\n Autocapitalize,\n MultiCheckboxField,\n RadioField,\n SelectField,\n SelectProps,\n SliderField,\n TextareaField,\n TextareaProps,\n TextareaMeta,\n TextareaWrap,\n ToggleField,\n} from './definitions';\n\n// =============================================================================\n// Field Mappers\n// =============================================================================\n\nexport {\n valueFieldMapper,\n buildValueFieldInputs,\n resolveValueFieldContext,\n checkboxFieldMapper,\n datepickerFieldMapper,\n optionsFieldMapper,\n // Button mappers\n buttonFieldMapper,\n // Array button utilities\n resolveArrayButtonContext,\n buildArrayButtonEventContext,\n resolveArrayButtonEventArgs,\n // Array button mappers\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n // Navigation button mappers\n submitButtonFieldMapper,\n nextButtonFieldMapper,\n previousButtonFieldMapper,\n} from './mappers';\n\nexport type {\n ValueFieldContext,\n FieldWithOptions,\n ArrayButtonContext,\n ArrayButtonEventContext,\n BaseArrayAddButtonField,\n BaseArrayRemoveButtonField,\n BaseInsertArrayItemButtonField,\n BaseNavigationButtonField,\n EventArg,\n} from './mappers';\n\n// =============================================================================\n// Error Display Utilities\n// =============================================================================\n\nexport { createResolvedErrorsSignal, shouldShowErrors } from './utils';\nexport type { ResolvedError } from './utils';\n\n// =============================================================================\n// Value Comparison Utilities\n// =============================================================================\n\nexport { isEqual } from './utils';\n\n// =============================================================================\n// Meta Tracking Utilities\n// =============================================================================\n\nexport { setupMetaTracking } from './utils';\nexport type { MetaTrackingOptions } from './utils';\n\n// =============================================================================\n// Non-Field Logic Resolvers (re-exported from @ng-forge/dynamic-forms)\n// =============================================================================\n\nexport { resolveNonFieldHidden, resolveNonFieldDisabled } from '@ng-forge/dynamic-forms';\nexport type { NonFieldLogicContext, NonFieldLogicType, NonFieldLogicConfig } from '@ng-forge/dynamic-forms';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAyBA;;;;;;;;;;;;;AAaG;SACa,wBAAwB,GAAA;AACtC,IAAA,MAAM,OAAO,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAE5C,OAAO;AACL,QAAA,YAAY,EAAE,CAAC,QAAgB,KAAI;;;AAGjC,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAkE;;YAG3F,IAAI,CAAC,QAAQ,EAAE;AACb,gBAAA,OAAO,SAAS;YAClB;AAEA,YAAA,OAAO,QAAQ,CAAC,QAAQ,CAAC;QAC3B,CAAC;KACF;AACH;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,qBAAqB,CACnC,QAA4D,EAC5D,GAAsB,EACtB,YAAsC,EACtC,yBAA8C,EAAA;IAE9C,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,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DA;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-forge-dynamic-forms-integration.mjs","sources":["../../../../packages/dynamic-forms/integration/src/mappers/value/value-field.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/checkbox/checkbox-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/datepicker/datepicker-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/select/options-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/slider/slider-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/non-field-logic.utils.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/button-field-mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/array-button.utils.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/array-button.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/navigation-button.mapper.ts","../../../../packages/dynamic-forms/integration/src/mappers/button/index.ts","../../../../packages/dynamic-forms/integration/src/mappers/index.ts","../../../../packages/dynamic-forms/integration/src/utils/create-resolved-errors-signal.ts","../../../../packages/dynamic-forms/integration/src/utils/should-show-errors.ts","../../../../packages/dynamic-forms/integration/src/utils/setup-meta-tracking.ts","../../../../packages/dynamic-forms/integration/src/utils/index.ts","../../../../packages/dynamic-forms/integration/src/public_api.ts","../../../../packages/dynamic-forms/integration/src/ng-forge-dynamic-forms-integration.ts"],"sourcesContent":["import { BaseValueField, FieldMeta } from '@ng-forge/dynamic-forms';\nimport { computed, inject, Signal } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\nimport { buildBaseInputs, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { FIELD_SIGNAL_CONTEXT } from '@ng-forge/dynamic-forms';\nimport { omit } from '@ng-forge/dynamic-forms';\nimport { ValidationMessages } from '@ng-forge/dynamic-forms';\n\n/**\n * Context for value field mapping, containing the injected context reference.\n * Used by specialized mappers to avoid duplicate injection.\n *\n * Note: The field tree is resolved lazily via getFieldTree() to support\n * reactive form access (e.g., for array items where the form structure\n * may not exist at injection time but becomes available later).\n */\nexport interface ValueFieldContext {\n /**\n * Gets the field tree for a given key from the form context.\n * This is reactive for array items - the form getter is evaluated each time,\n * allowing the computed to re-run when the root form structure updates.\n */\n getFieldTree: (fieldKey: string) => FieldTree<unknown> | undefined;\n}\n\n/**\n * Creates a value field context from the injected FIELD_SIGNAL_CONTEXT.\n * Must be called within an injection context.\n *\n * With direct root form binding for array items, the FIELD_SIGNAL_CONTEXT.form\n * uses a getter that evaluates reactively. This means:\n * - For regular fields: direct access to the form's FieldTree\n * - For array items: the getter resolves rootForm['arrayKey'][index] dynamically\n *\n * The returned context provides a getFieldTree function that should be called\n * inside a computed to establish proper reactive dependencies.\n *\n * @returns The value field context with reactive field tree accessor\n */\nexport function resolveValueFieldContext(): ValueFieldContext {\n const context = inject(FIELD_SIGNAL_CONTEXT);\n\n return {\n getFieldTree: (fieldKey: string) => {\n // Access context.form here (inside a function that will be called from a computed)\n // This allows the getter to be evaluated reactively\n const formRoot = context.form as Record<string, FieldTree<unknown> | undefined> | undefined;\n\n // Handle case where form is undefined (e.g., newly added array items before root form updates)\n if (!formRoot) {\n return undefined;\n }\n\n return formRoot[fieldKey];\n },\n };\n}\n\n/**\n * Builds the base inputs for a value field.\n * This is a helper function used by valueFieldMapper and specialized mappers.\n *\n * Note: This function should be called inside a computed signal to ensure\n * proper reactive dependency tracking for the field tree resolution.\n *\n * @param fieldDef The value field definition\n * @param ctx The resolved value field context\n * @param defaultProps Default props from the form configuration (may be undefined if not configured)\n * @param defaultValidationMessages Default validation messages from the form configuration (may be undefined if not configured)\n * @returns Record of input names to values\n */\nexport function buildValueFieldInputs<TProps, TValue = unknown>(\n fieldDef: BaseValueField<TProps, TValue, FieldMeta, boolean>,\n ctx: ValueFieldContext,\n defaultProps?: Record<string, unknown>,\n defaultValidationMessages?: ValidationMessages,\n): Record<string, unknown> {\n const omittedFields = omit(fieldDef, ['value']);\n const baseInputs = buildBaseInputs(omittedFields, defaultProps);\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n validationMessages: fieldDef.validationMessages ?? {},\n };\n\n if (fieldDef.placeholder !== undefined) {\n inputs['placeholder'] = fieldDef.placeholder;\n }\n\n if (defaultValidationMessages !== undefined) {\n inputs['defaultValidationMessages'] = defaultValidationMessages;\n }\n\n // Resolve field tree reactively - this call is inside a computed,\n // so it establishes the reactive dependency correctly\n const fieldTree = ctx.getFieldTree(fieldDef.key);\n if (fieldTree !== undefined) {\n inputs['field'] = fieldTree;\n }\n\n return inputs;\n}\n\n/**\n * Maps a value field definition to component inputs.\n *\n * Value fields are input fields that contribute to the form's value (text, number, etc.).\n * This mapper injects FIELD_SIGNAL_CONTEXT to access the form structure and retrieve the field proxy.\n *\n * For array items, the FIELD_SIGNAL_CONTEXT.form uses a reactive getter that resolves\n * rootForm['arrayKey'][index] dynamically. This means:\n * - Zod/StandardSchema validation errors are automatically available\n * - The field tree updates reactively when the root form structure changes\n * - Newly added array items will get their field tree once the form value updates\n *\n * For fields with specific properties, use the specialized mappers:\n * - optionsFieldMapper: for fields with options (select, radio, multi-checkbox)\n * - datepickerFieldMapper: for fields with minDate, maxDate, startAt\n * - checkboxFieldMapper: for boolean fields (checkbox, toggle)\n *\n * @param fieldDef The value field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function valueFieldMapper<TProps = unknown, TValue = unknown>(\n fieldDef: BaseValueField<TProps, TValue, FieldMeta, boolean>,\n): Signal<Record<string, unknown>> {\n // Get the context once at injection time (captures the FIELD_SIGNAL_CONTEXT reference)\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n // The computed calls ctx.getFieldTree(fieldDef.key) inside, which:\n // 1. Accesses context.form (triggering the getter for array items)\n // 2. Returns the field tree if available, or undefined if not yet\n // 3. Re-runs when the form structure updates (reactive dependency)\n return computed(() => {\n return buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n });\n}\n","import { BaseCheckedField } from '@ng-forge/dynamic-forms';\nimport { FieldDef } from '@ng-forge/dynamic-forms';\nimport { computed, inject, Signal } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\nimport { buildBaseInputs, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { FIELD_SIGNAL_CONTEXT } from '@ng-forge/dynamic-forms';\nimport { omit } from '@ng-forge/dynamic-forms';\n\n/**\n * Maps a checkbox/toggle field definition to component inputs.\n *\n * Checkbox fields are checked fields that contribute to the form's value as boolean.\n * This mapper injects FIELD_SIGNAL_CONTEXT to access the form structure and retrieve the field tree.\n *\n * @param fieldDef The checkbox field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function checkboxFieldMapper(fieldDef: BaseCheckedField<unknown>): Signal<Record<string, unknown>> {\n const context = inject(FIELD_SIGNAL_CONTEXT);\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const omittedFields = omit(fieldDef, ['value']) as FieldDef<unknown>;\n const baseInputs = buildBaseInputs(omittedFields, defaultProps());\n const validationMessages = defaultValidationMessages();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n validationMessages: fieldDef.validationMessages ?? {},\n };\n\n if (fieldDef.placeholder !== undefined) {\n inputs['placeholder'] = fieldDef.placeholder;\n }\n\n if (validationMessages !== undefined) {\n inputs['defaultValidationMessages'] = validationMessages;\n }\n\n // Access form inside computed for reactivity and to handle cases where\n // form may not be immediately available (e.g., during array item initialization)\n const formRoot = context.form as Record<string, FieldTree<unknown> | undefined> | undefined;\n const fieldTree = formRoot?.[fieldDef.key];\n if (fieldTree !== undefined) {\n inputs['field'] = fieldTree;\n }\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { DatepickerField } from '../../definitions';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Converts a date value (string, Date, or null) to a Date object or null.\n * This ensures UI libraries that expect Date objects receive the correct type.\n */\nfunction toDate(value: Date | string | null | undefined): Date | null {\n if (value === null || value === undefined) {\n return null;\n }\n if (value instanceof Date) {\n return value;\n }\n // Parse string to Date\n const date = new Date(value);\n return isNaN(date.getTime()) ? null : date;\n}\n\n/**\n * Maps a datepicker field to component inputs.\n *\n * Extends the base value field mapper by adding datepicker-specific properties:\n * - minDate: Minimum selectable date\n * - maxDate: Maximum selectable date\n * - startAt: Initial date to display when opening the picker\n *\n * Date values are automatically converted from strings to Date objects\n * since UI libraries (Material, PrimeNG, etc.) expect Date objects.\n *\n * @param fieldDef The datepicker field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function datepickerFieldMapper<TProps>(fieldDef: DatepickerField<TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const inputs = buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n\n // Add datepicker-specific properties, converting strings to Date objects\n if (fieldDef.minDate !== undefined) {\n inputs['minDate'] = toDate(fieldDef.minDate);\n }\n if (fieldDef.maxDate !== undefined) {\n inputs['maxDate'] = toDate(fieldDef.maxDate);\n }\n if (fieldDef.startAt !== undefined) {\n inputs['startAt'] = toDate(fieldDef.startAt);\n }\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { SelectField } from '../../definitions';\nimport { RadioField } from '../../definitions';\nimport { MultiCheckboxField } from '../../definitions';\nimport { BaseValueField, DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES, FieldMeta } from '@ng-forge/dynamic-forms';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Field types that have an options property.\n */\nexport type FieldWithOptions<T = unknown, TProps = unknown> =\n | SelectField<T, TProps>\n | RadioField<T, TProps>\n | MultiCheckboxField<T, TProps>;\n\n/**\n * Maps a field with options (select, radio, multi-checkbox) to component inputs.\n *\n * Extends the base value field mapper by adding the options property.\n *\n * @param fieldDef The field definition with options\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function optionsFieldMapper<T, TProps>(fieldDef: FieldWithOptions<T, TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n // Cast to BaseValueField - safe because all FieldWithOptions types extend BaseValueField\n const inputs = buildValueFieldInputs(\n fieldDef as BaseValueField<TProps, unknown, FieldMeta, boolean>,\n ctx,\n defaultProps(),\n defaultValidationMessages(),\n );\n\n // Add options property\n inputs['options'] = fieldDef.options;\n\n return inputs;\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { DEFAULT_PROPS, DEFAULT_VALIDATION_MESSAGES } from '@ng-forge/dynamic-forms';\nimport { SliderField } from '../../definitions';\nimport { resolveValueFieldContext, buildValueFieldInputs } from '../value/value-field.mapper';\n\n/**\n * Maps a slider field to component inputs.\n *\n * Extends the base value field mapper by adding slider-specific properties:\n * - minValue: Minimum slider value\n * - maxValue: Maximum slider value\n * - step: Step increment for the slider\n *\n * @param fieldDef The slider field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function sliderFieldMapper<TProps>(fieldDef: SliderField<TProps>): Signal<Record<string, unknown>> {\n const ctx = resolveValueFieldContext();\n const defaultProps = inject(DEFAULT_PROPS);\n const defaultValidationMessages = inject(DEFAULT_VALIDATION_MESSAGES);\n\n return computed(() => {\n const inputs = buildValueFieldInputs(fieldDef, ctx, defaultProps(), defaultValidationMessages());\n\n // Add slider-specific properties (these are at field level, not in props)\n if (fieldDef.minValue !== undefined) {\n inputs['minValue'] = fieldDef.minValue;\n }\n if (fieldDef.maxValue !== undefined) {\n inputs['maxValue'] = fieldDef.maxValue;\n }\n if (fieldDef.step !== undefined) {\n inputs['step'] = fieldDef.step;\n }\n\n return inputs;\n });\n}\n","import {\n LogicConfig,\n NonFieldLogicConfig,\n resolveNonFieldDisabled,\n resolveNonFieldHidden,\n RootFormRegistryService,\n} from '@ng-forge/dynamic-forms';\nimport { FieldTree } from '@angular/forms/signals';\n\n/**\n * Field definition with optional hidden/disabled and logic properties.\n * This is the minimal interface needed by applyNonFieldLogic.\n */\nexport interface FieldDefWithLogic {\n hidden?: boolean;\n disabled?: boolean;\n logic?: NonFieldLogicConfig[] | LogicConfig[];\n}\n\n/**\n * Result of applying non-field logic to a field.\n * Only includes properties that have values to apply.\n */\nexport interface NonFieldLogicResult {\n hidden?: boolean;\n disabled?: boolean;\n}\n\n/**\n * Applies hidden and disabled logic to a non-form-bound field.\n * Must be called inside a computed() context (reads form signals).\n */\nexport function applyNonFieldLogic(rootFormRegistry: RootFormRegistryService, fieldDef: FieldDefWithLogic): NonFieldLogicResult {\n const result: NonFieldLogicResult = {};\n const rootForm = rootFormRegistry.rootForm();\n\n if (rootForm) {\n if (fieldDef.hidden !== undefined || fieldDef.logic?.some((l) => l.type === 'hidden')) {\n const hiddenSignal = resolveNonFieldHidden({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.hidden,\n });\n result.hidden = hiddenSignal();\n }\n\n // Resolve disabled state if explicitly set or has logic\n if (fieldDef.disabled !== undefined || fieldDef.logic?.some((l) => l.type === 'disabled')) {\n // Create the signal and READ IT to establish reactive dependencies\n const disabledSignal = resolveNonFieldDisabled({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.disabled,\n });\n result.disabled = disabledSignal();\n }\n } else {\n // Fallback to static values when rootForm is not available\n if (fieldDef.hidden !== undefined) {\n result.hidden = fieldDef.hidden;\n }\n if (fieldDef.disabled !== undefined) {\n result.disabled = fieldDef.disabled;\n }\n }\n\n return result;\n}\n\n/**\n * Applies hidden logic to a non-form-bound field.\n *\n * This is a focused utility for fields that only need hidden state resolution.\n * Use this when you need hidden logic but handle disabled separately\n * (e.g., navigation buttons with custom disabled logic).\n *\n * NOTE: This function must be called inside a computed() context.\n *\n * @param rootForm The root form FieldTree (can be undefined)\n * @param fieldDef The field definition with optional hidden/logic\n * @returns The resolved hidden boolean value, or undefined if no hidden logic\n */\nexport function resolveHiddenValue(\n rootForm: FieldTree<unknown, string | number> | undefined,\n fieldDef: FieldDefWithLogic,\n): boolean | undefined {\n if (!rootForm) {\n return fieldDef.hidden;\n }\n\n if (fieldDef.hidden !== undefined || fieldDef.logic?.some((l) => l.type === 'hidden')) {\n return resolveNonFieldHidden({\n form: rootForm,\n fieldLogic: fieldDef.logic,\n explicitValue: fieldDef.hidden,\n // formValue omitted intentionally - resolver will read form.value() reactively\n })();\n }\n\n return undefined;\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { buildBaseInputs, DEFAULT_PROPS, FormEvent, RootFormRegistryService } from '@ng-forge/dynamic-forms';\nimport { ButtonField } from '../../definitions';\nimport { applyNonFieldLogic } from './non-field-logic.utils';\n\n/**\n * Maps a button field to component inputs.\n *\n * Unlike value field mappers, button fields do not participate in form values\n * and do not need field tree resolution or validation messages.\n *\n * Button-specific properties:\n * - event: The FormEvent constructor to emit when clicked\n * - eventArgs: Optional arguments to pass to the event constructor\n *\n * Hidden and disabled states are resolved using non-field logic resolvers which consider:\n * 1. Explicit `hidden: true` / `disabled: true` on the field definition\n * 2. Field-level `logic` array with `type: 'hidden'` or `type: 'disabled'` conditions\n *\n * @param fieldDef The button field definition\n * @returns Signal containing Record of input names to values for ngComponentOutlet\n */\nexport function buttonFieldMapper<TProps, TEvent extends FormEvent>(\n fieldDef: ButtonField<TProps, TEvent>,\n): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n\n return computed(() => {\n const inputs = buildBaseInputs(fieldDef, defaultProps());\n\n // Add button-specific properties\n inputs['event'] = fieldDef.event;\n\n if (fieldDef.eventArgs !== undefined) {\n inputs['eventArgs'] = fieldDef.eventArgs;\n }\n\n // Apply hidden/disabled logic\n return {\n ...inputs,\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport { ARRAY_CONTEXT, ArrayAllowedChildren, DynamicFormLogger } from '@ng-forge/dynamic-forms';\n\n/**\n * Context for array button mapping, containing resolved array information.\n * Used by array button mappers to build event context.\n */\nexport interface ArrayButtonContext {\n /** The target array key (from explicit arrayKey or ARRAY_CONTEXT) */\n targetArrayKey: string | undefined;\n /** Computed signal that returns the current array index (-1 if not inside array) */\n indexSignal: Signal<number>;\n /** The current form value for token resolution */\n formValue: Record<string, unknown>;\n /** Whether this button is inside an array context */\n isInsideArray: boolean;\n}\n\n/**\n * Event context passed to button components for array operations.\n */\nexport interface ArrayButtonEventContext {\n /** The button field key */\n key: string;\n /** The current array index (-1 if outside array) */\n index: number;\n /** The target array key */\n arrayKey: string;\n /** The form value for token resolution */\n formValue: Record<string, unknown>;\n /**\n * Optional template for add operations.\n * Can be a single field (primitive item) or array of fields (object item).\n */\n template?: ArrayAllowedChildren | readonly ArrayAllowedChildren[];\n}\n\n/**\n * Resolves array button context for button mappers.\n *\n * Handles both inside-array (context from ARRAY_CONTEXT) and\n * outside-array (explicit arrayKey) placements.\n *\n * Must be called in injection context.\n *\n * @param fieldKey The button field key (for logging)\n * @param buttonType The button type name (for logging)\n * @param explicitArrayKey Optional explicit arrayKey from field definition\n * @returns The array button context with reactive index signal\n */\nexport function resolveArrayButtonContext(fieldKey: string, buttonType: string, explicitArrayKey?: string): ArrayButtonContext {\n const arrayContext = inject(ARRAY_CONTEXT, { optional: true });\n const logger = inject(DynamicFormLogger);\n\n // Priority: explicit arrayKey from fieldDef > arrayKey from context\n const targetArrayKey = explicitArrayKey ?? arrayContext?.arrayKey;\n\n if (!targetArrayKey) {\n logger.warn(\n `${buttonType} button \"${fieldKey}\" has no array context. ` +\n 'Either place it inside an array field, or provide an explicit arrayKey property.',\n );\n }\n\n // Create index signal once at injection time - computed to track arrayContext.index changes\n const indexSignal = computed(() => {\n if (!arrayContext) return -1;\n return arrayContext.index();\n });\n\n return {\n targetArrayKey,\n indexSignal,\n formValue: (arrayContext?.formValue ?? {}) as Record<string, unknown>,\n isInsideArray: arrayContext !== null,\n };\n}\n\n/**\n * Builds the event context passed to the button component.\n *\n * Should be called inside a computed to track index signal changes.\n *\n * @param fieldKey The button field key\n * @param ctx The resolved array button context\n * @param template Optional template for add operations (single field or array of fields)\n * @returns The event context for the button component\n */\nexport function buildArrayButtonEventContext(\n fieldKey: string,\n ctx: ArrayButtonContext,\n template?: ArrayAllowedChildren | readonly ArrayAllowedChildren[],\n): ArrayButtonEventContext {\n const eventContext: ArrayButtonEventContext = {\n key: fieldKey,\n index: ctx.indexSignal(), // Evaluated inside computed\n arrayKey: ctx.targetArrayKey ?? '',\n formValue: ctx.formValue,\n };\n\n if (template) {\n eventContext.template = template;\n }\n\n return eventContext;\n}\n\n/**\n * Event argument type - supports static values and tokens.\n * Tokens: $key, $index, $arrayKey, $template, formValue\n */\nexport type EventArg = string | number | boolean | null | undefined;\n\n/**\n * Resolves eventArgs with defaults for array buttons.\n *\n * @param fieldEventArgs The eventArgs from field definition (may be undefined)\n * @param defaultEventArgs The default eventArgs to use if not specified\n * @returns The resolved eventArgs array\n */\nexport function resolveArrayButtonEventArgs(\n fieldEventArgs: readonly EventArg[] | undefined,\n defaultEventArgs: readonly EventArg[] = ['$arrayKey', '$template'],\n): readonly EventArg[] {\n return fieldEventArgs ?? defaultEventArgs;\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport {\n AppendArrayItemEvent,\n ArrayAllowedChildren,\n buildBaseInputs,\n DEFAULT_PROPS,\n InsertArrayItemEvent,\n NonFieldLogicConfig,\n PopArrayItemEvent,\n PrependArrayItemEvent,\n RemoveAtIndexEvent,\n RootFormRegistryService,\n ShiftArrayItemEvent,\n} from '@ng-forge/dynamic-forms';\nimport { buildArrayButtonEventContext, EventArg, resolveArrayButtonContext, resolveArrayButtonEventArgs } from './array-button.utils';\nimport { applyNonFieldLogic } from './non-field-logic.utils';\n\n// =============================================================================\n// Base Interfaces\n// =============================================================================\n\n/**\n * Base interface for array add button fields (append, prepend, insert).\n * Template is required to define the structure for new items.\n */\nexport interface BaseArrayAddButtonField<TProps = unknown> {\n key: string;\n type: string;\n label?: string;\n disabled?: boolean;\n hidden?: boolean;\n className?: string;\n props?: TProps;\n /** Target array key (required when outside array, optional inside) */\n arrayKey?: string;\n /**\n * Template defining the field structure for new items. REQUIRED.\n * - Single field (ArrayAllowedChildren): Creates a primitive item (field's value is extracted directly)\n * - Array of fields (ArrayAllowedChildren[]): Creates an object item (fields merged into object)\n */\n template: ArrayAllowedChildren | readonly ArrayAllowedChildren[];\n /** Optional custom eventArgs */\n eventArgs?: readonly EventArg[];\n /** Logic rules for dynamic hidden/disabled state (only hidden and disabled are supported) */\n logic?: NonFieldLogicConfig[];\n}\n\n/**\n * Base interface for array remove button fields (remove, pop, shift).\n * No template needed - removes existing items.\n */\nexport interface BaseArrayRemoveButtonField<TProps = unknown> {\n key: string;\n type: string;\n label?: string;\n disabled?: boolean;\n hidden?: boolean;\n className?: string;\n props?: TProps;\n /** Target array key (required when outside array, optional inside) */\n arrayKey?: string;\n /** Optional custom eventArgs */\n eventArgs?: readonly EventArg[];\n /** Logic rules for dynamic hidden/disabled state (only hidden and disabled are supported) */\n logic?: NonFieldLogicConfig[];\n}\n\n/**\n * Interface for insert array item button fields.\n * Extends add button with required index.\n */\nexport interface BaseInsertArrayItemButtonField<TProps = unknown> extends BaseArrayAddButtonField<TProps> {\n /** The index at which to insert the new item */\n index: number;\n}\n\n// =============================================================================\n// Add Array Item Mappers\n// =============================================================================\n\n/**\n * Mapper for add array item button — appends new item to end of array.\n * Template is REQUIRED to define the field structure for new items.\n */\nexport function addArrayItemButtonMapper<TProps>(fieldDef: BaseArrayAddButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'addArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: AppendArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/**\n * Mapper for prepend array item button — inserts new item at beginning of array.\n * Template is REQUIRED to define the field structure for new items.\n */\nexport function prependArrayItemButtonMapper<TProps>(fieldDef: BaseArrayAddButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'prependArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: PrependArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/**\n * Mapper for insert array item button — inserts new item at specific index.\n * Template and index are REQUIRED.\n */\nexport function insertArrayItemButtonMapper<TProps>(fieldDef: BaseInsertArrayItemButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'insertArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: InsertArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey', fieldDef.index, '$template']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx, fieldDef.template),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n// =============================================================================\n// Remove Array Item Mappers\n// =============================================================================\n\n/**\n * Mapper for remove array item button.\n * Inside array: RemoveAtIndexEvent. Outside array: PopArrayItemEvent.\n */\nexport function removeArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'removeArrayItem', fieldDef.arrayKey);\n\n // Choose event type based on context:\n // - Inside array: RemoveAtIndexEvent (remove specific item)\n // - Outside array: PopArrayItemEvent (remove last item)\n const eventType = ctx.isInsideArray ? RemoveAtIndexEvent : PopArrayItemEvent;\n const defaultEventArgs = ctx.isInsideArray ? ['$arrayKey', '$index'] : ['$arrayKey'];\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: eventType,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, defaultEventArgs),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/** Mapper for pop array item button — removes the last item from array. */\nexport function popArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'popArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: PopArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n\n/** Mapper for shift array item button — removes the first item from array. */\nexport function shiftArrayItemButtonMapper<TProps>(fieldDef: BaseArrayRemoveButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n const ctx = resolveArrayButtonContext(fieldDef.key, 'shiftArrayItem', fieldDef.arrayKey);\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps?.());\n\n return {\n ...baseInputs,\n event: ShiftArrayItemEvent,\n eventArgs: resolveArrayButtonEventArgs(fieldDef.eventArgs, ['$arrayKey']),\n eventContext: buildArrayButtonEventContext(fieldDef.key, ctx),\n ...applyNonFieldLogic(rootFormRegistry, fieldDef),\n };\n });\n}\n","import { computed, inject, Signal } from '@angular/core';\nimport {\n buildBaseInputs,\n DEFAULT_PROPS,\n FieldDef,\n FieldWithValidation,\n FIELD_SIGNAL_CONTEXT,\n FORM_OPTIONS,\n NextPageEvent,\n PreviousPageEvent,\n resolveNextButtonDisabled,\n resolveSubmitButtonDisabled,\n RootFormRegistryService,\n} from '@ng-forge/dynamic-forms';\nimport { ButtonField } from '../../definitions';\nimport { resolveHiddenValue } from './non-field-logic.utils';\n\n// =============================================================================\n// Base Interfaces\n// =============================================================================\n\n/**\n * Base interface for navigation button fields (submit, next, previous).\n */\nexport type BaseNavigationButtonField<TProps = unknown> = ButtonField<TProps, SubmitEvent | NextPageEvent | PreviousPageEvent> & {\n type: string;\n /** Logic rules for dynamic disabled state */\n logic?: FieldWithValidation['logic'];\n};\n\n// =============================================================================\n// Submit Button Mapper\n// =============================================================================\n\n/**\n * Mapper for submit button — configures native form submission via type=\"submit\".\n * Triggers native form submission rather than dispatching events directly.\n */\nexport function submitButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const rootFormRegistry = inject(RootFormRegistryService);\n const defaultProps = inject(DEFAULT_PROPS);\n const formOptions = inject(FORM_OPTIONS);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm()!;\n\n // Use rootForm (not fieldSignalContext.form) — submit needs root form validity (#157)\n const disabled = resolveSubmitButtonDisabled({\n form: rootForm,\n formOptions: formOptions(),\n fieldLogic: fieldWithLogic.logic,\n explicitlyDisabled: fieldDef.disabled,\n })();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n // type=\"submit\" triggers native form submission (no event dispatch needed)\n props: { ...(fieldDef.props as Record<string, unknown>), type: 'submit' },\n disabled,\n };\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n\n// =============================================================================\n// Next Page Button Mapper\n// =============================================================================\n\n/** Mapper for next page button — preconfigures NextPageEvent. */\nexport function nextButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const fieldSignalContext = inject(FIELD_SIGNAL_CONTEXT);\n const rootFormRegistry = inject(RootFormRegistryService);\n const defaultProps = inject(DEFAULT_PROPS);\n const formOptions = inject(FORM_OPTIONS);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm();\n\n const disabled = resolveNextButtonDisabled({\n form: fieldSignalContext.form,\n formOptions: formOptions(),\n fieldLogic: fieldWithLogic.logic,\n currentPageValid: fieldSignalContext.currentPageValid,\n })();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n event: NextPageEvent,\n disabled,\n };\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n\n// =============================================================================\n// Previous Page Button Mapper\n// =============================================================================\n\n/** Mapper for previous page button — preconfigures PreviousPageEvent. */\nexport function previousButtonFieldMapper<TProps>(fieldDef: BaseNavigationButtonField<TProps>): Signal<Record<string, unknown>> {\n const defaultProps = inject(DEFAULT_PROPS);\n const rootFormRegistry = inject(RootFormRegistryService);\n\n const fieldWithLogic = fieldDef as FieldDef<Record<string, unknown>> & Partial<FieldWithValidation>;\n\n return computed(() => {\n const baseInputs = buildBaseInputs(fieldDef, defaultProps());\n const rootForm = rootFormRegistry.rootForm();\n\n const inputs: Record<string, unknown> = {\n ...baseInputs,\n event: PreviousPageEvent,\n };\n\n // Add disabled binding only if explicitly set by user\n if (fieldDef.disabled !== undefined) {\n inputs['disabled'] = fieldDef.disabled;\n }\n\n const hidden = resolveHiddenValue(rootForm, fieldWithLogic);\n if (hidden !== undefined) {\n inputs['hidden'] = hidden;\n }\n\n return inputs;\n });\n}\n","// Button field mapper (generic)\nexport { buttonFieldMapper } from './button-field-mapper';\n\n// Array button utilities\nexport { resolveArrayButtonContext, buildArrayButtonEventContext, resolveArrayButtonEventArgs } from './array-button.utils';\nexport type { ArrayButtonContext, ArrayButtonEventContext, EventArg } from './array-button.utils';\n\n// Non-field logic utilities (for hidden/disabled state on non-form-bound elements)\nexport { applyNonFieldLogic, resolveHiddenValue } from './non-field-logic.utils';\nexport type { FieldDefWithLogic, NonFieldLogicResult } from './non-field-logic.utils';\n\n// Array button mappers\nexport {\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n} from './array-button.mapper';\nexport type { BaseArrayAddButtonField, BaseArrayRemoveButtonField, BaseInsertArrayItemButtonField } from './array-button.mapper';\n\n// Navigation button mappers\nexport { submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper } from './navigation-button.mapper';\nexport type { BaseNavigationButtonField } from './navigation-button.mapper';\n","// UI-specific field mappers\nexport { valueFieldMapper, buildValueFieldInputs, resolveValueFieldContext } from './value/value-field.mapper';\nexport type { ValueFieldContext } from './value/value-field.mapper';\nexport { checkboxFieldMapper } from './checkbox/checkbox-field-mapper';\nexport { datepickerFieldMapper } from './datepicker/datepicker-field-mapper';\nexport { optionsFieldMapper } from './select/options-field-mapper';\nexport type { FieldWithOptions } from './select/options-field-mapper';\nexport { sliderFieldMapper } from './slider/slider-field-mapper';\n\n// Button field mappers\nexport {\n buttonFieldMapper,\n // Array button utilities\n resolveArrayButtonContext,\n buildArrayButtonEventContext,\n resolveArrayButtonEventArgs,\n // Array button mappers\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n // Navigation button mappers\n submitButtonFieldMapper,\n nextButtonFieldMapper,\n previousButtonFieldMapper,\n} from './button';\nexport type {\n ArrayButtonContext,\n ArrayButtonEventContext,\n BaseArrayAddButtonField,\n BaseArrayRemoveButtonField,\n BaseInsertArrayItemButtonField,\n BaseNavigationButtonField,\n EventArg,\n} from './button';\n","import { computed, inject, Injector, signal, Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { FieldTree, ValidationError } from '@angular/forms/signals';\nimport { combineLatest, Observable, of } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { ValidationMessages } from '@ng-forge/dynamic-forms';\nimport { dynamicTextToObservable } from '@ng-forge/dynamic-forms';\nimport { interpolateParams } from '@ng-forge/dynamic-forms';\nimport { DynamicFormLogger } from '@ng-forge/dynamic-forms';\nimport type { Logger } from '@ng-forge/dynamic-forms';\n\n/**\n * Resolved validation error with interpolated message\n */\nexport interface ResolvedError {\n kind: string;\n message: string;\n}\n\n/**\n * Factory function that creates a signal of resolved validation errors\n * Handles async resolution of DynamicText validation messages\n *\n * @param field - Signal containing FieldTree\n * @param validationMessages - Signal containing custom field-level validation messages\n * @param defaultValidationMessages - Signal containing default validation messages (fallback)\n * @param injector - Optional injector for DynamicText resolution\n * @returns Signal<ResolvedError[]> - Reactively resolved error messages\n *\n * @example\n * ```typescript\n * readonly resolvedErrors = createResolvedErrorsSignal(\n * this.field,\n * this.validationMessages,\n * this.defaultValidationMessages\n * );\n * ```\n */\nexport function createResolvedErrorsSignal<T>(\n field: Signal<FieldTree<T>>,\n validationMessages: Signal<ValidationMessages | undefined>,\n defaultValidationMessages: Signal<ValidationMessages | undefined> = signal(undefined),\n injector = inject(Injector),\n): Signal<ResolvedError[]> {\n // Get logger from injector\n const logger = injector.get(DynamicFormLogger);\n\n // Ensure validationMessages is never undefined (mappers pass {} if not defined)\n const messages = computed(() => validationMessages() ?? {});\n const defaultMessages = computed(() => defaultValidationMessages() ?? {});\n\n // Create a computed signal that reads the actual errors from the field\n // This ensures the signal tracks changes to field().errors(), not just the field reference\n const errors = computed(() => {\n const control = field()();\n return control.errors();\n });\n\n // Convert signals to observables using toObservable with injector\n const errors$ = toObservable(errors, { injector });\n const messages$ = toObservable(messages, { injector });\n const defaultMessages$ = toObservable(defaultMessages, { injector });\n\n // Combine observables and process errors\n const resolvedErrors$ = combineLatest([errors$, messages$, defaultMessages$]).pipe(\n switchMap(([currentErrors, msgs, defaultMsgs]) => {\n // No errors - return empty array\n if (!currentErrors || currentErrors.length === 0) {\n return of([]);\n }\n\n // Create observable for each error's resolved message\n const errorResolvers = currentErrors.map((error: ValidationError) => resolveErrorMessage(error, msgs, defaultMsgs, injector, logger));\n\n // Combine all error message observables into single array emission, filtering out nulls\n return errorResolvers.length > 0\n ? combineLatest(errorResolvers).pipe(map((errors) => errors.filter((e): e is ResolvedError => e !== null)))\n : of([]);\n }),\n );\n\n // Convert observable back to signal using toSignal with injector\n // toSignal properly handles the injection context and manages subscriptions\n return toSignal(resolvedErrors$, { initialValue: [] as ResolvedError[], injector });\n}\n\n/**\n * Resolves a single error message from DynamicText sources with fallback logic\n * Priority: field-level message → default message → error.message → no message (logs warning)\n *\n * The error.message fallback enables schema validation libraries (Zod, Valibot, etc.)\n * to provide their own messages without requiring explicit validationMessages configuration.\n * Users who want translations can still override by configuring validationMessages.\n *\n * @internal\n */\nfunction resolveErrorMessage(\n error: ValidationError,\n fieldMessages: ValidationMessages,\n defaultMessages: ValidationMessages,\n injector: Injector,\n logger: Logger,\n): Observable<ResolvedError | null> {\n // Check for field-level custom message first\n const fieldMessage = fieldMessages[error.kind];\n\n // Fall back to default message if no field-level message exists\n const defaultMessage = defaultMessages[error.kind];\n\n // Determine which message to use: field-level → default → error.message (from schema validators)\n const messageToUse = fieldMessage ?? defaultMessage ?? error.message;\n\n // If no message found, log warning and return null (will be filtered out)\n if (!messageToUse) {\n logger.warn(\n `No validation message found for error kind \"${error.kind}\". ` +\n `Please provide a message via field-level validationMessages or form-level defaultValidationMessages.`,\n );\n return of(null);\n }\n\n // If using error.message directly (from schema validators), wrap in of() instead of dynamicTextToObservable\n // error.message is always a plain string, not DynamicText\n const isSchemaMessage = fieldMessage === undefined && defaultMessage === undefined;\n const messageObservable = isSchemaMessage\n ? of(messageToUse as string) // error.message is always string\n : dynamicTextToObservable(messageToUse, injector);\n\n // Apply parameter interpolation to support {{param}} syntax\n return messageObservable.pipe(\n map((msg) => ({\n kind: error.kind,\n message: interpolateParams(msg, error),\n })),\n );\n}\n","import { Signal, computed } from '@angular/core';\nimport { FieldTree } from '@angular/forms/signals';\n\n/**\n * Computed signal that determines if errors should be displayed.\n * Based on field's invalid, touched, and error count.\n *\n * @param field - Signal containing FieldTree\n * @returns Signal<boolean> - True if errors should be displayed\n */\nexport function shouldShowErrors<T>(field: Signal<FieldTree<T>>): Signal<boolean> {\n return computed(() => {\n const fieldTree = field();\n const control = fieldTree();\n\n return control.invalid() && control.touched() && control.errors().length > 0;\n });\n}\n","import { afterRenderEffect, ElementRef, Signal } from '@angular/core';\nimport { applyMetaToElement, FieldMeta, isEqual } from '@ng-forge/dynamic-forms';\n\n/**\n * Configuration options for setupMetaTracking.\n */\nexport interface MetaTrackingOptions {\n /**\n * CSS selector for target elements within the host.\n * If not provided, meta attributes are applied directly to the host element.\n *\n * @example\n * // Apply to internal radio inputs\n * selector: 'input[type=\"radio\"]'\n *\n * // Apply to host element (for Shadow DOM components)\n * selector: undefined\n */\n selector?: string;\n\n /**\n * Additional signals to track that should trigger re-application of meta.\n * Useful for components where DOM elements are dynamically created (e.g., radio options).\n *\n * @example\n * // Re-apply when options change\n * dependents: [this.options]\n */\n dependents?: Signal<unknown>[];\n}\n\n/**\n * Sets up automatic meta attribute tracking and application for wrapped components.\n *\n * This utility creates an `afterRenderEffect` that applies meta attributes to DOM elements\n * after Angular's render cycle. It efficiently tracks signal dependencies and only re-applies\n * when the meta signal or any dependent signals change.\n *\n * Use this instead of MutationObserver for better performance and integration with Angular's\n * change detection.\n *\n * @param elementRef - Reference to the host element\n * @param meta - Signal containing meta attributes to apply\n * @param options - Configuration options\n *\n * @example\n * ```typescript\n * // For a radio group with dynamic options\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta, {\n * selector: 'input[type=\"radio\"]',\n * dependents: [this.options]\n * });\n * }\n *\n * // For a simple checkbox\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta, {\n * selector: 'input[type=\"checkbox\"]'\n * });\n * }\n *\n * // For Shadow DOM components (apply to host)\n * constructor() {\n * setupMetaTracking(inject(ElementRef), this.meta);\n * }\n * ```\n */\nexport function setupMetaTracking(\n elementRef: ElementRef<HTMLElement>,\n meta: Signal<FieldMeta | undefined>,\n options?: MetaTrackingOptions,\n): void {\n let appliedAttributes = new Set<string>();\n let previousMeta: FieldMeta | undefined;\n let previousDeps: unknown[] | undefined;\n\n afterRenderEffect({\n write: () => {\n // Read dependents to establish signal tracking and collect their values\n const currentDeps = options?.dependents?.map((dep) => dep());\n\n const currentMeta = meta();\n const hostElement = elementRef.nativeElement;\n\n // Early exit if nothing changed (using deep equality for meta)\n const metaChanged = !isEqual(currentMeta, previousMeta);\n const depsChanged =\n !previousDeps || currentDeps?.length !== previousDeps.length || currentDeps?.some((d, i) => d !== previousDeps![i]);\n\n if (!metaChanged && !depsChanged) {\n return;\n }\n\n previousMeta = currentMeta;\n previousDeps = currentDeps;\n\n if (options?.selector) {\n // Apply to elements matching selector\n const elements = hostElement.querySelectorAll(options.selector);\n const allApplied = new Set<string>();\n\n elements.forEach((el) => {\n const applied = applyMetaToElement(el, currentMeta, appliedAttributes);\n applied.forEach((attr) => allApplied.add(attr));\n });\n\n appliedAttributes = allApplied;\n } else {\n // Apply to host element (for Shadow DOM components)\n appliedAttributes = applyMetaToElement(hostElement, currentMeta, appliedAttributes);\n }\n },\n });\n}\n","// Error display utilities for field components\nexport { createResolvedErrorsSignal } from './create-resolved-errors-signal';\nexport type { ResolvedError } from './create-resolved-errors-signal';\nexport { shouldShowErrors } from './should-show-errors';\n\n// Value comparison utilities - re-exported from main library\nexport { isEqual } from '@ng-forge/dynamic-forms';\n\n// Meta tracking utilities\nexport { setupMetaTracking } from './setup-meta-tracking';\nexport type { MetaTrackingOptions } from './setup-meta-tracking';\n","/**\n * @ng-forge/dynamic-forms/integration\n *\n * Integration API for UI library authors building field implementations\n * (Material, Bootstrap, PrimeNG, Ionic, etc.)\n *\n * This entrypoint provides:\n * - Specific field type definitions (InputField, SelectField, etc.)\n * - Field mappers for creating FieldTypeDefinition\n * - Error display utilities for field components\n */\n\n// =============================================================================\n// Field Type Definitions\n// =============================================================================\n\nexport type {\n ButtonField,\n EventArgs,\n CheckboxField,\n DatepickerField,\n DatepickerProps,\n InputField,\n InputProps,\n InputType,\n InputTypeToValueType,\n InferInputValue,\n NumericInputType,\n StringInputType,\n HtmlInputType,\n InputMeta,\n AutocompleteValue,\n InputMode,\n EnterKeyHint,\n Autocapitalize,\n MultiCheckboxField,\n RadioField,\n SelectField,\n SelectProps,\n SliderField,\n TextareaField,\n TextareaProps,\n TextareaMeta,\n TextareaWrap,\n ToggleField,\n} from './definitions';\n\n// =============================================================================\n// Field Mappers\n// =============================================================================\n\nexport {\n valueFieldMapper,\n buildValueFieldInputs,\n resolveValueFieldContext,\n checkboxFieldMapper,\n datepickerFieldMapper,\n optionsFieldMapper,\n // Button mappers\n buttonFieldMapper,\n // Array button utilities\n resolveArrayButtonContext,\n buildArrayButtonEventContext,\n resolveArrayButtonEventArgs,\n // Array button mappers\n addArrayItemButtonMapper,\n prependArrayItemButtonMapper,\n insertArrayItemButtonMapper,\n removeArrayItemButtonMapper,\n popArrayItemButtonMapper,\n shiftArrayItemButtonMapper,\n // Navigation button mappers\n submitButtonFieldMapper,\n nextButtonFieldMapper,\n previousButtonFieldMapper,\n} from './mappers';\n\nexport type {\n ValueFieldContext,\n FieldWithOptions,\n ArrayButtonContext,\n ArrayButtonEventContext,\n BaseArrayAddButtonField,\n BaseArrayRemoveButtonField,\n BaseInsertArrayItemButtonField,\n BaseNavigationButtonField,\n EventArg,\n} from './mappers';\n\n// =============================================================================\n// Error Display Utilities\n// =============================================================================\n\nexport { createResolvedErrorsSignal, shouldShowErrors } from './utils';\nexport type { ResolvedError } from './utils';\n\n// =============================================================================\n// Value Comparison Utilities\n// =============================================================================\n\nexport { isEqual } from './utils';\n\n// =============================================================================\n// Meta Tracking Utilities\n// =============================================================================\n\nexport { setupMetaTracking } from './utils';\nexport type { MetaTrackingOptions } from './utils';\n\n// =============================================================================\n// Non-Field Logic Resolvers (re-exported from @ng-forge/dynamic-forms)\n// =============================================================================\n\nexport { resolveNonFieldHidden, resolveNonFieldDisabled } from '@ng-forge/dynamic-forms';\nexport type { NonFieldLogicContext, NonFieldLogicType, NonFieldLogicConfig } from '@ng-forge/dynamic-forms';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],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,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,YAAa,CAAC,CAAC,CAAC,CAAC;AAErH,YAAA,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,EAAE;gBAChC;YACF;YAEA,YAAY,GAAG,WAAW;YAC1B,YAAY,GAAG,WAAW;AAE1B,YAAA,IAAI,OAAO,EAAE,QAAQ,EAAE;;gBAErB,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC/D,gBAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU;AAEpC,gBAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,KAAI;oBACtB,MAAM,OAAO,GAAG,kBAAkB,CAAC,EAAE,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACtE,oBAAA,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjD,gBAAA,CAAC,CAAC;gBAEF,iBAAiB,GAAG,UAAU;YAChC;iBAAO;;gBAEL,iBAAiB,GAAG,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,iBAAiB,CAAC;YACrF;QACF,CAAC;AACF,KAAA,CAAC;AACJ;;AClHA;;ACAA;;;;;;;;;;AAUG;AAqCH;AACA;AACA;;ACjDA;;AAEG;;;;"}
@@ -4141,9 +4141,9 @@ class PageOrchestratorComponent {
4141
4141
  }
4142
4142
  }
4143
4143
  }
4144
- `, isInline: true, styles: [":host{display:block;position:relative;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [import('./ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs').then(m => m.default)], () => [import('./ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs').then(m => m.default)]] });
4144
+ `, isInline: true, styles: [":host{display:block;position:relative;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [import('./ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs').then(m => m.default)], () => [import('./ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs').then(m => m.default)]] });
4145
4145
  }
4146
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: PageOrchestratorComponent, resolveDeferredDeps: () => [import('./ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs').then(m => m.default)], resolveMetadata: PageFieldComponent => ({ decorators: [{
4146
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: PageOrchestratorComponent, resolveDeferredDeps: () => [import('./ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs').then(m => m.default)], resolveMetadata: PageFieldComponent => ({ decorators: [{
4147
4147
  type: Component,
4148
4148
  args: [{ selector: 'div[page-orchestrator]', imports: [PageFieldComponent], template: `
4149
4149
  @for (pageField of pageFields(); track pageField.key; let i = $index) {
@@ -10537,6 +10537,44 @@ function computeValueFromEntry(entry, evalContext, options) {
10537
10537
  throw new DynamicFormError(`Derivation for ${options.subject} has no value source. Specify 'value', 'expression', or 'functionName'.`);
10538
10538
  }
10539
10539
 
10540
+ /**
10541
+ * Returns the path to the parent of the given field path. Drops the last
10542
+ * `.`-delimited segment. Returns `undefined` when the field has no parent
10543
+ * in scope (single-segment root key).
10544
+ *
10545
+ * - `'address.state'` → `'address'`
10546
+ * - `'org.address.state'` → `'org.address'`
10547
+ * - `'state'` → `undefined`
10548
+ *
10549
+ * Used by the non-array evaluation context to populate `groupValue` from
10550
+ * the field's parent group on `formValue`.
10551
+ *
10552
+ * @internal
10553
+ */
10554
+ function getParentPathInScope(fieldKey) {
10555
+ const lastDot = fieldKey.lastIndexOf('.');
10556
+ if (lastDot <= 0)
10557
+ return undefined;
10558
+ return fieldKey.slice(0, lastDot);
10559
+ }
10560
+ /**
10561
+ * Resolves the per-array-item scope shared by both derivation applicators.
10562
+ *
10563
+ * Both `derivation-applicator.ts` and `property-derivation-applicator.ts`
10564
+ * need the same fan-out from `(pathInfo, arrayItem)` to `fieldValue`,
10565
+ * `groupValue`, and `relativePath` when building an evaluation context for
10566
+ * an array item. Centralising here keeps the two pipelines from drifting.
10567
+ *
10568
+ * @internal
10569
+ */
10570
+ function resolveArrayItemScope(pathInfo, arrayItem) {
10571
+ const relativePath = pathInfo.isArrayPath ? pathInfo.relativePath : '';
10572
+ const innerParentPath = relativePath.includes('.') ? relativePath.slice(0, relativePath.lastIndexOf('.')) : '';
10573
+ const groupValue = innerParentPath ? getNestedValue(arrayItem, innerParentPath) : arrayItem;
10574
+ const fieldValue = relativePath ? getNestedValue(arrayItem, relativePath) : arrayItem;
10575
+ return { relativePath, groupValue, fieldValue };
10576
+ }
10577
+
10540
10578
  /**
10541
10579
  * Centralized constants for the derivation system.
10542
10580
  *
@@ -11122,25 +11160,6 @@ function createEvaluationContext$1(entry, formValue, context, chainContext) {
11122
11160
  formFieldState: chainContext.formFieldState,
11123
11161
  };
11124
11162
  }
11125
- /**
11126
- * Returns the path to the parent of the given field path, expressed in the
11127
- * scope appropriate for the entry. Drops the last `.`-delimited segment.
11128
- * Returns `undefined` when the field has no parent in scope (e.g., a
11129
- * single-segment root key, or `'items.$.x'` inside the array-item scope
11130
- * where `x` is a direct child of the item).
11131
- *
11132
- * For non-array entries: `'address.state'` → `'address'`, `'state'` → undefined.
11133
- * For array entries inside `createEvaluationContext` (root scope): unused —
11134
- * `createArrayItemEvaluationContext` handles the array-scope case.
11135
- *
11136
- * @internal
11137
- */
11138
- function getParentPathInScope(fieldKey) {
11139
- const lastDot = fieldKey.lastIndexOf('.');
11140
- if (lastDot <= 0)
11141
- return undefined;
11142
- return fieldKey.slice(0, lastDot);
11143
- }
11144
11163
  /**
11145
11164
  * Creates an evaluation context scoped to a specific array item.
11146
11165
  *
@@ -11172,18 +11191,7 @@ function createArrayItemEvaluationContext$1(entry, arrayItem, rootFormValue, ite
11172
11191
  }
11173
11192
  }
11174
11193
  }
11175
- // groupValue inside an array item:
11176
- // - Field directly under the array item (no inner group): the array item
11177
- // itself is the "nearest parent group".
11178
- // - Field inside an inner group within the item: the inner group's value.
11179
- // The relative path within the item is everything after `'.$.'`.
11180
- const relativePath = pathInfo.isArrayPath ? (pathInfo.relativePath ?? '') : '';
11181
- const innerParentPath = relativePath.includes('.') ? relativePath.slice(0, relativePath.lastIndexOf('.')) : '';
11182
- const groupValue = innerParentPath ? getNestedValue(arrayItem, innerParentPath) : arrayItem;
11183
- // Resolve fieldValue to the leaf value addressed by the entry's relative path
11184
- // within the array item. Without this, $self / fieldValue derivations inside
11185
- // arrays receive the whole array item instead of the field's own value.
11186
- const fieldValue = relativePath ? getNestedValue(arrayItem, relativePath) : arrayItem;
11194
+ const { relativePath, groupValue, fieldValue } = resolveArrayItemScope(pathInfo, arrayItem);
11187
11195
  return {
11188
11196
  fieldValue,
11189
11197
  formValue: arrayItem,
@@ -13366,14 +13374,26 @@ function tryApplyArrayPropertyDerivation(entry, context) {
13366
13374
  /**
13367
13375
  * Creates an evaluation context for property derivation processing.
13368
13376
  *
13377
+ * Note: `fieldState`/`formFieldState` are intentionally not populated here.
13378
+ * Property derivations run against the form value signal and write to a
13379
+ * separate override store; the applicator does not have access to the live
13380
+ * `FieldTree` (no `rootForm` on `PropertyDerivationApplicatorContext`), so
13381
+ * field-state snapshots cannot be read in this pipeline. Functions that need
13382
+ * field state (e.g. `dirty()`, `touched()`) must use a regular derivation.
13383
+ *
13369
13384
  * @internal
13370
13385
  */
13371
13386
  function createEvaluationContext(entry, formValue, context) {
13372
13387
  const fieldValue = getNestedValue(formValue, entry.fieldKey);
13388
+ // Parent group value: the absolute path with the trailing field segment
13389
+ // dropped. `undefined` when the field is at form root.
13390
+ const parentPath = getParentPathInScope(entry.fieldKey);
13391
+ const groupValue = parentPath ? getNestedValue(formValue, parentPath) : undefined;
13373
13392
  return {
13374
13393
  fieldValue,
13375
13394
  formValue,
13376
13395
  fieldPath: entry.fieldKey,
13396
+ groupValue,
13377
13397
  customFunctions: context.customFunctions,
13378
13398
  externalData: context.externalData,
13379
13399
  logger: context.logger,
@@ -13385,10 +13405,13 @@ function createEvaluationContext(entry, formValue, context) {
13385
13405
  * @internal
13386
13406
  */
13387
13407
  function createArrayItemEvaluationContext(entry, arrayItem, rootFormValue, itemIndex, arrayPath, context) {
13408
+ const pathInfo = parseArrayPath(entry.fieldKey);
13409
+ const { relativePath, groupValue, fieldValue } = resolveArrayItemScope(pathInfo, arrayItem);
13388
13410
  return {
13389
- fieldValue: arrayItem,
13411
+ fieldValue,
13390
13412
  formValue: arrayItem,
13391
- fieldPath: `${arrayPath}.${itemIndex}`,
13413
+ fieldPath: relativePath ? `${arrayPath}.${itemIndex}.${relativePath}` : `${arrayPath}.${itemIndex}`,
13414
+ groupValue,
13392
13415
  customFunctions: context.customFunctions,
13393
13416
  externalData: context.externalData,
13394
13417
  logger: context.logger,
@@ -14735,31 +14758,31 @@ const BUILT_IN_FIELDS = [
14735
14758
  // `row` is a virtual field type: it maps to ContainerFieldComponent, and
14736
14759
  // the rowFieldMapper injects a `{ type: 'row' }` wrapper so the container
14737
14760
  // renders the flex/grid layout via RowWrapperComponent.
14738
- loadComponent: () => import('./ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs'),
14761
+ loadComponent: () => import('./ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs'),
14739
14762
  mapper: rowFieldMapper,
14740
14763
  valueHandling: 'flatten',
14741
14764
  },
14742
14765
  {
14743
14766
  name: 'group',
14744
- loadComponent: () => import('./ng-forge-dynamic-forms-group-field.component-clrQsUyY.mjs'),
14767
+ loadComponent: () => import('./ng-forge-dynamic-forms-group-field.component-2yRmHAUp.mjs'),
14745
14768
  mapper: groupFieldMapper,
14746
14769
  valueHandling: 'include',
14747
14770
  },
14748
14771
  {
14749
14772
  name: 'array',
14750
- loadComponent: () => import('./ng-forge-dynamic-forms-array-field.component-DWhbvZUO.mjs'),
14773
+ loadComponent: () => import('./ng-forge-dynamic-forms-array-field.component-CWxCWVdz.mjs'),
14751
14774
  mapper: arrayFieldMapper,
14752
14775
  valueHandling: 'include',
14753
14776
  },
14754
14777
  {
14755
14778
  name: 'page',
14756
- loadComponent: () => import('./ng-forge-dynamic-forms-page-field.component-XtyjFlJi.mjs'),
14779
+ loadComponent: () => import('./ng-forge-dynamic-forms-page-field.component-B_CxX0T-.mjs'),
14757
14780
  mapper: pageFieldMapper,
14758
14781
  valueHandling: 'flatten',
14759
14782
  },
14760
14783
  {
14761
14784
  name: 'text',
14762
- loadComponent: () => import('./ng-forge-dynamic-forms-text-field.component-CJsRWH2r.mjs'),
14785
+ loadComponent: () => import('./ng-forge-dynamic-forms-text-field.component-rJMtKX2X.mjs'),
14763
14786
  mapper: textFieldMapper,
14764
14787
  valueHandling: 'exclude',
14765
14788
  ...DISPLAY_FIELD_TYPES_BASE,
@@ -14771,7 +14794,7 @@ const BUILT_IN_FIELDS = [
14771
14794
  },
14772
14795
  {
14773
14796
  name: 'container',
14774
- loadComponent: () => import('./ng-forge-dynamic-forms-container-field.component-ByKgY4-b.mjs'),
14797
+ loadComponent: () => import('./ng-forge-dynamic-forms-container-field.component-PozYj2JC.mjs'),
14775
14798
  mapper: containerFieldMapper,
14776
14799
  valueHandling: 'flatten',
14777
14800
  },
@@ -14779,7 +14802,7 @@ const BUILT_IN_FIELDS = [
14779
14802
  const BUILT_IN_WRAPPERS = [
14780
14803
  {
14781
14804
  wrapperName: 'css',
14782
- loadComponent: () => import('./ng-forge-dynamic-forms-css-wrapper.component-ClFdxZV4.mjs'),
14805
+ loadComponent: () => import('./ng-forge-dynamic-forms-css-wrapper.component-DrtHSaVV.mjs'),
14783
14806
  },
14784
14807
  {
14785
14808
  wrapperName: 'row',
@@ -15812,4 +15835,4 @@ function extractErrorParams(error) {
15812
15835
  */
15813
15836
 
15814
15837
  export { SubmitEvent as $, ARRAY_CONTEXT as A, BUILT_IN_FIELDS as B, CONTAINER_FIELD_PROCESSORS as C, DynamicFormLogger as D, EventBus as E, FIELD_SIGNAL_CONTEXT as F, DEFAULT_VALIDATION_MESSAGES as G, DynamicForm as H, DynamicFormError as I, EventDispatcher as J, FIELD_REGISTRY as K, FORM_OPTIONS as L, FormClearEvent as M, FormResetEvent as N, INITIALIZATION_TIMEOUT_MS as O, InsertArrayItemEvent as P, MoveArrayItemEvent as Q, RootFormRegistryService as R, NextPageEvent as S, NoopLogger as T, PageChangeEvent as U, PopArrayItemEvent as V, WRAPPER_AUTO_ASSOCIATIONS as W, PrependArrayItemEvent as X, PreviousPageEvent as Y, RemoveAtIndexEvent as Z, ShiftArrayItemEvent as _, DEFAULT_WRAPPERS as a, WRAPPER_REGISTRY as a0, applyMetaToElement as a1, applyValidator as a2, applyValidators as a3, arrayEvent as a4, arrayFieldMapper as a5, baseFieldMapper as a6, buildBaseInputs as a7, containerFieldMapper as a8, createField as a9, resolveNextButtonDisabled as aA, resolveNonFieldDisabled as aB, resolveNonFieldHidden as aC, resolveSubmitButtonDisabled as aD, resolveTokens as aE, rowFieldMapper as aF, textFieldMapper as aG, toReadonlyFieldTree as aH, withEventFormValue as aI, withLoggerConfig as aJ, withPreviousValue as aK, withValueExclusionDefaults as aL, wrapperProps as aM, createWrappers as aa, evaluateNonFieldDisabled as ab, evaluateNonFieldHidden as ac, field as ad, formConfig as ae, getArrayLength as af, groupFieldMapper as ag, hasFormValue as ah, interpolateParams as ai, isArrayField as aj, isCheckedField as ak, isContainerField as al, isContainerTypedField as am, isDisplayOnlyField as an, isFormStateCondition as ao, isLeafField as ap, isPageField as aq, isRowField as ar, isSimplifiedArrayField as as, isValueBearingField as at, isValueField as au, isWrapperTypeDefinition as av, isWrappersBundle as aw, omit as ax, pageFieldMapper as ay, provideDynamicForm as az, isSameWrapperChain as b, createFieldResolutionPipe as c, derivedFromDeferred as d, createWrapperChainController as e, DfFieldOutlet as f, isEqual as g, createSchemaFromFields as h, injectFieldRegistry as i, createRenderReadySignal as j, ARRAY_TEMPLATE_REGISTRY as k, ARRAY_ITEM_ID_GENERATOR as l, mapFieldToInputs as m, getNormalizedArrayMetadata as n, getFieldValueHandling as o, getFieldDefaultValue as p, isGroupField as q, resolveWrappers as r, createArrayItemIdGenerator as s, ComponentInitializedEvent as t, DynamicTextPipe as u, validatePageNesting as v, dynamicTextToObservable as w, AppendArrayItemEvent as x, ConsoleLogger as y, DEFAULT_PROPS as z };
15815
- //# sourceMappingURL=ng-forge-dynamic-forms-ng-forge-dynamic-forms-Bw9Bt0Ev.mjs.map
15838
+ //# sourceMappingURL=ng-forge-dynamic-forms-ng-forge-dynamic-forms-Ll4W2Z_n.mjs.map