UNPKG

bootstrap-table

Version:

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)

11 lines (9 loc) 15.3 kB
/** * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation) * * @version v1.17.1 * @homepage https://bootstrap-table.com * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/) * @license MIT */ !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},h=function(t){return d(v(t))},g=function(t){return"object"==typeof t?null!==t:"function"==typeof t},b=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(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=g(x)&&g(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=h(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(!g(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,R={f:u?_:function(t,e,n){if(T(t),e=b(e,!0),T(n),j)try{return _(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}},I=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{I(o,t,e)}catch(n){o[t]=e}return e},A=o["__core-js_shared__"]||k("__core-js_shared__",{}),C=Function.toString;"function"!=typeof A.inspectSource&&(A.inspectSource=function(t){return C.call(t)});var M,$,N,F=A.inspectSource,D=o.WeakMap,K="function"==typeof D&&/native code/.test(F(D)),L=n((function(t){(t.exports=function(t,e){return A[t]||(A[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.0",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),B=0,q=Math.random(),U=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++B+q).toString(36)},W=L("keys"),z=function(t){return W[t]||(W[t]=U(t))},Y={},G=o.WeakMap;if(K){var Q=new G,V=Q.get,X=Q.has,H=Q.set;M=function(t,e){return H.call(Q,t,e),e},$=function(t){return V.call(Q,t)||{}},N=function(t){return X.call(Q,t)}}else{var J=z("state");Y[J]=!0,M=function(t,e){return I(t,J,e),e},$=function(t){return w(t,J)?t[J]:{}},N=function(t){return w(t,J)}}var Z,tt,et={set:M,get:$,has:N,enforce:function(t){return N(t)?$(t):M(t,{})},getterFor:function(t){return function(e){var n;if(!g(e)||(n=$(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},nt=n((function(t){var e=et.get,n=et.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(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:I(t,e,i)):a?t[e]=i:k(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||F(this)}))})),rt=o,ot=function(t){return"function"==typeof t?t:void 0},it=function(t,e){return arguments.length<2?ot(rt[t])||ot(o[t]):rt[t]&&rt[t][e]||o[t]&&o[t][e]},ut=Math.ceil,ct=Math.floor,at=function(t){return isNaN(t=+t)?0:(t>0?ct:ut)(t)},ft=Math.min,lt=function(t){return t>0?ft(at(t),9007199254740991):0},st=Math.max,pt=Math.min,yt=function(t){return function(e,n,r){var o,i=h(e),u=lt(i.length),c=function(t,e){var n=at(t);return n<0?st(n+e,0):pt(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}},dt={includes:yt(!0),indexOf:yt(!1)}.indexOf,vt=function(t,e){var n,r=h(t),o=0,i=[];for(n in r)!w(Y,n)&&w(r,n)&&i.push(n);for(;e.length>o;)w(r,n=e[o++])&&(~dt(i,n)||i.push(n));return i},ht=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gt=ht.concat("length","prototype"),bt={f:Object.getOwnPropertyNames||function(t){return vt(t,gt)}},mt={f:Object.getOwnPropertySymbols},wt=it("Reflect","ownKeys")||function(t){var e=bt.f(T(t)),n=mt.f;return n?e.concat(n(t)):e},xt=function(t,e){for(var n=wt(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))}},Ot=/#|\.prototype\./,Et=function(t,e){var n=St[jt(t)];return n==Tt||n!=Pt&&("function"==typeof e?i(e):!!e)},jt=Et.normalize=function(t){return String(t).replace(Ot,".").toLowerCase()},St=Et.data={},Pt=Et.NATIVE="N",Tt=Et.POLYFILL="P",_t=Et,Rt=P.f,It=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=Rt(n,r))&&c.value:n[r],!_t(f?r:a+(l?".":"#")+r,t.forced)&&void 0!==i){if(typeof u==typeof i)continue;xt(u,i)}(t.sham||i&&i.sham)&&I(u,"sham",!0),nt(n,r,u,t)}},kt=Array.isArray||function(t){return"Array"==p(t)},At=function(t){return Object(v(t))},Ct=function(t,e,n){var r=b(e);r in t?R.f(t,r,l(0,n)):t[r]=n},Mt=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),$t=Mt&&!Symbol.sham&&"symbol"==typeof Symbol(),Nt=L("wks"),Ft=o.Symbol,Dt=$t?Ft:U,Kt=function(t){return w(Nt,t)||(Mt&&w(Ft,t)?Nt[t]=Ft[t]:Nt[t]=Dt("Symbol."+t)),Nt[t]},Lt=Kt("species"),Bt=function(t,e){var n;return kt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!kt(n.prototype)?g(n)&&null===(n=n[Lt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},qt=it("navigator","userAgent")||"",Ut=o.process,Wt=Ut&&Ut.versions,zt=Wt&&Wt.v8;zt?tt=(Z=zt.split("."))[0]+Z[1]:qt&&(!(Z=qt.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=qt.match(/Chrome\/(\d+)/))&&(tt=Z[1]);var Yt,Gt=tt&&+tt,Qt=Kt("species"),Vt=Kt("isConcatSpreadable"),Xt=Gt>=51||!i((function(){var t=[];return t[Vt]=!1,t.concat()[0]!==t})),Ht=(Yt="concat",Gt>=51||!i((function(){var t=[];return(t.constructor={})[Qt]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),Jt=function(t){if(!g(t))return!1;var e=t[Vt];return void 0!==e?!!e:kt(t)};It({target:"Array",proto:!0,forced:!Xt||!Ht},{concat:function(t){var e,n,r,o,i,u=At(this),c=Bt(u,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(Jt(i=-1===e?u:arguments[e])){if(a+(o=lt(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,a++)n in i&&Ct(c,a,i[n])}else{if(a>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ct(c,a++,i)}return c.length=a,c}});var Zt,te=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)}},ee=[].push,ne=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=At(c),v=d(y),h=te(a,f,3),g=lt(v.length),b=0,m=l||Bt,w=e?m(c,g):n?m(c,0):void 0;g>b;b++)if((u||b in v)&&(p=h(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:ee.call(w,s)}else if(o)return!1;return i?-1:r||o?o:w}},re={forEach:ne(0),map:ne(1),filter:ne(2),some:ne(3),every:ne(4),find:ne(5),findIndex:ne(6)},oe=Object.keys||function(t){return vt(t,ht)},ie=u?Object.defineProperties:function(t,e){T(t);for(var n,r=oe(e),o=r.length,i=0;o>i;)R.f(t,n=r[i++],e[n]);return t},ue=it("document","documentElement"),ce=z("IE_PROTO"),ae=function(){},fe=function(t){return"<script>"+t+"<\/script>"},le=function(){try{Zt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;le=Zt?function(t){t.write(fe("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Zt):((e=E("iframe")).style.display="none",ue.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(fe("document.F=Object")),t.close(),t.F);for(var n=ht.length;n--;)delete le.prototype[ht[n]];return le()};Y[ce]=!0;var se=Object.create||function(t,e){var n;return null!==t?(ae.prototype=T(t),n=new ae,ae.prototype=null,n[ce]=t):n=le(),void 0===e?n:ie(n,e)},pe=Kt("unscopables"),ye=Array.prototype;null==ye[pe]&&R.f(ye,pe,{configurable:!0,value:se(null)});var de,ve=re.find,he=!0;"find"in[]&&Array(1).find((function(){he=!1})),It({target:"Array",proto:!0,forced:he},{find:function(t){return ve(this,t,arguments.length>1?arguments[1]:void 0)}}),de="find",ye[pe][de]=!0;var ge=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 be(t,e){return RegExp(t,e)}var me,we,xe={UNSUPPORTED_Y:i((function(){var t=be("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:i((function(){var t=be("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Oe=RegExp.prototype.exec,Ee=String.prototype.replace,je=Oe,Se=(me=/a/,we=/b*/g,Oe.call(me,"a"),Oe.call(we,"a"),0!==me.lastIndex||0!==we.lastIndex),Pe=xe.UNSUPPORTED_Y||xe.BROKEN_CARET,Te=void 0!==/()??/.exec("")[1];(Se||Te||Pe)&&(je=function(t){var e,n,r,o,i=this,u=Pe&&i.sticky,c=ge.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)),Te&&(n=new RegExp("^"+a+"$(?!\\s)",c)),Se&&(e=i.lastIndex),r=Oe.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:Se&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),Te&&r&&r.length>1&&Ee.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var _e=je;It({target:"RegExp",proto:!0,forced:/./.exec!==_e},{exec:_e});var Re=Kt("species"),Ie=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),ke="$0"==="a".replace(/./,"$0"),Ae=!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]})),Ce=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $e(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 Ne(t){return(Ne=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 De(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 Ke(t,e,n){return(Ke="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=Ne(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=Kt(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[Re]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return e=!0,null},n[o](""),!e}));if(!u||!c||"replace"===t&&(!Ie||!ke)||"split"===t&&!Ae){var a=/./[o],f=n(o,""[t],(function(t,e,n,r,o){return e.exec===_e?u&&!o?{done:!0,value:a.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:ke}),l=f[0],s=f[1];nt(String.prototype,t,l),nt(RegExp.prototype,o,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&I(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;Ce(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 _e.call(t,e)}(o,i);return Ce(o.lastIndex,u)||(o.lastIndex=u),null===c?-1:c.index}]})),t.extend(t.fn.bootstrapTable.defaults,{keyEvents:!1}),t.BootstrapTable=function(e){function n(){return Me(this,n),De(this,Ne(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:"init",value:function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];(t=Ke(Ne(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=e.$toolbar.find(".search input"),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()}}))}}])&&$e(r.prototype,o),i&&$e(r,i),n}(t.BootstrapTable)}));