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

11 lines
6.5 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.array.slice.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.array.slice.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,o,i,s,n){"use strict";function r(t,e,o){return e=l(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||[],l(t).constructor):e.apply(t,o))}function a(t,e,o){return e&&function(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,p(i.key),i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,o){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:o):s.value}},u.apply(null,arguments)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(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 p(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}var m=n.fn.bootstrapTable.utils;Object.assign(n.fn.bootstrapTable.defaults,{customView:!1,showCustomView:!1,customViewDefaultView:!1}),Object.assign(n.fn.bootstrapTable.defaults.icons,{customViewOn:{bootstrap3:"glyphicon glyphicon-list",bootstrap5:"bi-list",bootstrap4:"fa fa-list",semantic:"fa fa-list",foundation:"fa fa-list",bulma:"fa fa-list",materialize:"list"}[n.fn.bootstrapTable.theme]||"fa-list",customViewOff:{bootstrap3:"glyphicon glyphicon-thumbnails",bootstrap5:"bi-grid",bootstrap4:"fa fa-th",semantic:"fa fa-th",foundation:"fa fa-th",bulma:"fa fa-th",materialize:"grid_on"}[n.fn.bootstrapTable.theme]||"fa-th"}),Object.assign(n.fn.bootstrapTable.defaults,{onCustomViewPostBody:function(){return!1},onCustomViewPreBody:function(){return!1},onToggleCustomView:function(){return!1}}),Object.assign(n.fn.bootstrapTable.locales,{formatToggleCustomViewOn:function(){return"Show custom view"},formatToggleCustomViewOff:function(){return"Hide custom view"}}),Object.assign(n.fn.bootstrapTable.defaults,n.fn.bootstrapTable.locales),n.fn.bootstrapTable.methods.push("toggleCustomView"),Object.assign(n.fn.bootstrapTable.events,{"custom-view-post-body.bs.table":"onCustomViewPostBody","custom-view-pre-body.bs.table":"onCustomViewPreBody","toggle-custom-view.bs.table":"onToggleCustomView"}),n.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),a(e,[{key:"init",value:function(){this.customViewDefaultView=this.options.customViewDefaultView,u(l(e.prototype),"init",this).call(this)}},{key:"initToolbar",value:function(){var t;this.options.customView&&this.options.showCustomView&&(this.buttons=Object.assign(this.buttons,{customView:{text:this.options.customViewDefaultView?this.options.formatToggleCustomViewOff():this.options.formatToggleCustomViewOn(),icon:this.options.customViewDefaultView?this.options.icons.customViewOn:this.options.icons.customViewOff,event:this.toggleCustomView,attributes:{"aria-label":this.options.customViewDefaultView?this.options.formatToggleCustomViewOff():this.options.formatToggleCustomViewOn(),title:this.options.customViewDefaultView?this.options.formatToggleCustomViewOff():this.options.formatToggleCustomViewOn()}}}));for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(t=u(l(e.prototype),"initToolbar",this)).call.apply(t,[this].concat(i))}},{key:"initBody",value:function(){if(u(l(e.prototype),"initBody",this).call(this),this.options.customView){var t=this.$el,o=this.$container.find(".fixed-table-custom-view");if(t.hide(),o.hide(),this.options.customView&&this.customViewDefaultView){var i=this.getData().slice(this.pageFrom-1,this.pageTo),s=m.calculateObjectValue(this,this.options.customView,[i],"");this.trigger("custom-view-pre-body",i,s),1===o.length?o.show().html(s):this.$tableBody.after('<div class="fixed-table-custom-view">'.concat(s,"</div>")),this.trigger("custom-view-post-body",i,s)}else t.show()}}},{key:"toggleCustomView",value:function(){this.customViewDefaultView=!this.customViewDefaultView;var t=this.options.showButtonIcons?this.customViewDefaultView?this.options.icons.customViewOn:this.options.icons.customViewOff:"",e=this.options.showButtonText?this.customViewDefaultView?this.options.formatToggleCustomViewOff():this.options.formatToggleCustomViewOn():"";this.$toolbar.find('button[name="customView"]').html("".concat(m.sprintf(this.constants.html.icon,this.options.iconsPrefix,t)," ").concat(e)).attr("aria-label",e).attr("title",e),this.initBody(),this.trigger("toggle-custom-view",this.customViewDefaultView)}}])}(n.BootstrapTable)}));