import { LitElement, css, html } from "lit";
import { shellApi } from "../../../api/api";
export class PocEventsEcap extends LitElement {
render() {
return html`
POC ECAP Test
Emplenar valors de url i accio per navegar a ECAP
`;
}
sendPdfToViewer() {
const pdfId = (this as any).shadowRoot?.getElementById("pdfId")?.value as string;
const pdfName = (this as any).shadowRoot?.getElementById("pdfName")?.value as string;
const pdfDate = (this as any).shadowRoot?.getElementById("pdfDate")?.value as string;
const fileName = (this as any).shadowRoot?.getElementById("url")?.value as string;
shellApi.pdfViewerManager.add({ id: pdfId, name: pdfName, date: pdfDate, url: fileName });
}
getPDFS() {
const pdfs = shellApi.pdfViewerManager.getPdfs();
return pdfs;
}
goToLinkOnEcap() {
const eventType = (this as any).shadowRoot?.getElementById("eventType")?.value;
const accio = (this as any).shadowRoot?.getElementById("accio")?.value;
const parameterName = (this as any).shadowRoot?.getElementById("parameterName")?.value;
const parameterValue = (this as any).shadowRoot?.getElementById("parameterValue")?.value;
//sending data to parent window if opened inside iframe
shellApi.ecapEventManager.publish(eventType, accio, {
[parameterName]: parameterValue,
});
}
static styles = css`
`;
}