UNPKG

14.8 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)}function l(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}function s(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return l(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)?l(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,u=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){c=!0,i=t},f:function(){try{u||null==n.return||n.return()}finally{if(c)throw i}}}}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(t,e){return t(e={exports:{}},e.exports),e.exports}var d=function(t){return t&&t.Math==Math&&t},h=d("object"==typeof globalThis&&globalThis)||d("object"==typeof window&&window)||d("object"==typeof self&&self)||d("object"==typeof p&&p)||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]})),b={}.propertyIsEnumerable,w=Object.getOwnPropertyDescriptor,m={f:w&&!b.call({1:2},1)?function(t){var e=w(this,t);return!!e&&e.enumerable}:b},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},j={}.toString,O=function(t){return j.call(t).slice(8,-1)},E="".split,T=v((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==O(t)?E.call(t,""):Object(t)}:Object,P=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},_=function(t){return T(P(t))},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},A=function(t,e){if(!x(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!x(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!x(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!x(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},I={}.hasOwnProperty,F=function(t,e){return I.call(t,e)},R=h.document,k=x(R)&&x(R.createElement),M=!g&&!v((function(){return 7!=Object.defineProperty((t="div",k?R.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),B=Object.getOwnPropertyDescriptor,C={f:g?B:function(t,e){if(t=_(t),e=A(e,!0),M)try{return B(t,e)}catch(t){}if(F(t,e))return S(!m.f.call(t,e),t[e])}},L=function(t){if(!x(t))throw TypeError(String(t)+" is not an object");return t},N=Object.defineProperty,q={f:g?N:function(t,e,n){if(L(t),e=A(e,!0),L(n),M)try{return N(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}},D=g?function(t,e,n){return q.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},z=function(t,e){try{D(h,t,e)}catch(n){h[t]=e}return e},G="__core-js_shared__",H=h[G]||z(G,{}),W=Function.toString;"function"!=typeof H.inspectSource&&(H.inspectSource=function(t){return W.call(t)});var $,K,Q,U,V=H.inspectSource,X=h.WeakMap,Y="function"==typeof X&&/native code/.test(V(X)),J=y((function(t){(t.exports=function(t,e){return H[t]||(H[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),Z=0,tt=Math.random(),et=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++Z+tt).toString(36)},nt=J("keys"),rt={},ot=h.WeakMap;if(Y){var it=H.state||(H.state=new ot),ut=it.get,ct=it.has,at=it.set;$=function(t,e){return e.facade=t,at.call(it,t,e),e},K=function(t){return ut.call(it,t)||{}},Q=function(t){return ct.call(it,t)}}else{var ft=nt[U="state"]||(nt[U]=et(U));rt[ft]=!0,$=function(t,e){return e.facade=t,D(t,ft,e),e},K=function(t){return F(t,ft)?t[ft]:{}},Q=function(t){return F(t,ft)}}var lt,st,pt={set:$,get:K,has:Q,enforce:function(t){return Q(t)?K(t):$(t,{})},getterFor:function(t){return function(e){var n;if(!x(e)||(n=K(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},yt=y((function(t){var e=pt.get,n=pt.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||F(o,"name")||D(o,"name",e),(u=n(o)).source||(u.source=r.join("string"==typeof e?e:""))),t!==h?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:D(t,e,o)):a?t[e]=o:z(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||V(this)}))})),dt=h,ht=function(t){return"function"==typeof t?t:void 0},vt=function(t,e){return arguments.length<2?ht(dt[t])||ht(h[t]):dt[t]&&dt[t][e]||h[t]&&h[t][e]},gt=Math.ceil,bt=Math.floor,wt=function(t){return isNaN(t=+t)?0:(t>0?bt:gt)(t)},mt=Math.min,St=function(t){return t>0?mt(wt(t),9007199254740991):0},jt=Math.max,Ot=Math.min,Et=function(t){return function(e,n,r){var o,i=_(e),u=St(i.length),c=function(t,e){var n=wt(t);return n<0?jt(n+e,0):Ot(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}},Tt={includes:Et(!0),indexOf:Et(!1)}.indexOf,Pt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=_(t),o=0,i=[];for(n in r)!F(rt,n)&&F(r,n)&&i.push(n);for(;e.length>o;)F(r,n=e[o++])&&(~Tt(i,n)||i.push(n));return i}(t,Pt)}},xt={f:Object.getOwnPropertySymbols},At=vt("Reflect","ownKeys")||function(t){var e=_t.f(L(t)),n=xt.f;return n?e.concat(n(t)):e},It=function(t,e){for(var n=At(e),r=q.f,o=C.f,i=0;i<n.length;i++){var u=n[i];F(t,u)||r(t,u,o(e,u))}},Ft=/#|\.prototype\./,Rt=function(t,e){var n=Mt[kt(t)];return n==Ct||n!=Bt&&("function"==typeof e?v(e):!!e)},kt=Rt.normalize=function(t){return String(t).replace(Ft,".").toLowerCase()},Mt=Rt.data={},Bt=Rt.NATIVE="N",Ct=Rt.POLYFILL="P",Lt=Rt,Nt=C.f,qt=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?h:f?h[c]||z(c,{}):(h[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=Nt(n,r))&&u.value:n[r],!Lt(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;It(i,o)}(t.sham||o&&o.sham)&&D(i,"sham",!0),yt(n,r,i,t)}},Dt=Array.isArray||function(t){return"Array"==O(t)},zt=function(t){return Object(P(t))},Gt=function(t,e,n){var r=A(e);r in t?q.f(t,r,S(0,n)):t[r]=n},Ht="process"==O(h.process),Wt=vt("navigator","userAgent")||"",$t=h.process,Kt=$t&&$t.versions,Qt=Kt&&Kt.v8;Qt?st=(lt=Qt.split("."))[0]+lt[1]:Wt&&(!(lt=Wt.match(/Edge\/(\d+)/))||lt[1]>=74)&&(lt=Wt.match(/Chrome\/(\d+)/))&&(st=lt[1]);var Ut=st&&+st,Vt=!!Object.getOwnPropertySymbols&&!v((function(){return!Symbol.sham&&(Ht?38===Ut:Ut>37&&Ut<41)})),Xt=Vt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Yt=J("wks"),Jt=h.Symbol,Zt=Xt?Jt:Jt&&Jt.withoutSetter||et,te=function(t){return F(Yt,t)&&(Vt||"string"==typeof Yt[t])||(Vt&&F(Jt,t)?Yt[t]=Jt[t]:Yt[t]=Zt("Symbol."+t)),Yt[t]},ee=te("species"),ne=function(t,e){var n;return Dt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Dt(n.prototype)?x(n)&&null===(n=n[ee])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},re=te("species"),oe=function(t){return Ut>=51||!v((function(){var e=[];return(e.constructor={})[re]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},ie=te("isConcatSpreadable"),ue=9007199254740991,ce="Maximum allowed index exceeded",ae=Ut>=51||!v((function(){var t=[];return t[ie]=!1,t.concat()[0]!==t})),fe=oe("concat"),le=function(t){if(!x(t))return!1;var e=t[ie];return void 0!==e?!!e:Dt(t)};qt({target:"Array",proto:!0,forced:!ae||!fe},{concat:function(t){var e,n,r,o,i,u=zt(this),c=ne(u,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(le(i=-1===e?u:arguments[e])){if(a+(o=St(i.length))>ue)throw TypeError(ce);for(n=0;n<o;n++,a++)n in i&&Gt(c,a,i[n])}else{if(a>=ue)throw TypeError(ce);Gt(c,a++,i)}return c.length=a,c}});var se=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)}},pe=[].push,ye=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=zt(a),h=T(d),v=se(f,l,3),g=St(h.length),b=0,w=s||ne,m=e?w(a,g):n||u?w(a,0):void 0;g>b;b++)if((c||b in h)&&(y=v(p=h[b],b,d),t))if(e)m[b]=y;else if(y)switch(t){case 3:return!0;case 5:return p;case 6:return b;case 2:pe.call(m,p)}else switch(t){case 4:return!1;case 7:pe.call(m,p)}return i?-1:r||o?o:m}},de={forEach:ye(0),map:ye(1),filter:ye(2),some:ye(3),every:ye(4),find:ye(5),findIndex:ye(6),filterOut:ye(7)}.filter;qt({target:"Array",proto:!0,forced:!oe("filter")},{filter:function(t){return de(this,t,arguments.length>1?arguments[1]:void 0)}});var he,ve,ge=[].join,be=T!=Object,we=(he=",",!!(ve=[]["join"])&&v((function(){ve.call(null,he||function(){throw 1},1)})));qt({target:"Array",proto:!0,forced:be||!we},{join:function(t){return ge.call(_(this),void 0===t?",":t)}});var me="\t\n\v\f\r                 \u2028\u2029\ufeff",Se="["+me+"]",je=RegExp("^"+Se+Se+"*"),Oe=RegExp(Se+Se+"*$"),Ee=function(t){return function(e){var n=String(P(e));return 1&t&&(n=n.replace(je,"")),2&t&&(n=n.replace(Oe,"")),n}},Te={start:Ee(1),end:Ee(2),trim:Ee(3)}.trim,Pe=h.parseInt,_e=/^[+-]?0[Xx]/,xe=8!==Pe(me+"08")||22!==Pe(me+"0x16")?function(t,e){var n=Te(String(t));return Pe(n,e>>>0||(_e.test(n)?16:10))}:Pe;qt({global:!0,forced:parseInt!=xe},{parseInt:xe}),n.default.extend(n.default.fn.bootstrapTable.defaults,{treeEnable:!1,treeShowField:null,idField:"id",parentIdField:"pid",rootParentId:null}),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)}(y,t);var e,c,l,p=a(y);function y(){return r(this,y),p.apply(this,arguments)}return e=y,(c=[{key:"init",value:function(){var t;this._rowStyle=this.options.rowStyle;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(y.prototype),"init",this)).call.apply(t,[this].concat(n))}},{key:"initHeader",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(y.prototype),"initHeader",this)).call.apply(t,[this].concat(n));var o=this.options.treeShowField;if(o){var u,c=s(this.header.fields);try{for(c.s();!(u=c.n()).done;){var a=u.value;if(o===a){this.treeEnable=!0;break}}}catch(t){c.e(t)}finally{c.f()}}}},{key:"initBody",value:function(){var t;this.treeEnable&&(this.options.virtualScroll=!1);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(y.prototype),"initBody",this)).call.apply(t,[this].concat(n))}},{key:"initTr",value:function(t,e,r,o){var u=this,c=r.filter((function(e){return t[u.options.idField]===e[u.options.parentIdField]}));o.append(f(i(y.prototype),"initRow",this).call(this,t,e,r,o));for(var a=c.length-1,l=0;l<=a;l++){var s=c[l],p=n.default.extend(!0,{},t);s._level=p._level+1,s._parent=p,l===a&&(s._last=1),this.options.rowStyle=function(t,e){var n=u._rowStyle(t,e),r=t[u.options.idField]?t[u.options.idField]:0,o=t[u.options.parentIdField]?t[u.options.parentIdField]:0;return n.classes=[n.classes||"","treegrid-".concat(r),"treegrid-parent-".concat(o)].join(" "),n},this.initTr(s,n.default.inArray(s,r),r,o)}}},{key:"initRow",value:function(t,e,n,r){var o=this;if(this.treeEnable){var u=parseInt(t[this.options.parentIdField],10);return!(this.options.rootParentId!==u&&u||(void 0===t._level&&(t._level=0),this.options.rowStyle=function(t,e){var n=o._rowStyle(t,e),r=t[o.options.idField]?t[o.options.idField]:0;return n.classes=[n.classes||"","treegrid-".concat(r)].join(" "),n},this.initTr(t,e,n,r),0))}return f(i(y.prototype),"initRow",this).call(this,t,e,n,r)}},{key:"destroy",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(y.prototype),"destroy",this)).call.apply(t,[this].concat(n)),this.options.rowStyle=this._rowStyle}}])&&o(e.prototype,c),l&&o(e,l),y}(n.default.BootstrapTable)}));