From 08d6842d74b2999caf34a5d3cebf9b68c7ab37ca Mon Sep 17 00:00:00 2001 From: zhanglei66 <38252062+zhanglei66@users.noreply.github.com> Date: Wed, 6 Apr 2022 14:55:37 +0800 Subject: [PATCH] Zl/v4.19.3 sync (#60) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Warning: Encountered two children with the same key, 'seperator' (#33649) * fix: Warning: Encountered two children with the same key, 'seperator' #33183 * eslint-disable-next-line react/no-array-index-key Co-authored-by: dimbslmh * feat: resolves issue 33572 re aria-sort on tables (#33603) * feat: resolves issue 33572 re aria-sort on tables * fixing snapshots * removing code that can't be hit anyway * feat: add skeleton input block (#33672) * feat: add skeleton input block * update: skeleton shapshot * test: improve layout demo (#33653) * test: improve layout demo * test: improve layout demo * update snapshot * fix: checkbox group support options other than string (#33678) * fix: checkbox group support options other than string * docs: update checkbox docs * fix: radio group support value other than string * fix: only support number and string * docs: update group options type * fix: Image 图片底部空白 #30825 (#33631) * fix: remove input showCount attribute from parent component (#33686) * ci: simple files check actions * ci: preview-deploy download add run_id (#33680) * feat: dropdown support arrow pointing at center (#33658) * feat: add pointAtCenter prop for dropdown * feat: dropdown support arrow pointing at center * chore: code clean * chore: use getPlacements in tooltip * feat: dropdown support 'top' and 'bottom' * chore: update snapshot * chore: move placements to util folder * feat: make 'topCenter' and 'bottomCenter' in Dropdown deprecated * test: update snapshot * test: add test for topCenter and bottomCenter * fix: Form validateMessages in nested ConfigProvider (#33705) close #33691 * fix: Input can not be hidden when prefix is set (#33706) * fix: Input can not be hidden when prefix is set * test: jest case for #33692 Co-authored-by: hydraZty * fix: align issue (#33709) * fix: align issue close #33703 * update snapshot * fix: Steps tail shouldn't show when type is navigation and labelPlacement is vertical (fix #33681) (#33716) * Steps tail shouldn't show when type is navigation and labelPlacement is vertical (fix #33681) * fix: Steps tail shouldn't show when type is navigation and labelPlacement is vertical close #33681 * fix: Steps tail shouldn't show when type is navigation and labelPlacement is vertical close #33681 * fix: shake issue. (#33726) * docs: add controlled preview demo for Image (#33727) * docs: add controlled preview demo for Image * test: update snapshot * test: fix lint error * fix: Invalid memoized context value in LocaleProvider (#33723) * fix: Invalid memoized context value in LocaleProvider * Add button type in test case. * fix: Invalid memoized context value in Anchor * docs(table): upgrade react-sortable-hoc usage (#33729) Co-authored-by: 亦逊 * fix Input及相关组件设置 hidden 时展示问题 (#33735) * fix: Image 图片底部空白 #30825 * feat: Input、Input.search、Input.Textarea、Input.password 设置 hidden 时 所有 prefix or suffix or showCount or allowClear or addonBefore or addonAfter 都应该隐藏 * fix: lint * fix: test * fix: test ui * fix: some incorrect translation for km_KH (#33738) * Add km_KH locale to component * Add test and docs * Fix typo * Add test snapshot * Fix translation * Add test * docs: remove v4 release qrcode * test: fix lint * fix: Typography error on context ellipsis (#33725) * chore: init measure * chore: out of space * refactor: Multiple render * chore: auto cut * feat: render split * fix: ellipsis logic of suffix * fix: ref missing * fix: Tooltip missing * test: snapshot * chore: opt for textarea * test: back part of ellipsis * chore: back of ellipsis logic * ellipsis logic * fix: init ellipsis measure * fix: ellipsis event * chore: clean up * test: Update snapshot * fix: test * test: Update snapshot * chore: lazy ellipsis * fix: check css ellipsis logic * test: Update snapshot * test: back of coverage * chore: clean up * test: ignore else * test: clean up * feat: border color with transparency (#33506) * feat: border color with transparency * feat: update progess remain color with rgba(0, 0, 0, 0.06) * feat: progress remaining color * fix: TreeSelect not show hightlight with keyboard (#33755) * docs: add changelog 4.18.4 (#33748) Co-authored-by: afc163 * docs: guide of theme dev (#33756) * chore: update Cacasder demo and remove array-tree-filter (#33754) * chore: upgrade rc-cacasder * update snapshot * chore: Add DingDing release bot * chore: conch script (#33766) * fix: Tag color in dark theme (#33751) * docs: update dark theme doc * fix: dark tag theme * docs: ✏️ add note comment (#33771) Co-authored-by: dengqing * fix: update prevValue of checkbox if value changed (#33753) * fix: Cascader auto placement & scroll (#33777) * fix: Cascader auto placement & scroll * chore: bump rc-tree-select * chore: try to find safe version (#33783) * feat: Select/DatePicker/TimePicker/TreeSelect support placement (#33541) * feat: select components add placement api * feat: select components add placement api * fix: delete placement * fix: change md demo and delete export * feat: cascader and tree-select add placement * feat: datapicker add placement api * fix: change repeat static declaration to single * test: updata test units * doc: change doc * fix: delete merge message & delete decalare ts * test: fix unit test * fix: add transName in select & treeSelect & cascader * fix: change common api in utils * fix: change useless if block to only * fix: change placement string to enum * fix: lint done Co-authored-by: 礼检 * fix: Get ref of Card component #33730 (#33784) * fix: Get ref of Card component #33730 * add test to the card ref Co-authored-by: zengguhao.zgh * fix(checkbox): disabled checkbox should works well with tooltip (#33772) Co-authored-by: wanghao * style: Cascader loading icon (#33799) * test: fix cascader test coverage (#33802) * chore: i18n contributing docs improve (#33760) * chore: i18n contributing docs improve * update * Update docs/react/i18n.zh-CN.md Co-authored-by: afc163 * update * update * fix name * 空格 * fix name * update * Update docs/react/i18n.zh-CN.md Co-authored-by: afc163 * update * update * update * 添加英文版本 * update * the * update * update * fix list * Revert "fix list" This reverts commit c6f3e2c699d133f74e0f4ce0424c1fd4ad43dcbf. * fix list * 指向源文件 Co-authored-by: afc163 * fix: Invalid hook dependency array in Sider and Row (#33804) * chore(deps): update dependency simple-git to v3 (#33817) Co-authored-by: Renovate Bot * docs: update sentence structure in the FAQ section (#33816) * docs: add Plasmic for Ant (#33758) * Add Plasmic for Ant * Point Plasmic link to dedicated Ant page * test: fix lint * docs(:sparkles:): release 4.18.5 (#33822) * docs(:sparkles:): release 4.18.5 * update changelog * fix: upload button position flashes when it changes from hidden to displayed (#33820) * fix: fix upload button position flashes when it changes from hidden to displayed (#33819) * fix: typo in upload Co-authored-by: chenqiufan * fix: Clear timer of delayed loading after Button is unmounted (#33858) * fix: Clear delay loading timer after Button is unmounted * [CodeFactor] Apply fixes to commit 16cfb89 [ci skip] [skip ci] * Change arrow function style in test case Co-authored-by: codefactor-io * feat: notification placement support 'top'/'bottom' (#33871) * fix: tooltip should work with loading switch (#33860) * fix: tooltip should work with loading switch * fix: only works for switch * chore: code clean * fix: block not work when small size (#33878) https://github.com/vueComponent/ant-design-vue/issues/5219 * fix: ellipsis should display tooltip if rows larger than 1 (#33875) * fix: ellipsis should display tooltip if rows larger than 1 * test: add test case * fix: update dropdown version to 3.2.5 (#33895) * fix: update dropdown version to 3.2.5 * test: update snapshot * revert: Revert "Merge branch 'feature' into master" (#33903) This reverts commit 40433f357da9129f4434f6846195abb517a2db7e, reversing changes made to 27a498e021891b44730303939d13d3cc401e24ed. * Revert "revert: Revert "Merge branch 'feature' into master" (#33903)" This reverts commit 6b1a48d5edaca3d10380568f8ca1a6a867cb599e. * chore(deps): update dependency eslint-plugin-jest to v26 (#33899) Co-authored-by: Renovate Bot * chore(deps): update dependency @types/jest-environment-puppeteer to v5 (#33898) Co-authored-by: Renovate Bot * types: export DatePickRef and RangePickerRef (close #33417) (#33901) * fix(popover): fix the problem that popover display when the props'content is empty (#33835) * fix(popover): fix the problem that popover display when the props'content is empty * refactor(popover): 更新代码判断逻辑 * test(popover): 添加popover的test * feat(popover): 更新snapshot * feat(popover): 更新剩余的snapshot * feat: optimize dropdown accessbility (#33893) * feat: optimize dropdown accessbility * chore: bump rc-dropdown version * docs(✨): release 4.18.6 (#33948) * docs(✨): release 4.18.6 * chore: update version * docs: add date * fix: custom color should work on antd icons (#33951) * feat: tooltip round arrow (#33710) * feat: tooltip round arrow * chore: update demo * docs: update docs * feat: rounded arrow in Tooltip/Popover/Popconfirm/Dropdown/RangePicker * chore: code clean * fix: fill gap * chore: code clean * chore: raise css bundle size * fix: arrow style * feat: use full path * test: update snapshot * perf: hack firefox * perf: more magic position * perf: RangePicker's arrow position * chore: bump rc-picker version * fix: arrow position * chore(deps): update dependency react-dnd-html5-backend to v15 (#33941) Co-authored-by: Renovate Bot * feat: inputNumber controls support customize upIcon/downIcon (#33914) * feat: inputNumber controls support customize upIcon/downIcon * feat: 修改代码格式问题 * feat: 更新snapshot,修改代码开启prettier * feat: 更新snapshot,order 属性修改 * feat: upIcon/downIcon写法调整 * feat: 更新snapshot * fix: Exception in enter key callback on editable or copyable Paragraph (#33976) * fix: Exception on enter key callback * Move spyOn position * docs: 4.18.6 changelog optimization (#33990) * fix: class names of Row and Col components when using custom prefix (#33969) * feat: Exposes additional props for pagination component on transfer (#33954) * Exposes additional props for pagination component on transfer * feat: Improve transfer pagination customization * feat: Improve transfer pagination customization * fix: Typography copyable add stopPropagation (#33998) * fix: Typography copyable add stopPropagation * add test * chore(deps): update dependency react-dnd to v15 (#33940) * chore(deps): update dependency react-dnd to v15 * fix: Tabs demo * fix: demo Co-authored-by: Renovate Bot Co-authored-by: afc163 * fix: Pagination and Rate style bug in Safari (#34002) * fix: Pagination and Rate style bug in safari close #33965 * fix style * docs: fix missing @/services/product (#34003) * docs: fix missing @/services/product close #33952 * update data * docs: improve Select dropdownRender demo style (#34004) * chore: remove unused interface file (#34011) * style: improve Menu :focus-visible style (#34008) * style: improve Menu :focus-visible style ref #34005 * style: darken :focus-visible style * fix: typography ellipsis check in transform (#34007) * fix: typography ellipsis check in transform * test: Update snapshot * chore: btn default provide default cls (#34013) * fix: cascader's onChange ts adapts to single and multiple (#33947) * fix to: cascader's multiple determines the declaration of onChange * fix: cascader's onChange ts adapts to single and multiple * test: fix * docs: more acurrate description about Menu overflowedIndicator prop (#34022) * docs: add info about Menu overflowedIndicator prop close #34016 * fix doc * fix textarea maxlength issue (#33910) * fix: textarea maxlength * refactor: delete some useless code * refactor: fix ci * refactor and fix test case fall * update snapshot * add testcase * refactor type defined * fix: min/max validators in pl_PL locale returning undefined (#34024) Co-authored-by: Michał Podeszwa <178679-michalpodeszwa@users.noreply.gitlab.com> * fix: useLayoutEffect to useIsomorphicLayoutEffect (#33818) * fix: useLayoutEffect to useIsomorphicLayoutEffect * chore: change to rc-util/lib/hooks/useLayoutEffect * ci: files modify cancel failed * feat: Add ability to overwrite Menu theme at Menu.SubMenu level. (#33971) * Add theme support to Menu.SubMenu * Tidy up docs * Tidy up docs * Update components/menu/index.en-US.md * Update components/menu/index.en-US.md Co-authored-by: Amumu * Add Chinese lang docs * Extend menu theme demo to additionally demonstrate Sub-menu theming * Add submenu theme demo * Revert "Extend menu theme demo to additionally demonstrate Sub-menu theming" This reverts commit 642a2b5b72322eb5f6d06d6eb644f877e7f6119c. * Add tests * Correct typo * Make demo vertical so absolutely positioned popover doesn't overflow * Make demo functional component * Update components/menu/index.en-US.md Co-authored-by: afc163 * Update components/menu/index.zh-CN.md Co-authored-by: Amumu * Update components/menu/demo/submenu-theme.md Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: Amumu Co-authored-by: afc163 Co-authored-by: MadCcc <1075746765@qq.com> * docs: 4.18.7 changelog (#34041) * feat: Input support status (#33995) * feat: remove form status style && input support status * test: update snapshot * feat: update status prop in config provider * fix: form item validateStatus support * chore: code clean * feat: status classname change * test: update snapshot * refactor: move formItemStatusContext to form folder * refactor: merge utils * refactor: rename statusUtils * chore: code clean * test: fix coverage * chore: remove status prop of Form.Item * chore: code clean * docs: update demo * test: fix lint * feat: status only success and warning * test: fix lint * docs: update deamo * test: Udpate test for rc-util@latest * docs: Patch adjust changelog desc * chore: update snapshot * chore: script update (#34060) * chore(deps): update dependency stylelint-config-standard to v25 (#34028) * chore(deps): update dependency stylelint-config-standard to v25 * fix stylelint lint Co-authored-by: Renovate Bot Co-authored-by: tanghui * chore: Update sk_SK locales (#34061) * chore: Update sk_SK locales * Disable eslint rule, based on defaults (EN) * feat: inputNumber support status (#34042) * feat: inputNumber support status * test: fix test * feat: custom status first * refactor: getMergedStatus pass status in params * ci: add MadCcc assign * perf: OPT table render perf (#34075) * fix: Typography copyable in clipboard incorrect (#34034) Co-authored-by: chenxq * docs: fix procomponents links * test: skip layout demo which failed a lot in argoci * docs: improve Umi documentation * feat: mentions support status (#34071) * test: skip form deps-lint * perf: remove useless has-feedback classname * test: raise test coverage * style: recover import arrangement * feat: DatePicker and TimePicker support status (#34073) * feat: DatePicker and TimePicker support status * docs: demo add version * chore: code clean * feat: select support status (#34084) * feat: select support status * test: fix lint * fix: update quarter picker placeholder for RangePicker (#34089) * feat: cascader support status (#34086) * feat: cascader support status * chore: code clean * chore: raise bundle size limitation * chore: code clean * feat: TreeSelect support status (#34093) * feat: TreeSelect support status * chore: code clean * docs: add demo version * feat: AutoComplete support status (#34096) * feat: AutoComplete support status * test: update snapshot * feat: transfer support status (#34098) * feat: transfer support status * docs: update demo * fix: Table render twice on first mount (#34106) * fix: Table render twice * chore: clean up * test: Fix test case * fix: remove duplicated style (#34101) * fix: remove duplicated style * chore: reduce bundle size limitation * chore: raise bundle size * docs: Multiple displayRender support (#34116) * fix: Form layout when Select has long text (#34117) * fix: Form layout when Select has long text close #33773 * chore: update snapshot * fix: not crash ConfigProvider.config on server side (#34118) * fix: Invalid memoized context value in Menu (#34121) * chore(deps): update dependency eslint-plugin-unicorn to v41 (#34133) Co-authored-by: Renovate Bot * chore(deps): update actions-cool/issues-helper action to v3 (#34132) Co-authored-by: Renovate Bot * docs: fix grammar error (#34138) in customize-theme-variable.zh-CN.md * fix: del messageInstance when configuring getContainer (#34123) * fix: del messageInstance when configuring getContainer * test: move the new test to the bottom of the test lists * fix: Layout component SiderProps type not exported (#34137) * perf: Improve Components render perfermance when it's not reponsive (#34122) * perf: Improve List render perfermance when grid is undefined https://github.com/ant-design/ant-design/pull/34106/files#diff-9e016ea02fe7dd0ea42d8774d29d45e1a10b8dd108de9c89d50c828c74b993b8R146-R151 * chore: do not export useBreakpoint param Co-authored-by: zombiej * docs: 4.18.8 changelog (#34146) * chore: bump version to 4.18.8 * docs: 4.18.8 changelog * docs: update changelog * docs: update changelog * docs: update changelog * fix: form initial values get modified (#34153) * chore: fix ts error in site * chore: fix Chinese expression about "的地得" (#34173) close #34167 * fix(upload): onChange params type err (#34161) * fix(upload): onChange params type err * test(upload): check onChange params type * fix: Dropdown item style when text is long (#34177) close #34176 * fix: issue #34015 cascader document of option less isleaf param (#34174) * fix: issue #34015 cascader document of option less isleaf param * fix: add comment * fix: comment change Co-authored-by: zengguhao.zgh * fix: Overview page EditableProTable link error (#34181) * docs: add MasterGo to design assets (#34055) * docs: add MasterGo to design assets * chore: update mastergo links * feat: table FilterDropdown support `clearFilters({ confirm: false, closeDropdown: false })` (#34120) * feat: table FilterDropdown support `clearFilters({ confirm: boolean })` * feat: update `clearFilters` and `confirm` * feat: add FilterRestProps,update document * feat: update onReset params order * feat: add test case * feat: table filterSearch supports function (#34085) * feat: table filterSearch supports function * feat: update for test * feat: update document * test: disabled react/jsx-key * chore: lock eslint-plugin-react (#34214) * Revert "test: disabled react/jsx-key" This reverts commit 7d64967d637ce1043467abd7802b872cfe8cc09d. * chore: lock eslint-plugin-react@7.28.0 * feat: add variable for aliyun theme of drawer (#34188) Co-authored-by: zhaohonghai * feat: add variable for aliyun theme of dropdown (#34189) Co-authored-by: zhaohonghai * fix: remove lock for eslint-plugin-react (#34220) * feat: add variable for aliyun theme of modal (#34191) Co-authored-by: zhaohonghai * feat: add variable for aliyun theme of divider (#34187) Co-authored-by: zhaohonghai * feat: add variable for aliyun theme of radio (#34194) Co-authored-by: zhaohonghai * docs: update maintainer for changelog script * docs: add changelog 4.18.9 (#34236) * docs: add changelog 4.18.9 * docs: update * docs: update * Update CHANGELOG.zh-CN.md * feat: introduce rc-input (#34206) * feat: introduce rc-input * fix: export InputRef alias * docs: fix demo * chore: code clean * test: fix lint * test: test coverage * chore: code clean * chore: code clean * test: update snapshot * refactor: Update rc-slider (#34234) * chore: Update rc-slider version * chore: bump * chore: update sty;e * fix: style * test: update snapshot * test: all fixed * fix lint * docs: update links of mastergo (#34242) * feat: add utm to mastergo's links (#34248) * chore(deps-dev): bump typescript from 4.5.5 to 4.6.2 (#34249) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.5 to 4.6.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.5...v4.6.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> * refactor: change usecontext of divider prepare for v5 (#34246) Co-authored-by: zengguhao.zgh * refactor: Wrap affix with FC (#34254) * test: fix * chore: ts fix * chore: update ts def * test: fix test * fix: Form doc "resetFields" args type (#34262) * style: remove overriding !important from input border right width styles (#34178) * docs: add description about onClear prop in AutoComplete doc (#34292) * fix: editable Typography.Title should match font size while editing (#34169) * feat: editable Typography.Title should match font size while editing * feat: update style * feat: update style * feat: update style * feat: style lint * feat: update style * Update components/typography/style/index.less * Update components/typography/Editable.tsx * feat: reorganize css * feat: style lint * feat: update snap Co-authored-by: afc163 * fix: limit input class due to rc-input won't override input class (#34294) * fix: limit input class due to rc-input won't override input class * fix: add feedback into affix judgement * fix: Tree filter select all behavior (#34295) ref https://github.com/ant-design/ant-design/issues/34280 * fix: typography title margin issue (#34302) * fix: Form.Item "React does not recognize the requiredMark prop on a DOM element" (#34323) close #34310 * test: add boolean value input test (#34324) * feat: Input support clearIcon (#34325) * feat: Input support clearIcon * docs: update Input api * chore: fix changelog print for author info in github web (#34326) * ci: fix ie11 close * refactor: clearIcon in allowClear (#34340) * refactor: Input allowClear api upadte * test: add test * docs: 4.19.0 changelog (#34328) * docs: 4.19.0 changelog * docs: update * docs: update * docs: update * Update CHANGELOG.en-US.md * Update CHANGELOG.zh-CN.md * fix: status less compile error (#34350) * docs: changelog 4.19.1-alpha.0 (#34352) * docs: changelog 4.19.1-alpha.0 * docs: update * docs: update * docs: update * fix: password icon color (#34354) * fix: csp not work on icon (#34356) * refactor: Input.Group use context hook (#34361) * docs: changelog 4.19.1 (#34357) * docs: changelog 4.19.1 * docs: update * refactor: Replace ConfigConsumer to ConfigContext (#34365) * chore: resposive.md => responsive.md (#34368) * chore: resposive.md => responsive.md * update snapshot * docs(Spin): fix en-US description of `spinning` prop (#34382) Previous description indicates that Spin is visible but not spinning when `spinning === false`. According to ZH-CN doc, Spin is not visible when `spinning === false`. * fix: input lg font size (#34381) * fix: Dropdown not auto adjust placement (#34390) * chore(deps-dev): bump jest-axe from 5.0.1 to 6.0.0 (#34392) Bumps [jest-axe](https://github.com/nickcolley/jest-axe) from 5.0.1 to 6.0.0. - [Release notes](https://github.com/nickcolley/jest-axe/releases) - [Changelog](https://github.com/nickcolley/jest-axe/blob/main/CHANGELOG.md) - [Commits](https://github.com/nickcolley/jest-axe/commits/v6.0.0) --- updated-dependencies: - dependency-name: jest-axe 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> * fix(transfer): footer类型定义支持direction (#34337) * docs: fix select fieldNames typo (#34399) * fix: not warning if Form.Item unmount (#34405) * fix: fix arrow size in default.less (#34407) * fix: fix arrow size in default.less * chore: code clean * chore: update rc-field-form version (#34411) * refactor: rm useDestroy hook (#34418) * fix: clear status in input addon (#34412) * Fix InputProps supports data attributes (#34410) * fix: add data-xx for inputProps and convert input/_tests/index.test.js to tsx file * fix: run tests * feat: hide the last border in borderless mode (#34366) * fix: Tooltip width in safari (#34415) * docs(Table): replace the link of `TableComponents` prop with `rc-table` type (#34423) * fix: PageHeader extra gutter (#34428) * chore: refactor internal menu with hooks (#34433) * chore: refactor menu with hooks * chore: clean up * chore: export css variable func (#34436) * docs(module:timeline): fix typo (#34389) * docs(module:timeline): fix typo * docs(module:timeline): fix typo * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: afc163 * docs(✨ ): changelog for 4.19.2 (#34472) * docs: changelog for 4.19.2 * fix changelog lint * chore: upgrade rc-menu to 9.3.x (#34473) * docs(components:Cascader): supplement the API documentation (#34466) * docs(components:Cascader): supplement the API documentation * docs(Cascader:en-US): supplement the API documentation * fix: input classname in affix wrapper (#34474) * chore: add focus warning for Input (#34475) * chore: add focus warning for Input * chore: code clean * chore: remove duplicate variables * refactor: move prefixCls to wrapper (#34482) * refactor: move prefixCls to wrapper * fix: name change Co-authored-by: zengguhao.zgh * docs: dropdownRender usage https://github.com/ant-design/ant-design/commit/2de1a15da977a5c7ce0bffa3b8ba19cea704023d * refactor: replace deprecated String.prototype.substr() (#34498) String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with functions which aren't. Signed-off-by: Tobias Speicher * test: Update snapshot * docs: fix alert docs escape * fix: missing status style for RangePicker (#34509) * fix: range picker should has status style * chore: code clean * chore: code clean * chore: code clean * fix: Typography ediable style (#34518) - [x] Fix Editable Textarea height jump in Firefox - [x] Fix Editable Typography.Title confirm icon position * docs: fix --- * fix: typos in Input.tsx (#34534) * chore(🤖): add ChainAlert action (#34530) * fix: col-x class names in css when using custom prefix (#34494) * fix: col-x class names of Row and Col components when using custom prefix * refactor: reuse @col-prefix-cls and @row-prefix-cls * refactor: move @col-prefix-cls and @row-prefix-cls to mixin.less * docs: update Input docs for default size in Form (#34537) * docs: move treeLoadedKeys to TreeSelect close #34538 * chore(deps-dev): bump @types/gtag.js from 0.0.8 to 0.0.9 (#34540) Bumps [@types/gtag.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/gtag.js) from 0.0.8 to 0.0.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/gtag.js) --- updated-dependencies: - dependency-name: "@types/gtag.js" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Badge RTL wrong placement (#34545) * fix: tooltip preset color (#34548) * fix: tooltip preset color * chore: code clean * fix: apply scale transform to disabled star (#34547) * test: add type test for Input * docs: add Currency recommendation * chore(deps-dev): bump @types/gtag.js from 0.0.9 to 0.0.10 (#34561) Bumps [@types/gtag.js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/gtag.js) from 0.0.9 to 0.0.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/gtag.js) --- updated-dependencies: - dependency-name: "@types/gtag.js" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: lt_LT locale for typeTemplate (#34567) * fix: Update it_IT locales (#34566) * chore: add issues similarity analysis and dingtalk issue notice actions (#34583) * chore: add Issues Similarity Analysis action * Delete suggest-related-links.yml * Create issue-sync-dingtalk.yml * Update issue-sync-dingtalk.yml * Update issue-sync-dingtalk.yml * Update issue-sync-dingtalk.yml * Update issues-similarity-analysis.yml * Delete chain-alert.yml * chore(🤖): Update issue-open-check.yml (#34589) * Update issue-open-check.yml * Delete issue-sync-dingtalk.yml * Update issue-open-check.yml * Update issue-open-check.yml * Update issue-open-check.yml * chore(🤖): upgrade github actions (#34599) * ci: update result * ci: fix result * Update issue-open-check.yml * fix: clear icon style (#34610) * docs: add 4.19.3 changhelog (#34617) Co-authored-by: 期贤 Co-authored-by: dimbslmh <745635+dimbslmh@users.noreply.github.com> Co-authored-by: dimbslmh Co-authored-by: Dan Greene <14020024+dgreene1@users.noreply.github.com> Co-authored-by: uchanlee Co-authored-by: afc163 Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: zhenfan.yu Co-authored-by: whwangms Co-authored-by: xrkffgg Co-authored-by: ZhouZhen <503633021@qq.com> Co-authored-by: hydraZty <670688667@qq.com> Co-authored-by: hydraZty Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: toSayNothing <91143836+toSayNothing@users.noreply.github.com> Co-authored-by: PlayerWho Co-authored-by: Di Wu Co-authored-by: yanm1ng <644169721@qq.com> Co-authored-by: 亦逊 Co-authored-by: VIREAK KEOSOKVIBOL <46261326+vireakkeosokvibol@users.noreply.github.com> Co-authored-by: 二货机器人 Co-authored-by: vagusX Co-authored-by: dengqing <1247748612@qq.com> Co-authored-by: dengqing Co-authored-by: Cat-XHS <1349021570@qq.com> Co-authored-by: 礼检 Co-authored-by: Long Hao (龙濠) <45565100+LongHaoo@users.noreply.github.com> Co-authored-by: zengguhao.zgh Co-authored-by: 王浩 Co-authored-by: wanghao Co-authored-by: Amumu Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot Co-authored-by: Eliot Sanford Co-authored-by: Yang Zhang <7129+yang@users.noreply.github.com> Co-authored-by: Cole Co-authored-by: chenqiufan Co-authored-by: codefactor-io Co-authored-by: 黑雨 Co-authored-by: tangjinzhou <415800467@qq.com> Co-authored-by: Amour1688 Co-authored-by: Dawnlck Co-authored-by: mic-web <4804412+mic-web@users.noreply.github.com> Co-authored-by: Jase Owens Co-authored-by: linxianxi <47104575+linxianxi@users.noreply.github.com> Co-authored-by: babycannotsay <335658202@qq.com> Co-authored-by: chenyizhongx <31769726+chenyizhongx@users.noreply.github.com> Co-authored-by: Michał Podeszwa Co-authored-by: Michał Podeszwa <178679-michalpodeszwa@users.noreply.gitlab.com> Co-authored-by: soso Co-authored-by: David <97387061+david-cord@users.noreply.github.com> Co-authored-by: Filip Seman Co-authored-by: opopeieie Co-authored-by: chenxq Co-authored-by: stefango Co-authored-by: TrickyPi <33021497+TrickyPi@users.noreply.github.com> Co-authored-by: Picsong <312465087@qq.com> Co-authored-by: Peach Co-authored-by: Dave Co-authored-by: 李瀚 <44010674+lihansir@users.noreply.github.com> Co-authored-by: KaKaHuoLuoTe <99702968+KaKaHuoLuoTe@users.noreply.github.com> Co-authored-by: qdzhaoxiaodao <32627250+qdzhaoxiaodao@users.noreply.github.com> Co-authored-by: zhaohonghai Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zach Bird <546439325@qq.com> Co-authored-by: aghArdeshir Co-authored-by: Karott Schu Co-authored-by: Dennis273 Co-authored-by: Fisher <33776415+zomixi@users.noreply.github.com> Co-authored-by: Jungzl <35426360+Jungzl@users.noreply.github.com> Co-authored-by: 高喵喵 Co-authored-by: PanStar Co-authored-by: dujun Co-authored-by: zqran Co-authored-by: YuTao Co-authored-by: EvanOne(文一) <1656081615@qq.com> Co-authored-by: CommanderRoot Co-authored-by: Yunwoo Ji Co-authored-by: Anizcus <48563303+Anizcus@users.noreply.github.com> Co-authored-by: Gianmarco Rengucci Co-authored-by: 陈帅 Co-authored-by: 期贤 Co-authored-by: zhang lay --- .github/workflows/compressed-size.yml | 2 +- .github/workflows/issue-open-check.yml | 17 +- .../workflows/issues-similarity-analysis.yml | 17 + .github/workflows/preview-build.yml | 8 +- .github/workflows/rebase.yml | 2 +- .github/workflows/site-deploy.yml | 4 +- .github/workflows/test.yml | 32 +- .github/workflows/ui.yml | 8 +- .github/workflows/verify-package-version.yml | 2 +- CHANGELOG.en-US.md | 91 + CHANGELOG.zh-CN.md | 107 +- components/_util/ActionButton.tsx | 13 +- components/_util/getDataOrAriaProps.ts | 4 +- components/affix/index.tsx | 35 +- components/alert/index.en-US.md | 2 +- components/alert/index.zh-CN.md | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 4 - .../__tests__/__snapshots__/demo.test.js.snap | 4 - components/badge/style/rtl.less | 2 +- components/cascader/index.en-US.md | 2 + components/cascader/index.zh-CN.md | 2 + components/collapse/style/index.less | 5 + .../__snapshots__/components.test.js.snap | 8 +- .../config-provider/__tests__/icon.test.js | 31 +- .../config-provider/__tests__/theme.test.ts | 14 +- components/config-provider/cssVariables.tsx | 17 +- components/config-provider/index.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 2368 +++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 174 + components/date-picker/demo/status.md | 2 + .../generatePicker/generateRangePicker.tsx | 94 +- .../date-picker/generatePicker/index.tsx | 4 +- components/dropdown/__tests__/index.test.js | 20 + components/dropdown/dropdown.tsx | 1 + components/dropdown/style/index.less | 2 - components/form/FormItem.tsx | 6 +- .../__snapshots__/demo-extend.test.ts.snap | 1228 +++++++ .../__tests__/__snapshots__/demo.test.js.snap | 131 + components/form/__tests__/list.test.js | 50 + components/form/context.tsx | 9 + components/form/demo/validate-static.md | 4 + components/form/style/horizontal.less | 5 - components/grid/style/mixin.less | 27 +- components/grid/style/rtl.less | 35 +- components/input-number/index.tsx | 8 +- components/input/ClearableLabeledInput.tsx | 7 +- components/input/Group.tsx | 61 +- components/input/Input.tsx | 33 +- components/input/Search.tsx | 5 +- .../__snapshots__/Password.test.js.snap | 4 +- .../__snapshots__/Search.test.js.snap | 4 - .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.js.snap | 20 +- .../__snapshots__/index.test.tsx.snap | 388 +++ components/input/__tests__/index.test.tsx | 413 +++ components/input/__tests__/textarea.test.js | 7 + components/input/__tests__/type.test.tsx | 17 + components/input/index.en-US.md | 4 +- components/input/index.zh-CN.md | 4 +- components/input/style/allow-clear.less | 1 + components/input/style/index.less | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- .../list/demo/{resposive.md => responsive.md} | 0 components/locale/it_IT.tsx | 2 + components/locale/lt_LT.tsx | 2 +- components/menu/index.tsx | 164 +- components/modal/Modal.tsx | 1 + .../__snapshots__/demo-extend.test.ts.snap | 696 ++-- .../__tests__/__snapshots__/demo.test.js.snap | 372 ++- components/page-header/demo/content.md | 18 +- components/page-header/index.tsx | 16 +- components/page-header/style/index.less | 5 - components/page-header/style/index.tsx | 1 + components/popconfirm/index.tsx | 7 +- components/rate/style/index.less | 2 +- .../select/demo/custom-dropdown-menu.md | 4 +- components/select/index.en-US.md | 4 +- components/select/index.zh-CN.md | 4 +- components/select/style/status.less | 74 +- components/spin/index.en-US.md | 2 +- components/style/themes/default.less | 4 +- components/style/themes/variable.less | 4 +- .../table/__tests__/Table.filter.test.js | 308 -- components/table/demo/filter-in-tree.md | 2 - components/table/index.en-US.md | 2 +- components/table/index.zh-CN.md | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 2918 +++++++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 178 + components/time-picker/demo/status.md | 2 + components/timeline/index.zh-CN.md | 2 +- components/tooltip/style/index.less | 3 +- components/transfer/index.tsx | 7 +- components/transfer/style/status.less | 6 +- components/tree-select/index.en-US.md | 1 + components/tree-select/index.zh-CN.md | 1 + .../__snapshots__/demo-extend.test.ts.snap | 1 - .../__tests__/__snapshots__/demo.test.js.snap | 1 - components/tree/demo/search.md | 4 +- components/tree/index.en-US.md | 1 - components/tree/index.zh-CN.md | 1 - components/typography/Typography.tsx | 42 +- components/typography/style/index.less | 3 + components/upload/demo/file-type.md | 2 +- docs/react/practical-projects.en-US.md | 26 +- docs/react/recommendation.en-US.md | 1 + docs/react/recommendation.zh-CN.md | 1 + package.json | 20 +- scripts/check-commit.js | 2 +- scripts/generate-authors.js | 2 +- scripts/print-changelog.js | 4 +- site/bisheng.config.js | 1 + site/theme/template/IconDisplay/index.tsx | 2 +- site/theme/template/Layout/Header/index.tsx | 2 +- 114 files changed, 9263 insertions(+), 1268 deletions(-) create mode 100644 .github/workflows/issues-similarity-analysis.yml create mode 100644 components/input/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 components/input/__tests__/index.test.tsx create mode 100644 components/input/__tests__/type.test.tsx rename components/list/demo/{resposive.md => responsive.md} (100%) diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml index 1c88a918619d..c3fa8b676742 100644 --- a/.github/workflows/compressed-size.yml +++ b/.github/workflows/compressed-size.yml @@ -11,7 +11,7 @@ jobs: CI_JOB_NUMBER: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: preactjs/compressed-size-action@v2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/issue-open-check.yml index 1f2112592fd0..2c978eb4caf2 100644 --- a/.github/workflows/issue-open-check.yml +++ b/.github/workflows/issue-open-check.yml @@ -8,14 +8,14 @@ jobs: issue-open-check: runs-on: ubuntu-latest steps: - - uses: actions-cool/check-user-permission@v1 + - uses: actions-cool/check-user-permission@v2 id: checkUser with: require: 'write' check-bot: true - name: check invalid - if: (contains(github.event.issue.body, 'ant-design-issue-helper') == false) && (steps.checkUser.outputs.result == 'false') + if: (contains(github.event.issue.body, 'ant-design-issue-helper') == false) && (steps.checkUser.outputs.require-result == 'false') uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,add-labels,close-issue' @@ -69,11 +69,20 @@ jobs: issue-number: ${{ github.event.issue.number }} labels: 'IE | Firefox | Safari,Internet Explorer' - - name: check ie - if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true + - name: check ie11- + if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true uses: actions-cool/issues-helper@v3 with: actions: 'create-comment, close-issue' issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, v4 only support IE11 and above. + + - name: send to dingtalk + uses: visiky/dingtalk-release-notify@main + with: + DING_TALK_TOKEN: ${{ secrets.DINGDING_BOT_TOKEN }} + notify_title: '🔥 @${{ github.event.issue.user.login }} 创建了 issue:${{ github.event.issue.title }}' + notify_body: '### 🔥 @${{ github.event.issue.user.login }} 创建了 issue:[${{ github.event.issue.title }}](${{ github.event.issue.html_url }})
![](https://gw.alipayobjects.com/zos/antfincdn/5Cl2G7JjF/jieping2022-03-20%252520xiawu11.06.04.png)
${{ github.event.issue.body }}' + notify_footer: '> 💬 欢迎前往 GitHub 进行讨论,社区可能需要你的帮助。' + at_all: false # whether to ding everybody diff --git a/.github/workflows/issues-similarity-analysis.yml b/.github/workflows/issues-similarity-analysis.yml new file mode 100644 index 000000000000..8a378357f621 --- /dev/null +++ b/.github/workflows/issues-similarity-analysis.yml @@ -0,0 +1,17 @@ +name: Issues Similarity Analysis + +on: + issues: + types: [opened, edited] + +jobs: + similarity-analysis: + runs-on: ubuntu-latest + steps: + - name: analysis + uses: actions-cool/issues-similarity-analysis@v1.1.0 + with: + filter-threshold: 0.5 + title-excludes: '' + comment-title: '### You may look for issues:' + comment-body: '${index}. ${similarity} #${number}' diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 16bb7253a7eb..a227a95bb034 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache package-lock.json uses: actions/cache@v2 @@ -47,7 +47,7 @@ jobs: needs: setup steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -68,7 +68,7 @@ jobs: SITE_ENV: development - name: upload site artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: site path: _site/ @@ -81,7 +81,7 @@ jobs: - name: Upload PR number if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: pr path: ./pr-id.txt diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 0d4b713e9b23..facf27780b96 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -10,7 +10,7 @@ jobs: if: github.event.issue.pull_request != '' && (contains(github.event.comment.body, '/rebase') || contains(github.event.comment.body, '\rebase')) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Automatic Rebase diff --git a/.github/workflows/site-deploy.yml b/.github/workflows/site-deploy.yml index 77008b5bf5e7..e6a469593fc0 100644 --- a/.github/workflows/site-deploy.yml +++ b/.github/workflows/site-deploy.yml @@ -10,7 +10,7 @@ jobs: if: github.event.ref_type == 'tag' && (contains(github.event.ref, '-') == false) steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache package-lock.json uses: actions/cache@v2 @@ -43,7 +43,7 @@ jobs: needs: setup steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b2abedf1132..23a0efff96b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache package-lock.json uses: actions/cache@v2 @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -100,7 +100,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -122,7 +122,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -145,7 +145,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -171,7 +171,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -194,7 +194,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -225,7 +225,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -256,7 +256,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -296,7 +296,7 @@ jobs: REACT: 16 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -324,7 +324,7 @@ jobs: REACT: 16 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -352,7 +352,7 @@ jobs: REACT: 16 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -388,7 +388,7 @@ jobs: REACT: 16 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -424,7 +424,7 @@ jobs: REACT: 16 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 @@ -460,7 +460,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: restore cache from package-lock.json uses: actions/cache@v2 diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index daace2e28e91..9279de6a5148 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: cache package-lock.json uses: actions/cache@v2 @@ -44,7 +44,7 @@ jobs: run: npm run test-image - name: upload snapshots artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: snapshots path: imageSnapshots/ @@ -60,7 +60,7 @@ jobs: - name: Upload commit if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: commit path: ./commit.txt @@ -75,7 +75,7 @@ jobs: - name: Upload branch if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: branch path: ./branch.txt diff --git a/.github/workflows/verify-package-version.yml b/.github/workflows/verify-package-version.yml index f73bcbb418fd..23ad7572f428 100644 --- a/.github/workflows/verify-package-version.yml +++ b/.github/workflows/verify-package-version.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.event.pull_request.title, 'changelog') || contains(github.event.pull_request.title, 'release') steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: verify-version uses: actions-cool/verify-package-version@v1 with: diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 8afd236a8210..f97bd8c1c03c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -9,6 +9,7 @@ timeline: true | infrad version | antd version | update content | time | | --- | --- | --- | --- | +| 4.19.3 | 4.19.3 | Synchronize the update of antd 4.19.3 version | 2022-03-22 | | 4.18.9 | 4.18.9 | Synchronize the update of antd 4.18.9 version | 2022-03-08 | | 4.18.5 | 4.18.3 | Roll back some components, details can be [View](https://docs.google.com/spreadsheets/d/1TvmnH4gNNt52CCLTn1GCuPlPDfjIQVHfbtauUOX3hdw/edit#gid=0) | 2022-02-25 | | 4.18.4 | 4.18.3 | fix error-color difference | 2022-01-17 | @@ -29,6 +30,96 @@ if you have some problem, welcome to connect `taofeng.yang@shopee.com` or `lay.z --- +## 4.19.3 + +`2022-03-21` + +- 🐞 Fix TextArea clearIcon color. [#34610](https://github.com/ant-design/ant-design/pull/34610) [@MadCcc](https://github.com/MadCcc) +- 🌐 Updated lt_LT locale for `typeTemplate`. [#34567](https://github.com/ant-design/ant-design/pull/34567) [@Anizcus](https://github.com/Anizcus) +- 🐞 fix: apply scale transform to disabled star. [#34547](https://github.com/ant-design/ant-design/pull/34547) [@Unuuuuu](https://github.com/Unuuuuu) +- 🐞 Fix Tooltip arrow color with preset. [#34548](https://github.com/ant-design/ant-design/pull/34548) [@MadCcc](https://github.com/MadCcc) +- 🐞 Fixed number abnormal position display in Badge RTL mode. [#34545](https://github.com/ant-design/ant-design/pull/34545) +- 💄 Fix numeric Row and Col class styles when using prefixCls. [#34494](https://github.com/ant-design/ant-design/pull/34494) [@mic-web](https://github.com/mic-web) +- 🐞 Fix Editable Textarea height jump in Firefox and Editable Typography.Title confirm icon position. [#34518](https://github.com/ant-design/ant-design/pull/34518) +- 💄 Fix missing `status` style in RangePicker. [#34509](https://github.com/ant-design/ant-design/pull/34509) [@MadCcc](https://github.com/MadCcc) +- 🛠 Prepare for CssInJs and place preClsName generation in the outer layer. [#34482](https://github.com/ant-design/ant-design/pull/34482) [@LongHaoo](https://github.com/LongHaoo) +- 🛎 Add warning for Input getting blurred when dynamically add `hasFeedback`. [#34475](https://github.com/ant-design/ant-design/pull/34475) [@MadCcc](https://github.com/MadCcc) +- 🐞 Fix missing classname in input when Input has `prefix` or `suffix`. [#34474](https://github.com/ant-design/ant-design/pull/34474) [@MadCcc](https://github.com/MadCcc) + +## 4.19.2 + +`2022-03-13` + +- 🐞 Fix Dropdown not auto adjust placement when position on the edge of window. [#34390](https://github.com/ant-design/ant-design/pull/34390) +- 💄 Change PageHeader elements margin from `12px` to `8px` inside `extra`. [#34428](https://github.com/ant-design/ant-design/pull/34428) +- 🛠 Export css variable function in `antd/es/config-provider` folder to enable ssr requirement. [#34436](https://github.com/ant-design/ant-design/pull/34436) +- 🛠 Refactor Menu with React hooks. [#34433](https://github.com/ant-design/ant-design/pull/34433) +- Input + - 💄 Fix Input font-size when `size` is large. [#34381](https://github.com/ant-design/ant-design/pull/34381) + - 💄 Fix Input.Group wrong border when status is error. [#34412](https://github.com/ant-design/ant-design/pull/34412) +- Form + - 🐞 Fix Form.Item removed in `form.validateFields` throw `Can't perform a React state update on an unmounted component` warning. [#34405](https://github.com/ant-design/ant-design/pull/34405) + - 🐞 Fix to Form that `initialValues` would change if `preserve` is false. [#34411](https://github.com/ant-design/ant-design/pull/34411) +- Tooltip + - 💄 Fix Tooltip width in Safari. [#34415](https://github.com/ant-design/ant-design/pull/34415) [@jiandandkl](https://github.com/jiandandkl) + - 💄 Fix arrow size of Tooltip/Popover/Popconfirm. [#34407](https://github.com/ant-design/ant-design/pull/34407) +- 💄 Remove Collapse bottom border in simple style. [#34366](https://github.com/ant-design/ant-design/pull/34366) [@PanStar](https://github.com/PanStar) +- TypeScript + - 🤖 Fix Input `data-*` type definition. [#34410](https://github.com/ant-design/ant-design/pull/34410) [@GitKou](https://github.com/GitKou) + - 🤖 Fix Transfer `footer` type definition. [#34337](https://github.com/ant-design/ant-design/pull/34337) [@zomixi](https://github.com/zomixi) + +## 4.19.1 + +`2022-03-08` + +- 🐞 Fix less compile error related to custom status. [#34350](https://github.com/ant-design/ant-design/pull/34350) + - 🐞 Fix error `ReferenceError: colorPalette is not defined` when customize theme. + - 🐞 Fix error `Error: Invalid class or id selector syntax` when import `antd/dist/antd.css`. +- 🐞 Fix Input.Passowrd icon color in site. [#34354](https://github.com/ant-design/ant-design/pull/34354) +- 🐞 Fix ConfigProvider `csp` sometime not effect on Icon. [#34356](https://github.com/ant-design/ant-design/pull/34356) + +## 4.19.0 + +`2022-03-08` + +- 💄 Optimize arrow style for some components. [#33710](https://github.com/ant-design/ant-design/pull/33710) + + + +- Input + - 🛠 Refactor Input with rc-input. [#34206](https://github.com/ant-design/ant-design/pull/34206) + - Attention: The type and value of `ref` is modified because of refactoring from class component to function component. You can still get DOM node from `input`, and other methods such as `focus` and `blur` mentioned in document are also supported. + - 🆕 Support `clearIcon` prop for customizing clear icon. [#34325](https://github.com/ant-design/ant-design/pull/34325) +- Table + - 🆕 `filterSearch` now support passing function to customize search. [#34085](https://github.com/ant-design/ant-design/pull/34085) [@heiyu4585](https://github.com/heiyu4585) + - 🆕 `column.filterDropdown({ clearFilters })` support `clearFilters({ confirm: false, closeDropdown: false })`. [#34120](https://github.com/ant-design/ant-design/pull/34120) [@heiyu4585](https://github.com/heiyu4585) + - ⌨️ Table adds `aria-sort` attribute for screen readers. [#33603](https://github.com/ant-design/ant-design/pull/33603) [@dgreene1](https://github.com/dgreene1) + - 🐞 Fix Table filters select-all Checkbox not changed when select item. [#34295](https://github.com/ant-design/ant-design/pull/34295) +- 🆕 Data entry components add `status` prop to support custom status. + + - Transfer [#34098](https://github.com/ant-design/ant-design/pull/34098) + - AutoComplete [#34096](https://github.com/ant-design/ant-design/pull/34096) + - TreeSelect [#34093](https://github.com/ant-design/ant-design/pull/34093) + - Cascader [#34086](https://github.com/ant-design/ant-design/pull/34086) + - Select [#34084](https://github.com/ant-design/ant-design/pull/34084) + - DatePicker and TimePicker [#34073](https://github.com/ant-design/ant-design/pull/34073) + - Mentions [#34071](https://github.com/ant-design/ant-design/pull/34071) + - InputNumber [#34042](https://github.com/ant-design/ant-design/pull/34042) + - Input [#33995](https://github.com/ant-design/ant-design/pull/33995) + + + +- 🆕 InputNumber supports `controls={{ upIcon, downIcon }}` to customize icon up and down. [#33914](https://github.com/ant-design/ant-design/pull/33914) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Notification `placement` support `top` / `bottom` [#33871](https://github.com/ant-design/ant-design/pull/33871) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Select, Cascades, DatePicker now support `placement` property. [#33641](https://github.com/ant-design/ant-design/pull/33541) [@ONLY-yours](https://github.com/ONLY-yours) +- 🆕 Dropdown support `arrow={{ pointAtCenter: true }}` to make arrow point at center. And `top` `bottom` placement are also supported. [#33658](https://github.com/ant-design/ant-design/pull/33658) +- 🆕 Skeleton.Input Adds `block` prop. [#33672](https://github.com/ant-design/ant-design/pull/33672) [@woochanleee](https://github.com/woochanleee) +- 🆕 Move TimePicker `disabledHours`, `disabledMinutes`, `disabledSeconds` into `disabledTime` to align with DatePicker. [#33503](https://github.com/ant-design/ant-design/pull/33503) +- 💄 Modify the color of some borders and the background color of the progress bar to be transparent to suit the colored background. [#33506](https://github.com/ant-design/ant-design/pull/33506) +- 💄 Space support custom children `key`. [#33607](https://github.com/ant-design/ant-design/pull/33607) [@qin20](https://github.com/qin20) +- 🐞 Fix `Typography.Title` didn't keep font size when become editable. [#34169](https://github.com/ant-design/ant-design/pull/34169) [@heiyu4585](https://github.com/heiyu4585) +- 🐞 Fix Form.Item throw warning `React does not recognize the requiredMark prop on a DOM element`. [#34323](https://github.com/ant-design/ant-design/pull/34323) + ## 4.18.9 `2022-02-28` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 0171e1927980..fd1347174e84 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -9,6 +9,7 @@ timeline: true | infrad 版本号 | 对应 antd 版本号 | 更新内容 | 时间 | | --- | --- | --- | --- | +| 4.19.3 | 4.19.3 | 同步 antd 4.19.3 版本的更新 | 2022-03-22 | | 4.18.9 | 4.18.9 | 同步 antd 4.18.9 版本的更新 | 2022-03-08 | | 4.18.5 | 4.18.3 | 回滚部分组件,详情可[查看](https://docs.google.com/spreadsheets/d/1TvmnH4gNNt52CCLTn1GCuPlPDfjIQVHfbtauUOX3hdw/edit#gid=0) | 2022-02-25 | | 4.18.4 | 4.18.3 | 修复 error-color 颜色差异问题 | 2022-01-18 | @@ -29,6 +30,96 @@ timeline: true --- +## 4.19.3 + +`2022-03-21` + +- 🐞 修复 TextArea clearIcon 的颜色问题。[#34610](https://github.com/ant-design/ant-design/pull/34610) [@MadCcc](https://github.com/MadCcc) +- 🌐 更新 lt_LT 的 locale。[#34567](https://github.com/ant-design/ant-design/pull/34567) [@Anizcus](https://github.com/Anizcus) +- 🐞 fix: apply scale transform to disabled star。[#34547](https://github.com/ant-design/ant-design/pull/34547) [@Unuuuuu](https://github.com/Unuuuuu) +- 🐞 修复 Tooltip 使用预设颜色时 arrow 颜色错误的问题。[#34548](https://github.com/ant-design/ant-design/pull/34548) [@MadCcc](https://github.com/MadCcc) +- 🐞 修复 Badge 数字 RTL 模式下异常位置显示。[#34545](https://github.com/ant-design/ant-design/pull/34545) +- 💄 修复使用 `prefixCls` 时的数字 Row 和 Col 类样式问题。[#34494](https://github.com/ant-design/ant-design/pull/34494) [@mic-web](https://github.com/mic-web) +- 🐞 修复 Typography `editable` 切换时在 Firefox 下高度跳动 和 Typography.Title `editable` 确定图标错位的问题。[#34518](https://github.com/ant-design/ant-design/pull/34518) +- 💄 修复 RangePicker `status` 相关样式丢失的问题。[#34509](https://github.com/ant-design/ant-design/pull/34509) [@MadCcc](https://github.com/MadCcc) +- 🛠 为 CssInJs 做准备,将 preClsName 生成放到外层。[#34482](https://github.com/ant-design/ant-design/pull/34482) [@LongHaoo](https://github.com/LongHaoo) +- 🛎 为动态改变 Form.Item 的 `hasFeedback` 时 Input 焦点丢失添加警告。[#34475](https://github.com/ant-design/ant-design/pull/34475) [@MadCcc](https://github.com/MadCcc) +- 🐞 修复 Input 有 `prefix` 或者 `suffix` 时 input 缺少某些 className 的问题。[#34474](https://github.com/ant-design/ant-design/pull/34474) [@MadCcc](https://github.com/MadCcc) + +## 4.19.2 + +`2022-03-13` + +- 🐞 修复 Dropdown 在边界情况下不会自动调整展示位置的问题。[#34390](https://github.com/ant-design/ant-design/pull/34390) +- 💄 缩小 PageHeader `extra` 内元素间距为 `8px`。[#34428](https://github.com/ant-design/ant-design/pull/34428) +- 🛠 导出 antd/es/config-provider 目录下的 css variable 函数以支持 ssr 的需求。[#34436](https://github.com/ant-design/ant-design/pull/34436) +- 🛠 使用 React hooks 重构 Menu。[#34433](https://github.com/ant-design/ant-design/pull/34433) +- Input + - 💄 修复大尺寸 Input 的字号问题。[#34381](https://github.com/ant-design/ant-design/pull/34381) + - 💄 修复 Input.Group 多余的错误边框样式。[#34412](https://github.com/ant-design/ant-design/pull/34412) +- Form + - 🐞 修复 Form.Item 在 `form.validateFields` 中移除时抛出 `Can't perform a React state update on an unmounted component` 警告的问题。[#34405](https://github.com/ant-design/ant-design/pull/34405) + - 🐞 修复 Form 组件当 `preserve` 为 `false` 时 `initialValues` 会被更改的问题。[#34411](https://github.com/ant-design/ant-design/pull/34411) +- Tooltip + - 💄 修复 Tooltip 在 Safari 下的内容宽度问题。[#34415](https://github.com/ant-design/ant-design/pull/34415) [@jiandandkl](https://github.com/jiandandkl) + - 💄 修复 Tooltip/Popover/Popconfirm 等组件箭头大小问题。[#34407](https://github.com/ant-design/ant-design/pull/34407) +- 💄 优化 Collapse 简洁模式的底边框。[#34366](https://github.com/ant-design/ant-design/pull/34366) [@PanStar](https://github.com/PanStar) +- TypeScript + - 🤖 修复 Input 不支持 `data-*` TS 定义的问题。[#34410](https://github.com/ant-design/ant-design/pull/34410) [@GitKou](https://github.com/GitKou) + - 🤖 修复 Transfer 的 `footer` 类型定义。[#34337](https://github.com/ant-design/ant-design/pull/34337) [@zomixi](https://github.com/zomixi) + +## 4.19.1 + +`2022-03-08` + +- 🐞 修复自定义状态相关的 less 编译错误。[#34350](htps://github.com/ant-dign/ant-design/pull/34350) + - 🐞 修复使用定制主题时 less 编译提示 `ReferenceError: colorPalette is not defined` 错误。 + - 🐞 修复引入 `antd/dist/antd.css` 时提示 `Error: Invalid class or id selector syntax` 错误。 +- 🐞 修复 Input.Passowrd 图标颜色错误。[#34354](https://github.com/ant-design/ant-design/pull/34354) +- 🐞 修复 ConfigProvider `csp` 有时在 Icon 上不会生效的问题。[#34356](https://github.com/ant-design/ant-design/pull/34356) + +## 4.19.0 + +`2022-03-08` + +- 💄 优化部分组件箭头样式。[#33710](https://github.com/ant-design/ant-design/pull/33710) + + + +- Input + - 🛠 引入 rc-input 重构 Input 组件为 function component。[#34206](https://github.com/ant-design/ant-design/pull/34206) + - 注意:由于从 class component 变为 function component,Input 组件的 `ref` 类型及内容已经更新,可以通过 `import { InputRef } from 'antd'` 引入。其中的 `input` 属性作为获取 DOM 的途径被保留,同时支持 `focus` 和 `blur` 等文档中支持的方法。 + - 🆕 新增 `clearIcon` 属性,支持自定义清除按钮。[#34325](https://github.com/ant-design/ant-design/pull/34325) +- Table + - 🆕 `column.filterSearch` 属性现在支持返回一个函数用于自定义搜索条件。[#34085](https://github.com/ant-design/ant-design/pull/34085) [@heiyu4585](https://github.com/heiyu4585) + - 🆕 `column.filterDropdown({ clearFilters })` 支持参数 `clearFilters({ confirm: false, closeDropdown: false })` 控制筛选。[#34120](https://github.com/ant-design/ant-design/pull/34120) [@heiyu4585](https://github.com/heiyu4585) + - ⌨️ 增加 `aria-sort` 属性以优化屏幕阅读器的使用体验。[#33603](https://github.com/ant-design/ant-design/pull/33603) [@dgreene1](https://github.com/dgreene1) + - 🐞 修复 Table 列筛选器中选择全部 Checkbox 状态问题。[#34295](https://github.com/ant-design/ant-design/pull/34295) +- 🆕 表单组件新增 `status` 属性以支持自定义状态。 + + - Transfer [#34098](https://github.com/ant-design/ant-design/pull/34098) + - AutoComplete [#34096](https://github.com/ant-design/ant-design/pull/34096) + - TreeSelect [#34093](https://github.com/ant-design/ant-design/pull/34093) + - Cascader [#34086](https://github.com/ant-design/ant-design/pull/34086) + - Select [#34084](https://github.com/ant-design/ant-design/pull/34084) + - DatePicker 和 TimePicker [#34073](https://github.com/ant-design/ant-design/pull/34073) + - Mentions [#34071](https://github.com/ant-design/ant-design/pull/34071) + - InputNumber [#34042](https://github.com/ant-design/ant-design/pull/34042) + - Input [#33995](https://github.com/ant-design/ant-design/pull/33995) + + + +- 🆕 InputNumber 组件支持 `controls={{ upIcon, downIcon }}` 用于自定义上下图标。[#33914](https://github.com/ant-design/ant-design/pull/33914) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Notification 组件弹窗位置新增支持 `top` / `bottom`。[#33871](https://github.com/ant-design/ant-design/pull/33871) [@heiyu4585](https://github.com/heiyu4585) +- 🆕 Select、Cascader、DatePicker 等组件新增 `placement` 用于自定义弹层方向。[#33641](https://github.com/ant-design/ant-design/pull/33541) [@ONLY-yours](https://github.com/ONLY-yours) +- 🆕 Dropdown 组件支持 `arrow={{ pointAtCenter: true }}` 用于指向元素正中间,并且新增 `top` `bottom` 两种 `placement` 位置。[#33658](https://github.com/ant-design/ant-design/pull/33658) +- 🆕 Skeleton.Input 添加 `block` 属性。[#33672](https://github.com/ant-design/ant-design/pull/33672) [@woochanleee](https://github.com/woochanleee) +- 🆕 合并 TimePicker `disabledHours`、`disabledMinutes`、`disabledSeconds` 至 `disabledTime` 以保持与 DatePicker 接口一致性。[#33503](https://github.com/ant-design/ant-design/pull/33503) +- 💄 修改部分边框颜色和进度条的背景色为透明色以适应有色背景。[#33506](https://github.com/ant-design/ant-design/pull/33506) +- 💄 Space 支持自定义 children 的 `key`。[#33607](https://github.com/ant-design/ant-design/pull/33607) [@qin20](https://github.com/qin20) +- 🐞 修复 Typography.Title 进入编辑模式时大小不一致的问题。[#34169](https://github.com/ant-design/ant-design/pull/34169) [@heiyu4585](https://github.com/heiyu4585) +- 🐞 修复 Form.Item 抛出 `React does not recognize the requiredMark prop on a DOM element` 的问题。[#34323](https://github.com/ant-design/ant-design/pull/34323) + ## 4.18.9 `2022-02-28` @@ -108,7 +199,7 @@ timeline: true - Typography - ⚡️ 优化 Typography 在配置 `tooltip` 时优先使用原生省略样式以提升性能。[#33669](https://github.com/ant-design/ant-design/pull/33669) - - 🐞 重构 Typography `ellipsis` 逻辑以修复 `children` 如果消费上游 Context 会报错的问题。 [#33725](https://github.com/ant-design/ant-design/pull/33725) + - 🐞 重构 Typography `ellipsis` 逻辑以修复 `children` 如果消费上游 Context 会报错的问题。[#33725](https://github.com/ant-design/ant-design/pull/33725) - Icon - 🐞 修复 `` 和 `` 不对齐的问题。[#33709](https://github.com/ant-design/ant-design/pull/33709) - 🐞 修复 `` 抖动的问题。[#33726](https://github.com/ant-design/ant-design/pull/33726) [@JX-Zhuang](https://github.com/JX-Zhuang) @@ -334,7 +425,7 @@ timeline: true - 🐞 修复 Button `ghost` 鼠标悬停样式。[#32289](https://github.com/ant-design/ant-design/pull/32289) - 🐞 修复 Button 配置 `loading` 时,无法触发 Tooltip 的问题。[#32158](https://github.com/ant-design/ant-design/pull/32158) - Pagination - - 🆕 Pagination 支持定制 `selectComponentClass`。 [#32132](https://github.com/ant-design/ant-design/pull/32132) [@JounQin](https://github.com/JounQin) + - 🆕 Pagination 支持定制 `selectComponentClass`。[#32132](https://github.com/ant-design/ant-design/pull/32132) [@JounQin](https://github.com/JounQin) - 💄 Pagination `simple` 属性下中翻页 input 增加 box-shadow。[#32528](https://github.com/ant-design/ant-design/pull/32528) [@chen-jingjie](https://github.com/chen-jingjie) - Upload - 🐞 修复 Upload `listStyle="picture"` 下加载中样式错位的问题。[#32664](https://github.com/ant-design/ant-design/pull/32664) @@ -387,7 +478,7 @@ timeline: true - 🤖 修复 Switch `id` 属性定义。[#32237](https://github.com/ant-design/ant-design/pull/32237) [@M-ZubairAhmed](https://github.com/M-ZubairAhmed) - 🤖 修复 Button 的 `type` 的 TS 类型定义。[#32004](https://github.com/ant-design/ant-design/pull/32004) [@jaredleechn](https://github.com/jaredleechn) - 🤖 完备 Pagination 的 `locale` TS 类型定义。[[#32128](https://github.com/ant-design/ant-design/pull/32128) [@JounQin](https://github.com/JounQin) - - 🤖 完善并导出 DropdownButton 的 `DropdownButtonType` TS 类型定义。 [[#31957](https://github.com/ant-design/ant-design/pull/31957) [@Dreamerryao](https://github.com/Dreamerryao) + - 🤖 完善并导出 DropdownButton 的 `DropdownButtonType` TS 类型定义。[[#31957](https://github.com/ant-design/ant-design/pull/31957) [@Dreamerryao](https://github.com/Dreamerryao) - 🤖 调整 List 组件 `rowKey` 类型为 React.key。[#32033](https://github.com/ant-design/ant-design/pull/32033) [@lironhl](https://github.com/lironhl) - 🐞 修复 DatePicker `ref` 类型。[#31993](https://github.com/ant-design/ant-design/pull/31993) [@acfasj](https://github.com/acfasj) - 🤖 更新 Drawer 中 `levelMove` 类型定义。[#30714](https://github.com/ant-design/ant-design/pull/30714) [@g0shed](https://github.com/g0shed) @@ -436,7 +527,7 @@ timeline: true - 🐞 修复 Progress 环形进度条 `success.strokeColor` 不生效的问题。[#31589](https://github.com/ant-design/ant-design/pull/31589) - 🐞 修复 Select 组件没有忽略 `getRawInputElement` 属性导致的类型报错问题。[#31566](https://github.com/ant-design/ant-design/pull/31566) [@aoilti](https://github.com/aoilti) - 🐞 修复 Pagination 的 `totalBoundaryShowSizeChanger` 属性类型错误。[#31549](https://github.com/ant-design/ant-design/pull/31549) [@Monty-Ma](https://github.com/Monty-Ma) -- 🐞 修复 Skeleton.Avatar `className` 重复应用的问题。 [#31536](https://github.com/ant-design/ant-design/pull/31536) [@Greatshock](https://github.com/Greatshock) +- 🐞 修复 Skeleton.Avatar `className` 重复应用的问题。[#31536](https://github.com/ant-design/ant-design/pull/31536) [@Greatshock](https://github.com/Greatshock) - 🌐 国际化 - 🇹🇷 为 Image 组件中 `预览` 文案增加土耳其语翻译。[#31593](https://github.com/ant-design/ant-design/pull/31593) [@mburakkalkan](https://github.com/mburakkalkan) - 🇰🇷 修复韩语中的错别字。[#31575](https://github.com/ant-design/ant-design/pull/31575) [@chatoo2412](https://github.com/chatoo2412) @@ -757,7 +848,7 @@ timeline: true - 🐞 修复 Modal 页脚里使用 href 按钮导致的间距丢失问题。[#29681](https://github.com/ant-design/ant-design/pull/29681) [@n0ruSh](https://github.com/n0ruSh) - 💄 修复 Input 组件配置附件元素时禁用样式异常的问题。[#29670](https://github.com/ant-design/ant-design/pull/29670) - 💄 优化 Form.Item 提示信息的鼠标显示样式。[#29650](https://github.com/ant-design/ant-design/pull/29650) -- 🇨🇿 修复 cs_CZ 语言环境中的错字。 [#29675](https://github.com/ant-design/ant-design/pull/29675) [@jvaclavik](https://github.com/jvaclavik) +- 🇨🇿 修复 cs_CZ 语言环境中的错字。[#29675](https://github.com/ant-design/ant-design/pull/29675) [@jvaclavik](https://github.com/jvaclavik) - 🇨🇦 添加 fr_CA 语言。[#29748](https://github.com/ant-design/ant-design/pull/29748) [@liufenghua808](https://github.com/liufenghua808) ## 4.13.1 @@ -857,7 +948,7 @@ timeline: true - TypeScript - 🤖 更新 Table TypeScript 定义 `dataSource` 至 `readonly`。[#29084](https://github.com/ant-design/ant-design/pull/29084) - Less - - 💄 增加 less 变量 `@progress-info-text-color`。 [#28981](https://github.com/ant-design/ant-design/pull/28981) [@yuxuan](https://github.com/yuxuan) + - 💄 增加 less 变量 `@progress-info-text-color`。[#28981](https://github.com/ant-design/ant-design/pull/28981) [@yuxuan](https://github.com/yuxuan) ## 4.11.3 @@ -996,7 +1087,7 @@ timeline: true - 🆕 多选模式下 `maxTagCount` 支持 `responsive`。[#28520](https://github.com/ant-design/ant-design/pull/28520) - 🆕 Slider 新增 range.draggableTrack 以支持范围刻度整体可拖拽。[#28592](https://github.com/ant-design/ant-design/pull/28592) - 🆕 `message` 新增 `onClick` 回调,会在消息被点击时触发。[#28148](https://github.com/ant-design/ant-design/pull/28148) [@ZeroTo0ne](https://github.com/ant-design/ant-design/pull/28148) -- 🆕 Descriptions 上可以统一设置 `labelStyle` 和 `contentStyle`。 [#28613](https://github.com/ant-design/ant-design/pull/28613) +- 🆕 Descriptions 上可以统一设置 `labelStyle` 和 `contentStyle`。[#28613](https://github.com/ant-design/ant-design/pull/28613) - 🆕 Form 的 `scrollToFirstError` 属性支持设置滚动的位置参数。[#28272](https://github.com/ant-design/ant-design/pull/28272) [@vouis](https://github.com/vouis) - 🆕 Steps 新增 reponsive 属性用于关闭响应式样式。[#28459](https://github.com/ant-design/ant-design/pull/28459) - 🌐 国际化 @@ -1387,7 +1478,7 @@ timeline: true - 🐞 修复 Form 使用 `help` 时出现的同构问题。[#26542](https://github.com/ant-design/ant-design/pull/26542) - 🐞 修复 Avatar 在 `display: none` 时不会正确缩放 fallback 文字的问题。[#26522](https://github.com/ant-design/ant-design/pull/26522) [@zhangyu1818](https://github.com/zhangyu1818) - TypeScript - - 🤖 Col 增加 `ColSize` 增加 `flex` 的定义。 [#26578](https://github.com/ant-design/ant-design/pull/26578) [@blaiz](https://github.com/blaiz) + - 🤖 Col 增加 `ColSize` 增加 `flex` 的定义。[#26578](https://github.com/ant-design/ant-design/pull/26578) [@blaiz](https://github.com/blaiz) - 🤖 修复 Tooltip/Popover `children` 定义不接受 ReactNode 的问题。[#26534](https://github.com/ant-design/ant-design/pull/26534) ## 4.6.2 diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index 50540b3c55f0..45f209602ca9 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; +import useState from 'rc-util/lib/hooks/useState'; import Button from '../button'; import { LegacyButtonType, ButtonProps, convertLegacyProps } from '../button/button'; -import useDestroyed from './hooks/useDestroyed'; export interface ActionButtonProps { type?: LegacyButtonType; @@ -21,8 +21,7 @@ function isThenable(thing?: PromiseLike): boolean { const ActionButton: React.FC = props => { const clickedRef = React.useRef(false); const ref = React.useRef(); - const isDestroyed = useDestroyed(); - const [loading, setLoading] = React.useState(false); + const [loading, setLoading] = useState(false); React.useEffect(() => { let timeoutId: any; @@ -45,9 +44,7 @@ const ActionButton: React.FC = props => { setLoading(true); returnValueOfOnOk!.then( (...args: any[]) => { - if (!isDestroyed()) { - setLoading(false); - } + setLoading(false, true); close(...args); clickedRef.current = false; }, @@ -56,9 +53,7 @@ const ActionButton: React.FC = props => { // eslint-disable-next-line no-console console.error(e); // See: https://github.com/ant-design/ant-design/issues/6183 - if (!isDestroyed()) { - setLoading(false); - } + setLoading(false, true); clickedRef.current = false; }, ); diff --git a/components/_util/getDataOrAriaProps.ts b/components/_util/getDataOrAriaProps.ts index ee4e271ec6ed..1984714db62b 100644 --- a/components/_util/getDataOrAriaProps.ts +++ b/components/_util/getDataOrAriaProps.ts @@ -1,8 +1,8 @@ export default function getDataOrAriaProps(props: any) { return Object.keys(props).reduce((prev: any, key: string) => { if ( - (key.substr(0, 5) === 'data-' || key.substr(0, 5) === 'aria-' || key === 'role') && - key.substr(0, 7) !== 'data-__' + (key.startsWith('data-') || key.startsWith('aria-') || key === 'role') && + !key.startsWith('data-__') ) { prev[key] = props[key]; } diff --git a/components/affix/index.tsx b/components/affix/index.tsx index 73d4ba6f48d6..1be9f0f545c7 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -33,6 +33,10 @@ export interface AffixProps { children: React.ReactNode; } +export interface InternalAffixProps extends AffixProps { + affixPrefixCls: string; +} + enum AffixStatus { None, Prepare, @@ -47,7 +51,7 @@ export interface AffixState { prevTarget: Window | HTMLElement | null; } -class Affix extends React.Component { +class Affix extends React.Component { static contextType = ConfigContext; state: AffixState = { @@ -250,14 +254,20 @@ class Affix extends React.Component { // =================== Render =================== render() { - const { getPrefixCls } = this.context; const { affixStyle, placeholderStyle } = this.state; - const { prefixCls, children } = this.props; + const { affixPrefixCls, children } = this.props; const className = classNames({ - [getPrefixCls('affix', prefixCls)]: !!affixStyle, + [affixPrefixCls]: !!affixStyle, }); - let props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange']); + let props = omit(this.props, [ + 'prefixCls', + 'offsetTop', + 'offsetBottom', + 'target', + 'onChange', + 'affixPrefixCls', + ]); // Omit this since `onTestUpdatePosition` only works on test. if (process.env.NODE_ENV === 'test') { props = omit(props as typeof props & { onTestUpdatePosition: any }, ['onTestUpdatePosition']); @@ -286,7 +296,20 @@ class Affix extends React.Component { } } -const AffixFC = React.forwardRef((props, ref) => ); +const AffixFC = React.forwardRef((props, ref) => { + const { prefixCls: customizePrefixCls } = props; + const { getPrefixCls } = React.useContext(ConfigContext); + + const affixPrefixCls = getPrefixCls('affix', customizePrefixCls); + + const AffixProps: InternalAffixProps = { + ...props, + + affixPrefixCls, + }; + + return ; +}); if (process.env.NODE_ENV !== 'production') { AffixFC.displayName = 'Affix'; diff --git a/components/alert/index.en-US.md b/components/alert/index.en-US.md index d0f9bdcee0ed..8b8992206bf7 100644 --- a/components/alert/index.en-US.md +++ b/components/alert/index.en-US.md @@ -21,7 +21,7 @@ Alert component for feedback. | banner | Whether to show as banner | boolean | false | | | closable | Whether Alert can be closed | boolean | - | | | closeText | Close text to show | ReactNode | - | | -| closeIcon | Custom close icon | ReactNode | | 4.17.0 | +| closeIcon | Custom close icon | ReactNode | `` | 4.17.0 | | description | Additional content of Alert | ReactNode | - | | | icon | Custom icon, effective when `showIcon` is true | ReactNode | - | | | message | Content of Alert | ReactNode | - | | diff --git a/components/alert/index.zh-CN.md b/components/alert/index.zh-CN.md index 3f99bfbc3305..8946f08330bd 100644 --- a/components/alert/index.zh-CN.md +++ b/components/alert/index.zh-CN.md @@ -22,7 +22,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8emPa3fjl/Alert.svg | banner | 是否用作顶部公告 | boolean | false | | | closable | 默认不显示关闭按钮 | boolean | - | | | closeText | 自定义关闭按钮 | ReactNode | - | | -| closeIcon | 自定义关闭 Icon | ReactNode | | 4.17.0 | +| closeIcon | 自定义关闭 Icon | ReactNode | `` | 4.17.0 | | description | 警告提示的辅助性文字介绍 | ReactNode | - | | | icon | 自定义图标,`showIcon` 为 true 时有效 | ReactNode | - | | | message | 警告提示内容 | ReactNode | - | | diff --git a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap index 2c0de46fd7fd..3a33dda07c25 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -136,7 +136,6 @@ exports[`renders ./components/auto-complete/demo/certain-category.md extend cont aria-label="search" class="anticon anticon-search" role="img" - style="color:#999999" >
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+
+
+
+
+
+
+
`; diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index 6e0dc91b0fc2..7c3bc24b8ced 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -3780,6 +3780,7 @@ exports[`renders ./components/date-picker/demo/status.md correctly 1`] = `
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
`; diff --git a/components/date-picker/demo/status.md b/components/date-picker/demo/status.md index 7a75ecd7bafa..c355a772dce5 100644 --- a/components/date-picker/demo/status.md +++ b/components/date-picker/demo/status.md @@ -21,6 +21,8 @@ const Status: React.FC = () => ( + + ); diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx index b22466ffa80a..1f9863aeb61d 100644 --- a/components/date-picker/generatePicker/generateRangePicker.tsx +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -8,6 +8,7 @@ import { } from 'infra-design-icons'; import { RangePicker as RCRangePicker } from 'rc-picker'; import { GenerateConfig } from 'rc-picker/lib/generate/index'; +import { PickerMode } from 'rc-picker/lib/interface'; import enUS from '../locale/en_US'; import { ConfigContext, ConfigConsumerProps } from '../../config-provider'; import SizeContext from '../../config-provider/SizeContext'; @@ -15,6 +16,8 @@ import LocaleReceiver from '../../locale-provider/LocaleReceiver'; import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util'; import { RangePickerProps, PickerLocale, getTimeProps, Components } from '.'; import { PickerComponentClass } from './interface'; +import { FormItemStatusContext } from '../../form/context'; +import { getFeedbackIcon, getMergedStatus, getStatusClassNames } from '../../_util/statusUtils'; export default function generateRangePicker( generateConfig: GenerateConfig, @@ -38,6 +41,23 @@ export default function generateRangePicker( } }; + renderFeedback = (prefixCls: string) => ( + + {({ hasFeedback, status: contextStatus }) => { + const { status: customStatus } = this.props; + const status = getMergedStatus(contextStatus, customStatus); + return hasFeedback && getFeedbackIcon(prefixCls, status); + }} + + ); + + renderSuffix = (prefixCls: string, mergedPicker?: PickerMode) => ( + <> + {mergedPicker === 'time' ? : } + {this.renderFeedback(prefixCls)} + + ); + renderPicker = (contextLocale: PickerLocale) => { const locale = { ...contextLocale, ...this.props.locale }; const { getPrefixCls, direction, getPopupContainer } = this.context; @@ -49,6 +69,7 @@ export default function generateRangePicker( size: customizeSize, bordered = true, placeholder, + status: customStatus, ...restProps } = this.props; const { format, showTime, picker } = this.props as any; @@ -69,39 +90,48 @@ export default function generateRangePicker( const mergedSize = customizeSize || size; return ( - - separator={ - - - - } - ref={this.pickerRef} - dropdownAlign={transPlacement2DropdownAlign(direction, placement)} - placeholder={getRangePlaceholder(picker, locale, placeholder)} - suffixIcon={picker === 'time' ? : } - clearIcon={} - prevIcon={} - nextIcon={} - superPrevIcon={} - superNextIcon={} - allowClear - transitionName={`${rootPrefixCls}-slide-up`} - {...restProps} - {...additionalOverrideProps} - className={classNames( - { - [`${prefixCls}-${mergedSize}`]: mergedSize, - [`${prefixCls}-borderless`]: !bordered, - }, - className, + + {({ hasFeedback, status: contextStatus }) => ( + + separator={ + + + + } + ref={this.pickerRef} + dropdownAlign={transPlacement2DropdownAlign(direction, placement)} + placeholder={getRangePlaceholder(picker, locale, placeholder)} + suffixIcon={this.renderSuffix(prefixCls, picker)} + clearIcon={} + prevIcon={} + nextIcon={} + superPrevIcon={} + superNextIcon={} + allowClear + transitionName={`${rootPrefixCls}-slide-up`} + {...restProps} + {...additionalOverrideProps} + className={classNames( + { + [`${prefixCls}-${mergedSize}`]: mergedSize, + [`${prefixCls}-borderless`]: !bordered, + }, + getStatusClassNames( + prefixCls, + getMergedStatus(contextStatus, customStatus), + hasFeedback, + ), + className, + )} + locale={locale!.lang} + prefixCls={prefixCls} + getPopupContainer={customGetPopupContainer || getPopupContainer} + generateConfig={generateConfig} + components={Components} + direction={direction} + /> )} - locale={locale!.lang} - prefixCls={prefixCls} - getPopupContainer={customGetPopupContainer || getPopupContainer} - generateConfig={generateConfig} - components={Components} - direction={direction} - /> + ); }} diff --git a/components/date-picker/generatePicker/index.tsx b/components/date-picker/generatePicker/index.tsx index f6341c972408..ee15764d8462 100644 --- a/components/date-picker/generatePicker/index.tsx +++ b/components/date-picker/generatePicker/index.tsx @@ -18,8 +18,9 @@ import PickerTag from '../PickerTag'; import { TimePickerLocale } from '../../time-picker'; import generateSinglePicker from './generateSinglePicker'; import generateRangePicker from './generateRangePicker'; -import { QuickPicker, IQuickDatePicker } from './QuickPicker'; import { tuple } from '../../_util/type'; +import { QuickPicker, IQuickDatePicker } from './QuickPicker'; +import { InputStatus } from '../../_util/statusUtils'; export const Components = { button: PickerButton, rangeItem: PickerTag }; @@ -83,6 +84,7 @@ type InjectDefaultProps = Omit< size?: SizeType; placement?: DataPickerPlacement; bordered?: boolean; + status?: InputStatus; }; export type PickerLocale = { diff --git a/components/dropdown/__tests__/index.test.js b/components/dropdown/__tests__/index.test.js index dc97a9bb8f82..a4009c40aec4 100644 --- a/components/dropdown/__tests__/index.test.js +++ b/components/dropdown/__tests__/index.test.js @@ -79,4 +79,24 @@ describe('Dropdown', () => { expect.stringContaining("[antd: Dropdown] You are using 'topCenter'"), ); }); + + // zombieJ: when replaced with react test lib, it may be mock fully content + it('dropdown should support auto adjust placement', () => { + const wrapper = mount( + menu
} visible> + + , + ); + + expect(wrapper.find('Trigger').prop('builtinPlacements')).toEqual( + expect.objectContaining({ + bottomLeft: expect.objectContaining({ + overflow: { + adjustX: 1, + adjustY: 1, + }, + }), + }), + ); + }); }); diff --git a/components/dropdown/dropdown.tsx b/components/dropdown/dropdown.tsx index 5293ffaeef56..27c9168f6c19 100644 --- a/components/dropdown/dropdown.tsx +++ b/components/dropdown/dropdown.tsx @@ -189,6 +189,7 @@ const Dropdown: DropdownInterface = props => { const builtinPlacements = getPlacements({ arrowPointAtCenter: typeof arrow === 'object' && arrow.pointAtCenter, + autoAdjustOverflow: true, }); return ( diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index aa87f7ba4491..1c30e40fbb71 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -82,7 +82,6 @@ &-placement-topLeft > &-arrow, &-placement-topRight > &-arrow { bottom: @popover-arrow-width * sqrt((1 / 2)) + 2px; - border-color: transparent @popover-bg @popover-bg transparent; box-shadow: 3px 3px 7px -3px fade(@black, 10%); transform: rotate(45deg); } @@ -104,7 +103,6 @@ &-placement-bottomLeft > &-arrow, &-placement-bottomRight > &-arrow { top: (@popover-arrow-width + 2px) * sqrt((1 / 2)); - border-color: @popover-bg transparent transparent @popover-bg; box-shadow: 2px 2px 5px -2px fade(@black, 10%); transform: rotate(-135deg) translateY(-0.5px); } diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index d879c2cab03b..2e64434ecea1 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -5,6 +5,7 @@ import { Field, FormInstance, FieldContext, ListContext } from 'rc-field-form'; import { FieldProps } from 'rc-field-form/lib/Field'; import { Meta, NamePath } from 'rc-field-form/lib/interface'; import { supportRef } from 'rc-util/lib/ref'; +import useState from 'rc-util/lib/hooks/useState'; import omit from 'rc-util/lib/omit'; import Row from '../grid/row'; import { ConfigContext } from '../config-provider'; @@ -132,7 +133,7 @@ function FormItem(props: FormItemProps): React.ReactElemen const [subFieldErrors, setSubFieldErrors] = useFrameState>({}); // >>>>> Current field errors - const [meta, setMeta] = React.useState(() => genEmptyMeta()); + const [meta, setMeta] = useState(() => genEmptyMeta()); const onMetaChange = (nextMeta: Meta & { destroy?: boolean }) => { // This keyInfo is not correct when field is removed @@ -141,7 +142,7 @@ function FormItem(props: FormItemProps): React.ReactElemen const keyInfo = listContext?.getKey(nextMeta.name); // Destroy will reset all the meta - setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta); + setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true); // Bump to parent since noStyle if (noStyle && notifyParentMetaChange) { @@ -261,6 +262,7 @@ function FormItem(props: FormItemProps): React.ReactElemen 'colon', 'extra', 'fieldKey', + 'requiredMark', 'getValueFromEvent', 'getValueProps', 'htmlFor', diff --git a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap index 2f47644a7115..2771c012d98d 100644 --- a/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/form/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -18730,6 +18730,1234 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
+
+
+ +
+
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 81ad892d2ebc..8b3a0b366faf 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -7872,6 +7872,137 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
+
+
+ +
+
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + + + + + + +
+
+
+
+
diff --git a/components/form/__tests__/list.test.js b/components/form/__tests__/list.test.js index bcb3ad000624..8f7778b0c6f9 100644 --- a/components/form/__tests__/list.test.js +++ b/components/form/__tests__/list.test.js @@ -1,6 +1,8 @@ import React from 'react'; import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; +import { render, fireEvent } from '@testing-library/react'; +import '@testing-library/jest-dom'; import Form from '..'; import Input from '../../input'; import Button from '../../button'; @@ -204,4 +206,52 @@ describe('Form.List', () => { const wrapper = mount(); expect(wrapper.render()).toMatchSnapshot(); }); + + it('no warning when reset in validate', async () => { + const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); + + const Demo = () => { + const [form] = Form.useForm(); + + React.useEffect(() => { + form.setFieldsValue({ + list: [1], + }); + }, []); + + return ( +
+ + {fields => + fields.map(field => ( + + + + )) + } + + +
+ ); + }; + + const { container } = render(); + fireEvent.click(container.querySelector('button')); + + await sleep(); + + expect(errorSpy).not.toHaveBeenCalled(); + + errorSpy.mockRestore(); + }); }); diff --git a/components/form/context.tsx b/components/form/context.tsx index 8ba6d2ac6b90..6ce2ac970dcf 100644 --- a/components/form/context.tsx +++ b/components/form/context.tsx @@ -3,6 +3,7 @@ import omit from 'rc-util/lib/omit'; import { Meta } from 'rc-field-form/lib/interface'; import { FormProvider as RcFormProvider } from 'rc-field-form'; import { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib/FormContext'; +import { FC, PropsWithChildren, useMemo } from 'react'; import { ColProps } from '../grid/col'; import { FormLabelAlign } from './interface'; import { RequiredMark } from './Form'; @@ -57,3 +58,11 @@ export interface FormItemStatusContextProps { } export const FormItemStatusContext = React.createContext({}); + +export const NoFormStatus: FC> = ({ children }: PropsWithChildren<{}>) => { + const emptyContext = useMemo(() => ({}), []); + + return ( + {children} + ); +}; diff --git a/components/form/demo/validate-static.md b/components/form/demo/validate-static.md index 1b9ed65b378d..cf9bca359aca 100644 --- a/components/form/demo/validate-static.md +++ b/components/form/demo/validate-static.md @@ -96,6 +96,10 @@ ReactDOM.render( + + + + @@ -163,7 +163,7 @@ exports[`Input.Password should support size 1`] = ` > diff --git a/components/input/__tests__/__snapshots__/Search.test.js.snap b/components/input/__tests__/__snapshots__/Search.test.js.snap index 09ac140a2bef..bebab65545ea 100644 --- a/components/input/__tests__/__snapshots__/Search.test.js.snap +++ b/components/input/__tests__/__snapshots__/Search.test.js.snap @@ -23,7 +23,6 @@ exports[`Input.Search rtl render component should be rendered correctly in RTL d aria-label="search" class="anticon anticon-search" role="img" - style="color: rgb(153, 153, 153);" > + + + + + + + +`; + +exports[`Input allowClear should change type when click 2`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 1`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 2`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 3`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 1`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 2`] = ` + + + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 3`] = ` + + + + + + + + + + +`; + +exports[`Input rtl render component should be rendered correctly in RTL direction 1`] = ` + +`; + +exports[`Input rtl render component should be rendered correctly in RTL direction 2`] = ` + +`; + +exports[`Input should support maxLength 1`] = ` + +`; + +exports[`Input should support size 1`] = ` + +`; + +exports[`Input should support size in form 1`] = ` +
+
+
+
+
+ +
+
+
+
+
+`; diff --git a/components/input/__tests__/index.test.tsx b/components/input/__tests__/index.test.tsx new file mode 100644 index 000000000000..edcdd4f99bb1 --- /dev/null +++ b/components/input/__tests__/index.test.tsx @@ -0,0 +1,413 @@ +import React, { useState } from 'react'; +import { mount } from 'enzyme'; +// eslint-disable-next-line import/no-unresolved +import Form from '../../form'; +import Input, { InputProps, InputRef } from '..'; +import mountTest from '../../../tests/shared/mountTest'; +import rtlTest from '../../../tests/shared/rtlTest'; + +describe('Input', () => { + const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); + + afterEach(() => { + errorSpy.mockReset(); + }); + + afterAll(() => { + errorSpy.mockRestore(); + }); + + mountTest(Input); + mountTest(Input.Group); + + rtlTest(Input); + rtlTest(Input.Group); + + it('should support maxLength', () => { + const wrapper = mount(); + expect(wrapper.render()).toMatchSnapshot(); + }); + + it('select()', () => { + const ref = React.createRef(); + mount(); + ref.current?.select(); + }); + + it('should support size', () => { + const wrapper = mount(); + expect(wrapper.find('input').hasClass('ant-input-lg')).toBe(true); + expect(wrapper.render()).toMatchSnapshot(); + }); + + it('should support size in form', () => { + const wrapper = mount( +
+ + + +
, + ); + expect(wrapper.find('input').hasClass('ant-input-lg')).toBe(true); + expect(wrapper.render()).toMatchSnapshot(); + }); + + describe('focus trigger warning', () => { + it('not trigger', () => { + const wrapper = mount(); + (wrapper.find('input').instance() as any).focus(); + wrapper.setProps({ + suffix: 'light', + }); + expect(errorSpy).not.toHaveBeenCalled(); + }); + it('trigger warning', () => { + const wrapper = mount(); + wrapper.find('input').first().getDOMNode().focus(); + wrapper.setProps({ + suffix: 'light', + }); + expect(errorSpy).toHaveBeenCalledWith( + 'Warning: [antd: Input] When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ', + ); + wrapper.unmount(); + }); + }); + + it('set mouse cursor position', () => { + const defaultValue = '11111'; + const valLength = defaultValue.length; + const ref = React.createRef(); + const wrapper = mount(); + ref.current?.setSelectionRange(valLength, valLength); + expect(wrapper.find('input').first().getDOMNode().selectionStart).toEqual(5); + expect(wrapper.find('input').first().getDOMNode().selectionEnd).toEqual(5); + }); +}); + +describe('prefix and suffix', () => { + it('should support className when has suffix', () => { + const wrapper = mount(); + expect(wrapper.getDOMNode().className.includes('my-class-name')).toBe(true); + expect(wrapper.find('input').getDOMNode().className.includes('my-class-name')).toBe(false); + }); + + it('should support className when has prefix', () => { + const wrapper = mount(); + expect(wrapper.getDOMNode().className.includes('my-class-name')).toBe(true); + expect(wrapper.find('input').getDOMNode().className.includes('my-class-name')).toBe(false); + }); + + it('should support hidden when has prefix or suffix', () => { + const wrapper = mount( + <> + + + , + ); + + expect(wrapper.find('.prefix-with-hidden').at(0).getDOMNode().hidden).toBe( + true, + ); + expect(wrapper.find('.suffix-with-hidden').at(0).getDOMNode().hidden).toBe( + true, + ); + }); +}); + +describe('Input setting hidden', () => { + it('should support hidden when has prefix or suffix or showCount or allowClear or addonBefore or addonAfter', () => { + const wrapper = mount( + <> + +