UNPKG

15.3 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.18.1
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&&Object.prototype.hasOwnProperty.call(t,"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=function(t){return t&&t.Math==Math&&t},o=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")(),i=function(t){try{return!!t()}catch(t){return!0}},u=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),c={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,f={f:a&&!c.call({1:2},1)?function(t){var e=a(this,t);return!!e&&e.enumerable}:c},l=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},s={}.toString,p=function(t){return s.call(t).slice(8,-1)},y="".split,d=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?y.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return d(v(t))},h=function(t){return"object"==typeof t?null!==t:"function"==typeof t},b=function(t,e){if(!h(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!h(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,w=function(t,e){return m.call(t,e)},x=o.document,O=h(x)&&h(x.createElement),E=function(t){return O?x.createElement(t):{}},j=!u&&!i((function(){return 7!=Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a})),S=Object.getOwnPropertyDescriptor,P={f:u?S:function(t,e){if(t=g(t),e=b(e,!0),j)try{return S(t,e)}catch(t){}if(w(t,e))return l(!f.f.call(t,e),t[e])}},T=function(t){if(!h(t))throw TypeError(String(t)+" is not an object");return t},I=Object.defineProperty,R={f:u?I:function(t,e,n){if(T(t),e=b(e,!0),T(n),j)try{return I(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}},_=u?function(t,e,n){return R.f(t,e,l(1,n))}:function(t,e,n){return t[e]=n,t},k=function(t,e){try{_(o,t,e)}catch(n){o[t]=e}return e},A="__core-js_shared__",C=o[A]||k(A,{}),M=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(t){return M.call(t)});var N,$,F,D=C.inspectSource,K=o.WeakMap,L="function"==typeof K&&/native code/.test(D(K)),B=n((function(t){(t.exports=function(t,e){return C[t]||(C[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.0",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),q=0,U=Math.random(),W=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+U).toString(36)},z=B("keys"),Y=function(t){return z[t]||(z[t]=W(t))},G={},Q=o.WeakMap;if(L){var V=new Q,X=V.get,H=V.has,J=V.set;N=function(t,e){return J.call(V,t,e),e},$=function(t){return X.call(V,t)||{}},F=function(t){return H.call(V,t)}}else{var Z=Y("state");G[Z]=!0,N=function(t,e){return _(t,Z,e),e},$=function(t){return w(t,Z)?t[Z]:{}},F=function(t){return w(t,Z)}}var tt,et,nt={set:N,get:$,has:F,enforce:function(t){return F(t)?$(t):N(t,{})},getterFor:function(t){return function(e){var n;if(!h(e)||(n=$(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},rt=n((function(t){var e=nt.get,n=nt.enforce,r=String(String).split("String");(t.exports=function(t,e,i,u){var c=!!u&&!!u.unsafe,a=!!u&&!!u.enumerable,f=!!u&&!!u.noTargetGet;"function"==typeof i&&("string"!=typeof e||w(i,"name")||_(i,"name",e),n(i).source=r.join("string"==typeof e?e:"")),t!==o?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=i:_(t,e,i)):a?t[e]=i:k(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||D(this)}))})),ot=o,it=function(t){return"function"==typeof t?t:void 0},ut=function(t,e){return arguments.length<2?it(ot[t])||it(o[t]):ot[t]&&ot[t][e]||o[t]&&o[t][e]},ct=Math.ceil,at=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?at:ct)(t)},lt=Math.min,st=function(t){return t>0?lt(ft(t),9007199254740991):0},pt=Math.max,yt=Math.min,dt=function(t){return function(e,n,r){var o,i=g(e),u=st(i.length),c=function(t,e){var n=ft(t);return n<0?pt(n+e,0):yt(n,e)}(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},vt={includes:dt(!0),indexOf:dt(!1)}.indexOf,gt=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!w(G,n)&&w(r,n)&&i.push(n);for(;e.length>o;)w(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},ht=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bt=ht.concat("length","prototype"),mt={f:Object.getOwnPropertyNames||function(t){return gt(t,bt)}},wt={f:Object.getOwnPropertySymbols},xt=ut("Reflect","ownKeys")||function(t){var e=mt.f(T(t)),n=wt.f;return n?e.concat(n(t)):e},Ot=function(t,e){for(var n=xt(e),r=R.f,o=P.f,i=0;i<n.length;i++){var u=n[i];w(t,u)||r(t,u,o(e,u))}},Et=/#|\.prototype\./,jt=function(t,e){var n=Pt[St(t)];return n==It||n!=Tt&&("function"==typeof e?i(e):!!e)},St=jt.normalize=function(t){return String(t).replace(Et,".").toLowerCase()},Pt=jt.data={},Tt=jt.NATIVE="N",It=jt.POLYFILL="P",Rt=jt,_t=P.f,kt=function(t,e){var n,r,i,u,c,a=t.target,f=t.global,l=t.stat;if(n=f?o:l?o[a]||k(a,{}):(o[a]||{}).prototype)for(r in e){if(u=e[r],i=t.noTargetGet?(c=_t(n,r))&&c.value:n[r],!Rt(f?r:a+(l?".":"#")+r,t.forced)&&void 0!==i){if(typeof u==typeof i)continue;Ot(u,i)}(t.sham||i&&i.sham)&&_(u,"sham",!0),rt(n,r,u,t)}},At=Array.isArray||function(t){return"Array"==p(t)},Ct=function(t){return Object(v(t))},Mt=function(t,e,n){var r=b(e);r in t?R.f(t,r,l(0,n)):t[r]=n},Nt=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),$t=Nt&&!Symbol.sham&&"symbol"==typeof Symbol(),Ft=B("wks"),Dt=o.Symbol,Kt=$t?Dt:W,Lt=function(t){return w(Ft,t)||(Nt&&w(Dt,t)?Ft[t]=Dt[t]:Ft[t]=Kt("Symbol."+t)),Ft[t]},Bt=Lt("species"),qt=function(t,e){var n;return At(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!At(n.prototype)?h(n)&&null===(n=n[Bt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Ut=ut("navigator","userAgent")||"",Wt=o.process,zt=Wt&&Wt.versions,Yt=zt&&zt.v8;Yt?et=(tt=Yt.split("."))[0]+tt[1]:Ut&&(!(tt=Ut.match(/Edge\/(\d+)/))||tt[1]>=74)&&(tt=Ut.match(/Chrome\/(\d+)/))&&(et=tt[1]);var Gt,Qt=et&&+et,Vt=Lt("species"),Xt=Lt("isConcatSpreadable"),Ht=9007199254740991,Jt="Maximum allowed index exceeded",Zt=Qt>=51||!i((function(){var t=[];return t[Xt]=!1,t.concat()[0]!==t})),te=(Gt="concat",Qt>=51||!i((function(){var t=[];return(t.constructor={})[Vt]=function(){return{foo:1}},1!==t[Gt](Boolean).foo}))),ee=function(t){if(!h(t))return!1;var e=t[Xt];return void 0!==e?!!e:At(t)};kt({target:"Array",proto:!0,forced:!Zt||!te},{concat:function(t){var e,n,r,o,i,u=Ct(this),c=qt(u,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(ee(i=-1===e?u:arguments[e])){if(a+(o=st(i.length))>Ht)throw TypeError(Jt);for(n=0;n<o;n++,a++)n in i&&Mt(c,a,i[n])}else{if(a>=Ht)throw TypeError(Jt);Mt(c,a++,i)}return c.length=a,c}});var ne,re=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)}},oe=[].push,ie=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=5==t||i;return function(c,a,f,l){for(var s,p,y=Ct(c),v=d(y),g=re(a,f,3),h=st(v.length),b=0,m=l||qt,w=e?m(c,h):n?m(c,0):void 0;h>b;b++)if((u||b in v)&&(p=g(s=v[b],b,y),t))if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return s;case 6:return b;case 2:oe.call(w,s)}else if(o)return!1;return i?-1:r||o?o:w}},ue={forEach:ie(0),map:ie(1),filter:ie(2),some:ie(3),every:ie(4),find:ie(5),findIndex:ie(6)},ce=Object.keys||function(t){return gt(t,ht)},ae=u?Object.defineProperties:function(t,e){T(t);for(var n,r=ce(e),o=r.length,i=0;o>i;)R.f(t,n=r[i++],e[n]);return t},fe=ut("document","documentElement"),le=Y("IE_PROTO"),se=function(){},pe=function(t){return"<script>"+t+"</"+"script>"},ye=function(){try{ne=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;ye=ne?function(t){t.write(pe("")),t.close();var e=t.parentWindow.Object;return t=null,e}(ne):((e=E("iframe")).style.display="none",fe.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(pe("document.F=Object")),t.close(),t.F);for(var n=ht.length;n--;)delete ye.prototype[ht[n]];return ye()};G[le]=!0;var de=Object.create||function(t,e){var n;return null!==t?(se.prototype=T(t),n=new se,se.prototype=null,n[le]=t):n=ye(),void 0===e?n:ae(n,e)},ve=Lt("unscopables"),ge=Array.prototype;null==ge[ve]&&R.f(ge,ve,{configurable:!0,value:de(null)});var he,be=ue.find,me="find",we=!0;me in[]&&Array(1).find((function(){we=!1})),kt({target:"Array",proto:!0,forced:we},{find:function(t){return be(this,t,arguments.length>1?arguments[1]:void 0)}}),he=me,ge[ve][he]=!0;var xe=function(){var t=T(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};function Oe(t,e){return RegExp(t,e)}var Ee,je,Se={UNSUPPORTED_Y:i((function(){var t=Oe("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:i((function(){var t=Oe("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Pe=RegExp.prototype.exec,Te=String.prototype.replace,Ie=Pe,Re=(Ee=/a/,je=/b*/g,Pe.call(Ee,"a"),Pe.call(je,"a"),0!==Ee.lastIndex||0!==je.lastIndex),_e=Se.UNSUPPORTED_Y||Se.BROKEN_CARET,ke=void 0!==/()??/.exec("")[1];(Re||ke||_e)&&(Ie=function(t){var e,n,r,o,i=this,u=_e&&i.sticky,c=xe.call(i),a=i.source,f=0,l=t;return u&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),l=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(a="(?: "+a+")",l=" "+l,f++),n=new RegExp("^(?:"+a+")",c)),ke&&(n=new RegExp("^"+a+"$(?!\\s)",c)),Re&&(e=i.lastIndex),r=Pe.call(u?n:i,l),u?r?(r.input=r.input.slice(f),r[0]=r[0].slice(f),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:Re&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),ke&&r&&r.length>1&&Te.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var Ae=Ie;kt({target:"RegExp",proto:!0,forced:/./.exec!==Ae},{exec:Ae});var Ce=Lt("species"),Me=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Ne="$0"==="a".replace(/./,"$0"),$e=!i((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]})),Fe=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};function De(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ke(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 Le(t){return(Le=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Be(t,e){return(Be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qe(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 Ue(t,e,n){return(Ue="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=Le(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=Lt(t),u=!i((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),c=u&&!i((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[Ce]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return e=!0,null},n[o](""),!e}));if(!u||!c||"replace"===t&&(!Me||!Ne)||"split"===t&&!$e){var a=/./[o],f=n(o,""[t],(function(t,e,n,r,o){return e.exec===Ae?u&&!o?{done:!0,value:a.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Ne}),l=f[0],s=f[1];rt(String.prototype,t,l),rt(RegExp.prototype,o,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&_(RegExp.prototype[o],"sham",!0)}("search",1,(function(t,e,n){return[function(e){var n=v(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var o=T(t),i=String(this),u=o.lastIndex;Fe(u,0)||(o.lastIndex=0);var c=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"!==p(t))throw TypeError("RegExp#exec called on incompatible receiver");return Ae.call(t,e)}(o,i);return Fe(o.lastIndex,u)||(o.lastIndex=u),null===c?-1:c.index}]}));var We=t.fn.bootstrapTable.utils;t.extend(t.fn.bootstrapTable.defaults,{keyEvents:!1}),t.BootstrapTable=function(e){function n(){return De(this,n),qe(this,Le(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&&Be(t,e)}(n,e),r=n,(o=[{key:"init",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];(t=Ue(Le(n.prototype),"init",this)).call.apply(t,[this].concat(r)),this.options.keyEvents&&this.initKeyEvents()}},{key:"initKeyEvents",value:function(){var e=this;t(document).off("keydown").on("keydown",(function(n){var r=We.getSearchInput(e),o=e.$toolbar.find('button[name="refresh"]'),i=e.$toolbar.find('button[name="toggle"]'),u=e.$toolbar.find('button[name="paginationSwitch"]');if(document.activeElement===r.get(0)||!t.contains(document.activeElement,e.$toolbar.get(0)))return!0;switch(n.keyCode){case 83:if(!e.options.search)return;return r.focus(),!1;case 82:if(!e.options.showRefresh)return;return o.click(),!1;case 84:if(!e.options.showToggle)return;return i.click(),!1;case 80:if(!e.options.showPaginationSwitch)return;return u.click(),!1;case 37:if(!e.options.pagination)return;return e.prevPage(),!1;case 39:if(!e.options.pagination)return;return void e.nextPage()}}))}}])&&Ke(r.prototype,o),i&&Ke(r,i),n}(t.BootstrapTable)}));