Loading resources/views/adminGen/listas/create.blade.php +54 −0 Original line number Diff line number Diff line Loading @@ -211,10 +211,37 @@ <script src="/assets/js/jquery.toast.js"></script> <script> function aplicarBusquedaNormalizada(niceSelectEl){ const input = niceSelectEl.querySelector('.nice-select-search'); if(input){ function normalizarTexto(texto){ return texto.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); } input.addEventListener('keydown', function (e) { if (e.key === ' ') { e.stopPropagation(); } }); input.addEventListener('input', function () { const search = normalizarTexto(this.value); const options = niceSelectEl.querySelectorAll('.option'); options.forEach(option => { const optionText = normalizarTexto(option.textContent); option.style.display = optionText.includes(search) ? '' : 'none'; }); }); } } // seachable var options = { searchable: true }; document.addEventListener("DOMContentLoaded", function(e) { // default var els = document.querySelectorAll(".selectize"); Loading @@ -225,6 +252,12 @@ NiceSelect.bind(document.getElementById("subgrupo_id"), options); NiceSelect.bind(document.getElementById("contacto_id"), options); setTimeout(()=> { document.querySelectorAll('.nice-select').forEach(select => { aplicarBusquedaNormalizada(select); }); }, 100); document.querySelectorAll('.nice-select .current').forEach(el => { if (el.textContent.trim() === 'Select an option') { el.textContent = 'Selecciona una opción'; Loading Loading @@ -285,6 +318,13 @@ `; dynamicFormContainerSubgrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectSubgrupo), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectSubgrupo}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -318,6 +358,13 @@ `; dynamicFormContainerGrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -350,6 +397,13 @@ `; dynamicFormContainerContactos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading resources/views/adminGen/listas/edit.blade.php +54 −1 Original line number Diff line number Diff line <x-layout.default> <link rel='stylesheet' type='text/css' href='{{ Vite::asset("resources/css/nice-select2.css") }}'> <script src="/assets/js/alpine-mask.min.js"></script> <div x-data="editarLista"> <div> <ul class="flex space-x-2 rtl:space-x-reverse"> <li> <a href="javascript:;" class="text-primary hover:underline">Dashboard</a> Loading Loading @@ -220,6 +220,32 @@ <script src="/assets/js/jquery.toast.js"></script> <script> function aplicarBusquedaNormalizada(niceSelectEl){ const input = niceSelectEl.querySelector('.nice-select-search'); if(input){ function normalizarTexto(texto){ return texto.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); } input.addEventListener('keydown', function (e) { if (e.key === ' ') { e.stopPropagation(); } }); input.addEventListener('input', function () { const search = normalizarTexto(this.value); const options = niceSelectEl.querySelectorAll('.option'); options.forEach(option => { const optionText = normalizarTexto(option.textContent); option.style.display = optionText.includes(search) ? '' : 'none'; }); }); } } // seachable var options = { searchable: true Loading @@ -234,6 +260,12 @@ NiceSelect.bind(document.getElementById("subgrupo_id"), options); NiceSelect.bind(document.getElementById("contacto_id"), options); setTimeout(()=> { document.querySelectorAll('.nice-select').forEach(select => { aplicarBusquedaNormalizada(select); }); }, 100); document.querySelectorAll('.nice-select .current').forEach(el => { if (el.textContent.trim() === 'Select an option') { el.textContent = 'Selecciona una opción'; Loading Loading @@ -294,6 +326,13 @@ `; dynamicFormContainerSubgrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectSubgrupo), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectSubgrupo}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -327,6 +366,13 @@ `; dynamicFormContainerGrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -359,6 +405,13 @@ `; dynamicFormContainerContactos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading
resources/views/adminGen/listas/create.blade.php +54 −0 Original line number Diff line number Diff line Loading @@ -211,10 +211,37 @@ <script src="/assets/js/jquery.toast.js"></script> <script> function aplicarBusquedaNormalizada(niceSelectEl){ const input = niceSelectEl.querySelector('.nice-select-search'); if(input){ function normalizarTexto(texto){ return texto.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); } input.addEventListener('keydown', function (e) { if (e.key === ' ') { e.stopPropagation(); } }); input.addEventListener('input', function () { const search = normalizarTexto(this.value); const options = niceSelectEl.querySelectorAll('.option'); options.forEach(option => { const optionText = normalizarTexto(option.textContent); option.style.display = optionText.includes(search) ? '' : 'none'; }); }); } } // seachable var options = { searchable: true }; document.addEventListener("DOMContentLoaded", function(e) { // default var els = document.querySelectorAll(".selectize"); Loading @@ -225,6 +252,12 @@ NiceSelect.bind(document.getElementById("subgrupo_id"), options); NiceSelect.bind(document.getElementById("contacto_id"), options); setTimeout(()=> { document.querySelectorAll('.nice-select').forEach(select => { aplicarBusquedaNormalizada(select); }); }, 100); document.querySelectorAll('.nice-select .current').forEach(el => { if (el.textContent.trim() === 'Select an option') { el.textContent = 'Selecciona una opción'; Loading Loading @@ -285,6 +318,13 @@ `; dynamicFormContainerSubgrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectSubgrupo), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectSubgrupo}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -318,6 +358,13 @@ `; dynamicFormContainerGrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -350,6 +397,13 @@ `; dynamicFormContainerContactos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading
resources/views/adminGen/listas/edit.blade.php +54 −1 Original line number Diff line number Diff line <x-layout.default> <link rel='stylesheet' type='text/css' href='{{ Vite::asset("resources/css/nice-select2.css") }}'> <script src="/assets/js/alpine-mask.min.js"></script> <div x-data="editarLista"> <div> <ul class="flex space-x-2 rtl:space-x-reverse"> <li> <a href="javascript:;" class="text-primary hover:underline">Dashboard</a> Loading Loading @@ -220,6 +220,32 @@ <script src="/assets/js/jquery.toast.js"></script> <script> function aplicarBusquedaNormalizada(niceSelectEl){ const input = niceSelectEl.querySelector('.nice-select-search'); if(input){ function normalizarTexto(texto){ return texto.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(); } input.addEventListener('keydown', function (e) { if (e.key === ' ') { e.stopPropagation(); } }); input.addEventListener('input', function () { const search = normalizarTexto(this.value); const options = niceSelectEl.querySelectorAll('.option'); options.forEach(option => { const optionText = normalizarTexto(option.textContent); option.style.display = optionText.includes(search) ? '' : 'none'; }); }); } } // seachable var options = { searchable: true Loading @@ -234,6 +260,12 @@ NiceSelect.bind(document.getElementById("subgrupo_id"), options); NiceSelect.bind(document.getElementById("contacto_id"), options); setTimeout(()=> { document.querySelectorAll('.nice-select').forEach(select => { aplicarBusquedaNormalizada(select); }); }, 100); document.querySelectorAll('.nice-select .current').forEach(el => { if (el.textContent.trim() === 'Select an option') { el.textContent = 'Selecciona una opción'; Loading Loading @@ -294,6 +326,13 @@ `; dynamicFormContainerSubgrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectSubgrupo), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectSubgrupo}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -327,6 +366,13 @@ `; dynamicFormContainerGrupos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading Loading @@ -359,6 +405,13 @@ `; dynamicFormContainerContactos.appendChild(newFormGroup); NiceSelect.bind(document.getElementById(newSelectId), options); setTimeout(()=>{ const nuevoNiceSelect = document.querySelector(`#${newSelectId}`).nextElementSibling; if(nuevoNiceSelect && nuevoNiceSelect.classList.contains('nice-select')){ aplicarBusquedaNormalizada(nuevoNiceSelect); } }, 50); // Añadir evento de clic para eliminar newFormGroup.querySelector('.removeBtn').addEventListener('click', function() { newFormGroup.remove(); Loading