UNPKG

2.48 kBJavaScriptView Raw
1/**
2 * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
3 *
4 * @version v1.21.4
5 * @homepage https://bootstrap-table.com
6 * @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
7 * @license MIT
8 */
9
10!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BootstrapTable=t()}(this,(function(){"use strict";const e=window.jQuery,t=t=>void 0===t?t:e.fn.bootstrapTable.utils.extend(!0,Array.isArray(t)?[]:{},t);function n(e,t,n,o,s,i,a,r,d,l){"boolean"!=typeof a&&(d=r,r=a,a=!1);const f="function"==typeof n?n.options:n;let c;if(e&&e.render&&(f.render=e.render,f.staticRenderFns=e.staticRenderFns,f._compiled=!0,s&&(f.functional=!0)),o&&(f._scopeId=o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},f._ssrRegister=c):t&&(c=a?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),c)if(f.functional){const e=f.render;f.render=function(t,n){return c.call(n),e(t,n)}}else{const e=f.beforeCreate;f.beforeCreate=e?[].concat(e,c):[c]}return n}return n({render:function(){var e=this.$createElement;return(this._self._c||e)("table")},staticRenderFns:[]},undefined,{name:"BootstrapTable",props:{columns:{type:Array,require:!0},data:{type:[Array,Object],default(){}},options:{type:Object,default:()=>({})}},mounted(){this.$table=e(this.$el),this.$table.on("all.bs.table",((t,n,o)=>{let s=e.fn.bootstrapTable.events[n];s=s.replace(/([A-Z])/g,"-$1").toLowerCase(),this.$emit("on-all",...o),this.$emit(s,...o)})),this._initTable()},methods:{_initTable(){const e={...t(this.options),columns:t(this.columns),data:t(this.data)};this._hasInit?this.refreshOptions(e):(this.$table.bootstrapTable(e),this._hasInit=!0)},...(()=>{const t={};for(const n of e.fn.bootstrapTable.methods)t[n]=function(...e){return this.$table.bootstrapTable(n,...e)};return t})()},watch:{options:{handler(){this._initTable()},deep:!0},columns:{handler(){this._initTable()},deep:!0},data:{handler(){this.load(t(this.data))},deep:!0}}},undefined,false,undefined,!1,void 0,void 0,void 0)}));