MCPcopy Create free account
hub / github.com/chhoumann/quickadd / display

Method display

src/preflight/OnePageInputModal.ts:91–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 private display() {
92 this.containerEl.addClass("quickAddModal", "onePageInputModal");
93 this.contentEl.empty();
94
95 const title = this.contentEl.createEl("h2", { text: "Provide inputs" });
96 title.addClass("qa-onepage-title");
97
98 // Optional live preview area
99 if (this.computePreview) {
100 this.previewContainerEl = this.contentEl.createDiv();
101 this.previewContainerEl.addClass("qa-onepage-preview");
102 const label = this.previewContainerEl.createEl("div", {
103 text: "Preview",
104 });
105 label.addClass("qa-onepage-preview-label");
106 void this.updatePreviews();
107 }
108
109 // Render fields
110 this.requirements.forEach((req) => this.renderField(req));
111
112 // Action bar
113 const btnRow = this.contentEl.createDiv();
114 new Setting(btnRow)
115 .addButton((btn) =>
116 btn
117 .setButtonText("Submit")
118 .setCta()
119 .onClick(() => this.submit()),
120 )
121 .addButton((btn) =>
122 btn.setButtonText("Cancel").onClick(() => this.cancel()),
123 );
124 }
125
126 onOpen() {
127 // Auto-focus the first field so keyboard-first users can start typing

Callers 1

constructorMethod · 0.95

Calls 9

updatePreviewsMethod · 0.95
renderFieldMethod · 0.95
submitMethod · 0.95
cancelMethod · 0.95
addClassMethod · 0.45
addButtonMethod · 0.45
onClickMethod · 0.45
setCtaMethod · 0.45
setButtonTextMethod · 0.45

Tested by

no test coverage detected