fix (table): embed table

This commit is contained in:
MickaelK 2025-05-01 12:07:43 +10:00
parent c6e7f39f67
commit 844fd5d7bb

View file

@ -1,4 +1,4 @@
import { init as initConfig, getVersion } from "../model/config.js";
import { init as initConfig, getVersion, get } from "../model/config.js";
const DEBOUNCETIME = 100;
@ -11,7 +11,7 @@ class FilestashTable extends HTMLElement {
this.iframe = document.createElement("iframe");
this.iframe.setAttribute("style", "width: 100%; height: 100%; border: none; display: block;");
this.iframe.setAttribute("sandbox", "allow-downloads allow-scripts allow-presentation");
this.iframe.setAttribute("sandbox", "allow-downloads allow-scripts allow-presentation allow-forms");
this.shadowRoot.appendChild(this.iframe);
this.debounce = null;
@ -41,15 +41,8 @@ class FilestashTable extends HTMLElement {
connectedCallback() {
const src = this.getAttribute("src") || "";
const name = this.getAttribute("name") || "main.dbf";
const mime = {
"orc": "application/vnd.apache.orc",
"arrow": "application/vnd.apache.feather",
"avro": "application/vnd.apache.avro",
"feather": "application/vnd.apache.feather",
"parquet": "application/vnd.apache.parquet",
"dbf": "application/dbf",
}[name.split(".").pop().toLowerCase()];
const name = this.getAttribute("name") || "main.dat";
const mime = get("mime", {})[name.split(".").pop().toLowerCase()];
this.style.display = "inline-block";
this.iframe.srcdoc = `<!DOCTYPE html>