diff --git a/components/badge/index.tsx b/components/badge/index.tsx index b6bb93af5e..99ff056346 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -175,7 +175,12 @@ const Badge: CompoundedComponent = ({ return ( {children} - + {({ className: motionClassName }) => { const scrollNumberPrefixCls = getPrefixCls( 'scroll-number', diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index ffa7bfdd1a..121c8eee78 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -242,7 +242,7 @@ Form.List 渲染表单相关操作函数。 | isFieldTouched | 检查对应字段是否被用户操作过 | (name: [NamePath](#NamePath)) => boolean | | | isFieldValidating | 检查对应字段是否正在校验 | (name: [NamePath](#NamePath)) => boolean | | | resetFields | 重置一组字段到 `initialValues` | (fields?: [FieldData](#FieldData)\[]) => void | | -| scrollToField | 滚动到对应字段位置 | (name: [NamePath](#NamePath), options: \[[ScrollOptions](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options)]) => void | | +| scrollToField | 滚动到对应字段位置 | (name: [NamePath](#NamePath), options: [ScrollOptions](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options)) => void | | | setFields | 设置一组字段状态 | (fields: [FieldData](#FieldData)\[]) => void | | | setFieldsValue | 设置表单的值(该值将直接传入 form store 中。如果你不希望传入对象被修改,请克隆后传入) | (values) => void | | | submit | 提交表单,与点击 `submit` 按钮效果相同 | () => void | | diff --git a/components/radio/style/index.less b/components/radio/style/index.less index f3a5d21c9f..44d4e499da 100644 --- a/components/radio/style/index.less +++ b/components/radio/style/index.less @@ -32,6 +32,10 @@ margin-right: @radio-wrapper-margin-right; cursor: pointer; + &-disabled { + cursor: not-allowed; + } + &::after { display: inline-block; width: 0; diff --git a/components/upload/Upload.tsx b/components/upload/Upload.tsx index 41c6eda3c2..013fba696e 100644 --- a/components/upload/Upload.tsx +++ b/components/upload/Upload.tsx @@ -305,7 +305,7 @@ const InternalUpload: React.ForwardRefRenderFunction = (pr onError, onProgress, onSuccess, - ...props, + ...(props as RcUploadProps), prefixCls, beforeUpload: mergedBeforeUpload, onChange: undefined, diff --git a/components/upload/__tests__/type.test.tsx b/components/upload/__tests__/type.test.tsx index f4b987309c..d3ce1cd3c0 100644 --- a/components/upload/__tests__/type.test.tsx +++ b/components/upload/__tests__/type.test.tsx @@ -99,11 +99,10 @@ describe('Upload.typescript', () => { status: 'error' as const, }, ]; - const upload = ( - - ) + const upload = ; expect(upload).toBeTruthy(); }); + it('itemRender', () => { const upload = ( { ); expect(upload).toBeTruthy(); }); + + it('data', () => { + const upload1 = ( + ({ + url: '', + })} + > + click to upload + + ); + const upload2 = ( + + Promise.resolve({ + url: '', + }) + } + > + click to upload + + ); + const upload3 = ( + + click to upload + + ); + expect(upload1).toBeTruthy(); + expect(upload2).toBeTruthy(); + expect(upload3).toBeTruthy(); + }); }); diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index 1139027a63..1977e812ba 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -91,7 +91,9 @@ export interface UploadProps { fileList?: Array>; action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike); directory?: boolean; - data?: object | ((file: UploadFile) => object); + data?: + | Record + | ((file: UploadFile) => Record | Promise>); method?: 'POST' | 'PUT' | 'PATCH' | 'post' | 'put' | 'patch'; headers?: HttpRequestHeader; showUploadList?: boolean | ShowUploadListInterface;