import * as _angular_core from '@angular/core'; import { InjectionToken, Signal, WritableSignal, Provider } from '@angular/core'; import * as forty_cdk_date_picker from 'forty-cdk/date-picker'; import { FormValueControl } from '@angular/forms/signals'; import { VetoableNativeEvent, IdGenerator, DateAdapter, WritingDirection, VetoableEvent, FieldGranularity, DateRange } from 'forty-cdk/core'; import { ReferenceElement } from '@floating-ui/dom'; import { FloatingSide, FloatingAlign, AnchoredFormValueControlBase, AnchoredPositioningSeedDefaults } from 'forty-cdk/core-overlay'; import { ForCalendar } from 'forty-cdk/calendar'; /** * Coordination contract owned by `[forDatePicker]` (the root). The trigger, * content surface, and value pieces inject this token to read state and * delegate behavior — they never import the root class directly. * * The root is the `FormValueControl`; the trigger is the focusable * element that carries `name` / `disabled` / `invalid` for `[formField]` * autowiring. * * `open` is read-only — route writes through `toggle()` / `close()`. The date * `value` is not exposed; the value piece renders the pre-formatted * {@link formattedValue}. */ interface ForDatePickerContext { /** Whether the surface is open. */ readonly open: Signal; /** * The picker's effective disabled — its own `disabled` input OR'd with a * surrounding disabled `[forFieldset]`. The trigger reads this so a disabled * picker (or fieldset) is inert and reflects the native `disabled` attribute * (its single channel). */ readonly effectiveDisabled: Signal; readonly readonly: Signal; readonly required: Signal; readonly invalid: Signal; readonly pending: Signal; /** When `true`, the surface is a trapped / inert / scroll-locked modal dialog. */ readonly modal: Signal; /** When `true`, Escape / outside-pointer dismiss the surface. */ readonly dismissible: Signal; /** When `true`, focus returns to the trigger on close. */ readonly returnFocus: Signal; /** Close the surface after a date is selected in the projected calendar. */ readonly closeOnSelect: Signal; readonly side: Signal; readonly align: Signal; readonly sideOffset: Signal; readonly alignOffset: Signal; readonly avoidCollisions: Signal; readonly collisionPadding: Signal; readonly sticky: Signal<'partial' | 'always' | false>; readonly hideWhenDetached: Signal; readonly clipUntilPositioned: Signal; readonly triggerId: Signal; readonly contentId: Signal; /** Accessible name for the dialog surface. Emits no `aria-label` while `null`. */ readonly ariaLabel: Signal; /** Formatted current value via the adapter, or `null` when empty. Read by `[forDatePickerValue]`. */ readonly formattedValue: Signal; /** Placeholder shown by `[forDatePickerValue]` when no date is selected. */ readonly placeholder: Signal; /** * Element floating-ui anchors the surface against. Prefers an optional * `[forDatePickerAnchor]` when registered, otherwise falls back to the * trigger. Decoupled from `trigger` so the trigger keeps driving * `aria-controls`, the click toggle, focus return, and its outside-pointer * exemption regardless of where the surface paints. */ readonly reference: Signal; /** The trigger button — exempt from outside-pointer checks and the return-focus target. */ readonly trigger: Signal; registerTrigger(el: HTMLElement): void; unregisterTrigger(el: HTMLElement): void; /** * Register / unregister an optional `[forDatePickerAnchor]` positioning * element. At most one anchor per root; a second registration throws. * Reference-based unregister, so an anchor torn down inside `@if` restores * the trigger fallback cleanly. */ registerAnchor(el: HTMLElement): void; unregisterAnchor(el: HTMLElement): void; /** The mounted `[forDatePickerContent]` element. */ readonly content: Signal; registerContent(el: HTMLElement): void; unregisterContent(el: HTMLElement): void; /** Toggle from a trigger click. Honours `disabled`. */ toggle(): void; /** Close the surface (Escape, outside-pointer, post-selection). Flips `touched`. */ close(): void; /** Flip the `touched` model. Called by the trigger on blur-to-outside. */ markTouched(): void; /** * Move focus to the projected calendar's roving cell (`tabindex="0"`) when * the surface mounts. Returns `false` when no cell is found so the overlay * shell can fall back to the first focusable descendant. */ focusCalendarCell(): boolean; /** * Anchored-path Escape — consumer-owned. Builds the veto, emits * `(escapeKeyDown)`, and closes unless vetoed (or `dismissible` is off). */ emitEscapeKeyDown(event: KeyboardEvent): void; /** * Outside-interaction emit forwarders shared by both shells. The shell * builds and reuses one `VetoableNativeEvent` across the specific and * composite channels; these only fire the matching `output()` and the shell * calls `requestClose` when un-vetoed. */ emitPointerDownOutside(veto: VetoableNativeEvent): void; emitFocusOutside(veto: VetoableNativeEvent): void; emitInteractOutside(veto: VetoableNativeEvent): void; /** Implicit close requested by either shell after an un-vetoed dismissal. */ requestClose(): void; /** * Modal-path Escape forwarder — the modal-shell builds the veto and owns the * close; this only fires `(escapeKeyDown)`. */ forwardEscapeKeyDown(veto: VetoableNativeEvent): void; /** * Auto-focus hooks. Content fires these just before its imperative `.focus()` * (open) or the trigger return-focus (close); `event.preventDefault()` skips * the move. Returns `true` when the consumer vetoed. */ emitAutoFocusOnOpen(): boolean; emitAutoFocusOnClose(): boolean; } /** Injection token for {@link ForDatePickerContext}, provided by `ForDatePicker`. */ declare const FOR_DATE_PICKER_CONTEXT: InjectionToken; /** * Shared overlay / trigger / anchor / content / dismiss / focus machinery for * the date-picker roots. Both the single-date `ForDatePicker` and the * range-form `ForDateRangePicker` extend it, so the floating surface, the * dismissible-layer wiring, the optional positioning anchor, the trigger / * content registration, return-focus, and the vetoable dismiss / auto-focus * outputs live in one place instead of being duplicated per root. * * It implements the full {@link ForDatePickerContext} except `formattedValue`, * which depends on the concrete value type (single date vs `start – end`). * That, plus the `adapter`, the per-root `positioningDefaults` token, and the * generated `triggerId` / `contentId`, are declared abstract so each concrete * root owns them; everything else is concrete and inherited. * * Each concrete root keeps ownership of its `value` model (the * `FormValueControl` backing), its hidden-input serialization, and its * calendar-selection bridge — those are value-type specific and never shared. * * Internal — not re-exported from `public-api.ts`. * * @typeParam D The adapter's immutable date type. */ declare abstract class DatePickerBase extends AnchoredFormValueControlBase implements ForDatePickerContext { #private; /** Shared id generator; concrete roots seed {@link triggerId} / {@link contentId} from it. */ protected readonly idGen: IdGenerator; /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */ abstract readonly adapter: DateAdapter; /** * Two-way bindable. Whether the surface is open. The `model()` change emitter * (`(openChange)`) fires only on internal transitions (trigger toggle, * Escape, outside dismissal, selection), never on consumer writes via * `[(open)]`. */ readonly open: _angular_core.ModelSignal; /** * Minimum selectable date (inclusive). Forward to the projected calendar's * `[min]`. Named `minDate` (not `min`) because `FormUiControl.min` is reserved * for a numeric validator bound by `[formField]`. */ readonly minDate: _angular_core.InputSignal; /** * Maximum selectable date (inclusive). Forward to the projected calendar's * `[max]`. Named `maxDate` (not `max`) for the same reason as {@link minDate}. */ readonly maxDate: _angular_core.InputSignal; /** Per-date predicate. Forward to the projected calendar's `[isDateUnavailable]`. */ readonly isDateUnavailable: _angular_core.InputSignal<(date: D) => boolean>; /** * Close the surface after a selection is committed in the projected calendar. * Default `true`. */ readonly closeOnSelect: _angular_core.InputSignalWithTransform; /** * When `true`, the surface is a trapped / inert / scroll-locked modal dialog * (routed through `core-overlay/modal-shell`) instead of the default non-modal * anchored popover. Read once when the content mounts. */ readonly modal: _angular_core.InputSignalWithTransform; /** When true (default), Escape, pointer-down outside, and focus outside close the surface. */ readonly dismissible: _angular_core.InputSignalWithTransform; /** When true (default), focus returns to the trigger on close. */ readonly returnFocus: _angular_core.InputSignalWithTransform; /** * `Intl.DateTimeFormat` options driving the text rendered by * `[forDatePickerValue]`. Default `{ year: 'numeric', month: 'long', day: 'numeric' }`. */ readonly formatOptions: _angular_core.InputSignal; /** * BCP 47 locale tag driving the text rendered by `[forDatePickerValue]`. When * `null` (default), the adapter formats through the runtime's default locale. * The projected `ForCalendar` is not forwarded this value — bind its own * `[locale]` directly, mirroring how `minDate` / `maxDate` are forwarded. */ readonly locale: _angular_core.InputSignal; /** Text rendered by `[forDatePickerValue]` when nothing is selected. */ readonly placeholder: _angular_core.InputSignal; /** Accessible name for the dialog surface. Emits no `aria-label` while `null`. */ readonly ariaLabel: _angular_core.InputSignal; /** * 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. */ readonly _dirInput: _angular_core.InputSignal; readonly dir: Signal; /** * Fires when the user presses Escape while this surface is the topmost * dismissible layer. Call `preventDefault()` on the veto to suppress the * automatic close. */ readonly escapeKeyDown: _angular_core.OutputEmitterRef>; /** Fires when a pointer goes down outside the surface (and trigger). Vetoable. */ readonly pointerDownOutside: _angular_core.OutputEmitterRef>; /** Fires when focus moves outside the surface (and trigger). Vetoable. */ readonly focusOutside: _angular_core.OutputEmitterRef>; /** Composite event: shares veto state with `pointerDownOutside` / `focusOutside`. */ readonly interactOutside: _angular_core.OutputEmitterRef>; /** Fires just before the surface sends focus into itself on open. Vetoable. */ readonly autoFocusOnOpen: _angular_core.OutputEmitterRef; /** Fires just before focus returns to the trigger on close. Vetoable. */ readonly autoFocusOnClose: _angular_core.OutputEmitterRef; /** The trigger's `id` for `aria-controls` wiring; concrete roots seed it from {@link idGen}. */ abstract readonly triggerId: WritableSignal; /** The surface's `id` for `aria-labelledby` wiring; concrete roots seed it from {@link idGen}. */ abstract readonly contentId: WritableSignal; /** Formatted current value via the adapter, or `null` when empty. */ abstract readonly formattedValue: Signal; readonly trigger: Signal; /** * Element floating-ui anchors the surface against. Prefers an optional * `[forDatePickerAnchor]` when registered, otherwise falls back to the * trigger so existing pickers without an anchor keep their behavior. * Decoupled from `trigger` so the trigger keeps driving `aria-controls`, the * click toggle, focus return, and its dismissal exemption regardless of where * the surface paints. */ readonly reference: Signal; readonly content: Signal; /** * The projected `ForCalendar`. Mounts only while the surface is open, so the * query resolves to the live instance on open and to `undefined` on close. * Its `valueChange` / `rangeChange` is the single signal that a selection * happened inside the grid — each concrete root wires the matching one in its * constructor. * * Invariant: the projected calendar MUST resolve the same `DateAdapter` as * this root (the same `FOR_DATE_ADAPTER` scope). Angular's `contentChild` * erases the generic, so a bridge reads `calendar.value` / `calendar.range` * via a cast; a mismatched adapter would leak a wrong-shaped date through that * seam. {@link assertSameAdapter} catches it early in dev mode. */ protected readonly calendar: Signal | undefined>; /** * Dev-mode guard for a concrete root's calendar-selection bridge: throws when * the projected `ForCalendar` resolved a different `DateAdapter` than this * root, which would leak a wrong-shaped date through the generic-erased * `contentChild` seam. */ protected assertSameAdapter(calendar: ForCalendar): void; registerTrigger(el: HTMLElement): void; unregisterTrigger(el: HTMLElement): void; registerAnchor(el: HTMLElement): void; unregisterAnchor(el: HTMLElement): void; registerContent(el: HTMLElement): void; unregisterContent(el: HTMLElement): void; protected fieldLabelledElement(): HTMLElement | null; protected fieldLabelledElementId(): string; /** * Move focus to the trigger, implementing `FormValueControl.focus` from * `@angular/forms/signals`. Without this override Signal Forms would focus the * host `[forDatePicker]` / `[forDateRangePicker]` wrapper — which carries no * focusable role — so focus-on-error would silently go nowhere. No-op when * disabled or before the trigger has registered. */ focus(options?: FocusOptions): void; toggle(): void; close(): void; markTouched(): void; focusCalendarCell(): boolean; /** * Anchored-path Escape. Builds the veto, emits `(escapeKeyDown)`, and — * unless vetoed and `dismissible` is off — stops propagation and closes. */ emitEscapeKeyDown(event: KeyboardEvent): void; /** * Outside-interaction emit forwarders shared by both shells. The shell builds * and reuses the veto; these only fire the matching output. */ emitPointerDownOutside(veto: VetoableNativeEvent): void; emitFocusOutside(veto: VetoableNativeEvent): void; emitInteractOutside(veto: VetoableNativeEvent): void; /** Modal-path Escape forwarder: emit only; the modal shell owns the close. */ forwardEscapeKeyDown(veto: VetoableNativeEvent): void; /** * Implicit close requested by either shell after an un-vetoed outside * interaction (or, on the modal path, an un-vetoed Escape). Marks the control * touched and closes. */ requestClose(): void; emitAutoFocusOnOpen(): boolean; emitAutoFocusOnClose(): boolean; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, never, never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "isDateUnavailable": { "alias": "isDateUnavailable"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "returnFocus": { "alias": "returnFocus"; "required": false; "isSignal": true; }; "formatOptions": { "alias": "formatOptions"; "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; }; }, { "open": "openChange"; "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "autoFocusOnOpen": "autoFocusOnOpen"; "autoFocusOnClose": "autoFocusOnClose"; }, ["calendar"], never, true, never>; } /** * Headless date picker — the [WAI-ARIA Date Picker Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/) * reinterpreted idiomatically for modern Angular: a focusable trigger that opens * a floating surface wrapping a projected `ForCalendar`. * * The root is the form value: it implements `FormValueControl`, so it auto-wires with * `[formField]` and auto-associates inside a `[forField]`. The trigger is the focusable control * carrying `name` / `disabled` / `invalid`. * * The surface defaults to a non-modal popover anchored to the trigger, dismissed on Escape or an * outside pointer, returning focus on close; set `modal` for the trapped, inert, scroll-locked * variant. Mounting is the consumer's job — wrap `[forDatePickerContent]` with `@if (open())`. * * The projected `ForCalendar` is two-way bound by the consumer and forwarded `[min]` / `[max]` / * `[isDateUnavailable]` from the picker's accessors. On selection the picker mirrors the value, * flips `touched` and — with the default `closeOnSelect` — closes the surface. * * Setting `granularity` finer than `'day'` makes it a date-time picker: project a `[forTimeField]` * beside the calendar and bind both children **one-way** to `picker.value()`, and the picker grafts * the entered time onto each selection. That requires a time-capable adapter. * * For range selection use `ForDateRangePicker`. * * The bounds are named `minDate` / `maxDate` because `min` / `max` are reserved `FormUiControl` * members. * * @typeParam D The adapter's immutable date (or, with `granularity > 'day'`, date-time) type. * * @example * ```html *
* * * @if (open()) { *
*
* *
*
* } *
* ``` * * @example Date-time picker (`granularity="minute"`), children bound one-way: * ```html *
* * @if (open()) { *
*
*
*
* } *
* ``` */ declare class ForDatePicker extends DatePickerBase implements FormValueControl, ForDatePickerContext { #private; protected readonly positioningDefaults: forty_cdk_date_picker.ForDatePickerDefaults; /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */ readonly adapter: DateAdapter; readonly triggerId: _angular_core.WritableSignal; readonly contentId: _angular_core.WritableSignal; /** * Two-way bindable selected date, or `null`. Required by * `FormValueControl`. The `model()` change emitter (`(valueChange)`) * fires only when the picker itself commits a selection, never on consumer * writes via `[(value)]`. */ readonly value: _angular_core.ModelSignal; /** * Date-time precision. `'day'` (default, **non-breaking**) keeps a pure * calendar picker. Anything coarser-than-a-day off — `'hour'` / `'minute'` / * `'second'` — turns it into a date-time picker: the consumer projects a * `[forTimeField]` beside the calendar, a calendar selection preserves the * entered time, and the value carries a time component. Requires a * time-capable adapter (`provideNativeDateAdapter()` or * `provideInternationalizedDateTimeAdapter()`). */ readonly granularity: _angular_core.InputSignal; /** * 12- or 24-hour cycle forwarded to `[forDatePickerValue]`'s formatting (and * typically to the projected `[forTimeField][hourCycle]`). When `null` * (default) it is derived from the runtime locale. Only meaningful when * `granularity > 'day'`. */ readonly hourCycle: _angular_core.InputSignal<12 | 24 | null>; /** Formatted current value via the adapter, or `null` when empty. */ readonly formattedValue: _angular_core.Signal; /** * The projected `ForTimeField`, present only in a date-time picker * (`granularity > 'day'`). Like the calendar, it mounts with the surface. The * bridge ignores its transient `null` commits (an incomplete time mid-clear) * so the committed day survives, and grafts a non-null commit's time-of-day * onto the picker's current day — never the time field's internal sentinel. * * Invariant: the projected time field MUST resolve the same `DateAdapter` as * this picker (see {@link DatePickerBase.calendar}). The bridge casts its * `value` to `D | null` because `contentChild` erases the generic; a dev-mode * assertion guards the same-adapter contract. */ private readonly timeSource; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[forDatePicker]", ["forDatePicker"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "granularity": { "alias": "granularity"; "required": false; "isSignal": true; }; "hourCycle": { "alias": "hourCycle"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["timeSource"], never, true, never>; } /** * Optional positioning anchor. When present, `[forDatePickerContent]` is * positioned against this element instead of `[forDatePickerTrigger]` — useful * when the trigger lives inside a decorated field box (padding, prefix icon, * clear / chevron buttons) and the surface should align to the visible field * rather than the inner button. * * Only positioning changes: the trigger still owns `aria-controls`, * `aria-expanded`, the click toggle, focus return on close, and its exemption * from outside-pointer dismissal. If no anchor is registered the surface falls * back to anchoring against the trigger, so existing usages are unaffected. * * A date picker's calendar has its own intrinsic width and ignores * `--for-floating-anchor-width`, so the practical effect is mostly start / side * alignment to the box edge. * * At most one `[forDatePickerAnchor]` may be registered per `[forDatePicker]`; * a second one throws. * * ```html *
*
* * * *
* @if (open()) { *
* } *
* ``` */ declare class ForDatePickerAnchor { #private; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The button that opens the date-picker surface — and the focusable form * control the picker exposes for `[formField]`. Apply on a ` * ``` * * For fully custom rendering, drop this directive and read * `forDatePicker.formattedValue()` / `forDatePicker.value()` from your template. */ declare class ForDatePickerValue { #private; /** Text shown when no date is selected. Falls back to `[forDatePicker][placeholder]`. */ readonly placeholder: _angular_core.InputSignal; protected readonly isPlaceholder: _angular_core.Signal; protected readonly displayText: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Defaults inherited by descendant date pickers in the surrounding injector * scope. Configure with `provideForDatePickerDefaults` either at the * application root or in any component's `providers` array; partial overrides * merge with the parent scope. */ interface ForDatePickerDefaults extends AnchoredPositioningSeedDefaults { /** * Side the surface is anchored to for pickers that don't override `side` * locally. Ignored in `modal` mode. Library fallback `'bottom'`. */ side: FloatingSide; /** * Alignment along the chosen `side` for pickers that don't override `align` * locally. Ignored in `modal` mode. Library fallback `'start'`. */ align: FloatingAlign; /** * Distance (px) between the trigger and the floating surface along the * resolved `side` axis. Ignored in `modal` * mode (the dialog is centered, not anchored). */ sideOffset: number; /** * Padding (px) added to the viewport edges for collision-aware positioning. * Higher values keep the surface further from the edge when `flip` / `shift` * runs. */ collisionPadding: number; } /** Token holding the resolved date-picker defaults for the current scope. */ declare const FOR_DATE_PICKER_DEFAULTS: _angular_core.InjectionToken; /** * Configures forty-cdk date-picker defaults for this injector scope. Partial * overrides inherit unspecified keys from the parent scope (or library * defaults at the root). */ declare function provideForDatePickerDefaults(defaults?: Partial): Provider[]; /** * Exact public names of every `ForDatePicker` 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[myDatePicker]', * template: '', * hostDirectives: [ * { * directive: ForDatePicker, * inputs: [...FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS], * outputs: [...FOR_DATE_PICKER_HOST_DIRECTIVE_OUTPUTS], * }, * ], * }) * export class MyDatePicker {} * ``` */ declare const FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS: readonly ["value", "open", "align", "alignOffset", "ariaLabel", "avoidCollisions", "clipUntilPositioned", "closeOnSelect", "collisionPadding", "dir", "dirty", "disabled", "dismissible", "errors", "formatOptions", "granularity", "hideWhenDetached", "hourCycle", "invalid", "isDateUnavailable", "locale", "maxDate", "minDate", "modal", "name", "pending", "placeholder", "readonly", "required", "returnFocus", "side", "sideOffset", "sticky", "touched"]; /** * Exact public names of every `ForDatePicker` output, the Signal Forms `touch` output * included. Spread it into the `outputs` array of the same `hostDirectives` entry as * {@link FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS}. */ declare const FOR_DATE_PICKER_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "openChange", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "autoFocusOnOpen", "autoFocusOnClose", "touchedChange", "touch"]; /** * Coordination contract owned by `[forDateRangePicker]` (the range root). It is * structurally identical to {@link ForDatePickerContext}: the range root reuses * the same trigger / content / value / anchor pieces (which inject * `FOR_DATE_PICKER_CONTEXT`), so it provides **both** tokens. This dedicated * token exists for advanced consumers and future range-specific pieces that * want to resolve the range root unambiguously. * * Unlike the single-date root, the range root's `formattedValue` renders * `start – end` and its form value is the committed `DateRange`. */ type ForDateRangePickerContext = ForDatePickerContext; /** Injection token for {@link ForDateRangePickerContext}, provided by `ForDateRangePicker`. */ declare const FOR_DATE_RANGE_PICKER_CONTEXT: InjectionToken; /** * Headless date **range** picker — the form-capable sibling of `ForDatePicker`. * It follows the same [WAI-ARIA Date Picker Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/) * and reuses the same overlay / trigger / anchor / content / value pieces * (`[forDatePickerTrigger]`, `[forDatePickerContent]`, `[forDatePickerValue]`, * `[forDatePickerAnchor]`) through the shared {@link DatePickerBase}. * * Where `ForDatePicker[selectionMode="range"]` exposes the range through a * plain two-way `[(range)]` model (no form contract), `ForDateRangePicker` is * the root **and** the form value: it implements * `FormValueControl | null>`, so the committed range * auto-wires with `[formField]` exactly like any other control. The committed * range is the `value` model — the two-click anchor → commit flow keeps `value` * `null` until both endpoints are chosen, so the form never sees a half-entered * range, and `start <= end` is an invariant (never an error). * * Project a `ForCalendar` in `selectionMode="range"` inside * `[forDatePickerContent]` and bind its `[(range)]` to `picker.value`; the root * mirrors each committed range, flips `touched`, and — when `closeOnSelect` is * on (default) — closes the surface once both endpoints are set. Range is * day-granular in v1 (no time composition). * * @typeParam D The adapter's immutable date type. * * Note: the date bounds are named `minDate` / `maxDate`, not `min` / `max` — * the latter are reserved `FormUiControl` members typed `number | undefined`, * and `FormUiControl.min` / `max` are additionally typed `NonNullable` * (the range object itself), which is meaningless as a bound. * * @example * ```html *
* * * @if (open()) { *
*
* *
*
* } *
* ``` */ declare class ForDateRangePicker extends DatePickerBase implements FormValueControl | null>, ForDateRangePickerContext { protected readonly positioningDefaults: forty_cdk_date_picker.ForDateRangePickerDefaults; /** The active date adapter, resolved from `FOR_DATE_ADAPTER` (shared with `ForCalendar`). */ readonly adapter: DateAdapter; readonly triggerId: _angular_core.WritableSignal; readonly contentId: _angular_core.WritableSignal; /** * Two-way bindable committed date range, or `null`. Required by * `FormValueControl | null>` — this **is** the form * value, so it auto-wires with `[formField]`. The `model()` change emitter * (`(valueChange)`) fires only when the picker itself commits or clears a * range, never on consumer writes via `[(value)]`. */ readonly value: _angular_core.ModelSignal | null>; /** * Minimum inclusive day count for a committed range. Forward to the projected * calendar's `[minRangeLength]`; the calendar's two-click flow rejects a * shorter range as a no-op (anchor preserved). `null` (default) means no * minimum. */ readonly minRangeLength: _angular_core.InputSignal; /** * Maximum inclusive day count for a committed range. Forward to the projected * calendar's `[maxRangeLength]`. `null` (default) means no maximum. */ readonly maxRangeLength: _angular_core.InputSignal; /** * Separator rendered between start and end in `[forDatePickerValue]`. Default * `' – '` (en-dash with spaces). */ readonly rangeSeparator: _angular_core.InputSignal; /** Formatted committed range (`start – end`) via the adapter, or `null` when empty. */ readonly formattedValue: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[forDateRangePicker]", ["forDateRangePicker"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "minRangeLength": { "alias": "minRangeLength"; "required": false; "isSignal": true; }; "maxRangeLength": { "alias": "maxRangeLength"; "required": false; "isSignal": true; }; "rangeSeparator": { "alias": "rangeSeparator"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>; } /** * Defaults inherited by descendant date range pickers in the surrounding * injector scope. Configure with `provideForDateRangePickerDefaults` either at * the application root or in any component's `providers` array; partial * overrides merge with the parent scope. */ interface ForDateRangePickerDefaults extends AnchoredPositioningSeedDefaults { /** * Side the surface is anchored to for pickers that don't override `side` * locally. Ignored in `modal` mode. Library fallback `'bottom'`. */ side: FloatingSide; /** * Alignment along the chosen `side` for pickers that don't override `align` * locally. Ignored in `modal` mode. Library fallback `'start'`. */ align: FloatingAlign; /** * Distance (px) between the trigger and the floating surface along the * resolved `side` axis. Ignored in `modal` mode (the dialog is centered, not * anchored). */ sideOffset: number; /** * Padding (px) added to the viewport edges for collision-aware positioning. * Higher values keep the surface further from the edge when `flip` / `shift` * runs. */ collisionPadding: number; } /** Token holding the resolved date-range-picker defaults for the current scope. */ declare const FOR_DATE_RANGE_PICKER_DEFAULTS: _angular_core.InjectionToken; /** * Configures forty-cdk date-range-picker defaults for this injector scope. * Partial overrides inherit unspecified keys from the parent scope (or library * defaults at the root). */ declare function provideForDateRangePickerDefaults(defaults?: Partial): Provider[]; /** * Exact public names of every `ForDateRangePicker` 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[myDateRangePicker]', * template: '', * hostDirectives: [ * { * directive: ForDateRangePicker, * inputs: [...FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS], * outputs: [...FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_OUTPUTS], * }, * ], * }) * export class MyDateRangePicker {} * ``` */ declare const FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS: readonly ["value", "open", "align", "alignOffset", "ariaLabel", "avoidCollisions", "clipUntilPositioned", "closeOnSelect", "collisionPadding", "dir", "dirty", "disabled", "dismissible", "errors", "formatOptions", "hideWhenDetached", "invalid", "isDateUnavailable", "locale", "maxDate", "maxRangeLength", "minDate", "minRangeLength", "modal", "name", "pending", "placeholder", "rangeSeparator", "readonly", "required", "returnFocus", "side", "sideOffset", "sticky", "touched"]; /** * Exact public names of every `ForDateRangePicker` output, the Signal Forms `touch` output * included. Spread it into the `outputs` array of the same `hostDirectives` entry as * {@link FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS}. */ declare const FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "openChange", "escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "autoFocusOnOpen", "autoFocusOnClose", "touchedChange", "touch"]; export { FOR_DATE_PICKER_CONTEXT, FOR_DATE_PICKER_DEFAULTS, FOR_DATE_PICKER_HOST_DIRECTIVE_INPUTS, FOR_DATE_PICKER_HOST_DIRECTIVE_OUTPUTS, FOR_DATE_RANGE_PICKER_CONTEXT, FOR_DATE_RANGE_PICKER_DEFAULTS, FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_INPUTS, FOR_DATE_RANGE_PICKER_HOST_DIRECTIVE_OUTPUTS, ForDatePicker, ForDatePickerAnchor, ForDatePickerContent, ForDatePickerTrigger, ForDatePickerValue, ForDateRangePicker, provideForDatePickerDefaults, provideForDateRangePickerDefaults }; export type { ForDatePickerContext, ForDatePickerDefaults, ForDateRangePickerContext, ForDateRangePickerDefaults };