"use strict";

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

var _configProvider = _interopRequireDefault(require("../config-provider"));

var _base = _interopRequireDefault(require("./base"));

var _tree = _interopRequireDefault(require("./tree"));

var _fixed = _interopRequireDefault(require("./fixed"));

var _selection = _interopRequireDefault(require("./selection"));

var _expanded = _interopRequireDefault(require("./expanded"));

var _virtual = _interopRequireDefault(require("./virtual"));

var _lock = _interopRequireDefault(require("./lock"));

var _list = _interopRequireDefault(require("./list"));

var _sticky = _interopRequireDefault(require("./sticky"));

var _listHeader = _interopRequireDefault(require("./list-header"));

var _listFooter = _interopRequireDefault(require("./list-footer"));

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

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

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; }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var ORDER_LIST = [_fixed["default"], _lock["default"], _selection["default"], _expanded["default"], _tree["default"], _virtual["default"], _list["default"], _sticky["default"]];
var Table = ORDER_LIST.reduce(function (ret, current) {
  ret = current(ret);
  return ret;
}, _base["default"]);
Table.Base = _base["default"];
Table.fixed = _fixed["default"];
Table.lock = _lock["default"];
Table.selection = _selection["default"];
Table.expanded = _expanded["default"];
Table.tree = _tree["default"];
Table.virtual = _virtual["default"];
Table.list = _list["default"];
Table.sticky = _sticky["default"];
Table.GroupHeader = _listHeader["default"];
Table.GroupFooter = _listFooter["default"];

var _default = _configProvider["default"].config(Table, {
  componentName: 'Table',
  transform:
  /* istanbul ignore next */
  function transform(props, deprecated) {
    if ('expandedRowKeys' in props) {
      deprecated('expandedRowKeys', 'openRowKeys', 'Table');

      var _props = props,
          expandedRowKeys = _props.expandedRowKeys,
          others = _objectWithoutProperties(_props, ["expandedRowKeys"]);

      props = _objectSpread({
        openRowKeys: expandedRowKeys
      }, others);
    }

    if ('onExpandedChange' in props) {
      deprecated('onExpandedChange', 'onRowOpen', 'Table');

      var _props2 = props,
          onExpandedChange = _props2.onExpandedChange,
          _others = _objectWithoutProperties(_props2, ["onExpandedChange"]);

      props = _objectSpread({
        onRowOpen: onExpandedChange
      }, _others);
    }

    if ('isLoading' in props) {
      deprecated('isLoading', 'loading', 'Table');

      var _props3 = props,
          isLoading = _props3.isLoading,
          _others2 = _objectWithoutProperties(_props3, ["isLoading"]);

      props = _objectSpread({
        loading: isLoading
      }, _others2);
    }

    if ('indentSize' in props) {
      deprecated('indentSize', 'indent', 'Table');

      var _props4 = props,
          indentSize = _props4.indentSize,
          _others3 = _objectWithoutProperties(_props4, ["indentSize"]);

      props = _objectSpread({
        indent: indentSize
      }, _others3);
    }

    if ('optimization' in props) {
      deprecated('optimization', 'pure', 'Table');

      var _props5 = props,
          optimization = _props5.optimization,
          _others4 = _objectWithoutProperties(_props5, ["optimization"]);

      props = _objectSpread({
        pure: optimization
      }, _others4);
    }

    if ('getRowClassName' in props) {
      deprecated('getRowClassName', 'getRowProps', 'Table');

      var _props6 = props,
          getRowClassName = _props6.getRowClassName,
          getRowProps = _props6.getRowProps,
          _others5 = _objectWithoutProperties(_props6, ["getRowClassName", "getRowProps"]);

      if (getRowClassName) {
        var newGetRowProps = function newGetRowProps() {
          return _objectSpread({
            className: getRowClassName.apply(void 0, arguments)
          }, getRowProps ? getRowProps.apply(void 0, arguments) : {});
        };

        props = _objectSpread({
          getRowProps: newGetRowProps
        }, _others5);
      } else {
        props = _objectSpread({
          getRowProps: getRowProps
        }, _others5);
      }
    }

    if ('getRowProps' in props) {
      deprecated('getRowProps', 'rowProps', 'Table in 1.15.0');

      var _props7 = props,
          _getRowProps = _props7.getRowProps,
          _others6 = _objectWithoutProperties(_props7, ["getRowProps"]);

      props = _objectSpread({
        rowProps: _getRowProps
      }, _others6);
    }

    if ('getCellProps' in props) {
      deprecated('getCellProps', 'cellProps', 'Table in 1.15.0');

      var _props8 = props,
          getCellProps = _props8.getCellProps,
          _others7 = _objectWithoutProperties(_props8, ["getCellProps"]);

      props = _objectSpread({
        cellProps: getCellProps
      }, _others7);
    }

    return props;
  }
});

exports["default"] = _default;