UNPKG

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