UNPKG

jexcel-pro

Version:

jExcel is a lightweight, vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with Excel, Google Spreadsheets and any other spreadsheet software.

45 lines (36 loc) 1.22 kB
class Jexcel extends HTMLElement { constructor() { super(); } init(o) { // Shadow root const shadowRoot = this.attachShadow({mode: 'open'}); // Style const cssJexcel = document.createElement('link'); cssJexcel.rel = 'stylesheet'; cssJexcel.type = 'text/css' cssJexcel.href = 'https://bossanova.uk/jexcel/v4/jexcel.css'; shadowRoot.appendChild(cssJexcel); const cssJsuites = document.createElement('link'); cssJsuites.rel = 'stylesheet'; cssJsuites.type = 'text/css' cssJsuites.href = 'https://bossanova.uk/jexcel/v4/jsuites.css'; shadowRoot.appendChild(cssJsuites); // Jexcel container var container = document.createElement('div'); shadowRoot.appendChild(container); // Create jexcel element this.el = jexcel(container, { root: shadowRoot, minDimensions: [10,10] }); } connectedCallback() { this.init(this); } disconnectedCallback() { } attributeChangedCallback() { } } window.customElements.define('jexcel-spreadsheet', Jexcel);