import * as _angular_core from '@angular/core'; import { Signal } from '@angular/core'; import * as forty_cdk_core from 'forty-cdk/core'; import { ForFieldContext, FieldControlHandle } from 'forty-cdk/core'; export { FOR_FIELD_CONTEXT, FieldControlHandle, ForFieldContext, injectFieldWiring } from 'forty-cdk/core'; import { ValidationError } from '@angular/forms/signals'; /** * Headless form-field container that wires accessible labelling, description, * and error association for a single control. It renders nothing and imposes no * layout: its only job is to connect a `[forLabel]`, `[forFieldDescription]`, * and `[forFieldError]` to the control via `id` / `aria-labelledby` / * `aria-describedby` / `aria-errormessage`, and to reflect the control's * validation state as `data-*` hooks for styling. * * Any forty-cdk form control (every `FormValueControl` / `FormCheckboxControl` * primitive) auto-associates when wrapped — no extra markup. A plain native * `` opts in with `[forFieldControl]`. * * Host reflects `data-invalid` / `data-disabled` / `data-required` / * `data-touched` from the registered control. * * @example * ```html *
* * *

We'll only email you about security.

* @if (settings.notify().invalid()) { *

{{ err.messages().join(', ') }}

* } *
* ``` */ declare class ForField implements ForFieldContext { #private; constructor(); /** * Id assigned to the control; a label's `for` points here. Adopts a * nominated control's own id (`labelledElementId`) when present so the label * and the primitive's internal `aria-labelledby` resolve to the same * focusable element; otherwise the field's owned/host-adopted id. */ readonly controlId: Signal; /** Id of the label element. */ readonly labelId: _angular_core.WritableSignal; /** Id of the description element. */ readonly descriptionId: _angular_core.WritableSignal; /** Id of the error element. */ readonly errorId: _angular_core.WritableSignal; /** * The currently registered control handle, or null. A `[forField]` targets a * single control; if several register, the last one wins and unregistering it * falls back to the previous still-mounted one (mirroring the counted label / * description / error slots). A duplicate emits a dev-mode warning. */ readonly control: Signal; /** Whether the registered control is currently invalid. */ readonly invalid: Signal; /** Whether the registered control is required. */ readonly required: Signal; /** * Whether the field is disabled: the registered control's own disabled state * OR'd with a surrounding `[forFieldset]`'s `disabled` (so a disabled group * reaches custom-role controls a native `
` can't). */ readonly disabled: Signal; /** Whether the registered control has been touched. */ readonly touched: Signal; /** Resolved `aria-labelledby` for the control (label id, or null). */ readonly labelledBy: Signal; /** * Resolved `aria-describedby`: the description id always, plus the error id * when the control is invalid. The error id is carried here as well as on * `aria-errormessage`, whose assistive-tech support is uneven. */ readonly describedBy: Signal; /** Resolved `aria-errormessage`: the error id when present and invalid, else null. */ readonly errorMessageId: Signal; /** * Register the control whose state the field reflects. The field targets a * single control — its `controlId` is one id, not an id list — so one control * per `[forField]` is the supported shape; group several controls under a * `[forFieldset]` instead. Registrations are tracked (mirroring the label / * description / error slots), so unmounting one of several accidental * duplicates never drops the association while another is still mounted; a * duplicate emits a dev-mode warning. */ registerControl(handle: FieldControlHandle): void; /** Remove a previously registered control. */ unregisterControl(handle: FieldControlHandle): void; /** * Register the label slot; returns an unregister callback. The field targets * a single label per slot — its `labelId` / `descriptionId` / `errorId` are * single ids, not id lists — so one `[forLabel]`, `[forFieldDescription]`, * and `[forFieldError]` per field is the supported shape. Registrations are * counted (mirroring `ForFieldset`'s legend counting), so unmounting one of * several accidental duplicates never drops the association while another is * still mounted; a duplicate emits a dev-mode warning. */ registerLabel(): () => void; /** Register the description slot; returns an unregister callback. See {@link registerLabel} for the counted single-instance-per-slot contract. */ registerDescription(): () => void; /** Register the error slot; returns an unregister callback. See {@link registerLabel} for the counted single-instance-per-slot contract. */ registerError(): () => void; /** * Forward a click to the control and move focus into it — matching the * activation a native `