UNPKG

12 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.1
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],n):n((t=t||self).jQuery)}(this,(function(t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,n){return t(n={exports:{}},n.exports),n.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 n&&n)||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})),a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,f={f:c&&!a.call({1:2},1)?function(t){var n=c(this,t);return!!n&&n.enumerable}:a},s=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},l={}.toString,p=function(t){return l.call(t).slice(8,-1)},d="".split,y=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?d.call(t,""):Object(t)}:Object,h=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return y(h(t))},b=function(t){return"object"==typeof t?null!==t:"function"==typeof t},v=function(t,n){if(!b(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!b(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!b(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")},w={}.hasOwnProperty,m=function(t,n){return w.call(t,n)},O=o.document,S=b(O)&&b(O.createElement),j=!u&&!i((function(){return 7!=Object.defineProperty((t="div",S?O.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),x=Object.getOwnPropertyDescriptor,D={f:u?x:function(t,n){if(t=g(t),n=v(n,!0),j)try{return x(t,n)}catch(t){}if(m(t,n))return s(!f.f.call(t,n),t[n])}},T=function(t){if(!b(t))throw TypeError(String(t)+" is not an object");return t},R=Object.defineProperty,P={f:u?R:function(t,n,e){if(T(t),n=v(n,!0),T(e),j)try{return R(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},E=u?function(t,n,e){return P.f(t,n,s(1,e))}:function(t,n,e){return t[n]=e,t},_=function(t,n){try{E(o,t,n)}catch(e){o[t]=n}return n},A="__core-js_shared__",M=o[A]||_(A,{}),k=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return k.call(t)});var C,I,B,F,N=M.inspectSource,L=o.WeakMap,q="function"==typeof L&&/native code/.test(N(L)),$=e((function(t){(t.exports=function(t,n){return M[t]||(M[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.0",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),z=0,H=Math.random(),G=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++z+H).toString(36)},V=$("keys"),W={},K=o.WeakMap;if(q){var Q=new K,Y=Q.get,J=Q.has,U=Q.set;C=function(t,n){return U.call(Q,t,n),n},I=function(t){return Y.call(Q,t)||{}},B=function(t){return J.call(Q,t)}}else{var X=V[F="state"]||(V[F]=G(F));W[X]=!0,C=function(t,n){return E(t,X,n),n},I=function(t){return m(t,X)?t[X]:{}},B=function(t){return m(t,X)}}var Z,tt,nt={set:C,get:I,has:B,enforce:function(t){return B(t)?I(t):C(t,{})},getterFor:function(t){return function(n){var e;if(!b(n)||(e=I(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}},et=e((function(t){var n=nt.get,e=nt.enforce,r=String(String).split("String");(t.exports=function(t,n,i,u){var a=!!u&&!!u.unsafe,c=!!u&&!!u.enumerable,f=!!u&&!!u.noTargetGet;"function"==typeof i&&("string"!=typeof n||m(i,"name")||E(i,"name",n),e(i).source=r.join("string"==typeof n?n:"")),t!==o?(a?!f&&t[n]&&(c=!0):delete t[n],c?t[n]=i:E(t,n,i)):c?t[n]=i:_(n,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&n(this).source||N(this)}))})),rt=o,ot=function(t){return"function"==typeof t?t:void 0},it=function(t,n){return arguments.length<2?ot(rt[t])||ot(o[t]):rt[t]&&rt[t][n]||o[t]&&o[t][n]},ut=Math.ceil,at=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?at:ut)(t)},ft=Math.min,st=function(t){return t>0?ft(ct(t),9007199254740991):0},lt=Math.max,pt=Math.min,dt=function(t,n){var e=ct(t);return e<0?lt(e+n,0):pt(e,n)},yt=function(t){return function(n,e,r){var o,i=g(n),u=st(i.length),a=dt(r,u);if(t&&e!=e){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===e)return t||a||0;return!t&&-1}},ht={includes:yt(!0),indexOf:yt(!1)},gt=ht.indexOf,bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return function(t,n){var e,r=g(t),o=0,i=[];for(e in r)!m(W,e)&&m(r,e)&&i.push(e);for(;n.length>o;)m(r,e=n[o++])&&(~gt(i,e)||i.push(e));return i}(t,bt)}},wt={f:Object.getOwnPropertySymbols},mt=it("Reflect","ownKeys")||function(t){var n=vt.f(T(t)),e=wt.f;return e?n.concat(e(t)):n},Ot=function(t,n){for(var e=mt(n),r=P.f,o=D.f,i=0;i<e.length;i++){var u=e[i];m(t,u)||r(t,u,o(n,u))}},St=/#|\.prototype\./,jt=function(t,n){var e=Dt[xt(t)];return e==Rt||e!=Tt&&("function"==typeof n?i(n):!!n)},xt=jt.normalize=function(t){return String(t).replace(St,".").toLowerCase()},Dt=jt.data={},Tt=jt.NATIVE="N",Rt=jt.POLYFILL="P",Pt=jt,Et=D.f,_t=function(t,n){var e,r,i,u,a,c=t.target,f=t.global,s=t.stat;if(e=f?o:s?o[c]||_(c,{}):(o[c]||{}).prototype)for(r in n){if(u=n[r],i=t.noTargetGet?(a=Et(e,r))&&a.value:e[r],!Pt(f?r:c+(s?".":"#")+r,t.forced)&&void 0!==i){if(typeof u==typeof i)continue;Ot(u,i)}(t.sham||i&&i.sham)&&E(u,"sham",!0),et(e,r,u,t)}},At=Array.isArray||function(t){return"Array"==p(t)},Mt=function(t){return Object(h(t))},kt=function(t,n,e){var r=v(n);r in t?P.f(t,r,s(0,e)):t[r]=e},Ct=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),It=Ct&&!Symbol.sham&&"symbol"==typeof Symbol(),Bt=$("wks"),Ft=o.Symbol,Nt=It?Ft:G,Lt=function(t){return m(Bt,t)||(Ct&&m(Ft,t)?Bt[t]=Ft[t]:Bt[t]=Nt("Symbol."+t)),Bt[t]},qt=Lt("species"),$t=function(t,n){var e;return At(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!At(e.prototype)?b(e)&&null===(e=e[qt])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)},zt=it("navigator","userAgent")||"",Ht=o.process,Gt=Ht&&Ht.versions,Vt=Gt&&Gt.v8;Vt?tt=(Z=Vt.split("."))[0]+Z[1]:zt&&(!(Z=zt.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=zt.match(/Chrome\/(\d+)/))&&(tt=Z[1]);var Wt=tt&&+tt,Kt=Lt("species"),Qt=function(t){return Wt>=51||!i((function(){var n=[];return(n.constructor={})[Kt]=function(){return{foo:1}},1!==n[t](Boolean).foo}))},Yt=Lt("isConcatSpreadable"),Jt=9007199254740991,Ut="Maximum allowed index exceeded",Xt=Wt>=51||!i((function(){var t=[];return t[Yt]=!1,t.concat()[0]!==t})),Zt=Qt("concat"),tn=function(t){if(!b(t))return!1;var n=t[Yt];return void 0!==n?!!n:At(t)};_t({target:"Array",proto:!0,forced:!Xt||!Zt},{concat:function(t){var n,e,r,o,i,u=Mt(this),a=$t(u,0),c=0;for(n=-1,r=arguments.length;n<r;n++)if(tn(i=-1===n?u:arguments[n])){if(c+(o=st(i.length))>Jt)throw TypeError(Ut);for(e=0;e<o;e++,c++)e in i&&kt(a,c,i[e])}else{if(c>=Jt)throw TypeError(Ut);kt(a,c++,i)}return a.length=c,a}});var nn,en,rn=ht.indexOf,on=[].indexOf,un=!!on&&1/[1].indexOf(1,-0)<0,an=!(en=[]["indexOf"])||!i((function(){en.call(null,nn||function(){throw 1},1)}));_t({target:"Array",proto:!0,forced:un||an},{indexOf:function(t){return un?on.apply(this,arguments)||0:rn(this,t,arguments.length>1?arguments[1]:void 0)}});var cn=Math.max,fn=Math.min,sn=9007199254740991,ln="Maximum allowed length exceeded";function pn(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function dn(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yn(t){return(yn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function hn(t,n){return(hn=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function gn(t,n){return!n||"object"!=typeof n&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):n}function bn(t,n,e){return(bn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,n,e){var r=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=yn(t)););return t}(t,n);if(r){var o=Object.getOwnPropertyDescriptor(r,n);return o.get?o.get.call(e):o.value}})(t,n,e||t)}_t({target:"Array",proto:!0,forced:!Qt("splice")},{splice:function(t,n){var e,r,o,i,u,a,c=Mt(this),f=st(c.length),s=dt(t,f),l=arguments.length;if(0===l?e=r=0:1===l?(e=0,r=f-s):(e=l-2,r=fn(cn(ct(n),0),f-s)),f+e-r>sn)throw TypeError(ln);for(o=$t(c,r),i=0;i<r;i++)(u=s+i)in c&&kt(o,i,c[u]);if(o.length=r,e<r){for(i=s;i<f-r;i++)a=i+e,(u=i+r)in c?c[a]=c[u]:delete c[a];for(i=f;i>f-r+e;i--)delete c[i-1]}else if(e>r)for(i=f-r;i>s;i--)a=i+e-1,(u=i+r-1)in c?c[a]=c[u]:delete c[a];for(i=0;i<e;i++)c[i+s]=arguments[i+2];return c.length=f-r+e,o}});var vn=function(t,n){return{id:"customId_".concat(n)}};t.extend(t.fn.bootstrapTable.defaults,{reorderableRows:!1,onDragStyle:null,onDropStyle:null,onDragClass:"reorder_rows_onDragClass",dragHandle:">tbody>tr>td",useRowAttrFunc:!1,onReorderRowsDrag:function(t){return!1},onReorderRowsDrop:function(t){return!1},onReorderRow:function(t){return!1}}),t.extend(t.fn.bootstrapTable.Constructor.EVENTS,{"reorder-row.bs.table":"onReorderRow"}),t.BootstrapTable=function(n){function e(){return pn(this,e),gn(this,yn(e).apply(this,arguments))}var r,o,i;return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&hn(t,n)}(e,n),r=e,(o=[{key:"init",value:function(){for(var t,n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(this.options.reorderableRows){this.options.useRowAttrFunc&&(this.options.rowAttributes=vn);var u=this.options.onPostBody;this.options.onPostBody=function(){setTimeout((function(){n.makeRowsReorderable(),u.call(n.options,n.options.data)}),1)},(t=bn(yn(e.prototype),"init",this)).call.apply(t,[this].concat(o))}else{var a;(a=bn(yn(e.prototype),"init",this)).call.apply(a,[this].concat(o))}}},{key:"makeRowsReorderable",value:function(){var t=this;this.$el.tableDnD({onDragStyle:this.options.onDragStyle,onDropStyle:this.options.onDropStyle,onDragClass:this.options.onDragClass,onDragStart:function(n,e){return t.onDropStart(n,e)},onDrop:function(n,e){return t.onDrop(n,e)},dragHandle:this.options.dragHandle})}},{key:"onDropStart",value:function(n,e){this.$draggingTd=t(e).css("cursor","move"),this.draggingIndex=t(this.$draggingTd.parent()).data("index"),this.options.onReorderRowsDrag(this.data[this.draggingIndex])}},{key:"onDrop",value:function(n){this.$draggingTd.css("cursor","");for(var e=[],r=0;r<n.tBodies[0].rows.length;r++){var o=t(n.tBodies[0].rows[r]);e.push(this.data[o.data("index")]),o.data("index",r)}var i=this.data[this.draggingIndex],u=e.indexOf(this.data[this.draggingIndex]),a=this.data[u],c=this.options.data.indexOf(this.data[u]);this.options.data.splice(this.options.data.indexOf(i),1),this.options.data.splice(c,0,i),this.options.onReorderRowsDrop(a),this.trigger("reorder-row",e,i,a)}}])&&dn(r.prototype,o),i&&dn(r,i),e}(t.BootstrapTable)}));