"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

require("./index.less");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var __extends = void 0 && (void 0).__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");

    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var Field =
/** @class */
function (_super) {
  __extends(Field, _super);

  function Field() {
    return _super !== null && _super.apply(this, arguments) || this;
  }

  Field.prototype.render = function () {
    var _a = this.props,
        title = _a.title,
        children = _a.children,
        layout = _a.layout,
        split = _a.split;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: (0, _classnames["default"])('m-field', {
        split: split,
        bold: split === 'bold'
      })
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: (0, _classnames["default"])('field-item', {
        horizontal: layout === 'horizontal'
      })
    }, title && /*#__PURE__*/_react["default"].createElement("div", {
      className: "field-title"
    }, title), children));
  };

  Field.defaultProps = {
    title: '',
    layout: 'vertical',
    split: false
  };
  return Field;
}(_react["default"].Component);

var _default = Field;
exports["default"] = _default;