From 4f06ebcdd2b77dffdc0007a6e5510f9ba45c4f8b Mon Sep 17 00:00:00 2001 From: Katherine Date: Tue, 29 Apr 2025 11:07:17 +0800 Subject: [PATCH] style: optimize subtable add button style and align paginator on the same row (#6790) --- .../antd/association-field/SubTable.tsx | 71 +++++++++++-------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx b/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx index 53225b028c..ace49b127e 100644 --- a/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx @@ -70,6 +70,15 @@ const subTableContainer = css` .ant-table-thead .ant-table-cell { font-weight: normal; } + .ant-pagination { + position: absolute; + right: 0px; + bottom: 0px; + } + .ant-table-footer { + margin-top: 10px; + background: inherit; + } `; const tableClassName = css` @@ -252,37 +261,39 @@ export const SubTable: any = observer( locale={{ emptyText: {field.editable ? t('Please add or select record') : t('No data')}, }} + footer={() => ( +
+ {field.editable && ( + + {allowAddnew !== false && ( + + {t('Add new')} + + } + /> + )} + {allowSelectExistingRecord && ( + + {t('Select record')} + + } + /> + )} + + )} +
+ )} /> - {field.editable && ( - - {allowAddnew !== false && ( - - {t('Add new')} - - } - /> - )} - {allowSelectExistingRecord && ( - - {t('Select record')} - - } - /> - )} - - )}