🐛 fix(data-grid): 修复当前页查找高亮残留并压缩旧版结果工具栏

- 当前页查找改为即时响应,清空或按 Esc 后立即取消高亮
- 查找渲染版本元数据改为可透传,避免高亮状态残留
- 旧版结果工具栏调整为紧凑单行布局并移除重复分页信息
- JSON 和文本视图隐藏当前页查找入口
This commit is contained in:
Syngnat
2026-05-31 13:33:46 +08:00
parent bea16b72df
commit e5fb03bbcd
7 changed files with 228 additions and 86 deletions

View File

@@ -114,4 +114,13 @@ describe('dataGridFind', () => {
expect(hasDataGridFindRenderVersionChanged(betaRows[0], alphaRows[0])).toBe(true);
expect(hasDataGridFindRenderVersionChanged(rows[0], alphaRows[0])).toBe(true);
});
it('keeps find render metadata on symbol keys while allowing wrapped rows to preserve it', () => {
const rows = [{ id: 1, name: 'Alpha' }];
const alphaRows = attachDataGridFindRenderVersion(rows, 'alpha');
expect(Object.keys(alphaRows[0])).toEqual(['id', 'name']);
expect(Object.getOwnPropertySymbols(alphaRows[0]).length).toBeGreaterThan(0);
expect(hasDataGridFindRenderVersionChanged(alphaRows[0], rows[0])).toBe(true);
});
});

View File

@@ -55,7 +55,7 @@ export const attachDataGridFindRenderVersion = <T>(rows: T[], query: string): T[
const nextRow = { ...(row as object) } as T;
Object.defineProperty(nextRow, DATA_GRID_FIND_RENDER_VERSION, {
value: normalizedQuery,
enumerable: false,
enumerable: true,
});
return nextRow;
});