jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/node_modules/antd-mini/es/Calendar/props.d.ts

174 lines
4.0 KiB
TypeScript
Raw Normal View History

2024-12-01 11:56:54 +00:00
import { IBaseProps } from '../_util/base';
export interface CalendarDate {
year: number;
month: number;
date: number;
2024-11-10 07:01:22 +00:00
}
2024-12-01 11:56:54 +00:00
export declare const defaultLocaleText: {
weekdayNames: string[];
title: string;
today: string;
start: string;
end: string;
startAndEnd: string;
};
export interface LocaleText {
/**
*
* ['一', '二', '三', '四', '五', '六', '日']
*/
weekdayNames: string[];
/**
* 'YYYY年MM月'
*/
title: string;
/**
* '今日'
*/
today: string;
/**
* '开始'
*/
start: string;
/**
* '结束'
*/
startAndEnd: string;
/**
* / '开始/结束'
*/
end: string;
2024-11-10 07:01:22 +00:00
}
2024-12-01 11:56:54 +00:00
export interface CellState {
/**
*
*/
className?: string;
/**
*
*/
disabled: boolean;
/**
*
*/
top?: {
label: string;
className?: string;
};
/**
*
*/
bottom?: {
label: string;
className?: string;
};
/**
*
*/
time: number;
/**
*
*/
date: number;
/**
*
*/
isSelected: boolean;
/**
*
*/
isSelectedBegin: boolean;
/**
*
*/
isSelectedEnd: boolean;
/**
*
*/
isRowBegin: boolean;
isRowEnd: boolean;
inThisMonth: boolean;
/**
*
*/
isRange: boolean;
index: number;
}
export type CalendarValue = number | number[];
export type SelectionMode = 'single' | 'range';
2024-11-10 07:01:22 +00:00
export interface ICalendarProps extends IBaseProps {
2024-12-01 11:56:54 +00:00
/**
*
*/
defaultValue?: CalendarValue;
/**
*
*/
value?: CalendarValue;
/**
* , 'range'
*/
selectionMode?: SelectionMode;
/**
* 3
*
* @default [, 3]
*/
monthRange?: [number, number];
/**
* 'Sunday'
*/
weekStartsOn?: 'Sunday' | 'Monday';
/**
*
*/
localeText?: Partial<LocaleText>;
/**
*
*/
changedScrollIntoView?: boolean;
/**
*
*/
showSelectableDatesOnly?: boolean;
/**
*
*/
onChange?: (date: CalendarValue) => void;
/**
* onFormatter
* @param cell
* @param currentValue value
* @returns
*/
onFormatter?: (cell: Pick<CellState, 'className' | 'disabled' | 'top' | 'bottom' | 'time' | 'isSelectedBegin' | 'isSelectedEnd' | 'isSelected'>, currentValue: CalendarValue) => Pick<CellState, 'disabled' | 'top' | 'bottom'>;
/**
* onMonthFormatter
* @param month
* @returns
*/
onMonthFormatter?: (month: any) => {
title?: string;
className?: string;
};
2024-11-10 07:01:22 +00:00
}
2024-12-01 11:56:54 +00:00
export declare const CalendarDefaultProps: {
defaultValue: any;
value: any;
selectionMode: string;
monthRange: [number, number];
weekStartsOn: string;
localeText: {
weekdayNames: string[];
title: string;
today: string;
start: string;
end: string;
startAndEnd: string;
};
onFormatter: any;
onMonthFormatter: any;
changedScrollIntoView: any;
showSelectableDatesOnly: boolean;
};