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.5
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],n):n((t=t||self).jQuery)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,n){return t(n={exports:{}},n.exports),n.exports}var r,o,i,u="object",c=function(t){return t&&t.Math==Math&&t},f=c(typeof globalThis==u&&globalThis)||c(typeof window==u&&window)||c(typeof self==u&&self)||c(typeof n==u&&n)||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},l=!a((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),s={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!s.call({1:2},1)?function(t){var n=h(this,t);return!!n&&n.enumerable}:s},d=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},y={}.toString,g=function(t){return y.call(t).slice(8,-1)},v="".split,w=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==g(t)?v.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=function(t){return w(m(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},S=function(t,n){if(!O(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!O(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!O(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!O(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")},T={}.hasOwnProperty,j=function(t,n){return T.call(t,n)},L=f.document,E=O(L)&&O(L.createElement),P=function(t){return E?L.createElement(t):{}},x=!l&&!a((function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a})),M=Object.getOwnPropertyDescriptor,V={f:l?M:function(t,n){if(t=b(t),n=S(n,!0),x)try{return M(t,n)}catch(t){}if(j(t,n))return d(!p.f.call(t,n),t[n])}},C=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,k={f:l?_:function(t,n,e){if(C(t),n=S(n,!0),C(e),x)try{return _(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},A=l?function(t,n,e){return k.f(t,n,d(1,e))}:function(t,n,e){return t[n]=e,t},H=function(t,n){try{A(f,t,n)}catch(e){f[t]=n}return n},R=e((function(t){var n=f["__core-js_shared__"]||H("__core-js_shared__",{});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),F=R("native-function-to-string",Function.toString),I=f.WeakMap,W="function"==typeof I&&/native code/.test(F.call(I)),D=0,N=Math.random(),G=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++D+N).toString(36)},q=R("keys"),z=function(t){return q[t]||(q[t]=G(t))},B={},K=f.WeakMap;if(W){var Q=new K,Y=Q.get,J=Q.has,U=Q.set;r=function(t,n){return U.call(Q,t,n),n},o=function(t){return Y.call(Q,t)||{}},i=function(t){return J.call(Q,t)}}else{var X=z("state");B[X]=!0,r=function(t,n){return A(t,X,n),n},o=function(t){return j(t,X)?t[X]:{}},i=function(t){return j(t,X)}}var Z,$={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(n){var e;if(!O(n)||(e=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}},tt=e((function(t){var n=$.get,e=$.enforce,r=String(F).split("toString");R("inspectSource",(function(t){return F.call(t)})),(t.exports=function(t,n,o,i){var u=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof n||j(o,"name")||A(o,"name",n),e(o).source=r.join("string"==typeof n?n:"")),t!==f?(u?!a&&t[n]&&(c=!0):delete t[n],c?t[n]=o:A(t,n,o)):c?t[n]=o:H(n,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&n(this).source||F.call(this)}))})),nt=f,et=function(t){return"function"==typeof t?t:void 0},rt=function(t,n){return arguments.length<2?et(nt[t])||et(f[t]):nt[t]&&nt[t][n]||f[t]&&f[t][n]},ot=Math.ceil,it=Math.floor,ut=function(t){return isNaN(t=+t)?0:(t>0?it:ot)(t)},ct=Math.min,ft=function(t){return t>0?ct(ut(t),9007199254740991):0},at=Math.max,lt=Math.min,st=function(t){return function(n,e,r){var o,i=b(n),u=ft(i.length),c=function(t,n){var e=ut(t);return e<0?at(e+n,0):lt(e,n)}(r,u);if(t&&e!=e){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===e)return t||c||0;return!t&&-1}},ht={includes:st(!0),indexOf:st(!1)},pt=ht.indexOf,dt=function(t,n){var e,r=b(t),o=0,i=[];for(e in r)!j(B,e)&&j(r,e)&&i.push(e);for(;n.length>o;)j(r,e=n[o++])&&(~pt(i,e)||i.push(e));return i},yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gt=yt.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return dt(t,gt)}},wt={f:Object.getOwnPropertySymbols},mt=rt("Reflect","ownKeys")||function(t){var n=vt.f(C(t)),e=wt.f;return e?n.concat(e(t)):n},bt=function(t,n){for(var e=mt(n),r=k.f,o=V.f,i=0;i<e.length;i++){var u=e[i];j(t,u)||r(t,u,o(n,u))}},Ot=/#|\.prototype\./,St=function(t,n){var e=jt[Tt(t)];return e==Et||e!=Lt&&("function"==typeof n?a(n):!!n)},Tt=St.normalize=function(t){return String(t).replace(Ot,".").toLowerCase()},jt=St.data={},Lt=St.NATIVE="N",Et=St.POLYFILL="P",Pt=St,xt=V.f,Mt=function(t,n){var e,r,o,i,u,c=t.target,a=t.global,l=t.stat;if(e=a?f:l?f[c]||H(c,{}):(f[c]||{}).prototype)for(r in n){if(i=n[r],o=t.noTargetGet?(u=xt(e,r))&&u.value:e[r],!Pt(a?r:c+(l?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;bt(i,o)}(t.sham||o&&o.sham)&&A(i,"sham",!0),tt(e,r,i,t)}},Vt=Array.isArray||function(t){return"Array"==g(t)},Ct=function(t){return Object(m(t))},_t=function(t,n,e){var r=S(n);r in t?k.f(t,r,d(0,e)):t[r]=e},kt=!!Object.getOwnPropertySymbols&&!a((function(){return!String(Symbol())})),At=f.Symbol,Ht=R("wks"),Rt=function(t){return Ht[t]||(Ht[t]=kt&&At[t]||(kt?At:G)("Symbol."+t))},Ft=Rt("species"),It=function(t,n){var e;return Vt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Vt(e.prototype)?O(e)&&null===(e=e[Ft])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)},Wt=Rt("species"),Dt=Rt("isConcatSpreadable"),Nt=!a((function(){var t=[];return t[Dt]=!1,t.concat()[0]!==t})),Gt=(Z="concat",!a((function(){var t=[];return(t.constructor={})[Wt]=function(){return{foo:1}},1!==t[Z](Boolean).foo}))),qt=function(t){if(!O(t))return!1;var n=t[Dt];return void 0!==n?!!n:Vt(t)};Mt({target:"Array",proto:!0,forced:!Nt||!Gt},{concat:function(t){var n,e,r,o,i,u=Ct(this),c=It(u,0),f=0;for(n=-1,r=arguments.length;n<r;n++)if(i=-1===n?u:arguments[n],qt(i)){if(f+(o=ft(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(e=0;e<o;e++,f++)e in i&&_t(c,f,i[e])}else{if(f>=9007199254740991)throw TypeError("Maximum allowed index exceeded");_t(c,f++,i)}return c.length=f,c}});var zt=Object.keys||function(t){return dt(t,yt)},Bt=l?Object.defineProperties:function(t,n){C(t);for(var e,r=zt(n),o=r.length,i=0;o>i;)k.f(t,e=r[i++],n[e]);return t},Kt=rt("document","documentElement"),Qt=z("IE_PROTO"),Yt=function(){},Jt=function(){var t,n=P("iframe"),e=yt.length;for(n.style.display="none",Kt.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Jt=t.F;e--;)delete Jt.prototype[yt[e]];return Jt()},Ut=Object.create||function(t,n){var e;return null!==t?(Yt.prototype=C(t),e=new Yt,Yt.prototype=null,e[Qt]=t):e=Jt(),void 0===n?e:Bt(e,n)};B[Qt]=!0;var Xt=Rt("unscopables"),Zt=Array.prototype;null==Zt[Xt]&&A(Zt,Xt,Ut(null));var $t,tn=ht.includes;Mt({target:"Array",proto:!0},{includes:function(t){return tn(this,t,arguments.length>1?arguments[1]:void 0)}}),$t="includes",Zt[Xt][$t]=!0;var nn=Rt("match"),en=function(t){if(function(t){var n;return O(t)&&(void 0!==(n=t[nn])?!!n:"RegExp"==g(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},rn=Rt("match");Mt({target:"String",proto:!0,forced:!function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[rn]=!1,"/./"[t](n)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(m(this)).indexOf(en(t),arguments.length>1?arguments[1]:void 0)}});var on=function(t,n,e){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}},un=[].push,cn=function(t){var n=1==t,e=2==t,r=3==t,o=4==t,i=6==t,u=5==t||i;return function(c,f,a,l){for(var s,h,p=Ct(c),d=w(p),y=on(f,a,3),g=ft(d.length),v=0,m=l||It,b=n?m(c,g):e?m(c,0):void 0;g>v;v++)if((u||v in d)&&(h=y(s=d[v],v,p),t))if(n)b[v]=h;else if(h)switch(t){case 3:return!0;case 5:return s;case 6:return v;case 2:un.call(b,s)}else if(o)return!1;return i?-1:r||o?o:b}},fn={forEach:cn(0),map:cn(1),filter:cn(2),some:cn(3),every:cn(4),find:cn(5),findIndex:cn(6)}.forEach,an=function(t,n){var e=[][t];return!e||!a((function(){e.call(null,n||function(){throw 1},1)}))}("forEach")?function(t){return fn(this,t,arguments.length>1?arguments[1]:void 0)}:[].forEach;for(var ln in{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}){var sn=f[ln],hn=sn&&sn.prototype;if(hn&&hn.forEach!==an)try{A(hn,"forEach",an)}catch(t){hn.forEach=an}}function pn(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function dn(t){return(dn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yn(t,n){return(yn=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function gn(t,n){return!n||"object"!=typeof n&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):n}function vn(t,n,e){return(vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){var r=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=dn(t)););return t}(t,n);if(r){var o=Object.getOwnPropertyDescriptor(r,n);return o.get?o.get.call(e):o.value}})(t,n,e||t)}var wn=function(t,n){var e=0;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var u=function(){e=0,t.apply(void 0,o)};clearTimeout(e),e=setTimeout(u,n)}};t.extend(t.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]}),t.BootstrapTable=function(n){function e(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),gn(this,dn(e).apply(this,arguments))}var r,o,i;return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&yn(t,n)}(e,n),r=e,(o=[{key:"init",value:function(){for(var n,r=this,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];if((n=vn(dn(e.prototype),"init",this)).call.apply(n,[this].concat(i)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&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 c={width:t(window).width(),height:t(window).height()};if(t(window).on("resize orientationchange",wn((function(){var n=t(window).width(),e=t(window).height();(Math.abs(c.height-e)>r.options.heightThreshold||c.width!==n)&&(r.changeView(n,e),c={width:n,height:e})}),200)),this.options.checkOnInit){var f=t(window).width(),a=t(window).height();this.changeView(f,a),c={width:f,height:a}}}}},{key:"conditionCardView",value:function(){this.changeTableView(!1),this.showHideColumns(!1)}},{key:"conditionFullView",value:function(){this.changeTableView(!0),this.showHideColumns(!0)}},{key:"changeTableView",value:function(t){this.options.cardView=t,this.toggleView()}},{key:"showHideColumns",value:function(t){var n=this;this.options.columnsHidden.length>0&&this.columns.forEach((function(e){n.options.columnsHidden.includes(e.field)&&e.visible!==t&&n._toggleColumn(n.fieldsColumnsIndex[e.field],t,!0)}))}},{key:"changeView",value:function(t,n){this.options.minHeight?t<=this.options.minWidth&&n<=this.options.minHeight?this.conditionCardView():t>this.options.minWidth&&n>this.options.minHeight&&this.conditionFullView():t<=this.options.minWidth?this.conditionCardView():t>this.options.minWidth&&this.conditionFullView(),this.resetView()}}])&&pn(r.prototype,o),i&&pn(r,i),e}(t.BootstrapTable)}));