diff --git a/bower.json b/bower.json index ee50bfd9..bfea3f6d 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "canvas-datagrid", "main": "lib/main.js", - "version": "0.22.11", + "version": "0.22.12", "ignore": [ "**/.*", "node_modules", diff --git a/build.txt b/build.txt index c05d4644..9adbd239 100644 --- a/build.txt +++ b/build.txt @@ -1 +1 @@ -2041 +2042 diff --git a/dist/canvas-datagrid.debug.js b/dist/canvas-datagrid.debug.js index 6cbe45b5..4ed7cf09 100644 --- a/dist/canvas-datagrid.debug.js +++ b/dist/canvas-datagrid.debug.js @@ -4936,9 +4936,9 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser try { data = JSON.parse(data); } catch (e) { - throw new Error('Cannot parse application/json+x-canvas-datagrid formated data. ' + console.warn(Error('Cannot parse application/json+x-canvas-datagrid formated data. ' + e.message + ' \nNote: canvas-datagrid.innerHTML is for string data only. ' - + 'Use the canvas-datagrid.data property to set object data.'); + + 'Use the canvas-datagrid.data property to set object data.')); } return data; }; diff --git a/dist/canvas-datagrid.debug.map b/dist/canvas-datagrid.debug.map index e7c6c0c7..02c8f456 100644 --- a/dist/canvas-datagrid.debug.map +++ b/dist/canvas-datagrid.debug.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 51116c756fa36c951632","webpack:///./lib/defaults.js","webpack:///./lib/main.js","webpack:///./lib/component.js","webpack:///./lib/draw.js","webpack:///./lib/events.js","webpack:///./lib/touch.js","webpack:///./lib/intf.js","webpack:///./lib/contextMenu.js","webpack:///./lib/dom.js","webpack:///./lib/publicMethods.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;AC7DA;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,MAAM,MAAM;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACpTF;AACA;AACA,iCAAO;AACP,IAAI,yCAAa;AACjB,IAAI,wCAAY;AAChB,IAAI,oCAAQ;AACZ,IAAI,sCAAU;AACd,IAAI,qCAAS;AACb,IAAI,oCAAQ;AACZ,IAAI,2CAAe;AACnB,IAAI,mCAAO;AACX,IAAI,6CAAiB;AACrB,CAAC,mCAAE;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,sDAAsD,aAAa;AACnE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA,0EAA0E,QAAQ;AAClF;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AClHF;AACA;AACA,iCAAO,CAAC,wCAAY,CAAC,mCAAE;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,mDAAmD,mBAAmB,EAAE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD,oDAAoD,4CAA4C,eAAe;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,oCAAoC,wEAAwE;AAC5G;AACA,sCAAsC,wEAAwE;AAC9G,aAAa;AACb;AACA;AACA;AACA,CAAC;AAAA,oGAAC,C;;;;;;;;;;;ACtMF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,gFAAgF,UAAU;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,wBAAwB,UAAU,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA,sFAAsF,OAAO;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,8EAA8E,SAAS,gCAAgC,EAAE;AACzH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,IAAI,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,UAAU;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF,QAAQ;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,OAAO;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA,uDAAuD,oEAAoE,eAAe,EAAE,EAAE;AAC9I,oDAAoD,iEAAiE,eAAe,EAAE,EAAE;AACxI,+CAA+C,kDAAkD;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mDAAmD;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,kEAAkE,eAAe,kDAAkD,YAAY;AAC/I,kEAAkE,eAAe,kDAAkD,YAAY;AAC/I;AACA;AACA;AACA;AACA;AACA,6DAA6D,KAAK,yCAAyC,KAAK;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,IAAI,QAAQ;AAC9D;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACl4CF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,oCAAoC;AAC1D;AACA;AACA,gCAAgC,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qBAAqB;AACtE;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC,IAAI,QAAQ;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4CAA4C,IAAI,cAAc;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,uCAAuC,IAAI,QAAQ;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,uCAAuC,IAAI,QAAQ;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uCAAuC,IAAI,QAAQ;AACpG;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,uCAAuC,IAAI,QAAQ;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,eAAe,IAAI,QAAQ;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC,IAAI,QAAQ;AAClG;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC,IAAI,QAAQ;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,kCAAkC;AACxF;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC,IAAI,QAAQ;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,4CAA4C,eAAe,IAAI,QAAQ;AACvE,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,WAAW;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AChzCF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,EAAE;AAC9C,sCAAsC,cAAc,EAAE;AACtD,uCAAuC,oBAAoB,EAAE;AAC7D,yCAAyC,mDAAmD,EAAE;AAC9F,uCAAuC,kBAAkB,EAAE;AAC3D,wCAAwC,0BAA0B,EAAE;AACpE,0CAA0C,0EAA0E,EAAE;AACtH,uCAAuC,sBAAsB,EAAE;AAC/D,wCAAwC,8BAA8B,EAAE;AACxE,0CAA0C,kEAAkE,EAAE;AAC9G,uCAAuC,0BAA0B,EAAE;AACnE,wCAAwC,mCAAmC,EAAE;AAC7E,0CAA0C,0EAA0E;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,sDAAsD;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC,IAAI,QAAQ;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C,yEAAyE,eAAe;AACxF;AACA;AACA;AACA;AACA;AACA,gFAAgF,QAAQ;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,eAAe,IAAI,QAAQ;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,eAAe;AAC3F;AACA;AACA;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uCAAuC,IAAI,QAAQ;AACtG;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AClYF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,oBAAoB;AACpB,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,0BAA0B,WAAW;AACrC;AACA,2BAA2B,QAAQ;AACnC,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA,iEAAiE,QAAQ;AACzE;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D;AACA;AACA;AACA,kDAAkD,UAAU;AAC5D;AACA;AACA;AACA,2EAA2E,QAAQ;AACnF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kEAAkE;AAClE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB,EAAE;AACjE;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gBAAgB,UAAU,EAAE,IAAI;AAC7G,qFAAqF,gBAAgB,UAAU,EAAE,IAAI;AACrH;AACA;AACA,aAAa;AACb;AACA,6CAA6C,yCAAyC,EAAE;AACxF,6CAA6C,wCAAwC,EAAE;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wDAAwD,kCAAkC;AAC1F;AACA,aAAa;AACb,4DAA4D,WAAW;AACvE;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B;AAC7F;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,mBAAmB,EAAE;AACxE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,yDAAyD,kBAAkB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qDAAqD,oBAAoB;AACzE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA,yDAAyD,wBAAwB;AACjF;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gBAAgB;AACvE;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yFAAyF;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AC/sCF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ;AAC7E,4FAA4F,QAAQ;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4CAA4C;AAC5E,gCAAgC,4CAA4C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,wCAAwC,+BAA+B;AACvE,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,QAAQ;AAC3G;AACA;AACA,gFAAgF,QAAQ,gBAAgB;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uEAAuE,QAAQ;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,sCAAsC;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kCAAkC;AAC9F,yDAAyD,kCAAkC;AAC3F;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACrjBF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,IAAI,cAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,IAAI,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA,uDAAuD,qCAAqC,IAAI,cAAc;AAC9G;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA,uDAAuD,WAAW;AAClE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6CAA6C,oBAAoB;AACjE;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,wDAAwD,6BAA6B,I;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,6CAA6C,8BAA8B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AC3iBF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,6DAA6D,iDAAiD;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,sDAAsD,+CAA+C;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,wBAAwB,OAAO;AAC/B,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yCAAyC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,6CAA6C,8BAA8B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,KAAK,oEAAoE,yCAAyC;AACrI;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,KAAK;AACxB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wDAAwD,uCAAuC,IAAI,QAAQ;AAC3G;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,uCAAuC;AACrF;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM;AACzB,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C,4CAA4C,uBAAuB;AACnE;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD,yCAAyC,oBAAoB;AAC7D;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,QAAQ;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,KAAK;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kCAAkC;AAChF;AACA,mDAAmD,iCAAiC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,UAAU;AACjE;AACA;AACA,mDAAmD,UAAU;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC","file":"canvas-datagrid.debug.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 51116c756fa36c951632","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 0\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([\n './component',\n './defaults',\n './draw',\n './events',\n './touch',\n './intf',\n './contextMenu',\n './dom',\n './publicMethods'\n], function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/main.js\n// module id = 1\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine(['./defaults'], function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/component.js\n// module id = 2\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/draw.js\n// module id = 3\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/events.js\n// module id = 4\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/touch.js\n// module id = 5\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n throw new Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.');\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/intf.js\n// module id = 6\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/contextMenu.js\n// module id = 7\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/dom.js\n// module id = 8\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/publicMethods.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 885c5f6cc338c50b68fe","webpack:///./lib/defaults.js","webpack:///./lib/main.js","webpack:///./lib/component.js","webpack:///./lib/draw.js","webpack:///./lib/events.js","webpack:///./lib/touch.js","webpack:///./lib/intf.js","webpack:///./lib/contextMenu.js","webpack:///./lib/dom.js","webpack:///./lib/publicMethods.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;AC7DA;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,MAAM,MAAM;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACpTF;AACA;AACA,iCAAO;AACP,IAAI,yCAAa;AACjB,IAAI,wCAAY;AAChB,IAAI,oCAAQ;AACZ,IAAI,sCAAU;AACd,IAAI,qCAAS;AACb,IAAI,oCAAQ;AACZ,IAAI,2CAAe;AACnB,IAAI,mCAAO;AACX,IAAI,6CAAiB;AACrB,CAAC,mCAAE;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,sDAAsD,aAAa;AACnE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA,0EAA0E,QAAQ;AAClF;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AClHF;AACA;AACA,iCAAO,CAAC,wCAAY,CAAC,mCAAE;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,mDAAmD,mBAAmB,EAAE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD,oDAAoD,4CAA4C,eAAe;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,oCAAoC,wEAAwE;AAC5G;AACA,sCAAsC,wEAAwE;AAC9G,aAAa;AACb;AACA;AACA;AACA,CAAC;AAAA,oGAAC,C;;;;;;;;;;;ACtMF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA,gFAAgF,UAAU;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,wBAAwB,UAAU,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA,sFAAsF,OAAO;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,8EAA8E,SAAS,gCAAgC,EAAE;AACzH;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,IAAI,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,UAAU;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF,QAAQ;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,OAAO;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA,uDAAuD,oEAAoE,eAAe,EAAE,EAAE;AAC9I,oDAAoD,iEAAiE,eAAe,EAAE,EAAE;AACxI,+CAA+C,kDAAkD;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mDAAmD;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,kEAAkE,eAAe,kDAAkD,YAAY;AAC/I,kEAAkE,eAAe,kDAAkD,YAAY;AAC/I;AACA;AACA;AACA;AACA;AACA,6DAA6D,KAAK,yCAAyC,KAAK;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,IAAI,QAAQ;AAC9D;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACl4CF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,oCAAoC;AAC1D;AACA;AACA,gCAAgC,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qBAAqB;AACtE;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC,IAAI,QAAQ;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4CAA4C,IAAI,cAAc;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,uCAAuC,IAAI,QAAQ;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,uCAAuC,IAAI,QAAQ;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,eAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uCAAuC,IAAI,QAAQ;AACpG;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,uCAAuC,IAAI,QAAQ;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,eAAe,IAAI,QAAQ;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC,IAAI,QAAQ;AAClG;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,uCAAuC,IAAI,QAAQ;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,kCAAkC;AACxF;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC,IAAI,QAAQ;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,4CAA4C,eAAe,IAAI,QAAQ;AACvE,qDAAqD,QAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,4CAA4C,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,WAAW;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AChzCF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,EAAE;AAC9C,sCAAsC,cAAc,EAAE;AACtD,uCAAuC,oBAAoB,EAAE;AAC7D,yCAAyC,mDAAmD,EAAE;AAC9F,uCAAuC,kBAAkB,EAAE;AAC3D,wCAAwC,0BAA0B,EAAE;AACpE,0CAA0C,0EAA0E,EAAE;AACtH,uCAAuC,sBAAsB,EAAE;AAC/D,wCAAwC,8BAA8B,EAAE;AACxE,0CAA0C,kEAAkE,EAAE;AAC9G,uCAAuC,0BAA0B,EAAE;AACnE,wCAAwC,mCAAmC,EAAE;AAC7E,0CAA0C,0EAA0E;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,sDAAsD;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,QAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC,IAAI,QAAQ;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C,yEAAyE,eAAe;AACxF;AACA;AACA;AACA;AACA;AACA,gFAAgF,QAAQ;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,eAAe,IAAI,QAAQ;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uCAAuC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,eAAe;AAC3F;AACA;AACA;AACA;AACA,gDAAgD,uCAAuC,IAAI,QAAQ;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uCAAuC,IAAI,QAAQ;AACtG;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AClYF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,oBAAoB;AACpB,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,0BAA0B,WAAW;AACrC;AACA,2BAA2B,QAAQ;AACnC,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA,iEAAiE,QAAQ;AACzE;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D;AACA;AACA;AACA,kDAAkD,UAAU;AAC5D;AACA;AACA;AACA,2EAA2E,QAAQ;AACnF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B,EAAE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kEAAkE;AAClE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB,EAAE;AACjE;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,gBAAgB,UAAU,EAAE,IAAI;AAC7G,qFAAqF,gBAAgB,UAAU,EAAE,IAAI;AACrH;AACA;AACA,aAAa;AACb;AACA,6CAA6C,yCAAyC,EAAE;AACxF,6CAA6C,wCAAwC,EAAE;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wDAAwD,kCAAkC;AAC1F;AACA,aAAa;AACb,4DAA4D,WAAW;AACvE;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,6BAA6B;AAC7F;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,mBAAmB,EAAE;AACxE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,yDAAyD,kBAAkB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qDAAqD,oBAAoB;AACzE;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA,yDAAyD,wBAAwB;AACjF;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gBAAgB;AACvE;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yFAAyF;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AC/sCF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,wCAAwC,wDAAwD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,QAAQ;AAC7E,4FAA4F,QAAQ;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4CAA4C;AAC5E,gCAAgC,4CAA4C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,wCAAwC,+BAA+B;AACvE,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,QAAQ;AAC3G;AACA;AACA,gFAAgF,QAAQ,gBAAgB;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uEAAuE,QAAQ;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,sCAAsC;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mBAAmB,EAAE;AACzE;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kCAAkC;AAC9F,yDAAyD,kCAAkC;AAC3F;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;ACrjBF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,IAAI,cAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,IAAI,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA,uDAAuD,qCAAqC,IAAI,cAAc;AAC9G;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA;AACA,uDAAuD,WAAW;AAClE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6CAA6C,oBAAoB;AACjE;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,wDAAwD,6BAA6B,I;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,6CAA6C,8BAA8B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC;;;;;;;;;;;;AC3iBF;AACA;AACA,iCAAO,EAAE,mCAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,6DAA6D,iDAAiD;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,sDAAsD,+CAA+C;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA,wBAAwB,OAAO;AAC/B,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA,mCAAmC,QAAQ;AAC3C;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yCAAyC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,6CAA6C,8BAA8B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,KAAK,oEAAoE,yCAAyC;AACrI;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B,mBAAmB,KAAK;AACxB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wDAAwD,uCAAuC,IAAI,QAAQ;AAC3G;AACA,uDAAuD,QAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,uCAAuC;AACrF;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM;AACzB,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ;AAC/C,4CAA4C,uBAAuB;AACnE;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD,yCAAyC,oBAAoB;AAC7D;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,QAAQ;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,KAAK;AAC1B;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,KAAK;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kCAAkC;AAChF;AACA,mDAAmD,iCAAiC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,QAAQ;AAChD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,UAAU;AACjE;AACA;AACA,mDAAmD,UAAU;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAA,oGAAC","file":"canvas-datagrid.debug.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 885c5f6cc338c50b68fe","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 0\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([\n './component',\n './defaults',\n './draw',\n './events',\n './touch',\n './intf',\n './contextMenu',\n './dom',\n './publicMethods'\n], function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/main.js\n// module id = 1\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine(['./defaults'], function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/component.js\n// module id = 2\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/draw.js\n// module id = 3\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/events.js\n// module id = 4\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/touch.js\n// module id = 5\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.warn(Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.'));\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/intf.js\n// module id = 6\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/contextMenu.js\n// module id = 7\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/dom.js\n// module id = 8\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/publicMethods.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/canvas-datagrid.js b/dist/canvas-datagrid.js index a71bebe4..d90560dd 100644 --- a/dist/canvas-datagrid.js +++ b/dist/canvas-datagrid.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.canvasDatagrid=t():e.canvasDatagrid=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,r){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.defaults={attributes:[["allowColumnReordering",!0],["allowColumnResize",!0],["allowColumnResizeFromCell",!1],["allowFreezingRows",!1],["allowFreezingColumns",!1],["allowMovingSelection",!0],["allowRowHeaderResize",!0],["allowRowReordering",!1],["allowRowResize",!0],["allowRowResizeFromCell",!1],["allowSorting",!0],["autoGenerateSchema",!1],["autoResizeColumns",!1],["borderDragBehavior","none"],["borderResizeZone",10],["clearSettingsOptionText","Clear saved settings"],["columnHeaderClickBehavior","sort"],["columnSelectorHiddenText","   "],["columnSelectorText","Add/Remove columns"],["columnSelectorVisibleText","✓"],["contextHoverScrollAmount",2],["contextHoverScrollRateMs",5],["copyHeadersOnSelectAll",!0],["copyText","Copy"],["debug",!1],["editable",!0],["ellipsisText","..."],["filterOptionText","Filter %s"],["filterTextPrefix","(filtered) "],["globalRowResize",!1],["hideColumnText","Hide %s"],["maxAutoCompleteItems",200],["multiLine",!1],["name",""],["pageUpDownOverlap",1],["pasteText","Paste"],["persistantSelectionMode",!1],["removeFilterOptionText","Remove filter on %s"],["reorderDeadZone",3],["resizeScrollZone",20],["rowGrabZoneSize",5],["saveAppearance",!0],["scrollAnimationPPSThreshold",.75],["scrollPointerLock",!1],["scrollRepeatRate",75],["selectionFollowsActiveCell",!1],["selectionHandleBehavior","none"],["selectionMode","cell"],["selectionScrollIncrement",20],["selectionScrollZone",20],["showClearSettingsOption",!0],["showColumnHeaders",!0],["showColumnSelector",!0],["showCopy",!1],["showFilter",!0],["showNewRow",!1],["showOrderByOption",!0],["showOrderByOptionTextAsc","Order by %s ascending"],["showOrderByOptionTextDesc","Order by %s descending"],["showPaste",!1],["showPerformance",!1],["showRowHeaders",!0],["showRowNumbers",!0],["snapToRow",!1],["touchContextMenuTimeMs",800],["touchDeadZone",3],["touchEasingMethod","easeOutQuad"],["touchReleaseAcceleration",1e3],["touchReleaseAnimationDurationMs",2e3],["touchScrollZone",20],["touchSelectHandleZone",20],["touchZoomSensitivity",.005],["touchZoomMin",.5],["touchZoomMax",1.75],["maxPixelRatio",2],["tree",!1],["treeHorizontalScroll",!1]],styles:[["activeCellBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellBorderColor","rgba(110, 168, 255, 1)"],["activeCellBorderWidth",1],["activeCellColor","rgba(0, 0, 0, 1)"],["activeCellFont","16px sans-serif"],["activeCellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellHorizontalAlignment","left"],["activeCellHoverColor","rgba(0, 0, 0, 1)"],["activeCellOverlayBorderColor","rgba(66, 133, 244, 1)"],["activeCellOverlayBorderWidth",1],["activeCellPaddingBottom",5],["activeCellPaddingLeft",5],["activeCellPaddingRight",5],["activeCellPaddingTop",5],["activeCellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["activeCellSelectedColor","rgba(0, 0, 0, 1)"],["activeCellVerticalAlignment","center"],["activeColumnHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeColumnHeaderCellColor","rgba(0, 0, 0, 1)"],["activeRowHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeRowHeaderCellColor","rgba(0, 0, 0, 1)"],["autocompleteBottomMargin",60],["autosizeHeaderCellPadding",8],["autosizePadding",5],["cellAutoResizePadding",13],["cellBackgroundColor","rgba(255, 255, 255, 1)"],["cellBorderColor","rgba(195, 199, 202, 1)"],["cellBorderWidth",1],["cellColor","rgba(0, 0, 0, 1)"],["cellFont","16px sans-serif"],["cellGridHeight",250],["cellHeight",24],["cellHeightWithChildGrid",150],["cellHorizontalAlignment","left"],["cellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["cellHoverColor","rgba(0, 0, 0, 1)"],["cellPaddingBottom",5],["cellPaddingLeft",5],["cellPaddingRight",5],["cellPaddingTop",5],["cellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["cellSelectedColor","rgba(0, 0, 0, 1)"],["cellVerticalAlignment","center"],["cellWidth",250],["cellWidthWithChildGrid",250],["cellWhiteSpace","nowrap"],["cellLineHeight",1],["cellLineSpacing",3],["childContextMenuArrowColor","rgba(43, 48, 43, 1)"],["childContextMenuArrowHTML","►"],["childContextMenuMarginLeft",-11],["childContextMenuMarginTop",-6],["columnHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellBorderWidth",1],["columnHeaderCellCapBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellCapBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellCapBorderWidth",1],["columnHeaderCellColor","rgba(50, 50, 50, 1)"],["columnHeaderCellFont","16px sans-serif"],["columnHeaderCellHeight",25],["columnHeaderCellHorizontalAlignment","left"],["columnHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["columnHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["columnHeaderCellPaddingBottom",5],["columnHeaderCellPaddingLeft",5],["columnHeaderCellPaddingRight",5],["columnHeaderCellPaddingTop",5],["columnHeaderCellVerticalAlignment","center"],["columnHeaderOrderByArrowBorderColor","rgba(195, 199, 202, 1)"],["columnHeaderOrderByArrowBorderWidth",1],["columnHeaderOrderByArrowColor","rgba(155, 155, 155, 1)"],["columnHeaderOrderByArrowHeight",8],["columnHeaderOrderByArrowMarginLeft",0],["columnHeaderOrderByArrowMarginRight",5],["columnHeaderOrderByArrowMarginTop",6],["columnHeaderOrderByArrowWidth",13],["contextFilterButtonBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterButtonBorderRadius","3px"],["contextFilterButtonHTML","▼"],["contextFilterInputBackground","rgba(255,255,255,1)"],["contextFilterInputBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterInputBorderRadius","0"],["contextFilterInputColor","rgba(0,0,0,1)"],["contextFilterInputFontFamily","sans-serif"],["contextFilterInputFontSize","14px"],["contextFilterInvalidRegExpBackground","rgba(180, 6, 1, 1)"],["contextFilterInvalidRegExpColor","rgba(255, 255, 255, 1)"],["contextMenuArrowColor","rgba(43, 48, 43, 1)"],["contextMenuArrowDownHTML","▼"],["contextMenuArrowUpHTML","▲"],["contextMenuBackground","rgba(240, 240, 240, 1)"],["contextMenuBorder","solid 1px rgba(158, 163, 169, 1)"],["contextMenuBorderRadius","3px"],["contextMenuChildArrowFontSize","12px"],["contextMenuColor","rgba(43, 48, 43, 1)"],["contextMenuCursor","default"],["contextMenuFilterButtonFontFamily","sans-serif"],["contextMenuFilterButtonFontSize","10px"],["contextMenuFilterInvalidExpresion","rgba(237, 155, 156, 1)"],["contextMenuFontFamily","sans-serif"],["contextMenuFontSize","16px"],["contextMenuHoverBackground","rgba(182, 205, 250, 1)"],["contextMenuHoverColor","rgba(43, 48, 153, 1)"],["contextMenuItemBorderRadius","3px"],["contextMenuItemMargin","2px"],["contextMenuLabelDisplay","inline-block"],["contextMenuLabelMargin","0 3px 0 0"],["contextMenuLabelMaxWidth","700px"],["contextMenuLabelMinWidth","75px"],["contextMenuMarginLeft",3],["contextMenuMarginTop",-3],["contextMenuOpacity","0.98"],["contextMenuPadding","2px"],["contextMenuWindowMargin",30],["contextMenuZIndex",1e4],["cornerCellBackgroundColor","rgba(240, 240, 240, 1)"],["cornerCellBorderColor","rgba(202, 202, 202, 1)"],["debugBackgroundColor","rgba(0, 0, 0, .0)"],["debugColor","rgba(255, 15, 24, 1)"],["debugEntitiesColor","rgba(76, 231, 239, 1.00)"],["debugFont","11px sans-serif"],["debugPerfChartBackground","rgba(29, 25, 26, 1.00)"],["debugPerfChartTextColor","rgba(255, 255, 255, 0.8)"],["debugPerformanceColor","rgba(252, 255, 37, 1.00)"],["debugScrollHeightColor","rgba(248, 33, 103, 1.00)"],["debugScrollWidthColor","rgba(66, 255, 27, 1.00)"],["debugTouchPPSXColor","rgba(246, 102, 24, 1.00)"],["debugTouchPPSYColor","rgba(186, 0, 255, 1.00)"],["display","inline-block"],["editCellBackgroundColor","white"],["editCellBorder","solid 1px rgba(110, 168, 255, 1)"],["editCellBoxShadow","0 2px 5px rgba(0,0,0,0.4)"],["editCellColor","black"],["editCellFontFamily","sans-serif"],["editCellFontSize","16px"],["editCellPaddingLeft",4],["editCellZIndex",1e4],["frozenMarkerHoverColor","rgba(236, 243, 255, 1)"],["frozenMarkerHoverBorderColor","rgba(110, 168, 255, 1)"],["frozenMarkerActiveColor","rgba(236, 243, 255, 1)"],["frozenMarkerActiveBorderColor","rgba(110, 168, 255, 1)"],["frozenMarkerColor","rgba(222, 222, 222, 1)"],["frozenMarkerBorderColor","rgba(168, 168, 168, 1)"],["frozenMarkerBorderWidth",1],["frozenMarkerWidth",2],["gridBackgroundColor","rgba(240, 240, 240, 1)"],["gridBorderCollapse","collapse"],["gridBorderColor","rgba(202, 202, 202, 1)"],["gridBorderWidth",1],["height","auto"],["maxHeight","inherit"],["maxWidth","inherit"],["minColumnWidth",45],["minHeight","inherit"],["minRowHeight",24],["minWidth","inherit"],["mobileContextMenuMargin",10],["mobileEditInputHeight",30],["mobileEditFontFamily","sans-serif"],["mobileEditFontSize","16px"],["moveOverlayBorderWidth",1],["moveOverlayBorderColor","rgba(66, 133, 244, 1)"],["moveOverlayBorderSegments","12, 7"],["name","default"],["overflowY","auto"],["overflowX","auto"],["reorderMarkerBackgroundColor","rgba(0, 0, 0, 0.1)"],["reorderMarkerBorderColor","rgba(0, 0, 0, 0.2)"],["reorderMarkerBorderWidth",1.25],["reorderMarkerIndexBorderColor","rgba(66, 133, 244, 1)"],["reorderMarkerIndexBorderWidth",2.75],["rowHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["rowHeaderCellBorderColor","rgba(200, 200, 200, 1)"],["rowHeaderCellBorderWidth",1],["rowHeaderCellColor","rgba(50, 50, 50, 1)"],["rowHeaderCellFont","16px sans-serif"],["rowHeaderCellHeight",25],["rowHeaderCellHorizontalAlignment","left"],["rowHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["rowHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["rowHeaderCellPaddingBottom",5],["rowHeaderCellPaddingLeft",5],["rowHeaderCellPaddingRight",5],["rowHeaderCellPaddingTop",5],["rowHeaderCellSelectedBackgroundColor","rgba(217, 217, 217, 1)"],["rowHeaderCellSelectedColor","rgba(50, 50, 50, 1)"],["rowHeaderCellVerticalAlignment","center"],["rowHeaderCellWidth",57],["scrollBarActiveColor","rgba(125, 125, 125, 1)"],["scrollBarBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarBorderColor","rgba(202, 202, 202, 1)"],["scrollBarBorderWidth",.5],["scrollBarBoxBorderRadius",4.125],["scrollBarBoxColor","rgba(192, 192, 192, 1)"],["scrollBarBoxMargin",2],["scrollBarBoxMinSize",15],["scrollBarBoxWidth",8],["scrollBarCornerBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarCornerBorderColor","rgba(202, 202, 202, 1)"],["scrollBarWidth",11],["selectionHandleBorderColor","rgba(255, 255, 255, 1)"],["selectionHandleBorderWidth",1.5],["selectionHandleColor","rgba(66, 133, 244, 1)"],["selectionHandleSize",8],["selectionHandleType","square"],["selectionOverlayBorderColor","rgba(66, 133, 244, 1)"],["selectionOverlayBorderWidth",1],["treeArrowBorderColor","rgba(195, 199, 202, 1)"],["treeArrowBorderWidth",1],["treeArrowClickRadius",5],["treeArrowColor","rgba(155, 155, 155, 1)"],["treeArrowHeight",8],["treeArrowMarginLeft",0],["treeArrowMarginRight",5],["treeArrowMarginTop",6],["treeArrowWidth",13],["treeGridHeight",250],["width","auto"]]}}}.apply(t,r))&&(e.exports=n)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2),__webpack_require__(0),__webpack_require__(3),__webpack_require__(4),__webpack_require__(5),__webpack_require__(6),__webpack_require__(7),__webpack_require__(8),__webpack_require__(9)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function context(component){"use strict";function Grid(args){args=args||{};var self={};return self.isComponent=void 0===args.component,self.isChildGrid=args.parentNode&&/canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType),self.isChildGrid?self.intf={}:self.intf=self.isComponent?eval("Reflect.construct(HTMLElement, [], new.target)"):document.createElement("canvas"),self.args=args,self.intf.args=args,self.applyComponentStyle=component.applyComponentStyle,self.hyphenateProperty=component.hyphenateProperty,self.dehyphenateProperty=component.dehyphenateProperty,self.createGrid=function(e){return e.component=!1,new Grid(e)},modules.forEach(function(e){e(self)}),self.isChildGrid?(self.shadowRoot=args.parentNode.shadowRoot,self.parentNode=args.parentNode):self.intf.createShadowRoot?(self.shadowRoot=self.intf.attachShadow({mode:"open"}),self.parentNode=self.shadowRoot):self.parentNode=self.intf,self.init(),self.intf}component=component();var modules=Array.prototype.slice.call(arguments);return window.HTMLElement&&(Grid.prototype=Object.create(window.HTMLElement.prototype)),window.customElements&&(Grid.observedAttributes=component.getObservableAttributes(),Grid.prototype.disconnectedCallback=component.disconnectedCallback,Grid.prototype.attributeChangedCallback=component.attributeChangedCallback,Grid.prototype.connectedCallback=component.connectedCallback,Grid.prototype.adoptedCallback=component.adoptedCallback,window.customElements.define("canvas-datagrid",Grid)),!window||window.canvasDatagrid||window.require||(window.canvasDatagrid=function(e){return new Grid(e)}),module.exports=function(e){e=e||{};var t,o=["style","formatters","sorters","filters","treeGridAttributes","cellGridAttributes","data","schema"];return window.customElements&&document.body.createShadowRoot?(t=document.createElement("canvas-datagrid"),Object.keys(e).forEach(function(r){if("data"!==r&&"parentNode"!==r)return-1!==o.indexOf(r)?void o.forEach(function(o){void 0!==e[o]&&o===r&&(-1!==["formatters","sorters","filters"].indexOf(r)?"object"==typeof e[o]&&null!==e[o]&&Object.keys(e[o]).forEach(function(r){t[o][r]=e[o][r]}):t[o]=e[o])}):void(t.attributes[r]=e[r])}),e.data&&(t.data=e.data),e.parentNode&&e.parentNode.appendChild(t),t):(e.component=!1,t=new Grid(e),e.parentNode&&e.parentNode.appendChild&&e.parentNode.appendChild(t),t)},module.exports}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(0)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(defaults){"use strict";return function(){function getDefaultItem(e,t){var o={};return defaults(o),o.defaults[e].filter(function(e){return e[0].toLowerCase()===t.toLowerCase()||component.hyphenateProperty(e[0])===t.toLowerCase()||component.hyphenateProperty(e[0],!0)===t.toLowerCase()})[0]}var typeMap,component={};return component.dehyphenateProperty=function(e){e=e.replace("--cdg-","");var t,o="";return Array.prototype.forEach.call(e,function(e){return t?(t=!1,void(o+=e.toUpperCase())):"-"===e?void(t=!0):void(o+=e)}),o},component.hyphenateProperty=function(e,t){var o="";return Array.prototype.forEach.call(e,function(e){if(e===e.toUpperCase())return void(o+="-"+e.toLowerCase());o+=e}),(t?"--cdg-":"")+o},component.applyComponentStyle=function(e,t){if(t.isComponent){var o=window.getComputedStyle("CANVAS-DATAGRID"===t.tagName?t:t.canvas,null),r={};t.computedStyle=o,defaults(r),r=r.defaults.styles,r.forEach(function(e){var r;r=o.getPropertyValue(component.hyphenateProperty(e[0],!0)),""===r&&(r=o.getPropertyValue(component.hyphenateProperty(e[0],!1))),""!==r&&"string"==typeof r&&t.setStyleProperty(e[0],typeMap[typeof e[1]](r.replace(/^\s+/,"").replace(/\s+$/,""),e[1]),!0)}),!e&&t.dispatchEvent&&(requestAnimationFrame(function(){t.resize(!0)}),t.dispatchEvent("stylechanged",t.style))}},typeMap={data:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid data.")}},schema:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid schema attribute.")}},number:function(e,t){var o=parseInt(e,10);return isNaN(o)?t:o},boolean:function(e){return/true/i.test(e)},string:function(e){return e}},component.getObservableAttributes=function(){var e={},t=["data","schema","style","className","name"];return defaults(e),e.defaults.attributes.forEach(function(e){t.push(e[0].toLowerCase())}),t},component.disconnectedCallback=function(){this.connected=!1},component.connectedCallback=function(){var e=this;e.parentDOMNode.innerHTML="",e.parentDOMNode.appendChild(e.canvas),e.connected=!0,component.observe(e),component.applyComponentStyle(!0,e),e.resize(!0)},component.adoptedCallback=function(){this.resize()},component.attributeChangedCallback=function(attrName,oldVal,newVal){var tfn,intf=this,def;if("style"===attrName)return void component.applyComponentStyle(!1,intf);if("data"===attrName)return"application/x-canvas-datagrid"===intf.dataType&&(intf.dataType="application/json+x-canvas-datagrid"),void(intf.args.data=newVal);if("schema"===attrName)return void(intf.args.schema=typeMap.schema(newVal));if("name"===attrName)return void(intf.name=newVal);if("class"!==attrName&&"className"!==attrName){if(def=getDefaultItem("attributes",attrName))return tfn=typeMap[typeof def[1]],void(intf.attributes[def[0]]=tfn(newVal));/^on/.test(attrName)&&intf.addEventListener("on"+attrName,function(e){eval(newVal)})}},component.observe=function(e){var t;window.MutationObserver&&(e.applyComponentStyle=function(){component.applyComponentStyle(!1,e),e.resize()},t=new window.MutationObserver(function(t){var o,r;Array.prototype.forEach.call(t,function(e){return"class"===e.attributeName||"style"===e.attributeName?void(r=!0):e.target.parentNode&&"STYLE"===e.target.parentNode.nodeName?void(r=!0):void((e.addedNodes.length>0||"characterData"===e.type)&&(o=!0))}),r&&e.applyComponentStyle(!1,e),o&&("application/x-canvas-datagrid"===e.dataType&&(e.dataType="application/json+x-canvas-datagrid"),e.data=e.innerHTML)}),t.observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0}),Array.prototype.forEach.call(document.querySelectorAll("style"),function(e){t.observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0})}))},component}}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(e,t,o,r){o=o||1;var n,l=[];for(n=e;n<=t;n+=o)l[n]=void 0===r?n:"function"==typeof r?r(n):r;return l}function o(t,o,r,n,l,i,a,s,c){var d=t/l.length,u=o/a;r+=e.canvasOffsetLeft,n+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.moveTo(r,n+o),l.forEach(function(t){var l,a,s=void 0===i?t:t[i];c&&(s=Math.abs(s)),l=r+d,a=n+o-s*u,e.ctx.lineTo(l,a),r+=d}),e.ctx.moveTo(r+t,n+o),e.ctx.strokeStyle=s,e.ctx.stroke()}function r(){var t=!0;Object.keys(e.htmlImageCache).forEach(function(o){e.htmlImageCache[o].complete||(t=!1)}),t&&!C&&(C=!0,e.draw())}function n(t){var o,n=t.innerHTML||t.formattedValue,l=n.toString()+t.rowIndex.toString()+t.columnIndex.toString(),i=t.x+e.canvasOffsetLeft,a=t.y+e.canvasOffsetTop;if(e.htmlImageCache[l]){if(o=e.htmlImageCache[l],o.height===t.height&&o.width===t.width){if(!o.complete)return;return e.ctx.drawImage(o,i,a)}e.htmlImageCache[l]=void 0}else C=!1;o=new Image(t.width,t.height),e.htmlImageCache[l]=o,o.onload=function(){e.ctx.drawImage(o,i,a),r()},o.src="data:image/svg+xml;base64,"+btoa('\n\n\n'+n+"\n\n\n")}function l(t,o){var r=e.style.columnHeaderOrderByArrowMarginTop*e.scale,n=e.style.columnHeaderOrderByArrowMarginLeft*e.scale,l=e.style.columnHeaderOrderByArrowMarginRight*e.scale,i=e.style.columnHeaderOrderByArrowWidth*e.scale,a=e.style.columnHeaderOrderByArrowHeight*e.scale;return t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.fillStyle=e.style.columnHeaderOrderByArrowColor,e.ctx.strokeStyle=e.style.columnHeaderOrderByArrowBorderColor,e.ctx.beginPath(),t+=n,o+=r,"asc"===e.orderDirection?(e.ctx.moveTo(t,o),e.ctx.lineTo(t+i,o),e.ctx.lineTo(t+.5*i,o+a),e.ctx.moveTo(t,o)):(e.ctx.lineTo(t,o+a),e.ctx.lineTo(t+i,o+a),e.ctx.lineTo(t+.5*i,o),e.ctx.lineTo(t,o+a)),e.ctx.stroke(),e.ctx.fill(),n+i+l}function i(t,o,r){var n=e.style.treeArrowMarginTop*e.scale,l=e.style.treeArrowMarginRight*e.scale,i=e.style.treeArrowMarginLeft*e.scale,a=e.style.treeArrowWidth*e.scale,s=e.style.treeArrowHeight*e.scale;return o+=e.canvasOffsetLeft,r+=e.canvasOffsetTop,e.ctx.fillStyle=e.style.treeArrowColor,e.ctx.strokeStyle=e.style.treeArrowBorderColor,e.ctx.beginPath(),o+=i,r+=n,e.openChildren[t.rowIndex]?(e.ctx.moveTo(o,r),e.ctx.lineTo(o+a,r),e.ctx.lineTo(o+.5*a,r+s),e.ctx.moveTo(o,r)):(e.ctx.lineTo(o,r),e.ctx.lineTo(o+s,r+.5*a),e.ctx.lineTo(o,r+a),e.ctx.lineTo(o,r)),e.ctx.stroke(),e.ctx.fill(),i+a+l}function a(t,o,r,n,l){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop;var i=t+r,a=o+n;e.ctx.beginPath(),e.ctx.moveTo(t+l,o),e.ctx.lineTo(i-l,o),e.ctx.quadraticCurveTo(i,o,i,o+l),e.ctx.lineTo(i,o+n-l),e.ctx.quadraticCurveTo(i,a,i-l,a),e.ctx.lineTo(t+l,a),e.ctx.quadraticCurveTo(t,a,t,a-l),e.ctx.lineTo(t,o+l),e.ctx.quadraticCurveTo(t,o,t+l,o)}function s(t,o,r,n){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.fillRect(t,o,r,n)}function c(t,o,r,n){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.strokeRect(t,o,r,n)}function d(t,o,r){o+=e.canvasOffsetLeft,r+=e.canvasOffsetTop,e.ctx.fillText(t,o,r)}function u(t,o,r){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.arc(t,o,r,0,2*Math.PI),e.ctx.fill()}function h(t,o,r){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.arc(t,o,r,0,2*Math.PI),e.ctx.stroke()}function f(t){e.ctx.beginPath(),0===t&&(e.ctx.moveTo(e.lastFrozenColumnPixel,e.lastFrozenRowPixel),e.ctx.lineTo(e.lastFrozenColumnPixel,e.height),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.width,e.lastFrozenRowPixel)),1===t&&(e.ctx.moveTo(0,e.lastFrozenRowPixel),e.ctx.lineTo(0,e.height),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.width,e.lastFrozenRowPixel)),2===t&&(e.ctx.moveTo(e.lastFrozenColumnPixel,0),e.ctx.lineTo(e.width,0),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.lastFrozenColumnPixel,e.height)),e.ctx.clip()}function g(t,o,r){if("circle"===e.style.selectionHandleType)return u(t,o,.5*r);s(t-.5*r,o-.5*r,r,r)}function m(t,o,r){if("circle"===e.style.selectionHandleType)return h(t,o,.5*r);c(t-.5*r,o-.5*r,r,r)}function x(t,o){var r=e.style.selectionHandleSize;({tr:function(){g(t.x+t.width,t.y,r),m(t.x+t.width,t.y,r)},br:function(){g(t.x+t.width,t.y+t.height,r),m(t.x+t.width,t.y+t.height,r)},tl:function(){g(t.x,t.y,r),m(t.x,t.y,r)},bl:function(){g(t.x,t.y+t.height,r),m(t.x,t.y+t.height,r)}})[o]()}function p(t,o){e.ctx.beginPath(),{t:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop)},r:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop+t.height)},b:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop+t.height),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop+t.height)},l:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop+t.height)}}[o](),e.ctx.stroke()}function y(t,o){if(!t.formattedValue)return{lines:[{width:0,value:""}],width:0,height:t.calculatedLineHeight};var r,n,l,i,a,s,c=t.formattedValue.split(o),d=t.calculatedLineHeight,u=[],h="nowrap"!==e.style.cellWhiteSpace,f=e.attributes.ellipsisText,g={width:0,value:""},m=h?t.paddedHeight:t.calculatedLineHeight;for(u.push(g),l=e.ctx.measureText(" "+f).width,r=0;rm){if(0===u.length)break;if(1,s=u[u.length-1],s.widtht.paddedWidth)for(var y=parseInt(a.length/2),v=-1;y>0;)a=p.substr(0,y*v+a.length),i=e.ctx.measureText(a+f).width,v=i>t.paddedWidth?-1:1,y=parseInt(y/2);a+=p.length!=a.length?f:"",s.value=a,s.width=i;break}r>0&&u.push(g)}}return{lines:u,width:0,height:t.calculatedLineHeight*u.length}}function v(t){var o,r,n=(t.text.lines.length,t.fontHeight*t.lineHeight),l="nowrap"!==e.style.cellWhiteSpace,i=0;for(o=0;oN)return!1;if(V=K[t],L=e.openChildren[t],l=(e.sizes.rows[t]||e.style.cellHeight)*e.scale,n=(L?e.sizes.trees[t]:0)*e.scale,R=l+n,D<-R)return!1;for(e.attributes.showRowHeaders&&(W+=te),oe=R,i=e.scrollIndexLeft;ie.width){e.scrollIndexRight=i,e.scrollPixelRight=W;break}for(W=0,e.attributes.showRowHeaders&&(W+=te),i=0;ie.width));i+=1);return e.lastFrozenColumnPixel=W,oe=R,W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,k=e.childGrids[t],t!==K.length&&L?(k.visible=!0,k.parentNode={offsetTop:D+l+e.canvasOffsetTop,offsetLeft:te-1+e.canvasOffsetLeft,offsetHeight:n,offsetWidth:e.width-te-e.style.scrollBarWidth-1,offsetParent:e.intf.parentNode,parentNode:e.intf.parentNode,style:e.style,nodeType:"canvas-datagrid-tree",scrollTop:e.scrollBox.scrollTop,scrollLeft:e.scrollBox.scrollLeft,rowIndex:t},e.visibleCells.unshift({rowIndex:t,columnIndex:0,y:k.parentNode.offsetTop,x:k.parentNode.offsetLeft,height:k.height,width:k.width,style:"tree-grid",type:k.parentNode.nodeType}),k.draw()):k&&(k.parentNode.offsetHeight=0,delete e.sizes.trees[t]),J.push([V,t,o,D,R]),e.visibleRowHeights[t]=R,D+=oe+(q?0:e.style.cellBorderWidth),!0}if(!e.dispatchEvent("beforedraw",{})&&(e.isChildGrid||e.height&&e.width)){if(e.isChildGrid&&r)return void requestAnimationFrame(e.parentGrid.draw);if(!1!==e.intf.visible){var M,z,P,H,O,k,L,R,A,D,W,F,N,j,_,G,V,Z,K=e.data||[],q="collapse"===e.style.gridBorderCollapse,Y=[],U=[],X=[],J=[],Q=K.length,$=e.currentCell||{},ee=e.getColumnHeaderCellHeight(),te=e.getRowHeaderCellWidth(),oe=e.style.cellHeight;B+=1,P=performance.now(),e.visibleRowHeights=[],K.length>e.orders.rows.length&&e.createRowOrders(),e.ctx.save(),function(){e.visibleRows=[],_=e.getSchema(),e.visibleCells=[],e.canvasOffsetTop=e.isChildGrid?e.parentNode.offsetTop:0,e.canvasOffsetLeft=e.isChildGrid?e.parentNode.offsetLeft:0,N=e.height,j=e.width}(),function(){a(0,0,j,N,0),e.ctx.clip(),e.ctx.fillStyle=e.style.gridBackgroundColor,s(0,0,j,N)}(),function(){var t,o=Math.min(K.length,e.frozenRow);for(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,D=ee,G=0;G0&&(a(0,e.lastFrozenRowPixel,e.width,e.height-e.lastFrozenRowPixel,0),e.ctx.clip());var t,o,r,n=_.length;for(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,e.attributes.snapToRow||(D+=-e.scrollBox.scrollTop+e.scrollPixelTop+e.style.cellBorderWidth),G=e.frozenRow+e.scrollIndexTop;Ge.width+e.scrollBox.scrollLeft));t+=1);J.push([e.newRow,K.length,K.length,D,R])}e.ctx.restore()}(),function(){if(Z){e.ctx.save();var t=e.activeCell.columnIndex+1>e.frozenColumn||e.activeCell.rowIndex+1>e.frozenRow;a(t?e.lastFrozenColumnPixel:0,t?e.lastFrozenRowPixel:0,t?e.width-e.lastFrozenColumnPixel:e.width,t?e.height-e.lastFrozenRowPixel:e.height,0),e.ctx.clip(),"row"===e.attributes.selectionMode?e.activeCell&&e.activeCell.rowIndex===Z.rowIndex&&(e.ctx.lineWidth=e.style.activeCellOverlayBorderWidth,e.ctx.strokeStyle=e.style.activeCellOverlayBorderColor,c(0,Z.y,e.getHeaderWidth()+te,e.visibleRowHeights[Z.rowIndex])):(e.ctx.lineWidth=e.style.activeCellOverlayBorderWidth,e.ctx.strokeStyle=e.style.activeCellOverlayBorderColor,c(Z.x,Z.y,Z.width,Z.height)),e.ctx.restore()}}(),function(){function t(t,a){for(a=Math.min(a,c),n=t;ne.width+e.scrollBox.scrollLeft)));n+=1);}var o,r,n,l,i,s,c=_.length;J.forEach(function(t,o){D=t[3],oe=t[4],o===e.frozenRow&&(e.ctx.save(),a(0,e.lastFrozenRowPixel,e.width,e.height-e.lastFrozenRowPixel,0),e.ctx.clip()),m(t[0],t[1],t[2])}),e.ctx.restore(),e.attributes.showColumnHeaders&&(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.columnHeaderCellBorderWidth,e.attributes.showRowHeaders&&(W+=te),D=0,oe=e.getColumnHeaderCellHeight(),t(e.scrollIndexLeft,c),s=W,W=e.style.columnHeaderCellBorderWidth,e.attributes.showRowHeaders&&(W+=te),t(0,e.frozenColumn),W=s,W-1&&e.currentCell.rowIndexe.reorderObject.sortRowIndex?"b":"t")):"column-reorder"===e.dragMode&&e.reorderObject&&(t.height=N,t.y=0,o.height=N,o.width=e.currentCell.width,o.y=0,o.x=e.currentCell.x,s(t.x,t.y,t.width,t.height),c(t.x,t.y,t.width,t.height),e.ctx.lineWidth=e.style.reorderMarkerIndexBorderWidth,e.ctx.strokeStyle=e.style.reorderMarkerIndexBorderColor,e.currentCell.sortColumnIndex!==e.reorderObject.sortColumnIndex&&e.currentCell.sortColumnIndex>-1&&e.currentCell.sortColumnIndex<_.length&&p(o,e.reorderTarget.columnIndex>e.reorderObject.columnIndex?"r":"l"))}}(),function(){e.movingSelection&&(e.ctx.lineWidth=e.style.moveOverlayBorderWidth,e.ctx.strokeStyle=e.style.moveOverlayBorderColor,e.ctx.setLineDash(e.style.moveOverlayBorderSegments),U.forEach(function(e){p(e[0],e[1])}),e.ctx.setLineDash([]))}(),function(){e.ctx.lineWidth=e.style.gridBorderWidth,e.ctx.strokeStyle=e.style.gridBorderColor,c(0,0,e.width,e.height)}(),function(){function t(e){p(e[0],e[1])}e.ctx.lineWidth=e.style.selectionOverlayBorderWidth,e.ctx.strokeStyle=e.style.selectionOverlayBorderColor,Y.filter(function(t){return t[0].rowIndex=e.frozenRow&&t[0].columnIndex>=e.frozenColumn}).forEach(t),e.ctx.restore(),e.ctx.save(),f(1),Y.filter(function(t){return t[0].rowIndex>=e.frozenRow&&t[0].columnIndex=e.frozenColumn}).forEach(t),e.ctx.restore()}(),function(){var t,o=e.scrollBox.entities,r=2*e.style.scrollBarBoxMargin;e.ctx.strokeStyle=e.style.scrollBarBorderColor,e.ctx.lineWidth=e.style.scrollBarBorderWidth,o.horizontalBox.x=te+e.style.scrollBarBoxMargin+(o.horizontalBar.width-e.scrollBox.scrollBoxWidth)*(e.scrollBox.scrollLeft/e.scrollBox.scrollWidth),o.verticalBox.y=ee+e.style.scrollBarBoxMargin+(o.verticalBar.height-e.scrollBox.scrollBoxHeight)*(e.scrollBox.scrollTop/e.scrollBox.scrollHeight),e.scrollBox.horizontalBarVisible&&(e.ctx.fillStyle=e.style.scrollBarBackgroundColor,s(o.horizontalBar.x,o.horizontalBar.y,o.horizontalBar.width+r,o.horizontalBar.height),c(o.horizontalBar.x,o.horizontalBar.y,o.horizontalBar.width+r,o.horizontalBar.height),e.ctx.fillStyle=e.style.scrollBarBoxColor,e.scrollBox.horizontalBoxVisible&&(/horizontal/.test($.context)&&(e.ctx.fillStyle=e.style.scrollBarActiveColor),a(o.horizontalBox.x,o.horizontalBox.y,o.horizontalBox.width,o.horizontalBox.height,e.style.scrollBarBoxBorderRadius),e.ctx.stroke(),e.ctx.fill()),t=!0,e.visibleCells.unshift(o.horizontalBar),e.visibleCells.unshift(o.horizontalBox)),e.scrollBox.verticalBarVisible&&(e.ctx.fillStyle=e.style.scrollBarBackgroundColor,s(o.verticalBar.x,o.verticalBar.y,o.verticalBar.width,o.verticalBar.height+r),c(o.verticalBar.x,o.verticalBar.y,o.verticalBar.width,o.verticalBar.height+r),e.scrollBox.verticalBoxVisible&&(e.ctx.fillStyle=e.style.scrollBarBoxColor,/vertical/.test($.context)&&(e.ctx.fillStyle=e.style.scrollBarActiveColor),a(o.verticalBox.x,o.verticalBox.y,o.verticalBox.width,o.verticalBox.height,e.style.scrollBarBoxBorderRadius),e.ctx.stroke(),e.ctx.fill()),t=!0,e.visibleCells.unshift(o.verticalBar),e.visibleCells.unshift(o.verticalBox)),t&&(e.ctx.strokeStyle=e.style.scrollBarCornerBorderColor,e.ctx.fillStyle=e.style.scrollBarCornerBackgroundColor,a(o.corner.x,o.corner.y,o.corner.width,o.corner.height,0),e.ctx.stroke(),e.ctx.fill(),e.visibleCells.unshift(o.corner))}(),M&&e.resize(!0),function(){e.ctx.save();var o;if((e.attributes.showPerformance||e.attributes.debug)&&(0===b.length&&(b=t(0,S,1,0)),b.pop(),b.unshift(performance.now()-P)),!e.attributes.debug)return void e.ctx.restore();e.ctx.font=e.style.debugFont,o={},o.perf=(b.reduce(function(e,t){return e+t},0)/Math.min(B,b.length)).toFixed(1),o.perfDelta=b[0].toFixed(1),o.frozenColumnsWidth=w(),o.htmlImages=Object.keys(e.htmlImageCache).length,o.reorderObject="x: "+(e.reorderObject||{columnIndex:0}).columnIndex+", y: "+(e.reorderObject||{rowIndex:0}).rowIndex,o.reorderTarget="x: "+(e.reorderTarget||{columnIndex:0}).columnIndex+", y: "+(e.reorderTarget||{rowIndex:0}).rowIndex,o.scale=e.scale,o.startScale=e.startScale,o.scaleDelta=e.scaleDelta,o.zoomDeltaStart=e.zoomDeltaStart,o.touchLength=e.touchLength,o.touches="y0: "+(e.touchPosition||{y:0}).y+" y1: "+(e.touchPosition1||{y:0}).y,o.scrollBox=e.scrollBox.toString(),o.scrollIndex="x: "+e.scrollIndexLeft+", y: "+e.scrollIndexTop,o.scrollPixel="x: "+e.scrollPixelLeft+", y: "+e.scrollPixelTop,o.canvasOffset="x: "+e.canvasOffsetLeft+", y: "+e.canvasOffsetTop,o.touchDelta="x: "+e.touchDelta.x+", y: "+e.touchDelta.y,o.touchAnimateTo="x: "+e.touchAnimateTo.x+", y: "+e.touchAnimateTo.y,o.scrollAnimation="x: "+e.scrollAnimation.x+", y: "+e.scrollAnimation.y,o.touchPPS="x: "+e.xPPS+", y: "+e.yPPS,o.touchPPST="x: "+e.xPPST+", y: "+e.yPPST,o.touchDuration=e.touchDuration,o.pointerLockPosition=e.pointerLockPosition?e.pointerLockPosition.x+", "+e.pointerLockPosition.y:"",o.size="w: "+e.width+", h: "+e.height,o.mouse="x: "+e.mouse.x+", y: "+e.mouse.y,o.touch=e.touchStart?"x: "+e.touchStart.x+", y: "+e.touchStart.y:"",o.entities=e.visibleCells.length,o.hasFocus=e.hasFocus,o.dragMode=e.dragMode,e.currentCell&&(o.columnIndex=e.currentCell.columnIndex,o.rowIndex=e.currentCell.rowIndex,o.sortColumnIndex=e.currentCell.sortColumnIndex,o.sortRowIndex=e.currentCell.sortRowIndex,o.context=e.currentCell.context,o.dragContext=e.currentCell.dragContext,o.style=e.currentCell.style,o.type=e.currentCell.type),e.ctx.textAlign="right",e.ctx.fillStyle=e.style.debugBackgroundColor,s(0,0,e.width,e.height),Object.keys(o).forEach(function(t,r){var n=t+": "+o[t];e.ctx.fillStyle=e.style.debugColor,d(n,j-20,(e.attributes.showPerformance?140:24)+14*r)}),e.ctx.restore()}(),function(){function r(t,r,c,u,h,f,g){var m;o(n,a,l,i,r,c,u,h,f),e.ctx.fillStyle=h,s(3+l,i+9+11*g,8,8),e.ctx.fillStyle=e.style.debugPerfChartTextColor,m=void 0!==c?r[0][c]:r[0],d(t+" "+(isNaN(m)?0:m).toFixed(3),14+l,i+16+11*g)}if(e.attributes.showPerformance){var n=250,l=e.width-n-e.style.scrollBarWidth-2*e.style.scrollBarBorderWidth,i=ee,a=100;0===E.length&&(E=t(0,S,1,function(){return[0,0]})),0===T.length&&(T=t(0,S,1,function(){return[0,0]})),0===I.length&&(I=t(0,S,1,0)),e.ctx.lineWidth=.5,e.ctx.textAlign="left",e.ctx.font=e.style.debugFont,e.ctx.fillStyle=e.style.debugPerfChartBackground,s(l,i,n,a),[["Scroll Height",E,0,e.scrollBox.scrollHeight,e.style.debugScrollHeightColor,!1],["Scroll Width",E,1,e.scrollBox.scrollWidth,e.style.debugScrollWidthColor,!1],["Performance",b,void 0,200,e.style.debugPerformanceColor,!1],["Entities",I,void 0,1500,e.style.debugEntitiesColor,!1],["TouchPPSX",T,0,1e3,e.style.debugTouchPPSXColor,!0],["TouchPPSY",T,1,1e3,e.style.debugTouchPPSYColor,!0]].forEach(function(e,t){e.push(t),r.apply(null,e)}),e.ctx.fillStyle=e.style.debugPerfChartBackground,I.pop(),I.unshift(e.visibleCells.length),E.pop(),E.unshift([e.scrollBox.scrollTop,e.scrollBox.scrollLeft]),T.pop(),T.unshift([e.yPPS,e.xPPS])}}(),e.dispatchEvent("afterdraw",{})||e.ctx.restore()}}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){var t;e.stopPropagation=function(e){e.stopPropagation()},e.addEventListener=function(t,o){e.events[t]=e.events[t]||[],e.events[t].unshift(o)},e.removeEventListener=function(t,o){(e.events[t]||[]).forEach(function(r,n){o===r&&e.events[t].splice(n,1)})},e.dispatchEvent=function(t,o){function r(){n=!0}o=t.type?t:o||{},t=t.type||t;var n;if(e.events[t])return e.events[t].forEach(function(t){o.ctx=e.ctx,o.preventDefault=r,t.apply(e.intf,[o])}),n},e.getRatio=function(){return Math.min(e.attributes.maxPixelRatio,(window.devicePixelRatio||1)/(e.ctx.webkitBackingStorePixelRatio||e.ctx.mozBackingStorePixelRatio||e.ctx.msBackingStorePixelRatio||e.ctx.oBackingStorePixelRatio||e.ctx.backingStorePixelRatio||1))},e.resize=function(t){function o(){e.scrollBox.horizontalBarVisible="auto"!==e.style.width&&b>e.scrollBox.width&&"hidden"!==e.style.overflowX||"scroll"===e.style.overflowX,e.scrollBox.horizontalBoxVisible=b>e.scrollBox.width,e.scrollBox.verticalBarVisible="auto"!==e.style.height&&w>e.scrollBox.height&&"hidden"!==e.style.overflowY||"scroll"===e.style.overflowY,e.scrollBox.verticalBoxVisible=w>e.scrollBox.height}function r(){e.scrollBox.width=e.width-S,e.scrollBox.height=e.height-B}function n(){e.isChildGrid||(i={height:B+w+y+1,width:b+S+y},["width","height"].forEach(function(t){-1!==["auto",void 0].indexOf(e.style[t])&&-1!==["auto",void 0].indexOf(e.appliedInlineStyles[t])?e.parentNodeStyle[t]=i[t]+"px":(e.parentNodeStyle[t]=e.style[t],e.isComponet&&(e.canvas.style[t]=e.style[t]))}))}if(e.canvas){var l,i,a={x:0,y:0,height:0,width:0,style:"vertical-scroll-bar"},s={x:0,y:0,height:0,width:0,style:"horizontal-scroll-bar"},c={x:0,y:0,height:0,width:0,style:"vertical-scroll-box"},d={x:0,y:0,height:0,width:0,style:"horizontal-scroll-box"},u={x:0,y:0,height:0,width:0,isCorner:!0,isScrollBoxCorner:!0,style:"scroll-box-corner"},h=2*e.style.scrollBarBoxMargin,f=2*e.style.scrollBarBorderWidth,g=.5*e.style.scrollBarBoxMargin,m=e.style.scrollBarWidth+2*e.style.scrollBarBorderWidth,x=e.getRatio(),p="collapse"===e.style.gridBorderCollapse?1:2,y=e.style.cellBorderWidth*p,v=e.style.columnHeaderCellBorderWidth*p,w=0,b=0,C=(e.data||[]).length,B=e.getColumnHeaderCellHeight(),S=e.getRowHeaderCellWidth(),I=e.style.cellHeight,M=e.getSchema();for(e.scrollCache.x=[],e.scrollCache.y=[],l=0;ll?e.sizes.trees[l]||0:0);return C>1&&(e.scrollCache.y[l]=w),b=M.reduce(function(t,o,r){if(o=M[e.orders.columns[r]],o.hidden)return e.scrollCache.x[r]=t,t;var n=t+e.getColummnWidth(e.orders.columns[r]);return e.scrollCache.x[r]=n,n},0)||0,e.attributes.showNewRow&&(w+=I),e.attributes.snapToRow&&(w+=e.style.cellHeight),n(),e.isChildGrid?(e.width=e.parentNode.offsetWidth,e.height=e.parentNode.offsetHeight):e.height===e.canvas.offsetHeight&&e.width===e.canvas.offsetWidth||(e.height=e.canvas.offsetHeight,e.width=e.canvas.offsetWidth,e.canvasOffsetLeft=e.args.canvasOffsetLeft||0,e.canvasOffsetTop=e.args.canvasOffsetTop||0),e.scrollBox.top=B+v,e.scrollBox.left=S,r(),o(),e.scrollBox.horizontalBarVisible&&("auto"!==e.style.height||e.isChildGrid||(e.height+=m),w+=m,n(),r(),o()),e.scrollBox.verticalBarVisible&&("auto"!==e.style.width||e.isChildGrid||(e.width+=m),b+=m,n(),r(),o()),r(),e.scrollBox.scrollWidth=b-e.scrollBox.width,e.scrollBox.scrollHeight=w-e.scrollBox.height,e.scrollBox.widthBoxRatio=e.scrollBox.width/b,e.scrollBox.scrollBoxWidth=e.scrollBox.width*e.scrollBox.widthBoxRatio-e.style.scrollBarWidth-f-g,e.scrollBox.heightBoxRatio=(e.scrollBox.height-B)/w,e.scrollBox.scrollBoxHeight=e.scrollBox.height*e.scrollBox.heightBoxRatio-e.style.scrollBarWidth-f-g,e.scrollBox.scrollBoxWidth=Math.max(e.scrollBox.scrollBoxWidth,e.style.scrollBarBoxMinSize),e.scrollBox.scrollBoxHeight=Math.max(e.scrollBox.scrollBoxHeight,e.style.scrollBarBoxMinSize),s.x+=S,s.y+=e.height-e.style.scrollBarWidth-g,s.width=e.width-e.style.scrollBarWidth-S-g-h,s.height=e.style.scrollBarWidth+e.style.scrollBarBorderWidth+g,d.y=s.y+e.style.scrollBarBoxMargin,d.width=e.scrollBox.scrollBoxWidth,d.height=e.style.scrollBarBoxWidth,a.x+=e.width-e.style.scrollBarWidth-e.style.scrollBarBorderWidth-g,a.y+=B,a.width=e.style.scrollBarWidth+e.style.scrollBarBorderWidth+g,a.height=e.height-B-e.style.scrollBarWidth-g-h,c.x=a.x+e.style.scrollBarBoxMargin,c.width=e.style.scrollBarBoxWidth,c.height=e.scrollBox.scrollBoxHeight,u.x=s.x+s.width+h,u.y=a.y+a.height+h,u.width=e.style.scrollBarWidth+e.style.scrollBarBorderWidth,u.height=e.style.scrollBarWidth+e.style.scrollBarBorderWidth,e.scrollBox.entities={horizontalBar:s,horizontalBox:d,verticalBar:a,verticalBox:c,corner:u},e.scrollBox.bar={v:a,h:s},e.scrollBox.box={v:c,h:d},e.page=Math.max(1,e.visibleRows.length-3-e.attributes.pageUpDownOverlap),e.isChildGrid||(e.canvas.width=e.width*x,e.canvas.height=e.height*x,e.ctx.scale(x,x)),e.resizeEditInput(),e.scroll(!0),t&&e.draw(!0),e.dispatchEvent("resize",{}),!0}},e.scroll=function(t){var o=e.getSchema(),r=(e.data||[]).length,n=e.style.cellHeight;for(e.scrollIndexTop=Math.floor(r*(e.scrollBox.scrollTop/e.scrollBox.scrollHeight)-100),e.scrollIndexTop=Math.max(e.scrollIndexTop,0),e.scrollPixelTop=e.scrollCache.y[e.scrollIndexTop],0===e.scrollBox.scrollHeight&&(e.scrollIndexTop=0),e.scrollPixelTop=0,e.scrollIndexLeft=e.frozenColumn,e.scrollPixelLeft=0;e.scrollPixelTop0&&(e.scrollIndexLeft=Math.max(e.scrollIndexLeft-1,0),e.scrollPixelLeft-=e.getColummnWidth(e.orders.columns[e.scrollIndexLeft])),(e.data||[]).length>0&&(e.scrollIndexTop=Math.max(e.scrollIndexTop-1,0),e.scrollPixelTop=Math.max(e.scrollPixelTop-(e.data[e.scrollIndexTop]?(e.sizes.rows[e.scrollIndexTop]||n)+(e.sizes.trees[e.scrollIndexTop]||0):n)*e.scale,0)),e.ellipsisCache={},t||e.draw(!0),requestAnimationFrame(e.resizeEditInput),e.dispatchEvent("scroll",{top:e.scrollBox.scrollTop,left:e.scrollBox.scrollLeft})},e.mousemove=function(t,o){if(!e.contextMenu&&!e.input){e.mouse=o||e.getLayerPos(t);var r,n,l,i,a=t.ctrlKey||t.metaKey||e.attributes.persistantSelectionMode,s=e.getSchema(),c=e.mouse.x,d=e.mouse.y,u=e.getCellAt(c,d),h={NativeEvent:t,cell:u,x:c,y:d},f=e.currentCell;if(clearTimeout(e.scrollTimer),e.isInGrid({x:c,y:d})||(e.hasFocus=!1),!e.dispatchEvent("mousemove",h)&&(u&&e.currentCell&&(e.rowBoundaryCrossed=e.currentCell.rowIndex!==u.rowIndex,e.columnBoundaryCrossed=e.currentCell.columnIndex!==u.columnIndex,e.cellBoundaryCrossed=e.rowBoundaryCrossed||e.columnBoundaryCrossed,["row","column","cell"].forEach(function(t){e[t+"BoundaryCrossed"]&&(h.cell=f,e.dispatchEvent(t+"mouseout",h),h.cell=u,e.dispatchEvent(t+"mouseover",h))})),e.currentCell=u,e.hasFocus)){if(e.hovers={},!e.draggingItem&&u&&-1===e.scrollModes.indexOf(u.context)&&(e.dragItem=u,e.dragMode=u.dragContext,e.cursor=u.context,"cell"===u.context&&(e.cursor="default",e.hovers={rowIndex:u.rowIndex,columnIndex:u.columnIndex}),(e.selecting||e.reorderObject)&&"cell"===u.context)){if(i={x:Math.abs(e.dragStart.x-c),y:Math.abs(e.dragStart.y-d)},-1!==e.dragStartObject.columnIndex&&t.shiftKey&&(e.dragStartObject={rowIndex:e.activeCell.rowIndex,columnIndex:e.activeCell.columnIndex}),n={top:Math.min(e.dragStartObject.rowIndex,u.rowIndex),left:Math.min(e.dragStartObject.columnIndex,u.columnIndex),bottom:Math.max(e.dragStartObject.rowIndex,u.rowIndex),right:Math.max(e.dragStartObject.columnIndex,u.columnIndex)},-1===e.dragStartObject.columnIndex&&(l=e.getSelectionBounds(),n.left=-1,n.right=s.length-1,n.top=Math.min(l.top,u.rowIndex),n.bottom=Math.max(l.bottom,u.rowIndex)),e.dragStartObject.rowIndex===u.rowIndex&&e.dragStartObject.columnIndex===u.columnIndex||(e.ignoreNextClick=!0),(e.cellBoundaryCrossed||0===i.x&&0===i.y||"row"===e.attributes.selectionMode)&&("row"!==e.attributes.selectionMode&&-1!==e.dragStartObject.columnIndex||!e.rowBoundaryCrossed?"row"!==e.attributes.selectionMode&&(e.dragAddToSelection||void 0===u.rowIndex?(e.selections[u.rowIndex]=e.selections[u.rowIndex]||[],-1===e.selections[u.rowIndex].indexOf(u.columnIndex)&&e.selections[u.rowIndex].push(u.columnIndex)):e.selections[u.rowIndex]&&-1!==e.selections[u.rowIndex].indexOf(u.columnIndex)&&e.selections[u.rowIndex].splice(e.selections[u.rowIndex].indexOf(u.columnIndex),1)):e.selectRow(u.rowIndex,a,null,!0)),!(e.selectionBounds&&n.top===e.selectionBounds.top&&n.left===e.selectionBounds.left&&n.bottom===e.selectionBounds.bottom&&n.right===e.selectionBounds.right||a))if(e.selections=[],l=n,"row"===e.attributes.selectionMode)for(r=l.top;r<=l.bottom;r+=1)e.selectRow(r,!0,null,!0);else-1!==n.top&&e.selectArea(l,!0);e.autoScrollZone(t,c,d,a)}e.cellBoundaryCrossed=!1,e.rowBoundaryCrossed=!1,e.columnBoundaryCrossed=!1,e.draw(!0)}}},e.click=function(t,o){function r(){var t,o=e.getSelectionBounds();l!==JSON.stringify(o)&&(t={selections:e.selections,selectionBounds:e.getSelectionBounds()},Object.defineProperty(t,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",t))}var n,l=JSON.stringify(e.getSelectionBounds()),i=t.ctrlKey||t.metaKey||e.attributes.persistantSelectionMode,a=o||e.getLayerPos(t);if(e.currentCell=e.getCellAt(a.x,a.y),void 0===e.currentCell.grid){if(e.input&&e.endEdit(),e.ignoreNextClick)return void(e.ignoreNextClick=!1);if(n=e.currentCell,!e.dispatchEvent("click",{NativeEvent:t,cell:e.currentCell})&&e.hasFocus){if(-1!==["rowHeaderCell","columnHeaderCell"].indexOf(e.currentCell.style)||i||e.setActiveCell(n.columnIndex,n.rowIndex),"cell"===e.currentCell.context){if("cornerCell"===e.currentCell.style)return e.selectAll(),e.draw(),void r();if("columnHeaderCell"===e.currentCell.style){if("sort"===e.attributes.columnHeaderClickBehavior)return e.orderBy===n.header.name?e.orderDirection="asc"===e.orderDirection?"desc":"asc":e.orderDirection="asc",e.order(n.header.name,e.orderDirection),void r();if("select"===e.attributes.columnHeaderClickBehavior)return e.selectColumn(n.header.index,i,t.shiftKey),void e.draw()}if(e.selections[n.rowIndex]=e.selections[n.rowIndex]||[],("row"===e.attributes.selectionMode||"rowHeaderCell"===e.currentCell.style)&&"rowHeaderCell"===e.currentCell.style&&e.attributes.tree&&a.x>0&&a.x-e.currentCell.x0)return void e.toggleTree(n.rowIndex);t.shiftKey&&!i&&(e.selectionBounds=e.getSelectionBounds(),e.selectArea(void 0,!1))}r(),e.draw(!0)}}},e.dragResizeColumn=function(t){var o,r,n;return o=e.getLayerPos(t),r=e.resizingStartingWidth+o.x-e.dragStart.x,n=e.resizingStartingHeight+o.y-e.dragStart.y,re.scrollBox.scrollWidth-e.attributes.resizeScrollZone&&"ew-resize"===e.dragMode&&(e.resize(!0),e.scrollBox.scrollLeft+=r),"ew-resize"===e.dragMode?(e.sizes.columns["rowHeaderCell"===e.draggingItem.header.style?"cornerCell":e.draggingItem.sortColumnIndex]=r,-1!==["rowHeaderCell","cornerCell"].indexOf(e.draggingItem.header.style)&&e.resize(!0),void e.resizeChildGrids()):"ns-resize"===e.dragMode?(e.draggingItem.rowOpen?e.sizes.trees[e.draggingItem.rowIndex]=n:e.attributes.globalRowResize?e.style.cellHeight=n:e.sizes.rows[e.draggingItem.rowIndex]=n,e.dispatchEvent("resizerow",{row:n}),void e.resizeChildGrids()):void(e.ellipsisCache={}))},e.stopDragResize=function(){e.resize(),document.body.removeEventListener("mousemove",e.dragResizeColumn,!1),document.body.removeEventListener("mouseup",e.stopDragResize,!1),e.setStorageData(),e.draw(!0),e.ignoreNextClick=!0},e.scrollGrid=function(t){var o=e.getLayerPos(t);return e.attributes.scrollPointerLock&&e.pointerLockPosition&&-1!==["horizontal-scroll-box","vertical-scroll-box"].indexOf(e.scrollStartMode)&&(e.pointerLockPosition.x+=t.movementX,e.pointerLockPosition.y+=t.movementY,e.pointerLockPosition.x=Math.min(e.width-e.style.scrollBarWidth,Math.max(0,e.pointerLockPosition.x)),e.pointerLockPosition.y=Math.min(e.height-e.style.scrollBarWidth,Math.max(0,e.pointerLockPosition.y)),o=e.pointerLockPosition),e.scrollMode=e.getCellAt(o.x,o.y).context,"horizontal-scroll-box"===e.scrollMode&&"horizontal-scroll-box"!==e.scrollStartMode?(e.scrollStartMode="horizontal-scroll-box",e.dragStart=o,e.scrollStart.left=e.scrollBox.scrollLeft,void clearTimeout(e.scrollTimer)):"vertical-scroll-box"===e.scrollMode&&"vertical-scroll-box"!==e.scrollStartMode?(e.scrollStartMode="vertical-scroll-box",e.dragStart=o,e.scrollStart.top=e.scrollBox.scrollTop,void clearTimeout(e.scrollTimer)):("vertical-scroll-box"===e.scrollStartMode&&"vertical-scroll-box"!==e.scrollMode&&(e.scrollMode="vertical-scroll-box"),"horizontal-scroll-box"===e.scrollStartMode&&"horizontal-scroll-box"!==e.scrollMode&&(e.scrollMode="horizontal-scroll-box"),clearTimeout(e.scrollTimer),void(-1!==e.scrollModes.indexOf(e.scrollMode)&&("vertical-scroll-box"===e.scrollMode?e.scrollBox.scrollTop=e.scrollStart.top+(o.y-e.dragStart.y)/e.scrollBox.heightBoxRatio:"vertical-scroll-top"===e.scrollMode?(e.scrollBox.scrollTop-=e.page*e.style.cellHeight,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)):"vertical-scroll-bottom"===e.scrollMode&&(e.scrollBox.scrollTop+=e.page*e.style.cellHeight,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)),"horizontal-scroll-box"===e.scrollMode?e.scrollBox.scrollLeft=e.scrollStart.left+(o.x-e.dragStart.x)/e.scrollBox.widthBoxRatio:"horizontal-scroll-right"===e.scrollMode?(e.scrollBox.scrollLeft+=e.attributes.selectionScrollIncrement,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)):"horizontal-scroll-left"===e.scrollMode&&(e.scrollBox.scrollLeft-=e.attributes.selectionScrollIncrement,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)))))},e.stopScrollGrid=function(){clearTimeout(e.scrollTimer),document.exitPointerLock&&document.exitPointerLock(),document.removeEventListener("mousemove",e.scrollGrid,!1)},e.dragReorder=function(t){var o,r,n,l="column-reorder"===e.dragMode,i="row-reorder"===e.dragMode;o=e.getLayerPos(t),r=o.x-e.dragStart.x,n=o.y-e.dragStart.y,!e.attributes.allowColumnReordering&&l||!e.attributes.allowRowReordering&&i||e.dispatchEvent("reordering",{NativeEvent:t,source:e.dragStartObject,target:e.currentCell,dragMode:e.dragMode})||(Math.abs(r)>e.attributes.reorderDeadZone||Math.abs(n)>e.attributes.reorderDeadZone)&&(e.reorderObject=e.draggingItem,e.reorderTarget=e.currentCell,e.reorderObject.dragOffset={x:r,y:n},e.autoScrollZone(t,l?o.x:-1,i?o.y:-1,!1))},e.stopDragReorder=function(t){var o,r,n={"row-reorder":e.orders.rows,"column-reorder":e.orders.columns},l={"row-reorder":"rowIndex","column-reorder":"sortColumnIndex"}[e.dragMode];document.body.removeEventListener("mousemove",e.dragReorder,!1),document.body.removeEventListener("mouseup",e.stopDragReorder,!1),e.reorderObject&&e.reorderTarget&&("column-reorder"===e.dragMode&&e.reorderTarget.sortColumnIndex>-1&&e.reorderTarget.sortColumnIndex-1&&e.reorderTarget.rowIndexe.attributes.reorderDeadZone||Math.abs(o.y)>e.attributes.reorderDeadZone)&&setTimeout(function(){e.autoScrollZone(t,o.x,o.y,!1)},1)}},e.stopDragMove=function(t){document.body.removeEventListener("mousemove",e.dragMove,!1),document.body.removeEventListener("mouseup",e.stopDragMove,!1);var o=e.getSelectionBounds();if(e.dispatchEvent("endmove",{NativeEvent:t,cell:e.currentCell}))return e.movingSelection=void 0,e.moveOffset=void 0,void e.draw(!0);e.moveOffset&&(e.moveTo(e.movingSelection,o.left+e.moveOffset.x,o.top+e.moveOffset.y),e.moveSelection(e.moveOffset.x,e.moveOffset.y)),e.movingSelection=void 0,e.moveOffset=void 0,e.draw(!0)},e.freezeMove=function(t){if(!e.dispatchEvent("freezemoving",{NativeEvent:t,cell:e.currentCell})){var o=e.getLayerPos(t);e.ignoreNextClick=!0,e.freezeMarkerPosition=o,e.currentCell&&void 0!==e.currentCell.rowIndex&&"frozen-row-marker"===e.dragMode&&(e.scrollBox.scrollTop=0,e.frozenRow=e.currentCell.rowIndex+1),e.currentCell&&void 0!==e.currentCell.columnIndex&&"frozen-column-marker"===e.dragMode&&(e.scrollBox.scrollLeft=0,e.frozenColumn=e.currentCell.columnIndex+1),(Math.abs(o.x)>e.attributes.reorderDeadZone||Math.abs(o.y)>e.attributes.reorderDeadZone)&&setTimeout(function(){e.autoScrollZone(t,o.x,o.y,!1)},1)}},e.stopFreezeMove=function(t){if(document.body.removeEventListener("mousemove",e.freezeMove,!1),document.body.removeEventListener("mouseup",e.stopFreezeMove,!1),e.freezeMarkerPosition=void 0,e.dispatchEvent("endfreezemove",{NativeEvent:t}))return e.frozenRow=e.startFreezeMove.x,e.frozenColumn=e.startFreezeMove.y,void e.draw(!0);e.draw(!0)},e.mousedown=function(t,o){if(e.lastMouseDownTarget=t.target,!e.dispatchEvent("mousedown",{NativeEvent:t,cell:e.currentCell})&&e.hasFocus&&2!==t.button&&!e.input){var r=t.ctrlKey||t.metaKey,n=/-move/.test(e.dragMode),l=/frozen-row-marker|frozen-column-marker/.test(e.dragMode),i=/-resize/.test(e.dragMode);if(e.dragStart=o||e.getLayerPos(t),e.scrollStart={left:e.scrollBox.scrollLeft,top:e.scrollBox.scrollTop},e.dragStartObject=e.getCellAt(e.dragStart.x,e.dragStart.y),e.dragAddToSelection=!e.dragStartObject.selected,r||t.shiftKey||/(vertical|horizontal)-scroll-(bar|box)/.test(e.dragStartObject.context)||!e.currentCell||e.currentCell.isColumnHeader||n||l||i||(e.selections=[]),!e.dragStartObject.isGrid){if(-1!==e.scrollModes.indexOf(e.dragStartObject.context))return e.scrollMode=e.dragStartObject.context,e.scrollStartMode=e.dragStartObject.context,e.scrollGrid(t),e.attributes.scrollPointerLock&&-1!==["horizontal-scroll-box","vertical-scroll-box"].indexOf(e.scrollStartMode)&&(e.pointerLockPosition={x:e.dragStart.x,y:e.dragStart.y},e.canvas.requestPointerLock()),document.addEventListener("mousemove",e.scrollGrid,!1),document.addEventListener("mouseup",e.stopScrollGrid,!1),void(e.ignoreNextClick=!0);if("cell"===e.dragMode)return e.selecting=!0,void(("row"===e.attributes.selectionMode||-1===e.dragStartObject.columnIndex)&&e.dragStartObject.rowIndex>-1?e.selectRow(e.dragStartObject.rowIndex,r,null):"row"!==e.attributes.selectionMode&&e.mousemove(t));if(n){if(e.draggingItem=e.dragItem,e.movingSelection=e.selections.concat([]),e.dragging=e.dragStartObject,e.dispatchEvent("beginmove",{NativeEvent:t,cell:e.currentCell}))return;return document.body.addEventListener("mousemove",e.dragMove,!1),document.body.addEventListener("mouseup",e.stopDragMove,!1),e.mousemove(t)}if(l){if(e.draggingItem=e.dragItem,e.startFreezeMove={x:e.frozenRow,y:e.frozenColumn},e.dispatchEvent("beginfreezemove",{NativeEvent:t}))return;return document.body.addEventListener("mousemove",e.freezeMove,!1),document.body.addEventListener("mouseup",e.stopFreezeMove,!1),e.mousemove(t)}return i?(e.draggingItem=e.dragItem,e.draggingItem.rowOpen?e.resizingStartingHeight=e.sizes.trees[e.draggingItem.rowIndex]:e.resizingStartingHeight=e.sizes.rows[e.draggingItem.rowIndex]||e.style.cellHeight,e.resizingStartingWidth=e.sizes.columns["rowHeaderCell"===e.draggingItem.header.style?"cornerCell":e.draggingItem.sortColumnIndex]||e.draggingItem.width,document.body.addEventListener("mousemove",e.dragResizeColumn,!1),void document.body.addEventListener("mouseup",e.stopDragResize,!1)):-1!==["row-reorder","column-reorder"].indexOf(e.dragMode)?(e.draggingItem=e.dragStartObject,document.body.addEventListener("mousemove",e.dragReorder,!1),void document.body.addEventListener("mouseup",e.stopDragReorder,!1)):void 0}}},e.mouseup=function(t){clearTimeout(e.scrollTimer),e.cellBoundaryCrossed=!0,e.rowBoundaryCrossed=!0,e.columnBoundaryCrossed=!0,e.selecting=void 0,e.draggingItem=void 0,e.dragStartObject=void 0,e.dispatchEvent("mouseup",{NativeEvent:t,cell:e.currentCell})||(e.hasFocus||t.target===e.canvas)&&(e.currentCell&&void 0!==e.currentCell.grid||e.contextMenu||e.input||(e.dragStart&&e.isInGrid(e.dragStart)&&e.controlInput.focus(),t.preventDefault()))},e.getAdjacentCells=function(){var t,o,r=e.getSchema(),n={};for(t=0;te.activeCell.columnIndex&&void 0===n.right&&(n.right=t),ts&&(i=s),(i<0||Number.isNaN(i))&&(i=0),l>d&&(l=n.last),t.shiftKey&&-1!==[37,38,39,40].indexOf(t.keyCode)&&(e.selections[Math.max(i,0)]=e.selections[Math.max(i,0)]||[],e.selections[Math.max(i,0)].push(l),e.selectionBounds=e.getSelectionBounds(),e.selectArea(void 0,a),e.draw(!0)),l===e.activeCell.columnIndex&&i===e.activeCell.rowIndex||(e.scrollIntoView(l!==e.activeCell.columnIndex?l:void 0,i===e.activeCell.rowIndex||Number.isNaN(i)?void 0:i),e.setActiveCell(l,i),!t.shiftKey&&e.attributes.selectionFollowsActiveCell&&(a||(e.selections=[]),e.selections[i]=e.selections[i]||[],e.selections[i].push(l),r={selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.getSelectionBounds()},Object.defineProperty(r,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",r)),e.draw(!0))}},e.keyup=function(t){e.dispatchEvent("keyup",{NativeEvent:t,cell:e.currentCell})||e.hasFocus},e.keypress=function(t){e.hasFocus&&e.dispatchEvent("keypress",{NativeEvent:t,cell:e.currentCell})},e.dblclick=function(t){e.dispatchEvent("dblclick",{NativeEvent:t,cell:e.currentCell})||e.hasFocus&&("ew-resize"===e.currentCell.context&&"columnHeaderCell"===e.currentCell.style?e.fitColumnToValues(e.currentCell.header.name):"ew-resize"===e.currentCell.context&&"cornerCell"===e.currentCell.style?e.autosize():-1!==["cell","activeCell"].indexOf(e.currentCell.style)&&e.beginEditAt(e.currentCell.columnIndex,e.currentCell.rowIndex))},e.scrollWheel=function(o){var r,n,l=o,i=void 0===o.deltaX?o.NativeEvent.deltaX:o.deltaX,a=void 0===o.deltaY?o.NativeEvent.deltaY:o.deltaY,s=void 0===o.deltaMode?o.NativeEvent.deltaMode:o.deltaMode;if(!t&&!e.dispatchEvent("wheel",{NativeEvent:o})){var o=o.NativeEvent||o;e.touchHaltAnimation=!0,r=e.scrollBox.scrollLeft,n=e.scrollBox.scrollTop,e.hasFocus&&(1===s&&(a*=17),(e.scrollBox.scrollTop0||e.scrollBox.scrollLeft0||e.scrollBox.scrollTop>0&&a<0||e.scrollBox.scrollLeft>0&&i<0)&&l.preventDefault(o),t=setTimeout(function(){t=void 0,e.scrollBox.scrollTo(i+r,a+n)},1))}},e.pasteItem=function(t,o,r,n){function l(e,t,o,r,n,l){var i=t;return Array.isArray(e)||null===e||"object"!=typeof e||(e=Object.keys(e).map(function(t){return e[t]})),/^text\/html/.test(n)&&(e=e.substring(4,e.length-5).split("")),"string"==typeof e&&(e=[e]),c[l]=[],e.forEach(function(n,a){var s=r[a+o].name;if(void 0===e[a]||null===e[a])return void(i[s]=t[s]);c[l].push(a+o),i[s]=e[a]}),i}var i,a=e.getVisibleSchema(),s=r-1,c=[];if(/^text\/html/.test(n)){if(!/^(]+>)?/.test(t.substring(0,29)))return void console.warn("Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.");t=t.substring(t.indexOf("")+11,t.length-13).split(""),t=t.filter(function(e){return!/^/.test(e)})}else t=t.split("\n");return i=t.length,t.forEach(function(t){s+=1;var r=e.orders.rows[s];e.data[r]=l(t,e.data[r],o,a,n,r)}),e.selections=c,i},e.getNextVisibleColumnIndex=function(t){var o,r=e.getVisibleSchema();for(o=0;o/g,">")}function r(e){return e=null===e||void 0===e?"":e,""}function n(t,r){if(!f.length||t.length<2)return"";var n=[];return r&&n.push(""),f.forEach(function(l,i){if(l=f[e.orders.columns[i]],!l.hidden&&-1!==t.indexOf(l.name)){var a=l.name||l.title||"";r?n.push(""):n.push('"'+a.replace(/"/g,'""')+'"')}}),n.push(r?"":"\n"),n.join(r?"":",")}function l(e,t,o,n){return null!==e&&!1!==e&&void 0!==e&&e.replace?(t.push(r(e)),void o.push('"'+e.replace(/"/g,'""')+'"')):void 0!==e?(o.push(e),void t.push(r(e))):(o.push(""),void t.push(""))}if(!e.dispatchEvent("copy",{NativeEvent:t})&&e.hasFocus&&t.clipboardData){var i,a,s,c=(e.data,[]),d=[],u={},h=e.getSelectedData(),f=e.getSchema();h.length>0&&(h.forEach(function(t){var o=Object.keys(t);if(t){var r=[],n=[],i=[];f.forEach(function(t,o){i.push(f[e.orders.columns[o]])}),i.forEach(function(e,i){-1!==o.indexOf(e.name)&&(u[e.name]=!0,l(t[e.name],r,n,e))}),c.push(r.join("")),d.push(n.join(","))}}),s=Object.keys(u),i=n(s)+d.join("\n"),a="
|^
"+("string"==typeof e?o(e):e)+"
"+o(a)+"
 
"+n(s,!0)+""+c.join("")+"
",1===s.length&&(i=i.substring(1,i.length-1)),t.clipboardData.setData("text/html",a),t.clipboardData.setData("text/plain",i),t.clipboardData.setData("text/csv",i),t.clipboardData.setData("application/json",JSON.stringify(h)),t.preventDefault())}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(t){function o(){var t=e.scrollBox.scrollLeft,n=e.scrollBox.scrollTop;t+=i?e.attributes.selectionScrollIncrement:0,n+=s?e.attributes.selectionScrollIncrement:0,n-=c?e.attributes.selectionScrollIncrement:0,t-=a?e.attributes.selectionScrollIncrement:0,e.scrollBox.scrollTo(t,n),r=setTimeout(o,e.attributes.scrollRepeatRate)}var n,l,i,a,s,c,d,u,h;if(!e.dispatchEvent("beforetouchmove",{NativeEvent:t})){if(clearTimeout(r),t.changedTouches[0]&&(e.touchPosition=e.getTouchPos(t)),t.changedTouches[1]&&(e.touchPosition1=e.getTouchPos(t,1)),Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)>e.attributes.touchDeadZone&&clearTimeout(e.touchContextTimeout),2===t.touches.length&&e.touchPosition&&e.touchPosition1)return u=e.touchPosition.y,h=e.touchPosition1.y,e.zoomDeltaStart||(e.zoomDeltaStart=Math.abs(u-h),e.startScale=e.scale),e.touchLength=2,e.scaleDelta=e.zoomDeltaStart-Math.abs(u-h),e.scale=e.startScale-e.scaleDelta*e.attributes.touchZoomSensitivity,e.scale=Math.min(Math.max(e.scale,e.attributes.touchZoomMin),e.attributes.touchZoomMax),e.zoomAltered=!0,e.resize(!0),void e.resizeChildGrids();if(!e.zoomAltered)return e.touchLength=1,e.touchPosition=e.touchPosition||e.touchPosition1,n=e.getColumnHeaderCellHeight(),l=e.getRowHeaderCellWidth(),i=e.width-e.style.scrollBarWidth-e.touchPosition.xr||e.scrollAnimation.y===e.scrollBox.scrollTop&&e.scrollAnimation.x===e.scrollBox.scrollLeft||e.stopAnimation||(e.scrollBox.scrollTo(e.scrollAnimation.x,e.scrollAnimation.y),requestAnimationFrame(e.touchEndAnimation))},e.touchEditCell=function(t){e.beginEditAt(t.columnIndex,t.rowIndex)},e.touchCell=function(t){return function(){clearInterval(e.calculatePPSTimer);var o,r=e.getTouchPos(t);if(Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)=r.top&&t.columnIndex<=r.right?(r.bottom=t.rowIndex,r.left=t.columnIndex):"selection-handle-tl"===o&&t.rowIndex<=r.bottom&&t.columnIndex<=r.right?(r.top=t.rowIndex,r.left=t.columnIndex):"selection-handle-tr"===o&&t.rowIndex<=r.bottom&&t.columnIndex>=r.left?(r.top=t.rowIndex,r.right=t.columnIndex):"selection-handle-br"===o&&t.rowIndex>=r.top&&t.columnIndex>=r.left&&(r.bottom=t.rowIndex,r.right=t.columnIndex),"row"===e.attributes.selectionMode||-1===t.rowIndex?(r.left=0,r.right=e.getSchema().length-1):r.left=Math.max(0,r.left),e.selectArea(r),e.draw(!0)}},e.touchmove=function(e){o||requestAnimationFrame(function(){o=!0,t(e),o=!1})},e.touchEndEvents=function(t){e.zoomDeltaStart=void 0,e.touchSelecting=!1,clearInterval(e.touchScrollTimeout),clearInterval(e.touchContextTimeout),clearInterval(e.calculatePPSTimer),t.stopPropagation(),document.body.removeEventListener("touchmove",e.touchmove,{passive:!1}),document.body.removeEventListener("touchend",e.touchend,!1),document.body.removeEventListener("touchcancel",e.touchcancel,!1)},e.touchend=function(t){if(!e.dispatchEvent("touchend",{NativeEvent:t,cell:e.currentCell})){if(e.zoomDeltaStart=void 0,t.changedTouches[0]&&(e.touchPosition=void 0),t.changedTouches[1]&&(e.touchPosition1=void 0),e.zoomAltered)return void(0===t.touches.length&&(e.zoomAltered=!1));var o=Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)e.attributes.scrollAnimationPPSThreshold||Math.abs(e.yPPST)>e.attributes.scrollAnimationPPSThreshold)||/-scroll-/.test(e.startingCell.style)||o||(e.stopAnimation=!1,e.touchEndAnimation()),e.touchEndEvents(t)}},e.touchcancel=function(t){e.dispatchEvent("touchcancel",{NativeEvent:t,cell:e.currentCell})||e.touchEndEvents(t)}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e,t){function o(e,t){var o,r=[];for(o=e;o<=t;o+=1)r[o]=o;return r}e.scale=1,e.orders={rows:[],columns:[]},e.appliedInlineStyles={},e.cellGridAttributes={},e.treeGridAttributes={},e.visibleRowHeights=[],e.hasFocus=!1,e.activeCell={columnIndex:0,rowIndex:0},e.innerHTML="",e.storageName="canvasDataGrid",e.invalidSearchExpClass="canvas-datagrid-invalid-search-regExp",e.localStyleLibraryStorageKey="canvas-datagrid-user-style-library",e.dataType="application/x-canvas-datagrid",e.orderBy=null,e.orderDirection="asc",e.columnFilters={},e.filters={},e.frozenRow=0,e.frozenColumn=0,e.ellipsisCache={},e.scrollCache={x:[],y:[]},e.scrollBox={},e.visibleRows=[],e.sizes={rows:{},columns:{},trees:{}},e.currentFilter=function(){return!0},e.selections=[],e.hovers={},e.attributes={},e.style={},e.formatters={},e.sorters={},e.parsers={},e.schemaHashes={},e.events={},e.changes=[],e.scrollIndexTop=0,e.scrollPixelTop=0,e.scrollIndexLeft=0,e.scrollPixelLeft=0,e.childGrids={},e.openChildren={},e.scrollModes=["vertical-scroll-box","vertical-scroll-top","vertical-scroll-bottom","horizontal-scroll-box","horizontal-scroll-right","horizontal-scroll-left"],e.componentL1Events={},e.eventNames=["afterdraw","afterrendercell","attributechanged","beforebeginedit","beforecreatecellgrid","beforedraw","beforeendedit","beforerendercell","beforerendercellgrid","beginedit","cellmouseout","cellmouseover","click","collapsetree","contextmenu","copy","datachanged","dblclick","endedit","expandtree","formatcellvalue","keydown","keypress","keyup","mousedown","mousemove","mouseup","newrow","ordercolumn","rendercell","rendercellgrid","renderorderbyarrow","rendertext","rendertreearrow","reorder","reordering","resize","resizecolumn","resizerow","schemachanged","scroll","selectionchanged","stylechanged","touchcancel","touchend","touchmove","touchstart","wheel"],e.mouse={x:0,y:0},e.getSelectedData=function(t){var o=[],r=e.getSchema(),n=e.data.length;return 0===n?[]:(e.selections.forEach(function(l,i){if(l&&i!==n){if(0===l.length)return void(o[i]=null);o[i]={},l.forEach(function(n){var l;-1!==n&&r[n]&&(l=e.orders.columns[n],!t&&r[l].hidden||e.data[i]&&(o[i][r[l].name]=e.data[i][r[l].name]))})}}),o)},e.getColumnHeaderCellHeight=function(){return e.attributes.showColumnHeaders?(e.sizes.rows[-1]||e.style.columnHeaderCellHeight)*e.scale:0},e.getRowHeaderCellWidth=function(){return e.attributes.showRowHeaders?(e.sizes.columns[-1]||e.style.rowHeaderCellWidth)*e.scale:0},e.setStorageData=function(){if(e.attributes.saveAppearance&&e.attributes.name){var t={};e.getSchema().forEach(function(e){t[e.name]=!e.hidden}),localStorage.setItem(e.storageName+"-"+e.attributes.name,JSON.stringify({sizes:{rows:e.sizes.rows,columns:e.sizes.columns},orders:{rows:e.orders.rows,columns:e.orders.columns},orderBy:e.orderBy,orderDirection:e.orderDirection,visibility:t}))}},e.getSchema=function(){return e.schema||e.tempSchema||[]},e.createColumnOrders=function(){var t=e.getSchema();e.orders.columns=o(0,t.length-1)},e.createRowOrders=function(){e.orders.rows=o(0,e.data.length-1)},e.getVisibleSchema=function(){return e.getSchema().filter(function(e){return!e.hidden})},e.applyDefaultValue=function(t,o){var r=o.defaultValue||"";"function"==typeof r&&(r=r.apply(e.intf,[o])),t[o.name]=r},e.createNewRowData=function(){e.newRow={},e.getSchema().forEach(function(t){e.applyDefaultValue(e.newRow,t)})},e.getSchemaNameHash=function(t){for(var o=0;e.schemaHashes[t];)o+=1,t+=o;return t},e.filter=function(t){var o=e.filters[t];return o||void 0===t||(console.warn("Cannot find filter for type %s, falling back to substring match.",t),o=e.filters.string),o},e.getBestGuessDataType=function(e,t){var o,r,n=t.length;for(r=0;re.width-e.attributes.selectionScrollZone&&oe.height-e.attributes.selectionScrollZone&&r0)throw new Error("A column with the name "+e.name+" already exists and cannot be added again.");return!0},e.setDefaults=function(e,t,o,r){e[o]=void 0===t[o]?r:t[o]},e.setAttributes=function(){e.defaults.attributes.forEach(function(t){e.setDefaults(e.attributes,e.args,t[0],t[1])})},e.setStyle=function(){e.defaults.styles.forEach(function(t){e.setDefaults(e.style,e.args.style||{},t[0],t[1])})},e.autosize=function(t){e.getVisibleSchema().forEach(function(o,r){o.name!==t&&void 0!==t||(e.sizes.columns[r]=Math.max(e.findColumnMaxTextLength(o.name),e.style.minColumnWidth))}),e.sizes.columns[-1]=e.findColumnMaxTextLength("cornerCell")},e.dispose=function(){!e.isChildGrid&&e.canvas&&e.canvas.parentNode&&e.canvas.parentNode.removeChild(e.canvas),e.isChildGrid||document.body.removeChild(e.controlInput),e.eventParent.removeEventListener("mouseup",e.mouseup,!1),e.eventParent.removeEventListener("mousedown",e.mousedown,!1),e.eventParent.removeEventListener("dblclick",e.dblclick,!1),e.eventParent.removeEventListener("click",e.click,!1),e.eventParent.removeEventListener("mousemove",e.mousemove),e.eventParent.removeEventListener("wheel",e.scrollWheel,!1),e.canvas.removeEventListener("contextmenu",e.contextmenu,!1),e.canvas.removeEventListener("copy",e.copy),e.controlInput.removeEventListener("copy",e.copy),e.controlInput.removeEventListener("cut",e.cut),e.controlInput.removeEventListener("paste",e.paste),e.controlInput.removeEventListener("keypress",e.keypress,!1),e.controlInput.removeEventListener("keyup",e.keyup,!1),e.controlInput.removeEventListener("keydown",e.keydown,!1),window.removeEventListener("resize",e.resize),e.observer&&e.observer.disconnect&&e.observer.disconnect()},e.tryLoadStoredSettings=function(){var t;e.reloadStoredValues(),e.storedSettings&&"object"==typeof e.storedSettings.orders&&null!==e.storedSettings.orders&&(e.storedSettings.orders.rows.length>=(e.data||[]).length&&(e.orders.rows=e.storedSettings.orders.rows),t=e.getSchema(),e.storedSettings.orders.columns.length===t.length&&(e.orders.columns=e.storedSettings.orders.columns),e.orderBy=void 0===e.storedSettings.orderBy?t[0].name:e.storedSettings.orderBy,e.orderDirection=void 0===e.storedSettings.orderDirection?"asc":e.storedSettings.orderDirection,void 0!==e.storedSettings.orderBy&&e.getHeaderByName(e.orderBy)&&e.orderDirection&&e.order(e.orderBy,e.orderDirection))},e.getDomRoot=function(){return e.shadowRoot?e.shadowRoot.host:e.parentNode},e.getFontName=function(e){return e.replace(/\d+\.?\d*px/,"")},e.getFontHeight=function(e){return parseFloat(e,10)},e.parseStyleValue=function(t){if(/Font/.test(t))return e.style[t+"Height"]=e.getFontHeight(e.style[t]),void(e.style[t+"Name"]=e.getFontName(e.style[t]));"moveOverlayBorderSegments"===t&&"string"==typeof e.style[t]&&(e.style[t]=e.style[t].split(",").map(function(e){return parseInt(e,10)}))},e.initProp=function(t){e.args[t]&&Object.keys(e.args[t]).forEach(function(o){e[t][o]=e.args[t][o]})},e.getStyleProperty=function(t){return-1===e.styleKeys.indexOf(t)?e.parentNodeStyle[t]:e.style[t]},e.setStyleProperty=function(t,o,r){var n=-1!==["height","width","minHeight","minWidth","maxHeight","maxWidth"].indexOf(t);-1===e.styleKeys.indexOf(t)?e.parentNodeStyle[t]=o:(/-/.test(t)&&(t=e.dehyphenateProperty(t)),e.style[t]=o,e.parseStyleValue(t)),n&&e.resize(),r||(e.draw(!0),e.dispatchEvent("stylechanged",{name:"style",value:o}))},e.reloadStoredValues=function(){if(e.attributes.name&&e.attributes.saveAppearance){try{e.storedSettings=localStorage.getItem(e.storageName+"-"+e.attributes.name)}catch(t){console.warn("Error loading stored values. "+t.message),e.storedSettings=void 0}if(e.storedSettings)try{e.storedSettings=JSON.parse(e.storedSettings)}catch(t){console.warn("could not read settings from localStore",t),e.storedSettings=void 0}e.storedSettings&&("object"==typeof e.storedSettings.sizes&&null!==e.storedSettings.sizes&&(e.sizes.rows=e.storedSettings.sizes.rows,e.sizes.columns=e.storedSettings.sizes.columns,["trees","columns","rows"].forEach(function(t){e.sizes[t]||(e.sizes[t]={})})),"object"==typeof e.storedSettings.visibility&&e.getSchema().forEach(function(t){e.storedSettings.visibility&&void 0!==e.storedSettings.visibility[t.name]&&(t.hidden=!e.storedSettings.visibility[t.name])}))}},e.init=function(){function t(t){-1===e.styleKeys.indexOf(t)&&e.styleKeys.push(t)}if(!e.initialized){var o={};return e.setAttributes(),e.setStyle(),e.initScrollBox(),e.setDom(),e.nodeType="canvas-datagrid",e.ie=/Trident/.test(window.navigator.userAgent),e.edge=/Edge/.test(window.navigator.userAgent),e.webKit=/WebKit/.test(window.navigator.userAgent),e.moz=/Gecko/.test(window.navigator.userAgent),e.mobile=/Mobile/i.test(window.navigator.userAgent),e.cursorGrab="grab",e.cursorGrabing="grabbing",e.cursorGrab=e.webKit?"-webkit-grab":e.cursorGrab,e.cursorGrabing=e.moz?"-webkit-grabbing":e.cursorGrabbing,e.pointerLockPosition={x:0,y:0},Object.keys(e.style).forEach(e.parseStyleValue),e.intf.moveSelection=e.moveSelection,e.intf.moveTo=e.moveTo,e.intf.addEventListener=e.addEventListener,e.intf.removeEventListener=e.removeEventListener,e.intf.dispatchEvent=e.dispatchEvent,e.intf.dispose=e.dispose,e.intf.appendTo=e.appendTo,e.intf.getVisibleCellByIndex=e.getVisibleCellByIndex,e.intf.filters=e.filters,e.intf.sorters=e.sorters,e.intf.autosize=e.autosize,e.intf.beginEditAt=e.beginEditAt,e.intf.endEdit=e.endEdit,e.intf.setActiveCell=e.setActiveCell,e.intf.forEachSelectedCell=e.forEachSelectedCell,e.intf.scrollIntoView=e.scrollIntoView,e.intf.clearChangeLog=e.clearChangeLog,e.intf.gotoCell=e.gotoCell,e.intf.gotoRow=e.gotoRow,e.intf.getHeaderByName=e.getHeaderByName,e.intf.findColumnScrollLeft=e.findColumnScrollLeft,e.intf.findRowScrollTop=e.findRowScrollTop,e.intf.fitColumnToValues=e.fitColumnToValues,e.intf.findColumnMaxTextLength=e.findColumnMaxTextLength,e.intf.disposeContextMenu=e.disposeContextMenu,e.intf.getCellAt=e.getCellAt,e.intf.isCellVisible=e.isCellVisible,e.intf.isRowVisible=e.isRowVisible,e.intf.isColumnVisible=e.isColumnVisible,e.intf.order=e.order,e.intf.draw=e.draw,e.intf.isComponent=e.isComponent,e.intf.selectArea=e.selectArea,e.intf.clipElement=e.clipElement,e.intf.getSchemaFromData=e.getSchemaFromData,e.intf.setFilter=e.setFilter,e.intf.selectRow=e.selectRow,e.intf.parentGrid=e.parentGrid,e.intf.toggleTree=e.toggleTree,e.intf.expandTree=e.expandTree,e.intf.collapseTree=e.collapseTree,e.intf.canvas=e.canvas,e.intf.context=e.ctx,e.intf.insertRow=e.insertRow,e.intf.deleteRow=e.deleteRow,e.intf.addRow=e.addRow,e.intf.insertColumn=e.insertColumn,e.intf.deleteColumn=e.deleteColumn,e.intf.addColumn=e.addColumn,e.intf.getClippingRect=e.getClippingRect,e.intf.setRowHeight=e.setRowHeight,e.intf.setColumnWidth=e.setColumnWidth,e.intf.resetColumnWidths=e.resetColumnWidths,e.intf.resetRowHeights=e.resetRowHeights,e.intf.resize=e.resize,e.intf.selectColumn=e.selectColumn,e.intf.selectRow=e.selectRow,e.intf.selectAll=e.selectAll,e.intf.selectNone=e.selectNone,e.intf.drawChildGrids=e.drawChildGrids,e.intf.assertPxColor=e.assertPxColor,e.intf.clearPxColorAssertions=e.clearPxColorAssertions,e.intf.integerToAlpha=e.integerToAlpha,e.intf.copy=e.copy,e.intf.setStyleProperty=e.setStyleProperty,Object.defineProperty(e.intf,"defaults",{get:function(){return{styles:e.defaults.styles.reduce(function(e,t){return e[t[0]]=t[1],e},{}),attributes:e.defaults.attributes.reduce(function(e,t){return e[t[0]]=t[1],e},{})}}}),e.styleKeys=Object.keys(e.intf.defaults.styles),e.styleKeys.map(function(t){return e.hyphenateProperty(t,!1)}).forEach(t),e.styleKeys.map(function(t){return e.hyphenateProperty(t,!0)}).forEach(t),e.DOMStyles=window.getComputedStyle(document.body,null),e.styleKeys.concat(Object.keys(e.DOMStyles)).forEach(function(t){o[t]=void 0,Object.defineProperty(o,t,{get:function(){return e.getStyleProperty(t)},set:function(o){e.initialized&&(e.appliedInlineStyles[t]=o),e.setStyleProperty(t,o)}})}),Object.defineProperty(e.intf,"shadowRoot",{get:function(){return e.shadowRoot}}),Object.defineProperty(e.intf,"activeCell",{get:function(){return e.activeCell}}),Object.defineProperty(e.intf,"hasFocus",{get:function(){return e.hasFocus}}),Object.defineProperty(e.intf,"style",{get:function(){return o},set:function(t){Object.keys(t).forEach(function(o){e.setStyleProperty(o,t[o],!0)}),e.draw(!0),e.dispatchEvent("stylechanged",{name:"style",value:t})}}),Object.defineProperty(e.intf,"attributes",{value:{}}),Object.keys(e.attributes).forEach(function(t){Object.defineProperty(e.intf.attributes,t,{get:function(){return e.attributes[t]},set:function(o){e.attributes[t]=o,"name"===t&&e.tryLoadStoredSettings(),e.draw(!0),e.dispatchEvent("attributechanged",{name:t,value:o[t]})}})}),e.filters.string=function(t,o){t=String(t);var r,n=/\/(i|g|m)*$/,l=n.exec(o),i=l?l[0].substring(1):"",a=i.length;if(e.invalidFilterRegEx=void 0,"/"===o.substring(0,1)&&l){try{r=new RegExp(o.substring(1,o.length-(a+1)),i)}catch(t){return void(e.invalidFilterRegEx=t)}return r.test(t)}return!!t.toString&&-1!==t.toString().toLocaleUpperCase().indexOf(o.toLocaleUpperCase())},e.filters.number=function(e,t){return!t||e===t},["formatters","filters","sorters"].forEach(e.initProp),e.applyComponentStyle(!1,e.intf),e.reloadStoredValues(),e.args.data&&(e.intf.data=e.args.data),(e.intf.innerText||e.intf.textContent)&&("application/x-canvas-datagrid"===e.intf.dataType&&(e.intf.dataType="application/json+x-canvas-datagrid"),e.intf.data=e.intf.innerText||e.intf.textContent),e.args.schema&&(e.intf.schema=e.args.schema),e.isChildGrid||!e.isComponent?requestAnimationFrame(function(){e.resize(!0)}):e.resize(!0),e.initialized=!0,e}},e.intf.blur=function(t){e.hasFocus=!1},e.intf.focus=function(){e.hasFocus=!0,e.controlInput.focus()},(e.shadowRoot||e.isChildGrid)&&(Object.defineProperty(e.intf,"height",{get:function(){return e.shadowRoot?e.shadowRoot.height:e.parentNode.height},set:function(t){e.shadowRoot?e.shadowRoot.height=t:e.parentNode.height=t,e.resize(!0)}}),Object.defineProperty(e.intf,"width",{get:function(){return e.shadowRoot?e.shadowRoot.width:e.parentNode.width},set:function(t){e.shadowRoot?e.shadowRoot.width=t:e.parentNode.width=t,e.resize(!0)}}),Object.defineProperty(e.intf,"parentNode",{get:function(){return e.parentNode},set:function(t){if(!e.isChildGrid)throw new TypeError("Cannot set property parentNode which has only a getter");e.parentNode=t}})),Object.defineProperty(e.intf,"visibleRowHeights",{get:function(){return e.visibleRowHeights}}),Object.defineProperty(e.intf,"openChildren",{get:function(){return e.openChildren}}),Object.defineProperty(e.intf,"childGrids",{get:function(){return Object.keys(e.childGrids).map(function(t){return e.childGrids[t]})}}),Object.defineProperty(e.intf,"isChildGrid",{get:function(){return e.isChildGrid}}),Object.defineProperty(e,"cursor",{get:function(){return e.parentNodeStyle.cursor},set:function(t){"cell"===t&&(t="default"),e.currentCursor!==t&&(e.parentNodeStyle.cursor=t,e.currentCursor=t)}}),Object.defineProperty(e.intf,"orderDirection",{get:function(){return e.orderDirection},set:function(t){"desc"!==t&&(t="asc"),e.orderDirection=t,e.order(e.orderBy,e.orderDirection)}}),Object.defineProperty(e.intf,"orderBy",{get:function(){return e.orderBy},set:function(t){if(void 0===e.getSchema().find(function(e){return e.name===t}))throw new Error("Cannot sort by unknown column name.");e.orderBy=t,e.order(e.orderBy,e.orderDirection)}}),e.isComponent&&(Object.defineProperty(e.intf,"offsetHeight",{get:function(){return e.canvas.offsetHeight}}),Object.defineProperty(e.intf,"offsetWidth",{get:function(){return e.canvas.offsetWidth}})),Object.defineProperty(e.intf,"scrollHeight",{get:function(){return e.scrollBox.scrollHeight}}),Object.defineProperty(e.intf,"scrollWidth",{get:function(){return e.scrollBox.scrollWidth}}),Object.defineProperty(e.intf,"scrollTop",{get:function(){return e.scrollBox.scrollTop},set:function(t){e.scrollBox.scrollTop=t}}),Object.defineProperty(e.intf,"scrollLeft",{get:function(){return e.scrollBox.scrollLeft},set:function(t){e.scrollBox.scrollLeft=t}}),Object.defineProperty(e.intf,"sizes",{get:function(){return e.sizes}}),Object.defineProperty(e.intf,"parentDOMNode",{get:function(){return e.parentDOMNode}}),Object.defineProperty(e.intf,"input",{get:function(){return e.input}}),Object.defineProperty(e.intf,"controlInput",{get:function(){return e.controlInput}}),Object.defineProperty(e.intf,"currentCell",{get:function(){return e.currentCell}}),Object.defineProperty(e.intf,"visibleCells",{get:function(){return e.visibleCells}}),Object.defineProperty(e.intf,"visibleRows",{get:function(){return e.visibleRows}}),Object.defineProperty(e.intf,"selections",{get:function(){return e.selections}}),Object.defineProperty(e.intf,"dragMode",{get:function(){return e.dragMode}}),Object.defineProperty(e.intf,"changes",{get:function(){return e.changes}}),e.intf.formatters=e.formatters,Object.defineProperty(e.intf,"dataType",{get:function(){return e.dataType},set:function(t){if(!e.parsers[t])throw new Error("No parser for MIME type "+t);e.dataType=t}}),e.eventNames.forEach(function(t){Object.defineProperty(e.intf,"on"+t,{get:function(){return e.componentL1Events[t]},set:function(o){e.events[t]=[],e.componentL1Events[t]=o,o&&e.addEventListener(t,o)}})}),Object.defineProperty(e.intf,"frozenRow",{get:function(){return e.frozenRow},set:function(t){if(isNaN(t))throw new TypeError("Expected value for frozenRow to be a number.");if(e.visibleRows.length0&&void 0===e.storedSettings&&e.autosize(),e.fitColumnToValues("cornerCell",!0),e.createRowOrders(),e.tryLoadStoredSettings(),e.dispatchEvent("datachanged",{data:e.data}),e.resize(!0)})}}),e.initScrollBox=function(){function t(t,o){if(isNaN(t))throw new Error("ScrollTop value must be a number");t<0&&(t=0),t>a&&(t=a),a<0&&(t=0),l=t,o||e.scroll()}function o(t,o){if(isNaN(t))throw new Error("ScrollLeft value must be a number");t<0&&(t=0),t>s&&(t=s),s<0&&(t=0),i=t,o||e.scroll()}var r=0,n=0,l=0,i=0,a=0,s=0,c=20,d=20;e.scrollBox.toString=function(){return'{"width": '+s.toFixed(2)+', "height": '+a.toFixed(2)+', "left": '+i.toFixed(2)+', "top": '+l.toFixed(2)+', "widthRatio": '+e.scrollBox.widthBoxRatio.toFixed(5)+', "heightRatio": '+e.scrollBox.heightBoxRatio.toFixed(5)+"}"},e.scrollBox.scrollTo=function(e,r,n){o(e,!0),t(r,n)},Object.defineProperty(e.scrollBox,"scrollBoxHeight",{get:function(){return c},set:function(e){c=e}}),Object.defineProperty(e.scrollBox,"scrollBoxWidth",{get:function(){return d},set:function(e){d=e}}),Object.defineProperty(e.scrollBox,"height",{get:function(){return r},set:function(e){r=e}}),Object.defineProperty(e.scrollBox,"width",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(e.scrollBox,"scrollTop",{get:function(){return l},set:t}),Object.defineProperty(e.scrollBox,"scrollLeft",{get:function(){return i},set:o}),Object.defineProperty(e.scrollBox,"scrollHeight",{get:function(){return a},set:function(e){l>e&&(l=Math.max(e,0)),a=e}}),Object.defineProperty(e.scrollBox,"scrollWidth",{get:function(){return s},set:function(e){i>e&&(i=Math.max(e,0)),s=e}})}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(t){e.createInlineStyle(t,"canvas-datagrid-context-menu-item"+(e.mobile?"-mobile":"")),t.addEventListener("mouseover",function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item:hover")}),t.addEventListener("mouseout",function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item")})}function o(r,n,a,s){function c(){a.forEach(function(n){function l(e){e.relatedTarget===m||n.contextMenu.container===e.relatedTarget||s===e.relatedTarget||c===e.relatedTarget||n.contextMenu.container.contains(e.relatedTarget)||(n.contextMenu.dispose(),y.splice(y.indexOf(n.contextMenu),1),n.contextMenu=void 0,c.removeEventListener("mouseout",l),m.removeEventListener("mouseout",l),c.setAttribute("contextOpen","0"),c.setAttribute("opening","0"))}function i(t){if("1"===c.getAttribute("opening")&&"1"!==c.getAttribute("contextOpen")){var i=c.getBoundingClientRect();i={left:i.left+e.style.childContextMenuMarginLeft+m.offsetWidth,top:i.top+e.style.childContextMenuMarginTop,bottom:i.bottom,right:i.right},n.contextMenu=o(r,i,t,w),c.setAttribute("contextOpen","1"),c.addEventListener("mouseout",l),m.addEventListener("mouseout",l),y.push(n.contextMenu)}}function a(){var e;if("1"!==c.getAttribute("contextOpen")){if(c.setAttribute("opening","1"),"function"==typeof n.items)return void(void 0!==(e=n.items.apply(w,[function(e){i(e)}]))&&Array.isArray(e)&&i(e));i(n.items)}}var s,c=document.createElement("div");!function(o){function n(e){if(null!==e){if("function"==typeof e)return n(e(r));if("object"==typeof e)return void c.appendChild(e);t(c),c.innerHTML=e}}n(o.title),o.contextItemContainer=c,(o.items&&o.items.length>0||"function"==typeof o.items)&&(s=document.createElement("div"),e.createInlineStyle(s,"canvas-datagrid-context-child-arrow"),s.innerHTML=e.style.childContextMenuArrowHTML,c.appendChild(s),c.addEventListener("mouseover",a),c.addEventListener("mouseout",function(){c.setAttribute("opening","0")})),o.click&&c.addEventListener("click",function(t){o.click.apply(e,[t])})}(n),m.appendChild(c)})}function d(e){a[e].contextItemContainer.dispatchEvent(new Event("click"))}function u(){m.scrollTop>0?e.parentDOMNode.appendChild(x):x.parentNode&&x.parentNode.removeChild(x),m.scrollTop>=m.scrollHeight-m.offsetHeight&&p.parentNode?p.parentNode.removeChild(p):m.scrollHeight-m.offsetHeight>0&&!(m.scrollTop>=m.scrollHeight-m.offsetHeight)&&e.parentDOMNode.appendChild(p)}function h(t){return function o(){var r=e.attributes.contextHoverScrollAmount;"up"===t&&0===m.scrollTop||"down"===t&&m.scrollTop===m.scrollHeight||(m.scrollTop+="up"===t?-r:r,i=setTimeout(o,e.attributes.contextHoverScrollRateMs,t))}}function f(e){return function(){clearTimeout(i)}}var g,m=document.createElement("div"),x=document.createElement("div"),p=document.createElement("div"),y=[],v=-1,w={};if(!Array.isArray(a))throw new Error("createContextMenu expects an array.");return w.parentGrid=e.intf,w.parentContextMenu=s,w.container=m,function(){var t={},o=e.scrollOffset(e.canvas);void 0===l&&(l=e.style.contextMenuZIndex),c(),e.createInlineStyle(m,"canvas-datagrid-context-menu"+(e.mobile?"-mobile":"")),t.x=n.left-o.left,t.y=n.top-o.top,t.height=0,l+=1,m.style.position="absolute",x.style.color=e.style.contextMenuArrowColor,p.style.color=e.style.contextMenuArrowColor,[x,p].forEach(function(e){e.style.textAlign="center",e.style.position="absolute",e.style.zIndex=l+1}),m.style.zIndex=l,s&&s.inputDropdown&&(m.style.maxHeight=window.innerHeight-t.y-e.style.autocompleteBottomMargin+"px",m.style.minWidth=n.width+"px",t.y+=n.height),e.mobile&&(m.style.width=n.width+"px"),m.style.left=t.x+"px",m.style.top=t.y+"px",m.addEventListener("scroll",u),m.addEventListener("wheel",function(t){e.hasFocus&&(m.scrollTop+=t.deltaY,m.scrollLeft+=t.deltaX),u()}),x.innerHTML=e.style.contextMenuArrowUpHTML,p.innerHTML=e.style.contextMenuArrowDownHTML,m.appendChild(x),document.body.appendChild(p),document.body.appendChild(m),g=m.getBoundingClientRect(),g.bottom>window.innerHeight&&(s&&s.inputDropdown||(t.y-=g.bottom+e.style.contextMenuWindowMargin-window.innerHeight),t.y<0&&(t.y=e.style.contextMenuWindowMargin),m.offsetHeight>window.innerHeight-e.style.contextMenuWindowMargin&&(m.style.height=window.innerHeight-2*e.style.contextMenuWindowMargin+"px")),g.right>window.innerWidth&&(t.x-=g.right-window.innerWidth+e.style.contextMenuWindowMargin),t.x<0&&(t.x=e.style.contextMenuWindowMargin),t.y<0&&(t.y=e.style.contextMenuWindowMargin),m.style.left=t.x+"px",m.style.top=t.y+"px",g=m.getBoundingClientRect(),x.style.top=g.top+"px",p.style.top=g.top+g.height-p.offsetHeight+"px",x.style.left=g.left+"px",p.style.left=g.left+"px",p.style.width=m.offsetWidth+"px",x.style.width=m.offsetWidth+"px",p.addEventListener("mouseover",h("down")),p.addEventListener("mouseout",f("down")),x.addEventListener("mouseover",h("up")),x.addEventListener("mouseout",f("up")),u()}(),w.clickIndex=d,w.rect=g,w.items=a,w.upArrow=x,w.downArrow=p,w.dispose=function(){clearTimeout(i),y.forEach(function(e){e.dispose()}),[p,x,m].forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})},Object.defineProperty(w,"selectedIndex",{get:function(){return v},set:function(t){if("number"!=typeof t||isNaN(t||!isFinite(t)))throw new Error("Context menu selected index must be a sane number.");v=t,v>a.length-1&&(v=a.length-1),v<0&&(v=0),a.forEach(function(t,o){if(o===v)return e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item:hover");e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item")})}}),w}function r(t){function r(){h.style.background=e.style.contextFilterInputBackground,h.style.color=e.style.contextFilterInputColor,e.invalidFilterRegEx&&(h.style.background=e.style.contextFilterInvalidRegExpBackground,h.style.color=e.style.contextFilterInvalidRegExpColor)}function n(){var o=0;i={},e.data.forEach(function(r){var n=r[t.cell.header.name];i[n]||o>e.attributes.maxAutoCompleteItems||(o+=1,i[n]={title:e.formatters[t.cell.header.type||"string"]({cell:{value:n}}),click:function(t){h.value=n,t.stopPropagation(),h.dispatchEvent(new Event("keyup")),e.disposeAutocomplete()}})}),i=Object.keys(i).map(function(e){return i[e]})}function l(e){e&&-1!==[40,38,13,9].indexOf(e.keyCode)||(n(),s=h.getBoundingClientRect(),a&&(a.dispose(),a=void 0),a=o(t,{left:s.left,top:s.top,right:s.right,bottom:s.bottom,height:s.height,width:s.width},i,{inputDropdown:!0}),a.selectedIndex=0)}var i,s,c=document.createElement("div"),d=document.createElement("div"),u=document.createElement("button"),h=document.createElement("input"),f=t.cell&&t.cell.header?t.cell.header.title||t.cell.header.name:"";e.createInlineStyle(d,"canvas-datagrid-context-menu-label"),e.createInlineStyle(u,"canvas-datagrid-context-menu-filter-button"),e.createInlineStyle(h,"canvas-datagrid-context-menu-filter-input"),r(),h.onclick=e.disposeAutocomplete,h.addEventListener("keydown",function(t){40===t.keyCode&&(a.selectedIndex+=1),38===t.keyCode&&(a.selectedIndex-=1),13===t.keyCode&&(a.clickIndex(a.selectedIndex),e.disposeContextMenu()),9===t.keyCode&&(a.clickIndex(a.selectedIndex),t.preventDefault()),27===t.keyCode&&e.disposeContextMenu()}),h.addEventListener("keyup",function(){e.setFilter(t.cell.header.name,h.value)}),h.addEventListener("keyup",l),["focus","blur","keydown","keyup","change"].forEach(function(e){h.addEventListener(e,r)}),h.value=t.cell.header?e.columnFilters[t.cell.header.name]||"":"",d.innerHTML=e.attributes.filterOptionText.replace(/%s/g,f),u.onclick=function(){if(a)return e.disposeAutocomplete();l()},u.innerHTML=e.style.contextFilterButtonHTML,c.addEventListener("click",function(e){return e.stopPropagation()}),c.appendChild(d),c.appendChild(h),c.appendChild(u),t.items.push({title:c}),Object.keys(e.columnFilters).length&&Object.keys(e.columnFilters).forEach(function(o){var r=e.getHeaderByName(o);t.items.push({title:e.attributes.removeFilterOptionText.replace(/%s/g,r.title||r.name),click:function(t){t.preventDefault(),e.setFilter(o,""),e.controlInput.focus()}})})}function n(o){var n=!(o.cell.isBackground||o.cell.isColumnHeaderCellCap||o.cell.isScrollBar||o.cell.isCorner||o.cell.isRowHeader)&&o.cell.header;e.attributes.showFilter&&n&&r(o),e.attributes.showCopy&&e.selections.reduce(function(e,t){return e+t.length},0)>0&&o.items.push({title:e.attributes.copyText,click:function(){document.execCommand("copy"),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.showPaste&&e.clipBoardData&&o.items.push({title:e.attributes.pasteText,click:function(){e.paste(e.clipBoardData,o.cell.columnIndex,o.cell.rowIndex),e.draw()}}),e.attributes.showColumnSelector&&(o.items.push({title:e.attributes.columnSelectorText,items:function(){var o=[];return e.getSchema().forEach(function(r){function n(t){r.hidden=!r.hidden,e.dispatchEvent("togglecolumn",{column:r,hidden:r.hidden}),t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),e.resize(!0),e.setStorageData()}var l=document.createElement("div");t(l),l.addEventListener("touchstart",n),l.addEventListener("click",n),l.innerHTML=(r.hidden?e.attributes.columnSelectorHiddenText:e.attributes.columnSelectorVisibleText)+(r.title||r.name),o.push({title:l})}),o}}),o.cell&&o.cell.header&&o.cell.columnIndex>-1&&o.items.push({title:e.attributes.hideColumnText.replace(/%s/gi,o.cell.header.title||o.cell.header.name),click:function(t){e.getSchema()[o.cell.columnIndex].hidden=!0,t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),e.setStorageData(),setTimeout(function(){e.resize(!0)},10)}})),e.attributes.saveAppearance&&e.attributes.showClearSettingsOption&&(Object.keys(e.sizes.rows).length>0||Object.keys(e.sizes.columns).length>0)&&o.items.push({title:e.attributes.clearSettingsOptionText,click:function(t){t.preventDefault(),e.sizes.rows={},e.sizes.columns={},e.createRowOrders(),e.createColumnOrders(),e.storedSettings=void 0,e.dispatchEvent("resizecolumn",{columnWidth:e.style.cellWidth}),e.dispatchEvent("resizerow",{cellHeight:e.style.cellHeight}),e.setStorageData(),e.resize(!0),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.allowSorting&&e.attributes.showOrderByOption&&n&&(o.items.push({title:e.attributes.showOrderByOptionTextAsc.replace("%s",o.cell.header.title||o.cell.header.name),click:function(t){t.preventDefault(),e.order(o.cell.header.name,"asc"),e.controlInput.focus()}}),o.items.push({title:e.attributes.showOrderByOptionTextDesc.replace("%s",o.cell.header.title||o.cell.header.name),click:function(t){t.preventDefault(),e.order(o.cell.header.name,"desc"),e.disposeContextMenu(),e.controlInput.focus()}}))}var l,i,a;e.disposeAutocomplete=function(){a&&(a.dispose(),a=void 0)},e.disposeContextMenu=function(){document.removeEventListener("click",e.disposeContextMenu),l=e.style.contextMenuZIndex,e.disposeAutocomplete(),e.contextMenu&&e.contextMenu.dispose(),e.contextMenu=void 0},e.contextmenuEvent=function(t,r){function l(){requestAnimationFrame(function(){document.addEventListener("click",e.disposeContextMenu),document.removeEventListener("mouseup",l)})}if(e.hasFocus||t.target===e.canvas){var i,a=[],s=r||e.getLayerPos(t),c={NativeEvent:t,cell:e.getCellAt(s.x,s.y),items:a};c.cell.isGrid||n(c),e.dispatchEvent("contextmenu",c)||c.cell.isGrid||(e.contextMenu&&e.disposeContextMenu(),i={left:s.x+s.rect.left+e.style.contextMenuMarginLeft+e.canvasOffsetLeft,top:s.y+s.rect.top+e.style.contextMenuMarginTop+e.canvasOffsetTop,right:c.cell.width+c.cell.x+s.rect.left,bottom:c.cell.height+c.cell.y+s.rect.top,height:c.cell.height,width:c.cell.width},e.mobile&&(i.left=e.style.mobileContextMenuMargin+"px",i.width=e.width-2*e.style.mobileContextMenuMargin+"px"),e.contextMenu=o(c,i,a),document.addEventListener("mouseup",l),t.preventDefault())}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.getClippingRect=function(t){var o=e.position(e.parentNode),r=e.position(t),n=e.scrollOffset(e.canvas),l={x:0,y:0,h:0,w:0},i={x:-1/0,y:-1/0,h:1/0,w:1/0},a=e.getColumnHeaderCellHeight(),s=e.getRowHeaderCellWidth();return o.top-=n.top,o.left-=n.left,r.top-=n.top,r.left-=n.left,l.h=o.top+o.height-t.offsetTop-e.style.scrollBarWidth,l.w=o.left+o.width-t.offsetLeft-e.style.scrollBarWidth,l.x=o.left+-1*r.left+s,l.y=o.top+-1*r.top+a,{x:l.x>i.x?l.x:i.x,y:l.y>i.y?l.y:i.y,h:l.he.data.length-1&&(l=0),e.scrollIntoView(r,l),e.beginEditAt(r,l,o)}}),e.dispatchEvent("beginedit",{cell:c,input:e.input}))}}},e.createInlineStyle=function(t,o){var r={"canvas-datagrid-context-menu-filter-input":{height:"19px",verticalAlign:"bottom",marginLeft:"2px",padding:"0",background:e.style.contextFilterInputBackground,color:e.style.contextFilterInputColor,border:e.style.contextFilterInputBorder,borderRadius:e.style.contextFilterInputBorderRadius,lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextFilterInputFontFamily,fontSize:e.style.contextFilterInputFontSize},"canvas-datagrid-context-menu-filter-button":{height:"19px",verticalAlign:"bottom",marginLeft:"2px",padding:"0",background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextFilterButtonBorder,borderRadius:e.style.contextFilterButtonBorderRadius,lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFilterButtonFontFamily,fontSize:e.style.contextMenuFilterButtonFontSize},"canvas-datagrid-context-child-arrow":{cssFloat:"right",color:e.style.childContextMenuArrowColor,fontSize:e.style.contextMenuChildArrowFontSize,fontFamily:e.style.contextMenuFontFamily,verticalAlign:"middle"},"canvas-datagrid-autocomplete":{fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,position:"absolute",zIndex:9999,overflow:"hidden"},"canvas-datagrid-autocomplete-item":{background:e.style.contextMenuBackground,color:e.style.contextMenuColor},"canvas-datagrid-autocomplete-item:hover":{background:e.style.contextMenuHoverBackground,color:e.style.contextMenuHoverColor},"canvas-datagrid-canvas":{position:"absolute",zIndex:"-1"},"canvas-datagrid":{display:"block"},"canvas-datagrid-control-input":{position:"fixed",top:"-5px",left:"-5px",border:"none",opacity:"0",cursor:"pointer",width:"1px",height:"1px",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize},"canvas-datagrid-edit-mobile-input":{boxSizing:"content-box",outline:"none",margin:"0",padding:"0 0 0 0",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.mobileEditFontFamily,fontSize:e.style.mobileEditFontSize,border:e.style.editCellBorder,color:e.style.editCellColor,background:e.style.editCellBackgroundColor,appearance:"none",webkitAppearance:"none",mozAppearance:"none",borderRadius:"0"},"canvas-datagrid-edit-input":{boxSizing:"content-box",outline:"none",margin:"0",padding:"0 0 0 "+e.style.editCellPaddingLeft+"px",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.editCellFontFamily,fontSize:e.style.editCellFontSize,boxShadow:e.style.editCellBoxShadow,border:e.style.editCellBorder,color:e.style.editCellColor,background:e.style.editCellBackgroundColor,appearance:"none",webkitAppearance:"none",mozAppearance:"none",borderRadius:"0"},"canvas-datagrid-context-menu-item-mobile":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-context-menu-item":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-context-menu-item:hover":{background:e.style.contextMenuHoverBackground,color:e.style.contextMenuHoverColor},"canvas-datagrid-context-menu-label":{margin:e.style.contextMenuLabelMargin,display:e.style.contextMenuLabelDisplay,minWidth:e.style.contextMenuLabelMinWidth,maxWidth:e.style.contextMenuLabelMaxWidth},"canvas-datagrid-context-menu-mobile":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,overflow:"hidden",whiteSpace:"nowrap"},"canvas-datagrid-context-menu":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,overflow:"hidden",whiteSpace:"nowrap",cursor:e.style.contextMenuCursor},"canvas-datagrid-invalid-search-regExp":{background:e.style.contextMenuFilterInvalidExpresion}};r[o]&&Object.keys(r[o]).map(function(e){t.style[e]=r[o][e]})},e.appendTo=function(t){e.parentNode=t,e.setDom()},e.setDom=function(){e.isChildGrid?(e.parentGrid=e.parentNode.parentGrid,e.ctx=e.parentGrid.context,e.canvas=e.parentGrid.canvas,e.controlInput=e.parentGrid.controlInput,e.eventParent=e.canvas):(e.controlInput=e.controlInput||document.createElement("input"),e.controlInput.onblur=e.intf.blur,e.createInlineStyle(e.controlInput,"canvas-datagrid-control-input"),e.isChildGrid=!1,e.parentDOMNode=e.parentNode,e.parentIsCanvas=/^canvas$/i.test(e.parentDOMNode.tagName),e.parentIsCanvas?e.canvas=e.parentDOMNode:(e.canvas=document.createElement("canvas"),e.intf.createShadowRoot&&e.parentDOMNode.appendChild(e.canvas)),document.body.appendChild(e.controlInput),e.createInlineStyle(e.canvas,"canvas-datagrid"),e.ctx=e.canvas.getContext("2d"),e.ctx.textBaseline="alphabetic",e.eventParent=e.canvas),e.parentNodeStyle=e.canvas.style,e.controlInput.setAttribute("readonly",!0),e.controlInput.addEventListener("blur",function(t){t.target!==e.canvas&&(e.hasFocus=!1)}),e.eventParent.addEventListener("scroll",e.resize,!1),e.eventParent.addEventListener("touchstart",e.touchstart,!1),e.eventParent.addEventListener("mouseup",e.mouseup,!1),e.eventParent.addEventListener("mousedown",e.mousedown,!1),e.eventParent.addEventListener("dblclick",e.dblclick,!1),e.eventParent.addEventListener("click",e.click,!1),e.eventParent.addEventListener("mousemove",e.mousemove),e[e.isChildGrid?"parentGrid":"eventParent"].addEventListener("wheel",e.scrollWheel,!1),e.canvas.addEventListener("contextmenu",e.contextmenuEvent,!1),e.controlInput.addEventListener("copy",e.copy),e.controlInput.addEventListener("cut",e.cut),e.controlInput.addEventListener("paste",e.paste),e.controlInput.addEventListener("keypress",e.keypress,!1),e.controlInput.addEventListener("keyup",e.keyup,!1),e.controlInput.addEventListener("keydown",e.keydown,!1),window.addEventListener("resize",e.resize)}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.integerToAlpha=function(e){for(var t="a".charCodeAt(0),o="z".charCodeAt(0),r=o-t+1,n="";e>=0;)n=String.fromCharCode(e%r+t)+n,e=Math.floor(e/r)-1;return n},e.insertColumn=function(t,o){var r=e.getSchema();if(r.length0&&r.y>0&&r.x+r.widths;s+=1)l(s)}o||r||(e.selections=[],e.activeCell.columnIndex=t,e.activeCell.rowIndex=e.scrollIndexTop),o&&e.isColumnSelected(t)?function(t){e.data.forEach(function(o,r){e.selections[r]=e.selections[r]||[],-1!==e.selections[r].indexOf(t)&&e.selections[r].splice(e.selections[r].indexOf(t),1)})}(t):l(t),n||e.dispatchEvent("selectionchanged",{selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.getSelectionBounds()})},e.selectRow=function(t,o,r,n){function l(){n||e.dispatchEvent("selectionchanged",{selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.selectionBounds})}function i(t){e.selections[t]=[],e.selections[t].push(-1),d.forEach(function(o,r){e.selections[t].push(e.orders.columns.indexOf(o.index))})}var a,s,c,d=e.getVisibleSchema();if((!1===e.dragAddToSelection||void 0===e.dragObject)&&e.selections[t]&&e.selections[t].length-1===d.length&&o)return e.selections[t]=[],void l();if(!0===e.dragAddToSelection||void 0===e.dragObject)if(r&&void 0===e.dragObject){if(!e.activeCell)return;for(s=Math.min(e.activeCell.rowIndex,t),c=Math.max(e.activeCell.rowIndex,t),a=s;c>=a;a+=1)i(a)}else i(t);l()},e.collapseTree=function(t){e.dispatchEvent("collapsetree",{childGrid:e.childGrids[t],data:e.data[t],rowIndex:t}),e.openChildren[t].blur(),e.openChildren[t].dispose(),delete e.openChildren[t],delete e.sizes.trees[t],delete e.childGrids[t],e.dispatchEvent("resizerow",{cellHeight:e.style.cellHeight}),e.resize(!0),e.draw(!0)},e.expandTree=function(t){var o,r=e.args.treeGridAttributes||{},n=e.getColumnHeaderCellHeight(),l=e.sizes.columns.cornerCell||e.style.rowHeaderCellWidth,i=e.sizes.trees[t]||e.style.treeGridHeight;e.childGrids[t]||(r.debug=e.attributes.debug,r.name=e.attributes.saveAppearance?e.attributes.name+"tree"+t:void 0,r.style=r.style||e.style,r.parentNode={parentGrid:e.intf,nodeType:"canvas-datagrid-tree",offsetHeight:i,offsetWidth:e.width-l,header:{width:e.width-l},offsetLeft:l,offsetTop:n,offsetParent:e.intf.parentNode,parentNode:e.intf.parentNode,style:"tree",data:e.data[t]},o=e.createGrid(r),e.childGrids[t]=o),o=e.childGrids[t],o.visible=!0,e.dispatchEvent("expandtree",{treeGrid:o,data:e.data[t],rowIndex:t}),e.openChildren[t]=o,e.sizes.trees[t]=i,e.dispatchEvent("resizerow",{height:e.style.cellHeight}),e.resize(!0)},e.toggleTree=function(t){if(e.openChildren[t])return e.collapseTree(t);e.expandTree(t)},e.getHeaderByName=function(t){var o,r=e.getSchema();for(o=0;o0;var r,n=e.visibleCells.length;for(r=0;re.width||t.y<0||t.y>e.height)},e.moveSelection=function(t,o){var r=[];e.selections.forEach(function(e,n){r[n+o]=[],e.forEach(function(e){r[n+o].push(e+t)})}),e.selections=r},e.moveTo=function(t,o,r){var n,l=e.getSelectedData(),i=e.getVisibleSchema(),a=t.length,s=-1/0,c=1/0,d=r-1;t.forEach(function(t,r){r!==a&&0!==t.length&&(c=Math.min(e.getVisibleColumnIndexOf(o),c),s=Math.max(s,t.length),t.forEach(function(t){t=e.getVisibleColumnIndexOf(t),i[t]&&(e.data[r]||(e.data[r]={}),e.data[r][i[t].name]=null)}))}),t.forEach(function(t,r){var a;d+=1,n=e.getVisibleColumnIndexOf(o),t.forEach(function(t,o){t=e.getVisibleColumnIndexOf(t),o>0&&(n+=t-a),a=t,-1===t||!i[n]||!i[t]||e.data.length-10},e.isRowVisible=function(t){return e.visibleCells.filter(function(e){return e.rowIndex===t}).length>0},e.getVisibleCellByIndex=function(t,o){return e.visibleCells.filter(function(e){return e.columnIndex===t&&e.rowIndex===o})[0]},e.getCellAt=function(t,o,r){if(e.visibleCells){var n,l,i,a,s,c=r?e.attributes.touchScrollZone:0,d="move"===e.attributes.borderDragBehavior,u=e.visibleCells.length,h=d?e.cursorGrab:"ew-resize",f=d?e.cursorGrab:"ns-resize";if(e.visibleCells&&e.visibleCells.length){if(e.hasFocus=!0,!(o0&&t0))return e.hasFocus=!1,{dragContext:"inherit",context:"inherit"};for(l=0;lt&&s.y-e.style.cellBorderWidtho){if(/frozen-row-marker/.test(a.style))return a.dragContext=a.style,a.context="row-resize",a;if(/frozen-column-marker/.test(a.style))return a.dragContext=a.style,a.context="col-resize",a;if(/selection-handle-/.test(a.style))return a.dragContext=a.style,a.context="crosshair",a;if(/vertical-scroll-(bar|box)/.test(a.style))return a.dragContext="vertical-scroll-box",a.context="vertical-scroll-box",a.isScrollBar=!0,a.isVerticalScrollBar=!0,o>e.scrollBox.box.v.y+e.scrollBox.scrollBoxHeight?(a.dragContext="vertical-scroll-bottom",a.context="vertical-scroll-bottom"):oe.scrollBox.box.h.x+e.scrollBox.scrollBoxWidth?(a.dragContext="horizontal-scroll-right",a.context="horizontal-scroll-right"):tt?"r":r.x-.4*e.attributes.borderResizeZonet?"l":r.y+r.height-.4*e.attributes.borderResizeZoneo?"b":r.y-.4*e.attributes.borderResizeZoneo?"t":void 0}(s),i=d&&a.selectionBorder&&-1!==a.selectionBorder.indexOf(n),-1!==["l","r"].indexOf(n)&&(e.attributes.allowColumnResize||i)&&(e.attributes.allowColumnResizeFromCell&&a.isNormal||!a.isNormal||i)&&(e.attributes.allowRowHeaderResize&&(a.isRowHeader||a.isCorner)||!a.isRowHeader||!a.isCorner)){if((a.isColumnHeader||a.isCorner||e.attributes.allowColumnResizeFromCell&&a.isNormal)&&"r"===n)return a.context="ew-resize",a.dragContext="ew-resize",a;if(!a.isColumnHeader&&!a.isCorner&&i)return a.context=h,a.dragContext=n+"-move",a}if(-1!==["t","b"].indexOf(n)&&a.rowIndex>-1&&(e.attributes.allowRowResize||i)&&(e.attributes.allowRowResizeFromCell&&a.isNormal||!a.isNormal||i)&&!a.isColumnHeader){if((a.isRowHeader||a.isCorner||e.attributes.allowRowResizeFromCell&&a.isNormal)&&"b"===n)return a.context="ns-resize",a.dragContext="ns-resize",a;if(!a.isRowHeader&&!a.isCorner&&i)return a.context=f,a.dragContext=n+"-move",a}return"columnHeaderCell"===a.style?(a.context="cell",a.dragContext="column-reorder",a):"rowHeaderCell"===a.style?(e.attributes.rowGrabZoneSize+(a.y-e.style.cellBorderWidth)o.y?r:o.y,n=Math.max.apply(null,e),l=Math.min.apply(null,e),t.x=lo.x?n:o.x}),{top:t.y,left:t.x,bottom:o.y,right:o.x}},e.getSchemaFromData=function(t){return t=t||e.data,Object.keys(t[0]||{" ":""}).map(function(o,r){var n=e.getBestGuessDataType(o,t),l={name:o,title:isNaN(parseInt(o,10))?o:e.integerToAlpha(o).toUpperCase(),index:r,type:n,filter:e.filter(n)};return e.storedSettings&&e.storedSettings.visibility&&void 0!==e.storedSettings.visibility[l.name]&&(l.hidden=!e.storedSettings.visibility[l.name]),l})},e.clearChangeLog=function(){e.changes=[]},e.selectArea=function(t,o){e.selectionBounds=t||e.selectionBounds;var r,n,l,i=e.getSchema();if(o||(e.selections=[]),e.selectionBounds.top<-1||e.selectionBounds.bottom>e.data.length||e.selectionBounds.left<-1||e.selectionBounds.right>i.length)throw new Error("Impossible selection area");for(n=e.selectionBounds.top;n<=e.selectionBounds.bottom;n+=1)for(e.selections[n]=[],l=e.selectionBounds.left;l<=e.selectionBounds.right;l+=1)-1===e.selections[n].indexOf(l)&&e.selections[n].push(l);r={selections:e.selections,selectionBounds:e.selectionBounds},Object.defineProperty(r,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",r)},e.findColumnMaxTextLength=function(t){var o=-1/0;return"cornerCell"===t?(e.ctx.font=e.style.rowHeaderCellFont,e.ctx.measureText((e.data.length+(e.attributes.showNewRow?1:0)).toString()).width+e.style.autosizePadding+e.style.autosizeHeaderCellPadding+e.style.rowHeaderCellPaddingRight+e.style.rowHeaderCellPaddingLeft+(e.attributes.tree?e.style.treeArrowWidth+e.style.treeArrowMarginLeft+e.style.treeArrowMarginRight:0)):(e.getSchema().forEach(function(r){if(r.name===t){e.ctx.font=e.style.columnHeaderCellFont;var n=e.ctx.measureText(r.title||r.name).width+e.style.headerCellPaddingRight+e.style.headerCellPaddingLeft;o=n>o?n:o}}),e.data.forEach(function(r){e.ctx.font=e.style.cellFont;var n=e.ctx.measureText(r[t]).width+e.style.cellPaddingRight+e.style.cellPaddingLeft+e.style.cellAutoResizePadding;o=n>o?n:o}),o)},e.getHeaderWidth=function(){return e.getVisibleSchema().reduce(function(t,o){return t+(o.width||e.style.cellWidth)},0)},e.getRowHeight=function(t){return(e.sizes.rows[t]||e.style.cellHeight)*e.scale},e.getColummnWidth=function(t){return(e.sizes.columns[t]||e.getSchema()[t].width||e.style.cellWidth)*e.scale},e.formatters.string=function(e){return void 0!==e.cell.value?e.cell.value:""},e.formatters.rowHeaderCell=e.formatters.string,e.formatters.headerCell=e.formatters.string,e.formatters.number=e.formatters.string,e.formatters.int=e.formatters.string,e.formatters.html=e.formatters.string,e.sorters.string=function(e,t){var o="asc"===t;return function(t,r){return void 0===t[e]||null===t[e]?1:void 0===r[e]||null===r[e]?0:o?t[e].localeCompare?t[e].localeCompare(r[e]):1:r[e].localeCompare?r[e].localeCompare(t[e]):1}},e.sorters.number=function(e,t){var o="asc"===t;return function(t,r){return o?t[e]-r[e]:r[e]-t[e]}},e.sorters.date=function(e,t){var o="asc"===t;return function(t,r){return o?new Date(t[e]).getTime()-new Date(r[e]).getTime():new Date(r[e]).getTime()-new Date(t[e]).getTime()}}}}.apply(t,r))&&(e.exports=n)}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.canvasDatagrid=t():e.canvasDatagrid=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,r){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.defaults={attributes:[["allowColumnReordering",!0],["allowColumnResize",!0],["allowColumnResizeFromCell",!1],["allowFreezingRows",!1],["allowFreezingColumns",!1],["allowMovingSelection",!0],["allowRowHeaderResize",!0],["allowRowReordering",!1],["allowRowResize",!0],["allowRowResizeFromCell",!1],["allowSorting",!0],["autoGenerateSchema",!1],["autoResizeColumns",!1],["borderDragBehavior","none"],["borderResizeZone",10],["clearSettingsOptionText","Clear saved settings"],["columnHeaderClickBehavior","sort"],["columnSelectorHiddenText","   "],["columnSelectorText","Add/Remove columns"],["columnSelectorVisibleText","✓"],["contextHoverScrollAmount",2],["contextHoverScrollRateMs",5],["copyHeadersOnSelectAll",!0],["copyText","Copy"],["debug",!1],["editable",!0],["ellipsisText","..."],["filterOptionText","Filter %s"],["filterTextPrefix","(filtered) "],["globalRowResize",!1],["hideColumnText","Hide %s"],["maxAutoCompleteItems",200],["multiLine",!1],["name",""],["pageUpDownOverlap",1],["pasteText","Paste"],["persistantSelectionMode",!1],["removeFilterOptionText","Remove filter on %s"],["reorderDeadZone",3],["resizeScrollZone",20],["rowGrabZoneSize",5],["saveAppearance",!0],["scrollAnimationPPSThreshold",.75],["scrollPointerLock",!1],["scrollRepeatRate",75],["selectionFollowsActiveCell",!1],["selectionHandleBehavior","none"],["selectionMode","cell"],["selectionScrollIncrement",20],["selectionScrollZone",20],["showClearSettingsOption",!0],["showColumnHeaders",!0],["showColumnSelector",!0],["showCopy",!1],["showFilter",!0],["showNewRow",!1],["showOrderByOption",!0],["showOrderByOptionTextAsc","Order by %s ascending"],["showOrderByOptionTextDesc","Order by %s descending"],["showPaste",!1],["showPerformance",!1],["showRowHeaders",!0],["showRowNumbers",!0],["snapToRow",!1],["touchContextMenuTimeMs",800],["touchDeadZone",3],["touchEasingMethod","easeOutQuad"],["touchReleaseAcceleration",1e3],["touchReleaseAnimationDurationMs",2e3],["touchScrollZone",20],["touchSelectHandleZone",20],["touchZoomSensitivity",.005],["touchZoomMin",.5],["touchZoomMax",1.75],["maxPixelRatio",2],["tree",!1],["treeHorizontalScroll",!1]],styles:[["activeCellBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellBorderColor","rgba(110, 168, 255, 1)"],["activeCellBorderWidth",1],["activeCellColor","rgba(0, 0, 0, 1)"],["activeCellFont","16px sans-serif"],["activeCellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["activeCellHorizontalAlignment","left"],["activeCellHoverColor","rgba(0, 0, 0, 1)"],["activeCellOverlayBorderColor","rgba(66, 133, 244, 1)"],["activeCellOverlayBorderWidth",1],["activeCellPaddingBottom",5],["activeCellPaddingLeft",5],["activeCellPaddingRight",5],["activeCellPaddingTop",5],["activeCellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["activeCellSelectedColor","rgba(0, 0, 0, 1)"],["activeCellVerticalAlignment","center"],["activeColumnHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeColumnHeaderCellColor","rgba(0, 0, 0, 1)"],["activeRowHeaderCellBackgroundColor","rgba(225, 225, 225, 1)"],["activeRowHeaderCellColor","rgba(0, 0, 0, 1)"],["autocompleteBottomMargin",60],["autosizeHeaderCellPadding",8],["autosizePadding",5],["cellAutoResizePadding",13],["cellBackgroundColor","rgba(255, 255, 255, 1)"],["cellBorderColor","rgba(195, 199, 202, 1)"],["cellBorderWidth",1],["cellColor","rgba(0, 0, 0, 1)"],["cellFont","16px sans-serif"],["cellGridHeight",250],["cellHeight",24],["cellHeightWithChildGrid",150],["cellHorizontalAlignment","left"],["cellHoverBackgroundColor","rgba(255, 255, 255, 1)"],["cellHoverColor","rgba(0, 0, 0, 1)"],["cellPaddingBottom",5],["cellPaddingLeft",5],["cellPaddingRight",5],["cellPaddingTop",5],["cellSelectedBackgroundColor","rgba(236, 243, 255, 1)"],["cellSelectedColor","rgba(0, 0, 0, 1)"],["cellVerticalAlignment","center"],["cellWidth",250],["cellWidthWithChildGrid",250],["cellWhiteSpace","nowrap"],["cellLineHeight",1],["cellLineSpacing",3],["childContextMenuArrowColor","rgba(43, 48, 43, 1)"],["childContextMenuArrowHTML","►"],["childContextMenuMarginLeft",-11],["childContextMenuMarginTop",-6],["columnHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellBorderWidth",1],["columnHeaderCellCapBackgroundColor","rgba(240, 240, 240, 1)"],["columnHeaderCellCapBorderColor","rgba(172, 172, 172, 1)"],["columnHeaderCellCapBorderWidth",1],["columnHeaderCellColor","rgba(50, 50, 50, 1)"],["columnHeaderCellFont","16px sans-serif"],["columnHeaderCellHeight",25],["columnHeaderCellHorizontalAlignment","left"],["columnHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["columnHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["columnHeaderCellPaddingBottom",5],["columnHeaderCellPaddingLeft",5],["columnHeaderCellPaddingRight",5],["columnHeaderCellPaddingTop",5],["columnHeaderCellVerticalAlignment","center"],["columnHeaderOrderByArrowBorderColor","rgba(195, 199, 202, 1)"],["columnHeaderOrderByArrowBorderWidth",1],["columnHeaderOrderByArrowColor","rgba(155, 155, 155, 1)"],["columnHeaderOrderByArrowHeight",8],["columnHeaderOrderByArrowMarginLeft",0],["columnHeaderOrderByArrowMarginRight",5],["columnHeaderOrderByArrowMarginTop",6],["columnHeaderOrderByArrowWidth",13],["contextFilterButtonBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterButtonBorderRadius","3px"],["contextFilterButtonHTML","▼"],["contextFilterInputBackground","rgba(255,255,255,1)"],["contextFilterInputBorder","solid 1px rgba(158, 163, 169, 1)"],["contextFilterInputBorderRadius","0"],["contextFilterInputColor","rgba(0,0,0,1)"],["contextFilterInputFontFamily","sans-serif"],["contextFilterInputFontSize","14px"],["contextFilterInvalidRegExpBackground","rgba(180, 6, 1, 1)"],["contextFilterInvalidRegExpColor","rgba(255, 255, 255, 1)"],["contextMenuArrowColor","rgba(43, 48, 43, 1)"],["contextMenuArrowDownHTML","▼"],["contextMenuArrowUpHTML","▲"],["contextMenuBackground","rgba(240, 240, 240, 1)"],["contextMenuBorder","solid 1px rgba(158, 163, 169, 1)"],["contextMenuBorderRadius","3px"],["contextMenuChildArrowFontSize","12px"],["contextMenuColor","rgba(43, 48, 43, 1)"],["contextMenuCursor","default"],["contextMenuFilterButtonFontFamily","sans-serif"],["contextMenuFilterButtonFontSize","10px"],["contextMenuFilterInvalidExpresion","rgba(237, 155, 156, 1)"],["contextMenuFontFamily","sans-serif"],["contextMenuFontSize","16px"],["contextMenuHoverBackground","rgba(182, 205, 250, 1)"],["contextMenuHoverColor","rgba(43, 48, 153, 1)"],["contextMenuItemBorderRadius","3px"],["contextMenuItemMargin","2px"],["contextMenuLabelDisplay","inline-block"],["contextMenuLabelMargin","0 3px 0 0"],["contextMenuLabelMaxWidth","700px"],["contextMenuLabelMinWidth","75px"],["contextMenuMarginLeft",3],["contextMenuMarginTop",-3],["contextMenuOpacity","0.98"],["contextMenuPadding","2px"],["contextMenuWindowMargin",30],["contextMenuZIndex",1e4],["cornerCellBackgroundColor","rgba(240, 240, 240, 1)"],["cornerCellBorderColor","rgba(202, 202, 202, 1)"],["debugBackgroundColor","rgba(0, 0, 0, .0)"],["debugColor","rgba(255, 15, 24, 1)"],["debugEntitiesColor","rgba(76, 231, 239, 1.00)"],["debugFont","11px sans-serif"],["debugPerfChartBackground","rgba(29, 25, 26, 1.00)"],["debugPerfChartTextColor","rgba(255, 255, 255, 0.8)"],["debugPerformanceColor","rgba(252, 255, 37, 1.00)"],["debugScrollHeightColor","rgba(248, 33, 103, 1.00)"],["debugScrollWidthColor","rgba(66, 255, 27, 1.00)"],["debugTouchPPSXColor","rgba(246, 102, 24, 1.00)"],["debugTouchPPSYColor","rgba(186, 0, 255, 1.00)"],["display","inline-block"],["editCellBackgroundColor","white"],["editCellBorder","solid 1px rgba(110, 168, 255, 1)"],["editCellBoxShadow","0 2px 5px rgba(0,0,0,0.4)"],["editCellColor","black"],["editCellFontFamily","sans-serif"],["editCellFontSize","16px"],["editCellPaddingLeft",4],["editCellZIndex",1e4],["frozenMarkerHoverColor","rgba(236, 243, 255, 1)"],["frozenMarkerHoverBorderColor","rgba(110, 168, 255, 1)"],["frozenMarkerActiveColor","rgba(236, 243, 255, 1)"],["frozenMarkerActiveBorderColor","rgba(110, 168, 255, 1)"],["frozenMarkerColor","rgba(222, 222, 222, 1)"],["frozenMarkerBorderColor","rgba(168, 168, 168, 1)"],["frozenMarkerBorderWidth",1],["frozenMarkerWidth",2],["gridBackgroundColor","rgba(240, 240, 240, 1)"],["gridBorderCollapse","collapse"],["gridBorderColor","rgba(202, 202, 202, 1)"],["gridBorderWidth",1],["height","auto"],["maxHeight","inherit"],["maxWidth","inherit"],["minColumnWidth",45],["minHeight","inherit"],["minRowHeight",24],["minWidth","inherit"],["mobileContextMenuMargin",10],["mobileEditInputHeight",30],["mobileEditFontFamily","sans-serif"],["mobileEditFontSize","16px"],["moveOverlayBorderWidth",1],["moveOverlayBorderColor","rgba(66, 133, 244, 1)"],["moveOverlayBorderSegments","12, 7"],["name","default"],["overflowY","auto"],["overflowX","auto"],["reorderMarkerBackgroundColor","rgba(0, 0, 0, 0.1)"],["reorderMarkerBorderColor","rgba(0, 0, 0, 0.2)"],["reorderMarkerBorderWidth",1.25],["reorderMarkerIndexBorderColor","rgba(66, 133, 244, 1)"],["reorderMarkerIndexBorderWidth",2.75],["rowHeaderCellBackgroundColor","rgba(240, 240, 240, 1)"],["rowHeaderCellBorderColor","rgba(200, 200, 200, 1)"],["rowHeaderCellBorderWidth",1],["rowHeaderCellColor","rgba(50, 50, 50, 1)"],["rowHeaderCellFont","16px sans-serif"],["rowHeaderCellHeight",25],["rowHeaderCellHorizontalAlignment","left"],["rowHeaderCellHoverBackgroundColor","rgba(235, 235, 235, 1)"],["rowHeaderCellHoverColor","rgba(0, 0, 0, 1)"],["rowHeaderCellPaddingBottom",5],["rowHeaderCellPaddingLeft",5],["rowHeaderCellPaddingRight",5],["rowHeaderCellPaddingTop",5],["rowHeaderCellSelectedBackgroundColor","rgba(217, 217, 217, 1)"],["rowHeaderCellSelectedColor","rgba(50, 50, 50, 1)"],["rowHeaderCellVerticalAlignment","center"],["rowHeaderCellWidth",57],["scrollBarActiveColor","rgba(125, 125, 125, 1)"],["scrollBarBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarBorderColor","rgba(202, 202, 202, 1)"],["scrollBarBorderWidth",.5],["scrollBarBoxBorderRadius",4.125],["scrollBarBoxColor","rgba(192, 192, 192, 1)"],["scrollBarBoxMargin",2],["scrollBarBoxMinSize",15],["scrollBarBoxWidth",8],["scrollBarCornerBackgroundColor","rgba(240, 240, 240, 1)"],["scrollBarCornerBorderColor","rgba(202, 202, 202, 1)"],["scrollBarWidth",11],["selectionHandleBorderColor","rgba(255, 255, 255, 1)"],["selectionHandleBorderWidth",1.5],["selectionHandleColor","rgba(66, 133, 244, 1)"],["selectionHandleSize",8],["selectionHandleType","square"],["selectionOverlayBorderColor","rgba(66, 133, 244, 1)"],["selectionOverlayBorderWidth",1],["treeArrowBorderColor","rgba(195, 199, 202, 1)"],["treeArrowBorderWidth",1],["treeArrowClickRadius",5],["treeArrowColor","rgba(155, 155, 155, 1)"],["treeArrowHeight",8],["treeArrowMarginLeft",0],["treeArrowMarginRight",5],["treeArrowMarginTop",6],["treeArrowWidth",13],["treeGridHeight",250],["width","auto"]]}}}.apply(t,r))&&(e.exports=n)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2),__webpack_require__(0),__webpack_require__(3),__webpack_require__(4),__webpack_require__(5),__webpack_require__(6),__webpack_require__(7),__webpack_require__(8),__webpack_require__(9)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function context(component){"use strict";function Grid(args){args=args||{};var self={};return self.isComponent=void 0===args.component,self.isChildGrid=args.parentNode&&/canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType),self.isChildGrid?self.intf={}:self.intf=self.isComponent?eval("Reflect.construct(HTMLElement, [], new.target)"):document.createElement("canvas"),self.args=args,self.intf.args=args,self.applyComponentStyle=component.applyComponentStyle,self.hyphenateProperty=component.hyphenateProperty,self.dehyphenateProperty=component.dehyphenateProperty,self.createGrid=function(e){return e.component=!1,new Grid(e)},modules.forEach(function(e){e(self)}),self.isChildGrid?(self.shadowRoot=args.parentNode.shadowRoot,self.parentNode=args.parentNode):self.intf.createShadowRoot?(self.shadowRoot=self.intf.attachShadow({mode:"open"}),self.parentNode=self.shadowRoot):self.parentNode=self.intf,self.init(),self.intf}component=component();var modules=Array.prototype.slice.call(arguments);return window.HTMLElement&&(Grid.prototype=Object.create(window.HTMLElement.prototype)),window.customElements&&(Grid.observedAttributes=component.getObservableAttributes(),Grid.prototype.disconnectedCallback=component.disconnectedCallback,Grid.prototype.attributeChangedCallback=component.attributeChangedCallback,Grid.prototype.connectedCallback=component.connectedCallback,Grid.prototype.adoptedCallback=component.adoptedCallback,window.customElements.define("canvas-datagrid",Grid)),!window||window.canvasDatagrid||window.require||(window.canvasDatagrid=function(e){return new Grid(e)}),module.exports=function(e){e=e||{};var t,o=["style","formatters","sorters","filters","treeGridAttributes","cellGridAttributes","data","schema"];return window.customElements&&document.body.createShadowRoot?(t=document.createElement("canvas-datagrid"),Object.keys(e).forEach(function(r){if("data"!==r&&"parentNode"!==r)return-1!==o.indexOf(r)?void o.forEach(function(o){void 0!==e[o]&&o===r&&(-1!==["formatters","sorters","filters"].indexOf(r)?"object"==typeof e[o]&&null!==e[o]&&Object.keys(e[o]).forEach(function(r){t[o][r]=e[o][r]}):t[o]=e[o])}):void(t.attributes[r]=e[r])}),e.data&&(t.data=e.data),e.parentNode&&e.parentNode.appendChild(t),t):(e.component=!1,t=new Grid(e),e.parentNode&&e.parentNode.appendChild&&e.parentNode.appendChild(t),t)},module.exports}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(0)],void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(defaults){"use strict";return function(){function getDefaultItem(e,t){var o={};return defaults(o),o.defaults[e].filter(function(e){return e[0].toLowerCase()===t.toLowerCase()||component.hyphenateProperty(e[0])===t.toLowerCase()||component.hyphenateProperty(e[0],!0)===t.toLowerCase()})[0]}var typeMap,component={};return component.dehyphenateProperty=function(e){e=e.replace("--cdg-","");var t,o="";return Array.prototype.forEach.call(e,function(e){return t?(t=!1,void(o+=e.toUpperCase())):"-"===e?void(t=!0):void(o+=e)}),o},component.hyphenateProperty=function(e,t){var o="";return Array.prototype.forEach.call(e,function(e){if(e===e.toUpperCase())return void(o+="-"+e.toLowerCase());o+=e}),(t?"--cdg-":"")+o},component.applyComponentStyle=function(e,t){if(t.isComponent){var o=window.getComputedStyle("CANVAS-DATAGRID"===t.tagName?t:t.canvas,null),r={};t.computedStyle=o,defaults(r),r=r.defaults.styles,r.forEach(function(e){var r;r=o.getPropertyValue(component.hyphenateProperty(e[0],!0)),""===r&&(r=o.getPropertyValue(component.hyphenateProperty(e[0],!1))),""!==r&&"string"==typeof r&&t.setStyleProperty(e[0],typeMap[typeof e[1]](r.replace(/^\s+/,"").replace(/\s+$/,""),e[1]),!0)}),!e&&t.dispatchEvent&&(requestAnimationFrame(function(){t.resize(!0)}),t.dispatchEvent("stylechanged",t.style))}},typeMap={data:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid data.")}},schema:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Cannot read JSON data in canvas-datagrid schema attribute.")}},number:function(e,t){var o=parseInt(e,10);return isNaN(o)?t:o},boolean:function(e){return/true/i.test(e)},string:function(e){return e}},component.getObservableAttributes=function(){var e={},t=["data","schema","style","className","name"];return defaults(e),e.defaults.attributes.forEach(function(e){t.push(e[0].toLowerCase())}),t},component.disconnectedCallback=function(){this.connected=!1},component.connectedCallback=function(){var e=this;e.parentDOMNode.innerHTML="",e.parentDOMNode.appendChild(e.canvas),e.connected=!0,component.observe(e),component.applyComponentStyle(!0,e),e.resize(!0)},component.adoptedCallback=function(){this.resize()},component.attributeChangedCallback=function(attrName,oldVal,newVal){var tfn,intf=this,def;if("style"===attrName)return void component.applyComponentStyle(!1,intf);if("data"===attrName)return"application/x-canvas-datagrid"===intf.dataType&&(intf.dataType="application/json+x-canvas-datagrid"),void(intf.args.data=newVal);if("schema"===attrName)return void(intf.args.schema=typeMap.schema(newVal));if("name"===attrName)return void(intf.name=newVal);if("class"!==attrName&&"className"!==attrName){if(def=getDefaultItem("attributes",attrName))return tfn=typeMap[typeof def[1]],void(intf.attributes[def[0]]=tfn(newVal));/^on/.test(attrName)&&intf.addEventListener("on"+attrName,function(e){eval(newVal)})}},component.observe=function(e){var t;window.MutationObserver&&(e.applyComponentStyle=function(){component.applyComponentStyle(!1,e),e.resize()},t=new window.MutationObserver(function(t){var o,r;Array.prototype.forEach.call(t,function(e){return"class"===e.attributeName||"style"===e.attributeName?void(r=!0):e.target.parentNode&&"STYLE"===e.target.parentNode.nodeName?void(r=!0):void((e.addedNodes.length>0||"characterData"===e.type)&&(o=!0))}),r&&e.applyComponentStyle(!1,e),o&&("application/x-canvas-datagrid"===e.dataType&&(e.dataType="application/json+x-canvas-datagrid"),e.data=e.innerHTML)}),t.observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0}),Array.prototype.forEach.call(document.querySelectorAll("style"),function(e){t.observe(e,{characterData:!0,childList:!0,attributes:!0,subtree:!0})}))},component}}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(e,t,o,r){o=o||1;var n,l=[];for(n=e;n<=t;n+=o)l[n]=void 0===r?n:"function"==typeof r?r(n):r;return l}function o(t,o,r,n,l,i,a,s,c){var d=t/l.length,u=o/a;r+=e.canvasOffsetLeft,n+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.moveTo(r,n+o),l.forEach(function(t){var l,a,s=void 0===i?t:t[i];c&&(s=Math.abs(s)),l=r+d,a=n+o-s*u,e.ctx.lineTo(l,a),r+=d}),e.ctx.moveTo(r+t,n+o),e.ctx.strokeStyle=s,e.ctx.stroke()}function r(){var t=!0;Object.keys(e.htmlImageCache).forEach(function(o){e.htmlImageCache[o].complete||(t=!1)}),t&&!C&&(C=!0,e.draw())}function n(t){var o,n=t.innerHTML||t.formattedValue,l=n.toString()+t.rowIndex.toString()+t.columnIndex.toString(),i=t.x+e.canvasOffsetLeft,a=t.y+e.canvasOffsetTop;if(e.htmlImageCache[l]){if(o=e.htmlImageCache[l],o.height===t.height&&o.width===t.width){if(!o.complete)return;return e.ctx.drawImage(o,i,a)}e.htmlImageCache[l]=void 0}else C=!1;o=new Image(t.width,t.height),e.htmlImageCache[l]=o,o.onload=function(){e.ctx.drawImage(o,i,a),r()},o.src="data:image/svg+xml;base64,"+btoa('\n\n\n'+n+"\n\n\n")}function l(t,o){var r=e.style.columnHeaderOrderByArrowMarginTop*e.scale,n=e.style.columnHeaderOrderByArrowMarginLeft*e.scale,l=e.style.columnHeaderOrderByArrowMarginRight*e.scale,i=e.style.columnHeaderOrderByArrowWidth*e.scale,a=e.style.columnHeaderOrderByArrowHeight*e.scale;return t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.fillStyle=e.style.columnHeaderOrderByArrowColor,e.ctx.strokeStyle=e.style.columnHeaderOrderByArrowBorderColor,e.ctx.beginPath(),t+=n,o+=r,"asc"===e.orderDirection?(e.ctx.moveTo(t,o),e.ctx.lineTo(t+i,o),e.ctx.lineTo(t+.5*i,o+a),e.ctx.moveTo(t,o)):(e.ctx.lineTo(t,o+a),e.ctx.lineTo(t+i,o+a),e.ctx.lineTo(t+.5*i,o),e.ctx.lineTo(t,o+a)),e.ctx.stroke(),e.ctx.fill(),n+i+l}function i(t,o,r){var n=e.style.treeArrowMarginTop*e.scale,l=e.style.treeArrowMarginRight*e.scale,i=e.style.treeArrowMarginLeft*e.scale,a=e.style.treeArrowWidth*e.scale,s=e.style.treeArrowHeight*e.scale;return o+=e.canvasOffsetLeft,r+=e.canvasOffsetTop,e.ctx.fillStyle=e.style.treeArrowColor,e.ctx.strokeStyle=e.style.treeArrowBorderColor,e.ctx.beginPath(),o+=i,r+=n,e.openChildren[t.rowIndex]?(e.ctx.moveTo(o,r),e.ctx.lineTo(o+a,r),e.ctx.lineTo(o+.5*a,r+s),e.ctx.moveTo(o,r)):(e.ctx.lineTo(o,r),e.ctx.lineTo(o+s,r+.5*a),e.ctx.lineTo(o,r+a),e.ctx.lineTo(o,r)),e.ctx.stroke(),e.ctx.fill(),i+a+l}function a(t,o,r,n,l){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop;var i=t+r,a=o+n;e.ctx.beginPath(),e.ctx.moveTo(t+l,o),e.ctx.lineTo(i-l,o),e.ctx.quadraticCurveTo(i,o,i,o+l),e.ctx.lineTo(i,o+n-l),e.ctx.quadraticCurveTo(i,a,i-l,a),e.ctx.lineTo(t+l,a),e.ctx.quadraticCurveTo(t,a,t,a-l),e.ctx.lineTo(t,o+l),e.ctx.quadraticCurveTo(t,o,t+l,o)}function s(t,o,r,n){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.fillRect(t,o,r,n)}function c(t,o,r,n){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.strokeRect(t,o,r,n)}function d(t,o,r){o+=e.canvasOffsetLeft,r+=e.canvasOffsetTop,e.ctx.fillText(t,o,r)}function u(t,o,r){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.arc(t,o,r,0,2*Math.PI),e.ctx.fill()}function h(t,o,r){t+=e.canvasOffsetLeft,o+=e.canvasOffsetTop,e.ctx.beginPath(),e.ctx.arc(t,o,r,0,2*Math.PI),e.ctx.stroke()}function f(t){e.ctx.beginPath(),0===t&&(e.ctx.moveTo(e.lastFrozenColumnPixel,e.lastFrozenRowPixel),e.ctx.lineTo(e.lastFrozenColumnPixel,e.height),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.width,e.lastFrozenRowPixel)),1===t&&(e.ctx.moveTo(0,e.lastFrozenRowPixel),e.ctx.lineTo(0,e.height),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.width,e.lastFrozenRowPixel)),2===t&&(e.ctx.moveTo(e.lastFrozenColumnPixel,0),e.ctx.lineTo(e.width,0),e.ctx.lineTo(e.width,e.height),e.ctx.lineTo(e.lastFrozenColumnPixel,e.height)),e.ctx.clip()}function g(t,o,r){if("circle"===e.style.selectionHandleType)return u(t,o,.5*r);s(t-.5*r,o-.5*r,r,r)}function m(t,o,r){if("circle"===e.style.selectionHandleType)return h(t,o,.5*r);c(t-.5*r,o-.5*r,r,r)}function x(t,o){var r=e.style.selectionHandleSize;({tr:function(){g(t.x+t.width,t.y,r),m(t.x+t.width,t.y,r)},br:function(){g(t.x+t.width,t.y+t.height,r),m(t.x+t.width,t.y+t.height,r)},tl:function(){g(t.x,t.y,r),m(t.x,t.y,r)},bl:function(){g(t.x,t.y+t.height,r),m(t.x,t.y+t.height,r)}})[o]()}function p(t,o){e.ctx.beginPath(),{t:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop)},r:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop+t.height)},b:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop+t.height),e.ctx.lineTo(t.x+e.canvasOffsetLeft+t.width,t.y+e.canvasOffsetTop+t.height)},l:function(){e.ctx.moveTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop),e.ctx.lineTo(t.x+e.canvasOffsetLeft,t.y+e.canvasOffsetTop+t.height)}}[o](),e.ctx.stroke()}function y(t,o){if(!t.formattedValue)return{lines:[{width:0,value:""}],width:0,height:t.calculatedLineHeight};var r,n,l,i,a,s,c=t.formattedValue.split(o),d=t.calculatedLineHeight,u=[],h="nowrap"!==e.style.cellWhiteSpace,f=e.attributes.ellipsisText,g={width:0,value:""},m=h?t.paddedHeight:t.calculatedLineHeight;for(u.push(g),l=e.ctx.measureText(" "+f).width,r=0;rm){if(0===u.length)break;if(1,s=u[u.length-1],s.widtht.paddedWidth)for(var y=parseInt(a.length/2),v=-1;y>0;)a=p.substr(0,y*v+a.length),i=e.ctx.measureText(a+f).width,v=i>t.paddedWidth?-1:1,y=parseInt(y/2);a+=p.length!=a.length?f:"",s.value=a,s.width=i;break}r>0&&u.push(g)}}return{lines:u,width:0,height:t.calculatedLineHeight*u.length}}function v(t){var o,r,n=(t.text.lines.length,t.fontHeight*t.lineHeight),l="nowrap"!==e.style.cellWhiteSpace,i=0;for(o=0;oN)return!1;if(V=K[t],L=e.openChildren[t],l=(e.sizes.rows[t]||e.style.cellHeight)*e.scale,n=(L?e.sizes.trees[t]:0)*e.scale,R=l+n,D<-R)return!1;for(e.attributes.showRowHeaders&&(W+=te),oe=R,i=e.scrollIndexLeft;ie.width){e.scrollIndexRight=i,e.scrollPixelRight=W;break}for(W=0,e.attributes.showRowHeaders&&(W+=te),i=0;ie.width));i+=1);return e.lastFrozenColumnPixel=W,oe=R,W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,k=e.childGrids[t],t!==K.length&&L?(k.visible=!0,k.parentNode={offsetTop:D+l+e.canvasOffsetTop,offsetLeft:te-1+e.canvasOffsetLeft,offsetHeight:n,offsetWidth:e.width-te-e.style.scrollBarWidth-1,offsetParent:e.intf.parentNode,parentNode:e.intf.parentNode,style:e.style,nodeType:"canvas-datagrid-tree",scrollTop:e.scrollBox.scrollTop,scrollLeft:e.scrollBox.scrollLeft,rowIndex:t},e.visibleCells.unshift({rowIndex:t,columnIndex:0,y:k.parentNode.offsetTop,x:k.parentNode.offsetLeft,height:k.height,width:k.width,style:"tree-grid",type:k.parentNode.nodeType}),k.draw()):k&&(k.parentNode.offsetHeight=0,delete e.sizes.trees[t]),J.push([V,t,o,D,R]),e.visibleRowHeights[t]=R,D+=oe+(q?0:e.style.cellBorderWidth),!0}if(!e.dispatchEvent("beforedraw",{})&&(e.isChildGrid||e.height&&e.width)){if(e.isChildGrid&&r)return void requestAnimationFrame(e.parentGrid.draw);if(!1!==e.intf.visible){var M,z,P,H,O,k,L,R,A,D,W,F,N,j,_,G,V,Z,K=e.data||[],q="collapse"===e.style.gridBorderCollapse,Y=[],U=[],X=[],J=[],Q=K.length,$=e.currentCell||{},ee=e.getColumnHeaderCellHeight(),te=e.getRowHeaderCellWidth(),oe=e.style.cellHeight;B+=1,P=performance.now(),e.visibleRowHeights=[],K.length>e.orders.rows.length&&e.createRowOrders(),e.ctx.save(),function(){e.visibleRows=[],_=e.getSchema(),e.visibleCells=[],e.canvasOffsetTop=e.isChildGrid?e.parentNode.offsetTop:0,e.canvasOffsetLeft=e.isChildGrid?e.parentNode.offsetLeft:0,N=e.height,j=e.width}(),function(){a(0,0,j,N,0),e.ctx.clip(),e.ctx.fillStyle=e.style.gridBackgroundColor,s(0,0,j,N)}(),function(){var t,o=Math.min(K.length,e.frozenRow);for(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,D=ee,G=0;G0&&(a(0,e.lastFrozenRowPixel,e.width,e.height-e.lastFrozenRowPixel,0),e.ctx.clip());var t,o,r,n=_.length;for(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.cellBorderWidth,e.attributes.snapToRow||(D+=-e.scrollBox.scrollTop+e.scrollPixelTop+e.style.cellBorderWidth),G=e.frozenRow+e.scrollIndexTop;Ge.width+e.scrollBox.scrollLeft));t+=1);J.push([e.newRow,K.length,K.length,D,R])}e.ctx.restore()}(),function(){if(Z){e.ctx.save();var t=e.activeCell.columnIndex+1>e.frozenColumn||e.activeCell.rowIndex+1>e.frozenRow;a(t?e.lastFrozenColumnPixel:0,t?e.lastFrozenRowPixel:0,t?e.width-e.lastFrozenColumnPixel:e.width,t?e.height-e.lastFrozenRowPixel:e.height,0),e.ctx.clip(),"row"===e.attributes.selectionMode?e.activeCell&&e.activeCell.rowIndex===Z.rowIndex&&(e.ctx.lineWidth=e.style.activeCellOverlayBorderWidth,e.ctx.strokeStyle=e.style.activeCellOverlayBorderColor,c(0,Z.y,e.getHeaderWidth()+te,e.visibleRowHeights[Z.rowIndex])):(e.ctx.lineWidth=e.style.activeCellOverlayBorderWidth,e.ctx.strokeStyle=e.style.activeCellOverlayBorderColor,c(Z.x,Z.y,Z.width,Z.height)),e.ctx.restore()}}(),function(){function t(t,a){for(a=Math.min(a,c),n=t;ne.width+e.scrollBox.scrollLeft)));n+=1);}var o,r,n,l,i,s,c=_.length;J.forEach(function(t,o){D=t[3],oe=t[4],o===e.frozenRow&&(e.ctx.save(),a(0,e.lastFrozenRowPixel,e.width,e.height-e.lastFrozenRowPixel,0),e.ctx.clip()),m(t[0],t[1],t[2])}),e.ctx.restore(),e.attributes.showColumnHeaders&&(W=-e.scrollBox.scrollLeft+e.scrollPixelLeft+e.style.columnHeaderCellBorderWidth,e.attributes.showRowHeaders&&(W+=te),D=0,oe=e.getColumnHeaderCellHeight(),t(e.scrollIndexLeft,c),s=W,W=e.style.columnHeaderCellBorderWidth,e.attributes.showRowHeaders&&(W+=te),t(0,e.frozenColumn),W=s,W-1&&e.currentCell.rowIndexe.reorderObject.sortRowIndex?"b":"t")):"column-reorder"===e.dragMode&&e.reorderObject&&(t.height=N,t.y=0,o.height=N,o.width=e.currentCell.width,o.y=0,o.x=e.currentCell.x,s(t.x,t.y,t.width,t.height),c(t.x,t.y,t.width,t.height),e.ctx.lineWidth=e.style.reorderMarkerIndexBorderWidth,e.ctx.strokeStyle=e.style.reorderMarkerIndexBorderColor,e.currentCell.sortColumnIndex!==e.reorderObject.sortColumnIndex&&e.currentCell.sortColumnIndex>-1&&e.currentCell.sortColumnIndex<_.length&&p(o,e.reorderTarget.columnIndex>e.reorderObject.columnIndex?"r":"l"))}}(),function(){e.movingSelection&&(e.ctx.lineWidth=e.style.moveOverlayBorderWidth,e.ctx.strokeStyle=e.style.moveOverlayBorderColor,e.ctx.setLineDash(e.style.moveOverlayBorderSegments),U.forEach(function(e){p(e[0],e[1])}),e.ctx.setLineDash([]))}(),function(){e.ctx.lineWidth=e.style.gridBorderWidth,e.ctx.strokeStyle=e.style.gridBorderColor,c(0,0,e.width,e.height)}(),function(){function t(e){p(e[0],e[1])}e.ctx.lineWidth=e.style.selectionOverlayBorderWidth,e.ctx.strokeStyle=e.style.selectionOverlayBorderColor,Y.filter(function(t){return t[0].rowIndex=e.frozenRow&&t[0].columnIndex>=e.frozenColumn}).forEach(t),e.ctx.restore(),e.ctx.save(),f(1),Y.filter(function(t){return t[0].rowIndex>=e.frozenRow&&t[0].columnIndex=e.frozenColumn}).forEach(t),e.ctx.restore()}(),function(){var t,o=e.scrollBox.entities,r=2*e.style.scrollBarBoxMargin;e.ctx.strokeStyle=e.style.scrollBarBorderColor,e.ctx.lineWidth=e.style.scrollBarBorderWidth,o.horizontalBox.x=te+e.style.scrollBarBoxMargin+(o.horizontalBar.width-e.scrollBox.scrollBoxWidth)*(e.scrollBox.scrollLeft/e.scrollBox.scrollWidth),o.verticalBox.y=ee+e.style.scrollBarBoxMargin+(o.verticalBar.height-e.scrollBox.scrollBoxHeight)*(e.scrollBox.scrollTop/e.scrollBox.scrollHeight),e.scrollBox.horizontalBarVisible&&(e.ctx.fillStyle=e.style.scrollBarBackgroundColor,s(o.horizontalBar.x,o.horizontalBar.y,o.horizontalBar.width+r,o.horizontalBar.height),c(o.horizontalBar.x,o.horizontalBar.y,o.horizontalBar.width+r,o.horizontalBar.height),e.ctx.fillStyle=e.style.scrollBarBoxColor,e.scrollBox.horizontalBoxVisible&&(/horizontal/.test($.context)&&(e.ctx.fillStyle=e.style.scrollBarActiveColor),a(o.horizontalBox.x,o.horizontalBox.y,o.horizontalBox.width,o.horizontalBox.height,e.style.scrollBarBoxBorderRadius),e.ctx.stroke(),e.ctx.fill()),t=!0,e.visibleCells.unshift(o.horizontalBar),e.visibleCells.unshift(o.horizontalBox)),e.scrollBox.verticalBarVisible&&(e.ctx.fillStyle=e.style.scrollBarBackgroundColor,s(o.verticalBar.x,o.verticalBar.y,o.verticalBar.width,o.verticalBar.height+r),c(o.verticalBar.x,o.verticalBar.y,o.verticalBar.width,o.verticalBar.height+r),e.scrollBox.verticalBoxVisible&&(e.ctx.fillStyle=e.style.scrollBarBoxColor,/vertical/.test($.context)&&(e.ctx.fillStyle=e.style.scrollBarActiveColor),a(o.verticalBox.x,o.verticalBox.y,o.verticalBox.width,o.verticalBox.height,e.style.scrollBarBoxBorderRadius),e.ctx.stroke(),e.ctx.fill()),t=!0,e.visibleCells.unshift(o.verticalBar),e.visibleCells.unshift(o.verticalBox)),t&&(e.ctx.strokeStyle=e.style.scrollBarCornerBorderColor,e.ctx.fillStyle=e.style.scrollBarCornerBackgroundColor,a(o.corner.x,o.corner.y,o.corner.width,o.corner.height,0),e.ctx.stroke(),e.ctx.fill(),e.visibleCells.unshift(o.corner))}(),M&&e.resize(!0),function(){e.ctx.save();var o;if((e.attributes.showPerformance||e.attributes.debug)&&(0===b.length&&(b=t(0,S,1,0)),b.pop(),b.unshift(performance.now()-P)),!e.attributes.debug)return void e.ctx.restore();e.ctx.font=e.style.debugFont,o={},o.perf=(b.reduce(function(e,t){return e+t},0)/Math.min(B,b.length)).toFixed(1),o.perfDelta=b[0].toFixed(1),o.frozenColumnsWidth=w(),o.htmlImages=Object.keys(e.htmlImageCache).length,o.reorderObject="x: "+(e.reorderObject||{columnIndex:0}).columnIndex+", y: "+(e.reorderObject||{rowIndex:0}).rowIndex,o.reorderTarget="x: "+(e.reorderTarget||{columnIndex:0}).columnIndex+", y: "+(e.reorderTarget||{rowIndex:0}).rowIndex,o.scale=e.scale,o.startScale=e.startScale,o.scaleDelta=e.scaleDelta,o.zoomDeltaStart=e.zoomDeltaStart,o.touchLength=e.touchLength,o.touches="y0: "+(e.touchPosition||{y:0}).y+" y1: "+(e.touchPosition1||{y:0}).y,o.scrollBox=e.scrollBox.toString(),o.scrollIndex="x: "+e.scrollIndexLeft+", y: "+e.scrollIndexTop,o.scrollPixel="x: "+e.scrollPixelLeft+", y: "+e.scrollPixelTop,o.canvasOffset="x: "+e.canvasOffsetLeft+", y: "+e.canvasOffsetTop,o.touchDelta="x: "+e.touchDelta.x+", y: "+e.touchDelta.y,o.touchAnimateTo="x: "+e.touchAnimateTo.x+", y: "+e.touchAnimateTo.y,o.scrollAnimation="x: "+e.scrollAnimation.x+", y: "+e.scrollAnimation.y,o.touchPPS="x: "+e.xPPS+", y: "+e.yPPS,o.touchPPST="x: "+e.xPPST+", y: "+e.yPPST,o.touchDuration=e.touchDuration,o.pointerLockPosition=e.pointerLockPosition?e.pointerLockPosition.x+", "+e.pointerLockPosition.y:"",o.size="w: "+e.width+", h: "+e.height,o.mouse="x: "+e.mouse.x+", y: "+e.mouse.y,o.touch=e.touchStart?"x: "+e.touchStart.x+", y: "+e.touchStart.y:"",o.entities=e.visibleCells.length,o.hasFocus=e.hasFocus,o.dragMode=e.dragMode,e.currentCell&&(o.columnIndex=e.currentCell.columnIndex,o.rowIndex=e.currentCell.rowIndex,o.sortColumnIndex=e.currentCell.sortColumnIndex,o.sortRowIndex=e.currentCell.sortRowIndex,o.context=e.currentCell.context,o.dragContext=e.currentCell.dragContext,o.style=e.currentCell.style,o.type=e.currentCell.type),e.ctx.textAlign="right",e.ctx.fillStyle=e.style.debugBackgroundColor,s(0,0,e.width,e.height),Object.keys(o).forEach(function(t,r){var n=t+": "+o[t];e.ctx.fillStyle=e.style.debugColor,d(n,j-20,(e.attributes.showPerformance?140:24)+14*r)}),e.ctx.restore()}(),function(){function r(t,r,c,u,h,f,g){var m;o(n,a,l,i,r,c,u,h,f),e.ctx.fillStyle=h,s(3+l,i+9+11*g,8,8),e.ctx.fillStyle=e.style.debugPerfChartTextColor,m=void 0!==c?r[0][c]:r[0],d(t+" "+(isNaN(m)?0:m).toFixed(3),14+l,i+16+11*g)}if(e.attributes.showPerformance){var n=250,l=e.width-n-e.style.scrollBarWidth-2*e.style.scrollBarBorderWidth,i=ee,a=100;0===E.length&&(E=t(0,S,1,function(){return[0,0]})),0===T.length&&(T=t(0,S,1,function(){return[0,0]})),0===I.length&&(I=t(0,S,1,0)),e.ctx.lineWidth=.5,e.ctx.textAlign="left",e.ctx.font=e.style.debugFont,e.ctx.fillStyle=e.style.debugPerfChartBackground,s(l,i,n,a),[["Scroll Height",E,0,e.scrollBox.scrollHeight,e.style.debugScrollHeightColor,!1],["Scroll Width",E,1,e.scrollBox.scrollWidth,e.style.debugScrollWidthColor,!1],["Performance",b,void 0,200,e.style.debugPerformanceColor,!1],["Entities",I,void 0,1500,e.style.debugEntitiesColor,!1],["TouchPPSX",T,0,1e3,e.style.debugTouchPPSXColor,!0],["TouchPPSY",T,1,1e3,e.style.debugTouchPPSYColor,!0]].forEach(function(e,t){e.push(t),r.apply(null,e)}),e.ctx.fillStyle=e.style.debugPerfChartBackground,I.pop(),I.unshift(e.visibleCells.length),E.pop(),E.unshift([e.scrollBox.scrollTop,e.scrollBox.scrollLeft]),T.pop(),T.unshift([e.yPPS,e.xPPS])}}(),e.dispatchEvent("afterdraw",{})||e.ctx.restore()}}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){var t;e.stopPropagation=function(e){e.stopPropagation()},e.addEventListener=function(t,o){e.events[t]=e.events[t]||[],e.events[t].unshift(o)},e.removeEventListener=function(t,o){(e.events[t]||[]).forEach(function(r,n){o===r&&e.events[t].splice(n,1)})},e.dispatchEvent=function(t,o){function r(){n=!0}o=t.type?t:o||{},t=t.type||t;var n;if(e.events[t])return e.events[t].forEach(function(t){o.ctx=e.ctx,o.preventDefault=r,t.apply(e.intf,[o])}),n},e.getRatio=function(){return Math.min(e.attributes.maxPixelRatio,(window.devicePixelRatio||1)/(e.ctx.webkitBackingStorePixelRatio||e.ctx.mozBackingStorePixelRatio||e.ctx.msBackingStorePixelRatio||e.ctx.oBackingStorePixelRatio||e.ctx.backingStorePixelRatio||1))},e.resize=function(t){function o(){e.scrollBox.horizontalBarVisible="auto"!==e.style.width&&b>e.scrollBox.width&&"hidden"!==e.style.overflowX||"scroll"===e.style.overflowX,e.scrollBox.horizontalBoxVisible=b>e.scrollBox.width,e.scrollBox.verticalBarVisible="auto"!==e.style.height&&w>e.scrollBox.height&&"hidden"!==e.style.overflowY||"scroll"===e.style.overflowY,e.scrollBox.verticalBoxVisible=w>e.scrollBox.height}function r(){e.scrollBox.width=e.width-S,e.scrollBox.height=e.height-B}function n(){e.isChildGrid||(i={height:B+w+y+1,width:b+S+y},["width","height"].forEach(function(t){-1!==["auto",void 0].indexOf(e.style[t])&&-1!==["auto",void 0].indexOf(e.appliedInlineStyles[t])?e.parentNodeStyle[t]=i[t]+"px":(e.parentNodeStyle[t]=e.style[t],e.isComponet&&(e.canvas.style[t]=e.style[t]))}))}if(e.canvas){var l,i,a={x:0,y:0,height:0,width:0,style:"vertical-scroll-bar"},s={x:0,y:0,height:0,width:0,style:"horizontal-scroll-bar"},c={x:0,y:0,height:0,width:0,style:"vertical-scroll-box"},d={x:0,y:0,height:0,width:0,style:"horizontal-scroll-box"},u={x:0,y:0,height:0,width:0,isCorner:!0,isScrollBoxCorner:!0,style:"scroll-box-corner"},h=2*e.style.scrollBarBoxMargin,f=2*e.style.scrollBarBorderWidth,g=.5*e.style.scrollBarBoxMargin,m=e.style.scrollBarWidth+2*e.style.scrollBarBorderWidth,x=e.getRatio(),p="collapse"===e.style.gridBorderCollapse?1:2,y=e.style.cellBorderWidth*p,v=e.style.columnHeaderCellBorderWidth*p,w=0,b=0,C=(e.data||[]).length,B=e.getColumnHeaderCellHeight(),S=e.getRowHeaderCellWidth(),I=e.style.cellHeight,M=e.getSchema();for(e.scrollCache.x=[],e.scrollCache.y=[],l=0;ll?e.sizes.trees[l]||0:0);return C>1&&(e.scrollCache.y[l]=w),b=M.reduce(function(t,o,r){if(o=M[e.orders.columns[r]],o.hidden)return e.scrollCache.x[r]=t,t;var n=t+e.getColummnWidth(e.orders.columns[r]);return e.scrollCache.x[r]=n,n},0)||0,e.attributes.showNewRow&&(w+=I),e.attributes.snapToRow&&(w+=e.style.cellHeight),n(),e.isChildGrid?(e.width=e.parentNode.offsetWidth,e.height=e.parentNode.offsetHeight):e.height===e.canvas.offsetHeight&&e.width===e.canvas.offsetWidth||(e.height=e.canvas.offsetHeight,e.width=e.canvas.offsetWidth,e.canvasOffsetLeft=e.args.canvasOffsetLeft||0,e.canvasOffsetTop=e.args.canvasOffsetTop||0),e.scrollBox.top=B+v,e.scrollBox.left=S,r(),o(),e.scrollBox.horizontalBarVisible&&("auto"!==e.style.height||e.isChildGrid||(e.height+=m),w+=m,n(),r(),o()),e.scrollBox.verticalBarVisible&&("auto"!==e.style.width||e.isChildGrid||(e.width+=m),b+=m,n(),r(),o()),r(),e.scrollBox.scrollWidth=b-e.scrollBox.width,e.scrollBox.scrollHeight=w-e.scrollBox.height,e.scrollBox.widthBoxRatio=e.scrollBox.width/b,e.scrollBox.scrollBoxWidth=e.scrollBox.width*e.scrollBox.widthBoxRatio-e.style.scrollBarWidth-f-g,e.scrollBox.heightBoxRatio=(e.scrollBox.height-B)/w,e.scrollBox.scrollBoxHeight=e.scrollBox.height*e.scrollBox.heightBoxRatio-e.style.scrollBarWidth-f-g,e.scrollBox.scrollBoxWidth=Math.max(e.scrollBox.scrollBoxWidth,e.style.scrollBarBoxMinSize),e.scrollBox.scrollBoxHeight=Math.max(e.scrollBox.scrollBoxHeight,e.style.scrollBarBoxMinSize),s.x+=S,s.y+=e.height-e.style.scrollBarWidth-g,s.width=e.width-e.style.scrollBarWidth-S-g-h,s.height=e.style.scrollBarWidth+e.style.scrollBarBorderWidth+g,d.y=s.y+e.style.scrollBarBoxMargin,d.width=e.scrollBox.scrollBoxWidth,d.height=e.style.scrollBarBoxWidth,a.x+=e.width-e.style.scrollBarWidth-e.style.scrollBarBorderWidth-g,a.y+=B,a.width=e.style.scrollBarWidth+e.style.scrollBarBorderWidth+g,a.height=e.height-B-e.style.scrollBarWidth-g-h,c.x=a.x+e.style.scrollBarBoxMargin,c.width=e.style.scrollBarBoxWidth,c.height=e.scrollBox.scrollBoxHeight,u.x=s.x+s.width+h,u.y=a.y+a.height+h,u.width=e.style.scrollBarWidth+e.style.scrollBarBorderWidth,u.height=e.style.scrollBarWidth+e.style.scrollBarBorderWidth,e.scrollBox.entities={horizontalBar:s,horizontalBox:d,verticalBar:a,verticalBox:c,corner:u},e.scrollBox.bar={v:a,h:s},e.scrollBox.box={v:c,h:d},e.page=Math.max(1,e.visibleRows.length-3-e.attributes.pageUpDownOverlap),e.isChildGrid||(e.canvas.width=e.width*x,e.canvas.height=e.height*x,e.ctx.scale(x,x)),e.resizeEditInput(),e.scroll(!0),t&&e.draw(!0),e.dispatchEvent("resize",{}),!0}},e.scroll=function(t){var o=e.getSchema(),r=(e.data||[]).length,n=e.style.cellHeight;for(e.scrollIndexTop=Math.floor(r*(e.scrollBox.scrollTop/e.scrollBox.scrollHeight)-100),e.scrollIndexTop=Math.max(e.scrollIndexTop,0),e.scrollPixelTop=e.scrollCache.y[e.scrollIndexTop],0===e.scrollBox.scrollHeight&&(e.scrollIndexTop=0),e.scrollPixelTop=0,e.scrollIndexLeft=e.frozenColumn,e.scrollPixelLeft=0;e.scrollPixelTop0&&(e.scrollIndexLeft=Math.max(e.scrollIndexLeft-1,0),e.scrollPixelLeft-=e.getColummnWidth(e.orders.columns[e.scrollIndexLeft])),(e.data||[]).length>0&&(e.scrollIndexTop=Math.max(e.scrollIndexTop-1,0),e.scrollPixelTop=Math.max(e.scrollPixelTop-(e.data[e.scrollIndexTop]?(e.sizes.rows[e.scrollIndexTop]||n)+(e.sizes.trees[e.scrollIndexTop]||0):n)*e.scale,0)),e.ellipsisCache={},t||e.draw(!0),requestAnimationFrame(e.resizeEditInput),e.dispatchEvent("scroll",{top:e.scrollBox.scrollTop,left:e.scrollBox.scrollLeft})},e.mousemove=function(t,o){if(!e.contextMenu&&!e.input){e.mouse=o||e.getLayerPos(t);var r,n,l,i,a=t.ctrlKey||t.metaKey||e.attributes.persistantSelectionMode,s=e.getSchema(),c=e.mouse.x,d=e.mouse.y,u=e.getCellAt(c,d),h={NativeEvent:t,cell:u,x:c,y:d},f=e.currentCell;if(clearTimeout(e.scrollTimer),e.isInGrid({x:c,y:d})||(e.hasFocus=!1),!e.dispatchEvent("mousemove",h)&&(u&&e.currentCell&&(e.rowBoundaryCrossed=e.currentCell.rowIndex!==u.rowIndex,e.columnBoundaryCrossed=e.currentCell.columnIndex!==u.columnIndex,e.cellBoundaryCrossed=e.rowBoundaryCrossed||e.columnBoundaryCrossed,["row","column","cell"].forEach(function(t){e[t+"BoundaryCrossed"]&&(h.cell=f,e.dispatchEvent(t+"mouseout",h),h.cell=u,e.dispatchEvent(t+"mouseover",h))})),e.currentCell=u,e.hasFocus)){if(e.hovers={},!e.draggingItem&&u&&-1===e.scrollModes.indexOf(u.context)&&(e.dragItem=u,e.dragMode=u.dragContext,e.cursor=u.context,"cell"===u.context&&(e.cursor="default",e.hovers={rowIndex:u.rowIndex,columnIndex:u.columnIndex}),(e.selecting||e.reorderObject)&&"cell"===u.context)){if(i={x:Math.abs(e.dragStart.x-c),y:Math.abs(e.dragStart.y-d)},-1!==e.dragStartObject.columnIndex&&t.shiftKey&&(e.dragStartObject={rowIndex:e.activeCell.rowIndex,columnIndex:e.activeCell.columnIndex}),n={top:Math.min(e.dragStartObject.rowIndex,u.rowIndex),left:Math.min(e.dragStartObject.columnIndex,u.columnIndex),bottom:Math.max(e.dragStartObject.rowIndex,u.rowIndex),right:Math.max(e.dragStartObject.columnIndex,u.columnIndex)},-1===e.dragStartObject.columnIndex&&(l=e.getSelectionBounds(),n.left=-1,n.right=s.length-1,n.top=Math.min(l.top,u.rowIndex),n.bottom=Math.max(l.bottom,u.rowIndex)),e.dragStartObject.rowIndex===u.rowIndex&&e.dragStartObject.columnIndex===u.columnIndex||(e.ignoreNextClick=!0),(e.cellBoundaryCrossed||0===i.x&&0===i.y||"row"===e.attributes.selectionMode)&&("row"!==e.attributes.selectionMode&&-1!==e.dragStartObject.columnIndex||!e.rowBoundaryCrossed?"row"!==e.attributes.selectionMode&&(e.dragAddToSelection||void 0===u.rowIndex?(e.selections[u.rowIndex]=e.selections[u.rowIndex]||[],-1===e.selections[u.rowIndex].indexOf(u.columnIndex)&&e.selections[u.rowIndex].push(u.columnIndex)):e.selections[u.rowIndex]&&-1!==e.selections[u.rowIndex].indexOf(u.columnIndex)&&e.selections[u.rowIndex].splice(e.selections[u.rowIndex].indexOf(u.columnIndex),1)):e.selectRow(u.rowIndex,a,null,!0)),!(e.selectionBounds&&n.top===e.selectionBounds.top&&n.left===e.selectionBounds.left&&n.bottom===e.selectionBounds.bottom&&n.right===e.selectionBounds.right||a))if(e.selections=[],l=n,"row"===e.attributes.selectionMode)for(r=l.top;r<=l.bottom;r+=1)e.selectRow(r,!0,null,!0);else-1!==n.top&&e.selectArea(l,!0);e.autoScrollZone(t,c,d,a)}e.cellBoundaryCrossed=!1,e.rowBoundaryCrossed=!1,e.columnBoundaryCrossed=!1,e.draw(!0)}}},e.click=function(t,o){function r(){var t,o=e.getSelectionBounds();l!==JSON.stringify(o)&&(t={selections:e.selections,selectionBounds:e.getSelectionBounds()},Object.defineProperty(t,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",t))}var n,l=JSON.stringify(e.getSelectionBounds()),i=t.ctrlKey||t.metaKey||e.attributes.persistantSelectionMode,a=o||e.getLayerPos(t);if(e.currentCell=e.getCellAt(a.x,a.y),void 0===e.currentCell.grid){if(e.input&&e.endEdit(),e.ignoreNextClick)return void(e.ignoreNextClick=!1);if(n=e.currentCell,!e.dispatchEvent("click",{NativeEvent:t,cell:e.currentCell})&&e.hasFocus){if(-1!==["rowHeaderCell","columnHeaderCell"].indexOf(e.currentCell.style)||i||e.setActiveCell(n.columnIndex,n.rowIndex),"cell"===e.currentCell.context){if("cornerCell"===e.currentCell.style)return e.selectAll(),e.draw(),void r();if("columnHeaderCell"===e.currentCell.style){if("sort"===e.attributes.columnHeaderClickBehavior)return e.orderBy===n.header.name?e.orderDirection="asc"===e.orderDirection?"desc":"asc":e.orderDirection="asc",e.order(n.header.name,e.orderDirection),void r();if("select"===e.attributes.columnHeaderClickBehavior)return e.selectColumn(n.header.index,i,t.shiftKey),void e.draw()}if(e.selections[n.rowIndex]=e.selections[n.rowIndex]||[],("row"===e.attributes.selectionMode||"rowHeaderCell"===e.currentCell.style)&&"rowHeaderCell"===e.currentCell.style&&e.attributes.tree&&a.x>0&&a.x-e.currentCell.x0)return void e.toggleTree(n.rowIndex);t.shiftKey&&!i&&(e.selectionBounds=e.getSelectionBounds(),e.selectArea(void 0,!1))}r(),e.draw(!0)}}},e.dragResizeColumn=function(t){var o,r,n;return o=e.getLayerPos(t),r=e.resizingStartingWidth+o.x-e.dragStart.x,n=e.resizingStartingHeight+o.y-e.dragStart.y,re.scrollBox.scrollWidth-e.attributes.resizeScrollZone&&"ew-resize"===e.dragMode&&(e.resize(!0),e.scrollBox.scrollLeft+=r),"ew-resize"===e.dragMode?(e.sizes.columns["rowHeaderCell"===e.draggingItem.header.style?"cornerCell":e.draggingItem.sortColumnIndex]=r,-1!==["rowHeaderCell","cornerCell"].indexOf(e.draggingItem.header.style)&&e.resize(!0),void e.resizeChildGrids()):"ns-resize"===e.dragMode?(e.draggingItem.rowOpen?e.sizes.trees[e.draggingItem.rowIndex]=n:e.attributes.globalRowResize?e.style.cellHeight=n:e.sizes.rows[e.draggingItem.rowIndex]=n,e.dispatchEvent("resizerow",{row:n}),void e.resizeChildGrids()):void(e.ellipsisCache={}))},e.stopDragResize=function(){e.resize(),document.body.removeEventListener("mousemove",e.dragResizeColumn,!1),document.body.removeEventListener("mouseup",e.stopDragResize,!1),e.setStorageData(),e.draw(!0),e.ignoreNextClick=!0},e.scrollGrid=function(t){var o=e.getLayerPos(t);return e.attributes.scrollPointerLock&&e.pointerLockPosition&&-1!==["horizontal-scroll-box","vertical-scroll-box"].indexOf(e.scrollStartMode)&&(e.pointerLockPosition.x+=t.movementX,e.pointerLockPosition.y+=t.movementY,e.pointerLockPosition.x=Math.min(e.width-e.style.scrollBarWidth,Math.max(0,e.pointerLockPosition.x)),e.pointerLockPosition.y=Math.min(e.height-e.style.scrollBarWidth,Math.max(0,e.pointerLockPosition.y)),o=e.pointerLockPosition),e.scrollMode=e.getCellAt(o.x,o.y).context,"horizontal-scroll-box"===e.scrollMode&&"horizontal-scroll-box"!==e.scrollStartMode?(e.scrollStartMode="horizontal-scroll-box",e.dragStart=o,e.scrollStart.left=e.scrollBox.scrollLeft,void clearTimeout(e.scrollTimer)):"vertical-scroll-box"===e.scrollMode&&"vertical-scroll-box"!==e.scrollStartMode?(e.scrollStartMode="vertical-scroll-box",e.dragStart=o,e.scrollStart.top=e.scrollBox.scrollTop,void clearTimeout(e.scrollTimer)):("vertical-scroll-box"===e.scrollStartMode&&"vertical-scroll-box"!==e.scrollMode&&(e.scrollMode="vertical-scroll-box"),"horizontal-scroll-box"===e.scrollStartMode&&"horizontal-scroll-box"!==e.scrollMode&&(e.scrollMode="horizontal-scroll-box"),clearTimeout(e.scrollTimer),void(-1!==e.scrollModes.indexOf(e.scrollMode)&&("vertical-scroll-box"===e.scrollMode?e.scrollBox.scrollTop=e.scrollStart.top+(o.y-e.dragStart.y)/e.scrollBox.heightBoxRatio:"vertical-scroll-top"===e.scrollMode?(e.scrollBox.scrollTop-=e.page*e.style.cellHeight,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)):"vertical-scroll-bottom"===e.scrollMode&&(e.scrollBox.scrollTop+=e.page*e.style.cellHeight,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)),"horizontal-scroll-box"===e.scrollMode?e.scrollBox.scrollLeft=e.scrollStart.left+(o.x-e.dragStart.x)/e.scrollBox.widthBoxRatio:"horizontal-scroll-right"===e.scrollMode?(e.scrollBox.scrollLeft+=e.attributes.selectionScrollIncrement,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)):"horizontal-scroll-left"===e.scrollMode&&(e.scrollBox.scrollLeft-=e.attributes.selectionScrollIncrement,e.scrollTimer=setTimeout(e.scrollGrid,e.attributes.scrollRepeatRate,t)))))},e.stopScrollGrid=function(){clearTimeout(e.scrollTimer),document.exitPointerLock&&document.exitPointerLock(),document.removeEventListener("mousemove",e.scrollGrid,!1)},e.dragReorder=function(t){var o,r,n,l="column-reorder"===e.dragMode,i="row-reorder"===e.dragMode;o=e.getLayerPos(t),r=o.x-e.dragStart.x,n=o.y-e.dragStart.y,!e.attributes.allowColumnReordering&&l||!e.attributes.allowRowReordering&&i||e.dispatchEvent("reordering",{NativeEvent:t,source:e.dragStartObject,target:e.currentCell,dragMode:e.dragMode})||(Math.abs(r)>e.attributes.reorderDeadZone||Math.abs(n)>e.attributes.reorderDeadZone)&&(e.reorderObject=e.draggingItem,e.reorderTarget=e.currentCell,e.reorderObject.dragOffset={x:r,y:n},e.autoScrollZone(t,l?o.x:-1,i?o.y:-1,!1))},e.stopDragReorder=function(t){var o,r,n={"row-reorder":e.orders.rows,"column-reorder":e.orders.columns},l={"row-reorder":"rowIndex","column-reorder":"sortColumnIndex"}[e.dragMode];document.body.removeEventListener("mousemove",e.dragReorder,!1),document.body.removeEventListener("mouseup",e.stopDragReorder,!1),e.reorderObject&&e.reorderTarget&&("column-reorder"===e.dragMode&&e.reorderTarget.sortColumnIndex>-1&&e.reorderTarget.sortColumnIndex-1&&e.reorderTarget.rowIndexe.attributes.reorderDeadZone||Math.abs(o.y)>e.attributes.reorderDeadZone)&&setTimeout(function(){e.autoScrollZone(t,o.x,o.y,!1)},1)}},e.stopDragMove=function(t){document.body.removeEventListener("mousemove",e.dragMove,!1),document.body.removeEventListener("mouseup",e.stopDragMove,!1);var o=e.getSelectionBounds();if(e.dispatchEvent("endmove",{NativeEvent:t,cell:e.currentCell}))return e.movingSelection=void 0,e.moveOffset=void 0,void e.draw(!0);e.moveOffset&&(e.moveTo(e.movingSelection,o.left+e.moveOffset.x,o.top+e.moveOffset.y),e.moveSelection(e.moveOffset.x,e.moveOffset.y)),e.movingSelection=void 0,e.moveOffset=void 0,e.draw(!0)},e.freezeMove=function(t){if(!e.dispatchEvent("freezemoving",{NativeEvent:t,cell:e.currentCell})){var o=e.getLayerPos(t);e.ignoreNextClick=!0,e.freezeMarkerPosition=o,e.currentCell&&void 0!==e.currentCell.rowIndex&&"frozen-row-marker"===e.dragMode&&(e.scrollBox.scrollTop=0,e.frozenRow=e.currentCell.rowIndex+1),e.currentCell&&void 0!==e.currentCell.columnIndex&&"frozen-column-marker"===e.dragMode&&(e.scrollBox.scrollLeft=0,e.frozenColumn=e.currentCell.columnIndex+1),(Math.abs(o.x)>e.attributes.reorderDeadZone||Math.abs(o.y)>e.attributes.reorderDeadZone)&&setTimeout(function(){e.autoScrollZone(t,o.x,o.y,!1)},1)}},e.stopFreezeMove=function(t){if(document.body.removeEventListener("mousemove",e.freezeMove,!1),document.body.removeEventListener("mouseup",e.stopFreezeMove,!1),e.freezeMarkerPosition=void 0,e.dispatchEvent("endfreezemove",{NativeEvent:t}))return e.frozenRow=e.startFreezeMove.x,e.frozenColumn=e.startFreezeMove.y,void e.draw(!0);e.draw(!0)},e.mousedown=function(t,o){if(e.lastMouseDownTarget=t.target,!e.dispatchEvent("mousedown",{NativeEvent:t,cell:e.currentCell})&&e.hasFocus&&2!==t.button&&!e.input){var r=t.ctrlKey||t.metaKey,n=/-move/.test(e.dragMode),l=/frozen-row-marker|frozen-column-marker/.test(e.dragMode),i=/-resize/.test(e.dragMode);if(e.dragStart=o||e.getLayerPos(t),e.scrollStart={left:e.scrollBox.scrollLeft,top:e.scrollBox.scrollTop},e.dragStartObject=e.getCellAt(e.dragStart.x,e.dragStart.y),e.dragAddToSelection=!e.dragStartObject.selected,r||t.shiftKey||/(vertical|horizontal)-scroll-(bar|box)/.test(e.dragStartObject.context)||!e.currentCell||e.currentCell.isColumnHeader||n||l||i||(e.selections=[]),!e.dragStartObject.isGrid){if(-1!==e.scrollModes.indexOf(e.dragStartObject.context))return e.scrollMode=e.dragStartObject.context,e.scrollStartMode=e.dragStartObject.context,e.scrollGrid(t),e.attributes.scrollPointerLock&&-1!==["horizontal-scroll-box","vertical-scroll-box"].indexOf(e.scrollStartMode)&&(e.pointerLockPosition={x:e.dragStart.x,y:e.dragStart.y},e.canvas.requestPointerLock()),document.addEventListener("mousemove",e.scrollGrid,!1),document.addEventListener("mouseup",e.stopScrollGrid,!1),void(e.ignoreNextClick=!0);if("cell"===e.dragMode)return e.selecting=!0,void(("row"===e.attributes.selectionMode||-1===e.dragStartObject.columnIndex)&&e.dragStartObject.rowIndex>-1?e.selectRow(e.dragStartObject.rowIndex,r,null):"row"!==e.attributes.selectionMode&&e.mousemove(t));if(n){if(e.draggingItem=e.dragItem,e.movingSelection=e.selections.concat([]),e.dragging=e.dragStartObject,e.dispatchEvent("beginmove",{NativeEvent:t,cell:e.currentCell}))return;return document.body.addEventListener("mousemove",e.dragMove,!1),document.body.addEventListener("mouseup",e.stopDragMove,!1),e.mousemove(t)}if(l){if(e.draggingItem=e.dragItem,e.startFreezeMove={x:e.frozenRow,y:e.frozenColumn},e.dispatchEvent("beginfreezemove",{NativeEvent:t}))return;return document.body.addEventListener("mousemove",e.freezeMove,!1),document.body.addEventListener("mouseup",e.stopFreezeMove,!1),e.mousemove(t)}return i?(e.draggingItem=e.dragItem,e.draggingItem.rowOpen?e.resizingStartingHeight=e.sizes.trees[e.draggingItem.rowIndex]:e.resizingStartingHeight=e.sizes.rows[e.draggingItem.rowIndex]||e.style.cellHeight,e.resizingStartingWidth=e.sizes.columns["rowHeaderCell"===e.draggingItem.header.style?"cornerCell":e.draggingItem.sortColumnIndex]||e.draggingItem.width,document.body.addEventListener("mousemove",e.dragResizeColumn,!1),void document.body.addEventListener("mouseup",e.stopDragResize,!1)):-1!==["row-reorder","column-reorder"].indexOf(e.dragMode)?(e.draggingItem=e.dragStartObject,document.body.addEventListener("mousemove",e.dragReorder,!1),void document.body.addEventListener("mouseup",e.stopDragReorder,!1)):void 0}}},e.mouseup=function(t){clearTimeout(e.scrollTimer),e.cellBoundaryCrossed=!0,e.rowBoundaryCrossed=!0,e.columnBoundaryCrossed=!0,e.selecting=void 0,e.draggingItem=void 0,e.dragStartObject=void 0,e.dispatchEvent("mouseup",{NativeEvent:t,cell:e.currentCell})||(e.hasFocus||t.target===e.canvas)&&(e.currentCell&&void 0!==e.currentCell.grid||e.contextMenu||e.input||(e.dragStart&&e.isInGrid(e.dragStart)&&e.controlInput.focus(),t.preventDefault()))},e.getAdjacentCells=function(){var t,o,r=e.getSchema(),n={};for(t=0;te.activeCell.columnIndex&&void 0===n.right&&(n.right=t),ts&&(i=s),(i<0||Number.isNaN(i))&&(i=0),l>d&&(l=n.last),t.shiftKey&&-1!==[37,38,39,40].indexOf(t.keyCode)&&(e.selections[Math.max(i,0)]=e.selections[Math.max(i,0)]||[],e.selections[Math.max(i,0)].push(l),e.selectionBounds=e.getSelectionBounds(),e.selectArea(void 0,a),e.draw(!0)),l===e.activeCell.columnIndex&&i===e.activeCell.rowIndex||(e.scrollIntoView(l!==e.activeCell.columnIndex?l:void 0,i===e.activeCell.rowIndex||Number.isNaN(i)?void 0:i),e.setActiveCell(l,i),!t.shiftKey&&e.attributes.selectionFollowsActiveCell&&(a||(e.selections=[]),e.selections[i]=e.selections[i]||[],e.selections[i].push(l),r={selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.getSelectionBounds()},Object.defineProperty(r,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",r)),e.draw(!0))}},e.keyup=function(t){e.dispatchEvent("keyup",{NativeEvent:t,cell:e.currentCell})||e.hasFocus},e.keypress=function(t){e.hasFocus&&e.dispatchEvent("keypress",{NativeEvent:t,cell:e.currentCell})},e.dblclick=function(t){e.dispatchEvent("dblclick",{NativeEvent:t,cell:e.currentCell})||e.hasFocus&&("ew-resize"===e.currentCell.context&&"columnHeaderCell"===e.currentCell.style?e.fitColumnToValues(e.currentCell.header.name):"ew-resize"===e.currentCell.context&&"cornerCell"===e.currentCell.style?e.autosize():-1!==["cell","activeCell"].indexOf(e.currentCell.style)&&e.beginEditAt(e.currentCell.columnIndex,e.currentCell.rowIndex))},e.scrollWheel=function(o){var r,n,l=o,i=void 0===o.deltaX?o.NativeEvent.deltaX:o.deltaX,a=void 0===o.deltaY?o.NativeEvent.deltaY:o.deltaY,s=void 0===o.deltaMode?o.NativeEvent.deltaMode:o.deltaMode;if(!t&&!e.dispatchEvent("wheel",{NativeEvent:o})){var o=o.NativeEvent||o;e.touchHaltAnimation=!0,r=e.scrollBox.scrollLeft,n=e.scrollBox.scrollTop,e.hasFocus&&(1===s&&(a*=17),(e.scrollBox.scrollTop0||e.scrollBox.scrollLeft0||e.scrollBox.scrollTop>0&&a<0||e.scrollBox.scrollLeft>0&&i<0)&&l.preventDefault(o),t=setTimeout(function(){t=void 0,e.scrollBox.scrollTo(i+r,a+n)},1))}},e.pasteItem=function(t,o,r,n){function l(e,t,o,r,n,l){var i=t;return Array.isArray(e)||null===e||"object"!=typeof e||(e=Object.keys(e).map(function(t){return e[t]})),/^text\/html/.test(n)&&(e=e.substring(4,e.length-5).split("")),"string"==typeof e&&(e=[e]),c[l]=[],e.forEach(function(n,a){var s=r[a+o].name;if(void 0===e[a]||null===e[a])return void(i[s]=t[s]);c[l].push(a+o),i[s]=e[a]}),i}var i,a=e.getVisibleSchema(),s=r-1,c=[];if(/^text\/html/.test(n)){if(!/^(]+>)?/.test(t.substring(0,29)))return void console.warn("Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.");t=t.substring(t.indexOf("")+11,t.length-13).split(""),t=t.filter(function(e){return!/^/.test(e)})}else t=t.split("\n");return i=t.length,t.forEach(function(t){s+=1;var r=e.orders.rows[s];e.data[r]=l(t,e.data[r],o,a,n,r)}),e.selections=c,i},e.getNextVisibleColumnIndex=function(t){var o,r=e.getVisibleSchema();for(o=0;o/g,">")}function r(e){return e=null===e||void 0===e?"":e,""}function n(t,r){if(!f.length||t.length<2)return"";var n=[];return r&&n.push(""),f.forEach(function(l,i){if(l=f[e.orders.columns[i]],!l.hidden&&-1!==t.indexOf(l.name)){var a=l.name||l.title||"";r?n.push(""):n.push('"'+a.replace(/"/g,'""')+'"')}}),n.push(r?"":"\n"),n.join(r?"":",")}function l(e,t,o,n){return null!==e&&!1!==e&&void 0!==e&&e.replace?(t.push(r(e)),void o.push('"'+e.replace(/"/g,'""')+'"')):void 0!==e?(o.push(e),void t.push(r(e))):(o.push(""),void t.push(""))}if(!e.dispatchEvent("copy",{NativeEvent:t})&&e.hasFocus&&t.clipboardData){var i,a,s,c=(e.data,[]),d=[],u={},h=e.getSelectedData(),f=e.getSchema();h.length>0&&(h.forEach(function(t){var o=Object.keys(t);if(t){var r=[],n=[],i=[];f.forEach(function(t,o){i.push(f[e.orders.columns[o]])}),i.forEach(function(e,i){-1!==o.indexOf(e.name)&&(u[e.name]=!0,l(t[e.name],r,n,e))}),c.push(r.join("")),d.push(n.join(","))}}),s=Object.keys(u),i=n(s)+d.join("\n"),a="
|^
"+("string"==typeof e?o(e):e)+"
"+o(a)+"
 
"+n(s,!0)+""+c.join("")+"
",1===s.length&&(i=i.substring(1,i.length-1)),t.clipboardData.setData("text/html",a),t.clipboardData.setData("text/plain",i),t.clipboardData.setData("text/csv",i),t.clipboardData.setData("application/json",JSON.stringify(h)),t.preventDefault())}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(t){function o(){var t=e.scrollBox.scrollLeft,n=e.scrollBox.scrollTop;t+=i?e.attributes.selectionScrollIncrement:0,n+=s?e.attributes.selectionScrollIncrement:0,n-=c?e.attributes.selectionScrollIncrement:0,t-=a?e.attributes.selectionScrollIncrement:0,e.scrollBox.scrollTo(t,n),r=setTimeout(o,e.attributes.scrollRepeatRate)}var n,l,i,a,s,c,d,u,h;if(!e.dispatchEvent("beforetouchmove",{NativeEvent:t})){if(clearTimeout(r),t.changedTouches[0]&&(e.touchPosition=e.getTouchPos(t)),t.changedTouches[1]&&(e.touchPosition1=e.getTouchPos(t,1)),Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)>e.attributes.touchDeadZone&&clearTimeout(e.touchContextTimeout),2===t.touches.length&&e.touchPosition&&e.touchPosition1)return u=e.touchPosition.y,h=e.touchPosition1.y,e.zoomDeltaStart||(e.zoomDeltaStart=Math.abs(u-h),e.startScale=e.scale),e.touchLength=2,e.scaleDelta=e.zoomDeltaStart-Math.abs(u-h),e.scale=e.startScale-e.scaleDelta*e.attributes.touchZoomSensitivity,e.scale=Math.min(Math.max(e.scale,e.attributes.touchZoomMin),e.attributes.touchZoomMax),e.zoomAltered=!0,e.resize(!0),void e.resizeChildGrids();if(!e.zoomAltered)return e.touchLength=1,e.touchPosition=e.touchPosition||e.touchPosition1,n=e.getColumnHeaderCellHeight(),l=e.getRowHeaderCellWidth(),i=e.width-e.style.scrollBarWidth-e.touchPosition.xr||e.scrollAnimation.y===e.scrollBox.scrollTop&&e.scrollAnimation.x===e.scrollBox.scrollLeft||e.stopAnimation||(e.scrollBox.scrollTo(e.scrollAnimation.x,e.scrollAnimation.y),requestAnimationFrame(e.touchEndAnimation))},e.touchEditCell=function(t){e.beginEditAt(t.columnIndex,t.rowIndex)},e.touchCell=function(t){return function(){clearInterval(e.calculatePPSTimer);var o,r=e.getTouchPos(t);if(Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)=r.top&&t.columnIndex<=r.right?(r.bottom=t.rowIndex,r.left=t.columnIndex):"selection-handle-tl"===o&&t.rowIndex<=r.bottom&&t.columnIndex<=r.right?(r.top=t.rowIndex,r.left=t.columnIndex):"selection-handle-tr"===o&&t.rowIndex<=r.bottom&&t.columnIndex>=r.left?(r.top=t.rowIndex,r.right=t.columnIndex):"selection-handle-br"===o&&t.rowIndex>=r.top&&t.columnIndex>=r.left&&(r.bottom=t.rowIndex,r.right=t.columnIndex),"row"===e.attributes.selectionMode||-1===t.rowIndex?(r.left=0,r.right=e.getSchema().length-1):r.left=Math.max(0,r.left),e.selectArea(r),e.draw(!0)}},e.touchmove=function(e){o||requestAnimationFrame(function(){o=!0,t(e),o=!1})},e.touchEndEvents=function(t){e.zoomDeltaStart=void 0,e.touchSelecting=!1,clearInterval(e.touchScrollTimeout),clearInterval(e.touchContextTimeout),clearInterval(e.calculatePPSTimer),t.stopPropagation(),document.body.removeEventListener("touchmove",e.touchmove,{passive:!1}),document.body.removeEventListener("touchend",e.touchend,!1),document.body.removeEventListener("touchcancel",e.touchcancel,!1)},e.touchend=function(t){if(!e.dispatchEvent("touchend",{NativeEvent:t,cell:e.currentCell})){if(e.zoomDeltaStart=void 0,t.changedTouches[0]&&(e.touchPosition=void 0),t.changedTouches[1]&&(e.touchPosition1=void 0),e.zoomAltered)return void(0===t.touches.length&&(e.zoomAltered=!1));var o=Math.abs(e.touchDelta.x)+Math.abs(e.touchDelta.y)e.attributes.scrollAnimationPPSThreshold||Math.abs(e.yPPST)>e.attributes.scrollAnimationPPSThreshold)||/-scroll-/.test(e.startingCell.style)||o||(e.stopAnimation=!1,e.touchEndAnimation()),e.touchEndEvents(t)}},e.touchcancel=function(t){e.dispatchEvent("touchcancel",{NativeEvent:t,cell:e.currentCell})||e.touchEndEvents(t)}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e,t){function o(e,t){var o,r=[];for(o=e;o<=t;o+=1)r[o]=o;return r}e.scale=1,e.orders={rows:[],columns:[]},e.appliedInlineStyles={},e.cellGridAttributes={},e.treeGridAttributes={},e.visibleRowHeights=[],e.hasFocus=!1,e.activeCell={columnIndex:0,rowIndex:0},e.innerHTML="",e.storageName="canvasDataGrid",e.invalidSearchExpClass="canvas-datagrid-invalid-search-regExp",e.localStyleLibraryStorageKey="canvas-datagrid-user-style-library",e.dataType="application/x-canvas-datagrid",e.orderBy=null,e.orderDirection="asc",e.columnFilters={},e.filters={},e.frozenRow=0,e.frozenColumn=0,e.ellipsisCache={},e.scrollCache={x:[],y:[]},e.scrollBox={},e.visibleRows=[],e.sizes={rows:{},columns:{},trees:{}},e.currentFilter=function(){return!0},e.selections=[],e.hovers={},e.attributes={},e.style={},e.formatters={},e.sorters={},e.parsers={},e.schemaHashes={},e.events={},e.changes=[],e.scrollIndexTop=0,e.scrollPixelTop=0,e.scrollIndexLeft=0,e.scrollPixelLeft=0,e.childGrids={},e.openChildren={},e.scrollModes=["vertical-scroll-box","vertical-scroll-top","vertical-scroll-bottom","horizontal-scroll-box","horizontal-scroll-right","horizontal-scroll-left"],e.componentL1Events={},e.eventNames=["afterdraw","afterrendercell","attributechanged","beforebeginedit","beforecreatecellgrid","beforedraw","beforeendedit","beforerendercell","beforerendercellgrid","beginedit","cellmouseout","cellmouseover","click","collapsetree","contextmenu","copy","datachanged","dblclick","endedit","expandtree","formatcellvalue","keydown","keypress","keyup","mousedown","mousemove","mouseup","newrow","ordercolumn","rendercell","rendercellgrid","renderorderbyarrow","rendertext","rendertreearrow","reorder","reordering","resize","resizecolumn","resizerow","schemachanged","scroll","selectionchanged","stylechanged","touchcancel","touchend","touchmove","touchstart","wheel"],e.mouse={x:0,y:0},e.getSelectedData=function(t){var o=[],r=e.getSchema(),n=e.data.length;return 0===n?[]:(e.selections.forEach(function(l,i){if(l&&i!==n){if(0===l.length)return void(o[i]=null);o[i]={},l.forEach(function(n){var l;-1!==n&&r[n]&&(l=e.orders.columns[n],!t&&r[l].hidden||e.data[i]&&(o[i][r[l].name]=e.data[i][r[l].name]))})}}),o)},e.getColumnHeaderCellHeight=function(){return e.attributes.showColumnHeaders?(e.sizes.rows[-1]||e.style.columnHeaderCellHeight)*e.scale:0},e.getRowHeaderCellWidth=function(){return e.attributes.showRowHeaders?(e.sizes.columns[-1]||e.style.rowHeaderCellWidth)*e.scale:0},e.setStorageData=function(){if(e.attributes.saveAppearance&&e.attributes.name){var t={};e.getSchema().forEach(function(e){t[e.name]=!e.hidden}),localStorage.setItem(e.storageName+"-"+e.attributes.name,JSON.stringify({sizes:{rows:e.sizes.rows,columns:e.sizes.columns},orders:{rows:e.orders.rows,columns:e.orders.columns},orderBy:e.orderBy,orderDirection:e.orderDirection,visibility:t}))}},e.getSchema=function(){return e.schema||e.tempSchema||[]},e.createColumnOrders=function(){var t=e.getSchema();e.orders.columns=o(0,t.length-1)},e.createRowOrders=function(){e.orders.rows=o(0,e.data.length-1)},e.getVisibleSchema=function(){return e.getSchema().filter(function(e){return!e.hidden})},e.applyDefaultValue=function(t,o){var r=o.defaultValue||"";"function"==typeof r&&(r=r.apply(e.intf,[o])),t[o.name]=r},e.createNewRowData=function(){e.newRow={},e.getSchema().forEach(function(t){e.applyDefaultValue(e.newRow,t)})},e.getSchemaNameHash=function(t){for(var o=0;e.schemaHashes[t];)o+=1,t+=o;return t},e.filter=function(t){var o=e.filters[t];return o||void 0===t||(console.warn("Cannot find filter for type %s, falling back to substring match.",t),o=e.filters.string),o},e.getBestGuessDataType=function(e,t){var o,r,n=t.length;for(r=0;re.width-e.attributes.selectionScrollZone&&oe.height-e.attributes.selectionScrollZone&&r0)throw new Error("A column with the name "+e.name+" already exists and cannot be added again.");return!0},e.setDefaults=function(e,t,o,r){e[o]=void 0===t[o]?r:t[o]},e.setAttributes=function(){e.defaults.attributes.forEach(function(t){e.setDefaults(e.attributes,e.args,t[0],t[1])})},e.setStyle=function(){e.defaults.styles.forEach(function(t){e.setDefaults(e.style,e.args.style||{},t[0],t[1])})},e.autosize=function(t){e.getVisibleSchema().forEach(function(o,r){o.name!==t&&void 0!==t||(e.sizes.columns[r]=Math.max(e.findColumnMaxTextLength(o.name),e.style.minColumnWidth))}),e.sizes.columns[-1]=e.findColumnMaxTextLength("cornerCell")},e.dispose=function(){!e.isChildGrid&&e.canvas&&e.canvas.parentNode&&e.canvas.parentNode.removeChild(e.canvas),e.isChildGrid||document.body.removeChild(e.controlInput),e.eventParent.removeEventListener("mouseup",e.mouseup,!1),e.eventParent.removeEventListener("mousedown",e.mousedown,!1),e.eventParent.removeEventListener("dblclick",e.dblclick,!1),e.eventParent.removeEventListener("click",e.click,!1),e.eventParent.removeEventListener("mousemove",e.mousemove),e.eventParent.removeEventListener("wheel",e.scrollWheel,!1),e.canvas.removeEventListener("contextmenu",e.contextmenu,!1),e.canvas.removeEventListener("copy",e.copy),e.controlInput.removeEventListener("copy",e.copy),e.controlInput.removeEventListener("cut",e.cut),e.controlInput.removeEventListener("paste",e.paste),e.controlInput.removeEventListener("keypress",e.keypress,!1),e.controlInput.removeEventListener("keyup",e.keyup,!1),e.controlInput.removeEventListener("keydown",e.keydown,!1),window.removeEventListener("resize",e.resize),e.observer&&e.observer.disconnect&&e.observer.disconnect()},e.tryLoadStoredSettings=function(){var t;e.reloadStoredValues(),e.storedSettings&&"object"==typeof e.storedSettings.orders&&null!==e.storedSettings.orders&&(e.storedSettings.orders.rows.length>=(e.data||[]).length&&(e.orders.rows=e.storedSettings.orders.rows),t=e.getSchema(),e.storedSettings.orders.columns.length===t.length&&(e.orders.columns=e.storedSettings.orders.columns),e.orderBy=void 0===e.storedSettings.orderBy?t[0].name:e.storedSettings.orderBy,e.orderDirection=void 0===e.storedSettings.orderDirection?"asc":e.storedSettings.orderDirection,void 0!==e.storedSettings.orderBy&&e.getHeaderByName(e.orderBy)&&e.orderDirection&&e.order(e.orderBy,e.orderDirection))},e.getDomRoot=function(){return e.shadowRoot?e.shadowRoot.host:e.parentNode},e.getFontName=function(e){return e.replace(/\d+\.?\d*px/,"")},e.getFontHeight=function(e){return parseFloat(e,10)},e.parseStyleValue=function(t){if(/Font/.test(t))return e.style[t+"Height"]=e.getFontHeight(e.style[t]),void(e.style[t+"Name"]=e.getFontName(e.style[t]));"moveOverlayBorderSegments"===t&&"string"==typeof e.style[t]&&(e.style[t]=e.style[t].split(",").map(function(e){return parseInt(e,10)}))},e.initProp=function(t){e.args[t]&&Object.keys(e.args[t]).forEach(function(o){e[t][o]=e.args[t][o]})},e.getStyleProperty=function(t){return-1===e.styleKeys.indexOf(t)?e.parentNodeStyle[t]:e.style[t]},e.setStyleProperty=function(t,o,r){var n=-1!==["height","width","minHeight","minWidth","maxHeight","maxWidth"].indexOf(t);-1===e.styleKeys.indexOf(t)?e.parentNodeStyle[t]=o:(/-/.test(t)&&(t=e.dehyphenateProperty(t)),e.style[t]=o,e.parseStyleValue(t)),n&&e.resize(),r||(e.draw(!0),e.dispatchEvent("stylechanged",{name:"style",value:o}))},e.reloadStoredValues=function(){if(e.attributes.name&&e.attributes.saveAppearance){try{e.storedSettings=localStorage.getItem(e.storageName+"-"+e.attributes.name)}catch(t){console.warn("Error loading stored values. "+t.message),e.storedSettings=void 0}if(e.storedSettings)try{e.storedSettings=JSON.parse(e.storedSettings)}catch(t){console.warn("could not read settings from localStore",t),e.storedSettings=void 0}e.storedSettings&&("object"==typeof e.storedSettings.sizes&&null!==e.storedSettings.sizes&&(e.sizes.rows=e.storedSettings.sizes.rows,e.sizes.columns=e.storedSettings.sizes.columns,["trees","columns","rows"].forEach(function(t){e.sizes[t]||(e.sizes[t]={})})),"object"==typeof e.storedSettings.visibility&&e.getSchema().forEach(function(t){e.storedSettings.visibility&&void 0!==e.storedSettings.visibility[t.name]&&(t.hidden=!e.storedSettings.visibility[t.name])}))}},e.init=function(){function t(t){-1===e.styleKeys.indexOf(t)&&e.styleKeys.push(t)}if(!e.initialized){var o={};return e.setAttributes(),e.setStyle(),e.initScrollBox(),e.setDom(),e.nodeType="canvas-datagrid",e.ie=/Trident/.test(window.navigator.userAgent),e.edge=/Edge/.test(window.navigator.userAgent),e.webKit=/WebKit/.test(window.navigator.userAgent),e.moz=/Gecko/.test(window.navigator.userAgent),e.mobile=/Mobile/i.test(window.navigator.userAgent),e.cursorGrab="grab",e.cursorGrabing="grabbing",e.cursorGrab=e.webKit?"-webkit-grab":e.cursorGrab,e.cursorGrabing=e.moz?"-webkit-grabbing":e.cursorGrabbing,e.pointerLockPosition={x:0,y:0},Object.keys(e.style).forEach(e.parseStyleValue),e.intf.moveSelection=e.moveSelection,e.intf.moveTo=e.moveTo,e.intf.addEventListener=e.addEventListener,e.intf.removeEventListener=e.removeEventListener,e.intf.dispatchEvent=e.dispatchEvent,e.intf.dispose=e.dispose,e.intf.appendTo=e.appendTo,e.intf.getVisibleCellByIndex=e.getVisibleCellByIndex,e.intf.filters=e.filters,e.intf.sorters=e.sorters,e.intf.autosize=e.autosize,e.intf.beginEditAt=e.beginEditAt,e.intf.endEdit=e.endEdit,e.intf.setActiveCell=e.setActiveCell,e.intf.forEachSelectedCell=e.forEachSelectedCell,e.intf.scrollIntoView=e.scrollIntoView,e.intf.clearChangeLog=e.clearChangeLog,e.intf.gotoCell=e.gotoCell,e.intf.gotoRow=e.gotoRow,e.intf.getHeaderByName=e.getHeaderByName,e.intf.findColumnScrollLeft=e.findColumnScrollLeft,e.intf.findRowScrollTop=e.findRowScrollTop,e.intf.fitColumnToValues=e.fitColumnToValues,e.intf.findColumnMaxTextLength=e.findColumnMaxTextLength,e.intf.disposeContextMenu=e.disposeContextMenu,e.intf.getCellAt=e.getCellAt,e.intf.isCellVisible=e.isCellVisible,e.intf.isRowVisible=e.isRowVisible,e.intf.isColumnVisible=e.isColumnVisible,e.intf.order=e.order,e.intf.draw=e.draw,e.intf.isComponent=e.isComponent,e.intf.selectArea=e.selectArea,e.intf.clipElement=e.clipElement,e.intf.getSchemaFromData=e.getSchemaFromData,e.intf.setFilter=e.setFilter,e.intf.selectRow=e.selectRow,e.intf.parentGrid=e.parentGrid,e.intf.toggleTree=e.toggleTree,e.intf.expandTree=e.expandTree,e.intf.collapseTree=e.collapseTree,e.intf.canvas=e.canvas,e.intf.context=e.ctx,e.intf.insertRow=e.insertRow,e.intf.deleteRow=e.deleteRow,e.intf.addRow=e.addRow,e.intf.insertColumn=e.insertColumn,e.intf.deleteColumn=e.deleteColumn,e.intf.addColumn=e.addColumn,e.intf.getClippingRect=e.getClippingRect,e.intf.setRowHeight=e.setRowHeight,e.intf.setColumnWidth=e.setColumnWidth,e.intf.resetColumnWidths=e.resetColumnWidths,e.intf.resetRowHeights=e.resetRowHeights,e.intf.resize=e.resize,e.intf.selectColumn=e.selectColumn,e.intf.selectRow=e.selectRow,e.intf.selectAll=e.selectAll,e.intf.selectNone=e.selectNone,e.intf.drawChildGrids=e.drawChildGrids,e.intf.assertPxColor=e.assertPxColor,e.intf.clearPxColorAssertions=e.clearPxColorAssertions,e.intf.integerToAlpha=e.integerToAlpha,e.intf.copy=e.copy,e.intf.setStyleProperty=e.setStyleProperty,Object.defineProperty(e.intf,"defaults",{get:function(){return{styles:e.defaults.styles.reduce(function(e,t){return e[t[0]]=t[1],e},{}),attributes:e.defaults.attributes.reduce(function(e,t){return e[t[0]]=t[1],e},{})}}}),e.styleKeys=Object.keys(e.intf.defaults.styles),e.styleKeys.map(function(t){return e.hyphenateProperty(t,!1)}).forEach(t),e.styleKeys.map(function(t){return e.hyphenateProperty(t,!0)}).forEach(t),e.DOMStyles=window.getComputedStyle(document.body,null),e.styleKeys.concat(Object.keys(e.DOMStyles)).forEach(function(t){o[t]=void 0,Object.defineProperty(o,t,{get:function(){return e.getStyleProperty(t)},set:function(o){e.initialized&&(e.appliedInlineStyles[t]=o),e.setStyleProperty(t,o)}})}),Object.defineProperty(e.intf,"shadowRoot",{get:function(){return e.shadowRoot}}),Object.defineProperty(e.intf,"activeCell",{get:function(){return e.activeCell}}),Object.defineProperty(e.intf,"hasFocus",{get:function(){return e.hasFocus}}),Object.defineProperty(e.intf,"style",{get:function(){return o},set:function(t){Object.keys(t).forEach(function(o){e.setStyleProperty(o,t[o],!0)}),e.draw(!0),e.dispatchEvent("stylechanged",{name:"style",value:t})}}),Object.defineProperty(e.intf,"attributes",{value:{}}),Object.keys(e.attributes).forEach(function(t){Object.defineProperty(e.intf.attributes,t,{get:function(){return e.attributes[t]},set:function(o){e.attributes[t]=o,"name"===t&&e.tryLoadStoredSettings(),e.draw(!0),e.dispatchEvent("attributechanged",{name:t,value:o[t]})}})}),e.filters.string=function(t,o){t=String(t);var r,n=/\/(i|g|m)*$/,l=n.exec(o),i=l?l[0].substring(1):"",a=i.length;if(e.invalidFilterRegEx=void 0,"/"===o.substring(0,1)&&l){try{r=new RegExp(o.substring(1,o.length-(a+1)),i)}catch(t){return void(e.invalidFilterRegEx=t)}return r.test(t)}return!!t.toString&&-1!==t.toString().toLocaleUpperCase().indexOf(o.toLocaleUpperCase())},e.filters.number=function(e,t){return!t||e===t},["formatters","filters","sorters"].forEach(e.initProp),e.applyComponentStyle(!1,e.intf),e.reloadStoredValues(),e.args.data&&(e.intf.data=e.args.data),(e.intf.innerText||e.intf.textContent)&&("application/x-canvas-datagrid"===e.intf.dataType&&(e.intf.dataType="application/json+x-canvas-datagrid"),e.intf.data=e.intf.innerText||e.intf.textContent),e.args.schema&&(e.intf.schema=e.args.schema),e.isChildGrid||!e.isComponent?requestAnimationFrame(function(){e.resize(!0)}):e.resize(!0),e.initialized=!0,e}},e.intf.blur=function(t){e.hasFocus=!1},e.intf.focus=function(){e.hasFocus=!0,e.controlInput.focus()},(e.shadowRoot||e.isChildGrid)&&(Object.defineProperty(e.intf,"height",{get:function(){return e.shadowRoot?e.shadowRoot.height:e.parentNode.height},set:function(t){e.shadowRoot?e.shadowRoot.height=t:e.parentNode.height=t,e.resize(!0)}}),Object.defineProperty(e.intf,"width",{get:function(){return e.shadowRoot?e.shadowRoot.width:e.parentNode.width},set:function(t){e.shadowRoot?e.shadowRoot.width=t:e.parentNode.width=t,e.resize(!0)}}),Object.defineProperty(e.intf,"parentNode",{get:function(){return e.parentNode},set:function(t){if(!e.isChildGrid)throw new TypeError("Cannot set property parentNode which has only a getter");e.parentNode=t}})),Object.defineProperty(e.intf,"visibleRowHeights",{get:function(){return e.visibleRowHeights}}),Object.defineProperty(e.intf,"openChildren",{get:function(){return e.openChildren}}),Object.defineProperty(e.intf,"childGrids",{get:function(){return Object.keys(e.childGrids).map(function(t){return e.childGrids[t]})}}),Object.defineProperty(e.intf,"isChildGrid",{get:function(){return e.isChildGrid}}),Object.defineProperty(e,"cursor",{get:function(){return e.parentNodeStyle.cursor},set:function(t){"cell"===t&&(t="default"),e.currentCursor!==t&&(e.parentNodeStyle.cursor=t,e.currentCursor=t)}}),Object.defineProperty(e.intf,"orderDirection",{get:function(){return e.orderDirection},set:function(t){"desc"!==t&&(t="asc"),e.orderDirection=t,e.order(e.orderBy,e.orderDirection)}}),Object.defineProperty(e.intf,"orderBy",{get:function(){return e.orderBy},set:function(t){if(void 0===e.getSchema().find(function(e){return e.name===t}))throw new Error("Cannot sort by unknown column name.");e.orderBy=t,e.order(e.orderBy,e.orderDirection)}}),e.isComponent&&(Object.defineProperty(e.intf,"offsetHeight",{get:function(){return e.canvas.offsetHeight}}),Object.defineProperty(e.intf,"offsetWidth",{get:function(){return e.canvas.offsetWidth}})),Object.defineProperty(e.intf,"scrollHeight",{get:function(){return e.scrollBox.scrollHeight}}),Object.defineProperty(e.intf,"scrollWidth",{get:function(){return e.scrollBox.scrollWidth}}),Object.defineProperty(e.intf,"scrollTop",{get:function(){return e.scrollBox.scrollTop},set:function(t){e.scrollBox.scrollTop=t}}),Object.defineProperty(e.intf,"scrollLeft",{get:function(){return e.scrollBox.scrollLeft},set:function(t){e.scrollBox.scrollLeft=t}}),Object.defineProperty(e.intf,"sizes",{get:function(){return e.sizes}}),Object.defineProperty(e.intf,"parentDOMNode",{get:function(){return e.parentDOMNode}}),Object.defineProperty(e.intf,"input",{get:function(){return e.input}}),Object.defineProperty(e.intf,"controlInput",{get:function(){return e.controlInput}}),Object.defineProperty(e.intf,"currentCell",{get:function(){return e.currentCell}}),Object.defineProperty(e.intf,"visibleCells",{get:function(){return e.visibleCells}}),Object.defineProperty(e.intf,"visibleRows",{get:function(){return e.visibleRows}}),Object.defineProperty(e.intf,"selections",{get:function(){return e.selections}}),Object.defineProperty(e.intf,"dragMode",{get:function(){return e.dragMode}}),Object.defineProperty(e.intf,"changes",{get:function(){return e.changes}}),e.intf.formatters=e.formatters,Object.defineProperty(e.intf,"dataType",{get:function(){return e.dataType},set:function(t){if(!e.parsers[t])throw new Error("No parser for MIME type "+t);e.dataType=t}}),e.eventNames.forEach(function(t){Object.defineProperty(e.intf,"on"+t,{get:function(){return e.componentL1Events[t]},set:function(o){e.events[t]=[],e.componentL1Events[t]=o,o&&e.addEventListener(t,o)}})}),Object.defineProperty(e.intf,"frozenRow",{get:function(){return e.frozenRow},set:function(t){if(isNaN(t))throw new TypeError("Expected value for frozenRow to be a number.");if(e.visibleRows.length0&&void 0===e.storedSettings&&e.autosize(),e.fitColumnToValues("cornerCell",!0),e.createRowOrders(),e.tryLoadStoredSettings(),e.dispatchEvent("datachanged",{data:e.data}),e.resize(!0)})}}),e.initScrollBox=function(){function t(t,o){if(isNaN(t))throw new Error("ScrollTop value must be a number");t<0&&(t=0),t>a&&(t=a),a<0&&(t=0),l=t,o||e.scroll()}function o(t,o){if(isNaN(t))throw new Error("ScrollLeft value must be a number");t<0&&(t=0),t>s&&(t=s),s<0&&(t=0),i=t,o||e.scroll()}var r=0,n=0,l=0,i=0,a=0,s=0,c=20,d=20;e.scrollBox.toString=function(){return'{"width": '+s.toFixed(2)+', "height": '+a.toFixed(2)+', "left": '+i.toFixed(2)+', "top": '+l.toFixed(2)+', "widthRatio": '+e.scrollBox.widthBoxRatio.toFixed(5)+', "heightRatio": '+e.scrollBox.heightBoxRatio.toFixed(5)+"}"},e.scrollBox.scrollTo=function(e,r,n){o(e,!0),t(r,n)},Object.defineProperty(e.scrollBox,"scrollBoxHeight",{get:function(){return c},set:function(e){c=e}}),Object.defineProperty(e.scrollBox,"scrollBoxWidth",{get:function(){return d},set:function(e){d=e}}),Object.defineProperty(e.scrollBox,"height",{get:function(){return r},set:function(e){r=e}}),Object.defineProperty(e.scrollBox,"width",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(e.scrollBox,"scrollTop",{get:function(){return l},set:t}),Object.defineProperty(e.scrollBox,"scrollLeft",{get:function(){return i},set:o}),Object.defineProperty(e.scrollBox,"scrollHeight",{get:function(){return a},set:function(e){l>e&&(l=Math.max(e,0)),a=e}}),Object.defineProperty(e.scrollBox,"scrollWidth",{get:function(){return s},set:function(e){i>e&&(i=Math.max(e,0)),s=e}})}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){function t(t){e.createInlineStyle(t,"canvas-datagrid-context-menu-item"+(e.mobile?"-mobile":"")),t.addEventListener("mouseover",function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item:hover")}),t.addEventListener("mouseout",function(){e.createInlineStyle(t,"canvas-datagrid-context-menu-item")})}function o(r,n,a,s){function c(){a.forEach(function(n){function l(e){e.relatedTarget===m||n.contextMenu.container===e.relatedTarget||s===e.relatedTarget||c===e.relatedTarget||n.contextMenu.container.contains(e.relatedTarget)||(n.contextMenu.dispose(),y.splice(y.indexOf(n.contextMenu),1),n.contextMenu=void 0,c.removeEventListener("mouseout",l),m.removeEventListener("mouseout",l),c.setAttribute("contextOpen","0"),c.setAttribute("opening","0"))}function i(t){if("1"===c.getAttribute("opening")&&"1"!==c.getAttribute("contextOpen")){var i=c.getBoundingClientRect();i={left:i.left+e.style.childContextMenuMarginLeft+m.offsetWidth,top:i.top+e.style.childContextMenuMarginTop,bottom:i.bottom,right:i.right},n.contextMenu=o(r,i,t,w),c.setAttribute("contextOpen","1"),c.addEventListener("mouseout",l),m.addEventListener("mouseout",l),y.push(n.contextMenu)}}function a(){var e;if("1"!==c.getAttribute("contextOpen")){if(c.setAttribute("opening","1"),"function"==typeof n.items)return void(void 0!==(e=n.items.apply(w,[function(e){i(e)}]))&&Array.isArray(e)&&i(e));i(n.items)}}var s,c=document.createElement("div");!function(o){function n(e){if(null!==e){if("function"==typeof e)return n(e(r));if("object"==typeof e)return void c.appendChild(e);t(c),c.innerHTML=e}}n(o.title),o.contextItemContainer=c,(o.items&&o.items.length>0||"function"==typeof o.items)&&(s=document.createElement("div"),e.createInlineStyle(s,"canvas-datagrid-context-child-arrow"),s.innerHTML=e.style.childContextMenuArrowHTML,c.appendChild(s),c.addEventListener("mouseover",a),c.addEventListener("mouseout",function(){c.setAttribute("opening","0")})),o.click&&c.addEventListener("click",function(t){o.click.apply(e,[t])})}(n),m.appendChild(c)})}function d(e){a[e].contextItemContainer.dispatchEvent(new Event("click"))}function u(){m.scrollTop>0?e.parentDOMNode.appendChild(x):x.parentNode&&x.parentNode.removeChild(x),m.scrollTop>=m.scrollHeight-m.offsetHeight&&p.parentNode?p.parentNode.removeChild(p):m.scrollHeight-m.offsetHeight>0&&!(m.scrollTop>=m.scrollHeight-m.offsetHeight)&&e.parentDOMNode.appendChild(p)}function h(t){return function o(){var r=e.attributes.contextHoverScrollAmount;"up"===t&&0===m.scrollTop||"down"===t&&m.scrollTop===m.scrollHeight||(m.scrollTop+="up"===t?-r:r,i=setTimeout(o,e.attributes.contextHoverScrollRateMs,t))}}function f(e){return function(){clearTimeout(i)}}var g,m=document.createElement("div"),x=document.createElement("div"),p=document.createElement("div"),y=[],v=-1,w={};if(!Array.isArray(a))throw new Error("createContextMenu expects an array.");return w.parentGrid=e.intf,w.parentContextMenu=s,w.container=m,function(){var t={},o=e.scrollOffset(e.canvas);void 0===l&&(l=e.style.contextMenuZIndex),c(),e.createInlineStyle(m,"canvas-datagrid-context-menu"+(e.mobile?"-mobile":"")),t.x=n.left-o.left,t.y=n.top-o.top,t.height=0,l+=1,m.style.position="absolute",x.style.color=e.style.contextMenuArrowColor,p.style.color=e.style.contextMenuArrowColor,[x,p].forEach(function(e){e.style.textAlign="center",e.style.position="absolute",e.style.zIndex=l+1}),m.style.zIndex=l,s&&s.inputDropdown&&(m.style.maxHeight=window.innerHeight-t.y-e.style.autocompleteBottomMargin+"px",m.style.minWidth=n.width+"px",t.y+=n.height),e.mobile&&(m.style.width=n.width+"px"),m.style.left=t.x+"px",m.style.top=t.y+"px",m.addEventListener("scroll",u),m.addEventListener("wheel",function(t){e.hasFocus&&(m.scrollTop+=t.deltaY,m.scrollLeft+=t.deltaX),u()}),x.innerHTML=e.style.contextMenuArrowUpHTML,p.innerHTML=e.style.contextMenuArrowDownHTML,m.appendChild(x),document.body.appendChild(p),document.body.appendChild(m),g=m.getBoundingClientRect(),g.bottom>window.innerHeight&&(s&&s.inputDropdown||(t.y-=g.bottom+e.style.contextMenuWindowMargin-window.innerHeight),t.y<0&&(t.y=e.style.contextMenuWindowMargin),m.offsetHeight>window.innerHeight-e.style.contextMenuWindowMargin&&(m.style.height=window.innerHeight-2*e.style.contextMenuWindowMargin+"px")),g.right>window.innerWidth&&(t.x-=g.right-window.innerWidth+e.style.contextMenuWindowMargin),t.x<0&&(t.x=e.style.contextMenuWindowMargin),t.y<0&&(t.y=e.style.contextMenuWindowMargin),m.style.left=t.x+"px",m.style.top=t.y+"px",g=m.getBoundingClientRect(),x.style.top=g.top+"px",p.style.top=g.top+g.height-p.offsetHeight+"px",x.style.left=g.left+"px",p.style.left=g.left+"px",p.style.width=m.offsetWidth+"px",x.style.width=m.offsetWidth+"px",p.addEventListener("mouseover",h("down")),p.addEventListener("mouseout",f("down")),x.addEventListener("mouseover",h("up")),x.addEventListener("mouseout",f("up")),u()}(),w.clickIndex=d,w.rect=g,w.items=a,w.upArrow=x,w.downArrow=p,w.dispose=function(){clearTimeout(i),y.forEach(function(e){e.dispose()}),[p,x,m].forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})},Object.defineProperty(w,"selectedIndex",{get:function(){return v},set:function(t){if("number"!=typeof t||isNaN(t||!isFinite(t)))throw new Error("Context menu selected index must be a sane number.");v=t,v>a.length-1&&(v=a.length-1),v<0&&(v=0),a.forEach(function(t,o){if(o===v)return e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item:hover");e.createInlineStyle(t.contextItemContainer,"canvas-datagrid-context-menu-item")})}}),w}function r(t){function r(){h.style.background=e.style.contextFilterInputBackground,h.style.color=e.style.contextFilterInputColor,e.invalidFilterRegEx&&(h.style.background=e.style.contextFilterInvalidRegExpBackground,h.style.color=e.style.contextFilterInvalidRegExpColor)}function n(){var o=0;i={},e.data.forEach(function(r){var n=r[t.cell.header.name];i[n]||o>e.attributes.maxAutoCompleteItems||(o+=1,i[n]={title:e.formatters[t.cell.header.type||"string"]({cell:{value:n}}),click:function(t){h.value=n,t.stopPropagation(),h.dispatchEvent(new Event("keyup")),e.disposeAutocomplete()}})}),i=Object.keys(i).map(function(e){return i[e]})}function l(e){e&&-1!==[40,38,13,9].indexOf(e.keyCode)||(n(),s=h.getBoundingClientRect(),a&&(a.dispose(),a=void 0),a=o(t,{left:s.left,top:s.top,right:s.right,bottom:s.bottom,height:s.height,width:s.width},i,{inputDropdown:!0}),a.selectedIndex=0)}var i,s,c=document.createElement("div"),d=document.createElement("div"),u=document.createElement("button"),h=document.createElement("input"),f=t.cell&&t.cell.header?t.cell.header.title||t.cell.header.name:"";e.createInlineStyle(d,"canvas-datagrid-context-menu-label"),e.createInlineStyle(u,"canvas-datagrid-context-menu-filter-button"),e.createInlineStyle(h,"canvas-datagrid-context-menu-filter-input"),r(),h.onclick=e.disposeAutocomplete,h.addEventListener("keydown",function(t){40===t.keyCode&&(a.selectedIndex+=1),38===t.keyCode&&(a.selectedIndex-=1),13===t.keyCode&&(a.clickIndex(a.selectedIndex),e.disposeContextMenu()),9===t.keyCode&&(a.clickIndex(a.selectedIndex),t.preventDefault()),27===t.keyCode&&e.disposeContextMenu()}),h.addEventListener("keyup",function(){e.setFilter(t.cell.header.name,h.value)}),h.addEventListener("keyup",l),["focus","blur","keydown","keyup","change"].forEach(function(e){h.addEventListener(e,r)}),h.value=t.cell.header?e.columnFilters[t.cell.header.name]||"":"",d.innerHTML=e.attributes.filterOptionText.replace(/%s/g,f),u.onclick=function(){if(a)return e.disposeAutocomplete();l()},u.innerHTML=e.style.contextFilterButtonHTML,c.addEventListener("click",function(e){return e.stopPropagation()}),c.appendChild(d),c.appendChild(h),c.appendChild(u),t.items.push({title:c}),Object.keys(e.columnFilters).length&&Object.keys(e.columnFilters).forEach(function(o){var r=e.getHeaderByName(o);t.items.push({title:e.attributes.removeFilterOptionText.replace(/%s/g,r.title||r.name),click:function(t){t.preventDefault(),e.setFilter(o,""),e.controlInput.focus()}})})}function n(o){var n=!(o.cell.isBackground||o.cell.isColumnHeaderCellCap||o.cell.isScrollBar||o.cell.isCorner||o.cell.isRowHeader)&&o.cell.header;e.attributes.showFilter&&n&&r(o),e.attributes.showCopy&&e.selections.reduce(function(e,t){return e+t.length},0)>0&&o.items.push({title:e.attributes.copyText,click:function(){document.execCommand("copy"),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.showPaste&&e.clipBoardData&&o.items.push({title:e.attributes.pasteText,click:function(){e.paste(e.clipBoardData,o.cell.columnIndex,o.cell.rowIndex),e.draw()}}),e.attributes.showColumnSelector&&(o.items.push({title:e.attributes.columnSelectorText,items:function(){var o=[];return e.getSchema().forEach(function(r){function n(t){r.hidden=!r.hidden,e.dispatchEvent("togglecolumn",{column:r,hidden:r.hidden}),t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),e.resize(!0),e.setStorageData()}var l=document.createElement("div");t(l),l.addEventListener("touchstart",n),l.addEventListener("click",n),l.innerHTML=(r.hidden?e.attributes.columnSelectorHiddenText:e.attributes.columnSelectorVisibleText)+(r.title||r.name),o.push({title:l})}),o}}),o.cell&&o.cell.header&&o.cell.columnIndex>-1&&o.items.push({title:e.attributes.hideColumnText.replace(/%s/gi,o.cell.header.title||o.cell.header.name),click:function(t){e.getSchema()[o.cell.columnIndex].hidden=!0,t.preventDefault(),e.stopPropagation(t),e.disposeContextMenu(),e.setStorageData(),setTimeout(function(){e.resize(!0)},10)}})),e.attributes.saveAppearance&&e.attributes.showClearSettingsOption&&(Object.keys(e.sizes.rows).length>0||Object.keys(e.sizes.columns).length>0)&&o.items.push({title:e.attributes.clearSettingsOptionText,click:function(t){t.preventDefault(),e.sizes.rows={},e.sizes.columns={},e.createRowOrders(),e.createColumnOrders(),e.storedSettings=void 0,e.dispatchEvent("resizecolumn",{columnWidth:e.style.cellWidth}),e.dispatchEvent("resizerow",{cellHeight:e.style.cellHeight}),e.setStorageData(),e.resize(!0),e.disposeContextMenu(),e.controlInput.focus()}}),e.attributes.allowSorting&&e.attributes.showOrderByOption&&n&&(o.items.push({title:e.attributes.showOrderByOptionTextAsc.replace("%s",o.cell.header.title||o.cell.header.name),click:function(t){t.preventDefault(),e.order(o.cell.header.name,"asc"),e.controlInput.focus()}}),o.items.push({title:e.attributes.showOrderByOptionTextDesc.replace("%s",o.cell.header.title||o.cell.header.name),click:function(t){t.preventDefault(),e.order(o.cell.header.name,"desc"),e.disposeContextMenu(),e.controlInput.focus()}}))}var l,i,a;e.disposeAutocomplete=function(){a&&(a.dispose(),a=void 0)},e.disposeContextMenu=function(){document.removeEventListener("click",e.disposeContextMenu),l=e.style.contextMenuZIndex,e.disposeAutocomplete(),e.contextMenu&&e.contextMenu.dispose(),e.contextMenu=void 0},e.contextmenuEvent=function(t,r){function l(){requestAnimationFrame(function(){document.addEventListener("click",e.disposeContextMenu),document.removeEventListener("mouseup",l)})}if(e.hasFocus||t.target===e.canvas){var i,a=[],s=r||e.getLayerPos(t),c={NativeEvent:t,cell:e.getCellAt(s.x,s.y),items:a};c.cell.isGrid||n(c),e.dispatchEvent("contextmenu",c)||c.cell.isGrid||(e.contextMenu&&e.disposeContextMenu(),i={left:s.x+s.rect.left+e.style.contextMenuMarginLeft+e.canvasOffsetLeft,top:s.y+s.rect.top+e.style.contextMenuMarginTop+e.canvasOffsetTop,right:c.cell.width+c.cell.x+s.rect.left,bottom:c.cell.height+c.cell.y+s.rect.top,height:c.cell.height,width:c.cell.width},e.mobile&&(i.left=e.style.mobileContextMenuMargin+"px",i.width=e.width-2*e.style.mobileContextMenuMargin+"px"),e.contextMenu=o(c,i,a),document.addEventListener("mouseup",l),t.preventDefault())}}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.getClippingRect=function(t){var o=e.position(e.parentNode),r=e.position(t),n=e.scrollOffset(e.canvas),l={x:0,y:0,h:0,w:0},i={x:-1/0,y:-1/0,h:1/0,w:1/0},a=e.getColumnHeaderCellHeight(),s=e.getRowHeaderCellWidth();return o.top-=n.top,o.left-=n.left,r.top-=n.top,r.left-=n.left,l.h=o.top+o.height-t.offsetTop-e.style.scrollBarWidth,l.w=o.left+o.width-t.offsetLeft-e.style.scrollBarWidth,l.x=o.left+-1*r.left+s,l.y=o.top+-1*r.top+a,{x:l.x>i.x?l.x:i.x,y:l.y>i.y?l.y:i.y,h:l.he.data.length-1&&(l=0),e.scrollIntoView(r,l),e.beginEditAt(r,l,o)}}),e.dispatchEvent("beginedit",{cell:c,input:e.input}))}}},e.createInlineStyle=function(t,o){var r={"canvas-datagrid-context-menu-filter-input":{height:"19px",verticalAlign:"bottom",marginLeft:"2px",padding:"0",background:e.style.contextFilterInputBackground,color:e.style.contextFilterInputColor,border:e.style.contextFilterInputBorder,borderRadius:e.style.contextFilterInputBorderRadius,lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextFilterInputFontFamily,fontSize:e.style.contextFilterInputFontSize},"canvas-datagrid-context-menu-filter-button":{height:"19px",verticalAlign:"bottom",marginLeft:"2px",padding:"0",background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextFilterButtonBorder,borderRadius:e.style.contextFilterButtonBorderRadius,lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFilterButtonFontFamily,fontSize:e.style.contextMenuFilterButtonFontSize},"canvas-datagrid-context-child-arrow":{cssFloat:"right",color:e.style.childContextMenuArrowColor,fontSize:e.style.contextMenuChildArrowFontSize,fontFamily:e.style.contextMenuFontFamily,verticalAlign:"middle"},"canvas-datagrid-autocomplete":{fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,position:"absolute",zIndex:9999,overflow:"hidden"},"canvas-datagrid-autocomplete-item":{background:e.style.contextMenuBackground,color:e.style.contextMenuColor},"canvas-datagrid-autocomplete-item:hover":{background:e.style.contextMenuHoverBackground,color:e.style.contextMenuHoverColor},"canvas-datagrid-canvas":{position:"absolute",zIndex:"-1"},"canvas-datagrid":{display:"block"},"canvas-datagrid-control-input":{position:"fixed",top:"-5px",left:"-5px",border:"none",opacity:"0",cursor:"pointer",width:"1px",height:"1px",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize},"canvas-datagrid-edit-mobile-input":{boxSizing:"content-box",outline:"none",margin:"0",padding:"0 0 0 0",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.mobileEditFontFamily,fontSize:e.style.mobileEditFontSize,border:e.style.editCellBorder,color:e.style.editCellColor,background:e.style.editCellBackgroundColor,appearance:"none",webkitAppearance:"none",mozAppearance:"none",borderRadius:"0"},"canvas-datagrid-edit-input":{boxSizing:"content-box",outline:"none",margin:"0",padding:"0 0 0 "+e.style.editCellPaddingLeft+"px",lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.editCellFontFamily,fontSize:e.style.editCellFontSize,boxShadow:e.style.editCellBoxShadow,border:e.style.editCellBorder,color:e.style.editCellColor,background:e.style.editCellBackgroundColor,appearance:"none",webkitAppearance:"none",mozAppearance:"none",borderRadius:"0"},"canvas-datagrid-context-menu-item-mobile":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-context-menu-item":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,color:"inherit",background:"inherit",margin:e.style.contextMenuItemMargin,borderRadius:e.style.contextMenuItemBorderRadius,verticalAlign:"middle"},"canvas-datagrid-context-menu-item:hover":{background:e.style.contextMenuHoverBackground,color:e.style.contextMenuHoverColor},"canvas-datagrid-context-menu-label":{margin:e.style.contextMenuLabelMargin,display:e.style.contextMenuLabelDisplay,minWidth:e.style.contextMenuLabelMinWidth,maxWidth:e.style.contextMenuLabelMaxWidth},"canvas-datagrid-context-menu-mobile":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,overflow:"hidden",whiteSpace:"nowrap"},"canvas-datagrid-context-menu":{lineHeight:"normal",fontWeight:"normal",fontFamily:e.style.contextMenuFontFamily,fontSize:e.style.contextMenuFontSize,background:e.style.contextMenuBackground,color:e.style.contextMenuColor,border:e.style.contextMenuBorder,padding:e.style.contextMenuPadding,borderRadius:e.style.contextMenuBorderRadius,opacity:e.style.contextMenuOpacity,overflow:"hidden",whiteSpace:"nowrap",cursor:e.style.contextMenuCursor},"canvas-datagrid-invalid-search-regExp":{background:e.style.contextMenuFilterInvalidExpresion}};r[o]&&Object.keys(r[o]).map(function(e){t.style[e]=r[o][e]})},e.appendTo=function(t){e.parentNode=t,e.setDom()},e.setDom=function(){e.isChildGrid?(e.parentGrid=e.parentNode.parentGrid,e.ctx=e.parentGrid.context,e.canvas=e.parentGrid.canvas,e.controlInput=e.parentGrid.controlInput,e.eventParent=e.canvas):(e.controlInput=e.controlInput||document.createElement("input"),e.controlInput.onblur=e.intf.blur,e.createInlineStyle(e.controlInput,"canvas-datagrid-control-input"),e.isChildGrid=!1,e.parentDOMNode=e.parentNode,e.parentIsCanvas=/^canvas$/i.test(e.parentDOMNode.tagName),e.parentIsCanvas?e.canvas=e.parentDOMNode:(e.canvas=document.createElement("canvas"),e.intf.createShadowRoot&&e.parentDOMNode.appendChild(e.canvas)),document.body.appendChild(e.controlInput),e.createInlineStyle(e.canvas,"canvas-datagrid"),e.ctx=e.canvas.getContext("2d"),e.ctx.textBaseline="alphabetic",e.eventParent=e.canvas),e.parentNodeStyle=e.canvas.style,e.controlInput.setAttribute("readonly",!0),e.controlInput.addEventListener("blur",function(t){t.target!==e.canvas&&(e.hasFocus=!1)}),e.eventParent.addEventListener("scroll",e.resize,!1),e.eventParent.addEventListener("touchstart",e.touchstart,!1),e.eventParent.addEventListener("mouseup",e.mouseup,!1),e.eventParent.addEventListener("mousedown",e.mousedown,!1),e.eventParent.addEventListener("dblclick",e.dblclick,!1),e.eventParent.addEventListener("click",e.click,!1),e.eventParent.addEventListener("mousemove",e.mousemove),e[e.isChildGrid?"parentGrid":"eventParent"].addEventListener("wheel",e.scrollWheel,!1),e.canvas.addEventListener("contextmenu",e.contextmenuEvent,!1),e.controlInput.addEventListener("copy",e.copy),e.controlInput.addEventListener("cut",e.cut),e.controlInput.addEventListener("paste",e.paste),e.controlInput.addEventListener("keypress",e.keypress,!1),e.controlInput.addEventListener("keyup",e.keyup,!1),e.controlInput.addEventListener("keydown",e.keydown,!1),window.addEventListener("resize",e.resize)}}}.apply(t,r))&&(e.exports=n)},function(e,t,o){var r,n;r=[],void 0!==(n=function(){"use strict";return function(e){e.integerToAlpha=function(e){for(var t="a".charCodeAt(0),o="z".charCodeAt(0),r=o-t+1,n="";e>=0;)n=String.fromCharCode(e%r+t)+n,e=Math.floor(e/r)-1;return n},e.insertColumn=function(t,o){var r=e.getSchema();if(r.length0&&r.y>0&&r.x+r.widths;s+=1)l(s)}o||r||(e.selections=[],e.activeCell.columnIndex=t,e.activeCell.rowIndex=e.scrollIndexTop),o&&e.isColumnSelected(t)?function(t){e.data.forEach(function(o,r){e.selections[r]=e.selections[r]||[],-1!==e.selections[r].indexOf(t)&&e.selections[r].splice(e.selections[r].indexOf(t),1)})}(t):l(t),n||e.dispatchEvent("selectionchanged",{selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.getSelectionBounds()})},e.selectRow=function(t,o,r,n){function l(){n||e.dispatchEvent("selectionchanged",{selectedData:e.getSelectedData(),selections:e.selections,selectionBounds:e.selectionBounds})}function i(t){e.selections[t]=[],e.selections[t].push(-1),d.forEach(function(o,r){e.selections[t].push(e.orders.columns.indexOf(o.index))})}var a,s,c,d=e.getVisibleSchema();if((!1===e.dragAddToSelection||void 0===e.dragObject)&&e.selections[t]&&e.selections[t].length-1===d.length&&o)return e.selections[t]=[],void l();if(!0===e.dragAddToSelection||void 0===e.dragObject)if(r&&void 0===e.dragObject){if(!e.activeCell)return;for(s=Math.min(e.activeCell.rowIndex,t),c=Math.max(e.activeCell.rowIndex,t),a=s;c>=a;a+=1)i(a)}else i(t);l()},e.collapseTree=function(t){e.dispatchEvent("collapsetree",{childGrid:e.childGrids[t],data:e.data[t],rowIndex:t}),e.openChildren[t].blur(),e.openChildren[t].dispose(),delete e.openChildren[t],delete e.sizes.trees[t],delete e.childGrids[t],e.dispatchEvent("resizerow",{cellHeight:e.style.cellHeight}),e.resize(!0),e.draw(!0)},e.expandTree=function(t){var o,r=e.args.treeGridAttributes||{},n=e.getColumnHeaderCellHeight(),l=e.sizes.columns.cornerCell||e.style.rowHeaderCellWidth,i=e.sizes.trees[t]||e.style.treeGridHeight;e.childGrids[t]||(r.debug=e.attributes.debug,r.name=e.attributes.saveAppearance?e.attributes.name+"tree"+t:void 0,r.style=r.style||e.style,r.parentNode={parentGrid:e.intf,nodeType:"canvas-datagrid-tree",offsetHeight:i,offsetWidth:e.width-l,header:{width:e.width-l},offsetLeft:l,offsetTop:n,offsetParent:e.intf.parentNode,parentNode:e.intf.parentNode,style:"tree",data:e.data[t]},o=e.createGrid(r),e.childGrids[t]=o),o=e.childGrids[t],o.visible=!0,e.dispatchEvent("expandtree",{treeGrid:o,data:e.data[t],rowIndex:t}),e.openChildren[t]=o,e.sizes.trees[t]=i,e.dispatchEvent("resizerow",{height:e.style.cellHeight}),e.resize(!0)},e.toggleTree=function(t){if(e.openChildren[t])return e.collapseTree(t);e.expandTree(t)},e.getHeaderByName=function(t){var o,r=e.getSchema();for(o=0;o0;var r,n=e.visibleCells.length;for(r=0;re.width||t.y<0||t.y>e.height)},e.moveSelection=function(t,o){var r=[];e.selections.forEach(function(e,n){r[n+o]=[],e.forEach(function(e){r[n+o].push(e+t)})}),e.selections=r},e.moveTo=function(t,o,r){var n,l=e.getSelectedData(),i=e.getVisibleSchema(),a=t.length,s=-1/0,c=1/0,d=r-1;t.forEach(function(t,r){r!==a&&0!==t.length&&(c=Math.min(e.getVisibleColumnIndexOf(o),c),s=Math.max(s,t.length),t.forEach(function(t){t=e.getVisibleColumnIndexOf(t),i[t]&&(e.data[r]||(e.data[r]={}),e.data[r][i[t].name]=null)}))}),t.forEach(function(t,r){var a;d+=1,n=e.getVisibleColumnIndexOf(o),t.forEach(function(t,o){t=e.getVisibleColumnIndexOf(t),o>0&&(n+=t-a),a=t,-1===t||!i[n]||!i[t]||e.data.length-10},e.isRowVisible=function(t){return e.visibleCells.filter(function(e){return e.rowIndex===t}).length>0},e.getVisibleCellByIndex=function(t,o){return e.visibleCells.filter(function(e){return e.columnIndex===t&&e.rowIndex===o})[0]},e.getCellAt=function(t,o,r){if(e.visibleCells){var n,l,i,a,s,c=r?e.attributes.touchScrollZone:0,d="move"===e.attributes.borderDragBehavior,u=e.visibleCells.length,h=d?e.cursorGrab:"ew-resize",f=d?e.cursorGrab:"ns-resize";if(e.visibleCells&&e.visibleCells.length){if(e.hasFocus=!0,!(o0&&t0))return e.hasFocus=!1,{dragContext:"inherit",context:"inherit"};for(l=0;lt&&s.y-e.style.cellBorderWidtho){if(/frozen-row-marker/.test(a.style))return a.dragContext=a.style,a.context="row-resize",a;if(/frozen-column-marker/.test(a.style))return a.dragContext=a.style,a.context="col-resize",a;if(/selection-handle-/.test(a.style))return a.dragContext=a.style,a.context="crosshair",a;if(/vertical-scroll-(bar|box)/.test(a.style))return a.dragContext="vertical-scroll-box",a.context="vertical-scroll-box",a.isScrollBar=!0,a.isVerticalScrollBar=!0,o>e.scrollBox.box.v.y+e.scrollBox.scrollBoxHeight?(a.dragContext="vertical-scroll-bottom",a.context="vertical-scroll-bottom"):oe.scrollBox.box.h.x+e.scrollBox.scrollBoxWidth?(a.dragContext="horizontal-scroll-right",a.context="horizontal-scroll-right"):tt?"r":r.x-.4*e.attributes.borderResizeZonet?"l":r.y+r.height-.4*e.attributes.borderResizeZoneo?"b":r.y-.4*e.attributes.borderResizeZoneo?"t":void 0}(s),i=d&&a.selectionBorder&&-1!==a.selectionBorder.indexOf(n),-1!==["l","r"].indexOf(n)&&(e.attributes.allowColumnResize||i)&&(e.attributes.allowColumnResizeFromCell&&a.isNormal||!a.isNormal||i)&&(e.attributes.allowRowHeaderResize&&(a.isRowHeader||a.isCorner)||!a.isRowHeader||!a.isCorner)){if((a.isColumnHeader||a.isCorner||e.attributes.allowColumnResizeFromCell&&a.isNormal)&&"r"===n)return a.context="ew-resize",a.dragContext="ew-resize",a;if(!a.isColumnHeader&&!a.isCorner&&i)return a.context=h,a.dragContext=n+"-move",a}if(-1!==["t","b"].indexOf(n)&&a.rowIndex>-1&&(e.attributes.allowRowResize||i)&&(e.attributes.allowRowResizeFromCell&&a.isNormal||!a.isNormal||i)&&!a.isColumnHeader){if((a.isRowHeader||a.isCorner||e.attributes.allowRowResizeFromCell&&a.isNormal)&&"b"===n)return a.context="ns-resize",a.dragContext="ns-resize",a;if(!a.isRowHeader&&!a.isCorner&&i)return a.context=f,a.dragContext=n+"-move",a}return"columnHeaderCell"===a.style?(a.context="cell",a.dragContext="column-reorder",a):"rowHeaderCell"===a.style?(e.attributes.rowGrabZoneSize+(a.y-e.style.cellBorderWidth)o.y?r:o.y,n=Math.max.apply(null,e),l=Math.min.apply(null,e),t.x=lo.x?n:o.x}),{top:t.y,left:t.x,bottom:o.y,right:o.x}},e.getSchemaFromData=function(t){return t=t||e.data,Object.keys(t[0]||{" ":""}).map(function(o,r){var n=e.getBestGuessDataType(o,t),l={name:o,title:isNaN(parseInt(o,10))?o:e.integerToAlpha(o).toUpperCase(),index:r,type:n,filter:e.filter(n)};return e.storedSettings&&e.storedSettings.visibility&&void 0!==e.storedSettings.visibility[l.name]&&(l.hidden=!e.storedSettings.visibility[l.name]),l})},e.clearChangeLog=function(){e.changes=[]},e.selectArea=function(t,o){e.selectionBounds=t||e.selectionBounds;var r,n,l,i=e.getSchema();if(o||(e.selections=[]),e.selectionBounds.top<-1||e.selectionBounds.bottom>e.data.length||e.selectionBounds.left<-1||e.selectionBounds.right>i.length)throw new Error("Impossible selection area");for(n=e.selectionBounds.top;n<=e.selectionBounds.bottom;n+=1)for(e.selections[n]=[],l=e.selectionBounds.left;l<=e.selectionBounds.right;l+=1)-1===e.selections[n].indexOf(l)&&e.selections[n].push(l);r={selections:e.selections,selectionBounds:e.selectionBounds},Object.defineProperty(r,"selectedData",{get:function(){return e.getSelectedData()}}),e.dispatchEvent("selectionchanged",r)},e.findColumnMaxTextLength=function(t){var o=-1/0;return"cornerCell"===t?(e.ctx.font=e.style.rowHeaderCellFont,e.ctx.measureText((e.data.length+(e.attributes.showNewRow?1:0)).toString()).width+e.style.autosizePadding+e.style.autosizeHeaderCellPadding+e.style.rowHeaderCellPaddingRight+e.style.rowHeaderCellPaddingLeft+(e.attributes.tree?e.style.treeArrowWidth+e.style.treeArrowMarginLeft+e.style.treeArrowMarginRight:0)):(e.getSchema().forEach(function(r){if(r.name===t){e.ctx.font=e.style.columnHeaderCellFont;var n=e.ctx.measureText(r.title||r.name).width+e.style.headerCellPaddingRight+e.style.headerCellPaddingLeft;o=n>o?n:o}}),e.data.forEach(function(r){e.ctx.font=e.style.cellFont;var n=e.ctx.measureText(r[t]).width+e.style.cellPaddingRight+e.style.cellPaddingLeft+e.style.cellAutoResizePadding;o=n>o?n:o}),o)},e.getHeaderWidth=function(){return e.getVisibleSchema().reduce(function(t,o){return t+(o.width||e.style.cellWidth)},0)},e.getRowHeight=function(t){return(e.sizes.rows[t]||e.style.cellHeight)*e.scale},e.getColummnWidth=function(t){return(e.sizes.columns[t]||e.getSchema()[t].width||e.style.cellWidth)*e.scale},e.formatters.string=function(e){return void 0!==e.cell.value?e.cell.value:""},e.formatters.rowHeaderCell=e.formatters.string,e.formatters.headerCell=e.formatters.string,e.formatters.number=e.formatters.string,e.formatters.int=e.formatters.string,e.formatters.html=e.formatters.string,e.sorters.string=function(e,t){var o="asc"===t;return function(t,r){return void 0===t[e]||null===t[e]?1:void 0===r[e]||null===r[e]?0:o?t[e].localeCompare?t[e].localeCompare(r[e]):1:r[e].localeCompare?r[e].localeCompare(t[e]):1}},e.sorters.number=function(e,t){var o="asc"===t;return function(t,r){return o?t[e]-r[e]:r[e]-t[e]}},e.sorters.date=function(e,t){var o="asc"===t;return function(t,r){return o?new Date(t[e]).getTime()-new Date(r[e]).getTime():new Date(r[e]).getTime()-new Date(t[e]).getTime()}}}}.apply(t,r))&&(e.exports=n)}])}); //# sourceMappingURL=canvas-datagrid.map \ No newline at end of file diff --git a/dist/canvas-datagrid.map b/dist/canvas-datagrid.map index 4f1c691e..e0207390 100644 --- a/dist/canvas-datagrid.map +++ b/dist/canvas-datagrid.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///canvas-datagrid.js","webpack:///webpack/bootstrap bdbb6fa182739ed17bed","webpack:///./lib/defaults.js","webpack:///./lib/main.js","webpack:///./lib/component.js","webpack:///./lib/draw.js","webpack:///./lib/events.js","webpack:///./lib/touch.js","webpack:///./lib/intf.js","webpack:///./lib/contextMenu.js","webpack:///./lib/dom.js","webpack:///./lib/publicMethods.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","undefined","defaults","attributes","styles","apply","context","component","Grid","args","isComponent","isChildGrid","parentNode","test","nodeType","intf","eval","document","createElement","applyComponentStyle","hyphenateProperty","dehyphenateProperty","createGrid","forEach","shadowRoot","createShadowRoot","attachShadow","mode","init","Array","slice","arguments","window","HTMLElement","create","customElements","observedAttributes","getObservableAttributes","disconnectedCallback","attributeChangedCallback","connectedCallback","adoptedCallback","canvasDatagrid","require","tKeys","body","keys","argKey","indexOf","tKey","sKey","data","appendChild","getDefaultItem","base","item","filter","toLowerCase","typeMap","prop","replace","nextLetterCap","char","toUpperCase","cust","supressChangeAndDrawEvents","cStyle","getComputedStyle","tagName","canvas","defs","computedStyle","def","val","getPropertyValue","setStyleProperty","dispatchEvent","requestAnimationFrame","resize","style","strData","JSON","parse","e","Error","schema","strSchema","number","strNum","parseInt","isNaN","boolean","strBool","string","str","attrs","attr","push","connected","parentDOMNode","innerHTML","observe","attrName","oldVal","newVal","tfn","dataType","addEventListener","observer","MutationObserver","mutations","checkInnerHTML","checkStyle","mutation","attributeName","target","nodeName","addedNodes","length","type","characterData","childList","subtree","querySelectorAll","el","fillArray","low","high","step","x","drawPerfLine","w","h","y","perfArr","arrIndex","max","color","useAbs","r","canvasOffsetLeft","canvasOffsetTop","ctx","beginPath","moveTo","cx","cy","Math","abs","lineTo","strokeStyle","stroke","drawOnAllImagesLoaded","loaded","htmlImageCache","html","complete","cachedImagesDrawn","draw","drawHtml","cell","img","v","formattedValue","cacheKey","toString","rowIndex","columnIndex","height","width","drawImage","Image","onload","src","btoa","drawOrderByArrow","mt","columnHeaderOrderByArrowMarginTop","scale","ml","columnHeaderOrderByArrowMarginLeft","mr","columnHeaderOrderByArrowMarginRight","aw","columnHeaderOrderByArrowWidth","ah","columnHeaderOrderByArrowHeight","fillStyle","columnHeaderOrderByArrowColor","columnHeaderOrderByArrowBorderColor","orderDirection","fill","drawTreeArrow","treeArrowMarginTop","treeArrowMarginRight","treeArrowMarginLeft","treeArrowWidth","treeArrowHeight","treeArrowColor","treeArrowBorderColor","openChildren","radiusRect","radius","b","quadraticCurveTo","fillRect","strokeRect","fillText","text","fillCircle","arc","PI","strokeCircle","clipFrozenArea","lastFrozenColumnPixel","lastFrozenRowPixel","clip","fillHandle","selectionHandleType","strokeHandle","addselectionHandle","pos","hw","selectionHandleSize","tr","br","tl","bl","addBorderLine","t","wrapText","splitChar","lines","value","calculatedLineHeight","word","elWidth","plWidth","clippedVal","previousLine","words","split","textHeight","wrap","cellWhiteSpace","et","ellipsisText","line","cHeight","paddedHeight","measureText","measure","paddedWidth","splice","originText","stepLength","direction","substr","drawText","fontHeight","lineHeight","vPos","hPos","paddingLeft","orderByArrowWidth","horizontalAlignment","paddingRight","verticalAlignment","paddingBottom","lineSpacing","offsetLeft","offsetTop","debug","active","font","debugFont","debugColor","stringify","pw","idx","idx_ord","sortColumnIndex","map","getFrozenColumnsWidth","column","getSchema","min","frozenColumn","hiddenFrozenColumnCount","hidden","getColummnWidth","perfCounters","drawCount","perfWindowSize","entityCount","scrollDebugCounters","touchPPSCounters","internal","createHandlesOverlayArray","allowMovingSelection","mobile","selectionBorderTop","selectionBorderRight","selectionHandles","selectionHandle","selectionBorderLeft","selectionBorderBottom","selectionHandleBehavior","createBorderOverlayArray","drawArray","propPrefix","offsetPoint","selectionBorder","isRowHeader","selections","isHeader","drawCell","rowOrderIndex","header","headerIndex","columnOrderIndex","cellGridAttributes","cellStyle","isCorner","isColumnHeader","selected","hovered","hovers","activeCell","isColumnHeaderCellCap","rawValue","isGrid","activeHeader","orders","rows","columns","f","formatters","orderByArrowSize","treeArrowSize","cellWidth","sizes","ev","row","cellBorderWidth","visibleRows","paddingTop","whiteSpace","cellLineHeight","cellLineSpacing","scrollTop","scrollBox","scrollLeft","cellHeight","offsetWidth","offsetHeight","offsetParent","rowOpen","sortRowIndex","isNormal","gridId","parentGrid","title","userHeight","rowHeight","userWidth","cornerCell","visibleCells","unshift","lineWidth","cellHeightWithChildGrid","checkScrollHeight","cellWidthWithChildGrid","save","tree","showRowNumbers","childGrids","saveAppearance","cellGridHeight","grid","visible","orderBy","console","warn","columnFilters","filterTextPrefix","aCell","selectionBorders","movingSelection","moveBorders","moveOffset","restore","bc","drawRowHeader","rowData","index","a","showRowHeaders","rowHeaderCell","rowHeaderCellWidth","drawRow","treeHeight","rowSansTreeHeight","g","rd","trees","scrollIndexRight","scrollPixelRight","scrollPixelLeft","treeGrid","scrollBarWidth","rowHeaders","visibleRowHeights","gridBorderCollapse","u","currentCell","columnHeaderCellHeight","getColumnHeaderCellHeight","getRowHeaderCellWidth","performance","now","createRowOrders","gridBackgroundColor","ln","frozenRow","allowFreezingRows","frozenMarkerBorderWidth","frozenMarkerWidth","snapToRow","scrollPixelTop","scrollIndexTop","scrollIndexBottom","scrollPixelBottom","showNewRow","scrollIndexLeft","newRow","cl","selectionMode","activeCellOverlayBorderWidth","activeCellOverlayBorderColor","getHeaderWidth","drawHeaderColumnRange","start","end","order","columnHeaderCell","nonFrozenHeaderWidth","rArgs","rhIndex","showColumnHeaders","columnHeaderCellBorderWidth","isColumnHeaderCell","endCap","my","mx","xHover","yHover","allowFreezingColumns","frozenMarkerHoverColor","frozenMarkerColor","frozenMarkerHoverBorderColor","frozenMarkerBorderColor","freezeMarkerPosition","frozenMarkerActiveColor","frozenMarkerActiveBorderColor","dragMode","selectionHandleBorderWidth","selectionHandleBorderColor","selectionHandleColor","az","touchSelectHandleZone","ax","ay","reorderObject","dragOffset","reorderMarkerBackgroundColor","reorderMarkerBorderWidth","reorderMarkerBorderColor","reorderMarkerIndexBorderWidth","reorderMarkerIndexBorderColor","reorderTarget","moveOverlayBorderWidth","moveOverlayBorderColor","setLineDash","moveOverlayBorderSegments","gridBorderWidth","gridBorderColor","dsb","selectionOverlayBorderWidth","selectionOverlayBorderColor","drawCorner","en","entities","scrollBarBoxMargin","scrollBarBorderColor","scrollBarBorderWidth","horizontalBox","horizontalBar","scrollBoxWidth","scrollWidth","verticalBox","verticalBar","scrollBoxHeight","scrollHeight","horizontalBarVisible","scrollBarBackgroundColor","scrollBarBoxColor","horizontalBoxVisible","scrollBarActiveColor","scrollBarBoxBorderRadius","verticalBarVisible","verticalBoxVisible","scrollBarCornerBorderColor","scrollBarCornerBackgroundColor","corner","showPerformance","pop","perf","reduce","toFixed","perfDelta","frozenColumnsWidth","htmlImages","startScale","scaleDelta","zoomDeltaStart","touchLength","touches","touchPosition","touchPosition1","scrollIndex","scrollPixel","canvasOffset","touchDelta","touchAnimateTo","scrollAnimation","touchPPS","xPPS","yPPS","touchPPST","xPPST","yPPST","touchDuration","pointerLockPosition","size","mouse","touch","touchStart","hasFocus","dragContext","textAlign","debugBackgroundColor","key","dpl","ph","px","py","debugPerfChartTextColor","debugPerfChartBackground","debugScrollHeightColor","debugScrollWidthColor","debugPerformanceColor","debugEntitiesColor","debugTouchPPSXColor","debugTouchPPSYColor","wheeling","stopPropagation","fn","events","removeEventListener","sfn","preventDefault","defaultPrevented","getRatio","maxPixelRatio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","drawAfterResize","checkScrollBoxVisibility","dataWidth","overflowX","dataHeight","overflowY","setScrollBoxSize","setCanvasSize","dims","cellBorder","dim","appliedInlineStyles","parentNodeStyle","isComponet","vb","nb","co","isScrollBoxCorner","sbw","ratio","bm","columnHeaderCellBorder","ch","scrollCache","accumulator","va","top","left","widthBoxRatio","heightBoxRatio","scrollBarBoxMinSize","scrollBarBoxWidth","bar","box","page","pageUpDownOverlap","resizeEditInput","scroll","dontDraw","floor","ellipsisCache","mousemove","overridePos","contextMenu","input","getLayerPos","dragBounds","sBounds","delta","ctrl","ctrlKey","metaKey","persistantSelectionMode","getCellAt","NativeEvent","previousCell","clearTimeout","scrollTimer","isInGrid","rowBoundaryCrossed","columnBoundaryCrossed","cellBoundaryCrossed","prefix","draggingItem","scrollModes","dragItem","cursor","selecting","dragStart","dragStartObject","shiftKey","bottom","right","getSelectionBounds","ignoreNextClick","dragAddToSelection","selectRow","selectionBounds","selectArea","autoScrollZone","click","checkSelectionChange","sb","startingBounds","getSelectedData","endEdit","setActiveCell","selectAll","columnHeaderClickBehavior","selectColumn","treeArrowClickRadius","toggleTree","dragResizeColumn","resizingStartingWidth","resizingStartingHeight","minColumnWidth","minRowHeight","resizeScrollZone","resizeChildGrids","globalRowResize","stopDragResize","setStorageData","scrollGrid","scrollPointerLock","scrollStartMode","movementX","movementY","scrollMode","scrollStart","setTimeout","scrollRepeatRate","selectionScrollIncrement","stopScrollGrid","exitPointerLock","dragReorder","columReorder","rowReorder","allowColumnReordering","allowRowReordering","source","reorderDeadZone","stopDragReorder","oIndex","tIndex","cr","row-reorder","column-reorder","dragMove","stopDragMove","moveSelection","freezeMove","stopFreezeMove","startFreezeMove","mousedown","lastMouseDownTarget","button","move","freeze","requestPointerLock","concat","dragging","mouseup","controlInput","focus","getAdjacentCells","first","last","keydown","adjacentCells","cols","keyCode","beginEditAt","Number","scrollIntoView","selectionFollowsActiveCell","selectedData","keyup","keypress","dblclick","fitColumnToValues","autosize","scrollWheel","deltaX","deltaY","deltaMode","touchHaltAnimation","scrollTo","pasteItem","clipData","mimeType","normalizeRowData","importingRow","existingRow","offsetX","isArray","colKey","substring","sel","cellData","colIndex","cName","getVisibleSchema","yi","getNextVisibleColumnIndex","visibleColumnIndex","getVisibleColumnIndexOf","paste","clipboardData","items","dti","getAsString","cut","copy","forEachSelectedCell","colName","htmlSafe","fCopyCell","addHeaders","headers","useHtml","hVal","join","addCellValue","trRow","textRow","outputHeaderKeys","tableRows","textRows","outputHeaders","sData","rowKeys","sSorted","setData","touchMove","touchScroll","rScrollZone","bScrollZone","tScrollZone","lScrollZone","touchScrollTimeout","rw","t1","t2","changedTouches","getTouchPos","touchDeadZone","touchContextTimeout","touchZoomSensitivity","touchZoomMin","touchZoomMax","zoomAltered","selectionScrollZone","calculatePPS","touchScrollStart","stopAnimation","animationFrames","touchSelecting","startingCell","touchSelect","touchMoving","touchIndex","rect","getBoundingClientRect","clientX","clientY","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easing","touchEasingMethod","calculatePPSTimed","touchSigmaTimed","touchSigma","touchEndAnimation","touchReleaseAnimationDurationMs","touchEditCell","touchCell","clearInterval","calculatePPSTimer","touchingCell","editCell","touchstart","disposeContextMenu","touchStartEvent","touchStart1","contextmenuEvent","touchContextMenuTimeMs","setInterval","touchEndEvents","touchmove","passive","touchend","touchcancel","handleType","bounds","dz","touchReleaseAcceleration","scrollAnimationPPSThreshold","ctor","treeGridAttributes","storageName","invalidSearchExpClass","localStyleLibraryStorageKey","filters","currentFilter","sorters","parsers","schemaHashes","changes","componentL1Events","eventNames","expandToRow","col","orderedIndex","visibility","localStorage","setItem","tempSchema","createColumnOrders","applyDefaultValue","defaultValue","createNewRowData","getSchemaNameHash","getBestGuessDataType","columnName","drawChildGrids","gridKey","setTimer","refreshFromOrigialData","originalData","validateColumn","setDefaults","obj1","obj2","setAttributes","setStyle","findColumnMaxTextLength","dispose","removeChild","eventParent","contextmenu","disconnect","tryLoadStoredSettings","reloadStoredValues","storedSettings","getHeaderByName","getDomRoot","host","getFontName","fontStyle","getFontHeight","parseFloat","parseStyleValue","initProp","propName","getStyleProperty","styleKeys","supressDrawAndEvent","isDim","getItem","message","addStyleKeyIfNoneExists","initialized","publicStyleKeyIntf","initScrollBox","setDom","ie","navigator","userAgent","edge","webKit","moz","cursorGrab","cursorGrabing","cursorGrabbing","appendTo","getVisibleCellByIndex","clearChangeLog","gotoCell","gotoRow","findColumnScrollLeft","findRowScrollTop","isCellVisible","isRowVisible","isColumnVisible","clipElement","getSchemaFromData","setFilter","expandTree","collapseTree","insertRow","deleteRow","addRow","insertColumn","deleteColumn","addColumn","getClippingRect","setRowHeight","setColumnWidth","resetColumnWidths","resetRowHeights","selectNone","assertPxColor","clearPxColorAssertions","integerToAlpha","DOMStyles","set","valueObject","filterFor","String","filterRegExp","regEnd","pattern","exec","flags","flagLength","invalidFilterRegEx","RegExp","toLocaleUpperCase","innerText","textContent","blur","TypeError","currentCursor","find","eventName","RangeError","getTypes","parseInnerHtml","callback","etl","autoGenerateSchema","autoResizeColumns","setScrollTop","preventScrollEvent","setScrollLeft","sHeight","sWidth","supressDrawEvent","applyContextItemStyle","contextItemContainer","createInlineStyle","createContextMenu","parentContextMenu","createItems","removeChildContext","relatedTarget","container","childMenuArrow","contains","children","setAttribute","contextAddCallback","getAttribute","cPos","childContextMenuMarginLeft","childContextMenuMarginTop","createChildContext","addContent","content","childContextMenuArrowHTML","clickIndex","Event","checkArrowVisibility","upArrow","downArrow","startHoverScroll","contextHoverScrollAmount","hoverScrollTimeout","contextHoverScrollRateMs","endHoverScroll","selectedIndex","loc","scrollOffset","zIndexTop","contextMenuZIndex","position","contextMenuArrowColor","zIndex","inputDropdown","maxHeight","innerHeight","autocompleteBottomMargin","minWidth","contextMenuArrowUpHTML","contextMenuArrowDownHTML","contextMenuWindowMargin","innerWidth","isFinite","createFilterContextMenuItems","checkRegExpErrorState","filterInput","background","contextFilterInputBackground","contextFilterInputColor","contextFilterInvalidRegExpBackground","contextFilterInvalidRegExpColor","fillAutoComplete","count","autoCompleteItems","maxAutoCompleteItems","disposeAutocomplete","createAutoCompleteContext","iRect","autoCompleteContext","filterContainer","filterLabel","filterAutoCompleteButton","onclick","filterOptionText","contextFilterButtonHTML","cf","removeFilterOptionText","addDefaultContextMenuItem","isNormalCell","isBackground","isScrollBar","showFilter","showCopy","copyText","execCommand","showPaste","clipBoardData","pasteText","showColumnSelector","columnSelectorText","toggleColumnVisibility","columnSelectorHiddenText","columnSelectorVisibleText","hideColumnText","showClearSettingsOption","clearSettingsOptionText","columnWidth","allowSorting","showOrderByOption","showOrderByOptionTextAsc","showOrderByOptionTextDesc","createDiposeEvent","contextPosition","contextMenuMarginLeft","contextMenuMarginTop","mobileContextMenuMargin","ele","boundingRect","eleRect","clipRect","parentRect","Infinity","scrollingElement","borderWidth","mobileEditInputHeight","cellPaddingLeft","ignoreScrollOffset","abort","abortEdit","newValue","oldValue","aborted","editable","enumItems","enu","option","valueInEnum","multiLine","editCellZIndex","fontSize","editCellFontSize","nx","ny","className","css","canvas-datagrid-context-menu-filter-input","verticalAlign","marginLeft","padding","border","contextFilterInputBorder","borderRadius","contextFilterInputBorderRadius","fontWeight","fontFamily","contextFilterInputFontFamily","contextFilterInputFontSize","canvas-datagrid-context-menu-filter-button","contextMenuBackground","contextMenuColor","contextFilterButtonBorder","contextFilterButtonBorderRadius","contextMenuFilterButtonFontFamily","contextMenuFilterButtonFontSize","canvas-datagrid-context-child-arrow","cssFloat","childContextMenuArrowColor","contextMenuChildArrowFontSize","contextMenuFontFamily","canvas-datagrid-autocomplete","contextMenuFontSize","contextMenuBorder","contextMenuPadding","contextMenuBorderRadius","opacity","contextMenuOpacity","overflow","canvas-datagrid-autocomplete-item","canvas-datagrid-autocomplete-item:hover","contextMenuHoverBackground","contextMenuHoverColor","canvas-datagrid-canvas","canvas-datagrid","display","canvas-datagrid-control-input","canvas-datagrid-edit-mobile-input","boxSizing","outline","margin","mobileEditFontFamily","mobileEditFontSize","editCellBorder","editCellColor","editCellBackgroundColor","appearance","webkitAppearance","mozAppearance","canvas-datagrid-edit-input","editCellPaddingLeft","editCellFontFamily","boxShadow","editCellBoxShadow","canvas-datagrid-context-menu-item-mobile","contextMenuItemMargin","contextMenuItemBorderRadius","canvas-datagrid-context-menu-item","canvas-datagrid-context-menu-item:hover","canvas-datagrid-context-menu-label","contextMenuLabelMargin","contextMenuLabelDisplay","contextMenuLabelMinWidth","maxWidth","contextMenuLabelMaxWidth","canvas-datagrid-context-menu-mobile","canvas-datagrid-context-menu","contextMenuCursor","canvas-datagrid-invalid-search-regExp","contextMenuFilterInvalidExpresion","onblur","parentIsCanvas","getContext","textBaseline","ordA","charCodeAt","ordZ","len","fromCharCode","applyFilter","offsetY","targetX","targetY","sbh","isColumnSelected","colIsSelected","shift","supressEvent","addCol","de","ri","st","dragObject","childGrid","trArgs","treeGridHeight","sortFunction","dontSetStorageData","sort","xi","maxRowLength","minXi","lastSourceIndex","cidx","useTouchScrollZones","moveBorder","entitiy","tsz","touchScrollZone","moveMode","borderDragBehavior","xBorderBehavior","yBorderBehavior","isVerticalScrollBar","isHorizontalScrollBar","borderResizeZone","allowColumnResize","allowColumnResizeFromCell","allowRowHeaderResize","allowRowResize","allowRowResizeFromCell","rowGrabZoneSize","maxCol","minCol"," ","rowHeaderCellFont","autosizePadding","autosizeHeaderCellPadding","rowHeaderCellPaddingRight","rowHeaderCellPaddingLeft","columnHeaderCellFont","headerCellPaddingRight","headerCellPaddingLeft","cellFont","cellPaddingRight","cellAutoResizePadding","total","getRowHeight","headerCell","int","asc","localeCompare","date","Date","getTime"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,eAAAD,IAEAD,EAAA,eAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB,EAAA,GAGAvB,IAAAwB,EAAA,KDgBM,SAAU9B,EAAQD,EAASO,GE7EjC,GAAAyB,GAAAC,CAEAD,UAkTCE,MAlTQD,EAAA,WACT,YACA,iBAAA7B,GACAA,EAAA+B,UACAC,aACA,6BACA,yBACA,iCACA,yBACA,4BACA,4BACA,4BACA,0BACA,sBACA,8BACA,oBACA,0BACA,yBACA,8BACA,wBACA,mDACA,qCACA,kDACA,4CACA,kCACA,+BACA,+BACA,8BACA,oBACA,aACA,gBACA,uBACA,iCACA,mCACA,uBACA,6BACA,6BACA,iBACA,YACA,wBACA,sBACA,+BACA,iDACA,sBACA,wBACA,sBACA,sBACA,oCACA,yBACA,wBACA,kCACA,mCACA,yBACA,gCACA,2BACA,+BACA,yBACA,0BACA,gBACA,kBACA,kBACA,yBACA,qDACA,uDACA,iBACA,uBACA,sBACA,sBACA,iBACA,+BACA,oBACA,oCACA,iCACA,wCACA,uBACA,6BACA,8BACA,oBACA,sBACA,oBACA,YACA,4BAEAC,SACA,uDACA,mDACA,4BACA,uCACA,qCACA,4DACA,yCACA,4CACA,yDACA,mCACA,8BACA,4BACA,6BACA,2BACA,+DACA,+CACA,yCACA,mEACA,mDACA,gEACA,gDACA,gCACA,gCACA,sBACA,6BACA,iDACA,6CACA,sBACA,iCACA,+BACA,uBACA,kBACA,gCACA,mCACA,sDACA,sCACA,wBACA,sBACA,uBACA,qBACA,yDACA,yCACA,mCACA,kBACA,+BACA,4BACA,qBACA,sBACA,qDACA,yCACA,mCACA,iCACA,6DACA,yDACA,kCACA,gEACA,4DACA,qCACA,gDACA,2CACA,8BACA,+CACA,kEACA,kDACA,oCACA,kCACA,mCACA,iCACA,+CACA,iEACA,0CACA,2DACA,qCACA,yCACA,0CACA,wCACA,qCACA,iEACA,0CACA,uCACA,uDACA,gEACA,uCACA,4CACA,8CACA,sCACA,8DACA,6DACA,gDACA,wCACA,sCACA,mDACA,yDACA,kCACA,yCACA,2CACA,gCACA,mDACA,2CACA,+DACA,uCACA,+BACA,wDACA,iDACA,sCACA,gCACA,2CACA,uCACA,qCACA,oCACA,4BACA,4BACA,8BACA,6BACA,+BACA,0BACA,uDACA,mDACA,6CACA,sCACA,kDACA,gCACA,sDACA,uDACA,qDACA,sDACA,oDACA,mDACA,kDACA,2BACA,oCACA,sDACA,kDACA,0BACA,oCACA,4BACA,0BACA,uBACA,oDACA,0DACA,qDACA,2DACA,+CACA,qDACA,8BACA,wBACA,iDACA,kCACA,6CACA,sBACA,kBACA,wBACA,uBACA,sBACA,wBACA,oBACA,uBACA,+BACA,6BACA,sCACA,8BACA,6BACA,mDACA,sCACA,mBACA,qBACA,qBACA,sDACA,kDACA,kCACA,0DACA,uCACA,0DACA,sDACA,+BACA,6CACA,wCACA,2BACA,4CACA,+DACA,+CACA,iCACA,+BACA,gCACA,8BACA,kEACA,qDACA,4CACA,0BACA,kDACA,sDACA,kDACA,4BACA,mCACA,+CACA,yBACA,2BACA,wBACA,4DACA,wDACA,sBACA,wDACA,mCACA,iDACA,0BACA,iCACA,wDACA,kCACA,kDACA,2BACA,2BACA,4CACA,sBACA,0BACA,2BACA,yBACA,sBACA,uBACA,oBAICC,MAAAtC,EAAAgC,M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AAApf,EAAAof,KAGA75B,EAAA04B,QAAA2Z,KAAA,SAAAxY,EAAAhoB,GACA,GAAAsgC,GAAA,QAAAtgC,CACA,iBAAA4I,EAAAjM,GACA,MAAA2jC,GACA,GAAAG,MAAA73B,EAAAof,IAAA0Y,UACA,GAAAD,MAAA9jC,EAAAqrB,IAAA0Y,UAEA,GAAAD,MAAA9jC,EAAAqrB,IAAA0Y,UACA,GAAAD,MAAA73B,EAAAof,IAAA0Y,cAICrwC,MAAAtC,EAAAgC,MAAA/B,EAAAD,QAAAiC","file":"canvas-datagrid.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(2),\n __webpack_require__(0),\n __webpack_require__(3),\n __webpack_require__(4),\n __webpack_require__(5),\n __webpack_require__(6),\n __webpack_require__(7),\n __webpack_require__(8),\n __webpack_require__(9)\n], __WEBPACK_AMD_DEFINE_RESULT__ = (function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n throw new Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.');\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// canvas-datagrid.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap bdbb6fa182739ed17bed","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 0\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([\n './component',\n './defaults',\n './draw',\n './events',\n './touch',\n './intf',\n './contextMenu',\n './dom',\n './publicMethods'\n], function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/main.js\n// module id = 1\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine(['./defaults'], function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/component.js\n// module id = 2\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/draw.js\n// module id = 3\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/events.js\n// module id = 4\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/touch.js\n// module id = 5\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n throw new Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.');\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/intf.js\n// module id = 6\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/contextMenu.js\n// module id = 7\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/dom.js\n// module id = 8\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/publicMethods.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///canvas-datagrid.js","webpack:///webpack/bootstrap 84d1080793981de45952","webpack:///./lib/defaults.js","webpack:///./lib/main.js","webpack:///./lib/component.js","webpack:///./lib/draw.js","webpack:///./lib/events.js","webpack:///./lib/touch.js","webpack:///./lib/intf.js","webpack:///./lib/contextMenu.js","webpack:///./lib/dom.js","webpack:///./lib/publicMethods.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","undefined","defaults","attributes","styles","apply","context","component","Grid","args","isComponent","isChildGrid","parentNode","test","nodeType","intf","eval","document","createElement","applyComponentStyle","hyphenateProperty","dehyphenateProperty","createGrid","forEach","shadowRoot","createShadowRoot","attachShadow","mode","init","Array","slice","arguments","window","HTMLElement","create","customElements","observedAttributes","getObservableAttributes","disconnectedCallback","attributeChangedCallback","connectedCallback","adoptedCallback","canvasDatagrid","require","tKeys","body","keys","argKey","indexOf","tKey","sKey","data","appendChild","getDefaultItem","base","item","filter","toLowerCase","typeMap","prop","replace","nextLetterCap","char","toUpperCase","cust","supressChangeAndDrawEvents","cStyle","getComputedStyle","tagName","canvas","defs","computedStyle","def","val","getPropertyValue","setStyleProperty","dispatchEvent","requestAnimationFrame","resize","style","strData","JSON","parse","e","Error","schema","strSchema","number","strNum","parseInt","isNaN","boolean","strBool","string","str","attrs","attr","push","connected","parentDOMNode","innerHTML","observe","attrName","oldVal","newVal","tfn","dataType","addEventListener","observer","MutationObserver","mutations","checkInnerHTML","checkStyle","mutation","attributeName","target","nodeName","addedNodes","length","type","characterData","childList","subtree","querySelectorAll","el","fillArray","low","high","step","x","drawPerfLine","w","h","y","perfArr","arrIndex","max","color","useAbs","r","canvasOffsetLeft","canvasOffsetTop","ctx","beginPath","moveTo","cx","cy","Math","abs","lineTo","strokeStyle","stroke","drawOnAllImagesLoaded","loaded","htmlImageCache","html","complete","cachedImagesDrawn","draw","drawHtml","cell","img","v","formattedValue","cacheKey","toString","rowIndex","columnIndex","height","width","drawImage","Image","onload","src","btoa","drawOrderByArrow","mt","columnHeaderOrderByArrowMarginTop","scale","ml","columnHeaderOrderByArrowMarginLeft","mr","columnHeaderOrderByArrowMarginRight","aw","columnHeaderOrderByArrowWidth","ah","columnHeaderOrderByArrowHeight","fillStyle","columnHeaderOrderByArrowColor","columnHeaderOrderByArrowBorderColor","orderDirection","fill","drawTreeArrow","treeArrowMarginTop","treeArrowMarginRight","treeArrowMarginLeft","treeArrowWidth","treeArrowHeight","treeArrowColor","treeArrowBorderColor","openChildren","radiusRect","radius","b","quadraticCurveTo","fillRect","strokeRect","fillText","text","fillCircle","arc","PI","strokeCircle","clipFrozenArea","lastFrozenColumnPixel","lastFrozenRowPixel","clip","fillHandle","selectionHandleType","strokeHandle","addselectionHandle","pos","hw","selectionHandleSize","tr","br","tl","bl","addBorderLine","t","wrapText","splitChar","lines","value","calculatedLineHeight","word","elWidth","plWidth","clippedVal","previousLine","words","split","textHeight","wrap","cellWhiteSpace","et","ellipsisText","line","cHeight","paddedHeight","measureText","measure","paddedWidth","splice","originText","stepLength","direction","substr","drawText","fontHeight","lineHeight","vPos","hPos","paddingLeft","orderByArrowWidth","horizontalAlignment","paddingRight","verticalAlignment","paddingBottom","lineSpacing","offsetLeft","offsetTop","debug","active","font","debugFont","debugColor","stringify","pw","idx","idx_ord","sortColumnIndex","map","getFrozenColumnsWidth","column","getSchema","min","frozenColumn","hiddenFrozenColumnCount","hidden","getColummnWidth","perfCounters","drawCount","perfWindowSize","entityCount","scrollDebugCounters","touchPPSCounters","internal","createHandlesOverlayArray","allowMovingSelection","mobile","selectionBorderTop","selectionBorderRight","selectionHandles","selectionHandle","selectionBorderLeft","selectionBorderBottom","selectionHandleBehavior","createBorderOverlayArray","drawArray","propPrefix","offsetPoint","selectionBorder","isRowHeader","selections","isHeader","drawCell","rowOrderIndex","header","headerIndex","columnOrderIndex","cellGridAttributes","cellStyle","isCorner","isColumnHeader","selected","hovered","hovers","activeCell","isColumnHeaderCellCap","rawValue","isGrid","activeHeader","orders","rows","columns","f","formatters","orderByArrowSize","treeArrowSize","cellWidth","sizes","ev","row","cellBorderWidth","visibleRows","paddingTop","whiteSpace","cellLineHeight","cellLineSpacing","scrollTop","scrollBox","scrollLeft","cellHeight","offsetWidth","offsetHeight","offsetParent","rowOpen","sortRowIndex","isNormal","gridId","parentGrid","title","userHeight","rowHeight","userWidth","cornerCell","visibleCells","unshift","lineWidth","cellHeightWithChildGrid","checkScrollHeight","cellWidthWithChildGrid","save","tree","showRowNumbers","childGrids","saveAppearance","cellGridHeight","grid","visible","orderBy","console","warn","columnFilters","filterTextPrefix","aCell","selectionBorders","movingSelection","moveBorders","moveOffset","restore","bc","drawRowHeader","rowData","index","a","showRowHeaders","rowHeaderCell","rowHeaderCellWidth","drawRow","treeHeight","rowSansTreeHeight","g","rd","trees","scrollIndexRight","scrollPixelRight","scrollPixelLeft","treeGrid","scrollBarWidth","rowHeaders","visibleRowHeights","gridBorderCollapse","u","currentCell","columnHeaderCellHeight","getColumnHeaderCellHeight","getRowHeaderCellWidth","performance","now","createRowOrders","gridBackgroundColor","ln","frozenRow","allowFreezingRows","frozenMarkerBorderWidth","frozenMarkerWidth","snapToRow","scrollPixelTop","scrollIndexTop","scrollIndexBottom","scrollPixelBottom","showNewRow","scrollIndexLeft","newRow","cl","selectionMode","activeCellOverlayBorderWidth","activeCellOverlayBorderColor","getHeaderWidth","drawHeaderColumnRange","start","end","order","columnHeaderCell","nonFrozenHeaderWidth","rArgs","rhIndex","showColumnHeaders","columnHeaderCellBorderWidth","isColumnHeaderCell","endCap","my","mx","xHover","yHover","allowFreezingColumns","frozenMarkerHoverColor","frozenMarkerColor","frozenMarkerHoverBorderColor","frozenMarkerBorderColor","freezeMarkerPosition","frozenMarkerActiveColor","frozenMarkerActiveBorderColor","dragMode","selectionHandleBorderWidth","selectionHandleBorderColor","selectionHandleColor","az","touchSelectHandleZone","ax","ay","reorderObject","dragOffset","reorderMarkerBackgroundColor","reorderMarkerBorderWidth","reorderMarkerBorderColor","reorderMarkerIndexBorderWidth","reorderMarkerIndexBorderColor","reorderTarget","moveOverlayBorderWidth","moveOverlayBorderColor","setLineDash","moveOverlayBorderSegments","gridBorderWidth","gridBorderColor","dsb","selectionOverlayBorderWidth","selectionOverlayBorderColor","drawCorner","en","entities","scrollBarBoxMargin","scrollBarBorderColor","scrollBarBorderWidth","horizontalBox","horizontalBar","scrollBoxWidth","scrollWidth","verticalBox","verticalBar","scrollBoxHeight","scrollHeight","horizontalBarVisible","scrollBarBackgroundColor","scrollBarBoxColor","horizontalBoxVisible","scrollBarActiveColor","scrollBarBoxBorderRadius","verticalBarVisible","verticalBoxVisible","scrollBarCornerBorderColor","scrollBarCornerBackgroundColor","corner","showPerformance","pop","perf","reduce","toFixed","perfDelta","frozenColumnsWidth","htmlImages","startScale","scaleDelta","zoomDeltaStart","touchLength","touches","touchPosition","touchPosition1","scrollIndex","scrollPixel","canvasOffset","touchDelta","touchAnimateTo","scrollAnimation","touchPPS","xPPS","yPPS","touchPPST","xPPST","yPPST","touchDuration","pointerLockPosition","size","mouse","touch","touchStart","hasFocus","dragContext","textAlign","debugBackgroundColor","key","dpl","ph","px","py","debugPerfChartTextColor","debugPerfChartBackground","debugScrollHeightColor","debugScrollWidthColor","debugPerformanceColor","debugEntitiesColor","debugTouchPPSXColor","debugTouchPPSYColor","wheeling","stopPropagation","fn","events","removeEventListener","sfn","preventDefault","defaultPrevented","getRatio","maxPixelRatio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","drawAfterResize","checkScrollBoxVisibility","dataWidth","overflowX","dataHeight","overflowY","setScrollBoxSize","setCanvasSize","dims","cellBorder","dim","appliedInlineStyles","parentNodeStyle","isComponet","vb","nb","co","isScrollBoxCorner","sbw","ratio","bm","columnHeaderCellBorder","ch","scrollCache","accumulator","va","top","left","widthBoxRatio","heightBoxRatio","scrollBarBoxMinSize","scrollBarBoxWidth","bar","box","page","pageUpDownOverlap","resizeEditInput","scroll","dontDraw","floor","ellipsisCache","mousemove","overridePos","contextMenu","input","getLayerPos","dragBounds","sBounds","delta","ctrl","ctrlKey","metaKey","persistantSelectionMode","getCellAt","NativeEvent","previousCell","clearTimeout","scrollTimer","isInGrid","rowBoundaryCrossed","columnBoundaryCrossed","cellBoundaryCrossed","prefix","draggingItem","scrollModes","dragItem","cursor","selecting","dragStart","dragStartObject","shiftKey","bottom","right","getSelectionBounds","ignoreNextClick","dragAddToSelection","selectRow","selectionBounds","selectArea","autoScrollZone","click","checkSelectionChange","sb","startingBounds","getSelectedData","endEdit","setActiveCell","selectAll","columnHeaderClickBehavior","selectColumn","treeArrowClickRadius","toggleTree","dragResizeColumn","resizingStartingWidth","resizingStartingHeight","minColumnWidth","minRowHeight","resizeScrollZone","resizeChildGrids","globalRowResize","stopDragResize","setStorageData","scrollGrid","scrollPointerLock","scrollStartMode","movementX","movementY","scrollMode","scrollStart","setTimeout","scrollRepeatRate","selectionScrollIncrement","stopScrollGrid","exitPointerLock","dragReorder","columReorder","rowReorder","allowColumnReordering","allowRowReordering","source","reorderDeadZone","stopDragReorder","oIndex","tIndex","cr","row-reorder","column-reorder","dragMove","stopDragMove","moveSelection","freezeMove","stopFreezeMove","startFreezeMove","mousedown","lastMouseDownTarget","button","move","freeze","requestPointerLock","concat","dragging","mouseup","controlInput","focus","getAdjacentCells","first","last","keydown","adjacentCells","cols","keyCode","beginEditAt","Number","scrollIntoView","selectionFollowsActiveCell","selectedData","keyup","keypress","dblclick","fitColumnToValues","autosize","scrollWheel","deltaX","deltaY","deltaMode","touchHaltAnimation","scrollTo","pasteItem","clipData","mimeType","normalizeRowData","importingRow","existingRow","offsetX","isArray","colKey","substring","sel","cellData","colIndex","cName","getVisibleSchema","yi","getNextVisibleColumnIndex","visibleColumnIndex","getVisibleColumnIndexOf","paste","clipboardData","items","dti","getAsString","cut","copy","forEachSelectedCell","colName","htmlSafe","fCopyCell","addHeaders","headers","useHtml","hVal","join","addCellValue","trRow","textRow","outputHeaderKeys","tableRows","textRows","outputHeaders","sData","rowKeys","sSorted","setData","touchMove","touchScroll","rScrollZone","bScrollZone","tScrollZone","lScrollZone","touchScrollTimeout","rw","t1","t2","changedTouches","getTouchPos","touchDeadZone","touchContextTimeout","touchZoomSensitivity","touchZoomMin","touchZoomMax","zoomAltered","selectionScrollZone","calculatePPS","touchScrollStart","stopAnimation","animationFrames","touchSelecting","startingCell","touchSelect","touchMoving","touchIndex","rect","getBoundingClientRect","clientX","clientY","easingFunctions","linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easing","touchEasingMethod","calculatePPSTimed","touchSigmaTimed","touchSigma","touchEndAnimation","touchReleaseAnimationDurationMs","touchEditCell","touchCell","clearInterval","calculatePPSTimer","touchingCell","editCell","touchstart","disposeContextMenu","touchStartEvent","touchStart1","contextmenuEvent","touchContextMenuTimeMs","setInterval","touchEndEvents","touchmove","passive","touchend","touchcancel","handleType","bounds","dz","touchReleaseAcceleration","scrollAnimationPPSThreshold","ctor","treeGridAttributes","storageName","invalidSearchExpClass","localStyleLibraryStorageKey","filters","currentFilter","sorters","parsers","schemaHashes","changes","componentL1Events","eventNames","expandToRow","col","orderedIndex","visibility","localStorage","setItem","tempSchema","createColumnOrders","applyDefaultValue","defaultValue","createNewRowData","getSchemaNameHash","getBestGuessDataType","columnName","drawChildGrids","gridKey","setTimer","refreshFromOrigialData","originalData","validateColumn","setDefaults","obj1","obj2","setAttributes","setStyle","findColumnMaxTextLength","dispose","removeChild","eventParent","contextmenu","disconnect","tryLoadStoredSettings","reloadStoredValues","storedSettings","getHeaderByName","getDomRoot","host","getFontName","fontStyle","getFontHeight","parseFloat","parseStyleValue","initProp","propName","getStyleProperty","styleKeys","supressDrawAndEvent","isDim","getItem","message","addStyleKeyIfNoneExists","initialized","publicStyleKeyIntf","initScrollBox","setDom","ie","navigator","userAgent","edge","webKit","moz","cursorGrab","cursorGrabing","cursorGrabbing","appendTo","getVisibleCellByIndex","clearChangeLog","gotoCell","gotoRow","findColumnScrollLeft","findRowScrollTop","isCellVisible","isRowVisible","isColumnVisible","clipElement","getSchemaFromData","setFilter","expandTree","collapseTree","insertRow","deleteRow","addRow","insertColumn","deleteColumn","addColumn","getClippingRect","setRowHeight","setColumnWidth","resetColumnWidths","resetRowHeights","selectNone","assertPxColor","clearPxColorAssertions","integerToAlpha","DOMStyles","set","valueObject","filterFor","String","filterRegExp","regEnd","pattern","exec","flags","flagLength","invalidFilterRegEx","RegExp","toLocaleUpperCase","innerText","textContent","blur","TypeError","currentCursor","find","eventName","RangeError","getTypes","parseInnerHtml","callback","etl","autoGenerateSchema","autoResizeColumns","setScrollTop","preventScrollEvent","setScrollLeft","sHeight","sWidth","supressDrawEvent","applyContextItemStyle","contextItemContainer","createInlineStyle","createContextMenu","parentContextMenu","createItems","removeChildContext","relatedTarget","container","childMenuArrow","contains","children","setAttribute","contextAddCallback","getAttribute","cPos","childContextMenuMarginLeft","childContextMenuMarginTop","createChildContext","addContent","content","childContextMenuArrowHTML","clickIndex","Event","checkArrowVisibility","upArrow","downArrow","startHoverScroll","contextHoverScrollAmount","hoverScrollTimeout","contextHoverScrollRateMs","endHoverScroll","selectedIndex","loc","scrollOffset","zIndexTop","contextMenuZIndex","position","contextMenuArrowColor","zIndex","inputDropdown","maxHeight","innerHeight","autocompleteBottomMargin","minWidth","contextMenuArrowUpHTML","contextMenuArrowDownHTML","contextMenuWindowMargin","innerWidth","isFinite","createFilterContextMenuItems","checkRegExpErrorState","filterInput","background","contextFilterInputBackground","contextFilterInputColor","contextFilterInvalidRegExpBackground","contextFilterInvalidRegExpColor","fillAutoComplete","count","autoCompleteItems","maxAutoCompleteItems","disposeAutocomplete","createAutoCompleteContext","iRect","autoCompleteContext","filterContainer","filterLabel","filterAutoCompleteButton","onclick","filterOptionText","contextFilterButtonHTML","cf","removeFilterOptionText","addDefaultContextMenuItem","isNormalCell","isBackground","isScrollBar","showFilter","showCopy","copyText","execCommand","showPaste","clipBoardData","pasteText","showColumnSelector","columnSelectorText","toggleColumnVisibility","columnSelectorHiddenText","columnSelectorVisibleText","hideColumnText","showClearSettingsOption","clearSettingsOptionText","columnWidth","allowSorting","showOrderByOption","showOrderByOptionTextAsc","showOrderByOptionTextDesc","createDiposeEvent","contextPosition","contextMenuMarginLeft","contextMenuMarginTop","mobileContextMenuMargin","ele","boundingRect","eleRect","clipRect","parentRect","Infinity","scrollingElement","borderWidth","mobileEditInputHeight","cellPaddingLeft","ignoreScrollOffset","abort","abortEdit","newValue","oldValue","aborted","editable","enumItems","enu","option","valueInEnum","multiLine","editCellZIndex","fontSize","editCellFontSize","nx","ny","className","css","canvas-datagrid-context-menu-filter-input","verticalAlign","marginLeft","padding","border","contextFilterInputBorder","borderRadius","contextFilterInputBorderRadius","fontWeight","fontFamily","contextFilterInputFontFamily","contextFilterInputFontSize","canvas-datagrid-context-menu-filter-button","contextMenuBackground","contextMenuColor","contextFilterButtonBorder","contextFilterButtonBorderRadius","contextMenuFilterButtonFontFamily","contextMenuFilterButtonFontSize","canvas-datagrid-context-child-arrow","cssFloat","childContextMenuArrowColor","contextMenuChildArrowFontSize","contextMenuFontFamily","canvas-datagrid-autocomplete","contextMenuFontSize","contextMenuBorder","contextMenuPadding","contextMenuBorderRadius","opacity","contextMenuOpacity","overflow","canvas-datagrid-autocomplete-item","canvas-datagrid-autocomplete-item:hover","contextMenuHoverBackground","contextMenuHoverColor","canvas-datagrid-canvas","canvas-datagrid","display","canvas-datagrid-control-input","canvas-datagrid-edit-mobile-input","boxSizing","outline","margin","mobileEditFontFamily","mobileEditFontSize","editCellBorder","editCellColor","editCellBackgroundColor","appearance","webkitAppearance","mozAppearance","canvas-datagrid-edit-input","editCellPaddingLeft","editCellFontFamily","boxShadow","editCellBoxShadow","canvas-datagrid-context-menu-item-mobile","contextMenuItemMargin","contextMenuItemBorderRadius","canvas-datagrid-context-menu-item","canvas-datagrid-context-menu-item:hover","canvas-datagrid-context-menu-label","contextMenuLabelMargin","contextMenuLabelDisplay","contextMenuLabelMinWidth","maxWidth","contextMenuLabelMaxWidth","canvas-datagrid-context-menu-mobile","canvas-datagrid-context-menu","contextMenuCursor","canvas-datagrid-invalid-search-regExp","contextMenuFilterInvalidExpresion","onblur","parentIsCanvas","getContext","textBaseline","ordA","charCodeAt","ordZ","len","fromCharCode","applyFilter","offsetY","targetX","targetY","sbh","isColumnSelected","colIsSelected","shift","supressEvent","addCol","de","ri","st","dragObject","childGrid","trArgs","treeGridHeight","sortFunction","dontSetStorageData","sort","xi","maxRowLength","minXi","lastSourceIndex","cidx","useTouchScrollZones","moveBorder","entitiy","tsz","touchScrollZone","moveMode","borderDragBehavior","xBorderBehavior","yBorderBehavior","isVerticalScrollBar","isHorizontalScrollBar","borderResizeZone","allowColumnResize","allowColumnResizeFromCell","allowRowHeaderResize","allowRowResize","allowRowResizeFromCell","rowGrabZoneSize","maxCol","minCol"," ","rowHeaderCellFont","autosizePadding","autosizeHeaderCellPadding","rowHeaderCellPaddingRight","rowHeaderCellPaddingLeft","columnHeaderCellFont","headerCellPaddingRight","headerCellPaddingLeft","cellFont","cellPaddingRight","cellAutoResizePadding","total","getRowHeight","headerCell","int","asc","localeCompare","date","Date","getTime"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,eAAAD,IAEAD,EAAA,eAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB,EAAA,GAGAvB,IAAAwB,EAAA,KDgBM,SAAU9B,EAAQD,EAASO,GE7EjC,GAAAyB,GAAAC,CAEAD,UAkTCE,MAlTQD,EAAA,WACT,YACA,iBAAA7B,GACAA,EAAA+B,UACAC,aACA,6BACA,yBACA,iCACA,yBACA,4BACA,4BACA,4BACA,0BACA,sBACA,8BACA,oBACA,0BACA,yBACA,8BACA,wBACA,mDACA,qCACA,kDACA,4CACA,kCACA,+BACA,+BACA,8BACA,oBACA,aACA,gBACA,uBACA,iCACA,mCACA,uBACA,6BACA,6BACA,iBACA,YACA,wBACA,sBACA,+BACA,iDACA,sBACA,wBACA,sBACA,sBACA,oCACA,yBACA,wBACA,kCACA,mCACA,yBACA,gCACA,2BACA,+BACA,yBACA,0BACA,gBACA,kBACA,kBACA,yBACA,qDACA,uDACA,iBACA,uBACA,sBACA,sBACA,iBACA,+BACA,oBACA,oCACA,iCACA,wCACA,uBACA,6BACA,8BACA,oBACA,sBACA,oBACA,YACA,4BAEAC,SACA,uDACA,mDACA,4BACA,uCACA,qCACA,4DACA,yCACA,4CACA,yDACA,mCACA,8BACA,4BACA,6BACA,2BACA,+DACA,+CACA,yCACA,mEACA,mDACA,gEACA,gDACA,gCACA,gCACA,sBACA,6BACA,iDACA,6CACA,sBACA,iCACA,+BACA,uBACA,kBACA,gCACA,mCACA,sDACA,sCACA,wBACA,sBACA,uBACA,qBACA,yDACA,yCACA,mCACA,kBACA,+BACA,4BACA,qBACA,sBACA,qDACA,yCACA,mCACA,iCACA,6DACA,yDACA,kCACA,gEACA,4DACA,qCACA,gDACA,2CACA,8BACA,+CACA,kEACA,kDACA,oCACA,kCACA,mCACA,iCACA,+CACA,iEACA,0CACA,2DACA,qCACA,yCACA,0CACA,wCACA,qCACA,iEACA,0CACA,uCACA,uDACA,gEACA,uCACA,4CACA,8CACA,sCACA,8DACA,6DACA,gDACA,wCACA,sCACA,mDACA,yDACA,kCACA,yCACA,2CACA,gCACA,mDACA,2CACA,+DACA,uCACA,+BACA,wDACA,iDACA,sCACA,gCACA,2CACA,uCACA,qCACA,oCACA,4BACA,4BACA,8BACA,6BACA,+BACA,0BACA,uDACA,mDACA,6CACA,sCACA,kDACA,gCACA,sDACA,uDACA,qDACA,sDACA,oDACA,mDACA,kDACA,2BACA,oCACA,sDACA,kDACA,0BACA,oCACA,4BACA,0BACA,uBACA,oDACA,0DACA,qDACA,2DACA,+CACA,qDACA,8BACA,wBACA,iDACA,kCAC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A,iBAAA4I,EAAAjM,GACA,WAAA1M,KAAA2Y,EAAAof,IAAA,OAAApf,EAAAof,GACA,MAEA/3B,KAAA0M,EAAAqrB,IAAA,OAAArrB,EAAAqrB,GACA,EAEAsY,EACA13B,EAAAof,GAAAuY,cACA33B,EAAAof,GAAAuY,cAAA5jC,EAAAqrB,IADuD,EAGvDrrB,EAAAqrB,GAAAuY,cACA5jC,EAAAqrB,GAAAuY,cAAA33B,EAAAof,IADmD,IAInD75B,EAAA04B,QAAAtxB,OAAA,SAAAyyB,EAAAhoB,GACA,GAAAsgC,GAAA,QAAAtgC,CACA,iBAAA4I,EAAAjM,GACA,MAAA2jC,GACA13B,EAAAof,GAAArrB,EAAAqrB,GAEArrB,EAAAqrB,GAAApf,EAAAof,KAGA75B,EAAA04B,QAAA2Z,KAAA,SAAAxY,EAAAhoB,GACA,GAAAsgC,GAAA,QAAAtgC,CACA,iBAAA4I,EAAAjM,GACA,MAAA2jC,GACA,GAAAG,MAAA73B,EAAAof,IAAA0Y,UACA,GAAAD,MAAA9jC,EAAAqrB,IAAA0Y,UAEA,GAAAD,MAAA9jC,EAAAqrB,IAAA0Y,UACA,GAAAD,MAAA73B,EAAAof,IAAA0Y,cAICrwC,MAAAtC,EAAAgC,MAAA/B,EAAAD,QAAAiC","file":"canvas-datagrid.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"canvasDatagrid\"] = factory();\n\telse\n\t\troot[\"canvasDatagrid\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(2),\n __webpack_require__(0),\n __webpack_require__(3),\n __webpack_require__(4),\n __webpack_require__(5),\n __webpack_require__(6),\n __webpack_require__(7),\n __webpack_require__(8),\n __webpack_require__(9)\n], __WEBPACK_AMD_DEFINE_RESULT__ = (function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.warn(Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.'));\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\n!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// canvas-datagrid.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 84d1080793981de45952","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.defaults = {\n attributes: [\n ['allowColumnReordering', true],\n ['allowColumnResize', true],\n ['allowColumnResizeFromCell', false],\n ['allowFreezingRows', false],\n ['allowFreezingColumns', false],\n ['allowMovingSelection', true],\n ['allowRowHeaderResize', true],\n ['allowRowReordering', false],\n ['allowRowResize', true],\n ['allowRowResizeFromCell', false],\n ['allowSorting', true],\n ['autoGenerateSchema', false],\n ['autoResizeColumns', false],\n ['borderDragBehavior', 'none'],\n ['borderResizeZone', 10],\n ['clearSettingsOptionText', 'Clear saved settings'],\n ['columnHeaderClickBehavior', 'sort'],\n ['columnSelectorHiddenText', '   '],\n ['columnSelectorText', 'Add/Remove columns'],\n ['columnSelectorVisibleText', '\\u2713'],\n ['contextHoverScrollAmount', 2],\n ['contextHoverScrollRateMs', 5],\n ['copyHeadersOnSelectAll', true],\n ['copyText', 'Copy'],\n ['debug', false],\n ['editable', true],\n ['ellipsisText', '...'],\n ['filterOptionText', 'Filter %s'],\n ['filterTextPrefix', '(filtered) '],\n ['globalRowResize', false],\n ['hideColumnText', 'Hide %s'],\n ['maxAutoCompleteItems', 200],\n ['multiLine', false],\n ['name', ''],\n ['pageUpDownOverlap', 1],\n ['pasteText', 'Paste'],\n ['persistantSelectionMode', false],\n ['removeFilterOptionText', 'Remove filter on %s'],\n ['reorderDeadZone', 3],\n ['resizeScrollZone', 20],\n ['rowGrabZoneSize', 5],\n ['saveAppearance', true],\n ['scrollAnimationPPSThreshold', 0.75],\n ['scrollPointerLock', false],\n ['scrollRepeatRate', 75],\n ['selectionFollowsActiveCell', false],\n ['selectionHandleBehavior', 'none'],\n ['selectionMode', 'cell'],\n ['selectionScrollIncrement', 20],\n ['selectionScrollZone', 20],\n ['showClearSettingsOption', true],\n ['showColumnHeaders', true],\n ['showColumnSelector', true],\n ['showCopy', false],\n ['showFilter', true],\n ['showNewRow', false],\n ['showOrderByOption', true],\n ['showOrderByOptionTextAsc', 'Order by %s ascending'],\n ['showOrderByOptionTextDesc', 'Order by %s descending'],\n ['showPaste', false],\n ['showPerformance', false],\n ['showRowHeaders', true],\n ['showRowNumbers', true],\n ['snapToRow', false],\n ['touchContextMenuTimeMs', 800],\n ['touchDeadZone', 3],\n ['touchEasingMethod', 'easeOutQuad'],\n ['touchReleaseAcceleration', 1000],\n ['touchReleaseAnimationDurationMs', 2000],\n ['touchScrollZone', 20],\n ['touchSelectHandleZone', 20],\n ['touchZoomSensitivity', 0.005],\n ['touchZoomMin', 0.5],\n ['touchZoomMax', 1.75],\n ['maxPixelRatio', 2],\n ['tree', false],\n ['treeHorizontalScroll', false]\n ],\n styles: [\n ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'],\n ['activeCellBorderWidth', 1],\n ['activeCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellFont', '16px sans-serif'],\n ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['activeCellHorizontalAlignment', 'left'],\n ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['activeCellOverlayBorderWidth', 1],\n ['activeCellPaddingBottom', 5],\n ['activeCellPaddingLeft', 5],\n ['activeCellPaddingRight', 5],\n ['activeCellPaddingTop', 5],\n ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['activeCellVerticalAlignment', 'center'],\n ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'],\n ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'],\n ['autocompleteBottomMargin', 60],\n ['autosizeHeaderCellPadding', 8],\n ['autosizePadding', 5],\n ['cellAutoResizePadding', 13],\n ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellBorderColor', 'rgba(195, 199, 202, 1)'],\n ['cellBorderWidth', 1],\n ['cellColor', 'rgba(0, 0, 0, 1)'],\n ['cellFont', '16px sans-serif'],\n ['cellGridHeight', 250],\n ['cellHeight', 24],\n ['cellHeightWithChildGrid', 150],\n ['cellHorizontalAlignment', 'left'],\n ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'],\n ['cellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['cellPaddingBottom', 5],\n ['cellPaddingLeft', 5],\n ['cellPaddingRight', 5],\n ['cellPaddingTop', 5],\n ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],\n ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],\n ['cellVerticalAlignment', 'center'],\n ['cellWidth', 250],\n ['cellWidthWithChildGrid', 250],\n ['cellWhiteSpace', 'nowrap'],\n ['cellLineHeight', 1],\n ['cellLineSpacing', 3],\n ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['childContextMenuArrowHTML', '►'],\n ['childContextMenuMarginLeft', -11],\n ['childContextMenuMarginTop', -6],\n ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellBorderWidth', 1],\n ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'],\n ['columnHeaderCellCapBorderWidth', 1],\n ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['columnHeaderCellFont', '16px sans-serif'],\n ['columnHeaderCellHeight', 25],\n ['columnHeaderCellHorizontalAlignment', 'left'],\n ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['columnHeaderCellPaddingBottom', 5],\n ['columnHeaderCellPaddingLeft', 5],\n ['columnHeaderCellPaddingRight', 5],\n ['columnHeaderCellPaddingTop', 5],\n ['columnHeaderCellVerticalAlignment', 'center'],\n ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['columnHeaderOrderByArrowBorderWidth', 1],\n ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'],\n ['columnHeaderOrderByArrowHeight', 8],\n ['columnHeaderOrderByArrowMarginLeft', 0],\n ['columnHeaderOrderByArrowMarginRight', 5],\n ['columnHeaderOrderByArrowMarginTop', 6],\n ['columnHeaderOrderByArrowWidth', 13],\n ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterButtonBorderRadius', '3px'],\n ['contextFilterButtonHTML', '▼'],\n ['contextFilterInputBackground', 'rgba(255,255,255,1)'],\n ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextFilterInputBorderRadius', '0'],\n ['contextFilterInputColor', 'rgba(0,0,0,1)'],\n ['contextFilterInputFontFamily', 'sans-serif'],\n ['contextFilterInputFontSize', '14px'],\n ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'],\n ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'],\n ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuArrowDownHTML', '▼'],\n ['contextMenuArrowUpHTML', '▲'],\n ['contextMenuBackground', 'rgba(240, 240, 240, 1)'],\n ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'],\n ['contextMenuBorderRadius', '3px'],\n ['contextMenuChildArrowFontSize', '12px'],\n ['contextMenuColor', 'rgba(43, 48, 43, 1)'],\n ['contextMenuCursor', 'default'],\n ['contextMenuFilterButtonFontFamily', 'sans-serif'],\n ['contextMenuFilterButtonFontSize', '10px'],\n ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'],\n ['contextMenuFontFamily', 'sans-serif'],\n ['contextMenuFontSize', '16px'],\n ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'],\n ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'],\n ['contextMenuItemBorderRadius', '3px'],\n ['contextMenuItemMargin', '2px'],\n ['contextMenuLabelDisplay', 'inline-block'],\n ['contextMenuLabelMargin', '0 3px 0 0'],\n ['contextMenuLabelMaxWidth', '700px'],\n ['contextMenuLabelMinWidth', '75px'],\n ['contextMenuMarginLeft', 3],\n ['contextMenuMarginTop', -3],\n ['contextMenuOpacity', '0.98'],\n ['contextMenuPadding', '2px'],\n ['contextMenuWindowMargin', 30],\n ['contextMenuZIndex', 10000],\n ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'],\n ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'],\n ['debugColor', 'rgba(255, 15, 24, 1)'],\n ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'],\n ['debugFont', '11px sans-serif'],\n ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'],\n ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'],\n ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'],\n ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'],\n ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'],\n ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'],\n ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'],\n ['display', 'inline-block'],\n ['editCellBackgroundColor', 'white'],\n ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'],\n ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'],\n ['editCellColor', 'black'],\n ['editCellFontFamily', 'sans-serif'],\n ['editCellFontSize', '16px'],\n ['editCellPaddingLeft', 4],\n ['editCellZIndex', 10000],\n ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],\n ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],\n ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],\n ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],\n ['frozenMarkerBorderWidth', 1],\n ['frozenMarkerWidth', 2],\n ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['gridBorderCollapse', 'collapse'],\n ['gridBorderColor', 'rgba(202, 202, 202, 1)'],\n ['gridBorderWidth', 1],\n ['height', 'auto'],\n ['maxHeight', 'inherit'],\n ['maxWidth', 'inherit'],\n ['minColumnWidth', 45],\n ['minHeight', 'inherit'],\n ['minRowHeight', 24],\n ['minWidth', 'inherit'],\n ['mobileContextMenuMargin', 10],\n ['mobileEditInputHeight', 30],\n ['mobileEditFontFamily', 'sans-serif'],\n ['mobileEditFontSize', '16px'],\n ['moveOverlayBorderWidth', 1],\n ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['moveOverlayBorderSegments', '12, 7'],\n ['name', 'default'],\n ['overflowY', 'auto'],\n ['overflowX', 'auto'],\n ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'],\n ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'],\n ['reorderMarkerBorderWidth', 1.25],\n ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],\n ['reorderMarkerIndexBorderWidth', 2.75],\n ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],\n ['rowHeaderCellBorderWidth', 1],\n ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellFont', '16px sans-serif'],\n ['rowHeaderCellHeight', 25],\n ['rowHeaderCellHorizontalAlignment', 'left'],\n ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],\n ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'],\n ['rowHeaderCellPaddingBottom', 5],\n ['rowHeaderCellPaddingLeft', 5],\n ['rowHeaderCellPaddingRight', 5],\n ['rowHeaderCellPaddingTop', 5],\n ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],\n ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],\n ['rowHeaderCellVerticalAlignment', 'center'],\n ['rowHeaderCellWidth', 57],\n ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'],\n ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarBorderWidth', 0.5],\n ['scrollBarBoxBorderRadius', 4.125],\n ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'],\n ['scrollBarBoxMargin', 2],\n ['scrollBarBoxMinSize', 15],\n ['scrollBarBoxWidth', 8],\n ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'],\n ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'],\n ['scrollBarWidth', 11],\n ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'],\n ['selectionHandleBorderWidth', 1.5],\n ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],\n ['selectionHandleSize', 8],\n ['selectionHandleType', 'square'],\n ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],\n ['selectionOverlayBorderWidth', 1],\n ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],\n ['treeArrowBorderWidth', 1],\n ['treeArrowClickRadius', 5],\n ['treeArrowColor', 'rgba(155, 155, 155, 1)'],\n ['treeArrowHeight', 8],\n ['treeArrowMarginLeft', 0],\n ['treeArrowMarginRight', 5],\n ['treeArrowMarginTop', 6],\n ['treeArrowWidth', 13],\n ['treeGridHeight', 250],\n ['width', 'auto']\n ]\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 0\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, evil: true*/\n/*globals Reflect: false, HTMLElement: true, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([\n './component',\n './defaults',\n './draw',\n './events',\n './touch',\n './intf',\n './contextMenu',\n './dom',\n './publicMethods'\n], function context(component) {\n 'use strict';\n component = component();\n var modules = Array.prototype.slice.call(arguments);\n function Grid(args) {\n args = args || {};\n var self = {};\n self.isComponent = args.component === undefined;\n self.isChildGrid = args.parentNode && /canvas-datagrid-(cell|tree)/.test(args.parentNode.nodeType);\n if (self.isChildGrid) {\n self.intf = {};\n } else {\n self.intf = self.isComponent ? eval('Reflect.construct(HTMLElement, [], new.target)')\n : document.createElement('canvas');\n }\n self.args = args;\n self.intf.args = args;\n self.applyComponentStyle = component.applyComponentStyle;\n self.hyphenateProperty = component.hyphenateProperty;\n self.dehyphenateProperty = component.dehyphenateProperty;\n self.createGrid = function grid(args) {\n args.component = false;\n return new Grid(args);\n };\n modules.forEach(function (module) {\n module(self);\n });\n if (self.isChildGrid) {\n self.shadowRoot = args.parentNode.shadowRoot;\n self.parentNode = args.parentNode;\n } else if (self.intf.createShadowRoot) {\n self.shadowRoot = self.intf.attachShadow({mode: 'open'});\n self.parentNode = self.shadowRoot;\n } else {\n self.parentNode = self.intf;\n }\n self.init();\n return self.intf;\n }\n if (window.HTMLElement) {\n Grid.prototype = Object.create(window.HTMLElement.prototype);\n }\n // export web component\n if (window.customElements) {\n Grid.observedAttributes = component.getObservableAttributes();\n Grid.prototype.disconnectedCallback = component.disconnectedCallback;\n Grid.prototype.attributeChangedCallback = component.attributeChangedCallback;\n Grid.prototype.connectedCallback = component.connectedCallback;\n Grid.prototype.adoptedCallback = component.adoptedCallback;\n window.customElements.define('canvas-datagrid', Grid);\n }\n // export global\n if (window && !window.canvasDatagrid && !window.require) {\n window.canvasDatagrid = function (args) { return new Grid(args); };\n }\n // export amd loader\n module.exports = function grid(args) {\n args = args || {};\n var i, tKeys = ['style', 'formatters', 'sorters', 'filters',\n 'treeGridAttributes', 'cellGridAttributes', 'data', 'schema'];\n if (window.customElements && document.body.createShadowRoot) {\n i = document.createElement('canvas-datagrid');\n Object.keys(args).forEach(function (argKey) {\n // set data and parentNode after everything else\n if (argKey === 'data') { return; }\n if (argKey === 'parentNode') { return; }\n // top level keys in args\n if (tKeys.indexOf(argKey) !== -1) {\n tKeys.forEach(function (tKey) {\n if (args[tKey] === undefined || tKey !== argKey) { return; }\n if (['formatters', 'sorters', 'filters'].indexOf(argKey) !== -1) {\n if (typeof args[tKey] === 'object' && args[tKey] !== null) {\n Object.keys(args[tKey]).forEach(function (sKey) {\n i[tKey][sKey] = args[tKey][sKey];\n });\n }\n } else {\n i[tKey] = args[tKey];\n }\n });\n return;\n }\n // all others are attribute level keys\n i.attributes[argKey] = args[argKey];\n });\n if (args.data) {\n i.data = args.data;\n }\n // add to the dom very last to avoid redraws\n if (args.parentNode) {\n args.parentNode.appendChild(i);\n }\n return i;\n }\n args.component = false;\n i = new Grid(args);\n if (args.parentNode && args.parentNode.appendChild) {\n args.parentNode.appendChild(i);\n }\n return i;\n };\n return module.exports;\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/main.js\n// module id = 1\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine(['./defaults'], function (defaults) {\n 'use strict';\n return function () {\n var typeMap, component = {};\n component.dehyphenateProperty = function hyphenateProperty(prop) {\n prop = prop.replace('--cdg-', '');\n var p = '', nextLetterCap;\n Array.prototype.forEach.call(prop, function (char) {\n if (nextLetterCap) {\n nextLetterCap = false;\n p += char.toUpperCase();\n return;\n }\n if (char === '-') {\n nextLetterCap = true;\n return;\n }\n p += char;\n });\n return p;\n };\n component.hyphenateProperty = function hyphenateProperty(prop, cust) {\n var p = '';\n Array.prototype.forEach.call(prop, function (char) {\n if (char === char.toUpperCase()) {\n p += '-' + char.toLowerCase();\n return;\n }\n p += char;\n });\n return (cust ? '--cdg-' : '') + p;\n };\n function getDefaultItem(base, item) {\n var i = {},\n r;\n defaults(i);\n r = i.defaults[base].filter(function (i) {\n return i[0].toLowerCase() === item.toLowerCase()\n || component.hyphenateProperty(i[0]) === item.toLowerCase()\n || component.hyphenateProperty(i[0], true) === item.toLowerCase();\n })[0];\n return r;\n }\n component.applyComponentStyle = function (supressChangeAndDrawEvents, intf) {\n if (!intf.isComponent) { return; }\n var cStyle = window.getComputedStyle(intf.tagName === 'CANVAS-DATAGRID' ? intf : intf.canvas, null),\n defs = {};\n intf.computedStyle = cStyle;\n defaults(defs);\n defs = defs.defaults.styles;\n defs.forEach(function (def) {\n var val;\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], true));\n if (val === \"\") {\n val = cStyle.getPropertyValue(component.hyphenateProperty(def[0], false));\n }\n if (val !== \"\" && typeof val === 'string') {\n intf.setStyleProperty(def[0], typeMap[typeof def[1]](val\n .replace(/^\\s+/, '').replace(/\\s+$/, ''), def[1]), true);\n }\n });\n if (!supressChangeAndDrawEvents && intf.dispatchEvent) {\n requestAnimationFrame(function () { intf.resize(true); });\n intf.dispatchEvent('stylechanged', intf.style);\n }\n };\n typeMap = {\n data: function (strData) {\n try {\n return JSON.parse(strData);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid data.');\n }\n },\n schema: function (strSchema) {\n try {\n return JSON.parse(strSchema);\n } catch (e) {\n throw new Error('Cannot read JSON data in canvas-datagrid schema attribute.');\n }\n },\n number: function (strNum, def) {\n var n = parseInt(strNum, 10);\n return isNaN(n) ? def : n;\n },\n boolean: function (strBool) {\n return (/true/i).test(strBool);\n },\n string: function (str) {\n return str;\n }\n };\n component.getObservableAttributes = function () {\n var i = {}, attrs = ['data', 'schema', 'style', 'className', 'name'];\n defaults(i);\n i.defaults.attributes.forEach(function (attr) {\n attrs.push(attr[0].toLowerCase());\n });\n return attrs;\n };\n component.disconnectedCallback = function () {\n this.connected = false;\n };\n component.connectedCallback = function () {\n var intf = this;\n intf.parentDOMNode.innerHTML = \"\";\n intf.parentDOMNode.appendChild(intf.canvas);\n intf.connected = true;\n component.observe(intf);\n component.applyComponentStyle(true, intf);\n intf.resize(true);\n };\n component.adoptedCallback = function () {\n this.resize();\n };\n component.attributeChangedCallback = function (attrName, oldVal, newVal) {\n var tfn, intf = this, def;\n if (attrName === 'style') {\n component.applyComponentStyle(false, intf);\n return;\n }\n if (attrName === 'data') {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.args.data = newVal;\n return;\n }\n if (attrName === 'schema') {\n intf.args.schema = typeMap.schema(newVal);\n return;\n }\n if (attrName === 'name') {\n intf.name = newVal;\n return;\n }\n if (attrName === 'class' || attrName === 'className') {\n return;\n }\n def = getDefaultItem('attributes', attrName);\n if (def) {\n tfn = typeMap[typeof def[1]];\n intf.attributes[def[0]] = tfn(newVal);\n return;\n }\n if (/^on/.test(attrName)) {\n intf.addEventListener('on' + attrName, function (e) {\n eval(newVal);\n });\n }\n return;\n };\n component.observe = function (intf) {\n var observer;\n if (!window.MutationObserver) { return; }\n intf.applyComponentStyle = function () { component.applyComponentStyle(false, intf); intf.resize(); };\n /**\n * Applies the computed css styles to the grid. In some browsers, changing directives in attached style sheets does not automatically update the styles in this component. It is necessary to call this method to update in these cases.\n * @memberof canvasDatagrid\n * @name applyComponentStyle\n * @method\n */\n observer = new window.MutationObserver(function (mutations) {\n var checkInnerHTML, checkStyle;\n Array.prototype.forEach.call(mutations, function (mutation) {\n if (mutation.attributeName === 'class'\n || mutation.attributeName === 'style') {\n checkStyle = true;\n return;\n }\n if (mutation.target.parentNode\n && mutation.target.parentNode.nodeName === 'STYLE') {\n checkStyle = true;\n return;\n }\n if (mutation.addedNodes.length > 0 || mutation.type === 'characterData') {\n checkInnerHTML = true;\n }\n });\n if (checkStyle) {\n intf.applyComponentStyle(false, intf);\n }\n if (checkInnerHTML) {\n if (intf.dataType === 'application/x-canvas-datagrid') {\n intf.dataType = 'application/json+x-canvas-datagrid';\n }\n intf.data = intf.innerHTML;\n }\n });\n observer.observe(intf, { characterData: true, childList: true, attributes: true, subtree: true });\n Array.prototype.forEach.call(document.querySelectorAll('style'), function (el) {\n observer.observe(el, { characterData: true, childList: true, attributes: true, subtree: true });\n });\n };\n return component;\n };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/component.js\n// module id = 2\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var perfCounters = [],\n cachedImagesDrawn = false,\n drawCount = 0,\n perfWindowSize = 300,\n entityCount = [],\n hiddenFrozenColumnCount = 0,\n scrollDebugCounters = [],\n touchPPSCounters = [];\n self.htmlImageCache = {};\n // more heavyweight version than fillArray defined in intf.js\n function fillArray(low, high, step, def) {\n step = step || 1;\n var i = [], x;\n for (x = low; x <= high; x += step) {\n i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def);\n }\n return i;\n }\n function drawPerfLine(w, h, x, y, perfArr, arrIndex, max, color, useAbs) {\n var i = w / perfArr.length,\n r = h / max;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.moveTo(x, y + h);\n perfArr.forEach(function (n) {\n var val = (arrIndex === undefined ? n : n[arrIndex]),\n cx,\n cy;\n if (useAbs) {\n val = Math.abs(val);\n }\n cx = x + i;\n cy = y + h - (val * r);\n self.ctx.lineTo(cx, cy);\n x += i;\n });\n self.ctx.moveTo(x + w, y + h);\n self.ctx.strokeStyle = color;\n self.ctx.stroke();\n }\n function drawOnAllImagesLoaded() {\n var loaded = true;\n Object.keys(self.htmlImageCache).forEach(function (html) {\n if (!self.htmlImageCache[html].complete) {\n loaded = false;\n }\n });\n if (loaded && !cachedImagesDrawn) {\n cachedImagesDrawn = true;\n self.draw();\n }\n }\n function drawHtml(cell) {\n var img,\n v = cell.innerHTML || cell.formattedValue,\n cacheKey = v.toString() + cell.rowIndex.toString() + cell.columnIndex.toString(), \n x = cell.x + self.canvasOffsetLeft,\n y = cell.y + self.canvasOffsetTop;\n if (self.htmlImageCache[cacheKey]) {\n img = self.htmlImageCache[cacheKey];\n if (img.height !== cell.height || img.width !== cell.width) {\n // height and width of the cell has changed, invalidate cache\n self.htmlImageCache[cacheKey] = undefined;\n } else {\n if (!img.complete) {\n return;\n }\n return self.ctx.drawImage(img, x, y);\n }\n } else {\n cachedImagesDrawn = false;\n }\n img = new Image(cell.width, cell.height);\n self.htmlImageCache[cacheKey] = img;\n img.onload = function () {\n self.ctx.drawImage(img, x, y);\n drawOnAllImagesLoaded();\n };\n img.src = 'data:image/svg+xml;base64,' + btoa(\n '\\n' +\n '\\n' +\n '\\n' +\n v + '\\n' +\n '' +\n '\\n' +\n '\\n'\n );\n }\n function drawOrderByArrow(x, y) {\n var mt = self.style.columnHeaderOrderByArrowMarginTop * self.scale,\n ml = self.style.columnHeaderOrderByArrowMarginLeft * self.scale,\n mr = self.style.columnHeaderOrderByArrowMarginRight * self.scale,\n aw = self.style.columnHeaderOrderByArrowWidth * self.scale,\n ah = self.style.columnHeaderOrderByArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.columnHeaderOrderByArrowColor;\n self.ctx.strokeStyle = self.style.columnHeaderOrderByArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.orderDirection === 'asc') {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y + ah);\n self.ctx.lineTo(x + aw, y + ah);\n self.ctx.lineTo(x + (aw * 0.5), y);\n self.ctx.lineTo(x, y + ah);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function drawTreeArrow(cell, x, y) {\n var mt = self.style.treeArrowMarginTop * self.scale,\n mr = self.style.treeArrowMarginRight * self.scale,\n ml = self.style.treeArrowMarginLeft * self.scale,\n aw = self.style.treeArrowWidth * self.scale,\n ah = self.style.treeArrowHeight * self.scale;\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillStyle = self.style.treeArrowColor;\n self.ctx.strokeStyle = self.style.treeArrowBorderColor;\n self.ctx.beginPath();\n x = x + ml;\n y = y + mt;\n if (self.openChildren[cell.rowIndex]) {\n self.ctx.moveTo(x, y);\n self.ctx.lineTo(x + aw, y);\n self.ctx.lineTo(x + (aw * 0.5), y + ah);\n self.ctx.moveTo(x, y);\n } else {\n self.ctx.lineTo(x, y);\n self.ctx.lineTo(x + ah, y + (aw * 0.5));\n self.ctx.lineTo(x, y + aw);\n self.ctx.lineTo(x, y);\n }\n self.ctx.stroke();\n self.ctx.fill();\n return ml + aw + mr;\n }\n function radiusRect(x, y, w, h, radius) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n var r = x + w, b = y + h;\n self.ctx.beginPath();\n self.ctx.moveTo(x + radius, y);\n self.ctx.lineTo(r - radius, y);\n self.ctx.quadraticCurveTo(r, y, r, y + radius);\n self.ctx.lineTo(r, y + h - radius);\n self.ctx.quadraticCurveTo(r, b, r - radius, b);\n self.ctx.lineTo(x + radius, b);\n self.ctx.quadraticCurveTo(x, b, x, b - radius);\n self.ctx.lineTo(x, y + radius);\n self.ctx.quadraticCurveTo(x, y, x + radius, y);\n }\n function fillRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillRect(x, y, w, h);\n }\n function strokeRect(x, y, w, h) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.strokeRect(x, y, w, h);\n }\n function fillText(text, x, y) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.fillText(text, x, y);\n }\n function fillCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.fill();\n }\n function strokeCircle(x, y, r) {\n x += self.canvasOffsetLeft;\n y += self.canvasOffsetTop;\n self.ctx.beginPath();\n self.ctx.arc(x, y, r, 0, 2 * Math.PI);\n self.ctx.stroke();\n }\n function clipFrozenArea(mode) {\n // 0 both, 1 rows, 2 cols\n // self.lastFrozenColumnPixel;\n // self.lastFrozenRowPixel;\n self.ctx.beginPath();\n if (mode === 0) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, self.lastFrozenRowPixel);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 1) {\n self.ctx.moveTo(0, self.lastFrozenRowPixel);\n self.ctx.lineTo(0, self.height);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.width, self.lastFrozenRowPixel);\n }\n if (mode === 2) {\n self.ctx.moveTo(self.lastFrozenColumnPixel, 0);\n self.ctx.lineTo(self.width, 0);\n self.ctx.lineTo(self.width, self.height);\n self.ctx.lineTo(self.lastFrozenColumnPixel, self.height);\n }\n self.ctx.clip();\n }\n function fillHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return fillCircle(x, y, r * 0.5);\n }\n fillRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function strokeHandle(x, y, r) {\n if (self.style.selectionHandleType === 'circle') {\n return strokeCircle(x, y, r * 0.5);\n }\n strokeRect(x - r * 0.5, y - r * 0.5, r, r);\n }\n function addselectionHandle(c, pos) {\n var hw = self.style.selectionHandleSize,\n p = {\n tr: function () {\n fillHandle(c.x + c.width, c.y, hw);\n strokeHandle(c.x + c.width, c.y, hw);\n },\n br: function () {\n fillHandle(c.x + c.width, c.y + c.height, hw);\n strokeHandle(c.x + c.width, c.y + c.height, hw);\n },\n tl: function () {\n fillHandle(c.x, c.y, hw);\n strokeHandle(c.x, c.y, hw);\n },\n bl: function () {\n fillHandle(c.x, c.y + c.height, hw);\n strokeHandle(c.x, c.y + c.height, hw);\n }\n };\n p[pos]();\n }\n function addBorderLine(c, pos) {\n self.ctx.beginPath();\n var p = {\n t: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n },\n r: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n b: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft + c.width, c.y + self.canvasOffsetTop + c.height);\n },\n l: function () {\n self.ctx.moveTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop);\n self.ctx.lineTo(c.x + self.canvasOffsetLeft, c.y + self.canvasOffsetTop + c.height);\n }\n };\n p[pos]();\n self.ctx.stroke();\n }\n function addEllipsis(text, width) {\n var c, w = 0;\n if (self.ellipsisCache[text] && self.ellipsisCache[text][width]) {\n return self.ellipsisCache[text][width];\n }\n //TODO Add ellipsis back when there is a fast way to do it\n w = self.ctx.measureText(text).width;\n self.ellipsisCache[text] = self.ellipsisCache[text] || {};\n c = {value: text, width: w};\n self.ellipsisCache[text][width] = c;\n return c;\n }\n function wrapText(cell, splitChar) {\n if (!cell.formattedValue) {\n return { lines: [{width: 0, value: ''}], width: 0, height: cell.calculatedLineHeight };\n }\n var max = 0,\n n = '\\n',\n x,\n word,\n words = cell.formattedValue.split(splitChar),\n textHeight = cell.calculatedLineHeight,\n lines = [],\n out = [],\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n elWidth,\n et = self.attributes.ellipsisText,\n elClipLength,\n plWidth,\n clippedVal,\n ogWordWidth,\n previousLine,\n line = {\n width: 0,\n value: ''\n },\n cHeight = wrap ? cell.paddedHeight : cell.calculatedLineHeight;\n lines.push(line);\n elWidth = self.ctx.measureText(' ' + et).width;\n for (x = 0; x < words.length; x += 1) {\n word = words[x];\n var measure = self.ctx.measureText(word + splitChar);\n if (line.width + measure.width + elWidth < cell.paddedWidth) {\n line.value += word + splitChar;\n line.width += measure.width;\n continue;\n }\n // if there is a hyphenated word that is too long\n // split it and add the split set to the array\n // then back up and re-read new split set\n // this behavior seems right, it might not be\n if (/\\w-\\w/.test(word) && cell.paddedWidth < measure.width) {\n words.splice(x, 1, word.split('-')[0] + '-', word.split('-')[1]);\n x -= 1;\n continue;\n }\n line = {\n width: measure.width,\n value: word + splitChar\n };\n if (x === 0) {\n lines = [];\n lines.push(line);\n }\n textHeight += cell.calculatedLineHeight;\n if (textHeight > cHeight) {\n if (lines.length === 0) { break; }\n elClipLength = 1;\n previousLine = lines[lines.length - 1];\n if (previousLine.width < cell.paddedWidth && words.length === 1) { break; }\n clippedVal = previousLine.value + word;\n plWidth = self.ctx.measureText(clippedVal + et).width;\n var originText = clippedVal;\n if (plWidth > cell.paddedWidth) {\n var stepLength = parseInt(clippedVal.length / 2);\n var direction = -1;\n while (stepLength > 0) {\n clippedVal = originText.substr(0, stepLength * direction + clippedVal.length);\n plWidth = self.ctx.measureText(clippedVal + et).width;\n direction = plWidth > cell.paddedWidth ? -1 : 1;\n stepLength = parseInt(stepLength / 2);\n }\n }\n clippedVal = clippedVal + (originText.length != clippedVal.length ? et : '');\n previousLine.value = clippedVal;\n previousLine.width = plWidth;\n break;\n }\n if (x > 0) {\n lines.push(line);\n }\n }\n return {\n lines: lines,\n width: max,\n height: cell.calculatedLineHeight * lines.length\n }\n }\n function drawText(cell) {\n var ll = cell.text.lines.length,\n h = (cell.fontHeight * cell.lineHeight),\n x,\n line,\n wrap = self.style.cellWhiteSpace !== 'nowrap',\n textHeight = 0;\n for (x = 0; x < cell.text.lines.length; x += 1) {\n line = cell.text.lines[x];\n var vPos = Math.max((cell.height - (wrap ? cell.text.height : cell.calculatedLineHeight)) * 0.5, 0) + h,\n hPos = cell.paddingLeft + cell.treeArrowWidth + cell.orderByArrowWidth;\n if (cell.horizontalAlignment === 'right') {\n hPos = cell.paddingLeft + cell.paddedWidth - line.width;\n } else if (cell.horizontalAlignment === 'center') {\n hPos = cell.paddingLeft + ((cell.paddedWidth + cell.paddingRight) / 2) - (line.width / 2);\n }\n if (cell.verticalAlignment === 'top') {\n vPos = cell.calculatedLineHeight;\n } else if (cell.verticalAlignment === 'bottom') {\n vPos = cell.height - cell.paddingBottom - cell.text.height;\n }\n line.height = h + cell.lineSpacing;\n line.offsetLeft = hPos;\n line.offsetTop = vPos;\n line.x = cell.x + hPos;\n line.y = cell.y + textHeight + vPos;\n textHeight += line.height;\n fillText(line.value, line.x, line.y);\n }\n if (self.attributes.debug && cell.active) {\n requestAnimationFrame(function () {\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(JSON.stringify({\n x: cell.x,\n y: cell.y,\n h: cell.height,\n w: cell.width,\n pw: cell.paddedWidth,\n idx: cell.columnIndex,\n idx_ord: cell.sortColumnIndex\n }, null, '\\t'),\n cell.x + 14, cell.y + 14);\n fillText(JSON.stringify(cell.text.lines.map(function (l) { return {w: l.width, v: l.value.length }; }), null, '\\t'),\n cell.x + 14, cell.y + 30);\n });\n }\n }\n function getFrozenColumnsWidth() {\n var w = 0,\n s = self.getSchema(),\n x = 0,\n n = Math.min(self.frozenColumn, s.length),\n column;\n hiddenFrozenColumnCount = 0;\n while (x < n) {\n column = s[x];\n if (column.hidden) {\n hiddenFrozenColumnCount += 1;\n } else {\n w += self.getColummnWidth(x);\n }\n x += 1;\n }\n return w;\n }\n /**\n * Redraws the grid. No matter what the change, this is the only method required to refresh everything.\n * @memberof canvasDatagrid\n * @name draw\n * @method\n */\n // r = literal row index\n // rd = row data array\n // i = user order index\n // o = literal data index\n // y = y drawing cursor\n // x = x drawing cursor\n // s = visible schema array\n // cx = current x drawing cursor sub calculation var\n // cy = current y drawing cursor sub calculation var\n // a = static cell (like corner cell)\n // p = perf counter\n // l = data length\n // u = current cell\n // h = current height\n // w = current width\n self.draw = function (internal) {\n if (self.dispatchEvent('beforedraw', {})) { return; }\n if (!self.isChildGrid && (!self.height || !self.width)) {\n return;\n }\n if (self.isChildGrid && internal) {\n requestAnimationFrame(self.parentGrid.draw);\n return;\n }\n if (self.intf.visible === false) {\n return;\n }\n // initial values\n var checkScrollHeight, rowHeaderCell, p, cx, cy, treeGrid, rowOpen,\n rowHeight, cornerCell, y, x, c, h, w, s, r, rd, aCell,\n data = (self.data || []),\n bc = self.style.gridBorderCollapse === 'collapse',\n selectionBorders = [],\n moveBorders = [],\n selectionHandles = [],\n rowHeaders = [],\n l = data.length,\n u = self.currentCell || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n cellHeight = self.style.cellHeight;\n drawCount += 1;\n p = performance.now();\n self.visibleRowHeights = [];\n // if data length has changed, there is no way to know\n if (data.length > self.orders.rows.length) {\n self.createRowOrders();\n }\n function drawScrollBars() {\n var drawCorner,\n en = self.scrollBox.entities,\n m = (self.style.scrollBarBoxMargin * 2);\n self.ctx.strokeStyle = self.style.scrollBarBorderColor;\n self.ctx.lineWidth = self.style.scrollBarBorderWidth;\n en.horizontalBox.x = rowHeaderCellWidth + self.style.scrollBarBoxMargin\n + ((en.horizontalBar.width - self.scrollBox.scrollBoxWidth)\n * (self.scrollBox.scrollLeft / self.scrollBox.scrollWidth));\n en.verticalBox.y = columnHeaderCellHeight + self.style.scrollBarBoxMargin\n + ((en.verticalBar.height - self.scrollBox.scrollBoxHeight)\n * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight));\n if (self.scrollBox.horizontalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n strokeRect(en.horizontalBar.x, en.horizontalBar.y, en.horizontalBar.width + m, en.horizontalBar.height);\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (self.scrollBox.horizontalBoxVisible) {\n if (/horizontal/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.horizontalBox.x, en.horizontalBox.y,\n en.horizontalBox.width, en.horizontalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.horizontalBar);\n self.visibleCells.unshift(en.horizontalBox);\n }\n if (self.scrollBox.verticalBarVisible) {\n self.ctx.fillStyle = self.style.scrollBarBackgroundColor;\n fillRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n strokeRect(en.verticalBar.x, en.verticalBar.y, en.verticalBar.width, en.verticalBar.height + m);\n if (self.scrollBox.verticalBoxVisible) {\n self.ctx.fillStyle = self.style.scrollBarBoxColor;\n if (/vertical/.test(u.context)) {\n self.ctx.fillStyle = self.style.scrollBarActiveColor;\n }\n radiusRect(en.verticalBox.x, en.verticalBox.y, en.verticalBox.width,\n en.verticalBox.height, self.style.scrollBarBoxBorderRadius);\n self.ctx.stroke();\n self.ctx.fill();\n }\n drawCorner = true;\n self.visibleCells.unshift(en.verticalBar);\n self.visibleCells.unshift(en.verticalBox);\n }\n if (drawCorner) {\n //corner\n self.ctx.strokeStyle = self.style.scrollBarCornerBorderColor;\n self.ctx.fillStyle = self.style.scrollBarCornerBackgroundColor;\n radiusRect(en.corner.x, en.corner.y, en.corner.width, en.corner.height, 0);\n self.ctx.stroke();\n self.ctx.fill();\n self.visibleCells.unshift(en.corner);\n }\n }\n function createHandlesOverlayArray(cell) {\n if (self.attributes.allowMovingSelection || self.mobile) {\n if (cell.selectionBorderTop && cell.selectionBorderRight && self.mobile) {\n selectionHandles.push([cell, 'tr']);\n cell.selectionHandle = 'tr';\n }\n if (cell.selectionBorderTop && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'tl']);\n cell.selectionHandle = 'tl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderLeft && self.mobile) {\n selectionHandles.push([cell, 'bl']);\n cell.selectionHandle = 'bl';\n }\n if (cell.selectionBorderBottom && cell.selectionBorderRight\n && (self.attributes.selectionHandleBehavior !== 'none' || self.mobile)) {\n selectionHandles.push([cell, 'br']);\n cell.selectionHandle = 'br';\n }\n }\n }\n function createBorderOverlayArray(cell, drawArray, propPrefix, offsetPoint) {\n offsetPoint = offsetPoint || {x: 0, y: 0};\n cell.selectionBorder = '';\n if (!cell.isRowHeader\n && self.selections[cell.rowIndex + -offsetPoint.y]\n && self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) !== -1) {\n if ((!self.selections[cell.rowIndex - 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex - 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1\n || cell.rowIndex === 0)\n && !cell.isHeader) {\n drawArray.push([cell, 't']);\n cell[propPrefix + 'BorderTop'] = true;\n cell[propPrefix + 'Border'] += 't';\n }\n if (!self.selections[cell.rowIndex + 1 + -offsetPoint.y]\n || self.selections[cell.rowIndex + 1 + -offsetPoint.y].indexOf(cell.columnIndex + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'b']);\n cell[propPrefix + 'BorderBottom'] = true;\n cell[propPrefix + 'Border'] += 'b';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === 0\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex - 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'l']);\n cell[propPrefix + 'BorderLeft'] = true;\n cell[propPrefix + 'Border'] += 'l';\n }\n if (!self.selections[cell.rowIndex + -offsetPoint.y] || cell.columnIndex === s.length\n || self.selections[cell.rowIndex + -offsetPoint.y].indexOf(cell.columnIndex + 1 + -offsetPoint.x) === -1) {\n drawArray.push([cell, 'r']);\n cell[propPrefix + 'BorderRight'] = true;\n cell[propPrefix + 'Border'] += 'r';\n }\n }\n }\n function drawCell(d, rowOrderIndex, rowIndex) {\n return function drawEach(header, headerIndex, columnOrderIndex) {\n if (header.hidden) { return 0; }\n var cellStyle = header.style || 'cell',\n cellGridAttributes,\n cell,\n isHeader = /HeaderCell/.test(cellStyle),\n isCorner = /cornerCell/.test(cellStyle),\n isRowHeader = 'rowHeaderCell' === cellStyle,\n isColumnHeader = 'columnHeaderCell' === cellStyle,\n selected = self.selections[rowOrderIndex] && self.selections[rowOrderIndex].indexOf(columnOrderIndex) !== -1,\n hovered = self.hovers.rowIndex === rowOrderIndex && self.hovers.columnIndex === columnOrderIndex,\n active = self.activeCell.rowIndex === rowOrderIndex && self.activeCell.columnIndex === columnOrderIndex,\n isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',\n rawValue = d ? d[header.name] : undefined,\n isGrid = header.type === 'canvas-datagrid',\n activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex\n || self.orders.columns[self.activeCell.columnIndex] === headerIndex)\n && (columnOrderIndex === -1 || rowOrderIndex === -1)\n ? (isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell') : false,\n val,\n f = self.formatters[header.type || 'string'],\n orderByArrowSize = 0,\n treeArrowSize = 0,\n cellWidth = self.sizes.columns[headerIndex] || header.width,\n ev = {\n value: rawValue,\n row: d,\n header: header\n };\n if (isColumnHeaderCellCap) {\n cellWidth = w - x;\n }\n // if no data or schema are defined, a width is provided to the stub column\n if (cellWidth === undefined) {\n cellWidth = self.style.cellWidth;\n }\n cellWidth = cellWidth * self.scale;\n if (x + cellWidth + self.style.cellBorderWidth < 0) {\n x += cellWidth + self.style.cellBorderWidth;\n }\n if (active && cellStyle !== 'cornerCell') {\n cellStyle = 'activeCell';\n }\n if (self.visibleRows.indexOf(rowIndex) === -1 && !isHeader) {\n self.visibleRows.push(rowIndex);\n }\n val = self.dispatchEvent('formatcellvalue', ev);\n cx = x;\n cy = y;\n if (cellStyle === 'cornerCell') {\n cx = 0;\n cy = 0;\n } else if (isRowHeader) {\n cx = 0;\n } else if (isHeader) {\n cy = 0;\n }\n cell = {\n type: isGrid ? 'canvas-datagrid-cell' : header.type,\n style: cellStyle,\n nodeType: 'canvas-datagrid-cell',\n x: cx,\n y: cy,\n fontHeight: (self.style[cellStyle + 'FontHeight'] || 0) * self.scale,\n horizontalAlignment: self.style[cellStyle + 'HorizontalAlignment'],\n verticalAlignment: self.style[cellStyle + 'VerticalAlignment'],\n paddingLeft: (self.style[cellStyle + 'PaddingLeft'] || 0) * self.scale,\n paddingTop: (self.style[cellStyle + 'PaddingTop'] || 0) * self.scale,\n paddingRight: (self.style[cellStyle + 'PaddingRight'] || 0) * self.scale,\n paddingBottom: (self.style[cellStyle + 'PaddingBottom'] || 0) * self.scale,\n whiteSpace: self.style.cellWhiteSpace,\n lineHeight: self.style.cellLineHeight,\n lineSpacing: self.style.cellLineSpacing,\n offsetTop: self.canvasOffsetTop + cy,\n offsetLeft: self.canvasOffsetLeft + cx,\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n active: active || activeHeader,\n hovered: hovered,\n selected: selected,\n width: cellWidth,\n height: cellHeight,\n offsetWidth: cellWidth,\n offsetHeight: cellHeight,\n parentNode: self.intf.parentNode,\n offsetParent: self.intf.parentNode,\n data: d,\n isCorner: isCorner,\n isHeader: isHeader,\n isColumnHeader: isColumnHeader,\n isColumnHeaderCellCap: isColumnHeaderCellCap,\n isRowHeader: isRowHeader,\n rowOpen: rowOpen,\n header: header,\n columnIndex: columnOrderIndex,\n rowIndex: rowOrderIndex,\n sortColumnIndex: headerIndex,\n sortRowIndex: rowIndex,\n isGrid: isGrid,\n isNormal: !isGrid && !isCorner && !isHeader,\n gridId: (self.attributes.name || '') + rowIndex + ':' + headerIndex,\n parentGrid: self.intf,\n innerHTML: '',\n activeHeader: activeHeader,\n value: isHeader && !isRowHeader ? (header.title || header.name) : rawValue\n };\n cell.calculatedLineHeight = (cell.fontHeight * cell.lineHeight) + cell.lineSpacing;\n cell.paddedWidth = cell.width - cell.paddingRight - cell.paddingLeft;\n cell.paddedHeight = cell.height - cell.paddingTop - cell.paddingBottom;\n ev.cell = cell;\n cell.userHeight = cell.isHeader ? self.sizes.rows[-1] : rowHeight;\n cell.userWidth = cell.isHeader ? self.sizes.columns.cornerCell : self.sizes.columns[headerIndex];\n self.visibleCells.unshift(cell);\n if (self.dispatchEvent('beforerendercell', ev)) { return; }\n self.ctx.fillStyle = self.style[cellStyle + 'BackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'BorderColor'];\n self.ctx.lineWidth = self.style[cellStyle + 'BorderWidth'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'HoverBorderColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedBackgroundColor'];\n self.ctx.strokeStyle = self.style[cellStyle + 'SelectedBorderColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'BackgroundColor'];\n }\n self.dispatchEvent('rendercell', ev);\n if (cell.isGrid) {\n if (cell.height !== rowHeight) {\n cell.height = rowHeight || self.style.cellHeightWithChildGrid;\n checkScrollHeight = true;\n }\n cell.width = self.sizes.columns[headerIndex] || self.style.cellWidthWithChildGrid;\n }\n if (rowOpen && !cell.isRowHeader) {\n cell.height = self.sizes.rows[rowIndex] || self.style.cellHeight;\n }\n if (!cell.isGrid) {\n fillRect(cx, cy, cell.width, cell.height);\n strokeRect(cx, cy, cell.width, cell.height);\n }\n self.ctx.save();\n radiusRect(cell.x, cell.y, cell.width, cell.height, 0);\n self.ctx.clip();\n self.dispatchEvent('afterrendercell', ev);\n if (cell.height !== cellHeight && !(rowOpen && !cell.isRowHeader)) {\n self.sizes.rows[isHeader ? -1 : rowIndex] = cell.height;\n checkScrollHeight = true;\n }\n if (cell.width !== cellWidth) {\n self.sizes.columns[headerIndex] = cell.width;\n checkScrollHeight = true;\n }\n if (isRowHeader && self.attributes.tree) {\n if (!self.dispatchEvent('rendertreearrow', ev)) {\n treeArrowSize = drawTreeArrow(cell, self.style[cellStyle + 'PaddingLeft'], cy, 0);\n }\n }\n if ((self.attributes.showRowNumbers && isRowHeader)\n || !isRowHeader) {\n if (cell.isGrid && !self.dispatchEvent('beforerendercellgrid', ev)) {\n if (!self.childGrids[cell.gridId]) {\n // HACK: this only allows setting of the child grids styles if data is set _after_\n // this is less than desirable. An interface needs to be made to effect the\n // style of all cell grids. One for individual grids already exists.\n cellGridAttributes = self.cellGridAttributes;\n cellGridAttributes.name = self.attributes.saveAppearance ? cell.gridId : undefined;\n cellGridAttributes.component = false;\n cellGridAttributes.parentNode = cell;\n cellGridAttributes.data = rawValue;\n ev.cellGridAttributes = cellGridAttributes;\n if (self.dispatchEvent('beforecreatecellgrid', ev)) { return; }\n self.childGrids[cell.gridId] = self.createGrid(cellGridAttributes);\n self.sizes.rows[rowIndex]\n = self.sizes.rows[rowIndex] || self.style.cellGridHeight;\n checkScrollHeight = true;\n }\n cell.grid = self.childGrids[cell.gridId];\n cell.grid.parentNode = cell;\n cell.grid.visible = true;\n cell.grid.draw();\n self.dispatchEvent('rendercellgrid', ev);\n } else if (!cell.isGrid) {\n if (self.childGrids[cell.gridId]) {\n self.childGrids[cell.gridId].parentNode.offsetHeight = 0;\n }\n if (isHeader && self.orderBy === header.name) {\n if (!self.dispatchEvent('renderorderbyarrow', ev)) {\n orderByArrowSize = drawOrderByArrow(cx + self.style[cellStyle + 'PaddingLeft'], 0);\n }\n }\n self.ctx.fillStyle = self.style[cellStyle + 'Color'];\n if (hovered) {\n self.ctx.fillStyle = self.style[cellStyle + 'HoverColor'];\n }\n if (selected) {\n self.ctx.fillStyle = self.style[cellStyle + 'SelectedColor'];\n }\n if (activeHeader) {\n self.ctx.fillStyle = self.style[activeHeader + 'Color'];\n }\n cell.treeArrowWidth = treeArrowSize;\n cell.orderByArrowWidth = orderByArrowSize;\n // create text ref to see if height needs to expand\n val = val !== undefined ? val : f\n ? f(ev) : '';\n if (val === undefined && !f) {\n val = '';\n console.warn('canvas-datagrid: Unknown format '\n + header.type + ' add a cellFormater');\n }\n cell.formattedValue = ((val !== undefined && val !== null) ? val : '').toString();\n if (self.columnFilters && self.columnFilters[val] !== undefined && isHeader) {\n cell.formattedValue = self.attributes.filterTextPrefix + val;\n }\n self.ctx.font = (self.style[cellStyle + 'FontHeight'] * self.scale) + 'px ' + self.style[cellStyle + 'FontName'];\n if (!self.dispatchEvent('formattext', ev)) {\n cell.text = wrapText(cell, ' ');\n }\n if (!self.dispatchEvent('rendertext', ev)) {\n if (cell.innerHTML || header.type === 'html') {\n drawHtml(cell);\n } else {\n drawText(cell);\n }\n }\n }\n }\n if (active) {\n aCell = cell;\n }\n createBorderOverlayArray(cell, selectionBorders, 'selection');\n // createBorderOverlayArray calculates data for createHandlesOverlayArray so it must go 2nd\n createHandlesOverlayArray(cell);\n if (self.movingSelection) {\n createBorderOverlayArray(cell, moveBorders, 'move', self.moveOffset);\n }\n self.ctx.restore();\n x += cell.width + (bc ? 0 : self.style.cellBorderWidth);\n return cell.width;\n };\n }\n function drawRowHeader(rowData, index, rowOrderIndex) {\n var a, i;\n if (self.attributes.showRowHeaders) {\n x = 0;\n i = index + 1;\n rowHeaderCell = {'rowHeaderCell': i };\n a = {\n name: 'rowHeaderCell',\n width: self.sizes.columns[-1] || self.style.rowHeaderCellWidth,\n style: 'rowHeaderCell',\n type: 'string',\n data: i,\n index: -1\n };\n rowOpen = self.openChildren[index];\n drawCell(rowHeaderCell, index, rowOrderIndex)(a, -1, -1);\n }\n }\n function drawHeaders() {\n var d, g = s.length, i, o, columnHeaderCell, header, nonFrozenHeaderWidth;\n function drawHeaderColumnRange(start, end) {\n end = Math.min(end, g);\n for (o = start; o < end; o += 1) {\n i = self.orders.columns[o];\n header = s[i];\n if (!header.hidden) {\n d = {\n title: header.title,\n name: header.name,\n width: header.width || self.style.cellWidth,\n style: 'columnHeaderCell',\n type: 'string',\n index: o,\n order: i\n };\n columnHeaderCell = {'columnHeaderCell': header.title || header.name};\n x += drawCell(columnHeaderCell, -1, -1)(d, i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n }\n }\n rowHeaders.forEach(function (rArgs, rhIndex) {\n y = rArgs[3];\n cellHeight = rArgs[4];\n if (rhIndex === self.frozenRow) {\n self.ctx.save();\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n drawRowHeader(rArgs[0], rArgs[1], rArgs[2]);\n });\n self.ctx.restore();\n if (self.attributes.showColumnHeaders) {\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n y = 0;\n // cell height might have changed during drawing\n cellHeight = self.getColumnHeaderCellHeight();\n drawHeaderColumnRange(self.scrollIndexLeft, g);\n nonFrozenHeaderWidth = x;\n x = self.style.columnHeaderCellBorderWidth;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n drawHeaderColumnRange(0, self.frozenColumn);\n // fill in the space right of the headers\n x = nonFrozenHeaderWidth;\n if (x < w) {\n c = {\n name: '',\n width: self.style.scrollBarWidth,\n style: 'columnHeaderCellCap',\n isColumnHeaderCell: true,\n isColumnHeaderCellCap: true,\n type: 'string',\n index: s.length\n };\n drawCell({endCap: ''}, -1, -1)(c, -1, -1);\n }\n // fill in the space right of the headers\n if (self.attributes.showRowHeaders) {\n cornerCell = {'cornerCell': '' };\n x = 0;\n c = {\n name: 'cornerCell',\n width: self.style.rowHeaderCellWidth,\n style: 'cornerCell',\n type: 'string',\n index: -1\n };\n drawCell(cornerCell, -1, -1)(c, -1, -1);\n }\n }\n }\n function drawRow(r, d) {\n var i, treeHeight, rowSansTreeHeight, o, g = s.length;\n if (y - (cellHeight * 2) > h) {\n return false;\n }\n rd = data[r];\n rowOpen = self.openChildren[r];\n rowSansTreeHeight = (self.sizes.rows[r] || self.style.cellHeight) * self.scale;\n treeHeight = (rowOpen ? self.sizes.trees[r] : 0) * self.scale;\n rowHeight = (rowSansTreeHeight + treeHeight);\n if (y < -rowHeight) {\n return false;\n }\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n cellHeight = rowHeight;\n //draw normal columns\n for (o = (self.scrollIndexLeft); o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n self.scrollIndexRight = o;\n self.scrollPixelRight = x;\n break;\n }\n }\n //draw frozen columns\n x = 0;\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n for (o = 0; o < self.frozenColumn; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(rd, r, d)(s[i], i, o);\n if (x > self.width) {\n break;\n }\n }\n self.lastFrozenColumnPixel = x;\n // cell height might have changed during drawing\n cellHeight = rowHeight;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n // don't draw a tree for the new row\n treeGrid = self.childGrids[r];\n if (r !== data.length && rowOpen) {\n treeGrid.visible = true;\n treeGrid.parentNode = {\n offsetTop: y + rowSansTreeHeight + self.canvasOffsetTop,\n offsetLeft: rowHeaderCellWidth - 1 + self.canvasOffsetLeft,\n offsetHeight: treeHeight,\n offsetWidth: self.width - rowHeaderCellWidth - self.style.scrollBarWidth - 1,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: self.style,\n nodeType: 'canvas-datagrid-tree',\n scrollTop: self.scrollBox.scrollTop,\n scrollLeft: self.scrollBox.scrollLeft,\n rowIndex: r\n };\n self.visibleCells.unshift({\n rowIndex: r,\n columnIndex: 0,\n y: treeGrid.parentNode.offsetTop,\n x: treeGrid.parentNode.offsetLeft,\n height: treeGrid.height,\n width: treeGrid.width,\n style: 'tree-grid',\n type: treeGrid.parentNode.nodeType\n });\n treeGrid.draw();\n } else if (treeGrid) {\n treeGrid.parentNode.offsetHeight = 0;\n delete self.sizes.trees[r];\n }\n rowHeaders.push([rd, r, d, y, rowHeight]);\n self.visibleRowHeights[r] = rowHeight;\n y += cellHeight + (bc ? 0 : self.style.cellBorderWidth);\n return true;\n }\n function initDraw() {\n self.visibleRows = [];\n s = self.getSchema();\n self.visibleCells = [];\n self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0;\n self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : 0;\n h = self.height;\n w = self.width;\n }\n function drawBackground() {\n radiusRect(0, 0, w, h, 0);\n self.ctx.clip();\n self.ctx.fillStyle = self.style.gridBackgroundColor;\n fillRect(0, 0, w, h);\n }\n function drawFrozenRows() {\n var n, ln = Math.min(data.length, self.frozenRow);\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n y = columnHeaderCellHeight;\n for (r = 0; r < ln; r += 1) {\n n = self.orders.rows[r];\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.allowFreezingRows) {\n // HACK great, another stupid magic number.\n // Background will appear as a 0.5px artifact behind the row freeze bar without this hack\n y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;\n }\n self.lastFrozenRowPixel = y;\n }\n function drawRows() {\n self.ctx.save();\n if (self.frozenRow > 0) {\n radiusRect(0, self.lastFrozenRowPixel, self.width, self.height - self.lastFrozenRowPixel, 0);\n self.ctx.clip();\n }\n var o, n, i, g = s.length;\n x = -self.scrollBox.scrollLeft + self.scrollPixelLeft + self.style.cellBorderWidth;\n if (!self.attributes.snapToRow) {\n y += -self.scrollBox.scrollTop + self.scrollPixelTop + self.style.cellBorderWidth;\n }\n for (r = self.frozenRow + self.scrollIndexTop; r < l; r += 1) {\n n = self.orders.rows[r];\n self.scrollIndexBottom = r;\n self.scrollPixelBottom = y;\n if (!drawRow(n, r)) {\n break;\n }\n }\n if (self.attributes.showNewRow) {\n if (self.attributes.showRowHeaders) {\n x += rowHeaderCellWidth;\n }\n rowHeight = cellHeight = self.style.cellHeight;\n rowOpen = false;\n for (o = self.scrollIndexLeft; o < g; o += 1) {\n i = self.orders.columns[o];\n x += drawCell(self.newRow, data.length, data.length)(s[i], i, o);\n if (x > self.width + self.scrollBox.scrollLeft) {\n break;\n }\n }\n rowHeaders.push([self.newRow, data.length, data.length, y, rowHeight]);\n }\n self.ctx.restore();\n }\n function drawMoveMarkers() {\n if (!self.movingSelection) { return; }\n self.ctx.lineWidth = self.style.moveOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.moveOverlayBorderColor;\n self.ctx.setLineDash(self.style.moveOverlayBorderSegments);\n moveBorders.forEach(function (c) {\n addBorderLine(c[0], c[1]);\n });\n self.ctx.setLineDash([]);\n }\n function drawReorderMarkers() {\n if (!self.reorderObject) { return; }\n var b = {\n height: self.reorderObject.height,\n width: self.reorderObject.width,\n x: self.reorderObject.x + self.reorderObject.dragOffset.x,\n y: self.reorderObject.y + self.reorderObject.dragOffset.y\n },\n m = {\n width: w,\n height: h,\n x: 0,\n y: 0\n };\n self.ctx.fillStyle = self.style.reorderMarkerBackgroundColor;\n self.ctx.lineWidth = self.style.reorderMarkerBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerBorderColor;\n if (self.dragMode === 'row-reorder') {\n b.width = w;\n b.x = 0;\n m.width = w;\n m.height = self.currentCell.height;\n m.y = self.currentCell.y;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.rowIndex !== self.reorderObject.rowIndex\n && self.currentCell.rowIndex > -1\n && self.currentCell.rowIndex < l) {\n addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');\n }\n } else if (self.dragMode === 'column-reorder' && self.reorderObject) {\n b.height = h;\n b.y = 0;\n m.height = h;\n m.width = self.currentCell.width;\n m.y = 0;\n m.x = self.currentCell.x;\n fillRect(b.x, b.y, b.width, b.height);\n strokeRect(b.x, b.y, b.width, b.height);\n self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;\n self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;\n if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex\n && self.currentCell.sortColumnIndex > -1\n && self.currentCell.sortColumnIndex < s.length) {\n addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');\n }\n }\n }\n function drawBorder() {\n self.ctx.lineWidth = self.style.gridBorderWidth;\n self.ctx.strokeStyle = self.style.gridBorderColor;\n strokeRect(0, 0, self.width, self.height);\n }\n function drawSelectionBorders() {\n self.ctx.lineWidth = self.style.selectionOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.selectionOverlayBorderColor;\n function dsb(c) {\n addBorderLine(c[0], c[1]);\n }\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.save();\n clipFrozenArea(0);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(1);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex >= self.frozenRow && c[0].columnIndex < self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n self.ctx.save();\n clipFrozenArea(2);\n selectionBorders.filter(function (c) {\n return c[0].rowIndex < self.frozenRow && c[0].columnIndex >= self.frozenColumn;\n }).forEach(dsb);\n self.ctx.restore();\n }\n function drawSelectionHandles() {\n if (self.mobile || self.attributes.allowMovingSelection) {\n self.ctx.lineWidth = self.style.selectionHandleBorderWidth;\n self.ctx.strokeStyle = self.style.selectionHandleBorderColor;\n self.ctx.fillStyle = self.style.selectionHandleColor;\n selectionHandles.forEach(function (c) {\n addselectionHandle(c[0], c[1]);\n var az = self.attributes.touchSelectHandleZone / 2,\n ax = c[0].x + (c[1] === 'tl' || c[1] === 'bl' ? 0 : c[0].width) - az,\n ay = c[0].y + (c[1] === 'bl' || c[1] === 'br' ? c[0].height : 0) - az;\n self.visibleCells.unshift({\n x: ax,\n y: ay,\n height: self.style.selectionHandleSize + az,\n width: self.style.selectionHandleSize + az,\n style: 'selection-handle-' + c[1]\n });\n });\n }\n }\n function drawActiveCell() {\n if (!aCell) { return; }\n self.ctx.save();\n var cl = self.activeCell.columnIndex + 1 > self.frozenColumn || self.activeCell.rowIndex + 1 > self.frozenRow,\n acx = cl ? self.lastFrozenColumnPixel : 0,\n acy = cl ? self.lastFrozenRowPixel : 0,\n acw = cl ? self.width - self.lastFrozenColumnPixel : self.width,\n ach = cl ? self.height - self.lastFrozenRowPixel : self.height;\n radiusRect(acx, acy, acw, ach, 0);\n self.ctx.clip();\n if (self.attributes.selectionMode === 'row') {\n if (self.activeCell && self.activeCell.rowIndex === aCell.rowIndex) {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(0, aCell.y, self.getHeaderWidth() + rowHeaderCellWidth, self.visibleRowHeights[aCell.rowIndex]);\n }\n } else {\n self.ctx.lineWidth = self.style.activeCellOverlayBorderWidth;\n self.ctx.strokeStyle = self.style.activeCellOverlayBorderColor;\n strokeRect(aCell.x, aCell.y, aCell.width, aCell.height);\n }\n self.ctx.restore();\n }\n function drawFrozenMarkers() {\n var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,\n mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,\n xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',\n yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';\n self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;\n if (self.attributes.allowFreezingColumns) {\n self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);\n self.visibleCells.unshift({\n x: mx,\n y: 0,\n height: self.height,\n width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n style: 'frozen-column-marker'\n });\n }\n if (self.attributes.allowFreezingRows) {\n self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;\n self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;\n fillRect(0, my, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, my, self.width, self.style.frozenMarkerWidth);\n self.visibleCells.unshift({\n x: 0,\n y: my,\n height: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,\n width: self.width,\n style: 'frozen-row-marker'\n });\n }\n if (self.freezeMarkerPosition) {\n self.ctx.fillStyle = self.style.frozenMarkerActiveColor;\n self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;\n if (self.dragMode === 'frozen-column-marker') {\n fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);\n } else {\n fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);\n }\n }\n }\n function drawPerfLines() {\n if (!self.attributes.showPerformance) { return; }\n var pw = 250,\n px = self.width - pw - self.style.scrollBarWidth - (self.style.scrollBarBorderWidth * 2),\n py = columnHeaderCellHeight,\n ph = 100;\n if (scrollDebugCounters.length === 0) { scrollDebugCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (touchPPSCounters.length === 0) { touchPPSCounters = fillArray(0, perfWindowSize, 1, function () { return [0, 0]; }); }\n if (entityCount.length === 0) { entityCount = fillArray(0, perfWindowSize, 1, 0); }\n self.ctx.lineWidth = 0.5;\n function dpl(name, perfArr, arrIndex, max, color, useAbs, rowIndex) {\n var v;\n drawPerfLine(pw, ph, px, py, perfArr, arrIndex, max, color, useAbs);\n self.ctx.fillStyle = color;\n fillRect(3 + px, py + 9 + (rowIndex * 11), 8, 8);\n self.ctx.fillStyle = self.style.debugPerfChartTextColor;\n v = arrIndex !== undefined ? perfArr[0][arrIndex] : perfArr[0];\n fillText(name + ' ' + (isNaN(v) ? 0 : v).toFixed(3), 14 + px, py + 16 + (rowIndex * 11));\n }\n self.ctx.textAlign = 'left';\n self.ctx.font = self.style.debugFont;\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n fillRect(px, py, pw, ph);\n [['Scroll Height', scrollDebugCounters, 0, self.scrollBox.scrollHeight, self.style.debugScrollHeightColor, false],\n ['Scroll Width', scrollDebugCounters, 1, self.scrollBox.scrollWidth, self.style.debugScrollWidthColor, false],\n ['Performance', perfCounters, undefined, 200, self.style.debugPerformanceColor, false],\n ['Entities', entityCount, undefined, 1500, self.style.debugEntitiesColor, false],\n ['TouchPPSX', touchPPSCounters, 0, 1000, self.style.debugTouchPPSXColor, true],\n ['TouchPPSY', touchPPSCounters, 1, 1000, self.style.debugTouchPPSYColor, true]\n ].forEach(function (i, index) {\n i.push(index);\n dpl.apply(null, i);\n });\n self.ctx.fillStyle = self.style.debugPerfChartBackground;\n entityCount.pop();\n entityCount.unshift(self.visibleCells.length);\n scrollDebugCounters.pop();\n scrollDebugCounters.unshift([self.scrollBox.scrollTop, self.scrollBox.scrollLeft]);\n touchPPSCounters.pop();\n touchPPSCounters.unshift([self.yPPS, self.xPPS]);\n }\n function drawDebug() {\n self.ctx.save();\n var d;\n if (self.attributes.showPerformance || self.attributes.debug) {\n if (perfCounters.length === 0) { perfCounters = fillArray(0, perfWindowSize, 1, 0); }\n perfCounters.pop();\n perfCounters.unshift(performance.now() - p);\n }\n if (!self.attributes.debug) {\n self.ctx.restore();\n return;\n }\n self.ctx.font = self.style.debugFont;\n d = {};\n d.perf = (perfCounters.reduce(function (a, b) {\n return a + b;\n }, 0) / Math.min(drawCount, perfCounters.length)).toFixed(1);\n d.perfDelta = perfCounters[0].toFixed(1);\n d.frozenColumnsWidth = getFrozenColumnsWidth();\n d.htmlImages = Object.keys(self.htmlImageCache).length;\n d.reorderObject = 'x: ' + (self.reorderObject || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderObject || {rowIndex: 0}).rowIndex;\n d.reorderTarget = 'x: ' + (self.reorderTarget || {columnIndex: 0}).columnIndex + ', y: ' + (self.reorderTarget || {rowIndex: 0}).rowIndex;\n d.scale = self.scale;\n d.startScale = self.startScale;\n d.scaleDelta = self.scaleDelta;\n d.zoomDeltaStart = self.zoomDeltaStart;\n d.touchLength = self.touchLength;\n d.touches = 'y0: ' + (self.touchPosition || {y: 0}).y + ' y1: ' + (self.touchPosition1 || {y: 0}).y;\n d.scrollBox = self.scrollBox.toString();\n d.scrollIndex = 'x: ' + self.scrollIndexLeft + ', y: ' + self.scrollIndexTop;\n d.scrollPixel = 'x: ' + self.scrollPixelLeft + ', y: ' + self.scrollPixelTop;\n d.canvasOffset = 'x: ' + self.canvasOffsetLeft + ', y: ' + self.canvasOffsetTop;\n d.touchDelta = 'x: ' + self.touchDelta.x + ', y: ' + self.touchDelta.y;\n d.touchAnimateTo = 'x: ' + self.touchAnimateTo.x + ', y: ' + self.touchAnimateTo.y;\n d.scrollAnimation = 'x: ' + self.scrollAnimation.x + ', y: ' + self.scrollAnimation.y;\n d.touchPPS = 'x: ' + self.xPPS + ', y: ' + self.yPPS;\n d.touchPPST = 'x: ' + self.xPPST + ', y: ' + self.yPPST;\n d.touchDuration = self.touchDuration;\n d.pointerLockPosition = self.pointerLockPosition ?\n self.pointerLockPosition.x + ', ' + self.pointerLockPosition.y : '';\n d.size = 'w: ' + self.width + ', h: ' + self.height;\n d.mouse = 'x: ' + self.mouse.x + ', y: ' + self.mouse.y;\n d.touch = !self.touchStart\n ? '' : 'x: ' + self.touchStart.x + ', y: ' + self.touchStart.y;\n d.entities = self.visibleCells.length;\n d.hasFocus = self.hasFocus;\n d.dragMode = self.dragMode;\n if (self.currentCell) {\n d.columnIndex = self.currentCell.columnIndex;\n d.rowIndex = self.currentCell.rowIndex;\n d.sortColumnIndex = self.currentCell.sortColumnIndex;\n d.sortRowIndex = self.currentCell.sortRowIndex;\n d.context = self.currentCell.context;\n d.dragContext = self.currentCell.dragContext;\n d.style = self.currentCell.style;\n d.type = self.currentCell.type;\n }\n self.ctx.textAlign = 'right';\n self.ctx.fillStyle = self.style.debugBackgroundColor;\n fillRect(0, 0, self.width, self.height);\n Object.keys(d).forEach(function (key, index) {\n var m = key + ': ' + d[key],\n lh = 14;\n self.ctx.fillStyle = self.style.debugColor;\n fillText(m, w - 20, (self.attributes.showPerformance ? 140 : 24) + (index * lh));\n });\n self.ctx.restore();\n }\n self.ctx.save();\n initDraw();\n drawBackground();\n drawFrozenRows();\n drawRows();\n drawActiveCell();\n drawHeaders();\n drawFrozenMarkers();\n drawSelectionHandles();\n drawReorderMarkers();\n drawMoveMarkers();\n drawBorder();\n drawSelectionBorders();\n drawScrollBars();\n if (checkScrollHeight) {\n self.resize(true);\n }\n drawDebug();\n drawPerfLines();\n if (self.dispatchEvent('afterdraw', {})) { return; }\n self.ctx.restore();\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/draw.js\n// module id = 3\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var wheeling;\n self.stopPropagation = function (e) { e.stopPropagation(); };\n /**\n * Adds an event listener to the given event.\n * @memberof canvasDatagrid\n * @name addEventListener\n * @method\n * @param {string} ev The name of the event to subscribe to.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.addEventListener = function (ev, fn) {\n self.events[ev] = self.events[ev] || [];\n self.events[ev].unshift(fn);\n };\n /**\n * Removes the given listener function from the given event. Must be an actual reference to the function that was bound.\n * @memberof canvasDatagrid\n * @name removeEventListener\n * @method\n * @param {string} ev The name of the event to unsubscribe from.\n * @param {function} fn The event procedure to execute when the event is raised.\n */\n self.removeEventListener = function (ev, fn) {\n (self.events[ev] || []).forEach(function removeEachListener(sfn, idx) {\n if (fn === sfn) {\n self.events[ev].splice(idx, 1);\n }\n });\n };\n /**\n * Fires the given event, padding an event object to the event subscribers.\n * @memberof canvasDatagrid\n * @name dispatchEvent\n * @method\n * @param {number} ev The name of the event to dispatch.\n * @param {number} e The event object.\n */\n self.dispatchEvent = function (ev, e) {\n e = ev.type ? ev : (e || {});\n ev = ev.type || ev;\n var defaultPrevented;\n function preventDefault() {\n defaultPrevented = true;\n }\n if (!self.events[ev]) { return; }\n self.events[ev].forEach(function dispatchEachEvent(fn) {\n e.ctx = self.ctx;\n e.preventDefault = preventDefault;\n fn.apply(self.intf, [e]);\n });\n return defaultPrevented;\n };\n self.getRatio = function () {\n return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) /\n (self.ctx.webkitBackingStorePixelRatio ||\n self.ctx.mozBackingStorePixelRatio ||\n self.ctx.msBackingStorePixelRatio ||\n self.ctx.oBackingStorePixelRatio ||\n self.ctx.backingStorePixelRatio || 1));\n };\n self.resize = function (drawAfterResize) {\n if (!self.canvas) { return; }\n var x,\n v = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-bar'\n },\n n = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-bar'\n },\n vb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'vertical-scroll-box'\n },\n nb = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n style: 'horizontal-scroll-box'\n },\n co = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n isCorner: true,\n isScrollBoxCorner: true,\n style: 'scroll-box-corner'\n },\n m = (self.style.scrollBarBoxMargin * 2),\n b = (self.style.scrollBarBorderWidth * 2),\n d = self.style.scrollBarBoxMargin * 0.5,\n sbw = self.style.scrollBarWidth + (self.style.scrollBarBorderWidth * 2),\n ratio = self.getRatio(),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n cellBorder = self.style.cellBorderWidth * bm,\n columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,\n dataHeight = 0,\n dataWidth = 0,\n dims,\n l = (self.data || []).length,\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n ch = self.style.cellHeight,\n s = self.getSchema();\n // sets actual DOM canvas element\n function checkScrollBoxVisibility() {\n self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden')\n || self.style.overflowX === 'scroll';\n self.scrollBox.horizontalBoxVisible = dataWidth > self.scrollBox.width;\n self.scrollBox.verticalBarVisible = (self.style.height !== 'auto' && dataHeight > self.scrollBox.height && self.style.overflowY !== 'hidden')\n || self.style.overflowY === 'scroll';\n self.scrollBox.verticalBoxVisible = dataHeight > self.scrollBox.height;\n }\n function setScrollBoxSize() {\n self.scrollBox.width = self.width - rowHeaderCellWidth;\n self.scrollBox.height = self.height - columnHeaderCellHeight;\n }\n function setCanvasSize() {\n if (self.isChildGrid) {\n return;\n }\n dims = {\n // HACK +1 ? maybe it's a magic cell border? Required to line up properly in auto height mode.\n height: columnHeaderCellHeight + dataHeight + cellBorder + 1,\n width: dataWidth + rowHeaderCellWidth + cellBorder\n };\n ['width', 'height'].forEach(function (dim) {\n //TODO: support inherit\n if (['auto', undefined].indexOf(self.style[dim]) !== -1\n && ['auto', undefined].indexOf(self.appliedInlineStyles[dim]) !== -1) {\n self.parentNodeStyle[dim] = dims[dim] + 'px';\n } else {\n self.parentNodeStyle[dim] = self.style[dim];\n if (self.isComponet) {\n self.canvas.style[dim] = self.style[dim];\n }\n }\n });\n }\n self.scrollCache.x = [];\n self.scrollCache.y = [];\n for (x = 0; x < l; x += 1) {\n self.scrollCache.y[x] = dataHeight;\n dataHeight += (((self.sizes.rows[x] || ch) + (self.sizes.trees[x] || 0)) * self.scale)\n // HACK? if an expanded tree row is frozen it is necessary to add the tree row's height a second time.\n + (self.frozenRow > x ? (self.sizes.trees[x] || 0) : 0);\n }\n if (l > 1) {\n self.scrollCache.y[x] = dataHeight;\n }\n dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {\n // intentional redefintion of column. This causes scrollCache to be in the correct order\n column = s[self.orders.columns[columnIndex]];\n if (column.hidden) {\n self.scrollCache.x[columnIndex] = accumulator;\n return accumulator;\n }\n var va = accumulator + self.getColummnWidth(self.orders.columns[columnIndex]);\n self.scrollCache.x[columnIndex] = va;\n return va;\n }, 0) || 0;\n if (self.attributes.showNewRow) {\n dataHeight += ch;\n }\n if (self.attributes.snapToRow) {\n dataHeight += self.style.cellHeight;\n }\n setCanvasSize();\n if (self.isChildGrid) {\n self.width = self.parentNode.offsetWidth;\n self.height = self.parentNode.offsetHeight;\n } else if (self.height !== self.canvas.offsetHeight || self.width !== self.canvas.offsetWidth) {\n self.height = self.canvas.offsetHeight;\n self.width = self.canvas.offsetWidth;\n self.canvasOffsetLeft = self.args.canvasOffsetLeft || 0;\n self.canvasOffsetTop = self.args.canvasOffsetTop || 0;\n }\n /// calculate scroll bar dimensions\n // non-controversial\n self.scrollBox.top = columnHeaderCellHeight + columnHeaderCellBorder;\n self.scrollBox.left = rowHeaderCellWidth;\n // width and height of scroll box\n setScrollBoxSize();\n // is the data larger than the scroll box\n checkScrollBoxVisibility();\n // if the scroll box is visible, make room for it by expanding the size of the element\n // if the other dimension is set to auto\n if (self.scrollBox.horizontalBarVisible) {\n if (self.style.height === 'auto' && !self.isChildGrid) {\n self.height += sbw;\n }\n dataHeight += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n if (self.scrollBox.verticalBarVisible) {\n if (self.style.width === 'auto' && !self.isChildGrid) {\n self.width += sbw;\n }\n dataWidth += sbw;\n setCanvasSize();\n setScrollBoxSize();\n checkScrollBoxVisibility();\n }\n // set again after bar visibility checks\n setScrollBoxSize();\n self.scrollBox.scrollWidth = dataWidth - self.scrollBox.width;\n self.scrollBox.scrollHeight = dataHeight - self.scrollBox.height;\n self.scrollBox.widthBoxRatio = self.scrollBox.width / dataWidth;\n self.scrollBox.scrollBoxWidth = self.scrollBox.width\n * self.scrollBox.widthBoxRatio\n - self.style.scrollBarWidth - b - d;\n // TODO: This heightBoxRatio number is terribly wrong.\n // They should be a result of the size of the grid/canvas?\n // it being off causes the scroll bar to \"slide\" under\n // the dragged mouse.\n // https://github.com/TonyGermaneri/canvas-datagrid/issues/97\n self.scrollBox.heightBoxRatio = (self.scrollBox.height - columnHeaderCellHeight) / dataHeight;\n self.scrollBox.scrollBoxHeight = self.scrollBox.height\n * self.scrollBox.heightBoxRatio\n - self.style.scrollBarWidth - b - d;\n self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);\n self.scrollBox.scrollBoxHeight = Math.max(self.scrollBox.scrollBoxHeight, self.style.scrollBarBoxMinSize);\n // horizontal\n n.x += rowHeaderCellWidth;\n n.y += self.height - self.style.scrollBarWidth - d;\n n.width = self.width - self.style.scrollBarWidth - rowHeaderCellWidth - d - m;\n n.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n // horizontal box\n nb.y = n.y + self.style.scrollBarBoxMargin;\n nb.width = self.scrollBox.scrollBoxWidth;\n nb.height = self.style.scrollBarBoxWidth;\n // vertical\n v.x += self.width - self.style.scrollBarWidth - self.style.scrollBarBorderWidth - d;\n v.y += columnHeaderCellHeight;\n v.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth + d;\n v.height = self.height - columnHeaderCellHeight - self.style.scrollBarWidth - d - m;\n // vertical box\n vb.x = v.x + self.style.scrollBarBoxMargin;\n vb.width = self.style.scrollBarBoxWidth;\n vb.height = self.scrollBox.scrollBoxHeight;\n // corner\n co.x = n.x + n.width + m;\n co.y = v.y + v.height + m;\n co.width = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n co.height = self.style.scrollBarWidth + self.style.scrollBarBorderWidth;\n self.scrollBox.entities = {\n horizontalBar: n,\n horizontalBox: nb,\n verticalBar: v,\n verticalBox: vb,\n corner: co\n };\n self.scrollBox.bar = {\n v: v,\n h: n\n };\n self.scrollBox.box = {\n v: vb,\n h: nb\n };\n /// calculate page and dom elements\n self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap);\n // set canvas drawing related items\n if (!self.isChildGrid) {\n self.canvas.width = self.width * ratio;\n self.canvas.height = self.height * ratio;\n self.ctx.scale(ratio, ratio);\n }\n // resize any open dom elements (input/textarea)\n self.resizeEditInput();\n self.scroll(true);\n if (drawAfterResize) {\n self.draw(true);\n }\n self.dispatchEvent('resize', {});\n return true;\n };\n self.scroll = function (dontDraw) {\n var s = self.getSchema(),\n l = (self.data || []).length,\n ch = self.style.cellHeight;\n // go too far in leaps, then get focused\n self.scrollIndexTop = Math.floor((l * (self.scrollBox.scrollTop / self.scrollBox.scrollHeight)) - 100);\n self.scrollIndexTop = Math.max(self.scrollIndexTop, 0);\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n // sometimes the grid is rendered but the height is zero\n if (self.scrollBox.scrollHeight === 0) {\n self.scrollIndexTop = 0;\n }\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = self.frozenColumn;\n self.scrollPixelLeft = 0;\n while (self.scrollPixelTop < self.scrollBox.scrollTop && self.scrollIndexTop < self.data.length) {\n // start on index +1 since index 0 was used in \"go too far\" section above\n self.scrollIndexTop += 1;\n self.scrollPixelTop = self.scrollCache.y[self.scrollIndexTop];\n }\n while (self.scrollPixelLeft < (self.scrollBox.scrollLeft + 1) && self.scrollIndexLeft < s.length) {\n self.scrollPixelLeft = self.scrollCache.x[self.scrollIndexLeft];\n self.scrollIndexLeft += 1;\n }\n if (s.length > 0) {\n self.scrollIndexLeft = Math.max(self.scrollIndexLeft - 1, 0);\n self.scrollPixelLeft -= self.getColummnWidth(self.orders.columns[self.scrollIndexLeft]);\n }\n if ((self.data || []).length > 0) {\n self.scrollIndexTop = Math.max(self.scrollIndexTop - 1, 0);\n self.scrollPixelTop = Math.max((self.scrollPixelTop\n - (\n self.data[self.scrollIndexTop] ? (self.sizes.rows[self.scrollIndexTop] || ch)\n + (self.sizes.trees[self.scrollIndexTop] || 0)\n : ch\n ) * self.scale), 0);\n }\n self.ellipsisCache = {};\n if (!dontDraw) {\n self.draw(true);\n }\n //TODO: figure out why this has to be delayed for child grids\n //BUG: wheeling event on 3rd level hierarchy fails to move input box\n requestAnimationFrame(self.resizeEditInput);\n self.dispatchEvent('scroll', {top: self.scrollBox.scrollTop, left: self.scrollBox.scrollLeft});\n };\n self.mousemove = function (e, overridePos) {\n if (self.contextMenu || self.input) {\n return;\n }\n self.mouse = overridePos || self.getLayerPos(e);\n var ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n i,\n s = self.getSchema(),\n dragBounds,\n sBounds,\n x = self.mouse.x,\n y = self.mouse.y,\n o = self.getCellAt(x, y),\n delta,\n ev = {NativeEvent: e, cell: o, x: x, y: y},\n previousCell = self.currentCell;\n clearTimeout(self.scrollTimer);\n if (!self.isInGrid({x: x, y: y})) {\n self.hasFocus = false;\n }\n if (self.dispatchEvent('mousemove', ev)) {\n return;\n }\n if (o && self.currentCell) {\n self.rowBoundaryCrossed = self.currentCell.rowIndex !== o.rowIndex;\n self.columnBoundaryCrossed = self.currentCell.columnIndex !== o.columnIndex;\n self.cellBoundaryCrossed = self.rowBoundaryCrossed || self.columnBoundaryCrossed;\n ['row', 'column', 'cell'].forEach(function (prefix) {\n if (self[prefix + 'BoundaryCrossed']) {\n ev.cell = previousCell;\n self.dispatchEvent(prefix + 'mouseout', ev);\n ev.cell = o;\n self.dispatchEvent(prefix + 'mouseover', ev);\n }\n });\n }\n self.currentCell = o;\n if (!self.hasFocus) {\n return;\n }\n self.hovers = {};\n if (!self.draggingItem\n && o\n && self.scrollModes.indexOf(o.context) === -1) {\n self.dragItem = o;\n self.dragMode = o.dragContext;\n self.cursor = o.context;\n if (o.context === 'cell') {\n self.cursor = 'default';\n self.hovers = { rowIndex: o.rowIndex, columnIndex: o.columnIndex };\n }\n if ((self.selecting || self.reorderObject)\n && o.context === 'cell') {\n delta = {\n x: Math.abs(self.dragStart.x - x),\n y: Math.abs(self.dragStart.y - y)\n };\n if (self.dragStartObject.columnIndex !== -1 && e.shiftKey) {\n self.dragStartObject = {\n rowIndex: self.activeCell.rowIndex,\n columnIndex: self.activeCell.columnIndex\n };\n }\n dragBounds = {\n top: Math.min(self.dragStartObject.rowIndex, o.rowIndex),\n left: Math.min(self.dragStartObject.columnIndex, o.columnIndex),\n bottom: Math.max(self.dragStartObject.rowIndex, o.rowIndex),\n right: Math.max(self.dragStartObject.columnIndex, o.columnIndex)\n };\n if (self.dragStartObject.columnIndex === -1) {\n sBounds = self.getSelectionBounds();\n dragBounds.left = -1;\n dragBounds.right = s.length - 1;\n dragBounds.top = Math.min(sBounds.top, o.rowIndex);\n dragBounds.bottom = Math.max(sBounds.bottom, o.rowIndex);\n }\n if (self.dragStartObject.rowIndex !== o.rowIndex\n || self.dragStartObject.columnIndex !== o.columnIndex) {\n self.ignoreNextClick = true;\n }\n if (self.cellBoundaryCrossed || (delta.x === 0 && delta.y === 0) || (self.attributes.selectionMode === 'row')) {\n if (((self.attributes.selectionMode === 'row') || self.dragStartObject.columnIndex === -1)\n && self.rowBoundaryCrossed) {\n self.selectRow(o.rowIndex, ctrl, null, true);\n } else if (self.attributes.selectionMode !== 'row') {\n if (!self.dragAddToSelection && o.rowIndex !== undefined) {\n if (self.selections[o.rowIndex] && self.selections[o.rowIndex].indexOf(o.columnIndex) !== -1) {\n self.selections[o.rowIndex].splice(self.selections[o.rowIndex].indexOf(o.columnIndex), 1);\n }\n } else {\n self.selections[o.rowIndex] = self.selections[o.rowIndex] || [];\n if (self.selections[o.rowIndex].indexOf(o.columnIndex) === -1) {\n self.selections[o.rowIndex].push(o.columnIndex);\n }\n }\n }\n }\n if ((!self.selectionBounds || (dragBounds.top !== self.selectionBounds.top\n || dragBounds.left !== self.selectionBounds.left\n || dragBounds.bottom !== self.selectionBounds.bottom\n || dragBounds.right !== self.selectionBounds.right)) && !ctrl) {\n self.selections = [];\n sBounds = dragBounds;\n if (self.attributes.selectionMode === 'row') {\n for (i = sBounds.top; i <= sBounds.bottom; i += 1) {\n self.selectRow(i, true, null, true);\n }\n } else if (dragBounds.top !== -1) {\n self.selectArea(sBounds, true);\n }\n }\n self.autoScrollZone(e, x, y, ctrl);\n }\n }\n self.cellBoundaryCrossed = false;\n self.rowBoundaryCrossed = false;\n self.columnBoundaryCrossed = false;\n self.draw(true);\n };\n self.click = function (e, overridePos) {\n var i,\n startingBounds = JSON.stringify(self.getSelectionBounds()),\n ctrl = (e.ctrlKey || e.metaKey || self.attributes.persistantSelectionMode),\n pos = overridePos || self.getLayerPos(e);\n self.currentCell = self.getCellAt(pos.x, pos.y);\n if (self.currentCell.grid !== undefined) {\n return;\n }\n function checkSelectionChange() {\n var ev, sb = self.getSelectionBounds();\n if (startingBounds === JSON.stringify(sb)) {\n return;\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n if (self.input) {\n self.endEdit();\n }\n if (self.ignoreNextClick) {\n self.ignoreNextClick = false;\n return;\n }\n i = self.currentCell;\n if (self.dispatchEvent('click', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (['rowHeaderCell', 'columnHeaderCell'].indexOf(self.currentCell.style) === -1 && !ctrl) {\n self.setActiveCell(i.columnIndex, i.rowIndex);\n }\n if (self.currentCell.context === 'cell') {\n if (self.currentCell.style === 'cornerCell') {\n self.selectAll();\n self.draw();\n checkSelectionChange();\n return;\n }\n if (self.currentCell.style === 'columnHeaderCell') {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === i.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(i.header.name, self.orderDirection);\n checkSelectionChange();\n return;\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectColumn(i.header.index, ctrl, e.shiftKey);\n self.draw();\n return;\n }\n }\n self.selections[i.rowIndex] = self.selections[i.rowIndex] || [];\n if (((self.attributes.selectionMode === 'row') || self.currentCell.style === 'rowHeaderCell')) {\n if (self.currentCell.style === 'rowHeaderCell'\n && self.attributes.tree && pos.x > 0\n && pos.x - self.currentCell.x < self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft\n + self.style.treeArrowMarginRight + self.style.treeArrowClickRadius\n && pos.y - self.currentCell.y < self.style.treeArrowHeight\n + self.style.treeArrowMarginTop + self.style.treeArrowClickRadius\n && pos.y > 0) {\n self.toggleTree(i.rowIndex);\n return;\n }\n }\n if (e.shiftKey && !ctrl) {\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, false);\n }\n }\n checkSelectionChange();\n self.draw(true);\n };\n self.dragResizeColumn = function (e) {\n var pos, x, y;\n pos = self.getLayerPos(e);\n x = self.resizingStartingWidth + pos.x - self.dragStart.x;\n y = self.resizingStartingHeight + pos.y - self.dragStart.y;\n if (x < self.style.minColumnWidth) {\n x = self.style.minColumnWidth;\n }\n if (y < self.style.minRowHeight) {\n y = self.style.minRowHeight;\n }\n if (self.dispatchEvent('resizecolumn', {x: x, y: y, draggingItem: self.draggingItem})) { return false; }\n if (self.scrollBox.scrollLeft > self.scrollBox.scrollWidth - self.attributes.resizeScrollZone\n && self.dragMode === 'ew-resize') {\n self.resize(true);\n self.scrollBox.scrollLeft += x;\n }\n if (self.dragMode === 'ew-resize') {\n self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] = x;\n if (['rowHeaderCell', 'cornerCell'].indexOf(self.draggingItem.header.style) !== -1) {\n self.resize(true);\n }\n self.resizeChildGrids();\n return;\n }\n if (self.dragMode === 'ns-resize') {\n if (self.draggingItem.rowOpen) {\n self.sizes.trees[self.draggingItem.rowIndex] = y;\n } else if (self.attributes.globalRowResize) {\n self.style.cellHeight = y;\n } else {\n self.sizes.rows[self.draggingItem.rowIndex] = y;\n }\n self.dispatchEvent('resizerow', {row: y});\n self.resizeChildGrids();\n return;\n }\n self.ellipsisCache = {};\n };\n self.stopDragResize = function () {\n self.resize();\n document.body.removeEventListener('mousemove', self.dragResizeColumn, false);\n document.body.removeEventListener('mouseup', self.stopDragResize, false);\n self.setStorageData();\n self.draw(true);\n self.ignoreNextClick = true;\n };\n self.scrollGrid = function (e) {\n var pos = self.getLayerPos(e);\n if (self.attributes.scrollPointerLock && self.pointerLockPosition\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition.x += e.movementX;\n self.pointerLockPosition.y += e.movementY;\n self.pointerLockPosition.x = Math.min(self.width - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.x));\n self.pointerLockPosition.y = Math.min(self.height - self.style.scrollBarWidth, Math.max(0, self.pointerLockPosition.y));\n pos = self.pointerLockPosition;\n }\n self.scrollMode = self.getCellAt(pos.x, pos.y).context;\n if (self.scrollMode === 'horizontal-scroll-box' && self.scrollStartMode !== 'horizontal-scroll-box') {\n self.scrollStartMode = 'horizontal-scroll-box';\n self.dragStart = pos;\n self.scrollStart.left = self.scrollBox.scrollLeft;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box' && self.scrollStartMode !== 'vertical-scroll-box') {\n self.scrollStartMode = 'vertical-scroll-box';\n self.dragStart = pos;\n self.scrollStart.top = self.scrollBox.scrollTop;\n clearTimeout(self.scrollTimer);\n return;\n }\n if (self.scrollStartMode === 'vertical-scroll-box'\n && self.scrollMode !== 'vertical-scroll-box') {\n self.scrollMode = 'vertical-scroll-box';\n }\n if (self.scrollStartMode === 'horizontal-scroll-box'\n && self.scrollMode !== 'horizontal-scroll-box') {\n self.scrollMode = 'horizontal-scroll-box';\n }\n clearTimeout(self.scrollTimer);\n if (self.scrollModes.indexOf(self.scrollMode) === -1) {\n return;\n }\n if (self.scrollMode === 'vertical-scroll-box') {\n self.scrollBox.scrollTop = self.scrollStart.top + ((pos.y - self.dragStart.y)\n / self.scrollBox.heightBoxRatio);\n } else if (self.scrollMode === 'vertical-scroll-top') {\n self.scrollBox.scrollTop -= (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'vertical-scroll-bottom') {\n self.scrollBox.scrollTop += (self.page * self.style.cellHeight);\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n if (self.scrollMode === 'horizontal-scroll-box') {\n self.scrollBox.scrollLeft = self.scrollStart.left + ((pos.x - self.dragStart.x)\n / self.scrollBox.widthBoxRatio);\n } else if (self.scrollMode === 'horizontal-scroll-right') {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n } else if (self.scrollMode === 'horizontal-scroll-left') {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n self.scrollTimer = setTimeout(self.scrollGrid, self.attributes.scrollRepeatRate, e);\n }\n };\n self.stopScrollGrid = function () {\n clearTimeout(self.scrollTimer);\n if (document.exitPointerLock) {\n document.exitPointerLock();\n }\n document.removeEventListener('mousemove', self.scrollGrid, false);\n };\n self.dragReorder = function (e) {\n var pos, x, y,\n columReorder = self.dragMode === 'column-reorder',\n rowReorder = self.dragMode === 'row-reorder';\n pos = self.getLayerPos(e);\n x = pos.x - self.dragStart.x;\n y = pos.y - self.dragStart.y;\n if (!self.attributes.allowColumnReordering && columReorder) {\n return;\n }\n if (!self.attributes.allowRowReordering && rowReorder) {\n return;\n }\n if (self.dispatchEvent('reordering', {\n NativeEvent: e,\n source: self.dragStartObject,\n target: self.currentCell,\n dragMode: self.dragMode\n })) {\n return;\n }\n if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {\n self.reorderObject = self.draggingItem;\n self.reorderTarget = self.currentCell;\n self.reorderObject.dragOffset = {\n x: x,\n y: y\n };\n self.autoScrollZone(e, columReorder ? pos.x : -1, rowReorder ? pos.y : -1, false);\n }\n };\n self.stopDragReorder = function (e) {\n var oIndex,\n tIndex,\n cr = {\n 'row-reorder': self.orders.rows,\n 'column-reorder': self.orders.columns\n },\n i = {\n 'row-reorder': 'rowIndex',\n 'column-reorder': 'sortColumnIndex'\n }[self.dragMode];\n document.body.removeEventListener('mousemove', self.dragReorder, false);\n document.body.removeEventListener('mouseup', self.stopDragReorder, false);\n if (self.reorderObject\n && self.reorderTarget\n && ((self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1\n && self.reorderTarget.sortColumnIndex < self.getSchema().length)\n || (self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1\n && self.reorderTarget.rowIndex < self.data.length))\n && self.reorderObject[i] !== self.reorderTarget[i]\n && !self.dispatchEvent('reorder', {\n NativeEvent: e,\n source: self.reorderObject,\n target: self.reorderTarget,\n dragMode: self.dragMode\n })) {\n self.ignoreNextClick = true;\n oIndex = cr[self.dragMode].indexOf(self.reorderObject[i]);\n tIndex = cr[self.dragMode].indexOf(self.reorderTarget[i]);\n cr[self.dragMode].splice(oIndex, 1);\n cr[self.dragMode].splice(tIndex, 0, self.reorderObject[i]);\n if(self.dragMode === 'column-reorder') {\n self.orders.columns = cr[self.dragMode];\n } else {\n self.orders.rows = cr[self.dragMode];\n }\n self.resize();\n self.setStorageData();\n }\n self.reorderObject = undefined;\n self.reorderTarget = undefined;\n self.draw(true);\n };\n self.dragMove = function (e) {\n if (self.dispatchEvent('moving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.moveOffset = {\n x: self.currentCell.columnIndex - self.dragStartObject.columnIndex,\n y: self.currentCell.rowIndex - self.dragStartObject.rowIndex\n };\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopDragMove = function (e) {\n document.body.removeEventListener('mousemove', self.dragMove, false);\n document.body.removeEventListener('mouseup', self.stopDragMove, false);\n var b = self.getSelectionBounds();\n if (self.dispatchEvent('endmove', {NativeEvent: e, cell: self.currentCell})) {\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n return;\n }\n if (self.moveOffset) {\n self.moveTo(self.movingSelection, b.left + self.moveOffset.x, b.top + self.moveOffset.y);\n self.moveSelection(self.moveOffset.x, self.moveOffset.y);\n }\n self.movingSelection = undefined;\n self.moveOffset = undefined;\n self.draw(true);\n };\n self.freezeMove = function (e) {\n if (self.dispatchEvent('freezemoving', {NativeEvent: e, cell: self.currentCell})) { return; }\n var pos = self.getLayerPos(e);\n self.ignoreNextClick = true;\n self.freezeMarkerPosition = pos;\n if (self.currentCell && self.currentCell.rowIndex !== undefined && self.dragMode === 'frozen-row-marker') {\n self.scrollBox.scrollTop = 0;\n self.frozenRow = self.currentCell.rowIndex + 1;\n }\n if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {\n self.scrollBox.scrollLeft = 0;\n self.frozenColumn = self.currentCell.columnIndex + 1;\n }\n if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {\n setTimeout(function () {\n self.autoScrollZone(e, pos.x, pos.y, false);\n }, 1);\n }\n };\n self.stopFreezeMove = function (e) {\n document.body.removeEventListener('mousemove', self.freezeMove, false);\n document.body.removeEventListener('mouseup', self.stopFreezeMove, false);\n self.freezeMarkerPosition = undefined;\n if (self.dispatchEvent('endfreezemove', {NativeEvent: e})) {\n self.frozenRow = self.startFreezeMove.x;\n self.frozenColumn = self.startFreezeMove.y;\n self.draw(true);\n return;\n }\n self.draw(true);\n };\n self.mousedown = function (e, overridePos) {\n self.lastMouseDownTarget = e.target;\n if (self.dispatchEvent('mousedown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (e.button === 2 || self.input) { return; }\n var ctrl = (e.ctrlKey || e.metaKey),\n move = /-move/.test(self.dragMode),\n freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),\n resize = /-resize/.test(self.dragMode);\n self.dragStart = overridePos || self.getLayerPos(e);\n self.scrollStart = {\n left: self.scrollBox.scrollLeft,\n top: self.scrollBox.scrollTop\n };\n self.dragStartObject = self.getCellAt(self.dragStart.x, self.dragStart.y);\n self.dragAddToSelection = !self.dragStartObject.selected;\n if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/\n .test(self.dragStartObject.context)\n && self.currentCell\n && !self.currentCell.isColumnHeader\n && !move\n && !freeze\n && !resize) {\n self.selections = [];\n }\n if (self.dragStartObject.isGrid) {\n return;\n }\n if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {\n self.scrollMode = self.dragStartObject.context;\n self.scrollStartMode = self.dragStartObject.context;\n self.scrollGrid(e);\n if (self.attributes.scrollPointerLock\n && ['horizontal-scroll-box', 'vertical-scroll-box'].indexOf(self.scrollStartMode) !== -1) {\n self.pointerLockPosition = {\n x: self.dragStart.x,\n y: self.dragStart.y\n };\n self.canvas.requestPointerLock();\n }\n document.addEventListener('mousemove', self.scrollGrid, false);\n document.addEventListener('mouseup', self.stopScrollGrid, false);\n self.ignoreNextClick = true;\n return;\n }\n if (self.dragMode === 'cell') {\n self.selecting = true;\n if ((self.attributes.selectionMode === 'row' || self.dragStartObject.columnIndex === -1)\n && self.dragStartObject.rowIndex > -1) {\n self.selectRow(self.dragStartObject.rowIndex, ctrl, null);\n } else if (self.attributes.selectionMode !== 'row') {\n self.mousemove(e);\n }\n return;\n }\n if (move) {\n self.draggingItem = self.dragItem;\n self.movingSelection = self.selections.concat([]);\n self.dragging = self.dragStartObject;\n if (self.dispatchEvent('beginmove', {NativeEvent: e, cell: self.currentCell})) { return; }\n document.body.addEventListener('mousemove', self.dragMove, false);\n document.body.addEventListener('mouseup', self.stopDragMove, false);\n return self.mousemove(e);\n }\n if (freeze) {\n self.draggingItem = self.dragItem;\n self.startFreezeMove = {\n x: self.frozenRow,\n y: self.frozenColumn\n };\n if (self.dispatchEvent('beginfreezemove', {NativeEvent: e})) { return; }\n document.body.addEventListener('mousemove', self.freezeMove, false);\n document.body.addEventListener('mouseup', self.stopFreezeMove, false);\n return self.mousemove(e);\n }\n if (resize) {\n self.draggingItem = self.dragItem;\n if (self.draggingItem.rowOpen) {\n self.resizingStartingHeight = self.sizes.trees[self.draggingItem.rowIndex];\n } else {\n self.resizingStartingHeight = self.sizes.rows[self.draggingItem.rowIndex] || self.style.cellHeight;\n }\n self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell'\n ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;\n document.body.addEventListener('mousemove', self.dragResizeColumn, false);\n document.body.addEventListener('mouseup', self.stopDragResize, false);\n return;\n }\n if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {\n self.draggingItem = self.dragStartObject;\n document.body.addEventListener('mousemove', self.dragReorder, false);\n document.body.addEventListener('mouseup', self.stopDragReorder, false);\n return;\n }\n };\n self.mouseup = function (e) {\n clearTimeout(self.scrollTimer);\n self.cellBoundaryCrossed = true;\n self.rowBoundaryCrossed = true;\n self.columnBoundaryCrossed = true;\n self.selecting = undefined;\n self.draggingItem = undefined;\n self.dragStartObject = undefined;\n if (self.dispatchEvent('mouseup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n if (self.currentCell && self.currentCell.grid !== undefined) {\n return;\n }\n if (self.contextMenu || self.input) { return; }\n if (self.dragStart && self.isInGrid(self.dragStart)) {\n self.controlInput.focus();\n }\n e.preventDefault();\n };\n // gets the horizontal adjacent cells as well as first/last based on column visibility\n self.getAdjacentCells = function () {\n var x,\n i,\n s = self.getSchema(),\n o = {};\n for (x = 0; x < s.length; x += 1) {\n i = self.orders.columns[x];\n if (!s[i].hidden) {\n if (o.first === undefined) {\n o.first = x;\n o.left = x;\n }\n o.last = x;\n if (x > self.activeCell.columnIndex && o.right === undefined) {\n o.right = x;\n }\n if (x < self.activeCell.columnIndex) {\n o.left = x;\n }\n }\n }\n if (o.right === undefined) {\n o.right = o.last;\n }\n return o;\n };\n self.keydown = function (e) {\n var i,\n ev,\n adjacentCells = self.getAdjacentCells(),\n x = self.activeCell.columnIndex,\n y = self.activeCell.rowIndex,\n ctrl = (e.ctrlKey || e.metaKey),\n last = self.data.length - 1,\n s = self.getSchema(),\n cols = s.length - 1;\n if (self.dispatchEvent('keydown', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.attributes.showNewRow) {\n last += 1;\n }\n if (e.keyCode === 9) {\n e.preventDefault();\n }\n // esc\n if (e.keyCode === 27) {\n self.selections = [];\n self.draw(true);\n // ctrl + a\n } else if (ctrl && e.keyCode === 65) {\n self.selectAll();\n //ArrowDown\n } else if (e.keyCode === 40) {\n y += 1;\n //ArrowUp\n } else if (e.keyCode === 38) {\n y -= 1;\n //ArrowLeft Tab\n } else if (e.keyCode === 37 || (e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.left;\n //ArrowRight Tab\n } else if (e.keyCode === 39 || (!e.shiftKey && e.keyCode === 9)) {\n x = adjacentCells.right;\n //PageUp\n } else if (e.keyCode === 33) {\n y -= self.page;\n e.preventDefault();\n //PageDown\n } else if (e.keyCode === 34) {\n y += self.page;\n e.preventDefault();\n //Home ArrowUp\n } else if (e.keyCode === 36 || (ctrl && e.keyCode === 38)) {\n y = 0;\n //End ArrowDown\n } else if (e.keyCode === 35 || (ctrl && e.keyCode === 40)) {\n y = self.data.length - 1;\n //ArrowRight\n } else if (ctrl && e.keyCode === 39) {\n x = adjacentCells.last;\n //ArrowLeft\n } else if (ctrl && e.keyCode === 37) {\n x = adjacentCells.first;\n }\n //Enter\n if (e.keyCode === 13) {\n return self.beginEditAt(x, y, e);\n }\n //Space\n if (e.keyCode === 32) {\n self.selections = [];\n self.selections[Math.max(y, 0)] = [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n if (self.attributes.selectionMode === 'row') {\n for (i = self.selectionBounds.top; i <= self.selectionBounds.bottom; i += 1) {\n self.selectRow(i, ctrl, null, true);\n }\n } else {\n self.selectArea(undefined, ctrl);\n }\n e.preventDefault();\n self.draw(true);\n return;\n }\n if (x < 0 || Number.isNaN(x)) {\n x = adjacentCells.first;\n }\n if (y > last) {\n y = last;\n }\n if (y < 0 || Number.isNaN(y)) {\n y = 0;\n }\n if (x > cols) {\n x = adjacentCells.last;\n }\n // TODO - most likley some column order related bugs in key based selection\n // Arrows\n if (e.shiftKey && [37, 38, 39, 40].indexOf(e.keyCode) !== -1) {\n self.selections[Math.max(y, 0)] = self.selections[Math.max(y, 0)] || [];\n self.selections[Math.max(y, 0)].push(x);\n self.selectionBounds = self.getSelectionBounds();\n self.selectArea(undefined, ctrl);\n self.draw(true);\n }\n if (x !== self.activeCell.columnIndex || y !== self.activeCell.rowIndex) {\n self.scrollIntoView(\n x !== self.activeCell.columnIndex ? x : undefined,\n y !== self.activeCell.rowIndex && !Number.isNaN(y) ? y : undefined\n );\n\n self.setActiveCell(x, y);\n if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {\n if (!ctrl) {\n self.selections = [];\n }\n self.selections[y] = self.selections[y] || [];\n self.selections[y].push(x);\n ev = {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n }\n self.draw(true);\n }\n };\n self.keyup = function (e) {\n if (self.dispatchEvent('keyup', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n };\n self.keypress = function (e) {\n if (!self.hasFocus) {\n return;\n }\n if (self.dispatchEvent('keypress', {NativeEvent: e, cell: self.currentCell})) { return; }\n };\n self.dblclick = function (e) {\n if (self.dispatchEvent('dblclick', {NativeEvent: e, cell: self.currentCell})) { return; }\n if (!self.hasFocus) {\n return;\n }\n if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'columnHeaderCell') {\n self.fitColumnToValues(self.currentCell.header.name);\n } else if (self.currentCell.context === 'ew-resize'\n && self.currentCell.style === 'cornerCell') {\n self.autosize();\n } else if (['cell', 'activeCell'].indexOf(self.currentCell.style) !== -1) {\n self.beginEditAt(self.currentCell.columnIndex, self.currentCell.rowIndex);\n }\n };\n self.scrollWheel = function (e) {\n var l,\n t,\n ev = e,\n deltaX = e.deltaX === undefined ? e.NativeEvent.deltaX : e.deltaX,\n deltaY = e.deltaY === undefined ? e.NativeEvent.deltaY : e.deltaY,\n deltaMode = e.deltaMode === undefined ? e.NativeEvent.deltaMode : e.deltaMode;\n if (wheeling) {\n return;\n }\n if (self.dispatchEvent('wheel', {NativeEvent: e})) {\n return;\n }\n var e = e.NativeEvent || e;\n self.touchHaltAnimation = true;\n l = self.scrollBox.scrollLeft;\n t = self.scrollBox.scrollTop;\n if (self.hasFocus) {\n //BUG Issue 42: https://github.com/TonyGermaneri/canvas-datagrid/issues/42\n //https://stackoverflow.com/questions/20110224/what-is-the-height-of-a-line-in-a-wheel-event-deltamode-dom-delta-line\n if (deltaMode === 1) {\n // line mode = 17 pixels per line\n deltaY = deltaY * 17;\n }\n if ((self.scrollBox.scrollTop < self.scrollBox.scrollHeight && deltaY > 0)\n || (self.scrollBox.scrollLeft < self.scrollBox.scrollWidth && deltaX > 0)\n || (self.scrollBox.scrollTop > 0 && deltaY < 0)\n || (self.scrollBox.scrollLeft > 0 && deltaX < 0)) {\n ev.preventDefault(e);\n }\n wheeling = setTimeout(function () {\n wheeling = undefined;\n self.scrollBox.scrollTo(deltaX + l, deltaY + t);\n }, 1);\n }\n };\n self.pasteItem = function (clipData, x, y, mimeType) {\n var l, s = self.getVisibleSchema(), yi = y - 1, sel = [];\n function normalizeRowData(importingRow, existingRow, offsetX, schema, mimeType, rowIndex) {\n var r = existingRow;\n if (!Array.isArray(importingRow) && importingRow !== null && typeof importingRow === 'object') {\n importingRow = Object.keys(importingRow).map(function (colKey) {\n return importingRow[colKey];\n });\n }\n if (/^text\\/html/.test(mimeType)) {\n importingRow = importingRow.substring(4, importingRow.length - 5).split('');\n }\n if (typeof importingRow === 'string') {\n importingRow = [importingRow];\n }\n sel[rowIndex] = [];\n importingRow.forEach(function (cellData, colIndex) {\n var cName = schema[colIndex + offsetX].name;\n if (importingRow[colIndex] === undefined || importingRow[colIndex] === null) {\n r[cName] = existingRow[cName];\n return;\n }\n sel[rowIndex].push(colIndex + offsetX);\n r[cName] = importingRow[colIndex];\n });\n return r;\n }\n if (/^text\\/html/.test(mimeType)) {\n if (!/^(]+>)?/.test(clipData.substring(0, 29))) {\n console.warn('Unrecognized HTML format. HTML must be a simple table, e.g.:
data
. Data with the mime type text/html not in this format will not be imported as row data.');\n return;\n }\n // strip table beginning and ending off, then split at rows\n clipData = clipData.substring(clipData.indexOf('') + 11, clipData.length - 13).split('');\n // ditch any headers on the table\n clipData = clipData.filter(function (row) {\n return !/^/.test(row);\n });\n } else {\n clipData = clipData.split('\\n');\n }\n l = clipData.length;\n clipData.forEach(function (rowData) {\n yi += 1;\n var i = self.orders.rows[yi];\n self.data[i] = normalizeRowData(rowData, self.data[i], x, s, mimeType, i);\n });\n self.selections = sel;\n return l;\n };\n self.getNextVisibleColumnIndex = function (visibleColumnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === visibleColumnIndex) {\n return s[x + 1].columnIndex;\n }\n }\n return -1;\n };\n self.getVisibleColumnIndexOf = function (columnIndex) {\n var x, s = self.getVisibleSchema();\n for (x = 0; x < s.length; x += 1) {\n if (s[x].columnIndex === columnIndex) {\n return x;\n }\n }\n return -1;\n };\n self.paste = function (e) {\n var d;\n function getItem(dti) {\n var type = dti.type;\n dti.getAsString(function (s) {\n self.pasteItem(s, self.getVisibleColumnIndexOf(self.activeCell.columnIndex), self.activeCell.rowIndex, type);\n self.draw();\n });\n }\n d = Array.prototype.filter.call(e.clipboardData.items, function (dti) {\n return dti.type === 'text/html';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/csv';\n })[0] || Array.prototype.filter(function (dti) {\n return dti.type === 'text/plain';\n })[0];\n if (!d) {\n console.warn('Cannot find supported clipboard data type. Supported types are text/html, text/csv, text/plain.');\n return;\n }\n getItem(d);\n };\n self.cut = function (e) {\n self.copy(e);\n self.forEachSelectedCell(function (data, index, colName) {\n data[index][colName] = '';\n });\n };\n self.copy = function (e) {\n if (self.dispatchEvent('copy', {NativeEvent: e})) { return; }\n if (!self.hasFocus || !e.clipboardData) { return; }\n var t,\n d,\n data = (self.data || []),\n tableRows = [],\n textRows = [],\n outputHeaders = {},\n outputHeaderKeys,\n sData = self.getSelectedData(),\n s = self.getSchema();\n function htmlSafe(v) {\n return v.replace(//g, '>');\n }\n function fCopyCell(v) {\n v = v === null || v === undefined ? '' : v;\n return '';\n }\n function addHeaders(headers, useHtml) {\n if (!s.length || headers.length < 2) { return ''; }\n var h = [];\n if (useHtml) {\n h.push('');\n }\n s.forEach(function (column, columnIndex) {\n // intentional redefinition of column\n column = s[self.orders.columns[columnIndex]];\n if (!column.hidden && headers.indexOf(column.name) !== -1) {\n var hVal = (column.name || column.title) || '';\n if (useHtml) {\n h.push('');\n } else {\n h.push('\"' + hVal.replace(/\"/g, '\"\"') + '\"');\n }\n }\n });\n h.push(useHtml ? '' : '\\n');\n return h.join(useHtml ? '' : ',');\n }\n function addCellValue(val, trRow, textRow, column) {\n // escape strings\n if (val !== null\n && val !== false\n && val !== undefined\n && val.replace) {\n trRow.push(fCopyCell(val));\n textRow.push('\"' + val.replace(/\"/g, '\"\"') + '\"');\n return;\n }\n if (val !== undefined) {\n textRow.push(val);\n trRow.push(fCopyCell(val));\n return;\n }\n // issue #66\n textRow.push('');\n trRow.push('');\n }\n if (sData.length > 0) {\n sData.forEach(function (row) {\n var rowKeys = Object.keys(row);\n if (row) {\n var trRow = [],\n textRow = [],\n sSorted = [];\n // HACK: https://github.com/TonyGermaneri/canvas-datagrid/issues/181\n // I can't use sort here or O(1), so hacks\n s.forEach(function (column, columnIndex) {\n sSorted.push(s[self.orders.columns[columnIndex]]);\n });\n sSorted.forEach(function (column, columnIndex) {\n if (rowKeys.indexOf(column.name) !== -1) {\n outputHeaders[column.name] = true;\n // escape strings\n addCellValue(row[column.name], trRow, textRow, column);\n }\n });\n tableRows.push(trRow.join(''));\n textRows.push(textRow.join(','));\n }\n });\n outputHeaderKeys = Object.keys(outputHeaders);\n t = addHeaders(outputHeaderKeys) + textRows.join('\\n');\n d = '
|^
' + (typeof v === 'string' ? htmlSafe(v) : v) + '
' + htmlSafe(hVal) + '
 
' + addHeaders(outputHeaderKeys, true) + '' + tableRows.join('') + '
';\n if (outputHeaderKeys.length === 1) {\n // if there was only one cell selected, remove the quotes from the string\n t = t.substring(1, t.length -1);\n }\n e.clipboardData.setData('text/html', d);\n e.clipboardData.setData('text/plain', t);\n e.clipboardData.setData('text/csv', t);\n e.clipboardData.setData('application/json', JSON.stringify(sData));\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/events.js\n// module id = 4\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true, plusplus: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var touchTimerMs = 50,\n debounceTouchMove,\n touchMoving,\n touchScrollTimeout;\n self.scrollAnimation = {};\n self.touchDelta = {};\n self.touchAnimateTo = {};\n self.animationFrames = 0;\n self.getTouchPos = function (e, touchIndex) {\n var t = touchIndex ? e.touches[touchIndex] : e.touches[0],\n rect = self.canvas.getBoundingClientRect(),\n pos;\n if (!t) { return; }\n pos = {\n x: t.clientX - rect.left,\n y: t.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n // shamelessly stolen from from https://gist.github.com/gre/1650294\n self.easingFunctions = {\n linear: function (t) { return t; },\n easeInQuad: function (t) { return t * t; },\n easeOutQuad: function (t) { return t * (2 - t); },\n easeInOutQuad: function (t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; },\n easeInCubic: function (t) { return t * t * t; },\n easeOutCubic: function (t) { return (--t) * t * t + 1; },\n easeInOutCubic: function (t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; },\n easeInQuart: function (t) { return t * t * t * t; },\n easeOutQuart: function (t) { return 1 - (--t) * t * t * t; },\n easeInOutQuart: function (t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * (--t) * t * t * t; },\n easeInQuint: function (t) { return t * t * t * t * t; },\n easeOutQuint: function (t) { return 1 + (--t) * t * t * t * t; },\n easeInOutQuint: function (t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * (--t) * t * t * t * t; }\n };\n self.easing = function (t, b, c, d) {\n return c * self.easingFunctions[self.attributes.touchEasingMethod](t / d) + b;\n };\n self.calculatePPSTimed = function () {\n self.xPPST = -((self.touchDelta.x - self.touchSigmaTimed.x) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.yPPST = -((self.touchDelta.y - self.touchSigmaTimed.y) / (self.touchDelta.t - self.touchSigmaTimed.t));\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.calculatePPS = function () {\n self.xPPS = -((self.touchDelta.x - self.touchSigma.x) / (self.touchDelta.t - self.touchSigma.t));\n self.yPPS = -((self.touchDelta.y - self.touchSigma.y) / (self.touchDelta.t - self.touchSigma.t));\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: performance.now()\n };\n };\n self.touchEndAnimation = function () {\n if (!self.canvas || !self.scrollBox.scrollTo) { return requestAnimationFrame(self.touchEndAnimation); }\n var n = performance.now(),\n d = self.attributes.touchReleaseAnimationDurationMs,\n t;\n t = n - self.touchDelta.t;\n self.animationFrames += 1;\n self.scrollAnimation.x = self.easing(t, self.touchDelta.scrollLeft, self.touchAnimateTo.x, d);\n self.scrollAnimation.y = self.easing(t, self.touchDelta.scrollTop, self.touchAnimateTo.y, d);\n if (t > d || (self.scrollAnimation.y === self.scrollBox.scrollTop\n && self.scrollAnimation.x === self.scrollBox.scrollLeft) || self.stopAnimation) {\n return;\n }\n self.scrollBox.scrollTo(self.scrollAnimation.x, self.scrollAnimation.y);\n requestAnimationFrame(self.touchEndAnimation);\n };\n self.touchEditCell = function (cell) {\n self.beginEditAt(cell.columnIndex, cell.rowIndex);\n };\n self.touchCell = function (e) {\n return function () {\n clearInterval(self.calculatePPSTimer);\n var i, pos = self.getTouchPos(e);\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone) {\n i = self.getCellAt(pos.x, pos.y);\n if (!i) { return; }\n if (self.touchingCell && self.touchingCell.rowIndex === i.rowIndex\n && self.touchingCell.columnIndex === i.columnIndex) {\n self.touchEditCell(i);\n return;\n }\n if (self.input && self.input.editCell) {\n self.endEdit();\n }\n self.touchingCell = i;\n self.selectArea({\n top: i.rowIndex,\n bottom: i.rowIndex,\n left: i.columnIndex,\n right: i.columnIndex\n });\n self.draw(true);\n }\n };\n };\n self.touchstart = function (e) {\n if (e.changedTouches[0]) {\n self.touchStart = self.getTouchPos(e);\n self.startingCell = self.getCellAt(self.touchStart.x, self.touchStart.y, true);\n }\n if (self.dispatchEvent('touchstart', {NativeEvent: e, cell: self.startingCell})) { return; }\n self.disposeContextMenu();\n clearInterval(self.calculatePPSTimer);\n clearTimeout(self.touchContextTimeout);\n self.touchStartEvent = e;\n self.stopAnimation = true;\n self.animationFrames = 0;\n self.stopPropagation(e);\n e.preventDefault();\n if (e.touches.length === 1 && e.changedTouches[0] && !self.zoomAltered) {\n self.touchLength = 1;\n self.touchStart = self.touchStart || self.touchStart1;\n self.touchScrollStart = {\n x: self.scrollBox.scrollLeft,\n y: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.touchDelta = {\n x: 0,\n y: 0,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: self.touchScrollStart.t\n };\n self.touchSigma = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchSigmaTimed = {\n x: self.touchDelta.x,\n y: self.touchDelta.y,\n t: self.touchDelta.t\n };\n self.touchContextTimeout = setTimeout(function () {\n self.contextmenuEvent(e, self.touchStart);\n }, self.attributes.touchContextMenuTimeMs);\n self.calculatePPSTimer = setInterval(self.calculatePPSTimed, touchTimerMs);\n if (self.startingCell && (self.startingCell.isGrid || ['tree', 'inherit'].indexOf(self.startingCell.context) !== -1)) {\n self.hasFocus = false;\n return;\n }\n self.hasFocus = true;\n if (self.startingCell.isHeader) {\n if (self.startingCell.isRowHeader) {\n self.selectArea({\n top: self.startingCell.rowIndex,\n bottom: self.startingCell.rowIndex,\n left: 0,\n right: self.getVisibleSchema().length - 1,\n });\n self.draw(true);\n } else if (self.startingCell.isColumnHeader) {\n if (self.attributes.columnHeaderClickBehavior === 'sort') {\n if (self.orderBy === self.startingCell.header.name) {\n self.orderDirection = self.orderDirection === 'asc' ? 'desc' : 'asc';\n } else {\n self.orderDirection = 'asc';\n }\n self.order(self.startingCell.header.name, self.orderDirection);\n }\n if (self.attributes.columnHeaderClickBehavior === 'select') {\n self.selectArea({\n top: 0,\n bottom: self.data.length - 1,\n left: self.startingCell.columnIndex,\n right: self.startingCell.columnIndex,\n });\n self.draw(true);\n }\n }\n self.touchEndEvents(e);\n return;\n }\n }\n if (self.zoomAltered) { return; }\n document.body.addEventListener('touchmove', self.touchmove, {passive: false});\n document.body.addEventListener('touchend', self.touchend, false);\n document.body.addEventListener('touchcancel', self.touchcancel, false);\n self.draw(true);\n };\n self.touchSelect = function (cell, handleType) {\n if (cell.rowIndex === undefined || cell.columnIndex === undefined) { return; }\n self.touchSelecting = true;\n var bounds = self.getSelectionBounds();\n if (handleType === 'selection-handle-bl'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex <= bounds.right) {\n bounds.bottom = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tl'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex <= bounds.right) {\n bounds.top = cell.rowIndex;\n bounds.left = cell.columnIndex;\n } else if (handleType === 'selection-handle-tr'\n && cell.rowIndex <= bounds.bottom\n && cell.columnIndex >= bounds.left) {\n bounds.top = cell.rowIndex;\n bounds.right = cell.columnIndex;\n } else if (handleType === 'selection-handle-br'\n && cell.rowIndex >= bounds.top\n && cell.columnIndex >= bounds.left) {\n bounds.bottom = cell.rowIndex;\n bounds.right = cell.columnIndex;\n }\n if (self.attributes.selectionMode === 'row' || cell.rowIndex === -1) {\n bounds.left = 0;\n bounds.right = self.getSchema().length - 1;\n } else {\n bounds.left = Math.max(0, bounds.left);\n }\n self.selectArea(bounds);\n self.draw(true);\n };\n function touchMove(e) {\n var ch, rw, rScrollZone, lScrollZone, bScrollZone, tScrollZone, sbw, t1, t2;\n if (self.dispatchEvent('beforetouchmove', {NativeEvent: e})) { return; }\n clearTimeout(touchScrollTimeout);\n if (e.changedTouches[0]) {\n self.touchPosition = self.getTouchPos(e);\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = self.getTouchPos(e, 1);\n }\n if (Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) > self.attributes.touchDeadZone) {\n clearTimeout(self.touchContextTimeout);\n }\n if (e.touches.length === 2 && self.touchPosition && self.touchPosition1) {\n t1 = self.touchPosition.y;\n t2 = self.touchPosition1.y;\n if (!self.zoomDeltaStart) {\n self.zoomDeltaStart = Math.abs(t1 - t2);\n self.startScale = self.scale;\n }\n self.touchLength = 2;\n self.scaleDelta = self.zoomDeltaStart - Math.abs(t1 - t2);\n self.scale = self.startScale - (self.scaleDelta * self.attributes.touchZoomSensitivity);\n self.scale = Math.min(Math.max(self.scale, self.attributes.touchZoomMin), self.attributes.touchZoomMax);\n self.zoomAltered = true;\n self.resize(true);\n self.resizeChildGrids();\n return;\n }\n if (self.zoomAltered) { return; }\n self.touchLength = 1;\n self.touchPosition = self.touchPosition || self.touchPosition1;\n ch = self.getColumnHeaderCellHeight();\n rw = self.getRowHeaderCellWidth();\n rScrollZone = self.width - self.style.scrollBarWidth - self.touchPosition.x < self.attributes.selectionScrollZone;\n lScrollZone = self.touchPosition.x - rw < self.attributes.selectionScrollZone;\n bScrollZone = self.height - self.style.scrollBarWidth - self.touchPosition.y < self.attributes.selectionScrollZone;\n tScrollZone = self.touchPosition.y - ch < self.attributes.selectionScrollZone;\n sbw = self.style.scrollBarWidth;\n function touchScroll() {\n var x = self.scrollBox.scrollLeft,\n y = self.scrollBox.scrollTop;\n x += (rScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y += (bScrollZone ? self.attributes.selectionScrollIncrement : 0);\n y -= (tScrollZone ? self.attributes.selectionScrollIncrement : 0);\n x -= (lScrollZone ? self.attributes.selectionScrollIncrement : 0);\n self.scrollBox.scrollTo(x, y);\n touchScrollTimeout = setTimeout(touchScroll, self.attributes.scrollRepeatRate);\n }\n e.stopPropagation();\n self.touchDelta = {\n x: self.touchPosition.x - self.touchStart.x,\n y: self.touchPosition.y - self.touchStart.y,\n scrollLeft: self.scrollBox.scrollLeft,\n scrollTop: self.scrollBox.scrollTop,\n t: performance.now()\n };\n self.currentCell = self.getCellAt(self.touchPosition.x, self.touchPosition.y);\n self.dispatchEvent('touchmove', {NativeEvent: e, cell: self.currentCell});\n self.calculatePPS();\n self.touchDuration = performance.now() - self.touchScrollStart.t;\n self.stopAnimation = true;\n self.animationFrames = 0;\n if (self.touchSelecting && (rScrollZone || lScrollZone || tScrollZone || bScrollZone)) {\n touchScroll();\n }\n if (/vertical-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollTop = self.scrollBox.scrollHeight\n * ((self.touchPosition.y - ch - sbw) / (self.scrollBox.height - sbw - ch));\n return;\n }\n if (/horizontal-scroll-/.test(self.startingCell.style)) {\n self.scrollBox.scrollLeft = self.scrollBox.scrollWidth\n * ((self.touchPosition.x - rw - sbw) / (self.scrollBox.width - sbw - rw));\n return;\n }\n if (/selection-handle-/.test(self.startingCell.style)) {\n self.touchSelect(self.currentCell, self.startingCell.style);\n return;\n }\n self.scrollBox.scrollTo(self.touchScrollStart.x - self.touchDelta.x,\n self.touchScrollStart.y - self.touchDelta.y);\n };\n self.touchmove = function (e) {\n if (touchMoving) {\n return;\n }\n requestAnimationFrame(function () {\n touchMoving = true;\n touchMove(e);\n touchMoving = false;\n });\n };\n self.touchEndEvents = function (e) {\n self.zoomDeltaStart = undefined;\n self.touchSelecting = false;\n clearInterval(self.touchScrollTimeout);\n clearInterval(self.touchContextTimeout);\n clearInterval(self.calculatePPSTimer);\n e.stopPropagation();\n document.body.removeEventListener('touchmove', self.touchmove, {passive: false});\n document.body.removeEventListener('touchend', self.touchend, false);\n document.body.removeEventListener('touchcancel', self.touchcancel, false);\n };\n self.touchend = function (e) {\n if (self.dispatchEvent('touchend', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.zoomDeltaStart = undefined;\n if (e.changedTouches[0]) {\n self.touchPosition = undefined;\n }\n if (e.changedTouches[1]) {\n self.touchPosition1 = undefined;\n }\n if (self.zoomAltered) {\n if (e.touches.length === 0) {\n self.zoomAltered = false;\n }\n return;\n }\n var dz = Math.abs(self.touchDelta.x) + Math.abs(self.touchDelta.y) < self.attributes.touchDeadZone;\n if (isNaN(self.xPPS)) {\n self.xPPS = 0;\n }\n if (isNaN(self.yPPS)) {\n self.yPPS = 0;\n }\n if (isNaN(self.xPPST)) {\n self.xPPST = 0;\n }\n if (isNaN(self.yPPST)) {\n self.yPPST = 0;\n }\n self.touchAnimateTo.x = self.xPPS * self.attributes.touchReleaseAcceleration;\n self.touchAnimateTo.y = self.yPPS * self.attributes.touchReleaseAcceleration;\n self.calculatePPSTimed();\n if (dz && !self.contextMenu) {\n self.touchCell(self.touchStartEvent)();\n } else if (self.animationFrames === 0\n && (Math.abs(self.xPPST) > self.attributes.scrollAnimationPPSThreshold\n || Math.abs(self.yPPST) > self.attributes.scrollAnimationPPSThreshold)\n && !/-scroll-/.test(self.startingCell.style)\n && !dz) {\n self.stopAnimation = false;\n self.touchEndAnimation();\n }\n self.touchEndEvents(e);\n };\n self.touchcancel = function (e) {\n if (self.dispatchEvent('touchcancel', {NativeEvent: e, cell: self.currentCell})) { return; }\n self.touchEndEvents(e);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/touch.js\n// module id = 5\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals HTMLElement: false, Reflect: false, define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self, ctor) {\n self.scale = 1;\n self.orders = {\n rows: [],\n columns: []\n };\n self.appliedInlineStyles = {};\n self.cellGridAttributes = {};\n self.treeGridAttributes = {};\n self.visibleRowHeights = [];\n self.hasFocus = false;\n self.activeCell = {\n columnIndex: 0,\n rowIndex: 0\n };\n self.innerHTML = '';\n self.storageName = 'canvasDataGrid';\n self.invalidSearchExpClass = 'canvas-datagrid-invalid-search-regExp';\n self.localStyleLibraryStorageKey = 'canvas-datagrid-user-style-library';\n self.dataType = 'application/x-canvas-datagrid';\n self.orderBy = null;\n self.orderDirection = 'asc';\n self.columnFilters = {};\n self.filters = {};\n self.frozenRow = 0;\n self.frozenColumn = 0;\n self.ellipsisCache = {};\n self.scrollCache = { x: [], y: [] };\n self.scrollBox = {};\n self.visibleRows = [];\n self.sizes = {\n rows: {},\n columns: {},\n trees: {}\n };\n self.currentFilter = function () {\n return true;\n };\n self.selections = [];\n self.hovers = {};\n self.attributes = {};\n self.style = {};\n self.formatters = {};\n self.sorters = {};\n self.parsers = {};\n self.schemaHashes = {};\n self.events = {};\n self.changes = [];\n self.scrollIndexTop = 0;\n self.scrollPixelTop = 0;\n self.scrollIndexLeft = 0;\n self.scrollPixelLeft = 0;\n self.childGrids = {};\n self.openChildren = {};\n self.scrollModes = [\n 'vertical-scroll-box',\n 'vertical-scroll-top',\n 'vertical-scroll-bottom',\n 'horizontal-scroll-box',\n 'horizontal-scroll-right',\n 'horizontal-scroll-left'\n ];\n self.componentL1Events = {};\n self.eventNames = ['afterdraw', 'afterrendercell', 'attributechanged', 'beforebeginedit',\n 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid',\n 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy',\n 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress',\n 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid',\n 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize',\n 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged',\n 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];\n self.mouse = { x: 0, y: 0};\n self.getSelectedData = function (expandToRow) {\n var d = [], s = self.getSchema(), l = self.data.length;\n if (l === 0) { return []; }\n self.selections.forEach(function (row, index) {\n if (!row) { return; }\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n var orderedIndex;\n if (col === -1 || !s[col]) { return; }\n orderedIndex = self.orders.columns[col];\n if (!expandToRow && s[orderedIndex].hidden) { return; }\n if (self.data[index]) {\n d[index][s[orderedIndex].name] = self.data[index][s[orderedIndex].name];\n }\n });\n });\n return d;\n };\n self.getColumnHeaderCellHeight = function () {\n if (!self.attributes.showColumnHeaders) { return 0; }\n return ((self.sizes.rows[-1] || self.style.columnHeaderCellHeight) * self.scale);\n };\n self.getRowHeaderCellWidth = function () {\n if (!self.attributes.showRowHeaders) { return 0; }\n return (self.sizes.columns[-1] || self.style.rowHeaderCellWidth) * self.scale;\n };\n self.setStorageData = function () {\n if (!self.attributes.saveAppearance || !self.attributes.name) { return; }\n var visibility = {};\n self.getSchema().forEach(function (column) {\n visibility[column.name] = !column.hidden;\n });\n localStorage.setItem(self.storageName + '-' + self.attributes.name, JSON.stringify({\n sizes: {\n rows: self.sizes.rows,\n columns: self.sizes.columns\n },\n orders: {\n rows: self.orders.rows,\n columns: self.orders.columns\n },\n orderBy: self.orderBy,\n orderDirection: self.orderDirection,\n visibility: visibility\n }));\n };\n self.getSchema = function () {\n return self.schema || self.tempSchema || [];\n };\n function fillArray(low, high) {\n var i = [], x;\n for (x = low; x <= high; x += 1) {\n i[x] = x;\n }\n return i;\n }\n self.createColumnOrders = function () {\n var s = self.getSchema();\n self.orders.columns = fillArray(0, s.length - 1);\n };\n self.createRowOrders = function () {\n self.orders.rows = fillArray(0, self.data.length - 1);\n };\n self.getVisibleSchema = function () {\n return self.getSchema().filter(function (col) {\n return !col.hidden;\n });\n };\n self.applyDefaultValue = function (row, header) {\n var d = header.defaultValue || '';\n if (typeof d === 'function') {\n d = d.apply(self.intf, [header]);\n }\n row[header.name] = d;\n };\n self.createNewRowData = function () {\n self.newRow = {};\n self.getSchema().forEach(function forEachHeader(header) {\n self.applyDefaultValue(self.newRow, header);\n });\n };\n self.getSchemaNameHash = function (key) {\n var n = 0;\n while (self.schemaHashes[key]) {\n n += 1;\n key = key + n;\n }\n return key;\n };\n self.filter = function (type) {\n var f = self.filters[type];\n if (!f && type !== undefined) {\n console.warn('Cannot find filter for type %s, falling back to substring match.', type);\n f = self.filters.string;\n }\n return f;\n };\n self.getBestGuessDataType = function (columnName, data) {\n var t, x, l = data.length;\n for (x = 0; x < l; x += 1) {\n if (data[x] !== undefined && data[x] !== null && [null, undefined].indexOf(data[x][columnName]) !== -1) {\n t = typeof data[x];\n return t === 'object' ? 'string' : t;\n }\n }\n return 'string';\n };\n self.drawChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].draw();\n });\n };\n self.resizeChildGrids = function () {\n Object.keys(self.childGrids).forEach(function (gridKey) {\n self.childGrids[gridKey].resize();\n });\n };\n self.autoScrollZone = function (e, x, y, ctrl) {\n var setTimer,\n rowHeaderCellWidth = self.getRowHeaderCellWidth(),\n columnHeaderCellHeight = self.getColumnHeaderCellHeight();\n if (y !== -1) {\n if (x > self.width - self.attributes.selectionScrollZone && x < self.width) {\n self.scrollBox.scrollLeft += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (x - self.attributes.selectionScrollZone - rowHeaderCellWidth < 0) {\n self.scrollBox.scrollLeft -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (y !== -1) {\n if (y > self.height - self.attributes.selectionScrollZone && y < self.height) {\n self.scrollBox.scrollTop += self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n if (y - self.attributes.selectionScrollZone - columnHeaderCellHeight < 0) {\n self.scrollBox.scrollTop -= self.attributes.selectionScrollIncrement;\n setTimer = true;\n }\n }\n if (setTimer && !ctrl && self.currentCell && self.currentCell.columnIndex !== -1) {\n self.scrollTimer = setTimeout(self.mousemove, self.attributes.scrollRepeatRate, e);\n }\n };\n self.refreshFromOrigialData = function () {\n self.data = self.originalData.filter(function (row) {\n return true;\n });\n };\n self.validateColumn = function (c, s) {\n if (!c.name) {\n throw new Error('A column must contain at least a name.');\n }\n if (s.filter(function (i) { return i.name === c.name; }).length > 0) {\n throw new Error('A column with the name '\n + c.name + ' already exists and cannot be added again.');\n }\n return true;\n };\n self.setDefaults = function (obj1, obj2, key, def) {\n obj1[key] = obj2[key] === undefined ? def : obj2[key];\n };\n self.setAttributes = function () {\n self.defaults.attributes.forEach(function eachAttribute(i) {\n self.setDefaults(self.attributes, self.args, i[0], i[1]);\n });\n };\n self.setStyle = function () {\n self.defaults.styles.forEach(function eachStyle(i) {\n self.setDefaults(self.style, self.args.style || {}, i[0], i[1]);\n });\n };\n self.autosize = function (colName) {\n self.getVisibleSchema().forEach(function (col, colIndex) {\n if (col.name === colName || colName === undefined) {\n self.sizes.columns[colIndex]\n = Math.max(self.findColumnMaxTextLength(col.name), self.style.minColumnWidth);\n }\n });\n self.sizes.columns[-1] = self.findColumnMaxTextLength('cornerCell');\n };\n self.dispose = function () {\n if (!self.isChildGrid && self.canvas && self.canvas.parentNode) {\n self.canvas.parentNode.removeChild(self.canvas);\n }\n if(!self.isChildGrid) {\n document.body.removeChild(self.controlInput)\n }\n self.eventParent.removeEventListener('mouseup', self.mouseup, false);\n self.eventParent.removeEventListener('mousedown', self.mousedown, false);\n self.eventParent.removeEventListener('dblclick', self.dblclick, false);\n self.eventParent.removeEventListener('click', self.click, false);\n self.eventParent.removeEventListener('mousemove', self.mousemove);\n self.eventParent.removeEventListener('wheel', self.scrollWheel, false);\n self.canvas.removeEventListener('contextmenu', self.contextmenu, false);\n self.canvas.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('copy', self.copy);\n self.controlInput.removeEventListener('cut', self.cut);\n self.controlInput.removeEventListener('paste', self.paste);\n self.controlInput.removeEventListener('keypress', self.keypress, false);\n self.controlInput.removeEventListener('keyup', self.keyup, false);\n self.controlInput.removeEventListener('keydown', self.keydown, false);\n window.removeEventListener('resize', self.resize);\n if (self.observer && self.observer.disconnect) {\n self.observer.disconnect();\n }\n };\n self.tryLoadStoredSettings = function () {\n var s;\n self.reloadStoredValues();\n if (self.storedSettings\n && typeof self.storedSettings.orders === 'object'\n && self.storedSettings.orders !== null) {\n if (self.storedSettings.orders.rows.length >= (self.data || []).length) {\n self.orders.rows = self.storedSettings.orders.rows;\n }\n s = self.getSchema();\n if (self.storedSettings.orders.columns.length === s.length) {\n self.orders.columns = self.storedSettings.orders.columns;\n }\n self.orderBy = self.storedSettings.orderBy === undefined\n ? s[0].name : self.storedSettings.orderBy;\n self.orderDirection = self.storedSettings.orderDirection === undefined\n ? 'asc' : self.storedSettings.orderDirection;\n if (self.storedSettings.orderBy !== undefined && self.getHeaderByName(self.orderBy) && self.orderDirection) {\n self.order(self.orderBy, self.orderDirection);\n }\n }\n };\n self.getDomRoot = function () {\n return self.shadowRoot ? self.shadowRoot.host : self.parentNode;\n };\n self.getFontName = function (fontStyle) {\n return fontStyle.replace(/\\d+\\.?\\d*px/, '');\n };\n self.getFontHeight = function (fontStyle) {\n return parseFloat(fontStyle, 10);\n };\n self.parseStyleValue = function (key) {\n if (/Font/.test(key)) {\n self.style[key + 'Height'] = self.getFontHeight(self.style[key]);\n self.style[key + 'Name'] = self.getFontName(self.style[key]);\n return;\n }\n // when inheriting styles from already instantiated grids, don't parse already parsed values.\n if (key === 'moveOverlayBorderSegments' && typeof self.style[key] === 'string') {\n self.style[key] = self.style[key].split(',')\n .map(function (i) { return parseInt(i, 10); });\n }\n };\n self.initProp = function (propName) {\n if (!self.args[propName]) { return; }\n Object.keys(self.args[propName]).forEach(function (key) {\n self[propName][key] = self.args[propName][key];\n });\n };\n self.getStyleProperty = function (key) {\n if (self.styleKeys.indexOf(key) === -1) {\n return self.parentNodeStyle[key];\n }\n return self.style[key];\n };\n self.setStyleProperty = function (key, value, supressDrawAndEvent) {\n var isDim = ['height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth'].indexOf(key) !== -1;\n if (self.styleKeys.indexOf(key) === -1) {\n self.parentNodeStyle[key] = value;\n } else {\n if (/-/.test(key)) {\n key = self.dehyphenateProperty(key);\n }\n self.style[key] = value;\n self.parseStyleValue(key);\n }\n if (isDim) {\n self.resize();\n }\n if (!supressDrawAndEvent) {\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: value});\n }\n };\n self.reloadStoredValues = function () {\n if (self.attributes.name && self.attributes.saveAppearance) {\n try {\n self.storedSettings = localStorage.getItem(self.storageName + '-' + self.attributes.name);\n } catch (e) {\n console.warn(\"Error loading stored values. \" + e.message);\n self.storedSettings = undefined;\n }\n if (self.storedSettings) {\n try {\n self.storedSettings = JSON.parse(self.storedSettings);\n } catch (e) {\n console.warn('could not read settings from localStore', e);\n self.storedSettings = undefined;\n }\n }\n if (self.storedSettings) {\n if (typeof self.storedSettings.sizes === 'object'\n && self.storedSettings.sizes !== null) {\n self.sizes.rows = self.storedSettings.sizes.rows;\n self.sizes.columns = self.storedSettings.sizes.columns;\n ['trees', 'columns', 'rows'].forEach(function (i) {\n if (!self.sizes[i]) {\n self.sizes[i] = {};\n }\n });\n }\n if (typeof self.storedSettings.visibility === 'object') {\n self.getSchema().forEach(function (column) {\n if (self.storedSettings.visibility && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n }\n }\n };\n self.init = function () {\n if (self.initialized) { return; }\n function addStyleKeyIfNoneExists(key) {\n if (self.styleKeys.indexOf(key) === -1) {\n self.styleKeys.push(key);\n }\n }\n var publicStyleKeyIntf = {};\n self.setAttributes();\n self.setStyle();\n self.initScrollBox();\n self.setDom();\n self.nodeType = 'canvas-datagrid';\n self.ie = /Trident/.test(window.navigator.userAgent);\n self.edge = /Edge/.test(window.navigator.userAgent);\n self.webKit = /WebKit/.test(window.navigator.userAgent);\n self.moz = /Gecko/.test(window.navigator.userAgent);\n self.mobile = /Mobile/i.test(window.navigator.userAgent);\n self.cursorGrab = 'grab';\n self.cursorGrabing = 'grabbing';\n self.cursorGrab = self.webKit ? '-webkit-grab' : self.cursorGrab;\n self.cursorGrabing = self.moz ? '-webkit-grabbing' : self.cursorGrabbing;\n self.pointerLockPosition = {x: 0, y: 0};\n Object.keys(self.style).forEach(self.parseStyleValue);\n self.intf.moveSelection = self.moveSelection;\n self.intf.moveTo = self.moveTo;\n self.intf.addEventListener = self.addEventListener;\n self.intf.removeEventListener = self.removeEventListener;\n self.intf.dispatchEvent = self.dispatchEvent;\n /**\n * Releases grid resources and removes grid elements.\n * @memberof canvasDatagrid\n * @name dispose\n * @method\n */\n self.intf.dispose = self.dispose;\n /**\n * Appends the grid to another element later. Not implemented.\n * @memberof canvasDatagrid\n * @name appendTo\n * @method\n * @param {number} el The element to append the grid to.\n */\n self.intf.appendTo = self.appendTo;\n self.intf.getVisibleCellByIndex = self.getVisibleCellByIndex;\n self.intf.filters = self.filters;\n self.intf.sorters = self.sorters;\n self.intf.autosize = self.autosize;\n self.intf.beginEditAt = self.beginEditAt;\n self.intf.endEdit = self.endEdit;\n self.intf.setActiveCell = self.setActiveCell;\n self.intf.forEachSelectedCell = self.forEachSelectedCell;\n self.intf.scrollIntoView = self.scrollIntoView;\n self.intf.clearChangeLog = self.clearChangeLog;\n self.intf.gotoCell = self.gotoCell;\n self.intf.gotoRow = self.gotoRow;\n self.intf.getHeaderByName = self.getHeaderByName;\n self.intf.findColumnScrollLeft = self.findColumnScrollLeft;\n self.intf.findRowScrollTop = self.findRowScrollTop;\n self.intf.fitColumnToValues = self.fitColumnToValues;\n self.intf.findColumnMaxTextLength = self.findColumnMaxTextLength;\n self.intf.disposeContextMenu = self.disposeContextMenu;\n self.intf.getCellAt = self.getCellAt;\n self.intf.isCellVisible = self.isCellVisible;\n self.intf.isRowVisible = self.isRowVisible;\n self.intf.isColumnVisible = self.isColumnVisible;\n self.intf.order = self.order;\n self.intf.draw = self.draw;\n self.intf.isComponent = self.isComponent;\n self.intf.selectArea = self.selectArea;\n self.intf.clipElement = self.clipElement;\n self.intf.getSchemaFromData = self.getSchemaFromData;\n self.intf.setFilter = self.setFilter;\n self.intf.selectRow = self.selectRow;\n self.intf.parentGrid = self.parentGrid;\n self.intf.toggleTree = self.toggleTree;\n self.intf.expandTree = self.expandTree;\n self.intf.collapseTree = self.collapseTree;\n self.intf.canvas = self.canvas;\n self.intf.context = self.ctx;\n self.intf.insertRow = self.insertRow;\n self.intf.deleteRow = self.deleteRow;\n self.intf.addRow = self.addRow;\n self.intf.insertColumn = self.insertColumn;\n self.intf.deleteColumn = self.deleteColumn;\n self.intf.addColumn = self.addColumn;\n self.intf.getClippingRect = self.getClippingRect;\n self.intf.setRowHeight = self.setRowHeight;\n self.intf.setColumnWidth = self.setColumnWidth;\n self.intf.resetColumnWidths = self.resetColumnWidths;\n self.intf.resetRowHeights = self.resetRowHeights;\n self.intf.resize = self.resize;\n self.intf.selectColumn = self.selectColumn;\n self.intf.selectRow = self.selectRow;\n self.intf.selectAll = self.selectAll;\n self.intf.selectNone = self.selectNone;\n self.intf.drawChildGrids = self.drawChildGrids;\n self.intf.assertPxColor = self.assertPxColor;\n self.intf.clearPxColorAssertions = self.clearPxColorAssertions;\n self.intf.integerToAlpha = self.integerToAlpha;\n self.intf.copy = self.copy;\n self.intf.setStyleProperty = self.setStyleProperty;\n Object.defineProperty(self.intf, 'defaults', {\n get: function () {\n return {\n styles: self.defaults.styles.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {}),\n attributes: self.defaults.attributes.reduce(function (a, i) { a[i[0]] = i[1]; return a; }, {})\n };\n }\n });\n self.styleKeys = Object.keys(self.intf.defaults.styles);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, false); }).forEach(addStyleKeyIfNoneExists);\n self.styleKeys.map(function (i) { return self.hyphenateProperty(i, true); }).forEach(addStyleKeyIfNoneExists);\n self.DOMStyles = window.getComputedStyle(document.body, null);\n self.styleKeys.concat(Object.keys(self.DOMStyles)).forEach(function (key) {\n // unless this line is here, Object.keys() will not work on .style\n publicStyleKeyIntf[key] = undefined;\n Object.defineProperty(publicStyleKeyIntf, key, {\n get: function () {\n return self.getStyleProperty(key);\n },\n set: function (value) {\n if (self.initialized) {\n self.appliedInlineStyles[key] = value;\n }\n self.setStyleProperty(key, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'shadowRoot', {\n get: function () {\n return self.shadowRoot;\n }\n });\n Object.defineProperty(self.intf, 'activeCell', {\n get: function () {\n return self.activeCell;\n }\n });\n Object.defineProperty(self.intf, 'hasFocus', {\n get: function () {\n return self.hasFocus;\n }\n });\n Object.defineProperty(self.intf, 'style', {\n get: function () {\n return publicStyleKeyIntf;\n },\n set: function (valueObject) {\n Object.keys(valueObject).forEach(function (key) {\n self.setStyleProperty(key, valueObject[key], true);\n });\n self.draw(true);\n self.dispatchEvent('stylechanged', {name: 'style', value: valueObject});\n }\n });\n Object.defineProperty(self.intf, 'attributes', { value: {}});\n Object.keys(self.attributes).forEach(function (key) {\n Object.defineProperty(self.intf.attributes, key, {\n get: function () {\n return self.attributes[key];\n },\n set: function (value) {\n self.attributes[key] = value;\n if (key === 'name') {\n self.tryLoadStoredSettings();\n }\n self.draw(true);\n self.dispatchEvent('attributechanged', {name: key, value: value[key]});\n }\n });\n });\n self.filters.string = function (value, filterFor) {\n value = String(value);\n var filterRegExp,\n regEnd = /\\/(i|g|m)*$/,\n pattern = regEnd.exec(filterFor),\n flags = pattern ? pattern[0].substring(1) : '',\n flagLength = flags.length;\n self.invalidFilterRegEx = undefined;\n if (filterFor.substring(0, 1) === '/' && pattern) {\n try {\n filterRegExp = new RegExp(filterFor.substring(1, filterFor.length - (flagLength + 1)), flags);\n } catch (e) {\n self.invalidFilterRegEx = e;\n return;\n }\n return filterRegExp.test(value);\n }\n return value.toString ? value.toString().toLocaleUpperCase()\n .indexOf(filterFor.toLocaleUpperCase()) !== -1 : false;\n };\n self.filters.number = function (value, filterFor) {\n if (!filterFor) { return true; }\n return value === filterFor;\n };\n ['formatters', 'filters', 'sorters'].forEach(self.initProp);\n self.applyComponentStyle(false, self.intf);\n self.reloadStoredValues();\n if (self.args.data) {\n self.intf.data = self.args.data;\n }\n if (self.intf.innerText || self.intf.textContent) {\n if (self.intf.dataType === 'application/x-canvas-datagrid') {\n self.intf.dataType = 'application/json+x-canvas-datagrid';\n }\n self.intf.data = self.intf.innerText || self.intf.textContent;\n }\n if (self.args.schema) {\n self.intf.schema = self.args.schema;\n }\n if (self.isChildGrid || !self.isComponent) {\n requestAnimationFrame(function () { self.resize(true); });\n } else {\n self.resize(true);\n }\n self.initialized = true;\n return self;\n };\n /**\n * Removes focus from the grid.\n * @memberof canvasDatagrid\n * @name blur\n * @method\n */\n self.intf.blur = function (e) {\n self.hasFocus = false;\n };\n /**\n * Focuses on the grid.\n * @memberof canvasDatagrid\n * @name focus\n * @method\n */\n self.intf.focus = function () {\n self.hasFocus = true;\n self.controlInput.focus();\n };\n if (self.shadowRoot || self.isChildGrid) {\n Object.defineProperty(self.intf, 'height', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.height;\n }\n return self.parentNode.height;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.height = value;\n } else {\n self.parentNode.height = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'width', {\n get: function () {\n if (self.shadowRoot) {\n return self.shadowRoot.width;\n }\n return self.parentNode.width;\n },\n set: function (value) {\n if (self.shadowRoot) {\n self.shadowRoot.width = value;\n } else {\n self.parentNode.width = value;\n }\n self.resize(true);\n }\n });\n Object.defineProperty(self.intf, 'parentNode', {\n get: function () {\n return self.parentNode;\n },\n set: function (value) {\n if (!self.isChildGrid) {\n throw new TypeError('Cannot set property parentNode which has only a getter');\n }\n self.parentNode = value;\n }\n });\n }\n Object.defineProperty(self.intf, 'visibleRowHeights', {\n get: function () {\n return self.visibleRowHeights;\n }\n });\n Object.defineProperty(self.intf, 'openChildren', {\n get: function () {\n return self.openChildren;\n }\n });\n Object.defineProperty(self.intf, 'childGrids', {\n get: function () {\n return Object.keys(self.childGrids).map(function (gridId) {\n return self.childGrids[gridId];\n });\n }\n });\n Object.defineProperty(self.intf, 'isChildGrid', {\n get: function () {\n return self.isChildGrid;\n }\n });\n Object.defineProperty(self, 'cursor', {\n get: function () {\n return self.parentNodeStyle.cursor;\n },\n set: function (value) {\n if (value === 'cell') { value = 'default'; }\n if (self.currentCursor !== value) {\n self.parentNodeStyle.cursor = value;\n self.currentCursor = value;\n }\n }\n });\n Object.defineProperty(self.intf, 'orderDirection', {\n get: function () {\n return self.orderDirection;\n },\n set: function (value) {\n if (value !== 'desc') {\n value = 'asc';\n }\n self.orderDirection = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n Object.defineProperty(self.intf, 'orderBy', {\n get: function () {\n return self.orderBy;\n },\n set: function (value) {\n if (self.getSchema().find(function (col) {\n return col.name === value;\n }) === undefined) {\n throw new Error('Cannot sort by unknown column name.');\n }\n self.orderBy = value;\n self.order(self.orderBy, self.orderDirection);\n }\n });\n if (self.isComponent) {\n Object.defineProperty(self.intf, 'offsetHeight', {\n get: function () {\n return self.canvas.offsetHeight;\n }\n });\n Object.defineProperty(self.intf, 'offsetWidth', {\n get: function () {\n return self.canvas.offsetWidth;\n }\n });\n }\n Object.defineProperty(self.intf, 'scrollHeight', {\n get: function () {\n return self.scrollBox.scrollHeight;\n }\n });\n Object.defineProperty(self.intf, 'scrollWidth', {\n get: function () {\n return self.scrollBox.scrollWidth;\n }\n });\n Object.defineProperty(self.intf, 'scrollTop', {\n get: function () {\n return self.scrollBox.scrollTop;\n },\n set: function (value) {\n self.scrollBox.scrollTop = value;\n }\n });\n Object.defineProperty(self.intf, 'scrollLeft', {\n get: function () {\n return self.scrollBox.scrollLeft;\n },\n set: function (value) {\n self.scrollBox.scrollLeft = value;\n }\n });\n Object.defineProperty(self.intf, 'sizes', {\n get: function () {\n return self.sizes;\n }\n });\n Object.defineProperty(self.intf, 'parentDOMNode', {\n get: function () {\n return self.parentDOMNode;\n }\n });\n Object.defineProperty(self.intf, 'input', {\n get: function () {\n return self.input;\n }\n });\n Object.defineProperty(self.intf, 'controlInput', {\n get: function () {\n return self.controlInput;\n }\n });\n Object.defineProperty(self.intf, 'currentCell', {\n get: function () {\n return self.currentCell;\n }\n });\n Object.defineProperty(self.intf, 'visibleCells', {\n get: function () {\n return self.visibleCells;\n }\n });\n Object.defineProperty(self.intf, 'visibleRows', {\n get: function () {\n return self.visibleRows;\n }\n });\n Object.defineProperty(self.intf, 'selections', {\n get: function () {\n return self.selections;\n }\n });\n Object.defineProperty(self.intf, 'dragMode', {\n get: function () {\n return self.dragMode;\n }\n });\n Object.defineProperty(self.intf, 'changes', {\n get: function () {\n return self.changes;\n }\n });\n self.intf.formatters = self.formatters;\n Object.defineProperty(self.intf, 'dataType', {\n get: function () {\n return self.dataType;\n },\n set: function (value) {\n if (!self.parsers[value]) {\n throw new Error('No parser for MIME type ' + value);\n }\n self.dataType = value;\n }\n });\n self.eventNames.forEach(function (eventName) {\n Object.defineProperty(self.intf, 'on' + eventName, {\n get: function () {\n return self.componentL1Events[eventName];\n },\n set: function (value) {\n self.events[eventName] = [];\n self.componentL1Events[eventName] = value;\n if (!value) { return; }\n self.addEventListener(eventName, value);\n }\n });\n });\n Object.defineProperty(self.intf, 'frozenRow', {\n get: function () {\n return self.frozenRow;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.visibleRows.length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible rows.');\n }\n self.frozenRow = val;\n }\n });\n Object.defineProperty(self.intf, 'frozenColumn', {\n get: function () {\n return self.frozenColumn;\n },\n set: function (val) {\n if (isNaN(val)) {\n throw new TypeError('Expected value for frozenRow to be a number.');\n }\n if (self.getVisibleSchema().length < val) {\n throw new RangeError('Cannot set a value larger than the number of visible columns.');\n }\n self.frozenColumn = val;\n }\n });\n Object.defineProperty(self.intf, 'scrollIndexRect', {\n get: function () {\n return {\n top: self.scrollIndexTop,\n right: self.scrollIndexRight,\n bottom: self.scrollIndexBottom,\n left: self.scrollIndexLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'scrollPixelRect', {\n get: function () {\n return {\n top: self.scrollPixelTop,\n right: self.scrollPixelRight,\n bottom: self.scrollPixelBottom,\n left: self.scrollPixelLeft\n };\n }\n });\n Object.defineProperty(self.intf, 'rowOrder', {\n get: function () {\n return self.orders.rows;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (!self.data || val.length < self.data.length) {\n throw new RangeError('Array length must be equal to or greater than number of rows.');\n }\n self.orders.rows = val;\n }\n });\n Object.defineProperty(self.intf, 'columnOrder', {\n get: function () {\n return self.orders.columns;\n },\n set: function (val) {\n if (!Array.isArray(val)) {\n throw new TypeError('Value must be an array.');\n }\n if (val.length < self.getSchema().length) {\n throw new RangeError('Array length must be equal to or greater than number of columns.');\n }\n self.orders.columns = val;\n }\n });\n Object.defineProperty(self.intf, 'selectionBounds', {\n get: function () {\n return self.getSelectionBounds();\n }\n });\n Object.defineProperty(self.intf, 'selectedRows', {\n get: function () {\n return self.getSelectedData(true);\n }\n });\n Object.defineProperty(self.intf, 'selectedCells', {\n get: function () {\n return self.getSelectedData();\n }\n });\n Object.defineProperty(self.intf, 'visibleSchema', {\n get: function () {\n return self.getVisibleSchema().map(function eachDataRow(col) {\n return col;\n });\n }\n });\n Object.defineProperty(self.intf, 'treeGridAttributes', {\n get: function () {\n return self.treeGridAttributes;\n },\n set: function setTreeGridAttributes(value) {\n self.treeGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'cellGridAttributes', {\n get: function () {\n return self.cellGridAttributes;\n },\n set: function setCellGridAttributes(value) {\n self.cellGridAttributes = value;\n }\n });\n Object.defineProperty(self.intf, 'ctx', {\n get: function () {\n return self.ctx;\n }\n });\n Object.defineProperty(self.intf, 'schema', {\n get: function schemaGetter() {\n return self.getSchema();\n },\n set: function schemaSetter(value) {\n if (value === undefined) {\n // Issue #89 - allow schema to be set to initialized state\n self.schema = undefined;\n self.tempSchema = undefined;\n self.dispatchEvent('schemachanged', {schema: undefined});\n return;\n }\n if (!Array.isArray(value) || typeof value[0] !== 'object') {\n throw new Error('Schema must be an array of objects.');\n }\n if (value[0].name === undefined) {\n throw new Error('Expected schema to contain an object with at least a name property.');\n }\n self.schema = value.map(function eachSchemaColumn(column, index) {\n column.width = column.width || self.style.cellWidth;\n column.filter = column.filter || self.filter(column.type);\n column.type = column.type || 'string';\n column.index = index;\n column.columnIndex = index;\n column.rowIndex = -1;\n return column;\n });\n self.tempSchema = undefined;\n self.createNewRowData();\n self.createColumnOrders();\n self.tryLoadStoredSettings();\n if (self.storedSettings && typeof self.storedSettings.visibility === 'object') {\n self.schema.forEach(function hideEachSchemaColumn(column, index) {\n if (self.storedSettings && self.storedSettings.visibility[column.name] !== undefined) {\n column.hidden = !self.storedSettings.visibility[column.name];\n }\n });\n }\n self.resize(true);\n self.dispatchEvent('schemachanged', {schema: self.schema});\n }\n });\n /**\n * Gets an array of currently registered MIME types.\n * @memberof canvasDatagrid\n * @name getDataTypes\n * @method\n */\n self.intf.getTypes = function () {\n return Object.keys(self.parsers);\n };\n self.parseInnerHtml = function (data) {\n if (!data || /^ +$/.test(data)) {\n return [];\n }\n try {\n data = JSON.parse(data);\n } catch (e) {\n console.warn(Error('Cannot parse application/json+x-canvas-datagrid formated data. '\n + e.message + ' \\nNote: canvas-datagrid.innerHTML is for string data only. '\n + 'Use the canvas-datagrid.data property to set object data.'));\n }\n return data;\n };\n self.parsers['application/json+x-canvas-datagrid'] = function (data, callback) {\n self.parsers['application/x-canvas-datagrid'](self.parseInnerHtml(data), function (data, schema) {\n return callback(data, schema);\n });\n };\n self.parsers['application/x-canvas-datagrid'] = function (data, callback) {\n return callback(data);\n };\n self.intf.parsers = self.parsers;\n // send to dataType ETL function to extract from input data\n // and transform into native [{}, {}] format\n self.etl = function (data, callback) {\n if (!self.intf.parsers[self.dataType]) {\n throw new Error('Unsupported data type.');\n }\n self.intf.parsers[self.dataType](data, function (data, schema) {\n if (Array.isArray(schema)) {\n self.schema = schema;\n }\n // Issue #89 - allow schema to be auto-created every time data is set\n if (self.attributes.autoGenerateSchema) {\n self.schema = self.getSchemaFromData(data);\n }\n if (!self.schema) {\n self.tempSchema = self.getSchemaFromData(data);\n }\n if (self.getSchema()) {\n self.createColumnOrders();\n }\n // set the unfiltered/sorted data array\n self.originalData = data;\n //TODO apply filter to incoming dataset\n self.data = self.originalData;\n // empty data was set\n if (!self.schema && (self.data || []).length === 0) {\n self.tempSchema = [{name: ''}];\n }\n self.fitColumnToValues('cornerCell', true);\n if ((self.tempSchema && !self.schema) || self.attributes.autoGenerateSchema) {\n self.createColumnOrders();\n self.dispatchEvent('schemachanged', {schema: self.tempSchema});\n }\n callback();\n });\n };\n Object.defineProperty(self.intf, 'data', {\n get: function dataGetter() {\n return self.data;\n },\n set: function dataSetter(value) {\n self.etl(value, function () {\n self.changes = [];\n self.createNewRowData();\n if (self.attributes.autoResizeColumns && self.data.length > 0\n && self.storedSettings === undefined) {\n self.autosize();\n }\n // set the header column to fit the numbers in it\n self.fitColumnToValues('cornerCell', true);\n self.createRowOrders();\n self.tryLoadStoredSettings();\n self.dispatchEvent('datachanged', {data: self.data});\n self.resize(true);\n });\n }\n });\n self.initScrollBox = function () {\n var sHeight = 0,\n sWidth = 0,\n scrollTop = 0,\n scrollLeft = 0,\n scrollHeight = 0,\n scrollWidth = 0,\n scrollBoxHeight = 20,\n scrollBoxWidth = 20;\n function setScrollTop(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollTop value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollHeight) {\n value = scrollHeight;\n }\n if (scrollHeight < 0) {\n value = 0;\n }\n scrollTop = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n function setScrollLeft(value, preventScrollEvent) {\n if (isNaN(value)) {\n throw new Error('ScrollLeft value must be a number');\n }\n if (value < 0) {\n value = 0;\n }\n if (value > scrollWidth) {\n value = scrollWidth;\n }\n if (scrollWidth < 0) {\n value = 0;\n }\n scrollLeft = value;\n if (!preventScrollEvent) {\n self.scroll();\n }\n }\n self.scrollBox.toString = function () {\n return '{\"width\": ' + scrollWidth.toFixed(2)\n + ', \"height\": ' + scrollHeight.toFixed(2)\n + ', \"left\": ' + scrollLeft.toFixed(2)\n + ', \"top\": ' + scrollTop.toFixed(2)\n + ', \"widthRatio\": ' + self.scrollBox.widthBoxRatio.toFixed(5)\n + ', \"heightRatio\": ' + self.scrollBox.heightBoxRatio.toFixed(5) + '}';\n };\n self.scrollBox.scrollTo = function (x, y, supressDrawEvent) {\n setScrollLeft(x, true);\n setScrollTop(y, supressDrawEvent);\n };\n Object.defineProperty(self.scrollBox, 'scrollBoxHeight', {\n get: function () {\n return scrollBoxHeight;\n },\n set: function (value) {\n scrollBoxHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollBoxWidth', {\n get: function () {\n return scrollBoxWidth;\n },\n set: function (value) {\n scrollBoxWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'height', {\n get: function () {\n return sHeight;\n },\n set: function (value) {\n sHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'width', {\n get: function () {\n return sWidth;\n },\n set: function (value) {\n sWidth = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollTop', {\n get: function () {\n return scrollTop;\n },\n set: setScrollTop\n });\n Object.defineProperty(self.scrollBox, 'scrollLeft', {\n get: function () {\n return scrollLeft;\n },\n set: setScrollLeft\n });\n Object.defineProperty(self.scrollBox, 'scrollHeight', {\n get: function () {\n return scrollHeight;\n },\n set: function (value) {\n if (scrollTop > value) {\n scrollTop = Math.max(value, 0);\n }\n scrollHeight = value;\n }\n });\n Object.defineProperty(self.scrollBox, 'scrollWidth', {\n get: function () {\n return scrollWidth;\n },\n set: function (value) {\n if (scrollLeft > value) {\n scrollLeft = Math.max(value, 0);\n }\n scrollWidth = value;\n }\n });\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/intf.js\n// module id = 6\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false, Event: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n var zIndexTop, hoverScrollTimeout, autoCompleteContext;\n function applyContextItemStyle(contextItemContainer) {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item' + (self.mobile ? '-mobile' : ''));\n contextItemContainer.addEventListener('mouseover', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n });\n contextItemContainer.addEventListener('mouseout', function () {\n self.createInlineStyle(contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n function createContextMenu(ev, pos, items, parentContextMenu) {\n var container = document.createElement('div'),\n upArrow = document.createElement('div'),\n downArrow = document.createElement('div'),\n children = [],\n selectedIndex = -1,\n intf = {},\n rect;\n if (!Array.isArray(items)) { throw new Error('createContextMenu expects an array.'); }\n function createItems() {\n items.forEach(function (item) {\n var contextItemContainer = document.createElement('div'),\n childMenuArrow;\n function removeChildContext(e) {\n if (e.relatedTarget === container\n || item.contextMenu.container === e.relatedTarget\n || childMenuArrow === e.relatedTarget\n || (contextItemContainer === e.relatedTarget)\n || item.contextMenu.container.contains(e.relatedTarget)\n ) { return; }\n item.contextMenu.dispose();\n children.splice(children.indexOf(item.contextMenu), 1);\n item.contextMenu = undefined;\n contextItemContainer.removeEventListener('mouseout', removeChildContext);\n container.removeEventListener('mouseout', removeChildContext);\n contextItemContainer.setAttribute('contextOpen', '0');\n contextItemContainer.setAttribute('opening', '0');\n }\n function contextAddCallback(items) {\n // check yet again if the user hasn't moved off\n if (contextItemContainer.getAttribute('opening') !== '1' ||\n contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n var cPos = contextItemContainer.getBoundingClientRect();\n cPos = {\n left: cPos.left + self.style.childContextMenuMarginLeft + container.offsetWidth,\n top: cPos.top + self.style.childContextMenuMarginTop,\n bottom: cPos.bottom,\n right: cPos.right\n };\n item.contextMenu = createContextMenu(ev, cPos, items, intf);\n contextItemContainer.setAttribute('contextOpen', '1');\n contextItemContainer.addEventListener('mouseout', removeChildContext);\n container.addEventListener('mouseout', removeChildContext);\n children.push(item.contextMenu);\n }\n function createChildContext() {\n var i;\n if (contextItemContainer.getAttribute('contextOpen') === '1') {\n return;\n }\n contextItemContainer.setAttribute('opening', '1');\n if (typeof item.items === 'function') {\n i = item.items.apply(intf, [function (items) {\n contextAddCallback(items);\n }]);\n if (i !== undefined && Array.isArray(i)) {\n contextAddCallback(i);\n }\n return;\n }\n contextAddCallback(item.items);\n }\n function addItem(item) {\n function addContent(content) {\n if (content === null) { return; }\n if (typeof content === 'function') {\n return addContent(content(ev));\n }\n if (typeof content === 'object') {\n contextItemContainer.appendChild(content);\n return;\n }\n applyContextItemStyle(contextItemContainer);\n contextItemContainer.innerHTML = content;\n return;\n }\n addContent(item.title);\n item.contextItemContainer = contextItemContainer;\n if ((item.items && item.items.length > 0) || typeof item.items === 'function') {\n childMenuArrow = document.createElement('div');\n self.createInlineStyle(childMenuArrow, 'canvas-datagrid-context-child-arrow');\n childMenuArrow.innerHTML = self.style.childContextMenuArrowHTML;\n contextItemContainer.appendChild(childMenuArrow);\n contextItemContainer.addEventListener('mouseover', createChildContext);\n contextItemContainer.addEventListener('mouseout', function () {\n contextItemContainer.setAttribute('opening', '0');\n });\n }\n if (item.click) {\n contextItemContainer.addEventListener('click', function (ev) {\n item.click.apply(self, [ev]);\n });\n }\n }\n addItem(item);\n container.appendChild(contextItemContainer);\n });\n }\n function clickIndex(idx) {\n items[idx].contextItemContainer.dispatchEvent(new Event('click'));\n }\n function checkArrowVisibility() {\n if (container.scrollTop > 0) {\n self.parentDOMNode.appendChild(upArrow);\n } else if (upArrow.parentNode) {\n upArrow.parentNode.removeChild(upArrow);\n }\n if (container.scrollTop >= container.scrollHeight - container.offsetHeight && downArrow.parentNode) {\n downArrow.parentNode.removeChild(downArrow);\n } else if (container.scrollHeight - container.offsetHeight > 0\n && !(container.scrollTop >= container.scrollHeight - container.offsetHeight)) {\n self.parentDOMNode.appendChild(downArrow);\n }\n }\n function startHoverScroll(type) {\n return function t() {\n var a = self.attributes.contextHoverScrollAmount;\n if (type === 'up' && container.scrollTop === 0) { return; }\n if (type === 'down' && container.scrollTop === container.scrollHeight) { return; }\n container.scrollTop += (type === 'up' ? -a : a);\n hoverScrollTimeout = setTimeout(t, self.attributes.contextHoverScrollRateMs, type);\n };\n }\n function endHoverScroll(type) {\n return function () {\n clearTimeout(hoverScrollTimeout);\n };\n }\n function init() {\n var loc = {},\n s = self.scrollOffset(self.canvas);\n if (zIndexTop === undefined) {\n zIndexTop = self.style.contextMenuZIndex;\n }\n createItems();\n self.createInlineStyle(container, 'canvas-datagrid-context-menu' + (self.mobile ? '-mobile' : ''));\n loc.x = pos.left - s.left;\n loc.y = pos.top - s.top;\n loc.height = 0;\n zIndexTop += 1;\n container.style.position = 'absolute';\n upArrow.style.color = self.style.contextMenuArrowColor;\n downArrow.style.color = self.style.contextMenuArrowColor;\n [upArrow, downArrow].forEach(function (el) {\n el.style.textAlign = 'center';\n el.style.position = 'absolute';\n el.style.zIndex = zIndexTop + 1;\n });\n container.style.zIndex = zIndexTop;\n if (parentContextMenu && parentContextMenu.inputDropdown) {\n container.style.maxHeight = window.innerHeight - loc.y - self.style.autocompleteBottomMargin + 'px';\n container.style.minWidth = pos.width + 'px';\n loc.y += pos.height;\n }\n if (self.mobile) {\n container.style.width = pos.width + 'px';\n }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n container.addEventListener('scroll', checkArrowVisibility);\n container.addEventListener('wheel', function (e) {\n if (self.hasFocus) {\n container.scrollTop += e.deltaY;\n container.scrollLeft += e.deltaX;\n }\n checkArrowVisibility();\n });\n upArrow.innerHTML = self.style.contextMenuArrowUpHTML;\n downArrow.innerHTML = self.style.contextMenuArrowDownHTML;\n container.appendChild(upArrow);\n document.body.appendChild(downArrow);\n document.body.appendChild(container);\n rect = container.getBoundingClientRect();\n // TODO: fix !(parentContextMenu && parentContextMenu.inputDropdown) state (autocomplete)\n if (rect.bottom > window.innerHeight) {\n if (!(parentContextMenu && parentContextMenu.inputDropdown)) {\n loc.y -= (rect.bottom + self.style.contextMenuWindowMargin) - window.innerHeight;\n }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n if (container.offsetHeight > window.innerHeight - self.style.contextMenuWindowMargin) {\n container.style.height = window.innerHeight - (self.style.contextMenuWindowMargin * 2) + 'px';\n }\n }\n if (rect.right > window.innerWidth) {\n loc.x -= rect.right - window.innerWidth + self.style.contextMenuWindowMargin;\n }\n if (loc.x < 0) { loc.x = self.style.contextMenuWindowMargin; }\n if (loc.y < 0) { loc.y = self.style.contextMenuWindowMargin; }\n container.style.left = loc.x + 'px';\n container.style.top = loc.y + 'px';\n rect = container.getBoundingClientRect();\n upArrow.style.top = rect.top + 'px';\n downArrow.style.top = rect.top + rect.height - downArrow.offsetHeight + 'px';\n upArrow.style.left = rect.left + 'px';\n downArrow.style.left = rect.left + 'px';\n downArrow.style.width = container.offsetWidth + 'px';\n upArrow.style.width = container.offsetWidth + 'px';\n downArrow.addEventListener('mouseover', startHoverScroll('down'));\n downArrow.addEventListener('mouseout', endHoverScroll('down'));\n upArrow.addEventListener('mouseover', startHoverScroll('up'));\n upArrow.addEventListener('mouseout', endHoverScroll('up'));\n checkArrowVisibility();\n }\n intf.parentGrid = self.intf;\n intf.parentContextMenu = parentContextMenu;\n intf.container = container;\n init();\n intf.clickIndex = clickIndex;\n intf.rect = rect;\n intf.items = items;\n intf.upArrow = upArrow;\n intf.downArrow = downArrow;\n intf.dispose = function () {\n clearTimeout(hoverScrollTimeout);\n children.forEach(function (c) {\n c.dispose();\n });\n [downArrow, upArrow, container].forEach(function (el) {\n if (el.parentNode) { el.parentNode.removeChild(el); }\n });\n };\n Object.defineProperty(intf, 'selectedIndex', {\n get: function () {\n return selectedIndex;\n },\n set: function (value) {\n if (typeof value !== 'number' || isNaN(value || !isFinite(value))) {\n throw new Error('Context menu selected index must be a sane number.');\n }\n selectedIndex = value;\n if (selectedIndex > items.length - 1) {\n selectedIndex = items.length - 1;\n }\n if (selectedIndex < 0) {\n selectedIndex = 0;\n }\n items.forEach(function (item, index) {\n if (index === selectedIndex) {\n return self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item:hover');\n }\n self.createInlineStyle(item.contextItemContainer, 'canvas-datagrid-context-menu-item');\n });\n }\n });\n return intf;\n }\n function createFilterContextMenuItems(e) {\n var filterContainer = document.createElement('div'),\n filterLabel = document.createElement('div'),\n filterAutoCompleteButton = document.createElement('button'),\n filterInput = document.createElement('input'),\n n = e.cell && e.cell.header ? e.cell.header.title || e.cell.header.name : '',\n autoCompleteItems,\n iRect;\n function checkRegExpErrorState() {\n filterInput.style.background = self.style.contextFilterInputBackground;\n filterInput.style.color = self.style.contextFilterInputColor;\n if (self.invalidFilterRegEx) {\n filterInput.style.background = self.style.contextFilterInvalidRegExpBackground;\n filterInput.style.color = self.style.contextFilterInvalidRegExpColor;\n }\n }\n function fillAutoComplete() {\n var count = 0;\n autoCompleteItems = {};\n self.data.forEach(function (row) {\n var value = row[e.cell.header.name];\n if (autoCompleteItems[value] || count > self.attributes.maxAutoCompleteItems) { return; }\n count += 1;\n autoCompleteItems[value] = {\n title: self.formatters[e.cell.header.type || 'string']({ cell: { value: value }}),\n click: function (e) {\n filterInput.value = value;\n e.stopPropagation();\n filterInput.dispatchEvent(new Event('keyup'));\n self.disposeAutocomplete();\n return;\n }\n };\n });\n autoCompleteItems = Object.keys(autoCompleteItems).map(function (key) {\n return autoCompleteItems[key];\n });\n }\n function createAutoCompleteContext(ev) {\n if (ev && [40, 38, 13, 9].indexOf(ev.keyCode) !== -1) { return; }\n fillAutoComplete();\n iRect = filterInput.getBoundingClientRect();\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n autoCompleteContext = createContextMenu(e, {\n left: iRect.left,\n top: iRect.top,\n right: iRect.right,\n bottom: iRect.bottom,\n height: iRect.height,\n width: iRect.width\n }, autoCompleteItems, {inputDropdown: true});\n autoCompleteContext.selectedIndex = 0;\n }\n self.createInlineStyle(filterLabel, 'canvas-datagrid-context-menu-label');\n self.createInlineStyle(filterAutoCompleteButton, 'canvas-datagrid-context-menu-filter-button');\n self.createInlineStyle(filterInput, 'canvas-datagrid-context-menu-filter-input');\n checkRegExpErrorState();\n filterInput.onclick = self.disposeAutocomplete;\n filterInput.addEventListener('keydown', function (e) {\n //down\n if (e.keyCode === 40) {\n autoCompleteContext.selectedIndex += 1;\n }\n //up\n if (e.keyCode === 38) {\n autoCompleteContext.selectedIndex -= 1;\n }\n //enter\n if (e.keyCode === 13) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n self.disposeContextMenu();\n }\n //tab\n if (e.keyCode === 9) {\n autoCompleteContext.clickIndex(autoCompleteContext.selectedIndex);\n e.preventDefault();\n }\n //esc\n if (e.keyCode === 27) {\n self.disposeContextMenu();\n }\n });\n filterInput.addEventListener('keyup', function () {\n self.setFilter(e.cell.header.name, filterInput.value);\n });\n filterInput.addEventListener('keyup', createAutoCompleteContext);\n ['focus', 'blur', 'keydown', 'keyup', 'change'].forEach(function (en) {\n filterInput.addEventListener(en, checkRegExpErrorState);\n });\n filterInput.value = e.cell.header ? self.columnFilters[e.cell.header.name] || '' : '';\n filterLabel.innerHTML = self.attributes.filterOptionText.replace(/%s/g, n);\n filterAutoCompleteButton.onclick = function () {\n if (autoCompleteContext) {\n return self.disposeAutocomplete();\n }\n createAutoCompleteContext();\n };\n filterAutoCompleteButton.innerHTML = self.style.contextFilterButtonHTML;\n filterContainer.addEventListener('click', function (e) {\n return e.stopPropagation();\n });\n filterContainer.appendChild(filterLabel);\n filterContainer.appendChild(filterInput);\n filterContainer.appendChild(filterAutoCompleteButton);\n e.items.push({\n title: filterContainer\n });\n if (Object.keys(self.columnFilters).length) {\n Object.keys(self.columnFilters).forEach(function (cf) {\n var h = self.getHeaderByName(cf);\n e.items.push({\n title: self.attributes.removeFilterOptionText.replace(/%s/g, h.title || h.name),\n click: function removeFilterClick(e) {\n e.preventDefault();\n self.setFilter(cf, '');\n self.controlInput.focus();\n }\n });\n });\n }\n }\n function addDefaultContextMenuItem(e) {\n var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap\n || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader)\n && e.cell.header;\n if (self.attributes.showFilter && isNormalCell) {\n createFilterContextMenuItems(e);\n }\n if (self.attributes.showCopy\n && self.selections.reduce(function (p, r) {\n return p + r.length;\n }, 0) > 0) {\n e.items.push({\n title: self.attributes.copyText,\n click: function () {\n document.execCommand('copy');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.showPaste && self.clipBoardData) {\n e.items.push({\n title: self.attributes.pasteText,\n click: function () {\n self.paste(self.clipBoardData, e.cell.columnIndex, e.cell.rowIndex);\n self.draw();\n }\n });\n }\n if (self.attributes.showColumnSelector) {\n e.items.push({\n title: self.attributes.columnSelectorText,\n items: function () {\n var d = [];\n self.getSchema().forEach(function (column) {\n function toggleColumnVisibility(e) {\n column.hidden = !column.hidden;\n self.dispatchEvent('togglecolumn', {column: column, hidden: column.hidden});\n e.preventDefault();\n self.stopPropagation(e);\n self.disposeContextMenu();\n self.resize(true);\n self.setStorageData();\n }\n var el = document.createElement('div');\n applyContextItemStyle(el);\n el.addEventListener('touchstart', toggleColumnVisibility);\n el.addEventListener('click', toggleColumnVisibility);\n el.innerHTML = (column.hidden ? self.attributes.columnSelectorHiddenText\n : self.attributes.columnSelectorVisibleText)\n + (column.title || column.name);\n d.push({\n title: el\n });\n });\n return d;\n }\n });\n if (e.cell && e.cell.header && e.cell.columnIndex > -1) {\n e.items.push({\n title: self.attributes.hideColumnText\n .replace(/%s/ig, e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n self.getSchema()[e.cell.columnIndex].hidden = true;\n ev.preventDefault();\n self.stopPropagation(ev);\n self.disposeContextMenu();\n self.setStorageData();\n setTimeout(function () { self.resize(true); }, 10);\n }\n });\n }\n }\n if (self.attributes.saveAppearance && self.attributes.showClearSettingsOption\n && (Object.keys(self.sizes.rows).length > 0\n || Object.keys(self.sizes.columns).length > 0)) {\n e.items.push({\n title: self.attributes.clearSettingsOptionText,\n click: function (e) {\n e.preventDefault();\n self.sizes.rows = {};\n self.sizes.columns = {};\n self.createRowOrders();\n self.createColumnOrders();\n self.storedSettings = undefined;\n self.dispatchEvent('resizecolumn', {columnWidth: self.style.cellWidth});\n self.dispatchEvent('resizerow', {cellHeight: self.style.cellHeight});\n self.setStorageData();\n self.resize(true);\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n if (self.attributes.allowSorting && self.attributes.showOrderByOption && isNormalCell) {\n e.items.push({\n title: self.attributes.showOrderByOptionTextAsc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'asc');\n self.controlInput.focus();\n }\n });\n e.items.push({\n title: self.attributes.showOrderByOptionTextDesc.replace('%s', e.cell.header.title || e.cell.header.name),\n click: function (ev) {\n ev.preventDefault();\n self.order(e.cell.header.name, 'desc');\n self.disposeContextMenu();\n self.controlInput.focus();\n }\n });\n }\n }\n self.disposeAutocomplete = function () {\n if (autoCompleteContext) {\n autoCompleteContext.dispose();\n autoCompleteContext = undefined;\n }\n };\n self.disposeContextMenu = function () {\n document.removeEventListener('click', self.disposeContextMenu);\n zIndexTop = self.style.contextMenuZIndex;\n self.disposeAutocomplete();\n if (self.contextMenu) {\n self.contextMenu.dispose();\n }\n self.contextMenu = undefined;\n };\n self.contextmenuEvent = function (e, overridePos) {\n if (!self.hasFocus && e.target !== self.canvas) {\n return;\n }\n function createDiposeEvent() {\n requestAnimationFrame(function () {\n document.addEventListener('click', self.disposeContextMenu);\n document.removeEventListener('mouseup', createDiposeEvent);\n });\n }\n var contextPosition,\n items = [],\n pos = overridePos || self.getLayerPos(e),\n ev = {\n NativeEvent: e,\n cell: self.getCellAt(pos.x, pos.y),\n items: items\n };\n if (!ev.cell.isGrid) {\n addDefaultContextMenuItem(ev);\n }\n if (self.dispatchEvent('contextmenu', ev)) {\n return;\n }\n if (!ev.cell.isGrid) {\n if (self.contextMenu) {\n self.disposeContextMenu();\n }\n contextPosition = {\n left: pos.x + pos.rect.left\n + self.style.contextMenuMarginLeft + self.canvasOffsetLeft,\n top: pos.y + pos.rect.top\n + self.style.contextMenuMarginTop + self.canvasOffsetTop,\n right: ev.cell.width + ev.cell.x + pos.rect.left,\n bottom: ev.cell.height + ev.cell.y + pos.rect.top,\n height: ev.cell.height,\n width: ev.cell.width\n };\n if (self.mobile) {\n contextPosition.left = self.style.mobileContextMenuMargin + 'px';\n contextPosition.width = self.width - (self.style.mobileContextMenuMargin * 2) + 'px';\n }\n self.contextMenu = createContextMenu(ev, contextPosition, items);\n document.addEventListener('mouseup', createDiposeEvent);\n e.preventDefault();\n }\n };\n return;\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/contextMenu.js\n// module id = 7\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n self.getClippingRect = function (ele) {\n var boundingRect = self.position(self.parentNode),\n eleRect = self.position(ele),\n s = self.scrollOffset(self.canvas),\n clipRect = {\n x: 0,\n y: 0,\n h: 0,\n w: 0\n },\n parentRect = {\n x: -Infinity,\n y: -Infinity,\n h: Infinity,\n w: Infinity\n },\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.getRowHeaderCellWidth();\n boundingRect.top -= s.top;\n boundingRect.left -= s.left;\n eleRect.top -= s.top;\n eleRect.left -= s.left;\n clipRect.h = boundingRect.top + boundingRect.height - ele.offsetTop - self.style.scrollBarWidth;\n clipRect.w = boundingRect.left + boundingRect.width - ele.offsetLeft - self.style.scrollBarWidth;\n clipRect.x = boundingRect.left + (eleRect.left * -1) + rowHeaderCellWidth;\n clipRect.y = boundingRect.top + (eleRect.top * -1) + columnHeaderCellHeight;\n return {\n x: clipRect.x > parentRect.x ? clipRect.x : parentRect.x,\n y: clipRect.y > parentRect.y ? clipRect.y : parentRect.y,\n h: clipRect.h < parentRect.h ? clipRect.h : parentRect.h,\n w: clipRect.w < parentRect.w ? clipRect.w : parentRect.w\n };\n };\n self.clipElement = function (ele) {\n var clipRect = self.getClippingRect(ele);\n if (clipRect.w < 0) { clipRect.w = 0; }\n if (clipRect.h < 0) { clipRect.h = 0; }\n ele.style.clip = 'rect('\n + clipRect.y + 'px,'\n + clipRect.w + 'px,'\n + clipRect.h + 'px,'\n + clipRect.x + 'px'\n + ')';\n // INFO https://developer.mozilla.org/en-US/docs/Web/CSS/clip\n // clip has been \"deprecated\" for clipPath. Of course nothing but chrome\n // supports clip path, so we'll keep using clip until someday clipPath becomes\n // more widely support. The code below works correctly, but setting clipPath and clip\n // at the same time has undesirable results.\n // ele.style.clipPath = 'polygon('\n // + clipRect.x + 'px ' + clipRect.y + 'px,'\n // + clipRect.x + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.h + 'px,'\n // + clipRect.w + 'px ' + clipRect.y + 'px'\n // + ')';\n };\n self.scrollOffset = function (e) {\n var x = 0, y = 0, scrollingElement = document.scrollingElement || { scrollLeft: 0, scrollTop: 0 };\n while (e.parentNode && e.nodeName !== 'CANVAS-DATAGRID' && e !== self.intf) {\n if (e.nodeType !== 'canvas-datagrid-tree'\n && e.nodeType !== 'canvas-datagrid-cell') {\n x -= e.scrollLeft;\n y -= e.scrollTop;\n }\n e = e.parentNode;\n }\n return {\n left: x - scrollingElement.scrollLeft,\n top: y - scrollingElement.scrollTop\n };\n };\n self.resizeEditInput = function () {\n if (self.input && self.input.editCell) {\n var pos = self.canvas.getBoundingClientRect(),\n s = self.scrollOffset(self.intf),\n bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,\n borderWidth = (self.style.cellBorderWidth * bm),\n cell = self.getVisibleCellByIndex(self.input.editCell.columnIndex, self.input.editCell.rowIndex)\n || {x: -100, y: -100, height: 0, width: 0};\n if (self.mobile) {\n self.input.style.left = '0';\n self.input.style.top = (self.height - self.style.mobileEditInputHeight) - borderWidth - 1 + 'px';\n self.input.style.height = self.style.mobileEditInputHeight + 'px';\n self.input.style.width = self.width - borderWidth - 1 + 'px';\n return;\n }\n self.input.style.left = pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';\n self.input.style.top = pos.top + cell.y - self.style.cellBorderWidth + self.canvasOffsetTop - s.top + 'px';\n self.input.style.height = cell.height - borderWidth + 'px';\n self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';\n self.clipElement(self.input);\n }\n };\n self.position = function (e, ignoreScrollOffset) {\n var x = 0, y = 0, s = e, h, w;\n while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {\n x += e.offsetLeft;\n y += e.offsetTop;\n h = e.offsetHeight;\n w = e.offsetWidth;\n e = e.offsetParent;\n }\n if (ignoreScrollOffset) {\n return {left: x, top: y, height: h, width: w};\n }\n e = s;\n s = self.scrollOffset(e);\n return { left: x + s.left, top: y + s.top, height: h, width: w };\n };\n self.getLayerPos = function (e) {\n var rect = self.canvas.getBoundingClientRect(),\n pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (self.isChildGrid) {\n pos.x -= self.canvasOffsetLeft;\n pos.y -= self.canvasOffsetTop;\n }\n return {\n x: pos.x,\n y: pos.y,\n rect: rect\n };\n };\n /**\n * Ends editing, optionally aborting the edit.\n * @memberof canvasDatagrid\n * @name endEdit\n * @method\n * @param {boolean} abort When true, abort the edit.\n */\n self.endEdit = function (abort) {\n var cell = self.input.editCell,\n y = cell.rowIndex;\n function abortEdit() {\n abort = true;\n }\n if (self.dispatchEvent('beforeendedit', {\n cell: cell,\n newValue: self.input.value,\n oldValue: cell.value,\n abort: abortEdit,\n input: self.input\n })) { return false; }\n if (self.input.value !== cell.value && !abort) {\n self.changes[y] = self.changes[y] || {};\n self.changes[y][cell.header.name] = self.input.value;\n if (!cell.data) {\n self.data[cell.rowIndex] = {};\n cell.data = self.data[cell.rowIndex];\n }\n cell.data[cell.header.name] = self.input.value;\n if (y === self.data.length) {\n if (self.dispatchEvent('newrow', {\n value: self.input.value,\n defaultValue: cell.value,\n aborted: abort,\n cell: cell,\n input: self.input\n })) { return false; }\n self.addRow(cell.data);\n self.createNewRowData();\n }\n self.draw(true);\n }\n if (self.input.parentNode) {\n self.input.parentNode.removeChild(self.input);\n }\n self.intf.focus();\n self.dispatchEvent('endedit', {\n cell: cell,\n value: self.input.value,\n aborted: abort,\n input: self.input\n });\n self.input = undefined;\n return true;\n };\n /**\n * Begins editing at cell x, row y.\n * @memberof canvasDatagrid\n * @name beginEditAt\n * @method\n * @param {number} x The column index of the cell to edit.\n * @param {number} y The row index of the cell to edit.\n */\n self.beginEditAt = function (x, y, NativeEvent) {\n if (!self.attributes.editable) { return; }\n if (self.input) {\n self.endEdit();\n }\n var cell = self.getVisibleCellByIndex(x, y),\n s = self.getSchema(),\n adjacentCells,\n enumItems,\n enu,\n option,\n valueInEnum;\n if (!(cell && cell.header)) { return; }\n //HACK for IE10, does not like literal enum\n enu = cell.header['enum'];\n if (self.dispatchEvent('beforebeginedit', {cell: cell, NativeEvent: NativeEvent})) { return false; }\n self.scrollIntoView(x, y);\n self.setActiveCell(x, y);\n adjacentCells = self.getAdjacentCells();\n if (enu) {\n self.input = document.createElement('select');\n } else {\n self.input = document.createElement(self.attributes.multiLine\n ? 'textarea' : 'input');\n }\n cell = self.getVisibleCellByIndex(x, y);\n //HACK on mobile devices sometimes edit can begin without the cell being in view, I don't know how.\n if (!cell) { return; }\n if (enu) {\n // add enums\n if (typeof enu === 'function') {\n enumItems = enu.apply(self.intf, [{cell: cell}]);\n } else if (Array.isArray(enu)) {\n enumItems = enu;\n }\n enumItems.forEach(function (e) {\n var i = document.createElement('option'),\n val,\n title;\n if (Array.isArray(e)) {\n val = e[0];\n title = e[1];\n } else {\n val = e;\n title = e;\n }\n if (val === cell.value) { valueInEnum = true; }\n i.value = val;\n i.innerHTML = title;\n self.input.appendChild(i);\n });\n if (!valueInEnum) {\n option = document.createElement('option');\n option.value = cell.value;\n option.innerHTML = cell.value;\n self.input.appendChild(option);\n }\n self.input.addEventListener('change', function () {\n self.endEdit();\n self.draw(true);\n });\n }\n // if the user has not prevented the default action, append to the body\n if (!self.dispatchEvent('appendeditinput', {cell: cell, input:self.input})) { \n document.body.appendChild(self.input);\n }\n self.createInlineStyle(self.input, self.mobile ? 'canvas-datagrid-edit-mobile-input' : 'canvas-datagrid-edit-input');\n self.input.style.position = 'absolute';\n self.input.editCell = cell;\n self.resizeEditInput();\n self.input.style.zIndex = self.style.editCellZIndex;\n self.input.style.fontSize = (parseInt(self.style.editCellFontSize, 10) * self.scale) + 'px';\n self.input.value = [null, undefined].indexOf(cell.value) !== -1 ? '' : cell.value;\n self.input.focus();\n self.input.addEventListener('click', self.stopPropagation);\n self.input.addEventListener('dblclick', self.stopPropagation);\n self.input.addEventListener('mouseup', self.stopPropagation);\n self.input.addEventListener('mousedown', self.stopPropagation);\n self.input.addEventListener('keydown', function (e) {\n var nx = cell.columnIndex,\n ny = cell.rowIndex;\n // esc\n if (e.keyCode === 27) {\n self.endEdit(true);\n self.draw(true);\n // enter\n } else if (e.keyCode === 13\n && (!self.attributes.multiLine\n || (self.attributes.multiLine && e.shiftKey))) {\n self.endEdit();\n self.draw(true);\n } else if (e.keyCode === 9) {\n e.preventDefault();\n if (!self.endEdit()) {\n return;\n }\n if (e.shiftKey) {\n nx = adjacentCells.left;\n } else {\n nx = adjacentCells.right;\n }\n if (adjacentCells.left === x && e.shiftKey) {\n nx = adjacentCells.last;\n ny -= 1;\n }\n if (adjacentCells.right === x && !e.shiftKey) {\n nx = adjacentCells.first;\n ny += 1;\n }\n if (ny < 0) {\n ny = self.data.length - 1;\n }\n if (ny > self.data.length - 1) {\n ny = 0;\n }\n self.scrollIntoView(nx, ny);\n self.beginEditAt(nx, ny, e);\n }\n });\n self.dispatchEvent('beginedit', {cell: cell, input: self.input});\n };\n self.createInlineStyle = function (el, className) {\n var css = {\n 'canvas-datagrid-context-menu-filter-input': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextFilterInputBackground,\n color: self.style.contextFilterInputColor,\n border: self.style.contextFilterInputBorder,\n borderRadius: self.style.contextFilterInputBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextFilterInputFontFamily,\n fontSize: self.style.contextFilterInputFontSize\n },\n 'canvas-datagrid-context-menu-filter-button': {\n height: '19px',\n verticalAlign: 'bottom',\n marginLeft: '2px',\n padding: '0',\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextFilterButtonBorder,\n borderRadius: self.style.contextFilterButtonBorderRadius,\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFilterButtonFontFamily,\n fontSize: self.style.contextMenuFilterButtonFontSize\n },\n 'canvas-datagrid-context-child-arrow': {\n cssFloat: 'right',\n color: self.style.childContextMenuArrowColor,\n fontSize: self.style.contextMenuChildArrowFontSize,\n fontFamily: self.style.contextMenuFontFamily,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-autocomplete': {\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n position: 'absolute',\n zIndex: 9999,\n overflow: 'hidden'\n },\n 'canvas-datagrid-autocomplete-item': {\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor\n },\n 'canvas-datagrid-autocomplete-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-canvas': {\n position: 'absolute',\n zIndex: '-1'\n },\n 'canvas-datagrid': {\n display: 'block'\n },\n 'canvas-datagrid-control-input': {\n position: 'fixed',\n top: '-5px',\n left: '-5px',\n border: 'none',\n opacity: '0',\n cursor: 'pointer',\n width: '1px',\n height: '1px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize\n },\n 'canvas-datagrid-edit-mobile-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 0',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.mobileEditFontFamily,\n fontSize: self.style.mobileEditFontSize,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-edit-input': {\n boxSizing: 'content-box',\n outline: 'none',\n margin: '0',\n padding: '0 0 0 ' + self.style.editCellPaddingLeft + 'px',\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.editCellFontFamily,\n fontSize: self.style.editCellFontSize,\n boxShadow: self.style.editCellBoxShadow,\n border: self.style.editCellBorder,\n color: self.style.editCellColor,\n background: self.style.editCellBackgroundColor,\n appearance: 'none',\n webkitAppearance: 'none',\n mozAppearance: 'none',\n borderRadius: '0'\n },\n 'canvas-datagrid-context-menu-item-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n color: 'inherit',\n background: 'inherit',\n margin: self.style.contextMenuItemMargin,\n borderRadius: self.style.contextMenuItemBorderRadius,\n verticalAlign: 'middle'\n },\n 'canvas-datagrid-context-menu-item:hover': {\n background: self.style.contextMenuHoverBackground,\n color: self.style.contextMenuHoverColor\n },\n 'canvas-datagrid-context-menu-label': {\n margin: self.style.contextMenuLabelMargin,\n display: self.style.contextMenuLabelDisplay,\n minWidth: self.style.contextMenuLabelMinWidth,\n maxWidth: self.style.contextMenuLabelMaxWidth\n },\n 'canvas-datagrid-context-menu-mobile': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n 'canvas-datagrid-context-menu': {\n lineHeight: 'normal',\n fontWeight: 'normal',\n fontFamily: self.style.contextMenuFontFamily,\n fontSize: self.style.contextMenuFontSize,\n background: self.style.contextMenuBackground,\n color: self.style.contextMenuColor,\n border: self.style.contextMenuBorder,\n padding: self.style.contextMenuPadding,\n borderRadius: self.style.contextMenuBorderRadius,\n opacity: self.style.contextMenuOpacity,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n cursor: self.style.contextMenuCursor\n },\n 'canvas-datagrid-invalid-search-regExp': {\n background: self.style.contextMenuFilterInvalidExpresion\n }\n };\n if (css[className]) {\n Object.keys(css[className]).map(function (prop) {\n el.style[prop] = css[className][prop];\n });\n }\n return;\n };\n self.appendTo = function (e) {\n self.parentNode = e;\n self.setDom();\n };\n self.setDom = function () {\n if (self.isChildGrid) {\n self.parentGrid = self.parentNode.parentGrid;\n self.ctx = self.parentGrid.context;\n self.canvas = self.parentGrid.canvas;\n self.controlInput = self.parentGrid.controlInput;\n self.eventParent = self.canvas;\n } else {\n self.controlInput = self.controlInput || document.createElement('input');\n self.controlInput.onblur = self.intf.blur;\n self.createInlineStyle(self.controlInput, 'canvas-datagrid-control-input');\n self.isChildGrid = false;\n self.parentDOMNode = self.parentNode;\n self.parentIsCanvas = /^canvas$/i.test(self.parentDOMNode.tagName);\n if (self.parentIsCanvas) {\n self.canvas = self.parentDOMNode;\n } else {\n self.canvas = document.createElement('canvas');\n if (self.intf.createShadowRoot) {\n self.parentDOMNode.appendChild(self.canvas);\n }\n }\n document.body.appendChild(self.controlInput);\n self.createInlineStyle(self.canvas, 'canvas-datagrid');\n self.ctx = self.canvas.getContext('2d');\n self.ctx.textBaseline = 'alphabetic';\n self.eventParent = self.canvas;\n }\n self.parentNodeStyle = self.canvas.style;\n self.controlInput.setAttribute('readonly', true);\n self.controlInput.addEventListener('blur', function (e) {\n if (e.target !== self.canvas) {\n self.hasFocus = false;\n }\n });\n self.eventParent.addEventListener('scroll', self.resize, false);\n self.eventParent.addEventListener('touchstart', self.touchstart, false);\n self.eventParent.addEventListener('mouseup', self.mouseup, false);\n self.eventParent.addEventListener('mousedown', self.mousedown, false);\n self.eventParent.addEventListener('dblclick', self.dblclick, false);\n self.eventParent.addEventListener('click', self.click, false);\n self.eventParent.addEventListener('mousemove', self.mousemove);\n self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);\n self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);\n self.controlInput.addEventListener('copy', self.copy);\n self.controlInput.addEventListener('cut', self.cut);\n self.controlInput.addEventListener('paste', self.paste);\n self.controlInput.addEventListener('keypress', self.keypress, false);\n self.controlInput.addEventListener('keyup', self.keyup, false);\n self.controlInput.addEventListener('keydown', self.keydown, false);\n window.addEventListener('resize', self.resize);\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/dom.js\n// module id = 8\n// module chunks = 0","/*jslint browser: true, unparam: true, todo: true*/\n/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/\ndefine([], function () {\n 'use strict';\n return function (self) {\n /**\n * Converts a integer into a letter A - ZZZZZ...\n * @memberof canvasDatagrid\n * @name integerToAlpha\n * @method\n * @param {column} n The number to convert.\n */\n self.integerToAlpha = function (n) {\n var ordA = 'a'.charCodeAt(0),\n ordZ = 'z'.charCodeAt(0),\n len = ordZ - ordA + 1,\n s = '';\n while (n >= 0) {\n s = String.fromCharCode(n % len + ordA) + s;\n n = Math.floor(n / len) - 1;\n }\n return s;\n };\n /**\n * Inserts a new column before the specified index into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name insertColumn\n * @method\n * @param {column} c The column to insert into the schema.\n * @param {number} index The index of the column to insert before.\n */\n self.insertColumn = function (c, index) {\n var s = self.getSchema();\n if (s.length < index) {\n throw new Error('Index is beyond the length of the schema.');\n }\n self.validateColumn(c, s);\n s.splice(index, 0, c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a column from the schema at the specified index.\n * @memberof canvasDatagrid\n * @name deleteColumn\n * @tutorial schema\n * @method\n * @param {number} index The index of the column to delete.\n */\n self.deleteColumn = function (index) {\n var s = self.getSchema();\n // remove data matching this column name from data\n self.data.forEach(function (row) {\n delete row[s[index].name];\n });\n s.splice(index, 1);\n self.intf.schema = s;\n };\n /**\n * Adds a new column into the schema.\n * @tutorial schema\n * @memberof canvasDatagrid\n * @name addColumn\n * @method\n * @param {column} c The column to add to the schema.\n */\n self.addColumn = function (c) {\n var s = self.getSchema();\n self.validateColumn(c, s);\n s.push(c);\n self.data.forEach(function (row) {\n self.applyDefaultValue(row, c);\n });\n self.intf.schema = s;\n };\n /**\n * Deletes a row from the dataset at the specified index.\n * @memberof canvasDatagrid\n * @name deleteRow\n * @method\n * @param {number} index The index of the row to delete.\n */\n self.deleteRow = function (index) {\n self.originalData.splice(index, 1);\n self.setFilter();\n self.resize(true);\n };\n /**\n * Inserts a new row into the dataset before the specified index.\n * @memberof canvasDatagrid\n * @name insertRow\n * @method\n * @param {object} d data.\n * @param {number} index The index of the row to insert before.\n */\n self.insertRow = function (d, index) {\n if (self.originalData.length < index) {\n throw new Error('Index is beyond the length of the dataset.');\n }\n self.originalData.splice(index, 0, d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[index], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Adds a new row into the dataset.\n * @memberof canvasDatagrid\n * @name addRow\n * @method\n * @param {object} d data.\n */\n self.addRow = function (d) {\n self.originalData.push(d);\n self.getSchema().forEach(function (c) {\n if (d[c.name] === undefined) {\n self.applyDefaultValue(self.originalData[self.originalData.length - 1], c);\n }\n });\n self.setFilter();\n self.resize(true);\n };\n /**\n * Sets the height of a given row by index number.\n * @memberof canvasDatagrid\n * @name setRowHeight\n * @method\n * @param {number} rowIndex The index of the row to set.\n * @param {number} height Height to set the row to.\n */\n self.setRowHeight = function (rowIndex, height) {\n self.sizes.rows[rowIndex] = height;\n self.draw(true);\n };\n /**\n * Sets the width of a given column by index number.\n * @memberof canvasDatagrid\n * @name setColumnWidth\n * @method\n * @param {number} colIndex The index of the column to set.\n * @param {number} width Width to set the column to.\n */\n self.setColumnWidth = function (colIndex, width) {\n self.sizes.columns[colIndex] = width;\n self.draw(true);\n };\n /**\n * Removes any changes to the width of the columns due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetColumnWidths\n * @tutorial schema\n * @method\n */\n self.resetColumnWidths = function () {\n self.sizes.columns = {};\n self.draw(true);\n };\n /**\n * Removes any changes to the height of the rows due to user or api interaction, setting them back to the schema or style default.\n * @memberof canvasDatagrid\n * @name resetRowHeights\n * @tutorial schema\n * @method\n */\n self.resetRowHeights = function () {\n self.sizes.rows = {};\n self.draw(true);\n };\n /**\n * Sets the value of the filter.\n * @memberof canvasDatagrid\n * @name setFilter\n * @method\n * @param {string} column Name of the column to filter.\n * @param {string} value The value to filter for.\n */\n self.setFilter = function (column, value) {\n function applyFilter() {\n self.refreshFromOrigialData();\n Object.keys(self.columnFilters).forEach(function (filter) {\n var header = self.getHeaderByName(column);\n if (!header) {\n return;\n }\n self.currentFilter = header.filter || self.filter(column.type || 'string');\n self.data = self.data.filter(function (row) {\n return self.currentFilter(row[filter], self.columnFilters[filter]);\n });\n });\n self.resize();\n self.draw(true);\n }\n if (column === undefined && value === undefined) {\n self.columnFilters = {};\n return applyFilter();\n }\n if (column && (value === '' || value === undefined)) {\n delete self.columnFilters[column];\n } else {\n self.columnFilters[column] = value;\n }\n applyFilter();\n };\n /**\n * Returns the number of pixels to scroll down to line up with row rowIndex.\n * @memberof canvasDatagrid\n * @name findRowScrollTop\n * @method\n * @param {number} rowIndex The row index of the row to scroll find.\n */\n self.findRowScrollTop = function (rowIndex) {\n if (self.scrollCache.y[rowIndex] === undefined) { throw new RangeError('Row index out of range.'); }\n return self.scrollCache.y[rowIndex];\n };\n /**\n * Returns the number of pixels to scroll to the left to line up with column columnIndex.\n * @memberof canvasDatagrid\n * @name findColumnScrollLeft\n * @method\n * @param {number} columnIndex The column index of the column to find.\n */\n self.findColumnScrollLeft = function (columnIndex) {\n var i = Math.max(columnIndex - 1, 0);\n if (self.scrollCache.x[i] === undefined) { throw new Error('Column index out of range.'); }\n return self.scrollCache.x[i] - self.getColummnWidth(self.orders.columns[columnIndex]);\n };\n /**\n * Scrolls to the cell at columnIndex x, and rowIndex y. If you define both rowIndex and columnIndex additional calculations can be made to center the cell using the target cell's height and width. Defining only one rowIndex or only columnIndex will result in simpler calculations.\n * @memberof canvasDatagrid\n * @name gotoCell\n * @method\n * @param {number} x The column index of the cell to scroll to.\n * @param {number} y The row index of the cell to scroll to.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.gotoCell = function (x, y, offsetX, offsetY) {\n var targetX = x === undefined ? undefined : self.findColumnScrollLeft(x),\n targetY = y === undefined ? undefined : self.findRowScrollTop(y),\n cell,\n sbw = self.scrollBox.width - (self.scrollBox.verticalBarVisible ? self.style.scrollBarWidth : 0),\n sbh = self.scrollBox.height - (self.scrollBox.horizontalBarVisible ? self.style.scrollBarWidth : 0);\n offsetX = offsetX === undefined ? 0 : offsetX;\n offsetY = offsetY === undefined ? 0 : offsetY;\n targetX -= sbw * offsetX;\n targetY -= sbh * offsetY;\n if (x !== undefined && y !== undefined) {\n self.scrollBox.scrollTo(targetX, targetY);\n requestAnimationFrame(function () {\n cell = self.getVisibleCellByIndex(x, y);\n // HACK: just don't offset if the target cell cannot be seen\n // TODO: offset does not work on very small grids, not sure why\n if (!cell) { return; }\n targetX += cell.width * offsetX;\n targetY += cell.height * offsetY;\n self.scrollBox.scrollTo(targetX, targetY);\n });\n } else if (x !== undefined) {\n self.scrollBox.scrollLeft = targetX;\n } else if (y !== undefined) {\n self.scrollBox.scrollTop = targetY;\n }\n };\n /**\n * Scrolls the row y.\n * @memberof canvasDatagrid\n * @name gotoRow\n * @method\n * @param {number} y The row index of the cell to scroll to.\n */\n self.gotoRow = function (y) {\n self.gotoCell(0, y);\n };\n /**\n * Scrolls the cell at cell x, row y into view if it is not already.\n * @memberof canvasDatagrid\n * @name scrollIntoView\n * @method\n * @param {number} x The column index of the cell to scroll into view.\n * @param {number} y The row index of the cell to scroll into view.\n * @param {number} [offsetX=0] Percentage offset the cell should be from the left edge (not including headers). The default is 0, meaning the cell will appear at the left edge. Valid values are 0 through 1. 1 = Left, 0 = Right, 0.5 = Center.\n * @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.\n */\n self.scrollIntoView = function (x, y, offsetX, offsetY) {\n if (self.visibleCells.filter(function (cell) {\n return (cell.rowIndex === y || y === undefined)\n && (cell.columnIndex === x || x === undefined)\n && cell.x > 0\n && cell.y > 0\n && cell.x + cell.width < self.width\n && cell.y + cell.height < self.height;\n }).length === 0) {\n self.gotoCell(x, y, offsetX, offsetY);\n }\n };\n /**\n * Sets the active cell. Requires redrawing.\n * @memberof canvasDatagrid\n * @name setActiveCell\n * @method\n * @param {number} x The column index of the cell to set active.\n * @param {number} y The row index of the cell to set active.\n */\n self.setActiveCell = function (x, y) {\n if (x < 0) { x = 0; }\n if (y < 0) { y = 0; }\n self.activeCell = {\n rowIndex: y,\n columnIndex: x\n };\n };\n /**\n * Removes the selection.\n * @memberof canvasDatagrid\n * @name selectNone\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectNone = function (dontDraw) {\n self.selections = [];\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Selects every visible cell.\n * @memberof canvasDatagrid\n * @name selectAll\n * @param {boolean} dontDraw Suppress the draw method after the selection change.\n * @method\n */\n self.selectAll = function (dontDraw) {\n self.selectArea({\n top: 0,\n left: -1,\n right: self.getSchema().length - 1,\n bottom: self.data.length - 1\n });\n if (dontDraw) { return; }\n self.draw();\n };\n /**\n * Returns true if the selected columnIndex is selected on every row.\n * @memberof canvasDatagrid\n * @name isColumnSelected\n * @method\n * @param {number} columnIndex The column index to check.\n */\n self.isColumnSelected = function (columnIndex) {\n var colIsSelected = true;\n self.data.forEach(function (row, rowIndex) {\n if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(self.orders.columns[columnIndex]) === -1) {\n colIsSelected = false;\n }\n });\n return colIsSelected;\n };\n /**\n * Runs the defined method on each selected cell.\n * @memberof canvasDatagrid\n * @name forEachSelectedCell\n * @method\n * @param {number} fn The function to execute. The signature of the function is: (data, rowIndex, columnName).\n * @param {number} expandToRow When true the data in the array is expanded to the entire row.\n */\n self.forEachSelectedCell = function (fn, expandToRow) {\n var d = [], s = expandToRow ? self.getSchema() : self.getVisibleSchema(), l = self.data.length;\n self.selections.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) {\n d[index] = null;\n return;\n }\n d[index] = {};\n row.forEach(function (col) {\n if (col === -1 || !s[col]) { return; }\n fn(self.data, index, s[col].name);\n });\n });\n };\n /**\n * Selects a column.\n * @memberof canvasDatagrid\n * @name selectColumn\n * @method\n * @param {number} columnIndex The column index to select.\n * @param {boolean} toggleSelectMode When true, behaves as if you were holding control/command when you clicked the column.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the column.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {\n var s, e, x;\n function addCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) === -1) {\n self.selections[rowIndex].push(i);\n }\n });\n }\n function removeCol(i) {\n self.data.forEach(function (row, rowIndex) {\n self.selections[rowIndex] = self.selections[rowIndex] || [];\n if (self.selections[rowIndex].indexOf(i) !== -1) {\n self.selections[rowIndex].splice(self.selections[rowIndex].indexOf(i), 1);\n }\n });\n }\n if (shift) {\n if (!self.activeCell) { return; }\n s = Math.min(self.activeCell.columnIndex, columnIndex);\n e = Math.max(self.activeCell.columnIndex, columnIndex);\n for (x = s; e > x; x += 1) {\n addCol(x);\n }\n }\n if (!ctrl && !shift) {\n self.selections = [];\n self.activeCell.columnIndex = columnIndex;\n self.activeCell.rowIndex = self.scrollIndexTop;\n }\n if (ctrl && self.isColumnSelected(columnIndex)) {\n removeCol(columnIndex);\n } else {\n addCol(columnIndex);\n }\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.getSelectionBounds()\n });\n };\n /**\n * Selects a row.\n * @memberof canvasDatagrid\n * @name selectRow\n * @method\n * @param {number} rowIndex The row index to select.\n * @param {boolean} ctrl When true, behaves as if you were holding control/command when you clicked the row.\n * @param {boolean} shift When true, behaves as if you were holding shift when you clicked the row.\n * @param {boolean} supressSelectionchangedEvent When true, prevents the selectionchanged event from firing.\n */\n self.selectRow = function (rowIndex, ctrl, shift, supressEvent) {\n var x, st, en, s = self.getVisibleSchema();\n function de() {\n if (supressEvent) { return; }\n self.dispatchEvent('selectionchanged', {\n selectedData: self.getSelectedData(),\n selections: self.selections,\n selectionBounds: self.selectionBounds\n });\n }\n function addRow(ri) {\n self.selections[ri] = [];\n self.selections[ri].push(-1);\n s.forEach(function (col, index) {\n self.selections[ri].push(self.orders.columns.indexOf(col.index));\n });\n }\n if (self.dragAddToSelection === false || self.dragObject === undefined) {\n if (self.selections[rowIndex] && self.selections[rowIndex].length - 1 === s.length) {\n if (ctrl) {\n self.selections[rowIndex] = [];\n de();\n return;\n }\n }\n }\n if (self.dragAddToSelection === true || self.dragObject === undefined) {\n if (shift && self.dragObject === undefined) {\n if (!self.activeCell) { return; }\n st = Math.min(self.activeCell.rowIndex, rowIndex);\n en = Math.max(self.activeCell.rowIndex, rowIndex);\n for (x = st; en >= x; x += 1) {\n addRow(x);\n }\n } else {\n addRow(rowIndex);\n }\n }\n de();\n };\n /**\n * Collapse a tree grid by row index.\n * @memberof canvasDatagrid\n * @name collapseTree\n * @method\n * @param {number} index The index of the row to collapse.\n */\n self.collapseTree = function (rowIndex) {\n self.dispatchEvent('collapsetree', {\n childGrid: self.childGrids[rowIndex],\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex].blur();\n self.openChildren[rowIndex].dispose();\n delete self.openChildren[rowIndex];\n delete self.sizes.trees[rowIndex];\n delete self.childGrids[rowIndex];\n self.dispatchEvent('resizerow', {\n cellHeight: self.style.cellHeight\n });\n self.resize(true);\n self.draw(true);\n };\n /**\n * Expands a tree grid by row index.\n * @memberof canvasDatagrid\n * @name expandTree\n * @method\n * @param {number} index The index of the row to expand.\n */\n self.expandTree = function (rowIndex) {\n var trArgs = self.args.treeGridAttributes || {},\n columnHeaderCellHeight = self.getColumnHeaderCellHeight(),\n rowHeaderCellWidth = self.sizes.columns.cornerCell || self.style.rowHeaderCellWidth,\n h = self.sizes.trees[rowIndex] || self.style.treeGridHeight,\n treeGrid;\n if (!self.childGrids[rowIndex]) {\n trArgs.debug = self.attributes.debug;\n trArgs.name = self.attributes.saveAppearance ? self.attributes.name + 'tree' + rowIndex : undefined;\n trArgs.style = trArgs.style || self.style;\n trArgs.parentNode = {\n parentGrid: self.intf,\n nodeType: 'canvas-datagrid-tree',\n offsetHeight: h,\n offsetWidth: self.width - rowHeaderCellWidth,\n header: { width: self.width - rowHeaderCellWidth },\n offsetLeft: rowHeaderCellWidth,\n offsetTop: columnHeaderCellHeight,\n offsetParent: self.intf.parentNode,\n parentNode: self.intf.parentNode,\n style: 'tree',\n data: self.data[rowIndex]\n };\n treeGrid = self.createGrid(trArgs);\n self.childGrids[rowIndex] = treeGrid;\n }\n treeGrid = self.childGrids[rowIndex];\n treeGrid.visible = true;\n self.dispatchEvent('expandtree', {\n treeGrid: treeGrid,\n data: self.data[rowIndex],\n rowIndex: rowIndex\n });\n self.openChildren[rowIndex] = treeGrid;\n self.sizes.trees[rowIndex] = h;\n self.dispatchEvent('resizerow', {height: self.style.cellHeight});\n self.resize(true);\n };\n /**\n * Toggles tree grid open and close by row index.\n * @memberof canvasDatagrid\n * @name toggleTree\n * @method\n * @param {number} index The index of the row to toggle.\n */\n self.toggleTree = function (rowIndex) {\n var i = self.openChildren[rowIndex];\n if (i) {\n return self.collapseTree(rowIndex);\n }\n self.expandTree(rowIndex);\n };\n /**\n * Returns a header from the schema by name.\n * @memberof canvasDatagrid\n * @name getHeaderByName\n * @tutorial schema\n * @method\n * @returns {header} header with the selected name, or undefined.\n * @param {string} name The name of the column to resize.\n */\n self.getHeaderByName = function (name) {\n var x, i = self.getSchema();\n for (x = 0; x < i.length; x += 1) {\n if (i[x].name === name) {\n return i[x];\n }\n }\n };\n /**\n * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.\n * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).\n * @memberof canvasDatagrid\n * @name fitColumnToValues\n * @method\n * @param {string} name The name of the column to resize.\n */\n self.fitColumnToValues = function (name, internal) {\n if (!self.canvas) { return; }\n self.sizes.columns[name === 'cornerCell' ? -1 : self.getHeaderByName(name).index]\n = Math.max(self.findColumnMaxTextLength(name), self.style.minColumnWidth);\n if (!internal) {\n self.resize();\n self.draw(true);\n }\n };\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @overload\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {number} columnIndex The column index of the cell to check.\n * @param {number} rowIndex The row index of the cell to check.\n */\n /**\n * Checks if a cell is currently visible.\n * @memberof canvasDatagrid\n * @name isCellVisible\n * @method\n * @returns {boolean} when true, the cell is visible, when false the cell is not currently drawn.\n * @param {cell} cell The cell to check for. Alternatively you can pass an object { x: , y: }.\n */\n self.isCellVisible = function (cell, rowIndex) {\n // overload\n if (rowIndex !== undefined) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === cell && c.rowIndex === rowIndex;\n }).length > 0;\n }\n var x, l = self.visibleCells.length;\n for (x = 0; x < l; x += 1) {\n if (cell.x === self.visibleCells[x].x && cell.y === self.visibleCells[x].y) {\n return true;\n }\n }\n return false;\n };\n /**\n * Sets the order of the data.\n * @memberof canvasDatagrid\n * @name order\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} columnName Name of the column to be sorted.\n * @param {string} direction `asc` for ascending or `desc` for descending.\n * @param {function} [sortFunction] When defined, override the default sorting method defined in the column's schema and use this one.\n * @param {bool} [dontSetStorageData] Don't store this setting for future use.\n */\n self.order = function (columnName, direction, sortFunction, dontSetStorageData) {\n var f,\n c = self.getSchema().filter(function (col) {\n return col.name === columnName;\n });\n if (self.dispatchEvent('beforesortcolumn', {name: columnName, direction: direction})) { return; }\n self.orderBy = columnName;\n if (!self.data || self.data.length === 0) { return; }\n if (c.length === 0) {\n throw new Error('Cannot sort. No such column name');\n }\n f = sortFunction || self.sorters[c[0].type];\n if (!f && c[0].type !== undefined) {\n console.warn('Cannot sort type \"%s\" falling back to string sort.', c[0].type);\n }\n self.data = self.data.sort(typeof f === 'function' ? f(columnName, direction) : self.sorters.string);\n self.dispatchEvent('sortcolumn', {name: columnName, direction: direction});\n self.draw(true);\n if (dontSetStorageData) { return; }\n self.setStorageData();\n };\n self.isInGrid = function (e) {\n if (e.x < 0\n || e.x > self.width\n || e.y < 0\n || e.y > self.height) {\n return false;\n }\n return true;\n };\n /**\n * Moves the current selection relative to the its current position. Note: this method does not move the selected data, just the selection itself.\n * @memberof canvasDatagrid\n * @name moveSelection\n * @method\n * @param {number} offsetX The number of columns to offset the selection.\n * @param {number} offsetY The number of rows to offset the selection.\n */\n self.moveSelection = function (offsetX, offsetY) {\n var sel = [];\n self.selections.forEach(function (row, rowIndex) {\n sel[rowIndex + offsetY] = [];\n row.forEach(function (colIndex) {\n sel[rowIndex + offsetY].push(colIndex + offsetX);\n });\n });\n self.selections = sel;\n };\n /**\n * Moves data in the provided selection to another position in the grid. Moving data off the edge of the schema (columns/x) will truncate data.\n * @memberof canvasDatagrid\n * @name moveTo\n * @method\n * @param {array} sel 2D array representing selected rows and columns. `canvasDatagrid.selections` is in this format and can be used here.\n * @param {number} x The column index to start inserting the selection at.\n * @param {number} y The row index to start inserting the selection at.\n */\n self.moveTo = function (sel, x, y) {\n var d = self.getSelectedData(),\n s = self.getVisibleSchema(),\n l = sel.length,\n xi,\n maxRowLength = -Infinity,\n minXi = Infinity,\n yi = y - 1;\n sel.forEach(function (row, index) {\n if (index === l) { return; }\n if (row.length === 0) { return; }\n minXi = Math.min(self.getVisibleColumnIndexOf(x), minXi);\n maxRowLength = Math.max(maxRowLength, row.length);\n row.forEach(function (colIndex) {\n // intentional redef of colIndex\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (!s[colIndex]) { return; }\n if (!self.data[index]) { self.data[index] = {}; }\n self.data[index][s[colIndex].name] = null;\n });\n });\n sel.forEach(function (row, index) {\n var lastSourceIndex;\n yi += 1;\n xi = self.getVisibleColumnIndexOf(x);\n row.forEach(function (colIndex, cidx) {\n colIndex = self.getVisibleColumnIndexOf(colIndex);\n if (cidx > 0) {\n // this confusing bit of nonsense figures out\n // if the selection has skipped cells\n xi += colIndex - lastSourceIndex;\n }\n lastSourceIndex = colIndex;\n if (colIndex === -1\n || !s[xi]\n || !s[colIndex]\n || self.data.length - 1 < yi\n || yi < 0) { return; }\n if (!self.data[yi]) { self.data[yi] = {}; }\n self.data[yi][s[xi].name] = d[index][s[colIndex].name];\n });\n });\n };\n /**\n * Checks if a given column is visible.\n * @memberof canvasDatagrid\n * @name isColumnVisible\n * @method\n * @returns {boolean} When true, the column is visible.\n * @param {number} columnIndex Column index.\n */\n self.isColumnVisible = function (columnIndex) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === columnIndex;\n }).length > 0;\n };\n /**\n * Checks if a given row is visible.\n * @memberof canvasDatagrid\n * @name isRowVisible\n * @method\n * @returns {boolean} When true, the row is visible.\n * @param {number} rowIndex Row index.\n */\n self.isRowVisible = function (rowIndex) {\n return self.visibleCells.filter(function (c) {\n return c.rowIndex === rowIndex;\n }).length > 0;\n };\n /**\n * Gets the cell at columnIndex and rowIndex.\n * @memberof canvasDatagrid\n * @name getVisibleCellByIndex\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Column index.\n * @param {number} y Row index.\n */\n self.getVisibleCellByIndex = function (x, y) {\n return self.visibleCells.filter(function (c) {\n return c.columnIndex === x && c.rowIndex === y;\n })[0];\n };\n /**\n * Gets the cell at grid pixel coordinate x and y. Author's note. This function ties drawing and events together. This is a very complex function and is core to the component.\n * @memberof canvasDatagrid\n * @name getCellAt\n * @method\n * @returns {cell} cell at the selected location.\n * @param {number} x Number of pixels from the left.\n * @param {number} y Number of pixels from the top.\n */\n self.getCellAt = function (x, y, useTouchScrollZones) {\n function getBorder(entitiy) {\n if (entitiy.x + entitiy.width - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + entitiy.width + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'r';\n }\n if (entitiy.x - (self.attributes.borderResizeZone * 0.4) < x && entitiy.x + (self.attributes.borderResizeZone * 0.6) > x) {\n return 'l';\n }\n if (entitiy.y + entitiy.height - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + entitiy.height + (self.attributes.borderResizeZone * 0.6) > y) {\n return 'b';\n }\n if (entitiy.y - (self.attributes.borderResizeZone * 0.4) < y && entitiy.y + (self.attributes.borderResizeZone * 0.6) > y) {\n return 't';\n }\n }\n if (!self.visibleCells) { return; }\n var border,\n tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,\n moveMode = self.attributes.borderDragBehavior === 'move',\n i,\n l = self.visibleCells.length,\n moveBorder,\n xBorderBehavior = moveMode ? self.cursorGrab : 'ew-resize',\n yBorderBehavior = moveMode ? self.cursorGrab : 'ns-resize',\n cell,\n entitiy;\n if (!self.visibleCells || !self.visibleCells.length) { return; }\n self.hasFocus = true;\n if (!(y < self.height\n && y > 0\n && x < self.width\n && x > 0)) {\n self.hasFocus = false;\n return {\n dragContext: 'inherit',\n context: 'inherit'\n };\n }\n for (i = 0; i < l; i += 1) {\n cell = self.visibleCells[i];\n // interactive dimensions of the cell. used for touch \"over size\" zones\n entitiy = {\n x: cell.x,\n y: cell.y,\n height: cell.height,\n width: cell.width\n };\n if (useTouchScrollZones && /(vertical|horizontal)-scroll-/.test(cell.style)) {\n entitiy.x -= tsz;\n entitiy.y -= tsz;\n entitiy.height += tsz;\n entitiy.width += tsz;\n }\n if (entitiy.x - self.style.cellBorderWidth < x\n && entitiy.x + entitiy.width + self.style.cellBorderWidth > x\n && entitiy.y - self.style.cellBorderWidth < y\n && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {\n if (/frozen-row-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'row-resize';\n return cell;\n }\n if (/frozen-column-marker/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'col-resize';\n return cell;\n }\n if (/selection-handle-/.test(cell.style)) {\n cell.dragContext = cell.style;\n cell.context = 'crosshair';\n return cell;\n }\n if (/vertical-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'vertical-scroll-box';\n cell.context = 'vertical-scroll-box';\n cell.isScrollBar = true;\n cell.isVerticalScrollBar = true;\n if (y > self.scrollBox.box.v.y + self.scrollBox.scrollBoxHeight) {\n cell.dragContext = 'vertical-scroll-bottom';\n cell.context = 'vertical-scroll-bottom';\n } else if (y < self.scrollBox.box.v.y) {\n cell.dragContext = 'vertical-scroll-top';\n cell.context = 'vertical-scroll-top';\n }\n self.cursor = 'default';\n return cell;\n }\n if (/horizontal-scroll-(bar|box)/.test(cell.style)) {\n cell.dragContext = 'horizontal-scroll-box';\n cell.context = 'horizontal-scroll-box';\n cell.isScrollBar = true;\n cell.isHorizontalScrollBar = true;\n if (x > self.scrollBox.box.h.x + self.scrollBox.scrollBoxWidth) {\n cell.dragContext = 'horizontal-scroll-right';\n cell.context = 'horizontal-scroll-right';\n } else if (x < self.scrollBox.box.h.x) {\n cell.dragContext = 'horizontal-scroll-left';\n cell.context = 'horizontal-scroll-left';\n }\n self.cursor = 'default';\n return cell;\n }\n border = getBorder(entitiy);\n // check if the border of this cell is the border of the selection and if so show move cursor in move mode\n moveBorder = moveMode && cell.selectionBorder && cell.selectionBorder.indexOf(border) !== -1;\n if (['l', 'r'].indexOf(border) !== -1\n && (self.attributes.allowColumnResize || moveBorder)\n && ((self.attributes.allowColumnResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && ((self.attributes.allowRowHeaderResize && (cell.isRowHeader || cell.isCorner)) || !(cell.isRowHeader && cell.isCorner))) {\n if (((cell.isColumnHeader || cell.isCorner) || (self.attributes.allowColumnResizeFromCell && cell.isNormal)) && border === 'r') {\n cell.context = 'ew-resize';\n cell.dragContext = 'ew-resize';\n return cell;\n }\n if (!(cell.isColumnHeader || cell.isCorner) && moveBorder) {\n cell.context = xBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (['t', 'b'].indexOf(border) !== -1\n && cell.rowIndex > -1\n && (self.attributes.allowRowResize || moveBorder)\n && ((self.attributes.allowRowResizeFromCell && cell.isNormal) || !cell.isNormal || moveBorder)\n && !cell.isColumnHeader) {\n if (((cell.isRowHeader || cell.isCorner) || (self.attributes.allowRowResizeFromCell && cell.isNormal)) && border === 'b') {\n cell.context = 'ns-resize';\n cell.dragContext = 'ns-resize';\n return cell;\n }\n if (!(cell.isRowHeader || cell.isCorner) && moveBorder) {\n cell.context = yBorderBehavior;\n cell.dragContext = border + '-move';\n return cell;\n }\n }\n if (cell.style === 'columnHeaderCell') {\n cell.context = 'cell';\n cell.dragContext = 'column-reorder';\n return cell;\n }\n if (cell.style === 'rowHeaderCell') {\n if ((self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y)\n || !self.attributes.allowRowReordering) {\n cell.dragContext = 'cell';\n cell.context = 'cell';\n } else {\n cell.context = self.cursorGrab;\n cell.dragContext = 'row-reorder';\n }\n return cell;\n }\n if (cell.isGrid) {\n self.hasFocus = false;\n cell.dragContext = 'cell-grid';\n cell.context = 'cell-grid';\n return cell;\n }\n if (cell.style === 'tree-grid') {\n self.hasFocus = false;\n cell.dragContext = 'tree';\n cell.context = 'tree';\n return cell;\n }\n cell.dragContext = 'cell';\n cell.context = 'cell';\n return cell;\n }\n }\n self.hasFocus = true;\n self.cursor = 'default';\n return {\n dragContext: 'background',\n context: 'background',\n style: 'background',\n isBackground: true\n };\n };\n /**\n * Gets the bounds of current selection. \n * @returns {rect} selection.\n * @memberof canvasDatagrid\n * @name getSelectionBounds\n * @method\n */\n self.getSelectionBounds = function () {\n var low = {x: Infinity, y: Infinity},\n high = {x: -Infinity, y: -Infinity};\n self.selections.forEach(function (row, rowIndex) {\n var maxCol, minCol;\n low.y = rowIndex < low.y ? rowIndex : low.y;\n high.y = rowIndex > high.y ? rowIndex : high.y;\n maxCol = Math.max.apply(null, row);\n minCol = Math.min.apply(null, row);\n low.x = minCol < low.x ? minCol : low.x;\n high.x = maxCol > high.x ? maxCol : high.x;\n });\n return {\n top: low.y,\n left: low.x,\n bottom: high.y,\n right: high.x\n };\n };\n /**\n * Returns an auto generated schema based on data structure.\n * @memberof canvasDatagrid\n * @name getSchemaFromData\n * @method\n * @tutorial schema\n * @returns {schema} schema A schema based on the first item in the data array.\n */\n self.getSchemaFromData = function (d) {\n d = d || self.data;\n return Object.keys(d[0] || {' ': ''}).map(function mapEachSchemaColumn(key, index) {\n var type = self.getBestGuessDataType(key, d),\n i = {\n name: key,\n title: isNaN(parseInt(key, 10)) ? key : self.integerToAlpha(key).toUpperCase(),\n index: index,\n type: type,\n filter: self.filter(type)\n };\n if (self.storedSettings\n && self.storedSettings.visibility\n && self.storedSettings.visibility[i.name] !== undefined) {\n i.hidden = !self.storedSettings.visibility[i.name];\n }\n return i;\n });\n };\n /**\n * Clears the change log grid.changes that keeps track of changes to the data set.\n * This does not undo changes or alter data it is simply a convince array to keep\n * track of changes made to the data since last this method was called.\n * @memberof canvasDatagrid\n * @name clearChangeLog\n * @method\n */\n self.clearChangeLog = function () {\n self.changes = [];\n };\n /**\n * Selects an area of the grid.\n * @memberof canvasDatagrid\n * @name selectArea\n * @method\n * @param {rect} bounds A rect object representing the selected values.\n */\n self.selectArea = function (bounds, ctrl) {\n self.selectionBounds = bounds || self.selectionBounds;\n var ev, x, y, s = self.getSchema();\n if (!ctrl) {\n self.selections = [];\n }\n if (self.selectionBounds.top < -1\n || self.selectionBounds.bottom > self.data.length\n || self.selectionBounds.left < -1\n || self.selectionBounds.right > s.length) {\n throw new Error('Impossible selection area');\n }\n for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {\n self.selections[x] = [];\n for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {\n if (self.selections[x].indexOf(y) === -1) {\n self.selections[x].push(y);\n }\n }\n }\n ev = {\n selections: self.selections,\n selectionBounds: self.selectionBounds\n };\n Object.defineProperty(ev, 'selectedData', {\n get: function () {\n return self.getSelectedData();\n }\n });\n self.dispatchEvent('selectionchanged', ev);\n };\n /**\n * Returns the maximum text width for a given column by column name.\n * @memberof canvasDatagrid\n * @name findColumnMaxTextLength\n * @method\n * @returns {number} The number of pixels wide the maximum width value in the selected column.\n * @param {string} name The name of the column to calculate the value's width of.\n */\n self.findColumnMaxTextLength = function (name) {\n var m = -Infinity;\n if (name === 'cornerCell') {\n self.ctx.font = self.style.rowHeaderCellFont;\n return self.ctx.measureText((self.data.length + (self.attributes.showNewRow ? 1 : 0)).toString()).width\n + self.style.autosizePadding + self.style.autosizeHeaderCellPadding\n + self.style.rowHeaderCellPaddingRight\n + self.style.rowHeaderCellPaddingLeft\n + (self.attributes.tree ? self.style.treeArrowWidth\n + self.style.treeArrowMarginLeft + self.style.treeArrowMarginRight : 0);\n }\n self.getSchema().forEach(function (col) {\n if (col.name !== name) { return; }\n self.ctx.font = self.style.columnHeaderCellFont;\n var t = self.ctx.measureText(col.title || col.name).width\n + self.style.headerCellPaddingRight\n + self.style.headerCellPaddingLeft;\n m = t > m ? t : m;\n });\n self.data.forEach(function (row) {\n self.ctx.font = self.style.cellFont;\n var t = self.ctx.measureText(row[name]).width\n + self.style.cellPaddingRight\n + self.style.cellPaddingLeft + self.style.cellAutoResizePadding;\n m = t > m ? t : m;\n });\n return m;\n };\n /**\n * Gets the total width of all header columns.\n * @memberof canvasDatagrid\n * @name getHeaderWidth\n * @method\n */\n self.getHeaderWidth = function () {\n return self.getVisibleSchema().reduce(function (total, header) {\n return total + (header.width || self.style.cellWidth);\n }, 0);\n };\n /**\n * Gets the height of a row by index.\n * @memberof canvasDatagrid\n * @name getRowHeight\n * @method\n * @param {number} rowIndex The row index to lookup.\n */\n self.getRowHeight = function (rowIndex) {\n return ((self.sizes.rows[rowIndex]\n || self.style.cellHeight) * self.scale);\n };\n /**\n * Gets the width of a column by index.\n * @memberof canvasDatagrid\n * @name getColummnWidth\n * @method\n * @param {number} columnIndex The column index to lookup.\n */\n self.getColummnWidth = function (columnIndex) {\n return ((self.sizes.columns[columnIndex]\n || self.getSchema()[columnIndex].width\n || self.style.cellWidth) * self.scale);\n };\n self.formatters.string = function cellFormatterString(e) {\n return e.cell.value !== undefined ? e.cell.value : '';\n };\n self.formatters.rowHeaderCell = self.formatters.string;\n self.formatters.headerCell = self.formatters.string;\n self.formatters.number = self.formatters.string;\n self.formatters.int = self.formatters.string;\n self.formatters.html = self.formatters.string;\n self.sorters.string = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (a[columnName] === undefined || a[columnName] === null) {\n return 1;\n }\n if (b[columnName] === undefined || b[columnName] === null) {\n return 0;\n }\n if (asc) {\n if (!a[columnName].localeCompare) { return 1; }\n return a[columnName].localeCompare(b[columnName]);\n }\n if (!b[columnName].localeCompare) { return 1; }\n return b[columnName].localeCompare(a[columnName]);\n };\n };\n self.sorters.number = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return a[columnName] - b[columnName];\n }\n return b[columnName] - a[columnName];\n };\n };\n self.sorters.date = function (columnName, direction) {\n var asc = direction === 'asc';\n return function (a, b) {\n if (asc) {\n return new Date(a[columnName]).getTime()\n - new Date(b[columnName]).getTime();\n }\n return new Date(b[columnName]).getTime()\n - new Date(a[columnName]).getTime();\n };\n };\n };\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/publicMethods.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/intf.js b/lib/intf.js index 1eb32376..3599ca59 100644 --- a/lib/intf.js +++ b/lib/intf.js @@ -1031,9 +1031,9 @@ define([], function () { try { data = JSON.parse(data); } catch (e) { - throw new Error('Cannot parse application/json+x-canvas-datagrid formated data. ' + console.warn(Error('Cannot parse application/json+x-canvas-datagrid formated data. ' + e.message + ' \nNote: canvas-datagrid.innerHTML is for string data only. ' - + 'Use the canvas-datagrid.data property to set object data.'); + + 'Use the canvas-datagrid.data property to set object data.')); } return data; }; diff --git a/package.json b/package.json index 3988a55d..2484c441 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "canvas-datagrid", - "version": "0.22.11", + "version": "0.22.12", "description": "Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.", "main": "./dist/canvas-datagrid.js", "scripts": {