refactor: set small as table default size (#5755)

This commit is contained in:
Katherine 2024-11-29 22:39:20 +08:00 committed by GitHub
parent 0e019d1317
commit d77b4aa36d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 4 deletions

View File

@ -202,7 +202,7 @@ export const tableBlockSettings = new SchemaSettings({
}, null);
return {
title: t('Table size'),
value: schema?.['x-component-props']?.size || 'middle',
value: schema?.['x-component-props']?.size || 'small',
options: [
{ label: t('Large'), value: 'large' },
{ label: t('Middle'), value: 'middle' },

View File

@ -64,7 +64,7 @@ const subTableContainer = css`
`;
const tableClassName = css`
.ant-formily-item.ant-formily-item-feedback-layout-loose {
.ant-formily-item-feedback-layout-popover {
margin-bottom: 0px !important;
}
.ant-formily-editable {
@ -201,7 +201,6 @@ export const SubTable: any = observer(
<SubFormProvider value={{ value: null, collection, fieldSchema: fieldSchema.parent, skip: true }}>
<Table
className={tableClassName}
bordered
size={'small'}
field={field}
showIndex

View File

@ -683,7 +683,7 @@ export const Table: any = withDynamicSchemaProps(
} = { ...others1, ...others2 } as any;
const field = useArrayField(others);
const schema = useFieldSchema();
const { size = 'middle' } = schema?.['x-component-props'] || {};
const { size = 'small' } = schema?.['x-component-props'] || {};
const collection = useCollection();
const isTableSelector = schema?.parent?.['x-decorator'] === 'TableSelectorProvider';
const ctx = isTableSelector ? useTableSelectorContext() : useTableBlockContext();