Skip to content

Commit

Permalink
Merge branch 'master' into master-merge-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan committed Oct 15, 2023
2 parents 442e175 + cd3e30e commit 0de095c
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .dumi/hooks/useLayoutState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { startTransition, useState } from 'react';

const useLayoutState = <S>(
const useLayoutState: typeof useState = <S>(
...args: Parameters<typeof useState<S>>
): ReturnType<typeof useState<S>> => {
const [state, setState] = useState<S>(...args);
Expand Down
2 changes: 1 addition & 1 deletion .dumi/pages/index/components/Theme/ThemePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function ThemePicker(props: ThemePickerProps) {
onChange?.(theme);
}}
>
<input type="radio" name="theme" id={index === 0 ? id : null} />
<input type="radio" name="theme" id={index === 0 ? id : undefined} />
<img src={url} alt={theme} />
</label>
<span>{locale[theme as keyof typeof locale]}</span>
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/common/Color/ColorStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Global, css } from '@emotion/react';
import { useTheme } from 'antd-style';

const gray = {
const gray: { [key: number]: string } = {
1: '#fff',
2: '#fafafa',
3: '#f5f5f5',
Expand All @@ -25,7 +25,7 @@ const ColorStyle = () => {
if (index <= 10) {
return `
.palette-${color}-${index} {
background: ${token[`${color}-${index}`]};
background: ${(token as any)[`${color}-${index}`]};
}
${makePalette(color, index + 1)}
`;
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/common/DirectionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const ltrD =
const rtlD =
'M256 64l512 0 0 128-128 0 0 768-128 0 0-768-128 0 0 768-128 0 0-448c-123.712 0-224-100.288-224-224s100.288-224 224-224zM960 896l-256-224 256-224z';

const DirectionIcon: React.FC<{ direction: DirectionType }> = (props) => (
const DirectionIcon: React.FC<{ direction: DirectionType; className?: string }> = (props) => (
<Icon {...props}>
<svg viewBox="0 0 1024 1024" fill="currentColor">
<path d={props.direction === 'ltr' ? ltrD : rtlD} />
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/layouts/GlobalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getAlgorithm = (themes: ThemeName[] = []) =>
}
return null;
})
.filter((item) => item);
.filter((item) => item) as typeof antdTheme.darkAlgorithm[];

const GlobalLayout: React.FC = () => {
const outlet = useOutlet();
Expand Down Expand Up @@ -109,7 +109,7 @@ const GlobalLayout: React.FC = () => {
setSiteState({
theme: _theme,
direction: _direction === 'rtl' ? 'rtl' : 'ltr',
bannerVisible: storedBannerVisibleLastTime ? storedBannerVisible : true,
bannerVisible: storedBannerVisibleLastTime ? !!storedBannerVisible : true,
});
// Handle isMobile
updateMobileMode();
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/layouts/ResourceLayout/AffixTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const AffixTabs: React.FC = () => {
const containerRef = React.useRef<HTMLDivElement>(null);
const idsRef = React.useRef<string[]>([]);
const [loaded, setLoaded] = React.useState(false);
const [fixedId, setFixedId] = React.useState<string | null>(null);
const [fixedId, setFixedId] = React.useState<string | undefined>(undefined);

const {
styles: { affixTabs, affixTabsFixed, span },
Expand Down Expand Up @@ -100,7 +100,7 @@ const AffixTabs: React.FC = () => {
}
}

setFixedId(null);
setFixedId(undefined);
}

return throttle(doSync);
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/slots/Header/More.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Community: React.FC = () => {
);
};

export const getEcosystemGroup = (): MenuProps['items'] => [
export const getEcosystemGroup = (): Exclude<MenuProps['items'], undefined> => [
{
label: (
<a href="https://charts.ant.design" target="_blank" rel="noopener noreferrer">
Expand Down
3 changes: 2 additions & 1 deletion .dumi/theme/slots/Header/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ export default ({
label: (
<Link
to={utils.getLocalizedPathname(
blogList.sort((a, b) => (a.frontmatter.date > b.frontmatter.date ? -1 : 1))[0].link,
blogList.sort((a, b) => (a.frontmatter?.date > b.frontmatter?.date ? -1 : 1))[0]
.link,
isZhCN,
search,
)}
Expand Down
1 change: 1 addition & 0 deletions .dumi/theme/slots/Header/SwitchBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface LangBtnProps {
value: 1 | 2;
pure?: boolean;
onClick?: React.MouseEventHandler;
['aria-label']?: string;
}

const BASE_SIZE = '1.2em';
Expand Down
5 changes: 5 additions & 0 deletions .dumi/theme/slots/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const locales = {
shortMessage: '支付宝语雀 · 大学生公益计划火热进行中!',
more: '了解更多',
},
en: {
message: '',
shortMessage: '',
more: '',
},
};

const useStyle = createStyles(({ token, css }) => {
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ tag: vVERSION

---

## 5.10.1

`2023-10-15`

- ⚡️ Optimize CSS-in-JS Design Token cache matching. [#45302](https://github.com/ant-design/ant-design/pull/45302)
- 🆕 Checkbox.Group &amp; Radio.Group `options` add missing `id` props. [#45287](https://github.com/ant-design/ant-design/pull/45287)
- 🐞 Fix Affix that `target` not work. [#45314](https://github.com/ant-design/ant-design/pull/45314) [@mingming-ma](https://github.com/mingming-ma)
- 🐞 MISC: Add `csp` attribute for icon style. [#45334](https://github.com/ant-design/ant-design/pull/45334) [@AlexeyTeterin](https://github.com/AlexeyTeterin)
- 🐞 Fix Button that does not display loading status when `loading` property is set to `{ delay: 0 }`. [#45282](https://github.com/ant-design/ant-design/pull/45282) [@YDFlame13](https://github.com/YDFlame13)
- 🐞 Fix Segmented text jump issue in Safari. [#45310](https://github.com/ant-design/ant-design/pull/45310)
- 🐞 Fix Watermark that can be hidden via "Hide Element" feature in browser. [#45290](https://github.com/ant-design/ant-design/pull/45290) [@Yuiai01](https://github.com/Yuiai01)
- 🐞 Fix Input that background should not be transparent when hovered or focused. [#45297](https://github.com/ant-design/ant-design/pull/45297) [@MadCcc](https://github.com/MadCcc)
- 🐞 Fix Form call `resetFields` will still keep Form.List field when its `initialValue` is set. [#45284](https://github.com/ant-design/ant-design/pull/45284)
- 🐞 Fix Tree.DirectoryTree `selectedNodes` in `onSelect` method could not get a value when configuring `fieldNames`. [#45036](https://github.com/ant-design/ant-design/pull/45036) [@Zian502](https://github.com/Zian502)
- 💄 Revert outline style of Input, InputNumber, Select, Cascader, TreeSelect, DatePicker, TimePicker, ColorPicker. [#45286](https://github.com/ant-design/ant-design/pull/45286) [@MadCcc](https://github.com/MadCcc)
- 💄 Fix Card style with small size Tabs. [#45272](https://github.com/ant-design/ant-design/pull/45272) [@MadCcc](https://github.com/MadCcc)

## 5.10.0

`2023-10-10`
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ tag: vVERSION

---

## 5.10.1

`2023-10-15`

- ⚡️ 优化 CSS-in-JS Design Token 缓存命中性能。[#45302](https://github.com/ant-design/ant-design/pull/45302)
- 🆕 为 Checkbox.Group 与 Radio.Group 的 `options` 添加 `id` 属性支持。[#45287](https://github.com/ant-design/ant-design/pull/45287)
- 🐞 修复 Affix 组件设置 `target` 失效的问题。[#45314](https://github.com/ant-design/ant-design/pull/45314) [@mingming-ma](https://github.com/mingming-ma)
- 🐞 MISC: 为图标样式设置 `csp` 属性。[#45334](https://github.com/ant-design/ant-design/pull/45334) [@AlexeyTeterin](https://github.com/AlexeyTeterin)
- 🐞 修复 Button 组件 `loading` 属性设置为 `{ delay: 0 }` 时不显示加载状态。[#45282](https://github.com/ant-design/ant-design/pull/45282) [@YDFlame13](https://github.com/YDFlame13)
- 🐞 修复 Segmented 在 Safari 下切换时的样式跳动问题。[#45310](https://github.com/ant-design/ant-design/pull/45310)
- 🐞 修复 Watermark可以使用浏览器的 `Hide Element` 来隐藏水印。[#45290](https://github.com/ant-design/ant-design/pull/45290) [@Yuiai01](https://github.com/Yuiai01)
- 🐞 修复 Input 组件 hover 或者 focus 状态时背景色变为透明的问题。[#45297](https://github.com/ant-design/ant-design/pull/45297) [@MadCcc](https://github.com/MadCcc)
- 🐞 修复 Form 在调用 `resetFields` 时,无法重置配置了 `initialValue` 的 Form.List 的问题。[#45284](https://github.com/ant-design/ant-design/pull/45284)
- 🐞 修复 Tree.DirectoryTree 在配置 `fieldNames` 时,`onSelect` 方法中的 `selectedNodes` 无法获取值。[#45036](https://github.com/ant-design/ant-design/pull/45036) [@Zian502](https://github.com/Zian502)
- 💄 回滚 Input、InputNumber、Select、Cascader、TreeSelect、DatePicker、TimePicker、ColorPicker 的描边样式。[#45286](https://github.com/ant-design/ant-design/pull/45286) [@MadCcc](https://github.com/MadCcc)
- 💄 修复 Card 搭配小尺寸 Tabs 时的样式问题。[#45272](https://github.com/ant-design/ant-design/pull/45272) [@MadCcc](https://github.com/MadCcc)

## 5.10.0

`2023-10-10`
Expand Down
2 changes: 1 addition & 1 deletion docs/react/use-custom-date-library.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You might want to use another date library (**Ant design currently supports [mom

The first way is to use `generatePicker` (or `generateCalendar`) to help create Picker components.

First, we initialize an antd demo with `create-react-app`. You can refer to [Use in TypeScript](/docs/react/use-in-typescript), or you can start directly here [init antd](https://github.com/xiaohuoni/antd4-generate-picker/commit/47fec964e36d48bd15760f8f5abcb9655c259aa6)
First, we initialize an antd demo with `create-react-app`. You can refer to [Usage with create-react-app](/docs/react/use-with-create-react-app), or you can start directly here [init antd](https://github.com/xiaohuoni/antd4-generate-picker/commit/47fec964e36d48bd15760f8f5abcb9655c259aa6)

### DatePicker.tsx

Expand Down
2 changes: 1 addition & 1 deletion docs/react/use-custom-date-library.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Ant Design 默认使用 [Day.js](https://day.js.org) 来处理时间日期问题

第一种方法是使用 `generatePicker`(或 `generateCalendar`)辅助创建 Picker 组件。

我们先初始化一个 `create-react-app` 的 antd demo,你可以参考 [TypeScript 中使用](/docs/react/use-in-typescript) 进行构建,也可以直接从这里开始[init antd](https://github.com/xiaohuoni/antd4-generate-picker/commit/47fec964e36d48bd15760f8f5abcb9655c259aa6)
我们先初始化一个 `create-react-app` 的 antd demo,你可以参考 [create-react-app 中使用](/docs/react/use-with-create-react-app-cn) 进行构建,也可以直接从这里开始[init antd](https://github.com/xiaohuoni/antd4-generate-picker/commit/47fec964e36d48bd15760f8f5abcb9655c259aa6)

### DatePicker.tsx

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "antd",
"version": "5.10.0",
"version": "5.10.1",
"packageManager": "^[email protected]",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('site test', () => {
server = createServer({ root: join(process.cwd(), '_site') });
server.listen(port);
// eslint-disable-next-line no-console
console.log('site static server run: http://localhost:3000');
console.log(`site static server run: http://localhost:${port}`);
});

afterAll(() => {
Expand Down

0 comments on commit 0de095c

Please sign in to comment.