(keyData: string)
| 110 | } |
| 111 | |
| 112 | handleInput(keyData: string): void { |
| 113 | const kb = getKeybindings(); |
| 114 | // Up arrow - wrap to bottom when at top |
| 115 | if (kb.matches(keyData, "tui.select.up")) { |
| 116 | this.selectedIndex = this.selectedIndex === 0 ? this.filteredItems.length - 1 : this.selectedIndex - 1; |
| 117 | this.notifySelectionChange(); |
| 118 | } |
| 119 | // Down arrow - wrap to top when at bottom |
| 120 | else if (kb.matches(keyData, "tui.select.down")) { |
| 121 | this.selectedIndex = this.selectedIndex === this.filteredItems.length - 1 ? 0 : this.selectedIndex + 1; |
| 122 | this.notifySelectionChange(); |
| 123 | } |
| 124 | // Enter |
| 125 | else if (kb.matches(keyData, "tui.select.confirm")) { |
| 126 | const selectedItem = this.filteredItems[this.selectedIndex]; |
| 127 | if (selectedItem && this.onSelect) { |
| 128 | this.onSelect(selectedItem); |
| 129 | } |
| 130 | } |
| 131 | // Escape or Ctrl+C |
| 132 | else if (kb.matches(keyData, "tui.select.cancel")) { |
| 133 | if (this.onCancel) { |
| 134 | this.onCancel(); |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | private renderItem( |
| 140 | item: SelectItem, |
nothing calls this directly
no test coverage detected