UNPKG

18.1 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.20.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,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=n(t);function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){for(var e=0;e<n.length;e++){var r=n[e];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)},i(t)}function c(t,n){return c=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},c(t,n)}function u(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var n=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 e,r=i(t);if(n){var o=i(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return u(this,e)}}function s(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=i(t)););return t}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){var r=s(t,n);if(r){var o=Object.getOwnPropertyDescriptor(r,n);return o.get?o.get.call(arguments.length<3?t:e):o.value}},f.apply(this,arguments)}var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(t,n){return t(n={exports:{}},n.exports),n.exports}var d,h,y=function(t){return t&&t.Math==Math&&t},b=y("object"==typeof globalThis&&globalThis)||y("object"==typeof window&&window)||y("object"==typeof self&&self)||y("object"==typeof l&&l)||function(){return this}()||Function("return this")(),v=function(t){try{return!!t()}catch(t){return!0}},g=!v((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),m=!v((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),w=Function.prototype.call,O=m?w.bind(w):function(){return w.apply(w,arguments)},j={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,P={f:S&&!j.call({1:2},1)?function(t){var n=S(this,t);return!!n&&n.enumerable}:j},T=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},E=Function.prototype,A=E.bind,k=E.call,x=m&&A.bind(k,k),C=m?function(t){return t&&x(t)}:function(t){return t&&function(){return k.apply(t,arguments)}},D=C({}.toString),R=C("".slice),_=function(t){return R(D(t),8,-1)},I=b.Object,F=C("".split),M=v((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"==_(t)?F(t,""):I(t)}:I,z=b.TypeError,B=function(t){if(null==t)throw z("Can't call method on "+t);return t},G=function(t){return M(B(t))},L=function(t){return"function"==typeof t},N=function(t){return"object"==typeof t?null!==t:L(t)},q=function(t){return L(t)?t:void 0},W=function(t,n){return arguments.length<2?q(b[t]):b[t]&&b[t][n]},U=C({}.isPrototypeOf),$=W("navigator","userAgent")||"",X=b.process,K=b.Deno,Q=X&&X.versions||K&&K.version,V=Q&&Q.v8;V&&(h=(d=V.split("."))[0]>0&&d[0]<4?1:+(d[0]+d[1])),!h&&$&&(!(d=$.match(/Edge\/(\d+)/))||d[1]>=74)&&(d=$.match(/Chrome\/(\d+)/))&&(h=+d[1]);var Y=h,H=!!Object.getOwnPropertySymbols&&!v((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Y&&Y<41})),J=H&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Z=b.Object,tt=J?function(t){return"symbol"==typeof t}:function(t){var n=W("Symbol");return L(n)&&U(n.prototype,Z(t))},nt=b.String,et=b.TypeError,rt=function(t){if(L(t))return t;throw et(function(t){try{return nt(t)}catch(t){return"Object"}}(t)+" is not a function")},ot=b.TypeError,it=Object.defineProperty,ct=function(t,n){try{it(b,t,{value:n,configurable:!0,writable:!0})}catch(e){b[t]=n}return n},ut="__core-js_shared__",at=b[ut]||ct(ut,{}),st=p((function(t){(t.exports=function(t,n){return at[t]||(at[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.22.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),ft=b.Object,lt=function(t){return ft(B(t))},pt=C({}.hasOwnProperty),dt=Object.hasOwn||function(t,n){return pt(lt(t),n)},ht=0,yt=Math.random(),bt=C(1..toString),vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+bt(++ht+yt,36)},gt=st("wks"),mt=b.Symbol,wt=mt&&mt.for,Ot=J?mt:mt&&mt.withoutSetter||vt,jt=function(t){if(!dt(gt,t)||!H&&"string"!=typeof gt[t]){var n="Symbol."+t;H&&dt(mt,t)?gt[t]=mt[t]:gt[t]=J&&wt?wt(n):Ot(n)}return gt[t]},St=b.TypeError,Pt=jt("toPrimitive"),Tt=function(t,n){if(!N(t)||tt(t))return t;var e,r,o=null==(e=t[Pt])?void 0:rt(e);if(o){if(void 0===n&&(n="default"),r=O(o,t,n),!N(r)||tt(r))return r;throw St("Can't convert object to primitive value")}return void 0===n&&(n="number"),function(t,n){var e,r;if("string"===n&&L(e=t.toString)&&!N(r=O(e,t)))return r;if(L(e=t.valueOf)&&!N(r=O(e,t)))return r;if("string"!==n&&L(e=t.toString)&&!N(r=O(e,t)))return r;throw ot("Can't convert object to primitive value")}(t,n)},Et=function(t){var n=Tt(t,"string");return tt(n)?n:n+""},At=b.document,kt=N(At)&&N(At.createElement),xt=function(t){return kt?At.createElement(t):{}},Ct=!g&&!v((function(){return 7!=Object.defineProperty(xt("div"),"a",{get:function(){return 7}}).a})),Dt=Object.getOwnPropertyDescriptor,Rt={f:g?Dt:function(t,n){if(t=G(t),n=Et(n),Ct)try{return Dt(t,n)}catch(t){}if(dt(t,n))return T(!O(P.f,t,n),t[n])}},_t=g&&v((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),It=b.String,Ft=b.TypeError,Mt=function(t){if(N(t))return t;throw Ft(It(t)+" is not an object")},zt=b.TypeError,Bt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,Lt="enumerable",Nt="configurable",qt="writable",Wt={f:g?_t?function(t,n,e){if(Mt(t),n=Et(n),Mt(e),"function"==typeof t&&"prototype"===n&&"value"in e&&qt in e&&!e.writable){var r=Gt(t,n);r&&r.writable&&(t[n]=e.value,e={configurable:Nt in e?e.configurable:r.configurable,enumerable:Lt in e?e.enumerable:r.enumerable,writable:!1})}return Bt(t,n,e)}:Bt:function(t,n,e){if(Mt(t),n=Et(n),Mt(e),Ct)try{return Bt(t,n,e)}catch(t){}if("get"in e||"set"in e)throw zt("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},Ut=g?function(t,n,e){return Wt.f(t,n,T(1,e))}:function(t,n,e){return t[n]=e,t},$t=Function.prototype,Xt=g&&Object.getOwnPropertyDescriptor,Kt=dt($t,"name"),Qt={EXISTS:Kt,PROPER:Kt&&"something"===function(){}.name,CONFIGURABLE:Kt&&(!g||g&&Xt($t,"name").configurable)},Vt=C(Function.toString);L(at.inspectSource)||(at.inspectSource=function(t){return Vt(t)});var Yt,Ht,Jt,Zt=at.inspectSource,tn=b.WeakMap,nn=L(tn)&&/native code/.test(Zt(tn)),en=st("keys"),rn=function(t){return en[t]||(en[t]=vt(t))},on={},cn="Object already initialized",un=b.TypeError,an=b.WeakMap;if(nn||at.state){var sn=at.state||(at.state=new an),fn=C(sn.get),ln=C(sn.has),pn=C(sn.set);Yt=function(t,n){if(ln(sn,t))throw new un(cn);return n.facade=t,pn(sn,t,n),n},Ht=function(t){return fn(sn,t)||{}},Jt=function(t){return ln(sn,t)}}else{var dn=rn("state");on[dn]=!0,Yt=function(t,n){if(dt(t,dn))throw new un(cn);return n.facade=t,Ut(t,dn,n),n},Ht=function(t){return dt(t,dn)?t[dn]:{}},Jt=function(t){return dt(t,dn)}}var hn={set:Yt,get:Ht,has:Jt,enforce:function(t){return Jt(t)?Ht(t):Yt(t,{})},getterFor:function(t){return function(n){var e;if(!N(n)||(e=Ht(n)).type!==t)throw un("Incompatible receiver, "+t+" required");return e}}},yn=p((function(t){var n=Wt.f,e=Qt.CONFIGURABLE,r=hn.enforce,o=hn.get,i=!v((function(){return 8!==n((function(){}),"length",{value:8}).length})),c=String(String).split("String"),u=t.exports=function(t,o,u){"Symbol("===String(o).slice(0,7)&&(o="["+String(o).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),u&&u.getter&&(o="get "+o),u&&u.setter&&(o="set "+o),(!dt(t,"name")||e&&t.name!==o)&&n(t,"name",{value:o,configurable:!0}),i&&u&&dt(u,"arity")&&t.length!==u.arity&&n(t,"length",{value:u.arity});var a=r(t);return dt(a,"source")||(a.source=c.join("string"==typeof o?o:"")),t};Function.prototype.toString=u((function(){return L(this)&&o(this).source||Zt(this)}),"toString")})),bn=function(t,n,e,r){var o=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,c=!!r&&!!r.noTargetGet,u=r&&void 0!==r.name?r.name:n;return L(e)&&yn(e,u,r),t===b?(i?t[n]=e:ct(n,e),t):(o?!c&&t[n]&&(i=!0):delete t[n],i?t[n]=e:Ut(t,n,e),t)},vn=Math.ceil,gn=Math.floor,mn=function(t){var n=+t;return n!=n||0===n?0:(n>0?gn:vn)(n)},wn=Math.max,On=Math.min,jn=Math.min,Sn=function(t){return(n=t.length)>0?jn(mn(n),9007199254740991):0;var n},Pn=function(t){return function(n,e,r){var o,i=G(n),c=Sn(i),u=function(t,n){var e=mn(t);return e<0?wn(e+n,0):On(e,n)}(r,c);if(t&&e!=e){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((t||u in i)&&i[u]===e)return t||u||0;return!t&&-1}},Tn={includes:Pn(!0),indexOf:Pn(!1)},En=Tn.indexOf,An=C([].push),kn=function(t,n){var e,r=G(t),o=0,i=[];for(e in r)!dt(on,e)&&dt(r,e)&&An(i,e);for(;n.length>o;)dt(r,e=n[o++])&&(~En(i,e)||An(i,e));return i},xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Cn=xn.concat("length","prototype"),Dn={f:Object.getOwnPropertyNames||function(t){return kn(t,Cn)}},Rn={f:Object.getOwnPropertySymbols},_n=C([].concat),In=W("Reflect","ownKeys")||function(t){var n=Dn.f(Mt(t)),e=Rn.f;return e?_n(n,e(t)):n},Fn=function(t,n,e){for(var r=In(n),o=Wt.f,i=Rt.f,c=0;c<r.length;c++){var u=r[c];dt(t,u)||e&&dt(e,u)||o(t,u,i(n,u))}},Mn=/#|\.prototype\./,zn=function(t,n){var e=Gn[Bn(t)];return e==Nn||e!=Ln&&(L(n)?v(n):!!n)},Bn=zn.normalize=function(t){return String(t).replace(Mn,".").toLowerCase()},Gn=zn.data={},Ln=zn.NATIVE="N",Nn=zn.POLYFILL="P",qn=zn,Wn=Rt.f,Un=function(t,n){var e,r,o,i,c,u=t.target,a=t.global,s=t.stat;if(e=a?b:s?b[u]||ct(u,{}):(b[u]||{}).prototype)for(r in n){if(i=n[r],o=t.noTargetGet?(c=Wn(e,r))&&c.value:e[r],!qn(a?r:u+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Fn(i,o)}(t.sham||o&&o.sham)&&Ut(i,"sham",!0),bn(e,r,i,t)}},$n=C(C.bind),Xn=Array.isArray||function(t){return"Array"==_(t)},Kn={};Kn[jt("toStringTag")]="z";var Qn="[object z]"===String(Kn),Vn=jt("toStringTag"),Yn=b.Object,Hn="Arguments"==_(function(){return arguments}()),Jn=Qn?_:function(t){var n,e,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Yn(t),Vn))?e:Hn?_(n):"Object"==(r=_(n))&&L(n.callee)?"Arguments":r},Zn=function(){},te=[],ne=W("Reflect","construct"),ee=/^\s*(?:class|function)\b/,re=C(ee.exec),oe=!ee.exec(Zn),ie=function(t){if(!L(t))return!1;try{return ne(Zn,te,t),!0}catch(t){return!1}},ce=function(t){if(!L(t))return!1;switch(Jn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return oe||!!re(ee,Zt(t))}catch(t){return!0}};ce.sham=!0;var ue,ae=!ne||v((function(){var t;return ie(ie.call)||!ie(Object)||!ie((function(){t=!0}))||t}))?ce:ie,se=jt("species"),fe=b.Array,le=function(t,n){return new(function(t){var n;return Xn(t)&&(n=t.constructor,(ae(n)&&(n===fe||Xn(n.prototype))||N(n)&&null===(n=n[se]))&&(n=void 0)),void 0===n?fe:n}(t))(0===n?0:n)},pe=C([].push),de=function(t){var n=1==t,e=2==t,r=3==t,o=4==t,i=6==t,c=7==t,u=5==t||i;return function(a,s,f,l){for(var p,d,h=lt(a),y=M(h),b=function(t,n){return rt(t),void 0===n?t:m?$n(t,n):function(){return t.apply(n,arguments)}}(s,f),v=Sn(y),g=0,w=l||le,O=n?w(a,v):e||c?w(a,0):void 0;v>g;g++)if((u||g in y)&&(d=b(p=y[g],g,h),t))if(n)O[g]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:pe(O,p)}else switch(t){case 4:return!1;case 7:pe(O,p)}return i?-1:r||o?o:O}},he={forEach:de(0),map:de(1),filter:de(2),some:de(3),every:de(4),find:de(5),findIndex:de(6),filterReject:de(7)},ye=Object.keys||function(t){return kn(t,xn)},be=g&&!_t?Object.defineProperties:function(t,n){Mt(t);for(var e,r=G(n),o=ye(n),i=o.length,c=0;i>c;)Wt.f(t,e=o[c++],r[e]);return t},ve={f:be},ge=W("document","documentElement"),me=rn("IE_PROTO"),we=function(){},Oe=function(t){return"<script>"+t+"</"+"script>"},je=function(t){t.write(Oe("")),t.close();var n=t.parentWindow.Object;return t=null,n},Se=function(){try{ue=new ActiveXObject("htmlfile")}catch(t){}var t,n;Se="undefined"!=typeof document?document.domain&&ue?je(ue):((n=xt("iframe")).style.display="none",ge.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write(Oe("document.F=Object")),t.close(),t.F):je(ue);for(var e=xn.length;e--;)delete Se.prototype[xn[e]];return Se()};on[me]=!0;var Pe=Object.create||function(t,n){var e;return null!==t?(we.prototype=Mt(t),e=new we,we.prototype=null,e[me]=t):e=Se(),void 0===n?e:ve.f(e,n)},Te=jt("unscopables"),Ee=Array.prototype;null==Ee[Te]&&Wt.f(Ee,Te,{configurable:!0,value:Pe(null)});var Ae=function(t){Ee[Te][t]=!0},ke=he.find,xe="find",Ce=!0;xe in[]&&Array(1).find((function(){Ce=!1})),Un({target:"Array",proto:!0,forced:Ce},{find:function(t){return ke(this,t,arguments.length>1?arguments[1]:void 0)}}),Ae(xe);var De=Qn?{}.toString:function(){return"[object "+Jn(this)+"]"};Qn||bn(Object.prototype,"toString",De,{unsafe:!0});var Re=Tn.includes;Un({target:"Array",proto:!0,forced:v((function(){return!Array(1).includes()}))},{includes:function(t){return Re(this,t,arguments.length>1?arguments[1]:void 0)}}),Ae("includes");var _e=jt("match"),Ie=b.TypeError,Fe=function(t){if(function(t){var n;return N(t)&&(void 0!==(n=t[_e])?!!n:"RegExp"==_(t))}(t))throw Ie("The method doesn't accept regular expressions");return t},Me=b.String,ze=function(t){if("Symbol"===Jn(t))throw TypeError("Cannot convert a Symbol value to a string");return Me(t)},Be=jt("match"),Ge=C("".indexOf);Un({target:"String",proto:!0,forced:!function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[Be]=!1,"/./"[t](n)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~Ge(ze(B(this)),ze(Fe(t)),arguments.length>1?arguments[1]:void 0)}}),e.default.extend(e.default.fn.bootstrapTable.defaults,{classes:"table is-bordered is-hoverable",buttonsPrefix:"",buttonsClass:"button"}),e.default.fn.bootstrapTable.theme="bulma",e.default.BootstrapTable=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&c(t,n)}(p,t);var n,u,s,l=a(p);function p(){return r(this,p),l.apply(this,arguments)}return n=p,(u=[{key:"initConstants",value:function(){f(i(p.prototype),"initConstants",this).call(this),this.constants.classes.buttonsGroup="buttons has-addons",this.constants.classes.buttonsDropdown="button dropdown is-right",this.constants.classes.input="input",this.constants.classes.paginationDropdown="ui dropdown",this.constants.classes.dropup="is-up",this.constants.classes.dropdownActive="is-active",this.constants.classes.paginationActive="is-current",this.constants.classes.buttonActive="is-active",this.constants.html.toolbarDropdown=['<div class="dropdown-menu"><div class="dropdown-content">',"</div></div>"],this.constants.html.toolbarDropdownItem='<label class="dropdown-item dropdown-item-marker">%s</label>',this.constants.html.toolbarDropdownSeparator='<li class="dropdown-divider"></li>',this.constants.html.pageDropdown=['<div class="dropdown-menu"><div class="dropdown-content">',"</div></div>"],this.constants.html.pageDropdownItem='<a class="dropdown-item %s" href="#">%s</a>',this.constants.html.dropdownCaret='<span class="icon is-small"><i class="fas fa-angle-down" aria-hidden="true"></i></span>',this.constants.html.pagination=['<ul class="pagination%s">',"</ul>"],this.constants.html.paginationItem='<li><a class="page-item pagination-link%s" aria-label="%s" href="#">%s</a></li>',this.constants.html.searchInput='<p class="control"><input class="%s input-%s" type="search" placeholder="%s"></p>',this.constants.html.inputGroup='<div class="field has-addons has-addons-right">%s%s</div>',this.constants.html.searchButton='<p class="control"><button class="%s" type="button" name="search" title="%s">%s %s</button></p>',this.constants.html.searchClearButton='<p class="control"><button class="%s" type="button" name="clearSearch" title="%s">%s %s</button></p>'}},{key:"initToolbar",value:function(){f(i(p.prototype),"initToolbar",this).call(this),this.handleToolbar()}},{key:"handleToolbar",value:function(){this.$toolbar.find(".dropdown").length&&this._initDropdown()}},{key:"initPagination",value:function(){f(i(p.prototype),"initPagination",this).call(this),this.options.pagination&&this.paginationParts.includes("pageSize")&&this._initDropdown()}},{key:"_initDropdown",value:function(){var t=this.$container.find(".dropdown:not(.is-hoverable)");t.off("click").on("click",(function(n){var r=e.default(n.currentTarget);n.stopPropagation(),t.not(r).removeClass("is-active"),r.toggleClass("is-active")})),e.default(document).off("click.bs.dropdown.bulma").on("click.bs.dropdown.bulma",(function(){t.removeClass("is-active")}))}}])&&o(n.prototype,u),s&&o(n,s),Object.defineProperty(n,"prototype",{writable:!1}),p}(e.default.BootstrapTable)}));