diff --git a/components/card/__tests__/index.test.tsx b/components/card/__tests__/index.test.tsx
index 9508eb909f..461503955e 100644
--- a/components/card/__tests__/index.test.tsx
+++ b/components/card/__tests__/index.test.tsx
@@ -132,6 +132,17 @@ describe('Card', () => {
expect(cardRef.current).toHaveClass('ant-card');
});
+ it('should show tab when tabList is empty', () => {
+ const { container } = render(
+
+ Card content
+ ,
+ );
+
+ expect(container.querySelector('.ant-tabs')).toBeTruthy();
+ expect(container.querySelector('.ant-tabs-nav-add')).toBeTruthy();
+ });
+
it('correct pass tabList props', () => {
const { container } = render(
Date: Fri, 7 Jul 2023 18:28:13 +0800
Subject: [PATCH 6/9] site: optimization type & props (#43433)
* chore: optimization type & props
* fix: remove useless type
---
.dumi/theme/builtins/Previewer/index.tsx | 5 ++---
.dumi/theme/common/ThemeSwitch/index.tsx | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/.dumi/theme/builtins/Previewer/index.tsx b/.dumi/theme/builtins/Previewer/index.tsx
index b3785af952..a37144956f 100644
--- a/.dumi/theme/builtins/Previewer/index.tsx
+++ b/.dumi/theme/builtins/Previewer/index.tsx
@@ -1,7 +1,6 @@
-import type { FC } from 'react';
-import React from 'react';
import type { IPreviewerProps } from 'dumi';
import { useTabMeta } from 'dumi';
+import React from 'react';
import CodePreviewer from './CodePreviewer';
import DesignPreviewer from './DesignPreviewer';
@@ -9,7 +8,7 @@ export interface AntdPreviewerProps extends IPreviewerProps {
originDebug?: IPreviewerProps['debug'];
}
-const Previewer: FC = ({ ...props }) => {
+const Previewer: React.FC = (props) => {
const tab = useTabMeta();
if (tab?.frontmatter.title === 'Design') {
diff --git a/.dumi/theme/common/ThemeSwitch/index.tsx b/.dumi/theme/common/ThemeSwitch/index.tsx
index 69895928f8..e17d2b4ebd 100644
--- a/.dumi/theme/common/ThemeSwitch/index.tsx
+++ b/.dumi/theme/common/ThemeSwitch/index.tsx
@@ -14,7 +14,7 @@ export type ThemeSwitchProps = {
onChange: (value: ThemeName[]) => void;
};
-const ThemeSwitch: React.FC = (props: ThemeSwitchProps) => {
+const ThemeSwitch: React.FC = (props) => {
const { value = ['light'], onChange } = props;
const { token } = useSiteToken();
const { pathname, search } = useLocation();
From 7d9429ba759f13cedca7aee6bd9328aaf5fd0ab9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?ZhuoYang=20Wu=28=E9=98=BF=E7=A6=BB=29?=
Date: Fri, 7 Jul 2023 18:58:20 +0800
Subject: [PATCH 7/9] fix: TreeSelect selected item not fit dropdown width
(#43413)
Co-authored-by: thinkasany <117748716+thinkasany@users.noreply.github.com>
---
components/tree-select/style/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/tree-select/style/index.ts b/components/tree-select/style/index.ts
index 61f15b0e8b..ab1319ebd6 100644
--- a/components/tree-select/style/index.ts
+++ b/components/tree-select/style/index.ts
@@ -30,7 +30,7 @@ const genBaseStyle: GenerateStyle = (token) => {
{
[treeCls]: {
borderRadius: 0,
- '&-list-holder-inner': {
+ [`${treeCls}-list-holder-inner`]: {
alignItems: 'stretch',
[`${treeCls}-treenode`]: {
From 2f0c82f59d439c8ebef517c0c422097b08e23152 Mon Sep 17 00:00:00 2001
From: Jomorx <95688556+Jomorx@users.noreply.github.com>
Date: Fri, 7 Jul 2023 18:58:54 +0800
Subject: [PATCH 8/9] fix: Slider tooltip text not align center (#43430)
* style: support centering text in tooltip in slider
* fix: formatting code
---
components/slider/style/index.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/components/slider/style/index.tsx b/components/slider/style/index.tsx
index d166ff3673..d75dc28257 100644
--- a/components/slider/style/index.tsx
+++ b/components/slider/style/index.tsx
@@ -57,7 +57,7 @@ interface SliderToken extends FullToken<'Slider'> {
// =============================== Base ===============================
const genBaseStyle: GenerateStyle = (token) => {
- const { componentCls, controlSize, dotSize, marginFull, marginPart, colorFillContentHover } =
+ const { componentCls, antCls, controlSize, dotSize, marginFull, marginPart, colorFillContentHover } =
token;
return {
@@ -256,6 +256,10 @@ const genBaseStyle: GenerateStyle = (token) => {
cursor: `not-allowed !important`,
},
},
+
+ [`&-tooltip ${antCls}-tooltip-inner`]:{
+ minWidth: "unset",
+ },
},
};
};
From 9b03ce476da059a92d66f93072b71c2644d43cb9 Mon Sep 17 00:00:00 2001
From: thinkasany <117748716+thinkasany@users.noreply.github.com>
Date: Fri, 7 Jul 2023 21:42:26 +0800
Subject: [PATCH 9/9] type: remove unnecessary code (#43439)
---
components/button/button-group.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx
index d38df65ab8..f9644f40f2 100644
--- a/components/button/button-group.tsx
+++ b/components/button/button-group.tsx
@@ -1,9 +1,9 @@
import classNames from 'classnames';
import * as React from 'react';
+import warning from '../_util/warning';
import { ConfigContext } from '../config-provider';
import type { SizeType } from '../config-provider/SizeContext';
import { useToken } from '../theme/internal';
-import warning from '../_util/warning';
export interface ButtonGroupProps {
size?: SizeType;
@@ -13,7 +13,7 @@ export interface ButtonGroupProps {
children?: React.ReactNode;
}
-export const GroupSizeContext = React.createContext(undefined);
+export const GroupSizeContext = React.createContext(undefined);
const ButtonGroup: React.FC = (props) => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);