/** * bootstrap-table - An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3). * * @version v1.13.0 * @homepage http://bootstrap-table.wenzhixin.net.cn * @author wenzhixin (http://wenzhixin.net.cn/) * @license MIT */ (function(a,b){if('function'==typeof define&&define.amd)define([],b);else if('undefined'!=typeof exports)b();else{b(),a.bootstrapTableToolbar={exports:{}}.exports}})(this,function(){'use strict';function a(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function b(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function c(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var d=function(){function a(a,b){for(var c,d=0;d\n \n \n \n '}},4:{icons:{advancedSearchIcon:'fa-chevron-down'},html:{modalHeader:'\n \n '}}}[g.bootstrapVersion];f.extend(f.fn.bootstrapTable.defaults,{advancedSearch:!1,idForm:'advancedSearch',actionForm:'',idTable:void 0,onColumnAdvancedSearch:function(){return!1}}),f.extend(f.fn.bootstrapTable.defaults.icons,{advancedSearchIcon:h.icons.advancedSearchIcon}),f.extend(f.fn.bootstrapTable.Constructor.EVENTS,{"column-advanced-search.bs.table":'onColumnAdvancedSearch'}),f.extend(f.fn.bootstrapTable.locales,{formatAdvancedSearch:function(){return'Advanced search'},formatAdvancedCloseButton:function(){return'Close'}}),f.extend(f.fn.bootstrapTable.defaults,f.fn.bootstrapTable.locales),f.BootstrapTable=function(i){function j(){return a(this,j),b(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return c(j,i),d(j,[{key:'initToolbar',value:function(){var a=this,b=this.options;this.showToolbar=this.showToolbar||b.search&&b.advancedSearch&&b.idTable,e(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),'initToolbar',this).call(this),b.search&&b.advancedSearch&&b.idTable&&(this.$toolbar.find('>.btn-group').append('\n \n '),this.$toolbar.find('button[name="advancedSearch"]').off('click').on('click',function(){return a.showAvdSearch()}))}},{key:'showAvdSearch',value:function(){var a=this,b=this.options;if(!f('#avdSearchModal_'+b.idTable).hasClass('modal')){f('body').append('\n \n ');var c=0;f('#avdSearchModalContent_'+b.idTable).append(this.createFormAvd().join('')),f('#'+b.idForm).off('keyup blur','input').on('keyup blur','input',function(d){'server'===b.sidePagination?a.onColumnAdvancedSearch(d):(clearTimeout(c),c=setTimeout(function(){a.onColumnAdvancedSearch(d)},b.searchTimeOut))}),f('#btnCloseAvd_'+b.idTable).click(function(){f('#avdSearchModal_'+b.idTable).modal('hide'),'server'===b.sidePagination&&(a.options.pageNumber=1,a.updatePagination(),a.trigger('column-advanced-search',a.filterColumnsPartial))}),f('#avdSearchModal_'+b.idTable).modal()}else f('#avdSearchModal_'+b.idTable).modal()}},{key:'createFormAvd',value:function(){var a=this.options,b=['
'],c=!0,d=!1,e=void 0;try{for(var f,g,h=this.columns[Symbol.iterator]();!(c=(f=h.next()).done);c=!0)g=f.value,!g.checkbox&&g.visible&&g.searchable&&b.push('\n
\n \n
\n \n
\n
\n ')}catch(a){d=!0,e=a}finally{try{!c&&h.return&&h.return()}finally{if(d)throw e}}return b.push('
'),b}},{key:'initSearch',value:function(){var a=this;if(e(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),'initSearch',this).call(this),this.options.advancedSearch&&'server'!==this.options.sidePagination){var b=f.isEmptyObject(this.filterColumnsPartial)?null:this.filterColumnsPartial;this.data=b?f.grep(this.data,function(c,d){for(var i in b){var e=b[i].toLowerCase(),f=c[i],h=a.header.fields.indexOf(i);if(f=g.calculateObjectValue(a.header,a.header.formatters[h],[f,c,d],f),!(-1!==h&&('string'==typeof f||'number'==typeof f)&&(''+f).toLowerCase().includes(e)))return!1}return!0}):this.data}}},{key:'onColumnAdvancedSearch',value:function(a){var b=f.trim(f(a.currentTarget).val()),c=f(a.currentTarget)[0].id;f.isEmptyObject(this.filterColumnsPartial)&&(this.filterColumnsPartial={}),b?this.filterColumnsPartial[c]=b:delete this.filterColumnsPartial[c],'server'!==this.options.sidePagination&&(this.options.pageNumber=1,this.onSearch(a),this.updatePagination(),this.trigger('column-advanced-search',c,b))}}]),j}(f.BootstrapTable)})(jQuery)});