界面:表格长文本列统一左对齐,保留名称与属性对齐

This commit is contained in:
2026-11-04 12:45:39 +08:00
parent 9f282baa95
commit 7357c309dd
13 changed files with 138 additions and 21 deletions
@@ -1,3 +1,4 @@
import { tableTextAlignment } from '../src/tableTextAlignment.ts';
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
@@ -157,8 +158,8 @@ test('export from the actual drawer keeps the clicked release even after current
});
function tableFixture(props) {
const code=read('QualityTable.tsx').slice(read('QualityTable.tsx').indexOf('type QualityTableProps')).replace('export function QualityTable','function QualityTable');
const renderer=hookRenderer(hooks=>new Function('React','useState','useContext','CompactManagementTables','AntdTable',transpile(`${code}\nreturn QualityTable;`))(React,hooks.useState,()=>false,{},'AntdTable'));
const code=read('QualityTable.tsx').slice(read('QualityTable.tsx').indexOf('function titleText')).replaceAll('export function ', 'function ');
const renderer=hookRenderer(hooks=>new Function('React','tableTextAlignment','isValidElement','useState','useContext','CompactManagementTables','AntdTable',transpile(`${code}\nreturn QualityTable;`))(React,tableTextAlignment,React.isValidElement,hooks.useState,()=>false,{},'AntdTable'));
return {render:()=>find(renderer.render(props),n=>n.type==='AntdTable').props,props};
}