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

11 lines
6.3 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.filter.js"),require("core-js/modules/es.array.join.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.filter.js","core-js/modules/es.array.join.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.to-string.js","jquery"],e):e(null,null,null,null,null,(t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t,e,r,n,o,i){"use strict";function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e,r){return e=f(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,p()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}function s(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return l(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},c.apply(null,arguments)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function d(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.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=i.fn.bootstrapTable.utils;Object.assign(i.fn.bootstrapTable.defaults,{treeEnable:!1,treeShowField:null,idField:"id",parentIdField:"pid",rootParentId:null}),i.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),a(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&&y(t,e)}(e,t),s(e,[{key:"init",value:function(){var t;this._rowStyle=this.options.rowStyle;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(t=c(f(e.prototype),"init",this)).call.apply(t,[this].concat(n))}},{key:"initHeader",value:function(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(t=c(f(e.prototype),"initHeader",this)).call.apply(t,[this].concat(n));var i=this.options.treeShowField;if(i){var l,a=u(this.header.fields);try{for(a.s();!(l=a.n()).done;){if(i===l.value){this.treeEnable=!0;break}}}catch(t){a.e(t)}finally{a.f()}}}},{key:"initBody",value:function(){var t;this.treeEnable&&(this.options.virtualScroll=!1);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(t=c(f(e.prototype),"initBody",this)).call.apply(t,[this].concat(n))}},{key:"initTr",value:function(t,r,n,o){var l=this,a=n.filter((function(e){return t[l.options.idField]===e[l.options.parentIdField]}));o.append(c(f(e.prototype),"initRow",this).call(this,t,r,n,o));for(var s=a.length-1,u=0;u<=s;u++){var p=a[u],y=h.extend(!0,{},t);p._level=y._level+1,p._parent=y,u===s&&(p._last=1),this.options.rowStyle=function(t,e){var r=l._rowStyle(t,e),n=t[l.options.idField]?t[l.options.idField]:0,o=t[l.options.parentIdField]?t[l.options.parentIdField]:0;return r.classes=[r.classes||"","treegrid-".concat(n),"treegrid-parent-".concat(o)].join(" "),r},this.initTr(p,i.inArray(p,n),n,o)}}},{key:"initRow",value:function(t,r,n,o){var i=this;return this.treeEnable?(this.options.rootParentId===t[this.options.parentIdField]||!t[this.options.parentIdField])&&(void 0===t._level&&(t._level=0),this.options.rowStyle=function(t,e){var r=i._rowStyle(t,e),n=t[i.options.idField]?t[i.options.idField]:0;return r.classes=[r.classes||"","treegrid-".concat(n)].join(" "),r},this.initTr(t,r,n,o),!0):c(f(e.prototype),"initRow",this).call(this,t,r,n,o)}},{key:"destroy",value:function(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(t=c(f(e.prototype),"destroy",this)).call.apply(t,[this].concat(n)),this.options.rowStyle=this._rowStyle}}])}(i.BootstrapTable)}));