import XEUtils from "xe-utils";
function getOnName(type) {
  return "on" + type.substring(0, 1).toLocaleUpperCase() + type.substring(1);
}
function getModelEvent(renderOpts) {
  switch (renderOpts.name) {
    case "input":
    case "textarea":
      return "input";
    case "select":
      return "change";
  }
  return "update:modelValue";
}
function getChangeEvent(renderOpts) {
  switch (renderOpts.name) {
    case "input":
    case "textarea":
    case "VxeInput":
    case "VxeTextarea":
    case "$input":
    // 已废弃
    case "$textarea":
      return "input";
  }
  return "change";
}
function getSlotVNs(vns) {
  if (XEUtils.isArray(vns)) {
    return vns;
  }
  return vns ? [vns] : [];
}
export {
  getChangeEvent,
  getModelEvent,
  getOnName,
  getSlotVNs
};
