UNPKG

9.68 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.3
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],b):(a=a||self,b(a.jQuery))})(this,function(a){'use strict';var c=Math.max,d=Math.min;function b(a,b){return b={exports:{}},a(b,b.exports),b.exports}a=a&&a.hasOwnProperty("default")?a["default"]:a;var e,g,h,i="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,j="object",k=function(a){return a&&a.Math==Math&&a},l=k(typeof globalThis==j&&globalThis)||k(typeof window==j&&window)||k(typeof self==j&&self)||k(typeof i==j&&i)||Function("return this")(),m=function(a){try{return!!a()}catch(a){return!0}},n=!m(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),o={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,q=p&&!o.call({1:2},1),r=q?function(a){var b=p(this,a);return!!b&&b.enumerable}:o,f={f:r},s=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}},t={}.toString,u=function(a){return t.call(a).slice(8,-1)},v="".split,w=m(function(){return!Object("z").propertyIsEnumerable(0)})?function(a){return"String"==u(a)?v.call(a,""):Object(a)}:Object,x=function(a){if(a==null)throw TypeError("Can't call method on "+a);return a},y=function(a){return w(x(a))},z=function(a){return"object"==typeof a?null!==a:"function"==typeof a},A=function(a,b){if(!z(a))return a;var c,d;if(b&&"function"==typeof(c=a.toString)&&!z(d=c.call(a)))return d;if("function"==typeof(c=a.valueOf)&&!z(d=c.call(a)))return d;if(!b&&"function"==typeof(c=a.toString)&&!z(d=c.call(a)))return d;throw TypeError("Can't convert object to primitive value")},B={}.hasOwnProperty,C=function(a,b){return B.call(a,b)},D=l.document,E=z(D)&&z(D.createElement),F=function(a){return E?D.createElement(a):{}},G=!n&&!m(function(){return 7!=Object.defineProperty(F("div"),"a",{get:function(){return 7}}).a}),H=Object.getOwnPropertyDescriptor,I=n?H:function(a,b){if(a=y(a),b=A(b,!0),G)try{return H(a,b)}catch(a){}return C(a,b)?s(!f.f.call(a,b),a[b]):void 0},J={f:I},K=function(a){if(!z(a))throw TypeError(a+" is not an object");return a},L=Object.defineProperty,M=n?L:function(a,b,c){if(K(a),b=A(b,!0),K(c),G)try{return L(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported");return"value"in c&&(a[b]=c.value),a},N={f:M},P=n?function(a,b,c){return N.f(a,b,s(1,c))}:function(a,b,c){return a[b]=c,a},Q=function(a,b){try{P(l,a,b)}catch(c){l[a]=b}return b},R=b(function(a){var b=l["__core-js_shared__"]||Q("__core-js_shared__",{});(a.exports=function(a,c){return b[a]||(b[a]=c===void 0?{}:c)})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})}),S=R("native-function-to-string",Function.toString),T=l.WeakMap,U="function"==typeof T&&/native code/.test(S.call(T)),V=0,O=Math.random(),W=function(a){return"Symbol("+((a===void 0?"":a)+"")+")_"+(++V+O).toString(36)},X=R("keys"),Y=function(a){return X[a]||(X[a]=W(a))},Z={},_=l.WeakMap,aa=function(a){return h(a)?g(a):e(a,{})};if(U){var ba=new _,ca=ba.get,da=ba.has,ea=ba.set;e=function(a,b){return ea.call(ba,a,b),b},g=function(a){return ca.call(ba,a)||{}},h=function(a){return da.call(ba,a)}}else{var fa=Y("state");Z[fa]=!0,e=function(a,b){return P(a,fa,b),b},g=function(a){return C(a,fa)?a[fa]:{}},h=function(a){return C(a,fa)}}var ga={set:e,get:g,has:h,enforce:aa,getterFor:function(a){return function(b){var c;if(!z(b)||(c=g(b)).type!==a)throw TypeError("Incompatible receiver, "+a+" required");return c}}},ha=b(function(a){var b=ga.get,c=ga.enforce,d=(S+"").split("toString");R("inspectSource",function(a){return S.call(a)}),(a.exports=function(a,b,e,f){var g=!!f&&!!f.unsafe,h=!!f&&!!f.enumerable,i=!!f&&!!f.noTargetGet;return("function"==typeof e&&("string"==typeof b&&!C(e,"name")&&P(e,"name",b),c(e).source=d.join("string"==typeof b?b:"")),a===l)?void(h?a[b]=e:Q(b,e)):void(g?!i&&a[b]&&(h=!0):delete a[b],h?a[b]=e:P(a,b,e))})(Function.prototype,"toString",function(){return"function"==typeof this&&b(this).source||S.call(this)})}),ia=l,ja=function(a){return"function"==typeof a?a:void 0},ka=Math.ceil,la=Math.floor,ma=function(a){return isNaN(a=+a)?0:(0<a?la:ka)(a)},na=function(a){return 0<a?d(ma(a),9007199254740991):0},oa=function(a,b){var e=ma(a);return 0>e?c(e+b,0):d(e,b)},pa=function(a){return function(b,c,d){var e,f=y(b),g=na(f.length),h=oa(d,g);if(a&&c!=c){for(;g>h;)if(e=f[h++],e!=e)return!0;}else for(;g>h;h++)if((a||h in f)&&f[h]===c)return a||h||0;return!a&&-1}},qa={includes:pa(!0),indexOf:pa(!1)},ra=qa.indexOf,sa=function(a,b){var c,d=y(a),e=0,f=[];for(c in d)!C(Z,c)&&C(d,c)&&f.push(c);for(;b.length>e;)C(d,c=b[e++])&&(~ra(f,c)||f.push(c));return f},ta=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),ua=Object.getOwnPropertyNames||function(a){return sa(a,ta)},va={f:ua},wa=Object.getOwnPropertySymbols,xa={f:wa},ya=function(a,b){return 2>arguments.length?ja(ia[a])||ja(l[a]):ia[a]&&ia[a][b]||l[a]&&l[a][b]}("Reflect","ownKeys")||function(a){var b=va.f(K(a)),c=xa.f;return c?b.concat(c(a)):b},za=function(a,b){for(var c,d=ya(b),e=N.f,f=J.f,g=0;g<d.length;g++)c=d[g],C(a,c)||e(a,c,f(b,c))},Aa=/#|\.prototype\./,Ba=function(a,b){var c=Da[Ca(a)];return!(c!=Fa)||c!=Ea&&("function"==typeof b?m(b):!!b)},Ca=Ba.normalize=function(a){return(a+"").replace(Aa,".").toLowerCase()},Da=Ba.data={},Ea=Ba.NATIVE="N",Fa=Ba.POLYFILL="P",Ga=J.f,Ha=function(a,b){var c,d,e,f,g,h,i=a.target,j=a.global,k=a.stat;if(d=j?l:k?l[i]||Q(i,{}):(l[i]||{}).prototype,d)for(e in b){if(g=b[e],a.noTargetGet?(h=Ga(d,e),f=h&&h.value):f=d[e],c=Ba(j?e:i+(k?".":"#")+e,a.forced),!c&&void 0!==f){if(typeof g==typeof f)continue;za(g,f)}(a.sham||f&&f.sham)&&P(g,"sham",!0),ha(d,e,g,a)}},Ia=Array.isArray||function(a){return"Array"==u(a)},Ja=function(a){return Object(x(a))},Ka=function(a,b,c){var d=A(b);d in a?N.f(a,d,s(0,c)):a[d]=c},La=!!Object.getOwnPropertySymbols&&!m(function(){return!(Symbol()+"")}),Ma=l.Symbol,Na=R("wks"),Oa=function(a){return Na[a]||(Na[a]=La&&Ma[a]||(La?Ma:W)("Symbol."+a))},Pa=Oa("species"),Qa=function(a,b){var c;return Ia(a)&&(c=a.constructor,"function"==typeof c&&(c===Array||Ia(c.prototype))?c=void 0:z(c)&&(c=c[Pa],null===c&&(c=void 0))),new(void 0===c?Array:c)(0===b?0:b)},Ra=Oa("species"),Sa=function(a){return!m(function(){var b=[],c=b.constructor={};return c[Ra]=function(){return{foo:1}},1!==b[a](Boolean).foo})},Ta=Oa("isConcatSpreadable"),Ua=9007199254740991,Va="Maximum allowed index exceeded",Wa=!m(function(){var a=[];return a[Ta]=!1,a.concat()[0]!==a}),Xa=Sa("concat"),Ya=function(a){if(!z(a))return!1;var b=a[Ta];return b===void 0?Ia(a):!!b};Ha({target:"Array",proto:!0,forced:!Wa||!Xa},{concat:function(){var a,b,c,d,e,f=Ja(this),g=Qa(f,0),h=0;for(a=-1,c=arguments.length;a<c;a++)if(e=-1===a?f:arguments[a],Ya(e)){if(d=na(e.length),h+d>Ua)throw TypeError(Va);for(b=0;b<d;b++,h++)b in e&&Ka(g,h,e[b])}else{if(h>=Ua)throw TypeError(Va);Ka(g,h++,e)}return g.length=h,g}});var Za=Oa("species"),$a=[].slice;Ha({target:"Array",proto:!0,forced:!Sa("slice")},{slice:function(a,b){var d,e,f,g=y(this),h=na(g.length),i=oa(a,h),j=oa(void 0===b?h:b,h);if(Ia(g)&&(d=g.constructor,"function"==typeof d&&(d===Array||Ia(d.prototype))?d=void 0:z(d)&&(d=d[Za],null===d&&(d=void 0)),d===Array||void 0===d))return $a.call(g,i,j);for(e=new(void 0===d?Array:d)(c(j-i,0)),f=0;i<j;i++,f++)i in g&&Ka(e,f,g[i]);return e.length=f,e}});var _a=function(a,b){return{id:"customId_".concat(b)}};a.extend(a.fn.bootstrapTable.defaults,{reorderableRows:!1,onDragStyle:null,onDropStyle:null,onDragClass:"reorder_rows_onDragClass",dragHandle:null,useRowAttrFunc:!1,onReorderRowsDrag:function(){return!1},onReorderRowsDrop:function(){return!1},onReorderRow:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"reorder-row.bs.table":"onReorderRow"});var ab=a.fn.bootstrapTable.Constructor,bb=ab.prototype.init,cb=ab.prototype.initSearch;ab.prototype.init=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];if(!this.options.reorderableRows)return void bb.apply(this,Array.prototype.slice.apply(b));var d=this;this.options.useRowAttrFunc&&(this.options.rowAttributes=_a);var e=this.options.onPostBody;this.options.onPostBody=function(){setTimeout(function(){d.makeRowsReorderable(),e.apply()},1)},bb.apply(this,Array.prototype.slice.apply(b))},ab.prototype.initSearch=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];cb.apply(this,Array.prototype.slice.apply(b));!this.options.reorderableRows},ab.prototype.makeRowsReorderable=function(){if(!this.options.cardView){var a=this;this.$el.tableDnD({onDragStyle:a.options.onDragStyle,onDropStyle:a.options.onDropStyle,onDragClass:a.options.onDragClass,onDrop:a.onDrop,onDragStart:a.options.onReorderRowsDrag,dragHandle:a.options.dragHandle})}},ab.prototype.onDrop=function(b,c){for(var d=a(b),e=d.data("bootstrap.table"),f=d.data("bootstrap.table").options,g=null,h=[],j=0;j<b.tBodies[0].rows.length;j++)g=a(b.tBodies[0].rows[j]),h.push(f.data[g.data("index")]),g.data("index",j).attr("data-index",j);f.data=f.data.slice(0,e.pageFrom-1).concat(h).concat(f.data.slice(e.pageTo)),f.onReorderRowsDrop.apply(b,[b,c]),e.trigger("reorder-row",h)}});