vue-tables-2
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -14,3 +14,3 @@ "use strict"; | ||
name: 'RLTableCell', | ||
inject: ['row', 'scopedSlots', 'opts', 'render', 'index', 'setEditingCell', 'updateValue', 'revertValue', 'editing', 'getValue', 'columnClass', 'cellClasses', 'componentsOverride'], | ||
inject: ['row', 'scopedSlots', 'opts', 'render', 'index', 'setEditingCell', 'updateValue', 'revertValue', 'editing', 'getValue', 'columnClass', 'cellClasses', 'componentsOverride', 'isListFilter', 'optionText', 'source', 'dateFormat', 'formatDate'], | ||
props: ['column'], | ||
@@ -50,4 +50,15 @@ render: function render(h) { | ||
return this.getValue(this.Row, this.column); | ||
return this.formatCellContent(this.getValue(this.Row, this.column), this.column); | ||
}, | ||
formatCellContent: function formatCellContent(value, column) { | ||
if (this.source === 'client' && this.opts().dateColumns.includes(column)) { | ||
return this.formatDate(value, this.dateFormat(column)); | ||
} | ||
if (this.isListFilter(column)) { | ||
return this.optionText(value, column); | ||
} | ||
return value; | ||
}, | ||
isEditing: function isEditing() { | ||
@@ -54,0 +65,0 @@ return function () { |
@@ -26,4 +26,3 @@ "use strict"; | ||
this.allFilteredData = JSON.parse(JSON.stringify(data)); | ||
data = data.splice(offset, this.limit); | ||
return this.applyFilters(data); | ||
return data.splice(offset, this.limit); | ||
}; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var data = this.opts.responseAdapter.call(this, response); | ||
this.data = this.applyFilters(data.data); | ||
this.data = data.data; | ||
@@ -10,0 +10,0 @@ if (isNaN(data.count)) { |
@@ -28,3 +28,2 @@ "use strict"; | ||
hasDateFilters: require('../methods/has-date-filters'), | ||
applyFilters: require('../methods/apply-filters'), | ||
optionText: require('../filters/option-text'), | ||
@@ -31,0 +30,0 @@ render: require('../methods/render'), |
@@ -99,4 +99,8 @@ "use strict"; | ||
return _this.orderBy; | ||
} | ||
}, | ||
isListFilter: this.isListFilter, | ||
optionText: this.optionText, | ||
dateFormat: this.dateFormat, | ||
formatDate: this.formatDate | ||
}; | ||
}; |
{ | ||
"name": "vue-tables-2", | ||
"description": "Vue.js 2 grid components", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "vue2", |
585029
7156