mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-27 01:14:07 +01:00
This commit is contained in:
parent
76ac9912dc
commit
fa4d66dcce
5 changed files with 145 additions and 23 deletions
|
|
@ -130,6 +130,18 @@ export const genCellValue = (colType: TAVCol, value: string | any) => {
|
|||
checked: true
|
||||
}
|
||||
};
|
||||
} else if (colType === "date") {
|
||||
cellValue = {
|
||||
type: colType,
|
||||
date: {
|
||||
content: null,
|
||||
isNotEmpty: false,
|
||||
content2: null,
|
||||
isNotEmpty2: false,
|
||||
hasEndDate: false,
|
||||
isNotTime: true,
|
||||
}
|
||||
};
|
||||
}
|
||||
} else if (typeof value === "undefined" || !value) {
|
||||
if (colType === "number") {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
|
|||
if (!rowElement) {
|
||||
return false;
|
||||
}
|
||||
if (event.key === "Backspace" || event.key === "Delete") {
|
||||
updateCellsValue(protyle, nodeElement, undefined, Array.from(nodeElement.querySelectorAll(".av__cell--active, .av__cell--select")));
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
// 复制、粘贴
|
||||
if (!event.ctrlKey && !event.metaKey) {
|
||||
nodeElement.querySelectorAll(".av__cell--active").forEach(item => {
|
||||
|
|
@ -41,11 +46,6 @@ export const avKeydown = (event: KeyboardEvent, nodeElement: HTMLElement, protyl
|
|||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
if (event.key === "Backspace" || event.key === "Delete") {
|
||||
updateCellsValue(protyle, nodeElement, undefined, [selectCellElement]);
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
let newCellElement;
|
||||
if (event.key === "ArrowLeft" || matchHotKey("⇧⇥", event)) {
|
||||
const previousRowElement = rowElement.previousElementSibling;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue