diff --git a/.dumi/theme/common/styles/Markdown.tsx b/.dumi/theme/common/styles/Markdown.tsx index b72a18278..3d2c507fe 100644 --- a/.dumi/theme/common/styles/Markdown.tsx +++ b/.dumi/theme/common/styles/Markdown.tsx @@ -3,10 +3,6 @@ import { css, Global } from '@emotion/react'; import React from 'react'; import useSiteToken from '../../../hooks/useSiteToken'; -console.log(new TinyColor('#8592AD').getAlpha()); - -console.log(new TinyColor('#5c6b8a').toRgb()); - const GlobalStyle: React.FC = () => { const { token } = useSiteToken(); diff --git a/packages/ui/src/ProTable/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/ProTable/__tests__/__snapshots__/index.test.tsx.snap index bee243afc..f356de140 100644 --- a/packages/ui/src/ProTable/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/ProTable/__tests__/__snapshots__/index.test.tsx.snap @@ -351,7 +351,7 @@ exports[`ProTable > ConfigProvider pagination should work 1`] = `
default pagination should work 1`] = `
render 1`] = `
, ...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, + }), + }, }, }; };