@alauda-fe/common
Version:
Alauda frontend team common codes.
56 lines (55 loc) • 2.64 kB
TypeScript
import { DateNavRange, TooltipDirective, DisabledTimeFn } from '@alauda/ui';
import { ChangeDetectorRef, OnInit } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { Dayjs } from 'dayjs';
import { TranslateService } from '../../translate/public-api';
import { Options, PickerTimeRange } from './type';
import * as i0 from "@angular/core";
export declare class DateRangePickerComponent implements OnInit, ControlValueAccessor {
readonly translate: TranslateService;
private readonly cdr;
options: Options;
format: string;
mode: string;
tagActive: boolean;
customInputWidth: string;
enableDisableTime: boolean;
tip: TooltipDirective;
rangeValue: Dayjs[];
get isCustom(): boolean;
get ranges(): PickerTimeRange[];
finalOptions: Options;
CUSTOM: string;
selectedRange: PickerTimeRange;
CUSTOM_RANGE: PickerTimeRange;
value: PickerTimeRange;
inputWidth: string;
private onChange;
onBlur: (value: PickerTimeRange) => void;
constructor(translate: TranslateService, cdr: ChangeDetectorRef);
writeValue(obj: PickerTimeRange): void;
registerOnChange(fn: () => void): void;
registerOnTouched(fn: () => void): void;
ngOnInit(): void;
cancel(): void;
submitRange(range: PickerTimeRange, rangeValue?: Dayjs[]): void;
setInputWidth(label: string): void;
selectRange(range: PickerTimeRange): void;
formatValue(value: PickerTimeRange, _locale: string): string;
formatCustomValue(value: Dayjs[]): string;
getDisabledDate: (options: Options) => (date: Dayjs, navType: DateNavRange, startDate: Dayjs) => boolean;
getMinMaxDate: (startDate?: Dayjs) => {
minValue: number;
maxValue: number;
};
/**
* 禁用时间存在 bug 具体查看 https://jira.alauda.cn/browse/AIT-52471 描述
* 可通过 enableDisableTime 开启 默认关闭,如果选择的 end 比 start 会对调
*/
disabledTime: () => {
left: DisabledTimeFn;
right: DisabledTimeFn;
};
static ɵfac: i0.ɵɵFactoryDeclaration<DateRangePickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DateRangePickerComponent, "acl-date-range-picker", never, { "options": { "alias": "options"; "required": false; }; "format": { "alias": "format"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "tagActive": { "alias": "tagActive"; "required": false; }; "customInputWidth": { "alias": "customInputWidth"; "required": false; }; "enableDisableTime": { "alias": "enableDisableTime"; "required": false; }; }, {}, never, never, true, never>;
}