refactor(views/table): rename event

This commit is contained in:
Elian Doran 2025-07-14 21:06:44 +03:00
parent ab093ed9a0
commit c9b37dcc77
No known key found for this signature in database
4 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ export type CommandMappings = {
customOpts: CreateNoteOpts; customOpts: CreateNoteOpts;
parentNotePath?: string; parentNotePath?: string;
}; };
addNoteListItem: CommandData & { addNewTableColumn: CommandData & {
referenceColumn?: ColumnComponent; referenceColumn?: ColumnComponent;
direction?: "before" | "after"; direction?: "before" | "after";
}; };

View File

@ -82,14 +82,14 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
{ {
title: t("table_view.add-column-to-the-left"), title: t("table_view.add-column-to-the-left"),
uiIcon: "bx bx-horizontal-left", uiIcon: "bx bx-horizontal-left",
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", { handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
referenceColumn: column referenceColumn: column
}) })
}, },
{ {
title: t("table_view.add-column-to-the-right"), title: t("table_view.add-column-to-the-right"),
uiIcon: "bx bx-horizontal-right", uiIcon: "bx bx-horizontal-right",
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", { handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
referenceColumn: column, referenceColumn: column,
direction: "after" direction: "after"
}) })

View File

@ -15,7 +15,7 @@ export default function buildFooter(parentNote: FNote) {
<span class="bx bx-plus"></span> ${t("table_view.new-row")} <span class="bx bx-plus"></span> ${t("table_view.new-row")}
</button> </button>
<button class="btn btn-sm" style="padding: 0px 10px 0px 10px;" data-trigger-command="addNoteListItem"> <button class="btn btn-sm" style="padding: 0px 10px 0px 10px;" data-trigger-command="addNewTableColumn">
<span class="bx bx-columns"></span> ${t("table_view.new-column")} <span class="bx bx-columns"></span> ${t("table_view.new-column")}
</button> </button>
`.trimStart(); `.trimStart();

View File

@ -234,7 +234,7 @@ export default class TableView extends ViewMode<StateInfo> {
console.log("Save attributes", this.newAttribute); console.log("Save attributes", this.newAttribute);
} }
addNoteListItemEvent({ referenceColumn, direction }: EventData<"addNoteListItem">) { addNewTableColumnEvent({ referenceColumn, direction }: EventData<"addNewTableColumn">) {
const attr: Attribute = { const attr: Attribute = {
type: "label", type: "label",
name: "label:myLabel", name: "label:myLabel",