@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
73 lines • 3.33 kB
TypeScript
import { ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
import { AbstractControl, ControlValueAccessor, FormGroup, ValidationErrors, Validator } from '@angular/forms';
import { BsDatepickerDirective } from 'ngx-bootstrap/datepicker';
import { PickedDates } from '../date-picker';
import * as i0 from "@angular/core";
interface DateAndTimeOptions {
showSpinners?: boolean;
showMeridian?: boolean;
showMinutes?: boolean;
showSeconds?: boolean;
}
export type DateType = 'DateAndTime' | 'Date' | 'DateRange' | 'SingleDateRequired' | 'Time';
export declare class DateTimePickerComponent implements ControlValueAccessor, Validator, OnDestroy {
private cd;
minDate: Date;
set _minDate(value: string);
maxDate: Date;
set _maxDate(value: string);
placeholder: string;
dateInputFormat: string;
adaptivePosition: boolean;
size: string;
/**
* Specifies the type of date input.
*
* @param DateAndTime - Display both date and time.
* @param Date - Display only the date without the time.
* @param DateRange - Specify a range of dates.
* @param SingleDateRequired - Require the selection of a single date.
* @param Time - Display only the time without the date.
*
* @defaultValue 'DateAndTime'
*/
dateType: DateType;
config: DateAndTimeOptions;
onDateSelected: EventEmitter<PickedDates>;
date: Date;
form: FormGroup;
defaultPlaceholder: "Select a date…";
datepicker: BsDatepickerDirective;
private previousValue;
private previousTimePickerValues;
private destroy$;
constructor(cd: ChangeDetectorRef);
onChange: (value: string) => void;
onTouched: () => void;
ngOnDestroy(): void;
ngAfterViewInit(): void;
/**
* Control Value Accessor - If form value changes by external factor, update date property and internal form with new value.
*/
writeValue(value: string): void;
registerOnChange(fn: any): void;
registerOnTouched(onTouched: any): void;
setDisabledState(disabled: boolean): void;
validate(_control: AbstractControl): ValidationErrors | null;
previousDay(): void;
nextDay(): void;
hide(): void;
handleMouseWheel(event: WheelEvent): void;
/**
* If internal form changes its value, then combine date and time into one Date and pass its ISO string value to onChange method
* @param dateTime
* @private
*/
private setDatetime;
private verifyDate;
private isInputCleared;
static ɵfac: i0.ɵɵFactoryDeclaration<DateTimePickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DateTimePickerComponent, "c8y-date-time-picker", never, { "_minDate": { "alias": "minDate"; "required": false; }; "_maxDate": { "alias": "maxDate"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "dateInputFormat": { "alias": "dateInputFormat"; "required": false; }; "adaptivePosition": { "alias": "adaptivePosition"; "required": false; }; "size": { "alias": "size"; "required": false; }; "dateType": { "alias": "dateType"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "onDateSelected": "onDateSelected"; }, never, never, true, never>;
}
export {};
//# sourceMappingURL=date-time-picker.component.d.ts.map