From 2dd7277dddab80b241e5da5f2c4a9377a71e0507 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 20 Jul 2023 18:37:53 +0300 Subject: [PATCH] Updates --- assets/{index-2bcf435d.js => index-b094be88.js} | 6 +++--- index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename assets/{index-2bcf435d.js => index-b094be88.js} (91%) diff --git a/assets/index-2bcf435d.js b/assets/index-b094be88.js similarity index 91% rename from assets/index-2bcf435d.js rename to assets/index-b094be88.js index a345125..e6e5fa1 100644 --- a/assets/index-2bcf435d.js +++ b/assets/index-b094be88.js @@ -1,4 +1,4 @@ -var d=Object.defineProperty;var u=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>(u(n,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function e(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(s){if(s.ep)return;s.ep=!0;const l=e(s);fetch(s.href,l)}})();class w{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("input");this.element=e,this.hide()}hide(){this.element.style.display="none"}show(){this.element.style.display="block"}}class g{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("header");e.classList.add(),this.element=e}}class m{constructor(t){i(this,"element");i(this,"verticalScroller");i(this,"horizontalScroller");i(this,"root");i(this,"handleScroll",()=>{const t=this.getViewportBoundlingRect();this.root.viewport.updateValues(t),this.root.renderSheet()});this.root=t;const{horizontalScroller:e,scroller:o,verticalScroller:s}=this.buildComponent();this.element=o,this.verticalScroller=s,this.horizontalScroller=e,this.element.style.height=this.root.config.view.height+"px",this.element.style.width=this.root.config.view.width+"px",this.updateScrollerSize(),this.element.addEventListener("scroll",this.handleScroll)}getViewportBoundlingRect(){const{scrollTop:t,scrollLeft:e}=this.element,{height:o,width:s}=this.element.getBoundingClientRect(),l=t+o,r=e+s;return{top:t,left:e,bottom:l,right:r}}buildComponent(){const t=document.createElement("div"),e=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");return e.style.width="0px",e.style.pointerEvents="none",o.style.pointerEvents="none",s.style.display="flex",l.appendChild(e),l.appendChild(o),s.appendChild(l),this.verticalScroller=e,this.horizontalScroller=o,t.appendChild(s),t.classList.add("scroller"),{scroller:t,verticalScroller:e,horizontalScroller:o}}getActualHeight(){return this.root.config.rows.reduce((t,e)=>(t+=e.height,t),0)}getActualWidth(){return this.root.config.columns.reduce((t,e)=>(t+=e.width,t),0)}updateScrollerSize(){const t=this.getActualHeight(),e=this.getActualWidth();this.setScrollerHeight(t),this.setScrollerWidth(e)}setScrollerHeight(t){this.verticalScroller.style.height=t+"px"}setScrollerWidth(t){this.horizontalScroller.style.width=t+"px"}}class f{constructor(t){i(this,"element");i(this,"ctx");i(this,"root");this.root=t;const e=document.createElement("canvas");e.classList.add("sheet"),e.height=this.root.config.view.height,e.width=this.root.config.view.width,e.style.width=this.root.config.view.width+"px",e.style.height=this.root.config.view.height+"px",this.element=e;const o=this.element.getContext("2d");if(!o)throw new Error("Enable hardware acceleration");this.ctx=o}renderCell(t){const{column:e,row:o}=t;this.root.data[o][e].render(this.root)}renderSheet(){const t=this.root.viewport.firstRow,e=this.root.viewport.lastCol+3,o=this.root.viewport.lastRow+3,s=this.root.viewport.firstCol;console.log();let l=0;for(let r=t;r<=o;r++){for(let h=s;h<=e&&!(!this.root.config.columns[h]||!this.root.config.rows[r]);h++)this.renderCell({column:h,row:r});l++}console.log(`Rendered ${l} rows!`)}}class p{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("div");e.classList.add("spreadsheet_container"),this.element=e,this.changeElementSizes(this.root.viewProps)}changeElementSizes(t){const{height:e,width:o}=t;this.element.style.width=o+"px",this.element.style.height=e+"px"}}class v{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("div");e.classList.add("toolbar"),this.element=e}}class c{constructor(t){i(this,"rows");i(this,"columns");i(this,"view",{width:800,height:600});this.columns=t.columns,this.rows=t.rows,this.view=t.view}}class C{}class y{constructor(t,e){i(this,"root");i(this,"top");i(this,"left");i(this,"right");i(this,"bottom");i(this,"firstRow");i(this,"lastRow");i(this,"firstCol");i(this,"lastCol");this.root=t,this.top=e.top,this.left=e.left,this.right=e.right,this.bottom=e.bottom,this.firstRow=this.getFirstRow(),this.lastCol=this.getFirstRow();//!Temp +var d=Object.defineProperty;var u=(h,t,e)=>t in h?d(h,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):h[t]=e;var i=(h,t,e)=>(u(h,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function e(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(s){if(s.ep)return;s.ep=!0;const l=e(s);fetch(s.href,l)}})();class w{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("input");this.element=e,this.hide()}hide(){this.element.style.display="none"}show(){this.element.style.display="block"}}class g{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("header");e.classList.add(),this.element=e}}class m{constructor(t){i(this,"element");i(this,"verticalScroller");i(this,"horizontalScroller");i(this,"root");i(this,"handleScroll",()=>{const t=this.getViewportBoundlingRect();this.root.viewport.updateValues(t),this.root.renderSheet()});this.root=t;const{horizontalScroller:e,scroller:o,verticalScroller:s}=this.buildComponent();this.element=o,this.verticalScroller=s,this.horizontalScroller=e,this.element.style.height=this.root.config.view.height+"px",this.element.style.width=this.root.config.view.width+"px",this.updateScrollerSize(),this.element.addEventListener("scroll",this.handleScroll)}getViewportBoundlingRect(){const{scrollTop:t,scrollLeft:e}=this.element,{height:o,width:s}=this.element.getBoundingClientRect(),l=t+o,r=e+s;return{top:t,left:e,bottom:l,right:r}}buildComponent(){const t=document.createElement("div"),e=document.createElement("div"),o=document.createElement("div"),s=document.createElement("div"),l=document.createElement("div");return e.style.width="0px",e.style.pointerEvents="none",o.style.pointerEvents="none",s.style.display="flex",l.appendChild(e),l.appendChild(o),s.appendChild(l),this.verticalScroller=e,this.horizontalScroller=o,t.appendChild(s),t.classList.add("scroller"),{scroller:t,verticalScroller:e,horizontalScroller:o}}getActualHeight(){return this.root.config.rows.reduce((t,e)=>(t+=e.height,t),0)}getActualWidth(){return this.root.config.columns.reduce((t,e)=>(t+=e.width,t),0)}updateScrollerSize(){const t=this.getActualHeight(),e=this.getActualWidth();this.setScrollerHeight(t),this.setScrollerWidth(e)}setScrollerHeight(t){this.verticalScroller.style.height=t+"px"}setScrollerWidth(t){this.horizontalScroller.style.width=t+"px"}}class f{constructor(t){i(this,"element");i(this,"ctx");i(this,"root");this.root=t;const e=document.createElement("canvas");e.classList.add("sheet"),e.height=this.root.config.view.height,e.width=this.root.config.view.width,e.style.width=this.root.config.view.width+"px",e.style.height=this.root.config.view.height+"px",this.element=e;const o=this.element.getContext("2d");if(!o)throw new Error("Enable hardware acceleration");this.ctx=o}renderCell(t){const{column:e,row:o}=t;this.root.data[o][e].render(this.root)}renderSheet(){const t=this.root.viewport.firstRow,e=this.root.viewport.lastCol+3,o=this.root.viewport.lastRow+3,s=this.root.viewport.firstCol;console.log();let l=0;for(let r=t;r<=o;r++){for(let n=s;n<=e&&!(!this.root.config.columns[n]||!this.root.config.rows[r]);n++)this.renderCell({column:n,row:r});l++}console.log(`Rendered ${l} rows!`)}}class p{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("div");e.classList.add("spreadsheet_container"),this.element=e,this.changeElementSizes(this.root.viewProps)}changeElementSizes(t){const{height:e,width:o}=t;this.element.style.width=o+"px",this.element.style.height=e+"px"}}class v{constructor(t){i(this,"element");i(this,"root");this.root=t;const e=document.createElement("div");e.classList.add("toolbar"),this.element=e}}class c{constructor(t){i(this,"rows");i(this,"columns");i(this,"view",{width:800,height:600});this.columns=t.columns,this.rows=t.rows,this.view=t.view}}class C{}class y{constructor(t,e){i(this,"root");i(this,"top");i(this,"left");i(this,"right");i(this,"bottom");i(this,"firstRow");i(this,"lastRow");i(this,"firstCol");i(this,"lastCol");this.root=t,this.top=e.top,this.left=e.left,this.right=e.right,this.bottom=e.bottom,this.firstRow=this.getFirstRow(),this.lastCol=this.getFirstRow();//!Temp this.firstCol=this.getFirstRow();//!Temp -this.lastRow=this.getLastRow(),this.updateValues({top:0,left:0,right:this.root.viewProps.width,bottom:this.root.viewProps.height})}updateValues(t){this.top=t.top,this.left=t.left,this.right=t.right,this.bottom=t.bottom,this.firstRow=this.getFirstRow(),this.lastRow=this.getLastRow(),this.firstCol=this.getFirstCol(),this.lastCol=this.getLastCol(),console.log({first:this.firstCol,last:this.lastCol})}getFirstRow(){let t=0;for(let e=0,o=0;o<=this.top;e++)o+=this.root.config.rows[e].height,t=e;return t}getLastRow(){let t=this.getFirstRow(),e=this.top;for(;e<=this.bottom&&(e+=this.root.config.rows[t].height,!(e>=this.bottom));)t++;return t}getFirstCol(){let t=0,e=0;for(;e<=this.left&&(e+=this.root.config.columns[t].width,!(e>=this.left));)t+=1;return t}getLastCol(){let t=this.getFirstCol(),e=this.left;for(;e<=this.right&&(e+=this.root.config.columns[t].width,!(e>=this.right));)t++;return t}}class S{constructor(t,e){i(this,"x");i(this,"y");i(this,"width");i(this,"height");this.x=this.getXCoord(e.column,t),this.y=this.getYCoord(e.row,t),this.width=t.columns[e.column].width,this.height=t.rows[e.row].height}getXCoord(t,e){let o=0;for(let s=0;s=this.bottom));)t++;return t}getFirstCol(){let t=0,e=0;for(;e<=this.left&&(e+=this.root.config.columns[t].width,!(e>=this.left));)t+=1;return t}getLastCol(){let t=this.getFirstCol(),e=this.left;for(;e<=this.right&&(e+=this.root.config.columns[t].width,!(e>=this.right));)t++;return t}}class S{constructor(t,e){i(this,"x");i(this,"y");i(this,"width");i(this,"height");this.x=this.getXCoord(e.column,t),this.y=this.getYCoord(e.row,t),this.width=t.columns[e.column].width,this.height=t.rows[e.row].height}getXCoord(t,e){let o=0;for(let s=0;s