From 4a6cef3c4969d553d336439b570bcfb711ed2832 Mon Sep 17 00:00:00 2001 From: zhanglei66 <38252062+zhanglei66@users.noreply.github.com> Date: Fri, 10 Jun 2022 12:50:03 +0800 Subject: [PATCH] Zl/v4.21.0 sync (#70) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: upload circle ref (#34379) Co-authored-by: kanweiwei * feat(Typography): copyable text support format (#35219) Co-authored-by: kanweiwei * chore: add useWatch test placeholder * chore: run image snapshots on every branches * style: fix Breadcrumb reset style (#35235) close https://github.com/ant-design/ant-design/issues/35233 * fix: input onSearch trigger wrongly (#34844) (#35164) Co-authored-by: zhangqingyang@mindlinker.com * docs(:sparkles:): release 4.20.1 (#35250) * test: add menu focus test (#35252) * test: fix upload test case * refactor: replace float with flex of Card (#35236) * test: skip uploadlist test for now * docs: replace `git.io` link with the original URL (#35261) * fix: Table columns sorter a11y experience (#35269) * Make table sortable columns focusable and keyboard accessible. * Fix typo. * Change focus style for sortable table column header from broken outline to color text. * Update snapshots. * Change order to fix lint error. * Add unit test to test sorting with keypress. * Update components/table/hooks/useSorter.tsx * chore: improve code style * style: use focus-visible * fix: test case * test: update snapshot Co-authored-by: Katsiaryna Pustakhod * feat: support icon only in segmented (#35256) * feat: support icon only with segmented * fix: lint issue * chore: update * test: fix * test: update snapshot * feat: dropdown auto-focus (#35307) * feat: dropdown auto-focus * chore: update rc-tabs * docs: update space demos * fix: Space duplicated key warning (#35311) close #35305 * Added pending filter translations Table locale/es_ES (#35309) Co-authored-by: Jesús Gallego Irles * chore: Add code file owner * chore: more owner files * docs: fix form instance type error (#35320) * feat: set proper height for Segmented (#35281) * style: tweak BreadCrumb link hover color (#35324) * chore: Aligning the CI description and its behavior (#35325) * test: Rewrite mountTest with testing lib (#35326) * feat: Form disabled (#35210) * feat: add form disabled * feat: add form disabled * feat: add radio disabled * feat: update snap * feat: add test case * docs: add instruction about tokenSeparators (#35329) * test: replace Empty part test with test lib (#35289) * test: replace Empty part test with test lib * test: update snapshot case * fix: Switch disabled color in dark theme (#35332) * Revert "feat: dropdown auto-focus (#35307)" (#35337) This reverts commit 1ff58d23f08d8d7f487c123f21eaf5d3a79f95e9. * docs: update Tabs component onEdit prop describe (#35271) * docs: update Tabs component onEdit prop describe * docs: update Tabs component onEdit prop describe * Apply suggestions from code review Co-authored-by: afc163 * docs: changelog for 4.20.2 (#35338) * docs: add changelog for #35336 * style: fix Select tag remove icon position (#35336) The icon is pushed down a bit * test: update test case * test: transfer part of tooltip test case to testing library (#35362) * test: refactor test cases of Space (#35372) * test: migrate part of anchor tests (#35371) * test: migrate part of checkbox tests (#35354) * fix: Carousel compatible with vertical property (#35349) * chore: fix npm start error in Gitpod close #33444 * Revert "chore: fix npm start error in Gitpod" This reverts commit 978226fb13a7ec2c4ee07bb8eeba6bb18188a622. * fix: table column filter reset is not working (#35226) (#35386) * fix: Respect user provided space item key (#35344) * Resolve Ant Design Notification component TypeScript error via adding maxCount as an ArgsProps property (#35369) * fix: use less variables for Segmented (#35387) * docs: reverse React 18 demo * feat: Dropdown support autoFocus (#35391) * feat: Dropdown support autoFocus * chore: add bundle size * test: replace textarea some test case with testing lib (#35398) * test: replace textarea some test case with testing lib * test: full process * test: mv input test to input scope * test: fix lint * refactor: Progress rebuild as function component (#35393) * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * refactor: Progress rebuild as function component * chore: rm useless console * chore: rm CODEOWNER since this block github action * test: transfer tooltip test case to testing library * ci: trigger the pr check * test: try to fix the pr check * test: remove some test case * test: foreach all placement * feat: focus menu item automaticly when focusing menu (#35407) * feat: focus menu item automaticly when focusing menu * chore: update mentions * test: fix test case * chore: decrease bundle size * chore: increase bundle size * fix(): wipe out unnecessary prop (#35409) * fix: wipe out unnecessary prop * wipe out unnecessary prop(`row-gap: 0px`) on * add test case * chore: remove unnecessary import * chore: add prop to Row and Col * chore: update snapshot (Form/Grid/Card) * chore: update snapshot * chore: move location * docs: explain Avatar fallback strategy (#35415) The original description was unclear, incomplete, and confusing, requiring a look at the code to understand it, so I revised it to a more understandable version. * fix: arrow style (#35401) * fix: arrow style * fix: raise arrow z-index * fix: fix defualt arrow color * fix: mix shadow * chore: code clean * chore: code clean * fix: use fadeout instead * test: fix style lint * test: replace some slepp with jest.runAllTimers * chore: update snapshot * Revert "test: replace some slepp with jest.runAllTimers" This reverts commit ad886d1f65d83a92bc9810d6d74c71a3dc1cc608. * fix: List.Item ref (#35321) * fix: list item ref * add test * improve * fix: List.Item typescript (#35418) * chore: eslint add consistent-type-imports (#35419) * chore: eslint add consistent-type-imports * fix avatar * Update Item.tsx * chore: change menu icon in site * docs: update mirror link (#35424) * docs: update mirror link * feat: add modal * feat: add icon * chore: code clean * feat: text * fix: cancel btn * chore: split chunks (#35222) * chore: split chunks * chore: update bisheng version * chore: split @ant-design/icon * chore: code clean * chore: test * chore: split moment * chore: code clean * fix: add missing localizations (#35430) * Add missing localizations * Update snapshot * refactor: Progress type="circle" for some issues (#35433) * refactor: Progress type="circle" for some issues close #17706 close #35009 close #35352 * test: update progress snapshot * docs: update linecap.md * Update components/progress/demo/linecap.md * test: update progress snapshot * fix: rc-progress@~3.3.1 * fix: rc-progress@~3.3.2 * docs: add 4.20.3 changelog (#35435) * docs: add 4.20.3 changelog * Update CHANGELOG.zh-CN.md Co-authored-by: afc163 * fix typo * Update CHANGELOG.zh-CN.md Co-authored-by: afc163 * Update CHANGELOG.en-US.md Co-authored-by: afc163 * Update CHANGELOG.zh-CN.md Co-authored-by: afc163 * fix typo * fix typo * fix typo * fix typo Co-authored-by: afc163 * feat: edit date-picker to hook (#35425) * docs: update demo template (#35440) * docs: fix typo (#35439) * chore: fixed typo * chore: fixed typo+1 * chore(deps-dev): bump husky from 7.0.4 to 8.0.1 (#35451) Bumps [husky](https://github.com/typicode/husky) from 7.0.4 to 8.0.1. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v7.0.4...v8.0.1) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * test: update snapshot (#35452) * chore: optimze LGTM (#35443) * chore: optimze LGTM * chore: type * fix: dev broken (#35453) * chore(deps-dev): upgrade to jest 28 (#35334) https://jestjs.io/zh-Hans/docs/upgrading-to-jest28 * fix: bad List.Item type (#35454) (#35455) Co-authored-by: Ron Smeral * docs: replace class component with hooks (#35461) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * refactor: remove cascader displayRender warning (#35417) * refactor: remove useless warning (#35291) * refactor: remove useless test case * docs: remove cascader tagRender * perf: refactor devWarning for production code size (#35411) * pref: better code style for production * refactor `devWarning` * don't use `useEffect` only wrap `devWarning` * chore: add 'noop' to coverage * chore: add test cases for devWarning * chore: add test case * chore: update test cases for devWarning * chore: restore test script command * fix: remove 'throw new Error' * should not use `throw` for browser * chore: update test case for AutoComplete * perf: add prefix for `devWarning` * update RegExp for UMD * add prefix for ES and CJS * chore: better code style * perf: * upgrade antd-tools * remove `injectWarningCondition` * rename `devWarning` to `warning` * chore: better code style * chore: better code style * chore: restore hasValidName * docs: replace class component with hooks (#35472) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * chore: fix LGTM * docs: indicate that menu items require `key`s (#35474) * docs: remove editable in table documentation close https://github.com/ant-design/ant-design/pull/35471#issuecomment-1123239879 * fix: tree checkbox margin in rtl mode (#35491) * docs: Table QA about rowSelection renderCell (#35494) * Update index.zh-CN.md 之前需要在 可选列的勾选框 中增加 Tooltip,没有在文档中找到相关的文档,通过搜索 issue,以为暂时不支持,看了源码才发现已经支持了。 所以想要完善一下文档,可以方便其他用户找到此内容。 * docs: Table QA about rowSelection renderCell update US doc * docs: changelog 4.20.4 (#35495) * docs: changelog 4.20.4 * chore: emoji * docs: replace class component with hooks (#35500) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * docs(config-provider): replace class component with hooks * docs(date-picker): replace class component with hooks * test: update snapshot * fix(statistic): ignore the decimal part when the precision is negative (#35520) * test: Update snapshot * test: Update snapshot (#35529) * refactor: Card loading (#35525) * feat: card loading with skeleton * test: update snapshot * test: add style deps * chore: import * docs: update work with us part * refactor: modal confirm button style (#35530) * fix: modal rtl style * fix: cannot use logic css * chore: change css writing order * feat: update changelog * test: moving to testing-library in `Segmented` (#35538) * test(Segmented): moving to testing-library * chore: cleanup * fix: test * test: use click instead of change to fire event * Update index.test.tsx * fix: Picker focus & blur not working (#35552) * docs: replace class component with hooks (#35519) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * docs(config-provider): replace class component with hooks * docs(date-picker): replace class component with hooks * docs(drawer): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(empty): replace class component with hooks * docs(grid): replace class component with hooks * docs(input): replace class component with hooks * docs(input-number): replace class component with hooks * docs(demo): fix lint error * chore: deprecated rowSelection.onSelectNone and onSelectMultiple (#35545) * chore: del unused package && downgrade some packages which related webpack@5 (#35551) * docs: changelog 4.20.5 (#35560) * chore: Update github action release helper release title * fix: drawer close speed (#35339) * fix: drawer close speed * chroe: snap * chroe: test * chroe: test * feat: remove file * feat: 重新整理 * feat: forceRender * feat: snap * chroe: test * chroe: test * chroe: test * feat: create event * feat: diff code * feat: forceRender * chore: test (#35364) * Update components/drawer/index.tsx Co-authored-by: afc163 * feat: remove load state * feat: test * fix: destroyOnClose * feat: add load * fix: update snap * fix: update snap * feat: reset test * feat: docs * feat: test * feat: test Co-authored-by: afc163 * docs: fix 4.20.5 changelog typo (#35567) * refactor: reduce empty cycling deps (#35570) * chore: rm in root * chore: fix ts * test: Update snapshot * chore: ignore part * chore: delete extra spaces (#35582) Co-authored-by: hezhaoshun * docs: replace class component with hooks (#35580) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * docs(config-provider): replace class component with hooks * docs(date-picker): replace class component with hooks * docs(drawer): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(empty): replace class component with hooks * docs(grid): replace class component with hooks * docs(input): replace class component with hooks * docs(input-number): replace class component with hooks * docs(demo): fix lint error * docs(layout): replace class component with hooks * docs(list): replace class component with hooks * docs(mentions): replace class component with hooks * docs: fix code review issue * chore: bump tools version (#35594) * style: fix Table header border when has rowSpan (#35591) close #35577 * docs: Update CHANGELOG.zh-CN.md (#35604) * feat: add a new locale tk_TK (#35605) * feat: add a new locale tk_TK * fix: fix moment locale * feat: table rowSelection.onChange support type (#35598) * feat: table rowSelection onChange support method * docs: update * chore: rename param * test: update * test: update * Update rebase.yml * docs: Fix DatePicker throw demo * style: anchor text is overwritten (#35612) Co-authored-by: hezhaoshun * docs: replace class component with hooks (#35613) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * docs(config-provider): replace class component with hooks * docs(date-picker): replace class component with hooks * docs(drawer): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(empty): replace class component with hooks * docs(grid): replace class component with hooks * docs(input): replace class component with hooks * docs(input-number): replace class component with hooks * docs(demo): fix lint error * docs(layout): replace class component with hooks * docs(list): replace class component with hooks * docs(mentions): replace class component with hooks * docs: fix code review issue * docs(modal): replace class component with hooks * docs: feat components TS demo (#34742) * docs: add general components TS demo * docs: add layout components TS demo * docs: add navigation components TS demo * docs: add data entry components TS demo * chore(deps): add types for qs * docs: add data display TS demo * docs: add feedback components TS demo * docs: add other components TS demo * chore(deps): add types * docs: unified demo code style * docs: fix lint error * docs: add demo TS type * docs: fix demo TS type * test: update snapshot * docs: fix TS demo * feat: update Rate character type * docs: fix lint error * feat: update Rate character type * feat: update Rate character type * fix: Remove Grid row and cell aria roles (#35616) close https://github.com/ant-design/ant-design/issues/35549 * test: move test cases to `@testing/library` for Result (#35621) * fix: incorrect position of picker popup (#35620) Co-authored-by: yangpj17 close #35590 * feat: add-testing-lib (#35626) * docs: Convert part demo to ts version (#35641) * docs(badge): replace class component with hooks * docs(button): replace class component with hooks * docs(calendar): replace class component with hooks * docs(card): replace class component with hooks * docs(button): replace class component with hooks * chore(deps): remove webpack devDependencies * docs(cascader): replace class component with hooks * docs(checkbox): replace class component with hooks * docs(collapse): replace class component with hooks * docs(comment): replace class component with hooks * docs(descriptions): replace class component with hooks * docs(config-provider): replace class component with hooks * docs(date-picker): replace class component with hooks * docs(drawer): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(dropdown): replace class component with hooks * docs(empty): replace class component with hooks * docs(grid): replace class component with hooks * docs(input): replace class component with hooks * docs(input-number): replace class component with hooks * docs(demo): fix lint error * docs(layout): replace class component with hooks * docs(list): replace class component with hooks * docs(mentions): replace class component with hooks * docs: fix code review issue * docs(modal): replace class component with hooks * docs(pagination): replace class component with hooks * docs(popconfirm): replace class component with hooks * docs(popover): replace class component with hooks * docs(progress): replace class component with hooks * docs(rate): replace class component with hooks * docs(radio): replace class component with hooks * docs: jsx to TS demo * test: improve Select test case (#35633) * docs(mentions): fix debounce demo bug (#35653) * chore(deps-dev): bump @types/react-resizable from 1.7.4 to 3.0.0 (#35658) Bumps [@types/react-resizable](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-resizable) from 1.7.4 to 3.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-resizable) --- updated-dependencies: - dependency-name: "@types/react-resizable" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * test: refactor test cases of Timeline with testing library (#35654) * test: refactor test cases of TimeLine * fix: lint errors * chore(deps-dev): bump react-intl from 5.25.1 to 6.0.1 (#35659) Bumps [react-intl](https://github.com/formatjs/formatjs) from 5.25.1 to 6.0.1. - [Release notes](https://github.com/formatjs/formatjs/releases) - [Commits](https://github.com/formatjs/formatjs/compare/react-intl@5.25.1...react-intl@6.0.1) --- updated-dependencies: - dependency-name: react-intl dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: fix cheerio for enzyme fix (#35666) * docs: 4.20.6 changelog (#35671) * docs: 4.20.6 changelog * docs: fix build * test: Update snapshot * refactor: align with popover (#35676) * chore: short auto merge time * chore: update issue check mirror (#35680) * fix: division in less for Segmented (#35701) * fix: division in less for Segmented * fix: update * chore: increase bundle size (#35709) * docs: fix mistype (#35714) * docs: update demo code (#35695) * docs: update demo code * chore: increase bundle size * Revert "chore: increase bundle size" This reverts commit 1c75e5ab5a85259f4d610e33009072e3e9c9acd4. * fix: drawer can not ref form instance when open (#35706) * fix: drawer can not ref form instance when open * fix: test * feat: div ref * feat: test * feat: test * feat: test * feat: test * chore: lock stylelint (#35725) * fix: Popover arrow style (#35717) * feat: config provider support componentDisabled (#35718) * feat: config provider support componentDisable * test: update snapshot * docs: update * chore: code * docs: componentDisabled version (#35730) * test: Replace alert part test with testing lib (#35736) Co-authored-by: chenkan1 * chore(deps-dev): bump typescript from 4.6.4 to 4.7.2 (#35737) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.4 to 4.7.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.4...v4.7.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs(select): fix type (#35726) * fix: demo ts type * mend * Update select-users.md * chore: move `@types/qs` from deps to devDeps (#35747) * feat: Config provider pagination showSizeChanger (#35750) * feat: support showSizeChanger * test: test case * fix: the ts wrong of card inteface (#35753) * fix: the ts wrong of card inteface * fix: add export cardproprs * feat: add card type test * docs(👍): update recommendation (#35758) * docs: update recommendation * Update recommendation.en-US.md * docs: fix skeleton demo (#35760) * refactor: Collapse replace expandIconPosition with logical position (#35770) * refactor: change collapse to logic position * test: Update snapshot * chore: force trigger CI * ci: use jest shard (#35622) * refactor: bump rc-collapse to stable dom (#35781) * chore: bump rc-collapse to stable dom * chore: clean up * test: Replace card component test with testing lib (#35751) * test: Replace card component test with testing lib * test: update the snapshot * docs: add note to custom BackTop demo (#35625) * docs: add note to custom BackTop demo * Apply suggestions from code review Co-authored-by: afc163 * test: lock eslint-plugin-jest version for false positive https://github.com/jest-community/eslint-plugin-jest/issues/1128 * test: move test cases to @testing/library for Tabs (#35796) * chore(deps): update dependency eslint-plugin-jest to ~26.4.0 (#35801) * chore(deps): update dependency eslint-plugin-jest to ~26.4.0 * Update package.json Co-authored-by: Renovate Bot Co-authored-by: afc163 * feat: change the changelog of 4.20.6 version * test: move test cases to @testing/library for Image (#35806) * docs: changelog for 4.20.7 (#35804) * docs: changelog for 4.20.7 * chore: bump version to 4.20.7 * docs: update changelog * refactor: Fix Dropdown nesting menu injection logic (#35810) * refactor: Dependency Inversion * test: update snapshot * test: Update snapshot * test: more * fix: table dropdown logic * fix: menu lint * chore: upgrade to jest-image-snapshot 5.x (#35818) * test: move test cases to @testing/library for Modal (#35785) * test: move test cases to @testing/library for Modal * update * fix: test * test: add test case for mouse position * chore: revert * fix: Progress type="line" strokeLinecap (#35822) * docs: fix typo of Menu items code example (#35832) * test: move test cases to @testing/library for Drawer (#35839) * perf: active skeleton animated with transform (#35836) * active skeleton animated with transform * properties order fixed * properties order fixed * properties order fixed Co-authored-by: afc163 * style: tweak Skeleton margin top style (#35848) * docs: update FAQ titles * test: move test cases to @testing/library for List (#35850) * chore: bump rc-dialog & update snapshot * fix: set jest shard to 2 (#35831) * fix: drawer close twice children is undefined (#35853) * fix: drawer close twice children is undefined * fix: drawer close twice children is undefined * chore: code * fix: test * test: update snapshot * fix: remove extraneous space from rc-segmented version (#35863) The extra spaces confuses third-party tooling * feat: Progress steps support custom strokeColor for each step (#35855) * feat: could accept string[] as strokeColor close #35852 close #26858 * fix: tsx demo * docs: add version column * chore: stlye patch of statistic (#35874) * chore: stlye patch of statistic * test: Udpate snapshot * test: replace Input part test with test lib (#35754) * test: replace Input part test with test lib * test: test input case * test: update textarea case Co-authored-by: z1399 Co-authored-by: afc163 * refactor: pagination mini className (#35881) * refactor: pagination mini cls * test: update snapshot * test: update snapshot * chore: code clean * chore: code clean * test: update snapshot * test: update snapshot * refactor: Wave in React 18 StrictMode (#35889) * feat: tabs support popupClassName (#35892) * feat: tabs support popupClassName * docs: update * fix:border-style for inputNumber addon when rtl (#35876) * chore(deps): update dependency @types/jest to v28 (#35907) Co-authored-by: Renovate Bot * ci: fix typo * fix: 类型“FormListFieldData”上不存在属性“fieldKey”。(#35883) (#35884) * fix: 类型“FormListFieldData”上不存在属性“fieldKey”。(#35883) * add deprecated tag to fieldKey * add changelog * Revert "add changelog" This reverts commit 2cc174f6338dbf073aa38133042f3d594a40b7b6. * chore: update changelog script (#35916) * docs: add typography format version * fix: remove important in radio style (#35920) * fix: remove important in radio style * chore: code clean * docs: correct types (#35919) * docs: correct types * ++ Co-authored-by: afc163 * test: migrate part of Button tests (#35869) * test: migrate part of Affix tests (#35860) * docs: add changelog 4.21.0 (#35915) * docs: add changelog 4.21.0 * Update CHANGELOG.en-US.md Co-authored-by: Amumu * Update CHANGELOG.zh-CN.md Co-authored-by: Amumu * docs: add * Update CHANGELOG.en-US.md * docs: fix * docs: add * docs: update * docs: fix * docs: remove 35407 Co-authored-by: Amumu * Feat: support 'treeExpandAction' prop for TreeSelect (#35618) * Feat: support 'treeExpandAction' prop for TreeSelect * chore: bump rc-tree * chore: fix lint * fix: fix directory tree duplicate expandAction * fix: fix directory tree duplicate expandAction * fix: fix directory tree duplicate expandAction * chore: add docs Co-authored-by: zombiej Co-authored-by: afc163 * chore: bump bundle size of babel runtime * docs: Update 4.21.0 changelog * docs: fix tree demo (#35927) * fix: Form.Item noStyle should not be affected by parent Form.Item (#35849) * fix: Form.Item noStyle should not be affected by parent Form.Item * test: update snapshot * fix: status * chore: code clean * fix: modal and drawer * test: fix lint * chore: code clean * refactor: noFormStyle * chore: code clean * revert: revert change in Form.Item * chore: code clean * test: replace test case with test library (#35925) * test: replace test case with test library * test: replace test case with test library * test: update snapshots * docs: clean up useless space * test: refactor tree with testing lib (#35937) * test: tree test * test: clean up * chore: bump rc-tree * test: Update snapshot * test: Update for react 18 * test: move test cases to testing lib (#35909) * test: move test cases to testing lib (#35900) * fix: menu items typings (#35790) * Fix menu items typings * add test case for menu item type checking * fix: cubic-bezier should be animation-timing-function (#35943) * fix: modify 'antd' to 'infrad' in loop-banner.md of alert * fix: modify line-height value to @line-height-base of descriptions component Co-authored-by: Camol Co-authored-by: kanweiwei Co-authored-by: zombiej Co-authored-by: afc163 Co-authored-by: qyzzzz <43691324+qyzzzz@users.noreply.github.com> Co-authored-by: zhangqingyang@mindlinker.com Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: miracles1919 <516571350@qq.com> Co-authored-by: zhang lay Co-authored-by: Sukka Co-authored-by: Katsiaryna Pustakhod Co-authored-by: vagusX Co-authored-by: agarciaguillo Co-authored-by: Jesús Gallego Irles Co-authored-by: Dunqing <1247748612@qq.com> Co-authored-by: Amumu Co-authored-by: Zack Chang <73225408+jrr997@users.noreply.github.com> Co-authored-by: 黑雨 Co-authored-by: lalalazero Co-authored-by: Dreamcreative Co-authored-by: Walid Cherhane <56094829+walidcherhane@users.noreply.github.com> Co-authored-by: PCCCCCCC Co-authored-by: linqiqi077 <865530219@qq.com> Co-authored-by: TrickyPi <33021497+TrickyPi@users.noreply.github.com> Co-authored-by: haipeng Co-authored-by: Yanlin Jiang Co-authored-by: Cooper Veysey Co-authored-by: shuaijiumei <63175611+shuaijiumei@users.noreply.github.com> Co-authored-by: Karott Schu Co-authored-by: parabolazz Co-authored-by: Tom Xu Co-authored-by: Mykyta Velykanov Co-authored-by: 陈帅 Co-authored-by: Yanming Deng Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ron Šmeral Co-authored-by: Ron Smeral Co-authored-by: dingkang Co-authored-by: Tony Wu <93302820+tonywu6@users.noreply.github.com> Co-authored-by: limingxin <906529775@qq.com> Co-authored-by: ty888 <1506125048@qq.com> Co-authored-by: Yuki Zhang Co-authored-by: 叶枫 <7971419+crazyair@users.noreply.github.com> Co-authored-by: joson <373693643@qq.com> Co-authored-by: hezhaoshun Co-authored-by: 周晨阳 <59002875+ZZZCNY@users.noreply.github.com> Co-authored-by: 章鱼 Co-authored-by: Bart Piotrowski <31428082+bartpio@users.noreply.github.com> Co-authored-by: yykoypj <601924094@qq.com> Co-authored-by: Niyaz Akhmetov Co-authored-by: 社长长 Co-authored-by: chenkan1 Co-authored-by: zhao-huo-long Co-authored-by: Cong Zhang Co-authored-by: Long Hao (龙濠) <45565100+LongHaoo@users.noreply.github.com> Co-authored-by: Gabriel Haruki Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot Co-authored-by: Peach Co-authored-by: MrHadEnough Co-authored-by: slotDumpling <67586451+slotDumpling@users.noreply.github.com> Co-authored-by: Mehdi Salem Naraghi Co-authored-by: 郑国庆 Co-authored-by: z1399 Co-authored-by: Luobo Zhang Co-authored-by: xrkffgg Co-authored-by: chenxiang <597219320@qq.com> Co-authored-by: 元凛 Co-authored-by: kalykun <984757534@qq.com> Co-authored-by: Shang Song <14830727+zggmd@users.noreply.github.com> Co-authored-by: Heaven <18418010+NE-SmallTown@users.noreply.github.com> Co-authored-by: MasaoBlue <16271994+MasaoBlue@users.noreply.github.com> --- .github/workflows/pr-check-ci.yml | 2 +- .github/workflows/test.yml | 11 +- CHANGELOG.en-US.md | 58 +- CHANGELOG.zh-CN.md | 57 + components/_util/wave.tsx | 7 +- components/affix/__tests__/Affix.test.tsx | 50 +- components/affix/demo/basic.md | 2 +- components/affix/demo/debug.md | 2 +- components/affix/demo/on-change.md | 2 +- components/affix/demo/target.md | 2 +- components/affix/index.tsx | 12 +- components/alert/demo/action.md | 2 +- components/alert/demo/banner.md | 2 +- components/alert/demo/basic.md | 2 +- components/alert/demo/closable.md | 2 +- components/alert/demo/close-text.md | 2 +- components/alert/demo/custom-icon.md | 4 +- components/alert/demo/description.md | 2 +- components/alert/demo/error-boundary.md | 2 +- components/alert/demo/icon.md | 2 +- components/alert/demo/loop-banner.md | 4 +- components/alert/demo/smooth-closed.md | 2 +- components/alert/demo/style.md | 2 +- components/anchor/demo/basic.md | 2 +- components/anchor/demo/customizeHighlight.md | 2 +- components/anchor/demo/onChange.md | 2 +- components/anchor/demo/onClick.md | 2 +- components/anchor/demo/static.md | 2 +- components/anchor/demo/targetOffset.md | 2 +- .../auto-complete/__tests__/focus.test.js | 34 +- .../auto-complete/__tests__/index.test.js | 43 +- components/auto-complete/demo/basic.md | 2 +- .../auto-complete/demo/certain-category.md | 4 +- components/auto-complete/demo/custom.md | 2 +- components/auto-complete/demo/form-debug.md | 4 +- .../auto-complete/demo/non-case-sensitive.md | 2 +- components/auto-complete/demo/options.md | 2 +- components/auto-complete/demo/status.md | 2 +- .../auto-complete/demo/uncertain-category.md | 4 +- components/avatar/demo/badge.md | 4 +- components/avatar/demo/basic.md | 4 +- components/avatar/demo/dynamic.md | 2 +- components/avatar/demo/fallback.md | 2 +- components/avatar/demo/group.md | 4 +- components/avatar/demo/responsive.md | 4 +- components/avatar/demo/toggle-debug.md | 2 +- components/avatar/demo/type.md | 4 +- components/back-top/__tests__/index.test.js | 18 +- components/back-top/demo/basic.md | 2 +- components/back-top/demo/custom.md | 6 +- components/badge/demo/basic.md | 4 +- components/badge/demo/change.md | 4 +- components/badge/demo/colorful.md | 2 +- components/badge/demo/dot.md | 4 +- components/badge/demo/link.md | 2 +- components/badge/demo/mix.md | 2 +- components/badge/demo/no-wrapper.md | 4 +- components/badge/demo/offset.md | 2 +- components/badge/demo/overflow.md | 2 +- components/badge/demo/ribbbon.md | 2 +- components/badge/demo/ribbon-debug.md | 2 +- components/badge/demo/size.md | 2 +- components/badge/demo/status.md | 2 +- components/badge/demo/title.md | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 1 - components/breadcrumb/demo/basic.md | 2 +- components/breadcrumb/demo/overlay.md | 2 +- components/breadcrumb/demo/react-router.md | 5 +- .../breadcrumb/demo/separator-component.md | 2 +- components/breadcrumb/demo/separator.md | 2 +- components/breadcrumb/demo/withIcon.md | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 1 - .../button/__tests__/delay-timer.test.tsx | 18 +- components/button/__tests__/index.test.tsx | 142 +- components/button/__tests__/wave.test.tsx | 106 +- components/button/button.tsx | 24 +- components/button/demo/basic.md | 2 +- components/button/demo/block.md | 2 +- components/button/demo/danger.md | 2 +- components/button/demo/disabled.md | 2 +- components/button/demo/ghost.md | 2 +- components/button/demo/icon.md | 4 +- components/button/demo/legacy-group.md | 4 +- components/button/demo/loading.md | 4 +- components/button/demo/multiple.md | 4 +- components/button/demo/size.md | 4 +- components/calendar/demo/basic.md | 2 +- components/calendar/demo/card.md | 2 +- components/calendar/demo/customize-header.md | 4 +- components/calendar/demo/notice-calendar.md | 4 +- components/calendar/demo/select.md | 6 +- components/calendar/index.en-US.md | 18 +- components/calendar/index.zh-CN.md | 18 +- components/calendar/locale/tk_TK.tsx | 3 + components/card/Card.tsx | 33 +- .../__snapshots__/demo-extend.test.ts.snap | 113 +- .../__tests__/__snapshots__/demo.test.js.snap | 111 +- .../__snapshots__/index.test.js.snap | 173 - .../__snapshots__/index.test.tsx.snap | 81 + .../{index.test.js => index.test.tsx} | 30 +- components/card/demo/basic.md | 2 +- components/card/demo/border-less.md | 2 +- components/card/demo/flexible-content.md | 2 +- components/card/demo/grid-card.md | 2 +- components/card/demo/in-column.md | 2 +- components/card/demo/inner.md | 2 +- components/card/demo/loading.md | 4 +- components/card/demo/meta.md | 4 +- components/card/demo/simple.md | 2 +- components/card/demo/tabs.md | 2 +- components/card/index.tsx | 3 +- components/card/style/index.less | 46 +- components/card/style/index.tsx | 3 +- components/carousel/demo/autoplay.md | 2 +- components/carousel/demo/basic.md | 2 +- components/carousel/demo/fade.md | 2 +- components/carousel/demo/position.md | 4 +- components/cascader/demo/basic.md | 2 +- components/cascader/demo/change-on-select.md | 2 +- components/cascader/demo/custom-dropdown.md | 2 +- components/cascader/demo/custom-render.md | 2 +- components/cascader/demo/custom-trigger.md | 2 +- components/cascader/demo/default-value.md | 2 +- components/cascader/demo/disabled-option.md | 2 +- components/cascader/demo/fields-name.md | 2 +- components/cascader/demo/hover.md | 2 +- components/cascader/demo/lazy.md | 2 +- components/cascader/demo/multiple.md | 2 +- components/cascader/demo/placement.md | 4 +- components/cascader/demo/search.md | 2 +- components/cascader/demo/size.md | 2 +- components/cascader/demo/status.md | 2 +- components/cascader/demo/suffix.md | 4 +- components/cascader/index.tsx | 31 +- components/checkbox/demo/basic.md | 2 +- components/checkbox/demo/check-all.md | 4 +- components/checkbox/demo/controller.md | 4 +- components/checkbox/demo/debug-line.md | 2 +- components/checkbox/demo/disabled.md | 2 +- components/checkbox/demo/group.md | 2 +- components/checkbox/demo/layout.md | 4 +- components/collapse/Collapse.tsx | 56 +- .../__snapshots__/demo-extend.test.ts.snap | 282 +- .../__tests__/__snapshots__/demo.test.js.snap | 266 +- .../__snapshots__/index.test.js.snap | 43 +- components/collapse/__tests__/index.test.js | 37 +- components/collapse/demo/accordion.md | 2 +- components/collapse/demo/basic.md | 2 +- components/collapse/demo/borderless.md | 2 +- components/collapse/demo/collapsible.md | 2 +- components/collapse/demo/custom.md | 4 +- components/collapse/demo/extra.md | 13 +- components/collapse/demo/ghost.md | 2 +- components/collapse/demo/mix.md | 2 +- components/collapse/demo/noarrow.md | 2 +- components/collapse/index.en-US.md | 2 +- components/collapse/index.zh-CN.md | 18 +- components/collapse/style/index.less | 4 +- components/collapse/style/rtl.less | 20 + components/comment/demo/basic.md | 6 +- components/comment/demo/editor.md | 4 +- components/comment/demo/list.md | 4 +- components/comment/demo/nested.md | 2 +- .../config-provider/DisabledContext.tsx | 21 + .../__snapshots__/components.test.js.snap | 7590 ++++++++++++++--- .../__snapshots__/index.test.js.snap | 76 - .../__tests__/components.test.js | 15 +- .../config-provider/__tests__/index.test.js | 21 +- .../__tests__/pagination.test.tsx | 17 + components/config-provider/context.tsx | 13 +- ...renderEmpty.tsx => defaultRenderEmpty.tsx} | 11 +- components/config-provider/demo/direction.md | 47 +- components/config-provider/demo/locale.md | 18 +- components/config-provider/demo/prefixCls.md | 4 +- components/config-provider/demo/size.md | 12 +- components/config-provider/demo/theme.md | 48 +- components/config-provider/index.en-US.md | 1 + components/config-provider/index.tsx | 29 +- components/config-provider/index.zh-CN.md | 1 + components/date-picker/demo/basic.md | 4 +- components/date-picker/demo/bordered.md | 2 +- components/date-picker/demo/date-render.md | 2 +- components/date-picker/demo/disabled-date.md | 4 +- components/date-picker/demo/disabled.md | 2 +- components/date-picker/demo/extra-footer.md | 2 +- components/date-picker/demo/format.md | 4 +- components/date-picker/demo/mode.md | 4 +- components/date-picker/demo/placement.md | 4 +- .../date-picker/demo/presetted-ranges.md | 4 +- components/date-picker/demo/range-picker.md | 2 +- .../date-picker/demo/select-in-range.md | 2 +- components/date-picker/demo/size.md | 4 +- components/date-picker/demo/start-end.md | 2 +- components/date-picker/demo/status.md | 2 +- components/date-picker/demo/suffix.md | 4 +- components/date-picker/demo/switchable.md | 4 +- components/date-picker/demo/time.md | 2 +- .../generatePicker/generateRangePicker.tsx | 226 +- .../generatePicker/generateSinglePicker.tsx | 221 +- components/date-picker/locale/tk_TK.tsx | 24 + components/descriptions/demo/basic.md | 2 +- components/descriptions/demo/border.md | 2 +- components/descriptions/demo/responsive.md | 2 +- components/descriptions/demo/size.md | 4 +- components/descriptions/demo/style.md | 2 +- components/descriptions/demo/text.md | 2 +- .../descriptions/demo/vertical-border.md | 2 +- components/descriptions/demo/vertical.md | 2 +- components/descriptions/style/index.less | 4 +- components/divider/demo/customize-style.md | 2 +- components/divider/demo/horizontal.md | 2 +- components/divider/demo/plain.md | 2 +- components/divider/demo/vertical.md | 2 +- components/divider/demo/with-text.md | 2 +- components/drawer/__tests__/Drawer.test.js | 59 +- .../drawer/__tests__/DrawerEvent.test.js | 19 + .../drawer/__tests__/MultiDrawer.test.js | 80 +- components/drawer/demo/basic-right.md | 2 +- components/drawer/demo/config-provider.md | 4 +- components/drawer/demo/extra.md | 4 +- components/drawer/demo/form-in-drawer.md | 4 +- components/drawer/demo/multi-level-drawer.md | 2 +- components/drawer/demo/no-mask.md | 2 +- components/drawer/demo/placement.md | 4 +- components/drawer/demo/render-in-current.md | 2 +- components/drawer/demo/size.md | 4 +- components/drawer/demo/user-profile.md | 2 +- components/drawer/index.tsx | 62 +- components/drawer/style/index.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 35 - components/dropdown/demo/arrow-center.md | 2 +- components/dropdown/demo/arrow.md | 2 +- components/dropdown/demo/basic.md | 4 +- components/dropdown/demo/context-menu.md | 2 +- components/dropdown/demo/dropdown-button.md | 4 +- components/dropdown/demo/event.md | 4 +- components/dropdown/demo/item.md | 4 +- components/dropdown/demo/loading.md | 4 +- components/dropdown/demo/menu-full.md | 6 +- components/dropdown/demo/overlay-visible.md | 4 +- components/dropdown/demo/placement.md | 2 +- components/dropdown/demo/sub-menu.md | 4 +- components/dropdown/demo/trigger.md | 4 +- components/dropdown/dropdown.tsx | 106 +- components/dropdown/index.en-US.md | 1 + components/dropdown/index.zh-CN.md | 1 + components/dropdown/style/index.tsx | 1 + .../__snapshots__/demo-extend.test.ts.snap | 2 - components/empty/demo/config-provider.md | 14 +- components/empty/demo/customize.md | 2 +- components/form/Form.tsx | 42 +- components/form/FormItem.tsx | 63 +- components/form/FormList.tsx | 8 +- .../__snapshots__/demo-extend.test.ts.snap | 2650 +++++- .../__tests__/__snapshots__/demo.test.js.snap | 791 +- .../__snapshots__/index.test.js.snap | 1548 ++++ components/form/__tests__/index.test.js | 169 +- components/form/context.tsx | 36 +- components/form/demo/advanced-search.md | 4 +- components/form/demo/basic.md | 2 +- components/form/demo/col-24-debug.md | 2 +- components/form/demo/complex-form-control.md | 2 +- components/form/demo/control-hooks.md | 2 +- components/form/demo/control-ref.md | 4 +- .../form/demo/customized-form-controls.md | 2 +- components/form/demo/dep-debug.md | 2 +- components/form/demo/disabled-input-debug.md | 2 +- components/form/demo/disabled.md | 113 + components/form/demo/dynamic-form-item.md | 4 +- .../form/demo/dynamic-form-items-complex.md | 4 +- .../form/demo/dynamic-form-items-no-style.md | 4 +- components/form/demo/dynamic-form-items.md | 4 +- components/form/demo/dynamic-rule.md | 4 +- components/form/demo/form-context.md | 4 +- components/form/demo/form-in-modal.md | 2 +- components/form/demo/global-state.md | 2 +- components/form/demo/inline-login.md | 6 +- components/form/demo/label-debug.md | 2 +- components/form/demo/layout-can-wrap.md | 2 +- components/form/demo/layout.md | 2 +- components/form/demo/nest-messages.md | 2 +- components/form/demo/normal-login.md | 4 +- components/form/demo/ref-item.md | 4 +- components/form/demo/register.md | 14 +- components/form/demo/required-mark.md | 4 +- components/form/demo/size.md | 12 +- components/form/demo/time-related-controls.md | 2 +- components/form/demo/validate-other.md | 18 +- components/form/demo/validate-static.md | 10 +- components/form/demo/warning-only.md | 2 +- components/form/demo/without-form-create.md | 2 +- components/grid/__tests__/gap.test.js | 7 +- components/grid/col.tsx | 4 +- components/grid/demo/basic.md | 2 +- components/grid/demo/flex-align.md | 2 +- components/grid/demo/flex-order.md | 2 +- components/grid/demo/flex-stretch.md | 2 +- components/grid/demo/flex.md | 2 +- components/grid/demo/gutter.md | 2 +- components/grid/demo/offset.md | 2 +- components/grid/demo/playground.md | 2 +- components/grid/demo/responsive-more.md | 2 +- components/grid/demo/responsive.md | 2 +- components/grid/demo/sort.md | 2 +- components/grid/demo/useBreakpoint.md | 2 +- components/grid/row.tsx | 8 +- components/icon/demo/basic.md | 6 +- components/icon/demo/custom.md | 4 +- components/icon/demo/iconfont.md | 4 +- components/icon/demo/scriptUrl.md | 4 +- components/icon/demo/two-tone.md | 4 +- components/image/__tests__/index.test.js | 50 +- components/image/demo/basic.md | 2 +- components/image/demo/controlled-preview.md | 2 +- components/image/demo/fallback.md | 2 +- components/image/demo/placeholder.md | 2 +- .../image/demo/preview-group-visible.md | 2 +- components/image/demo/preview-group.md | 2 +- components/image/demo/preview-mask.md | 4 +- components/image/demo/previewSrc.md | 2 +- components/input-number/demo/addon.md | 4 +- components/input-number/demo/basic.md | 2 +- components/input-number/demo/borderless.md | 2 +- components/input-number/demo/controls.md | 4 +- components/input-number/demo/digit.md | 2 +- components/input-number/demo/disabled.md | 2 +- components/input-number/demo/formatter.md | 2 +- components/input-number/demo/keyboard.md | 2 +- components/input-number/demo/out-of-range.md | 2 +- components/input-number/demo/prefix.md | 4 +- components/input-number/demo/size.md | 2 +- components/input-number/demo/status.md | 4 +- components/input-number/index.tsx | 28 +- components/input-number/style/rtl.less | 23 + components/input/Input.tsx | 36 +- components/input/TextArea.tsx | 11 +- components/input/__tests__/Password.test.js | 100 +- components/input/__tests__/Search.test.js | 141 +- .../__snapshots__/index.test.tsx.snap | 2 +- components/input/__tests__/focus.test.tsx | 13 +- components/input/__tests__/index.test.tsx | 224 +- components/input/__tests__/textarea.test.js | 399 +- components/input/__tests__/type.test.tsx | 11 +- components/input/demo/addon.md | 4 +- components/input/demo/align.md | 16 +- components/input/demo/allowClear.md | 2 +- components/input/demo/autosize-textarea.md | 2 +- components/input/demo/basic.md | 2 +- components/input/demo/borderless-debug.md | 2 +- components/input/demo/borderless.md | 2 +- components/input/demo/focus.md | 4 +- components/input/demo/group.md | 14 +- components/input/demo/password-input.md | 4 +- components/input/demo/presuffix.md | 4 +- components/input/demo/search-input-loading.md | 2 +- components/input/demo/search-input.md | 4 +- components/input/demo/show-count.md | 2 +- components/input/demo/size.md | 4 +- components/input/demo/status.md | 4 +- components/input/demo/textarea-resize.md | 2 +- components/input/demo/textarea-show-count.md | 2 +- components/input/demo/textarea.md | 2 +- components/input/demo/tooltip.md | 2 +- components/input/style/rtl.less | 1 + components/layout/demo/basic.md | 2 +- .../layout/demo/custom-trigger-debug.md | 14 +- components/layout/demo/custom-trigger.md | 8 +- components/layout/demo/fixed-sider.md | 6 +- components/layout/demo/fixed.md | 2 +- components/layout/demo/responsive.md | 4 +- components/layout/demo/side.md | 6 +- components/layout/demo/top-side-2.md | 6 +- components/layout/demo/top-side.md | 6 +- components/layout/demo/top.md | 2 +- components/list/__tests__/Item.test.js | 45 +- components/list/__tests__/empty.test.js | 7 +- components/list/__tests__/index.test.js | 9 +- components/list/__tests__/loading.test.js | 15 +- components/list/__tests__/pagination.test.js | 153 +- components/list/demo/basic.md | 2 +- components/list/demo/grid-test.md | 2 +- components/list/demo/grid.md | 2 +- components/list/demo/infinite-load.md | 4 +- components/list/demo/loadmore.md | 4 +- components/list/demo/responsive.md | 2 +- components/list/demo/simple.md | 2 +- components/list/demo/vertical.md | 4 +- components/list/demo/virtual-list.md | 4 +- components/list/index.tsx | 19 +- .../__snapshots__/index.test.js.snap | 5253 +++++++++++- .../locale-provider/__tests__/index.test.js | 30 +- components/locale-provider/tk_TK.tsx | 3 + components/locale/tk_TK.tsx | 132 + components/mentions/demo/async.md | 2 +- components/mentions/demo/autoSize.md | 2 +- components/mentions/demo/basic.md | 2 +- components/mentions/demo/form.md | 2 +- components/mentions/demo/placement.md | 2 +- components/mentions/demo/prefix.md | 2 +- components/mentions/demo/readonly.md | 2 +- components/mentions/demo/status.md | 2 +- components/mentions/index.tsx | 7 +- components/menu/OverrideContext.ts | 16 + .../__snapshots__/index.test.js.snap | 161 + components/menu/__tests__/index.test.js | 62 +- components/menu/__tests__/type.test.tsx | 39 + components/menu/demo/horizontal.md | 6 +- components/menu/demo/inline-collapsed.md | 12 +- components/menu/demo/inline.md | 4 +- components/menu/demo/sider-current.md | 4 +- components/menu/demo/style-debug.md | 6 +- components/menu/demo/submenu-theme.md | 6 +- components/menu/demo/switch-mode.md | 12 +- components/menu/demo/theme.md | 6 +- components/menu/demo/vertical.md | 6 +- components/menu/hooks/useItems.tsx | 10 +- components/menu/index.en-US.md | 2 +- components/menu/index.tsx | 92 +- components/message/demo/custom-style.md | 2 +- components/message/demo/duration.md | 2 +- components/message/demo/hooks.md | 2 +- components/message/demo/info.md | 2 +- components/message/demo/loading.md | 2 +- components/message/demo/other.md | 2 +- components/message/demo/thenable.md | 2 +- components/message/demo/update.md | 2 +- components/modal/Modal.tsx | 48 +- components/modal/__tests__/Modal.test.js | 76 - components/modal/__tests__/Modal.test.tsx | 93 + ...Modal.test.js.snap => Modal.test.tsx.snap} | 0 .../{demo.test.js.snap => demo.test.ts.snap} | 0 .../__tests__/{demo.test.js => demo.test.ts} | 0 .../__tests__/{hook.test.js => hook.test.tsx} | 60 +- components/modal/demo/async.md | 2 +- components/modal/demo/basic.md | 2 +- components/modal/demo/button-props.md | 2 +- components/modal/demo/confirm-router.md | 4 +- components/modal/demo/confirm.md | 4 +- components/modal/demo/footer.md | 2 +- components/modal/demo/hooks.md | 2 +- components/modal/demo/info.md | 2 +- components/modal/demo/locale.md | 4 +- components/modal/demo/manual.md | 2 +- components/modal/demo/modal-render.md | 5 +- components/modal/demo/position.md | 2 +- components/modal/demo/width.md | 2 +- components/modal/style/confirm.less | 2 +- components/modal/style/index.tsx | 1 + components/modal/style/rtl.less | 2 +- components/notification/demo/basic.md | 2 +- components/notification/demo/custom-icon.md | 4 +- components/notification/demo/custom-style.md | 2 +- components/notification/demo/duration.md | 2 +- components/notification/demo/hooks.md | 8 +- components/notification/demo/placement.md | 12 +- components/notification/demo/update.md | 2 +- components/notification/demo/with-btn.md | 2 +- components/notification/demo/with-icon.md | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 2 - components/page-header/demo/actions.md | 2 +- components/page-header/demo/basic.md | 2 +- components/page-header/demo/breadcrumb.md | 2 +- components/page-header/demo/content.md | 4 +- components/page-header/demo/ghost.md | 2 +- components/page-header/demo/responsive.md | 2 +- components/pagination/Pagination.tsx | 24 +- .../__snapshots__/demo-extend.test.ts.snap | 8 +- .../__tests__/__snapshots__/demo.test.js.snap | 8 +- components/pagination/__tests__/index.test.js | 7 +- components/pagination/demo/all.md | 2 +- components/pagination/demo/basic.md | 2 +- components/pagination/demo/changer.md | 4 +- components/pagination/demo/controlled.md | 4 +- components/pagination/demo/itemRender.md | 4 +- components/pagination/demo/jump.md | 4 +- components/pagination/demo/mini.md | 4 +- components/pagination/demo/more.md | 2 +- components/pagination/demo/simple.md | 2 +- components/pagination/demo/total.md | 2 +- components/pagination/style/index.less | 22 +- components/popconfirm/demo/async.md | 2 +- components/popconfirm/demo/basic.md | 2 +- components/popconfirm/demo/dynamic-trigger.md | 2 +- components/popconfirm/demo/icon.md | 4 +- components/popconfirm/demo/locale.md | 2 +- components/popconfirm/demo/placement.md | 2 +- components/popconfirm/demo/promise.md | 2 +- components/popconfirm/index.tsx | 23 +- .../popover/demo/arrow-point-at-center.md | 2 +- components/popover/demo/basic.md | 2 +- components/popover/demo/control.md | 2 +- components/popover/demo/hover-with-click.md | 2 +- components/popover/demo/placement.md | 2 +- components/popover/demo/triggerType.md | 2 +- components/popover/index.tsx | 8 +- components/progress/Circle.tsx | 15 +- components/progress/Line.tsx | 29 +- components/progress/Steps.tsx | 13 +- .../__snapshots__/demo-extend.test.ts.snap | 651 +- .../__tests__/__snapshots__/demo.test.js.snap | 651 +- .../__snapshots__/index.test.js.snap | 210 +- components/progress/demo/circle-dynamic.md | 4 +- components/progress/demo/circle-mini.md | 2 +- components/progress/demo/circle.md | 2 +- components/progress/demo/dashboard.md | 2 +- components/progress/demo/dynamic.md | 4 +- components/progress/demo/format.md | 2 +- components/progress/demo/gradient-line.md | 2 +- components/progress/demo/line-mini.md | 2 +- components/progress/demo/line.md | 2 +- components/progress/demo/linecap.md | 16 +- components/progress/demo/segment.md | 2 +- components/progress/demo/steps.md | 6 +- components/progress/index.en-US.md | 12 +- components/progress/index.zh-CN.md | 12 +- components/progress/progress.tsx | 203 +- components/radio/demo/badge.md | 2 +- components/radio/demo/basic.md | 2 +- components/radio/demo/disabled.md | 2 +- components/radio/demo/radiobutton-solid.md | 2 +- components/radio/demo/radiobutton.md | 4 +- components/radio/demo/radiogroup-more.md | 4 +- components/radio/demo/radiogroup-options.md | 4 +- components/radio/demo/radiogroup-with-name.md | 2 +- components/radio/demo/radiogroup.md | 4 +- components/radio/demo/size.md | 2 +- components/radio/interface.tsx | 4 +- components/radio/radio.tsx | 27 +- components/radio/style/index.less | 7 +- components/rate/demo/basic.md | 2 +- components/rate/demo/character-function.md | 4 +- components/rate/demo/character.md | 4 +- components/rate/demo/clear.md | 2 +- components/rate/demo/disabled.md | 2 +- components/rate/demo/half.md | 2 +- components/rate/demo/text.md | 2 +- components/rate/index.tsx | 7 +- components/result/__tests__/index.test.tsx | 5 +- components/result/demo/403.md | 2 +- components/result/demo/404.md | 2 +- components/result/demo/500.md | 2 +- components/result/demo/customIcon.md | 4 +- components/result/demo/error.md | 4 +- components/result/demo/info.md | 2 +- components/result/demo/success.md | 2 +- components/result/demo/warning.md | 2 +- components/select/__tests__/index.test.js | 4 +- .../select/demo/automatic-tokenization.md | 2 +- components/select/demo/basic.md | 2 +- components/select/demo/big-data.md | 4 +- components/select/demo/bordered.md | 2 +- components/select/demo/coordinate.md | 2 +- .../select/demo/custom-dropdown-menu.md | 4 +- components/select/demo/custom-tag-render.md | 2 +- components/select/demo/debug.md | 2 +- components/select/demo/hide-selected.md | 2 +- components/select/demo/label-in-value.md | 2 +- components/select/demo/multiple.md | 2 +- components/select/demo/optgroup.md | 2 +- components/select/demo/option-label-prop.md | 2 +- components/select/demo/placement.md | 6 +- components/select/demo/responsive.md | 4 +- components/select/demo/search-box.md | 4 +- components/select/demo/search-sort.md | 2 +- components/select/demo/search.md | 2 +- components/select/demo/size.md | 6 +- components/select/demo/status.md | 2 +- components/select/demo/suffix.md | 4 +- components/select/demo/tags.md | 2 +- components/select/index.tsx | 26 +- components/skeleton/demo/active.md | 2 +- components/skeleton/demo/basic.md | 2 +- components/skeleton/demo/children.md | 2 +- components/skeleton/demo/complex.md | 2 +- components/skeleton/demo/element.md | 4 +- components/skeleton/style/index.less | 32 +- components/slider/demo/basic.md | 2 +- components/slider/demo/dragableTrack.md | 2 +- components/slider/demo/event.md | 2 +- components/slider/demo/icon-slider.md | 4 +- components/slider/demo/input-number.md | 2 +- components/slider/demo/mark.md | 2 +- components/slider/demo/reverse.md | 2 +- components/slider/demo/show-tooltip.md | 2 +- components/slider/demo/tip-formatter.md | 2 +- components/slider/demo/vertical.md | 2 +- components/space/demo/align.md | 2 +- components/space/demo/base.md | 4 +- components/space/demo/customize.md | 2 +- components/space/demo/debug.md | 2 +- components/space/demo/gap-in-line.md | 2 +- components/space/demo/size.md | 4 +- components/space/demo/split.md | 2 +- components/space/demo/vertical.md | 2 +- components/space/demo/wrap.md | 2 +- components/spin/demo/basic.md | 2 +- components/spin/demo/custom-indicator.md | 4 +- components/spin/demo/delayAndDebounce.md | 2 +- components/spin/demo/inside.md | 2 +- components/spin/demo/nested.md | 2 +- components/spin/demo/size.md | 2 +- components/spin/demo/tip.md | 2 +- components/statistic/Statistic.tsx | 8 +- .../__snapshots__/demo-extend.test.ts.snap | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- components/statistic/demo/basic.md | 2 +- components/statistic/demo/card.md | 4 +- components/statistic/demo/countdown.md | 4 +- components/statistic/demo/unit.md | 4 +- components/statistic/style/index.less | 4 + .../__snapshots__/demo-extend.test.ts.snap | 175 +- .../__tests__/__snapshots__/demo.test.js.snap | 175 +- components/steps/demo/clickable.md | 2 +- .../steps/demo/customized-progress-dot.md | 4 +- components/steps/demo/error.md | 2 +- components/steps/demo/icon.md | 4 +- components/steps/demo/nav.md | 2 +- components/steps/demo/progress-debug.md | 4 +- components/steps/demo/progress-dot-small.md | 2 +- components/steps/demo/progress-dot.md | 2 +- components/steps/demo/progress.md | 2 +- components/steps/demo/simple.md | 2 +- components/steps/demo/small-size.md | 2 +- components/steps/demo/step-next.md | 2 +- components/steps/demo/steps-in-steps.md | 4 +- components/steps/demo/vertical-small.md | 2 +- components/steps/demo/vertical.md | 2 +- components/style/themes/default.less | 2 +- components/style/themes/variable.less | 2 +- components/switch/demo/basic.md | 2 +- components/switch/demo/disabled.md | 2 +- components/switch/demo/loading.md | 2 +- components/switch/demo/size.md | 2 +- components/switch/demo/text.md | 4 +- components/switch/index.tsx | 16 +- components/table/Table.tsx | 69 +- .../table/__tests__/Table.expand.test.js | 63 +- .../table/__tests__/Table.filter.test.js | 1356 +-- .../table/__tests__/Table.order.test.js | 14 +- .../table/__tests__/Table.pagination.test.js | 392 +- .../__tests__/Table.rowSelection.test.js | 53 +- .../table/__tests__/Table.sorter.test.js | 516 +- components/table/__tests__/Table.test.js | 97 +- .../__snapshots__/Table.filter.test.js.snap | 320 +- .../Table.rowSelection.test.js.snap | 2 - .../__snapshots__/demo-extend.test.ts.snap | 35 +- .../__tests__/__snapshots__/demo.test.js.snap | 8 +- .../__snapshots__/empty.test.js.snap | 70 +- components/table/__tests__/empty.test.js | 19 +- components/table/demo/ajax.md | 6 +- components/table/demo/basic.md | 4 +- components/table/demo/bordered.md | 2 +- components/table/demo/colspan-rowspan.md | 2 +- components/table/demo/custom-filter-panel.md | 10 +- components/table/demo/drag-sorting-handler.md | 8 +- components/table/demo/drag-sorting.md | 6 +- components/table/demo/dynamic-settings.md | 8 +- components/table/demo/edit-cell.md | 4 +- components/table/demo/edit-row.md | 2 +- .../table/demo/ellipsis-custom-tooltip.md | 2 +- components/table/demo/ellipsis.md | 2 +- components/table/demo/expand.md | 2 +- components/table/demo/filter-in-tree.md | 2 +- components/table/demo/filter-search.md | 2 +- components/table/demo/fixed-columns-header.md | 2 +- components/table/demo/fixed-columns.md | 2 +- components/table/demo/fixed-header.md | 2 +- components/table/demo/grouping-columns.md | 2 +- components/table/demo/head.md | 2 +- components/table/demo/jsx.md | 2 +- components/table/demo/multiple-sorter.md | 2 +- components/table/demo/narrow.md | 2 +- .../table/demo/nest-table-border-debug.md | 4 +- components/table/demo/nested-table.md | 4 +- components/table/demo/order-column.md | 2 +- components/table/demo/pagination.md | 4 +- components/table/demo/reset-filter.md | 4 +- components/table/demo/resizable-column.md | 6 +- components/table/demo/responsive.md | 2 +- .../table/demo/row-selection-and-operation.md | 4 +- .../table/demo/row-selection-custom-debug.md | 4 +- components/table/demo/row-selection-custom.md | 4 +- components/table/demo/row-selection.md | 4 +- components/table/demo/size.md | 2 +- components/table/demo/sticky.md | 4 +- components/table/demo/summary.md | 2 +- components/table/demo/tree-data.md | 6 +- components/table/demo/virtual-list.md | 6 +- .../table/hooks/useFilter/FilterDropdown.tsx | 45 +- components/table/hooks/useSelection.tsx | 37 +- components/table/index.en-US.md | 2 +- components/table/index.zh-CN.md | 2 +- components/table/interface.tsx | 14 +- components/table/style/index.less | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 18 - .../__snapshots__/index.test.js.snap | 14 +- components/tabs/__tests__/index.test.js | 30 +- components/tabs/demo/basic.md | 2 +- components/tabs/demo/card-top.md | 2 +- components/tabs/demo/card.md | 2 +- components/tabs/demo/centered.md | 2 +- components/tabs/demo/custom-add-trigger.md | 2 +- components/tabs/demo/custom-tab-bar-node.md | 4 +- components/tabs/demo/custom-tab-bar.md | 6 +- components/tabs/demo/disabled.md | 2 +- components/tabs/demo/editable-card.md | 2 +- components/tabs/demo/extra.md | 2 +- components/tabs/demo/icon.md | 4 +- components/tabs/demo/nest.md | 2 +- components/tabs/demo/position.md | 4 +- components/tabs/demo/size.md | 6 +- components/tabs/demo/slide.md | 4 +- components/tabs/index.en-US.md | 1 + components/tabs/index.zh-CN.md | 1 + components/tag/demo/animation.md | 6 +- components/tag/demo/basic.md | 2 +- components/tag/demo/checkable.md | 2 +- components/tag/demo/colorful-inverse.md | 2 +- components/tag/demo/colorful.md | 2 +- components/tag/demo/control.md | 6 +- components/tag/demo/controlled.md | 2 +- components/tag/demo/customize.md | 4 +- components/tag/demo/icon.md | 8 +- components/tag/demo/status.md | 8 +- .../time-picker/__tests__/index.test.js | 5 +- components/time-picker/demo/12hours.md | 2 +- components/time-picker/demo/addon.md | 2 +- components/time-picker/demo/basic.md | 4 +- components/time-picker/demo/bordered.md | 2 +- components/time-picker/demo/colored-popup.md | 4 +- components/time-picker/demo/disabled.md | 2 +- components/time-picker/demo/hide-column.md | 2 +- .../time-picker/demo/interval-options.md | 2 +- components/time-picker/demo/range-picker.md | 2 +- components/time-picker/demo/size.md | 2 +- components/time-picker/demo/status.md | 2 +- components/time-picker/demo/suffix.md | 6 +- components/time-picker/demo/value.md | 2 +- components/time-picker/locale/tk_TK.tsx | 8 + components/timeline/demo/alternate.md | 4 +- components/timeline/demo/basic.md | 2 +- components/timeline/demo/color.md | 4 +- components/timeline/demo/custom.md | 4 +- components/timeline/demo/label.md | 4 +- components/timeline/demo/pending.md | 2 +- components/timeline/demo/right.md | 4 +- .../tooltip/demo/arrow-point-at-center.md | 2 +- .../tooltip/demo/auto-adjust-overflow.md | 2 +- components/tooltip/demo/basic.md | 2 +- components/tooltip/demo/colorful.md | 2 +- .../tooltip/demo/destroy-tooltip-on-hide.md | 2 +- components/tooltip/demo/placement.md | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 24 +- .../__tests__/__snapshots__/demo.test.js.snap | 4 +- components/transfer/demo/advanced.md | 4 +- components/transfer/demo/basic.md | 2 +- components/transfer/demo/custom-item.md | 2 +- .../transfer/demo/custom-select-all-labels.md | 2 +- components/transfer/demo/large-data.md | 4 +- components/transfer/demo/oneWay.md | 4 +- components/transfer/demo/search.md | 2 +- components/transfer/demo/status.md | 2 +- components/transfer/demo/table-transfer.md | 8 +- components/transfer/demo/tree-transfer.md | 2 +- components/transfer/index.tsx | 23 +- components/tree-select/demo/async.md | 4 +- components/tree-select/demo/basic.md | 2 +- components/tree-select/demo/checkable.md | 2 +- components/tree-select/demo/multiple.md | 2 +- components/tree-select/demo/placement.md | 6 +- components/tree-select/demo/status.md | 2 +- components/tree-select/demo/suffix.md | 4 +- components/tree-select/demo/treeData.md | 2 +- components/tree-select/demo/treeLine.md | 2 +- components/tree-select/index.en-US.md | 1 + components/tree-select/index.tsx | 35 +- components/tree-select/index.zh-CN.md | 1 + components/tree/DirectoryTree.tsx | 50 +- .../__snapshots__/directory.test.js.snap | 1269 +-- components/tree/__tests__/directory.test.js | 146 +- .../tree/__tests__/dropIndicator.test.tsx | 24 +- components/tree/__tests__/index.test.js | 39 +- components/tree/__tests__/type.test.tsx | 11 +- components/tree/demo/basic-controlled.md | 2 +- components/tree/demo/basic.md | 2 +- components/tree/demo/big-data.md | 2 +- components/tree/demo/customized-icon.md | 8 +- components/tree/demo/directory.md | 2 +- components/tree/demo/draggable.md | 2 +- components/tree/demo/dynamic.md | 2 +- components/tree/demo/line.md | 4 +- components/tree/demo/search.md | 6 +- components/tree/demo/switcher-icon.md | 4 +- components/tree/demo/virtual-scroll.md | 2 +- components/typography/Base/index.tsx | 32 +- components/typography/__tests__/index.test.js | 39 +- components/typography/demo/basic.md | 2 +- components/typography/demo/ellipsis-debug.md | 2 +- components/typography/demo/ellipsis-middle.md | 2 +- components/typography/demo/ellipsis.md | 2 +- components/typography/demo/interactive.md | 4 +- components/typography/demo/paragraph-debug.md | 2 +- components/typography/demo/suffix.md | 2 +- components/typography/demo/text.md | 2 +- components/typography/demo/title.md | 2 +- components/typography/index.en-US.md | 2 + components/typography/index.zh-CN.md | 2 + components/typography/style/index.less | 1 - components/upload/demo/avatar.md | 4 +- components/upload/demo/basic.md | 4 +- components/upload/demo/crop-image.md | 6 +- .../upload/demo/customize-progress-bar.md | 4 +- components/upload/demo/defaultFileList.md | 4 +- components/upload/demo/directory.md | 4 +- components/upload/demo/drag-sorting.md | 8 +- components/upload/demo/drag.md | 4 +- components/upload/demo/file-type.md | 10 +- components/upload/demo/fileList.md | 6 +- components/upload/demo/max-count.md | 4 +- components/upload/demo/picture-card.md | 6 +- components/upload/demo/picture-style.md | 4 +- components/upload/demo/preview-file.md | 4 +- components/upload/demo/transform-file.md | 4 +- .../upload/demo/upload-custom-action-icon.md | 6 +- components/upload/demo/upload-manually.md | 4 +- components/upload/demo/upload-png-only.md | 4 +- .../upload/demo/upload-with-aliyun-oss.md | 4 +- components/upload/style/index.less | 2 +- docs/react/faq.en-US.md | 88 +- docs/react/faq.zh-CN.md | 88 +- docs/react/i18n.en-US.md | 3 +- docs/react/i18n.zh-CN.md | 1 + docs/spec/buttons.zh-CN.md | 6 +- package.json | 35 +- scripts/print-changelog.js | 7 +- scripts/resolve-md-conflict.js | 48 + tests/__mocks__/copy-to-clipboard.js | 3 +- tests/shared/imageTest.tsx | 4 +- tests/utils.ts | 17 +- typings/jest-image-snapshot.d.ts | 145 - webpack.config.js | 16 +- 841 files changed, 24301 insertions(+), 8990 deletions(-) create mode 100644 components/calendar/locale/tk_TK.tsx delete mode 100644 components/card/__tests__/__snapshots__/index.test.js.snap create mode 100644 components/card/__tests__/__snapshots__/index.test.tsx.snap rename components/card/__tests__/{index.test.js => index.test.tsx} (72%) create mode 100644 components/config-provider/DisabledContext.tsx delete mode 100644 components/config-provider/__tests__/__snapshots__/index.test.js.snap create mode 100644 components/config-provider/__tests__/pagination.test.tsx rename components/config-provider/{renderEmpty.tsx => defaultRenderEmpty.tsx} (73%) create mode 100644 components/date-picker/locale/tk_TK.tsx create mode 100644 components/form/demo/disabled.md create mode 100644 components/locale-provider/tk_TK.tsx create mode 100644 components/locale/tk_TK.tsx create mode 100644 components/menu/OverrideContext.ts create mode 100644 components/menu/__tests__/type.test.tsx delete mode 100644 components/modal/__tests__/Modal.test.js create mode 100644 components/modal/__tests__/Modal.test.tsx rename components/modal/__tests__/__snapshots__/{Modal.test.js.snap => Modal.test.tsx.snap} (100%) rename components/modal/__tests__/__snapshots__/{demo.test.js.snap => demo.test.ts.snap} (100%) rename components/modal/__tests__/{demo.test.js => demo.test.ts} (100%) rename components/modal/__tests__/{hook.test.js => hook.test.tsx} (70%) create mode 100644 components/time-picker/locale/tk_TK.tsx create mode 100644 scripts/resolve-md-conflict.js delete mode 100644 typings/jest-image-snapshot.d.ts diff --git a/.github/workflows/pr-check-ci.yml b/.github/workflows/pr-check-ci.yml index 054c1e052270..b065fa90d9c6 100644 --- a/.github/workflows/pr-check-ci.yml +++ b/.github/workflows/pr-check-ci.yml @@ -28,4 +28,4 @@ jobs: success-review: true success-merge: true merge-method: 'merge' - merge-title: 'chore: auto merge branchs (#${number})' + merge-title: 'chore: auto merge branches (#${number})' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 760f34640a0b..85a76bb0f2dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -138,7 +138,7 @@ jobs: key: dist-${{ github.sha }} - name: dist - run: npm run dist + run: CI=1 npm run dist env: NODE_OPTIONS: --max_old_space_size=4096 needs: setup @@ -236,6 +236,7 @@ jobs: matrix: react: ['16', '17', '18'] module: ['dom', 'node', 'dist'] + shard: ['1/2', '2/2'] env: REACT: ${{ matrix.react }} runs-on: ubuntu-latest @@ -288,12 +289,11 @@ jobs: # dom test - name: dom test if: ${{ matrix.module == 'dom' }} - run: npm test -- -w 1 --coverage + run: npm test -- --maxWorkers=2 --shard=${{matrix.shard}} --coverage - # > 17 only - name: coverage + uses: codecov/codecov-action@v3 if: ${{ matrix.module == 'dom' && matrix.react == '17' }} - run: bash <(curl -s https://codecov.io/bash) # node test - name: node test @@ -353,6 +353,7 @@ jobs: matrix: react: ['16', '17', '18'] module: [lib, es] + shard: ['1/2', '2/2'] env: REACT: ${{ matrix.react }} steps: @@ -400,7 +401,7 @@ jobs: - name: test # lib only run in master branch not in pull request if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} - run: npm test + run: npm test -- --maxWorkers=2 --shard=${{matrix.shard}} env: LIB_DIR: ${{ matrix.module }} needs: compile diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index b1314909226b..1bb2a0cafbb8 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -9,7 +9,7 @@ timeline: true | infrad version | antd version | update content | time | | --- | --- | --- | --- | -| 4.20.6 | 4.20.6 | Synchronize the update of antd 4.20.6 version | 2022-05-30 | +| 4.21.0 | 4.21.0 | 1.Synchronize the update of antd 4.21.0 version
2.Modify a part of UI of table header | 2022-06-09 | | 4.20.4 | 4.20.4 | Synchronize the update of antd 4.20.4 version | 2022-05-13 | | 4.20.0 | 4.20.0 | Synchronize the update of antd 4.20.0 version | 2022-04-26 | | 4.19.5 | 4.19.5 | Synchronize the update of antd 4.19.5 version | 2022-04-07 | @@ -34,6 +34,62 @@ if you have some problem, welcome to connect `taofeng.yang@shopee.com` or `lay.z --- +## 4.21.0 + +`2022-06-06` + +- 🔥 Add Form level control input component `disabled`. [#35210](https://github.com/ant-design/ant-design/pull/35210) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Tabs support `popupClassName` for more Dropdown. [#35892](https://github.com/ant-design/ant-design/pull/35892) +- 🆕 Table `rowSelection.onChange` support `info.type` param. [#35598](https://github.com/ant-design/ant-design/pull/35598) +- 🆕 The `copyable` prop of Typography.Paragraph supports to reset the mime type of the clipboardData by the `format`. [#35219](https://github.com/ant-design/ant-design/pull/35219) [@kanweiwei](https://github.com/kanweiwei) +- 🆕 TreeSelect support `treeExpandAction`. [#35618](https://github.com/ant-design/ant-design/pull/35618) [@NE-SmallTown](https://github.com/NE-SmallTown) +- ConfigProvider + - 🆕 ConfigProvider support config Pagination `showSizeChanger`. [#35750](https://github.com/ant-design/ant-design/pull/35750) + - 🆕 ConfigProvider support `componentDisabled` to config components `disabled` status. [#35718](https://github.com/ant-design/ant-design/pull/35718) + - 🛠 Refactor ConfigProvider removing default `renderEmpty` to resolve dist circle deps. [#35570](https://github.com/ant-design/ant-design/pull/35570) +- Collapse + - 🛠 Refactor Collapse to keep stable dom structure with header content. [#35781](https://github.com/ant-design/ant-design/pull/35781) + - 🛠 Refactor Collapse `expandIconPosition` with logical position `start` or `end` to resolve RTL style issue. [#35770](https://github.com/ant-design/ant-design/pull/35770) +- Progress + - 🆕 Progress steps support custom strokeColor for each step. [#35855](https://github.com/ant-design/ant-design/pull/35855) + - 🛠 Refactor Progress `type="circle"` and `type="dashboard"` for simpler dom structure and better rendering. [#35433](https://github.com/ant-design/ant-design/pull/35433) + - 🛠 Refactor Progress to React hooks. [#35393](https://github.com/ant-design/ant-design/pull/35393) [@shuaijiumei](https://github.com/shuaijiumei) + - 🐞 Fix Progress percent accuracy issue when near 100%. [#35433](https://github.com/ant-design/ant-design/pull/35433) + - 🐞 Fix Progress `gapDegree` displayed with wrong degree when `type="dashboard"`. [#35433](https://github.com/ant-design/ant-design/pull/35433) + - 💄 Fix Progress border radius style when `type="line"` and `strokeLinecap="butt"`. [#35822](https://github.com/ant-design/ant-design/pull/35822) +- Dropdown + - 🆕 Dropdown support `autoFocus` to focus elements in `overlay` automaticly when opened. [#35391](https://github.com/ant-design/ant-design/pull/35391) + - 🛠 Fix Dropdown nesting menu injection logic. [#35810](https://github.com/ant-design/ant-design/pull/35810) +- Card + - 🛠 Refactor Card `loading` with Skeleton. [#35525](https://github.com/ant-design/ant-design/pull/35525) + - 🛠 Refactor Card style to use flex instead of float. [#35236](https://github.com/ant-design/ant-design/pull/35236) [@miracles1919](https://github.com/miracles1919) +- 🛠 DatePicker refactored to React hooks. [#35425](https://github.com/ant-design/ant-design/pull/35425) [@heiyu4585](https://github.com/heiyu4585) +- 🛠 Rename className of Pagination `mini` mode with `ant-pagination-mini`. [#35881](https://github.com/ant-design/ant-design/pull/35881) +- 🛠 Refactor Popconfirm internal realize with Popover component. [#35676](https://github.com/ant-design/ant-design/pull/35676) +- 🛠 Change the implementation of the bottom button layout of the Modal confirm component. [#35530](https://github.com/ant-design/ant-design/pull/35530) [@foryuki](https://github.com/foryuki) +- 🐞 Fix the Wave effect does not work in React 18 strict mode. [#35889](https://github.com/ant-design/ant-design/pull/35889) [@Carrotzpc](https://github.com/Carrotzpc) +- 🐞 Fix Drawer close twice `children` will undefined. [#35853](https://github.com/ant-design/ant-design/pull/35853) [@crazyair](https://github.com/crazyair) +- Skeleton + - 💄 Remove Skeleton default `margin-top` style. [#35848](https://github.com/ant-design/ant-design/pull/35848) + - 💄 Optimize Skeleton `active` animation perfermance. [#35836](https://github.com/ant-design/ant-design/pull/35836) [@slotDumpling](https://github.com/slotDumpling) +- 💄 Remove `!important` in Radio style with `disabled`. [#35920](https://github.com/ant-design/ant-design/pull/35920) +- TypeScript + - 🤖 Fix Form.List type `FormListFieldData` missing property `fieldKey`. [#35884](https://github.com/ant-design/ant-design/pull/35884) [@nanianlisao](https://github.com/nanianlisao) +- 🌐 Localization + - 🇹🇲 Add a new locale `tk_TK`. [#35605](https://github.com/ant-design/ant-design/pull/35605) +- RTL + - 💄 Fix the wrong direction of `border` and `border-radius` for InputNumber and Input in RTL mode. [#35876](https://github.com/ant-design/ant-design/pull/35876) [@yykoypj](https://github.com/yykoypj) + +## 4.20.7 + +`2022-05-30` + +- 🐞 Fix Drawer form instance lost bug when opened. [#35706](https://github.com/ant-design/ant-design/pull/35706) [@crazyair](https://github.com/crazyair) +- 🐞 Fix Segmented options invalid space between icon and text when using the icon prop. [#35701](https://github.com/ant-design/ant-design/pull/35701) +- 💄 Optimize Popover arrow style. [#35717](https://github.com/ant-design/ant-design/pull/35717) +- TypeScript + - 🤖 Fix Card type hints problem. [#35753](https://github.com/ant-design/ant-design/pull/35753) + ## 4.20.6 `2022-05-22` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index fb0d26c5621a..f1ae30f2f189 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -9,6 +9,7 @@ timeline: true | infrad 版本号 | 对应 antd 版本号 | 更新内容 | 时间 | | --- | --- | --- | --- | +| 4.21.0 | 4.21.0 | 1.同步 antd 4.21.0 版本的更新
2.修改 table 表头部分 UI | 2022-06-09 | | 4.20.6 | 4.20.6 | 同步 antd 4.20.6 版本的更新 | 2022-05-30 | | 4.20.4 | 4.20.4 | 同步 antd 4.20.4 版本的更新 | 2022-05-13 | | 4.20.0 | 4.20.0 | 同步 antd 4.20.0 版本的更新 | 2022-04-26 | @@ -34,6 +35,62 @@ timeline: true --- +## 4.21.0 + +`2022-06-06` + +- 🔥 新增 Form 级别控制输入组件 `disabled`。[#35210](https://github.com/ant-design/ant-design/pull/35210) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Tabs 组件支持 `popupClassName` 用于更多菜单。[#35892](https://github.com/ant-design/ant-design/pull/35892) +- 🆕 Table 组件 `rowSelection.onChange` 新增 `info.type` 参数。[#35598](https://github.com/ant-design/ant-design/pull/35598) +- 🆕 Typography.Paragraph 的 `copyable` 属性支持 `format` 以重置剪切板数据的 Mime Type。[#35219](https://github.com/ant-design/ant-design/pull/35219) [@kanweiwei](https://github.com/kanweiwei) +- 🆕 TreeSelect 支持 `treeExpandAction` 定义展开操作。[#35618](https://github.com/ant-design/ant-design/pull/35618) [@NE-SmallTown](https://github.com/NE-SmallTown) +- ConfigProvider + - 🆕 ConfigProvider 支持全局配置 Pagination `showSizeChanger` 属性。[#35750](https://github.com/ant-design/ant-design/pull/35750) + - 🆕 ConfigProvider 支持 `componentDisabled` 来配置组件禁用状态。[#35718](https://github.com/ant-design/ant-design/pull/35718) + - 🛠 重构 ConfigProvider 移除默认的 `renderEmpty` 方法以解决打包循环依赖的问题。[#35570](https://github.com/ant-design/ant-design/pull/35570) +- Collapse + - 🛠 重构 Collapse 标题部分以确保其稳定的 DOM 结构易于样式选择。[#35781](https://github.com/ant-design/ant-design/pull/35781) + - 🛠 重构 Collapse `expandIconPosition` 为逻辑位置 `start` 与 `end` 以解决 RTL 下的样式问题。[#35770](https://github.com/ant-design/ant-design/pull/35770) +- Progress + - 🆕 Progress 分步进度条支持单独自定义色彩。[#35855](https://github.com/ant-design/ant-design/pull/35855) + - 🛠 重构 Progress `type="circle"` 和 `type="dashboard"` 以简化 dom 结构和带来更好的渲染效果。[#35433](https://github.com/ant-design/ant-design/pull/35433) + - 🛠 重构 Progress 成 React hooks。[#35393](https://github.com/ant-design/ant-design/pull/35393) [@shuaijiumei](https://github.com/shuaijiumei) + - 🐞 修复 Progress 进度接近 100% 间距几乎消失的问题。[#35433](https://github.com/ant-design/ant-design/pull/35433) + - 🐞 修复 Progress `type="dashboard"` 的 `gapDegree` 角度不准确的问题。[#35433](https://github.com/ant-design/ant-design/pull/35433) + - 💄 修复 Progress `type="line"` 和 `strokeLinecap="butt"` 时的圆角样式。[#35822](https://github.com/ant-design/ant-design/pull/35822) +- Dropdown + - 🆕 Dropdown 支持 `autoFocus` 属性,打开时自动聚焦下拉单。[#35391](https://github.com/ant-design/ant-design/pull/35391) + - 🛠 修复 Dropdown 嵌套菜单注入逻辑。[#35810](https://github.com/ant-design/ant-design/pull/35810) +- Card + - 🛠 使用 Skeleton 重构 Card `loading` 属性。[#35525](https://github.com/ant-design/ant-design/pull/35525) + - 🛠 重构 Card 样式用 flex 代替 float。[#35236](https://github.com/ant-design/ant-design/pull/35236) [@miracles1919](https://github.com/miracles1919) +- 🛠 DatePicker 重构成 React hooks。[#35425](https://github.com/ant-design/ant-design/pull/35425) [@heiyu4585](https://github.com/heiyu4585) +- 🛠 将 Pagination `mini` 模式的 className 重命名为 `ant-pagination-mini`。[#35881](https://github.com/ant-design/ant-design/pull/35881) +- 🛠 重构 Popconfirm 内部实现为 Popover 组件。[#35676](https://github.com/ant-design/ant-design/pull/35676) +- 🛠 改变 Modal confirm 组件底部按钮布局实现方式。[#35530](https://github.com/ant-design/ant-design/pull/35530) [@foryuki](https://github.com/foryuki) +- 🐞 修复波浪效果在 React 18 严格模式不生效的问题。[#35889](https://github.com/ant-design/ant-design/pull/35889) [@Carrotzpc](https://github.com/Carrotzpc) +- 🐞 修复 Drawer 关闭 2 次后 `children` 为 undefined 的问题。[#35853](https://github.com/ant-design/ant-design/pull/35853) [@crazyair](https://github.com/crazyair) +- Skeleton + - 💄 移除 Skeleton 默认的 `margin-top` 以便在默认情况下更对称。[#35848](https://github.com/ant-design/ant-design/pull/35848) + - 💄 优化 Skeleton `active` 的动画性能。[#35836](https://github.com/ant-design/ant-design/pull/35836) [@slotDumpling](https://github.com/slotDumpling) +- 💄 移除 Radio 禁用状态时样式中的 `!important`。[#35920](https://github.com/ant-design/ant-design/pull/35920) +- TypeScript + - 🤖 修复 Form.List 类型 `FormListFieldData` 缺失属性 `fieldKey`。[#35884](https://github.com/ant-design/ant-design/pull/35884) [@nanianlisao](https://github.com/nanianlisao) +- 🌐 国际化 + - 🇹🇲 添加土库曼语国际化。[#35605](https://github.com/ant-design/ant-design/pull/35605) +- RTL + - 💄 修正 Input 和 InputNumber 的 `border` 和 `border-radius` 在 RTL 模式下的方向问题。[#35876](https://github.com/ant-design/ant-design/pull/35876) [@yykoypj](https://github.com/yykoypj) + +## 4.20.7 + +`2022-05-30` + +- 🐞 修复 Drawer 打开时 form 实例为 null 的问题。[#35706](https://github.com/ant-design/ant-design/pull/35706) [@crazyair](https://github.com/crazyair) +- 🐞 修复 Segmented 组件中选项使用 icon 属性时图标与文字之间的间距失效问题。[#35701](https://github.com/ant-design/ant-design/pull/35701) +- 💄 优化 Popover 的箭头效果。[#35717](https://github.com/ant-design/ant-design/pull/35717) +- TypeScript + - 🤖 修复 Card 组件的类型提示。[#35753](https://github.com/ant-design/ant-design/pull/35753) + ## 4.20.6 `2022-05-22` diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index fe233bad9b33..5f7d6998509a 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS'; -import { supportRef, composeRef } from 'rc-util/lib/ref'; -import raf from './raf'; +import { composeRef, supportRef } from 'rc-util/lib/ref'; +import * as React from 'react'; import type { ConfigConsumerProps, CSPConfig } from '../config-provider'; import { ConfigConsumer, ConfigContext } from '../config-provider'; +import raf from './raf'; import { cloneElement } from './reactNode'; let styleForPseudo: HTMLStyleElement | null; @@ -55,6 +55,7 @@ export default class Wave extends React.Component { context: ConfigConsumerProps; componentDidMount() { + this.destroyed = false; const node = this.containerRef.current as HTMLDivElement; if (!node || node.nodeType !== 1) { return; diff --git a/components/affix/__tests__/Affix.test.tsx b/components/affix/__tests__/Affix.test.tsx index 4bee04c5eb00..5d3b0473d2b8 100644 --- a/components/affix/__tests__/Affix.test.tsx +++ b/components/affix/__tests__/Affix.test.tsx @@ -1,13 +1,13 @@ -import React from 'react'; import type { ReactWrapper } from 'enzyme'; import { mount } from 'enzyme'; -import type { AffixProps, AffixState } from '..'; +import React from 'react'; +import type { AffixProps, AffixState, InternalAffixClass } from '..'; import Affix from '..'; -import { getObserverEntities } from '../utils'; -import Button from '../../button'; -import rtlTest from '../../../tests/shared/rtlTest'; import accessibilityTest from '../../../tests/shared/accessibilityTest'; -import { sleep, render } from '../../../tests/utils'; +import rtlTest from '../../../tests/shared/rtlTest'; +import { render, sleep } from '../../../tests/utils'; +import Button from '../../button'; +import { getObserverEntities } from '../utils'; const events: Partial) => void>> = {}; @@ -60,7 +60,6 @@ describe('Affix Render', () => { const domMock = jest.spyOn(HTMLElement.prototype, 'getBoundingClientRect'); let affixMounterWrapper: ReactWrapper; - let affixWrapper: ReactWrapper>; const classRect: Record = { container: { @@ -143,15 +142,35 @@ describe('Affix Render', () => { }); describe('updatePosition when target changed', () => { - it('function change', () => { + it('function change', async () => { document.body.innerHTML = '
'; const container = document.querySelector('#id') as HTMLDivElement; const getTarget = () => container; - affixWrapper = mount({null}); - affixWrapper.setProps({ target: () => null }); - expect(affixWrapper.find('Affix').last().state().status).toBe(0); - expect(affixWrapper.find('Affix').last().state().affixStyle).toBe(undefined); - expect(affixWrapper.find('Affix').last().state().placeholderStyle).toBe(undefined); + let affixInstance: InternalAffixClass; + const { rerender } = render( + { + affixInstance = node as InternalAffixClass; + }} + target={getTarget} + > + {null} + , + ); + rerender( + { + affixInstance = node as InternalAffixClass; + }} + target={() => null} + > + {null} + , + ); + expect(affixInstance!.state.status).toBe(0); + expect(affixInstance!.state.affixStyle).toBe(undefined); + expect(affixInstance!.state.placeholderStyle).toBe(undefined); + await sleep(100); }); it('instance change', async () => { @@ -163,13 +182,12 @@ describe('Affix Render', () => { const originLength = getObserverLength(); const getTarget = () => target; - affixWrapper = mount({null}); + const { rerender } = render({null}); await sleep(100); expect(getObserverLength()).toBe(originLength + 1); target = null; - affixWrapper.setProps({}); - affixWrapper.update(); + rerender({null}); await sleep(100); expect(getObserverLength()).toBe(originLength); }); diff --git a/components/affix/demo/basic.md b/components/affix/demo/basic.md index a444582071e5..53b3cd7c67bf 100644 --- a/components/affix/demo/basic.md +++ b/components/affix/demo/basic.md @@ -14,8 +14,8 @@ title: The simplest usage. ```tsx -import React, { useState } from 'react'; import { Affix, Button } from 'infrad'; +import React, { useState } from 'react'; const App: React.FC = () => { const [top, setTop] = useState(10); diff --git a/components/affix/demo/debug.md b/components/affix/demo/debug.md index 3b1464b05d5f..1eae61cd172a 100644 --- a/components/affix/demo/debug.md +++ b/components/affix/demo/debug.md @@ -15,8 +15,8 @@ DEBUG DEBUG ```tsx -import React, { useState } from 'react'; import { Affix, Button } from 'infrad'; +import React, { useState } from 'react'; const App: React.FC = () => { const [top, setTop] = useState(10); diff --git a/components/affix/demo/on-change.md b/components/affix/demo/on-change.md index 888bfb2734d0..8bba52921170 100644 --- a/components/affix/demo/on-change.md +++ b/components/affix/demo/on-change.md @@ -14,8 +14,8 @@ title: Callback with affixed state. ```tsx -import React from 'react'; import { Affix, Button } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( console.log(affixed)}> diff --git a/components/affix/demo/target.md b/components/affix/demo/target.md index 7f10668a4fe0..3f5769fd6105 100644 --- a/components/affix/demo/target.md +++ b/components/affix/demo/target.md @@ -14,8 +14,8 @@ title: Set a `target` for 'Affix', which is listen to scroll event of target element (default is `window`). ```tsx -import React, { useState } from 'react'; import { Affix, Button } from 'infrad'; +import React, { useState } from 'react'; const App: React.FC = () => { const [container, setContainer] = useState(null); diff --git a/components/affix/index.tsx b/components/affix/index.tsx index b0c7ee139c76..8de5817709d7 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -1,17 +1,17 @@ -import * as React from 'react'; import classNames from 'classnames'; -import omit from 'rc-util/lib/omit'; import ResizeObserver from 'rc-resize-observer'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigContext } from '../config-provider'; import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame'; import { addObserveTarget, - removeObserveTarget, - getTargetRect, - getFixedTop, getFixedBottom, + getFixedTop, + getTargetRect, + removeObserveTarget, } from './utils'; function getDefaultTarget() { @@ -296,6 +296,8 @@ class Affix extends React.Component { ); } } +// just use in test +export type InternalAffixClass = Affix; const AffixFC = React.forwardRef((props, ref) => { const { prefixCls: customizePrefixCls } = props; diff --git a/components/alert/demo/action.md b/components/alert/demo/action.md index d22a048fedd2..6efaa4c50d71 100644 --- a/components/alert/demo/action.md +++ b/components/alert/demo/action.md @@ -14,8 +14,8 @@ title: Custom action. ```tsx -import React from 'react'; import { Alert, Button, Space } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( <> diff --git a/components/alert/demo/banner.md b/components/alert/demo/banner.md index 12b457befeca..34768105541a 100644 --- a/components/alert/demo/banner.md +++ b/components/alert/demo/banner.md @@ -15,8 +15,8 @@ title: Display Alert as a banner at top of page. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( <> diff --git a/components/alert/demo/basic.md b/components/alert/demo/basic.md index e79f6fdd0b77..cf1b203e147b 100644 --- a/components/alert/demo/basic.md +++ b/components/alert/demo/basic.md @@ -14,8 +14,8 @@ title: The simplest usage for short messages. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ; diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md index ba9038e3c163..474a06359188 100644 --- a/components/alert/demo/closable.md +++ b/components/alert/demo/closable.md @@ -14,8 +14,8 @@ title: To show close button. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const onClose = (e: React.MouseEvent) => { console.log(e, 'I was closed.'); diff --git a/components/alert/demo/close-text.md b/components/alert/demo/close-text.md index a48c5c96cdc4..858a5660203d 100644 --- a/components/alert/demo/close-text.md +++ b/components/alert/demo/close-text.md @@ -14,8 +14,8 @@ title: Replace the default icon with customized text. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ; diff --git a/components/alert/demo/custom-icon.md b/components/alert/demo/custom-icon.md index d1421550d8f1..6b593cdf422c 100644 --- a/components/alert/demo/custom-icon.md +++ b/components/alert/demo/custom-icon.md @@ -15,9 +15,9 @@ title: A relevant icon makes information clearer and more friendly. ```tsx -import React from 'react'; -import { Alert } from 'infrad'; import { SmileOutlined } from 'infra-design-icons'; +import { Alert } from 'infrad'; +import React from 'react'; const icon = ; diff --git a/components/alert/demo/description.md b/components/alert/demo/description.md index b914f3848e66..a858d0f07900 100644 --- a/components/alert/demo/description.md +++ b/components/alert/demo/description.md @@ -14,8 +14,8 @@ title: Additional description for alert message. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( <> diff --git a/components/alert/demo/error-boundary.md b/components/alert/demo/error-boundary.md index 6b2dc78ecbd9..ca36249985bc 100644 --- a/components/alert/demo/error-boundary.md +++ b/components/alert/demo/error-boundary.md @@ -14,8 +14,8 @@ title: ErrorBoundary Component for making error handling easier in [React](https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html). ```tsx +import { Alert, Button } from 'infrad'; import React, { useState } from 'react'; -import { Button, Alert } from 'infrad'; const { ErrorBoundary } = Alert; const ThrowError: React.FC = () => { diff --git a/components/alert/demo/icon.md b/components/alert/demo/icon.md index faebfd19061b..294e2f6dbbe5 100644 --- a/components/alert/demo/icon.md +++ b/components/alert/demo/icon.md @@ -14,8 +14,8 @@ title: A relevant icon will make information clearer and more friendly. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( <> diff --git a/components/alert/demo/loop-banner.md b/components/alert/demo/loop-banner.md index 9587f2deeb06..dcb0375b8747 100644 --- a/components/alert/demo/loop-banner.md +++ b/components/alert/demo/loop-banner.md @@ -14,10 +14,10 @@ title: Show a loop banner by using with [react-text-loop-next](https://npmjs.com/package/react-text-loop-next) or [react-fast-marquee](https://npmjs.com/package/react-fast-marquee). ```tsx +import { Alert } from 'infrad'; import React from 'react'; -import { Alert } from 'antd'; -import { TextLoop } from 'react-text-loop-next'; import Marquee from 'react-fast-marquee'; +import { TextLoop } from 'react-text-loop-next'; const App: React.FC = () => ( <> diff --git a/components/alert/demo/smooth-closed.md b/components/alert/demo/smooth-closed.md index 9b5a93eec9bb..1ae5a20bdc30 100644 --- a/components/alert/demo/smooth-closed.md +++ b/components/alert/demo/smooth-closed.md @@ -14,8 +14,8 @@ title: Smoothly unmount Alert upon close. ```tsx -import React, { useState } from 'react'; import { Alert } from 'infrad'; +import React, { useState } from 'react'; const App: React.FC = () => { const [visible, setVisible] = useState(true); diff --git a/components/alert/demo/style.md b/components/alert/demo/style.md index 32467a334cf3..fa1caed430f1 100644 --- a/components/alert/demo/style.md +++ b/components/alert/demo/style.md @@ -14,8 +14,8 @@ title: There are 4 types of Alert: `success`, `info`, `warning`, `error`. ```tsx -import React from 'react'; import { Alert } from 'infrad'; +import React from 'react'; const App: React.FC = () => ( <> diff --git a/components/anchor/demo/basic.md b/components/anchor/demo/basic.md index 1cdc3b0ca22a..e1f23727435b 100644 --- a/components/anchor/demo/basic.md +++ b/components/anchor/demo/basic.md @@ -14,8 +14,8 @@ title: The simplest usage. ```tsx -import React from 'react'; import { Anchor } from 'infrad'; +import React from 'react'; const { Link } = Anchor; diff --git a/components/anchor/demo/customizeHighlight.md b/components/anchor/demo/customizeHighlight.md index 3e3e8b3ea9f5..25a8bd87d8e5 100644 --- a/components/anchor/demo/customizeHighlight.md +++ b/components/anchor/demo/customizeHighlight.md @@ -14,8 +14,8 @@ title: Customize the anchor highlight. ```tsx -import React from 'react'; import { Anchor } from 'infrad'; +import React from 'react'; const { Link } = Anchor; diff --git a/components/anchor/demo/onChange.md b/components/anchor/demo/onChange.md index 29bea99a3554..451ae617919d 100644 --- a/components/anchor/demo/onChange.md +++ b/components/anchor/demo/onChange.md @@ -14,8 +14,8 @@ title: Listening for anchor link change. ```tsx -import React from 'react'; import { Anchor } from 'infrad'; +import React from 'react'; const { Link } = Anchor; diff --git a/components/anchor/demo/onClick.md b/components/anchor/demo/onClick.md index a03ae2092946..db0487bfbd99 100644 --- a/components/anchor/demo/onClick.md +++ b/components/anchor/demo/onClick.md @@ -14,8 +14,8 @@ title: Clicking on an anchor does not record history. ```tsx -import React from 'react'; import { Anchor } from 'infrad'; +import React from 'react'; const { Link } = Anchor; diff --git a/components/anchor/demo/static.md b/components/anchor/demo/static.md index 1c1f8b4a42d3..bec253aa677d 100644 --- a/components/anchor/demo/static.md +++ b/components/anchor/demo/static.md @@ -14,8 +14,8 @@ title: Do not change state when page is scrolling. ```tsx -import React from 'react'; import { Anchor } from 'infrad'; +import React from 'react'; const { Link } = Anchor; diff --git a/components/anchor/demo/targetOffset.md b/components/anchor/demo/targetOffset.md index 840ebe5702d2..35d46cc5dccc 100644 --- a/components/anchor/demo/targetOffset.md +++ b/components/anchor/demo/targetOffset.md @@ -14,8 +14,8 @@ title: Anchor target scroll to screen center. ```tsx -import React, { useState, useEffect } from 'react'; import { Anchor } from 'infrad'; +import React, { useEffect, useState } from 'react'; const { Link } = Anchor; diff --git a/components/auto-complete/__tests__/focus.test.js b/components/auto-complete/__tests__/focus.test.js index 2f4193f75f57..0a931765e727 100644 --- a/components/auto-complete/__tests__/focus.test.js +++ b/components/auto-complete/__tests__/focus.test.js @@ -1,6 +1,6 @@ -import React from 'react'; -import { mount } from 'enzyme'; +import { act } from 'react-dom/test-utils'; import AutoComplete from '..'; +import { render } from '../../../tests/utils'; describe('AutoComplete children could be focus', () => { beforeAll(() => { @@ -23,25 +23,35 @@ describe('AutoComplete children could be focus', () => { it('focus() and onFocus', () => { const handleFocus = jest.fn(); - const wrapper = mount(, { attachTo: container }); - wrapper.find('input').instance().focus(); - jest.runAllTimers(); + const { container: wrapper } = render(, { + attachTo: container, + }); + wrapper.querySelector('input').focus(); + act(() => { + jest.runAllTimers(); + }); expect(handleFocus).toHaveBeenCalled(); }); it('blur() and onBlur', () => { const handleBlur = jest.fn(); - const wrapper = mount(, { attachTo: container }); - wrapper.find('input').instance().focus(); - jest.runAllTimers(); - wrapper.find('input').instance().blur(); - jest.runAllTimers(); + const { container: wrapper } = render(, { + attachTo: container, + }); + wrapper.querySelector('input').focus(); + act(() => { + jest.runAllTimers(); + }); + wrapper.querySelector('input').blur(); + act(() => { + jest.runAllTimers(); + }); expect(handleBlur).toHaveBeenCalled(); }); it('child.ref should work', () => { const mockRef = jest.fn(); - mount( + render( , @@ -51,7 +61,7 @@ describe('AutoComplete children could be focus', () => { it('child.ref instance should support be focused and blured', () => { let inputRef; - mount( + render( { diff --git a/components/auto-complete/__tests__/index.test.js b/components/auto-complete/__tests__/index.test.js index 702e885278a6..7c239bd800aa 100644 --- a/components/auto-complete/__tests__/index.test.js +++ b/components/auto-complete/__tests__/index.test.js @@ -1,30 +1,29 @@ -import React from 'react'; -import { mount } from 'enzyme'; import AutoComplete from '..'; -import Input from '../../input'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render } from '../../../tests/utils'; +import Input from '../../input'; describe('AutoComplete', () => { mountTest(AutoComplete); rtlTest(AutoComplete); it('AutoComplete with custom Input render perfectly', () => { - const wrapper = mount( + const { container } = render(