UNPKG

16.9 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,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t=t||self).jQuery)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r,o,i,c="object",u=function(t){return t&&t.Math==Math&&t},a=u(typeof globalThis==c&&globalThis)||u(typeof window==c&&window)||u(typeof self==c&&self)||u(typeof e==c&&e)||Function("return this")(),f=function(t){try{return!!t()}catch(t){return!0}},l=!f((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),s={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,p={f:d&&!s.call({1:2},1)?function(t){var e=d(this,t);return!!e&&e.enumerable}:s},h=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,v=function(t){return y.call(t).slice(8,-1)},g="".split,b=f((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?g.call(t,""):Object(t)}:Object,x=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},m=function(t){return b(x(t))},w=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!w(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!w(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},j={}.hasOwnProperty,$=function(t,e){return j.call(t,e)},S=a.document,E=w(S)&&w(S.createElement),T=function(t){return E?S.createElement(t):{}},P=!l&&!f((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),k=Object.getOwnPropertyDescriptor,A={f:l?k:function(t,e){if(t=m(t),e=O(e,!0),P)try{return k(t,e)}catch(t){}if($(t,e))return h(!p.f.call(t,e),t[e])}},B=function(t){if(!w(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,_={f:l?C:function(t,e,n){if(B(t),e=O(e,!0),B(n),P)try{return C(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},F=l?function(t,e,n){return _.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},H=function(t,e){try{F(a,t,e)}catch(n){a[t]=e}return e},I=n((function(t){var e=a["__core-js_shared__"]||H("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),M=I("native-function-to-string",Function.toString),R=a.WeakMap,N="function"==typeof R&&/native code/.test(M.call(R)),W=0,L=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++W+L).toString(36)},D=I("keys"),z=function(t){return D[t]||(D[t]=q(t))},G={},V=a.WeakMap;if(N){var K=new V,Q=K.get,Y=K.has,J=K.set;r=function(t,e){return J.call(K,t,e),e},o=function(t){return Q.call(K,t)||{}},i=function(t){return Y.call(K,t)}}else{var U=z("state");G[U]=!0,r=function(t,e){return F(t,U,e),e},o=function(t){return $(t,U)?t[U]:{}},i=function(t){return $(t,U)}}var X,Z={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!w(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},tt=n((function(t){var e=Z.get,n=Z.enforce,r=String(M).split("toString");I("inspectSource",(function(t){return M.call(t)})),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||$(o,"name")||F(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==a?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=o:F(t,e,o)):u?t[e]=o:H(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||M.call(this)}))})),et=a,nt=function(t){return"function"==typeof t?t:void 0},rt=function(t,e){return arguments.length<2?nt(et[t])||nt(a[t]):et[t]&&et[t][e]||a[t]&&a[t][e]},ot=Math.ceil,it=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?it:ot)(t)},ut=Math.min,at=function(t){return t>0?ut(ct(t),9007199254740991):0},ft=Math.max,lt=Math.min,st=function(t){return function(e,n,r){var o,i=m(e),c=at(i.length),u=function(t,e){var n=ct(t);return n<0?ft(n+e,0):lt(n,e)}(r,c);if(t&&n!=n){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((t||u in i)&&i[u]===n)return t||u||0;return!t&&-1}},dt={includes:st(!0),indexOf:st(!1)}.indexOf,pt=function(t,e){var n,r=m(t),o=0,i=[];for(n in r)!$(G,n)&&$(r,n)&&i.push(n);for(;e.length>o;)$(r,n=e[o++])&&(~dt(i,n)||i.push(n));return i},ht=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yt=ht.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return pt(t,yt)}},gt={f:Object.getOwnPropertySymbols},bt=rt("Reflect","ownKeys")||function(t){var e=vt.f(B(t)),n=gt.f;return n?e.concat(n(t)):e},xt=function(t,e){for(var n=bt(e),r=_.f,o=A.f,i=0;i<n.length;i++){var c=n[i];$(t,c)||r(t,c,o(e,c))}},mt=/#|\.prototype\./,wt=function(t,e){var n=jt[Ot(t)];return n==St||n!=$t&&("function"==typeof e?f(e):!!e)},Ot=wt.normalize=function(t){return String(t).replace(mt,".").toLowerCase()},jt=wt.data={},$t=wt.NATIVE="N",St=wt.POLYFILL="P",Et=wt,Tt=A.f,Pt=function(t,e){var n,r,o,i,c,u=t.target,f=t.global,l=t.stat;if(n=f?a:l?a[u]||H(u,{}):(a[u]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=Tt(n,r))&&c.value:n[r],!Et(f?r:u+(l?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;xt(i,o)}(t.sham||o&&o.sham)&&F(i,"sham",!0),tt(n,r,i,t)}},kt=Array.isArray||function(t){return"Array"==v(t)},At=function(t){return Object(x(t))},Bt=function(t,e,n){var r=O(e);r in t?_.f(t,r,h(0,n)):t[r]=n},Ct=!!Object.getOwnPropertySymbols&&!f((function(){return!String(Symbol())})),_t=a.Symbol,Ft=I("wks"),Ht=function(t){return Ft[t]||(Ft[t]=Ct&&_t[t]||(Ct?_t:q)("Symbol."+t))},It=Ht("species"),Mt=function(t,e){var n;return kt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!kt(n.prototype)?w(n)&&null===(n=n[It])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Rt=Ht("species"),Nt=Ht("isConcatSpreadable"),Wt=!f((function(){var t=[];return t[Nt]=!1,t.concat()[0]!==t})),Lt=(X="concat",!f((function(){var t=[];return(t.constructor={})[Rt]=function(){return{foo:1}},1!==t[X](Boolean).foo}))),qt=function(t){if(!w(t))return!1;var e=t[Nt];return void 0!==e?!!e:kt(t)};Pt({target:"Array",proto:!0,forced:!Wt||!Lt},{concat:function(t){var e,n,r,o,i,c=At(this),u=Mt(c,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(i=-1===e?c:arguments[e],qt(i)){if(a+(o=at(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,a++)n in i&&Bt(u,a,i[n])}else{if(a>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Bt(u,a++,i)}return u.length=a,u}});var Dt=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},zt=[].push,Gt=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,c=5==t||i;return function(u,a,f,l){for(var s,d,p=At(u),h=b(p),y=Dt(a,f,3),v=at(h.length),g=0,x=l||Mt,m=e?x(u,v):n?x(u,0):void 0;v>g;g++)if((c||g in h)&&(d=y(s=h[g],g,p),t))if(e)m[g]=d;else if(d)switch(t){case 3:return!0;case 5:return s;case 6:return g;case 2:zt.call(m,s)}else if(o)return!1;return i?-1:r||o?o:m}},Vt={forEach:Gt(0),map:Gt(1),filter:Gt(2),some:Gt(3),every:Gt(4),find:Gt(5),findIndex:Gt(6)},Kt=Object.keys||function(t){return pt(t,ht)},Qt=l?Object.defineProperties:function(t,e){B(t);for(var n,r=Kt(e),o=r.length,i=0;o>i;)_.f(t,n=r[i++],e[n]);return t},Yt=rt("document","documentElement"),Jt=z("IE_PROTO"),Ut=function(){},Xt=function(){var t,e=T("iframe"),n=ht.length;for(e.style.display="none",Yt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Xt=t.F;n--;)delete Xt.prototype[ht[n]];return Xt()},Zt=Object.create||function(t,e){var n;return null!==t?(Ut.prototype=B(t),n=new Ut,Ut.prototype=null,n[Jt]=t):n=Xt(),void 0===e?n:Qt(n,e)};G[Jt]=!0;var te=Ht("unscopables"),ee=Array.prototype;null==ee[te]&&F(ee,te,Zt(null));var ne,re=Vt.find,oe=!0;"find"in[]&&Array(1).find((function(){oe=!1})),Pt({target:"Array",proto:!0,forced:oe},{find:function(t){return re(this,t,arguments.length>1?arguments[1]:void 0)}}),ne="find",ee[te][ne]=!0;var ie,ce,ue=function(){var t=B(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},ae=RegExp.prototype.exec,fe=String.prototype.replace,le=ae,se=(ie=/a/,ce=/b*/g,ae.call(ie,"a"),ae.call(ce,"a"),0!==ie.lastIndex||0!==ce.lastIndex),de=void 0!==/()??/.exec("")[1];(se||de)&&(le=function(t){var e,n,r,o,i=this;return de&&(n=new RegExp("^"+i.source+"$(?!\\s)",ue.call(i))),se&&(e=i.lastIndex),r=ae.call(i,t),se&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),de&&r&&r.length>1&&fe.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var pe=le,he=Ht("species"),ye=!f((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),ve=!f((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),ge=function(t){return function(e,n){var r,o,i=String(x(e)),c=ct(n),u=i.length;return c<0||c>=u?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===u||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}},be={codeAt:ge(!1),charAt:ge(!0)}.charAt,xe=function(t,e,n){return e+(n?be(t,e).length:1)},me=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==v(t))throw TypeError("RegExp#exec called on incompatible receiver");return pe.call(t,e)},we=Math.max,Oe=Math.min,je=Math.floor,$e=/\$([$&'`]|\d\d?|<[^>]*>)/g,Se=/\$([$&'`]|\d\d?)/g;function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Te(t){return(Te=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pe(t,e){return(Pe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ke(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ae(t,e,n){return(Ae="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Te(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}!function(t,e,n,r){var o=Ht(t),i=!f((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),c=i&&!f((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[he]=function(){return n}),n[o](""),!e}));if(!i||!c||"replace"===t&&!ye||"split"===t&&!ve){var u=/./[o],a=n(o,""[t],(function(t,e,n,r,o){return e.exec===pe?i&&!o?{done:!0,value:u.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),l=a[0],s=a[1];tt(String.prototype,t,l),tt(RegExp.prototype,o,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)}),r&&F(RegExp.prototype[o],"sham",!0)}}("replace",2,(function(t,e,n){return[function(n,r){var o=x(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,o){var i=n(e,t,this,o);if(i.done)return i.value;var c=B(t),u=String(this),a="function"==typeof o;a||(o=String(o));var f=c.global;if(f){var l=c.unicode;c.lastIndex=0}for(var s=[];;){var d=me(c,u);if(null===d)break;if(s.push(d),!f)break;""===String(d[0])&&(c.lastIndex=xe(u,at(c.lastIndex),l))}for(var p,h="",y=0,v=0;v<s.length;v++){d=s[v];for(var g=String(d[0]),b=we(Oe(ct(d.index),u.length),0),x=[],m=1;m<d.length;m++)x.push(void 0===(p=d[m])?p:String(p));var w=d.groups;if(a){var O=[g].concat(x,b,u);void 0!==w&&O.push(w);var j=String(o.apply(void 0,O))}else j=r(g,u,b,x,w,o);b>=y&&(h+=u.slice(y,b)+j,y=b+g.length)}return h+u.slice(y)}];function r(t,n,r,o,i,c){var u=r+t.length,a=o.length,f=Se;return void 0!==i&&(i=At(i),f=$e),e.call(c,f,(function(e,c){var f;switch(c.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(u);case"<":f=i[c.slice(1,-1)];break;default:var l=+c;if(0===l)return e;if(l>a){var s=je(l/10);return 0===s?e:s<=a?void 0===o[s-1]?c.charAt(1):o[s-1]+c.charAt(1):e}f=o[l-1]}return void 0===f?"":f}))}})),t.extend(t.fn.bootstrapTable.defaults,{fixedColumns:!1,fixedNumber:1}),t.BootstrapTable=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),ke(this,Te(n).apply(this,arguments))}var r,o,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pe(t,e)}(n,e),r=n,(o=[{key:"fitHeader",value:function(){for(var e,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if((e=Ae(Te(n.prototype),"fitHeader",this)).call.apply(e,[this].concat(o)),this.options.fixedColumns&&!this.$el.is(":hidden")){this.$container.find(".fixed-table-header-columns").remove(),this.$fixedHeader=t('<div class="fixed-table-header-columns"></div>'),this.$fixedHeader.append(this.$tableHeader.find(">table").clone(!0)),this.$tableHeader.after(this.$fixedHeader);var c=this.getFixedColumnsWidth();this.$fixedHeader.css({top:0,width:c,height:this.$tableHeader.outerHeight(!0)}),this.initFixedColumnsBody(),this.$fixedBody.css({top:this.$tableHeader.outerHeight(!0),width:c,height:this.$tableBody.outerHeight(!0)-1}),this.initFixedColumnsEvents()}}},{key:"initBody",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];(t=Ae(Te(n.prototype),"initBody",this)).call.apply(t,[this].concat(r)),this.options.fixedColumns&&(this.options.showHeader&&this.options.height||(this.initFixedColumnsBody(),this.$fixedBody.css({top:0,width:this.getFixedColumnsWidth(),height:this.$tableHeader.outerHeight(!0)+this.$tableBody.outerHeight(!0)}),this.initFixedColumnsEvents()))}},{key:"initFixedColumnsBody",value:function(){this.$container.find(".fixed-table-body-columns").remove(),this.$fixedBody=t('<div class="fixed-table-body-columns"></div>'),this.$fixedBody.append(this.$tableBody.find(">table").clone(!0)),this.$tableBody.after(this.$fixedBody)}},{key:"getFixedColumnsWidth",value:function(){for(var t=this.getVisibleFields(),e=0,n=0;n<this.options.fixedNumber;n++)e+=this.$header.find('th[data-field="'.concat(t[n],'"]')).outerWidth(!0);return e+1}},{key:"initFixedColumnsEvents",value:function(){var e=this;this.$tableBody.off("scroll.fixed-columns").on("scroll.fixed-columns",(function(n){e.$fixedBody.find("table").css("top",-t(n.currentTarget).scrollTop())})),this.$body.find("> tr[data-index]").off("hover").hover((function(n){var r=t(n.currentTarget).data("index");e.$fixedBody.find('tr[data-index="'.concat(r,'"]')).css("background-color",t(n.currentTarget).css("background-color"))}),(function(n){var r=t(n.currentTarget).data("index"),o=e.$fixedBody.find('tr[data-index="'.concat(r,'"]'));o.attr("style",o.attr("style").replace(/background-color:.*;/,""))})),this.$fixedBody.find("tr[data-index]").off("hover").hover((function(n){var r=t(n.currentTarget).data("index");e.$body.find('tr[data-index="'.concat(r,'"]')).css("background-color",t(n.currentTarget).css("background-color"))}),(function(n){var r=t(n.currentTarget).data("index"),o=e.$body.find('> tr[data-index="'.concat(r,'"]'));o.attr("style",o.attr("style").replace(/background-color:.*;/,""))}))}}])&&Ee(r.prototype,o),i&&Ee(r,i),n}(t.BootstrapTable)}));