"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
var _react = _interopRequireDefault(require("react"));
var _renderChild = _interopRequireDefault(require("../common-table/components/render-child"));
var _variables = require("../../variables");
require("./index.scss");
var _excluded = ["displayName", "isRequired", "fieldName", "style", "formField"]; //这是过滤器字段
// import BizItem from '../field/biz-item';
var FormItem = _form["default"].Item;
var FilterField = /*#__PURE__*/function (_React$Component) {
  (0, _inheritsLoose2["default"])(FilterField, _React$Component);
  function FilterField(props) {
    var _this;
    _this = _React$Component.call(this, props) || this;
    _this.onChange = function (value) {
      console.log(value);
    };
    _this.state = {
      value: ''
    };
    return _this;
  }
  var _proto = FilterField.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      displayName = _this$props.displayName,
      isRequired = _this$props.isRequired,
      fieldName = _this$props.fieldName,
      style = _this$props.style,
      formField = _this$props.formField,
      otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded);
    // console.log(otherProps)
    var init = formField.init,
      getValue = formField.getValue;
    var formItemLayout = {
      labelCol: {
        span: 8
      },
      wrapperCol: {
        span: 14
      }
    };
    var labelAlign = 'left';
    return /*#__PURE__*/_react["default"].createElement(FormItem, (0, _extends2["default"])({
      className: _variables.bizCssPrefix + '-filter-field',
      style: style,
      colon: true,
      hasFeedback: true,
      name: fieldName
    }, formItemLayout, {
      labelAlign: labelAlign,
      label: displayName,
      required: isRequired,
      requiredMessage: "\u8BF7\u8F93\u5165" + displayName
    }), /*#__PURE__*/_react["default"].createElement(_renderChild["default"], (0, _extends2["default"])({}, init(fieldName, {
      rules: {
        required: isRequired,
        message: "\u8BF7\u8F93\u5165" + displayName
      }
    }), {
      value: getValue(fieldName)
    }, otherProps)));
  };
  return FilterField;
}(_react["default"].Component);
FilterField.displayName = 'FilterField';
FilterField.defaultProps = {
  isRequired: false,
  placeholder: '',
  isDisabled: false
};
var _default = FilterField;
exports["default"] = _default;