UNPKG

13.5 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.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&&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}},a=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),u={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,s={f:c&&!u.call({1:2},1)?function(t){var n=c(this,t);return!!n&&n.enumerable}:u},f=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,h=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?d.call(t,""):Object(t)}:Object,y=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return h(y(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,j=b(O)&&b(O.createElement),S=function(t){return j?O.createElement(t):{}},P=!a&&!i((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),T=Object.getOwnPropertyDescriptor,x={f:a?T:function(t,n){if(t=g(t),n=v(n,!0),P)try{return T(t,n)}catch(t){}if(m(t,n))return f(!s.f.call(t,n),t[n])}},E=function(t){if(!b(t))throw TypeError(String(t)+" is not an object");return t},k=Object.defineProperty,_={f:a?k:function(t,n,e){if(E(t),n=v(n,!0),E(e),P)try{return k(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}},D=a?function(t,n,e){return _.f(t,n,f(1,e))}:function(t,n,e){return t[n]=e,t},A=function(t,n){try{D(o,t,n)}catch(e){o[t]=n}return n},I="__core-js_shared__",M=o[I]||A(I,{}),C=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return C.call(t)});var F,R,L,N=M.inspectSource,$=o.WeakMap,q="function"==typeof $&&/native code/.test(N($)),z=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)"})})),G=0,W=Math.random(),B=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+W).toString(36)},K=z("keys"),Q=function(t){return K[t]||(K[t]=B(t))},V={},X=o.WeakMap;if(q){var Y=new X,H=Y.get,J=Y.has,U=Y.set;F=function(t,n){return U.call(Y,t,n),n},R=function(t){return H.call(Y,t)||{}},L=function(t){return J.call(Y,t)}}else{var Z=Q("state");V[Z]=!0,F=function(t,n){return D(t,Z,n),n},R=function(t){return m(t,Z)?t[Z]:{}},L=function(t){return m(t,Z)}}var tt,nt={set:F,get:R,has:L,enforce:function(t){return L(t)?R(t):F(t,{})},getterFor:function(t){return function(n){var e;if(!b(n)||(e=R(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,a){var u=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,s=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof n||m(i,"name")||D(i,"name",n),e(i).source=r.join("string"==typeof n?n:"")),t!==o?(u?!s&&t[n]&&(c=!0):delete t[n],c?t[n]=i:D(t,n,i)):c?t[n]=i:A(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]},at=Math.ceil,ut=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?ut:at)(t)},st=Math.min,ft=function(t){return t>0?st(ct(t),9007199254740991):0},lt=Math.max,pt=Math.min,dt=function(t){return function(n,e,r){var o,i=g(n),a=ft(i.length),u=function(t,n){var e=ct(t);return e<0?lt(e+n,0):pt(e,n)}(r,a);if(t&&e!=e){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===e)return t||u||0;return!t&&-1}},ht={includes:dt(!0),indexOf:dt(!1)},yt=ht.indexOf,gt=function(t,n){var e,r=g(t),o=0,i=[];for(e in r)!m(V,e)&&m(r,e)&&i.push(e);for(;n.length>o;)m(r,e=n[o++])&&(~yt(i,e)||i.push(e));return i},bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],vt=bt.concat("length","prototype"),wt={f:Object.getOwnPropertyNames||function(t){return gt(t,vt)}},mt={f:Object.getOwnPropertySymbols},Ot=it("Reflect","ownKeys")||function(t){var n=wt.f(E(t)),e=mt.f;return e?n.concat(e(t)):n},jt=function(t,n){for(var e=Ot(n),r=_.f,o=x.f,i=0;i<e.length;i++){var a=e[i];m(t,a)||r(t,a,o(n,a))}},St=/#|\.prototype\./,Pt=function(t,n){var e=xt[Tt(t)];return e==kt||e!=Et&&("function"==typeof n?i(n):!!n)},Tt=Pt.normalize=function(t){return String(t).replace(St,".").toLowerCase()},xt=Pt.data={},Et=Pt.NATIVE="N",kt=Pt.POLYFILL="P",_t=Pt,Dt=x.f,At=function(t,n){var e,r,i,a,u,c=t.target,s=t.global,f=t.stat;if(e=s?o:f?o[c]||A(c,{}):(o[c]||{}).prototype)for(r in n){if(a=n[r],i=t.noTargetGet?(u=Dt(e,r))&&u.value:e[r],!_t(s?r:c+(f?".":"#")+r,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;jt(a,i)}(t.sham||i&&i.sham)&&D(a,"sham",!0),et(e,r,a,t)}},It=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)}},Mt=Array.isArray||function(t){return"Array"==p(t)},Ct=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Ft=Ct&&!Symbol.sham&&"symbol"==typeof Symbol(),Rt=z("wks"),Lt=o.Symbol,Nt=Ft?Lt:B,$t=function(t){return m(Rt,t)||(Ct&&m(Lt,t)?Rt[t]=Lt[t]:Rt[t]=Nt("Symbol."+t)),Rt[t]},qt=$t("species"),zt=function(t,n){var e;return Mt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Mt(e.prototype)?b(e)&&null===(e=e[qt])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)},Gt=[].push,Wt=function(t){var n=1==t,e=2==t,r=3==t,o=4==t,i=6==t,a=5==t||i;return function(u,c,s,f){for(var l,p,d=Object(y(u)),g=h(d),b=It(c,s,3),v=ft(g.length),w=0,m=f||zt,O=n?m(u,v):e?m(u,0):void 0;v>w;w++)if((a||w in g)&&(p=b(l=g[w],w,d),t))if(n)O[w]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return w;case 2:Gt.call(O,l)}else if(o)return!1;return i?-1:r||o?o:O}},Bt={forEach:Wt(0),map:Wt(1),filter:Wt(2),some:Wt(3),every:Wt(4),find:Wt(5),findIndex:Wt(6)},Kt=Object.keys||function(t){return gt(t,bt)},Qt=a?Object.defineProperties:function(t,n){E(t);for(var e,r=Kt(n),o=r.length,i=0;o>i;)_.f(t,e=r[i++],n[e]);return t},Vt=it("document","documentElement"),Xt=Q("IE_PROTO"),Yt=function(){},Ht=function(t){return"<script>"+t+"</"+"script>"},Jt=function(){try{tt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,n;Jt=tt?function(t){t.write(Ht("")),t.close();var n=t.parentWindow.Object;return t=null,n}(tt):((n=S("iframe")).style.display="none",Vt.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write(Ht("document.F=Object")),t.close(),t.F);for(var e=bt.length;e--;)delete Jt.prototype[bt[e]];return Jt()};V[Xt]=!0;var Ut=Object.create||function(t,n){var e;return null!==t?(Yt.prototype=E(t),e=new Yt,Yt.prototype=null,e[Xt]=t):e=Jt(),void 0===n?e:Qt(e,n)},Zt=$t("unscopables"),tn=Array.prototype;null==tn[Zt]&&_.f(tn,Zt,{configurable:!0,value:Ut(null)});var nn=function(t){tn[Zt][t]=!0},en=Bt.find,rn="find",on=!0;rn in[]&&Array(1).find((function(){on=!1})),At({target:"Array",proto:!0,forced:on},{find:function(t){return en(this,t,arguments.length>1?arguments[1]:void 0)}}),nn(rn);var an=ht.includes;At({target:"Array",proto:!0},{includes:function(t){return an(this,t,arguments.length>1?arguments[1]:void 0)}}),nn("includes");var un=$t("match"),cn=function(t){if(function(t){var n;return b(t)&&(void 0!==(n=t[un])?!!n:"RegExp"==p(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},sn=$t("match");function fn(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function ln(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 pn(t){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function dn(t,n){return(dn=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function hn(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 yn(t,n,e){return(yn="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=pn(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:"String",proto:!0,forced:!function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[sn]=!1,"/./"[t](n)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(y(this)).indexOf(cn(t),arguments.length>1?arguments[1]:void 0)}}),t.extend(t.fn.bootstrapTable.defaults,{classes:"table hover",buttonsPrefix:"",buttonsClass:"button"}),t.fn.bootstrapTable.theme="foundation",t.BootstrapTable=function(n){function e(){return fn(this,e),hn(this,pn(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&&dn(t,n)}(e,n),r=e,(o=[{key:"initConstants",value:function(){yn(pn(e.prototype),"initConstants",this).call(this),this.constants.classes.buttonsGroup="button-group",this.constants.classes.buttonsDropdown="dropdown-container",this.constants.classes.paginationDropdown="",this.constants.classes.dropdownActive="is-active",this.constants.classes.paginationActive="current",this.constants.classes.buttonActive="success",this.constants.html.toolbarDropdown=['<div class="dropdown-pane" id="toolbar-columns-id" data-dropdown><ul class="vertical menu">',"</ul></div>"],this.constants.html.toolbarDropdownItem='<li class="dropdown-item-marker"><label class="dropdown-item">%s</label></li>',this.constants.html.toolbarDropdownSeparator="<li><hr></li>",this.constants.html.pageDropdown=['<div class="dropdown-pane" id="pagination-list-id" data-dropdown><ul class="vertical menu">',"</ul></div>"],this.constants.html.pageDropdownItem='<li class="dropdown-item %s"><a href="#">%s</a></li>',this.constants.html.dropdownCaret='<i class="fa fa-angle-down"></i>',this.constants.html.pagination=['<ul class="pagination%s">',"</ul>"],this.constants.html.paginationItem='<li><a class="page-item%s" aria-label="%s" href="#">%s</a></li>',this.constants.html.inputGroup='<div class="input-group">%s <div class="input-group-button">%s</div></div>',this.constants.html.searchInput='<input class="%s input-%s input-group-field" type="search" placeholder="%s">'}},{key:"initToolbar",value:function(){yn(pn(e.prototype),"initToolbar",this).call(this),this.handleToolbar()}},{key:"handleToolbar",value:function(){this.$toolbar.find(".dropdown-toggle").length&&(this.$toolbar.find(".dropdown-toggle").each((function(n,e){t(e).attr("data-toggle",t(e).next().attr("id"));var r=t(e).next().attr("data-position","bottom").attr("data-alignment","right");new window.Foundation.Dropdown(r)})),this._initDropdown())}},{key:"initPagination",value:function(){if(yn(pn(e.prototype),"initPagination",this).call(this),this.options.pagination&&this.paginationParts.includes("pageSize")){var t=this.$pagination.find(".dropdown-toggle");t.attr("data-toggle",t.next().attr("id"));var n=this.$pagination.find(".dropdown-pane").attr("data-position","top").attr("data-alignment","left");new window.Foundation.Dropdown(n),this._initDropdown()}}},{key:"_initDropdown",value:function(){var n=this.$container.find(".dropdown-toggle");n.off("click").on("click",(function(e){var r=t(e.currentTarget);e.stopPropagation(),r.next().foundation("toggle"),n.not(r).length&&n.not(r).next().foundation("close")})),t(document).off("click.bs.dropdown.foundation").on("click.bs.dropdown.foundation",(function(){n.next().foundation("close")}))}}])&&ln(r.prototype,o),i&&ln(r,i),e}(t.BootstrapTable)}));