bootstrap-table
Version:
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
11 lines (9 loc) • 13 kB
JavaScript
/**
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
*
* @version v1.17.1
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
!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}},c=!i((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),a={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,s={f:u&&!a.call({1:2},1)?function(t){var n=u(this,t);return!!n&&n.enumerable}:a},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")},m={}.hasOwnProperty,w=function(t,n){return m.call(t,n)},O=o.document,j=b(O)&&b(O.createElement),S=function(t){return j?O.createElement(t):{}},P=!c&&!i((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),T=Object.getOwnPropertyDescriptor,_={f:c?T:function(t,n){if(t=g(t),n=v(n,!0),P)try{return T(t,n)}catch(t){}if(w(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},x=Object.defineProperty,k={f:c?x:function(t,n,e){if(E(t),n=v(n,!0),E(e),P)try{return x(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 k.f(t,n,f(1,e))}:function(t,n,e){return t[n]=e,t},D=function(t,n){try{A(o,t,n)}catch(e){o[t]=n}return n},C=o["__core-js_shared__"]||D("__core-js_shared__",{}),I=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(t){return I.call(t)});var M,F,R,z=C.inspectSource,L=o.WeakMap,N="function"==typeof L&&/native code/.test(z(L)),W=e((function(t){(t.exports=function(t,n){return C[t]||(C[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.6.0",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})})),q=0,G=Math.random(),$=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++q+G).toString(36)},B=W("keys"),K=function(t){return B[t]||(B[t]=$(t))},Q={},U=o.WeakMap;if(N){var V=new U,X=V.get,Y=V.has,H=V.set;M=function(t,n){return H.call(V,t,n),n},F=function(t){return X.call(V,t)||{}},R=function(t){return Y.call(V,t)}}else{var J=K("state");Q[J]=!0,M=function(t,n){return A(t,J,n),n},F=function(t){return w(t,J)?t[J]:{}},R=function(t){return w(t,J)}}var Z,tt={set:M,get:F,has:R,enforce:function(t){return R(t)?F(t):M(t,{})},getterFor:function(t){return function(n){var e;if(!b(n)||(e=F(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}},nt=e((function(t){var n=tt.get,e=tt.enforce,r=String(String).split("String");(t.exports=function(t,n,i,c){var a=!!c&&!!c.unsafe,u=!!c&&!!c.enumerable,s=!!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?(a?!s&&t[n]&&(u=!0):delete t[n],u?t[n]=i:A(t,n,i)):u?t[n]=i:D(n,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&n(this).source||z(this)}))})),et=o,rt=function(t){return"function"==typeof t?t:void 0},ot=function(t,n){return arguments.length<2?rt(et[t])||rt(o[t]):et[t]&&et[t][n]||o[t]&&o[t][n]},it=Math.ceil,ct=Math.floor,at=function(t){return isNaN(t=+t)?0:(t>0?ct:it)(t)},ut=Math.min,st=function(t){return t>0?ut(at(t),9007199254740991):0},ft=Math.max,lt=Math.min,pt=function(t){return function(n,e,r){var o,i=g(n),c=st(i.length),a=function(t,n){var e=at(t);return e<0?ft(e+n,0):lt(e,n)}(r,c);if(t&&e!=e){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===e)return t||a||0;return!t&&-1}},dt={includes:pt(!0),indexOf:pt(!1)},ht=dt.indexOf,yt=function(t,n){var e,r=g(t),o=0,i=[];for(e in r)!w(Q,e)&&w(r,e)&&i.push(e);for(;n.length>o;)w(r,e=n[o++])&&(~ht(i,e)||i.push(e));return i},gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bt=gt.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return yt(t,bt)}},mt={f:Object.getOwnPropertySymbols},wt=ot("Reflect","ownKeys")||function(t){var n=vt.f(E(t)),e=mt.f;return e?n.concat(e(t)):n},Ot=function(t,n){for(var e=wt(n),r=k.f,o=_.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=Tt[Pt(t)];return e==Et||e!=_t&&("function"==typeof n?i(n):!!n)},Pt=St.normalize=function(t){return String(t).replace(jt,".").toLowerCase()},Tt=St.data={},_t=St.NATIVE="N",Et=St.POLYFILL="P",xt=St,kt=_.f,At=function(t,n){var e,r,i,c,a,u=t.target,s=t.global,f=t.stat;if(e=s?o:f?o[u]||D(u,{}):(o[u]||{}).prototype)for(r in n){if(c=n[r],i=t.noTargetGet?(a=kt(e,r))&&a.value:e[r],!xt(s?r:u+(f?".":"#")+r,t.forced)&&void 0!==i){if(typeof c==typeof i)continue;Ot(c,i)}(t.sham||i&&i.sham)&&A(c,"sham",!0),nt(e,r,c,t)}},Dt=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)}},Ct=Array.isArray||function(t){return"Array"==p(t)},It=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Mt=It&&!Symbol.sham&&"symbol"==typeof Symbol(),Ft=W("wks"),Rt=o.Symbol,zt=Mt?Rt:$,Lt=function(t){return w(Ft,t)||(It&&w(Rt,t)?Ft[t]=Rt[t]:Ft[t]=zt("Symbol."+t)),Ft[t]},Nt=Lt("species"),Wt=function(t,n){var e;return Ct(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Ct(e.prototype)?b(e)&&null===(e=e[Nt])&&(e=void 0):e=void 0),new(void 0===e?Array:e)(0===n?0:n)},qt=[].push,Gt=function(t){var n=1==t,e=2==t,r=3==t,o=4==t,i=6==t,c=5==t||i;return function(a,u,s,f){for(var l,p,d=Object(y(a)),g=h(d),b=Dt(u,s,3),v=st(g.length),m=0,w=f||Wt,O=n?w(a,v):e?w(a,0):void 0;v>m;m++)if((c||m in g)&&(p=b(l=g[m],m,d),t))if(n)O[m]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return m;case 2:qt.call(O,l)}else if(o)return!1;return i?-1:r||o?o:O}},$t={forEach:Gt(0),map:Gt(1),filter:Gt(2),some:Gt(3),every:Gt(4),find:Gt(5),findIndex:Gt(6)},Bt=Object.keys||function(t){return yt(t,gt)},Kt=c?Object.defineProperties:function(t,n){E(t);for(var e,r=Bt(n),o=r.length,i=0;o>i;)k.f(t,e=r[i++],n[e]);return t},Qt=ot("document","documentElement"),Ut=K("IE_PROTO"),Vt=function(){},Xt=function(t){return"<script>"+t+"<\/script>"},Yt=function(){try{Z=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,n;Yt=Z?function(t){t.write(Xt("")),t.close();var n=t.parentWindow.Object;return t=null,n}(Z):((n=S("iframe")).style.display="none",Qt.appendChild(n),n.src=String("javascript:"),(t=n.contentWindow.document).open(),t.write(Xt("document.F=Object")),t.close(),t.F);for(var e=gt.length;e--;)delete Yt.prototype[gt[e]];return Yt()};Q[Ut]=!0;var Ht=Object.create||function(t,n){var e;return null!==t?(Vt.prototype=E(t),e=new Vt,Vt.prototype=null,e[Ut]=t):e=Yt(),void 0===n?e:Kt(e,n)},Jt=Lt("unscopables"),Zt=Array.prototype;null==Zt[Jt]&&k.f(Zt,Jt,{configurable:!0,value:Ht(null)});var tn=function(t){Zt[Jt][t]=!0},nn=$t.find,en=!0;"find"in[]&&Array(1).find((function(){en=!1})),At({target:"Array",proto:!0,forced:en},{find:function(t){return nn(this,t,arguments.length>1?arguments[1]:void 0)}}),tn("find");var rn=dt.includes;At({target:"Array",proto:!0},{includes:function(t){return rn(this,t,arguments.length>1?arguments[1]:void 0)}}),tn("includes");var on=Lt("match"),cn=function(t){if(function(t){var n;return b(t)&&(void 0!==(n=t[on])?!!n:"RegExp"==p(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},an=Lt("match");function un(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function sn(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 fn(t){return(fn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ln(t,n){return(ln=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function pn(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 dn(t,n,e){return(dn="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=fn(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[an]=!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 highlight",buttonsPrefix:"",buttonsClass:"waves-effect waves-light btn",iconsPrefix:"material-icons",icons:{paginationSwitchDown:"grid_on",paginationSwitchUp:"grid_off",refresh:"refresh",toggleOff:"tablet",toggleOn:"tablet_android",columns:"view_list",detailOpen:"add",detailClose:"remove",fullscreen:"fullscreen",sort:"sort",search:"search",clearSearch:"delete"}}),t.fn.bootstrapTable.theme="materialize",t.BootstrapTable=function(n){function e(){return un(this,e),pn(this,fn(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&&ln(t,n)}(e,n),r=e,(o=[{key:"initConstants",value:function(){dn(fn(e.prototype),"initConstants",this).call(this),this.constants.classes.buttonsGroup="button-group",this.constants.classes.buttonsDropdown="",this.constants.classes.input="input-field",this.constants.classes.input="",this.constants.classes.paginationDropdown="",this.constants.classes.buttonActive="green",this.constants.html.toolbarDropdown=['<ul id="toolbar-columns-id" class="dropdown-content">',"</ul>"],this.constants.html.toolbarDropdownItem='<li class="dropdown-item-marker"><label>%s</label></li>',this.constants.html.toolbarDropdownSeparator='<li class="divider" tabindex="-1"></li>',this.constants.html.pageDropdown=['<ul id="pagination-list-id" class="dropdown-content">',"</ul>"],this.constants.html.pageDropdownItem='<li><a class="%s" href="#">%s</a></li>',this.constants.html.dropdownCaret='<i class="material-icons">arrow_drop_down</i>',this.constants.html.pagination=['<ul class="pagination%s">',"</ul>"],this.constants.html.paginationItem='<li class="waves-effect page-item%s" aria-label="%s"><a href="#">%s</a></li>',this.constants.html.icon='<i class="%s">%s</i>',this.constants.html.inputGroup="%s%s"}},{key:"initToolbar",value:function(){dn(fn(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-target",t(e).next().attr("id")).dropdown({alignment:"right",constrainWidth:!1,closeOnClick:!1})}))}},{key:"initPagination",value:function(){dn(fn(e.prototype),"initPagination",this).call(this),this.options.pagination&&this.paginationParts.includes("pageSize")&&this.$pagination.find(".dropdown-toggle").attr("data-target",this.$pagination.find(".dropdown-content").attr("id")).dropdown()}}])&&sn(r.prototype,o),i&&sn(r,i),e}(t.BootstrapTable)}));