"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _checkbox = _interopRequireDefault(require("../../../checkbox"));
var _wauField = _interopRequireDefault(require("../../../wau-field"));
var _utils = require("../../../utils");
var _createField = _interopRequireDefault(require("../../create-field"));
var _jsxRuntime = require("react/jsx-runtime");
const CheckboxGroup = /*#__PURE__*/_react.default.forwardRef(({
  options,
  fieldProps,
  proFieldProps,
  valueEnum,
  ...rest
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_wauField.default, {
  ref: ref,
  valueType: "checkbox",
  mode: "edit",
  valueEnum: (0, _utils.runFunction)(valueEnum, undefined),
  ...rest,
  fieldProps: {
    options,
    ...fieldProps
  },
  ...proFieldProps
}));
CheckboxGroup.displayName = 'CheckboxGroup';
/**
 * 多选框的
 *
 * @param
 */
const ProFormCheckbox = /*#__PURE__*/_react.default.forwardRef(({
  fieldProps,
  children
}, ref) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_checkbox.default, {
    ref: ref,
    ...fieldProps,
    children: children
  });
});
ProFormCheckbox.displayName = 'ProFormCheckbox';
const Group = (0, _createField.default)(CheckboxGroup);
const WrappedProFormCheckbox = (0, _createField.default)(ProFormCheckbox, {
  valuePropName: 'checked'
});
WrappedProFormCheckbox.Group = Group;
var _default = WrappedProFormCheckbox;
exports.default = _default;