js-pkg
Version:
Npm package of Syncfusion.JavaScript.
10 lines • 1.28 MB
JavaScript
/*!
* filename: ej.spreadsheet.min.js
* version : 15.3.0.33
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
(function(n){typeof define=="function"&&define.amd?define(["jsrender","jquery-validation","./../common/ej.core.min","./../common/ej.data.min","./ej.grid.min","./../common/ej.scroller.min","./../common/ej.globalize.min","./ej.calculate.min","./ej.waitingpopup.min","./../datavisualization/ej.chart.min","./ej.dialog.min","./ej.tab.min","./ej.button.min","./ej.splitbutton.min","./ej.togglebutton.min","./ej.checkbox.min","./ej.radiobutton.min","./ej.autocomplete.min","./ej.datepicker.min","./ej.dropdownlist.min","./ej.listbox.min","./ej.editor.min","./ej.pager.min","./ej.menu.min","./ej.treeview.min","./ej.uploadbox.min","./ej.colorpicker.min","./ej.excelfilter.min","./ej.ribbon.min","./ej.pivotschemadesigner.min","./ej.pivotgrid.min"],n):n()})(function(){(function(n,t,i){t.widget("ejSpreadsheet","ej.Spreadsheet",{_rootCSS:"e-spreadsheet",element:null,_excelFilter:null,validTags:["div"],model:null,_requiresID:!0,defaults:{allowFreezing:!0,enableContextMenu:!0,allowEditing:!0,allowResizing:!0,allowMerging:!0,allowWrap:!0,allowUndoRedo:!0,allowClipboard:!0,allowDataValidation:!0,allowConditionalFormats:!0,allowSearching:!0,allowKeyboardNavigation:!0,allowAutoFill:!0,allowSelection:!0,allowSorting:!0,allowDragAndDrop:!0,allowCellType:!0,allowAutoCellType:!1,allowCharts:!0,enablePersistence:!1,allowCellFormatting:!0,allowFormulaBar:!0,showRibbon:!0,showPager:!0,allowComments:!0,allowFiltering:!0,allowInsert:!0,allowDelete:!0,allowFormatPainter:!0,allowHyperlink:!0,allowImport:!0,allowFormatAsTable:!0,allowAutoSum:!0,enablePivotTable:!1,allowLockCell:!0,enableTouch:!0,allowOverflow:!0,allowClear:!0,isReadOnly:!1,columnCount:21,rowCount:20,rowHeight:20,columnWidth:64,sheetCount:1,undoRedoStep:20,activeSheetIndex:1,apWidth:300,activationPanelWidth:300,_isActPanelVisible:!1,cssClass:"",userName:"",locale:"en-US",pageSize:"A4",sheets:[],nameManager:[],customFormulas:[],currentViewData:null,query:null,create:null,actionBegin:null,actionComplete:null,beforeCellFormat:null,cellFormatting:null,beforeOpen:null,beforeDrop:null,drop:null,cellEdit:null,pagerClick:null,cellClick:null,_pivotPrint:null,tabClick:null,tabSelect:null,_createPivotTable:null,beforePanelOpen:null,load:null,loadComplete:null,editRangeBegin:null,editRangeComplete:null,cellHover:null,menuClick:null,contextMenuClick:null,ribbonClick:null,dragStart:null,drag:null,cellSave:null,beforeCellSelect:null,cellSelected:null,autoFillBegin:null,autoFillComplete:null,openFailure:null,onImport:null,onExport:null,beforeImport:null,beforeBatchSave:null,keyUp:null,keyDown:null,dragShape:null,resizeStart:null,resizeEnd:null,refresh:null,beforeEditComment:null,beforeTabClick:null,scrollStop:null,scrollSettings:{width:"100%",height:"100%",allowScrolling:!0,scrollMode:"infinite",isResponsive:!0,allowVirtualScrolling:!0,allowSheetOnDemand:!1},pageSettings:{pageCount:10,currentPage:1,pagerHeight:26},exportSettings:{allowExporting:!0,excelUrl:null,csvUrl:null,pdfUrl:null,password:null},pictureSettings:{allowPictures:!0,height:220,width:440},selectionSettings:{selectionType:"default",selectionUnit:"multirange",enableAnimation:!1,animationType:"linear",animationTime:.001,activeCell:""},chartSettings:{height:220,width:440},formatSettings:{allowFontFamily:!0,allowDecimalPlaces:!0,allowCellBorder:!0},autoFillSettings:{fillType:"fillseries",showFillOptions:!0},importSettings:{importMapper:"",importUrl:"",password:"",allowSheetOnDemand:!1,importOnLoad:!1},printSettings:{allowPageSetup:!0,allowPageSize:!1,allowPrinting:!0},ribbonSettings:{enableOnDemand:!1,applicationTab:{type:t.Ribbon.ApplicationTabType.Backstage,menuSettings:{isAppend:!1,dataSource:[]}}}},dataTypes:{pageSize:"enum",sheets:"array",nameManager:"array",scrollSettings:{scrollMode:"enum"},selectionSettings:{selectionType:"enum",selectionUnit:"enum",animationType:"enum"},autoFillSettings:{fillType:"enum"}},_dataSource:function(n){return this.getSheet(n).dataSource},getSheet:function(n){return this.model.sheets[this._getSheetIndex(n)]},getSheets:function(){return this.model.sheets},getSheetElement:function(n){return this.element.find("#"+this._id+"_"+this.getSheet(n).sheetInfo.value)},getDataSettings:function(n){var i,r=[],t=this.getSheet(n),u=t.rangeSettings.length;if(u)while(u--)i=t.rangeSettings[u],i.dataSource&&r.push(i);return r.length?r:t.dataSource?[t]:null},_getJSSheetHeader:function(n){return this._sheets[n]._sheetHeader},_setJSSheetHeader:function(n,t){this._sheets[t]._sheetHeader=n},_getInputBox:function(){return this._inputBox},_setInputBox:function(n){this._inputBox=n},_getIndexBox:function(){return this._indexBox},_setIndexBox:function(n){this._indexBox=n},_getJSSheetRowHeader:function(n){return this._sheets[n]._sheetRowHeader},_setJSSheetRowHeader:function(n,t){this._sheets[t]._sheetRowHeader=n},_getJSSheetRowHeaderContent:function(n){return this._sheets[n]._sheetRowHeaderContent},_setJSSheetRowHeaderContent:function(n,t){this._sheets[t]._sheetRowHeaderContent=n},_getJSSheetContent:function(n){return this._sheets[n]._sheetContent},_setJSSheetContent:function(n,t){this._sheets[t]._sheetContent=n},_getContent:function(n){return this._sheets[n]._content},_setContent:function(n,t){this._sheets[t]._content=n},getPager:function(){return this._spreadSheetPager},setPager:function(n){this._spreadSheetPager=n},getFooter:function(){return this._footer},setFooter:function(n){this._footer=n},getMainPanel:function(){return this._mainPanel},setMainPanel:function(n){this._mainPanel=n},getGroupPanel:function(){return this._groupPanel},setGroupPanel:function(n){this._groupPanel=n},getActivationPanel:function(){return this._activationPanel},setActivationPanel:function(n){this._activationPanel=n},getActiveSheetIndex:function(){return this.model.activeSheetIndex},setActiveSheetIndex:function(n){this.model.activeSheetIndex=n},getRows:function(n){return this._sheets[n]._Rows},setRows:function(n,t){this._sheets[t]._Rows=n},getFrozenRows:function(n){return this.getSheet(this._getSheetIndex(n)).frozenRows},setFrozenRows:function(n,t){this.model.isReadOnly||(this.getSheet(this._getSheetIndex(t)).frozenRows=n)},getFrozenColumns:function(n){return this.getSheet(n).frozenColumns},setFrozenColumns:function(n,t){this.model.isReadOnly||(this.getSheet(t).frozenColumns=n)},setFocusTopElem:function(n){this._focusTopElem=n},getFocusTopElem:function(){return this._focusTopElem},setFocusRightElem:function(n){this._focusRightElem=n},getFocusRightElem:function(){return this._focusRightElem},setFocusBottomElem:function(n){this._focusBottomElem=n},getFocusBottomElem:function(){return this._focusBottomElem},setFocusLeftElem:function(n){this._focusLeftElem=n},getFocusLeftElem:function(){return this._focusLeftElem},setAutoFillElem:function(n){this._autoFillElem=n},getAutoFillElem:function(){return this._autoFillElem},_setAutoFillOptElem:function(n){this._autoFillOptElem=n},_getAutoFillOptElem:function(){return this._autoFillOptElem},_getColWidth:function(n,t){return this.getSheet(t).columnsWidthCollection[n]},_getRowHeight:function(n,t){return this.getSheet(t).rowsHeightCollection[n]},setActiveCell:function(n,i,r){var f=this.getSheet(r?r:this.getActiveSheetIndex()),u;typeof n=="string"&&(u=this.getRangeIndices(n),n=u[0],i=u[1]);f._activeCell=t.isNullOrUndefined(n)&&t.isNullOrUndefined(i)?f._startCell:{rowIndex:n,colIndex:i}},getActiveCell:function(n){return this.getSheet(this._getSheetIndex(n))._activeCell},_setFormulaSuggElem:function(n){this._formulaSuggElem=n},_getFormulaSuggElem:function(){return this._formulaSuggElem},_setRowHdrTBody:function(n,t){this._sheets[t]._rowHdrTBody=n},_getRowHdrTBody:function(n){return this._sheets[n]._rowHdrTBody},_setContTBody:function(n,t){this._sheets[t]._contTBody=n},_getContTBody:function(n){return this._sheets[n]._contTBody},_init:function(){var n=this.model.importSettings,t;this._initBegin();this.model.allowImport&&(n.importUrl.length||n.importOnLoad)?this["import"]({url:n.importUrl,password:n.password,allowSheetOnDemand:n.allowSheetOnDemand}):(this.showWaitingPopUp(),this._initBase(),this._initComplete());this._isAutoWHMode&&(t=this._getElementDimension(),this.element.css({height:t.height,width:t.width}));this.addClass(this.element,this.model.cssClass);this._cssClass=this.model.cssClass},_initBegin:function(){var r="touch-action",i=this.model.scrollSettings,f=i.width,e=i.height,u;t.support.stableSort=!1;this._isInitLoad=!0;this._isAutoWHMode=!i.allowScrolling;this._isAutoWHMode&&(i.isResponsive=!1,i.scrollMode="normal",i.allowVirtualScrolling=!1);this._minWidth=280;this._minHeight=200;this._isAutoWHMode||this.element.css({"min-height":this._minHeight,"min-width":this._minWidth,height:i.height,width:i.width});this._updateResponsiveSettings();this._isAutoWHMode||i.isResponsive||(i.width.toString().indexOf("%")>-1&&(i.width=this._responsiveWidth),i.height.toString().indexOf("%")>-1&&(i.height=this._responsiveHeight),this.element.css({height:i.height,width:i.width}));this._browserDetails=t.browserInfo();this.localizedLabels=t.getLocalizedConstants(this.sfType,this.model.locale);this.element.attr("tabindex",0);this._browserDetails.name==="msie"&&(r="-ms-"+r);this.element.css(r,"double-tap-zoom pinch-zoom");u=t.buildTag("div#"+this._id+"_wait","",{position:"absolute"});n(document.body).append(u);u.ejWaitingPopup({showOnInit:!1,target:this.element})},_initBase:function(){this._refreshModel(this.isImport?this._impData.model:null);this._initProps();this._initCSSTag();this._initLayout();this._wireEvents("_on");this._isInitLoad=!1},_initProps:function(){var r=this.model,i=t.spreadsheetFeatures;this.XLClipboard=new i.clipboard(this);this.XLEdit=new i.editing(this);this.XLPrint=new i.print(this);this.XLRibbon=new i.ribbon(this);this.XLScroll=new i.scroller(this);r.allowDragAndDrop&&(this.XLDragDrop=new i.dragAndDrop(this));r.allowKeyboardNavigation&&(this.XLCellNav=new i.cellNavigation(this));r.allowFiltering&&(this.XLFilter=new i.filter(this));r.allowAutoFill&&(this.XLDragFill=new i.dragFill(this));(r.allowCellFormatting||r.allowFormatAsTable||r.allowFormatPainter)&&(this.XLFormat=new i.cellFormatting(this));r.allowCellFormatting&&(this.XLCellFrmtDlg=new i.formatCellDialog(this));r.allowConditionalFormats&&(this.XLCFormat=new i.cFormat(this));r.allowSearching&&(this.XLSearch=new i.findnreplace(this));r.allowCharts&&(this.XLChart=new i.chart(this));r.exportSettings.allowExporting&&(this.XLExport=new i.exporting(this));r.allowSorting&&(this.XLSort=new i.sorting(this));r.allowFreezing&&(this.XLFreeze=new i.freezepane(this));r.allowComments&&(this.XLComment=new i.comments(this));r.allowSelection&&(this.XLSelection=new i.selection(this));(r.allowCharts||r.pictureSettings.allowPictures)&&(this.XLShape=new i.shape(this));r.allowResizing&&(this.XLResize=new i.resizing(this));r.enableContextMenu&&(this.XLCMenu=new i.contextmenu(this));r.allowDataValidation&&(this.XLValidate=new i.validation(this));r.allowCellType&&(this.XLCellType=new i.cellType(this));r.enablePivotTable&&(this.XLPivot=new i.pivot(this));i.math&&n.extend(t.Spreadsheet.prototype,i.math);this._initPvtProps();this._initFATProps();this.model.customFormulas.length&&this._updateCustomFormulas(this.model.customFormulas,"add");this.model.nameManager.length&&this._refreshNameMngr(this.model.nameManager)},_initPvtProps:function(){var u=1,i={rowIndex:0,colIndex:0},r=this._getLocStr("AutoFillOptions").split("/"),e=this.getActiveSheetIndex(),f=t.preferredCulture(this.model.locale).numberFormat;for(this._dataContainer=this.isImport?n.extend(!0,{},this._impData.dataContainer):{sheets:{},sheetCellType:{},hashCode:[],sharedData:[],cellType:[],valData:[],cFormatData:[]},this._newSIndex=1,this.isImport=this.isImport||!1,this.mergeCenter=!1,this.isDirty=!1,this._calcID=CalcEngine.createSheetFamilyID(),this._calcEngine=new CalcEngine(this,this._calcID),this._calcEngine.setUseDependencies(!0),this._calcEngine.setExcelLikeComputations(!0),this._calcEngine.setUseDatesInCalculations(!0),this._calcEngine.setEnableFormulaErrorValidation(!0),this._calcEngine.setCalculatingSuspended(n("#"+this._id+"_CalcManual").find("span").hasClass("e-ss-calcauto")),this._sheets=[],this._cellProp=["value","value2","type","cFormatRule","range","thousandSeparator","rule","format","border","picture","chart","calcValue","align","hyperlink","formats","borders","tformats","tborders","isFilterHeader","filterState","tableName","comment","formatStr","decimalPlaces","cellType","isFilterHighlight","pivot"],this.isImport||(this.model.sheets.splice(0,0,{}),this._updateCellType());u<=this.model.sheetCount;)this.isImport||(this._dataContainer.sheets[u]={}),this._sheetSettings(u),this._newSIndex++,u++;this._detachTable=null;this._isPrint=!1;this._isSheetInsert=!1;this._isSheetRename=!1;this._isTableRename=!1;this._tableClassName=null;this._isSheetNavigate=!1;this._sheetCopy={isSheetCopy:!1,sheetContent:null};this._alertDialog={element:null,action:null};this._dataManager=null;this._isUndo=!1;this._undoCollection=[];this._redoCollection=[];this._ctrlKeyCount=0;this._formulaRange=[];this._formulaHeight=36;this._isSort=!1;this._isPaste=!1;this._isFATResize=!1;this._isDisplayHeader=!1;this._currencySymbol=f.currency.symbol||"$";this._percentSymbol=f.percent.symbol||"%";this._decimalSeparator=f["."]||".";this.operators={"<":function(n,t){return n<t},">":function(n,t){return n>t},">=":function(n,t){return n>=t},"<=":function(n,t){return n<=t},"==":function(n,t){return n===t},"!=":function(n,t){return n!==t},"!":function(n){return!n},"=":function(n){return n}};this.parse={parseInt:function(n){return parseInt(n)},parseFloat:function(n){return parseFloat(n)},parseDate:function(n){return new Date(n).getTime()},parseTime:function(n){return new Date("01/01/1990 "+n).getTime()},length:function(n){return n.charAt(0)==="^"?parseInt(n.split("^")[1]):n.length}};this._selMergeCells=[];this._mergeType="merge-cells";this._delCells=[];this._deletedText=[];this._removeMergeColl=[];this._insData={};this._deletedDimension=[];this._insDelStatus="";this._isUndoRedo=!1;this._indexBox=null;this._inputBox=null;this._focusTopElem=null;this._focusRightElem=null;this._focusBottomElem=null;this._focusLeftElem=null;this._dStartCell=i;this._dEndCell=i;this._pStartCell=i;this._pEndCell=i;this._pFillCell=i;this._borderFocus=["e-focusright","e-focusbottom"];this._cutFocus=["e-cutright","e-cutbottom"];this._autoFillFocus=["e-autofillright","e-autofillbottom"];this._formulaBorder=[["e-bborderright","e-bborderbottom"],["e-rborderright","e-rborderbottom"],["e-vborderright","e-vborderbottom"],["e-gborderright","e-gborderbottom"],["e-pborderright","e-pborderbottom"],["e-oborderright","e-oborderbottom"]];this._ctrlFormulaBorder=[["e-bctrlborderright","e-bctrlborderbottom"],["e-rctrlborderright","e-rctrlborderbottom"],["e-vctrlborderright","e-vctrlborderbottom"],["e-gctrlborderright","e-gctrlborderbottom"],["e-pctrlborderright","e-pctrlborderbottom"],["e-octrlborderright","e-octrlborderbottom"]];this._borderTypes=[{id:"bottomborder",text:this._getLocStr("BottomBorder"),parentId:null,sprite:"e-icon e-ss-bottomborder"},{id:"topborder",text:this._getLocStr("TopBorder"),parentId:null,sprite:"e-icon e-ss-topborder"},{id:"leftborder",text:this._getLocStr("LeftBorder"),parentId:null,sprite:"e-icon e-ss-leftborder"},{id:"rightborder",text:this._getLocStr("RightBorder"),parentId:null,sprite:"e-icon e-ss-rightborder"},{id:"noborder",text:this._getLocStr("NoBorder"),parentId:null,sprite:"e-icon e-ss-noborder"},{id:"allborder",text:this._getLocStr("AllBorder"),parentId:null,sprite:"e-icon e-ss-allborder"}];this._datePattern=["year","month","day","hours","minutes","seconds"];this._styleColl={};this._borderStyle="solid";this._borderColor="#000000";this._borderStyles=["solid","dashed","dotted"];this._ddlCell=null;this._cOpt={};this._shapeChange=!1;this._dupDetails=!1;this._paste=!1;this._autoFillElem=null;this._autoFillOptElem=null;this._fillOptionMenuData=[{id:"copycells",text:r[0],parentId:null,sprite:"e-icon e-ss-fillselect"},{id:"fillseries",text:r[1],parentId:null,sprite:"e-icon e-ss-filloption"},{id:"fillformattingonly",text:r[2],parentId:null,sprite:"e-icon e-ss-filloption"},{id:"fillwithoutformatting",text:r[3],parentId:null,sprite:"e-icon e-ss-filloption"},{id:"flashfill",text:r[4],parentId:null,sprite:"e-icon e-ss-filloption"}];this._formulaSuggElem=null;this._isFormulaSuggestion=!1;this._shiftKeyEnabled=!1;this._preventctrlkey=!1;this._rAlign="e-ralign";this._cAlign="e-calign";this._chartBorder=[["e-rcbright","e-rcbbottom"],["e-vcbright","e-vcbbottom"],["e-bcbright","e-bcbbottom"]];this._selectionBorder=["e-selecttop","e-selectright","e-selectbottom","e-selectleft"];this._autofillBorder=["e-autofilltop","e-autofillright","e-autofillbottom","e-autofillleft"];this._thinBorder=["e-thinright","e-thinbottom"];this._rcRegx=new RegExp("\\be-rc.*\\b","g");this._formatRegx=new RegExp("\\be-format.*?\\b","g");this._borderRegx=new RegExp("\\be-border.*?\\b","g");this._formulaChanged=[];this._ref=[];this._prevText="";this._prevVal="";this._dlgHLClick=!1;this._selectDataval={};this._undoInputobj={};this._cureditedCell="";this._colHeaderHeight=22;this._rowHeaderWidth=30;this._scrollerHeight=18;this._scrollerWidth=18;this._bufferCnt=5;this._maxRowCnt=1048576;this._maxColCnt=16384;this._impData=this._impData||null;this._isNew=!1;this._isSheetReq=!1;this._intrnlReq=!1;this._isFilterApplied=!1;this._commentCount=0;this._tableCnt=1;this._uploadImage=!1;this._responsiveWidth=0;this._responsiveHeight=0;this._celltypes=[];this._reqCnt=0;this._resCnt=0;this._pageClickArgs=null;this._gotoPageArgs=null;this._updateFormulaCollection();this._isRibbonClick=!1;this._intrnlUpdate=!1;this._isPvtNameEdit=!1;this._hlColor="#428bca";this._isFilter=!1;this._isShowHide=!1;this._insRows={};this._isTotalRow=!1;this._scrollReverse=!1;this._phoneMode=this.model.scrollSettings.isResponsive&&document.documentElement.clientWidth<420;this._tabMode=this.model.scrollSettings.isResponsive&&document.documentElement.clientWidth>419&&document.documentElement.clientWidth<617;this._dlgHeight=this._responsiveHeight-2;this._dlgWidth=this._responsiveWidth-2;this._isTouchEvt=!1;this._isTouchMoveSel=!1;this._isTouchScroll=!1;this._isScrolling=!1;this._startXY=null;this._touchArgs=null;this._isResized=!1;this._isRibbonDestroyed=!1;this._resizeColl=[];this._delWrapColl={};this._isInsdel=!1;this._canOverflow=!0;this.preventFilterPopup=!1;this._FATStyles={};this._isFiltered=!1;this._dautoFillCell={rowIndex:0,colIndex:0};this._isPublic=!1;this._fRow={rowAdj:!0,fRowCnt:0};this._fCol={colAdj:!0,fColCnt:0};this.isPasteValuesOnly=!1;this._isSaveAsJSON=!1;this._cssClass="";this._hideRowColl=[];this._isSort=!1;this._isKeyCtrlShftF2=!1},_initFATProps:function(){var o,g,t="w:bold",i="c:#FFFFFF",n="c:#000000",l="c:#2F75B5",a="c:#ED7D31",v="c:#FFC000",r="1px solid #000000",u="1px solid #2f75b5",f="1px solid #ED7D31",e="1px solid #FFC000",y="b:#D9D9D9",s="b:#DDEBF7",p="b:#FCE4D6",w="b:#FFF2CC",nt="b:#000000",tt="b:#FFE2C6",it="b:#FFF1BF",h="b:#000000",rt="b:#D7D7D7",b="b:#FFC000",k="b:#5B9BD5",ut="b:#Ed7D31",d="hl?"+t+";"+n+";bo:tb-"+r+"&cl?"+y+";"+n+","+n+"&cb?b-"+r+"/hl?"+t+";bo:tb-"+u+";"+l+"&cl?"+s+";"+l+","+l+"&cb?b-"+u+"/hl?"+t+";bo:tb-"+f+";"+a+"&cl?"+p+";"+a+","+a+"&cb?b-"+f+"/hl?"+t+";bo:tb-"+e+";"+v+"&cl?"+w+";"+v+","+v+"&cb?b-"+e+"/hl?"+t+";"+nt+";"+i+";bo:o-"+r+"&cl?bo:t-"+r+";"+n+"&cb?o-"+r+"/hl?bo:o-"+u+";"+t+";"+k+";"+i+"&cl?bo:t-"+u+";"+n+"&cb?o-"+u+"/hl?"+t+";b:#EB7E2F;"+i+";bo:o-"+f+"&cl?bo:t-"+f+";"+n+"&cb?o-"+f+"/hl?"+t+";"+b+";"+i+";bo:o-"+e+"&cl?bo:t-"+e+";"+n+"&cb?o-"+e+"/hl?"+t+";bo:gb-"+r+";"+n+"&cl?"+y+";"+n+","+n+"&cb?gb-"+r+"/hl?"+t+";bo:gb-"+u+";"+n+"&cl?"+s+";"+n+","+n+"&cb?gb-"+u+"/hl?"+t+";bo:gb-"+f+";"+n+"&cl?"+p+";"+n+","+n+"&cb?gb-"+f+"/hl?"+t+";bo:gb-"+e+";"+n+"&cl?"+w+";"+n+","+n+"&cb?gb-"+e+"/hl?"+t+";"+nt+";"+i+"&cl?b:#A6A6A6;"+n+","+y+";"+n+"/hl?"+t+";"+k+";"+i+"&cl?b:#BDD7EE;"+n+","+s+";"+n+"/hl?"+t+";"+ut+";"+i+"&cl?b:#F8CBAD;"+n+","+p+";"+n+"/hl?"+t+";"+b+";"+i+"&cl?b:#FFE699;"+n+","+w+";"+n+"/hl?"+t+";"+rt+";"+n+";bo:gb-"+r+"&cl?b:#A7A7A7;"+n+","+rt+";"+n+"&cb?gb-"+r+"/hl?"+t+";b:#DBECF6;"+n+";bo:gb-"+u+"&cl?b:#BED8F1;"+n+","+s+";"+n+"&cb?gb-"+u+"/hl?"+t+";"+tt+";"+n+";bo:gb-"+f+"&cl?b:#F6CAAD;"+n+","+tt+";"+n+"&cb?gb-"+f+"/hl?"+t+";"+it+";"+n+";bo:gb-"+e+"&cl?b:#FDE18D;"+n+","+it+";"+n+"&cb?gb-"+e+"/hl?"+t+";"+h+";"+i+"&cl?b:#404040;"+i+",b:#737373;"+i+"/hl?"+t+";"+h+";"+i+"&cl?b:#2F75B5;"+i+","+k+";"+i+"/hl?"+t+";"+h+";"+i+"&cl?b:#C65911;"+i+","+ut+";"+i+"/hl?"+t+";"+h+";"+i+"&cl?b:#BF8F00;"+i+","+b+";"+i,c=["Light1","Light2","Light3","Light5","Light8","Light9","Light10","Light12","Light15","Light16","Light17","Light19","Medium8","Medium9","Medium10","Medium12","Medium22","Medium23","Medium24","Medium26","Dark1","Dark2","Dark3","Dark5"];for(d=d.split("/"),o=0,g=c.length;o<g;)this._FATStyles["TableStyle"+c[o]]={format:this.XLRibbon._getFormatAsTableInput(d[o]),formatName:"TableStyle"+c[o]},o++;this.XLFormat._formatAsTableStyle=this._FATStyles["TableStyle"+c[0]]},_updateResponsiveSettings:function(){var i=t.browserInfo().name==="msie"&&t.browserInfo().version==="8.0",n=this.element[0].getClientRects()[0];this._responsiveHeight=Math.floor(i?this.element[0].offsetHeight:n?n.height:0);this._responsiveWidth=Math.floor(i?this.element[0].offsetWidth:n?n.width:0)},_getElementDimension:function(){var f=0,t,e=0,o=0,i,r,u;return this.model.showRibbon&&(i=n("#"+this._id+"_Ribbon").data("ejRibbon"),t=i.element[0].offsetWidth,f=i.element[0].offsetHeight),this.model.allowFormulaBar&&(r=n("#"+this._id+"_formulabar")[0],e=r.offsetHeight,t||(t=r.offsetWidth)),u=this.element.find(".e-spreadsheetmainpanel")[0],o=u.offsetHeight,t||(t=u.offsetWidth),{width:t+2,height:f+e+o+1}},_sheetSettings:function(i){var o,f,u,s,c,r,a,e,l,h;if(this._isSheetReq?f=this.getSheet(i):(r=this.getSheet(i),c=this._generateSheetName(this._newSIndex),f=this.model.sheets[i]={colCount:r&&r.colCount||this.model.columnCount,rowCount:r&&r.rowCount||this.model.rowCount,_formulaCollection:{},columnsWidthCollection:[],_colWidthCollection:[],_ofColWidthColl:[],rowsHeightCollection:[],_rowHeightCollection:[],_rowIdxColl:[],_spreadSheetPager:null,showHeadings:r&&!this.isUndefined(r.showHeadings)?r.showHeadings:!0,showGridlines:r&&!this.isUndefined(r.showGridlines)?r.showGridlines:!0,dataSource:r&&r.dataSource||null,_jsonData:r?r.dataSource instanceof t.DataManager?null:r.dataSource:null,_dataManager:r&&r.dataSource instanceof t.DataManager?r.dataSource:null,query:r&&r.query||null,primaryKey:r&&r.primaryKey||"",startCell:r&&r.startCell||"A1",topLeftCell:r&&r.topLeftCell||"A1",fieldAsColumnHeader:r&&r.fieldAsColumnHeader||!1,showHeader:r&&r.showHeader===!1?!1:!0,headerStyles:r&&r.headerStyles||null,batchChanges:{added:[],changed:[],deleted:[]},range:[0,0,0,0],fields:[],_isDataManager:!1,_isOffline:!1,_hasDataSrc:!1,columns:r&&r.columns||[],_columnStyles:{},_rowStyles:{},cellTypes:r&&r.cellTypes||[],rows:r&&r.rows||null,_excelFilter:null,filterSettings:{filteredColumns:[],maxFilterChoices:1e3,filteredRange:[],range:"",tableRange:[]},frozenRows:r&&r.frozenRows||0,frozenColumns:r&&r.frozenColumns||0,_frozenRows:r&&r.frozenRows&&r.frozenRows+1||1,_frozenColumns:r&&r.frozenColumns&&r.frozenColumns+1||1,_fHMergeRows:[],_fHMergeCols:[],paneTopLeftCell:r&&r.paneTopLeftCell||"A1",_selectedRange:{},_selectedCellColors:[],columnWidth:r&&r.columnWidth||this.model.columnWidth,rowHeight:this.model.rowHeight,_frozenHeight:0,_frozenWidth:0,_firstRow:{idx:0,value:0},_firstCol:{idx:0,value:0},_topRow:{idx:0,value:0},_bottomRow:{idx:0,value:0},_leftCol:{idx:0,value:0},_rightCol:{idx:0,value:0},_filterColl:{},_filteredColumns:[],_commentColl:{},_mergeColl:{},_unmergeColl:{},_delmergeColl:{},_hideMergeColl:{},_clrMergeColl:[],_clrWrapColl:[],_selectedCells:[],selectedRange:[0,0,0,0],tableManager:{},_header:{},_selectedCellIndexes:[],_startCell:{rowIndex:0,colIndex:0},_endCell:{rowIndex:0,colIndex:0},_activeCell:{rowIndex:0,colIndex:0},_autoFillCell:{rowIndex:0,colIndex:0},rangeSettings:r&&r.rangeSettings||[],sheetInfo:{text:c,value:this._getLocStr("Sheet")+this._newSIndex,isVisible:!0},_multipleFiltering:!1,_multifilterIdx:[],_filteredByColor:"",staticWidth:0,_fRow:0,_fCol:0,hideColsCollection:{},hideRowsCollection:r&&r.hideRowsCollection||[],_hiddenFreezeRows:[],_hiddenFreezeCols:[],_filterHRowsColl:[],_restrictedHeightRows:[],filteredRowsCollection:[],_rHeightCollection:[],_frHiddenHeight:0,_fpHiddenHeight:0,_fpHiddenWidth:0,_pTarget:{},_cSpan:1,_rSpan:1,usedRange:{rowIndex:0,colIndex:0},mergedCells:[],shapeMngr:{picture:{},chart:{},sharedPics:[]},pivotMngr:{pivot:{}},_nmValue:{},_nmEdit:!1,_wrapHtCollection:{},_isChartBorderDrawn:!1,_virtualBlockCnt:0,_virtualBlockRowCnt:0,_virtualContBlockIdx:1,_virtualTopTBodyHgt:0,_virtualBottomTBodyHgt:0,_virtualTBodyHgt:0,_scrollTop:0,_scrollLeft:0,_virtualRowIdx:[],_virtualTopTBodyOffset:{top:0,bottom:0},_virtualContTBodyOffset:{top:0,bottom:0},_virtualBottomTBodyOffset:{top:0,bottom:0},_virtualDataLoadedBlks:[],_virtualDataMngrLoadedBlks:[1,2],_isVirtualTopReached:!0,_isVirtualEndReached:!1,_isLoaded:!1,_isImpSLoad:!1,_isRowSelected:!1,_isColSelected:!1,_isSheetSelected:!1,isSheetProtected:!1,_contWidth:0,_isRangeSelected:!1,_isEmptyActiveCell:!1,_isMultiSelect:!1,_isImported:this.isImport,_isRequested:!1,_goToCollection:{multiple:!1,selected:[]},_showLockCellAlert:!1,_reqCnt:0,_resCnt:0,_templateColCount:0,_isTemplate:!1,_cFormatFormula:{},_isVPRendered:!1,_isDataMoved:!1,_vPortHgt:0,_vPortWth:0,cFormatRule:r&&r.cFormatRule||[],mergeCells:r&&r.mergeCells||[],hideRows:r&&r.hideRows||[],hideColumns:r&&r.hideColumns||[],border:r&&r.border||[],isResized:!1,_isOpened:!1,_wrapColl:{},_formatColl:{},_isFreezed:!1,_ftopRowIdx:0,_fleftColIdx:0,_contScrollTop:0,_contScrollLeft:0,_fDivTop:0,_fDivLeft:0,_isRibCollapsed:!1},this._initRangeSettings(i),s=f.sheetInfo.value,a=this._sheets[i]={_contentColGroup:null,_content:null,_sheetRowHeaderContent:null,_sheetHeader:null,_sheetRowHeader:null,_sheetContent:null,_Rows:null,_contTBody:null,_rowHdrTBody:null},this._calcEngine.registerGridAsSheet(s,s,this._calcID)),this.isImport&&(u=this._impData.model.sheets[i],o=this.getRangeIndices(u.topLeftCell||"A1"),f.sheetInfo.text=u.sheetInfo.text,f.sheetInfo.isVisible=this.isUndefined(u.sheetInfo.isVisible)?!0:u.sheetInfo.isVisible,this.model.importSettings.allowSheetOnDemand&&i!==this.getActiveSheetIndex()||(f._isRequested=!0),f._isRequested)){if(u.usedRange&&(u.usedRange.rowIndex&&(f.usedRange.rowIndex=u.usedRange.rowIndex),u.usedRange.colIndex&&(f.usedRange.colIndex=u.usedRange.colIndex)),u._startCell&&(u._startCell.rowIndex&&(f._startCell.rowIndex=u._startCell.rowIndex),u._startCell.colIndex&&(f._startCell.colIndex=u._startCell.colIndex)),u._endCell&&(u._endCell.rowIndex&&(f._endCell.rowIndex=u._endCell.rowIndex),u._endCell.colIndex&&(f._endCell.colIndex=u._endCell.colIndex)),u._activeCell&&(u._activeCell.rowIndex&&(f._activeCell.rowIndex=u._activeCell.rowIndex),u._activeCell.colIndex&&(f._activeCell.colIndex=u._activeCell.colIndex)),u.columnsWidthCollection&&(f.columnsWidthCollection=u.columnsWidthCollection),u.rowsHeightCollection){for(h=u.hideRowsCollection||[],e=0,l=h.length;e<l;e++)u.rowsHeightCollection[parseInt(h[e])]=0;f.rowsHeightCollection=n.extend(!0,[],u.rowsHeightCollection)}t.isNullOrUndefined(u.showGridlines)||(f.showGridlines=u.showGridlines);u.hideRowsCollection&&(f.hideRowsCollection=u.hideRowsCollection||[]);u.shapeMngr.picture.length&&(f.shapeMngr.sharedPics=u.shapeMngr.sharedPics);u.isSheetProtected&&(f.isSheetProtected=u.isSheetProtected);u._restrictedHeightRows&&(f._restrictedHeightRows=u._restrictedHeightRows||[]);u._isColSelected&&(f._isColSelected=u._isColSelected);u._isRowSelected&&(f._isRowSelected=u._isRowSelected);u.showHeadings===!1&&(f.showHeadings=!1);u.frozenRows&&(f.frozenRows=f._frozenRows=o[0]+u.frozenRows,f._frozenRows=f.frozenRows+1);u.frozenColumns&&(f.frozenColumns=f._frozenColumns=o[1]+u.frozenColumns,f._frozenColumns=f.frozenColumns+1)}},_generateSheetName:function(n){var t,f,r,o=1,u=this.model.sheets,e=this._getLocStr("Sheet"),i=u[n];for(r=i&&i.sheetName||e+n,t=1,f=u.length;t<f;t++)u[t].sheetInfo&&r===u[t].sheetInfo.text&&(t=0,r=i&&i.sheetName?i.sheetName+o++:e+ ++n);return r},_initRangeSettings:function(n){var i,u=this.getSheet(n),r=u.rangeSettings.length;if(r)while(r--)i=u.rangeSettings[r],i.dataSource&&(i._jsonData=i._dataManager=null,i.dataSource instanceof t.DataManager?i._dataManager=i.dataSource:i._jsonData=i.dataSource,i.showHeader!=!1&&(i.showHeader=!0))},_initCSSTag:function(){if(!document.getElementById(this._id+"_sscustomformat")){this.isImport&&(this._dataContainer.hashCode=[]);var n,r,i=0,t;if(t=this._renderStyleTag("custom"),this.isImport)this._refreshImpStyles(this._impData.dataContainer.hashCode);else if(this.XLFormat)for(n="s:11pt/b:#FFC7CE;c:#82012A;f:calibri;s:11pt/b:#C6EED2;c:#0A7043;f:calibri;s:11pt/b:#FEEC9B;c:#826717;f:calibri;s:11pt/f:Calibri;w:bold;v:top;s:11pt/f:calibri;s:18pt/b:#DDE5F6;f:calibri;s:11pt/b:#FDE0D2;f:calibri;s:11pt/b:#EEEEEC;f:calibri;s:11pt/b:#FEF4CD;f:calibri;s:11pt/b:#9CC0E7;f:calibri;s:11pt/b:#F9AD7B;f:calibri;s:11pt/b:#C9C9C9;f:calibri;s:11pt/b:#FED965;f:calibri;s:11pt/b:#559AD9;c:#FFFFFF;f:calibri;s:11pt/b:#EB7E2F;c:#FFFFFF;f:calibri;s:11pt/b:#A5A5A5;c:#FFFFFF;f:calibri;s:11pt/b:#FDBF01;c:#FFFFFF;f:calibri;s:11pt".split("/"),r=n.length;i<r;)this.XLFormat._createFormatClass(this._getStyleAsJSON(n[i]),null,!0),i++;n=".e-spreadsheet .e-hide, .e-spreadsheet .e-mc-hide, .e-spreadsheet .e-fr-hide, .e-spreadsheet .e-fc-hide, .e-spreadsheet .e-c-hide, .e-spreadsheet .e-r-hide, .e-spreadsheet .e-col-hide{ display: none}";n+=".e-spreadsheet .e-rowcell.e-redft { background-color: #FFC7CE; color: #9C0055;} .e-spreadsheet .e-rowcell.e-yellowft { background-color: #FFEB9C; color: #9C6500;}";n+=".e-spreadsheet .e-rowcell.e-greenft { background-color: #C6EFCE; color: #006100;} .e-spreadsheet .e-rowcell.e-redf { background-color: #FFC7CE;} .e-spreadsheet .e-rowcell.e-redt { color: #9C0055;}";n+=".e-spreadsheet .e-rowcell.e-hlcell { background-color: #FFFF00; color: #FF0000;} .e-spreadsheet .e-rowcell.e-goto-blank { background-color: #C6C6C6;}";t.styleSheet?t.styleSheet.cssText+=n:t.appendChild(document.createTextNode(n))}this._renderStyleTag("showhide")},_initEditForm:function(){var n,i,r;n=t.buildTag("input","",{display:"none"},{id:this._id+"_AutoComplete"});n.addClass("e-hide");this.element.append(n);this.XLEdit._renderAutoComplete(n,"",null,!0);n.data("ejAutocomplete")._setListPosition=function(){};i=t.buildTag("form","",{width:1,height:1,display:"none"},{id:this._id+"EditForm"});r=t.buildTag("input","",{width:1,height:1,overflow:"hidden",opacity:0},{id:this._id+"_ValElem"});i.append(r);r.data("id",this._id);this.element.append(i)},_getStyleAsJSON:function(n){var t,r,i=0,u={},f={b:"background-color",c:"color",f:"font-family",s:"font-size",w:"font-weight",v:"vetical-align",bo:"border"};for(n=n.split(";"),r=n.length;i<r;)t=n[i].split(":"),u[f[t[0]]]=t[0]==="bo"?this.XLRibbon._getBorderObj(t[1].split("-")[0],t[1].split("-")[1]):t[1],i++;return u},_initLayout:function(){this.model.showRibbon&&(this.XLRibbon._renderRibbon(),this._tabMode&&n("#"+this._id+"_Ribbon").ejRibbon("collapse"));this.model.allowFormulaBar&&this._renderFormulaBar();this._renderFUpload();this._renderLayout()},_renderLayout:function(){var n,t;for(this._renderPanel(),this._initTags(),this._initDependencies(),this._renderFooter(),this._refreshSheetLayout(),this.model.scrollSettings.allowVirtualScrolling||this.model.scrollSettings.allowSheetOnDemand?n=t=this.getActiveSheetIndex():(n=1,t=this.model.sheetCount);n<=t;)this._initSheet(n),n++},_renderPanel:function(){var i,n,r=this.model.scrollSettings;i=t.buildTag("div.e-spreadsheetgrppanel","",{},{id:this._id+"GroupPanel"});this.setGroupPanel(i);n=t.buildTag("div.e-spreadsheetmainpanel",this._renderDIV("e-spreadsheet-list",""),{},{id:this._id+"MainPanel"});i.append(n);this.setMainPanel(n);n=t.buildTag("div.e-spreadsheetactpanel","",{height:r.height,width:this.model.activationPanelWidth-1,display:"none"},{id:this._id+"ActivationPanel"});i.append(n);this.setActivationPanel(n);this.element.append(i)},_refreshSheetLayout:function(){var i,r,t,u,f=-1,e=this.model.pageSettings.pagerHeight+1;this._updateResponsiveSettings();this.XLRibbon._ribbonState&&(f=n("#"+this._id+"_Ribbon").find(".e-content:eq(1)").height());t=this._phoneMode?n("#"+this._id+"_Ribbon").height():n("#"+this._id+"_Ribbon").find(".e-header").height()+f+2;r=this.model.allowFormulaBar?this._formulaHeight:0;u=t&&this.model.showRibbon&&n("#"+this._id+"_Ribbon").is(":visible")?t:0;this.model.showPager&&this.element.find(".e-spreadsheetfooter").is(":visible")||(e=1);i=this._responsiveHeight-(u+r+2);this._browserDetails.name=="msie"||this._isAutoWHMode||this.element.find(".e-spreadsheet-list").height(i-e)},_initTags:function(){var n=t.buildTag("span#"+this._id+"_emptySpan"),i=t.buildTag("div#"+this._id+"_emptyDiv");this.element.find(".e-spreadsheetmainpanel")[0].insertBefore(n[0],this.element.find(".e-spreadsheetmainpanel").find(".e-spreadsheet-list")[0]);this.element.find(".e-spreadsheetmainpanel")[0].insertBefore(i[0],this.element.find(".e-spreadsheetmainpanel").find(".e-spreadsheet-list")[0]);this._refreshGlobalSpan()},_refreshGlobalSpan:function(t,i){t=t||document.getElementById(this._id+(i?"_emptyDiv":"_emptySpan"));t.textContent="";t.className="";this._browserDetails.name==="msie"&&this._browserDetails.version==="8.0"?n(t).removeAttr("style").text(""):t.removeAttribute("style")},_initSheet:function(n){var u,t=0,i=this.getSheet(n),r=this.getDataSettings(n);if(this._updateResponsiveSettings(),this._initViewPort(n),r&&!this._sheetCopy.isSheetCopy)for(u=r.length;t<u;)this._initDataSrc(n,i,r[t]),t++;i._reqCnt===i._resCnt&&this._renderSheet(n)},_initViewPort:function(t){var c=-1,u,i,f,e,o,s,h,l=this.model.scrollSettings,r=this.getSheet(t);u=i=f=e=o=s=h=0;l.allowScrolling&&(f=this._scrollerHeight,e=this._scrollerWidth);r.showHeadings&&(o=this._colHeaderHeight,s=this._rowHeaderWidth);this.model.showRibbon&&(i=n("#"+this._id+"_Ribbon").height(),i=i<189?i:188);this.model.allowFormulaBar&&(h=this._formulaHeight);this.model.showPager&&this.element.find(".e-spreadsheetfooter").is(":visible")&&(c=this.model.pageSettings.pagerHeight);this.getActivationPanel().is(":visible")&&(u=this.getActivationPanel().width());r._vPortHgt=this._responsiveHeight-(i+h+o+c+f);r._vPortWth=this._responsiveWidth-(u+e+s);l.allowVirtualScrolling&&(r._virtualBlockRowCnt=Math.ceil(r._vPortHgt/r.rowHeight)+this._bufferCnt)},_initDataSrc:function(n,i,r){if(r._dataManager){if(r._dataManager instanceof t.DataManager)if(r._dataManager.ready){var u=this;i._reqCnt++;this._reqCnt++;r._dataManager.ready.done(function(){u._initDataMngr(n,i,r)})}else this._initDataMngr(n,i,r)}else r._jsonData&&(r.count=r._jsonData.length)},_initDataMngr:function(n,i,r){var u,f,h,s,c,e,o=0,l=this;if(r._isDataManager=!0,r._isOffline=r._dataManager.dataSource.offline,r.query||(r.query=new t.Query),r.query.requiresCount(),this.model.scrollSettings.allowVirtualScrolling){if(s=r.query.queries,u=s.length,u)while(u--)f=s[u],f.fn==="onTake"?(o=f.e.nos,s.splice(u,1)):f.fn==="onSkip"&&(r._skip=f.e.nos);e=i._virtualBlockRowCnt*2;r.startCell&&(h=this.getRangeIndices(r.startCell),h[0]&&(e-=h[0]-0));o&&o<e&&(e=o);r.query.take(e)}c=r._dataManager.executeQuery(r.query);c.done(function(t){u=t.count||t.result.length;u&&(r._jsonData=t.result,r.count=o||u);l._respHandler(n)});c.fail(function(){l._respHandler(n)});r._dataManager.isDataAvailable||(i._reqCnt++,this._reqCnt++)},_respHandler:function(n){var t=this.getSheet(n);t._resCnt++;this._resCnt++;t._reqCnt===t._resCnt&&this._renderSheet(n);this._initComplete()},_renderSheet:function(i){var u,e,c,o,f=this.getActiveSheetIndex(),r=this.getSheet(i),l=r.sheetInfo.value,s={},h=this.element.find("#"+this._id+"_"+l);this._resizeColl[i-1]=!1;this._isInitLoad&&this._trigger("load",{sheetIndex:i});this._initTmplColumns(i);u=h.length===1?h:t.buildTag("div.e-sheet e-hide ","",{},{id:this._id+"_"+l});u.append(this._renderContent(i));h.length||(this.model.allowFreezing&&(o=this.XLFreeze._getHFreeze()),o?o.before(u):this.element.find(".e-spreadsheet-list").append(u));r.showGridlines===!1&&n("#"+this._id+"_Ribbon_PageLayout_Show_Gridlines").ejCheckBox({checked:r.showGridlines});this.model.enableContextMenu&&(this.XLCMenu._initContextMenu(),this.XLCMenu._initColorDialog(),this.XLCMenu._initCMenuFooter());this._updateResponsiveSettings();this._removeClass(u,"e-hide");s.width=this._responsiveWidth;s.height=this._responsiveHeight;this.model.showRibbon&&!this._isAutoWHMode&&(this._tabMode||this._responsiveHeight<280)&&n("#"+this._id+"_Ribbon").ejRibbon("collapse");this._setSheetWidthHeight(i,s,null,"refresh","initial");this._refreshCellBinding(i);this._refreshImpResRowHght(i);this.refreshContent(i);i===f&&this._updateHiddenRows(f);this._initializePicture(i);this.isImport&&this.model.allowCellType&&this.model.allowAutoCellType&&this._celltypes.length&&this._processCellTypes(this._celltypes,i);this.model.allowCellType&&!this.model.scrollSettings.allowVirtualScrolling&&this.XLCellType._rangeCellTypes(r.cellTypes,i);r._isImported&&!this._sheetCopy.isSheetCopy&&(this.setActiveSheetIndex(i),this._refreshImpSheets(i),this.setActiveSheetIndex(f));i!==f?u.hide():this._initSelection();this._initSheetModel(i);this.isImport&&r._isFreezed&&(c=this._impData.model.sheets[i],e=this.getRangeIndices(c.paneTopLeftCell),this._isFrozen(r.frozenRows)&&this.XLScroll._vScroller(i).scroll(this._getRowOffsetTop(r,e[0])-r._frozenHeight),this._isFrozen(r.frozenColumns)&&this.XLScroll._hScroller(i).scroll(this._getColOffsetLeft(r,e[1])-r._frozenWidth));r._isLoaded=!0;!this._isSheetInsert&&(this._pageClickArgs||this._gotoPageArgs)&&this._pageLoadComplete(i);this.getSheet(f)._isOpened=!0;this.model.showRibbon&&(n("#"+this._id+"_Ribbon")[0].style.overflow==="hidden"&&(n("#"+this._id+"_Ribbon")[0].style.overflow="",this.model.showRibbon&&this.XLRibbon._refreshBackstageHeight()),r._isRibCollapsed=!this.XLRibbon._ribbonState);this._isAutoWHMode&&this._autoSSWidthHeight(i)},_initSheetModel:function(n){var u,f,e,o,t=this.getSheet(n),i=this.getFrozenRows(n),r=this.getFrozenColumns(n);t.showHeadings===!1&&this.showHeadings(t.showHeadings);t._isImported&&(o=this._impData.model.sheets[n],u=this.getRangeIndices(o.topLeftCell||"A1"));f=t._isImported?u[0]:this._isFrozen(i)&&t._bottomRow.idx<=i?i-1:0;e=t._isImported?u[1]:this._isFrozen(r)&&t._rightCol.idx<=r?r-1:0;this.model.scrollSettings.allowScrolling&&(f>0&&this.XLScroll._vScroller(n).scroll(this._getRowOffsetTop(t,f)),e>0&&this.XLScroll._hScroller(n).scroll(this._getColOffsetLeft(t,e)));this.model.allowFreezing&&(this._isFrozen(i)&&this._isFrozen(r)?this.XLFreeze.freezePanes(i,r):this._isFrozen(i)?this.XLFreeze._freeze(i):this._isFrozen(r)&&this.XLFreeze._freeze(null,r))},_initTmplColumns:function(n){var u,f,i,r,e,t=this.getSheet(n);if(!this._sheetCopy.isSheetCopy&&!t.rangeSettings.length&&t.dataSource&&t._jsonData&&t.fieldAsColumnHeader&&(r=t._jsonData[0],e=this.getRangeIndices(t.startCell),u=e[1]+1,r)){for(i in r)r.hasOwnProperty(i)&&(f=r[i],typeof r[i]=="object"&&(i=this._iterateComplxObj(r[i],i).prop),t.columns[u-1]={field:this._generateHeaderText(u),text:i,type:f!=null?f.getDay?"date":typeof f:null},u++);t.colCount=t._templateColCount=t.columns.length;t._isTemplate=!0}},_refreshCellBinding:function(n){var t,r,f,l=this.getSheet(n),e=l.mergeCells,o=l.hideRows,u,i,s,h,c;if(e.length)for(u=0,f=e.length;u<f;u++)for(i=this.getRangeIndices(e[u]),s=i[2]-i[0]+1,h=i[3]-i[1]+1,c,t=0;t<s;t++)for(r=0;r<h;r++)c=t==0&&r==0?{merge:{isMerge:!0,mRange:e[u],isCenterAlign:!1,mSpan:{colSpan:h,rowSpan:s}}}:{isMHide:!0,mergeIdx:{rowIndex:i[0],colIndex:i[1]}},this.XLEdit._updateDataContainer({rowIndex:i[0]+t,colIndex:i[1]+r},{dataObj:c,sheetIdx:n,skipCell:!0});if(o.length&&this.model.scrollSettings.allowVirtualScrolling)for(t=0,f=o.length;t<f;t++)this._cellBindHiddenRows(o[t],o,n)},_cellBindHiddenRows:function(n,t,i){var r,u,e=this.getSheet(i),f=this.XLEdit;e.hideRowsCollection.push(n);this.XLScroll._getRowHeights(i,t.sort()[0]);u=n===0?{rowIndex:n,colIndex:0}:{rowIndex:n-1,colIndex:0};r={rowIndex:n,colIndex:0};f._updateDataContainer(u,{dataObj:{hRow:!0},sheetIdx:i,skipCell:!0});f._updateDataContainer(r,{dataObj:{isRHide:!0},sheetIdx:i,skipCell:!0})},_updateHiddenRows:function(n){var i,r,h,a,c,u=this.getSheet(n),s=u.hideRows,f,v=u.cFormatRule,e,o=u.hideColumns,l=u.border;if(s.length&&!this.model.scrollSettings.allowVirtualScrolling)for(i=0,r=s.length;i<r;i++)f=s[i],h=this.getRows(n),a=h[1],c=h[0],this.addClass(a[f],"e-r-hide"),this.addClass(c[f],"e-r-hide"),f>0&&this.addClass(c.eq(f-1).find("td")[0],"e-hrow"),this._cellBindHiddenRows(f,s,n);if(o.length&&!this.model.scrollSettings.allowVirtualScrolling){for(i=0,r=o.length;i<r;i++)u.hideColsCollection[o[i]]||this._updateHiddenColumns({rowIndex:0,colIndex:o[i]},n);this.XLScroll._getColWidths(n,o.sort()[0])}if(!t.isNullOrUndefined(v)&&v.length)for(i=0,r=u.cFormatRule.length;i<r;i++)e=u.cFormatRule[i],this.XLCFormat._cFormat(e.action,e.inputs[0],e.inputs[1],e.color,e.range,n);if(l.length&&!this.model.scrollSettings.allowVirtualScrolling)for(i=0,r=l.length;i<r;i++)this._updateCellBorder(l[i],n)},_updateHiddenColumns:function(n,t){var h=n.rowIndex,i=n.colIndex,u=this.getSheet(t),f={isCHide:!0},r=this._getJSSheetHeader(t),e=r.find("th"),o=r.find("col"),s=this._getContent(t).find("col");u.hideColsCollection[i]=u.columnWidth;u.columnsWidthCollection[i]=0;i===0&&(f.hCol=!0);this._writeRule(i,t);this.addClass(e[i],"e-hide");this.addClass(o[i],"e-hide");this.addClass(s[i],"e-hide");r.find("th:eq("+(i-1)+")").hasClass("e-hide")||this.addClass(r.find("th:eq("+(i-1)+")")[0],"e-hcol");this.XLEdit._updateDataContainer({rowIndex:0,colIndex:i},{dataObj:f,sheetIdx:t,skipCell:!0});i>0&&this.isUndefined(this.XLEdit.getPropertyValue(0,i-1,"isCHide"))&&this.XLEdit._updateDataContainer({rowIndex:0,colIndex:i-1},{dataObj:{hCol:!0},sheetIdx:t,skipCell:!0})},_renderContent:function(n){var r=[],i=t.buildTag("div.e-spreadsheetheader"),o=t.buildTag("div.e-headercontent"),h=t.buildTag("div.e-spreadsheetcolumnheader e-icon e-ss-selectall e-ss-cursor","",{},{}),u=t.buildTag("div.e-spreadsheetcontentcontainer","",{"-webkit-tap-highlight-color":"rgba(0,0,0,0)"}),s=t.buildTag("div.e-content e-ss-cursor"),f=t.buildTag("div.e-spreadsheetrowheader","",{float:"left",width:"30px"},{}),e=t.buildTag("div.e-rowheadercontent");return this._isAutoWHMode&&(s.addClass("e-rmvbtmbdr"),o.addClass("e-rmvrghtbdr"),e.addClass("e-rmvbtmbdr")),this._setJSSheetHeader(i,n),i.append(h),i.append(o),r.push(i),i=t.buildTag("div.e-spreadsheetcontent"),this._setJSSheetContent(i,n),this._setContent(u,n),this._setJSSheetRowHeader(f,n),this._setJSSheetRowHeaderContent(e,n),f.append(e),u.append(s),i.append(f),i.append(u),r.push(i),r},refreshContent:function(n){n=n||this.getActiveSheetIndex();var t,i,e=this.getSheet(n),u=this.model.scrollSettings,f=u.allowVirtualScrolling,r=this._getJSSheetContent(n).find(".e-spreadsheetcontentcontainer > .e-content");this._initDataRange(n);this._refreshRowColCnt(n);this._getJSSheetHeader(n).find(".e-headercontent").html(this._renderHeaderColumns(n));this._refreshTemplates(n);this._getJSSheetRowHeaderContent(n).html(this._renderHdrRows(n));r.find(".e-table").remove();r.prepend(this._renderContTable(n));this._initViewPortCont(n);this._isAutoWHMode?this._isInitLoad||this._autoSSWidthHeight(n):this.XLScroll._refreshScroller(n,"refresh","all");f||(this.XLScroll._getFirstRow(n),this.XLScroll._getFirstColumn(n));t=this._getContTBody(n).find("tr");i=this._getRowHdrTBody(n).find("tr");this.setRows([i,t],n)},_autoSSWidthHeight:function(t,i){var r={},f=this.model.scrollSettings,u=n("#"+this._id+"_Ribbon").data("ejRibbon");t=t||this._getSheetIndex();this._responsiveWidth=this._dlgWidth=r.width=this._getContTBody(t).width()+this._getJSSheetRowHeader(t).width();this.model.showRibbon&&r.width<=480?(r.width=480,this._getContent(t).find(".e-content").removeClass("e-rmvrghtbdr")):i||this._getContent(t).find(".e-content").addClass("e-rmvrghtbdr");i||this._setSheetWidthHeight(t,r,null,"refresh");this.model.showRibbon&&(r.width<=480&&this._alignFormulaBar(r.width),this.XLRibbon._refreshBackstageHeight(),u.setModel({width:r.width}));this._responsiveHeight=this._dlgHeight=r.height=this.element.height()},_initDataRange:function(n){var c,r,t,e,o,u,f,s=0,i=this.getSheet(n),h=this.getDataSettings(n);if(h)for(c=h.length;s<c;)t=h[s],t._jsonData&&(t.batchChanges={added:[],changed:[],deleted:[]},t.fields=this.getObjectKeys(t._jsonData[0]),r=t.startCell?this._toIntrnlRange(t.startCell,n):[0,0,0,0],r[2]=r[0]+(!t.fieldAsColumnHeader&&t.showHeader?t.count:t.count-1),r[3]=r[1]+this.getObjectLength(t._jsonData[0])-1,t.range=r,u=r[2],f=r[3],(this._isAutoWHMode||i.usedRange.rowIndex<u)&&(i.usedRange.rowIndex=u),(this._isAutoWHMode||i.usedRange.colIndex<f)&&(i.usedRange.colIndex=f),e=u+1,o=f+1,(this._isAutoWHMode||i.rowCount<e)&&(i.rowCount=e),(this._isAutoWHMode||i.colCount<=o)&&(i.colCount=o),i._hasDataSrc=!0),s++},_renderStyleTag:function(n){var i,t;return i=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0],t=document.createElement("style"),t.type="text/css",n=="custom"?(t.setAttribute("id",this._id+"_sscustomformat"),i.appendChild(t)):n!=="showhide"||document.getElementById(this._id+"_sshide")||(t.setAttribute("id",this._id+"_sshide"),i.appendChild(t)),t},_renderHeaderColumns:function(i){var f,r,e,u,o=document.createElement("thead");return u=this._renderHeaderCol(i,0,this.getSheet(i).colCount),r=t.buildTag("table.e-table")[0],this.model.scrollSettings.scrollMode===t.Spreadsheet.scrollMode.Normal?n(r).width(this._getEntireColWidth(i)):this.addClass(r,"e-ss-hdrspacing"),e=u[1],f=u[0],o.appendChild(f),r.appendChild(e),r.appendChild(o),r},_renderHeaderCol:function(n,i,r){var e,h,c,b,l,a,v,y,o,s=0,p=[],f=i,u=this.getSheet(n),w=document.createElement("tr"),k=document.createElement("colgroup");for(w.className="e-columnheader",this.isImport||(u._colWidthCollection.length=0,u._ofColWidthColl.length=0),u._colWidthCollection.push(s),u._ofColWidthColl.push(s);f<r;)e="e-headercell",l="col",o=u.columnsWidthCollection[f],this.isUndefined(o)&&(o=u.columnsWidthCollection[f]=u.columnWidth),f!=r-1&&(s=u._colWidthCollection[u._colWidthCollection.length-1]+o,u._colWidthCollection.push(s),u._ofColWidthColl.push(s)),this.model.allowSelection&&this._inColumn(u.selectedRange,f)&&(e+=" e-colhighlight",u._isColSelected&&(e+=" e-colselected")),o<1?(l+=".e-hide",e+=" e-hide"):u._hiddenFreezeCols.indexOf(f)>-1&&(l+=".e-fcol-hide",e+=" e-fcol-hide"),(this.IsImport||u._isLoaded)&&this.XLEdit.getPropertyValue(0,f,"hCol")&&(e+=" e-hcol"),h=document.createElement("th"),h.className=e,a=v=this._generateHeaderText(f+1),u.fieldAsColumnHeader&&u.columns[f]&&(a=u.columns[f].text),c=document.createElement("div"),c.className="e-headercelldiv",c.innerHTML=a,h.appendChild(c),b=t.buildTag(l,"",{width:o},{}),w.appendChild(h),k.appendChild(b[0]),this._sheetCopy.isSheetCopy||u.columns[f]||(u.columns[f]={field:v,text:v,type:y!=null?y.getDay?"date":typeof y:null}),f++;return p.push(w),p.push(k),p},_getWidth:function(n,t,i){for(var r=0,u=this.getSheet(i);n<=t;n++)r+=u.columnsWidthCollection[n];return r},_getEntireColWidth:function(n){var t=this.getSheet(n),i=this._getIdxWithOffset(null,this._getLastColIdx(t)).xOffset;return i+t.columnsWidthCollection[t.columnsWidthCollection.length-1]},_getLastColIdx:function(n){for(var t=n.colCount-1;t>-1;){if(!(t in n.hideColsCollection)&&n._hiddenFreezeCols.indexOf(t)===-1)break;t--}return t},_getIdxWithOffset:function(n,i,r,u,f){u=u||[];var s,h,p,e,c,l,a,y={},v=t.Spreadsheet.HideTypes,o=this.getSheet(f);if(e=c=l=a=0,!t.isNullOrUndefined(n)){if(r)for(p=o.rowsHeightCollection.length;e<p;){if(s=h=!1,u.indexOf(v.Default)===-1&&o.hideRowsCollection.indexOf(e)>-1&&(s=!0),u.indexOf(v.Freeze)===-1&&o._hiddenFreezeRows.indexOf(e)>-1&&(h=!0),!s&&!h){if(l+=o.rowsHeightCollection[e],l>n){c=e;break}a=l}e++}else{while(e<n)s=h=!1,u.indexOf(v.Default)===-1&&o.hideRowsCollection.indexOf(e)>-1&&(s=!0),u.indexOf(v.Freeze)===-1&&o._hiddenFreezeRows.indexOf(e)>-1&&(h=!0),s||h||(a+=o.rowsHeightCollection[e]),e++;c=n}y.rowIdx=c;y.yOffset=a}if(!t.isNullOrUndefined(i)){if(r)for(e=c=l=a=0,p=o.columnsWidthCollection.length;e<p;){if(s=h=!1,u.indexOf(v.Default)===-1&&e in o.hideColsCollection&&(s=!0),u.indexOf(v.Freeze)===-1&&o._hiddenFreezeCols.indexOf(e)>-1&&(h=!0),!s&&!h){if(l+=o.columnsWidthCollection[e],l>i){c=e;break}a=l}e++}else{while(e<i)s=h=!1,u.indexOf(v.Default)===-1&&e in o.hideColsCollection&&(s=!0),u.indexOf(v.Freeze)===-1&&o._hiddenFreezeCols.indexOf(e)>-1&&(h=!0),s||h||(a+=o.columnsWidthCollection[e]),e++;c=i}y.colIdx=c;y.xOffset=a}return y},_getEntireRowHeight:function(n){var t=this.getSheet(n);return t._rowHeightCollection[t._rowHeightCollection.length-1]+t.rowsHeightCollection[t.rowsHeightCollection.length-1]},_renderHdrRows:function(n){var r,a,v,b,k,p,d,u,o,s,c,g,h,l,f,e,y,i=this.getSheet(n),w=this.model.scrollSettings.allowVirtualScrolling;if(h=t.buildTag("table.e-table","<colgroup><col style='width: 30px;'><\/colgroup>",{}),this.addClass(h[0],"e-ss-rowhdrspacing"),!this._sheetCopy.isSheetCopy){for(u=f=0,y=i.rows,r=0,p=i.rowCount,i._rowHeightCollection=[],i._rowIdxColl=[],i._rowHeightCollection.push(u);r<p;)l=i.rowsHeightCollection[r],l||(l=i.rowsHeightCollection[r]=i.rowHeight),w&&(i.hideRowsCollection.indexOf(r)!==-1||i._hiddenFreezeRows.indexOf(r)!==-1)?l=0:i._rowIdxColl.push(r),r!=p-1&&i._rowHeightCollection.push(i._rowHeightCollection[i._rowHeightCo