PageSourceSearch

https://nutrebem.prod.nutrebem.com.br/assets/controllers/keyboard_shortcut_controller-59fddd3b.js

js nutrebem.com.br collected 2026-10-01 16:39:34 UTC 668 bytes, 24 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3// Telas de terminal: o operador conclui pelo teclado, sem tirar a mao do leitor.
4export default class extends Controller {
5  static values = { enter: String, escape: String }
6
7  connect() {
8    this.aoSoltarTecla = (evento) => this.#acionar(evento)
9    document.addEventListener("keyup", this.aoSoltarTecla)
10  }
11
12  disconnect() {
13    document.removeEventListener("keyup", this.aoSoltarTecla)
14  }
15
16  #acionar(evento) {
17    const seletor =
18      evento.key === "Enter" ? this.enterValue
19        : evento.key === "Escape" ? this.escapeValue
20        : null
21
22    if (seletor) document.querySelector(seletor)?.click()
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.