import Checkbox from "./Checkbox";
import ColorPicker from "./ColorPicker";
import DatePicker from "./DatePicker";
import Input from "./Input";
import Radio from "./Radio";
import Select from "./Select";
import InputNumber from "./InputNumber";
import TimePicker from "./TimePicker";
import DateRangePicker from "./DateRangePicker";
import Upload from "./Upload";
import Translation from "./Translation";
import IconSelect from "./IconSelect";
import RecordListWrapper from "./RecordListWrapper";
import Tabs from "./Tabs";

// 表单字段组件映射 增加时需要同步更新 utils 中的 formFieldFilterFuncMap
var formFieldMap = {
  FormItemCheckbox: Checkbox,
  FormItemColorPicker: ColorPicker,
  FormItemDatePicker: DatePicker,
  FormItemInput: Input,
  FormItemRadio: Radio,
  FormItemSelect: Select,
  FormItemInputNumber: InputNumber,
  FormItemPercent: InputNumber,
  FormItemTimePicker: TimePicker,
  'FormItemInput.JSON': Input.JSON,
  'FormItemInput.Phone': Input.Phone,
  'FormItemInput.Mobile': Input.Mobile,
  'FormItemInput.Email': Input.Email,
  'FormItemInput.URL': Input.URL,
  'FormItemInput.Password': Input.Password,
  'FormItemRadio.Group': Radio.Group,
  'FormItemCheckbox.Group': Checkbox.Group,
  FormItemDateRangePicker: DateRangePicker,
  FormItemUpload: Upload,
  FormItemTranslation: Translation,
  FormItemIconSelect: IconSelect,
  FormItemRecordListWrapper: RecordListWrapper,
  FormItemTabs: Tabs
};
var getFieldComponent = function getFieldComponent(fieldComponent) {
  return formFieldMap[fieldComponent];
};
export { getFieldComponent, formFieldMap };