Added comments and minor refactoring

This commit is contained in:
2019-03-14 10:30:23 +01:00
parent 01da240f54
commit 4136da110f
15 changed files with 162 additions and 57 deletions

View File

@@ -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

View File

@@ -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 }

View File

@@ -1,10 +0,0 @@
const TEMPLATE =`
<div class="pillar-table-column"/>
`;
Vue.component('pillar-table-column', {
template: TEMPLATE,
props: {
column: Object
},
});