diff --git a/dist/vue-table.js b/dist/vue-table.js index 34bdc98..b79070c 100644 --- a/dist/vue-table.js +++ b/dist/vue-table.js @@ -575,9 +575,8 @@ exports.default = { console.warn('You need to define "detail-row-id" in order for detail-row feature to work!'); return false; } - var result = this.detailRowCallback.trim() !== '' || this.detailRowComponent !== ''; - console.log('aaa>>>', this.detailRowComponent, result); - return result; + + return this.detailRowCallback.trim() !== '' || this.detailRowComponent !== ''; }, useDetailRowComponent: function useDetailRowComponent() { return this.detailRowComponent !== ''; @@ -1059,9 +1058,9 @@ if (module.hot) {(function () { module.hot.accept() document.head.removeChild(__vueify_style__) }) if (!module.hot.data) { - hotAPI.createRecord("_v-a86009c0", module.exports) + hotAPI.createRecord("_v-3563622c", module.exports) } else { - hotAPI.update("_v-a86009c0", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) + hotAPI.update("_v-3563622c", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) } })()} },{"vue":"vue","vue-hot-reload-api":1,"vueify/lib/insert-css":2}],4:[function(require,module,exports){ @@ -1087,9 +1086,9 @@ if (module.hot) {(function () { module.hot.accept() hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return if (!module.hot.data) { - hotAPI.createRecord("_v-50fb97da", module.exports) + hotAPI.createRecord("_v-3d729fe6", module.exports) } else { - hotAPI.update("_v-50fb97da", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) + hotAPI.update("_v-3d729fe6", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) } })()} },{"./VuetablePaginationMixin.vue":6,"vue":"vue","vue-hot-reload-api":1}],5:[function(require,module,exports){ @@ -1155,9 +1154,9 @@ if (module.hot) {(function () { module.hot.accept() hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return if (!module.hot.data) { - hotAPI.createRecord("_v-15a35d8b", module.exports) + hotAPI.createRecord("_v-9c70ccd2", module.exports) } else { - hotAPI.update("_v-15a35d8b", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) + hotAPI.update("_v-9c70ccd2", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) } })()} },{"./VuetablePaginationMixin.vue":6,"vue":"vue","vue-hot-reload-api":1}],6:[function(require,module,exports){ @@ -1275,9 +1274,9 @@ if (module.hot) {(function () { module.hot.accept() hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return if (!module.hot.data) { - hotAPI.createRecord("_v-e59f6b12", module.exports) + hotAPI.createRecord("_v-e34f2c2a", module.exports) } else { - hotAPI.update("_v-e59f6b12", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) + hotAPI.update("_v-e34f2c2a", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template) } })()} },{"vue":"vue","vue-hot-reload-api":1}],7:[function(require,module,exports){ diff --git a/dist/vue-table.min.js b/dist/vue-table.min.js index 2719ced..e83fe2a 100644 --- a/dist/vue-table.min.js +++ b/dist/vue-table.min.js @@ -1 +1 @@ -!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o>>",this.detailRowComponent,result),result},useDetailRowComponent:function(){return""!==this.detailRowComponent},countVisibleFields:function(){return this.fields.filter(function(field){return field.visible}).length}},methods:{normalizeFields:function(){var obj,self=this;this.fields.forEach(function(field,i){obj="string"==typeof field?{name:field,title:self.setTitle(field),titleClass:"",dataClass:"",callback:null,visible:!0}:{name:field.name,title:void 0===field.title?self.setTitle(field.name):field.title,sortField:field.sortField,titleClass:void 0===field.titleClass?"":field.titleClass,dataClass:void 0===field.dataClass?"":field.dataClass,callback:void 0===field.callback?"":field.callback,visible:void 0===field.visible||field.visible},self.fields.$set(i,obj)})},setTitle:function(str){return this.isSpecialField(str)?"":this.titleCase(str)},titleCase:function(str){return str.replace(/\w+/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()})},loadData:function(){var self=this,wrapper=document.querySelector(this.tableWrapper);this.showLoadingAnimation(wrapper);var url=this.apiUrl+"?"+this.getAllQueryParams();this.$http.get(url,this.httpData,this.httpOptions).then(function(response){self.tableData=self.getObjectValue(response.data,self.dataPath,null),self.tablePagination=self.getObjectValue(response.data,self.paginationPath,null),null===self.tablePagination&&console.warn('vuetable: pagination-path "'+self.paginationPath+'" not found. It looks like the data returned from the sever does not have pagination information or you may have set it incorrectly.'),self.$nextTick(function(){self.dispatchEvent("load-success",response),self.broadcastEvent("load-success",self.tablePagination),self.hideLoadingAnimation(wrapper)})},function(response){self.dispatchEvent("load-error",response),self.broadcastEvent("load-error",response),self.hideLoadingAnimation(wrapper)})},getAllQueryParams:function(){var params=[this.queryParams.sort+"="+this.getSortParam(),this.queryParams.page+"="+this.currentPage,this.queryParams.perPage+"="+this.perPage].join("&");return this.appendParams.length>0&&(params+="&"+this.appendParams.join("&")),params},showLoadingAnimation:function(wrapper){null!==wrapper&&this.addClass(wrapper,this.loadingClass),this.dispatchEvent("loading")},hideLoadingAnimation:function(wrapper){null!==wrapper&&this.removeClass(wrapper,this.loadingClass),this.dispatchEvent("loaded")},getTitle:function(field){return"undefined"==typeof field.title?field.name.replace("."," "):field.title},getSortParam:function(){return this.sortOrder&&""!=this.sortOrder.field?"function"==typeof this.$parent.getSortParam?this.$parent.getSortParam.call(this.$parent,this.sortOrder):this.getDefaultSortParam():""},getDefaultSortParam:function(){for(var result="",i=0;i1&&(this.currentPage--,this.loadData())},gotoNextPage:function(){this.currentPage0&&page<=this.tablePagination.last_page&&(this.currentPage=page,this.loadData())},isSpecialField:function(fieldName){return"__"===fieldName.slice(0,2)},hasCallback:function(item){return!!item.callback},callCallback:function(field,item){if(this.hasCallback(field)){var args=field.callback.split("|"),func=args.shift();return"function"==typeof this.$parent[func]?args.length>0?this.$parent[func].apply(this.$parent,[this.getObjectValue(item,field.name)].concat(args)):this.$parent[func].call(this.$parent,this.getObjectValue(item,field.name)):null}},getObjectValue:function(object,path,defaultValue){defaultValue="undefined"==typeof defaultValue?null:defaultValue;var obj=object;if(""!=path.trim()){var keys=path.split(".");keys.forEach(function(key){return null===obj||"undefined"==typeof obj[key]||null===obj[key]?void(obj=defaultValue):void(obj=obj[key])})}return obj},callAction:function(action,data){this.$dispatch(this.eventPrefix+"action",action,data)},addParam:function(param){this.appendParams.push(param)},toggleCheckbox:function(isChecked,dataItem,fieldName){var idColumn=this.extractArgs(fieldName);return void 0===idColumn?void console.warn('You did not provide reference id column with "__checkbox:" field!'):void(isChecked?this.selectedTo.push(dataItem[idColumn]):this.selectedTo.$remove(dataItem[idColumn]))},toggleAllCheckboxes:function(isChecked,fieldName){var self=this,idColumn=this.extractArgs(fieldName);isChecked?this.tableData.forEach(function(dataItem){self.isSelectedRow(dataItem,fieldName)||self.selectedTo.push(dataItem[idColumn])}):this.tableData.forEach(function(dataItem){self.selectedTo.$remove(dataItem[idColumn])})},isSelectedRow:function(dataItem,fieldName){return this.selectedTo.indexOf(dataItem[this.extractArgs(fieldName)])>=0},extractName:function(string){return string.split(":")[0].trim()},extractArgs:function(string){return string.split(":")[1]},callDetailRowCallback:function(item){var func=this.detailRowCallback.trim();return""===func?"":"function"==typeof this.$parent[func]?this.$parent[func].call(this.$parent,item):void console.error('Function "'+func+'()" does not exist!')},isVisibleDetailRow:function(rowId){return this.visibleDetailRows.indexOf(rowId)>=0},showDetailRow:function(rowId){this.isVisibleDetailRow(rowId)||this.visibleDetailRows.push(rowId)},hideDetailRow:function(rowId){this.isVisibleDetailRow(rowId)&&this.visibleDetailRows.$remove(rowId)},toggleDetailRow:function(rowId){this.isVisibleDetailRow(rowId)?this.hideDetailRow(rowId):this.showDetailRow(rowId)},onRowClass:function(dataItem,index){var func=this.rowClassCallback.trim();return""!==func&&"function"==typeof this.$parent[func]?this.$parent[func].call(this.$parent,dataItem,index):""},onRowChanged:function(dataItem){return this.dispatchEvent("row-changed",dataItem),!0},onRowClicked:function(dataItem,event){return this.$dispatch(this.eventPrefix+"row-clicked",dataItem,event),!0},onCellClicked:function(dataItem,field,event){this.$dispatch(this.eventPrefix+"cell-clicked",dataItem,field,event)},onCellDoubleClicked:function(dataItem,field,event){this.$dispatch(this.eventPrefix+"cell-dblclicked",dataItem,field,event)},onDetailRowClick:function(dataItem,event){this.$dispatch(this.eventPrefix+"detail-row-clicked",dataItem,event)},callPaginationConfig:function(){"function"==typeof this.$parent[this.paginationConfigCallback]&&this.$parent[this.paginationConfigCallback].call(this.$parent,this.$refs.pagination.$options.name)},logDeprecatedMessage:function(name,replacer){var msg='"{name}" prop is being deprecated and will be removed in the future. Please use "{replacer}" instead.';console.warn(msg.replace("{name}",name).replace("{replacer}",replacer))},checkForDeprecatedProps:function(){"paginationConfig"!==this.paginationConfig&&this.logDeprecatedMessage("paginationConfig","paginationConfigCallback"),""!==this.detailRow&&this.logDeprecatedMessage("detail-row","detail-row-callback"),""!==this.detailRowCallback&&this.logDeprecatedMessage("detail-row-callback","detail-row-component")}},watch:{multiSort:function(newVal,oldVal){newVal===!1&&this.sortOrder.length>1&&(this.sortOrder.splice(1),this.loadData())}},events:{"vuetable-pagination:change-page":function(page){"prev"==page?this.gotoPreviousPage():"next"==page?this.gotoNextPage():this.gotoPage(page)},"vuetable:reload":function(){this.loadData()},"vuetable:refresh":function(){this.currentPage=1,this.loadData()},"vuetable:goto-page":function(page){this.$emit("vuetable-pagination:change-page",page)},"vuetable:set-options":function(options){for(var n in options)this.$set(n,options[n])},"vuetable:toggle-detail":function(dataItem){this.toggleDetailRow(dataItem)},"vuetable:show-detail":function(dataItem){this.showDetailRow(dataItem)},"vuetable:hide-detail":function(dataItem){this.hideDetailRow(dataItem)}},created:function(){this.checkForDeprecatedProps(),this.normalizeFields(),this.loadOnStart&&this.loadData(),this.$nextTick(function(){this.callPaginationConfig()})}},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template='
'},{"vueify/lib/insert-css":1}],3:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _VuetablePaginationMixin=require("./VuetablePaginationMixin.vue"),_VuetablePaginationMixin2=_interopRequireDefault(_VuetablePaginationMixin);exports.default={mixins:[_VuetablePaginationMixin2.default]},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template=''},{"./VuetablePaginationMixin.vue":5}],4:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _VuetablePaginationMixin=require("./VuetablePaginationMixin.vue"),_VuetablePaginationMixin2=_interopRequireDefault(_VuetablePaginationMixin);exports.default={mixins:[_VuetablePaginationMixin2.default],props:{dropdownClass:{type:String,default:function(){return"ui search dropdown"}},pageText:{type:String,default:function(){return"Page"}}},methods:{loadPage:function(page){"prev"!=page||this.isOnFirstPage?"next"!=page||this.isOnLastPage||this.setDropdownToPage(this.tablePagination.current_page+1):this.setDropdownToPage(this.tablePagination.current_page-1),this.$dispatch("vuetable-pagination:change-page",page)},setDropdownToPage:function(page){this.$nextTick(function(){document.getElementById("vuetable-pagination-dropdown").value=page})},selectPage:function(event){this.$dispatch("vuetable-pagination:change-page",event.target.selectedIndex+1)}},events:{"vuetable:load-success":function(tablePagination){this.tablePagination=tablePagination,this.setDropdownToPage(tablePagination.current_page)}}},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template='
'},{"./VuetablePaginationMixin.vue":5}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={props:{wrapperClass:{type:String,default:function(){return"ui right floated pagination menu"}},activeClass:{type:String,default:function(){return"active large"}},disabledClass:{type:String,default:function(){return"disabled"}},pageClass:{type:String,default:function(){return"item"}},linkClass:{type:String,default:function(){return"icon item"}},icons:{type:Object,default:function(){return{first:"angle double left icon",prev:"left chevron icon",next:"right chevron icon",last:"angle double right icon"}}},onEachSide:{type:Number,coerce:function(value){return parseInt(value)},default:function(){return 2}}},data:function(){return{tablePagination:null}},computed:{totalPage:function(){return null==this.tablePagination?0:this.tablePagination.last_page},isOnFirstPage:function(){return null!=this.tablePagination&&1==this.tablePagination.current_page},isOnLastPage:function(){return null!=this.tablePagination&&this.tablePagination.current_page==this.tablePagination.last_page},notEnoughPages:function(){return this.totalPage<2*this.onEachSide+4},windowSize:function(){return 2*this.onEachSide+1},windowStart:function(){return!this.tablePagination||this.tablePagination.current_page<=this.onEachSide?1:this.tablePagination.current_page>=this.totalPage-this.onEachSide?this.totalPage-2*this.onEachSide:this.tablePagination.current_page-this.onEachSide}},methods:{loadPage:function(page){this.$dispatch("vuetable-pagination:change-page",page)},isCurrentPage:function(page){return page==this.tablePagination.current_page}},events:{"vuetable:load-success":function(tablePagination){this.tablePagination=tablePagination},"vuetable-pagination:set-options":function(options){for(var n in options)this.$set(n,options[n])}}},module.exports.__esModule&&(module.exports=module.exports.default)},{}],6:[function(require,module,exports){Vue.component("vuetable-pagination",require("./components/VuetablePagination.vue")),Vue.component("vuetable-pagination-dropdown",require("./components/VuetablePaginationDropdown.vue")),Vue.component("vuetable",require("./components/Vuetable.vue"))},{"./components/Vuetable.vue":2,"./components/VuetablePagination.vue":3,"./components/VuetablePaginationDropdown.vue":4}]},{},[6]); +!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o0&&(params+="&"+this.appendParams.join("&")),params},showLoadingAnimation:function(wrapper){null!==wrapper&&this.addClass(wrapper,this.loadingClass),this.dispatchEvent("loading")},hideLoadingAnimation:function(wrapper){null!==wrapper&&this.removeClass(wrapper,this.loadingClass),this.dispatchEvent("loaded")},getTitle:function(field){return"undefined"==typeof field.title?field.name.replace("."," "):field.title},getSortParam:function(){return this.sortOrder&&""!=this.sortOrder.field?"function"==typeof this.$parent.getSortParam?this.$parent.getSortParam.call(this.$parent,this.sortOrder):this.getDefaultSortParam():""},getDefaultSortParam:function(){for(var result="",i=0;i1&&(this.currentPage--,this.loadData())},gotoNextPage:function(){this.currentPage0&&page<=this.tablePagination.last_page&&(this.currentPage=page,this.loadData())},isSpecialField:function(fieldName){return"__"===fieldName.slice(0,2)},hasCallback:function(item){return!!item.callback},callCallback:function(field,item){if(this.hasCallback(field)){var args=field.callback.split("|"),func=args.shift();return"function"==typeof this.$parent[func]?args.length>0?this.$parent[func].apply(this.$parent,[this.getObjectValue(item,field.name)].concat(args)):this.$parent[func].call(this.$parent,this.getObjectValue(item,field.name)):null}},getObjectValue:function(object,path,defaultValue){defaultValue="undefined"==typeof defaultValue?null:defaultValue;var obj=object;if(""!=path.trim()){var keys=path.split(".");keys.forEach(function(key){return null===obj||"undefined"==typeof obj[key]||null===obj[key]?void(obj=defaultValue):void(obj=obj[key])})}return obj},callAction:function(action,data){this.$dispatch(this.eventPrefix+"action",action,data)},addParam:function(param){this.appendParams.push(param)},toggleCheckbox:function(isChecked,dataItem,fieldName){var idColumn=this.extractArgs(fieldName);return void 0===idColumn?void console.warn('You did not provide reference id column with "__checkbox:" field!'):void(isChecked?this.selectedTo.push(dataItem[idColumn]):this.selectedTo.$remove(dataItem[idColumn]))},toggleAllCheckboxes:function(isChecked,fieldName){var self=this,idColumn=this.extractArgs(fieldName);isChecked?this.tableData.forEach(function(dataItem){self.isSelectedRow(dataItem,fieldName)||self.selectedTo.push(dataItem[idColumn])}):this.tableData.forEach(function(dataItem){self.selectedTo.$remove(dataItem[idColumn])})},isSelectedRow:function(dataItem,fieldName){return this.selectedTo.indexOf(dataItem[this.extractArgs(fieldName)])>=0},extractName:function(string){return string.split(":")[0].trim()},extractArgs:function(string){return string.split(":")[1]},callDetailRowCallback:function(item){var func=this.detailRowCallback.trim();return""===func?"":"function"==typeof this.$parent[func]?this.$parent[func].call(this.$parent,item):void console.error('Function "'+func+'()" does not exist!')},isVisibleDetailRow:function(rowId){return this.visibleDetailRows.indexOf(rowId)>=0},showDetailRow:function(rowId){this.isVisibleDetailRow(rowId)||this.visibleDetailRows.push(rowId)},hideDetailRow:function(rowId){this.isVisibleDetailRow(rowId)&&this.visibleDetailRows.$remove(rowId)},toggleDetailRow:function(rowId){this.isVisibleDetailRow(rowId)?this.hideDetailRow(rowId):this.showDetailRow(rowId)},onRowClass:function(dataItem,index){var func=this.rowClassCallback.trim();return""!==func&&"function"==typeof this.$parent[func]?this.$parent[func].call(this.$parent,dataItem,index):""},onRowChanged:function(dataItem){return this.dispatchEvent("row-changed",dataItem),!0},onRowClicked:function(dataItem,event){return this.$dispatch(this.eventPrefix+"row-clicked",dataItem,event),!0},onCellClicked:function(dataItem,field,event){this.$dispatch(this.eventPrefix+"cell-clicked",dataItem,field,event)},onCellDoubleClicked:function(dataItem,field,event){this.$dispatch(this.eventPrefix+"cell-dblclicked",dataItem,field,event)},onDetailRowClick:function(dataItem,event){this.$dispatch(this.eventPrefix+"detail-row-clicked",dataItem,event)},callPaginationConfig:function(){"function"==typeof this.$parent[this.paginationConfigCallback]&&this.$parent[this.paginationConfigCallback].call(this.$parent,this.$refs.pagination.$options.name)},logDeprecatedMessage:function(name,replacer){var msg='"{name}" prop is being deprecated and will be removed in the future. Please use "{replacer}" instead.';console.warn(msg.replace("{name}",name).replace("{replacer}",replacer))},checkForDeprecatedProps:function(){"paginationConfig"!==this.paginationConfig&&this.logDeprecatedMessage("paginationConfig","paginationConfigCallback"),""!==this.detailRow&&this.logDeprecatedMessage("detail-row","detail-row-callback"),""!==this.detailRowCallback&&this.logDeprecatedMessage("detail-row-callback","detail-row-component")}},watch:{multiSort:function(newVal,oldVal){newVal===!1&&this.sortOrder.length>1&&(this.sortOrder.splice(1),this.loadData())}},events:{"vuetable-pagination:change-page":function(page){"prev"==page?this.gotoPreviousPage():"next"==page?this.gotoNextPage():this.gotoPage(page)},"vuetable:reload":function(){this.loadData()},"vuetable:refresh":function(){this.currentPage=1,this.loadData()},"vuetable:goto-page":function(page){this.$emit("vuetable-pagination:change-page",page)},"vuetable:set-options":function(options){for(var n in options)this.$set(n,options[n])},"vuetable:toggle-detail":function(dataItem){this.toggleDetailRow(dataItem)},"vuetable:show-detail":function(dataItem){this.showDetailRow(dataItem)},"vuetable:hide-detail":function(dataItem){this.hideDetailRow(dataItem)}},created:function(){this.checkForDeprecatedProps(),this.normalizeFields(),this.loadOnStart&&this.loadData(),this.$nextTick(function(){this.callPaginationConfig()})}},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template='
'},{"vueify/lib/insert-css":1}],3:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _VuetablePaginationMixin=require("./VuetablePaginationMixin.vue"),_VuetablePaginationMixin2=_interopRequireDefault(_VuetablePaginationMixin);exports.default={mixins:[_VuetablePaginationMixin2.default]},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template=''},{"./VuetablePaginationMixin.vue":5}],4:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _VuetablePaginationMixin=require("./VuetablePaginationMixin.vue"),_VuetablePaginationMixin2=_interopRequireDefault(_VuetablePaginationMixin);exports.default={mixins:[_VuetablePaginationMixin2.default],props:{dropdownClass:{type:String,default:function(){return"ui search dropdown"}},pageText:{type:String,default:function(){return"Page"}}},methods:{loadPage:function(page){"prev"!=page||this.isOnFirstPage?"next"!=page||this.isOnLastPage||this.setDropdownToPage(this.tablePagination.current_page+1):this.setDropdownToPage(this.tablePagination.current_page-1),this.$dispatch("vuetable-pagination:change-page",page)},setDropdownToPage:function(page){this.$nextTick(function(){document.getElementById("vuetable-pagination-dropdown").value=page})},selectPage:function(event){this.$dispatch("vuetable-pagination:change-page",event.target.selectedIndex+1)}},events:{"vuetable:load-success":function(tablePagination){this.tablePagination=tablePagination,this.setDropdownToPage(tablePagination.current_page)}}},module.exports.__esModule&&(module.exports=module.exports.default),("function"==typeof module.exports?module.exports.options:module.exports).template='
'},{"./VuetablePaginationMixin.vue":5}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={props:{wrapperClass:{type:String,default:function(){return"ui right floated pagination menu"}},activeClass:{type:String,default:function(){return"active large"}},disabledClass:{type:String,default:function(){return"disabled"}},pageClass:{type:String,default:function(){return"item"}},linkClass:{type:String,default:function(){return"icon item"}},icons:{type:Object,default:function(){return{first:"angle double left icon",prev:"left chevron icon",next:"right chevron icon",last:"angle double right icon"}}},onEachSide:{type:Number,coerce:function(value){return parseInt(value)},default:function(){return 2}}},data:function(){return{tablePagination:null}},computed:{totalPage:function(){return null==this.tablePagination?0:this.tablePagination.last_page},isOnFirstPage:function(){return null!=this.tablePagination&&1==this.tablePagination.current_page},isOnLastPage:function(){return null!=this.tablePagination&&this.tablePagination.current_page==this.tablePagination.last_page},notEnoughPages:function(){return this.totalPage<2*this.onEachSide+4},windowSize:function(){return 2*this.onEachSide+1},windowStart:function(){return!this.tablePagination||this.tablePagination.current_page<=this.onEachSide?1:this.tablePagination.current_page>=this.totalPage-this.onEachSide?this.totalPage-2*this.onEachSide:this.tablePagination.current_page-this.onEachSide}},methods:{loadPage:function(page){this.$dispatch("vuetable-pagination:change-page",page)},isCurrentPage:function(page){return page==this.tablePagination.current_page}},events:{"vuetable:load-success":function(tablePagination){this.tablePagination=tablePagination},"vuetable-pagination:set-options":function(options){for(var n in options)this.$set(n,options[n])}}},module.exports.__esModule&&(module.exports=module.exports.default)},{}],6:[function(require,module,exports){Vue.component("vuetable-pagination",require("./components/VuetablePagination.vue")),Vue.component("vuetable-pagination-dropdown",require("./components/VuetablePaginationDropdown.vue")),Vue.component("vuetable",require("./components/Vuetable.vue"))},{"./components/Vuetable.vue":2,"./components/VuetablePagination.vue":3,"./components/VuetablePaginationDropdown.vue":4}]},{},[6]); diff --git a/package.json b/package.json index f9e3d11..b65267e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuetable", - "version": "1.5.0", + "version": "1.5.1", "description": "vue.js table component that will automatically request JSON data from server and display them nicely in HTML table with swap-able/extensible pagination component", "main": "dist/vue-table.js", "dependencies": { diff --git a/src/components/Vuetable.vue b/src/components/Vuetable.vue index 7e6418e..197bd04 100644 --- a/src/components/Vuetable.vue +++ b/src/components/Vuetable.vue @@ -357,9 +357,8 @@ export default { console.warn('You need to define "detail-row-id" in order for detail-row feature to work!') return false } - var result = this.detailRowCallback.trim() !== '' || this.detailRowComponent !== '' - console.log('aaa>>>', this.detailRowComponent, result) - return result + + return this.detailRowCallback.trim() !== '' || this.detailRowComponent !== '' }, useDetailRowComponent: function() { return this.detailRowComponent !== ''