free table infrastructure

This commit is contained in:
Jan Prochazka
2020-10-25 09:31:00 +01:00
parent 857f3fb4f7
commit c80510c37b
14 changed files with 211 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
import { FreeTableModel } from '@dbgate/datalib';
import Grider, { GriderRowStatus } from '../datagrid/Grider';
export default class FreeTableGrider extends Grider {
public model: FreeTableModel;
public rows: any[];
constructor(public modelState, public dispatchModel) {
super();
this.model = modelState && modelState.value;
this.rows = this.model.rows;
}
getRowData(index: any) {
return this.rows[index];
}
get rowCount() {
return this.rows.length;
}
static factory({ modelState, dispatchModel }): FreeTableGrider {
return new FreeTableGrider(modelState, dispatchModel);
}
static factoryDeps({ modelState, dispatchModel }) {
return [modelState, dispatchModel];
}
}