"use strict";

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

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

var _util = require("../util");

var _tag = _interopRequireDefault(require("./tag"));

var _tagGroup = _interopRequireDefault(require("./tag-group"));

var _selectable = _interopRequireDefault(require("./selectable"));

var _closeable = _interopRequireDefault(require("./closeable"));

var _colorable = _interopRequireDefault(require("./colorable"));

var _tabletag = _interopRequireDefault(require("./tabletag"));

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

var ConfigTag = _configProvider["default"].config(_tag["default"], {
  transfrom:
  /* istanbul ignore next */
  function transfrom(props, deprecated) {
    var shape = props.shape,
        type = props.type;

    if (shape === 'selectable') {
      deprecated('shape=selectable', 'Tag.Selectable', 'Tag');
    }

    if (shape === 'deletable') {
      deprecated('shape=deletable', 'Tag.Closeable', 'Tag');
    }

    if (shape === 'link') {
      deprecated('shape=link', '<Tag><a href="x">x</a></Tag>', 'Tag');
    }

    if (shape === 'readonly' || shape === 'interactive') {
      _util.log.warning("Warning: [ shape=".concat(shape, " ] is deprecated at [ Tag ]"));
    }

    if (type === 'secondary') {
      _util.log.warning('Warning: [ type=secondary ] is deprecated at [ Tag ]');
    }

    ['count', 'marked', 'value', 'onChange'].forEach(function (key) {
      if (key in props) {
        _util.log.warning("Warning: [ ".concat(key, " ] is deprecated at [ Tag ]"));
      }
    });

    if ('selected' in props || 'defaultSelected' in props) {
      _util.log.warning('Warning: [ selected|defaultSelected  ] is deprecated at [ Tag ], use [ checked|defaultChecked ] at [ Tag.Selectable ] instead of it');
    }

    if ('closed' in props) {
      _util.log.warning('Warning: [ closed  ] is deprecated at [ Tag ], use [ onClose ] at [ Tag.Closeable ] instead of it');
    }

    if ('onSelect' in props) {
      deprecated('onSelect', '<Tag.Selectable onChange/>', 'Tag');
    }

    if ('afterClose' in props) {
      _util.log.warning('Warning: [ afterClose  ] is deprecated at [ Tag ], use [ afterClose ] at [ Tag.Closeable ] instead of it');
    }

    return props;
  }
});

ConfigTag.Group = _configProvider["default"].config(_tagGroup["default"]);
ConfigTag.Selectable = _configProvider["default"].config(_selectable["default"]);
ConfigTag.Colorable = _configProvider["default"].config(_colorable["default"]);
ConfigTag.TableTag = _configProvider["default"].config(_tabletag["default"]); // 有的地方叫做 Closeable 有的地方用Closeable, 为了保持兼容 文档类出现 Closeable, Closeable可以继续用

ConfigTag.Closable = _configProvider["default"].config(_closeable["default"]);
ConfigTag.Closeable = ConfigTag.Closable;
var _default = ConfigTag;
exports["default"] = _default;