2025-04-10 23:19:13 +08:00

11 lines
5.6 KiB
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.23.1
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.find.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.to-string.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.find.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.to-string.js","jquery"],e):e(null,null,null,null,(t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t,e,o,n,s){"use strict";function r(t,e,o){return e=u(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,c()?Reflect.construct(e,o||[],u(t).constructor):e.apply(t,o))}function i(t,e,o){return e&&function(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(){return a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,o){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var s=Object.getOwnPropertyDescriptor(n,e);return s.get?s.get.call(arguments.length<3?t:o):s.value}},a.apply(null,arguments)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function c(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(c=function(){return!!t})()}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function l(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}var h=s.fn.bootstrapTable.utils;Object.assign(s.fn.bootstrapTable.defaults,{autoRefresh:!1,showAutoRefresh:!0,autoRefreshInterval:60,autoRefreshSilent:!0,autoRefreshStatus:!0,autoRefreshFunction:null}),Object.assign(s.fn.bootstrapTable.defaults.icons,{autoRefresh:{bootstrap3:"glyphicon-time icon-time",bootstrap5:"bi-clock",materialize:"access_time","bootstrap-table":"icon-clock"}[s.fn.bootstrapTable.theme]||"fa-clock"}),Object.assign(s.fn.bootstrapTable.locales,{formatAutoRefresh:function(){return"Auto Refresh"}}),Object.assign(s.fn.bootstrapTable.defaults,s.fn.bootstrapTable.locales),s.BootstrapTable=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,e,arguments)}return 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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(e,t),i(e,[{key:"init",value:function(){for(var t,o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];(t=a(u(e.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?h.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 o=arguments.length,n=new Array(o),s=0;s<o;s++)n[s]=arguments[s];(t=a(u(e.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),a(u(e.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)}}])}(s.BootstrapTable)}));