UNPKG

@platform/ui.datagrid

Version:

Isolated tabular DataGrid.

20 lines (19 loc) 626 B
import { func } from '../../common'; export function calc(args) { const { grid, getFunc } = args; const refsTable = grid.refsTable; const getCells = async () => grid.data.cells; const table = func.table({ getCells, getFunc, refsTable }); const changes = async (args = {}) => { const { cells } = args; const res = await table.calculate({ cells }); return res; }; const update = async (args = {}) => { const { cells } = args; const res = await changes({ cells }); grid.changeCells(res.map); return res; }; return { changes, update }; }