@ninebone/grid 0.0.55 → 0.0.56
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.
- package/dist/nine-grid.js +1 -1
- package/dist/nine-grid.js.map +1 -1
- package/dist/nine-grid.umd.js +1 -1
- package/dist/nine-grid.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-grid.umd.js
CHANGED
|
@@ -499,7 +499,7 @@ use chrome, FireFox or Internet Explorer 11`)}var s=t("safe-buffer"),e=t("random
|
|
|
499
499
|
${t.join(" ")}
|
|
500
500
|
ondragstart="return false;"
|
|
501
501
|
>
|
|
502
|
-
`,super.connectedCallback(),tt(this,Ke,this.shadowRoot.querySelector("input")),f(this,Ke).addEventListener("keydown",f(this,$h)),f(this,Ke).addEventListener("compositionstart",c=>{c.target.selectionStart==c.target.selectionEnd&&f(this,Wr)&&H.getByteLength(c.target.value)>=Number(f(this,Wr))&&(c.target.value=H.cut(c.target.value,Number(f(this,Wr))),this.value=c.target.value)}),f(this,Ke).addEventListener("compositionupdate",c=>{f(this,ms)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ke).addEventListener("compositionend",c=>{}),f(this,Ke).addEventListener("keydown",c=>{c.isComposing||c.keyCode===229||(["Enter","Escape"].includes(c.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown"].includes(c.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(c)))})}}Ke=new WeakMap,ms=new WeakMap,Wr=new WeakMap,Ds=new WeakMap,gn=new WeakMap,ts=new WeakMap,$h=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",jd);class $d{constructor(C){Y(this,ke);Y(this,ui);Y(this,bn);Y(this,yn);Y(this,vn);Y(this,di,[]);it(this,"getHeight",C=>{const t=parseInt(C/f(this,ke).template.length);if(t<0||t>=f(this,ke).data.count())return 32;const l=f(this,ke).data.__ng(t);return l?l.height[parseInt(C%f(this,ke).template.length)]:32});it(this,"setHeight",(C,t)=>{f(this,ke).data.get(parseInt(C/f(this,ke).template.length)).__ng.height[parseInt(C%f(this,ke).template.length)]=t});Y(this,fi,C=>typeof C=="object"&&C.tagName=="TR"?parseInt(C.getAttribute("data-row"))*f(this,ke).template.length+C.sectionRowIndex%f(this,ke).template.length:C);it(this,"attr",(C,t,l,c)=>{t=f(this,fi).call(this,t);var o=parseInt(t/f(this,ke).template.length),r=f(this,ke).data.get(o,"rowid"),n=t%f(this,ke).template.length,s=H.decode(C,"head",f(this,bn),"foot",f(this,vn),f(this,yn)),e=s.findIndex(u=>u.rowid==r&&u.subrow==n);if(c)if(e<0){var i={rowid:r,subrow:n,cells:[]};i[l]=c,s.push(i)}else s[e][l]=c;else return e<0?null:s[e][l]});it(this,"height",(C,t,l)=>{var c=this.attr(C,t,"height",l);return c||(c=$(f(this,ke).template[f(this,fi).call(this,t)%f(this,ke).template.length]).height()),c});it(this,"attr2",(C,t,l,c,o)=>{l=f(this,fi).call(this,l);var r=parseInt(l/f(this,ke).template.length),n=C&&C.hasOwnProperty("rowid")?C[r].rowid:null,s=l%f(this,ke).template.length,e=H.decode(t,"head",f(this,bn),"foot",f(this,vn),f(this,yn)),i=e.findIndex(a=>a.rowid==n&&a.subrow==s);if(o)if(i<0){var u={rowid:n,subrow:s,cells:[]};u[c]=o,e.push(u)}else e[i][c]=o;else return i<0?null:e[i][c]});it(this,"height2",(C,t,l,c)=>{var o=this.attr2(C,t,l,"height",c);return o||(o=$(f(this,ke).template[f(this,fi).call(this,l)%f(this,ke).template.length]).height()),o});tt(this,ke,C),tt(this,ui,-1),tt(this,bn,[]),tt(this,yn,[]),tt(this,vn,[]),this.head={attr:(t,l,c)=>this.attr("head",t,l,c),height:(t,l)=>this.height("head",t,l)},this.body={attr:(t,l,c)=>this.attr("body",t,l,c),height:(t,l)=>this.height("body",t,l),height2:(t,l,c)=>this.height2(t,"body",l,c)},this.foot={attr:(t,l,c)=>this.attr("foot",t,l,c),height:(t,l)=>this.height("foot",t,l)},tt(this,di,[0])}get row(){return f(this,ui)}set row(C){tt(this,ui,parseInt(C)),f(this,ke).selection.selectedStartRow==f(this,ke).selection.selectedEndRow&&(f(this,ke).selection.selectedStartRow=f(this,ke).selection.selectedEndRow=f(this,ke).selection.startRow=f(this,ui))}updateCumulativeHeights(){jr.log("***********************====================="),jr.log(f(this,ke).data),tt(this,di,[0]);let C=0;const t=f(this,ke).data.count();for(let l=0;l<t;l++){let c=0;for(let o=0;o<f(this,ke).template.length;o++)c+=this.getHeight(l*f(this,ke).template.length+o);C+=c,f(this,di).push(C)}jr.log(f(this,di))}getRowInfoAt(C){const t=this.cumulativeHeights;if(!t||t.length<2)return{index:0,offset:C};if(C<=0)return{index:0,offset:C};if(C>=t[t.length-1])return{index:t.length-2,offset:C-t[t.length-2]};let l=0,c=t.length-2,o=0;for(;l<=c;){let n=Math.floor((l+c)/2);t[n]<=C?(o=n,l=n+1):c=n-1}jr.log(o);const r=t[o];return{index:o,offset:C-r}}}ke=new WeakMap,ui=new WeakMap,bn=new WeakMap,yn=new WeakMap,vn=new WeakMap,di=new WeakMap,fi=new WeakMap;class Ld extends HTMLElement{constructor(){super();Y(this,es);Y(this,rs);it(this,"popup",()=>{setTimeout(()=>{f(this,rs).data.assign(f(this,es).data.get()),this.shadowRoot.querySelector("dialog").showModal()},100)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,es,this.getRootNode().host),this.shadowRoot.innerHTML=`
|
|
502
|
+
`,super.connectedCallback(),tt(this,Ke,this.shadowRoot.querySelector("input")),f(this,Ke).addEventListener("keydown",f(this,$h)),f(this,Ke).addEventListener("compositionstart",c=>{c.target.selectionStart==c.target.selectionEnd&&f(this,Wr)&&H.getByteLength(c.target.value)>=Number(f(this,Wr))&&(c.target.value=H.cut(c.target.value,Number(f(this,Wr))),this.value=c.target.value)}),f(this,Ke).addEventListener("compositionupdate",c=>{f(this,ms)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ke).addEventListener("compositionend",c=>{}),f(this,Ke).addEventListener("keydown",c=>{c.isComposing||c.keyCode===229||(["Enter","Escape"].includes(c.code)?this.owner.cell.currentCell=this.cell:["Tab","PageUp","PageDown","ArrowUp","ArrowDown"].includes(c.code)&&(this.owner.cell.currentCell=this.cell,this.owner.cell.moveCell(c)))})}}Ke=new WeakMap,ms=new WeakMap,Wr=new WeakMap,Ds=new WeakMap,gn=new WeakMap,ts=new WeakMap,$h=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",jd);class $d{constructor(C){Y(this,ke);Y(this,ui);Y(this,bn);Y(this,yn);Y(this,vn);Y(this,di,[]);it(this,"getHeight",C=>{const t=parseInt(C/f(this,ke).template.length);if(t<0||t>=f(this,ke).data.count())return 32;const l=f(this,ke).data.__ng(t);return l?l.height[parseInt(C%f(this,ke).template.length)]:32});it(this,"setHeight",(C,t)=>{f(this,ke).data.get(parseInt(C/f(this,ke).template.length)).__ng.height[parseInt(C%f(this,ke).template.length)]=t});Y(this,fi,C=>typeof C=="object"&&C.tagName=="TR"?parseInt(C.getAttribute("data-row"))*f(this,ke).template.length+C.sectionRowIndex%f(this,ke).template.length:C);it(this,"attr",(C,t,l,c)=>{t=f(this,fi).call(this,t);var o=parseInt(t/f(this,ke).template.length),r=f(this,ke).data.get(o,"rowid"),n=t%f(this,ke).template.length,s=H.decode(C,"head",f(this,bn),"foot",f(this,vn),f(this,yn)),e=s.findIndex(u=>u.rowid==r&&u.subrow==n);if(c)if(e<0){var i={rowid:r,subrow:n,cells:[]};i[l]=c,s.push(i)}else s[e][l]=c;else return e<0?null:s[e][l]});it(this,"height",(C,t,l)=>{var c=this.attr(C,t,"height",l);return c||(c=$(f(this,ke).template[f(this,fi).call(this,t)%f(this,ke).template.length]).height()),c});it(this,"attr2",(C,t,l,c,o)=>{l=f(this,fi).call(this,l);var r=parseInt(l/f(this,ke).template.length),n=C&&C.hasOwnProperty("rowid")?C[r].rowid:null,s=l%f(this,ke).template.length,e=H.decode(t,"head",f(this,bn),"foot",f(this,vn),f(this,yn)),i=e.findIndex(a=>a.rowid==n&&a.subrow==s);if(o)if(i<0){var u={rowid:n,subrow:s,cells:[]};u[c]=o,e.push(u)}else e[i][c]=o;else return i<0?null:e[i][c]});it(this,"height2",(C,t,l,c)=>{var o=this.attr2(C,t,l,"height",c);return o||(o=$(f(this,ke).template[f(this,fi).call(this,l)%f(this,ke).template.length]).height()),o});tt(this,ke,C),tt(this,ui,-1),tt(this,bn,[]),tt(this,yn,[]),tt(this,vn,[]),this.head={attr:(t,l,c)=>this.attr("head",t,l,c),height:(t,l)=>this.height("head",t,l)},this.body={attr:(t,l,c)=>this.attr("body",t,l,c),height:(t,l)=>this.height("body",t,l),height2:(t,l,c)=>this.height2(t,"body",l,c)},this.foot={attr:(t,l,c)=>this.attr("foot",t,l,c),height:(t,l)=>this.height("foot",t,l)},tt(this,di,[0])}get row(){return f(this,ui)}set row(C){tt(this,ui,parseInt(C)),f(this,ke).selection.selectedStartRow==f(this,ke).selection.selectedEndRow&&(f(this,ke).selection.selectedStartRow=f(this,ke).selection.selectedEndRow=f(this,ke).selection.startRow=f(this,ui))}updateCumulativeHeights(){jr.log("***********************====================="),jr.log(f(this,ke).data),tt(this,di,[0]);let C=0;const t=f(this,ke).data.count();for(let l=0;l<t;l++){let c=0;for(let o=0;o<f(this,ke).template.length;o++)c+=this.getHeight(l*f(this,ke).template.length+o);C+=c,f(this,di).push(C)}jr.log(f(this,di))}getRowInfoAt(C){const t=this.cumulativeHeights;if(!t||t.length<2)return{index:0,offset:C};if(C<=0)return{index:0,offset:C};if(C>=t[t.length-1])return{index:t.length-2,offset:C-t[t.length-2]};let l=0,c=t.length-2,o=0;for(;l<=c;){let n=Math.floor((l+c)/2);t[n]<=C?(o=n,l=n+1):c=n-1}jr.log(o,l,c);const r=t[o];return{index:o,offset:C-r}}}ke=new WeakMap,ui=new WeakMap,bn=new WeakMap,yn=new WeakMap,vn=new WeakMap,di=new WeakMap,fi=new WeakMap;class Ld extends HTMLElement{constructor(){super();Y(this,es);Y(this,rs);it(this,"popup",()=>{setTimeout(()=>{f(this,rs).data.assign(f(this,es).data.get()),this.shadowRoot.querySelector("dialog").showModal()},100)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,es,this.getRootNode().host),this.shadowRoot.innerHTML=`
|
|
503
503
|
<style>
|
|
504
504
|
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
|
|
505
505
|
:host {
|