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

11 lines
6.9 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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.entries.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/web.url-search-params.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.iterator.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.entries.js","core-js/modules/es.object.to-string.js","core-js/modules/es.regexp.exec.js","core-js/modules/es.regexp.to-string.js","core-js/modules/es.string.iterator.js","core-js/modules/es.string.search.js","core-js/modules/web.dom-collections.iterator.js","core-js/modules/web.url-search-params.js","jquery"],t):t(null,null,null,null,null,null,null,null,null,null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,r,o,n,s,i,a,u,c,l,f){"use strict";function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function h(e,t,r){return t=j(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,r||[],j(e).constructor):t.apply(e,r))}function d(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,v(o.key),o)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=j(e)););return e}(e,t);if(o){var n=Object.getOwnPropertyDescriptor(o,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},b.apply(null,arguments)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,s,i,a=[],u=!0,c=!1;try{if(s=(r=r.call(e)).next,0===t);else for(;!(u=(o=s.call(r)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}var O=f.fn.bootstrapTable.utils;Object.assign(f.fn.bootstrapTable.defaults,{addrbar:!1,addrPrefix:"",addrCustomParams:{}}),f.BootstrapTable=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),d(t,[{key:"init",value:function(){var e;this.options.pagination&&this.options.addrbar&&this.initAddrbar();for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];(e=b(j(t.prototype),"init",this)).call.apply(e,[this].concat(o))}},{key:"getDefaultOptionValue",value:function(e,t){return this.options[e]!==f.BootstrapTable.DEFAULTS[e]?this.options[e]:this.searchParams.get("".concat(this.options.addrPrefix||"").concat(t))||f.BootstrapTable.DEFAULTS[e]}},{key:"initAddrbar",value:function(){var e=this;this.addrbarInit=!0,this.searchParams=new URLSearchParams(window.location.search.substring(1)),this.options.pageNumber=+this.getDefaultOptionValue("pageNumber","page"),this.options.pageSize=+this.getDefaultOptionValue("pageSize","size"),this.options.sortOrder=this.getDefaultOptionValue("sortOrder","order"),this.options.sortName=this.getDefaultOptionValue("sortName","sort"),this.options.searchText=this.getDefaultOptionValue("searchText","search");var t=this.options.addrPrefix||"",r=this.options.onLoadSuccess,o=this.options.onPageChange;this.options.onLoadSuccess=function(o){e.addrbarInit?e.addrbarInit=!1:e.updateHistoryState(t),r&&r.call(e,o)},this.options.onPageChange=function(r,n){e.updateHistoryState(t),o&&o.call(e,r,n)}}},{key:"updateHistoryState",value:function(e){var t={};t["".concat(e,"page")]=this.options.pageNumber,t["".concat(e,"size")]=this.options.pageSize,t["".concat(e,"order")]=this.options.sortOrder,t["".concat(e,"sort")]=this.options.sortName,t["".concat(e,"search")]=this.options.searchText;for(var r=0,o=Object.entries(t);r<o.length;r++){var n=g(o[r],2),s=n[0],i=n[1];void 0===i?this.searchParams.delete(s):this.searchParams.set(s,i)}for(var a=O.calculateObjectValue(this.options,this.options.addrCustomParams,[],{}),u=0,c=Object.entries(a);u<c.length;u++){var l=g(c[u],2),f=l[0],p=l[1];this.searchParams.set(f,p)}var h="?".concat(this.searchParams.toString());location.hash&&(h+=location.hash),window.history.pushState({},"",h)}},{key:"resetSearch",value:function(e){b(j(t.prototype),"resetSearch",this).call(this,e),this.options.searchText=e||""}}])}(f.BootstrapTable)}));