UNPKG

15.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.18.2
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),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},u=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||function(){return this}()||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},f=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!a.call({1:2},1)?function(t){var e=s(this,t);return!!e&&e.enumerable}:a},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,d=function(t){return y.call(t).slice(8,-1)},h="".split,b=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==d(t)?h.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},v=function(t){return b(g(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!m(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!m(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!m(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},O={}.hasOwnProperty,j=function(t,e){return O.call(t,e)},S=u.document,T=m(S)&&m(S.createElement),C=function(t){return T?S.createElement(t):{}},P=!f&&!c((function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a})),V=Object.getOwnPropertyDescriptor,E={f:f?V:function(t,e){if(t=v(t),e=w(e,!0),P)try{return V(t,e)}catch(t){}if(j(t,e))return p(!l.f.call(t,e),t[e])}},x=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},A=Object.defineProperty,_={f:f?A:function(t,e,n){if(x(t),e=w(e,!0),x(n),P)try{return A(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}},R=f?function(t,e,n){return _.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},k=function(t,e){try{R(u,t,e)}catch(n){u[t]=e}return e},B="__core-js_shared__",M=u[B]||k(B,{}),F=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return F.call(t)});var I,D,N,q=M.inspectSource,L=u.WeakMap,z="function"==typeof L&&/native code/.test(q(L)),W=o((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.1",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),$=0,G=Math.random(),K=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+G).toString(36)},Q=W("keys"),X=function(t){return Q[t]||(Q[t]=K(t))},Y={},H=u.WeakMap;if(z){var J=M.state||(M.state=new H),U=J.get,Z=J.has,tt=J.set;I=function(t,e){return e.facade=t,tt.call(J,t,e),e},D=function(t){return U.call(J,t)||{}},N=function(t){return Z.call(J,t)}}else{var et=X("state");Y[et]=!0,I=function(t,e){return e.facade=t,R(t,et,e),e},D=function(t){return j(t,et)?t[et]:{}},N=function(t){return j(t,et)}}var nt,rt,ot={set:I,get:D,has:N,enforce:function(t){return N(t)?D(t):I(t,{})},getterFor:function(t){return function(e){var n;if(!m(e)||(n=D(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},it=o((function(t){var e=ot.get,n=ot.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var c,f=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,s=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||j(o,"name")||R(o,"name",e),(c=n(o)).source||(c.source=r.join("string"==typeof e?e:""))),t!==u?(f?!s&&t[e]&&(a=!0):delete t[e],a?t[e]=o:R(t,e,o)):a?t[e]=o:k(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||q(this)}))})),ut=u,ct=function(t){return"function"==typeof t?t:void 0},ft=function(t,e){return arguments.length<2?ct(ut[t])||ct(u[t]):ut[t]&&ut[t][e]||u[t]&&u[t][e]},at=Math.ceil,st=Math.floor,lt=function(t){return isNaN(t=+t)?0:(t>0?st:at)(t)},pt=Math.min,yt=function(t){return t>0?pt(lt(t),9007199254740991):0},dt=Math.max,ht=Math.min,bt=function(t,e){var n=lt(t);return n<0?dt(n+e,0):ht(n,e)},gt=function(t){return function(e,n,r){var o,i=v(e),u=yt(i.length),c=bt(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}},vt={includes:gt(!0),indexOf:gt(!1)}.indexOf,mt=function(t,e){var n,r=v(t),o=0,i=[];for(n in r)!j(Y,n)&&j(r,n)&&i.push(n);for(;e.length>o;)j(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ot=wt.concat("length","prototype"),jt={f:Object.getOwnPropertyNames||function(t){return mt(t,Ot)}},St={f:Object.getOwnPropertySymbols},Tt=ft("Reflect","ownKeys")||function(t){var e=jt.f(x(t)),n=St.f;return n?e.concat(n(t)):e},Ct=function(t,e){for(var n=Tt(e),r=_.f,o=E.f,i=0;i<n.length;i++){var u=n[i];j(t,u)||r(t,u,o(e,u))}},Pt=/#|\.prototype\./,Vt=function(t,e){var n=xt[Et(t)];return n==_t||n!=At&&("function"==typeof e?c(e):!!e)},Et=Vt.normalize=function(t){return String(t).replace(Pt,".").toLowerCase()},xt=Vt.data={},At=Vt.NATIVE="N",_t=Vt.POLYFILL="P",Rt=Vt,kt=E.f,Bt=function(t,e){var n,r,o,i,c,f=t.target,a=t.global,s=t.stat;if(n=a?u:s?u[f]||k(f,{}):(u[f]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=kt(n,r))&&c.value:n[r],!Rt(a?r:f+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ct(i,o)}(t.sham||o&&o.sham)&&R(i,"sham",!0),it(n,r,i,t)}},Mt=Array.isArray||function(t){return"Array"==d(t)},Ft=function(t){return Object(g(t))},It=function(t,e,n){var r=w(e);r in t?_.f(t,r,p(0,n)):t[r]=n},Dt=!!Object.getOwnPropertySymbols&&!c((function(){return!String(Symbol())})),Nt=Dt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,qt=W("wks"),Lt=u.Symbol,zt=Nt?Lt:Lt&&Lt.withoutSetter||K,Wt=function(t){return j(qt,t)||(Dt&&j(Lt,t)?qt[t]=Lt[t]:qt[t]=zt("Symbol."+t)),qt[t]},$t=Wt("species"),Gt=function(t,e){var n;return Mt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Mt(n.prototype)?m(n)&&null===(n=n[$t])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Kt=ft("navigator","userAgent")||"",Qt=u.process,Xt=Qt&&Qt.versions,Yt=Xt&&Xt.v8;Yt?rt=(nt=Yt.split("."))[0]+nt[1]:Kt&&(!(nt=Kt.match(/Edge\/(\d+)/))||nt[1]>=74)&&(nt=Kt.match(/Chrome\/(\d+)/))&&(rt=nt[1]);var Ht=rt&&+rt,Jt=Wt("species"),Ut=function(t){return Ht>=51||!c((function(){var e=[];return(e.constructor={})[Jt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Zt=Wt("isConcatSpreadable"),te=9007199254740991,ee="Maximum allowed index exceeded",ne=Ht>=51||!c((function(){var t=[];return t[Zt]=!1,t.concat()[0]!==t})),re=Ut("concat"),oe=function(t){if(!m(t))return!1;var e=t[Zt];return void 0!==e?!!e:Mt(t)};Bt({target:"Array",proto:!0,forced:!ne||!re},{concat:function(t){var e,n,r,o,i,u=Ft(this),c=Gt(u,0),f=0;for(e=-1,r=arguments.length;e<r;e++)if(oe(i=-1===e?u:arguments[e])){if(f+(o=yt(i.length))>te)throw TypeError(ee);for(n=0;n<o;n++,f++)n in i&&It(c,f,i[n])}else{if(f>=te)throw TypeError(ee);It(c,f++,i)}return c.length=f,c}});var ie,ue=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)}},ce=[].push,fe=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,s,l){for(var p,y,d=Ft(f),h=b(d),g=ue(a,s,3),v=yt(h.length),m=0,w=l||Gt,O=e?w(f,v):n||u?w(f,0):void 0;v>m;m++)if((c||m in h)&&(y=g(p=h[m],m,d),t))if(e)O[m]=y;else if(y)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:ce.call(O,p)}else switch(t){case 4:return!1;case 7:ce.call(O,p)}return i?-1:r||o?o:O}},ae={forEach:fe(0),map:fe(1),filter:fe(2),some:fe(3),every:fe(4),find:fe(5),findIndex:fe(6),filterOut:fe(7)},se=Object.keys||function(t){return mt(t,wt)},le=f?Object.defineProperties:function(t,e){x(t);for(var n,r=se(e),o=r.length,i=0;o>i;)_.f(t,n=r[i++],e[n]);return t},pe=ft("document","documentElement"),ye=X("IE_PROTO"),de=function(){},he=function(t){return"<script>"+t+"</"+"script>"},be=function(){try{ie=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;be=ie?function(t){t.write(he("")),t.close();var e=t.parentWindow.Object;return t=null,e}(ie):((e=C("iframe")).style.display="none",pe.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(he("document.F=Object")),t.close(),t.F);for(var n=wt.length;n--;)delete be.prototype[wt[n]];return be()};Y[ye]=!0;var ge=Object.create||function(t,e){var n;return null!==t?(de.prototype=x(t),n=new de,de.prototype=null,n[ye]=t):n=be(),void 0===e?n:le(n,e)},ve=Wt("unscopables"),me=Array.prototype;null==me[ve]&&_.f(me,ve,{configurable:!0,value:ge(null)});var we,Oe=Object.defineProperty,je={},Se=function(t){throw t},Te=function(t,e){if(j(je,t))return je[t];e||(e={});var n=[][t],r=!!j(e,"ACCESSORS")&&e.ACCESSORS,o=j(e,0)?e[0]:Se,i=j(e,1)?e[1]:void 0;return je[t]=!!n&&!c((function(){if(r&&!f)return!0;var t={length:-1};r?Oe(t,1,{enumerable:!0,get:Se}):t[1]=1,n.call(t,o,i)}))},Ce=ae.find,Pe="find",Ve=!0,Ee=Te(Pe);Pe in[]&&Array(1).find((function(){Ve=!1})),Bt({target:"Array",proto:!0,forced:Ve||!Ee},{find:function(t){return Ce(this,t,arguments.length>1?arguments[1]:void 0)}}),we=Pe,me[ve][we]=!0;var xe=Ut("slice"),Ae=Te("slice",{ACCESSORS:!0,0:0,1:2}),_e=Wt("species"),Re=[].slice,ke=Math.max;Bt({target:"Array",proto:!0,forced:!xe||!Ae},{slice:function(t,e){var n,r,o,i=v(this),u=yt(i.length),c=bt(t,u),f=bt(void 0===e?u:e,u);if(Mt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Mt(n.prototype)?m(n)&&null===(n=n[_e])&&(n=void 0):n=void 0,n===Array||void 0===n))return Re.call(i,c,f);for(r=new(void 0===n?Array:n)(ke(f-c,0)),o=0;c<f;c++,o++)c in i&&It(r,o,i[c]);return r.length=o,r}});var Be=Object.assign,Me=Object.defineProperty,Fe=!Be||c((function(){if(f&&1!==Be({b:1},Be(Me({},"a",{enumerable:!0,get:function(){Me(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Be({},t)[n]||se(Be({},e)).join("")!=r}))?function(t,e){for(var n=Ft(t),r=arguments.length,o=1,i=St.f,u=l.f;r>o;)for(var c,a=b(arguments[o++]),s=i?se(a).concat(i(a)):se(a),p=s.length,y=0;p>y;)c=s[y++],f&&!u.call(a,c)||(n[c]=a[c]);return n}:Be;function Ie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function De(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 qe(t,e){return(qe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Le(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 ze(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ne(t);if(e){var o=Ne(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Le(this,n)}}function We(t,e,n){return(We="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)}Bt({target:"Object",stat:!0,forced:Object.assign!==Fe},{assign:Fe});var $e=n.default.fn.bootstrapTable.utils;n.default.extend(n.default.fn.bootstrapTable.defaults,{customView:!1,showCustomView:!1,showCustomViewButton:!1}),n.default.extend(n.default.fn.bootstrapTable.defaults.icons,{customView:{bootstrap3:"glyphicon glyphicon-eye-open",bootstrap4:"fa fa-eye",semantic:"fa fa-eye",foundation:"fa fa-eye",bulma:"fa fa-eye",materialize:"remove_red_eye"}[n.default.fn.bootstrapTable.theme]||"fa-eye"}),n.default.extend(n.default.fn.bootstrapTable.defaults,{onCustomViewPostBody:function(){return!1},onCustomViewPreBody:function(){return!1}}),n.default.extend(n.default.fn.bootstrapTable.locales,{formatToggleCustomView:function(){return"Toggle custom view"}}),n.default.extend(n.default.fn.bootstrapTable.defaults,n.default.fn.bootstrapTable.locales),n.default.fn.bootstrapTable.methods.push("toggleCustomView"),n.default.extend(n.default.fn.bootstrapTable.Constructor.EVENTS,{"custom-view-post-body.bs.table":"onCustomViewPostBody","custom-view-pre-body.bs.table":"onCustomViewPreBody"}),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&&qe(t,e)}(i,t);var e,n,r,o=ze(i);function i(){return Ie(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"init",value:function(){this.showCustomView=this.options.showCustomView,We(Ne(i.prototype),"init",this).call(this)}},{key:"initToolbar",value:function(){var t;this.options.customView&&this.options.showCustomViewButton&&(this.buttons=Object.assign(this.buttons,{customView:{text:this.options.formatToggleCustomView(),icon:this.options.icons.customView,event:this.toggleCustomView,attributes:{"aria-label":this.options.formatToggleCustomView(),title:this.options.formatToggleCustomView()}}}));for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=We(Ne(i.prototype),"initToolbar",this)).call.apply(t,[this].concat(n))}},{key:"initBody",value:function(){if(We(Ne(i.prototype),"initBody",this).call(this),this.options.customView){var t=this.$el,e=this.$container.find(".fixed-table-custom-view");if(t.hide(),e.hide(),this.options.customView&&this.showCustomView){var n=this.getData().slice(this.pageFrom-1,this.pageTo),r=$e.calculateObjectValue(this,this.options.customView,[n],"");this.trigger("custom-view-pre-body",n,r),1===e.length?e.show().html(r):this.$tableBody.after('<div class="fixed-table-custom-view">'.concat(r,"</div>")),this.trigger("custom-view-post-body",n,r)}else t.show()}}},{key:"toggleCustomView",value:function(){this.showCustomView=!this.showCustomView,this.initBody()}}])&&De(e.prototype,n),r&&De(e,r),i}(n.default.BootstrapTable)}));