From a3a84abd371428a62c4de341eee6a4a2e04546b6 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 14 Aug 2026 09:19:44 -0300 Subject: [PATCH] fix: campo codigo do cliente so aceita numeros + botoes de tabela nao quebram linha Gerador de chave: filtra caracteres nao numericos do campo codigo em tempo real (input event), alem da validacao ja existente no submit. Tabelas: a.botao/button ganham white-space: nowrap, corrigindo o botao 'Abrir' (e outros) quebrando em duas linhas depois que as celulas de dado passaram a permitir quebra de texto longo. Co-Authored-By: Claude Sonnet 5 --- app/static/estilo.css | 1 + app/templates/gerador_chave.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/static/estilo.css b/app/static/estilo.css index 51f6c8e..7929402 100644 --- a/app/static/estilo.css +++ b/app/static/estilo.css @@ -213,6 +213,7 @@ button, a.botao { border: 1px solid transparent; border-radius: 8px; background: var(--cor-acento); color: var(--cor-acento-contraste); font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; + white-space: nowrap; } a.botao { background: transparent; border-color: var(--cor-borda); color: var(--cor-texto); font-weight: 400; margin-right: 6px; } a.botao:hover { border-color: var(--cor-acento); color: var(--cor-acento); } diff --git a/app/templates/gerador_chave.html b/app/templates/gerador_chave.html index 6ef7b84..75fd13a 100644 --- a/app/templates/gerador_chave.html +++ b/app/templates/gerador_chave.html @@ -95,6 +95,10 @@ const $erro = document.getElementById('erro'); const $resultado = document.getElementById('resultado'); const $copiar = document.getElementById('copiar'); +$codigo.addEventListener('input', () => { + $codigo.value = $codigo.value.replace(/\D/g, ''); +}); + (function preencherMesAtual() { const hoje = new Date(); $referencia.value = `${hoje.getFullYear()}-${String(hoje.getMonth() + 1).padStart(2, '0')}`;