text: /*!
  *  filename: ej.pivotpager.min.js
  *  version : 15.1.0.41
  *  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(["./../common/ej.core.min"],n):n()})(function(){(function(n,t,i){t.widget("ejPivotPager","ej.PivotPager",{_rootCSS:"e-pivotpager",element:null,model:null,_getModel:function(){return this.model},_setModel:function(n){this.model=n},defaults:{targetControlID:"",categoricalCurrentPage:1,seriesCurrentPage:1,seriesPageCount:0,categoricalPageCount:0,locale:"en-US",mode:"both"},_init:function(){n("#"+this.model.targetControlID).hasClass("e-pivotgrid")?(this.targetControlName="PivotGrid",this.targetControl=n("#"+this.model.targetControlID).data("ejPivotGrid"),this.targetControl._pagerObj=this):n("#"+this.model.targetControlID).hasClass("e-pivotchart")?(this.targetControlName="PivotChart",this.targetControl=n("#"+this.model.targetControlID).data("ejPivotChart"),this.targetControl._pagerObj=this):n("#"+this.model.targetControlID).hasClass("e-pivotclient")&&(this.targetControlName="PivotClient",this.targetControl=n("#"+this.model.targetControlID).data("ejPivotClient"),this.targetControl._pagerObj=this);this._load();this._unwireEvents();this._wireEvents()},_destroy:function(){this.element.empty().removeClass("e-pivotpager")},_wireEvents:function(){this._on(this.element,"keydown",".pagerTextBox",this._pagerTextBoxClick);this._on(this.element,"click",".moveNext",this._moveNextPage);this._on(this.element,"click",".moveLast",this._moveLastPage);this._on(this.element,"click",".moveFirst",this._moveFirstPage);this._on(this.element,"blur",".pagerTextBox",this._restorePageNo);this._on(this.element,"click",".movePrevious",this._movePreviousPage)},_unwireEvents:function(){this._off(this.element,"click",".moveNext",this._moveNextPage);this._off(this.element,"blur",".pagerTextBox",this._restorePageNo);this._off(this.element,"click",".moveLast",this._moveLastPage);this._off(this.element,"click",".moveFirst",this._moveFirstPage);this._off(this.element,"click",".movePrevious",this._movePreviousPage);this._off(this.element,"keydown",".pagerTextBox",this._pagerTextBoxClick)},_getLocalizedLabels:function(n){return t.PivotPager.Locale[this.model.locale][n]===i?t.PivotPager.Locale["en-US"][n]:t.PivotPager.Locale[this.model.locale][n]},_load:function(){var i,r,u,f;n(this.element).addClass("pivotPager").attr("targetControlID",this.model.targetControlID);i="";this.targetControl.model.enableRTL&&this.element.addClass("e-rtl");this.model.mode!="series"&&(r=t.buildTag("td.categPagerTd",""),n(r).html(t.buildTag("div.pagerDiv",t.buildTag("span.moveFirst e-icon").attr("role","button").attr("aria-label","move first")[0].outerHTML+t.buildTag("span.movePrevious e-icon").attr("role","button").attr("aria-label","move previous")[0].outerHTML+t.buildTag("span.pagerLabel",this._getLocalizedLabels("CategoricalPage"))[0].outerHTML+t.buildTag("input#"+this._id+"_CategCurrentPage.pagerTextBox")[0].outerHTML+t.buildTag("span.categPageCount")[0].outerHTML+t.buildTag("span.moveNext e-icon").attr("role","button").attr("aria-label","move next")[0].outerHTML+t.buildTag("span.moveLast e-icon").attr("role","button").attr("aria-label","move last")[0].outerHTML)),i=r[0].outerHTML);this.model.mode!="categorical"&&(u=t.buildTag("td.seriesPagerTd",""),n(u).html(t.buildTag("div.pagerDiv",t.buildTag("span.moveFirst e-icon").attr("role","button").attr("aria-label","move first")[0].outerHTML+t.buildTag("span.movePrevious e-icon").attr("role","button").attr("aria-label","move previous")[0].outerHTML+t.buildTag("span.pagerLabel",this._getLocalizedLabels("SeriesPage"))[0].outerHTML+t.buildTag("input#"+this._id+"_SeriesCurrentPage.pagerTextBox")[0].outerHTML+t.buildTag("span.seriesPageCount")[0].outerHTML+t.buildTag("span.moveNext e-icon").attr("role","button").attr("aria-label","move next")[0].outerHTML+t.buildTag("span.moveLast e-icon").attr("role","button").attr("aria-label","move last")[0].outerHTML)),i+=u[0].outerHTML);f=t.buildTag("table",t.buildTag("tbody",t.buildTag("tr",i)))[0];n(this.element).html(f)},initPagerProperties:function(t,i){t.Row<=i.SeriesPageSize?(n("#"+this._id+"_SeriesCurrentPage").attr("disabled",!0),n(".seriesPagerTd").fadeTo(0,.5)):(n("#"+this._id+"_SeriesCurrentPage").attr("disabled",!1),n(".seriesPagerTd").fadeTo(0,1));t.Column<=i.CategorialPageSize?(n("#"+this._id+"_CategCurrentPage").attr("disabled",!0),n(".categPagerTd").fadeTo(0,.5)):(n("#"+this._id+"_CategCurrentPage").attr("disabled",!1),n(".categPagerTd").fadeTo(0,1));this.model.categoricalPageCount=Math.ceil(t.Column/i.CategorialPageSize);this.model.seriesPageCount=Math.ceil(t.Row/i.SeriesPageSize);this.model.categoricalCurrentPage=i.CategorialCurrentPage;this.model.seriesCurrentPage=i.SeriesCurrentPage;this._initPagerControl()},_initPagerControl:function(){this.model.mode!="series"&&(n(this.element.find(".categPageCount")[0]).html("/ "+this.model.categoricalPageCount),n("#"+this._id+"_CategCurrentPage")[0].value=this.model.categoricalCurrentPage,this._setNavigators(this.model.categoricalCurrentPage,this.model.categoricalPageCount,this.element.find(".categPagerTd")[0]));this.model.mode!="categorical"&&(n(this.element.find(".seriesPageCount")[0]).html("/ "+this.model.seriesPageCount),n("#"+this._id+"_SeriesCurrentPage")[0].value=this.model.seriesCurrentPage,this._setNavigators(this.model.seriesCurrentPage,this.model.seriesPageCount,this.element.find(".seriesPagerTd")[0]))},_moveNextPage:function(t){if(!n(t.target).hasClass("disabled")){var i=n(n(t.target).parents("td")[0]).find(".pagerTextBox")[0];n(n(n(t.target).parents("td")[0]).find(".movePrevious")[0]).removeClass("disabled");n(n(n(t.target).parents("td")[0]).find(".moveFirst")[0]).removeClass("disabled");i.value=parseInt(i.value)+1;i.id.indexOf("Categ")!=-1?(this.model.categoricalCurrentPage=i.value,this.targetControlName=="PivotGrid"&&this.targetControl.refreshPagedPivotGrid("categorical",i.value),this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("categorical",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("categorical",i.value),i.value==this.model.categoricalPageCount&&(n(t.target).addClass("disabled"),n(n(n(t.target).parents("td")[0]).find(".moveLast")[0]).addClass("disabled"))):i.id.indexOf("Series")!=-1&&(this.model.seriesCurrentPage=i.value,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("series",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("series",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("series",i.value),i.value==this.model.seriesPageCount&&(n(t.target).addClass("disabled"),n(n(n(t.target).parents("td")[0]).find(".moveLast")[0]).addClass("disabled")))}},_movePreviousPage:function(t){if(!n(t.target).hasClass("disabled")){var i=n(n(t.target).parents("td")[0]).find(".pagerTextBox")[0];n(n(n(t.target).parents("td")[0]).find(".moveNext")[0]).removeClass("disabled");n(n(n(t.target).parents("td")[0]).find(".moveLast")[0]).removeClass("disabled");i.value=parseInt(i.value)-1;i.id.indexOf("Categ")!=-1?(this.model.categoricalCurrentPage=i.value,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("categorical",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("categorical",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("categorical",i.value),i.value=="1"&&(n(t.target).addClass("disabled"),n(n(n(t.target).parents("td")[0]).find(".moveFirst")[0]).addClass("disabled"))):i.id.indexOf("Series")!=-1&&(this.model.seriesCurrentPage=i.value,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("series",i.value):this.targetControlName=="PivotChart"&&this.targetControl.refreshPagedPivotChart("series",i.value),this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("series",i.value),i.value=="1"&&(n(t.target).addClass("disabled"),n(n(n(t.target).parents("td")[0]).find(".moveFirst")[0]).addClass("disabled")))}},_moveLastPage:function(t){if(!n(t.target).hasClass("disabled")){var i=n(n(t.target).parents("td")[0]).find(".pagerTextBox")[0];n(n(n(t.target).parents("td")[0]).find(".movePrevious")[0]).removeClass("disabled");n(n(n(t.target).parents("td")[0]).find(".moveFirst")[0]).removeClass("disabled");n(t.target).addClass("disabled");n(n(n(t.target).parents("td")[0]).find(".moveNext")[0]).addClass("disabled");i.id.indexOf("Categ")!=-1?(this.model.categoricalCurrentPage=i.value=this.model.categoricalPageCount,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("categorical",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("categorical",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("categorical",i.value)):i.id.indexOf("Series")!=-1&&(this.model.seriesCurrentPage=i.value=this.model.seriesPageCount,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("series",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("series",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("series",i.value))}},_moveFirstPage:function(t){if(!n(t.target).hasClass("disabled")){var i=n(n(t.target).parents("td")[0]).find(".pagerTextBox")[0];n(n(n(t.target).parents("td")[0]).find(".moveNext")[0]).removeClass("disabled");n(n(n(t.target).parents("td")[0]).find(".moveLast")[0]).removeClass("disabled");n(t.target).addClass("disabled");n(n(n(t.target).parents("td")[0]).find(".movePrevious")[0]).addClass("disabled");i.id.indexOf("Categ")!=-1?(this.model.categoricalCurrentPage=i.value=1,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("categorical",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("categorical",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("categorical",i.value)):i.id.indexOf("Series")!=-1&&(this.model.seriesCurrentPage=i.value=1,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid("series",i.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart("series",i.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient("series",i.value))}},_pagerTextBoxClick:function(i){if(i.which==13){i.preventDefault();var r=n(i.target).parents("td")[0],u=r.className.indexOf("categ")!=-1?this.model.categoricalPageCount:this.model.seriesPageCount;parseInt(i.target.value)>u||parseInt(i.target.value)<1||i.target.value==""?(this._restorePageNo(i),t.Pivot._createErrorDialog(this._getLocalizedLabels("PageCountErrorMsg"),"Error",this)):(r.className.indexOf("categ")!=-1&&this.model.categoricalCurrentPage!=parseInt(i.target.value)?(this.model.categoricalCurrentPage=i.target.value,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid(r.className,i.target.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart(r.className,i.target.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient(r.className,i.target.value)):r.className.indexOf("series")!=-1&&this.model.seriesCurrentPage!=parseInt(i.target.value)&&(this.model.seriesCurrentPage=i.target.value,this.targetControlName=="PivotGrid"?this.targetControl.refreshPagedPivotGrid(r.className,i.target.value):this.targetControlName=="PivotChart"?this.targetControl.refreshPagedPivotChart(r.className,i.target.value):this.targetControlName=="PivotClient"&&this.targetControl.refreshPagedPivotClient(r.className,i.target.value)),this._setNavigators(i.target.value,u,r),i.target.blur())}else{if(n.inArray(i.keyCode,[46,8,9,27,13,190])!==-1||i.keyCode==65&&i.ctrlKey===!0||i.keyCode>=35&&i.keyCode<=39)return;(i.shiftKey||i.keyCode<48||i.keyCode>57)&&(i.keyCode<96||i.keyCode>105)&&i.preventDefault()}},_restorePageNo:function(n){n.target.value=n.target.id.indexOf("Categ")!=-1?this.model.categoricalCurrentPage:this.model.seriesCurrentPage},_setNavigators:function(t,i,r){t==i&&(n(n(r).find(".moveNext")[0]).addClass("disabled"),n(n(r).find(".moveLast")[0]).addClass("disabled"));t=="1"&&(n(n(r).find(".movePrevious")[0]).addClass("disabled"),n(n(r).find(".moveFirst")[0]).addClass("disabled"));t>1&&(n(n(r).find(".movePrevious")[0]).removeClass("disabled"),n(n(r).find(".moveFirst")[0]).removeClass("disabled"));t<i&&(n(n(r).find(".moveNext")[0]).removeClass("disabled"),n(n(r).find(".moveLast")[0]).removeClass("disabled"))}});t.PivotPager.Locale={};t.PivotPager.Locale["en-US"]={SeriesPage:"Series Page",CategoricalPage:"Categorical Page",Error:"Error",OK:"OK",Close:"Close",PageCountErrorMsg:"Enter valid page number"};t.PivotPager.Mode={Both:"both",Categorical:"categorical",Series:"series"}})(jQuery,Syncfusion)});
  