mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
This commit is contained in:
parent
bfacae35fa
commit
1b9e2fe35d
4 changed files with 6 additions and 2 deletions
|
|
@ -142,6 +142,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
|||
|
||||
const checkElement = hasClosestByClassName(event.target, "av__firstcol");
|
||||
if (checkElement) {
|
||||
// TODO
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export const popTextCell = (protyle: IProtyle, cellElement: HTMLElement) => {
|
|||
const type = cellElement.parentElement.parentElement.firstElementChild.children[parseInt(cellElement.getAttribute("data-index")) + 1].getAttribute("data-dtype") as TAVCol;
|
||||
const cellRect = cellElement.getBoundingClientRect();
|
||||
let html = "";
|
||||
if (type === "block") {
|
||||
if (type === "block" || type === "text") {
|
||||
html = `<textarea style="position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 200)}px" class="b3-text-field">${cellElement.textContent}</textarea>`;
|
||||
}
|
||||
document.body.insertAdjacentHTML("beforeend", `<div class="av__mask">
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export const avRender = (element: Element) => {
|
|||
data.rows.forEach((row: IAVRow) => {
|
||||
tableHTML += `<div class="av__row" data-id="${row.id}"><div class="av__firstcol"><svg><use xlink:href="#iconUncheck"></use></svg></div>`;
|
||||
row.cells.forEach((cell, index) => {
|
||||
tableHTML += `<div class="av__cell" data-index="${index}" style="width: ${data.columns[index].width || 200}px;background-color: ${cell.bgColor || ""};color: ${cell.color || ""}">${cell.value}</div>`;
|
||||
tableHTML += `<div class="av__cell" data-index="${index}" style="width: ${data.columns[index].width || 200}px;${cell.bgColor ? `background-color:${cell.bgColor};` : ""}${cell.color ? `color:${cell.color};` : ""}">${cell.renderValue?.content || ""}</div>`;
|
||||
});
|
||||
tableHTML += "<div></div></div>";
|
||||
});
|
||||
|
|
|
|||
3
app/src/types/index.d.ts
vendored
3
app/src/types/index.d.ts
vendored
|
|
@ -825,4 +825,7 @@ interface IAVCell {
|
|||
color: string,
|
||||
bgColor: string,
|
||||
value: string,
|
||||
renderValue: {
|
||||
content: string,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue