MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / createPropertyEventCard

Function createPropertyEventCard

src/ui/PropertyEventCard.ts:21–216  ·  view source on GitHub ↗
(
	entry: BasesEntry,
	plugin: TaskNotesPlugin,
	viewConfig?: BasesViewConfig,
	options: Partial<PropertyEventCardOptions> = {}
)

Source from the content-addressed store, hash-verified

19 * Shows file title and Bases properties configured as visible in the view
20 */
21export function createPropertyEventCard(
22 entry: BasesEntry,
23 plugin: TaskNotesPlugin,
24 viewConfig?: BasesViewConfig,
25 options: Partial<PropertyEventCardOptions> = {}
26): HTMLElement {
27 const opts = { ...DEFAULT_PROPERTY_EVENT_CARD_OPTIONS, ...options };
28
29 const card = activeDocument.createElement("div");
30 card.className = "task-card task-card--property-event";
31
32 const file = entry.file;
33 if (!file) {
34 card.textContent = plugin.i18n.translate("ui.propertyEventCard.unknownFile");
35 return card;
36 }
37
38 card.dataset.key = `property-${file.path}`;
39 card.dataset.filePath = file.path;
40
41 // Main row
42 const mainRow = card.createEl("div", { cls: "task-card__main-row" });
43
44 // Left indicator area: file icon
45 const leftIconWrap = mainRow.createEl("span", { cls: "property-event-card__icon" });
46 const leftIcon = leftIconWrap.createDiv();
47 setIcon(leftIcon, "file-text");
48
49 // Styling for icon area
50 leftIconWrap.classList.remove(
51 "tn-static-display-block-2a1b75c9",
52 "tn-static-display-flex-4d51fc62",
53 "tn-static-display-flex-75816cae",
54 "tn-static-display-flex-8bb39979",
55 "tn-static-display-inline-block-60e32dcb",
56 "tn-static-display-inline-cccfa456",
57 "tn-static-display-none-6b99de8b",
58 "tn-static-min-height-800px-997b4c8c"
59 );
60 leftIconWrap.classList.add("tn-static-display-inline-flex-f984c520");
61 leftIconWrap.classList.remove(
62 "tn-static-width-100-0466783d",
63 "tn-static-width-12px-fbf353fb",
64 "tn-static-width-1px-aa77e27e",
65 "tn-static-width-200px-2acaf3b5",
66 "tn-static-width-60px-bd09c419",
67 "tn-static-width-80px-8573bae3"
68 );
69 leftIconWrap.classList.add("tn-static-width-16px-7375d50b");
70 leftIconWrap.classList.remove(
71 "tn-static-display-flex-4d51fc62",
72 "tn-static-height-0-7a31cef0",
73 "tn-static-height-100-62264068",
74 "tn-static-height-12px-06c0747e",
75 "tn-static-height-24px-29a11d37",
76 "tn-static-min-height-800px-997b4c8c"
77 );
78 leftIconWrap.classList.add("tn-static-height-16px-30de4aee");

Callers

nothing calls this directly

Calls 7

setIconFunction · 0.90
isEmptyCardDisplayValueFunction · 0.90
renderBasesValueFunction · 0.90
debugMethod · 0.80
translateMethod · 0.65
triggerMethod · 0.65
getValueMethod · 0.45

Tested by

no test coverage detected