UNPKG

9.64 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 n(t,r){return t(r={exports:{}},r.exports),r.exports}var e,o,i,a,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")(),s=function(t){try{return!!t()}catch(t){return!0}},l=!s((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),p={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,d={f:y&&!p.call({1:2},1)?function(t){var r=y(this,t);return!!r&&r.enumerable}:p},h=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}},g={}.toString,v=function(t){return g.call(t).slice(8,-1)},b="".split,w=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==v(t)?b.call(t,""):Object(t)}:Object,m=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},S=function(t){return w(m(t))},O=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=function(t,r){if(!O(t))return t;var n,e;if(r&&"function"==typeof(n=t.toString)&&!O(e=n.call(t)))return e;if("function"==typeof(n=t.valueOf)&&!O(e=n.call(t)))return e;if(!r&&"function"==typeof(n=t.toString)&&!O(e=n.call(t)))return e;throw TypeError("Can't convert object to primitive value")},D={}.hasOwnProperty,R=function(t,r){return D.call(t,r)},x=f.document,A=O(x)&&O(x.createElement),T=!l&&!s((function(){return 7!=Object.defineProperty((t="div",A?x.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),P=Object.getOwnPropertyDescriptor,E={f:l?P:function(t,r){if(t=S(t),r=j(r,!0),T)try{return P(t,r)}catch(t){}if(R(t,r))return h(!d.f.call(t,r),t[r])}},_=function(t){if(!O(t))throw TypeError(String(t)+" is not an object");return t},M=Object.defineProperty,C={f:l?M:function(t,r,n){if(_(t),r=j(r,!0),_(n),T)try{return M(t,r,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[r]=n.value),t}},k=l?function(t,r,n){return C.f(t,r,h(1,n))}:function(t,r,n){return t[r]=n,t},F=function(t,r){try{k(f,t,r)}catch(n){f[t]=r}return r},I=n((function(t){var r=f["__core-js_shared__"]||F("__core-js_shared__",{});(t.exports=function(t,n){return r[t]||(r[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.1.3",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),N=I("native-function-to-string",Function.toString),B=f.WeakMap,L="function"==typeof B&&/native code/.test(N.call(B)),q=0,z=Math.random(),H=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+z).toString(36)},V=I("keys"),G={},W=f.WeakMap;if(L){var K=new W,Q=K.get,Y=K.has,$=K.set;e=function(t,r){return $.call(K,t,r),r},o=function(t){return Q.call(K,t)||{}},i=function(t){return Y.call(K,t)}}else{var J=V[a="state"]||(V[a]=H(a));G[J]=!0,e=function(t,r){return k(t,J,r),r},o=function(t){return R(t,J)?t[J]:{}},i=function(t){return R(t,J)}}var U={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(r){var n;if(!O(r)||(n=o(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},X=n((function(t){var r=U.get,n=U.enforce,e=String(N).split("toString");I("inspectSource",(function(t){return N.call(t)})),(t.exports=function(t,r,o,i){var a=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,c=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof r||R(o,"name")||k(o,"name",r),n(o).source=e.join("string"==typeof r?r:"")),t!==f?(a?!c&&t[r]&&(u=!0):delete t[r],u?t[r]=o:k(t,r,o)):u?t[r]=o:F(r,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&r(this).source||N.call(this)}))})),Z=f,tt=function(t){return"function"==typeof t?t:void 0},rt=Math.ceil,nt=Math.floor,et=function(t){return isNaN(t=+t)?0:(t>0?nt:rt)(t)},ot=Math.min,it=function(t){return t>0?ot(et(t),9007199254740991):0},at=Math.max,ut=Math.min,ct=function(t,r){var n=et(t);return n<0?at(n+r,0):ut(n,r)},ft=function(t){return function(r,n,e){var o,i=S(r),a=it(i.length),u=ct(e,a);if(t&&n!=n){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===n)return t||u||0;return!t&&-1}},st={includes:ft(!0),indexOf:ft(!1)}.indexOf,lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),pt={f:Object.getOwnPropertyNames||function(t){return function(t,r){var n,e=S(t),o=0,i=[];for(n in e)!R(G,n)&&R(e,n)&&i.push(n);for(;r.length>o;)R(e,n=r[o++])&&(~st(i,n)||i.push(n));return i}(t,lt)}},yt={f:Object.getOwnPropertySymbols},dt=function(t,r){return arguments.length<2?tt(Z[t])||tt(f[t]):Z[t]&&Z[t][r]||f[t]&&f[t][r]}("Reflect","ownKeys")||function(t){var r=pt.f(_(t)),n=yt.f;return n?r.concat(n(t)):r},ht=function(t,r){for(var n=dt(r),e=C.f,o=E.f,i=0;i<n.length;i++){var a=n[i];R(t,a)||e(t,a,o(r,a))}},gt=/#|\.prototype\./,vt=function(t,r){var n=wt[bt(t)];return n==St||n!=mt&&("function"==typeof r?s(r):!!r)},bt=vt.normalize=function(t){return String(t).replace(gt,".").toLowerCase()},wt=vt.data={},mt=vt.NATIVE="N",St=vt.POLYFILL="P",Ot=vt,jt=E.f,Dt=function(t,r){var n,e,o,i,a,u=t.target,c=t.global,s=t.stat;if(n=c?f:s?f[u]||F(u,{}):(f[u]||{}).prototype)for(e in r){if(i=r[e],o=t.noTargetGet?(a=jt(n,e))&&a.value:n[e],!Ot(c?e:u+(s?".":"#")+e,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;ht(i,o)}(t.sham||o&&o.sham)&&k(i,"sham",!0),X(n,e,i,t)}},Rt=Array.isArray||function(t){return"Array"==v(t)},xt=function(t){return Object(m(t))},At=function(t,r,n){var e=j(r);e in t?C.f(t,e,h(0,n)):t[e]=n},Tt=!!Object.getOwnPropertySymbols&&!s((function(){return!String(Symbol())})),Pt=f.Symbol,Et=I("wks"),_t=function(t){return Et[t]||(Et[t]=Tt&&Pt[t]||(Tt?Pt:H)("Symbol."+t))},Mt=_t("species"),Ct=function(t,r){var n;return Rt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Rt(n.prototype)?O(n)&&null===(n=n[Mt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===r?0:r)},kt=_t("species"),Ft=function(t){return!s((function(){var r=[];return(r.constructor={})[kt]=function(){return{foo:1}},1!==r[t](Boolean).foo}))},It=_t("isConcatSpreadable"),Nt=!s((function(){var t=[];return t[It]=!1,t.concat()[0]!==t})),Bt=Ft("concat"),Lt=function(t){if(!O(t))return!1;var r=t[It];return void 0!==r?!!r:Rt(t)};Dt({target:"Array",proto:!0,forced:!Nt||!Bt},{concat:function(t){var r,n,e,o,i,a=xt(this),u=Ct(a,0),c=0;for(r=-1,e=arguments.length;r<e;r++)if(i=-1===r?a:arguments[r],Lt(i)){if(c+(o=it(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,c++)n in i&&At(u,c,i[n])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");At(u,c++,i)}return u.length=c,u}});var qt=_t("species"),zt=[].slice,Ht=Math.max;Dt({target:"Array",proto:!0,forced:!Ft("slice")},{slice:function(t,r){var n,e,o,i=S(this),a=it(i.length),u=ct(t,a),c=ct(void 0===r?a:r,a);if(Rt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Rt(n.prototype)?O(n)&&null===(n=n[qt])&&(n=void 0):n=void 0,n===Array||void 0===n))return zt.call(i,u,c);for(e=new(void 0===n?Array:n)(Ht(c-u,0)),o=0;u<c;u++,o++)u in i&&At(e,o,i[u]);return e.length=o,e}});var Vt=function(t,r){return{id:"customId_".concat(r)}};t.extend(t.fn.bootstrapTable.defaults,{reorderableRows:!1,onDragStyle:null,onDropStyle:null,onDragClass:"reorder_rows_onDragClass",dragHandle:null,useRowAttrFunc:!1,onReorderRowsDrag:function(t,r){return!1},onReorderRowsDrop:function(t,r){return!1},onReorderRow:function(t){return!1}}),t.extend(t.fn.bootstrapTable.Constructor.EVENTS,{"reorder-row.bs.table":"onReorderRow"});var Gt=t.fn.bootstrapTable.Constructor,Wt=Gt.prototype.init,Kt=Gt.prototype.initSearch;Gt.prototype.init=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(this.options.reorderableRows){var e=this;this.options.useRowAttrFunc&&(this.options.rowAttributes=Vt);var o=this.options.onPostBody;this.options.onPostBody=function(){setTimeout((function(){e.makeRowsReorderable(),o.apply()}),1)},Wt.apply(this,Array.prototype.slice.apply(r))}else Wt.apply(this,Array.prototype.slice.apply(r))},Gt.prototype.initSearch=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];Kt.apply(this,Array.prototype.slice.apply(r)),this.options.reorderableRows},Gt.prototype.makeRowsReorderable=function(){if(!this.options.cardView){this.$el.tableDnD({onDragStyle:this.options.onDragStyle,onDropStyle:this.options.onDropStyle,onDragClass:this.options.onDragClass,onDrop:this.onDrop,onDragStart:this.options.onReorderRowsDrag,dragHandle:this.options.dragHandle})}},Gt.prototype.onDrop=function(r,n){for(var e=t(r),o=e.data("bootstrap.table"),i=e.data("bootstrap.table").options,a=null,u=[],c=0;c<r.tBodies[0].rows.length;c++)a=t(r.tBodies[0].rows[c]),u.push(i.data[a.data("index")]),a.data("index",c).attr("data-index",c);i.data=i.data.slice(0,o.pageFrom-1).concat(u).concat(i.data.slice(o.pageTo)),i.onReorderRowsDrop.apply(r,[r,n]),o.trigger("reorder-row",u)}}));