import XEUtils from "xe-utils";
import { VxeUI } from "../../../../@vxe-ui/core/es/index.esm.mjs";
import DomZIndex from "../../../../dom-zindex/es/index.esm.mjs";
const { getConfig } = VxeUI;
function isEnableConf(conf) {
  return conf && conf.enabled !== false;
}
function isEmptyValue(cellValue) {
  return cellValue === null || cellValue === void 0 || cellValue === "";
}
function parseFile(file) {
  const name = file.name;
  const tIndex = XEUtils.lastIndexOf(name, ".");
  const type = name.substring(tIndex + 1, name.length).toLowerCase();
  const filename = name.substring(0, tIndex);
  return { filename, type };
}
function nextZIndex() {
  return DomZIndex.getNext();
}
function getLastZIndex() {
  return DomZIndex.getCurrent();
}
function hasChildrenList(item) {
  return item && item.children && item.children.length > 0;
}
function getFuncText(content, args) {
  if (XEUtils.eqNull(content)) {
    return "";
  }
  const translate = getConfig().translate;
  return `${translate ? translate("" + content, args) : content}`;
}
function formatText(value, placeholder) {
  return "" + (isEmptyValue(value) ? placeholder ? getConfig().emptyCell : "" : value);
}
function eqEmptyValue(cellValue) {
  return cellValue === "" || XEUtils.eqNull(cellValue);
}
export {
  eqEmptyValue,
  formatText,
  getFuncText,
  getLastZIndex,
  hasChildrenList,
  isEmptyValue,
  isEnableConf,
  nextZIndex,
  parseFile
};
