@ninebone/table 0.1.30 → 0.1.32

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.
@@ -3961,7 +3961,7 @@ const Qo = class Qo {
3961
3961
  }).join(""), o = nine.cssPath ? `@import "${nine.cssPath}/layout.css";` : "";
3962
3962
  t(this, et).shadowRoot.innerHTML = `
3963
3963
  <style>
3964
- @import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.30/dist/css/layout.css";
3964
+ @import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.32/dist/css/layout.css";
3965
3965
  ${o}
3966
3966
  </style>
3967
3967
 
@@ -882,7 +882,7 @@ nine-table-sheet tr.ng-sticky-header td {
882
882
  <div class="ng-col-mover-indi"></div>
883
883
  `,v.log("3333*****************"),g(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,qn,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"),n=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,n,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 n=Math.max(e.length,s.length,i.length);for(let c=0;c<n;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],p=Math.max(...u);p>0&&(e[c]&&(e[c].style.height=`${p}px`),s[c]&&(s[c].style.height=`${p}px`),i[c]&&(i[c].style.height=`${p}px`))}},"#applyMaxHeights"));d(this,Mn,h(()=>{const e=this.querySelector(".ng-sheet-body");if(!e)return;let s=null;e.addEventListener("mouseover",i=>{const n=i.target.closest("tr");if(!n||!n.dataset.row&&n.dataset.row!=="0")return;const o=n.dataset.row;s!==o&&(s=o,e.querySelectorAll(`tr[data-row="${o}"]`).forEach(l=>{l.classList.add("hover")}))}),e.addEventListener("mouseout",i=>{const n=i.target.closest("tr");if(!n)return;const o=i.relatedTarget;n.contains(o)||(e.querySelectorAll("tr.hover").forEach(l=>{l.classList.remove("hover")}),s=null)})},"#initRowHoverEvent"));v.log("11111"),g(this,Ot,new Hr(this)),v.log("222"),g(this,ae,this.getRootNode().host),v.log("333")}connectedCallback(){t(this,Tn).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,Ot)}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,n;const e=this.getAttribute("auto-fit-col")==="true"||((i=t(this,ae))==null?void 0:i.getAttribute("auto-fit-col"))==="true",s=((n=t(this,qt).table)==null?void 0:n.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 n=this.querySelector(`.ng-sheet-${i} .ng-container-${s}`);n&&n.querySelectorAll("table").forEach(o=>o.remove())})}),t(this,Li).call(this),t(this,Qe).call(this),t(this,Ot).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,Ot))==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,Rn).call(this),(s=t(this,Ee))==null||s.refreshLayout(),(i=t(this,Ot))==null||i.refresh()})}get view(){var e;return!t(this,Ze)&&((e=t(this,ae))!=null&&e.data)&&g(this,Ze,new Pi(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,Ot=new WeakMap,vi=new WeakMap,Si=new WeakMap,Ee=new WeakMap,xs=new WeakMap,Ai=new WeakMap,En=new WeakMap,Ei=new WeakMap,ws=new WeakMap,Ze=new WeakMap,qt=new WeakMap,Je=new WeakMap,Ln=new WeakSet,Yl=h(function(){return t(this,ae).hasAttribute("simple")||t(this,ae).getAttribute("theme")==="simple"},"#isSimple"),Rn=new WeakMap,Cn=new WeakMap,Qe=new WeakMap,Li=new WeakMap,kn=new WeakMap,Tn=new WeakMap,In=new WeakMap,qn=new WeakMap,Ri=new WeakMap,Mn=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(r){d(this,it);d(this,Hn,h(()=>{t(this,Nn).call(this),new ResizeObserver(r=>{for(let e of r)t(this,it).getAttribute("auto-height")==="true"&&t(this,ki).call(this)}).observe(t(this,it))},"#init"));d(this,ki,h(()=>{const r=Array.from(t(this,it).shadowRoot.querySelectorAll("nine-table-sheet.active"));if(r.length===0)return;const e=parseInt(t(this,it).getAttribute("max-display-row"),10)||10,s=Math.max(...r.map(u=>u.getRowHeight())),i=t(this,it).shadowRoot.querySelector("nine-table-toolbar"),n=t(this,it).shadowRoot.querySelector("nine-table-sheets-footer"),o=i?i.getBoundingClientRect().height:0,l=n?n.getBoundingClientRect().height:0,a=Xi.SCROLLBAR_SIZE,c=e*s+o+l+a;t(this,it).style.height=`${c}px`},"#applyAutoHeight"));d(this,Nn,h(()=>{const e=Array.from(t(this,it).children).filter(l=>l.tagName.toUpperCase()==="TABLE"),s=t(this,it).getAttribute("auto-height")==="true",i=e.length,n=e.map((l,a)=>{const c=a===0?"active":"",u=l.id||`sheet${a+1}`,p=`<nine-table-sheet class="${c}" data-index="${a}" data-sheet-id="${u}" id="${u}"></nine-table-sheet>`,f=a<i-1?`<nine-splitter class="h" data-split-index="${a}"></nine-splitter>`:"";return p+f}).join(""),o=nine.cssPath?`@import "${nine.cssPath}/layout.css";`:"";t(this,it).shadowRoot.innerHTML=`
884
884
  <style>
885
- @import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.30/dist/css/layout.css";
885
+ @import "https://cdn.jsdelivr.net/npm/@ninebone/table@0.1.32/dist/css/layout.css";
886
886
  ${o}
887
887
  </style>
888
888
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninebone/table",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Grid component for real-time collaboration (Vanilla JS based)",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-table.umd.js",