Vanessa 2024-01-14 18:02:14 +08:00
parent eb18429d6e
commit 1544786bb6
5 changed files with 96 additions and 8 deletions

View file

@ -661,6 +661,9 @@ export const getPositionByCellElement = (cellElement: HTMLElement) => {
let celIndex = -2;
while (cellElement) {
cellElement = cellElement.previousElementSibling as HTMLElement;
if (cellElement && cellElement.classList.contains("av__colsticky")) {
cellElement = cellElement.lastElementChild as HTMLElement;
}
celIndex++;
}
return {rowIndex, celIndex};

View file

@ -23,6 +23,10 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
if (!rowElement) {
return false;
}
nodeElement.querySelectorAll(".av__cell--active").forEach(item => {
item.classList.remove("av__cell--active");
item.querySelector(".av__drag-fill")?.remove();
})
if (event.key === "Escape") {
selectCellElement.classList.remove("av__cell--select");
selectRow(rowElement.querySelector(".av__firstcol"), "select");

View file

@ -12,7 +12,7 @@ export const selectRow = (checkElement: Element, type: "toggle" | "select" | "un
}
const useElement = checkElement.querySelector("use");
if (rowElement.classList.contains("av__row--header") || type === "unselectAll") {
if ("#iconCheck" === useElement.getAttribute("xlink:href")) {
if ("#iconCheck" === useElement.getAttribute("xlink:href") || type === "unselectAll") {
rowElement.parentElement.querySelectorAll(".av__firstcol").forEach(item => {
item.querySelector("use").setAttribute("xlink:href", "#iconUncheck");
const rowItemElement = hasClosestByClassName(item, "av__row");