UNPKG

13.2 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.16.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,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&&t.hasOwnProperty("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}},c=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),u={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,a={f:f&&!u.call({1:2},1)?function(t){var n=f(this,t);return!!n&&n.enumerable}:u},l=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},s={}.toString,p=function(t){return s.call(t).slice(8,-1)},y="".split,d=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?y.call(t,""):Object(t)}:Object,h=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=function(t){return d(h(t))},v=function(t){return"object"==typeof t?null!==t:"function"==typeof t},g=function(t,n){if(!v(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!v(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!v(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!v(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")},m={}.hasOwnProperty,w=function(t,n){return m.call(t,n)},O=o.document,j=v(O)&&v(O.createElement),S=function(t){return j?O.createElement(t):{}},T=!c&&!i((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,x={f:c?P:function(t,n){if(t=b(t),n=g(n,!0),T)try{return P(t,n)}catch(t){}if(w(t,n))return l(!a.f.call(t,n),t[n])}},E=function(t){if(!v(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,_={f:c?C:function(t,n,e){if(E(t),n=g(n,!0),E(e),T)try{return C(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}},A=c?function(t,n,e){return _.f(t,n,l(1,e))}:function(t,n,e){return t[n]=e,t},k=function(t,n){try{A(o,t,n)}catch(e){o[t]=n}return n},M=o["__core-js_shared__"]||k("__core-js_shared__",{}),B=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return B.call(t)});var F,I,R,N=M.inspectSource,W=o.WeakMap,D="function"==typeof W&&/native code/.test(N(W)),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)"})})),$=0,q=Math.random(),z=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+q).toString(36)},H=L("keys"),G=function(t){return H[t]||(H[t]=z(t))},V={},K=o.WeakMap;if(D){var Q=new K,X=Q.get,Y=Q.has,J=Q.set;F=function(t,n){return J.call(Q,t,n),n},I=function(t){return X.call(Q,t)||{}},R=function(t){return Y.call(Q,t)}}else{var U=G("state");V[U]=!0,F=function(t,n){return A(t,U,n),n},I=function(t){return w(t,U)?t[U]:{}},R=function(t){return w(t,U)}}var Z,tt,nt={set:F,get:I,has:R,enforce:function(t){return R(t)?I(t):F(t,{})},getterFor:function(t){return function(n){var e;if(!v(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,c){var u=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,a=!!c&&!!c.noTargetGet;"function"==typeof i&&("string"!=typeof n||w(i,"name")||A(i,"name",n),e(i).source=r.join("string"==typeof n?n:"")),t!==o?(u?!a&&t[n]&&(f=!0):delete t[n],f?t[n]=i:A(t,n,i)):f?t[n]=i:k(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]},ct=Math.ceil,ut=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?ut:ct)(t)},at=Math.min,lt=function(t){return t>0?at(ft(t),9007199254740991):0},st=Math.max,pt=Math.min,yt=function(t){return function(n,e,r){var o,i=b(n),c=lt(i.length),u=function(t,n){var e=ft(t);return e<0?st(e+n,0):pt(e,n)}(r,c);if(t&&e!=e){for(;c>u;)if((o=i[u++])!=o)return!0}else for(;c>u;u++)if((t||u in i)&&i[u]===e)return t||u||0;return!t&&-1}},dt={includes:yt(!0),indexOf:yt(!1)}.indexOf,ht=function(t,n){var e,r=b(t),o=0,i=[];for(e in r)!w(V,e)&&w(r,e)&&i.push(e);for(;n.length>o;)w(r,e=n[o++])&&(~dt(i,e)||i.push(e));return i},bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vt=bt.concat("length","prototype"),gt={f:Object.getOwnPropertyNames||function(t){return ht(t,vt)}},mt={f:Object.getOwnPropertySymbols},wt=it("Reflect","ownKeys")||function(t){var n=gt.f(E(t)),e=mt.f;return e?n.concat(e(t)):n},Ot=function(t,n){for(var e=wt(n),r=_.f,o=x.f,i=0;i<e.length;i++){var c=e[i];w(t,c)||r(t,c,o(n,c))}},jt=/#|\.prototype\./,St=function(t,n){var e=Pt[Tt(t)];return e==Et||e!=xt&&("function"==typeof n?i(n):!!n)},Tt=St.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Pt=St.data={},xt=St.NATIVE="N",Et=St.POLYFILL="P",Ct=St,_t=x.f,At=function(t,n){var e,r,i,c,u,f=t.target,a=t.global,l=t.stat;if(e=a?o:l?o[f]||k(f,{}):(o[f]||{}).prototype)for(r in n){if(c=n[r],i=t.noTargetGet?(u=_t(e,r))&&u.value:e[r],!Ct(a?r:f+(l?".":"#")+r,t.forced)&&void 0!==i){if(typeof c==typeof i)continue;Ot(c,i)}(t.sham||i&&i.sham)&&A(c,"sham",!0),et(e,r,c,t)}},kt=Array.isArray||function(t){return"Array"==p(t)},Mt=function(t){return Object(h(t))},Bt=function(t,n,e){var r=g(n);r in t?_.f(t,r,l(0,e)):t[r]=e},Ft=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),It=Ft&&!Symbol.sham&&"symbol"==typeof Symbol(),Rt=L("wks"),Nt=o.Symbol,Wt=It?Nt:z,Dt=function(t){return w(Rt,t)||(Ft&&w(Nt,t)?Rt[t]=Nt[t]:Rt[t]=Wt("Symbol."+t)),Rt[t]},Lt=Dt("species"),$t=function(t,n){var e;return kt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!kt(e.prototype)?v(e)&&null===(e=e[Lt])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)},qt=it("navigator","userAgent")||"",zt=o.process,Ht=zt&&zt.versions,Gt=Ht&&Ht.v8;Gt?tt=(Z=Gt.split("."))[0]+Z[1]:qt&&(!(Z=qt.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=qt.match(/Chrome\/(\d+)/))&&(tt=Z[1]);var Vt,Kt=tt&&+tt,Qt=Dt("species"),Xt=Dt("isConcatSpreadable"),Yt=Kt>=51||!i((function(){var t=[];return t[Xt]=!1,t.concat()[0]!==t})),Jt=(Vt="concat",Kt>=51||!i((function(){var t=[];return(t.constructor={})[Qt]=function(){return{foo:1}},1!==t[Vt](Boolean).foo}))),Ut=function(t){if(!v(t))return!1;var n=t[Xt];return void 0!==n?!!n:kt(t)};At({target:"Array",proto:!0,forced:!Yt||!Jt},{concat:function(t){var n,e,r,o,i,c=Mt(this),u=$t(c,0),f=0;for(n=-1,r=arguments.length;n<r;n++)if(i=-1===n?c:arguments[n],Ut(i)){if(f+(o=lt(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(e=0;e<o;e++,f++)e in i&&Bt(u,f,i[e])}else{if(f>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Bt(u,f++,i)}return u.length=f,u}});var Zt,tn=function(t,n,e){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===n)return t;switch(e){case 0:return function(){return t.call(n)};case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}},nn=[].push,en=function(t){var n=1==t,e=2==t,r=3==t,o=4==t,i=6==t,c=5==t||i;return function(u,f,a,l){for(var s,p,y=Mt(u),h=d(y),b=tn(f,a,3),v=lt(h.length),g=0,m=l||$t,w=n?m(u,v):e?m(u,0):void 0;v>g;g++)if((c||g in h)&&(p=b(s=h[g],g,y),t))if(n)w[g]=p;else if(p)switch(t){case 3:return!0;case 5:return s;case 6:return g;case 2:nn.call(w,s)}else if(o)return!1;return i?-1:r||o?o:w}},rn={forEach:en(0),map:en(1),filter:en(2),some:en(3),every:en(4),find:en(5),findIndex:en(6)},on=Object.keys||function(t){return ht(t,bt)},cn=c?Object.defineProperties:function(t,n){E(t);for(var e,r=on(n),o=r.length,i=0;o>i;)_.f(t,e=r[i++],n[e]);return t},un=it("document","documentElement"),fn=G("IE_PROTO"),an=function(){},ln=function(t){return"<script>"+t+"<\/script>"},sn=function(){try{Zt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,n;sn=Zt?function(t){t.write(ln("")),t.close();var n=t.parentWindow.Object;return t=null,n}(Zt):((n=S("iframe")).style.display="none",un.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write(ln("document.F=Object")),t.close(),t.F);for(var e=bt.length;e--;)delete sn.prototype[bt[e]];return sn()};V[fn]=!0;var pn=Object.create||function(t,n){var e;return null!==t?(an.prototype=E(t),e=new an,an.prototype=null,e[fn]=t):e=sn(),void 0===n?e:cn(e,n)},yn=Dt("unscopables"),dn=Array.prototype;null==dn[yn]&&_.f(dn,yn,{configurable:!0,value:pn(null)});var hn,bn=rn.find,vn=!0;"find"in[]&&Array(1).find((function(){vn=!1})),At({target:"Array",proto:!0,forced:vn},{find:function(t){return bn(this,t,arguments.length>1?arguments[1]:void 0)}}),hn="find",dn[yn][hn]=!0;var gn=[].join,mn=d!=Object,wn=function(t,n){var e=[][t];return!e||!i((function(){e.call(null,n||function(){throw 1},1)}))}("join",",");function On(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 jn(t){return(jn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Sn(t,n){return(Sn=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function Tn(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 Pn(t,n,e){return(Pn="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=jn(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)}At({target:"Array",proto:!0,forced:mn||wn},{join:function(t){return gn.call(b(this),void 0===t?",":t)}});var xn=t.fn.bootstrapTable.utils;t.extend(t.fn.bootstrapTable.defaults.icons,{copy:{bootstrap3:"glyphicon-copy icon-pencil",materialize:"content_copy"}[t.fn.bootstrapTable.theme]||"fa-copy"});t.extend(t.fn.bootstrapTable.defaults,{showCopyRows:!1,copyWithHidden:!1,copyDelimiter:", ",copyNewline:"\n"}),t.fn.bootstrapTable.methods.push("copyColumnsToClipboard"),t.BootstrapTable=function(n){function e(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),Tn(this,jn(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&&Sn(t,n)}(e,n),r=e,(o=[{key:"initToolbar",value:function(){for(var n,r=this,o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];(n=Pn(jn(e.prototype),"initToolbar",this)).call.apply(n,[this].concat(i));var u=this.$toolbar.find(">.columns");this.options.showCopyRows&&this.header.stateField&&(this.$copyButton=t('\n <button class="'.concat(this.constants.buttonsClass,'">\n ').concat(xn.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.copy),"\n </button>\n ")),u.append(this.$copyButton),this.$copyButton.click((function(){r.copyColumnsToClipboard()})),this.updateCopyButton())}},{key:"copyColumnsToClipboard",value:function(){var n=this,e=[];t.each(this.getSelections(),(function(r,o){var i=[];t.each(n.options.columns[0],(function(t,e){e.field!==n.header.stateField&&(!n.options.copyWithHidden||n.options.copyWithHidden&&e.visible)&&null!==o[e.field]&&i.push(xn.calculateObjectValue(e,n.header.formatters[t],[o[e.field],o,r],o[e.field]))})),e.push(i.join(n.options.copyDelimiter))})),function(n){var e=document.createElement("textarea");t(e).html(n),document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(t){console.log("Oops, unable to copy")}t(e).remove()}(e.join(this.options.copyNewline))}},{key:"updateSelected",value:function(){Pn(jn(e.prototype),"updateSelected",this).call(this),this.updateCopyButton()}},{key:"updateCopyButton",value:function(){this.$copyButton.prop("disabled",!this.getSelections().length)}}])&&On(r.prototype,o),i&&On(r,i),e}(t.BootstrapTable)}));