import * as _angular_core from '@angular/core'; import { OnInit, ElementRef, OnDestroy } from '@angular/core'; import { ValidationErrors, AbstractControl, FormGroup, FormBuilder, ControlValueAccessor, Validator, FormControl, UntypedFormControl } from '@angular/forms'; import { Observable } from 'rxjs'; import * as i1 from '@yuuvis/client-framework/common'; interface DatepickerLabels { calendarApply: string; calendarCancel: string; shortcut: { today: string; }; } interface DatepickerCalendarTriggerTarget { openCalendar: () => void; } interface DatepickerValueChange { value: Date | null; propagateChange: boolean; } interface DatepickerValidationOptions { withTime?: boolean; onlyFutureDates?: boolean; minDate?: Date; maxDate?: Date; } interface DatepickerCalendarOptions extends DatepickerValidationOptions { hour12?: boolean; locale?: string; labels?: DatepickerLabels; } type DayPeriod = 'am' | 'pm'; interface DayPeriodLabels { am: string; pm: string; } declare const DEFAULT_DAY_PERIOD_LABELS: { am: string; pm: string; }; interface TimeValue { hour: number; minute: number; dayPeriod?: DayPeriod; } interface CalendarItem { id: string; day: number; inactive?: boolean; disabled?: boolean; } declare class CalendarComponent implements OnInit { #private; private datepickerService; calEl: _angular_core.Signal>; private _initialized; maxYear: number; minYear: number; year?: number; _offsetYear?: number; month?: number; time?: TimeValue; /** * Allow only date inputs after this date */ minDate: _angular_core.InputSignal; /** * Allow only date inputs before this date */ maxDate: _angular_core.InputSignal; /** * Allow only date inputs that are after today */ onlyFutureDates: _angular_core.InputSignal; date: _angular_core.ModelSignal; months: { label: string; value: number; }[]; private DEFAULT_FIRST_DAY_OF_WEEK; private _firstDayOfWeek; daysOfWeek: string[]; dayPeriodLabels: DayPeriodLabels; locale: _angular_core.InputSignal; withTime: _angular_core.InputSignal; hour12: _angular_core.InputSignal; selectedIndex: number; focusedIndex: number; private _focusPos; calendarDays: CalendarItem[]; private _numberOfWeeks; ngOnInit(): void; private _dateToTime; selectByIndex(i: number, setFocusPosition?: boolean): void; select(d: Date | string | number, setFocusPosition?: boolean, silent?: boolean): void; selectMonthOfYear(month: number, year?: number, skipImmediateSelect?: boolean): void; selectYear(year: number, skipImmediateSelect?: boolean): void; onYearInputKeydown(e: KeyboardEvent): void; onTimeChange(e: TimeValue): void; private _setLocale; private _reset; private _buildMonth; private _getDayId; protected handleKeyboardEvent(event: KeyboardEvent): void; private _getCalendarIndex; private _stopEvent; private _setFocusPos; private _setFocusPosByCalendarIndex; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class DatepickerService { private _value; private _valueChangeSource; valueChange$: Observable; private _validationChangeSource; validationChange$: Observable; DEFAULT_LANGUAGE: string; yearOffset: number; datePattern?: string; private _language; private _languageSource; language$: Observable; private _validationErrors; private _options; /** * Handler for paste events from the components inputs. If the clipboard * contains a whole date it will be covered by the service. * @param event the ClipboardEvent * @returns true if the paste event has been processed by the service, false otherwise */ onPaste(e: string | ClipboardEvent): boolean; setLanguage(isoCode: string): void; getDatePattern(locale: string, withTime: boolean, hour12: boolean): string; isDifferent(d1: Date | null, d2: Date | null): boolean; setValue(date: Date | null, silent?: boolean): void; setOption(options: DatepickerValidationOptions): void; hasErrors(): boolean; getErrors(): ValidationErrors | null; setErrors(err: ValidationErrors): void; removeErrors(err: string[]): void; private _emitValidationChange; getIntlOptions(withTime?: boolean, hour12?: boolean): Intl.DateTimeFormatOptions; /** * Returns locale specific values for AM/PM * @param locale locale string * @returns */ getDayPeriodLabels(locale: string): DayPeriodLabels; private _validateValue; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** * */ declare class DateInputComponent implements OnInit, OnDestroy { private datepickerService; private fb; private elRef; readonly dateInputEls: _angular_core.Signal[]>; private _subs; private _formValueSub?; private _formStateSub?; protected date: Date | null; private _intlOptions?; dateAttribute?: string; set disabled(d: boolean); private _disabled; invalid: _angular_core.WritableSignal; private _refreshPlaceholder; _placeholder?: string; set placeholder(p: string); private _locale; private _withTime; set withTime(b: boolean); get withTime(): boolean; private _hour12; set hour12(b: boolean); get hour12(): boolean; get hoursControl(): AbstractControl; dateTokens: Intl.DateTimeFormatPart[]; dateInputForm?: FormGroup; currentDayPeriod?: DayPeriod; dayPeriodLabels: DayPeriodLabels; constructor(datepickerService: DatepickerService, fb: FormBuilder, elRef: ElementRef); private _setupForm; private _setInvalidInputError; private _checkAndPropagateForm; private _formToDate; private _focusInput; onFormClick(event: MouseEvent): void; onDateInputBlur(): void; focusFirstInput(): void; private _getFocusableElements; private _getPatch; reset(): void; getFormattedValue(): string | null; onInputNext(): void; onInputPrev(): void; toggleDayPeriod(): void; private _init; private _setPlaceholder; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class DatepickerComponent implements ControlValueAccessor, Validator, OnInit, OnDestroy { #private; private _subs; readonly dateInputCmp: _angular_core.Signal; allSelected: _angular_core.WritableSignal; keydownHandler(e: KeyboardEvent): void; clickHandler(): void; focusOutHandler(): void; /** * Whether or not to show a calendar picker */ readonly calendar: _angular_core.InputSignal; /** * Whether or not the component is readonly */ readonly readonly: _angular_core.InputSignal; _hour12: boolean; /** * Whether or not to 12-hour format vs. default 24h format. * By default the component will try to figure out which hour cycle to * use based on the locale. Setting hour12 property to either ` * `true`or `false will overwrite that. */ set hour12(b: boolean); private _detectHourCycle; private _locale; set locale(iso: string); get locale(): string; private _defaultLabelslabels; private _labels; set labels(l: DatepickerLabels | undefined); get labels(): DatepickerLabels | undefined; private _withTime; /** * Whether or not to also include time */ set withTime(b: boolean); get withTime(): boolean; /** * Allow only date inputs that are after today */ set onlyFutureDates(b: boolean); /** * Allow only date inputs after this date */ set minDate(d: Date); /** * Allow only date inputs before this date */ set maxDate(d: Date); disabled: boolean; calendarValue: Date | null; copyToClipboard(): void; clear(): void; openCalendar(): void; onCalendarDateApply(date: Date): void; onTextInputStatusChange(e: { valid: boolean; }): void; closeCalendar(): void; onDateInputBlur(): void; validate(ac: AbstractControl): ValidationErrors | null; propagateChange: (_: any) => void; validationChange: () => void; writeValue(value: any): void; registerOnChange(fn: () => void): void; registerOnValidatorChange?(fn: () => void): void; registerOnTouched(fn: () => void): void; private _getHourCycle; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class DatepickerCalendarTriggerComponent { for: _angular_core.InputSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class YuvDatepickerModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } declare class DateInputElementComponent implements ControlValueAccessor, Validator { private datepickerService; _value?: string; pasteHandler(event: ClipboardEvent): void; keyDownHandler(event: KeyboardEvent): void; readonly maxLength: _angular_core.InputSignal; maxValue: number | undefined; minValue: number; disabled: boolean; placeholder: _angular_core.InputSignal; readonly next: _angular_core.OutputEmitterRef; readonly prev: _angular_core.OutputEmitterRef; fc: FormControl; protected _isNumber(v: any): boolean; private _stopEvent; onInputChange(iv: string): void; onBlur(): void; wheelHandler(event: WheelEvent): void; keydownHandler(event: KeyboardEvent): void; focusHandler(event: FocusEvent): void; protected _setValue(n: any, silent?: boolean): void; increaseValue(step?: number): void; decreaseValue(step?: number): void; private _applyOffset; private _propagate; propagateChange: (_: any) => void; validationChange: () => void; writeValue(value: any): void; registerOnChange(fn: any): void; registerOnValidatorChange?(fn: () => void): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; private _isValidInput; validate(c: UntypedFormControl): { dateInputElement: { valid: boolean; }; } | null; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class DateInputHourElementComponent extends DateInputElementComponent { set dayPeriod(p: 'am' | 'pm' | undefined); readonly dayPeriodChange: _angular_core.OutputEmitterRef<"am" | "pm">; constructor(); writeValue(value: any): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class TimeInputComponent implements ControlValueAccessor, Validator { private fb; readonly hourInput: _angular_core.Signal; readonly minuteInput: _angular_core.Signal; private _time?; protected _hour12: boolean; get hour12(): boolean; set hour12(b: boolean); readonly dayPeriodLabels: _angular_core.InputSignal; private _currentDayPeriod?; set currentDayPeriod(p: DayPeriod | undefined); get currentDayPeriod(): DayPeriod | undefined; form: FormGroup; constructor(fb: FormBuilder); private _propagate; private _patch; propagateChange: (_: any) => void; validationChange: () => void; writeValue(value: TimeValue): void; registerOnChange(fn: any): void; registerOnValidatorChange?(fn: () => void): void; registerOnTouched(fn: any): void; validate(ac: AbstractControl): ValidationErrors | null; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { CalendarComponent, DEFAULT_DAY_PERIOD_LABELS, DatepickerCalendarTriggerComponent, DatepickerComponent, TimeInputComponent, YuvDatepickerModule }; export type { CalendarItem, DatepickerCalendarOptions, DatepickerCalendarTriggerTarget, DatepickerLabels, DatepickerValidationOptions, DatepickerValueChange, DayPeriod, DayPeriodLabels };