UNPKG

@nova-ui/bits

Version:

SolarWinds Nova Framework

115 lines (114 loc) 6.55 kB
import { OverlayConfig } from "@angular/cdk/overlay"; import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from "@angular/core"; import { ControlValueAccessor, FormControl, ValidationErrors } from "@angular/forms"; import { Moment } from "moment/moment"; import { Subject } from "rxjs"; import { DatePickerInnerComponent } from "./date-picker-inner.component"; import { IDatePickerDisabledDate } from "./public-api"; import { NuiFormFieldControl } from "../form-field/public-api"; import { OverlayComponent } from "../overlay/overlay-component/overlay.component"; import { TextboxComponent } from "../textbox/textbox.component"; import * as i0 from "@angular/core"; export declare class DatePickerComponent implements OnChanges, OnInit, ControlValueAccessor, NuiFormFieldControl, AfterViewInit, OnDestroy { private cd; /** sets date-picker inline mode */ inline: boolean; /** checks if value in datepicker is required */ isRequired: boolean; /** Option to disabled datepicker. */ isDisabled: boolean; /** to apply error state styles */ isInErrorState: boolean; /** Input to set aria label text */ ariaLabel: string; /** to date format locale */ locale: string; /** sets date-picker mode, supports: `day`, `month`, `year` */ datepickerMode: string; /** earliest selectable date */ minDate: Moment; /** latest selectable date */ maxDate: Moment; /** set lower date-picker mode, supports: `day`, `month`, `year` */ minMode: string; /** sets upper date-picker mode, supports: `day`, `month`, `year` */ maxMode: string; /** if false week numbers will be hidden */ showWeeks: boolean; /** date format, used to format selected date */ dateFormat: string; /** format of day in month */ formatDay: string; /** format of month in year */ formatMonth: string; /** format of year in year range */ formatYear: string; /** format of day in week header */ formatDayHeader: string; /** format of title when selecting day */ formatDayTitle: string; /** format of title when selecting month */ formatMonthTitle: string; /** starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday) */ startingDay: number; /** number of years displayed in year selection */ yearRange: number; /** if true only dates from the currently displayed month will be shown */ onlyCurrentMonth: boolean; /** number of months displayed in a single row of month picker */ preserveInsignificant: boolean; /** array of custom css classes to be applied to targeted dates */ disabledDates: IDatePickerDisabledDate[]; /** Is used to handle timezone of date value */ handleTimezone: boolean; /** Allows popup box to be attached to document.body */ appendToBody: boolean; /** currently active date */ get value(): Moment; set value(value: Moment); selectionDone: EventEmitter<Moment>; /** callback to invoke when the value is changed. */ valueChange: EventEmitter<Moment>; calendarNavigated: EventEmitter<Moment>; inputBlurred: EventEmitter<any>; _datePicker: DatePickerInnerComponent; textbox: TextboxComponent; popupArea: ElementRef; overlay: OverlayComponent; onDestroy$: Subject<void>; customContainer: ElementRef | undefined; selectedDate: Moment; initDate: Moment; overlayConfig: OverlayConfig; protected _value: Moment; protected _todayDate: Moment; private formControl; private inputChanged; private momentDateFormat; private calendarChanged; constructor(cd: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; updateTouchedState(): void; onUpdate(event: Moment): void; private setDate; onInputActiveDateChanged(value: string): void; getIconColor(): string; onChange(value: any): void; onTouched(): void; validate(control: FormControl): ValidationErrors | null; writeValue(value: any): void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; setErrorState(isInErrorState: boolean): void; onSelectionDone(value: Moment): void; private updateTextboxValue; private isDateDisabled; private setDateFormat; ngOnDestroy(): void; private onAppendToBodyChange; static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<DatePickerComponent, "nui-date-picker", never, { "inline": { "alias": "inline"; "required": false; }; "isRequired": { "alias": "isRequired"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; "isInErrorState": { "alias": "isInErrorState"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "datepickerMode": { "alias": "datepickerMode"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "minMode": { "alias": "minMode"; "required": false; }; "maxMode": { "alias": "maxMode"; "required": false; }; "showWeeks": { "alias": "showWeeks"; "required": false; }; "dateFormat": { "alias": "dateFormat"; "required": false; }; "formatDay": { "alias": "formatDay"; "required": false; }; "formatMonth": { "alias": "formatMonth"; "required": false; }; "formatYear": { "alias": "formatYear"; "required": false; }; "formatDayHeader": { "alias": "formatDayHeader"; "required": false; }; "formatDayTitle": { "alias": "formatDayTitle"; "required": false; }; "formatMonthTitle": { "alias": "formatMonthTitle"; "required": false; }; "startingDay": { "alias": "startingDay"; "required": false; }; "yearRange": { "alias": "yearRange"; "required": false; }; "onlyCurrentMonth": { "alias": "onlyCurrentMonth"; "required": false; }; "preserveInsignificant": { "alias": "preserveInsignificant"; "required": false; }; "disabledDates": { "alias": "disabledDates"; "required": false; }; "handleTimezone": { "alias": "handleTimezone"; "required": false; }; "appendToBody": { "alias": "appendToBody"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "selectionDone": "selectionDone"; "valueChange": "valueChange"; "calendarNavigated": "calendarNavigated"; "inputBlurred": "inputBlurred"; }, never, never, false, never>; }