-1) { var s = strcode.indexOf("", e); scripts.push(strcode.substring(s_e + 1, e)); strcode = strcode.substring(0, s) + strcode.substring(e_e + 1); } for (var _contScript = 0; _contScript < scripts.length; _contScript++) { try { eval(scripts[_contScript]); } catch (ex) { console.warn("Erro parseScript: ", scripts[_contScript]); throw ex; } } if (callback) { setTimeout(callback, 250); }}; window.setarElementosComponents = function(){ let inputs = document.querySelectorAll('[name^="inp-form-"]');let resultado = [];inputs.forEach(input => { let form = input.closest('form'); if (form && form.hasAttribute('tecnicon.data')) { let dataEncoded = form.getAttribute('tecnicon.data'); let dataDecoded = decodeURIComponent(dataEncoded); let dataJson = JSON.parse(dataDecoded); let inputData = dataJson.find(item => item.name === input.name); if (inputData) { resultado.push({ tabela: inputData.tabela, campo: inputData.campo }); } }}); executaServico('LPGerenciador.LPGerenciador', 'validarCamposFk', null, function(data) { var jsonData = JSON.parse(data); var filtrados = jsonData.filter(item => item.FK === "S"); filtrados.forEach(function(item) { let inputAnt = document.querySelector(`[name="inp-form-${item.campo}"]`); inputAnt.type = 'text'; inputAnt.style.position = 'absolute'; inputAnt.style.opacity = '0'; let novoElemento = document.createElement('t-autocomplete'); novoElemento.id = item.campo; novoElemento.name = item.campo; novoElemento.setAttribute('tabela', 'CIDADE'); novoElemento.setAttribute('campo', 'CCIDADE'); novoElemento.setAttribute('descricao', 'CIDADE,UF'); novoElemento.setAttribute('automatico', 'S'); novoElemento.setAttribute('style', 'float: left;'); novoElemento.setAttribute('classestilo', 'width-xx-grande-px'); novoElemento.setAttribute('placeholder', 'Selecione...'); novoElemento.setAttribute('aliastabela', 'CIDADE'); novoElemento.setAttribute('required', 'true'); novoElemento.addEventListener('blur', function() { inputAnt.value = this.value; }); inputAnt.insertAdjacentElement('afterend', novoElemento); });}, 'JSON='+ JSON.stringify(resultado)); }; setarElementosComponents(); carregaWebComponents(); document.querySelectorAll('input[name*="inp-form-INPUT"]').forEach(input => { const x = Math.floor(Math.random() * 10); const y = Math.floor(Math.random() * 10); const soma = x + y; input.name = "inp-form-INPUT" + soma; const p = input.closest('p') || input.previousElementSibling || input.nextElementSibling; if (p && p.tagName.toLowerCase() === 'p') { p.innerText = `(${x}) + (${y}) = ?`; }}); (function(node, container) { let scale = ((container.offsetWidth) * 0.1) / 100; let width = parseFloat(node.style.width); let dif = width - container.offsetWidth; let perc = (dif * 100) / width; scale = 1 - (perc / 100); node.style.transform = `scale(${scale})`; console.log('Página Pronta!');})(document.querySelector("section"), document.body)