界面:表格长文本列统一左对齐,保留名称与属性对齐
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user