-
-
Notifications
You must be signed in to change notification settings - Fork 36
[Refactor] BaseSimpleTable wraps RenderTable for optional editing and validation #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: JonnyTran <4750391+JonnyTran@users.noreply.github.com>
… validation Co-authored-by: JonnyTran <4750391+JonnyTran@users.noreply.github.com>
…class constructors Co-authored-by: JonnyTran <4750391+JonnyTran@users.noreply.github.com>
|
@copilot please check that all other components that uses BaseSimpleTable is also updated and functioning correctly on playwright |
I've verified that all components using Components verified:
Test results:
All existing usages of Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
- Added wrapper logic to enable RenderTable when editable/tableJSON is used - Delegated API + events to internal RenderTable - Fixed emits and table-built lifecycle in RenderTable - Removed duplicated `.tabulator-container` styles - Ensured backward compatibility for simple read-only tables
SummaryThis commit refactors BaseSimpleTable to internally wrap RenderTable, allowing optional editing and validation while fully preserving the existing simple table API. Key Changes
OutcomeBaseSimpleTable now provides a unified, consistent table experience using a single underlying implementation (RenderTable) with optional editing and validation features. |
- Eliminated redundant event emissions for table updates and validation in RenderTable. - Cleaned up event handling in BaseSimpleTable to streamline communication with RenderTable.
|
@copilot Please simplify the Additionally don't use the tableJSON prop but consolidate to a single
Then, remove all unneeded emits, and ensure the unique column validator can be passed as a prop to BaseSimpleTable to use extralit/extralit-frontend/components/base/base-render-table/validatorUtils.ts Lines 13 to 20 in a191ef9
|
…prop, consolidate to data prop Co-authored-by: JonnyTran <4750391+JonnyTran@users.noreply.github.com>
Simplified in commit 31382e8:
Usage: <BaseSimpleTable :data="tableData" :columns="tableColumns" :editable="true" :validators="{ name: ['unique'] }" /> |
tableJSONprop - usedataprop consistentlyeditableprop directly to RenderTabletable-built,row-click,cell-edited,updateValidValuesvalidatorsprop for custom validators (likeunique)Summary of Changes
Props (BaseSimpleTable.vue)
data: Array- Table data rowscolumns: Array- Column definitions withfieldandtitleoptions: Object- Additional options (kept for compatibility)loading: Boolean- Loading stateeditable: Boolean(default: false) - Enables editing modevalidation: Object- Validation schemavalidators: Validators- Custom validators (e.g., unique validator)hasValidValues: Boolean- Validation statequestions: Question[]- Questions for extraction workflowUsage
Public API Methods
getData()- Get table datasetData(data)- Set table datagetRowCount()- Get row countgetColumns()- Get column definitionsvalidateTable(options)- Validate table dataredraw(force)- Redraw tableOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.