From d4b4edf8efdb4ef5544a36ccb5c855574c189d69 Mon Sep 17 00:00:00 2001 From: songlinn <17741492+songlinn@users.noreply.github.com> Date: Mon, 6 Dec 2021 11:23:34 +0800 Subject: [PATCH 1/4] fix: fix badge animation end not trigger when parent is display:none (#33083) Co-authored-by: songlin.chen --- components/badge/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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', From eb3cf792cf29fefb17188daf58ebb3e09b9c8510 Mon Sep 17 00:00:00 2001 From: zhichenshaw <37165714+zhichenshaw@users.noreply.github.com> Date: Tue, 7 Dec 2021 18:27:47 +0800 Subject: [PATCH 2/4] docs: Update index.zh-CN.md (#33184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复文档中 FormInstance 的 scrollToField方法 第二个参数 options 错误的类型 --- components/form/index.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index f3966972e6..8d0680d91f 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -241,7 +241,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 | | From 2df7cc6f30a1f871827b32bbcf316c69260b6120 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 7 Dec 2021 21:45:11 +0800 Subject: [PATCH 3/4] fix: Upload `data` type (#33193) * fix: Upload `data` type * fix eslint errors --- components/upload/Upload.tsx | 10 +++--- components/upload/__tests__/type.test.tsx | 40 +++++++++++++++++++++-- components/upload/interface.tsx | 4 ++- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/components/upload/Upload.tsx b/components/upload/Upload.tsx index 23269c2446..db16e4bff9 100644 --- a/components/upload/Upload.tsx +++ b/components/upload/Upload.tsx @@ -174,13 +174,13 @@ const InternalUpload: React.ForwardRefRenderFunction = (pr let clone; try { - clone = (new File([originFileObj], originFileObj.name, { + clone = new File([originFileObj], originFileObj.name, { type: originFileObj.type, - }) as any) as UploadFile; + }) as any as UploadFile; } catch (e) { - clone = (new Blob([originFileObj], { + clone = new Blob([originFileObj], { type: originFileObj.type, - }) as any) as UploadFile; + }) as any as UploadFile; clone.name = originFileObj.name; clone.lastModifiedDate = new Date(); clone.lastModified = new Date().getTime(); @@ -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 2aa11ae9e8..efd41d720a 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -90,7 +90,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; From ad3ba274cdce63ef1384e310c2420214b067bee4 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Wed, 8 Dec 2021 10:38:06 +0800 Subject: [PATCH 4/4] fix: radio cursor style (#33198) * fix: radio cursor style * [CodeFactor] Apply fixes to commit 38721bb [ci skip] [skip ci] Co-authored-by: codefactor-io --- components/radio/style/index.less | 4 ++++ 1 file changed, 4 insertions(+) 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;