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

11 lines
5.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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.object.assign.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("jquery")):"function"==typeof define&&define.amd?define(["core-js/modules/es.array.concat.js","core-js/modules/es.array.includes.js","core-js/modules/es.object.assign.js","core-js/modules/es.object.to-string.js","core-js/modules/es.string.includes.js","core-js/modules/web.dom-collections.for-each.js","jquery"],t):t(null,null,null,null,null,null,(e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e,t,i,n,o,r,s){"use strict";function c(e,t,i){return t=a(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,h()?Reflect.construct(t,i||[],a(e).constructor):t.apply(e,i))}function u(e,t,i){return t&&function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:i):o.value}},l.apply(null,arguments)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}Object.assign(s.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]}),s.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),c(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&&d(e,t)}(t,e),u(t,[{key:"init",value:function(){for(var e,i=this,n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];if((e=l(a(t.prototype),"init",this)).call.apply(e,[this].concat(o)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.warn("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var c,u,h,d={width:s(window).width(),height:s(window).height()};if(s(window).on("resize orientationchange",(c=function(){var e=s(window).width(),t=s(window).height(),n=s(document.activeElement);n.length&&["INPUT","SELECT","TEXTAREA"].includes(n.prop("nodeName"))||(Math.abs(d.height-t)>i.options.heightThreshold||d.width!==e)&&(i.changeView(e,t),d={width:e,height:t})},u=200,h=0,function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];clearTimeout(h),h=setTimeout((function(){h=0,c.apply(void 0,t)}),u)})),this.options.checkOnInit){var f=s(window).width(),p=s(window).height();this.changeView(f,p),d={width:f,height:p}}}}},{key:"conditionCardView",value:function(){this.changeTableView(!1),this.showHideColumns(!1)}},{key:"conditionFullView",value:function(){this.changeTableView(!0),this.showHideColumns(!0)}},{key:"changeTableView",value:function(e){this.options.cardView=e,this.toggleView()}},{key:"showHideColumns",value:function(e){var t=this;this.options.columnsHidden.length>0&&this.columns.forEach((function(i){t.options.columnsHidden.includes(i.field)&&i.visible!==e&&t._toggleColumn(t.fieldsColumnsIndex[i.field],e,!0)}))}},{key:"changeView",value:function(e,t){this.options.minHeight?e<=this.options.minWidth&&t<=this.options.minHeight?this.conditionCardView():e>this.options.minWidth&&t>this.options.minHeight&&this.conditionFullView():e<=this.options.minWidth?this.conditionCardView():e>this.options.minWidth&&this.conditionFullView(),this.resetView()}}])}(s.BootstrapTable)}));