"use strict";

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

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

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/**
 * Table.Column
 * @order 0
 * */
var Column =
/*#__PURE__*/
function (_React$Component) {
  _inherits(Column, _React$Component);

  function Column() {
    _classCallCheck(this, Column);

    return _possibleConstructorReturn(this, _getPrototypeOf(Column).apply(this, arguments));
  }

  _createClass(Column, [{
    key: "render",
    value: function render() {
      return null;
    }
  }]);

  return Column;
}(_react["default"].Component);

exports["default"] = Column;

_defineProperty(Column, "propTypes", {
  /**
   * 指定列对应的字段，支持`a.b`形式的快速取值
   */
  dataIndex: _propTypes["default"].string,

  /**
   * 行渲染的逻辑
   * value, rowIndex, record, context四个属性只可读不可被更改
   * Function(value, index, record) => Element
   */
  cell: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].node, _propTypes["default"].func]),

  /**
   * 表头显示的内容
   */
  title: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].node, _propTypes["default"].func]),

  /**
   * 是否支持排序
   */
  sortable: _propTypes["default"].bool,

  /**
   * 未指定列升降序时，首次点击返回的顺序
   */
  initialOrder: _propTypes["default"].oneOf(['asc', 'desc']),

  /**
   * 列宽，注意在锁列的情况下一定需要配置宽度
   */
  width: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),

  /**
   * 单元格的对齐方式
   */
  align: _propTypes["default"].oneOf(['left', 'center', 'right']),

  /**
   * 单元格标题的对齐方式, 不配置默认读取align值
   */
  alignHeader: _propTypes["default"].oneOf(['left', 'center', 'right']),

  /**
   * 生成标题过滤的菜单, 格式为`[{label:'xxx', value:'xxx'}]`
   */
  filters: _propTypes["default"].arrayOf(_propTypes["default"].shape({
    label: _propTypes["default"].string,
    value: _propTypes["default"].oneOfType([_propTypes["default"].node, _propTypes["default"].string])
  })),

  /**
   * 过滤的模式是单选还是多选
   */
  filterMode: _propTypes["default"].oneOf(['single', 'multiple']),

  /**
   * filter 模式下传递给 Menu 菜单的属性， 默认继承 `Menu` 组件的API
   * @property {Boolean} subMenuSelectable 默认为`false` subMenu是否可选择
   * @property {Boolean} isSelectIconRight 默认为`false` 是否将选中图标居右。注意：SubMenu 上的选中图标一直居左，不受此API控制
   */
  filterMenuProps: _propTypes["default"].object,

  /**
   * 是否支持锁列,可选值为`left`,`right`, `true`
   */
  lock: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string]),

  /**
   * 是否支持列宽调整, 当该值设为true，table的布局方式会修改为fixed.
   */
  resizable: _propTypes["default"].bool
});

_defineProperty(Column, "contextTypes", {
  parent: _propTypes["default"].any
});

_defineProperty(Column, "defaultProps", {
  cell: function cell(value) {
    return value;
  },
  filterMode: 'multiple',
  filterMenuProps: {
    subMenuSelectable: false
  },
  initialOrder: 'desc',
  resizable: false
});

_defineProperty(Column, "_typeMark", 'column');