@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
72 lines (71 loc) • 1.91 kB
TypeScript
import { default as React, ReactNode } from 'react';
import { BasicComponent } from '../../utils/typings';
import { CalendarCardDay, CalendarCardMonth, CalendarCardRef, CalendarCardValue } from './types';
export interface CalendarCardProps extends BasicComponent {
/**
* 类型,单个日期 single,多个日期 multiple,日期范围 range,周选择 week
* @default single
*/
type: 'single' | 'multiple' | 'range' | 'week'
/**
* 受控模式下的值,与 onChange 搭配使用
* @default -
*/
value?: CalendarCardValue
/**
* 默认值,单个日期 Date 格式,多个日期/范围选择 Date[] 格式
* @default -
*/
defaultValue?: CalendarCardValue
/**
* 设置周起始日,0 为周日,1 为周一
* @default 1
*/
firstDayOfWeek?: number
/**
* 限制范围开始日期
* @default -
*/
startDate?: Date
/**
* 限制范围结束日期
* @default -
*/
endDate?: Date
/**
* 设置不可选日期
* @default -
*/
disableDay?: (day: CalendarCardDay) => boolean
/**
* 日期信息
* @default -
*/
renderDay?: (day: CalendarCardDay) => ReactNode
/**
* 日期顶部信息
* @default -
*/
renderDayTop?: (day: CalendarCardDay) => ReactNode
/**
* 日期底部信息
* @default -
*/
renderDayBottom?: (day: CalendarCardDay) => ReactNode
/**
* 点击后触发
* @default -
*/
onDayClick?: (day: CalendarCardDay) => void
/**
* 切换月份时触发
* @default -
*/
onPageChange: (data: CalendarCardMonth) => void
/**
* 选择值发生变化时触发
* @default -
*/
onChange: (value: CalendarCardValue) => void
}
export declare const CalendarCard: React.ForwardRefExoticComponent<Partial<CalendarCardProps> & React.RefAttributes<CalendarCardRef>>;