mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
feat: 更新 Image 组件以支持 rootClassName 属性,增强 OTP 组件以支持 inputMode,更新表格文档中的 React 规范链接,升级 trigger 组件版本
This commit is contained in:
commit
453d1d4968
@ -54,7 +54,7 @@ const Image: CompositionImage<ImageProps> = (props) => {
|
||||
return preview;
|
||||
}
|
||||
const _preview = typeof preview === 'object' ? preview : {};
|
||||
const { getContainer, closeIcon, ...restPreviewProps } = _preview;
|
||||
const { getContainer, closeIcon, rootClassName, ...restPreviewProps } = _preview;
|
||||
return {
|
||||
mask: (
|
||||
<div className={`${prefixCls}-mask-info`}>
|
||||
@ -64,6 +64,7 @@ const Image: CompositionImage<ImageProps> = (props) => {
|
||||
),
|
||||
icons,
|
||||
...restPreviewProps,
|
||||
rootClassName: classNames(mergedRootClassName, rootClassName),
|
||||
getContainer: getContainer ?? getContextPopupContainer,
|
||||
transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),
|
||||
maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName),
|
||||
|
@ -166,7 +166,7 @@ export type { TreeSelectProps } from './tree-select';
|
||||
export { default as Typography } from './typography';
|
||||
export type { TypographyProps } from './typography';
|
||||
export { default as Upload } from './upload';
|
||||
export type { UploadFile, UploadProps } from './upload';
|
||||
export type { UploadFile, UploadProps, DraggerProps } from './upload';
|
||||
export { default as version } from './version';
|
||||
export { default as Watermark } from './watermark';
|
||||
export type { WatermarkProps } from './watermark';
|
||||
|
@ -73,6 +73,7 @@ const OTP = React.forwardRef<OTPRef, OTPProps>((props, ref) => {
|
||||
mask,
|
||||
type,
|
||||
onInput,
|
||||
inputMode,
|
||||
...restProps
|
||||
} = props;
|
||||
|
||||
@ -225,6 +226,7 @@ const OTP = React.forwardRef<OTPRef, OTPProps>((props, ref) => {
|
||||
status: mergedStatus as InputStatus,
|
||||
mask,
|
||||
type,
|
||||
inputMode,
|
||||
};
|
||||
|
||||
return wrapCSSVar(
|
||||
|
@ -348,7 +348,7 @@ Here is the [CodeSandbox for TypeScript](https://codesandbox.io/s/serene-platfor
|
||||
|
||||
## Note
|
||||
|
||||
According to the [React documentation](https://facebook.github.io/react/docs/lists-and-keys.html#keys), every child in an array should be assigned a unique key. The values inside the Table's `dataSource` and `columns` should follow this rule. By default, `dataSource[i].key` will be treated as the key value for `dataSource`.
|
||||
According to the [React documentation](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key), every child in an array should be assigned a unique key. The values inside the Table's `dataSource` and `columns` should follow this rule. By default, `dataSource[i].key` will be treated as the key value for `dataSource`.
|
||||
|
||||
![console warning](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png)
|
||||
|
||||
|
@ -351,7 +351,7 @@ TypeScript 里使用 Table 的 [CodeSandbox 实例](https://codesandbox.io/s/ser
|
||||
|
||||
## 注意
|
||||
|
||||
按照 [React 的规范](https://zh-hans.reactjs.org/docs/lists-and-keys.html#keys),所有的数组组件必须绑定 `key`。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。
|
||||
按照 [React 的规范](https://zh-hans.react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key),所有的列表必须绑定 `key`。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。
|
||||
|
||||
![控制台警告](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png)
|
||||
|
||||
|
@ -116,7 +116,7 @@
|
||||
"@rc-component/mutate-observer": "^1.1.0",
|
||||
"@rc-component/qrcode": "~1.0.0",
|
||||
"@rc-component/tour": "~1.15.1",
|
||||
"@rc-component/trigger": "^2.2.3",
|
||||
"@rc-component/trigger": "^2.2.5",
|
||||
"classnames": "^2.5.1",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"dayjs": "^1.11.11",
|
||||
|
Loading…
Reference in New Issue
Block a user