fundamental-ngx
Version:
SAP Fiori Fundamentals, implemented in Angular
109 lines (108 loc) • 4.31 kB
TypeScript
import { OnInit, ElementRef, EventEmitter, OnDestroy } from '@angular/core';
import { CalendarDay } from '../calendar/calendar.component';
import { ControlValueAccessor } from '@angular/forms';
import { Subject } from 'rxjs';
import { TimeObject } from '../time/time-object';
import { TimeComponent } from '../time/time.component';
/**
* The datetime picker component is an opinionated composition of the fd-popover,
* fd-calendar and fd-time components to accomplish the UI pattern for picking a date and time.
*/
export declare class DatetimePickerComponent implements OnInit, OnDestroy, ControlValueAccessor {
private elRef;
/** @hidden Reference to the inner time component. */
timeComponent: TimeComponent;
/** Placeholder for the inner input element. */
placeholder: string;
/** Whether the component should be in compact mode. */
compact: boolean;
/** Whether the time component should be meridian (am/pm). */
meridian: boolean;
/** Whether the component is disabled. */
disabled: boolean;
/** Whether the time component shows spinners for changing the time. */
spinners: boolean;
/** Whether the time component shows seconds. */
displaySeconds: boolean;
/** Whether to perform visual validation on the picker input. */
validate: boolean;
/** Current selected date. Two-way binding is supported. */
date: Date;
/** Whether the popover is open. Two-way binding is supported. */
isOpen: boolean;
/** Event emitted when the date changes. This can be a time or day change. */
readonly dateChange: EventEmitter<Date>;
/** Event emitted when the day changes from the calendar. */
readonly calendarChange: EventEmitter<Date>;
/** Event emitted when the time changes from the time component. */
readonly timeChange: EventEmitter<Date>;
/** Event emitted when popover closes. */
readonly onClose: EventEmitter<Date>;
/**
* @hidden Date of the input field. Internal use.
* For programmatic selection, use two-way binding on the date input.
*/
inputFieldDate: any;
/** @hidden The Time object which interacts with the inner Time component. Internal use. */
isInvalidDateInput: boolean;
/** @hidden Observable used internally. */
dateFromInput: Subject<string>;
/** @hidden The Time object which interacts with the inner Time component. Internal use. */
time: TimeObject;
/** @hidden The CalendarDay object which interacts with the inner Calendar component. Internal use. */
selectedDay: CalendarDay;
/** Subscription of the dateFromInput. */
private dateFromInputSubscription;
/** The disableFunction for the calendar. */
startingDayOfWeek: number;
/** Aria label for the datetime picker input. */
datetimeInputLabel: string;
/** Aria label for the button to show/hide the calendar. */
displayDatetimeToggleLabel: string;
disableFunction: (d: any) => boolean;
/** The blockFunction for the calendar. */
blockFunction: (d: any) => boolean;
disableRangeStartFunction: (d: any) => boolean;
disableRangeEndFunction: (d: any) => boolean;
blockRangeStartFunction: (d: any) => boolean;
blockRangeEndFunction: (d: any) => boolean;
/** @hidden */
onChange: any;
/** @hidden */
onTouched: any;
/** Toggles the popover. */
togglePopover(): void;
/** Opens the popover. */
openPopover(): void;
/** Closes the popover */
closePopover(): void;
updatePickerInputHandler(d: any): void;
/** @hidden */
isInvalidDateInputHandler(e: any): void;
/** @hidden */
inputValueChange(e: any): void;
/** @hidden */
onEscapeKeydownHandler(): void;
/** @hidden */
onGlobalClick(event: MouseEvent): void;
/** @hidden */
ngOnInit(): void;
/** @hidden */
ngOnDestroy(): void;
/** @hidden */
constructor(elRef: ElementRef);
/** @hidden */
registerOnChange(fn: (selected: any) => {
void: any;
}): void;
/** @hidden */
registerOnTouched(fn: any): void;
/** @hidden */
setDisabledState(isDisabled: boolean): void;
/** @hidden */
writeValue(selected: Date): void;
/** @hidden */
setTime(fireEvents?: boolean): void;
/** @hidden */
focusArrowLeft(): void;
}