1class QuantityInput extends HTMLElement{#t;#e;#i;#s;constructor(){super(),this.#t=this.add.bind(this),this.#i=this.subtract.bind(this),this.#s=this.validate.bind(this),this.#e=QuantityInput.#n.bind(this)}connectedCallback(){this.input=this.querySelector('input[type="number"]'),this.minus=this.querySelector("button[minus]"),this.plus=this.querySelector("button[plus]"),this.min=Number(this.input.getAttribute("min")||0),this.max=Number(this.input.getAttribute("max")||1/0),this.step=Number(this.input.getAttribute("step")||1),setTimeout((()=>{this.minus.addEventListener("click",this.#i),this.plus.addEventListener("click",this.#t),this.input.addEventListener("change",this.#s),this.input.addEventListener("select",this.#e),this.input.addEventListener("click",this.#e)}))}disconnectedCallback(){this.minus.removeEventListener("click",this.#i),this.plus.removeEventListener("click",this.#t),this.input.removeEventListener("change",this.#s),this.input.removeEventListener("select",this.#e),this.input.removeEventListener("click",this.#e)}subtract(){const t=Number(this.input.value);t>this.min&&(this.input.value=t-Math.min(this.step,t-this.min),this.dispatchEvent(new CustomEvent("update",{detail:{value:this.input.value}})))}add(){const t=Number(this.input.value);t<this.max&&(this.input.value=t+Math.min(this.step,this.max-t),this.dispatchEvent(new CustomEvent("update",{detail:{value:this.input.value}})))}validate(t){const{value:e}=t.target;(!/^[0-9]+$/.test(e)||Number(e)<this.min)&&(this.input.value=this.min),Number(e)>this.max&&(this.input.value=this.max),this.dispatchEvent(new CustomEvent("update",{detail:{value:this.input.value}}))}set value(t){this.input.value=Number(t)}get value(){return Number(this.input.value)}static#n(t){t.target.select()}}customElements.define("quantity-input",QuantityInput); 2//# sourceMappingURL=quantity-input.js.map
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.