-
Notifications
You must be signed in to change notification settings - Fork 439
Feat/support cell values change #4976
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
Closed
Gino2333
wants to merge
25
commits into
VisActor:develop
from
Gino2333:feat/support_cell_values_change
Closed
Feat/support cell values change #4976
Gino2333
wants to merge
25
commits into
VisActor:develop
from
Gino2333:feat/support_cell_values_change
+2,197
−209
Conversation
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
允许 triggerEvent 参数接受 'change_cell_values' 字符串值,用于精确控制是否触发 CHANGE_CELL_VALUES 事件
为addRecord、addRecords、deleteRecords和updateRecords方法添加triggerEvent可选参数 当triggerEvent为false时,不触发对应的事件通知
…es_change Feat/support cell values change
添加syncRecordOperationsToSourceRecords配置选项,当设置为true时,表格的增删改操作会同步到原始records数组 修改DataSource类实现源数据同步逻辑,包括添加、删除和更新记录时对原始数据的处理 添加相关测试用例验证同步功能 在示例中添加同步选项的UI控制
refactor: 重命名 changeCellValuesByIds 为 changeCellValuesByRanges feat: 新增批量修改离散选区单元格值的接口 changeCellValuesByRanges feat: 增加 syncRecordOperationsToSourceRecords 配置支持筛选态数据同步 feat: 新增 CHANGE_CELL_VALUES 聚合事件及相关文档 docs: 更新接口文档和指南说明新增功能
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.
🤔 This is a ...
New feature
Bug fix
Performance optimization
Enhancement feature
TypeScript definition update
Test Case
Site / documentation update
Chore
Branch merge
🔗 Related issue link
https://github.com/VisActor/VTable/issues/4871(prepareEdit error)
https://github.com/VisActor/VTable/pull/4901(merge: support_cell_values_change)
💡 Background and solution
本 PR 汇总最近 22 次提交,聚焦在「数据操作能力增强 + 事件触发可控 + 过滤场景数据插入修复 + 搜索高亮性能优化」,并同步补齐类型/示例/测试与发布日志。
数据源同步能力增强:新增 syncRecordOperationsToSourceRecords ,支持把增删改等操作同步回传入的源 records(并在过滤生效时重建过滤/排序状态)。
表格数据操作事件可控: addRecord/addRecords/deleteRecords/updateRecords 增加 triggerEvent 控制是否触发对应事件( add_record/delete_record/update_record )。
单元格修改能力增强:
新增基于 recordIndex/field 的改单元格与批量改值 API: changeCellValueByRecord / changeCellValuesByRecords (并提供 changeCellValueBySource / changeCellValuesBySource 便捷调用)。
changeCellValue/changeCellValues/changeCellValuesByIds 增加 silentChangeCellValuesEvent ,用于抑制批量事件 change_cell_values (保留单点事件 change_cell_value )。
过滤场景修复:修复“过滤状态下新增记录位置错误”,并补充相应测试与示例覆盖。
搜索性能优化:SearchComponent 高亮更新改为批量写入自定义样式安排并按需刷新单元格内容,降低频繁搜索/跳转时的样式更新开销。
其他:修复编辑 prepareEdit 的时序/状态问题;更新 README / release log / rush changelog 等文档与变更记录。
📝 Changelog
Language Changelog 🇺🇸 English Enhance ListTable data operations: add syncRecordOperationsToSourceRecords , make record CRUD events optional via triggerEvent , introduce recordIndex-based cell update APIs, add silentChangeCellValuesEvent to suppress change_cell_values , fix wrong insert position under filtering, and optimize search highlight latency. Update typings, tests, examples, and docs/release logs. 🇨🇳 Chinese 增强 ListTable 数据操作能力:新增 syncRecordOperationsToSourceRecords 支持操作同步到源数据;增删改记录接口新增 triggerEvent 控制事件触发;新增基于 recordIndex 的单元格改值/批量改值 API,并新增 silentChangeCellValuesEvent 用于抑制 change_cell_values ;修复过滤状态下新增记录位置错误;优化搜索高亮更新延迟。同步更新类型、测试、示例与发布/文档记录。
☑️ Self-Check before Merge
Doc is updated/provided or not needed
Demo is updated/provided or not needed
TypeScript definition is updated/provided or not needed
Changelog is provided or not needed
🚀 Summary
copilot:summary
新增 syncRecordOperationsToSourceRecords ,支持将增删改同步回源 records,并在过滤场景下保持插入位置与视图一致
增删改记录 API 增加 triggerEvent ,可选择性触发 add_record/delete_record/update_record
新增基于 recordIndex 的改值 API(单个/批量),并新增 silentChangeCellValuesEvent 以抑制 change_cell_values
修复过滤状态下新增记录位置错误,补充对应测试与示例
优化搜索组件高亮更新路径,降低搜索/跳转时的样式刷新开销
🔍 Walkthrough
copilot:walkthrough
数据源层:为 add/delete/update 等操作增加“是否同步到源 records”的分支处理,并在过滤生效时做视图索引到原始索引的映射与状态重建。
表格 API 层:
记录增删改接口增加 triggerEvent ,只在需要时派发记录事件;
增加 recordIndex/field 维度的改单元格与批量改值能力,并提供自动刷新与事件静默选项;
原坐标改值接口支持 silentChangeCellValuesEvent ,减少批量事件带来的监听开销。
搜索组件:高亮更新改为批量安排自定义样式并按需刷新单元格内容,减少逐项调用带来的耗时。