(
options: Array<{ value: string; label: string }>,
selectedValue?: string
)
| 697 | * Creates a select dropdown with card styling |
| 698 | */ |
| 699 | export function createCardSelect( |
| 700 | options: Array<{ value: string; label: string }>, |
| 701 | selectedValue?: string |
| 702 | ): HTMLSelectElement { |
| 703 | const select = activeDocument.createElement("select"); |
| 704 | select.addClass("tasknotes-settings__card-input"); |
| 705 | |
| 706 | options.forEach((option) => { |
| 707 | const optionEl = select.createEl("option", { |
| 708 | value: option.value, |
| 709 | text: option.label, |
| 710 | }); |
| 711 | |
| 712 | if (selectedValue === option.value) { |
| 713 | optionEl.selected = true; |
| 714 | } |
| 715 | }); |
| 716 | |
| 717 | return select; |
| 718 | } |
| 719 | |
| 720 | /** |
| 721 | * Sets up drag and drop functionality for a draggable card |
no test coverage detected