slick-table 1.1.72 → 1.1.73
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/index.cjs.js
CHANGED
|
@@ -354,7 +354,7 @@ return o.version="2.30.1",r(Mt),o.fn=ye,o.min=Jw,o.max=eC,o.now=tC,o.utc=b,o.uni
|
|
|
354
354
|
.align_left {
|
|
355
355
|
text-align: left;
|
|
356
356
|
}
|
|
357
|
-
`;class Ib{constructor(){this.clientId=0,this.clientName="",this.cssStyles=QB}getClientName(){const t=document.createElement("tr"),n=document.createElement("th");return n.classList.add("align_left"),n.setAttribute("colspan","100%"),n.innerText=`${this.clientName} [${this.clientId}]`,t.append(n),t}columnNames(t){const n=document.createElement("tr");return(t.grid?.getColumns()||[]).filter(a=>a.forPrint).forEach(({name:a})=>{const l=document.createElement("th");l.classList.add("column_name"),typeof a=="string"?l.innerText=a:l.innerText=" ",n.append(l)}),n}tableNameAndTime(t){const n=document.createElement("tr");n.classList.add("heading");const o=document.createElement("th");o.setAttribute("colspan","2"),o.classList.add("table_name"),o.innerText=t.name||t.id,n.append(o);const r=document.createElement("th");return r.setAttribute("colspan","100%"),r.classList.add("date_stamp"),r.innerText=xe().format("MM/DD/YYYY h:mm A"),n.append(r),n}createStyleElement(){const t=document.createElement("style");return t.innerHTML=this.cssStyles,t}createTableElement(t){const n=document.createElement("table");return n.append(this.createThead(t)),n.append(this.createTbody(t)),n}createTbody(t){const n=document.createElement("tbody"),o=t.grid;if(!o)return n;const i=o.getColumns().filter(d=>d.forPrint),a=o.getData();return Bc(a).forEach((d,u)=>{const f=this.createTr(i,u,o);n.append(f)}),n.append(...this.totals(t)),n}filters(t){const n=[];if(t.filter){const o=t.filter.print(t);if(o.length){const r=document.createElement("tr"),i=document.createElement("th");i.setAttribute("colspan","100%"),i.classList.add("align_left"),i.innerText="Applied filters",r.append(i),n.push(r)}o.forEach(r=>{n.push(r)})}return n}totals(t){return[]}createThead(t){const n=document.createElement("thead");return n.append(this.getClientName()),n.append(this.tableNameAndTime(t)),n.append(...this.filters(t)),n.append(this.columnNames(t)),n}createTr(t,n,o){const r=document.createElement("tr"),i=o.getData(),a=i.getItem(n),l=a.__group,d=a.__groupTotals;if(l){const u=document.createElement("td");u.setAttribute("colspan","100%"),u.innerText=Vy(a.title),r.append(u)}else t.forEach(u=>{const f=document.createElement("td");u.cssClass&&f.classList.add(u.cssClass);const p=u.field,w=i.getItemMetadata(n)?.columns?.[p]?.formatter,b=u.printer||w||u.formatter;let m=a[p];if(d){const v=u.groupTotalsFormatter;m=v?v(a,u,o):""}else b&&(m=b(0,0,m,u,a,o));f.innerText=m||"",r.append(f)});return r}print(t,n,o){this.clientId=n,this.clientName=o;const r=window.open(),i=document.createElement("title");i.innerText=t.name||t.id;const a=r.document.querySelector("head");a.append(i),a.append(this.createStyleElement()),r.document.querySelector("body").append(this.createTableElement(t)),r.print()}}function JB(e){const t=document.querySelector(e);if(!t)return!0;const{scrollHeight:n,scrollWidth:o}=document.documentElement,{bottom:r,left:i,right:a,top:l}=t.getBoundingClientRect();return r<=0||i>=o||a<=0||l>=n}class eW{constructor(t){this.columnPicker=null,this.downloadManager=new ND,this.filter=new zN,this.hotKeysBehavior=new jy,this.summaryColumnIds=[],this._grid=null,this._grouping={},this._isActive=!1,this._isEdited=!1,this._lastActiveCell={row:0,cell:0},this._observers=[],this._printer=new Ib;const{columnPicker:n,downloadManager:o,filter:r,hotKeys:i,id:a,name:l,printer:d,summaryColumnIds:u,totalCalculator:f}=t;this.id=a,this.name=l||"",n&&(this.columnPicker=n),o&&(this.downloadManager=o),r&&(this.filter=r,this.filter.args={columnFilters:Jo.columnFilters.get(this.id)}),i&&(this.hotKeysBehavior=i),d&&(this.printer=d),u&&(this.summaryColumnIds=u),f&&(this.totalCalculator=f)}createGrid(t,n,o){this.reset();const r=new DB(`#${this.id}`,t,n,o);return this.grid=r,r.onKeyDown.subscribe(fm(r)),this.filter.register(r,this.id),this.grid}handleKeyboardEvent(t){JB(`#${this.id}`)||this.hotKeysBehavior.handleKeyboardEvent(t,this)}get grid(){return this._grid}get grouping(){return this._grouping}get isEdited(){return this._isEdited}set grid(t){this._grid=t}set grouping(t){if(this._grouping={...this._grouping,...t},!this.grid)return;const n=this.grid.getData();this.grouping.isGrouped?n.setGrouping(this.grouping.groups||[]):n.setGrouping([])}set isEdited(t){this._isEdited=t,this.notifyObservers()}set printer(t){this._printer=t}get printer(){return this._printer}get isActive(){return this._isActive}set isActive(t){this._isActive=t}get lastActiveSell(){return this._lastActiveCell}set lastActiveSell(t){this._lastActiveCell=t}resizeCanvas(){console.log(""),this.grid?.resizeCanvas()}registerObservers(t){~this._observers.indexOf(t)||this._observers.push(t)}notifyObservers(){for(const t of this._observers)t(this)}deleteObserver(t){const n=this._observers.indexOf(t);this._observers.splice(n,1)}reset(){this.grid?.onKeyDown.unsubscribe(fm(this.grid)),this.grid?.getSelectionModel()&&this.grid.setSelectedRows([]),this.hotKeysBehavior.resetQueue(),this.isEdited=!1,this.isActive=!1,this.grid=null}}class tW extends Ra{constructor(){super(...arguments),this.clientId=0,this.clientName="",this.x=0,this.y=0}}const ln=new tW;class nW extends Ra{constructor(){super(...arguments),this.x=0,this.y=0}}const fo=new nW;class oW extends Ra{constructor(){super(...arguments),this._open=!1,this.x=0,this.y=0}get open(){return this._open}set open(t){this._open=t,this.notify()}get table(){return this._table}set table(t){this._table=t}}const Bn=new oW,rW=e=>{const t=e.getLength()-1;return e.getItem(t)},Bh=e=>{const t=e.getData(),n=t.getIdPropertyName(),o=t.getItems();let r=0;return o.forEach(i=>{i[n]>r&&(r=i[n])}),r+1},Wh=()=>{Pb.commitCurrentEdit()};function Hh(e){return e.ctrlKey||e.metaKey}function zh(e){return Hh(e)&&e.keyCode===Qr.KeyB}function Nb(e){return e.shiftKey&&e.keyCode===Qr.KeyDel}function sW(e){return e.altKey&&e.keyCode===Qr.KeyS}function Yh(e){return Hh(e)&&e.keyCode===Qr.KeyY}function Uh(e){return Hh(e)&&e.keyCode===Qr.KeyZ}function iW(e){const t=e.getActiveCell();return!e.getSelectedRows().length&&!t}function aW(e){const t=lW(e),o=e.getData().getItems(),r=o.findIndex(a=>a.id===t)+1,i=o.length;return r||i}const Bc=e=>{const t=[];for(let n=0;n<e.getLength();n++)t.push(e.getItem(n));return t},Ab=e=>{const t=e.getSelectedRows(),n=e.getData(),o=Bc(n),r=n.getItems(),i=[],a=n.getIdPropertyName();let l=Bh(e);t.length?t.forEach(d=>{i.push({...o[d],[a]:l++,isEdited:!0,isNew:!0})}):i.push({[a]:l,isEdited:!0,isNew:!0}),r.splice(aW(e),0,...i),n.setItems(r),e.setSelectedRows([]),e.invalidate()},lW=e=>{const t=e.getData(),n=Bc(t),o=e.getActiveCell()?.row;return o!==void 0?(n[o]||n[n.length-1])?.id:0};function cW(e){return function(t){t.preventDefault(),Wh(),ln.table=e,ln.x=t.pageX||0,ln.y=t.pageY||0,ln.notify()}}function dW(e){return function(t){t.preventDefault(),Wh(),fo.table=e,fo.x=t.pageX||0,fo.y=t.pageY||0,fo.notify()}}class uW extends Ra{constructor(){super(...arguments),this._activeTable=null}get activeTable(){return this._activeTable}set activeTable(t){this._activeTable=t}}const Ei=new uW,hW=e=>{function t(){if(e.id!==Ei.activeTable?.id){e.isActive=!1;const o=e.grid;o?.resetActiveCell(),o?.setSelectedRows([])}}function n(){e.isActive=!0,Ei.activeTable=e,Ei.notify()}Ae.useEffect(()=>{Ei.subscribe(t),document.addEventListener("keydown",e.handleKeyboardEvent.bind(e));const o=document.getElementById(e.id);if(o)return o.addEventListener("click",n,!0),()=>{Ei.unsubscribe(t),document.removeEventListener("keydown",e.handleKeyboardEvent.bind(e)),o.removeEventListener("click",n,!0)}},[])},fW=e=>{const[t,n]=Ae.useState(pW(e));return Ae.useEffect(()=>{const o=r=>{n(i=>({...i,[r.id]:r.isEdited}))};return e.forEach(r=>{r.registerObservers(o)}),()=>{e.forEach(r=>{r.deleteObserver(o)})}},[]),Object.values(t).some(o=>o)};function pW(e){const t={};for(const n of e)t[n.id]=n.isEdited;return t}function mW(e){Ae.useEffect(()=>{function t(){e.grid?.resizeCanvas()}const n=Fv(t);return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[])}const gW=e=>{Ae.useEffect(()=>{function t(n){const o=n.grid;o&&n.totalCalculator?.calculate(o)}return e.registerObservers(t),()=>{e.deleteObserver(t)}},[])},yW=e=>{if(!e)return 0;if(typeof e=="number")return e;const t=e.replace(/\$|,|\s/g,""),n=t.replace(/\(|\)/g,"");return isNaN(Number(n))?0:t.startsWith("(")&&t.endsWith(")")?0-Number(n):Number(t)},Wr=function(){const e=function(x,S,C,O){for(C=C||{},O=x.length;O--;C[x[O]]=S);return C},t=[1,3],n=[1,4],o=[1,5],r=[1,6],i=[1,7],a=[1,9],l=[1,10],d=[1,11],u=[1,12],f=[1,13],p=[1,14],y=[1,15],w=[5,6,7,8,9,10,11,12,14],b=[5,6,7,14],m=[5,6,7,8,9,14],v={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"+":6,"-":7,"*":8,"/":9,"^":10,"!":11,"%":12,"(":13,")":14,NUMBER:15,E:16,PI:17,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"+",7:"-",8:"*",9:"/",10:"^",11:"!",12:"%",13:"(",14:")",15:"NUMBER",16:"E",17:"PI"},productions_:[0,[3,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,2],[4,3],[4,1],[4,1],[4,1]],performAction:function(S,C,O,A,F,B,R){const $=B.length-1;switch(F){case 1:return B[$-1];case 2:this.$=B[$-2]+B[$];break;case 3:this.$=B[$-2]-B[$];break;case 4:this.$=B[$-2]*B[$];break;case 5:this.$=B[$-2]/B[$];break;case 6:this.$=Math.pow(B[$-2],B[$]);break;case 7:this.$=function K(G){return G==0?1:K(G-1)*G}(B[$-1]);break;case 8:this.$=B[$-1]/100;break;case 9:this.$=-B[$];break;case 10:this.$=B[$-1];break;case 11:this.$=Number(S);break;case 12:this.$=Math.E;break;case 13:this.$=Math.PI;break}},table:[{3:1,4:2,7:t,13:n,15:o,16:r,17:i},{1:[3]},{5:[1,8],6:a,7:l,8:d,9:u,10:f,11:p,12:y},{4:16,7:t,13:n,15:o,16:r,17:i},{4:17,7:t,13:n,15:o,16:r,17:i},e(w,[2,11]),e(w,[2,12]),e(w,[2,13]),{1:[2,1]},{4:18,7:t,13:n,15:o,16:r,17:i},{4:19,7:t,13:n,15:o,16:r,17:i},{4:20,7:t,13:n,15:o,16:r,17:i},{4:21,7:t,13:n,15:o,16:r,17:i},{4:22,7:t,13:n,15:o,16:r,17:i},e(w,[2,7]),e(w,[2,8]),e(w,[2,9]),{6:a,7:l,8:d,9:u,10:f,11:p,12:y,14:[1,23]},e(b,[2,2],{8:d,9:u,10:f,11:p,12:y}),e(b,[2,3],{8:d,9:u,10:f,11:p,12:y}),e(m,[2,4],{10:f,11:p,12:y}),e(m,[2,5],{10:f,11:p,12:y}),e([5,6,7,8,9,10,14],[2,6],{11:p,12:y}),e(w,[2,10])],defaultActions:{8:[2,1]},parseError:function(S,C){if(C.recoverable)this.trace(S);else{const O=new Error(S);throw O.hash=C,O}},parse:function(S){const C=this;let O=[0],A=[null],F=[];const B=this.table;let R="",$=0,K=0;const G=2,q=1,Y=F.slice.call(arguments,1),z=Object.create(this.lexer),ae={yy:{}};for(let le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,le)&&(ae.yy[le]=this.yy[le]);z.setInput(S,ae.yy),ae.yy.lexer=z,ae.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});let N=z.yylloc;F.push(N);const M=z.options&&z.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;var L=function(){let le;return le=z.lex()||q,typeof le!="number"&&(le=C.symbols_[le]||le),le};let W,ne,oe,se;const j={};let ee,J,te,ce;for(;;){if(ne=O[O.length-1],this.defaultActions[ne]?oe=this.defaultActions[ne]:((W===null||typeof W>"u")&&(W=L()),oe=B[ne]&&B[ne][W]),typeof oe>"u"||!oe.length||!oe[0]){let le="";ce=[];for(ee in B[ne])this.terminals_[ee]&&ee>G&&ce.push("'"+this.terminals_[ee]+"'");z.showPosition?le="Parse error on line "+($+1)+`:
|
|
357
|
+
`;class Ib{constructor(){this.clientId=0,this.clientName="",this.cssStyles=QB}getClientName(){const t=document.createElement("tr"),n=document.createElement("th");return n.classList.add("align_left"),n.setAttribute("colspan","100%"),n.innerText=`${this.clientName} [${this.clientId}]`,t.append(n),t}columnNames(t){const n=document.createElement("tr");return(t.grid?.getColumns()||[]).filter(a=>a.forPrint).forEach(({name:a})=>{const l=document.createElement("th");l.classList.add("column_name"),typeof a=="string"?l.innerText=a:l.innerText=" ",n.append(l)}),n}tableNameAndTime(t){const n=document.createElement("tr");n.classList.add("heading");const o=document.createElement("th");o.setAttribute("colspan","2"),o.classList.add("table_name"),o.innerText=t.name||t.id,n.append(o);const r=document.createElement("th");return r.setAttribute("colspan","100%"),r.classList.add("date_stamp"),r.innerText=xe().format("MM/DD/YYYY h:mm A"),n.append(r),n}createStyleElement(){const t=document.createElement("style");return t.innerHTML=this.cssStyles,t}createTableElement(t){const n=document.createElement("table");return n.append(this.createThead(t)),n.append(this.createTbody(t)),n}createTbody(t){const n=document.createElement("tbody"),o=t.grid;if(!o)return n;const i=o.getColumns().filter(d=>d.forPrint),a=o.getData();return Bc(a).forEach((d,u)=>{const f=this.createTr(i,u,o);n.append(f)}),n.append(...this.totals(t)),n}filters(t){const n=[];if(t.filter){const o=t.filter.print(t);if(o.length){const r=document.createElement("tr"),i=document.createElement("th");i.setAttribute("colspan","100%"),i.classList.add("align_left"),i.innerText="Applied filters",r.append(i),n.push(r)}o.forEach(r=>{n.push(r)})}return n}totals(t){return[]}createThead(t){const n=document.createElement("thead");return n.append(this.getClientName()),n.append(this.tableNameAndTime(t)),n.append(...this.filters(t)),n.append(this.columnNames(t)),n}createTr(t,n,o){const r=document.createElement("tr"),i=o.getData(),a=i.getItem(n),l=a.__group,d=a.__groupTotals;if(l){const u=document.createElement("td");u.setAttribute("colspan","100%"),u.innerText=Vy(a.title),r.append(u)}else t.forEach(u=>{const f=document.createElement("td");u.cssClass&&f.classList.add(u.cssClass);const p=u.field,w=i.getItemMetadata(n)?.columns?.[p]?.formatter,b=u.printer||w||u.formatter;let m=a[p];if(d){const v=u.groupTotalsFormatter;m=v?v(a,u,o):""}else b&&(m=b(0,0,m,u,a,o));f.innerText=m||"",r.append(f)});return r}print(t,n,o){this.clientId=n,this.clientName=o;const r=window.open(),i=document.createElement("title");i.innerText=t.name||t.id;const a=r.document.querySelector("head");a.append(i),a.append(this.createStyleElement()),r.document.querySelector("body").append(this.createTableElement(t)),r.print()}}function JB(e){const t=document.querySelector(e);if(!t)return!0;const{scrollHeight:n,scrollWidth:o}=document.documentElement,{bottom:r,left:i,right:a,top:l}=t.getBoundingClientRect();return r<=0||i>=o||a<=0||l>=n}class eW{constructor(t){this.columnPicker=null,this.downloadManager=new ND,this.filter=new zN,this.hotKeysBehavior=new jy,this.summaryColumnIds=[],this._grid=null,this._grouping={},this._isActive=!1,this._isEdited=!1,this._lastActiveCell={row:0,cell:0},this._observers=[],this._printer=new Ib;const{columnPicker:n,downloadManager:o,filter:r,hotKeys:i,id:a,name:l,printer:d,summaryColumnIds:u,totalCalculator:f}=t;this.id=a,this.name=l||"",n&&(this.columnPicker=n),o&&(this.downloadManager=o),r&&(this.filter=r,this.filter.tableId=a,this.filter.args={columnFilters:Jo.columnFilters.get(this.id)}),i&&(this.hotKeysBehavior=i),d&&(this.printer=d),u&&(this.summaryColumnIds=u),f&&(this.totalCalculator=f)}createGrid(t,n,o){this.reset();const r=new DB(`#${this.id}`,t,n,o);return this.grid=r,r.onKeyDown.subscribe(fm(r)),this.filter.register(r,this.id),this.grid}handleKeyboardEvent(t){JB(`#${this.id}`)||this.hotKeysBehavior.handleKeyboardEvent(t,this)}get grid(){return this._grid}get grouping(){return this._grouping}get isEdited(){return this._isEdited}set grid(t){this._grid=t}set grouping(t){if(this._grouping={...this._grouping,...t},!this.grid)return;const n=this.grid.getData();this.grouping.isGrouped?n.setGrouping(this.grouping.groups||[]):n.setGrouping([])}set isEdited(t){this._isEdited=t,this.notifyObservers()}set printer(t){this._printer=t}get printer(){return this._printer}get isActive(){return this._isActive}set isActive(t){this._isActive=t}get lastActiveSell(){return this._lastActiveCell}set lastActiveSell(t){this._lastActiveCell=t}resizeCanvas(){console.log(""),this.grid?.resizeCanvas()}registerObservers(t){~this._observers.indexOf(t)||this._observers.push(t)}notifyObservers(){for(const t of this._observers)t(this)}deleteObserver(t){const n=this._observers.indexOf(t);this._observers.splice(n,1)}reset(){this.grid?.onKeyDown.unsubscribe(fm(this.grid)),this.grid?.getSelectionModel()&&this.grid.setSelectedRows([]),this.hotKeysBehavior.resetQueue(),this.isEdited=!1,this.isActive=!1,this.grid=null}}class tW extends Ra{constructor(){super(...arguments),this.clientId=0,this.clientName="",this.x=0,this.y=0}}const ln=new tW;class nW extends Ra{constructor(){super(...arguments),this.x=0,this.y=0}}const fo=new nW;class oW extends Ra{constructor(){super(...arguments),this._open=!1,this.x=0,this.y=0}get open(){return this._open}set open(t){this._open=t,this.notify()}get table(){return this._table}set table(t){this._table=t}}const Bn=new oW,rW=e=>{const t=e.getLength()-1;return e.getItem(t)},Bh=e=>{const t=e.getData(),n=t.getIdPropertyName(),o=t.getItems();let r=0;return o.forEach(i=>{i[n]>r&&(r=i[n])}),r+1},Wh=()=>{Pb.commitCurrentEdit()};function Hh(e){return e.ctrlKey||e.metaKey}function zh(e){return Hh(e)&&e.keyCode===Qr.KeyB}function Nb(e){return e.shiftKey&&e.keyCode===Qr.KeyDel}function sW(e){return e.altKey&&e.keyCode===Qr.KeyS}function Yh(e){return Hh(e)&&e.keyCode===Qr.KeyY}function Uh(e){return Hh(e)&&e.keyCode===Qr.KeyZ}function iW(e){const t=e.getActiveCell();return!e.getSelectedRows().length&&!t}function aW(e){const t=lW(e),o=e.getData().getItems(),r=o.findIndex(a=>a.id===t)+1,i=o.length;return r||i}const Bc=e=>{const t=[];for(let n=0;n<e.getLength();n++)t.push(e.getItem(n));return t},Ab=e=>{const t=e.getSelectedRows(),n=e.getData(),o=Bc(n),r=n.getItems(),i=[],a=n.getIdPropertyName();let l=Bh(e);t.length?t.forEach(d=>{i.push({...o[d],[a]:l++,isEdited:!0,isNew:!0})}):i.push({[a]:l,isEdited:!0,isNew:!0}),r.splice(aW(e),0,...i),n.setItems(r),e.setSelectedRows([]),e.invalidate()},lW=e=>{const t=e.getData(),n=Bc(t),o=e.getActiveCell()?.row;return o!==void 0?(n[o]||n[n.length-1])?.id:0};function cW(e){return function(t){t.preventDefault(),Wh(),ln.table=e,ln.x=t.pageX||0,ln.y=t.pageY||0,ln.notify()}}function dW(e){return function(t){t.preventDefault(),Wh(),fo.table=e,fo.x=t.pageX||0,fo.y=t.pageY||0,fo.notify()}}class uW extends Ra{constructor(){super(...arguments),this._activeTable=null}get activeTable(){return this._activeTable}set activeTable(t){this._activeTable=t}}const Ei=new uW,hW=e=>{function t(){if(e.id!==Ei.activeTable?.id){e.isActive=!1;const o=e.grid;o?.resetActiveCell(),o?.setSelectedRows([])}}function n(){e.isActive=!0,Ei.activeTable=e,Ei.notify()}Ae.useEffect(()=>{Ei.subscribe(t),document.addEventListener("keydown",e.handleKeyboardEvent.bind(e));const o=document.getElementById(e.id);if(o)return o.addEventListener("click",n,!0),()=>{Ei.unsubscribe(t),document.removeEventListener("keydown",e.handleKeyboardEvent.bind(e)),o.removeEventListener("click",n,!0)}},[])},fW=e=>{const[t,n]=Ae.useState(pW(e));return Ae.useEffect(()=>{const o=r=>{n(i=>({...i,[r.id]:r.isEdited}))};return e.forEach(r=>{r.registerObservers(o)}),()=>{e.forEach(r=>{r.deleteObserver(o)})}},[]),Object.values(t).some(o=>o)};function pW(e){const t={};for(const n of e)t[n.id]=n.isEdited;return t}function mW(e){Ae.useEffect(()=>{function t(){e.grid?.resizeCanvas()}const n=Fv(t);return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[])}const gW=e=>{Ae.useEffect(()=>{function t(n){const o=n.grid;o&&n.totalCalculator?.calculate(o)}return e.registerObservers(t),()=>{e.deleteObserver(t)}},[])},yW=e=>{if(!e)return 0;if(typeof e=="number")return e;const t=e.replace(/\$|,|\s/g,""),n=t.replace(/\(|\)/g,"");return isNaN(Number(n))?0:t.startsWith("(")&&t.endsWith(")")?0-Number(n):Number(t)},Wr=function(){const e=function(x,S,C,O){for(C=C||{},O=x.length;O--;C[x[O]]=S);return C},t=[1,3],n=[1,4],o=[1,5],r=[1,6],i=[1,7],a=[1,9],l=[1,10],d=[1,11],u=[1,12],f=[1,13],p=[1,14],y=[1,15],w=[5,6,7,8,9,10,11,12,14],b=[5,6,7,14],m=[5,6,7,8,9,14],v={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"+":6,"-":7,"*":8,"/":9,"^":10,"!":11,"%":12,"(":13,")":14,NUMBER:15,E:16,PI:17,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"+",7:"-",8:"*",9:"/",10:"^",11:"!",12:"%",13:"(",14:")",15:"NUMBER",16:"E",17:"PI"},productions_:[0,[3,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,2],[4,2],[4,3],[4,1],[4,1],[4,1]],performAction:function(S,C,O,A,F,B,R){const $=B.length-1;switch(F){case 1:return B[$-1];case 2:this.$=B[$-2]+B[$];break;case 3:this.$=B[$-2]-B[$];break;case 4:this.$=B[$-2]*B[$];break;case 5:this.$=B[$-2]/B[$];break;case 6:this.$=Math.pow(B[$-2],B[$]);break;case 7:this.$=function K(G){return G==0?1:K(G-1)*G}(B[$-1]);break;case 8:this.$=B[$-1]/100;break;case 9:this.$=-B[$];break;case 10:this.$=B[$-1];break;case 11:this.$=Number(S);break;case 12:this.$=Math.E;break;case 13:this.$=Math.PI;break}},table:[{3:1,4:2,7:t,13:n,15:o,16:r,17:i},{1:[3]},{5:[1,8],6:a,7:l,8:d,9:u,10:f,11:p,12:y},{4:16,7:t,13:n,15:o,16:r,17:i},{4:17,7:t,13:n,15:o,16:r,17:i},e(w,[2,11]),e(w,[2,12]),e(w,[2,13]),{1:[2,1]},{4:18,7:t,13:n,15:o,16:r,17:i},{4:19,7:t,13:n,15:o,16:r,17:i},{4:20,7:t,13:n,15:o,16:r,17:i},{4:21,7:t,13:n,15:o,16:r,17:i},{4:22,7:t,13:n,15:o,16:r,17:i},e(w,[2,7]),e(w,[2,8]),e(w,[2,9]),{6:a,7:l,8:d,9:u,10:f,11:p,12:y,14:[1,23]},e(b,[2,2],{8:d,9:u,10:f,11:p,12:y}),e(b,[2,3],{8:d,9:u,10:f,11:p,12:y}),e(m,[2,4],{10:f,11:p,12:y}),e(m,[2,5],{10:f,11:p,12:y}),e([5,6,7,8,9,10,14],[2,6],{11:p,12:y}),e(w,[2,10])],defaultActions:{8:[2,1]},parseError:function(S,C){if(C.recoverable)this.trace(S);else{const O=new Error(S);throw O.hash=C,O}},parse:function(S){const C=this;let O=[0],A=[null],F=[];const B=this.table;let R="",$=0,K=0;const G=2,q=1,Y=F.slice.call(arguments,1),z=Object.create(this.lexer),ae={yy:{}};for(let le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,le)&&(ae.yy[le]=this.yy[le]);z.setInput(S,ae.yy),ae.yy.lexer=z,ae.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});let N=z.yylloc;F.push(N);const M=z.options&&z.options.ranges;typeof ae.yy.parseError=="function"?this.parseError=ae.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;var L=function(){let le;return le=z.lex()||q,typeof le!="number"&&(le=C.symbols_[le]||le),le};let W,ne,oe,se;const j={};let ee,J,te,ce;for(;;){if(ne=O[O.length-1],this.defaultActions[ne]?oe=this.defaultActions[ne]:((W===null||typeof W>"u")&&(W=L()),oe=B[ne]&&B[ne][W]),typeof oe>"u"||!oe.length||!oe[0]){let le="";ce=[];for(ee in B[ne])this.terminals_[ee]&&ee>G&&ce.push("'"+this.terminals_[ee]+"'");z.showPosition?le="Parse error on line "+($+1)+`:
|
|
358
358
|
`+z.showPosition()+`
|
|
359
359
|
Expecting `+ce.join(", ")+", got '"+(this.terminals_[W]||W)+"'":le="Parse error on line "+($+1)+": Unexpected "+(W==q?"end of input":"'"+(this.terminals_[W]||W)+"'"),this.parseError(le,{text:z.match,token:this.terminals_[W]||W,line:z.yylineno,loc:N,expected:ce})}if(oe[0]instanceof Array&&oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ne+", token: "+W);switch(oe[0]){case 1:O.push(W),A.push(z.yytext),F.push(z.yylloc),O.push(oe[1]),W=null,K=z.yyleng,R=z.yytext,$=z.yylineno,N=z.yylloc;break;case 2:if(J=this.productions_[oe[1]][1],j.$=A[A.length-J],j._$={first_line:F[F.length-(J||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(J||1)].first_column,last_column:F[F.length-1].last_column},M&&(j._$.range=[F[F.length-(J||1)].range[0],F[F.length-1].range[1]]),se=this.performAction.apply(j,[R,K,$,ae.yy,oe[1],A,F].concat(Y)),typeof se<"u")return se;J&&(O=O.slice(0,-1*J*2),A=A.slice(0,-1*J),F=F.slice(0,-1*J)),O.push(this.productions_[oe[1]][0]),A.push(j.$),F.push(j._$),te=B[O[O.length-2]][O[O.length-1]],O.push(te);break;case 3:return!0}}return!0}},P=function(){return{EOF:1,parseError:function(C,O){if(this.yy.parser)this.yy.parser.parseError(C,O);else throw new Error(C)},setInput:function(S,C){return this.yy=C||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){const S=this._input[0];return this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S,S.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},unput:function(S){const C=S.length,O=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;const A=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),O.length-1&&(this.yylineno-=O.length-1);const F=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:O?(O.length===A.length?this.yylloc.first_column:0)+A[A.length-O.length].length-O[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[F[0],F[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
360
360
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(S){this.unput(this.match.slice(S))},pastInput:function(){const S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},upcomingInput:function(){let S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){const S=this.pastInput(),C=new Array(S.length+1).join("-");return S+this.upcomingInput()+`
|
package/dist/index.es.js
CHANGED
|
@@ -43912,7 +43912,7 @@ class jW {
|
|
|
43912
43912
|
summaryColumnIds: u,
|
|
43913
43913
|
totalCalculator: f
|
|
43914
43914
|
} = t;
|
|
43915
|
-
this.id = a, this.name = l || "", n && (this.columnPicker = n), o && (this.downloadManager = o), r && (this.filter = r, this.filter.args = {
|
|
43915
|
+
this.id = a, this.name = l || "", n && (this.columnPicker = n), o && (this.downloadManager = o), r && (this.filter = r, this.filter.tableId = a, this.filter.args = {
|
|
43916
43916
|
columnFilters: er.columnFilters.get(this.id)
|
|
43917
43917
|
}), i && (this.hotKeysBehavior = i), d && (this.printer = d), u && (this.summaryColumnIds = u), f && (this.totalCalculator = f);
|
|
43918
43918
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlickTable.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/model/SlickTable/table/SlickTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,SAAS,EACT,MAAM,WAAW,CAAC;AAInB,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,MAAM,oBAAoB,CAAC;AAQ5B,qBAAa,UAAW,YAAW,WAAW;IACtC,YAAY,EAAE,aAAa,GAAG,IAAI,CAAQ;IAC1C,eAAe,EAAE,gBAAgB,CAAyB;IAC1D,MAAM,EAAE,OAAO,CAAuB;IAC7C,SAAgB,eAAe,EAAE,gBAAgB,CAAwB;IACzE,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAC1C,SAAgB,gBAAgB,EAAE,MAAM,EAAE,CAAM;IAEhD,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;IAC9C,OAAO,CAAC,QAAQ,CAAkC;gBAEtC,IAAI,EAAE;QACjB,YAAY,CAAC,EAAE,aAAa,CAAC;QAC7B,eAAe,CAAC,EAAE,gBAAgB,CAAC;QACnC,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,gBAAgB,CAAC;QAC3B,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,QAAQ,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,eAAe,CAAC,EAAE,gBAAgB,CAAC;KACnC;
|
|
1
|
+
{"version":3,"file":"SlickTable.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/model/SlickTable/table/SlickTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,SAAS,EACT,MAAM,WAAW,CAAC;AAInB,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,MAAM,oBAAoB,CAAC;AAQ5B,qBAAa,UAAW,YAAW,WAAW;IACtC,YAAY,EAAE,aAAa,GAAG,IAAI,CAAQ;IAC1C,eAAe,EAAE,gBAAgB,CAAyB;IAC1D,MAAM,EAAE,OAAO,CAAuB;IAC7C,SAAgB,eAAe,EAAE,gBAAgB,CAAwB;IACzE,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAC1C,SAAgB,gBAAgB,EAAE,MAAM,EAAE,CAAM;IAEhD,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;IAC9C,OAAO,CAAC,QAAQ,CAAkC;gBAEtC,IAAI,EAAE;QACjB,YAAY,CAAC,EAAE,aAAa,CAAC;QAC7B,eAAe,CAAC,EAAE,gBAAgB,CAAC;QACnC,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,gBAAgB,CAAC;QAC3B,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,QAAQ,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,eAAe,CAAC,EAAE,gBAAgB,CAAC;KACnC;IA6BM,UAAU,CAChB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,UAAU,GACjB,SAAS;IASL,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,kBAAkB,CAAC,GAAG,IAAI;IAK3E,IAAW,IAAI,IAAI,SAAS,GAAG,IAAI,CAElC;IACD,IAAW,QAAQ,IAAI,SAAS,CAE/B;IACD,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,OAAO,KAAK,IAAI,QAEf;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAStC;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAGpC;IAED,IAAW,OAAO,CAAC,OAAO,EAAE,QAAQ,EAEnC;IACD,IAAW,OAAO,IAAI,QAAQ,CAE7B;IAED,IAAW,QAAQ,IAAI,OAAO,CAE7B;IACD,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAEpC;IAED,IAAW,cAAc,IAGO;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAD5D;IACD,IAAW,cAAc,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAE5D;IAEM,YAAY,IAAI,IAAI;IAKpB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI;IAK5C,eAAe,IAAI,IAAI;IAKvB,cAAc,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI;IAKzC,KAAK,IAAI,IAAI;CAUpB"}
|
package/package.json
CHANGED
|
@@ -73,6 +73,7 @@ export class SlickTable implements ISlickTable {
|
|
|
73
73
|
if (downloadManager) this.downloadManager = downloadManager;
|
|
74
74
|
if (filter) {
|
|
75
75
|
this.filter = filter;
|
|
76
|
+
this.filter.tableId = id;
|
|
76
77
|
this.filter.args = {
|
|
77
78
|
columnFilters: localStore.columnFilters.get(this.id),
|
|
78
79
|
};
|