1import { Controller } from "@hotwired/stimulus" 2 3// Cuando una pareja paga una parte, quién de los dos la puso. 4// 5// La inscripción es de dos y el cobro casi nunca entra junto: uno paga su 6// mitad el martes y el otro el sábado. Si no queda anotado, al segundo hay que 7// preguntarle âo creerleâ si el primero ya pagó (Juanma, 23/09/2026). 8// 9// Se pregunta solo cuando paga MENOS del total: si paga todo, no hay nada que 10// preguntar. 11export default class extends Controller { 12 static targets = ["monto", "quien", "nombre", "elegido"] 13 static values = { falta: Number } 14 15 connect() { 16 this.cambio() 17 } 18 19 poner(event) { 20 this.montoTarget.value = event.currentTarget.dataset.monto 21 this.cambio() 22 } 23 24 cambio() { 25 if (!this.hasQuienTarget) return 26 27 const monto = Number(String(this.montoTarget.value).replace(/[^\d]/g, "")) || 0 28 const parcial = monto > 0 && monto < this.faltaValue 29 this.quienTarget.classList.toggle("hidden", !parcial) 30 if (!parcial) this.limpiar() 31 } 32 33 elegir(event) { 34 const nombre = event.currentTarget.dataset.nombre 35 this.elegidoTarget.value = nombre 36 this.nombreTargets.forEach((b) => { 37 const puesto = b.dataset.nombre === nombre 38 b.classList.toggle("bg-lime", puesto) 39 b.classList.toggle("border-lime", puesto) 40 b.classList.toggle("font-semibold", puesto) 41 }) 42 } 43 44 limpiar() { 45 if (!this.hasElegidoTarget) return 46 this.elegidoTarget.value = "" 47 this.nombreTargets.forEach((b) => { 48 b.classList.remove("bg-lime", "border-lime", "font-semibold") 49 }) 50 } 51}
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.