Added comments and minor refactoring
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { CellDefault } from '../cells/renderer/CellDefault'
|
||||
|
||||
/**
|
||||
* Column logic
|
||||
*/
|
||||
|
||||
let nextColumnId = 0;
|
||||
export class ColumnBase {
|
||||
constructor(displayName, columnType) {
|
||||
@@ -13,13 +17,18 @@ export class ColumnBase {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} rowObject
|
||||
* @param {RowObject} rowObject
|
||||
* @returns {String} Name of the Cell renderer component
|
||||
*/
|
||||
getCellRenderer(rowObject) {
|
||||
return CellDefault.options.name;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {RowObject} rowObject
|
||||
* @returns {*} Raw unformated value
|
||||
*/
|
||||
getRawCellValue(rowObject) {
|
||||
// Should be overridden
|
||||
throw Error('Not implemented');
|
||||
@@ -38,7 +47,7 @@ export class ColumnBase {
|
||||
|
||||
/**
|
||||
* Object with css classes to use on the header cell
|
||||
* @returns {Any} Object with css classes
|
||||
* @returns {Object} Object with css classes
|
||||
*/
|
||||
getHeaderCellClasses() {
|
||||
// Should be overridden
|
||||
|
@@ -1,10 +1,16 @@
|
||||
/**
|
||||
* Provides the columns that are available in a table.
|
||||
*/
|
||||
class ColumnFactoryBase{
|
||||
constructor(projectId) {
|
||||
this.projectId = projectId;
|
||||
this.projectPromise;
|
||||
}
|
||||
|
||||
// Override this
|
||||
/**
|
||||
* To be overridden for your purposes
|
||||
* @returns {Promise(ColumnBase)} The columns that are available in the table.
|
||||
*/
|
||||
thenGetColumns() {
|
||||
throw Error('Not implemented')
|
||||
}
|
||||
@@ -19,3 +25,4 @@ class ColumnFactoryBase{
|
||||
}
|
||||
|
||||
export { ColumnFactoryBase }
|
||||
|
||||
|
@@ -1,10 +0,0 @@
|
||||
const TEMPLATE =`
|
||||
<div class="pillar-table-column"/>
|
||||
`;
|
||||
|
||||
Vue.component('pillar-table-column', {
|
||||
template: TEMPLATE,
|
||||
props: {
|
||||
column: Object
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user