()
| 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 |
no test coverage detected