Implement resolving math expressions, limited to addition, subtraction, multiplication and division. Closes #35
We should keep security in mind if we expand included functionality. Mathjs has a page on security here.
Modify setCell to update cell value in the UI if the cell's value is set to an expression
Implement resolving cell references (e.g. =A1+A2 -> =1+2 -> 3) within a single sheet
Add ExpressionHandler as a property to Sheet for now. It should probably be instantiated by SheetHolder once we implement that structure.
Points to consider in review:
To reflect cell formula changes, setCellValue was added to render.ts. This updates the cell's input field's value to the resolved value, which means the user can't edit the formula (#49). Is this good enough to merge?
Math.js is limited to basic math operations. This increases the dist file size to ~247kb/53kb from ~9kb/3kb. Is this small enough, or should we consider some other solution?
setCell
to update cell value in the UI if the cell's value is set to an expression=A1+A2
->=1+2
->3
) within a single sheetSheet
for now. It should probably be instantiated bySheetHolder
once we implement that structure.Points to consider in review:
setCellValue
was added torender.ts
. This updates the cell's input field's value to the resolved value, which means the user can't edit the formula (#49). Is this good enough to merge?