/** * bootstrap-table - An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3). * * @version v1.14.2 * @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:'',dropdownCaret:'',pagination:[''],paginationItem:'
  • %s
  • ',icon:''}},4:{theme:'bootstrap4',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',fullscreen:'fa-arrows-alt',detailOpen:'fa-plus',detailClose:'fa-minus'},classes:{buttonsPrefix:'btn',buttons:'secondary',buttonsGroup:'btn-group',buttonsDropdown:'btn-group',pull:'float',inputGroup:'',input:'form-control',paginationDropdown:'btn-group dropdown',dropup:'dropup',dropdownActive:'active',paginationActive:'active'},html:{toobarDropdow:[''],toobarDropdowItem:'',pageDropdown:[''],pageDropdownItem:'%s',dropdownCaret:'',pagination:[''],paginationItem:'
  • %s
  • ',icon:''}}}[i],r={bootstrapVersion:i,sprintf:function(e){for(var t=arguments.length,o=Array(1=o.length)break;n=o[i++]}else{if(i=o.next(),i.done)break;n=i.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=c.length)break;g=c[h++]}else{if(h=c.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=s('
    ').addClass('fixed-table-scroll-outer');t.append(e),s('body').append(t);var o=e[0].offsetWidth;t.css('overflow','scroll');var a=e[0].offsetWidth;o===a&&(a=t[0].clientWidth),t.remove(),this.cachedWidth=o-a}return this.cachedWidth},calculateObjectValue:function(e,o,a,i){var s=o;if('string'==typeof o){var h=o.split('.');if(1=l.length)break;c=l[d++]}else{if(d=l.next(),d.done)break;c=d.value}var p=c;s=s[p]}}else s=window[o]}return null!==s&&'object'===('undefined'==typeof s?'undefined':n(s))?s:'function'==typeof s?s.apply(e,a||[]):!s&&'string'==typeof o&&this.sprintf.apply(this,[o].concat(t(a)))?this.sprintf.apply(this,[o].concat(t(a))):i},compareObjects:function(e,t,o){var a=Object.keys(e),i=Object.keys(t);if(o&&a.length!==i.length)return!1;for(var n=a,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!==i.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),i=0,_iterator6=o?t:t[Symbol.iterator]();;){var n;if(o){if(i>=t.length)break;n=t[i++]}else{if(i=t.next(),i.done)break;n=i.value}var s=n,l=a(s,2),r=l[0],d=l[1],c=r.split(/(?=[A-Z])/).join('-').toLowerCase();c!==r&&(e[c]=d,delete e[r])}return e},getItemField:function(e,t,o){var a=e;if('string'!=typeof t||e.hasOwnProperty(t))return o?this.escapeHTML(e[t]):e[t];for(var i=t.split('.'),n=i,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;a=a&&a[d]}return o?this.escapeHTML(a):a},isIEBrowser:function(){return -1!==navigator.userAgent.indexOf('MSIE ')||/Trident.*rv:11\./.test(navigator.userAgent)},findIndex:function(e,t){for(var o=e,a=Array.isArray(o),i=0,_iterator8=a?o:o[Symbol.iterator]();;){var n;if(a){if(i>=o.length)break;n=o[i++]}else{if(i=o.next(),i.done)break;n=i.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,selectItemName:'btSelectItem',clickToSelect:!1,ignoreClickToSelectOn:function(e){var t=e.tagName;return -1!==['A','BUTTON'].indexOf(t)},singleSelect:!1,checkboxHeader:!0,maintainSelected:!1,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return''},detailFilter:function(){return!0},toolbar:void 0,toolbarAlign:'left',buttonsToolbar:void 0,buttonsAlign:'right',buttonsPrefix:l.classes.buttonsPrefix,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}},c={};c['en-US']=c.en={formatLoadingMessage:function(){return'Loading, please wait'},formatRecordsPerPage:function(e){return e+' rows per page'},formatShowingRows:function(e,t,o){return'Showing '+e+' to '+t+' of '+o+' rows'},formatDetailPagination:function(e){return'Showing '+e+' rows'},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'},formatColumns:function(){return'Columns'},formatFullscreen:function(){return'Fullscreen'},formatAllRows:function(){return'All'}},s.extend(d,c['en-US']);var p=function(){function t(o,a){e(this,t),this.options=a,this.$el=s(o),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()}return o(t,[{key:'init',value:function(){this.initConstants(),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:'initConstants',value:function(){var e=this.options;this.constants=l;var t=e.buttonsPrefix?e.buttonsPrefix+'-':'';this.constants.buttonsClass=[e.buttonsPrefix,t+e.buttonsClass,r.sprintf(t+'%s',e.iconSize)].join(' ').trim()}},{key:'initLocale',value:function(){if(this.options.locale){var e=s.fn.bootstrapTable.locales,t=this.options.locale.split(/-|_/);t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),e[this.options.locale]?s.extend(this.options,e[this.options.locale]):e[t.join('-')]?s.extend(this.options,e[t.join('-')]):e[t[0]]&&s.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=s('\n
    \n
    \n '+e+'\n
    \n
    \n
    \n
    \n \n '+this.options.formatLoadingMessage()+'\n \n \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?s('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.$tableLoading.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=[],a=[];if(this.$header=this.$el.find('>thead'),this.$header.length?this.options.theadClasses&&this.$header.addClass(this.options.theadClasses):this.$header=s('').appendTo(this.$el),this.$header.find('tr').each(function(e,t){var a=[];s(t).find('th').each(function(e,t){'undefined'!=typeof s(t).data('field')&&s(t).data('field',''+s(t).data('field')),a.push(s.extend({},{title:s(t).html(),class:s(t).attr('class'),titleTooltip:s(t).attr('title'),rowspan:s(t).attr('rowspan')?+s(t).attr('rowspan'):void 0,colspan:s(t).attr('colspan')?+s(t).attr('colspan'):void 0},s(t).data()))}),o.push(a)}),Array.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=s.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 n=s.extend({},t.COLUMN_DEFAULTS,o);'undefined'!=typeof n.fieldIndex&&(e.columns[n.fieldIndex]=n,e.fieldsColumnsIndex[n.field]=n.fieldIndex),e.options.columns[a][i]=n})}),!this.options.data.length){var i=[];this.$el.find('>tbody>tr').each(function(t,o){var n={};n._id=s(o).attr('id'),n._class=s(o).attr('class'),n._data=r.getRealDataAttr(s(o).data()),s(o).find('>td').each(function(o,a){for(var l=+s(a).attr('colspan')||1,d=+s(a).attr('rowspan')||1,c=o;i[t]&&i[t][c];c++);for(var h=c;h'),0===n&&!t.options.cardView&&t.options.detailView&&o.push('\n
    \n \n '),a.forEach(function(a,i){var s='',l='',d='',c='',p=r.sprintf(' class="%s"',a['class']),h='px',g=a.width;if(void 0===a.width||t.options.cardView||'string'!=typeof a.width||-1===a.width.indexOf('%')||(h='%'),a.width&&'string'==typeof a.width&&(g=a.width.replace('%','').replace('px','')),l=r.sprintf('text-align: %s; ',a.halign?a.halign:a.align),d=r.sprintf('text-align: %s; ',a.align),c=r.sprintf('vertical-align: %s; ',a.valign),c+=r.sprintf('width: %s; ',(a.checkbox||a.radio)&&!g?a.showSelectTitle?void 0:'36px':g?g+h:void 0),'undefined'!=typeof a.fieldIndex){if(t.header.fields[a.fieldIndex]=a.field,t.header.styles[a.fieldIndex]=d+c,t.header.classes[a.fieldIndex]=p,t.header.formatters[a.fieldIndex]=a.formatter,t.header.events[a.fieldIndex]=a.events,t.header.sorters[a.fieldIndex]=a.sorter,t.header.sortNames[a.fieldIndex]=a.sortName,t.header.cellStyles[a.fieldIndex]=a.cellStyle,t.header.searchables[a.fieldIndex]=a.searchable,!a.visible)return;if(t.options.cardView&&!a.cardVisible)return;e[a.field]=a}o.push(''),o.push(r.sprintf('
    ',t.options.sortable&&a.sortable?'sortable both':'')),s=t.options.escape?r.escapeHTML(a.title):a.title;var u=s;a.checkbox&&(s='',!t.options.singleSelect&&t.options.checkboxHeader&&(s=''),t.header.stateField=a.field),a.radio&&(s='',t.header.stateField=a.field,t.options.singleSelect=!0),!s&&a.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){s(o).data(e[s(o).data('field')])}),this.$container.off('click','.th-inner').on('click','.th-inner',function(o){var e=s(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&&s(o.currentTarget).data().sortable){var e=o.keyCode||o.which;13===e&&t.onSort(o)}}),s(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(),s(window).on('resize.bootstrap-table',function(o){return t.resetWidth(o)})),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off('click').on('click',function(e){var o=e.currentTarget,a=s(o).prop('checked');t[a?'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(n,a){e.header.sortNames[i]&&(t=e.header.sortNames[i]);var s=r.getItemField(n,t,e.options.escape),l=r.getItemField(a,t,e.options.escape),d=r.calculateObjectValue(e.header,e.header.sorters[i],[s,l,n,a]);return void 0===d?((void 0===s||null===s)&&(s=''),(void 0===l||null===l)&&(l=''),e.options.sortStable&&s===l&&(s=n._position,l=a._position),r.isNumeric(s)&&r.isNumeric(l))?(s=parseFloat(s),l=parseFloat(l),sl?o:0):s===l?0:('string'!=typeof s&&(s=s.toString()),-1===s.localeCompare(l)?-1*o:o):e.options.sortStable&&0===d?o*(n._position-a._position):o*d}),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,a='keypress'===t?s(o):s(o).parent(),i=this.$header.find('th').eq(a.index());return this.$header.add(this.$header_).find('span.order').remove(),this.options.sortName===a.data('field')?this.options.sortOrder='asc'===this.options.sortOrder?'desc':'asc':(this.options.sortName=a.data('field'),this.options.sortOrder=this.options.rememberOrder?'asc'===a.data('order')?'desc':'asc':this.columns[this.fieldsColumnsIndex[a.data('field')]].order),this.trigger('sort',this.options.sortName,this.options.sortOrder),a.add(i).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=this.options,o=[],a=0,i=void 0,l=void 0,d=0;this.$toolbar.find('.bs-bars').children().length&&s('body').append(s(t.toolbar)),this.$toolbar.html(''),('string'==typeof t.toolbar||'object'===n(t.toolbar))&&s(r.sprintf('
    ',this.constants.classes.pull,t.toolbarAlign)).appendTo(this.$toolbar).append(s(t.toolbar)),o=['
    '],'string'==typeof t.icons&&(t.icons=r.calculateObjectValue(null,t.icons)),t.showPaginationSwitch&&o.push(''),t.showRefresh&&o.push(''),t.showToggle&&o.push(''),t.showFullscreen&&o.push(''),t.showColumns&&(o.push('
    \n \n '+this.constants.html.toobarDropdow[0]),this.columns.forEach(function(a,n){if(!(a.radio||a.checkbox)&&(!t.cardView||a.cardVisible)){var i=a.visible?' checked="checked"':'';a.switchable&&(o.push(r.sprintf(e.constants.html.toobarDropdowItem,r.sprintf(' %s',a.field,n,i,a.title))),d++)}}),o.push(this.constants.html.toobarDropdow[1],'
    ')),o.push('
    '),(this.showToolbar||2\n \n '),this.$toolbar.append(o.join('')),l=this.$toolbar.find('.search input'),l.off('keyup drop blur').on('keyup drop blur',function(o){t.searchOnEnterKey&&13!==o.keyCode||-1!==[37,38,39,40].indexOf(o.keyCode)||(clearTimeout(a),a=setTimeout(function(){e.onSearch(o)},t.searchTimeOut))}),r.isIEBrowser()&&l.off('mouseup').on('mouseup',function(o){clearTimeout(a),a=setTimeout(function(){e.onSearch(o)},t.searchTimeOut)}))}},{key:'onSearch',value:function(e){var t=e.currentTarget,o=e.firedByInitSearchText,a=s(t).val().trim();this.options.trimOnSearch&&s(t).val()!==a&&s(t).val(a),a===this.searchText||(this.searchText=a,this.options.searchText=a,!o&&(this.options.pageNumber=1),this.initSearch(),o?'client'===this.options.sidePagination&&this.updatePagination():this.updatePagination(),this.trigger('search',a))}},{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=r.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&&(a.pageNumber=this.totalPages),this.pageFrom=(a.pageNumber-1)*a.pageSize+1,this.pageTo=a.pageNumber*a.pageSize,this.pageTo>a.totalRows&&(this.pageTo=a.totalRows);var f=a.onlyInfoPagination?a.formatDetailPagination(a.totalRows):a.formatShowingRows(this.pageFrom,this.pageTo,a.totalRows);if(o.push('
    \n \n '+f+'\n '),!a.onlyInfoPagination){o.push('');var P=['\n \n '+this.constants.html.pageDropdown[0]];if('string'==typeof a.pageList){var C=a.pageList.replace('[','').replace(']','').replace(/ /g,'').split(',');u=[];for(var b=C,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;u.push(k.toUpperCase()===a.formatAllRows().toUpperCase()||'UNLIMITED'===k.toUpperCase()?a.formatAllRows():+k)}}u.forEach(function(e,o){if(!a.smartDisplay||0===o||u[o-1]'),o.push(a.formatRecordsPerPage(P.join(''))),o.push('
    '),o.push('')}this.$pagination.html(o.join(''));var S=-1===['bottom','both'].indexOf(a.paginationVAlign)?'':' '+this.constants.classes.dropup;this.$pagination.last().find('.page-list > span').addClass(S),a.onlyInfoPagination||(d=this.$pagination.find('.page-list a'),c=this.$pagination.find('.page-pre'),p=this.$pagination.find('.page-next'),h=this.$pagination.find('.page-item').not('.page-next, .page-pre'),a.smartDisplay&&(1>=this.totalPages&&this.$pagination.find('div.pagination').hide(),(2>u.length||a.totalRows<=u[0])&&this.$pagination.find('span.page-list').hide(),this.$pagination[this.getData().length?'show':'hide']()),!a.paginationLoop&&(1===a.pageNumber&&c.addClass('disabled'),a.pageNumber===this.totalPages&&p.addClass('disabled')),n&&(a.pageSize=a.formatAllRows()),d.off('click').on('click',function(o){return t.onPageListChange(o)}),c.off('click').on('click',function(o){return t.onPagePre(o)}),p.off('click').on('click',function(o){return t.onPageNext(o)}),h.off('click').on('click',function(o){return t.onPageNumber(o)}))}},{key:'updatePagination',value:function(e){e&&s(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=s(e.currentTarget);return t.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive),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!==+s(e.currentTarget).text())return this.options.pageNumber=+s(e.currentTarget).text(),this.updatePagination(e),!1}},{key:'initRow',value:function(e,t){var o=this,i=[],n={},s=[],l='',d={},c=[];if(!(-1=p.length)break;u=p[g++]}else{if(g=p.next(),g.done)break;u=g.value}var f=u,b=a(f,2),m=b[0],y=b[1];s.push(m+': '+y)}if(d=r.calculateObjectValue(this.options,this.options.rowAttributes,[e,t],d),d)for(var w=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(d),x=Array.isArray(w),S=0,_iterator11=x?w:w[Symbol.iterator]();;){var $;if(x){if(S>=w.length)break;$=w[S++]}else{if(S=w.next(),S.done)break;$=S.value}var P=$,C=a(P,2),T=C[0],A=C[1];c.push(T+'="'+r.escapeHTML(A)+'"')}if(e._data&&!r.isEmptyObject(e._data))for(var O=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(e._data),I=Array.isArray(O),R=0,_iterator12=I?O:O[Symbol.iterator]();;){var _;if(I){if(R>=O.length)break;_=O[R++]}else{if(R=O.next(),R.done)break;_=R.value}var V=_,F=a(V,2),B=F[0],k=F[1];if('index'===B)return;l+=' data-'+B+'="'+k+'"'}return i.push(''),this.options.cardView&&i.push('
    '),!this.options.cardView&&this.options.detailView&&(i.push(''),r.calculateObjectValue(null,this.options.detailFilter,[t,e])&&i.push('\n \n '+r.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.detailOpen)+'\n \n '),i.push('')),this.header.fields.forEach(function(n,l){var d='',p=r.getItemField(e,n,o.options.escape),h='',g='',u={},f='',b=o.header.classes[l],m='',y='',w='',k='',v='',x=o.columns[l];if((!o.fromHtml||'undefined'!=typeof p||x.checkbox||x.radio)&&x.visible&&(!o.options.cardView||x.cardVisible)){if(x.escape&&(p=r.escapeHTML(p)),s.concat([o.header.styles[l]]).length&&(m=' style="'+s.concat([o.header.styles[l]]).join('; ')+'"'),e['_'+n+'_id']&&(f=r.sprintf(' id="%s"',e['_'+n+'_id'])),e['_'+n+'_class']&&(b=r.sprintf(' class="%s"',e['_'+n+'_class'])),e['_'+n+'_rowspan']&&(w=r.sprintf(' rowspan="%s"',e['_'+n+'_rowspan'])),e['_'+n+'_colspan']&&(k=r.sprintf(' colspan="%s"',e['_'+n+'_colspan'])),e['_'+n+'_title']&&(v=r.sprintf(' title="%s"',e['_'+n+'_title'])),u=r.calculateObjectValue(o.header,o.header.cellStyles[l],[p,e,t,n],u),u.classes&&(b=' class="'+u.classes+'"'),u.css){for(var S=[],$=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(u.css),P=Array.isArray($),C=0,_iterator13=P?$:$[Symbol.iterator]();;){var T;if(P){if(C>=$.length)break;T=$[C++]}else{if(C=$.next(),C.done)break;T=C.value}var A=T,O=a(A,2),I=O[0],R=O[1];S.push(I+': '+R)}m=' style="'+S.concat(o.header.styles[l]).join('; ')+'"'}if(h=r.calculateObjectValue(x,o.header.formatters[l],[p,e,t,n],p),e['_'+n+'_data']&&!r.isEmptyObject(e['_'+n+'_data']))for(var _=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(e['_'+n+'_data']),V=Array.isArray(_),F=0,_iterator14=V?_:_[Symbol.iterator]();;){var B;if(V){if(F>=_.length)break;B=_[F++]}else{if(F=_.next(),F.done)break;B=F.value}var N=B,j=a(N,2),H=j[0],L=j[1];if('index'===H)return;y+=' data-'+H+'="'+L+'"'}if(x.checkbox||x.radio){g=x.checkbox?'checkbox':g,g=x.radio?'radio':g;var D=x['class']||'',c=!0===h||p||h&&h.checked,E=!x.checkboxEnabled||h&&h.disabled;d=[o.options.cardView?'
    ':'','',o.header.formatters[l]&&'string'==typeof h?h:'',o.options.cardView?'
    ':''].join(''),e[o.header.stateField]=!0===h||!!p||h&&h.checked}else if(h='undefined'==typeof h||null===h?o.options.undefinedText:h,o.options.cardView){var U=o.options.showHeader?''+r.getFieldTitle(o.columns,n)+'':'';d='
    '+U+''+h+'
    ',o.options.smartDisplay&&''===h&&(d='
    ')}else d=''+h+'';i.push(d)}}),this.options.cardView&&i.push('
    '),i.push(''),i.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=s('').appendTo(this.$el)),this.options.pagination&&'server'!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=o.length);for(var n=s(document.createDocumentFragment()),l=!1,d=this.pageFrom-1;d'+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,a=e.type,i=e.target,n=s(o),l=n.parent(),d=s(i).parents('.card-views').children(),c=s(i).parents('.card-view'),p=t.data[l.data('index')],h=t.options.cardView?d.index(c):n[0].cellIndex,g=t.getVisibleFields(),u=g[t.options.detailView&&!t.options.cardView?h-1:h],f=t.columns[t.fieldsColumnsIndex[u]],b=r.getItemField(p,u,t.options.escape);if(!n.find('.detail-icon').length&&(t.trigger('click'===a?'click-cell':'dbl-click-cell',u,b,p,n),t.trigger('click'===a?'click-row':'dbl-click-row',p,l,u),'click'===a&&t.options.clickToSelect&&f.clickToSelect&&!r.calculateObjectValue(t.options,t.options.ignoreClickToSelectOn,[i]))){var m=l.find(r.sprintf('[name="%s"]',t.options.selectItemName));m.length&&m[0].click()}}),this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click',function(a){a.preventDefault();var e=s(a.currentTarget),i=e.parent().parent(),n=i.data('index'),l=o[n];if(i.next().is('tr.detail-view'))e.html(r.sprintf(t.constants.html.icon,t.options.iconsPrefix,t.options.icons.detailOpen)),t.trigger('collapse-row',n,l,i.next()),i.next().remove();else{e.html(r.sprintf(t.constants.html.icon,t.options.iconsPrefix,t.options.icons.detailClose)),i.after(r.sprintf('',i.children('td').length));var d=i.next().find('td'),c=r.calculateObjectValue(t.options,t.options.detailFormatter,[n,l,d],'');1===d.length&&d.append(c),t.trigger('expand-row',n,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=s(o.currentTarget);t.check_(e.prop('checked'),e.data('index'))}),this.header.events.forEach(function(e,o){var i=e;if(i){'string'==typeof i&&(i=r.calculateObjectValue(null,i));var n=t.header.fields[o],l=t.getVisibleFields().indexOf(n);if(-1!==l){t.options.detailView&&!t.options.cardView&&(l+=1);for(var d=function(){if(p){if(h>=c.length)return'break';g=c[h++]}else{if(h=c.next(),h.done)return'break';g=h.value}var e=g,o=a(e,2),r=o[0],i=o[1];t.$body.find('>tr:not(.no-records-found)').each(function(e,o){var a=s(o),d=a.find(t.options.cardView?'.card-view':'td').eq(l),c=r.indexOf(' '),p=r.substring(0,c),h=r.substring(c+1);d.find(h).off(p).on(p,function(o){var e=a.data('index'),s=t.data[e],l=s[n];i.apply(t,[o,l,s,e])})})},c=function(e){return Object.keys(e).map(function(t){return[t,e[t]]})}(i),p=Array.isArray(c),h=0,_iterator15=p?c:c[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 a=this,i={},n=this.header.fields.indexOf(this.options.sortName),l={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};if((this.header.sortNames[n]&&(l.sortName=this.header.sortNames[n]),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)),r.isEmptyObject(this.filterColumnsPartial)||(l.filter=JSON.stringify(this.filterColumnsPartial,null)),i=r.calculateObjectValue(this.options,this.options.queryParams,[l],i),s.extend(i,t||{}),!1!==i)){e||this.showLoading();var d=s.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(i):i,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(t){var o=r.calculateObjectValue(a.options,a.options.responseHandler,[t],t);a.load(o),a.trigger('load-success',o),e||a.hideLoading()},error:function(t){var o=[];'server'===a.options.sidePagination&&(o={},o[a.options.totalField]=0,o[a.options.dataField]=[]),a.load(o),a.trigger('load-error',t.status,t),e||a.$tableLoading.hide()}});return this.options.ajax?r.calculateObjectValue(this,this.options.ajax,[d],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=s.ajax(d)),i}}},{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){s(o).find('.sortable').removeClass('desc asc').addClass(s(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){s(t).closest('tr')[s(t).prop('checked')?'addClass':'removeClass']('selected')})}},{key:'updateRows',value:function(){var e=this;this.$selectItem.each(function(t,o){e.data[s(o).data('index')][e.header.stateField]=s(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 a;if(t){if(o>=e.length)break;a=e[o++]}else{if(o=e.next(),o.done)break;a=o.value}var i=a;this.$selectAll.prop('checked',!1),this.$selectItem.prop('checked',!1),this.header.stateField&&(i[this.header.stateField]=!1)}this.initHiddenRows()}},{key:'trigger',value:function(e){for(var o,a=e+'.bs.table',i=arguments.length,n=Array(1t.clientWidth&&t.scrollHeight>t.clientHeight+this.$header.outerHeight()?r.getScrollBarWidth():0;this.$el.css('margin-top',-this.$header.outerHeight());var a=s(':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 a=s(o),i=t;if(e.options.detailView&&!e.options.cardView){if(0===t){var d=l.filter('.detail'),c=d.width()-d.find('.fht-cell').width();d.find('.fht-cell').width(a.innerWidth()-c)}i=t-1}if(-1!==i){var p=e.$header_.find(r.sprintf('th[data-field="%s"]',n[i]));1
    ');for(var o=this.columns,i=Array.isArray(o),n=0,_iterator17=i?o:o[Symbol.iterator]();;){var s;if(i){if(n>=o.length)break;s=o[n++]}else{if(n=o.next(),n.done)break;s=n.value}var l=s,d='',c='',p=[],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),c=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=a(y,2),k=w[0],v=w[1];p.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(function(){return e.fitFooter()},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 a=this.getVisibleFields(),n=this.$tableFooter.find('th'),i=this.$body.find('>tr:first-child:not(.no-records-found)');i.length&&i.find('>td[colspan]:not([colspan="1"])').length;)i=i.next();i.find('> *').each(function(t,o){var a=s(o),i=t;if(e.options.detailView&&!e.options.cardView){if(0===t){var l=n.filter('.detail'),r=l.width()-l.find('.fht-cell').width();l.find('.fht-cell').width(a.innerWidth()-r)}i=t-1}if(-1!==i){var d=n.eq(t),c=d.width()-d.find('.fht-cell').width();d.find('.fht-cell').width(a.innerWidth()-c)}}),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(s(o).scrollLeft()),e.options.showFooter&&!e.options.cardView&&e.$tableFooter.scrollLeft(s(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 a=this.$toolbar.find('.keep-open input').prop('disabled',!1);o&&a.filter(r.sprintf('[value="%s"]',e)).prop('checked',t),a.filter(':checked').length<=this.options.minimumCountColumns&&a.filter(':checked').prop('disabled',!0)}}},{key:'getVisibleFields',value:function(){for(var e=[],t=this.header.fields,o=Array.isArray(t),a=0,_iterator19=o?t:t[Symbol.iterator]();;){var i;if(o){if(a>=t.length)break;i=t[a++]}else{if(a=t.next(),a.done)break;i=a.value}var n=i,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;n=o[i++]}else{if(i=o.next(),i.done)break;n=i.value}var l=n;if(l.hasOwnProperty('id')&&l.hasOwnProperty('row')){var r=this.options.data.indexOf(this.getRowByUniqueId(l.id));-1!==r&&s.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(s(o).data('field')===e.field)return s(s(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,a=Array.isArray(o),i=0,_iterator21=a?o:o[Symbol.iterator]();;){var n;if(a){if(i>=o.length)break;n=o[i++]}else{if(i=o.next(),i.done)break;n=i.value}var l=n;l.hasOwnProperty('index')&&l.hasOwnProperty('row')&&s.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 a=r.findIndex(this.hiddenRows,o);t||-1!==a?t&&-1=a.length)break;s=a[n++]}else{if(n=a.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,a=e.field,i=e.value,n=t.options.data.indexOf(t.getRowByUniqueId(o));-1===n||(t.data[n][a]=i)}),!1===e.reinit||(this.initSort(),this.initBody(!0))}}},{key:'getOptions',value:function(){var e=JSON.parse(JSON.stringify(this.options));return delete e.data,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){s(t).prop('checked',!s(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+'"]'),a=this.data[t];if(o.is(':radio')||this.options.singleSelect){for(var i=this.options.data,n=Array.isArray(i),s=0,_iterator23=n?i:i[Symbol.iterator]();;){var l;if(n){if(s>=i.length)break;l=i[s++]}else{if(s=i.next(),s.done)break;l=s.value}var d=l;d[this.header.stateField]=!1}this.$selectItem.filter(':checked').not(o).prop('checked',!1)}a[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),s(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.css('display','flex')}},{key:'hideLoading',value:function(){this.$tableLoading.css('display','none')}},{key:'togglePagination',value:function(){this.options.pagination=!this.options.pagination,this.$toolbar.find('button[name="paginationSwitch"]').html(r.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.pagination?this.options.icons.paginationSwitchDown:this.options.icons.paginationSwitchUp)),this.updatePagination()}},{key:'toggleFullscreen',value:function(){this.$el.closest('.bootstrap-table').toggleClass('fullscreen'),this.resetView()}},{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.trigger('refresh',this.initServer(e&&e.silent,e&&e.query,e&&e.url))}},{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),a=0,_iterator24=o?t:t[Symbol.iterator]();;){var i;if(o){if(a>=t.length)break;i=t[a++]}else{if(a=t.next(),a.done)break;i=a.value}var n=i;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=r.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,n=!1,l=-1;if(o.next().is('tr.detail-view')?!o.next().next().is('tr.detail-view')&&(o.next().find('.detail-icon').click(),n=!0):(o.find('> td > .detail-icon').click(),n=!0),n)try{l=setInterval(function(){a=t.$body.find('tr.detail-view').last().find('.detail-icon'),0