feat(views/table): support color class for title

This commit is contained in:
Elian Doran 2025-07-18 14:13:18 +03:00
parent 3d264379cc
commit 7a131e0bcc
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -51,12 +51,12 @@ export function NoteFormatter(cell: CellComponent, _formatterParams, onRendered)
* Custom formatter for the note title that is quite similar to {@link NoteFormatter}, but where the title and icons are read from separate fields. * Custom formatter for the note title that is quite similar to {@link NoteFormatter}, but where the title and icons are read from separate fields.
*/ */
export function NoteTitleFormatter(cell: CellComponent) { export function NoteTitleFormatter(cell: CellComponent) {
const { noteId, iconClass } = cell.getRow().getData(); const { noteId, iconClass, colorClass } = cell.getRow().getData();
if (!noteId) { if (!noteId) {
return ""; return "";
} }
const { $noteRef } = buildNoteLink(noteId, cell.getValue(), iconClass); const { $noteRef } = buildNoteLink(noteId, cell.getValue(), iconClass, colorClass);
return $noteRef[0].outerHTML; return $noteRef[0].outerHTML;
} }

View file

@ -9,6 +9,7 @@ export type TableData = {
labels: Record<string, boolean | string | null>; labels: Record<string, boolean | string | null>;
relations: Record<string, boolean | string | null>; relations: Record<string, boolean | string | null>;
branchId: string; branchId: string;
colorClass: string | undefined;
_children?: TableData[]; _children?: TableData[];
}; };
@ -41,6 +42,7 @@ export async function buildRowDefinitions(parentNote: FNote, infos: AttributeDef
labels, labels,
relations, relations,
branchId: branch.branchId, branchId: branch.branchId,
colorClass: note.getColorClass()
} }
if (note.hasChildren() && (maxDepth < 0 || currentDepth < maxDepth)) { if (note.hasChildren() && (maxDepth < 0 || currentDepth < maxDepth)) {