UNPKG

13.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 n=Math.min;function b(a,b){return b={exports:{}},a(b,b.exports),b.exports}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function e(a,b,c){return b&&d(a.prototype,b),c&&d(a,c),a}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&i(a,b)}function h(a){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},h(a)}function i(a,b){return i=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},i(a,b)}function j(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function k(a,b){return b&&("object"==typeof b||"function"==typeof b)?b:j(a)}function l(a,b){for(;!Object.prototype.hasOwnProperty.call(a,b)&&(a=h(a),null!==a););return a}function m(a,b,c){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(a,b,c){var d=l(a,b);if(d){var e=Object.getOwnPropertyDescriptor(d,b);return e.get?e.get.call(c):e.value}},m(a,b,c||a)}a=a&&a.hasOwnProperty("default")?a["default"]:a;var o,p,q,r="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,s="object",t=function(a){return a&&a.Math==Math&&a},u=t(typeof globalThis==s&&globalThis)||t(typeof window==s&&window)||t(typeof self==s&&self)||t(typeof r==s&&r)||Function("return this")(),v=function(a){try{return!!a()}catch(a){return!0}},w=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),x={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,z=y&&!x.call({1:2},1),A=z?function(a){var b=y(this,a);return!!b&&b.enumerable}:x,f={f:A},B=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},C={}.toString,D=function(a){return C.call(a).slice(8,-1)},E="".split,F=v(function(){return!Object("z").propertyIsEnumerable(0)})?function(a){return"String"==D(a)?E.call(a,""):Object(a)}:Object,G=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},H=function(a){return F(G(a))},I=function(a){return"object"==typeof a?null!==a:"function"==typeof a},J=function(a,b){if(!I(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!I(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!I(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!I(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},K={}.hasOwnProperty,L=function(a,b){return K.call(a,b)},M=u.document,N=I(M)&&I(M.createElement),O=function(a){return N?M.createElement(a):{}},Q=!w&&!v(function(){return 7!=Object.defineProperty(O("div"),"a",{get:function(){return 7}}).a}),R=Object.getOwnPropertyDescriptor,S=w?R:function(a,b){if(a=H(a),b=J(b,!0),Q)try{return R(a,b)}catch(a){}return L(a,b)?B(!f.f.call(a,b),a[b]):void 0},T={f:S},U=function(a){if(!I(a))throw TypeError(a+" is not an object");return a},V=Object.defineProperty,W=w?V:function(a,b,c){if(U(a),b=J(b,!0),U(c),Q)try{return V(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},X={f:W},Y=w?function(a,b,c){return X.f(a,b,B(1,c))}:function(a,b,c){return a[b]=c,a},Z=function(a,b){try{Y(u,a,b)}catch(c){u[a]=b}return b},_=b(function(a){var b=u["__core-js_shared__"]||Z("__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)"})}),aa=_("native-function-to-string",Function.toString),ba=u.WeakMap,ca="function"==typeof ba&&/native code/.test(aa.call(ba)),da=0,P=Math.random(),ea=function(a){return"Symbol("+((a===void 0?"":a)+"")+")_"+(++da+P).toString(36)},fa=_("keys"),ga=function(a){return fa[a]||(fa[a]=ea(a))},ha={},ia=u.WeakMap,ja=function(a){return q(a)?p(a):o(a,{})};if(ca){var ka=new ia,la=ka.get,ma=ka.has,na=ka.set;o=function(a,b){return na.call(ka,a,b),b},p=function(a){return la.call(ka,a)||{}},q=function(a){return ma.call(ka,a)}}else{var oa=ga("state");ha[oa]=!0,o=function(a,b){return Y(a,oa,b),b},p=function(a){return L(a,oa)?a[oa]:{}},q=function(a){return L(a,oa)}}var pa={set:o,get:p,has:q,enforce:ja,getterFor:function(a){return function(b){var c;if(!I(b)||(c=p(b)).type!==a)throw TypeError("Incompatible receiver, "+a+" required");return c}}},qa=b(function(a){var b=pa.get,c=pa.enforce,d=(aa+"").split("toString");_("inspectSource",function(a){return aa.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&&!L(e,"name")&&Y(e,"name",b),c(e).source=d.join("string"==typeof b?b:"")),a===u)?void(h?a[b]=e:Z(b,e)):void(g?!i&&a[b]&&(h=!0):delete a[b],h?a[b]=e:Y(a,b,e))})(Function.prototype,"toString",function(){return"function"==typeof this&&b(this).source||aa.call(this)})}),ra=u,sa=function(a){return"function"==typeof a?a:void 0},ta=function(a,b){return 2>arguments.length?sa(ra[a])||sa(u[a]):ra[a]&&ra[a][b]||u[a]&&u[a][b]},ua=Math.ceil,va=Math.floor,wa=function(a){return isNaN(a=+a)?0:(0<a?va:ua)(a)},xa=function(a){return 0<a?n(wa(a),9007199254740991):0},ya=Math.max,za=function(a,b){var c=wa(a);return 0>c?ya(c+b,0):n(c,b)},Aa=function(a){return function(b,c,d){var e,f=H(b),g=xa(f.length),h=za(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}},Ba={includes:Aa(!0),indexOf:Aa(!1)},Ca=Ba.indexOf,Da=function(a,b){var c,d=H(a),e=0,f=[];for(c in d)!L(ha,c)&&L(d,c)&&f.push(c);for(;b.length>e;)L(d,c=b[e++])&&(~Ca(f,c)||f.push(c));return f},Ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Fa=Ea.concat("length","prototype"),Ga=Object.getOwnPropertyNames||function(a){return Da(a,Fa)},Ha={f:Ga},Ia=Object.getOwnPropertySymbols,Ja={f:Ia},Ka=ta("Reflect","ownKeys")||function(a){var b=Ha.f(U(a)),c=Ja.f;return c?b.concat(c(a)):b},La=function(a,b){for(var c,d=Ka(b),e=X.f,f=T.f,g=0;g<d.length;g++)c=d[g],L(a,c)||e(a,c,f(b,c))},Ma=/#|\.prototype\./,Na=function(a,b){var c=Pa[Oa(a)];return!(c!=Ra)||c!=Qa&&("function"==typeof b?v(b):!!b)},Oa=Na.normalize=function(a){return(a+"").replace(Ma,".").toLowerCase()},Pa=Na.data={},Qa=Na.NATIVE="N",Ra=Na.POLYFILL="P",Sa=T.f,Ta=function(a,b){var c,d,e,f,g,h,i=a.target,j=a.global,k=a.stat;if(d=j?u:k?u[i]||Z(i,{}):(u[i]||{}).prototype,d)for(e in b){if(g=b[e],a.noTargetGet?(h=Sa(d,e),f=h&&h.value):f=d[e],c=Na(j?e:i+(k?".":"#")+e,a.forced),!c&&void 0!==f){if(typeof g==typeof f)continue;La(g,f)}(a.sham||f&&f.sham)&&Y(g,"sham",!0),qa(d,e,g,a)}},Ua=Array.isArray||function(a){return"Array"==D(a)},Va=function(a){return Object(G(a))},Wa=function(a,b,c){var d=J(b);d in a?X.f(a,d,B(0,c)):a[d]=c},Xa=!!Object.getOwnPropertySymbols&&!v(function(){return!(Symbol()+"")}),Ya=u.Symbol,Za=_("wks"),$a=function(a){return Za[a]||(Za[a]=Xa&&Ya[a]||(Xa?Ya:ea)("Symbol."+a))},_a=$a("species"),ab=function(a,b){var c;return Ua(a)&&(c=a.constructor,"function"==typeof c&&(c===Array||Ua(c.prototype))?c=void 0:I(c)&&(c=c[_a],null===c&&(c=void 0))),new(void 0===c?Array:c)(0===b?0:b)},bb=$a("species"),cb=$a("isConcatSpreadable"),db=9007199254740991,eb="Maximum allowed index exceeded",fb=!v(function(){var a=[];return a[cb]=!1,a.concat()[0]!==a}),gb=function(a){return!v(function(){var b=[],c=b.constructor={};return c[bb]=function(){return{foo:1}},1!==b[a](Boolean).foo})}("concat"),hb=function(a){if(!I(a))return!1;var b=a[cb];return b===void 0?Ua(a):!!b};Ta({target:"Array",proto:!0,forced:!fb||!gb},{concat:function(){var a,b,c,d,e,f=Va(this),g=ab(f,0),h=0;for(a=-1,c=arguments.length;a<c;a++)if(e=-1===a?f:arguments[a],hb(e)){if(d=xa(e.length),h+d>db)throw TypeError(eb);for(b=0;b<d;b++,h++)b in e&&Wa(g,h,e[b])}else{if(h>=db)throw TypeError(eb);Wa(g,h++,e)}return g.length=h,g}});var ib=Object.keys||function(a){return Da(a,Ea)},jb=w?Object.defineProperties:function(a,b){U(a);for(var c,d=ib(b),e=d.length,f=0;e>f;)X.f(a,c=d[f++],b[c]);return a},kb=ta("document","documentElement"),lb=ga("IE_PROTO"),mb="prototype",nb=function(){},ob=function(){var a,b=O("iframe"),c=Ea.length,d="<",e="script",f=">";for(b.style.display="none",kb.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(),ob=a.F;c--;)delete ob[mb][Ea[c]];return ob()},pb=Object.create||function(a,b){var c;return null===a?c=ob():(nb[mb]=U(a),c=new nb,nb[mb]=null,c[lb]=a),void 0===b?c:jb(c,b)};ha[lb]=!0;var qb=$a("unscopables"),rb=Array.prototype;rb[qb]==null&&Y(rb,qb,pb(null));var sb=Ba.includes;Ta({target:"Array",proto:!0},{includes:function(a){return sb(this,a,1<arguments.length?arguments[1]:void 0)}}),function(a){rb[qb][a]=!0}("includes");var tb=$a("match"),ub=function(a){var b;return I(a)&&((b=a[tb])===void 0?"RegExp"==D(a):!!b)},vb=function(a){if(ub(a))throw TypeError("The method doesn't accept regular expressions");return a},wb=$a("match");Ta({target:"String",proto:!0,forced:!function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[wb]=!1,"/./"[a](b)}catch(a){}}return!1}("includes")},{includes:function(a){return!!~(G(this)+"").indexOf(vb(a),1<arguments.length?arguments[1]:void 0)}});var xb={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},yb=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function");return a},zb=function(d,e,f){return(yb(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)}},Ab=[].push,Bb=function(a){var b=1==a,c=4==a,d=6==a;return function(e,f,g,h){for(var i,j,k=Va(e),l=F(k),m=zb(f,g,3),n=xa(l.length),o=0,p=h||ab,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:Ab.call(q,i);}else if(c)return!1;return d?-1:3==a||c?c:q}},Cb={forEach:Bb(0),map:Bb(1),filter:Bb(2),some:Bb(3),every:Bb(4),find:Bb(5),findIndex:Bb(6)},Db=Cb.forEach,Eb=function(a,b){var c=[][a];return!c||!v(function(){c.call(null,b||function(){throw 1},1)})}("forEach")?function(a){return Db(this,a,1<arguments.length?arguments[1]:void 0)}:[].forEach;for(var Fb in xb){var Gb=u[Fb],Hb=Gb&&Gb.prototype;if(Hb&&Hb.forEach!==Eb)try{Y(Hb,"forEach",Eb)}catch(a){Hb.forEach=Eb}}var Ib=function(a,b){var c=0;return function(){for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];clearTimeout(c),c=setTimeout(function(){c=0,a.apply(void 0,e)},b)}};a.extend(a.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]}),a.BootstrapTable=function(b){function d(){return c(this,d),k(this,h(d).apply(this,arguments))}return g(d,b),e(d,[{key:"init",value:function(){for(var b,c=this,e=arguments.length,f=Array(e),g=0;g<e;g++)f[g]=arguments[g];if((b=m(h(d.prototype),"init",this)).call.apply(b,[this].concat(f)),this.options.mobileResponsive&&this.options.minWidth){100>this.options.minWidth&&this.options.resizable&&(console.info("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var i={width:a(window).width(),height:a(window).height()};if(a(window).on("resize orientationchange",Ib(function(){var b=Math.abs,d=a(window).width(),e=a(window).height();(b(i.height-e)>c.options.heightThreshold||i.width!==d)&&(c.changeView(d,e),i={width:d,height:e})},200)),this.options.checkOnInit){var j=a(window).width(),k=a(window).height();this.changeView(j,k),i={width:j,height:k}}}}},{key:"conditionCardView",value:function(){this.changeTableView(!1),this.showHideColumns(!1)}},{key:"conditionFullView",value:function(){this.changeTableView(!0),this.showHideColumns(!0)}},{key:"changeTableView",value:function(a){this.options.cardView=a,this.toggleView()}},{key:"showHideColumns",value:function(a){var b=this;0<this.options.columnsHidden.length&&this.columns.forEach(function(c){b.options.columnsHidden.includes(c.field)&&c.visible!==a&&b._toggleColumn(b.fieldsColumnsIndex[c.field],a,!0)})}},{key:"changeView",value:function(a,b){this.options.minHeight?a<=this.options.minWidth&&b<=this.options.minHeight?this.conditionCardView():a>this.options.minWidth&&b>this.options.minHeight&&this.conditionFullView():a<=this.options.minWidth?this.conditionCardView():a>this.options.minWidth&&this.conditionFullView(),this.resetView()}}]),d}(a.BootstrapTable)});