import { DatePipe } from '@angular/common'; import { EventEmitter, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { PickerOptions } from './options'; import { PickerComponent } from './picker.component'; export declare const FORMAT: any; export declare type DatePickerType = 'date-ym' | 'date' | 'datetime' | 'time'; export declare type FORMAT_TYPE = string | { format: string; yu?: string; Mu?: string; du?: string; hu?: string; mu?: string; }; /** * 日期时间选择器 */ export declare class DatePickerComponent implements OnInit, ControlValueAccessor, OnDestroy, OnChanges { private datePipe; private initFlag; private onChange; private onTouched; _pickerInstance: PickerComponent; _value: Date; _groups: any[]; _selected: number[]; /** * 最小时间范围 * - 当前只限定年月日,暂不包括时间范围 */ min: Date; /** * 最大时间范围 * - 当前只限定年月日,暂不包括时间范围 */ max: Date; /** * 类型 * + `date-ym` 年月 * + `date` 日期 * + `datetime` 日期&时间(不包括秒) * + `time` 时间(不包括秒) */ type: DatePickerType; private _format; /** * 日期格式化代码,实际是采用 DatePipe,所有代码内容和它一样 */ set format(v: FORMAT_TYPE); /** 配置项 */ options: PickerOptions; /** 当options.type=='form'时,占位符文本 */ placeholder: string; title: string; disabled: boolean; /** 确认后回调 */ readonly change: EventEmitter; /** 列变更时回调 */ readonly groupChange: EventEmitter; /** 取消后回调 */ readonly cancel: EventEmitter; /** 显示时回调 */ readonly show: EventEmitter; /** 隐藏后回调 */ readonly hide: EventEmitter; constructor(datePipe: DatePipe); private genGroups; private genDateGroups; private genDateTimeGroups; private genValueBySelected; ngOnDestroy(): void; private getFormatDate; _onCityChange(data: any): void; _onCityGroupChange(res: any): void; _onCityCancelChange(): void; ngOnInit(): void; ngOnChanges(): void; /** 服务于Service,并无实际意义 */ _triggerShow(): void; _onShow(): void; _onHide(): void; writeValue(value: Date): void; registerOnChange(fn: (_: any) => {}): void; registerOnTouched(fn: () => {}): void; setDisabledState(isDisabled: boolean): void; }