mirror of
https://github.com/zadam/trilium.git
synced 2025-10-06 13:39:51 +08:00
feat(views/table): format note ID as monospace
This commit is contained in:
parent
aa8902f5b9
commit
cf8063f311
2 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { RelationEditor } from "./relation_editor.js";
|
import { RelationEditor } from "./relation_editor.js";
|
||||||
import { NoteFormatter, NoteTitleFormatter, RowNumberFormatter } from "./formatters.js";
|
import { MonospaceFormatter, NoteFormatter, NoteTitleFormatter, RowNumberFormatter } from "./formatters.js";
|
||||||
import type { ColumnDefinition, Tabulator } from "tabulator-tables";
|
import type { ColumnDefinition } from "tabulator-tables";
|
||||||
import { LabelType } from "../../../services/promoted_attribute_definition_parser.js";
|
import { LabelType } from "../../../services/promoted_attribute_definition_parser.js";
|
||||||
|
|
||||||
type ColumnType = LabelType | "relation";
|
type ColumnType = LabelType | "relation";
|
||||||
|
@ -55,6 +55,7 @@ export function buildColumnDefinitions(info: AttributeDefinitionInformation[], m
|
||||||
{
|
{
|
||||||
field: "noteId",
|
field: "noteId",
|
||||||
title: "Note ID",
|
title: "Note ID",
|
||||||
|
formatter: MonospaceFormatter,
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,10 @@ export function RowNumberFormatter(draggableRows: boolean) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function MonospaceFormatter(cell: CellComponent) {
|
||||||
|
return `<code>${cell.getValue()}</code>`;
|
||||||
|
}
|
||||||
|
|
||||||
function buildNoteLink(noteId: string) {
|
function buildNoteLink(noteId: string) {
|
||||||
const $noteRef = $("<span>");
|
const $noteRef = $("<span>");
|
||||||
const href = `#root/${noteId}`;
|
const href = `#root/${noteId}`;
|
||||||
|
|
Loading…
Add table
Reference in a new issue