@daysnap/horn-ui
Version:
hron ui
32 lines (30 loc) • 819 B
text/typescript
import type { ExtractPropTypes } from 'vue'
import { makeNumberProp, makeStringProp, makeBooleanProp, makeArrayProp } from '../utils'
import type { PropType } from 'vue'
export type CalendarDay = {
value: number
dateTime: string
isOtherDays: boolean
disable: boolean
}
export const horCalendarProps = {
type: makeStringProp<'single' | 'multiple' | 'range'>('single'),
modelValue: makeArrayProp<string>(),
maxRange: makeNumberProp(0),
minDate: {
type: Date,
},
maxDate: {
type: Date,
},
disable: makeBooleanProp(false),
formatDays: {
type: Function as PropType<(v: CalendarDay[]) => CalendarDay[]>,
default: (v: CalendarDay[]) => v,
},
initialValue: {
type: Date,
default: new Date(),
},
}
export type HorCalendarProps = ExtractPropTypes<typeof horCalendarProps>