Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ant-design:master #33

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5ddec3a
chore: CI of PR welcome (#44184)
zombieJ Aug 11, 2023
56f2bc5
fix: (tabs)Unexpected color change in the click area of the mobile ta…
electroluxcode Aug 14, 2023
72b449a
docs: update faq (#44198)
zombieJ Aug 14, 2023
ee984fe
fix: Modal open should not block dropdown hidden (#44204)
zombieJ Aug 14, 2023
d1bd2d0
docs: Update recommendation (#44207)
afc163 Aug 14, 2023
e0e373f
fix(badge): fix badge number is rtl (#43998)
NotEvenANeko Aug 14, 2023
41cb8be
fix(DatePicker): optimize RangePicker's range area style (#44206)
kiner-tang Aug 14, 2023
16f0738
chore(deps-dev): bump lint-staged from 13.3.0 to 14.0.0 (#44212)
dependabot[bot] Aug 14, 2023
d493594
docs: fix menu sider-current demo (#44222)
MadCcc Aug 15, 2023
aff2bb7
chore: update pagination (#44226)
zombieJ Aug 15, 2023
9ec8534
docs(cascader): fix allowClear default value in doc (#44230)
zbw-zbw Aug 15, 2023
4fb448f
doc: upload doc line break (#44234)
1587315093 Aug 15, 2023
3f0e747
docs: fix theme editor page (#44232)
MadCcc Aug 15, 2023
8a65ad6
docs: fix font color (#44236)
MadCcc Aug 15, 2023
83e3b52
docs(Tabs): update animated prop's description (#44227)
kovsu Aug 15, 2023
a92a883
docs: render china mirror link before hydration (#44233)
afc163 Aug 16, 2023
9ba9da2
fix: ColorPicker HEX input cursor jump bug (#44137)
gouge666 Aug 16, 2023
808452e
fix(DataPicker):fix picker content is not centered (#44245)
Zian502 Aug 17, 2023
f1c38bf
site(Calendar): add lunar calendar demo (#44166)
kiner-tang Aug 17, 2023
3525966
docs: Update faq.zh-CN.md (#44274)
afc163 Aug 17, 2023
7179dc8
docs: update footer links (#44272)
afc163 Aug 17, 2023
73cfd37
fix: `Descriptions` key prop issue (#44278)
RedJue Aug 17, 2023
affd62f
chore(deps-dev): bump @testing-library/jest-dom from 5.17.0 to 6.0.0 …
dependabot[bot] Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .dumi/pages/theme-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ const CustomTheme = () => {
const storedConfig = localStorage.getItem(ANT_DESIGN_V5_THEME_EDITOR_THEME);
if (storedConfig) {
const themeConfig = JSON.parse(storedConfig);
const originThemeConfig = {
json: themeConfig,
text: undefined,
};
setThemeConfigContent(originThemeConfig);
setTheme(themeConfig);
}
}, []);
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/builtins/IconSearch/Category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Category: React.FC<CategoryProps> = (props) => {
const { icons, title, newIcons, theme } = props;
const intl = useIntl();
const [justCopied, setJustCopied] = React.useState<string | null>(null);
const copyId = React.useRef<NodeJS.Timeout | null>(null);
const copyId = React.useRef<ReturnType<typeof setTimeout> | null>(null);
const onCopied = React.useCallback((type: string, text: string) => {
message.success(
<span>
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/builtins/TokenCompare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';
import { TinyColor } from '@ctrl/tinycolor';
import { createStyles } from 'antd-style';
import tokenMeta from 'antd/es/version/token-meta.json';
import { theme, Space } from 'antd';
import { Space, theme } from 'antd';
import useLocale from '../../../hooks/useLocale';

const useStyle = createStyles(({ token, css }) => {
Expand All @@ -29,7 +29,7 @@ const useStyle = createStyles(({ token, css }) => {
display: flex;
align-items: center;
justify-content: center;

color: rgba(0,0,0,0.88);
border-right: 1px solid rgba(0, 0, 0, 0.1);
`,

Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/layouts/DocLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const DocLayout: React.FC = () => {
const location = useLocation();
const { pathname, search, hash } = location;
const [locale, lang] = useLocale(locales);
const timerRef = useRef<NodeJS.Timeout | null>(null);
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const { direction } = useContext(SiteContext);
const { loading } = useSiteData();

Expand Down
8 changes: 4 additions & 4 deletions .dumi/theme/slots/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const Footer: React.FC = () => {
items: [
{
title: 'Ant Design Charts',
url: 'https://charts.ant.design',
url: isZhCN ? 'https://ant-design-charts.antgroup.com' : 'https://charts.ant.design',
openExternal: true,
},
{
Expand All @@ -117,12 +117,12 @@ const Footer: React.FC = () => {
},
{
title: 'Ant Design Mobile',
url: 'https://mobile.ant.design',
url: isZhCN ? 'https://ant-design-mobile.antgroup.com/zh' : 'https://mobile.ant.design',
openExternal: true,
},
{
title: 'Ant Design Mini',
url: 'https://mini.ant.design',
url: isZhCN ? 'https://ant-design-mini.antgroup.com/' : 'https://mini.ant.design',
openExternal: true,
},
{
Expand Down Expand Up @@ -338,7 +338,7 @@ const Footer: React.FC = () => {
/>
),
title: 'AntV',
url: 'https://antv.vision',
url: 'https://antv.antgroup.com',
description: <FormattedMessage id="app.footer.antv.slogan" />,
openExternal: true,
},
Expand Down
39 changes: 29 additions & 10 deletions .dumi/theme/slots/Header/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const locales = {

// ============================= Style =============================
const useStyle = createStyles(({ token }) => {
const { antCls, iconCls, fontFamily, headerHeight, menuItemBorder, colorPrimary } = token;
const { antCls, iconCls, fontFamily, headerHeight, menuItemBorder, colorPrimary, colorText } =
token;

return {
nav: css`
Expand All @@ -56,6 +57,17 @@ const useStyle = createStyles(({ token }) => {
left: 12px;
border-width: ${menuItemBorder}px;
}

a {
color: ${colorText};
}

a:before {
position: absolute;
inset: 0;
background-color: transparent;
content: "";
}
}

& ${antCls}-menu-submenu-title ${iconCls} {
Expand Down Expand Up @@ -97,7 +109,6 @@ const useStyle = createStyles(({ token }) => {

export interface NavigationProps extends SharedProps {
isMobile: boolean;
isClient: boolean;
responsive: null | 'narrow' | 'crowded';
directionText: string;
onLangChange: () => void;
Expand All @@ -106,7 +117,6 @@ export interface NavigationProps extends SharedProps {

export default ({
isZhCN,
isClient,
isMobile,
responsive,
directionText,
Expand Down Expand Up @@ -224,16 +234,21 @@ export default ({
),
key: 'docs/resources',
},
isZhCN &&
isClient &&
window.location.host !== 'ant-design.antgroup.com' &&
window.location.host !== 'ant-design.gitee.io'
isZhCN
? {
label: '国内镜像',
label: (
<a href="https://ant-design.antgroup.com" target="_blank" rel="noreferrer">
国内镜像
</a>
),
key: 'mirror',
children: [
{
label: <a href="https://ant-design.antgroup.com">官方镜像</a>,
label: (
<a href="https://ant-design.antgroup.com" target="_blank" rel="noreferrer">
官方镜像
</a>
),
icon: (
<img
alt="logo"
Expand All @@ -245,7 +260,11 @@ export default ({
key: 'antgroup',
},
{
label: <a href="https://ant-design.gitee.io">Gitee 镜像</a>,
label: (
<a href="https://ant-design.gitee.io" target="_blank" rel="noreferrer">
Gitee 镜像
</a>
),
icon: (
<img
alt="gitee"
Expand Down
5 changes: 1 addition & 4 deletions .dumi/theme/slots/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ interface HeaderState {

// ================================= Header =================================
const Header: React.FC = () => {
const [isClient, setIsClient] = React.useState(false);
const [, lang] = useLocale();

const { pkg } = useSiteData();
Expand All @@ -139,7 +138,7 @@ const Header: React.FC = () => {
searching: false,
});
const { direction, isMobile, updateSiteConfig } = useContext<SiteContextProps>(SiteContext);
const pingTimer = useRef<NodeJS.Timeout | null>(null);
const pingTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
const location = useLocation();
const { pathname, search } = location;

Expand All @@ -166,7 +165,6 @@ const Header: React.FC = () => {
}, [location]);

useEffect(() => {
setIsClient(typeof window !== 'undefined');
onWindowResize();
window.addEventListener('resize', onWindowResize);
pingTimer.current = ping((status) => {
Expand Down Expand Up @@ -273,7 +271,6 @@ const Header: React.FC = () => {
const sharedProps: SharedProps = {
isZhCN,
isRTL,
isClient,
};

const navigationNode = (
Expand Down
1 change: 0 additions & 1 deletion .dumi/theme/slots/Header/interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export interface SharedProps {
isZhCN: boolean;
isRTL: boolean;
isClient: boolean;
}
28 changes: 28 additions & 0 deletions .github/workflows/pr-contributor-welcome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 当 PR 被合并时,留言欢迎加入共建群
name: PullRequest Contributor Welcome

on:
pull_request_target:
types:
- closed
paths:
- 'components/**'

jobs:
check-merged:
runs-on: ubuntu-latest
needs: read-file
if: github.event.pull_request.merged == true
steps:
- uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🎉 Thanks for contribution. Please feel free to join DingTalk Social Community (Provide the PR link please).

🎉 感谢参与贡献,欢迎扫码加入钉钉社区(进群后请提供 PR 地址)。

<img src="https://github.com/ant-design/ant-design/assets/5378891/e24c6080-bf38-4523-b1cd-f6c43ad7375f" height="200" />

<!-- WELCOME_CONTRIBUTION -->
body-include: '<!-- WELCOME_CONTRIBUTION -->'
2 changes: 1 addition & 1 deletion components/_util/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ActionButton: React.FC<ActionButtonProps> = (props) => {
};

React.useEffect(() => {
let timeoutId: NodeJS.Timer | null = null;
let timeoutId: ReturnType<typeof setTimeout> | null = null;
if (autoFocus) {
timeoutId = setTimeout(() => {
buttonRef.current?.focus();
Expand Down
2 changes: 1 addition & 1 deletion components/affix/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class InternalAffix extends React.Component<InternalAffixProps, AffixState> {

private fixedNodeRef = createRef<HTMLDivElement>();

private timer: NodeJS.Timeout | null;
private timer: ReturnType<typeof setTimeout> | null;

context: ConfigConsumerProps;

Expand Down
32 changes: 18 additions & 14 deletions components/avatar/__tests__/__snapshots__/demo-extend.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ exports[`renders components/avatar/demo/badge.tsx extend context correctly 1`] =
data-show="true"
title="1"
>
<span
class="ant-scroll-number-only"
style="transition: none;"
>
<bdi>
<span
class="ant-scroll-number-only-unit current"
class="ant-scroll-number-only"
style="transition: none;"
>
1
<span
class="ant-scroll-number-only-unit current"
>
1
</span>
</span>
</span>
</bdi>
</sup>
</span>
</div>
Expand Down Expand Up @@ -531,16 +533,18 @@ Array [
data-show="true"
title="1"
>
<span
class="ant-scroll-number-only"
style="transition: none;"
>
<bdi>
<span
class="ant-scroll-number-only-unit current"
class="ant-scroll-number-only"
style="transition: none;"
>
1
<span
class="ant-scroll-number-only-unit current"
>
1
</span>
</span>
</span>
</bdi>
</sup>
</span>
</div>
Expand Down
32 changes: 18 additions & 14 deletions components/avatar/__tests__/__snapshots__/demo.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ exports[`renders components/avatar/demo/badge.tsx correctly 1`] = `
data-show="true"
title="1"
>
<span
class="ant-scroll-number-only"
style="transition:none"
>
<bdi>
<span
class="ant-scroll-number-only-unit current"
class="ant-scroll-number-only"
style="transition:none"
>
1
<span
class="ant-scroll-number-only-unit current"
>
1
</span>
</span>
</span>
</bdi>
</sup>
</span>
</div>
Expand Down Expand Up @@ -438,16 +440,18 @@ Array [
data-show="true"
title="1"
>
<span
class="ant-scroll-number-only"
style="transition:none"
>
<bdi>
<span
class="ant-scroll-number-only-unit current"
class="ant-scroll-number-only"
style="transition:none"
>
1
<span
class="ant-scroll-number-only-unit current"
>
1
</span>
</span>
</span>
</bdi>
</sup>
</span>
</div>
Expand Down
22 changes: 13 additions & 9 deletions components/badge/ScrollNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,19 @@ const ScrollNumber = React.forwardRef<HTMLElement, ScrollNumberProps>((props, re
if (count && Number(count) % 1 === 0) {
const numberList = String(count).split('');

numberNodes = numberList.map((num, i) => (
<SingleNumber
prefixCls={prefixCls}
count={Number(count)}
value={num}
// eslint-disable-next-line react/no-array-index-key
key={numberList.length - i}
/>
));
numberNodes = (
<bdi>
{numberList.map((num, i) => (
<SingleNumber
prefixCls={prefixCls}
count={Number(count)}
value={num}
// eslint-disable-next-line react/no-array-index-key
key={numberList.length - i}
/>
))}
</bdi>
);
}

// allow specify the border
Expand Down
Loading
Loading