All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.gate.g-progress-dialog.js Maven / Gradle / Ivy

There is a newer version: 12.3.1
Show newest version
let template = document.createElement("template");
template.innerHTML = `
	
Progresso
`; /* global customElements */ import './g-icon.js'; import './g-progress-status.js'; import GWindow from './g-window.js'; customElements.define('g-progress-dialog', class extends GWindow { constructor() { super(); this.shadowRoot.appendChild(template.content.cloneNode(true)); let close = this.shadowRoot.getElementById("close"); let commit = this.shadowRoot.getElementById("commit"); commit.onclick = close.onclick = event => { event.preventDefault(); event.stopPropagation(); if (confirm("Tem certeza de que deseja fechar o progresso?")) this.hide(); }; window.addEventListener("ProcessCommited", event => { if (event.detail.process !== this.process) return; commit.innerHTML = "Ok"; commit.style.color = getComputedStyle(document.documentElement).getPropertyValue('--question1'); commit.onclick = close.onclick = click => { click.preventDefault(); click.stopPropagation(); this.hide(); }; }); window.addEventListener("ProcessCanceled", event => { if (event.detail.process !== this.process) return; commit.innerHTML = "OK"; commit.style.color = getComputedStyle(document.documentElement).getPropertyValue('--error1'); commit.onclick = close.onclick = click => { click.preventDefault(); click.stopPropagation(); this.hide(); }; }); window.addEventListener("ProcessRedirect", event => { if (event.detail.process !== this.process) return; commit.innerHTML = "Ok"; commit.onclick = close.onclick = click => { click.preventDefault(); click.stopPropagation(); this.hide(); this.dispatchEvent(new CustomEvent('redirect', {detail: event.detail.url})); }; }); } set process(process) { this.setAttribute("process", process); } get process() { return JSON.parse(this.getAttribute("process")); } attributeChangedCallback(name) { this.shadowRoot.querySelector("g-progress-status") .process = this.process; } static get observedAttributes() { return ["process"]; } });




© 2015 - 2024 Weber Informatics LLC | Privacy Policy