import { ElementRef, ViewContainerRef, Renderer2, ComponentFactoryResolver, NgZone, TemplateRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms'; import { NgbDatepickerNavigateEvent } from './datepicker'; import { DayTemplateContext } from './datepicker-day-template-context'; import { NgbDateParserFormatter } from './ngb-date-parser-formatter'; import { PlacementArray } from '../util/positioning'; import { NgbFocusTrapFactory } from '../util/focus-trap'; import { NgbDateStruct } from './ngb-date-struct'; import { NgbDateAdapter } from './ngb-date-adapter'; import { NgbCalendar } from './ngb-calendar'; import { NgbDatepickerService } from './datepicker-service'; /** * A directive that makes it possible to have datepickers on input fields. * Manages integration with the input field itself (data entry) and ngModel (validation etc.). */ export declare class NgbInputDatepicker implements OnChanges, OnDestroy, ControlValueAccessor, Validator { private _parserFormatter; private _elRef; private _vcRef; private _renderer; private _cfr; private _service; private _calendar; private _ngbDateAdapter; private _focusTrapFactory; private _cRef; private _disabled; private _model; private _zoneSubscription; private _focusTrap; /** * Indicates whether the datepicker popup should be closed automatically after date selection or not. * If the value is 'false', the popup can be closed via 'close()' or 'toggle()' methods. * * @since 1.1.0 */ autoClose: boolean; /** * Reference for the custom template for the day display */ dayTemplate: TemplateRef; /** * Number of months to display */ displayMonths: number; /** * First day of the week. With default calendar we use ISO 8601: 1=Mon ... 7=Sun */ firstDayOfWeek: number; /** * Callback to mark a given date as disabled. * 'Current' contains the month that will be displayed in the view */ markDisabled: (date: NgbDateStruct, current: { year: number; month: number; }) => boolean; /** * Min date for the navigation. If not provided will be 10 years before today or `startDate` */ minDate: NgbDateStruct; /** * Max date for the navigation. If not provided will be 10 years from today or `startDate` */ maxDate: NgbDateStruct; /** * Navigation type: `select` (default with select boxes for month and year), `arrows` * (without select boxes, only navigation arrows) or `none` (no navigation at all) */ navigation: 'select' | 'arrows' | 'none'; /** * The way to display days that don't belong to current month: `visible` (default), * `hidden` (not displayed) or `collapsed` (not displayed with empty space collapsed) */ outsideDays: 'visible' | 'collapsed' | 'hidden'; /** * Placement of a datepicker popup accepts: * "top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right", * "left", "left-top", "left-bottom", "right", "right-top", "right-bottom" * and array of above values. */ placement: PlacementArray; /** * Whether to display days of the week */ showWeekdays: boolean; /** * Whether to display week numbers */ showWeekNumbers: boolean; /** * Date to open calendar with. * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec. * If nothing or invalid date provided, calendar will open with current month. * Use 'navigateTo(date)' as an alternative */ startDate: { year: number; month: number; }; /** * A selector specifying the element the datepicker popup should be appended to. * Currently only supports "body". */ container: string; /** * An event fired when user selects a date using keyboard or mouse. * The payload of the event is currently selected NgbDateStruct. * * @since 1.1.1 */ dateSelect: EventEmitter; /** * An event fired when navigation happens and currently displayed month changes. * See NgbDatepickerNavigateEvent for the payload info. */ navigate: EventEmitter; disabled: any; private _onChange; private _onTouched; private _validatorChange; constructor(_parserFormatter: NgbDateParserFormatter, _elRef: ElementRef, _vcRef: ViewContainerRef, _renderer: Renderer2, _cfr: ComponentFactoryResolver, ngZone: NgZone, _service: NgbDatepickerService, _calendar: NgbCalendar, _ngbDateAdapter: NgbDateAdapter, _focusTrapFactory: NgbFocusTrapFactory); registerOnChange(fn: (value: any) => any): void; registerOnTouched(fn: () => any): void; registerOnValidatorChange(fn: () => void): void; setDisabledState(isDisabled: boolean): void; validate(c: AbstractControl): { [key: string]: any; }; writeValue(value: any): void; manualDateChange(value: string, updateView?: boolean): void; isOpen(): boolean; /** * Opens the datepicker with the selected date indicated by the ngModel value. */ open(): void; /** * Closes the datepicker popup. */ close(): void; /** * Toggles the datepicker popup (opens when closed and closes when opened). */ toggle(): void; /** * Navigates current view to provided date. * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec. * If nothing or invalid date provided calendar will open current month. * Use 'startDate' input as an alternative */ navigateTo(date?: { year: number; month: number; }): void; onBlur(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private _applyDatepickerInputs(datepickerInstance); private _applyPopupStyling(nativeElement); private _subscribeForDatepickerOutputs(datepickerInstance); private _writeModelValue(model); private _fromDateStruct(date); }