Transaction Ledger Editor
In financial management applications like QuickBooks, users frequently interact with large datasets of transactions. An intuitive and efficient way to manage these records is through an editable data grid. This problem challenges you to build a simplified version of such a grid, focusing on in-place editing, data validation, and basic row management, crucial for a seamless user experience in data entry and reconciliation workflows.
Your goal is to implement a React component that renders an editable data grid for managing financial transactions.
id, date, description, amount, category).Enter or blurring the input field should save the changes and revert the cell to its display state.Escape should discard changes and revert the cell to its original display state.amount column must only accept valid numeric input. If an invalid value is entered, the cell should visually indicate an error state (e.g., red border), and the change should not be saved until fixed.date column should ideally accept a valid date format (e.g., YYYY-MM-DD). For simplicity, you can treat this as a string input but ensure it's not empty.id and default values for other fields (e.g., empty strings, 0 for amount).amount values at the bottom of the grid. This total should update dynamically as transactions are edited, added, or deleted.<input> element).amount field should show a distinct visual error (e.g., a red border on the input field).blur or Enter key press.Escape key press.amount field correctly validates for numeric input; invalid input prevents saving and shows an error.Constraints
Loading editor...