/** * bootstrap-table - An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3). * * @version v1.13.5 * @homepage https://bootstrap-table.com * @author wenzhixin (http://wenzhixin.net.cn/) * @license MIT */ (function(e,t){if('function'==typeof define&&define.amd)define([],t);else if('undefined'!=typeof exports)t();else{t(),e.bootstrapTable={exports:{}}.exports}})(this,function(){'use strict';function e(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function t(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t',''],toobarDropdowItem:'
  • ',pageDropdown:[''],pageDropdownItem:''}},4:{iconsPrefix:'fa',icons:{paginationSwitchDown:'fa-caret-square-down',paginationSwitchUp:'fa-caret-square-up',refresh:'fa-sync',toggleOff:'fa-toggle-off',toggleOn:'fa-toggle-on',columns:'fa-th-list',detailOpen:'fa-plus',detailClose:'fa-minus',fullscreen:'fa-arrows-alt'},classes:{buttons:'secondary',pull:'float'},html:{toobarDropdow:[''],toobarDropdowItem:'',pageDropdown:[''],pageDropdownItem:'%s'}}}[s],r={bootstrapVersion:s,sprintf:function(e){for(var t=arguments.length,o=Array(1=o.length)break;n=o[a++]}else{if(a=o.next(),a.done)break;n=a.value}var s=n;if(s.field===t)return s.title}return''},setFieldIndex:function(e){for(var t=0,o=[],a=e[0],n=Array.isArray(a),s=0,_iterator2=n?a:a[Symbol.iterator]();;){var l;if(n){if(s>=a.length)break;l=a[s++]}else{if(s=a.next(),s.done)break;l=s.value}var d=l;t+=d.colspan||1}for(var m=0;m=p.length)break;g=p[h++]}else{if(h=p.next(),h.done)break;g=h.value}var u=g,r=u.rowspan||1,f=u.colspan||1,b=o[y].indexOf(!1);1===f&&(u.fieldIndex=b,'undefined'==typeof u.field&&(u.field=b));for(var w=0;w').addClass('fixed-table-scroll-inner'),t=n('
    ').addClass('fixed-table-scroll-outer');t.append(e),n('body').append(t);var o=e[0].offsetWidth;t.css('overflow','scroll');var i=e[0].offsetWidth;o===i&&(i=t[0].clientWidth),t.remove(),this.cachedWidth=o-i}return this.cachedWidth},calculateObjectValue:function(e,o,i,n){var s=o;if('string'==typeof o){var h=o.split('.');if(1=l.length)break;p=l[d++]}else{if(d=l.next(),d.done)break;p=d.value}var c=p;s=s[c]}}else s=window[o]}return null!==s&&'object'===('undefined'==typeof s?'undefined':a(s))?s:'function'==typeof s?s.apply(e,i||[]):!s&&'string'==typeof o&&this.sprintf.apply(this,[o].concat(t(i)))?this.sprintf.apply(this,[o].concat(t(i))):n},compareObjects:function(e,t,o){var i=Object.keys(e),a=Object.keys(t);if(o&&i.length!==a.length)return!1;for(var n=i,s=Array.isArray(n),l=0,_iterator5=s?n:n[Symbol.iterator]();;){var r;if(s){if(l>=n.length)break;r=n[l++]}else{if(l=n.next(),l.done)break;r=l.value}var d=r;if(-1!==a.indexOf(d)&&e[d]!==t[d])return!1}return!0},escapeHTML:function(e){return'string'==typeof e?e.replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`'):e},getRealDataAttr:function(e){for(var t=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(e),o=Array.isArray(t),a=0,_iterator6=o?t:t[Symbol.iterator]();;){var n;if(o){if(a>=t.length)break;n=t[a++]}else{if(a=t.next(),a.done)break;n=a.value}var s=n,l=i(s,2),r=l[0],d=l[1],p=r.split(/(?=[A-Z])/).join('-').toLowerCase();p!==r&&(e[p]=d,delete e[r])}return e},getItemField:function(e,t,o){var i=e;if('string'!=typeof t||e.hasOwnProperty(t))return o?this.escapeHTML(e[t]):e[t];for(var a=t.split('.'),n=a,s=Array.isArray(n),l=0,_iterator7=s?n:n[Symbol.iterator]();;){var r;if(s){if(l>=n.length)break;r=n[l++]}else{if(l=n.next(),l.done)break;r=l.value}var d=r;i=i&&i[d]}return o?this.escapeHTML(i):i},isIEBrowser:function(){return -1!==navigator.userAgent.indexOf('MSIE ')||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function(e,t){for(var o=e,i=Array.isArray(o),a=0,_iterator8=i?o:o[Symbol.iterator]();;){var n;if(i){if(a>=o.length)break;n=o[a++]}else{if(a=o.next(),a.done)break;n=a.value}var s=n;if(JSON.stringify(s)===JSON.stringify(t))return e.indexOf(s)}return-1}},d={height:void 0,classes:'table table-bordered table-hover',theadClasses:'',rowStyle:function(){return{}},rowAttributes:function(){return{}},undefinedText:'-',locale:void 0,sortable:!0,sortClass:void 0,silentSort:!0,sortName:void 0,sortOrder:'asc',sortStable:!1,rememberOrder:!1,customSort:void 0,columns:[[]],data:[],url:void 0,method:'get',cache:!0,contentType:'application/json',dataType:'json',ajax:void 0,ajaxOptions:{},queryParams:function(e){return e},queryParamsType:'limit',responseHandler:function(e){return e},totalField:'total',dataField:'rows',pagination:!1,onlyInfoPagination:!1,paginationLoop:!0,sidePagination:'client',totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:'right',paginationVAlign:'bottom',paginationDetailHAlign:'left',paginationPreText:'‹',paginationNextText:'›',paginationSuccessivelySize:5,paginationPagesBySide:1,paginationUseIntermediate:!1,search:!1,searchOnEnterKey:!1,strictSearch:!1,trimOnSearch:!0,searchAlign:'right',searchTimeOut:500,searchText:'',customSearch:void 0,showHeader:!0,showFooter:!1,footerStyle:function(){return{}},showColumns:!1,minimumCountColumns:1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,showFullscreen:!1,smartDisplay:!0,escape:!1,idField:void 0,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return''},detailFilter:function(){return!0},selectItemName:'btSelectItem',clickToSelect:!1,ignoreClickToSelectOn:function(e){var t=e.tagName;return -1!==['A','BUTTON'].indexOf(t)},singleSelect:!1,checkboxHeader:!0,maintainSelected:!1,toolbar:void 0,toolbarAlign:'left',buttonsToolbar:void 0,buttonsAlign:'right',buttonsClass:l.classes.buttons,icons:l.icons,iconSize:void 0,iconsPrefix:l.iconsPrefix,onAll:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1},onSort:function(){return!1},onCheck:function(){return!1},onUncheck:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onCheckSome:function(){return!1},onUncheckSome:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onColumnSwitch:function(){return!1},onPageChange:function(){return!1},onSearch:function(){return!1},onToggle:function(){return!1},onPreBody:function(){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onExpandRow:function(){return!1},onCollapseRow:function(){return!1},onRefreshOptions:function(){return!1},onRefresh:function(){return!1},onResetView:function(){return!1},onScrollBody:function(){return!1}},p={};p['en-US']=p.en={formatLoadingMessage:function(){return'Loading, please wait...'},formatRecordsPerPage:function(e){return r.sprintf('%s rows per page',e)},formatShowingRows:function(e,t,o){return r.sprintf('Showing %s to %s of %s rows',e,t,o)},formatDetailPagination:function(e){return r.sprintf('Showing %s rows',e)},formatSearch:function(){return'Search'},formatNoMatches:function(){return'No matching records found'},formatPaginationSwitch:function(){return'Hide/Show pagination'},formatRefresh:function(){return'Refresh'},formatToggle:function(){return'Toggle'},formatFullscreen:function(){return'Fullscreen'},formatColumns:function(){return'Columns'},formatAllRows:function(){return'All'}},n.extend(d,p['en-US']);var c=function(){function t(o,i){e(this,t),this.options=i,this.$el=n(o),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()}return o(t,[{key:'init',value:function(){this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initHiddenRows(),this.initFooter(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()}},{key:'initLocale',value:function(){if(this.options.locale){var e=n.fn.bootstrapTable.locales,t=this.options.locale.split(/-|_/);t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),e[this.options.locale]?n.extend(this.options,e[this.options.locale]):e[t.join('-')]?n.extend(this.options,e[t.join('-')]):e[t[0]]&&n.extend(this.options,e[t[0]])}}},{key:'initContainer',value:function(){var e=-1===['top','both'].indexOf(this.options.paginationVAlign)?'':'
    ',t=-1===['bottom','both'].indexOf(this.options.paginationVAlign)?'':'
    ';this.$container=n('\n
    \n
    \n '+e+'\n
    \n
    \n
    \n
    \n '+this.options.formatLoadingMessage()+'\n
    \n
    \n \n
    \n '+t+'\n
    \n '),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find('.fixed-table-container'),this.$tableHeader=this.$container.find('.fixed-table-header'),this.$tableBody=this.$container.find('.fixed-table-body'),this.$tableLoading=this.$container.find('.fixed-table-loading'),this.$tableFooter=this.$container.find('.fixed-table-footer'),this.$toolbar=this.options.buttonsToolbar?n('body').find(this.options.buttonsToolbar):this.$container.find('.fixed-table-toolbar'),this.$pagination=this.$container.find('.fixed-table-pagination'),this.$tableBody.append(this.$el),this.$container.after('
    '),this.$el.addClass(this.options.classes),this.options.height&&(this.$tableContainer.addClass('fixed-height'),this.options.showFooter&&this.$tableContainer.addClass('has-footer'),-1!==this.options.classes.split(' ').indexOf('table-bordered')&&(this.$tableBody.append('
    '),this.$tableBorder=this.$tableBody.find('.fixed-table-border'),this.$tableLoading.addClass('fixed-table-border')))}},{key:'initTable',value:function(){var e=this,o=[],i=[];if(this.$header=this.$el.find('>thead'),this.$header.length?this.options.theadClasses&&this.$header.addClass(this.options.theadClasses):this.$header=n('').appendTo(this.$el),this.$header.find('tr').each(function(e,t){var a=[];n(t).find('th').each(function(e,t){'undefined'!=typeof n(t).data('field')&&n(t).data('field',''+n(t).data('field')),a.push(n.extend({},{title:n(t).html(),class:n(t).attr('class'),titleTooltip:n(t).attr('title'),rowspan:n(t).attr('rowspan')?+n(t).attr('rowspan'):void 0,colspan:n(t).attr('colspan')?+n(t).attr('colspan'):void 0},n(t).data()))}),o.push(a)}),Array.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=n.extend(!0,[],o,this.options.columns),this.columns=[],this.fieldsColumnsIndex=[],r.setFieldIndex(this.options.columns),this.options.columns.forEach(function(o,a){o.forEach(function(o,i){var s=n.extend({},t.COLUMN_DEFAULTS,o);'undefined'!=typeof s.fieldIndex&&(e.columns[s.fieldIndex]=s,e.fieldsColumnsIndex[s.field]=s.fieldIndex),e.options.columns[a][i]=s})}),!this.options.data.length){var a=[];this.$el.find('>tbody>tr').each(function(t,o){var s={};s._id=n(o).attr('id'),s._class=n(o).attr('class'),s._data=r.getRealDataAttr(n(o).data()),n(o).find('>td').each(function(o,i){for(var l=+n(i).attr('colspan')||1,d=+n(i).attr('rowspan')||1,p=o;a[t]&&a[t][p];p++);for(var h=p;h'),0===n&&!t.options.cardView&&t.options.detailView&&o.push('\n
    \n \n '),a.forEach(function(i,a){var s='',l='',d='',p='',c=r.sprintf(' class="%s"',i['class']),h='px',g=i.width;if(void 0===i.width||t.options.cardView||'string'!=typeof i.width||-1===i.width.indexOf('%')||(h='%'),i.width&&'string'==typeof i.width&&(g=i.width.replace('%','').replace('px','')),l=r.sprintf('text-align: %s; ',i.halign?i.halign:i.align),d=r.sprintf('text-align: %s; ',i.align),p=r.sprintf('vertical-align: %s; ',i.valign),p+=r.sprintf('width: %s; ',(i.checkbox||i.radio)&&!g?i.showSelectTitle?void 0:'36px':g?g+h:void 0),'undefined'!=typeof i.fieldIndex){if(t.header.fields[i.fieldIndex]=i.field,t.header.styles[i.fieldIndex]=d+p,t.header.classes[i.fieldIndex]=c,t.header.formatters[i.fieldIndex]=i.formatter,t.header.events[i.fieldIndex]=i.events,t.header.sorters[i.fieldIndex]=i.sorter,t.header.sortNames[i.fieldIndex]=i.sortName,t.header.cellStyles[i.fieldIndex]=i.cellStyle,t.header.searchables[i.fieldIndex]=i.searchable,!i.visible)return;if(t.options.cardView&&!i.cardVisible)return;e[i.field]=i}o.push(''),o.push(r.sprintf('
    ',t.options.sortable&&i.sortable?'sortable both':'')),s=t.options.escape?r.escapeHTML(i.title):i.title;var u=s;i.checkbox&&(s='',!t.options.singleSelect&&t.options.checkboxHeader&&(s=''),t.header.stateField=i.field),i.radio&&(s='',t.header.stateField=i.field,t.options.singleSelect=!0),!s&&i.showSelectTitle&&(s+=u),o.push(s),o.push('
    '),o.push('
    '),o.push('
    '),o.push('')}),o.push('')}),this.$header.html(o.join('')),this.$header.find('th[data-field]').each(function(t,o){n(o).data(e[n(o).data('field')])}),this.$container.off('click','.th-inner').on('click','.th-inner',function(o){var e=n(o.currentTarget);return t.options.detailView&&!e.parent().hasClass('bs-checkbox')&&e.closest('.bootstrap-table')[0]!==t.$container[0]?!1:void(t.options.sortable&&e.parent().data().sortable&&t.onSort(o))}),this.$header.children().children().off('keypress').on('keypress',function(o){if(t.options.sortable&&n(o.currentTarget).data().sortable){var e=o.keyCode||o.which;13===e&&t.onSort(o)}}),n(window).off('resize.bootstrap-table'),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css('top',0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css('top',this.$header.outerHeight()+1),this.getCaret(),n(window).on('resize.bootstrap-table',n.proxy(this.resetWidth,this))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off('click').on('click',function(e){var o=e.currentTarget,i=n(o).prop('checked');t[i?'checkAll':'uncheckAll'](),t.updateSelected()})}},{key:'initFooter',value:function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()}},{key:'initData',value:function(e,t){this.options.data='append'===t?this.options.data.concat(e):'prepend'===t?[].concat(e).concat(this.options.data):e||this.options.data,this.data=this.options.data,'server'===this.options.sidePagination||this.initSort()}},{key:'initSort',value:function(){var e=this,t=this.options.sortName,o='desc'===this.options.sortOrder?-1:1,i=this.header.fields.indexOf(this.options.sortName),a=0;-1!==i&&(this.options.sortStable&&this.data.forEach(function(e,t){e.hasOwnProperty('_position')||(e._position=t)}),this.options.customSort?r.calculateObjectValue(this.options,this.options.customSort,[this.options.sortName,this.options.sortOrder,this.data]):this.data.sort(function(s,a){e.header.sortNames[i]&&(t=e.header.sortNames[i]);var l=r.getItemField(s,t,e.options.escape),d=r.getItemField(a,t,e.options.escape),p=r.calculateObjectValue(e.header,e.header.sorters[i],[l,d,s,a]);return void 0===p?((void 0===l||null===l)&&(l=''),(void 0===d||null===d)&&(d=''),e.options.sortStable&&l===d&&(l=s._position,d=a._position),n.isNumeric(l)&&n.isNumeric(d))?(l=parseFloat(l),d=parseFloat(d),ld?o:0):l===d?0:('string'!=typeof l&&(l=l.toString()),-1===l.localeCompare(d)?-1*o:o):e.options.sortStable&&0===p?o*(s._position-a._position):o*p}),void 0!==this.options.sortClass&&(clearTimeout(a),a=setTimeout(function(){e.$el.removeClass(e.options.sortClass);var t=e.$header.find('[data-field="'+e.options.sortName+'"]').index();e.$el.find('tr td:nth-child('+(t+1)+')').addClass(e.options.sortClass)},250)))}},{key:'onSort',value:function(e){var t=e.type,o=e.currentTarget,i='keypress'===t?n(o):n(o).parent(),a=this.$header.find('th').eq(i.index());return this.$header.add(this.$header_).find('span.order').remove(),this.options.sortName===i.data('field')?this.options.sortOrder='asc'===this.options.sortOrder?'desc':'asc':(this.options.sortName=i.data('field'),this.options.sortOrder=this.options.rememberOrder?'asc'===i.data('order')?'desc':'asc':this.columns[this.fieldsColumnsIndex[i.data('field')]].order),this.trigger('sort',this.options.sortName,this.options.sortOrder),i.add(a).data('order',this.options.sortOrder),this.getCaret(),'server'===this.options.sidePagination?void this.initServer(this.options.silentSort):void(this.initSort(),this.initBody())}},{key:'initToolbar',value:function(){var e=this,t=[],o=0,i=void 0,s=void 0,d=0;this.$toolbar.find('.bs-bars').children().length&&n('body').append(n(this.options.toolbar)),this.$toolbar.html(''),('string'==typeof this.options.toolbar||'object'===a(this.options.toolbar))&&n(r.sprintf('
    ',l.classes.pull,this.options.toolbarAlign)).appendTo(this.$toolbar).append(n(this.options.toolbar)),t=[r.sprintf('
    ',this.options.buttonsAlign,l.classes.pull,this.options.buttonsAlign)],'string'==typeof this.options.icons&&(this.options.icons=r.calculateObjectValue(null,this.options.icons)),this.options.showPaginationSwitch&&t.push(r.sprintf(''),this.options.showRefresh&&t.push(r.sprintf(''),this.options.showToggle&&t.push(r.sprintf(''),this.options.showFullscreen&&t.push(r.sprintf(''),this.options.showColumns&&(t.push(r.sprintf('
    ',this.options.formatColumns()),'',l.html.toobarDropdow[0]),this.columns.forEach(function(o,a){if(!(o.radio||o.checkbox)&&(!e.options.cardView||o.cardVisible)){var i=o.visible?' checked="checked"':'';o.switchable&&(t.push(r.sprintf(l.html.toobarDropdowItem,r.sprintf(' %s',o.field,a,i,o.title))),d++)}}),t.push(l.html.toobarDropdow[1],'
    ')),t.push('
    '),(this.showToolbar||2',l.classes.pull,this.options.searchAlign),r.sprintf('',this.options.formatSearch()),''),this.$toolbar.append(t.join('')),s=this.$toolbar.find('.search input'),s.off('keyup drop blur').on('keyup drop blur',function(t){e.options.searchOnEnterKey&&13!==t.keyCode||-1!==[37,38,39,40].indexOf(t.keyCode)||(clearTimeout(o),o=setTimeout(function(){e.onSearch(t)},e.options.searchTimeOut))}),r.isIEBrowser()&&s.off('mouseup').on('mouseup',function(t){clearTimeout(o),o=setTimeout(function(){e.onSearch(t)},e.options.searchTimeOut)}))}},{key:'onSearch',value:function(e){var t=e.currentTarget,o=e.firedByInitSearchText,i=n.trim(n(t).val());this.options.trimOnSearch&&n(t).val()!==i&&n(t).val(i),i===this.searchText||(this.searchText=i,this.options.searchText=i,!o&&(this.options.pageNumber=1),this.initSearch(),o?'client'===this.options.sidePagination&&this.updatePagination():this.updatePagination(),this.trigger('search',i))}},{key:'initSearch',value:function(){var e=this;if('server'!==this.options.sidePagination){if(this.options.customSearch)return void(this.data=r.calculateObjectValue(this.options,this.options.customSearch,[this.options.data,this.searchText]));var t=this.searchText&&(this.options.escape?r.escapeHTML(this.searchText):this.searchText).toLowerCase(),o=n.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=o?this.options.data.filter(function(e){for(var t in o)if(Array.isArray(o[t])&&-1===o[t].indexOf(e[t])||!Array.isArray(o[t])&&e[t]!==o[t])return!1;return!0}):this.options.data,this.data=t?this.data.filter(function(o,a){for(var c=0;cthis.totalPages&&(this.options.pageNumber=this.totalPages),this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1,this.pageTo=this.options.pageNumber*this.options.pageSize,this.pageTo>this.options.totalRows&&(this.pageTo=this.options.totalRows),o.push(r.sprintf('
    ',l.classes.pull,this.options.paginationDetailHAlign),'',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),''),!this.options.onlyInfoPagination){o.push('');var $=[r.sprintf('','top'===this.options.paginationVAlign||'both'===this.options.paginationVAlign?'dropdown':'dropup'),'',l.html.pageDropdown[0]];if('string'==typeof this.options.pageList){var P=this.options.pageList.replace('[','').replace(']','').replace(/ /g,'').split(',');f=[];for(var b=P,m=Array.isArray(b),y=0,_iterator9=m?b:b[Symbol.iterator]();;){var w;if(m){if(y>=b.length)break;w=b[y++]}else{if(y=b.next(),y.done)break;w=y.value}var k=w;f.push(k.toUpperCase()===this.options.formatAllRows().toUpperCase()||'UNLIMITED'===k.toUpperCase()?this.options.formatAllRows():+k)}}f.forEach(function(e,o){if(!t.options.smartDisplay||0===o||f[o-1]'),o.push(this.options.formatRecordsPerPage($.join(''))),o.push(''),o.push('
    ',r.sprintf('\n ')}this.$pagination.html(o.join('')),this.options.onlyInfoPagination||(p=this.$pagination.find('.page-list a'),c=this.$pagination.find('.page-pre'),h=this.$pagination.find('.page-next'),g=this.$pagination.find('.page-item').not('.page-next, .page-pre'),this.options.smartDisplay&&(1>=this.totalPages&&this.$pagination.find('div.pagination').hide(),(2>f.length||this.options.totalRows<=f[0])&&this.$pagination.find('span.page-list').hide(),this.$pagination[this.getData().length?'show':'hide']()),!this.options.paginationLoop&&(1===this.options.pageNumber&&c.addClass('disabled'),this.options.pageNumber===this.totalPages&&h.addClass('disabled')),a&&(this.options.pageSize=this.options.formatAllRows()),p.off('click').on('click',n.proxy(this.onPageListChange,this)),c.off('click').on('click',n.proxy(this.onPagePre,this)),h.off('click').on('click',n.proxy(this.onPageNext,this)),g.off('click').on('click',n.proxy(this.onPageNumber,this)))}},{key:'updatePagination',value:function(e){e&&n(e.currentTarget).hasClass('disabled')||(!this.options.maintainSelected&&this.resetRows(),this.initPagination(),'server'===this.options.sidePagination?this.initServer():this.initBody(),this.trigger('page-change',this.options.pageNumber,this.options.pageSize))}},{key:'onPageListChange',value:function(e){e.preventDefault();var t=n(e.currentTarget);return t.parent().addClass('active').siblings().removeClass('active'),this.options.pageSize=t.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+t.text(),this.$toolbar.find('.page-size').text(this.options.pageSize),this.updatePagination(e),!1}},{key:'onPagePre',value:function(e){return e.preventDefault(),0==this.options.pageNumber-1?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(e),!1}},{key:'onPageNext',value:function(e){return e.preventDefault(),this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(e),!1}},{key:'onPageNumber',value:function(e){if(e.preventDefault(),this.options.pageNumber!==+n(e.currentTarget).text())return this.options.pageNumber=+n(e.currentTarget).text(),this.updatePagination(e),!1}},{key:'initRow',value:function(e,t){var o=this,a=[],s={},l=[],d='',p={},c=[];if(!(-1=h.length)break;f=h[u++]}else{if(u=h.next(),u.done)break;f=u.value}var b=f,m=i(b,2),y=m[0],w=m[1];l.push(y+': '+w)}if(p=r.calculateObjectValue(this.options,this.options.rowAttributes,[e,t],p),p)for(var x=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(p),S=Array.isArray(x),$=0,_iterator11=S?x:x[Symbol.iterator]();;){var P;if(S){if($>=x.length)break;P=x[$++]}else{if($=x.next(),$.done)break;P=$.value}var C=P,T=i(C,2),O=T[0],A=T[1];c.push(O+'="'+r.escapeHTML(A)+'"')}if(e._data&&!n.isEmptyObject(e._data))for(var R=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(e._data),I=Array.isArray(R),_=0,_iterator12=I?R:R[Symbol.iterator]();;){var V;if(I){if(_>=R.length)break;V=R[_++]}else{if(_=R.next(),_.done)break;V=_.value}var F=V,B=i(F,2),N=B[0],k=B[1];if('index'===N)return;d+=' data-'+N+'="'+k+'"'}return a.push(''),this.options.cardView&&a.push('
    '),!this.options.cardView&&this.options.detailView&&(a.push(''),r.calculateObjectValue(null,this.options.detailFilter,[t,e])&&a.push('\n \n \n \n '),a.push('')),this.header.fields.forEach(function(d,p){var h='',g=r.getItemField(e,d,o.options.escape),u='',f='',b={},m='',y=o.header.classes[p],w='',k='',v='',x='',S='',$=o.columns[p];if((!o.fromHtml||'undefined'!=typeof g||$.checkbox||$.radio)&&$.visible&&(!o.options.cardView||$.cardVisible)){if($.escape&&(g=r.escapeHTML(g)),l.concat([o.header.styles[p]]).length&&(w=' style="'+l.concat([o.header.styles[p]]).join('; ')+'"'),e['_'+d+'_id']&&(m=r.sprintf(' id="%s"',e['_'+d+'_id'])),e['_'+d+'_class']&&(y=r.sprintf(' class="%s"',e['_'+d+'_class'])),e['_'+d+'_rowspan']&&(v=r.sprintf(' rowspan="%s"',e['_'+d+'_rowspan'])),e['_'+d+'_colspan']&&(x=r.sprintf(' colspan="%s"',e['_'+d+'_colspan'])),e['_'+d+'_title']&&(S=r.sprintf(' title="%s"',e['_'+d+'_title'])),b=r.calculateObjectValue(o.header,o.header.cellStyles[p],[g,e,t,d],b),b.classes&&(y=' class="'+b.classes+'"'),b.css){for(var P=[],C=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(b.css),T=Array.isArray(C),O=0,_iterator13=T?C:C[Symbol.iterator]();;){var A;if(T){if(O>=C.length)break;A=C[O++]}else{if(O=C.next(),O.done)break;A=O.value}var R=A,I=i(R,2),_=I[0],V=I[1];P.push(_+': '+V)}w=' style="'+P.concat(o.header.styles[p]).join('; ')+'"'}if(u=r.calculateObjectValue($,o.header.formatters[p],[g,e,t,d],g),e['_'+d+'_data']&&!n.isEmptyObject(e['_'+d+'_data']))for(var F=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(e['_'+d+'_data']),B=Array.isArray(F),N=0,_iterator14=B?F:F[Symbol.iterator]();;){var j;if(B){if(N>=F.length)break;j=F[N++]}else{if(N=F.next(),N.done)break;j=N.value}var H=j,L=i(H,2),D=L[0],E=L[1];if('index'===D)return;k+=' data-'+D+'="'+E+'"'}if($.checkbox||$.radio){f=$.checkbox?'checkbox':f,f=$.radio?'radio':f;var z=$['class']||'',c=!0===u||g||u&&u.checked,U=!$.checkboxEnabled||u&&u.disabled;h=[o.options.cardView?'
    ':'','',o.header.formatters[p]&&'string'==typeof u?u:'',o.options.cardView?'
    ':''].join(''),e[o.header.stateField]=!0===u||!!g||u&&u.checked}else if(u='undefined'==typeof u||null===u?o.options.undefinedText:u,o.options.cardView){var q=o.options.showHeader?''+r.getFieldTitle(o.columns,d)+'':'';h='
    '+q+''+u+'
    ',o.options.smartDisplay&&''===u&&(h='
    ')}else h=''+u+'';a.push(h)}}),this.options.cardView&&a.push('
    '),a.push(''),a.join('')}}},{key:'initBody',value:function(e){var t=this,o=this.getData();this.trigger('pre-body',o),this.$body=this.$el.find('>tbody'),this.$body.length||(this.$body=n('').appendTo(this.$el)),this.options.pagination&&'server'!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=o.length);for(var a=n(document.createDocumentFragment()),s=!1,l=this.pageFrom-1;l'+r.sprintf('%s',this.$header.find('th').length,this.options.formatNoMatches())+''),e||this.scrollTo(0),this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick',function(e){var o=e.currentTarget,i=e.type,a=e.target,s=n(o),l=s.parent(),d=t.data[l.data('index')],p=s[0].cellIndex,c=t.getVisibleFields(),h=c[t.options.detailView&&!t.options.cardView?p-1:p],g=t.columns[t.fieldsColumnsIndex[h]],u=r.getItemField(d,h,t.options.escape);if(!s.find('.detail-icon').length&&(t.trigger('click'===i?'click-cell':'dbl-click-cell',h,u,d,s),t.trigger('click'===i?'click-row':'dbl-click-row',d,l,h),'click'===i&&t.options.clickToSelect&&g.clickToSelect&&!t.options.ignoreClickToSelectOn(a))){var f=l.find(r.sprintf('[name="%s"]',t.options.selectItemName));f.length&&f[0].click()}}),this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click',function(i){i.preventDefault();var e=n(i.currentTarget),a=e.parent().parent(),s=a.data('index'),l=o[s];if(a.next().is('tr.detail-view'))e.find('i').attr('class',r.sprintf('%s %s',t.options.iconsPrefix,t.options.icons.detailOpen)),t.trigger('collapse-row',s,l,a.next()),a.next().remove();else{e.find('i').attr('class',r.sprintf('%s %s',t.options.iconsPrefix,t.options.icons.detailClose)),a.after(r.sprintf('',a.find('td').length));var d=a.next().find('td'),p=r.calculateObjectValue(t.options,t.options.detailFormatter,[s,l,d],'');1===d.length&&d.append(p),t.trigger('expand-row',s,l,d)}return t.resetView(),!1}),this.$selectItem=this.$body.find(r.sprintf('[name="%s"]',this.options.selectItemName)),this.$selectItem.off('click').on('click',function(o){o.stopImmediatePropagation();var e=n(o.currentTarget);t.check_(e.prop('checked'),e.data('index'))}),this.header.events.forEach(function(e,o){var a=e;if(a){'string'==typeof a&&(a=r.calculateObjectValue(null,a));var s=t.header.fields[o],l=t.getVisibleFields().indexOf(s);if(-1!==l){t.options.detailView&&!t.options.cardView&&(l+=1);for(var d=function(){if(c){if(h>=p.length)return'break';g=p[h++]}else{if(h=p.next(),h.done)return'break';g=h.value}var e=g,o=i(e,2),a=o[0],r=o[1];t.$body.find('>tr:not(.no-records-found)').each(function(e,o){var i=n(o),d=i.find(t.options.cardView?'.card-view':'td').eq(l),p=a.indexOf(' '),c=a.substring(0,p),h=a.substring(p+1);d.find(h).off(c).on(c,function(o){var e=i.data('index'),a=t.data[e],n=a[s];r.apply(t,[o,n,a,e])})})},p=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(a),c=Array.isArray(p),h=0,_iterator15=c?p:p[Symbol.iterator]();;){var g,u=d();if('break'===u)break}}}}),this.updateSelected(),this.resetView(),this.trigger('post-body',o)}},{key:'initServer',value:function(e,t,o){var i=this,a={},s=this.header.fields.indexOf(this.options.sortName),l={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if((this.header.sortNames[s]&&(l.sortName=this.header.sortNames[s]),this.options.pagination&&'server'===this.options.sidePagination&&(l.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,l.pageNumber=this.options.pageNumber),o||this.options.url||this.options.ajax)&&('limit'===this.options.queryParamsType&&(l={search:l.searchText,sort:l.sortName,order:l.sortOrder},this.options.pagination&&'server'===this.options.sidePagination&&(l.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),l.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,0===l.limit&&delete l.limit)),n.isEmptyObject(this.filterColumnsPartial)||(l.filter=JSON.stringify(this.filterColumnsPartial,null)),a=r.calculateObjectValue(this.options,this.options.queryParams,[l],a),n.extend(a,t||{}),!1!==a)){e||this.$tableLoading.show();var d=n.extend({},r.calculateObjectValue(null,this.options.ajaxOptions),{type:this.options.method,url:o||this.options.url,data:'application/json'===this.options.contentType&&'post'===this.options.method?JSON.stringify(a):a,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(t){var o=r.calculateObjectValue(i.options,i.options.responseHandler,[t],t);i.load(o),i.trigger('load-success',o),e||i.$tableLoading.hide()},error:function(t){var o=[];'server'===i.options.sidePagination&&(o={},o[i.options.totalField]=0,o[i.options.dataField]=[]),i.load(o),i.trigger('load-error',t.status,t),e||i.$tableLoading.hide()}});this.options.ajax?r.calculateObjectValue(this,this.options.ajax,[d],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=n.ajax(d))}}},{key:'initSearchText',value:function(){if(this.options.search&&(this.searchText='',''!==this.options.searchText)){var e=this.$toolbar.find('.search input');e.val(this.options.searchText),this.onSearch({currentTarget:e,firedByInitSearchText:!0})}}},{key:'getCaret',value:function(){var e=this;this.$header.find('th').each(function(t,o){n(o).find('.sortable').removeClass('desc asc').addClass(n(o).data('field')===e.options.sortName?e.options.sortOrder:'both')})}},{key:'updateSelected',value:function(){var e=this.$selectItem.filter(':enabled').length&&this.$selectItem.filter(':enabled').length===this.$selectItem.filter(':enabled').filter(':checked').length;this.$selectAll.add(this.$selectAll_).prop('checked',e),this.$selectItem.each(function(e,t){n(t).closest('tr')[n(t).prop('checked')?'addClass':'removeClass']('selected')})}},{key:'updateRows',value:function(){var e=this;this.$selectItem.each(function(t,o){e.data[n(o).data('index')][e.header.stateField]=n(o).prop('checked')})}},{key:'resetRows',value:function(){for(var e=this.data,t=Array.isArray(e),o=0,_iterator16=t?e:e[Symbol.iterator]();;){var i;if(t){if(o>=e.length)break;i=e[o++]}else{if(o=e.next(),o.done)break;i=o.value}var a=i;this.$selectAll.prop('checked',!1),this.$selectItem.prop('checked',!1),this.header.stateField&&(a[this.header.stateField]=!1)}this.initHiddenRows()}},{key:'trigger',value:function(e){for(var o,i=e+'.bs.table',a=arguments.length,s=Array(1t.clientWidth&&t.scrollHeight>t.clientHeight+this.$header.outerHeight()?r.getScrollBarWidth():0;this.$el.css('margin-top',-this.$header.outerHeight());var i=n(':focus');if(0tr:first-child:not(.no-records-found)');d.length&&d.find('>td[colspan]:not([colspan="1"])').length;)d=d.next();d.find('> *').each(function(t,o){var i=n(o),a=t;if(e.options.detailView&&!e.options.cardView){if(0===t){var d=l.filter('.detail'),p=d.width()-d.find('.fht-cell').width();d.find('.fht-cell').width(i.innerWidth()-p)}a=t-1}if(-1!==a){var c=e.$header_.find(r.sprintf('th[data-field="%s"]',s[a]));1
    ');for(var o=this.columns,a=Array.isArray(o),n=0,_iterator17=a?o:o[Symbol.iterator]();;){var s;if(a){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var l=s,d='',p='',c=[],h={},g=r.sprintf(' class="%s"',l['class']);if(l.visible){if(this.options.cardView&&!l.cardVisible)return;if(d=r.sprintf('text-align: %s; ',l.falign?l.falign:l.align),p=r.sprintf('vertical-align: %s; ',l.valign),h=r.calculateObjectValue(null,this.options.footerStyle,[l]),h&&h.css)for(var u=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(h.css),f=Array.isArray(u),b=0,_iterator18=f?u:u[Symbol.iterator]();;){var m;if(f){if(b>=u.length)break;m=u[b++]}else{if(b=u.next(),b.done)break;m=b.value}var y=m,w=i(y,2),k=w[0],v=w[1];c.push(k+': '+v)}h&&h.classes&&(g=r.sprintf(' class="%s"',l['class']?[l['class'],h.classes].join(' '):h.classes)),t.push(''),t.push('
    '),t.push(r.calculateObjectValue(l,l.footerFormatter,[e],'')),t.push('
    '),t.push('
    '),t.push(''),t.push('')}}this.$tableFooter.find('tr').html(t.join('')),this.$tableFooter.show(),this.fitFooter()}}},{key:'fitFooter',value:function(){var e=this;if(this.$el.is(':hidden'))return void setTimeout(n.proxy(this.fitFooter,this),100);var t=this.$tableBody.get(0),o=t.scrollWidth>t.clientWidth&&t.scrollHeight>t.clientHeight+this.$header.outerHeight()?r.getScrollBarWidth():0;this.$tableFooter.css('margin-right',o).find('table').css('width',this.$el.outerWidth()).attr('class',this.$el.attr('class'));for(var i=this.getVisibleFields(),a=this.$tableFooter.find('th'),s=this.$body.find('>tr:first-child:not(.no-records-found)');s.length&&s.find('>td[colspan]:not([colspan="1"])').length;)s=s.next();s.find('> *').each(function(t,o){var i=n(o),s=t;if(e.options.detailView&&!e.options.cardView){if(0===t){var l=a.filter('.detail'),r=l.width()-l.find('.fht-cell').width();l.find('.fht-cell').width(i.innerWidth()-r)}s=t-1}if(-1!==s){var d=a.eq(t),p=d.width()-d.find('.fht-cell').width();d.find('.fht-cell').width(i.innerWidth()-p)}}),this.horizontalScroll()}},{key:'horizontalScroll',value:function(){var e=this;this.trigger('scroll-body'),this.$tableBody.off('scroll').on('scroll',function(t){var o=t.currentTarget;e.options.showHeader&&e.options.height&&e.$tableHeader.scrollLeft(n(o).scrollLeft()),e.options.showFooter&&!e.options.cardView&&e.$tableFooter.scrollLeft(n(o).scrollLeft())})}},{key:'toggleColumn',value:function(e,t,o){if(-1!==e&&(this.columns[e].visible=t,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var i=this.$toolbar.find('.keep-open input').prop('disabled',!1);o&&i.filter(r.sprintf('[value="%s"]',e)).prop('checked',t),i.filter(':checked').length<=this.options.minimumCountColumns&&i.filter(':checked').prop('disabled',!0)}}},{key:'getVisibleFields',value:function(){for(var e=[],t=this.header.fields,o=Array.isArray(t),i=0,_iterator19=o?t:t[Symbol.iterator]();;){var a;if(o){if(i>=t.length)break;a=t[i++]}else{if(i=t.next(),i.done)break;a=i.value}var n=a,s=this.columns[this.fieldsColumnsIndex[n]];s.visible&&e.push(n)}return e}},{key:'resetView',value:function(e){var t=0;if(e&&e.height&&(this.options.height=e.height),this.$selectAll.prop('checked',0=o.length)break;s=o[a++]}else{if(a=o.next(),a.done)break;s=a.value}var l=s;if(l.hasOwnProperty('id')&&l.hasOwnProperty('row')){var r=this.options.data.indexOf(this.getRowByUniqueId(l.id));-1!==r&&n.extend(this.options.data[r],l.row)}}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)}},{key:'refreshColumnTitle',value:function(e){if(e.hasOwnProperty('field')&&e.hasOwnProperty('title')&&(this.columns[this.fieldsColumnsIndex[e.field]].title=this.options.escape?r.escapeHTML(e.title):e.title,this.columns[this.fieldsColumnsIndex[e.field]].visible)){var t=void 0===this.options.height?this.$header:this.$tableHeader;t.find('th[data-field]').each(function(t,o){if(n(o).data('field')===e.field)return n(n(o).find('.th-inner')[0]).text(e.title),!1})}}},{key:'insertRow',value:function(e){e.hasOwnProperty('index')&&e.hasOwnProperty('row')&&(this.options.data.splice(e.index,0,e.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},{key:'updateRow',value:function(e){for(var t=Array.isArray(e)?e:[e],o=t,i=Array.isArray(o),a=0,_iterator21=i?o:o[Symbol.iterator]();;){var s;if(i){if(a>=o.length)break;s=o[a++]}else{if(a=o.next(),a.done)break;s=a.value}var l=s;l.hasOwnProperty('index')&&l.hasOwnProperty('row')&&n.extend(this.options.data[l.index],l.row)}this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)}},{key:'initHiddenRows',value:function(){this.hiddenRows=[]}},{key:'showRow',value:function(e){this.toggleRow(e,!0)}},{key:'hideRow',value:function(e){this.toggleRow(e,!1)}},{key:'toggleRow',value:function(e,t){var o;if(e.hasOwnProperty('index')?o=this.getData()[e.index]:e.hasOwnProperty('uniqueId')&&(o=this.getRowByUniqueId(e.uniqueId)),!!o){var i=r.findIndex(this.hiddenRows,o);t||-1!==i?t&&-1=i.length)break;s=i[n++]}else{if(n=i.next(),n.done)break;s=n.value}var l=s;-1!==this.hiddenRows.indexOf(l)&&o.push(l)}return this.hiddenRows=o,o}},{key:'mergeCells',value:function(e){var t=e.index,o=this.getVisibleFields().indexOf(e.field),a=e.rowspan||1,n=e.colspan||1,s=void 0,i=void 0,l=this.$body.find('>tr');this.options.detailView&&!this.options.cardView&&(o+=1);var r=l.eq(t).find('>td').eq(o);if(!(0>t||0>o||t>=this.data.length)){for(s=t;std').eq(i).hide();r.attr('rowspan',a).attr('colspan',n).show()}}},{key:'updateCell',value:function(e){e.hasOwnProperty('index')&&e.hasOwnProperty('field')&&e.hasOwnProperty('value')&&(this.data[e.index][e.field]=e.value,!1===e.reinit||(this.initSort(),this.initBody(!0)))}},{key:'updateCellById',value:function(e){var t=this;if(e.hasOwnProperty('id')&&e.hasOwnProperty('field')&&e.hasOwnProperty('value')){var o=Array.isArray(e)?e:[e];o.forEach(function(e){var o=e.id,i=e.field,a=e.value,n=t.options.data.indexOf(t.getRowByUniqueId(o));-1===n||(t.data[n][i]=a)}),!1===e.reinit||(this.initSort(),this.initBody(!0))}}},{key:'getOptions',value:function(){var e=n.extend({},this.options);return delete e.data,n.extend(!0,{},e)}},{key:'getSelections',value:function(){var e=this;return this.options.data.filter(function(t){return!0===t[e.header.stateField]})}},{key:'getAllSelections',value:function(){var e=this;return this.options.data.filter(function(t){return t[e.header.stateField]})}},{key:'checkAll',value:function(){this.checkAll_(!0)}},{key:'uncheckAll',value:function(){this.checkAll_(!1)}},{key:'checkInvert',value:function(){var e=this.$selectItem.filter(':enabled'),t=e.filter(':checked');e.each(function(e,t){n(t).prop('checked',!n(t).prop('checked'))}),this.updateRows(),this.updateSelected(),this.trigger('uncheck-some',t),t=this.getSelections(),this.trigger('check-some',t)}},{key:'checkAll_',value:function(e){var t;e||(t=this.getSelections()),this.$selectAll.add(this.$selectAll_).prop('checked',e),this.$selectItem.filter(':enabled').prop('checked',e),this.updateRows(),e&&(t=this.getSelections()),this.trigger(e?'check-all':'uncheck-all',t)}},{key:'check',value:function(e){this.check_(!0,e)}},{key:'uncheck',value:function(e){this.check_(!1,e)}},{key:'check_',value:function(e,t){var o=this.$selectItem.filter('[data-index="'+t+'"]'),i=this.data[t];if(o.is(':radio')||this.options.singleSelect){for(var a=this.options.data,n=Array.isArray(a),s=0,_iterator23=n?a:a[Symbol.iterator]();;){var l;if(n){if(s>=a.length)break;l=a[s++]}else{if(s=a.next(),s.done)break;l=s.value}var d=l;d[this.header.stateField]=!1}this.$selectItem.filter(':checked').not(o).prop('checked',!1)}i[this.header.stateField]=e,o.prop('checked',e),this.updateSelected(),this.trigger(e?'check':'uncheck',this.data[t],o)}},{key:'checkBy',value:function(e){this.checkBy_(!0,e)}},{key:'uncheckBy',value:function(e){this.checkBy_(!1,e)}},{key:'checkBy_',value:function(e,t){var o=this;if(t.hasOwnProperty('field')&&t.hasOwnProperty('values')){var a=[];this.options.data.forEach(function(n,s){if(!n.hasOwnProperty(t.field))return!1;if(-1!==t.values.indexOf(n[t.field])){var i=o.$selectItem.filter(':enabled').filter(r.sprintf('[data-index="%s"]',s)).prop('checked',e);n[o.header.stateField]=e,a.push(n),o.trigger(e?'check':'uncheck',n,i)}}),this.updateSelected(),this.trigger(e?'check-some':'uncheck-some',a)}}},{key:'destroy',value:function(){this.$el.insertBefore(this.$container),n(this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css('margin-top','0').attr('class',this.$el_.attr('class')||'')}},{key:'showLoading',value:function(){this.$tableLoading.show()}},{key:'hideLoading',value:function(){this.$tableLoading.hide()}},{key:'togglePagination',value:function(){this.options.pagination=!this.options.pagination;var e=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?e.attr('class',this.options.iconsPrefix+' '+this.options.icons.paginationSwitchDown):e.attr('class',this.options.iconsPrefix+' '+this.options.icons.paginationSwitchUp),this.updatePagination()}},{key:'toggleFullscreen',value:function(){this.$el.closest('.bootstrap-table').toggleClass('fullscreen')}},{key:'refresh',value:function(e){e&&e.url&&(this.options.url=e.url),e&&e.pageNumber&&(this.options.pageNumber=e.pageNumber),e&&e.pageSize&&(this.options.pageSize=e.pageSize),this.initServer(e&&e.silent,e&&e.query,e&&e.url),this.trigger('refresh',e)}},{key:'resetWidth',value:function(){this.options.showHeader&&this.options.height&&this.fitHeader(),this.options.showFooter&&!this.options.cardView&&this.fitFooter()}},{key:'showColumn',value:function(e){this.toggleColumn(this.fieldsColumnsIndex[e],!0,!0)}},{key:'hideColumn',value:function(e){this.toggleColumn(this.fieldsColumnsIndex[e],!1,!0)}},{key:'getHiddenColumns',value:function(){return this.columns.filter(function(e){var t=e.visible;return!t})}},{key:'getVisibleColumns',value:function(){return this.columns.filter(function(e){var t=e.visible;return t})}},{key:'toggleAllColumns',value:function(e){for(var t=this.columns,o=Array.isArray(t),i=0,_iterator24=o?t:t[Symbol.iterator]();;){var a;if(o){if(i>=t.length)break;a=t[i++]}else{if(i=t.next(),i.done)break;a=i.value}var n=a;n.visible=e}if(this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var s=this.$toolbar.find('.keep-open input').prop('disabled',!1);s.filter(':checked').length<=this.options.minimumCountColumns&&s.filter(':checked').prop('disabled',!0)}}},{key:'showAllColumns',value:function(){this.toggleAllColumns(!0)}},{key:'hideAllColumns',value:function(){this.toggleAllColumns(!1)}},{key:'filterBy',value:function(e){this.filterColumns=n.isEmptyObject(e)?{}:e,this.options.pageNumber=1,this.initSearch(),this.updatePagination()}},{key:'scrollTo',value:function(e){if('undefined'==typeof e)return this.$tableBody.scrollTop();var t=e;'string'==typeof e&&'bottom'===e&&(t=this.$tableBody[0].scrollHeight),this.$tableBody.scrollTop(t)}},{key:'getScrollPosition',value:function(){return this.scrollTo()}},{key:'selectPage',value:function(e){0 tr[data-index="%s"]',t));o.next().is('tr.detail-view')===!e&&o.find('> td > .detail-icon').click()}},{key:'expandRow',value:function(e){this.expandRow_(!0,e)}},{key:'collapseRow',value:function(e){this.expandRow_(!1,e)}},{key:'expandAllRows',value:function(e){var t=this;if(e){var o=this.$body.find(r.sprintf('> tr[data-index="%s"]',0)),a=null,s=!1,l=-1;if(o.next().is('tr.detail-view')?!o.next().next().is('tr.detail-view')&&(o.next().find('.detail-icon').click(),s=!0):(o.find('> td > .detail-icon').click(),s=!0),s)try{l=setInterval(function(){a=t.$body.find('tr.detail-view').last().find('.detail-icon'),0