1import { Controller } from "@hotwired/stimulus"; 2 3export default class extends Controller { 4 static targets = ["todayBtn", "weekBtn", "todayData", "weekData"]; 5 static values = { period: { type: String, default: "today" } }; 6 7 periodValueChanged() { 8 const isToday = this.periodValue === "today"; 9 this.todayDataTargets.forEach((el) => el.classList.toggle("hidden", !isToday)); 10 this.weekDataTargets.forEach((el) => el.classList.toggle("hidden", isToday)); 11 12 this.todayBtnTargets.forEach((el) => { 13 el.classList.toggle("text-neutral-900", isToday); 14 el.classList.toggle("font-medium", isToday); 15 el.classList.toggle("text-neutral-400", !isToday); 16 }); 17 18 this.weekBtnTargets.forEach((el) => { 19 el.classList.toggle("text-neutral-900", !isToday); 20 el.classList.toggle("font-medium", !isToday); 21 el.classList.toggle("text-neutral-400", isToday); 22 }); 23 } 24 25 showToday() { 26 this.periodValue = "today"; 27 } 28 29 showWeek() { 30 this.periodValue = "week"; 31 } 32};
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.