@daysnap/horn-ui
Version:
hron ui
30 lines (27 loc) • 852 B
text/typescript
import type { ExtractPropTypes } from 'vue'
import { horCellProps } from '../hor-cell'
import { omit } from '@daysnap/utils'
import { makeBooleanProp, makeStringProp, makeArrayProp, makeNumericProp } from '../utils'
import type { RadioShape } from 'vant'
export const omitHorCellPropsInRadio = omit(horCellProps, [
'value',
'arrow',
'ellipsis',
'formatter',
'lineClamp',
'alignItemCenter',
])
type OptionItem = {
[x: string]: any
}
export const horRadioProps = {
...omitHorCellPropsInRadio,
disabled: makeBooleanProp(false),
checkedColor: makeStringProp('#1989fa'),
shape: makeStringProp<RadioShape>('round'),
options: makeArrayProp<OptionItem>(),
labelKey: makeStringProp('label'),
valueKey: makeStringProp('value'),
modelValue: makeNumericProp(''),
}
export type HorRadioProps = ExtractPropTypes<typeof horRadioProps>