import cx from 'classnames'; import { ICheckboxGroupProps, CheckboxGroup } from '../../checkbox'; import { FormField, IFormFieldChildProps } from '../Field'; import { IFormComponentProps } from '../shared'; import { $MergeParams } from '../utils'; export type IFormCheckboxGroupFieldProps = IFormComponentProps< T[], Omit, 'value'> > & { children?: React.ReactNode; }; function renderCheckboxGroup( childProps: IFormFieldChildProps, props: IFormCheckboxGroupFieldProps ) { return ( {props.children} ); } const DEFAULT_VALUE = [] as any[]; export function FormCheckboxGroupField( props: IFormCheckboxGroupFieldProps ) { const { className, ...rest } = props; return ( >).defaultValue || DEFAULT_VALUE } > {childProps => renderCheckboxGroup(childProps, props)} ); }