bootstrap-table-auto-refresh.min.js 15 KB

12345678910
  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.19.1
  5. * @homepage https://bootstrap-table.com
  6. * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
  7. * @license MIT
  8. */
  9. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t,e){return t(e={exports:{}},e.exports),e.exports}var p=function(t){return t&&t.Math==Math&&t},h=p("object"==typeof globalThis&&globalThis)||p("object"==typeof window&&window)||p("object"==typeof self&&self)||p("object"==typeof s&&s)||function(){return this}()||Function("return this")(),y=function(t){try{return!!t()}catch(t){return!0}},b=!y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,g={f:v&&!d.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:d},m=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w={}.toString,O=function(t){return w.call(t).slice(8,-1)},j="".split,R=y((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==O(t)?j.call(t,""):Object(t)}:Object,S=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return R(S(t))},P=function(t){return"object"==typeof t?null!==t:"function"==typeof t},A=function(t,e){if(!P(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!P(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!P(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!P(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},E={}.hasOwnProperty,x=function(t,e){return E.call(t,e)},k=h.document,I=P(k)&&P(k.createElement),_=function(t){return I?k.createElement(t):{}},F=!b&&!y((function(){return 7!=Object.defineProperty(_("div"),"a",{get:function(){return 7}}).a})),M=Object.getOwnPropertyDescriptor,C={f:b?M:function(t,e){if(t=T(t),e=A(e,!0),F)try{return M(t,e)}catch(t){}if(x(t,e))return m(!g.f.call(t,e),t[e])}},B=function(t){if(!P(t))throw TypeError(String(t)+" is not an object");return t},q=Object.defineProperty,L={f:b?q:function(t,e,n){if(B(t),e=A(e,!0),B(n),F)try{return q(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},N=b?function(t,e,n){return L.f(t,e,m(1,n))}:function(t,e,n){return t[e]=n,t},z=function(t,e){try{N(h,t,e)}catch(n){h[t]=e}return e},D="__core-js_shared__",W=h[D]||z(D,{}),G=Function.toString;"function"!=typeof W.inspectSource&&(W.inspectSource=function(t){return G.call(t)});var $,K,Q,V=W.inspectSource,X=h.WeakMap,Y="function"==typeof X&&/native code/.test(V(X)),H=l((function(t){(t.exports=function(t,e){return W[t]||(W[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),J=0,U=Math.random(),Z=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++J+U).toString(36)},tt=H("keys"),et=function(t){return tt[t]||(tt[t]=Z(t))},nt={},rt=h.WeakMap;if(Y){var ot=W.state||(W.state=new rt),it=ot.get,ut=ot.has,ct=ot.set;$=function(t,e){return e.facade=t,ct.call(ot,t,e),e},K=function(t){return it.call(ot,t)||{}},Q=function(t){return ut.call(ot,t)}}else{var at=et("state");nt[at]=!0,$=function(t,e){return e.facade=t,N(t,at,e),e},K=function(t){return x(t,at)?t[at]:{}},Q=function(t){return x(t,at)}}var ft,st,lt={set:$,get:K,has:Q,enforce:function(t){return Q(t)?K(t):$(t,{})},getterFor:function(t){return function(e){var n;if(!P(e)||(n=K(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},pt=l((function(t){var e=lt.get,n=lt.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var u,c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,f=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||x(o,"name")||N(o,"name",e),(u=n(o)).source||(u.source=r.join("string"==typeof e?e:""))),t!==h?(c?!f&&t[e]&&(a=!0):delete t[e],a?t[e]=o:N(t,e,o)):a?t[e]=o:z(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||V(this)}))})),ht=h,yt=function(t){return"function"==typeof t?t:void 0},bt=function(t,e){return arguments.length<2?yt(ht[t])||yt(h[t]):ht[t]&&ht[t][e]||h[t]&&h[t][e]},dt=Math.ceil,vt=Math.floor,gt=function(t){return isNaN(t=+t)?0:(t>0?vt:dt)(t)},mt=Math.min,wt=function(t){return t>0?mt(gt(t),9007199254740991):0},Ot=Math.max,jt=Math.min,Rt=function(t){return function(e,n,r){var o,i=T(e),u=wt(i.length),c=function(t,e){var n=gt(t);return n<0?Ot(n+e,0):jt(n,e)}(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},St={includes:Rt(!0),indexOf:Rt(!1)}.indexOf,Tt=function(t,e){var n,r=T(t),o=0,i=[];for(n in r)!x(nt,n)&&x(r,n)&&i.push(n);for(;e.length>o;)x(r,n=e[o++])&&(~St(i,n)||i.push(n));return i},Pt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],At=Pt.concat("length","prototype"),Et={f:Object.getOwnPropertyNames||function(t){return Tt(t,At)}},xt={f:Object.getOwnPropertySymbols},kt=bt("Reflect","ownKeys")||function(t){var e=Et.f(B(t)),n=xt.f;return n?e.concat(n(t)):e},It=function(t,e){for(var n=kt(e),r=L.f,o=C.f,i=0;i<n.length;i++){var u=n[i];x(t,u)||r(t,u,o(e,u))}},_t=/#|\.prototype\./,Ft=function(t,e){var n=Ct[Mt(t)];return n==qt||n!=Bt&&("function"==typeof e?y(e):!!e)},Mt=Ft.normalize=function(t){return String(t).replace(_t,".").toLowerCase()},Ct=Ft.data={},Bt=Ft.NATIVE="N",qt=Ft.POLYFILL="P",Lt=Ft,Nt=C.f,zt=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?h:f?h[c]||z(c,{}):(h[c]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(u=Nt(n,r))&&u.value:n[r],!Lt(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;It(i,o)}(t.sham||o&&o.sham)&&N(i,"sham",!0),pt(n,r,i,t)}},Dt=Array.isArray||function(t){return"Array"==O(t)},Wt=function(t){return Object(S(t))},Gt=function(t,e,n){var r=A(e);r in t?L.f(t,r,m(0,n)):t[r]=n},$t="process"==O(h.process),Kt=bt("navigator","userAgent")||"",Qt=h.process,Vt=Qt&&Qt.versions,Xt=Vt&&Vt.v8;Xt?st=(ft=Xt.split("."))[0]+ft[1]:Kt&&(!(ft=Kt.match(/Edge\/(\d+)/))||ft[1]>=74)&&(ft=Kt.match(/Chrome\/(\d+)/))&&(st=ft[1]);var Yt,Ht=st&&+st,Jt=!!Object.getOwnPropertySymbols&&!y((function(){return!Symbol.sham&&($t?38===Ht:Ht>37&&Ht<41)})),Ut=Jt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Zt=H("wks"),te=h.Symbol,ee=Ut?te:te&&te.withoutSetter||Z,ne=function(t){return x(Zt,t)&&(Jt||"string"==typeof Zt[t])||(Jt&&x(te,t)?Zt[t]=te[t]:Zt[t]=ee("Symbol."+t)),Zt[t]},re=ne("species"),oe=function(t,e){var n;return Dt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!Dt(n.prototype)?P(n)&&null===(n=n[re])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},ie=ne("species"),ue=ne("isConcatSpreadable"),ce=9007199254740991,ae="Maximum allowed index exceeded",fe=Ht>=51||!y((function(){var t=[];return t[ue]=!1,t.concat()[0]!==t})),se=(Yt="concat",Ht>=51||!y((function(){var t=[];return(t.constructor={})[ie]=function(){return{foo:1}},1!==t[Yt](Boolean).foo}))),le=function(t){if(!P(t))return!1;var e=t[ue];return void 0!==e?!!e:Dt(t)};zt({target:"Array",proto:!0,forced:!fe||!se},{concat:function(t){var e,n,r,o,i,u=Wt(this),c=oe(u,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(le(i=-1===e?u:arguments[e])){if(a+(o=wt(i.length))>ce)throw TypeError(ae);for(n=0;n<o;n++,a++)n in i&&Gt(c,a,i[n])}else{if(a>=ce)throw TypeError(ae);Gt(c,a++,i)}return c.length=a,c}});var pe=Object.keys||function(t){return Tt(t,Pt)},he=Object.assign,ye=Object.defineProperty,be=!he||y((function(){if(b&&1!==he({b:1},he(ye({},"a",{enumerable:!0,get:function(){ye(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=he({},t)[n]||pe(he({},e)).join("")!=r}))?function(t,e){for(var n=Wt(t),r=arguments.length,o=1,i=xt.f,u=g.f;r>o;)for(var c,a=R(arguments[o++]),f=i?pe(a).concat(i(a)):pe(a),s=f.length,l=0;s>l;)c=f[l++],b&&!u.call(a,c)||(n[c]=a[c]);return n}:he;zt({target:"Object",stat:!0,forced:Object.assign!==be},{assign:be});var de,ve=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ge=[].push,me=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,u=7==t,c=5==t||i;return function(a,f,s,l){for(var p,h,y=Wt(a),b=R(y),d=ve(f,s,3),v=wt(b.length),g=0,m=l||oe,w=e?m(a,v):n||u?m(a,0):void 0;v>g;g++)if((c||g in b)&&(h=d(p=b[g],g,y),t))if(e)w[g]=h;else if(h)switch(t){case 3:return!0;case 5:return p;case 6:return g;case 2:ge.call(w,p)}else switch(t){case 4:return!1;case 7:ge.call(w,p)}return i?-1:r||o?o:w}},we={forEach:me(0),map:me(1),filter:me(2),some:me(3),every:me(4),find:me(5),findIndex:me(6),filterOut:me(7)},Oe=b?Object.defineProperties:function(t,e){B(t);for(var n,r=pe(e),o=r.length,i=0;o>i;)L.f(t,n=r[i++],e[n]);return t},je=bt("document","documentElement"),Re=et("IE_PROTO"),Se=function(){},Te=function(t){return"<script>"+t+"</"+"script>"},Pe=function(){try{de=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;Pe=de?function(t){t.write(Te("")),t.close();var e=t.parentWindow.Object;return t=null,e}(de):((e=_("iframe")).style.display="none",je.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Te("document.F=Object")),t.close(),t.F);for(var n=Pt.length;n--;)delete Pe.prototype[Pt[n]];return Pe()};nt[Re]=!0;var Ae=Object.create||function(t,e){var n;return null!==t?(Se.prototype=B(t),n=new Se,Se.prototype=null,n[Re]=t):n=Pe(),void 0===e?n:Oe(n,e)},Ee=ne("unscopables"),xe=Array.prototype;null==xe[Ee]&&L.f(xe,Ee,{configurable:!0,value:Ae(null)});var ke,Ie=we.find,_e="find",Fe=!0;_e in[]&&Array(1).find((function(){Fe=!1})),zt({target:"Array",proto:!0,forced:Fe},{find:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}}),ke=_e,xe[Ee][ke]=!0;var Me=n.default.fn.bootstrapTable.utils;n.default.extend(n.default.fn.bootstrapTable.defaults,{autoRefresh:!1,showAutoRefresh:!0,autoRefreshInterval:60,autoRefreshSilent:!0,autoRefreshStatus:!0,autoRefreshFunction:null}),n.default.extend(n.default.fn.bootstrapTable.defaults.icons,{autoRefresh:{bootstrap3:"glyphicon-time icon-time",bootstrap5:"bi-clock",materialize:"access_time","bootstrap-table":"icon-clock"}[n.default.fn.bootstrapTable.theme]||"fa-clock"}),n.default.extend(n.default.fn.bootstrapTable.locales,{formatAutoRefresh:function(){return"Auto Refresh"}}),n.default.extend(n.default.fn.bootstrapTable.defaults,n.default.fn.bootstrapTable.locales),n.default.BootstrapTable=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(l,t);var e,n,c,s=a(l);function l(){return r(this,l),s.apply(this,arguments)}return e=l,(n=[{key:"init",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(l.prototype),"init",this)).call.apply(t,[this].concat(n)),this.options.autoRefresh&&this.options.autoRefreshStatus&&this.setupRefreshInterval()}},{key:"initToolbar",value:function(){var t;this.options.autoRefresh&&(this.buttons=Object.assign(this.buttons,{autoRefresh:{html:'\n <button class="auto-refresh '.concat(this.constants.buttonsClass,"\n ").concat(this.options.autoRefreshStatus?" ".concat(this.constants.classes.buttonActive):"",'"\n type="button" name="autoRefresh" title="').concat(this.options.formatAutoRefresh(),'">\n ').concat(this.options.showButtonIcons?Me.sprintf(this.constants.html.icon,this.options.iconsPrefix,this.options.icons.autoRefresh):"","\n ").concat(this.options.showButtonText?this.options.formatAutoRefresh():"","\n </button>\n "),event:this.toggleAutoRefresh}}));for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=f(i(l.prototype),"initToolbar",this)).call.apply(t,[this].concat(n))}},{key:"toggleAutoRefresh",value:function(){this.options.autoRefresh&&(this.options.autoRefreshStatus?(clearInterval(this.options.autoRefreshFunction),this.$toolbar.find(">.columns .auto-refresh").removeClass(this.constants.classes.buttonActive)):(this.setupRefreshInterval(),this.$toolbar.find(">.columns .auto-refresh").addClass(this.constants.classes.buttonActive)),this.options.autoRefreshStatus=!this.options.autoRefreshStatus)}},{key:"destroy",value:function(){this.options.autoRefresh&&this.options.autoRefreshStatus&&clearInterval(this.options.autoRefreshFunction),f(i(l.prototype),"destroy",this).call(this)}},{key:"setupRefreshInterval",value:function(){var t=this;this.options.autoRefreshFunction=setInterval((function(){t.options.autoRefresh&&t.options.autoRefreshStatus&&t.refresh({silent:t.options.autoRefreshSilent})}),1e3*this.options.autoRefreshInterval)}}])&&o(e.prototype,n),c&&o(e,c),l}(n.default.BootstrapTable)}));