From a6f787ed47d1b9e72a5210b3e4be30cb4f2aca53 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Wed, 5 Aug 2020 16:50:17 +0800 Subject: [PATCH 1/6] fix: menu position in dark rtl (#26032) --- components/menu/style/rtl.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/menu/style/rtl.less b/components/menu/style/rtl.less index dc03206f4b..21987789c0 100644 --- a/components/menu/style/rtl.less +++ b/components/menu/style/rtl.less @@ -4,7 +4,7 @@ @menu-prefix-cls: ~'@{ant-prefix}-menu'; .@{menu-prefix-cls} { - &-rtl { + &&-rtl { direction: rtl; text-align: right; } From e3946416a3b9fd5b7f41ec5d92b4dd9b626dd681 Mon Sep 17 00:00:00 2001 From: Thanaen Date: Wed, 5 Aug 2020 11:05:53 +0200 Subject: [PATCH 2/6] fix: fr_FR Table.cancelSort spelling error (#26034) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Costedoat --- components/locale/fr_FR.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/locale/fr_FR.tsx b/components/locale/fr_FR.tsx index 647c9f8693..431d03afab 100644 --- a/components/locale/fr_FR.tsx +++ b/components/locale/fr_FR.tsx @@ -22,7 +22,7 @@ const localeValues: Locale = { collapse: 'Réduire la ligne', triggerDesc: 'Trier par ordre décroissant', triggerAsc: 'Trier par ordre croissant', - cancelSort: 'Annuler le trie', + cancelSort: 'Annuler le tri', }, Modal: { okText: 'OK', From 1d0f6009183d65f1ebefead9bebcf7a126006210 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 5 Aug 2020 18:30:53 +0800 Subject: [PATCH 3/6] :memo: update PR template --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ .github/PULL_REQUEST_TEMPLATE/pr_cn.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 529069eba2..8cc79fde47 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,6 +18,8 @@ Please makes sure that these form are filled before submitting your pull request - [ ] TypeScript definition update - [ ] Bundle size optimization - [ ] Performance optimization +- [ ] Enhancement feature +- [ ] Internationalization - [ ] Refactoring - [ ] Code style optimization - [ ] Test Case diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md index fa630f0fdb..34d4a0b89e 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -14,11 +14,13 @@ - [ ] 日常 bug 修复 - [ ] 站点、文档改进 - [ ] 演示代码改进 -- [ ] 组件样式改进 +- [ ] 组件样式/交互改进 - [ ] TypeScript 定义更新 - [ ] 包体积优化 - [ ] 性能优化 - [ ] 重构 +- [ ] 功能增强 +- [ ] 国际化改进 - [ ] 代码风格优化 - [ ] 测试用例 - [ ] 分支合并 From c6244382a7bc9e2aa7a54f16cde32698a4790254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 5 Aug 2020 21:23:15 +0800 Subject: [PATCH 4/6] chore: Replace `rc-animation/lib/CSSMotion` to `rc-motion` (#26044) * chore: bump version * chore: update rest version * clean up rc-trigger ts define * clean up motion define --- components/_util/motion.tsx | 38 ++++++++----------------------------- components/menu/index.tsx | 3 +-- package.json | 11 ++++++----- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/components/_util/motion.tsx b/components/_util/motion.tsx index 973e6cf136..f9c5a7f431 100644 --- a/components/_util/motion.tsx +++ b/components/_util/motion.tsx @@ -1,36 +1,14 @@ -import * as React from 'react'; - -type MotionFunc = (element: HTMLElement) => React.CSSProperties; -type MotionEndFunc = (element: HTMLElement, event: TransitionEvent) => boolean; - -interface Motion { - visible?: boolean; - motionName?: string; // It also support object, but we only use string here. - motionAppear?: boolean; - motionEnter?: boolean; - motionLeave?: boolean; - motionLeaveImmediately?: boolean; // Trigger leave motion immediately - motionDeadline?: number; - removeOnLeave?: boolean; - leavedClassName?: string; - onAppearStart?: MotionFunc; - onAppearActive?: MotionFunc; - onAppearEnd?: MotionEndFunc; - onEnterStart?: MotionFunc; - onEnterActive?: MotionFunc; - onEnterEnd?: MotionEndFunc; - onLeaveStart?: MotionFunc; - onLeaveActive?: MotionFunc; - onLeaveEnd?: MotionEndFunc; -} +import { CSSMotionProps } from 'rc-motion'; +import { MotionEventHandler, MotionEndEventHandler } from 'rc-motion/lib/CSSMotion'; // ================== Collapse Motion ================== -const getCollapsedHeight: MotionFunc = () => ({ height: 0, opacity: 0 }); -const getRealHeight: MotionFunc = node => ({ height: node.scrollHeight, opacity: 1 }); -const getCurrentHeight: MotionFunc = node => ({ height: node.offsetHeight }); -const skipOpacityTransition: MotionEndFunc = (_, event) => event.propertyName === 'height'; +const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 }); +const getRealHeight: MotionEventHandler = node => ({ height: node.scrollHeight, opacity: 1 }); +const getCurrentHeight: MotionEventHandler = node => ({ height: node.offsetHeight }); +const skipOpacityTransition: MotionEndEventHandler = (_, event) => + (event as TransitionEvent).propertyName === 'height'; -const collapseMotion: Motion = { +const collapseMotion: CSSMotionProps = { motionName: 'ant-motion-collapse', onAppearStart: getCollapsedHeight, onEnterStart: getCollapsedHeight, diff --git a/components/menu/index.tsx b/components/menu/index.tsx index 1e132df7fe..295dad3395 100644 --- a/components/menu/index.tsx +++ b/components/menu/index.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import RcMenu, { Divider, ItemGroup, MenuProps as RcMenuProps } from 'rc-menu'; import classNames from 'classnames'; -import { MotionType } from 'rc-trigger/lib/interface'; import SubMenu from './SubMenu'; import Item from './MenuItem'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; @@ -57,7 +56,7 @@ class InternalMenu extends React.Component { const { prefixCls: customizePrefixCls, className, theme } = this.props; const defaultMotions = { horizontal: { motionName: 'slide-up' }, - inline: collapseMotion as MotionType, + inline: collapseMotion, other: { motionName: 'zoom-big' }, }; diff --git a/package.json b/package.json index e4d031f7ab..3260b002b4 100644 --- a/package.json +++ b/package.json @@ -126,14 +126,15 @@ "rc-field-form": "~1.8.0", "rc-input-number": "~6.0.0", "rc-mentions": "~1.4.0", - "rc-menu": "~8.5.0", + "rc-menu": "~8.5.2", + "rc-motion": "^1.0.0", "rc-notification": "~4.4.0", "rc-pagination": "~2.4.5", "rc-picker": "~1.15.1", "rc-progress": "~3.0.0", "rc-rate": "~2.8.2", "rc-resize-observer": "^0.2.3", - "rc-select": "~11.0.10", + "rc-select": "~11.0.12", "rc-slider": "~9.3.0", "rc-steps": "~4.1.0", "rc-switch": "~3.2.0", @@ -141,9 +142,9 @@ "rc-tabs": "~11.5.0", "rc-textarea": "~0.3.0", "rc-tooltip": "~4.2.0", - "rc-tree": "~3.8.0", - "rc-tree-select": "~4.1.0", - "rc-trigger": "~4.3.0", + "rc-tree": "~3.8.5", + "rc-tree-select": "~4.1.1", + "rc-trigger": "~4.4.0", "rc-upload": "~3.2.0", "rc-util": "^5.0.1", "scroll-into-view-if-needed": "^2.2.25", From 35a9d94c92bdf08a3a93f6bad2595c00fe6c5a99 Mon Sep 17 00:00:00 2001 From: Mateusz Wierzbicki <22788841+mateusz-wierzbicki@users.noreply.github.com> Date: Wed, 5 Aug 2020 16:09:26 +0200 Subject: [PATCH 5/6] docs: Added UI kit for Adobe XD to Resources page (#26047) --- docs/resources.en-US.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/resources.en-US.md b/docs/resources.en-US.md index 7abb8e0bdb..9d431dd120 100644 --- a/docs/resources.en-US.md +++ b/docs/resources.en-US.md @@ -50,6 +50,10 @@ Please find below some of the design resources and tools about Ant Design that w - https://gw.alipayobjects.com/zos/basement_prod/7b9ed3f2-6f05-4ddb-bac3-d55feb71e0ac.svg - Library of components for Desktop - https://www.antforfigma.com +- UI Kit for Adobe XD + - https://uploads-ssl.webflow.com/5ecbd337fe499992c9ed75ba/5f2a7a30f3e817085cec5ac9_ant-xd-svg.svg + - Library of components for Desktop + - https://gumroad.com/l/antdesign-xd - Figma Open Source Library - https://i.imgur.com/kopdWeX.png - Free open source Figma library with complete accrate to code components From 9a67f3571d54326e5cd3e9b05b3c92c6976dc823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Wed, 5 Aug 2020 22:29:38 +0800 Subject: [PATCH 6/6] fix: Table crash when dataSource contains number (#26042) close #26039 --- components/table/Table.tsx | 4 ++-- components/table/__tests__/Table.test.js | 13 +++++++++++++ components/table/hooks/useLazyKVMap.ts | 2 +- components/table/hooks/useSelection.tsx | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index be99cdb5ee..903765027f 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -162,7 +162,7 @@ function Table(props: TableProps) { const { childrenColumnName = 'children' } = mergedExpandable; const expandType: ExpandType = React.useMemo(() => { - if (rawData.some(item => (item as any)[childrenColumnName])) { + if (rawData.some(item => (item as any)?.[childrenColumnName])) { return 'nest'; } @@ -183,7 +183,7 @@ function Table(props: TableProps) { return rowKey; } - return (record: RecordType) => (record as any)[rowKey as string]; + return (record: RecordType) => (record as any)?.[rowKey as string]; }, [rowKey]); const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName, getRowKey); diff --git a/components/table/__tests__/Table.test.js b/components/table/__tests__/Table.test.js index 6d0e55d366..8c4988e431 100644 --- a/components/table/__tests__/Table.test.js +++ b/components/table/__tests__/Table.test.js @@ -160,6 +160,19 @@ describe('Table', () => { ); }); + it('should not crash when dataSource is array with none-object items', () => { + mount( + , + ); + }); + it('prevent touch event', () => { const wrapper = mount(
( const rowKey = getRowKey(record, index); kvMap.set(rowKey, record); - if (childrenColumnName in record) { + if (record && typeof record === 'object' && childrenColumnName in record) { dig((record as any)[childrenColumnName] || []); } }); diff --git a/components/table/hooks/useSelection.tsx b/components/table/hooks/useSelection.tsx index 2136201764..f87193f6b7 100644 --- a/components/table/hooks/useSelection.tsx +++ b/components/table/hooks/useSelection.tsx @@ -59,7 +59,7 @@ function flattenData( (data || []).forEach(record => { list.push(record); - if (childrenColumnName in record) { + if (record && typeof record === 'object' && childrenColumnName in record) { list = [ ...list, ...flattenData((record as any)[childrenColumnName], childrenColumnName),