UNPKG

@funidata/ngx-fudis

Version:

Funidata Design System.

86 lines (85 loc) 3.75 kB
import { AfterViewInit, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { DateAdapter } from '@angular/material/core'; import { MatDatepickerIntl } from '@angular/material/datepicker'; import { FudisInputSize } from '../../../../types/forms'; import { FudisIdService } from '../../../../services/id/id.service'; import { FudisTranslationService } from '../../../../services/translation/translation.service'; import { FudisFocusService } from '../../../../services/focus/focus.service'; import { FudisComponentChanges } from '../../../../types/miscellaneous'; import { BehaviorSubject } from 'rxjs'; import { DateRangeComponent } from '../date-range/date-range.component'; import { ControlComponentBaseDirective } from '../../../../directives/form/control-component-base/control-component-base.directive'; import * as i0 from "@angular/core"; export declare class DatepickerComponent extends ControlComponentBaseDirective implements OnInit, OnChanges, AfterViewInit, OnDestroy { protected _parentDateRange: DateRangeComponent | null; private _adapter; private _datePickerConfigService; private _datepickerIntl; private _translationService; constructor(_parentDateRange: DateRangeComponent | null, _adapter: DateAdapter<Date>, _datePickerConfigService: FudisTranslationService, _datepickerIntl: MatDatepickerIntl, _translationService: FudisTranslationService, _idService: FudisIdService, _focusService: FudisFocusService); /** * FormControl for the input */ control: FormControl<Date | null>; /** * Available sizes for the Datepicker */ size: FudisInputSize; /** * Show internal date parsing validator message. By setting to false date parsing is not executed. */ dateParse: boolean; /** * Type of the Datepicker in Date Range */ dateRangeType: 'start' | 'end' | null; /** * Allowed range for minimun date */ protected _minDate: Date | null | undefined; /** * Allowed range for maximum date */ protected _maxDate: Date | null | undefined; /** * Fudis translation for invalid start date in Date Range */ protected _startDateInvalidTranslation: string; /** * Fudis translation for invalid end date in Date Range */ protected _endDateInvalidTranslation: string; /** * Fudis translation for date parse error message */ protected _dateParseError: BehaviorSubject<string>; /** * Fudis translation for Datepicker placeholder text */ protected _placeholderString: BehaviorSubject<string>; /** * Instance of Datepicker Parse validator */ private _parseValidatorInstance; /** * Subscription for handling the valueChanges observable */ private _subscription; /** * Validator reads HTML input field and checks if it can be converted to valid Date object */ private _datepickerParseValidatorFn; private _addParseValidator; private _removeParseValidator; /** * Handle calendar close */ protected _handleCalendarClose(): void; ngOnInit(): void; ngAfterViewInit(): void; ngOnChanges(changes: FudisComponentChanges<DatepickerComponent>): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerComponent, [{ optional: true; host: true; }, null, null, null, null, null, null]>; static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerComponent, "fudis-datepicker", never, { "control": { "alias": "control"; "required": true; }; "size": { "alias": "size"; "required": false; }; "dateParse": { "alias": "dateParse"; "required": false; }; }, {}, never, ["fudis-error-message"], false, never>; }