@ninebone/grid 0.0.115 → 0.0.116
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 -4
- 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,Ze,this.shadowRoot.querySelector("input")),f(this,Ze).addEventListener("keydown",f(this,Ph)),f(this,Ze).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,Ze).addEventListener("compositionupdate",c=>{f(this,gs)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ze).addEventListener("compositionend",c=>{}),f(this,Ze).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)))})}}Ze=new WeakMap,gs=new WeakMap,Wr=new WeakMap,Bs=new WeakMap,bn=new WeakMap,es=new WeakMap,Ph=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",Dd);class Bd{constructor(E){Y(this,Oe);Y(this,di);Y(this,yn);Y(this,vn);Y(this,wn);it(this,"getTotalHeight",()=>{let E=0;const t=f(this,Oe).data.get();trace.log(t);for(var l=0;l<t.length;l++)
|
|
502
|
+
`,super.connectedCallback(),tt(this,Ze,this.shadowRoot.querySelector("input")),f(this,Ze).addEventListener("keydown",f(this,Ph)),f(this,Ze).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,Ze).addEventListener("compositionupdate",c=>{f(this,gs)=="number"&&(c.target.value=c.target.value.replace(c.data,""))}),f(this,Ze).addEventListener("compositionend",c=>{}),f(this,Ze).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)))})}}Ze=new WeakMap,gs=new WeakMap,Wr=new WeakMap,Bs=new WeakMap,bn=new WeakMap,es=new WeakMap,Ph=new WeakMap,customElements.get("ng-input")||customElements.define("ng-input",Dd);class Bd{constructor(E){Y(this,Oe);Y(this,di);Y(this,yn);Y(this,vn);Y(this,wn);it(this,"getTotalHeight",()=>{let E=0;const t=f(this,Oe).data.get();trace.log(t);for(var l=0;l<t.length;l++)trace.log(t[l]);return E});it(this,"getHeight",E=>{const t=parseInt(E/f(this,Oe).template.length);if(t<0||t>=f(this,Oe).data.count())return 32;const l=f(this,Oe).data.__ng(t);return l?l.height[parseInt(E%f(this,Oe).template.length)]:32});it(this,"setHeight",(E,t)=>{f(this,Oe).data.get(parseInt(E/f(this,Oe).template.length)).__ng.height[parseInt(E%f(this,Oe).template.length)]=t});Y(this,fi,E=>typeof E=="object"&&E.tagName=="TR"?parseInt(E.getAttribute("data-row"))*f(this,Oe).template.length+E.sectionRowIndex%f(this,Oe).template.length:E);it(this,"attr",(E,t,l,c)=>{t=f(this,fi).call(this,t);var o=parseInt(t/f(this,Oe).template.length),r=f(this,Oe).data.get(o,"rowid"),n=t%f(this,Oe).template.length,s=H.decode(E,"head",f(this,yn),"foot",f(this,wn),f(this,vn)),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",(E,t,l)=>{var c=this.attr(E,t,"height",l);return c||(c=$(f(this,Oe).template[f(this,fi).call(this,t)%f(this,Oe).template.length]).height()),c});it(this,"attr2",(E,t,l,c,o)=>{l=f(this,fi).call(this,l);var r=parseInt(l/f(this,Oe).template.length),n=E&&E.hasOwnProperty("rowid")?E[r].rowid:null,s=l%f(this,Oe).template.length,e=H.decode(t,"head",f(this,yn),"foot",f(this,wn),f(this,vn)),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",(E,t,l,c)=>{var o=this.attr2(E,t,l,"height",c);return o||(o=$(f(this,Oe).template[f(this,fi).call(this,l)%f(this,Oe).template.length]).height()),o});tt(this,Oe,E),tt(this,di,-1),tt(this,yn,[]),tt(this,vn,[]),tt(this,wn,[]),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)}}get row(){return f(this,di)}set row(E){tt(this,di,parseInt(E)),f(this,Oe).selection.selectedStartRow==f(this,Oe).selection.selectedEndRow&&(f(this,Oe).selection.selectedStartRow=f(this,Oe).selection.selectedEndRow=f(this,Oe).selection.startRow=f(this,di))}}Oe=new WeakMap,di=new WeakMap,yn=new WeakMap,vn=new WeakMap,wn=new WeakMap,fi=new WeakMap;class Fd extends HTMLElement{constructor(){super();Y(this,rs);Y(this,ss);it(this,"popup",()=>{setTimeout(()=>{f(this,ss).data.assign(f(this,rs).data.get()),this.shadowRoot.querySelector("dialog").showModal()},100)});this.attachShadow({mode:"open"})}connectedCallback(){tt(this,rs,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 {
|