chore: auto merge branches (#41114)

chore: merge master into feature
This commit is contained in:
github-actions[bot] 2023-03-08 03:06:59 +00:00 committed by GitHub
commit 3a4fd2652b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 536 additions and 72 deletions

View File

@ -99,7 +99,13 @@ const Overview: React.FC = () => {
const { search: urlSearch } = useLocation();
const { locale, formatMessage } = useIntl();
const [search, setSearch] = useState<string>('');
const [search, setSearch] = useState<string>(() => {
const params = new URLSearchParams(urlSearch);
if (params.has('s')) {
return params.get('s');
}
return '';
});
const sectionRef = useRef<HTMLElement>(null);

View File

@ -1,8 +1,7 @@
import type { FC } from 'react';
import React, { useEffect, useRef } from 'react';
import G6 from '@antv/g6';
import { createStyles, css } from 'antd-style';
import { useRouteMeta } from 'dumi';
import React, { useEffect, useRef } from 'react';
G6.registerNode('behavior-start-node', {
draw: (cfg, group) => {
@ -242,26 +241,26 @@ const useStyle = createStyles(() => ({
display: flex;
align-items: center;
&::before {
content: '';
display: block;
width: 8px;
height: 8px;
margin-right: 8px;
background-color: #1677ff;
border-radius: 50%;
margin-right: 8px;
content: '';
}
`,
extension: css`
display: flex;
align-items: center;
&::before {
content: '';
display: block;
width: 8px;
height: 8px;
background-color: #A0A0A0;
border-radius: 50%;
margin-right: 8px;
background-color: #a0a0a0;
border-radius: 50%;
content: '';
}
`,
}));
@ -270,7 +269,7 @@ export type BehaviorMapProps = {
data: BehaviorMapItem;
};
const BehaviorMap: FC<BehaviorMapProps> = ({ data }) => {
const BehaviorMap: React.FC<BehaviorMapProps> = ({ data }) => {
const ref = useRef<HTMLDivElement>(null);
const { styles } = useStyle();
const meta = useRouteMeta();

View File

@ -1,5 +1,5 @@
import classnames from 'classnames';
import React from 'react';
import cls from 'classnames';
import Palette from './Palette';
const colors = [
@ -79,11 +79,8 @@ const colors = [
const ColorPalettes: React.FC<{ dark?: boolean }> = (props) => {
const { dark } = props;
const colorCls = cls('color-palettes', {
'color-palettes-dark': !!dark,
});
return (
<div className={colorCls}>
<div className={classnames('color-palettes', { 'color-palettes-dark': dark })}>
{colors.map((color) => (
<Palette key={color.name} color={color} dark={dark} showTitle />
))}

View File

@ -1,8 +1,7 @@
import type { FC } from 'react';
import React, { useEffect } from 'react';
import { message } from 'antd';
import CopyToClipboard from 'react-copy-to-clipboard';
import { presetDarkPalettes } from '@ant-design/colors';
import { message } from 'antd';
import React, { useEffect } from 'react';
import CopyToClipboard from 'react-copy-to-clipboard';
const rgbToHex = (rgbString: string): string => {
const rgb = rgbString.match(/\d+/g);
@ -21,22 +20,20 @@ interface PaletteProps {
dark?: boolean;
color?: {
name: string;
count: number;
count?: number;
description?: string;
english?: string;
chinese?: string;
};
}
const Palette: FC<PaletteProps> = ({
showTitle,
direction,
dark,
color: { name, count = 10, description, english, chinese } = {
name: 'gray',
count: 13,
},
}) => {
const Palette: React.FC<PaletteProps> = (props) => {
const {
showTitle,
direction,
dark,
color: { name, count = 10, description, english, chinese } = { name: 'gray', count: 13 },
} = props;
const [hexColors, setHexColors] = React.useState<Record<PropertyKey, string>>({});
const colorNodesRef = React.useRef<Record<PropertyKey, HTMLDivElement>>({});

View File

@ -290,7 +290,7 @@ const GlobalDemoStyles: React.FC = () => {
transition: transform 0.24s;
&${iconCls}-check {
color: ${token['green-6']} !important;
color: ${token.green6} !important;
font-weight: bold;
}
}
@ -342,11 +342,11 @@ const GlobalDemoStyles: React.FC = () => {
}
&-debug {
border-color: ${token['purple-3']};
border-color: ${token.purple3};
}
&-debug &-title a {
color: ${token['purple-6']};
color: ${token.purple6};
}
}

View File

@ -340,7 +340,7 @@ export default () => {
&:nth-child(3) {
width: 22%;
color: ${token['magenta-7']};
color: ${token.magenta7};
font-size: ${Math.max(token.fontSize - 1, 12)}px;
}

View File

@ -57,10 +57,10 @@ const useStyle = () => {
box-sizing: border-box;
.toc-debug {
color: ${token['purple-6']};
color: ${token.purple6};
&:hover {
color: ${token['purple-5']};
color: ${token.purple5};
}
}

View File

@ -10,6 +10,7 @@ on:
- 3.x-stable
- 4.x-stable
create:
workflow_dispatch:
permissions:
contents: read

View File

@ -15,6 +15,41 @@ timeline: true
---
## 5.3.0
`2023-03-06`
- 🆕 Tooltip support `arrow.pointAtCenter` and deprecate `arrow.arrowPointAtCenter`. [#40989](https://github.com/ant-design/ant-design/pull/40989) [@MadCcc](https://github.com/MadCcc)
- 🆕 Progress support custom `size`. [#40903](https://github.com/ant-design/ant-design/pull/40903) [@kiner-tang](https://github.com/kiner-tang)
- 🆕 Tour support custom `zIndex`. [#40982](https://github.com/ant-design/ant-design/pull/40982) [@kiner-tang](https://github.com/kiner-tang)
- 🆕 Table `onHeaderCell` support customize `colSpan` and `rowSpan`. [#40885](https://github.com/ant-design/ant-design/pull/40885)
- 🆕 Image.Group support `onChange` callback. [#40857](https://github.com/ant-design/ant-design/pull/40857) [@kiner-tang](https://github.com/kiner-tang)
- App
- 🆕 App support `style` props. [#40708](https://github.com/ant-design/ant-design/pull/40708) [@li-jia-nan](https://github.com/li-jia-nan)
- 🆕 App support `message` and `notification` options. [#40458](https://github.com/ant-design/ant-design/pull/40458) [@luo3house](https://github.com/luo3house)
- 🆕 ConfigProvider support `useConfig` hook to get `size` and `disabled` in context. [#40215](https://github.com/ant-design/ant-design/pull/40215) [@xliez](https://github.com/xliez)
- 🆕 Breadcrumb support `items` prop. [#40543](https://github.com/ant-design/ant-design/pull/40543) [@heiyu4585](https://github.com/heiyu4585)
- 🛠 Breadcrumb separators are unified into `li` elements. [#40887](https://github.com/ant-design/ant-design/pull/40887) [@heiyu4585](https://github.com/heiyu4585)
- 🛠 Tooltip support auto arrow position &amp; adjust position if possible. `destroyTooltipOnHide.keepParent` is deprecated since it will be always auto destroy unnecessary container now. [#40632](https://github.com/ant-design/ant-design/pull/40632)
- 🛠 Rename preset colors in token, .e.g `blue-1` to `blue1`, and deprecate tokens before. [#41071](https://github.com/ant-design/ant-design/pull/41071)
- 💄 Message use `colorText` in style. [#41047](https://github.com/ant-design/ant-design/pull/41047) [@Yuiai01](https://github.com/Yuiai01)
- 💄 Fix Select, TreeSelect, Cascader popup align position not correct when parent has `transform: scale` style. [#41013](https://github.com/ant-design/ant-design/pull/41013)
- 💄 Optimize `rowScope` style for Table. [#40304](https://github.com/ant-design/ant-design/pull/40304) [@Yuiai01](https://github.com/Yuiai01)
- 💄 Provide new AliasToken `lineWidthFocus` for `outline-width` of focused component. [#40840](https://github.com/ant-design/ant-design/pull/40840) [@MadCcc](https://github.com/MadCcc)
- 💄 WeekPicker support hover style. [#40772](https://github.com/ant-design/ant-design/pull/40772)
- 💄 Adjust Select, TreeSelect, Cascader always show the `arrow` by default when multiple. [#41028](https://github.com/ant-design/ant-design/pull/41028)
- 🐞 Fix Form `Form.Item.useStatus` problem with sever-side-rendering. [#40977](https://github.com/ant-design/ant-design/pull/40977) [@AndyBoat](https://github.com/AndyBoat)
- 🐞 Fix arrow shape in some components. [#40971](https://github.com/ant-design/ant-design/pull/40971) [@MadCcc](https://github.com/MadCcc)
- 🐞 Fix Layout throw `React does not recognize the `suffixCls` prop on a DOM element` warning. [#40969](https://github.com/ant-design/ant-design/pull/40969)
- 🐞 Fix Watermark that text will be displayed when the picture loads abnormally. [#40770](https://github.com/ant-design/ant-design/pull/40770) [@OriginRing](https://github.com/OriginRing)
- 🐞 Image support flip function in preview mode. Fix Image `fallback` when used in ssr. [#40660](https://github.com/ant-design/ant-design/pull/40660)
- 🐞 Fix Typography component is not centered in the Select component. [#40422](https://github.com/ant-design/ant-design/pull/40422) [@Yuiai01](https://github.com/Yuiai01)
- 🌐 Update locale `vi_VN` adding Vietnamese translation for Form component validation. [#40992](https://github.com/ant-design/ant-design/pull/40992) [@lamvananh](https://github.com/lamvananh)
- RTL
- 💄 FloatButton support `rtl` mode. [#40990](https://github.com/ant-design/ant-design/pull/40990) [@li-jia-nan](https://github.com/li-jia-nan)
- TypeScript
- 🤖 Fix Cascader that generics should not be necessary. [#40961](https://github.com/ant-design/ant-design/pull/40961) [@crazyair](https://github.com/crazyair)
## 5.2.3
`2023-02-27`

View File

@ -15,6 +15,41 @@ timeline: true
---
## 5.3.0
`2023-03-06`
- 🆕 Tooltip 组件新增 `arrow.pointAtCenter` 废弃 `arrow.arrowPointAtCenter`。[#40989](https://github.com/ant-design/ant-design/pull/40989) [@MadCcc](https://github.com/MadCcc)
- 🆕 Progress 组件支持自定义 `size`。[#40903](https://github.com/ant-design/ant-design/pull/40903) [@kiner-tang](https://github.com/kiner-tang)
- 🆕 Tour 组件支持自定义 `zIndex`。[#40982](https://github.com/ant-design/ant-design/pull/40982) [@kiner-tang](https://github.com/kiner-tang)
- 🆕 Table `onHeaderCell` 支持自定义 `colSpan``rowSpan`。[#40885](https://github.com/ant-design/ant-design/pull/40885)
- 🆕 Image.Group 支持 `onChange` 回调。[#40857](https://github.com/ant-design/ant-design/pull/40857) [@kiner-tang](https://github.com/kiner-tang)
- App
- 🆕 App 支持自定义 `style`。[#40708](https://github.com/ant-design/ant-design/pull/40708) [@li-jia-nan](https://github.com/li-jia-nan)
- 🆕 App 提供预先配置 `message`、`notification` 的选项。[#40458](https://github.com/ant-design/ant-design/pull/40458) [@luo3house](https://github.com/luo3house)
- 🆕 ConfigProvider 新增 `useConfig` 以获取上下文中的 `size``disabled`。[#40215](https://github.com/ant-design/ant-design/pull/40215) [@xliez](https://github.com/xliez)
- 🆕 Breadcrumb 支持 `items` 数据驱动。[#40543](https://github.com/ant-design/ant-design/pull/40543) [@heiyu4585](https://github.com/heiyu4585)
- 🛠 Breadcrumb 分隔符统一为 `li` 元素。[#40887](https://github.com/ant-design/ant-design/pull/40887) [@heiyu4585](https://github.com/heiyu4585)
- 🛠 Tooltip 现在自动调整自身以及箭头位置以更好的展示。同时废弃 `destroyTooltipOnHide.keepParent`,现在总是会自动销毁不需要的容器。[#40632](https://github.com/ant-design/ant-design/pull/40632)
- 🛠 重命名 token 中的预设颜色,如 `blue-1` 变为 `blue1`,废弃原有的 token。[#41071](https://github.com/ant-design/ant-design/pull/41071)
- 💄 Message 组件使用 `colorText` 优化样式。[#41047](https://github.com/ant-design/ant-design/pull/41047) [@Yuiai01](https://github.com/Yuiai01)
- 💄 修复 Select, TreeSelect, Cascader 父元素存在 `transform: scale` 样式时的对齐问题。[#41013](https://github.com/ant-design/ant-design/pull/41013)
- 💄 优化 Table 中 `rowScope` 的样式。[#40304](https://github.com/ant-design/ant-design/pull/40304) [@Yuiai01](https://github.com/Yuiai01)
- 💄 为组件聚焦时的 `outline` 提供新的 AliasToken `lineWidthFocus`。[#40840](https://github.com/ant-design/ant-design/pull/40840) [@MadCcc](https://github.com/MadCcc)
- 💄 WeekPicker 支持鼠标悬浮样式。[#40772](https://github.com/ant-design/ant-design/pull/40772)
- 💄 调整 Select, TreeSelect, Cascader 在多选时总是默认显示下拉箭头。[#41028](https://github.com/ant-design/ant-design/pull/41028)
- 🐞 修复 Form 组件 `Form.Item.useStatus` 导致的服务端渲染问题。[#40977](https://github.com/ant-design/ant-design/pull/40977) [@AndyBoat](https://github.com/AndyBoat)
- 🐞 修复部分组件箭头形状问题。[#40971](https://github.com/ant-design/ant-design/pull/40971) [@MadCcc](https://github.com/MadCcc)
- 🐞 修复 Layout 报错 `React does not recognize the `suffixCls` prop on a DOM element` 的问题。[#40969](https://github.com/ant-design/ant-design/pull/40969)
- 🐞 修复 Watermark 组件图片加载异常时的问题,默认展示文字。[#40770](https://github.com/ant-design/ant-design/pull/40770) [@OriginRing](https://github.com/OriginRing)
- 🐞 Image 预览新增图片翻转功能。并修复 Image `fallback` 在 ssr 下失效的问题。[#40660](https://github.com/ant-design/ant-design/pull/40660)
- 🐞 修复 Select 中使用 Typography 不居中的问题。[#40422](https://github.com/ant-design/ant-design/pull/40422) [@Yuiai01](https://github.com/Yuiai01)
- 🌐 完善 Form 的 `vi_VN` 语言包。[#40992](https://github.com/ant-design/ant-design/pull/40992) [@lamvananh](https://github.com/lamvananh)
- RTL
- 💄 修复 FloatButton 不支持 `rtl` 模式的问题。[#40990](https://github.com/ant-design/ant-design/pull/40990) [@li-jia-nan](https://github.com/li-jia-nan)
- TypeScript
- 🤖 修复 Cascader 泛型为非必传。[#40961](https://github.com/ant-design/ant-design/pull/40961) [@crazyair](https://github.com/crazyair)
## 5.2.3
`2023-02-27`

View File

@ -130,7 +130,7 @@ const Page: React.FC = () => {
</Select>
<DatePicker />
<TimePicker />
<RangePicker style={{ width: 200 }} />
<RangePicker />
</Space>
<Space wrap>
<Button type="primary" onClick={showModal}>

View File

@ -180744,9 +180744,9 @@ exports[`Locale Provider should display the text as ko 1`] = `
</span>
<span
class="ant-select-selection-item"
title="10 / "
title="10 / 페이지"
>
10 /
10 / 페이지
</span>
</div>
<span

View File

@ -109,7 +109,7 @@ const genColorStyle: GenerateStyle<PopoverToken> = (token) => {
return {
[componentCls]: PresetColors.map((colorKey: keyof PresetColorType) => {
const lightColor = token[`${colorKey}-6`];
const lightColor = token[`${colorKey}6`];
return {
[`&${componentCls}-${colorKey}`]: {
'--antd-arrow-background-color': lightColor,

View File

@ -10,13 +10,13 @@ group:
order: 5
---
Components that can convert links into QR codes, and support custom color and logo. Available since `antd@5.1.0`.
Components that can convert text into QR codes, and support custom color and logo. Available since `antd@5.1.0`.
<Alert message="If the QR code cannot be scanned for identification, it may be because the link address is too long, which leads to too dense pixels. You can configure the QR code to be larger through `size`, or shorten the link through short link services."></Alert>
## When To Use
Used when the link needs to be converted into a QR Code.
Used when the text needs to be converted into a QR Code.
## Examples
@ -36,7 +36,7 @@ Used when the link needs to be converted into a QR Code.
| Property | Description | Type | Default |
| :-- | :-- | :-- | :-- |
| value | scanned link | string | - |
| value | scanned text | string | - |
| icon | include image url (only image link are supported) | string | - |
| size | QRCode size | number | 128 |
| iconSize | include image size | number | 32 |

View File

@ -11,13 +11,13 @@ group:
order: 5
---
能够将链接转换生成二维码的组件,支持自定义配色和 Logo 配置,自 `antd@5.1.0` 版本开始提供该组件。
能够将文本转换生成二维码的组件,支持自定义配色和 Logo 配置,自 `antd@5.1.0` 版本开始提供该组件。
<Alert message="若二维码无法扫码识别,可能是因为链接地址过长导致像素过于密集,可以通过 `size` 配置二维码更大,或者通过短链接服务等方式将链接变短。"></Alert>
## 何时使用
当需要将链接转换成为二维码时使用。
当需要将文本转换成为二维码时使用。
## 代码演示
@ -37,7 +37,7 @@ group:
| 参数 | 说明 | 类型 | 默认值 |
| :-- | :-- | :-- | :-- |
| value | 扫描后的地址 | string | - |
| value | 扫描后的文本 | string | - |
| icon | 二维码中图片的地址(目前只支持图片地址) | string | - |
| size | 二维码大小 | number | 160 |
| iconSize | 二维码中图片的大小 | number | 40 |

View File

@ -1,7 +1,7 @@
import StarFilled from '@ant-design/icons/StarFilled';
import classNames from 'classnames';
import RcRate from 'rc-rate';
import type { RateProps as RcRateProps } from 'rc-rate/lib/Rate';
import type { RateProps as RcRateProps, RateRef } from 'rc-rate/lib/Rate';
import * as React from 'react';
import { ConfigContext } from '../config-provider';
import Tooltip from '../tooltip';
@ -16,7 +16,7 @@ interface RateNodeProps {
index: number;
}
const Rate = React.forwardRef<unknown, RateProps>((props, ref) => {
const Rate = React.forwardRef<RateRef, RateProps>((props, ref) => {
const {
prefixCls,
className,

View File

@ -126,7 +126,7 @@ export default genComponentStyleHook('Rate', (token) => {
const { colorFillContent } = token;
const rateToken = mergeToken<RateToken>(token, {
rateStarColor: token['yellow-6'],
rateStarColor: token.yellow6,
rateStarSize: token.controlHeightLG * 0.5,
rateStarHoverScale: 'scale(1.1)',
defaultColor: colorFillContent,

View File

@ -4090,6 +4090,189 @@ exports[`renders ./components/select/demo/optgroup.tsx extend context correctly
</div>
`;
exports[`renders ./components/select/demo/option-label-center.tsx extend context correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center"
style="flex-wrap:wrap;margin-bottom:-8px"
>
<div
class="ant-space-item"
style="padding-bottom:8px"
>
<div
class="ant-select ant-select-single ant-select-allow-clear ant-select-show-arrow"
style="width:120px"
>
<div
class="ant-select-selector"
>
<span
class="ant-select-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
</span>
<span
class="ant-select-selection-item"
title="long, long, long piece of text"
>
long, long, long piece of text
</span>
</div>
<div
class="ant-select-dropdown ant-select-dropdown-placement-bottomLeft"
style="left:-1000vw;top:-1000vh;box-sizing:border-box"
>
<div>
<div
id="undefined_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
>
<div
aria-selected="false"
id="undefined_list_0"
role="option"
>
long
</div>
<div
aria-selected="false"
id="undefined_list_1"
role="option"
>
short
</div>
</div>
<div
class="rc-virtual-list"
style="position:relative"
>
<div
class="rc-virtual-list-holder"
style="max-height:256px;overflow-y:auto;overflow-anchor:none"
>
<div>
<div
class="rc-virtual-list-holder-inner"
style="display:flex;flex-direction:column"
>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option ant-select-item-option-active"
>
<div
class="ant-select-item-option-content"
>
<article
class="ant-typography"
>
long, long, long piece of text
</article>
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
</div>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option"
>
<div
class="ant-select-item-option-content"
>
<article
class="ant-typography"
>
short
</article>
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span
aria-hidden="true"
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="down"
class="anticon anticon-down ant-select-suffix"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
<span
aria-hidden="true"
class="ant-select-clear"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close-circle"
class="anticon anticon-close-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="close-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
`;
exports[`renders ./components/select/demo/option-label-prop.tsx extend context correctly 1`] = `
<div
class="ant-select ant-select-multiple ant-select-show-arrow ant-select-show-search"

View File

@ -1718,6 +1718,105 @@ exports[`renders ./components/select/demo/optgroup.tsx correctly 1`] = `
</div>
`;
exports[`renders ./components/select/demo/option-label-center.tsx correctly 1`] = `
<div
class="ant-space ant-space-horizontal ant-space-align-center"
style="flex-wrap:wrap;margin-bottom:-8px"
>
<div
class="ant-space-item"
style="padding-bottom:8px"
>
<div
class="ant-select ant-select-single ant-select-allow-clear ant-select-show-arrow"
style="width:120px"
>
<div
class="ant-select-selector"
>
<span
class="ant-select-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-select-selection-search-input"
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
</span>
<span
class="ant-select-selection-item"
title="long, long, long piece of text"
>
long, long, long piece of text
</span>
</div>
<span
aria-hidden="true"
class="ant-select-arrow"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="down"
class="anticon anticon-down ant-select-suffix"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
<span
aria-hidden="true"
class="ant-select-clear"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close-circle"
class="anticon anticon-close-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="close-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
`;
exports[`renders ./components/select/demo/option-label-prop.tsx correctly 1`] = `
<div
class="ant-select ant-select-multiple ant-select-show-arrow ant-select-show-search"

View File

@ -0,0 +1,7 @@
## zh-CN
选项文本居中
## en-US
Options label Centered.

View File

@ -0,0 +1,18 @@
import React from 'react';
import { Select, Space, Typography } from 'antd';
const App: React.FC = () => (
<Space wrap>
<Select
defaultValue="long, long, long piece of text"
style={{ width: 120 }}
allowClear
options={[
{ value: 'long', label: <Typography>long, long, long piece of text</Typography> },
{ value: 'short', label: <Typography>short</Typography> },
]}
/>
</Space>
);
export default App;

View File

@ -42,6 +42,7 @@ Select component to select value from options.
<code src="./demo/placement.tsx">Placement</code>
<code src="./demo/debug.tsx" debug>4.0 Debug</code>
<code src="./demo/render-panel.tsx" debug>\_InternalPanelDoNotUseOrYouWillBeFired</code>
<code src="./demo/option-label-center.tsx" debug>Options label Centered</code>
## API

View File

@ -43,6 +43,7 @@ demo:
<code src="./demo/placement.tsx">弹出位置</code>
<code src="./demo/debug.tsx" debug>4.0 Debug</code>
<code src="./demo/render-panel.tsx" debug>\_InternalPanelDoNotUseOrYouWillBeFired</code>
<code src="./demo/option-label-center.tsx" debug>选项文本居中</code>
## API

View File

@ -114,6 +114,10 @@ const genSingleStyle: GenerateStyle<SelectToken> = (token) => {
'&-content': {
flex: 'auto',
...textEllipsis,
'> *': {
...textEllipsis,
},
},
'&-state': {

View File

@ -144,6 +144,11 @@ const genBaseStyle: GenerateStyle<SelectToken> = (token) => {
flex: 1,
fontWeight: 'normal',
...textEllipsis,
'> *': {
lineHeight: 'inherit',
...textEllipsis,
},
},
// ======================= Placeholder =======================

View File

@ -22,10 +22,10 @@ export function genPresetColor<Token extends TokenWithCommonCls<AliasToken>>(
genCss: GenCSS,
): CSSObject {
return PresetColors.reduce((prev: CSSObject, colorKey: PresetColorKey) => {
const lightColor = token[`${colorKey}-1`];
const lightBorderColor = token[`${colorKey}-3`];
const darkColor = token[`${colorKey}-6`];
const textColor = token[`${colorKey}-7`];
const lightColor = token[`${colorKey}1`];
const lightBorderColor = token[`${colorKey}3`];
const darkColor = token[`${colorKey}6`];
const textColor = token[`${colorKey}7`];
return {
...prev,

View File

@ -9,7 +9,12 @@ export type OverrideToken = {
export type GlobalToken = AliasToken & ComponentTokenMap;
export { PresetColors } from './presetColors';
export type { PresetColorType, ColorPalettes, PresetColorKey } from './presetColors';
export type {
PresetColorType,
ColorPalettes,
LegacyColorPalettes,
PresetColorKey,
} from './presetColors';
export type { SeedToken } from './seeds';
export type {
MapToken,

View File

@ -1,4 +1,4 @@
import type { ColorPalettes } from '../presetColors';
import type { ColorPalettes, LegacyColorPalettes } from '../presetColors';
import type { SeedToken } from '../seeds';
import type { SizeMapToken, HeightMapToken } from './size';
import type { ColorMapToken } from './colors';
@ -24,6 +24,7 @@ export interface CommonMapToken extends StyleMapToken {
export interface MapToken
extends SeedToken,
LegacyColorPalettes,
ColorPalettes,
ColorMapToken,
SizeMapToken,

View File

@ -20,6 +20,13 @@ export type PresetColorType = Record<PresetColorKey, string>;
type ColorPaletteKeyIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
export type ColorPalettes = {
export type LegacyColorPalettes = {
/**
* @deprecated
*/
[key in `${keyof PresetColorType}-${ColorPaletteKeyIndex}`]: string;
};
export type ColorPalettes = {
[key in `${keyof PresetColorType}${ColorPaletteKeyIndex}`]: string;
};

View File

@ -1,6 +1,12 @@
import { generate } from '@ant-design/colors';
import type { DerivativeFunc } from '@ant-design/cssinjs';
import type { ColorPalettes, MapToken, PresetColorType, SeedToken } from '../../interface';
import type {
ColorPalettes,
LegacyColorPalettes,
MapToken,
PresetColorType,
SeedToken,
} from '../../interface';
import { defaultPresetColors } from '../seed';
import genColorMapToken from '../shared/genColorMapToken';
import { generateColorPalettes, generateNeutralColorPalettes } from './colors';
@ -13,6 +19,7 @@ const derivative: DerivativeFunc<SeedToken, MapToken> = (token, mapToken) => {
return new Array(10).fill(1).reduce((prev, _, i) => {
prev[`${colorKey}-${i + 1}`] = colors[i];
prev[`${colorKey}${i + 1}`] = colors[i];
return prev;
}, {}) as ColorPalettes;
})
@ -22,7 +29,7 @@ const derivative: DerivativeFunc<SeedToken, MapToken> = (token, mapToken) => {
...cur,
};
return prev;
}, {} as ColorPalettes);
}, {} as ColorPalettes & LegacyColorPalettes);
const mergedMapToken = mapToken ?? defaultAlgorithm(token);

View File

@ -1,7 +1,13 @@
import { generate } from '@ant-design/colors';
import genControlHeight from '../shared/genControlHeight';
import genSizeMapToken from '../shared/genSizeMapToken';
import type { ColorPalettes, MapToken, PresetColorType, SeedToken } from '../../interface';
import type {
ColorPalettes,
LegacyColorPalettes,
MapToken,
PresetColorType,
SeedToken,
} from '../../interface';
import { defaultPresetColors } from '../seed';
import genColorMapToken from '../shared/genColorMapToken';
import genCommonMapToken from '../shared/genCommonMapToken';
@ -15,8 +21,9 @@ export default function derivative(token: SeedToken): MapToken {
return new Array(10).fill(1).reduce((prev, _, i) => {
prev[`${colorKey}-${i + 1}`] = colors[i];
prev[`${colorKey}${i + 1}`] = colors[i];
return prev;
}, {}) as ColorPalettes;
}, {}) as ColorPalettes & LegacyColorPalettes;
})
.reduce((prev, cur) => {
prev = {
@ -24,7 +31,7 @@ export default function derivative(token: SeedToken): MapToken {
...cur,
};
return prev;
}, {} as ColorPalettes);
}, {} as ColorPalettes & LegacyColorPalettes);
return {
...token,

View File

@ -38,7 +38,7 @@ demo:
| mask | 是否启用蒙层,也可传入配置改变蒙层样式和填充色 | `boolean \| { style?: React.CSSProperties; color?: string; }` | `true` | |
| type | 类型,影响底色与文字颜色 | `default` \| `primary` | `default` | |
| open | 打开引导 | `boolean` | - | |
| onChange | 步骤改变时的回调current 为当前的步骤 | `(current: number) => void` | - | |
| onChange | 步骤改变时的回调current 为当前的步骤 | `(current: number) => void` | - | |
| current | 当前处于哪一步 | `number` | - | |
| scrollIntoViewOptions | 是否支持当前元素滚动到视窗内,也可传入配置指定滚动视窗的相关参数 | `boolean \| ScrollIntoViewOptions` | `true` | 5.2.0 |
| indicatorsRender | 自定义指示器 | `(current: number, total: number) => ReactNode` | - | 5.2.0 |

View File

@ -116,7 +116,9 @@ const InternalUpload: React.ForwardRefRenderFunction<unknown, UploadProps> = (pr
changeInfo.event = event;
}
onChange?.(changeInfo);
flushSync(() => {
onChange?.(changeInfo);
});
};
const mergedBeforeUpload = async (file: RcFile, fileListArgs: RcFile[]) => {

View File

@ -580,7 +580,7 @@ exports[`renders ./components/upload/demo/drag.tsx extend context correctly 1`]
<p
class="ant-upload-hint"
>
Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files
Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files.
</p>
</div>
</span>

View File

@ -580,7 +580,7 @@ exports[`renders ./components/upload/demo/drag.tsx correctly 1`] = `
<p
class="ant-upload-hint"
>
Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files
Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files.
</p>
</div>
</span>

View File

@ -7,7 +7,7 @@ import type { RcFile, UploadFile, UploadProps } from '..';
import Upload from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import { fireEvent, render, waitFakeTimer, act } from '../../../tests/utils';
import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils';
import Form from '../../form';
import { resetWarned } from '../../_util/warning';
import { getFileItem, isImageUrl, removeFileItem } from '../utils';
@ -946,4 +946,51 @@ describe('Upload', () => {
}),
);
});
it('prevent auto batch in control mode', async () => {
const mockFile1 = new File(['bamboo'], 'bamboo.png', { type: 'image/png' });
const mockFile2 = new File(['light'], 'light.png', { type: 'image/png' });
const customRequest = jest.fn(async (options) => {
// stop here to make sure new fileList has been set and passed to Upload
// eslint-disable-next-line no-promise-executor-return
await new Promise((resolve) => setTimeout(resolve, 0));
options.onProgress({ percent: 0 });
const url = Promise.resolve<string>('https://ant.design');
options.onProgress({ percent: 100 });
options.onSuccess({}, { ...options.file, url });
});
let fileListOut: UploadProps['fileList'] = [];
const Demo: React.FC = () => {
const [fileList, setFileList] = React.useState<UploadFile[]>([]);
const onChange: UploadProps['onChange'] = async (e) => {
const newFileList = Array.isArray(e) ? e : e.fileList;
setFileList(newFileList);
fileListOut = newFileList;
};
return (
<Upload customRequest={customRequest} onChange={onChange} fileList={fileList}>
<button type="button">Upload</button>
</Upload>
);
};
const { container } = render(<Demo />);
fireEvent.change(container.querySelector<HTMLInputElement>('input')!, {
target: { files: [mockFile1, mockFile2] },
});
// React 18 is async now
await waitFakeTimer();
fileListOut.forEach((file) => {
expect(file.status).toBe('done');
});
});
});

View File

@ -32,8 +32,8 @@ const App: React.FC = () => (
</p>
<p className="ant-upload-text">Click or drag file to this area to upload</p>
<p className="ant-upload-hint">
Support for a single or bulk upload. Strictly prohibit from uploading company data or other
band files
Support for a single or bulk upload. Strictly prohibited from uploading company data or other
banned files.
</p>
</Dragger>
);

View File

@ -1,6 +1,6 @@
---
title: How to Grow as a Collaborator
date: 2022-12-08
date: 2022-12-22
author: heiyu4585
---

View File

@ -1,6 +1,6 @@
---
title: 如何成长为 Collaborator
date: 2022-12-08
date: 2022-12-22
author: heiyu4585
---

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "5.2.3",
"version": "5.3.0",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -134,10 +134,10 @@
"rc-menu": "~9.8.2",
"rc-motion": "^2.6.1",
"rc-notification": "~5.0.0",
"rc-pagination": "~3.2.0",
"rc-pagination": "~3.3.0",
"rc-picker": "~3.2.4",
"rc-progress": "~3.4.1",
"rc-rate": "~2.9.0",
"rc-rate": "~2.10.0",
"rc-resize-observer": "^1.2.0",
"rc-segmented": "~2.1.2",
"rc-select": "~14.3.0",
@ -217,7 +217,7 @@
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-unicorn": "^45.0.0",
"eslint-plugin-unicorn": "^46.0.0",
"fast-glob": "^3.2.11",
"fetch-jsonp": "^1.1.3",
"fs-extra": "^11.0.0",