UNPKG

16.6 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
10function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){t(n,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))}))}return n}function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var u=function(t){return t&&t.Math==Math&&t},l=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof a&&a)||function(){return this}()||Function("return this")(),f=function(t){try{return!!t()}catch(t){return!0}},s=!f((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),p={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,h={f:d&&!p.call({1:2},1)?function(t){var e=d(this,t);return!!e&&e.enumerable}:p},y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v={}.toString,g=function(t){return v.call(t).slice(8,-1)},b="".split,m=f((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==g(t)?b.call(t,""):Object(t)}:Object,x=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},E=function(t){return m(x(t))},S=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=function(t,e){if(!S(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!S(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},w={}.hasOwnProperty,_=function(t,e){return w.call(t,e)},j=l.document,T=S(j)&&S(j.createElement),A=!s&&!f((function(){return 7!=Object.defineProperty((t="div",T?j.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),P=Object.getOwnPropertyDescriptor,I={f:s?P:function(t,e){if(t=E(t),e=O(e,!0),A)try{return P(t,e)}catch(t){}if(_(t,e))return y(!h.f.call(t,e),t[e])}},R=function(t){if(!S(t))throw TypeError(String(t)+" is not an object");return t},$=Object.defineProperty,C={f:s?$:function(t,e,n){if(R(t),e=O(e,!0),R(n),A)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}},M=s?function(t,e,n){return C.f(t,e,y(1,n))}:function(t,e,n){return t[e]=n,t},N=function(t,e){try{M(l,t,e)}catch(n){l[t]=e}return e},U=l["__core-js_shared__"]||N("__core-js_shared__",{}),D=Function.toString;"function"!=typeof U.inspectSource&&(U.inspectSource=function(t){return D.call(t)});var k,F,L,B,K=U.inspectSource,G=l.WeakMap,X="function"==typeof G&&/native code/.test(K(G)),z=c((function(t){(t.exports=function(t,e){return U[t]||(U[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),V=0,Y=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++V+Y).toString(36)},W=z("keys"),Q={},Z=l.WeakMap;if(X){var H=U.state||(U.state=new Z),J=H.get,tt=H.has,et=H.set;k=function(t,e){return e.facade=t,et.call(H,t,e),e},F=function(t){return J.call(H,t)||{}},L=function(t){return tt.call(H,t)}}else{var nt=W[B="state"]||(W[B]=q(B));Q[nt]=!0,k=function(t,e){return e.facade=t,M(t,nt,e),e},F=function(t){return _(t,nt)?t[nt]:{}},L=function(t){return _(t,nt)}}var rt={set:k,get:F,has:L,enforce:function(t){return L(t)?F(t):k(t,{})},getterFor:function(t){return function(e){var n;if(!S(e)||(n=F(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ot=c((function(t){var e=rt.get,n=rt.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var a,c=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||_(o,"name")||M(o,"name",e),(a=n(o)).source||(a.source=r.join("string"==typeof e?e:""))),t!==l?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=o:M(t,e,o)):u?t[e]=o:N(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||K(this)}))})),it=l,at=function(t){return"function"==typeof t?t:void 0},ct=function(t,e){return arguments.length<2?at(it[t])||at(l[t]):it[t]&&it[t][e]||l[t]&&l[t][e]},ut=Math.ceil,lt=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?lt:ut)(t)},st=Math.min,pt=function(t){return t>0?st(ft(t),9007199254740991):0},dt=Math.max,ht=Math.min,yt=function(t){return function(e,n,r){var o,i=E(e),a=pt(i.length),c=function(t,e){var n=ft(t);return n<0?dt(n+e,0):ht(n,e)}(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},vt={includes:yt(!0),indexOf:yt(!1)}.indexOf,gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),bt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=E(t),o=0,i=[];for(n in r)!_(Q,n)&&_(r,n)&&i.push(n);for(;e.length>o;)_(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i}(t,gt)}},mt={f:Object.getOwnPropertySymbols},xt=ct("Reflect","ownKeys")||function(t){var e=bt.f(R(t)),n=mt.f;return n?e.concat(n(t)):e},Et=function(t,e){for(var n=xt(e),r=C.f,o=I.f,i=0;i<n.length;i++){var a=n[i];_(t,a)||r(t,a,o(e,a))}},St=/#|\.prototype\./,Ot=function(t,e){var n=_t[wt(t)];return n==Tt||n!=jt&&("function"==typeof e?f(e):!!e)},wt=Ot.normalize=function(t){return String(t).replace(St,".").toLowerCase()},_t=Ot.data={},jt=Ot.NATIVE="N",Tt=Ot.POLYFILL="P",At=Ot,Pt=I.f,It=function(t,e){var n,r,o,i,a,c=t.target,u=t.global,f=t.stat;if(n=u?l:f?l[c]||N(c,{}):(l[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(a=Pt(n,r))&&a.value:n[r],!At(u?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Et(i,o)}(t.sham||o&&o.sham)&&M(i,"sham",!0),ot(n,r,i,t)}},Rt=function(){var t=R(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 $t(t,e){return RegExp(t,e)}var Ct,Mt,Nt={UNSUPPORTED_Y:f((function(){var t=$t("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:f((function(){var t=$t("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},Ut=RegExp.prototype.exec,Dt=z("native-string-replace",String.prototype.replace),kt=Ut,Ft=(Ct=/a/,Mt=/b*/g,Ut.call(Ct,"a"),Ut.call(Mt,"a"),0!==Ct.lastIndex||0!==Mt.lastIndex),Lt=Nt.UNSUPPORTED_Y||Nt.BROKEN_CARET,Bt=void 0!==/()??/.exec("")[1];(Ft||Bt||Lt)&&(kt=function(t){var e,n,r,o,i=this,a=Lt&&i.sticky,c=Rt.call(i),u=i.source,l=0,f=t;return a&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),f=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(u="(?: "+u+")",f=" "+f,l++),n=new RegExp("^(?:"+u+")",c)),Bt&&(n=new RegExp("^"+u+"$(?!\\s)",c)),Ft&&(e=i.lastIndex),r=Ut.call(a?n:i,f),a?r?(r.input=r.input.slice(l),r[0]=r[0].slice(l),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:Ft&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),Bt&&r&&r.length>1&&Dt.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var Kt=kt;It({target:"RegExp",proto:!0,forced:/./.exec!==Kt},{exec:Kt});var Gt,Xt,zt="process"==g(l.process),Vt=ct("navigator","userAgent")||"",Yt=l.process,qt=Yt&&Yt.versions,Wt=qt&&qt.v8;Wt?Xt=(Gt=Wt.split("."))[0]+Gt[1]:Vt&&(!(Gt=Vt.match(/Edge\/(\d+)/))||Gt[1]>=74)&&(Gt=Vt.match(/Chrome\/(\d+)/))&&(Xt=Gt[1]);var Qt=Xt&&+Xt,Zt=!!Object.getOwnPropertySymbols&&!f((function(){return!Symbol.sham&&(zt?38===Qt:Qt>37&&Qt<41)})),Ht=Zt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Jt=z("wks"),te=l.Symbol,ee=Ht?te:te&&te.withoutSetter||q,ne=function(t){return _(Jt,t)&&(Zt||"string"==typeof Jt[t])||(Zt&&_(te,t)?Jt[t]=te[t]:Jt[t]=ee("Symbol."+t)),Jt[t]},re=ne("species"),oe=!f((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),ie="$0"==="a".replace(/./,"$0"),ae=ne("replace"),ce=!!/./[ae]&&""===/./[ae]("a","$0"),ue=!f((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]})),le=function(t){return function(e,n){var r,o,i=String(x(e)),a=ft(n),c=i.length;return a<0||a>=c?t?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):r:t?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}},fe={codeAt:le(!1),charAt:le(!0)}.charAt,se=function(t,e,n){return e+(n?fe(t,e).length:1)},pe=function(t){return Object(x(t))},de=Math.floor,he="".replace,ye=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ve=/\$([$&'`]|\d{1,2})/g,ge=function(t,e,n,r,o,i){var a=n+t.length,c=r.length,u=ve;return void 0!==o&&(o=pe(o),u=ye),he.call(i,u,(function(i,u){var l;switch(u.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(a);case"<":l=o[u.slice(1,-1)];break;default:var f=+u;if(0===f)return i;if(f>c){var s=de(f/10);return 0===s?i:s<=c?void 0===r[s-1]?u.charAt(1):r[s-1]+u.charAt(1):i}l=r[f-1]}return void 0===l?"":l}))},be=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"!==g(t))throw TypeError("RegExp#exec called on incompatible receiver");return Kt.call(t,e)},me=Math.max,xe=Math.min;!function(t,e,n,r){var o=ne(t),i=!f((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),a=i&&!f((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(!i||!a||"replace"===t&&(!oe||!ie||ce)||"split"===t&&!ue){var c=/./[o],u=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:ie,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:ce}),l=u[0],s=u[1];ot(String.prototype,t,l),ot(RegExp.prototype,o,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&M(RegExp.prototype[o],"sham",!0)}("replace",2,(function(t,e,n,r){var o=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function(n,r){var o=x(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,r){if(!o&&i||"string"==typeof r&&-1===r.indexOf(a)){var c=n(e,t,this,r);if(c.done)return c.value}var u=R(t),l=String(this),f="function"==typeof r;f||(r=String(r));var s=u.global;if(s){var p=u.unicode;u.lastIndex=0}for(var d=[];;){var h=be(u,l);if(null===h)break;if(d.push(h),!s)break;""===String(h[0])&&(u.lastIndex=se(l,pt(u.lastIndex),p))}for(var y,v="",g=0,b=0;b<d.length;b++){h=d[b];for(var m=String(h[0]),x=me(xe(ft(h.index),l.length),0),E=[],S=1;S<h.length;S++)E.push(void 0===(y=h[S])?y:String(y));var O=h.groups;if(f){var w=[m].concat(E,x,l);void 0!==O&&w.push(O);var _=String(r.apply(void 0,w))}else _=ge(m,l,x,E,O,r);x>=g&&(v+=l.slice(g,x)+_,g=x+m.length)}return v+l.slice(g)}]}));var Ee,Se=Array.isArray||function(t){return"Array"==g(t)},Oe=function(t,e,n){var r=O(e);r in t?C.f(t,r,y(0,n)):t[r]=n},we=ne("species"),_e=function(t,e){var n;return Se(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Se(n.prototype)?S(n)&&null===(n=n[we])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},je=ne("species"),Te=ne("isConcatSpreadable"),Ae=Qt>=51||!f((function(){var t=[];return t[Te]=!1,t.concat()[0]!==t})),Pe=(Ee="concat",Qt>=51||!f((function(){var t=[];return(t.constructor={})[je]=function(){return{foo:1}},1!==t[Ee](Boolean).foo}))),Ie=function(t){if(!S(t))return!1;var e=t[Te];return void 0!==e?!!e:Se(t)};It({target:"Array",proto:!0,forced:!Ae||!Pe},{concat:function(t){var e,n,r,o,i,a=pe(this),c=_e(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(Ie(i=-1===e?a:arguments[e])){if(u+(o=pt(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,u++)n in i&&Oe(c,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Oe(c,u++,i)}return c.length=u,c}});var Re=window.jQuery,$e=function(t){return void 0===t?t:Re.extend(!0,Array.isArray(t)?[]:{},t)};function Ce(t,e,n,r,o,i,a,c,u,l){"boolean"!=typeof a&&(u=c,c=a,a=!1);const f="function"==typeof n?n.options:n;let s;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,o&&(f.functional=!0)),r&&(f._scopeId=r),i?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},f._ssrRegister=s):e&&(s=a?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,c(t))}),s)if(f.functional){const t=f.render;f.render=function(e,n){return s.call(n),t(e,n)}}else{const t=f.beforeCreate;f.beforeCreate=t?[].concat(t,s):[s]}return n}const Me=Ce({render:function(){var t=this.$createElement;return(this._self._c||t)("table")},staticRenderFns:[]},undefined,{name:"BootstrapTable",props:{columns:{type:Array,require:!0},data:{type:[Array,Object],default:function(){}},options:{type:Object,default:function(){return{}}}},mounted:function(){var t=this;this.$table=Re(this.$el),this.$table.on("all.bs.table",(function(e,n,o){var i=Re.fn.bootstrapTable.events[n];i=i.replace(/([A-Z])/g,"-$1").toLowerCase(),t.$emit.apply(t,["on-all"].concat(r(o))),t.$emit.apply(t,[i].concat(r(o)))})),this._initTable()},methods:n({_initTable:function(){var t=n(n({},$e(this.options)),{},{columns:$e(this.columns),data:$e(this.data)});this._hasInit?this.refreshOptions(t):(this.$table.bootstrapTable(t),this._hasInit=!0)}},function(){var t,e={},n=function(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return c=t.done,t},e:function(t){u=!0,a=t},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw a}}}}(Re.fn.bootstrapTable.methods);try{var r=function(){var n=t.value;e[n]=function(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return(t=this.$table).bootstrapTable.apply(t,[n].concat(r))}};for(n.s();!(t=n.n()).done;)r()}catch(t){n.e(t)}finally{n.f()}return e}()),watch:{options:{handler:function(){this._initTable()},deep:!0},columns:{handler:function(){this._initTable()},deep:!0},data:{handler:function(){this.load($e(this.data))},deep:!0}}},undefined,false,undefined,!1,void 0,void 0,void 0);export default Me;