vue-tables-2
Version:
Vue.js 2 grid components
43 lines (41 loc) • 1.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _default = {
name: 'RLTableRow',
props: ['row', 'index'],
inject: ['allColumns', 'opts', 'rowWasClicked', 'hasChildRow', 'componentsOverride'],
provide: function provide() {
var _this = this;
return {
row: function row() {
return _this.row;
},
index: function index() {
return _this.index;
}
};
},
render: function render() {
return this.$scopedSlots["default"]({
opts: this.opts(),
columns: this.allColumns(),
hasChildRow: this.hasChildRow(),
rowId: this.row[this.opts().uniqueKey],
rowAttrs: {
"class": this.opts().rowClassCallback ? this.opts().rowClassCallback(this.row) : '',
attrs: this.opts().rowAttributesCallback ? this.opts().rowAttributesCallback(this.row) : {}
},
rowEvents: {
click: this.rowWasClicked.bind(this, this.row, this.index),
dblclick: this.rowWasClicked.bind(this, this.row, this.index)
},
childRowTogglerFirst: this.hasChildRow() && this.opts().showChildRowToggler && this.opts().childRowTogglerFirst,
childRowTogglerLast: this.hasChildRow() && this.opts().showChildRowToggler && !this.opts().childRowTogglerFirst,
override: this.componentsOverride.tableRow
});
}
};
exports["default"] = _default;