jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
53 lines (52 loc) • 1.94 kB
TypeScript
import type { LocaleProps, Schema, SchemaClassName, ThemeProps } from 'jamis-core';
import type { Moment } from 'moment';
import type { CalendarViewMode } from './types';
export type DateRangeValue<T extends number = number> = T extends number ? 'today' | 'yesterday' | 'tomorrow' | 'prevweek' | 'thisweek' | 'thismonth' | 'prevmonth' | 'prevquarter' | 'thisquarter' | 'prevyear' | 'lastyear' | 'halfyearago' | 'thisyear' | 'halfyearlater' | `${T}${'daysago' | 'dayslater' | 'weeksago' | 'weekslater' | 'monthsago' | 'monthslater' | 'quartersago' | 'quarterslater' | 'yearsago' | 'yearslater'}` : never;
export type DateRanges = Array<DateRangeValue | {
label: string;
value?: DateRangeValue;
startDate?: Moment;
endDate?: Moment;
}>;
export interface DateRangePickerProps extends ThemeProps, LocaleProps {
borderMode?: 'full' | 'half' | 'none';
clearable?: boolean;
closeOnSelect?: boolean;
data?: any;
dateFormat?: string;
delimiter: string;
disabled?: boolean;
embed?: boolean;
endPlaceholder?: string;
format: string;
hasError?: boolean;
inputFormat?: string;
joinValues: boolean;
label?: string | false | Schema;
maxDate?: moment.Moment;
maxDuration?: moment.Duration;
minDate?: moment.Moment;
minDuration?: moment.Duration;
overlayPlacement: string;
popoverClassName?: string;
popOverContainer?: any;
ranges?: DateRanges | string;
rangesPosition?: 'picker' | 'input';
rangesClassName?: SchemaClassName;
rangesRefDate?: Moment;
resetValue?: any;
startPlaceholder?: string;
theme?: any;
timeFormat?: string;
type?: string;
utc?: boolean;
value?: any;
viewMode?: CalendarViewMode;
/** 是否开启游标动画 */
animation?: boolean;
pickerInputClassName?: SchemaClassName;
onBlur?: Function;
onChange: (value: any) => void;
onFocus?: Function;
onRef?: any;
}