/* * * Wijmo Library 5.20171.293 * http://wijmo.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * * Licensed under the Wijmo Commercial License. * sales@wijmo.com * wijmo.com/products/wijmo-5/license/ * */ var __extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),wijmo;wijmo.culture.FlexGrid=window.wijmo.culture.FlexGrid||{groupHeaderFormat:'{name}: {value} ({count:n0} items)'},function(n){var t;(function(t){'use strict';var i,r;(function(n){n[n.None=0]="None";n[n.Column=1]="Column";n[n.Row=2]="Row";n[n.All=3]="All"})(i=t.HeadersVisibility||(t.HeadersVisibility={}));r=function(r){function u(u,f){var e=r.call(this,u,null,!0)||this,s,h,o;return e._szClient=new n.Size(0,0),e._ptScrl=new n.Point(0,0),e._cellPadding=3,e._autoGenCols=!0,e._autoClipboard=!0,e._readOnly=!1,e._indent=14,e._autoSizeMode=t.AutoSizeMode.Both,e._hdrVis=i.All,e._alSorting=!0,e._alAddNew=!1,e._alDelete=!1,e._alResizing=t.AllowResizing.Columns,e._alDragging=t.AllowDragging.Columns,e._alMerging=t.AllowMerging.None,e._ssHdr=i.None,e._shSort=!0,e._shGroups=!0,e._shAlt=!0,e._shErr=!0,e._valEdt=!0,e._deferResizing=!1,e._pSel=!0,e._pOutline=!0,e._vt=0,e.itemsSourceChanged=new n.Event,e.scrollPositionChanged=new n.Event,e.selectionChanging=new n.Event,e.selectionChanged=new n.Event,e.loadingRows=new n.Event,e.loadedRows=new n.Event,e.updatingLayout=new n.Event,e.updatedLayout=new n.Event,e.resizingColumn=new n.Event,e.resizedColumn=new n.Event,e.autoSizingColumn=new n.Event,e.autoSizedColumn=new n.Event,e.draggingColumn=new n.Event,e.draggingColumnOver=new n.Event,e.draggedColumn=new n.Event,e.resizingRow=new n.Event,e.resizedRow=new n.Event,e.autoSizingRow=new n.Event,e.autoSizedRow=new n.Event,e.draggingRow=new n.Event,e.draggingRowOver=new n.Event,e.draggedRow=new n.Event,e.groupCollapsedChanging=new n.Event,e.groupCollapsedChanged=new n.Event,e.sortingColumn=new n.Event,e.sortedColumn=new n.Event,e.beginningEdit=new n.Event,e.prepareCellForEdit=new n.Event,e.cellEditEnding=new n.Event,e.cellEditEnded=new n.Event,e.rowEditStarting=new n.Event,e.rowEditStarted=new n.Event,e.rowEditEnding=new n.Event,e.rowEditEnded=new n.Event,e.rowAdded=new n.Event,e.deletingRow=new n.Event,e.deletedRow=new n.Event,e.copying=new n.Event,e.copied=new n.Event,e.pasting=new n.Event,e.pasted=new n.Event,e.pastingCell=new n.Event,e.pastedCell=new n.Event,e.formatItem=new n.Event,e.updatingView=new n.Event,e.updatedView=new n.Event,e._mappedColumns=null,s=e.hostElement,n.isIE()&&(s.style.borderRadius='0px'),h=e.getTemplate(),e.applyTemplate('wj-control wj-flexgrid wj-content',h,{_root:'root',_eSz:'sz',_eCt:'cells',_fCt:'fcells',_eTL:'tl',_eBL:'bl',_eCHdr:'ch',_eRHdr:'rh',_eCFtr:'cf',_eTLCt:'tlcells',_eBLCt:'blcells',_eCHdrCt:'chcells',_eCFtrCt:'cfcells',_eRHdrCt:'rhcells',_eMarquee:'marquee',_eFocus:'focus'}),o=e._getDefaultRowHeight(),e.deferUpdate(function(){e._rows=new t.RowCollection(e,o);e._cols=new t.ColumnCollection(e,o*4);e._hdrRows=new t.RowCollection(e,o);e._hdrCols=new t.ColumnCollection(e,Math.round(o*1.25));e._ftrRows=new t.RowCollection(e,o);e._gpTL=new t.GridPanel(e,t.CellType.TopLeft,e._hdrRows,e._hdrCols,e._eTLCt);e._gpCHdr=new t.GridPanel(e,t.CellType.ColumnHeader,e._hdrRows,e._cols,e._eCHdrCt);e._gpRHdr=new t.GridPanel(e,t.CellType.RowHeader,e._rows,e._hdrCols,e._eRHdrCt);e._gpCells=new t.GridPanel(e,t.CellType.Cell,e._rows,e._cols,e._eCt);e._gpBL=new t.GridPanel(e,t.CellType.BottomLeft,e._ftrRows,e._hdrCols,e._eBLCt);e._gpCFtr=new t.GridPanel(e,t.CellType.ColumnFooter,e._ftrRows,e._cols,e._eCFtrCt);e._hdrRows.push(new t.Row);e._hdrCols.push(new t.Column);e._hdrCols[0].align='center';e._cf=new t.CellFactory;e._keyHdl=new t._KeyboardHandler(e);e._mouseHdl=new t._MouseHandler(e);e._edtHdl=new t._EditHandler(e);e._selHdl=new t._SelectionHandler(e);e._addHdl=new t._AddNewHandler(e);e._mrgMgr=new t.MergeManager(e);e._bndSortConverter=e._sortConverter.bind(e);e._bndScroll=e._scroll.bind(e);e.initialize(f)}),e.addEventListener(e._root,'scroll',function(){e._updateScrollPosition()&&(e.finishEditing(),e._updateContent(!0))}),e}return __extends(u,r),u.prototype._handleResize=function(){this._rcBounds=null;r.prototype._handleResize.call(this)},Object.defineProperty(u.prototype,"headersVisibility",{get:function(){return this._hdrVis},set:function(t){t!=this._hdrVis&&(this._hdrVis=n.asEnum(t,i),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"stickyHeaders",{get:function(){return this._stickyHdr},set:function(t){t!=this._stickyHdr&&(this._stickyHdr=n.asBoolean(t),this._updateStickyHeaders(),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"preserveSelectedState",{get:function(){return this._pSel},set:function(t){this._pSel=n.asBoolean(t)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"preserveOutlineState",{get:function(){return this._pOutline},set:function(t){this._pOutline=n.asBoolean(t)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"_virtualizationThreshold",{get:function(){return this._vt},set:function(t){this._vt=n.asNumber(t)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"autoGenerateColumns",{get:function(){return this._autoGenCols},set:function(t){this._autoGenCols=n.asBoolean(t)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"autoClipboard",{get:function(){return this._autoClipboard},set:function(t){this._autoClipboard=n.asBoolean(t)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"columnLayout",{get:function(){for(var c,o,r,i,f,s=u._getSerializableProperties(t.Column),l=new t.Column,h=[],e=0;e-1||u.indexOf('"')>-1)&&(u='"'+u.replace(/"/g,'""')+'"'),r+=u);return r},u.prototype.setClipString=function(i,r){var y=r==null,e,s,l,u,h,o;if(!r){r=this.selection;switch(this.selectionMode){case t.SelectionMode.Row:case t.SelectionMode.RowRange:case t.SelectionMode.ListBox:r.col=0;r.col2=this.columns.length-1}}r=n.asType(r,t.CellRange);i=n.asString(i).replace(/\r\n/g,'\n').replace(/\r/g,'\n');i&&i[i.length-1]=='\n'&&(i=i.substring(0,i.length-1));y&&!r.isSingleCell&&(i=this._expandClipString(i,r));e=new t.CellRange(r.topRow,r.leftCol);this.beginUpdate();var f=r.topRow,a=this._clipToRows(i),v=!1,c;for(s=0;s1&&n[0]=='"'&&n[r-1]=='"'&&(n=n.substr(1,r-2),n=n.replace(/""/g,'"')),t[i]=n;return t},u.prototype._expandClipString=function(n,t){var s,u,f,i,r;if(!n)return n;var h=n.split('\n'),o=h.length,e=0,c=[];for(i=0;i1&&s.length!=e)return n;e=s.length}for(u=0,f=0,i=t.topRow;i<=t.bottomRow;i++)this.rows[i].isVisible&&u++;for(r=t.leftCol;r<=t.rightCol;r++)this.columns[r].isVisible&&f++;if((u>1||f>1)&&(u==1&&(u=o),f==1&&(f=e),f%e==0&&u%o==0))for(n='',i=0;i0&&r==0&&(n+='\n'),r>0&&(n+='\t'),n+=c[i%o][r%e];return n},u.prototype.focus=function(){var u=this.hostElement,t,i;if(u){if(this.activeEditor){this.activeEditor.focus();return}if(n.getActiveElement()!=this._eFocus){if(t=u.getBoundingClientRect(),t.bottom>0&&t.right>0&&t.top-1&&v-1&&f-1&&a0&&(v=s._getDesiredHeight(c,a,f,l),h=Math.max(h,v));if(s.autoSizeMode&t.AutoSizeMode.Cells)for(f=0;f0&&(v=s._getDesiredHeight(o,a,f,l),h=Math.max(h,v));o.rows[a].height=h+e}l.parentElement.removeChild(l)})},Object.defineProperty(u.prototype,"treeIndent",{get:function(){return this._indent},set:function(t){t!=this._indent&&(this._indent=n.asNumber(t,!1,!0),this.columns.onCollectionChanged())},enumerable:!0,configurable:!0}),u.prototype.collapseGroupsToLevel=function(i){if(this.finishEditing()){var r=this.rows;r.deferUpdate(function(){for(var f,u=0;u=i)})}},Object.defineProperty(u.prototype,"selectionMode",{get:function(){return this._selHdl.selectionMode},set:function(i){i!=this.selectionMode&&(this._selHdl.selectionMode=n.asEnum(i,t.SelectionMode),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"selection",{get:function(){return this._selHdl.selection.clone()},set:function(n){this._selHdl.selection=n},enumerable:!0,configurable:!0}),u.prototype.select=function(n,t){t===void 0&&(t=!0);this._selHdl.select(n,t)},u.prototype.getSelectedState=function(n,t){return this.cells.getSelectedState(n,t,null)},Object.defineProperty(u.prototype,"selectedRows",{get:function(){var i=[],r,n;if(this.selectionMode==t.SelectionMode.ListBox)for(n=0;n-1&&n<=r.bottomRow;n++)i.push(this.rows[n]);return i},set:function(i){var r=this;n.assert(this.selectionMode==t.SelectionMode.ListBox,'This property can be set only in ListBox mode.');i=n.asArray(i);this.deferUpdate(function(){for(var u,f,n=0,t=!0;n-1,f&&t&&(t=!1,r.select(n,r.selection.col)),u.isSelected=f})},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"selectedItems",{get:function(){for(var n=this.selectedRows,t=0;t-1,f&&t&&(t=!1,r.select(n,r.selection.col)),u.isSelected=f})},enumerable:!0,configurable:!0}),u.prototype.scrollIntoView=function(t,i){var u,h;this._maxOffsetY==null&&this._updateLayout();var r=this.scrollPosition,c=this._szClient.width,f=this._szClient.height-this._gpCFtr.rows.getTotalSize(),e=this.cells._getFrozenPos();if(t=n.asInt(t),t>-1&&t=this._rows.frozen){var s=this._rows[t],a=this.cells.height>f?Math.round(s.pos/(this.cells.height-f)*100)/100:0,v=Math.round(this._maxOffsetY*a),o=s.pos-v,l=o+s.renderSize-1;l>f-r.y&&(r.y=Math.max(-o,f-l));o-e.y<-r.y&&(r.y=-(o-e.y))}return(i=n.asInt(i),i>-1&&i=this._cols.frozen&&(u=this._cols[i],h=u.pos+u.renderSize-1,h>-r.x+c&&(r.x=Math.max(-u.pos,c-h)),u.pos-e.x<-r.x&&(r.x=-(u.pos-e.x))),!r.equals(this._ptScrl))?(this.scrollPosition=r,!0):!1},u.prototype.isRangeValid=function(n){return n.isValid&&n.bottomRow123',f),u=e.scrollHeight+2,f.removeChild(e),i&&t.removeChild(i),(u<=6||isNaN(u)||!t)&&(u=28),u},u.prototype._getCollectionView=function(t){return n.asCollectionView(t)},u.prototype._getDesiredWidth=function(n,t,i,r){var u=this.getMergedRange(n,t,i),f;return this.cellFactory.updateCell(n,t,i,r,u),r.style.width='',f=r.offsetWidth,u&&u.columnSpan>1?f/u.columnSpan:f},u.prototype._getDesiredHeight=function(n,t,i,r){var u=this.getMergedRange(n,t,i),f;return this.cellFactory.updateCell(n,t,i,r,u),r.style.height='',f=r.offsetHeight,u&&u.rowSpan>1?f/u.rowSpan:f},u.prototype._getSortRowIndex=function(){return this._sortRowIndex!=null?this._sortRowIndex:this.columnHeaders.rows.length-1},u.prototype._sortConverter=function(n,t,i,r){var u,o,f,e;if(r){if(this._mappedColumns=null,this.collectionView)for(o=this.collectionView.sortDescriptions,f=0;f-1&&(u=this.columns[this._mouseHdl._htDown.col],this._mappedColumns&&u.dataMap&&(this._mappedColumns[u.binding]=u.dataMap))}return this._mappedColumns&&(e=this._mappedColumns[n.property],e&&e.sortByDisplayValues&&(i=e.getDisplayValue(i))),i},u.prototype._bindGrid=function(i){var r=this;this.deferUpdate(function(){var f,s,h,e,o,c,l,u;if(r._lastCount==0&&r._cv&&r._cv.items&&r._cv.items.length&&(i=!0),f=[],r.preserveSelectedState&&r.selectionMode==t.SelectionMode.ListBox)for(u=0;u-1)for(h=new Map,u=0;u-1&&(r.rows[u].isSelected=!0,c++);if(r.selectionMode==t.SelectionMode.ListBox&&c==0)for(l=r.selection,u=l.topRow;u<=l.bottomRow&&u>-1&&u-1){this.rows.removeAt(u);this._cvCurrentChanged(i,r);return}n.assert(!1,'removed item not found in grid.')}this._bindGrid(!1)},u.prototype._cvCurrentChanged=function(){if(this.collectionView){var i=this.selection,r=i.row>-1&&i.row-1){for(r=this.collectionView.items[n];n-1?this.rows[n]:null,i&&(i instanceof t.GroupRow||i.dataItem==null)?n:-1)}return this.selection.row},u.prototype._getCvIndex=function(n){if(n>-1&&this.collectionView){var t=this.rows[n].dataItem;for(n=Math.min(n,this.collectionView.items.length);n>-1;n--)if(this.collectionView.items[n]===t)return n}return-1},u.prototype._findRow=function(n){for(var t=0;t',this.cells.hostElement),l=getComputedStyle(h),this._cellPadding=parseInt(this.rightToLeft?l.paddingRight:l.paddingLeft),h.parentElement.removeChild(h));o=this._heightBrowser+r-e;this.rightToLeft?(n.setCss(this._eTL,{right:0,top:0,width:t,height:r}),n.setCss(this._eCHdr,{right:t,top:0,height:r}),n.setCss(this._eRHdr,{right:0,top:r,width:t}),n.setCss(this._eCt,{right:t,top:r,width:this._gpCells.width,height:this._heightBrowser}),n.setCss(this._fCt,{right:t,top:r}),n.setCss(this._eBL,{right:0,top:o,width:t,height:e}),n.setCss(this._eCFtr,{right:t,top:o,height:e})):(n.setCss(this._eTL,{left:0,top:0,width:t,height:r}),n.setCss(this._eCHdr,{left:t,top:0,height:r}),n.setCss(this._eRHdr,{left:0,top:r,width:t}),n.setCss(this._eCt,{left:t,top:r,width:this._gpCells.width,height:this._heightBrowser}),n.setCss(this._fCt,{left:t,top:r}),n.setCss(this._eBL,{left:0,top:o,width:t,height:e}),n.setCss(this._eCFtr,{left:t,top:o,height:e}));this._stickyHdr&&this._updateStickyHeaders();a=[this._eTL,this._eBL,this._eCHdr,this._eCFtr,this._eRHdr,this._eMarquee];this._useFrozenDiv()&&this.showMarquee&&(this.frozenRows||this.frozenColumns)?n.setCss(a,{zIndex:1}):n.setCss(a,{zIndex:''});var f=this._root,v=f.offsetWidth-f.clientWidth,y=f.offsetHeight-f.clientHeight;n.setCss(this._eSz,{width:t+v+this._gpCells.width,height:r+y+this._heightBrowser});c=null;this.columns._updateStarSizes(f.clientWidth-t)&&(c=f.clientWidth,n.setCss(this._eCt,{width:this._gpCells.width}));this._rcBounds=null;this._szClient=new n.Size(f.clientWidth-t,f.clientHeight-r);this._updateScrollHandler();this._updateContent(!1);v=f.offsetWidth-f.clientWidth;y=f.offsetHeight-f.clientHeight;n.setCss(this._eSz,{width:t+v+this._gpCells.width,height:r+y+this._heightBrowser});this._szClient=new n.Size(f.clientWidth-t,f.clientHeight-r);c&&c!=f.clientWidth&&this.columns._updateStarSizes(f.clientWidth-t)&&(n.setCss(this._eCt,{width:this._gpCells.width}),this._updateContent(!1));n.setCss([this._eCHdr,this._eCFtr,this._fCt],{width:this._szClient.width});n.setCss([this._eRHdr,this._fCt],{height:this._szClient.height});e&&(o=Math.min(o,this._szClient.height+r-e),n.setCss([this._eBL,this._eCFtr],{top:o}));this.onUpdatedLayout(p)}},u.prototype._updateStickyHeaders=function(){var r=!1,o=0,f,t,i,e;if(this._stickyHdr){for(f=0,t=null,i=this.hostElement;i;i=i.parentElement)e=i.getBoundingClientRect(),t==null&&(t=e.top),f=Math.max(f,e.top);t=Math.max(0,f-t-1);o=-t;r=t>0}this._eTL.style.top=this._eCHdr.style.top=r?-o+'px':'';n.toggleClass(this._eTL,u._WJS_STICKY,r);n.toggleClass(this._eCHdr,u._WJS_STICKY,r)},u.prototype._updateScrollHandler=function(){var n=this._stickyHdr||this._clipToScreen();n!=this._scrollHandlerAttached&&(this._scrollHandlerAttached=n,n?this.addEventListener(window,'scroll',this._bndScroll,!0):this.removeEventListener(window,'scroll',this._bndScroll,!0))},u.prototype._clipToScreen=function(){var n=this.hostElement;return this.rows.length>u._MIN_VIRT_ROWS&&n.parentElement==document.body&&n.clientHeight==n.scrollHeight},u.prototype._scroll=function(t){var i=this;n.contains(t.target,this.hostElement)&&(this._clipToScreen()&&(this._afScrl&&cancelAnimationFrame(this._afScrl),this._afScrl=requestAnimationFrame(function(){i.finishEditing();i._updateContent(!0);i._afScrl=null})),this._stickyHdr&&(this._toSticky&&cancelAnimationFrame(this._toSticky),this._toSticky=requestAnimationFrame(function(){var t=new n.CancelEventArgs;if(i.onUpdatingLayout(t)){i._updateStickyHeaders();i.onUpdatedLayout(t)}i._toSticky=null})))},u.prototype._updateScrollPosition=function(){var t=this._root,f=t.scrollTop,i=t.scrollLeft,r;return(this.rightToLeft&&u._getRtlMode()=='rev'&&(i=t.scrollWidth-t.clientWidth-i),r=new n.Point(-Math.abs(i),-f),!this._ptScrl.equals(r))?(this._ptScrl=r,this.onScrollPositionChanged(),!0):!1},u.prototype._updateContent=function(t,r){var e=this,o=this.containsFocus()?n.getActiveElement():null,h=new n.CancelEventArgs,c,s,u;if(this.onUpdatingView(h)){if(this._offsetY=0,this._heightBrowser>this._szClient.height&&(c=Math.round(-this._ptScrl.y/(this._heightBrowser-this._szClient.height)*100)/100,this._offsetY=Math.round(this._maxOffsetY*c)),this._updateScrollPosition(),this._gpCells._updateContent(t,r,this._offsetY),this._hdrVis&i.Column&&(!r||this._ssHdr&i.Column)&&this._gpCHdr._updateContent(t,r,0),this._hdrVis&i.Row&&(!r||this._ssHdr&i.Row)&&this._gpRHdr._updateContent(t,r,this._offsetY),this._hdrVis&&!r&&this._gpTL._updateContent(t,r,0),this._gpCFtr.rows.length&&(this._gpBL._updateContent(t,r,0),this._gpCFtr._updateContent(t,r,0)),this.showMarquee)if(s=this._selHdl._sel,u=this._eMarquee,this.isRangeValid(s)){var f=this._getMarqueeRect(s),l=u.firstChild,a=u.offsetWidth-l.offsetWidth,v=u.offsetHeight-l.offsetHeight;n.setCss(u,{left:f.left+this.cells.hostElement.offsetLeft-a/2,top:f.top+this.cells.hostElement.offsetTop-v/2,width:f.width+a,height:f.height+v,visibility:f.width>0&&f.height>0?'':'collapse'})}else n.setCss(u,{left:0,top:0,width:0,height:0,visibility:'collapse'});this._updateFrozenCells(r);this._rcBounds=null;this.onUpdatedView(h);!r&&o&&setTimeout(function(){var t=e.hostElement;t&&(!e.activeEditor&&n.contains(t,o)&&o!=n.getActiveElement()&&o!=e._root&&o.focus(),e.containsFocus()||e.focus())})}},u.prototype._useFrozenDiv=function(){return n.isIE()||n.isFirefox()||n.isMobile()},u.prototype._updateFrozenCells=function(t){var r,i,u;if(this._useFrozenDiv())if(r=this._eCt.querySelectorAll('.wj-frozen'),this.frozenRows||this.frozenColumns){if(t&&this._fCt.children.length==r.length){for(i=0;i=o&&r.top=o&&f.bottom=e&&r.right>u.left&&(r.left=u.left-r.width),i.rightCol>=e&&f.left>u.left&&(f.left=u.left)):(i.leftCol>=e&&r.left=e&&f.right0&&this.showGroups)for(t=0;t0}return!1},u.prototype._wantsInput=function(n){return!this.activeEditor&&this._isInputElement(n)&&!n.getAttribute('wj-part')},u._getMaxSupportedCssHeight=function(){var n;if(!u._maxCssHeight){var i=1e6,t=document.createElement('div');for(t.style.visibility='hidden',document.body.appendChild(t),n=i;n<=6e7;n+=5e5){if(t.style.height=n+'px',t.offsetHeight!=n)break;i=n}document.body.removeChild(t);u._maxCssHeight=i}return u._maxCssHeight},u._getRtlMode=function(){var t,i,r;return u._rtlMode||(t=n.createElement('
<\/div><\/div>'),document.body.appendChild(t),i=t.scrollLeft,t.scrollLeft=-1e3,r=t.scrollLeft,document.body.removeChild(t),u._rtlMode=r<0?'neg':i>0?'rev':'std'),u._rtlMode},u}(n.Control);r._WJS_STICKY='wj-state-sticky';r._WJS_MEASURE='wj-state-measuring';r._MIN_VIRT_ROWS=200;r.controlTemplate='
<\/div>
<\/div>