1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static targets = ['results', 'input', 'componentIdInput']; 5 static values = {url: String} 6 7 findResults(event) { 8 const searchTerm = encodeURIComponent(event.target.value); 9 const urlWithSearchTerm = this.urlValue.replace(/_0_component/g, searchTerm); 10 this.resultsTarget.classList.remove("hidden") 11 this.resultsTarget.src = urlWithSearchTerm; 12 } 13 14 selectComponent(event) { 15 this.componentIdInputTarget.value = event.currentTarget.dataset.componentId 16 this.inputTarget.value = event.currentTarget.dataset.componentName 17 18 this.resultsTarget.classList.add("hidden") 19 } 20 21 clearInput(event) { 22 this.inputTarget.value = "" 23 } 24};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.