import React from 'react'; import Checkbox from './Checkbox'; import { CheckboxGroupProps, RenderIconProps, } from '../../core/checkbox/interface'; import CheckboxGroup from '../../core/checkbox/checkbox-group'; import CheckboxIcon from './CheckboxIcon'; import { SpaceProps } from 'src/core'; import { omit } from 'lodash'; export type RNCheckboxGroupProps = Omit< CheckboxGroupProps & { /** * 是否启用分列布局 * @default false */ split?: boolean; }, 'checkboxComponent' >; const renderIconDefault = ({ size, ...renderIconProps }: RenderIconProps) => { return ; }; const RNCheckboxGroup = ({ renderIcon = renderIconDefault, ...restProps }: RNCheckboxGroupProps) => { const splitProps: SpaceProps | null = restProps.split ? { direction: 'horizontal' as 'vertical' | 'horizontal', wrap: true, gap: 0, style: { marginBottom: -8, }, itemStyle: { width: '50%', marginBottom: 8, }, } : null; return ( ); }; export default RNCheckboxGroup;