@ninebone/table 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3350,7 +3350,7 @@ const Qo = class Qo {
3350
3350
  const g = u === 0 ? "active" : "", f = c.id || `sheet${u + 1}`, b = `<nine-table-sheet class="${g}" data-index="${u}" data-sheet-id="${f}" id="${f}"></nine-table-sheet>`, m = u < i - 1 ? `<nine-splitter class="h" data-split-index="${u}"></nine-splitter>` : "";
3351
3351
  return b + m;
3352
3352
  }).join(""), o = ["layout.css", "nine-table-sheet.css"], l = o.map(
3353
- (c) => `@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.35/dist/css/${c}";`
3353
+ (c) => `@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.37/dist/css/${c}";`
3354
3354
  ), a = [];
3355
3355
  nine.cssPath && o.forEach((c) => {
3356
3356
  a.push(`@import "${nine.cssPath}/${c}";`);
@@ -273,7 +273,7 @@
273
273
 
274
274
  <div class="ng-col-mover-grip"></div>
275
275
  <div class="ng-col-mover-indi"></div>
276
- `,v.log("3333*****************"),p(this,Je,{mainBody:this.querySelector(".ng-sheet-body .ng-container-body"),hscrollbar:this.querySelector("nine-table-hscrollbar"),vscrollbar:this.querySelector("nine-table-vscrollbar"),content:this.querySelector(".ng-sheet-body .ng-sheet-body-content"),scrollHolder:this.querySelector(".ng-sheet-body .ng-virtual-height-holder")}),v.log("444*****************")},"#render"));d(this,Ir,h(()=>{v.log("**********************","#syncHeaderAndFooterHeights");const e=this.querySelector(".ng-container-left table"),s=this.querySelector(".ng-container-body table"),i=this.querySelector(".ng-container-right table"),r=Array.from(e.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),o=Array.from(s.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),l=Array.from(i.querySelectorAll("thead tr:not(.col-indicator-rowgroup)"));t(this,Ri).call(this,r,o,l);const a=Array.from(e.querySelectorAll("tfoot tr")),c=Array.from(s.querySelectorAll("tfoot tr")),u=Array.from(i.querySelectorAll("tfoot tr"));t(this,Ri).call(this,a,c,u)},"#syncHeaderAndFooterHeights"));d(this,Ri,h((e,s,i)=>{var o,l,a;const r=Math.max(e.length,s.length,i.length);for(let c=0;c<r;c++){const u=[((o=e[c])==null?void 0:o.getBoundingClientRect().height)||0,((l=s[c])==null?void 0:l.getBoundingClientRect().height)||0,((a=i[c])==null?void 0:a.getBoundingClientRect().height)||0],g=Math.max(...u);g>0&&(e[c]&&(e[c].style.height=`${g}px`),s[c]&&(s[c].style.height=`${g}px`),i[c]&&(i[c].style.height=`${g}px`))}},"#applyMaxHeights"));d(this,qr,h(()=>{const e=this.querySelector(".ng-sheet-body");if(!e)return;let s=null;e.addEventListener("mouseover",i=>{const r=i.target.closest("tr");if(!r||!r.dataset.row&&r.dataset.row!=="0")return;const o=r.dataset.row;s!==o&&(s=o,e.querySelectorAll(`tr[data-row="${o}"]`).forEach(l=>{l.classList.add("hover")}))}),e.addEventListener("mouseout",i=>{const r=i.target.closest("tr");if(!r)return;const o=i.relatedTarget;r.contains(o)||(e.querySelectorAll("tr.hover").forEach(l=>{l.classList.remove("hover")}),s=null)})},"#initRowHoverEvent"));v.log("11111"),p(this,zt,new Hn(this)),v.log("222"),p(this,ae,this.getRootNode().host),v.log("333")}connectedCallback(){t(this,Tr).call(this)}get index(){return t(this,wi)}get colResizer(){return t(this,Ee)}get filtering(){return t(this,Ei)}get grouping(){return t(this,ws)}get colMover(){return t(this,xs)}get colFix(){return t(this,Ai)}get rowManager(){return t(this,zt)}get selection(){return t(this,vi)}get navigation(){return t(this,Si)}get templateLength(){return t(this,qt).tbody.tr.length||0}get elements(){return t(this,Je)}get isAutoFitCol(){var i,r;const e=this.getAttribute("auto-fit-col")==="true"||((i=t(this,ae))==null?void 0:i.getAttribute("auto-fit-col"))==="true",s=((r=t(this,qt).table)==null?void 0:r.getAttribute("auto-fit-col"))==="true";return e||s}get sourceTable(){return t(this,qt).table}get source(){return t(this,qt)}recompileAndRefresh(){var e;t(this,qt).table&&(fe.recompile(t(this,qt).table),["left","right","body"].forEach(s=>{["header","body","footer"].forEach(i=>{const r=this.querySelector(`.ng-sheet-${i} .ng-container-${s}`);r&&r.querySelectorAll("table").forEach(o=>o.remove())})}),t(this,Li).call(this),t(this,Qe).call(this),t(this,zt).initialize(),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),requestAnimationFrame(()=>{var s;t(this,Qe).call(this),(s=t(this,zt))==null||s.refresh()}))}refreshLayout(){!this.classList.contains("active")||!t(this,qt).table||requestAnimationFrame(()=>{var e,s,i;t(this,Qe).call(this),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),t(this,Lr).call(this),(s=t(this,Ee))==null||s.refreshLayout(),(i=t(this,zt))==null||i.refresh()})}get view(){var e;return!t(this,Ze)&&((e=t(this,ae))!=null&&e.data)&&p(this,Ze,new Vi(this)),t(this,Ze)}disconnectedCallback(){var e,s;(e=t(this,Ee))==null||e.destroy(),(s=t(this,xs))==null||s.destroy(),this.innerHTML=""}};wi=new WeakMap,ae=new WeakMap,zt=new WeakMap,vi=new WeakMap,Si=new WeakMap,Ee=new WeakMap,xs=new WeakMap,Ai=new WeakMap,Ar=new WeakMap,Ei=new WeakMap,ws=new WeakMap,Ze=new WeakMap,qt=new WeakMap,Je=new WeakMap,Er=new WeakSet,Yl=h(function(){return t(this,ae).hasAttribute("simple")||t(this,ae).getAttribute("theme")==="simple"},"#isSimple"),Lr=new WeakMap,Rr=new WeakMap,Qe=new WeakMap,Li=new WeakMap,Cr=new WeakMap,Tr=new WeakMap,kr=new WeakMap,Ir=new WeakMap,Ri=new WeakMap,qr=new WeakMap,h(Ci,"NineTableSheet"),E(Ci,"SCROLLBAR_SIZE",16);let Xi=Ci;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Xi);const Do=class Do{constructor(n){d(this,it);d(this,Mr,h(()=>{t(this,Hr).call(this),new ResizeObserver(n=>{for(let e of n)t(this,it).getAttribute("auto-height")==="true"&&t(this,Ti).call(this)}).observe(t(this,it))},"#init"));d(this,Ti,h(()=>{const n=Array.from(t(this,it).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(n.length===0)return;const e=parseInt(t(this,it).getAttribute("max-display-row"),10)||10,s=Math.max(...n.map(u=>u.getRowHeight())),i=t(this,it).shadowRoot.querySelector("nine-table-toolbar"),r=t(this,it).shadowRoot.querySelector("nine-table-sheets-footer"),o=i?i.getBoundingClientRect().height:0,l=r?r.getBoundingClientRect().height:0,a=Xi.SCROLLBAR_SIZE,c=e*s+o+l+a;t(this,it).style.height=`${c}px`},"#applyAutoHeight"));d(this,Hr,h(()=>{const e=Array.from(t(this,it).children).filter(c=>c.tagName.toUpperCase()==="TABLE"),s=t(this,it).getAttribute("auto-height")==="true",i=e.length,r=e.map((c,u)=>{const g=u===0?"active":"",f=c.id||`sheet${u+1}`,b=`<nine-table-sheet class="${g}" data-index="${u}" data-sheet-id="${f}" id="${f}"></nine-table-sheet>`,m=u<i-1?`<nine-splitter class="h" data-split-index="${u}"></nine-splitter>`:"";return b+m}).join(""),o=["layout.css","nine-table-sheet.css"],l=o.map(c=>`@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.35/dist/css/${c}";`),a=[];nine.cssPath&&o.forEach(c=>{a.push(`@import "${nine.cssPath}/${c}";`)}),t(this,it).shadowRoot.innerHTML=`
276
+ `,v.log("3333*****************"),p(this,Je,{mainBody:this.querySelector(".ng-sheet-body .ng-container-body"),hscrollbar:this.querySelector("nine-table-hscrollbar"),vscrollbar:this.querySelector("nine-table-vscrollbar"),content:this.querySelector(".ng-sheet-body .ng-sheet-body-content"),scrollHolder:this.querySelector(".ng-sheet-body .ng-virtual-height-holder")}),v.log("444*****************")},"#render"));d(this,Ir,h(()=>{v.log("**********************","#syncHeaderAndFooterHeights");const e=this.querySelector(".ng-container-left table"),s=this.querySelector(".ng-container-body table"),i=this.querySelector(".ng-container-right table"),r=Array.from(e.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),o=Array.from(s.querySelectorAll("thead tr:not(.col-indicator-rowgroup)")),l=Array.from(i.querySelectorAll("thead tr:not(.col-indicator-rowgroup)"));t(this,Ri).call(this,r,o,l);const a=Array.from(e.querySelectorAll("tfoot tr")),c=Array.from(s.querySelectorAll("tfoot tr")),u=Array.from(i.querySelectorAll("tfoot tr"));t(this,Ri).call(this,a,c,u)},"#syncHeaderAndFooterHeights"));d(this,Ri,h((e,s,i)=>{var o,l,a;const r=Math.max(e.length,s.length,i.length);for(let c=0;c<r;c++){const u=[((o=e[c])==null?void 0:o.getBoundingClientRect().height)||0,((l=s[c])==null?void 0:l.getBoundingClientRect().height)||0,((a=i[c])==null?void 0:a.getBoundingClientRect().height)||0],g=Math.max(...u);g>0&&(e[c]&&(e[c].style.height=`${g}px`),s[c]&&(s[c].style.height=`${g}px`),i[c]&&(i[c].style.height=`${g}px`))}},"#applyMaxHeights"));d(this,qr,h(()=>{const e=this.querySelector(".ng-sheet-body");if(!e)return;let s=null;e.addEventListener("mouseover",i=>{const r=i.target.closest("tr");if(!r||!r.dataset.row&&r.dataset.row!=="0")return;const o=r.dataset.row;s!==o&&(s=o,e.querySelectorAll(`tr[data-row="${o}"]`).forEach(l=>{l.classList.add("hover")}))}),e.addEventListener("mouseout",i=>{const r=i.target.closest("tr");if(!r)return;const o=i.relatedTarget;r.contains(o)||(e.querySelectorAll("tr.hover").forEach(l=>{l.classList.remove("hover")}),s=null)})},"#initRowHoverEvent"));v.log("11111"),p(this,zt,new Hn(this)),v.log("222"),p(this,ae,this.getRootNode().host),v.log("333")}connectedCallback(){t(this,Tr).call(this)}get index(){return t(this,wi)}get colResizer(){return t(this,Ee)}get filtering(){return t(this,Ei)}get grouping(){return t(this,ws)}get colMover(){return t(this,xs)}get colFix(){return t(this,Ai)}get rowManager(){return t(this,zt)}get selection(){return t(this,vi)}get navigation(){return t(this,Si)}get templateLength(){return t(this,qt).tbody.tr.length||0}get elements(){return t(this,Je)}get isAutoFitCol(){var i,r;const e=this.getAttribute("auto-fit-col")==="true"||((i=t(this,ae))==null?void 0:i.getAttribute("auto-fit-col"))==="true",s=((r=t(this,qt).table)==null?void 0:r.getAttribute("auto-fit-col"))==="true";return e||s}get sourceTable(){return t(this,qt).table}get source(){return t(this,qt)}recompileAndRefresh(){var e;t(this,qt).table&&(fe.recompile(t(this,qt).table),["left","right","body"].forEach(s=>{["header","body","footer"].forEach(i=>{const r=this.querySelector(`.ng-sheet-${i} .ng-container-${s}`);r&&r.querySelectorAll("table").forEach(o=>o.remove())})}),t(this,Li).call(this),t(this,Qe).call(this),t(this,zt).initialize(),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),requestAnimationFrame(()=>{var s;t(this,Qe).call(this),(s=t(this,zt))==null||s.refresh()}))}refreshLayout(){!this.classList.contains("active")||!t(this,qt).table||requestAnimationFrame(()=>{var e,s,i;t(this,Qe).call(this),this.isAutoFitCol?this.autoFit(!0):(e=this.querySelector("nine-table-hscrollbar"))==null||e.refresh(),t(this,Lr).call(this),(s=t(this,Ee))==null||s.refreshLayout(),(i=t(this,zt))==null||i.refresh()})}get view(){var e;return!t(this,Ze)&&((e=t(this,ae))!=null&&e.data)&&p(this,Ze,new Vi(this)),t(this,Ze)}disconnectedCallback(){var e,s;(e=t(this,Ee))==null||e.destroy(),(s=t(this,xs))==null||s.destroy(),this.innerHTML=""}};wi=new WeakMap,ae=new WeakMap,zt=new WeakMap,vi=new WeakMap,Si=new WeakMap,Ee=new WeakMap,xs=new WeakMap,Ai=new WeakMap,Ar=new WeakMap,Ei=new WeakMap,ws=new WeakMap,Ze=new WeakMap,qt=new WeakMap,Je=new WeakMap,Er=new WeakSet,Yl=h(function(){return t(this,ae).hasAttribute("simple")||t(this,ae).getAttribute("theme")==="simple"},"#isSimple"),Lr=new WeakMap,Rr=new WeakMap,Qe=new WeakMap,Li=new WeakMap,Cr=new WeakMap,Tr=new WeakMap,kr=new WeakMap,Ir=new WeakMap,Ri=new WeakMap,qr=new WeakMap,h(Ci,"NineTableSheet"),E(Ci,"SCROLLBAR_SIZE",16);let Xi=Ci;customElements.get("nine-table-sheet")||customElements.define("nine-table-sheet",Xi);const Do=class Do{constructor(n){d(this,it);d(this,Mr,h(()=>{t(this,Hr).call(this),new ResizeObserver(n=>{for(let e of n)t(this,it).getAttribute("auto-height")==="true"&&t(this,Ti).call(this)}).observe(t(this,it))},"#init"));d(this,Ti,h(()=>{const n=Array.from(t(this,it).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(n.length===0)return;const e=parseInt(t(this,it).getAttribute("max-display-row"),10)||10,s=Math.max(...n.map(u=>u.getRowHeight())),i=t(this,it).shadowRoot.querySelector("nine-table-toolbar"),r=t(this,it).shadowRoot.querySelector("nine-table-sheets-footer"),o=i?i.getBoundingClientRect().height:0,l=r?r.getBoundingClientRect().height:0,a=Xi.SCROLLBAR_SIZE,c=e*s+o+l+a;t(this,it).style.height=`${c}px`},"#applyAutoHeight"));d(this,Hr,h(()=>{const e=Array.from(t(this,it).children).filter(c=>c.tagName.toUpperCase()==="TABLE"),s=t(this,it).getAttribute("auto-height")==="true",i=e.length,r=e.map((c,u)=>{const g=u===0?"active":"",f=c.id||`sheet${u+1}`,b=`<nine-table-sheet class="${g}" data-index="${u}" data-sheet-id="${f}" id="${f}"></nine-table-sheet>`,m=u<i-1?`<nine-splitter class="h" data-split-index="${u}"></nine-splitter>`:"";return b+m}).join(""),o=["layout.css","nine-table-sheet.css"],l=o.map(c=>`@import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.37/dist/css/${c}";`),a=[];nine.cssPath&&o.forEach(c=>{a.push(`@import "${nine.cssPath}/${c}";`)}),t(this,it).shadowRoot.innerHTML=`
277
277
  <style>
278
278
  ${[...l,...a].join(`
279
279
  `)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninebone/table",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Grid component for real-time collaboration (Vanilla JS based)",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-table.umd.js",