feat: Table full-row inline editing with batch save - #4759
Draft
ernst-dev wants to merge 1 commit into
Draft
Conversation
Adds a row-level edit mode to the Table component via a new `rowEditingConfig` prop. When set, an action column is appended with Edit / Save / Cancel buttons per row. Clicking Edit puts all columns that have `editConfig` into edit state simultaneously; Save calls the new `submitRowEdit(item, newValues)\ callback with a Map of changed column values; Cancel reverts without saving. The existing per-cell immediate-save path (via `submitEdit`) is fully preserved and unaffected when `rowEditingConfig` is absent. New API surface: - `TableProps.rowEditingConfig` (RowEditingConfig<T>) - enables row mode - `TableProps.submitRowEdit` (SubmitRowEditFunction<T>) - batch save cb - `TableProps.RowEditingConfig.disabledReason` - per-row disable fn - `TableProps.AriaLabels.activateRowEditLabel` / cancelRowEditLabel / submitRowEditLabel / submittingRowEditText Closes #4181
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements row-level batch inline editing for the Table component, resolving #4181.
When
rowEditingConfigis set, an action column is appended to the table with an Edit button per row. Clicking Edit puts all columns that haveeditConfiginto edit state simultaneously. A single Save commits all changes via the newsubmitRowEdit(item, newValues)callback (receives the original item and aMap<columnKey, newValue>of changed cells). Cancel reverts without saving.The existing per-cell immediate-save path (
submitEdit) is fully preserved and unaffected.New API:
TableProps.rowEditingConfig(RowEditingConfig<T>) — enables row-edit mode; optionaldisabledReasonfn for per-row disableTableProps.submitRowEdit(SubmitRowEditFunction<T>) — batch save callback; return a Promise to show loading stateTableProps.AriaLabels:activateRowEditLabel,cancelRowEditLabel,submitRowEditLabel,submittingRowEditTextFiles changed:
src/table/interfaces.tsx— new typessrc/table/use-row-editing.ts— row-edit state hooksrc/table/row-editing/—RowEditActionCellcomponent + stylessrc/table/internal.tsx— wiringsrc/table/thead.tsx— action column headersrc/table/__tests__/table-row-edit.test.tsx— 8 unit tests (all passing)pages/table/row-edit.page.tsx— dev pageRelated links, issue #, if available: Closes #4181
How has this been tested?
src/table/__tests__/table-row-edit.test.tsx(all pass)table-editable.test.tsxtests still passpages/table/row-edit.page.tsxReview checklist
Correctness
rowEditingConfigis opt-in; existingsubmitEdit/ per-cell path unchanged.Security
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.