UNPKG

15.3 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 f(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 a(t,e,n){return(a="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 h=function(t){return t&&t.Math==Math&&t},p=h("object"==typeof globalThis&&globalThis)||h("object"==typeof window&&window)||h("object"==typeof self&&self)||h("object"==typeof l&&l)||function(){return this}()||Function("return this")(),d=function(t){try{return!!t()}catch(t){return!0}},y=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),g={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,m={f:v&&!g.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:g},w=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},b={}.toString,O=function(t){return b.call(t).slice(8,-1)},S="".split,T=d((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==O(t)?S.call(t,""):Object(t)}:Object,j=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},E=function(t){return T(j(t))},L=function(t){return"object"==typeof t?null!==t:"function"==typeof t},P=function(t,e){if(!L(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!L(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!L(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!L(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},x={}.hasOwnProperty,C=function(t,e){return x.call(t,e)},V=p.document,M=L(V)&&L(V.createElement),k=function(t){return M?V.createElement(t):{}},A=!y&&!d((function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a})),R=Object.getOwnPropertyDescriptor,_={f:y?R:function(t,e){if(t=E(t),e=P(e,!0),A)try{return R(t,e)}catch(t){}if(C(t,e))return w(!m.f.call(t,e),t[e])}},H=function(t){if(!L(t))throw TypeError(String(t)+" is not an object");return t},I=Object.defineProperty,W={f:y?I:function(t,e,n){if(H(t),e=P(e,!0),H(n),A)try{return I(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=y?function(t,e,n){return W.f(t,e,w(1,n))}:function(t,e,n){return t[e]=n,t},N=function(t,e){try{F(p,t,e)}catch(n){p[t]=e}return e},D="__core-js_shared__",G=p[D]||N(D,{}),q=Function.toString;"function"!=typeof G.inspectSource&&(G.inspectSource=function(t){return q.call(t)});var z,B,X,K=G.inspectSource,Q=p.WeakMap,U="function"==typeof Q&&/native code/.test(K(Q)),Y=s((function(t){(t.exports=function(t,e){return G[t]||(G[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),J=0,Z=Math.random(),$=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++J+Z).toString(36)},tt=Y("keys"),et=function(t){return tt[t]||(tt[t]=$(t))},nt={},rt=p.WeakMap;if(U){var ot=G.state||(G.state=new rt),it=ot.get,ut=ot.has,ct=ot.set;z=function(t,e){return e.facade=t,ct.call(ot,t,e),e},B=function(t){return it.call(ot,t)||{}},X=function(t){return ut.call(ot,t)}}else{var ft=et("state");nt[ft]=!0,z=function(t,e){return e.facade=t,F(t,ft,e),e},B=function(t){return C(t,ft)?t[ft]:{}},X=function(t){return C(t,ft)}}var at,lt,st={set:z,get:B,has:X,enforce:function(t){return X(t)?B(t):z(t,{})},getterFor:function(t){return function(e){var n;if(!L(e)||(n=B(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ht=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,f=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||C(o,"name")||F(o,"name",e),(u=n(o)).source||(u.source=r.join("string"==typeof e?e:""))),t!==p?(c?!a&&t[e]&&(f=!0):delete t[e],f?t[e]=o:F(t,e,o)):f?t[e]=o:N(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||K(this)}))})),pt=p,dt=function(t){return"function"==typeof t?t:void 0},yt=function(t,e){return arguments.length<2?dt(pt[t])||dt(p[t]):pt[t]&&pt[t][e]||p[t]&&p[t][e]},gt=Math.ceil,vt=Math.floor,mt=function(t){return isNaN(t=+t)?0:(t>0?vt:gt)(t)},wt=Math.min,bt=function(t){return t>0?wt(mt(t),9007199254740991):0},Ot=Math.max,St=Math.min,Tt=function(t){return function(e,n,r){var o,i=E(e),u=bt(i.length),c=function(t,e){var n=mt(t);return n<0?Ot(n+e,0):St(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:Tt(!0),indexOf:Tt(!1)},Et=jt.indexOf,Lt=function(t,e){var n,r=E(t),o=0,i=[];for(n in r)!C(nt,n)&&C(r,n)&&i.push(n);for(;e.length>o;)C(r,n=e[o++])&&(~Et(i,n)||i.push(n));return i},Pt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xt=Pt.concat("length","prototype"),Ct={f:Object.getOwnPropertyNames||function(t){return Lt(t,xt)}},Vt={f:Object.getOwnPropertySymbols},Mt=yt("Reflect","ownKeys")||function(t){var e=Ct.f(H(t)),n=Vt.f;return n?e.concat(n(t)):e},kt=function(t,e){for(var n=Mt(e),r=W.f,o=_.f,i=0;i<n.length;i++){var u=n[i];C(t,u)||r(t,u,o(e,u))}},At=/#|\.prototype\./,Rt=function(t,e){var n=Ht[_t(t)];return n==Wt||n!=It&&("function"==typeof e?d(e):!!e)},_t=Rt.normalize=function(t){return String(t).replace(At,".").toLowerCase()},Ht=Rt.data={},It=Rt.NATIVE="N",Wt=Rt.POLYFILL="P",Ft=Rt,Nt=_.f,Dt=function(t,e){var n,r,o,i,u,c=t.target,f=t.global,a=t.stat;if(n=f?p:a?p[c]||N(c,{}):(p[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=Nt(n,r))&&u.value:n[r],!Ft(f?r:c+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;kt(i,o)}(t.sham||o&&o.sham)&&F(i,"sham",!0),ht(n,r,i,t)}},Gt=Array.isArray||function(t){return"Array"==O(t)},qt=function(t){return Object(j(t))},zt=function(t,e,n){var r=P(e);r in t?W.f(t,r,w(0,n)):t[r]=n},Bt="process"==O(p.process),Xt=yt("navigator","userAgent")||"",Kt=p.process,Qt=Kt&&Kt.versions,Ut=Qt&&Qt.v8;Ut?lt=(at=Ut.split("."))[0]+at[1]:Xt&&(!(at=Xt.match(/Edge\/(\d+)/))||at[1]>=74)&&(at=Xt.match(/Chrome\/(\d+)/))&&(lt=at[1]);var Yt,Jt=lt&&+lt,Zt=!!Object.getOwnPropertySymbols&&!d((function(){return!Symbol.sham&&(Bt?38===Jt:Jt>37&&Jt<41)})),$t=Zt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,te=Y("wks"),ee=p.Symbol,ne=$t?ee:ee&&ee.withoutSetter||$,re=function(t){return C(te,t)&&(Zt||"string"==typeof te[t])||(Zt&&C(ee,t)?te[t]=ee[t]:te[t]=ne("Symbol."+t)),te[t]},oe=re("species"),ie=function(t,e){var n;return Gt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Gt(n.prototype)?L(n)&&null===(n=n[oe])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},ue=re("species"),ce=re("isConcatSpreadable"),fe=9007199254740991,ae="Maximum allowed index exceeded",le=Jt>=51||!d((function(){var t=[];return t[ce]=!1,t.concat()[0]!==t})),se=(Yt="concat",Jt>=51||!d((function(){var t=[];return(t.constructor={})[ue]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),he=function(t){if(!L(t))return!1;var e=t[ce];return void 0!==e?!!e:Gt(t)};Dt({target:"Array",proto:!0,forced:!le||!se},{concat:function(t){var e,n,r,o,i,u=qt(this),c=ie(u,0),f=0;for(e=-1,r=arguments.length;e<r;e++)if(he(i=-1===e?u:arguments[e])){if(f+(o=bt(i.length))>fe)throw TypeError(ae);for(n=0;n<o;n++,f++)n in i&&zt(c,f,i[n])}else{if(f>=fe)throw TypeError(ae);zt(c,f++,i)}return c.length=f,c}});var pe,de=Object.keys||function(t){return Lt(t,Pt)},ye=y?Object.defineProperties:function(t,e){H(t);for(var n,r=de(e),o=r.length,i=0;o>i;)W.f(t,n=r[i++],e[n]);return t},ge=yt("document","documentElement"),ve=et("IE_PROTO"),me=function(){},we=function(t){return"<script>"+t+"</"+"script>"},be=function(){try{pe=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;be=pe?function(t){t.write(we("")),t.close();var e=t.parentWindow.Object;return t=null,e}(pe):((e=k("iframe")).style.display="none",ge.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(we("document.F=Object")),t.close(),t.F);for(var n=Pt.length;n--;)delete be.prototype[Pt[n]];return be()};nt[ve]=!0;var Oe=Object.create||function(t,e){var n;return null!==t?(me.prototype=H(t),n=new me,me.prototype=null,n[ve]=t):n=be(),void 0===e?n:ye(n,e)},Se=re("unscopables"),Te=Array.prototype;null==Te[Se]&&W.f(Te,Se,{configurable:!0,value:Oe(null)});var je,Ee=jt.includes;Dt({target:"Array",proto:!0},{includes:function(t){return Ee(this,t,arguments.length>1?arguments[1]:void 0)}}),je="includes",Te[Se][je]=!0;var Le=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,xe=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(f,a,l,s){for(var h,p,d=qt(f),y=T(d),g=Le(a,l,3),v=bt(y.length),m=0,w=s||ie,b=e?w(f,v):n||u?w(f,0):void 0;v>m;m++)if((c||m in y)&&(p=g(h=y[m],m,d),t))if(e)b[m]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:Pe.call(b,h)}else switch(t){case 4:return!1;case 7:Pe.call(b,h)}return i?-1:r||o?o:b}},Ce={forEach:xe(0),map:xe(1),filter:xe(2),some:xe(3),every:xe(4),find:xe(5),findIndex:xe(6),filterOut:xe(7)}.forEach,Ve=function(t,e){var n=[][t];return!!n&&d((function(){n.call(null,e||function(){throw 1},1)}))}("forEach")?[].forEach:function(t){return Ce(this,t,arguments.length>1?arguments[1]:void 0)};for(var Me in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var ke=p[Me],Ae=ke&&ke.prototype;if(Ae&&Ae.forEach!==Ve)try{F(Ae,"forEach",Ve)}catch(t){Ae.forEach=Ve}}var Re=re("match"),_e=function(t){if(function(t){var e;return L(t)&&(void 0!==(e=t[Re])?!!e:"RegExp"==O(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},He=re("match");Dt({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[He]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(j(this)).indexOf(_e(t),arguments.length>1?arguments[1]:void 0)}});var Ie=function(t,e){var n=0;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var u=function(){n=0,t.apply(void 0,o)};clearTimeout(n),n=setTimeout(u,e)}};n.default.extend(n.default.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]}),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)}(h,t);var e,c,l,s=f(h);function h(){return r(this,h),s.apply(this,arguments)}return e=h,(c=[{key:"init",value:function(){for(var t,e=this,r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];if((t=a(i(h.prototype),"init",this)).call.apply(t,[this].concat(o)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.warn("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var c={width:n.default(window).width(),height:n.default(window).height()};if(n.default(window).on("resize orientationchange",Ie((function(){var t=n.default(window).width(),r=n.default(window).height(),o=n.default(document.activeElement);o.length&&["INPUT","SELECT","TEXTAREA"].includes(o.prop("nodeName"))||(Math.abs(c.height-r)>e.options.heightThreshold||c.width!==t)&&(e.changeView(t,r),c={width:t,height:r})}),200)),this.options.checkOnInit){var f=n.default(window).width(),l=n.default(window).height();this.changeView(f,l),c={width:f,height:l}}}}},{key:"conditionCardView",value:function(){this.changeTableView(!1),this.showHideColumns(!1)}},{key:"conditionFullView",value:function(){this.changeTableView(!0),this.showHideColumns(!0)}},{key:"changeTableView",value:function(t){this.options.cardView=t,this.toggleView()}},{key:"showHideColumns",value:function(t){var e=this;this.options.columnsHidden.length>0&&this.columns.forEach((function(n){e.options.columnsHidden.includes(n.field)&&n.visible!==t&&e._toggleColumn(e.fieldsColumnsIndex[n.field],t,!0)}))}},{key:"changeView",value:function(t,e){this.options.minHeight?t<=this.options.minWidth&&e<=this.options.minHeight?this.conditionCardView():t>this.options.minWidth&&e>this.options.minHeight&&this.conditionFullView():t<=this.options.minWidth?this.conditionCardView():t>this.options.minWidth&&this.conditionFullView(),this.resetView()}}])&&o(e.prototype,c),l&&o(e,l),h}(n.default.BootstrapTable)}));