import * as _angular_core from '@angular/core'; import { InjectionToken, Signal, Provider } from '@angular/core'; import { FormValueControl } from '@angular/forms/signals'; import * as forty_cdk_core from 'forty-cdk/core'; import { SegmentEditorContext, SegmentHandle, TimeSegmentType, FieldSegment, FormUiControlBase, TimeCapableDateAdapter, TimeGranularity, WritingDirection, RovingTabindex, SegmentEditorDelegate, ForDateTimeSegmentBase, ForDateTimeLiteralBase, DateRange } from 'forty-cdk/core'; import * as forty_cdk_time_field from 'forty-cdk/time-field'; /** * A rendered segment descriptor exposed by `ForTimeField.segments()` for the * consumer's `@for`. Covers both editable spinbutton segments (hour / minute / * second / dayPeriod) and the decorative literal separators between them. */ type TimeFieldSegment = FieldSegment; /** Handle a `[forTimeFieldSegment]` registers with the root for focus moves. */ type ForTimeFieldSegmentHandle = SegmentHandle; /** * The coordination surface `ForTimeField` exposes to its segment / literal * children. Segments read the reactive per-part accessors for their ARIA and * display bindings, and call the behavior methods to type, step, clear, and * move focus — all canonical state lives on the root, never on the segment. * * It is the shared {@link SegmentEditorContext} backing both date and time * fields; `ForTimeField` satisfies it by forwarding to its `SegmentEditor`. */ type ForTimeFieldContext = SegmentEditorContext; /** * Injection token for the {@link ForTimeFieldContext} provided by * `[forTimeField]`. Segment and literal children inject it to coordinate with * the root. */ declare const FOR_TIME_FIELD_CONTEXT: InjectionToken; /** * Headless, segmented, spin-editable time-of-day input — the time counterpart * to `ForDateField`. There is no single WAI-ARIA APG pattern for a time field; * it is a composition of * [Spinbuttons](https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/) inside a * labelled `role="group"`. * Each hour / minute / second / AM·PM part is an independent * `role="spinbutton"` segment (`[forTimeFieldSegment]`) so entry is unambiguous * and locale-correct. * * The root owns the entered parts, composes them into the adapter's date-time type, resolves the * locale-ordered segment list, and exposes everything to the segment and literal children through * {@link FOR_TIME_FIELD_CONTEXT}. The spin-button engine lives in the shared * {@link TimeFieldEngine}. All time math goes through the `DateAdapter`, which **must be * time-capable** — the day-only `provideInternationalizedDateAdapter()` throws. * * Implements `FormValueControl`, so it auto-wires with `[formField]` and auto-associates * inside a `[forField]`. The value stays `null` until every visible segment is filled. * * While no value is bound the composed value is anchored on a fixed, DST-stable sentinel date * rather than today, so a wall-clock time round-trips to the same instant. Binding an existing * date-time edits its time in place. * * Read-only and required states reflect as the boolean `data-readonly` / `data-required` hooks on * the root: `role="group"` supports neither ARIA property. The read-only announcement lives on each * `[forTimeFieldSegment]` instead, whose `role="spinbutton"` does support it; the required state is * Not repeated per segment. * * The bounds are named `minTime` / `maxTime` because `min` / `max` are reserved `FormUiControl` * members typed for numeric validators. Only their time-of-day component is considered. * * @typeParam D The adapter's immutable, time-capable date-time type. * * @example * ```html *
* @for (seg of field.segments(); track seg.id) { * @if (seg.isLiteral) { * {{ seg.text }} * } @else { * {{ seg.text }} * } * } *
* ``` */ declare class ForTimeField extends FormUiControlBase implements FormValueControl, ForTimeFieldContext { #private; /** * The active, time-capable date adapter, resolved from `FOR_DATE_ADAPTER` * (shared with `ForCalendar`). Throws when the provided adapter is day-only. */ readonly adapter: TimeCapableDateAdapter; /** * Two-way bindable entered time, or `null` while any visible segment is * empty. Required by `FormValueControl`. Emitted only on a settled * commit (segment completion / blur) — a mid-typing keystroke is never * observable through the value. The `model()` change emitter (`(valueChange)`) * fires only when the field itself composes a new value, never on consumer * writes via `[(value)]`. * * When no value is bound, the composed date-time anchors its date part on a * fixed, DST-stable sentinel date (`2000-01-01`) instead of today. This avoids * two `today()` hazards on adapters whose `D` carries a time zone (e.g. * `NativeDateAdapter`'s `Date`): a wall-clock time on a DST-transition day that * does not exist or is ambiguous would silently shift the emitted instant, and * a today-anchored value would leak the current date into a time-only control * (so a persisted value re-derives a different time next week). Consumers * reading the emitted value should treat only its time-of-day component as * meaningful while no date is bound. `CalendarDateTime` (no time zone) is * unaffected, but anchors on the same sentinel for consistency. */ readonly value: _angular_core.ModelSignal; /** * Earliest selectable time-of-day (inclusive). A composed value earlier in * the day is clamped up to it. Named `minTime` (not `min`) because * `FormUiControl.min` is reserved for a numeric validator. Only the * hour / minute / second component is considered. */ readonly minTime: _angular_core.InputSignal; /** * Latest selectable time-of-day (inclusive). A composed value later in the * day is clamped down to it. Named `maxTime` for the same reason as * {@link minTime}. */ readonly maxTime: _angular_core.InputSignal; /** * 12- or 24-hour cycle. When `null` (default) it is derived from the runtime * locale. A 12-hour cycle adds the AM/PM `dayPeriod` segment. */ readonly hourCycle: _angular_core.InputSignal<12 | 24 | null>; /** Smallest editable unit: `'hour'`, `'minute'` (default), or `'second'`. */ readonly granularity: _angular_core.InputSignal; /** BCP 47 locale driving segment order, separators, and AM/PM names. Defaults to the runtime locale. */ readonly locale: _angular_core.InputSignal; /** * Per-segment placeholder shown while empty. Unspecified parts fall back to * `hh` / `mm` / `ss` / `--`. */ readonly placeholder: _angular_core.InputSignal>>; /** Accessible name for the field group. Emits no `aria-label` while `null`. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: Signal; /** * Writing direction. When unset (default `null`), the inherited ambient * direction is resolved from the nearest ancestor carrying a `dir` attribute * (or ``), defaulting to `'ltr'`. An explicit `[dir]` always wins. * The resolved value is reflected to the host `dir` attribute and mirrors the * ArrowLeft / ArrowRight segment navigation in RTL. */ readonly _dirInput: _angular_core.InputSignal; readonly dir: Signal; /** Shared roving-tabindex tracker: exactly one segment owns `tabindex=0`. */ readonly roving: RovingTabindex; /** * The field engine backing the per-segment accessors and behavior methods the * segment / literal children read through {@link FOR_TIME_FIELD_CONTEXT}. */ readonly delegate: SegmentEditorDelegate; /** * The ordered, locale-derived segments (editable + literals) to render. Each * entry carries the text to display: the formatted value when filled, the * placeholder while empty, or the literal separator. */ readonly segments: Signal[]>; protected readonly empty: Signal; constructor(); /** * Move focus to the first editable segment, implementing * `FormValueControl.focus` from `@angular/forms/signals`. Without this override * Signal Forms would focus the host `role="group"` wrapper — which is not * focusable — so focus-on-error would silently go nowhere. No-op when disabled. */ focus(options?: FocusOptions): void; protected onFocusOut(event: FocusEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[forTimeField]", ["forTimeField"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "minTime": { "alias": "minTime"; "required": false; "isSignal": true; }; "maxTime": { "alias": "maxTime"; "required": false; "isSignal": true; }; "hourCycle": { "alias": "hourCycle"; "required": false; "isSignal": true; }; "granularity": { "alias": "granularity"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>; } /** * One editable spinbutton segment of a `[forTimeField]` — the hour, minute, * second, or AM/PM (`dayPeriod`) part. Apply on a focusable element (typically * a ``); the directive adds * `role="spinbutton"`, the `aria-valuemin` / `aria-valuemax` / `aria-valuenow` / * `aria-valuetext` reflection, the roving tabindex, and the full keyboard map: * * - **digits** fill a numeric segment and auto-advance to the next when full; * - **a / p** set the period on the `dayPeriod` segment; * - **ArrowUp / ArrowDown** step the value (hour / minute / second wrap; dayPeriod toggles); * - **ArrowLeft / ArrowRight** move between segments (mirrored under RTL, no wrap); * - **Home / End** jump to the segment minimum / maximum (dayPeriod → AM / PM); * - **Backspace** deletes the last entered digit of a numeric segment (clearing * it once the last digit is removed); **Delete** clears the whole segment. * * All state lives on the root `ForTimeField`; the segment only reads it and * forwards intents. The rendered text comes from the root's `segments()` list * (`{{ seg.text }}`), so this element carries behavior and ARIA, not content. */ declare class ForTimeFieldSegment extends ForDateTimeSegmentBase { #private; protected readonly ctx: forty_cdk_core.SegmentEditorContext; /** Which time part this segment edits. */ readonly segment: _angular_core.InputSignal; /** * Accessible name for this segment. Falls back to the scope's localized * default label for the part (via `provideForTimeFieldDefaults`), which in * turn defaults to the part name — and `'AM/PM'` for the `dayPeriod` segment. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * A decorative separator (`:`, a space) between the editable segments of a * `[forTimeField]`. Apply on the element rendering the literal text; it is * marked `aria-hidden` and stays out of the tab order, so assistive tech reads * only the spinbutton segments. The separator characters come from the root's * locale-ordered `segments()` list (`{{ seg.text }}`). */ declare class ForTimeFieldLiteral extends ForDateTimeLiteralBase { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Accessible name announced for each editable segment, keyed by its part type. * Override individually (or wholesale) for localization; any key left unset * falls back to the library default for that part — so overriding just * `dayPeriod` keeps the English labels for the rest. */ type ForTimeFieldSegmentLabels = Partial>; /** * Defaults inherited by descendant `[forTimeField]` controls in the * surrounding injector scope. Configure with `provideForTimeFieldDefaults` at * the application root or in any component's `providers`; partial overrides * merge with the parent scope. */ interface ForTimeFieldDefaults { /** * Accessible value announced (via `aria-valuetext`) for an empty editable * segment, so screen readers report the segment's empty state instead of * silence. Override for localization. */ emptySegmentText: string; /** * Accessible names announced for each editable segment (via `aria-label`), * keyed by part type, used when a segment has no explicit `ariaLabel`. The * AM/PM `dayPeriod` defaults to `'AM/PM'` instead of leaking the raw token. * Override for localization; unset keys keep the library default. */ segmentLabels: ForTimeFieldSegmentLabels; } /** * Library default accessible name for each editable segment. Used when neither * the segment's explicit `ariaLabel` nor a `provideForTimeFieldDefaults` * override supplies one for that part. */ declare const DEFAULT_TIME_FIELD_SEGMENT_LABELS: Readonly>; /** Token holding the resolved time-field defaults for the current scope. */ declare const FOR_TIME_FIELD_DEFAULTS: _angular_core.InjectionToken; /** * Configures forty-cdk time-field defaults for this injector scope. Partial * overrides inherit unspecified keys from the parent scope (or library * defaults at the root). */ declare function provideForTimeFieldDefaults(defaults?: Partial): Provider[]; /** * Exact public names of every `ForTimeField` input, its models included. Spread it into the * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the * primitive's full surface — the Signal Forms members `[formField]` binds among them — * without hand-maintaining the list. Always spread into an inline object literal as shown * below: the literal is what keeps the entry statically analyzable for consumers compiling * against the published package. An anti-drift spec fails when this list no longer matches * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported * wrapping patterns. * * @example * ```ts * @Component({ * selector: 'div[myTimeField]', * template: '', * hostDirectives: [ * { * directive: ForTimeField, * inputs: [...FOR_TIME_FIELD_HOST_DIRECTIVE_INPUTS], * outputs: [...FOR_TIME_FIELD_HOST_DIRECTIVE_OUTPUTS], * }, * ], * }) * export class MyTimeField {} * ``` */ declare const FOR_TIME_FIELD_HOST_DIRECTIVE_INPUTS: readonly ["value", "ariaLabel", "dir", "dirty", "disabled", "errors", "granularity", "hourCycle", "invalid", "locale", "maxTime", "minTime", "name", "pending", "placeholder", "readonly", "required", "touched"]; /** * Exact public names of every `ForTimeField` output, the Signal Forms `touch` output * included. Spread it into the `outputs` array of the same `hostDirectives` entry as * {@link FOR_TIME_FIELD_HOST_DIRECTIVE_INPUTS}. */ declare const FOR_TIME_FIELD_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "touchedChange", "touch"]; /** Which endpoint group of a time range field a piece coordinates with. */ type TimeRangeFieldEndpoint = 'start' | 'end'; /** * A rendered segment descriptor exposed by an endpoint's `segments()` for the * consumer's `@for`. Covers both editable spinbutton segments (hour / minute / * second / dayPeriod) and the decorative literal separators between them. */ type TimeRangeFieldSegment = FieldSegment; /** * Coordination surface `[forTimeRangeField]` (the root) exposes to its two * endpoint groups (`[forTimeRangeFieldStart]` / `[forTimeRangeFieldEnd]`). The * root owns the start / end time engines and the composed `DateRange` * value; each endpoint reads its rendered segments, its accessible group label, * and the {@link SegmentEditorContext} it provides to its own segment / literal * children. */ interface ForTimeRangeFieldContext { /** The field's effective disabled (own input OR a surrounding disabled `[forFieldset]`). */ readonly effectiveDisabled: Signal; /** Whether the field is read-only. */ readonly readonly: Signal; /** Resolved writing direction, reflected on each endpoint group. */ readonly dir: Signal; /** The rendered segment list for `which` endpoint. */ endpointSegments(which: TimeRangeFieldEndpoint): Signal[]>; /** The segment-coordination surface `which` endpoint provides to its segments. */ endpointContext(which: TimeRangeFieldEndpoint): SegmentEditorContext; /** The accessible `aria-label` for `which` endpoint group. */ endpointLabel(which: TimeRangeFieldEndpoint): Signal; } /** * Injection token for the {@link ForTimeRangeFieldContext} provided by * `[forTimeRangeField]`. Endpoint children inject it to coordinate with the * root. */ declare const FOR_TIME_RANGE_FIELD_CONTEXT: InjectionToken; /** * Headless, segmented, spin-editable time-of-day **range** input — the * keyboard-first, form-capable time analog of `ForDateRangeField`. There is no * single WAI-ARIA APG pattern for a range field; it is a composition of two * labelled `role="group"` endpoints, each holding a row of * [Spinbuttons](https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/) (the same * machinery as `ForTimeField`), nested inside one outer `role="group"`. * * The root owns one time engine per endpoint and assembles the committed `DateRange`, exposing the * rendered segments and the shared configuration to its `[forTimeRangeFieldStart]` / * `[forTimeRangeFieldEnd]` children through {@link FOR_TIME_RANGE_FIELD_CONTEXT}. All time math * goes through the `DateAdapter`, which **must be time-capable** — the day-only * `provideInternationalizedDateAdapter()` throws. * * Implements `FormValueControl | null>`, so the committed range auto-wires with * `[formField]`. `value` stays `null` until both endpoints are fully entered, so a half-entered * range never reaches the form and the `end >= start` invariant always holds. A complete but * out-of-order entry keeps its typed segments, leaves `value` `null` and reflects * `aria-invalid="true"` + `data-range-error`; restoring the order emits the range. Set * {@link allowOvernight} to read `start > end` as a midnight crossing instead. * * While no value is bound each endpoint anchors on a fixed, DST-stable sentinel date, so endpoints * compare by time-of-day and a time round-trips to the same instant. Binding an existing range * edits its times in place, preserving each endpoint's calendar day. * * Read-only and required states reflect as the boolean `data-readonly` / `data-required` hooks on * the root: `role="group"` supports neither ARIA property. The read-only announcement lives on each * `[forTimeRangeFieldSegment]` instead, whose `role="spinbutton"` does support it; the required * state is not repeated per segment. * * The bounds are named `minTime` / `maxTime` because `min` / `max` are reserved `FormUiControl` * members whose types cannot express a time bound. Only their time-of-day component is considered. * * @typeParam D The adapter's immutable, time-capable date-time type. * * @example * ```html *
*
* @for (seg of start.segments(); track seg.id) { * @if (seg.isLiteral) { * {{ seg.text }} * } @else { * {{ seg.text }} * } * } *
* *
*
* ``` */ declare class ForTimeRangeField extends FormUiControlBase implements FormValueControl | null>, ForTimeRangeFieldContext { #private; /** * The active, time-capable date adapter, resolved from `FOR_DATE_ADAPTER` * (shared with `ForCalendar`). Throws when the provided adapter is day-only. */ readonly adapter: TimeCapableDateAdapter; /** * Two-way bindable committed time range, or `null` while either endpoint is * incomplete or the two are out of order (unless {@link allowOvernight} reads a * `start > end` entry as a midnight-crossing range). Required by * `FormValueControl | null>` — this **is** the form * value, so it auto-wires with `[formField]`. Emitted only on a settled commit * (segment completion / blur) of an endpoint — a mid-typing keystroke is never * observable through the value. The `model()` change emitter (`(valueChange)`) * fires only when the field itself composes or clears a range, never on * consumer writes via `[(value)]`. * * Two complete endpoints with an **equal** time-of-day compose a valid * zero-length range (`start === end`), not `null`. */ readonly value: _angular_core.ModelSignal | null>; /** * Earliest selectable time-of-day (inclusive) for both endpoints. A composed * endpoint earlier in the day is clamped up, compared by time-of-day. Named * `minTime` (not `min`) because `FormUiControl.min` is reserved for a numeric * validator. Only the hour / minute / second component is considered. */ readonly minTime: _angular_core.InputSignal; /** * Latest selectable time-of-day (inclusive) for both endpoints. A composed * endpoint later in the day is clamped down, compared by time-of-day. Named * `maxTime` (not `max`) for the same reason as {@link minTime}. */ readonly maxTime: _angular_core.InputSignal; /** * Whether a start time-of-day after the end reads as an **overnight** range crossing midnight * (`22:00`–`06:00`) rather than an unorderable error. Defaults to `false`, where `start > end` * keeps `value` `null` and reflects `aria-invalid`. * * When `true`, such an entry commits with the end advanced to the next day, so `end >= start` * still holds and the range spans the correct duration. Only a **strict** `start > end` is * reinterpreted: two equal times compose a zero-length range, never a 24-hour span. * * In this mode a bound value's calendar day is not preserved across edits — both endpoints * re-anchor on the sentinel date. * * The midnight crossing exists only in the in-memory `DateRange`. The hidden inputs serialize * each endpoint's time-of-day alone, so a server reading the posted fields sees `start > end` * again and must re-apply the rule to reconstruct the crossing. */ readonly allowOvernight: _angular_core.InputSignal; /** Smallest editable unit shared by both endpoints: `'hour'`, `'minute'` (default), or `'second'`. */ readonly granularity: _angular_core.InputSignal; /** * 12- or 24-hour cycle. When `null` (default) it is derived from the locale. * A 12-hour cycle adds the AM/PM `dayPeriod` segment to each endpoint. */ readonly hourCycle: _angular_core.InputSignal<12 | 24 | null>; /** BCP 47 locale driving segment order, separators, and AM/PM names. Defaults to the runtime locale. */ readonly locale: _angular_core.InputSignal; /** * Per-segment placeholder shown while empty, applied to both endpoints. * Unspecified parts fall back to `hh` / `mm` / `ss` / `--`. */ readonly placeholder: _angular_core.InputSignal>>; /** Accessible name for the whole range field group. Emits no `aria-label` while `null`. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: Signal; /** * Writing direction. When unset (default `null`), the inherited ambient * direction is resolved from the nearest ancestor carrying a `dir` attribute * (or ``), defaulting to `'ltr'`. An explicit `[dir]` always wins. * The resolved value is reflected to the host `dir` attribute (and each * endpoint group) and mirrors the ArrowLeft / ArrowRight segment navigation * in RTL. */ readonly _dirInput: _angular_core.InputSignal; readonly dir: Signal; /** `aria-invalid` reflects the form-driven invalidity OR a self-detected disorder. */ protected readonly ariaInvalid: Signal; /** * Both endpoints complete but the start falls after the end — an unorderable * range. Never flagged when {@link allowOvernight} is set, where a `start > end` * entry is a valid midnight-crossing range instead of an error. */ protected readonly disordered: Signal; /** `true` only while both endpoints are entirely empty — neither shows entered digits. */ protected readonly empty: Signal; /** * Folds a self-detected out-of-order range into the base invalidity so * `data-invalid` and a surrounding `[forField]` (error region + folded * `aria-describedby`) stay in step with the host `aria-invalid`, which already * reflects the disorder. */ protected effectiveInvalid(): boolean; constructor(); /** * Move focus to the first editable segment of the first incomplete endpoint, * implementing `FormValueControl.focus` from `@angular/forms/signals`: the start * endpoint unless it is complete and the end is not, in which case focus lands * on the end; when both endpoints are complete it falls back to the start. * Without this override Signal Forms would focus the host `role="group"` * wrapper — which is not focusable — so focus-on-error would silently go * nowhere. No-op when disabled. */ focus(options?: FocusOptions): void; endpointSegments(which: TimeRangeFieldEndpoint): Signal[]>; endpointContext(which: TimeRangeFieldEndpoint): SegmentEditorContext; endpointLabel(which: TimeRangeFieldEndpoint): Signal; protected onFocusOut(event: FocusEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[forTimeRangeField]", ["forTimeRangeField"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "minTime": { "alias": "minTime"; "required": false; "isSignal": true; }; "maxTime": { "alias": "maxTime"; "required": false; "isSignal": true; }; "allowOvernight": { "alias": "allowOvernight"; "required": false; "isSignal": true; }; "granularity": { "alias": "granularity"; "required": false; "isSignal": true; }; "hourCycle": { "alias": "hourCycle"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>; } /** * Shared base for the two endpoint groups of a `[forTimeRangeField]`. Each * endpoint is a labelled `role="group"` owning one tab stop (its own roving * tabindex) and one time engine on the root. The base reads the root * coordination surface and exposes the endpoint's rendered `segments` (for the * consumer's `@for`), accessible label, and disabled / read-only / direction * for its host bindings. The concrete `[forTimeRangeFieldStart]` / * `[forTimeRangeFieldEnd]` subclasses bind the matching start / end engine and * provide the per-endpoint `SegmentEditorContext` their segments inject. * * A read-only field is reflected on the endpoint group as the boolean * `data-readonly` styling hook only. `aria-readonly` is not a supported * property of `role="group"`, so the ARIA announcement lives on each * `[forTimeRangeFieldSegment]` — `role="spinbutton"` does support it. */ declare abstract class ForTimeRangeFieldEndpointBase { /** Which endpoint this group edits. */ protected abstract readonly which: TimeRangeFieldEndpoint; protected readonly root: forty_cdk_time_field.ForTimeRangeFieldContext; /** * Accessible name for this endpoint group. Falls back to the scope default * (`'Start time'` / `'End time'` via `provideForTimeRangeFieldDefaults`). * Emits no `aria-label` while both are `null`. */ readonly ariaLabel: _angular_core.InputSignal; /** The field's effective disabled, reflected on the group. */ readonly effectiveDisabled: Signal; /** Whether the field is read-only, reflected on the group. */ readonly readonly: Signal; /** Resolved writing direction, reflected on the group. */ readonly dir: Signal; /** * The ordered, locale-derived segments (editable + literals) of this * endpoint to render. Each entry carries the text to display: the formatted * value when filled, the placeholder while empty, or the literal separator. */ readonly segments: Signal[]>; /** Resolved accessible name for this endpoint group (explicit input or scope default). */ protected readonly label: Signal; /** * Emitted `aria-label`: a consumer-set static value on the endpoint group * when present, else {@link label}. */ protected readonly resolvedAriaLabel: Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The start endpoint group of a `[forTimeRangeField]`. Render its * `segments()` with `[forTimeRangeFieldSegment]` / `[forTimeRangeFieldLiteral]` * children; entry composes the range's inclusive start. * * @example * ```html *
* @for (seg of start.segments(); track seg.id) { * @if (seg.isLiteral) { * {{ seg.text }} * } @else { * {{ seg.text }} * } * } *
* ``` */ declare class ForTimeRangeFieldStart extends ForTimeRangeFieldEndpointBase { protected readonly which: "start"; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The end endpoint group of a `[forTimeRangeField]`. Render its `segments()` * with `[forTimeRangeFieldSegment]` / `[forTimeRangeFieldLiteral]` children; * entry composes the range's inclusive end. */ declare class ForTimeRangeFieldEnd extends ForTimeRangeFieldEndpointBase { protected readonly which: "end"; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * One editable spinbutton segment of a `[forTimeRangeFieldStart]` / * `[forTimeRangeFieldEnd]` endpoint — the hour, minute, second, or AM·PM * (`dayPeriod`) part. Apply on a focusable element (typically a ``); the * directive adds `role="spinbutton"`, the * `aria-valuemin` / `aria-valuemax` / `aria-valuenow` / `aria-valuetext` * reflection, the roving tabindex (scoped to the surrounding endpoint group), * and the full keyboard map (digits, a/p for AM·PM, ArrowUp/Down to step, * ArrowLeft/Right to move between segments — mirrored under RTL, Home/End for the * bounds, Backspace to delete the last entered digit, Delete to clear the whole * segment). * * All state lives on the root `ForTimeRangeField`; the segment only reads its * endpoint's coordination surface and forwards intents. The rendered text comes * from the endpoint's `segments()` list (`{{ seg.text }}`), so this element * carries behavior and ARIA, not content. */ declare class ForTimeRangeFieldSegment extends ForDateTimeSegmentBase { #private; protected readonly ctx: forty_cdk_core.SegmentEditorContext; /** Which time part this segment edits. */ readonly segment: _angular_core.InputSignal; /** * Accessible name for this segment. Falls back to the scope's localized * default label for the part (via `provideForTimeRangeFieldDefaults`), which * in turn defaults to the part name — and `'AM/PM'` for the `dayPeriod` * segment. */ readonly ariaLabel: _angular_core.InputSignal; protected readonly resolvedAriaLabel: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * A decorative separator (`:`, a space) between the editable segments of a * `[forTimeRangeFieldStart]` / `[forTimeRangeFieldEnd]` endpoint. Apply on the * element rendering the literal text; it is marked `aria-hidden` and stays out * of the tab order, so assistive tech reads only the spinbutton segments. The * separator characters come from the endpoint's locale-ordered `segments()` list * (`{{ seg.text }}`). */ declare class ForTimeRangeFieldLiteral extends ForDateTimeLiteralBase { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Accessible name announced for each editable segment, keyed by its part type. * Override individually (or wholesale) for localization; any key left unset * falls back to the library default for that part — so overriding just * `dayPeriod` keeps the English labels for the rest. */ type ForTimeRangeFieldSegmentLabels = Partial>; /** * Defaults inherited by descendant `[forTimeRangeField]` controls in the * surrounding injector scope. Configure with `provideForTimeRangeFieldDefaults` * at the application root or in any component's `providers`; partial overrides * merge with the parent scope. */ interface ForTimeRangeFieldDefaults { /** * Accessible value announced (via `aria-valuetext`) for an empty editable * segment, so screen readers report the segment's empty state instead of * silence. Override for localization. */ emptySegmentText: string; /** * Accessible names announced for each editable segment (via `aria-label`), * keyed by part type, used when a segment has no explicit `ariaLabel`. The * AM/PM `dayPeriod` defaults to `'AM/PM'` instead of leaking the raw token. * Override for localization; unset keys keep the library default. */ segmentLabels: ForTimeRangeFieldSegmentLabels; /** * Accessible name announced (via `aria-label`) for the start endpoint group, * used when `[forTimeRangeFieldStart]` has no explicit `ariaLabel`. */ startLabel: string; /** * Accessible name announced (via `aria-label`) for the end endpoint group, * used when `[forTimeRangeFieldEnd]` has no explicit `ariaLabel`. */ endLabel: string; } /** * Library default accessible name for each editable segment. Used when neither * the segment's explicit `ariaLabel` nor a `provideForTimeRangeFieldDefaults` * override supplies one for that part. */ declare const DEFAULT_TIME_RANGE_FIELD_SEGMENT_LABELS: Readonly>; /** Token holding the resolved time-range-field defaults for the current scope. */ declare const FOR_TIME_RANGE_FIELD_DEFAULTS: _angular_core.InjectionToken; /** * Configures forty-cdk time-range-field defaults for this injector scope. * Partial overrides inherit unspecified keys from the parent scope (or library * defaults at the root). */ declare function provideForTimeRangeFieldDefaults(defaults?: Partial): Provider[]; /** * Exact public names of every `ForTimeRangeField` input, its model included. Spread it into * the `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the * primitive's full surface — the Signal Forms members `[formField]` binds among them — * without hand-maintaining the list. Always spread into an inline object literal as shown * below: the literal is what keeps the entry statically analyzable for consumers compiling * against the published package. An anti-drift spec fails when this list no longer matches * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported * wrapping patterns. * * @example * ```ts * @Component({ * selector: 'div[myTimeRangeField]', * template: '', * hostDirectives: [ * { * directive: ForTimeRangeField, * inputs: [...FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_INPUTS], * outputs: [...FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_OUTPUTS], * }, * ], * }) * export class MyTimeRangeField {} * ``` */ declare const FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_INPUTS: readonly ["value", "allowOvernight", "ariaLabel", "dir", "dirty", "disabled", "errors", "granularity", "hourCycle", "invalid", "locale", "maxTime", "minTime", "name", "pending", "placeholder", "readonly", "required", "touched"]; /** * Exact public names of every `ForTimeRangeField` output, the Signal Forms `touch` output * included. Spread it into the `outputs` array of the same `hostDirectives` entry as * {@link FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_INPUTS}. */ declare const FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "touchedChange", "touch"]; export { DEFAULT_TIME_FIELD_SEGMENT_LABELS, DEFAULT_TIME_RANGE_FIELD_SEGMENT_LABELS, FOR_TIME_FIELD_CONTEXT, FOR_TIME_FIELD_DEFAULTS, FOR_TIME_FIELD_HOST_DIRECTIVE_INPUTS, FOR_TIME_FIELD_HOST_DIRECTIVE_OUTPUTS, FOR_TIME_RANGE_FIELD_CONTEXT, FOR_TIME_RANGE_FIELD_DEFAULTS, FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_INPUTS, FOR_TIME_RANGE_FIELD_HOST_DIRECTIVE_OUTPUTS, ForTimeField, ForTimeFieldLiteral, ForTimeFieldSegment, ForTimeRangeField, ForTimeRangeFieldEnd, ForTimeRangeFieldLiteral, ForTimeRangeFieldSegment, ForTimeRangeFieldStart, provideForTimeFieldDefaults, provideForTimeRangeFieldDefaults }; export type { ForTimeFieldContext, ForTimeFieldDefaults, ForTimeFieldSegmentHandle, ForTimeFieldSegmentLabels, ForTimeRangeFieldContext, ForTimeRangeFieldDefaults, ForTimeRangeFieldSegmentLabels, TimeFieldSegment, TimeRangeFieldEndpoint, TimeRangeFieldSegment };