HM-71. Доработки таблицы логов. Универсальной таблице добавлена возможность переопределять рендер строк и заголовков (#31)
This commit is contained in:
15
src/components/client-logs-table/ClientLogsTable.js
Normal file
15
src/components/client-logs-table/ClientLogsTable.js
Normal file
@ -0,0 +1,15 @@
|
||||
import Table from '../table';
|
||||
import {LOG_COLS, LOG_TYPE} from '../../consts';
|
||||
import ClientLogsTableRow from './ClientLogsTableRow';
|
||||
|
||||
class ClientLogsTable extends Table {
|
||||
constructor () {
|
||||
super(null, LOG_COLS[LOG_TYPE.CLIENT]);
|
||||
}
|
||||
|
||||
renderRow = (parentNode, cols, row) => {
|
||||
return new ClientLogsTableRow(parentNode, cols, row);
|
||||
}
|
||||
}
|
||||
|
||||
export default ClientLogsTable;
|
||||
12
src/components/client-logs-table/ClientLogsTableRow.js
Normal file
12
src/components/client-logs-table/ClientLogsTableRow.js
Normal file
@ -0,0 +1,12 @@
|
||||
import Component from '../component';
|
||||
import TableCellOverflow from '../table-cell-overflow';
|
||||
|
||||
class ClientLogsTableRow extends Component {
|
||||
constructor (parentNode, cols, row) {
|
||||
super(null, parentNode);
|
||||
|
||||
this.cols = cols.map((col) => new TableCellOverflow(this.mainNode, row[col.id]));
|
||||
}
|
||||
}
|
||||
|
||||
export default ClientLogsTableRow;
|
||||
3
src/components/client-logs-table/index.js
Normal file
3
src/components/client-logs-table/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import ClientLogsTable from './ClientLogsTable';
|
||||
|
||||
export default ClientLogsTable;
|
||||
Reference in New Issue
Block a user