bootstrap-table-mobile.min.js 13 KB

12345678910
  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.0
  5. * @homepage https://bootstrap-table.com
  6. * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
  7. * @license MIT
  8. */
  9. (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={}.toString,s=function(a){return r.call(a).slice(8,-1)},t=Array.isArray||function(a){return"Array"==s(a)},u=function(a){return"object"==typeof a?null!==a:"function"==typeof a},v=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},w=function(a){return Object(v(a))},x=Math.ceil,y=Math.floor,z=function(a){return isNaN(a=+a)?0:(0<a?y:x)(a)},B=function(a){return 0<a?n(z(a),9007199254740991):0},C=function(a,b){if(!u(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!u(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!u(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!u(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},D=function(a){try{return!!a()}catch(a){return!0}},E=!D(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),F="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")(),G=F.document,H=u(G)&&u(G.createElement),I=function(a){return H?G.createElement(a):{}},J=!E&&!D(function(){return 7!=Object.defineProperty(I("div"),"a",{get:function(){return 7}}).a}),K=function(a){if(!u(a))throw TypeError(a+" is not an object");return a},L=Object.defineProperty,M=E?L:function(a,b,c){if(K(a),b=C(b,!0),K(c),J)try{return L(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},f={f:M},A=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},N=function(a,b,c){var d=C(b);d in a?f.f(a,d,A(0,c)):a[d]=c},P=E?function(a,b,c){return f.f(a,b,A(1,c))}:function(a,b,c){return a[b]=c,a},Q=function(a,b){try{P(F,a,b)}catch(c){F[a]=b}return b},R=b(function(a){var b=F["__core-js_shared__"]||Q("__core-js_shared__",{});(a.exports=function(a,c){return b[a]||(b[a]=c===void 0?{}:c)})("versions",[]).push({version:"3.0.0",mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),S=0,O=Math.random(),T=function(a){return"Symbol(".concat(a===void 0?"":a,")_",(++S+O).toString(36))},U=!D(function(){}),V=R("wks"),W=F.Symbol,X=function(a){return V[a]||(V[a]=U&&W[a]||(U?W:T)("Symbol."+a))},Y=X("species"),Z=function(a,b){var c;return t(a)&&(c=a.constructor,"function"==typeof c&&(c===Array||t(c.prototype))?c=void 0:u(c)&&(c=c[Y],null===c&&(c=void 0))),new(void 0===c?Array:c)(0===b?0:b)},_=X("species"),aa={}.propertyIsEnumerable,ba=Object.getOwnPropertyDescriptor,ca=ba&&!aa.call({1:2},1),da=ca?function(a){var b=ba(this,a);return!!b&&b.enumerable}:aa,ea={f:da},fa="".split,ga=D(function(){return!Object("z").propertyIsEnumerable(0)})?function(a){return"String"==s(a)?fa.call(a,""):Object(a)}:Object,ha=function(a){return ga(v(a))},ia={}.hasOwnProperty,ja=function(a,b){return ia.call(a,b)},ka=Object.getOwnPropertyDescriptor,la=E?ka:function(a,b){if(a=ha(a),b=C(b,!0),J)try{return ka(a,b)}catch(a){}return ja(a,b)?A(!ea.f.call(a,b),a[b]):void 0},ma={f:la},na=R("native-function-to-string",Function.toString),oa=F.WeakMap,pa="function"==typeof oa&&/native code/.test(na.call(oa)),qa=R("keys"),ra=function(a){return qa[a]||(qa[a]=T(a))},sa={},ta=F.WeakMap,ua=function(a){return q(a)?p(a):o(a,{})};if(pa){var va=new ta,wa=va.get,xa=va.has,ya=va.set;o=function(a,b){return ya.call(va,a,b),b},p=function(a){return wa.call(va,a)||{}},q=function(a){return xa.call(va,a)}}else{var za=ra("state");sa[za]=!0,o=function(a,b){return P(a,za,b),b},p=function(a){return ja(a,za)?a[za]:{}},q=function(a){return ja(a,za)}}var Aa={set:o,get:p,has:q,enforce:ua,getterFor:function(a){return function(b){var c;if(!u(b)||(c=p(b)).type!==a)throw TypeError("Incompatible receiver, "+a+" required");return c}}},Ba=b(function(a){var b=Aa.get,c=Aa.enforce,d=(na+"").split("toString");R("inspectSource",function(a){return na.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&&!ja(e,"name")&&P(e,"name",b),c(e).source=d.join("string"==typeof b?b:"")),a===F)?void(h?a[b]=e:Q(b,e)):void(g?!i&&a[b]&&(h=!0):delete a[b],h?a[b]=e:P(a,b,e))})(Function.prototype,"toString",function(){return"function"==typeof this&&b(this).source||na.call(this)})}),Ca=Math.max,Da=function(a,b){var c=z(a);return 0>c?Ca(c+b,0):n(c,b)},Ea=function(a){return function(b,c,d){var e,f=ha(b),g=B(f.length),h=Da(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}},Fa=Ea(!1),Ga=function(a,b){var c,d=ha(a),e=0,f=[];for(c in d)!ja(sa,c)&&ja(d,c)&&f.push(c);for(;b.length>e;)ja(d,c=b[e++])&&(~Fa(f,c)||f.push(c));return f},Ha=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ia=Ha.concat("length","prototype"),Ja=Object.getOwnPropertyNames||function(a){return Ga(a,Ia)},Ka={f:Ja},La=Object.getOwnPropertySymbols,Ma={f:La},Na=F.Reflect,Oa=Na&&Na.ownKeys||function(a){var b=Ka.f(K(a)),c=Ma.f;return c?b.concat(c(a)):b},Pa=function(a,b){for(var c,d=Oa(b),e=f.f,g=ma.f,h=0;h<d.length;h++)c=d[h],ja(a,c)||e(a,c,g(b,c))},Qa=/#|\.prototype\./,Ra=function(a,b){var c=Ta[Sa(a)];return!(c!=Va)||c!=Ua&&("function"==typeof b?D(b):!!b)},Sa=Ra.normalize=function(a){return(a+"").replace(Qa,".").toLowerCase()},Ta=Ra.data={},Ua=Ra.NATIVE="N",Va=Ra.POLYFILL="P",Wa=ma.f,Xa=function(a,b){var c,d,e,f,g,h,i=a.target,j=a.global,k=a.stat;if(d=j?F:k?F[i]||Q(i,{}):(F[i]||{}).prototype,d)for(e in b){if(g=b[e],a.noTargetGet?(h=Wa(d,e),f=h&&h.value):f=d[e],c=Ra(j?e:i+(k?".":"#")+e,a.forced),!c&&void 0!==f){if(typeof g==typeof f)continue;Pa(g,f)}(a.sham||f&&f.sham)&&P(g,"sham",!0),Ba(d,e,g,a)}},Ya=X("isConcatSpreadable"),Za=9007199254740991,$a="Maximum allowed index exceeded",_a=!D(function(){var a=[];return a[Ya]=!1,a.concat()[0]!==a}),ab=function(a){return!D(function(){var b=[],c=b.constructor={};return c[_]=function(){return{foo:1}},1!==b[a](Boolean).foo})}("concat"),bb=function(a){if(!u(a))return!1;var b=a[Ya];return b===void 0?t(a):!!b};Xa({target:"Array",proto:!0,forced:!_a||!ab},{concat:function(){var a,b,c,d,e,f=w(this),g=Z(f,0),h=0;for(a=-1,c=arguments.length;a<c;a++)if(e=-1===a?f:arguments[a],bb(e)){if(d=B(e.length),h+d>Za)throw TypeError($a);for(b=0;b<d;b++,h++)b in e&&N(g,h,e[b])}else{if(h>=Za)throw TypeError($a);N(g,h++,e)}return g.length=h,g}});var cb=Object.keys||function(a){return Ga(a,Ha)},db=E?Object.defineProperties:function(a,b){K(a);for(var c,d=cb(b),e=d.length,g=0;e>g;)f.f(a,c=d[g++],b[c]);return a},eb=F.document,fb=eb&&eb.documentElement,gb=ra("IE_PROTO"),hb="prototype",ib=function(){},jb=function(){var a,b=I("iframe"),c=Ha.length,d="<",e="script",f=">";for(b.style.display="none",fb.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(),jb=a.F;c--;)delete jb[hb][Ha[c]];return jb()},kb=Object.create||function(a,b){var c;return null===a?c=jb():(ib[hb]=K(a),c=new ib,ib[hb]=null,c[gb]=a),void 0===b?c:db(c,b)};sa[gb]=!0;var lb=X("unscopables"),mb=Array.prototype;mb[lb]==null&&P(mb,lb,kb(null));var nb=Ea(!0);Xa({target:"Array",proto:!0},{includes:function(a){return nb(this,a,1<arguments.length?arguments[1]:void 0)}}),function(a){mb[lb][a]=!0}("includes");var ob=X("match"),pb=function(a){var b;return u(a)&&((b=a[ob])===void 0?"RegExp"==s(a):!!b)},qb=function(a,b,c){if(pb(b))throw TypeError("String.prototype."+c+" doesn't accept regex");return v(a)+""},rb=X("match"),sb="includes",tb=function(a){var b=/./;try{"/./"[a](b)}catch(c){try{return b[rb]=!1,"/./"[a](b)}catch(a){}}return!1}(sb);Xa({target:"String",proto:!0,forced:!tb},{includes:function(a){return!!~qb(this,a,sb).indexOf(a,1<arguments.length?arguments[1]:void 0)}});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=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function");return a},wb=function(d,e,f){return(vb(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)}},xb=[].forEach,yb=function(a,b){var c=1==a,d=4==a,e=6==a,f=b||Z;return function(b,g,h){for(var i,j,k=w(b),l=ga(k),m=wb(g,h,3),n=B(l.length),o=0,p=c?f(b,n):2==a?f(b,0):void 0;n>o;o++)if((5==a||e||o in l)&&(i=l[o],j=m(i,o,k),a))if(c)p[o]=j;else if(j)switch(a){case 3:return!0;case 5:return i;case 6:return o;case 2:p.push(i);}else if(d)return!1;return e?-1:3==a||d?d:p}}(0),zb=function(a,b){var c=[][a];return!c||!D(function(){c.call(null,b||function(){throw Error()},1)})}("forEach"),Ab=zb?function(a){return yb(this,a,arguments[1])}:xb;for(var Bb in ub){var Cb=F[Bb],Db=Cb&&Cb.prototype;if(Db&&Db.forEach!==Ab)try{P(Db,"forEach",Ab)}catch(a){Db.forEach=Ab}}var Eb=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",Eb(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)});