import type { ExtractPropTypes } from 'vue'
import { omit } from '@daysnap/utils'
import { horCellProps } from '../hor-cell'
import { makeArrayProp, makeStringProp, makeNumericProp, makeBooleanProp } from '../utils'

export type HorRadioButtonOptionItem = {
  disabled?: boolean
  label: string
  value: string
  [key: string]: any
}

// 排除hor-cell中的部分props
const partialCellProps = omit(horCellProps, [
  'value',
  'arrow',
  'ellipsis',
  'formatter',
  'lineClamp',
  'alignItemCenter',
])

export const horRadioButtonProps = {
  ...partialCellProps,
  disabled: makeBooleanProp(false),
  span: makeNumericProp('3'), //仅column模式生效
  options: makeArrayProp<HorRadioButtonOptionItem>(),
  valueKey: makeStringProp('value'),
  modelValue: makeStringProp(''),
  cancelable: makeBooleanProp(false),
}

export type HorRadioButtonProps = ExtractPropTypes<typeof horRadioButtonProps>
