"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getChangeEvent = getChangeEvent;
exports.getModelEvent = getModelEvent;
exports.getOnName = getOnName;
exports.getSlotVNs = getSlotVNs;
exports.hasInputType = hasInputType;
var _xeUtils = _interopRequireDefault(require("xe-utils"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function getOnName(type) {
  return _xeUtils.default.kebabCase(type);
}
function getModelEvent(renderOpts) {
  switch (renderOpts.name) {
    case 'VxeInput':
    case 'VxeTextarea':
    case 'VxeNumberInput':
    case 'VxePasswordInput':
    case 'VxeSelect':
    case 'VxeTreeSelect':
    case 'VxeTableSelect':
    case 'VxeDatePicker':
    case 'VxeDateRangePicker':
    case 'VxeIconPicker':
    case 'VxeColorPicker':
    case 'VxeSlider':
    case 'VxeUpload':
      return 'modelValue';
    case 'select':
      return 'change';
  }
  return 'input';
}
function getChangeEvent(renderOpts) {
  switch (renderOpts.name) {
    case 'input':
    case 'textarea':
    case 'VxeInput':
    case 'VxeTextarea':
    case '$input': // 已废弃
    case '$textarea':
      // 已废弃
      return 'input';
  }
  return 'change';
}
function hasInputType(renderOpts) {
  switch (renderOpts.name) {
    case 'VxeInput':
    case 'VxeNumberInput':
    case 'VxeTextarea':
    case '$input':
    case '$textarea':
      return true;
  }
  return false;
}
function getSlotVNs(vns) {
  if (vns === null || vns === undefined) {
    return [];
  }
  if (_xeUtils.default.isArray(vns)) {
    return vns;
  }
  return [vns];
}