, ...restLocale } =
locale || {};
+ const cardProps = typeof outerCardProps === 'boolean' ? {} : outerCardProps;
+ const proCardCls = getPrefixCls('pro-card', customizePrefixCls);
+
return tableWrapSSR(
lightFilterWrapSSR(
wrapSSR(
@@ -58,6 +67,29 @@ const ProTable: typeof AntProTable = ({
requiredMark: false,
...form,
}}
+ headerTitle={headerTitle}
+ options={options}
+ optionsRender={optionsRender}
+ toolbar={toolbar}
+ toolBarRender={toolBarRender}
+ cardProps={{
+ ...cardProps,
+ className: classNames(
+ {
+ [`${proCardCls}-has-title`]:
+ !!headerTitle ||
+ options ||
+ options === undefined ||
+ optionsRender ||
+ toolbar ||
+ toolBarRender,
+ [`${proCardCls}-no-divider`]: !cardProps?.headerBordered,
+ [`${proCardCls}-no-padding`]: true,
+ [`${proCardCls}-contain-tabs`]: !!cardProps?.tabs,
+ },
+ cardProps?.className
+ ),
+ }}
expandable={
expandable
? {
diff --git a/packages/ui/src/ProTable/style/index.ts b/packages/ui/src/ProTable/style/index.ts
index d1f92fc9e..ad92774a0 100644
--- a/packages/ui/src/ProTable/style/index.ts
+++ b/packages/ui/src/ProTable/style/index.ts
@@ -1,10 +1,12 @@
import type { CSSObject } from '@ant-design/cssinjs';
+import { Card } from '@oceanbase/design';
import type { GenerateStyle } from '@oceanbase/design/es/theme';
import { genComponentStyleHook } from '../../_util/genComponentStyleHook';
import type { OBToken } from '../../_util/genComponentStyleHook';
export const genProTableStyle: GenerateStyle
= (token: OBToken): CSSObject => {
const { antCls, componentCls, proComponentsCls } = token;
+ const proCardComponentCls = `${proComponentsCls}-card`;
return {
[`${componentCls}`]: {
[`${proComponentsCls}-query-filter-actions`]: {
@@ -13,6 +15,18 @@ export const genProTableStyle: GenerateStyle = (token: OBToken): CSSObj
flexDirection: 'row-reverse',
},
},
+ [`${proCardComponentCls}${proCardComponentCls}-no-padding`]: {
+ [`${proCardComponentCls}-body`]: {
+ paddingInline: 0,
+ [`${componentCls}-list-toolbar-container`]: {
+ paddingInline: token.paddingLG,
+ },
+ },
+ ...Card.genTableStyle(token.paddingLG, {
+ ...token,
+ componentCls: proCardComponentCls,
+ }),
+ },
},
};
};