import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate'; import { TranslatableString } from '@siemens/element-translate-ng/translate'; import * as _angular_forms from '@angular/forms'; import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors, FormControl, ValidatorFn, NgControl } from '@angular/forms'; import * as _angular_core from '@angular/core'; import { OnChanges, SimpleChanges, OnInit, AfterViewInit, OnDestroy, ComponentRef, ElementRef, AfterContentInit } from '@angular/core'; import { SiFormItemControl } from '@siemens/element-ng/form'; import * as _angular_cdk_overlay from '@angular/cdk/overlay'; import { ConnectionPositionPair } from '@angular/cdk/overlay'; import { FocusOrigin } from '@angular/cdk/a11y'; /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ type WeekStart = 'monday' | 'saturday' | 'sunday' | undefined; interface DatepickerConfig { /** * Text or translation key for today button title. Default is `Today`. */ todayText?: TranslatableString; /** * Defines the starting day of the week. Default is `monday`. */ weekStartDay?: WeekStart; /** * Configuration for hiding week numbers. Default is `false`. */ hideWeekNumbers?: boolean; /** * Defines the timepicker visibility. Default is `false`. */ showTime?: boolean; /** * Defines the timepicker minutes visibility. Default is `true`. */ showMinutes?: boolean; /** * Defines the timepicker seconds visibility . Default is `false`. */ showSeconds?: boolean; /** * Defines the timepicker milliseconds visibility . Default is `false`. */ showMilliseconds?: boolean; /** * Hides disable time switch in the timepicker part and includes mandatory the * time in the picker. */ mandatoryTime?: boolean; /** * Defines the time is disabled when visible. Will also be updated on user change. Default is `false`. */ disabledTime?: boolean; /** * Text or translation key for the `enabled` disable time. Default is `Consider time`. */ enabledTimeText?: TranslatableString; /** * Text or translation key for the `disabled` disable time. Default is `Ignore time`. */ disabledTimeText?: TranslatableString; /** * Minimal (earliest) selectable date. */ minDate?: Date; /** * Maximal (latest) selectable date. */ maxDate?: Date; /** * Options to turn on date range selection. */ enableDateRange?: boolean; /** * Option to use two months view for date range picking. */ enableTwoMonthDateRange?: boolean; /** * Consider time with minDate and maxDate */ enableTimeValidation?: boolean; /** * Only month and year are selectable. */ onlyMonthSelection?: boolean; hoursLabel?: string; minutesLabel?: string; secondsLabel?: string; millisecondsLabel?: string; hideLabels?: boolean; hoursAriaLabel?: string; minutesAriaLabel?: string; secondsAriaLabel?: string; millisecondsAriaLabel?: string; hoursPlaceholder?: string; minutesPlaceholder?: string; secondsPlaceholder?: string; millisecondsPlaceholder?: string; meridians?: string[]; meridiansLabel?: string; meridiansAriaLabel?: string; startTimeLabel?: string; endTimeLabel?: string; } interface DatepickerInputConfig extends DatepickerConfig { /** * A custom date/time format according the Angular date pipe (see {@link https://angular.dev/api/common/DatePipe}). * Only numeric date formats are supported. * The format is used to render the time of a date-time criterion. If not specified, `mediumTime` is * used if the `showSeconds` flag is true, otherwise `shortTime` as default. For the date-only * case, 'shortDate' is used. */ dateTimeFormat?: string; /** * Similar to `dateTimeFormat`, but used when only a date is displayed * (e.g. when `showTime === false` or `disabledTime === true`). * Only numeric date formats are supported. */ dateFormat?: string; } /** * Returns date / datetime format to be used for rendering a date object as text * to an Html input element, which has the `SiDatepickerDirective`. * * @see https://angular.dev/api/common/DatePipe?tab=usage-notes * @param locale - The locale for which the format is returned. * @param config - The config object of the datepicker. * @param timeWhenDisabled - If `true`, a format with time (medium or short) is returned, even if the `disabledTime` config is `true`. * @returns Either * - a custom format provided by the config, * - the localized `medium` format when time and seconds included * - the localized `short` format when time and no seconds included */ declare const getDatepickerFormat: (locale: string, config?: DatepickerInputConfig, timeWhenDisabled?: boolean) => string; type DateRange = { start: Date | undefined; end: Date | undefined; }; /** * Base directive for date input fields. */ declare class SiDateInputDirective implements ControlValueAccessor, OnChanges, Validator, SiFormItemControl { private static idCounter; /** * @defaultValue * ``` * `si-date-input-${SiDateInputDirective.idCounter++}` * ``` */ readonly id: _angular_core.InputSignal; /** * Configuration object for the datepicker. * * @defaultValue * ``` * {} * ``` */ readonly siDatepickerConfig: _angular_core.ModelSignal; /** * Emits an event to notify about disabling the time from the datepicker. * When time is disable, we construct a pure date object in UTC 00:00:00 time. */ readonly siDatepickerDisabledTime: _angular_core.OutputEmitterRef; /** * Emits an event on state changes e.g. readonly, disable, ... . */ readonly stateChange: _angular_core.OutputEmitterRef; /** * Whether the date range input is disabled. * @defaultValue false */ readonly disabledInput: _angular_core.InputSignal; /** * Whether the date range input is readonly. * @defaultValue false */ readonly readonly: _angular_core.InputSignalWithTransform; /** * This ID will be bound to the `aria-describedby` attribute of the date-input. * Use this to reference the element containing the error message(s) for the date-input. * It will be picked by the {@link SiFormItemComponent} if the date-input is used inside a form item. * * @defaultValue * ``` * `${this.id()}-errormessage` * ``` */ readonly errormessageId: _angular_core.InputSignal; /** @internal */ validatorOnChange: () => void; /** @internal */ readonly validationChange: _angular_core.OutputEmitterRef; /** * Date form input validator function, validating text format, min and max value. */ protected validator: _angular_forms.ValidatorFn; protected date?: Date; /** * Emits a new `date` value on input field value changes. */ protected readonly dateChange: _angular_core.OutputEmitterRef; /** @internal */ readonly disabled: _angular_core.Signal; protected onTouched: () => void; protected onModelChange: (value: any) => void; protected readonly dateString: _angular_core.WritableSignal; private readonly disabledNgControl; protected readonly locale: string; private format; ngOnChanges(changes: SimpleChanges): void; validate(c: AbstractControl): ValidationErrors | null; registerOnChange(fn: any): void; registerOnTouched(fn: () => void): void; registerOnValidatorChange(fn: () => void): void; setDisabledState(isDisabled: boolean): void; writeValue(value?: Date | string | null): void; private updateNativeValue; /** * Handles `input` events on the input element. */ protected onInput(event: Event): void; protected onBlur(event: FocusEvent): void; private getFormat; /** * Callback when the datepicker changes his value. * @param date - updated date */ protected onDateChanged(date?: Date): void; /** * Datepicker consider time / ignore time changed. * @param disabledTime - disable time * @internal */ onDisabledTime(disabledTime: boolean): void; /** The form control validator for date format */ private formatValidator; /** The form control validator for the min date. */ private minValidator; /** The form control validator for the min date. */ private maxValidator; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** CSS classes that can be associated with a calendar cell. */ type CellCssClasses = string | string[] | Set | { [key: string]: any; }; interface Cell { value: number; /** Indicate that the cell is disabled */ disabled: boolean; /** Cell specific aria label */ ariaLabel: string; /** Display value */ displayValue: string; /** * Indicate that the cell is a preview, this is dedicated to the calendar month * view to where a day could be part of the previous or next month */ isPreview: boolean; /** * The cell corresponds to today. */ isToday: boolean; /** Raw value */ valueRaw: Date; /** Additional CSS classes for the cell */ cssClasses: CellCssClasses; } /** * Choose which view shall be shown. * @internal */ type ViewType = 'week' | 'month' | 'year' | undefined; type RangeType = 'START' | 'END' | undefined; declare class SiDatepickerComponent implements OnInit, OnChanges, AfterViewInit { private readonly locale; /** * The date which is currently focused * Compare to the selected date or range the calendar requires to have one element to focus. */ readonly focusedDate: _angular_core.ModelSignal; /** * The selected date of the datepicker. Use for * initialization and for bidirectional binding. */ readonly date: _angular_core.ModelSignal; /** * The selected date range of the datepicker. Use for * initialization and for bidirectional binding. */ readonly dateRange: _angular_core.ModelSignal; /** * Role of this calendar when a date range is displayed across two calendars. * * @internal */ readonly dateRangeRole: _angular_core.InputSignal; /** * Set initial focus to calendar body. * * @defaultValue false */ readonly initialFocus: _angular_core.InputSignal; /** * Disabled the optional visible time picker. * * @defaultValue false */ readonly disabledTime: _angular_core.ModelSignal; /** * Object to configure the datepicker. * * @defaultValue * ``` * {} * ``` */ readonly config: _angular_core.ModelSignal; /** * Aria label for the previous button. Needed for a11y. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.PREVIOUS:Previous`) * ``` */ readonly previousLabel: _angular_core.InputSignal; /** * Aria label for the next button. Needed for a11y. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.NEXT:Next`) * ``` */ readonly nextLabel: _angular_core.InputSignal; /** * Aria label for week number column * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.CALENDAR_WEEK_LABEL:Calendar week`) * ``` */ readonly calendarWeekLabel: _angular_core.InputSignal; /** * Enable/disable 12H mode in timepicker. Defaults to locale * * @defaultValue undefined */ readonly time12h: _angular_core.InputSignalWithTransform; /** * Use this to force date range operation to select either start date or end date. * * @defaultValue 'START' */ readonly rangeType: _angular_core.ModelSignal; /** * Optional input to control the minimum month the datepicker can show and the user can navigate. * The `minMonth` can be larger than the `minDate` This option enables the usage of multiple * datepickers next to each other while the more left calendar always * shows a earlier month the the more right one. * @internal */ readonly minMonth: _angular_core.InputSignal; /** * Optional input to control the maximum month the datepicker can show and the user can navigate. * The `maxMonth` can be smaller than the `maxDate` This option enables the usage of multiple * datepickers next to each other while the more left calendar always * shows a earlier month the the more right one. * @internal */ readonly maxMonth: _angular_core.InputSignal; /** * Option to hide the time switch. * * @defaultValue false */ readonly hideTimeToggle: _angular_core.InputSignal; /** * Whether the calendar is hidden while retaining the optional timepicker. * * @internal */ readonly hideCalendar: _angular_core.InputSignal; /** * Optional timepicker label. */ readonly timepickerLabel: _angular_core.InputSignal; protected get startDate(): Date | undefined; protected get endDate(): Date | undefined; /** * Returns the date object if not range selection is enabled. Otherwise, if * the date range role is 'END', the date range end date is returned. If * date range role is not 'END', the date range start date is returned. */ private getRelevantDate; private readonly defaultDisabledTimeText; private readonly defaultEnableTimeText; protected readonly includeTimeLabel: _angular_core.Signal; protected get weekStartDay(): WeekStart; protected get hideWeekNumbers(): boolean; /** * The active view */ protected readonly view: _angular_core.WritableSignal; /** * Get the current shown view. */ private readonly activeView; protected readonly actualFocusedDate: _angular_core.Signal; protected readonly requireFocus: _angular_core.WritableSignal; /** When the user switch from the year or month view via keyboard selection we force the focus. */ protected readonly forceFocus: _angular_core.Signal; protected months: string[]; protected switchId: string; protected timepickerId: string; /** * Configuration which view shall be shown after year selection, * when onlyMonthSelection is enabled the month view is shown otherwise the week view. */ protected yearViewSwitchTo: 'month' | 'week'; protected monthViewSwitchTo: 'month' | 'week'; private readonly cdRef; private readonly localeWeekStart; /** * Date object to track and change the time. Keeping time and date * in separate objects to not change the date when flipping time. * After change, a new date object is created with an adapted time. */ protected time: FormControl; /** * Used to hold the last time when setting the time to disabled. * Value will be reset on enabling the time again. */ private previousTime?; /** Reference to the current day selection component. Shown when view === 'week' */ private readonly daySelection; /** Reference to the current month selection component. Shown when view === 'month' */ private readonly monthSelection; /** Reference to the current year selection component. Shown when view === 'year' */ private readonly yearSelection; /** * The cell which which has the mouse hover. * @internal */ readonly activeHover: _angular_core.ModelSignal; constructor(); ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; ngAfterViewInit(): void; /** Initialize day and month labels */ private initCalendarLabels; /** * Validates and sets a new date to the this.date model object of this component * and fires the related events. The model object shall not be updated elsewhere * with a new date object. Shall only be called on simple date selection and not * on date range selection. * * @param newDate - The new date to be set. */ private setDate; /** * Validates and sets the new date range to the dateRange model * object. * @param newDateRange - The new range to be set. * @returns True if the new range is valid and set. Otherwise false. */ private setDateRange; protected timeSelected(newTime?: Date): void; protected toggleDisabledTime(): void; private onDisabledTimeChanged; private validateTime; /** * Handle selection in the day view. * @param selection - selected date. */ protected selectionChange(selection: Date): void; /** * Handle month/year changes * @param selection - the selected month or null of cancelled. */ protected activeMonthChange(selection: Date | null): void; /** * Handle year changes * @param selection - the selected year or null of cancelled. */ protected activeYearChange(selection: Date | null): void; /** * Focus the active cell in view. * The function is required to transfer the focus from input to the active date cell. */ focusActiveCell(): void; protected onActiveHoverChange(event?: Cell): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SiDatepickerOverlayComponent implements OnChanges, OnInit, OnDestroy { protected readonly minMonth: _angular_core.WritableSignal; protected readonly maxMonth: _angular_core.WritableSignal; protected readonly datepicker: _angular_core.Signal; /** * {@inheritDoc SiDatepickerComponent#initialFocus} * @defaultValue false */ readonly initialFocus: _angular_core.InputSignalWithTransform; /** * {@inheritDoc SiDatepickerComponent#config} * @defaultValue * ``` * {} * ``` */ readonly config: _angular_core.InputSignal; /** * {@inheritDoc SiDatepickerComponent#date} */ readonly date: _angular_core.ModelSignal; /** * {@inheritDoc SiDatepickerComponent#dateRange} */ readonly dateRange: _angular_core.ModelSignal; /** * {@inheritDoc SiDatepickerComponent#rangeType} */ readonly rangeType: _angular_core.ModelSignal<"START" | "END" | undefined>; /** * {@inheritDoc SiDatepickerComponent#time12h} * @defaultValue false */ readonly time12h: _angular_core.InputSignalWithTransform; /** * Emits an event to notify about disabling the time from the datepicker. * When time is disable, we construct a pure date object in UTC 00:00:00 time. */ readonly disabledTimeChange: _angular_core.OutputEmitterRef; private readonly document; private readonly elementRef; private readonly focusMonitor; private readonly focusTrapFactory; private focusTrap?; private previousActiveElement?; protected readonly disableTime: _angular_core.WritableSignal; protected readonly activeHover: _angular_core.WritableSignal; protected readonly isTwoMonthDateRange: _angular_core.Signal; protected readonly firstDatepickerConfig: _angular_core.WritableSignal; protected readonly secondDatepickerConfig: _angular_core.WritableSignal; /** * Indicate that the overlay is opened in small screen. * A modal dialog animation display when true and a wrapped two month calendar layout is displayed. * * @defaultValue false */ readonly isMobile: _angular_core.InputSignal; protected readonly completeAnimation: _angular_core.WritableSignal; ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; ngOnDestroy(): void; /** * Focus active cell in the current datepicker view. */ focusActiveCell(): void; protected firstDatepickerFocusDateChange(newFocusedDate?: Date): void; protected secondDatepickerFocusDateChange(newFocusedDate?: Date): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare enum CloseCause { Backdrop = "backdrop", Detach = "detach", Escape = "escape", Select = "select" } type DatepickerInput = { config: DatepickerConfig; date: Date; dateRange: DateRange; rangeType: 'START' | 'END'; time12h: boolean; showTime: true; }; /** Partial datepicker inputs */ type DatepickerInputPartial = Partial; /** * Directive with the responsibility to open/close datepicker overlay. */ declare class SiDatepickerOverlayDirective implements OnDestroy { /** * Position of the datepicker overlay. Accepts an array of positions or a single position. * The position will be chosen based on the first position that fits into the viewport. * The input is necessary since the positions between the siDatepicker directive and si-date-range * component are different. * @internal */ readonly placement: _angular_core.WritableSignal; /** * Optional CDK scroll strategy used for the datepicker overlay. * * @defaultValue defaultConnectedOverlayScrollStrategy() */ readonly scrollStrategy: _angular_core.InputSignal<_angular_cdk_overlay.ScrollStrategy>; /** * Output event on closing datepicker e.g. by clicking backdrop or escape key. */ readonly siDatepickerClose: _angular_core.OutputEmitterRef; private overlayRef?; private datepickerRef?; private autoCloseSelection; /** Guard for siDatepickerClose event emitter to make sure the cause is emitter just once */ private ignoreClose; private readonly overlay; private readonly triggerElementRef; private readonly mediaMatcher; private readonly breakpointObserver; private readonly destroyRef; /** * When the media query matches on open the overlay is displayed like a modal dialog. * In case, users change the screen size to the matching media query we close the overlay * if it is open with a connected overlay strategy. */ private readonly smallScreenQuery; ngOnDestroy(): void; /** * Show datepicker overlay. * @param focus - move focus to the datepicker. * @returns create datepicker overlay instance */ showOverlay(focus?: boolean, inputs?: DatepickerInputPartial): ComponentRef; /** * Close datepicker. */ closeOverlay(): undefined; /** * Focus active cell in datepicker. * @param focus - show transfer focus. * @returns current instance. */ focus(focus?: boolean): this; /** * Indicate the datepicker is visible. * @returns is visible. */ isShown(): ComponentRef | undefined; /** Set datepicker inputs */ setInputs(inputs?: DatepickerInputPartial): this; /** Close overlay with cause select, which will recover the focus */ closeAfterSelection(): void; /** Indicate whether the HTML element is a child of the datepicker overlay. */ contains(element: HTMLElement): boolean; private showDatepicker; protected createMobileOverlay(): void; protected createDesktopOverlay(): void; /** * Merge events which shall close the overlay * @param overlayRef - source for backdrop, detach or escape events. * @returns merged observable */ private closeStream; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class SiDatepickerDirective extends SiDateInputDirective implements AfterViewInit { /** * Automatically close overlay on date selection. * Do not use this behavior with config showTime = true, because it * will close the overlay when the user change one of the time units. * * @defaultValue false */ readonly autoClose: _angular_core.InputSignalWithTransform; /** * During focus on close the datepicker will not show since we recover the focus on element. * The focus on close is only relevant when the directive is configured without a calendar button. */ private overlaySubscriptions?; private externalTrigger?; private readonly overlayToggle; ngAfterViewInit(): void; /** @internal */ touch(): void; /** * On click shall show datepicker. */ protected onClick(): void; /** * Focus out shall close the datepicker except we are moving the focus to the datepicker. * @param event - focus out event with the related target */ protected onBlur(event: FocusEvent): void; protected onTab(): void; /** * @internal */ show(initialFocus?: boolean): void; /** * @internal */ useExternalTrigger(element: ElementRef): void; protected focusChange(): void; private subscribeDateChanges; /** * Callback when the datepicker changes his value. * @param date - updated date */ protected onDateChanged(date?: Date): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface Value { hours: T; minutes: T; seconds: T; milliseconds: T; } interface Config { ariaLabel: TranslatableString; label: TranslatableString; maxLength: number; max: number; name: keyof Value; placeholder: string; separator?: string; } declare class SiTimepickerComponent implements ControlValueAccessor, Validator, SiFormItemControl { private static idCounter; private readonly locale; private readonly formBuilder; /** * @defaultValue * ``` * `__si-timepicker-${SiTimepickerComponent.idCounter++}` * ``` */ readonly id: _angular_core.InputSignal; readonly labelledby: string; /** * All input fields will be disabled if set to true. * * @defaultValue false */ readonly disabledInput: _angular_core.InputSignal; /** * Visible label for the hours input. * * @defaultValue 'hh' */ readonly hoursLabel: _angular_core.InputSignal; /** * Visible label for the minutes input. * * @defaultValue 'mm' */ readonly minutesLabel: _angular_core.InputSignal; /** * Visible label for the seconds input. * * @defaultValue 'ss' */ readonly secondsLabel: _angular_core.InputSignal; /** * Visible label for the milliseconds input. * * @defaultValue 'ms' */ readonly millisecondsLabel: _angular_core.InputSignal; /** * Hide the labels of the input fields. * @defaultValue false */ readonly hideLabels: _angular_core.InputSignalWithTransform; /** * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.HOURS:Hours`) * ``` */ readonly hoursAriaLabel: _angular_core.InputSignal; /** * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.MINUTES:Minutes`) * ``` */ readonly minutesAriaLabel: _angular_core.InputSignal; /** * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.SECONDS:Seconds`) * ``` */ readonly secondsAriaLabel: _angular_core.InputSignal; /** * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.MILLISECONDS:Milliseconds`) * ``` */ readonly millisecondsAriaLabel: _angular_core.InputSignal; /** * Placeholder for the hours input. * * @defaultValue 'hh' */ readonly hoursPlaceholder: _angular_core.InputSignal; /** * Placeholder for the minutes input. * * @defaultValue 'mm' */ readonly minutesPlaceholder: _angular_core.InputSignal; /** * Placeholder for the seconds input. * * @defaultValue 'ss' */ readonly secondsPlaceholder: _angular_core.InputSignal; /** * Placeholder for the milliseconds input. * * @defaultValue 'ms' */ readonly millisecondsPlaceholder: _angular_core.InputSignal; /** Custom labels for the AM and PM options. */ readonly meridians: _angular_core.InputSignal; /** * Visible label for the AM/PM selector. * * @defaultValue 'am/pm' */ readonly meridiansLabel: _angular_core.InputSignal; /** * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.PERIOD:Period`) * ``` */ readonly meridiansAriaLabel: _angular_core.InputSignal; /** * Whether the minutes input is displayed. * * @defaultValue true */ readonly showMinutes: _angular_core.InputSignalWithTransform; /** * Whether the seconds input is displayed. * * @defaultValue false */ readonly showSeconds: _angular_core.InputSignalWithTransform; /** * Whether the milliseconds input is displayed. * * @defaultValue false */ readonly showMilliseconds: _angular_core.InputSignalWithTransform; /** * Show time in 12-hour period including the select to toggle between AM/PM. */ readonly showMeridian: _angular_core.InputSignal; /** * A minimum time limit. The date part of the date object will be ignored. */ readonly min: _angular_core.InputSignal; /** * A maximum time limit. The date part of the date object will be ignored. */ readonly max: _angular_core.InputSignal; /** * Whether the time inputs are read-only. * * @defaultValue false */ readonly readonly: _angular_core.InputSignalWithTransform; /** Emits whether the entered time components form a valid time. */ readonly isValid: _angular_core.OutputEmitterRef; /** Emits the selected meridian when it changes. */ readonly meridianChange: _angular_core.OutputEmitterRef; /** Emits when the user presses Enter in the final time input. */ readonly inputCompleted: _angular_core.OutputEmitterRef; private readonly inputParts; /** * This ID will be bound to the `aria-describedby` attribute of the timepicker. * Use this to reference the element containing the error message(s) for the timepicker. * It will be picked by the {@link SiFormItemComponent} if the timepicker is used inside a form item. * * @defaultValue * ``` * `${this.id()}-errormessage` * ``` */ readonly errormessageId: _angular_core.InputSignal; private onChange; private onTouched; protected readonly periods: _angular_core.Signal; protected readonly use12HourClock: _angular_core.Signal; protected readonly disabled: _angular_core.Signal; protected readonly meridian: _angular_core.WritableSignal<"" | "am" | "pm">; protected readonly units: _angular_core.Signal; protected readonly timeControls: _angular_forms.FormGroup<{ hours: _angular_forms.FormControl; minutes: _angular_forms.FormControl; seconds: _angular_forms.FormControl; milliseconds: _angular_forms.FormControl; }>; /** Indicate whether one of the input fields has an invalid value. */ protected hasInvalidUnit(): boolean; private readonly disabledNgControl; /** * Holds the time as date object that is presented by this control. */ private time?; /** * Whether `null` was emitted due to an incomplete or invalid input. * The next valid time must be emitted, even if it equals the previous `time`. */ private invalidTimeEmitted; private periodDefaults; constructor(); writeValue(obj?: Date | string): void; /** @internal */ isPM(): boolean; registerOnChange(fn: any): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; /** @internal */ validate(control: AbstractControl): ValidationErrors | null; /** * Handle Enter, Arrow up/down and Space key press events. */ protected handleKeyPressEvent(event: KeyboardEvent): void; protected toHtmlInputElement: (target?: EventTarget | null) => HTMLInputElement; protected updateField(name: keyof Value, value: string): void; protected toggleMeridian(): void; /** * Takes the current UI values and updates the time object value * accordingly, if they UI input values are valid. */ private updateTime; /** * Sets a new time object as model value, updates the user interface * and invokes onChange to let timepicker clients know about the update. * @param time - The new time to be set. */ private setTime; /** * Updates the user interface by filling the time components * into the time input fields. Sets empty values if the date * is undefined or invalid. * * @param value - The date object or string from with the time components are taken. */ private updateUI; private isValidDate; private parseTime; private createDateUpdate; private toNumber; private changeTimeComponent; private changeTime; /** * Focuses the next available input/select field or emit inputCompleted event. */ protected focusNext(event: Event): void; protected focusChange(event: FocusOrigin): void; protected formatTime(time: Date): string; protected validateMin(control: AbstractControl): ValidationErrors | null; protected validateMax(control: AbstractControl): ValidationErrors | null; protected validateTime(name: string): ValidatorFn; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SiDateRangeComponent implements ControlValueAccessor, Validator, AfterViewInit, OnChanges, SiFormItemControl { private static idCounter; private readonly inputDirectives; private readonly startInput; private readonly endInput; private readonly button; /** * @defaultValue * ``` * `__si-date-range-${SiDateRangeComponent.idCounter++}` * ``` */ readonly id: _angular_core.InputSignal; readonly labelledby: string; /** * Date range component configuration. * * @defaultValue * ``` * { enableDateRange: true } * ``` */ readonly siDatepickerConfig: _angular_core.ModelSignal; /** * Placeholder of the start date input. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.START_DATE_PLACEHOLDER:Start date`) * ``` */ readonly startDatePlaceholder: _angular_core.InputSignal; /** * Placeholder of the end date input. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.END_DATE_PLACEHOLDER:End date`) * ``` */ readonly endDatePlaceholder: _angular_core.InputSignal; /** * Aria label of the date-range calendar toggle button. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.CALENDAR_TOGGLE_BUTTON:Open calendar`) * ``` */ readonly ariaLabelCalendarButton: _angular_core.InputSignal; /** * Form label of the start timepicker. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.START_TIME_LABEL:From`) * ``` */ readonly startTimeLabel: _angular_core.InputSignal; /** * Form label of the start timepicker. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.END_TIME_LABEL:To`) * ``` */ readonly endTimeLabel: _angular_core.InputSignal; /** * Automatically close overlay on date selection. * * @defaultValue false */ readonly autoClose: _angular_core.InputSignalWithTransform; /** Emits on the date range value changes. */ readonly siDatepickerRangeChange: _angular_core.OutputEmitterRef; /** * Emits an event to notify about disabling the time from the range picker. * When time is disable, we construct a pure date objects in UTC 00:00:00 time. */ readonly disabledTimeChange: _angular_core.OutputEmitterRef; /** * Whether the date range input is disabled. * * @defaultValue false */ readonly disabledInput: _angular_core.InputSignal; /** * Whether the date range input is readonly. * * @defaultValue false */ readonly readonly: _angular_core.InputSignalWithTransform; /** * Set the date-range object displayed in the control. * The input can be used if the control is used outside Angular forms. */ readonly value: _angular_core.ModelSignal; /** * This ID will be bound to the `aria-describedby` attribute of the date-range. * Use this to reference the element containing the error message(s) for the date-range. * It will be picked by the {@link SiFormItemComponent} if the date-range is used inside a form item. * * @defaultValue * ``` * `${this.id()}-errormessage` * ``` */ readonly errormessageId: _angular_core.InputSignal; private validator; private onChange; private onTouch; protected onValidatorChange: () => void; protected readonly icons: Record<"elementCalendar", string>; protected readonly disabled: _angular_core.Signal; private readonly disabledNgControl; private readonly cdRef; private readonly locale; private readonly overlayToggle; private readonly elementRef; private readonly defaultPlacement; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; writeValue(dateRange: DateRange): void; registerOnChange(fn: any): void; registerOnTouched(fn: () => void): void; registerOnValidatorChange(fn: () => void): void; setDisabledState(isDisabled: boolean): void; validate(c: AbstractControl): ValidationErrors | null; /** * Focus out shall close the datepicker except we are moving the focus to the datepicker or one of the input elements. * @param event - focus out event with the related target */ protected onFocusOut(event: FocusEvent): void; /** Forward date range input changes to datepicker overlay */ protected onInputChanged(dateRange: DateRange): void; protected show(): void; private subscribeRangeChanges; private onRangeChanged; /** Run validators on the start/end inputs. */ private validateChildren; /** The form control validator for the end date is greater equal start date. */ private endAfterStartValidator; private readonly childValidation; private readErrorsFromInnerControl; private updateValue; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Calendar toggle button used in combination with a datepicker directive. * * @example * ``` * * * * ``` */ declare class SiCalendarButtonComponent implements OnInit, AfterContentInit { /** * Aria label for the calendar toggle button. * * @defaultValue * ``` * t(() => $localize`:@@SI_DATEPICKER.CALENDAR_TOGGLE_BUTTON:Open calendar`) * ``` */ readonly ariaLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>; protected readonly button: _angular_core.Signal>; /** Datepicker input directive instance used to watch for state changes and required to open the calendar. */ protected readonly datepicker: _angular_core.Signal; protected readonly datepickerOverlay: _angular_core.Signal; protected readonly ngControl: _angular_core.Signal; protected readonly disabled: _angular_core.WritableSignal; protected readonly icons: Record<"elementCalendar", string>; private readonly destroyerRef; private readonly focusMonitor; private readonly elementRef; ngOnInit(): void; ngAfterContentInit(): void; protected show(): void; private updateState; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class SiDatepickerModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } interface DayOfWeek { id: string; index: number; offset: number; isWeekend: boolean; } declare const WEEK_START_OFFSET: { monday: number; saturday: number; sunday: number; }; declare const getDaysOfWeek: (weekStart: WeekStart) => DayOfWeek[]; /** * Get local specific months using DateTimeFormat. * @param locale - current locale */ declare const getLocaleMonthNames: (locale: string) => string[]; /** * Get local specific weekdays as string using DateTimeFormat. * @param locale - current local * @param weekStart - start of the week * @param format - display format * @returns array of week days. */ declare const getDayStrings: (locale: string, weekStart?: WeekStart, format?: "narrow" | "short" | "long") => string[]; /** * Gets the first day in the specified month. * Expects the month as a value between 1 and 12. * The year is required to handle leap years. * * @returns The first day of the month as a Date. */ declare const getFirstDayInMonth: (year: number, month: number) => Date; /** * Returns the ISO-8601 week number for the user's week containing the specified date. * ISO-8601 weeks always start on Monday. When the user's week starts on Sunday or Saturday, * the date is adjusted to find the corresponding ISO week (based on the Thursday rule). * The first week of a year is the week that contains the first Thursday of the year (='First 4-day week'). * The highest week number in a year is either 52 or 53. * * @param date -The JavaScript date object. * @param weekStart -Name of the first day of the week * @returns The number of the Week */ declare const getWeekOfYear: (date: Date, weekStart: WeekStart) => number; declare const getWeekDayOffset: (date: Date, weekStart: WeekStart) => number; /** returns the date string in format YYYY-MM-DD for given date */ declare const getStringforDate: (date: Date) => string; /** * Creates a new date object on from a date with or without time. * @param value - The date from with the year, month and day is taken. * @param hours - Optional numeric value of the hours, otherwise 0. * @param minutes - Optional numeric value of the minutes, otherwise 0. * @param seconds - Optional numeric value of the seconds, otherwise 0. * @param milliseconds - Optional numeric value of the milliseconds, otherwise 0. * @returns */ declare const createDate: (value: Date, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) => Date; /** * @param input - String containing a date or dateTime value (Ex. "05/15/2020" * @param format - Format of the input value (Ex. "M/d/YYYY") * @param locale - Locale of the input value * @returns A JS Date in accordance of the three parameters */ declare const parseDate: (input: string, format: string, locale: string) => Date | undefined; declare const getNamedFormat: (locale: string, format: string) => string; declare const getDateWithoutTime: (date: Date) => Date; /** * Get today * @returns date of today */ declare const today: () => Date; /** * Calculate a new date based on the offset while considering the min and max date. * @param current - input date. * @param daysOffset - numeric offset of days. * @returns new date if the range is valid or original date */ declare const addDaysInRange: (current: Date, daysOffset: number, minDate?: Date, maxDate?: Date) => Date; /** * Get date delta based on the offset. * @param date - source date object. * @param days - numeric offset of days. * @returns new date. */ declare const addDays: (date: Date, days: number) => Date; /** * Update date/day of give date without changing the month. * In case the day exceed the number of days in the current month the last day in month will be assigned. * @param date - the date object to update the day. * @param day - the day which shall be set. * @returns the updated date object. */ declare const changeDay: (date: Date, day: number) => Date; /** * Get date delta specifically for months based on the offset. * @param current - starting date. * @param monthsOffset - numeric offset of months. * @param minDate - optional minimum allowed date. * @param maxDate - optional maximum allowed date. * @returns a new date object with the updated month. */ declare const addMonthsInRange: (current: Date, monthsOffset: number, minDate?: Date, maxDate?: Date) => Date; /** * Get date delta specifically for years based on the offset. * @param current - starting date. * @param yearsOffset - numeric offset of years. * @param minDate - optional minimum allowed date. * @param maxDate - optional maximum allowed date. * @returns a new date object with the updated year. */ declare const addYearsInRange: (current: Date, yearsOffset: number, minDate?: Date, maxDate?: Date) => Date; /** * Get number of days for the given month and year. * @param month - month as number (0..11). * @param year - year as number. * @returns the number of days for the given month. */ declare const daysInMonth: (month: number, year: number) => number; /** * Get the first date of the week based on the input date. * @param current - a date object from where the last date of a week is derived. * @param weekStartDay - optional when a week shall start. * @returns a new date object which is the start of the current week. */ declare const getWeekStartDate: (current: Date, weekStartDay?: WeekStart) => Date; /** * Get the last date of the week based on the input date. * @param current - a date object from where the last date of a week is derived. * @param weekStartDay - optional when a week shall start. * @returns the last date within the week. */ declare const getWeekEndDate: (current: Date, weekStartDay?: WeekStart) => Date; /** * Get the beginning of the month. * @param current - a date object from where the first date in a month is derived. * @returns a new date object which starts a the first. */ declare const getFirstDateInMonth: (current: Date) => Date; /** * Get the last date of the month. * @param current - a date object from where we derive the last date in a month. * @returns a new date object which is the last day in the current month. */ declare const getLastDateInMonth: (current: Date) => Date; /** * Get the beginning of the year. * @param current - a date object from where the first date in a year is derived. * @returns a new date object which starts a the first. */ declare const getFirstDateInYear: (current: Date) => Date; /** * Are the two dates identical without considering time. */ declare const isSameDate: (current: Date, compareTo?: Date) => boolean; /** * Are the two months identical without considering time. */ declare const isSameMonth: (current: Date, compareTo?: Date) => boolean; /** * Are the two years identical. */ declare const isSameYear: (current: Date, compareTo?: Date) => boolean; /** * Compares two dates. * @param first - The first date to compare. * @param second - The second date to compare. * @returns 0 if the dates are equal, a number less than 0 if the first date is earlier, * a number greater than 0 if the first date is later. */ declare const compareDate: (first: Date, second: Date) => number; /** * Compares two months. * @param first - The first month to compare. * @param second - The second month to compare. * @returns 0 if the months are equal, a number less than 0 if the first month is earlier, * a number greater than 0 if the first month is later. */ declare const compareMonth: (first: Date, second: Date) => number; /** * Compares two years. * @param first - The first year to compare. * @param second - The second year to compare. * @returns 0 if the years are equal, a number less than 0 if the first year is earlier, * a number greater than 0 if the first year is later. */ declare const compareYear: (first: Date, second: Date) => number; /** * Compare the current date is the same date or between start and end date. * @param current - the date object. * @param from - optional min date, if no value is provided we assume true for the min value. * @param to - optional max date, if no value is provided we assume true for the max value. * @returns true if the date is in the provided range. */ declare const isSameOrBetween: (current: Date, from?: Date, to?: Date) => boolean; /** * Compare the current month is the same month or between start and end month. * @param current - the month object. * @param from - optional min month, if no value is provided we assume true for the min value. * @param to - optional max month, if no value is provided we assume true for the max value. * @returns true if the date is in the provided range. */ declare const isSameOrBetweenMonth: (current: Date, from?: Date, to?: Date) => boolean; /** * Compare the current year is the same year or between start and end year. * @param current - the year object. * @param from - optional min year, if no value is provided we assume true for the min value. * @param to - optional max year, if no value is provided we assume true for the max value. * @returns true if the date is in the provided range. */ declare const isSameOrBetweenYears: (current: Date, from?: Date, to?: Date) => boolean; /** * Compare the current date is between start and end date. * from \< current \< to */ declare const isBetween: (current: Date, from?: Date, to?: Date) => boolean; /** * Compare the current month is between start and end month. * from \< current \< to */ declare const isBetweenMonth: (current: Date, from?: Date, to?: Date) => boolean; /** * Compare the current year is between start and end year. * from \< current \< to */ declare const isBetweenYears: (current: Date, from?: Date, to?: Date) => boolean; /** * Is first date after the second date (without considering the time). * current \> compareTo */ declare const isAfter: (current: Date, compareTo: Date) => boolean; /** * Is first month after the second month (without considering the time). * current \> compareTo */ declare const isAfterMonth: (current: Date, compareTo: Date) => boolean; /** * Is first year after the second year. * current \> compareTo */ declare const isAfterYear: (current: Date, compareTo: Date) => boolean; /** * Is first date equal or before the second date (without considering the time). * current \>= compareTo */ declare const isSameOrBefore: (current: Date, compareTo: Date) => boolean; /** * Is first month equal or before the second month. * current \>= compareTo */ declare const isSameOrBeforeMonth: (current: Date, compareTo: Date) => boolean; /** * Is first year equal or before the second year. * current \>= compareTo */ declare const isSameOrBeforeYear: (current: Date, compareTo: Date) => boolean; /** * Are the two dates in different months. */ declare const isAnotherMonth: (current: Date, compareTo: Date) => boolean; /** * Are the two dates in different years. */ declare const isAnotherYear: (current: Date, compareTo: Date) => boolean; /** * Are the two dates either in different months or years. */ declare const isAnotherMonthOrYear: (current: Date, compareTo: Date) => boolean; /** * Get a date which is in within the range and the close to current. */ declare const getDateSameOrBetween: (current: Date, minDate?: Date, maxDate?: Date) => Date; /** * Get date or absolute min date. * @param date - input date. * @returns date or date of 1.1.1900 */ declare const getMinDate: (date?: Date) => Date; /** * Get date or absolute max date. * @param date - input date. * @returns date or date of 31.12.2154 */ declare const getMaxDate: (date?: Date) => Date; /** * Is valid date object. */ declare const isValid: (date?: Date) => date is NonNullable; /** * Returns the next months of the given date. * @param date - The date for which the next month is returned. * @returns A date of the first day of the following month of the given day. */ declare const nextMonth: (date: Date) => Date; /** * Returns the last day of the previous month of the given date object. * @param date - The date for which the previous month is returned. * @returns A date of the last day of the previous month of the given day. */ declare const previousMonth: (date: Date) => Date; declare const minDate: (first?: Date, second?: Date) => Date | undefined; declare const maxDate: (first?: Date, second?: Date) => Date | undefined; /** * Indicate whether the time use the 12-hour format */ declare const is12HourFormat: (locale: string, config: DatepickerInputConfig) => boolean; export { CloseCause, SiCalendarButtonComponent, SiDateInputDirective, SiDateRangeComponent, SiDatepickerComponent, SiDatepickerDirective, SiDatepickerModule, SiDatepickerOverlayComponent, SiDatepickerOverlayDirective, SiTimepickerComponent, WEEK_START_OFFSET, addDays, addDaysInRange, addMonthsInRange, addYearsInRange, changeDay, compareDate, compareMonth, compareYear, createDate, daysInMonth, getDateSameOrBetween, getDateWithoutTime, getDatepickerFormat, getDayStrings, getDaysOfWeek, getFirstDateInMonth, getFirstDateInYear, getFirstDayInMonth, getLastDateInMonth, getLocaleMonthNames, getMaxDate, getMinDate, getNamedFormat, getStringforDate, getWeekDayOffset, getWeekEndDate, getWeekOfYear, getWeekStartDate, is12HourFormat, isAfter, isAfterMonth, isAfterYear, isAnotherMonth, isAnotherMonthOrYear, isAnotherYear, isBetween, isBetweenMonth, isBetweenYears, isSameDate, isSameMonth, isSameOrBefore, isSameOrBeforeMonth, isSameOrBeforeYear, isSameOrBetween, isSameOrBetweenMonth, isSameOrBetweenYears, isSameYear, isValid, maxDate, minDate, nextMonth, parseDate, previousMonth, today }; export type { DateRange, DatepickerConfig, DatepickerInput, DatepickerInputConfig, DatepickerInputPartial, DayOfWeek, RangeType, WeekStart };