"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const XEUtils = require("xe-utils");
const dom = require("./dom.js");
const rowMoveCls = "row--drag-move";
const colMoveClass = "col--drag-move";
function moveRowAnimateToTb(elemList, offsetTop) {
  XEUtils.arrayEach(elemList, (trEl) => {
    trEl.style.transform = `translateY(${offsetTop}px)`;
  });
  requestAnimationFrame(() => {
    XEUtils.arrayEach(elemList, (trEl) => {
      dom.addClass(trEl, rowMoveCls);
      trEl.style.transform = "";
    });
  });
}
function clearRowAnimate(elem, clss) {
  setTimeout(() => {
    if (elem) {
      XEUtils.arrayEach(elem.querySelectorAll(clss.map((cls) => `${cls}.${rowMoveCls}`).join(",")), (elem2) => dom.removeClass(elem2, rowMoveCls));
    }
  }, 500);
}
function moveColAnimateToLr(elemList, offsetLeft) {
  XEUtils.arrayEach(elemList, (trEl) => {
    trEl.style.transform = `translateX(${offsetLeft}px)`;
  });
  requestAnimationFrame(() => {
    XEUtils.arrayEach(elemList, (trEl) => {
      dom.addClass(trEl, colMoveClass);
      trEl.style.transform = "";
    });
  });
}
function clearColAnimate(elem, clss) {
  setTimeout(() => {
    if (elem) {
      XEUtils.arrayEach(elem.querySelectorAll(clss.map((cls) => `${cls}.${rowMoveCls}`).join(",")), (elem2) => dom.removeClass(elem2, colMoveClass));
    }
  }, 500);
}
exports.clearColAnimate = clearColAnimate;
exports.clearRowAnimate = clearRowAnimate;
exports.moveColAnimateToLr = moveColAnimateToLr;
exports.moveRowAnimateToTb = moveRowAnimateToTb;
