UNPKG

12.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,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",f=function(t){return t&&t.Math==Math&&t},u=f(typeof globalThis==c&&globalThis)||f(typeof window==c&&window)||f(typeof self==c&&self)||f(typeof e==c&&e)||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},s=!a((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),l={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,y={f:p&&!l.call({1:2},1)?function(t){var e=p(this,t);return!!e&&e.enumerable}:l},d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,b=function(t){return h.call(t).slice(8,-1)},v="".split,g=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?v.call(t,""):Object(t)}:Object,w=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},m=function(t){return g(w(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},k=function(t,e){if(!O(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!O(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!O(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!O(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=u.document,_=O(S)&&O(S.createElement),P=function(t){return _?S.createElement(t):{}},T=!s&&!a((function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a})),E=Object.getOwnPropertyDescriptor,x={f:s?E:function(t,e){if(t=m(t),e=k(e,!0),T)try{return E(t,e)}catch(t){}if($(t,e))return d(!y.f.call(t,e),t[e])}},C=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},H=Object.defineProperty,A={f:s?H:function(t,e,n){if(C(t),e=k(e,!0),C(n),T)try{return H(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}},M=s?function(t,e,n){return A.f(t,e,d(1,n))}:function(t,e,n){return t[e]=n,t},B=function(t,e){try{M(u,t,e)}catch(n){u[t]=e}return e},L=n((function(t){var e=u["__core-js_shared__"]||B("__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)"})})),I=L("native-function-to-string",Function.toString),R=u.WeakMap,q="function"==typeof R&&/native code/.test(I.call(R)),F=0,N=Math.random(),Y=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++F+N).toString(36)},z=L("keys"),D=function(t){return z[t]||(z[t]=Y(t))},W={},X=u.WeakMap;if(q){var G=new X,K=G.get,Q=G.has,V=G.set;r=function(t,e){return V.call(G,t,e),e},o=function(t){return K.call(G,t)||{}},i=function(t){return Q.call(G,t)}}else{var J=D("state");W[J]=!0,r=function(t,e){return M(t,J,e),e},o=function(t){return $(t,J)?t[J]:{}},i=function(t){return $(t,J)}}var U,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(!O(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(I).split("toString");L("inspectSource",(function(t){return I.call(t)})),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,f=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||$(o,"name")||M(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==u?(c?!a&&t[e]&&(f=!0):delete t[e],f?t[e]=o:M(t,e,o)):f?t[e]=o:B(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||I.call(this)}))})),et=u,nt=function(t){return"function"==typeof t?t:void 0},rt=function(t,e){return arguments.length<2?nt(et[t])||nt(u[t]):et[t]&&et[t][e]||u[t]&&u[t][e]},ot=Math.ceil,it=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?it:ot)(t)},ft=Math.min,ut=function(t){return t>0?ft(ct(t),9007199254740991):0},at=Math.max,st=Math.min,lt=function(t){return function(e,n,r){var o,i=m(e),c=ut(i.length),f=function(t,e){var n=ct(t);return n<0?at(n+e,0):st(n,e)}(r,c);if(t&&n!=n){for(;c>f;)if((o=i[f++])!=o)return!0}else for(;c>f;f++)if((t||f in i)&&i[f]===n)return t||f||0;return!t&&-1}},pt={includes:lt(!0),indexOf:lt(!1)}.indexOf,yt=function(t,e){var n,r=m(t),o=0,i=[];for(n in r)!$(W,n)&&$(r,n)&&i.push(n);for(;e.length>o;)$(r,n=e[o++])&&(~pt(i,n)||i.push(n));return i},dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ht=dt.concat("length","prototype"),bt={f:Object.getOwnPropertyNames||function(t){return yt(t,ht)}},vt={f:Object.getOwnPropertySymbols},gt=rt("Reflect","ownKeys")||function(t){var e=bt.f(C(t)),n=vt.f;return n?e.concat(n(t)):e},wt=function(t,e){for(var n=gt(e),r=A.f,o=x.f,i=0;i<n.length;i++){var c=n[i];$(t,c)||r(t,c,o(e,c))}},mt=/#|\.prototype\./,Ot=function(t,e){var n=jt[kt(t)];return n==St||n!=$t&&("function"==typeof e?a(e):!!e)},kt=Ot.normalize=function(t){return String(t).replace(mt,".").toLowerCase()},jt=Ot.data={},$t=Ot.NATIVE="N",St=Ot.POLYFILL="P",_t=Ot,Pt=x.f,Tt=function(t,e){var n,r,o,i,c,f=t.target,a=t.global,s=t.stat;if(n=a?u:s?u[f]||B(f,{}):(u[f]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=Pt(n,r))&&c.value:n[r],!_t(a?r:f+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;wt(i,o)}(t.sham||o&&o.sham)&&M(i,"sham",!0),tt(n,r,i,t)}},Et=Array.isArray||function(t){return"Array"==b(t)},xt=function(t){return Object(w(t))},Ct=function(t,e,n){var r=k(e);r in t?A.f(t,r,d(0,n)):t[r]=n},Ht=!!Object.getOwnPropertySymbols&&!a((function(){return!String(Symbol())})),At=u.Symbol,Mt=L("wks"),Bt=function(t){return Mt[t]||(Mt[t]=Ht&&At[t]||(Ht?At:Y)("Symbol."+t))},Lt=Bt("species"),It=function(t,e){var n;return Et(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Et(n.prototype)?O(n)&&null===(n=n[Lt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Rt=Bt("species"),qt=Bt("isConcatSpreadable"),Ft=!a((function(){var t=[];return t[qt]=!1,t.concat()[0]!==t})),Nt=(U="concat",!a((function(){var t=[];return(t.constructor={})[Rt]=function(){return{foo:1}},1!==t[U](Boolean).foo}))),Yt=function(t){if(!O(t))return!1;var e=t[qt];return void 0!==e?!!e:Et(t)};Tt({target:"Array",proto:!0,forced:!Ft||!Nt},{concat:function(t){var e,n,r,o,i,c=xt(this),f=It(c,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(i=-1===e?c:arguments[e],Yt(i)){if(u+(o=ut(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,u++)n in i&&Ct(f,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(f,u++,i)}return f.length=u,f}});var zt=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)}},Dt=[].push,Wt=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,c=5==t||i;return function(f,u,a,s){for(var l,p,y=xt(f),d=g(y),h=zt(u,a,3),b=ut(d.length),v=0,w=s||It,m=e?w(f,b):n?w(f,0):void 0;b>v;v++)if((c||v in d)&&(p=h(l=d[v],v,y),t))if(e)m[v]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return v;case 2:Dt.call(m,l)}else if(o)return!1;return i?-1:r||o?o:m}},Xt={forEach:Wt(0),map:Wt(1),filter:Wt(2),some:Wt(3),every:Wt(4),find:Wt(5),findIndex:Wt(6)},Gt=Object.keys||function(t){return yt(t,dt)},Kt=s?Object.defineProperties:function(t,e){C(t);for(var n,r=Gt(e),o=r.length,i=0;o>i;)A.f(t,n=r[i++],e[n]);return t},Qt=rt("document","documentElement"),Vt=D("IE_PROTO"),Jt=function(){},Ut=function(){var t,e=P("iframe"),n=dt.length;for(e.style.display="none",Qt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Ut=t.F;n--;)delete Ut.prototype[dt[n]];return Ut()},Zt=Object.create||function(t,e){var n;return null!==t?(Jt.prototype=C(t),n=new Jt,Jt.prototype=null,n[Vt]=t):n=Ut(),void 0===e?n:Kt(n,e)};W[Vt]=!0;var te=Bt("unscopables"),ee=Array.prototype;null==ee[te]&&M(ee,te,Zt(null));var ne,re=Xt.find,oe=!0;function ie(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 ce(t){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function fe(t,e){return(fe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ue(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=ce(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)}"find"in[]&&Array(1).find((function(){oe=!1})),Tt({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;t.fn.bootstrapTable.utils;t.extend(t.fn.bootstrapTable.defaults,{stickyHeader:!1,stickyHeaderOffsetY:0,stickyHeaderOffsetLeft:0,stickyHeaderOffsetRight:0});var se={bootstrap3:"hidden"}[t.fn.bootstrapTable.theme]||"d-none";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),ue(this,ce(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&&fe(t,e)}(n,e),r=n,(o=[{key:"initHeader",value:function(){for(var e,r=this,o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];(e=ae(ce(n.prototype),"initHeader",this)).call.apply(e,[this].concat(i)),this.options.stickyHeader&&(this.$el.before('<div class="sticky-header-container"></div>'),this.$el.before('<div class="sticky_anchor_begin"></div>'),this.$el.after('<div class="sticky_anchor_end"></div>'),this.$header.addClass("sticky-header"),this.$stickyContainer=this.$tableBody.find(".sticky-header-container"),this.$stickyBegin=this.$tableBody.find(".sticky_anchor_begin"),this.$stickyEnd=this.$tableBody.find(".sticky_anchor_end"),this.$stickyHeader=this.$header.clone(!0,!0),t(window).on("resize.sticky-header-table",(function(){return r.renderStickyHeader()})),t(window).on("scroll.sticky-header-table",(function(){return r.renderStickyHeader()})),this.$tableBody.off("scroll").on("scroll",(function(){return r.matchPositionX()})))}},{key:"renderStickyHeader",value:function(){var e=this,n=t(window).scrollTop(),r=this.$stickyBegin.offset().top-this.options.stickyHeaderOffsetY,o=this.$stickyEnd.offset().top-this.options.stickyHeaderOffsetY-this.$header.height();n>r&&n<=o?(this.$stickyHeader.find("tr:eq(0)").find("th").each((function(n,r){t(r).css("min-width",e.$header.find("tr:eq(0)").find("th").eq(n).css("width"))})),this.$stickyContainer.removeClass(se).addClass("fix-sticky fixed-table-container"),this.$stickyContainer.css("top","".concat(this.options.stickyHeaderOffsetY)),this.$stickyContainer.css("left","".concat(this.options.stickyHeaderOffsetLeft)),this.$stickyContainer.css("right","".concat(this.options.stickyHeaderOffsetRight)),this.$stickyTable=t("<table/>"),this.$stickyTable.addClass(this.options.classes),this.$stickyContainer.html(this.$stickyTable.append(this.$stickyHeader)),this.matchPositionX()):this.$stickyContainer.removeClass("fix-sticky").addClass(se)}},{key:"matchPositionX",value:function(){this.$stickyContainer.scrollLeft(this.$tableBody.scrollLeft())}}])&&ie(r.prototype,o),i&&ie(r,i),n}(t.BootstrapTable)}));