UNPKG

11.7 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.15.5
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],r):r((t=t||self).jQuery)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,r){return t(r={exports:{}},r.exports),r.exports}var n,o,i,u="object",c=function(t){return t&&t.Math==Math&&t},f=c(typeof globalThis==u&&globalThis)||c(typeof window==u&&window)||c(typeof self==u&&self)||c(typeof r==u&&r)||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},l=!a((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),s={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,y={f:p&&!s.call({1:2},1)?function(t){var r=p(this,t);return!!r&&r.enumerable}:s},d=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}},h={}.toString,g=function(t){return h.call(t).slice(8,-1)},v="".split,m=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==g(t)?v.call(t,""):Object(t)}:Object,b=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},w=function(t){return m(b(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=function(t,r){if(!O(t))return t;var e,n;if(r&&"function"==typeof(e=t.toString)&&!O(n=e.call(t)))return n;if("function"==typeof(e=t.valueOf)&&!O(n=e.call(t)))return n;if(!r&&"function"==typeof(e=t.toString)&&!O(n=e.call(t)))return n;throw TypeError("Can't convert object to primitive value")},S={}.hasOwnProperty,A=function(t,r){return S.call(t,r)},T=f.document,x=O(T)&&O(T.createElement),E=function(t){return x?T.createElement(t):{}},C=!l&&!a((function(){return 7!=Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,R={f:l?P:function(t,r){if(t=w(t),r=j(r,!0),C)try{return P(t,r)}catch(t){}if(A(t,r))return d(!y.f.call(t,r),t[r])}},M=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},_=Object.defineProperty,k={f:l?_:function(t,r,e){if(M(t),r=j(r,!0),M(e),C)try{return _(t,r,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},I=l?function(t,r,e){return k.f(t,r,d(1,e))}:function(t,r,e){return t[r]=e,t},V=function(t,r){try{I(f,t,r)}catch(e){f[t]=r}return r},F=e((function(t){var r=f["__core-js_shared__"]||V("__core-js_shared__",{});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),N=F("native-function-to-string",Function.toString),L=f.WeakMap,q="function"==typeof L&&/native code/.test(N.call(L)),D=0,H=Math.random(),z=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++D+H).toString(36)},W=F("keys"),$=function(t){return W[t]||(W[t]=z(t))},B={},G=f.WeakMap;if(q){var K=new G,Q=K.get,Y=K.has,J=K.set;n=function(t,r){return J.call(K,t,r),r},o=function(t){return Q.call(K,t)||{}},i=function(t){return Y.call(K,t)}}else{var U=$("state");B[U]=!0,n=function(t,r){return I(t,U,r),r},o=function(t){return A(t,U)?t[U]:{}},i=function(t){return A(t,U)}}var X={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!O(r)||(e=o(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}},Z=e((function(t){var r=X.get,e=X.enforce,n=String(N).split("toString");F("inspectSource",(function(t){return N.call(t)})),(t.exports=function(t,r,o,i){var u=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof r||A(o,"name")||I(o,"name",r),e(o).source=n.join("string"==typeof r?r:"")),t!==f?(u?!a&&t[r]&&(c=!0):delete t[r],c?t[r]=o:I(t,r,o)):c?t[r]=o:V(r,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&r(this).source||N.call(this)}))})),tt=f,rt=function(t){return"function"==typeof t?t:void 0},et=function(t,r){return arguments.length<2?rt(tt[t])||rt(f[t]):tt[t]&&tt[t][r]||f[t]&&f[t][r]},nt=Math.ceil,ot=Math.floor,it=function(t){return isNaN(t=+t)?0:(t>0?ot:nt)(t)},ut=Math.min,ct=function(t){return t>0?ut(it(t),9007199254740991):0},ft=Math.max,at=Math.min,lt=function(t,r){var e=it(t);return e<0?ft(e+r,0):at(e,r)},st=function(t){return function(r,e,n){var o,i=w(r),u=ct(i.length),c=lt(n,u);if(t&&e!=e){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===e)return t||c||0;return!t&&-1}},pt={includes:st(!0),indexOf:st(!1)}.indexOf,yt=function(t,r){var e,n=w(t),o=0,i=[];for(e in n)!A(B,e)&&A(n,e)&&i.push(e);for(;r.length>o;)A(n,e=r[o++])&&(~pt(i,e)||i.push(e));return i},dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ht=dt.concat("length","prototype"),gt={f:Object.getOwnPropertyNames||function(t){return yt(t,ht)}},vt={f:Object.getOwnPropertySymbols},mt=et("Reflect","ownKeys")||function(t){var r=gt.f(M(t)),e=vt.f;return e?r.concat(e(t)):r},bt=function(t,r){for(var e=mt(r),n=k.f,o=R.f,i=0;i<e.length;i++){var u=e[i];A(t,u)||n(t,u,o(r,u))}},wt=/#|\.prototype\./,Ot=function(t,r){var e=St[jt(t)];return e==Tt||e!=At&&("function"==typeof r?a(r):!!r)},jt=Ot.normalize=function(t){return String(t).replace(wt,".").toLowerCase()},St=Ot.data={},At=Ot.NATIVE="N",Tt=Ot.POLYFILL="P",xt=Ot,Et=R.f,Ct=function(t,r){var e,n,o,i,u,c=t.target,a=t.global,l=t.stat;if(e=a?f:l?f[c]||V(c,{}):(f[c]||{}).prototype)for(n in r){if(i=r[n],o=t.noTargetGet?(u=Et(e,n))&&u.value:e[n],!xt(a?n:c+(l?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;bt(i,o)}(t.sham||o&&o.sham)&&I(i,"sham",!0),Z(e,n,i,t)}},Pt=function(t,r,e){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===r)return t;switch(e){case 0:return function(){return t.call(r)};case 1:return function(e){return t.call(r,e)};case 2:return function(e,n){return t.call(r,e,n)};case 3:return function(e,n,o){return t.call(r,e,n,o)}}return function(){return t.apply(r,arguments)}},Rt=Array.isArray||function(t){return"Array"==g(t)},Mt=!!Object.getOwnPropertySymbols&&!a((function(){return!String(Symbol())})),_t=f.Symbol,kt=F("wks"),It=function(t){return kt[t]||(kt[t]=Mt&&_t[t]||(Mt?_t:z)("Symbol."+t))},Vt=It("species"),Ft=function(t,r){var e;return Rt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Rt(e.prototype)?O(e)&&null===(e=e[Vt])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===r?0:r)},Nt=[].push,Lt=function(t){var r=1==t,e=2==t,n=3==t,o=4==t,i=6==t,u=5==t||i;return function(c,f,a,l){for(var s,p,y=Object(b(c)),d=m(y),h=Pt(f,a,3),g=ct(d.length),v=0,w=l||Ft,O=r?w(c,g):e?w(c,0):void 0;g>v;v++)if((u||v in d)&&(p=h(s=d[v],v,y),t))if(r)O[v]=p;else if(p)switch(t){case 3:return!0;case 5:return s;case 6:return v;case 2:Nt.call(O,s)}else if(o)return!1;return i?-1:n||o?o:O}},qt={forEach:Lt(0),map:Lt(1),filter:Lt(2),some:Lt(3),every:Lt(4),find:Lt(5),findIndex:Lt(6)},Dt=It("species"),Ht=function(t){return!a((function(){var r=[];return(r.constructor={})[Dt]=function(){return{foo:1}},1!==r[t](Boolean).foo}))},zt=qt.filter;Ct({target:"Array",proto:!0,forced:!Ht("filter")},{filter:function(t){return zt(this,t,arguments.length>1?arguments[1]:void 0)}});var Wt=Object.keys||function(t){return yt(t,dt)},$t=l?Object.defineProperties:function(t,r){M(t);for(var e,n=Wt(r),o=n.length,i=0;o>i;)k.f(t,e=n[i++],r[e]);return t},Bt=et("document","documentElement"),Gt=$("IE_PROTO"),Kt=function(){},Qt=function(){var t,r=E("iframe"),e=dt.length;for(r.style.display="none",Bt.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Qt=t.F;e--;)delete Qt.prototype[dt[e]];return Qt()},Yt=Object.create||function(t,r){var e;return null!==t?(Kt.prototype=M(t),e=new Kt,Kt.prototype=null,e[Gt]=t):e=Qt(),void 0===r?e:$t(e,r)};B[Gt]=!0;var Jt=It("unscopables"),Ut=Array.prototype;null==Ut[Jt]&&I(Ut,Jt,Yt(null));var Xt,Zt=qt.find,tr=!0;"find"in[]&&Array(1).find((function(){tr=!1})),Ct({target:"Array",proto:!0,forced:tr},{find:function(t){return Zt(this,t,arguments.length>1?arguments[1]:void 0)}}),Xt="find",Ut[Jt][Xt]=!0;var rr=function(t,r,e){var n=j(r);n in t?k.f(t,n,d(0,e)):t[n]=e},er=It("species"),nr=[].slice,or=Math.max;Ct({target:"Array",proto:!0,forced:!Ht("slice")},{slice:function(t,r){var e,n,o,i=w(this),u=ct(i.length),c=lt(t,u),f=lt(void 0===r?u:r,u);if(Rt(i)&&("function"!=typeof(e=i.constructor)||e!==Array&&!Rt(e.prototype)?O(e)&&null===(e=e[er])&&(e=void 0):e=void 0,e===Array||void 0===e))return nr.call(i,c,f);for(n=new(void 0===e?Array:e)(or(f-c,0)),o=0;c<f;c++,o++)c in i&&rr(n,o,i[c]);return n.length=o,n}});t.extend(t.fn.bootstrapTable.defaults,{reorderableColumns:!1,maxMovingRows:10,onReorderColumn:function(t){return!1},dragaccept:null}),t.extend(t.fn.bootstrapTable.Constructor.EVENTS,{"reorder-column.bs.table":"onReorderColumn"});var ir=t.fn.bootstrapTable.Constructor,ur=ir.prototype.initHeader,cr=ir.prototype._toggleColumn,fr=ir.prototype.toggleView,ar=ir.prototype.resetView;ir.prototype.initHeader=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];ur.apply(this,Array.prototype.slice.apply(r)),this.options.reorderableColumns&&this.makeRowsReorderable()},ir.prototype._toggleColumn=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];cr.apply(this,Array.prototype.slice.apply(r)),this.options.reorderableColumns&&this.makeRowsReorderable()},ir.prototype.toggleView=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];fr.apply(this,Array.prototype.slice.apply(r)),this.options.reorderableColumns&&(this.options.cardView||this.makeRowsReorderable())},ir.prototype.resetView=function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];ar.apply(this,Array.prototype.slice.apply(r)),this.options.reorderableColumns&&this.makeRowsReorderable()},ir.prototype.makeRowsReorderable=function(){var r=this;try{t(this.$el).dragtable("destroy")}catch(t){}t(this.$el).dragtable({maxMovingRows:r.options.maxMovingRows,dragaccept:r.options.dragaccept,clickDelay:200,dragHandle:".th-inner",beforeStop:function(){var e=[],n=[],o=[],i=[],u=-1,c=[];if(r.$header.find("th").each((function(r){e.push(t(this).data("field")),n.push(t(this).data("formatter"))})),e.length<r.columns.length){i=r.columns.filter((function(t){return!t.visible}));for(var f=0;f<i.length;f++)e.push(i[f].field),n.push(i[f].formatter)}for(var a=0;a<e.length;a++)-1!==(u=r.fieldsColumnsIndex[e[a]])&&(r.fieldsColumnsIndex[e[a]]=a,r.columns[u].fieldIndex=a,o.push(r.columns[u]));r.columns=o,Array.prototype.filter||(Array.prototype.filter=function(t){if(null==this)throw new TypeError;var r=Object(this),e=r.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],o=arguments.length>=2?arguments[1]:void 0,i=0;i<e;i++)if(i in r){var u=r[i];t.call(o,u,i,r)&&n.push(u)}return n}),t.each(r.columns,(function(t,e){var n=!1,o=e.field;r.options.columns[0].filter((function(t){return!(!n&&t.field===o)||(c.push(t),n=!0,!1)}))})),r.options.columns[0]=c,r.header.fields=e,r.header.formatters=n,r.initHeader(),r.initToolbar(),r.initSearchText(),r.initBody(),r.resetView(),r.trigger("reorder-column",e)}})}}));