import * as _spartan_ng_brain_popover from '@spartan-ng/brain/popover'; import { BrnPopover } from '@spartan-ng/brain/popover'; import * as _spartan_ng_brain_date_picker from '@spartan-ng/brain/date-picker'; import * as _angular_core from '@angular/core'; import { Signal, InjectionToken, Type, ExistingProvider } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; /** * Headless behavior shared by every date picker text input (single, multi, * range, month-year). Owns the editable text mirror, cursor preservation and * the commit/parse lifecycle; styled subclasses provide the template, styling * and the parse/format strategy. * * `V` is the value type held by the associated date picker (e.g. `Date`, * `Date[]` or `[Date, Date]`). */ declare abstract class BrnDateInput { private static _nextId; readonly inputId: _angular_core.InputSignal; private readonly _document; private readonly _host; private readonly _inputElement; private _pendingSelection; protected readonly _datePicker: _spartan_ng_brain_date_picker.BrnDatePickerBase; protected readonly _popover: _angular_core.Signal<_spartan_ng_brain_popover.BrnPopover>; protected readonly _disabled: _angular_core.Signal; /** Initial text shown in the input. Mirrored by the picker once a date is committed. */ readonly inputValue: _angular_core.InputSignal; /** Show a clear button that resets the input and picker value. Hidden when empty. */ readonly showClear: _angular_core.InputSignalWithTransform; /** Open the popover on input click. */ readonly openOnClick: _angular_core.InputSignalWithTransform; /** Forces the invalid state visually, regardless of form control state. */ readonly forceInvalid: _angular_core.InputSignalWithTransform; /** Accessible name of the text input. Forwarded to the inner ``, not the host. */ readonly ariaLabel: _angular_core.InputSignal; /** Id(s) of the element(s) labelling the text input. Forwarded to the inner ``, not the host. */ readonly ariaLabelledby: _angular_core.InputSignal; /** Id(s) of the element(s) describing the text input. Forwarded to the inner ``, not the host. */ readonly ariaDescribedby: _angular_core.InputSignal; /** * Manual override for aria-invalid, e.g. for server-side validation errors. * When not set, it follows the error state matcher (and `forceInvalid`). */ readonly ariaInvalidInput: _angular_core.InputSignalWithTransform; /** Accessible label for the clear button. */ readonly clearAriaLabel: _angular_core.InputSignal; /** Accessible label for the calendar trigger button. */ readonly calendarAriaLabel: _angular_core.InputSignal; /** @internal Id used by the trigger contract for labeling. */ readonly triggerId: _angular_core.Signal; readonly placeholder: _angular_core.InputSignal; /** * Parse user-entered text into the picker value. Return `null` for * invalid input - the picker's value is cleared while the text is preserved * so the user can fix it. */ protected abstract parseValue(value: string): V | null; /** * Format the committed value into the input/edit format shown while the * input is focused. On blur the picker's display format is restored. */ protected abstract formatInputValue(value: V): string; /** * Text shown in the input. Mirrors the picker's `formattedDate` and the * parent's `inputValue`, and accepts user writes via `_handleInputChange`. * Commits only happen on blur / Enter, so in-progress text isn't clobbered. */ protected readonly _inputValue: _angular_core.WritableSignal; protected readonly _showClearButton: _angular_core.Signal; constructor(); protected _handleInputChange(event: Event): void; protected _clear(): void; protected _handleEnter(event: Event): void; /** On focus, reformat the committed value into the input/edit format. */ protected _handleFocus(): void; /** On blur, commit the input and snap back to the picker's display format. */ protected _handleBlur(): void; protected _commitDate(): void; protected _open(): void; protected _handleClick(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, never, never, { "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "inputValue": { "alias": "inputValue"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "openOnClick": { "alias": "openOnClick"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaInvalidInput": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "calendarAriaLabel": { "alias": "calendarAriaLabel"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } interface BrnDatePickerTriggerBase { triggerId: Signal; } declare const BrnDatePickerTriggerToken: InjectionToken; declare function provideBrnDatePickerTrigger(instance: Type): ExistingProvider; interface BrnDatePickerBase { popover: Signal; disabledState: Signal; formattedDate: Signal; hasDate: Signal; /** The current raw value. Used by inputs to reformat into the input format on focus. Optional. */ value?: Signal; /** Commit a date to the picker (e.g. from a parsed input). Pass `null` to clear. Optional. */ updateDate?(value: T | null): void; touched?(): void; } declare const BrnDatePickerToken: InjectionToken>; declare function provideBrnDatePicker(instance: Type>): ExistingProvider; /** * Inject the date picker component. */ declare function injectBrnDatePicker(): BrnDatePickerBase; export { BrnDateInput, BrnDatePickerToken, BrnDatePickerTriggerToken, injectBrnDatePicker, provideBrnDatePicker, provideBrnDatePickerTrigger }; export type { BrnDatePickerBase, BrnDatePickerTriggerBase };