diff --git a/lab_formularios.php b/lab_formularios.php
index 1b143bc..9bf2c85 100644
--- a/lab_formularios.php
+++ b/lab_formularios.php
@@ -34,6 +34,12 @@ $puedeEscribir = $esAdmin && hasModuleWrite('lab_formularios');
.badge-completado { background:#0d6efd; }
.badge-firmado { background:#198754; }
.badge-expirado { background:#dc3545; }
+
+ /* ── Animación toast ────────────────────────────── */
+ @keyframes fadeInUp {
+ from { opacity:0; transform:translateY(12px); }
+ to { opacity:1; transform:translateY(0); }
+ }
@@ -118,53 +124,58 @@ $puedeEscribir = $esAdmin && hasModuleWrite('lab_formularios');
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+ Cargando…
+
+
Cargando envíos…
+
+
+
@@ -504,12 +515,21 @@ const envios = {
_pagina: 1,
async cargar() {
+ // Mostrar spinner, ocultar tabla
+ const spinner = $('env-spinner');
+ const tabla = $('env-tabla-wrap');
+ if (spinner) spinner.style.display = '';
+ if (tabla) tabla.style.display = 'none';
+
const r = await fetch('api/lab/get_formularios.php?envios=1');
const d = await r.json();
this._data = d.data || [];
this._pagina = 1;
this._poblarSelectFormulario();
this._aplicarFiltros();
+
+ if (spinner) spinner.style.display = 'none';
+ if (tabla) tabla.style.display = '';
},
filtrar() {
@@ -644,7 +664,7 @@ const envios = {
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
- showToast('✅ Exportando ' + rows.length + ' envíos…');
+ showToast('✅ Excel descargado — ' + rows.length + ' registro(s)', 'success', 4000);
},
_render() {
@@ -1042,13 +1062,13 @@ function renderCampoPreview(c, valores) {
// ══════════════════════════════════════════════════════════════════════
// HELPERS UI
// ══════════════════════════════════════════════════════════════════════
-function showToast(msg) {
+function showToast(msg, tipo = 'success', ms = 3000) {
const t = document.createElement('div');
- t.className = 'alert alert-success position-fixed bottom-0 end-0 m-3 shadow py-2 px-3';
- t.style.zIndex = '9999';
- t.textContent = msg;
+ t.className = `alert alert-${tipo} d-flex align-items-center gap-2 position-fixed bottom-0 end-0 m-3 shadow-sm py-2 px-3`;
+ t.style.cssText = 'z-index:9999;min-width:220px;max-width:360px;font-size:.875rem;border-radius:8px;animation:fadeInUp .2s ease';
+ t.innerHTML = `${esc(msg)}`;
document.body.appendChild(t);
- setTimeout(() => t.remove(), 3000);
+ setTimeout(() => t && t.remove(), ms);
}
document.addEventListener('keydown', e => {