UNPKG

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