Melhorias gerais descritas no READ.me

This commit is contained in:
2026-06-26 11:30:35 -03:00
parent 1ca5fc67d7
commit 1ad1d4c143
8 changed files with 198 additions and 23 deletions

View File

@@ -0,0 +1,23 @@
// app/javascript/controllers/adicionar_motorista_controller.js
// Stimulus — modal "Adicionar motorista" no Passo 1. Só abre/fecha o modal; o
// formulário em si submete normalmente (Turbo), redirecionando de volta ao wizard.
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["modal", "input"]
abrir() {
this.modalTarget.classList.remove("hidden")
if (this.hasInputTarget) this.inputTarget.focus()
}
fechar() {
this.modalTarget.classList.add("hidden")
}
// Fecha ao clicar no fundo (fora do card)
fundo(event) {
if (event.target === this.modalTarget) this.fechar()
}
}