import React from 'react';
import Checkbox from '../../../checkbox';
import ProField from '../../../wau-field';
import { runFunction } from '../../../utils';
import createField from '../../create-field';
import { jsx as _jsx } from "react/jsx-runtime";
const CheckboxGroup = /*#__PURE__*/React.forwardRef(({
  options,
  fieldProps,
  proFieldProps,
  valueEnum,
  ...rest
}, ref) => /*#__PURE__*/_jsx(ProField, {
  ref: ref,
  valueType: "checkbox",
  mode: "edit",
  valueEnum: runFunction(valueEnum, undefined),
  ...rest,
  fieldProps: {
    options,
    ...fieldProps
  },
  ...proFieldProps
}));
CheckboxGroup.displayName = 'CheckboxGroup';
/**
 * 多选框的
 *
 * @param
 */
const ProFormCheckbox = /*#__PURE__*/React.forwardRef(({
  fieldProps,
  children
}, ref) => {
  return /*#__PURE__*/_jsx(Checkbox, {
    ref: ref,
    ...fieldProps,
    children: children
  });
});
ProFormCheckbox.displayName = 'ProFormCheckbox';
const Group = createField(CheckboxGroup);
const WrappedProFormCheckbox = createField(ProFormCheckbox, {
  valuePropName: 'checked'
});
WrappedProFormCheckbox.Group = Group;
export default WrappedProFormCheckbox;