import { ChangeDetectorRef, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges } from "@angular/core"; import { ControlValueAccessor, FormBuilder, UntypedFormGroup, Validator } from "@angular/forms"; import { FocusMonitor } from "@angular/cdk/a11y"; import { BooleanInput } from "@angular/cdk/coercion"; import { MatLegacyFormField as MatFormField, MatLegacyFormFieldControl as MatFormFieldControl } from "@angular/material/legacy-form-field"; import moment from "moment"; import { TranslateService } from "@ngx-translate/core"; import { StarkLoggingService } from "@nationalbankbelgium/stark-core"; import { StarkTimestampMaskConfig } from "@nationalbankbelgium/stark-ui/src/modules/input-mask-directives"; import { StarkDateInput, StarkDatePickerComponent, StarkDatePickerFilter, StarkDatePickerMaskConfig } from "@nationalbankbelgium/stark-ui/src/modules/date-picker"; import { AbstractStarkUiComponent } from "@nationalbankbelgium/stark-ui/src/internal-common"; import * as i0 from "@angular/core"; /** * Default TimeMask configuration */ export declare const DEFAULT_TIME_MASK_CONFIG: StarkTimestampMaskConfig; /** * Component to select a date and a time together */ export declare class StarkDateTimePickerComponent extends AbstractStarkUiComponent implements MatFormFieldControl, ControlValueAccessor, Validator, OnInit, OnChanges, OnDestroy { logger: StarkLoggingService; private _fb; private _fm; private matFormField; private injector; private cdRef; private translateService; /** * Part of {@link MatFormFieldControl} API * @ignore */ id: string; /** * Part of {@link MatFormFieldControl} API * @ignore */ describedBy: string; /** * Part of {@link MatFormFieldControl} API * @ignore */ get shouldLabelFloat(): boolean; /** * Source date to bound to the DateTimePicker */ get value(): Date | null; set value(value: Date | null); /** * Placeholder / label for DateTimePicker */ get placeholder(): string; set placeholder(value: string); /** * Determines if DateTimePicker is required */ get required(): boolean; set required(value: boolean); static ngAcceptInputType_required: BooleanInput; /** * Determines if DateTimePicker is disabled */ get disabled(): boolean; set disabled(value: boolean); /** * Mask for the time */ get timeMask(): StarkTimestampMaskConfig; set timeMask(value: StarkTimestampMaskConfig); /** * Input for {@link StarkDatePickerComponent} */ pickerId: string; /** * Input for {@link StarkDatePickerComponent} */ pickerName: string; /** * Input for {@link StarkDatePickerComponent} */ dateFilter?: StarkDatePickerFilter; /** * Input for {@link StarkDatePickerComponent} */ dateMask?: StarkDatePickerMaskConfig; /** * Input for {@link StarkDatePickerComponent} */ set max(value: moment.Moment | null); get max(): moment.Moment | null; static ngAcceptInputType_max: StarkDateInput; /** * @ignore * Angular expects a Moment or null value. */ private _max; /** * Input for {@link StarkDatePickerComponent} */ set min(value: moment.Moment | null); get min(): moment.Moment | null; static ngAcceptInputType_min: StarkDateInput; /** * @ignore * Angular expects a Moment or null value. */ _min: moment.Moment | null; /** * Output that will emit a specific date whenever the selection has changed */ readonly dateTimeChange: EventEmitter; /** * Reference to the time input embedded in this component */ timeInput: ElementRef; /** * Reference to the Stark date picker embedded in this component */ datePicker: StarkDatePickerComponent & Validator; /** * Part of {@link MatFormFieldControl} API * @ignore */ focused: boolean; /** * @ignore */ dateTimeFormGroup: UntypedFormGroup; /** * Default date in case no date is defined */ defaultDate: Date; /** * Default time (in a Date object form) in case no time is defined. * * IMPORTANT: Although it is a Date object, only the time part will be used. */ defaultTime: Date; /** * Class constructor * @param logger - The `StarkLoggingService` instance of the application. * @param _fb - The Angular Form builder * @param _fm - The Angular Material Focus Monitor service * @param elementRef - Reference to the DOM element where this component is attached to. * @param renderer - Angular `Renderer2` wrapper for DOM manipulations. * @param matFormField - The parent MatFormField directive surrounding this component * @param injector - The Injector of the application * @param cdRef - Reference to the change detector attached to this component * @param translateService - The `TranslateService` instance of the application. */ constructor(logger: StarkLoggingService, _fb: FormBuilder, _fm: FocusMonitor, elementRef: ElementRef, renderer: Renderer2, matFormField: MatFormField, injector: Injector, cdRef: ChangeDetectorRef, translateService: TranslateService); /** * Component lifecycle hook */ ngOnInit(): void; /** * Component lifecycle hook * @param changes - Contains the changed properties */ ngOnChanges(changes: SimpleChanges): void; /** * Component lifecycle hook */ ngOnDestroy(): void; /** * @ignore */ onDateTimeChange(): void; /** * Construct the date time model based on the internal form controls for date and time */ constructDateTime(): Date | null; /** * Construct a time string (with the format "HH:mm:ss:SSS") from the given date * @param dateTime - `Date` object */ constructTimeStringFromDate(dateTime: Date): string; /** * Return an array with the numeric values of the time part of the given date * @param dateTime - `Date` object */ getTimeNumericValuesFromDate(dateTime: Date): number[]; /** * @ignore */ private parseTime; /** * Focus the time input field * @param event - The handled event */ focusTimeInput(event: Event): void; /** * Clears the values of the internal form controls for date and time */ clearDateTime(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }