import XEUtils from "xe-utils";
import { removeClass, addClass } from "./dom.mjs";
const rowMoveCls = "row--drag-move";
function moveRowAnimateToTb(elemList, offsetTop) {
  XEUtils.arrayEach(elemList, (trEl) => {
    trEl.style.transform = `translateY(${offsetTop}px)`;
  });
  requestAnimationFrame(() => {
    XEUtils.arrayEach(elemList, (trEl) => {
      addClass(trEl, rowMoveCls);
      trEl.style.transform = "";
    });
  });
}
function clearRowAnimate(elem, clss) {
  setTimeout(() => {
    if (elem) {
      XEUtils.arrayEach(elem.querySelectorAll(clss.map((cls) => `${cls}.${rowMoveCls}`).join(",")), (elem2) => removeClass(elem2, rowMoveCls));
    }
  }, 500);
}
export {
  clearRowAnimate,
  moveRowAnimateToTb
};
