/** * 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