UNPKG

17.8 kBJavaScriptView Raw
1/**
2 * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
3 *
4 * @version v1.15.3
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],b):(a=a||self,b(a.jQuery))})(this,function(a){'use strict';var c=Math.max,d=Math.min,e=Math.floor;function b(a,b){return b={exports:{}},a(b,b.exports),b.exports}a=a&&a.hasOwnProperty("default")?a["default"]:a;var g,h,i,j="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,k="object",l=function(a){return a&&a.Math==Math&&a},m=l(typeof globalThis==k&&globalThis)||l(typeof window==k&&window)||l(typeof self==k&&self)||l(typeof j==k&&j)||Function("return this")(),n=function(a){try{return!!a()}catch(a){return!0}},o=!n(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),p={}.propertyIsEnumerable,q=Object.getOwnPropertyDescriptor,r=q&&!p.call({1:2},1),s=r?function(a){var b=q(this,a);return!!b&&b.enumerable}:p,f={f:s},t=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},u={}.toString,v=function(a){return u.call(a).slice(8,-1)},w="".split,x=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(a){return"String"==v(a)?w.call(a,""):Object(a)}:Object,y=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},z=function(a){return x(y(a))},A=function(a){return"object"==typeof a?null!==a:"function"==typeof a},B=function(a,b){if(!A(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!A(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!A(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!A(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},C={}.hasOwnProperty,D=function(a,b){return C.call(a,b)},E=m.document,F=A(E)&&A(E.createElement),G=function(a){return F?E.createElement(a):{}},H=!o&&!n(function(){return 7!=Object.defineProperty(G("div"),"a",{get:function(){return 7}}).a}),I=Object.getOwnPropertyDescriptor,J=o?I:function(a,b){if(a=z(a),b=B(b,!0),H)try{return I(a,b)}catch(a){}return D(a,b)?t(!f.f.call(a,b),a[b]):void 0},K={f:J},L=function(a){if(!A(a))throw TypeError(a+" is not an object");return a},M=Object.defineProperty,N=o?M:function(a,b,c){if(L(a),b=B(b,!0),L(c),H)try{return M(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported");return"value"in c&&(a[b]=c.value),a},P={f:N},Q=o?function(a,b,c){return P.f(a,b,t(1,c))}:function(a,b,c){return a[b]=c,a},R=function(a,b){try{Q(m,a,b)}catch(c){m[a]=b}return b},S=b(function(a){var b=m["__core-js_shared__"]||R("__core-js_shared__",{});(a.exports=function(a,c){return b[a]||(b[a]=c===void 0?{}:c)})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),T=S("native-function-to-string",Function.toString),U=m.WeakMap,V="function"==typeof U&&/native code/.test(T.call(U)),W=0,O=Math.random(),X=function(a){return"Symbol("+((a===void 0?"":a)+"")+")_"+(++W+O).toString(36)},Y=S("keys"),Z=function(a){return Y[a]||(Y[a]=X(a))},_={},aa=m.WeakMap,ba=function(a){return i(a)?h(a):g(a,{})};if(V){var ca=new aa,da=ca.get,ea=ca.has,fa=ca.set;g=function(a,b){return fa.call(ca,a,b),b},h=function(a){return da.call(ca,a)||{}},i=function(a){return ea.call(ca,a)}}else{var ga=Z("state");_[ga]=!0,g=function(a,b){return Q(a,ga,b),b},h=function(a){return D(a,ga)?a[ga]:{}},i=function(a){return D(a,ga)}}var ha={set:g,get:h,has:i,enforce:ba,getterFor:function(a){return function(b){var c;if(!A(b)||(c=h(b)).type!==a)throw TypeError("Incompatible receiver, "+a+" required");return c}}},ia=b(function(a){var b=ha.get,c=ha.enforce,d=(T+"").split("toString");S("inspectSource",function(a){return T.call(a)}),(a.exports=function(a,b,e,f){var g=!!f&&!!f.unsafe,h=!!f&&!!f.enumerable,i=!!f&&!!f.noTargetGet;return("function"==typeof e&&("string"==typeof b&&!D(e,"name")&&Q(e,"name",b),c(e).source=d.join("string"==typeof b?b:"")),a===m)?void(h?a[b]=e:R(b,e)):void(g?!i&&a[b]&&(h=!0):delete a[b],h?a[b]=e:Q(a,b,e))})(Function.prototype,"toString",function(){return"function"==typeof this&&b(this).source||T.call(this)})}),ja=m,ka=function(a){return"function"==typeof a?a:void 0},la=function(a,b){return 2>arguments.length?ka(ja[a])||ka(m[a]):ja[a]&&ja[a][b]||m[a]&&m[a][b]},ma=Math.ceil,na=function(a){return isNaN(a=+a)?0:(0<a?e:ma)(a)},oa=function(a){return 0<a?d(na(a),9007199254740991):0},pa=function(a,b){var e=na(a);return 0>e?c(e+b,0):d(e,b)},qa=function(a){return function(b,c,d){var e,f=z(b),g=oa(f.length),h=pa(d,g);if(a&&c!=c){for(;g>h;)if(e=f[h++],e!=e)return!0;}else for(;g>h;h++)if((a||h in f)&&f[h]===c)return a||h||0;return!a&&-1}},ra={includes:qa(!0),indexOf:qa(!1)},sa=ra.indexOf,ta=function(a,b){var c,d=z(a),e=0,f=[];for(c in d)!D(_,c)&&D(d,c)&&f.push(c);for(;b.length>e;)D(d,c=b[e++])&&(~sa(f,c)||f.push(c));return f},ua=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],va=ua.concat("length","prototype"),wa=Object.getOwnPropertyNames||function(a){return ta(a,va)},xa={f:wa},ya=Object.getOwnPropertySymbols,za={f:ya},Aa=la("Reflect","ownKeys")||function(a){var b=xa.f(L(a)),c=za.f;return c?b.concat(c(a)):b},Ba=function(a,b){for(var c,d=Aa(b),e=P.f,f=K.f,g=0;g<d.length;g++)c=d[g],D(a,c)||e(a,c,f(b,c))},Ca=/#|\.prototype\./,Da=function(a,b){var c=Fa[Ea(a)];return!(c!=Ha)||c!=Ga&&("function"==typeof b?n(b):!!b)},Ea=Da.normalize=function(a){return(a+"").replace(Ca,".").toLowerCase()},Fa=Da.data={},Ga=Da.NATIVE="N",Ha=Da.POLYFILL="P",Ia=K.f,Ja=function(a,b){var c,d,e,f,g,h,i=a.target,j=a.global,k=a.stat;if(d=j?m:k?m[i]||R(i,{}):(m[i]||{}).prototype,d)for(e in b){if(g=b[e],a.noTargetGet?(h=Ia(d,e),f=h&&h.value):f=d[e],c=Da(j?e:i+(k?".":"#")+e,a.forced),!c&&void 0!==f){if(typeof g==typeof f)continue;Ba(g,f)}(a.sham||f&&f.sham)&&Q(g,"sham",!0),ia(d,e,g,a)}},Ka=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function");return a},La=function(d,e,f){return(Ka(d),void 0===e)?d:0===f?function(){return d.call(e)}:1===f?function(b){return d.call(e,b)}:2===f?function(c,a){return d.call(e,c,a)}:3===f?function(f,a,b){return d.call(e,f,a,b)}:function(){return d.apply(e,arguments)}},Ma=function(a){return Object(y(a))},Na=Array.isArray||function(a){return"Array"==v(a)},Oa=!!Object.getOwnPropertySymbols&&!n(function(){return!(Symbol()+"")}),Pa=m.Symbol,Qa=S("wks"),Ra=function(a){return Qa[a]||(Qa[a]=Oa&&Pa[a]||(Oa?Pa:X)("Symbol."+a))},Sa=Ra("species"),Ta=function(a,b){var c;return Na(a)&&(c=a.constructor,"function"==typeof c&&(c===Array||Na(c.prototype))?c=void 0:A(c)&&(c=c[Sa],null===c&&(c=void 0))),new(void 0===c?Array:c)(0===b?0:b)},Ua=[].push,Va=function(a){var b=1==a,c=4==a,d=6==a;return function(e,f,g,h){for(var i,j,k=Ma(e),l=x(k),m=La(f,g,3),n=oa(l.length),o=0,p=h||Ta,q=b?p(e,n):2==a?p(e,0):void 0;n>o;o++)if((5==a||d||o in l)&&(i=l[o],j=m(i,o,k),a))if(b)q[o]=j;else if(j)switch(a){case 3:return!0;case 5:return i;case 6:return o;case 2:Ua.call(q,i);}else if(c)return!1;return d?-1:3==a||c?c:q}},Wa={forEach:Va(0),map:Va(1),filter:Va(2),some:Va(3),every:Va(4),find:Va(5),findIndex:Va(6)},Xa=Ra("species"),Ya=function(a){return!n(function(){var b=[],c=b.constructor={};return c[Xa]=function(){return{foo:1}},1!==b[a](Boolean).foo})},Za=Wa.filter;Ja({target:"Array",proto:!0,forced:!Ya("filter")},{filter:function(a){return Za(this,a,1<arguments.length?arguments[1]:void 0)}});var $a=Object.keys||function(a){return ta(a,ua)},_a=o?Object.defineProperties:function(a,b){L(a);for(var c,d=$a(b),e=d.length,f=0;e>f;)P.f(a,c=d[f++],b[c]);return a},ab=la("document","documentElement"),bb=Z("IE_PROTO"),cb="prototype",db=function(){},eb=function(){var a,b=G("iframe"),c=ua.length,d="<",e="script",f=">";for(b.style.display="none",ab.appendChild(b),b.src="java"+e+":"+"",a=b.contentWindow.document,a.open(),a.write(d+e+f+"document.F=Object"+d+"/"+e+f),a.close(),eb=a.F;c--;)delete eb[cb][ua[c]];return eb()},fb=Object.create||function(a,b){var c;return null===a?c=eb():(db[cb]=L(a),c=new db,db[cb]=null,c[bb]=a),void 0===b?c:_a(c,b)};_[bb]=!0;var gb=Ra("unscopables"),hb=Array.prototype;hb[gb]==null&&Q(hb,gb,fb(null));var ib=Wa.find,jb="find",kb=!0;jb in[]&&[,][jb](function(){kb=!1}),Ja({target:"Array",proto:!0,forced:kb},{find:function(a){return ib(this,a,1<arguments.length?arguments[1]:void 0)}}),function(a){hb[gb][a]=!0}(jb);var lb=function(a,b){var c=[][a];return!c||!n(function(){c.call(null,b||function(){throw 1},1)})},mb=[].join,nb=x!=Object,ob=lb("join",",");Ja({target:"Array",proto:!0,forced:nb||ob},{join:function(a){return mb.call(z(this),a===void 0?",":a)}});var pb=function(a,b,c){var d=B(b);d in a?P.f(a,d,t(0,c)):a[d]=c},qb=Ra("species"),rb=[].slice;Ja({target:"Array",proto:!0,forced:!Ya("slice")},{slice:function(a,b){var d,e,f,g=z(this),h=oa(g.length),i=pa(a,h),j=pa(void 0===b?h:b,h);if(Na(g)&&(d=g.constructor,"function"==typeof d&&(d===Array||Na(d.prototype))?d=void 0:A(d)&&(d=d[qb],null===d&&(d=void 0)),d===Array||void 0===d))return rb.call(g,i,j);for(e=new(void 0===d?Array:d)(c(j-i,0)),f=0;i<j;i++,f++)i in g&&pb(e,f,g[i]);return e.length=f,e}});var sb=[].sort,tb=[1,2,3],ub=n(function(){tb.sort(void 0)}),vb=n(function(){tb.sort(null)}),wb=lb("sort");Ja({target:"Array",proto:!0,forced:ub||!vb||wb},{sort:function(a){return a===void 0?sb.call(Ma(this)):sb.call(Ma(this),Ka(a))}});var xb=P.f,yb=Function.prototype,zb=yb.toString,Ab=/^\s*function ([^ (]*)/,Bb="name";o&&!(Bb in yb)&&xb(yb,Bb,{configurable:!0,get:function(){try{return zb.call(this).match(Ab)[1]}catch(a){return""}}});var Cb=function(){var a=L(this),b="";return a.global&&(b+="g"),a.ignoreCase&&(b+="i"),a.multiline&&(b+="m"),a.dotAll&&(b+="s"),a.unicode&&(b+="u"),a.sticky&&(b+="y"),b},Db=RegExp.prototype.exec,Eb=String.prototype.replace,Fb=Db,Gb=function(){var a=/a/,b=/b*/g;return Db.call(a,"a"),Db.call(b,"a"),0!==a.lastIndex||0!==b.lastIndex}(),Hb=/()??/.exec("")[1]!==void 0;(Gb||Hb)&&(Fb=function(a){var b,c,d,e,f=this;return Hb&&(c=new RegExp("^"+f.source+"$(?!\\s)",Cb.call(f))),Gb&&(b=f.lastIndex),d=Db.call(f,a),Gb&&d&&(f.lastIndex=f.global?d.index+d[0].length:b),Hb&&d&&1<d.length&&Eb.call(d[0],c,function(){for(e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(d[e]=void 0)}),d});var Ib=Fb,Jb=Ra("species"),Kb=!n(function(){var a=/./;return a.exec=function(){var a=[];return a.groups={a:"7"},a},"7"!=="".replace(a,"$<a>")}),Lb=!n(function(){var a=/(?:)/,b=a.exec;a.exec=function(){return b.apply(this,arguments)};var c="ab".split(a);return 2!==c.length||"a"!==c[0]||"b"!==c[1]}),Mb=function(a){return function(b,c){var d,e,f=y(b)+"",g=na(c),h=f.length;return 0>g||g>=h?a?"":void 0:(d=f.charCodeAt(g),55296>d||56319<d||g+1===h||56320>(e=f.charCodeAt(g+1))||57343<e?a?f.charAt(g):d:a?f.slice(g,g+2):(d-55296<<10)+(e-56320)+65536)}},Nb={codeAt:Mb(!1),charAt:Mb(!0)},Ob=Nb.charAt,Pb=function(a,b,c){return b+(c?Ob(a,b).length:1)},Qb=function(a,b){var c=a.exec;if("function"==typeof c){var d=c.call(a,b);if("object"!=typeof d)throw TypeError("RegExp exec method returned something other than an Object or null");return d}if("RegExp"!==v(a))throw TypeError("RegExp#exec called on incompatible receiver");return Ib.call(a,b)},Rb=/\$([$&'`]|\d\d?|<[^>]*>)/g,Sb=/\$([$&'`]|\d\d?)/g,Tb=function(a){return a===void 0?a:a+""};(function(a,b,c,d){var e=Ra(a),f=!n(function(){var b={};return b[e]=function(){return 7},7!=""[a](b)}),g=f&&!n(function(){var b=!1,c=/a/;return c.exec=function(){return b=!0,null},"split"===a&&(c.constructor={},c.constructor[Jb]=function(){return c}),c[e](""),!b});if(!f||!g||"replace"===a&&!Kb||"split"===a&&!Lb){var h=/./[e],i=c(e,""[a],function(a,b,c,d,e){return b.exec===Ib?f&&!e?{done:!0,value:h.call(b,c,d)}:{done:!0,value:a.call(c,b,d)}:{done:!1}}),j=i[0],k=i[1];ia(String.prototype,a,j),ia(RegExp.prototype,e,2==b?function(a,b){return k.call(a,this,b)}:function(a){return k.call(a,this)}),d&&Q(RegExp.prototype[e],"sham",!0)}})("replace",2,function(a,b,f){function g(a,c,d,g,h,i){var j=d+a.length,k=g.length,f=Sb;return void 0!==h&&(h=Ma(h),f=Rb),b.call(i,f,function(b,i){var l;switch(i.charAt(0)){case"$":return"$";case"&":return a;case"`":return c.slice(0,d);case"'":return c.slice(j);case"<":l=h[i.slice(1,-1)];break;default:var m=+i;if(0==m)return b;if(m>k){var n=e(m/10);return 0===n?b:n<=k?void 0===g[n-1]?i.charAt(1):g[n-1]+i.charAt(1):b}l=g[m-1];}return void 0===l?"":l})}return[function(c,d){var e=y(this),f=c==null?void 0:c[a];return f===void 0?b.call(e+"",c,d):f.call(c,e,d)},function(a,e){var h=f(b,a,this,e);if(h.done)return h.value;var k=L(a),l=this+"",m="function"==typeof e;m||(e=e+"");var n=k.global;if(n){var o=k.unicode;k.lastIndex=0}for(var p,q=[];(p=Qb(k,l),null!==p)&&!(q.push(p),!n);){var r=p[0]+"";""==r&&(k.lastIndex=Pb(l,oa(k.lastIndex),o))}for(var s="",t=0,u=0;u<q.length;u++){p=q[u];for(var v=p[0]+"",w=c(d(na(p.index),l.length),0),x=[],y=1;y<p.length;y++)x.push(Tb(p[y]));var z=p.groups;if(m){var A=[v].concat(x,w,l);z!==void 0&&A.push(z);var B=e.apply(void 0,A)+""}else B=g(v,l,w,x,z,e);w>=t&&(s+=l.slice(t,w)+B,t=w+v.length)}return s+l.slice(t)}]});var Ub={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Vb=Wa.forEach,Wb=lb("forEach")?function(a){return Vb(this,a,1<arguments.length?arguments[1]:void 0)}:[].forEach;for(var Xb in Ub){var Yb=m[Xb],Zb=Yb&&Yb.prototype;if(Zb&&Zb.forEach!==Wb)try{Q(Zb,"forEach",Wb)}catch(a){Zb.forEach=Wb}}var $b,_b,ac=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},bc=function(a,b){var c={};return a.forEach(function(a){var d=b(a);c[d]=c[d]||[],c[d].push(a)}),c};a.extend(a.fn.bootstrapTable.defaults,{groupBy:!1,groupByField:"",groupByFormatter:void 0});var cc=a.fn.bootstrapTable.Constructor,dc=cc.prototype.initSort,ec=cc.prototype.initBody,fc=cc.prototype.updateSelected;cc.prototype.initSort=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];dc.apply(this,Array.prototype.slice.apply(c));var e=this;if(_b=[],this.options.groupBy&&""!==this.options.groupByField){this.options.sortName!==this.options.groupByField&&this.data.sort(function(c,a){return c[e.options.groupByField].localeCompare(a[e.options.groupByField])});var f=bc(e.data,function(a){return[a[e.options.groupByField]]}),g=0;a.each(f,function(a,b){_b.push({id:g,name:a,data:b}),b.forEach(function(a){a._data||(a._data={}),a._data["parent-index"]=g}),g++})}},cc.prototype.initBody=function(){$b=!0;for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];if(ec.apply(this,Array.prototype.slice.apply(c)),this.options.groupBy&&""!==this.options.groupByField){var e=this,f=!1,g=0;this.columns.forEach(function(a){a.checkbox?f=!0:a.visible&&(g+=1)}),this.options.detailView&&!this.options.cardView&&(g+=1),_b.forEach(function(b){var c=[];c.push(ac("<tr class=\"info groupBy expanded\" data-group-index=\"%s\">",b.id)),e.options.detailView&&!e.options.cardView&&c.push("<td class=\"detail\"></td>"),f&&c.push("<td class=\"bs-checkbox\">","<input name=\"btSelectGroup\" type=\"checkbox\" />","</td>");var d=b.name;"function"==typeof e.options.groupByFormatter&&(d=e.options.groupByFormatter(b.name,b.id,b.data)),c.push("<td",ac(" colspan=\"%s\"",g),">",d,"</td>"),c.push("</tr>"),e.$body.find("tr[data-parent-index=".concat(b.id,"]:first")).before(a(c.join("")))}),this.$selectGroup=[],this.$body.find("[name=\"btSelectGroup\"]").each(function(){var b=a(this);e.$selectGroup.push({group:b,item:e.$selectItem.filter(function(){return a(this).closest("tr").data("parent-index")===b.closest("tr").data("group-index")})})}),this.$container.off("click",".groupBy").on("click",".groupBy",function(){a(this).toggleClass("expanded"),e.$body.find("tr[data-parent-index=".concat(a(this).closest("tr").data("group-index"),"]")).toggleClass("hidden")}),this.$container.off("click","[name=\"btSelectGroup\"]").on("click","[name=\"btSelectGroup\"]",function(b){b.stopImmediatePropagation();var c=a(this),d=c.prop("checked");e[d?"checkGroup":"uncheckGroup"](a(this).closest("tr").data("group-index"))})}$b=!1,this.updateSelected()},cc.prototype.updateSelected=function(){if(!$b){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];fc.apply(this,Array.prototype.slice.apply(b)),this.options.groupBy&&""!==this.options.groupByField&&this.$selectGroup.forEach(function(a){var b=a.item.filter(":enabled").length===a.item.filter(":enabled").filter(":checked").length;a.group.prop("checked",b)})}},cc.prototype.getGroupSelections=function(a){var b=this;return this.data.filter(function(c){return c[b.header.stateField]&&c._data["parent-index"]===a})},cc.prototype.checkGroup=function(a){this.checkGroup_(a,!0)},cc.prototype.uncheckGroup=function(a){this.checkGroup_(a,!1)},cc.prototype.checkGroup_=function(b,c){var d,e=function(){return a(this).closest("tr").data("parent-index")===b};c||(d=this.getGroupSelections(b)),this.$selectItem.filter(e).prop("checked",c),this.updateRows(),this.updateSelected(),c&&(d=this.getGroupSelections(b)),this.trigger(c?"check-all":"uncheck-all",d)}});