UNPKG

@daysnap/horn-ui

Version:

hron ui

32 lines (28 loc) 933 B
import type { ExtractPropTypes } from 'vue' import { horCellProps } from '../hor-cell' import { omit } from '@daysnap/utils' import { makeBooleanProp, makeNumericProp, makeStringProp, makeArrayProp } from '../utils' import type { CheckerShape } from 'vant/lib/checkbox/Checker' export const omitHorCellPropsInCheckbox = omit(horCellProps, [ 'value', 'arrow', 'ellipsis', 'formatter', 'lineClamp', 'alignItemCenter', ]) type OptionItem = { [x: string]: any } export const horCheckboxProps = { ...omitHorCellPropsInCheckbox, disabled: makeBooleanProp(false), max: makeNumericProp(0), checkedColor: makeStringProp('#1989fa'), shape: makeStringProp<CheckerShape>('round'), options: makeArrayProp<OptionItem>(), labelKey: makeStringProp('label'), valueKey: makeStringProp('value'), modelValue: makeArrayProp<string | number>(), } export type HorCheckboxProps = ExtractPropTypes<typeof horCheckboxProps>