1import { Controller } from "@hotwired/stimulus"; 2 3// The closed/summary chip panel isn't a form and doesn't need the full 4// subject-filter-preview controller -- it just needs to filter the products 5// list below to the pre-computed uncovered-titles set, purely client-side, 6// with no server round-trip and no need to enter (admin-only) edit mode. 7export default class extends Controller { 8 static outlets = [ "product-list" ]; 9 static targets = [ "link" ]; 10 static values = { 11 ids: Array, 12 label: String, 13 }; 14 15 connect() { 16 this.active = false; 17 } 18 19 toggle(event) { 20 event.preventDefault(); 21 if (!this.hasProductListOutlet) return; 22 23 this.active = !this.active; 24 25 if (this.active) { 26 this.productListOutlet.showOnly(this.idsValue); 27 this.linkTarget.textContent = "Show all titles"; 28 } else { 29 this.productListOutlet.showAll(); 30 this.linkTarget.textContent = this.labelValue; 31 } 32 } 33}
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.